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

    ".concat(V,"

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

    [TOC]

    ",L()),A()),jt=jt.replace(/(__special_katext_id_\d+__)/g,function(rn,yi){var Ii=di[yi],Xn=Ii.type,xn=Ii.expression;return Object(ae.renderToString)(vn(xn)||"",{displayMode:Xn==="block",throwOnError:!1,output:"html"})}),jt=jt.replace(/▁/g,"\u2581\u2581\u2581"),v(),ge){var $t=document.createElement("div");return $t.innerHTML=jt,$t.innerText}return setTimeout(function(){return dr()},500),jt},[Ci]),$i=Object(D.useRef)();E.WebkitLineClamp=He,He&&(zt=Object(U.a)(Object(U.a)({},zt),E));function _n(oi){var Vt=oi.target;if(Vt.tagName.toUpperCase()==="IMG"){if(gt){var Ti=Vt.getAttribute("src");un(Ti),bn("image")}}else if(Vt.tagName.toUpperCase()==="A"){var jt=Vt.getAttribute("href");if(jt.indexOf("office")>-1)oi.preventDefault(),un(jt),bn("office");else if(jt.indexOf("application/pdf")>-1)oi.preventDefault(),un(jt),bn("pdf");else if(jt.indexOf("text/html")>-1)oi.preventDefault(),un(jt),bn("html");else if(jt.startsWith("#")){oi.preventDefault();var di=document.getElementById(jt.replace("#",""));di&&di.scrollIntoView(!0)}}}var dr=function(){var Vt,Ti=(Vt=$i.current)===null||Vt===void 0?void 0:Vt.querySelectorAll("video");Ti==null||Ti.forEach(function(jt){if(jt.oncontextmenu=function(){return!1},jt.src.indexOf(".m3u8")>-1&&!jt.canPlayType("application/vnd.apple.mpegurl")){if(Y.a.isSupported()){var di=new Y.a;di.loadSource(jt.src),di.attachMedia(jt)}}})};Object(D.useEffect)(function(){if($i.current&&Qi&&(Qi.match(gn)&&window.PR.prettyPrint()),$i.current)return $i.current.addEventListener("click",_n),function(){$i.current.removeEventListener("click",_n),v(),A()}},[Qi,$i.current,_n]);var En=function(Vt){if(!q)return;Vt.target.nodeName==="IMG"?(Ai.current.style.zIndex=1,Ai.current.style.display="flex",Ai.current.style.width=Vt.target.clientWidth+"px",Ai.current.style.height=Vt.target.clientHeight+"px",Ai.current.style.top=Vt.target.offsetTop+"px",Ai.current.style.left=Vt.target.offsetLeft+"px",Zi.current.src=Vt.target.getAttribute("src")):Ai.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:$i,style:Object(U.a)({},zt),className:"".concat(z||""," markdown-body ").concat(mn.a.mdBody),onMouseOver:En,dangerouslySetInnerHTML:{__html:Qi}}),g.a.createElement("div",{ref:Ai,className:mn.a.button},g.a.createElement($.a,null,g.a.createElement(X.a,{onClick:function(){return zn()}},"\u88C1\u526A"),g.a.createElement(X.a,{onClick:function(){return Vn()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Zi,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(ue.a,{close:!0,data:zi,type:zi!=null&&zi.length?kn:"",style:Object(U.a)({},Hi),onClose:function(){return un("")}}))}},"9VGf":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return P});var re=Z("q1tI"),$=Z.n(re);function P(X,U){var k=Object(re.useRef)();Object(re.useEffect)(function(){k.current=X}),Object(re.useEffect)(function(){function G(){k.current()}if(U!==null){var W=setInterval(G,U);return function(){return clearInterval(W)}}},[U])}},BU3w:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return k});var re=Z("MNnm"),$="rc-util-key";function P(G){if(G.attachTo)return G.attachTo;var W=document.querySelector("head");return W||document.body}function X(G){var W,i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(re.a)())return null;var D=document.createElement("style");if((W=i.csp)===null||W===void 0?void 0:W.nonce){var g;D.nonce=(g=i.csp)===null||g===void 0?void 0:g.nonce}D.innerHTML=G;var p=P(i),m=p.firstChild;return i.prepend&&p.prepend?p.prepend(D):i.prepend&&m?p.insertBefore(D,m):p.appendChild(D),D}var U=new Map;function k(G,W){var i=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},D=P(i);if(!U.has(D)){var g=X("",i),p=g.parentNode;U.set(D,p),p.removeChild(g)}var m=Array.from(U.get(D).children).find(function(h){return h.tagName==="STYLE"&&h[$]===W});if(m){var u,o;if(((u=i.csp)===null||u===void 0?void 0:u.nonce)&&m.nonce!==((o=i.csp)===null||o===void 0?void 0:o.nonce)){var f;m.nonce=(f=i.csp)===null||f===void 0?void 0:f.nonce}return m.innerHTML!==G&&(m.innerHTML=G),m}var l=X(G,i);return l[$]=W,l}},Bd2K:function(ht,be,Z){(function(re){re(Z("VrN/"),Z("osHv"))})(function(re){re.defineOption("autoCloseTags",!1,function(i,D,g){if(g!=re.Init&&g&&i.removeKeyMap("autoCloseTags"),!D)return;var p={name:"autoCloseTags"};(typeof D!="object"||D.whenClosing!==!1)&&(p["'/'"]=function(m){return k(m)}),(typeof D!="object"||D.whenOpening!==!1)&&(p["'>'"]=function(m){return X(m)}),i.addKeyMap(p)});var $=["area","base","br","col","command","embed","hr","img","input","keygen","link","meta","param","source","track","wbr"],P=["applet","blockquote","body","button","div","dl","fieldset","form","frameset","h1","h2","h3","h4","h5","h6","head","html","iframe","layer","legend","object","ol","p","select","table","ul"];function X(i){if(i.getOption("disableInput"))return re.Pass;for(var D=i.listSelections(),g=[],p=i.getOption("autoCloseTags"),m=0;mu.ch&&(a=a.slice(0,a.length-o.end+u.ch));var S=a.toLowerCase();if(!a||o.type=="string"&&(o.end!=u.ch||!/[\"\']/.test(o.string.charAt(o.string.length-1))||o.string.length==1)||o.type=="tag"&&h.close||o.string.indexOf("/")==u.ch-o.start-1||A&&G(A,S)>-1||W(i,f.mode.xmlCurrentContext&&f.mode.xmlCurrentContext(l)||[],a,u,!0))return re.Pass;var L=typeof p=="object"&&p.emptyTags;if(L&&G(L,a)>-1){g[m]={text:"/>",newPos:re.Pos(u.line,u.ch+2)};continue}var O=E&&G(E,S)>-1;g[m]={indent:O,text:">"+(O?` `:"")+"",newPos:O?re.Pos(u.line+1,0):re.Pos(u.line,u.ch+1)}}for(var C=typeof p=="object"&&p.dontIndentOnAutoClose,m=D.length-1;m>=0;m--){var T=g[m];i.replaceRange(T.text,D[m].head,D[m].anchor,"+insert");var x=i.listSelections().slice(0);x[m]={head:T.newPos,anchor:T.newPos},i.setSelections(x),!C&&T.indent&&(i.indentLine(T.newPos.line,null,!0),i.indentLine(T.newPos.line+1,null,!0))}}function U(i,D){for(var g=i.listSelections(),p=[],m=D?"/":""&&(A+=">"),p[f]=A}if(i.replaceSelections(p),g=i.listSelections(),!o)for(var f=0;f=0&&D[l]==g;l--)++f;p=o.to;for(var l=1;l0){for(var D=0;D1&&arguments[1]!==void 0?arguments[1]:"",D=[],g=0;gk,re.serviceIds.set(k,G),G}function U(k){return function(G,W,i){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");P(k,G,i,!0)}}},DlQD:function(ht,be,Z){(function(re,$){ht.exports=$()})(this,function(){"use strict";function re(ve,ce){for(var fe=0;feve.length)&&(ce=ve.length);for(var fe=0,ne=new Array(ce);fe=ve.length?{done:!0}:{done:!1,value:ve[ne++]}}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}return fe=ve[Symbol.iterator](),fe.next.bind(fe)}function k(ve,ce){return ce={exports:{}},ve(ce,ce.exports),ce.exports}var G=k(function(ve){function ce(){return{baseUrl:null,breaks:!1,gfm:!0,headerIds:!0,headerPrefix:"",highlight:null,langPrefix:"language-",mangle:!0,pedantic:!1,renderer:null,sanitize:!1,sanitizer:null,silent:!1,smartLists:!1,smartypants:!1,tokenizer:null,walkTokens:null,xhtml:!1}}function fe(ne){ve.exports.defaults=ne}ve.exports={defaults:ce(),getDefaults:ce,changeDefaults:fe}}),W=G.defaults,i=G.getDefaults,D=G.changeDefaults,g=/[&<>"']/,p=/[&<>"']/g,m=/[<>"']|&(?!#?\w+;)/,u=/[<>"']|&(?!#?\w+;)/g,o={"&":"&","<":"<",">":">",'"':""","'":"'"},f=function(ce){return o[ce]};function l(ve,ce){if(ce){if(g.test(ve))return ve.replace(p,f)}else if(m.test(ve))return ve.replace(u,f);return ve}var h=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function a(ve){return ve.replace(h,function(ce,fe){return fe=fe.toLowerCase(),fe==="colon"?":":fe.charAt(0)==="#"?fe.charAt(1)==="x"?String.fromCharCode(parseInt(fe.substring(2),16)):String.fromCharCode(+fe.substring(1)):""})}var s=/(^|[^\[])\^/g;function A(ve,ce){ve=ve.source||ve,ce=ce||"";var fe={replace:function(ie,oe){return oe=oe.source||oe,oe=oe.replace(s,"$1"),ve=ve.replace(ie,oe),fe},getRegex:function(){return new RegExp(ve,ce)}};return fe}var E=/[^\w:]/g,S=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function L(ve,ce,fe){if(ve){var ne;try{ne=decodeURIComponent(a(fe)).replace(E,"").toLowerCase()}catch(ie){return null}if(ne.indexOf("javascript:")===0||ne.indexOf("vbscript:")===0||ne.indexOf("data:")===0)return null}ce&&!S.test(fe)&&(fe=c(ce,fe));try{fe=encodeURI(fe).replace(/%25/g,"%")}catch(ie){return null}return fe}var O={},C=/^[^:]+:\/*[^/]*$/,T=/^([^:]+:)[\s\S]*$/,x=/^([^:]+:\/*[^/]*)[\s\S]*$/;function c(ve,ce){O[" "+ve]||(C.test(ve)?O[" "+ve]=ve+"/":O[" "+ve]=F(ve,"/",!0)),ve=O[" "+ve];var fe=ve.indexOf(":")===-1;return ce.substring(0,2)==="//"?fe?ce:ve.replace(T,"$1")+ce:ce.charAt(0)==="/"?fe?ce:ve.replace(x,"$1")+ce:ve+ce}var w={exec:function(){}};function v(ve){for(var ce=1,fe,ne;ce=0&&ye[Ue]==="\\";)Le=!Le;return Le?"|":" |"}),ne=fe.split(/ \|/),ie=0;if(ne.length>ce)ne.splice(ce);else for(;ne.length=ne.length?ie.slice(ne.length):ie}).join(` `)}var Ee=function(){function ve(fe){this.options=fe||N}var ce=ve.prototype;return ce.space=function(ne){var ie=this.rules.block.newline.exec(ne);if(ie)return ie[0].length>1?{type:"space",raw:ie[0]}:{raw:` `}},ce.code=function(ne,ie){var oe=this.rules.block.code.exec(ne);if(oe){var le=ie[ie.length-1];if(le&&le.type==="paragraph")return{raw:oe[0],text:oe[0].trimRight()};var ye=oe[0].replace(/^ {4}/gm,"");return{type:"code",raw:oe[0],codeBlockStyle:"indented",text:this.options.pedantic?ye:b(ye,` `)}}},ce.fences=function(ne){var ie=this.rules.block.fences.exec(ne);if(ie){var oe=ie[0],le=Oe(oe,ie[3]||"");return{type:"code",raw:oe,lang:ie[2]?ie[2].trim():ie[2],text:le}}},ce.heading=function(ne){var ie=this.rules.block.heading.exec(ne);if(ie)return{type:"heading",raw:ie[0],depth:ie[1].length,text:ie[2]}},ce.nptable=function(ne){var ie=this.rules.block.nptable.exec(ne);if(ie){var oe={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(` `):[],raw:ie[0]};if(oe.header.length===oe.align.length){var le=oe.align.length,ye;for(ye=0;ye ?/gm,"");return{type:"blockquote",raw:ie[0],text:oe}}},ce.list=function(ne){var ie=this.rules.block.list.exec(ne);if(ie){for(var oe=ie[0],le=ie[2],ye=le.length>1,Le=le[le.length-1]===")",Ue={type:"list",raw:oe,ordered:ye,start:ye?+le.slice(0,-1):"",loose:!1,items:[]},Ze=ie[0].match(this.rules.block.item),mt=!1,ft,Ct,xt,Qe,Lt,vt,Ft,Pt=Ze.length,Rt=0;Rt1||this.options.smartLists&&xt!==le)&&(Qe=Ze.slice(Rt+1).join(` `),Ue.raw=Ue.raw.substring(0,Ue.raw.length-Qe.length),Rt=Pt-1)),Lt=mt||/\n\n(?!\s*$)/.test(ft),Rt!==Pt-1&&(mt=ft.charAt(ft.length-1)===` `,Lt||(Lt=mt)),Lt&&(Ue.loose=!0),vt=/^\[[ xX]\] /.test(ft),Ft=void 0,vt&&(Ft=ft[1]!==" ",ft=ft.replace(/^\[[ xX]\] +/,"")),Ue.items.push({type:"list_item",raw:oe,task:vt,checked:Ft,loose:Lt,text:ft});return Ue}},ce.html=function(ne){var ie=this.rules.block.html.exec(ne);if(ie)return{type:this.options.sanitize?"paragraph":"html",raw:ie[0],pre:!this.options.sanitizer&&(ie[1]==="pre"||ie[1]==="script"||ie[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):ee(ie[0]):ie[0]}},ce.def=function(ne){var ie=this.rules.block.def.exec(ne);if(ie){ie[3]&&(ie[3]=ie[3].substring(1,ie[3].length-1));var oe=ie[1].toLowerCase().replace(/\s+/g," ");return{tag:oe,raw:ie[0],href:ie[2],title:ie[3]}}},ce.table=function(ne){var ie=this.rules.block.table.exec(ne);if(ie){var oe={type:"table",header:Y(ie[1].replace(/^ *| *\| *$/g,"")),align:ie[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:ie[3]?ie[3].replace(/\n$/,"").split(` `):[]};if(oe.header.length===oe.align.length){oe.raw=ie[0];var le=oe.align.length,ye;for(ye=0;ye/i.test(le[0])&&(ie=!1),!oe&&/^<(pre|code|kbd|script)(\s|>)/i.test(le[0])?oe=!0:oe&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(le[0])&&(oe=!1),{type:this.options.sanitize?"text":"html",raw:le[0],inLink:ie,inRawBlock:oe,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ee(le[0]):le[0]}},ce.link=function(ne){var ie=this.rules.inline.link.exec(ne);if(ie){var oe=ae(ie[2],"()");if(oe>-1){var le=ie[0].indexOf("!")===0?5:4,ye=le+ie[1].length+oe;ie[2]=ie[2].substring(0,oe),ie[0]=ie[0].substring(0,ye).trim(),ie[3]=""}var Le=ie[2],Ue="";if(this.options.pedantic){var Ze=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Le);Ze?(Le=Ze[1],Ue=Ze[3]):Ue=""}else Ue=ie[3]?ie[3].slice(1,-1):"";Le=Le.trim().replace(/^<([\s\S]*)>$/,"$1");var mt=ue(ie,{href:Le&&Le.replace(this.rules.inline._escapes,"$1"),title:Ue&&Ue.replace(this.rules.inline._escapes,"$1")},ie[0]);return mt}},ce.reflink=function(ne,ie){var oe;if((oe=this.rules.inline.reflink.exec(ne))||(oe=this.rules.inline.nolink.exec(ne))){var le=(oe[2]||oe[1]).replace(/\s+/g," ");if(le=ie[le.toLowerCase()],!le||!le.href){var ye=oe[0].charAt(0);return{type:"text",raw:ye,text:ye}}var Le=ue(oe,le,oe[0]);return Le}},ce.strong=function(ne,ie,oe){oe===void 0&&(oe="");var le=this.rules.inline.strong.start.exec(ne);if(le&&(!le[1]||le[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*ne.length);var ye=le[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ye.lastIndex=0;for(var Le;(le=ye.exec(ie))!=null;)if(Le=this.rules.inline.strong.middle.exec(ie.slice(0,le.index+3)),Le)return{type:"strong",raw:ne.slice(0,Le[0].length),text:ne.slice(2,Le[0].length-2)}}},ce.em=function(ne,ie,oe){oe===void 0&&(oe="");var le=this.rules.inline.em.start.exec(ne);if(le&&(!le[1]||le[1]&&(oe===""||this.rules.inline.punctuation.exec(oe)))){ie=ie.slice(-1*ne.length);var ye=le[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ye.lastIndex=0;for(var Le;(le=ye.exec(ie))!=null;)if(Le=this.rules.inline.em.middle.exec(ie.slice(0,le.index+2)),Le)return{type:"em",raw:ne.slice(0,Le[0].length),text:ne.slice(1,Le[0].length-1)}}},ce.codespan=function(ne){var ie=this.rules.inline.code.exec(ne);if(ie){var oe=ie[2].replace(/\n/g," "),le=/[^ ]/.test(oe),ye=oe.startsWith(" ")&&oe.endsWith(" ");return le&&ye&&(oe=oe.substring(1,oe.length-1)),oe=ee(oe,!0),{type:"codespan",raw:ie[0],text:oe}}},ce.br=function(ne){var ie=this.rules.inline.br.exec(ne);if(ie)return{type:"br",raw:ie[0]}},ce.del=function(ne){var ie=this.rules.inline.del.exec(ne);if(ie)return{type:"del",raw:ie[0],text:ie[1]}},ce.autolink=function(ne,ie){var oe=this.rules.inline.autolink.exec(ne);if(oe){var le,ye;return oe[2]==="@"?(le=ee(this.options.mangle?ie(oe[1]):oe[1]),ye="mailto:"+le):(le=ee(oe[1]),ye=le),{type:"link",raw:oe[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},ce.url=function(ne,ie){var oe;if(oe=this.rules.inline.url.exec(ne)){var le,ye;if(oe[2]==="@")le=ee(this.options.mangle?ie(oe[0]):oe[0]),ye="mailto:"+le;else{var Le;do Le=oe[0],oe[0]=this.rules.inline._backpedal.exec(oe[0])[0];while(Le!==oe[0]);le=ee(oe[0]),oe[1]==="www."?ye="http://"+le:ye=le}return{type:"link",raw:oe[0],text:le,href:ye,tokens:[{type:"text",raw:le,text:le}]}}},ce.inlineText=function(ne,ie,oe){var le=this.rules.inline.text.exec(ne);if(le){var ye;return ie?ye=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(le[0]):ee(le[0]):le[0]:ye=ee(this.options.smartypants?oe(le[0]):le[0]),{type:"text",raw:le[0],text:ye}}},ve}(),xe=j.noopTest,Ae=j.edit,Re=j.merge,pe={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:[^\\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:xe,table:xe,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};pe._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,pe._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,pe.def=Ae(pe.def).replace("label",pe._label).replace("title",pe._title).getRegex(),pe.bullet=/(?:[*+-]|\d{1,9}[.)])/,pe.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,pe.item=Ae(pe.item,"gm").replace(/bull/g,pe.bullet).getRegex(),pe.list=Ae(pe.list).replace(/bull/g,pe.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+pe.def.source+")").getRegex(),pe._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",pe._comment=//,pe.html=Ae(pe.html,"i").replace("comment",pe._comment).replace("tag",pe._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),pe.paragraph=Ae(pe._paragraph).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.blockquote=Ae(pe.blockquote).replace("paragraph",pe.paragraph).getRegex(),pe.normal=Re({},pe),pe.gfm=Re({},pe.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),pe.gfm.nptable=Ae(pe.gfm.nptable).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.gfm.table=Ae(pe.gfm.table).replace("hr",pe.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html",")|<(?:script|pre|style|!--)").replace("tag",pe._tag).getRegex(),pe.pedantic=Re({},pe.normal,{html:Ae(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+? *(?:\\n{2,}|\\s*$)|\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",pe._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:xe,paragraph:Ae(pe.normal._paragraph).replace("hr",pe.hr).replace("heading",` *#{1,6} *[^ ]`).replace("lheading",pe.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var he={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:xe,tag:"^comment|^|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^|^",link:/^!?\[(label)\]\(\s*(href)(?:\s+(title))?\s*\)/,reflink:/^!?\[(label)\]\[(?!\s*\])((?:\\[\[\]]?|[^\[\]\\])+)\]/,nolink:/^!?\[(?!\s*\])((?:\[[^\[\]]*\]|\\[\[\]]|[^\[\]])*)\](?:\[\])?/,reflinkSearch:"reflink|nolink(?!\\()",strong:{start:/^(?:(\*\*(?=[*punctuation]))|\*\*)(?![\s])|__/,middle:/^\*\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*\*$|^__(?![\s])((?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?)__$/,endAst:/[^punctuation\s]\*\*(?!\*)|[punctuation]\*\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]__(?!_)(?:(?=[punctuation\s])|$)/},em:{start:/^(?:(\*(?=[punctuation]))|\*)(?![*\s])|_/,middle:/^\*(?:(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)|\*(?:(?!overlapSkip)(?:[^*]|\\\*)|overlapSkip)*?\*)+?\*$|^_(?![_\s])(?:(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)|_(?:(?!overlapSkip)(?:[^_]|\\_)|overlapSkip)*?_)+?_$/,endAst:/[^punctuation\s]\*(?!\*)|[punctuation]\*(?!\*)(?:(?=[punctuation\s]|$))/,endUnd:/[^\s]_(?!_)(?:(?=[punctuation\s])|$)/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:xe,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\?@\\[\\]`^{|}~",he.punctuation=Ae(he.punctuation).replace(/punctuation/g,he._punctuation).getRegex(),he._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",he._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",he.em.start=Ae(he.em.start).replace(/punctuation/g,he._punctuation).getRegex(),he.em.middle=Ae(he.em.middle).replace(/punctuation/g,he._punctuation).replace(/overlapSkip/g,he._overlapSkip).getRegex(),he.em.endAst=Ae(he.em.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.em.endUnd=Ae(he.em.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.start=Ae(he.strong.start).replace(/punctuation/g,he._punctuation).getRegex(),he.strong.middle=Ae(he.strong.middle).replace(/punctuation/g,he._punctuation).replace(/blockSkip/g,he._blockSkip).getRegex(),he.strong.endAst=Ae(he.strong.endAst,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.strong.endUnd=Ae(he.strong.endUnd,"g").replace(/punctuation/g,he._punctuation).getRegex(),he.blockSkip=Ae(he._blockSkip,"g").getRegex(),he.overlapSkip=Ae(he._overlapSkip,"g").getRegex(),he._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,he._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,he._email=/[a-zA-Z0-9.!#$%&'*+/=?^_`{|}~-]+(@)[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?(?:\.[a-zA-Z0-9](?:[a-zA-Z0-9-]{0,61}[a-zA-Z0-9])?)+(?![-_])/,he.autolink=Ae(he.autolink).replace("scheme",he._scheme).replace("email",he._email).getRegex(),he._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,he.tag=Ae(he.tag).replace("comment",pe._comment).replace("attribute",he._attribute).getRegex(),he._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,he._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,he._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,he.link=Ae(he.link).replace("label",he._label).replace("href",he._href).replace("title",he._title).getRegex(),he.reflink=Ae(he.reflink).replace("label",he._label).getRegex(),he.reflinkSearch=Ae(he.reflinkSearch,"g").replace("reflink",he.reflink).replace("nolink",he.nolink).getRegex(),he.normal=Re({},he),he.pedantic=Re({},he.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Ae(/^!?\[(label)\]\((.*?)\)/).replace("label",he._label).getRegex(),reflink:Ae(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",he._label).getRegex()}),he.gfm=Re({},he.normal,{escape:Ae(he.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\.5&&(ne="x"+ne.toString(16)),ce+="&#"+ne+";";return ce}var je=function(){function ve(fe){this.tokens=[],this.tokens.links=Object.create(null),this.options=fe||et,this.options.tokenizer=this.options.tokenizer||new Ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var ne={block:We.normal,inline:it.normal};this.options.pedantic?(ne.block=We.pedantic,ne.inline=it.pedantic):this.options.gfm&&(ne.block=We.gfm,this.options.breaks?ne.inline=it.breaks:ne.inline=it.gfm),this.tokenizer.rules=ne}ve.lex=function(ne,ie){var oe=new ve(ie);return oe.lex(ne)};var ce=ve.prototype;return ce.lex=function(ne){return ne=ne.replace(/\r\n|\r/g,` `).replace(/\t/g," "),this.blockTokens(ne,this.tokens,!0),this.inline(this.tokens),this.tokens},ce.blockTokens=function(ne,ie,oe){ie===void 0&&(ie=[]),oe===void 0&&(oe=!0),ne=ne.replace(/^ +$/gm,"");for(var le,ye,Le,Ue;ne;){if(le=this.tokenizer.space(ne)){ne=ne.substring(le.raw.length),le.type&&ie.push(le);continue}if(le=this.tokenizer.code(ne,ie)){ne=ne.substring(le.raw.length),le.type?ie.push(le):(Ue=ie[ie.length-1],Ue.raw+=` `+le.raw,Ue.text+=` `+le.text);continue}if(le=this.tokenizer.fences(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.heading(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.nptable(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.hr(ne)){ne=ne.substring(le.raw.length),ie.push(le);continue}if(le=this.tokenizer.blockquote(ne)){ne=ne.substring(le.raw.length),le.tokens=this.blockTokens(le.text,[],oe),ie.push(le);continue}if(le=this.tokenizer.list(ne)){for(ne=ne.substring(le.raw.length),Le=le.items.length,ye=0;ye0)for(;(Ze=this.tokenizer.rules.inline.reflinkSearch.exec(Ue))!=null;)mt.includes(Ze[0].slice(Ze[0].lastIndexOf("[")+1,-1))&&(Ue=Ue.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ze=this.tokenizer.rules.inline.blockSkip.exec(Ue))!=null;)Ue=Ue.slice(0,Ze.index)+"["+"a".repeat(Ze[0].length-2)+"]"+Ue.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;ne;){if(Le=this.tokenizer.escape(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.tag(ne,oe,le)){ne=ne.substring(Le.raw.length),oe=Le.inLink,le=Le.inRawBlock,ie.push(Le);continue}if(Le=this.tokenizer.link(ne)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,le)),ie.push(Le);continue}if(Le=this.tokenizer.reflink(ne,this.tokens.links)){ne=ne.substring(Le.raw.length),Le.type==="link"&&(Le.tokens=this.inlineTokens(Le.text,[],!0,le)),ie.push(Le);continue}if(Le=this.tokenizer.strong(ne,Ue,ye)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ie.push(Le);continue}if(Le=this.tokenizer.em(ne,Ue,ye)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ie.push(Le);continue}if(Le=this.tokenizer.codespan(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.br(ne)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.del(ne)){ne=ne.substring(Le.raw.length),Le.tokens=this.inlineTokens(Le.text,[],oe,le),ie.push(Le);continue}if(Le=this.tokenizer.autolink(ne,Pe)){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(!oe&&(Le=this.tokenizer.url(ne,Pe))){ne=ne.substring(Le.raw.length),ie.push(Le);continue}if(Le=this.tokenizer.inlineText(ne,le,at)){ne=ne.substring(Le.raw.length),ye=Le.raw.slice(-1),ie.push(Le);continue}if(ne){var ft="Infinite loop on byte: "+ne.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}return ie},$(ve,null,[{key:"rules",get:function(){return{block:We,inline:it}}}]),ve}(),$e=G.defaults,se=j.cleanUrl,_e=j.escape,Te=function(){function ve(fe){this.options=fe||$e}var ce=ve.prototype;return ce.code=function(ne,ie,oe){var le=(ie||"").match(/\S*/)[0];if(this.options.highlight){var ye=this.options.highlight(ne,le);ye!=null&&ye!==ne&&(oe=!0,ne=ye)}return le?'
    '+(oe?ne:_e(ne,!0))+`
    `:"
    "+(oe?ne:_e(ne,!0))+`
    `},ce.blockquote=function(ne){return`
    `+ne+`
    `},ce.html=function(ne){return ne},ce.heading=function(ne,ie,oe,le){return this.options.headerIds?"'+ne+" `:""+ne+" `},ce.hr=function(){return this.options.xhtml?`
    `:`
    `},ce.list=function(ne,ie,oe){var le=ie?"ol":"ul",ye=ie&&oe!==1?' start="'+oe+'"':"";return"<"+le+ye+`> `+ne+" `},ce.listitem=function(ne){return"
  • "+ne+`
  • `},ce.checkbox=function(ne){return" "},ce.paragraph=function(ne){return"

    "+ne+`

    `},ce.table=function(ne,ie){return ie&&(ie=""+ie+""),` `+ne+` `+ie+`
    `},ce.tablerow=function(ne){return` `+ne+` `},ce.tablecell=function(ne,ie){var oe=ie.header?"th":"td",le=ie.align?"<"+oe+' align="'+ie.align+'">':"<"+oe+">";return le+ne+" `},ce.strong=function(ne){return""+ne+""},ce.em=function(ne){return""+ne+""},ce.codespan=function(ne){return""+ne+""},ce.br=function(){return this.options.xhtml?"
    ":"
    "},ce.del=function(ne){return""+ne+""},ce.link=function(ne,ie,oe){if(ne=se(this.options.sanitize,this.options.baseUrl,ne),ne===null)return oe;var le='",le},ce.image=function(ne,ie,oe){if(ne=se(this.options.sanitize,this.options.baseUrl,ne),ne===null)return oe;var le=''+oe+'":">",le},ce.text=function(ne){return ne},ve}(),Se=function(){function ve(){}var ce=ve.prototype;return ce.strong=function(ne){return ne},ce.em=function(ne){return ne},ce.codespan=function(ne){return ne},ce.del=function(ne){return ne},ce.html=function(ne){return ne},ce.text=function(ne){return ne},ce.link=function(ne,ie,oe){return""+oe},ce.image=function(ne,ie,oe){return""+oe},ce.br=function(){return""},ve}(),Ge=function(){function ve(){this.seen={}}var ce=ve.prototype;return ce.slug=function(ne){var ie=ne.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(ie)){var oe=ie;do this.seen[oe]++,ie=oe+"-"+this.seen[oe];while(this.seen.hasOwnProperty(ie))}return this.seen[ie]=0,ie},ve}(),Ne=G.defaults,Fe=j.unescape,Ke=function(){function ve(fe){this.options=fe||Ne,this.options.renderer=this.options.renderer||new Te,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new Se,this.slugger=new Ge}ve.parse=function(ne,ie){var oe=new ve(ie);return oe.parse(ne)};var ce=ve.prototype;return ce.parse=function(ne,ie){ie===void 0&&(ie=!0);var oe="",le,ye,Le,Ue,Ze,mt,ft,Ct,xt,Qe,Lt,vt,Ft,Pt,Rt,pi,ai,bt,ti=ne.length;for(le=0;le0&&Rt.tokens[0].type==="text"?(Rt.tokens[0].text=bt+" "+Rt.tokens[0].text,Rt.tokens[0].tokens&&Rt.tokens[0].tokens.length>0&&Rt.tokens[0].tokens[0].type==="text"&&(Rt.tokens[0].tokens[0].text=bt+" "+Rt.tokens[0].tokens[0].text)):Rt.tokens.unshift({type:"text",text:bt}):Pt+=bt),Pt+=this.parse(Rt.tokens,Ft),xt+=this.renderer.listitem(Pt,ai,pi);oe+=this.renderer.list(xt,Lt,vt);continue}case"html":{oe+=this.renderer.html(Qe.text);continue}case"paragraph":{oe+=this.renderer.paragraph(this.parseInline(Qe.tokens));continue}case"text":{for(xt=Qe.tokens?this.parseInline(Qe.tokens):Qe.text;le+1An error occurred:

    "+tt(Le.message+"",!0)+"
    ";throw Le}}De.options=De.setOptions=function(ve){return Je(De.defaults,ve),nt(De.defaults),De},De.getDefaults=Ie,De.defaults=st,De.use=function(ve){var ce=Je({},ve);if(ve.renderer&&function(){var ne=De.defaults.renderer||new Te,ie=function(ye){var Le=ne[ye];ne[ye]=function(){for(var Ue=arguments.length,Ze=new Array(Ue),mt=0;mt`,triples:"",explode:"[]{}"},P=re.Pos;re.defineOption("autoCloseBrackets",!1,function(o,f,l){l&&l!=re.Init&&(o.removeKeyMap(U),o.state.closeBrackets=null),f&&(k(X(f,"pairs")),o.state.closeBrackets=f,o.addKeyMap(U))});function X(o,f){return f=="pairs"&&typeof o=="string"?o:typeof o=="object"&&o[f]!=null?o[f]:$[f]}var U={Backspace:i,Enter:D};function k(o){for(var f=0;f=0;a--){var A=h[a].head;o.replaceRange("",P(A.line,A.ch-1),P(A.line,A.ch+1),"+delete")}}function D(o){var f=W(o),l=f&&X(f,"explode");if(!l||o.getOption("disableInput"))return re.Pass;for(var h=o.listSelections(),a=0;a0;return{anchor:new P(o.anchor.line,o.anchor.ch+(f?-1:1)),head:new P(o.head.line,o.head.ch+(f?1:-1))}}function p(o,f){var l=W(o);if(!l||o.getOption("disableInput"))return re.Pass;var h=X(l,"pairs"),a=h.indexOf(f);if(a==-1)return re.Pass;for(var s=X(l,"closeBefore"),A=X(l,"triples"),E=h.charAt(a+1)==f,S=o.listSelections(),L=a%2==0,O,C=0;C=0&&o.getRange(x,P(x.line,x.ch+3))==f+f+f?c="skipThree":c="skip";else if(E&&x.ch>1&&A.indexOf(f)>=0&&o.getRange(P(x.line,x.ch-2),x)==f+f){if(x.ch>2&&/\bstring/.test(o.getTokenTypeAt(P(x.line,x.ch-2))))return re.Pass;c="addFour"}else if(E){var v=x.ch==0?" ":o.getRange(P(x.line,x.ch-1),x);if(!re.isWordChar(w)&&v!=f&&!re.isWordChar(v))c="both";else return re.Pass}else if(L&&(w.length===0||/\s/.test(w)||s.indexOf(w)>-1))c="both";else return re.Pass;if(!O)O=c;else if(O!=c)return re.Pass}var y=a%2?h.charAt(a-1):f,F=a%2?f:h.charAt(a+1);o.operation(function(){if(O=="skip")o.execCommand("goCharRight");else if(O=="skipThree")for(var B=0;B<3;B++)o.execCommand("goCharRight");else if(O=="surround"){for(var R=o.getSelections(),B=0;Bs.length&&(E=s.length);AS===L){const S=s[Symbol.iterator](),L=A[Symbol.iterator]();for(;;){const O=S.next(),C=L.next();if(O.done!==C.done)return!1;if(O.done)return!0;if(!E(O.value,C.value))return!1}}$.equals=a})(re||(re={}))},JkjM:function(ht,be,Z){"use strict";Z.r(be);var re=Z("9og8"),$=Z("PpiC"),P=Z("WmNS"),X=Z.n(P),U=Z("q1tI"),k=Z.n(U),G=Z("Ty5D"),W=Z("9kvl"),i=Z("14J3"),D=Z("BMrR"),g=Z("jCWc"),p=Z("kPKH"),m=Z("+L6B"),u=Z("2/Rp"),o=Z("k1fw"),f=Z("m3rI"),l=Z("LO5M"),h=Z.n(l),a=Z("h+Ho"),s=function(Fe){var Ke,Je,Ve,tt,Ie=Fe.user,nt=Fe.forumsDetail,st=Fe.globalSetting,De=Fe.loading,Me=Fe.dispatch,ve=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch"]),ce=nt.forumsDetailData||{},fe=ce.author_info,ne=ce.memo,ie=ce.recommend_shixuns,oe=function(){var le=Object(re.a)(X.a.mark(function ye(){var Le;return X.a.wrap(function(Ze){for(;;)switch(Ze.prev=Ze.next){case 0:if(!(fe!=null&&fe.watched)){Ze.next=6;break}return Ze.next=3,Object(a.a)({user_id:fe.user_id});case 3:Ze.t0=Ze.sent,Ze.next=9;break;case 6:return Ze.next=8,Object(a.o)({user_id:fe.user_id});case 8:Ze.t0=Ze.sent;case 9:Le=Ze.t0,Le&&Me({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},nt.forumsDetailData),{},{author_info:Object(o.a)(Object(o.a)({},fe),{},{watched:!(fe!=null&&fe.watched)})})});case 11:case"end":return Ze.stop()}},ye)}));return function(){return le.apply(this,arguments)}}();return k.a.createElement("section",{className:h.a.wrap},k.a.createElement("aside",{className:"ml20"},k.a.createElement("div",{className:"bg-white pt40 pb40 pl20 pr20 ".concat(h.a.head)},k.a.createElement("a",{href:"/users/".concat(fe==null?void 0:fe.login),target:"_blank"},(fe==null?void 0:fe.image_url)&&k.a.createElement("img",{src:"".concat(f.a.API_SERVER,"/images/").concat(fe==null?void 0:fe.image_url)})),k.a.createElement("div",{className:"tc font20"},fe==null?void 0:fe.username),k.a.createElement("div",{className:"tc c-grey-999"},fe==null?void 0:fe.identity),((Ke=Ie.userInfo)===null||Ke===void 0?void 0:Ke.user_id)!==(fe==null?void 0:fe.user_id)&&k.a.createElement(D.a,{justify:"center",className:"mt30 ".concat(h.a.buttonWrap)},k.a.createElement(p.a,null,k.a.createElement(u.a,{type:"primary",className:"mr10",onClick:oe},fe!=null&&fe.watched?"\u53D6\u6D88\u5173\u6CE8":"\u5173\u6CE8")),k.a.createElement(p.a,null,k.a.createElement(u.a,{ghost:!0,className:h.a.privateMessage,href:"/messages/".concat((Je=Ie.userInfo)===null||Je===void 0?void 0:Je.login,"/message_detail?target_ids=").concat(fe==null?void 0:fe.user_id),target:"_blank"},"\u79C1\u4FE1")))),!!(ne!=null&&(Ve=ne.tag)!==null&&Ve!==void 0&&Ve.length)&&k.a.createElement("div",{className:"bg-white mt10 pt40 pb40 pl20 pr20"},k.a.createElement("div",{className:"font16"},"\u8BDD\u9898\u6807\u7B7E"),k.a.createElement("div",{className:"mt30 ".concat(h.a.tag)},ne==null||((tt=ne.tag)===null||tt===void 0)?void 0:tt.map(function(le){return k.a.createElement("a",null,le==null?void 0:le.name)}))),k.a.createElement("div",{className:"pt10 pb10 pl10 pr10"},k.a.createElement("div",{className:"font16 mb20"},"\u63A8\u8350\u5B9E\u8BAD"),k.a.createElement("div",{className:h.a.recommend},ie==null?void 0:ie.map(function(le){return k.a.createElement("div",{className:h.a.recommendItem},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank"},k.a.createElement("img",{alt:le.id,src:"".concat(f.a.API_SERVER,"/").concat(le.image_url)})),k.a.createElement("div",{className:"".concat(h.a.flex1," ml10")},k.a.createElement("a",{href:"/shixuns/".concat(le.identifier,"/challenges"),target:"_blank",title:le.name,className:"".concat(h.a.mWidth147," multi-llipsis1e c-grey-666 mb10")},le.name),k.a.createElement("div",{className:"c-grey-999"},le.myshixuns_count," \u4EBA\u5B66\u4E60")))})))))},A=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.models.forumsDetail}})(s),E=Z("qVdP"),S=Z("jsC+"),L=Z("5Dmo"),O=Z("3S7+"),C=Z("sPJy"),T=Z("bE4q"),x=Z("lUTK"),c=Z("BvKs"),w=Z("5NDa"),v=Z("5rEg"),y=Z("2qtc"),F=Z("kLXV"),B=Z("miYZ"),R=Z("tsqr"),j=Z("55Ip"),N=Z("wd/R"),b=Z.n(N),Y=Z("9Bee"),ee=Z("oBTY"),ae=Z("tJVT"),ue=Z("Ot1p"),Oe=Z("/MfK"),Ee=Z("8JLL"),xe=Z.n(Ee);b.a.lang("ZH-cn");function Ae(Ne){var Fe=Ne.user,Ke=Ne.vlist,Je=Ke===void 0?[]:Ke,Ve=Ne.dispatch,tt=Ne.params,Ie=Ne.id,nt=Ne.memo_replies,st=Ne.forumsDetail;return k.a.createElement("aside",{className:xe.a.comment},Je.map(function(De,Me){var ve,ce;return k.a.createElement(D.a,{key:Me,className:xe.a.commentItem},k.a.createElement(p.a,{span:24},k.a.createElement(D.a,null,k.a.createElement(p.a,{flex:"1"},k.a.createElement("a",{href:"/users/".concat(De.user_login),target:"_blank",className:"c-light-black"},De==null?void 0:De.username),k.a.createElement("span",{className:"c-light-black ml10"},De.time)),(De.can_delete||De.user_id===((ve=Fe.userInfo)===null||ve===void 0?void 0:ve.user_id)||De.user_login===((ce=Fe.userInfo)===null||ce===void 0?void 0:ce.login))&&k.a.createElement(p.a,{className:"forums-comment-delete",style:{display:"none"}},k.a.createElement(O.a,{title:"\u5220\u9664"},k.a.createElement(Oe.a,{className:"current",onClick:function(){F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u63D0\u793A",content:k.a.createElement("div",{className:"font16 tc"},"\u786E\u5B9A\u8981\u5220\u9664\u8BE5\u6761\u56DE\u590D\u5417\uFF1F"),onOk:function(){var ne=Object(re.a)(X.a.mark(function oe(){var le,ye;return X.a.wrap(function(Ue){for(;;)switch(Ue.prev=Ue.next){case 0:return Ue.next=2,Object(a.b)({id:De.id});case 2:le=Ue.sent,ye=nt.find(function(Ze){return Ze.id===Ie}).children.filter(function(Ze){return Ze.id!==De.id}),nt.find(function(Ze){return Ze.id===Ie}).children=ye,Ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo_replies:Object(ee.a)(nt)})});case 6:case"end":return Ue.stop()}},oe)}));function ie(){return ne.apply(this,arguments)}return ie}()})}}))))),k.a.createElement(p.a,null,k.a.createElement(Y.a,{value:De.content})))}))}var Re=Ae,pe=Z("1vsH");b.a.lang("ZH-cn");var he=function(Fe,Ke){var Je=Fe.user,Ve=Fe.forumsDetail,tt=Fe.globalSetting,Ie=Fe.loading,nt=Fe.dispatch,st=Fe.handleClick,De=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch","handleClick"]),Me=Ve.forumsDetailData||{},ve=Me.memo,ce=Me.memo_replies,fe=Object(G.i)(),ne=Object(U.useState)(""),ie=Object(ae.a)(ne,2),oe=ie[0],le=ie[1],ye=Object(U.useState)(""),Le=Object(ae.a)(ye,2),Ue=Le[0],Ze=Le[1],mt=Object(U.useState)(-1),ft=Object(ae.a)(mt,2),Ct=ft[0],xt=ft[1],Qe=Object(U.useState)(!1),Lt=Object(ae.a)(Qe,2),vt=Lt[0],Ft=Lt[1],Pt=Object(U.useState)(1),Rt=Object(ae.a)(Pt,2),pi=Rt[0],ai=Rt[1],bt=Object(U.useState)(!1),ti=Object(ae.a)(bt,2),_t=ti[0],Tt=ti[1];Object(U.useImperativeHandle)(Ke,function(){return{onMdFouch:ui}}),Object(U.useEffect)(function(){Ft((ve==null?void 0:ve.replies_count)>10)},[ve==null?void 0:ve.replies_count]);var Wt=function(){var dt=Object(re.a)(X.a.mark(function ut(){var qt,Ot,Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return qt=pi+1,ai(qt),Ut.next=4,Object(a.h)({id:fe.memoId,page:qt});case 4:Ot=Ut.sent,Ot!=null&&Ot.memo_replies&&(nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo_replies:[].concat(Object(ee.a)(ce),Object(ee.a)(Ot.memo_replies))})}),Ft(((Mt=Ot.memo_replies)===null||Mt===void 0?void 0:Mt.length)===10));case 6:case"end":return Ut.stop()}},ut)}));return function(){return dt.apply(this,arguments)}}(),ii=function(ut){var qt,Ot,Mt,Dt;return Object(o.a)(Object(o.a)({},ut),{},{image_url:(qt=Je.userInfo)===null||qt===void 0?void 0:qt.image_url,children:[],user_id:(Ot=Je.userInfo)===null||Ot===void 0?void 0:Ot.user_id,user_login:(Mt=Je.userInfo)===null||Mt===void 0?void 0:Mt.login,username:(Dt=Je.userInfo)===null||Dt===void 0?void 0:Dt.username,time:"".concat(Object(pe.bb)((new Date().getTime()-new Date(ut.created_at).getTime())/1e3),"\u524D")})},ui=function(){Tt(!0)};return k.a.createElement("section",{className:xe.a.wrap},!!(ce!=null&&ce.length)&&k.a.createElement("aside",{className:xe.a.content},k.a.createElement("div",{style:{padding:"10px 15px 5px 15px",justifyContent:"space-between",display:"flex"}},k.a.createElement("span",null,"\u5168\u90E8\u56DE\u590D\uFF08",ve.replies_count,"\uFF09")),k.a.createElement("aside",{className:xe.a.replyList},ce==null?void 0:ce.map(function(dt,ut){var qt;return k.a.createElement(D.a,{gutter:[12,12],key:ut},k.a.createElement(p.a,{flex:"40px"},k.a.createElement("a",{href:"/users/".concat(dt.user_login),target:"_blank"},k.a.createElement("img",{alt:"\u7528\u6237\u5934\u50CF",width:"50",height:"50",src:"".concat(f.a.IMG_SERVER,"/images/").concat(dt==null?void 0:dt.image_url)}))),k.a.createElement(p.a,{flex:"1"},k.a.createElement(D.a,{align:"middle"},k.a.createElement(p.a,{span:24},k.a.createElement("a",{href:"/users/".concat(dt.user_login),target:"_blank"},k.a.createElement("span",{className:"c-light-black"},dt==null?void 0:dt.username)),k.a.createElement("span",{className:"c-light-black ml10"},dt.time)),k.a.createElement(p.a,{span:24},k.a.createElement("div",{onClick:st},k.a.createElement(Y.a,{value:dt.content}))),!!(dt!=null&&(qt=dt.children)!==null&&qt!==void 0&&qt.length)&&k.a.createElement(Re,{user:Je,id:dt==null?void 0:dt.id,vlist:dt==null?void 0:dt.children,dispatch:nt,params:fe,memo_replies:ce,forumsDetail:Ve}),k.a.createElement(p.a,{span:24,className:"mt5 c-light-black"},Ct===ut?k.a.createElement("aside",null,k.a.createElement(ue.a,{onChange:function(Mt){Ze(Mt)},height:150,isFocus:!0,placeholder:"\u6211\u8981\u56DE\u590D..."}),k.a.createElement(D.a,null,k.a.createElement(p.a,{span:24,className:"tr"},k.a.createElement(u.a,{type:"primary",size:"large",onClick:Object(re.a)(X.a.mark(function Ot(){var Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:if(!(Ue==="")){Ut.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ut.next=9;break;case 4:return Ut.next=6,Object(a.k)({parent_id:dt.id,content:Ue});case 6:Mt=Ut.sent,Ze(null),Mt&&(xt(-1),ce.find(function(hi){return hi.id===Mt.parent_id}).children.push(ii(Mt)),nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ve),{},{replies_count:ve.replies_count+1}),memo_replies:Object(ee.a)(ce)})}));case 9:case"end":return Ut.stop()}},Ot)}))},"\u53D1\u9001")))):k.a.createElement("div",{className:"tr"},k.a.createElement("span",{className:"iconfont icon-huifu1 mr15 ml30 current",onClick:function(){return xt(ut)}}),k.a.createElement(O.a,{title:dt.user_praise?"\u53D6\u6D88\u70B9\u8D5E":"\u70B9\u8D5E"},k.a.createElement("span",{className:dt.user_praise?"c-orange":"c-gery-888"},k.a.createElement("i",{className:"iconfont icon-dianzan mr3 current",onClick:Object(re.a)(X.a.mark(function Ot(){var Mt;return X.a.wrap(function(Ut){for(;;)switch(Ut.prev=Ut.next){case 0:return Ut.next=2,Object(a.i)({id:dt.id,container_type:"Memo",type:dt.user_praise?0:1});case 2:Mt=Ut.sent,(Mt==null?void 0:Mt.praise_count)>=0&&(ce.find(function(hi){return hi.id===dt.id}).user_praise=!dt.user_praise,ce.find(function(hi){return hi.id===dt.id}).praise_count=Mt==null?void 0:Mt.praise_count,nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo_replies:Object(ee.a)(ce)})}));case 4:case"end":return Ut.stop()}},Ot)}))}),dt.praise_count>0?dt.praise_count:"")))))))}))),vt&&k.a.createElement("aside",{className:"bg-white pb20",style:{display:"flex",justifyContent:"center"}},k.a.createElement(D.a,{justify:"space-between"},k.a.createElement(p.a,null),k.a.createElement(p.a,null,vt&&k.a.createElement("a",{className:"c-black",onClick:Wt},"\u67E5\u770B\u66F4\u591A\u8BC4\u8BBA")))),k.a.createElement("aside",{className:xe.a.reply},k.a.createElement(ue.a,{onBlur:function(){return Tt(!1)},isFocus:_t,defaultValue:oe,id:"writeForumsReviewId",onChange:function(ut){le(ut)},placeholder:"\u6211\u8981\u56DE\u590D...",height:240}),k.a.createElement(D.a,null,k.a.createElement(p.a,{flex:"1"}),k.a.createElement(p.a,null,k.a.createElement(u.a,{type:"primary",size:"large",onClick:Object(re.a)(X.a.mark(function dt(){var ut;return X.a.wrap(function(Ot){for(;;)switch(Ot.prev=Ot.next){case 0:if(!(oe==="")){Ot.next=4;break}R.b.error("\u8BF7\u8F93\u5165\u5185\u5BB9"),Ot.next=9;break;case 4:return Ot.next=6,Object(a.k)({parent_id:ve.id,content:oe});case 6:ut=Ot.sent,le(null),ut&&nt({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},Ve.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ve),{},{replies_count:ve.replies_count+1}),memo_replies:[ii(ut)].concat(Object(ee.a)(ce))})});case 9:case"end":return Ot.stop()}},dt)}))},"\u53D1\u9001")))))},ke=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.models.forumsDetail}},null,null,{forwardRef:!0})(Object(U.forwardRef)(he)),et=Z("smFo"),We=Z.n(et),it=Z("RCxd"),at=Z("kaH+"),Pe=Z("dhSg"),je={5:"\u6280\u672F\u5206\u4EAB",3:"\u64CD\u4F5C\u6307\u5357",16:"\u901A\u77E5\u516C\u544A"},$e=function(Fe){var Ke,Je,Ve,tt,Ie,nt=Fe.user,st=Fe.forumsDetail,De=Fe.globalSetting,Me=Fe.loading,ve=Fe.dispatch,ce=Object($.a)(Fe,["user","forumsDetail","globalSetting","loading","dispatch"]),fe=st.forumsDetailData||{},ne=fe.author_info,ie=fe.memo,oe=fe.attachments_list,le=Object(U.useRef)(),ye=Object(U.useRef)(),Le=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt,Ft;return X.a.wrap(function(Rt){for(;;)switch(Rt.prev=Rt.next){case 0:return vt={id:ie.id,sticky:ie.sticky?0:1},Rt.next=3,Object(a.m)(vt);case 3:Ft=Rt.sent,(Ft==null?void 0:Ft.status)===0&&ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ie),{},{sticky:!(ie!=null&&ie.sticky)})})});case 5:case"end":return Rt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ue=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt;return X.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(a.b)({id:ie==null?void 0:ie.id});case 2:vt=Pt.sent,(vt==null?void 0:vt.status)===0&&(R.b.success("\u5220\u9664\u6210\u529F"),W.d.push("/forums")),(vt==null?void 0:vt.status)===-1&&W.d.push("/forums");case 5:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ze=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){return X.a.wrap(function(Ft){for(;;)switch(Ft.prev=Ft.next){case 0:F.a.confirm({centered:!0,width:530,okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",title:"\u5956\u52B1\u8BBE\u7F6E",content:k.a.createElement("div",{className:"font14 tc"},k.a.createElement(v.a,{defaultValue:le.current,onChange:function(Rt){return le.current=Rt.target.value}})),onOk:function(){var Pt=Object(re.a)(X.a.mark(function pi(){var ai;return X.a.wrap(function(ti){for(;;)switch(ti.prev=ti.next){case 0:return ti.next=2,Object(a.l)({id:ie==null?void 0:ie.id,container_type:"Memo",score:le.current?Number(le.current):0,user_id:ne==null?void 0:ne.user_id});case 2:if(ai=ti.sent,le.current=null,!((ai==null?void 0:ai.code)>0)){ti.next=8;break}return ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ie),{},{reward:ai==null?void 0:ai.code})})}),R.b.success("\u5956\u52B1\u6210\u529F"),ti.abrupt("return");case 8:R.b.success("\u5956\u52B1\u5931\u8D25\uFF0C\u8BF7\u8054\u7CFB\u7CFB\u7EDF\u7BA1\u7406\u5458\uFF01");case 9:case"end":return ti.stop()}},pi)}));function Rt(){return Pt.apply(this,arguments)}return Rt}()});case 1:case"end":return Ft.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),mt=function(){ye.current.onMdFouch&&ye.current.onMdFouch()},ft=function(){var Qe=Object(re.a)(X.a.mark(function Lt(){var vt;return X.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Pt.next=2,Object(a.i)({id:ie.id,container_type:"Memo",type:1});case 2:vt=Pt.sent,(vt==null?void 0:vt.praise_count)>=0&&ve({type:"forumsDetail/setForumsDetailData",payload:Object(o.a)(Object(o.a)({},st.forumsDetailData),{},{memo:Object(o.a)(Object(o.a)({},ie),{},{user_praise:!(ie!=null&&ie.user_praise),memo_praise_count:vt==null?void 0:vt.praise_count})})});case 4:case"end":return Pt.stop()}},Lt)}));return function(){return Qe.apply(this,arguments)}}(),Ct=k.a.createElement(c.a,{className:We.a.menu},((Ke=nt.userInfo)===null||Ke===void 0?void 0:Ke.admin)&&(ie==null?void 0:ie.sticky)&&k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u53D6\u6D88\u7F6E\u9876")),((Je=nt.userInfo)===null||Je===void 0?void 0:Je.admin)&&!(ie!=null&&ie.sticky)&&k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){return Le()}},"\u7F6E\xA0\xA0\u9876")),k.a.createElement(c.a.Item,null,k.a.createElement(j.a,{to:"/forums/".concat(ie==null?void 0:ie.id,"/edit")},"\u7F16\xA0\xA0\u8F91")),k.a.createElement(c.a.Item,null,k.a.createElement("a",{onClick:function(){F.a.confirm({title:"\u63D0\u793A",icon:k.a.createElement(it.a,null),content:"\u5E16\u5B50\u5C06\u88AB\u5220\u9664\uFF0C\u65E0\u6CD5\u6062\u590D\u3002\u662F\u5426\u786E\u8BA4\u5220\u9664\uFF1F",okText:"\u786E\u8BA4",onOk:function(){Ue()},cancelText:"\u53D6\u6D88"})}},"\u5220\xA0\xA0\u9664"))),xt=function(Lt){var vt=Lt.target,Ft=vt.nodeName,Pt=vt.src;Ft==="IMG"&&(Pe.a.publish("preview-image",Pt),console.log("src:",Pt))};return Object(U.useEffect)(function(){},[]),k.a.createElement("section",{className:We.a.wrap},k.a.createElement(T.a,{separator:"/",className:"mb5"},k.a.createElement(T.a.Item,null,k.a.createElement(j.a,{to:"/forums/categories/".concat(ie==null?void 0:ie.forum_id)},je[ie==null?void 0:ie.forum_id])),k.a.createElement(T.a.Item,null,"\u8BE6\u60C5")),k.a.createElement("header",{className:"bg-white pt40 pb40 pl30 pr30 ".concat(We.a.header)},k.a.createElement(D.a,{align:"middle"},k.a.createElement(p.a,{flex:1,className:"font24 mb5"},k.a.createElement("span",{className:We.a.title},ie==null?void 0:ie.subject),(ie==null?void 0:ie.sticky)&&k.a.createElement("span",{className:We.a.top},"\u7F6E\u9876"),!!(ie!=null&&ie.reward)&&k.a.createElement(O.a,{placement:"bottom",title:"\u83B7\u5F97\u5E73\u53F0\u5956\u52B1\u91D1\u5E01\uFF1A".concat(ie==null?void 0:ie.reward)},k.a.createElement("span",{className:"ml10 c-orange-ff7"},k.a.createElement("i",{className:"iconfont icon-gift font16 mr5"}),k.a.createElement("span",{className:"font14"},ie==null?void 0:ie.reward)))),k.a.createElement(p.a,null,(((Ve=nt.userInfo)===null||Ve===void 0?void 0:Ve.admin)||((tt=nt.userInfo)===null||tt===void 0?void 0:tt.user_id)===(ne==null?void 0:ne.user_id))&&k.a.createElement(S.a,{overlay:Ct},k.a.createElement("i",{className:"fa fa-bars font-16 current c-grey-bcb"})))),k.a.createElement(D.a,{align:"middle",className:"font14"},k.a.createElement(p.a,{flex:1,className:"c-grey-999"},k.a.createElement("span",null,b()(ie==null?void 0:ie.time).fromNow()," \u53D1\u5E03")),k.a.createElement(p.a,{className:"c-grey-999"},((Ie=nt.userInfo)===null||Ie===void 0?void 0:Ie.admin)&&k.a.createElement(O.a,{placement:"bottom",title:"\u5E16\u5B50\u5956\u52B1"},k.a.createElement("span",{className:"current pr10 ".concat(We.a.line),onClick:Ze},k.a.createElement("i",{className:"iconfont icon-jiangli font18 mr5"}))),k.a.createElement("span",{className:"pr10 pl10 ".concat(ie!=null&&ie.replies_count?We.a.line:"")},k.a.createElement("i",{className:"iconfont icon-liulanyan font18 mr5"}),ie==null?void 0:ie.viewed_count),!!(ie!=null&&ie.replies_count)&&k.a.createElement(O.a,{placement:"bottom",title:"\u5199\u8BC4\u8BBA"},k.a.createElement("span",{className:"current pl10",onClick:mt},k.a.createElement("i",{className:"iconfont icon-huifu1 font18 mr5"}),ie==null?void 0:ie.replies_count))))),k.a.createElement("main",{className:"bg-white pt40 pb40 pl40 pr40"},k.a.createElement("div",{onClick:xt},k.a.createElement(Y.a,{value:ie==null?void 0:ie.content})),k.a.createElement("div",{className:"bg-white pl40 pr40 mt40"},k.a.createElement("div",{className:"mt10 mb20 ".concat(We.a.flexCenter)},k.a.createElement("div",{className:"".concat(We.a.like," ").concat(ie!=null&&ie.user_praise?"":We.a.canLike),onClick:ft},k.a.createElement("i",{className:"iconfont icon-dianzan font18"}),k.a.createElement("br",null),k.a.createElement("span",null,ie==null?void 0:ie.memo_praise_count)))),!!(oe!=null&&oe.length)&&k.a.createElement("div",{className:"mt40"},oe==null?void 0:oe.map(function(Qe){return k.a.createElement("div",{className:"c-grey-888 ".concat(We.a.flexCenter)},k.a.createElement("i",{className:"iconfont icon-fujian mr10 font14 c-green-29b"}),k.a.createElement("a",{href:Qe==null?void 0:Qe.url,title:Qe==null?void 0:Qe.title,className:"".concat(We.a.attachmentName," mr10")},Qe==null?void 0:Qe.title),k.a.createElement("span",{className:"font12 c-grey-666 mt3"},Qe==null?void 0:Qe.filesize))}))),k.a.createElement(ke,{ref:ye,handleClick:xt}),k.a.createElement(at.a,null))},se=Object(W.a)(function(Ne){var Fe=Ne.user,Ke=Ne.forumsDetail,Je=Ne.loading,Ve=Ne.globalSetting;return{user:Fe,forumsDetail:Ke,globalSetting:Ve,loading:Je.effects}})($e),_e=Z("G8my"),Te=Z.n(_e),Se=function(Fe){var Ke=Fe.forumsDetail,Je=Fe.globalSetting,Ve=Fe.loading,tt=Fe.dispatch,Ie=Object($.a)(Fe,["forumsDetail","globalSetting","loading","dispatch"]),nt=Object(G.i)();Object(U.useEffect)(function(){st()},[nt.memoId]);var st=function(){var De=Object(re.a)(X.a.mark(function Me(){return X.a.wrap(function(ce){for(;;)switch(ce.prev=ce.next){case 0:tt({type:"forumsDetail/getForumsDetailData",payload:{id:nt.memoId}});case 1:case"end":return ce.stop()}},Me)}));return function(){return De.apply(this,arguments)}}();return k.a.createElement("section",{className:"edu-container mb20 mt30 ".concat(Te.a.flex)},k.a.createElement(se,null),k.a.createElement(A,null))},Ge=be.default=Object(W.a)(function(Ne){var Fe=Ne.forumsDetail,Ke=Ne.loading,Je=Ne.globalSetting;return{forumsDetail:Fe,globalSetting:Je,loading:Ke.models.forumsDetail}})(Se)},LO5M:function(ht,be,Z){ht.exports={wrap:"wrap___1d4rP",head:"head___1_Uzf",recommendItem:"recommendItem___IStR9",buttonWrap:"buttonWrap___3dpFm",privateMessage:"privateMessage___24GfS",flex1:"flex1___3wIqQ",mWidth147:"mWidth147___3ODny"}},LdHM:function(ht,be,Z){"use strict";Z.d(be,"b",function(){return s}),Z.d(be,"a",function(){return E});var re=Z("1OyB"),$=Z("vuIU"),P=Z("Ji7U"),X=Z("LK+K"),U=Z("q1tI"),k=Z("rePB"),G=Z("Ff2n"),W=Z("ODXe"),i=Z("4IlW"),D=Z("bX4T"),g=Z("YrtM"),p=Z("TSYQ"),m=Z.n(p),u=Z("+nKL"),o=Z("8OUc"),f=function(Y,ee){var ae=Y.prefixCls,ue=Y.id,Oe=Y.flattenOptions,Ee=Y.childrenAsData,xe=Y.values,Ae=Y.searchValue,Re=Y.multiple,pe=Y.defaultActiveFirstOption,he=Y.height,ke=Y.itemHeight,et=Y.notFoundContent,We=Y.open,it=Y.menuItemSelectedIcon,at=Y.virtual,Pe=Y.onSelect,je=Y.onToggleOpen,$e=Y.onActiveValue,se=Y.onScroll,_e=Y.onMouseEnter,Te="".concat(ae,"-item"),Se=Object(g.a)(function(){return Oe},[We,Oe],function(Me,ve){return ve[0]&&Me[1]!==ve[1]}),Ge=U.useRef(null),Ne=function(ve){ve.preventDefault()},Fe=function(ve){Ge.current&&Ge.current.scrollTo({index:ve})},Ke=function(ve){for(var ce=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,fe=Se.length,ne=0;ne1&&arguments[1]!==void 0?arguments[1]:!1;return Object(L.a)(b).map(function(ee,ae){if(!U.isValidElement(ee)||!ee.type)return null;var ue=ee.type.isSelectOptGroup,Oe=ee.key,Ee=ee.props,xe=Ee.children,Ae=Object(G.a)(Ee,["children"]);return Y||!ue?O(ee):Object(S.a)(Object(S.a)({key:"__RC_SELECT_GRP__".concat(Oe===null?ae:Oe,"__"),label:Oe},Ae),{},{options:C(xe)})}).filter(function(ee){return ee})}var T=Z("2Qr1"),x=Z("qNPg"),c=Z("U8pU"),w=Z("Kwbf"),v=Z("WKfj");function y(b){var Y=b.mode,ee=b.options,ae=b.children,ue=b.backfill,Oe=b.allowClear,Ee=b.placeholder,xe=b.getInputElement,Ae=b.showSearch,Re=b.onSearch,pe=b.defaultOpen,he=b.autoFocus,ke=b.labelInValue,et=b.value,We=b.inputValue,it=b.optionLabelProp,at=Y==="multiple"||Y==="tags",Pe=Ae!==void 0?Ae:at||Y==="combobox",je=ee||C(ae);if(Object(w.a)(Y!=="tags"||je.every(function(Te){return!Te.disabled}),"Please avoid setting option to disabled in tags mode since user can always type text as tag."),Y==="tags"||Y==="combobox"){var $e=je.some(function(Te){return Te.options?Te.options.some(function(Se){return typeof("value"in Se?Se.value:Se.key)=="number"}):typeof("value"in Te?Te.value:Te.key)=="number"});Object(w.a)(!$e,"`value` of Option should not use number type when `mode` is `tags` or `combobox`.")}if(Object(w.a)(Y!=="combobox"||!it,"`combobox` mode not support `optionLabelProp`. Please set `value` on Option directly."),Object(w.a)(Y==="combobox"||!ue,"`backfill` only works with `combobox` mode."),Object(w.a)(Y==="combobox"||!xe,"`getInputElement` only work with `combobox` mode."),Object(w.b)(Y!=="combobox"||!xe||!Oe||!Ee,"Customize `getInputElement` should customize clear and placeholder logic instead of configuring `allowClear` and `placeholder`."),Re&&!Pe&&Y!=="combobox"&&Y!=="tags"&&Object(w.a)(!1,"`onSearch` should work with `showSearch` instead of use alone."),Object(w.b)(!pe||he,"`defaultOpen` makes Select open without focus which means it will not close by click outside. You can set `autoFocus` if needed."),et!=null){var se=Object(v.d)(et);Object(w.a)(!ke||se.every(function(Te){return Object(c.a)(Te)==="object"&&("key"in Te||"value"in Te)}),"`value` should in shape of `{ value: string | number, label?: ReactNode }` when you set `labelInValue` to `true`"),Object(w.a)(!at||Array.isArray(et),"`value` should be array when `mode` is `multiple` or `tags`")}if(ae){var _e=null;Object(L.a)(ae).some(function(Te){if(!U.isValidElement(Te)||!Te.type)return!1;var Se=Te.type;if(Se.isSelectOption)return!1;if(Se.isSelectOptGroup){var Ge=Object(L.a)(Te.props.children).every(function(Ne){return!U.isValidElement(Ne)||!Te.type||Ne.type.isSelectOption?!0:(_e=Ne.type,!1)});return!Ge}return _e=Se,!0}),_e&&Object(w.a)(!1,"`children` should be `Select.Option` or `Select.OptGroup` instead of `".concat(_e.displayName||_e.name||_e,"`.")),Object(w.a)(We===void 0,"`inputValue` is deprecated, please use `searchValue` instead.")}}var F=y,B=Object(x.a)({prefixCls:"rc-select",components:{optionList:h},convertChildrenToData:C,flattenOptions:T.d,getLabeledValue:T.e,filterOptions:T.b,isValueDisabled:T.g,findValueOption:T.c,warningProps:F,fillOptionsWithMissingValue:T.a}),R=function(b){Object(P.a)(ee,b);var Y=Object(X.a)(ee);function ee(){var ae;return Object(re.a)(this,ee),ae=Y.apply(this,arguments),ae.selectRef=U.createRef(),ae.focus=function(){ae.selectRef.current.focus()},ae.blur=function(){ae.selectRef.current.blur()},ae}return Object($.a)(ee,[{key:"render",value:function(){return U.createElement(B,Object.assign({ref:this.selectRef},this.props))}}]),ee}(U.Component);R.Option=s,R.OptGroup=E;var j=R,N=be.c=j},M8RZ:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return i});var re=Z("fWQN"),$=Z("mtLc"),P=Z("yKVA"),X=Z("879j"),U=Z("q1tI"),k=Z.n(U),G=Z("i8i4"),W=Z.n(G),i=function(D){Object(P.a)(p,D);var g=Object(X.a)(p);function p(m){var u;Object(re.a)(this,p),u=g.call(this,m);var o=window.document;return u.node=o.createElement("div"),o.body.appendChild(u.node),u}return Object($.a)(p,[{key:"render",value:function(){var u=this.props.children;return Object(G.createPortal)(u,this.node)}},{key:"componentWillUnmount",value:function(){window.document.body.removeChild(this.node)}}]),p}(k.a.Component)},MI8n:function(ht,be,Z){"use strict";Z.d(be,"c",function(){return U}),Z.d(be,"b",function(){return i}),Z.d(be,"e",function(){return D}),Z.d(be,"a",function(){return g}),Z.d(be,"d",function(){return p}),Z.d(be,"f",function(){return m});var re=Z("/cxE"),$=Z("pmY6"),P=Z("24hK"),X=Z("5Y4S"),U;(function(u){u.None=()=>$.a.None;function o(y){return(F,B=null,R)=>{let j=!1,N;return N=y(b=>j?void 0:(N?N.dispose():j=!0,F.call(B,b)),null,R),j&&N.dispose(),N}}u.once=o;function f(y,F){return E((B,R=null,j)=>y(N=>B.call(R,F(N)),null,j))}u.map=f;function l(y,F){return E((B,R=null,j)=>y(N=>{F(N),B.call(R,N)},null,j))}u.forEach=l;function h(y,F){return E((B,R=null,j)=>y(N=>F(N)&&B.call(R,N),null,j))}u.filter=h;function a(y){return y}u.signal=a;function s(...y){return(F,B=null,R)=>Object($.e)(...y.map(j=>j(N=>F.call(B,N),null,R)))}u.any=s;function A(y,F,B){let R=B;return f(y,j=>(R=F(R,j),R))}u.reduce=A;function E(y){let F;const B=new i({onFirstListenerAdd(){F=y(B.fire,B)},onLastListenerRemove(){F.dispose()}});return B.event}function S(y,F,B=100,R=!1,j){let N,b,Y,ee=0;const ae=new i({leakWarningThreshold:j,onFirstListenerAdd(){N=y(ue=>{ee++,b=F(b,ue),R&&!Y&&(ae.fire(b),b=void 0),clearTimeout(Y),Y=setTimeout(()=>{const Oe=b;b=void 0,Y=void 0,(!R||ee>1)&&ae.fire(Oe),ee=0},B)})},onLastListenerRemove(){N.dispose()}});return ae.event}u.debounce=S;function L(y,F=(B,R)=>B===R){let B=!0,R;return h(y,j=>{const N=B||!F(j,R);return B=!1,R=j,N})}u.latch=L;function O(y,F){return[u.filter(y,F),u.filter(y,B=>!F(B))]}u.split=O;function C(y,F=!1,B=[]){let R=B.slice(),j=y(Y=>{R?R.push(Y):b.fire(Y)});const N=()=>{R&&R.forEach(Y=>b.fire(Y)),R=null},b=new i({onFirstListenerAdd(){j||(j=y(Y=>b.fire(Y)))},onFirstListenerDidAdd(){R&&(F?setTimeout(N):N())},onLastListenerRemove(){j&&j.dispose(),j=null}});return b.event}u.buffer=C;class T{constructor(y){this.event=y}map(y){return new T(f(this.event,y))}forEach(y){return new T(l(this.event,y))}filter(y){return new T(h(this.event,y))}reduce(y,F){return new T(A(this.event,y,F))}latch(){return new T(L(this.event))}debounce(y,F=100,B=!1,R){return new T(S(this.event,y,F,B,R))}on(y,F,B){return this.event(y,F,B)}once(y,F,B){return o(this.event)(y,F,B)}}function x(y){return new T(y)}u.chain=x;function c(y,F,B=R=>R){const R=(...Y)=>b.fire(B(...Y)),j=()=>y.on(F,R),N=()=>y.removeListener(F,R),b=new i({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}u.fromNodeEventEmitter=c;function w(y,F,B=R=>R){const R=(...Y)=>b.fire(B(...Y)),j=()=>y.addEventListener(F,R),N=()=>y.removeEventListener(F,R),b=new i({onFirstListenerAdd:j,onLastListenerRemove:N});return b.event}u.fromDOMEventEmitter=w;function v(y){return new Promise(F=>o(y)(F))}u.toPromise=v})(U||(U={}));class k{constructor(u){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${u}_${k._idPool++}`}start(u){this._stopWatch=new X.a(!0),this._listenerCount=u}stop(){if(this._stopWatch){const u=this._stopWatch.elapsed();this._elapsedOverall+=u,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${u.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}k._idPool=0;let G=-1;class W{constructor(u,o=Math.random().toString(18).slice(2,5)){this.customThreshold=u,this.name=o,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(u){let o=G;if(typeof this.customThreshold=="number"&&(o=this.customThreshold),o<=0||u{const h=this._stacks.get(f)||0;this._stacks.set(f,h-1)}}}class i{constructor(u){var o;this._disposed=!1,this._options=u,this._leakageMon=G>0?new W(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((o=this._options)===null||o===void 0?void 0:o._profName)?new k(this._options._profName):void 0}get event(){return this._event||(this._event=(u,o,f)=>{var l;this._listeners||(this._listeners=new P.a);const h=this._listeners.isEmpty();h&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const a=this._listeners.push(o?[u,o]:u);h&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,u,o);const s=(l=this._leakageMon)===null||l===void 0?void 0:l.check(this._listeners.size),A=Object($.i)(()=>{if(s&&s(),!this._disposed&&(a(),this._options&&this._options.onLastListenerRemove)){const E=this._listeners&&!this._listeners.isEmpty();E||this._options.onLastListenerRemove(this)}});return f instanceof $.b?f.add(A):Array.isArray(f)&&f.push(A),A}),this._event}fire(u){var o,f;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new P.a);for(let l of this._listeners)this._deliveryQueue.push([l,u]);for((o=this._perfMon)===null||o===void 0||o.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[l,h]=this._deliveryQueue.shift();try{typeof l=="function"?l.call(void 0,h):l[0].call(l[1],h)}catch(a){Object(re.f)(a)}}(f=this._perfMon)===null||f===void 0||f.stop()}}dispose(){var u,o,f,l,h;this._disposed||(this._disposed=!0,(u=this._listeners)===null||u===void 0||u.clear(),(o=this._deliveryQueue)===null||o===void 0||o.clear(),(l=(f=this._options)===null||f===void 0?void 0:f.onLastListenerRemove)===null||l===void 0||l.call(f),(h=this._leakageMon)===null||h===void 0||h.dispose())}}class D extends i{constructor(u){super(u);this._isPaused=0,this._eventQueue=new P.a,this._mergeFn=u==null?void 0:u.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const u=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(u))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(u){this._listeners&&(this._isPaused!==0?this._eventQueue.push(u):super.fire(u))}}class g extends D{constructor(u){var o;super(u);this._delay=(o=u.delay)!==null&&o!==void 0?o:100}fire(u){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(u)}}class p{constructor(){this.buffers=[]}wrapEvent(u){return(o,f,l)=>u(h=>{const a=this.buffers[this.buffers.length-1];a?a.push(()=>o.call(f,h)):o.call(f,h)},void 0,l)}bufferEvents(u){const o=[];this.buffers.push(o);const f=u();return this.buffers.pop(),o.forEach(l=>l()),f}}class m{constructor(){this.listening=!1,this.inputEvent=U.None,this.inputEventListener=$.a.None,this.emitter=new i({onFirstListenerDidAdd:()=>{this.listening=!0,this.inputEventListener=this.inputEvent(this.emitter.fire,this.emitter)},onLastListenerRemove:()=>{this.listening=!1,this.inputEventListener.dispose()}}),this.event=this.emitter.event}set input(u){this.inputEvent=u,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=u(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(ht,be,Z){"use strict";(function(re,$){Z.d(be,"b",function(){return f}),Z.d(be,"i",function(){return s}),Z.d(be,"f",function(){return A}),Z.d(be,"d",function(){return E}),Z.d(be,"g",function(){return S}),Z.d(be,"h",function(){return L}),Z.d(be,"c",function(){return O}),Z.d(be,"k",function(){return C}),Z.d(be,"j",function(){return T}),Z.d(be,"a",function(){return x}),Z.d(be,"e",function(){return v});var P;const X="en";let U=!1,k=!1,G=!1,W=!1,i=!1,D=!1,g=!1,p,m=X,u,o;const f=typeof self=="object"?self:typeof re=="object"?re:{};let l;typeof f.vscode!="undefined"&&typeof f.vscode.process!="undefined"?l=f.vscode.process:typeof $!="undefined"&&(l=$);const h=typeof((P=l==null?void 0:l.versions)===null||P===void 0?void 0:P.electron)=="string"&&l.type==="renderer";if(typeof navigator=="object"&&!h)o=navigator.userAgent,U=o.indexOf("Windows")>=0,k=o.indexOf("Macintosh")>=0,g=(o.indexOf("Macintosh")>=0||o.indexOf("iPad")>=0||o.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,G=o.indexOf("Linux")>=0,D=!0,p=navigator.language,m=p;else if(typeof l=="object"){U=l.platform==="win32",k=l.platform==="darwin",G=l.platform==="linux",W=G&&!!l.env.SNAP&&!!l.env.SNAP_REVISION,p=X,m=X;const y=l.env.VSCODE_NLS_CONFIG;if(y)try{const F=JSON.parse(y),B=F.availableLanguages["*"];p=F.locale,m=B||X,u=F._translationsConfigFile}catch(F){}i=!0}else console.error("Unable to resolve platform.");let a=0;k?a=1:U?a=3:G&&(a=2);const s=U,A=k,E=G,S=i,L=D,O=g,C=o,T=function(){if(f.setImmediate)return f.setImmediate.bind(f);if(typeof f.postMessage=="function"&&!f.importScripts){let B=[];f.addEventListener("message",j=>{if(j.data&&j.data.vscodeSetImmediateId)for(let N=0,b=B.length;N{const N=++R;B.push({id:N,callback:j}),f.postMessage({vscodeSetImmediateId:N},"*")}}if(typeof(l==null?void 0:l.nextTick)=="function")return l.nextTick.bind(l);const F=Promise.resolve();return B=>F.then(B)}(),x=k||g?2:U?1:3;let c=!0,w=!1;function v(){if(!w){w=!0;const y=new Uint8Array(2);y[0]=1,y[1]=2;const F=new Uint16Array(y.buffer);c=F[0]===(2<<8)+1}return c}}).call(this,Z("IyRk"),Z("Q2Ig"))},N0LK:function(ht,be,Z){"use strict";Z.d(be,"C",function(){return re}),Z.d(be,"v",function(){return P}),Z.d(be,"s",function(){return X}),Z.d(be,"t",function(){return U}),Z.d(be,"U",function(){return k}),Z.d(be,"J",function(){return G}),Z.d(be,"O",function(){return W}),Z.d(be,"p",function(){return i}),Z.d(be,"T",function(){return D}),Z.d(be,"q",function(){return g}),Z.d(be,"N",function(){return p}),Z.d(be,"M",function(){return m}),Z.d(be,"Q",function(){return u}),Z.d(be,"u",function(){return o}),Z.d(be,"x",function(){return f}),Z.d(be,"I",function(){return l}),Z.d(be,"f",function(){return h}),Z.d(be,"h",function(){return a}),Z.d(be,"g",function(){return s}),Z.d(be,"i",function(){return A}),Z.d(be,"G",function(){return E}),Z.d(be,"H",function(){return S}),Z.d(be,"r",function(){return L}),Z.d(be,"R",function(){return O}),Z.d(be,"d",function(){return C}),Z.d(be,"e",function(){return T}),Z.d(be,"E",function(){return x}),Z.d(be,"F",function(){return c}),Z.d(be,"j",function(){return w}),Z.d(be,"z",function(){return v}),Z.d(be,"K",function(){return F}),Z.d(be,"L",function(){return B}),Z.d(be,"m",function(){return j}),Z.d(be,"k",function(){return b}),Z.d(be,"A",function(){return ee}),Z.d(be,"a",function(){return ae}),Z.d(be,"n",function(){return ue}),Z.d(be,"l",function(){return Oe}),Z.d(be,"D",function(){return Ee}),Z.d(be,"B",function(){return xe}),Z.d(be,"b",function(){return Ae}),Z.d(be,"S",function(){return Re}),Z.d(be,"o",function(){return pe}),Z.d(be,"P",function(){return he}),Z.d(be,"w",function(){return ke}),Z.d(be,"c",function(){return et}),Z.d(be,"y",function(){return at});function re(se){return!se||typeof se!="string"?!0:se.trim().length===0}const $=/{(\d+)}/g;function P(se,..._e){return _e.length===0?se:se.replace($,function(Te,Se){const Ge=parseInt(Se,10);return isNaN(Ge)||Ge<0||Ge>=_e.length?Te:_e[Ge]})}function X(se){return se.replace(/[<>&]/g,function(_e){switch(_e){case"<":return"<";case">":return">";case"&":return"&";default:return _e}})}function U(se){return se.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function k(se,_e=" "){const Te=G(se,_e);return W(Te,_e)}function G(se,_e){if(!se||!_e)return se;const Te=_e.length;if(Te===0||se.length===0)return se;let Se=0;for(;se.indexOf(_e,Se)===Se;)Se=Se+Te;return se.substring(Se)}function W(se,_e){if(!se||!_e)return se;const Te=_e.length,Se=se.length;if(Te===0||Se===0)return se;let Ge=Se,Ne=-1;for(;!(Ne=se.lastIndexOf(_e,Ge-1),Ne===-1||Ne+Te!==Ge);){if(Ne===0)return"";Ge=Ne}return se.substring(0,Ge)}function i(se){return se.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function D(se){return se.replace(/\*/g,"")}function g(se,_e,Te={}){if(!se)throw new Error("Cannot create regex from empty string");_e||(se=U(se)),Te.wholeWord&&(/\B/.test(se.charAt(0))||(se="\\b"+se),/\B/.test(se.charAt(se.length-1))||(se=se+"\\b"));let Se="";return Te.global&&(Se+="g"),Te.matchCase||(Se+="i"),Te.multiline&&(Se+="m"),Te.unicode&&(Se+="u"),new RegExp(se,Se)}function p(se){if(se.source==="^"||se.source==="^$"||se.source==="$"||se.source==="^\\s*$")return!1;const _e=se.exec("");return!!(_e&&se.lastIndex===0)}function m(se){return(se.global?"g":"")+(se.ignoreCase?"i":"")+(se.multiline?"m":"")+(se.unicode?"u":"")}function u(se){return se.split(/\r\n|\r|\n/)}function o(se){for(let _e=0,Te=se.length;_e=0;Te--){const Se=se.charCodeAt(Te);if(Se!==32&&Se!==9)return Te}return-1}function h(se,_e){return se<_e?-1:se>_e?1:0}function a(se,_e,Te=0,Se=se.length,Ge=0,Ne=_e.length){for(;TeVe)return 1}const Fe=Se-Te,Ke=Ne-Ge;return FeKe?1:0}function s(se,_e){return A(se,_e,0,se.length,0,_e.length)}function A(se,_e,Te=0,Se=se.length,Ge=0,Ne=_e.length){for(;Te=128||Ve>=128)return a(se.toLowerCase(),_e.toLowerCase(),Te,Se,Ge,Ne);E(Je)&&(Je-=32),E(Ve)&&(Ve-=32);const tt=Je-Ve;if(tt===0)continue;return tt}const Fe=Se-Te,Ke=Ne-Ge;return FeKe?1:0}function E(se){return se>=97&&se<=122}function S(se){return se>=65&&se<=90}function L(se,_e){return se.length===_e.length&&A(se,_e)===0}function O(se,_e){const Te=_e.length;return _e.length>se.length?!1:A(se,_e,0,Te)===0}function C(se,_e){let Te,Se=Math.min(se.length,_e.length);for(Te=0;Te1){const Se=se.charCodeAt(_e-2);if(x(Se))return w(Se,Te)}return Te}function F(se,_e){const Te=We.getInstance(),Se=_e,Ge=se.length,Ne=v(se,Ge,_e);_e+=Ne>=65536?2:1;let Fe=Te.getGraphemeBreakType(Ne);for(;_e=65536?2:1,Fe=Je}return _e-Se}function B(se,_e){const Te=We.getInstance(),Se=_e,Ge=y(se,_e);_e-=Ge>=65536?2:1;let Ne=Te.getGraphemeBreakType(Ge);for(;_e>0;){const Fe=y(se,_e),Ke=Te.getGraphemeBreakType(Fe);if(et(Ke,Ne))break;_e-=Fe>=65536?2:1,Ne=Ke}return Se-_e}const R=/(?:[\u05BE\u05C0\u05C3\u05C6\u05D0-\u05F4\u0608\u060B\u060D\u061B-\u064A\u066D-\u066F\u0671-\u06D5\u06E5\u06E6\u06EE\u06EF\u06FA-\u0710\u0712-\u072F\u074D-\u07A5\u07B1-\u07EA\u07F4\u07F5\u07FA-\u0815\u081A\u0824\u0828\u0830-\u0858\u085E-\u08BD\u200F\uFB1D\uFB1F-\uFB28\uFB2A-\uFD3D\uFD50-\uFDFC\uFE70-\uFEFC]|\uD802[\uDC00-\uDD1B\uDD20-\uDE00\uDE10-\uDE33\uDE40-\uDEE4\uDEEB-\uDF35\uDF40-\uDFFF]|\uD803[\uDC00-\uDCFF]|\uD83A[\uDC00-\uDCCF\uDD00-\uDD43\uDD50-\uDFFF]|\uD83B[\uDC00-\uDEBB])/;function j(se){return R.test(se)}const N=/(?:[\u231A\u231B\u23F0\u23F3\u2600-\u27BF\u2B50\u2B55]|\uD83C[\uDDE6-\uDDFF\uDF00-\uDFFF]|\uD83D[\uDC00-\uDE4F\uDE80-\uDEFC\uDFE0-\uDFEB]|\uD83E[\uDD00-\uDDFF\uDE70-\uDED6])/;function b(se){return N.test(se)}const Y=/^[\t\n\r\x20-\x7E]*$/;function ee(se){return Y.test(se)}const ae=/[\u2028\u2029]/;function ue(se){return ae.test(se)}function Oe(se){for(let _e=0,Te=se.length;_e=11904&&se<=55215||se>=63744&&se<=64255||se>=65281&&se<=65374}function xe(se){return se>=127462&&se<=127487||se===8986||se===8987||se===9200||se===9203||se>=9728&&se<=10175||se===11088||se===11093||se>=127744&&se<=128591||se>=128640&&se<=128764||se>=128992&&se<=129003||se>=129280&&se<=129535||se>=129648&&se<=129750}const Ae=String.fromCharCode(65279);function Re(se){return!!(se&&se.length>0&&se.charCodeAt(0)===65279)}function pe(se,_e=!1){return se?(_e&&(se=se.replace(/\\./g,"")),se.toLowerCase()!==se):!1}function he(se){const _e=90-65+1;return se=se%(2*_e),se<_e?String.fromCharCode(97+se):String.fromCharCode(65+se-_e)}function ke(se){const _e=We.getInstance();return _e.getGraphemeBreakType(se)}function et(se,_e){return se===0?_e!==5&&_e!==7:se===2&&_e===3?!1:se===4||se===2||se===3||(_e===4||_e===2||_e===3)?!0:se===8&&(_e===8||_e===9||_e===11||_e===12)||((se===11||se===9)&&(_e===9||_e===10)||((se===12||se===10)&&_e===10||(_e===5||_e===13||(_e===7||(se===1||se===13&&_e===14)))))?!1:!(se===6&&_e===6)}class We{constructor(){this._data=it()}static getInstance(){return We._INSTANCE||(We._INSTANCE=new We),We._INSTANCE}getGraphemeBreakType(se){if(se<32)return se===10?3:se===13?2:4;if(se<127)return 0;const _e=this._data,Te=_e.length/3;let Se=1;for(;Se<=Te;)if(se<_e[3*Se])Se=2*Se;else if(se>_e[3*Se+1])Se=2*Se+1;else return _e[3*Se+2];return 0}}We._INSTANCE=null;function it(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function at(se,_e){if(se===0)return 0;const Te=Pe(se,_e);if(Te!==void 0)return Te;const Se=y(_e,se);return se-=je(Se),se}function Pe(se,_e){let Te=y(_e,se);for(se-=je(Te);$e(Te)||Te===65039||Te===8419;){if(se===0)return;Te=y(_e,se),se-=je(Te)}if(!xe(Te))return;if(se>=0){const Se=y(_e,se);Se===8205&&(se-=je(Se))}return se}function je(se){return se>=65536?2:1}function $e(se){return 127995<=se&&se<=127999}},Ot1p:function(ht,be,Z){"use strict";var re=Z("2qtc"),$=Z("kLXV"),P=Z("rAM+"),X=Z("miYZ"),U=Z("tsqr"),k=Z("9og8"),G=Z("tJVT"),W=Z("jrin"),i=Z("WmNS"),D=Z.n(i),g=Z("q1tI"),p=Z.n(g),m=Z("VrN/"),u=Z.n(m),o=Z("bdgK"),f=Z("p77/"),l=Z("Bd2K"),h=Z("ELLl"),a=Z("19Vz"),s=Z("lZu9"),A=Z("+NIl"),E=Z("kSUc"),S=Z("9Bee"),L=function(ye){var Le=ye.value,Ue=Le===void 0?"":Le,Ze=ye.className,mt=ye.showTextOnly,ft=ye.showLines,Ct=ye.style,xt=Ct===void 0?{}:Ct,Qe=Object(g.useMemo)(function(){return""},[Ue]);return p.a.createElement(p.a.Fragment,null,p.a.createElement("div",{dangerouslySetInnerHTML:{__html:Qe}}))},O=Z("0Owb"),C=Z("dejd"),T=Z("C+DQ"),x=Z("1vsH"),c=Z("m3rI"),w=[{title:"\u7C97\u4F53",icon:"icon-bold",actionName:"bold"},{title:"\u659C\u4F53",icon:"icon-italic",actionName:"italic"},"|",{title:"\u65E0\u5E8F\u5217\u8868",icon:"icon-unorder-list",actionName:"list-ul"},{title:"\u6709\u5E8F\u5217\u8868",icon:"icon-order-list",actionName:"list-ol"},"|",{title:"\u884C\u5185\u4EE3\u7801",icon:"icon-code",actionName:"code"},{title:"\u4EE3\u7801\u5757\uFF08\u591A\u8BED\u8A00\u98CE\u683C\uFF09",icon:"icon-file-code",actionName:"code-block"},{title:"\u94FE\u63A5",icon:"icon-link",actionName:"link"},"|",{title:"\u884C\u5185\u516C\u5F0F",icon:"icon-sum",actionName:"inline-latex"},{title:"\u591A\u884C\u516C\u5F0F",icon:"icon-formula",actionName:"latex"},"|",{title:"\u6DFB\u52A0\u56FE\u7247",icon:"icon-picture",actionName:"upload-image"},{title:"\u8868\u683C",icon:"icon-table",actionName:"add-table"},"|",{title:"\u6362\u884C",icon:"icon-minus",actionName:"line-break"},{title:"\u6E05\u7A7A",icon:"icon-eraser",actionName:"eraser"}];function v(ye){var Le=ye.onActionCallback,Ue=ye.title,Ze=ye.icon,mt=ye.actionName,ft=ye.className,Ct=ft===void 0?"":ft,xt=ye.children;function Qe(){Le(mt)}return p.a.createElement("a",{title:Ue,className:Ct,onClick:Qe},p.a.createElement("i",{className:"md-iconfont ".concat(Ze)}),xt)}var y=function(ye){var Le=ye.watch,Ue=ye.showNullButton,Ze=ye.onActionCallback,mt=ye.fullScreen,ft=ye.insertTemp,Ct=ye.hidetoolBar,xt=ye.uuid,Qe=ye.setOpenPhones;console.log("link:","".concat(location.origin,"/upload.html?_educoder_session_login=").concat(Object(x.F)("_educoder_session_login"),"&_educoder_session=").concat(Object(x.F)("_educoder_session"),"&key=").concat(xt,"&api=").concat(encodeURIComponent(c.a.PROXY_SERVER)));var Lt=[].concat(w,[{title:"".concat(Le?"\u5173\u95ED\u5B9E\u65F6\u9884\u89C8":"\u5F00\u542F\u5B9E\u65F6\u9884\u89C8"),icon:"".concat(Le?"icon-eye-slash":"icon-eye"),actionName:"trigger-watch"}]);return p.a.createElement("ul",{className:"markdown-toolbar-container"},!Ct&&Lt.map(function(vt,Ft){return p.a.createElement("li",{key:Ft},vt.actionName?p.a.createElement(v,Object(O.a)({},vt,{onActionCallback:Ze})):p.a.createElement("span",{className:"v-line"}))}),Ue?p.a.createElement("li",null,p.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u589E\u52A0\u586B\u7A7A",actionName:"add-null-ch",onActionCallback:Ze},p.a.createElement("span",{className:"fill-tip"},"\u70B9\u51FB\u63D2\u5165\b\u586B\u7A7A\u9879"))):null,ft&&p.a.createElement("li",null,p.a.createElement(v,{icon:"icon-edit",className:"btn-null",title:"\u63D2\u5165\u6A21\u677F",actionName:"inster-template-".concat(ft),onActionCallback:Ze},p.a.createElement("span",{className:"fill-tip"},"\u63D2\u5165\u6A21\u677F"))),p.a.createElement("li",{className:"btn-full-screen"},p.a.createElement(v,{icon:"".concat(mt?"icon-shrink":"icon-enlarge"),title:mt?"\u5173\u95ED\u5168\u5C4F":"\u5F00\u542F\u5168\u5C4F",actionName:"trigger-full-screen",onActionCallback:Ze})))},F=Z("M8RZ"),B=Z("+L6B"),R=Z("2/Rp"),j=Z("y8nQ"),N=Z("Vl3Y"),b=Z("5NDa"),Y=Z("5rEg"),ee={labelCol:{span:4},wrapperCol:{span:20}},ae=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Ze(mt){Le(mt)}return p.a.createElement(N.a,Object(O.a)({},ee,{initialValues:{link:"http://",title:""},className:"link-panel",onFinish:Ze}),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u5730\u5740",name:"link",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u5730\u5740"}]},p.a.createElement(Y.a,null)),p.a.createElement(N.a.Item,{label:"\u94FE\u63A5\u6807\u9898",name:"title",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u94FE\u63A5\u6807\u9898"}]},p.a.createElement(Y.a,null)),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},ue=Z("7ahc"),Oe=Z("HmJG"),Ee=Z("BjJ7"),xe=N.a.useForm,Ae={width:280,marginRight:10},Re={labelCol:{span:5},wrapperCol:{span:19}},pe=function(ye){var Le=ye.callback,Ue=ye.onCancel,Ze=xe(),mt=Object(G.a)(Ze,1),ft=mt[0];function Ct(Lt){Le(Lt)}function xt(Lt,vt){if(Lt.status===-1){U.b.error(Lt.message);return}ft.setFieldsValue({src:"/api/attachments/".concat(Lt.id),type:vt.type})}function Qe(Lt){var vt=Lt.target.files[0];ke(vt,xt)}return p.a.createElement(N.a,Object(O.a)({form:ft},Re,{className:"upload-image-panel",onFinish:Ct}),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u5730\u5740",required:!0},p.a.createElement("div",{className:"flex-container"},p.a.createElement(N.a.Item,{noStyle:!0,name:"src",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u56FE\u7247\u5730\u5740"}]},p.a.createElement(Y.a,{style:Ae})),p.a.createElement(he,{onFileChange:Qe}))),p.a.createElement(N.a.Item,{label:"\u56FE\u7247\u63CF\u8FF0",name:"alt"},p.a.createElement(Y.a,{style:{width:264}})),p.a.createElement(N.a.Item,{style:{textAlign:"right"}},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))};function he(ye){var Le=ye.onFileChange;return p.a.createElement("a",{className:"upload-button"},"\u672C\u5730\u4E0A\u4F20",p.a.createElement("input",{type:"file",onChange:Le}))}function ke(ye,Le){if(!ye)throw new String("\u6CA1\u6709\u6587\u4EF6");var Ue=new FormData;Ue.append("editormd-image-file",ye),Ue.append("file_param_name","editormd-image-file"),Ue.append("byxhr","true");var Ze=new window.XMLHttpRequest;Ze.withCredentials=!0,Ze.addEventListener("load",function(mt){Le(JSON.parse(mt.target.responseText),ye)},!1),Ze.addEventListener("error",function(mt){console.error(mt)},!1),Ze.open("POST","".concat(Ee.a,"/api/attachments.json")),Ze.send(Ue)}var et=Z("giR+"),We=Z("fyUT"),it=Z("7Kak"),at=Z("9yH6"),Pe=at.a.Group,je={margin:"0 8px"},$e=function(ye){var Le=ye.callback,Ue=ye.onCancel;function Ze(mt){Le(mt)}return p.a.createElement(N.a,{className:"add-table-panel",initialValues:{row:3,col:2,align:"default"},onFinish:Ze},p.a.createElement("div",{className:"flex-container",style:{alignItems:"baseline"}},p.a.createElement("span",{style:je},"\u5355\u5143\u683C\u6570\uFF1A"),p.a.createElement("span",{style:je},"\u884C\u6570"),p.a.createElement(N.a.Item,{name:"row",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u884C\u6570"}]},p.a.createElement(We.a,null)),p.a.createElement("span",{style:je},"\u5217\u6570"),p.a.createElement(N.a.Item,{name:"col",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u5217\u6570"}]},p.a.createElement(We.a,null))),p.a.createElement("div",{className:"flex-container",style:{marginTop:12,alignItems:"baseline"}},p.a.createElement("span",{style:je},"\u5BF9\u9F50\u65B9\u5F0F\uFF1A"),p.a.createElement(N.a.Item,{name:"align"},p.a.createElement(Pe,null,p.a.createElement(at.a,{value:"default"},p.a.createElement("i",{className:"fa fa-align-justify"})),p.a.createElement(at.a,{value:"left"},p.a.createElement("i",{className:"fa fa-align-left"})),p.a.createElement(at.a,{value:"center"},p.a.createElement("i",{className:"fa fa-align-center"})),p.a.createElement(at.a,{value:"right"},p.a.createElement("i",{className:"fa fa-align-right"}))))),p.a.createElement("div",{className:"flex-container flex-end"},p.a.createElement(R.a,{type:"primary",htmlType:"submit",style:{marginRight:10}},"\u786E\u5B9A"),p.a.createElement(R.a,{type:"ghost",onClick:Ue},"\u53D6\u6D88")))},se=Z("ErOA"),_e=Z("7Cbv"),Te="link",Se="upload-image",Ge="code-block",Ne="add-table",Fe="------------",Ke={default:Fe,left:":".concat(Fe),center:":".concat(Fe,":"),right:"".concat(Fe,":")},Je=Z("9VGf"),Ve,tt;function Ie(){}var nt=0,st=1e4,De="\u2581",Me=` **\u6A21\u677F\u6807\u9898** \u6A21\u677F\u6B63\u6587\u5185\u5BB9\uFF0C\u53EF\u8F93\u5165\u6587\u672C\u5185\u5BB9\u548C\u7C98\u8D34\u56FE\u7247\u7B49\u64CD\u4F5C`;function ve(ye){return/^\d+$/.test(ye)?"".concat(ye,"px"):ye}var ce=navigator.platform.toUpperCase().indexOf("MAC")>=0,fe=ce?"Cmd":"Ctrl",ne=["pptm","pptx","ppt","pot","pps","ppa","potx","ppsx","ppam","pptm","potm","ppsm","doc","docx","dot","dotx","docm","dotm","xls","xlsx","csv","xlt","xla","xltx","xlsm","xltm","xlam","xlsb"],ie=(Ve={},Object(W.a)(Ve,fe+"-B","bold"),Object(W.a)(Ve,fe+"-I","italic"),Ve),oe=(tt={},Object(W.a)(tt,Te,"\u6DFB\u52A0\u94FE\u63A5"),Object(W.a)(tt,Ge,"\u6DFB\u52A0\u4EE3\u7801\u5757"),Object(W.a)(tt,Se,"\u6DFB\u52A0\u6587\u4EF6"),Object(W.a)(tt,Ne,"\u6DFB\u52A0\u8868\u683C"),tt),le=be.a=function(ye){var Le=ye.defaultValue,Ue=Le===void 0?"":Le,Ze=ye.onChange,mt=ye.width,ft=mt===void 0?"100%":mt,Ct=ye.height,xt=Ct===void 0?400:Ct,Qe=ye.miniToolbar,Lt=Qe===void 0?!1:Qe,vt=ye.isFocus,Ft=vt===void 0?!1:vt,Pt=ye.watch,Rt=ye.insertTemp,pi=ye.mode,ai=pi===void 0?"markdown":pi,bt=ye.id,ti=bt===void 0?"markdown-editor-id":bt,_t=ye.showResizeBar,Tt=_t===void 0?!1:_t,Wt=ye.noStorage,ii=Wt===void 0?!1:Wt,ui=ye.showNullButton,dt=ui===void 0?!1:ui,ut=ye.hidetoolBar,qt=ut===void 0?!1:ut,Ot=ye.fullScreen,Mt=Ot===void 0?!1:Ot,Dt=ye.onBlur,Ut=ye.onCMBeforeChange,hi=ye.onFullScreen,Yi=ye.className,Ye=Yi===void 0?"":Yi,It=ye.disablePaste,mn=It===void 0?!1:It,gn=ye.placeholder,vn=gn===void 0?"":gn,yn=ye.values,V=yn===void 0?"":yn,_=Object(g.useState)(null),I=Object(G.a)(_,2),H=I[0],q=I[1],z=Object(g.useState)(Ue),ge=Object(G.a)(z,2),He=ge[0],rt=ge[1],gt=Object(g.useState)(Pt),ze=Object(G.a)(gt,2),wt=ze[0],zt=ze[1],ei=Object(g.useState)(Mt),Hi=Object(G.a)(ei,2),Ci=Hi[0],Ai=Hi[1],Zi=Object(g.useState)(""),Dn=Object(G.a)(Zi,2),vi=Dn[0],zi=Dn[1],un=Object(g.useState)(0),hn=Object(G.a)(un,2),Wi=hn[0],kn=hn[1],bn=Object(g.useState)(xt),zn=Object(G.a)(bn,2),Vn=zn[0],Qi=zn[1],$i=Object(g.useState)(!1),_n=Object(G.a)($i,2),dr=_n[0],En=_n[1],oi=Object(g.useRef)(Object(_e.a)()),Vt=Object(g.useRef)(!1),Ti=Object(g.useRef)(),jt=Object(g.useRef)(),di=Object(g.useRef)(),$t=Object(g.useRef)(),rn=Object(g.useRef)(),yi=function(){var yt=Object(k.a)(D.a.mark(function kt(){var St,Bt;return D.a.wrap(function(Zt){for(;;)switch(Zt.prev=Zt.next){case 0:return Zt.next=2,Object(se.a)("/api/attachments/distinct_hash_val.json",{method:"post",body:{hash_val:oi.current}});case 2:Bt=Zt.sent,Bt!=null&&(St=Bt.attachments)!==null&&St!==void 0&&St.length&&(console.log("cm:",H,jt),Bt.attachments.map(function(Gt){Gt.content_type.indexOf("image")>-1?H.replaceSelection("![,](/api/attachments/".concat(Gt.id,"?type=").concat(Gt.content_type,")")):Gt.content_type.indexOf("video")>-1?H.replaceSelection('')):Gt.content_type.indexOf("pdf")>-1?H.replaceSelection('
    ').concat(Gt.name,"")):H.replaceSelection("[".concat(Gt.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Gt.id,"?type=").concat(Gt.content_type,")"))}));case 4:case"end":return Zt.stop()}},kt)}));return function(){return yt.apply(this,arguments)}}();Object(g.useEffect)(function(){rt(V),H==null||H.setValue(V)},[V]),Object(g.useEffect)(function(){hi==null||hi(Ci)},[Ci]),Object(g.useEffect)(function(){if(jt.current){var yt=u.a.fromTextArea(jt.current,{mode:ai,lineNumbers:!Lt,lineWrapping:!0,value:Ue,autoCloseTags:!0,autoCloseBrackets:!0});Ft&&yt.focus();function kt(St,Bt){if(mn){Bt.preventDefault();return}var Kt=Bt.clipboardData;if(Kt){var Zt=Kt.types.toString(),Gt=Kt.items;if(Zt==="Files"||Kt.types.indexOf("Files")>-1){if(Bt.preventDefault(),ai=="stex")return;try{var mi,Mi=Gt[1];((mi=Gt[0])===null||mi===void 0?void 0:mi.kind)==="file"&&(Mi=Gt[0]);var Ht=Mi.getAsFile(),dn=Ht.name.split(".").pop();ke(Ht,function(Xt){if(Xt.id){var Pi,Ri,Ji;(Ht==null||((Pi=Ht.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Xt.id,"?type=").concat(Xt.content_type,")")):(Ht==null||((Ri=Ht.type)===null||Ri===void 0)?void 0:Ri.indexOf("video"))>-1?yt.replaceSelection('')):(Ht==null||((Ji=Ht.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Ht.name,"")):ne.includes(dn)?yt.replaceSelection('').concat(Ht.name,"")):yt.replaceSelection("[".concat(Ht.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})}catch(Xt){U.b.warn("\u8BF7\u4F7F\u7528chrome\u6D4F\u89C8\u5668\u7C98\u8D34")}return!0}else return!0}return!0}return yt.on("paste",kt),yt.on("dragleave",function(St,Bt){di.current.classList.remove("mouse-hover-md")}),yt.on("dragover",function(St,Bt){di.current.classList.add("mouse-hover-md")}),yt.on("drop",function(St,Bt){di.current.classList.add("mouse-hover-md");var Kt;if(Kt=Bt.dataTransfer.files,Kt.length>0){Bt.preventDefault(),Bt.stopPropagation();for(var Zt=function(Mi){var Ht=Kt[Mi],dn=Ht.name.split(".").pop();ke(Ht,function(Xt){if(Xt.id){var Pi,Ri,Ji;(Ht==null||((Pi=Ht.type)===null||Pi===void 0)?void 0:Pi.indexOf("image"))>-1?yt.replaceSelection("![,](/api/attachments/".concat(Xt.id,"?type=").concat(Xt.content_type,")")):(Ht==null||((Ri=Ht.type)===null||Ri===void 0)?void 0:Ri.indexOf("video"))>-1?yt.replaceSelection('')):(Ht==null||((Ji=Ht.type)===null||Ji===void 0)?void 0:Ji.indexOf("pdf"))>-1?yt.replaceSelection('').concat(Ht.name,"")):ne.includes(dn)?yt.replaceSelection('').concat(Ht.name,"")):yt.replaceSelection("[".concat(Ht.name,"](").concat(c.a.API_SERVER,"/api/attachments/").concat(Xt.id,"?type=").concat(Xt.content_type,")"))}else(Xt==null?void 0:Xt.status)===401&&(document.location.href="/user/login")})},Gt=0;Gt0||Gt.target.offsetWidth>0)&&(Ii(),H.setSize("100%","100%"),H.refresh())}}catch(mi){Kt.e(mi)}finally{Kt.f()}});return St.observe(jt.current.parentElement),St}if(H){var kt=yt();return function(){kt.unobserve(jt.current.parentElement)}}},[H,Ii]),Object(g.useEffect)(function(){if(H){for(var yt=[],kt=function(){var Gt=Bt[St];Kt=Object(G.a)(Gt,2);var mi=Kt[0],Mi=Kt[1],Ht=Object(W.a)({},mi,function(){Xn(Mi)});yt.push(Ht),H.addKeyMap(Ht)},St=0,Bt=Object.entries(ie);St0){var yt=new Date().getTime(),kt=window.sessionStorage.getItem(ti);yt>=Wi+st&&(!kt||kt!==He)&&(window.sessionStorage.setItem(ti,He),En(!0))}},st),Object(g.useEffect)(function(){zt(Pt)},[H,Pt]),Object(g.useEffect)(function(){H&&(Ft&&H.focus())},[H,Ft]),Object(g.useEffect)(function(){if(wt&&H){var yt=H.getScrollerElement();function kt(St){var Bt=St.target;if(rn.current){var Kt=Bt.scrollTop/Bt.scrollHeight;rn.current.scrollTop=rn.current.scrollHeight*Kt}}return yt.addEventListener("scroll",kt),function(){yt.removeEventListener("scroll",kt)}}},[H,wt]),Object(g.useEffect)(function(){if(H&&Ut){function yt(kt,St){Ut(kt,St)}return H.on("beforeChange",yt),function(){H.off("beforeChange",yt)}}},[H,Ut]),Object(g.useEffect)(function(){if(H&&Dt){function yt(){Dt(H.getValue())}return H.on("blur",yt),function(){H.off("blur",yt)}}},[H,Dt]),Object(g.useEffect)(function(){if(H){function yt(kt){var St=kt.getValue();rt(St),kn(new Date().getTime()),kt.getScrollerElement().dispatchEvent(new CustomEvent("scroll")),Ze&&Ze(St)}return H.on("change",yt),function(){H.off("change",yt)}}},[H,Ze]),Object(g.useEffect)(function(){H&&(Ue==null?(H.setValue(""),rt("")):Ue!==H.getValue()&&(H.setValue(Ue),rt(Ue),H.setCursor(H.lineCount(),0)))},[H,Ue]);var Xn=Object(g.useCallback)(function(yt){var kt=H.getCursor(),St=H.getSelection(),Bt=St.split(` `);switch(yt){case"bold":return H.replaceSelection("**"+St+"**"),St===""&&H.setCursor(kt.line,kt.ch+2),H.focus();case"italic":return H.replaceSelection("*"+St+"*"),St===""&&H.setCursor(kt.line,kt.ch+1),H.focus();case"code":return H.replaceSelection("`"+St+"`"),St===""&&H.setCursor(kt.line,kt.ch+1),H.focus();case"inline-latex":return H.replaceSelection("`$$"+St+"$$`"),St===""&&H.setCursor(kt.line,kt.ch+3),H.focus();case"latex":return H.replaceSelection("```latex\n"+St+"\n```"),H.setCursor(kt.line+1,St.length+1),H.focus();case"line-break":return H.replaceSelection(`
    `),H.focus();case"list-ul":return St===""?H.replaceSelection("- "+St):H.replaceSelection(Bt.map(function(Kt){return Kt===""?"":"- ".concat(Kt)}).join(` `)),H.focus();case"list-ol":return St===""?H.replaceSelection("1. "+St):H.replaceSelection(Bt.map(function(Kt,Zt){return Kt===""?"":"".concat(Zt+1,". ").concat(Kt)}).join(` `)),H.focus();case"add-null-ch":return St===""&&H.setCursor(kt.line,kt.ch+1),H.replaceSelection(De),H.focus();case"inster-template-1":return St===""&&H.setCursor(kt.line,kt.ch),H.replaceSelection(Me),H.focus();case"eraser":return H.setValue(""),H.focus();case"trigger-watch":return zt(!wt),H.focus();case"trigger-full-screen":return Ai(!Ci),H.focus();case Te:zi(Te);return;case Ge:zi(Ge);return;case Se:zi(Se);return;case Ne:zi(Ne);return;default:throw new Error}},[H,wt,Ci]),xn=Object(g.useCallback)(function(yt){zi("");switch(vi){case Te:var kt=yt.title,St=yt.link;return H.replaceSelection("[".concat(kt,"](").concat(St,")")),H.focus();case Ge:var Bt=yt.language,Kt=yt.content;return H.replaceSelection(["```"+Bt,Kt,"```"].join(` `)),H.focus();case Se:var Zt=yt.src,Gt=yt.alt;return Gt?H.replaceSelection("![ ".concat(Gt," ]( ").concat(Zt,' "').concat(Gt,'" )')):H.replaceSelection("![,](".concat(Zt,")")),H.focus();case Ne:for(var mi=yt.row,Mi=yt.col,Ht=yt.align,dn=` `,Xt=0;Xt300&&(mi=300);var Mi=xt+mi+"px";Qi(Mi)}}return yt.addEventListener("mousedown",Bt),document.addEventListener("mousemove",Zt),document.addEventListener("mouseup",Kt),function(){yt.removeEventListener("mousedown",Bt),document.removeEventListener("mousemove",Zt),document.removeEventListener("mouseup",Kt)}}},[H,$t]),Object(g.useEffect)(function(){Qi(xt)},[xt]);var an=ve(ft),fr=ve(Vn),qi={width:an,height:fr},pr=Object(g.useMemo)(function(){if(Wi){var yt=new Date(Wi),kt=yt.getHours(),St=yt.getMinutes(),Bt=yt.getSeconds();return kt=kt<10?"0"+kt:kt,St=St<10?"0"+St:St,Bt=Bt<10?"0"+Bt:Bt,"".concat(kt,":").concat(St,":").concat(Bt)}return 0},[Wi]);function jr(){window.sessionStorage.removeItem(ti),En(!1),kn(0)}function Mn(){En(!1),kn(0),H.setValue(window.sessionStorage.getItem(ti))}function ua(yt,kt){var St=H.getValue();St=St.replace(yt,kt),rt(St),H==null||H.setValue(St)}return p.a.createElement(g.Fragment,null,p.a.createElement("div",{className:"markdown-editor-wrapper",ref:di},p.a.createElement("div",{className:"markdown-editor-container ".concat(Ye," ").concat(wt?"on-preview":""," ").concat(Lt?"mini":""," ").concat(Ci?"full-screen":""),style:qi},p.a.createElement(y,{insertTemp:Rt,watch:wt,fullScreen:Ci,showNullButton:dt,onActionCallback:Xn,hidetoolBar:qt,uuid:oi.current,setOpenPhones:function(){Vt.current=!0}}),p.a.createElement("div",{className:"markdown-editor-body"},p.a.createElement("div",{className:"codemirror-container"},p.a.createElement("textarea",{ref:jt,placeholder:vn})),wt?p.a.createElement("div",{ref:rn,className:"preview-container"},ai==="stex"&&p.a.createElement(L,{value:He}),ai!=="stex"&&p.a.createElement(S.a,{edit:!0,value:He,replaces:ua})):null))),Tt?p.a.createElement("a",{ref:$t,className:"editor-resize"}):null,p.a.createElement(F.a,null,oe[vi]?p.a.createElement($.a,{centered:!0,title:oe[vi],visible:!0,onCancel:Tn,footer:null,className:"markdown-popup-form"},cr):null))}},SJMd:function(ht,be){/** * @license * Copyright (C) 2006 Google Inc. * * Licensed under the Apache License, Version 2.0 (the "License"); * you may not use this file except in compliance with the License. * You may obtain a copy of the License at * * http://www.apache.org/licenses/LICENSE-2.0 * * Unless required by applicable law or agreed to in writing, software * distributed under the License is distributed on an "AS IS" BASIS, * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. * See the License for the specific language governing permissions and * limitations under the License. */var Z,re,$,P=!1,X,U;window.PR_SHOULD_USE_CONTINUATION=!0;var k,G;(function(){var W=window,i=["break,continue,do,else,for,if,return,while"],D=[i,"auto,case,char,const,default,double,enum,extern,float,goto,inline,int,long,register,restrict,short,signed,sizeof,static,struct,switch,typedef,union,unsigned,void,volatile"],g=[D,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[g,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],m=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],u=[g,"abstract,add,alias,as,ascending,async,await,base,bool,by,byte,checked,decimal,delegate,descending,dynamic,event,finally,fixed,foreach,from,get,global,group,implicit,in,interface,internal,into,is,join,let,lock,null,object,out,override,orderby,params,partial,readonly,ref,remove,sbyte,sealed,select,set,stackalloc,string,select,uint,ulong,unchecked,unsafe,ushort,value,var,virtual,where,yield"],o="all,and,by,catch,class,else,extends,false,finally,for,if,in,is,isnt,loop,new,no,not,null,of,off,on,or,return,super,then,throw,true,try,unless,until,when,while,yes",f=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],l="caller,delete,die,do,dump,elsif,eval,exit,foreach,for,goto,if,import,last,local,my,next,no,our,print,package,redo,require,sub,undef,unless,until,use,wantarray,while,BEGIN,END",h=[i,"and,as,assert,class,def,del,elif,except,exec,finally,from,global,import,in,is,lambda,nonlocal,not,or,pass,print,raise,try,with,yield,False,True,None"],a=[i,"alias,and,begin,case,class,def,defined,elsif,end,ensure,false,in,module,next,nil,not,or,redo,rescue,retry,self,super,then,true,undef,unless,until,when,yield,BEGIN,END"],s=[i,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],A=[p,u,m,f,l,h,a,s],E=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,S="str",L="kwd",O="com",C="typ",T="lit",x="pun",c="pln",w="tag",v="dec",y="src",F="atn",B="atv",R="nocode",j="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function N(Pe){for(var je=0,$e=!1,se=!1,_e=0,Te=Pe.length;_e122||(ne<65||fe>90||nt.push([Math.max(65,fe)|32,Math.min(ne,90)|32]),ne<97||fe>122||nt.push([Math.max(97,fe)&~32,Math.min(ne,122)&~32]))}}nt.sort(function(ye,Le){return ye[0]-Le[0]||Le[1]-ye[1]});for(var ie=[],oe=[],Me=0;Mele[0]&&(le[1]+1>le[0]&&De.push("-"),De.push(Fe(le[1])))}return De.push("]"),De.join("")}function Je(tt){for(var Ie=tt.source.match(new RegExp("(?:\\[(?:[^\\x5C\\x5D]|\\\\[\\s\\S])*\\]|\\\\u[A-Fa-f0-9]{4}|\\\\x[A-Fa-f0-9]{2}|\\\\[0-9]+|\\\\[^ux0-9]|\\(\\?[:!=]|[\\(\\)\\^]|[^\\x5B\\x5C\\(\\)\\^]+)","g")),nt=Ie.length,st=[],De=0,Me=0;De=2&&fe==="["?Ie[De]=Ke(ve):fe!=="\\"&&(Ie[De]=ve.replace(/[a-zA-Z]/g,function(oe){var le=oe.charCodeAt(0);return"["+String.fromCharCode(le&~32,le|32)+"]"}))}return Ie.join("")}for(var Ve=[],_e=0,Te=Pe.length;_e=0;)$e[Ve.charAt(tt)]=Je;var Ie=Je[1],nt=""+Ie;Ne.hasOwnProperty(nt)||(Ge.push(Ie),Ne[nt]=null)}Ge.push(/[\0-\uffff]/),se=N(Ge)})();var _e=je.length,Te=function(Se){for(var Ge=Se.sourceCode,Ne=Se.basePos,Fe=Se.sourceNode,Ke=[Ne,c],Je=0,Ve=Ge.match(se)||[],tt={},Ie=0,nt=Ve.length;Ie=5&&De.substring(0,5)==="lang-",ve&&!(Me&&typeof Me[1]=="string")&&(ve=!1,De=y),ve||(tt[st]=De)}var ne=Je;if(Je+=st.length,!ve)Ke.push(Ne+ne,De);else{var ie=Me[1],oe=st.indexOf(ie),le=oe+ie.length;Me[2]&&(le=st.length-Me[2].length,oe=le-ie.length);var ye=De.substring(5);Y(Fe,Ne+ne,st.substring(0,oe),Te,Ke),Y(Fe,Ne+ne+oe,ie,he(ye,ie),Ke),Y(Fe,Ne+ne+le,st.substring(le),Te,Ke)}}Se.decorations=Ke};return Te}function Oe(Pe){var je=[],$e=[];Pe.tripleQuotedStrings?je.push([S,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):Pe.multiLineStrings?je.push([S,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):je.push([S,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),Pe.verbatimStrings&&$e.push([S,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var se=Pe.hashComments;se&&(Pe.cStyleComments?(se>1?je.push([O,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):je.push([O,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),$e.push([S,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):je.push([O,/^#[^\r\n]*/,null,"#"])),Pe.cStyleComments&&($e.push([O,/^\/\/[^\r\n]*/,null]),$e.push([O,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var _e=Pe.regexLiterals;if(_e){var Te=_e>1?"":` \r`,Se=Te?".":"[\\S\\s]",Ge="/(?=[^/*"+Te+"])(?:[^/\\x5B\\x5C"+Te+"]|\\x5C"+Se+"|\\x5B(?:[^\\x5C\\x5D"+Te+"]|\\x5C"+Se+")*(?:\\x5D|$))+/";$e.push(["lang-regex",RegExp("^"+j+"("+Ge+")")])}var Ne=Pe.types;Ne&&$e.push([C,Ne]);var Fe=(""+Pe.keywords).replace(/^ | $/g,"");Fe.length&&$e.push([L,new RegExp("^(?:"+Fe.replace(/[\s,]+/g,"|")+")\\b"),null]),je.push([c,/^\s+/,null,` \r \xA0`]);var Ke="^.[^\\s\\w.$@'\"`/\\\\]*";return Pe.regexLiterals&&(Ke+="(?!s*/)"),$e.push([T,/^@[a-z_$][a-z_$@0-9]*/i,null],[C,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[c,/^[a-z_$][a-z_$@0-9]*/i,null],[T,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[c,/^\\[\s\S]?/,null],[x,new RegExp(Ke),null]),ue(je,$e)}var Ee=Oe({keywords:A,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function xe(Pe,je,$e){for(var se=/(?:^|\s)nocode(?:\s|$)/,_e=/\r\n?|\n/,Te=Pe.ownerDocument,Se=Te.createElement("li");Pe.firstChild;)Se.appendChild(Pe.firstChild);var Ge=[Se];function Ne(Ie){var nt=Ie.nodeType;if(nt==1&&!se.test(Ie.className))if(Ie.nodeName==="br")Fe(Ie),Ie.parentNode&&Ie.parentNode.removeChild(Ie);else for(var st=Ie.firstChild;st;st=st.nextSibling)Ne(st);else if((nt==3||nt==4)&&$e){var De=Ie.nodeValue,Me=De.match(_e);if(Me){var ve=De.substring(0,Me.index);Ie.nodeValue=ve;var ce=De.substring(Me.index+Me[0].length);if(ce){var fe=Ie.parentNode;fe.insertBefore(Te.createTextNode(ce),Ie.nextSibling)}Fe(Ie),ve||Ie.parentNode.removeChild(Ie)}}}function Fe(Ie){for(;!Ie.nextSibling;)if(Ie=Ie.parentNode,!Ie)return;function nt(Me,ve){var ce=ve?Me.cloneNode(!1):Me,fe=Me.parentNode;if(fe){var ne=nt(fe,1),ie=Me.nextSibling;ne.appendChild(ce);for(var oe=ie;oe;oe=ie)ie=oe.nextSibling,ne.appendChild(oe)}return ce}for(var st=nt(Ie.nextSibling,0),De;(De=st.parentNode)&&De.nodeType===1;)st=De;Ge.push(st)}for(var Ke=0;Ke=fe&&(Ne+=2),Te>=ne&&(Je+=2)}}finally{De&&(De.style.display=Me)}}var Re={};function pe(Pe,je){for(var $e=je.length;--$e>=0;){var se=je[$e];Re.hasOwnProperty(se)?W.console&&console.warn("cannot override language handler %s",se):Re[se]=Pe}}function he(Pe,je){return Pe&&Re.hasOwnProperty(Pe)||(Pe=/^\s*]*(?:>|$)/],[O,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[x,/^(?:<[%?]|[%?]>)/],["lang-",/^]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^]*>([\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"]),pe(ue([[c,/^[\s]+/,null,` \r `],[B,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[w,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[F,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[x,/^[=<>\/]+/],["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"]),pe(ue([],[[B,/^[\s\S]+/]]),["uq.val"]),pe(Oe({keywords:p,hashComments:!0,cStyleComments:!0,types:E}),["c","cc","cpp","cxx","cyc","m"]),pe(Oe({keywords:"null,true,false"}),["json"]),pe(Oe({keywords:u,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:E}),["cs"]),pe(Oe({keywords:m,cStyleComments:!0}),["java"]),pe(Oe({keywords:s,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),pe(Oe({keywords:h,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),pe(Oe({keywords:l,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),pe(Oe({keywords:a,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),pe(Oe({keywords:f,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),pe(Oe({keywords:o,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),pe(ue([],[[S,/^[\s\S]+/]]),["regex"]);function ke(Pe){var je=Pe.langExtension;try{var $e=b(Pe.sourceNode,Pe.pre),se=$e.sourceCode;Pe.sourceCode=se,Pe.spans=$e.spans,Pe.basePos=0,he(je,se)(Pe),Ae(Pe)}catch(_e){W.console&&console.log(_e&&_e.stack||_e)}}function et(Pe,je,$e){var se=$e||!1,_e=je||null,Te=document.createElement("div");Te.innerHTML="
    "+Pe+"
    ",Te=Te.firstChild,se&&xe(Te,se,!0);var Se={langExtension:_e,numberLines:se,sourceNode:Te,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ke(Se),Te.innerHTML}function We(Pe,je){var $e=je||document.body,se=$e.ownerDocument||document;function _e(ce){return $e.getElementsByTagName(ce)}for(var Te=[_e("pre"),_e("code"),_e("xmp")],Se=[],Ge=0;Ge=0),U.set("isFirefox",X.indexOf("Firefox")>=0),U.set("isChrome",X.indexOf("Chrome")>=0),U.set("isSafari",X.indexOf("Safari")>=0);const k=Object.prototype.hasOwnProperty;class G{static has(R){return p.create(R)}static equals(R,j){return m.create(R,j)}static regex(R,j){return S.create(R,j)}static not(R){return l.create(R)}static and(...R){return C.create(R,null)}static or(...R){return T.create(R,null,!0)}static deserialize(R,j=!1){return R?this._deserializeOrExpression(R,j):void 0}static _deserializeOrExpression(R,j){let N=R.split("||");return T.create(N.map(b=>this._deserializeAndExpression(b,j)),null,!0)}static _deserializeAndExpression(R,j){let N=R.split("&&");return C.create(N.map(b=>this._deserializeOne(b,j)),null)}static _deserializeOne(R,j){if(R=R.trim(),R.indexOf("!=")>=0){let N=R.split("!=");return f.create(N[0].trim(),this._deserializeValue(N[1],j))}if(R.indexOf("==")>=0){let N=R.split("==");return m.create(N[0].trim(),this._deserializeValue(N[1],j))}if(R.indexOf("=~")>=0){let N=R.split("=~");return S.create(N[0].trim(),this._deserializeRegexValue(N[1],j))}if(R.indexOf(" in ")>=0){let N=R.split(" in ");return u.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(R)){const N=R.split(">=");return s.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(R)){const N=R.split(">");return a.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(R)){const N=R.split("<=");return E.create(N[0].trim(),N[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(R)){const N=R.split("<");return A.create(N[0].trim(),N[1].trim())}return/^\!\s*/.test(R)?l.create(R.substr(1).trim()):p.create(R)}static _deserializeValue(R,j){if(R=R.trim(),R==="true")return!0;if(R==="false")return!1;let N=/^'([^']*)'$/.exec(R);return N?N[1].trim():R}static _deserializeRegexValue(R,j){if(Object($.C)(R)){if(j)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let N=R.indexOf("/"),b=R.lastIndexOf("/");if(N===b||N<0){if(j)throw new Error(`bad regexp-value '${R}', missing /-enclosure`);return console.warn(`bad regexp-value '${R}', missing /-enclosure`),null}let Y=R.slice(N+1,b),ee=R[b+1]==="i"?"i":"";try{return new RegExp(Y,ee)}catch(ae){if(j)throw new Error(`bad regexp-value '${R}', parse error: ${ae}`);return console.warn(`bad regexp-value '${R}', parse error: ${ae}`),null}}}function W(R,j){const N=R?R.substituteConstants():void 0,b=j?j.substituteConstants():void 0;return!N&&!b?!0:!N||!b?!1:N.equals(b)}function i(R,j){return R.cmp(j)}class D{constructor(){this.type=0}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}D.INSTANCE=new D;class g{constructor(){this.type=1}cmp(R){return this.type-R.type}equals(R){return R.type===this.type}substituteConstants(){return this}evaluate(R){return!0}serialize(){return"true"}keys(){return[]}negate(){return D.INSTANCE}}g.INSTANCE=new g;class p{constructor(R,j){this.key=R,this.negated=j,this.type=2}static create(R,j=null){const N=U.get(R);return typeof N=="boolean"?N?g.INSTANCE:D.INSTANCE:new p(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=U.get(this.key);return typeof R=="boolean"?R?g.INSTANCE:D.INSTANCE:this}evaluate(R){return!!R.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this)),this.negated}}class m{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=4}static create(R,j,N=null){if(typeof j=="boolean")return j?p.create(R,N):l.create(R,N);const b=U.get(R);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?g.INSTANCE:D.INSTANCE}return new m(R,j,N)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=U.get(this.key);if(typeof R=="boolean"){const j=R?"true":"false";return this.value===j?g.INSTANCE:D.INSTANCE}return this}evaluate(R){return R.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 u{constructor(R,j){this.key=R,this.valueKey=j,this.type=10,this.negated=null}static create(R,j){return new u(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.valueKey,R.key,R.valueKey)}equals(R){return R.type===this.type?this.key===R.key&&this.valueKey===R.valueKey:!1}substituteConstants(){return this}evaluate(R){const j=R.getValue(this.valueKey),N=R.getValue(this.key);return Array.isArray(j)?j.indexOf(N)>=0:typeof N=="string"&&typeof j=="object"&&j!==null?k.call(j,N):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=o.create(this)),this.negated}}class o{constructor(R){this._actual=R,this.type=11}static create(R){return new o(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class f{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=5}static create(R,j,N=null){if(typeof j=="boolean")return j?l.create(R,N):p.create(R,N);const b=U.get(R);if(typeof b=="boolean"){const Y=b?"true":"false";return j===Y?D.INSTANCE:g.INSTANCE}return new f(R,j,N)}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){const R=U.get(this.key);if(typeof R=="boolean"){const j=R?"true":"false";return this.value===j?D.INSTANCE:g.INSTANCE}return this}evaluate(R){return R.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=m.create(this.key,this.value,this)),this.negated}}class l{constructor(R,j){this.key=R,this.negated=j,this.type=3}static create(R,j=null){const N=U.get(R);return typeof N=="boolean"?N?D.INSTANCE:g.INSTANCE:new l(R,j)}cmp(R){return R.type!==this.type?this.type-R.type:v(this.key,R.key)}equals(R){return R.type===this.type?this.key===R.key:!1}substituteConstants(){const R=U.get(this.key);return typeof R=="boolean"?R?D.INSTANCE:g.INSTANCE:this}evaluate(R){return!R.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function h(R,j){if(typeof R=="string"){const N=parseFloat(R);isNaN(N)||(R=N)}return typeof R=="string"||typeof R=="number"?j(R):D.INSTANCE}class a{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=12}static create(R,j,N=null){return h(j,b=>new a(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this.key,this.value,this)),this.negated}}class s{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=13}static create(R,j,N=null){return h(j,b=>new s(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.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 A{constructor(R,j,N){this.key=R,this.value=j,this.negated=N,this.type=14}static create(R,j,N=null){return h(j,b=>new A(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.getValue(this.key))new E(R,b,N))}cmp(R){return R.type!==this.type?this.type-R.type:y(this.key,this.value,R.key,R.value)}equals(R){return R.type===this.type?this.key===R.key&&this.value===R.value:!1}substituteConstants(){return this}evaluate(R){return typeof this.value=="string"?!1:parseFloat(R.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 S{constructor(R,j){this.key=R,this.regexp=j,this.type=7,this.negated=null}static create(R,j){return new S(R,j)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.keyR.key)return 1;const j=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return jN?1:0}equals(R){if(R.type===this.type){const j=this.regexp?this.regexp.source:"",N=R.regexp?R.regexp.source:"";return this.key===R.key&&j===N}return!1}substituteConstants(){return this}evaluate(R){let j=R.getValue(this.key);return this.regexp?this.regexp.test(j):!1}serialize(){const R=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${R}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=L.create(this)),this.negated}}class L{constructor(R){this._actual=R,this.type=8}static create(R){return new L(R)}cmp(R){return R.type!==this.type?this.type-R.type:this._actual.cmp(R._actual)}equals(R){return R.type===this.type?this._actual.equals(R._actual):!1}substituteConstants(){return this}evaluate(R){return!this._actual.evaluate(R)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function O(R){let j=null;for(let N=0,b=R.length;NR.expr.length)return 1;for(let j=0,N=this.expr.length;j1;){const Y=N[N.length-1];if(Y.type!==9)break;N.pop();const ee=N.pop(),ae=N.length===0,ue=T.create(Y.expr.map(Oe=>C.create([Oe,ee],null)),null,ae);ue&&(N.push(ue),N.sort(i))}return N.length===1?N[0]:new C(N,j)}serialize(){return this.expr.map(R=>R.serialize()).join(" && ")}keys(){const R=[];for(let j of this.expr)R.push(...j.keys());return R}negate(){if(!this.negated){const R=[];for(let j of this.expr)R.push(j.negate());this.negated=T.create(R,this,!0)}return this.negated}}class T{constructor(R,j){this.expr=R,this.negated=j,this.type=9}static create(R,j,N){return T._normalizeArr(R,j,N)}cmp(R){if(R.type!==this.type)return this.type-R.type;if(this.expr.lengthR.expr.length)return 1;for(let j=0,N=this.expr.length;jR.serialize()).join(" || ")}keys(){const R=[];for(let j of this.expr)R.push(...j.keys());return R}negate(){if(!this.negated){let R=[];for(let j of this.expr)R.push(j.negate());for(;R.length>1;){const j=R.shift(),N=R.shift(),b=[];for(const ee of B(j))for(const ae of B(N))b.push(C.create([ee,ae],null));const Y=R.length===0;R.unshift(T.create(b,null,Y))}this.negated=R[0]}return this.negated}}class x extends p{constructor(R,j,N){super(R,null);this._defaultValue=j,typeof N=="object"?x._info.push(Object.assign(Object.assign({},N),{key:R})):N!==!0&&x._info.push({key:R,description:N,type:j!=null?typeof j:void 0})}static all(){return x._info.values()}bindTo(R){return R.createKey(this.key,this._defaultValue)}getValue(R){return R.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(R){return m.create(this.key,R)}}x._info=[];const c=Object(P.c)("contextKeyService"),w="setContext";function v(R,j){return Rj?1:0}function y(R,j,N,b){return RN?1:jb?1:0}function F(R,j){if(j.type===6&&R.type!==9&&R.type!==6){for(const Y of j.expr)if(R.equals(Y))return!0}const N=R.negate(),b=B(N).concat(B(j));b.sort(i);for(let Y=0;Y=0;u--)if(this.__items[u].match(m))return!0;return!1},D.prototype.set_indent=function(m,u){this.is_empty()&&(this.__indent_count=m||0,this.__alignment_count=u||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},D.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},D.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},D.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var m=this.__parent.current_line;return m.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),m.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),m.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,m.__items[0]===" "&&(m.__items.splice(0,1),m.__character_count-=1),!0}return!1},D.prototype.is_empty=function(){return this.__items.length===0},D.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},D.prototype.push=function(m){this.__items.push(m);var u=m.lastIndexOf(` `);u!==-1?this.__character_count=m.length-u:this.__character_count+=m.length},D.prototype.pop=function(){var m=null;return this.is_empty()||(m=this.__items.pop(),this.__character_count-=m.length),m},D.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},D.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},D.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},D.prototype.toString=function(){var m="";return this.is_empty()?this.__parent.indent_empty_lines&&(m=this.__parent.get_indent_string(this.__indent_count)):(m=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),m+=this.__items.join("")),m};function g(m,u){this.__cache=[""],this.__indent_size=m.indent_size,this.__indent_string=m.indent_char,m.indent_with_tabs||(this.__indent_string=new Array(m.indent_size+1).join(m.indent_char)),u=u||"",m.indent_level>0&&(u=new Array(m.indent_level+1).join(this.__indent_string)),this.__base_string=u,this.__base_string_length=u.length}g.prototype.get_indent_size=function(m,u){var o=this.__base_string_length;return u=u||0,m<0&&(o=0),o+=m*this.__indent_size,o+=u,o},g.prototype.get_indent_string=function(m,u){var o=this.__base_string;return u=u||0,m<0&&(m=0,o=""),u+=m*this.__indent_size,this.__ensure_cache(u),o+=this.__cache[u],o},g.prototype.__ensure_cache=function(m){for(;m>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var m=this.__cache.length,u=0,o="";this.__indent_size&&m>=this.__indent_size&&(u=Math.floor(m/this.__indent_size),m-=u*this.__indent_size,o=new Array(u+1).join(this.__indent_string)),m&&(o+=new Array(m+1).join(" ")),this.__cache.push(o)};function p(m,u){this.__indent_cache=new g(m,u),this.raw=!1,this._end_with_newline=m.end_with_newline,this.indent_size=m.indent_size,this.wrap_line_length=m.wrap_line_length,this.indent_empty_lines=m.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new D(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(m,u){return this.__indent_cache.get_indent_string(m,u)},p.prototype.get_indent_size=function(m,u){return this.__indent_cache.get_indent_size(m,u)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(m){return this.is_empty()||!m&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(m){this.trim(!0);var u=this.current_line.pop();u&&(u[u.length-1]===` `&&(u=u.replace(/\n+$/g,"")),this.current_line.push(u)),this._end_with_newline&&this.__add_outputline();var o=this.__lines.join(` `);return m!==` `&&(o=o.replace(/[\n]/g,m)),o},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(m,u){return m=m||0,u=u||0,this.next_line.set_indent(m,u),this.__lines.length>1?(this.current_line.set_indent(m,u),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(m){for(var u=0;u1&&this.current_line.is_empty();)this.__lines.pop(),this.current_line=this.__lines[this.__lines.length-1],this.current_line.trim();this.previous_line=this.__lines.length>1?this.__lines[this.__lines.length-2]:null},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(m,u){for(var o=this.__lines.length-2;o>=0;){var f=this.__lines[o];if(f.is_empty())break;if(f.item(0).indexOf(m)!==0&&f.item(-1)!==u){this.__lines.splice(o+1,0,new D(this)),this.previous_line=this.__lines[this.__lines.length-2];break}o--}},i.exports.Output=p},,,,function(i){function D(m,u){this.raw_options=g(m,u),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"])}D.prototype._get_array=function(m,u){var o=this.raw_options[m],f=u||[];return typeof o=="object"?o!==null&&typeof o.concat=="function"&&(f=o.concat()):typeof o=="string"&&(f=o.split(/[^a-zA-Z0-9_\/\-]+/)),f},D.prototype._get_boolean=function(m,u){var o=this.raw_options[m],f=o===void 0?!!u:!!o;return f},D.prototype._get_characters=function(m,u){var o=this.raw_options[m],f=u||"";return typeof o=="string"&&(f=o.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),f},D.prototype._get_number=function(m,u){var o=this.raw_options[m];u=parseInt(u,10),isNaN(u)&&(u=0);var f=parseInt(o,10);return isNaN(f)&&(f=u),f},D.prototype._get_selection=function(m,u,o){var f=this._get_selection_list(m,u,o);if(f.length!==1)throw new Error("Invalid Option Value: The option '"+m+`' can only be one of the following values: `+u+` You passed in: '`+this.raw_options[m]+"'");return f[0]},D.prototype._get_selection_list=function(m,u,o){if(!u||u.length===0)throw new Error("Selection list cannot be empty.");if(o=o||[u[0]],!this._is_valid_selection(o,u))throw new Error("Invalid Default Value!");var f=this._get_array(m,o);if(!this._is_valid_selection(f,u))throw new Error("Invalid Option Value: The option '"+m+`' can contain only the following values: `+u+` You passed in: '`+this.raw_options[m]+"'");return f},D.prototype._is_valid_selection=function(m,u){return m.length&&u.length&&!m.some(function(o){return u.indexOf(o)===-1})};function g(m,u){var o={};m=p(m);var f;for(f in m)f!==u&&(o[f]=m[f]);if(u&&m[u])for(f in m[u])o[f]=m[u][f];return o}function p(m){var u={},o;for(o in m){var f=o.replace(/-/g,"_");u[f]=m[o]}return u}i.exports.Options=D,i.exports.normalizeOpts=p,i.exports.mergeOpts=g},,function(i){var D=RegExp.prototype.hasOwnProperty("sticky");function g(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}g.prototype.restart=function(){this.__position=0},g.prototype.back=function(){this.__position>0&&(this.__position-=1)},g.prototype.hasNext=function(){return this.__position=0&&p=0&&m=p.length&&this.__input.substring(m-p.length,m).toLowerCase()===p},i.exports.InputScanner=g},,,,,function(i){function D(g,p){g=typeof g=="string"?g:g.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+p,"g")}D.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var m=this.__directive_pattern.exec(g);m;)p[m[1]]=m[2],m=this.__directive_pattern.exec(g);return p},D.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},i.exports.Directives=D},,function(i,D,g){var p=g(16).Beautifier,m=g(17).Options;function u(o,f){var l=new p(o,f);return l.beautify()}i.exports=u,i.exports.defaultOptions=function(){return new m}},function(i,D,g){var p=g(17).Options,m=g(2).Output,u=g(8).InputScanner,o=g(13).Directives,f=new o(/\/\*/,/\*\//),l=/\r\n|[\r\n]/,h=/\r\n|[\r\n]/g,a=/\s/,s=/(?:\s|\n)+/g,A=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,E=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function S(L,O){this._source_text=L||"",this._options=new p(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"]}S.prototype.eatString=function(L){var O="";for(this._ch=this._input.next();this._ch;){if(O+=this._ch,this._ch==="\\")O+=this._input.next();else if(L.indexOf(this._ch)!==-1||this._ch===` `)break;this._ch=this._input.next()}return O},S.prototype.eatWhitespace=function(L){for(var O=a.test(this._input.peek()),C=0;a.test(this._input.peek());)this._ch=this._input.next(),L&&this._ch===` `&&((C===0||C0&&this._indentLevel--},S.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var L=this._source_text,O=this._options.eol;O==="auto"&&(O=` `,L&&l.test(L||"")&&(O=L.match(l)[0])),L=L.replace(h,` `);var C=L.match(/^[\t ]*/)[0];this._output=new m(this._options,C),this._input=new u(L),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var T=0,x=!1,c=!1,w=!1,v=!1,y=!1,F=!1,B=this._ch,R=!1,j,N,b;j=this._input.read(s),N=j!=="",b=B,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),B=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var Y=this._input.read(A),ee=f.get_directives(Y);ee&&ee.ignore==="start"&&(Y+=f.readIgnored(this._input)),this.print_string(Y),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(E)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(N),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?v=!0:ae==="import"&&(y=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(w=!0)):!x&&T===0&&ae.indexOf(":")!==-1&&(c=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(N),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")c&&(c=!1,this.outdent()),w?(w=!1,x=this._indentLevel>=this._nestedLevel):x=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&x&&(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)):(b==="("?this._output.space_before_token=!1:b!==","&&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(),b==="{"&&this._output.trim(!0),y=!1,v=!1,c&&(this.outdent(),c=!1),this.print_string(this._ch),x=!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 ue=0;ue"||this._ch==="+"||this._ch==="~")&&!c&&T===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(N),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 xe=b==='"'||b==="'";this.preserveSingleSpace(xe||N),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===` `&&R&&this._output.add_new_line()}var Ae=this._output.get_code(O);return Ae},i.exports.Beautifier=S},function(i,D,g){var p=g(6).Options;function m(u){p.call(this,u,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var o=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||o;var f=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var l=0;l` ${g} `).trim():""}class G{constructor(i,D,g){this.id=i,this.definition=D,this.description=g,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 W;(function(i){i.iconNameSegment="[A-Za-z0-9]+",i.iconNameExpression="[A-Za-z0-9\\-]+",i.iconModifierExpression="~[A-Za-z]+";const D=new RegExp(`^(${i.iconNameExpression})(${i.iconModifierExpression})?$`);function g(u){if(u instanceof G)return["codicon","codicon-"+u.id];const o=D.exec(u.id);if(!o)return g(G.error);let[,f,l]=o;const h=["codicon","codicon-"+f];return l&&h.push("codicon-modifier-"+l.substr(1)),h}i.asClassNameArray=g;function p(u){return g(u).join(" ")}i.asClassName=p;function m(u){return"."+g(u).join(".")}i.asCSSSelector=m})(W||(W={})),function(i){i.add=new i("add",{fontCharacter:"\\ea60"}),i.plus=new i("plus",i.add.definition),i.gistNew=new i("gist-new",i.add.definition),i.repoCreate=new i("repo-create",i.add.definition),i.lightbulb=new i("lightbulb",{fontCharacter:"\\ea61"}),i.lightBulb=new i("light-bulb",{fontCharacter:"\\ea61"}),i.repo=new i("repo",{fontCharacter:"\\ea62"}),i.repoDelete=new i("repo-delete",{fontCharacter:"\\ea62"}),i.gistFork=new i("gist-fork",{fontCharacter:"\\ea63"}),i.repoForked=new i("repo-forked",{fontCharacter:"\\ea63"}),i.gitPullRequest=new i("git-pull-request",{fontCharacter:"\\ea64"}),i.gitPullRequestAbandoned=new i("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),i.recordKeys=new i("record-keys",{fontCharacter:"\\ea65"}),i.keyboard=new i("keyboard",{fontCharacter:"\\ea65"}),i.tag=new i("tag",{fontCharacter:"\\ea66"}),i.tagAdd=new i("tag-add",{fontCharacter:"\\ea66"}),i.tagRemove=new i("tag-remove",{fontCharacter:"\\ea66"}),i.person=new i("person",{fontCharacter:"\\ea67"}),i.personFollow=new i("person-follow",{fontCharacter:"\\ea67"}),i.personOutline=new i("person-outline",{fontCharacter:"\\ea67"}),i.personFilled=new i("person-filled",{fontCharacter:"\\ea67"}),i.gitBranch=new i("git-branch",{fontCharacter:"\\ea68"}),i.gitBranchCreate=new i("git-branch-create",{fontCharacter:"\\ea68"}),i.gitBranchDelete=new i("git-branch-delete",{fontCharacter:"\\ea68"}),i.sourceControl=new i("source-control",{fontCharacter:"\\ea68"}),i.mirror=new i("mirror",{fontCharacter:"\\ea69"}),i.mirrorPublic=new i("mirror-public",{fontCharacter:"\\ea69"}),i.star=new i("star",{fontCharacter:"\\ea6a"}),i.starAdd=new i("star-add",{fontCharacter:"\\ea6a"}),i.starDelete=new i("star-delete",{fontCharacter:"\\ea6a"}),i.starEmpty=new i("star-empty",{fontCharacter:"\\ea6a"}),i.comment=new i("comment",{fontCharacter:"\\ea6b"}),i.commentAdd=new i("comment-add",{fontCharacter:"\\ea6b"}),i.alert=new i("alert",{fontCharacter:"\\ea6c"}),i.warning=new i("warning",{fontCharacter:"\\ea6c"}),i.search=new i("search",{fontCharacter:"\\ea6d"}),i.searchSave=new i("search-save",{fontCharacter:"\\ea6d"}),i.logOut=new i("log-out",{fontCharacter:"\\ea6e"}),i.signOut=new i("sign-out",{fontCharacter:"\\ea6e"}),i.logIn=new i("log-in",{fontCharacter:"\\ea6f"}),i.signIn=new i("sign-in",{fontCharacter:"\\ea6f"}),i.eye=new i("eye",{fontCharacter:"\\ea70"}),i.eyeUnwatch=new i("eye-unwatch",{fontCharacter:"\\ea70"}),i.eyeWatch=new i("eye-watch",{fontCharacter:"\\ea70"}),i.circleFilled=new i("circle-filled",{fontCharacter:"\\ea71"}),i.primitiveDot=new i("primitive-dot",{fontCharacter:"\\ea71"}),i.closeDirty=new i("close-dirty",{fontCharacter:"\\ea71"}),i.debugBreakpoint=new i("debug-breakpoint",{fontCharacter:"\\ea71"}),i.debugBreakpointDisabled=new i("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),i.debugHint=new i("debug-hint",{fontCharacter:"\\ea71"}),i.primitiveSquare=new i("primitive-square",{fontCharacter:"\\ea72"}),i.edit=new i("edit",{fontCharacter:"\\ea73"}),i.pencil=new i("pencil",{fontCharacter:"\\ea73"}),i.info=new i("info",{fontCharacter:"\\ea74"}),i.issueOpened=new i("issue-opened",{fontCharacter:"\\ea74"}),i.gistPrivate=new i("gist-private",{fontCharacter:"\\ea75"}),i.gitForkPrivate=new i("git-fork-private",{fontCharacter:"\\ea75"}),i.lock=new i("lock",{fontCharacter:"\\ea75"}),i.mirrorPrivate=new i("mirror-private",{fontCharacter:"\\ea75"}),i.close=new i("close",{fontCharacter:"\\ea76"}),i.removeClose=new i("remove-close",{fontCharacter:"\\ea76"}),i.x=new i("x",{fontCharacter:"\\ea76"}),i.repoSync=new i("repo-sync",{fontCharacter:"\\ea77"}),i.sync=new i("sync",{fontCharacter:"\\ea77"}),i.clone=new i("clone",{fontCharacter:"\\ea78"}),i.desktopDownload=new i("desktop-download",{fontCharacter:"\\ea78"}),i.beaker=new i("beaker",{fontCharacter:"\\ea79"}),i.microscope=new i("microscope",{fontCharacter:"\\ea79"}),i.vm=new i("vm",{fontCharacter:"\\ea7a"}),i.deviceDesktop=new i("device-desktop",{fontCharacter:"\\ea7a"}),i.file=new i("file",{fontCharacter:"\\ea7b"}),i.fileText=new i("file-text",{fontCharacter:"\\ea7b"}),i.more=new i("more",{fontCharacter:"\\ea7c"}),i.ellipsis=new i("ellipsis",{fontCharacter:"\\ea7c"}),i.kebabHorizontal=new i("kebab-horizontal",{fontCharacter:"\\ea7c"}),i.mailReply=new i("mail-reply",{fontCharacter:"\\ea7d"}),i.reply=new i("reply",{fontCharacter:"\\ea7d"}),i.organization=new i("organization",{fontCharacter:"\\ea7e"}),i.organizationFilled=new i("organization-filled",{fontCharacter:"\\ea7e"}),i.organizationOutline=new i("organization-outline",{fontCharacter:"\\ea7e"}),i.newFile=new i("new-file",{fontCharacter:"\\ea7f"}),i.fileAdd=new i("file-add",{fontCharacter:"\\ea7f"}),i.newFolder=new i("new-folder",{fontCharacter:"\\ea80"}),i.fileDirectoryCreate=new i("file-directory-create",{fontCharacter:"\\ea80"}),i.trash=new i("trash",{fontCharacter:"\\ea81"}),i.trashcan=new i("trashcan",{fontCharacter:"\\ea81"}),i.history=new i("history",{fontCharacter:"\\ea82"}),i.clock=new i("clock",{fontCharacter:"\\ea82"}),i.folder=new i("folder",{fontCharacter:"\\ea83"}),i.fileDirectory=new i("file-directory",{fontCharacter:"\\ea83"}),i.symbolFolder=new i("symbol-folder",{fontCharacter:"\\ea83"}),i.logoGithub=new i("logo-github",{fontCharacter:"\\ea84"}),i.markGithub=new i("mark-github",{fontCharacter:"\\ea84"}),i.github=new i("github",{fontCharacter:"\\ea84"}),i.terminal=new i("terminal",{fontCharacter:"\\ea85"}),i.console=new i("console",{fontCharacter:"\\ea85"}),i.repl=new i("repl",{fontCharacter:"\\ea85"}),i.zap=new i("zap",{fontCharacter:"\\ea86"}),i.symbolEvent=new i("symbol-event",{fontCharacter:"\\ea86"}),i.error=new i("error",{fontCharacter:"\\ea87"}),i.stop=new i("stop",{fontCharacter:"\\ea87"}),i.variable=new i("variable",{fontCharacter:"\\ea88"}),i.symbolVariable=new i("symbol-variable",{fontCharacter:"\\ea88"}),i.array=new i("array",{fontCharacter:"\\ea8a"}),i.symbolArray=new i("symbol-array",{fontCharacter:"\\ea8a"}),i.symbolModule=new i("symbol-module",{fontCharacter:"\\ea8b"}),i.symbolPackage=new i("symbol-package",{fontCharacter:"\\ea8b"}),i.symbolNamespace=new i("symbol-namespace",{fontCharacter:"\\ea8b"}),i.symbolObject=new i("symbol-object",{fontCharacter:"\\ea8b"}),i.symbolMethod=new i("symbol-method",{fontCharacter:"\\ea8c"}),i.symbolFunction=new i("symbol-function",{fontCharacter:"\\ea8c"}),i.symbolConstructor=new i("symbol-constructor",{fontCharacter:"\\ea8c"}),i.symbolBoolean=new i("symbol-boolean",{fontCharacter:"\\ea8f"}),i.symbolNull=new i("symbol-null",{fontCharacter:"\\ea8f"}),i.symbolNumeric=new i("symbol-numeric",{fontCharacter:"\\ea90"}),i.symbolNumber=new i("symbol-number",{fontCharacter:"\\ea90"}),i.symbolStructure=new i("symbol-structure",{fontCharacter:"\\ea91"}),i.symbolStruct=new i("symbol-struct",{fontCharacter:"\\ea91"}),i.symbolParameter=new i("symbol-parameter",{fontCharacter:"\\ea92"}),i.symbolTypeParameter=new i("symbol-type-parameter",{fontCharacter:"\\ea92"}),i.symbolKey=new i("symbol-key",{fontCharacter:"\\ea93"}),i.symbolText=new i("symbol-text",{fontCharacter:"\\ea93"}),i.symbolReference=new i("symbol-reference",{fontCharacter:"\\ea94"}),i.goToFile=new i("go-to-file",{fontCharacter:"\\ea94"}),i.symbolEnum=new i("symbol-enum",{fontCharacter:"\\ea95"}),i.symbolValue=new i("symbol-value",{fontCharacter:"\\ea95"}),i.symbolRuler=new i("symbol-ruler",{fontCharacter:"\\ea96"}),i.symbolUnit=new i("symbol-unit",{fontCharacter:"\\ea96"}),i.activateBreakpoints=new i("activate-breakpoints",{fontCharacter:"\\ea97"}),i.archive=new i("archive",{fontCharacter:"\\ea98"}),i.arrowBoth=new i("arrow-both",{fontCharacter:"\\ea99"}),i.arrowDown=new i("arrow-down",{fontCharacter:"\\ea9a"}),i.arrowLeft=new i("arrow-left",{fontCharacter:"\\ea9b"}),i.arrowRight=new i("arrow-right",{fontCharacter:"\\ea9c"}),i.arrowSmallDown=new i("arrow-small-down",{fontCharacter:"\\ea9d"}),i.arrowSmallLeft=new i("arrow-small-left",{fontCharacter:"\\ea9e"}),i.arrowSmallRight=new i("arrow-small-right",{fontCharacter:"\\ea9f"}),i.arrowSmallUp=new i("arrow-small-up",{fontCharacter:"\\eaa0"}),i.arrowUp=new i("arrow-up",{fontCharacter:"\\eaa1"}),i.bell=new i("bell",{fontCharacter:"\\eaa2"}),i.bold=new i("bold",{fontCharacter:"\\eaa3"}),i.book=new i("book",{fontCharacter:"\\eaa4"}),i.bookmark=new i("bookmark",{fontCharacter:"\\eaa5"}),i.debugBreakpointConditionalUnverified=new i("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),i.debugBreakpointConditional=new i("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),i.debugBreakpointConditionalDisabled=new i("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),i.debugBreakpointDataUnverified=new i("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),i.debugBreakpointData=new i("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),i.debugBreakpointDataDisabled=new i("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),i.debugBreakpointLogUnverified=new i("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),i.debugBreakpointLog=new i("debug-breakpoint-log",{fontCharacter:"\\eaab"}),i.debugBreakpointLogDisabled=new i("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),i.briefcase=new i("briefcase",{fontCharacter:"\\eaac"}),i.broadcast=new i("broadcast",{fontCharacter:"\\eaad"}),i.browser=new i("browser",{fontCharacter:"\\eaae"}),i.bug=new i("bug",{fontCharacter:"\\eaaf"}),i.calendar=new i("calendar",{fontCharacter:"\\eab0"}),i.caseSensitive=new i("case-sensitive",{fontCharacter:"\\eab1"}),i.check=new i("check",{fontCharacter:"\\eab2"}),i.checklist=new i("checklist",{fontCharacter:"\\eab3"}),i.chevronDown=new i("chevron-down",{fontCharacter:"\\eab4"}),i.dropDownButton=new i("drop-down-button",i.chevronDown.definition),i.chevronLeft=new i("chevron-left",{fontCharacter:"\\eab5"}),i.chevronRight=new i("chevron-right",{fontCharacter:"\\eab6"}),i.chevronUp=new i("chevron-up",{fontCharacter:"\\eab7"}),i.chromeClose=new i("chrome-close",{fontCharacter:"\\eab8"}),i.chromeMaximize=new i("chrome-maximize",{fontCharacter:"\\eab9"}),i.chromeMinimize=new i("chrome-minimize",{fontCharacter:"\\eaba"}),i.chromeRestore=new i("chrome-restore",{fontCharacter:"\\eabb"}),i.circleOutline=new i("circle-outline",{fontCharacter:"\\eabc"}),i.debugBreakpointUnverified=new i("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),i.circleSlash=new i("circle-slash",{fontCharacter:"\\eabd"}),i.circuitBoard=new i("circuit-board",{fontCharacter:"\\eabe"}),i.clearAll=new i("clear-all",{fontCharacter:"\\eabf"}),i.clippy=new i("clippy",{fontCharacter:"\\eac0"}),i.closeAll=new i("close-all",{fontCharacter:"\\eac1"}),i.cloudDownload=new i("cloud-download",{fontCharacter:"\\eac2"}),i.cloudUpload=new i("cloud-upload",{fontCharacter:"\\eac3"}),i.code=new i("code",{fontCharacter:"\\eac4"}),i.collapseAll=new i("collapse-all",{fontCharacter:"\\eac5"}),i.colorMode=new i("color-mode",{fontCharacter:"\\eac6"}),i.commentDiscussion=new i("comment-discussion",{fontCharacter:"\\eac7"}),i.compareChanges=new i("compare-changes",{fontCharacter:"\\eafd"}),i.creditCard=new i("credit-card",{fontCharacter:"\\eac9"}),i.dash=new i("dash",{fontCharacter:"\\eacc"}),i.dashboard=new i("dashboard",{fontCharacter:"\\eacd"}),i.database=new i("database",{fontCharacter:"\\eace"}),i.debugContinue=new i("debug-continue",{fontCharacter:"\\eacf"}),i.debugDisconnect=new i("debug-disconnect",{fontCharacter:"\\ead0"}),i.debugPause=new i("debug-pause",{fontCharacter:"\\ead1"}),i.debugRestart=new i("debug-restart",{fontCharacter:"\\ead2"}),i.debugStart=new i("debug-start",{fontCharacter:"\\ead3"}),i.debugStepInto=new i("debug-step-into",{fontCharacter:"\\ead4"}),i.debugStepOut=new i("debug-step-out",{fontCharacter:"\\ead5"}),i.debugStepOver=new i("debug-step-over",{fontCharacter:"\\ead6"}),i.debugStop=new i("debug-stop",{fontCharacter:"\\ead7"}),i.debug=new i("debug",{fontCharacter:"\\ead8"}),i.deviceCameraVideo=new i("device-camera-video",{fontCharacter:"\\ead9"}),i.deviceCamera=new i("device-camera",{fontCharacter:"\\eada"}),i.deviceMobile=new i("device-mobile",{fontCharacter:"\\eadb"}),i.diffAdded=new i("diff-added",{fontCharacter:"\\eadc"}),i.diffIgnored=new i("diff-ignored",{fontCharacter:"\\eadd"}),i.diffModified=new i("diff-modified",{fontCharacter:"\\eade"}),i.diffRemoved=new i("diff-removed",{fontCharacter:"\\eadf"}),i.diffRenamed=new i("diff-renamed",{fontCharacter:"\\eae0"}),i.diff=new i("diff",{fontCharacter:"\\eae1"}),i.discard=new i("discard",{fontCharacter:"\\eae2"}),i.editorLayout=new i("editor-layout",{fontCharacter:"\\eae3"}),i.emptyWindow=new i("empty-window",{fontCharacter:"\\eae4"}),i.exclude=new i("exclude",{fontCharacter:"\\eae5"}),i.extensions=new i("extensions",{fontCharacter:"\\eae6"}),i.eyeClosed=new i("eye-closed",{fontCharacter:"\\eae7"}),i.fileBinary=new i("file-binary",{fontCharacter:"\\eae8"}),i.fileCode=new i("file-code",{fontCharacter:"\\eae9"}),i.fileMedia=new i("file-media",{fontCharacter:"\\eaea"}),i.filePdf=new i("file-pdf",{fontCharacter:"\\eaeb"}),i.fileSubmodule=new i("file-submodule",{fontCharacter:"\\eaec"}),i.fileSymlinkDirectory=new i("file-symlink-directory",{fontCharacter:"\\eaed"}),i.fileSymlinkFile=new i("file-symlink-file",{fontCharacter:"\\eaee"}),i.fileZip=new i("file-zip",{fontCharacter:"\\eaef"}),i.files=new i("files",{fontCharacter:"\\eaf0"}),i.filter=new i("filter",{fontCharacter:"\\eaf1"}),i.flame=new i("flame",{fontCharacter:"\\eaf2"}),i.foldDown=new i("fold-down",{fontCharacter:"\\eaf3"}),i.foldUp=new i("fold-up",{fontCharacter:"\\eaf4"}),i.fold=new i("fold",{fontCharacter:"\\eaf5"}),i.folderActive=new i("folder-active",{fontCharacter:"\\eaf6"}),i.folderOpened=new i("folder-opened",{fontCharacter:"\\eaf7"}),i.gear=new i("gear",{fontCharacter:"\\eaf8"}),i.gift=new i("gift",{fontCharacter:"\\eaf9"}),i.gistSecret=new i("gist-secret",{fontCharacter:"\\eafa"}),i.gist=new i("gist",{fontCharacter:"\\eafb"}),i.gitCommit=new i("git-commit",{fontCharacter:"\\eafc"}),i.gitCompare=new i("git-compare",{fontCharacter:"\\eafd"}),i.gitMerge=new i("git-merge",{fontCharacter:"\\eafe"}),i.githubAction=new i("github-action",{fontCharacter:"\\eaff"}),i.githubAlt=new i("github-alt",{fontCharacter:"\\eb00"}),i.globe=new i("globe",{fontCharacter:"\\eb01"}),i.grabber=new i("grabber",{fontCharacter:"\\eb02"}),i.graph=new i("graph",{fontCharacter:"\\eb03"}),i.gripper=new i("gripper",{fontCharacter:"\\eb04"}),i.heart=new i("heart",{fontCharacter:"\\eb05"}),i.home=new i("home",{fontCharacter:"\\eb06"}),i.horizontalRule=new i("horizontal-rule",{fontCharacter:"\\eb07"}),i.hubot=new i("hubot",{fontCharacter:"\\eb08"}),i.inbox=new i("inbox",{fontCharacter:"\\eb09"}),i.issueClosed=new i("issue-closed",{fontCharacter:"\\eba4"}),i.issueReopened=new i("issue-reopened",{fontCharacter:"\\eb0b"}),i.issues=new i("issues",{fontCharacter:"\\eb0c"}),i.italic=new i("italic",{fontCharacter:"\\eb0d"}),i.jersey=new i("jersey",{fontCharacter:"\\eb0e"}),i.json=new i("json",{fontCharacter:"\\eb0f"}),i.kebabVertical=new i("kebab-vertical",{fontCharacter:"\\eb10"}),i.key=new i("key",{fontCharacter:"\\eb11"}),i.law=new i("law",{fontCharacter:"\\eb12"}),i.lightbulbAutofix=new i("lightbulb-autofix",{fontCharacter:"\\eb13"}),i.linkExternal=new i("link-external",{fontCharacter:"\\eb14"}),i.link=new i("link",{fontCharacter:"\\eb15"}),i.listOrdered=new i("list-ordered",{fontCharacter:"\\eb16"}),i.listUnordered=new i("list-unordered",{fontCharacter:"\\eb17"}),i.liveShare=new i("live-share",{fontCharacter:"\\eb18"}),i.loading=new i("loading",{fontCharacter:"\\eb19"}),i.location=new i("location",{fontCharacter:"\\eb1a"}),i.mailRead=new i("mail-read",{fontCharacter:"\\eb1b"}),i.mail=new i("mail",{fontCharacter:"\\eb1c"}),i.markdown=new i("markdown",{fontCharacter:"\\eb1d"}),i.megaphone=new i("megaphone",{fontCharacter:"\\eb1e"}),i.mention=new i("mention",{fontCharacter:"\\eb1f"}),i.milestone=new i("milestone",{fontCharacter:"\\eb20"}),i.mortarBoard=new i("mortar-board",{fontCharacter:"\\eb21"}),i.move=new i("move",{fontCharacter:"\\eb22"}),i.multipleWindows=new i("multiple-windows",{fontCharacter:"\\eb23"}),i.mute=new i("mute",{fontCharacter:"\\eb24"}),i.noNewline=new i("no-newline",{fontCharacter:"\\eb25"}),i.note=new i("note",{fontCharacter:"\\eb26"}),i.octoface=new i("octoface",{fontCharacter:"\\eb27"}),i.openPreview=new i("open-preview",{fontCharacter:"\\eb28"}),i.package_=new i("package",{fontCharacter:"\\eb29"}),i.paintcan=new i("paintcan",{fontCharacter:"\\eb2a"}),i.pin=new i("pin",{fontCharacter:"\\eb2b"}),i.play=new i("play",{fontCharacter:"\\eb2c"}),i.run=new i("run",{fontCharacter:"\\eb2c"}),i.plug=new i("plug",{fontCharacter:"\\eb2d"}),i.preserveCase=new i("preserve-case",{fontCharacter:"\\eb2e"}),i.preview=new i("preview",{fontCharacter:"\\eb2f"}),i.project=new i("project",{fontCharacter:"\\eb30"}),i.pulse=new i("pulse",{fontCharacter:"\\eb31"}),i.question=new i("question",{fontCharacter:"\\eb32"}),i.quote=new i("quote",{fontCharacter:"\\eb33"}),i.radioTower=new i("radio-tower",{fontCharacter:"\\eb34"}),i.reactions=new i("reactions",{fontCharacter:"\\eb35"}),i.references=new i("references",{fontCharacter:"\\eb36"}),i.refresh=new i("refresh",{fontCharacter:"\\eb37"}),i.regex=new i("regex",{fontCharacter:"\\eb38"}),i.remoteExplorer=new i("remote-explorer",{fontCharacter:"\\eb39"}),i.remote=new i("remote",{fontCharacter:"\\eb3a"}),i.remove=new i("remove",{fontCharacter:"\\eb3b"}),i.replaceAll=new i("replace-all",{fontCharacter:"\\eb3c"}),i.replace=new i("replace",{fontCharacter:"\\eb3d"}),i.repoClone=new i("repo-clone",{fontCharacter:"\\eb3e"}),i.repoForcePush=new i("repo-force-push",{fontCharacter:"\\eb3f"}),i.repoPull=new i("repo-pull",{fontCharacter:"\\eb40"}),i.repoPush=new i("repo-push",{fontCharacter:"\\eb41"}),i.report=new i("report",{fontCharacter:"\\eb42"}),i.requestChanges=new i("request-changes",{fontCharacter:"\\eb43"}),i.rocket=new i("rocket",{fontCharacter:"\\eb44"}),i.rootFolderOpened=new i("root-folder-opened",{fontCharacter:"\\eb45"}),i.rootFolder=new i("root-folder",{fontCharacter:"\\eb46"}),i.rss=new i("rss",{fontCharacter:"\\eb47"}),i.ruby=new i("ruby",{fontCharacter:"\\eb48"}),i.saveAll=new i("save-all",{fontCharacter:"\\eb49"}),i.saveAs=new i("save-as",{fontCharacter:"\\eb4a"}),i.save=new i("save",{fontCharacter:"\\eb4b"}),i.screenFull=new i("screen-full",{fontCharacter:"\\eb4c"}),i.screenNormal=new i("screen-normal",{fontCharacter:"\\eb4d"}),i.searchStop=new i("search-stop",{fontCharacter:"\\eb4e"}),i.server=new i("server",{fontCharacter:"\\eb50"}),i.settingsGear=new i("settings-gear",{fontCharacter:"\\eb51"}),i.settings=new i("settings",{fontCharacter:"\\eb52"}),i.shield=new i("shield",{fontCharacter:"\\eb53"}),i.smiley=new i("smiley",{fontCharacter:"\\eb54"}),i.sortPrecedence=new i("sort-precedence",{fontCharacter:"\\eb55"}),i.splitHorizontal=new i("split-horizontal",{fontCharacter:"\\eb56"}),i.splitVertical=new i("split-vertical",{fontCharacter:"\\eb57"}),i.squirrel=new i("squirrel",{fontCharacter:"\\eb58"}),i.starFull=new i("star-full",{fontCharacter:"\\eb59"}),i.starHalf=new i("star-half",{fontCharacter:"\\eb5a"}),i.symbolClass=new i("symbol-class",{fontCharacter:"\\eb5b"}),i.symbolColor=new i("symbol-color",{fontCharacter:"\\eb5c"}),i.symbolConstant=new i("symbol-constant",{fontCharacter:"\\eb5d"}),i.symbolEnumMember=new i("symbol-enum-member",{fontCharacter:"\\eb5e"}),i.symbolField=new i("symbol-field",{fontCharacter:"\\eb5f"}),i.symbolFile=new i("symbol-file",{fontCharacter:"\\eb60"}),i.symbolInterface=new i("symbol-interface",{fontCharacter:"\\eb61"}),i.symbolKeyword=new i("symbol-keyword",{fontCharacter:"\\eb62"}),i.symbolMisc=new i("symbol-misc",{fontCharacter:"\\eb63"}),i.symbolOperator=new i("symbol-operator",{fontCharacter:"\\eb64"}),i.symbolProperty=new i("symbol-property",{fontCharacter:"\\eb65"}),i.wrench=new i("wrench",{fontCharacter:"\\eb65"}),i.wrenchSubaction=new i("wrench-subaction",{fontCharacter:"\\eb65"}),i.symbolSnippet=new i("symbol-snippet",{fontCharacter:"\\eb66"}),i.tasklist=new i("tasklist",{fontCharacter:"\\eb67"}),i.telescope=new i("telescope",{fontCharacter:"\\eb68"}),i.textSize=new i("text-size",{fontCharacter:"\\eb69"}),i.threeBars=new i("three-bars",{fontCharacter:"\\eb6a"}),i.thumbsdown=new i("thumbsdown",{fontCharacter:"\\eb6b"}),i.thumbsup=new i("thumbsup",{fontCharacter:"\\eb6c"}),i.tools=new i("tools",{fontCharacter:"\\eb6d"}),i.triangleDown=new i("triangle-down",{fontCharacter:"\\eb6e"}),i.triangleLeft=new i("triangle-left",{fontCharacter:"\\eb6f"}),i.triangleRight=new i("triangle-right",{fontCharacter:"\\eb70"}),i.triangleUp=new i("triangle-up",{fontCharacter:"\\eb71"}),i.twitter=new i("twitter",{fontCharacter:"\\eb72"}),i.unfold=new i("unfold",{fontCharacter:"\\eb73"}),i.unlock=new i("unlock",{fontCharacter:"\\eb74"}),i.unmute=new i("unmute",{fontCharacter:"\\eb75"}),i.unverified=new i("unverified",{fontCharacter:"\\eb76"}),i.verified=new i("verified",{fontCharacter:"\\eb77"}),i.versions=new i("versions",{fontCharacter:"\\eb78"}),i.vmActive=new i("vm-active",{fontCharacter:"\\eb79"}),i.vmOutline=new i("vm-outline",{fontCharacter:"\\eb7a"}),i.vmRunning=new i("vm-running",{fontCharacter:"\\eb7b"}),i.watch=new i("watch",{fontCharacter:"\\eb7c"}),i.whitespace=new i("whitespace",{fontCharacter:"\\eb7d"}),i.wholeWord=new i("whole-word",{fontCharacter:"\\eb7e"}),i.window=new i("window",{fontCharacter:"\\eb7f"}),i.wordWrap=new i("word-wrap",{fontCharacter:"\\eb80"}),i.zoomIn=new i("zoom-in",{fontCharacter:"\\eb81"}),i.zoomOut=new i("zoom-out",{fontCharacter:"\\eb82"}),i.listFilter=new i("list-filter",{fontCharacter:"\\eb83"}),i.listFlat=new i("list-flat",{fontCharacter:"\\eb84"}),i.listSelection=new i("list-selection",{fontCharacter:"\\eb85"}),i.selection=new i("selection",{fontCharacter:"\\eb85"}),i.listTree=new i("list-tree",{fontCharacter:"\\eb86"}),i.debugBreakpointFunctionUnverified=new i("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),i.debugBreakpointFunction=new i("debug-breakpoint-function",{fontCharacter:"\\eb88"}),i.debugBreakpointFunctionDisabled=new i("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),i.debugStackframeActive=new i("debug-stackframe-active",{fontCharacter:"\\eb89"}),i.debugStackframeDot=new i("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),i.debugStackframe=new i("debug-stackframe",{fontCharacter:"\\eb8b"}),i.debugStackframeFocused=new i("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),i.debugBreakpointUnsupported=new i("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),i.symbolString=new i("symbol-string",{fontCharacter:"\\eb8d"}),i.debugReverseContinue=new i("debug-reverse-continue",{fontCharacter:"\\eb8e"}),i.debugStepBack=new i("debug-step-back",{fontCharacter:"\\eb8f"}),i.debugRestartFrame=new i("debug-restart-frame",{fontCharacter:"\\eb90"}),i.callIncoming=new i("call-incoming",{fontCharacter:"\\eb92"}),i.callOutgoing=new i("call-outgoing",{fontCharacter:"\\eb93"}),i.menu=new i("menu",{fontCharacter:"\\eb94"}),i.expandAll=new i("expand-all",{fontCharacter:"\\eb95"}),i.feedback=new i("feedback",{fontCharacter:"\\eb96"}),i.groupByRefType=new i("group-by-ref-type",{fontCharacter:"\\eb97"}),i.ungroupByRefType=new i("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),i.account=new i("account",{fontCharacter:"\\eb99"}),i.bellDot=new i("bell-dot",{fontCharacter:"\\eb9a"}),i.debugConsole=new i("debug-console",{fontCharacter:"\\eb9b"}),i.library=new i("library",{fontCharacter:"\\eb9c"}),i.output=new i("output",{fontCharacter:"\\eb9d"}),i.runAll=new i("run-all",{fontCharacter:"\\eb9e"}),i.syncIgnored=new i("sync-ignored",{fontCharacter:"\\eb9f"}),i.pinned=new i("pinned",{fontCharacter:"\\eba0"}),i.githubInverted=new i("github-inverted",{fontCharacter:"\\eba1"}),i.debugAlt=new i("debug-alt",{fontCharacter:"\\eb91"}),i.serverProcess=new i("server-process",{fontCharacter:"\\eba2"}),i.serverEnvironment=new i("server-environment",{fontCharacter:"\\eba3"}),i.pass=new i("pass",{fontCharacter:"\\eba4"}),i.stopCircle=new i("stop-circle",{fontCharacter:"\\eba5"}),i.playCircle=new i("play-circle",{fontCharacter:"\\eba6"}),i.record=new i("record",{fontCharacter:"\\eba7"}),i.debugAltSmall=new i("debug-alt-small",{fontCharacter:"\\eba8"}),i.vmConnect=new i("vm-connect",{fontCharacter:"\\eba9"}),i.cloud=new i("cloud",{fontCharacter:"\\ebaa"}),i.merge=new i("merge",{fontCharacter:"\\ebab"}),i.exportIcon=new i("export",{fontCharacter:"\\ebac"}),i.graphLeft=new i("graph-left",{fontCharacter:"\\ebad"}),i.magnet=new i("magnet",{fontCharacter:"\\ebae"}),i.notebook=new i("notebook",{fontCharacter:"\\ebaf"}),i.redo=new i("redo",{fontCharacter:"\\ebb0"}),i.checkAll=new i("check-all",{fontCharacter:"\\ebb1"}),i.pinnedDirty=new i("pinned-dirty",{fontCharacter:"\\ebb2"}),i.passFilled=new i("pass-filled",{fontCharacter:"\\ebb3"}),i.circleLargeFilled=new i("circle-large-filled",{fontCharacter:"\\ebb4"}),i.circleLargeOutline=new i("circle-large-outline",{fontCharacter:"\\ebb5"}),i.combine=new i("combine",{fontCharacter:"\\ebb6"}),i.gather=new i("gather",{fontCharacter:"\\ebb6"}),i.table=new i("table",{fontCharacter:"\\ebb7"}),i.variableGroup=new i("variable-group",{fontCharacter:"\\ebb8"}),i.typeHierarchy=new i("type-hierarchy",{fontCharacter:"\\ebb9"}),i.typeHierarchySub=new i("type-hierarchy-sub",{fontCharacter:"\\ebba"}),i.typeHierarchySuper=new i("type-hierarchy-super",{fontCharacter:"\\ebbb"}),i.gitPullRequestCreate=new i("git-pull-request-create",{fontCharacter:"\\ebbc"}),i.runAbove=new i("run-above",{fontCharacter:"\\ebbd"}),i.runBelow=new i("run-below",{fontCharacter:"\\ebbe"}),i.notebookTemplate=new i("notebook-template",{fontCharacter:"\\ebbf"}),i.debugRerun=new i("debug-rerun",{fontCharacter:"\\ebc0"}),i.workspaceTrusted=new i("workspace-trusted",{fontCharacter:"\\ebc1"}),i.workspaceUntrusted=new i("workspace-untrusted",{fontCharacter:"\\ebc2"}),i.workspaceUnspecified=new i("workspace-unspecified",{fontCharacter:"\\ebc3"}),i.terminalCmd=new i("terminal-cmd",{fontCharacter:"\\ebc4"}),i.terminalDebian=new i("terminal-debian",{fontCharacter:"\\ebc5"}),i.terminalLinux=new i("terminal-linux",{fontCharacter:"\\ebc6"}),i.terminalPowershell=new i("terminal-powershell",{fontCharacter:"\\ebc7"}),i.terminalTmux=new i("terminal-tmux",{fontCharacter:"\\ebc8"}),i.terminalUbuntu=new i("terminal-ubuntu",{fontCharacter:"\\ebc9"}),i.terminalBash=new i("terminal-bash",{fontCharacter:"\\ebca"}),i.arrowSwap=new i("arrow-swap",{fontCharacter:"\\ebcb"}),i.copy=new i("copy",{fontCharacter:"\\ebcc"}),i.personAdd=new i("person-add",{fontCharacter:"\\ebcd"}),i.filterFilled=new i("filter-filled",{fontCharacter:"\\ebce"}),i.wand=new i("wand",{fontCharacter:"\\ebcf"}),i.debugLineByLine=new i("debug-line-by-line",{fontCharacter:"\\ebd0"}),i.inspect=new i("inspect",{fontCharacter:"\\ebd1"}),i.layers=new i("layers",{fontCharacter:"\\ebd2"}),i.layersDot=new i("layers-dot",{fontCharacter:"\\ebd3"}),i.layersActive=new i("layers-active",{fontCharacter:"\\ebd4"}),i.compass=new i("compass",{fontCharacter:"\\ebd5"}),i.compassDot=new i("compass-dot",{fontCharacter:"\\ebd6"}),i.compassActive=new i("compass-active",{fontCharacter:"\\ebd7"}),i.azure=new i("azure",{fontCharacter:"\\ebd8"}),i.issueDraft=new i("issue-draft",{fontCharacter:"\\ebd9"}),i.gitPullRequestClosed=new i("git-pull-request-closed",{fontCharacter:"\\ebda"}),i.gitPullRequestDraft=new i("git-pull-request-draft",{fontCharacter:"\\ebdb"}),i.debugAll=new i("debug-all",{fontCharacter:"\\ebdc"}),i.debugCoverage=new i("debug-coverage",{fontCharacter:"\\ebdd"}),i.runErrors=new i("run-errors",{fontCharacter:"\\ebde"}),i.folderLibrary=new i("folder-library",{fontCharacter:"\\ebdf"}),i.debugContinueSmall=new i("debug-continue-small",{fontCharacter:"\\ebe0"}),i.beakerStop=new i("beaker-stop",{fontCharacter:"\\ebe1"}),i.graphLine=new i("graph-line",{fontCharacter:"\\ebe2"}),i.graphScatter=new i("graph-scatter",{fontCharacter:"\\ebe3"}),i.pieChart=new i("pie-chart",{fontCharacter:"\\ebe4"}),i.bracket=new i("bracket",i.json.definition),i.bracketDot=new i("bracket-dot",{fontCharacter:"\\ebe5"}),i.bracketError=new i("bracket-error",{fontCharacter:"\\ebe6"}),i.lockSmall=new i("lock-small",{fontCharacter:"\\ebe7"}),i.azureDevops=new i("azure-devops",{fontCharacter:"\\ebe8"}),i.verifiedFilled=new i("verified-filled",{fontCharacter:"\\ebe9"})}(G||(G={}))},"VrN/":function(ht,be,Z){(function(re,$){ht.exports=$()})(this,function(){"use strict";var re=navigator.userAgent,$=navigator.platform,P=/gecko\/\d/i.test(re),X=/MSIE \d/.test(re),U=/Trident\/(?:[7-9]|\d{2,})\..*rv:(\d+)/.exec(re),k=/Edge\/(\d+)/.exec(re),G=X||U||k,W=G&&(X?document.documentMode||6:+(k||U)[1]),i=!k&&/WebKit\//.test(re),D=i&&/Qt\/\d+\.\d+/.test(re),g=!k&&/Chrome\//.test(re),p=/Opera\//.test(re),m=/Apple Computer/.test(navigator.vendor),u=/Mac OS X 1\d\D([8-9]|\d\d)\D/.test(re),o=/PhantomJS/.test(re),f=!k&&/AppleWebKit/.test(re)&&/Mobile\/\w+/.test(re),l=/Android/.test(re),h=f||l||/webOS|BlackBerry|Opera Mini|Opera Mobi|IEMobile/i.test(re),a=f||/Mac/.test($),s=/\bCrOS\b/.test(re),A=/win/i.test($),E=p&&re.match(/Version\/(\d*\.\d*)/);E&&(E=Number(E[1])),E&&E>=15&&(p=!1,i=!0);var S=a&&(D||p&&(E==null||E<12.11)),L=P||G&&W>=9;function O(e){return new RegExp("(^|\\s)"+e+"(?:$|\\s)\\s*")}var C=function(e,t){var r=e.className,n=O(t).exec(r);if(n){var d=r.slice(n.index+n[0].length);e.className=r.slice(0,n.index)+(d?n[1]+d:"")}};function T(e){for(var t=e.childNodes.length;t>0;--t)e.removeChild(e.firstChild);return e}function x(e,t){return T(e).appendChild(t)}function c(e,t,r,n){var d=document.createElement(e);if(r&&(d.className=r),n&&(d.style.cssText=n),typeof t=="string")d.appendChild(document.createTextNode(t));else if(t)for(var M=0;M=t)return K+(t-M);K+=J-M,K+=r-K%r,M=J+1}}var ee=function(){this.id=null,this.f=null,this.time=0,this.handler=N(this.onTimeout,this)};ee.prototype.onTimeout=function(e){e.id=0,e.time<=+new Date?e.f():setTimeout(e.handler,e.time-+new Date)},ee.prototype.set=function(e,t){this.f=t;var r=+new Date+e;(!this.id||r=t)return n+Math.min(K,t-d);if(d+=M-n,d+=r-d%r,n=M+1,d>=t)return n}}var pe=[""];function he(e){for(;pe.length<=e;)pe.push(ke(pe)+" ");return pe[e]}function ke(e){return e[e.length-1]}function et(e,t){for(var r=[],n=0;n"\x80"&&(e.toUpperCase()!=e.toLowerCase()||Pe.test(e))}function $e(e,t){return t?t.source.indexOf("\\w")>-1&&je(e)?!0:t.test(e):je(e)}function se(e){for(var t in e)if(e.hasOwnProperty(t)&&e[t])return!1;return!0}var _e=/[\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 Te(e){return e.charCodeAt(0)>=768&&_e.test(e)}function Se(e,t,r){for(;(r<0?t>0:tr?-1:1;;){if(t==r)return t;var d=(t+r)/2,M=n<0?Math.ceil(d):Math.floor(d);if(M==t)return e(M)?t:r;e(M)?r=M:t=M+n}}function Ne(e,t,r,n){if(!e)return n(t,r,"ltr",0);for(var d=!1,M=0;Mt||t==r&&K.to==t)&&(n(Math.max(K.from,t),Math.min(K.to,r),K.level==1?"rtl":"ltr",M),d=!0)}d||n(t,r,"ltr")}var Fe=null;function Ke(e,t,r){var n;Fe=null;for(var d=0;dt)return d;M.to==t&&(M.from!=M.to&&r=="before"?n=d:Fe=d),M.from==t&&(M.from!=M.to&&r!="before"?n=d:Fe=d)}return n!=null?n:Fe}var Je=function(){var e="bbbbbbbbbtstwsbbbbbbbbbbbbbbssstwNN%%%NNNNNN,N,N1111111111NNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNNNLLLLLLLLLLLLLLLLLLLLLLLLLLNNNNbbbbbbsbbbbbbbbbbbbbbbbbbbbbbbbbb,N%%%%NNNNLNNNNN%%11NLNNN1LNNNNNLLLLLLLLLLLLLLLLLLLLLLLNLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLLN",t="nnnnnnNNr%%r,rNNmmmmmmmmmmmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmmmmmmmmmmmmmmmnnnnnnnnnn%nnrrrmrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrrmmmmmmmnNmmmmmmrrmmNmmmmrr1111111111";function r(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 n=/[\u0590-\u05f4\u0600-\u06ff\u0700-\u08ac]/,d=/[stwN]/,M=/[LRr]/,K=/[Lb1n]/,J=/[1n]/;function Q(te,de,me){this.level=te,this.from=de,this.to=me}return function(te,de){var me=de=="ltr"?"L":"R";if(te.length==0||de=="ltr"&&!n.test(te))return!1;for(var Ce=te.length,we=[],Be=0;Be-1&&(n[t]=d.slice(0,M).concat(d.slice(M+1)))}}}function De(e,t){var r=nt(e,t);if(!r.length)return;for(var n=Array.prototype.slice.call(arguments,2),d=0;d0}function fe(e){e.prototype.on=function(t,r){Ie(this,t,r)},e.prototype.off=function(t,r){st(this,t,r)}}function ne(e){e.preventDefault?e.preventDefault():e.returnValue=!1}function ie(e){e.stopPropagation?e.stopPropagation():e.cancelBubble=!0}function oe(e){return e.defaultPrevented!=null?e.defaultPrevented:e.returnValue==!1}function le(e){ne(e),ie(e)}function ye(e){return e.target||e.srcElement}function Le(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 Ue=function(){if(G&&W<9)return!1;var e=c("div");return"draggable"in e||"dragDrop"in e}(),Ze;function mt(e){if(Ze==null){var t=c("span","\u200B");x(e,c("span",[t,document.createTextNode("x")])),e.firstChild.offsetHeight!=0&&(Ze=t.offsetWidth<=1&&t.offsetHeight>2&&!(G&&W<8))}var r=Ze?c("span","\u200B"):c("span","\xA0",null,"display: inline-block; width: 1px; margin-right: -1px");return r.setAttribute("cm-text",""),r}var ft;function Ct(e){if(ft!=null)return ft;var t=x(e,document.createTextNode("A\u062EA")),r=v(t,0,1).getBoundingClientRect(),n=v(t,1,2).getBoundingClientRect();return T(e),!r||r.left==r.right?!1:ft=n.right-r.right<3}var xt=` b`.split(/\n/).length!=3?function(e){for(var t=0,r=[],n=e.length;t<=n;){var d=e.indexOf(` `,t);d==-1&&(d=e.length);var M=e.slice(t,e.charAt(d-1)=="\r"?d-1:d),K=M.indexOf("\r");K!=-1?(r.push(M.slice(0,K)),t+=K+1):(r.push(M),t=d+1)}return r}:function(e){return e.split(/\r\n?|\n/)},Qe=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(r){}return!t||t.parentElement()!=e?!1:t.compareEndPoints("StartToEnd",t)!=0},Lt=function(){var e=c("div");return"oncopy"in e?!0:(e.setAttribute("oncopy","return;"),typeof e.oncopy=="function")}(),vt=null;function Ft(e){if(vt!=null)return vt;var t=x(e,c("span","x")),r=t.getBoundingClientRect(),n=v(t,0,1).getBoundingClientRect();return vt=Math.abs(r.left-n.left)>1}var Pt={},Rt={};function pi(e,t){arguments.length>2&&(t.dependencies=Array.prototype.slice.call(arguments,2)),Pt[e]=t}function ai(e,t){Rt[e]=t}function bt(e){if(typeof e=="string"&&Rt.hasOwnProperty(e))e=Rt[e];else if(e&&typeof e.name=="string"&&Rt.hasOwnProperty(e.name)){var t=Rt[e.name];typeof t=="string"&&(t={name:t}),e=at(t,e),e.name=t.name}else{if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+xml$/.test(e))return bt("application/xml");if(typeof e=="string"&&/^[\w\-]+\/[\w\-]+\+json$/.test(e))return bt("application/json")}return typeof e=="string"?{name:e}:e||{name:"null"}}function ti(e,t){t=bt(t);var r=Pt[t.name];if(!r)return ti(e,"text/plain");var n=r(e,t);if(_t.hasOwnProperty(t.name)){var d=_t[t.name];for(var M in d){if(!d.hasOwnProperty(M))continue;n.hasOwnProperty(M)&&(n["_"+M]=n[M]),n[M]=d[M]}}if(n.name=t.name,t.helperType&&(n.helperType=t.helperType),t.modeProps)for(var K in t.modeProps)n[K]=t.modeProps[K];return n}var _t={};function Tt(e,t){var r=_t.hasOwnProperty(e)?_t[e]:_t[e]={};b(t,r)}function Wt(e,t){if(t===!0)return t;if(e.copyState)return e.copyState(t);var r={};for(var n in t){var d=t[n];d instanceof Array&&(d=d.concat([])),r[n]=d}return r}function ii(e,t){for(var r;e.innerMode&&!(r=e.innerMode(t),!r||r.mode==e);)t=r.state,e=r.mode;return r||{mode:e,state:t}}function ui(e,t,r){return e.startState?e.startState(t,r):!0}var dt=function(e,t,r){this.pos=this.start=0,this.string=e,this.tabSize=t||8,this.lastColumnPos=this.lastColumnValue=0,this.lineStart=0,this.lineOracle=r};dt.prototype.eol=function(){return this.pos>=this.string.length},dt.prototype.sol=function(){return this.pos==this.lineStart},dt.prototype.peek=function(){return this.string.charAt(this.pos)||void 0},dt.prototype.next=function(){if(this.post},dt.prototype.eatSpace=function(){for(var e=this.pos;/[\s\u00a0]/.test(this.string.charAt(this.pos));)++this.pos;return this.pos>e},dt.prototype.skipToEnd=function(){this.pos=this.string.length},dt.prototype.skipTo=function(e){var t=this.string.indexOf(e,this.pos);if(t>-1)return this.pos=t,!0},dt.prototype.backUp=function(e){this.pos-=e},dt.prototype.column=function(){return this.lastColumnPos0?null:(M&&t!==!1&&(this.pos+=M[0].length),M)}},dt.prototype.current=function(){return this.string.slice(this.start,this.pos)},dt.prototype.hideFirstChars=function(e,t){this.lineStart+=e;try{return t()}finally{this.lineStart-=e}},dt.prototype.lookAhead=function(e){var t=this.lineOracle;return t&&t.lookAhead(e)},dt.prototype.baseToken=function(){var e=this.lineOracle;return e&&e.baseToken(this.pos)};function ut(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 r=e;!r.lines;)for(var n=0;;++n){var d=r.children[n],M=d.chunkSize();if(t=e.first&&tr?Ye(r,ut(e,r).text.length):I(t,ut(e,t.line).text.length)}function I(e,t){var r=e.ch;return r==null||r>t?Ye(e.line,t):r<0?Ye(e.line,0):e}function H(e,t){for(var r=[],n=0;nthis.maxLookAhead&&(this.maxLookAhead=e),t},z.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}},z.prototype.nextLine=function(){this.line++,this.maxLookAhead>0&&this.maxLookAhead--},z.fromSaved=function(e,t,r){return t instanceof q?new z(e,Wt(e.mode,t.state),r,t.lookAhead):new z(e,Wt(e.mode,t),r)},z.prototype.save=function(e){var t=e!==!1?Wt(this.doc.mode,this.state):this.state;return this.maxLookAhead>0?new q(t,this.maxLookAhead):t};function ge(e,t,r,n){var d=[e.state.modeGen],M={};Ci(e,t.text,e.doc.mode,r,function(te,de){return d.push(te,de)},M,n);for(var K=r.state,J=function(te){r.baseTokens=d;var de=e.state.overlays[te],me=1,Ce=0;r.state=!0,Ci(e,t.text,de.mode,r,function(we,Be){for(var Xe=me;Cewe&&d.splice(me,1,we,d[me+1],qe),me+=2,Ce=Math.min(we,qe)}if(!Be)return;if(de.opaque)d.splice(Xe,me-Xe,we,"overlay "+Be),me=Xe+2;else for(;Xee.options.maxHighlightLength&&Wt(e.doc.mode,n.state),M=ge(e,t,n);d&&(n.state=d),t.stateAfter=n.save(!d),t.styles=M.styles,M.classes?t.styleClasses=M.classes:t.styleClasses&&(t.styleClasses=null),r===e.doc.highlightFrontier&&(e.doc.modeFrontier=Math.max(e.doc.modeFrontier,++e.doc.highlightFrontier))}return t.styles}function rt(e,t,r){var n=e.doc,d=e.display;if(!n.mode.startState)return new z(n,!0,t);var M=Ai(e,t,r),K=M>n.first&&ut(n,M-1).stateAfter,J=K?z.fromSaved(n,K,M):new z(n,ui(n.mode),M);return n.iter(M,t,function(Q){gt(e,Q.text,J);var te=J.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 zt=function(e,t,r){this.start=e.start,this.end=e.pos,this.string=e.current(),this.type=t||null,this.state=r};function ei(e,t,r,n){var d=e.doc,M=d.mode,K;t=_(d,t);var J=ut(d,t.line),Q=rt(e,t.line,r),te=new dt(J.text,e.options.tabSize,Q),de;for(n&&(de=[]);(n||te.pose.options.maxHighlightLength?(J=!1,K&>(e,t,n,de.pos),de.pos=t.length,me=null):me=Hi(wt(r,de,n.state,Ce),M),Ce){var we=Ce[0].name;we&&(me="m-"+(me?we+" "+me:we))}if(!J||te!=me){for(;QK;--J){if(J<=M.first)return M.first;var Q=ut(M,J-1),te=Q.stateAfter;if(te&&(!r||J+(te instanceof q?te.lookAhead:0)<=M.modeFrontier))return J;var de=Y(Q.text,null,e.options.tabSize);(d==null||n>de)&&(d=J-1,n=de)}return d}function Zi(e,t){if(e.modeFrontier=Math.min(e.modeFrontier,t),e.highlightFrontierr;n--){var d=ut(e,n).stateAfter;if(d&&(!(d instanceof q)||n+d.lookAhead=t:M.to>t);(n||(n=[])).push(new hn(K,M.from,Q?null:M.to))}}return n}function Vn(e,t,r){var n;if(e)for(var d=0;d=t:M.to>t);if(J||M.from==t&&K.type=="bookmark"&&(!r||M.marker.insertLeft)){var Q=M.from==null||(K.inclusiveLeft?M.from<=t:M.from0&&J)for(var pt=0;pt0)continue;var de=[Q,1],me=It(te.from,J.from),Ce=It(te.to,J.to);(me<0||!K.inclusiveLeft&&!me)&&de.push({from:te.from,to:J.from}),(Ce>0||!K.inclusiveRight&&!Ce)&&de.push({from:J.to,to:te.to}),d.splice.apply(d,de),Q+=de.length-3}return d}function dr(e){var t=e.markedSpans;if(!t)return;for(var r=0;rt)&&(!n||Ti(n,M.marker)<0)&&(n=M.marker)}return n}function yi(e,t,r,n,d){var M=ut(e,t),K=vi&&M.markedSpans;if(K)for(var J=0;J=0&&me<=0||de<=0&&me>=0)continue;if(de<=0&&(Q.marker.inclusiveRight&&d.inclusiveLeft?It(te.to,r)>=0:It(te.to,r)>0)||de>=0&&(Q.marker.inclusiveRight&&d.inclusiveLeft?It(te.from,n)<=0:It(te.from,n)<0))return!0}}function Ii(e){for(var t;t=di(e);)e=t.find(-1,!0).line;return e}function Xn(e){for(var t;t=$t(e);)e=t.find(1,!0).line;return e}function xn(e){for(var t,r;t=$t(e);)e=t.find(1,!0).line,(r||(r=[])).push(e);return r}function cr(e,t){var r=ut(e,t),n=Ii(r);return r==n?t:Dt(n)}function Tn(e,t){if(t>e.lastLine())return t;var r=ut(e,t),n;if(!an(e,r))return t;for(;n=$t(r);)r=n.find(1,!0).line;return Dt(r)+1}function an(e,t){var r=vi&&t.markedSpans;if(r)for(var n=void 0,d=0;dt.maxLineLength&&(t.maxLineLength=d,t.maxLine=n)})}var Mn=function(e,t,r){this.text=e,En(this,t),this.height=r?r(this):1};Mn.prototype.lineNo=function(){return Dt(this)},fe(Mn);function ua(e,t,r,n){e.text=t,e.stateAfter&&(e.stateAfter=null),e.styles&&(e.styles=null),e.order!=null&&(e.order=null),dr(e),En(e,r);var d=n?n(e):1;d!=e.height&&Mt(e,d)}function yt(e){e.parent=null,dr(e)}var kt={},St={};function Bt(e,t){if(!e||/^\s*$/.test(e))return null;var r=t.addModeClass?St:kt;return r[e]||(r[e]=e.replace(/\S+/g,"cm-$&"))}function Kt(e,t){var r=w("span",null,null,i?"padding-right: .1px":null),n={pre:w("pre",[r],"CodeMirror-line"),content:r,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,K=void 0;n.pos=0,n.addToken=Gt,Ct(e.display.measure)&&(K=Ve(M,e.doc.direction))&&(n.addToken=Mi(n.addToken,K)),n.map=[];var J=t!=e.display.externalMeasured&&Dt(M);dn(M,n,He(e,M,J)),M.styleClasses&&(M.styleClasses.bgClass&&(n.bgClass=R(M.styleClasses.bgClass,n.bgClass||"")),M.styleClasses.textClass&&(n.textClass=R(M.styleClasses.textClass,n.textClass||""))),n.map.length==0&&n.map.push(0,0,n.content.appendChild(mt(e.display.measure))),d==0?(t.measure.map=n.map,t.measure.cache={}):((t.measure.maps||(t.measure.maps=[])).push(n.map),(t.measure.caches||(t.measure.caches=[])).push({}))}if(i){var Q=n.content.lastChild;(/\bcm-tab\b/.test(Q.className)||Q.querySelector&&Q.querySelector(".cm-tab"))&&(n.content.className="cm-tab-wrap-hack")}return De(e,"renderLine",e,t.line,n.pre),n.pre.className&&(n.textClass=R(n.pre.className,n.textClass||"")),n}function Zt(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 Gt(e,t,r,n,d,M,K){if(!t)return;var J=e.splitSpaces?mi(t,e.trailingSpace):t,Q=e.cm.state.specialChars,te=!1,de;if(!Q.test(t))e.col+=t.length,de=document.createTextNode(J),e.map.push(e.pos,e.pos+t.length,de),G&&W<9&&(te=!0),e.pos+=t.length;else{de=document.createDocumentFragment();for(var me=0;;){Q.lastIndex=me;var Ce=Q.exec(t),we=Ce?Ce.index-me:t.length-me;if(we){var Be=document.createTextNode(J.slice(me,me+we));G&&W<9?de.appendChild(c("span",[Be])):de.appendChild(Be),e.map.push(e.pos,e.pos+we,Be),e.col+=we,e.pos+=we}if(!Ce)break;me+=we+1;var Xe=void 0;if(Ce[0]==" "){var qe=e.cm.options.tabSize,ot=qe-e.col%qe;Xe=de.appendChild(c("span",he(ot),"cm-tab")),Xe.setAttribute("role","presentation"),Xe.setAttribute("cm-text"," "),e.col+=ot}else Ce[0]=="\r"||Ce[0]==` `?(Xe=de.appendChild(c("span",Ce[0]=="\r"?"\u240D":"\u2424","cm-invalidchar")),Xe.setAttribute("cm-text",Ce[0]),e.col+=1):(Xe=e.cm.options.specialCharPlaceholder(Ce[0]),Xe.setAttribute("cm-text",Ce[0]),G&&W<9?de.appendChild(c("span",[Xe])):de.appendChild(Xe),e.col+=1);e.map.push(e.pos,e.pos+1,Xe),e.pos++}}if(e.trailingSpace=J.charCodeAt(t.length-1)==32,r||n||d||te||M||K){var ct=r||"";n&&(ct+=n),d&&(ct+=d);var lt=c("span",[de],ct,M);if(K)for(var pt in K)K.hasOwnProperty(pt)&&pt!="style"&&pt!="class"&<.setAttribute(pt,K[pt]);return e.content.appendChild(lt)}e.content.appendChild(de)}function mi(e,t){if(e.length>1&&!/ /.test(e))return e;for(var r=t,n="",d=0;dte&&me.from<=te);Ce++);if(me.to>=de)return e(r,n,d,M,K,J,Q);e(r,n.slice(0,me.to-te),d,M,null,J,Q),M=null,n=n.slice(me.to-te),te=me.to}}}function Ht(e,t,r,n){var d=!n&&r.widgetNode;d&&e.map.push(e.pos,e.pos+t,d),!n&&e.cm.display.input.needsContentAttribute&&(d||(d=e.content.appendChild(document.createElement("span"))),d.setAttribute("cm-marker",r.id)),d&&(e.cm.display.input.setUneditable(d),e.content.appendChild(d)),e.pos+=t,e.trailingSpace=!1}function dn(e,t,r){var n=e.markedSpans,d=e.text,M=0;if(!n){for(var K=1;KQ||Nt.collapsed&&Et.to==Q&&Et.from==Q)){if(Et.to!=null&&Et.to!=Q&&we>Et.to&&(we=Et.to,Xe=""),Nt.className&&(Be+=" "+Nt.className),Nt.css&&(Ce=(Ce?Ce+";":"")+Nt.css),Nt.startStyle&&Et.from==Q&&(qe+=" "+Nt.startStyle),Nt.endStyle&&Et.to==we&&(pt||(pt=[])).push(Nt.endStyle,Et.to),Nt.title&&((ct||(ct={})).title=Nt.title),Nt.attributes)for(var Qt in Nt.attributes)(ct||(ct={}))[Qt]=Nt.attributes[Qt];Nt.collapsed&&(!ot||Ti(ot.marker,Nt)<0)&&(ot=Et)}else Et.from>Q&&we>Et.from&&(we=Et.from)}if(pt)for(var Ei=0;Ei=J)break;for(var Ki=Math.min(J,we);;){if(de){var Ui=Q+de.length;if(!ot){var ci=Ui>Ki?de.slice(0,Ki-Q):de;t.addToken(t,ci,me?me+Be:Be,qe,Q+ci.length==we?Xe:"",Ce,ct)}if(Ui>=Ki){de=de.slice(Ki-Q),Q=Ki;break}Q=Ui,qe=""}de=d.slice(M,M=r[te++]),me=Bt(r[te++],t.cm.options)}}}function Xt(e,t,r){this.line=t,this.rest=xn(t),this.size=this.rest?Dt(ke(this.rest))-r+1:1,this.node=this.text=null,this.hidden=an(e,t)}function Pi(e,t,r){for(var n=[],d,M=t;M2&&M.push((Q.bottom+te.top)/2-r.top)}}M.push(r.bottom-r.top)}}function es(e,t,r){if(e.line==t)return{map:e.measure.map,cache:e.measure.cache};for(var n=0;nr)return{map:e.measure.maps[d],cache:e.measure.caches[d],before:!0}}function Bo(e,t){t=Ii(t);var r=Dt(t),n=e.display.externalMeasured=new Xt(e.doc,t,r);n.lineN=r;var d=n.built=Kt(e,n);return n.text=d.pre,x(e.display.lineMeasure,d.pre),n}function ts(e,t,r,n){return on(e,Yn(e,t),r,n)}function fa(e,t){if(t>=e.display.viewFrom&&t=r.lineN&&tt)&&(M=Q-J,d=M-1,t>=Q&&(K="right")),d!=null){if(n=e[te+2],J==Q&&r==(n.insertLeft?"left":"right")&&(K=r),r=="left"&&d==0)for(;te&&e[te-2]==e[te-3]&&e[te-1].insertLeft;)n=e[(te-=3)+2],K="left";if(r=="right"&&d==Q-J)for(;te=0&&!((r=e[d]).left!=r.right);d--);return r}function Ho(e,t,r,n){var d=ns(t.map,r,n),M=d.node,K=d.start,J=d.end,Q=d.collapse,te;if(M.nodeType==3){for(var de=0;de<4;de++){for(;K&&Te(t.line.text.charAt(d.coverStart+K));)--K;for(;d.coverStart+J0&&(Q=n="right");var me;e.options.lineWrapping&&(me=M.getClientRects()).length>1?te=me[n=="right"?me.length-1:0]:te=M.getBoundingClientRect()}if(G&&W<9&&!K&&(!te||!te.left&&!te.right)){var Ce=M.parentNode.getClientRects()[0];Ce?te={left:Ce.left,right:Ce.left+Jn(e.display),top:Ce.top,bottom:Ce.bottom}:te=is}for(var we=te.top-t.rect.top,Be=te.bottom-t.rect.top,Xe=(we+Be)/2,qe=t.view.measure.heights,ot=0;ot=n.text.length?(Q=n.text.length,te="before"):Q<=0&&(Q=0,te="after"),!J)return K(te=="before"?Q-1:Q,te=="before");function de(Be,Xe,qe){var ot=J[Xe],ct=ot.level==1;return K(qe?Be-1:Be,ct!=qe)}var me=Ke(J,Q,te),Ce=Fe,we=de(Q,me,te=="before");return Ce!=null&&(we.other=de(Q,Ce,te!="before")),we}function us(e,t){var r=0;t=_(e.doc,t),e.options.lineWrapping||(r=Jn(e.display)*t.ch);var n=ut(e.doc,t.line),d=qi(n)+Hr(e.display);return{left:r,right:r,top:d,bottom:d+n.height}}function ga(e,t,r,n,d){var M=Ye(e,t,r);return M.xRel=d,n&&(M.outside=n),M}function va(e,t,r){var n=e.doc;if(r+=e.display.viewOffset,r<0)return ga(n.first,0,null,-1,-1);var d=Ut(n,r),M=n.first+n.size-1;if(d>M)return ga(n.first+n.size-1,ut(n,M).text.length,null,1,1);t<0&&(t=0);for(var K=ut(n,d);;){var J=Go(e,K,d,t,r),Q=rn(K,J.ch+(J.xRel>0||J.outside>0?1:0));if(!Q)return J;var te=Q.find(1);if(te.line==d)return te;K=ut(n,d=te.line)}}function hs(e,t,r,n){n-=pa(t);var d=t.text.length,M=Ge(function(K){return on(e,r,K-1).bottom<=n},d,0);return d=Ge(function(K){return on(e,r,K).top>n},M,d),{begin:M,end:d}}function ds(e,t,r,n){r||(r=Yn(e,t));var d=Wr(e,t,on(e,r,n),"line").top;return hs(e,t,r,d)}function ya(e,t,r,n){return e.bottom<=r?!1:e.top>r?!0:(n?e.left:e.right)>t}function Go(e,t,r,n,d){d-=qi(t);var M=Yn(e,t),K=pa(t),J=0,Q=t.text.length,te=!0,de=Ve(t,e.doc.direction);if(de){var me=(e.options.lineWrapping?zo:Ko)(e,t,r,M,de,n,d);te=me.level!=1,J=te?me.from:me.to-1,Q=te?me.to:me.from-1}var Ce=null,we=null,Be=Ge(function(At){var Et=on(e,M,At);return Et.top+=K,Et.bottom+=K,ya(Et,n,d,!1)?(Et.top<=d&&Et.left<=n&&(Ce=At,we=Et),!0):!1},J,Q),Xe,qe,ot=!1;if(we){var ct=n-we.left=pt.bottom?1:0}return Be=Se(t.text,Be,1),ga(r,Be,qe,ot,n-Xe)}function Ko(e,t,r,n,d,M,K){var J=Ge(function(me){var Ce=d[me],we=Ce.level!=1;return ya(en(e,Ye(r,we?Ce.to:Ce.from,we?"before":"after"),"line",t,n),M,K,!0)},0,d.length-1),Q=d[J];if(J>0){var te=Q.level!=1,de=en(e,Ye(r,te?Q.from:Q.to,te?"after":"before"),"line",t,n);ya(de,M,K,!0)&&de.top>K&&(Q=d[J-1])}return Q}function zo(e,t,r,n,d,M,K){var J=hs(e,t,n,K),Q=J.begin,te=J.end;/\s/.test(t.text.charAt(te-1))&&te--;for(var de=null,me=null,Ce=0;Ce=te||we.to<=Q)continue;var Be=we.level!=1,Xe=on(e,n,Be?Math.min(te,we.to)-1:Math.max(Q,we.from)).right,qe=Xeqe)&&(de=we,me=qe)}return de||(de=d[d.length-1]),de.fromte&&(de={from:de.from,to:te,level:de.level}),de}var Nn;function $n(e){if(e.cachedTextHeight!=null)return e.cachedTextHeight;if(Nn==null){Nn=c("pre",null,"CodeMirror-line-like");for(var t=0;t<49;++t)Nn.appendChild(document.createTextNode("x")),Nn.appendChild(c("br"));Nn.appendChild(document.createTextNode("x"))}x(e.measure,Nn);var r=Nn.offsetHeight/50;return r>3&&(e.cachedTextHeight=r),T(e.measure),r||1}function Jn(e){if(e.cachedCharWidth!=null)return e.cachedCharWidth;var t=c("span","xxxxxxxxxx"),r=c("pre",[t],"CodeMirror-line-like");x(e.measure,r);var n=t.getBoundingClientRect(),d=(n.right-n.left)/10;return d>2&&(e.cachedCharWidth=d),d||10}function ba(e){for(var t=e.display,r={},n={},d=t.gutters.clientLeft,M=t.gutters.firstChild,K=0;M;M=M.nextSibling,++K){var J=e.display.gutterSpecs[K].className;r[J]=M.offsetLeft+M.clientLeft+d,n[J]=M.clientWidth}return{fixedPos:_a(t),gutterTotalWidth:t.gutters.offsetWidth,gutterLeft:r,gutterWidth:n,wrapperWidth:t.wrapper.clientWidth}}function _a(e){return e.scroller.getBoundingClientRect().left-e.sizer.getBoundingClientRect().left}function cs(e){var t=$n(e.display),r=e.options.lineWrapping,n=r&&Math.max(5,e.display.scroller.clientWidth/Jn(e.display)-3);return function(d){if(an(e.doc,d))return 0;var M=0;if(d.widgets)for(var K=0;K0&&(te=ut(e.doc,Q.line).text).length==Q.ch){var de=Y(te,te.length,e.options.tabSize)-te.length;Q=Ye(Q.line,Math.max(0,Math.round((M-qa(e.display).left)/Jn(e.display))-de))}return Q}function Un(e,t){if(t>=e.display.viewTo)return null;if(t-=e.display.viewFrom,t<0)return null;for(var r=e.display.view,n=0;nt)&&(d.updateLineNumbers=t),e.curOp.viewChanged=!0,t>=d.viewTo)vi&&cr(e.doc,t)d.viewFrom?Sn(e):(d.viewFrom+=n,d.viewTo+=n);else if(t<=d.viewFrom&&r>=d.viewTo)Sn(e);else if(t<=d.viewFrom){var M=Gr(e,r,r+n,1);M?(d.view=d.view.slice(M.index),d.viewFrom=M.lineN,d.viewTo+=n):Sn(e)}else if(r>=d.viewTo){var K=Gr(e,t,t,-1);K?(d.view=d.view.slice(0,K.index),d.viewTo=K.lineN):Sn(e)}else{var J=Gr(e,t,t,-1),Q=Gr(e,r,r+n,1);J&&Q?(d.view=d.view.slice(0,J.index).concat(Pi(e,J.lineN,Q.lineN)).concat(d.view.slice(Q.index)),d.viewTo+=n):Sn(e)}var te=d.externalMeasured;te&&(r=d.lineN&&t=n.viewTo)return;var M=n.view[Un(e,t)];if(M.node==null)return;var K=M.changes||(M.changes=[]);ae(K,r)==-1&&K.push(r)}function Sn(e){e.display.viewFrom=e.display.viewTo=e.doc.first,e.display.view=[],e.display.viewOffset=0}function Gr(e,t,r,n){var d=Un(e,t),M,K=e.display.view;if(!vi||r==e.doc.first+e.doc.size)return{index:d,lineN:r};for(var J=e.display.viewFrom,Q=0;Q0){if(d==K.length-1)return null;M=J+K[d].size-t,d++}else M=J-t;t+=M,r+=M}for(;cr(e.doc,r)!=r;){if(d==(n<0?0:K.length-1))return null;r+=n*K[d-(n<0?1:0)].size,d+=n}return{index:d,lineN:r}}function Vo(e,t,r){var n=e.display,d=n.view;d.length==0||t>=n.viewTo||r<=n.viewFrom?(n.view=Pi(e,t,r),n.viewFrom=t):(n.viewFrom>t?n.view=Pi(e,t,n.viewFrom).concat(n.view):n.viewFromr&&(n.view=n.view.slice(0,Un(e,r)))),n.viewTo=r}function fs(e){for(var t=e.display.view,r=0,n=0;n=e.display.viewTo||J.to().line0?t.blinker=setInterval(function(){e.hasFocus()||Zn(e),t.cursorDiv.style.visibility=(r=!r)?"":"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,Zn(e))},100)}function Ta(e,t){if(e.state.delayingBlurEvent&&(e.state.delayingBlurEvent=!1),e.options.readOnly=="nocursor")return;e.state.focused||(De(e,"focus",e,t),e.state.focused=!0,B(e.display.wrapper,"CodeMirror-focused"),!e.curOp&&e.display.selForContextMenu!=e.doc.sel&&(e.display.input.reset(),i&&setTimeout(function(){return e.display.input.reset(!0)},20)),e.display.input.receivedFocus()),xa(e)}function Zn(e,t){if(e.state.delayingBlurEvent)return;e.state.focused&&(De(e,"blur",e,t),e.state.focused=!1,C(e.display.wrapper,"CodeMirror-focused")),clearInterval(e.display.blinker),setTimeout(function(){e.state.focused||(e.display.shift=!1)},150)}function zr(e){for(var t=e.display,r=t.lineDiv.offsetTop,n=0;n.005||de<-.005)&&(Mt(d.line,K),ys(d.line),d.rest))for(var me=0;mee.display.sizerWidth){var Ce=Math.ceil(J/Jn(e.display));Ce>e.display.maxLineLength&&(e.display.maxLineLength=Ce,e.display.maxLine=d.line,e.display.maxLineChanged=!0)}}}function ys(e){if(e.widgets)for(var t=0;t=K&&(M=Ut(t,qi(ut(t,Q))-e.wrapper.clientHeight),K=Q)}return{from:M,to:Math.max(K,M+1)}}function Yo(e,t){if(Me(e,"scrollCursorIntoView"))return;var r=e.display,n=r.sizer.getBoundingClientRect(),d=null;if(t.top+n.top<0?d=!0:t.bottom+n.top>(window.innerHeight||document.documentElement.clientHeight)&&(d=!1),d!=null&&!o){var M=c("div","\u200B",null,`position: absolute; top: `+(t.top-r.viewOffset-Hr(e.display))+`px; height: `+(t.bottom-t.top+sn(e)+r.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,r,n){n==null&&(n=0);var d;!e.options.lineWrapping&&t==r&&(t=t.ch?Ye(t.line,t.sticky=="before"?t.ch-1:t.ch,"after"):t,r=t.sticky=="before"?Ye(t.line,t.ch+1,"before"):t);for(var M=0;M<5;M++){var K=!1,J=en(e,t),Q=!r||r==t?J:en(e,r);d={left:Math.min(J.left,Q.left),top:Math.min(J.top,Q.top)-n,right:Math.max(J.left,Q.left),bottom:Math.max(J.bottom,Q.bottom)+n};var te=wa(e,d),de=e.doc.scrollTop,me=e.doc.scrollLeft;if(te.scrollTop!=null&&(Er(e,te.scrollTop),Math.abs(e.doc.scrollTop-de)>1&&(K=!0)),te.scrollLeft!=null&&(Bn(e,te.scrollLeft),Math.abs(e.doc.scrollLeft-me)>1&&(K=!0)),!K)break}return d}function Jo(e,t){var r=wa(e,t);r.scrollTop!=null&&Er(e,r.scrollTop),r.scrollLeft!=null&&Bn(e,r.scrollLeft)}function wa(e,t){var r=e.display,n=$n(e.display);t.top<0&&(t.top=0);var d=e.curOp&&e.curOp.scrollTop!=null?e.curOp.scrollTop:r.scroller.scrollTop,M=ca(e),K={};t.bottom-t.top>M&&(t.bottom=t.top+M);var J=e.doc.height+da(r),Q=t.topJ-n;if(t.topd+M){var de=Math.min(t.top,(te?J:t.bottom)-M);de!=d&&(K.scrollTop=de)}var me=e.options.fixedGutter?0:r.gutters.offsetWidth,Ce=e.curOp&&e.curOp.scrollLeft!=null?e.curOp.scrollLeft:r.scroller.scrollLeft-me,we=Pn(e)-r.gutters.offsetWidth,Be=t.right-t.left>we;return Be&&(t.right=t.left+we),t.left<10?K.scrollLeft=0:t.leftwe+Ce-3&&(K.scrollLeft=t.right+(Be?0:10)-we),K}function Sa(e,t){if(t==null)return;Xr(e),e.curOp.scrollTop=(e.curOp.scrollTop==null?e.doc.scrollTop:e.curOp.scrollTop)+t}function Qn(e){Xr(e);var t=e.getCursor();e.curOp.scrollToPos={from:t,to:t,margin:e.options.cursorScrollMargin}}function _r(e,t,r){(t!=null||r!=null)&&Xr(e),t!=null&&(e.curOp.scrollLeft=t),r!=null&&(e.curOp.scrollTop=r)}function Zo(e,t){Xr(e),e.curOp.scrollToPos=t}function Xr(e){var t=e.curOp.scrollToPos;if(t){e.curOp.scrollToPos=null;var r=us(e,t.from),n=us(e,t.to);bs(e,r,n,t.margin)}}function bs(e,t,r,n){var d=wa(e,{left:Math.min(t.left,r.left),top:Math.min(t.top,r.top)-n,right:Math.max(t.right,r.right),bottom:Math.max(t.bottom,r.bottom)+n});_r(e,d.scrollLeft,d.scrollTop)}function Er(e,t){if(Math.abs(e.doc.scrollTop-t)<2)return;P||Aa(e,{top:t}),_s(e,t,!0),P&&Aa(e),wr(e,100)}function _s(e,t,r){if(t=Math.max(0,Math.min(e.display.scroller.scrollHeight-e.display.scroller.clientHeight,t)),e.display.scroller.scrollTop==t&&!r)return;e.doc.scrollTop=t,e.display.scrollbars.setScrollTop(t),e.display.scroller.scrollTop!=t&&(e.display.scroller.scrollTop=t)}function Bn(e,t,r,n){if(t=Math.max(0,Math.min(t,e.display.scroller.scrollWidth-e.display.scroller.clientWidth)),(r?t==e.doc.scrollLeft:Math.abs(e.doc.scrollLeft-t)<2)&&!n)return;e.doc.scrollLeft=t,Ss(e),e.display.scroller.scrollLeft!=t&&(e.display.scroller.scrollLeft=t),e.display.scrollbars.setScrollLeft(t)}function xr(e){var t=e.display,r=t.gutters.offsetWidth,n=Math.round(e.doc.height+da(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?r:0,docHeight:n,scrollHeight:n+sn(e)+t.barHeight,nativeBarWidth:t.nativeBarWidth,gutterWidth:r}}var jn=function(e,t,r){this.cm=r;var n=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");n.tabIndex=d.tabIndex=-1,e(n),e(d),Ie(n,"scroll",function(){n.clientHeight&&t(n.scrollTop,"vertical")}),Ie(d,"scroll",function(){d.clientWidth&&t(d.scrollLeft,"horizontal")}),this.checkedZeroWidth=!1,G&&W<8&&(this.horiz.style.minHeight=this.vert.style.minWidth="18px")};jn.prototype.update=function(e){var t=e.scrollWidth>e.clientWidth+1,r=e.scrollHeight>e.clientHeight+1,n=e.nativeBarWidth;if(r){this.vert.style.display="block",this.vert.style.bottom=t?n+"px":"0";var d=e.viewHeight-(t?n: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=r?n+"px":"0",this.horiz.style.left=e.barLeft+"px";var M=e.viewWidth-e.barLeft-(r?n: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&&(n==0&&this.zeroWidthHack(),this.checkedZeroWidth=!0),{right:r?n:0,bottom:t?n:0}},jn.prototype.setScrollLeft=function(e){this.horiz.scrollLeft!=e&&(this.horiz.scrollLeft=e),this.disableHoriz&&this.enableZeroWidthBar(this.horiz,this.disableHoriz,"horiz")},jn.prototype.setScrollTop=function(e){this.vert.scrollTop!=e&&(this.vert.scrollTop=e),this.disableVert&&this.enableZeroWidthBar(this.vert,this.disableVert,"vert")},jn.prototype.zeroWidthHack=function(){var e=a&&!u?"12px":"18px";this.horiz.style.height=this.vert.style.width=e,this.horiz.style.pointerEvents=this.vert.style.pointerEvents="none",this.disableHoriz=new ee,this.disableVert=new ee},jn.prototype.enableZeroWidthBar=function(e,t,r){e.style.pointerEvents="auto";function n(){var d=e.getBoundingClientRect(),M=r=="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,n)}t.set(1e3,n)},jn.prototype.clear=function(){var e=this.horiz.parentNode;e.removeChild(this.horiz),e.removeChild(this.vert)};var Tr=function(){};Tr.prototype.update=function(){return{bottom:0,right:0}},Tr.prototype.setScrollLeft=function(){},Tr.prototype.setScrollTop=function(){},Tr.prototype.clear=function(){};function qn(e,t){t||(t=xr(e));var r=e.display.barWidth,n=e.display.barHeight;Es(e,t);for(var d=0;d<4&&r!=e.display.barWidth||n!=e.display.barHeight;d++)r!=e.display.barWidth&&e.options.lineWrapping&&zr(e),Es(e,xr(e)),r=e.display.barWidth,n=e.display.barHeight}function Es(e,t){var r=e.display,n=r.scrollbars.update(t);r.sizer.style.paddingRight=(r.barWidth=n.right)+"px",r.sizer.style.paddingBottom=(r.barHeight=n.bottom)+"px",r.heightForcer.style.borderBottom=n.bottom+"px solid transparent",n.right&&n.bottom?(r.scrollbarFiller.style.display="block",r.scrollbarFiller.style.height=n.bottom+"px",r.scrollbarFiller.style.width=n.right+"px"):r.scrollbarFiller.style.display="",n.bottom&&e.options.coverGutterNextToScrollbar&&e.options.fixedGutter?(r.gutterFiller.style.display="block",r.gutterFiller.style.height=n.bottom+"px",r.gutterFiller.style.width=t.gutterWidth+"px"):r.gutterFiller.style.display=""}var xs={native:jn,null:Tr};function Ts(e){e.display.scrollbars&&(e.display.scrollbars.clear(),e.display.scrollbars.addClass&&C(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),Ie(t,"mousedown",function(){e.state.focused&&setTimeout(function(){return e.display.input.focus()},0)}),t.setAttribute("cm-not-content","true")},function(t,r){r=="horizontal"?Bn(e,t):Er(e,t)},e),e.display.scrollbars.addClass&&B(e.display.wrapper,e.display.scrollbars.addClass)}var Qo=0;function Hn(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:++Qo},Ji(e.curOp)}function Wn(e){var t=e.curOp;t&&Io(t,function(r){for(var n=0;n=r.viewTo)||r.maxLineChanged&&t.options.lineWrapping,e.update=e.mustUpdate&&new Yr(t,e.mustUpdate&&{top:e.scrollTop,ensure:e.scrollToPos},e.forceUpdate)}function tl(e){e.updatedDisplay=e.mustUpdate&&Ca(e.cm,e.update)}function il(e){var t=e.cm,r=t.display;e.updatedDisplay&&zr(t),e.barMeasure=xr(t),r.maxLineChanged&&!t.options.lineWrapping&&(e.adjustWidthTo=ts(t,r.maxLine,r.maxLine.text.length).left+3,t.display.sizerWidth=e.adjustWidthTo,e.barMeasure.scrollWidth=Math.max(r.scroller.clientWidth,r.sizer.offsetLeft+e.adjustWidthTo+sn(t)+t.display.barWidth),e.maxScrollLeft=Math.max(0,r.sizer.offsetLeft+e.adjustWidthTo-Pn(t))),(e.updatedDisplay||e.selectionChanged)&&(e.preparedSelection=r.input.prepareSelection())}function nl(e){var t=e.cm;e.adjustWidthTo!=null&&(t.display.sizer.style.minWidth=e.adjustWidthTo+"px",e.maxScrollLeft=e.display.viewTo)return;var r=+new Date+e.options.workTime,n=rt(e,t.highlightFrontier),d=[];t.iter(n.line,Math.min(t.first+t.size,e.display.viewTo+500),function(M){if(n.line>=e.display.viewFrom){var K=M.styles,J=M.text.length>e.options.maxHighlightLength?Wt(t.mode,n.state):null,Q=ge(e,M,n,!0);J&&(n.state=J),M.styles=Q.styles;var te=M.styleClasses,de=Q.classes;de?M.styleClasses=de:te&&(M.styleClasses=null);for(var me=!K||K.length!=M.styles.length||te!=de&&(!te||!de||te.bgClass!=de.bgClass||te.textClass!=de.textClass),Ce=0;!me&&Cer)return wr(e,e.options.workDelay),!0}),t.highlightFrontier=n.line,t.modeFrontier=Math.max(t.modeFrontier,n.line),d.length&&Gi(e,function(){for(var M=0;M=r.viewFrom&&t.visible.to<=r.viewTo&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo)&&r.renderedView==r.view&&fs(e)==0)return!1;Cs(e)&&(Sn(e),t.dims=ba(e));var d=n.first+n.size,M=Math.max(t.visible.from-e.options.viewportMargin,n.first),K=Math.min(d,t.visible.to+e.options.viewportMargin);r.viewFromK&&r.viewTo-K<20&&(K=Math.min(d,r.viewTo)),vi&&(M=cr(e.doc,M),K=Tn(e.doc,K));var J=M!=r.viewFrom||K!=r.viewTo||r.lastWrapHeight!=t.wrapperHeight||r.lastWrapWidth!=t.wrapperWidth;Vo(e,M,K),r.viewOffset=qi(ut(e.doc,r.viewFrom)),e.display.mover.style.top=r.viewOffset+"px";var Q=fs(e);if(!J&&Q==0&&!t.force&&r.renderedView==r.view&&(r.updateLineNumbers==null||r.updateLineNumbers>=r.viewTo))return!1;var te=ol(e);return Q>4&&(r.lineDiv.style.display="none"),ul(e,r.updateLineNumbers,t.dims),Q>4&&(r.lineDiv.style.display=""),r.renderedView=r.view,ll(te),T(r.cursorDiv),T(r.selectionDiv),r.gutters.style.height=r.sizer.style.minHeight=0,J&&(r.lastWrapHeight=t.wrapperHeight,r.lastWrapWidth=t.wrapperWidth,wr(e,400)),r.updateLineNumbers=null,!0}function ws(e,t){for(var r=t.viewport,n=!0;;n=!1){if(!n||!e.options.lineWrapping||t.oldDisplayWidth==Pn(e)){if(r&&r.top!=null&&(r={top:Math.min(e.doc.height+da(e.display)-ca(e),r.top)}),t.visible=Vr(e.display,e.doc,r),t.visible.from>=e.display.viewFrom&&t.visible.to<=e.display.viewTo)break}else n&&(t.visible=Vr(e.display,e.doc,r));if(!Ca(e,t))break;zr(e);var d=xr(e);br(e),qn(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 r=new Yr(e,t);if(Ca(e,r)){zr(e),ws(e,r);var n=xr(e);br(e),qn(e,n),Oa(e,n),r.finish()}}function ul(e,t,r){var n=e.display,d=e.options.lineNumbers,M=n.lineDiv,K=M.firstChild;function J(Be){var Xe=Be.nextSibling;return i&&a&&e.display.currentWheelTarget==Be?Be.style.display="none":Be.parentNode.removeChild(Be),Xe}for(var Q=n.view,te=n.viewFrom,de=0;de-1&&(we=!1),Ya(e,me,te,r)),we&&(T(me.lineNumber),me.lineNumber.appendChild(document.createTextNode(Yi(e.options,te)))),K=me.node.nextSibling}te+=me.size}for(;K;)K=J(K)}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+sn(e)+"px"}function Ss(e){var t=e.display,r=t.view;if(!t.alignWidgets&&(!t.gutters.firstChild||!e.options.fixedGutter))return;for(var n=_a(t)-t.scroller.scrollLeft+e.doc.scrollLeft,d=t.gutters.offsetWidth,M=n+"px",K=0;KK.clientWidth,Q=K.scrollHeight>K.clientHeight;if(!(n&&J||d&&Q))return;if(d&&a&&i){e:for(var te=t.target,de=M.view;te!=K;te=te.parentNode)for(var me=0;me=0&&It(e,n.to())<=0)return r}return-1};var Yt=function(e,t){this.anchor=e,this.head=t};Yt.prototype.from=function(){return yn(this.anchor,this.head)},Yt.prototype.to=function(){return vn(this.anchor,this.head)},Yt.prototype.empty=function(){return this.head.line==this.anchor.line&&this.head.ch==this.anchor.ch};function tn(e,t,r){var n=e&&e.options.selectionsMayTouch,d=t[r];t.sort(function(Ce,we){return It(Ce.from(),we.from())}),r=ae(t,d);for(var M=1;M0:Q>=0){var te=yn(J.from(),K.from()),de=vn(J.to(),K.to()),me=J.empty()?K.from()==K.head:J.from()==J.head;M<=r&&--r,t.splice(--M,2,new Yt(me?de:te,me?te:de))}}return new Xi(t,r)}function Cn(e,t){return new Xi([new Yt(e,t||e)],0)}function An(e){return e.text?Ye(e.from.line+e.text.length-1,ke(e.text).length+(e.text.length==1?e.from.ch:0)):e.to}function Ls(e,t){if(It(e,t.from)<0)return e;if(It(e,t.to)<=0)return An(t);var r=e.line+t.text.length-(t.to.line-t.from.line)-1,n=e.ch;return e.line==t.to.line&&(n+=An(t).ch-t.to.ch),Ye(r,n)}function Ia(e,t){for(var r=[],n=0;n1&&e.remove(J.line+1,Be-1),e.insert(J.line+1,ot)}wi(e,"change",e,t)}function Rn(e,t,r){function n(d,M,K){if(d.linked)for(var J=0;J1&&!e.done[e.done.length-2].ranges)return e.done.pop(),ke(e.done)}function Ns(e,t,r,n){var d=e.history;d.undone.length=0;var M=+new Date,K,J;if((d.lastOp==n||d.lastOrigin==t.origin&&t.origin&&(t.origin.charAt(0)=="+"&&d.lastModTime>M-(e.cm?e.cm.options.historyEventDelay:500)||t.origin.charAt(0)=="*"))&&(K=pl(d,d.lastOp==n)))J=ke(K.changes),It(t.from,t.to)==0&&It(t.from,J.to)==0?J.to=An(t):K.changes.push(Ma(e,t));else{var Q=ke(d.done);for((!Q||!Q.ranges)&&Zr(e.sel,d.done),K={changes:[Ma(e,t)],generation:d.generation},d.done.push(K);d.done.length>d.undoDepth;)d.done.shift(),d.done[0].ranges||d.done.shift()}d.done.push(r),d.generation=++d.maxGeneration,d.lastModTime=d.lastSelTime=M,d.lastOp=d.lastSelOp=n,d.lastOrigin=d.lastSelOrigin=t.origin,J||De(e,"historyAdded")}function ml(e,t,r,n){var d=t.charAt(0);return d=="*"||d=="+"&&r.ranges.length==n.ranges.length&&r.somethingSelected()==n.somethingSelected()&&new Date-e.history.lastSelTime<=(e.cm?e.cm.options.historyEventDelay:500)}function gl(e,t,r,n){var d=e.history,M=n&&n.origin;r==d.lastSelOp||M&&d.lastSelOrigin==M&&(d.lastModTime==d.lastSelTime&&d.lastOrigin==M||ml(e,M,ke(d.done),t))?d.done[d.done.length-1]=t:Zr(t,d.done),d.lastSelTime=+new Date,d.lastSelOrigin=M,d.lastSelOp=r,n&&n.clearRedo!==!1&&Ps(d.undone)}function Zr(e,t){var r=ke(t);r&&r.ranges&&r.equals(e)||t.push(e)}function Fs(e,t,r,n){var d=t["spans_"+e.id],M=0;e.iter(Math.max(e.first,r),Math.min(e.first+e.size,n),function(K){K.markedSpans&&((d||(d=t["spans_"+e.id]={}))[M]=K.markedSpans),++M})}function vl(e){if(!e)return null;for(var t,r=0;r-1&&(ke(J)[me]=te[me],delete te[me]))}}return n}function Pa(e,t,r,n){if(n){var d=e.anchor;if(r){var M=It(t,d)<0;M!=It(r,d)<0?(d=t,t=r):M!=It(t,r)<0&&(t=r)}return new Yt(d,t)}else return new Yt(r||t,t)}function Qr(e,t,r,n,d){d==null&&(d=e.cm&&(e.cm.display.shift||e.extend)),Oi(e,new Xi([Pa(e.sel.primary(),t,r,d)],0),n)}function Bs(e,t,r){for(var n=[],d=e.cm&&(e.cm.display.shift||e.extend),M=0;M=t.ch:J.to>t.ch))){if(d&&(De(Q,"beforeCursorEnter"),Q.explicitlyCleared))if(M.markedSpans){--K;continue}else break;if(!Q.atomic)continue;if(r){var me=Q.find(n<0?1:-1),Ce=void 0;if((n<0?de:te)&&(me=zs(e,me,-n,me&&me.line==t.line?M:null)),me&&me.line==t.line&&(Ce=It(me,r))&&(n<0?Ce<0:Ce>0))return tr(e,me,t,n,d)}var we=Q.find(n<0?-1:1);return(n<0?te:de)&&(we=zs(e,we,n,we.line==t.line?M:null)),we?tr(e,we,t,n,d):null}}return t}function ea(e,t,r,n,d){var M=n||1,K=tr(e,t,r,M,d)||!d&&tr(e,t,r,M,!0)||tr(e,t,r,-M,d)||!d&&tr(e,t,r,-M,!0);return K||(e.cantEdit=!0,Ye(e.first,0))}function zs(e,t,r,n){return r<0&&t.ch==0?t.line>e.first?_(e,Ye(t.line-1)):null:r>0&&t.ch==(n||ut(e,t.line)).text.length?t.line=0;--d)Ys(e,{from:n[d].from,to:n[d].to,text:d?[""]:t.text,origin:t.origin});else Ys(e,t)}function Ys(e,t){if(t.text.length==1&&t.text[0]==""&&It(t.from,t.to)==0)return;var r=Ia(e,t);Ns(e,t,r,e.cm?e.cm.curOp.id:NaN),Ar(e,t,r,Qi(e,t));var n=[];Rn(e,function(d,M){!M&&ae(n,d.history)==-1&&(Qs(d.history,t),n.push(d.history)),Ar(d,t,null,Qi(d,t))})}function ta(e,t,r){var n=e.cm&&e.cm.state.suppressEdits;if(n&&!r)return;for(var d=e.history,M,K=e.sel,J=t=="undo"?d.done:d.undone,Q=t=="undo"?d.undone:d.done,te=0;te=0;--we){var Be=Ce(we);if(Be)return Be.v}}function $s(e,t){if(t==0)return;if(e.first+=t,e.sel=new Xi(et(e.sel.ranges,function(d){return new Yt(Ye(d.anchor.line+t,d.anchor.ch),Ye(d.head.line+t,d.head.ch))}),e.sel.primIndex),e.cm){Ni(e.cm,e.first,e.first-t,t);for(var r=e.cm.display,n=r.viewFrom;ne.lastLine())return;if(t.from.lineM&&(t={from:t.from,to:Ye(M,ut(e,M).text.length),text:[t.text[0]],origin:t.origin}),t.removed=qt(e,t.from,t.to),r||(r=Ia(e,t)),e.cm?_l(e.cm,t,n):ka(e,t,n),qr(e,r,Ee),e.cantEdit&&ea(e,Ye(e.firstLine(),0))&&(e.cantEdit=!1)}function _l(e,t,r){var n=e.doc,d=e.display,M=t.from,K=t.to,J=!1,Q=M.line;e.options.lineWrapping||(Q=Dt(Ii(ut(n,M.line))),n.iter(Q,K.line+1,function(we){if(we==d.maxLine)return J=!0,!0})),n.sel.contains(t.from,t.to)>-1&&ve(e),ka(n,t,r,cs(e)),e.options.lineWrapping||(n.iter(Q,M.line+t.text.length,function(we){var Be=pr(we);Be>d.maxLineLength&&(d.maxLine=we,d.maxLineLength=Be,d.maxLineChanged=!0,J=!1)}),J&&(e.curOp.updateMaxLine=!0)),Zi(n,M.line),wr(e,400);var te=t.text.length-(K.line-M.line)-1;t.full?Ni(e):M.line==K.line&&t.text.length==1&&!Ds(e.doc,t)?wn(e,M.line,"text"):Ni(e,M.line,K.line+1,te);var de=ce(e,"changes"),me=ce(e,"change");if(me||de){var Ce={from:M,to:K,text:t.text,removed:t.removed,origin:t.origin};me&&wi(e,"change",e,Ce),de&&(e.curOp.changeObjs||(e.curOp.changeObjs=[])).push(Ce)}e.display.selForContextMenu=null}function nr(e,t,r,n,d){var M;n||(n=r),It(n,r)<0&&(M=[n,r],r=M[0],n=M[1]),typeof t=="string"&&(t=e.splitLines(t)),ir(e,{from:r,to:n,text:t,origin:d})}function Js(e,t,r,n){r1||!(this.children[0]instanceof Or))){var J=[];this.collapse(J),this.children=[new Or(J)],this.children[0].parent=this}},collapse:function(e){for(var t=0;t50){for(var K=d.lines.length%25+25,J=K;J10);e.parent.maybeSpill()},iterN:function(e,t,r){for(var n=0;ne.display.maxLineLength&&(e.display.maxLine=te,e.display.maxLineLength=de,e.display.maxLineChanged=!0)}n!=null&&e&&this.collapsed&&Ni(e,n,d+1),this.lines.length=0,this.explicitlyCleared=!0,this.atomic&&this.doc.cantEdit&&(this.doc.cantEdit=!1,e&&Gs(e.doc)),e&&wi(e,"markerCleared",e,this,n,d),t&&Wn(e),this.parent&&this.parent.clear()},On.prototype.find=function(e,t){e==null&&this.type=="bookmark"&&(e=1);for(var r,n,d=0;d0||K==0&&M.clearWhenEmpty!==!1)return M;if(M.replacedWith&&(M.collapsed=!0,M.widgetNode=w("span",[M.replacedWith],"CodeMirror-widget"),n.handleMouseEvents||M.widgetNode.setAttribute("cm-ignore-events","true"),n.insertLeft&&(M.widgetNode.insertLeft=!0)),M.collapsed){if(yi(e,t.line,t,r,M)||t.line!=r.line&&yi(e,r.line,t,r,M))throw new Error("Inserting collapsed marker partially overlapping an existing one");un()}M.addToHistory&&Ns(e,{from:t,to:r,origin:"markText"},e.sel,NaN);var J=t.line,Q=e.cm,te;if(e.iter(J,r.line+1,function(me){Q&&M.collapsed&&!Q.options.lineWrapping&&Ii(me)==Q.display.maxLine&&(te=!0),M.collapsed&&J!=t.line&&Mt(me,0),bn(me,new hn(M,J==t.line?t.ch:null,J==r.line?r.ch:null)),++J}),M.collapsed&&e.iter(t.line,r.line+1,function(me){an(e,me)&&Mt(me,0)}),M.clearOnEnter&&Ie(M,"beforeCursorEnter",function(){return M.clear()}),M.readOnly&&(zi(),(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)Ni(Q,t.line,r.line+1);else if(M.className||M.startStyle||M.endStyle||M.css||M.attributes||M.title)for(var de=t.line;de<=r.line;de++)wn(Q,de,"text");M.atomic&&Gs(Q.doc),wi(Q,"markerAdded",Q,M)}return M}var Dr=function(e,t){this.markers=e,this.primary=t;for(var r=0;r=0;Q--)ir(this,n[Q]);J?Hs(this,J):this.cm&&Qn(this.cm)}),undo:_i(function(){ta(this,"undo")}),redo:_i(function(){ta(this,"redo")}),undoSelection:_i(function(){ta(this,"undo",!0)}),redoSelection:_i(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,r=0,n=0;n=e.ch)&&t.push(d.marker.parent||d.marker)}return t},findMarks:function(e,t,r){e=_(this,e),t=_(this,t);var n=[],d=e.line;return this.iter(e.line,t.line+1,function(M){var K=M.markedSpans;if(K)for(var J=0;J=Q.to||Q.from==null&&d!=e.line||Q.from!=null&&d==t.line&&Q.from>=t.ch)&&(!r||r(Q.marker))&&n.push(Q.marker.parent||Q.marker)}++d}),n},getAllMarks:function(){var e=[];return this.iter(function(t){var r=t.markedSpans;if(r)for(var n=0;ne)return t=e,!0;e-=M,++r}),_(this,Ye(r,t))},indexFromPos:function(e){e=_(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 de=e.dataTransfer.getData("Text");if(de){var me;if(t.state.draggingText&&!t.state.draggingText.copy&&(me=t.listSelections()),qr(t.doc,Cn(r,r)),me)for(var Ce=0;Ce=0;J--)nr(e.doc,"",n[J].from,n[J].to,"+delete");Qn(e)})}function Fa(e,t,r){var n=Se(e.text,t+r,r);return n<0||n>e.text.length?null:n}function Ua(e,t,r){var n=Fa(e,t.ch,r);return n==null?null:new Ye(t.line,n,r<0?"after":"before")}function Ba(e,t,r,n,d){if(e){t.doc.direction=="rtl"&&(d=-d);var M=Ve(r,t.doc.direction);if(M){var K=d<0?ke(M):M[0],J=d<0==(K.level==1),Q=J?"after":"before",te;if(K.level>0||t.doc.direction=="rtl"){var de=Yn(t,r);te=d<0?r.text.length-1:0;var me=on(t,de,te).top;te=Ge(function(Ce){return on(t,de,Ce).top==me},d<0==(K.level==1)?K.from:K.to-1,te),Q=="before"&&(te=Fa(r,te,1))}else te=d<0?K.to:K.from;return new Ye(n,te,Q)}}return new Ye(n,d<0?r.text.length:0,d<0?"before":"after")}function Ml(e,t,r,n){var d=Ve(t,e.doc.direction);if(!d)return Ua(t,r,n);r.ch>=t.text.length?(r.ch=t.text.length,r.sticky="before"):r.ch<=0&&(r.ch=0,r.sticky="after");var M=Ke(d,r.ch,r.sticky),K=d[M];if(e.doc.direction=="ltr"&&K.level%2==0&&(n>0?K.to>r.ch:K.from=K.from&&Ce>=de.begin)){var we=me?"before":"after";return new Ye(r.line,Ce,we)}}var Be=function(ot,ct,lt){for(var pt=function(Qt,Ei){return Ei?new Ye(r.line,J(Qt,1),"before"):new Ye(r.line,Qt,"after")};ot>=0&&ot0==(At.level!=1),Nt=Et?lt.begin:J(lt.end,-1);if(At.from<=Nt&&Nt0?de.end:J(de.begin,-1);return qe!=null&&!(n>0&&qe==t.text.length)&&(Xe=Be(n>0?0:d.length-1,n,te(qe)),Xe)?Xe:null}var Pr={selectAll:Vs,singleSelection:function(e){return e.setSelection(e.getCursor("anchor"),e.getCursor("head"),Ee)},killLine:function(e){return sr(e,function(t){if(t.empty()){var r=ut(e.doc,t.head.line).text.length;return t.head.ch==r&&t.head.line0)d=new Ye(d.line,d.ch+1),e.replaceRange(M.charAt(d.ch-1)+M.charAt(d.ch-2),Ye(d.line,d.ch-2),d,"+transpose");else if(d.line>e.doc.first){var K=ut(e.doc,d.line-1).text;K&&(d=new Ye(d.line,1),e.replaceRange(M.charAt(0)+e.doc.lineSeparator()+K.charAt(K.length-1),Ye(d.line-1,K.length-1),d,"+transpose"))}}r.push(new Yt(d,d))}e.setSelections(r)})},newlineAndIndent:function(e){return Gi(e,function(){for(var t=e.listSelections(),r=t.length-1;r>=0;r--)e.replaceRange(e.doc.lineSeparator(),t[r].anchor,t[r].head,"+input");t=e.listSelections();for(var n=0;ne&&It(t,this.pos)==0&&r==this.button};var Fr,Ur;function Hl(e,t){var r=+new Date;return Ur&&Ur.compare(r,e,t)?(Fr=Ur=null,"triple"):Fr&&Fr.compare(r,e,t)?(Ur=new Ha(r,e,t),Fr=null,"double"):(Fr=new Ha(r,e,t),Ur=null,"single")}function vo(e){var t=this,r=t.display;if(Me(t,e)||r.activeTouch&&r.input.supportsTouch())return;if(r.input.ensurePolled(),r.shift=e.shiftKey,cn(r,e)){i||(r.scroller.draggable=!1,setTimeout(function(){return r.scroller.draggable=!0},100));return}if(Wa(t,e))return;var n=Fn(t,e),d=Le(e),M=n?Hl(n,d):"single";if(window.focus(),d==1&&t.state.selectingText&&t.state.selectingText(e),n&&Wl(t,d,n,M,e))return;d==1?n?Kl(t,n,M,e):ye(e)==r.scroller&&ne(e):d==2?(n&&Qr(t.doc,n),setTimeout(function(){return r.input.focus()},20)):d==3&&(L?t.display.input.onContextMenu(e):vs(t))}function Wl(e,t,r,n,d){var M="Click";return n=="double"?M="Double"+M:n=="triple"&&(M="Triple"+M),M=(t==1?"Left":t==2?"Middle":"Right")+M,Nr(e,oo(M,d),d,function(K){if(typeof K=="string"&&(K=Pr[K]),!K)return!1;var J=!1;try{e.isReadOnly()&&(e.state.suppressEdits=!0),J=K(e,r)!=Oe}finally{e.state.suppressEdits=!1}return J})}function Gl(e,t,r){var n=e.getOption("configureMouse"),d=n?n(e,t,r):{};if(d.unit==null){var M=s?r.shiftKey&&r.metaKey:r.altKey;d.unit=M?"rectangle":t=="single"?"char":t=="double"?"word":"line"}return(d.extend==null||e.doc.extend)&&(d.extend=e.doc.extend||r.shiftKey),d.addNew==null&&(d.addNew=a?r.metaKey:r.ctrlKey),d.moveOnDrag==null&&(d.moveOnDrag=!(a?r.altKey:r.ctrlKey)),d}function Kl(e,t,r,n){G?setTimeout(N(gs,e),0):e.curOp.focus=F();var d=Gl(e,r,n),M=e.doc.sel,K;e.options.dragDrop&&Ue&&!e.isReadOnly()&&r=="single"&&(K=M.contains(t))>-1&&(It((K=M.ranges[K]).from(),t)<0||t.xRel>0)&&(It(K.to(),t)>0||t.xRel<0)?zl(e,n,t,d):Vl(e,n,t,d)}function zl(e,t,r,n){var d=e.display,M=!1,K=bi(e,function(te){i&&(d.scroller.draggable=!1),e.state.draggingText=!1,st(d.wrapper.ownerDocument,"mouseup",K),st(d.wrapper.ownerDocument,"mousemove",J),st(d.scroller,"dragstart",Q),st(d.scroller,"drop",K),M||(ne(te),n.addNew||Qr(e.doc,r,null,null,n.extend),i&&!m||G&&W==9?setTimeout(function(){d.wrapper.ownerDocument.body.focus({preventScroll:!0}),d.input.focus()},20):d.input.focus())}),J=function(te){M=M||Math.abs(t.clientX-te.clientX)+Math.abs(t.clientY-te.clientY)>=10},Q=function(){return M=!0};i&&(d.scroller.draggable=!0),e.state.draggingText=K,K.copy=!n.moveOnDrag,d.scroller.dragDrop&&d.scroller.dragDrop(),Ie(d.wrapper.ownerDocument,"mouseup",K),Ie(d.wrapper.ownerDocument,"mousemove",J),Ie(d.scroller,"dragstart",Q),Ie(d.scroller,"drop",K),vs(e),setTimeout(function(){return d.input.focus()},20)}function yo(e,t,r){if(r=="char")return new Yt(t,t);if(r=="word")return e.findWordAt(t);if(r=="line")return new Yt(Ye(t.line,0),_(e.doc,Ye(t.line+1,0)));var n=r(e,t);return new Yt(n.from,n.to)}function Vl(e,t,r,n){var d=e.display,M=e.doc;ne(t);var K,J,Q=M.sel,te=Q.ranges;if(n.addNew&&!n.extend?(J=M.sel.contains(r),J>-1?K=te[J]:K=new Yt(r,r)):(K=M.sel.primary(),J=M.sel.primIndex),n.unit=="rectangle")n.addNew||(K=new Yt(r,r)),r=Fn(e,t,!0,!0),J=-1;else{var de=yo(e,r,n.unit);n.extend?K=Pa(K,de.anchor,de.head,n.extend):K=de}n.addNew?J==-1?(J=te.length,Oi(M,tn(e,te.concat([K]),J),{scroll:!1,origin:"*mouse"})):te.length>1&&te[J].empty()&&n.unit=="char"&&!n.extend?(Oi(M,tn(e,te.slice(0,J).concat(te.slice(J+1)),0),{scroll:!1,origin:"*mouse"}),Q=M.sel):Na(M,J,K,xe):(J=0,Oi(M,new Xi([K],0),xe),Q=M.sel);var me=r;function Ce(lt){if(It(me,lt)==0)return;if(me=lt,n.unit=="rectangle"){for(var pt=[],At=e.options.tabSize,Et=Y(ut(M,r.line).text,r.ch,At),Nt=Y(ut(M,lt.line).text,lt.ch,At),Qt=Math.min(Et,Nt),Ei=Math.max(Et,Nt),ri=Math.min(r.line,lt.line),Ki=Math.min(e.lastLine(),Math.max(r.line,lt.line));ri<=Ki;ri++){var Ui=ut(M,ri).text,ci=Re(Ui,Qt,At);Qt==Ei?pt.push(new Yt(Ye(ri,ci),Ye(ri,ci))):Ui.length>ci&&pt.push(new Yt(Ye(ri,ci),Ye(ri,Re(Ui,Ei,At))))}pt.length||pt.push(new Yt(r,r)),Oi(M,tn(e,Q.ranges.slice(0,J).concat(pt),J),{origin:"*mouse",scroll:!1}),e.scrollIntoView(lt)}else{var Bi=K,Si=yo(e,lt,n.unit),gi=Bi.anchor,fi;It(Si.anchor,gi)>0?(fi=Si.head,gi=yn(Bi.from(),Si.anchor)):(fi=Si.anchor,gi=vn(Bi.to(),Si.head));var si=Q.ranges.slice(0);si[J]=Xl(e,new Yt(_(M,gi),fi)),Oi(M,tn(e,si,J),xe)}}var we=d.wrapper.getBoundingClientRect(),Be=0;function Xe(lt){var pt=++Be,At=Fn(e,lt,!0,n.unit=="rectangle");if(!At)return;if(It(At,me)!=0){e.curOp.focus=F(),Ce(At);var Et=Vr(d,M);(At.line>=Et.to||At.linewe.bottom?20:0;Nt&&setTimeout(bi(e,function(){if(Be!=pt)return;d.scroller.scrollTop+=Nt,Xe(lt)}),50)}}function qe(lt){e.state.selectingText=!1,Be=Infinity,lt&&(ne(lt),d.input.focus()),st(d.wrapper.ownerDocument,"mousemove",ot),st(d.wrapper.ownerDocument,"mouseup",ct),M.history.lastSelOrigin=null}var ot=bi(e,function(lt){lt.buttons===0||!Le(lt)?qe(lt):Xe(lt)}),ct=bi(e,qe);e.state.selectingText=ct,Ie(d.wrapper.ownerDocument,"mousemove",ot),Ie(d.wrapper.ownerDocument,"mouseup",ct)}function Xl(e,t){var r=t.anchor,n=t.head,d=ut(e.doc,r.line);if(It(r,n)==0&&r.sticky==n.sticky)return t;var M=Ve(d);if(!M)return t;var K=Ke(M,r.ch,r.sticky),J=M[K];if(J.from!=r.ch&&J.to!=r.ch)return t;var Q=K+(J.from==r.ch==(J.level!=1)?0:1);if(Q==0||Q==M.length)return t;var te;if(n.line!=r.line)te=(n.line-r.line)*(e.doc.direction=="ltr"?1:-1)>0;else{var de=Ke(M,n.ch,n.sticky),me=de-K||(n.ch-r.ch)*(J.level==1?-1:1);de==Q-1||de==Q?te=me<0:te=me>0}var Ce=M[Q+(te?-1:0)],we=te==(Ce.level==1),Be=we?Ce.from:Ce.to,Xe=we?"after":"before";return r.ch==Be&&r.sticky==Xe?t:new Yt(new Ye(r.line,Be,Xe),n)}function bo(e,t,r,n){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(Ce){return!1}if(d>=Math.floor(e.display.gutters.getBoundingClientRect().right))return!1;n&&ne(t);var K=e.display,J=K.lineDiv.getBoundingClientRect();if(M>J.bottom||!ce(e,r))return oe(t);M-=J.top-K.viewOffset;for(var Q=0;Q=d){var de=Ut(e.doc,M),me=e.display.gutterSpecs[Q];return De(e,r,e,de,me.className,t),oe(t)}}}function Wa(e,t){return bo(e,t,"gutterClick",!0)}function _o(e,t){if(cn(e.display,t)||Yl(e,t))return;if(Me(e,t,"contextmenu"))return;L||e.display.input.onContextMenu(t)}function Yl(e,t){return ce(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-"),yr(e)}var or={toString:function(){return"CodeMirror.Init"}},xo={},aa={};function $l(e){var t=e.optionHandlers;function r(n,d,M,K){e.defaults[n]=d,M&&(t[n]=K?function(J,Q,te){te!=or&&M(J,Q,te)}:M)}e.defineOption=r,e.Init=or,r("value","",function(n,d){return n.setValue(d)},!0),r("mode",null,function(n,d){n.doc.modeOption=d,Da(n)},!0),r("indentUnit",2,Da,!0),r("indentWithTabs",!1),r("smartIndent",!0),r("tabSize",4,function(n){Cr(n),yr(n),Ni(n)},!0),r("lineSeparator",null,function(n,d){if(n.doc.lineSep=d,!d)return;var M=[],K=n.doc.first;n.doc.iter(function(Q){for(var te=0;;){var de=Q.text.indexOf(d,te);if(de==-1)break;te=de+d.length,M.push(Ye(K,de))}K++});for(var J=M.length-1;J>=0;J--)nr(n.doc,d,M[J],Ye(M[J].line,M[J].ch+d.length))}),r("specialChars",/[\u0000-\u001f\u007f-\u009f\u00ad\u061c\u200b-\u200c\u200e\u200f\u2028\u2029\ufeff\ufff9-\ufffc]/g,function(n,d,M){n.state.specialChars=new RegExp(d.source+(d.test(" ")?"":"| "),"g"),M!=or&&n.refresh()}),r("specialCharPlaceholder",Zt,function(n){return n.refresh()},!0),r("electricChars",!0),r("inputStyle",h?"contenteditable":"textarea",function(){throw new Error("inputStyle can not (yet) be changed in a running editor")},!0),r("spellcheck",!1,function(n,d){return n.getInputField().spellcheck=d},!0),r("autocorrect",!1,function(n,d){return n.getInputField().autocorrect=d},!0),r("autocapitalize",!1,function(n,d){return n.getInputField().autocapitalize=d},!0),r("rtlMoveVisually",!A),r("wholeLineUpdateBefore",!0),r("theme","default",function(n){Eo(n),Sr(n)},!0),r("keyMap","default",function(n,d,M){var K=na(d),J=M!=or&&na(M);J&&J.detach&&J.detach(n,K),K.attach&&K.attach(n,J||null)}),r("extraKeys",null),r("configureMouse",null),r("lineWrapping",!1,Zl,!0),r("gutters",[],function(n,d){n.display.gutterSpecs=La(d,n.options.lineNumbers),Sr(n)},!0),r("fixedGutter",!0,function(n,d){n.display.gutters.style.left=d?_a(n.display)+"px":"0",n.refresh()},!0),r("coverGutterNextToScrollbar",!1,function(n){return qn(n)},!0),r("scrollbarStyle","native",function(n){Ts(n),qn(n),n.display.scrollbars.setScrollTop(n.doc.scrollTop),n.display.scrollbars.setScrollLeft(n.doc.scrollLeft)},!0),r("lineNumbers",!1,function(n,d){n.display.gutterSpecs=La(n.options.gutters,d),Sr(n)},!0),r("firstLineNumber",1,Sr,!0),r("lineNumberFormatter",function(n){return n},Sr,!0),r("showCursorWhenSelecting",!1,br,!0),r("resetSelectionOnContextMenu",!0),r("lineWiseCopyCut",!0),r("pasteLinesPerSelection",!0),r("selectionsMayTouch",!1),r("readOnly",!1,function(n,d){d=="nocursor"&&(Zn(n),n.display.input.blur()),n.display.input.readOnlyChanged(d)}),r("screenReaderLabel",null,function(n,d){d=d===""?null:d,n.display.input.screenReaderLabelChanged(d)}),r("disableInput",!1,function(n,d){d||n.display.input.reset()},!0),r("dragDrop",!0,Jl),r("allowDropFileTypes",null),r("cursorBlinkRate",530),r("cursorScrollMargin",0),r("cursorHeight",1,br,!0),r("singleCursorHeightPerLine",!0,br,!0),r("workTime",100),r("workDelay",100),r("flattenSpans",!0,Cr,!0),r("addModeClass",!1,Cr,!0),r("pollInterval",100),r("undoDepth",200,function(n,d){return n.doc.history.undoDepth=d}),r("historyEventDelay",1250),r("viewportMargin",10,function(n){return n.refresh()},!0),r("maxHighlightLength",1e4,Cr,!0),r("moveInputWithCursor",!0,function(n,d){d||n.display.input.resetPosition()}),r("tabindex",null,function(n,d){return n.display.input.getField().tabIndex=d||""}),r("autofocus",null),r("direction","ltr",function(n,d){return n.doc.setDirection(d)},!0),r("phrases",null)}function Jl(e,t,r){var n=r&&r!=or;if(!t!=!n){var d=e.display.dragFunctions,M=t?Ie:st;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 Zl(e){e.options.lineWrapping?(B(e.display.wrapper,"CodeMirror-wrap"),e.display.sizer.style.minWidth="",e.display.sizerWidth=null):(C(e.display.wrapper,"CodeMirror-wrap"),jr(e)),Ea(e),Ni(e),yr(e),setTimeout(function(){return qn(e)},100)}function ni(e,t){var r=this;if(!(this instanceof ni))return new ni(e,t);this.options=t=t?b(t):{},b(xo,t,!1);var n=t.value;typeof n=="string"?n=new Fi(n,t.mode,null,t.lineSeparator,t.direction):t.mode&&(n.modeOption=t.mode),this.doc=n;var d=new ni.inputStyles[t.inputStyle](this),M=this.display=new hl(e,n,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 ee,keySeq:null,specialChars:null},t.autofocus&&!h&&M.input.focus(),G&&W<11&&setTimeout(function(){return r.display.input.reset(!0)},20),Ql(this),Ol(),Hn(this),this.curOp.forceUpdate=!0,ks(this,n),t.autofocus&&!h||this.hasFocus()?setTimeout(function(){r.hasFocus()&&!r.state.focused&&Ta(r)},20):Zn(this);for(var K in aa)aa.hasOwnProperty(K)&&aa[K](this,t[K],or);Cs(this),t.finishInit&&t.finishInit(this);for(var J=0;J20*20}Ie(t.scroller,"touchstart",function(Q){if(!Me(e,Q)&&!M(Q)&&!Wa(e,Q)){t.input.ensurePolled(),clearTimeout(r);var te=+new Date;t.activeTouch={start:te,moved:!1,prev:te-n.end<=300?n:null},Q.touches.length==1&&(t.activeTouch.left=Q.touches[0].pageX,t.activeTouch.top=Q.touches[0].pageY)}}),Ie(t.scroller,"touchmove",function(){t.activeTouch&&(t.activeTouch.moved=!0)}),Ie(t.scroller,"touchend",function(Q){var te=t.activeTouch;if(te&&!cn(t,Q)&&te.left!=null&&!te.moved&&new Date-te.start<300){var de=e.coordsChar(t.activeTouch,"page"),me;!te.prev||K(te,te.prev)?me=new Yt(de,de):!te.prev.prev||K(te,te.prev.prev)?me=e.findWordAt(de):me=new Yt(Ye(de.line,0),_(e.doc,Ye(de.line+1,0))),e.setSelection(me.anchor,me.head),e.focus(),ne(Q)}d()}),Ie(t.scroller,"touchcancel",d),Ie(t.scroller,"scroll",function(){t.scroller.clientHeight&&(Er(e,t.scroller.scrollTop),Bn(e,t.scroller.scrollLeft,!0),De(e,"scroll",e))}),Ie(t.scroller,"mousewheel",function(Q){return Os(e,Q)}),Ie(t.scroller,"DOMMouseScroll",function(Q){return Os(e,Q)}),Ie(t.wrapper,"scroll",function(){return t.wrapper.scrollTop=t.wrapper.scrollLeft=0}),t.dragFunctions={enter:function(Q){Me(e,Q)||le(Q)},over:function(Q){Me(e,Q)||(Rl(e,Q),le(Q))},start:function(Q){return Al(e,Q)},drop:bi(e,Cl),leave:function(Q){Me(e,Q)||no(e)}};var J=t.input.getField();Ie(J,"keyup",function(Q){return mo.call(e,Q)}),Ie(J,"keydown",bi(e,po)),Ie(J,"keypress",bi(e,go)),Ie(J,"focus",function(Q){return Ta(e,Q)}),Ie(J,"blur",function(Q){return Zn(e,Q)})}var Ga=[];ni.defineInitHook=function(e){return Ga.push(e)};function Br(e,t,r,n){var d=e.doc,M;r==null&&(r="add"),r=="smart"&&(d.mode.indent?M=rt(e,t).state:r="prev");var K=e.options.tabSize,J=ut(d,t),Q=Y(J.text,null,K);J.stateAfter&&(J.stateAfter=null);var te=J.text.match(/^\s*/)[0],de;if(!n&&!/\S/.test(J.text))de=0,r="not";else if(r=="smart"&&(de=d.mode.indent(M,J.text.slice(te.length),J.text),de==Oe||de>150)){if(!n)return;r="prev"}r=="prev"?t>d.first?de=Y(ut(d,t-1).text,null,K):de=0:r=="add"?de=Q+e.options.indentUnit:r=="subtract"?de=Q-e.options.indentUnit:typeof r=="number"&&(de=Q+r),de=Math.max(0,de);var me="",Ce=0;if(e.options.indentWithTabs)for(var we=Math.floor(de/K);we;--we)Ce+=K,me+=" ";if(CeK,Q=xt(t),te=null;if(J&&n.ranges.length>1)if(nn&&nn.text.join(` `)==t){if(n.ranges.length%nn.text.length==0){te=[];for(var de=0;de=0;Ce--){var we=n.ranges[Ce],Be=we.from(),Xe=we.to();we.empty()&&(r&&r>0?Be=Ye(Be.line,Be.ch-r):e.state.overwrite&&!J?Xe=Ye(Xe.line,Math.min(ut(M,Xe.line).text.length,Xe.ch+ke(Q).length)):J&&nn&&nn.lineWise&&nn.text.join(` `)==Q.join(` `)&&(Be=Xe=Ye(Be.line,0)));var qe={from:Be,to:Xe,text:te?te[Ce%te.length]:Q,origin:d||(J?"paste":e.state.cutIncoming>K?"cut":"+input")};ir(e.doc,qe),wi(e,"inputRead",e,qe)}t&&!J&&wo(e,t),Qn(e),e.curOp.updateInput<2&&(e.curOp.updateInput=me),e.curOp.typing=!0,e.state.pasteIncoming=e.state.cutIncoming=-1}function To(e,t){var r=e.clipboardData&&e.clipboardData.getData("Text");if(r)return e.preventDefault(),!t.isReadOnly()&&!t.options.disableInput&&Gi(t,function(){return Ka(t,r,0,null,"paste")}),!0}function wo(e,t){if(!e.options.electricChars||!e.options.smartIndent)return;for(var r=e.doc.sel,n=r.ranges.length-1;n>=0;n--){var d=r.ranges[n];if(d.head.ch>100||n&&r.ranges[n-1].head.line==d.head.line)continue;var M=e.getModeAt(d.head),K=!1;if(M.electricChars){for(var J=0;J-1){K=Br(e,d.head.line,"smart");break}}else M.electricInput&&(M.electricInput.test(ut(e.doc,d.head.line).text.slice(0,d.head.ch))&&(K=Br(e,d.head.line,"smart")));K&&wi(e,"electricInput",e,d.head.line)}}function So(e){for(var t=[],r=[],n=0;nM&&(Br(this,J.head.line,n,!0),M=J.head.line,K==this.doc.sel.primIndex&&Qn(this));else{var Q=J.from(),te=J.to(),de=Math.max(M,Q.line);M=Math.min(this.lastLine(),te.line-(te.ch?0:1))+1;for(var me=de;me0&&Na(this.doc,K,new Yt(Q,Ce[K].to()),Ee)}}}),getTokenAt:function(n,d){return ei(this,n,d)},getLineTokens:function(n,d){return ei(this,Ye(n),d,!0)},getTokenTypeAt:function(n){n=_(this.doc,n);var d=He(this,ut(this.doc,n.line)),M=0,K=(d.length-1)/2,J=n.ch,Q;if(J==0)Q=d[2];else for(;;){var te=M+K>>1;if((te?d[te*2-1]:0)>=J)K=te;else if(d[te*2+1]Q&&(n=Q,K=!0),J=ut(this.doc,n)}else J=n;return Wr(this,J,{top:0,left:0},d||"page",M||K).top+(K?this.doc.height-qi(J):0)},defaultTextHeight:function(){return $n(this.display)},defaultCharWidth:function(){return Jn(this.display)},getViewport:function(){return{from:this.display.viewFrom,to:this.display.viewTo}},addWidget:function(n,d,M,K,J){var Q=this.display;n=en(this,_(this.doc,n));var te=n.bottom,de=n.left;if(d.style.position="absolute",d.setAttribute("cm-ignore-events","true"),this.display.input.setUneditable(d),Q.sizer.appendChild(d),K=="over")te=n.top;else if(K=="above"||K=="near"){var me=Math.max(Q.wrapper.clientHeight,this.doc.height),Ce=Math.max(Q.sizer.clientWidth,Q.lineSpace.clientWidth);(K=="above"||n.bottom+d.offsetHeight>me)&&n.top>d.offsetHeight?te=n.top-d.offsetHeight:n.bottom+d.offsetHeight<=me&&(te=n.bottom),de+d.offsetWidth>Ce&&(de=Ce-d.offsetWidth)}d.style.top=te+"px",d.style.left=d.style.right="",J=="right"?(de=Q.sizer.clientWidth-d.offsetWidth,d.style.right="0px"):(J=="left"?de=0:J=="middle"&&(de=(Q.sizer.clientWidth-d.offsetWidth)/2),d.style.left=de+"px"),M&&Jo(this,{left:de,top:te,right:de+d.offsetWidth,bottom:te+d.offsetHeight})},triggerOnKeyDown:Di(po),triggerOnKeyPress:Di(go),triggerOnKeyUp:mo,triggerOnMouseDown:Di(vo),execCommand:function(n){if(Pr.hasOwnProperty(n))return Pr[n].call(null,this)},triggerElectric:Di(function(n){wo(this,n)}),findPosH:function(n,d,M,K){var J=1;d<0&&(J=-1,d=-d);for(var Q=_(this.doc,n),te=0;te0&&de(M.charAt(K-1));)--K;for(;J.5||this.options.lineWrapping)&&Ea(this),De(this,"refresh",this)}),swapDoc:Di(function(n){var d=this.doc;return d.cm=null,this.state.selectingText&&this.state.selectingText(),ks(this,n),yr(this),this.display.input.reset(),_r(this,n.scrollLeft,n.scrollTop),this.curOp.forceScroll=!0,wi(this,"swapDoc",this,d),d}),phrase:function(n){var d=this.options.phrases;return d&&Object.prototype.hasOwnProperty.call(d,n)?d[n]:n},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}},fe(e),e.registerHelper=function(n,d,M){r.hasOwnProperty(n)||(r[n]=e[n]={_global:[]}),r[n][d]=M},e.registerGlobalHelper=function(n,d,M,K){e.registerHelper(n,d,K),r[n]._global.push({pred:M,val:K})}}function za(e,t,r,n,d){var M=t,K=r,J=ut(e,t.line),Q=d&&e.direction=="rtl"?-r:r;function te(){var ct=t.line+Q;return ct=e.first+e.size?!1:(t=new Ye(ct,t.ch,t.sticky),J=ut(e,ct))}function de(ct){var lt;if(n=="codepoint"){var pt=J.text.charCodeAt(t.ch+(n>0?0:-1));isNaN(pt)?lt=null:lt=new Ye(t.line,Math.max(0,Math.min(J.text.length,t.ch+r*(pt>=55296&&pt<56320?2:1))),-r)}else d?lt=Ml(e.cm,J,t,r):lt=Ua(J,t,r);if(lt==null)if(!ct&&te())t=Ba(d,e.cm,J,t.line,Q);else return!1;else t=lt;return!0}if(n=="char"||n=="codepoint")de();else if(n=="column")de(!0);else if(n=="word"||n=="group")for(var me=null,Ce=n=="group",we=e.cm&&e.cm.getHelper(t,"wordChars"),Be=!0;!(r<0&&!de(!Be));Be=!1){var Xe=J.text.charAt(t.ch)||` `,qe=$e(Xe,we)?"w":Ce&&Xe==` `?"n":!Ce||/\s/.test(Xe)?null:"p";if(Ce&&!Be&&!qe&&(qe="s"),me&&me!=qe){r<0&&(r=1,de(),t.sticky="after");break}if(qe&&(me=qe),r>0&&!de(!Be))break}var ot=ea(e,t,M,K,!0);return mn(M,ot)&&(ot.hitSide=!0),ot}function Ro(e,t,r,n){var d=e.doc,M=t.left,K;if(n=="page"){var J=Math.min(e.display.wrapper.clientHeight,window.innerHeight||document.documentElement.clientHeight),Q=Math.max(J-.5*$n(e.display),3);K=(r>0?t.bottom:t.top)+r*Q}else n=="line"&&(K=r>0?t.bottom+3:t.top-3);for(var te;!(te=va(e,M,K),!te.outside);){if(r<0?K<=0:K>=d.height){te.hitSide=!0;break}K+=r*5}return te}var Jt=function(e){this.cm=e,this.lastAnchorNode=this.lastAnchorOffset=this.lastFocusNode=this.lastFocusOffset=null,this.polling=new ee,this.composing=null,this.gracePeriod=!1,this.readDOMTimeout=null};Jt.prototype.init=function(e){var t=this,r=this,n=r.cm,d=r.div=e.lineDiv;Co(d,n.options.spellcheck,n.options.autocorrect,n.options.autocapitalize);function M(J){for(var Q=J.target;Q;Q=Q.parentNode){if(Q==d)return!0;if(/\bCodeMirror-(?:line)?widget\b/.test(Q.className))break}return!1}Ie(d,"paste",function(J){if(!M(J)||Me(n,J)||To(J,n))return;W<=11&&setTimeout(bi(n,function(){return t.updateFromDOM()}),20)}),Ie(d,"compositionstart",function(J){t.composing={data:J.data,done:!1}}),Ie(d,"compositionupdate",function(J){t.composing||(t.composing={data:J.data,done:!1})}),Ie(d,"compositionend",function(J){t.composing&&(J.data!=t.composing.data&&t.readFromDOMSoon(),t.composing.done=!0)}),Ie(d,"touchstart",function(){return r.forceCompositionEnd()}),Ie(d,"input",function(){t.composing||t.readFromDOMSoon()});function K(J){if(!M(J)||Me(n,J))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()}),J.type=="cut"&&n.replaceSelection("",null,"cut");else if(n.options.lineWiseCopyCut){var Q=So(n);sa({lineWise:!0,text:Q.text}),J.type=="cut"&&n.operation(function(){n.setSelections(Q.ranges,0,Ee),n.replaceSelection("",null,"cut")})}else return;if(J.clipboardData){J.clipboardData.clearData();var te=nn.text.join(` `);if(J.clipboardData.setData("Text",te),J.clipboardData.getData("Text")==te){J.preventDefault();return}}var de=Ao(),me=de.firstChild;n.display.lineSpace.insertBefore(de,n.display.lineSpace.firstChild),me.value=nn.text.join(` `);var Ce=document.activeElement;j(me),setTimeout(function(){n.display.lineSpace.removeChild(de),Ce.focus(),Ce==d&&r.showPrimarySelection()},50)}Ie(d,"copy",K),Ie(d,"cut",K)},Jt.prototype.screenReaderLabelChanged=function(e){e?this.div.setAttribute("aria-label",e):this.div.removeAttribute("aria-label")},Jt.prototype.prepareSelection=function(){var e=ps(this.cm,!1);return e.focus=document.activeElement==this.div,e},Jt.prototype.showSelection=function(e,t){if(!e||!this.cm.display.view.length)return;(e.focus||t)&&this.showPrimarySelection(),this.showMultipleSelections(e)},Jt.prototype.getSelection=function(){return this.cm.display.wrapper.ownerDocument.getSelection()},Jt.prototype.showPrimarySelection=function(){var e=this.getSelection(),t=this.cm,r=t.doc.sel.primary(),n=r.from(),d=r.to();if(t.display.viewTo==t.display.viewFrom||n.line>=t.display.viewTo||d.line=t.display.viewFrom&&Oo(t,n)||{node:J[0].measure.map[2],offset:0},te=d.linee.firstLine()&&(n=Ye(n.line-1,ut(e.doc,n.line-1).length)),d.ch==ut(e.doc,d.line).text.length&&d.linet.viewTo-1)return!1;var M,K,J;n.line==t.viewFrom||(M=Un(e,n.line))==0?(K=Dt(t.view[0].line),J=t.view[0].node):(K=Dt(t.view[M].line),J=t.view[M-1].node.nextSibling);var Q=Un(e,d.line),te,de;if(Q==t.view.length-1?(te=t.viewTo-1,de=t.lineDiv.lastChild):(te=Dt(t.view[Q+1].line)-1,de=t.view[Q+1].node.previousSibling),!J)return!1;for(var me=e.doc.splitLines(tu(e,J,de,K,te)),Ce=qt(e.doc,Ye(K,0),Ye(te,ut(e.doc,te).text.length));me.length>1&&Ce.length>1;)if(ke(me)==ke(Ce))me.pop(),Ce.pop(),te--;else if(me[0]==Ce[0])me.shift(),Ce.shift(),K++;else break;for(var we=0,Be=0,Xe=me[0],qe=Ce[0],ot=Math.min(Xe.length,qe.length);wen.ch&&ct.charCodeAt(ct.length-Be-1)==lt.charCodeAt(lt.length-Be-1);)we--,Be++;me[me.length-1]=ct.slice(0,ct.length-Be).replace(/^\u200b+/,""),me[0]=me[0].slice(we).replace(/\u200b+$/,"");var At=Ye(K,we),Et=Ye(te,Ce.length?ke(Ce).length-Be:0);if(me.length>1||me[0]||It(At,Et))return nr(e.doc,me,At,Et,"+input"),!0},Jt.prototype.ensurePolled=function(){this.forceCompositionEnd()},Jt.prototype.reset=function(){this.forceCompositionEnd()},Jt.prototype.forceCompositionEnd=function(){if(!this.composing)return;clearTimeout(this.readDOMTimeout),this.composing=null,this.updateFromDOM(),this.div.blur(),this.div.focus()},Jt.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)},Jt.prototype.updateFromDOM=function(){var e=this;(this.cm.isReadOnly()||!this.pollContent())&&Gi(this.cm,function(){return Ni(e.cm)})},Jt.prototype.setUneditable=function(e){e.contentEditable="false"},Jt.prototype.onKeyPress=function(e){if(e.charCode==0||this.composing)return;e.preventDefault(),this.cm.isReadOnly()||bi(this.cm,Ka)(this.cm,String.fromCharCode(e.charCode==null?e.keyCode:e.charCode),0)},Jt.prototype.readOnlyChanged=function(e){this.div.contentEditable=String(e!="nocursor")},Jt.prototype.onContextMenu=function(){},Jt.prototype.resetPosition=function(){},Jt.prototype.needsContentAttribute=!0;function Oo(e,t){var r=fa(e,t.line);if(!r||r.hidden)return null;var n=ut(e.doc,t.line),d=es(r,n,t.line),M=Ve(n,e.doc.direction),K="left";if(M){var J=Ke(M,t.ch);K=J%2?"right":"left"}var Q=ns(d.map,t.ch,K);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 lr(e,t){return t&&(e.bad=!0),e}function tu(e,t,r,n,d){var M="",K=!1,J=e.doc.lineSeparator(),Q=!1;function te(we){return function(Be){return Be.id==we}}function de(){K&&(M+=J,Q&&(M+=J),K=Q=!1)}function me(we){we&&(de(),M+=we)}function Ce(we){if(we.nodeType==1){var Be=we.getAttribute("cm-text");if(Be){me(Be);return}var Xe=we.getAttribute("cm-marker"),qe;if(Xe){var ot=e.findMarks(Ye(n,0),Ye(d+1,0),te(+Xe));ot.length&&(qe=ot[0].find(0))&&me(qt(e.doc,qe.from,qe.to).join(J));return}if(we.getAttribute("contenteditable")=="false")return;var ct=/^(pre|div|p|li|table|br)$/i.test(we.nodeName);if(!/^br$/i.test(we.nodeName)&&we.textContent.length==0)return;ct&&de();for(var lt=0;lt=9&&t.hasSelection&&(t.hasSelection=null),r.poll()}),Ie(d,"paste",function(K){if(Me(n,K)||To(K,n))return;n.state.pasteIncoming=+new Date,r.fastPoll()});function M(K){if(Me(n,K))return;if(n.somethingSelected())sa({lineWise:!1,text:n.getSelections()});else if(n.options.lineWiseCopyCut){var J=So(n);sa({lineWise:!0,text:J.text}),K.type=="cut"?n.setSelections(J.ranges,null,Ee):(r.prevInput="",d.value=J.text.join(` `),j(d))}else return;K.type=="cut"&&(n.state.cutIncoming=+new Date)}Ie(d,"cut",M),Ie(d,"copy",M),Ie(e.scroller,"paste",function(K){if(cn(e,K)||Me(n,K))return;if(!d.dispatchEvent){n.state.pasteIncoming=+new Date,r.focus();return}var J=new Event("paste");J.clipboardData=K.clipboardData,d.dispatchEvent(J)}),Ie(e.lineSpace,"selectstart",function(K){cn(e,K)||ne(K)}),Ie(d,"compositionstart",function(){var K=n.getCursor("from");r.composing&&r.composing.range.clear(),r.composing={start:K,range:n.markText(K,n.getCursor("to"),{className:"CodeMirror-composing"})}}),Ie(d,"compositionend",function(){r.composing&&(r.poll(),r.composing.range.clear(),r.composing=null)})},li.prototype.createField=function(e){this.wrapper=Ao(),this.textarea=this.wrapper.firstChild},li.prototype.screenReaderLabelChanged=function(e){e?this.textarea.setAttribute("aria-label",e):this.textarea.removeAttribute("aria-label")},li.prototype.prepareSelection=function(){var e=this.cm,t=e.display,r=e.doc,n=ps(e);if(e.options.moveInputWithCursor){var d=en(e,r.sel.primary().head,"div"),M=t.wrapper.getBoundingClientRect(),K=t.lineDiv.getBoundingClientRect();n.teTop=Math.max(0,Math.min(t.wrapper.clientHeight-10,d.top+K.top-M.top)),n.teLeft=Math.max(0,Math.min(t.wrapper.clientWidth-10,d.left+K.left-M.left))}return n},li.prototype.showSelection=function(e){var t=this.cm,r=t.display;x(r.cursorDiv,e.cursors),x(r.selectionDiv,e.selection),e.teTop!=null&&(this.wrapper.style.top=e.teTop+"px",this.wrapper.style.left=e.teLeft+"px")},li.prototype.reset=function(e){if(this.contextMenuPending||this.composing)return;var t=this.cm;if(t.somethingSelected()){this.prevInput="";var r=t.getSelection();this.textarea.value=r,t.state.focused&&j(this.textarea),G&&W>=9&&(this.hasSelection=r)}else e||(this.prevInput=this.textarea.value="",G&&W>=9&&(this.hasSelection=null))},li.prototype.getField=function(){return this.textarea},li.prototype.supportsTouch=function(){return!1},li.prototype.focus=function(){if(this.cm.options.readOnly!="nocursor"&&(!h||F()!=this.textarea))try{this.textarea.focus()}catch(e){}},li.prototype.blur=function(){this.textarea.blur()},li.prototype.resetPosition=function(){this.wrapper.style.top=this.wrapper.style.left=0},li.prototype.receivedFocus=function(){this.slowPoll()},li.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()})},li.prototype.fastPoll=function(){var e=!1,t=this;t.pollingFast=!0;function r(){var n=t.poll();!n&&!e?(e=!0,t.polling.set(60,r)):(t.pollingFast=!1,t.slowPoll())}t.polling.set(20,r)},li.prototype.poll=function(){var e=this,t=this.cm,r=this.textarea,n=this.prevInput;if(this.contextMenuPending||!t.state.focused||Qe(r)&&!n&&!this.composing||t.isReadOnly()||t.options.disableInput||t.state.keySeq)return!1;var d=r.value;if(d==n&&!t.somethingSelected())return!1;if(G&&W>=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&&!n&&(n="\u200B"),M==8666)return this.reset(),this.cm.execCommand("undo")}for(var K=0,J=Math.min(n.length,d.length);K1e3||d.indexOf(` `)>-1?r.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},li.prototype.ensurePolled=function(){this.pollingFast&&this.poll()&&(this.pollingFast=!1)},li.prototype.onKeyPress=function(){G&&W>=9&&(this.hasSelection=null),this.fastPoll()},li.prototype.onContextMenu=function(e){var t=this,r=t.cm,n=r.display,d=t.textarea;t.contextMenuPending&&t.contextMenuPending();var M=Fn(r,e),K=n.scroller.scrollTop;if(!M||p)return;var J=r.options.resetSelectionOnContextMenu;J&&r.doc.sel.contains(M)==-1&&bi(r,Oi)(r.doc,Cn(M),Ee);var Q=d.style.cssText,te=t.wrapper.style.cssText,de=t.wrapper.offsetParent.getBoundingClientRect();t.wrapper.style.cssText="position: static",d.style.cssText=`position: absolute; width: 30px; height: 30px; top: `+(e.clientY-de.top-5)+"px; left: "+(e.clientX-de.left-5)+`px; z-index: 1000; background: `+(G?"rgba(255, 255, 255, .05)":"transparent")+`; outline: none; border-width: 0; outline: none; overflow: hidden; opacity: .05; filter: alpha(opacity=5);`;var me;i&&(me=window.scrollY),n.input.focus(),i&&window.scrollTo(null,me),n.input.reset(),r.somethingSelected()||(d.value=t.prevInput=" "),t.contextMenuPending=we,n.selForContextMenu=r.doc.sel,clearTimeout(n.detectingSelectAll);function Ce(){if(d.selectionStart!=null){var Xe=r.somethingSelected(),qe="\u200B"+(Xe?d.value:"");d.value="\u21DA",d.value=qe,t.prevInput=Xe?"":"\u200B",d.selectionStart=1,d.selectionEnd=qe.length,n.selForContextMenu=r.doc.sel}}function we(){if(t.contextMenuPending!=we)return;if(t.contextMenuPending=!1,t.wrapper.style.cssText=te,d.style.cssText=Q,G&&W<9&&n.scrollbars.setScrollTop(n.scroller.scrollTop=K),d.selectionStart!=null){(!G||G&&W<9)&&Ce();var Xe=0,qe=function(){n.selForContextMenu==r.doc.sel&&d.selectionStart==0&&d.selectionEnd>0&&t.prevInput=="\u200B"?bi(r,Vs)(r):Xe++<10?n.detectingSelectAll=setTimeout(qe,500):(n.selForContextMenu=null,n.input.reset())};n.detectingSelectAll=setTimeout(qe,200)}}if(G&&W>=9&&Ce(),L){le(e);var Be=function(){st(window,"mouseup",Be),setTimeout(we,20)};Ie(window,"mouseup",Be)}else setTimeout(we,50)},li.prototype.readOnlyChanged=function(e){e||this.reset(),this.textarea.disabled=e=="nocursor",this.textarea.readOnly=!!e},li.prototype.setUneditable=function(){},li.prototype.needsContentAttribute=!1;function nu(e,t){if(t=t?b(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 r=F();t.autofocus=r==e||e.getAttribute("autofocus")!=null&&r==document.body}function n(){e.value=J.getValue()}var d;if(e.form&&(Ie(e.form,"submit",n),!t.leaveSubmitMethodAlone)){var M=e.form;d=M.submit;try{var K=M.submit=function(){n(),M.submit=d,M.submit(),M.submit=K}}catch(Q){}}t.finishInit=function(Q){Q.save=n,Q.getTextArea=function(){return e},Q.toTextArea=function(){Q.toTextArea=isNaN,n(),e.parentNode.removeChild(Q.getWrapperElement()),e.style.display="",e.form&&(st(e.form,"submit",n),!t.leaveSubmitMethodAlone&&typeof e.form.submit=="function"&&(e.form.submit=d))}},e.style.display="none";var J=ni(function(Q){return e.parentNode.insertBefore(Q,e.nextSibling)},t);return J}function ru(e){e.off=st,e.on=Ie,e.wheelEventPixels=dl,e.Doc=Fi,e.splitLines=xt,e.countColumn=Y,e.findColumn=Re,e.isWordChar=je,e.Pass=Oe,e.signal=De,e.Line=Mn,e.changeEnd=An,e.scrollbarModel=xs,e.Pos=Ye,e.cmpPos=It,e.modes=Pt,e.mimeModes=Rt,e.resolveMode=bt,e.getMode=ti,e.modeExtensions=_t,e.extendMode=Tt,e.copyState=Wt,e.startState=ui,e.innerMode=ii,e.commands=Pr,e.keyMap=fn,e.keyName=lo,e.isModifierKey=so,e.lookupKey=ar,e.normalizeKeyMap=kl,e.StringStream=dt,e.SharedTextMarker=Dr,e.TextMarker=On,e.LineWidget=Ir,e.e_preventDefault=ne,e.e_stopPropagation=ie,e.e_stop=le,e.addClass=B,e.contains=y,e.rmClass=C,e.keyNames=Ln}$l(ni),ql(ni);var au="iter insert remove copy getEditor constructor".split(" ");for(var la in Fi.prototype)Fi.prototype.hasOwnProperty(la)&&ae(au,la)<0&&(ni.prototype[la]=function(e){return function(){return e.apply(this.doc,arguments)}}(Fi.prototype[la]));return fe(Fi),ni.inputStyles={textarea:li,contenteditable:Jt},ni.defineMode=function(e){!ni.defaults.mode&&e!="null"&&(ni.defaults.mode=e),pi.apply(this,arguments)},ni.defineMIME=ai,ni.defineMode("null",function(){return{token:function(e){return e.skipToEnd()}}}),ni.defineMIME("text/plain","null"),ni.defineExtension=function(e,t){ni.prototype[e]=t},ni.defineDocExtension=function(e,t){Fi.prototype[e]=t},ni.fromTextArea=nu,ru(ni),ni.version="5.58.2",ni})},Y1PL:function(ht,be,Z){"use strict";Z.r(be),Z.d(be,"ResizableTextArea",function(){return ae});var re=Z("wx14"),$=Z("1OyB"),P=Z("vuIU"),X=Z("Ji7U"),U=Z("LK+K"),k=Z("q1tI"),G=Z("VTBJ"),W=Z("rePB"),i=Z("Zm9Q"),D=Z("Kwbf"),g=Z("c+Xe"),p=Z("m+aA"),m=Z("bdgK"),u=new Map;function o(Ee){Ee.forEach(function(xe){var Ae,Re=xe.target;(Ae=u.get(Re))===null||Ae===void 0||Ae.forEach(function(pe){return pe(Re)})})}var f=new m.default(o),l=null,h=null;function a(Ee,xe){u.has(Ee)||(u.set(Ee,new Set),f.observe(Ee)),u.get(Ee).add(xe)}function s(Ee,xe){u.has(Ee)&&(u.get(Ee).delete(xe),u.get(Ee).size||(f.unobserve(Ee),u.delete(Ee)))}var A=function(Ee){Object(X.a)(Ae,Ee);var xe=Object(U.a)(Ae);function Ae(){return Object($.a)(this,Ae),xe.apply(this,arguments)}return Object(P.a)(Ae,[{key:"render",value:function(){return this.props.children}}]),Ae}(k.Component),E=k.createContext(null);function S(Ee){var xe=Ee.children,Ae=Ee.onBatchResize,Re=k.useRef(0),pe=k.useRef([]),he=k.useContext(E),ke=k.useCallback(function(et,We,it){Re.current+=1;var at=Re.current;pe.current.push({size:et,element:We,data:it}),Promise.resolve().then(function(){at===Re.current&&(Ae==null||Ae(pe.current),pe.current=[])}),he==null||he(et,We,it)},[Ae,he]);return k.createElement(E.Provider,{value:ke},xe)}function L(Ee){var xe=Ee.children,Ae=Ee.disabled,Re=k.useRef(null),pe=k.useRef(null),he=k.useContext(E),ke=k.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),et=k.isValidElement(xe)&&Object(g.c)(xe),We=et?xe.ref:null,it=k.useMemo(function(){return Object(g.a)(We,Re)},[We,Re]),at=k.useRef(Ee);at.current=Ee;var Pe=k.useCallback(function(je){var $e=at.current,se=$e.onResize,_e=$e.data,Te=je.getBoundingClientRect(),Se=Te.width,Ge=Te.height,Ne=je.offsetWidth,Fe=je.offsetHeight,Ke=Math.floor(Se),Je=Math.floor(Ge);if(ke.current.width!==Ke||ke.current.height!==Je||ke.current.offsetWidth!==Ne||ke.current.offsetHeight!==Fe){var Ve={width:Ke,height:Je,offsetWidth:Ne,offsetHeight:Fe};ke.current=Ve;var tt=Ne===Math.round(Se)?Se:Ne,Ie=Fe===Math.round(Ge)?Ge:Fe,nt=Object(G.a)(Object(G.a)({},Ve),{},{offsetWidth:tt,offsetHeight:Ie});he==null||he(nt,je,_e),se&&Promise.resolve().then(function(){se(nt,je)})}},[]);return k.useEffect(function(){var je=Object(p.a)(Re.current)||Object(p.a)(pe.current);return je&&!Ae&&a(je,Pe),function(){return s(je,Pe)}},[Re.current,Ae]),k.createElement(A,{ref:pe},et?k.cloneElement(xe,{ref:it}):xe)}var O="rc-observer-key";function C(Ee){var xe=Ee.children,Ae=Object(i.a)(xe);return Ae.map(function(Re,pe){var he=(Re==null?void 0:Re.key)||"".concat(O,"-").concat(pe);return k.createElement(L,Object(re.a)({},Ee,{key:he}),Re)})}C.Collection=S;var T=C,x=Z("bT9E"),c=Z("TSYQ"),w=Z.n(c),v=` 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 `,y=["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"],F={},B;function R(Ee){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=Ee.getAttribute("id")||Ee.getAttribute("data-reactid")||Ee.getAttribute("name");if(xe&&F[Ae])return F[Ae];var Re=window.getComputedStyle(Ee),pe=Re.getPropertyValue("box-sizing")||Re.getPropertyValue("-moz-box-sizing")||Re.getPropertyValue("-webkit-box-sizing"),he=parseFloat(Re.getPropertyValue("padding-bottom"))+parseFloat(Re.getPropertyValue("padding-top")),ke=parseFloat(Re.getPropertyValue("border-bottom-width"))+parseFloat(Re.getPropertyValue("border-top-width")),et=y.map(function(it){return"".concat(it,":").concat(Re.getPropertyValue(it))}).join(";"),We={sizingStyle:et,paddingSize:he,borderSize:ke,boxSizing:pe};return xe&&Ae&&(F[Ae]=We),We}function j(Ee){var xe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Ae=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,Re=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;B||(B=document.createElement("textarea"),B.setAttribute("tab-index","-1"),B.setAttribute("aria-hidden","true"),document.body.appendChild(B)),Ee.getAttribute("wrap")?B.setAttribute("wrap",Ee.getAttribute("wrap")):B.removeAttribute("wrap");var pe=R(Ee,xe),he=pe.paddingSize,ke=pe.borderSize,et=pe.boxSizing,We=pe.sizingStyle;B.setAttribute("style","".concat(We,";").concat(v)),B.value=Ee.value||Ee.placeholder||"";var it=Number.MIN_SAFE_INTEGER,at=Number.MAX_SAFE_INTEGER,Pe=B.scrollHeight,je;if(et==="border-box"?Pe+=ke:et==="content-box"&&(Pe-=he),Ae!==null||Re!==null){B.value=" ";var $e=B.scrollHeight-he;Ae!==null&&(it=$e*Ae,et==="border-box"&&(it=it+he+ke),Pe=Math.max(it,Pe)),Re!==null&&(at=$e*Re,et==="border-box"&&(at=at+he+ke),je=Pe>at?"":"hidden",Pe=Math.min(at,Pe))}return{height:Pe,minHeight:it,maxHeight:at,overflowY:je,resize:"none"}}var N=Z("Gytx"),b=Z.n(N),Y;(function(Ee){Ee[Ee.NONE=0]="NONE",Ee[Ee.RESIZING=1]="RESIZING",Ee[Ee.RESIZED=2]="RESIZED"})(Y||(Y={}));var ee=function(Ee){Object(X.a)(Ae,Ee);var xe=Object(U.a)(Ae);function Ae(Re){var pe;return Object($.a)(this,Ae),pe=xe.call(this,Re),pe.nextFrameActionId=void 0,pe.resizeFrameId=void 0,pe.textArea=void 0,pe.saveTextArea=function(he){pe.textArea=he},pe.handleResize=function(he){var ke=pe.state.resizeStatus,et=pe.props,We=et.autoSize,it=et.onResize;if(ke!==Y.NONE)return;typeof it=="function"&&it(he),We&&pe.resizeOnNextFrame()},pe.resizeOnNextFrame=function(){cancelAnimationFrame(pe.nextFrameActionId),pe.nextFrameActionId=requestAnimationFrame(pe.resizeTextarea)},pe.resizeTextarea=function(){var he=pe.props.autoSize;if(!he||!pe.textArea)return;var ke=he.minRows,et=he.maxRows,We=j(pe.textArea,!1,ke,et);pe.setState({textareaStyles:We,resizeStatus:Y.RESIZING},function(){cancelAnimationFrame(pe.resizeFrameId),pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.RESIZED},function(){pe.resizeFrameId=requestAnimationFrame(function(){pe.setState({resizeStatus:Y.NONE}),pe.fixFirefoxAutoScroll()})})})})},pe.renderTextArea=function(){var he=pe.props,ke=he.prefixCls,et=ke===void 0?"rc-textarea":ke,We=he.autoSize,it=he.onResize,at=he.className,Pe=he.disabled,je=pe.state,$e=je.textareaStyles,se=je.resizeStatus,_e=Object(x.a)(pe.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),Te=w()(et,at,Object(W.a)({},"".concat(et,"-disabled"),Pe));"value"in _e&&(_e.value=_e.value||"");var Se=Object(G.a)(Object(G.a)(Object(G.a)({},pe.props.style),$e),se===Y.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return k.createElement(T,{onResize:pe.handleResize,disabled:!(We||it)},k.createElement("textarea",Object(re.a)({},_e,{className:Te,style:Se,ref:pe.saveTextArea})))},pe.state={textareaStyles:{},resizeStatus:Y.NONE},pe}return Object(P.a)(Ae,[{key:"componentDidUpdate",value:function(pe){(pe.value!==this.props.value||!b()(pe.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 pe=this.textArea.selectionStart,he=this.textArea.selectionEnd;this.textArea.setSelectionRange(pe,he)}}catch(ke){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Ae}(k.Component),ae=ee,ue=function(Ee){Object(X.a)(Ae,Ee);var xe=Object(U.a)(Ae);function Ae(Re){var pe;Object($.a)(this,Ae),pe=xe.call(this,Re),pe.resizableTextArea=void 0,pe.focus=function(){pe.resizableTextArea.textArea.focus()},pe.saveTextArea=function(ke){pe.resizableTextArea=ke},pe.handleChange=function(ke){var et=pe.props.onChange;pe.setValue(ke.target.value,function(){pe.resizableTextArea.resizeTextarea()}),et&&et(ke)},pe.handleKeyDown=function(ke){var et=pe.props,We=et.onPressEnter,it=et.onKeyDown;ke.keyCode===13&&We&&We(ke),it&&it(ke)};var he=typeof Re.value=="undefined"||Re.value===null?Re.defaultValue:Re.value;return pe.state={value:he},pe}return Object(P.a)(Ae,[{key:"setValue",value:function(pe,he){"value"in this.props||this.setState({value:pe},he)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return k.createElement(ae,Object(re.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(pe){return"value"in pe?{value:pe.value}:null}}]),Ae}(k.Component),Oe=be.default=ue},ZW9T:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return N});var re=Z("k1fw"),$=Z("oBTY"),P=Z("miYZ"),X=Z("tsqr"),U=Z("rAM+"),k=Z("tJVT"),G=Z("PpiC"),W=Z("q1tI"),i=Z.n(W),D=Z("bdgK"),g=Z("9og8"),p=Z("WmNS"),m=Z.n(p),u={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"]},o={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(` `)}]},l={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(` `)}]},h=Z("5VLF"),a=Z.n(h),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"]}},A=function(Y,ee){return ee.map(function(ae){return{label:ae,kind:Y.languages.CompletionItemKind.Keyword,insertText:ae}})},E=function(Y){return Object.keys(s.tables).map(function(ee){return{label:ee,kind:Y.languages.CompletionItemKind.Variable,insertText:ee}})},S=function(Y,ee){var ae=s.tables[Y];return ae?ae.map(function(ue){return{label:ue,kind:ee.languages.CompletionItemKind.Field,insertText:ue}}):[]};function L(b,Y,ee,ae,ue){var Oe=Y.getWordUntilPosition(ee),Ee={startLineNumber:ee.lineNumber,endLineNumber:ee.lineNumber,startColumn:Oe.startColumn,endColumn:Oe.endColumn},xe=ae.map(function(Ae){return{label:Ae,kind:b.languages.CompletionItemKind.Keyword,insertText:Ae,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ee}});return ue.map(function(Ae){xe.push(Object(re.a)(Object(re.a)({},Ae),{},{range:Ee}))}),xe}var O=function(b){s.languages.map(function(ue){return b.languages.registerDocumentFormattingEditProvider(ue,{provideDocumentFormattingEdits:function(Ee,xe,Ae){return Object(g.a)(m.a.mark(function Re(){var pe;return m.a.wrap(function(ke){for(;;)switch(ke.prev=ke.next){case 0:return pe=a()(Ee.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}),ke.abrupt("return",[{range:Ee.getFullModelRange(),text:pe}]);case 2:case"end":return ke.stop()}},Re)}))()}}),ue});var Y=f.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ee=l.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=o.quickKey.map(function(ue){return{label:ue.label,kind:b.languages.CompletionItemKind.Method,insertText:ue.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet}});b.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Re=Oe.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(f.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(f.quickKey.map(function(pe){return{label:pe.label,kind:b.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Re.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn};return{suggestions:Object($.a)(u.keywords.map(function(Re){return{label:Re,kind:b.languages.CompletionItemKind.Function,documentation:Re,insertText:Re,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}}))}}}),b.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Re=Oe.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(o.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(o.quickKey.map(function(pe){return{label:pe.label,kind:b.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Re.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}}),b.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(Oe,Ee){var xe=Oe.getWordUntilPosition(Ee),Ae={startLineNumber:Ee.lineNumber,endLineNumber:Ee.lineNumber,startColumn:xe.startColumn,endColumn:xe.endColumn},Re=Oe.getLineContent(Ee.lineNumber).substring(xe.startColumn-2,xe.endColumn);return{suggestions:[].concat(Object($.a)(l.keywords.map(function(pe){return{label:pe,kind:b.languages.CompletionItemKind.Function,documentation:pe,insertText:pe,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})),Object($.a)(l.quickKey.map(function(pe){return{label:pe.label,kind:b.languages.CompletionItemKind.Function,documentation:pe.content,insertText:Re.startsWith("#")?pe.content.replace(/#/,""):pe.content,insertTextRules:b.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Ae}})))}}})},C="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",T=Z("fjLI"),x=Z("LvDl"),c=Z("+ua5");function w(b){return/^\d+$/.test(b)?"".concat(b,"px"):b}function v(){}var y=!1,F={"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 B(){var b=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],Y=b;if(Array.isArray(b)){for(var ee=0;ee0||ui.target.offsetWidth>0)&&Me.current.instance.layout()}}catch(dt){Wt.e(dt)}finally{Wt.f()}}),_t.observe(De.current)),_t}function Ue(){X.b.warn(decodeURIComponent(C))}var Ze=function(){var Tt=Me.current.instance;if(Oe!=null&&Tt&&le){var Wt=Tt.getModel();Wt&&Oe!==Wt.getValue()&&(y=!0,Wt.setValue(Oe),Tt.layout(),y=!1)}};Object(W.useEffect)(function(){ce.current&&clearTimeout(ce.current),ce.current=setTimeout(function(){Ze()},500)},[Oe,le,Me.current]),Object(W.useEffect)(function(){if(tt&&Me.current&&Me.current.instance){var _t=Me.current.instance;_t.changeViewZones(function(Wt){var ii=document.createElement("div");ii.style.padding="10px 20px",ii.style.width="calc(100% - 20px)",ii.className="my-error-line-wrp",ii.innerHTML=nt,Wt.addZone({afterLineNumber:tt||11,heightInLines:3,domNode:ii})});var Tt={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}};_t.addOverlayWidget(Tt),_t.revealPositionInCenter({lineNumber:20,column:1})}},[tt,Me.current,le]);function mt(){var _t=Me.current.instance;if(_t){var Tt=_t.getSelection(),Wt=Me.current.pastePos||{},ii=new R.Range(Wt.startLineNumber||Tt.endLineNumber,Wt.startColumn||Tt.endColumn,Wt.endLineNumber||Tt.endLineNumber,Wt.endColumn||Tt.endColumn);setTimeout(function(){_t.executeEdits("",[{range:ii,text:""}])},300)}}function ft(_t){(window.navigator.platform.match("Mac")?_t.metaKey:_t.ctrlKey)&&_t.keyCode==83&&(_t.preventDefault(),Pe())}var Ct=function(){if($e&&Me.current.instance){var Tt=Me.current.instance.getContentHeight();bt(Tt0||Ge.target.offsetWidth>0)&&$e.layout()}}catch(Ne){Te.e(Ne)}finally{Te.f()}}),se.observe(pe.current)),se}Object(W.useEffect)(function(){pe.current&&Promise.all([Z.e(16),Z.e(28)]).then(Z.t.bind(null,"M/lh",7)).then(function($e){R=$e;var se=R.editor.createDiffEditor(pe.current,Object(re.a)(Object(re.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},Re),{},{wordWrap:!0}));We(se);var _e=it(se);return function(){se.dispose();var Te=se.getModel();Te&&Te.dispose(),_e.unobserve(pe.current)}})},[]),Object(W.useEffect)(function(){et&&et.setModel({original:R.editor.createModel(Oe,xe),modified:R.editor.createModel(Ee,xe)})},[Oe,Ee,xe,et]);var at=w(ee),Pe=w(ue),je={width:at,height:Pe};return i.a.createElement("div",{className:"my-diff-editor",ref:pe,style:je})}},ZpRC:function(ht,be,Z){"use strict";function re(g){return typeof g=="object"&&g!=null&&g.nodeType===1}function $(g,p){return(!p||g!=="hidden")&&g!=="visible"&&g!=="clip"}function P(g,p){if(g.clientHeightp||f>g&&l=p&&h>=m?f-g-u:l>p&&hm?l-p+o:0}var U=function(g,p){var m=window,u=p.scrollMode,o=p.block,f=p.inline,l=p.boundary,h=p.skipOverflowHiddenElements,a=typeof l=="function"?l:function($e){return $e!==l};if(!re(g))throw new TypeError("Invalid target");for(var s=document.scrollingElement||document.documentElement,A=[],E=g;re(E)&&a(E);){if((E=E.parentElement)===s){A.push(E);break}E!=null&&E===document.body&&P(E)&&!P(document.documentElement)||E!=null&&P(E,h)&&A.push(E)}for(var S=m.visualViewport?m.visualViewport.width:innerWidth,L=m.visualViewport?m.visualViewport.height:innerHeight,O=window.scrollX||pageXOffset,C=window.scrollY||pageYOffset,T=g.getBoundingClientRect(),x=T.height,c=T.width,w=T.top,v=T.right,y=T.bottom,F=T.left,B=o==="start"||o==="nearest"?w:o==="end"?y:w+x/2,R=f==="center"?F+c/2:f==="end"?v:F,j=[],N=0;N=0&&F>=0&&y<=L&&v<=S&&w>=ue&&y<=Ee&&F>=xe&&v<=Oe)return j;var Ae=getComputedStyle(b),Re=parseInt(Ae.borderLeftWidth,10),pe=parseInt(Ae.borderTopWidth,10),he=parseInt(Ae.borderRightWidth,10),ke=parseInt(Ae.borderBottomWidth,10),et=0,We=0,it="offsetWidth"in b?b.offsetWidth-b.clientWidth-Re-he:0,at="offsetHeight"in b?b.offsetHeight-b.clientHeight-pe-ke:0;if(s===b)et=o==="start"?B:o==="end"?B-L:o==="nearest"?X(C,C+L,L,pe,ke,C+B,C+B+x,x):B-L/2,We=f==="start"?R:f==="center"?R-S/2:f==="end"?R-S:X(O,O+S,S,Re,he,O+R,O+R+c,c),et=Math.max(0,et+C),We=Math.max(0,We+O);else{et=o==="start"?B-ue-pe:o==="end"?B-Ee+ke+at:o==="nearest"?X(ue,Ee,ee,pe,ke+at,B,B+x,x):B-(ue+ee/2)+at/2,We=f==="start"?R-xe-Re:f==="center"?R-(xe+ae/2)+it/2:f==="end"?R-Oe+he+it:X(xe,Oe,ae,Re,he+it,R,R+c,c);var Pe=b.scrollLeft,je=b.scrollTop;B+=je-(et=Math.max(0,Math.min(je+et,b.scrollHeight-ee+at))),R+=Pe-(We=Math.max(0,Math.min(Pe+We,b.scrollWidth-ae+it)))}j.push({el:b,top:et,left:We})}return j};function k(g){return g===Object(g)&&Object.keys(g).length!==0}function G(g,p){p===void 0&&(p="auto");var m="scrollBehavior"in document.body.style;g.forEach(function(u){var o=u.el,f=u.top,l=u.left;o.scroll&&m?o.scroll({top:f,left:l,behavior:p}):(o.scrollTop=f,o.scrollLeft=l)})}function W(g){return g===!1?{block:"end",inline:"nearest"}:k(g)?g:{block:"start",inline:"nearest"}}function i(g,p){var m=!g.ownerDocument.documentElement.contains(g);if(k(p)&&typeof p.behavior=="function")return p.behavior(m?[]:U(g,p));if(m)return;var u=W(p);return G(U(g,u),u.behavior)}var D=be.a=i},bT9E:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});var re=Z("VTBJ");function $(P,X){var U=Object(re.a)({},P);return Array.isArray(X)&&X.forEach(function(k){delete U[k]}),U}},c5Ni:function(ht,be,Z){},dejd:function(ht,be,Z){},dmUQ:function(ht,be,Z){"use strict";var re=Z("Ff2n"),$=Z("rePB"),P=Z("1OyB"),X=Z("vuIU"),U=Z("Ji7U"),k=Z("md7G"),G=Z("foSv"),W=Z("q1tI"),i=Z.n(W),D=Z("TSYQ"),g=Z.n(D),p=Z("4IlW");function m(x,c){var w=Object.keys(x);if(Object.getOwnPropertySymbols){var v=Object.getOwnPropertySymbols(x);c&&(v=v.filter(function(y){return Object.getOwnPropertyDescriptor(x,y).enumerable})),w.push.apply(w,v)}return w}function u(x){for(var c=1;c1?ae-1:0),Oe=1;Oe1?N-1:0),Y=1;Y=0)return parseInt(j.slice(j.indexOf("e-")+2),10);var N=0;return j.indexOf(".")>=0&&(N=j.length-j.indexOf(".")-1),N},y.getInputDisplayValue=function(R){var j=R||y.state,N=j.focused,b=j.inputValue,Y=j.value,ee;N?ee=b:ee=y.toPrecisionAsStep(Y),ee==null&&(ee="");var ae=y.formatWrapper(ee);return S(y.props.decimalSeparator)&&(ae=ae.toString().replace(".",y.props.decimalSeparator)),ae},y.recordCursorPosition=function(){try{y.cursorStart=y.input.selectionStart,y.cursorEnd=y.input.selectionEnd,y.currentValue=y.input.value,y.cursorBefore=y.input.value.substring(0,y.cursorStart),y.cursorAfter=y.input.value.substring(y.cursorEnd)}catch(R){}},y.restoreByAfter=function(R){if(R===void 0)return!1;var j=y.input.value,N=j.lastIndexOf(R);if(N===-1)return!1;var b=y.cursorBefore.length;return y.lastKeyCode===p.a.DELETE&&y.cursorBefore.charAt(b-1)===R[0]?(y.fixCaret(b,b),!0):N+R.length===j.length?(y.fixCaret(N,N),!0):!1},y.partRestoreByAfter=function(R){return R===void 0?!1:Array.prototype.some.call(R,function(j,N){var b=R.substring(N);return y.restoreByAfter(b)})},y.isNotCompleteNumber=function(R){return isNaN(R)||R===""||R===null||R&&R.toString().indexOf(".")===R.toString().length-1},y.stop=function(){y.autoStepTimer&&clearTimeout(y.autoStepTimer)},y.down=function(R,j,N){y.pressingUpOrDown=!0,y.step("down",R,j,N)},y.up=function(R,j,N){y.pressingUpOrDown=!0,y.step("up",R,j,N)},y.saveInput=function(R){y.input=R};var F=v.value;F===void 0&&(F=v.defaultValue),y.state={focused:v.autoFocus};var B=y.getValidValue(y.toNumber(F));return y.state=u(u({},y.state),{},{inputValue:y.toPrecisionAsStep(B),value:B}),y}return Object(X.a)(w,[{key:"componentDidMount",value:function(){this.componentDidUpdate(null)}},{key:"componentDidUpdate",value:function(y){var F=this.props,B=F.value,R=F.onChange,j=F.max,N=F.min,b=this.state.focused;if(y){if(!L(y.value,B)||!L(y.max,j)||!L(y.min,N)){var Y=b?B:this.getValidValue(B),ee;this.pressingUpOrDown?ee=Y:this.inputting?ee=this.rawInput:ee=this.toPrecisionAsStep(Y),this.setState({value:Y,inputValue:ee})}var ae="value"in this.props?B:this.state.value;"max"in this.props&&y.max!==j&&typeof ae=="number"&&ae>j&&R&&R(j),"min"in this.props&&y.min!==N&&typeof ae=="number"&&ae1&&arguments[1]!==void 0?arguments[1]:this.props.min,B=arguments.length>2&&arguments[2]!==void 0?arguments[2]:this.props.max,R=parseFloat(y);return isNaN(R)?y:(RB&&(R=B),R)}},{key:"setValue",value:function(y,F){var B=this.props.precision,R=this.isNotCompleteNumber(parseFloat(y))?null:parseFloat(y),j=this.state.value,N=j===void 0?null:j,b=this.state.inputValue,Y=b===void 0?null:b,ee=typeof R=="number"?R.toFixed(B):"".concat(R),ae=R!==N||ee!=="".concat(Y);return"value"in this.props?(Y=this.toPrecisionAsStep(this.state.value),this.setState({inputValue:Y},F)):this.setState({value:R,inputValue:this.toPrecisionAsStep(y)},F),ae&&this.props.onChange(R),R}},{key:"getMaxPrecision",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.props,R=B.precision,j=B.step;if(S(R))return R;var N=this.getPrecision(F),b=this.getPrecision(j),Y=this.getPrecision(y);return y?Math.max(Y,N+b):N+b}},{key:"getPrecisionFactor",value:function(y){var F=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1,B=this.getMaxPrecision(y,F);return Math.pow(10,B)}},{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(y){return this.props.formatter?this.props.formatter(y):y}},{key:"toPrecisionAsStep",value:function(y){if(this.isNotCompleteNumber(y)||y==="")return y;var F=Math.abs(this.getMaxPrecision(y));return isNaN(F)?y.toString():Number(y).toFixed(F)}},{key:"toNumber",value:function(y){var F=this.props.precision,B=this.state.focused,R=y&&y.length>16&&B;return this.isNotCompleteNumber(y)||R?y:S(F)?Math.round(y*Math.pow(10,F))/Math.pow(10,F):Number(y)}},{key:"upStep",value:function(y,F){var B=this.props.step,R=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),N=((R*y+R*B*F)/R).toFixed(j);return this.toNumber(N)}},{key:"downStep",value:function(y,F){var B=this.props.step,R=this.getPrecisionFactor(y,F),j=Math.abs(this.getMaxPrecision(y,F)),N=((R*y-R*B*F)/R).toFixed(j);return this.toNumber(N)}},{key:"step",value:function(y,F){var B=this,R=arguments.length>2&&arguments[2]!==void 0?arguments[2]:1,j=arguments.length>3?arguments[3]:void 0;this.stop(),F&&(F.persist(),F.preventDefault());var N=this.props;if(N.disabled)return;var b=this.getCurrentValidValue(this.state.inputValue)||0;if(this.isNotCompleteNumber(b))return;var Y=this["".concat(y,"Step")](b,R),ee=Y>N.max||YN.max?Y=N.max:Y=ue),Me=(Je||Je===0)&&(isNaN(Je)||Number(Je)<=Oe),ve=De||R||j,ce=Me||R||j,fe=g()("".concat(B,"-handler"),"".concat(B,"-handler-up"),Object($.a)({},"".concat(B,"-handler-up-disabled"),ve)),ne=g()("".concat(B,"-handler"),"".concat(B,"-handler-down"),Object($.a)({},"".concat(B,"-handler-down-disabled"),ce)),ie=N?{onTouchStart:ve?l:this.up,onTouchEnd:this.stop}:{onMouseDown:ve?l:this.up,onMouseUp:this.stop,onMouseLeave:this.stop},oe=N?{onTouchStart:ce?l:this.down,onTouchEnd:this.stop}:{onMouseDown:ce?l:this.down,onMouseUp:this.stop,onMouseLeave:this.stop};return i.a.createElement("div",{className:tt,style:Ee,title:xe,onMouseEnter:Ae,onMouseLeave:Re,onMouseOver:pe,onMouseOut:he,onFocus:function(){return null},onBlur:function(){return null}},i.a.createElement("div",{className:"".concat(B,"-handler-wrap")},i.a.createElement("span",Object.assign({unselectable:"on"},ie,{role:"button","aria-label":"Increase Value","aria-disabled":ve,className:fe}),Y||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-up-inner"),onClick:h})),i.a.createElement("span",Object.assign({unselectable:"on"},oe,{role:"button","aria-label":"Decrease Value","aria-disabled":ce,className:ne}),ee||i.a.createElement("span",{unselectable:"on",className:"".concat(B,"-handler-down-inner"),onClick:h}))),i.a.createElement("div",{className:"".concat(B,"-input-wrap")},i.a.createElement("input",Object.assign({role:"spinbutton","aria-valuemin":Oe,"aria-valuemax":ue,"aria-valuenow":Je,required:ke,type:it,placeholder:at,onPaste:Ge,onClick:et,onMouseUp:this.onMouseUp,className:"".concat(B,"-input"),tabIndex:We,autoComplete:b,onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:nt?this.onKeyDown:l,onKeyUp:nt?this.onKeyUp:l,autoFocus:Te,maxLength:_e,readOnly:j,disabled:R,max:ue,min:Oe,step:se,name:Se,title:xe,id:Pe,onChange:this.onChange,ref:this.saveInput,value:this.getFullNum(st),pattern:$e,inputMode:je,onInput:Ne},Ie))))}}]),w}(i.a.Component);O.defaultProps={focusOnUpDown:!0,useTouch:!1,prefixCls:"rc-input-number",max:E,min:-E,step:1,style:{},onChange:l,onKeyDown:l,onPressEnter:l,onFocus:l,onBlur:l,parser:a,required:!1,autoComplete:"off"};var C=O,T=be.a=C},fjLI:function(ht,be,Z){"use strict";Z.d(be,"f",function(){return m}),Z.d(be,"b",function(){return u}),Z.d(be,"a",function(){return o}),Z.d(be,"d",function(){return f}),Z.d(be,"e",function(){return l}),Z.d(be,"c",function(){return h});var re=Z("8HAY"),$=Z("Vhoy"),P=Z("MI8n"),X=Z("JYp7"),U=Z("pmY6"),k=Z("24hK"),G=Z("nnTU"),W=Z("T8No"),i=Z("Cg/j"),D=Z("t9D7"),g=function(a,s,A,E){var S=arguments.length,L=S<3?s:E===null?E=Object.getOwnPropertyDescriptor(s,A):E,O;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")L=Reflect.decorate(a,s,A,E);else for(var C=a.length-1;C>=0;C--)(O=a[C])&&(L=(S<3?O(L):S>3?O(s,A,L):O(s,A))||L);return S>3&&L&&Object.defineProperty(s,A,L),L},p=function(a,s){return function(A,E){s(A,E,a)}};function m(a){return a.command!==void 0}class u{constructor(a){this.id=u._idPool++,this._debugName=a}}u._idPool=0,u.CommandPalette=new u("CommandPalette"),u.EditorContext=new u("EditorContext"),u.SimpleEditorContext=new u("SimpleEditorContext"),u.EditorContextCopy=new u("EditorContextCopy"),u.EditorContextPeek=new u("EditorContextPeek"),u.MenubarEditMenu=new u("MenubarEditMenu"),u.MenubarCopy=new u("MenubarCopy"),u.MenubarGoMenu=new u("MenubarGoMenu"),u.MenubarSelectionMenu=new u("MenubarSelectionMenu"),u.InlineCompletionsActions=new u("InlineCompletionsActions");const o=Object(i.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===u.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(U.i)(()=>{let s=!1;for(const A of a)s=this._commands.delete(A.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,A)=>a.set(A,s)),a}appendMenuItem(a,s){return this.appendMenuItems(X.a.single({id:a,item:s}))}appendMenuItems(a){const s=new Set,A=new k.a;for(const{id:E,item:S}of a){let L=this._menuItems.get(E);L||(L=new k.a,this._menuItems.set(E,L)),A.push(L.push(S)),s.add(E)}return this._onDidChangeMenu.fire(s),Object(U.i)(()=>{if(A.size>0){for(let E of A)E();this._onDidChangeMenu.fire(s),A.clear()}})}getMenuItems(a){let s;return this._menuItems.has(a)?s=[...this._menuItems.get(a)]:s=[],a===u.CommandPalette&&this._appendImplicitItems(s),s}_appendImplicitItems(a){const s=new Set;for(const A of a)m(A)&&(s.add(A.command.id),A.alt&&s.add(A.alt.id));this._commands.forEach((A,E)=>{s.has(E)||a.push({command:A})})}};class l extends re.e{constructor(a,s,A,E){super(`submenuitem.${a.submenu.id}`,typeof a.title=="string"?a.title:a.title.value,[],"submenu");this.item=a,this._menuService=s,this._contextKeyService=A,this._options=E}get actions(){const a=[],s=this._menuService.createMenu(this.item.submenu,this._contextKeyService),A=s.getActions(this._options);s.dispose();for(const[,E]of A)E.length>0&&(a.push(...E),a.push(new re.d));return a.length&&a.pop(),a}}let h=class a{constructor(s,A,E,S,L){var O,C;if(this._commandService=L,this.id=s.id,this.label=(E==null?void 0:E.renderShortTitle)&&s.shortTitle?typeof s.shortTitle=="string"?s.shortTitle:s.shortTitle.value:typeof s.title=="string"?s.title:s.title.value,this.tooltip=(C=typeof s.tooltip=="string"?s.tooltip:(O=s.tooltip)===null||O===void 0?void 0:O.value)!==null&&C!==void 0?C:"",this.enabled=!s.precondition||S.contextMatchesRules(s.precondition),this.checked=void 0,s.toggled){const T=s.toggled.condition?s.toggled:{condition:s.toggled};this.checked=S.contextMatchesRules(T.condition),this.checked&&T.tooltip&&(this.tooltip=typeof T.tooltip=="string"?T.tooltip:T.tooltip.value),T.title&&(this.label=typeof T.title=="string"?T.title:T.title.value)}this.item=s,this.alt=A?new a(A,void 0,E,S,L):void 0,this._options=E,D.d.isThemeIcon(s.icon)&&(this.class=$.a.asClassName(s.icon))}dispose(){}run(...s){var A,E;let S=[];return((A=this._options)===null||A===void 0?void 0:A.arg)&&(S=[...S,this._options.arg]),((E=this._options)===null||E===void 0?void 0:E.shouldForwardArgs)&&(S=[...S,...s]),this._commandService.executeCommand(this.id,...S)}};h=g([p(3,W.b),p(4,G.b)],h)},ic2d:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return X});var re=Z("FWmy"),$=Z("746U");class P{constructor(){this.data=new Map}add(U,k){re.a($.l(U)),re.a($.k(k)),re.a(!this.data.has(U),"There is already an extension with this id"),this.data.set(U,k)}as(U){return this.data.get(U)||null}}const X=new P},kSUc:function(ht,be,Z){},"kaH+":function(ht,be,Z){"use strict";var re=Z("+L6B"),$=Z("2/Rp"),P=Z("tJVT"),X=Z("q1tI"),U=Z.n(X),k=Z("UZu5"),G=Z.n(k),W=Z("dhSg"),i=Z("rLCj"),D=Z("dF/Y"),g=Z("4i/N");be.a=function(){var p=Object(X.useState)(""),m=Object(P.a)(p,2),u=m[0],o=m[1],f=Object(X.useState)(0),l=Object(P.a)(f,2),h=l[0],a=l[1],s=Object(X.useRef)("");Object(X.useEffect)(function(){var T=W.a.subscribe("preview-image",function(x){o(x),document.body.style.overflow="hidden"});return T},[]),Object(X.useEffect)(function(){return document.addEventListener("keydown",A),function(){document.removeEventListener("keydown",A)}},[]),Object(X.useEffect)(function(){s.current=u},[u]);function A(T){T.keyCode==27&&s.current&&E()}function E(){document.body.style.overflow="auto",o("")}function S(){a(h+90)}var L=Object(X.useRef)(),O=Object(X.useRef)(),C=function(x){(x.nativeEvent.target===L.current||x.nativeEvent.target===O.current)&&E()};return U.a.createElement(X.Fragment,null,u?U.a.createElement("div",{className:"image-preview-container",ref:L,onClick:C},U.a.createElement("div",{className:"button-group"},U.a.createElement($.a,{onClick:S},"\u65CB\u8F6C",U.a.createElement(i.a,null)),U.a.createElement($.a,{href:u},"\u4E0B\u8F7D",U.a.createElement(D.a,null)),U.a.createElement($.a,{onClick:E},"\u5173\u95ED",U.a.createElement(g.a,null))),U.a.createElement("div",{className:"preview-wrp-group",ref:O},U.a.createElement("img",{className:"image-preview",src:u,alt:"\u9884\u89C8\u5927\u56FE",style:{transform:"rotate(".concat(h,"deg)")}}))):null)}},lZu9:function(ht,be,Z){(function(re){re(Z("VrN/"),Z("1eCo"),Z("8EBN"))})(function(re){"use strict";re.defineMode("markdown",function($,P){var X=re.getMode($,"text/html"),U=X.name=="null";function k(N){if(re.findModeByName){var b=re.findModeByName(N);b&&(N=b.mime||b.mimes[0])}var Y=re.getMode($,N);return Y.name=="null"?null:Y}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 G={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 W in G)G.hasOwnProperty(W)&&P.tokenTypeOverrides[W]&&(G[W]=P.tokenTypeOverrides[W]);var i=/^([*\-_])(?:\s*\1){2,}\s*$/,D=/^(?:[*\-+]|^[0-9]+([.)]))\s+/,g=/^\[(x| )\](?=\s)/i,p=P.allowAtxHeaderWithoutSpace?/^(#+)/:/^(#+)(?: |$)/,m=/^ {0,3}(?:\={1,}|-{2,})\s*$/,u=/^[^#!\[\]*_\\<>` "'(~:]+/,o=/^(~~~+|```+)[ \t]*([\w\/+#-]*)[^\n`]*$/,f=/^\s*\[[^\]]+?\]:.*$/,l=/[!"#$%&'()*+,\-.\/:;<=>?@\[\\\]^_`{|}~\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]/,h=" ";function a(N,b,Y){return b.f=b.inline=Y,Y(N,b)}function s(N,b,Y){return b.f=b.block=Y,Y(N,b)}function A(N){return!N||!/\S/.test(N.string)}function E(N){if(N.linkTitle=!1,N.linkHref=!1,N.linkText=!1,N.em=!1,N.strong=!1,N.strikethrough=!1,N.quote=0,N.indentedCode=!1,N.f==L){var b=U;if(!b){var Y=re.innerMode(X,N.htmlState);b=Y.mode.name=="xml"&&Y.state.tagStart===null&&!Y.state.context&&Y.state.tokenize.isInText}b&&(N.f=x,N.block=S,N.htmlState=null)}return N.trailingSpace=0,N.trailingSpaceNewLine=!1,N.prevLine=N.thisLine,N.thisLine={stream:null},null}function S(N,b){var Y=N.column()===b.indentation,ee=A(b.prevLine.stream),ae=b.indentedCode,ue=b.prevLine.hr,Oe=b.list!==!1,Ee=(b.listStack[b.listStack.length-1]||0)+3;b.indentedCode=!1;var xe=b.indentation;if(b.indentationDiff===null&&(b.indentationDiff=b.indentation,Oe)){for(b.list=null;xe=4&&(ae||b.prevLine.fencedCodeEnd||b.prevLine.header||ee))return N.skipToEnd(),b.indentedCode=!0,G.code;if(N.eatSpace())return null;if(Y&&b.indentation<=Ee&&(pe=N.match(p))&&pe[1].length<=6)return b.quote=0,b.header=pe[1].length,b.thisLine.header=!0,P.highlightFormatting&&(b.formatting="header"),b.f=b.inline,C(b);if(b.indentation<=Ee&&N.eat(">"))return b.quote=Y?1:b.quote+1,P.highlightFormatting&&(b.formatting="quote"),N.eatSpace(),C(b);if(!Re&&!b.setext&&Y&&b.indentation<=Ee&&(pe=N.match(D))){var he=pe[1]?"ol":"ul";return b.indentation=xe+N.current().length,b.list=!0,b.quote=0,b.listStack.push(b.indentation),b.em=!1,b.strong=!1,b.code=!1,b.strikethrough=!1,P.taskLists&&N.match(g,!1)&&(b.taskList=!0),b.f=b.inline,P.highlightFormatting&&(b.formatting=["list","list-"+he]),C(b)}else{if(Y&&b.indentation<=Ee&&(pe=N.match(o,!0)))return b.quote=0,b.fencedEndRE=new RegExp(pe[1]+"+ *$"),b.localMode=P.fencedCodeBlockHighlighting&&k(pe[2]||P.fencedCodeBlockDefaultMode),b.localMode&&(b.localState=re.startState(b.localMode)),b.f=b.block=O,P.highlightFormatting&&(b.formatting="code-block"),b.code=-1,C(b);if(b.setext||(!Ae||!Oe)&&!b.quote&&b.list===!1&&!b.code&&!Re&&!f.test(N.string)&&(pe=N.lookAhead(1))&&(pe=pe.match(m)))return b.setext?(b.header=b.setext,b.setext=0,N.skipToEnd(),P.highlightFormatting&&(b.formatting="header")):(b.header=pe[0].charAt(0)=="="?1:2,b.setext=b.header),b.thisLine.header=!0,b.f=b.inline,C(b);if(Re)return N.skipToEnd(),b.hr=!0,b.thisLine.hr=!0,G.hr;if(N.peek()==="[")return a(N,b,F)}return a(N,b,b.inline)}function L(N,b){var Y=X.token(N,b.htmlState);if(!U){var ee=re.innerMode(X,b.htmlState);(ee.mode.name=="xml"&&ee.state.tagStart===null&&!ee.state.context&&ee.state.tokenize.isInText||b.md_inside&&N.current().indexOf(">")>-1)&&(b.f=x,b.block=S,b.htmlState=null)}return Y}function O(N,b){var Y=b.listStack[b.listStack.length-1]||0,ee=b.indentation=N.quote?b.push(G.formatting+"-"+N.formatting[Y]+"-"+N.quote):b.push("error"))}if(N.taskOpen)return b.push("meta"),b.length?b.join(" "):null;if(N.taskClosed)return b.push("property"),b.length?b.join(" "):null;if(N.linkHref?b.push(G.linkHref,"url"):(N.strong&&b.push(G.strong),N.em&&b.push(G.em),N.strikethrough&&b.push(G.strikethrough),N.emoji&&b.push(G.emoji),N.linkText&&b.push(G.linkText),N.code&&b.push(G.code),N.image&&b.push(G.image),N.imageAltText&&b.push(G.imageAltText,"link"),N.imageMarker&&b.push(G.imageMarker)),N.header&&b.push(G.header,G.header+"-"+N.header),N.quote&&(b.push(G.quote),!P.maxBlockquoteDepth||P.maxBlockquoteDepth>=N.quote?b.push(G.quote+"-"+N.quote):b.push(G.quote+"-"+P.maxBlockquoteDepth)),N.list!==!1){var ee=(N.listStack.length-1)%3;ee?ee===1?b.push(G.list2):b.push(G.list3):b.push(G.list1)}return N.trailingSpaceNewLine?b.push("trailing-space-new-line"):N.trailingSpace&&b.push("trailing-space-"+(N.trailingSpace%2?"a":"b")),b.length?b.join(" "):null}function T(N,b){return N.match(u,!0)?C(b):void 0}function x(N,b){var Y=b.text(N,b);if(typeof Y!="undefined")return Y;if(b.list)return b.list=null,C(b);if(b.taskList){var ee=N.match(g,!0)[1]===" ";return ee?b.taskOpen=!0:b.taskClosed=!0,P.highlightFormatting&&(b.formatting="task"),b.taskList=!1,C(b)}if(b.taskOpen=!1,b.taskClosed=!1,b.header&&N.match(/^#+$/,!0))return P.highlightFormatting&&(b.formatting="header"),C(b);var ae=N.next();if(b.linkTitle){b.linkTitle=!1;var ue=ae;ae==="("&&(ue=")"),ue=(ue+"").replace(/([.?*+^\[\]\\(){}|-])/g,"\\$1");var Oe="^\\s*(?:[^"+ue+"\\\\]+|\\\\\\\\|\\\\.)"+ue;if(N.match(new RegExp(Oe),!0))return G.linkHref}if(ae==="`"){var Ee=b.formatting;P.highlightFormatting&&(b.formatting="code"),N.eatWhile("`");var xe=N.current().length;if(b.code==0&&(!b.quote||xe==1))return b.code=xe,C(b);if(xe==b.code){var Ae=C(b);return b.code=0,Ae}else return b.formatting=Ee,C(b)}else if(b.code)return C(b);if(ae==="\\"&&(N.next(),P.highlightFormatting)){var Re=C(b),pe=G.formatting+"-escape";return Re?Re+" "+pe:pe}if(ae==="!"&&N.match(/\[[^\]]*\] ?(?:\(|\[)/,!1))return b.imageMarker=!0,b.image=!0,P.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="["&&b.imageMarker&&N.match(/[^\]]*\](\(.*?\)| ?\[.*?\])/,!1))return b.imageMarker=!1,b.imageAltText=!0,P.highlightFormatting&&(b.formatting="image"),C(b);if(ae==="]"&&b.imageAltText){P.highlightFormatting&&(b.formatting="image");var Re=C(b);return b.imageAltText=!1,b.image=!1,b.inline=b.f=w,Re}if(ae==="["&&!b.image)return b.linkText&&N.match(/^.*?\]/)||(b.linkText=!0,P.highlightFormatting&&(b.formatting="link")),C(b);if(ae==="]"&&b.linkText){P.highlightFormatting&&(b.formatting="link");var Re=C(b);return b.linkText=!1,b.inline=b.f=N.match(/\(.*?\)| ?\[.*?\]/,!1)?w:x,Re}if(ae==="<"&&N.match(/^(https?|ftps?):\/\/(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,P.highlightFormatting&&(b.formatting="link");var Re=C(b);return Re?Re+=" ":Re="",Re+G.linkInline}if(ae==="<"&&N.match(/^[^> \\]+@(?:[^\\>]|\\.)+>/,!1)){b.f=b.inline=c,P.highlightFormatting&&(b.formatting="link");var Re=C(b);return Re?Re+=" ":Re="",Re+G.linkEmail}if(P.xml&&ae==="<"&&N.match(/^(!--|\?|!\[CDATA\[|[a-z][a-z0-9-]*(?:\s+[a-z_:.\-]+(?:\s*=\s*[^>]+)?)*\s*(?:>|$))/i,!1)){var he=N.string.indexOf(">",N.pos);if(he!=-1){var ke=N.string.substring(N.start,he);/markdown\s*=\s*('|"){0,1}1('|"){0,1}/.test(ke)&&(b.md_inside=!0)}return N.backUp(1),b.htmlState=re.startState(X),s(N,b,L)}if(P.xml&&ae==="<"&&N.match(/^\/\w*?>/))return b.md_inside=!1,"tag";if(ae==="*"||ae==="_"){for(var et=1,We=N.pos==1?" ":N.string.charAt(N.pos-2);et<3&&N.eat(ae);)et++;var it=N.peek()||" ",at=!/\s/.test(it)&&(!l.test(it)||/\s/.test(We)||l.test(We)),Pe=!/\s/.test(We)&&(!l.test(We)||/\s/.test(it)||l.test(it)),je=null,$e=null;if(et%2&&(!b.em&&at&&(ae==="*"||!Pe||l.test(We))?je=!0:b.em==ae&&Pe&&(ae==="*"||!at||l.test(it))&&(je=!1)),et>1&&(!b.strong&&at&&(ae==="*"||!Pe||l.test(We))?$e=!0:b.strong==ae&&Pe&&(ae==="*"||!at||l.test(it))&&($e=!1)),$e!=null||je!=null){P.highlightFormatting&&(b.formatting=je==null?"strong":$e==null?"em":"strong em"),je===!0&&(b.em=ae),$e===!0&&(b.strong=ae);var Ae=C(b);return je===!1&&(b.em=!1),$e===!1&&(b.strong=!1),Ae}}else if(ae===" "&&(N.eat("*")||N.eat("_"))){if(N.peek()===" ")return C(b);N.backUp(1)}if(P.strikethrough){if(ae==="~"&&N.eatWhile(ae)){if(b.strikethrough){P.highlightFormatting&&(b.formatting="strikethrough");var Ae=C(b);return b.strikethrough=!1,Ae}else if(N.match(/^[^\s]/,!1))return b.strikethrough=!0,P.highlightFormatting&&(b.formatting="strikethrough"),C(b)}else if(ae===" "&&N.match(/^~~/,!0)){if(N.peek()===" ")return C(b);N.backUp(2)}}if(P.emoji&&ae===":"&&N.match(/^(?:[a-z_\d+][a-z_\d+-]*|\-[a-z_\d+][a-z_\d+-]*):/)){b.emoji=!0,P.highlightFormatting&&(b.formatting="emoji");var se=C(b);return b.emoji=!1,se}return ae===" "&&(N.match(/^ +$/,!1)?b.trailingSpace++:b.trailingSpace&&(b.trailingSpaceNewLine=!0)),C(b)}function c(N,b){var Y=N.next();if(Y===">"){b.f=b.inline=x,P.highlightFormatting&&(b.formatting="link");var ee=C(b);return ee?ee+=" ":ee="",ee+G.linkInline}return N.match(/^[^>]+/,!0),G.linkInline}function w(N,b){if(N.eatSpace())return null;var Y=N.next();return Y==="("||Y==="["?(b.f=b.inline=y(Y==="("?")":"]"),P.highlightFormatting&&(b.formatting="link-string"),b.linkHref=!0,C(b)):"error"}var v={")":/^(?:[^\\\(\)]|\\.|\((?:[^\\\(\)]|\\.)*\))*?(?=\))/,"]":/^(?:[^\\\[\]]|\\.|\[(?:[^\\\[\]]|\\.)*\])*?(?=\])/};function y(N){return function(b,Y){var ee=b.next();if(ee===N){Y.f=Y.inline=x,P.highlightFormatting&&(Y.formatting="link-string");var ae=C(Y);return Y.linkHref=!1,ae}return b.match(v[N]),Y.linkHref=!0,C(Y)}}function F(N,b){return N.match(/^([^\]\\]|\\.)*\]:/,!1)?(b.f=B,N.next(),P.highlightFormatting&&(b.formatting="link"),b.linkText=!0,C(b)):a(N,b,x)}function B(N,b){if(N.match(/^\]:/,!0)){b.f=b.inline=R,P.highlightFormatting&&(b.formatting="link");var Y=C(b);return b.linkText=!1,Y}return N.match(/^([^\]\\]|\\.)+/,!0),G.linkText}function R(N,b){return N.eatSpace()?null:(N.match(/^[^\s]+/,!0),N.peek()===void 0?b.linkTitle=!0:N.match(/^(?:\s+(?:"(?:[^"\\]|\\\\|\\.)+"|'(?:[^'\\]|\\\\|\\.)+'|\((?:[^)\\]|\\\\|\\.)+\)))?/,!0),b.f=b.inline=x,G.linkHref+" url")}var j={startState:function(){return{f:S,prevLine:{stream:null},thisLine:{stream:null},block:S,htmlState:null,indentation:0,inline:x,text:T,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(N){return{f:N.f,prevLine:N.prevLine,thisLine:N.thisLine,block:N.block,htmlState:N.htmlState&&re.copyState(X,N.htmlState),indentation:N.indentation,localMode:N.localMode,localState:N.localMode?re.copyState(N.localMode,N.localState):null,inline:N.inline,text:N.text,formatting:!1,linkText:N.linkText,linkTitle:N.linkTitle,linkHref:N.linkHref,code:N.code,em:N.em,strong:N.strong,strikethrough:N.strikethrough,emoji:N.emoji,header:N.header,setext:N.setext,hr:N.hr,taskList:N.taskList,list:N.list,listStack:N.listStack.slice(0),quote:N.quote,indentedCode:N.indentedCode,trailingSpace:N.trailingSpace,trailingSpaceNewLine:N.trailingSpaceNewLine,md_inside:N.md_inside,fencedEndRE:N.fencedEndRE}},token:function(N,b){if(b.formatting=!1,N!=b.thisLine.stream){if(b.header=0,b.hr=!1,N.match(/^\s*$/,!0))return E(b),null;if(b.prevLine=b.thisLine,b.thisLine={stream:N},b.taskList=!1,b.trailingSpace=0,b.trailingSpaceNewLine=!1,!b.localState&&(b.f=b.block,b.f!=L)){var Y=N.match(/^\s*/,!0)[0].replace(/\t/g,h).length;if(b.indentation=Y,b.indentationDiff=null,Y>0)return null}}return b.f(N,b)},innerMode:function(N){return N.block==L?{state:N.htmlState,mode:X}:N.localState?{state:N.localState,mode:N.localMode}:{state:N,mode:j}},indent:function(N,b,Y){return N.block==L&&X.indent?X.indent(N.htmlState,b,Y):N.localState&&N.localMode.indent?N.localMode.indent(N.localState,b,Y):re.Pass},blankLine:E,getType:C,blockCommentStart:"",closeBrackets:"()[]{}''\"\"``",fold:"markdown"};return j},"xml"),re.defineMIME("text/markdown","markdown"),re.defineMIME("text/x-markdown","markdown")})},nEHx:function(ht,be,Z){"use strict";Z.d(be,"a",function(){return re});var re;(function($){$.DARK="dark",$.LIGHT="light",$.HIGH_CONTRAST="hc"})(re||(re={}))},nnTU:function(ht,be,Z){"use strict";Z.d(be,"b",function(){return G}),Z.d(be,"a",function(){return W});var re=Z("MI8n"),$=Z("JYp7"),P=Z("pmY6"),X=Z("24hK"),U=Z("746U"),k=Z("Cg/j");const G=Object(k.c)("commandService"),W=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new re.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(i,D){if(!i)throw new Error("invalid command");if(typeof i=="string"){if(!D)throw new Error("invalid command");return this.registerCommand({id:i,handler:D})}if(i.description){const o=[];for(let l of i.description.args)o.push(l.constraint);const f=i.handler;i.handler=function(l,...h){return Object(U.o)(h,o),f(l,...h)}}const{id:g}=i;let p=this._commands.get(g);p||(p=new X.a,this._commands.set(g,p));let m=p.unshift(i),u=Object(P.i)(()=>{m();const o=this._commands.get(g);(o==null?void 0:o.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),u}registerCommandAlias(i,D){return W.registerCommand(i,(g,...p)=>g.get(G).executeCommand(D,...p))}getCommand(i){const D=this._commands.get(i);return!D||D.isEmpty()?void 0:$.a.first(D)}getCommands(){const i=new Map;for(const D of this._commands.keys()){const g=this.getCommand(D);g&&i.set(D,g)}return i}};W.registerCommand("noop",()=>{})},osHv:function(ht,be,Z){(function(re){re(Z("VrN/"))})(function(re){"use strict";var $=re.Pos;function P(l,h){return l.line-h.line||l.ch-h.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",U=X+"-:.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040",k=new RegExp("<(/?)(["+X+"]["+U+"]*)","g");function G(l,h,a,s){this.line=h,this.ch=a,this.cm=l,this.text=l.getLine(h),this.min=s?Math.max(s.from,l.firstLine()):l.firstLine(),this.max=s?Math.min(s.to-1,l.lastLine()):l.lastLine()}function W(l,h){var a=l.cm.getTokenTypeAt($(l.line,h));return a&&/\btag\b/.test(a)}function i(l){return l.line>=l.max?void 0:(l.ch=0,l.text=l.cm.getLine(++l.line),!0)}function D(l){return l.line<=l.min?void 0:(l.text=l.cm.getLine(--l.line),l.ch=l.text.length,!0)}function g(l){for(;;){var h=l.text.indexOf(">",l.ch);if(h==-1){if(i(l))continue;return}if(!W(l,h+1)){l.ch=h+1;continue}var a=l.text.lastIndexOf("/",h),s=a>-1&&!/\S/.test(l.text.slice(a+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function p(l){for(;;){var h=l.ch?l.text.lastIndexOf("<",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}k.lastIndex=h,l.ch=h;var a=k.exec(l.text);if(a&&a.index==h)return a}}function m(l){for(;;){k.lastIndex=l.ch;var h=k.exec(l.text);if(!h){if(i(l))continue;return}if(!W(l,h.index+1)){l.ch=h.index+1;continue}return l.ch=h.index+h[0].length,h}}function u(l){for(;;){var h=l.ch?l.text.lastIndexOf(">",l.ch-1):-1;if(h==-1){if(D(l))continue;return}if(!W(l,h+1)){l.ch=h;continue}var a=l.text.lastIndexOf("/",h),s=a>-1&&!/\S/.test(l.text.slice(a+1,h));return l.ch=h+1,s?"selfClose":"regular"}}function o(l,h){for(var a=[];;){var s=m(l),A,E=l.line,S=l.ch-(s?s[0].length:0);if(!s||!(A=g(l)))return;if(A=="selfClose")continue;if(s[1]){for(var L=a.length-1;L>=0;--L)if(a[L]==s[2]){a.length=L;break}if(L<0&&(!h||h==s[2]))return{tag:s[2],from:$(E,S),to:$(l.line,l.ch)}}else a.push(s[2])}}function f(l,h){for(var a=[];;){var s=u(l);if(!s)return;if(s=="selfClose"){p(l);continue}var A=l.line,E=l.ch,S=p(l);if(!S)return;if(S[1])a.push(S[2]);else{for(var L=a.length-1;L>=0;--L)if(a[L]==S[2]){a.length=L;break}if(L<0&&(!h||h==S[2]))return{tag:S[2],from:$(l.line,l.ch),to:$(A,E)}}}}re.registerHelper("fold","xml",function(l,h){for(var a=new G(l,h.line,0);;){var s=m(a);if(!s||a.line!=h.line)return;var A=g(a);if(!A)return;if(!s[1]&&A!="selfClose"){var E=$(a.line,a.ch),S=o(a,s[2]);return S&&P(S.from,E)>0?{from:E,to:S.from}:null}}}),re.findMatchingTag=function(l,h,a){var s=new G(l,h.line,h.ch,a);if(s.text.indexOf(">")==-1&&s.text.indexOf("<")==-1)return;var A=g(s),E=A&&$(s.line,s.ch),S=A&&p(s);if(!A||!S||P(s,h)>0)return;var L={from:$(s.line,s.ch),to:E,tag:S[2]};return A=="selfClose"?{open:L,close:null,at:"open"}:S[1]?{open:f(s,S[2]),close:L,at:"close"}:(s=new G(l,E.line,E.ch,a),{open:L,close:o(s,S[2]),at:"open"})},re.findEnclosingTag=function(l,h,a,s){for(var A=new G(l,h.line,h.ch,a);;){var E=f(A,s);if(!E)break;var S=new G(l,h.line,h.ch,a),L=o(S,E.tag);if(L)return{open:E,close:L}}},re.scanForClosingTag=function(l,h,a,s){var A=new G(l,h.line,h.ch,s?{from:0,to:s}:null);return o(A,a)}})},p5ED:function(ht,be,Z){"use strict";var re=Z("+L6B"),$=Z("2/Rp"),P=Z("5Dmo"),X=Z("3S7+"),U=Z("k1fw"),k=Z("9og8"),G=Z("tJVT"),W=Z("WmNS"),i=Z.n(W),D=Z("q1tI"),g=Z.n(D),p=Z("vHTk"),m=Z.n(p),u=Z("yEEn"),o=Z("ZW9T"),f=Z("1vsH"),l=Z("V0Rq"),h=Z("m3rI");be.a=function(a){var s,A,E,S,L,O,C,T=a.editOffice,x=T===void 0?"view":T,c=a.data,w=a.theme,v=a.type,y=a.filename,F=a.monacoEditor,B=a.className,R=a.style,j=a.close,N=a.onClose,b=a.hasMask,Y=a.disabledDownload,ee=Object(D.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(G.a)(ee,2),ue=ae[0],Oe=ae[1],Ee=Object(D.useState)(""),xe=Object(G.a)(Ee,2),Ae=xe[0],Re=xe[1],pe=Object(D.useState)(),he=Object(G.a)(pe,2),ke=he[0],et=he[1],We=window.ENV==="build"?"/react/build":"",it=h.a.PROXY_SERVER||location.origin,at,Pe=1024*1024,je=10*Pe,$e=Object(D.useRef)();(s=c)!==null&&s!==void 0&&s.startsWith("/api")&&v!=="txt"&&(c=h.a.API_SERVER+c),v==="office"&&(at=Object(f.T)(c).filesize,at>je&&(v="other")),y&&F&&(F.filename=y),Object(D.useEffect)(function(){var Se,Ge,Ne=(Se=document.cookie)===null||Se===void 0||((Ge=Se.replace(/\s/g,""))===null||Ge===void 0)?void 0:Ge.split(";");Ne==null||Ne.map(function(Fe){var Ke=Fe.split("=");Ke[0]==="_educoder_session"&&Re(Ke[1])})},[]),Object(D.useEffect)(function(){v==="office"&&se()},[v,c]);var se=function(){var Se=Object(k.a)(i.a.mark(function Ge(){var Ne,Fe,Ke;return i.a.wrap(function(Ve){for(;;)switch(Ve.prev=Ve.next){case 0:return console.log("data:",c),Ne=c,c.startsWith("http")||(Ne=location.origin+Ne),Fe=new URL(Ne).pathname.split("/").pop(),Ve.next=6,Object(l.V)({attachment_id:Fe});case 6:Ke=Ve.sent,et(Ke);case 8:case"end":return Ve.stop()}},Ge)}));return function(){return Se.apply(this,arguments)}}(),_e=function(){if(c.startsWith("http")||c.startsWith("blob:")){Te();return}Object(f.z)(y||"educoder",c,y)},Te=function(){Object(f.x)(y||"educoder",decodeURIComponent(c))};return g.a.createElement("div",{style:Object(U.a)({},R||{}),className:"".concat(b&&m.a.bgBlack," ").concat(v?m.a.wrp:"hide")},j&&g.a.createElement("div",{className:m.a.close,ref:$e},!Y&&g.a.createElement(X.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return $e.current}},g.a.createElement("span",{onClick:Te},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(X.a,{title:"\u5173\u95ED",getPopupContainer:function(){return $e.current}},g.a.createElement("span",{className:"",onClick:N},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(m.a[B]," ").concat(B," ").concat(m.a.monaco," ").concat(v==="txt"?"show":"hide")},v==="txt"&&g.a.createElement(o.b,F)),v==="audio"&&g.a.createElement("audio",{src:"".concat(((A=c)===null||A===void 0?void 0:A.indexOf("http://"))>-1||((E=c)===null||E===void 0?void 0:E.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(c),autoPlay:!0}),v==="video"&&g.a.createElement(g.a.Fragment,null,((S=c)===null||S===void 0?void 0:S.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(c),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(c),autoPlay:!0})),v==="office"&&ke&&g.a.createElement("iframe",{src:"".concat(We,"/office.html?key=").concat(ke.key,"&url=").concat(it+ke.url,"&callbackUrl=").concat(it+ke.callbackUrl,"&fileType=").concat(ke.fileType,"&title=").concat(ke.title,"&model=").concat(x,"&officeServer=").concat(h.a.OFFICE_SERVER,"&disabledDownload=").concat(!!Y)}),v==="html"&&g.a.createElement("iframe",{src:c+"&disposition=inline"}),v==="pdf"&&g.a.createElement("iframe",{src:"".concat(We,"/js/pdfview/index.html?url=").concat(c,"&disabledDownload=").concat(!!Y)}),v==="image"&&g.a.createElement("img",{src:"".concat(((L=c)===null||L===void 0?void 0:L.indexOf("http://"))>-1||((O=c)===null||O===void 0?void 0:O.indexOf("https://"))>-1||(C=c)!==null&&C!==void 0&&C.startsWith("/api")?"":"data:image/png;base64,").concat(c)}),v==="other"&&g.a.createElement("div",null,g.a.createElement($.a,{type:"primary",size:"large",onClick:_e},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),v==="download"&&g.a.createElement($.a,{type:"primary",size:"large",onClick:_e},g.a.createElement(u.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},"p77/":function(ht,be,Z){},pmY6:function(ht,be,Z){"use strict";Z.d(be,"h",function(){return D}),Z.d(be,"g",function(){return p}),Z.d(be,"f",function(){return m}),Z.d(be,"e",function(){return u}),Z.d(be,"i",function(){return o}),Z.d(be,"b",function(){return f}),Z.d(be,"a",function(){return l}),Z.d(be,"d",function(){return h}),Z.d(be,"c",function(){return a});var re=Z("C/vA"),$=Z("JYp7");const P=!1;let X=null;function U(s){X=s}if(P){const s="__is_disposable_tracked__";U(new class{trackDisposable(A){const E=new Error("Potentially leaked disposable").stack;setTimeout(()=>{A[s]||console.log(E)},3e3)}setParent(A,E){if(A&&A!==l.None)try{A[s]=!0}catch(S){}}markAsDisposed(A){if(A&&A!==l.None)try{A[s]=!0}catch(E){}}markAsSingleton(A){}})}function k(s){return X==null||X.trackDisposable(s),s}function G(s){X==null||X.markAsDisposed(s)}function W(s,A){X==null||X.setParent(s,A)}function i(s,A){if(!X)return;for(const E of s)X.setParent(E,A)}function D(s){return X==null||X.markAsSingleton(s),s}class g extends Error{constructor(s){super(`Encountered errors while disposing of store. Errors: [${s.join(", ")}]`);this.errors=s}}function p(s){return typeof s.dispose=="function"&&s.dispose.length===0}function m(s){if($.a.is(s)){let A=[];for(const E of s)if(E)try{E.dispose()}catch(S){A.push(S)}if(A.length===1)throw A[0];if(A.length>1)throw new g(A);return Array.isArray(s)?[]:s}else if(s)return s.dispose(),s}function u(...s){const A=o(()=>m(s));return i(s,A),A}function o(s){const A=k({dispose:Object(re.a)(()=>{G(A),s()})});return A}class f{constructor(){this._toDispose=new Set,this._isDisposed=!1,k(this)}dispose(){if(this._isDisposed)return;G(this),this._isDisposed=!0,this.clear()}clear(){try{m(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 W(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 l{constructor(){this._store=new f,k(this),W(this._store,this)}dispose(){G(this),this._store.dispose()}_register(s){if(s===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(s)}}l.None=Object.freeze({dispose(){}});class h{constructor(){this._isDisposed=!1,k(this)}get value(){return this._isDisposed?void 0:this._value}set value(s){var A;if(this._isDisposed||s===this._value)return;(A=this._value)===null||A===void 0||A.dispose(),s&&W(s,this),this._value=s}clear(){this.value=void 0}dispose(){var s;this._isDisposed=!0,G(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&&W(s,null),s}}class a{constructor(s){this.object=s}dispose(){}}},psGv:function(ht,be,Z){var re,$;(function(){var P;(function(){"use strict";var G=[,,function(g){function p(o){this.__parent=o,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=[]}p.prototype.clone_empty=function(){var o=new p(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},p.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},p.prototype.has_match=function(o){for(var f=this.__items.length-1;f>=0;f--)if(this.__items[f].match(o))return!0;return!1},p.prototype.set_indent=function(o,f){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=f||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.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)},p.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},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var o=this.__parent.current_line;return o.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),o.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),o.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,o.__items[0]===" "&&(o.__items.splice(0,1),o.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(o){this.__items.push(o);var f=o.lastIndexOf(` `);f!==-1?this.__character_count=o.length-f:this.__character_count+=o.length},p.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var o="";return this.is_empty()?this.__parent.indent_empty_lines&&(o=this.__parent.get_indent_string(this.__indent_count)):(o=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),o+=this.__items.join("")),o};function m(o,f){this.__cache=[""],this.__indent_size=o.indent_size,this.__indent_string=o.indent_char,o.indent_with_tabs||(this.__indent_string=new Array(o.indent_size+1).join(o.indent_char)),f=f||"",o.indent_level>0&&(f=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=f,this.__base_string_length=f.length}m.prototype.get_indent_size=function(o,f){var l=this.__base_string_length;return f=f||0,o<0&&(l=0),l+=o*this.__indent_size,l+=f,l},m.prototype.get_indent_string=function(o,f){var l=this.__base_string;return f=f||0,o<0&&(o=0,l=""),f+=o*this.__indent_size,this.__ensure_cache(f),l+=this.__cache[f],l},m.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},m.prototype.__add_column=function(){var o=this.__cache.length,f=0,l="";this.__indent_size&&o>=this.__indent_size&&(f=Math.floor(o/this.__indent_size),o-=f*this.__indent_size,l=new Array(f+1).join(this.__indent_string)),o&&(l+=new Array(o+1).join(" ")),this.__cache.push(l)};function u(o,f){this.__indent_cache=new m(o,f),this.raw=!1,this._end_with_newline=o.end_with_newline,this.indent_size=o.indent_size,this.wrap_line_length=o.wrap_line_length,this.indent_empty_lines=o.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}u.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},u.prototype.get_line_number=function(){return this.__lines.length},u.prototype.get_indent_string=function(o,f){return this.__indent_cache.get_indent_string(o,f)},u.prototype.get_indent_size=function(o,f){return this.__indent_cache.get_indent_size(o,f)},u.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},u.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},u.prototype.get_code=function(o){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 l=this.__lines.join(` `);return o!==` `&&(l=l.replace(/[\n]/g,o)),l},u.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},u.prototype.set_indent=function(o,f){return o=o||0,f=f||0,this.next_line.set_indent(o,f),this.__lines.length>1?(this.current_line.set_indent(o,f),!0):(this.current_line.set_indent(),!1)},u.prototype.add_raw_token=function(o){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},u.prototype.just_added_newline=function(){return this.current_line.is_empty()},u.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},u.prototype.ensure_empty_line_above=function(o,f){for(var l=this.__lines.length-2;l>=0;){var h=this.__lines[l];if(h.is_empty())break;if(h.item(0).indexOf(o)!==0&&h.item(-1)!==f){this.__lines.splice(l+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}l--}},g.exports.Output=u},function(g){function p(m,u,o,f){this.type=m,this.text=u,this.comments_before=null,this.newlines=o||0,this.whitespace_before=f||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=p},,,function(g){function p(o,f){this.raw_options=m(o,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"])}p.prototype._get_array=function(o,f){var l=this.raw_options[o],h=f||[];return typeof l=="object"?l!==null&&typeof l.concat=="function"&&(h=l.concat()):typeof l=="string"&&(h=l.split(/[^a-zA-Z0-9_\/\-]+/)),h},p.prototype._get_boolean=function(o,f){var l=this.raw_options[o],h=l===void 0?!!f:!!l;return h},p.prototype._get_characters=function(o,f){var l=this.raw_options[o],h=f||"";return typeof l=="string"&&(h=l.replace(/\\r/,"\r").replace(/\\n/,` `).replace(/\\t/," ")),h},p.prototype._get_number=function(o,f){var l=this.raw_options[o];f=parseInt(f,10),isNaN(f)&&(f=0);var h=parseInt(l,10);return isNaN(h)&&(h=f),h},p.prototype._get_selection=function(o,f,l){var h=this._get_selection_list(o,f,l);if(h.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values: `+f+` You passed in: '`+this.raw_options[o]+"'");return h[0]},p.prototype._get_selection_list=function(o,f,l){if(!f||f.length===0)throw new Error("Selection list cannot be empty.");if(l=l||[f[0]],!this._is_valid_selection(l,f))throw new Error("Invalid Default Value!");var h=this._get_array(o,l);if(!this._is_valid_selection(h,f))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values: `+f+` You passed in: '`+this.raw_options[o]+"'");return h},p.prototype._is_valid_selection=function(o,f){return o.length&&f.length&&!o.some(function(l){return f.indexOf(l)===-1})};function m(o,f){var l={};o=u(o);var h;for(h in o)h!==f&&(l[h]=o[h]);if(f&&o[f])for(h in o[f])l[h]=o[f][h];return l}function u(o){var f={},l;for(l in o){var h=l.replace(/-/g,"_");f[h]=o[l]}return f}g.exports.Options=p,g.exports.normalizeOpts=u,g.exports.mergeOpts=m},,function(g){var p=RegExp.prototype.hasOwnProperty("sticky");function m(u){this.__input=u||"",this.__input_length=this.__input.length,this.__position=0}m.prototype.restart=function(){this.__position=0},m.prototype.back=function(){this.__position>0&&(this.__position-=1)},m.prototype.hasNext=function(){return this.__position=0&&u=0&&o=u.length&&this.__input.substring(o-u.length,o).toLowerCase()===u},g.exports.InputScanner=m},function(g,p,m){var u=m(8).InputScanner,o=m(3).Token,f=m(10).TokenStream,l=m(11).WhitespacePattern,h={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(s,A){this._input=new u(s),this._options=A||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new l(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new f,this._reset();for(var s,A=new o(h.START,""),E=null,S=[],L=new f;A.type!==h.EOF;){for(s=this._get_next_token(A,E);this._is_comment(s);)L.add(s),s=this._get_next_token(A,E);L.isEmpty()||(s.comments_before=L,L=new f),s.parent=E,this._is_opening(s)?(S.push(E),E=s):E&&this._is_closing(s,E)&&(s.opened=E,E.closed=s,E=S.pop(),s.parent=E),s.previous=A,A.next=s,this.__tokens.add(s),A=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,A){this._readWhitespace();var E=this._input.read(/.+/g);return E?this._create_token(h.RAW,E):this._create_token(h.EOF,"")},a.prototype._is_comment=function(s){return!1},a.prototype._is_opening=function(s){return!1},a.prototype._is_closing=function(s,A){return!1},a.prototype._create_token=function(s,A){var E=new o(s,A,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return E},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=a,g.exports.TOKEN=h},function(g){function p(m){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=m}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position=0&&m/),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 u,f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){this.__set_templated_pattern()},f.prototype.disable=function(l){var h=this._create();return h._disabled[l]=!0,h._update(),h},f.prototype.read_options=function(l){var h=this._create();for(var a in o)h._disabled[a]=l.templating.indexOf(a)===-1;return h._update(),h},f.prototype.exclude=function(l){var h=this._create();return h._excluded[l]=!0,h._update(),h},f.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 h=this._read_template();h;)this._match_pattern?h+=this._input.read(this._match_pattern):h+=this._input.readUntil(this.__template_pattern),l+=h,h=this._read_template();return this._until_after&&(l+=this._input.readUntilAfter(this._until_pattern)),l},f.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("|")+")")},f.prototype._read_template=function(){var l="",h=this._input.peek();if(h==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(l=l||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(l=l||this.__patterns.erb.read())}else h==="{"&&(!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},g.exports.TemplatablePattern=f},,,,function(g,p,m){var u=m(19).Beautifier,o=m(20).Options;function f(l,h,a,s){var A=new u(l,h,a,s);return A.beautify()}g.exports=f,g.exports.defaultOptions=function(){return new o}},function(g,p,m){var u=m(20).Options,o=m(2).Output,f=m(21).Tokenizer,l=m(21).TOKEN,h=/\r\n|[\r\n]/,a=/\r\n|[\r\n]/g,s=function(w,v){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 o(w,v)};s.prototype.current_line_has_match=function(w){return this._output.current_line.has_match(w)},s.prototype.set_space_before_token=function(w,v){this._output.space_before_token=w,this._output.non_breaking_space=v},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 v=0;w.type!==l.TEXT&&w.previous.type!==l.TEXT&&(v=w.newlines?1:0),this.preserve_newlines&&(v=w.newlines0);return v!==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 A=function(w){for(var v=null,y=w.next;y.type!==l.EOF&&w.closed!==y;){if(y.type===l.ATTRIBUTE&&y.text==="type"){y.next&&y.next.type===l.EQUALS&&y.next.next&&y.next.next.type===l.VALUE&&(v=y.next.next.text);break}y=y.next}return v},E=function(w,v){var y=null,F=null;return v.closed?(w==="script"?y="text/javascript":w==="style"&&(y="text/css"),y=A(v)||y,y.search("text/css")>-1?F="css":y.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?F="javascript":y.search(/(text|application|dojo)\/(x-)?(html)/)>-1?F="html":y.search(/test\/null/)>-1&&(F="null"),F):null};function S(w,v){return v.indexOf(w)!==-1}function L(w,v,y){this.parent=w||null,this.tag=v?v.tag_name:"",this.indent_level=y||0,this.parser_token=v||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 v=new L(this._current_frame,w,this._printer.indent_level);this._current_frame=v},O.prototype._try_pop_frame=function(w){var v=null;return w&&(v=w.parser_token,this._printer.indent_level=w.indent_level,this._current_frame=w.parent),v},O.prototype._get_frame=function(w,v){for(var y=this._current_frame;y&&!(w.indexOf(y.tag)!==-1);){if(v&&v.indexOf(y.tag)!==-1){y=null;break}y=y.parent}return y},O.prototype.try_pop=function(w,v){var y=this._get_frame([w],v);return this._try_pop_frame(y)},O.prototype.indent_to_tag=function(w){var v=this._get_frame(w);v&&(this._printer.indent_level=v.indent_level)};function C(w,v,y,F){this._source_text=w||"",v=v||{},this._js_beautify=y,this._css_beautify=F,this._tag_stack=null;var B=new u(v,"html");this._options=B,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"}C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var w=this._source_text,v=this._options.eol;this._options.eol==="auto"&&(v=` `,w&&h.test(w)&&(v=w.match(h)[0])),w=w.replace(a,` `);var y=w.match(/^[\t ]*/)[0],F={text:"",type:""},B=new T,R=new s(this._options,y),j=new f(w,this._options).tokenize();this._tag_stack=new O(R);for(var N=null,b=j.next();b.type!==l.EOF;)b.type===l.TAG_OPEN||b.type===l.COMMENT?(N=this._handle_tag_open(R,b,B,F),B=N):b.type===l.ATTRIBUTE||b.type===l.EQUALS||b.type===l.VALUE||b.type===l.TEXT&&!B.tag_complete?N=this._handle_inside_tag(R,b,B,j):b.type===l.TAG_CLOSE?N=this._handle_tag_close(R,b,B):b.type===l.TEXT?N=this._handle_text(R,b,B):R.add_raw_token(b),F=N,b=j.next();var Y=R._output.get_code(v);return Y},C.prototype._handle_tag_close=function(w,v,y){var F={text:v.text,type:v.type};return w.alignment_size=0,y.tag_complete=!0,w.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted?w.add_raw_token(v):(y.tag_start_char==="<"&&(w.set_space_before_token(v.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&y.has_wrapped_attrs&&w.print_newline(!1)),w.print_token(v)),y.indent_content&&!(y.is_unformatted||y.is_content_unformatted)&&(w.indent(),y.indent_content=!1),!y.is_inline_element&&!(y.is_unformatted||y.is_content_unformatted)&&w.set_wrap_point(),F},C.prototype._handle_inside_tag=function(w,v,y,F){var B=y.has_wrapped_attrs,R={text:v.text,type:v.type};if(w.set_space_before_token(v.newlines||v.whitespace_before!=="",!0),y.is_unformatted)w.add_raw_token(v);else if(y.tag_start_char==="{"&&v.type===l.TEXT)w.print_preserved_newlines(v)?(v.newlines=0,w.add_raw_token(v)):w.print_token(v);else{if(v.type===l.ATTRIBUTE?(w.set_space_before_token(!0),y.attr_count+=1):(v.type===l.EQUALS||v.type===l.VALUE&&v.previous.type===l.EQUALS)&&w.set_space_before_token(!1),v.type===l.ATTRIBUTE&&y.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(w.traverse_whitespace(v),B=B||v.newlines!==0),this._is_wrap_attributes_force)){var j=y.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&y.attr_count===1){var N=!0,b=0,Y;do{if(Y=F.peek(b),Y.type===l.ATTRIBUTE){N=!1;break}b+=1}while(b<4&&Y.type!==l.EOF&&Y.type!==l.TAG_CLOSE);j=!N}j&&(w.print_newline(!1),B=!0)}w.print_token(v),B=B||w.previous_token_wrapped(),y.has_wrapped_attrs=B}return R},C.prototype._handle_text=function(w,v,y){var F={text:v.text,type:"TK_CONTENT"};return y.custom_beautifier_name?this._print_custom_beatifier_text(w,v,y):y.is_unformatted||y.is_content_unformatted?w.add_raw_token(v):(w.traverse_whitespace(v),w.print_token(v)),F},C.prototype._print_custom_beatifier_text=function(w,v,y){var F=this;if(v.text!==""){var B=v.text,R,j=1,N="",b="";y.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?R=this._js_beautify:y.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?R=this._css_beautify:y.custom_beautifier_name==="html"&&(R=function(Ee,xe){var Ae=new C(Ee,xe,F._js_beautify,F._css_beautify);return Ae.beautify()}),this._options.indent_scripts==="keep"?j=0:this._options.indent_scripts==="separate"&&(j=-w.indent_level);var Y=w.get_full_indent(j);if(B=B.replace(/\n[ \t]*$/,""),y.custom_beautifier_name!=="html"&&B[0]==="<"&&B.match(/^(|]]>)$/.exec(B);if(!ee){w.add_raw_token(v);return}N=Y+ee[1]+` `,B=ee[4],ee[5]&&(b=Y+ee[5]),B=B.replace(/\n[ \t]*$/,""),(ee[2]||ee[3].indexOf(` `)!==-1)&&(ee=ee[3].match(/[ \t]+$/),ee&&(v.whitespace_before=ee[0]))}if(B)if(R){var ae=function(){this.eol=` `};ae.prototype=this._options.raw_options;var ue=new ae;B=R(Y+B,ue)}else{var Oe=v.whitespace_before;Oe&&(B=B.replace(new RegExp(` (`+Oe+")?","g"),` `)),B=Y+B.replace(/\n/g,` `+Y)}N&&(B?B=N+B+` `+b:B=N+b),w.print_newline(!1),B&&(v.text=B,v.whitespace_before="",v.newlines=0,w.add_raw_token(v),w.print_newline(!0))}},C.prototype._handle_tag_open=function(w,v,y,F){var B=this._get_tag_open_token(v);return(y.is_unformatted||y.is_content_unformatted)&&!y.is_empty_element&&v.type===l.TAG_OPEN&&v.text.indexOf("]*)/),this.tag_check=y?y[1]:""):(y=v.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=y?y[1]:"",(v.text.startsWith("{{#>")||v.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&v.next!==null?this.tag_check=v.next.text.split(" ")[0]:this.tag_check=v.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),v.type===l.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||v.closed&&v.closed.text==="/>";var F=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(F=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(F)))}};C.prototype._get_tag_open_token=function(w){var v=new T(this._tag_stack.get_parser_token(),w);return v.alignment_size=this._options.wrap_attributes_indent_size,v.is_end_tag=v.is_end_tag||S(v.tag_check,this._options.void_elements),v.is_empty_element=v.tag_complete||v.is_start_tag&&v.is_end_tag,v.is_unformatted=!v.tag_complete&&S(v.tag_check,this._options.unformatted),v.is_content_unformatted=!v.is_empty_element&&S(v.tag_check,this._options.content_unformatted),v.is_inline_element=S(v.tag_name,this._options.inline)||v.tag_name.includes("-")||v.tag_start_char==="{",v},C.prototype._set_tag_position=function(w,v,y,F,B){if(y.is_empty_element||(y.is_end_tag?y.start_tag_token=this._tag_stack.try_pop(y.tag_name):(this._do_optional_end_element(y)&&(y.is_inline_element||w.print_newline(!1)),this._tag_stack.record_tag(y),(y.tag_name==="script"||y.tag_name==="style")&&!(y.is_unformatted||y.is_content_unformatted)&&(y.custom_beautifier_name=E(y.tag_check,v)))),S(y.tag_check,this._options.extra_liners)&&(w.print_newline(!1),w._output.just_added_blankline()||w.print_newline(!0)),y.is_empty_element){if(y.tag_start_char==="{"&&y.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),y.indent_content=!0;var R=w.current_line_has_match(/{{#if/);R||w.print_newline(!1)}y.tag_name==="!--"&&B.type===l.TAG_CLOSE&&F.is_end_tag&&y.text.indexOf(` `)===-1||(y.is_inline_element||y.is_unformatted||w.print_newline(!1),this._calcluate_parent_multiline(w,y))}else if(y.is_end_tag){var j=!1;j=y.start_tag_token&&y.start_tag_token.multiline_content,j=j||!y.is_inline_element&&!(F.is_inline_element||F.is_unformatted)&&!(B.type===l.TAG_CLOSE&&y.start_tag_token===F)&&B.type!=="TK_CONTENT",(y.is_content_unformatted||y.is_unformatted)&&(j=!1),j&&w.print_newline(!1)}else y.indent_content=!y.custom_beautifier_name,y.tag_start_char==="<"&&(y.tag_name==="html"?y.indent_content=this._options.indent_inner_html:y.tag_name==="head"?y.indent_content=this._options.indent_head_inner_html:y.tag_name==="body"&&(y.indent_content=this._options.indent_body_inner_html)),!(y.is_inline_element||y.is_unformatted)&&(B.type!=="TK_CONTENT"||y.is_content_unformatted)&&w.print_newline(!1),this._calcluate_parent_multiline(w,y)},C.prototype._calcluate_parent_multiline=function(w,v){v.parent&&w._output.just_added_newline()&&!((v.is_inline_element||v.is_unformatted)&&v.parent.is_inline_element)&&(v.parent.multiline_content=!0)};var x=["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"];C.prototype._do_optional_end_element=function(w){var v=null;if(w.is_empty_element||!w.is_start_tag||!w.parent)return;if(w.tag_name==="body")v=v||this._tag_stack.try_pop("head");else if(w.tag_name==="li")v=v||this._tag_stack.try_pop("li",["ol","ul"]);else if(w.tag_name==="dd"||w.tag_name==="dt")v=v||this._tag_stack.try_pop("dt",["dl"]),v=v||this._tag_stack.try_pop("dd",["dl"]);else if(w.parent.tag_name==="p"&&x.indexOf(w.tag_name)!==-1){var y=w.parent.parent;(!y||c.indexOf(y.tag_name)===-1)&&(v=v||this._tag_stack.try_pop("p"))}else w.tag_name==="rp"||w.tag_name==="rt"?(v=v||this._tag_stack.try_pop("rt",["ruby","rtc"]),v=v||this._tag_stack.try_pop("rp",["ruby","rtc"])):w.tag_name==="optgroup"?v=v||this._tag_stack.try_pop("optgroup",["select"]):w.tag_name==="option"?v=v||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):w.tag_name==="colgroup"?v=v||this._tag_stack.try_pop("caption",["table"]):w.tag_name==="thead"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"])):w.tag_name==="tbody"||w.tag_name==="tfoot"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("thead",["table"]),v=v||this._tag_stack.try_pop("tbody",["table"])):w.tag_name==="tr"?(v=v||this._tag_stack.try_pop("caption",["table"]),v=v||this._tag_stack.try_pop("colgroup",["table"]),v=v||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(w.tag_name==="th"||w.tag_name==="td")&&(v=v||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),v=v||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return w.parent=this._tag_stack.get_parser_token(),v},g.exports.Beautifier=C},function(g,p,m){var u=m(6).Options;function o(f){u.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"])}o.prototype=new u,g.exports.Options=o},function(g,p,m){var u=m(9).Tokenizer,o=m(9).TOKEN,f=m(13).Directives,l=m(14).TemplatablePattern,h=m(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:o.START,RAW:o.RAW,EOF:o.EOF},s=new f(/<\!--/,/-->/),A=function(E,S){u.call(this,E,S),this._current_tag_name="";var L=new l(this._input).read_options(this._options),O=new h(this._input);if(this.__patterns={word:L.until(/[\n\r\t <]/),single_quote:L.until_after(/'/),double_quote:L.until_after(/"/),attribute:L.until(/[\n\r\t =>]|\/>/),element_name:L.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 C=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=O.matching(C).until_after(C)}};A.prototype=new u,A.prototype._is_comment=function(E){return!1},A.prototype._is_opening=function(E){return E.type===a.TAG_OPEN},A.prototype._is_closing=function(E,S){return E.type===a.TAG_CLOSE&&S&&((E.text===">"||E.text==="/>")&&S.text[0]==="<"||E.text==="}}"&&S.text[0]==="{"&&S.text[1]==="{")},A.prototype._reset=function(){this._current_tag_name=""},A.prototype._get_next_token=function(E,S){var L=null;this._readWhitespace();var O=this._input.peek();return O===null?this._create_token(a.EOF,""):(L=L||this._read_open_handlebars(O,S),L=L||this._read_attribute(O,E,S),L=L||this._read_close(O,S),L=L||this._read_raw_content(O,E,S),L=L||this._read_content_word(O),L=L||this._read_comment_or_cdata(O),L=L||this._read_processing(O),L=L||this._read_open(O,S),L=L||this._create_token(a.UNKNOWN,this._input.next()),L)},A.prototype._read_comment_or_cdata=function(E){var S=null,L=null,O=null;if(E==="<"){var C=this._input.peek(1);C==="!"&&(L=this.__patterns.comment.read(),L?(O=s.get_directives(L),O&&O.ignore==="start"&&(L+=s.readIgnored(this._input))):L=this.__patterns.cdata.read()),L&&(S=this._create_token(a.COMMENT,L),S.directives=O)}return S},A.prototype._read_processing=function(E){var S=null,L=null,O=null;if(E==="<"){var C=this._input.peek(1);(C==="!"||C==="?")&&(L=this.__patterns.conditional_comment.read(),L=L||this.__patterns.processing.read()),L&&(S=this._create_token(a.COMMENT,L),S.directives=O)}return S},A.prototype._read_open=function(E,S){var L=null,O=null;return S||E==="<"&&(L=this._input.next(),this._input.peek()==="/"&&(L+=this._input.next()),L+=this.__patterns.element_name.read(),O=this._create_token(a.TAG_OPEN,L)),O},A.prototype._read_open_handlebars=function(E,S){var L=null,O=null;return S||this._options.indent_handlebars&&E==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(L=this.__patterns.handlebars_comment.read(),L=L||this.__patterns.handlebars.read(),O=this._create_token(a.COMMENT,L)):(L=this.__patterns.handlebars_open.read(),O=this._create_token(a.TAG_OPEN,L))),O},A.prototype._read_close=function(E,S){var L=null,O=null;return S&&(S.text[0]==="<"&&(E===">"||E==="/"&&this._input.peek(1)===">")?(L=this._input.next(),E==="/"&&(L+=this._input.next()),O=this._create_token(a.TAG_CLOSE,L)):S.text[0]==="{"&&E==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),O=this._create_token(a.TAG_CLOSE,"}}"))),O},A.prototype._read_attribute=function(E,S,L){var O=null,C="";if(L&&L.text[0]==="<")if(E==="=")O=this._create_token(a.EQUALS,this._input.next());else if(E==='"'||E==="'"){var T=this._input.next();E==='"'?T+=this.__patterns.double_quote.read():T+=this.__patterns.single_quote.read(),O=this._create_token(a.VALUE,T)}else C=this.__patterns.attribute.read(),C&&(S.type===a.EQUALS?O=this._create_token(a.VALUE,C):O=this._create_token(a.ATTRIBUTE,C));return O},A.prototype._is_content_unformatted=function(E){return this._options.void_elements.indexOf(E)===-1&&(this._options.content_unformatted.indexOf(E)!==-1||this._options.unformatted.indexOf(E)!==-1)},A.prototype._read_raw_content=function(E,S,L){var O="";if(L&&L.text[0]==="{")O=this.__patterns.handlebars_raw_close.read();else if(S.type===a.TAG_CLOSE&&S.opened.text[0]==="<"&&S.text[0]!=="/"){var C=S.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var T=this._read_comment_or_cdata(E);if(T)return T.type=a.TEXT,T;O=this._input.readUntil(new RegExp("","ig"))}else this._is_content_unformatted(C)&&(O=this._input.readUntil(new RegExp("","ig")))}return O?this._create_token(a.TEXT,O):null},A.prototype._read_content_word=function(E){var S="";if(this._options.unformatted_content_delimiter&&(E===this._options.unformatted_content_delimiter[0]&&(S=this.__patterns.unformatted_content_delimiter.read())),S||(S=this.__patterns.word.read()),S)return this._create_token(a.TEXT,S)},g.exports.Tokenizer=A,g.exports.TOKEN=a}],W={};function i(g){var p=W[g];if(p!==void 0)return p.exports;var m=W[g]={exports:{}};return G[g](m,m.exports,i),m.exports}var D=i(18);P=D})();var X=P;if(!0)!(re=[Z,Z("6UM0"),Z("TXwP")],$=function(G){var W=Z("6UM0"),i=Z("TXwP");return{html_beautify:function(D,g){return X(D,g,W.js_beautify,i.css_beautify)}}}.apply(be,re),$!==void 0&&(ht.exports=$));else var U,k})()},"rAM+":function(ht,be,Z){"use strict";Z.d(be,"a",function(){return $});var re=Z("Qw5x");function $(P,X){var U;if(typeof Symbol=="undefined"||P[Symbol.iterator]==null){if(Array.isArray(P)||(U=Object(re.a)(P))||X&&P&&typeof P.length=="number"){U&&(P=U);var k=0,G=function(){};return{s:G,n:function(){return k>=P.length?{done:!0}:{done:!1,value:P[k++]}},e:function(p){throw p},f:G}}throw new TypeError(`Invalid attempt to iterate non-iterable instance. In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}var W=!0,i=!1,D;return{s:function(){U=P[Symbol.iterator]()},n:function(){var p=U.next();return W=p.done,p},e:function(p){i=!0,D=p},f:function(){try{!W&&U.return!=null&&U.return()}finally{if(i)throw D}}}}},rUJ1:function(ht,be){const Z=/[&<>"']/,re=/[&<>"']/g,$=/[<>"']|&(?!#?\w+;)/,P=/[<>"']|&(?!#?\w+;)/g,X={"&":"&","<":"<",">":">",'"':""","'":"'"},U=O=>X[O];function k(O,C){if(C){if(Z.test(O))return O.replace(re,U)}else if($.test(O))return O.replace(P,U);return O}const G=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function W(O){return O.replace(G,(C,T)=>(T=T.toLowerCase(),T==="colon"?":":T.charAt(0)==="#"?T.charAt(1)==="x"?String.fromCharCode(parseInt(T.substring(2),16)):String.fromCharCode(+T.substring(1)):""))}const i=/(^|[^\[])\^/g;function D(O,C){O=O.source||O,C=C||"";const T={replace:(x,c)=>(c=c.source||c,c=c.replace(i,"$1"),O=O.replace(x,c),T),getRegex:()=>new RegExp(O,C)};return T}const g=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function m(O,C,T){if(O){let x;try{x=decodeURIComponent(W(T)).replace(g,"").toLowerCase()}catch(c){return null}if(x.indexOf("javascript:")===0||x.indexOf("vbscript:")===0||x.indexOf("data:")===0)return null}C&&!p.test(T)&&(T=h(C,T));try{T=encodeURI(T).replace(/%25/g,"%")}catch(x){return null}return T}const u={},o=/^[^:]+:\/*[^/]*$/,f=/^([^:]+:)[\s\S]*$/,l=/^([^:]+:\/*[^/]*)[\s\S]*$/;function h(O,C){u[" "+O]||(o.test(O)?u[" "+O]=O+"/":u[" "+O]=E(O,"/",!0)),O=u[" "+O];const T=O.indexOf(":")===-1;return C.substring(0,2)==="//"?T?C:O.replace(f,"$1")+C:C.charAt(0)==="/"?T?C:O.replace(l,"$1")+C:O+C}const a={exec:function(){}};function s(O){let C=1,T,x;for(;C{let F=!1,B=v;for(;--B>=0&&y[B]==="\\";)F=!F;return F?"|":" |"}),x=T.split(/ \|/);let c=0;if(x.length>C)x.splice(C);else for(;x.length{const h=this.themingParticipants.indexOf(l);this.themingParticipants.splice(h,1)})}getThemingParticipants(){return this.themingParticipants}}let u=new m;U.a.add(p.ThemingContribution,u);function o(l){return u.onColorThemeChange(l)}class f extends P.a{constructor(l){super();this.themeService=l,this.theme=l.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(h=>this.onThemeChange(h)))}onThemeChange(l){this.theme=l,this.updateStyles()}updateStyles(){}}},ulZh:function(ht,be,Z){typeof window!="undefined"&&function($,P){ht.exports=P()}(this,function(){return function(re){var $={};function P(X){if($[X])return $[X].exports;var U=$[X]={i:X,l:!1,exports:{}};return re[X].call(U.exports,U,U.exports,P),U.l=!0,U.exports}return P.m=re,P.c=$,P.d=function(X,U,k){P.o(X,U)||Object.defineProperty(X,U,{enumerable:!0,get:k})},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,U){if(U&1&&(X=P(X)),U&8)return X;if(U&4&&typeof X=="object"&&X&&X.__esModule)return X;var k=Object.create(null);if(P.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:X}),U&2&&typeof X!="string")for(var G in X)P.d(k,G,function(W){return X[W]}.bind(null,G));return k},P.n=function(X){var U=X&&X.__esModule?function(){return X.default}:function(){return X};return P.d(U,"a",U),U},P.o=function(X,U){return Object.prototype.hasOwnProperty.call(X,U)},P.p="/dist/",P(P.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(re,$,P){"use strict";var X=Object.prototype.hasOwnProperty,U="~";function k(){}Object.create&&(k.prototype=Object.create(null),new k().__proto__||(U=!1));function G(g,p,m){this.fn=g,this.context=p,this.once=m||!1}function W(g,p,m,u,o){if(typeof m!="function")throw new TypeError("The listener must be a function");var f=new G(m,u||g,o),l=U?U+p:p;return g._events[l]?g._events[l].fn?g._events[l]=[g._events[l],f]:g._events[l].push(f):(g._events[l]=f,g._eventsCount++),g}function i(g,p){--g._eventsCount===0?g._events=new k:delete g._events[p]}function D(){this._events=new k,this._eventsCount=0}D.prototype.eventNames=function(){var p=[],m,u;if(this._eventsCount===0)return p;for(u in m=this._events)X.call(m,u)&&p.push(U?u.slice(1):u);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(m)):p},D.prototype.listeners=function(p){var m=U?U+p:p,u=this._events[m];if(!u)return[];if(u.fn)return[u.fn];for(var o=0,f=u.length,l=new Array(f);o0},!1)}function g(p,m){for(var u={main:[m]},o={main:[]},f={main:{}};D(u);)for(var l=Object.keys(u),h=0;h=2*L/C||y<=B)return;var R=Number.POSITIVE_INFINITY,j;for(j=l.level-1;j>x;j--){var N=T[j].maxBitrate;if(R=L*N/(8*.8*v),R=y)return;var b=this.bwEstimator.getEstimate();D.logger.warn("Fragment "+l.sn+(h?" part "+h.index:"")+" of level "+l.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+j+` Current BW estimate: `+(Object(X.isFiniteNumber)(b)?(b/1024).toFixed(3):"Unknown")+` Kb/s Estimated load time for current fragment: `+y.toFixed(3)+` s Estimated load time for the next fragment: `+R.toFixed(3)+` s Time to underbuffer: `+B.toFixed(3)+" s"),a.nextLoadLevel=j,this.bwEstimator.sample(O,S.loaded),this.clearTimer(),l.loader&&(this.fragCurrent=this.partCurrent=null,l.loader.abort()),a.trigger(k.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:l,part:h,stats:S})},o.onFragLoaded=function(l,h){var a=h.frag,s=h.part;if(a.type===i.PlaylistLevelType.MAIN&&Object(X.isFiniteNumber)(a.sn)){var A=s?s.stats:a.stats,E=s?s.duration:a.duration;if(this.clearTimer(),this.lastLoadedFragLevel=a.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var S=this.hls.levels[a.level],L=(S.loaded?S.loaded.bytes:0)+A.loaded,O=(S.loaded?S.loaded.duration:0)+E;S.loaded={bytes:L,duration:O},S.realBitrate=Math.round(8*L/O)}if(a.bitrateTest){var C={stats:A,frag:a,part:s,id:a.type};this.onFragBuffered(k.Events.FRAG_BUFFERED,C),a.bitrateTest=!1}}},o.onFragBuffered=function(l,h){var a=h.frag,s=h.part,A=s?s.stats:a.stats;if(A.aborted)return;if(a.type!==i.PlaylistLevelType.MAIN||a.sn==="initSegment")return;var E=A.parsing.end-A.loading.start;this.bwEstimator.sample(E,A.loaded),A.bwEstimate=this.bwEstimator.getEstimate(),a.bitrateTest?this.bitrateTestDelay=E/1e3:this.bitrateTestDelay=0},o.onError=function(l,h){switch(h.details){case W.ErrorDetails.FRAG_LOAD_ERROR:case W.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},o.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},o.getNextABRAutoLevel=function(){var l=this.fragCurrent,h=this.partCurrent,a=this.hls,s=a.maxAutoLevel,A=a.config,E=a.minAutoLevel,S=a.media,L=h?h.duration:l?l.duration:0,O=S?S.currentTime:0,C=S&&S.playbackRate!==0?Math.abs(S.playbackRate):1,T=this.bwEstimator?this.bwEstimator.getEstimate():A.abrEwmaDefaultEstimate,x=(G.BufferHelper.bufferInfo(S,O,A.maxBufferHole).end-O)/C,c=this.findBestLevel(T,E,s,x,A.abrBandWidthFactor,A.abrBandWidthUpFactor);if(c>=0)return c;D.logger.trace((x?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var w=L?Math.min(L,A.maxStarvationDelay):A.maxStarvationDelay,v=A.abrBandWidthFactor,y=A.abrBandWidthUpFactor;if(!x){var F=this.bitrateTestDelay;if(F){var B=L?Math.min(L,A.maxLoadingDelay):A.maxLoadingDelay;w=B-F,D.logger.trace("bitrate test took "+Math.round(1e3*F)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*w)+" ms"),v=y=1}}return c=this.findBestLevel(T,E,s,x+w,v,y),Math.max(c,0)},o.findBestLevel=function(l,h,a,s,A,E){for(var S,L=this.fragCurrent,O=this.partCurrent,C=this.lastLoadedFragLevel,T=this.hls.levels,x=T[C],c=!!(x!=null&&(S=x.details)!==null&&S!==void 0&&S.live),w=x==null?void 0:x.codecSet,v=O?O.duration:L?L.duration:0,y=a;y>=h;y--){var F=T[y];if(!F||w&&F.codecSet!==w)continue;var B=F.details,R=(O?B==null?void 0:B.partTarget:B==null?void 0:B.averagetargetduration)||v,j=void 0;y<=C?j=A*l:j=E*l;var N=T[y].maxBitrate,b=N*R/j;if(D.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+y+"/"+Math.round(j)+"/"+N+"/"+R+"/"+s+"/"+b),j>N&&(!b||c&&!this.bitrateTestDelay||b0&&x===-1?(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),this.state=U.State.IDLE):(this.loadedmetadata=!1,this.state=U.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=x,this.tick()},C.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_TRACK:{var x,c=this.levels,w=this.trackId,v=c==null||((x=c[w])===null||x===void 0)?void 0:x.details;if(v){if(this.waitForCdnTuneIn(v))break;this.state=U.State.WAITING_INIT_PTS}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var y,F=performance.now(),B=this.retryDate;(!B||F>=B||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=U.State.IDLE);break}case U.State.WAITING_INIT_PTS:{var R=this.waitingData;if(R){var j=R.frag,N=R.part,b=R.cache,Y=R.complete;if(this.initPTS[j.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.FRAG_LOADING;var ee=b.flush(),ae={frag:j,part:N,payload:ee,networkDetails:null};this._handleFragmentLoadProgress(ae),Y&&L.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)h.logger.log("Waiting fragment cc ("+j.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ue=this.getLoadPosition(),Oe=G.BufferHelper.bufferInfo(this.mediaBuffer,ue,this.config.maxBufferHole),Ee=Object(o.fragmentWithinToleranceTest)(Oe.end,this.config.maxFragLookUpTolerance,j);Ee<0&&(h.logger.log("Waiting fragment cc ("+j.cc+") @ "+j.start+" cancelled because another fragment at "+Oe.end+" is needed"),this.clearWaitingFragment())}}else this.state=U.State.IDLE}}this.onTickEnd()},C.clearWaitingFragment=function(){var x=this.waitingData;x&&(this.fragmentTracker.removeFragment(x.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=U.State.IDLE)},C.onTickEnd=function(){var x=this.media;if(!x||!x.readyState)return;var c=this.mediaBuffer?this.mediaBuffer:x,w=c.buffered;!this.loadedmetadata&&w.length&&(this.loadedmetadata=!0),this.lastCurrentTime=x.currentTime},C.doTickIdle=function(){var x,c,w=this.hls,v=this.levels,y=this.media,F=this.trackId,B=w.config;if(!v||!v[F])return;if(!y&&(this.startFragRequested||!B.startFragPrefetch))return;var R=v[F],j=R.details;if(!j||j.live&&this.levelLastLoaded!==F||this.waitForCdnTuneIn(j)){this.state=U.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,D.PlaylistLevelType.AUDIO));var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,D.PlaylistLevelType.AUDIO);if(N===null)return;var b=N.len,Y=this.getMaxBufferLength(),ee=this.audioSwitch;if(b>=Y&&!ee)return;if(!ee&&this._streamEnded(N,j)){w.trigger(k.Events.BUFFER_EOS,{type:"audio"}),this.state=U.State.ENDED;return}var ae=j.fragments,ue=ae[0].start,Oe=N.end;if(ee){var Ee=this.getLoadPosition();Oe=Ee,j.PTSKnown&&Eeue||N.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),y.currentTime=ue+.05))}var xe=this.getNextFragment(Oe,j);if(!xe){this.bufferFlushed=!0;return}((x=xe.decryptdata)===null||x===void 0?void 0:x.keyFormat)==="identity"&&!((c=xe.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(xe,j):this.loadFragment(xe,j,Oe)},C.getMaxBufferLength=function(){var x=L.prototype.getMaxBufferLength.call(this),c=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,D.PlaylistLevelType.MAIN);return c===null?x:Math.max(x,c.len)},C.onMediaDetaching=function(){this.videoBuffer=null,L.prototype.onMediaDetaching.call(this)},C.onAudioTracksUpdated=function(x,c){var w=c.audioTracks;this.resetTransmuxer(),this.levels=w.map(function(v){return new i.Level(v)})},C.onAudioTrackSwitching=function(x,c){var w=!!c.url;this.trackId=c.id;var v=this.fragCurrent;v!=null&&v.loader&&v.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),w?this.setInterval(E):this.resetTransmuxer(),w?(this.audioSwitch=!0,this.state=U.State.IDLE):this.state=U.State.STOPPED,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},C.onLevelLoaded=function(x,c){this.mainDetails=c.details},C.onAudioTrackLoaded=function(x,c){var w,v=this.levels,y=c.details,F=c.id;if(!v){this.warn("Audio tracks were reset while loading level "+F);return}this.log("Track "+F+" loaded ["+y.startSN+","+y.endSN+"],duration:"+y.totalduration);var B=v[F],R=0;if(y.live||(w=B.details)!==null&&w!==void 0&&w.live){var j=this.mainDetails;if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed||!j)return;!B.details&&y.hasProgramDateTime&&j.hasProgramDateTime?(Object(f.alignMediaPlaylistByPDT)(y,j),R=y.fragments[0].start):R=this.alignPlaylists(y,B.details)}B.details=y,this.levelLastLoaded=F,!this.startFragRequested&&(this.mainDetails||!y.live)&&this.setStartPosition(B.details,R),this.state===U.State.WAITING_TRACK&&!this.waitForCdnTuneIn(y)&&(this.state=U.State.IDLE),this.tick()},C._handleFragmentLoadProgress=function(x){var c,w=x.frag,v=x.part,y=x.payload,F=this.config,B=this.trackId,R=this.levels;if(!R){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 j=R[B];console.assert(j,"Audio track is defined on fragment load progress");var N=j.details;console.assert(N,"Audio track details are defined on fragment load progress");var b=F.defaultAudioCodec||j.audioCodec||"mp4a.40.2",Y=this.transmuxer;Y||(Y=this.transmuxer=new m.default(this.hls,D.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var ee=this.initPTS[w.cc],ae=(c=w.initSegment)===null||c===void 0?void 0:c.data;if(ee!==void 0){var ue=!1,Oe=v?v.index:-1,Ee=Oe!==-1,xe=new u.ChunkMetadata(w.level,w.sn,w.stats.chunkCount,y.byteLength,Oe,Ee);Y.push(y,ae,b,"",w,v,N.totalduration,ue,xe,ee)}else{h.logger.log("Unknown video PTS for cc "+w.cc+", waiting for video PTS before demuxing audio frag "+w.sn+" of ["+N.startSN+" ,"+N.endSN+"],track "+B);var Ae=this.waitingData=this.waitingData||{frag:w,part:v,cache:new p.default,complete:!1},Re=Ae.cache;Re.push(new Uint8Array(y)),this.waitingVideoCC=this.videoTrackCC,this.state=U.State.WAITING_INIT_PTS}},C._handleFragmentLoadComplete=function(x){if(this.waitingData){this.waitingData.complete=!0;return}L.prototype._handleFragmentLoadComplete.call(this,x)},C.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},C.onBufferCreated=function(x,c){var w=c.tracks.audio;w&&(this.mediaBuffer=w.buffer),c.tracks.video&&(this.videoBuffer=c.tracks.video.buffer)},C.onFragBuffered=function(x,c){var w=c.frag,v=c.part;if(w.type!==D.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(w)){this.warn("Fragment "+w.sn+(v?" p: "+v.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(k.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(w,v)},C.onError=function(x,c){switch(c.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(D.PlaylistLevelType.AUDIO,c);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==U.State.ERROR&&this.state!==U.State.STOPPED&&(this.state=c.fatal?U.State.ERROR:U.State.IDLE,this.warn(c.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="audio"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var w=!0,v=this.getFwdBufferInfo(this.mediaBuffer,D.PlaylistLevelType.AUDIO);v&&v.len>.5&&(w=!this.reduceMaxBufferLength(v.len)),w&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},C.onBufferFlushed=function(x,c){var w=c.type;w===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},C._handleTransmuxComplete=function(x){var c,w="audio",v=this.hls,y=x.remuxResult,F=x.chunkMeta,B=this.getCurrentContext(F);if(!B){this.warn("The loading context changed while buffering fragment "+F.sn+" of level "+F.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(F.level);return}var R=B.frag,j=B.part,N=y.audio,b=y.text,Y=y.id3,ee=y.initSegment;if(this.fragContextChanged(R))return;if(this.state=U.State.PARSING,this.audioSwitch&&N&&this.completeAudioSwitch(),ee!=null&&ee.tracks&&(this._bufferInitSegment(ee.tracks,R,F),v.trigger(k.Events.FRAG_PARSING_INIT_SEGMENT,{frag:R,id:w,tracks:ee.tracks})),N){var ae=N.startPTS,ue=N.endPTS,Oe=N.startDTS,Ee=N.endDTS;j&&(j.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ue,startDTS:Oe,endDTS:Ee}),R.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ae,ue,Oe,Ee),this.bufferFragmentData(N,R,j,F)}if(Y!=null&&(c=Y.samples)!==null&&c!==void 0&&c.length){var xe=a({frag:R,id:w},Y);v.trigger(k.Events.FRAG_PARSING_METADATA,xe)}if(b){var Ae=a({frag:R,id:w},b);v.trigger(k.Events.FRAG_PARSING_USERDATA,Ae)}},C._bufferInitSegment=function(x,c,w){if(this.state!==U.State.PARSING)return;x.video&&delete x.video;var v=x.audio;if(!v)return;v.levelCodec=v.codec,v.id="audio",this.log("Init audio buffer, container:"+v.container+", codecs[parsed]=["+v.codec+"]"),this.hls.trigger(k.Events.BUFFER_CODECS,x);var y=v.initSegment;if(y!=null&&y.byteLength){var F={type:"audio",frag:c,part:null,chunkMeta:w,parent:c.type,data:y};this.hls.trigger(k.Events.BUFFER_APPENDING,F)}this.tick()},C.loadFragment=function(x,c,w){var v=this.fragmentTracker.getState(x);this.fragCurrent=x,(this.audioSwitch||v===W.FragmentState.NOT_LOADED||v===W.FragmentState.PARTIAL)&&(x.sn==="initSegment"?this._loadInitSegment(x):c.live&&!Object(X.isFiniteNumber)(this.initPTS[x.cc])?(this.log("Waiting for video PTS in continuity counter "+x.cc+" of live stream before loading audio fragment "+x.sn+" of level "+this.trackId),this.state=U.State.WAITING_INIT_PTS):(this.startFragRequested=!0,L.prototype.loadFragment.call(this,x,c,w)))},C.completeAudioSwitch=function(){var x=this.hls,c=this.media,w=this.trackId;c&&(this.log("Switching audio track : flushing all audio"),L.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,x.trigger(k.Events.AUDIO_TRACK_SWITCHED,{id:w})},O}(U.default);$.default=S},"./src/controller/audio-track-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/controller/base-playlist-controller.ts"),G=P("./src/types/loader.ts");function W(m,u){for(var o=0;o=h.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var a=h[this.trackId];this.log("Now switching to audio-track index "+l);var s=h[l],A=s.id,E=s.groupId,S=E===void 0?"":E,L=s.name,O=s.type,C=s.url;if(this.trackId=l,this.trackName=L,this.selectDefaultTrack=!1,this.hls.trigger(X.Events.AUDIO_TRACK_SWITCHING,{id:A,groupId:S,name:L,type:O,url:C}),s.details&&!s.details.live)return;var T=this.switchParams(s.url,a==null?void 0:a.details);this.loadPlaylist(T)},o.selectInitialTrack=function(){var l=this.tracksInGroup;console.assert(l.length,"Initial audio track should be selected when tracks are known");var h=this.trackName,a=this.findTrackId(h)||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:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(l){for(var h=this.tracksInGroup,a=0;au.partTarget&&(s+=1)}if(Object(X.isFiniteNumber)(a))return new U.HlsUrlParameters(a,Object(X.isFiniteNumber)(s)?s:void 0,U.HlsSkip.No)}}},g.loadPlaylist=function(m){},g.shouldLoadTrack=function(m){return this.canLoad&&m&&!!m.url&&(!m.details||m.details.live)},g.playlistLoaded=function(m,u,o){var f=this,l=u.details,h=u.stats,a=h.loading.end?Math.max(0,self.performance.now()-h.loading.end):0;if(l.advancedDateTime=Date.now()-a,l.live||o!=null&&o.live){if(l.reloaded(o),o&&this.log("live playlist "+m+" "+(l.advanced?"REFRESHED "+l.lastPartSn+"-"+l.lastPartIndex:"MISSED")),o&&l.fragments.length>0&&Object(k.mergeDetails)(o,l),!this.canLoad||!l.live)return;var s,A=void 0,E=void 0;if(l.canBlockReload&&l.endSN&&l.advanced){var S=this.hls.config.lowLatencyMode,L=l.lastPartSn,O=l.endSN,C=l.lastPartIndex,T=C!==-1,x=L===O,c=S?0:C;T?(A=x?O+1:L,E=x?c:C+1):A=O+1;var w=l.age,v=w+l.ageHeader,y=Math.min(v-l.partTarget,l.targetduration*1.5);if(y>0){if(o&&y>o.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+o.tuneInGoal+" to: "+y+" with playlist age: "+l.age),y=0;else{var F=Math.floor(y/l.targetduration);if(A+=F,E!==void 0){var B=Math.round(y%l.targetduration/l.partTarget);E+=B}this.log("CDN Tune-in age: "+l.ageHeader+"s last advanced "+w.toFixed(2)+"s goal: "+y+" skip sn "+F+" to part "+E)}l.tuneInGoal=y}if(s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,E),S||!x){this.loadPlaylist(s);return}}else s=this.getDeliveryDirectives(l,u.deliveryDirectives,A,E);var R=Object(k.computeReloadInterval)(l,h);A!==void 0&&l.canBlockReload&&(R-=l.partTarget||1),this.log("reload live playlist "+m+" in "+Math.round(R)+" ms"),this.timer=self.setTimeout(function(){return f.loadPlaylist(s)},R)}else this.clearTimer()},g.getDeliveryDirectives=function(m,u,o,f){var l=Object(U.getSkipValue)(m,o);return u!=null&&u.skip&&m.deltaUpdateFailed&&(o=u.msn,f=u.part,l=U.HlsSkip.No),new U.HlsUrlParameters(o,f,l)},g.retryLoadingOrFail=function(m){var u=this,o=this.hls.config,f=this.retryCount-1&&(l=m.context)!==null&&l!==void 0&&l.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+m.details+'"'),this.loadPlaylist();else{var h=Math.min(Math.pow(2,this.retryCount)*o.levelLoadingRetryDelay,o.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return u.loadPlaylist()},h),this.warn("retry playlist loading #"+this.retryCount+" in "+h+' ms after "'+m.details+'"')}}else this.warn('cannot recover from error "'+m.details+'"'),this.clearTimer(),m.fatal=!0;return f},D}()},"./src/controller/base-stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"State",function(){return O}),P.d($,"default",function(){return C});var X=P("./src/polyfills/number.ts"),U=P("./src/task-loop.ts"),k=P("./src/controller/fragment-tracker.ts"),G=P("./src/utils/buffer-helper.ts"),W=P("./src/utils/logger.ts"),i=P("./src/events.ts"),D=P("./src/errors.ts"),g=P("./src/types/transmuxer.ts"),p=P("./src/utils/mp4-tools.ts"),m=P("./src/utils/discontinuities.ts"),u=P("./src/controller/fragment-finders.ts"),o=P("./src/controller/level-helper.ts"),f=P("./src/loader/fragment-loader.ts"),l=P("./src/crypt/decrypter.ts"),h=P("./src/utils/time-ranges.ts"),a=P("./src/types/loader.ts");function s(T,x){for(var c=0;cee;(j0&&j&&j.key&&j.iv&&j.method==="AES-128"){var N=self.performance.now();return y.decrypter.webCryptoDecrypt(new Uint8Array(R),j.key.buffer,j.iv.buffer).then(function(b){var Y=self.performance.now();return B.trigger(i.Events.FRAG_DECRYPTED,{frag:v,payload:b,stats:{tstart:N,tdecrypt:Y}}),F.payload=b,F})}return F}).then(function(F){var B=y.fragCurrent,R=y.hls,j=y.levels;if(!j)throw new Error("init load aborted, missing levels");var N=j[v.level].details;console.assert(N,"Level details are defined when init segment is loaded");var b=v.stats;y.state=O.IDLE,y.fragLoadError=0,v.data=new Uint8Array(F.payload),b.parsing.start=b.buffering.start=self.performance.now(),b.parsing.end=b.buffering.end=self.performance.now(),F.frag===B&&R.trigger(i.Events.FRAG_BUFFERED,{stats:b,frag:B,part:null,id:v.type}),y.tick()}).catch(function(F){y.warn(F),y.resetFragmentLoading(v)})},c.fragContextChanged=function(v){var y=this.fragCurrent;return!v||!y||v.level!==y.level||v.sn!==y.sn||v.urlId!==y.urlId},c.fragBufferedComplete=function(v,y){var F=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+v.type+" sn: "+v.sn+(y?" part: "+y.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+v.level+" "+h.default.toString(G.BufferHelper.getBuffered(F))),this.state=O.IDLE,this.tick()},c._handleFragmentLoadComplete=function(v){var y=this.transmuxer;if(!y)return;var F=v.frag,B=v.part,R=v.partsLoaded,j=!R||R.length===0||R.some(function(b){return!b}),N=new g.ChunkMetadata(F.level,F.sn,F.stats.chunkCount+1,0,B?B.index:-1,!j);y.flush(N)},c._handleFragmentLoadProgress=function(v){},c._doFragLoad=function(v,y,F,B){var R=this;if(F===void 0&&(F=null),!this.levels)throw new Error("frag load aborted, missing levels");if(F=Math.max(v.start,F||0),this.config.lowLatencyMode&&y){var j=y.partList;if(j&&B){F>v.end&&y.fragmentHint&&(v=y.fragmentHint);var N=this.getNextPart(j,v,F);if(N>-1){var b=j[N];return this.log("Loading part sn: "+v.sn+" p: "+b.index+" cc: "+v.cc+" of playlist ["+y.startSN+"-"+y.endSN+"] parts [0-"+N+"-"+(j.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),this.nextLoadPosition=b.start+b.duration,this.state=O.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:v,part:j[N],targetBufferTime:F}),this.doFragPartsLoad(v,j,N,B).catch(function(Y){return R.handleFragLoadError(Y)})}else if(!v.url||this.loadedEndOfParts(j,F))return Promise.resolve(null)}}return this.log("Loading fragment "+v.sn+" cc: "+v.cc+" "+(y?"of ["+y.startSN+"-"+y.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+v.level+", target: "+parseFloat(F.toFixed(3))),Object(X.isFiniteNumber)(v.sn)&&!this.bitrateTest&&(this.nextLoadPosition=v.start+v.duration),this.state=O.FRAG_LOADING,this.hls.trigger(i.Events.FRAG_LOADING,{frag:v,targetBufferTime:F}),this.fragmentLoader.load(v,B).catch(function(Y){return R.handleFragLoadError(Y)})},c.doFragPartsLoad=function(v,y,F,B){var R=this;return new Promise(function(j,N){var b=[],Y=function ee(ae){var ue=y[ae];R.fragmentLoader.loadPart(v,ue,B).then(function(Oe){b[ue.index]=Oe;var Ee=Oe.part;R.hls.trigger(i.Events.FRAG_LOADED,Oe);var xe=y[ae+1];if(xe&&xe.fragment===v)ee(ae+1);else return j({frag:v,part:Ee,partsLoaded:b})}).catch(N)};Y(F)})},c.handleFragLoadError=function(v){var y=v.data;return y&&y.details===D.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(y.frag,y.part):this.hls.trigger(i.Events.ERROR,y),null},c._handleTransmuxerFlush=function(v){var y=this.getCurrentContext(v);if(!y||this.state!==O.PARSING){this.fragCurrent||(this.state=O.IDLE);return}var F=y.frag,B=y.part,R=y.level,j=self.performance.now();F.stats.parsing.end=j,B&&(B.stats.parsing.end=j),this.updateLevelTiming(F,B,R,v.partial)},c.getCurrentContext=function(v){var y=this.levels,F=v.level,B=v.sn,R=v.part;if(!y||!y[F])return this.warn("Levels object was unset while buffering fragment "+B+" of level "+F+". The current chunk will not be buffered."),null;var j=y[F],N=R>-1?Object(o.getPartWith)(j,B,R):null,b=N?N.fragment:Object(o.getFragmentWithSN)(j,B,this.fragCurrent);return b?{frag:b,part:N,level:j}:null},c.bufferFragmentData=function(v,y,F,B){if(!v||this.state!==O.PARSING)return;var R=v.data1,j=v.data2,N=R;if(R&&j&&(N=Object(p.appendUint8Array)(R,j)),!N||!N.length)return;var b={type:v.type,frag:y,part:F,chunkMeta:B,parent:y.type,data:N};this.hls.trigger(i.Events.BUFFER_APPENDING,b),v.dropped&&v.independent&&!F&&this.flushBufferGap(y)},c.flushBufferGap=function(v){var y=this.media;if(!y)return;if(!G.BufferHelper.isBuffered(y,y.currentTime)){this.flushMainBuffer(0,v.start);return}var F=y.currentTime,B=G.BufferHelper.bufferInfo(y,F,0),R=v.duration,j=Math.min(this.config.maxFragLookUpTolerance*2,R*.25),N=Math.max(Math.min(v.start-j,B.end-j),F+j);v.start-N>j&&this.flushMainBuffer(N,v.start)},c.getFwdBufferInfo=function(v,y){var F=this.config,B=this.getLoadPosition();if(!Object(X.isFiniteNumber)(B))return null;var R=G.BufferHelper.bufferInfo(v,B,F.maxBufferHole);if(R.len===0&&R.nextStart!==void 0){var j=this.fragmentTracker.getBufferedFrag(B,y);if(j&&R.nextStart=F?(y.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+y.maxMaxBufferLength+"s"),!0):!1},c.getNextFragment=function(v,y){var F,B,R=y.fragments,j=R.length;if(!j)return null;var N=this.config,b=R[0].start,Y;if(y.live){var ee=N.initialLiveManifestSize;if(j-1&&FF.start&&F.loaded},c.getInitialLiveFragment=function(v,y){var F=this.fragPrevious,B=null;if(F){if(v.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+F.programDateTime),B=Object(u.findFragmentByPDT)(y,F.endProgramDateTime,this.config.maxFragLookUpTolerance)),!B){var R=F.sn+1;if(R>=v.startSN&&R<=v.endSN){var j=y[R-v.startSN];F.cc===j.cc&&(B=j,this.log("Live playlist, switching playlist, load frag with next SN: "+B.sn))}B||(B=Object(u.findFragWithCC)(y,F.cc),B&&this.log("Live playlist, switching playlist, load frag with same CC: "+B.sn))}}else{var N=this.hls.liveSyncPosition;N!==null&&(B=this.getFragmentAtPosition(N,this.bitrateTest?v.fragmentEnd:v.edge,v))}return B},c.getFragmentAtPosition=function(v,y,F){var B=this.config,R=this.fragPrevious,j=F.fragments,N=F.endSN,b=F.fragmentHint,Y=B.maxFragLookUpTolerance,ee=!!(B.lowLatencyMode&&F.partList&&b);ee&&b&&!this.bitrateTest&&(j=j.concat(b),N=b.sn);var ae;if(vy-Y?0:Y;ae=Object(u.findFragmentByPTS)(R,j,v,ue)}else ae=j[j.length-1];if(ae){var Oe=ae.sn-F.startSN,Ee=R&&ae.level===R.level,xe=j[Oe+1],Ae=this.fragmentTracker.getState(ae);if(Ae===k.FragmentState.BACKTRACKED){ae=null;for(var Re=Oe;j[Re]&&this.fragmentTracker.getState(j[Re])===k.FragmentState.BACKTRACKED;)R?ae=j[Re--]:ae=j[--Re];ae||(ae=xe)}else R&&ae.sn===R.sn&&!ee&&(Ee&&(ae.sn=j-y.maxFragLookUpTolerance&&R<=N;if(B!==null&&F.duration>B&&(R"+v.startSN+" prev-sn: "+(R?R.sn:"na")+" fragments: "+N),ae}return b},c.waitForCdnTuneIn=function(v){var y=3;return v.live&&v.canBlockReload&&v.tuneInGoal>Math.max(v.partHoldBack,v.partTarget*y)},c.setStartPosition=function(v,y){var F=this.startPosition;if(F"+v))}}]),x}(U.default)},"./src/controller/buffer-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var X=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),k=P("./src/utils/logger.ts"),G=P("./src/errors.ts"),W=P("./src/utils/buffer-helper.ts"),i=P("./src/utils/mediasource-helper.ts"),D=P("./src/loader/fragment.ts"),g=P("./src/controller/buffer-operation-queue.ts"),p=Object(i.getMediaSource)(),m=/([ha]vc.)(?:\.[^.,]+)+/,u=function(){function o(l){var h=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=h.hls,s=h.media,A=h.mediaSource;k.logger.log("[buffer-controller]: Media source opened"),s&&(h.updateMediaElementDuration(),a.trigger(U.Events.MEDIA_ATTACHED,{media:s})),A&&A.removeEventListener("sourceopen",h._onMediaSourceOpen),h.checkPendingTracks()},this._onMediaSourceClose=function(){k.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){k.logger.log("[buffer-controller]: Media source ended")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var f=o.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 h=this.hls;h.on(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.on(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(U.Events.BUFFER_RESET,this.onBufferReset,this),h.on(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.on(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.on(U.Events.BUFFER_EOS,this.onBufferEos,this),h.on(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.on(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.on(U.Events.FRAG_PARSED,this.onFragParsed,this),h.on(U.Events.FRAG_CHANGED,this.onFragChanged,this)},f.unregisterListeners=function(){var h=this.hls;h.off(U.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),h.off(U.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(U.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(U.Events.BUFFER_RESET,this.onBufferReset,this),h.off(U.Events.BUFFER_APPENDING,this.onBufferAppending,this),h.off(U.Events.BUFFER_CODECS,this.onBufferCodecs,this),h.off(U.Events.BUFFER_EOS,this.onBufferEos,this),h.off(U.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),h.off(U.Events.LEVEL_UPDATED,this.onLevelUpdated,this),h.off(U.Events.FRAG_PARSED,this.onFragParsed,this),h.off(U.Events.FRAG_CHANGED,this.onFragChanged,this)},f._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},f.onManifestParsed=function(h,a){var s=2;(a.audio&&!a.video||!a.altAudio)&&(s=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=s,this.details=null,k.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},f.onMediaAttaching=function(h,a){var s=this.media=a.media;if(s&&p){var A=this.mediaSource=new p;A.addEventListener("sourceopen",this._onMediaSourceOpen),A.addEventListener("sourceended",this._onMediaSourceEnded),A.addEventListener("sourceclose",this._onMediaSourceClose),s.src=self.URL.createObjectURL(A),this._objectUrl=s.src}},f.onMediaDetaching=function(){var h=this.media,a=this.mediaSource,s=this._objectUrl;if(a){if(k.logger.log("[buffer-controller]: media source detaching"),a.readyState==="open")try{a.endOfStream()}catch(A){k.logger.warn("[buffer-controller]: onMediaDetaching: "+A.message+" while calling endOfStream")}this.onBufferReset(),a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),h&&(s&&self.URL.revokeObjectURL(s),h.src===s?(h.removeAttribute("src"),h.load()):k.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(U.Events.MEDIA_DETACHED,void 0)},f.onBufferReset=function(){var h=this;this.getSourceBufferTypes().forEach(function(a){var s=h.sourceBuffer[a];try{s&&(h.removeBufferListeners(a),h.mediaSource&&h.mediaSource.removeSourceBuffer(s),h.sourceBuffer[a]=void 0)}catch(A){k.logger.warn("[buffer-controller]: Failed to reset the "+a+" buffer",A)}}),this._initSourceBuffer()},f.onBufferCodecs=function(h,a){var s=this,A=this.getSourceBufferTypes().length;if(Object.keys(a).forEach(function(E){if(A){var S=s.tracks[E];if(S&&typeof S.buffer.changeType=="function"){var L=a[E],O=L.codec,C=L.levelCodec,T=L.container,x=(S.levelCodec||S.codec).replace(m,"$1"),c=(C||O).replace(m,"$1");if(x!==c){var w=T+";codecs="+(C||O);s.appendChangeType(E,w)}}}else s.pendingTracks[E]=a[E]}),A)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},f.appendChangeType=function(h,a){var s=this,A=this.operationQueue,E={execute:function(){var L=s.sourceBuffer[h];L&&(k.logger.log("[buffer-controller]: changing "+h+" sourceBuffer type to "+a),L.changeType(a)),A.shiftAndExecuteNext(h)},onStart:function(){},onComplete:function(){},onError:function(L){k.logger.warn("[buffer-controller]: Failed to change "+h+" SourceBuffer type",L)}};A.append(E,h)},f.onBufferAppending=function(h,a){var s=this,A=this.hls,E=this.operationQueue,S=this.tracks,L=a.data,O=a.type,C=a.frag,T=a.part,x=a.chunkMeta,c=x.buffering[O],w=self.performance.now();c.start=w;var v=C.stats.buffering,y=T?T.stats.buffering:null;v.start===0&&(v.start=w),y&&y.start===0&&(y.start=w);var F=S.audio,B=O==="audio"&&x.id===1&&(F==null?void 0:F.container)==="audio/mpeg",R={execute:function(){if(c.executeStart=self.performance.now(),B){var N=s.sourceBuffer[O];if(N){var b=C.start-N.timestampOffset;Math.abs(b)>=.1&&(k.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+C.start+" (delta: "+b+") sn: "+C.sn+")"),N.timestampOffset=C.start)}}s.appendExecutor(L,O)},onStart:function(){},onComplete:function(){var N=self.performance.now();c.executeEnd=c.end=N,v.first===0&&(v.first=N),y&&y.first===0&&(y.first=N);var b=s.sourceBuffer,Y={};for(var ee in b)Y[ee]=W.BufferHelper.getBuffered(b[ee]);s.appendError=0,s.hls.trigger(U.Events.BUFFER_APPENDED,{type:O,frag:C,part:T,chunkMeta:x,parent:C.type,timeRanges:Y})},onError:function(N){k.logger.error("[buffer-controller]: Error encountered while trying to append to the "+O+" SourceBuffer",N);var b={type:G.ErrorTypes.MEDIA_ERROR,parent:C.type,details:G.ErrorDetails.BUFFER_APPEND_ERROR,err:N,fatal:!1};N.code===DOMException.QUOTA_EXCEEDED_ERR?b.details=G.ErrorDetails.BUFFER_FULL_ERROR:(s.appendError++,b.details=G.ErrorDetails.BUFFER_APPEND_ERROR,s.appendError>A.config.appendErrorMaxRetry&&(k.logger.error("[buffer-controller]: Failed "+A.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),b.fatal=!0)),A.trigger(U.Events.ERROR,b)}};E.append(R,O)},f.onBufferFlushing=function(h,a){var s=this,A=this.operationQueue,E=function(L){return{execute:s.removeExecutor.bind(s,L,a.startOffset,a.endOffset),onStart:function(){},onComplete:function(){s.hls.trigger(U.Events.BUFFER_FLUSHED,{type:L})},onError:function(C){k.logger.warn("[buffer-controller]: Failed to remove from "+L+" SourceBuffer",C)}}};a.type?A.append(E(a.type),a.type):this.getSourceBufferTypes().forEach(function(S){A.append(E(S),S)})},f.onFragParsed=function(h,a){var s=this,A=a.frag,E=a.part,S=[],L=E?E.elementaryStreams:A.elementaryStreams;L[D.ElementaryStreamTypes.AUDIOVIDEO]?S.push("audiovideo"):(L[D.ElementaryStreamTypes.AUDIO]&&S.push("audio"),L[D.ElementaryStreamTypes.VIDEO]&&S.push("video"));var O=function(){var T=self.performance.now();A.stats.buffering.end=T,E&&(E.stats.buffering.end=T);var x=E?E.stats:A.stats;s.hls.trigger(U.Events.FRAG_BUFFERED,{frag:A,part:E,stats:x,id:A.type})};S.length===0&&k.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+A.type+" level: "+A.level+" sn: "+A.sn),this.blockBuffers(O,S)},f.onFragChanged=function(h,a){this.flushBackBuffer()},f.onBufferEos=function(h,a){var s=this,A=this.getSourceBufferTypes().reduce(function(E,S){var L=s.sourceBuffer[S];return(!a.type||a.type===S)&&(L&&!L.ended&&(L.ended=!0,k.logger.log("[buffer-controller]: "+S+" sourceBuffer now EOS"))),E&&!!(!L||L.ended)},!0);A&&this.blockBuffers(function(){var E=s.mediaSource;if(!E||E.readyState!=="open")return;E.endOfStream()})},f.onLevelUpdated=function(h,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 h=this.hls,a=this.details,s=this.media,A=this.sourceBuffer;if(!s||a===null)return;var E=this.getSourceBufferTypes();if(!E.length)return;var S=a.live&&h.config.liveBackBufferLength!==null?h.config.liveBackBufferLength:h.config.backBufferLength;if(!Object(X.isFiniteNumber)(S)||S<0)return;var L=s.currentTime,O=a.levelTargetDuration,C=Math.max(S,O),T=Math.floor(L/O)*O-C;E.forEach(function(x){var c=A[x];if(c){var w=W.BufferHelper.getBuffered(c);w.length>0&&T>w.start(0)&&(h.trigger(U.Events.BACK_BUFFER_REACHED,{bufferEnd:T}),a.live&&h.trigger(U.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:T}),h.trigger(U.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:T,type:x}))}})},f.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var h=this.details,a=this.hls,s=this.media,A=this.mediaSource,E=h.fragments[0].start+h.totalduration,S=s.duration,L=Object(X.isFiniteNumber)(A.duration)?A.duration:0;h.live&&a.config.liveDurationInfinity?(k.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),A.duration=Infinity,this.updateSeekableRange(h)):(E>L&&E>S||!Object(X.isFiniteNumber)(S))&&(k.logger.log("[buffer-controller]: Updating Media Source duration to "+E.toFixed(3)),A.duration=E)},f.updateSeekableRange=function(h){var a=this.mediaSource,s=h.fragments,A=s.length;if(A&&h.live&&a!==null&&a!==void 0&&a.setLiveSeekableRange){var E=Math.max(0,s[0].start),S=Math.max(E,E+h.totalduration);a.setLiveSeekableRange(E,S)}},f.checkPendingTracks=function(){var h=this.bufferCodecEventsExpected,a=this.operationQueue,s=this.pendingTracks,A=Object.keys(s).length;if(A&&!h||A===2){this.createSourceBuffers(s),this.pendingTracks={};var E=this.getSourceBufferTypes();if(E.length===0){this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}E.forEach(function(S){a.executeNext(S)})}},f.createSourceBuffers=function(h){var a=this.sourceBuffer,s=this.mediaSource;if(!s)throw Error("createSourceBuffers called when mediaSource was null");var A=0;for(var E in h)if(!a[E]){var S=h[E];if(!S)throw Error("source buffer exists for track "+E+", however track does not");var L=S.levelCodec||S.codec,O=S.container+";codecs="+L;k.logger.log("[buffer-controller]: creating sourceBuffer("+O+")");try{var C=a[E]=s.addSourceBuffer(O),T=E;this.addBufferListener(T,"updatestart",this._onSBUpdateStart),this.addBufferListener(T,"updateend",this._onSBUpdateEnd),this.addBufferListener(T,"error",this._onSBUpdateError),this.tracks[E]={buffer:C,codec:L,container:S.container,levelCodec:S.levelCodec,id:S.id},A++}catch(x){k.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+x.message),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:x,mimeType:O})}}A&&this.hls.trigger(U.Events.BUFFER_CREATED,{tracks:this.tracks})},f._onSBUpdateStart=function(h){var a=this.operationQueue,s=a.current(h);s.onStart()},f._onSBUpdateEnd=function(h){var a=this.operationQueue,s=a.current(h);s.onComplete(),a.shiftAndExecuteNext(h)},f._onSBUpdateError=function(h,a){k.logger.error("[buffer-controller]: "+h+" SourceBuffer error",a),this.hls.trigger(U.Events.ERROR,{type:G.ErrorTypes.MEDIA_ERROR,details:G.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var s=this.operationQueue.current(h);s&&s.onError(a)},f.removeExecutor=function(h,a,s){var A=this.media,E=this.mediaSource,S=this.operationQueue,L=this.sourceBuffer,O=L[h];if(!A||!E||!O){k.logger.warn("[buffer-controller]: Attempting to remove from the "+h+" SourceBuffer, but it does not exist"),S.shiftAndExecuteNext(h);return}var C=Object(X.isFiniteNumber)(A.duration)?A.duration:Infinity,T=Object(X.isFiniteNumber)(E.duration)?E.duration:Infinity,x=Math.max(0,a),c=Math.min(s,C,T);c>x?(k.logger.log("[buffer-controller]: Removing ["+x+","+c+"] from the "+h+" SourceBuffer"),console.assert(!O.updating,h+" sourceBuffer must not be updating"),O.remove(x,c)):S.shiftAndExecuteNext(h)},f.appendExecutor=function(h,a){var s=this.operationQueue,A=this.sourceBuffer,E=A[a];if(!E){k.logger.warn("[buffer-controller]: Attempting to append to the "+a+" SourceBuffer, but it does not exist"),s.shiftAndExecuteNext(a);return}E.ended=!1,console.assert(!E.updating,a+" sourceBuffer must not be updating"),E.appendBuffer(h)},f.blockBuffers=function(h,a){var s=this;if(a===void 0&&(a=this.getSourceBufferTypes()),!a.length){k.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(h);return}var A=this.operationQueue,E=a.map(function(S){return A.appendBlocker(S)});Promise.all(E).then(function(){h(),a.forEach(function(S){var L=s.sourceBuffer[S];(!L||!L.updating)&&A.shiftAndExecuteNext(S)})})},f.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},f.addBufferListener=function(h,a,s){var A=this.sourceBuffer[h];if(!A)return;var E=s.bind(this,h);this.listeners[h].push({event:a,listener:E}),A.addEventListener(a,E)},f.removeBufferListeners=function(h){var a=this.sourceBuffer[h];if(!a)return;this.listeners[h].forEach(function(s){a.removeEventListener(s.event,s.listener)})},o}()},"./src/controller/buffer-operation-queue.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return U});var X=P("./src/utils/logger.ts"),U=function(){function k(W){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=W}var G=k.prototype;return G.append=function(i,D){var g=this.queues[D];g.push(i),g.length===1&&this.buffers[D]&&this.executeNext(D)},G.insertAbort=function(i,D){var g=this.queues[D];g.unshift(i),this.executeNext(D)},G.appendBlocker=function(i){var D,g=new Promise(function(m){D=m}),p={execute:D,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,i),g},G.executeNext=function(i){var D=this.buffers,g=this.queues,p=D[i],m=g[i];if(m.length){var u=m[0];try{u.execute()}catch(o){X.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),u.onError(o),(!p||!p.updating)&&(m.shift(),this.executeNext(i))}}},G.shiftAndExecuteNext=function(i){this.queues[i].shift(),this.executeNext(i)},G.current=function(i){return this.queues[i][0]},k}()},"./src/controller/cap-level-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts");function U(W,i){for(var D=0;D0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(g.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},i.getMaxLevel=function(g){var p=this,m=this.hls.levels;if(!m.length)return-1;var u=m.filter(function(o,f){return W.isLevelAllowed(f,p.restrictedLevels)&&f<=g});return this.clientRect=null,W.getMaxLevelByMediaSize(u,this.mediaWidth,this.mediaHeight)},i.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()},i.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},i.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,p={width:0,height:0};if(g){var m=g.getBoundingClientRect();p.width=m.width,p.height=m.height,!p.width&&!p.height&&(p.width=m.right-m.left||g.width||0,p.height=m.bottom-m.top||g.height||0)}return this.clientRect=p,p},W.isLevelAllowed=function(g,p){return p===void 0&&(p=[]),p.indexOf(g)===-1},W.getMaxLevelByMediaSize=function(g,p,m){if(!g||!g.length)return-1;for(var u=function(a,s){return s?a.width!==s.width||a.height!==s.height:!0},o=g.length-1,f=0;f=p||l.height>=m)&&u(l,g[f+1])){o=f;break}}return o},k(W,[{key:"mediaWidth",get:function(){return this.getDimensions().width*W.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*W.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(p){}return g}}]),W}();$.default=G},"./src/controller/cmcd-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var X=P("./src/events.ts"),U=P("./src/types/cmcd.ts"),k=P("./src/utils/buffer-helper.ts"),G=P("./src/utils/logger.ts");function W(o,f){for(var l=0;l=o.length?{done:!0}:{done:!1,value:o[h++]}}}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 g(o,f){if(!o)return;if(typeof o=="string")return p(o,f);var l=Object.prototype.toString.call(o).slice(8,-1);if(l==="Object"&&o.constructor&&(l=o.constructor.name),l==="Map"||l==="Set")return Array.from(o);if(l==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(l))return p(o,f)}function p(o,f){(f==null||f>o.length)&&(f=o.length);for(var l=0,h=new Array(f);la&&(a=S.bitrate)}return a>0?a:NaN},f.getBufferLength=function(h){var a=this.hls.media,s=h===U.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!s||!a)return NaN;var A=k.BufferHelper.bufferInfo(s,a.currentTime,this.config.maxBufferHole);return A.len*1e3},f.createPlaylistLoader=function(){var h=this.config.pLoader,a=this.applyPlaylistData,s=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new s(S)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(L,O,C){a(L),this.loader.load(L,O,C)},i(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},f.createFragmentLoader=function(){var h=this.config.fLoader,a=this.applyFragmentData,s=h||this.config.loader;return function(){function A(S){this.loader=void 0,this.loader=new s(S)}var E=A.prototype;return E.destroy=function(){this.loader.destroy()},E.abort=function(){this.loader.abort()},E.load=function(L,O,C){a(L),this.loader.load(L,O,C)},i(A,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),A}()},o.uuid=function(){var h=URL.createObjectURL(new Blob),a=h.toString();return URL.revokeObjectURL(h),a.substr(a.lastIndexOf("/")+1)},o.serialize=function(h){for(var a=[],s=function(B){return!Number.isNaN(B)&&B!=null&&B!==""&&B!==!1},A=function(B){return Math.round(B)},E=function(B){return A(B/100)*100},S=function(B){return encodeURIComponent(B)},L={br:A,d:A,bl:E,dl:E,mtp:E,nor:S,rtp:E,tb:A},O=Object.keys(h||{}).sort(),C=D(O),T;!(T=C()).done;){var x=T.value,c=h[x];if(!s(c))continue;if(x==="v"&&c===1)continue;if(x=="pr"&&c===1)continue;var w=L[x];w&&(c=w(c));var v=typeof c,y=void 0;x==="ot"||x==="sf"||x==="st"?y=x+"="+c:v==="boolean"?y=x:v==="number"?y=x+"="+c:y=x+"="+JSON.stringify(c),a.push(y)}return a.join(",")},o.toHeaders=function(h){for(var a=Object.keys(h),s={},A=["Object","Request","Session","Status"],E=[{},{},{},{}],S={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},L=0,O=a;LD){this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var S=D-this._requestLicenseFailureCount+1;k.logger.warn("Retrying license request, "+S+" attempts left"),this._requestLicense(a,s)}break}},o._generateLicenseRequestChallenge=function(l,h){switch(l.mediaKeySystemDomain){case G.KeySystems.WIDEVINE:return h}throw new Error("unsupported key-system: "+l.mediaKeySystemDomain)},o._requestLicense=function(l,h){k.logger.log("Requesting content license for key-system");var a=this._mediaKeysList[0];if(!a){k.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var s=this.getLicenseServerUrl(a.mediaKeySystemDomain),A=this._createLicenseXhr(s,l,h);k.logger.log("Sending license request to URL: "+s);var E=this._generateLicenseRequestChallenge(a,l);A.send(E)}catch(S){k.logger.error("Failure requesting DRM license: "+S),this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.KEY_SYSTEM_ERROR,details:U.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},o.onMediaAttached=function(l,h){if(!this._emeEnabled)return;var a=h.media;this._media=a,a.addEventListener("encrypted",this._onMediaEncrypted)},o.onMediaDetached=function(){var l=this._media,h=this._mediaKeysList;if(!l)return;l.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(h.map(function(a){if(a.mediaKeysSession)return a.mediaKeysSession.close().catch(function(){})})).then(function(){return l.setMediaKeys(null)}).catch(function(){})},o.onManifestParsed=function(l,h){if(!this._emeEnabled)return;var a=h.levels.map(function(A){return A.audioCodec}).filter(function(A){return!!A}),s=h.levels.map(function(A){return A.videoCodec}).filter(function(A){return!!A});this._attemptKeySystemAccess(G.KeySystems.WIDEVINE,a,s)},i(u,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),u}();$.default=m},"./src/controller/fps-controller.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/events.ts"),U=P("./src/utils/logger.ts"),k=function(){function G(i){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=i,this.registerListeners()}var W=G.prototype;return W.setStreamController=function(D){this.streamController=D},W.registerListeners=function(){this.hls.on(X.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},W.unregisterListeners=function(){this.hls.off(X.Events.MEDIA_ATTACHING,this.onMediaAttaching)},W.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},W.onMediaAttaching=function(D,g){var p=this.hls.config;if(p.capLevelOnFPSDrop){var m=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=m,m&&typeof m.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),p.fpsDroppedMonitoringPeriod)}},W.checkFPS=function(D,g,p){var m=performance.now();if(g){if(this.lastTime){var u=m-this.lastTime,o=p-this.lastDroppedFrames,f=g-this.lastDecodedFrames,l=1e3*o/u,h=this.hls;if(h.trigger(X.Events.FPS_DROP,{currentDropped:o,currentDecoded:f,totalDroppedFrames:p}),l>0&&o>h.config.fpsDroppedMonitoringThreshold*f){var a=h.currentLevel;U.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+a),a>0&&(h.autoLevelCapping===-1||h.autoLevelCapping>=a)&&(a=a-1,h.trigger(X.Events.FPS_DROP_LEVEL_CAPPING,{level:a,droppedLevel:h.currentLevel}),h.autoLevelCapping=a,this.streamController.nextLevelSwitch())}}this.lastTime=m,this.lastDroppedFrames=p,this.lastDecodedFrames=g}},W.checkFPSInterval=function(){var D=this.media;if(D)if(this.isVideoPlaybackQualityAvailable){var g=D.getVideoPlaybackQuality();this.checkFPS(D,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(D,D.webkitDecodedFrameCount,D.webkitDroppedFrameCount)},G}();$.default=k},"./src/controller/fragment-finders.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFragmentByPDT",function(){return k}),P.d($,"findFragmentByPTS",function(){return G}),P.d($,"fragmentWithinToleranceTest",function(){return W}),P.d($,"pdtWithinToleranceTest",function(){return i}),P.d($,"findFragWithCC",function(){return D});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/binary-search.ts");function k(g,p,m){if(p===null||!Array.isArray(g)||!g.length||!Object(X.isFiniteNumber)(p))return null;var u=g[0].programDateTime;if(p<(u||0))return null;var o=g[g.length-1].endProgramDateTime;if(p>=(o||0))return null;m=m||0;for(var f=0;fg&&m.start?-1:0}function i(g,p,m){var u=Math.min(p,m.duration+(m.deltaPTS?m.deltaPTS:0))*1e3,o=m.endProgramDateTime||0;return o-u>g}function D(g,p){return U.default.search(g,function(m){return m.ccp?-1:0})}},"./src/controller/fragment-tracker.ts":function(re,$,P){"use strict";P.r($),P.d($,"FragmentState",function(){return k}),P.d($,"FragmentTracker",function(){return G});var X=P("./src/events.ts"),U=P("./src/types/loader.ts"),k;(function(D){D.NOT_LOADED="NOT_LOADED",D.BACKTRACKED="BACKTRACKED",D.APPENDING="APPENDING",D.PARTIAL="PARTIAL",D.OK="OK"})(k||(k={}));var G=function(){function D(p){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=p,this._registerListeners()}var g=D.prototype;return g._registerListeners=function(){var m=this.hls;m.on(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.on(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.on(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var m=this.hls;m.off(X.Events.BUFFER_APPENDED,this.onBufferAppended,this),m.off(X.Events.FRAG_BUFFERED,this.onFragBuffered,this),m.off(X.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(m,u){if(u===U.PlaylistLevelType.MAIN){var o=this.activeFragment,f=this.activeParts;if(!o)return null;if(f)for(var l=f.length;l--;){var h=f[l],a=h?h.end:o.appendedPTS;if(h.start<=m&&a!==void 0&&m<=a)return l>9&&(this.activeParts=f.slice(l-9)),h}else if(o.start<=m&&o.appendedPTS!==void 0&&m<=o.appendedPTS)return o}return this.getBufferedFrag(m,u)},g.getBufferedFrag=function(m,u){for(var o=this.fragments,f=Object.keys(o),l=f.length;l--;){var h=o[f[l]];if((h==null?void 0:h.body.type)===u&&h.buffered){var a=h.body;if(a.start<=m&&m<=a.end)return a}}return null},g.detectEvictedFragments=function(m,u,o){var f=this;Object.keys(this.fragments).forEach(function(l){var h=f.fragments[l];if(!h)return;if(!h.buffered){h.body.type===o&&f.removeFragment(h.body);return}var a=h.range[m];if(!a)return;a.time.some(function(s){var A=!f.isTimeBuffered(s.startPTS,s.endPTS,u);return A&&f.removeFragment(h.body),A})})},g.detectPartialFragments=function(m){var u=this,o=this.timeRanges,f=m.frag,l=m.part;if(!o||f.sn==="initSegment")return;var h=i(f),a=this.fragments[h];if(!a)return;Object.keys(o).forEach(function(s){var A=f.elementaryStreams[s];if(!A)return;var E=o[s],S=l!==null||A.partial===!0;a.range[s]=u.getBufferedTimes(f,l,S,E)}),a.backtrack=a.loaded=null,Object.keys(a.range).length?a.buffered=!0:this.removeFragment(a.body)},g.fragBuffered=function(m){var u=i(m),o=this.fragments[u];o&&(o.backtrack=o.loaded=null,o.buffered=!0)},g.getBufferedTimes=function(m,u,o,f){for(var l={time:[],partial:o},h=u?u.start:m.start,a=u?u.end:m.end,s=m.minEndPTS||a,A=m.maxStartPTS||h,E=0;E=S&&s<=L){l.time.push({startPTS:Math.max(h,f.start(E)),endPTS:Math.min(a,f.end(E))});break}else if(hS)l.partial=!0,l.time.push({startPTS:Math.max(h,f.start(E)),endPTS:Math.min(a,f.end(E))});else if(a<=S)break}return l},g.getPartialFragment=function(m){var u=null,o,f,l,h=0,a=this.bufferPadding,s=this.fragments;return Object.keys(s).forEach(function(A){var E=s[A];if(!E)return;W(E)&&(f=E.body.start-a,l=E.body.end+a,m>=f&&m<=l&&(o=Math.min(m-f,l-m),h<=o&&(u=E.body,h=o)))}),u},g.getState=function(m){var u=i(m),o=this.fragments[u];return o?o.buffered?W(o)?k.PARTIAL:k.OK:o.backtrack?k.BACKTRACKED:k.APPENDING:k.NOT_LOADED},g.backtrack=function(m,u){var o=i(m),f=this.fragments[o];if(!f||f.backtrack)return null;var l=f.backtrack=u||f.loaded;return f.loaded=null,l},g.getBacktrackData=function(m){var u=i(m),o=this.fragments[u];if(o){var f,l=o.backtrack;if(l!=null&&(f=l.payload)!==null&&f!==void 0&&f.byteLength)return l;this.removeFragment(m)}return null},g.isTimeBuffered=function(m,u,o){for(var f,l,h=0;h=f&&u<=l)return!0;if(u<=f)return!1}return!1},g.onFragLoaded=function(m,u){var o=u.frag,f=u.part;if(o.sn==="initSegment"||o.bitrateTest||f)return;var l=i(o);this.fragments[l]={body:o,loaded:u,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(m,u){var o=this,f=u.frag,l=u.part,h=u.timeRanges;if(f.type===U.PlaylistLevelType.MAIN)if(this.activeFragment=f,l){var a=this.activeParts;a||(this.activeParts=a=[]),a.push(l)}else this.activeParts=null;this.timeRanges=h,Object.keys(h).forEach(function(s){var A=h[s];if(o.detectEvictedFragments(s,A),!l)for(var E=0;Em&&f.removeFragment(a)}})},g.removeFragment=function(m){var u=i(m);m.stats.loaded=0,m.clearElementaryStreamInfo(),delete this.fragments[u]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},D}();function W(D){var g,p;return D.buffered&&(((g=D.range.video)===null||g===void 0?void 0:g.partial)||((p=D.range.audio)===null||p===void 0?void 0:p.partial))}function i(D){return D.type+"_"+D.level+"_"+D.urlId+"_"+D.sn}},"./src/controller/gap-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"STALL_MINIMUM_DURATION_MS",function(){return W}),P.d($,"MAX_START_GAP_JUMP",function(){return i}),P.d($,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return D}),P.d($,"SKIP_BUFFER_RANGE_START",function(){return g}),P.d($,"default",function(){return p});var X=P("./src/utils/buffer-helper.ts"),U=P("./src/errors.ts"),k=P("./src/events.ts"),G=P("./src/utils/logger.ts"),W=250,i=2,D=.1,g=.05,p=function(){function m(o,f,l,h){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=o,this.media=f,this.fragmentTracker=l,this.hls=h}var u=m.prototype;return u.destroy=function(){this.hls=this.fragmentTracker=this.media=null},u.poll=function(f){var l=this.config,h=this.media,a=this.stalled,s=h.currentTime,A=h.seeking,E=this.seeking&&!A,S=!this.seeking&&A;if(this.seeking=A,s!==f){if(this.moved=!0,a!==null){if(this.stallReported){var L=self.performance.now()-a;G.logger.warn("playback not stuck anymore @"+s+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((S||E)&&(this.stalled=null),h.paused||h.ended||h.playbackRate===0||!X.BufferHelper.getBuffered(h).length)return;var O=X.BufferHelper.bufferInfo(h,s,0),C=O.len>0,T=O.nextStart||0;if(!C&&!T)return;if(A){var x=O.len>i,c=!T||T-s>i&&!this.fragmentTracker.getPartialFragment(s);if(x||c)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var w,v=Math.max(T,O.start||0)-s,y=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,F=y==null||((w=y.details)===null||w===void 0)?void 0:w.live,B=F?y.details.targetduration*2:i;if(v>0&&v<=B){this._trySkipBufferHole(null);return}}var R=self.performance.now();if(a===null){this.stalled=R;return}var j=R-a;!A&&j>=W&&this._reportStall(O.len);var N=X.BufferHelper.bufferInfo(h,s,l.maxBufferHole);this._tryFixBufferStall(N,j)},u._tryFixBufferStall=function(f,l){var h=this.config,a=this.fragmentTracker,s=this.media,A=s.currentTime,E=a.getPartialFragment(A);if(E){var S=this._trySkipBufferHole(E);if(S)return}f.len>h.maxBufferHole&&l>h.highBufferWatchdogPeriod*1e3&&(G.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},u._reportStall=function(f){var l=this.hls,h=this.media,a=this.stallReported;a||(this.stallReported=!0,G.logger.warn("Playback stalling at @"+h.currentTime+" due to low buffer (buffer="+f+")"),l.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:f}))},u._trySkipBufferHole=function(f){for(var l=this.config,h=this.hls,a=this.media,s=a.currentTime,A=0,E=X.BufferHelper.getBuffered(a),S=0;S=A&&s.05&&this.forwardBufferLength>1){var S=Math.min(2,Math.max(1,h)),L=Math.round(2/(1+Math.exp(-.75*s-this.edgeStalled))*20)/20;m.playbackRate=Math.min(S,Math.max(1,L))}else m.playbackRate!==1&&m.playbackRate!==0&&(m.playbackRate=1)},g.estimateLiveEdge=function(){var m=this.levelDetails;return m===null?null:m.edge+m.age},g.computeLatency=function(){var m=this.estimateLiveEdge();return m===null?null:m-this.currentTime},W(D,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var m=this.config,u=this.levelDetails;return m.liveMaxLatencyDuration!==void 0?m.liveMaxLatencyDuration:u?m.liveMaxLatencyDurationCount*u.targetduration:0}},{key:"targetLatency",get:function(){var m=this.levelDetails;if(m===null)return null;var u=m.holdBack,o=m.partHoldBack,f=m.targetduration,l=this.config,h=l.liveSyncDuration,a=l.liveSyncDurationCount,s=l.lowLatencyMode,A=this.hls.userConfig,E=s&&o||u;(A.liveSyncDuration||A.liveSyncDurationCount||E===0)&&(E=h!==void 0?h:a*f);var S=f,L=1;return E+Math.min(this.stallCount*L,S)}},{key:"liveSyncPosition",get:function(){var m=this.estimateLiveEdge(),u=this.targetLatency,o=this.levelDetails;if(m===null||u===null||o===null)return null;var f=o.edge,l=m-u-this.edgeStalled,h=f-o.totalduration,a=f-(this.config.lowLatencyMode&&o.partTarget||o.targetduration);return Math.min(Math.max(h,l),a)}},{key:"drift",get:function(){var m=this.levelDetails;return m===null?1:m.drift}},{key:"edgeStalled",get:function(){var m=this.levelDetails;if(m===null)return 0;var u=(this.config.lowLatencyMode&&m.partTarget||m.targetduration)*3;return Math.max(m.age-u,0)}},{key:"forwardBufferLength",get:function(){var m=this.media,u=this.levelDetails;if(!m||!u)return 0;var o=m.buffered.length;return o?m.buffered.end(o-1):u.edge-this.currentTime}}]),D}()},"./src/controller/level-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return l});var X=P("./src/types/level.ts"),U=P("./src/events.ts"),k=P("./src/errors.ts"),G=P("./src/utils/codecs.ts"),W=P("./src/controller/level-helper.ts"),i=P("./src/controller/base-playlist-controller.ts"),D=P("./src/types/loader.ts");function g(){return g=Object.assign||function(h){for(var a=1;a0){T=L[0].bitrate,L.sort(function(j,N){return j.bitrate-N.bitrate}),this._levels=L;for(var F=0;Fthis.hls.config.fragLoadingMaxRetry&&(x=S.frag.level)):x=S.frag.level}break;case k.ErrorDetails.LEVEL_LOAD_ERROR:case k.ErrorDetails.LEVEL_LOAD_TIMEOUT:L&&(L.deliveryDirectives&&(T=!1),x=L.level),C=!0;break;case k.ErrorDetails.REMUX_ALLOC_ERROR:x=S.level,C=!0;break}x!==void 0&&this.recoverLevel(S,x,C,T)},s.recoverLevel=function(E,S,L,O){var C=E.details,T=this._levels[S];if(T.loadError++,L){var x=this.retryLoadingOrFail(E);if(x)E.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var c=T.url.length;if(c>1&&T.loadError1){var O=(S.urlId+1)%L;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(C){C.urlId=O}),this.level=E}},s.onFragLoaded=function(E,S){var L=S.frag;if(L!==void 0&&L.type===D.PlaylistLevelType.MAIN){var O=this._levels[L.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},s.onLevelLoaded=function(E,S){var L,O=S.level,C=S.details,T=this._levels[O];if(!T){var x;this.warn("Invalid level index "+O),(x=S.deliveryDirectives)!==null&&x!==void 0&&x.skip&&(C.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(T.fragmentError===0&&(T.loadError=0,this.retryCount=0),this.playlistLoaded(O,S,T.details)):(L=S.deliveryDirectives)!==null&&L!==void 0&&L.skip&&(C.deltaUpdateFailed=!0)},s.onAudioTrackSwitched=function(E,S){var L=this.hls.levels[this.currentLevelIndex];if(!L)return;if(L.audioGroupIds){for(var O=-1,C=this.hls.audioTracks[S.id].groupId,T=0;T0){var O=L.urlId,C=L.url[O];if(E)try{C=E.addDirectives(C)}catch(T){this.warn("Could not construct new URL with HLS Delivery Directives: "+T)}this.log("Attempt loading level index "+S+(E?" at sn "+E.msn+" part "+E.part:"")+" with URL-id "+O+" "+C),this.clearTimer(),this.hls.trigger(U.Events.LEVEL_LOADING,{url:C,level:S,id:O,deliveryDirectives:E||null})}},s.removeLevel=function(E,S){var L=function(T,x){return x!==S},O=this._levels.filter(function(C,T){return T!==E?!0:C.url.length>1&&S!==void 0?(C.url=C.url.filter(L),C.audioGroupIds&&(C.audioGroupIds=C.audioGroupIds.filter(L)),C.textGroupIds&&(C.textGroupIds=C.textGroupIds.filter(L)),C.urlId=0,!0):!1}).map(function(C,T){var x=C.details;return x!=null&&x.fragments&&x.fragments.forEach(function(c){c.level=T}),C});this._levels=O,this.hls.trigger(U.Events.LEVELS_UPDATED,{levels:O})},m(a,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(E){var S,L=this._levels;if(L.length===0)return;if(this.currentLevelIndex===E&&(S=L[E])!==null&&S!==void 0&&S.details)return;if(E<0||E>=L.length){var O=E<0;if(this.hls.trigger(U.Events.ERROR,{type:k.ErrorTypes.OTHER_ERROR,details:k.ErrorDetails.LEVEL_SWITCH_ERROR,level:E,fatal:O,reason:"invalid level idx"}),O)return;E=Math.min(E,L.length-1)}this.clearTimer();var C=this.currentLevelIndex,T=L[C],x=L[E];this.log("switching to level "+E+" from "+C),this.currentLevelIndex=E;var c=g({},x,{level:E,maxBitrate:x.maxBitrate,uri:x.uri,urlId:x.urlId});delete c._urlId,this.hls.trigger(U.Events.LEVEL_SWITCHING,c);var w=x.details;if(!w||w.live){var v=this.switchParams(x.uri,T==null?void 0:T.details);this.loadPlaylist(v)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(E){this.manualLevelIndex=E,this._startLevel===void 0&&(this._startLevel=E),E!==-1&&(this.level=E)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(E){this._firstLevel=E}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var E=this.hls.config.startLevel;return E!==void 0?E:this._firstLevel}else return this._startLevel},set:function(E){this._startLevel=E}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(E){this.level=E,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=E)}}]),a}(i.default)},"./src/controller/level-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"addGroupId",function(){return k}),P.d($,"assignTrackIdsByGroup",function(){return G}),P.d($,"updatePTS",function(){return W}),P.d($,"updateFragPTSDTS",function(){return D}),P.d($,"mergeDetails",function(){return g}),P.d($,"mapPartIntersection",function(){return p}),P.d($,"mapFragmentIntersection",function(){return m}),P.d($,"adjustSliding",function(){return u}),P.d($,"addSliding",function(){return o}),P.d($,"computeReloadInterval",function(){return f}),P.d($,"getFragmentWithSN",function(){return l}),P.d($,"getPartWith",function(){return h});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts");function k(a,s,A){switch(s){case"audio":a.audioGroupIds||(a.audioGroupIds=[]),a.audioGroupIds.push(A);break;case"text":a.textGroupIds||(a.textGroupIds=[]),a.textGroupIds.push(A);break}}function G(a){var s={};a.forEach(function(A){var E=A.groupId||"";A.id=s[E]=s[E]||0,s[E]++})}function W(a,s,A){var E=a[s],S=a[A];i(E,S)}function i(a,s){var A=s.startPTS;if(Object(X.isFiniteNumber)(A)){var E=0,S;s.sn>a.sn?(E=A-a.start,S=a):(E=a.start-A,S=s),S.duration!==E&&(S.duration=E)}else if(s.sn>a.sn){var L=a.cc===s.cc;L&&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 D(a,s,A,E,S,L){var O=E-A;O<=0&&(U.logger.warn("Fragment should have a positive duration",s),E=A+s.duration,L=S+s.duration);var C=A,T=E,x=s.startPTS,c=s.endPTS;if(Object(X.isFiniteNumber)(x)){var w=Math.abs(x-A);Object(X.isFiniteNumber)(s.deltaPTS)?s.deltaPTS=Math.max(w,s.deltaPTS):s.deltaPTS=w,C=Math.max(A,x),A=Math.min(A,x),S=Math.min(S,s.startDTS),T=Math.min(E,c),E=Math.max(E,c),L=Math.max(L,s.endDTS)}s.duration=E-A;var v=A-s.start;s.appendedPTS=E,s.start=s.startPTS=A,s.maxStartPTS=C,s.startDTS=S,s.endPTS=E,s.minEndPTS=T,s.endDTS=L;var y=s.sn;if(!a||ya.endSN)return 0;var F,B=y-a.startSN,R=a.fragments;for(R[B]=s,F=B;F>0;F--)i(R[F],R[F-1]);for(F=B;F=0;S--){var L=E[S].initSegment;if(L){A=L;break}}a.fragmentHint&&delete a.fragmentHint.endPTS;var O=0,C;if(m(a,s,function(F,B){F.relurl&&(O=F.cc-B.cc),Object(X.isFiniteNumber)(F.startPTS)&&Object(X.isFiniteNumber)(F.endPTS)&&(B.start=B.startPTS=F.startPTS,B.startDTS=F.startDTS,B.appendedPTS=F.appendedPTS,B.maxStartPTS=F.maxStartPTS,B.endPTS=F.endPTS,B.endDTS=F.endDTS,B.minEndPTS=F.minEndPTS,B.duration=F.endPTS-F.startPTS,B.duration&&(C=B),s.PTSKnown=s.alignedSliding=!0),B.elementaryStreams=F.elementaryStreams,B.loader=F.loader,B.stats=F.stats,B.urlId=F.urlId,F.initSegment&&(B.initSegment=F.initSegment,A=F.initSegment)}),A){var T=s.fragmentHint?s.fragments.concat(s.fragmentHint):s.fragments;T.forEach(function(F){var B;(!F.initSegment||F.initSegment.relurl===((B=A)===null||B===void 0?void 0:B.relurl))&&(F.initSegment=A)})}if(s.skippedSegments&&(s.deltaUpdateFailed=s.fragments.some(function(F){return!F}),s.deltaUpdateFailed)){U.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var x=s.skippedSegments;x--;)s.fragments.shift();s.startSN=s.fragments[0].sn,s.startCC=s.fragments[0].cc}var c=s.fragments;if(O){U.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w=E.length)return;o(s,E[A].start)}function o(a,s){if(s){for(var A=a.fragments,E=a.skippedSegments;E0&&S0&&T===-1&&(this.log("Override startPosition with lastCurrentTime @"+x.toFixed(3)),T=x),this.state=U.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=T,this.tick()}else this._forceStartLoad=!0,this.state=U.State.STOPPED},O.stopLoad=function(){this._forceStartLoad=!1,S.prototype.stopLoad.call(this)},O.doTick=function(){switch(this.state){case U.State.IDLE:this.doTickIdle();break;case U.State.WAITING_LEVEL:{var T,x=this.levels,c=this.level,w=x==null||((T=x[c])===null||T===void 0)?void 0:T.details;if(w&&(!w.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(w))break;this.state=U.State.IDLE;break}break}case U.State.FRAG_LOADING_WAITING_RETRY:{var v,y=self.performance.now(),F=this.retryDate;(!F||y>=F||(v=this.media)!==null&&v!==void 0&&v.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=U.State.IDLE)}break;default:break}this.onTickEnd()},O.onTickEnd=function(){S.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},O.doTickIdle=function(){var T,x,c=this.hls,w=this.levelLastLoaded,v=this.levels,y=this.media,F=c.config,B=c.nextLoadLevel;if(w===null||!y&&(this.startFragRequested||!F.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!v||!v[B])return;var R=v[B];this.level=c.nextLoadLevel=B;var j=R.details;if(!j||this.state===U.State.WAITING_LEVEL||j.live&&this.levelLastLoaded!==B){this.state=U.State.WAITING_LEVEL;return}var N=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:y,D.PlaylistLevelType.MAIN);if(N===null)return;var b=N.len,Y=this.getMaxBufferLength(R.maxBitrate);if(b>=Y)return;if(this._streamEnded(N,j)){var ee={};this.altAudio&&(ee.type="video"),this.hls.trigger(G.Events.BUFFER_EOS,ee),this.state=U.State.ENDED;return}var ae=N.end,ue=this.getNextFragment(ae,j);if(this.couldBacktrack&&!this.fragPrevious&&ue&&ue.sn!=="initSegment"){var Oe=ue.sn-j.startSN;Oe>1&&(ue=j.fragments[Oe-1],this.fragmentTracker.removeFragment(ue))}if(ue&&this.fragmentTracker.getState(ue)===i.FragmentState.OK&&this.nextLoadPosition>ae){var Ee=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(y,Ee,D.PlaylistLevelType.MAIN),ue=this.getNextFragment(this.nextLoadPosition,j)}if(!ue)return;ue.initSegment&&!ue.initSegment.data&&!this.bitrateTest&&(ue=ue.initSegment),((T=ue.decryptdata)===null||T===void 0?void 0:T.keyFormat)==="identity"&&!((x=ue.decryptdata)!==null&&x!==void 0&&x.key)?this.loadKey(ue,j):this.loadFragment(ue,j,ae)},O.loadFragment=function(T,x,c){var w,v=this.fragmentTracker.getState(T);if(this.fragCurrent=T,v===i.FragmentState.BACKTRACKED){var y=this.fragmentTracker.getBacktrackData(T);if(y){this._handleFragmentLoadProgress(y),this._handleFragmentLoadComplete(y);return}else v=i.FragmentState.NOT_LOADED}v===i.FragmentState.NOT_LOADED||v===i.FragmentState.PARTIAL?T.sn==="initSegment"?this._loadInitSegment(T):this.bitrateTest?(T.bitrateTest=!0,this.log("Fragment "+T.sn+" of level "+T.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(T)):(this.startFragRequested=!0,S.prototype.loadFragment.call(this,T,x,c)):v===i.FragmentState.APPENDING?this.reduceMaxBufferLength(T.duration)&&this.fragmentTracker.removeFragment(T):((w=this.media)===null||w===void 0?void 0:w.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},O.getAppendedFrag=function(T){var x=this.fragmentTracker.getAppendedFrag(T,D.PlaylistLevelType.MAIN);return x&&"fragment"in x?x.fragment:x},O.getBufferedFrag=function(T){return this.fragmentTracker.getBufferedFrag(T,D.PlaylistLevelType.MAIN)},O.followingBufferedFrag=function(T){return T?this.getBufferedFrag(T.end+.5):null},O.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},O.nextLevelSwitch=function(){var T=this.levels,x=this.media;if(x!=null&&x.readyState){var c,w=this.getAppendedFrag(x.currentTime);if(w&&w.start>1&&this.flushMainBuffer(0,w.start-1),!x.paused&&T){var v=this.hls.nextLoadLevel,y=T[v],F=this.fragLastKbps;F&&this.fragCurrent?c=this.fragCurrent.duration*y.maxBitrate/(1e3*F)+1:c=0}else c=0;var B=this.getBufferedFrag(x.currentTime+c);if(B){var R=this.followingBufferedFrag(B);if(R){this.abortCurrentFrag();var j=R.maxStartPTS?R.maxStartPTS:R.start,N=R.duration,b=Math.max(B.end,j+Math.min(Math.max(N-this.config.maxFragLookUpTolerance,N*.5),N*.75));this.flushMainBuffer(b,Number.POSITIVE_INFINITY)}}}},O.abortCurrentFrag=function(){var T=this.fragCurrent;this.fragCurrent=null,T!=null&&T.loader&&T.loader.abort(),this.state===U.State.KEY_LOADING&&(this.state=U.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},O.flushMainBuffer=function(T,x){S.prototype.flushMainBuffer.call(this,T,x,this.altAudio?"video":null)},O.onMediaAttached=function(T,x){S.prototype.onMediaAttached.call(this,T,x);var c=x.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 u.default(this.config,c,this.fragmentTracker,this.hls)},O.onMediaDetaching=function(){var T=this.media;T&&(T.removeEventListener("playing",this.onvplaying),T.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),S.prototype.onMediaDetaching.call(this)},O.onMediaPlaying=function(){this.tick()},O.onMediaSeeked=function(){var T=this.media,x=T?T.currentTime:null;Object(X.isFiniteNumber)(x)&&this.log("Media seeked to "+x.toFixed(3)),this.tick()},O.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(G.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},O.onManifestParsed=function(T,x){var c=!1,w=!1,v;x.levels.forEach(function(y){v=y.audioCodec,v&&(v.indexOf("mp4a.40.2")!==-1&&(c=!0),v.indexOf("mp4a.40.5")!==-1&&(w=!0))}),this.audioCodecSwitch=c&&w&&!Object(k.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=x.levels,this.startFragRequested=!1},O.onLevelLoading=function(T,x){var c=this.levels;if(!c||this.state!==U.State.IDLE)return;var w=c[x.level];(!w.details||w.details.live&&this.levelLastLoaded!==x.level||this.waitForCdnTuneIn(w.details))&&(this.state=U.State.WAITING_LEVEL)},O.onLevelLoaded=function(T,x){var c,w=this.levels,v=x.level,y=x.details,F=y.totalduration;if(!w){this.warn("Levels were reset while loading level "+v);return}this.log("Level "+v+" loaded ["+y.startSN+","+y.endSN+"], cc ["+y.startCC+", "+y.endCC+"] duration:"+F);var B=this.fragCurrent;B&&(this.state===U.State.FRAG_LOADING||this.state===U.State.FRAG_LOADING_WAITING_RETRY)&&(B.level!==x.level&&B.loader&&(this.state=U.State.IDLE,B.loader.abort()));var R=w[v],j=0;if(y.live||(c=R.details)!==null&&c!==void 0&&c.live){if(y.fragments[0]||(y.deltaUpdateFailed=!0),y.deltaUpdateFailed)return;j=this.alignPlaylists(y,R.details)}if(R.details=y,this.levelLastLoaded=v,this.hls.trigger(G.Events.LEVEL_UPDATED,{details:y,level:v}),this.state===U.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(y))return;this.state=U.State.IDLE}this.startFragRequested?y.live&&this.synchronizeToLiveEdge(y):this.setStartPosition(y,j),this.tick()},O._handleFragmentLoadProgress=function(T){var x,c=T.frag,w=T.part,v=T.payload,y=this.levels;if(!y){this.warn("Levels were reset while fragment load was in progress. Fragment "+c.sn+" of level "+c.level+" will not be buffered");return}var F=y[c.level],B=F.details;if(!B){this.warn("Dropping fragment "+c.sn+" of level "+c.level+" after level details were reset");return}var R=F.videoCodec,j=B.PTSKnown||!B.live,N=(x=c.initSegment)===null||x===void 0?void 0:x.data,b=this._getAudioCodec(F),Y=this.transmuxer=this.transmuxer||new p.default(this.hls,D.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),ee=w?w.index:-1,ae=ee!==-1,ue=new m.ChunkMetadata(c.level,c.sn,c.stats.chunkCount,v.byteLength,ee,ae),Oe=this.initPTS[c.cc];Y.push(v,N,b,R,c,w,B.totalduration,j,ue,Oe)},O.onAudioTrackSwitching=function(T,x){var c=this.altAudio,w=!!x.url,v=x.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 y=this.fragCurrent;y!=null&&y.loader&&(this.log("Switching to main audio track, cancel main fragment load"),y.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var F=this.hls;c&&F.trigger(G.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),F.trigger(G.Events.AUDIO_TRACK_SWITCHED,{id:v})}},O.onAudioTrackSwitched=function(T,x){var c=x.id,w=!!this.hls.audioTracks[c].url;if(w){var v=this.videoBuffer;v&&this.mediaBuffer!==v&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=v)}this.altAudio=w,this.tick()},O.onBufferCreated=function(T,x){var c=x.tracks,w,v,y=!1;for(var F in c){var B=c[F];if(B.id==="main"){if(v=F,w=B,F==="video"){var R=c[F];R&&(this.videoBuffer=R.buffer)}}else y=!0}y&&w?(this.log("Alternate track found, use "+v+".buffered to schedule main fragment loading"),this.mediaBuffer=w.buffer):this.mediaBuffer=this.media},O.onFragBuffered=function(T,x){var c=x.frag,w=x.part;if(c&&c.type!==D.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===U.State.PARSED&&(this.state=U.State.IDLE);return}var v=w?w.stats:c.stats;this.fragLastKbps=Math.round(8*v.total/(v.buffering.end-v.loading.first)),c.sn!=="initSegment"&&(this.fragPrevious=c),this.fragBufferedComplete(c,w)},O.onError=function(T,x){switch(x.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(D.PlaylistLevelType.MAIN,x);break;case o.ErrorDetails.LEVEL_LOAD_ERROR:case o.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==U.State.ERROR&&(x.fatal?(this.warn(""+x.details),this.state=U.State.ERROR):!x.levelRetry&&this.state===U.State.WAITING_LEVEL&&(this.state=U.State.IDLE));break;case o.ErrorDetails.BUFFER_FULL_ERROR:if(x.parent==="main"&&(this.state===U.State.PARSING||this.state===U.State.PARSED)){var c=!0,w=this.getFwdBufferInfo(this.media,D.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 T=this.media,x=this.gapController;if(!T||!x||!T.readyState)return;var c=W.BufferHelper.getBuffered(T);!this.loadedmetadata&&c.length?(this.loadedmetadata=!0,this.seekToStartPos()):x.poll(this.lastCurrentTime),this.lastCurrentTime=T.currentTime},O.onFragLoadEmergencyAborted=function(){this.state=U.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},O.onBufferFlushed=function(T,x){var c=x.type;if(c!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var w=(c===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(w,c,D.PlaylistLevelType.MAIN)}},O.onLevelsUpdated=function(T,x){this.levels=x.levels},O.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},O.seekToStartPos=function(){var T=this.media,x=T.currentTime,c=this.startPosition;if(c>=0&&x0&&(y1&&T.seeking===!1){var c=T.currentTime;if(W.BufferHelper.isBuffered(T,c)?x=this.getAppendedFrag(c):W.BufferHelper.isBuffered(T,c+.1)&&(x=this.getAppendedFrag(c+.1)),x){var w=this.fragPlaying,v=x.level;(!w||x.sn!==w.sn||w.level!==v||x.urlId!==w.urlId)&&(this.hls.trigger(G.Events.FRAG_CHANGED,{frag:x}),(!w||w.level!==v)&&this.hls.trigger(G.Events.LEVEL_SWITCHED,{level:v}),this.fragPlaying=x)}}},h(L,[{key:"nextLevel",get:function(){var T=this.nextBufferedFrag;return T?T.level:-1}},{key:"currentLevel",get:function(){var T=this.media;if(T){var x=this.getAppendedFrag(T.currentTime);if(x)return x.level}return-1}},{key:"nextBufferedFrag",get:function(){var T=this.media;if(T){var x=this.getAppendedFrag(T.currentTime);return this.followingBufferedFrag(x)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(U.default)},"./src/controller/subtitle-stream-controller.ts":function(re,$,P){"use strict";P.r($),P.d($,"SubtitleStreamController",function(){return a});var X=P("./src/events.ts"),U=P("./src/utils/logger.ts"),k=P("./src/utils/buffer-helper.ts"),G=P("./src/controller/fragment-finders.ts"),W=P("./src/utils/discontinuities.ts"),i=P("./src/controller/level-helper.ts"),D=P("./src/controller/fragment-tracker.ts"),g=P("./src/controller/base-stream-controller.ts"),p=P("./src/types/loader.ts"),m=P("./src/types/level.ts");function u(s,A){for(var E=0;E=x[v].start&&w<=x[v].end){c=x[v];break}var y=C.start+C.duration;c?c.end=y:(c={start:w,end:y},x.push(c)),this.fragmentTracker.fragBuffered(C)},E.onBufferFlushing=function(L,O){var C=O.startOffset,T=O.endOffset;if(C===0&&T!==Number.POSITIVE_INFINITY){var x=this.currentTrackId,c=this.levels;if(!c.length||!c[x]||!c[x].details)return;var w=c[x].details,v=w.targetduration,y=T-v;if(y<=0)return;O.endOffsetSubtitles=Math.max(0,y),this.tracksBuffered.forEach(function(F){for(var B=0;B=w.length||x!==c||!v)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,T.live||(C=v.details)!==null&&C!==void 0&&C.live){var y=this.mainDetails;if(T.deltaUpdateFailed||!y)return;var F=y.fragments[0];if(!v.details)T.hasProgramDateTime&&y.hasProgramDateTime?Object(W.alignMediaPlaylistByPDT)(T,y):F&&Object(i.addSliding)(T,F.start);else{var B=this.alignPlaylists(T,v.details);B===0&&F&&Object(i.addSliding)(T,F.start)}}if(v.details=T,this.levelLastLoaded=x,this.tick(),T.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var R=Object(G.findFragmentByPTS)(null,T.fragments,this.media.currentTime,0);R||(this.warn("Subtitle playlist not aligned with playback"),v.details=void 0)}},E._handleFragmentLoadComplete=function(L){var O=L.frag,C=L.payload,T=O.decryptdata,x=this.hls;if(this.fragContextChanged(O))return;if(C&&C.byteLength>0&&T&&T.key&&T.iv&&T.method==="AES-128"){var c=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(C),T.key.buffer,T.iv.buffer).then(function(w){var v=performance.now();x.trigger(X.Events.FRAG_DECRYPTED,{frag:O,payload:w,stats:{tstart:c,tdecrypt:v}})})}},E.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var L,O=this.currentTrackId,C=this.levels;if(!C.length||!C[O]||!C[O].details)return;var T=C[O].details,x=T.targetduration,c=this.config,w=this.media,v=k.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,w.currentTime-x,c.maxBufferHole),y=v.end,F=v.len,B=this.getMaxBufferLength()+x;if(F>B)return;console.assert(T,"Subtitle track details are defined on idle subtitle stream controller tick");var R=T.fragments,j=R.length,N=T.edge,b,Y=this.fragPrevious;if(y-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(h){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,h)},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 h=m(this.media.textTracks);h.forEach(function(a){Object(U.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(h,a){this.tracks=a.subtitleTracks},f.onSubtitleTrackLoaded=function(h,a){var s=a.id,A=a.details,E=this.trackId,S=this.tracksInGroup[E];if(!S){this.warn("Invalid subtitle track id "+s);return}var L=S.details;S.details=a.details,this.log("subtitle track "+s+" loaded ["+A.startSN+"-"+A.endSN+"]"),s===this.trackId&&(this.retryCount=0,this.playlistLoaded(s,a,L))},f.onLevelLoading=function(h,a){this.switchLevel(a.level)},f.onLevelSwitching=function(h,a){this.switchLevel(a.level)},f.switchLevel=function(h){var a=this.hls.levels[h];if(!(a!=null&&a.textGroupIds))return;var s=a.textGroupIds[a.urlId];if(this.groupId!==s){var A=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,E=this.tracks.filter(function(O){return!s||O.groupId===s});this.tracksInGroup=E;var S=this.findTrackId(A==null?void 0:A.name)||this.findTrackId();this.groupId=s;var L={subtitleTracks:E};this.log("Updating subtitle tracks, "+E.length+' track(s) found in "'+s+'" group-id'),this.hls.trigger(X.Events.SUBTITLE_TRACKS_UPDATED,L),S!==-1&&this.setSubtitleTrack(S,A)}},f.findTrackId=function(h){for(var a=this.tracksInGroup,s=0;s=A.length)return;this.clearTimer();var E=A[h];if(this.log("Switching to subtitle track "+h),this.trackId=h,E){var S=E.id,L=E.groupId,O=L===void 0?"":L,C=E.name,T=E.type,x=E.url;this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:S,groupId:O,name:C,type:T,url:x});var c=this.switchParams(E.url,a==null?void 0:a.details);this.loadPlaylist(c)}else this.hls.trigger(X.Events.SUBTITLE_TRACK_SWITCH,{id:h})},f.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var h=-1,a=m(this.media.textTracks),s=0;s=0&&(T[0]=Math.min(T[0],A),T[1]=Math.max(T[1],E),O=!0,x/(E-A)>.5))return}if(O||L.push([A,E]),this.config.renderTextTracksNatively){var c=this.captionsTracks[s];this.Cues.newCue(c,A,E,S)}else{var w=this.Cues.newCue(null,A,E,S);this.hls.trigger(U.Events.CUES_PARSED,{type:"captions",cues:w,track:s})}},h.onInitPtsFound=function(s,A){var E=this,S=A.frag,L=A.id,O=A.initPTS,C=A.timescale,T=this.unparsedVttFrags;L==="main"&&(this.initPTS[S.cc]=O,this.timescale[S.cc]=C),T.length&&(this.unparsedVttFrags=[],T.forEach(function(x){E.onFragLoaded(U.Events.FRAG_LOADED,x)}))},h.getExistingTrack=function(s){var A=this.media;if(A)for(var E=0;E>>8^C&255^99,D[S]=C,g[C]=S;var T=E[S],x=E[T],c=E[x],w=E[C]*257^C*16843008;m[S]=w<<24|w>>>8,u[S]=w<<16|w>>>16,o[S]=w<<8|w>>>24,f[S]=w,w=c*16843009^x*65537^T*257^S*16843008,h[C]=w<<24|w>>>8,a[C]=w<<16|w>>>16,s[C]=w<<8|w>>>24,A[C]=w,S?(S=T^E[E[E[c^T]]],L^=E[E[L]]):S=L=1}},W.expandKey=function(D){for(var g=this.uint8ArrayToUint32Array_(D),p=!0,m=0;m>>6)+1;var w=(s[A+2]&60)>>>2;if(w>c.length-1){a.trigger(k.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+w});return}return O=(s[A+2]&1)<<2,O|=(s[A+3]&192)>>>6,X.logger.log("manifest codec:"+E+", ADTS type:"+S+", samplingIndex:"+w),/firefox/i.test(T)?w>=6?(S=5,C=new Array(4),L=w-3):(S=2,C=new Array(2),L=w):T.indexOf("android")!==-1?(S=2,C=new Array(2),L=w):(S=5,C=new Array(4),E&&(E.indexOf("mp4a.40.29")!==-1||E.indexOf("mp4a.40.5")!==-1)||!E&&w>=6?L=w-3:((E&&E.indexOf("mp4a.40.2")!==-1&&(w>=6&&O===1||/vivaldi/i.test(T))||!E&&O===1)&&(S=2,C=new Array(2)),L=w)),C[0]=S<<3,C[0]|=(w&14)>>1,C[1]|=(w&1)<<7,C[1]|=O<<3,S===5&&(C[1]|=(L&14)>>1,C[2]=(L&1)<<7,C[2]|=2<<2,C[3]=0),{config:C,samplerate:c[w],channelCount:O,codec:"mp4a.40."+S,manifestCodec:x}}function W(a,s){return a[s]===255&&(a[s+1]&246)===240}function i(a,s){return a[s+1]&1?7:9}function D(a,s){return(a[s+3]&3)<<11|a[s+4]<<3|(a[s+5]&224)>>>5}function g(a,s){return s+5=a.length)return!1;var E=D(a,s);if(E<=A)return!1;var S=s+E;return S===a.length||p(a,S)}return!1}function o(a,s,A,E,S){if(!a.samplerate){var L=G(s,A,E,S);if(!L)return;a.config=L.config,a.samplerate=L.samplerate,a.channelCount=L.channelCount,a.codec=L.codec,a.manifestCodec=L.manifestCodec,X.logger.log("parsed codec:"+a.codec+", rate:"+L.samplerate+", channels:"+L.channelCount)}}function f(a){return 1024*9e4/a}function l(a,s,A,E,S){var L=i(a,s),O=D(a,s);if(O-=L,O>0){var C=A+E*S;return{headerLength:L,frameLength:O,stamp:C}}}function h(a,s,A,E,S){var L=f(a.samplerate),O=l(s,A,E,S,L);if(O){var C=O.frameLength,T=O.headerLength,x=O.stamp,c=T+C,w=Math.max(0,A+c-s.length),v;w?(v=new Uint8Array(c-T),v.set(s.subarray(A+T,s.length),0)):v=s.subarray(A+T,A+c);var y={unit:v,pts:x};return w||a.samples.push(y),{sample:y,length:c,missing:w}}}},"./src/demux/base-audio-demuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"initPTSFn",function(){return D});var X=P("./src/polyfills/number.ts"),U=P("./src/demux/id3.ts"),k=P("./src/demux/dummy-demuxed-track.ts"),G=P("./src/utils/mp4-tools.ts"),W=P("./src/utils/typed-array.ts"),i=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=g.prototype;return p.resetInitSegment=function(u,o,f){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(u,o){return!1},p.appendFrame=function(u,o,f){},p.demux=function(u,o){this.cachedData&&(u=Object(G.appendUint8Array)(this.cachedData,u),this.cachedData=null);var f=U.getID3Data(u,0),l=f?f.length:0,h,a,s=this._audioTrack,A=this._id3Track,E=f?U.getTimeStamp(f):void 0,S=u.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=D(E,o)),f&&f.length>0&&A.samples.push({pts:this.initPTS,dts:this.initPTS,data:f}),a=this.initPTS;li?(this.word<<=i,this.bitsAvailable-=i):(i-=this.bitsAvailable,D=i>>3,i-=D>>3,this.bytesAvailable-=D,this.loadWord(),this.word<<=i,this.bitsAvailable-=i)},G.readBits=function(i){var D=Math.min(this.bitsAvailable,i),g=this.word>>>32-D;return i>32&&X.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=D,this.bitsAvailable>0?this.word<<=D:this.bytesAvailable>0&&this.loadWord(),D=i-D,D>0&&this.bitsAvailable?g<>>i)!==0)return this.word<<=i,this.bitsAvailable-=i,i;return this.loadWord(),i+this.skipLZ()},G.skipUEG=function(){this.skipBits(1+this.skipLZ())},G.skipEG=function(){this.skipBits(1+this.skipLZ())},G.readUEG=function(){var i=this.skipLZ();return this.readBits(i+1)-1},G.readEG=function(){var i=this.readUEG();return 1&i?1+i>>>1:-1*(i>>>1)},G.readBoolean=function(){return this.readBits(1)===1},G.readUByte=function(){return this.readBits(8)},G.readUShort=function(){return this.readBits(16)},G.readUInt=function(){return this.readBits(32)},G.skipScalingList=function(i){for(var D=8,g=8,p,m=0;m0?S.subarray(O,O+C):void 0},G=function(S,L){var O=0;return O=(S[L]&127)<<21,O|=(S[L+1]&127)<<14,O|=(S[L+2]&127)<<7,O|=S[L+3]&127,O},W=function(S,L){return X(S,L)&&G(S,L+6)+10<=S.length-L},i=function(S){for(var L=p(S),O=0;O>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:y+=String.fromCharCode(c);break;case 12:case 13:w=S[F++],y+=String.fromCharCode((c&31)<<6|w&63);break;case 14:w=S[F++],v=S[F++],y+=String.fromCharCode((c&15)<<12|(w&63)<<6|(v&63)<<0);break;default:}}return y},a={decodeTextFrame:o},s;function A(){return!s&&typeof self.TextDecoder!="undefined"&&(s=new self.TextDecoder("utf-8")),s}},"./src/demux/mp3demuxer.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/demux/base-audio-demuxer.ts"),U=P("./src/demux/id3.ts"),k=P("./src/utils/logger.ts"),G=P("./src/demux/mpegaudio.ts");function W(g,p){g.prototype=Object.create(p.prototype),g.prototype.constructor=g,i(g,p)}function i(g,p){return i=Object.setPrototypeOf||function(u,o){return u.__proto__=o,u},i(g,p)}var D=function(g){W(p,g);function p(){return g.apply(this,arguments)||this}var m=p.prototype;return m.resetInitSegment=function(o,f,l){g.prototype.resetInitSegment.call(this,o,f,l),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:o,duration:l,inputTimeScale:9e4,dropped:0}},p.probe=function(o){if(!o)return!1;for(var f=U.getID3Data(o,0)||[],l=f.length,h=o.length;l0},W.demux=function(D){var g=D,p=Object(U.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(X.appendUint8Array)(this.remainderData,D));var m=Object(X.segmentValidRange)(g);this.remainderData=m.remainder,p.samples=m.valid||new Uint8Array}else p.samples=g;return{audioTrack:Object(U.dummyTrack)(),avcTrack:p,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},W.flush=function(){var D=Object(U.dummyTrack)();return D.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(U.dummyTrack)(),avcTrack:D,id3Track:Object(U.dummyTrack)(),textTrack:Object(U.dummyTrack)()}},W.demuxSampleAes=function(D,g,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},W.destroy=function(){},G}();k.minProbeByteLength=1024,$.default=k},"./src/demux/mpegaudio.ts":function(re,$,P){"use strict";P.r($),P.d($,"appendFrame",function(){return i}),P.d($,"parseHeader",function(){return D}),P.d($,"isHeaderPattern",function(){return g}),P.d($,"isHeader",function(){return p}),P.d($,"canParse",function(){return m}),P.d($,"probe",function(){return u});var X=null,U=[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],k=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],G=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],W=[0,1,1,4];function i(o,f,l,h,a){if(l+24>f.length)return;var s=D(f,l);if(s&&l+s.frameLength<=f.length){var A=s.samplesPerFrame*9e4/s.sampleRate,E=h+a*A,S={unit:f.subarray(l,l+s.frameLength),pts:E,dts:E};return o.config=[],o.channelCount=s.channelCount,o.samplerate=s.sampleRate,o.samples.push(S),{sample:S,length:s.frameLength,missing:0}}}function D(o,f){var l=o[f+1]>>3&3,h=o[f+1]>>1&3,a=o[f+2]>>4&15,s=o[f+2]>>2&3;if(l!==1&&a!==0&&a!==15&&s!==3){var A=o[f+2]>>1&1,E=o[f+3]>>6,S=l===3?3-h:h===3?3:4,L=U[S*14+a-1]*1e3,O=l===3?0:l===2?1:2,C=k[O*3+s],T=E===3?1:2,x=G[l][h],c=W[h],w=x*8*c,v=Math.floor(x*L/C+A)*c;if(X===null){var y=navigator.userAgent||"",F=y.match(/Chrome\/(\d+)/i);X=F?parseInt(F[1]):0}var B=!!X&&X<=87;return B&&h===2&&L>=224e3&&E===0&&(o[f+3]=o[f+3]|128),{sampleRate:C,channelCount:T,frameLength:v,samplesPerFrame:w}}}function g(o,f){return o[f]===255&&(o[f+1]&224)===224&&(o[f+1]&6)!==0}function p(o,f){return f+1=D.length){p();return}if(D[g].unit.length<32)continue;var m=this.decrypter.isSync();if(this.decryptAacSample(D,g,p,m),!m)return}},W.getAvcEncryptedData=function(D){for(var g=Math.floor((D.length-48)/160)*16+16,p=new Int8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)p.set(D.subarray(u,u+16),m);return p},W.getAvcDecryptedUnit=function(D,g){for(var p=new Uint8Array(g),m=0,u=32;u<=D.length-16;u+=160,m+=16)D.set(p.subarray(m,m+16),u);return D},W.decryptAvcSample=function(D,g,p,m,u,o){var f=Object(U.discardEPB)(u.data),l=this.getAvcEncryptedData(f),h=this;this.decryptBuffer(l.buffer,function(a){u.data=h.getAvcDecryptedUnit(f,a),o||h.decryptAvcSamples(D,g,p+1,m)})},W.decryptAvcSamples=function(D,g,p,m){if(D instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,p=0){if(g>=D.length){m();return}for(var u=D[g].units;!(p>=u.length);p++){var o=u[p];if(o.data.length<=48||o.type!==1&&o.type!==5)continue;var f=this.decrypter.isSync();if(this.decryptAvcSample(D,g,p,m,o,f),!f)return}}},G}();$.default=k},"./src/demux/transmuxer-interface.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u});var X=P("./node_modules/webworkify-webpack/index.js"),U=P.n(X),k=P("./src/events.ts"),G=P("./src/demux/transmuxer.ts"),W=P("./src/utils/logger.ts"),i=P("./src/errors.ts"),D=P("./src/utils/mediasource-helper.ts"),g=P("./node_modules/eventemitter3/index.js"),p=P.n(g),m=Object(D.getMediaSource)()||{isTypeSupported:function(){return!1}},u=function(){function o(l,h,a,s){var A=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=l,this.id=h,this.onTransmuxComplete=a,this.onFlush=s;var E=l.config,S=function(x,c){c=c||{},c.frag=A.frag,c.id=A.id,l.trigger(x,c)};this.observer=new g.EventEmitter,this.observer.on(k.Events.FRAG_DECRYPTED,S),this.observer.on(k.Events.ERROR,S);var L={mp4:m.isTypeSupported("video/mp4"),mpeg:m.isTypeSupported("audio/mpeg"),mp3:m.isTypeSupported('audio/mp4; codecs="mp3"')},O=navigator.vendor;if(E.enableWorker&&typeof Worker!="undefined"){W.logger.log("demuxing in webworker");var C;try{C=this.worker=X("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),C.addEventListener("message",this.onwmsg),C.onerror=function(T){l.trigger(k.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(T.message+" ("+T.filename+":"+T.lineno+")")})},C.postMessage({cmd:"init",typeSupported:L,vendor:O,id:h,config:JSON.stringify(E)})}catch(T){W.logger.warn("Error in worker:",T),W.logger.error("Error while initializing DemuxerWorker, fallback to inline"),C&&self.URL.revokeObjectURL(C.objectURL),this.transmuxer=new G.default(this.observer,L,E,O,h),this.worker=null}}else this.transmuxer=new G.default(this.observer,L,E,O,h)}var f=o.prototype;return f.destroy=function(){var h=this.worker;if(h)h.removeEventListener("message",this.onwmsg),h.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(h,a,s,A,E,S,L,O,C,T){var x=this;C.transmuxing.start=self.performance.now();var c=this.transmuxer,w=this.worker,v=S?S.start:E.start,y=E.decryptdata,F=this.frag,B=!(F&&E.cc===F.cc),R=!(F&&C.level===F.level),j=F?C.sn-F.sn:-1,N=this.part?C.part-this.part.index:1,b=!R&&(j===1||j===0&&N===1),Y=self.performance.now();(R||j||E.stats.parsing.start===0)&&(E.stats.parsing.start=Y),S&&(N||!b)&&(S.stats.parsing.start=Y);var ee=new G.TransmuxState(B,b,O,R,v);if(!b||B){W.logger.log("[transmuxer-interface, "+E.type+"]: Starting new transmux session for sn: "+C.sn+" p: "+C.part+" level: "+C.level+" id: "+C.id+` discontinuity: `+B+` trackSwitch: `+R+` contiguous: `+b+` accurateTimeOffset: `+O+` timeOffset: `+v);var ae=new G.TransmuxConfig(s,A,a,L,T);this.configureTransmuxer(ae)}if(this.frag=E,this.part=S,w)w.postMessage({cmd:"demux",data:h,decryptdata:y,chunkMeta:C,state:ee},h instanceof ArrayBuffer?[h]:[]);else if(c){var ue=c.push(h,y,C,ee);Object(G.isPromise)(ue)?ue.then(function(Oe){x.handleTransmuxComplete(Oe)}):this.handleTransmuxComplete(ue)}},f.flush=function(h){var a=this;h.transmuxing.start=self.performance.now();var s=this.transmuxer,A=this.worker;if(A)A.postMessage({cmd:"flush",chunkMeta:h});else if(s){var E=s.flush(h);Object(G.isPromise)(E)?E.then(function(S){a.handleFlushResult(S,h)}):this.handleFlushResult(E,h)}},f.handleFlushResult=function(h,a){var s=this;h.forEach(function(A){s.handleTransmuxComplete(A)}),this.onFlush(a)},f.onWorkerMessage=function(h){var a=h.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(h){var a=this.worker,s=this.transmuxer;a?a.postMessage({cmd:"configure",config:h}):s&&s.configure(h)},f.handleTransmuxComplete=function(h){h.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(h)},o}()},"./src/demux/transmuxer-worker.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return i});var X=P("./src/demux/transmuxer.ts"),U=P("./src/events.ts"),k=P("./src/utils/logger.ts"),G=P("./node_modules/eventemitter3/index.js"),W=P.n(G);function i(u){var o=new G.EventEmitter,f=function(h,a){u.postMessage({event:h,data:a})};o.on(U.Events.FRAG_DECRYPTED,f),o.on(U.Events.ERROR,f),u.addEventListener("message",function(l){var h=l.data;switch(h.cmd){case"init":{var a=JSON.parse(h.config);u.transmuxer=new X.default(o,h.typeSupported,a,h.vendor,h.id),Object(k.enableLogs)(a.debug),f("init",null);break}case"configure":{u.transmuxer.configure(h.config);break}case"demux":{var s=u.transmuxer.push(h.data,h.decryptdata,h.chunkMeta,h.state);Object(X.isPromise)(s)?s.then(function(S){D(u,S)}):D(u,s);break}case"flush":{var A=h.chunkMeta,E=u.transmuxer.flush(A);Object(X.isPromise)(E)?E.then(function(S){p(u,S,A)}):p(u,E,A);break}default:break}})}function D(u,o){if(m(o.remuxResult))return;var f=[],l=o.remuxResult,h=l.audio,a=l.video;h&&g(f,h),a&&g(f,a),u.postMessage({event:"transmuxComplete",data:o},f)}function g(u,o){o.data1&&u.push(o.data1.buffer),o.data2&&u.push(o.data2.buffer)}function p(u,o,f){o.forEach(function(l){D(u,l)}),u.postMessage({event:"flush",data:f})}function m(u){return!u.audio&&!u.video&&!u.text&&!u.id3&&!u.initSegment}},"./src/demux/transmuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return a}),P.d($,"isPromise",function(){return E}),P.d($,"TransmuxConfig",function(){return S}),P.d($,"TransmuxState",function(){return L});var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/crypt/decrypter.ts"),G=P("./src/demux/aacdemuxer.ts"),W=P("./src/demux/mp4demuxer.ts"),i=P("./src/demux/tsdemuxer.ts"),D=P("./src/demux/mp3demuxer.ts"),g=P("./src/remux/mp4-remuxer.ts"),p=P("./src/remux/passthrough-remuxer.ts"),m=P("./src/demux/chunk-cache.ts"),u=P("./src/utils/mp4-tools.ts"),o=P("./src/utils/logger.ts"),f;try{f=self.performance.now.bind(self.performance)}catch(O){o.logger.debug("Unable to use Performance API on this environment"),f=self.Date.now}var l=[{demux:i.default,remux:g.default},{demux:W.default,remux:p.default},{demux:G.default,remux:g.default},{demux:D.default,remux:g.default}],h=1024;l.forEach(function(O){var C=O.demux;h=Math.max(h,C.minProbeByteLength)});var a=function(){function O(T,x,c,w,v){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 m.default,this.observer=T,this.typeSupported=x,this.config=c,this.vendor=w,this.id=v}var C=O.prototype;return C.configure=function(x){this.transmuxConfig=x,this.decrypter&&this.decrypter.reset()},C.push=function(x,c,w,v){var y=this,F=w.transmuxing;F.executeStart=f();var B=new Uint8Array(x),R=this.cache,j=this.config,N=this.currentTransmuxState,b=this.transmuxConfig;v&&(this.currentTransmuxState=v);var Y=s(B,c);if(Y&&Y.method==="AES-128"){var ee=this.getDecrypter();if(j.enableSoftwareAES){var ae=ee.softwareDecrypt(B,Y.key.buffer,Y.iv.buffer);if(!ae)return F.executeEnd=f(),A(w);B=new Uint8Array(ae)}else return this.decryptionPromise=ee.webCryptoDecrypt(B,Y.key.buffer,Y.iv.buffer).then(function(je){var $e=y.push(je,null,w);return y.decryptionPromise=null,$e}),this.decryptionPromise}var ue=v||N,Oe=ue.contiguous,Ee=ue.discontinuity,xe=ue.trackSwitch,Ae=ue.accurateTimeOffset,Re=ue.timeOffset,pe=b.audioCodec,he=b.videoCodec,ke=b.defaultInitPts,et=b.duration,We=b.initSegmentData;if((Ee||xe)&&this.resetInitSegment(We,pe,he,et),Ee&&this.resetInitialTimestamp(ke),Oe||this.resetContiguity(),this.needsProbing(B,Ee,xe)){if(R.dataLength){var it=R.flush();B=Object(u.appendUint8Array)(it,B)}this.configureTransmuxer(B,b)}var at=this.transmux(B,Y,Re,Ae,w),Pe=this.currentTransmuxState;return Pe.contiguous=!0,Pe.discontinuity=!1,Pe.trackSwitch=!1,F.executeEnd=f(),at},C.flush=function(x){var c=this,w=x.transmuxing;w.executeStart=f();var v=this.decrypter,y=this.cache,F=this.currentTransmuxState,B=this.decryptionPromise;if(B)return B.then(function(){return c.flush(x)});var R=[],j=F.timeOffset;if(v){var N=v.flush();N&&R.push(this.push(N,null,x))}var b=y.dataLength;y.reset();var Y=this.demuxer,ee=this.remuxer;if(!Y||!ee)return b>=h&&this.observer.emit(X.Events.ERROR,X.Events.ERROR,{type:U.ErrorTypes.MEDIA_ERROR,details:U.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),w.executeEnd=f(),[A(x)];var ae=Y.flush(j);return E(ae)?ae.then(function(ue){return c.flushRemux(R,ue,x),R}):(this.flushRemux(R,ae,x),R)},C.flushRemux=function(x,c,w){var v=c.audioTrack,y=c.avcTrack,F=c.id3Track,B=c.textTrack,R=this.currentTransmuxState,j=R.accurateTimeOffset,N=R.timeOffset;o.logger.log("[transmuxer.ts]: Flushed fragment "+w.sn+(w.part>-1?" p: "+w.part:"")+" of level "+w.level);var b=this.remuxer.remux(v,y,F,B,N,j,!0,this.id);x.push({remuxResult:b,chunkMeta:w}),w.transmuxing.executeEnd=f()},C.resetInitialTimestamp=function(x){var c=this.demuxer,w=this.remuxer;if(!c||!w)return;c.resetTimeStamp(x),w.resetTimeStamp(x)},C.resetContiguity=function(){var x=this.demuxer,c=this.remuxer;if(!x||!c)return;x.resetContiguity(),c.resetNextTimestamp()},C.resetInitSegment=function(x,c,w,v){var y=this.demuxer,F=this.remuxer;if(!y||!F)return;y.resetInitSegment(c,w,v),F.resetInitSegment(x,c,w)},C.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},C.transmux=function(x,c,w,v,y){var F;return c&&c.method==="SAMPLE-AES"?F=this.transmuxSampleAes(x,c,w,v,y):F=this.transmuxUnencrypted(x,w,v,y),F},C.transmuxUnencrypted=function(x,c,w,v){var y=this.demuxer.demux(x,c,!1,!this.config.progressive),F=y.audioTrack,B=y.avcTrack,R=y.id3Track,j=y.textTrack,N=this.remuxer.remux(F,B,R,j,c,w,!1,this.id);return{remuxResult:N,chunkMeta:v}},C.transmuxSampleAes=function(x,c,w,v,y){var F=this;return this.demuxer.demuxSampleAes(x,c,w).then(function(B){var R=F.remuxer.remux(B.audioTrack,B.avcTrack,B.id3Track,B.textTrack,w,v,!1,F.id);return{remuxResult:R,chunkMeta:y}})},C.configureTransmuxer=function(x,c){for(var w=this.config,v=this.observer,y=this.typeSupported,F=this.vendor,B=c.audioCodec,R=c.defaultInitPts,j=c.duration,N=c.initSegmentData,b=c.videoCodec,Y,ee=0,ae=l.length;ee0&&C!=null&&C.key!=null&&C.iv!==null&&C.method!=null&&(T=C),T}var A=function(C){return{remuxResult:{},chunkMeta:C}};function E(O){return"then"in O&&O.then instanceof Function}var S=function(C,T,x,c,w){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=C,this.videoCodec=T,this.initSegmentData=x,this.duration=c,this.defaultInitPts=w},L=function(C,T,x,c,w){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=C,this.contiguous=T,this.accurateTimeOffset=x,this.trackSwitch=c,this.timeOffset=w}},"./src/demux/tsdemuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"discardEPB",function(){return A});var X=P("./src/demux/adts.ts"),U=P("./src/demux/mpegaudio.ts"),k=P("./src/demux/exp-golomb.ts"),G=P("./src/demux/id3.ts"),W=P("./src/demux/sample-aes.ts"),i=P("./src/events.ts"),D=P("./src/utils/mp4-tools.ts"),g=P("./src/utils/logger.ts"),p=P("./src/errors.ts"),m={video:1,audio:2,id3:3,text:4},u=function(){function E(L,O,C){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=L,this.config=O,this.typeSupported=C}E.probe=function(O){var C=E.syncOffset(O);return C<0?!1:(C&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+C+", junk ahead ?"),!0)},E.syncOffset=function(O){for(var C=Math.min(1e3,O.length-3*188),T=0;T>4,pe=void 0;if(Re>1){if(pe=Ee+5+O[Ee+4],pe===Ee+188)continue}else pe=Ee+4;switch(Ae){case F:xe&&(B&&(c=h(B))&&this.parseAVCPES(c,!1),B={data:[],size:0}),B&&(B.data.push(O.subarray(pe,Ee+188)),B.size+=Ee+188-pe);break;case R:xe&&(N&&(c=h(N))&&(v.isAAC?this.parseAACPES(c):this.parseMPEGPES(c)),N={data:[],size:0}),N&&(N.data.push(O.subarray(pe,Ee+188)),N.size+=Ee+188-pe);break;case j:xe&&(b&&(c=h(b))&&this.parseID3PES(c),b={data:[],size:0}),b&&(b.data.push(O.subarray(pe,Ee+188)),b.size+=Ee+188-pe);break;case 0:xe&&(pe+=O[pe]+1),ae=this._pmtId=f(O,pe);break;case ae:{xe&&(pe+=O[pe]+1);var he=l(O,pe,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,T);F=he.avc,F>0&&(w.pid=F),R=he.audio,R>0&&(v.pid=R,v.isAAC=he.isAAC),j=he.id3,j>0&&(y.pid=j),Y&&!ee&&(g.logger.log("reparse from beginning"),Y=!1,Ee=Oe-188),ee=this.pmtParsed=!0;break}case 17:case 8191:break;default:Y=!0;break}}else this.observer.emit(i.Events.ERROR,i.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});w.pesData=B,v.pesData=N,y.pesData=b;var ke={audioTrack:v,avcTrack:w,id3Track:y,textTrack:this._txtTrack};return x&&this.extractRemainingSamples(ke),ke},S.flush=function(){var O=this.remainderData;this.remainderData=null;var C;return O?C=this.demux(O,-1,!1,!0):C={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(C),this.sampleAes?this.decrypt(C,this.sampleAes):C},S.extractRemainingSamples=function(O){var C=O.audioTrack,T=O.avcTrack,x=O.id3Track,c=T.pesData,w=C.pesData,v=x.pesData,y;c&&(y=h(c))?(this.parseAVCPES(y,!0),T.pesData=null):T.pesData=c,w&&(y=h(w))?(C.isAAC?this.parseAACPES(y):this.parseMPEGPES(y),C.pesData=null):(w!=null&&w.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),C.pesData=w),v&&(y=h(v))?(this.parseID3PES(y),x.pesData=null):x.pesData=v},S.demuxSampleAes=function(O,C,T){var x=this.demux(O,T,!0,!this.config.progressive),c=this.sampleAes=new W.default(this.observer,this.config,C);return this.decrypt(x,c)},S.decrypt=function(O,C){return new Promise(function(T){var x=O.audioTrack,c=O.avcTrack;x.samples&&x.isAAC?C.decryptAacSamples(x.samples,0,function(){c.samples?C.decryptAvcSamples(c.samples,0,0,function(){T(O)}):T(O)}):c.samples&&C.decryptAvcSamples(c.samples,0,0,function(){T(O)})})},S.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},S.parseAVCPES=function(O,C){var T=this,x=this._avcTrack,c=this.parseAVCNALu(O.data),w=!1,v=this.avcSample,y,F=!1;O.data=null,v&&c.length&&!x.audFound&&(a(v,x),v=this.avcSample=o(!1,O.pts,O.dts,"")),c.forEach(function(B){switch(B.type){case 1:{y=!0,v||(v=T.avcSample=o(!0,O.pts,O.dts,"")),w&&(v.debug+="NDR "),v.frame=!0;var R=B.data;if(F&&R.length>4){var j=new k.default(R).readSliceType();(j===2||j===4||j===7||j===9)&&(v.key=!0)}break}case 5:y=!0,v||(v=T.avcSample=o(!0,O.pts,O.dts,"")),w&&(v.debug+="IDR "),v.key=!0,v.frame=!0;break;case 6:{y=!0,w&&v&&(v.debug+="SEI ");var N=new k.default(A(B.data));N.readUByte();for(var b=0,Y=0,ee=!1,ae=0;!ee&&N.bytesAvailable>1;){b=0;do ae=N.readUByte(),b+=ae;while(ae===255);Y=0;do ae=N.readUByte(),Y+=ae;while(ae===255);if(b===4&&N.bytesAvailable!==0){ee=!0;var ue=N.readUByte();if(ue===181){var Oe=N.readUShort();if(Oe===49){var Ee=N.readUInt();if(Ee===1195456820){var xe=N.readUByte();if(xe===3){for(var Ae=N.readUByte(),Re=N.readUByte(),pe=31&Ae,he=[Ae,Re],ke=0;ke16){for(var et=[],We=0;We<16;We++)et.push(N.readUByte().toString(16)),(We===3||We===5||We===7||We===9)&&et.push("-");for(var it=Y-16,at=new Uint8Array(it),Pe=0;Pe=0){var N={data:O.subarray(R,v-x-1),type:j};w.push(N)}else{var b=this.getLastNalUnit();if(b&&(c&&v<=4-c&&(b.state&&(b.data=b.data.subarray(0,b.data.byteLength-c))),F=v-x-1,F>0)){var Y=new Uint8Array(b.data.byteLength+F);Y.set(b.data,0),Y.set(O.subarray(0,F),b.data.byteLength),b.data=Y,b.state=0}}v=0&&x>=0){var ee={data:O.subarray(R,C),type:j,state:x};w.push(ee)}if(w.length===0){var ae=this.getLastNalUnit();if(ae){var ue=new Uint8Array(ae.data.byteLength+O.byteLength);ue.set(ae.data,0),ue.set(O,ae.data.byteLength),ae.data=ue}}return T.naluState=x,w},S.parseAACPES=function(O){var C=0,T=this._audioTrack,x=this.aacOverFlow,c=O.data;if(x){this.aacOverFlow=null;var w=x.sample.unit.byteLength,v=Math.min(x.missing,w),y=w-v;x.sample.unit.set(c.subarray(0,v),y),T.samples.push(x.sample),C=x.missing}var F,B;for(F=C,B=c.length;F1;){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)}L=c[0];var v=(L[0]<<16)+(L[1]<<8)+L[2];if(v===1){if(O=(L[4]<<8)+L[5],O&&O>E.size-6)return null;var y=L[7];y&192&&(T=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,y&64?(x=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,T-x>60*9e4&&(g.logger.warn(Math.round((T-x)/9e4)+"s delta between PTS and DTS, align them"),T=x)):x=T),C=L[8];var F=C+9;if(E.size<=F)return null;E.size-=F;for(var B=new Uint8Array(E.size),R=0,j=c.length;RN){F-=N;continue}else L=L.subarray(F),N-=F,F=0;B.set(L,S),S+=N}return O&&(O-=C+3),{data:B,pts:T,dts:x,len:O}}return null}function a(E,S){if(E.units.length&&E.frame){if(E.pts===void 0){var L=S.samples,O=L.length;if(O){var C=L[O-1];E.pts=C.pts,E.dts=C.dts}else{S.dropped++;return}}S.samples.push(E)}E.debug.length&&g.logger.log(E.pts+"/"+E.dts+":"+E.debug)}function s(E,S){var L=E.length;if(L>0){if(S.pts>=E[L-1].pts)E.push(S);else for(var O=L-1;O>=0;O--)if(S.ptsT)return c;return 0}},{key:"maxAutoLevel",get:function(){var C=this.levels,T=this.autoLevelCapping,x;return T===-1&&C&&C.length?x=C.length-1:x=T,x}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(C){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,C)}},{key:"audioTracks",get:function(){var C=this.audioTrackController;return C?C.audioTracks:[]}},{key:"audioTrack",get:function(){var C=this.audioTrackController;return C?C.audioTrack:-1},set:function(C){var T=this.audioTrackController;T&&(T.audioTrack=C)}},{key:"subtitleTracks",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var C=this.subtitleTrackController;return C?C.subtitleTrack:-1},set:function(C){var T=this.subtitleTrackController;T&&(T.subtitleTrack=C)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var C=this.subtitleTrackController;return C?C.subtitleDisplay:!1},set:function(C){var T=this.subtitleTrackController;T&&(T.subtitleDisplay=C)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(C){this.config.lowLatencyMode=C}},{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 h.Events}},{key:"ErrorTypes",get:function(){return a.ErrorTypes}},{key:"ErrorDetails",get:function(){return a.ErrorDetails}},{key:"DefaultConfig",get:function(){return S.defaultConfig?S.defaultConfig:o.hlsDefaultConfig},set:function(C){S.defaultConfig=C}}]),S}();E.defaultConfig=void 0},"./src/is-supported.ts":function(re,$,P){"use strict";P.r($),P.d($,"isSupported",function(){return k}),P.d($,"changeTypeSupported",function(){return G});var X=P("./src/utils/mediasource-helper.ts");function U(){return self.SourceBuffer||self.WebKitSourceBuffer}function k(){var W=Object(X.getMediaSource)();if(!W)return!1;var i=U(),D=W&&typeof W.isTypeSupported=="function"&&W.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!i||i.prototype&&typeof i.prototype.appendBuffer=="function"&&typeof i.prototype.remove=="function";return!!D&&!!g}function G(){var W,i=U();return typeof(i==null||((W=i.prototype)===null||W===void 0)?void 0:W.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return u}),P.d($,"LoadError",function(){return f});var X=P("./src/polyfills/number.ts"),U=P("./src/errors.ts");function k(l,h){l.prototype=Object.create(h.prototype),l.prototype.constructor=l,g(l,h)}function G(l){var h=typeof Map=="function"?new Map:void 0;return G=function(s){if(s===null||!D(s))return s;if(typeof s!="function")throw new TypeError("Super expression must either be null or a function");if(typeof h!="undefined"){if(h.has(s))return h.get(s);h.set(s,A)}function A(){return W(s,arguments,p(this).constructor)}return A.prototype=Object.create(s.prototype,{constructor:{value:A,enumerable:!1,writable:!0,configurable:!0}}),g(A,s)},G(l)}function W(l,h,a){return i()?W=Reflect.construct:W=function(A,E,S){var L=[null];L.push.apply(L,E);var O=Function.bind.apply(A,L),C=new O;return S&&g(C,S.prototype),C},W.apply(null,arguments)}function i(){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(l){return!1}}function D(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function g(l,h){return g=Object.setPrototypeOf||function(s,A){return s.__proto__=A,s},g(l,h)}function p(l){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(a){return a.__proto__||Object.getPrototypeOf(a)},p(l)}var m=Math.pow(2,17),u=function(){function l(a){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=a}var h=l.prototype;return h.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},h.abort=function(){this.loader&&this.loader.abort()},h.load=function(s,A){var E=this,S=s.url;if(!S)return Promise.reject(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,networkDetails:null},"Fragment does not have a "+(S?"part list":"url")));this.abort();var L=this.config,O=L.fLoader,C=L.loader;return new Promise(function(T,x){E.loader&&E.loader.destroy();var c=E.loader=s.loader=O?new O(L):new C(L),w=o(s),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};s.stats=c.stats,c.load(w,v,{onSuccess:function(F,B,R,j){E.resetLoader(s,c),T({frag:s,part:null,payload:F.data,networkDetails:j})},onError:function(F,B,R){E.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,response:F,networkDetails:R}))},onAbort:function(F,B,R){E.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,networkDetails:R}))},onTimeout:function(F,B,R){E.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,networkDetails:R}))},onProgress:function(F,B,R,j){A&&A({frag:s,part:null,payload:R,networkDetails:j})}})})},h.loadPart=function(s,A,E){var S=this;this.abort();var L=this.config,O=L.fLoader,C=L.loader;return new Promise(function(T,x){S.loader&&S.loader.destroy();var c=S.loader=s.loader=O?new O(L):new C(L),w=o(s,A),v={timeout:L.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:L.fragLoadingMaxRetryTimeout,highWaterMark:m};A.stats=c.stats,c.load(w,v,{onSuccess:function(F,B,R,j){S.resetLoader(s,c),S.updateStatsFromPart(s,A);var N={frag:s,part:A,payload:F.data,networkDetails:j};E(N),T(N)},onError:function(F,B,R){S.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:s,part:A,response:F,networkDetails:R}))},onAbort:function(F,B,R){s.stats.aborted=A.stats.aborted,S.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:s,part:A,networkDetails:R}))},onTimeout:function(F,B,R){S.resetLoader(s,c),x(new f({type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:s,part:A,networkDetails:R}))}})})},h.updateStatsFromPart=function(s,A){var E=s.stats,S=A.stats,L=S.total;if(E.loaded+=S.loaded,L){var O=Math.round(s.duration/A.duration),C=Math.min(Math.round(E.loaded/L),O),T=O-C,x=T*Math.round(E.loaded/C);E.total=E.loaded+x}else E.total=Math.max(E.loaded,E.total);var c=E.loading,w=S.loading;c.start?c.first+=w.first-w.start:(c.start=w.start,c.first=w.first),c.end=w.end},h.resetLoader=function(s,A){s.loader=null,this.loader===A&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),A.destroy()},l}();function o(l,h){h===void 0&&(h=null);var a=h||l,s={frag:l,part:h,responseType:"arraybuffer",url:a.url,headers:{},rangeStart:0,rangeEnd:0},A=a.byteRangeStartOffset,E=a.byteRangeEndOffset;return Object(X.isFiniteNumber)(A)&&Object(X.isFiniteNumber)(E)&&(s.rangeStart=A,s.rangeEnd=E),s}var f=function(l){k(h,l);function h(a){for(var s,A=arguments.length,E=new Array(A>1?A-1:0),S=1;S>8*(15-L)&255;return S},s.setDecryptDataFromLevelKey=function(E,S){var L=E;return(E==null?void 0:E.method)==="AES-128"&&E.uri&&!E.iv&&(L=W.LevelKey.fromURI(E.uri),L.method=E.method,L.iv=this.createInitializationVector(S),L.keyFormat="identity"),L},s.setElementaryStreamInfo=function(E,S,L,O,C,T){T===void 0&&(T=!1);var x=this.elementaryStreams,c=x[E];if(!c){x[E]={startPTS:S,endPTS:L,startDTS:O,endDTS:C,partial:T};return}c.startPTS=Math.min(c.startPTS,S),c.endPTS=Math.max(c.endPTS,L),c.startDTS=Math.min(c.startDTS,O),c.endDTS=Math.max(c.endDTS,C)},s.clearElementaryStreamInfo=function(){var E=this.elementaryStreams;E[u.AUDIO]=null,E[u.VIDEO]=null,E[u.AUDIOVIDEO]=null},m(a,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var E=this.sn;typeof E!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&G.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),E=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,E)}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 E=Object(X.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+E*1e3}},{key:"encrypted",get:function(){var E;return!!((E=this.decryptdata)!==null&&E!==void 0&&E.keyFormat&&this.decryptdata.uri)}}]),a}(o),l=function(h){D(a,h);function a(s,A,E,S,L){var O;O=h.call(this,E)||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 i.LoadStats,O.duration=s.decimalFloatingPoint("DURATION"),O.gap=s.bool("GAP"),O.independent=s.bool("INDEPENDENT"),O.relurl=s.enumeratedString("URI"),O.fragment=A,O.index=S;var C=s.enumeratedString("BYTERANGE");return C&&O.setByteRange(C,L),L&&(O.fragOffset=L.fragOffset+L.duration),O}return m(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 A=this.elementaryStreams;return!!(A.audio||A.video||A.audiovideo)}}]),a}(o)},"./src/loader/key-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return G});var X=P("./src/events.ts"),U=P("./src/errors.ts"),k=P("./src/utils/logger.ts"),G=function(){function W(D){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=D,this._registerListeners()}var i=W.prototype;return i._registerListeners=function(){this.hls.on(X.Events.KEY_LOADING,this.onKeyLoading,this)},i._unregisterListeners=function(){this.hls.off(X.Events.KEY_LOADING,this.onKeyLoading)},i.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var p=this.loaders[g];p&&p.destroy()}this.loaders={}},i.onKeyLoading=function(g,p){var m=p.frag,u=m.type,o=this.loaders[u];if(!m.decryptdata){k.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var f=m.decryptdata.uri;if(f!==this.decrypturl||this.decryptkey===null){var l=this.hls.config;if(o&&(k.logger.warn("abort previous key loader for type:"+u),o.abort()),!f){k.logger.warn("key uri is falsy");return}var h=l.loader,a=m.loader=this.loaders[u]=new h(l);this.decrypturl=f,this.decryptkey=null;var s={url:f,frag:m,responseType:"arraybuffer"},A={timeout:l.fragLoadingTimeOut,maxRetry:0,retryDelay:l.fragLoadingRetryDelay,maxRetryDelay:l.fragLoadingMaxRetryTimeout,highWaterMark:0},E={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};a.load(s,A,E)}else this.decryptkey&&(m.decryptdata.key=this.decryptkey,this.hls.trigger(X.Events.KEY_LOADED,{frag:m}))},i.loadsuccess=function(g,p,m){var u=m.frag;if(!u.decryptdata){k.logger.error("after key load, decryptdata unset");return}this.decryptkey=u.decryptdata.key=new Uint8Array(g.data),u.loader=null,delete this.loaders[u.type],this.hls.trigger(X.Events.KEY_LOADED,{frag:u})},i.loaderror=function(g,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:m,response:g})},i.loadtimeout=function(g,p){var m=p.frag,u=m.loader;u&&u.abort(),delete this.loaders[m.type],this.hls.trigger(X.Events.ERROR,{type:U.ErrorTypes.NETWORK_ERROR,details:U.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:m})},W}()},"./src/loader/level-details.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelDetails",function(){return W});var X=P("./src/polyfills/number.ts");function U(i,D){for(var g=0;gp.endSN||m>0||m===0&&u>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},k(i,[{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||G}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var m=this.driftEnd-this.driftStart;return m*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.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 p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),i}()},"./src/loader/level-key.ts":function(re,$,P){"use strict";P.r($),P.d($,"LevelKey",function(){return W});var X=P("./node_modules/url-toolkit/src/url-toolkit.js"),U=P.n(X);function k(i,D){for(var g=0;g2){var x=T.shift()+".";return x+=parseInt(T.shift()).toString(16),x+=("000"+parseInt(T.shift()).toString(16)).substr(-4),x}return C},L.resolve=function(C,T){return U.buildAbsoluteURL(T,C,{alwaysNormalize:!0})},L.parseMasterPlaylist=function(C,T){var x=[],c={},w=!1;m.lastIndex=0;for(var v;(v=m.exec(C))!=null;)if(v[1]){var y=new D.AttrList(v[1]),F={attrs:y,bitrate:y.decimalInteger("AVERAGE-BANDWIDTH")||y.decimalInteger("BANDWIDTH"),name:y.NAME,url:L.resolve(v[2],T)},B=y.decimalResolution("RESOLUTION");B&&(F.width=B.width,F.height=B.height),s((y.CODECS||"").split(/[ ,]+/).filter(function(j){return j}),F),F.videoCodec&&F.videoCodec.indexOf("avc1")!==-1&&(F.videoCodec=L.convertAVC1ToAVCOTI(F.videoCodec)),x.push(F)}else if(v[3]){var R=new D.AttrList(v[3]);R["DATA-ID"]&&(w=!0,c[R["DATA-ID"]]=R)}return{levels:x,sessionData:w?c:null}},L.parseMasterPlaylistMedia=function(C,T,x,c){c===void 0&&(c=[]);var w,v=[],y=0;for(u.lastIndex=0;(w=u.exec(C))!==null;){var F=new D.AttrList(w[1]);if(F.TYPE===x){var B={attrs:F,bitrate:0,id:y++,groupId:F["GROUP-ID"],instreamId:F["INSTREAM-ID"],name:F.NAME||F.LANGUAGE||"",type:x,default:F.bool("DEFAULT"),autoselect:F.bool("AUTOSELECT"),forced:F.bool("FORCED"),lang:F.LANGUAGE,url:F.URI?L.resolve(F.URI,T):""};if(c.length){var R=L.findGroup(c,B.groupId)||c[0];A(B,R,"audioCodec"),A(B,R,"textCodec")}v.push(B)}}return v},L.parseLevelPlaylist=function(C,T,x,c,w){var v=new W.LevelDetails(T),y=v.fragments,F=null,B=0,R=0,j=0,N=0,b=null,Y=new G.Fragment(c,T),ee,ae,ue,Oe=-1,Ee=!1;for(o.lastIndex=0,v.m3u8=C;(ee=o.exec(C))!==null;){Ee&&(Ee=!1,Y=new G.Fragment(c,T),Y.start=j,Y.sn=B,Y.cc=N,Y.level=x,F&&(Y.initSegment=F,Y.rawProgramDateTime=F.rawProgramDateTime));var xe=ee[1];if(xe){Y.duration=parseFloat(xe);var Ae=(" "+ee[2]).slice(1);Y.title=Ae||null,Y.tagList.push(Ae?["INF",xe,Ae]:["INF",xe])}else if(ee[3])Object(X.isFiniteNumber)(Y.duration)&&(Y.start=j,ue&&(Y.levelkey=ue),Y.sn=B,Y.level=x,Y.cc=N,Y.urlId=w,y.push(Y),Y.relurl=(" "+ee[3]).slice(1),S(Y,b),b=Y,j+=Y.duration,B++,R=0,Ee=!0);else if(ee[4]){var Re=(" "+ee[4]).slice(1);b?Y.setByteRange(Re,b):Y.setByteRange(Re)}else if(ee[5])Y.rawProgramDateTime=(" "+ee[5]).slice(1),Y.tagList.push(["PROGRAM-DATE-TIME",Y.rawProgramDateTime]),Oe===-1&&(Oe=y.length);else{if(ee=ee[0].match(f),!ee){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae-1){g.logger.warn("Keyformat "+Ge+" is not supported from the manifest");continue}else if(Ge!=="identity")continue;$e&&(ue=i.LevelKey.fromURL(T,se),se&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf($e)>=0&&(ue.method=$e,ue.keyFormat=Ge,Se&&(ue.keyID=Se),Te&&(ue.keyFormatVersions=Te),ue.iv=_e));break}case"START":{var Fe=new D.AttrList(he),Ke=Fe.decimalFloatingPoint("TIME-OFFSET");Object(X.isFiniteNumber)(Ke)&&(v.startTimeOffset=Ke);break}case"MAP":{var Je=new D.AttrList(he);Y.relurl=Je.URI,Je.BYTERANGE&&Y.setByteRange(Je.BYTERANGE),Y.level=x,Y.sn="initSegment",ue&&(Y.levelkey=ue),Y.initSegment=null,F=Y,Ee=!0;break}case"SERVER-CONTROL":{var Ve=new D.AttrList(he);v.canBlockReload=Ve.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=Ve.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&Ve.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=Ve.optionalFloat("PART-HOLD-BACK",0),v.holdBack=Ve.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var tt=new D.AttrList(he);v.partTarget=tt.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Ie=v.partList;Ie||(Ie=v.partList=[]);var nt=R>0?Ie[Ie.length-1]:void 0,st=R++,De=new G.Part(new D.AttrList(he),Y,T,st,nt);Ie.push(De),Y.duration+=De.duration;break}case"PRELOAD-HINT":{var Me=new D.AttrList(he);v.preloadHint=Me;break}case"RENDITION-REPORT":{var ve=new D.AttrList(he);v.renditionReports=v.renditionReports||[],v.renditionReports.push(ve);break}default:g.logger.warn("line parsed but not handled: "+ee);break}}}b&&!b.relurl?(y.pop(),j-=b.duration,v.partList&&(v.fragmentHint=b)):v.partList&&(S(Y,b),Y.cc=N,v.fragmentHint=Y);var ce=y.length,fe=y[0],ne=y[ce-1];if(j+=v.skippedSegments*v.targetduration,j>0&&ce&&ne){v.averagetargetduration=j/ce;var ie=ne.sn;v.endSN=ie!=="initSegment"?ie:0,fe&&(v.startCC=fe.cc,fe.initSegment||v.fragments.every(function(oe){return oe.relurl&&h(oe.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),Y=new G.Fragment(c,T),Y.relurl=ne.relurl,Y.level=x,Y.sn="initSegment",fe.initSegment=Y,v.needSidxRanges=!0))}else v.endSN=0,v.startCC=0;return v.fragmentHint&&(j+=v.fragmentHint.duration),v.totalduration=j,v.endCC=N,Oe>0&&E(y,Oe),v},L}();function s(L,O){["video","audio","text"].forEach(function(C){var T=L.filter(function(c){return Object(p.isCodecType)(c,C)});if(T.length){var x=T.filter(function(c){return c.lastIndexOf("avc1",0)===0||c.lastIndexOf("mp4a",0)===0});O[C+"Codec"]=x.length>0?x[0]:T[0],L=L.filter(function(c){return T.indexOf(c)===-1})}}),O.unknownCodecs=L}function A(L,O,C){var T=O[C];T&&(L[C]=T)}function E(L,O){for(var C=L[O],T=O;T--;){var x=L[T];if(!x)return;x.programDateTime=C.programDateTime-x.duration*1e3,C=x}}function S(L,O){L.rawProgramDateTime?L.programDateTime=Date.parse(L.rawProgramDateTime):O!=null&&O.programDateTime&&(L.programDateTime=O.endProgramDateTime),Object(X.isFiniteNumber)(L.programDateTime)||(L.programDateTime=null,L.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/polyfills/number.ts"),U=P("./src/events.ts"),k=P("./src/errors.ts"),G=P("./src/utils/logger.ts"),W=P("./src/utils/mp4-tools.ts"),i=P("./src/loader/m3u8-parser.ts"),D=P("./src/types/loader.ts"),g=P("./src/utils/attr-list.ts");function p(o){var f=o.type;switch(f){case D.PlaylistContextType.AUDIO_TRACK:return D.PlaylistLevelType.AUDIO;case D.PlaylistContextType.SUBTITLE_TRACK:return D.PlaylistLevelType.SUBTITLE;default:return D.PlaylistLevelType.MAIN}}function m(o,f){var l=o.url;return(l===void 0||l.indexOf("data:")===0)&&(l=f.url),l}var u=function(){function o(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var f=o.prototype;return f.registerListeners=function(){var h=this.hls;h.on(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(U.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.on(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.unregisterListeners=function(){var h=this.hls;h.off(U.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(U.Events.LEVEL_LOADING,this.onLevelLoading,this),h.off(U.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),h.off(U.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},f.createInternalLoader=function(h){var a=this.hls.config,s=a.pLoader,A=a.loader,E=s||A,S=new E(a);return h.loader=S,this.loaders[h.type]=S,S},f.getInternalLoader=function(h){return this.loaders[h.type]},f.resetInternalLoader=function(h){this.loaders[h]&&delete this.loaders[h]},f.destroyInternalLoaders=function(){for(var h in this.loaders){var a=this.loaders[h];a&&a.destroy(),this.resetInternalLoader(h)}},f.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},f.onManifestLoading=function(h,a){var s=a.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:D.PlaylistContextType.MANIFEST,url:s,deliveryDirectives:null})},f.onLevelLoading=function(h,a){var s=a.id,A=a.level,E=a.url,S=a.deliveryDirectives;this.load({id:s,groupId:null,level:A,responseType:"text",type:D.PlaylistContextType.LEVEL,url:E,deliveryDirectives:S})},f.onAudioTrackLoading=function(h,a){var s=a.id,A=a.groupId,E=a.url,S=a.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.AUDIO_TRACK,url:E,deliveryDirectives:S})},f.onSubtitleTrackLoading=function(h,a){var s=a.id,A=a.groupId,E=a.url,S=a.deliveryDirectives;this.load({id:s,groupId:A,level:null,responseType:"text",type:D.PlaylistContextType.SUBTITLE_TRACK,url:E,deliveryDirectives:S})},f.load=function(h){var a,s=this.hls.config,A=this.getInternalLoader(h);if(A){var E=A.context;if(E&&E.url===h.url){G.logger.trace("[playlist-loader]: playlist request ongoing");return}G.logger.log("[playlist-loader]: aborting previous loader for type: "+h.type),A.abort()}var S,L,O,C;switch(h.type){case D.PlaylistContextType.MANIFEST:S=s.manifestLoadingMaxRetry,L=s.manifestLoadingTimeOut,O=s.manifestLoadingRetryDelay,C=s.manifestLoadingMaxRetryTimeout;break;case D.PlaylistContextType.LEVEL:case D.PlaylistContextType.AUDIO_TRACK:case D.PlaylistContextType.SUBTITLE_TRACK:S=0,L=s.levelLoadingTimeOut;break;default:S=s.levelLoadingMaxRetry,L=s.levelLoadingTimeOut,O=s.levelLoadingRetryDelay,C=s.levelLoadingMaxRetryTimeout;break}if(A=this.createInternalLoader(h),(a=h.deliveryDirectives)!==null&&a!==void 0&&a.part){var T;if(h.type===D.PlaylistContextType.LEVEL&&h.level!==null?T=this.hls.levels[h.level].details:h.type===D.PlaylistContextType.AUDIO_TRACK&&h.id!==null?T=this.hls.audioTracks[h.id].details:h.type===D.PlaylistContextType.SUBTITLE_TRACK&&h.id!==null&&(T=this.hls.subtitleTracks[h.id].details),T){var x=T.partTarget,c=T.targetduration;x&&c&&(L=Math.min(Math.max(x*3,c*.8)*1e3,L))}}var w={timeout:L,maxRetry:S,retryDelay:O,maxRetryDelay:C,highWaterMark:0},v={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};A.load(h,w,v)},f.loadsuccess=function(h,a,s,A){if(A===void 0&&(A=null),s.isSidxRequest){this.handleSidxRequest(h,s),this.handlePlaylistLoaded(h,a,s,A);return}this.resetInternalLoader(s.type);var E=h.data;if(E.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(h,s,"no EXTM3U delimiter",A);return}a.parsing.start=performance.now(),E.indexOf("#EXTINF:")>0||E.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(h,a,s,A):this.handleMasterPlaylist(h,a,s,A)},f.loaderror=function(h,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!1,h)},f.loadtimeout=function(h,a,s){s===void 0&&(s=null),this.handleNetworkError(a,s,!0)},f.handleMasterPlaylist=function(h,a,s,A){var E=this.hls,S=h.data,L=m(h,s),O=i.default.parseMasterPlaylist(S,L),C=O.levels,T=O.sessionData;if(!C.length){this.handleManifestParsingError(h,s,"no level found in manifest",A);return}var x=C.map(function(B){return{id:B.attrs.AUDIO,audioCodec:B.audioCodec}}),c=C.map(function(B){return{id:B.attrs.SUBTITLES,textCodec:B.textCodec}}),w=i.default.parseMasterPlaylistMedia(S,L,"AUDIO",x),v=i.default.parseMasterPlaylistMedia(S,L,"SUBTITLES",c),y=i.default.parseMasterPlaylistMedia(S,L,"CLOSED-CAPTIONS");if(w.length){var F=w.some(function(B){return!B.url});!F&&C[0].audioCodec&&!C[0].attrs.AUDIO&&(G.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 g.AttrList({}),bitrate:0,url:""}))}E.trigger(U.Events.MANIFEST_LOADED,{levels:C,audioTracks:w,subtitles:v,captions:y,url:L,stats:a,networkDetails:A,sessionData:T})},f.handleTrackOrLevelPlaylist=function(h,a,s,A){var E=this.hls,S=s.id,L=s.level,O=s.type,C=m(h,s),T=Object(X.isFiniteNumber)(S)?S:0,x=Object(X.isFiniteNumber)(L)?L:T,c=p(s),w=i.default.parseLevelPlaylist(h.data,C,x,c,T);if(!w.fragments.length){E.trigger(U.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:C,reason:"no fragments found in level",level:typeof s.level=="number"?s.level:void 0});return}if(O===D.PlaylistContextType.MANIFEST){var v={attrs:new g.AttrList({}),bitrate:0,details:w,name:"",url:C};E.trigger(U.Events.MANIFEST_LOADED,{levels:[v],audioTracks:[],url:C,stats:a,networkDetails:A,sessionData:null})}if(a.parsing.end=performance.now(),w.needSidxRanges){var y,F=(y=w.fragments[0].initSegment)===null||y===void 0?void 0:y.url;this.load({url:F,isSidxRequest:!0,type:O,level:L,levelDetails:w,id:S,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}s.levelDetails=w,this.handlePlaylistLoaded(h,a,s,A)},f.handleSidxRequest=function(h,a){var s=Object(W.parseSegmentIndex)(new Uint8Array(h.data));if(!s)return;var A=s.references,E=a.levelDetails;A.forEach(function(S,L){var O=S.info,C=E.fragments[L];C.byteRange.length===0&&C.setByteRange(String(1+O.end-O.start)+"@"+String(O.start)),C.initSegment&&C.initSegment.setByteRange(String(s.moovEndOffset)+"@0")})},f.handleManifestParsingError=function(h,a,s,A){this.hls.trigger(U.Events.ERROR,{type:k.ErrorTypes.NETWORK_ERROR,details:k.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:a.type===D.PlaylistContextType.MANIFEST,url:h.url,reason:s,response:h,context:a,networkDetails:A})},f.handleNetworkError=function(h,a,s,A){s===void 0&&(s=!1),G.logger.warn("[playlist-loader]: A network "+(s?"timeout":"error")+" occurred while loading "+h.type+" level: "+h.level+" id: "+h.id+' group-id: "'+h.groupId+'"');var E=k.ErrorDetails.UNKNOWN,S=!1,L=this.getInternalLoader(h);switch(h.type){case D.PlaylistContextType.MANIFEST:E=s?k.ErrorDetails.MANIFEST_LOAD_TIMEOUT:k.ErrorDetails.MANIFEST_LOAD_ERROR,S=!0;break;case D.PlaylistContextType.LEVEL:E=s?k.ErrorDetails.LEVEL_LOAD_TIMEOUT:k.ErrorDetails.LEVEL_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.AUDIO_TRACK:E=s?k.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:k.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,S=!1;break;case D.PlaylistContextType.SUBTITLE_TRACK:E=s?k.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:k.ErrorDetails.SUBTITLE_LOAD_ERROR,S=!1;break}L&&this.resetInternalLoader(h.type);var O={type:k.ErrorTypes.NETWORK_ERROR,details:E,fatal:S,url:h.url,loader:L,context:h,networkDetails:a};A&&(O.response=A),this.hls.trigger(U.Events.ERROR,O)},f.handlePlaylistLoaded=function(h,a,s,A){var E=s.type,S=s.level,L=s.id,O=s.groupId,C=s.loader,T=s.levelDetails,x=s.deliveryDirectives;if(!(T!=null&&T.targetduration)){this.handleManifestParsingError(h,s,"invalid target duration",A);return}if(!C)return;T.live&&(C.getCacheAge&&(T.ageHeader=C.getCacheAge()||0),(!C.getCacheAge||isNaN(T.ageHeader))&&(T.ageHeader=0));switch(E){case D.PlaylistContextType.MANIFEST:case D.PlaylistContextType.LEVEL:this.hls.trigger(U.Events.LEVEL_LOADED,{details:T,level:S||0,id:L||0,stats:a,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(U.Events.AUDIO_TRACK_LOADED,{details:T,id:L||0,groupId:O||"",stats:a,networkDetails:A,deliveryDirectives:x});break;case D.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(U.Events.SUBTITLE_TRACK_LOADED,{details:T,id:L||0,groupId:O||"",stats:a,networkDetails:A,deliveryDirectives:x});break}},o}();$.default=u},"./src/polyfills/number.ts":function(re,$,P){"use strict";P.r($),P.d($,"isFiniteNumber",function(){return X}),P.d($,"MAX_SAFE_INTEGER",function(){return U});var X=Number.isFinite||function(k){return typeof k=="number"&&isFinite(k)},U=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(re,$,P){"use strict";P.r($);var X=function(){function U(){}return U.getSilentFrame=function(G,W){switch(G){case"mp4a.40.2":if(W===1)return new Uint8Array([0,200,0,128,35,128]);if(W===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(W===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(W===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(W===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(W===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(W===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(W===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(W===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},U}();$.default=X},"./src/remux/mp4-generator.ts":function(re,$,P){"use strict";P.r($);var X=Math.pow(2,32)-1,U=function(){function k(){}return k.init=function(){k.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 W;for(W in k.types)k.types.hasOwnProperty(W)&&(k.types[W]=[W.charCodeAt(0),W.charCodeAt(1),W.charCodeAt(2),W.charCodeAt(3)]);var i=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]),D=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]);k.HDLR_TYPES={video:i,audio:D};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);k.STTS=k.STSC=k.STCO=p,k.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),k.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),k.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),k.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var m=new Uint8Array([105,115,111,109]),u=new Uint8Array([97,118,99,49]),o=new Uint8Array([0,0,0,1]);k.FTYP=k.box(k.types.ftyp,m,o,m,u),k.DINF=k.box(k.types.dinf,k.box(k.types.dref,g))},k.box=function(W){for(var i=8,D=arguments.length,g=new Array(D>1?D-1:0),p=1;p>24&255,o[1]=i>>16&255,o[2]=i>>8&255,o[3]=i&255,o.set(W,4),m=0,i=8;m>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},k.mdia=function(W){return k.box(k.types.mdia,k.mdhd(W.timescale,W.duration),k.hdlr(W.type),k.minf(W))},k.mfhd=function(W){return k.box(k.types.mfhd,new Uint8Array([0,0,0,0,W>>24,W>>16&255,W>>8&255,W&255]))},k.minf=function(W){return W.type==="audio"?k.box(k.types.minf,k.box(k.types.smhd,k.SMHD),k.DINF,k.stbl(W)):k.box(k.types.minf,k.box(k.types.vmhd,k.VMHD),k.DINF,k.stbl(W))},k.moof=function(W,i,D){return k.box(k.types.moof,k.mfhd(W),k.traf(D,i))},k.moov=function(W){for(var i=W.length,D=[];i--;)D[i]=k.trak(W[i]);return k.box.apply(null,[k.types.moov,k.mvhd(W[0].timescale,W[0].duration)].concat(D).concat(k.mvex(W)))},k.mvex=function(W){for(var i=W.length,D=[];i--;)D[i]=k.trex(W[i]);return k.box.apply(null,[k.types.mvex].concat(D))},k.mvhd=function(W,i){i*=W;var D=Math.floor(i/(X+1)),g=Math.floor(i%(X+1)),p=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,W>>24&255,W>>16&255,W>>8&255,W&255,D>>24,D>>16&255,D>>8&255,D&255,g>>24,g>>16&255,g>>8&255,g&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 k.box(k.types.mvhd,p)},k.sdtp=function(W){var i=W.samples||[],D=new Uint8Array(4+i.length),g,p;for(g=0;g>>8&255),i.push(m&255),i=i.concat(Array.prototype.slice.call(p));for(g=0;g>>8&255),D.push(m&255),D=D.concat(Array.prototype.slice.call(p));var u=k.box(k.types.avcC,new Uint8Array([1,i[3],i[4],i[5],252|3,224|W.sps.length].concat(i).concat([W.pps.length]).concat(D))),o=W.width,f=W.height,l=W.pixelRatio[0],h=W.pixelRatio[1];return k.box(k.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,o>>8&255,o&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]),u,k.box(k.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),k.box(k.types.pasp,new Uint8Array([l>>24,l>>16&255,l>>8&255,l&255,h>>24,h>>16&255,h>>8&255,h&255])))},k.esds=function(W){var i=W.config.length;return new Uint8Array([0,0,0,0,3,23+i,0,1,0,4,15+i,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([i]).concat(W.config).concat([6,1,2]))},k.mp4a=function(W){var i=W.samplerate;return k.box(k.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]),k.box(k.types.esds,k.esds(W)))},k.mp3=function(W){var i=W.samplerate;return k.box(k.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,W.channelCount,0,16,0,0,0,0,i>>8&255,i&255,0,0]))},k.stsd=function(W){return W.type==="audio"?!W.isAAC&&W.codec==="mp3"?k.box(k.types.stsd,k.STSD,k.mp3(W)):k.box(k.types.stsd,k.STSD,k.mp4a(W)):k.box(k.types.stsd,k.STSD,k.avc1(W))},k.tkhd=function(W){var i=W.id,D=W.duration*W.timescale,g=W.width,p=W.height,m=Math.floor(D/(X+1)),u=Math.floor(D%(X+1));return k.box(k.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,m>>24,m>>16&255,m>>8&255,m&255,u>>24,u>>16&255,u>>8&255,u&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,g>>8&255,g&255,0,0,p>>8&255,p&255,0,0]))},k.traf=function(W,i){var D=k.sdtp(W),g=W.id,p=Math.floor(i/(X+1)),m=Math.floor(i%(X+1));return k.box(k.types.traf,k.box(k.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),k.box(k.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,m>>24,m>>16&255,m>>8&255,m&255])),k.trun(W,D.length+16+20+8+16+8+8),D)},k.trak=function(W){return W.duration=W.duration||4294967295,k.box(k.types.trak,k.tkhd(W),k.mdia(W))},k.trex=function(W){var i=W.id;return k.box(k.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},k.trun=function(W,i){var D=W.samples||[],g=D.length,p=12+16*g,m=new Uint8Array(p),u,o,f,l,h,a;for(i+=8+p,m.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),u=0;u>>24&255,f>>>16&255,f>>>8&255,f&255,l>>>24&255,l>>>16&255,l>>>8&255,l&255,h.isLeading<<2|h.dependsOn,h.isDependedOn<<6|h.hasRedundancy<<4|h.paddingValue<<1|h.isNonSync,h.degradPrio&240<<8,h.degradPrio&15,a>>>24&255,a>>>16&255,a>>>8&255,a&255],12+16*u);return k.box(k.types.trun,m)},k.initSegment=function(W){k.types||k.init();var i=k.moov(W),D=new Uint8Array(k.FTYP.byteLength+i.byteLength);return D.set(k.FTYP),D.set(i,k.FTYP.byteLength),D},k}();U.types=void 0,U.HDLR_TYPES=void 0,U.STTS=void 0,U.STSC=void 0,U.STCO=void 0,U.STSZ=void 0,U.VMHD=void 0,U.SMHD=void 0,U.STSD=void 0,U.FTYP=void 0,U.DINF=void 0,$.default=U},"./src/remux/mp4-remuxer.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return a}),P.d($,"normalizePts",function(){return s});var X=P("./src/polyfills/number.ts"),U=P("./src/remux/aac-helper.ts"),k=P("./src/remux/mp4-generator.ts"),G=P("./src/events.ts"),W=P("./src/errors.ts"),i=P("./src/utils/logger.ts"),D=P("./src/types/loader.ts"),g=P("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(L){for(var O=1;O0?w:v.pts},T[0].pts);return x&&i.logger.debug("PTS rollover detected"),c},O.remux=function(T,x,c,w,v,y,F,B){var R,j,N,b,Y,ee,ae=v,ue=v,Oe=T.pid>-1,Ee=x.pid>-1,xe=x.samples.length,Ae=T.samples.length>0,Re=xe>1,pe=(!Oe||Ae)&&(!Ee||Re)||this.ISGenerated||F;if(pe){this.ISGenerated||(N=this.generateIS(T,x,v));var he=this.isVideoContiguous,ke=-1;if(Re&&(ke=A(x.samples),!he&&this.config.forceKeyFrameOnDiscontinuity))if(ee=!0,ke>0){i.logger.warn("[mp4-remuxer]: Dropped "+ke+" out of "+xe+" video samples due to a missing keyframe");var et=this.getVideoStartPts(x.samples);x.samples=x.samples.slice(ke),x.dropped+=ke,ue+=(x.samples[0].pts-et)/(x.timescale||9e4)}else ke===-1&&(i.logger.warn("[mp4-remuxer]: No keyframe found out of "+xe+" video samples"),ee=!1);if(this.ISGenerated){if(Ae&&Re){var We=this.getVideoStartPts(x.samples),it=s(T.samples[0].pts,We)-We,at=it/x.inputTimeScale;ae+=Math.max(0,at),ue+=Math.max(0,-at)}if(Ae){if(T.samplerate||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),N=this.generateIS(T,x,v)),j=this.remuxAudio(T,ae,this.isAudioContiguous,y,Ee||Re||B===D.PlaylistLevelType.AUDIO?ue:void 0),Re){var Pe=j?j.endPTS-j.startPTS:0;x.inputTimeScale||(i.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),N=this.generateIS(T,x,v)),R=this.remuxVideo(x,ue,he,Pe)}}else Re&&(R=this.remuxVideo(x,ue,he,0));R&&(R.firstKeyFrame=ke,R.independent=ke!==-1)}}return this.ISGenerated&&(c.samples.length&&(Y=this.remuxID3(c,v)),w.samples.length&&(b=this.remuxText(w,v))),{audio:j,video:R,initSegment:N,independent:ee,text:b,id3:Y}},O.generateIS=function(T,x,c){var w=T.samples,v=x.samples,y=this.typeSupported,F={},B=!Object(X.isFiniteNumber)(this._initPTS),R="audio/mp4",j,N,b;if(B&&(j=N=Infinity),T.config&&w.length&&(T.timescale=T.samplerate,T.isAAC||(y.mpeg?(R="audio/mpeg",T.codec=""):y.mp3&&(T.codec="mp3")),F.audio={id:"audio",container:R,codec:T.codec,initSegment:!T.isAAC&&y.mpeg?new Uint8Array(0):k.default.initSegment([T]),metadata:{channelCount:T.channelCount}},B&&(b=T.inputTimeScale,j=N=w[0].pts-Math.round(b*c))),x.sps&&x.pps&&v.length&&(x.timescale=x.inputTimeScale,F.video={id:"main",container:"video/mp4",codec:x.codec,initSegment:k.default.initSegment([x]),metadata:{width:x.width,height:x.height}},B)){b=x.inputTimeScale;var Y=this.getVideoStartPts(v),ee=Math.round(b*c);N=Math.min(N,s(v[0].dts,Y)-ee),j=Math.min(j,Y-ee)}if(Object.keys(F).length)return this.ISGenerated=!0,B&&(this._initPTS=j,this._initDTS=N),{tracks:F,initPTS:j,timescale:b}},O.remuxVideo=function(T,x,c,w){var v=T.inputTimeScale,y=T.samples,F=[],B=y.length,R=this._initPTS,j=this.nextAvcDts,N=8,b,Y,ee,ae=Number.POSITIVE_INFINITY,ue=Number.NEGATIVE_INFINITY,Oe=0,Ee=!1;if(!c||j===null){var xe=x*v,Ae=y[0].pts-s(y[0].dts,y[0].pts);j=xe-Ae}for(var Re=0;Repe.pts){var he=9e4*.2;Oe=Math.max(Math.min(Oe,pe.pts-pe.dts),-1*he)}pe.dts0?Re-1:Re].dts&&(Ee=!0)}Ee&&y.sort(function(Ct,xt){var Qe=Ct.dts-xt.dts,Lt=Ct.pts-xt.pts;return Qe||Lt}),Y=y[0].dts,ee=y[y.length-1].dts;var ke=Math.round((ee-Y)/(B-1));if(Oe<0){if(Oeke,je=at<-1;if(Pe||je){Pe?i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(at,!0)+" ms ("+at+"dts) hole between fragments detected, filling it"):i.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-at,!0)+" ms ("+at+"dts) overlapping between fragments detected"),Y=j;var $e=y[0].pts-at;y[0].dts=Y,y[0].pts=$e,i.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)($e,!0)+"/"+Object(g.toMsFromMpegTsClock)(Y,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(at,!0)+" ms")}}h&&(Y=Math.max(0,Y));for(var se=0,_e=0,Te=0;Te0?Ie-1:Ie].dts;if(ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var le=Math.floor(ie.maxBufferHole*v),ye=(w?ae+w*v:this.nextAudioPts)-nt.pts;ye>le?(b=ye-oe,b<0&&(b=oe),i.logger.log("[mp4-remuxer]: It is approximately "+ye/90+" ms to the next segment; using duration "+b/90+" ms for the last video frame.")):b=oe}else b=oe}var Le=Math.round(nt.pts-nt.dts);F.push(new E(nt.key,b,De,Le))}if(F.length&&f&&f<70){var Ue=F[0].flags;Ue.dependsOn=2,Ue.isNonSync=0}console.assert(b!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=j=ee+b,this.isVideoContiguous=!0;var Ze=k.default.moof(T.sequenceNumber++,Y,p({},T,{samples:F})),mt="video",ft={data1:Ze,data2:Ve,startPTS:ae/v,endPTS:(ue+b)/v,startDTS:Y/v,endDTS:j/v,type:mt,hasAudio:!1,hasVideo:!0,nb:F.length,dropped:T.dropped};return T.samples=[],T.dropped=0,console.assert(Ve.length,"MDAT length must not be zero"),ft},O.remuxAudio=function(T,x,c,w,v){var y=T.inputTimeScale,F=T.samplerate?T.samplerate:y,B=y/F,R=T.isAAC?u:o,j=R*B,N=this._initPTS,b=!T.isAAC&&this.typeSupported.mpeg,Y=[],ee=T.samples,ae=b?0:8,ue=this.nextAudioPts||-1,Oe=x*y;if(this.isAudioContiguous=c=c||ee.length&&ue>0&&(w&&Math.abs(Oe-ue)<9e3||Math.abs(s(ee[0].pts-N,Oe)-ue)<20*j),ee.forEach(function(fe){fe.pts=s(fe.pts-N,Oe)}),!c||ue<0){if(ee=ee.filter(function(fe){return fe.pts>=0}),!ee.length)return;v===0?ue=0:w?ue=Math.max(0,Oe):ue=ee[0].pts}if(T.isAAC)for(var Ee=v!==void 0,xe=this.config.maxAudioFramesDrift,Ae=0,Re=ue;Ae=xe*j&&et0){_e+=ae;try{se=new Uint8Array(_e)}catch(fe){this.observer.emit(G.Events.ERROR,G.Events.ERROR,{type:W.ErrorTypes.MUX_ERROR,details:W.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:_e,reason:"fail allocating audio mdat "+_e});return}if(!b){var Ve=new DataView(se.buffer);Ve.setUint32(0,_e),se.set(k.default.types.mdat,4)}}else return;se.set(Fe,ae);var tt=Fe.byteLength;ae+=tt,Y.push(new E(!0,R,tt,0)),$e=Ke}var Ie=Y.length;if(!Ie)return;var nt=Y[Y.length-1];this.nextAudioPts=ue=$e+B*nt.duration;var st=b?new Uint8Array(0):k.default.moof(T.sequenceNumber++,je/B,p({},T,{samples:Y}));T.samples=[];var De=je/y,Me=ue/y,ve="audio",ce={data1:st,data2:se,startPTS:De,endPTS:Me,startDTS:De,endDTS:Me,type:ve,hasAudio:!0,hasVideo:!1,nb:Ie};return this.isAudioContiguous=!0,console.assert(se.length,"MDAT length must not be zero"),ce},O.remuxEmptyAudio=function(T,x,c,w){var v=T.inputTimeScale,y=T.samplerate?T.samplerate:v,F=v/y,B=this.nextAudioPts,R=(B!==null?B:w.startDTS*v)+this._initDTS,j=w.endDTS*v+this._initDTS,N=F*u,b=Math.ceil((j-R)/N),Y=U.default.getSilentFrame(T.manifestCodec||T.codec,T.channelCount);if(i.logger.warn("[mp4-remuxer]: remux empty Audio"),!Y){i.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var ee=[],ae=0;ae4294967296;)L+=C;return L}function A(L){for(var O=0;O0?this.lastEndDTS=T:(G.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var x=!!L.audio,c=!!L.video,w="";x&&(w+="audio"),c&&(w+="video");var v={data1:E,startPTS:C,startDTS:C,endPTS:T,endDTS:T,type:w,hasAudio:x,hasVideo:c,nb:1,dropped:0};return A.audio=v.type==="audio"?v:void 0,A.video=v.type!=="audio"?v:void 0,A.text=l,A.id3=f,A.initSegment=S,A},g}(),i=function(p,m,u){return Object(U.getStartDTS)(p,m)-u};function D(g,p){var m=g==null?void 0:g.codec;return m&&m.length>4?m:m==="hvc1"?"hvc1.1.c.L120.90":m==="av01"?"av01.0.04M.08":m==="avc1"||p===k.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}$.default=W},"./src/task-loop.ts":function(re,$,P){"use strict";P.r($),P.d($,"default",function(){return X});var X=function(){function U(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var k=U.prototype;return k.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},k.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},k.onHandlerDestroyed=function(){},k.hasInterval=function(){return!!this._tickInterval},k.hasNextTick=function(){return!!this._tickTimer},k.setInterval=function(W){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,W),!0)},k.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},k.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},k.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},k.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},k.doTick=function(){},U}()},"./src/types/cmcd.ts":function(re,$,P){"use strict";P.r($),P.d($,"CMCDVersion",function(){return X}),P.d($,"CMCDObjectType",function(){return U}),P.d($,"CMCDStreamingFormat",function(){return k}),P.d($,"CMCDStreamType",function(){return G});var X=1,U;(function(W){W.MANIFEST="m",W.AUDIO="a",W.VIDEO="v",W.MUXED="av",W.INIT="i",W.CAPTION="c",W.TIMED_TEXT="tt",W.KEY="k",W.OTHER="o"})(U||(U={}));var k;(function(W){W.DASH="d",W.HLS="h",W.SMOOTH="s",W.OTHER="o"})(k||(k={}));var G;(function(W){W.VOD="v",W.LIVE="l"})(G||(G={}))},"./src/types/level.ts":function(re,$,P){"use strict";P.r($),P.d($,"HlsSkip",function(){return k}),P.d($,"getSkipValue",function(){return G}),P.d($,"HlsUrlParameters",function(){return W}),P.d($,"Level",function(){return i});function X(D,g){for(var p=0;pNumber.MAX_SAFE_INTEGER?Infinity:g},W.hexadecimalInteger=function(D){if(this[D]){var g=(this[D]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var p=new Uint8Array(g.length/2),m=0;mNumber.MAX_SAFE_INTEGER?Infinity:g},W.decimalFloatingPoint=function(D){return parseFloat(this[D])},W.optionalFloat=function(D,g){var p=this[D];return p?parseFloat(p):g},W.enumeratedString=function(D){return this[D]},W.bool=function(D){return this[D]==="YES"},W.decimalResolution=function(D){var g=X.exec(this[D]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},G.parseAttrList=function(D){var g,p={},m='"';for(U.lastIndex=0;(g=U.exec(D))!==null;){var u=g[2];u.indexOf(m)===0&&u.lastIndexOf(m)===u.length-1&&(u=u.slice(1,-1)),p[g[1]]=u}return p},G}()},"./src/utils/binary-search.ts":function(re,$,P){"use strict";P.r($);var X={search:function(k,G){for(var W=0,i=k.length-1,D=null,g=null;W<=i;){D=(W+i)/2|0,g=k[D];var p=G(g);if(p>0)W=D+1;else if(p<0)i=D-1;else return g}return null}};$.default=X},"./src/utils/buffer-helper.ts":function(re,$,P){"use strict";P.r($),P.d($,"BufferHelper",function(){return k});var X=P("./src/utils/logger.ts"),U={length:0,start:function(){return 0},end:function(){return 0}},k=function(){function G(){}return G.isBuffered=function(i,D){try{if(i){for(var g=G.getBuffered(i),p=0;p=g.start(p)&&D<=g.end(p))return!0}}catch(m){}return!1},G.bufferInfo=function(i,D,g){try{if(i){var p=G.getBuffered(i),m=[],u;for(u=0;uo&&(p[u-1].end=i[m].end):p.push(i[m])}else p.push(i[m])}else p=i;for(var f=0,l,h=D,a=D,s=0;s=A&&D=c&&X.logger.log(this.time+" ["+c+"] "+w)},C}(),f=function(T){for(var x=[],c=0;cW&&(this.logger.log(u.DEBUG,"Too large cursor position "+this.pos),this.pos=W)},T.moveCursor=function(c){var w=this.pos+c;if(c>1)for(var v=this.pos+1;v=144&&this.backSpace();var w=k(c);if(this.pos>=W){this.logger.log(u.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)},T.clearFromPos=function(c){var w;for(w=c;w0&&(c?v="["+w.join(" | ")+"]":v=w.join(` `)),v},T.getTextAndFormat=function(){return this.rows},C}(),A=function(){function C(x,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=x,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[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=w}var T=C.prototype;return T.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[G-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},T.getHandler=function(){return this.outputFilter},T.setHandler=function(c){this.outputFilter=c},T.setPAC=function(c){this.writeScreen.setPAC(c)},T.setBkgData=function(c){this.writeScreen.setBkgData(c)},T.setMode=function(c){if(c===this.mode)return;this.mode=c,this.logger.log(u.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},T.insertChars=function(c){for(var w=0;w=46,w.italics)w.foreground="white";else{var v=Math.floor(c/2)-16,y=["white","green","blue","cyan","red","yellow","magenta"];w.foreground=y[v]}this.logger.log(u.INFO,"MIDROW: "+JSON.stringify(w)),this.writeScreen.setPen(w)},T.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))},T.cueSplitAtTime=function(c){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,c,this.displayedMemory),this.cueStartTime=c))},C}(),E=function(){function C(x,c,w){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var v=new o;this.channels=[null,new A(x,c,v),new A(x+1,w,v)],this.cmdHistory=O(),this.logger=v}var T=C.prototype;return T.getHandler=function(c){return this.channels[c].getHandler()},T.setHandler=function(c,w){this.channels[c].setHandler(w)},T.addData=function(c,w){var v,y,F,B=!1;this.logger.time=c;for(var R=0;R ("+f([y,F])+")"),v=this.parseCmd(y,F),v||(v=this.parseMidrow(y,F)),v||(v=this.parsePAC(y,F)),v||(v=this.parseBackgroundAttributes(y,F)),!v&&(B=this.parseChars(y,F),B)){var j=this.currentChannel;if(j&&j>0){var N=this.channels[j];N.insertChars(B)}else this.logger.log(u.WARNING,"No channel found yet. TEXT-MODE?")}!v&&!B&&this.logger.log(u.WARNING,"Couldn't parse cleaned data "+f([y,F])+" orig: "+f([w[R],w[R+1]]))}},T.parseCmd=function(c,w){var v=this.cmdHistory,y=(c===20||c===28||c===21||c===29)&&w>=32&&w<=47,F=(c===23||c===31)&&w>=33&&w<=35;if(!(y||F))return!1;if(L(c,w,v))return S(null,null,v),this.logger.log(u.DEBUG,"Repeated command ("+f([c,w])+") is dropped"),!0;var B=c===20||c===21||c===23?1:2,R=this.channels[B];return c===20||c===21||c===28||c===29?w===32?R.ccRCL():w===33?R.ccBS():w===34?R.ccAOF():w===35?R.ccAON():w===36?R.ccDER():w===37?R.ccRU(2):w===38?R.ccRU(3):w===39?R.ccRU(4):w===40?R.ccFON():w===41?R.ccRDC():w===42?R.ccTR():w===43?R.ccRTD():w===44?R.ccEDM():w===45?R.ccCR():w===46?R.ccENM():w===47&&R.ccEOC():R.ccTO(w-32),S(c,w,v),this.currentChannel=B,!0},T.parseMidrow=function(c,w){var v=0;if((c===17||c===25)&&w>=32&&w<=47){if(c===17?v=1:v=2,v!==this.currentChannel)return this.logger.log(u.ERROR,"Mismatch channel in midrow parsing"),!1;var y=this.channels[v];return y?(y.ccMIDROW(w),this.logger.log(u.DEBUG,"MIDROW ("+f([c,w])+")"),!0):!1}return!1},T.parsePAC=function(c,w){var v,y=this.cmdHistory,F=(c>=17&&c<=23||c>=25&&c<=31)&&w>=64&&w<=127,B=(c===16||c===24)&&w>=64&&w<=95;if(!(F||B))return!1;if(L(c,w,y))return S(null,null,y),!0;var R=c<=23?1:2;w>=64&&w<=95?v=R===1?i[c]:g[c]:v=R===1?D[c]:p[c];var j=this.channels[R];return j?(j.setPAC(this.interpretPAC(v,w)),S(c,w,y),this.currentChannel=R,!0):!1},T.interpretPAC=function(c,w){var v,y={color:null,italics:!1,indent:null,underline:!1,row:c};return w>95?v=w-96:v=w-64,y.underline=(v&1)===1,v<=13?y.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(v/2)]:v<=15?(y.italics=!0,y.color="white"):y.indent=Math.floor((v-16)/2)*4,y},T.parseChars=function(c,w){var v,y=null,F=null;if(c>=25?(v=2,F=c-8):(v=1,F=c),F>=17&&F<=19){var B;F===17?B=w+80:F===18?B=w+112:B=w+144,this.logger.log(u.INFO,"Special char '"+k(B)+"' in channel "+v),y=[B]}else c>=32&&c<=127&&(y=w===0?[c]:[c,w]);if(y){var R=f(y);this.logger.log(u.DEBUG,"Char codes = "+R.join(",")),S(c,w,this.cmdHistory)}return y},T.parseBackgroundAttributes=function(c,w){var v=(c===16||c===24)&&w>=32&&w<=47,y=(c===23||c===31)&&w>=45&&w<=47;if(!(v||y))return!1;var F,B={};c===16||c===24?(F=Math.floor((w-32)/2),B.background=m[F],w%2===1&&(B.background=B.background+"_semi")):w===45?B.background="transparent":(B.foreground="black",w===47&&(B.underline=!0));var R=c<=23?1:2,j=this.channels[R];return j.setBkgData(B),S(c,w,this.cmdHistory),!0},T.reset=function(){for(var c=0;c=16?h--:h++;var S=Object(X.fixLineBreaks)(a.trim()),L=Object(U.generateCueId)(g,p,S);(!D||!D.cues||!D.cues.getCueById(L))&&(f=new s(g,p,S),f.id=L,f.line=A+1,f.align="left",f.position=10+Math.min(80,Math.floor(h*8/32)*10),u.push(f))}return D&&u.length&&(u.sort(function(O,C){return O.line==="auto"||C.line==="auto"?0:O.line>8&&C.line>8?C.line-O.line:O.line-C.line}),u.forEach(function(O){return Object(k.addCueToTrack)(D,O)})),u}};$.default=W},"./src/utils/discontinuities.ts":function(re,$,P){"use strict";P.r($),P.d($,"findFirstFragWithCC",function(){return G}),P.d($,"shouldAlignOnDiscontinuities",function(){return W}),P.d($,"findDiscontinuousReferenceFrag",function(){return i}),P.d($,"adjustSlidingStart",function(){return g}),P.d($,"alignStream",function(){return p}),P.d($,"alignPDT",function(){return u}),P.d($,"alignFragmentByPDTDelta",function(){return o}),P.d($,"alignMediaPlaylistByPDT",function(){return f});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/logger.ts"),k=P("./src/controller/level-helper.ts");function G(l,h){for(var a=null,s=0,A=l.length;sa.startCC||l&&l.cc=this.minWeight_},G.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},G.destroy=function(){},k}();$.default=U},"./src/utils/ewma.ts":function(re,$,P){"use strict";P.r($);var X=function(){function U(G,W,i){W===void 0&&(W=0),i===void 0&&(i=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=G,this.alpha_=G?Math.exp(Math.log(.5)/G):0,this.estimate_=W,this.totalWeight_=i}var k=U.prototype;return k.sample=function(W,i){var D=Math.pow(this.alpha_,W);this.estimate_=i*(1-D)+D*this.estimate_,this.totalWeight_+=W},k.getTotalWeight=function(){return this.totalWeight_},k.getEstimate=function(){if(this.alpha_){var W=1-Math.pow(this.alpha_,this.totalWeight_);if(W)return this.estimate_/W}return this.estimate_},U}();$.default=X},"./src/utils/fetch-loader.ts":function(re,$,P){"use strict";P.r($),P.d($,"fetchSupported",function(){return o});var X=P("./src/polyfills/number.ts"),U=P("./src/loader/load-stats.ts"),k=P("./src/demux/chunk-cache.ts");function G(s,A){s.prototype=Object.create(A.prototype),s.prototype.constructor=s,p(s,A)}function W(s){var A=typeof Map=="function"?new Map:void 0;return W=function(S){if(S===null||!g(S))return S;if(typeof S!="function")throw new TypeError("Super expression must either be null or a function");if(typeof A!="undefined"){if(A.has(S))return A.get(S);A.set(S,L)}function L(){return i(S,arguments,m(this).constructor)}return L.prototype=Object.create(S.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),p(L,S)},W(s)}function i(s,A,E){return D()?i=Reflect.construct:i=function(L,O,C){var T=[null];T.push.apply(T,O);var x=Function.bind.apply(L,T),c=new x;return C&&p(c,C.prototype),c},i.apply(null,arguments)}function D(){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 g(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function p(s,A){return p=Object.setPrototypeOf||function(S,L){return S.__proto__=L,S},p(s,A)}function m(s){return m=Object.setPrototypeOf?Object.getPrototypeOf:function(E){return E.__proto__||Object.getPrototypeOf(E)},m(s)}function u(){return u=Object.assign||function(s){for(var A=1;A=C&&T(L,O,x.flush(),S)):T(L,O,F,S),v()}).catch(function(){return Promise.reject()})};return w()},s}();function l(s,A){var E={method:"GET",mode:"cors",credentials:"same-origin",signal:A,headers:new self.Headers(u({},s.headers))};return s.rangeEnd&&E.headers.set("Range","bytes="+s.rangeStart+"-"+String(s.rangeEnd-1)),E}function h(s,A){return new self.Request(s.url,A)}var a=function(s){G(A,s);function A(E,S,L){var O;return O=s.call(this,E)||this,O.code=void 0,O.details=void 0,O.code=S,O.details=L,O}return A}(W(Error));$.default=f},"./src/utils/imsc1-ttml-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"IMSC1_CODEC",function(){return g}),P.d($,"parseIMSC1",function(){return o});var X=P("./src/utils/mp4-tools.ts"),U=P("./src/utils/vttparser.ts"),k=P("./src/utils/vttcue.ts"),G=P("./src/demux/id3.ts"),W=P("./src/utils/timescale-conversion.ts"),i=P("./src/utils/webvtt-parser.ts");function D(){return D=Object.assign||function(C){for(var T=1;T"):X}function W(g){for(var p=arguments.length,m=new Array(p>1?p-1:0),u=1;u>24,A[E+1]=S>>16&255,A[E+2]=S>>8&255,A[E+3]=S&255}function p(A,E){var S=[];if(!E.length)return S;var L,O,C;"data"in A?(L=A.data,O=A.start,C=A.end):(L=A,O=0,C=L.byteLength);for(var T=O;T1?T+x:C;if(c===E[0])if(E.length===1)S.push({data:L,start:T+8,end:w});else{var v=p({data:L,start:T+8,end:w},E.slice(1));v.length&&G.apply(S,v)}T=w}return S}function m(A){var E=p(A,["moov"]),S=E[0],L=S?S.end:null,O=p(A,["sidx"]);if(!O||!O[0])return null;var C=[],T=O[0],x=T.data[0],c=x===0?8:16,w=D(T,c);c+=4;var v=0,y=0;x===0?c+=8:c+=16,c+=2;var F=T.end+y,B=i(T,c);c+=2;for(var R=0;R>>31;if(Y===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ee=D(T,j);j+=4,C.push({referenceSize:b,subsegmentDuration:ee,info:{duration:ee/w,start:F,end:F+b-1}}),F+=b,j+=4,c=j}return{earliestPresentationTime:v,timescale:w,version:x,referencesCount:B,references:C,moovEndOffset:L}}function u(A){for(var E=[],S=p(A,["moov","trak"]),L=0;LW)&&(this.startTime=W),this.endTime=i,this.screen=D,this.timelineController.createCaptionsTrack(this.trackName)},k.reset=function(){this.cueRanges=[]},U}()},"./src/utils/texttrack-utils.ts":function(re,$,P){"use strict";P.r($),P.d($,"sendAddTrackEvent",function(){return U}),P.d($,"addCueToTrack",function(){return k}),P.d($,"clearCurrentCues",function(){return G}),P.d($,"removeCuesInRange",function(){return W}),P.d($,"getCuesInRange",function(){return D});var X=P("./src/utils/logger.ts");function U(g,p){var m;try{m=new Event("addtrack")}catch(u){m=document.createEvent("Event"),m.initEvent("addtrack",!1,!1)}m.track=g,p.dispatchEvent(m)}function k(g,p){var m=g.mode;if(m==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(p.id))try{if(g.addCue(p),!g.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(o){X.logger.debug("[texttrack-utils]: "+o);var u=new self.TextTrackCue(p.startTime,p.endTime,p.text);u.id=p.id,g.addCue(u)}m==="disabled"&&(g.mode=m)}function G(g){var p=g.mode;if(p==="disabled"&&(g.mode="hidden"),g.cues)for(var m=g.cues.length;m--;)g.removeCue(g.cues[m]);p==="disabled"&&(g.mode=p)}function W(g,p,m){var u=g.mode;if(u==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var o=D(g.cues,p,m),f=0;fg[m].endTime)return-1;for(var u=0,o=m;u<=o;){var f=Math.floor((o+u)/2);if(pg[f].startTime&&u-1)for(var f=o,l=g.length;f=p&&h.endTime<=m)u.push(h);else if(h.startTime>m)return u}return u}},"./src/utils/time-ranges.ts":function(re,$,P){"use strict";P.r($);var X={toString:function(k){for(var G="",W=k.length,i=0;i1?p-1:0),u=1;u100)throw new Error("Position must be between 0 and 100.");C=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"positionAlign",i({},o,{get:function(){return T},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");T=y,this.hasBeenReset=!0}})),Object.defineProperty(u,"size",i({},o,{get:function(){return x},set:function(v){if(v<0||v>100)throw new Error("Size must be between 0 and 100.");x=v,this.hasBeenReset=!0}})),Object.defineProperty(u,"align",i({},o,{get:function(){return c},set:function(v){var y=W(v);if(!y)throw new SyntaxError("An invalid or illegal string was specified.");c=y,this.hasBeenReset=!0}})),u.displayState=void 0}return D.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},D}()},"./src/utils/vttparser.ts":function(re,$,P){"use strict";P.r($),P.d($,"parseTimeStamp",function(){return k}),P.d($,"fixLineBreaks",function(){return p}),P.d($,"VTTParser",function(){return m});var X=P("./src/utils/vttcue.ts"),U=function(){function u(){}var o=u.prototype;return o.decode=function(l,h){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},u}();function k(u){function o(l,h,a,s){return(l|0)*3600+(h|0)*60+(a|0)+parseFloat(s||0)}var f=u.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return f?parseFloat(f[2])>59?o(f[2],f[3],0,f[4]):o(f[1],f[2],f[3],f[4]):null}var G=function(){function u(){this.values=Object.create(null)}var o=u.prototype;return o.set=function(l,h){!this.get(l)&&h!==""&&(this.values[l]=h)},o.get=function(l,h,a){return a?this.has(l)?this.values[l]:h[a]:this.has(l)?this.values[l]:h},o.has=function(l){return l in this.values},o.alt=function(l,h,a){for(var s=0;s=0&&a<=100)return this.set(l,a),!0}return!1},u}();function W(u,o,f,l){var h=l?u.split(l):[u];for(var a in h){if(typeof h[a]!="string")continue;var s=h[a].split(f);if(s.length!==2)continue;var A=s[0],E=s[1];o(A,E)}}var i=new X.default(0,0,""),D=i.align==="middle"?"middle":"center";function g(u,o,f){var l=u;function h(){var A=k(u);if(A===null)throw new Error("Malformed timestamp: "+l);return u=u.replace(/^[^\sa-zA-Z-]+/,""),A}function a(A,E){var S=new G;W(A,function(C,T){var x;switch(C){case"region":for(var c=f.length-1;c>=0;c--)if(f[c].id===T){S.set(C,f[c].region);break}break;case"vertical":S.alt(C,T,["rl","lr"]);break;case"line":x=T.split(","),S.integer(C,x[0]),S.percent(C,x[0])&&S.set("snapToLines",!1),S.alt(C,x[0],["auto"]),x.length===2&&S.alt("lineAlign",x[1],["start",D,"end"]);break;case"position":x=T.split(","),S.percent(C,x[0]),x.length===2&&S.alt("positionAlign",x[1],["start",D,"end","line-left","line-right","auto"]);break;case"size":S.percent(C,T);break;case"align":S.alt(C,T,["start",D,"end","left","right"]);break}},/:/,/\s/),E.region=S.get("region",null),E.vertical=S.get("vertical","");var L=S.get("line","auto");L==="auto"&&i.line===-1&&(L=-1),E.line=L,E.lineAlign=S.get("lineAlign","start"),E.snapToLines=S.get("snapToLines",!0),E.size=S.get("size",100),E.align=S.get("align",D);var O=S.get("position","auto");O==="auto"&&i.position===50&&(O=E.align==="start"||E.align==="left"?0:E.align==="end"||E.align==="right"?100:50),E.position=O}function s(){u=u.replace(/^\s+/,"")}if(s(),o.startTime=h(),s(),u.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);u=u.substr(3),s(),o.endTime=h(),s(),a(u,o)}function p(u){return u.replace(//gi,` `)}var m=function(){function u(){this.state="INITIAL",this.buffer="",this.decoder=new U,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var o=u.prototype;return o.parse=function(l){var h=this;l&&(h.buffer+=h.decoder.decode(l,{stream:!0}));function a(){var O=h.buffer,C=0;for(O=p(O);C")===-1){h.cue.id=A;continue}case"CUE":if(!h.cue){h.state="BADCUE";continue}try{g(A,h.cue,h.regionList)}catch(O){h.cue=null,h.state="BADCUE";continue}h.state="CUETEXT";continue;case"CUETEXT":{var L=A.indexOf("-->")!==-1;if(!A||L&&(S=!0)){h.oncue&&h.cue&&h.oncue(h.cue),h.cue=null,h.state="ID";continue}if(h.cue===null)continue;h.cue.text&&(h.cue.text+=` `),h.cue.text+=A}continue;case"BADCUE":A||(h.state="ID")}}}catch(O){h.state==="CUETEXT"&&h.cue&&h.oncue&&h.oncue(h.cue),h.cue=null,h.state=h.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},o.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=` `,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(h){l.onparsingerror&&l.onparsingerror(h)}return l.onflush&&l.onflush(),this},u}()},"./src/utils/webvtt-parser.ts":function(re,$,P){"use strict";P.r($),P.d($,"generateCueId",function(){return m}),P.d($,"parseWebVTT",function(){return o});var X=P("./src/polyfills/number.ts"),U=P("./src/utils/vttparser.ts"),k=P("./src/demux/id3.ts"),G=P("./src/utils/timescale-conversion.ts"),W=P("./src/remux/mp4-remuxer.ts"),i=/\r\n|\n\r|\n|\r/g,D=function(l,h,a){return a===void 0&&(a=0),l.substr(a,h.length)===h},g=function(l){var h=parseInt(l.substr(-3)),a=parseInt(l.substr(-6,2)),s=parseInt(l.substr(-9,2)),A=l.length>9?parseInt(l.substr(0,l.indexOf(":"))):0;if(!Object(X.isFiniteNumber)(h)||!Object(X.isFiniteNumber)(a)||!Object(X.isFiniteNumber)(s)||!Object(X.isFiniteNumber)(A))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return h+=1e3*a,h+=60*1e3*s,h+=60*60*1e3*A,h},p=function(l){for(var h=5381,a=l.length;a;)h=h*33^l.charCodeAt(--a);return(h>>>0).toString()};function m(f,l,h){return p(f.toString())+p(l.toString())+p(h)}var u=function(l,h,a){var s=l[h],A=l[s.prevCC];if(!A||!A.new&&s.new){l.ccOffset=l.presentationOffset=s.start,s.new=!1;return}for(;(E=A)!==null&&E!==void 0&&E.new;){var E;l.ccOffset+=s.start-A.start,s.new=!1,s=A,A=l[s.prevCC]}l.presentationOffset=a};function o(f,l,h,a,s,A,E,S){var L=new U.VTTParser,O=Object(k.utf8ArrayToStr)(new Uint8Array(f)).trim().replace(i,` `).split(` `),C=[],T=Object(G.toMpegTsClockFromTimescale)(l,h),x="00:00.000",c=0,w=0,v,y=!0,F=!1;L.oncue=function(B){var R=a[s],j=a.ccOffset,N=(c-T)/9e4;if(R!=null&&R.new&&(w!==void 0?j=a.ccOffset=R.start:u(a,s,N)),N&&(j=N-a.presentationOffset),F){var b=B.endTime-B.startTime,Y=Object(W.normalizePts)((B.startTime+j-w)*9e4,A*9e4)/9e4;B.startTime=Y,B.endTime=Y+b}var ee=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(ee)),B.id||(B.id=m(B.startTime,B.endTime,ee)),B.endTime>0&&C.push(B)},L.onparsingerror=function(B){v=B},L.onflush=function(){if(v){S(v);return}E(C)},O.forEach(function(B){if(y)if(D(B,"X-TIMESTAMP-MAP=")){y=!1,F=!0,B.substr(16).split(",").forEach(function(R){D(R,"LOCAL:")?x=R.substr(6):D(R,"MPEGTS:")&&(c=parseInt(R.substr(7)))});try{w=g(x)/1e3}catch(R){F=!1,v=R}return}else B===""&&(y=!1);L.parse(B+` `)}),L.flush()}},"./src/utils/xhr-loader.ts":function(re,$,P){"use strict";P.r($);var X=P("./src/utils/logger.ts"),U=P("./src/loader/load-stats.ts"),k=/^age:\s*[\d.]+\s*$/m,G=function(){function W(D){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=D?D.xhrSetup:null,this.stats=new U.LoadStats,this.retryDelay=0}var i=W.prototype;return i.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},i.abortInternal=function(){var g=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),g&&(g.onreadystatechange=null,g.onprogress=null,g.readyState!==4&&(this.stats.aborted=!0,g.abort()))},i.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},i.load=function(g,p,m){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=g,this.config=p,this.callbacks=m,this.retryDelay=p.retryDelay,this.loadInternal()},i.loadInternal=function(){var g=this.config,p=this.context;if(!g)return;var m=this.loader=new self.XMLHttpRequest,u=this.stats;u.loading.first=0,u.loaded=0;var o=this.xhrSetup;try{if(o)try{o(m,p.url)}catch(h){m.open("GET",p.url,!0),o(m,p.url)}m.readyState||m.open("GET",p.url,!0);var f=this.context.headers;if(f)for(var l in f)m.setRequestHeader(l,f[l])}catch(h){this.callbacks.onError({code:m.status,text:h.message},p,m);return}p.rangeEnd&&m.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),m.onreadystatechange=this.readystatechange.bind(this),m.onprogress=this.loadprogress.bind(this),m.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),m.send()},i.readystatechange=function(){var g=this.context,p=this.loader,m=this.stats;if(!g||!p)return;var u=p.readyState,o=this.config;if(m.aborted)return;if(u>=2)if(self.clearTimeout(this.requestTimeout),m.loading.first===0&&(m.loading.first=Math.max(self.performance.now(),m.loading.start)),u===4){p.onreadystatechange=null,p.onprogress=null;var f=p.status;if(f>=200&&f<300){m.loading.end=Math.max(self.performance.now(),m.loading.first);var l,h;if(g.responseType==="arraybuffer"?(l=p.response,h=l.byteLength):(l=p.responseText,h=l.length),m.loaded=m.total=h,!this.callbacks)return;var a=this.callbacks.onProgress;if(a&&a(m,g,l,p),!this.callbacks)return;var s={url:p.responseURL,data:l};this.callbacks.onSuccess(s,m,g,p)}else m.retry>=o.maxRetry||f>=400&&f<499?(X.logger.error(f+" while loading "+g.url),this.callbacks.onError({code:f,text:p.statusText},g,p)):(X.logger.warn(f+" while loading "+g.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,o.maxRetryDelay),m.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),o.timeout)},i.loadtimeout=function(){X.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},i.loadprogress=function(g){var p=this.stats;p.loaded=g.loaded,g.lengthComputable&&(p.total=g.total)},i.getCacheAge=function(){var g=null;if(this.loader&&k.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");g=p?parseFloat(p):null}return g},W}();$.default=G}}).default})},vHTk:function(ht,be,Z){ht.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);