You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
NewEduCoderBuild/p__RestFul.015fa740.async.js

403 lines
941 KiB

(window.webpackJsonp=window.webpackJsonp||[]).push([[245,5,7,9],{"+ua5":function(Fe,ce,z){},"/cxE":function(Fe,ce,z){"use strict";z.d(ce,"f",function(){return O}),z.d(ce,"g",function(){return H}),z.d(ce,"h",function(){return I}),z.d(ce,"e",function(){return j}),z.d(ce,"b",function(){return N}),z.d(ce,"c",function(){return e}),z.d(ce,"d",function(){return w}),z.d(ce,"a",function(){return g});class oe{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(f){setTimeout(()=>{throw f.stack?new Error(f.message+`
`+f.stack):f},0)}}emit(f){this.listeners.forEach(o=>{o(f)})}onUnexpectedError(f){this.unexpectedErrorHandler(f),this.emit(f)}onUnexpectedExternalError(f){this.unexpectedErrorHandler(f)}}const B=new oe;function O(f){j(f)||B.onUnexpectedError(f);return}function H(f){j(f)||B.onUnexpectedExternalError(f);return}function I(f){if(f instanceof Error){let{name:o,message:n}=f;const a=f.stacktrace||f.stack;return{$isError:!0,name:o,message:n,stack:a}}return f}const C="Canceled";function j(f){return f instanceof Error&&f.name===C&&f.message===C}function N(){const f=new Error(C);return f.name=f.message,f}function e(f){return f?new Error(`Illegal argument: ${f}`):new Error("Illegal argument")}function w(f){return f?new Error(`Illegal state: ${f}`):new Error("Illegal state")}class g extends Error{constructor(f){super("NotSupported");f&&(this.message=f)}}},"24hK":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return B});class oe{constructor(O){this.element=O,this.next=oe.Undefined,this.prev=oe.Undefined}}oe.Undefined=new oe(void 0);class B{constructor(){this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===oe.Undefined}clear(){let O=this._first;for(;O!==oe.Undefined;){const H=O.next;O.prev=oe.Undefined,O.next=oe.Undefined,O=H}this._first=oe.Undefined,this._last=oe.Undefined,this._size=0}unshift(O){return this._insert(O,!1)}push(O){return this._insert(O,!0)}_insert(O,H){const I=new oe(O);if(this._first===oe.Undefined)this._first=I,this._last=I;else if(H){const j=this._last;this._last=I,I.prev=j,j.next=I}else{const j=this._first;this._first=I,I.next=j,j.prev=I}this._size+=1;let C=!1;return()=>{C||(C=!0,this._remove(I))}}shift(){if(this._first===oe.Undefined)return;{const O=this._first.element;return this._remove(this._first),O}}pop(){if(this._last===oe.Undefined)return;{const O=this._last.element;return this._remove(this._last),O}}_remove(O){if(O.prev!==oe.Undefined&&O.next!==oe.Undefined){const H=O.prev;H.next=O.next,O.next.prev=H}else O.prev===oe.Undefined&&O.next===oe.Undefined?(this._first=oe.Undefined,this._last=oe.Undefined):O.next===oe.Undefined?(this._last=this._last.prev,this._last.next=oe.Undefined):O.prev===oe.Undefined&&(this._first=this._first.next,this._first.prev=oe.Undefined);this._size-=1}*[Symbol.iterator](){let O=this._first;for(;O!==oe.Undefined;)yield O.element,O=O.next}}},"3/fG":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return B});function oe(O,H){let I;return H.length===0?I=O:I=O.replace(/\{(\d+)\}/g,function(C,j){const N=j[0];return typeof H[N]!="undefined"?H[N]:C}),I}function B(O,H,...I){return oe(H,I)}},"55Ip":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return r});var oe=z("Ty5D"),B=z("dI71"),O=z("q1tI"),H=z.n(O),I=z("YS25"),C=z("17x9"),j=z.n(C),N=z("wx14"),e=z("zLVn"),w=z("9R94"),g=function(h){Object(B.a)(c,h);function c(){for(var E,y=arguments.length,T=new Array(y),D=0;D<y;D++)T[D]=arguments[D];return E=h.call.apply(h,[this].concat(T))||this,E.history=Object(I.a)(E.props),E}var d=c.prototype;return d.render=function(){return H.a.createElement(oe.c,{history:this.history,children:this.props.children})},c}(H.a.Component),f=function(h){Object(B.a)(c,h);function c(){for(var E,y=arguments.length,T=new Array(y),D=0;D<y;D++)T[D]=arguments[D];return E=h.call.apply(h,[this].concat(T))||this,E.history=Object(I.b)(E.props),E}var d=c.prototype;return d.render=function(){return H.a.createElement(oe.c,{history:this.history,children:this.props.children})},c}(H.a.Component),o=function(c,d){return typeof c=="function"?c(d):c},n=function(c,d){return typeof c=="string"?Object(I.c)(c,null,null,d):c},a=function(c){return c},l=H.a.forwardRef;typeof l=="undefined"&&(l=a);function s(h){return!!(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)}var i=l(function(h,c){var d=h.innerRef,E=h.navigate,y=h.onClick,T=Object(e.a)(h,["innerRef","navigate","onClick"]),D=T.target,L=Object(N.a)({},T,{onClick:function(k){try{y&&y(k)}catch(U){throw k.preventDefault(),U}!k.defaultPrevented&&k.button===0&&(!D||D==="_self")&&!s(k)&&(k.preventDefault(),E())}});return a!==l?L.ref=c||d:L.ref=d,H.a.createElement("a",L)}),r=l(function(h,c){var d=h.component,E=d===void 0?i:d,y=h.replace,T=h.to,D=h.innerRef,L=Object(e.a)(h,["component","replace","to","innerRef"]);return H.a.createElement(oe.e.Consumer,null,function(x){x||Object(w.a)(!1);var k=x.history,U=n(o(T,x.location),x.location),R=U?k.createHref(U):"",V=Object(N.a)({},L,{href:R,navigate:function(){var ue=o(T,x.location),le=y?k.replace:k.push;le(ue)}});return a!==l?V.ref=c||D:V.innerRef=D,H.a.createElement(E,V)})});if(!1)var t,v;var m=function(c){return c},p=H.a.forwardRef;typeof p=="undefined"&&(p=m);function _(){for(var h=arguments.length,c=new Array(h),d=0;d<h;d++)c[d]=arguments[d];return c.filter(function(E){return E}).join(" ")}var b=p(function(h,c){var d=h["aria-current"],E=d===void 0?"page":d,y=h.activeClassName,T=y===void 0?"active":y,D=h.activeStyle,L=h.className,x=h.exact,k=h.isActive,U=h.location,R=h.sensitive,V=h.strict,Z=h.style,ue=h.to,le=h.innerRef,ge=Object(e.a)(h,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return H.a.createElement(oe.e.Consumer,null,function(pe){pe||Object(w.a)(!1);var ae=U||pe.location,ne=n(o(ue,ae),ae),fe=ne.pathname,q=fe&&fe.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),M=q?Object(oe.f)(ae.pathname,{path:q,exact:x,sensitive:R,strict:V}):null,S=!!(k?k(M,ae):M),A=S?_(L,T):L,F=S?Object(N.a)({},Z,{},D):Z,K=Object(N.a)({"aria-current":S&&E||null,className:A,style:F,to:ne},ge);return m!==p?K.ref=c||le:K.innerRef=le,H.a.createElement(r,K)})});if(!1)var u},"5VLF":function(Fe,ce,z){"use strict";var oe,B;function O(H,I,C){var j=function(N,e){return H.js_beautify(N,e)};return j.js=H.js_beautify,j.css=I.css_beautify,j.html=C.html_beautify,j.js_beautify=H.js_beautify,j.css_beautify=I.css_beautify,j.html_beautify=C.html_beautify,j}!(oe=[z("6UM0"),z("TXwP"),z("psGv")],B=function(H,I,C){return O(H,I,C)}.apply(ce,oe),B!==void 0&&(Fe.exports=B))},"5Y4S":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return O});var oe=z("MNsG");const B=oe.b.performance&&typeof oe.b.performance.now=="function";class O{constructor(H){this._highResolution=B&&H,this._startTime=this._now(),this._stopTime=-1}static create(H=!0){return new O(H)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?oe.b.performance.now():Date.now()}}},"6UM0":function(Fe,ce,z){var oe,B;(function(){var O;(function(){"use strict";var I=[function(e,w,g){var f=g(1).Beautifier,o=g(5).Options;function n(a,l){var s=new f(a,l);return s.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new o}},function(e,w,g){var f=g(2).Output,o=g(3).Token,n=g(4),a=g(5).Options,l=g(7).Tokenizer,s=g(7).line_starters,i=g(7).positionable_operators,r=g(7).TOKEN;function t(R,V){return V.indexOf(R)!==-1}function v(R){return R.replace(/^\s+/g,"")}function m(R){for(var V={},Z=0;Z<R.length;Z++)V[R[Z].replace(/-/g,"_")]=R[Z];return V}function p(R,V){return R&&R.type===r.RESERVED&&R.text===V}function _(R,V){return R&&R.type===r.RESERVED&&t(R.text,V)}var b=["case","return","do","if","throw","else","await","break","continue","async"],u=["before-newline","after-newline","preserve-newline"],h=m(u),c=[h.before_newline,h.preserve_newline],d={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function E(R,V){if(V.multiline_frame||V.mode===d.ForInitializer||V.mode===d.Conditional)return;R.remove_indent(V.start_line_index)}function y(R){R=R.replace(n.allLineBreaks,`
`);for(var V=[],Z=R.indexOf(`
`);Z!==-1;)V.push(R.substring(0,Z)),R=R.substring(Z+1),Z=R.indexOf(`
`);return R.length&&V.push(R),V}function T(R){return R===d.ArrayLiteral}function D(R){return t(R,[d.Expression,d.ForInitializer,d.Conditional])}function L(R,V){for(var Z=0;Z<R.length;Z++){var ue=R[Z].trim();if(ue.charAt(0)!==V)return!1}return!0}function x(R,V){for(var Z=0,ue=R.length,le;Z<ue;Z++)if(le=R[Z],le&&le.indexOf(V)!==0)return!1;return!0}function k(R,V){V=V||{},this._source_text=R||"",this._output=null,this._tokens=null,this._last_last_text=null,this._flags=null,this._previous_flags=null,this._flag_store=null,this._options=new a(V)}k.prototype.create_flags=function(R,V){var Z=0;R&&(Z=R.indentation_level,!this._output.just_added_newline()&&R.line_indent_level>Z&&(Z=R.line_indent_level));var ue={mode:V,parent:R,last_token:R?R.last_token:new o(r.START_BLOCK,""),last_word:R?R.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:Z,alignment:0,line_indent_level:R?R.line_indent_level:Z,start_line_index:this._output.get_line_number(),ternary_depth:0};return ue},k.prototype._reset=function(R){var V=R.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new f(this._options,V),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var Z=new l(R,this._options);return this._tokens=Z.tokenize(),R},k.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var R,V=this._reset(this._source_text),Z=this._options.eol;this._options.eol==="auto"&&(Z=`
`,V&&n.lineBreak.test(V||"")&&(Z=V.match(n.lineBreak)[0]));for(var ue=this._tokens.next();ue;)this.handle_token(ue),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ue,ue=this._tokens.next();return R=this._output.get_code(Z),R},k.prototype.handle_token=function(R,V){R.type===r.START_EXPR?this.handle_start_expr(R):R.type===r.END_EXPR?this.handle_end_expr(R):R.type===r.START_BLOCK?this.handle_start_block(R):R.type===r.END_BLOCK?this.handle_end_block(R):R.type===r.WORD?this.handle_word(R):R.type===r.RESERVED?this.handle_word(R):R.type===r.SEMICOLON?this.handle_semicolon(R):R.type===r.STRING?this.handle_string(R):R.type===r.EQUALS?this.handle_equals(R):R.type===r.OPERATOR?this.handle_operator(R):R.type===r.COMMA?this.handle_comma(R):R.type===r.BLOCK_COMMENT?this.handle_block_comment(R,V):R.type===r.COMMENT?this.handle_comment(R,V):R.type===r.DOT?this.handle_dot(R):R.type===r.EOF?this.handle_eof(R):R.type===r.UNKNOWN?this.handle_unknown(R,V):this.handle_unknown(R,V)},k.prototype.handle_whitespace_and_comments=function(R,V){var Z=R.newlines,ue=this._options.keep_array_indentation&&T(this._flags.mode);if(R.comments_before)for(var le=R.comments_before.next();le;)this.handle_whitespace_and_comments(le,V),this.handle_token(le,V),le=R.comments_before.next();if(ue)for(var ge=0;ge<Z;ge+=1)this.print_newline(ge>0,V);else if(this._options.max_preserve_newlines&&Z>this._options.max_preserve_newlines&&(Z=this._options.max_preserve_newlines),this._options.preserve_newlines&&Z>1){this.print_newline(!1,V);for(var pe=1;pe<Z;pe+=1)this.print_newline(!0,V)}};var U=["async","break","continue","return","throw","yield"];k.prototype.allow_wrap_or_preserved_newline=function(R,V){if(V=V===void 0?!1:V,this._output.just_added_newline())return;var Z=this._options.preserve_newlines&&R.newlines||V,ue=t(this._flags.last_token.text,i)||t(R.text,i);if(ue){var le=t(this._flags.last_token.text,i)&&t(this._options.operator_position,c)||t(R.text,i);Z=Z&&le}if(Z)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(_(this._flags.last_token,U))return;this._output.set_wrap_point()}},k.prototype.print_newline=function(R,V){if(!V&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var Z=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&p(Z,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(R)&&(this._flags.multiline_frame=!0)},k.prototype.print_token_line_indentation=function(R){this._output.just_added_newline()&&(this._options.keep_array_indentation&&R.newlines&&(R.text==="["||T(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(R.whitespace_before),this._output.space_before_token=!1):this._output.set_indent(this._flags.indentation_level,this._flags.alignment)&&(this._flags.line_indent_level=this._flags.indentation_level))},k.prototype.print_token=function(R){if(this._output.raw){this._output.add_raw_token(R);return}if(this._options.comma_first&&R.previous&&R.previous.type===r.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var V=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(V),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(R),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(R),this._output.non_breaking_space=!0,this._output.add_token(R.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},k.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},k.prototype.deindent=function(){this._flags.indentation_level>0&&(!this._flags.parent||this._flags.indentation_level>this._flags.parent.indentation_level)&&(this._flags.indentation_level-=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},k.prototype.set_mode=function(R){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,R),this._flags=this.create_flags(this._previous_flags,R),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},k.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===d.Statement&&E(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},k.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||_(this._flags.last_token,["get","set"]))},k.prototype.start_of_statement=function(R){var V=!1;return V=V||_(this._flags.last_token,["var","let","const"])&&R.type===r.WORD,V=V||p(this._flags.last_token,"do"),V=V||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&_(this._flags.last_token,U)&&!R.newlines,V=V||p(this._flags.last_token,"else")&&!(p(R,"if")&&!R.comments_before),V=V||this._flags.last_token.type===r.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),V=V||this._flags.last_token.type===r.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(R.text==="--"||R.text==="++")&&this._last_last_text!=="function"&&R.type!==r.WORD&&R.type!==r.RESERVED,V=V||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||_(this._flags.last_token,["get","set"])),V?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(R,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R,_(R,["do","for","if","while"])),!0):!1},k.prototype.handle_start_expr=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R);var V=d.Expression;if(R.text==="["){if(this._flags.last_token.type===r.WORD||this._flags.last_token.text===")"){_(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(R),this.set_mode(V),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}V=d.ArrayLiteral,T(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())),t(this._flags.last_token.type,[r.START_EXPR,r.END_EXPR,r.WORD,r.OPERATOR,r.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===r.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,V=d.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,V=d.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&R.whitespace_before===""?this._output.space_before_token=!1:(t(this._flags.last_token.text,s)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R);else if(this._flags.last_token.type===r.WORD){this._output.space_before_token=!1;var Z=this._tokens.peek(-3);if(this._options.space_after_named_function&&Z){var ue=this._tokens.peek(-4);_(Z,["async","function"])||Z.text==="*"&&_(ue,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(Z.text==="{"||Z.text===","||Z.text==="*"&&(ue.text==="{"||ue.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(R);(this._flags.last_token.type===r.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&t(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===r.START_BLOCK?this.print_newline():(this._flags.last_token.type===r.END_EXPR||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===r.COMMA)&&this.allow_wrap_or_preserved_newline(R,R.newlines),this.print_token(R),this.set_mode(V),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},k.prototype.handle_end_expr=function(R){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(R,R.text==="]"&&T(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===r.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(R),this.restore_mode(),E(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===d.Conditional&&(this._previous_flags.mode=d.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},k.prototype.handle_start_block=function(R){this.handle_whitespace_and_comments(R);var V=this._tokens.peek(),Z=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===r.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):Z&&(t(Z.text,[":",","])&&t(V.type,[r.STRING,r.WORD,r.RESERVED])||t(V.text,["get","set","..."])&&t(Z.type,[r.WORD,r.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(Z.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===r.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):t(this._flags.last_token.type,[r.EQUALS,r.START_EXPR,r.COMMA,r.OPERATOR])||_(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(_(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ue=!V.comments_before&&V.text==="}",le=ue&&this._flags.last_word==="function"&&this._flags.last_token.type===r.END_EXPR;if(this._options.brace_preserve_inline){var ge=0,pe=null;this._flags.inline_frame=!0;do if(ge+=1,pe=this._tokens.peek(ge-1),pe.newlines){this._flags.inline_frame=!1;break}while(pe.type!==r.EOF&&!(pe.type===r.END_BLOCK&&pe.opened===R))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==r.OPERATOR&&(le||this._flags.last_token.type===r.EQUALS||_(this._flags.last_token,b)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(T(this._previous_flags.mode)&&(this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.COMMA)&&((this._flags.last_token.type===r.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(R),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==r.OPERATOR&&this._flags.last_token.type!==r.START_EXPR&&(this._flags.last_token.type===r.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(R),this.indent(),!ue&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},k.prototype.handle_end_block=function(R){for(this.handle_whitespace_and_comments(R);this._flags.mode===d.Statement;)this.restore_mode();var V=this._flags.last_token.type===r.START_BLOCK;this._flags.inline_frame&&!V?this._output.space_before_token=!0:this._options.brace_style==="expand"?V||this.print_newline():V||(T(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(R)},k.prototype.handle_word=function(R){if(R.type===r.RESERVED){if(t(R.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)R.type=r.WORD;else if(R.text==="import"&&t(this._tokens.peek().text,["(","."]))R.type=r.WORD;else if(t(R.text,["as","from"])&&!this._flags.import_block)R.type=r.WORD;else if(this._flags.mode===d.ObjectLiteral){var V=this._tokens.peek();V.text===":"&&(R.type=r.WORD)}}if(this.start_of_statement(R)?_(this._flags.last_token,["var","let","const"])&&R.type===r.WORD&&(this._flags.declaration_statement=!0):R.newlines&&!D(this._flags.mode)&&(this._flags.last_token.type!==r.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==r.EQUALS&&(this._options.preserve_newlines||!_(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(R),this.print_newline()):this.handle_whitespace_and_comments(R),this._flags.do_block&&!this._flags.do_while)if(p(R,"while")){this._output.space_before_token=!0,this.print_token(R),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&&p(R,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&_(R,["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(R),this._flags.in_case=!0;return}if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R)),p(R,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===r.OPERATOR))&&(!this._output.just_added_blankline()&&!R.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD?_(this._flags.last_token,["get","set","new","export"])||_(this._flags.last_token,U)?this._output.space_before_token=!0:p(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===r.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(D(this._flags.mode)||T(this._flags.mode))||this.print_newline(),this.print_token(R),this._flags.last_word=R.text;return}var Z="NONE";if(this._flags.last_token.type===r.END_BLOCK?this._previous_flags.inline_frame?Z="SPACE":_(R,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines?Z="NEWLINE":(Z="SPACE",this._output.space_before_token=!0):Z="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&this._flags.mode===d.BlockStatement?Z="NEWLINE":this._flags.last_token.type===r.SEMICOLON&&D(this._flags.mode)?Z="SPACE":this._flags.last_token.type===r.STRING?Z="NEWLINE":this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&t(this._last_last_text,["{",","]))?Z="SPACE":this._flags.last_token.type===r.START_BLOCK?this._flags.inline_frame?Z="SPACE":Z="NEWLINE":this._flags.last_token.type===r.END_EXPR&&(this._output.space_before_token=!0,Z="NEWLINE"),_(R,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?Z="SPACE":Z="NEWLINE"),_(R,["else","catch","finally"]))if((!(this._flags.last_token.type===r.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&R.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ue=this._output.current_line;ue.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else Z==="NEWLINE"?_(this._flags.last_token,b)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&_(R,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==r.END_EXPR?(this._flags.last_token.type!==r.START_EXPR||!_(R,["var","let","const"]))&&this._flags.last_token.text!==":"&&(p(R,"if")&&p(R.previous,"else")?this._output.space_before_token=!0:this.print_newline()):_(R,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&T(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():Z==="SPACE"&&(this._output.space_before_token=!0);R.previous&&(R.previous.type===r.WORD||R.previous.type===r.RESERVED)&&(this._output.space_before_token=!0),this.print_token(R),this._flags.last_word=R.text,R.type===r.RESERVED&&(R.text==="do"?this._flags.do_block=!0:R.text==="if"?this._flags.if_block=!0:R.text==="import"?this._flags.import_block=!0:this._flags.import_block&&p(R,"from")&&(this._flags.import_block=!1))},k.prototype.handle_semicolon=function(R){this.start_of_statement(R)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(R);for(var V=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&p(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(R)},k.prototype.handle_string=function(R){R.text.startsWith("`")&&R.newlines===0&&R.whitespace_before===""&&(R.previous.text===")"||this._flags.last_token.type===r.WORD)||(this.start_of_statement(R)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(R),this._flags.last_token.type===r.RESERVED||this._flags.last_token.type===r.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR||this._flags.last_token.type===r.EQUALS||this._flags.last_token.type===r.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(R):R.text.startsWith("`")&&this._flags.last_token.type===r.END_EXPR&&(R.previous.text==="]"||R.previous.text===")")&&R.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(R)},k.prototype.handle_equals=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0},k.prototype.handle_comma=function(R){this.handle_whitespace_and_comments(R,!0),this.print_token(R),this._output.space_before_token=!0,this._flags.declaration_statement?(D(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(R)):this._flags.mode===d.ObjectLiteral||this._flags.mode===d.Statement&&this._flags.parent.mode===d.ObjectLiteral?(this._flags.mode===d.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(R)},k.prototype.handle_operator=function(R){var V=R.text==="*"&&(_(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[r.START_BLOCK,r.COMMA,r.END_BLOCK,r.SEMICOLON])),Z=t(R.text,["-","+"])&&(t(this._flags.last_token.type,[r.START_BLOCK,r.START_EXPR,r.EQUALS,r.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(R)){var ue=!V;this.handle_whitespace_and_comments(R,ue)}if(R.text==="*"&&this._flags.last_token.type===r.DOT){this.print_token(R);return}if(R.text==="::"){this.print_token(R);return}if(this._flags.last_token.type===r.OPERATOR&&t(this._options.operator_position,c)&&this.allow_wrap_or_preserved_newline(R),R.text===":"&&this._flags.in_case){this.print_token(R),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==r.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 le=!0,ge=!0,pe=!1;if(R.text===":"?this._flags.ternary_depth===0?le=!1:(this._flags.ternary_depth-=1,pe=!0):R.text==="?"&&(this._flags.ternary_depth+=1),!Z&&!V&&this._options.preserve_newlines&&t(R.text,i)){var ae=R.text===":",ne=ae&&pe,fe=ae&&!pe;switch(this._options.operator_position){case h.before_newline:this._output.space_before_token=!fe,this.print_token(R),(!ae||ne)&&this.allow_wrap_or_preserved_newline(R),this._output.space_before_token=!0;return;case h.after_newline:this._output.space_before_token=!0,!ae||ne?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(R):this._output.space_before_token=!1,this.print_token(R),this._output.space_before_token=!0;return;case h.preserve_newline:fe||this.allow_wrap_or_preserved_newline(R),le=!(this._output.just_added_newline()||fe),this._output.space_before_token=le,this.print_token(R),this._output.space_before_token=!0;return}}if(V){this.allow_wrap_or_preserved_newline(R),le=!1;var q=this._tokens.peek();ge=q&&t(q.type,[r.WORD,r.RESERVED])}else if(R.text==="...")this.allow_wrap_or_preserved_newline(R),le=this._flags.last_token.type===r.START_BLOCK,ge=!1;else if(t(R.text,["--","++","!","~"])||Z){if((this._flags.last_token.type===r.COMMA||this._flags.last_token.type===r.START_EXPR)&&this.allow_wrap_or_preserved_newline(R),le=!1,ge=!1,R.newlines&&(R.text==="--"||R.text==="++"||R.text==="~")){var M=_(this._flags.last_token,b)&&R.newlines;M&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(M,!0)}this._flags.last_token.text===";"&&D(this._flags.mode)&&(le=!0),this._flags.last_token.type===r.RESERVED?le=!0:this._flags.last_token.type===r.END_EXPR?le=!(this._flags.last_token.text==="]"&&(R.text==="--"||R.text==="++")):this._flags.last_token.type===r.OPERATOR&&(le=t(R.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(R.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(ge=!0)),(this._flags.mode===d.BlockStatement&&!this._flags.inline_frame||this._flags.mode===d.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||le,this.print_token(R),this._output.space_before_token=ge},k.prototype.handle_block_comment=function(R,V){if(this._output.raw){this._output.add_raw_token(R),R.directives&&R.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(R.directives){this.print_newline(!1,V),this.print_token(R),R.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!n.newline.test(R.text)&&!R.newlines){this._output.space_before_token=!0,this.print_token(R),this._output.space_before_token=!0;return}else this.print_block_commment(R,V)},k.prototype.print_block_commment=function(R,V){var Z=y(R.text),ue,le=!1,ge=!1,pe=R.whitespace_before,ae=pe.length;if(this.print_newline(!1,V),this.print_token_line_indentation(R),this._output.add_token(Z[0]),this.print_newline(!1,V),Z.length>1){for(Z=Z.slice(1),le=L(Z,"*"),ge=x(Z,pe),le&&(this._flags.alignment=1),ue=0;ue<Z.length;ue++)le?(this.print_token_line_indentation(R),this._output.add_token(v(Z[ue]))):ge&&Z[ue]?(this.print_token_line_indentation(R),this._output.add_token(Z[ue].substring(ae))):(this._output.current_line.set_indent(-1),this._output.add_token(Z[ue])),this.print_newline(!1,V);this._flags.alignment=0}},k.prototype.handle_comment=function(R,V){R.newlines?this.print_newline(!1,V):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(R),this.print_newline(!1,V)},k.prototype.handle_dot=function(R){this.start_of_statement(R)||this.handle_whitespace_and_comments(R,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),_(this._flags.last_token,b)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(R,this._flags.last_token.text===")"&&this._options.break_chained_methods),this._options.unindent_chained_methods&&this._output.just_added_newline()&&this.deindent(),this.print_token(R)},k.prototype.handle_unknown=function(R,V){this.print_token(R),R.text[R.text.length-1]===`
`&&this.print_newline(!1,V)},k.prototype.handle_eof=function(R){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(R)},e.exports.Beautifier=k},function(e){function w(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=[]}w.prototype.clone_empty=function(){var o=new w(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},w.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},w.prototype.has_match=function(o){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(o))return!0;return!1},w.prototype.set_indent=function(o,n){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.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)},w.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},w.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},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(o){this.__items.push(o);var n=o.lastIndexOf(`
`);n!==-1?this.__character_count=o.length-n:this.__character_count+=o.length},w.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.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 g(o,n){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)),n=n||"",o.indent_level>0&&(n=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}g.prototype.get_indent_size=function(o,n){var a=this.__base_string_length;return n=n||0,o<0&&(a=0),a+=o*this.__indent_size,a+=n,a},g.prototype.get_indent_string=function(o,n){var a=this.__base_string;return n=n||0,o<0&&(o=0,a=""),n+=o*this.__indent_size,this.__ensure_cache(n),a+=this.__cache[n],a},g.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var o=this.__cache.length,n=0,a="";this.__indent_size&&o>=this.__indent_size&&(n=Math.floor(o/this.__indent_size),o-=n*this.__indent_size,a=new Array(n+1).join(this.__indent_string)),o&&(a+=new Array(o+1).join(" ")),this.__cache.push(a)};function f(o,n){this.__indent_cache=new g(o,n),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 w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(o,n){return this.__indent_cache.get_indent_string(o,n)},f.prototype.get_indent_size=function(o,n){return this.__indent_cache.get_indent_size(o,n)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(o){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return o!==`
`&&(a=a.replace(/[\n]/g,o)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(o,n){return o=o||0,n=n||0,this.next_line.set_indent(o,n),this.__lines.length>1?(this.current_line.set_indent(o,n),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(o){for(var n=0;n<o.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(o){for(var n=this.__lines.length;o<n;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(o,n){for(var a=this.__lines.length-2;a>=0;){var l=this.__lines[a];if(l.is_empty())break;if(l.item(0).indexOf(o)!==0&&l.item(-1)!==n){this.__lines.splice(a+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},e.exports.Output=f},function(e){function w(g,f,o,n){this.type=g,this.text=f,this.comments_before=null,this.newlines=o||0,this.whitespace_before=n||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=w},function(e,w){var g="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",f="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",o="\\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",n="\\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",a="(?:\\\\u[0-9a-fA-F]{4}|["+g+o+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+f+o+n+"])*";w.identifier=new RegExp(a+l,"g"),w.identifierStart=new RegExp(a),w.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+f+o+n+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;w.newline=/[\n\r\u2028\u2029]/,w.lineBreak=new RegExp(`\r
|`+w.newline.source),w.allLineBreaks=new RegExp(w.lineBreak.source,"g")},function(e,w,g){var f=g(6).Options,o=["before-newline","after-newline","preserve-newline"];function n(a){f.call(this,a,"js");var l=this.raw_options.brace_style||null;l==="expand-strict"?this.raw_options.brace_style="expand":l==="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 s=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var i=0;i<s.length;i++)s[i]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[i];this.unindent_chained_methods=this._get_boolean("unindent_chained_methods"),this.break_chained_methods=this._get_boolean("break_chained_methods"),this.space_in_paren=this._get_boolean("space_in_paren"),this.space_in_empty_paren=this._get_boolean("space_in_empty_paren"),this.jslint_happy=this._get_boolean("jslint_happy"),this.space_after_anon_function=this._get_boolean("space_after_anon_function"),this.space_after_named_function=this._get_boolean("space_after_named_function"),this.keep_array_indentation=this._get_boolean("keep_array_indentation"),this.space_before_conditional=this._get_boolean("space_before_conditional",!0),this.unescape_strings=this._get_boolean("unescape_strings"),this.e4x=this._get_boolean("e4x"),this.comma_first=this._get_boolean("comma_first"),this.operator_position=this._get_selection("operator_position",o),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}n.prototype=new f,e.exports.Options=n},function(e){function w(o,n){this.raw_options=g(o,n),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"])}w.prototype._get_array=function(o,n){var a=this.raw_options[o],l=n||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(l=a.concat()):typeof a=="string"&&(l=a.split(/[^a-zA-Z0-9_\/\-]+/)),l},w.prototype._get_boolean=function(o,n){var a=this.raw_options[o],l=a===void 0?!!n:!!a;return l},w.prototype._get_characters=function(o,n){var a=this.raw_options[o],l=n||"";return typeof a=="string"&&(l=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},w.prototype._get_number=function(o,n){var a=this.raw_options[o];n=parseInt(n,10),isNaN(n)&&(n=0);var l=parseInt(a,10);return isNaN(l)&&(l=n),l},w.prototype._get_selection=function(o,n,a){var l=this._get_selection_list(o,n,a);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[o]+"'");return l[0]},w.prototype._get_selection_list=function(o,n,a){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[n[0]],!this._is_valid_selection(a,n))throw new Error("Invalid Default Value!");var l=this._get_array(o,a);if(!this._is_valid_selection(l,n))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[o]+"'");return l},w.prototype._is_valid_selection=function(o,n){return o.length&&n.length&&!o.some(function(a){return n.indexOf(a)===-1})};function g(o,n){var a={};o=f(o);var l;for(l in o)l!==n&&(a[l]=o[l]);if(n&&o[n])for(l in o[n])a[l]=o[n][l];return a}function f(o){var n={},a;for(a in o){var l=a.replace(/-/g,"_");n[l]=o[a]}return n}e.exports.Options=w,e.exports.normalizeOpts=f,e.exports.mergeOpts=g},function(e,w,g){var f=g(8).InputScanner,o=g(9).Tokenizer,n=g(9).TOKEN,a=g(13).Directives,l=g(4),s=g(12).Pattern,i=g(14).TemplatablePattern;function r(L,x){return x.indexOf(L)!==-1}var t={START_EXPR:"TK_START_EXPR",END_EXPR:"TK_END_EXPR",START_BLOCK:"TK_START_BLOCK",END_BLOCK:"TK_END_BLOCK",WORD:"TK_WORD",RESERVED:"TK_RESERVED",SEMICOLON:"TK_SEMICOLON",STRING:"TK_STRING",EQUALS:"TK_EQUALS",OPERATOR:"TK_OPERATOR",COMMA:"TK_COMMA",BLOCK_COMMENT:"TK_BLOCK_COMMENT",COMMENT:"TK_COMMENT",DOT:"TK_DOT",UNKNOWN:"TK_UNKNOWN",START:n.START,RAW:n.RAW,EOF:n.EOF},v=new a(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,p=/[0-9]/,_=/[^\d\.]/,b=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),u=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";u=u.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),u="\\?\\.(?!\\d) "+u,u=u.replace(/ /g,"|");var h=new RegExp(u),c="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),d=c.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),E=new RegExp("^(?:"+d.join("|")+")$"),y,T=function(L,x){o.call(this,L,x),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var k=new s(this._input),U=new i(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(l.identifier).matching(l.identifierMatch),number:k.matching(m),punct:k.matching(h),comment:k.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:k.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:k.matching(/<!--/),html_comment_end:k.matching(/-->/),include:k.starting_with(/#include/).until_after(l.lineBreak),shebang:k.starting_with(/#!/).until_after(l.lineBreak),xml:k.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:U.until(/['\\\n\r\u2028\u2029]/),double_quote:U.until(/["\\\n\r\u2028\u2029]/),template_text:U.until(/[`\\$]/),template_expression:U.until(/[`}\\]/)}};T.prototype=new o,T.prototype._is_comment=function(L){return L.type===t.COMMENT||L.type===t.BLOCK_COMMENT||L.type===t.UNKNOWN},T.prototype._is_opening=function(L){return L.type===t.START_BLOCK||L.type===t.START_EXPR},T.prototype._is_closing=function(L,x){return(L.type===t.END_BLOCK||L.type===t.END_EXPR)&&x&&(L.text==="]"&&x.text==="["||L.text===")"&&x.text==="("||L.text==="}"&&x.text==="{")},T.prototype._reset=function(){y=!1},T.prototype._get_next_token=function(L,x){var k=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(t.EOF,""):(k=k||this._read_non_javascript(U),k=k||this._read_string(U),k=k||this._read_word(L),k=k||this._read_singles(U),k=k||this._read_comment(U),k=k||this._read_regexp(U,L),k=k||this._read_xml(U,L),k=k||this._read_punctuation(),k=k||this._create_token(t.UNKNOWN,this._input.next()),k)},T.prototype._read_word=function(L){var x;if(x=this.__patterns.identifier.read(),x!=="")return x=x.replace(l.allLineBreaks,`
`),!(L.type===t.DOT||L.type===t.RESERVED&&(L.text==="set"||L.text==="get"))&&E.test(x)?(x==="in"||x==="of")&&(L.type===t.WORD||L.type===t.STRING)?this._create_token(t.OPERATOR,x):this._create_token(t.RESERVED,x):this._create_token(t.WORD,x);if(x=this.__patterns.number.read(),x!=="")return this._create_token(t.WORD,x)},T.prototype._read_singles=function(L){var x=null;return L==="("||L==="["?x=this._create_token(t.START_EXPR,L):L===")"||L==="]"?x=this._create_token(t.END_EXPR,L):L==="{"?x=this._create_token(t.START_BLOCK,L):L==="}"?x=this._create_token(t.END_BLOCK,L):L===";"?x=this._create_token(t.SEMICOLON,L):L==="."&&_.test(this._input.peek(1))?x=this._create_token(t.DOT,L):L===","&&(x=this._create_token(t.COMMA,L)),x&&this._input.next(),x},T.prototype._read_punctuation=function(){var L=this.__patterns.punct.read();if(L!=="")return L==="="?this._create_token(t.EQUALS,L):L==="?."?this._create_token(t.DOT,L):this._create_token(t.OPERATOR,L)},T.prototype._read_non_javascript=function(L){var x="";if(L==="#"){if(this._is_first_token()&&(x=this.__patterns.shebang.read(),x))return this._create_token(t.UNKNOWN,x.trim()+`
`);if(x=this.__patterns.include.read(),x)return this._create_token(t.UNKNOWN,x.trim()+`
`);L=this._input.next();var k="#";if(this._input.hasNext()&&this._input.testChar(p)){do L=this._input.next(),k+=L;while(this._input.hasNext()&&L!=="#"&&L!=="=");return L==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(k+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(k+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,k)}this._input.back()}else if(L==="<"&&this._is_first_token()){if(x=this.__patterns.html_comment_start.read(),x){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)x+=this._input.next();return y=!0,this._create_token(t.COMMENT,x)}}else if(y&&L==="-"&&(x=this.__patterns.html_comment_end.read(),x))return y=!1,this._create_token(t.COMMENT,x);return null},T.prototype._read_comment=function(L){var x=null;if(L==="/"){var k="";if(this._input.peek(1)==="*"){k=this.__patterns.block_comment.read();var U=v.get_directives(k);U&&U.ignore==="start"&&(k+=v.readIgnored(this._input)),k=k.replace(l.allLineBreaks,`
`),x=this._create_token(t.BLOCK_COMMENT,k),x.directives=U}else this._input.peek(1)==="/"&&(k=this.__patterns.comment.read(),x=this._create_token(t.COMMENT,k))}return x},T.prototype._read_string=function(L){if(L==="`"||L==="'"||L==='"'){var x=this._input.next();return this.has_char_escapes=!1,L==="`"?x+=this._read_string_recursive("`",!0,"${"):x+=this._read_string_recursive(L),this.has_char_escapes&&this._options.unescape_strings&&(x=D(x)),this._input.peek()===L&&(x+=this._input.next()),x=x.replace(l.allLineBreaks,`
`),this._create_token(t.STRING,x)}return null},T.prototype._allow_regexp_or_xml=function(L){return L.type===t.RESERVED&&r(L.text,["return","case","throw","else","do","typeof","yield"])||L.type===t.END_EXPR&&L.text===")"&&L.opened.previous.type===t.RESERVED&&r(L.opened.previous.text,["if","while","for"])||r(L.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},T.prototype._read_regexp=function(L,x){if(L==="/"&&this._allow_regexp_or_xml(x)){for(var k=this._input.next(),U=!1,R=!1;this._input.hasNext()&&(U||R||this._input.peek()!==L)&&!this._input.testChar(l.newline);)k+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?R=!0:this._input.peek()==="]"&&(R=!1)),this._input.next();return this._input.peek()===L&&(k+=this._input.next(),k+=this._input.read(l.identifier)),this._create_token(t.STRING,k)}return null},T.prototype._read_xml=function(L,x){if(this._options.e4x&&L==="<"&&this._allow_regexp_or_xml(x)){var k="",U=this.__patterns.xml.read_match();if(U){for(var R=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),V=R.indexOf("{")===0,Z=0;U;){var ue=!!U[1],le=U[2],ge=!!U[U.length-1]||le.slice(0,8)==="![CDATA[";if(!ge&&(le===R||V&&le.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ue?--Z:++Z),k+=U[0],Z<=0)break;U=this.__patterns.xml.read_match()}return U||(k+=this._input.match(/[\s\S]*/g)[0]),k=k.replace(l.allLineBreaks,`
`),this._create_token(t.STRING,k)}}return null};function D(L){for(var x="",k=0,U=new f(L),R=null;U.hasNext();)if(R=U.match(/([\s]|[^\\]|\\\\)+/g),R&&(x+=R[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")R=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")R=U.match(/u([0-9A-Fa-f]{4})/g);else{x+="\\",U.hasNext()&&(x+=U.next());continue}if(!R)return L;if(k=parseInt(R[1],16),k>126&&k<=255&&R[0].indexOf("x")===0)return L;if(k>=0&&k<32){x+="\\"+R[0];continue}else k===34||k===39||k===92?x+="\\"+String.fromCharCode(k):x+=String.fromCharCode(k)}return x}T.prototype._read_string_recursive=function(L,x,k){var U,R;L==="'"?R=this.__patterns.single_quote:L==='"'?R=this.__patterns.double_quote:L==="`"?R=this.__patterns.template_text:L==="}"&&(R=this.__patterns.template_expression);for(var V=R.read(),Z="";this._input.hasNext();){if(Z=this._input.next(),Z===L||!x&&l.newline.test(Z)){this._input.back();break}else Z==="\\"&&this._input.hasNext()?(U=this._input.peek(),U==="x"||U==="u"?this.has_char_escapes=!0:U==="\r"&&this._input.peek(1)===`
`&&this._input.next(),Z+=this._input.next()):k&&(k==="${"&&Z==="$"&&this._input.peek()==="{"&&(Z+=this._input.next()),k===Z&&(L==="`"?Z+=this._read_string_recursive("}",x,"`"):Z+=this._read_string_recursive("`",x,"${"),this._input.hasNext()&&(Z+=this._input.next())));Z+=R.read(),V+=Z}return V},e.exports.Tokenizer=T,e.exports.TOKEN=t,e.exports.positionable_operators=b.slice(),e.exports.line_starters=c.slice()},function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",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<this.__input_length},g.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},g.prototype.peek=function(f){var o=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(o=this.__input.charAt(f)),o},g.prototype.__match=function(f,o){f.lastIndex=o;var n=f.exec(this.__input);return n&&!(w&&f.sticky)&&(n.index!==o&&(n=null)),n},g.prototype.test=function(f,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(f,o):!1},g.prototype.testChar=function(f,o){var n=this.peek(o);return f.lastIndex=0,n!==null&&f.test(n)},g.prototype.match=function(f){var o=this.__match(f,this.__position);return o?this.__position+=o[0].length:o=null,o},g.prototype.read=function(f,o,n){var a="",l;return f&&(l=this.match(f),l&&(a+=l[0])),o&&(l||!f)&&(a+=this.readUntil(o,n)),a},g.prototype.readUntil=function(f,o){var n="",a=this.__position;f.lastIndex=this.__position;var l=f.exec(this.__input);return l?(a=l.index,o&&(a+=l[0].length)):a=this.__input_length,n=this.__input.substring(this.__position,a),this.__position=a,n},g.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},g.prototype.get_regexp=function(f,o){var n=null,a="g";return o&&w&&(a="y"),typeof f=="string"&&f!==""?n=new RegExp(f,a):f&&(n=new RegExp(f.source,a)),n},g.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(f){var o=this.__position,n=this.readUntilAfter(f);return this.__position=o,n},g.prototype.lookBack=function(f){var o=this.__position-1;return o>=f.length&&this.__input.substring(o-f.length,o).toLowerCase()===f},e.exports.InputScanner=g},function(e,w,g){var f=g(8).InputScanner,o=g(3).Token,n=g(10).TokenStream,a=g(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(i,r){this._input=new f(i),this._options=r||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new a(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new n,this._reset();for(var i,r=new o(l.START,""),t=null,v=[],m=new n;r.type!==l.EOF;){for(i=this._get_next_token(r,t);this._is_comment(i);)m.add(i),i=this._get_next_token(r,t);m.isEmpty()||(i.comments_before=m,m=new n),i.parent=t,this._is_opening(i)?(v.push(t),t=i):t&&this._is_closing(i,t)&&(i.opened=t,t.closed=i,t=v.pop(),i.parent=t),i.previous=r,r.next=i,this.__tokens.add(i),r=i}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(i,r){this._readWhitespace();var t=this._input.read(/.+/g);return t?this._create_token(l.RAW,t):this._create_token(l.EOF,"")},s.prototype._is_comment=function(i){return!1},s.prototype._is_opening=function(i){return!1},s.prototype._is_closing=function(i,r){return!1},s.prototype._create_token=function(i,r){var t=new o(i,r,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return t},s.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},e.exports.Tokenizer=s,e.exports.TOKEN=l},function(e){function w(g){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=g}w.prototype.restart=function(){this.__position=0},w.prototype.isEmpty=function(){return this.__tokens_length===0},w.prototype.hasNext=function(){return this.__position<this.__tokens_length},w.prototype.next=function(){var g=null;return this.hasNext()&&(g=this.__tokens[this.__position],this.__position+=1),g},w.prototype.peek=function(g){var f=null;return g=g||0,g+=this.__position,g>=0&&g<this.__tokens_length&&(f=this.__tokens[g]),f},w.prototype.add=function(g){this.__parent_token&&(g.parent=this.__parent_token),this.__tokens.push(g),this.__tokens_length+=1},e.exports.TokenStream=w},function(e,w,g){var f=g(12).Pattern;function o(n,a){f.call(this,n,a),a?this._line_regexp=this._input.get_regexp(a._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new f,o.prototype.__set_whitespace_patterns=function(n,a){n+="\\t ",a+="\\n\\r",this._match_pattern=this._input.get_regexp("["+n+a+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+a+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var n=this._input.read(this._match_pattern);if(n===" ")this.whitespace_before_token=" ";else if(n){var a=this.__split(this._newline_regexp,n);this.newline_count=a.length-1,this.whitespace_before_token=a[this.newline_count]}return n},o.prototype.matching=function(n,a){var l=this._create();return l.__set_whitespace_patterns(n,a),l._update(),l},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(n,a){n.lastIndex=0;for(var l=0,s=[],i=n.exec(a);i;)s.push(a.substring(l,i.index)),l=i.index+i[0].length,i=n.exec(a);return l<a.length?s.push(a.substring(l,a.length)):s.push(""),s},e.exports.WhitespacePattern=o},function(e){function w(g,f){this._input=g,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,f&&(this._starting_pattern=this._input.get_regexp(f._starting_pattern,!0),this._match_pattern=this._input.get_regexp(f._match_pattern,!0),this._until_pattern=this._input.get_regexp(f._until_pattern),this._until_after=f._until_after)}w.prototype.read=function(){var g=this._input.read(this._starting_pattern);return(!this._starting_pattern||g)&&(g+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),g},w.prototype.read_match=function(){return this._input.match(this._match_pattern)},w.prototype.until_after=function(g){var f=this._create();return f._until_after=!0,f._until_pattern=this._input.get_regexp(g),f._update(),f},w.prototype.until=function(g){var f=this._create();return f._until_after=!1,f._until_pattern=this._input.get_regexp(g),f._update(),f},w.prototype.starting_with=function(g){var f=this._create();return f._starting_pattern=this._input.get_regexp(g,!0),f._update(),f},w.prototype.matching=function(g){var f=this._create();return f._match_pattern=this._input.get_regexp(g,!0),f._update(),f},w.prototype._create=function(){return new w(this._input,this)},w.prototype._update=function(){},e.exports.Pattern=w},function(e){function w(g,f){g=typeof g=="string"?g:g.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+f,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(g);o;)f[o[1]]=o[2],o=this.__directive_pattern.exec(g);return f},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},function(e,w,g){var f=g(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function n(a,l){f.call(this,a,l),this.__template_pattern=null,this._disabled=Object.assign({},o),this._excluded=Object.assign({},o),l&&(this.__template_pattern=this._input.get_regexp(l.__template_pattern),this._excluded=Object.assign(this._excluded,l._excluded),this._disabled=Object.assign(this._disabled,l._disabled));var s=new f(a);this.__patterns={handlebars_comment:s.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:s.starting_with(/{{{/).until_after(/}}}/),handlebars:s.starting_with(/{{/).until_after(/}}/),php:s.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:s.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:s.starting_with(/{%/).until_after(/%}/),django_value:s.starting_with(/{{/).until_after(/}}/),django_comment:s.starting_with(/{#/).until_after(/#}/),smarty:s.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:s.starting_with(/{\*/).until_after(/\*}/),smarty_literal:s.starting_with(/{literal}/).until_after(/{\/literal}/)}}n.prototype=new f,n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){this.__set_templated_pattern()},n.prototype.disable=function(a){var l=this._create();return l._disabled[a]=!0,l._update(),l},n.prototype.read_options=function(a){var l=this._create();for(var s in o)l._disabled[s]=a.templating.indexOf(s)===-1;return l._update(),l},n.prototype.exclude=function(a){var l=this._create();return l._excluded[a]=!0,l._update(),l},n.prototype.read=function(){var a="";this._match_pattern?a=this._input.read(this._starting_pattern):a=this._input.read(this._starting_pattern,this.__template_pattern);for(var l=this._read_template();l;)this._match_pattern?l+=this._input.read(this._match_pattern):l+=this._input.readUntil(this.__template_pattern),a+=l,l=this._read_template();return this._until_after&&(a+=this._input.readUntilAfter(this._until_pattern)),a},n.prototype.__set_templated_pattern=function(){var a=[];this._disabled.php||a.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||a.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||a.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(a.push(this.__patterns.django._starting_pattern.source),a.push(this.__patterns.django_value._starting_pattern.source),a.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||a.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&a.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+a.join("|")+")")},n.prototype._read_template=function(){var a="",l=this._input.peek();if(l==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(a=a||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(a=a||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(a=a||this.__patterns.handlebars_comment.read(),a=a||this.__patterns.handlebars_unescaped.read(),a=a||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(a=a||this.__patterns.django_value.read()),this._excluded.django||(a=a||this.__patterns.django_comment.read(),a=a||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(a=a||this.__patterns.smarty_comment.read(),a=a||this.__patterns.smarty_literal.read(),a=a||this.__patterns.smarty.read()));return a},e.exports.TemplatablePattern=n}],C={};function j(e){var w=C[e];if(w!==void 0)return w.exports;var g=C[e]={exports:{}};return I[e](g,g.exports,j),g.exports}var N=j(0);O=N})();var H=O;!(oe=[],B=function(){return{js_beautify:H}}.apply(ce,oe),B!==void 0&&(Fe.exports=B))})()},"746U":function(Fe,ce,z){"use strict";z.d(ce,"f",function(){return oe}),z.d(ce,"l",function(){return B}),z.d(ce,"k",function(){return O}),z.d(ce,"j",function(){return H}),z.d(ce,"g",function(){return I}),z.d(ce,"m",function(){return C}),z.d(ce,"h",function(){return j}),z.d(ce,"n",function(){return N}),z.d(ce,"c",function(){return e}),z.d(ce,"a",function(){return w}),z.d(ce,"i",function(){return g}),z.d(ce,"o",function(){return f}),z.d(ce,"e",function(){return a}),z.d(ce,"d",function(){return l}),z.d(ce,"p",function(){return s}),z.d(ce,"b",function(){return i});function oe(r){return Array.isArray(r)}function B(r){return typeof r=="string"}function O(r){return typeof r=="object"&&r!==null&&!Array.isArray(r)&&!(r instanceof RegExp)&&!(r instanceof Date)}function H(r){return typeof r=="number"&&!isNaN(r)}function I(r){return r===!0||r===!1}function C(r){return typeof r=="undefined"}function j(r){return!N(r)}function N(r){return C(r)||r===null}function e(r,t){if(!r)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function w(r){if(N(r))throw new Error("Assertion Failed: argument is undefined or null");return r}function g(r){return typeof r=="function"}function f(r,t){const v=Math.min(r.length,t.length);for(let m=0;m<v;m++)o(r[m],t[m])}function o(r,t){if(B(t)){if(typeof r!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(g(t)){try{if(r instanceof t)return}catch(v){}if(!N(r)&&r.constructor===t)return;if(t.length===1&&t.call(void 0,r)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function n(r){let t=[],v=Object.getPrototypeOf(r);for(;Object.prototype!==v;)t=t.concat(Object.getOwnPropertyNames(v)),v=Object.getPrototypeOf(v);return t}function a(r){const t=[];for(const v of n(r))typeof r[v]=="function"&&t.push(v);return t}function l(r,t){const v=p=>function(){const _=Array.prototype.slice.call(arguments,0);return t(p,_)};let m={};for(const p of r)m[p]=v(p);return m}function s(r){return r===null?void 0:r}function i(r,t="Unreachable"){throw new Error(t)}},"815F":function(Fe,ce,z){"use strict";z.d(ce,"e",function(){return j}),z.d(ce,"c",function(){return e}),z.d(ce,"d",function(){return w}),z.d(ce,"a",function(){return f}),z.d(ce,"f",function(){return o}),z.d(ce,"b",function(){return n});var oe=z("KQm4"),B=z("VTBJ"),O=z("Ff2n"),H=z("Zm9Q"),I=z("Kwbf"),C=z("OZM5");function j(a,l){return a!=null?a:l}function N(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function s(i){var r=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(i||[]).forEach(function(t){var v=t.key,m=t.children;Object(I.a)(v!=null,"Tree node must have a certain key: [".concat(r).concat(v,"]"));var p=String(v);Object(I.a)(!l.has(p)||v===null||v===void 0,"Same 'key' exist in the Tree: ".concat(p)),l.set(p,!0),s(m,"".concat(r).concat(p," > "))})}s(a)}function e(a){function l(s){var i=Object(H.a)(s);return i.map(function(r){if(!Object(C.i)(r))return Object(I.a)(!r,"Tree/TreeNode can only accept TreeNode as children."),null;var t=r.key,v=r.props,m=v.children,p=Object(O.a)(v,["children"]),_=Object(B.a)({key:t},p),b=l(m);return b.length&&(_.children=b),_}).filter(function(r){return r})}return l(a)}function w(){var a=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],s=new Set(l===!0?[]:l),i=[];function r(t){var v=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(m,p){var _=Object(C.h)(v?v.pos:"0",p),b=j(m.key,_),u=Object(B.a)(Object(B.a)({},m),{},{parent:v,pos:_,children:null,data:m,isStart:[].concat(Object(oe.a)(v?v.isStart:[]),[p===0]),isEnd:[].concat(Object(oe.a)(v?v.isEnd:[]),[p===t.length-1])});return i.push(u),l===!0||s.has(b)?u.children=r(m.children||[],u):u.children=[],u})}return r(a),i}function g(a,l,s){var i;s?typeof s=="string"?i=function(v){return v[s]}:typeof s=="function"&&(i=function(v){return s(v)}):i=function(v,m){return j(v.key,m)};function r(t,v,m){var p=t?t.children:a,_=t?Object(C.h)(m.pos,v):"0";if(t){var b=i(t,_),u={node:t,index:v,pos:_,key:b,parentPos:m.node?m.pos:null,level:m.level+1};l(u)}p&&p.forEach(function(h,c){r(h,c,{node:t,pos:_,level:m?m.level+1:-1})})}r(null)}function f(a){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=l.initWrapper,i=l.processEntity,r=l.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,v={},m={},p={posEntities:v,keyEntities:m};return s&&(p=s(p)||p),g(a,function(_){var b=_.node,u=_.index,h=_.pos,c=_.key,d=_.parentPos,E=_.level,y={node:b,index:u,key:c,pos:h,level:E},T=j(c,h);v[h]=y,m[T]=y,y.parent=v[d],y.parent&&(y.parent.children=y.parent.children||[],y.parent.children.push(y)),i&&i(y,p)},t),r&&r(p),p}function o(a,l){var s=l.expandedKeys,i=l.selectedKeys,r=l.loadedKeys,t=l.loadingKeys,v=l.checkedKeys,m=l.halfCheckedKeys,p=l.dragOverNodeKey,_=l.dropPosition,b=l.keyEntities,u=b[a],h={eventKey:a,expanded:s.indexOf(a)!==-1,selected:i.indexOf(a)!==-1,loaded:r.indexOf(a)!==-1,loading:t.indexOf(a)!==-1,checked:v.indexOf(a)!==-1,halfChecked:m.indexOf(a)!==-1,pos:String(u?u.pos:""),dragOver:p===a&&_===0,dragOverGapTop:p===a&&_===-1,dragOverGapBottom:p===a&&_===1};return h}function n(a){var l=a.data,s=a.expanded,i=a.selected,r=a.checked,t=a.loaded,v=a.loading,m=a.halfChecked,p=a.dragOver,_=a.dragOverGapTop,b=a.dragOverGapBottom,u=a.pos,h=a.active,c=Object(B.a)(Object(B.a)({},l),{},{expanded:s,selected:i,checked:r,loaded:t,loading:v,halfChecked:m,dragOver:p,dragOverGapTop:_,dragOverGapBottom:b,pos:u,active:h});return"props"in c||Object.defineProperty(c,"props",{get:function(){return Object(I.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),a}}),c}},"8HAY":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return I}),z.d(ce,"b",function(){return C}),z.d(ce,"d",function(){return j}),z.d(ce,"e",function(){return N}),z.d(ce,"c",function(){return e});var oe=z("MI8n"),B=z("pmY6"),O=z("3/fG"),H=function(w,g,f,o){function n(a){return a instanceof f?a:new f(function(l){l(a)})}return new(f||(f=Promise))(function(a,l){function s(t){try{r(o.next(t))}catch(v){l(v)}}function i(t){try{r(o.throw(t))}catch(v){l(v)}}function r(t){t.done?a(t.value):n(t.value).then(s,i)}r((o=o.apply(w,g||[])).next())})};class I extends B.a{constructor(w,g="",f="",o=!0,n){super();this._onDidChange=this._register(new oe.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=w,this._label=g,this._cssClass=f,this._enabled=o,this._actionCallback=n}get id(){return this._id}get label(){return this._label}set label(w){this._setLabel(w)}_setLabel(w){this._label!==w&&(this._label=w,this._onDidChange.fire({label:w}))}get tooltip(){return this._tooltip||""}set tooltip(w){this._setTooltip(w)}_setTooltip(w){this._tooltip!==w&&(this._tooltip=w,this._onDidChange.fire({tooltip:w}))}get class(){return this._cssClass}set class(w){this._setClass(w)}_setClass(w){this._cssClass!==w&&(this._cssClass=w,this._onDidChange.fire({class:w}))}get enabled(){return this._enabled}set enabled(w){this._setEnabled(w)}_setEnabled(w){this._enabled!==w&&(this._enabled=w,this._onDidChange.fire({enabled:w}))}get checked(){return this._checked}set checked(w){this._setChecked(w)}_setChecked(w){this._checked!==w&&(this._checked=w,this._onDidChange.fire({checked:w}))}run(w,g){return H(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(w))})}}class C extends B.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new oe.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new oe.b),this.onDidRun=this._onDidRun.event}run(w,g){return H(this,void 0,void 0,function*(){if(!w.enabled)return;this._onBeforeRun.fire({action:w});let f;try{yield this.runAction(w,g)}catch(o){f=o}this._onDidRun.fire({action:w,error:f})})}runAction(w,g){return H(this,void 0,void 0,function*(){yield w.run(g)})}}class j extends I{constructor(w){super(j.ID,w,w?"separator text":"separator");this.checked=!1,this.enabled=!1}}j.ID="vs.actions.separator";class N{constructor(w,g,f,o){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=w,this.label=g,this.class=o,this._actions=f}get actions(){return this._actions}dispose(){}run(){return H(this,void 0,void 0,function*(){})}}class e extends I{constructor(){super(e.ID,O.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8Jsi":function(Fe,ce,z){"use strict";z.d(ce,"d",function(){return d}),z.d(ce,"a",function(){return F}),z.d(ce,"b",function(){return P}),z.d(ce,"c",function(){return K});var oe=z("1OyB"),B=z("vuIU"),O=z("Ji7U"),H=z("LK+K"),I=z("KQm4"),C=z("U8pU"),j=z("ODXe"),N=z("VTBJ"),e=z("q1tI"),w=z("qNPg"),g=z("2Qr1"),f=z("815F"),o=z("NvD2"),n=z("wPlo"),a=z("6cGi"),l=z("Kwbf"),s=z("4IlW"),i=z("YrtM"),r=z("fAei"),t=e.createContext(null);function v(de,Ee){if(!de)return!0;var Te=de.data,Se=Te.disabled,we=Te.disableCheckbox;switch(Ee){case"select":return Se;case"checkbox":return Se||we}return!1}function m(de,Ee){var Te=e.useCallback(function(we){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",xe=arguments.length>2?arguments[2]:void 0,Re=de.get(we);return!xe&&v(Re,Ae)?null:Re},[de]),Se=e.useCallback(function(we){var Ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",xe=arguments.length>2?arguments[2]:void 0,Re=Ee.get(we);return!xe&&v(Re,Ae)?null:Re},[Ee]);return[Te,Se]}function p(de){return e.useMemo(function(){var Ee=new Map,Te=new Map;return de.forEach(function(Se){Ee.set(Se.key,Se),Te.set(Se.data.value,Se)}),[Ee,Te]},[de])}var _={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},b=function(Ee,Te){var Se=Ee.prefixCls,we=Ee.height,Ae=Ee.itemHeight,xe=Ee.virtual,Re=Ee.options,Ie=Ee.flattenOptions,Q=Ee.multiple,W=Ee.searchValue,G=Ee.onSelect,X=Ee.onToggleOpen,ee=Ee.open,Y=Ee.notFoundContent,$=Ee.onMouseEnter,te=e.useContext(t),ie=te.checkable,be=te.checkedKeys,ve=te.halfCheckedKeys,Oe=te.treeExpandedKeys,Le=te.treeDefaultExpandAll,Pe=te.treeDefaultExpandedKeys,ke=te.onTreeExpand,Ge=te.treeIcon,Ke=te.showTreeIcon,Ue=te.switcherIcon,it=te.treeLine,$e=te.treeNodeFilterProp,rt=te.loadData,qe=te.treeLoadedKeys,Ye=te.treeMotion,nt=te.onTreeLoad,at=e.useRef(),et=Object(i.a)(function(){return Re},[ee,Re],function(ht,ot){return ot[0]&&ht[1]!==ot[1]}),ut=p(Ie),Me=Object(j.a)(ut,2),Be=Me[0],ze=Me[1],Je=m(Be,ze),st=Object(j.a)(Je,2),tt=st[0],We=st[1],De=e.useMemo(function(){return be.map(function(ht){var ot=We(ht);return ot?ot.key:null})},[be]),He=e.useMemo(function(){return ie?{checked:De,halfChecked:ve}:null},[De,ve,ie]);e.useEffect(function(){if(ee&&!Q&&De.length){var ht;(ht=at.current)===null||ht===void 0||ht.scrollTo({key:De[0]})}},[ee]);var Ne=String(W).toLowerCase(),Ve=function(ot){return Ne?String(ot[$e]).toLowerCase().includes(Ne):!1},je=e.useState(Pe),Ze=Object(j.a)(je,2),Qe=Ze[0],pt=Ze[1],vt=e.useState(null),Ct=Object(j.a)(vt,2),xt=Ct[0],Nt=Ct[1],Rt=e.useMemo(function(){return Oe?Object(I.a)(Oe):W?xt:Qe},[Qe,xt,Ne,Oe]);e.useEffect(function(){W&&Nt(Ie.map(function(ht){return ht.key}))},[W]);var Ft=function(ot){pt(ot),Nt(ot),ke&&ke(ot)},Lt=function(ot){ot.preventDefault()},St=function(ot,dt){var Xe=dt.node.key,ct=tt(Xe,ie?"checkbox":"select");ct!==null&&G(ct.data.value,{selected:!be.includes(ct.data.value)}),Q||X(!1)},Dt=e.useState(null),kt=Object(j.a)(Dt,2),Ot=kt[0],Ut=kt[1],It=tt(Ot);if(e.useImperativeHandle(Te,function(){return{onKeyDown:function(ot){var dt,Xe=ot.which;switch(Xe){case s.a.UP:case s.a.DOWN:case s.a.LEFT:case s.a.RIGHT:(dt=at.current)===null||dt===void 0||dt.onKeyDown(ot);break;case s.a.ENTER:{It!==null&&St(null,{node:{key:Ot},selected:!be.includes(It.data.value)});break}case s.a.ESC:X(!1)}},onKeyUp:function(){}}}),et.length===0)return e.createElement("div",{role:"listbox",className:"".concat(Se,"-empty"),onMouseDown:Lt},Y);var Pt={};return qe&&(Pt.loadedKeys=qe),Rt&&(Pt.expandedKeys=Rt),e.createElement("div",{onMouseDown:Lt,onMouseEnter:$},It&&ee&&e.createElement("span",{style:_,"aria-live":"assertive"},It.data.value),e.createElement(r.b,Object.assign({ref:at,focusable:!1,prefixCls:"".concat(Se,"-tree"),treeData:et,height:we,itemHeight:Ae,virtual:xe,multiple:Q,icon:Ge,showIcon:Ke,switcherIcon:Ue,showLine:it,loadData:W?null:rt,motion:Ye,checkable:ie,checkStrictly:!0,checkedKeys:He,selectedKeys:ie?[]:De,defaultExpandAll:Le},Pt,{onActiveChange:Ut,onSelect:St,onCheck:St,onExpand:Ft,onLoad:nt,filterTreeNode:Ve})))},u=e.forwardRef(b);u.displayName="OptionList";var h=u,c=function(){return null},d=c,E=z("Ff2n"),y=z("Zm9Q");function T(de){return Object(y.a)(de).map(function(Ee){if(!e.isValidElement(Ee)||!Ee.type)return null;var Te=Ee.key,Se=Ee.props,we=Se.children,Ae=Se.value,xe=Object(E.a)(Se,["children","value"]),Re=Object(N.a)({key:Te,value:Ae},xe),Ie=T(we);return Ie.length&&(Re.children=Ie),Re}).filter(function(Ee){return Ee})}function D(de){if(!de)return de;var Ee=Object(N.a)({},de);return"props"in Ee||Object.defineProperty(Ee,"props",{get:function(){return Object(l.a)(!1,"New `rc-tree-select` not support return node instance as argument anymore. Please consider to remove `props` access."),Ee}}),Ee}function L(de,Ee,Te,Se,we){var Ae=null,xe=null;function Re(){function Ie(Q){var W=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",G=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Q.map(function(X,ee){var Y="".concat(W,"-").concat(ee),$=Te.includes(X.value),te=Ie(X.children||[],Y,$),ie=e.createElement(d,Object.assign({},X),te.map(function(ve){return ve.node}));if(Ee===X.value&&(Ae=ie),$){var be={pos:Y,node:ie,children:te};return G||xe.push(be),be}return null}).filter(function(X){return X})}xe||(xe=[],Ie(Se),xe.sort(function(Q,W){var G=Q.node.props.value,X=W.node.props.value,ee=Te.indexOf(G),Y=Te.indexOf(X);return ee-Y}))}Object.defineProperty(de,"triggerNode",{get:function(){return Object(l.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Re(),Ae}}),Object.defineProperty(de,"allCheckedNodes",{get:function(){return Object(l.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Re(),we?xe:xe.map(function(Q){var W=Q.node;return W})}})}function x(de){return Array.isArray(de)?de:de!==void 0?[de]:[]}function k(de,Ee){var Te=new Map;return Ee.forEach(function(Se){var we=Se.data;Te.set(we.value,we)}),de.map(function(Se){return D(Te.get(Se))})}function U(de,Ee){var Te=k([de],Ee)[0];return Te?Te.disabled:!1}function R(de){return de.disabled||de.disableCheckbox||de.checkable===!1}function V(de){for(var Ee=de.parent,Te=0,Se=Ee;Se;)Se=Se.parent,Te+=1;return Te}function Z(de){function Ee(Se){return(Se||[]).map(function(we){var Ae=we.value,xe=we.key,Re=we.children,Ie=Object(N.a)(Object(N.a)({},we),{},{key:"key"in we?xe:Ae});return Re&&(Ie.children=Ee(Re)),Ie})}var Te=Object(f.d)(Ee(de),!0);return Te.map(function(Se){return{key:Se.data.key,data:Se.data,level:V(Se)}})}function ue(de){return function(Ee,Te){var Se=Te[de];return String(Se).toLowerCase().includes(String(Ee).toLowerCase())}}function le(de,Ee,Te){var Se=Te.optionFilterProp,we=Te.filterOption;if(we===!1)return Ee;var Ae;typeof we=="function"?Ae=we:Ae=ue(Se);function xe(Re){var Ie=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Re.map(function(Q){var W=Q.children,G=Ie||Ae(de,D(Q)),X=xe(W||[],G);return G||X.length?Object(N.a)(Object(N.a)({},Q),{},{children:X}):null}).filter(function(Q){return Q})}return xe(Ee)}function ge(de,Ee,Te,Se){var we=new Map;return x(Ee).forEach(function(Ae){Ae&&Object(C.a)(Ae)==="object"&&"value"in Ae&&we.set(Ae.value,Ae)}),de.map(function(Ae){var xe={value:Ae},Re=Te(Ae,"select",!0),Ie=Re?Se(Re.data):Ae;if(we.has(Ae)){var Q=we.get(Ae);xe.label="label"in Q?Q.label:Ie,"halfChecked"in Q&&(xe.halfChecked=Q.halfChecked)}else xe.label=Ie;return xe})}function pe(de,Ee){var Te=new Set(de);return Te.add(Ee),Array.from(Te)}function ae(de,Ee){var Te=new Set(de);return Te.delete(Ee),Array.from(Te)}function ne(de){var Ee=de.searchPlaceholder,Te=de.treeCheckStrictly,Se=de.treeCheckable,we=de.labelInValue,Ae=de.value,xe=de.multiple;Object(l.a)(!Ee,"`searchPlaceholder` has been removed."),Te&&we===!1&&Object(l.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(we||Te)&&Object(l.a)(x(Ae).every(function(Re){return Re&&Object(C.a)(Re)==="object"&&"value"in Re}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),Te||xe||Se?Object(l.a)(!Ae||Array.isArray(Ae),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(l.a)(!Array.isArray(Ae),"`value` should not be array when `TreeSelect` is single mode.")}var fe=ne,q=10;function M(de,Ee){var Te=Ee.id,Se=Ee.pId,we=Ee.rootPId,Ae={},xe=[],Re=de.map(function(Ie){var Q=Object(N.a)({},Ie),W=Q[Te];return Ae[W]=Q,Q.key=Q.key||W,Q});return Re.forEach(function(Ie){var Q=Ie[Se],W=Ae[Q];W&&(W.children=W.children||[],W.children.push(Ie)),(Q===we||!W&&we===null)&&xe.push(Ie)}),xe}function S(de,Ee){var Te=0,Se=new Set;function we(Ae){return(Ae||[]).map(function(xe){var Re=xe.key,Ie=xe.value,Q=xe.children,W=Object(E.a)(xe,["key","value","children"]),G="value"in xe?Ie:Re,X=Object(N.a)(Object(N.a)({},W),{},{key:Re!=null?Re:G,value:G,title:Ee(xe)});return"children"in xe&&(X.children=we(Q)),X})}return we(de)}function A(de,Ee,Te){var Se=Te.getLabelProp,we=Te.simpleMode,Ae=e.useRef({});return de?(Ae.current.formatTreeData=Ae.current.treeData===de?Ae.current.formatTreeData:S(we?M(de,Object(N.a)({id:"id",pId:"pId",rootPId:null},we!==!0?we:{})):de,Se),Ae.current.treeData=de):Ae.current.formatTreeData=Ae.current.children===Ee?Ae.current.formatTreeData:S(T(Ee),Se),Ae.current.formatTreeData}var F="SHOW_ALL",K="SHOW_PARENT",P="SHOW_CHILD";function re(de,Ee,Te){var Se=new Set(de);return Ee===P?de.filter(function(we){var Ae=Te[we];return!(Ae&&Ae.children&&Ae.children.every(function(xe){var Re=xe.node;return R(Re)||Se.has(Re.key)}))}):Ee===K?de.filter(function(we){var Ae=Te[we],xe=Ae?Ae.parent:null;return!(xe&&!R(xe.node)&&Se.has(xe.node.key))}):de}function he(de,Ee){var Te=Ee.value,Se=Ee.getEntityByValue,we=Ee.getEntityByKey,Ae=Ee.treeConduction,xe=Ee.showCheckedStrategy,Re=Ee.conductKeyEntities,Ie=Ee.getLabelProp;return e.useMemo(function(){var Q=de;if(Ae){var W=re(de.map(function(G){var X=Se(G);return X?X.key:G}),xe,Re);Q=W.map(function(G){var X=we(G);return X?X.data.value:G})}return ge(Q,Te,Se,Ie)},[de,Te,Ae,xe,Se])}var ye=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],J=Object(w.a)({prefixCls:"rc-tree-select",components:{optionList:h},convertChildrenToData:function(){return null},flattenOptions:Z,getLabeledValue:g.e,filterOptions:le,isValueDisabled:U,findValueOption:k,omitDOMProps:function(Ee){var Te=Object(N.a)({},Ee);return ye.forEach(function(Se){delete Te[Se]}),Te}});J.displayName="Select";var se=e.forwardRef(function(de,Ee){var Te=de.multiple,Se=de.treeCheckable,we=de.treeCheckStrictly,Ae=de.showCheckedStrategy,xe=Ae===void 0?"SHOW_CHILD":Ae,Re=de.labelInValue,Ie=de.loadData,Q=de.treeLoadedKeys,W=de.treeNodeFilterProp,G=W===void 0?"value":W,X=de.treeNodeLabelProp,ee=de.treeDataSimpleMode,Y=de.treeData,$=de.treeExpandedKeys,te=de.treeDefaultExpandedKeys,ie=de.treeDefaultExpandAll,be=de.children,ve=de.treeIcon,Oe=de.showTreeIcon,Le=de.switcherIcon,Pe=de.treeLine,ke=de.treeMotion,Ge=de.filterTreeNode,Ke=de.dropdownPopupAlign,Ue=de.onChange,it=de.onTreeExpand,$e=de.onTreeLoad,rt=de.onDropdownVisibleChange,qe=de.onSelect,Ye=de.onDeselect,nt=Se||we,at=Te||nt,et=Se&&!we,ut=we||Re,Me=e.useRef(null);e.useImperativeHandle(Ee,function(){return{focus:Me.current.focus,blur:Me.current.blur}});var Be=function(Xe){return Y&&Xe.label||Xe.title},ze=function(Xe){return X?Xe[X]:Be(Xe)},Je=A(Y,be,{getLabelProp:Be,simpleMode:ee}),st=Object(e.useMemo)(function(){return Z(Je)},[Je]),tt=p(st),We=Object(j.a)(tt,2),De=We[0],He=We[1],Ne=m(De,He),Ve=Object(j.a)(Ne,2),je=Ve[0],Ze=Ve[1],Qe=Object(e.useMemo)(function(){return et?Object(f.a)(Je):{keyEntities:null}},[Je,Se,we]),pt=Qe.keyEntities,vt=Object(a.a)(de.defaultValue,{value:de.value}),Ct=Object(j.a)(vt,2),xt=Ct[0],Nt=Ct[1],Rt=function(Xe){var ct=[],yt=[];return Xe.forEach(function(ft){Ze(ft)?yt.push(ft):ct.push(ft)}),{missingRawValues:ct,existRawValues:yt}},Ft=Object(e.useMemo)(function(){var dt=[],Xe=[];if(x(xt).forEach(function(lt){if(lt&&Object(C.a)(lt)==="object"&&"value"in lt)if(lt.halfChecked&&we){var _t=Ze(lt.value);dt.push(_t?_t.key:lt.value)}else Xe.push(lt.value);else Xe.push(lt)}),et){var ct=Rt(Xe),yt=ct.missingRawValues,ft=ct.existRawValues,bt=ft.map(function(lt){return Ze(lt).key}),Tt=Object(o.a)(bt,!0,pt),wt=Tt.checkedKeys,At=Tt.halfCheckedKeys;return[[].concat(Object(I.a)(yt),Object(I.a)(wt.map(function(lt){return je(lt).data.value}))),At]}return[Xe,dt]},[xt,at,ut,Se,we]),Lt=Object(j.a)(Ft,2),St=Lt[0],Dt=Lt[1],kt=he(St,{treeConduction:et,value:xt,showCheckedStrategy:xe,conductKeyEntities:pt,getEntityByValue:Ze,getEntityByKey:je,getLabelProp:ze}),Ot=function(Xe,ct,yt){if(Nt(at?Xe:Xe[0]),Ue){var ft=Xe;if(et&&xe!=="SHOW_ALL"){var bt=Xe.map(function(gt){var Et=Ze(gt);return Et?Et.key:gt}),Tt=re(bt,xe,pt);ft=Tt.map(function(gt){var Et=je(gt);return Et?Et.data.value:gt})}var wt=ct||{triggerValue:void 0,selected:void 0},At=wt.triggerValue,lt=wt.selected,_t=ut?ge(ft,xt,Ze,ze):ft;if(we){var Mt=Dt.map(function(gt){var Et=je(gt);return Et?Et.data.value:gt}).filter(function(gt){return!ft.includes(gt)});_t=[].concat(Object(I.a)(_t),Object(I.a)(ge(Mt,xt,Ze,ze)))}var mt={preValue:kt,triggerValue:At},Bt=!0;(we||yt==="selection"&&!lt)&&(Bt=!1),L(mt,At,Xe,Je,Bt),nt?mt.checked=lt:mt.selected=lt,Ue(at?_t:_t[0],ut?null:ft.map(function(gt){var Et=Ze(gt);return Et?ze(Et.data):null}),mt)}},Ut=function(Xe,ct,yt){var ft=Xe;if(!at)Ot([Xe],{selected:!0,triggerValue:Xe},yt);else{var bt=pe(St,Xe);if(et){var Tt=Rt(bt),wt=Tt.missingRawValues,At=Tt.existRawValues,lt=At.map(function(mt){return Ze(mt).key}),_t=Object(o.a)(lt,!0,pt),Mt=_t.checkedKeys;bt=[].concat(Object(I.a)(wt),Object(I.a)(Mt.map(function(mt){return je(mt).data.value})))}Ot(bt,{selected:!0,triggerValue:Xe},yt)}qe&&qe(ft,ct)},It=function(Xe,ct,yt){var ft=Xe,bt=ae(St,Xe);if(et){var Tt=Rt(bt),wt=Tt.missingRawValues,At=Tt.existRawValues,lt=At.map(function(mt){return Ze(mt).key}),_t=Object(o.a)(lt,{checked:!1,halfCheckedKeys:Dt},pt),Mt=_t.checkedKeys;bt=[].concat(Object(I.a)(wt),Object(I.a)(Mt.map(function(mt){return je(mt).data.value})))}Ot(bt,{selected:!1,triggerValue:Xe},yt),Ye&&Ye(ft,ct)},Pt=function(){Ot([],null,"clear")},ht=e.useCallback(function(dt){if(rt){var Xe={};Object.defineProperty(Xe,"documentClickClose",{get:function(){return Object(l.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),rt(dt,Xe)}},[rt]),ot={optionLabelProp:null,optionFilterProp:G,dropdownAlign:Ke,internalProps:{mark:n.a,onClear:Pt,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:Ut,onRawDeselect:It}};return"filterTreeNode"in de&&(ot.filterOption=Ge),e.createElement(t.Provider,{value:{checkable:nt,loadData:Ie,treeLoadedKeys:Q,onTreeLoad:$e,checkedKeys:St,halfCheckedKeys:Dt,treeDefaultExpandAll:ie,treeExpandedKeys:$,treeDefaultExpandedKeys:te,onTreeExpand:it,treeIcon:ve,treeMotion:ke,showTreeIcon:Oe,switcherIcon:Le,treeLine:Pe,treeNodeFilterProp:G}},e.createElement(J,Object.assign({ref:Me,mode:at?"multiple":null},de,ot,{value:kt,labelInValue:!0,options:Je,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:ht})))}),me=function(de){Object(O.a)(Te,de);var Ee=Object(H.a)(Te);function Te(){var Se;return Object(oe.a)(this,Te),Se=Ee.apply(this,arguments),Se.selectRef=e.createRef(),Se.focus=function(){Se.selectRef.current.focus()},Se.blur=function(){Se.selectRef.current.blur()},Se}return Object(B.a)(Te,[{key:"render",value:function(){return e.createElement(se,Object.assign({ref:this.selectRef},this.props))}}]),Te}(e.Component);me.TreeNode=d,me.SHOW_ALL=F,me.SHOW_PARENT=K,me.SHOW_CHILD=P;var _e=me,Ce=ce.e=_e},"8hTe":function(Fe,ce,z){Fe.exports={button:"button___1wy9m"}},"9Bee":function(Fe,ce,z){"use strict";var oe=z("DYRE"),B=z("zeV3"),O=z("+L6B"),H=z("2/Rp"),I=z("k1fw"),C=z("9og8"),j=z("tJVT"),N=z("WmNS"),e=z.n(N),w=z("q1tI"),g=z.n(w),f=z("vg9a"),o=z("DlQD"),n=z.n(o),a=z("rUJ1");function l(Q,W){var G=Q.match(/^(\s+)(?:```)/);if(G===null)return W;var X=G[1];return W.split(`
`).map(function(ee){var Y=ee.match(/^\s+/);if(Y===null)return ee;var $=Object(j.a)(Y,1),te=$[0];return te.length>=X.length?ee.slice(X.length):ee}).join(`
`)}var s=[],i=["<ul>"],r=new n.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function v(){s.length=0,i=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function p(Q,W,G,X){if(W>=Q.length||Q[W].level<=G)return W;var ee=Q[W];X.push("<li><a href='#"+ee.anchor+"'>"+ee.text+"</a>"),W++;var Y=[];return W=p(Q,W,ee.level,Y),Y.length>0&&(X.push("<ul>"),Y.forEach(function($){X.push($)}),X.push("</ul>")),X.push("</li>"),W=p(Q,W,G,X),W}function _(){return p(s,0,0,i),i.push("</ul>"),i.join("")}var b={heading:function(W){var G=t.exec(W);if(G)return{type:"heading",raw:G[0],depth:G[1].length,text:G[2]}},fences:function(W){var G=this.rules.block.fences.exec(W);if(G){var X=G[0],ee=l(X,G[3]||""),Y=G[2]?G[2].trim():G[2];if(["latex","katex","math"].indexOf(Y)>=0){var $=c(),te=ee;ee=$,d[$]={type:"block",expression:te}}return{type:"code",raw:X,lang:Y,text:ee}}}},u=/(?:\${2})([^\n`]+?)(?:\${2})/gi,h=0,c=function(){return"__special_katext_id_".concat(h++,"__")},d={};function E(){return d}function y(){h=0,d={}}function T(Q){return Q=Q.replace(u,function(W,G){var X=c();return d[X]={type:"inline",expression:G},X}),Q}var D=r.listitem;r.listitem=function(Q){return D(T(Q))};var L=r.paragraph;r.paragraph=function(Q){return L(T(Q))};var x=r.tablecell;r.tablecell=function(Q,W){return x(T(Q),W)},r.code=function(Q,W,G){var X=(W||"").match(/\S*/)[0];return X?["latex","katex","math"].indexOf(X)>=0?"<p class='editormd-tex'>".concat(Q,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(W,'">').concat(G?Q:Object(a.escape)(Q,!0),`</code></pre>
`):'<pre class="prettyprint linenums"><code>'+(G?Q:Object(a.escape)(Q,!0))+"</code></pre>"},r.heading=function(Q,W,G){var X=this.options.headerPrefix+G.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:X,level:W,text:Q}),"<h"+W+' id="'+X+'">'+Q+"</h"+W+">"},n.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),n.a.use({tokenizer:b,renderer:r});var k=n.a,U=z("SJMd"),R=z("ulZh"),V=z.n(R),Z=z("m3rI"),ue=z("Oy/b"),le=z("p5ED"),ge=z("ErOA"),pe=z("STEk");/* **********************************
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 ae=function(Q,W){return(ae=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(G,X){G.__proto__=X}||function(G,X){for(var ee in X)Object.prototype.hasOwnProperty.call(X,ee)&&(G[ee]=X[ee])})(Q,W)};function ne(Q,W){if(typeof W!="function"&&W!==null)throw new TypeError("Class extends value "+String(W)+" is not a constructor or null");function G(){this.constructor=Q}ae(Q,W),Q.prototype=W===null?Object.create(W):(G.prototype=W.prototype,new G)}function fe(Q,W,G,X){return new(G||(G=Promise))(function(ee,Y){function $(be){try{ie(X.next(be))}catch(ve){Y(ve)}}function te(be){try{ie(X.throw(be))}catch(ve){Y(ve)}}function ie(be){var ve;be.done?ee(be.value):(ve=be.value,ve instanceof G?ve:new G(function(Oe){Oe(ve)})).then($,te)}ie((X=X.apply(Q,W||[])).next())})}function q(Q,W){var G,X,ee,Y,$={label:0,sent:function(){if(1&ee[0])throw ee[1];return ee[1]},trys:[],ops:[]};return Y={next:te(0),throw:te(1),return:te(2)},typeof Symbol=="function"&&(Y[Symbol.iterator]=function(){return this}),Y;function te(ie){return function(be){return function(ve){if(G)throw new TypeError("Generator is already executing.");for(;$;)try{if(G=1,X&&(ee=2&ve[0]?X.return:ve[0]?X.throw||((ee=X.return)&&ee.call(X),0):X.next)&&!(ee=ee.call(X,ve[1])).done)return ee;switch(X=0,ee&&(ve=[2&ve[0],ee.value]),ve[0]){case 0:case 1:ee=ve;break;case 4:return $.label++,{value:ve[1],done:!1};case 5:$.label++,X=ve[1],ve=[0];continue;case 7:ve=$.ops.pop(),$.trys.pop();continue;default:if(!(ee=$.trys,(ee=ee.length>0&&ee[ee.length-1])||ve[0]!==6&&ve[0]!==2)){$=0;continue}if(ve[0]===3&&(!ee||ve[1]>ee[0]&&ve[1]<ee[3])){$.label=ve[1];break}if(ve[0]===6&&$.label<ee[1]){$.label=ee[1],ee=ve;break}if(ee&&$.label<ee[2]){$.label=ee[2],$.ops.push(ve);break}ee[2]&&$.ops.pop(),$.trys.pop();continue}ve=W.call(Q,$)}catch(Oe){ve=[6,Oe],X=0}finally{G=ee=0}if(5&ve[0])throw ve[1];return{value:ve[0]?ve[1]:void 0,done:!0}}([ie,be])}}}var M=function(){function Q(){}return Q.addKey=function(W){Q.key=W},Object.defineProperty(Q,"isLicensed",{get:function(){return!!Q.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(Q.key)},enumerable:!1,configurable:!0}),Q}(),S=function(){function Q(){}return Q.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},Q.setAttributes=function(W,G){for(var X=0,ee=G;X<ee.length;X++){var Y=ee[X],$=Y[0],te=Y[1];W.setAttribute($,te)}},Q.createRect=function(W,G,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","rect");return ee.setAttribute("width",W.toString()),ee.setAttribute("height",G.toString()),X&&Q.setAttributes(ee,X),ee},Q.createLine=function(W,G,X,ee,Y){var $=document.createElementNS("http://www.w3.org/2000/svg","line");return $.setAttribute("x1",W.toString()),$.setAttribute("y1",G.toString()),$.setAttribute("x2",X.toString()),$.setAttribute("y2",ee.toString()),Y&&Q.setAttributes($,Y),$},Q.createPolygon=function(W,G){var X=document.createElementNS("http://www.w3.org/2000/svg","polygon");return X.setAttribute("points",W),G&&Q.setAttributes(X,G),X},Q.createCircle=function(W,G){var X=document.createElementNS("http://www.w3.org/2000/svg","circle");return X.setAttribute("cx",(W/2).toString()),X.setAttribute("cy",(W/2).toString()),X.setAttribute("r",W.toString()),G&&Q.setAttributes(X,G),X},Q.createEllipse=function(W,G,X){var ee=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return ee.setAttribute("cx",(W/2).toString()),ee.setAttribute("cy",(G/2).toString()),ee.setAttribute("rx",(W/2).toString()),ee.setAttribute("ry",(G/2).toString()),X&&Q.setAttributes(ee,X),ee},Q.createGroup=function(W){var G=document.createElementNS("http://www.w3.org/2000/svg","g");return W&&Q.setAttributes(G,W),G},Q.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},Q.createMarker=function(W,G,X,ee,Y,$,te){var ie=document.createElementNS("http://www.w3.org/2000/svg","marker");return Q.setAttributes(ie,[["id",W],["orient",G],["markerWidth",X.toString()],["markerHeight",ee.toString()],["refX",Y.toString()],["refY",$.toString()]]),ie.appendChild(te),ie},Q.createText=function(W){var G=document.createElementNS("http://www.w3.org/2000/svg","text");return G.setAttribute("x","0"),G.setAttribute("y","0"),W&&Q.setAttributes(G,W),G},Q.createTSpan=function(W,G){var X=document.createElementNS("http://www.w3.org/2000/svg","tspan");return X.textContent=W,G&&Q.setAttributes(X,G),X},Q.createImage=function(W){var G=document.createElementNS("http://www.w3.org/2000/svg","image");return W&&Q.setAttributes(G,W),G},Q.createPoint=function(W,G){var X=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return X.x=W,X.y=G,X},Q.createPath=function(W,G){var X=document.createElementNS("http://www.w3.org/2000/svg","path");return X.setAttribute("d",W),G&&Q.setAttributes(X,G),X},Q.createElement=function(W,G){var X=document.createElementNS("http://www.w3.org/2000/svg",W);return G&&Q.setAttributes(X,G),X},Q.getHollowRectanglePath=function(W,G,X,ee,Y,$,te,ie){return"M"+W+","+G+"V"+(G+ee)+"H"+(W+X)+"V"+G+"H"+Y+"V"+$+"H"+(Y+te)+"V"+($+ie)+"H"+Y+"V"+G+"Z"},Q}(),A=function(){function Q(W){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+W+"_"}return Object.defineProperty(Q.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#333333",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarBackgroundActiveColor:"#282828",toolbarColor:"#eeeeee",cropShadeColor:"#ffffff",cropFrameColor:"#ffffff",gripColor:"#333333",gripFillColor:"#cccccc",toolbarHeight:40}},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),Q.prototype.addClass=function(W){return this.styleSheet===void 0&&this.addStyleSheet(),W.name=""+this.classNamePrefix+W.localName,this.classes.push(W),this.styleSheet.sheet.insertRule("."+W.name+" {"+W.style+"}",this.styleSheet.sheet.cssRules.length),W},Q.prototype.addRule=function(W){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(W),this.styleSheet.sheet.insertRule(W.selector+" {"+W.style+"}",this.styleSheet.sheet.cssRules.length)},Q.prototype.addStyleSheet=function(){var W;this.styleSheet=document.createElement("style"),((W=this.styleSheetRoot)!==null&&W!==void 0?W:document.head).appendChild(this.styleSheet),this.addRule(new F("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new F("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new F("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new K("_fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new K("_fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},Q.prototype.removeStyleSheet=function(){var W;this.styleSheet&&(((W=this.styleSheetRoot)!==null&&W!==void 0?W:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},Q}(),F=function(Q,W){this.selector=Q,this.style=W},K=function(Q,W){this.localName=Q,this.style=W},P=function(){function Q(){this.blocks=[],this.display=""}return Q.prototype.addButtonBlock=function(W){W.className=this.blockClassName,W.buttonClassName=this.buttonClassName,W.buttonColorsClassName=this.buttonColorsClassName,W.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(W)},Q.prototype.addElementBlock=function(W){W.className===void 0&&(W.className=this.blockClassName),this.blocks.push(W)},Q.prototype.getUI=function(){var W=document.createElement("div");return W.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,W.style.display=this.display,this.blocks.forEach(function(G){return W.appendChild(G.getUI())}),W},Q}(),re=function(){function Q(){}return Q.prototype.getUI=function(){var W=document.createElement("div");if(W.className=this.className,this.minWidth!==void 0&&(W.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":W.style.justifyContent="flex-start";break;case"center":W.style.justifyContent="center";break;case"end":W.style.justifyContent="flex-end"}return W.style.whiteSpace="nowrap",W},Q}(),he=function(Q){function W(){var G=Q!==null&&Q.apply(this,arguments)||this;return G.buttons=[],G}return ne(W,Q),W.prototype.addButton=function(G){G.className=this.buttonClassName,G.colorsClassName=this.buttonColorsClassName,G.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(G)},W.prototype.getUI=function(){var G=Q.prototype.getUI.call(this);return this.buttons.forEach(function(X){return G.appendChild(X.getUI())}),G},W}(re),ye=function(){function Q(W,G){this._isActive=!1,this._isHidden=!1,this._icon=W,this.title=G,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(Q.prototype,"icon",{get:function(){return this._icon},set:function(W){this._icon=W,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isActive",{get:function(){return this._isActive},set:function(W){this._isActive=W,this.adjustClassName()},enumerable:!1,configurable:!0}),Q.prototype.getUI=function(){var W=this;return this.buttonContainer=document.createElement("div"),this.buttonContainer.title=this.title,this.buttonContainer.className=this.className+" "+this.colorsClassName,this.adjustClassName(),this.buttonContainer.innerHTML=this._icon,this.onClick&&this.buttonContainer.addEventListener("click",function(){return W.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},Q.prototype.adjustClassName=function(){this.activeColorsClassName&&(this._isActive&&this.buttonContainer.className.indexOf(this.activeColorsClassName)<0?this.buttonContainer.className+=" "+this.activeColorsClassName:this._isActive||(this.buttonContainer.className=this.buttonContainer.className.replace(this.activeColorsClassName,"")))},Q.prototype.hide=function(){this._isHidden=!0},Q}(),J=function(Q){function W(){var G=Q!==null&&Q.apply(this,arguments)||this;return G.elements=[],G}return ne(W,Q),W.prototype.addElement=function(G){this.elements.push(G)},W.prototype.getUI=function(){var G=Q.prototype.getUI.call(this);return this.elements.forEach(function(X){return G.appendChild(X)}),G},W}(re),se=function(){function Q(W,G){this.horizontal=W,this.vertical=G}return Object.defineProperty(Q.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),Q.prototype.getVerticalLength=function(W){return W/this.ratio},Q.prototype.getHorizontalLength=function(W){return W*this.ratio},Q}(),me=function(){function Q(){}return Q.getIcon=function(W,G){if(W>0&&G>0){var X=new se(W,G),ee=X.ratio>=1?20:X.getHorizontalLength(20),Y=X.ratio<1?20:X.getVerticalLength(20),$=document.createElementNS("http://www.w3.org/2000/svg","svg");$.setAttribute("xmlns","http://www.w3.org/2000/svg"),$.setAttribute("viewBox","0 0 24 24"),document.body.appendChild($);var te=S.createDefs();$.appendChild(te);var ie=S.createElement("clipPath",[["id","text-bg-clip"]]);te.appendChild(ie);var be=S.createPath(S.getHollowRectanglePath((24-ee)/2,(24-Y)/2,ee,Y,(24-ee)/2+2,(24-Y)/2+2,ee-4,Y-4));$.appendChild(be);var ve=S.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);ve.appendChild(S.createTSpan(W+":"+G)),$.appendChild(ve);var Oe=ve.getBBox();S.setAttributes(ve,[["x",((24-Oe.width)/2).toString()],["y",((24-Oe.height)/2-Oe.y).toString()]]);var Le=S.createPath(S.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Oe.width))/2,(24-Math.ceil(Oe.height))/2,Math.ceil(Oe.width),Math.ceil(Oe.height)));return ie.appendChild(Le),S.setAttributes(be,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild($),$.outerHTML}return'<svg viewBox="0 0 24 24"><path d="M19 12h-2v3h-3v2h5v-5M7 9h3V7H5v5h2V9m14-6H3a2 2 0 00-2 2v14a2 2 0 002 2h18a2 2 0 002-2V5a2 2 0 00-2-2m0 16H3V5h18v14z"/></svg>'},Q}(),_e=function(Q){function W(G,X,ee){var Y=Q.call(this,G,X)||this;return Y.isDropdownOpen=!1,Y.onClick=Y.dropdownButtonClicked,Y.dropdownButtons=ee,Y}return ne(W,Q),W.prototype.setupDropdown=function(){var G=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(X){X.className=G.className,X.colorsClassName=G.colorsClassName,G.dropdownBlock.appendChild(X.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},W.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},W.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},W.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},W.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},W.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},W}(ye),Ce=function(){function Q(W,G){this.GRIP_SIZE=10,this.color=W,this.fillColor=G,this.visual=S.createGroup(),this.visual.appendChild(S.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(S.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return Q.prototype.ownsTarget=function(W){return W===this.visual||W===this.visual.childNodes[0]||W===this.visual.childNodes[1]},Q.prototype.setCenter=function(W,G){this.visual.childNodes.forEach(function(X){return S.setAttributes(X,[["cx",W.toString()],["cy",G.toString()]])})},Q}(),de=function(){function Q(W,G,X,ee){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=W,this.canvasHeight=G,this.margin=X,this.container=ee,this.attachEvents=this.attachEvents.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.resize=this.resize.bind(this),this.adjustCropRect=this.adjustCropRect.bind(this),this.scaleCanvas=this.scaleCanvas.bind(this),this.getRescaledRect=this.getRescaledRect.bind(this)}return Object.defineProperty(Q.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(W){this._aspectRatio=W,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(W){this._isGridVisible=W,this.gridContainer&&S.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(W){this._zoomFactor=W,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Q.prototype.open=function(){var W=this;this.cropShadeElement=S.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=S.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var G=0;G<this.numberOfGridLines;G++)this.horizontalGridLines.push(S.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(S.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(X){return W.gridContainer.appendChild(X)}),this.verticalGridLines.forEach(function(X){return W.gridContainer.appendChild(X)}),this.cropRectElement=S.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new Ce(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new Ce(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new Ce(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new Ce(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},Q.prototype.setCropRectangle=function(W){this.cropRect=W;var G=Object.assign({},this.cropRect);this.zoomFactor!==1&&(G.width=this.cropRect.width*this.zoomFactor,G.height=this.cropRect.height*this.zoomFactor,G.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-G.width/2,G.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-G.height/2),S.setAttributes(this.cropRectElement,[["x",G.x.toString()],["y",G.y.toString()],["width",G.width.toString()],["height",G.height.toString()]]);var X=G.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(Y,$){var te=G.y+X*($+1);S.setAttributes(Y,[["x1",""+G.x],["y1",""+te],["x2",""+(G.x+G.width)],["y2",""+te]])});var ee=G.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(Y,$){var te=G.x+ee*($+1);S.setAttributes(Y,[["x1",""+te],["y1",""+G.y],["x2",""+te],["y2",""+(G.y+G.height)]])}),S.setAttributes(this.cropShadeElement,[["d",S.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,G.x,G.y,G.width,G.height)]]),this.topLeftGrip.setCenter(G.x,G.y),this.topRightGrip.setCenter(G.x+G.width,G.y),this.bottomLeftGrip.setCenter(G.x,G.y+G.height),this.bottomRightGrip.setCenter(G.x+G.width,G.y+G.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},Q.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)},Q.prototype.clientToLocalCoordinates=function(W,G){var X=this.container.getBoundingClientRect();return{x:W-X.left+this.margin,y:G-X.top+this.margin}},Q.prototype.onPointerDown=function(W){this.container.setPointerCapture(W.pointerId),this.previousPoint=this.clientToLocalCoordinates(W.clientX,W.clientY),this.cropRectElement===W.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(W.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(W.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(W.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(W.target)&&(this.activeGrip=this.bottomRightGrip)},Q.prototype.onPointerMove=function(W){if(this.isMoving)this.move(this.clientToLocalCoordinates(W.clientX,W.clientY));else if(this.activeGrip){var G=this.clientToLocalCoordinates(W.clientX,W.clientY);this.resize(G)}W.preventDefault()},Q.prototype.onPointerUp=function(W){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(W.pointerId)},Q.prototype.move=function(W){var G=W.x-this.previousPoint.x,X=W.y-this.previousPoint.y;this.zoomFactor!==1&&(G=-G/this.zoomFactor,X=-X/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+G),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+X),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=W},Q.prototype.resize=function(W){var G=Object.assign({},this.cropRect),X=W.x-this.previousPoint.x,ee=W.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:G.x+X<this.margin&&(X=this.margin-G.x),G.x+=X,G.width=this.cropRect.x+this.cropRect.width-G.x;break;case this.bottomRightGrip:case this.topRightGrip:G.width+X>this.canvasWidth*this.zoomFactor&&(X=this.canvasWidth*this.zoomFactor-G.width),G.width+=X}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(G.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(X),G.height=this.aspectRatio.getVerticalLength(G.width)):(G.y+=ee,G.height=this.cropRect.y+this.cropRect.height-G.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?G.height=this.aspectRatio.getVerticalLength(G.width):G.height+=ee}G.width<10&&(G.x=this.cropRect.x,G.width=10),G.height<10&&(G.y=this.cropRect.y,G.height=10),this.previousPoint=W,G.x>=this.margin&&G.y>=this.margin&&G.x-this.margin+G.width<=this.canvasWidth&&G.y-this.margin+G.height<=this.canvasHeight&&(this.cropRect=G,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},Q.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var W=this.cropRect.x+this.cropRect.width/2,G=this.cropRect.y+this.cropRect.height/2,X=this.aspectRatio.getHorizontalLength(this.cropRect.height),ee=this.aspectRatio.getVerticalLength(this.cropRect.width);X/this.canvasWidth<ee/this.canvasHeight?this.cropRect.width=X:this.cropRect.height=ee,this.cropRect.width>this.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=W-this.cropRect.width/2,this.cropRect.y=G-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)}},Q.prototype.getRescaledRect=function(W,G,X,ee,Y,$){var te=X/W,ie=ee/G;return{x:(Y.x-$)*te+$,y:(Y.y-$)*ie+$,width:Y.width*te,height:Y.height*ie}},Q.prototype.scaleCanvas=function(W,G){var X=this.getRescaledRect(this.canvasWidth,this.canvasHeight,W,G,this.cropRect,this.margin);this.canvasWidth=W,this.canvasHeight=G,this.onCropChange&&this.onCropChange(X),this.setCropRectangle(X)},Q}(),Ee=function(){function Q(W){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=W,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(Q.prototype,"angle",{get:function(){return this._angle},set:function(W){this._angle=W,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),Q.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},Q.prototype.onPointerDown=function(W){this.controlContainer.setPointerCapture(W.pointerId),this.isDragging=!0,this.previousPoint={x:W.clientX,y:W.clientY}},Q.prototype.onPointerMove=function(W){this.isDragging&&(this.onAngleChange&&this.onAngleChange((W.clientX-this.previousPoint.x)/5),this.previousPoint.x=W.clientX)},Q.prototype.onPointerUp=function(W){this.isDragging&&this.onAngleChange&&this.onAngleChange((W.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(W.pointerId)},Q.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var W=this.angleLabelText.getBBox();S.setAttributes(this.angleLabelElement,[["x",((this.width-W.width)/2).toString()],["y",(this.height/2).toString()]])}},Q.prototype.positionScaleShape=function(){if(this.scaleShape){var W=this.scaleShape.transform.baseVal.getItem(0);W.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(W,0)}},Q.prototype.getVisual=function(){var W=document.createElementNS("http://www.w3.org/2000/svg","svg");W.setAttribute("xmlns","http://www.w3.org/2000/svg"),W.setAttribute("width",this.width+"px"),W.setAttribute("height",this.height+"px"),W.setAttribute("viewBox","0 0 "+this.width+" "+this.height),W.style.flexShrink="0",document.body.appendChild(W);for(var G="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,X=1;X<=this.width/5+10;X++){var ee=X%5==0?this.height/3:this.height/6;G+="h4v"+-ee+"h1v"+ee}G+="v1H0Z",this.scaleShape=S.createPath(G);var Y=S.createTransform();this.scaleShape.transform.baseVal.appendItem(Y),W.appendChild(this.scaleShape),this.angleLabelElement=S.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=S.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var $=S.createTSpan("");return $.innerHTML="&deg;",this.angleLabelElement.appendChild($),W.appendChild(this.angleLabelElement),document.body.removeChild(W),W},Q}(),Te=function(){function Q(){this.naturalSize=!1,this.imageType="image/png"}return Q.prototype.rasterize=function(W,G,X,ee,Y,$,te){var ie=this;return new Promise(function(be){var ve=document.createElement("canvas");ve.width=W.width.baseVal.value-2*ee,ve.height=W.height.baseVal.value-2*ee;var Oe=1,Le=1;ie.naturalSize===!0?(Oe=G.naturalWidth/(W.width.baseVal.value-2*ee)/$,Le=G.naturalHeight/(W.height.baseVal.value-2*ee)/te,ve.width=G.naturalWidth/$,ve.height=G.naturalHeight/te):ie.width!==void 0&&ie.height!==void 0&&(Oe=ie.width/X.width,Le=ie.height/X.height,ve.width*=Oe,ve.height*=Le);var Pe=ve.getContext("2d");Pe.translate(ve.width/2,ve.height/2),Pe.rotate(Y*Math.PI/180),Pe.scale($,te),Pe.translate(-ve.width/2,-ve.height/2),Pe.drawImage(G,0,0,ve.width,ve.height);var ke=document.createElement("canvas");ke.width=X.width*Oe,ke.height=X.height*Le,ke.getContext("2d").putImageData(Pe.getImageData((X.x-ee)*Oe,(X.y-ee)*Le,X.width*Oe,X.height*Le),0,0),be(ke.toDataURL(ie.imageType,ie.imageQuality))})},Q}(),Se=function(){function Q(W){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=Q.instanceCounter++,this.styles=new A(this.instanceNo),this.target=W,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(Q.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(W){this._zoomToCropEnabled=W,W?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(W){this._isGridVisible=W,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"gridLines",{get:function(){return this._gridLines},set:function(W){this._gridLines=W,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(W){this._rotationAngle=W,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(Q.prototype,"aspectRatio",{get:function(){var W;return(W=this._aspectRatio)!==null&&W!==void 0?W:this.aspectRatios[0]},set:function(W){this._aspectRatio=W},enumerable:!1,configurable:!0}),Q.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},Q.prototype.show=function(){this.showUI(),this.open()},Q.prototype.close=function(W){W===void 0&&(W=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),W||this.closeEventListeners.forEach(function(G){return G()}),this._isOpen=!1)},Q.prototype.addRenderEventListener=function(W){this.renderEventListeners.push(W)},Q.prototype.removeRenderEventListener=function(W){this.renderEventListeners.indexOf(W)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(W),1)},Q.prototype.addCloseEventListener=function(W){this.closeEventListeners.push(W)},Q.prototype.removeCloseEventListener=function(W){this.closeEventListeners.indexOf(W)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(W),1)},Q.prototype.setupResizeObserver=function(){var W=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){W.resize(W.target.clientWidth,W.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))},Q.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var W=1*this.target.clientWidth/this.target.clientHeight,G=this.contentDiv.clientWidth/W>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*W:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,X=G+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/W;this.resize(G,X)}},Q.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},Q.prototype.setEditingTargetSize=function(){this.editorCanvas.style.width=this.imageWidth+2*this.CANVAS_MARGIN+"px",this.editorCanvas.style.height=this.imageHeight+2*this.CANVAS_MARGIN+"px",S.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},Q.prototype.resize=function(W,G){this.imageWidth=Math.round(W),this.imageHeight=Math.round(G),this.setEditingTargetSize(),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.displayMode!=="popup"?this.coverDiv.style.width=this.paddedImageWidth+"px":(this.setTopLeft(),this.positionCropImage()),this.cropLayer.scaleCanvas(this.imageWidth,this.imageHeight),this.applyRotation()},Q.prototype.setEditingTarget=function(){var W=document.createElement("canvas");W.width=this.target.naturalWidth,W.height=this.target.naturalHeight,W.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var G=W.toDataURL();S.setAttributes(this.editingTarget,[["href",G]]),this.setEditingTargetSize()},Q.prototype.setTopLeft=function(){var W=this.target.getBoundingClientRect(),G=this.editorCanvas.getBoundingClientRect();this.left=W.left-G.left-this.CANVAS_MARGIN,this.top=W.top-G.top-this.CANVAS_MARGIN},Q.prototype.initCropCanvas=function(){this.cropImageHolder=document.createElement("div"),this.cropImageHolder.style.setProperty("touch-action","none"),this.cropImageHolder.style.setProperty("-ms-touch-action","none"),this.cropImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.cropImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.cropImage.setAttribute("width",this.paddedImageWidth.toString()),this.cropImage.setAttribute("height",this.paddedImageHeight.toString()),this.cropImage.setAttribute("viewBox","0 0 "+this.paddedImageWidth.toString()+" "+this.paddedImageHeight.toString()),this.cropImage.style.pointerEvents="auto",this.cropImageHolder.style.width=this.paddedImageWidth+"px",this.cropImageHolder.style.height=this.paddedImageHeight+"px",this.cropImageHolder.style.transformOrigin="top left",this.positionCropImage(),this.defs=S.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=S.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=S.createGroup(),this.editingTargetRotationScaleContainer=S.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var W=S.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(W);var G=S.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(G),this.editingTargetContainer=S.createGroup(),this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px)",this.editingTargetContainer.appendChild(this.editingTargetRotationContainer),this.cropImage.appendChild(this.editingTargetContainer),this.cropImageHolder.appendChild(this.cropImage),this.editorCanvas.appendChild(this.cropImageHolder)},Q.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},Q.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=S.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new de(this.imageWidth,this.imageHeight,this.CANVAS_MARGIN,this.cropLayerContainer),this.cropLayer.onCropChange=this.cropRectChanged,this.cropLayer.numberOfGridLines=this.gridLines,this.cropLayer.isGridVisible=this.isGridVisible,this.cropLayer.cropShadeColor=this.styles.settings.cropShadeColor,this.cropLayer.cropFrameColor=this.styles.settings.cropFrameColor,this.cropLayer.gripColor=this.styles.settings.gripColor,this.cropLayer.gripFillColor=this.styles.settings.gripFillColor,this.cropLayer.open(),this.cropLayer.setCropRectangle(this.cropRect),this.zoomToCropEnabled&&this.zoomToCrop()},Q.prototype.zoomToCrop=function(){if(this.cropRect){var W=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,G=this.cropRect.y-this.CANVAS_MARGIN+this.cropRect.height/2;this.zoomFactor=Math.min(this.imageWidth/this.cropRect.width,this.imageHeight/this.cropRect.height),this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin=W+"px "+G+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-W+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-G+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},Q.prototype.unzoomFromCrop=function(){this.zoomFactor=1,this.editingTargetContainer&&this.cropLayer&&(this.editingTargetContainer.style.transformOrigin="center",this.editingTargetContainer.style.transform="translate("+this.CANVAS_MARGIN+"px, "+this.CANVAS_MARGIN+"px) scale(1)",this.cropLayer.zoomFactor=this.zoomFactor)},Q.prototype.cropRectChanged=function(W){this.cropRect=W,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},Q.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},Q.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"},Q.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},Q.prototype.showUI=function(){switch(this.addStyles(),this.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.displayMode){case"inline":this.coverDiv.style.position="absolute";var W=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,G=this.target.offsetTop>W+this.CANVAS_MARGIN?this.target.offsetTop-(W+this.CANVAS_MARGIN):0;this.coverDiv.style.top=G+"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},Q.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},Q.prototype.addTopToolbar=function(){var W=this;this.topToolbar=new P,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 G=new he;G.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(G);var X=[];this.aspectRatios.forEach(function(Le){var Pe=new ye(me.getIcon(Le.horizontal,Le.vertical),Le.horizontal===0&&Le.vertical===0?"FREE":Le.horizontal+":"+Le.vertical);Pe.onClick=function(){return W.ratioButtonClicked(Le)},X.push(Pe)}),this.aspectRatioButton=new _e(me.getIcon(0,0),"Aspect ratio",X),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,G.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var ee=new ye('<svg viewBox="0 0 24 24"><path d="M10 4v4h4V4h-4m6 0v4h4V4h-4m0 6v4h4v-4h-4m0 6v4h4v-4h-4m-2 4v-4h-4v4h4m-6 0v-4H4v4h4m0-6v-4H4v4h4m0-6V4H4v4h4m2 6h4v-4h-4v4M4 2h16a2 2 0 012 2v16a2 2 0 01-2 2H4c-1.08 0-2-.9-2-2V4a2 2 0 012-2z"/></svg>',"Toggle grid");ee.isActive=this.isGridVisible,ee.onClick=function(){W.isGridVisible=!W.isGridVisible,ee.isActive=W.isGridVisible},G.addButton(ee);var Y=new ye('<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"Zoom to selection");if(Y.isActive=this.zoomToCropEnabled,Y.onClick=function(){W.zoomToCropEnabled=!W.zoomToCropEnabled,Y.isActive=W.zoomToCropEnabled},G.addButton(Y),!M.isLicensed){var $=new J;this.topToolbar.addElementBlock($);var te=document.createElement("div");te.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var ie=document.createElement("a");ie.style.color="currentColor",ie.href="https://markerjs.com/products/cropro",ie.target="_blank",ie.innerHTML='<svg viewBox="0 0 24 24" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="2"><path d="M16.326 14.895c0 1.126-.558 1.688-1.673 1.688H9.931c-1.116 0-1.674-.562-1.674-1.688V3.733c0-1.126.558-1.688 1.674-1.688h4.722c1.115 0 1.673.562 1.673 1.688v2.899h-1.957V3.793h-4.124v11.042h4.124v-3.242h1.957v3.302z" fill="currentColor"/><path d="M15.94 7.364a.783.783 0 00-1.065-.304l-11.01 6.126a.783.783 0 00-.303 1.065l4.498 8.085a.783.783 0 001.065.304l11.01-6.126a.783.783 0 00.303-1.065L15.94 7.364zM5.311 14.173l3.737 6.718 9.641-5.364-3.737-6.718-9.641 5.364z" fill="#eef762"/></svg>',te.appendChild(ie),$.addElement(te)}var be=new he;be.minWidth=3*this.toolbarHeight+"px",be.contentAlign="end",this.topToolbar.addButtonBlock(be);var ve=new ye('<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"OK");ve.onClick=this.startRenderAndClose,be.addButton(ve),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(ve.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Oe=new ye('<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"Close");Oe.onClick=this.close,be.addButton(Oe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Oe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},Q.prototype.addBottomToolbar=function(){var W=this;this.bottomToolbar=new P,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 G=new he;G.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(G);var X=new ye('<svg viewBox="0 0 24 24"><path d="M13 4.07V1L8.45 5.55 13 10V6.09c2.84.48 5 2.94 5 5.91s-2.16 5.43-5 5.91v2.02c3.95-.49 7-3.85 7-7.93s-3.05-7.44-7-7.93M7.1 18.32c1.16.9 2.51 1.44 3.9 1.61V17.9c-.87-.15-1.71-.49-2.46-1.03L7.1 18.32M6.09 13H4.07c.17 1.39.72 2.73 1.62 3.89l1.41-1.42c-.52-.75-.87-1.59-1.01-2.47m1.02-4.47L5.7 7.11C4.8 8.27 4.24 9.61 4.07 11h2.02c.14-.87.49-1.72 1.02-2.47z"/></svg>',"Rotate left");X.onClick=this.rotateLeftButtonClicked,G.addButton(X);var ee=new ye('<svg viewBox="0 0 24 24"><path d="M16.89 15.5l1.42 1.39c.9-1.16 1.45-2.5 1.62-3.89h-2.02c-.14.87-.48 1.72-1.02 2.5M13 17.9v2.02c1.39-.17 2.74-.71 3.9-1.61l-1.44-1.44c-.75.54-1.59.89-2.46 1.03m6.93-6.9a7.906 7.906 0 00-1.62-3.89l-1.42 1.42c.54.75.88 1.6 1.02 2.47m-2.36-5.45L11 1v3.07C7.06 4.56 4 7.92 4 12s3.05 7.44 7 7.93v-2.02c-2.84-.48-5-2.94-5-5.91s2.16-5.43 5-5.91V10l4.55-4.45z"/></svg>',"Rotate right");ee.onClick=this.rotateRightButtonClicked,G.addButton(ee);var Y=new J;Y.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(Y),this.straightener=new Ee("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(be){W.rotateBy(be),W.straightener.angle=W.rotationAngle},Y.addElement(this.straightener.getUI());var $=new he;$.minWidth=2*this.toolbarHeight+"px",$.contentAlign="end",this.bottomToolbar.addButtonBlock($);var te=new ye('<svg viewBox="0 0 24 24"><path d="M15 21h2v-2h-2m4-10h2V7h-2M3 5v14c0 1.1.9 2 2 2h4v-2H5V5h4V3H5c-1.1 0-2 .9-2 2m16-2v2h2c0-1.1-.9-2-2-2m-8 20h2V1h-2m8 16h2v-2h-2M15 5h2V3h-2m4 10h2v-2h-2m0 10c1.1 0 2-.9 2-2h-2z"/></svg>',"Flip horizontal");te.onClick=this.flipHorizontallyButtonClicked,$.addButton(te);var ie=new ye('<svg viewBox="0 0 24 24"><path d="M3 15v2h2v-2m10 4v2h2v-2m2-16H5c-1.1 0-2 .9-2 2v4h2V5h14v4h2V5c0-1.1-.9-2-2-2m2 16h-2v2c1.1 0 2-.9 2-2M1 11v2h22v-2M7 19v2h2v-2m10-4v2h2v-2m-10 4v2h2v-2M3 19c0 1.1.9 2 2 2v-2z"/></svg>',"Flip vertical");ie.onClick=this.flipVerticallyButtonClicked,$.addButton(ie)},Q.prototype.ratioButtonClicked=function(W){this.aspectRatio=W,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},Q.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=me.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},Q.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new se(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},Q.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},Q.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},Q.prototype.restoreState=function(W){if(W){var G=this.cropLayer.getRescaledRect(W.width,W.height,this.imageWidth,this.imageHeight,W.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(G),this.cropRectChanged(G),this.flippedHorizontally=W.flippedHorizontally,this.flippedVertically=W.flippedVertically,this.applyFlip(),this.rotationAngle=W.rotationAngle,this.applyRotation()}},Q.prototype.clientToLocalCoordinates=function(W,G){var X=this.cropImage.getBoundingClientRect();return{x:W-X.left,y:G-X.top}},Q.prototype.onWindowResize=function(){this.positionUI()},Q.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var W=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=W+"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()},Q.prototype.rotateLeftButtonClicked=function(){var W=this.rotationAngle-90;this.rotationAngle%90!=0&&(W+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(W)},Q.prototype.rotateRightButtonClicked=function(){var W=this.rotationAngle+90;this.rotationAngle%90!=0&&(W-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(W)},Q.prototype.rotateTo=function(W){W=(W=W>180?W-360:W)<=-180?W+360:W,this.rotationAngle=W,this.applyRotation()},Q.prototype.rotateBy=function(W){this.rotateTo((this.rotationAngle+W)%360)},Q.prototype.applyRotation=function(){var W=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var G=this.editingTargetRotationContainer.transform.baseVal.getItem(0);G.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(G,0);var X=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/X.width,this.imageHeight/X.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=W},Q.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},Q.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},Q.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},Q.prototype.startRenderAndClose=function(){return fe(this,void 0,void 0,function(){var W,G;return q(this,function(X){switch(X.label){case 0:return[4,this.render()];case 1:return W=X.sent(),G=this.getState(),this.renderEventListeners.forEach(function(ee){return ee(W,G)}),this.close(!0),[2]}})})},Q.prototype.render=function(){return fe(this,void 0,void 0,function(){var W;return q(this,function(G){switch(G.label){case 0:return(W=new Te).naturalSize=this.renderAtNaturalSize,W.imageType=this.renderImageType,W.imageQuality=this.renderImageQuality,W.width=this.renderWidth,W.height=this.renderHeight,this.unzoomFromCrop(),S.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,W.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 G.sent(),[4,W.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,G.sent()]}})})},Q.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new K("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 K("toolbar_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarBlockStyleClass=this.styles.addClass(new K("toolbar-block",`
display: flex;
align-items: center;
box-sizing: content-box;
`));var W=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new K("toolbar_button",`
display: inline-block;
width: `+(this.toolbarHeight-2*W)+`px;
height: `+(this.toolbarHeight-2*W)+`px;
padding: `+W+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new K("toolbar_button_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new K("toolbar_active_button",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
`)),this.styles.addRule(new F("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.toolbarHeight/2+`px;
`)),this.styles.addRule(new F("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new K("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 K("toolbar_dropdown_colors",`
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new K("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 K("toolbar_straightener",`
display: flex;
overflow: hidden;
justify-content: center;
height: `+(this.toolbarHeight-2*W)+`px;
padding: `+W+`px;
cursor: default;
user-select: none;
box-sizing: content-box;
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new K("toolbar_straightener_colors",`
color: `+this.styles.settings.toolbarColor+`;
fill: currentColor;
`))},Q.instanceCounter=0,Q}(),we=z("8hTe"),Ae=z.n(we),xe=/<pre[^>]*>/g;function Re(Q){var W=document.createElement("div");return W.innerHTML=Q,W.childNodes.length===0?"":W.childNodes[0].nodeValue}var Ie=ce.a=function(Q){var W=Q.value,G=W===void 0?"":W,X=Q.edit,ee=X===void 0?!1:X,Y=Q.className,$=Q.showTextOnly,te=Q.showLines,ie=Q.replaces,be=Q.zoomImg,ve=Q.hasMask,Oe=Q.style,Le=Oe===void 0?{}:Oe,Pe=Q.stylesPrev,ke=Pe===void 0?{}:Pe,Ge=String(G),Ke=Object(w.useRef)(),Ue=Object(w.useRef)(),it=Object(w.useState)(""),$e=Object(j.a)(it,2),rt=$e[0],qe=$e[1],Ye=Object(w.useState)("office"),nt=Object(j.a)(Ye,2),at=nt[0],et=nt[1],ut=function(){var De=new Se(Ue.current);De.displayMode="popup",De.addRenderEventListener(function(){var He=Object(C.a)(e.a.mark(function Ne(Ve){var je;return e.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:return Ke.current.style.display="none",Qe.next=3,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ve}});case 3:je=Qe.sent,je!=null&&je.id&&ie(Ue.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(je==null?void 0:je.id,"?type=").concat(je.content_type));case 5:case"end":return Qe.stop()}},Ne)}));return function(Ne){return He.apply(this,arguments)}}()),De.show()},Me=function(){var De=new pe.a(Ue.current);De.settings.displayMode="popup",De.addEventListener("render",function(){var He=Object(C.a)(e.a.mark(function Ne(Ve){var je;return e.a.wrap(function(Qe){for(;;)switch(Qe.prev=Qe.next){case 0:if(Ke.current.style.display="none",!Ue.current){Qe.next=6;break}return Qe.next=4,Object(ge.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Ve.dataUrl}});case 4:je=Qe.sent,je!=null&&je.id&&ie(Ue.current.getAttribute("src").replace(Z.a.API_SERVER,""),"/api/attachments/".concat(je==null?void 0:je.id,"?type=").concat(je.content_type));case 6:case"end":return Qe.stop()}},Ne)}));return function(Ne){return He.apply(this,arguments)}}()),De.show(),window.markerArea=De},Be=Object(w.useMemo)(function(){Ke.current&&(Ke.current.style.zIndex=-1);try{var We=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,De=/\"\/api\/attachments\/|\"\/attachments\/download\//g,He=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;Ge=Ge.replace(We,"("+Z.a.API_SERVER+"/api/attachments/").replace(De,'"'+Z.a.API_SERVER+"/api/attachments/").replace(He,'"'+Z.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(Ze){}var Ne=k(Ge),Ve=E();if(Ge.match(/\[TOC\]/)&&(Ne=Ne.replace("<p>[TOC]</p>",_()),v()),Ne=Ne.replace(/(__special_katext_id_\d+__)/g,function(Ze,Qe){var pt=Ve[Qe],vt=pt.type,Ct=pt.expression;return Object(ue.renderToString)(Re(Ct)||"",{displayMode:vt==="block",throwOnError:!1,output:"html"})}),Ne=Ne.replace(/▁/g,"\u2581\u2581\u2581"),y(),$){var je=document.createElement("div");return je.innerHTML=Ne,je.innerText}return setTimeout(function(){return st()},500),Ne},[Ge]),ze=Object(w.useRef)();m.WebkitLineClamp=te,te&&(Le=Object(I.a)(Object(I.a)({},Le),m));function Je(We){var De=We.target;if(De.tagName.toUpperCase()==="IMG"){if(be){var He=De.getAttribute("src");qe(He),et("image")}}else if(De.tagName.toUpperCase()==="A"){var Ne=De.getAttribute("href");if(Ne.indexOf("office")>-1)We.preventDefault(),qe(Ne),et("office");else if(Ne.indexOf("application/pdf")>-1)We.preventDefault(),qe(Ne),et("pdf");else if(Ne.indexOf("text/html")>-1)We.preventDefault(),qe(Ne),et("html");else if(Ne.startsWith("#")){We.preventDefault();var Ve=document.getElementById(Ne.replace("#",""));Ve&&Ve.scrollIntoView(!0)}}}var st=function(){var De,He=(De=ze.current)===null||De===void 0?void 0:De.querySelectorAll("video");He==null||He.forEach(function(Ne){if(Ne.oncontextmenu=function(){return!1},Ne.src.indexOf(".m3u8")>-1&&!Ne.canPlayType("application/vnd.apple.mpegurl")){if(V.a.isSupported()){var Ve=new V.a;Ve.loadSource(Ne.src),Ve.attachMedia(Ne)}}})};Object(w.useEffect)(function(){if(ze.current&&Be&&(Be.match(xe)&&window.PR.prettyPrint()),ze.current)return ze.current.addEventListener("click",Je),function(){ze.current.removeEventListener("click",Je),y(),v()}},[Be,ze.current,Je]);var tt=function(De){if(!ee)return;De.target.nodeName==="IMG"?(Ke.current.style.zIndex=1,Ke.current.style.display="flex",Ke.current.style.width=De.target.clientWidth+"px",Ke.current.style.height=De.target.clientHeight+"px",Ke.current.style.top=De.target.offsetTop+"px",Ke.current.style.left=De.target.offsetLeft+"px",Ue.current.src=De.target.getAttribute("src")):Ke.current.style.display="none"};return g.a.createElement("div",{style:{position:"relative"}},g.a.createElement("div",{ref:ze,style:Object(I.a)({},Le),className:"".concat(Y||""," markdown-body ").concat(Ae.a.mdBody),onMouseOver:tt,dangerouslySetInnerHTML:{__html:Be}}),g.a.createElement("div",{ref:Ke,className:Ae.a.button},g.a.createElement(B.a,null,g.a.createElement(H.a,{onClick:function(){return ut()}},"\u88C1\u526A"),g.a.createElement(H.a,{onClick:function(){return Me()}},"\u7F16\u8F91"))),g.a.createElement("img",{ref:Ue,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),g.a.createElement(le.a,{close:!0,data:rt,type:rt!=null&&rt.length?at:"",style:Object(I.a)({},ke),onClose:function(){return qe("")}}))}},BU3w:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return C});var oe=z("MNnm"),B="rc-util-key";function O(j){if(j.attachTo)return j.attachTo;var N=document.querySelector("head");return N||document.body}function H(j){var N,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(oe.a)())return null;var w=document.createElement("style");if((N=e.csp)===null||N===void 0?void 0:N.nonce){var g;w.nonce=(g=e.csp)===null||g===void 0?void 0:g.nonce}w.innerHTML=j;var f=O(e),o=f.firstChild;return e.prepend&&f.prepend?f.prepend(w):e.prepend&&o?f.insertBefore(w,o):f.appendChild(w),w}var I=new Map;function C(j,N){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},w=O(e);if(!I.has(w)){var g=H("",e),f=g.parentNode;I.set(w,f),f.removeChild(g)}var o=Array.from(I.get(w).children).find(function(i){return i.tagName==="STYLE"&&i[B]===N});if(o){var n,a;if(((n=e.csp)===null||n===void 0?void 0:n.nonce)&&o.nonce!==((a=e.csp)===null||a===void 0?void 0:a.nonce)){var l;o.nonce=(l=e.csp)===null||l===void 0?void 0:l.nonce}return o.innerHTML!==j&&(o.innerHTML=j),o}var s=H(j,e);return s[B]=N,s}},"C/vA":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return oe});function oe(B){const O=this;let H=!1,I;return function(){return H||(H=!0,I=B.apply(O,arguments)),I}}},"Cg/j":function(Fe,ce,z){"use strict";z.d(ce,"b",function(){return oe}),z.d(ce,"a",function(){return B}),z.d(ce,"c",function(){return H}),z.d(ce,"d",function(){return I});var oe;(function(C){C.serviceIds=new Map,C.DI_TARGET="$di$target",C.DI_DEPENDENCIES="$di$dependencies";function j(N){return N[C.DI_DEPENDENCIES]||[]}C.getServiceDependencies=j})(oe||(oe={}));const B=H("instantiationService");function O(C,j,N,e){j[oe.DI_TARGET]===j?j[oe.DI_DEPENDENCIES].push({id:C,index:N,optional:e}):(j[oe.DI_DEPENDENCIES]=[{id:C,index:N,optional:e}],j[oe.DI_TARGET]=j)}function H(C){if(oe.serviceIds.has(C))return oe.serviceIds.get(C);const j=function(N,e,w){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");O(j,N,w,!1)};return j.toString=()=>C,oe.serviceIds.set(C,j),j}function I(C){return function(j,N,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");O(C,j,e,!0)}}},DlQD:function(Fe,ce,z){(function(oe,B){Fe.exports=B()})(this,function(){"use strict";function oe(G,X){for(var ee=0;ee<X.length;ee++){var Y=X[ee];Y.enumerable=Y.enumerable||!1,Y.configurable=!0,"value"in Y&&(Y.writable=!0),Object.defineProperty(G,Y.key,Y)}}function B(G,X,ee){return X&&oe(G.prototype,X),ee&&oe(G,ee),G}function O(G,X){if(!G)return;if(typeof G=="string")return H(G,X);var ee=Object.prototype.toString.call(G).slice(8,-1);if(ee==="Object"&&G.constructor&&(ee=G.constructor.name),ee==="Map"||ee==="Set")return Array.from(G);if(ee==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(ee))return H(G,X)}function H(G,X){(X==null||X>G.length)&&(X=G.length);for(var ee=0,Y=new Array(X);ee<X;ee++)Y[ee]=G[ee];return Y}function I(G,X){var ee;if(typeof Symbol=="undefined"||G[Symbol.iterator]==null){if(Array.isArray(G)||(ee=O(G))||X&&G&&typeof G.length=="number"){ee&&(G=ee);var Y=0;return function(){return Y>=G.length?{done:!0}:{done:!1,value:G[Y++]}}}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 ee=G[Symbol.iterator](),ee.next.bind(ee)}function C(G,X){return X={exports:{}},G(X,X.exports),X.exports}var j=C(function(G){function X(){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 ee(Y){G.exports.defaults=Y}G.exports={defaults:X(),getDefaults:X,changeDefaults:ee}}),N=j.defaults,e=j.getDefaults,w=j.changeDefaults,g=/[&<>"']/,f=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,n=/[<>"']|&(?!#?\w+;)/g,a={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},l=function(X){return a[X]};function s(G,X){if(X){if(g.test(G))return G.replace(f,l)}else if(o.test(G))return G.replace(n,l);return G}var i=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function r(G){return G.replace(i,function(X,ee){return ee=ee.toLowerCase(),ee==="colon"?":":ee.charAt(0)==="#"?ee.charAt(1)==="x"?String.fromCharCode(parseInt(ee.substring(2),16)):String.fromCharCode(+ee.substring(1)):""})}var t=/(^|[^\[])\^/g;function v(G,X){G=G.source||G,X=X||"";var ee={replace:function($,te){return te=te.source||te,te=te.replace(t,"$1"),G=G.replace($,te),ee},getRegex:function(){return new RegExp(G,X)}};return ee}var m=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function _(G,X,ee){if(G){var Y;try{Y=decodeURIComponent(r(ee)).replace(m,"").toLowerCase()}catch($){return null}if(Y.indexOf("javascript:")===0||Y.indexOf("vbscript:")===0||Y.indexOf("data:")===0)return null}X&&!p.test(ee)&&(ee=d(X,ee));try{ee=encodeURI(ee).replace(/%25/g,"%")}catch($){return null}return ee}var b={},u=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(G,X){b[" "+G]||(u.test(G)?b[" "+G]=G+"/":b[" "+G]=D(G,"/",!0)),G=b[" "+G];var ee=G.indexOf(":")===-1;return X.substring(0,2)==="//"?ee?X:G.replace(h,"$1")+X:X.charAt(0)==="/"?ee?X:G.replace(c,"$1")+X:G+X}var E={exec:function(){}};function y(G){for(var X=1,ee,Y;X<arguments.length;X++){ee=arguments[X];for(Y in ee)Object.prototype.hasOwnProperty.call(ee,Y)&&(G[Y]=ee[Y])}return G}function T(G,X){var ee=G.replace(/\|/g,function(te,ie,be){for(var ve=!1,Oe=ie;--Oe>=0&&be[Oe]==="\\";)ve=!ve;return ve?"|":" |"}),Y=ee.split(/ \|/),$=0;if(Y.length>X)Y.splice(X);else for(;Y.length<X;)Y.push("");for(;$<Y.length;$++)Y[$]=Y[$].trim().replace(/\\\|/g,"|");return Y}function D(G,X,ee){var Y=G.length;if(Y===0)return"";for(var $=0;$<Y;){var te=G.charAt(Y-$-1);if(te===X&&!ee)$++;else if(te!==X&&ee)$++;else break}return G.substr(0,Y-$)}function L(G,X){if(G.indexOf(X[1])===-1)return-1;for(var ee=G.length,Y=0,$=0;$<ee;$++)if(G[$]==="\\")$++;else if(G[$]===X[0])Y++;else if(G[$]===X[1]&&(Y--,Y<0))return $;return-1}function x(G){G&&G.sanitize&&!G.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}var k={escape:s,unescape:r,edit:v,cleanUrl:_,resolveUrl:d,noopTest:E,merge:y,splitCells:T,rtrim:D,findClosingBracket:L,checkSanitizeDeprecation:x},U=j.defaults,R=k.rtrim,V=k.splitCells,Z=k.escape,ue=k.findClosingBracket;function le(G,X,ee){var Y=X.href,$=X.title?Z(X.title):null,te=G[1].replace(/\\([\[\]])/g,"$1");return G[0].charAt(0)!=="!"?{type:"link",raw:ee,href:Y,title:$,text:te}:{type:"image",raw:ee,href:Y,title:$,text:Z(te)}}function ge(G,X){var ee=G.match(/^(\s+)(?:```)/);if(ee===null)return X;var Y=ee[1];return X.split(`
`).map(function($){var te=$.match(/^\s+/);if(te===null)return $;var ie=te[0];return ie.length>=Y.length?$.slice(Y.length):$}).join(`
`)}var pe=function(){function G(ee){this.options=ee||U}var X=G.prototype;return X.space=function(Y){var $=this.rules.block.newline.exec(Y);if($)return $[0].length>1?{type:"space",raw:$[0]}:{raw:`
`}},X.code=function(Y,$){var te=this.rules.block.code.exec(Y);if(te){var ie=$[$.length-1];if(ie&&ie.type==="paragraph")return{raw:te[0],text:te[0].trimRight()};var be=te[0].replace(/^ {4}/gm,"");return{type:"code",raw:te[0],codeBlockStyle:"indented",text:this.options.pedantic?be:R(be,`
`)}}},X.fences=function(Y){var $=this.rules.block.fences.exec(Y);if($){var te=$[0],ie=ge(te,$[3]||"");return{type:"code",raw:te,lang:$[2]?$[2].trim():$[2],text:ie}}},X.heading=function(Y){var $=this.rules.block.heading.exec(Y);if($)return{type:"heading",raw:$[0],depth:$[1].length,text:$[2]}},X.nptable=function(Y){var $=this.rules.block.nptable.exec(Y);if($){var te={type:"table",header:V($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
`):[],raw:$[0]};if(te.header.length===te.align.length){var ie=te.align.length,be;for(be=0;be<ie;be++)/^ *-+: *$/.test(te.align[be])?te.align[be]="right":/^ *:-+: *$/.test(te.align[be])?te.align[be]="center":/^ *:-+ *$/.test(te.align[be])?te.align[be]="left":te.align[be]=null;for(ie=te.cells.length,be=0;be<ie;be++)te.cells[be]=V(te.cells[be],te.header.length);return te}}},X.hr=function(Y){var $=this.rules.block.hr.exec(Y);if($)return{type:"hr",raw:$[0]}},X.blockquote=function(Y){var $=this.rules.block.blockquote.exec(Y);if($){var te=$[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:$[0],text:te}}},X.list=function(Y){var $=this.rules.block.list.exec(Y);if($){for(var te=$[0],ie=$[2],be=ie.length>1,ve=ie[ie.length-1]===")",Oe={type:"list",raw:te,ordered:be,start:be?+ie.slice(0,-1):"",loose:!1,items:[]},Le=$[0].match(this.rules.block.item),Pe=!1,ke,Ge,Ke,Ue,it,$e,rt,qe=Le.length,Ye=0;Ye<qe;Ye++)ke=Le[Ye],te=ke,Ge=ke.length,ke=ke.replace(/^ *([*+-]|\d+[.)]) */,""),~ke.indexOf(`
`)&&(Ge-=ke.length,ke=this.options.pedantic?ke.replace(/^ {1,4}/gm,""):ke.replace(new RegExp("^ {1,"+Ge+"}","gm"),"")),Ye!==qe-1&&(Ke=this.rules.block.bullet.exec(Le[Ye+1])[0],(be?Ke.length===1||!ve&&Ke[Ke.length-1]===")":Ke.length>1||this.options.smartLists&&Ke!==ie)&&(Ue=Le.slice(Ye+1).join(`
`),Oe.raw=Oe.raw.substring(0,Oe.raw.length-Ue.length),Ye=qe-1)),it=Pe||/\n\n(?!\s*$)/.test(ke),Ye!==qe-1&&(Pe=ke.charAt(ke.length-1)===`
`,it||(it=Pe)),it&&(Oe.loose=!0),$e=/^\[[ xX]\] /.test(ke),rt=void 0,$e&&(rt=ke[1]!==" ",ke=ke.replace(/^\[[ xX]\] +/,"")),Oe.items.push({type:"list_item",raw:te,task:$e,checked:rt,loose:it,text:ke});return Oe}},X.html=function(Y){var $=this.rules.block.html.exec(Y);if($)return{type:this.options.sanitize?"paragraph":"html",raw:$[0],pre:!this.options.sanitizer&&($[1]==="pre"||$[1]==="script"||$[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer($[0]):Z($[0]):$[0]}},X.def=function(Y){var $=this.rules.block.def.exec(Y);if($){$[3]&&($[3]=$[3].substring(1,$[3].length-1));var te=$[1].toLowerCase().replace(/\s+/g," ");return{tag:te,raw:$[0],href:$[2],title:$[3]}}},X.table=function(Y){var $=this.rules.block.table.exec(Y);if($){var te={type:"table",header:V($[1].replace(/^ *| *\| *$/g,"")),align:$[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:$[3]?$[3].replace(/\n$/,"").split(`
`):[]};if(te.header.length===te.align.length){te.raw=$[0];var ie=te.align.length,be;for(be=0;be<ie;be++)/^ *-+: *$/.test(te.align[be])?te.align[be]="right":/^ *:-+: *$/.test(te.align[be])?te.align[be]="center":/^ *:-+ *$/.test(te.align[be])?te.align[be]="left":te.align[be]=null;for(ie=te.cells.length,be=0;be<ie;be++)te.cells[be]=V(te.cells[be].replace(/^ *\| *| *\| *$/g,""),te.header.length);return te}}},X.lheading=function(Y){var $=this.rules.block.lheading.exec(Y);if($)return{type:"heading",raw:$[0],depth:$[2].charAt(0)==="="?1:2,text:$[1]}},X.paragraph=function(Y){var $=this.rules.block.paragraph.exec(Y);if($)return{type:"paragraph",raw:$[0],text:$[1].charAt($[1].length-1)===`
`?$[1].slice(0,-1):$[1]}},X.text=function(Y,$){var te=this.rules.block.text.exec(Y);if(te){var ie=$[$.length-1];return ie&&ie.type==="text"?{raw:te[0],text:te[0]}:{type:"text",raw:te[0],text:te[0]}}},X.escape=function(Y){var $=this.rules.inline.escape.exec(Y);if($)return{type:"escape",raw:$[0],text:Z($[1])}},X.tag=function(Y,$,te){var ie=this.rules.inline.tag.exec(Y);if(ie)return!$&&/^<a /i.test(ie[0])?$=!0:$&&/^<\/a>/i.test(ie[0])&&($=!1),!te&&/^<(pre|code|kbd|script)(\s|>)/i.test(ie[0])?te=!0:te&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ie[0])&&(te=!1),{type:this.options.sanitize?"text":"html",raw:ie[0],inLink:$,inRawBlock:te,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):Z(ie[0]):ie[0]}},X.link=function(Y){var $=this.rules.inline.link.exec(Y);if($){var te=ue($[2],"()");if(te>-1){var ie=$[0].indexOf("!")===0?5:4,be=ie+$[1].length+te;$[2]=$[2].substring(0,te),$[0]=$[0].substring(0,be).trim(),$[3]=""}var ve=$[2],Oe="";if(this.options.pedantic){var Le=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(ve);Le?(ve=Le[1],Oe=Le[3]):Oe=""}else Oe=$[3]?$[3].slice(1,-1):"";ve=ve.trim().replace(/^<([\s\S]*)>$/,"$1");var Pe=le($,{href:ve&&ve.replace(this.rules.inline._escapes,"$1"),title:Oe&&Oe.replace(this.rules.inline._escapes,"$1")},$[0]);return Pe}},X.reflink=function(Y,$){var te;if((te=this.rules.inline.reflink.exec(Y))||(te=this.rules.inline.nolink.exec(Y))){var ie=(te[2]||te[1]).replace(/\s+/g," ");if(ie=$[ie.toLowerCase()],!ie||!ie.href){var be=te[0].charAt(0);return{type:"text",raw:be,text:be}}var ve=le(te,ie,te[0]);return ve}},X.strong=function(Y,$,te){te===void 0&&(te="");var ie=this.rules.inline.strong.start.exec(Y);if(ie&&(!ie[1]||ie[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){$=$.slice(-1*Y.length);var be=ie[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;be.lastIndex=0;for(var ve;(ie=be.exec($))!=null;)if(ve=this.rules.inline.strong.middle.exec($.slice(0,ie.index+3)),ve)return{type:"strong",raw:Y.slice(0,ve[0].length),text:Y.slice(2,ve[0].length-2)}}},X.em=function(Y,$,te){te===void 0&&(te="");var ie=this.rules.inline.em.start.exec(Y);if(ie&&(!ie[1]||ie[1]&&(te===""||this.rules.inline.punctuation.exec(te)))){$=$.slice(-1*Y.length);var be=ie[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;be.lastIndex=0;for(var ve;(ie=be.exec($))!=null;)if(ve=this.rules.inline.em.middle.exec($.slice(0,ie.index+2)),ve)return{type:"em",raw:Y.slice(0,ve[0].length),text:Y.slice(1,ve[0].length-1)}}},X.codespan=function(Y){var $=this.rules.inline.code.exec(Y);if($){var te=$[2].replace(/\n/g," "),ie=/[^ ]/.test(te),be=te.startsWith(" ")&&te.endsWith(" ");return ie&&be&&(te=te.substring(1,te.length-1)),te=Z(te,!0),{type:"codespan",raw:$[0],text:te}}},X.br=function(Y){var $=this.rules.inline.br.exec(Y);if($)return{type:"br",raw:$[0]}},X.del=function(Y){var $=this.rules.inline.del.exec(Y);if($)return{type:"del",raw:$[0],text:$[1]}},X.autolink=function(Y,$){var te=this.rules.inline.autolink.exec(Y);if(te){var ie,be;return te[2]==="@"?(ie=Z(this.options.mangle?$(te[1]):te[1]),be="mailto:"+ie):(ie=Z(te[1]),be=ie),{type:"link",raw:te[0],text:ie,href:be,tokens:[{type:"text",raw:ie,text:ie}]}}},X.url=function(Y,$){var te;if(te=this.rules.inline.url.exec(Y)){var ie,be;if(te[2]==="@")ie=Z(this.options.mangle?$(te[0]):te[0]),be="mailto:"+ie;else{var ve;do ve=te[0],te[0]=this.rules.inline._backpedal.exec(te[0])[0];while(ve!==te[0]);ie=Z(te[0]),te[1]==="www."?be="http://"+ie:be=ie}return{type:"link",raw:te[0],text:ie,href:be,tokens:[{type:"text",raw:ie,text:ie}]}}},X.inlineText=function(Y,$,te){var ie=this.rules.inline.text.exec(Y);if(ie){var be;return $?be=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ie[0]):Z(ie[0]):ie[0]:be=Z(this.options.smartypants?te(ie[0]):ie[0]),{type:"text",raw:ie[0],text:be}}},G}(),ae=k.noopTest,ne=k.edit,fe=k.merge,q={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![A-Z][\\s\\S]*?>\\n*|<!\\[CDATA\\[[\\s\\S]*?\\]\\]>\\n*|</?(tag)(?: +|\\n|/?>)[\\s\\S]*?(?:\\n{2,}|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:\\n{2,}|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:ae,table:ae,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};q._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,q._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,q.def=ne(q.def).replace("label",q._label).replace("title",q._title).getRegex(),q.bullet=/(?:[*+-]|\d{1,9}[.)])/,q.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,q.item=ne(q.item,"gm").replace(/bull/g,q.bullet).getRegex(),q.list=ne(q.list).replace(/bull/g,q.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+q.def.source+")").getRegex(),q._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",q._comment=/<!--(?!-?>)[\s\S]*?-->/,q.html=ne(q.html,"i").replace("comment",q._comment).replace("tag",q._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),q.paragraph=ne(q._paragraph).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.blockquote=ne(q.blockquote).replace("paragraph",q.paragraph).getRegex(),q.normal=fe({},q),q.gfm=fe({},q.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*|$)"}),q.gfm.nptable=ne(q.gfm.nptable).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.gfm.table=ne(q.gfm.table).replace("hr",q.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",q._tag).getRegex(),q.pedantic=fe({},q.normal,{html:ne(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",q._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:ae,paragraph:ne(q.normal._paragraph).replace("hr",q.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",q.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var M={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:ae,tag:"^comment|^</[a-zA-Z][\\w:-]*\\s*>|^<[a-zA-Z][\\w-]*(?:attribute)*?\\s*/?>|^<\\?[\\s\\S]*?\\?>|^<![a-zA-Z]+\\s[\\s\\S]*?>|^<!\\[CDATA\\[[\\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:ae,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};M._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",M.punctuation=ne(M.punctuation).replace(/punctuation/g,M._punctuation).getRegex(),M._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",M._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",M.em.start=ne(M.em.start).replace(/punctuation/g,M._punctuation).getRegex(),M.em.middle=ne(M.em.middle).replace(/punctuation/g,M._punctuation).replace(/overlapSkip/g,M._overlapSkip).getRegex(),M.em.endAst=ne(M.em.endAst,"g").replace(/punctuation/g,M._punctuation).getRegex(),M.em.endUnd=ne(M.em.endUnd,"g").replace(/punctuation/g,M._punctuation).getRegex(),M.strong.start=ne(M.strong.start).replace(/punctuation/g,M._punctuation).getRegex(),M.strong.middle=ne(M.strong.middle).replace(/punctuation/g,M._punctuation).replace(/blockSkip/g,M._blockSkip).getRegex(),M.strong.endAst=ne(M.strong.endAst,"g").replace(/punctuation/g,M._punctuation).getRegex(),M.strong.endUnd=ne(M.strong.endUnd,"g").replace(/punctuation/g,M._punctuation).getRegex(),M.blockSkip=ne(M._blockSkip,"g").getRegex(),M.overlapSkip=ne(M._overlapSkip,"g").getRegex(),M._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,M._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,M._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])?)+(?![-_])/,M.autolink=ne(M.autolink).replace("scheme",M._scheme).replace("email",M._email).getRegex(),M._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,M.tag=ne(M.tag).replace("comment",q._comment).replace("attribute",M._attribute).getRegex(),M._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,M._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,M._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,M.link=ne(M.link).replace("label",M._label).replace("href",M._href).replace("title",M._title).getRegex(),M.reflink=ne(M.reflink).replace("label",M._label).getRegex(),M.reflinkSearch=ne(M.reflinkSearch,"g").replace("reflink",M.reflink).replace("nolink",M.nolink).getRegex(),M.normal=fe({},M),M.pedantic=fe({},M.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:ne(/^!?\[(label)\]\((.*?)\)/).replace("label",M._label).getRegex(),reflink:ne(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",M._label).getRegex()}),M.gfm=fe({},M.normal,{escape:ne(M.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]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),M.gfm.url=ne(M.gfm.url,"i").replace("email",M.gfm._extended_email).getRegex(),M.breaks=fe({},M.gfm,{br:ne(M.br).replace("{2,}","*").getRegex(),text:ne(M.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var S={block:q,inline:M},A=j.defaults,F=S.block,K=S.inline;function P(G){return G.replace(/---/g,"\u2014").replace(/--/g,"\u2013").replace(/(^|[-\u2014/(\[{"\s])'/g,"$1\u2018").replace(/'/g,"\u2019").replace(/(^|[-\u2014/(\[{\u2018\s])"/g,"$1\u201C").replace(/"/g,"\u201D").replace(/\.{3}/g,"\u2026")}function re(G){var X="",ee,Y,$=G.length;for(ee=0;ee<$;ee++)Y=G.charCodeAt(ee),Math.random()>.5&&(Y="x"+Y.toString(16)),X+="&#"+Y+";";return X}var he=function(){function G(ee){this.tokens=[],this.tokens.links=Object.create(null),this.options=ee||A,this.options.tokenizer=this.options.tokenizer||new pe,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var Y={block:F.normal,inline:K.normal};this.options.pedantic?(Y.block=F.pedantic,Y.inline=K.pedantic):this.options.gfm&&(Y.block=F.gfm,this.options.breaks?Y.inline=K.breaks:Y.inline=K.gfm),this.tokenizer.rules=Y}G.lex=function(Y,$){var te=new G($);return te.lex(Y)};var X=G.prototype;return X.lex=function(Y){return Y=Y.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(Y,this.tokens,!0),this.inline(this.tokens),this.tokens},X.blockTokens=function(Y,$,te){$===void 0&&($=[]),te===void 0&&(te=!0),Y=Y.replace(/^ +$/gm,"");for(var ie,be,ve,Oe;Y;){if(ie=this.tokenizer.space(Y)){Y=Y.substring(ie.raw.length),ie.type&&$.push(ie);continue}if(ie=this.tokenizer.code(Y,$)){Y=Y.substring(ie.raw.length),ie.type?$.push(ie):(Oe=$[$.length-1],Oe.raw+=`
`+ie.raw,Oe.text+=`
`+ie.text);continue}if(ie=this.tokenizer.fences(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(ie=this.tokenizer.heading(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(ie=this.tokenizer.nptable(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(ie=this.tokenizer.hr(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(ie=this.tokenizer.blockquote(Y)){Y=Y.substring(ie.raw.length),ie.tokens=this.blockTokens(ie.text,[],te),$.push(ie);continue}if(ie=this.tokenizer.list(Y)){for(Y=Y.substring(ie.raw.length),ve=ie.items.length,be=0;be<ve;be++)ie.items[be].tokens=this.blockTokens(ie.items[be].text,[],!1);$.push(ie);continue}if(ie=this.tokenizer.html(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(te&&(ie=this.tokenizer.def(Y))){Y=Y.substring(ie.raw.length),this.tokens.links[ie.tag]||(this.tokens.links[ie.tag]={href:ie.href,title:ie.title});continue}if(ie=this.tokenizer.table(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(ie=this.tokenizer.lheading(Y)){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(te&&(ie=this.tokenizer.paragraph(Y))){Y=Y.substring(ie.raw.length),$.push(ie);continue}if(ie=this.tokenizer.text(Y,$)){Y=Y.substring(ie.raw.length),ie.type?$.push(ie):(Oe=$[$.length-1],Oe.raw+=`
`+ie.raw,Oe.text+=`
`+ie.text);continue}if(Y){var Le="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(Le);break}else throw new Error(Le)}}return $},X.inline=function(Y){var $,te,ie,be,ve,Oe,Le=Y.length;for($=0;$<Le;$++){Oe=Y[$];switch(Oe.type){case"paragraph":case"text":case"heading":{Oe.tokens=[],this.inlineTokens(Oe.text,Oe.tokens);break}case"table":{for(Oe.tokens={header:[],cells:[]},be=Oe.header.length,te=0;te<be;te++)Oe.tokens.header[te]=[],this.inlineTokens(Oe.header[te],Oe.tokens.header[te]);for(be=Oe.cells.length,te=0;te<be;te++)for(ve=Oe.cells[te],Oe.tokens.cells[te]=[],ie=0;ie<ve.length;ie++)Oe.tokens.cells[te][ie]=[],this.inlineTokens(ve[ie],Oe.tokens.cells[te][ie]);break}case"blockquote":{this.inline(Oe.tokens);break}case"list":{for(be=Oe.items.length,te=0;te<be;te++)this.inline(Oe.items[te].tokens);break}}}return Y},X.inlineTokens=function(Y,$,te,ie,be){$===void 0&&($=[]),te===void 0&&(te=!1),ie===void 0&&(ie=!1),be===void 0&&(be="");var ve,Oe=Y,Le;if(this.tokens.links){var Pe=Object.keys(this.tokens.links);if(Pe.length>0)for(;(Le=this.tokenizer.rules.inline.reflinkSearch.exec(Oe))!=null;)Pe.includes(Le[0].slice(Le[0].lastIndexOf("[")+1,-1))&&(Oe=Oe.slice(0,Le.index)+"["+"a".repeat(Le[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Le=this.tokenizer.rules.inline.blockSkip.exec(Oe))!=null;)Oe=Oe.slice(0,Le.index)+"["+"a".repeat(Le[0].length-2)+"]"+Oe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;Y;){if(ve=this.tokenizer.escape(Y)){Y=Y.substring(ve.raw.length),$.push(ve);continue}if(ve=this.tokenizer.tag(Y,te,ie)){Y=Y.substring(ve.raw.length),te=ve.inLink,ie=ve.inRawBlock,$.push(ve);continue}if(ve=this.tokenizer.link(Y)){Y=Y.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,ie)),$.push(ve);continue}if(ve=this.tokenizer.reflink(Y,this.tokens.links)){Y=Y.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,ie)),$.push(ve);continue}if(ve=this.tokenizer.strong(Y,Oe,be)){Y=Y.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],te,ie),$.push(ve);continue}if(ve=this.tokenizer.em(Y,Oe,be)){Y=Y.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],te,ie),$.push(ve);continue}if(ve=this.tokenizer.codespan(Y)){Y=Y.substring(ve.raw.length),$.push(ve);continue}if(ve=this.tokenizer.br(Y)){Y=Y.substring(ve.raw.length),$.push(ve);continue}if(ve=this.tokenizer.del(Y)){Y=Y.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],te,ie),$.push(ve);continue}if(ve=this.tokenizer.autolink(Y,re)){Y=Y.substring(ve.raw.length),$.push(ve);continue}if(!te&&(ve=this.tokenizer.url(Y,re))){Y=Y.substring(ve.raw.length),$.push(ve);continue}if(ve=this.tokenizer.inlineText(Y,ie,P)){Y=Y.substring(ve.raw.length),be=ve.raw.slice(-1),$.push(ve);continue}if(Y){var ke="Infinite loop on byte: "+Y.charCodeAt(0);if(this.options.silent){console.error(ke);break}else throw new Error(ke)}}return $},B(G,null,[{key:"rules",get:function(){return{block:F,inline:K}}}]),G}(),ye=j.defaults,J=k.cleanUrl,se=k.escape,me=function(){function G(ee){this.options=ee||ye}var X=G.prototype;return X.code=function(Y,$,te){var ie=($||"").match(/\S*/)[0];if(this.options.highlight){var be=this.options.highlight(Y,ie);be!=null&&be!==Y&&(te=!0,Y=be)}return ie?'<pre><code class="'+this.options.langPrefix+se(ie,!0)+'">'+(te?Y:se(Y,!0))+`</code></pre>
`:"<pre><code>"+(te?Y:se(Y,!0))+`</code></pre>
`},X.blockquote=function(Y){return`<blockquote>
`+Y+`</blockquote>
`},X.html=function(Y){return Y},X.heading=function(Y,$,te,ie){return this.options.headerIds?"<h"+$+' id="'+this.options.headerPrefix+ie.slug(te)+'">'+Y+"</h"+$+`>
`:"<h"+$+">"+Y+"</h"+$+`>
`},X.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},X.list=function(Y,$,te){var ie=$?"ol":"ul",be=$&&te!==1?' start="'+te+'"':"";return"<"+ie+be+`>
`+Y+"</"+ie+`>
`},X.listitem=function(Y){return"<li>"+Y+`</li>
`},X.checkbox=function(Y){return"<input "+(Y?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},X.paragraph=function(Y){return"<p>"+Y+`</p>
`},X.table=function(Y,$){return $&&($="<tbody>"+$+"</tbody>"),`<table>
<thead>
`+Y+`</thead>
`+$+`</table>
`},X.tablerow=function(Y){return`<tr>
`+Y+`</tr>
`},X.tablecell=function(Y,$){var te=$.header?"th":"td",ie=$.align?"<"+te+' align="'+$.align+'">':"<"+te+">";return ie+Y+"</"+te+`>
`},X.strong=function(Y){return"<strong>"+Y+"</strong>"},X.em=function(Y){return"<em>"+Y+"</em>"},X.codespan=function(Y){return"<code>"+Y+"</code>"},X.br=function(){return this.options.xhtml?"<br/>":"<br>"},X.del=function(Y){return"<del>"+Y+"</del>"},X.link=function(Y,$,te){if(Y=J(this.options.sanitize,this.options.baseUrl,Y),Y===null)return te;var ie='<a href="'+se(Y)+'"';return $&&(ie+=' title="'+$+'"'),ie+=">"+te+"</a>",ie},X.image=function(Y,$,te){if(Y=J(this.options.sanitize,this.options.baseUrl,Y),Y===null)return te;var ie='<img src="'+Y+'" alt="'+te+'"';return $&&(ie+=' title="'+$+'"'),ie+=this.options.xhtml?"/>":">",ie},X.text=function(Y){return Y},G}(),_e=function(){function G(){}var X=G.prototype;return X.strong=function(Y){return Y},X.em=function(Y){return Y},X.codespan=function(Y){return Y},X.del=function(Y){return Y},X.html=function(Y){return Y},X.text=function(Y){return Y},X.link=function(Y,$,te){return""+te},X.image=function(Y,$,te){return""+te},X.br=function(){return""},G}(),Ce=function(){function G(){this.seen={}}var X=G.prototype;return X.slug=function(Y){var $=Y.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty($)){var te=$;do this.seen[te]++,$=te+"-"+this.seen[te];while(this.seen.hasOwnProperty($))}return this.seen[$]=0,$},G}(),de=j.defaults,Ee=k.unescape,Te=function(){function G(ee){this.options=ee||de,this.options.renderer=this.options.renderer||new me,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new _e,this.slugger=new Ce}G.parse=function(Y,$){var te=new G($);return te.parse(Y)};var X=G.prototype;return X.parse=function(Y,$){$===void 0&&($=!0);var te="",ie,be,ve,Oe,Le,Pe,ke,Ge,Ke,Ue,it,$e,rt,qe,Ye,nt,at,et,ut=Y.length;for(ie=0;ie<ut;ie++){Ue=Y[ie];switch(Ue.type){case"space":continue;case"hr":{te+=this.renderer.hr();continue}case"heading":{te+=this.renderer.heading(this.parseInline(Ue.tokens),Ue.depth,Ee(this.parseInline(Ue.tokens,this.textRenderer)),this.slugger);continue}case"code":{te+=this.renderer.code(Ue.text,Ue.lang,Ue.escaped);continue}case"table":{for(Ge="",ke="",Oe=Ue.header.length,be=0;be<Oe;be++)ke+=this.renderer.tablecell(this.parseInline(Ue.tokens.header[be]),{header:!0,align:Ue.align[be]});for(Ge+=this.renderer.tablerow(ke),Ke="",Oe=Ue.cells.length,be=0;be<Oe;be++){for(Pe=Ue.tokens.cells[be],ke="",Le=Pe.length,ve=0;ve<Le;ve++)ke+=this.renderer.tablecell(this.parseInline(Pe[ve]),{header:!1,align:Ue.align[ve]});Ke+=this.renderer.tablerow(ke)}te+=this.renderer.table(Ge,Ke);continue}case"blockquote":{Ke=this.parse(Ue.tokens),te+=this.renderer.blockquote(Ke);continue}case"list":{for(it=Ue.ordered,$e=Ue.start,rt=Ue.loose,Oe=Ue.items.length,Ke="",be=0;be<Oe;be++)Ye=Ue.items[be],nt=Ye.checked,at=Ye.task,qe="",Ye.task&&(et=this.renderer.checkbox(nt),rt?Ye.tokens.length>0&&Ye.tokens[0].type==="text"?(Ye.tokens[0].text=et+" "+Ye.tokens[0].text,Ye.tokens[0].tokens&&Ye.tokens[0].tokens.length>0&&Ye.tokens[0].tokens[0].type==="text"&&(Ye.tokens[0].tokens[0].text=et+" "+Ye.tokens[0].tokens[0].text)):Ye.tokens.unshift({type:"text",text:et}):qe+=et),qe+=this.parse(Ye.tokens,rt),Ke+=this.renderer.listitem(qe,at,nt);te+=this.renderer.list(Ke,it,$e);continue}case"html":{te+=this.renderer.html(Ue.text);continue}case"paragraph":{te+=this.renderer.paragraph(this.parseInline(Ue.tokens));continue}case"text":{for(Ke=Ue.tokens?this.parseInline(Ue.tokens):Ue.text;ie+1<ut&&Y[ie+1].type==="text";)Ue=Y[++ie],Ke+=`
`+(Ue.tokens?this.parseInline(Ue.tokens):Ue.text);te+=$?this.renderer.paragraph(Ke):Ke;continue}default:{var Me='Token with "'+Ue.type+'" type was not found.';if(this.options.silent){console.error(Me);return}else throw new Error(Me)}}}return te},X.parseInline=function(Y,$){$=$||this.renderer;var te="",ie,be,ve=Y.length;for(ie=0;ie<ve;ie++){be=Y[ie];switch(be.type){case"escape":{te+=$.text(be.text);break}case"html":{te+=$.html(be.text);break}case"link":{te+=$.link(be.href,be.title,this.parseInline(be.tokens,$));break}case"image":{te+=$.image(be.href,be.title,be.text);break}case"strong":{te+=$.strong(this.parseInline(be.tokens,$));break}case"em":{te+=$.em(this.parseInline(be.tokens,$));break}case"codespan":{te+=$.codespan(be.text);break}case"br":{te+=$.br();break}case"del":{te+=$.del(this.parseInline(be.tokens,$));break}case"text":{te+=$.text(be.text);break}default:{var Oe='Token with "'+be.type+'" type was not found.';if(this.options.silent){console.error(Oe);return}else throw new Error(Oe)}}}return te},G}(),Se=k.merge,we=k.checkSanitizeDeprecation,Ae=k.escape,xe=j.getDefaults,Re=j.changeDefaults,Ie=j.defaults;function Q(G,X,ee){if(typeof G=="undefined"||G===null)throw new Error("marked(): input parameter is undefined or null");if(typeof G!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(G)+", string expected");if(typeof X=="function"&&(ee=X,X=null),X=Se({},Q.defaults,X||{}),we(X),ee){var Y=X.highlight,$;try{$=he.lex(G,X)}catch(ve){return ee(ve)}var te=function(Oe){var Le;if(!Oe)try{Le=Te.parse($,X)}catch(Pe){Oe=Pe}return X.highlight=Y,Oe?ee(Oe):ee(null,Le)};if(!Y||Y.length<3)return te();if(delete X.highlight,!$.length)return te();var ie=0;Q.walkTokens($,function(ve){ve.type==="code"&&(ie++,setTimeout(function(){Y(ve.text,ve.lang,function(Oe,Le){if(Oe)return te(Oe);Le!=null&&Le!==ve.text&&(ve.text=Le,ve.escaped=!0),ie--,ie===0&&te()})},0))}),ie===0&&te();return}try{var be=he.lex(G,X);return X.walkTokens&&Q.walkTokens(be,X.walkTokens),Te.parse(be,X)}catch(ve){if(ve.message+=`
Please report this to https://github.com/markedjs/marked.`,X.silent)return"<p>An error occurred:</p><pre>"+Ae(ve.message+"",!0)+"</pre>";throw ve}}Q.options=Q.setOptions=function(G){return Se(Q.defaults,G),Re(Q.defaults),Q},Q.getDefaults=xe,Q.defaults=Ie,Q.use=function(G){var X=Se({},G);if(G.renderer&&function(){var Y=Q.defaults.renderer||new me,$=function(be){var ve=Y[be];Y[be]=function(){for(var Oe=arguments.length,Le=new Array(Oe),Pe=0;Pe<Oe;Pe++)Le[Pe]=arguments[Pe];var ke=G.renderer[be].apply(Y,Le);return ke===!1&&(ke=ve.apply(Y,Le)),ke}};for(var te in G.renderer)$(te);X.renderer=Y}(),G.tokenizer&&function(){var Y=Q.defaults.tokenizer||new pe,$=function(be){var ve=Y[be];Y[be]=function(){for(var Oe=arguments.length,Le=new Array(Oe),Pe=0;Pe<Oe;Pe++)Le[Pe]=arguments[Pe];var ke=G.tokenizer[be].apply(Y,Le);return ke===!1&&(ke=ve.apply(Y,Le)),ke}};for(var te in G.tokenizer)$(te);X.tokenizer=Y}(),G.walkTokens){var ee=Q.defaults.walkTokens;X.walkTokens=function(Y){G.walkTokens(Y),ee&&ee(Y)}}Q.setOptions(X)},Q.walkTokens=function(G,X){for(var ee=I(G),Y;!(Y=ee()).done;){var $=Y.value;X($);switch($.type){case"table":{for(var te=I($.tokens.header),ie;!(ie=te()).done;){var be=ie.value;Q.walkTokens(be,X)}for(var ve=I($.tokens.cells),Oe;!(Oe=ve()).done;)for(var Le=Oe.value,Pe=I(Le),ke;!(ke=Pe()).done;){var Ge=ke.value;Q.walkTokens(Ge,X)}break}case"list":{Q.walkTokens($.items,X);break}default:$.tokens&&Q.walkTokens($.tokens,X)}}},Q.Parser=Te,Q.parser=Te.parse,Q.Renderer=me,Q.TextRenderer=_e,Q.Lexer=he,Q.lexer=he.lex,Q.Tokenizer=pe,Q.Slugger=Ce,Q.parse=Q;var W=Q;return W})},Etsf:function(Fe,ce,z){"use strict";z.r(ce);var oe=z("5Dmo"),B=z("3S7+"),O=z("14J3"),H=z("BMrR"),I=z("jCWc"),C=z("kPKH"),j=z("sPJy"),N=z("bE4q"),e=z("k1fw"),w=z("9og8"),g=z("y8nQ"),f=z("Vl3Y"),o=z("tJVT"),n=z("PpiC"),a=z("WmNS"),l=z.n(a),s=z("q1tI"),i=z.n(s),r=z("55Ip"),t=z("9kvl"),v=z("9Bee"),m=z("xKgJ"),p=z("U/Y8"),_=z.n(p),b=z("Q9mQ"),u=z("diRs"),h=z("miYZ"),c=z("tsqr"),d=z("2qtc"),E=z("kLXV"),y=z("oBTY"),T=z("ozfa"),D=z("MJZm"),L=z("5NDa"),x=z("5rEg"),k=z("jrin"),U=z("nRaC"),R=z("5RzL"),V=z("ErOA"),Z=z("Ty5D"),ue=R.a.TreeNode,le=function(ye){var J=ye.restful,se=ye.loading,me=ye.dispatch,_e=Object(Z.i)(),Ce=Object(Z.h)(),de=Object(s.useState)(!1),Ee=Object(o.a)(de,2),Te=Ee[0],Se=Ee[1],we=Object(s.useState)(),Ae=Object(o.a)(we,2),xe=Ae[0],Re=Ae[1],Ie=J.actionTabs,Q=f.a.useForm(),W=Object(o.a)(Q,1),G=W[0];return Object(s.useEffect)(function(){J.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&G.resetFields()},[J.actionTabs.key]),J.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:i.a.createElement(E.a,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",visible:J.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:Te,onOk:Object(w.a)(l.a.mark(function X(){var ee,Y,$;return l.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,G.validateFields();case 2:return ee=G.getFieldValue(),Se(!0),Y="/api/restfuls.json",ie.next=7,Object(V.a)(Y,{method:"post",body:Object(e.a)({file_type:1},ee)});case 7:$=ie.sent,$.status===0&&(c.b.success("\u6DFB\u52A0\u6210\u529F"),me({type:"restful/setActionTabs",payload:{}}),me({type:"restful/getRestful"})),Se(!1);case 10:case"end":return ie.stop()}},X)})),onCancel:function(){me({type:"restful/setActionTabs",payload:{}})}},i.a.createElement("div",{className:"pl30 pr30"},i.a.createElement(f.a,{form:G,initialValues:Object(k.a)({},"name","")},i.a.createElement(f.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},i.a.createElement(H.a,{className:"mt30"},i.a.createElement(C.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),i.a.createElement(C.a,{flex:"1"},i.a.createElement(x.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},ge=Object(t.a)(function(he){var ye=he.restful,J=he.loading;return{restful:ye,loading:J}})(le),pe=R.a.TreeNode,ae=function(ye){var J=ye.restful,se=ye.loading,me=ye.dispatch,_e=Object(Z.i)(),Ce=Object(Z.h)(),de=Object(s.useState)(!1),Ee=Object(o.a)(de,2),Te=Ee[0],Se=Ee[1],we=Object(s.useState)(),Ae=Object(o.a)(we,2),xe=Ae[0],Re=Ae[1],Ie=J.actionTabs,Q=f.a.useForm(),W=Object(o.a)(Q,1),G=W[0];return Object(s.useEffect)(function(){J.actionTabs.key=="\u91CD\u547D\u540D"&&(G.resetFields(),G.setFieldsValue({name:J.actionTabs.data.title}))},[J.actionTabs.key]),J.actionTabs.key!=="\u91CD\u547D\u540D"?null:i.a.createElement(E.a,{centered:!0,title:"\u91CD\u547D\u540D",visible:J.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:Te,onOk:Object(w.a)(l.a.mark(function X(){var ee,Y,$;return l.a.wrap(function(ie){for(;;)switch(ie.prev=ie.next){case 0:return ie.next=2,G.validateFields();case 2:return ee=G.getFieldValue(),Se(!0),Y="/api/restfuls/".concat(J.actionTabs.data.id,".json"),ie.next=7,Object(V.a)(Y,{method:"put",body:Object(e.a)({file_type:1},ee)});case 7:$=ie.sent,$.status===0&&(c.b.success("\u4FEE\u6539\u6210\u529F"),me({type:"restful/setActionTabs",payload:{}}),me({type:"restful/getRestful"})),Se(!1);case 10:case"end":return ie.stop()}},X)})),onCancel:function(){me({type:"restful/setActionTabs",payload:{}})}},i.a.createElement("div",{className:"pl30 pr30"},i.a.createElement(f.a,{form:G,initialValues:Object(k.a)({},"name","")},i.a.createElement(H.a,{className:"mt30"},i.a.createElement(C.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),i.a.createElement(C.a,{flex:"1"},i.a.createElement(f.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},i.a.createElement(x.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},ne=Object(t.a)(function(he){var ye=he.restful,J=he.loading;return{restful:ye,loading:J}})(ae),fe=z("s7vb"),q=z("P48q"),M=z.n(q),S=x.a.Search,A=D.a.DirectoryTree,F=function(ye){var J=ye.user,se=ye.globalSetting,me=ye.loading,_e=ye.dispatch,Ce=ye.restful,de=Object(n.a)(ye,["user","globalSetting","loading","dispatch","restful"]),Ee=Object(s.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),Te=Object(o.a)(Ee,2),Se=Te[0],we=Te[1],Ae=Object(s.useState)(!0),xe=Object(o.a)(Ae,2),Re=xe[0],Ie=xe[1],Q=f.a.useForm(),W=Object(o.a)(Q,1),G=W[0],X=Object(s.useState)(""),ee=Object(o.a)(X,2),Y=ee[0],$=ee[1],te=Object(s.useState)([{id:1,name:"\u65B0\u5EFA\u6587\u4EF6"},{id:2,name:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"},{id:3,name:"\u91CD\u547D\u540D"},{id:4,name:"\u7F16\u8F91"},{id:5,name:"\u5220\u9664"}]),ie=Object(o.a)(te,1),be=ie[0],ve=Object(s.useState)([]),Oe=Object(o.a)(ve,2),Le=Oe[0],Pe=Oe[1],ke=Object(s.useState)([]),Ge=Object(o.a)(ke,2),Ke=Ge[0],Ue=Ge[1],it=Object(s.useState)(!1),$e=Object(o.a)(it,2),rt=$e[0],qe=$e[1],Ye=Object(s.useState)([]),nt=Object(o.a)(Ye,2),at=nt[0],et=nt[1];Object(s.useEffect)(function(){var tt;if((tt=Ce.restful)!==null&&tt!==void 0&&tt.data){var We,De,He;et(Object(y.a)((We=Ce.restful)===null||We===void 0?void 0:We.data));var Ne=0,Ve;if((De=Ce.restful)===null||De===void 0||((He=De.data)===null||He===void 0)||He.map(function(je){var Ze;je.id==de.match.params.id&&(Ne=je.id),je.file_type==0&&!Ve&&(Ve=je.id),je==null||((Ze=je.children)===null||Ze===void 0)||Ze.map(function(Qe){Ve||(Ve=Qe.id),Qe.id==de.match.params.id&&(Ne=je.id)}),!je.children&&!Ve&&(Ve=je.id)}),!de.match.params.id&&Ve){de.history.push("/ch/rest/".concat(Ve));return}Ne&&setTimeout(function(){Pe([Ne]),Ue([Number(de.match.params.id||Ve)])},200)}},[Ce.restful]);var ut=function(We,De){De.node.file_type===0?de.history.push("/ch/rest/".concat(We[0])):Ue(Object(y.a)(We)),console.log("Trigger Select",We,De)},Me=function(We){Pe(We),console.log("Trigger Expand",We)},Be=function(We){return i.a.createElement("div",null,be.map(function(De,He){return i.a.createElement("p",{key:De.id,className:"current",onClick:function(){switch(De.id){case 1:de.history.push("/ch/rest/edit/".concat(We.id,"/0"));break;case 2:case 3:_e({type:"restful/setActionTabs",payload:{key:De.name,data:We}});break;case 4:document.location.href="/ch/rest/edit/".concat(We.pid||0,"/").concat(We.id);break;case 5:E.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:function(){var Ve=Object(w.a)(l.a.mark(function Ze(){var Qe;return l.a.wrap(function(vt){for(;;)switch(vt.prev=vt.next){case 0:return vt.next=2,Object(fe.a)({id:We.id});case 2:Qe=vt.sent,(Qe==null?void 0:Qe.status)==0&&(c.b.success("\u5220\u9664\u6210\u529F"),_e({type:"restful/getRestful"}));case 4:case"end":return vt.stop()}},Ze)}));function je(){return Ve.apply(this,arguments)}return je}()});break}}},De.name)}).filter(function(De){return!!De}).filter(function(De){return We.pid||We.file_type==0?De.key>3:De.key!=4}))},ze=function tt(We){return We.map(function(De){var He=De.title.indexOf(Y),Ne=De.title.substr(0,He),Ve=De.title.substr(He+Y.length),je=i.a.createElement("span",null,Ne,i.a.createElement("span",{className:"c-blue"},Y),Ve,Object(m.o)()&&i.a.createElement(u.a,{placement:"right",title:Y,content:function(){return Be(De)},trigger:"hover"},i.a.createElement("span",{className:"iconfont icon-sandian ".concat(M.a.actions)})));if(Y!==""){var Ze;if(He===-1&&!((Ze=De.children)!==null&&Ze!==void 0&&Ze.length))return null}return De.children&&De.file_type===1?Object(e.a)(Object(e.a)({},De),{},{title:je,key:De.key,children:tt(De.children)}):Object(e.a)(Object(e.a)({},De),{},{title:je,key:De.key,isLeaf:!0})}).filter(function(De){return!!De})},Je=function tt(We,De){for(var He,Ne=0;Ne<De.length;Ne++){var Ve=De[Ne];Ve.children&&(Ve.children.some(function(je){return je.key===We})?He=Ve.key:tt(We,Ve.children)&&(He=tt(We,Ve.children)))}return He},st=function(We){var De=We.target.value,He=at.map(function(Ne){if(Ne!=null&&Ne.children){var Ve;return Ne!=null&&(Ve=Ne.children.filter(function(je){return je.title.indexOf(De)>-1}))!==null&&Ve!==void 0&&Ve.length?Ne.id:null}return null});$(De),qe(!0),console.log("expandedKeys:",He),Pe(He)};return console.log("loop(treeData):",ze(at)),i.a.createElement("div",{className:M.a.tree},i.a.createElement(S,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:st}),i.a.createElement(A,{multiple:!0,defaultExpandAll:!0,onSelect:ut,onExpand:Me,expandedKeys:Le,selectedKeys:Ke,autoExpandParent:rt,treeData:ze(at)}),i.a.createElement(ge,null),i.a.createElement(ne,null))},K=Object(t.a)(function(he){var ye=he.user,J=he.loading,se=he.globalSetting,me=he.restful;return{user:ye,globalSetting:se,restful:me,loading:J.models.index}})(F),P=function(ye){var J,se,me=ye.user,_e=ye.globalSetting,Ce=ye.loading,de=ye.dispatch,Ee=ye.restful,Te=Object(n.a)(ye,["user","globalSetting","loading","dispatch","restful"]),Se=Object(s.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),we=Object(o.a)(Se,2),Ae=we[0],xe=we[1],Re=Object(s.useState)(!0),Ie=Object(o.a)(Re,2),Q=Ie[0],W=Ie[1],G=f.a.useForm(),X=Object(o.a)(G,1),ee=X[0],Y=Te.match.params,$=function(){var be=Object(w.a)(l.a.mark(function ve(){return l.a.wrap(function(Le){for(;;)switch(Le.prev=Le.next){case 0:de({type:"restful/getRestful"}),Y.id&&de({type:"restful/getRestfulDetail",payload:Object(e.a)({},Y)});case 2:case"end":return Le.stop()}},ve)}));return function(){return be.apply(this,arguments)}}();Object(s.useEffect)(function(){W(!0),$()},[Y.id]);var te=function(){de({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},ie=function(){var ve;if((ve=Ee.restful)!==null&&ve!==void 0&&ve.data){var Oe,Le,Pe=0;return(Oe=Ee.restful)===null||Oe===void 0||((Le=Oe.data)===null||Le===void 0)||Le.map(function(ke){var Ge;ke==null||((Ge=ke.children)===null||Ge===void 0)||Ge.map(function(Ke){Ke.id==Te.match.params.id&&(Pe=ke.id)}),!ke.children&&!Pe&&(Pe=ke.id)}),Pe}return 0};return i.a.createElement("section",null,i.a.createElement("aside",{className:"edu-container mt20"},i.a.createElement(N.a,null,i.a.createElement(N.a.Item,null,i.a.createElement(r.a,{to:"/"},"\u9996\u9875")),i.a.createElement(N.a.Item,null,i.a.createElement(r.a,{to:"/ch/rest"},"API\u6587\u6863"))),i.a.createElement("div",{className:"mt20"},i.a.createElement(H.a,{gutter:[20,20]},i.a.createElement(C.a,{flex:"300px"},i.a.createElement(K,Te)),i.a.createElement(C.a,{flex:"1"},i.a.createElement("div",{className:_.a.info},i.a.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(J=Ee.restfulDetail)===null||J===void 0?void 0:J.name),i.a.createElement(v.a,{value:(se=Ee.restfulDetail)===null||se===void 0?void 0:se.description}))))),Object(m.o)()&&i.a.createElement("div",{className:_.a.bar},i.a.createElement(H.a,null,!!ie()&&i.a.createElement(C.a,null,i.a.createElement(B.a,{title:"\u7F16\u8F91\u6587\u4EF6"},i.a.createElement(r.a,{to:"/ch/rest/edit/".concat(ie(),"/").concat(Te.match.params.id),className:"icon-zhongmingming current"}))),i.a.createElement(C.a,null,i.a.createElement(B.a,{title:"\u6DFB\u52A0\u6587\u4EF6"},i.a.createElement(r.a,{to:"/ch/rest/edit/".concat(ie(),"/0"),className:"icon-tianjiatimu current"}))),i.a.createElement(C.a,null,i.a.createElement(B.a,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},i.a.createElement("span",{className:"icon-wenjianjia1 current",onClick:te})))))))},re=ce.default=Object(t.a)(function(he){var ye=he.user,J=he.loading,se=he.globalSetting,me=he.restful;return{user:ye,globalSetting:se,restful:me,loading:J.models.index}})(P)},FWmy:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return oe});function oe(B,O){if(!B)throw new Error(O?`Assertion failed (${O})`:"Assertion Failed")}},JYp7:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return oe});var oe;(function(B){function O(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}B.is=O;const H=Object.freeze([]);function I(){return H}B.empty=I;function*C(t){yield t}B.single=C;function j(t){return t||H}B.from=j;function N(t){return!t||t[Symbol.iterator]().next().done===!0}B.isEmpty=N;function e(t){return t[Symbol.iterator]().next().value}B.first=e;function w(t,v){for(const m of t)if(v(m))return!0;return!1}B.some=w;function g(t,v){for(const m of t)if(v(m))return m;return}B.find=g;function*f(t,v){for(const m of t)v(m)&&(yield m)}B.filter=f;function*o(t,v){let m=0;for(const p of t)yield v(p,m++)}B.map=o;function*n(...t){for(const v of t)for(const m of v)yield m}B.concat=n;function*a(t){for(const v of t)for(const m of v)yield m}B.concatNested=a;function l(t,v,m){let p=m;for(const _ of t)p=v(p,_);return p}B.reduce=l;function*s(t,v,m=t.length){for(v<0&&(v+=t.length),m<0?m+=t.length:m>t.length&&(m=t.length);v<m;v++)yield t[v]}B.slice=s;function i(t,v=Number.POSITIVE_INFINITY){const m=[];if(v===0)return[m,t];const p=t[Symbol.iterator]();for(let _=0;_<v;_++){const b=p.next();if(b.done)return[m,B.empty()];m.push(b.value)}return[m,{[Symbol.iterator](){return p}}]}B.consume=i;function r(t,v,m=(p,_)=>p===_){const p=t[Symbol.iterator](),_=v[Symbol.iterator]();for(;;){const b=p.next(),u=_.next();if(b.done!==u.done)return!1;if(b.done)return!0;if(!m(b.value,u.value))return!1}}B.equals=r})(oe||(oe={}))},MI8n:function(Fe,ce,z){"use strict";z.d(ce,"c",function(){return I}),z.d(ce,"b",function(){return e}),z.d(ce,"e",function(){return w}),z.d(ce,"a",function(){return g}),z.d(ce,"d",function(){return f}),z.d(ce,"f",function(){return o});var oe=z("/cxE"),B=z("pmY6"),O=z("24hK"),H=z("5Y4S"),I;(function(n){n.None=()=>B.a.None;function a(T){return(D,L=null,x)=>{let k=!1,U;return U=T(R=>k?void 0:(U?U.dispose():k=!0,D.call(L,R)),null,x),k&&U.dispose(),U}}n.once=a;function l(T,D){return m((L,x=null,k)=>T(U=>L.call(x,D(U)),null,k))}n.map=l;function s(T,D){return m((L,x=null,k)=>T(U=>{D(U),L.call(x,U)},null,k))}n.forEach=s;function i(T,D){return m((L,x=null,k)=>T(U=>D(U)&&L.call(x,U),null,k))}n.filter=i;function r(T){return T}n.signal=r;function t(...T){return(D,L=null,x)=>Object(B.e)(...T.map(k=>k(U=>D.call(L,U),null,x)))}n.any=t;function v(T,D,L){let x=L;return l(T,k=>(x=D(x,k),x))}n.reduce=v;function m(T){let D;const L=new e({onFirstListenerAdd(){D=T(L.fire,L)},onLastListenerRemove(){D.dispose()}});return L.event}function p(T,D,L=100,x=!1,k){let U,R,V,Z=0;const ue=new e({leakWarningThreshold:k,onFirstListenerAdd(){U=T(le=>{Z++,R=D(R,le),x&&!V&&(ue.fire(R),R=void 0),clearTimeout(V),V=setTimeout(()=>{const ge=R;R=void 0,V=void 0,(!x||Z>1)&&ue.fire(ge),Z=0},L)})},onLastListenerRemove(){U.dispose()}});return ue.event}n.debounce=p;function _(T,D=(L,x)=>L===x){let L=!0,x;return i(T,k=>{const U=L||!D(k,x);return L=!1,x=k,U})}n.latch=_;function b(T,D){return[n.filter(T,D),n.filter(T,L=>!D(L))]}n.split=b;function u(T,D=!1,L=[]){let x=L.slice(),k=T(V=>{x?x.push(V):R.fire(V)});const U=()=>{x&&x.forEach(V=>R.fire(V)),x=null},R=new e({onFirstListenerAdd(){k||(k=T(V=>R.fire(V)))},onFirstListenerDidAdd(){x&&(D?setTimeout(U):U())},onLastListenerRemove(){k&&k.dispose(),k=null}});return R.event}n.buffer=u;class h{constructor(T){this.event=T}map(T){return new h(l(this.event,T))}forEach(T){return new h(s(this.event,T))}filter(T){return new h(i(this.event,T))}reduce(T,D){return new h(v(this.event,T,D))}latch(){return new h(_(this.event))}debounce(T,D=100,L=!1,x){return new h(p(this.event,T,D,L,x))}on(T,D,L){return this.event(T,D,L)}once(T,D,L){return a(this.event)(T,D,L)}}function c(T){return new h(T)}n.chain=c;function d(T,D,L=x=>x){const x=(...V)=>R.fire(L(...V)),k=()=>T.on(D,x),U=()=>T.removeListener(D,x),R=new e({onFirstListenerAdd:k,onLastListenerRemove:U});return R.event}n.fromNodeEventEmitter=d;function E(T,D,L=x=>x){const x=(...V)=>R.fire(L(...V)),k=()=>T.addEventListener(D,x),U=()=>T.removeEventListener(D,x),R=new e({onFirstListenerAdd:k,onLastListenerRemove:U});return R.event}n.fromDOMEventEmitter=E;function y(T){return new Promise(D=>a(T)(D))}n.toPromise=y})(I||(I={}));class C{constructor(n){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${n}_${C._idPool++}`}start(n){this._stopWatch=new H.a(!0),this._listenerCount=n}stop(){if(this._stopWatch){const n=this._stopWatch.elapsed();this._elapsedOverall+=n,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${n.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}C._idPool=0;let j=-1;class N{constructor(n,a=Math.random().toString(18).slice(2,5)){this.customThreshold=n,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(n){let a=j;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||n<a)return;this._stacks||(this._stacks=new Map);const l=new Error().stack.split(`
`).slice(3).join(`
`),s=this._stacks.get(l)||0;if(this._stacks.set(l,s+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let i,r=0;for(const[t,v]of this._stacks)(!i||r<v)&&(i=t,r=v);console.warn(`[${this.name}] potential listener LEAK detected, having ${n} listeners already. MOST frequent listener (${r}):`),console.warn(i)}return()=>{const i=this._stacks.get(l)||0;this._stacks.set(l,i-1)}}}class e{constructor(n){var a;this._disposed=!1,this._options=n,this._leakageMon=j>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((a=this._options)===null||a===void 0?void 0:a._profName)?new C(this._options._profName):void 0}get event(){return this._event||(this._event=(n,a,l)=>{var s;this._listeners||(this._listeners=new O.a);const i=this._listeners.isEmpty();i&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const r=this._listeners.push(a?[n,a]:n);i&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,n,a);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),v=Object(B.i)(()=>{if(t&&t(),!this._disposed&&(r(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return l instanceof B.b?l.add(v):Array.isArray(l)&&l.push(v),v}),this._event}fire(n){var a,l;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new O.a);for(let s of this._listeners)this._deliveryQueue.push([s,n]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,i]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,i):s[0].call(s[1],i)}catch(r){Object(oe.f)(r)}}(l=this._perfMon)===null||l===void 0||l.stop()}}dispose(){var n,a,l,s,i;this._disposed||(this._disposed=!0,(n=this._listeners)===null||n===void 0||n.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(s=(l=this._options)===null||l===void 0?void 0:l.onLastListenerRemove)===null||s===void 0||s.call(l),(i=this._leakageMon)===null||i===void 0||i.dispose())}}class w extends e{constructor(n){super(n);this._isPaused=0,this._eventQueue=new O.a,this._mergeFn=n==null?void 0:n.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const n=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(n))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(n){this._listeners&&(this._isPaused!==0?this._eventQueue.push(n):super.fire(n))}}class g extends w{constructor(n){var a;super(n);this._delay=(a=n.delay)!==null&&a!==void 0?a:100}fire(n){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(n)}}class f{constructor(){this.buffers=[]}wrapEvent(n){return(a,l,s)=>n(i=>{const r=this.buffers[this.buffers.length-1];r?r.push(()=>a.call(l,i)):a.call(l,i)},void 0,s)}bufferEvents(n){const a=[];this.buffers.push(a);const l=n();return this.buffers.pop(),a.forEach(s=>s()),l}}class o{constructor(){this.listening=!1,this.inputEvent=I.None,this.inputEventListener=B.a.None,this.emitter=new e({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(n){this.inputEvent=n,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=n(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Fe,ce,z){"use strict";(function(oe,B){z.d(ce,"b",function(){return l}),z.d(ce,"i",function(){return t}),z.d(ce,"f",function(){return v}),z.d(ce,"d",function(){return m}),z.d(ce,"g",function(){return p}),z.d(ce,"h",function(){return _}),z.d(ce,"c",function(){return b}),z.d(ce,"k",function(){return u}),z.d(ce,"j",function(){return h}),z.d(ce,"a",function(){return c}),z.d(ce,"e",function(){return y});var O;const H="en";let I=!1,C=!1,j=!1,N=!1,e=!1,w=!1,g=!1,f,o=H,n,a;const l=typeof self=="object"?self:typeof oe=="object"?oe:{};let s;typeof l.vscode!="undefined"&&typeof l.vscode.process!="undefined"?s=l.vscode.process:typeof B!="undefined"&&(s=B);const i=typeof((O=s==null?void 0:s.versions)===null||O===void 0?void 0:O.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!i)a=navigator.userAgent,I=a.indexOf("Windows")>=0,C=a.indexOf("Macintosh")>=0,g=(a.indexOf("Macintosh")>=0||a.indexOf("iPad")>=0||a.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,j=a.indexOf("Linux")>=0,w=!0,f=navigator.language,o=f;else if(typeof s=="object"){I=s.platform==="win32",C=s.platform==="darwin",j=s.platform==="linux",N=j&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,f=H,o=H;const T=s.env.VSCODE_NLS_CONFIG;if(T)try{const D=JSON.parse(T),L=D.availableLanguages["*"];f=D.locale,o=L||H,n=D._translationsConfigFile}catch(D){}e=!0}else console.error("Unable to resolve platform.");let r=0;C?r=1:I?r=3:j&&(r=2);const t=I,v=C,m=j,p=e,_=w,b=g,u=a,h=function(){if(l.setImmediate)return l.setImmediate.bind(l);if(typeof l.postMessage=="function"&&!l.importScripts){let L=[];l.addEventListener("message",k=>{if(k.data&&k.data.vscodeSetImmediateId)for(let U=0,R=L.length;U<R;U++){const V=L[U];if(V.id===k.data.vscodeSetImmediateId){L.splice(U,1),V.callback();return}}});let x=0;return k=>{const U=++x;L.push({id:U,callback:k}),l.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const D=Promise.resolve();return L=>D.then(L)}(),c=C||g?2:I?1:3;let d=!0,E=!1;function y(){if(!E){E=!0;const T=new Uint8Array(2);T[0]=1,T[1]=2;const D=new Uint16Array(T.buffer);d=D[0]===(2<<8)+1}return d}}).call(this,z("IyRk"),z("Q2Ig"))},N0LK:function(Fe,ce,z){"use strict";z.d(ce,"C",function(){return oe}),z.d(ce,"v",function(){return O}),z.d(ce,"s",function(){return H}),z.d(ce,"t",function(){return I}),z.d(ce,"U",function(){return C}),z.d(ce,"J",function(){return j}),z.d(ce,"O",function(){return N}),z.d(ce,"p",function(){return e}),z.d(ce,"T",function(){return w}),z.d(ce,"q",function(){return g}),z.d(ce,"N",function(){return f}),z.d(ce,"M",function(){return o}),z.d(ce,"Q",function(){return n}),z.d(ce,"u",function(){return a}),z.d(ce,"x",function(){return l}),z.d(ce,"I",function(){return s}),z.d(ce,"f",function(){return i}),z.d(ce,"h",function(){return r}),z.d(ce,"g",function(){return t}),z.d(ce,"i",function(){return v}),z.d(ce,"G",function(){return m}),z.d(ce,"H",function(){return p}),z.d(ce,"r",function(){return _}),z.d(ce,"R",function(){return b}),z.d(ce,"d",function(){return u}),z.d(ce,"e",function(){return h}),z.d(ce,"E",function(){return c}),z.d(ce,"F",function(){return d}),z.d(ce,"j",function(){return E}),z.d(ce,"z",function(){return y}),z.d(ce,"K",function(){return D}),z.d(ce,"L",function(){return L}),z.d(ce,"m",function(){return k}),z.d(ce,"k",function(){return R}),z.d(ce,"A",function(){return Z}),z.d(ce,"a",function(){return ue}),z.d(ce,"n",function(){return le}),z.d(ce,"l",function(){return ge}),z.d(ce,"D",function(){return pe}),z.d(ce,"B",function(){return ae}),z.d(ce,"b",function(){return ne}),z.d(ce,"S",function(){return fe}),z.d(ce,"o",function(){return q}),z.d(ce,"P",function(){return M}),z.d(ce,"w",function(){return S}),z.d(ce,"c",function(){return A}),z.d(ce,"y",function(){return P});function oe(J){return!J||typeof J!="string"?!0:J.trim().length===0}const B=/{(\d+)}/g;function O(J,...se){return se.length===0?J:J.replace(B,function(me,_e){const Ce=parseInt(_e,10);return isNaN(Ce)||Ce<0||Ce>=se.length?me:se[Ce]})}function H(J){return J.replace(/[<>&]/g,function(se){switch(se){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return se}})}function I(J){return J.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function C(J,se=" "){const me=j(J,se);return N(me,se)}function j(J,se){if(!J||!se)return J;const me=se.length;if(me===0||J.length===0)return J;let _e=0;for(;J.indexOf(se,_e)===_e;)_e=_e+me;return J.substring(_e)}function N(J,se){if(!J||!se)return J;const me=se.length,_e=J.length;if(me===0||_e===0)return J;let Ce=_e,de=-1;for(;!(de=J.lastIndexOf(se,Ce-1),de===-1||de+me!==Ce);){if(de===0)return"";Ce=de}return J.substring(0,Ce)}function e(J){return J.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function w(J){return J.replace(/\*/g,"")}function g(J,se,me={}){if(!J)throw new Error("Cannot create regex from empty string");se||(J=I(J)),me.wholeWord&&(/\B/.test(J.charAt(0))||(J="\\b"+J),/\B/.test(J.charAt(J.length-1))||(J=J+"\\b"));let _e="";return me.global&&(_e+="g"),me.matchCase||(_e+="i"),me.multiline&&(_e+="m"),me.unicode&&(_e+="u"),new RegExp(J,_e)}function f(J){if(J.source==="^"||J.source==="^$"||J.source==="$"||J.source==="^\\s*$")return!1;const se=J.exec("");return!!(se&&J.lastIndex===0)}function o(J){return(J.global?"g":"")+(J.ignoreCase?"i":"")+(J.multiline?"m":"")+(J.unicode?"u":"")}function n(J){return J.split(/\r\n|\r|\n/)}function a(J){for(let se=0,me=J.length;se<me;se++){const _e=J.charCodeAt(se);if(_e!==32&&_e!==9)return se}return-1}function l(J,se=0,me=J.length){for(let _e=se;_e<me;_e++){const Ce=J.charCodeAt(_e);if(Ce!==32&&Ce!==9)return J.substring(se,_e)}return J.substring(se,me)}function s(J,se=J.length-1){for(let me=se;me>=0;me--){const _e=J.charCodeAt(me);if(_e!==32&&_e!==9)return me}return-1}function i(J,se){return J<se?-1:J>se?1:0}function r(J,se,me=0,_e=J.length,Ce=0,de=se.length){for(;me<_e&&Ce<de;me++,Ce++){let Se=J.charCodeAt(me),we=se.charCodeAt(Ce);if(Se<we)return-1;if(Se>we)return 1}const Ee=_e-me,Te=de-Ce;return Ee<Te?-1:Ee>Te?1:0}function t(J,se){return v(J,se,0,J.length,0,se.length)}function v(J,se,me=0,_e=J.length,Ce=0,de=se.length){for(;me<_e&&Ce<de;me++,Ce++){let Se=J.charCodeAt(me),we=se.charCodeAt(Ce);if(Se===we)continue;if(Se>=128||we>=128)return r(J.toLowerCase(),se.toLowerCase(),me,_e,Ce,de);m(Se)&&(Se-=32),m(we)&&(we-=32);const Ae=Se-we;if(Ae===0)continue;return Ae}const Ee=_e-me,Te=de-Ce;return Ee<Te?-1:Ee>Te?1:0}function m(J){return J>=97&&J<=122}function p(J){return J>=65&&J<=90}function _(J,se){return J.length===se.length&&v(J,se)===0}function b(J,se){const me=se.length;return se.length>J.length?!1:v(J,se,0,me)===0}function u(J,se){let me,_e=Math.min(J.length,se.length);for(me=0;me<_e;me++)if(J.charCodeAt(me)!==se.charCodeAt(me))return me;return _e}function h(J,se){let me,_e=Math.min(J.length,se.length);const Ce=J.length-1,de=se.length-1;for(me=0;me<_e;me++)if(J.charCodeAt(Ce-me)!==se.charCodeAt(de-me))return me;return _e}function c(J){return 55296<=J&&J<=56319}function d(J){return 56320<=J&&J<=57343}function E(J,se){return(J-55296<<10)+(se-56320)+65536}function y(J,se,me){const _e=J.charCodeAt(me);if(c(_e)&&me+1<se){const Ce=J.charCodeAt(me+1);if(d(Ce))return E(_e,Ce)}return _e}function T(J,se){const me=J.charCodeAt(se-1);if(d(me)&&se>1){const _e=J.charCodeAt(se-2);if(c(_e))return E(_e,me)}return me}function D(J,se){const me=F.getInstance(),_e=se,Ce=J.length,de=y(J,Ce,se);se+=de>=65536?2:1;let Ee=me.getGraphemeBreakType(de);for(;se<Ce;){const Te=y(J,Ce,se),Se=me.getGraphemeBreakType(Te);if(A(Ee,Se))break;se+=Te>=65536?2:1,Ee=Se}return se-_e}function L(J,se){const me=F.getInstance(),_e=se,Ce=T(J,se);se-=Ce>=65536?2:1;let de=me.getGraphemeBreakType(Ce);for(;se>0;){const Ee=T(J,se),Te=me.getGraphemeBreakType(Ee);if(A(Te,de))break;se-=Ee>=65536?2:1,de=Te}return _e-se}const x=/(?:[\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 k(J){return x.test(J)}const U=/(?:[\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 R(J){return U.test(J)}const V=/^[\t\n\r\x20-\x7E]*$/;function Z(J){return V.test(J)}const ue=/[\u2028\u2029]/;function le(J){return ue.test(J)}function ge(J){for(let se=0,me=J.length;se<me;se++)if(pe(J.charCodeAt(se)))return!0;return!1}function pe(J){return J=+J,J>=11904&&J<=55215||J>=63744&&J<=64255||J>=65281&&J<=65374}function ae(J){return J>=127462&&J<=127487||J===8986||J===8987||J===9200||J===9203||J>=9728&&J<=10175||J===11088||J===11093||J>=127744&&J<=128591||J>=128640&&J<=128764||J>=128992&&J<=129003||J>=129280&&J<=129535||J>=129648&&J<=129750}const ne=String.fromCharCode(65279);function fe(J){return!!(J&&J.length>0&&J.charCodeAt(0)===65279)}function q(J,se=!1){return J?(se&&(J=J.replace(/\\./g,"")),J.toLowerCase()!==J):!1}function M(J){const se=90-65+1;return J=J%(2*se),J<se?String.fromCharCode(97+J):String.fromCharCode(65+J-se)}function S(J){const se=F.getInstance();return se.getGraphemeBreakType(J)}function A(J,se){return J===0?se!==5&&se!==7:J===2&&se===3?!1:J===4||J===2||J===3||(se===4||se===2||se===3)?!0:J===8&&(se===8||se===9||se===11||se===12)||((J===11||J===9)&&(se===9||se===10)||((J===12||J===10)&&se===10||(se===5||se===13||(se===7||(J===1||J===13&&se===14)))))?!1:!(J===6&&se===6)}class F{constructor(){this._data=K()}static getInstance(){return F._INSTANCE||(F._INSTANCE=new F),F._INSTANCE}getGraphemeBreakType(J){if(J<32)return J===10?3:J===13?2:4;if(J<127)return 0;const se=this._data,me=se.length/3;let _e=1;for(;_e<=me;)if(J<se[3*_e])_e=2*_e;else if(J>se[3*_e+1])_e=2*_e+1;else return se[3*_e+2];return 0}}F._INSTANCE=null;function K(){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 P(J,se){if(J===0)return 0;const me=re(J,se);if(me!==void 0)return me;const _e=T(se,J);return J-=he(_e),J}function re(J,se){let me=T(se,J);for(J-=he(me);ye(me)||me===65039||me===8419;){if(J===0)return;me=T(se,J),J-=he(me)}if(!ae(me))return;if(J>=0){const _e=T(se,J);_e===8205&&(J-=he(_e))}return J}function he(J){return J>=65536?2:1}function ye(J){return 127995<=J&&J<=127999}},NvD2:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return C});var oe=z("Kwbf");function B(j,N){var e=new Set;return j.forEach(function(w){N.has(w)||e.add(w)}),e}function O(j){var N=j||{},e=N.disabled,w=N.disableCheckbox,g=N.checkable;return!!(e||w)||g===!1}function H(j,N,e,w){for(var g=new Set(j),f=new Set,o=0;o<=e;o+=1){var n=N.get(o)||new Set;n.forEach(function(i){var r=i.key,t=i.node,v=i.children,m=v===void 0?[]:v;g.has(r)&&!w(t)&&m.filter(function(p){return!w(p.node)}).forEach(function(p){g.add(p.key)})})}for(var a=new Set,l=e;l>=0;l-=1){var s=N.get(l)||new Set;s.forEach(function(i){var r=i.parent,t=i.node;if(w(t)||!i.parent||a.has(i.parent.key))return;if(w(i.parent.node)){a.add(r.key);return}var v=!0,m=!1;(r.children||[]).filter(function(p){return!w(p.node)}).forEach(function(p){var _=p.key,b=g.has(_);v&&!b&&(v=!1),!m&&(b||f.has(_))&&(m=!0)}),v&&g.add(r.key),m&&f.add(r.key),a.add(r.key)})}return{checkedKeys:Array.from(g),halfCheckedKeys:Array.from(B(f,g))}}function I(j,N,e,w,g){for(var f=new Set(j),o=new Set(N),n=0;n<=w;n+=1){var a=e.get(n)||new Set;a.forEach(function(r){var t=r.key,v=r.node,m=r.children,p=m===void 0?[]:m;!f.has(t)&&!o.has(t)&&!g(v)&&p.filter(function(_){return!g(_.node)}).forEach(function(_){f.delete(_.key)})})}o=new Set;for(var l=new Set,s=w;s>=0;s-=1){var i=e.get(s)||new Set;i.forEach(function(r){var t=r.parent,v=r.node;if(g(v)||!r.parent||l.has(r.parent.key))return;if(g(r.parent.node)){l.add(t.key);return}var m=!0,p=!1;(t.children||[]).filter(function(_){return!g(_.node)}).forEach(function(_){var b=_.key,u=f.has(b);m&&!u&&(m=!1),!p&&(u||o.has(b))&&(p=!0)}),m||f.delete(t.key),p&&o.add(t.key),l.add(t.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(B(o,f))}}function C(j,N,e,w){var g=[],f;w?f=w:f=O;var o=new Set(j.filter(function(s){var i=!!e[s];return i||g.push(s),i})),n=new Map,a=0;Object.keys(e).forEach(function(s){var i=e[s],r=i.level,t=n.get(r);t||(t=new Set,n.set(r,t)),t.add(i),a=Math.max(a,r)}),Object(oe.a)(!g.length,"Tree missing follow keys: ".concat(g.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var l;return N===!0?l=H(o,n,a,f):l=I(o,N.halfCheckedKeys,n,a,f),l}},OZM5:function(Fe,ce,z){"use strict";z.d(ce,"b",function(){return w}),z.d(ce,"a",function(){return g}),z.d(ce,"k",function(){return f}),z.d(ce,"h",function(){return o}),z.d(ce,"i",function(){return n}),z.d(ce,"g",function(){return a}),z.d(ce,"c",function(){return l}),z.d(ce,"d",function(){return s}),z.d(ce,"j",function(){return t}),z.d(ce,"e",function(){return v}),z.d(ce,"f",function(){return m});var oe=z("KQm4"),B=z("U8pU"),O=z("Ff2n"),H=z("q1tI"),I=z.n(H),C=z("Kwbf"),j=z("WaYH"),N=.25,e=2;function w(p,_){var b=p.slice(),u=b.indexOf(_);return u>=0&&b.splice(u,1),b}function g(p,_){var b=p.slice();return b.indexOf(_)===-1&&b.push(_),b}function f(p){return p.split("-")}function o(p,_){return"".concat(p,"-").concat(_)}function n(p){return p&&p.type&&p.type.isTreeNode}function a(p,_){var b=[p],u=_[p];function h(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];c.forEach(function(d){var E=d.key,y=d.children;b.push(E),h(y)})}return h(u.children),b}function l(p,_){var b=p.clientY,u=_.selectHandle.getBoundingClientRect(),h=u.top,c=u.bottom,d=u.height,E=Math.max(d*N,e);return b<=h+E?-1:b>=c-E?1:0}function s(p,_){if(!p)return;var b=_.multiple;return b?p.slice():p.length?[p[0]]:p}var i=function(_){return _};function r(p,_){if(!p)return[];var b=_||{},u=b.processProps,h=u===void 0?i:u,c=Array.isArray(p)?p:[p];return c.map(function(d){var E=d.children,y=Object(O.a)(d,["children"]),T=r(E,_);return I.a.createElement(j.a,Object.assign({},h(y)),T)})}function t(p){if(!p)return null;var _;if(Array.isArray(p))_={checkedKeys:p,halfCheckedKeys:void 0};else if(Object(B.a)(p)==="object")_={checkedKeys:p.checked||void 0,halfCheckedKeys:p.halfChecked||void 0};else return Object(C.a)(!1,"`checkedKeys` is not an array or an object"),null;return _}function v(p,_){var b=new Set;function u(h){if(b.has(h))return;var c=_[h];if(!c)return;b.add(h);var d=c.parent,E=c.node;if(E.disabled)return;d&&u(d.key)}return(p||[]).forEach(function(h){u(h)}),Object(oe.a)(b)}function m(p){var _={};return Object.keys(p).forEach(function(b){(b.startsWith("data-")||b.startsWith("aria-"))&&(_[b]=p[b])}),_}},P48q:function(Fe,ce,z){Fe.exports={flex_box_center:"flex_box_center___BHtvi",flex_space_between:"flex_space_between___1noDr",flex_box_vertical_center:"flex_box_vertical_center___2UDAc",flex_box_center_end:"flex_box_center_end___2j8--",flex_box_column:"flex_box_column___3X60k",tree:"tree___2kCYs",actions:"actions___10Q_6"}},SJMd:function(Fe,ce){/**
* @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,oe,B,O=!1,H,I;window.PR_SHOULD_USE_CONTINUATION=!0;var C,j;(function(){var N=window,e=["break,continue,do,else,for,if,return,while"],w=[e,"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=[w,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],f=[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"],o=[g,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[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"],a="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",l=[g,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],s="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",i=[e,"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"],r=[e,"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"],t=[e,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],v=[f,n,o,l,s,i,r,t],m=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,p="str",_="kwd",b="com",u="typ",h="lit",c="pun",d="pln",E="tag",y="dec",T="src",D="atn",L="atv",x="nocode",k="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(re){for(var he=0,ye=!1,J=!1,se=0,me=re.length;se<me;++se){var _e=re[se];if(_e.ignoreCase)J=!0;else if(/[a-z]/i.test(_e.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){ye=!0,J=!1;break}}var Ce={b:8,t:9,n:10,v:11,f:12,r:13};function de(Ae){var xe=Ae.charCodeAt(0);if(xe!==92)return xe;var Re=Ae.charAt(1);return xe=Ce[Re],xe||("0"<=Re&&Re<="7"?parseInt(Ae.substring(1),8):Re==="u"||Re==="x"?parseInt(Ae.substring(2),16):Ae.charCodeAt(1))}function Ee(Ae){if(Ae<32)return(Ae<16?"\\x0":"\\x")+Ae.toString(16);var xe=String.fromCharCode(Ae);return xe==="\\"||xe==="-"||xe==="]"||xe==="^"?"\\"+xe:xe}function Te(Ae){var xe=Ae.substring(1,Ae.length-1).match(new RegExp("\\\\u[0-9A-Fa-f]{4}|\\\\x[0-9A-Fa-f]{2}|\\\\[0-3][0-7]{0,2}|\\\\[0-7]{1,2}|\\\\[\\s\\S]|-|[^-\\\\]","g")),Re=[],Ie=xe[0]==="^",Q=["["];Ie&&Q.push("^");for(var W=Ie?1:0,G=xe.length;W<G;++W){var X=xe[W];if(/\\[bdsw]/i.test(X))Q.push(X);else{var ee=de(X),Y;W+2<G&&xe[W+1]==="-"?(Y=de(xe[W+2]),W+=2):Y=ee,Re.push([ee,Y]),Y<65||ee>122||(Y<65||ee>90||Re.push([Math.max(65,ee)|32,Math.min(Y,90)|32]),Y<97||ee>122||Re.push([Math.max(97,ee)&~32,Math.min(Y,122)&~32]))}}Re.sort(function(be,ve){return be[0]-ve[0]||ve[1]-be[1]});for(var $=[],te=[],W=0;W<Re.length;++W){var ie=Re[W];ie[0]<=te[1]+1?te[1]=Math.max(te[1],ie[1]):$.push(te=ie)}for(var W=0;W<$.length;++W){var ie=$[W];Q.push(Ee(ie[0])),ie[1]>ie[0]&&(ie[1]+1>ie[0]&&Q.push("-"),Q.push(Ee(ie[1])))}return Q.push("]"),Q.join("")}function Se(Ae){for(var xe=Ae.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")),Re=xe.length,Ie=[],Q=0,W=0;Q<Re;++Q){var G=xe[Q];if(G==="(")++W;else if(G.charAt(0)==="\\"){var X=+G.substring(1);X&&(X<=W?Ie[X]=-1:xe[Q]=Ee(X))}}for(var Q=1;Q<Ie.length;++Q)Ie[Q]===-1&&(Ie[Q]=++he);for(var Q=0,W=0;Q<Re;++Q){var G=xe[Q];if(G==="(")++W,Ie[W]||(xe[Q]="(?:");else if(G.charAt(0)==="\\"){var X=+G.substring(1);X&&X<=W&&(xe[Q]="\\"+Ie[X])}}for(var Q=0;Q<Re;++Q)xe[Q]==="^"&&xe[Q+1]!=="^"&&(xe[Q]="");if(Ae.ignoreCase&&ye)for(var Q=0;Q<Re;++Q){var G=xe[Q],ee=G.charAt(0);G.length>=2&&ee==="["?xe[Q]=Te(G):ee!=="\\"&&(xe[Q]=G.replace(/[a-zA-Z]/g,function(te){var ie=te.charCodeAt(0);return"["+String.fromCharCode(ie&~32,ie|32)+"]"}))}return xe.join("")}for(var we=[],se=0,me=re.length;se<me;++se){var _e=re[se];if(_e.global||_e.multiline)throw new Error(""+_e);we.push("(?:"+Se(_e)+")")}return new RegExp(we.join("|"),J?"gi":"g")}function R(re,he){var ye=/(?:^|\s)nocode(?:\s|$)/,J=[],se=0,me=[],_e=0;function Ce(de){var Ee=de.nodeType;if(Ee==1){if(ye.test(de.className))return;for(var Te=de.firstChild;Te;Te=Te.nextSibling)Ce(Te);var Se=de.nodeName.toLowerCase();(Se==="br"||Se==="li")&&(J[_e]=`
`,me[_e<<1]=se++,me[_e++<<1|1]=de)}else if(Ee==3||Ee==4){var we=de.nodeValue;we.length&&(he?we=we.replace(/\r\n?/g,`
`):we=we.replace(/[ \t\r\n]+/g," "),J[_e]=we,me[_e<<1]=se,se+=we.length,me[_e++<<1|1]=de)}}return Ce(re),{sourceCode:J.join("").replace(/\n$/,""),spans:me}}function V(re,he,ye,J,se){if(!ye)return;var me={sourceNode:re,pre:1,langExtension:null,numberLines:null,sourceCode:ye,spans:null,basePos:he,decorations:null};J(me),se.push.apply(se,me.decorations)}var Z=/\S/;function ue(re){for(var he=void 0,ye=re.firstChild;ye;ye=ye.nextSibling){var J=ye.nodeType;he=J===1?he?re:ye:J===3&&Z.test(ye.nodeValue)?re:he}return he===re?void 0:he}function le(re,he){var ye={},J;(function(){for(var _e=re.concat(he),Ce=[],de={},Ee=0,Te=_e.length;Ee<Te;++Ee){var Se=_e[Ee],we=Se[3];if(we)for(var Ae=we.length;--Ae>=0;)ye[we.charAt(Ae)]=Se;var xe=Se[1],Re=""+xe;de.hasOwnProperty(Re)||(Ce.push(xe),de[Re]=null)}Ce.push(/[\0-\uffff]/),J=U(Ce)})();var se=he.length,me=function(_e){for(var Ce=_e.sourceCode,de=_e.basePos,Ee=_e.sourceNode,Te=[de,d],Se=0,we=Ce.match(J)||[],Ae={},xe=0,Re=we.length;xe<Re;++xe){var Ie=we[xe],Q=Ae[Ie],W=void 0,G;if(typeof Q=="string")G=!1;else{var X=ye[Ie.charAt(0)];if(X)W=Ie.match(X[1]),Q=X[0];else{for(var ee=0;ee<se;++ee)if(X=he[ee],W=Ie.match(X[1]),W){Q=X[0];break}W||(Q=d)}G=Q.length>=5&&Q.substring(0,5)==="lang-",G&&!(W&&typeof W[1]=="string")&&(G=!1,Q=T),G||(Ae[Ie]=Q)}var Y=Se;if(Se+=Ie.length,!G)Te.push(de+Y,Q);else{var $=W[1],te=Ie.indexOf($),ie=te+$.length;W[2]&&(ie=Ie.length-W[2].length,te=ie-$.length);var be=Q.substring(5);V(Ee,de+Y,Ie.substring(0,te),me,Te),V(Ee,de+Y+te,$,M(be,$),Te),V(Ee,de+Y+ie,Ie.substring(ie),me,Te)}}_e.decorations=Te};return me}function ge(re){var he=[],ye=[];re.tripleQuotedStrings?he.push([p,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):re.multiLineStrings?he.push([p,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):he.push([p,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),re.verbatimStrings&&ye.push([p,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var J=re.hashComments;J&&(re.cStyleComments?(J>1?he.push([b,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):he.push([b,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),ye.push([p,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):he.push([b,/^#[^\r\n]*/,null,"#"])),re.cStyleComments&&(ye.push([b,/^\/\/[^\r\n]*/,null]),ye.push([b,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var se=re.regexLiterals;if(se){var me=se>1?"":`
\r`,_e=me?".":"[\\S\\s]",Ce="/(?=[^/*"+me+"])(?:[^/\\x5B\\x5C"+me+"]|\\x5C"+_e+"|\\x5B(?:[^\\x5C\\x5D"+me+"]|\\x5C"+_e+")*(?:\\x5D|$))+/";ye.push(["lang-regex",RegExp("^"+k+"("+Ce+")")])}var de=re.types;de&&ye.push([u,de]);var Ee=(""+re.keywords).replace(/^ | $/g,"");Ee.length&&ye.push([_,new RegExp("^(?:"+Ee.replace(/[\s,]+/g,"|")+")\\b"),null]),he.push([d,/^\s+/,null,` \r
\xA0`]);var Te="^.[^\\s\\w.$@'\"`/\\\\]*";return re.regexLiterals&&(Te+="(?!s*/)"),ye.push([h,/^@[a-z_$][a-z_$@0-9]*/i,null],[u,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[d,/^[a-z_$][a-z_$@0-9]*/i,null],[h,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[d,/^\\[\s\S]?/,null],[c,new RegExp(Te),null]),le(he,ye)}var pe=ge({keywords:v,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function ae(re,he,ye){for(var J=/(?:^|\s)nocode(?:\s|$)/,se=/\r\n?|\n/,me=re.ownerDocument,_e=me.createElement("li");re.firstChild;)_e.appendChild(re.firstChild);var Ce=[_e];function de(xe){var Re=xe.nodeType;if(Re==1&&!J.test(xe.className))if(xe.nodeName==="br")Ee(xe),xe.parentNode&&xe.parentNode.removeChild(xe);else for(var Ie=xe.firstChild;Ie;Ie=Ie.nextSibling)de(Ie);else if((Re==3||Re==4)&&ye){var Q=xe.nodeValue,W=Q.match(se);if(W){var G=Q.substring(0,W.index);xe.nodeValue=G;var X=Q.substring(W.index+W[0].length);if(X){var ee=xe.parentNode;ee.insertBefore(me.createTextNode(X),xe.nextSibling)}Ee(xe),G||xe.parentNode.removeChild(xe)}}}function Ee(xe){for(;!xe.nextSibling;)if(xe=xe.parentNode,!xe)return;function Re(W,G){var X=G?W.cloneNode(!1):W,ee=W.parentNode;if(ee){var Y=Re(ee,1),$=W.nextSibling;Y.appendChild(X);for(var te=$;te;te=$)$=te.nextSibling,Y.appendChild(te)}return X}for(var Ie=Re(xe.nextSibling,0),Q;(Q=Ie.parentNode)&&Q.nodeType===1;)Ie=Q;Ce.push(Ie)}for(var Te=0;Te<Ce.length;++Te)de(Ce[Te]);he===(he|0)&&Ce[0].setAttribute("value",he);var Se=me.createElement("ol");Se.className="linenums";for(var we=Math.max(0,he-1|0)||0,Te=0,Ae=Ce.length;Te<Ae;++Te)_e=Ce[Te],_e.className="L"+(Te+we)%10,_e.firstChild||_e.appendChild(me.createTextNode("\xA0")),Se.appendChild(_e);re.appendChild(Se)}function ne(re){var he=/\bMSIE\s(\d+)/.exec(navigator.userAgent);he=he&&+he[1]<=8;var ye=/\n/g,J=re.sourceCode,se=J.length,me=0,_e=re.spans,Ce=_e.length,de=0,Ee=re.decorations,Te=Ee.length,Se=0;Ee[Te]=se;var we,Ae;for(Ae=we=0;Ae<Te;)Ee[Ae]!==Ee[Ae+2]?(Ee[we++]=Ee[Ae++],Ee[we++]=Ee[Ae++]):Ae+=2;for(Te=we,Ae=we=0;Ae<Te;){for(var xe=Ee[Ae],Re=Ee[Ae+1],Ie=Ae+2;Ie+2<=Te&&Ee[Ie+1]===Re;)Ie+=2;Ee[we++]=xe,Ee[we++]=Re,Ae=Ie}Te=Ee.length=we;var Q=re.sourceNode,W="";Q&&(W=Q.style.display,Q.style.display="none");try{for(var G=null;de<Ce;){var X=_e[de],ee=_e[de+2]||se,Y=Ee[Se+2]||se,Ie=Math.min(ee,Y),$=_e[de+1],te;if($.nodeType!==1&&(te=J.substring(me,Ie))){he&&(te=te.replace(ye,"\r")),$.nodeValue=te;var ie=$.ownerDocument,be=ie.createElement("span");be.className=Ee[Se+1];var ve=$.parentNode;ve.replaceChild(be,$),be.appendChild($),me<ee&&(_e[de+1]=$=ie.createTextNode(J.substring(Ie,ee)),ve.insertBefore($,be.nextSibling))}me=Ie,me>=ee&&(de+=2),me>=Y&&(Se+=2)}}finally{Q&&(Q.style.display=W)}}var fe={};function q(re,he){for(var ye=he.length;--ye>=0;){var J=he[ye];fe.hasOwnProperty(J)?N.console&&console.warn("cannot override language handler %s",J):fe[J]=re}}function M(re,he){return re&&fe.hasOwnProperty(re)||(re=/^\s*</.test(he)?"default-markup":"default-code"),fe[re]}q(pe,["default-code"]),q(le([],[[d,/^[^<?]+/],[y,/^<!\w[^>]*(?:>|$)/],[b,/^<\!--[\s\S]*?(?:-\->|$)/],["lang-",/^<\?([\s\S]+?)(?:\?>|$)/],["lang-",/^<%([\s\S]+?)(?:%>|$)/],[c,/^(?:<[%?]|[%?]>)/],["lang-",/^<xmp\b[^>]*>([\s\S]+?)<\/xmp\b[^>]*>/i],["lang-js",/^<script\b[^>]*>([\s\S]*?)(<\/script\b[^>]*>)/i],["lang-css",/^<style\b[^>]*>([\s\S]*?)(<\/style\b[^>]*>)/i],["lang-in.tag",/^(<\/?[a-z][^<>]*>)/i]]),["default-markup","htm","html","mxml","xhtml","xml","xsl"]),q(le([[d,/^[\s]+/,null,` \r
`],[L,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[E,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[D,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[c,/^[=<>\/]+/],["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"]),q(le([],[[L,/^[\s\S]+/]]),["uq.val"]),q(ge({keywords:f,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),q(ge({keywords:"null,true,false"}),["json"]),q(ge({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),q(ge({keywords:o,cStyleComments:!0}),["java"]),q(ge({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),q(ge({keywords:i,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),q(ge({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),q(ge({keywords:r,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),q(ge({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),q(ge({keywords:a,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),q(le([],[[p,/^[\s\S]+/]]),["regex"]);function S(re){var he=re.langExtension;try{var ye=R(re.sourceNode,re.pre),J=ye.sourceCode;re.sourceCode=J,re.spans=ye.spans,re.basePos=0,M(he,J)(re),ne(re)}catch(se){N.console&&console.log(se&&se.stack||se)}}function A(re,he,ye){var J=ye||!1,se=he||null,me=document.createElement("div");me.innerHTML="<pre>"+re+"</pre>",me=me.firstChild,J&&ae(me,J,!0);var _e={langExtension:se,numberLines:J,sourceNode:me,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return S(_e),me.innerHTML}function F(re,he){var ye=he||document.body,J=ye.ownerDocument||document;function se(X){return ye.getElementsByTagName(X)}for(var me=[se("pre"),se("code"),se("xmp")],_e=[],Ce=0;Ce<me.length;++Ce)for(var de=0,Ee=me[Ce].length;de<Ee;++de)_e.push(me[Ce][de]);me=null;var Te=Date;Te.now||(Te={now:function(){return+new Date}});var Se=0,we=/\blang(?:uage)?-([\w.]+)(?!\S)/,Ae=/\bprettyprint\b/,xe=/\bprettyprinted\b/,Re=/pre|xmp/i,Ie=/^code$/i,Q=/^(?:pre|code|xmp)$/i,W={};function G(){for(var X=N.PR_SHOULD_USE_CONTINUATION?Te.now()+250:Infinity;Se<_e.length&&Te.now()<X;Se++){for(var ee=_e[Se],Y=W,$=ee;$=$.previousSibling;){var te=$.nodeType,ie=(te===7||te===8)&&$.nodeValue;if(ie?!/^\??prettify\b/.test(ie):te!==3||/\S/.test($.nodeValue))break;if(ie){Y={},ie.replace(/\b(\w+)=([\w:.%+-]+)/g,function(qe,Ye,nt){Y[Ye]=nt});break}}var be=ee.className;if((Y!==W||Ae.test(be))&&!xe.test(be)){for(var ve=!1,Oe=ee.parentNode;Oe;Oe=Oe.parentNode){var Le=Oe.tagName;if(Q.test(Le)&&Oe.className&&Ae.test(Oe.className)){ve=!0;break}}if(!ve){ee.className+=" prettyprinted";var Pe=Y.lang;if(!Pe){Pe=be.match(we);var ke;!Pe&&(ke=ue(ee))&&Ie.test(ke.tagName)&&(Pe=ke.className.match(we)),Pe&&(Pe=Pe[1])}var Ge;if(Re.test(ee.tagName))Ge=1;else{var Ke=ee.currentStyle,Ue=J.defaultView,it=Ke?Ke.whiteSpace:Ue&&Ue.getComputedStyle?Ue.getComputedStyle(ee,null).getPropertyValue("white-space"):0;Ge=it&&it.substring(0,3)==="pre"}var $e=Y.linenums;($e=$e==="true"||+$e)||($e=be.match(/\blinenums\b(?::(\d+))?/),$e=$e?$e[1]&&$e[1].length?+$e[1]:!0:!1),$e&&ae(ee,$e,Ge);var rt={langExtension:Pe,sourceNode:ee,numberLines:$e,pre:Ge,sourceCode:null,basePos:null,spans:null,decorations:null};S(rt)}}}Se<_e.length?N.setTimeout(G,250):typeof re=="function"&&re()}G()}var K=N.PR={createSimpleLexer:le,registerLangHandler:q,sourceDecorator:ge,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:L,PR_COMMENT:b,PR_DECLARATION:y,PR_KEYWORD:_,PR_LITERAL:h,PR_NOCODE:x,PR_PLAIN:d,PR_PUNCTUATION:c,PR_SOURCE:T,PR_STRING:p,PR_TAG:E,PR_TYPE:u,prettyPrintOne:O?N.prettyPrintOne=A:C=A,prettyPrint:j=O?N.prettyPrint=F:j=F},P=N.define;typeof P=="function"&&P.amd&&P("google-code-prettify",[],function(){return K})})()},STEk:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return q});/*! *****************************************************************************
Copyright (c) Microsoft Corporation.
Permission to use, copy, modify, and/or distribute this software for any
purpose with or without fee is hereby granted.
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
PERFORMANCE OF THIS SOFTWARE.
***************************************************************************** */var oe=function(M,S){return(oe=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,F){A.__proto__=F}||function(A,F){for(var K in F)Object.prototype.hasOwnProperty.call(F,K)&&(A[K]=F[K])})(M,S)};function B(M,S){function A(){this.constructor=M}oe(M,S),M.prototype=S===null?Object.create(S):(A.prototype=S.prototype,new A)}function O(M,S,A,F){return new(A||(A=Promise))(function(K,P){function re(J){try{ye(F.next(J))}catch(se){P(se)}}function he(J){try{ye(F.throw(J))}catch(se){P(se)}}function ye(J){var se;J.done?K(J.value):(se=J.value,se instanceof A?se:new A(function(me){me(se)})).then(re,he)}ye((F=F.apply(M,S||[])).next())})}function H(M,S){var A,F,K,P,re={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return P={next:he(0),throw:he(1),return:he(2)},typeof Symbol=="function"&&(P[Symbol.iterator]=function(){return this}),P;function he(ye){return function(J){return function(se){if(A)throw new TypeError("Generator is already executing.");for(;re;)try{if(A=1,F&&(K=2&se[0]?F.return:se[0]?F.throw||((K=F.return)&&K.call(F),0):F.next)&&!(K=K.call(F,se[1])).done)return K;switch(F=0,K&&(se=[2&se[0],K.value]),se[0]){case 0:case 1:K=se;break;case 4:return re.label++,{value:se[1],done:!1};case 5:re.label++,F=se[1],se=[0];continue;case 7:se=re.ops.pop(),re.trys.pop();continue;default:if(!(K=re.trys,(K=K.length>0&&K[K.length-1])||se[0]!==6&&se[0]!==2)){re=0;continue}if(se[0]===3&&(!K||se[1]>K[0]&&se[1]<K[3])){re.label=se[1];break}if(se[0]===6&&re.label<K[1]){re.label=K[1],K=se;break}if(K&&re.label<K[2]){re.label=K[2],re.ops.push(se);break}K[2]&&re.ops.pop(),re.trys.pop();continue}se=S.call(M,re)}catch(me){se=[6,me],F=0}finally{A=K=0}if(5&se[0])throw se[1];return{value:se[0]?se[1]:void 0,done:!0}}([ye,J])}}}function I(){for(var M=0,S=0,A=arguments.length;S<A;S++)M+=arguments[S].length;var F=Array(M),K=0;for(S=0;S<A;S++)for(var P=arguments[S],re=0,he=P.length;re<he;re++,K++)F[K]=P[re];return F}var C=function(){function M(){}return M.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},M.setAttributes=function(S,A){for(var F=0,K=A;F<K.length;F++){var P=K[F],re=P[0],he=P[1];S.setAttribute(re,he)}},M.createRect=function(S,A,F){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",S.toString()),K.setAttribute("height",A.toString()),F&&M.setAttributes(K,F),K},M.createLine=function(S,A,F,K,P){var re=document.createElementNS("http://www.w3.org/2000/svg","line");return re.setAttribute("x1",S.toString()),re.setAttribute("y1",A.toString()),re.setAttribute("x2",F.toString()),re.setAttribute("y2",K.toString()),P&&M.setAttributes(re,P),re},M.createPolygon=function(S,A){var F=document.createElementNS("http://www.w3.org/2000/svg","polygon");return F.setAttribute("points",S),A&&M.setAttributes(F,A),F},M.createCircle=function(S,A){var F=document.createElementNS("http://www.w3.org/2000/svg","circle");return F.setAttribute("cx",(S/2).toString()),F.setAttribute("cy",(S/2).toString()),F.setAttribute("r",S.toString()),A&&M.setAttributes(F,A),F},M.createEllipse=function(S,A,F){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(S/2).toString()),K.setAttribute("cy",(A/2).toString()),K.setAttribute("rx",(S/2).toString()),K.setAttribute("ry",(A/2).toString()),F&&M.setAttributes(K,F),K},M.createGroup=function(S){var A=document.createElementNS("http://www.w3.org/2000/svg","g");return S&&M.setAttributes(A,S),A},M.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},M.createMarker=function(S,A,F,K,P,re,he){var ye=document.createElementNS("http://www.w3.org/2000/svg","marker");return M.setAttributes(ye,[["id",S],["orient",A],["markerWidth",F.toString()],["markerHeight",K.toString()],["refX",P.toString()],["refY",re.toString()]]),ye.appendChild(he),ye},M.createText=function(S){var A=document.createElementNS("http://www.w3.org/2000/svg","text");return A.setAttribute("x","0"),A.setAttribute("y","0"),S&&M.setAttributes(A,S),A},M.createTSpan=function(S,A){var F=document.createElementNS("http://www.w3.org/2000/svg","tspan");return F.textContent=S,A&&M.setAttributes(F,A),F},M.createImage=function(S){var A=document.createElementNS("http://www.w3.org/2000/svg","image");return S&&M.setAttributes(A,S),A},M.createPoint=function(S,A){var F=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return F.x=S,F.y=A,F},M.createPath=function(S,A){var F=document.createElementNS("http://www.w3.org/2000/svg","path");return F.setAttribute("d",S),A&&M.setAttributes(F,A),F},M}(),j=function(){function M(){}return M.addKey=function(S){M.key=S},Object.defineProperty(M,"isLicensed",{get:function(){return!!M.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(M.key)},enumerable:!1,configurable:!0}),M}(),N=function(){function M(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return M.prototype.rasterize=function(S,A,F){var K=this;return new Promise(function(P){var re=F!==void 0?F:document.createElement("canvas");S===null&&(K.markersOnly=!0,K.naturalSize=!1);var he=document.createElementNS("http://www.w3.org/2000/svg","svg");he.setAttribute("xmlns","http://www.w3.org/2000/svg"),he.setAttribute("width",A.width.baseVal.valueAsString),he.setAttribute("height",A.height.baseVal.valueAsString),he.setAttribute("viewBox","0 0 "+A.viewBox.baseVal.width.toString()+" "+A.viewBox.baseVal.height.toString()),he.innerHTML=A.innerHTML,K.naturalSize===!0?(he.width.baseVal.value=S.naturalWidth,he.height.baseVal.value=S.naturalHeight):K.width!==void 0&&K.height!==void 0&&(he.width.baseVal.value=K.width,he.height.baseVal.value=K.height),re.width=he.width.baseVal.value,re.height=he.height.baseVal.value;var ye=he.outerHTML,J=re.getContext("2d");K.markersOnly!==!0&&J.drawImage(S,0,0,re.width,re.height);var se=window.URL,me=new Image(re.width,re.height);me.setAttribute("crossOrigin","anonymous");var _e=new Blob([ye],{type:"image/svg+xml"}),Ce=se.createObjectURL(_e);me.onload=function(){J.drawImage(me,0,0),se.revokeObjectURL(Ce);var de=re.toDataURL(K.imageType,K.imageQuality);P(de)},me.src=Ce})},M}(),e=function(){},w=function(){function M(S){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+S+"_"}return Object.defineProperty(M.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"defaultSettings",{get:function(){return{canvasBackgroundColor:"#ffffff",toolbarBackgroundColor:"#111111",toolbarBackgroundHoverColor:"#333333",toolbarColor:"#eeeeee",toolbarHeight:40,toolboxColor:"#eeeeee",toolboxAccentColor:"#3080c3",undoButtonVisible:!0,redoButtonVisible:!1,zoomButtonVisible:!1,zoomOutButtonVisible:!1,clearButtonVisible:!1,resultButtonBlockVisible:!0,logoPosition:"left"}},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),M.prototype.addClass=function(S){return this.styleSheet===void 0&&this.addStyleSheet(),S.name=""+this.classNamePrefix+S.localName,this.classes.push(S),this.styleSheet.sheet.insertRule("."+S.name+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length),S},M.prototype.addRule=function(S){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(S),this.styleSheet.sheet.insertRule(S.selector+" {"+S.style+"}",this.styleSheet.sheet.cssRules.length)},M.prototype.addStyleSheet=function(){var S;this.styleSheet=document.createElement("style"),((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).appendChild(this.styleSheet),this.addRule(new g("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
from {
opacity: 0;
}
to {
opacity: 1;
}
`)),this.addRule(new g("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
from {
opacity: 1;
}
to {
opacity: 0;
}
`)),this.addClass(new f("fade_in",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
`)),this.addClass(new f("fade_out",`
animation-duration: 0.3s;
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
`))},M.prototype.removeStyleSheet=function(){var S;this.styleSheet&&(((S=this.styleSheetRoot)!==null&&S!==void 0?S:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},M}(),g=function(M,S){this.selector=M,this.style=S},f=function(M,S){this.localName=M,this.style=S},o=function(){function M(S,A,F,K,P){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=S,this.displayMode=A,this.markerItems=F,this.uiStyleSettings=K,this.styles=P,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return M.prototype.show=function(S){var A=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var F=document.createElement("div");F.className=this.toolbarBlockStyleClass.name,F.style.whiteSpace="nowrap",this.uiContainer.appendChild(F),this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M10.07 14.27a.997.997 0 011.33.48l2.3 4.99 1.8-.85-2.31-4.98c-.24-.5-.02-1.1.48-1.33l.28-.08 2.3-.45L8 5.12V15.9l1.82-1.47.25-.16m3.57 7.7a.99.99 0 01-1.33-.47l-2.18-4.74-2.51 2.02c-.17.14-.38.22-.62.22a1 1 0 01-1-1V3a1 1 0 011-1c.24 0 .47.09.64.23l.01-.01 11.49 9.64a1.001 1.001 0 01-.44 1.75l-3.16.62 2.2 4.73c.26.5.02 1.09-.48 1.32l-3.62 1.69z"/></svg>',"select"),this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M9 3v1H4v2h1v13a2 2 0 002 2h10a2 2 0 002-2V6h1V4h-5V3H9M7 6h10v13H7V6m2 2v9h2V8H9m4 0v9h2V8h-2z"/></svg>',"delete"),this.uiStyleSettings.clearButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M19.36 2.72l1.42 1.42-5.72 5.71c1.07 1.54 1.22 3.39.32 4.59L9.06 8.12c1.2-.9 3.05-.75 4.59.32l5.71-5.72M5.93 17.57c-2.01-2.01-3.24-4.41-3.58-6.65l4.88-2.09 7.44 7.44-2.09 4.88c-2.24-.34-4.64-1.57-6.65-3.58z"/></svg>',"clear"),this.uiStyleSettings.undoButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M12.5 8c-2.65 0-5.05 1-6.9 2.6L2 7v9h9l-3.62-3.62c1.39-1.16 3.16-1.88 5.12-1.88 3.54 0 6.55 2.31 7.6 5.5l2.37-.78C21.08 11.03 17.15 8 12.5 8z"/></svg>',"undo"),this.uiStyleSettings.redoButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M18.4 10.6C16.55 9 14.15 8 11.5 8c-4.65 0-8.58 3.03-9.96 7.22L3.9 16a8.002 8.002 0 017.6-5.5c1.95 0 3.73.72 5.12 1.88L13 16h9V7l-3.6 3.6z"/></svg>',"redo"),this.uiStyleSettings.zoomButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M15.5 14l5 5-1.5 1.5-5-5v-.79l-.27-.28A6.471 6.471 0 019.5 16 6.5 6.5 0 013 9.5 6.5 6.5 0 019.5 3 6.5 6.5 0 0116 9.5c0 1.61-.59 3.09-1.57 4.23l.28.27h.79m-6 0C12 14 14 12 14 9.5S12 5 9.5 5 5 7 5 9.5 7 14 9.5 14m2.5-4h-2v2H9v-2H7V9h2V7h1v2h2v1z"/></svg>',"zoom"),this.uiStyleSettings.zoomButtonVisible&&this.uiStyleSettings.zoomOutButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M15.5 14h-.79l-.28-.27A6.471 6.471 0 0016 9.5 6.5 6.5 0 009.5 3 6.5 6.5 0 003 9.5 6.5 6.5 0 009.5 16c1.61 0 3.09-.59 4.23-1.57l.27.28v.79l5 5 1.5-1.5-5-5m-6 0C7 14 5 12 5 9.5S7 5 9.5 5 14 7 14 9.5 12 14 9.5 14M7 9h5v1H7V9z"/></svg>',"zoom-out"),this.uiStyleSettings.notesButtonVisible&&this.addActionButton(F,'<svg viewBox="0 0 24 24"><path d="M18.13 12l1.26-1.26c.44-.44 1-.68 1.61-.74V9l-6-6H5c-1.11 0-2 .89-2 2v14a2 2 0 002 2h6v-1.87l.13-.13H5V5h7v7h6.13M14 4.5l5.5 5.5H14V4.5m5.13 9.33l2.04 2.04L15.04 22H13v-2.04l6.13-6.13m3.72.36l-.98.98-2.04-2.04.98-.98c.19-.2.52-.2.72 0l1.32 1.32c.2.2.2.53 0 .72z"/></svg>',"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(P){var re=document.createElement("div");re.className=""+A.toolbarButtonStyleClass.name,re.setAttribute("data-type-name",P.typeName),re.innerHTML=P.icon,re.addEventListener("click",function(){A.markerToolbarButtonClicked(re,P)}),A.buttons.push(re),A.markerButtons.push(re)}),this.overflowButton=document.createElement("div"),this.overflowButton.className=this.toolbarButtonStyleClass.name+" "+(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name),this.overflowButton.innerHTML='<svg viewBox="0 0 24 24"><path d="M12 16a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2m0-6a2 2 0 012 2 2 2 0 01-2 2 2 2 0 01-2-2 2 2 0 012-2z"/></svg>',this.overflowButton.addEventListener("click",this.overflowButtonClicked),this.markerButtonBlock.appendChild(this.overflowButton));var K=document.createElement("div");K.className=this.toolbarBlockStyleClass.name,K.style.whiteSpace="nowrap",K.style.display=this.uiStyleSettings.resultButtonBlockVisible!==!1?"":"none",this.uiContainer.appendChild(K),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M9 20.42l-6.21-6.21 2.83-2.83L9 14.77l9.88-9.89 2.83 2.83L9 20.42z"/></svg>',"render"),this.addActionButton(K,'<svg viewBox="0 0 24 24"><path d="M20 6.91L17.09 4 12 9.09 6.91 4 4 6.91 9.09 12 4 17.09 6.91 20 12 14.91 17.09 20 20 17.09 14.91 12 20 6.91z"/></svg>',"close"),this.markerjsContainer.appendChild(this.uiContainer),this.setSelectMode(),this.setCurrentMarker(),this.adjustLayout()},M.prototype.addButtonClickListener=function(S){this.buttonClickListeners.push(S)},M.prototype.removeButtonClickListener=function(S){this.buttonClickListeners.indexOf(S)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(S),1)},M.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},M.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var S=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var A=0;A<this.markerButtons.length;A++)A<S||A===S&&this.markerButtons.length-1===S?this.markerButtonBlock.appendChild(this.markerButtons[A]):(A===S&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[A]))}},M.prototype.overflowButtonClicked=function(){this.markerButtonOverflowBlock.style.display!=="none"?(this.markerButtonOverflowBlock.className=this.markerButtonOverflowBlock.className.replace(this.styles.fadeInAnimationClassName,""),this.markerButtonOverflowBlock.style.display="none"):(this.markerButtonOverflowBlock.className+=" "+this.styles.fadeInAnimationClassName,this.markerButtonOverflowBlock.style.top=this.uiContainer.offsetTop+this.overflowButton.offsetHeight+"px",this.markerButtonOverflowBlock.style.right=this.uiContainer.offsetWidth-this.overflowButton.offsetLeft-this.overflowButton.offsetWidth+2*this.uiContainer.offsetLeft+"px",this.markerButtonOverflowBlock.style.display="inline-block")},M.prototype.resetButtonStyles=function(){var S=this;this.buttons.forEach(function(A){A.className=A.className.replace(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name,"").trim(),A.className=A.className.replace(S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?S.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:S.toolbarActiveButtonStyleColorsClass.name,"").trim(),A.className+=" "+(S.uiStyleSettings.toolbarButtonStyleColorsClassName?S.uiStyleSettings.toolbarButtonStyleColorsClassName:S.toolbarButtonStyleColorsClass.name)})},M.prototype.addActionButton=function(S,A,F){var K=this,P=document.createElement("div");switch(P.className=""+this.toolbarButtonStyleClass.name,P.innerHTML=A,P.setAttribute("data-action",F),P.addEventListener("click",function(){K.actionToolbarButtonClicked(P,F)}),F){case"select":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":P.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":P.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":P.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":P.style.fill=this.uiStyleSettings.closeButtonColor}S.appendChild(P),this.buttons.push(P)},M.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new f("toolbar",`
width: 100%;
flex-shrink: 0;
display: flex;
flex-direction: row;
justify-content: space-between;
height: `+this.uiStyleSettings.toolbarHeight+`px;
box-sizing: content-box;
`+(this.displayMode==="inline"?"border-top-left-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
`+(this.displayMode==="inline"?"border-top-right-radius: "+Math.round(this.uiStyleSettings.toolbarHeight/10)+"px;":"")+`
overflow: hidden;
`)),this.toolbarStyleColorsClass=this.styles.addClass(new f("toolbar_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
`)),this.toolbarBlockStyleClass=this.styles.addClass(new f("toolbar-block",`
display: inline-block;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new f("toolbar-overflow-block",`
position: absolute;
top: `+this.uiStyleSettings.toolbarHeight+`px;
max-width: `+2*this.uiStyleSettings.toolbarHeight+`px;
z-index: 10;
box-sizing: content-box;
`)),this.toolbarOverflowBlockStyleColorsClass=this.styles.addClass(new f("toolbar-overflow-block_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`));var S=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new f("toolbar_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*S)+`px;
padding: `+S+`px;
box-sizing: content-box;
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new f("toolbar_button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbar_active_button",`
fill: `+this.uiStyleSettings.toolbarColor+`;
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`)),this.styles.addRule(new g("."+this.toolbarButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`))},M.prototype.markerToolbarButtonClicked=function(S,A){this.setActiveButton(S),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("marker",A)}),this.markerButtonOverflowBlock.style.display="none"},M.prototype.actionToolbarButtonClicked=function(S,A){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(F){return F("action",A)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},M.prototype.setActiveButton=function(S){this.resetButtonStyles(),S.className=S.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),S.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},M.prototype.setActiveMarkerButton=function(S){var A=this.markerButtons.find(function(F){return F.getAttribute("data-type-name")===S});A&&this.setActiveButton(A)},M.prototype.setCurrentMarker=function(S){var A=this;this.currentMarker=S,this.buttons.filter(function(F){return/delete|notes/.test(F.getAttribute("data-action"))}).forEach(function(F){A.currentMarker===void 0?(F.style.fillOpacity="0.4",F.style.pointerEvents="none"):(F.style.fillOpacity="1",F.style.pointerEvents="all")})},M}(),n=function(){function M(S,A,F,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=S,this.displayMode=A,this.uiStyleSettings=F,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return M.prototype.addStyles=function(){var S;this.toolboxStyleClass=this.styles.addClass(new f("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 f("toolbox_colors",`
color: `+this.uiStyleSettings.toolboxColor+`;
`));var A=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new f("toolbox-button-row",`
display: flex;
cursor: default;
box-sizing: content-box;
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new f("toolbox-button-row_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new f("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 f("toolbox-panel-row_colors",`
background-color: `+((S=this.uiStyleSettings.toolboxBackgroundColor)!==null&&S!==void 0?S:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
`)),this.toolboxButtonStyleClass=this.styles.addClass(new f("toolbox_button",`
display: inline-block;
width: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
height: `+(this.uiStyleSettings.toolbarHeight-2*A)+`px;
padding: `+A+`px;
box-sizing: content-box;
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new f("toolbox-button_colors",`
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new f("toolbox-active-button_colors",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
fill: `+this.uiStyleSettings.toolbarColor+`;
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleColorsClass.name+":hover",`
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
`)),this.styles.addRule(new g("."+this.toolboxButtonStyleClass.name+" svg",`
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
`))},M.prototype.show=function(S){var A;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=S,this.uiContainer.className=this.toolboxStyleClass.name+" "+((A=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},M.prototype.setPanelButtons=function(S){var A,F,K=this;this.panels=S,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((A=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&A!==void 0?A:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((F=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&F!==void 0?F:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(P){var re;P.uiStyleSettings=K.uiStyleSettings;var he=document.createElement("div");he.className=K.toolboxButtonStyleClass.name+" "+((re=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&re!==void 0?re:K.toolboxButtonStyleColorsClass.name),he.innerHTML=P.icon,he.title=P.title,he.addEventListener("click",function(){K.panelButtonClick(P)}),K.panelButtons.push(he),K.buttonRow.appendChild(he)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},M.prototype.panelButtonClick=function(S){var A=this,F=-1;if(S!==this.activePanel){F=this.panels.indexOf(S),this.panelRow.innerHTML="";var K=S.getUi();K.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.panelRow.appendChild(K),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=S}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){A.displayMode==="inline"?A.panelRow.style.display="none":A.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(P,re){var he,ye;P.className=A.toolboxButtonStyleClass.name+" "+(re===F?""+((he=A.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&he!==void 0?he:A.toolboxActiveButtonStyleColorsClass.name):""+((ye=A.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ye!==void 0?ye:A.toolboxButtonStyleColorsClass.name))})},M}(),a=function(M,S){this.title=M,this.icon=S},l=function(M){function S(A,F,K,P){var re=M.call(this,A,P||'<svg viewBox="0 0 24 24"><path d="M17.5 12a1.5 1.5 0 01-1.5-1.5A1.5 1.5 0 0117.5 9a1.5 1.5 0 011.5 1.5 1.5 1.5 0 01-1.5 1.5m-3-4A1.5 1.5 0 0113 6.5 1.5 1.5 0 0114.5 5 1.5 1.5 0 0116 6.5 1.5 1.5 0 0114.5 8m-5 0A1.5 1.5 0 018 6.5 1.5 1.5 0 019.5 5 1.5 1.5 0 0111 6.5 1.5 1.5 0 019.5 8m-3 4A1.5 1.5 0 015 10.5 1.5 1.5 0 016.5 9 1.5 1.5 0 018 10.5 1.5 1.5 0 016.5 12M12 3a9 9 0 00-9 9 9 9 0 009 9 1.5 1.5 0 001.5-1.5c0-.39-.15-.74-.39-1-.23-.27-.38-.62-.38-1a1.5 1.5 0 011.5-1.5H16a5 5 0 005-5c0-4.42-4.03-8-9-8z"/></svg>')||this;return re.colors=[],re.addTransparent=!1,re.colorBoxes=[],re.colors=F,re.currentColor=K,re.setCurrentColor=re.setCurrentColor.bind(re),re.getColorBox=re.getColorBox.bind(re),re}return B(S,M),S.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.whiteSpace="nowrap",this.colors.forEach(function(K){var P=A.getColorBox(K);F.appendChild(P),A.colorBoxes.push(P)}),F},S.prototype.getColorBox=function(A){var F=this,K=this.uiStyleSettings.toolbarHeight/4,P=this.uiStyleSettings.toolbarHeight-K,re=document.createElement("div");re.style.display="inline-block",re.style.boxSizing="content-box",re.style.width=P-2+"px",re.style.height=P-2+"px",re.style.padding="1px",re.style.marginRight="2px",re.style.marginBottom="2px",re.style.borderWidth="2px",re.style.borderStyle="solid",re.style.borderRadius=(P+2)/2+"px",re.style.borderColor=A===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",re.addEventListener("click",function(){F.setCurrentColor(A,re)});var he=document.createElement("div");return he.style.display="inline-block",he.style.width=P-2+"px",he.style.height=P-2+"px",he.style.backgroundColor=A,he.style.borderRadius=P/2+"px",A==="transparent"&&(he.style.fill=this.uiStyleSettings.toolboxAccentColor,he.innerHTML=`<svg viewBox="0 0 24 24">
<path d="M2,5.27L3.28,4L20,20.72L18.73,22L15.65,18.92C14.5,19.3 13.28,19.5 12,19.5C7,19.5 2.73,16.39 1,12C1.69,10.24 2.79,8.69 4.19,7.46L2,5.27M12,9A3,3 0 0,1 15,12C15,12.35 14.94,12.69 14.83,13L11,9.17C11.31,9.06 11.65,9 12,9M12,4.5C17,4.5 21.27,7.61 23,12C22.18,14.08 20.79,15.88 19,17.19L17.58,15.76C18.94,14.82 20.06,13.54 20.82,12C19.17,8.64 15.76,6.5 12,6.5C10.91,6.5 9.84,6.68 8.84,7L7.3,5.47C8.74,4.85 10.33,4.5 12,4.5M3.18,12C4.83,15.36 8.24,17.5 12,17.5C12.69,17.5 13.37,17.43 14,17.29L11.72,15C10.29,14.85 9.15,13.71 9,12.28L5.6,8.87C4.61,9.72 3.78,10.78 3.18,12Z" />
</svg>`),re.appendChild(he),re},S.prototype.setCurrentColor=function(A,F){var K=this;this.currentColor=A,this.colorBoxes.forEach(function(P){P.style.borderColor=P===F?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(A)},S}(a),s=function(){function M(S,A,F){this._state="new",this._isSelected=!1,this._container=S,this._overlayContainer=A,this.globalSettings=F,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(M.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),M.prototype.ownsTarget=function(S){return!1},Object.defineProperty(M.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),M.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},M.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},M.prototype.pointerDown=function(S,A){},M.prototype.dblClick=function(S,A){},M.prototype.manipulate=function(S){},M.prototype.pointerUp=function(S){this.stateChanged()},M.prototype.dispose=function(){},M.prototype.addMarkerVisualToContainer=function(S){this.container.childNodes.length>0?this.container.insertBefore(S,this.container.childNodes[0]):this.container.appendChild(S)},M.prototype.getState=function(){return{typeName:M.typeName,state:this.state,notes:this.notes}},M.prototype.restoreState=function(S){this._state=S.state,this.notes=S.notes},M.prototype.scale=function(S,A){},M.prototype.colorChanged=function(S){this.onColorChanged&&this.onColorChanged(S),this.stateChanged()},M.prototype.fillColorChanged=function(S){this.onFillColorChanged&&this.onFillColorChanged(S),this.stateChanged()},M.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var S=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),S.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(S)&&this.onStateChanged(this)}},M.typeName="MarkerBase",M}(),i=function(){function M(){this.findGripByVisual=this.findGripByVisual.bind(this)}return M.prototype.findGripByVisual=function(S){return this.topLeft.ownsTarget(S)?this.topLeft:this.topCenter.ownsTarget(S)?this.topCenter:this.topRight.ownsTarget(S)?this.topRight:this.centerLeft.ownsTarget(S)?this.centerLeft:this.centerRight.ownsTarget(S)?this.centerRight:this.bottomLeft.ownsTarget(S)?this.bottomLeft:this.bottomCenter.ownsTarget(S)?this.bottomCenter:this.bottomRight.ownsTarget(S)?this.bottomRight:void 0},M}(),r=function(){function M(){this.GRIP_SIZE=10,this.visual=C.createGroup(),this.visual.appendChild(C.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(C.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return M.prototype.ownsTarget=function(S){return S===this.visual||S===this.visual.childNodes[0]||S===this.visual.childNodes[1]},M}(),t=function(){function M(){}return M.toITransformMatrix=function(S){return{a:S.a,b:S.b,c:S.c,d:S.d,e:S.e,f:S.f}},M.toSVGMatrix=function(S,A){return S.a=A.a,S.b=A.b,S.c=A.c,S.d=A.d,S.e=A.e,S.f=A.f,S},M}(),v=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.left=0,P.top=0,P.width=0,P.height=0,P.defaultSize={x:50,y:20},P.offsetX=0,P.offsetY=0,P.rotationAngle=0,P.CB_DISTANCE=10,P._suppressMarkerCreateEvent=!1,P.container.transform.baseVal.appendItem(C.createTransform()),P.setupControlBox(),P}return B(S,M),Object.defineProperty(S.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"visual",{get:function(){return this._visual},set:function(A){this._visual=A;var F=C.createTransform();this._visual.transform.baseVal.appendItem(F)},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(A){return!!M.prototype.ownsTarget.call(this,A)||!!(this.controlGrips.findGripByVisual(A)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(A))},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.left=A.x,this.top=A.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(A);if(this.manipulationStartX=K.x,this.manipulationStartY=K.y,this.offsetX=K.x-this.left,this.offsetY=K.y-this.top,this.state!=="new")if(this.select(),this.activeGrip=this.controlGrips.findGripByVisual(F),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(F)){this.activeGrip=this.rotatorGrip;var P=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=P.x-this.width/2,this.top=P.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var re=this.container.transform.baseVal.getItem(0);re.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(re,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},S.prototype.pointerUp=function(A){var F=this.state;M.prototype.pointerUp.call(this,A),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(A),this._state="select",F==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},S.prototype.moveVisual=function(A){this.visual.style.transform="translate("+A.x+"px, "+A.y+"px)"},S.prototype.manipulate=function(A){var F=this.unrotatePoint(A);this.state==="creating"?this.resize(A):this.state==="move"?(this.left=this.manipulationStartLeft+(F.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(F.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(F):this.state==="rotate"&&this.rotate(A)},S.prototype.resize=function(A){var F=this.manipulationStartLeft,K=this.manipulationStartWidth,P=this.manipulationStartTop,re=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:F=this.manipulationStartLeft+A.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-F;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+A.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:P=this.manipulationStartTop+A.y-this.manipulationStartY,re=this.manipulationStartHeight+this.manipulationStartTop-P;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:re=this.manipulationStartHeight+A.y-this.manipulationStartY}K>=0?(this.left=F,this.width=K):(this.left=F+K,this.width=-K),re>=0?(this.top=P,this.height=re):(this.top=P+re,this.height=-re),this.setSize()},S.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},S.prototype.rotate=function(A){if(Math.abs(A.x-this.centerX)>.1){var F=Math.sign(A.x-this.centerX);this.rotationAngle=180*Math.atan((A.y-this.centerY)/(A.x-this.centerX))/Math.PI+90*F,this.applyRotation()}},S.prototype.applyRotation=function(){var A=this.container.transform.baseVal.getItem(0);A.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(A,0)},S.prototype.rotatePoint=function(A){if(this.rotationAngle===0)return A;var F=this.container.getCTM(),K=C.createPoint(A.x,A.y);return{x:(K=K.matrixTransform(F)).x,y:K.y}},S.prototype.unrotatePoint=function(A){if(this.rotationAngle===0)return A;var F=this.container.getCTM();F=F.inverse();var K=C.createPoint(A.x,A.y);return{x:(K=K.matrixTransform(F)).x,y:K.y}},S.prototype.select=function(){M.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){M.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=C.createGroup();var A=C.createTransform();A.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(A),this.container.appendChild(this.controlBox),this.controlRect=C.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=C.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 i,this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){var A=this.controlBox.transform.baseVal.getItem(0);A.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(A,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()},S.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()},S.prototype.createGrip=function(){var A=new r;return A.visual.transform.baseVal.appendItem(C.createTransform()),this.controlBox.appendChild(A.visual),A},S.prototype.positionGrips=function(){var A=this.controlGrips.topLeft.GRIP_SIZE,F=-A/2,K=F,P=(this.width+this.CB_DISTANCE)/2-A/2,re=(this.height+this.CB_DISTANCE)/2-A/2,he=this.height+this.CB_DISTANCE-A/2,ye=this.width+this.CB_DISTANCE-A/2;this.positionGrip(this.controlGrips.topLeft.visual,F,K),this.positionGrip(this.controlGrips.topCenter.visual,P,K),this.positionGrip(this.controlGrips.topRight.visual,ye,K),this.positionGrip(this.controlGrips.centerLeft.visual,F,re),this.positionGrip(this.controlGrips.centerRight.visual,ye,re),this.positionGrip(this.controlGrips.bottomLeft.visual,F,he),this.positionGrip(this.controlGrips.bottomCenter.visual,P,he),this.positionGrip(this.controlGrips.bottomRight.visual,ye,he),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,P,K-3*this.CB_DISTANCE)},S.prototype.positionGrip=function(A,F,K){var P=A.transform.baseVal.getItem(0);P.setTranslate(F,K),A.transform.baseVal.replaceItem(P,0)},S.prototype.hideControlBox=function(){this.controlBox.style.display="none"},S.prototype.showControlBox=function(){this.controlBox.style.display=""},S.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:t.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:t.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},M.prototype.getState.call(this))},S.prototype.restoreState=function(A){M.prototype.restoreState.call(this,A);var F=A;this.left=F.left,this.top=F.top,this.width=F.width,this.height=F.height,this.rotationAngle=F.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,F.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(t.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,F.containerTransformMatrix))},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F);var K=this.rotatePoint({x:this.left,y:this.top}),P=this.unrotatePoint({x:K.x*A,y:K.y*F});this.left=P.x,this.top=P.y,this.width=this.width*A,this.height=this.height*F,this.adjustControlBox()},S}(s),m=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.createVisual=P.createVisual.bind(P),P}return B(S,M),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.visual)},S.prototype.createVisual=function(){this.visual=C.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)},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},S.prototype.manipulate=function(A){M.prototype.manipulate.call(this,A)},S.prototype.resize=function(A){M.prototype.resize.call(this,A),this.setSize()},S.prototype.setSize=function(){M.prototype.setSize.call(this),C.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(A){M.prototype.pointerUp.call(this,A),this.setSize()},S.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&C.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},S.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&C.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},S.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&C.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&C.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},M.prototype.getState.call(this))},S.prototype.restoreState=function(A){var F=A;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),M.prototype.restoreState.call(this,A),this.setSize()},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F),this.setSize()},S.title="Rectangle marker",S}(v),p=function(M){function S(A,F,K,P){var re=M.call(this,A,P||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return re.widths=[],re.widthBoxes=[],re.widths=F,re.currentWidth=K,re.setCurrentWidth=re.setCurrentWidth.bind(re),re}return B(S,M),S.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.widths.forEach(function(K){var P=document.createElement("div");P.style.display="flex",P.style.flexGrow="2",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=K===A.currentWidth?A.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){A.setCurrentWidth(K,P)}),F.appendChild(P);var re=document.createElement("div");re.innerText=K.toString(),re.style.marginRight="5px",P.appendChild(re);var he=document.createElement("div");he.style.minHeight="20px",he.style.flexGrow="2",he.style.display="flex",he.style.alignItems="center";var ye=document.createElement("hr");ye.style.minWidth="20px",ye.style.border="0px",ye.style.borderTop=K+"px solid "+A.uiStyleSettings.toolboxColor,ye.style.flexGrow="2",he.appendChild(ye),P.appendChild(he),A.widthBoxes.push(P)}),F},S.prototype.setCurrentWidth=function(A,F){var K=this;this.currentWidth=A,this.widthBoxes.forEach(function(P){P.style.borderColor=P===F?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},S}(a),_=function(M){function S(A,F,K,P){var re=M.call(this,A,P||'<svg viewBox="0 0 24 24"><path d="M3 16h5v-2H3v2m6.5 0h5v-2h-5v2m6.5 0h5v-2h-5v2M3 20h2v-2H3v2m4 0h2v-2H7v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2m4 0h2v-2h-2v2M3 12h8v-2H3v2m10 0h8v-2h-8v2M3 4v4h18V4H3z"/></svg>')||this;return re.styles=[],re.styleBoxes=[],re.styles=F,re.currentStyle=K,re.setCurrentStyle=re.setCurrentStyle.bind(re),re}return B(S,M),S.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",this.styles.forEach(function(K){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/A.styles.length-5+"%",P.style.borderColor=K===A.currentStyle?A.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){A.setCurrentStyle(K,P)}),F.appendChild(P);var re=document.createElement("div");re.style.minHeight="20px",re.style.flexGrow="2",re.style.overflow="hidden";var he=`<svg width="100" height="20">
<line x1="0" y1="10" x2="100" y2="10" stroke="`+A.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
</svg>`;re.innerHTML=he,P.appendChild(re),A.styleBoxes.push(P)}),F},S.prototype.setCurrentStyle=function(A,F){var K=this;this.currentStyle=A,this.styleBoxes.forEach(function(P){P.style.borderColor=P===F?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},S}(a),b=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.strokeColor=K.defaultColor,P.strokeWidth=K.defaultStrokeWidth,P.strokeDasharray=K.defaultStrokeDasharray,P.strokePanel=new l("Line color",K.defaultColorSet,K.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new _("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return B(S,M),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=M.prototype.getState.call(this);return A.typeName=S.typeName,A},S.typeName="FrameMarker",S.title="Frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',S}(m),u=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},h=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.x1=0,P.y1=0,P.x2=0,P.y2=0,P.defaultLength=50,P.manipulationStartX=0,P.manipulationStartY=0,P.manipulationStartX1=0,P.manipulationStartY1=0,P.manipulationStartX2=0,P.manipulationStartY2=0,P.setupControlBox(),P}return B(S,M),S.prototype.ownsTarget=function(A){return!!M.prototype.ownsTarget.call(this,A)||!(!this.grip1.ownsTarget(A)&&!this.grip2.ownsTarget(A))},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.manipulationStartX=A.x,this.manipulationStartY=A.y,this.state==="new"&&(this.x1=A.x,this.y1=A.y,this.x2=A.x,this.y2=A.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(F)?this.activeGrip=this.grip1:this.grip2.ownsTarget(F)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},S.prototype.pointerUp=function(A){var F=this.state;M.prototype.pointerUp.call(this,A),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(A),this._state="select",F==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},S.prototype.adjustVisual=function(){},S.prototype.manipulate=function(A){this.state==="creating"?this.resize(A):this.state==="move"?(this.x1=this.manipulationStartX1+A.x-this.manipulationStartX,this.y1=this.manipulationStartY1+A.y-this.manipulationStartY,this.x2=this.manipulationStartX2+A.x-this.manipulationStartX,this.y2=this.manipulationStartY2+A.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(A)},S.prototype.resize=function(A){switch(this.activeGrip){case this.grip1:this.x1=A.x,this.y1=A.y;break;case this.grip2:case void 0:this.x2=A.x,this.y2=A.y}this.adjustVisual(),this.adjustControlBox()},S.prototype.select=function(){M.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},S.prototype.deselect=function(){M.prototype.deselect.call(this),this.controlBox.style.display="none"},S.prototype.setupControlBox=function(){this.controlBox=C.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},S.prototype.adjustControlBox=function(){this.positionGrips()},S.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},S.prototype.createGrip=function(){var A=new r;return A.visual.transform.baseVal.appendItem(C.createTransform()),this.controlBox.appendChild(A.visual),A},S.prototype.positionGrips=function(){var A=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-A/2,this.y1-A/2),this.positionGrip(this.grip2.visual,this.x2-A/2,this.y2-A/2)},S.prototype.positionGrip=function(A,F,K){var P=A.transform.baseVal.getItem(0);P.setTranslate(F,K),A.transform.baseVal.replaceItem(P,0)},S.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},M.prototype.getState.call(this))},S.prototype.restoreState=function(A){M.prototype.restoreState.call(this,A);var F=A;this.x1=F.x1,this.y1=F.y1,this.x2=F.x2,this.y2=F.y2},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F),this.x1=this.x1*A,this.y1=this.y1*F,this.x2=this.x2*A,this.y2=this.y2*F,this.adjustVisual(),this.adjustControlBox()},S}(s),c=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.strokeColor=K.defaultColor,P.strokeWidth=K.defaultStrokeWidth,P.strokeDasharray=K.defaultStrokeDasharray,P.strokePanel=new l("Line color",K.defaultColorSet,K.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new _("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return B(S,M),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorLine&&A!==this.visibleLine)},S.prototype.createVisual=function(){this.visual=C.createGroup(),this.selectorLine=C.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=C.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)},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},S.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()),C.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),C.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),C.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},S.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},S.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){M.prototype.restoreState.call(this,A);var F=A;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.createVisual(),this.adjustVisual()},S.typeName="LineMarker",S.title="Line marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',S}(h),d=function(M){function S(A,F,K,P){var re=M.call(this,A,P||'<svg viewBox="0 0 24 24"><path d="M17 8h3v12h1v1h-4v-1h1v-3h-4l-1.5 3H14v1h-4v-1h1l6-12m1 1l-3.5 7H18V9M5 3h5c1.11 0 2 .89 2 2v11H9v-5H6v5H3V5c0-1.11.89-2 2-2m1 2v4h3V5H6z"/></svg>')||this;return re.fonts=[],re.fontBoxes=[],re.fonts=F,re.currentFont=K,re.setCurrentFont=re.setCurrentFont.bind(re),re}return B(S,M),S.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.overflow="hidden",F.style.flexGrow="2",this.fonts.forEach(function(K){var P=document.createElement("div");P.style.display="inline-block",P.style.alignItems="center",P.style.justifyContent="space-between",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.overflow="hidden",P.style.maxWidth=100/A.fonts.length-5+"%",P.style.borderColor=K===A.currentFont?A.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){A.setCurrentFont(K,P)}),F.appendChild(P);var re=document.createElement("div");re.style.display="flex",re.style.minHeight="20px",re.style.flexGrow="2",re.style.fontFamily=K,re.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",re.appendChild(he),P.appendChild(re),A.fontBoxes.push(P)}),F},S.prototype.setCurrentFont=function(A,F){var K=this;this.currentFont=A,this.fontBoxes.forEach(function(P){P.style.borderColor=P===F?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},S}(a),E=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.color="transparent",P.padding=5,P.DEFAULT_TEXT="your text here",P.text=P.DEFAULT_TEXT,P.isMoved=!1,P.color=K.defaultColor,P.fontFamily=K.defaultFontFamily,P.defaultSize={x:100,y:30},P.setColor=P.setColor.bind(P),P.setFont=P.setFont.bind(P),P.renderText=P.renderText.bind(P),P.sizeText=P.sizeText.bind(P),P.textEditDivClicked=P.textEditDivClicked.bind(P),P.showTextEditor=P.showTextEditor.bind(P),P.setSize=P.setSize.bind(P),P.positionTextEditor=P.positionTextEditor.bind(P),P.colorPanel=new l("Color",K.defaultColorSet,K.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.fontFamilyPanel=new d("Font",K.defaultFontFamilies,K.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P}return B(S,M),S.prototype.ownsTarget=function(A){if(M.prototype.ownsTarget.call(this,A)||A===this.visual||A===this.textElement||A===this.bgRectangle)return!0;var F=!1;return this.textElement.childNodes.forEach(function(K){K===A&&(F=!0)}),F},S.prototype.createVisual=function(){this.visual=C.createGroup(),this.bgRectangle=C.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=C.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem(C.createTransform()),this.textElement.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.isMoved=!1,this.pointerDownPoint=A,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},S.prototype.renderText=function(){var A=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(F){A.textElement.appendChild(C.createTSpan(F.trim()===""?" ":F.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},S.prototype.getTextScale=function(){var A=this.textElement.getBBox(),F=1;if(A.width>0&&A.height>0){var K=(1*this.width-this.width*this.padding*2/100)/A.width,P=(1*this.height-this.height*this.padding*2/100)/A.height;F=Math.min(K,P)}return F},S.prototype.getTextPosition=function(A){var F=this.textElement.getBBox(),K=0,P=0;return F.width>0&&F.height>0&&(K=(this.width-F.width*A)/2,P=this.height/2-F.height*A/2),{x:K,y:P}},S.prototype.sizeText=function(){var A=this.textElement.getBBox(),F=this.getTextScale(),K=this.getTextPosition(F);K.y-=A.y*F,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+F+", "+F+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(F,F))},S.prototype.manipulate=function(A){M.prototype.manipulate.call(this,A),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(A.x-this.pointerDownPoint.x)>5||Math.abs(A.y-this.pointerDownPoint.y)>5)},S.prototype.resize=function(A){M.prototype.resize.call(this,A),this.isMoved=!0,this.setSize(),this.sizeText()},S.prototype.setSize=function(){M.prototype.setSize.call(this),this.visual&&this.bgRectangle&&(C.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),C.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},S.prototype.pointerUp=function(A){var F=this.state;F==="creating"&&(this._suppressMarkerCreateEvent=!0),M.prototype.pointerUp.call(this,A),this.setSize(),(F==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},S.prototype.showTextEditor=function(){var A=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(F){F.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var F=Number.parseFloat(A.textEditor.style.fontSize);A.textEditor.clientWidth>=Number.parseInt(A.textEditor.style.maxWidth)&&F>.9;)F-=.1,A.textEditor.style.fontSize=Math.max(F,.9)+"em"}),this.textEditor.addEventListener("keyup",function(F){F.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(F){if(F.clipboardData){var K=F.clipboardData.getData("text"),P=window.getSelection();if(!P.rangeCount)return!1;P.deleteFromDocument(),P.getRangeAt(0).insertNode(document.createTextNode(K)),F.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){A.textEditDivClicked(A.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},S.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var A=this.getTextScale(),F=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),P={x:K.width*A,y:K.height*A};F.x-=P.x/2,F.y-=P.y/2,this.textEditor.style.top=F.y+"px",this.textEditor.style.left=F.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-F.x+"px",this.textEditor.style.fontSize=Math.max(16*A,12)+"px",this.textElement.style.display="none"}},S.prototype.textEditDivClicked=function(A){this.text=A.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},S.prototype.select=function(){M.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},S.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),M.prototype.deselect.call(this)},S.prototype.dblClick=function(A,F){M.prototype.dblClick.call(this,A,F),this.showTextEditor()},S.prototype.setColor=function(A){this.textElement&&C.setAttributes(this.textElement,[["fill",A]]),this.color=A,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(A)},S.prototype.setFont=function(A){this.textElement&&C.setAttributes(this.textElement,[["font-family",A]]),this.fontFamily=A,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},S.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},S.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){var F=A;this.color=F.color,this.fontFamily=F.fontFamily,this.padding=F.padding,this.text=F.text,this.createVisual(),M.prototype.restoreState.call(this,A),this.setSize()},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F),this.setSize(),this.sizeText(),this.positionTextEditor()},S.typeName="TextMarker",S.title="Text marker",S.icon='<svg viewBox="0 0 24 24"><path d="M9.6 14L12 7.7l2.4 6.3M11 5L5.5 19h2.2l1.1-3H15l1.1 3h2.2L13 5h-2z"/></svg>',S}(v),y=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.color="transparent",P.lineWidth=3,P.drawing=!1,P.pixelRatio=1,P.color=K.defaultColor,P.lineWidth=K.defaultStrokeWidth,P.pixelRatio=K.freehandPixelRatio,P.setColor=P.setColor.bind(P),P.addCanvas=P.addCanvas.bind(P),P.finishCreation=P.finishCreation.bind(P),P.setLineWidth=P.setLineWidth.bind(P),P.colorPanel=new l("Color",K.defaultColorSet,K.defaultColor),P.colorPanel.onColorChanged=P.setColor,P.lineWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),P.lineWidthPanel.onWidthChanged=P.setLineWidth,P}return B(S,M),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.drawingImage)},S.prototype.createVisual=function(){this.visual=C.createGroup(),this.drawingImage=C.createImage(),this.visual.appendChild(this.drawingImage);var A=C.createTransform();this.visual.transform.baseVal.appendItem(A),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(A,F){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(A.x,A.y),this.drawing=!0):M.prototype.pointerDown.call(this,A,F)},S.prototype.manipulate=function(A){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(A.x,A.y),this.canvasContext.stroke()):M.prototype.manipulate.call(this,A)},S.prototype.resize=function(A){M.prototype.resize.call(this,A),C.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),C.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},S.prototype.pointerUp=function(A){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):M.prototype.pointerUp.call(this,A)},S.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)},S.prototype.select=function(){this.state==="creating"&&this.finishCreation(),M.prototype.select.call(this)},S.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),M.prototype.deselect.call(this)},S.prototype.finishCreation=function(){for(var A=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),F=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=F[0],P=F[1],re=F[2],he=F[3],ye=!1,J=0;J<this.canvasElement.height;J++)for(var se=0;se<this.canvasElement.width;se++)A.data[J*this.canvasElement.width*4+4*se+3]>0&&(ye=!0,J<P&&(P=J),se<K&&(K=se),J>he&&(he=J),se>re&&(re=se));if(ye){this.left=K/this.pixelRatio,this.top=P/this.pixelRatio,this.width=(re-K)/this.pixelRatio,this.height=(he-P)/this.pixelRatio;var me=document.createElement("canvas");me.width=re-K,me.height=he-P,me.getContext("2d").putImageData(this.canvasContext.getImageData(K,P,re-K,he-P),0,0),this.drawingImgUrl=me.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},S.prototype.setDrawingImage=function(){C.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),C.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},S.prototype.setColor=function(A){this.color=A,this.colorChanged(A)},S.prototype.setLineWidth=function(A){this.lineWidth=A},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=Object.assign({drawingImgUrl:this.drawingImgUrl},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){this.createVisual(),M.prototype.restoreState.call(this,A),this.drawingImgUrl=A.drawingImgUrl,this.setDrawingImage()},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F),this.setDrawingImage()},S.typeName="FreehandMarker",S.title="Freehand marker",S.icon='<svg viewBox="0 0 24 24"><path d="M9.75 20.85c1.78-.7 1.39-2.63.49-3.85-.89-1.25-2.12-2.11-3.36-2.94A9.817 9.817 0 014.54 12c-.28-.33-.85-.94-.27-1.06.59-.12 1.61.46 2.13.68.91.38 1.81.82 2.65 1.34l1.01-1.7C8.5 10.23 6.5 9.32 4.64 9.05c-1.06-.16-2.18.06-2.54 1.21-.32.99.19 1.99.77 2.77 1.37 1.83 3.5 2.71 5.09 4.29.34.33.75.72.95 1.18.21.44.16.47-.31.47-1.24 0-2.79-.97-3.8-1.61l-1.01 1.7c1.53.94 4.09 2.41 5.96 1.79m11.09-15.6c.22-.22.22-.58 0-.79l-1.3-1.3a.562.562 0 00-.78 0l-1.02 1.02 2.08 2.08M11 10.92V13h2.08l6.15-6.15-2.08-2.08L11 10.92z"/></svg>',S}(v),T=function(M){function S(A,F,K){var P=M.call(this,A,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return P.typeBoxes=[],P.currentType=F,P.setCurrentType=P.setCurrentType.bind(P),P}return B(S,M),S.prototype.getUi=function(){var A=this,F=document.createElement("div");F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2";for(var K=function(he){var ye="both";switch(he){case 0:ye="both";break;case 1:ye="start";break;case 2:ye="end";break;case 3:ye="none"}var J=document.createElement("div");if(J.style.display="flex",J.style.flexGrow="2",J.style.alignItems="center",J.style.justifyContent="space-between",J.style.padding="5px",J.style.borderWidth="2px",J.style.borderStyle="solid",J.style.borderColor=ye===P.currentType?P.uiStyleSettings.toolboxAccentColor:"transparent",J.addEventListener("click",function(){A.setCurrentType(ye,J)}),F.appendChild(J),ye==="both"||ye==="start"){var se=document.createElement("div");se.style.display="flex",se.style.alignItems="center",se.style.minHeight="20px",se.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,5 10,0 10,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,se.style.marginLeft="5px",J.appendChild(se)}var me=document.createElement("div");me.style.display="flex",me.style.alignItems="center",me.style.minHeight="20px",me.style.flexGrow="2";var _e=document.createElement("hr");if(_e.style.minWidth="20px",_e.style.border="0px",_e.style.borderTop="3px solid "+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee"),_e.style.flexGrow="2",me.appendChild(_e),J.appendChild(me),ye==="both"||ye==="end"){var Ce=document.createElement("div");Ce.style.display="flex",Ce.style.alignItems="center",Ce.style.minHeight="20px",Ce.innerHTML=`<svg viewBox="0 0 10 10" width="10" height="10" xmlns="http://www.w3.org/2000/svg">
<polygon points="0,0 10,5 0,10" fill="`+(P.uiStyleSettings!==void 0?P.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
</svg>`,Ce.style.marginRight="5px",J.appendChild(Ce)}P.typeBoxes.push(J)},P=this,re=0;re<4;re++)K(re);return F},S.prototype.setCurrentType=function(A,F){var K=this;this.currentType=A,this.typeBoxes.forEach(function(P){P.style.borderColor=P===F?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},S}(a),D=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.arrowType="end",P.arrowBaseHeight=10,P.arrowBaseWidth=10,P.getArrowPoints=P.getArrowPoints.bind(P),P.setArrowType=P.setArrowType.bind(P),P.arrowTypePanel=new T("Arrow type","end"),P.arrowTypePanel.onArrowTypeChanged=P.setArrowType,P}return B(S,M),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.arrow1&&A!==this.arrow2)},S.prototype.getArrowPoints=function(A,F){var K=this.arrowBaseWidth+2*this.strokeWidth,P=this.arrowBaseHeight+2*this.strokeWidth;return A-K/2+","+(F+P/2)+" "+A+","+(F-P/2)+" "+(A+K/2)+","+(F+P/2)},S.prototype.createTips=function(){this.arrow1=C.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=C.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.arrow2)},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(M.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",C.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),C.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var A=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.arrow1.transform.baseVal.getItem(0);F.setRotate(A,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(F,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(A+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},S.prototype.setArrowType=function(A){this.arrowType=A,this.adjustVisual(),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=Object.assign({arrowType:this.arrowType},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){M.prototype.restoreState.call(this,A);var F=A;this.arrowType=F.arrowType,this.createTips(),this.adjustVisual()},S.typeName="ArrowMarker",S.title="Arrow marker",S.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',S}(c),L=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.fillColor=K.defaultFillColor,P.strokeWidth=0,P.fillPanel=new l("Color",K.defaultColorSet,K.defaultFillColor),P.fillPanel.onColorChanged=P.setFillColor,P}return B(S,M),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=M.prototype.getState.call(this);return A.typeName=S.typeName,A},S.typeName="CoverMarker",S.title="Cover marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',S}(m),x=function(M){function S(A,F,K,P){var re=M.call(this,A,P||'<svg viewBox="0 0 24 24"><path d="M17.66 8L12 2.35 6.34 8A8.02 8.02 0 004 13.64c0 2 .78 4.11 2.34 5.67a7.99 7.99 0 0011.32 0c1.56-1.56 2.34-3.67 2.34-5.67S19.22 9.56 17.66 8M6 14c0-2 .62-3.27 1.76-4.4L12 5.27l4.24 4.38C17.38 10.77 18 12 18 14H6z"/></svg>')||this;return re.opacities=[],re.opacityBoxes=[],re.opacities=F,re.currentOpacity=K,re.setCurrentOpacity=re.setCurrentOpacity.bind(re),re}return B(S,M),S.prototype.getUi=function(){var A=this,F=document.createElement("div");return F.style.display="flex",F.style.overflow="hidden",F.style.flexGrow="2",F.style.justifyContent="space-between",this.opacities.forEach(function(K){var P=document.createElement("div");P.style.display="flex",P.style.alignItems="center",P.style.justifyContent="center",P.style.padding="5px",P.style.borderWidth="2px",P.style.borderStyle="solid",P.style.borderColor=K===A.currentOpacity?A.uiStyleSettings.toolboxAccentColor:"transparent",P.addEventListener("click",function(){A.setCurrentOpacity(K,P)}),F.appendChild(P);var re=document.createElement("div");re.innerText=100*K+"%",P.appendChild(re),A.opacityBoxes.push(P)}),F},S.prototype.setCurrentOpacity=function(A,F){var K=this;this.currentOpacity=A,this.opacityBoxes.forEach(function(P){P.style.borderColor=P===F?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},S}(a),k=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.setOpacity=P.setOpacity.bind(P),P.fillColor=K.defaultHighlightColor,P.strokeWidth=0,P.opacity=K.defaultHighlightOpacity,P.fillPanel=new l("Color",K.defaultColorSet,P.fillColor),P.fillPanel.onColorChanged=P.setFillColor,P.opacityPanel=new x("Opacity",K.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return B(S,M),S.prototype.setOpacity=function(A){this.opacity=A,this.visual&&C.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=M.prototype.getState.call(this);return A.typeName=S.typeName,A},S.typeName="HighlightMarker",S.title="Highlight marker",S.icon='<svg viewBox="0 0 24 24"><path d="M18.5 1.15c-.53 0-1.04.19-1.43.58l-5.81 5.82 5.65 5.65 5.82-5.81c.77-.78.77-2.04 0-2.83l-2.84-2.83c-.39-.39-.89-.58-1.39-.58M10.3 8.5l-5.96 5.96c-.78.78-.78 2.04.02 2.85C3.14 18.54 1.9 19.77.67 21h5.66l.86-.86c.78.76 2.03.75 2.81-.02l5.95-5.96"/></svg>',S}(L),U='<svg viewBox="0 0 24 24"><path d="M19 11.5s-2 2.17-2 3.5a2 2 0 002 2 2 2 0 002-2c0-1.33-2-3.5-2-3.5M5.21 10L10 5.21 14.79 10m1.77-1.06L7.62 0 6.21 1.41l2.38 2.38-5.15 5.15c-.59.56-.59 1.53 0 2.12l5.5 5.5c.29.29.68.44 1.06.44s.77-.15 1.06-.44l5.5-5.5c.59-.59.59-1.56 0-2.12z"/></svg>',R=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.bgColor="transparent",P.tipPosition={x:0,y:0},P.tipBase1Position={x:0,y:0},P.tipBase2Position={x:0,y:0},P.tipMoving=!1,P.color=K.defaultStrokeColor,P.bgColor=K.defaultFillColor,P.fontFamily=K.defaultFontFamily,P.defaultSize={x:100,y:30},P.setBgColor=P.setBgColor.bind(P),P.getTipPoints=P.getTipPoints.bind(P),P.positionTip=P.positionTip.bind(P),P.setTipPoints=P.setTipPoints.bind(P),P.colorPanel=new l("Text color",K.defaultColorSet,P.color,'<svg viewBox="0 0 24 24"><path d="M9.62 12L12 5.67 14.37 12M11 3L5.5 17h2.25l1.12-3h6.25l1.13 3h2.25L13 3h-2z"/></svg>'),P.colorPanel.onColorChanged=P.setColor,P.bgColorPanel=new l("Fill color",K.defaultColorSet,P.bgColor,U),P.bgColorPanel.onColorChanged=P.setBgColor,P.fontFamilyPanel=new d("Font",K.defaultFontFamilies,K.defaultFontFamily),P.fontFamilyPanel.onFontChanged=P.setFont,P.tipGrip=new r,P.tipGrip.visual.transform.baseVal.appendItem(C.createTransform()),P.controlBox.appendChild(P.tipGrip.visual),P}return B(S,M),S.prototype.ownsTarget=function(A){return M.prototype.ownsTarget.call(this,A)||this.tipGrip.ownsTarget(A)||this.tip===A},S.prototype.createTip=function(){C.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=C.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},S.prototype.pointerDown=function(A,F){this.state==="new"&&M.prototype.pointerDown.call(this,A,F),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(F)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):M.prototype.pointerDown.call(this,A,F)},S.prototype.pointerUp=function(A){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,M.prototype.pointerUp.call(this,A);else{var F=this.state==="creating";M.prototype.pointerUp.call(this,A),this.setTipPoints(F),this.positionTip()}},S.prototype.manipulate=function(A){if(this.tipMoving){var F=this.unrotatePoint(A);this.tipPosition={x:F.x-this.manipulationStartLeft,y:F.y-this.manipulationStartTop},this.positionTip()}else M.prototype.manipulate.call(this,A)},S.prototype.setBgColor=function(A){this.bgRectangle&&this.tip&&(C.setAttributes(this.bgRectangle,[["fill",A]]),C.setAttributes(this.tip,[["fill",A]])),this.bgColor=A,this.fillColorChanged(A)},S.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},S.prototype.setTipPoints=function(A){A===void 0&&(A=!1);var F=Math.min(this.height/2,15),K=this.height/5;A&&(this.tipPosition={x:F+K/2,y:this.height+20});var P=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(K=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:0},this.tipBase2Position={x:F+K,y:0}):(this.tipBase1Position={x:0,y:F},this.tipBase2Position={x:0,y:F+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?P<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(K=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-K,y:0},this.tipBase2Position={x:this.width-F,y:0}):(this.tipBase1Position={x:this.width,y:F},this.tipBase2Position={x:this.width,y:F+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?P<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(K=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-F-K,y:this.height},this.tipBase2Position={x:this.width-F,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-F-K},this.tipBase2Position={x:this.width,y:this.height-F}):P<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,F=Math.min(this.width/2,15),this.tipBase1Position={x:F,y:this.height},this.tipBase2Position={x:F+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-F},this.tipBase2Position={x:0,y:this.height-F-K})},S.prototype.resize=function(A){M.prototype.resize.call(this,A),this.positionTip()},S.prototype.positionTip=function(){C.setAttributes(this.tip,[["points",this.getTipPoints()]]);var A=this.tipGrip.visual.transform.baseVal.getItem(0);A.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(A,0)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),S.prototype.select=function(){this.positionTip(),M.prototype.select.call(this)},S.prototype.getState=function(){var A=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){var F=A;this.bgColor=F.bgColor,this.tipPosition=F.tipPosition,M.prototype.restoreState.call(this,A),this.createTip(),this.setTipPoints()},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F),this.tipPosition={x:this.tipPosition.x*A,y:this.tipPosition.y*F},this.positionTip()},S.typeName="CalloutMarker",S.title="Callout marker",S.icon='<svg viewBox="0 0 24 24"><path d="M4 2h16a2 2 0 012 2v12a2 2 0 01-2 2h-4l-4 4-4-4H4a2 2 0 01-2-2V4a2 2 0 012-2m0 2v12h4.83L12 19.17 15.17 16H20V4H4m2 3h12v2H6V7m0 4h10v2H6v-2z"/></svg>',S}(E),V=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.fillColor="transparent",P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.opacity=1,P.strokeColor=K.defaultColor,P.strokeWidth=K.defaultStrokeWidth,P.strokeDasharray=K.defaultStrokeDasharray,P.fillColor=K.defaultFillColor,P.setStrokeColor=P.setStrokeColor.bind(P),P.setFillColor=P.setFillColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.setOpacity=P.setOpacity.bind(P),P.createVisual=P.createVisual.bind(P),P.strokePanel=new l("Line color",I(K.defaultColorSet,["transparent"]),K.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.fillPanel=new l("Fill color",I(K.defaultColorSet,["transparent"]),P.fillColor,U),P.fillPanel.onColorChanged=P.setFillColor,P.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new _("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P.opacityPanel=new x("Opacity",K.defaultOpacitySteps,P.opacity),P.opacityPanel.onOpacityChanged=P.setOpacity,P}return B(S,M),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.visual)},S.prototype.createVisual=function(){this.visual=C.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.state==="new"&&(this.createVisual(),this.moveVisual(A),this._state="creating")},S.prototype.manipulate=function(A){M.prototype.manipulate.call(this,A)},S.prototype.resize=function(A){M.prototype.resize.call(this,A),this.setSize()},S.prototype.setSize=function(){M.prototype.setSize.call(this),C.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},S.prototype.pointerUp=function(A){M.prototype.pointerUp.call(this,A),this.setSize()},S.prototype.setStrokeColor=function(A){this.strokeColor=A,this.visual&&C.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(A),this.stateChanged()},S.prototype.setFillColor=function(A){this.fillColor=A,this.visual&&C.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(A),this.stateChanged()},S.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.visual&&C.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},S.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.visual&&C.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},S.prototype.setOpacity=function(A){this.opacity=A,this.visual&&C.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){var F=A;this.fillColor=F.fillColor,this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.opacity=F.opacity,this.createVisual(),M.prototype.restoreState.call(this,A),this.setSize()},S.prototype.scale=function(A,F){M.prototype.scale.call(this,A,F),this.setSize()},S.typeName="EllipseMarker",S.title="Ellipse marker",S.icon='<svg viewBox="0 0 24 24"><path d="M12 4C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',S}(v),Z=function(M){function S(A,F,K){return M.call(this,A,F,K)||this}return B(S,M),Object.defineProperty(S.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.tip1&&A!==this.tip2)},S.prototype.createTips=function(){this.tip1=C.createLine(this.x1-this.tipLength/2,this.y1,this.x1+this.tipLength/2,this.y1,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip1.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.tip1),this.tip2=C.createLine(this.x2-this.tipLength/2,this.y2,this.x2+this.tipLength/2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.tip2.transform.baseVal.appendItem(C.createTransform()),this.visual.appendChild(this.tip2)},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.state==="creating"&&this.createTips()},S.prototype.adjustVisual=function(){if(M.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&(C.setAttributes(this.tip1,[["x1",(this.x1-this.tipLength/2).toString()],["y1",this.y1.toString()],["x2",(this.x1+this.tipLength/2).toString()],["y2",this.y1.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),C.setAttributes(this.tip2,[["x1",(this.x2-this.tipLength/2).toString()],["y1",this.y2.toString()],["x2",(this.x2+this.tipLength/2).toString()],["y2",this.y2.toString()],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),Math.abs(this.x1-this.x2)>.1)){var A=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),F=this.tip1.transform.baseVal.getItem(0);F.setRotate(A,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(F,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(A+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=M.prototype.getState.call(this);return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){M.prototype.restoreState.call(this,A),this.createTips(),this.adjustVisual()},S.typeName="MeasurementMarker",S.title="Measurement marker",S.icon='<svg viewBox="0 0 24 24"><path d="M1.39 18.36l1.77-1.76L4.58 18l1.06-1.05-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.42 1.41L10.59 12l-1.42-1.41 1.42-1.42 2.47 2.48 1.06-1.06-2.47-2.48 1.41-1.41 1.41 1.41 1.07-1.06-1.42-1.41 1.42-1.42L18 6.7l1.07-1.06-2.47-2.48 1.76-1.77 4.25 4.25L5.64 22.61l-4.25-4.25z"/></svg>',S}(c),ue=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.strokePanel.colors=K.defaultColorSet,P.fillColor="transparent",P}return B(S,M),Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=M.prototype.getState.call(this);return A.typeName=S.typeName,A},S.typeName="EllipseFrameMarker",S.title="Ellipse frame marker",S.icon='<svg viewBox="0 0 24 24"><path d="M12 6c4.41 0 8 2.69 8 6s-3.59 6-8 6-8-2.69-8-6 3.59-6 8-6m0-2C6.5 4 2 7.58 2 12s4.5 8 10 8 10-3.58 10-8-4.5-8-10-8z"/></svg>',S}(V),le=function(){function M(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(M.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),M.prototype.addUndoStep=function(S){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(S)||(this.undoStack.push(S),JSON.stringify(this.lastRedoStep)!==JSON.stringify(S)&&this.redoStack.splice(0,this.redoStack.length))},M.prototype.replaceLastUndoStep=function(S){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=S)},M.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},M.prototype.undo=function(){if(this.undoStack.length>1){var S=this.undoStack.pop();return S!==void 0&&this.redoStack.push(S),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},M.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},M}(),ge=function(M){function S(A,F,K){var P=M.call(this,A,F,K)||this;return P.strokeColor="transparent",P.strokeWidth=0,P.strokeDasharray="",P.curveX=0,P.curveY=0,P.manipulationStartCurveX=0,P.manipulationStartCurveY=0,P.setStrokeColor=P.setStrokeColor.bind(P),P.setStrokeWidth=P.setStrokeWidth.bind(P),P.setStrokeDasharray=P.setStrokeDasharray.bind(P),P.positionGrips=P.positionGrips.bind(P),P.addControlGrips=P.addControlGrips.bind(P),P.adjustVisual=P.adjustVisual.bind(P),P.setupControlBox=P.setupControlBox.bind(P),P.resize=P.resize.bind(P),P.strokeColor=K.defaultColor,P.strokeWidth=K.defaultStrokeWidth,P.strokeDasharray=K.defaultStrokeDasharray,P.strokePanel=new l("Line color",K.defaultColorSet,K.defaultColor),P.strokePanel.onColorChanged=P.setStrokeColor,P.strokeWidthPanel=new p("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),P.strokeWidthPanel.onWidthChanged=P.setStrokeWidth,P.strokeStylePanel=new _("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),P.strokeStylePanel.onStyleChanged=P.setStrokeDasharray,P}return B(S,M),S.prototype.ownsTarget=function(A){return!(!M.prototype.ownsTarget.call(this,A)&&A!==this.visual&&A!==this.selectorCurve&&A!==this.visibleCurve&&!this.curveGrip.ownsTarget(A))},S.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},S.prototype.createVisual=function(){this.visual=C.createGroup(),this.selectorCurve=C.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=C.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)},S.prototype.pointerDown=function(A,F){M.prototype.pointerDown.call(this,A,F),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=A.x,this.curveY=A.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(F)&&(this.activeGrip=this.curveGrip,this._state="resize")},S.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),C.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),C.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),C.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},S.prototype.setupControlBox=function(){M.prototype.setupControlBox.call(this),this.curveControlLine1=C.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=C.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)},S.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,M.prototype.addControlGrips.call(this)},S.prototype.positionGrips=function(){M.prototype.positionGrips.call(this);var A=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-A/2,this.curveY-A/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()))},S.prototype.manipulate=function(A){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+A.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+A.y-this.manipulationStartY),M.prototype.manipulate.call(this,A)},S.prototype.resize=function(A){this.activeGrip===this.curveGrip&&(this.curveX=A.x,this.curveY=A.y),M.prototype.resize.call(this,A),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},S.prototype.setStrokeColor=function(A){this.strokeColor=A,this.adjustVisual(),this.colorChanged(A)},S.prototype.setStrokeWidth=function(A){this.strokeWidth=A,this.adjustVisual()},S.prototype.setStrokeDasharray=function(A){this.strokeDasharray=A,this.adjustVisual()},S.prototype.scale=function(A,F){this.curveX=this.curveX*A,this.curveY=this.curveY*F,M.prototype.scale.call(this,A,F)},Object.defineProperty(S.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),S.prototype.getState=function(){var A=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},M.prototype.getState.call(this));return A.typeName=S.typeName,A},S.prototype.restoreState=function(A){M.prototype.restoreState.call(this,A);var F=A;this.strokeColor=F.strokeColor,this.strokeWidth=F.strokeWidth,this.strokeDasharray=F.strokeDasharray,this.curveX=F.curveX,this.curveY=F.curveY,this.createVisual(),this.adjustVisual()},S.typeName="CurveMarker",S.title="Curve marker",S.icon='<svg viewBox="0 0 24 24"><path d="M18.5 2A1.5 1.5 0 0120 3.5 1.5 1.5 0 0118.5 5c-.23 0-.45-.05-.65-.15l-3.69 3.7.34.45c2.19-1.26 4.76-2 7.5-2l1 .03v2.01L22 9c-2.58 0-5 .75-7 2.04A3.96 3.96 0 0111.04 15C9.75 17 9 19.42 9 22l.04 1H7.03L7 22c0-2.74.74-5.31 2-7.5l-.45-.34-3.7 3.69c.1.2.15.42.15.65A1.5 1.5 0 013.5 20 1.5 1.5 0 012 18.5 1.5 1.5 0 013.5 17c.23 0 .45.05.65.15l3.69-3.7C7.31 12.78 7 11.92 7 11a4 4 0 014-4c.92 0 1.78.31 2.45.84l3.7-3.69c-.1-.2-.15-.42-.15-.65A1.5 1.5 0 0118.5 2M11 9a2 2 0 00-2 2 2 2 0 002 2 2 2 0 002-2 2 2 0 00-2-2z"/></svg>',S}(h),pe=function(){function M(S,A){A===void 0&&(A=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=S,this.cancelable=A}return Object.defineProperty(M.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),M.prototype.preventDefault=function(){this._defaultPrevented=!0},M}(),ae=function(M){function S(A,F,K){var P=M.call(this,A,!1)||this;return P.dataUrl=F,P.state=K,P}return B(S,M),S}(pe),ne=function(M){function S(A,F,K){K===void 0&&(K=!1);var P=M.call(this,A,K)||this;return P.marker=F,P}return B(S,M),S}(pe),fe=function(){function M(){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 M.prototype.addEventListener=function(S,A){this[S].push(A)},M.prototype.removeEventListener=function(S,A){var F=this[S].indexOf(A);F>-1&&this[S].splice(F,1)},M}(),q=function(){function M(S){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new u,this._isOpen=!1,this.undoRedoManager=new le,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 fe,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=M.instanceCounter++,this.styles=new w(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=S,this.targetRoot=document.body,this.width=S.clientWidth,this.height=S.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(M.prototype,"ALL_MARKER_TYPES",{get:function(){return[b,y,D,E,ue,V,k,R,Z,L,c,ge]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[b,y,D,E,V,k,R]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"BASIC_MARKER_TYPES",{get:function(){return[b,y,D,E,k]},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(S){var A=this;this._availableMarkerTypes.splice(0),S.forEach(function(F){if(typeof F=="string"){var K=A.ALL_MARKER_TYPES.find(function(P){return P.typeName===F});K!==void 0&&A._availableMarkerTypes.push(K)}else A._availableMarkerTypes.push(F)})},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(M.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(S){this._zoomLevel=S,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(M.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),M.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),j.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},M.prototype.show=function(){var S=this;this.styles.styleSheetRoot===void 0&&e.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=e.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(A){return A(new pe(S))})},M.prototype.render=function(){return O(this,void 0,void 0,function(){var S;return H(this,function(A){switch(A.label){case 0:return this.setCurrentMarker(),(S=new N).naturalSize=this.renderAtNaturalSize,S.imageType=this.renderImageType,S.imageQuality=this.renderImageQuality,S.markersOnly=this.renderMarkersOnly,S.width=this.renderWidth,S.height=this.renderHeight,[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return A.sent(),[4,S.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,A.sent()]}})})},M.prototype.close=function(S){var A=this;if(S===void 0&&(S=!1),this.isOpen){var F=!1;S||this.eventListeners.beforeclose.forEach(function(K){var P=new pe(A,!0);K(P),P.defaultPrevented&&(F=!0)}),F||(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(K){return K(new pe(A))}),this.detachEvents(),this._isOpen=!1)}},M.prototype.addMarkersToToolbar=function(){for(var S,A=[],F=0;F<arguments.length;F++)A[F]=arguments[F];(S=this._availableMarkerTypes).push.apply(S,A)},M.prototype.addRenderEventListener=function(S){this.addEventListener("render",function(A){S(A.dataUrl,A.state)})},M.prototype.removeRenderEventListener=function(S){},M.prototype.addCloseEventListener=function(S){this.addEventListener("close",function(){S()})},M.prototype.removeCloseEventListener=function(S){},M.prototype.setupResizeObserver=function(){var S=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){S.resize(S.target.clientWidth,S.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return S.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},M.prototype.onPopupTargetResize=function(){var S=1*this.target.clientWidth/this.target.clientHeight,A=this.editorCanvas.clientWidth/S>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*S:this.editorCanvas.clientWidth,F=A<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/S;this.resize(A,F)},M.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},M.prototype.resize=function(S,A){this._isResizing=!0;var F=S/this.imageWidth,K=A/this.imageHeight;this.imageWidth=Math.round(S),this.imageHeight=Math.round(A),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px",this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.settings.displayMode!=="popup"?this.coverDiv.style.width=this.imageWidth.toString()+"px":(this.setTopLeft(),this.positionMarkerImage()),this.toolbar!==void 0&&this.toolbar.adjustLayout(),this.positionLogo(),this.scaleMarkers(F,K),this._isResizing=!1},M.prototype.scaleMarkers=function(S,A){var F,K=this;this._currentMarker&&this._currentMarker instanceof E?this._currentMarker.scale(S,A):(F=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(P){P!==K._currentMarker&&P.scale(S,A)}),F!==void 0&&this.setCurrentMarker(F)},M.prototype.setEditingTarget=function(){this.imageWidth=Math.round(this.target.clientWidth),this.imageHeight=Math.round(this.target.clientHeight),this.target instanceof HTMLImageElement&&this.editingTarget instanceof HTMLImageElement&&(this.editingTarget.src=this.target.src),this.editingTarget.width=this.imageWidth,this.editingTarget.height=this.imageHeight,this.editingTarget.style.width=this.imageWidth+"px",this.editingTarget.style.height=this.imageHeight+"px"},M.prototype.setTopLeft=function(){var S=this.editingTarget.getBoundingClientRect(),A=this.editorCanvas.getBoundingClientRect();this.left=S.left-A.left,this.top=S.top-A.top},M.prototype.initMarkerCanvas=function(){this.markerImageHolder=document.createElement("div"),this.markerImageHolder.style.setProperty("touch-action","pinch-zoom"),this.markerImage=document.createElementNS("http://www.w3.org/2000/svg","svg"),this.markerImage.setAttribute("xmlns","http://www.w3.org/2000/svg"),this.markerImage.setAttribute("width",this.imageWidth.toString()),this.markerImage.setAttribute("height",this.imageHeight.toString()),this.markerImage.setAttribute("viewBox","0 0 "+this.imageWidth.toString()+" "+this.imageHeight.toString()),this.markerImage.style.pointerEvents="auto",this.markerImageHolder.style.position="absolute",this.markerImageHolder.style.width=this.imageWidth+"px",this.markerImageHolder.style.height=this.imageHeight+"px",this.markerImageHolder.style.transformOrigin="top left",this.positionMarkerImage(),this.markerImageHolder.appendChild(this.markerImage),this.editorCanvas.appendChild(this.markerImageHolder)},M.prototype.addDefs=function(){for(var S,A=[],F=0;F<arguments.length;F++)A[F]=arguments[F];this.defs=C.createDefs(),this.addDefsToImage(),(S=this.defs).append.apply(S,A)},M.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},M.prototype.initOverlay=function(){this.overlayContainer=document.createElement("div"),this.overlayContainer.style.position="absolute",this.overlayContainer.style.left="0px",this.overlayContainer.style.top="0px",this.overlayContainer.style.width=this.imageWidth+"px",this.overlayContainer.style.height=this.imageHeight+"px",this.overlayContainer.style.display="flex",this.markerImageHolder.appendChild(this.overlayContainer)},M.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},M.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},M.prototype.attachWindowEvents=function(){window.addEventListener("pointermove",this.onPointerMove),window.addEventListener("pointerup",this.onPointerUp),window.addEventListener("pointercancel",this.onPointerOut),window.addEventListener("pointerout",this.onPointerOut),window.addEventListener("pointerleave",this.onPointerUp),window.addEventListener("resize",this.onWindowResize),window.addEventListener("keyup",this.onKeyUp)},M.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},M.prototype.detachWindowEvents=function(){window.removeEventListener("pointermove",this.onPointerMove),window.removeEventListener("pointerup",this.onPointerUp),window.removeEventListener("pointercancel",this.onPointerOut),window.removeEventListener("pointerout",this.onPointerOut),window.removeEventListener("pointerleave",this.onPointerUp),window.removeEventListener("resize",this.onWindowResize),window.removeEventListener("keyup",this.onKeyUp)},M.prototype.addLogo=function(){this.logoUI=document.createElement("div"),this.logoUI.style.display="inline-block",this.logoUI.style.margin="0px",this.logoUI.style.padding="0px",this.logoUI.style.fill="#333333";var S=document.createElement("a");S.href="https://markerjs.com/",S.target="_blank",S.innerHTML='<svg viewBox="0 0 112 96" xmlns="http://www.w3.org/2000/svg" fill-rule="evenodd" clip-rule="evenodd" stroke-linejoin="round" stroke-miterlimit="1.414"><path fill="#e5f20d" fill-opacity=".647" d="M0 40.386h111.96V95.62H0z"/><path d="M93.61 61.452c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.591 1.048-1.481 0-2.222-.74-2.222-2.22 0-16.617-.533-29.347-1.604-38.192-1.068-8.842-2.92-13.265-5.552-13.265-4.443 0-10.94 15.509-19.497 46.52v.124c0 .987-.328 1.831-.987 2.53-.657.7-1.52 1.048-2.592 1.048-1.48 0-2.22-.74-2.22-2.22 0-3.29.165-8.392.493-15.302.33-7.732.494-13.82.494-18.262 0-6.17-.186-10.55-.556-13.142-.37-2.591-1.172-3.887-2.406-3.887-2.796 0-6.333 5.12-10.612 15.363C38.494 34.367 34.01 46.44 29.32 60.34l-1.11 3.209a5.714 5.714 0 01-1.42 2.097c-.617.578-1.295.864-2.036.864-.987 0-1.644-.081-1.974-.247-.328-.162-.533-.656-.617-1.48-.41-4.03-.74-9.418-.987-16.165-.163-1.728-.329-4.566-.494-8.515-.822-13.901-1.562-23.3-2.221-28.196-.657-4.893-.987-7.628-.987-8.205 0-.657.33-1.44.987-2.345.659-.903 1.276-1.357 1.85-1.357 1.319 0 2.387.947 3.21 2.838.411.906.863 4.526 1.357 10.859.493 6.335.905 14.19 1.233 23.568l.617 18.88c4.527-13.983 9.216-26.673 14.068-38.068C45.65 6.686 50.093.988 54.123.988c2.715 0 4.566 1.974 5.553 5.923.987 3.949 1.481 9.667 1.481 17.152 0 3.949-.081 9.625-.247 17.029l-.123 5.676c3.373-11.762 6.725-21.634 10.057-29.615 3.331-7.979 6.685-11.97 10.056-11.97 8.475 0 12.71 18.757 12.71 56.269z" fill-rule="nonzero"/></svg>',S.title="Powered by marker.js",S.style.display="grid",S.style.alignItems="center",S.style.justifyItems="center",S.style.padding="3px",S.style.width="20px",S.style.height="20px",this.logoUI.appendChild(S),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},M.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")},M.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"},M.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},M.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 S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"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 o(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<this.styles.settings.toolbarHeight&&(this.editingTarget.style.marginTop=this.target.offsetTop-this.styles.settings.toolbarHeight+"px"),this.editorCanvas.appendChild(this.editingTarget),this.toolbox=new n(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},M.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},M.prototype.removeMarker=function(S){this.markerImage.removeChild(S.container),this.markers.indexOf(S)>-1&&this.markers.splice(this.markers.indexOf(S),1),S.dispose()},M.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())},M.prototype.toolbarButtonClicked=function(S,A){if(S==="marker"&&A!==void 0)this.createNewMarker(A);else if(S==="action")switch(A){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()}},M.prototype.deleteSelectedMarker=function(){var S=this;if(this._currentMarker!==void 0){var A=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var P=new ne(S,S._currentMarker,!0);K(P),P.defaultPrevented&&(A=!0)}),!A){var F=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(K){return K(new ne(S,F))})}}},M.prototype.clear=function(){var S=this,A=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(re){var he=new ne(S,void 0,!0);re(he),he.defaultPrevented&&(A=!0)}),!A)){this.setCurrentMarker();for(var F=function(re){var he=K.markers[re];K.setCurrentMarker(K.markers[re]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(ye){return ye(new ne(S,he))})},K=this,P=this.markers.length-1;P>=0;P--)F(P);this.addUndoStep()}},Object.defineProperty(M.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),M.prototype.showNotesEditor=function(){var S;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=(S=this._currentMarker.notes)!==null&&S!==void 0?S:"",this.overlayContainer.appendChild(this.notesArea))},M.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)},M.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},M.prototype.addUndoStep=function(){var S=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var A=this.getState(),F=this.undoRedoManager.getLastUndoStep();if(!F||F.width===A.width&&F.height===A.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(A),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(P){return P(new pe(S))})}else this.undoRedoManager.replaceLastUndoStep(A),this.eventListeners.statechange.forEach(function(P){return P(new pe(S))})}},M.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},M.prototype.undoStep=function(){var S=this,A=this.undoRedoManager.undo();A!==void 0&&(this.restoreState(A),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new pe(S))}))},M.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},M.prototype.redoStep=function(){var S=this,A=this.undoRedoManager.redo();A!==void 0&&(this.restoreState(A),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(F){return F(new pe(S))}))},M.prototype.stepZoom=function(){var S=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=S<this.zoomSteps.length-1?this.zoomSteps[S+1]:this.zoomSteps[0]},M.prototype.panTo=function(S){this.contentDiv.scrollBy({left:this.prevPanPoint.x-S.x,top:this.prevPanPoint.y-S.y}),this.prevPanPoint=S},M.prototype.startRenderAndClose=function(){return O(this,void 0,void 0,function(){var S,A,F=this;return H(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return S=K.sent(),A=this.getState(),this.eventListeners.render.forEach(function(P){return P(new ae(F,S,A))}),this.close(!0),[2]}})})},M.prototype.getState=function(S){S===!0&&this.setCurrentMarker();var A={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(F){return A.markers.push(F.getState())}),A},M.prototype.restoreState=function(S){var A=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);S.markers.forEach(function(F){var K=A._availableMarkerTypes.find(function(re){return re.typeName===F.typeName});if(K!==void 0){var P=A.addNewMarker(K);P.restoreState(F),A.markers.push(P)}}),S.width&&S.height&&(S.width!==this.imageWidth||S.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/S.width,this.imageHeight/S.height),this.eventListeners.restorestate.forEach(function(F){return F(new pe(A))})},M.prototype.addNewMarker=function(S){var A=C.createGroup();return this.markerImage.appendChild(A),new S(A,this.overlayContainer,this.settings)},M.prototype.createNewMarker=function(S){var A,F=this;(A=typeof S=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===S}):S)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(A),this._currentMarker.onMarkerCreated=this.markerCreated,this._currentMarker.onColorChanged=this.colorChanged,this._currentMarker.onFillColorChanged=this.fillColorChanged,this._currentMarker.onStateChanged=this.markerStateChanged,this.markerImage.style.cursor="crosshair",this.toolbar.setActiveMarkerButton(A.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new ne(F,F._currentMarker))}))},M.prototype.markerCreated=function(S){var A=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(S),this.setCurrentMarker(S),S instanceof y&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(y):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(F){return F(new ne(A,A._currentMarker))})},M.prototype.colorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=S,this.settings.defaultStrokeColor=S)},M.prototype.fillColorChanged=function(S){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=S)},M.prototype.markerStateChanged=function(S){var A=this;this.eventListeners.markerchange.forEach(function(F){return F(new ne(A,S))})},M.prototype.setCurrentMarker=function(S){var A=this;this._currentMarker!==S&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(F){return F(new ne(A,A._currentMarker))})),this._currentMarker=S,this._currentMarker===void 0||this._currentMarker.isSelected||(this._currentMarker.state!=="new"&&this._currentMarker.select(),this.toolbar.setCurrentMarker(this._currentMarker),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this._isResizing||this.eventListeners.markerselect.forEach(function(F){return F(new ne(A,A._currentMarker))}))},M.prototype.onPointerDown=function(S){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||S.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var A=this.markers.find(function(F){return F.ownsTarget(S.target)});A!==void 0?(this.setCurrentMarker(A),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:S.clientX,y:S.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(S.clientX,S.clientY))},M.prototype.onDblClick=function(S){if(this._isFocused||this.focus(),this.mode==="select"){var A=this.markers.find(function(F){return F.ownsTarget(S.target)});A!==void 0&&A!==this._currentMarker&&this.setCurrentMarker(A),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(S.clientX,S.clientY),S.target):this.setCurrentMarker()}},M.prototype.onPointerMove=function(S){this.touchPoints!==1&&S.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||S.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(S.clientX,S.clientY)):this.zoomLevel>1&&this.panTo({x:S.clientX,y:S.clientY}))},M.prototype.onPointerUp=function(S){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(S.clientX,S.clientY)),this.isDragging=!1,this.addUndoStep()},M.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},M.prototype.onKeyUp=function(S){this._currentMarker===void 0||this.notesArea!==void 0||S.key!=="Delete"&&S.key!=="Backspace"||this.deleteSelectedMarker()},M.prototype.clientToLocalCoordinates=function(S,A){var F=this.markerImage.getBoundingClientRect();return{x:(S-F.left)/this.zoomLevel,y:(A-F.top)/this.zoomLevel}},M.prototype.onWindowResize=function(){this.positionUI()},M.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var S=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=S+"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()},M.prototype.addLicenseKey=function(S){j.addKey(S)},M.prototype.addEventListener=function(S,A){this.eventListeners.addEventListener(S,A)},M.prototype.removeEventListener=function(S,A){this.eventListeners.removeEventListener(S,A)},M.prototype.renderState=function(S){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(S),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(M.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),M.prototype.focus=function(){var S=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(A){return A(new pe(S))}))},M.prototype.blur=function(){var S=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(A){return A(new pe(S))}))},M.instanceCounter=0,M}()},T8No:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return j}),z.d(ce,"e",function(){return N}),z.d(ce,"c",function(){return c}),z.d(ce,"b",function(){return d}),z.d(ce,"d",function(){return E}),z.d(ce,"f",function(){return D});var oe=z("MNsG"),B=z("N0LK"),O=z("Cg/j");let H=oe.k||"";const I=new Map;I.set("false",!1),I.set("true",!0),I.set("isMac",oe.f),I.set("isLinux",oe.d),I.set("isWindows",oe.i),I.set("isWeb",oe.h),I.set("isMacNative",oe.f&&!oe.h),I.set("isEdge",H.indexOf("Edg/")>=0),I.set("isFirefox",H.indexOf("Firefox")>=0),I.set("isChrome",H.indexOf("Chrome")>=0),I.set("isSafari",H.indexOf("Safari")>=0);const C=Object.prototype.hasOwnProperty;class j{static has(x){return f.create(x)}static equals(x,k){return o.create(x,k)}static regex(x,k){return p.create(x,k)}static not(x){return s.create(x)}static and(...x){return u.create(x,null)}static or(...x){return h.create(x,null,!0)}static deserialize(x,k=!1){return x?this._deserializeOrExpression(x,k):void 0}static _deserializeOrExpression(x,k){let U=x.split("||");return h.create(U.map(R=>this._deserializeAndExpression(R,k)),null,!0)}static _deserializeAndExpression(x,k){let U=x.split("&&");return u.create(U.map(R=>this._deserializeOne(R,k)),null)}static _deserializeOne(x,k){if(x=x.trim(),x.indexOf("!=")>=0){let U=x.split("!=");return l.create(U[0].trim(),this._deserializeValue(U[1],k))}if(x.indexOf("==")>=0){let U=x.split("==");return o.create(U[0].trim(),this._deserializeValue(U[1],k))}if(x.indexOf("=~")>=0){let U=x.split("=~");return p.create(U[0].trim(),this._deserializeRegexValue(U[1],k))}if(x.indexOf(" in ")>=0){let U=x.split(" in ");return n.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const U=x.split(">=");return t.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const U=x.split(">");return r.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const U=x.split("<=");return m.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const U=x.split("<");return v.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(x)?s.create(x.substr(1).trim()):f.create(x)}static _deserializeValue(x,k){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let U=/^'([^']*)'$/.exec(x);return U?U[1].trim():x}static _deserializeRegexValue(x,k){if(Object(B.C)(x)){if(k)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=x.indexOf("/"),R=x.lastIndexOf("/");if(U===R||U<0){if(k)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let V=x.slice(U+1,R),Z=x[R+1]==="i"?"i":"";try{return new RegExp(V,Z)}catch(ue){if(k)throw new Error(`bad regexp-value '${x}', parse error: ${ue}`);return console.warn(`bad regexp-value '${x}', parse error: ${ue}`),null}}}function N(x,k){const U=x?x.substituteConstants():void 0,R=k?k.substituteConstants():void 0;return!U&&!R?!0:!U||!R?!1:U.equals(R)}function e(x,k){return x.cmp(k)}class w{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return g.INSTANCE}}w.INSTANCE=new w;class g{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return w.INSTANCE}}g.INSTANCE=new g;class f{constructor(x,k){this.key=x,this.negated=k,this.type=2}static create(x,k=null){const U=I.get(x);return typeof U=="boolean"?U?g.INSTANCE:w.INSTANCE:new f(x,k)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=I.get(this.key);return typeof x=="boolean"?x?g.INSTANCE:w.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=s.create(this.key,this)),this.negated}}class o{constructor(x,k,U){this.key=x,this.value=k,this.negated=U,this.type=4}static create(x,k,U=null){if(typeof k=="boolean")return k?f.create(x,U):s.create(x,U);const R=I.get(x);if(typeof R=="boolean"){const V=R?"true":"false";return k===V?g.INSTANCE:w.INSTANCE}return new o(x,k,U)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=I.get(this.key);if(typeof x=="boolean"){const k=x?"true":"false";return this.value===k?g.INSTANCE:w.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class n{constructor(x,k){this.key=x,this.valueKey=k,this.type=10,this.negated=null}static create(x,k){return new n(x,k)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const k=x.getValue(this.valueKey),U=x.getValue(this.key);return Array.isArray(k)?k.indexOf(U)>=0:typeof U=="string"&&typeof k=="object"&&k!==null?C.call(k,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=a.create(this)),this.negated}}class a{constructor(x){this._actual=x,this.type=11}static create(x){return new a(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class l{constructor(x,k,U){this.key=x,this.value=k,this.negated=U,this.type=5}static create(x,k,U=null){if(typeof k=="boolean")return k?s.create(x,U):f.create(x,U);const R=I.get(x);if(typeof R=="boolean"){const V=R?"true":"false";return k===V?w.INSTANCE:g.INSTANCE}return new l(x,k,U)}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=I.get(this.key);if(typeof x=="boolean"){const k=x?"true":"false";return this.value===k?w.INSTANCE:g.INSTANCE}return this}evaluate(x){return x.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class s{constructor(x,k){this.key=x,this.negated=k,this.type=3}static create(x,k=null){const U=I.get(x);return typeof U=="boolean"?U?w.INSTANCE:g.INSTANCE:new s(x,k)}cmp(x){return x.type!==this.type?this.type-x.type:y(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=I.get(this.key);return typeof x=="boolean"?x?w.INSTANCE:g.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=f.create(this.key,this)),this.negated}}function i(x,k){if(typeof x=="string"){const U=parseFloat(x);isNaN(U)||(x=U)}return typeof x=="string"||typeof x=="number"?k(x):w.INSTANCE}class r{constructor(x,k,U){this.key=x,this.value=k,this.negated=U,this.type=12}static create(x,k,U=null){return i(k,R=>new r(x,R,U))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.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 t{constructor(x,k,U){this.key=x,this.value=k,this.negated=U,this.type=13}static create(x,k,U=null){return i(k,R=>new t(x,R,U))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this.value,this)),this.negated}}class v{constructor(x,k,U){this.key=x,this.value=k,this.negated=U,this.type=14}static create(x,k,U=null){return i(k,R=>new v(x,R,U))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class m{constructor(x,k,U){this.key=x,this.value=k,this.negated=U,this.type=15}static create(x,k,U=null){return i(k,R=>new m(x,R,U))}cmp(x){return x.type!==this.type?this.type-x.type:T(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=r.create(this.key,this.value,this)),this.negated}}class p{constructor(x,k){this.key=x,this.regexp=k,this.type=7,this.negated=null}static create(x,k){return new p(x,k)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const k=this.regexp?this.regexp.source:"",U=x.regexp?x.regexp.source:"";return k<U?-1:k>U?1:0}equals(x){if(x.type===this.type){const k=this.regexp?this.regexp.source:"",U=x.regexp?x.regexp.source:"";return this.key===x.key&&k===U}return!1}substituteConstants(){return this}evaluate(x){let k=x.getValue(this.key);return this.regexp?this.regexp.test(k):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=_.create(this)),this.negated}}class _{constructor(x){this._actual=x,this.type=8}static create(x){return new _(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function b(x){let k=null;for(let U=0,R=x.length;U<R;U++){const V=x[U].substituteConstants();if(x[U]!==V&&k===null){k=[];for(let Z=0;Z<U;Z++)k[Z]=x[Z]}k!==null&&(k[U]=V)}return k===null?x:k}class u{constructor(x,k){this.expr=x,this.negated=k,this.type=6}static create(x,k){return u._normalizeArr(x,k)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let k=0,U=this.expr.length;k<U;k++){const R=e(this.expr[k],x.expr[k]);if(R!==0)return R}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let k=0,U=this.expr.length;k<U;k++)if(!this.expr[k].equals(x.expr[k]))return!1;return!0}return!1}substituteConstants(){const x=b(this.expr);return x===this.expr?this:u.create(x,this.negated)}evaluate(x){for(let k=0,U=this.expr.length;k<U;k++)if(!this.expr[k].evaluate(x))return!1;return!0}static _normalizeArr(x,k){const U=[];let R=!1;for(const V of x){if(!V)continue;if(V.type===1){R=!0;continue}if(V.type===0)return w.INSTANCE;if(V.type===6){U.push(...V.expr);continue}U.push(V)}if(U.length===0&&R)return g.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(e);for(let V=1;V<U.length;V++)U[V-1].equals(U[V])&&(U.splice(V,1),V--);if(U.length===1)return U[0];for(;U.length>1;){const V=U[U.length-1];if(V.type!==9)break;U.pop();const Z=U.pop(),ue=U.length===0,le=h.create(V.expr.map(ge=>u.create([ge,Z],null)),null,ue);le&&(U.push(le),U.sort(e))}return U.length===1?U[0]:new u(U,k)}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let k of this.expr)x.push(...k.keys());return x}negate(){if(!this.negated){const x=[];for(let k of this.expr)x.push(k.negate());this.negated=h.create(x,this,!0)}return this.negated}}class h{constructor(x,k){this.expr=x,this.negated=k,this.type=9}static create(x,k,U){return h._normalizeArr(x,k,U)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let k=0,U=this.expr.length;k<U;k++){const R=e(this.expr[k],x.expr[k]);if(R!==0)return R}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let k=0,U=this.expr.length;k<U;k++)if(!this.expr[k].equals(x.expr[k]))return!1;return!0}return!1}substituteConstants(){const x=b(this.expr);return x===this.expr?this:h.create(x,this.negated,!1)}evaluate(x){for(let k=0,U=this.expr.length;k<U;k++)if(this.expr[k].evaluate(x))return!0;return!1}static _normalizeArr(x,k,U){let R=[],V=!1;if(x){for(let Z=0,ue=x.length;Z<ue;Z++){const le=x[Z];if(!le)continue;if(le.type===0){V=!0;continue}if(le.type===1)return g.INSTANCE;if(le.type===9){R=R.concat(le.expr);continue}R.push(le)}if(R.length===0&&V)return w.INSTANCE;R.sort(e)}if(R.length===0)return;if(R.length===1)return R[0];for(let Z=1;Z<R.length;Z++)R[Z-1].equals(R[Z])&&(R.splice(Z,1),Z--);if(R.length===1)return R[0];if(U){for(let Z=0;Z<R.length;Z++)for(let ue=Z+1;ue<R.length;ue++)D(R[Z],R[ue])&&(R.splice(ue,1),ue--);if(R.length===1)return R[0]}return new h(R,k)}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let k of this.expr)x.push(...k.keys());return x}negate(){if(!this.negated){let x=[];for(let k of this.expr)x.push(k.negate());for(;x.length>1;){const k=x.shift(),U=x.shift(),R=[];for(const Z of L(k))for(const ue of L(U))R.push(u.create([Z,ue],null));const V=x.length===0;x.unshift(h.create(R,null,V))}this.negated=x[0]}return this.negated}}class c extends f{constructor(x,k,U){super(x,null);this._defaultValue=k,typeof U=="object"?c._info.push(Object.assign(Object.assign({},U),{key:x})):U!==!0&&c._info.push({key:x,description:U,type:k!=null?typeof k:void 0})}static all(){return c._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return o.create(this.key,x)}}c._info=[];const d=Object(O.c)("contextKeyService"),E="setContext";function y(x,k){return x<k?-1:x>k?1:0}function T(x,k,U,R){return x<U?-1:x>U?1:k<R?-1:k>R?1:0}function D(x,k){if(k.type===6&&x.type!==9&&x.type!==6){for(const V of k.expr)if(x.equals(V))return!0}const U=x.negate(),R=L(U).concat(L(k));R.sort(e);for(let V=0;V<R.length;V++){const Z=R[V],ue=Z.negate();for(let le=V+1;le<R.length;le++){const ge=R[le];if(ue.equals(ge))return!0}}return!1}function L(x){return x.type===9?x.expr:[x]}},TXwP:function(Fe,ce,z){var oe,B;(function(){var O;(function(){"use strict";var I=[,,function(e){function w(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=[]}w.prototype.clone_empty=function(){var o=new w(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},w.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},w.prototype.has_match=function(o){for(var n=this.__items.length-1;n>=0;n--)if(this.__items[n].match(o))return!0;return!1},w.prototype.set_indent=function(o,n){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=n||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},w.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)},w.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},w.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},w.prototype.is_empty=function(){return this.__items.length===0},w.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},w.prototype.push=function(o){this.__items.push(o);var n=o.lastIndexOf(`
`);n!==-1?this.__character_count=o.length-n:this.__character_count+=o.length},w.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},w.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},w.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},w.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},w.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 g(o,n){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)),n=n||"",o.indent_level>0&&(n=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=n,this.__base_string_length=n.length}g.prototype.get_indent_size=function(o,n){var a=this.__base_string_length;return n=n||0,o<0&&(a=0),a+=o*this.__indent_size,a+=n,a},g.prototype.get_indent_string=function(o,n){var a=this.__base_string;return n=n||0,o<0&&(o=0,a=""),n+=o*this.__indent_size,this.__ensure_cache(n),a+=this.__cache[n],a},g.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},g.prototype.__add_column=function(){var o=this.__cache.length,n=0,a="";this.__indent_size&&o>=this.__indent_size&&(n=Math.floor(o/this.__indent_size),o-=n*this.__indent_size,a=new Array(n+1).join(this.__indent_string)),o&&(a+=new Array(o+1).join(" ")),this.__cache.push(a)};function f(o,n){this.__indent_cache=new g(o,n),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 w(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}f.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},f.prototype.get_line_number=function(){return this.__lines.length},f.prototype.get_indent_string=function(o,n){return this.__indent_cache.get_indent_string(o,n)},f.prototype.get_indent_size=function(o,n){return this.__indent_cache.get_indent_size(o,n)},f.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},f.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},f.prototype.get_code=function(o){this.trim(!0);var n=this.current_line.pop();n&&(n[n.length-1]===`
`&&(n=n.replace(/\n+$/g,"")),this.current_line.push(n)),this._end_with_newline&&this.__add_outputline();var a=this.__lines.join(`
`);return o!==`
`&&(a=a.replace(/[\n]/g,o)),a},f.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},f.prototype.set_indent=function(o,n){return o=o||0,n=n||0,this.next_line.set_indent(o,n),this.__lines.length>1?(this.current_line.set_indent(o,n),!0):(this.current_line.set_indent(),!1)},f.prototype.add_raw_token=function(o){for(var n=0;n<o.newlines;n++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(o.whitespace_before),this.current_line.push(o.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},f.prototype.add_token=function(o){this.__add_space_before_token(),this.current_line.push(o),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},f.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},f.prototype.remove_indent=function(o){for(var n=this.__lines.length;o<n;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},f.prototype.trim=function(o){for(o=o===void 0?!1:o,this.current_line.trim();o&&this.__lines.length>1&&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},f.prototype.just_added_newline=function(){return this.current_line.is_empty()},f.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},f.prototype.ensure_empty_line_above=function(o,n){for(var a=this.__lines.length-2;a>=0;){var l=this.__lines[a];if(l.is_empty())break;if(l.item(0).indexOf(o)!==0&&l.item(-1)!==n){this.__lines.splice(a+1,0,new w(this)),this.previous_line=this.__lines[this.__lines.length-2];break}a--}},e.exports.Output=f},,,,function(e){function w(o,n){this.raw_options=g(o,n),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"])}w.prototype._get_array=function(o,n){var a=this.raw_options[o],l=n||[];return typeof a=="object"?a!==null&&typeof a.concat=="function"&&(l=a.concat()):typeof a=="string"&&(l=a.split(/[^a-zA-Z0-9_\/\-]+/)),l},w.prototype._get_boolean=function(o,n){var a=this.raw_options[o],l=a===void 0?!!n:!!a;return l},w.prototype._get_characters=function(o,n){var a=this.raw_options[o],l=n||"";return typeof a=="string"&&(l=a.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),l},w.prototype._get_number=function(o,n){var a=this.raw_options[o];n=parseInt(n,10),isNaN(n)&&(n=0);var l=parseInt(a,10);return isNaN(l)&&(l=n),l},w.prototype._get_selection=function(o,n,a){var l=this._get_selection_list(o,n,a);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
`+n+`
You passed in: '`+this.raw_options[o]+"'");return l[0]},w.prototype._get_selection_list=function(o,n,a){if(!n||n.length===0)throw new Error("Selection list cannot be empty.");if(a=a||[n[0]],!this._is_valid_selection(a,n))throw new Error("Invalid Default Value!");var l=this._get_array(o,a);if(!this._is_valid_selection(l,n))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
`+n+`
You passed in: '`+this.raw_options[o]+"'");return l},w.prototype._is_valid_selection=function(o,n){return o.length&&n.length&&!o.some(function(a){return n.indexOf(a)===-1})};function g(o,n){var a={};o=f(o);var l;for(l in o)l!==n&&(a[l]=o[l]);if(n&&o[n])for(l in o[n])a[l]=o[n][l];return a}function f(o){var n={},a;for(a in o){var l=a.replace(/-/g,"_");n[l]=o[a]}return n}e.exports.Options=w,e.exports.normalizeOpts=f,e.exports.mergeOpts=g},,function(e){var w=RegExp.prototype.hasOwnProperty("sticky");function g(f){this.__input=f||"",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<this.__input_length},g.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__input.charAt(this.__position),this.__position+=1),f},g.prototype.peek=function(f){var o=null;return f=f||0,f+=this.__position,f>=0&&f<this.__input_length&&(o=this.__input.charAt(f)),o},g.prototype.__match=function(f,o){f.lastIndex=o;var n=f.exec(this.__input);return n&&!(w&&f.sticky)&&(n.index!==o&&(n=null)),n},g.prototype.test=function(f,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(f,o):!1},g.prototype.testChar=function(f,o){var n=this.peek(o);return f.lastIndex=0,n!==null&&f.test(n)},g.prototype.match=function(f){var o=this.__match(f,this.__position);return o?this.__position+=o[0].length:o=null,o},g.prototype.read=function(f,o,n){var a="",l;return f&&(l=this.match(f),l&&(a+=l[0])),o&&(l||!f)&&(a+=this.readUntil(o,n)),a},g.prototype.readUntil=function(f,o){var n="",a=this.__position;f.lastIndex=this.__position;var l=f.exec(this.__input);return l?(a=l.index,o&&(a+=l[0].length)):a=this.__input_length,n=this.__input.substring(this.__position,a),this.__position=a,n},g.prototype.readUntilAfter=function(f){return this.readUntil(f,!0)},g.prototype.get_regexp=function(f,o){var n=null,a="g";return o&&w&&(a="y"),typeof f=="string"&&f!==""?n=new RegExp(f,a):f&&(n=new RegExp(f.source,a)),n},g.prototype.get_literal_regexp=function(f){return RegExp(f.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},g.prototype.peekUntilAfter=function(f){var o=this.__position,n=this.readUntilAfter(f);return this.__position=o,n},g.prototype.lookBack=function(f){var o=this.__position-1;return o>=f.length&&this.__input.substring(o-f.length,o).toLowerCase()===f},e.exports.InputScanner=g},,,,,function(e){function w(g,f){g=typeof g=="string"?g:g.source,f=typeof f=="string"?f:f.source,this.__directives_block_pattern=new RegExp(g+/ beautify( \w+[:]\w+)+ /.source+f,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(g+/\sbeautify\signore:end\s/.source+f,"g")}w.prototype.get_directives=function(g){if(!g.match(this.__directives_block_pattern))return null;var f={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(g);o;)f[o[1]]=o[2],o=this.__directive_pattern.exec(g);return f},w.prototype.readIgnored=function(g){return g.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=w},,function(e,w,g){var f=g(16).Beautifier,o=g(17).Options;function n(a,l){var s=new f(a,l);return s.beautify()}e.exports=n,e.exports.defaultOptions=function(){return new o}},function(e,w,g){var f=g(17).Options,o=g(2).Output,n=g(8).InputScanner,a=g(13).Directives,l=new a(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,r=/\s/,t=/(?:\s|\n)+/g,v=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function p(_,b){this._source_text=_||"",this._options=new f(b),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"]}p.prototype.eatString=function(_){var b="";for(this._ch=this._input.next();this._ch;){if(b+=this._ch,this._ch==="\\")b+=this._input.next();else if(_.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return b},p.prototype.eatWhitespace=function(_){for(var b=r.test(this._input.peek()),u=0;r.test(this._input.peek());)this._ch=this._input.next(),_&&this._ch===`
`&&((u===0||u<this._options.max_preserve_newlines)&&(u++,this._output.add_new_line(!0)));return b},p.prototype.foundNestedPseudoClass=function(){for(var _=0,b=1,u=this._input.peek(b);u;){if(u==="{")return!0;if(u==="(")_+=1;else if(u===")"){if(_===0)return!1;_-=1}else if(u===";"||u==="}")return!1;b++,u=this._input.peek(b)}return!1},p.prototype.print_string=function(_){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(_)},p.prototype.preserveSingleSpace=function(_){_&&(this._output.space_before_token=!0)},p.prototype.indent=function(){this._indentLevel++},p.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},p.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,b=this._options.eol;b==="auto"&&(b=`
`,_&&s.test(_||"")&&(b=_.match(s)[0])),_=_.replace(i,`
`);var u=_.match(/^[\t ]*/)[0];this._output=new o(this._options,u),this._input=new n(_),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var h=0,c=!1,d=!1,E=!1,y=!1,T=!1,D=!1,L=this._ch,x=!1,k,U,R;k=this._input.read(t),U=k!=="",R=L,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),L=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var V=this._input.read(v),Z=l.get_directives(V);Z&&Z.ignore==="start"&&(V+=l.readIgnored(this._input)),this.print_string(V),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(m)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(U),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var ue=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ue.match(/[ :]$/)&&(ue=this.eatString(": ").replace(/\s$/,""),this.print_string(ue),this._output.space_before_token=!0),ue=ue.replace(/\s$/,""),ue==="extend"?y=!0:ue==="import"&&(T=!0),ue in this.NESTED_AT_RULE?(this._nestedLevel+=1,ue in this.CONDITIONAL_GROUP_RULE&&(E=!0)):!c&&h===0&&ue.indexOf(":")!==-1&&(d=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(U),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")d&&(d=!1,this.outdent()),E?(E=!1,c=this._indentLevel>=this._nestedLevel):c=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&c&&(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)):(R==="("?this._output.space_before_token=!1:R!==","&&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(),R==="{"&&this._output.trim(!0),T=!1,y=!1,d&&(this.outdent(),d=!1),this.print_string(this._ch),c=!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 le=0;le<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;le++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[le])){x=!0;break}(c||E)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!y&&h===0?(this.print_string(":"),d||(d=!0,this._output.space_before_token=!0,this.eatWhitespace(!0),this.indent())):(this._input.lookBack(" ")&&(this._output.space_before_token=!0),this._input.peek()===":"?(this._ch=this._input.next(),this.print_string("::")):this.print_string(":"))}else if(this._ch==='"'||this._ch==="'"){var ge=R==='"'||R==="'";this.preserveSingleSpace(ge||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")x=!1,h===0?(d&&(this.outdent(),d=!1),y=!1,T=!1,this.print_string(this._ch),this.eatWhitespace(!0),this._input.peek()!=="/"&&this._output.add_new_line()):(this.print_string(this._ch),this.eatWhitespace(!0),this._output.space_before_token=!0);else if(this._ch==="(")if(this._input.lookBack("url"))this.print_string(this._ch),this.eatWhitespace(),h++,this.indent(),this._ch=this._input.next(),this._ch===")"||this._ch==='"'||this._ch==="'"?this._input.back():this._ch&&(this.print_string(this._ch+this.eatString(")")),h&&(h--,this.outdent()));else{var pe=!1;this._input.lookBack("with")&&(pe=!0),this.preserveSingleSpace(U||pe),this.print_string(this._ch),d&&R==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),D=!0):(this.eatWhitespace(),h++,this.indent())}else if(this._ch===")")h&&(h--,this.outdent()),D&&this._input.peek()===";"&&this._options.selector_separator_newline&&(D=!1,this.outdent(),this._output.add_new_line()),this.print_string(this._ch);else if(this._ch===",")this.print_string(this._ch),this.eatWhitespace(!0),this._options.selector_separator_newline&&(!d||D)&&h===0&&!T&&!y?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!d&&h===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&&r.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(U),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),r.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 ae=R==='"'||R==="'";this.preserveSingleSpace(ae||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&x&&this._output.add_new_line()}var ne=this._output.get_code(b);return ne},e.exports.Beautifier=p},function(e,w,g){var f=g(6).Options;function o(n){f.call(this,n,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var a=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||a;var l=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var s=0;s<l.length;s++)l[s]!=="expand"?this.brace_style="collapse":this.brace_style=l[s]}o.prototype=new f,e.exports.Options=o}],C={};function j(e){var w=C[e];if(w!==void 0)return w.exports;var g=C[e]={exports:{}};return I[e](g,g.exports,j),g.exports}var N=j(15);O=N})();var H=O;!(oe=[],B=function(){return{css_beautify:H}}.apply(ce,oe),B!==void 0&&(Fe.exports=B))})()},"U/Y8":function(Fe,ce,z){Fe.exports={flex_box_center:"flex_box_center___2aRVA",flex_space_between:"flex_space_between___12c3F",flex_box_vertical_center:"flex_box_vertical_center___30OYS",flex_box_center_end:"flex_box_center_end___12QBt",flex_box_column:"flex_box_column___t6urT",info:"info___2BaCz",bar:"bar___3Aega"}},Vhoy:function(Fe,ce,z){"use strict";z.d(ce,"d",function(){return H}),z.d(ce,"e",function(){return I}),z.d(ce,"c",function(){return C}),z.d(ce,"b",function(){return j}),z.d(ce,"a",function(){return N});var oe=z("MI8n");class B{constructor(){this._icons=new Map,this._onDidRegister=new oe.b}add(e){const w=this._icons.get(e.id);w?e.description?w.description=e.description:console.error(`Duplicate registration of codicon ${e.id}`):(this._icons.set(e.id,e),this._onDidRegister.fire(e))}get(e){return this._icons.get(e)}get all(){return this._icons.values()}get onDidRegister(){return this._onDidRegister.event}}const O=new B,H=O;function I(e,w){return new j(e,w)}function C(e){return e?e.replace(/\$\((.*?)\)/g,(w,g)=>` ${g} `).trim():""}class j{constructor(e,w,g){this.id=e,this.definition=w,this.description=g,O.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var N;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const w=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function g(n){if(n instanceof j)return["codicon","codicon-"+n.id];const a=w.exec(n.id);if(!a)return g(j.error);let[,l,s]=a;const i=["codicon","codicon-"+l];return s&&i.push("codicon-modifier-"+s.substr(1)),i}e.asClassNameArray=g;function f(n){return g(n).join(" ")}e.asClassName=f;function o(n){return"."+g(n).join(".")}e.asCSSSelector=o})(N||(N={})),function(e){e.add=new e("add",{fontCharacter:"\\ea60"}),e.plus=new e("plus",e.add.definition),e.gistNew=new e("gist-new",e.add.definition),e.repoCreate=new e("repo-create",e.add.definition),e.lightbulb=new e("lightbulb",{fontCharacter:"\\ea61"}),e.lightBulb=new e("light-bulb",{fontCharacter:"\\ea61"}),e.repo=new e("repo",{fontCharacter:"\\ea62"}),e.repoDelete=new e("repo-delete",{fontCharacter:"\\ea62"}),e.gistFork=new e("gist-fork",{fontCharacter:"\\ea63"}),e.repoForked=new e("repo-forked",{fontCharacter:"\\ea63"}),e.gitPullRequest=new e("git-pull-request",{fontCharacter:"\\ea64"}),e.gitPullRequestAbandoned=new e("git-pull-request-abandoned",{fontCharacter:"\\ea64"}),e.recordKeys=new e("record-keys",{fontCharacter:"\\ea65"}),e.keyboard=new e("keyboard",{fontCharacter:"\\ea65"}),e.tag=new e("tag",{fontCharacter:"\\ea66"}),e.tagAdd=new e("tag-add",{fontCharacter:"\\ea66"}),e.tagRemove=new e("tag-remove",{fontCharacter:"\\ea66"}),e.person=new e("person",{fontCharacter:"\\ea67"}),e.personFollow=new e("person-follow",{fontCharacter:"\\ea67"}),e.personOutline=new e("person-outline",{fontCharacter:"\\ea67"}),e.personFilled=new e("person-filled",{fontCharacter:"\\ea67"}),e.gitBranch=new e("git-branch",{fontCharacter:"\\ea68"}),e.gitBranchCreate=new e("git-branch-create",{fontCharacter:"\\ea68"}),e.gitBranchDelete=new e("git-branch-delete",{fontCharacter:"\\ea68"}),e.sourceControl=new e("source-control",{fontCharacter:"\\ea68"}),e.mirror=new e("mirror",{fontCharacter:"\\ea69"}),e.mirrorPublic=new e("mirror-public",{fontCharacter:"\\ea69"}),e.star=new e("star",{fontCharacter:"\\ea6a"}),e.starAdd=new e("star-add",{fontCharacter:"\\ea6a"}),e.starDelete=new e("star-delete",{fontCharacter:"\\ea6a"}),e.starEmpty=new e("star-empty",{fontCharacter:"\\ea6a"}),e.comment=new e("comment",{fontCharacter:"\\ea6b"}),e.commentAdd=new e("comment-add",{fontCharacter:"\\ea6b"}),e.alert=new e("alert",{fontCharacter:"\\ea6c"}),e.warning=new e("warning",{fontCharacter:"\\ea6c"}),e.search=new e("search",{fontCharacter:"\\ea6d"}),e.searchSave=new e("search-save",{fontCharacter:"\\ea6d"}),e.logOut=new e("log-out",{fontCharacter:"\\ea6e"}),e.signOut=new e("sign-out",{fontCharacter:"\\ea6e"}),e.logIn=new e("log-in",{fontCharacter:"\\ea6f"}),e.signIn=new e("sign-in",{fontCharacter:"\\ea6f"}),e.eye=new e("eye",{fontCharacter:"\\ea70"}),e.eyeUnwatch=new e("eye-unwatch",{fontCharacter:"\\ea70"}),e.eyeWatch=new e("eye-watch",{fontCharacter:"\\ea70"}),e.circleFilled=new e("circle-filled",{fontCharacter:"\\ea71"}),e.primitiveDot=new e("primitive-dot",{fontCharacter:"\\ea71"}),e.closeDirty=new e("close-dirty",{fontCharacter:"\\ea71"}),e.debugBreakpoint=new e("debug-breakpoint",{fontCharacter:"\\ea71"}),e.debugBreakpointDisabled=new e("debug-breakpoint-disabled",{fontCharacter:"\\ea71"}),e.debugHint=new e("debug-hint",{fontCharacter:"\\ea71"}),e.primitiveSquare=new e("primitive-square",{fontCharacter:"\\ea72"}),e.edit=new e("edit",{fontCharacter:"\\ea73"}),e.pencil=new e("pencil",{fontCharacter:"\\ea73"}),e.info=new e("info",{fontCharacter:"\\ea74"}),e.issueOpened=new e("issue-opened",{fontCharacter:"\\ea74"}),e.gistPrivate=new e("gist-private",{fontCharacter:"\\ea75"}),e.gitForkPrivate=new e("git-fork-private",{fontCharacter:"\\ea75"}),e.lock=new e("lock",{fontCharacter:"\\ea75"}),e.mirrorPrivate=new e("mirror-private",{fontCharacter:"\\ea75"}),e.close=new e("close",{fontCharacter:"\\ea76"}),e.removeClose=new e("remove-close",{fontCharacter:"\\ea76"}),e.x=new e("x",{fontCharacter:"\\ea76"}),e.repoSync=new e("repo-sync",{fontCharacter:"\\ea77"}),e.sync=new e("sync",{fontCharacter:"\\ea77"}),e.clone=new e("clone",{fontCharacter:"\\ea78"}),e.desktopDownload=new e("desktop-download",{fontCharacter:"\\ea78"}),e.beaker=new e("beaker",{fontCharacter:"\\ea79"}),e.microscope=new e("microscope",{fontCharacter:"\\ea79"}),e.vm=new e("vm",{fontCharacter:"\\ea7a"}),e.deviceDesktop=new e("device-desktop",{fontCharacter:"\\ea7a"}),e.file=new e("file",{fontCharacter:"\\ea7b"}),e.fileText=new e("file-text",{fontCharacter:"\\ea7b"}),e.more=new e("more",{fontCharacter:"\\ea7c"}),e.ellipsis=new e("ellipsis",{fontCharacter:"\\ea7c"}),e.kebabHorizontal=new e("kebab-horizontal",{fontCharacter:"\\ea7c"}),e.mailReply=new e("mail-reply",{fontCharacter:"\\ea7d"}),e.reply=new e("reply",{fontCharacter:"\\ea7d"}),e.organization=new e("organization",{fontCharacter:"\\ea7e"}),e.organizationFilled=new e("organization-filled",{fontCharacter:"\\ea7e"}),e.organizationOutline=new e("organization-outline",{fontCharacter:"\\ea7e"}),e.newFile=new e("new-file",{fontCharacter:"\\ea7f"}),e.fileAdd=new e("file-add",{fontCharacter:"\\ea7f"}),e.newFolder=new e("new-folder",{fontCharacter:"\\ea80"}),e.fileDirectoryCreate=new e("file-directory-create",{fontCharacter:"\\ea80"}),e.trash=new e("trash",{fontCharacter:"\\ea81"}),e.trashcan=new e("trashcan",{fontCharacter:"\\ea81"}),e.history=new e("history",{fontCharacter:"\\ea82"}),e.clock=new e("clock",{fontCharacter:"\\ea82"}),e.folder=new e("folder",{fontCharacter:"\\ea83"}),e.fileDirectory=new e("file-directory",{fontCharacter:"\\ea83"}),e.symbolFolder=new e("symbol-folder",{fontCharacter:"\\ea83"}),e.logoGithub=new e("logo-github",{fontCharacter:"\\ea84"}),e.markGithub=new e("mark-github",{fontCharacter:"\\ea84"}),e.github=new e("github",{fontCharacter:"\\ea84"}),e.terminal=new e("terminal",{fontCharacter:"\\ea85"}),e.console=new e("console",{fontCharacter:"\\ea85"}),e.repl=new e("repl",{fontCharacter:"\\ea85"}),e.zap=new e("zap",{fontCharacter:"\\ea86"}),e.symbolEvent=new e("symbol-event",{fontCharacter:"\\ea86"}),e.error=new e("error",{fontCharacter:"\\ea87"}),e.stop=new e("stop",{fontCharacter:"\\ea87"}),e.variable=new e("variable",{fontCharacter:"\\ea88"}),e.symbolVariable=new e("symbol-variable",{fontCharacter:"\\ea88"}),e.array=new e("array",{fontCharacter:"\\ea8a"}),e.symbolArray=new e("symbol-array",{fontCharacter:"\\ea8a"}),e.symbolModule=new e("symbol-module",{fontCharacter:"\\ea8b"}),e.symbolPackage=new e("symbol-package",{fontCharacter:"\\ea8b"}),e.symbolNamespace=new e("symbol-namespace",{fontCharacter:"\\ea8b"}),e.symbolObject=new e("symbol-object",{fontCharacter:"\\ea8b"}),e.symbolMethod=new e("symbol-method",{fontCharacter:"\\ea8c"}),e.symbolFunction=new e("symbol-function",{fontCharacter:"\\ea8c"}),e.symbolConstructor=new e("symbol-constructor",{fontCharacter:"\\ea8c"}),e.symbolBoolean=new e("symbol-boolean",{fontCharacter:"\\ea8f"}),e.symbolNull=new e("symbol-null",{fontCharacter:"\\ea8f"}),e.symbolNumeric=new e("symbol-numeric",{fontCharacter:"\\ea90"}),e.symbolNumber=new e("symbol-number",{fontCharacter:"\\ea90"}),e.symbolStructure=new e("symbol-structure",{fontCharacter:"\\ea91"}),e.symbolStruct=new e("symbol-struct",{fontCharacter:"\\ea91"}),e.symbolParameter=new e("symbol-parameter",{fontCharacter:"\\ea92"}),e.symbolTypeParameter=new e("symbol-type-parameter",{fontCharacter:"\\ea92"}),e.symbolKey=new e("symbol-key",{fontCharacter:"\\ea93"}),e.symbolText=new e("symbol-text",{fontCharacter:"\\ea93"}),e.symbolReference=new e("symbol-reference",{fontCharacter:"\\ea94"}),e.goToFile=new e("go-to-file",{fontCharacter:"\\ea94"}),e.symbolEnum=new e("symbol-enum",{fontCharacter:"\\ea95"}),e.symbolValue=new e("symbol-value",{fontCharacter:"\\ea95"}),e.symbolRuler=new e("symbol-ruler",{fontCharacter:"\\ea96"}),e.symbolUnit=new e("symbol-unit",{fontCharacter:"\\ea96"}),e.activateBreakpoints=new e("activate-breakpoints",{fontCharacter:"\\ea97"}),e.archive=new e("archive",{fontCharacter:"\\ea98"}),e.arrowBoth=new e("arrow-both",{fontCharacter:"\\ea99"}),e.arrowDown=new e("arrow-down",{fontCharacter:"\\ea9a"}),e.arrowLeft=new e("arrow-left",{fontCharacter:"\\ea9b"}),e.arrowRight=new e("arrow-right",{fontCharacter:"\\ea9c"}),e.arrowSmallDown=new e("arrow-small-down",{fontCharacter:"\\ea9d"}),e.arrowSmallLeft=new e("arrow-small-left",{fontCharacter:"\\ea9e"}),e.arrowSmallRight=new e("arrow-small-right",{fontCharacter:"\\ea9f"}),e.arrowSmallUp=new e("arrow-small-up",{fontCharacter:"\\eaa0"}),e.arrowUp=new e("arrow-up",{fontCharacter:"\\eaa1"}),e.bell=new e("bell",{fontCharacter:"\\eaa2"}),e.bold=new e("bold",{fontCharacter:"\\eaa3"}),e.book=new e("book",{fontCharacter:"\\eaa4"}),e.bookmark=new e("bookmark",{fontCharacter:"\\eaa5"}),e.debugBreakpointConditionalUnverified=new e("debug-breakpoint-conditional-unverified",{fontCharacter:"\\eaa6"}),e.debugBreakpointConditional=new e("debug-breakpoint-conditional",{fontCharacter:"\\eaa7"}),e.debugBreakpointConditionalDisabled=new e("debug-breakpoint-conditional-disabled",{fontCharacter:"\\eaa7"}),e.debugBreakpointDataUnverified=new e("debug-breakpoint-data-unverified",{fontCharacter:"\\eaa8"}),e.debugBreakpointData=new e("debug-breakpoint-data",{fontCharacter:"\\eaa9"}),e.debugBreakpointDataDisabled=new e("debug-breakpoint-data-disabled",{fontCharacter:"\\eaa9"}),e.debugBreakpointLogUnverified=new e("debug-breakpoint-log-unverified",{fontCharacter:"\\eaaa"}),e.debugBreakpointLog=new e("debug-breakpoint-log",{fontCharacter:"\\eaab"}),e.debugBreakpointLogDisabled=new e("debug-breakpoint-log-disabled",{fontCharacter:"\\eaab"}),e.briefcase=new e("briefcase",{fontCharacter:"\\eaac"}),e.broadcast=new e("broadcast",{fontCharacter:"\\eaad"}),e.browser=new e("browser",{fontCharacter:"\\eaae"}),e.bug=new e("bug",{fontCharacter:"\\eaaf"}),e.calendar=new e("calendar",{fontCharacter:"\\eab0"}),e.caseSensitive=new e("case-sensitive",{fontCharacter:"\\eab1"}),e.check=new e("check",{fontCharacter:"\\eab2"}),e.checklist=new e("checklist",{fontCharacter:"\\eab3"}),e.chevronDown=new e("chevron-down",{fontCharacter:"\\eab4"}),e.dropDownButton=new e("drop-down-button",e.chevronDown.definition),e.chevronLeft=new e("chevron-left",{fontCharacter:"\\eab5"}),e.chevronRight=new e("chevron-right",{fontCharacter:"\\eab6"}),e.chevronUp=new e("chevron-up",{fontCharacter:"\\eab7"}),e.chromeClose=new e("chrome-close",{fontCharacter:"\\eab8"}),e.chromeMaximize=new e("chrome-maximize",{fontCharacter:"\\eab9"}),e.chromeMinimize=new e("chrome-minimize",{fontCharacter:"\\eaba"}),e.chromeRestore=new e("chrome-restore",{fontCharacter:"\\eabb"}),e.circleOutline=new e("circle-outline",{fontCharacter:"\\eabc"}),e.debugBreakpointUnverified=new e("debug-breakpoint-unverified",{fontCharacter:"\\eabc"}),e.circleSlash=new e("circle-slash",{fontCharacter:"\\eabd"}),e.circuitBoard=new e("circuit-board",{fontCharacter:"\\eabe"}),e.clearAll=new e("clear-all",{fontCharacter:"\\eabf"}),e.clippy=new e("clippy",{fontCharacter:"\\eac0"}),e.closeAll=new e("close-all",{fontCharacter:"\\eac1"}),e.cloudDownload=new e("cloud-download",{fontCharacter:"\\eac2"}),e.cloudUpload=new e("cloud-upload",{fontCharacter:"\\eac3"}),e.code=new e("code",{fontCharacter:"\\eac4"}),e.collapseAll=new e("collapse-all",{fontCharacter:"\\eac5"}),e.colorMode=new e("color-mode",{fontCharacter:"\\eac6"}),e.commentDiscussion=new e("comment-discussion",{fontCharacter:"\\eac7"}),e.compareChanges=new e("compare-changes",{fontCharacter:"\\eafd"}),e.creditCard=new e("credit-card",{fontCharacter:"\\eac9"}),e.dash=new e("dash",{fontCharacter:"\\eacc"}),e.dashboard=new e("dashboard",{fontCharacter:"\\eacd"}),e.database=new e("database",{fontCharacter:"\\eace"}),e.debugContinue=new e("debug-continue",{fontCharacter:"\\eacf"}),e.debugDisconnect=new e("debug-disconnect",{fontCharacter:"\\ead0"}),e.debugPause=new e("debug-pause",{fontCharacter:"\\ead1"}),e.debugRestart=new e("debug-restart",{fontCharacter:"\\ead2"}),e.debugStart=new e("debug-start",{fontCharacter:"\\ead3"}),e.debugStepInto=new e("debug-step-into",{fontCharacter:"\\ead4"}),e.debugStepOut=new e("debug-step-out",{fontCharacter:"\\ead5"}),e.debugStepOver=new e("debug-step-over",{fontCharacter:"\\ead6"}),e.debugStop=new e("debug-stop",{fontCharacter:"\\ead7"}),e.debug=new e("debug",{fontCharacter:"\\ead8"}),e.deviceCameraVideo=new e("device-camera-video",{fontCharacter:"\\ead9"}),e.deviceCamera=new e("device-camera",{fontCharacter:"\\eada"}),e.deviceMobile=new e("device-mobile",{fontCharacter:"\\eadb"}),e.diffAdded=new e("diff-added",{fontCharacter:"\\eadc"}),e.diffIgnored=new e("diff-ignored",{fontCharacter:"\\eadd"}),e.diffModified=new e("diff-modified",{fontCharacter:"\\eade"}),e.diffRemoved=new e("diff-removed",{fontCharacter:"\\eadf"}),e.diffRenamed=new e("diff-renamed",{fontCharacter:"\\eae0"}),e.diff=new e("diff",{fontCharacter:"\\eae1"}),e.discard=new e("discard",{fontCharacter:"\\eae2"}),e.editorLayout=new e("editor-layout",{fontCharacter:"\\eae3"}),e.emptyWindow=new e("empty-window",{fontCharacter:"\\eae4"}),e.exclude=new e("exclude",{fontCharacter:"\\eae5"}),e.extensions=new e("extensions",{fontCharacter:"\\eae6"}),e.eyeClosed=new e("eye-closed",{fontCharacter:"\\eae7"}),e.fileBinary=new e("file-binary",{fontCharacter:"\\eae8"}),e.fileCode=new e("file-code",{fontCharacter:"\\eae9"}),e.fileMedia=new e("file-media",{fontCharacter:"\\eaea"}),e.filePdf=new e("file-pdf",{fontCharacter:"\\eaeb"}),e.fileSubmodule=new e("file-submodule",{fontCharacter:"\\eaec"}),e.fileSymlinkDirectory=new e("file-symlink-directory",{fontCharacter:"\\eaed"}),e.fileSymlinkFile=new e("file-symlink-file",{fontCharacter:"\\eaee"}),e.fileZip=new e("file-zip",{fontCharacter:"\\eaef"}),e.files=new e("files",{fontCharacter:"\\eaf0"}),e.filter=new e("filter",{fontCharacter:"\\eaf1"}),e.flame=new e("flame",{fontCharacter:"\\eaf2"}),e.foldDown=new e("fold-down",{fontCharacter:"\\eaf3"}),e.foldUp=new e("fold-up",{fontCharacter:"\\eaf4"}),e.fold=new e("fold",{fontCharacter:"\\eaf5"}),e.folderActive=new e("folder-active",{fontCharacter:"\\eaf6"}),e.folderOpened=new e("folder-opened",{fontCharacter:"\\eaf7"}),e.gear=new e("gear",{fontCharacter:"\\eaf8"}),e.gift=new e("gift",{fontCharacter:"\\eaf9"}),e.gistSecret=new e("gist-secret",{fontCharacter:"\\eafa"}),e.gist=new e("gist",{fontCharacter:"\\eafb"}),e.gitCommit=new e("git-commit",{fontCharacter:"\\eafc"}),e.gitCompare=new e("git-compare",{fontCharacter:"\\eafd"}),e.gitMerge=new e("git-merge",{fontCharacter:"\\eafe"}),e.githubAction=new e("github-action",{fontCharacter:"\\eaff"}),e.githubAlt=new e("github-alt",{fontCharacter:"\\eb00"}),e.globe=new e("globe",{fontCharacter:"\\eb01"}),e.grabber=new e("grabber",{fontCharacter:"\\eb02"}),e.graph=new e("graph",{fontCharacter:"\\eb03"}),e.gripper=new e("gripper",{fontCharacter:"\\eb04"}),e.heart=new e("heart",{fontCharacter:"\\eb05"}),e.home=new e("home",{fontCharacter:"\\eb06"}),e.horizontalRule=new e("horizontal-rule",{fontCharacter:"\\eb07"}),e.hubot=new e("hubot",{fontCharacter:"\\eb08"}),e.inbox=new e("inbox",{fontCharacter:"\\eb09"}),e.issueClosed=new e("issue-closed",{fontCharacter:"\\eba4"}),e.issueReopened=new e("issue-reopened",{fontCharacter:"\\eb0b"}),e.issues=new e("issues",{fontCharacter:"\\eb0c"}),e.italic=new e("italic",{fontCharacter:"\\eb0d"}),e.jersey=new e("jersey",{fontCharacter:"\\eb0e"}),e.json=new e("json",{fontCharacter:"\\eb0f"}),e.kebabVertical=new e("kebab-vertical",{fontCharacter:"\\eb10"}),e.key=new e("key",{fontCharacter:"\\eb11"}),e.law=new e("law",{fontCharacter:"\\eb12"}),e.lightbulbAutofix=new e("lightbulb-autofix",{fontCharacter:"\\eb13"}),e.linkExternal=new e("link-external",{fontCharacter:"\\eb14"}),e.link=new e("link",{fontCharacter:"\\eb15"}),e.listOrdered=new e("list-ordered",{fontCharacter:"\\eb16"}),e.listUnordered=new e("list-unordered",{fontCharacter:"\\eb17"}),e.liveShare=new e("live-share",{fontCharacter:"\\eb18"}),e.loading=new e("loading",{fontCharacter:"\\eb19"}),e.location=new e("location",{fontCharacter:"\\eb1a"}),e.mailRead=new e("mail-read",{fontCharacter:"\\eb1b"}),e.mail=new e("mail",{fontCharacter:"\\eb1c"}),e.markdown=new e("markdown",{fontCharacter:"\\eb1d"}),e.megaphone=new e("megaphone",{fontCharacter:"\\eb1e"}),e.mention=new e("mention",{fontCharacter:"\\eb1f"}),e.milestone=new e("milestone",{fontCharacter:"\\eb20"}),e.mortarBoard=new e("mortar-board",{fontCharacter:"\\eb21"}),e.move=new e("move",{fontCharacter:"\\eb22"}),e.multipleWindows=new e("multiple-windows",{fontCharacter:"\\eb23"}),e.mute=new e("mute",{fontCharacter:"\\eb24"}),e.noNewline=new e("no-newline",{fontCharacter:"\\eb25"}),e.note=new e("note",{fontCharacter:"\\eb26"}),e.octoface=new e("octoface",{fontCharacter:"\\eb27"}),e.openPreview=new e("open-preview",{fontCharacter:"\\eb28"}),e.package_=new e("package",{fontCharacter:"\\eb29"}),e.paintcan=new e("paintcan",{fontCharacter:"\\eb2a"}),e.pin=new e("pin",{fontCharacter:"\\eb2b"}),e.play=new e("play",{fontCharacter:"\\eb2c"}),e.run=new e("run",{fontCharacter:"\\eb2c"}),e.plug=new e("plug",{fontCharacter:"\\eb2d"}),e.preserveCase=new e("preserve-case",{fontCharacter:"\\eb2e"}),e.preview=new e("preview",{fontCharacter:"\\eb2f"}),e.project=new e("project",{fontCharacter:"\\eb30"}),e.pulse=new e("pulse",{fontCharacter:"\\eb31"}),e.question=new e("question",{fontCharacter:"\\eb32"}),e.quote=new e("quote",{fontCharacter:"\\eb33"}),e.radioTower=new e("radio-tower",{fontCharacter:"\\eb34"}),e.reactions=new e("reactions",{fontCharacter:"\\eb35"}),e.references=new e("references",{fontCharacter:"\\eb36"}),e.refresh=new e("refresh",{fontCharacter:"\\eb37"}),e.regex=new e("regex",{fontCharacter:"\\eb38"}),e.remoteExplorer=new e("remote-explorer",{fontCharacter:"\\eb39"}),e.remote=new e("remote",{fontCharacter:"\\eb3a"}),e.remove=new e("remove",{fontCharacter:"\\eb3b"}),e.replaceAll=new e("replace-all",{fontCharacter:"\\eb3c"}),e.replace=new e("replace",{fontCharacter:"\\eb3d"}),e.repoClone=new e("repo-clone",{fontCharacter:"\\eb3e"}),e.repoForcePush=new e("repo-force-push",{fontCharacter:"\\eb3f"}),e.repoPull=new e("repo-pull",{fontCharacter:"\\eb40"}),e.repoPush=new e("repo-push",{fontCharacter:"\\eb41"}),e.report=new e("report",{fontCharacter:"\\eb42"}),e.requestChanges=new e("request-changes",{fontCharacter:"\\eb43"}),e.rocket=new e("rocket",{fontCharacter:"\\eb44"}),e.rootFolderOpened=new e("root-folder-opened",{fontCharacter:"\\eb45"}),e.rootFolder=new e("root-folder",{fontCharacter:"\\eb46"}),e.rss=new e("rss",{fontCharacter:"\\eb47"}),e.ruby=new e("ruby",{fontCharacter:"\\eb48"}),e.saveAll=new e("save-all",{fontCharacter:"\\eb49"}),e.saveAs=new e("save-as",{fontCharacter:"\\eb4a"}),e.save=new e("save",{fontCharacter:"\\eb4b"}),e.screenFull=new e("screen-full",{fontCharacter:"\\eb4c"}),e.screenNormal=new e("screen-normal",{fontCharacter:"\\eb4d"}),e.searchStop=new e("search-stop",{fontCharacter:"\\eb4e"}),e.server=new e("server",{fontCharacter:"\\eb50"}),e.settingsGear=new e("settings-gear",{fontCharacter:"\\eb51"}),e.settings=new e("settings",{fontCharacter:"\\eb52"}),e.shield=new e("shield",{fontCharacter:"\\eb53"}),e.smiley=new e("smiley",{fontCharacter:"\\eb54"}),e.sortPrecedence=new e("sort-precedence",{fontCharacter:"\\eb55"}),e.splitHorizontal=new e("split-horizontal",{fontCharacter:"\\eb56"}),e.splitVertical=new e("split-vertical",{fontCharacter:"\\eb57"}),e.squirrel=new e("squirrel",{fontCharacter:"\\eb58"}),e.starFull=new e("star-full",{fontCharacter:"\\eb59"}),e.starHalf=new e("star-half",{fontCharacter:"\\eb5a"}),e.symbolClass=new e("symbol-class",{fontCharacter:"\\eb5b"}),e.symbolColor=new e("symbol-color",{fontCharacter:"\\eb5c"}),e.symbolConstant=new e("symbol-constant",{fontCharacter:"\\eb5d"}),e.symbolEnumMember=new e("symbol-enum-member",{fontCharacter:"\\eb5e"}),e.symbolField=new e("symbol-field",{fontCharacter:"\\eb5f"}),e.symbolFile=new e("symbol-file",{fontCharacter:"\\eb60"}),e.symbolInterface=new e("symbol-interface",{fontCharacter:"\\eb61"}),e.symbolKeyword=new e("symbol-keyword",{fontCharacter:"\\eb62"}),e.symbolMisc=new e("symbol-misc",{fontCharacter:"\\eb63"}),e.symbolOperator=new e("symbol-operator",{fontCharacter:"\\eb64"}),e.symbolProperty=new e("symbol-property",{fontCharacter:"\\eb65"}),e.wrench=new e("wrench",{fontCharacter:"\\eb65"}),e.wrenchSubaction=new e("wrench-subaction",{fontCharacter:"\\eb65"}),e.symbolSnippet=new e("symbol-snippet",{fontCharacter:"\\eb66"}),e.tasklist=new e("tasklist",{fontCharacter:"\\eb67"}),e.telescope=new e("telescope",{fontCharacter:"\\eb68"}),e.textSize=new e("text-size",{fontCharacter:"\\eb69"}),e.threeBars=new e("three-bars",{fontCharacter:"\\eb6a"}),e.thumbsdown=new e("thumbsdown",{fontCharacter:"\\eb6b"}),e.thumbsup=new e("thumbsup",{fontCharacter:"\\eb6c"}),e.tools=new e("tools",{fontCharacter:"\\eb6d"}),e.triangleDown=new e("triangle-down",{fontCharacter:"\\eb6e"}),e.triangleLeft=new e("triangle-left",{fontCharacter:"\\eb6f"}),e.triangleRight=new e("triangle-right",{fontCharacter:"\\eb70"}),e.triangleUp=new e("triangle-up",{fontCharacter:"\\eb71"}),e.twitter=new e("twitter",{fontCharacter:"\\eb72"}),e.unfold=new e("unfold",{fontCharacter:"\\eb73"}),e.unlock=new e("unlock",{fontCharacter:"\\eb74"}),e.unmute=new e("unmute",{fontCharacter:"\\eb75"}),e.unverified=new e("unverified",{fontCharacter:"\\eb76"}),e.verified=new e("verified",{fontCharacter:"\\eb77"}),e.versions=new e("versions",{fontCharacter:"\\eb78"}),e.vmActive=new e("vm-active",{fontCharacter:"\\eb79"}),e.vmOutline=new e("vm-outline",{fontCharacter:"\\eb7a"}),e.vmRunning=new e("vm-running",{fontCharacter:"\\eb7b"}),e.watch=new e("watch",{fontCharacter:"\\eb7c"}),e.whitespace=new e("whitespace",{fontCharacter:"\\eb7d"}),e.wholeWord=new e("whole-word",{fontCharacter:"\\eb7e"}),e.window=new e("window",{fontCharacter:"\\eb7f"}),e.wordWrap=new e("word-wrap",{fontCharacter:"\\eb80"}),e.zoomIn=new e("zoom-in",{fontCharacter:"\\eb81"}),e.zoomOut=new e("zoom-out",{fontCharacter:"\\eb82"}),e.listFilter=new e("list-filter",{fontCharacter:"\\eb83"}),e.listFlat=new e("list-flat",{fontCharacter:"\\eb84"}),e.listSelection=new e("list-selection",{fontCharacter:"\\eb85"}),e.selection=new e("selection",{fontCharacter:"\\eb85"}),e.listTree=new e("list-tree",{fontCharacter:"\\eb86"}),e.debugBreakpointFunctionUnverified=new e("debug-breakpoint-function-unverified",{fontCharacter:"\\eb87"}),e.debugBreakpointFunction=new e("debug-breakpoint-function",{fontCharacter:"\\eb88"}),e.debugBreakpointFunctionDisabled=new e("debug-breakpoint-function-disabled",{fontCharacter:"\\eb88"}),e.debugStackframeActive=new e("debug-stackframe-active",{fontCharacter:"\\eb89"}),e.debugStackframeDot=new e("debug-stackframe-dot",{fontCharacter:"\\eb8a"}),e.debugStackframe=new e("debug-stackframe",{fontCharacter:"\\eb8b"}),e.debugStackframeFocused=new e("debug-stackframe-focused",{fontCharacter:"\\eb8b"}),e.debugBreakpointUnsupported=new e("debug-breakpoint-unsupported",{fontCharacter:"\\eb8c"}),e.symbolString=new e("symbol-string",{fontCharacter:"\\eb8d"}),e.debugReverseContinue=new e("debug-reverse-continue",{fontCharacter:"\\eb8e"}),e.debugStepBack=new e("debug-step-back",{fontCharacter:"\\eb8f"}),e.debugRestartFrame=new e("debug-restart-frame",{fontCharacter:"\\eb90"}),e.callIncoming=new e("call-incoming",{fontCharacter:"\\eb92"}),e.callOutgoing=new e("call-outgoing",{fontCharacter:"\\eb93"}),e.menu=new e("menu",{fontCharacter:"\\eb94"}),e.expandAll=new e("expand-all",{fontCharacter:"\\eb95"}),e.feedback=new e("feedback",{fontCharacter:"\\eb96"}),e.groupByRefType=new e("group-by-ref-type",{fontCharacter:"\\eb97"}),e.ungroupByRefType=new e("ungroup-by-ref-type",{fontCharacter:"\\eb98"}),e.account=new e("account",{fontCharacter:"\\eb99"}),e.bellDot=new e("bell-dot",{fontCharacter:"\\eb9a"}),e.debugConsole=new e("debug-console",{fontCharacter:"\\eb9b"}),e.library=new e("library",{fontCharacter:"\\eb9c"}),e.output=new e("output",{fontCharacter:"\\eb9d"}),e.runAll=new e("run-all",{fontCharacter:"\\eb9e"}),e.syncIgnored=new e("sync-ignored",{fontCharacter:"\\eb9f"}),e.pinned=new e("pinned",{fontCharacter:"\\eba0"}),e.githubInverted=new e("github-inverted",{fontCharacter:"\\eba1"}),e.debugAlt=new e("debug-alt",{fontCharacter:"\\eb91"}),e.serverProcess=new e("server-process",{fontCharacter:"\\eba2"}),e.serverEnvironment=new e("server-environment",{fontCharacter:"\\eba3"}),e.pass=new e("pass",{fontCharacter:"\\eba4"}),e.stopCircle=new e("stop-circle",{fontCharacter:"\\eba5"}),e.playCircle=new e("play-circle",{fontCharacter:"\\eba6"}),e.record=new e("record",{fontCharacter:"\\eba7"}),e.debugAltSmall=new e("debug-alt-small",{fontCharacter:"\\eba8"}),e.vmConnect=new e("vm-connect",{fontCharacter:"\\eba9"}),e.cloud=new e("cloud",{fontCharacter:"\\ebaa"}),e.merge=new e("merge",{fontCharacter:"\\ebab"}),e.exportIcon=new e("export",{fontCharacter:"\\ebac"}),e.graphLeft=new e("graph-left",{fontCharacter:"\\ebad"}),e.magnet=new e("magnet",{fontCharacter:"\\ebae"}),e.notebook=new e("notebook",{fontCharacter:"\\ebaf"}),e.redo=new e("redo",{fontCharacter:"\\ebb0"}),e.checkAll=new e("check-all",{fontCharacter:"\\ebb1"}),e.pinnedDirty=new e("pinned-dirty",{fontCharacter:"\\ebb2"}),e.passFilled=new e("pass-filled",{fontCharacter:"\\ebb3"}),e.circleLargeFilled=new e("circle-large-filled",{fontCharacter:"\\ebb4"}),e.circleLargeOutline=new e("circle-large-outline",{fontCharacter:"\\ebb5"}),e.combine=new e("combine",{fontCharacter:"\\ebb6"}),e.gather=new e("gather",{fontCharacter:"\\ebb6"}),e.table=new e("table",{fontCharacter:"\\ebb7"}),e.variableGroup=new e("variable-group",{fontCharacter:"\\ebb8"}),e.typeHierarchy=new e("type-hierarchy",{fontCharacter:"\\ebb9"}),e.typeHierarchySub=new e("type-hierarchy-sub",{fontCharacter:"\\ebba"}),e.typeHierarchySuper=new e("type-hierarchy-super",{fontCharacter:"\\ebbb"}),e.gitPullRequestCreate=new e("git-pull-request-create",{fontCharacter:"\\ebbc"}),e.runAbove=new e("run-above",{fontCharacter:"\\ebbd"}),e.runBelow=new e("run-below",{fontCharacter:"\\ebbe"}),e.notebookTemplate=new e("notebook-template",{fontCharacter:"\\ebbf"}),e.debugRerun=new e("debug-rerun",{fontCharacter:"\\ebc0"}),e.workspaceTrusted=new e("workspace-trusted",{fontCharacter:"\\ebc1"}),e.workspaceUntrusted=new e("workspace-untrusted",{fontCharacter:"\\ebc2"}),e.workspaceUnspecified=new e("workspace-unspecified",{fontCharacter:"\\ebc3"}),e.terminalCmd=new e("terminal-cmd",{fontCharacter:"\\ebc4"}),e.terminalDebian=new e("terminal-debian",{fontCharacter:"\\ebc5"}),e.terminalLinux=new e("terminal-linux",{fontCharacter:"\\ebc6"}),e.terminalPowershell=new e("terminal-powershell",{fontCharacter:"\\ebc7"}),e.terminalTmux=new e("terminal-tmux",{fontCharacter:"\\ebc8"}),e.terminalUbuntu=new e("terminal-ubuntu",{fontCharacter:"\\ebc9"}),e.terminalBash=new e("terminal-bash",{fontCharacter:"\\ebca"}),e.arrowSwap=new e("arrow-swap",{fontCharacter:"\\ebcb"}),e.copy=new e("copy",{fontCharacter:"\\ebcc"}),e.personAdd=new e("person-add",{fontCharacter:"\\ebcd"}),e.filterFilled=new e("filter-filled",{fontCharacter:"\\ebce"}),e.wand=new e("wand",{fontCharacter:"\\ebcf"}),e.debugLineByLine=new e("debug-line-by-line",{fontCharacter:"\\ebd0"}),e.inspect=new e("inspect",{fontCharacter:"\\ebd1"}),e.layers=new e("layers",{fontCharacter:"\\ebd2"}),e.layersDot=new e("layers-dot",{fontCharacter:"\\ebd3"}),e.layersActive=new e("layers-active",{fontCharacter:"\\ebd4"}),e.compass=new e("compass",{fontCharacter:"\\ebd5"}),e.compassDot=new e("compass-dot",{fontCharacter:"\\ebd6"}),e.compassActive=new e("compass-active",{fontCharacter:"\\ebd7"}),e.azure=new e("azure",{fontCharacter:"\\ebd8"}),e.issueDraft=new e("issue-draft",{fontCharacter:"\\ebd9"}),e.gitPullRequestClosed=new e("git-pull-request-closed",{fontCharacter:"\\ebda"}),e.gitPullRequestDraft=new e("git-pull-request-draft",{fontCharacter:"\\ebdb"}),e.debugAll=new e("debug-all",{fontCharacter:"\\ebdc"}),e.debugCoverage=new e("debug-coverage",{fontCharacter:"\\ebdd"}),e.runErrors=new e("run-errors",{fontCharacter:"\\ebde"}),e.folderLibrary=new e("folder-library",{fontCharacter:"\\ebdf"}),e.debugContinueSmall=new e("debug-continue-small",{fontCharacter:"\\ebe0"}),e.beakerStop=new e("beaker-stop",{fontCharacter:"\\ebe1"}),e.graphLine=new e("graph-line",{fontCharacter:"\\ebe2"}),e.graphScatter=new e("graph-scatter",{fontCharacter:"\\ebe3"}),e.pieChart=new e("pie-chart",{fontCharacter:"\\ebe4"}),e.bracket=new e("bracket",e.json.definition),e.bracketDot=new e("bracket-dot",{fontCharacter:"\\ebe5"}),e.bracketError=new e("bracket-error",{fontCharacter:"\\ebe6"}),e.lockSmall=new e("lock-small",{fontCharacter:"\\ebe7"}),e.azureDevops=new e("azure-devops",{fontCharacter:"\\ebe8"}),e.verifiedFilled=new e("verified-filled",{fontCharacter:"\\ebe9"})}(j||(j={}))},WaYH:function(Fe,ce,z){"use strict";var oe=z("rePB"),B=z("Ff2n"),O=z("VTBJ"),H=z("1OyB"),I=z("vuIU"),C=z("JX7q"),j=z("Ji7U"),N=z("LK+K"),e=z("q1tI"),w=z("TSYQ"),g=z.n(w),f=z("sboe"),o=z("OZM5"),n=function(_){var b=_.prefixCls,u=_.level,h=_.isStart,c=_.isEnd;if(!u)return null;for(var d="".concat(b,"-indent-unit"),E=[],y=0;y<u;y+=1){var T;E.push(e.createElement("span",{key:y,className:g()(d,(T={},Object(oe.a)(T,"".concat(d,"-start"),h[y+1]),Object(oe.a)(T,"".concat(d,"-end"),c[y+1]),Object(oe.a)(T,"".concat(d,"-end-first-level"),!y&&c[0]),T))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(b,"-indent")},E)},a=n,l=z("815F"),s="open",i="close",r="---",t=function(p){Object(j.a)(b,p);var _=Object(N.a)(b);function b(){var u;return Object(H.a)(this,b),u=_.apply(this,arguments),u.state={dragNodeHighlight:!1},u.onSelectorClick=function(h){var c=u.props.context.onNodeClick;c(h,Object(l.b)(u.props)),u.isSelectable()?u.onSelect(h):u.onCheck(h)},u.onSelectorDoubleClick=function(h){var c=u.props.context.onNodeDoubleClick;c(h,Object(l.b)(u.props))},u.onSelect=function(h){if(u.isDisabled())return;var c=u.props.context.onNodeSelect;h.preventDefault(),c(h,Object(l.b)(u.props))},u.onCheck=function(h){if(u.isDisabled())return;var c=u.props,d=c.disableCheckbox,E=c.checked,y=u.props.context.onNodeCheck;if(!u.isCheckable()||d)return;h.preventDefault();var T=!E;y(h,Object(l.b)(u.props),T)},u.onMouseEnter=function(h){var c=u.props.context.onNodeMouseEnter;c(h,Object(l.b)(u.props))},u.onMouseLeave=function(h){var c=u.props.context.onNodeMouseLeave;c(h,Object(l.b)(u.props))},u.onContextMenu=function(h){var c=u.props.context.onNodeContextMenu;c(h,Object(l.b)(u.props))},u.onDragStart=function(h){var c=u.props.context.onNodeDragStart;h.stopPropagation(),u.setState({dragNodeHighlight:!0}),c(h,Object(C.a)(u));try{h.dataTransfer.setData("text/plain","")}catch(d){}},u.onDragEnter=function(h){var c=u.props.context.onNodeDragEnter;h.preventDefault(),h.stopPropagation(),c(h,Object(C.a)(u))},u.onDragOver=function(h){var c=u.props.context.onNodeDragOver;h.preventDefault(),h.stopPropagation(),c(h,Object(C.a)(u))},u.onDragLeave=function(h){var c=u.props.context.onNodeDragLeave;h.stopPropagation(),c(h,Object(C.a)(u))},u.onDragEnd=function(h){var c=u.props.context.onNodeDragEnd;h.stopPropagation(),u.setState({dragNodeHighlight:!1}),c(h,Object(C.a)(u))},u.onDrop=function(h){var c=u.props.context.onNodeDrop;h.preventDefault(),h.stopPropagation(),u.setState({dragNodeHighlight:!1}),c(h,Object(C.a)(u))},u.onExpand=function(h){var c=u.props.context.onNodeExpand;c(h,Object(l.b)(u.props))},u.setSelectHandle=function(h){u.selectHandle=h},u.getNodeState=function(){var h=u.props.expanded;return u.isLeaf()?null:h?s:i},u.hasChildren=function(){var h=u.props.eventKey,c=u.props.context.keyEntities,d=c[h]||{},E=d.children;return!!(E||[]).length},u.isLeaf=function(){var h=u.props,c=h.isLeaf,d=h.loaded,E=u.props.context.loadData,y=u.hasChildren();return c===!1?!1:c||!E&&!y||E&&d&&!y},u.isDisabled=function(){var h=u.props.disabled,c=u.props.context.disabled;return!!(c||h)},u.isCheckable=function(){var h=u.props.checkable,c=u.props.context.checkable;return!c||h===!1?!1:c},u.syncLoadData=function(h){var c=h.expanded,d=h.loading,E=h.loaded,y=u.props.context,T=y.loadData,D=y.onNodeLoad;if(d)return;T&&c&&!u.isLeaf()&&(!u.hasChildren()&&!E&&D(Object(l.b)(u.props)))},u.renderSwitcher=function(){var h=u.props,c=h.expanded,d=h.switcherIcon,E=u.props.context,y=E.prefixCls,T=E.switcherIcon,D=d||T;if(u.isLeaf())return e.createElement("span",{className:g()("".concat(y,"-switcher"),"".concat(y,"-switcher-noop"))},typeof D=="function"?D(Object(O.a)(Object(O.a)({},u.props),{},{isLeaf:!0})):D);var L=g()("".concat(y,"-switcher"),"".concat(y,"-switcher_").concat(c?s:i));return e.createElement("span",{onClick:u.onExpand,className:L},typeof D=="function"?D(Object(O.a)(Object(O.a)({},u.props),{},{isLeaf:!1})):D)},u.renderCheckbox=function(){var h=u.props,c=h.checked,d=h.halfChecked,E=h.disableCheckbox,y=u.props.context.prefixCls,T=u.isDisabled(),D=u.isCheckable();if(!D)return null;var L=typeof D!="boolean"?D:null;return e.createElement("span",{className:g()("".concat(y,"-checkbox"),c&&"".concat(y,"-checkbox-checked"),!c&&d&&"".concat(y,"-checkbox-indeterminate"),(T||E)&&"".concat(y,"-checkbox-disabled")),onClick:u.onCheck},L)},u.renderIcon=function(){var h=u.props.loading,c=u.props.context.prefixCls;return e.createElement("span",{className:g()("".concat(c,"-iconEle"),"".concat(c,"-icon__").concat(u.getNodeState()||"docu"),h&&"".concat(c,"-icon_loading"))})},u.renderSelector=function(){var h=u.state.dragNodeHighlight,c=u.props,d=c.title,E=c.selected,y=c.icon,T=c.loading,D=c.data,L=u.props.context,x=L.prefixCls,k=L.showIcon,U=L.icon,R=L.draggable,V=L.loadData,Z=L.titleRender,ue=u.isDisabled(),le="".concat(x,"-node-content-wrapper"),ge;if(k){var pe=y||U;ge=pe?e.createElement("span",{className:g()("".concat(x,"-iconEle"),"".concat(x,"-icon__customize"))},typeof pe=="function"?pe(u.props):pe):u.renderIcon()}else V&&T&&(ge=u.renderIcon());var ae;typeof d=="function"?ae=d(D):Z?ae=Z(D):ae=d;var ne=e.createElement("span",{className:"".concat(x,"-title")},ae);return e.createElement("span",{ref:u.setSelectHandle,title:typeof d=="string"?d:"",className:g()("".concat(le),"".concat(le,"-").concat(u.getNodeState()||"normal"),!ue&&(E||h)&&"".concat(x,"-node-selected"),!ue&&R&&"draggable"),draggable:!ue&&R||void 0,"aria-grabbed":!ue&&R||void 0,onMouseEnter:u.onMouseEnter,onMouseLeave:u.onMouseLeave,onContextMenu:u.onContextMenu,onClick:u.onSelectorClick,onDoubleClick:u.onSelectorDoubleClick,onDragStart:R?u.onDragStart:void 0},ge,ne)},u}return Object(I.a)(b,[{key:"componentDidMount",value:function(){this.syncLoadData(this.props)}},{key:"componentDidUpdate",value:function(){this.syncLoadData(this.props)}},{key:"isSelectable",value:function(){var h=this.props.selectable,c=this.props.context.selectable;return typeof h=="boolean"?h:c}},{key:"render",value:function(){var h,c=this.props,d=c.eventKey,E=c.className,y=c.style,T=c.dragOver,D=c.dragOverGapTop,L=c.dragOverGapBottom,x=c.isLeaf,k=c.isStart,U=c.isEnd,R=c.expanded,V=c.selected,Z=c.checked,ue=c.halfChecked,le=c.loading,ge=c.domRef,pe=c.active,ae=c.onMouseMove,ne=Object(B.a)(c,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),fe=this.props.context,q=fe.prefixCls,M=fe.filterTreeNode,S=fe.draggable,A=fe.keyEntities,F=this.isDisabled(),K=Object(o.f)(ne),P=A[d]||{},re=P.level,he=U[U.length-1];return e.createElement("div",Object.assign({ref:ge,className:g()(E,"".concat(q,"-treenode"),(h={},Object(oe.a)(h,"".concat(q,"-treenode-disabled"),F),Object(oe.a)(h,"".concat(q,"-treenode-switcher-").concat(R?"open":"close"),!x),Object(oe.a)(h,"".concat(q,"-treenode-checkbox-checked"),Z),Object(oe.a)(h,"".concat(q,"-treenode-checkbox-indeterminate"),ue),Object(oe.a)(h,"".concat(q,"-treenode-selected"),V),Object(oe.a)(h,"".concat(q,"-treenode-loading"),le),Object(oe.a)(h,"".concat(q,"-treenode-active"),pe),Object(oe.a)(h,"".concat(q,"-treenode-leaf-last"),he),Object(oe.a)(h,"drag-over",!F&&T),Object(oe.a)(h,"drag-over-gap-top",!F&&D),Object(oe.a)(h,"drag-over-gap-bottom",!F&&L),Object(oe.a)(h,"filter-node",M&&M(Object(l.b)(this.props))),h)),style:y,onDragEnter:S?this.onDragEnter:void 0,onDragOver:S?this.onDragOver:void 0,onDragLeave:S?this.onDragLeave:void 0,onDrop:S?this.onDrop:void 0,onDragEnd:S?this.onDragEnd:void 0,onMouseMove:ae},K),e.createElement(a,{prefixCls:q,level:re,isStart:k,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),b}(e.Component),v=function(_){return e.createElement(f.a.Consumer,null,function(b){return e.createElement(t,Object.assign({},_,{context:b}))})};v.displayName="TreeNode",v.defaultProps={title:r},v.isTreeNode=1;var m=ce.a=v},Y1PL:function(Fe,ce,z){"use strict";z.r(ce),z.d(ce,"ResizableTextArea",function(){return ue});var oe=z("wx14"),B=z("1OyB"),O=z("vuIU"),H=z("Ji7U"),I=z("LK+K"),C=z("q1tI"),j=z("VTBJ"),N=z("rePB"),e=z("Zm9Q"),w=z("Kwbf"),g=z("c+Xe"),f=z("m+aA"),o=z("bdgK"),n=new Map;function a(pe){pe.forEach(function(ae){var ne,fe=ae.target;(ne=n.get(fe))===null||ne===void 0||ne.forEach(function(q){return q(fe)})})}var l=new o.default(a),s=null,i=null;function r(pe,ae){n.has(pe)||(n.set(pe,new Set),l.observe(pe)),n.get(pe).add(ae)}function t(pe,ae){n.has(pe)&&(n.get(pe).delete(ae),n.get(pe).size||(l.unobserve(pe),n.delete(pe)))}var v=function(pe){Object(H.a)(ne,pe);var ae=Object(I.a)(ne);function ne(){return Object(B.a)(this,ne),ae.apply(this,arguments)}return Object(O.a)(ne,[{key:"render",value:function(){return this.props.children}}]),ne}(C.Component),m=C.createContext(null);function p(pe){var ae=pe.children,ne=pe.onBatchResize,fe=C.useRef(0),q=C.useRef([]),M=C.useContext(m),S=C.useCallback(function(A,F,K){fe.current+=1;var P=fe.current;q.current.push({size:A,element:F,data:K}),Promise.resolve().then(function(){P===fe.current&&(ne==null||ne(q.current),q.current=[])}),M==null||M(A,F,K)},[ne,M]);return C.createElement(m.Provider,{value:S},ae)}function _(pe){var ae=pe.children,ne=pe.disabled,fe=C.useRef(null),q=C.useRef(null),M=C.useContext(m),S=C.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),A=C.isValidElement(ae)&&Object(g.c)(ae),F=A?ae.ref:null,K=C.useMemo(function(){return Object(g.a)(F,fe)},[F,fe]),P=C.useRef(pe);P.current=pe;var re=C.useCallback(function(he){var ye=P.current,J=ye.onResize,se=ye.data,me=he.getBoundingClientRect(),_e=me.width,Ce=me.height,de=he.offsetWidth,Ee=he.offsetHeight,Te=Math.floor(_e),Se=Math.floor(Ce);if(S.current.width!==Te||S.current.height!==Se||S.current.offsetWidth!==de||S.current.offsetHeight!==Ee){var we={width:Te,height:Se,offsetWidth:de,offsetHeight:Ee};S.current=we;var Ae=de===Math.round(_e)?_e:de,xe=Ee===Math.round(Ce)?Ce:Ee,Re=Object(j.a)(Object(j.a)({},we),{},{offsetWidth:Ae,offsetHeight:xe});M==null||M(Re,he,se),J&&Promise.resolve().then(function(){J(Re,he)})}},[]);return C.useEffect(function(){var he=Object(f.a)(fe.current)||Object(f.a)(q.current);return he&&!ne&&r(he,re),function(){return t(he,re)}},[fe.current,ne]),C.createElement(v,{ref:q},A?C.cloneElement(ae,{ref:K}):ae)}var b="rc-observer-key";function u(pe){var ae=pe.children,ne=Object(e.a)(ae);return ne.map(function(fe,q){var M=(fe==null?void 0:fe.key)||"".concat(b,"-").concat(q);return C.createElement(_,Object(oe.a)({},pe,{key:M}),fe)})}u.Collection=p;var h=u,c=z("bT9E"),d=z("TSYQ"),E=z.n(d),y=`
min-height:0 !important;
max-height:none !important;
height:0 !important;
visibility:hidden !important;
overflow:hidden !important;
position:absolute !important;
z-index:-1000 !important;
top:0 !important;
right:0 !important
`,T=["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"],D={},L;function x(pe){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ne=pe.getAttribute("id")||pe.getAttribute("data-reactid")||pe.getAttribute("name");if(ae&&D[ne])return D[ne];var fe=window.getComputedStyle(pe),q=fe.getPropertyValue("box-sizing")||fe.getPropertyValue("-moz-box-sizing")||fe.getPropertyValue("-webkit-box-sizing"),M=parseFloat(fe.getPropertyValue("padding-bottom"))+parseFloat(fe.getPropertyValue("padding-top")),S=parseFloat(fe.getPropertyValue("border-bottom-width"))+parseFloat(fe.getPropertyValue("border-top-width")),A=T.map(function(K){return"".concat(K,":").concat(fe.getPropertyValue(K))}).join(";"),F={sizingStyle:A,paddingSize:M,borderSize:S,boxSizing:q};return ae&&ne&&(D[ne]=F),F}function k(pe){var ae=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,ne=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,fe=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;L||(L=document.createElement("textarea"),L.setAttribute("tab-index","-1"),L.setAttribute("aria-hidden","true"),document.body.appendChild(L)),pe.getAttribute("wrap")?L.setAttribute("wrap",pe.getAttribute("wrap")):L.removeAttribute("wrap");var q=x(pe,ae),M=q.paddingSize,S=q.borderSize,A=q.boxSizing,F=q.sizingStyle;L.setAttribute("style","".concat(F,";").concat(y)),L.value=pe.value||pe.placeholder||"";var K=Number.MIN_SAFE_INTEGER,P=Number.MAX_SAFE_INTEGER,re=L.scrollHeight,he;if(A==="border-box"?re+=S:A==="content-box"&&(re-=M),ne!==null||fe!==null){L.value=" ";var ye=L.scrollHeight-M;ne!==null&&(K=ye*ne,A==="border-box"&&(K=K+M+S),re=Math.max(K,re)),fe!==null&&(P=ye*fe,A==="border-box"&&(P=P+M+S),he=re>P?"":"hidden",re=Math.min(P,re))}return{height:re,minHeight:K,maxHeight:P,overflowY:he,resize:"none"}}var U=z("Gytx"),R=z.n(U),V;(function(pe){pe[pe.NONE=0]="NONE",pe[pe.RESIZING=1]="RESIZING",pe[pe.RESIZED=2]="RESIZED"})(V||(V={}));var Z=function(pe){Object(H.a)(ne,pe);var ae=Object(I.a)(ne);function ne(fe){var q;return Object(B.a)(this,ne),q=ae.call(this,fe),q.nextFrameActionId=void 0,q.resizeFrameId=void 0,q.textArea=void 0,q.saveTextArea=function(M){q.textArea=M},q.handleResize=function(M){var S=q.state.resizeStatus,A=q.props,F=A.autoSize,K=A.onResize;if(S!==V.NONE)return;typeof K=="function"&&K(M),F&&q.resizeOnNextFrame()},q.resizeOnNextFrame=function(){cancelAnimationFrame(q.nextFrameActionId),q.nextFrameActionId=requestAnimationFrame(q.resizeTextarea)},q.resizeTextarea=function(){var M=q.props.autoSize;if(!M||!q.textArea)return;var S=M.minRows,A=M.maxRows,F=k(q.textArea,!1,S,A);q.setState({textareaStyles:F,resizeStatus:V.RESIZING},function(){cancelAnimationFrame(q.resizeFrameId),q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:V.RESIZED},function(){q.resizeFrameId=requestAnimationFrame(function(){q.setState({resizeStatus:V.NONE}),q.fixFirefoxAutoScroll()})})})})},q.renderTextArea=function(){var M=q.props,S=M.prefixCls,A=S===void 0?"rc-textarea":S,F=M.autoSize,K=M.onResize,P=M.className,re=M.disabled,he=q.state,ye=he.textareaStyles,J=he.resizeStatus,se=Object(c.a)(q.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),me=E()(A,P,Object(N.a)({},"".concat(A,"-disabled"),re));"value"in se&&(se.value=se.value||"");var _e=Object(j.a)(Object(j.a)(Object(j.a)({},q.props.style),ye),J===V.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return C.createElement(h,{onResize:q.handleResize,disabled:!(F||K)},C.createElement("textarea",Object(oe.a)({},se,{className:me,style:_e,ref:q.saveTextArea})))},q.state={textareaStyles:{},resizeStatus:V.NONE},q}return Object(O.a)(ne,[{key:"componentDidUpdate",value:function(q){(q.value!==this.props.value||!R()(q.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 q=this.textArea.selectionStart,M=this.textArea.selectionEnd;this.textArea.setSelectionRange(q,M)}}catch(S){}}},{key:"render",value:function(){return this.renderTextArea()}}]),ne}(C.Component),ue=Z,le=function(pe){Object(H.a)(ne,pe);var ae=Object(I.a)(ne);function ne(fe){var q;Object(B.a)(this,ne),q=ae.call(this,fe),q.resizableTextArea=void 0,q.focus=function(){q.resizableTextArea.textArea.focus()},q.saveTextArea=function(S){q.resizableTextArea=S},q.handleChange=function(S){var A=q.props.onChange;q.setValue(S.target.value,function(){q.resizableTextArea.resizeTextarea()}),A&&A(S)},q.handleKeyDown=function(S){var A=q.props,F=A.onPressEnter,K=A.onKeyDown;S.keyCode===13&&F&&F(S),K&&K(S)};var M=typeof fe.value=="undefined"||fe.value===null?fe.defaultValue:fe.value;return q.state={value:M},q}return Object(O.a)(ne,[{key:"setValue",value:function(q,M){"value"in this.props||this.setState({value:q},M)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return C.createElement(ue,Object(oe.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(q){return"value"in q?{value:q.value}:null}}]),ne}(C.Component),ge=ce.default=le},ZW9T:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return U});var oe=z("k1fw"),B=z("oBTY"),O=z("miYZ"),H=z("tsqr"),I=z("rAM+"),C=z("tJVT"),j=z("PpiC"),N=z("q1tI"),e=z.n(N),w=z("bdgK"),g=z("9og8"),f=z("WmNS"),o=z.n(f),n={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"]},a={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"]},l={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 <iostream>",content:["#include <iostream>"].join(`
`)},{label:"include <vector>",content:["#include <vector>"].join(`
`)},{label:"include <cstdio>",content:["#include <cstdio>"].join(`
`)},{label:"include <cstring>",content:["#include <cstring>"].join(`
`)},{label:"include <sstream>",content:["#include <sstream>"].join(`
`)},{label:"include <fstream>",content:["#include <fstream>"].join(`
`)},{label:"include <map>",content:["#include <map>"].join(`
`)},{label:"include <string>",content:["#include <string>"].join(`
`)},{label:"include <cmath>",content:["#include <cmath>"].join(`
`)}]},s={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(`
`)}]},i=z("5VLF"),r=z.n(i),t={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"]}},v=function(V,Z){return Z.map(function(ue){return{label:ue,kind:V.languages.CompletionItemKind.Keyword,insertText:ue}})},m=function(V){return Object.keys(t.tables).map(function(Z){return{label:Z,kind:V.languages.CompletionItemKind.Variable,insertText:Z}})},p=function(V,Z){var ue=t.tables[V];return ue?ue.map(function(le){return{label:le,kind:Z.languages.CompletionItemKind.Field,insertText:le}}):[]};function _(R,V,Z,ue,le){var ge=V.getWordUntilPosition(Z),pe={startLineNumber:Z.lineNumber,endLineNumber:Z.lineNumber,startColumn:ge.startColumn,endColumn:ge.endColumn},ae=ue.map(function(ne){return{label:ne,kind:R.languages.CompletionItemKind.Keyword,insertText:ne,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:pe}});return le.map(function(ne){ae.push(Object(oe.a)(Object(oe.a)({},ne),{},{range:pe}))}),ae}var b=function(R){t.languages.map(function(le){return R.languages.registerDocumentFormattingEditProvider(le,{provideDocumentFormattingEdits:function(pe,ae,ne){return Object(g.a)(o.a.mark(function fe(){var q;return o.a.wrap(function(S){for(;;)switch(S.prev=S.next){case 0:return q=r()(pe.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}),S.abrupt("return",[{range:pe.getFullModelRange(),text:q}]);case 2:case"end":return S.stop()}},fe)}))()}}),le});var V=l.quickKey.map(function(le){return{label:le.label,kind:R.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),Z=s.quickKey.map(function(le){return{label:le.label,kind:R.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ue=a.quickKey.map(function(le){return{label:le.label,kind:R.languages.CompletionItemKind.Method,insertText:le.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet}});R.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(ge,pe){var ae=ge.getWordUntilPosition(pe),ne={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},fe=ge.getLineContent(pe.lineNumber).substring(ae.startColumn-2,ae.endColumn);return{suggestions:[].concat(Object(B.a)(l.keywords.map(function(q){return{label:q,kind:R.languages.CompletionItemKind.Function,documentation:q,insertText:q,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})),Object(B.a)(l.quickKey.map(function(q){return{label:q.label,kind:R.languages.CompletionItemKind.Function,documentation:q.content,insertText:fe.startsWith("#")?q.content.replace(/#/,""):q.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})))}}}),R.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(ge,pe){var ae=ge.getWordUntilPosition(pe),ne={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn};return{suggestions:Object(B.a)(n.keywords.map(function(fe){return{label:fe,kind:R.languages.CompletionItemKind.Function,documentation:fe,insertText:fe,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}}))}}}),R.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(ge,pe){var ae=ge.getWordUntilPosition(pe),ne={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},fe=ge.getLineContent(pe.lineNumber).substring(ae.startColumn-2,ae.endColumn);return{suggestions:[].concat(Object(B.a)(a.keywords.map(function(q){return{label:q,kind:R.languages.CompletionItemKind.Function,documentation:q,insertText:q,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})),Object(B.a)(a.quickKey.map(function(q){return{label:q.label,kind:R.languages.CompletionItemKind.Function,documentation:q.content,insertText:fe.startsWith("#")?q.content.replace(/#/,""):q.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})))}}}),R.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(ge,pe){var ae=ge.getWordUntilPosition(pe),ne={startLineNumber:pe.lineNumber,endLineNumber:pe.lineNumber,startColumn:ae.startColumn,endColumn:ae.endColumn},fe=ge.getLineContent(pe.lineNumber).substring(ae.startColumn-2,ae.endColumn);return{suggestions:[].concat(Object(B.a)(s.keywords.map(function(q){return{label:q,kind:R.languages.CompletionItemKind.Function,documentation:q,insertText:q,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})),Object(B.a)(s.quickKey.map(function(q){return{label:q.label,kind:R.languages.CompletionItemKind.Function,documentation:q.content,insertText:fe.startsWith("#")?q.content.replace(/#/,""):q.content,insertTextRules:R.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ne}})))}}})},u="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002",h=z("fjLI"),c=z("LvDl"),d=z("+ua5");function E(R){return/^\d+$/.test(R)?"".concat(R,"px"):R}function y(){}var T=!1,D={"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 L(){var R=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],V=R;if(Array.isArray(R)){for(var Z=0;Z<R.length;Z++){var ue=D[R[Z]];if(ue)return ue}return V[0]}return D[V]||V}var x=null,k=ce.b=function(R){var V=R.width,Z=V===void 0?"100%":V,ue=R.height,le=ue===void 0?"100%":ue,ge=R.value,pe=R.language,ae=pe===void 0?"javascript":pe,ne=R.style,fe=ne===void 0?{}:ne,q=R.options,M=q===void 0?{}:q,S=R.overrideServices,A=S===void 0?{}:S,F=R.theme,K=F===void 0?"vs-dark":F,P=R.onEditBlur,re=R.onSave,he=R.autoHeight,ye=he===void 0?!1:he,J=R.forbidCopy,se=J===void 0?!1:J,me=R.onChange,_e=me===void 0?y:me,Ce=R.editorDidMount,de=Ce===void 0?y:Ce,Ee=R.onFocus,Te=Ee===void 0?y:Ee,Se=R.filename,we=Se===void 0?"educoder.txt":Se,Ae=R.errorLine,xe=R.errorContent,Re=xe===void 0?"":xe,Ie=Object(j.a)(R,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Q=Object(N.useRef)(),W=Object(N.useRef)({}),G=Object(N.useRef)(),X=Object(N.useRef)(),ee=Object(N.useRef)(!1),Y=Object(N.useRef)(),$=Object(N.useState)(!1),te=Object(C.a)($,2),ie=te[0],be=te[1];function ve(){var Me;return Q.current&&(Me=new w.default(function(Be){var ze=Object(I.a)(Be),Je;try{for(ze.s();!(Je=ze.n()).done;){var st=Je.value;(st.target.offsetHeight>0||st.target.offsetWidth>0)&&W.current.instance.layout()}}catch(tt){ze.e(tt)}finally{ze.f()}}),Me.observe(Q.current)),Me}function Oe(){H.b.warn(decodeURIComponent(u))}var Le=function(){var Be=W.current.instance;if(ge!=null&&Be&&ie){var ze=Be.getModel();ze&&ge!==ze.getValue()&&(T=!0,ze.setValue(ge),Be.layout(),T=!1)}};Object(N.useEffect)(function(){X.current&&clearTimeout(X.current),X.current=setTimeout(function(){Le()},500)},[ge,ie,W.current]),Object(N.useEffect)(function(){if(Ae&&W.current&&W.current.instance){var Me=W.current.instance;Me.changeViewZones(function(ze){var Je=document.createElement("div");Je.style.padding="10px 20px",Je.style.width="calc(100% - 20px)",Je.className="my-error-line-wrp",Je.innerHTML=Re,ze.addZone({afterLineNumber:Ae||11,heightInLines:3,domNode:Je})});var Be={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}};Me.addOverlayWidget(Be),Me.revealPositionInCenter({lineNumber:20,column:1})}},[Ae,W.current,ie]);function Pe(){var Me=W.current.instance;if(Me){var Be=Me.getSelection(),ze=W.current.pastePos||{},Je=new x.Range(ze.startLineNumber||Be.endLineNumber,ze.startColumn||Be.endColumn,ze.endLineNumber||Be.endLineNumber,ze.endColumn||Be.endColumn);setTimeout(function(){Me.executeEdits("",[{range:Je,text:""}])},300)}}function ke(Me){(window.navigator.platform.match("Mac")?Me.metaKey:Me.ctrlKey)&&Me.keyCode==83&&(Me.preventDefault(),re())}var Ge=function(){if(ye&&W.current.instance){var Be=W.current.instance.getContentHeight();et(Be<le?le:Be)}else et(le)};function Ke(Me){var Be=document.createEvent("MouseEvents");Be.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Me.dispatchEvent(Be)}function Ue(Me,Be){var ze=window.URL||window.webkitURL||window,Je=new Blob([Be]),st=document.createElementNS("http://www.w3.org/1999/xhtml","a");st.href=ze.createObjectURL(Je),st.download=Me,Ke(st)}Object(N.useEffect)(function(){Ge()},[Ge]),Object(N.useEffect)(function(){Q.current&&!ie&&Promise.all([z.e(18),z.e(29)]).then(z.t.bind(null,"M/lh",7)).then(function(Me){try{x=Me,W.current.instance=x.editor.create(Q.current,{value:ge,language:L(ae),theme:K,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},A);var Be=W.current.instance,ze=h.d._menuItems,Je=Object(B.a)(ze).find(function(He){return He[0]._debugName=="EditorContext"}),st=Je[1],tt=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],We=function(Ne,Ve){var je=Ne._first;do{var Ze,Qe,pt=Ve.includes((Ze=je.element)===null||Ze===void 0||((Qe=Ze.command)===null||Qe===void 0)?void 0:Qe.id);pt&&Ne._remove(je)}while(je=je.next)};if(de(Be,x),setTimeout(function(){Ge(),W.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){Ue(we||"educoder.txt",Be.getValue())}}),Be.getDomNode().addEventListener("input",function(){G.current.autoFormat&&Be.getAction("editor.action.formatDocument").run()})},500),W.current.subscription=Be.onDidChangeModelContent(function(He){ee.current?clearTimeout(Y.current):(Ge(),_e(Be.getValue(),He)),Y.current=setTimeout(function(){ee.current=!1},500)}),window.Monaco||b(x,L(ae)),se&&(We(st,tt),Q.current.classList.add("noCopyPaste"),Be.onKeyDown(function(He){var Ne=He.keyCode,Ve=He.ctrlKey,je=He.metaKey;(Ne===33||Ne===52)&&(je||Ve)&&(Oe(),He.preventDefault())})),window.Monaco=x,P&&Be.onDidBlurEditorWidget(function(){P(Be.getValue())}),Te&&Be.onDidFocusEditorText(function(){Te(Be.getValue())}),se){Be.addCommand(x.KeyMod.CtrlCmd|x.KeyCode.KEY_V,function(){return Oe(),null}),Be.onDidPaste(function(He){W.current.pastePos=He});try{window.addEventListener("paste",Pe)}catch(He){}}var De=ve();return be(!0),function(){var He=W.current.instance;He.dispose();var Ne=He.getModel();Ne&&Ne.dispose(),W.current.subscription&&W.current.subscription.dispose(),se&&window.removeEventListener("paste",Pe),De.unobserve(Q.current)}}catch(He){}})},[]),Object(N.useEffect)(function(){var Me=W.current.instance;if(Me&&ie)return document.addEventListener("keydown",ke,!1),function(){document.removeEventListener("keydown",ke)}},[re,ie]),Object(N.useEffect)(function(){var Me=W.current.instance;if(Me&&ie){var Be=L(ae);x.editor.setModelLanguage(Me.getModel(),Be),console.log("language:",ae,Me.getModel(),Be)}},[ae,ie]),Object(N.useEffect)(function(){var Me=W.current.instance;Me&&ie&&x.editor.setTheme(K)},[K,ie]),Object(N.useEffect)(function(){var Me=W.current.instance;G.current=M,Me&&ie&&(Me.updateOptions(Object(oe.a)({},M)),setTimeout(function(){Me.getModel().updateOptions(Object(oe.a)({},M))},200))},[JSON.stringify(M),ie]),Object(N.useEffect)(function(){var Me=W.current.instance;Me&&ie&&Me.layout()},[Z,le,ie]);var it=Object(N.useState)(E(Z)),$e=Object(C.a)(it,2),rt=$e[0],qe=$e[1],Ye=Object(N.useState)(E(le)),nt=Object(C.a)(Ye,2),at=nt[0],et=nt[1],ut=Object(oe.a)(Object(oe.a)({},fe),{},{width:rt,height:at});return e.a.createElement("div",{className:"my-monaco-editor",ref:Q,style:ut})};function U(R){var V=R.width,Z=V===void 0?"100%":V,ue=R.height,le=ue===void 0?"100%":ue,ge=R.original,pe=R.modified,ae=R.language,ne=R.options,fe=ne===void 0?{}:ne,q=Object(N.useRef)(),M=Object(N.useState)(null),S=Object(C.a)(M,2),A=S[0],F=S[1];function K(ye){var J;return q.current&&(J=new w.default(function(se){var me=Object(I.a)(se),_e;try{for(me.s();!(_e=me.n()).done;){var Ce=_e.value;(Ce.target.offsetHeight>0||Ce.target.offsetWidth>0)&&ye.layout()}}catch(de){me.e(de)}finally{me.f()}}),J.observe(q.current)),J}Object(N.useEffect)(function(){q.current&&Promise.all([z.e(18),z.e(29)]).then(z.t.bind(null,"M/lh",7)).then(function(ye){x=ye;var J=x.editor.createDiffEditor(q.current,Object(oe.a)(Object(oe.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},fe),{},{wordWrap:!0}));F(J);var se=K(J);return function(){J.dispose();var me=J.getModel();me&&me.dispose(),se.unobserve(q.current)}})},[]),Object(N.useEffect)(function(){A&&A.setModel({original:x.editor.createModel(ge,ae),modified:x.editor.createModel(pe,ae)})},[ge,pe,ae,A]);var P=E(Z),re=E(le),he={width:P,height:re};return e.a.createElement("div",{className:"my-diff-editor",ref:q,style:he})}},bT9E:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return B});var oe=z("VTBJ");function B(O,H){var I=Object(oe.a)({},O);return Array.isArray(H)&&H.forEach(function(C){delete I[C]}),I}},fAei:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return t.a});var oe=z("rePB"),B=z("VTBJ"),O=z("KQm4"),H=z("1OyB"),I=z("vuIU"),C=z("Ji7U"),j=z("LK+K"),N=z("q1tI"),e=z("4IlW"),w=z("Kwbf"),g=z("TSYQ"),f=z.n(g),o=z("sboe"),n=z("OZM5"),a=z("815F"),l=z("ODXe"),s=z("Ff2n"),i=z("+nKL"),r=z("8XRh"),t=z("WaYH"),v=function(ge,pe){var ae=ge.className,ne=ge.style,fe=ge.motion,q=ge.motionNodes,M=ge.motionType,S=ge.onMotionStart,A=ge.onMotionEnd,F=ge.active,K=ge.treeNodeRequiredProps,P=Object(s.a)(ge,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),re=N.useState(!0),he=Object(l.a)(re,2),ye=he[0],J=he[1],se=N.useContext(o.a),me=se.prefixCls,_e=N.useRef(!1),Ce=function(){_e.current||A(),_e.current=!0};return Object(N.useEffect)(function(){q&&M==="hide"&&ye&&J(!1)},[q]),Object(N.useEffect)(function(){return q&&S(),function(){q&&Ce()}},[]),q?N.createElement(r.default,Object.assign({ref:pe,visible:ye},fe,{motionAppear:M==="show",onAppearEnd:Ce,onLeaveEnd:Ce}),function(de,Ee){var Te=de.className,Se=de.style;return N.createElement("div",{ref:Ee,className:f()("".concat(me,"-treenode-motion"),Te),style:Se},q.map(function(we){var Ae=we.data,xe=Ae.key,Re=Object(s.a)(Ae,["key"]),Ie=we.isStart,Q=we.isEnd;delete Re.children;var W=Object(a.f)(xe,K);return N.createElement(t.a,Object.assign({},Re,W,{active:F,data:we.data,key:xe,isStart:Ie,isEnd:Q}))}))}):N.createElement(t.a,Object.assign({domRef:pe,className:ae,style:ne},P,{active:F}))};v.displayName="MotionTreeNode";var m=N.forwardRef(v),p=m;function _(){var le=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ge=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],pe=le.length,ae=ge.length;if(Math.abs(pe-ae)!==1)return{add:!1,key:null};function ne(fe,q){var M=new Map;fe.forEach(function(A){M.set(A,!0)});var S=q.filter(function(A){return!M.has(A)});return S.length===1?S[0]:null}return pe<ae?{add:!0,key:ne(le,ge)}:{add:!1,key:ne(ge,le)}}function b(le,ge,pe){var ae=le.findIndex(function(M){var S=M.data;return S.key===pe}),ne=le[ae+1],fe=ge.findIndex(function(M){var S=M.data;return S.key===pe});if(ne){var q=ge.findIndex(function(M){var S=M.data;return S.key===ne.data.key});return ge.slice(fe+1,q)}return ge.slice(fe+1)}var u={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},h=function(){},c="RC_TREE_MOTION_".concat(Math.random()),d={key:c},E={key:c,level:0,index:0,pos:"0",node:d},y={parent:null,children:[],pos:E.pos,data:d,isStart:[],isEnd:[]};function T(le,ge,pe,ae){return ge===!1||!pe?le:le.slice(0,Math.ceil(pe/ae)+1)}function D(le){var ge=le.data.key,pe=le.pos;return Object(a.e)(ge,pe)}function L(le){for(var ge=String(le.data.key),pe=le;pe.parent;)pe=pe.parent,ge="".concat(pe.data.key," > ").concat(ge);return ge}var x=function(ge,pe){var ae=ge.prefixCls,ne=ge.data,fe=ge.selectable,q=ge.checkable,M=ge.expandedKeys,S=ge.selectedKeys,A=ge.checkedKeys,F=ge.loadedKeys,K=ge.loadingKeys,P=ge.halfCheckedKeys,re=ge.keyEntities,he=ge.disabled,ye=ge.dragging,J=ge.dragOverNodeKey,se=ge.dropPosition,me=ge.motion,_e=ge.height,Ce=ge.itemHeight,de=ge.virtual,Ee=ge.focusable,Te=ge.activeItem,Se=ge.focused,we=ge.tabIndex,Ae=ge.onKeyDown,xe=ge.onFocus,Re=ge.onBlur,Ie=ge.onActiveChange,Q=ge.onListChangeStart,W=ge.onListChangeEnd,G=Object(s.a)(ge,["prefixCls","data","selectable","checkable","expandedKeys","selectedKeys","checkedKeys","loadedKeys","loadingKeys","halfCheckedKeys","keyEntities","disabled","dragging","dragOverNodeKey","dropPosition","motion","height","itemHeight","virtual","focusable","activeItem","focused","tabIndex","onKeyDown","onFocus","onBlur","onActiveChange","onListChangeStart","onListChangeEnd"]),X=N.useRef(null);N.useImperativeHandle(pe,function(){return{scrollTo:function(Be){X.current.scrollTo(Be)}}});var ee=N.useState(M),Y=Object(l.a)(ee,2),$=Y[0],te=Y[1],ie=N.useState(ne),be=Object(l.a)(ie,2),ve=be[0],Oe=be[1],Le=N.useState(ne),Pe=Object(l.a)(Le,2),ke=Pe[0],Ge=Pe[1],Ke=N.useState([]),Ue=Object(l.a)(Ke,2),it=Ue[0],$e=Ue[1],rt=N.useState(null),qe=Object(l.a)(rt,2),Ye=qe[0],nt=qe[1];function at(){Oe(ne),Ge(ne),$e([]),nt(null),W()}N.useEffect(function(){te(M);var Me=_($,M);if(Me.key!==null)if(Me.add){var Be=ve.findIndex(function(De){var He=De.data.key;return He===Me.key}),ze=T(b(ve,ne,Me.key),de,_e,Ce),Je=ve.slice();Je.splice(Be+1,0,y),Ge(Je),$e(ze),nt("show")}else{var st=ne.findIndex(function(De){var He=De.data.key;return He===Me.key}),tt=T(b(ne,ve,Me.key),de,_e,Ce),We=ne.slice();We.splice(st+1,0,y),Ge(We),$e(tt),nt("hide")}else ve!==ne&&(Oe(ne),Ge(ne))},[M,ne]),N.useEffect(function(){ye||at()},[ye]);var et=me?ke:ne,ut={expandedKeys:M,selectedKeys:S,loadedKeys:F,loadingKeys:K,checkedKeys:A,halfCheckedKeys:P,dragOverNodeKey:J,dropPosition:se,keyEntities:re};return N.createElement(N.Fragment,null,Se&&Te&&N.createElement("span",{style:u,"aria-live":"assertive"},L(Te)),N.createElement("div",{role:"tree"},N.createElement("input",{style:u,disabled:Ee===!1||he,tabIndex:Ee!==!1?we:null,onKeyDown:Ae,onFocus:xe,onBlur:Re,value:"",onChange:h})),N.createElement(i.a,Object.assign({},G,{data:et,itemKey:D,height:_e,fullHeight:!1,virtual:de,itemHeight:Ce,prefixCls:"".concat(ae,"-list"),ref:X}),function(Me){var Be=Me.pos,ze=Me.data,Je=ze.key,st=Object(s.a)(ze,["key"]),tt=Me.isStart,We=Me.isEnd,De=Object(a.e)(Je,Be);delete st.children;var He=Object(a.f)(De,ut);return N.createElement(p,Object.assign({},st,He,{active:Te&&Je===Te.data.key,pos:Be,data:Me.data,isStart:tt,isEnd:We,motion:me,motionNodes:Je===c?it:null,motionType:Ye,onMotionStart:Q,onMotionEnd:at,treeNodeRequiredProps:ut,onMouseMove:function(){Ie(null)}}))}))},k=N.forwardRef(x);k.displayName="NodeList";var U=k,R=z("NvD2"),V=function(le){Object(C.a)(pe,le);var ge=Object(j.a)(pe);function pe(){var ae;return Object(H.a)(this,pe),ae=ge.apply(this,arguments),ae.destroyed=!1,ae.state={keyEntities:{},selectedKeys:[],checkedKeys:[],halfCheckedKeys:[],loadedKeys:[],loadingKeys:[],expandedKeys:[],dragging:!1,dragNodesKeys:[],dragOverNodeKey:null,dropPosition:null,treeData:[],flattenNodes:[],focused:!1,activeKey:null,listChanging:!1,prevProps:null},ae.listRef=N.createRef(),ae.onNodeDragStart=function(ne,fe){var q=ae.state,M=q.expandedKeys,S=q.keyEntities,A=ae.props.onDragStart,F=fe.props.eventKey;ae.dragNode=fe;var K=Object(n.b)(M,F);ae.setState({dragging:!0,dragNodesKeys:Object(n.g)(F,S)}),ae.setExpandedKeys(K),A&&A({event:ne,node:Object(a.b)(fe.props)})},ae.onNodeDragEnter=function(ne,fe){var q=ae.state,M=q.expandedKeys,S=q.keyEntities,A=q.dragNodesKeys,F=ae.props.onDragEnter,K=fe.props,P=K.pos,re=K.eventKey;if(!ae.dragNode||A.indexOf(re)!==-1)return;var he=Object(n.c)(ne,fe);if(ae.dragNode.props.eventKey===re&&he===0){ae.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){ae.setState({dragOverNodeKey:re,dropPosition:he}),ae.delayedDragEnterLogic||(ae.delayedDragEnterLogic={}),Object.keys(ae.delayedDragEnterLogic).forEach(function(ye){clearTimeout(ae.delayedDragEnterLogic[ye])}),ae.delayedDragEnterLogic[P]=window.setTimeout(function(){if(!ae.state.dragging)return;var ye=Object(O.a)(M),J=S[re];J&&(J.children||[]).length&&(ye=Object(n.a)(M,re)),"expandedKeys"in ae.props||ae.setExpandedKeys(ye),F&&F({event:ne,node:Object(a.b)(fe.props),expandedKeys:ye})},400)},0)},ae.onNodeDragOver=function(ne,fe){var q=ae.state.dragNodesKeys,M=ae.props.onDragOver,S=fe.props.eventKey;if(q.indexOf(S)!==-1)return;if(ae.dragNode&&S===ae.state.dragOverNodeKey){var A=Object(n.c)(ne,fe);if(A===ae.state.dropPosition)return;ae.setState({dropPosition:A})}M&&M({event:ne,node:Object(a.b)(fe.props)})},ae.onNodeDragLeave=function(ne,fe){var q=ae.props.onDragLeave;ae.setState({dragOverNodeKey:""}),q&&q({event:ne,node:Object(a.b)(fe.props)})},ae.onNodeDragEnd=function(ne,fe){var q=ae.props.onDragEnd;ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),q&&q({event:ne,node:Object(a.b)(fe.props)}),ae.dragNode=null},ae.onNodeDrop=function(ne,fe){var q=ae.state,M=q.dragNodesKeys,S=M===void 0?[]:M,A=q.dropPosition,F=ae.props.onDrop,K=fe.props,P=K.eventKey,re=K.pos;if(ae.setState({dragOverNodeKey:""}),ae.cleanDragState(),S.indexOf(P)!==-1){Object(w.a)(!1,"Can not drop to dragNode(include it's children node)");return}var he=Object(n.k)(re),ye={event:ne,node:Object(a.b)(fe.props),dragNode:ae.dragNode?Object(a.b)(ae.dragNode.props):null,dragNodesKeys:S.slice(),dropPosition:A+Number(he[he.length-1]),dropToGap:!1};A!==0&&(ye.dropToGap=!0),F&&F(ye),ae.dragNode=null},ae.cleanDragState=function(){var ne=ae.state.dragging;ne&&ae.setState({dragging:!1})},ae.onNodeClick=function(ne,fe){var q=ae.props.onClick;q&&q(ne,fe)},ae.onNodeDoubleClick=function(ne,fe){var q=ae.props.onDoubleClick;q&&q(ne,fe)},ae.onNodeSelect=function(ne,fe){var q=ae.state.selectedKeys,M=ae.state.keyEntities,S=ae.props,A=S.onSelect,F=S.multiple,K=fe.selected,P=fe.key,re=!K;re?F?q=Object(n.a)(q,P):q=[P]:q=Object(n.b)(q,P);var he=q.map(function(ye){var J=M[ye];return J?J.node:null}).filter(function(ye){return ye});ae.setUncontrolledState({selectedKeys:q}),A&&A(q,{event:"select",selected:re,node:fe,selectedNodes:he,nativeEvent:ne.nativeEvent})},ae.onNodeCheck=function(ne,fe,q){var M=ae.state,S=M.keyEntities,A=M.checkedKeys,F=M.halfCheckedKeys,K=ae.props,P=K.checkStrictly,re=K.onCheck,he=fe.key,ye,J={event:"check",node:fe,checked:q,nativeEvent:ne.nativeEvent};if(P){var se=q?Object(n.a)(A,he):Object(n.b)(A,he),me=Object(n.b)(F,he);ye={checked:se,halfChecked:me},J.checkedNodes=se.map(function(Se){return S[Se]}).filter(function(Se){return Se}).map(function(Se){return Se.node}),ae.setUncontrolledState({checkedKeys:se})}else{var _e=Object(R.a)([].concat(Object(O.a)(A),[he]),!0,S),Ce=_e.checkedKeys,de=_e.halfCheckedKeys;if(!q){var Ee=new Set(Ce);Ee.delete(he);var Te=Object(R.a)(Array.from(Ee),{checked:!1,halfCheckedKeys:de},S);Ce=Te.checkedKeys,de=Te.halfCheckedKeys}ye=Ce,J.checkedNodes=[],J.checkedNodesPositions=[],J.halfCheckedKeys=de,Ce.forEach(function(Se){var we=S[Se];if(!we)return;var Ae=we.node,xe=we.pos;J.checkedNodes.push(Ae),J.checkedNodesPositions.push({node:Ae,pos:xe})}),ae.setUncontrolledState({checkedKeys:Ce},!1,{halfCheckedKeys:de})}re&&re(ye,J)},ae.onNodeLoad=function(ne){return new Promise(function(fe){ae.setState(function(q){var M=q.loadedKeys,S=M===void 0?[]:M,A=q.loadingKeys,F=A===void 0?[]:A,K=ae.props,P=K.loadData,re=K.onLoad,he=ne.key;if(!P||S.indexOf(he)!==-1||F.indexOf(he)!==-1)return{};var ye=P(ne);return ye.then(function(){var J=ae.state,se=J.loadedKeys,me=J.loadingKeys,_e=Object(n.a)(se,he),Ce=Object(n.b)(me,he);re&&re(_e,{event:"load",node:ne}),ae.setUncontrolledState({loadedKeys:_e}),ae.setState({loadingKeys:Ce}),fe()}),{loadingKeys:Object(n.a)(F,he)}})})},ae.onNodeMouseEnter=function(ne,fe){var q=ae.props.onMouseEnter;q&&q({event:ne,node:fe})},ae.onNodeMouseLeave=function(ne,fe){var q=ae.props.onMouseLeave;q&&q({event:ne,node:fe})},ae.onNodeContextMenu=function(ne,fe){var q=ae.props.onRightClick;q&&(ne.preventDefault(),q({event:ne,node:fe}))},ae.onFocus=function(){var ne=ae.props.onFocus;ae.setState({focused:!0}),ne&&ne.apply(void 0,arguments)},ae.onBlur=function(){var ne=ae.props.onBlur;ae.setState({focused:!1}),ae.onActiveChange(null),ne&&ne.apply(void 0,arguments)},ae.getTreeNodeRequiredProps=function(){var ne=ae.state,fe=ne.expandedKeys,q=ne.selectedKeys,M=ne.loadedKeys,S=ne.loadingKeys,A=ne.checkedKeys,F=ne.halfCheckedKeys,K=ne.dragOverNodeKey,P=ne.dropPosition,re=ne.keyEntities;return{expandedKeys:fe||[],selectedKeys:q||[],loadedKeys:M||[],loadingKeys:S||[],checkedKeys:A||[],halfCheckedKeys:F||[],dragOverNodeKey:K,dropPosition:P,keyEntities:re}},ae.setExpandedKeys=function(ne){var fe=ae.state.treeData,q=Object(a.d)(fe,ne);ae.setUncontrolledState({expandedKeys:ne,flattenNodes:q},!0)},ae.onNodeExpand=function(ne,fe){var q=ae.state.expandedKeys,M=ae.state.listChanging,S=ae.props,A=S.onExpand,F=S.loadData,K=fe.key,P=fe.expanded;if(M)return;var re=q.indexOf(K),he=!P;if(Object(w.a)(P&&re!==-1||!P&&re===-1,"Expand state not sync with index check"),he?q=Object(n.a)(q,K):q=Object(n.b)(q,K),ae.setExpandedKeys(q),A&&A(q,{node:fe,expanded:he,nativeEvent:ne.nativeEvent}),he&&F){var ye=ae.onNodeLoad(fe);ye&&ye.then(function(){var J=Object(a.d)(ae.state.treeData,q);ae.setUncontrolledState({flattenNodes:J})})}},ae.onListChangeStart=function(){ae.setUncontrolledState({listChanging:!0})},ae.onListChangeEnd=function(){setTimeout(function(){ae.setUncontrolledState({listChanging:!1})})},ae.onActiveChange=function(ne){var fe=ae.state.activeKey,q=ae.props.onActiveChange;if(fe===ne)return;ae.setState({activeKey:ne}),ne!==null&&ae.scrollTo({key:ne}),q&&q(ne)},ae.getActiveItem=function(){var ne=ae.state,fe=ne.activeKey,q=ne.flattenNodes;return fe===null?null:q.find(function(M){var S=M.data.key;return S===fe})||null},ae.offsetActiveKey=function(ne){var fe=ae.state,q=fe.flattenNodes,M=fe.activeKey,S=q.findIndex(function(K){var P=K.data.key;return P===M});S===-1&&ne<0&&(S=q.length),S=(S+ne+q.length)%q.length;var A=q[S];if(A){var F=A.data.key;ae.onActiveChange(F)}else ae.onActiveChange(null)},ae.onKeyDown=function(ne){var fe=ae.state,q=fe.activeKey,M=fe.expandedKeys,S=fe.checkedKeys,A=ae.props,F=A.onKeyDown,K=A.checkable,P=A.selectable;switch(ne.which){case e.a.UP:{ae.offsetActiveKey(-1),ne.preventDefault();break}case e.a.DOWN:{ae.offsetActiveKey(1),ne.preventDefault();break}}var re=ae.getActiveItem();if(re&&re.data){var he=ae.getTreeNodeRequiredProps(),ye=re.data.isLeaf===!1||!!(re.data.children||[]).length,J=Object(a.b)(Object(B.a)(Object(B.a)({},Object(a.f)(q,he)),{},{data:re.data,active:!0}));switch(ne.which){case e.a.LEFT:{ye&&M.includes(q)?ae.onNodeExpand({},J):re.parent&&ae.onActiveChange(re.parent.data.key),ne.preventDefault();break}case e.a.RIGHT:{ye&&!M.includes(q)?ae.onNodeExpand({},J):re.children&&re.children.length&&ae.onActiveChange(re.children[0].data.key),ne.preventDefault();break}case e.a.ENTER:case e.a.SPACE:{K&&!J.disabled&&J.checkable!==!1&&!J.disableCheckbox?ae.onNodeCheck({},J,!S.includes(q)):!K&&P&&!J.disabled&&J.selectable!==!1&&ae.onNodeSelect({},J);break}}}F&&F(ne)},ae.setUncontrolledState=function(ne){var fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,q=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(ae.destroyed)return;var M=!1,S=!0,A={};Object.keys(ne).forEach(function(F){if(F in ae.props){S=!1;return}M=!0,A[F]=ne[F]}),M&&(!fe||S)&&ae.setState(Object(B.a)(Object(B.a)({},A),q))},ae.scrollTo=function(ne){ae.listRef.current.scrollTo(ne)},ae}return Object(I.a)(pe,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var ne,fe=this.state,q=fe.focused,M=fe.flattenNodes,S=fe.keyEntities,A=fe.dragging,F=fe.activeKey,K=this.props,P=K.prefixCls,re=K.className,he=K.style,ye=K.showLine,J=K.focusable,se=K.tabIndex,me=se===void 0?0:se,_e=K.selectable,Ce=K.showIcon,de=K.icon,Ee=K.switcherIcon,Te=K.draggable,Se=K.checkable,we=K.checkStrictly,Ae=K.disabled,xe=K.motion,Re=K.loadData,Ie=K.filterTreeNode,Q=K.height,W=K.itemHeight,G=K.virtual,X=K.titleRender,ee=K.onContextMenu,Y=Object(n.f)(this.props);return N.createElement(o.a.Provider,{value:{prefixCls:P,selectable:_e,showIcon:Ce,icon:de,switcherIcon:Ee,draggable:Te,checkable:Se,checkStrictly:we,disabled:Ae,keyEntities:S,loadData:Re,filterTreeNode:Ie,titleRender:X,onNodeClick:this.onNodeClick,onNodeDoubleClick:this.onNodeDoubleClick,onNodeExpand:this.onNodeExpand,onNodeSelect:this.onNodeSelect,onNodeCheck:this.onNodeCheck,onNodeLoad:this.onNodeLoad,onNodeMouseEnter:this.onNodeMouseEnter,onNodeMouseLeave:this.onNodeMouseLeave,onNodeContextMenu:this.onNodeContextMenu,onNodeDragStart:this.onNodeDragStart,onNodeDragEnter:this.onNodeDragEnter,onNodeDragOver:this.onNodeDragOver,onNodeDragLeave:this.onNodeDragLeave,onNodeDragEnd:this.onNodeDragEnd,onNodeDrop:this.onNodeDrop}},N.createElement("div",{className:f()(P,re,(ne={},Object(oe.a)(ne,"".concat(P,"-show-line"),ye),Object(oe.a)(ne,"".concat(P,"-focused"),q),Object(oe.a)(ne,"".concat(P,"-active-focused"),F!==null),ne))},N.createElement(U,Object.assign({ref:this.listRef,prefixCls:P,style:he,data:M,disabled:Ae,selectable:_e,checkable:!!Se,motion:xe,dragging:A,height:Q,itemHeight:W,virtual:G,focusable:J,focused:q,tabIndex:me,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:ee},this.getTreeNodeRequiredProps(),Y))))}}],[{key:"getDerivedStateFromProps",value:function(ne,fe){var q=fe.prevProps,M={prevProps:ne};function S(de){return!q&&de in ne||q&&q[de]!==ne[de]}var A;if(S("treeData")?A=ne.treeData:S("children")&&(Object(w.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),A=Object(a.c)(ne.children)),A){M.treeData=A;var F=Object(a.a)(A);M.keyEntities=Object(B.a)(Object(oe.a)({},c,E),F.keyEntities)}var K=M.keyEntities||fe.keyEntities;if(S("expandedKeys")||q&&S("autoExpandParent"))M.expandedKeys=ne.autoExpandParent||!q&&ne.defaultExpandParent?Object(n.e)(ne.expandedKeys,K):ne.expandedKeys;else if(!q&&ne.defaultExpandAll){var P=Object(B.a)({},K);delete P[c],M.expandedKeys=Object.keys(P).map(function(de){return P[de].key})}else!q&&ne.defaultExpandedKeys&&(M.expandedKeys=ne.autoExpandParent||ne.defaultExpandParent?Object(n.e)(ne.defaultExpandedKeys,K):ne.defaultExpandedKeys);if(M.expandedKeys||delete M.expandedKeys,A||M.expandedKeys){var re=Object(a.d)(A||fe.treeData,M.expandedKeys||fe.expandedKeys);M.flattenNodes=re}if(ne.selectable&&(S("selectedKeys")?M.selectedKeys=Object(n.d)(ne.selectedKeys,ne):!q&&ne.defaultSelectedKeys&&(M.selectedKeys=Object(n.d)(ne.defaultSelectedKeys,ne))),ne.checkable){var he;if(S("checkedKeys")?he=Object(n.j)(ne.checkedKeys)||{}:!q&&ne.defaultCheckedKeys?he=Object(n.j)(ne.defaultCheckedKeys)||{}:A&&(he=Object(n.j)(ne.checkedKeys)||{checkedKeys:fe.checkedKeys,halfCheckedKeys:fe.halfCheckedKeys}),he){var ye=he,J=ye.checkedKeys,se=J===void 0?[]:J,me=ye.halfCheckedKeys,_e=me===void 0?[]:me;if(!ne.checkStrictly){var Ce=Object(R.a)(se,!0,K);se=Ce.checkedKeys,_e=Ce.halfCheckedKeys}M.checkedKeys=se,M.halfCheckedKeys=_e}}return S("loadedKeys")&&(M.loadedKeys=ne.loadedKeys),M}}]),pe}(N.Component);V.defaultProps={prefixCls:"rc-tree",showLine:!1,showIcon:!0,selectable:!0,multiple:!1,checkable:!1,disabled:!1,checkStrictly:!1,draggable:!1,defaultExpandParent:!0,autoExpandParent:!1,defaultExpandAll:!1,defaultExpandedKeys:[],defaultCheckedKeys:[],defaultSelectedKeys:[]},V.TreeNode=t.a;var Z=V,ue=ce.b=Z},fjLI:function(Fe,ce,z){"use strict";z.d(ce,"f",function(){return o}),z.d(ce,"b",function(){return n}),z.d(ce,"a",function(){return a}),z.d(ce,"d",function(){return l}),z.d(ce,"e",function(){return s}),z.d(ce,"c",function(){return i});var oe=z("8HAY"),B=z("Vhoy"),O=z("MI8n"),H=z("JYp7"),I=z("pmY6"),C=z("24hK"),j=z("nnTU"),N=z("T8No"),e=z("Cg/j"),w=z("t9D7"),g=function(r,t,v,m){var p=arguments.length,_=p<3?t:m===null?m=Object.getOwnPropertyDescriptor(t,v):m,b;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")_=Reflect.decorate(r,t,v,m);else for(var u=r.length-1;u>=0;u--)(b=r[u])&&(_=(p<3?b(_):p>3?b(t,v,_):b(t,v))||_);return p>3&&_&&Object.defineProperty(t,v,_),_},f=function(r,t){return function(v,m){t(v,m,r)}};function o(r){return r.command!==void 0}class n{constructor(r){this.id=n._idPool++,this._debugName=r}}n._idPool=0,n.CommandPalette=new n("CommandPalette"),n.EditorContext=new n("EditorContext"),n.SimpleEditorContext=new n("SimpleEditorContext"),n.EditorContextCopy=new n("EditorContextCopy"),n.EditorContextPeek=new n("EditorContextPeek"),n.MenubarEditMenu=new n("MenubarEditMenu"),n.MenubarCopy=new n("MenubarCopy"),n.MenubarGoMenu=new n("MenubarGoMenu"),n.MenubarSelectionMenu=new n("MenubarSelectionMenu"),n.InlineCompletionsActions=new n("InlineCompletionsActions");const a=Object(e.c)("menuService"),l=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new O.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:r=>r===n.CommandPalette}}addCommand(r){return this.addCommands(H.a.single(r))}addCommands(r){for(const t of r)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(I.i)(()=>{let t=!1;for(const v of r)t=this._commands.delete(v.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(r){return this._commands.get(r)}getCommands(){const r=new Map;return this._commands.forEach((t,v)=>r.set(v,t)),r}appendMenuItem(r,t){return this.appendMenuItems(H.a.single({id:r,item:t}))}appendMenuItems(r){const t=new Set,v=new C.a;for(const{id:m,item:p}of r){let _=this._menuItems.get(m);_||(_=new C.a,this._menuItems.set(m,_)),v.push(_.push(p)),t.add(m)}return this._onDidChangeMenu.fire(t),Object(I.i)(()=>{if(v.size>0){for(let m of v)m();this._onDidChangeMenu.fire(t),v.clear()}})}getMenuItems(r){let t;return this._menuItems.has(r)?t=[...this._menuItems.get(r)]:t=[],r===n.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(r){const t=new Set;for(const v of r)o(v)&&(t.add(v.command.id),v.alt&&t.add(v.alt.id));this._commands.forEach((v,m)=>{t.has(m)||r.push({command:v})})}};class s extends oe.e{constructor(r,t,v,m){super(`submenuitem.${r.submenu.id}`,typeof r.title=="string"?r.title:r.title.value,[],"submenu");this.item=r,this._menuService=t,this._contextKeyService=v,this._options=m}get actions(){const r=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),v=t.getActions(this._options);t.dispose();for(const[,m]of v)m.length>0&&(r.push(...m),r.push(new oe.d));return r.length&&r.pop(),r}}let i=class r{constructor(t,v,m,p,_){var b,u;if(this._commandService=_,this.id=t.id,this.label=(m==null?void 0:m.renderShortTitle)&&t.shortTitle?typeof t.shortTitle=="string"?t.shortTitle:t.shortTitle.value:typeof t.title=="string"?t.title:t.title.value,this.tooltip=(u=typeof t.tooltip=="string"?t.tooltip:(b=t.tooltip)===null||b===void 0?void 0:b.value)!==null&&u!==void 0?u:"",this.enabled=!t.precondition||p.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const h=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=p.contextMatchesRules(h.condition),this.checked&&h.tooltip&&(this.tooltip=typeof h.tooltip=="string"?h.tooltip:h.tooltip.value),h.title&&(this.label=typeof h.title=="string"?h.title:h.title.value)}this.item=t,this.alt=v?new r(v,void 0,m,p,_):void 0,this._options=m,w.d.isThemeIcon(t.icon)&&(this.class=B.a.asClassName(t.icon))}dispose(){}run(...t){var v,m;let p=[];return((v=this._options)===null||v===void 0?void 0:v.arg)&&(p=[...p,this._options.arg]),((m=this._options)===null||m===void 0?void 0:m.shouldForwardArgs)&&(p=[...p,...t]),this._commandService.executeCommand(this.id,...p)}};i=g([f(3,N.b),f(4,j.b)],i)},ic2d:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return H});var oe=z("FWmy"),B=z("746U");class O{constructor(){this.data=new Map}add(I,C){oe.a(B.l(I)),oe.a(B.k(C)),oe.a(!this.data.has(I),"There is already an extension with this id"),this.data.set(I,C)}as(I){return this.data.get(I)||null}}const H=new O},nEHx:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return oe});var oe;(function(B){B.DARK="dark",B.LIGHT="light",B.HIGH_CONTRAST="hc"})(oe||(oe={}))},nnTU:function(Fe,ce,z){"use strict";z.d(ce,"b",function(){return j}),z.d(ce,"a",function(){return N});var oe=z("MI8n"),B=z("JYp7"),O=z("pmY6"),H=z("24hK"),I=z("746U"),C=z("Cg/j");const j=Object(C.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new oe.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,w){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!w)throw new Error("invalid command");return this.registerCommand({id:e,handler:w})}if(e.description){const a=[];for(let s of e.description.args)a.push(s.constraint);const l=e.handler;e.handler=function(s,...i){return Object(I.o)(i,a),l(s,...i)}}const{id:g}=e;let f=this._commands.get(g);f||(f=new H.a,this._commands.set(g,f));let o=f.unshift(e),n=Object(O.i)(()=>{o();const a=this._commands.get(g);(a==null?void 0:a.isEmpty())&&this._commands.delete(g)});return this._onDidRegisterCommand.fire(g),n}registerCommandAlias(e,w){return N.registerCommand(e,(g,...f)=>g.get(j).executeCommand(w,...f))}getCommand(e){const w=this._commands.get(e);return!w||w.isEmpty()?void 0:B.a.first(w)}getCommands(){const e=new Map;for(const w of this._commands.keys()){const g=this.getCommand(w);g&&e.set(w,g)}return e}};N.registerCommand("noop",()=>{})},p5ED:function(Fe,ce,z){"use strict";var oe=z("+L6B"),B=z("2/Rp"),O=z("5Dmo"),H=z("3S7+"),I=z("k1fw"),C=z("9og8"),j=z("tJVT"),N=z("WmNS"),e=z.n(N),w=z("q1tI"),g=z.n(w),f=z("vHTk"),o=z.n(f),n=z("yEEn"),a=z("ZW9T"),l=z("1vsH"),s=z("V0Rq"),i=z("m3rI");ce.a=function(r){var t,v,m,p,_,b,u,h=r.editOffice,c=h===void 0?"view":h,d=r.data,E=r.theme,y=r.type,T=r.filename,D=r.monacoEditor,L=r.className,x=r.style,k=r.close,U=r.onClose,R=r.hasMask,V=r.disabledDownload,Z=Object(w.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ue=Object(j.a)(Z,2),le=ue[0],ge=ue[1],pe=Object(w.useState)(""),ae=Object(j.a)(pe,2),ne=ae[0],fe=ae[1],q=Object(w.useState)(),M=Object(j.a)(q,2),S=M[0],A=M[1],F=window.ENV==="build"?"/react/build":"",K=i.a.PROXY_SERVER||location.origin,P,re=1024*1024,he=10*re,ye=Object(w.useRef)();(t=d)!==null&&t!==void 0&&t.startsWith("/api")&&y!=="txt"&&(d=(i.a.API_SERVER||location.origin)+d),y==="office"&&(P=Object(l.T)(d).filesize,P>he&&(y="other")),T&&D&&(D.filename=T),Object(w.useEffect)(function(){var _e,Ce,de=(_e=document.cookie)===null||_e===void 0||((Ce=_e.replace(/\s/g,""))===null||Ce===void 0)?void 0:Ce.split(";");de==null||de.map(function(Ee){var Te=Ee.split("=");Te[0]==="_educoder_session"&&fe(Te[1])})},[]),Object(w.useEffect)(function(){y==="office"&&J()},[y,d]);var J=function(){var _e=Object(C.a)(e.a.mark(function Ce(){var de,Ee,Te;return e.a.wrap(function(we){for(;;)switch(we.prev=we.next){case 0:return console.log("data:",d),de=d,d.startsWith("http")||(de=location.origin+de),Ee=new URL(de).pathname.split("/").pop(),we.next=6,Object(s.V)({attachment_id:Ee});case 6:Te=we.sent,A(Te);case 8:case"end":return we.stop()}},Ce)}));return function(){return _e.apply(this,arguments)}}(),se=function(){if(d.startsWith("http")||d.startsWith("blob:")){me();return}Object(l.z)(T||"educoder",d,T)},me=function(){Object(l.x)(T||"educoder",decodeURIComponent(d))};return g.a.createElement("div",{style:Object(I.a)({},x||{}),className:"".concat(R&&o.a.bgBlack," ").concat(y?o.a.wrp:"hide")},k&&g.a.createElement("div",{className:o.a.close,ref:ye},!V&&g.a.createElement(H.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return ye.current}},g.a.createElement("span",{onClick:me},g.a.createElement("i",{className:"icon-quxiaozhiding"}))),g.a.createElement(H.a,{title:"\u5173\u95ED",getPopupContainer:function(){return ye.current}},g.a.createElement("span",{className:"",onClick:U},g.a.createElement("i",{className:"icon-guanbi1"})))),g.a.createElement("div",{className:"".concat(o.a[L]," ").concat(L," ").concat(o.a.monaco," ").concat(y==="txt"?"show":"hide")},y==="txt"&&g.a.createElement(a.b,D)),y==="audio"&&g.a.createElement("audio",{src:"".concat(((v=d)===null||v===void 0?void 0:v.indexOf("http://"))>-1||((m=d)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),y==="video"&&g.a.createElement(g.a.Fragment,null,((p=d)===null||p===void 0?void 0:p.indexOf("http"))>-1?g.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):g.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),y==="office"&&S&&g.a.createElement("iframe",{src:"".concat(F,"/office.html?key=").concat(S.key,"&url=").concat(K+S.url,"&callbackUrl=").concat(K+S.callbackUrl,"&fileType=").concat(S.fileType,"&title=").concat(S.title,"&model=").concat(c,"&officeServer=").concat(i.a.OFFICE_SERVER,"&disabledDownload=").concat(!!V)}),y==="html"&&g.a.createElement("iframe",{src:d+"&disposition=inline"}),y==="pdf"&&g.a.createElement("iframe",{src:"".concat(F,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!V)}),y==="image"&&g.a.createElement("img",{src:"".concat(((_=d)===null||_===void 0?void 0:_.indexOf("http://"))>-1||((b=d)===null||b===void 0?void 0:b.indexOf("https://"))>-1||(u=d)!==null&&u!==void 0&&u.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),y==="other"&&g.a.createElement("div",null,g.a.createElement(B.a,{type:"primary",size:"large",onClick:se},g.a.createElement(n.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),y==="download"&&g.a.createElement(B.a,{type:"primary",size:"large",onClick:se},g.a.createElement(n.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Fe,ce,z){"use strict";z.d(ce,"h",function(){return w}),z.d(ce,"g",function(){return f}),z.d(ce,"f",function(){return o}),z.d(ce,"e",function(){return n}),z.d(ce,"i",function(){return a}),z.d(ce,"b",function(){return l}),z.d(ce,"a",function(){return s}),z.d(ce,"d",function(){return i}),z.d(ce,"c",function(){return r});var oe=z("C/vA"),B=z("JYp7");const O=!1;let H=null;function I(t){H=t}if(O){const t="__is_disposable_tracked__";I(new class{trackDisposable(v){const m=new Error("Potentially leaked disposable").stack;setTimeout(()=>{v[t]||console.log(m)},3e3)}setParent(v,m){if(v&&v!==s.None)try{v[t]=!0}catch(p){}}markAsDisposed(v){if(v&&v!==s.None)try{v[t]=!0}catch(m){}}markAsSingleton(v){}})}function C(t){return H==null||H.trackDisposable(t),t}function j(t){H==null||H.markAsDisposed(t)}function N(t,v){H==null||H.setParent(t,v)}function e(t,v){if(!H)return;for(const m of t)H.setParent(m,v)}function w(t){return H==null||H.markAsSingleton(t),t}class g extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function f(t){return typeof t.dispose=="function"&&t.dispose.length===0}function o(t){if(B.a.is(t)){let v=[];for(const m of t)if(m)try{m.dispose()}catch(p){v.push(p)}if(v.length===1)throw v[0];if(v.length>1)throw new g(v);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function n(...t){const v=a(()=>o(t));return e(t,v),v}function a(t){const v=C({dispose:Object(oe.a)(()=>{j(v),t()})});return v}class l{constructor(){this._toDispose=new Set,this._isDisposed=!1,C(this)}dispose(){if(this._isDisposed)return;j(this),this._isDisposed=!0,this.clear()}clear(){try{o(this._toDispose.values())}finally{this._toDispose.clear()}}add(t){if(!t)return t;if(t===this)throw new Error("Cannot register a disposable on itself!");return N(t,this),this._isDisposed?l.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(t),t}}l.DISABLE_DISPOSED_WARNING=!1;class s{constructor(){this._store=new l,C(this),N(this._store,this)}dispose(){j(this),this._store.dispose()}_register(t){if(t===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(t)}}s.None=Object.freeze({dispose(){}});class i{constructor(){this._isDisposed=!1,C(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var v;if(this._isDisposed||t===this._value)return;(v=this._value)===null||v===void 0||v.dispose(),t&&N(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,j(this),(t=this._value)===null||t===void 0||t.dispose(),this._value=void 0}clearAndLeak(){const t=this._value;return this._value=void 0,t&&N(t,null),t}}class r{constructor(t){this.object=t}dispose(){}}},psGv:function(Fe,ce,z){var oe,B;(function(){var O;(function(){"use strict";var j=[,,function(g){function f(a){this.__parent=a,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=[]}f.prototype.clone_empty=function(){var a=new f(this.__parent);return a.set_indent(this.__indent_count,this.__alignment_count),a},f.prototype.item=function(a){return a<0?this.__items[this.__items.length+a]:this.__items[a]},f.prototype.has_match=function(a){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(a))return!0;return!1},f.prototype.set_indent=function(a,l){this.is_empty()&&(this.__indent_count=a||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},f.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)},f.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},f.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var a=this.__parent.current_line;return a.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),a.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),a.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,a.__items[0]===" "&&(a.__items.splice(0,1),a.__character_count-=1),!0}return!1},f.prototype.is_empty=function(){return this.__items.length===0},f.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},f.prototype.push=function(a){this.__items.push(a);var l=a.lastIndexOf(`
`);l!==-1?this.__character_count=a.length-l:this.__character_count+=a.length},f.prototype.pop=function(){var a=null;return this.is_empty()||(a=this.__items.pop(),this.__character_count-=a.length),a},f.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},f.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},f.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},f.prototype.toString=function(){var a="";return this.is_empty()?this.__parent.indent_empty_lines&&(a=this.__parent.get_indent_string(this.__indent_count)):(a=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),a+=this.__items.join("")),a};function o(a,l){this.__cache=[""],this.__indent_size=a.indent_size,this.__indent_string=a.indent_char,a.indent_with_tabs||(this.__indent_string=new Array(a.indent_size+1).join(a.indent_char)),l=l||"",a.indent_level>0&&(l=new Array(a.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}o.prototype.get_indent_size=function(a,l){var s=this.__base_string_length;return l=l||0,a<0&&(s=0),s+=a*this.__indent_size,s+=l,s},o.prototype.get_indent_string=function(a,l){var s=this.__base_string;return l=l||0,a<0&&(a=0,s=""),l+=a*this.__indent_size,this.__ensure_cache(l),s+=this.__cache[l],s},o.prototype.__ensure_cache=function(a){for(;a>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var a=this.__cache.length,l=0,s="";this.__indent_size&&a>=this.__indent_size&&(l=Math.floor(a/this.__indent_size),a-=l*this.__indent_size,s=new Array(l+1).join(this.__indent_string)),a&&(s+=new Array(a+1).join(" ")),this.__cache.push(s)};function n(a,l){this.__indent_cache=new o(a,l),this.raw=!1,this._end_with_newline=a.end_with_newline,this.indent_size=a.indent_size,this.wrap_line_length=a.wrap_line_length,this.indent_empty_lines=a.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new f(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}n.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},n.prototype.get_line_number=function(){return this.__lines.length},n.prototype.get_indent_string=function(a,l){return this.__indent_cache.get_indent_string(a,l)},n.prototype.get_indent_size=function(a,l){return this.__indent_cache.get_indent_size(a,l)},n.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},n.prototype.add_new_line=function(a){return this.is_empty()||!a&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},n.prototype.get_code=function(a){this.trim(!0);var l=this.current_line.pop();l&&(l[l.length-1]===`
`&&(l=l.replace(/\n+$/g,"")),this.current_line.push(l)),this._end_with_newline&&this.__add_outputline();var s=this.__lines.join(`
`);return a!==`
`&&(s=s.replace(/[\n]/g,a)),s},n.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},n.prototype.set_indent=function(a,l){return a=a||0,l=l||0,this.next_line.set_indent(a,l),this.__lines.length>1?(this.current_line.set_indent(a,l),!0):(this.current_line.set_indent(),!1)},n.prototype.add_raw_token=function(a){for(var l=0;l<a.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(a.whitespace_before),this.current_line.push(a.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},n.prototype.add_token=function(a){this.__add_space_before_token(),this.current_line.push(a),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},n.prototype.__add_space_before_token=function(){this.space_before_token&&!this.just_added_newline()&&(this.non_breaking_space||this.set_wrap_point(),this.current_line.push(" "))},n.prototype.remove_indent=function(a){for(var l=this.__lines.length;a<l;)this.__lines[a]._remove_indent(),a++;this.current_line._remove_wrap_indent()},n.prototype.trim=function(a){for(a=a===void 0?!1:a,this.current_line.trim();a&&this.__lines.length>1&&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},n.prototype.just_added_newline=function(){return this.current_line.is_empty()},n.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},n.prototype.ensure_empty_line_above=function(a,l){for(var s=this.__lines.length-2;s>=0;){var i=this.__lines[s];if(i.is_empty())break;if(i.item(0).indexOf(a)!==0&&i.item(-1)!==l){this.__lines.splice(s+1,0,new f(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},g.exports.Output=n},function(g){function f(o,n,a,l){this.type=o,this.text=n,this.comments_before=null,this.newlines=a||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}g.exports.Token=f},,,function(g){function f(a,l){this.raw_options=o(a,l),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"])}f.prototype._get_array=function(a,l){var s=this.raw_options[a],i=l||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(i=s.concat()):typeof s=="string"&&(i=s.split(/[^a-zA-Z0-9_\/\-]+/)),i},f.prototype._get_boolean=function(a,l){var s=this.raw_options[a],i=s===void 0?!!l:!!s;return i},f.prototype._get_characters=function(a,l){var s=this.raw_options[a],i=l||"";return typeof s=="string"&&(i=s.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),i},f.prototype._get_number=function(a,l){var s=this.raw_options[a];l=parseInt(l,10),isNaN(l)&&(l=0);var i=parseInt(s,10);return isNaN(i)&&(i=l),i},f.prototype._get_selection=function(a,l,s){var i=this._get_selection_list(a,l,s);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+a+`' can only be one of the following values:
`+l+`
You passed in: '`+this.raw_options[a]+"'");return i[0]},f.prototype._get_selection_list=function(a,l,s){if(!l||l.length===0)throw new Error("Selection list cannot be empty.");if(s=s||[l[0]],!this._is_valid_selection(s,l))throw new Error("Invalid Default Value!");var i=this._get_array(a,s);if(!this._is_valid_selection(i,l))throw new Error("Invalid Option Value: The option '"+a+`' can contain only the following values:
`+l+`
You passed in: '`+this.raw_options[a]+"'");return i},f.prototype._is_valid_selection=function(a,l){return a.length&&l.length&&!a.some(function(s){return l.indexOf(s)===-1})};function o(a,l){var s={};a=n(a);var i;for(i in a)i!==l&&(s[i]=a[i]);if(l&&a[l])for(i in a[l])s[i]=a[l][i];return s}function n(a){var l={},s;for(s in a){var i=s.replace(/-/g,"_");l[i]=a[s]}return l}g.exports.Options=f,g.exports.normalizeOpts=n,g.exports.mergeOpts=o},,function(g){var f=RegExp.prototype.hasOwnProperty("sticky");function o(n){this.__input=n||"",this.__input_length=this.__input.length,this.__position=0}o.prototype.restart=function(){this.__position=0},o.prototype.back=function(){this.__position>0&&(this.__position-=1)},o.prototype.hasNext=function(){return this.__position<this.__input_length},o.prototype.next=function(){var n=null;return this.hasNext()&&(n=this.__input.charAt(this.__position),this.__position+=1),n},o.prototype.peek=function(n){var a=null;return n=n||0,n+=this.__position,n>=0&&n<this.__input_length&&(a=this.__input.charAt(n)),a},o.prototype.__match=function(n,a){n.lastIndex=a;var l=n.exec(this.__input);return l&&!(f&&n.sticky)&&(l.index!==a&&(l=null)),l},o.prototype.test=function(n,a){return a=a||0,a+=this.__position,a>=0&&a<this.__input_length?!!this.__match(n,a):!1},o.prototype.testChar=function(n,a){var l=this.peek(a);return n.lastIndex=0,l!==null&&n.test(l)},o.prototype.match=function(n){var a=this.__match(n,this.__position);return a?this.__position+=a[0].length:a=null,a},o.prototype.read=function(n,a,l){var s="",i;return n&&(i=this.match(n),i&&(s+=i[0])),a&&(i||!n)&&(s+=this.readUntil(a,l)),s},o.prototype.readUntil=function(n,a){var l="",s=this.__position;n.lastIndex=this.__position;var i=n.exec(this.__input);return i?(s=i.index,a&&(s+=i[0].length)):s=this.__input_length,l=this.__input.substring(this.__position,s),this.__position=s,l},o.prototype.readUntilAfter=function(n){return this.readUntil(n,!0)},o.prototype.get_regexp=function(n,a){var l=null,s="g";return a&&f&&(s="y"),typeof n=="string"&&n!==""?l=new RegExp(n,s):n&&(l=new RegExp(n.source,s)),l},o.prototype.get_literal_regexp=function(n){return RegExp(n.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(n){var a=this.__position,l=this.readUntilAfter(n);return this.__position=a,l},o.prototype.lookBack=function(n){var a=this.__position-1;return a>=n.length&&this.__input.substring(a-n.length,a).toLowerCase()===n},g.exports.InputScanner=o},function(g,f,o){var n=o(8).InputScanner,a=o(3).Token,l=o(10).TokenStream,s=o(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},r=function(t,v){this._input=new n(t),this._options=v||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};r.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var t,v=new a(i.START,""),m=null,p=[],_=new l;v.type!==i.EOF;){for(t=this._get_next_token(v,m);this._is_comment(t);)_.add(t),t=this._get_next_token(v,m);_.isEmpty()||(t.comments_before=_,_=new l),t.parent=m,this._is_opening(t)?(p.push(m),m=t):m&&this._is_closing(t,m)&&(t.opened=m,m.closed=t,m=p.pop(),t.parent=m),t.previous=v,v.next=t,this.__tokens.add(t),v=t}return this.__tokens},r.prototype._is_first_token=function(){return this.__tokens.isEmpty()},r.prototype._reset=function(){},r.prototype._get_next_token=function(t,v){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(i.RAW,m):this._create_token(i.EOF,"")},r.prototype._is_comment=function(t){return!1},r.prototype._is_opening=function(t){return!1},r.prototype._is_closing=function(t,v){return!1},r.prototype._create_token=function(t,v){var m=new a(t,v,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},r.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},g.exports.Tokenizer=r,g.exports.TOKEN=i},function(g){function f(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}f.prototype.restart=function(){this.__position=0},f.prototype.isEmpty=function(){return this.__tokens_length===0},f.prototype.hasNext=function(){return this.__position<this.__tokens_length},f.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},f.prototype.peek=function(o){var n=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(n=this.__tokens[o]),n},f.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},g.exports.TokenStream=f},function(g,f,o){var n=o(12).Pattern;function a(l,s){n.call(this,l,s),s?this._line_regexp=this._input.get_regexp(s._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}a.prototype=new n,a.prototype.__set_whitespace_patterns=function(l,s){l+="\\t ",s+="\\n\\r",this._match_pattern=this._input.get_regexp("["+l+s+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+s+"]")},a.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var l=this._input.read(this._match_pattern);if(l===" ")this.whitespace_before_token=" ";else if(l){var s=this.__split(this._newline_regexp,l);this.newline_count=s.length-1,this.whitespace_before_token=s[this.newline_count]}return l},a.prototype.matching=function(l,s){var i=this._create();return i.__set_whitespace_patterns(l,s),i._update(),i},a.prototype._create=function(){return new a(this._input,this)},a.prototype.__split=function(l,s){l.lastIndex=0;for(var i=0,r=[],t=l.exec(s);t;)r.push(s.substring(i,t.index)),i=t.index+t[0].length,t=l.exec(s);return i<s.length?r.push(s.substring(i,s.length)):r.push(""),r},g.exports.WhitespacePattern=a},function(g){function f(o,n){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,n&&(this._starting_pattern=this._input.get_regexp(n._starting_pattern,!0),this._match_pattern=this._input.get_regexp(n._match_pattern,!0),this._until_pattern=this._input.get_regexp(n._until_pattern),this._until_after=n._until_after)}f.prototype.read=function(){var o=this._input.read(this._starting_pattern);return(!this._starting_pattern||o)&&(o+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),o},f.prototype.read_match=function(){return this._input.match(this._match_pattern)},f.prototype.until_after=function(o){var n=this._create();return n._until_after=!0,n._until_pattern=this._input.get_regexp(o),n._update(),n},f.prototype.until=function(o){var n=this._create();return n._until_after=!1,n._until_pattern=this._input.get_regexp(o),n._update(),n},f.prototype.starting_with=function(o){var n=this._create();return n._starting_pattern=this._input.get_regexp(o,!0),n._update(),n},f.prototype.matching=function(o){var n=this._create();return n._match_pattern=this._input.get_regexp(o,!0),n._update(),n},f.prototype._create=function(){return new f(this._input,this)},f.prototype._update=function(){},g.exports.Pattern=f},function(g){function f(o,n){o=typeof o=="string"?o:o.source,n=typeof n=="string"?n:n.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+n,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+n,"g")}f.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var n={};this.__directive_pattern.lastIndex=0;for(var a=this.__directive_pattern.exec(o);a;)n[a[1]]=a[2],a=this.__directive_pattern.exec(o);return n},f.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},g.exports.Directives=f},function(g,f,o){var n=o(12).Pattern,a={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(s,i){n.call(this,s,i),this.__template_pattern=null,this._disabled=Object.assign({},a),this._excluded=Object.assign({},a),i&&(this.__template_pattern=this._input.get_regexp(i.__template_pattern),this._excluded=Object.assign(this._excluded,i._excluded),this._disabled=Object.assign(this._disabled,i._disabled));var r=new n(s);this.__patterns={handlebars_comment:r.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:r.starting_with(/{{{/).until_after(/}}}/),handlebars:r.starting_with(/{{/).until_after(/}}/),php:r.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:r.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:r.starting_with(/{%/).until_after(/%}/),django_value:r.starting_with(/{{/).until_after(/}}/),django_comment:r.starting_with(/{#/).until_after(/#}/),smarty:r.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:r.starting_with(/{\*/).until_after(/\*}/),smarty_literal:r.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new n,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(s){var i=this._create();return i._disabled[s]=!0,i._update(),i},l.prototype.read_options=function(s){var i=this._create();for(var r in a)i._disabled[r]=s.templating.indexOf(r)===-1;return i._update(),i},l.prototype.exclude=function(s){var i=this._create();return i._excluded[s]=!0,i._update(),i},l.prototype.read=function(){var s="";this._match_pattern?s=this._input.read(this._starting_pattern):s=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),s+=i,i=this._read_template();return this._until_after&&(s+=this._input.readUntilAfter(this._until_pattern)),s},l.prototype.__set_templated_pattern=function(){var s=[];this._disabled.php||s.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||s.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||s.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(s.push(this.__patterns.django._starting_pattern.source),s.push(this.__patterns.django_value._starting_pattern.source),s.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||s.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&s.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+s.join("|")+")")},l.prototype._read_template=function(){var s="",i=this._input.peek();if(i==="<"){var r=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&r==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&r==="%"&&(s=s||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(s=s||this.__patterns.handlebars_comment.read(),s=s||this.__patterns.handlebars_unescaped.read(),s=s||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(s=s||this.__patterns.django_value.read()),this._excluded.django||(s=s||this.__patterns.django_comment.read(),s=s||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(s=s||this.__patterns.smarty_comment.read(),s=s||this.__patterns.smarty_literal.read(),s=s||this.__patterns.smarty.read()));return s},g.exports.TemplatablePattern=l},,,,function(g,f,o){var n=o(19).Beautifier,a=o(20).Options;function l(s,i,r,t){var v=new n(s,i,r,t);return v.beautify()}g.exports=l,g.exports.defaultOptions=function(){return new a}},function(g,f,o){var n=o(20).Options,a=o(2).Output,l=o(21).Tokenizer,s=o(21).TOKEN,i=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,t=function(E,y){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=E.max_preserve_newlines,this.preserve_newlines=E.preserve_newlines,this._output=new a(E,y)};t.prototype.current_line_has_match=function(E){return this._output.current_line.has_match(E)},t.prototype.set_space_before_token=function(E,y){this._output.space_before_token=E,this._output.non_breaking_space=y},t.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},t.prototype.add_raw_token=function(E){this._output.add_raw_token(E)},t.prototype.print_preserved_newlines=function(E){var y=0;E.type!==s.TEXT&&E.previous.type!==s.TEXT&&(y=E.newlines?1:0),this.preserve_newlines&&(y=E.newlines<this.max_preserve_newlines+1?E.newlines:this.max_preserve_newlines+1);for(var T=0;T<y;T++)this.print_newline(T>0);return y!==0},t.prototype.traverse_whitespace=function(E){return E.whitespace_before||E.newlines?(this.print_preserved_newlines(E)||(this._output.space_before_token=!0),!0):!1},t.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},t.prototype.print_newline=function(E){this._output.add_new_line(E)},t.prototype.print_token=function(E){E.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(E.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(E){return E=this.indent_level+(E||0),E<1?"":this._output.get_indent_string(E)};var v=function(E){for(var y=null,T=E.next;T.type!==s.EOF&&E.closed!==T;){if(T.type===s.ATTRIBUTE&&T.text==="type"){T.next&&T.next.type===s.EQUALS&&T.next.next&&T.next.next.type===s.VALUE&&(y=T.next.next.text);break}T=T.next}return y},m=function(E,y){var T=null,D=null;return y.closed?(E==="script"?T="text/javascript":E==="style"&&(T="text/css"),T=v(y)||T,T.search("text/css")>-1?D="css":T.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?D="javascript":T.search(/(text|application|dojo)\/(x-)?(html)/)>-1?D="html":T.search(/test\/null/)>-1&&(D="null"),D):null};function p(E,y){return y.indexOf(E)!==-1}function _(E,y,T){this.parent=E||null,this.tag=y?y.tag_name:"",this.indent_level=T||0,this.parser_token=y||null}function b(E){this._printer=E,this._current_frame=null}b.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},b.prototype.record_tag=function(E){var y=new _(this._current_frame,E,this._printer.indent_level);this._current_frame=y},b.prototype._try_pop_frame=function(E){var y=null;return E&&(y=E.parser_token,this._printer.indent_level=E.indent_level,this._current_frame=E.parent),y},b.prototype._get_frame=function(E,y){for(var T=this._current_frame;T&&!(E.indexOf(T.tag)!==-1);){if(y&&y.indexOf(T.tag)!==-1){T=null;break}T=T.parent}return T},b.prototype.try_pop=function(E,y){var T=this._get_frame([E],y);return this._try_pop_frame(T)},b.prototype.indent_to_tag=function(E){var y=this._get_frame(E);y&&(this._printer.indent_level=y.indent_level)};function u(E,y,T,D){this._source_text=E||"",y=y||{},this._js_beautify=T,this._css_beautify=D,this._tag_stack=null;var L=new n(y,"html");this._options=L,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"}u.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,y=this._options.eol;this._options.eol==="auto"&&(y=`
`,E&&i.test(E)&&(y=E.match(i)[0])),E=E.replace(r,`
`);var T=E.match(/^[\t ]*/)[0],D={text:"",type:""},L=new h,x=new t(this._options,T),k=new l(E,this._options).tokenize();this._tag_stack=new b(x);for(var U=null,R=k.next();R.type!==s.EOF;)R.type===s.TAG_OPEN||R.type===s.COMMENT?(U=this._handle_tag_open(x,R,L,D),L=U):R.type===s.ATTRIBUTE||R.type===s.EQUALS||R.type===s.VALUE||R.type===s.TEXT&&!L.tag_complete?U=this._handle_inside_tag(x,R,L,k):R.type===s.TAG_CLOSE?U=this._handle_tag_close(x,R,L):R.type===s.TEXT?U=this._handle_text(x,R,L):x.add_raw_token(R),D=U,R=k.next();var V=x._output.get_code(y);return V},u.prototype._handle_tag_close=function(E,y,T){var D={text:y.text,type:y.type};return E.alignment_size=0,T.tag_complete=!0,E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),T.is_unformatted?E.add_raw_token(y):(T.tag_start_char==="<"&&(E.set_space_before_token(y.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&T.has_wrapped_attrs&&E.print_newline(!1)),E.print_token(y)),T.indent_content&&!(T.is_unformatted||T.is_content_unformatted)&&(E.indent(),T.indent_content=!1),!T.is_inline_element&&!(T.is_unformatted||T.is_content_unformatted)&&E.set_wrap_point(),D},u.prototype._handle_inside_tag=function(E,y,T,D){var L=T.has_wrapped_attrs,x={text:y.text,type:y.type};if(E.set_space_before_token(y.newlines||y.whitespace_before!=="",!0),T.is_unformatted)E.add_raw_token(y);else if(T.tag_start_char==="{"&&y.type===s.TEXT)E.print_preserved_newlines(y)?(y.newlines=0,E.add_raw_token(y)):E.print_token(y);else{if(y.type===s.ATTRIBUTE?(E.set_space_before_token(!0),T.attr_count+=1):(y.type===s.EQUALS||y.type===s.VALUE&&y.previous.type===s.EQUALS)&&E.set_space_before_token(!1),y.type===s.ATTRIBUTE&&T.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(E.traverse_whitespace(y),L=L||y.newlines!==0),this._is_wrap_attributes_force)){var k=T.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&T.attr_count===1){var U=!0,R=0,V;do{if(V=D.peek(R),V.type===s.ATTRIBUTE){U=!1;break}R+=1}while(R<4&&V.type!==s.EOF&&V.type!==s.TAG_CLOSE);k=!U}k&&(E.print_newline(!1),L=!0)}E.print_token(y),L=L||E.previous_token_wrapped(),T.has_wrapped_attrs=L}return x},u.prototype._handle_text=function(E,y,T){var D={text:y.text,type:"TK_CONTENT"};return T.custom_beautifier_name?this._print_custom_beatifier_text(E,y,T):T.is_unformatted||T.is_content_unformatted?E.add_raw_token(y):(E.traverse_whitespace(y),E.print_token(y)),D},u.prototype._print_custom_beatifier_text=function(E,y,T){var D=this;if(y.text!==""){var L=y.text,x,k=1,U="",R="";T.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?x=this._js_beautify:T.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?x=this._css_beautify:T.custom_beautifier_name==="html"&&(x=function(pe,ae){var ne=new u(pe,ae,D._js_beautify,D._css_beautify);return ne.beautify()}),this._options.indent_scripts==="keep"?k=0:this._options.indent_scripts==="separate"&&(k=-E.indent_level);var V=E.get_full_indent(k);if(L=L.replace(/\n[ \t]*$/,""),T.custom_beautifier_name!=="html"&&L[0]==="<"&&L.match(/^(<!--|<!\[CDATA\[)/)){var Z=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(L);if(!Z){E.add_raw_token(y);return}U=V+Z[1]+`
`,L=Z[4],Z[5]&&(R=V+Z[5]),L=L.replace(/\n[ \t]*$/,""),(Z[2]||Z[3].indexOf(`
`)!==-1)&&(Z=Z[3].match(/[ \t]+$/),Z&&(y.whitespace_before=Z[0]))}if(L)if(x){var ue=function(){this.eol=`
`};ue.prototype=this._options.raw_options;var le=new ue;L=x(V+L,le)}else{var ge=y.whitespace_before;ge&&(L=L.replace(new RegExp(`
(`+ge+")?","g"),`
`)),L=V+L.replace(/\n/g,`
`+V)}U&&(L?L=U+L+`
`+R:L=U+R),E.print_newline(!1),L&&(y.text=L,y.whitespace_before="",y.newlines=0,E.add_raw_token(y),E.print_newline(!0))}},u.prototype._handle_tag_open=function(E,y,T,D){var L=this._get_tag_open_token(y);return(T.is_unformatted||T.is_content_unformatted)&&!T.is_empty_element&&y.type===s.TAG_OPEN&&y.text.indexOf("</")===0?(E.add_raw_token(y),L.start_tag_token=this._tag_stack.try_pop(L.tag_name)):(E.traverse_whitespace(y),this._set_tag_position(E,y,L,T,D),L.is_inline_element||E.set_wrap_point(),E.print_token(y)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(L.alignment_size=y.text.length+1),!L.tag_complete&&!L.is_unformatted&&(E.alignment_size=L.alignment_size),L};var h=function(E,y){if(this.parent=E||null,this.text="",this.type="TK_TAG_OPEN",this.tag_name="",this.is_inline_element=!1,this.is_unformatted=!1,this.is_content_unformatted=!1,this.is_empty_element=!1,this.is_start_tag=!1,this.is_end_tag=!1,this.indent_content=!1,this.multiline_content=!1,this.custom_beautifier_name=null,this.start_tag_token=null,this.attr_count=0,this.has_wrapped_attrs=!1,this.alignment_size=0,this.tag_complete=!1,this.tag_start_char="",this.tag_check="",!y)this.tag_complete=!0;else{var T;this.tag_start_char=y.text[0],this.text=y.text,this.tag_start_char==="<"?(T=y.text.match(/^<([^\s>]*)/),this.tag_check=T?T[1]:""):(T=y.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=T?T[1]:"",(y.text.startsWith("{{#>")||y.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&y.next!==null?this.tag_check=y.next.text.split(" ")[0]:this.tag_check=y.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),y.type===s.COMMENT&&(this.tag_complete=!0),this.is_start_tag=this.tag_check.charAt(0)!=="/",this.tag_name=this.is_start_tag?this.tag_check:this.tag_check.substr(1),this.is_end_tag=!this.is_start_tag||y.closed&&y.closed.text==="/>";var D=2;this.tag_start_char==="{"&&this.text.length>=3&&(this.text.charAt(2)==="~"&&(D=3)),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(D)))}};u.prototype._get_tag_open_token=function(E){var y=new h(this._tag_stack.get_parser_token(),E);return y.alignment_size=this._options.wrap_attributes_indent_size,y.is_end_tag=y.is_end_tag||p(y.tag_check,this._options.void_elements),y.is_empty_element=y.tag_complete||y.is_start_tag&&y.is_end_tag,y.is_unformatted=!y.tag_complete&&p(y.tag_check,this._options.unformatted),y.is_content_unformatted=!y.is_empty_element&&p(y.tag_check,this._options.content_unformatted),y.is_inline_element=p(y.tag_name,this._options.inline)||y.tag_name.includes("-")||y.tag_start_char==="{",y},u.prototype._set_tag_position=function(E,y,T,D,L){if(T.is_empty_element||(T.is_end_tag?T.start_tag_token=this._tag_stack.try_pop(T.tag_name):(this._do_optional_end_element(T)&&(T.is_inline_element||E.print_newline(!1)),this._tag_stack.record_tag(T),(T.tag_name==="script"||T.tag_name==="style")&&!(T.is_unformatted||T.is_content_unformatted)&&(T.custom_beautifier_name=m(T.tag_check,y)))),p(T.tag_check,this._options.extra_liners)&&(E.print_newline(!1),E._output.just_added_blankline()||E.print_newline(!0)),T.is_empty_element){if(T.tag_start_char==="{"&&T.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),T.indent_content=!0;var x=E.current_line_has_match(/{{#if/);x||E.print_newline(!1)}T.tag_name==="!--"&&L.type===s.TAG_CLOSE&&D.is_end_tag&&T.text.indexOf(`
`)===-1||(T.is_inline_element||T.is_unformatted||E.print_newline(!1),this._calcluate_parent_multiline(E,T))}else if(T.is_end_tag){var k=!1;k=T.start_tag_token&&T.start_tag_token.multiline_content,k=k||!T.is_inline_element&&!(D.is_inline_element||D.is_unformatted)&&!(L.type===s.TAG_CLOSE&&T.start_tag_token===D)&&L.type!=="TK_CONTENT",(T.is_content_unformatted||T.is_unformatted)&&(k=!1),k&&E.print_newline(!1)}else T.indent_content=!T.custom_beautifier_name,T.tag_start_char==="<"&&(T.tag_name==="html"?T.indent_content=this._options.indent_inner_html:T.tag_name==="head"?T.indent_content=this._options.indent_head_inner_html:T.tag_name==="body"&&(T.indent_content=this._options.indent_body_inner_html)),!(T.is_inline_element||T.is_unformatted)&&(L.type!=="TK_CONTENT"||T.is_content_unformatted)&&E.print_newline(!1),this._calcluate_parent_multiline(E,T)},u.prototype._calcluate_parent_multiline=function(E,y){y.parent&&E._output.just_added_newline()&&!((y.is_inline_element||y.is_unformatted)&&y.parent.is_inline_element)&&(y.parent.multiline_content=!0)};var c=["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"],d=["a","audio","del","ins","map","noscript","video"];u.prototype._do_optional_end_element=function(E){var y=null;if(E.is_empty_element||!E.is_start_tag||!E.parent)return;if(E.tag_name==="body")y=y||this._tag_stack.try_pop("head");else if(E.tag_name==="li")y=y||this._tag_stack.try_pop("li",["ol","ul"]);else if(E.tag_name==="dd"||E.tag_name==="dt")y=y||this._tag_stack.try_pop("dt",["dl"]),y=y||this._tag_stack.try_pop("dd",["dl"]);else if(E.parent.tag_name==="p"&&c.indexOf(E.tag_name)!==-1){var T=E.parent.parent;(!T||d.indexOf(T.tag_name)===-1)&&(y=y||this._tag_stack.try_pop("p"))}else E.tag_name==="rp"||E.tag_name==="rt"?(y=y||this._tag_stack.try_pop("rt",["ruby","rtc"]),y=y||this._tag_stack.try_pop("rp",["ruby","rtc"])):E.tag_name==="optgroup"?y=y||this._tag_stack.try_pop("optgroup",["select"]):E.tag_name==="option"?y=y||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):E.tag_name==="colgroup"?y=y||this._tag_stack.try_pop("caption",["table"]):E.tag_name==="thead"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"])):E.tag_name==="tbody"||E.tag_name==="tfoot"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("thead",["table"]),y=y||this._tag_stack.try_pop("tbody",["table"])):E.tag_name==="tr"?(y=y||this._tag_stack.try_pop("caption",["table"]),y=y||this._tag_stack.try_pop("colgroup",["table"]),y=y||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(E.tag_name==="th"||E.tag_name==="td")&&(y=y||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),y=y||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return E.parent=this._tag_stack.get_parser_token(),y},g.exports.Beautifier=u},function(g,f,o){var n=o(6).Options;function a(l){n.call(this,l,"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"])}a.prototype=new n,g.exports.Options=a},function(g,f,o){var n=o(9).Tokenizer,a=o(9).TOKEN,l=o(13).Directives,s=o(14).TemplatablePattern,i=o(12).Pattern,r={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:a.START,RAW:a.RAW,EOF:a.EOF},t=new l(/<\!--/,/-->/),v=function(m,p){n.call(this,m,p),this._current_tag_name="";var _=new s(this._input).read_options(this._options),b=new i(this._input);if(this.__patterns={word:_.until(/[\n\r\t <]/),single_quote:_.until_after(/'/),double_quote:_.until_after(/"/),attribute:_.until(/[\n\r\t =>]|\/>/),element_name:_.until(/[\n\r\t >\/]/),handlebars_comment:b.starting_with(/{{!--/).until_after(/--}}/),handlebars:b.starting_with(/{{/).until_after(/}}/),handlebars_open:b.until(/[\n\r\t }]/),handlebars_raw_close:b.until(/}}/),comment:b.starting_with(/<!--/).until_after(/-->/),cdata:b.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:b.starting_with(/<!\[/).until_after(/]>/),processing:b.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 u=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=b.matching(u).until_after(u)}};v.prototype=new n,v.prototype._is_comment=function(m){return!1},v.prototype._is_opening=function(m){return m.type===r.TAG_OPEN},v.prototype._is_closing=function(m,p){return m.type===r.TAG_CLOSE&&p&&((m.text===">"||m.text==="/>")&&p.text[0]==="<"||m.text==="}}"&&p.text[0]==="{"&&p.text[1]==="{")},v.prototype._reset=function(){this._current_tag_name=""},v.prototype._get_next_token=function(m,p){var _=null;this._readWhitespace();var b=this._input.peek();return b===null?this._create_token(r.EOF,""):(_=_||this._read_open_handlebars(b,p),_=_||this._read_attribute(b,m,p),_=_||this._read_close(b,p),_=_||this._read_raw_content(b,m,p),_=_||this._read_content_word(b),_=_||this._read_comment_or_cdata(b),_=_||this._read_processing(b),_=_||this._read_open(b,p),_=_||this._create_token(r.UNKNOWN,this._input.next()),_)},v.prototype._read_comment_or_cdata=function(m){var p=null,_=null,b=null;if(m==="<"){var u=this._input.peek(1);u==="!"&&(_=this.__patterns.comment.read(),_?(b=t.get_directives(_),b&&b.ignore==="start"&&(_+=t.readIgnored(this._input))):_=this.__patterns.cdata.read()),_&&(p=this._create_token(r.COMMENT,_),p.directives=b)}return p},v.prototype._read_processing=function(m){var p=null,_=null,b=null;if(m==="<"){var u=this._input.peek(1);(u==="!"||u==="?")&&(_=this.__patterns.conditional_comment.read(),_=_||this.__patterns.processing.read()),_&&(p=this._create_token(r.COMMENT,_),p.directives=b)}return p},v.prototype._read_open=function(m,p){var _=null,b=null;return p||m==="<"&&(_=this._input.next(),this._input.peek()==="/"&&(_+=this._input.next()),_+=this.__patterns.element_name.read(),b=this._create_token(r.TAG_OPEN,_)),b},v.prototype._read_open_handlebars=function(m,p){var _=null,b=null;return p||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(_=this.__patterns.handlebars_comment.read(),_=_||this.__patterns.handlebars.read(),b=this._create_token(r.COMMENT,_)):(_=this.__patterns.handlebars_open.read(),b=this._create_token(r.TAG_OPEN,_))),b},v.prototype._read_close=function(m,p){var _=null,b=null;return p&&(p.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(_=this._input.next(),m==="/"&&(_+=this._input.next()),b=this._create_token(r.TAG_CLOSE,_)):p.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),b=this._create_token(r.TAG_CLOSE,"}}"))),b},v.prototype._read_attribute=function(m,p,_){var b=null,u="";if(_&&_.text[0]==="<")if(m==="=")b=this._create_token(r.EQUALS,this._input.next());else if(m==='"'||m==="'"){var h=this._input.next();m==='"'?h+=this.__patterns.double_quote.read():h+=this.__patterns.single_quote.read(),b=this._create_token(r.VALUE,h)}else u=this.__patterns.attribute.read(),u&&(p.type===r.EQUALS?b=this._create_token(r.VALUE,u):b=this._create_token(r.ATTRIBUTE,u));return b},v.prototype._is_content_unformatted=function(m){return this._options.void_elements.indexOf(m)===-1&&(this._options.content_unformatted.indexOf(m)!==-1||this._options.unformatted.indexOf(m)!==-1)},v.prototype._read_raw_content=function(m,p,_){var b="";if(_&&_.text[0]==="{")b=this.__patterns.handlebars_raw_close.read();else if(p.type===r.TAG_CLOSE&&p.opened.text[0]==="<"&&p.text[0]!=="/"){var u=p.opened.text.substr(1).toLowerCase();if(u==="script"||u==="style"){var h=this._read_comment_or_cdata(m);if(h)return h.type=r.TEXT,h;b=this._input.readUntil(new RegExp("</"+u+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(u)&&(b=this._input.readUntil(new RegExp("</"+u+"[\\n\\r\\t ]*?>","ig")))}return b?this._create_token(r.TEXT,b):null},v.prototype._read_content_word=function(m){var p="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(p=this.__patterns.unformatted_content_delimiter.read())),p||(p=this.__patterns.word.read()),p)return this._create_token(r.TEXT,p)},g.exports.Tokenizer=v,g.exports.TOKEN=r}],N={};function e(g){var f=N[g];if(f!==void 0)return f.exports;var o=N[g]={exports:{}};return j[g](o,o.exports,e),o.exports}var w=e(18);O=w})();var H=O;if(!0)!(oe=[z,z("6UM0"),z("TXwP")],B=function(j){var N=z("6UM0"),e=z("TXwP");return{html_beautify:function(w,g){return H(w,g,N.js_beautify,e.css_beautify)}}}.apply(ce,oe),B!==void 0&&(Fe.exports=B));else var I,C})()},"rAM+":function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return B});var oe=z("Qw5x");function B(O,H){var I;if(typeof Symbol=="undefined"||O[Symbol.iterator]==null){if(Array.isArray(O)||(I=Object(oe.a)(O))||H&&O&&typeof O.length=="number"){I&&(O=I);var C=0,j=function(){};return{s:j,n:function(){return C>=O.length?{done:!0}:{done:!1,value:O[C++]}},e:function(f){throw f},f:j}}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 N=!0,e=!1,w;return{s:function(){I=O[Symbol.iterator]()},n:function(){var f=I.next();return N=f.done,f},e:function(f){e=!0,w=f},f:function(){try{!N&&I.return!=null&&I.return()}finally{if(e)throw w}}}}},rUJ1:function(Fe,ce){const z=/[&<>"']/,oe=/[&<>"']/g,B=/[<>"']|&(?!#?\w+;)/,O=/[<>"']|&(?!#?\w+;)/g,H={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},I=b=>H[b];function C(b,u){if(u){if(z.test(b))return b.replace(oe,I)}else if(B.test(b))return b.replace(O,I);return b}const j=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(b){return b.replace(j,(u,h)=>(h=h.toLowerCase(),h==="colon"?":":h.charAt(0)==="#"?h.charAt(1)==="x"?String.fromCharCode(parseInt(h.substring(2),16)):String.fromCharCode(+h.substring(1)):""))}const e=/(^|[^\[])\^/g;function w(b,u){b=b.source||b,u=u||"";const h={replace:(c,d)=>(d=d.source||d,d=d.replace(e,"$1"),b=b.replace(c,d),h),getRegex:()=>new RegExp(b,u)};return h}const g=/[^\w:]/g,f=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(b,u,h){if(b){let c;try{c=decodeURIComponent(N(h)).replace(g,"").toLowerCase()}catch(d){return null}if(c.indexOf("javascript:")===0||c.indexOf("vbscript:")===0||c.indexOf("data:")===0)return null}u&&!f.test(h)&&(h=i(u,h));try{h=encodeURI(h).replace(/%25/g,"%")}catch(c){return null}return h}const n={},a=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function i(b,u){n[" "+b]||(a.test(b)?n[" "+b]=b+"/":n[" "+b]=m(b,"/",!0)),b=n[" "+b];const h=b.indexOf(":")===-1;return u.substring(0,2)==="//"?h?u:b.replace(l,"$1")+u:u.charAt(0)==="/"?h?u:b.replace(s,"$1")+u:b+u}const r={exec:function(){}};function t(b){let u=1,h,c;for(;u<arguments.length;u++){h=arguments[u];for(c in h)Object.prototype.hasOwnProperty.call(h,c)&&(b[c]=h[c])}return b}function v(b,u){const h=b.replace(/\|/g,(E,y,T)=>{let D=!1,L=y;for(;--L>=0&&T[L]==="\\";)D=!D;return D?"|":" |"}),c=h.split(/ \|/);let d=0;if(c.length>u)c.splice(u);else for(;c.length<u;)c.push("");for(;d<c.length;d++)c[d]=c[d].trim().replace(/\\\|/g,"|");return c}function m(b,u,h){const c=b.length;if(c===0)return"";let d=0;for(;d<c;){const E=b.charAt(c-d-1);if(E===u&&!h)d++;else if(E!==u&&h)d++;else break}return b.substr(0,c-d)}function p(b,u){if(b.indexOf(u[1])===-1)return-1;const h=b.length;let c=0,d=0;for(;d<h;d++)if(b[d]==="\\")d++;else if(b[d]===u[0])c++;else if(b[d]===u[1]&&(c--,c<0))return d;return-1}function _(b){b&&b.sanitize&&!b.silent&&console.warn("marked(): sanitize and sanitizer parameters are deprecated since version 0.7.0, should not be used and will be removed in the future. Read more here: https://marked.js.org/#/USING_ADVANCED.md#options")}Fe.exports={escape:C,unescape:N,edit:w,cleanUrl:o,resolveUrl:i,noopTest:r,merge:t,splitCells:v,rtrim:m,findClosingBracket:p,checkSanitizeDeprecation:_}},sboe:function(Fe,ce,z){"use strict";z.d(ce,"a",function(){return O});var oe=z("q1tI"),B=z.n(oe),O=oe.createContext(null)},t9D7:function(Fe,ce,z){"use strict";z.d(ce,"b",function(){return j}),z.d(ce,"g",function(){return e}),z.d(ce,"d",function(){return w}),z.d(ce,"e",function(){return g}),z.d(ce,"a",function(){return f}),z.d(ce,"f",function(){return a}),z.d(ce,"c",function(){return l});var oe=z("Vhoy"),B=z("MI8n"),O=z("pmY6"),H=z("Cg/j"),I=z("ic2d"),C=z("nEHx");const j=Object(H.c)("themeService");var N;(function(s){function i(r){return r&&typeof r=="object"&&typeof r.id=="string"}s.isThemeColor=i})(N||(N={}));function e(s){return{id:s}}var w;(function(s){function i(_){return _&&typeof _=="object"&&typeof _.id=="string"&&(typeof _.color=="undefined"||N.isThemeColor(_.color))}s.isThemeIcon=i;const r=new RegExp(`^\\$\\((${oe.a.iconNameExpression}(?:${oe.a.iconModifierExpression})?)\\)$`);function t(_){const b=r.exec(_);if(!b)return;let[,u]=b;return{id:u}}s.fromString=t;function v(_,b){let u=_.id;const h=u.lastIndexOf("~");return h!==-1&&(u=u.substring(0,h)),b&&(u=`${u}~${b}`),{id:u}}s.modify=v;function m(_,b){var u,h;return _.id===b.id&&((u=_.color)===null||u===void 0?void 0:u.id)===((h=b.color)===null||h===void 0?void 0:h.id)}s.isEqual=m;function p(_,b){return{id:_.id,color:b?e(b):void 0}}s.asThemeIcon=p,s.asClassNameArray=oe.a.asClassNameArray,s.asClassName=oe.a.asClassName,s.asCSSSelector=oe.a.asCSSSelector})(w||(w={}));function g(s){switch(s){case C.a.DARK:return"vs-dark";case C.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const f={ThemingContribution:"base.contributions.theming"};class o{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(O.i)(()=>{const i=this.themingParticipants.indexOf(s);this.themingParticipants.splice(i,1)})}getThemingParticipants(){return this.themingParticipants}}let n=new o;I.a.add(f.ThemingContribution,n);function a(s){return n.onColorThemeChange(s)}class l extends O.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(i=>this.onThemeChange(i)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Fe,ce,z){typeof window!="undefined"&&function(B,O){Fe.exports=O()}(this,function(){return function(oe){var B={};function O(H){if(B[H])return B[H].exports;var I=B[H]={i:H,l:!1,exports:{}};return oe[H].call(I.exports,I,I.exports,O),I.l=!0,I.exports}return O.m=oe,O.c=B,O.d=function(H,I,C){O.o(H,I)||Object.defineProperty(H,I,{enumerable:!0,get:C})},O.r=function(H){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(H,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(H,"__esModule",{value:!0})},O.t=function(H,I){if(I&1&&(H=O(H)),I&8)return H;if(I&4&&typeof H=="object"&&H&&H.__esModule)return H;var C=Object.create(null);if(O.r(C),Object.defineProperty(C,"default",{enumerable:!0,value:H}),I&2&&typeof H!="string")for(var j in H)O.d(C,j,function(N){return H[N]}.bind(null,j));return C},O.n=function(H){var I=H&&H.__esModule?function(){return H.default}:function(){return H};return O.d(I,"a",I),I},O.o=function(H,I){return Object.prototype.hasOwnProperty.call(H,I)},O.p="/dist/",O(O.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(oe,B,O){"use strict";var H=Object.prototype.hasOwnProperty,I="~";function C(){}Object.create&&(C.prototype=Object.create(null),new C().__proto__||(I=!1));function j(g,f,o){this.fn=g,this.context=f,this.once=o||!1}function N(g,f,o,n,a){if(typeof o!="function")throw new TypeError("The listener must be a function");var l=new j(o,n||g,a),s=I?I+f:f;return g._events[s]?g._events[s].fn?g._events[s]=[g._events[s],l]:g._events[s].push(l):(g._events[s]=l,g._eventsCount++),g}function e(g,f){--g._eventsCount===0?g._events=new C:delete g._events[f]}function w(){this._events=new C,this._eventsCount=0}w.prototype.eventNames=function(){var f=[],o,n;if(this._eventsCount===0)return f;for(n in o=this._events)H.call(o,n)&&f.push(I?n.slice(1):n);return Object.getOwnPropertySymbols?f.concat(Object.getOwnPropertySymbols(o)):f},w.prototype.listeners=function(f){var o=I?I+f:f,n=this._events[o];if(!n)return[];if(n.fn)return[n.fn];for(var a=0,l=n.length,s=new Array(l);a<l;a++)s[a]=n[a].fn;return s},w.prototype.listenerCount=function(f){var o=I?I+f:f,n=this._events[o];return n?n.fn?1:n.length:0},w.prototype.emit=function(f,o,n,a,l,s){var i=I?I+f:f;if(!this._events[i])return!1;var r=this._events[i],t=arguments.length,v,m;if(r.fn){r.once&&this.removeListener(f,r.fn,void 0,!0);switch(t){case 1:return r.fn.call(r.context),!0;case 2:return r.fn.call(r.context,o),!0;case 3:return r.fn.call(r.context,o,n),!0;case 4:return r.fn.call(r.context,o,n,a),!0;case 5:return r.fn.call(r.context,o,n,a,l),!0;case 6:return r.fn.call(r.context,o,n,a,l,s),!0}for(m=1,v=new Array(t-1);m<t;m++)v[m-1]=arguments[m];r.fn.apply(r.context,v)}else{var p=r.length,_;for(m=0;m<p;m++){r[m].once&&this.removeListener(f,r[m].fn,void 0,!0);switch(t){case 1:r[m].fn.call(r[m].context);break;case 2:r[m].fn.call(r[m].context,o);break;case 3:r[m].fn.call(r[m].context,o,n);break;case 4:r[m].fn.call(r[m].context,o,n,a);break;default:if(!v)for(_=1,v=new Array(t-1);_<t;_++)v[_-1]=arguments[_];r[m].fn.apply(r[m].context,v)}}}return!0},w.prototype.on=function(f,o,n){return N(this,f,o,n,!1)},w.prototype.once=function(f,o,n){return N(this,f,o,n,!0)},w.prototype.removeListener=function(f,o,n,a){var l=I?I+f:f;if(!this._events[l])return this;if(!o)return e(this,l),this;var s=this._events[l];if(s.fn)s.fn===o&&(!a||s.once)&&(!n||s.context===n)&&e(this,l);else{for(var i=0,r=[],t=s.length;i<t;i++)(s[i].fn!==o||a&&!s[i].once||n&&s[i].context!==n)&&r.push(s[i]);r.length?this._events[l]=r.length===1?r[0]:r:e(this,l)}return this},w.prototype.removeAllListeners=function(f){var o;return f?(o=I?I+f:f,this._events[o]&&e(this,o)):(this._events=new C,this._eventsCount=0),this},w.prototype.off=w.prototype.removeListener,w.prototype.addListener=w.prototype.on,w.prefixed=I,w.EventEmitter=w,oe.exports=w},"./node_modules/url-toolkit/src/url-toolkit.js":function(oe,B,O){(function(H){var I=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,C=/^([^\/?#]*)([^]*)$/,j=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(w,g,f){if(f=f||{},w=w.trim(),g=g.trim(),!g){if(!f.alwaysNormalize)return w;var o=e.parseURL(w);if(!o)throw new Error("Error trying to parse base URL.");return o.path=e.normalizePath(o.path),e.buildURLFromParts(o)}var n=e.parseURL(g);if(!n)throw new Error("Error trying to parse relative URL.");if(n.scheme)return f.alwaysNormalize?(n.path=e.normalizePath(n.path),e.buildURLFromParts(n)):g;var a=e.parseURL(w);if(!a)throw new Error("Error trying to parse base URL.");if(!a.netLoc&&a.path&&a.path[0]!=="/"){var l=C.exec(a.path);a.netLoc=l[1],a.path=l[2]}a.netLoc&&!a.path&&(a.path="/");var s={scheme:a.scheme,netLoc:n.netLoc,path:null,params:n.params,query:n.query,fragment:n.fragment};if(!n.netLoc&&(s.netLoc=a.netLoc,n.path[0]!=="/"))if(!n.path)s.path=a.path,n.params||(s.params=a.params,n.query||(s.query=a.query));else{var i=a.path,r=i.substring(0,i.lastIndexOf("/")+1)+n.path;s.path=e.normalizePath(r)}return s.path===null&&(s.path=f.alwaysNormalize?e.normalizePath(n.path):n.path),e.buildURLFromParts(s)},parseURL:function(w){var g=I.exec(w);return g?{scheme:g[1]||"",netLoc:g[2]||"",path:g[3]||"",params:g[4]||"",query:g[5]||"",fragment:g[6]||""}:null},normalizePath:function(w){for(w=w.split("").reverse().join("").replace(j,"");w.length!==(w=w.replace(N,"")).length;);return w.split("").reverse().join("")},buildURLFromParts:function(w){return w.scheme+w.netLoc+w.path+w.params+w.query+w.fragment}};oe.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(oe,B,O){function H(f){var o={};function n(l){if(o[l])return o[l].exports;var s=o[l]={i:l,l:!1,exports:{}};return f[l].call(s.exports,s,s.exports,n),s.l=!0,s.exports}n.m=f,n.c=o,n.i=function(l){return l},n.d=function(l,s,i){n.o(l,s)||Object.defineProperty(l,s,{configurable:!1,enumerable:!0,get:i})},n.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},n.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return n.d(s,"a",s),s},n.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},n.p="/",n.oe=function(l){throw console.error(l),l};var a=n(n.s=ENTRY_MODULE);return a.default||a}var I="[\\.|\\-|\\+|\\w|/|@]+",C="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+I+").*?\\)";function j(f){return(f+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(f){return!isNaN(1*f)}function e(f,o,n){var a={};a[n]=[];var l=o.toString(),s=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return a;for(var i=s[1],r=new RegExp("(\\\\n|\\W)"+j(i)+C,"g"),t;t=r.exec(l);){if(t[3]==="dll-reference")continue;a[n].push(t[3])}for(r=new RegExp("\\("+j(i)+'\\("(dll-reference\\s('+I+'))"\\)\\)'+C,"g");t=r.exec(l);)f[t[2]]||(a[n].push(t[1]),f[t[2]]=O(t[1]).m),a[t[2]]=a[t[2]]||[],a[t[2]].push(t[4]);for(var v=Object.keys(a),m=0;m<v.length;m++)for(var p=0;p<a[v[m]].length;p++)N(a[v[m]][p])&&(a[v[m]][p]=1*a[v[m]][p]);return a}function w(f){var o=Object.keys(f);return o.reduce(function(n,a){return n||f[a].length>0},!1)}function g(f,o){for(var n={main:[o]},a={main:[]},l={main:{}};w(n);)for(var s=Object.keys(n),i=0;i<s.length;i++){var r=s[i],t=n[r],v=t.pop();if(l[r]=l[r]||{},l[r][v]||!f[r][v])continue;l[r][v]=!0,a[r]=a[r]||[],a[r].push(v);for(var m=e(f,f[r][v],r),p=Object.keys(m),_=0;_<p.length;_++)n[p[_]]=n[p[_]]||[],n[p[_]]=n[p[_]].concat(m[p[_]])}return a}oe.exports=function(f,o){o=o||{};var n={main:O.m},a=o.all?{main:Object.keys(n.main)}:g(n,f),l="";Object.keys(a).filter(function(v){return v!=="main"}).forEach(function(v){for(var m=0;a[v][m];)m++;a[v].push(m),n[v][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+v+" = ("+H.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+a[v].map(function(p){return""+JSON.stringify(p)+": "+n[v][p].toString()}).join(",")+`});
`}),l=l+"new (("+H.toString().replace("ENTRY_MODULE",JSON.stringify(f))+")({"+a.main.map(function(v){return""+JSON.stringify(v)+": "+n.main[v].toString()}).join(",")+"}))(self);";var s=new window.Blob([l],{type:"text/javascript"});if(o.bare)return s;var i=window.URL||window.webkitURL||window.mozURL||window.msURL,r=i.createObjectURL(s),t=new window.Worker(r);return t.objectURL=r,t}},"./src/config.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"hlsDefaultConfig",function(){return _}),O.d(B,"mergeConfig",function(){return u}),O.d(B,"enableStreamingMode",function(){return h});var H=O("./src/controller/abr-controller.ts"),I=O("./src/controller/audio-stream-controller.ts"),C=O("./src/controller/audio-track-controller.ts"),j=O("./src/controller/subtitle-stream-controller.ts"),N=O("./src/controller/subtitle-track-controller.ts"),e=O("./src/controller/buffer-controller.ts"),w=O("./src/controller/timeline-controller.ts"),g=O("./src/controller/cap-level-controller.ts"),f=O("./src/controller/fps-controller.ts"),o=O("./src/controller/eme-controller.ts"),n=O("./src/controller/cmcd-controller.ts"),a=O("./src/utils/xhr-loader.ts"),l=O("./src/utils/fetch-loader.ts"),s=O("./src/utils/cues.ts"),i=O("./src/utils/mediakeys-helper.ts"),r=O("./src/utils/logger.ts");function t(){return t=Object.assign||function(c){for(var d=1;d<arguments.length;d++){var E=arguments[d];for(var y in E)Object.prototype.hasOwnProperty.call(E,y)&&(c[y]=E[y])}return c},t.apply(this,arguments)}function v(c,d){var E=Object.keys(c);if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(c);d&&(y=y.filter(function(T){return Object.getOwnPropertyDescriptor(c,T).enumerable})),E.push.apply(E,y)}return E}function m(c){for(var d=1;d<arguments.length;d++){var E=arguments[d]!=null?arguments[d]:{};d%2?v(Object(E),!0).forEach(function(y){p(c,y,E[y])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(E)):v(Object(E)).forEach(function(y){Object.defineProperty(c,y,Object.getOwnPropertyDescriptor(E,y))})}return c}function p(c,d,E){return d in c?Object.defineProperty(c,d,{value:E,enumerable:!0,configurable:!0,writable:!0}):c[d]=E,c}var _=m(m({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:Infinity,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:Infinity,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,enableSoftwareAES:!0,manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,startLevel:void 0,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,loader:a.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:H.default,bufferController:e.default,capLevelController:g.default,fpsController:f.default,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystemOptions:{},requestMediaKeySystemAccessFunc:i.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},b()),{},{subtitleStreamController:j.SubtitleStreamController,subtitleTrackController:N.default,timelineController:w.TimelineController,audioStreamController:I.default,audioTrackController:C.default,emeController:o.default,cmcdController:n.default});function b(){return{cueHandler:s.default,enableCEA708Captions:!0,enableWebVTT:!0,enableIMSC1:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function u(c,d){if((d.liveSyncDurationCount||d.liveMaxLatencyDurationCount)&&(d.liveSyncDuration||d.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(d.liveMaxLatencyDurationCount!==void 0&&(d.liveSyncDurationCount===void 0||d.liveMaxLatencyDurationCount<=d.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(d.liveMaxLatencyDuration!==void 0&&(d.liveSyncDuration===void 0||d.liveMaxLatencyDuration<=d.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return t({},c,d)}function h(c){var d=c.loader;if(d!==l.default&&d!==a.default)r.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),c.progressive=!1;else{var E=Object(l.fetchSupported)();E&&(c.loader=l.default,c.progressive=!0,c.enableSoftwareAES=!0,r.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/polyfills/number.ts"),I=O("./src/utils/ewma-bandwidth-estimator.ts"),C=O("./src/events.ts"),j=O("./src/utils/buffer-helper.ts"),N=O("./src/errors.ts"),e=O("./src/types/loader.ts"),w=O("./src/utils/logger.ts");function g(n,a){for(var l=0;l<a.length;l++){var s=a[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function f(n,a,l){return a&&g(n.prototype,a),l&&g(n,l),n}var o=function(){function n(l){this.hls=void 0,this.lastLoadedFragLevel=0,this._nextAutoLevel=-1,this.timer=void 0,this.onCheck=this._abandonRulesCheck.bind(this),this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.bwEstimator=void 0,this.hls=l;var s=l.config;this.bwEstimator=new I.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(C.Events.FRAG_LOADING,this.onFragLoading,this),s.on(C.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(C.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(C.Events.FRAG_LOADING,this.onFragLoading,this),s.off(C.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(C.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},a.onFragLoading=function(s,i){var r=i.frag;if(r.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=r,this.partCurrent=(t=i.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},a.onLevelLoaded=function(s,i){var r=this.hls.config;i.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD)},a._abandonRulesCheck=function(){var s=this.fragCurrent,i=this.partCurrent,r=this.hls,t=r.autoLevelEnabled,v=r.config,m=r.media;if(!s||!m)return;var p=i?i.stats:s.stats,_=i?i.duration:s.duration;if(p.aborted){w.logger.warn("frag loader destroy or aborted, disarm abandonRules"),this.clearTimer(),this._nextAutoLevel=-1;return}if(!t||m.paused||!m.playbackRate||!m.readyState)return;var b=performance.now()-p.loading.start,u=Math.abs(m.playbackRate);if(b<=500*_/u)return;var h=r.levels,c=r.minAutoLevel,d=h[s.level],E=p.total||Math.max(p.loaded,Math.round(_*d.maxBitrate/8)),y=Math.max(1,p.bwEstimate?p.bwEstimate/8:p.loaded*1e3/b),T=(E-p.loaded)/y,D=m.currentTime,L=(j.BufferHelper.bufferInfo(m,D,v.maxBufferHole).end-D)/u;if(L>=2*_/u||T<=L)return;var x=Number.POSITIVE_INFINITY,k;for(k=s.level-1;k>c;k--){var U=h[k].maxBitrate;if(x=_*U/(8*.8*y),x<L)break}if(x>=T)return;var R=this.bwEstimator.getEstimate();w.logger.warn("Fragment "+s.sn+(i?" part "+i.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+k+`
Current BW estimate: `+(Object(H.isFiniteNumber)(R)?(R/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+T.toFixed(3)+` s
Estimated load time for the next fragment: `+x.toFixed(3)+` s
Time to underbuffer: `+L.toFixed(3)+" s"),r.nextLoadLevel=k,this.bwEstimator.sample(b,p.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),r.trigger(C.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:i,stats:p})},a.onFragLoaded=function(s,i){var r=i.frag,t=i.part;if(r.type===e.PlaylistLevelType.MAIN&&Object(H.isFiniteNumber)(r.sn)){var v=t?t.stats:r.stats,m=t?t.duration:r.duration;if(this.clearTimer(),this.lastLoadedFragLevel=r.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var p=this.hls.levels[r.level],_=(p.loaded?p.loaded.bytes:0)+v.loaded,b=(p.loaded?p.loaded.duration:0)+m;p.loaded={bytes:_,duration:b},p.realBitrate=Math.round(8*_/b)}if(r.bitrateTest){var u={stats:v,frag:r,part:t,id:r.type};this.onFragBuffered(C.Events.FRAG_BUFFERED,u),r.bitrateTest=!1}}},a.onFragBuffered=function(s,i){var r=i.frag,t=i.part,v=t?t.stats:r.stats;if(v.aborted)return;if(r.type!==e.PlaylistLevelType.MAIN||r.sn==="initSegment")return;var m=v.parsing.end-v.loading.start;this.bwEstimator.sample(m,v.loaded),v.bwEstimate=this.bwEstimator.getEstimate(),r.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},a.onError=function(s,i){switch(i.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},a.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},a.getNextABRAutoLevel=function(){var s=this.fragCurrent,i=this.partCurrent,r=this.hls,t=r.maxAutoLevel,v=r.config,m=r.minAutoLevel,p=r.media,_=i?i.duration:s?s.duration:0,b=p?p.currentTime:0,u=p&&p.playbackRate!==0?Math.abs(p.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():v.abrEwmaDefaultEstimate,c=(j.BufferHelper.bufferInfo(p,b,v.maxBufferHole).end-b)/u,d=this.findBestLevel(h,m,t,c,v.abrBandWidthFactor,v.abrBandWidthUpFactor);if(d>=0)return d;w.logger.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var E=_?Math.min(_,v.maxStarvationDelay):v.maxStarvationDelay,y=v.abrBandWidthFactor,T=v.abrBandWidthUpFactor;if(!c){var D=this.bitrateTestDelay;if(D){var L=_?Math.min(_,v.maxLoadingDelay):v.maxLoadingDelay;E=L-D,w.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*E)+" ms"),y=T=1}}return d=this.findBestLevel(h,m,t,c+E,y,T),Math.max(d,0)},a.findBestLevel=function(s,i,r,t,v,m){for(var p,_=this.fragCurrent,b=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,c=h[u],d=!!(c!=null&&(p=c.details)!==null&&p!==void 0&&p.live),E=c==null?void 0:c.codecSet,y=b?b.duration:_?_.duration:0,T=r;T>=i;T--){var D=h[T];if(!D||E&&D.codecSet!==E)continue;var L=D.details,x=(b?L==null?void 0:L.partTarget:L==null?void 0:L.averagetargetduration)||y,k=void 0;T<=u?k=v*s:k=m*s;var U=h[T].maxBitrate,R=U*x/k;if(w.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+T+"/"+Math.round(k)+"/"+U+"/"+x+"/"+t+"/"+R),k>U&&(!R||d&&!this.bitrateTestDelay||R<t))return T}return-1},f(n,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,i=this.bwEstimator;if(s!==-1&&(!i||!i.canEstimate()))return s;var r=this.getNextABRAutoLevel();return s!==-1&&(r=Math.min(s,r)),r},set:function(s){this._nextAutoLevel=s}}]),n}();B.default=o},"./src/controller/audio-stream-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/polyfills/number.ts"),I=O("./src/controller/base-stream-controller.ts"),C=O("./src/events.ts"),j=O("./src/utils/buffer-helper.ts"),N=O("./src/controller/fragment-tracker.ts"),e=O("./src/types/level.ts"),w=O("./src/types/loader.ts"),g=O("./src/loader/fragment.ts"),f=O("./src/demux/chunk-cache.ts"),o=O("./src/demux/transmuxer-interface.ts"),n=O("./src/types/transmuxer.ts"),a=O("./src/controller/fragment-finders.ts"),l=O("./src/utils/discontinuities.ts"),s=O("./src/errors.ts"),i=O("./src/utils/logger.ts");function r(){return r=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var u=arguments[b];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(_[h]=u[h])}return _},r.apply(this,arguments)}function t(_,b){_.prototype=Object.create(b.prototype),_.prototype.constructor=_,v(_,b)}function v(_,b){return v=Object.setPrototypeOf||function(h,c){return h.__proto__=c,h},v(_,b)}var m=100,p=function(_){t(b,_);function b(h,c){var d;return d=_.call(this,h,c,"[audio-stream-controller]")||this,d.videoBuffer=null,d.videoTrackCC=-1,d.waitingVideoCC=-1,d.audioSwitch=!1,d.trackId=-1,d.waitingData=null,d.mainDetails=null,d.bufferFlushed=!1,d._registerListeners(),d}var u=b.prototype;return u.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},u._registerListeners=function(){var c=this.hls;c.on(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(C.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),c.on(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(C.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(C.Events.ERROR,this.onError,this),c.on(C.Events.BUFFER_RESET,this.onBufferReset,this),c.on(C.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(C.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},u._unregisterListeners=function(){var c=this.hls;c.off(C.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(C.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(C.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(C.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(C.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),c.off(C.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(C.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(C.Events.ERROR,this.onError,this),c.off(C.Events.BUFFER_RESET,this.onBufferReset,this),c.off(C.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(C.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(C.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(C.Events.FRAG_BUFFERED,this.onFragBuffered,this)},u.onInitPtsFound=function(c,d){var E=d.frag,y=d.id,T=d.initPTS;if(y==="main"){var D=E.cc;this.initPTS[E.cc]=T,this.log("InitPTS for cc: "+D+" found from main: "+T),this.videoTrackCC=D,this.state===I.State.WAITING_INIT_PTS&&this.tick()}},u.startLoad=function(c){if(!this.levels){this.startPosition=c,this.state=I.State.STOPPED;return}var d=this.lastCurrentTime;this.stopLoad(),this.setInterval(m),this.fragLoadError=0,d>0&&c===-1?(this.log("Override startPosition with lastCurrentTime @"+d.toFixed(3)),this.state=I.State.IDLE):(this.loadedmetadata=!1,this.state=I.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()},u.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_TRACK:{var c,d=this.levels,E=this.trackId,y=d==null||((c=d[E])===null||c===void 0)?void 0:c.details;if(y){if(this.waitForCdnTuneIn(y))break;this.state=I.State.WAITING_INIT_PTS}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var T,D=performance.now(),L=this.retryDate;(!L||D>=L||(T=this.media)!==null&&T!==void 0&&T.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=I.State.IDLE);break}case I.State.WAITING_INIT_PTS:{var x=this.waitingData;if(x){var k=x.frag,U=x.part,R=x.cache,V=x.complete;if(this.initPTS[k.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.FRAG_LOADING;var Z=R.flush(),ue={frag:k,part:U,payload:Z,networkDetails:null};this._handleFragmentLoadProgress(ue),V&&_.prototype._handleFragmentLoadComplete.call(this,ue)}else if(this.videoTrackCC!==this.waitingVideoCC)i.logger.log("Waiting fragment cc ("+k.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var le=this.getLoadPosition(),ge=j.BufferHelper.bufferInfo(this.mediaBuffer,le,this.config.maxBufferHole),pe=Object(a.fragmentWithinToleranceTest)(ge.end,this.config.maxFragLookUpTolerance,k);pe<0&&(i.logger.log("Waiting fragment cc ("+k.cc+") @ "+k.start+" cancelled because another fragment at "+ge.end+" is needed"),this.clearWaitingFragment())}}else this.state=I.State.IDLE}}this.onTickEnd()},u.clearWaitingFragment=function(){var c=this.waitingData;c&&(this.fragmentTracker.removeFragment(c.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=I.State.IDLE)},u.onTickEnd=function(){var c=this.media;if(!c||!c.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:c,E=d.buffered;!this.loadedmetadata&&E.length&&(this.loadedmetadata=!0),this.lastCurrentTime=c.currentTime},u.doTickIdle=function(){var c,d,E=this.hls,y=this.levels,T=this.media,D=this.trackId,L=E.config;if(!y||!y[D])return;if(!T&&(this.startFragRequested||!L.startFragPrefetch))return;var x=y[D],k=x.details;if(!k||k.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(k)){this.state=I.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,g.ElementaryStreamTypes.AUDIO,w.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,w.PlaylistLevelType.AUDIO);if(U===null)return;var R=U.len,V=this.getMaxBufferLength(),Z=this.audioSwitch;if(R>=V&&!Z)return;if(!Z&&this._streamEnded(U,k)){E.trigger(C.Events.BUFFER_EOS,{type:"audio"}),this.state=I.State.ENDED;return}var ue=k.fragments,le=ue[0].start,ge=U.end;if(Z){var pe=this.getLoadPosition();ge=pe,k.PTSKnown&&pe<le&&((U.end>le||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),T.currentTime=le+.05))}var ae=this.getNextFragment(ge,k);if(!ae){this.bufferFlushed=!0;return}((c=ae.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((d=ae.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(ae,k):this.loadFragment(ae,k,ge)},u.getMaxBufferLength=function(){var c=_.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,w.PlaylistLevelType.MAIN);return d===null?c:Math.max(c,d.len)},u.onMediaDetaching=function(){this.videoBuffer=null,_.prototype.onMediaDetaching.call(this)},u.onAudioTracksUpdated=function(c,d){var E=d.audioTracks;this.resetTransmuxer(),this.levels=E.map(function(y){return new e.Level(y)})},u.onAudioTrackSwitching=function(c,d){var E=!!d.url;this.trackId=d.id;var y=this.fragCurrent;y!=null&&y.loader&&y.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),E?this.setInterval(m):this.resetTransmuxer(),E?(this.audioSwitch=!0,this.state=I.State.IDLE):this.state=I.State.STOPPED,this.tick()},u.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},u.onLevelLoaded=function(c,d){this.mainDetails=d.details},u.onAudioTrackLoaded=function(c,d){var E,y=this.levels,T=d.details,D=d.id;if(!y){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+T.startSN+","+T.endSN+"],duration:"+T.totalduration);var L=y[D],x=0;if(T.live||(E=L.details)!==null&&E!==void 0&&E.live){var k=this.mainDetails;if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed||!k)return;!L.details&&T.hasProgramDateTime&&k.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(T,k),x=T.fragments[0].start):x=this.alignPlaylists(T,L.details)}L.details=T,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!T.live)&&this.setStartPosition(L.details,x),this.state===I.State.WAITING_TRACK&&!this.waitForCdnTuneIn(T)&&(this.state=I.State.IDLE),this.tick()},u._handleFragmentLoadProgress=function(c){var d,E=c.frag,y=c.part,T=c.payload,D=this.config,L=this.trackId,x=this.levels;if(!x){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+E.sn+" of level "+E.level+" will not be buffered");return}var k=x[L];console.assert(k,"Audio track is defined on fragment load progress");var U=k.details;console.assert(U,"Audio track details are defined on fragment load progress");var R=D.defaultAudioCodec||k.audioCodec||"mp4a.40.2",V=this.transmuxer;V||(V=this.transmuxer=new o.default(this.hls,w.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var Z=this.initPTS[E.cc],ue=(d=E.initSegment)===null||d===void 0?void 0:d.data;if(Z!==void 0){var le=!1,ge=y?y.index:-1,pe=ge!==-1,ae=new n.ChunkMetadata(E.level,E.sn,E.stats.chunkCount,T.byteLength,ge,pe);V.push(T,ue,R,"",E,y,U.totalduration,le,ae,Z)}else{i.logger.log("Unknown video PTS for cc "+E.cc+", waiting for video PTS before demuxing audio frag "+E.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+L);var ne=this.waitingData=this.waitingData||{frag:E,part:y,cache:new f.default,complete:!1},fe=ne.cache;fe.push(new Uint8Array(T)),this.waitingVideoCC=this.videoTrackCC,this.state=I.State.WAITING_INIT_PTS}},u._handleFragmentLoadComplete=function(c){if(this.waitingData){this.waitingData.complete=!0;return}_.prototype._handleFragmentLoadComplete.call(this,c)},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(c,d){var E=d.tracks.audio;E&&(this.mediaBuffer=E.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},u.onFragBuffered=function(c,d){var E=d.frag,y=d.part;if(E.type!==w.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(E)){this.warn("Fragment "+E.sn+(y?" p: "+y.index:"")+" of level "+E.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}E.sn!=="initSegment"&&(this.fragPrevious=E,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(E,y)},u.onError=function(c,d){switch(d.details){case s.ErrorDetails.FRAG_LOAD_ERROR:case s.ErrorDetails.FRAG_LOAD_TIMEOUT:case s.ErrorDetails.KEY_LOAD_ERROR:case s.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.AUDIO,d);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==I.State.ERROR&&this.state!==I.State.STOPPED&&(this.state=d.fatal?I.State.ERROR:I.State.IDLE,this.warn(d.details+" while loading frag, switching to "+this.state+" state"));break;case s.ErrorDetails.BUFFER_FULL_ERROR:if(d.parent==="audio"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var E=!0,y=this.getFwdBufferInfo(this.mediaBuffer,w.PlaylistLevelType.AUDIO);y&&y.len>.5&&(E=!this.reduceMaxBufferLength(y.len)),E&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,_.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},u.onBufferFlushed=function(c,d){var E=d.type;E===g.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},u._handleTransmuxComplete=function(c){var d,E="audio",y=this.hls,T=c.remuxResult,D=c.chunkMeta,L=this.getCurrentContext(D);if(!L){this.warn("The loading context changed while buffering fragment "+D.sn+" of level "+D.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(D.level);return}var x=L.frag,k=L.part,U=T.audio,R=T.text,V=T.id3,Z=T.initSegment;if(this.fragContextChanged(x))return;if(this.state=I.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),Z!=null&&Z.tracks&&(this._bufferInitSegment(Z.tracks,x,D),y.trigger(C.Events.FRAG_PARSING_INIT_SEGMENT,{frag:x,id:E,tracks:Z.tracks})),U){var ue=U.startPTS,le=U.endPTS,ge=U.startDTS,pe=U.endDTS;k&&(k.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:ue,endPTS:le,startDTS:ge,endDTS:pe}),x.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,ue,le,ge,pe),this.bufferFragmentData(U,x,k,D)}if(V!=null&&(d=V.samples)!==null&&d!==void 0&&d.length){var ae=r({frag:x,id:E},V);y.trigger(C.Events.FRAG_PARSING_METADATA,ae)}if(R){var ne=r({frag:x,id:E},R);y.trigger(C.Events.FRAG_PARSING_USERDATA,ne)}},u._bufferInitSegment=function(c,d,E){if(this.state!==I.State.PARSING)return;c.video&&delete c.video;var y=c.audio;if(!y)return;y.levelCodec=y.codec,y.id="audio",this.log("Init audio buffer, container:"+y.container+", codecs[parsed]=["+y.codec+"]"),this.hls.trigger(C.Events.BUFFER_CODECS,c);var T=y.initSegment;if(T!=null&&T.byteLength){var D={type:"audio",frag:d,part:null,chunkMeta:E,parent:d.type,data:T};this.hls.trigger(C.Events.BUFFER_APPENDING,D)}this.tick()},u.loadFragment=function(c,d,E){var y=this.fragmentTracker.getState(c);this.fragCurrent=c,(this.audioSwitch||y===N.FragmentState.NOT_LOADED||y===N.FragmentState.PARTIAL)&&(c.sn==="initSegment"?this._loadInitSegment(c):d.live&&!Object(H.isFiniteNumber)(this.initPTS[c.cc])?(this.log("Waiting for video PTS in continuity counter "+c.cc+" of live stream before loading audio fragment "+c.sn+" of level "+this.trackId),this.state=I.State.WAITING_INIT_PTS):(this.startFragRequested=!0,_.prototype.loadFragment.call(this,c,d,E)))},u.completeAudioSwitch=function(){var c=this.hls,d=this.media,E=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),_.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,c.trigger(C.Events.AUDIO_TRACK_SWITCHED,{id:E})},b}(I.default);B.default=p},"./src/controller/audio-track-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/events.ts"),I=O("./src/errors.ts"),C=O("./src/controller/base-playlist-controller.ts"),j=O("./src/types/loader.ts");function N(o,n){for(var a=0;a<n.length;a++){var l=n[a];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(o,l.key,l)}}function e(o,n,a){return n&&N(o.prototype,n),a&&N(o,a),o}function w(o,n){o.prototype=Object.create(n.prototype),o.prototype.constructor=o,g(o,n)}function g(o,n){return g=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},g(o,n)}var f=function(o){w(n,o);function n(l){var s;return s=o.call(this,l,"[audio-track-controller]")||this,s.tracks=[],s.groupId=null,s.tracksInGroup=[],s.trackId=-1,s.trackName="",s.selectDefaultTrack=!0,s.registerListeners(),s}var a=n.prototype;return a.registerListeners=function(){var s=this.hls;s.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(H.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(H.Events.ERROR,this.onError,this)},a.unregisterListeners=function(){var s=this.hls;s.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(H.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(H.Events.ERROR,this.onError,this)},a.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},a.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},a.onManifestParsed=function(s,i){this.tracks=i.audioTracks||[]},a.onAudioTrackLoaded=function(s,i){var r=i.id,t=i.details,v=this.tracksInGroup[r];if(!v){this.warn("Invalid audio track id "+r);return}var m=v.details;v.details=i.details,this.log("audioTrack "+r+" loaded ["+t.startSN+"-"+t.endSN+"]"),r===this.trackId&&(this.retryCount=0,this.playlistLoaded(r,i,m))},a.onLevelLoading=function(s,i){this.switchLevel(i.level)},a.onLevelSwitching=function(s,i){this.switchLevel(i.level)},a.switchLevel=function(s){var i=this.hls.levels[s];if(!(i!=null&&i.audioGroupIds))return;var r=i.audioGroupIds[i.urlId];if(this.groupId!==r){this.groupId=r;var t=this.tracks.filter(function(m){return!r||m.groupId===r});this.selectDefaultTrack&&!t.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var v={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+r+'" group-id'),this.hls.trigger(H.Events.AUDIO_TRACKS_UPDATED,v),this.selectInitialTrack()}},a.onError=function(s,i){if(o.prototype.onError.call(this,s,i),i.fatal||!i.context)return;i.context.type===j.PlaylistContextType.AUDIO_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},a.setAudioTrack=function(s){var i=this.tracksInGroup;if(s<0||s>=i.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var r=i[this.trackId];this.log("Now switching to audio-track index "+s);var t=i[s],v=t.id,m=t.groupId,p=m===void 0?"":m,_=t.name,b=t.type,u=t.url;if(this.trackId=s,this.trackName=_,this.selectDefaultTrack=!1,this.hls.trigger(H.Events.AUDIO_TRACK_SWITCHING,{id:v,groupId:p,name:_,type:b,url:u}),t.details&&!t.details.live)return;var h=this.switchParams(t.url,r==null?void 0:r.details);this.loadPlaylist(h)},a.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var i=this.trackName,r=this.findTrackId(i)||this.findTrackId();r!==-1?this.setAudioTrack(r):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},a.findTrackId=function(s){for(var i=this.tracksInGroup,r=0;r<i.length;r++){var t=i[r];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},a.loadPlaylist=function(s){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var r=i.id,t=i.groupId,v=i.url;if(s)try{v=s.addDirectives(v)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+r),this.clearTimer(),this.hls.trigger(H.Events.AUDIO_TRACK_LOADING,{url:v,id:r,groupId:t,deliveryDirectives:s||null})}},e(n,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),n}(C.default);B.default=f},"./src/controller/base-playlist-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return e});var H=O("./src/polyfills/number.ts"),I=O("./src/types/level.ts"),C=O("./src/controller/level-helper.ts"),j=O("./src/utils/logger.ts"),N=O("./src/errors.ts"),e=function(){function w(f,o){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=j.logger.log.bind(j.logger,o+":"),this.warn=j.logger.warn.bind(j.logger,o+":"),this.hls=f}var g=w.prototype;return g.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},g.onError=function(o,n){n.fatal&&n.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},g.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},g.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},g.stopLoad=function(){this.canLoad=!1,this.clearTimer()},g.switchParams=function(o,n){var a=n==null?void 0:n.renditionReports;if(a)for(var l=0;l<a.length;l++){var s=a[l],i=""+s.URI;if(i===o.substr(-i.length)){var r=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(n&&this.hls.config.lowLatencyMode){var v=Math.min(n.age-n.partTarget,n.targetduration);t!==void 0&&v>n.partTarget&&(t+=1)}if(Object(H.isFiniteNumber)(r))return new I.HlsUrlParameters(r,Object(H.isFiniteNumber)(t)?t:void 0,I.HlsSkip.No)}}},g.loadPlaylist=function(o){},g.shouldLoadTrack=function(o){return this.canLoad&&o&&!!o.url&&(!o.details||o.details.live)},g.playlistLoaded=function(o,n,a){var l=this,s=n.details,i=n.stats,r=i.loading.end?Math.max(0,self.performance.now()-i.loading.end):0;if(s.advancedDateTime=Date.now()-r,s.live||a!=null&&a.live){if(s.reloaded(a),a&&this.log("live playlist "+o+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),a&&s.fragments.length>0&&Object(C.mergeDetails)(a,s),!this.canLoad||!s.live)return;var t,v=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var p=this.hls.config.lowLatencyMode,_=s.lastPartSn,b=s.endSN,u=s.lastPartIndex,h=u!==-1,c=_===b,d=p?0:u;h?(v=c?b+1:_,m=c?d:u+1):v=b+1;var E=s.age,y=E+s.ageHeader,T=Math.min(y-s.partTarget,s.targetduration*1.5);if(T>0){if(a&&T>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+T+" with playlist age: "+s.age),T=0;else{var D=Math.floor(T/s.targetduration);if(v+=D,m!==void 0){var L=Math.round(T%s.targetduration/s.partTarget);m+=L}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+E.toFixed(2)+"s goal: "+T+" skip sn "+D+" to part "+m)}s.tuneInGoal=T}if(t=this.getDeliveryDirectives(s,n.deliveryDirectives,v,m),p||!c){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,n.deliveryDirectives,v,m);var x=Object(C.computeReloadInterval)(s,i);v!==void 0&&s.canBlockReload&&(x-=s.partTarget||1),this.log("reload live playlist "+o+" in "+Math.round(x)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(t)},x)}else this.clearTimer()},g.getDeliveryDirectives=function(o,n,a,l){var s=Object(I.getSkipValue)(o,a);return n!=null&&n.skip&&o.deltaUpdateFailed&&(a=n.msn,l=n.part,s=I.HlsSkip.No),new I.HlsUrlParameters(a,l,s)},g.retryLoadingOrFail=function(o){var n=this,a=this.hls.config,l=this.retryCount<a.levelLoadingMaxRetry;if(l){var s;if(this.retryCount++,o.details.indexOf("LoadTimeOut")>-1&&(s=o.context)!==null&&s!==void 0&&s.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+o.details+'"'),this.loadPlaylist();else{var i=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return n.loadPlaylist()},i),this.warn("retry playlist loading #"+this.retryCount+" in "+i+' ms after "'+o.details+'"')}}else this.warn('cannot recover from error "'+o.details+'"'),this.clearTimer(),o.fatal=!0;return l},w}()},"./src/controller/base-stream-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"State",function(){return b}),O.d(B,"default",function(){return u});var H=O("./src/polyfills/number.ts"),I=O("./src/task-loop.ts"),C=O("./src/controller/fragment-tracker.ts"),j=O("./src/utils/buffer-helper.ts"),N=O("./src/utils/logger.ts"),e=O("./src/events.ts"),w=O("./src/errors.ts"),g=O("./src/types/transmuxer.ts"),f=O("./src/utils/mp4-tools.ts"),o=O("./src/utils/discontinuities.ts"),n=O("./src/controller/fragment-finders.ts"),a=O("./src/controller/level-helper.ts"),l=O("./src/loader/fragment-loader.ts"),s=O("./src/crypt/decrypter.ts"),i=O("./src/utils/time-ranges.ts"),r=O("./src/types/loader.ts");function t(h,c){for(var d=0;d<c.length;d++){var E=c[d];E.enumerable=E.enumerable||!1,E.configurable=!0,"value"in E&&(E.writable=!0),Object.defineProperty(h,E.key,E)}}function v(h,c,d){return c&&t(h.prototype,c),d&&t(h,d),h}function m(h){if(h===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return h}function p(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,_(h,c)}function _(h,c){return _=Object.setPrototypeOf||function(E,y){return E.__proto__=y,E},_(h,c)}var b={STOPPED:"STOPPED",IDLE:"IDLE",KEY_LOADING:"KEY_LOADING",FRAG_LOADING:"FRAG_LOADING",FRAG_LOADING_WAITING_RETRY:"FRAG_LOADING_WAITING_RETRY",WAITING_TRACK:"WAITING_TRACK",PARSING:"PARSING",PARSED:"PARSED",BACKTRACKING:"BACKTRACKING",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},u=function(h){p(c,h);function c(E,y,T){var D;return D=h.call(this)||this,D.hls=void 0,D.fragPrevious=null,D.fragCurrent=null,D.fragmentTracker=void 0,D.transmuxer=null,D._state=b.STOPPED,D.media=void 0,D.mediaBuffer=void 0,D.config=void 0,D.bitrateTest=!1,D.lastCurrentTime=0,D.nextLoadPosition=0,D.startPosition=0,D.loadedmetadata=!1,D.fragLoadError=0,D.retryDate=0,D.levels=null,D.fragmentLoader=void 0,D.levelLastLoaded=null,D.startFragRequested=!1,D.decrypter=void 0,D.initPTS=[],D.onvseeking=null,D.onvended=null,D.logPrefix="",D.log=void 0,D.warn=void 0,D.logPrefix=T,D.log=N.logger.log.bind(N.logger,T+":"),D.warn=N.logger.warn.bind(N.logger,T+":"),D.hls=E,D.fragmentLoader=new l.default(E.config),D.fragmentTracker=y,D.config=E.config,D.decrypter=new s.default(E,E.config),E.on(e.Events.KEY_LOADED,D.onKeyLoaded,m(D)),D}var d=c.prototype;return d.doTick=function(){this.onTickEnd()},d.onTickEnd=function(){},d.startLoad=function(y){},d.stopLoad=function(){this.fragmentLoader.abort();var y=this.fragCurrent;y&&this.fragmentTracker.removeFragment(y),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=b.STOPPED},d._streamEnded=function(y,T){var D=this.fragCurrent,L=this.fragmentTracker;if(!T.live&&D&&D.sn===T.endSN&&!y.nextStart){var x=L.getState(D);return x===C.FragmentState.PARTIAL||x===C.FragmentState.OK}return!1},d.onMediaAttached=function(y,T){var D=this.media=this.mediaBuffer=T.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var L=this.config;this.levels&&L.autoStartLoad&&this.state===b.STOPPED&&this.startLoad(L.startPosition)},d.onMediaDetaching=function(){var y=this.media;y!=null&&y.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),y&&(y.removeEventListener("seeking",this.onvseeking),y.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},d.onMediaSeeking=function(){var y=this.config,T=this.fragCurrent,D=this.media,L=this.mediaBuffer,x=this.state,k=D?D.currentTime:0,U=j.BufferHelper.bufferInfo(L||D,k,y.maxBufferHole);if(this.log("media seeking to "+(Object(H.isFiniteNumber)(k)?k.toFixed(3):k)+", state: "+x),x===b.ENDED)this.resetLoadingState();else if(T&&!U.len){var R=y.maxFragLookUpTolerance,V=T.start-R,Z=T.start+T.duration+R,ue=k>Z;(k<V||ue)&&(ue&&T.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),T.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=k),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=k),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(y,T){if(this.state!==b.KEY_LOADING||T.frag!==this.fragCurrent||!this.levels)return;this.state=b.IDLE;var D=this.levels[T.frag.level].details;D&&this.loadFragment(T.frag,D,T.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),h.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=b.STOPPED,this.hls.off(e.Events.KEY_LOADED,this.onKeyLoaded,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.fragmentLoader=this.fragmentTracker=null,h.prototype.onHandlerDestroyed.call(this)},d.loadKey=function(y,T){this.log("Loading key for "+y.sn+" of ["+T.startSN+"-"+T.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level),this.state=b.KEY_LOADING,this.fragCurrent=y,this.hls.trigger(e.Events.KEY_LOADING,{frag:y})},d.loadFragment=function(y,T,D){this._loadFragForPlayback(y,T,D)},d._loadFragForPlayback=function(y,T,D){var L=this,x=function(U){if(L.fragContextChanged(y)){L.warn("Fragment "+y.sn+(U.part?" p: "+U.part.index:"")+" of level "+y.level+" was dropped during download."),L.fragmentTracker.removeFragment(y);return}y.stats.chunkCount++,L._handleFragmentLoadProgress(U)};this._doFragLoad(y,T,D,x).then(function(k){if(!k)return;L.fragLoadError=0;var U=L.state;if(L.fragContextChanged(y)){(U===b.FRAG_LOADING||U===b.BACKTRACKING||!L.fragCurrent&&U===b.PARSING)&&(L.fragmentTracker.removeFragment(y),L.state=b.IDLE);return}if("payload"in k&&(L.log("Loaded fragment "+y.sn+" of level "+y.level),L.hls.trigger(e.Events.FRAG_LOADED,k),L.state===b.BACKTRACKING)){L.fragmentTracker.backtrack(y,k),L.resetFragmentLoading(y);return}L._handleFragmentLoadComplete(k)}).catch(function(k){L.warn(k),L.resetFragmentLoading(y)})},d.flushMainBuffer=function(y,T,D){if(D===void 0&&(D=null),!(y-T))return;var L={startOffset:y,endOffset:T,type:D};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,L)},d._loadInitSegment=function(y){var T=this;this._doFragLoad(y).then(function(D){if(!D||T.fragContextChanged(y)||!T.levels)throw new Error("init load aborted");return D}).then(function(D){var L=T.hls,x=D.payload,k=y.decryptdata;if(x&&x.byteLength>0&&k&&k.key&&k.iv&&k.method==="AES-128"){var U=self.performance.now();return T.decrypter.webCryptoDecrypt(new Uint8Array(x),k.key.buffer,k.iv.buffer).then(function(R){var V=self.performance.now();return L.trigger(e.Events.FRAG_DECRYPTED,{frag:y,payload:R,stats:{tstart:U,tdecrypt:V}}),D.payload=R,D})}return D}).then(function(D){var L=T.fragCurrent,x=T.hls,k=T.levels;if(!k)throw new Error("init load aborted, missing levels");var U=k[y.level].details;console.assert(U,"Level details are defined when init segment is loaded");var R=y.stats;T.state=b.IDLE,T.fragLoadError=0,y.data=new Uint8Array(D.payload),R.parsing.start=R.buffering.start=self.performance.now(),R.parsing.end=R.buffering.end=self.performance.now(),D.frag===L&&x.trigger(e.Events.FRAG_BUFFERED,{stats:R,frag:L,part:null,id:y.type}),T.tick()}).catch(function(D){T.warn(D),T.resetFragmentLoading(y)})},d.fragContextChanged=function(y){var T=this.fragCurrent;return!y||!T||y.level!==T.level||y.sn!==T.sn||y.urlId!==T.urlId},d.fragBufferedComplete=function(y,T){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+y.type+" sn: "+y.sn+(T?" part: "+T.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+y.level+" "+i.default.toString(j.BufferHelper.getBuffered(D))),this.state=b.IDLE,this.tick()},d._handleFragmentLoadComplete=function(y){var T=this.transmuxer;if(!T)return;var D=y.frag,L=y.part,x=y.partsLoaded,k=!x||x.length===0||x.some(function(R){return!R}),U=new g.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,L?L.index:-1,!k);T.flush(U)},d._handleFragmentLoadProgress=function(y){},d._doFragLoad=function(y,T,D,L){var x=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(y.start,D||0),this.config.lowLatencyMode&&T){var k=T.partList;if(k&&L){D>y.end&&T.fragmentHint&&(y=T.fragmentHint);var U=this.getNextPart(k,y,D);if(U>-1){var R=k[U];return this.log("Loading part sn: "+y.sn+" p: "+R.index+" cc: "+y.cc+" of playlist ["+T.startSN+"-"+T.endSN+"] parts [0-"+U+"-"+(k.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=R.start+R.duration,this.state=b.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,part:k[U],targetBufferTime:D}),this.doFragPartsLoad(y,k,U,L).catch(function(V){return x.handleFragLoadError(V)})}else if(!y.url||this.loadedEndOfParts(k,D))return Promise.resolve(null)}}return this.log("Loading fragment "+y.sn+" cc: "+y.cc+" "+(T?"of ["+T.startSN+"-"+T.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+y.level+", target: "+parseFloat(D.toFixed(3))),Object(H.isFiniteNumber)(y.sn)&&!this.bitrateTest&&(this.nextLoadPosition=y.start+y.duration),this.state=b.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:y,targetBufferTime:D}),this.fragmentLoader.load(y,L).catch(function(V){return x.handleFragLoadError(V)})},d.doFragPartsLoad=function(y,T,D,L){var x=this;return new Promise(function(k,U){var R=[],V=function Z(ue){var le=T[ue];x.fragmentLoader.loadPart(y,le,L).then(function(ge){R[le.index]=ge;var pe=ge.part;x.hls.trigger(e.Events.FRAG_LOADED,ge);var ae=T[ue+1];if(ae&&ae.fragment===y)Z(ue+1);else return k({frag:y,part:pe,partsLoaded:R})}).catch(U)};V(D)})},d.handleFragLoadError=function(y){var T=y.data;return T&&T.details===w.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(T.frag,T.part):this.hls.trigger(e.Events.ERROR,T),null},d._handleTransmuxerFlush=function(y){var T=this.getCurrentContext(y);if(!T||this.state!==b.PARSING){this.fragCurrent||(this.state=b.IDLE);return}var D=T.frag,L=T.part,x=T.level,k=self.performance.now();D.stats.parsing.end=k,L&&(L.stats.parsing.end=k),this.updateLevelTiming(D,L,x,y.partial)},d.getCurrentContext=function(y){var T=this.levels,D=y.level,L=y.sn,x=y.part;if(!T||!T[D])return this.warn("Levels object was unset while buffering fragment "+L+" of level "+D+". The current chunk will not be buffered."),null;var k=T[D],U=x>-1?Object(a.getPartWith)(k,L,x):null,R=U?U.fragment:Object(a.getFragmentWithSN)(k,L,this.fragCurrent);return R?{frag:R,part:U,level:k}:null},d.bufferFragmentData=function(y,T,D,L){if(!y||this.state!==b.PARSING)return;var x=y.data1,k=y.data2,U=x;if(x&&k&&(U=Object(f.appendUint8Array)(x,k)),!U||!U.length)return;var R={type:y.type,frag:T,part:D,chunkMeta:L,parent:T.type,data:U};this.hls.trigger(e.Events.BUFFER_APPENDING,R),y.dropped&&y.independent&&!D&&this.flushBufferGap(T)},d.flushBufferGap=function(y){var T=this.media;if(!T)return;if(!j.BufferHelper.isBuffered(T,T.currentTime)){this.flushMainBuffer(0,y.start);return}var D=T.currentTime,L=j.BufferHelper.bufferInfo(T,D,0),x=y.duration,k=Math.min(this.config.maxFragLookUpTolerance*2,x*.25),U=Math.max(Math.min(y.start-k,L.end-k),D+k);y.start-U>k&&this.flushMainBuffer(U,y.start)},d.getFwdBufferInfo=function(y,T){var D=this.config,L=this.getLoadPosition();if(!Object(H.isFiniteNumber)(L))return null;var x=j.BufferHelper.bufferInfo(y,L,D.maxBufferHole);if(x.len===0&&x.nextStart!==void 0){var k=this.fragmentTracker.getBufferedFrag(L,T);if(k&&x.nextStart<k.end)return j.BufferHelper.bufferInfo(y,L,Math.max(x.nextStart,D.maxBufferHole))}return x},d.getMaxBufferLength=function(y){var T=this.config,D;return y?D=Math.max(8*T.maxBufferSize/y,T.maxBufferLength):D=T.maxBufferLength,Math.min(D,T.maxMaxBufferLength)},d.reduceMaxBufferLength=function(y){var T=this.config,D=y||T.maxBufferLength;return T.maxMaxBufferLength>=D?(T.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+T.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(y,T){var D,L,x=T.fragments,k=x.length;if(!k)return null;var U=this.config,R=x[0].start,V;if(T.live){var Z=U.initialLiveManifestSize;if(k<Z)return this.warn("Not enough fragments to start playback (have: "+k+", need: "+Z+")"),null;!T.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(V=this.getInitialLiveFragment(T,x),this.startPosition=V?this.hls.liveSyncPosition||V.start:y)}else y<=R&&(V=x[0]);if(!V){var ue=U.lowLatencyMode?T.partEnd:T.fragmentEnd;V=this.getFragmentAtPosition(y,ue,T)}return(D=V)!==null&&D!==void 0&&D.initSegment&&!((L=V)!==null&&L!==void 0&&L.initSegment.data)&&!this.bitrateTest&&(V=V.initSegment),V},d.getNextPart=function(y,T,D){for(var L=-1,x=!1,k=!0,U=0,R=y.length;U<R;U++){var V=y[U];if(k=k&&!V.independent,L>-1&&D<V.start)break;var Z=V.loaded;!Z&&(x||V.independent||k)&&V.fragment===T&&(L=U),x=Z}return L},d.loadedEndOfParts=function(y,T){var D=y[y.length-1];return D&&T>D.start&&D.loaded},d.getInitialLiveFragment=function(y,T){var D=this.fragPrevious,L=null;if(D){if(y.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),L=Object(n.findFragmentByPDT)(T,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!L){var x=D.sn+1;if(x>=y.startSN&&x<=y.endSN){var k=T[x-y.startSN];D.cc===k.cc&&(L=k,this.log("Live playlist, switching playlist, load frag with next SN: "+L.sn))}L||(L=Object(n.findFragWithCC)(T,D.cc),L&&this.log("Live playlist, switching playlist, load frag with same CC: "+L.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(L=this.getFragmentAtPosition(U,this.bitrateTest?y.fragmentEnd:y.edge,y))}return L},d.getFragmentAtPosition=function(y,T,D){var L=this.config,x=this.fragPrevious,k=D.fragments,U=D.endSN,R=D.fragmentHint,V=L.maxFragLookUpTolerance,Z=!!(L.lowLatencyMode&&D.partList&&R);Z&&R&&!this.bitrateTest&&(k=k.concat(R),U=R.sn);var ue;if(y<T){var le=y>T-V?0:V;ue=Object(n.findFragmentByPTS)(x,k,y,le)}else ue=k[k.length-1];if(ue){var ge=ue.sn-D.startSN,pe=x&&ue.level===x.level,ae=k[ge+1],ne=this.fragmentTracker.getState(ue);if(ne===C.FragmentState.BACKTRACKED){ue=null;for(var fe=ge;k[fe]&&this.fragmentTracker.getState(k[fe])===C.FragmentState.BACKTRACKED;)x?ue=k[fe--]:ue=k[--fe];ue||(ue=ae)}else x&&ue.sn===x.sn&&!Z&&(pe&&(ue.sn<U&&this.fragmentTracker.getState(ae)!==C.FragmentState.OK?(this.log("SN "+ue.sn+" just loaded, load next one: "+ae.sn),ue=ae):ue=null))}return ue},d.synchronizeToLiveEdge=function(y){var T=this.config,D=this.media;if(!D)return;var L=this.hls.liveSyncPosition,x=D.currentTime,k=y.fragments[0].start,U=y.edge,R=x>=k-T.maxFragLookUpTolerance&&x<=U;if(L!==null&&D.duration>L&&(x<L||!R)){var V=T.liveMaxLatencyDuration!==void 0?T.liveMaxLatencyDuration:T.liveMaxLatencyDurationCount*y.targetduration;(!R&&D.readyState<4||x<U-V)&&(this.loadedmetadata||(this.nextLoadPosition=L),D.readyState&&(this.warn("Playback: "+x.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+L.toFixed(3)),D.currentTime=L))}},d.alignPlaylists=function(y,T){var D=this.levels,L=this.levelLastLoaded,x=this.fragPrevious,k=L!==null?D[L]:null,U=y.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var R=y.fragments[0].start,V=!T,Z=y.alignedSliding&&Object(H.isFiniteNumber)(R);if(V||!Z&&!R){Object(o.alignStream)(x,k,y);var ue=y.fragments[0].start;return this.log("Live playlist sliding: "+ue.toFixed(2)+" start-sn: "+(T?T.startSN:"na")+"->"+y.startSN+" prev-sn: "+(x?x.sn:"na")+" fragments: "+U),ue}return R},d.waitForCdnTuneIn=function(y){var T=3;return y.live&&y.canBlockReload&&y.tuneInGoal>Math.max(y.partHoldBack,y.partTarget*T)},d.setStartPosition=function(y,T){var D=this.startPosition;if(D<T&&(D=-1),D===-1||this.lastCurrentTime===-1){var L=y.startTimeOffset;Object(H.isFiniteNumber)(L)?(D=T+L,L<0&&(D+=y.totalduration),D=Math.min(Math.max(T,D),T+y.totalduration),this.log("Start time offset "+L+" found in playlist, adjust startPosition to "+D),this.startPosition=D):y.live?D=this.hls.liveSyncPosition||T:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},d.getLoadPosition=function(){var y=this.media,T=0;return this.loadedmetadata&&y?T=y.currentTime:this.nextLoadPosition&&(T=this.nextLoadPosition),T},d.handleFragLoadAborted=function(y,T){this.transmuxer&&y.sn!=="initSegment"&&y.stats.aborted&&(this.warn("Fragment "+y.sn+(T?" part"+T.index:"")+" of level "+y.level+" was aborted"),this.resetFragmentLoading(y))},d.resetFragmentLoading=function(y){(!this.fragCurrent||!this.fragContextChanged(y))&&(this.state=b.IDLE)},d.onFragmentOrKeyLoadError=function(y,T){if(T.fatal)return;var D=T.frag;if(!D||D.type!==y)return;var L=this.fragCurrent;console.assert(L&&D.sn===L.sn&&D.level===L.level&&D.urlId===L.urlId,"Frag load error must match current frag to retry");var x=this.config;if(this.fragLoadError+1<=x.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var k=Math.min(Math.pow(2,this.fragLoadError)*x.fragLoadingRetryDelay,x.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+y+" "+D.level+" failed to load, retrying in "+k+"ms"),this.retryDate=self.performance.now()+k,this.fragLoadError++,this.state=b.FRAG_LOADING_WAITING_RETRY}else T.levelRetry?(y===r.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=b.IDLE):(N.logger.error(T.details+" reaches max retry, redispatch as fatal ..."),T.fatal=!0,this.hls.stopLoad(),this.state=b.ERROR)},d.afterBufferFlushed=function(y,T,D){if(!y)return;var L=j.BufferHelper.getBuffered(y);this.fragmentTracker.detectEvictedFragments(T,L,D),this.state===b.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=b.IDLE},d.resetLiveStartWhenNotLoaded=function(y){if(!this.loadedmetadata){this.startFragRequested=!1;var T=this.levels?this.levels[y].details:null;if(T!=null&&T.live)return this.startPosition=-1,this.setStartPosition(T,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(y,T,D,L){var x=this,k=D.details;console.assert(!!k,"level.details must be defined");var U=Object.keys(y.elementaryStreams).reduce(function(R,V){var Z=y.elementaryStreams[V];if(Z){var ue=Z.endPTS-Z.startPTS;if(ue<=0)return x.warn("Could not parse fragment "+y.sn+" "+V+" duration reliably ("+ue+") resetting transmuxer to fallback to playlist timing"),x.resetTransmuxer(),R||!1;var le=L?0:Object(a.updateFragPTSDTS)(k,y,Z.startPTS,Z.endPTS,Z.startDTS,Z.endDTS);return x.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:k,level:D,drift:le,type:V,frag:y,start:Z.startPTS,end:Z.endPTS}),!0}return R},!1);U?(this.state=b.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:y,part:T})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},v(c,[{key:"state",get:function(){return this._state},set:function(y){var T=this._state;T!==y&&(this._state=y,this.log(T+"->"+y))}}]),c}(I.default)},"./src/controller/buffer-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return n});var H=O("./src/polyfills/number.ts"),I=O("./src/events.ts"),C=O("./src/utils/logger.ts"),j=O("./src/errors.ts"),N=O("./src/utils/buffer-helper.ts"),e=O("./src/utils/mediasource-helper.ts"),w=O("./src/loader/fragment.ts"),g=O("./src/controller/buffer-operation-queue.ts"),f=Object(e.getMediaSource)(),o=/([ha]vc.)(?:\.[^.,]+)+/,n=function(){function a(s){var i=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 r=i.hls,t=i.media,v=i.mediaSource;C.logger.log("[buffer-controller]: Media source opened"),t&&(i.updateMediaElementDuration(),r.trigger(I.Events.MEDIA_ATTACHED,{media:t})),v&&v.removeEventListener("sourceopen",i._onMediaSourceOpen),i.checkPendingTracks()},this._onMediaSourceClose=function(){C.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){C.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var l=a.prototype;return l.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},l.destroy=function(){this.unregisterListeners(),this.details=null},l.registerListeners=function(){var i=this.hls;i.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(I.Events.BUFFER_RESET,this.onBufferReset,this),i.on(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.on(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.on(I.Events.BUFFER_EOS,this.onBufferEos,this),i.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.on(I.Events.FRAG_PARSED,this.onFragParsed,this),i.on(I.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var i=this.hls;i.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(I.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(I.Events.BUFFER_RESET,this.onBufferReset,this),i.off(I.Events.BUFFER_APPENDING,this.onBufferAppending,this),i.off(I.Events.BUFFER_CODECS,this.onBufferCodecs,this),i.off(I.Events.BUFFER_EOS,this.onBufferEos,this),i.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),i.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),i.off(I.Events.FRAG_PARSED,this.onFragParsed,this),i.off(I.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new g.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(i,r){var t=2;(r.audio&&!r.video||!r.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,C.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(i,r){var t=this.media=r.media;if(t&&f){var v=this.mediaSource=new f;v.addEventListener("sourceopen",this._onMediaSourceOpen),v.addEventListener("sourceended",this._onMediaSourceEnded),v.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(v),this._objectUrl=t.src}},l.onMediaDetaching=function(){var i=this.media,r=this.mediaSource,t=this._objectUrl;if(r){if(C.logger.log("[buffer-controller]: media source detaching"),r.readyState==="open")try{r.endOfStream()}catch(v){C.logger.warn("[buffer-controller]: onMediaDetaching: "+v.message+" while calling endOfStream")}this.onBufferReset(),r.removeEventListener("sourceopen",this._onMediaSourceOpen),r.removeEventListener("sourceended",this._onMediaSourceEnded),r.removeEventListener("sourceclose",this._onMediaSourceClose),i&&(t&&self.URL.revokeObjectURL(t),i.src===t?(i.removeAttribute("src"),i.load()):C.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(I.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var i=this;this.getSourceBufferTypes().forEach(function(r){var t=i.sourceBuffer[r];try{t&&(i.removeBufferListeners(r),i.mediaSource&&i.mediaSource.removeSourceBuffer(t),i.sourceBuffer[r]=void 0)}catch(v){C.logger.warn("[buffer-controller]: Failed to reset the "+r+" buffer",v)}}),this._initSourceBuffer()},l.onBufferCodecs=function(i,r){var t=this,v=this.getSourceBufferTypes().length;if(Object.keys(r).forEach(function(m){if(v){var p=t.tracks[m];if(p&&typeof p.buffer.changeType=="function"){var _=r[m],b=_.codec,u=_.levelCodec,h=_.container,c=(p.levelCodec||p.codec).replace(o,"$1"),d=(u||b).replace(o,"$1");if(c!==d){var E=h+";codecs="+(u||b);t.appendChangeType(m,E)}}}else t.pendingTracks[m]=r[m]}),v)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(i,r){var t=this,v=this.operationQueue,m={execute:function(){var _=t.sourceBuffer[i];_&&(C.logger.log("[buffer-controller]: changing "+i+" sourceBuffer type to "+r),_.changeType(r)),v.shiftAndExecuteNext(i)},onStart:function(){},onComplete:function(){},onError:function(_){C.logger.warn("[buffer-controller]: Failed to change "+i+" SourceBuffer type",_)}};v.append(m,i)},l.onBufferAppending=function(i,r){var t=this,v=this.hls,m=this.operationQueue,p=this.tracks,_=r.data,b=r.type,u=r.frag,h=r.part,c=r.chunkMeta,d=c.buffering[b],E=self.performance.now();d.start=E;var y=u.stats.buffering,T=h?h.stats.buffering:null;y.start===0&&(y.start=E),T&&T.start===0&&(T.start=E);var D=p.audio,L=b==="audio"&&c.id===1&&(D==null?void 0:D.container)==="audio/mpeg",x={execute:function(){if(d.executeStart=self.performance.now(),L){var U=t.sourceBuffer[b];if(U){var R=u.start-U.timestampOffset;Math.abs(R)>=.1&&(C.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+u.start+" (delta: "+R+") sn: "+u.sn+")"),U.timestampOffset=u.start)}}t.appendExecutor(_,b)},onStart:function(){},onComplete:function(){var U=self.performance.now();d.executeEnd=d.end=U,y.first===0&&(y.first=U),T&&T.first===0&&(T.first=U);var R=t.sourceBuffer,V={};for(var Z in R)V[Z]=N.BufferHelper.getBuffered(R[Z]);t.appendError=0,t.hls.trigger(I.Events.BUFFER_APPENDED,{type:b,frag:u,part:h,chunkMeta:c,parent:u.type,timeRanges:V})},onError:function(U){C.logger.error("[buffer-controller]: Error encountered while trying to append to the "+b+" SourceBuffer",U);var R={type:j.ErrorTypes.MEDIA_ERROR,parent:u.type,details:j.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?R.details=j.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,R.details=j.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>v.config.appendErrorMaxRetry&&(C.logger.error("[buffer-controller]: Failed "+v.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),R.fatal=!0)),v.trigger(I.Events.ERROR,R)}};m.append(x,b)},l.onBufferFlushing=function(i,r){var t=this,v=this.operationQueue,m=function(_){return{execute:t.removeExecutor.bind(t,_,r.startOffset,r.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(I.Events.BUFFER_FLUSHED,{type:_})},onError:function(u){C.logger.warn("[buffer-controller]: Failed to remove from "+_+" SourceBuffer",u)}}};r.type?v.append(m(r.type),r.type):this.getSourceBufferTypes().forEach(function(p){v.append(m(p),p)})},l.onFragParsed=function(i,r){var t=this,v=r.frag,m=r.part,p=[],_=m?m.elementaryStreams:v.elementaryStreams;_[w.ElementaryStreamTypes.AUDIOVIDEO]?p.push("audiovideo"):(_[w.ElementaryStreamTypes.AUDIO]&&p.push("audio"),_[w.ElementaryStreamTypes.VIDEO]&&p.push("video"));var b=function(){var h=self.performance.now();v.stats.buffering.end=h,m&&(m.stats.buffering.end=h);var c=m?m.stats:v.stats;t.hls.trigger(I.Events.FRAG_BUFFERED,{frag:v,part:m,stats:c,id:v.type})};p.length===0&&C.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+v.type+" level: "+v.level+" sn: "+v.sn),this.blockBuffers(b,p)},l.onFragChanged=function(i,r){this.flushBackBuffer()},l.onBufferEos=function(i,r){var t=this,v=this.getSourceBufferTypes().reduce(function(m,p){var _=t.sourceBuffer[p];return(!r.type||r.type===p)&&(_&&!_.ended&&(_.ended=!0,C.logger.log("[buffer-controller]: "+p+" sourceBuffer now EOS"))),m&&!!(!_||_.ended)},!0);v&&this.blockBuffers(function(){var m=t.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},l.onLevelUpdated=function(i,r){var t=r.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var i=this.hls,r=this.details,t=this.media,v=this.sourceBuffer;if(!t||r===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var p=r.live&&i.config.liveBackBufferLength!==null?i.config.liveBackBufferLength:i.config.backBufferLength;if(!Object(H.isFiniteNumber)(p)||p<0)return;var _=t.currentTime,b=r.levelTargetDuration,u=Math.max(p,b),h=Math.floor(_/b)*b-u;m.forEach(function(c){var d=v[c];if(d){var E=N.BufferHelper.getBuffered(d);E.length>0&&h>E.start(0)&&(i.trigger(I.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),r.live&&i.trigger(I.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),i.trigger(I.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:h,type:c}))}})},l.updateMediaElementDuration=function(){if(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")return;var i=this.details,r=this.hls,t=this.media,v=this.mediaSource,m=i.fragments[0].start+i.totalduration,p=t.duration,_=Object(H.isFiniteNumber)(v.duration)?v.duration:0;i.live&&r.config.liveDurationInfinity?(C.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),v.duration=Infinity,this.updateSeekableRange(i)):(m>_&&m>p||!Object(H.isFiniteNumber)(p))&&(C.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),v.duration=m)},l.updateSeekableRange=function(i){var r=this.mediaSource,t=i.fragments,v=t.length;if(v&&i.live&&r!==null&&r!==void 0&&r.setLiveSeekableRange){var m=Math.max(0,t[0].start),p=Math.max(m,m+i.totalduration);r.setLiveSeekableRange(m,p)}},l.checkPendingTracks=function(){var i=this.bufferCodecEventsExpected,r=this.operationQueue,t=this.pendingTracks,v=Object.keys(t).length;if(v&&!i||v===2){this.createSourceBuffers(t),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(I.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(p){r.executeNext(p)})}},l.createSourceBuffers=function(i){var r=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var v=0;for(var m in i)if(!r[m]){var p=i[m];if(!p)throw Error("source buffer exists for track "+m+", however track does not");var _=p.levelCodec||p.codec,b=p.container+";codecs="+_;C.logger.log("[buffer-controller]: creating sourceBuffer("+b+")");try{var u=r[m]=t.addSourceBuffer(b),h=m;this.addBufferListener(h,"updatestart",this._onSBUpdateStart),this.addBufferListener(h,"updateend",this._onSBUpdateEnd),this.addBufferListener(h,"error",this._onSBUpdateError),this.tracks[m]={buffer:u,codec:_,container:p.container,levelCodec:p.levelCodec,id:p.id},v++}catch(c){C.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+c.message),this.hls.trigger(I.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,mimeType:b})}}v&&this.hls.trigger(I.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(i){var r=this.operationQueue,t=r.current(i);t.onStart()},l._onSBUpdateEnd=function(i){var r=this.operationQueue,t=r.current(i);t.onComplete(),r.shiftAndExecuteNext(i)},l._onSBUpdateError=function(i,r){C.logger.error("[buffer-controller]: "+i+" SourceBuffer error",r),this.hls.trigger(I.Events.ERROR,{type:j.ErrorTypes.MEDIA_ERROR,details:j.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(i);t&&t.onError(r)},l.removeExecutor=function(i,r,t){var v=this.media,m=this.mediaSource,p=this.operationQueue,_=this.sourceBuffer,b=_[i];if(!v||!m||!b){C.logger.warn("[buffer-controller]: Attempting to remove from the "+i+" SourceBuffer, but it does not exist"),p.shiftAndExecuteNext(i);return}var u=Object(H.isFiniteNumber)(v.duration)?v.duration:Infinity,h=Object(H.isFiniteNumber)(m.duration)?m.duration:Infinity,c=Math.max(0,r),d=Math.min(t,u,h);d>c?(C.logger.log("[buffer-controller]: Removing ["+c+","+d+"] from the "+i+" SourceBuffer"),console.assert(!b.updating,i+" sourceBuffer must not be updating"),b.remove(c,d)):p.shiftAndExecuteNext(i)},l.appendExecutor=function(i,r){var t=this.operationQueue,v=this.sourceBuffer,m=v[r];if(!m){C.logger.warn("[buffer-controller]: Attempting to append to the "+r+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(r);return}m.ended=!1,console.assert(!m.updating,r+" sourceBuffer must not be updating"),m.appendBuffer(i)},l.blockBuffers=function(i,r){var t=this;if(r===void 0&&(r=this.getSourceBufferTypes()),!r.length){C.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(i);return}var v=this.operationQueue,m=r.map(function(p){return v.appendBlocker(p)});Promise.all(m).then(function(){i(),r.forEach(function(p){var _=t.sourceBuffer[p];(!_||!_.updating)&&v.shiftAndExecuteNext(p)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(i,r,t){var v=this.sourceBuffer[i];if(!v)return;var m=t.bind(this,i);this.listeners[i].push({event:r,listener:m}),v.addEventListener(r,m)},l.removeBufferListeners=function(i){var r=this.sourceBuffer[i];if(!r)return;this.listeners[i].forEach(function(t){r.removeEventListener(t.event,t.listener)})},a}()},"./src/controller/buffer-operation-queue.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return I});var H=O("./src/utils/logger.ts"),I=function(){function C(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var j=C.prototype;return j.append=function(e,w){var g=this.queues[w];g.push(e),g.length===1&&this.buffers[w]&&this.executeNext(w)},j.insertAbort=function(e,w){var g=this.queues[w];g.unshift(e),this.executeNext(w)},j.appendBlocker=function(e){var w,g=new Promise(function(o){w=o}),f={execute:w,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(f,e),g},j.executeNext=function(e){var w=this.buffers,g=this.queues,f=w[e],o=g[e];if(o.length){var n=o[0];try{n.execute()}catch(a){H.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),n.onError(a),(!f||!f.updating)&&(o.shift(),this.executeNext(e))}}},j.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},j.current=function(e){return this.queues[e][0]},C}()},"./src/controller/cap-level-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/events.ts");function I(N,e){for(var w=0;w<e.length;w++){var g=e[w];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(N,g.key,g)}}function C(N,e,w){return e&&I(N.prototype,e),w&&I(N,w),N}var j=function(){function N(w){this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.hls=void 0,this.streamController=void 0,this.clientRect=void 0,this.hls=w,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var e=N.prototype;return e.setStreamController=function(g){this.streamController=g},e.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},e.registerListeners=function(){var g=this.hls;g.on(H.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var g=this.hls;g.off(H.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),g.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),g.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(H.Events.BUFFER_CODECS,this.onBufferCodecs,this),g.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(g,f){N.isLevelAllowed(f.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(f.droppedLevel)},e.onMediaAttaching=function(g,f){this.media=f.media instanceof HTMLVideoElement?f.media:null},e.onManifestParsed=function(g,f){var o=this.hls;this.restrictedLevels=[],this.firstLevel=f.firstLevel,o.config.capLevelToPlayerSize&&f.video&&this.startCapping()},e.onBufferCodecs=function(g,f){var o=this.hls;o.config.capLevelToPlayerSize&&f.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var g=this.hls.levels;if(g.length){var f=this.hls;f.autoLevelCapping=this.getMaxLevel(g.length-1),f.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=f.autoLevelCapping}}},e.getMaxLevel=function(g){var f=this,o=this.hls.levels;if(!o.length)return-1;var n=o.filter(function(a,l){return N.isLevelAllowed(l,f.restrictedLevels)&&l<=g});return this.clientRect=null,N.getMaxLevelByMediaSize(n,this.mediaWidth,this.mediaHeight)},e.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()},e.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},e.getDimensions=function(){if(this.clientRect)return this.clientRect;var g=this.media,f={width:0,height:0};if(g){var o=g.getBoundingClientRect();f.width=o.width,f.height=o.height,!f.width&&!f.height&&(f.width=o.right-o.left||g.width||0,f.height=o.bottom-o.top||g.height||0)}return this.clientRect=f,f},N.isLevelAllowed=function(g,f){return f===void 0&&(f=[]),f.indexOf(g)===-1},N.getMaxLevelByMediaSize=function(g,f,o){if(!g||!g.length)return-1;for(var n=function(r,t){return t?r.width!==t.width||r.height!==t.height:!0},a=g.length-1,l=0;l<g.length;l+=1){var s=g[l];if((s.width>=f||s.height>=o)&&n(s,g[l+1])){a=l;break}}return a},C(N,[{key:"mediaWidth",get:function(){return this.getDimensions().width*N.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*N.contentScaleFactor}}],[{key:"contentScaleFactor",get:function(){var g=1;try{g=self.devicePixelRatio}catch(f){}return g}}]),N}();B.default=j},"./src/controller/cmcd-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return n});var H=O("./src/events.ts"),I=O("./src/types/cmcd.ts"),C=O("./src/utils/buffer-helper.ts"),j=O("./src/utils/logger.ts");function N(a,l){for(var s=0;s<l.length;s++){var i=l[s];i.enumerable=i.enumerable||!1,i.configurable=!0,"value"in i&&(i.writable=!0),Object.defineProperty(a,i.key,i)}}function e(a,l,s){return l&&N(a.prototype,l),s&&N(a,s),a}function w(a,l){var s=typeof Symbol!="undefined"&&a[Symbol.iterator]||a["@@iterator"];if(s)return(s=s.call(a)).next.bind(s);if(Array.isArray(a)||(s=g(a))||l&&a&&typeof a.length=="number"){s&&(a=s);var i=0;return function(){return i>=a.length?{done:!0}:{done:!1,value:a[i++]}}}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(a,l){if(!a)return;if(typeof a=="string")return f(a,l);var s=Object.prototype.toString.call(a).slice(8,-1);if(s==="Object"&&a.constructor&&(s=a.constructor.name),s==="Map"||s==="Set")return Array.from(a);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return f(a,l)}function f(a,l){(l==null||l>a.length)&&(l=a.length);for(var s=0,i=new Array(l);s<l;s++)i[s]=a[s];return i}function o(){return o=Object.assign||function(a){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var i in s)Object.prototype.hasOwnProperty.call(s,i)&&(a[i]=s[i])}return a},o.apply(this,arguments)}var n=function(){function a(s){var i=this;this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=function(){i.initialized&&(i.starved=!0),i.buffering=!0},this.onPlaying=function(){i.initialized||(i.initialized=!0),i.buffering=!1},this.applyPlaylistData=function(v){try{i.apply(v,{ot:I.CMCDObjectType.MANIFEST,su:!i.initialized})}catch(m){j.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(v){try{var m=v.frag,p=i.hls.levels[m.level],_=i.getObjectType(m),b={d:m.duration*1e3,ot:_};(_===I.CMCDObjectType.VIDEO||_===I.CMCDObjectType.AUDIO||_==I.CMCDObjectType.MUXED)&&(b.br=p.bitrate/1e3,b.tb=i.getTopBandwidth(_),b.bl=i.getBufferLength(_)),i.apply(v,b)}catch(u){j.logger.warn("Could not generate segment CMCD data.",u)}},this.hls=s;var r=this.config=s.config,t=r.cmcd;t!=null&&(r.pLoader=this.createPlaylistLoader(),r.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||a.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var l=a.prototype;return l.registerListeners=function(){var i=this.hls;i.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.on(H.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var i=this.hls;i.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),i.off(H.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},l.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},l.onMediaAttached=function(i,r){this.media=r.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},l.onMediaDetached=function(){if(!this.media)return;this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null},l.onBufferCreated=function(i,r){var t,v;this.audioBuffer=(t=r.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(v=r.tracks.video)===null||v===void 0?void 0:v.buffer},l.createData=function(){var i;return{v:I.CMCDVersion,sf:I.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(i=this.media)===null||i===void 0?void 0:i.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(i,r){r===void 0&&(r={}),o(r,this.createData());var t=r.ot===I.CMCDObjectType.INIT||r.ot===I.CMCDObjectType.VIDEO||r.ot===I.CMCDObjectType.MUXED;if(this.starved&&t&&(r.bs=!0,r.su=!0,this.starved=!1),r.su==null&&(r.su=this.buffering),this.useHeaders){var v=a.toHeaders(r);if(!Object.keys(v).length)return;i.headers||(i.headers={}),o(i.headers,v)}else{var m=a.toQuery(r);if(!m)return;i.url=a.appendQueryToUri(i.url,m)}},l.getObjectType=function(i){var r=i.type;return r==="subtitle"?I.CMCDObjectType.TIMED_TEXT:i.sn==="initSegment"?I.CMCDObjectType.INIT:r==="audio"?I.CMCDObjectType.AUDIO:r==="main"?this.hls.audioTracks.length?I.CMCDObjectType.VIDEO:I.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(i){for(var r=0,t=i===I.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,v=w(t),m;!(m=v()).done;){var p=m.value;p.bitrate>r&&(r=p.bitrate)}return r>0?r:NaN},l.getBufferLength=function(i){var r=this.hls.media,t=i===I.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!r)return NaN;var v=C.BufferHelper.bufferInfo(t,r.currentTime,this.config.maxBufferHole);return v.len*1e3},l.createPlaylistLoader=function(){var i=this.config.pLoader,r=this.applyPlaylistData,t=i||this.config.loader;return function(){function v(p){this.loader=void 0,this.loader=new t(p)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(_,b,u){r(_),this.loader.load(_,b,u)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},l.createFragmentLoader=function(){var i=this.config.fLoader,r=this.applyFragmentData,t=i||this.config.loader;return function(){function v(p){this.loader=void 0,this.loader=new t(p)}var m=v.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(_,b,u){r(_),this.loader.load(_,b,u)},e(v,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),v}()},a.uuid=function(){var i=URL.createObjectURL(new Blob),r=i.toString();return URL.revokeObjectURL(i),r.substr(r.lastIndexOf("/")+1)},a.serialize=function(i){for(var r=[],t=function(L){return!Number.isNaN(L)&&L!=null&&L!==""&&L!==!1},v=function(L){return Math.round(L)},m=function(L){return v(L/100)*100},p=function(L){return encodeURIComponent(L)},_={br:v,d:v,bl:m,dl:m,mtp:m,nor:p,rtp:m,tb:v},b=Object.keys(i||{}).sort(),u=w(b),h;!(h=u()).done;){var c=h.value,d=i[c];if(!t(d))continue;if(c==="v"&&d===1)continue;if(c=="pr"&&d===1)continue;var E=_[c];E&&(d=E(d));var y=typeof d,T=void 0;c==="ot"||c==="sf"||c==="st"?T=c+"="+d:y==="boolean"?T=c:y==="number"?T=c+"="+d:T=c+"="+JSON.stringify(d),r.push(T)}return r.join(",")},a.toHeaders=function(i){for(var r=Object.keys(i),t={},v=["Object","Request","Session","Status"],m=[{},{},{},{}],p={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},_=0,b=r;_<b.length;_++){var u=b[_],h=p[u]!=null?p[u]:1;m[h][u]=i[u]}for(var c=0;c<m.length;c++){var d=a.serialize(m[c]);d&&(t["CMCD-"+v[c]]=d)}return t},a.toQuery=function(i){return"CMCD="+encodeURIComponent(a.serialize(i))},a.appendQueryToUri=function(i,r){if(!r)return i;var t=i.includes("?")?"&":"?";return""+i+t+r},a}()},"./src/controller/eme-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/events.ts"),I=O("./src/errors.ts"),C=O("./src/utils/logger.ts"),j=O("./src/utils/mediakeys-helper.ts");function N(n,a){for(var l=0;l<a.length;l++){var s=a[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function e(n,a,l){return a&&N(n.prototype,a),l&&N(n,l),n}var w=3,g=function(a,l,s){var i={audioCapabilities:[],videoCapabilities:[]};return a.forEach(function(r){i.audioCapabilities.push({contentType:'audio/mp4; codecs="'+r+'"',robustness:s.audioRobustness||""})}),l.forEach(function(r){i.videoCapabilities.push({contentType:'video/mp4; codecs="'+r+'"',robustness:s.videoRobustness||""})}),[i]},f=function(a,l,s,i){switch(a){case j.KeySystems.WIDEVINE:return g(l,s,i);default:throw new Error("Unknown key-system: "+a)}},o=function(){function n(l){this.hls=void 0,this._widevineLicenseUrl=void 0,this._licenseXhrSetup=void 0,this._licenseResponseCallback=void 0,this._emeEnabled=void 0,this._requestMediaKeySystemAccess=void 0,this._drmSystemOptions=void 0,this._config=void 0,this._mediaKeysList=[],this._media=null,this._hasSetMediaKeys=!1,this._requestLicenseFailureCount=0,this.mediaKeysPromise=null,this._onMediaEncrypted=this.onMediaEncrypted.bind(this),this.hls=l,this._config=l.config,this._widevineLicenseUrl=this._config.widevineLicenseUrl,this._licenseXhrSetup=this._config.licenseXhrSetup,this._licenseResponseCallback=this._config.licenseResponseCallback,this._emeEnabled=this._config.emeEnabled,this._requestMediaKeySystemAccess=this._config.requestMediaKeySystemAccessFunc,this._drmSystemOptions=this._config.drmSystemOptions,this._registerListeners()}var a=n.prototype;return a.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},a._registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a._unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(H.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this)},a.getLicenseServerUrl=function(s){switch(s){case j.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},a._attemptKeySystemAccess=function(s,i,r){var t=this,v=f(s,i,r,this._drmSystemOptions);C.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,v);this.mediaKeysPromise=m.then(function(p){return t._onMediaKeySystemAccessObtained(s,p)}),m.catch(function(p){C.logger.error('Failed to obtain key-system "'+s+'" access:',p)})},a._onMediaKeySystemAccessObtained=function(s,i){var r=this;C.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:i,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var v=Promise.resolve().then(function(){return i.createMediaKeys()}).then(function(m){return t.mediaKeys=m,C.logger.log('Media-keys created for key-system "'+s+'"'),r._onMediaKeysCreated(),m});return v.catch(function(m){C.logger.error("Failed to create media-keys:",m)}),v},a._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(i){i.mediaKeysSession||(i.mediaKeysSession=i.mediaKeys.createSession(),s._onNewMediaKeySession(i.mediaKeysSession))})},a._onNewMediaKeySession=function(s){var i=this;C.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(r){i._onKeySessionMessage(s,r.message)},!1)},a._onKeySessionMessage=function(s,i){C.logger.log("Got EME message event, creating license request"),this._requestLicense(i,function(r){C.logger.log("Received license data (length: "+(r&&r.byteLength)+"), updating key-session"),s.update(r)})},a.onMediaEncrypted=function(s){var i=this;if(C.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){C.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var r=function(v){if(!i._media)return;i._attemptSetMediaKeys(v),i._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(r).catch(r)},a._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var i=this._mediaKeysList[0];if(!i||!i.mediaKeys){C.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}C.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(i.mediaKeys),this._hasSetMediaKeys=!0}},a._generateRequestWithPreferredKeySession=function(s,i){var r=this,t=this._mediaKeysList[0];if(!t){C.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){C.logger.warn("Key-Session already initialized but requested again");return}var v=t.mediaKeysSession;if(!v){C.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!i){C.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}C.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,v.generateRequest(s,i).then(function(){C.logger.debug("Key-session generation succeeded")}).catch(function(m){C.logger.error("Error generating key-session request:",m),r.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},a._createLicenseXhr=function(s,i,r){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,i,r);var v=this._licenseXhrSetup;if(v)try{v.call(this.hls,t,s),v=void 0}catch(m){C.logger.error(m)}try{t.readyState||t.open("POST",s,!0),v&&v.call(this.hls,t,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return t},a._onLicenseRequestReadyStageChange=function(s,i,r,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,C.logger.log("License request succeeded");var v=s.response,m=this._licenseResponseCallback;if(m)try{v=m.call(this.hls,s,i)}catch(_){C.logger.error(_)}t(v)}else{if(C.logger.error("License Request XHR failed ("+i+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>w){this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var p=w-this._requestLicenseFailureCount+1;C.logger.warn("Retrying license request, "+p+" attempts left"),this._requestLicense(r,t)}break}},a._generateLicenseRequestChallenge=function(s,i){switch(s.mediaKeySystemDomain){case j.KeySystems.WIDEVINE:return i}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},a._requestLicense=function(s,i){C.logger.log("Requesting content license for key-system");var r=this._mediaKeysList[0];if(!r){C.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(r.mediaKeySystemDomain),v=this._createLicenseXhr(t,s,i);C.logger.log("Sending license request to URL: "+t);var m=this._generateLicenseRequestChallenge(r,s);v.send(m)}catch(p){C.logger.error("Failure requesting DRM license: "+p),this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.KEY_SYSTEM_ERROR,details:I.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},a.onMediaAttached=function(s,i){if(!this._emeEnabled)return;var r=i.media;this._media=r,r.addEventListener("encrypted",this._onMediaEncrypted)},a.onMediaDetached=function(){var s=this._media,i=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(i.map(function(r){if(r.mediaKeysSession)return r.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},a.onManifestParsed=function(s,i){if(!this._emeEnabled)return;var r=i.levels.map(function(v){return v.audioCodec}).filter(function(v){return!!v}),t=i.levels.map(function(v){return v.videoCodec}).filter(function(v){return!!v});this._attemptKeySystemAccess(j.KeySystems.WIDEVINE,r,t)},e(n,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),n}();B.default=o},"./src/controller/fps-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/events.ts"),I=O("./src/utils/logger.ts"),C=function(){function j(e){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=e,this.registerListeners()}var N=j.prototype;return N.setStreamController=function(w){this.streamController=w},N.registerListeners=function(){this.hls.on(H.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(H.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(w,g){var f=this.hls.config;if(f.capLevelOnFPSDrop){var o=g.media instanceof self.HTMLVideoElement?g.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),f.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(w,g,f){var o=performance.now();if(g){if(this.lastTime){var n=o-this.lastTime,a=f-this.lastDroppedFrames,l=g-this.lastDecodedFrames,s=1e3*a/n,i=this.hls;if(i.trigger(H.Events.FPS_DROP,{currentDropped:a,currentDecoded:l,totalDroppedFrames:f}),s>0&&a>i.config.fpsDroppedMonitoringThreshold*l){var r=i.currentLevel;I.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+r),r>0&&(i.autoLevelCapping===-1||i.autoLevelCapping>=r)&&(r=r-1,i.trigger(H.Events.FPS_DROP_LEVEL_CAPPING,{level:r,droppedLevel:i.currentLevel}),i.autoLevelCapping=r,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=f,this.lastDecodedFrames=g}},N.checkFPSInterval=function(){var w=this.media;if(w)if(this.isVideoPlaybackQualityAvailable){var g=w.getVideoPlaybackQuality();this.checkFPS(w,g.totalVideoFrames,g.droppedVideoFrames)}else this.checkFPS(w,w.webkitDecodedFrameCount,w.webkitDroppedFrameCount)},j}();B.default=C},"./src/controller/fragment-finders.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"findFragmentByPDT",function(){return C}),O.d(B,"findFragmentByPTS",function(){return j}),O.d(B,"fragmentWithinToleranceTest",function(){return N}),O.d(B,"pdtWithinToleranceTest",function(){return e}),O.d(B,"findFragWithCC",function(){return w});var H=O("./src/polyfills/number.ts"),I=O("./src/utils/binary-search.ts");function C(g,f,o){if(f===null||!Array.isArray(g)||!g.length||!Object(H.isFiniteNumber)(f))return null;var n=g[0].programDateTime;if(f<(n||0))return null;var a=g[g.length-1].endProgramDateTime;if(f>=(a||0))return null;o=o||0;for(var l=0;l<g.length;++l){var s=g[l];if(e(f,o,s))return s}return null}function j(g,f,o,n){o===void 0&&(o=0),n===void 0&&(n=0);var a=null;if(g?a=f[g.sn-f[0].sn+1]||null:o===0&&f[0].start===0&&(a=f[0]),a&&N(o,n,a)===0)return a;var l=I.default.search(f,N.bind(null,o,n));return l||a}function N(g,f,o){g===void 0&&(g=0),f===void 0&&(f=0);var n=Math.min(f,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-n<=g?1:o.start-n>g&&o.start?-1:0}function e(g,f,o){var n=Math.min(f,o.duration+(o.deltaPTS?o.deltaPTS:0))*1e3,a=o.endProgramDateTime||0;return a-n>g}function w(g,f){return I.default.search(g,function(o){return o.cc<f?1:o.cc>f?-1:0})}},"./src/controller/fragment-tracker.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"FragmentState",function(){return C}),O.d(B,"FragmentTracker",function(){return j});var H=O("./src/events.ts"),I=O("./src/types/loader.ts"),C;(function(w){w.NOT_LOADED="NOT_LOADED",w.BACKTRACKED="BACKTRACKED",w.APPENDING="APPENDING",w.PARTIAL="PARTIAL",w.OK="OK"})(C||(C={}));var j=function(){function w(f){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=f,this._registerListeners()}var g=w.prototype;return g._registerListeners=function(){var o=this.hls;o.on(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.on(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(H.Events.FRAG_LOADED,this.onFragLoaded,this)},g._unregisterListeners=function(){var o=this.hls;o.off(H.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.off(H.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(H.Events.FRAG_LOADED,this.onFragLoaded,this)},g.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},g.getAppendedFrag=function(o,n){if(n===I.PlaylistLevelType.MAIN){var a=this.activeFragment,l=this.activeParts;if(!a)return null;if(l)for(var s=l.length;s--;){var i=l[s],r=i?i.end:a.appendedPTS;if(i.start<=o&&r!==void 0&&o<=r)return s>9&&(this.activeParts=l.slice(s-9)),i}else if(a.start<=o&&a.appendedPTS!==void 0&&o<=a.appendedPTS)return a}return this.getBufferedFrag(o,n)},g.getBufferedFrag=function(o,n){for(var a=this.fragments,l=Object.keys(a),s=l.length;s--;){var i=a[l[s]];if((i==null?void 0:i.body.type)===n&&i.buffered){var r=i.body;if(r.start<=o&&o<=r.end)return r}}return null},g.detectEvictedFragments=function(o,n,a){var l=this;Object.keys(this.fragments).forEach(function(s){var i=l.fragments[s];if(!i)return;if(!i.buffered){i.body.type===a&&l.removeFragment(i.body);return}var r=i.range[o];if(!r)return;r.time.some(function(t){var v=!l.isTimeBuffered(t.startPTS,t.endPTS,n);return v&&l.removeFragment(i.body),v})})},g.detectPartialFragments=function(o){var n=this,a=this.timeRanges,l=o.frag,s=o.part;if(!a||l.sn==="initSegment")return;var i=e(l),r=this.fragments[i];if(!r)return;Object.keys(a).forEach(function(t){var v=l.elementaryStreams[t];if(!v)return;var m=a[t],p=s!==null||v.partial===!0;r.range[t]=n.getBufferedTimes(l,s,p,m)}),r.backtrack=r.loaded=null,Object.keys(r.range).length?r.buffered=!0:this.removeFragment(r.body)},g.fragBuffered=function(o){var n=e(o),a=this.fragments[n];a&&(a.backtrack=a.loaded=null,a.buffered=!0)},g.getBufferedTimes=function(o,n,a,l){for(var s={time:[],partial:a},i=n?n.start:o.start,r=n?n.end:o.end,t=o.minEndPTS||r,v=o.maxStartPTS||i,m=0;m<l.length;m++){var p=l.start(m)-this.bufferPadding,_=l.end(m)+this.bufferPadding;if(v>=p&&t<=_){s.time.push({startPTS:Math.max(i,l.start(m)),endPTS:Math.min(r,l.end(m))});break}else if(i<_&&r>p)s.partial=!0,s.time.push({startPTS:Math.max(i,l.start(m)),endPTS:Math.min(r,l.end(m))});else if(r<=p)break}return s},g.getPartialFragment=function(o){var n=null,a,l,s,i=0,r=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(v){var m=t[v];if(!m)return;N(m)&&(l=m.body.start-r,s=m.body.end+r,o>=l&&o<=s&&(a=Math.min(o-l,s-o),i<=a&&(n=m.body,i=a)))}),n},g.getState=function(o){var n=e(o),a=this.fragments[n];return a?a.buffered?N(a)?C.PARTIAL:C.OK:a.backtrack?C.BACKTRACKED:C.APPENDING:C.NOT_LOADED},g.backtrack=function(o,n){var a=e(o),l=this.fragments[a];if(!l||l.backtrack)return null;var s=l.backtrack=n||l.loaded;return l.loaded=null,s},g.getBacktrackData=function(o){var n=e(o),a=this.fragments[n];if(a){var l,s=a.backtrack;if(s!=null&&(l=s.payload)!==null&&l!==void 0&&l.byteLength)return s;this.removeFragment(o)}return null},g.isTimeBuffered=function(o,n,a){for(var l,s,i=0;i<a.length;i++){if(l=a.start(i)-this.bufferPadding,s=a.end(i)+this.bufferPadding,o>=l&&n<=s)return!0;if(n<=l)return!1}return!1},g.onFragLoaded=function(o,n){var a=n.frag,l=n.part;if(a.sn==="initSegment"||a.bitrateTest||l)return;var s=e(a);this.fragments[s]={body:a,loaded:n,backtrack:null,buffered:!1,range:Object.create(null)}},g.onBufferAppended=function(o,n){var a=this,l=n.frag,s=n.part,i=n.timeRanges;if(l.type===I.PlaylistLevelType.MAIN)if(this.activeFragment=l,s){var r=this.activeParts;r||(this.activeParts=r=[]),r.push(s)}else this.activeParts=null;this.timeRanges=i,Object.keys(i).forEach(function(t){var v=i[t];if(a.detectEvictedFragments(t,v),!s)for(var m=0;m<v.length;m++)l.appendedPTS=Math.max(v.end(m),l.appendedPTS||0)})},g.onFragBuffered=function(o,n){this.detectPartialFragments(n)},g.hasFragment=function(o){var n=e(o);return!!this.fragments[n]},g.removeFragmentsInRange=function(o,n,a){var l=this;Object.keys(this.fragments).forEach(function(s){var i=l.fragments[s];if(!i)return;if(i.buffered){var r=i.body;r.type===a&&r.start<n&&r.end>o&&l.removeFragment(r)}})},g.removeFragment=function(o){var n=e(o);o.stats.loaded=0,o.clearElementaryStreamInfo(),delete this.fragments[n]},g.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},w}();function N(w){var g,f;return w.buffered&&(((g=w.range.video)===null||g===void 0?void 0:g.partial)||((f=w.range.audio)===null||f===void 0?void 0:f.partial))}function e(w){return w.type+"_"+w.level+"_"+w.urlId+"_"+w.sn}},"./src/controller/gap-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"STALL_MINIMUM_DURATION_MS",function(){return N}),O.d(B,"MAX_START_GAP_JUMP",function(){return e}),O.d(B,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return w}),O.d(B,"SKIP_BUFFER_RANGE_START",function(){return g}),O.d(B,"default",function(){return f});var H=O("./src/utils/buffer-helper.ts"),I=O("./src/errors.ts"),C=O("./src/events.ts"),j=O("./src/utils/logger.ts"),N=250,e=2,w=.1,g=.05,f=function(){function o(a,l,s,i){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=a,this.media=l,this.fragmentTracker=s,this.hls=i}var n=o.prototype;return n.destroy=function(){this.hls=this.fragmentTracker=this.media=null},n.poll=function(l){var s=this.config,i=this.media,r=this.stalled,t=i.currentTime,v=i.seeking,m=this.seeking&&!v,p=!this.seeking&&v;if(this.seeking=v,t!==l){if(this.moved=!0,r!==null){if(this.stallReported){var _=self.performance.now()-r;j.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(_)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((p||m)&&(this.stalled=null),i.paused||i.ended||i.playbackRate===0||!H.BufferHelper.getBuffered(i).length)return;var b=H.BufferHelper.bufferInfo(i,t,0),u=b.len>0,h=b.nextStart||0;if(!u&&!h)return;if(v){var c=b.len>e,d=!h||h-t>e&&!this.fragmentTracker.getPartialFragment(t);if(c||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var E,y=Math.max(h,b.start||0)-t,T=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=T==null||((E=T.details)===null||E===void 0)?void 0:E.live,L=D?T.details.targetduration*2:e;if(y>0&&y<=L){this._trySkipBufferHole(null);return}}var x=self.performance.now();if(r===null){this.stalled=x;return}var k=x-r;!v&&k>=N&&this._reportStall(b.len);var U=H.BufferHelper.bufferInfo(i,t,s.maxBufferHole);this._tryFixBufferStall(U,k)},n._tryFixBufferStall=function(l,s){var i=this.config,r=this.fragmentTracker,t=this.media,v=t.currentTime,m=r.getPartialFragment(v);if(m){var p=this._trySkipBufferHole(m);if(p)return}l.len>i.maxBufferHole&&s>i.highBufferWatchdogPeriod*1e3&&(j.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},n._reportStall=function(l){var s=this.hls,i=this.media,r=this.stallReported;r||(this.stallReported=!0,j.logger.warn("Playback stalling at @"+i.currentTime+" due to low buffer (buffer="+l+")"),s.trigger(C.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},n._trySkipBufferHole=function(l){for(var s=this.config,i=this.hls,r=this.media,t=r.currentTime,v=0,m=H.BufferHelper.getBuffered(r),p=0;p<m.length;p++){var _=m.start(p);if(t+s.maxBufferHole>=v&&t<_){var b=Math.max(_+g,r.currentTime+w);return j.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+b),this.moved=!0,this.stalled=null,r.currentTime=b,l&&i.trigger(C.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+b,frag:l}),b}v=m.end(p)}return 0},n._tryNudgeBuffer=function(){var l=this.config,s=this.hls,i=this.media,r=i.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<l.nudgeMaxRetry){var v=r+t*l.nudgeOffset;j.logger.warn("Nudging 'currentTime' from "+r+" to "+v),i.currentTime=v,s.trigger(C.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else j.logger.error("Playhead still not moving while enough data buffered @"+r+" after "+l.nudgeMaxRetry+" nudges"),s.trigger(C.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},o}()},"./src/controller/id3-track-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/events.ts"),I=O("./src/utils/texttrack-utils.ts"),C=O("./src/demux/id3.ts"),j=.25,N=function(){function e(g){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=g,this._registerListeners()}var w=e.prototype;return w.destroy=function(){this._unregisterListeners()},w._registerListeners=function(){var f=this.hls;f.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.on(H.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w._unregisterListeners=function(){var f=this.hls;f.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),f.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),f.off(H.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),f.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},w.onMediaAttached=function(f,o){this.media=o.media},w.onMediaDetaching=function(){if(!this.id3Track)return;Object(I.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},w.getID3Track=function(f){if(!this.media)return;for(var o=0;o<f.length;o++){var n=f[o];if(n.kind==="metadata"&&n.label==="id3")return Object(I.sendAddTrackEvent)(n,this.media),n}return this.media.addTextTrack("metadata","id3")},w.onFragParsingMetadata=function(f,o){if(!this.media)return;var n=o.frag,a=o.samples;this.id3Track||(this.id3Track=this.getID3Track(this.media.textTracks),this.id3Track.mode="hidden");for(var l=self.WebKitDataCue||self.VTTCue||self.TextTrackCue,s=0;s<a.length;s++){var i=C.getID3Frames(a[s].data);if(i){var r=a[s].pts,t=s<a.length-1?a[s+1].pts:n.end,v=t-r;v<=0&&(t=r+j);for(var m=0;m<i.length;m++){var p=i[m];if(!C.isTimeStampFrame(p)){var _=new l(r,t,"");_.value=p,this.id3Track.addCue(_)}}}}},w.onBufferFlushing=function(f,o){var n=o.startOffset,a=o.endOffset,l=o.type;if(!l||l==="audio"){var s=this.id3Track;s&&Object(I.removeCuesInRange)(s,n,a)}},e}();B.default=N},"./src/controller/latency-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return e});var H=O("./src/errors.ts"),I=O("./src/events.ts"),C=O("./src/utils/logger.ts");function j(w,g){for(var f=0;f<g.length;f++){var o=g[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(w,o.key,o)}}function N(w,g,f){return g&&j(w.prototype,g),f&&j(w,f),w}var e=function(){function w(f){var o=this;this.hls=void 0,this.config=void 0,this.media=null,this.levelDetails=null,this.currentTime=0,this.stallCount=0,this._latency=null,this.timeupdateHandler=function(){return o.timeupdate()},this.hls=f,this.config=f.config,this.registerListeners()}var g=w.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},g.registerListeners=function(){this.hls.on(I.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(I.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(I.Events.ERROR,this.onError,this)},g.unregisterListeners=function(){this.hls.off(I.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(I.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(I.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(I.Events.ERROR,this.onError)},g.onMediaAttached=function(o,n){this.media=n.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},g.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},g.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},g.onLevelUpdated=function(o,n){var a=n.details;this.levelDetails=a,a.advanced&&this.timeupdate(),!a.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},g.onError=function(o,n){if(n.details!==H.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,C.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},g.timeupdate=function(){var o=this.media,n=this.levelDetails;if(!o||!n)return;this.currentTime=o.currentTime;var a=this.computeLatency();if(a===null)return;this._latency=a;var l=this.config,s=l.lowLatencyMode,i=l.maxLiveSyncPlaybackRate;if(!s||i===1)return;var r=this.targetLatency;if(r===null)return;var t=a-r,v=Math.min(this.maxLatency,r+n.targetduration),m=t<v;if(n.live&&m&&t>.05&&this.forwardBufferLength>1){var p=Math.min(2,Math.max(1,i)),_=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;o.playbackRate=Math.min(p,Math.max(1,_))}else o.playbackRate!==1&&o.playbackRate!==0&&(o.playbackRate=1)},g.estimateLiveEdge=function(){var o=this.levelDetails;return o===null?null:o.edge+o.age},g.computeLatency=function(){var o=this.estimateLiveEdge();return o===null?null:o-this.currentTime},N(w,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var o=this.config,n=this.levelDetails;return o.liveMaxLatencyDuration!==void 0?o.liveMaxLatencyDuration:n?o.liveMaxLatencyDurationCount*n.targetduration:0}},{key:"targetLatency",get:function(){var o=this.levelDetails;if(o===null)return null;var n=o.holdBack,a=o.partHoldBack,l=o.targetduration,s=this.config,i=s.liveSyncDuration,r=s.liveSyncDurationCount,t=s.lowLatencyMode,v=this.hls.userConfig,m=t&&a||n;(v.liveSyncDuration||v.liveSyncDurationCount||m===0)&&(m=i!==void 0?i:r*l);var p=l,_=1;return m+Math.min(this.stallCount*_,p)}},{key:"liveSyncPosition",get:function(){var o=this.estimateLiveEdge(),n=this.targetLatency,a=this.levelDetails;if(o===null||n===null||a===null)return null;var l=a.edge,s=o-n-this.edgeStalled,i=l-a.totalduration,r=l-(this.config.lowLatencyMode&&a.partTarget||a.targetduration);return Math.min(Math.max(i,s),r)}},{key:"drift",get:function(){var o=this.levelDetails;return o===null?1:o.drift}},{key:"edgeStalled",get:function(){var o=this.levelDetails;if(o===null)return 0;var n=(this.config.lowLatencyMode&&o.partTarget||o.targetduration)*3;return Math.max(o.age-n,0)}},{key:"forwardBufferLength",get:function(){var o=this.media,n=this.levelDetails;if(!o||!n)return 0;var a=o.buffered.length;return a?o.buffered.end(a-1):n.edge-this.currentTime}}]),w}()},"./src/controller/level-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return s});var H=O("./src/types/level.ts"),I=O("./src/events.ts"),C=O("./src/errors.ts"),j=O("./src/utils/codecs.ts"),N=O("./src/controller/level-helper.ts"),e=O("./src/controller/base-playlist-controller.ts"),w=O("./src/types/loader.ts");function g(){return g=Object.assign||function(i){for(var r=1;r<arguments.length;r++){var t=arguments[r];for(var v in t)Object.prototype.hasOwnProperty.call(t,v)&&(i[v]=t[v])}return i},g.apply(this,arguments)}function f(i,r){for(var t=0;t<r.length;t++){var v=r[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(i,v.key,v)}}function o(i,r,t){return r&&f(i.prototype,r),t&&f(i,t),i}function n(i,r){i.prototype=Object.create(r.prototype),i.prototype.constructor=i,a(i,r)}function a(i,r){return a=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},a(i,r)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(i){n(r,i);function r(v){var m;return m=i.call(this,v,"[level-controller]")||this,m._levels=[],m._firstLevel=-1,m._startLevel=void 0,m.currentLevelIndex=-1,m.manualLevelIndex=-1,m.onParsedComplete=void 0,m._registerListeners(),m}var t=r.prototype;return t._registerListeners=function(){var m=this.hls;m.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(I.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var m=this.hls;m.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(I.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(I.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(I.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,i.prototype.destroy.call(this)},t.startLoad=function(){var m=this._levels;m.forEach(function(p){p.loadError=0}),i.prototype.startLoad.call(this)},t.onManifestLoaded=function(m,p){var _=[],b=[],u=[],h,c={},d,E=!1,y=!1,T=!1;if(p.levels.forEach(function(k){var U=k.attrs;E=E||!!(k.width&&k.height),y=y||!!k.videoCodec,T=T||!!k.audioCodec,l&&k.audioCodec&&k.audioCodec.indexOf("mp4a.40.34")!==-1&&(k.audioCodec=void 0);var R=k.bitrate+"-"+k.attrs.RESOLUTION+"-"+k.attrs.CODECS;d=c[R],d?d.url.push(k.url):(d=new H.Level(k),c[R]=d,_.push(d)),U&&(U.AUDIO&&Object(N.addGroupId)(d,"audio",U.AUDIO),U.SUBTITLES&&Object(N.addGroupId)(d,"text",U.SUBTITLES))}),(E||y)&&T&&(_=_.filter(function(k){var U=k.videoCodec,R=k.width,V=k.height;return!!U||!!(R&&V)})),_=_.filter(function(k){var U=k.audioCodec,R=k.videoCodec;return(!U||Object(j.isCodecSupportedInMp4)(U,"audio"))&&(!R||Object(j.isCodecSupportedInMp4)(R,"video"))}),p.audioTracks&&(b=p.audioTracks.filter(function(k){return!k.audioCodec||Object(j.isCodecSupportedInMp4)(k.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(b)),p.subtitles&&(u=p.subtitles,Object(N.assignTrackIdsByGroup)(u)),_.length>0){h=_[0].bitrate,_.sort(function(k,U){return k.bitrate-U.bitrate}),this._levels=_;for(var D=0;D<_.length;D++)if(_[D].bitrate===h){this._firstLevel=D,this.log("manifest loaded, "+_.length+" level(s) found, first bitrate: "+h);break}var L=T&&!y,x={levels:_,audioTracks:b,subtitleTracks:u,firstLevel:this._firstLevel,stats:p.stats,audio:T,video:y,altAudio:!L&&b.some(function(k){return!!k.url})};this.hls.trigger(I.Events.MANIFEST_PARSED,x),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(I.Events.ERROR,{type:C.ErrorTypes.MEDIA_ERROR,details:C.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:p.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(m,p){if(i.prototype.onError.call(this,m,p),p.fatal)return;var _=p.context,b=this._levels[this.currentLevelIndex];if(_&&(_.type===w.PlaylistContextType.AUDIO_TRACK&&b.audioGroupIds&&_.groupId===b.audioGroupIds[b.urlId]||_.type===w.PlaylistContextType.SUBTITLE_TRACK&&b.textGroupIds&&_.groupId===b.textGroupIds[b.urlId])){this.redundantFailover(this.currentLevelIndex);return}var u=!1,h=!0,c;switch(p.details){case C.ErrorDetails.FRAG_LOAD_ERROR:case C.ErrorDetails.FRAG_LOAD_TIMEOUT:case C.ErrorDetails.KEY_LOAD_ERROR:case C.ErrorDetails.KEY_LOAD_TIMEOUT:if(p.frag){var d=this._levels[p.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(c=p.frag.level)):c=p.frag.level}break;case C.ErrorDetails.LEVEL_LOAD_ERROR:case C.ErrorDetails.LEVEL_LOAD_TIMEOUT:_&&(_.deliveryDirectives&&(h=!1),c=_.level),u=!0;break;case C.ErrorDetails.REMUX_ALLOC_ERROR:c=p.level,u=!0;break}c!==void 0&&this.recoverLevel(p,c,u,h)},t.recoverLevel=function(m,p,_,b){var u=m.details,h=this._levels[p];if(h.loadError++,_){var c=this.retryLoadingOrFail(m);if(c)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(b){var d=h.url.length;if(d>1&&h.loadError<d)m.levelRetry=!0,this.redundantFailover(p);else if(this.manualLevelIndex===-1){var E=p===0?this._levels.length-1:p-1;this.currentLevelIndex!==E&&this._levels[E].loadError===0&&(this.warn(u+": switch to "+E),m.levelRetry=!0,this.hls.nextAutoLevel=E)}}},t.redundantFailover=function(m){var p=this._levels[m],_=p.url.length;if(_>1){var b=(p.urlId+1)%_;this.warn("Switching to redundant URL-id "+b),this._levels.forEach(function(u){u.urlId=b}),this.level=m}},t.onFragLoaded=function(m,p){var _=p.frag;if(_!==void 0&&_.type===w.PlaylistLevelType.MAIN){var b=this._levels[_.level];b!==void 0&&(b.fragmentError=0,b.loadError=0)}},t.onLevelLoaded=function(m,p){var _,b=p.level,u=p.details,h=this._levels[b];if(!h){var c;this.warn("Invalid level index "+b),(c=p.deliveryDirectives)!==null&&c!==void 0&&c.skip&&(u.deltaUpdateFailed=!0);return}b===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0,this.retryCount=0),this.playlistLoaded(b,p,h.details)):(_=p.deliveryDirectives)!==null&&_!==void 0&&_.skip&&(u.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(m,p){var _=this.hls.levels[this.currentLevelIndex];if(!_)return;if(_.audioGroupIds){for(var b=-1,u=this.hls.audioTracks[p.id].groupId,h=0;h<_.audioGroupIds.length;h++)if(_.audioGroupIds[h]===u){b=h;break}b!==_.urlId&&(_.urlId=b,this.startLoad())}},t.loadPlaylist=function(m){var p=this.currentLevelIndex,_=this._levels[p];if(this.canLoad&&_&&_.url.length>0){var b=_.urlId,u=_.url[b];if(m)try{u=m.addDirectives(u)}catch(h){this.warn("Could not construct new URL with HLS Delivery Directives: "+h)}this.log("Attempt loading level index "+p+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+b+" "+u),this.clearTimer(),this.hls.trigger(I.Events.LEVEL_LOADING,{url:u,level:p,id:b,deliveryDirectives:m||null})}},t.removeLevel=function(m,p){var _=function(h,c){return c!==p},b=this._levels.filter(function(u,h){return h!==m?!0:u.url.length>1&&p!==void 0?(u.url=u.url.filter(_),u.audioGroupIds&&(u.audioGroupIds=u.audioGroupIds.filter(_)),u.textGroupIds&&(u.textGroupIds=u.textGroupIds.filter(_)),u.urlId=0,!0):!1}).map(function(u,h){var c=u.details;return c!=null&&c.fragments&&c.fragments.forEach(function(d){d.level=h}),u});this._levels=b,this.hls.trigger(I.Events.LEVELS_UPDATED,{levels:b})},o(r,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var p,_=this._levels;if(_.length===0)return;if(this.currentLevelIndex===m&&(p=_[m])!==null&&p!==void 0&&p.details)return;if(m<0||m>=_.length){var b=m<0;if(this.hls.trigger(I.Events.ERROR,{type:C.ErrorTypes.OTHER_ERROR,details:C.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:b,reason:"invalid level idx"}),b)return;m=Math.min(m,_.length-1)}this.clearTimer();var u=this.currentLevelIndex,h=_[u],c=_[m];this.log("switching to level "+m+" from "+u),this.currentLevelIndex=m;var d=g({},c,{level:m,maxBitrate:c.maxBitrate,uri:c.uri,urlId:c.urlId});delete d._urlId,this.hls.trigger(I.Events.LEVEL_SWITCHING,d);var E=c.details;if(!E||E.live){var y=this.switchParams(c.uri,h==null?void 0:h.details);this.loadPlaylist(y)}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(m){this.manualLevelIndex=m,this._startLevel===void 0&&(this._startLevel=m),m!==-1&&(this.level=m)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(m){this._firstLevel=m}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var m=this.hls.config.startLevel;return m!==void 0?m:this._firstLevel}else return this._startLevel},set:function(m){this._startLevel=m}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(m){this.level=m,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=m)}}]),r}(e.default)},"./src/controller/level-helper.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"addGroupId",function(){return C}),O.d(B,"assignTrackIdsByGroup",function(){return j}),O.d(B,"updatePTS",function(){return N}),O.d(B,"updateFragPTSDTS",function(){return w}),O.d(B,"mergeDetails",function(){return g}),O.d(B,"mapPartIntersection",function(){return f}),O.d(B,"mapFragmentIntersection",function(){return o}),O.d(B,"adjustSliding",function(){return n}),O.d(B,"addSliding",function(){return a}),O.d(B,"computeReloadInterval",function(){return l}),O.d(B,"getFragmentWithSN",function(){return s}),O.d(B,"getPartWith",function(){return i});var H=O("./src/polyfills/number.ts"),I=O("./src/utils/logger.ts");function C(r,t,v){switch(t){case"audio":r.audioGroupIds||(r.audioGroupIds=[]),r.audioGroupIds.push(v);break;case"text":r.textGroupIds||(r.textGroupIds=[]),r.textGroupIds.push(v);break}}function j(r){var t={};r.forEach(function(v){var m=v.groupId||"";v.id=t[m]=t[m]||0,t[m]++})}function N(r,t,v){var m=r[t],p=r[v];e(m,p)}function e(r,t){var v=t.startPTS;if(Object(H.isFiniteNumber)(v)){var m=0,p;t.sn>r.sn?(m=v-r.start,p=r):(m=r.start-v,p=t),p.duration!==m&&(p.duration=m)}else if(t.sn>r.sn){var _=r.cc===t.cc;_&&r.minEndPTS?t.start=r.start+(r.minEndPTS-r.start):t.start=r.start+r.duration}else t.start=Math.max(r.start-t.duration,0)}function w(r,t,v,m,p,_){var b=m-v;b<=0&&(I.logger.warn("Fragment should have a positive duration",t),m=v+t.duration,_=p+t.duration);var u=v,h=m,c=t.startPTS,d=t.endPTS;if(Object(H.isFiniteNumber)(c)){var E=Math.abs(c-v);Object(H.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(E,t.deltaPTS):t.deltaPTS=E,u=Math.max(v,c),v=Math.min(v,c),p=Math.min(p,t.startDTS),h=Math.min(m,d),m=Math.max(m,d),_=Math.max(_,t.endDTS)}t.duration=m-v;var y=v-t.start;t.appendedPTS=m,t.start=t.startPTS=v,t.maxStartPTS=u,t.startDTS=p,t.endPTS=m,t.minEndPTS=h,t.endDTS=_;var T=t.sn;if(!r||T<r.startSN||T>r.endSN)return 0;var D,L=T-r.startSN,x=r.fragments;for(x[L]=t,D=L;D>0;D--)e(x[D],x[D-1]);for(D=L;D<x.length-1;D++)e(x[D],x[D+1]);return r.fragmentHint&&e(x[x.length-1],r.fragmentHint),r.PTSKnown=r.alignedSliding=!0,y}function g(r,t){for(var v=null,m=r.fragments,p=m.length-1;p>=0;p--){var _=m[p].initSegment;if(_){v=_;break}}r.fragmentHint&&delete r.fragmentHint.endPTS;var b=0,u;if(o(r,t,function(D,L){D.relurl&&(b=D.cc-L.cc),Object(H.isFiniteNumber)(D.startPTS)&&Object(H.isFiniteNumber)(D.endPTS)&&(L.start=L.startPTS=D.startPTS,L.startDTS=D.startDTS,L.appendedPTS=D.appendedPTS,L.maxStartPTS=D.maxStartPTS,L.endPTS=D.endPTS,L.endDTS=D.endDTS,L.minEndPTS=D.minEndPTS,L.duration=D.endPTS-D.startPTS,L.duration&&(u=L),t.PTSKnown=t.alignedSliding=!0),L.elementaryStreams=D.elementaryStreams,L.loader=D.loader,L.stats=D.stats,L.urlId=D.urlId,D.initSegment&&(L.initSegment=D.initSegment,v=D.initSegment)}),v){var h=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;h.forEach(function(D){var L;(!D.initSegment||D.initSegment.relurl===((L=v)===null||L===void 0?void 0:L.relurl))&&(D.initSegment=v)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(D){return!D}),t.deltaUpdateFailed)){I.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var c=t.skippedSegments;c--;)t.fragments.shift();t.startSN=t.fragments[0].sn,t.startCC=t.fragments[0].cc}var d=t.fragments;if(b){I.logger.warn("discontinuity sliding from playlist, take drift into account");for(var E=0;E<d.length;E++)d[E].cc+=b}t.skippedSegments&&(t.startCC=t.fragments[0].cc),f(r.partList,t.partList,function(D,L){L.elementaryStreams=D.elementaryStreams,L.stats=D.stats}),u?w(t,u,u.startPTS,u.endPTS,u.startDTS,u.endDTS):n(r,t),d.length&&(t.totalduration=t.edge-d[0].start),t.driftStartTime=r.driftStartTime,t.driftStart=r.driftStart;var y=t.advancedDateTime;if(t.advanced&&y){var T=t.edge;t.driftStart||(t.driftStartTime=y,t.driftStart=T),t.driftEndTime=y,t.driftEnd=T}else t.driftEndTime=r.driftEndTime,t.driftEnd=r.driftEnd,t.advancedDateTime=r.advancedDateTime}function f(r,t,v){if(r&&t)for(var m=0,p=0,_=r.length;p<=_;p++){var b=r[p],u=t[p+m];b&&u&&b.index===u.index&&b.fragment.sn===u.fragment.sn?v(b,u):m--}}function o(r,t,v){for(var m=t.skippedSegments,p=Math.max(r.startSN,t.startSN)-t.startSN,_=(r.fragmentHint?1:0)+(m?t.endSN:Math.min(r.endSN,t.endSN))-t.startSN,b=t.startSN-r.startSN,u=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,h=r.fragmentHint?r.fragments.concat(r.fragmentHint):r.fragments,c=p;c<=_;c++){var d=h[b+c],E=u[c];m&&!E&&c<m&&(E=t.fragments[c]=d),d&&E&&v(d,E)}}function n(r,t){var v=t.startSN+t.skippedSegments-r.startSN,m=r.fragments;if(v<0||v>=m.length)return;a(t,m[v].start)}function a(r,t){if(t){for(var v=r.fragments,m=r.skippedSegments;m<v.length;m++)v[m].start+=t;r.fragmentHint&&(r.fragmentHint.start+=t)}}function l(r,t){var v=1e3*r.levelTargetDuration,m=v/2,p=r.age,_=p>0&&p<v*3,b=t.loading.end-t.loading.start,u,h=r.availabilityDelay;if(r.updated===!1)if(_){var c=333*r.misses;u=Math.max(Math.min(m,b*2),c),r.availabilityDelay=(r.availabilityDelay||0)+u}else u=m;else _?(h=Math.min(h||v/2,p),r.availabilityDelay=h,u=h+v-p):u=v-b;return Math.round(u)}function s(r,t,v){if(!r||!r.details)return null;var m=r.details,p=m.fragments[t-m.startSN];return p||(p=m.fragmentHint,p&&p.sn===t?p:t<m.startSN&&v&&v.sn===t?v:null)}function i(r,t,v){if(!r||!r.details)return null;var m=r.details.partList;if(m)for(var p=m.length;p--;){var _=m[p];if(_.index===v&&_.fragment.sn===t)return _}return null}},"./src/controller/stream-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return m});var H=O("./src/polyfills/number.ts"),I=O("./src/controller/base-stream-controller.ts"),C=O("./src/is-supported.ts"),j=O("./src/events.ts"),N=O("./src/utils/buffer-helper.ts"),e=O("./src/controller/fragment-tracker.ts"),w=O("./src/types/loader.ts"),g=O("./src/loader/fragment.ts"),f=O("./src/demux/transmuxer-interface.ts"),o=O("./src/types/transmuxer.ts"),n=O("./src/controller/gap-controller.ts"),a=O("./src/errors.ts"),l=O("./src/utils/logger.ts");function s(p,_){for(var b=0;b<_.length;b++){var u=_[b];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,u.key,u)}}function i(p,_,b){return _&&s(p.prototype,_),b&&s(p,b),p}function r(p,_){p.prototype=Object.create(_.prototype),p.prototype.constructor=p,t(p,_)}function t(p,_){return t=Object.setPrototypeOf||function(u,h){return u.__proto__=h,u},t(p,_)}var v=100,m=function(p){r(_,p);function _(u,h){var c;return c=p.call(this,u,h,"[stream-controller]")||this,c.audioCodecSwap=!1,c.gapController=null,c.level=-1,c._forceStartLoad=!1,c.altAudio=!1,c.audioOnly=!1,c.fragPlaying=null,c.onvplaying=null,c.onvseeked=null,c.fragLastKbps=0,c.stalled=!1,c.couldBacktrack=!1,c.audioCodecSwitch=!1,c.videoBuffer=null,c._registerListeners(),c}var b=_.prototype;return b._registerListeners=function(){var h=this.hls;h.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.on(j.Events.ERROR,this.onError,this),h.on(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b._unregisterListeners=function(){var h=this.hls;h.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(j.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.off(j.Events.ERROR,this.onError,this),h.off(j.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(j.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.off(j.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(j.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(j.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this)},b.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},b.startLoad=function(h){if(this.levels){var c=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(v),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var E=d.startLevel;E===-1&&(d.config.testBandwidth?(E=0,this.bitrateTest=!0):E=d.nextAutoLevel),this.level=d.nextLoadLevel=E,this.loadedmetadata=!1}c>0&&h===-1&&(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),h=c),this.state=I.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()}else this._forceStartLoad=!0,this.state=I.State.STOPPED},b.stopLoad=function(){this._forceStartLoad=!1,p.prototype.stopLoad.call(this)},b.doTick=function(){switch(this.state){case I.State.IDLE:this.doTickIdle();break;case I.State.WAITING_LEVEL:{var h,c=this.levels,d=this.level,E=c==null||((h=c[d])===null||h===void 0)?void 0:h.details;if(E&&(!E.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(E))break;this.state=I.State.IDLE;break}break}case I.State.FRAG_LOADING_WAITING_RETRY:{var y,T=self.performance.now(),D=this.retryDate;(!D||T>=D||(y=this.media)!==null&&y!==void 0&&y.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=I.State.IDLE)}break;default:break}this.onTickEnd()},b.onTickEnd=function(){p.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},b.doTickIdle=function(){var h,c,d=this.hls,E=this.levelLastLoaded,y=this.levels,T=this.media,D=d.config,L=d.nextLoadLevel;if(E===null||!T&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!y||!y[L])return;var x=y[L];this.level=d.nextLoadLevel=L;var k=x.details;if(!k||this.state===I.State.WAITING_LEVEL||k.live&&this.levelLastLoaded!==L){this.state=I.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:T,w.PlaylistLevelType.MAIN);if(U===null)return;var R=U.len,V=this.getMaxBufferLength(x.maxBitrate);if(R>=V)return;if(this._streamEnded(U,k)){var Z={};this.altAudio&&(Z.type="video"),this.hls.trigger(j.Events.BUFFER_EOS,Z),this.state=I.State.ENDED;return}var ue=U.end,le=this.getNextFragment(ue,k);if(this.couldBacktrack&&!this.fragPrevious&&le&&le.sn!=="initSegment"){var ge=le.sn-k.startSN;ge>1&&(le=k.fragments[ge-1],this.fragmentTracker.removeFragment(le))}if(le&&this.fragmentTracker.getState(le)===e.FragmentState.OK&&this.nextLoadPosition>ue){var pe=this.audioOnly&&!this.altAudio?g.ElementaryStreamTypes.AUDIO:g.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(T,pe,w.PlaylistLevelType.MAIN),le=this.getNextFragment(this.nextLoadPosition,k)}if(!le)return;le.initSegment&&!le.initSegment.data&&!this.bitrateTest&&(le=le.initSegment),((h=le.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((c=le.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(le,k):this.loadFragment(le,k,ue)},b.loadFragment=function(h,c,d){var E,y=this.fragmentTracker.getState(h);if(this.fragCurrent=h,y===e.FragmentState.BACKTRACKED){var T=this.fragmentTracker.getBacktrackData(h);if(T){this._handleFragmentLoadProgress(T),this._handleFragmentLoadComplete(T);return}else y=e.FragmentState.NOT_LOADED}y===e.FragmentState.NOT_LOADED||y===e.FragmentState.PARTIAL?h.sn==="initSegment"?this._loadInitSegment(h):this.bitrateTest?(h.bitrateTest=!0,this.log("Fragment "+h.sn+" of level "+h.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(h)):(this.startFragRequested=!0,p.prototype.loadFragment.call(this,h,c,d)):y===e.FragmentState.APPENDING?this.reduceMaxBufferLength(h.duration)&&this.fragmentTracker.removeFragment(h):((E=this.media)===null||E===void 0?void 0:E.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},b.getAppendedFrag=function(h){var c=this.fragmentTracker.getAppendedFrag(h,w.PlaylistLevelType.MAIN);return c&&"fragment"in c?c.fragment:c},b.getBufferedFrag=function(h){return this.fragmentTracker.getBufferedFrag(h,w.PlaylistLevelType.MAIN)},b.followingBufferedFrag=function(h){return h?this.getBufferedFrag(h.end+.5):null},b.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},b.nextLevelSwitch=function(){var h=this.levels,c=this.media;if(c!=null&&c.readyState){var d,E=this.getAppendedFrag(c.currentTime);if(E&&E.start>1&&this.flushMainBuffer(0,E.start-1),!c.paused&&h){var y=this.hls.nextLoadLevel,T=h[y],D=this.fragLastKbps;D&&this.fragCurrent?d=this.fragCurrent.duration*T.maxBitrate/(1e3*D)+1:d=0}else d=0;var L=this.getBufferedFrag(c.currentTime+d);if(L){var x=this.followingBufferedFrag(L);if(x){this.abortCurrentFrag();var k=x.maxStartPTS?x.maxStartPTS:x.start,U=x.duration,R=Math.max(L.end,k+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(R,Number.POSITIVE_INFINITY)}}}},b.abortCurrentFrag=function(){var h=this.fragCurrent;this.fragCurrent=null,h!=null&&h.loader&&h.loader.abort(),this.state===I.State.KEY_LOADING&&(this.state=I.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},b.flushMainBuffer=function(h,c){p.prototype.flushMainBuffer.call(this,h,c,this.altAudio?"video":null)},b.onMediaAttached=function(h,c){p.prototype.onMediaAttached.call(this,h,c);var d=c.media;this.onvplaying=this.onMediaPlaying.bind(this),this.onvseeked=this.onMediaSeeked.bind(this),d.addEventListener("playing",this.onvplaying),d.addEventListener("seeked",this.onvseeked),this.gapController=new n.default(this.config,d,this.fragmentTracker,this.hls)},b.onMediaDetaching=function(){var h=this.media;h&&(h.removeEventListener("playing",this.onvplaying),h.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),p.prototype.onMediaDetaching.call(this)},b.onMediaPlaying=function(){this.tick()},b.onMediaSeeked=function(){var h=this.media,c=h?h.currentTime:null;Object(H.isFiniteNumber)(c)&&this.log("Media seeked to "+c.toFixed(3)),this.tick()},b.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(j.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},b.onManifestParsed=function(h,c){var d=!1,E=!1,y;c.levels.forEach(function(T){y=T.audioCodec,y&&(y.indexOf("mp4a.40.2")!==-1&&(d=!0),y.indexOf("mp4a.40.5")!==-1&&(E=!0))}),this.audioCodecSwitch=d&&E&&!Object(C.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=c.levels,this.startFragRequested=!1},b.onLevelLoading=function(h,c){var d=this.levels;if(!d||this.state!==I.State.IDLE)return;var E=d[c.level];(!E.details||E.details.live&&this.levelLastLoaded!==c.level||this.waitForCdnTuneIn(E.details))&&(this.state=I.State.WAITING_LEVEL)},b.onLevelLoaded=function(h,c){var d,E=this.levels,y=c.level,T=c.details,D=T.totalduration;if(!E){this.warn("Levels were reset while loading level "+y);return}this.log("Level "+y+" loaded ["+T.startSN+","+T.endSN+"], cc ["+T.startCC+", "+T.endCC+"] duration:"+D);var L=this.fragCurrent;L&&(this.state===I.State.FRAG_LOADING||this.state===I.State.FRAG_LOADING_WAITING_RETRY)&&(L.level!==c.level&&L.loader&&(this.state=I.State.IDLE,L.loader.abort()));var x=E[y],k=0;if(T.live||(d=x.details)!==null&&d!==void 0&&d.live){if(T.fragments[0]||(T.deltaUpdateFailed=!0),T.deltaUpdateFailed)return;k=this.alignPlaylists(T,x.details)}if(x.details=T,this.levelLastLoaded=y,this.hls.trigger(j.Events.LEVEL_UPDATED,{details:T,level:y}),this.state===I.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(T))return;this.state=I.State.IDLE}this.startFragRequested?T.live&&this.synchronizeToLiveEdge(T):this.setStartPosition(T,k),this.tick()},b._handleFragmentLoadProgress=function(h){var c,d=h.frag,E=h.part,y=h.payload,T=this.levels;if(!T){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var D=T[d.level],L=D.details;if(!L){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var x=D.videoCodec,k=L.PTSKnown||!L.live,U=(c=d.initSegment)===null||c===void 0?void 0:c.data,R=this._getAudioCodec(D),V=this.transmuxer=this.transmuxer||new f.default(this.hls,w.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),Z=E?E.index:-1,ue=Z!==-1,le=new o.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,y.byteLength,Z,ue),ge=this.initPTS[d.cc];V.push(y,U,R,x,d,E,L.totalduration,k,le,ge)},b.onAudioTrackSwitching=function(h,c){var d=this.altAudio,E=!!c.url,y=c.id;if(!E){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var T=this.fragCurrent;T!=null&&T.loader&&(this.log("Switching to main audio track, cancel main fragment load"),T.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;d&&D.trigger(j.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(j.Events.AUDIO_TRACK_SWITCHED,{id:y})}},b.onAudioTrackSwitched=function(h,c){var d=c.id,E=!!this.hls.audioTracks[d].url;if(E){var y=this.videoBuffer;y&&this.mediaBuffer!==y&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=y)}this.altAudio=E,this.tick()},b.onBufferCreated=function(h,c){var d=c.tracks,E,y,T=!1;for(var D in d){var L=d[D];if(L.id==="main"){if(y=D,E=L,D==="video"){var x=d[D];x&&(this.videoBuffer=x.buffer)}}else T=!0}T&&E?(this.log("Alternate track found, use "+y+".buffered to schedule main fragment loading"),this.mediaBuffer=E.buffer):this.mediaBuffer=this.media},b.onFragBuffered=function(h,c){var d=c.frag,E=c.part;if(d&&d.type!==w.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(E?" p: "+E.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===I.State.PARSED&&(this.state=I.State.IDLE);return}var y=E?E.stats:d.stats;this.fragLastKbps=Math.round(8*y.total/(y.buffering.end-y.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,E)},b.onError=function(h,c){switch(c.details){case a.ErrorDetails.FRAG_LOAD_ERROR:case a.ErrorDetails.FRAG_LOAD_TIMEOUT:case a.ErrorDetails.KEY_LOAD_ERROR:case a.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(w.PlaylistLevelType.MAIN,c);break;case a.ErrorDetails.LEVEL_LOAD_ERROR:case a.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==I.State.ERROR&&(c.fatal?(this.warn(""+c.details),this.state=I.State.ERROR):!c.levelRetry&&this.state===I.State.WAITING_LEVEL&&(this.state=I.State.IDLE));break;case a.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="main"&&(this.state===I.State.PARSING||this.state===I.State.PARSED)){var d=!0,E=this.getFwdBufferInfo(this.media,w.PlaylistLevelType.MAIN);E&&E.len>.5&&(d=!this.reduceMaxBufferLength(E.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},b.checkBuffer=function(){var h=this.media,c=this.gapController;if(!h||!c||!h.readyState)return;var d=N.BufferHelper.getBuffered(h);!this.loadedmetadata&&d.length?(this.loadedmetadata=!0,this.seekToStartPos()):c.poll(this.lastCurrentTime),this.lastCurrentTime=h.currentTime},b.onFragLoadEmergencyAborted=function(){this.state=I.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},b.onBufferFlushed=function(h,c){var d=c.type;if(d!==g.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var E=(d===g.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(E,d,w.PlaylistLevelType.MAIN)}},b.onLevelsUpdated=function(h,c){this.levels=c.levels},b.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},b.seekToStartPos=function(){var h=this.media,c=h.currentTime,d=this.startPosition;if(d>=0&&c<d){if(h.seeking){l.logger.log("could not seek to "+d+", already seeking at "+c);return}var E=N.BufferHelper.getBuffered(h),y=E.length?E.start(0):0,T=y-d;T>0&&(T<this.config.maxBufferHole||T<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+T+" to match buffer start"),d+=T,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+c),h.currentTime=d}},b._getAudioCodec=function(h){var c=this.config.defaultAudioCodec||h.audioCodec;return this.audioCodecSwap&&c&&(this.log("Swapping audio codec"),c.indexOf("mp4a.40.5")!==-1?c="mp4a.40.2":c="mp4a.40.5"),c},b._loadBitrateTestFrag=function(h){var c=this;this._doFragLoad(h).then(function(d){var E=c.hls;if(!d||E.nextLoadLevel||c.fragContextChanged(h))return;c.fragLoadError=0,c.state=I.State.IDLE,c.startFragRequested=!1,c.bitrateTest=!1;var y=h.stats;y.parsing.start=y.parsing.end=y.buffering.start=y.buffering.end=self.performance.now(),E.trigger(j.Events.FRAG_LOADED,d)})},b._handleTransmuxComplete=function(h){var c,d="main",E=this.hls,y=h.remuxResult,T=h.chunkMeta,D=this.getCurrentContext(T);if(!D){this.warn("The loading context changed while buffering fragment "+T.sn+" of level "+T.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(T.level);return}var L=D.frag,x=D.part,k=D.level,U=y.video,R=y.text,V=y.id3,Z=y.initSegment,ue=this.altAudio?void 0:y.audio;if(this.fragContextChanged(L))return;if(this.state=I.State.PARSING,Z){Z.tracks&&(this._bufferInitSegment(k,Z.tracks,L,T),E.trigger(j.Events.FRAG_PARSING_INIT_SEGMENT,{frag:L,id:d,tracks:Z.tracks}));var le=Z.initPTS,ge=Z.timescale;Object(H.isFiniteNumber)(le)&&(this.initPTS[L.cc]=le,E.trigger(j.Events.INIT_PTS_FOUND,{frag:L,id:d,initPTS:le,timescale:ge}))}if(U&&y.independent!==!1){if(k.details){var pe=U.startPTS,ae=U.endPTS,ne=U.startDTS,fe=U.endDTS;if(x)x.elementaryStreams[U.type]={startPTS:pe,endPTS:ae,startDTS:ne,endDTS:fe};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var q=this.getLoadPosition()+this.config.maxBufferHole;if(q<pe){this.backtrack(L);return}L.setElementaryStreamInfo(U.type,L.start,ae,L.start,fe,!0)}L.setElementaryStreamInfo(U.type,pe,ae,ne,fe),this.bufferFragmentData(U,L,x,T)}}else if(y.independent===!1){this.backtrack(L);return}if(ue){var M=ue.startPTS,S=ue.endPTS,A=ue.startDTS,F=ue.endDTS;x&&(x.elementaryStreams[g.ElementaryStreamTypes.AUDIO]={startPTS:M,endPTS:S,startDTS:A,endDTS:F}),L.setElementaryStreamInfo(g.ElementaryStreamTypes.AUDIO,M,S,A,F),this.bufferFragmentData(ue,L,x,T)}if(V!=null&&(c=V.samples)!==null&&c!==void 0&&c.length){var K={frag:L,id:d,samples:V.samples};E.trigger(j.Events.FRAG_PARSING_METADATA,K)}if(R){var P={frag:L,id:d,samples:R.samples};E.trigger(j.Events.FRAG_PARSING_USERDATA,P)}},b._bufferInitSegment=function(h,c,d,E){var y=this;if(this.state!==I.State.PARSING)return;this.audioOnly=!!c.audio&&!c.video,this.altAudio&&!this.audioOnly&&delete c.audio;var T=c.audio,D=c.video,L=c.audiovideo;if(T){var x=h.audioCodec,k=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(x&&(x.indexOf("mp4a.40.5")!==-1?x="mp4a.40.2":x="mp4a.40.5"),T.metadata.channelCount!==1&&k.indexOf("firefox")===-1&&(x="mp4a.40.5")),k.indexOf("android")!==-1&&T.container!=="audio/mpeg"&&(x="mp4a.40.2",this.log("Android: force audio codec to "+x)),h.audioCodec&&h.audioCodec!==x&&this.log('Swapping manifest audio codec "'+h.audioCodec+'" for "'+x+'"'),T.levelCodec=x,T.id="main",this.log("Init audio buffer, container:"+T.container+", codecs[selected/level/parsed]=["+(x||"")+"/"+(h.audioCodec||"")+"/"+T.codec+"]")}D&&(D.levelCodec=h.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(h.videoCodec||"")+"/"+D.codec+"]")),L&&this.log("Init audiovideo buffer, container:"+L.container+", codecs[level/parsed]=["+(h.attrs.CODECS||"")+"/"+L.codec+"]"),this.hls.trigger(j.Events.BUFFER_CODECS,c),Object.keys(c).forEach(function(U){var R=c[U],V=R.initSegment;V!=null&&V.byteLength&&y.hls.trigger(j.Events.BUFFER_APPENDING,{type:U,data:V,frag:d,part:null,chunkMeta:E,parent:d.type})}),this.tick()},b.backtrack=function(h){this.couldBacktrack=!0,this.resetTransmuxer(),this.flushBufferGap(h);var c=this.fragmentTracker.backtrack(h);this.fragPrevious=null,this.nextLoadPosition=h.start,c?this.resetFragmentLoading(h):this.state=I.State.BACKTRACKING},b.checkFragmentChanged=function(){var h=this.media,c=null;if(h&&h.readyState>1&&h.seeking===!1){var d=h.currentTime;if(N.BufferHelper.isBuffered(h,d)?c=this.getAppendedFrag(d):N.BufferHelper.isBuffered(h,d+.1)&&(c=this.getAppendedFrag(d+.1)),c){var E=this.fragPlaying,y=c.level;(!E||c.sn!==E.sn||E.level!==y||c.urlId!==E.urlId)&&(this.hls.trigger(j.Events.FRAG_CHANGED,{frag:c}),(!E||E.level!==y)&&this.hls.trigger(j.Events.LEVEL_SWITCHED,{level:y}),this.fragPlaying=c)}}},i(_,[{key:"nextLevel",get:function(){var h=this.nextBufferedFrag;return h?h.level:-1}},{key:"currentLevel",get:function(){var h=this.media;if(h){var c=this.getAppendedFrag(h.currentTime);if(c)return c.level}return-1}},{key:"nextBufferedFrag",get:function(){var h=this.media;if(h){var c=this.getAppendedFrag(h.currentTime);return this.followingBufferedFrag(c)}else return null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),_}(I.default)},"./src/controller/subtitle-stream-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"SubtitleStreamController",function(){return r});var H=O("./src/events.ts"),I=O("./src/utils/logger.ts"),C=O("./src/utils/buffer-helper.ts"),j=O("./src/controller/fragment-finders.ts"),N=O("./src/utils/discontinuities.ts"),e=O("./src/controller/level-helper.ts"),w=O("./src/controller/fragment-tracker.ts"),g=O("./src/controller/base-stream-controller.ts"),f=O("./src/types/loader.ts"),o=O("./src/types/level.ts");function n(t,v){for(var m=0;m<v.length;m++){var p=v[m];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(t,p.key,p)}}function a(t,v,m){return v&&n(t.prototype,v),m&&n(t,m),t}function l(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,s(t,v)}function s(t,v){return s=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},s(t,v)}var i=500,r=function(t){l(v,t);function v(p,_){var b;return b=t.call(this,p,_,"[subtitle-stream-controller]")||this,b.levels=[],b.currentTrackId=-1,b.tracksBuffered=[],b.mainDetails=null,b._registerListeners(),b}var m=v.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var _=this.hls;_.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.on(H.Events.ERROR,this.onError,this),_.on(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.on(H.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.on(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.on(H.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.on(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var _=this.hls;_.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(H.Events.LEVEL_LOADED,this.onLevelLoaded,this),_.off(H.Events.ERROR,this.onError,this),_.off(H.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.off(H.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),_.off(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.off(H.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),_.off(H.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=g.State.IDLE,this.setInterval(i),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(_,b){this.mainDetails=b.details},m.onSubtitleFragProcessed=function(_,b){var u=b.frag,h=b.success;if(this.fragPrevious=u,this.state=g.State.IDLE,!h)return;var c=this.tracksBuffered[this.currentTrackId];if(!c)return;for(var d,E=u.start,y=0;y<c.length;y++)if(E>=c[y].start&&E<=c[y].end){d=c[y];break}var T=u.start+u.duration;d?d.end=T:(d={start:E,end:T},c.push(d)),this.fragmentTracker.fragBuffered(u)},m.onBufferFlushing=function(_,b){var u=b.startOffset,h=b.endOffset;if(u===0&&h!==Number.POSITIVE_INFINITY){var c=this.currentTrackId,d=this.levels;if(!d.length||!d[c]||!d[c].details)return;var E=d[c].details,y=E.targetduration,T=h-y;if(T<=0)return;b.endOffsetSubtitles=Math.max(0,T),this.tracksBuffered.forEach(function(D){for(var L=0;L<D.length;){if(D[L].end<=T){D.shift();continue}else if(D[L].start<T)D[L].start=T;else break;L++}}),this.fragmentTracker.removeFragmentsInRange(u,T,f.PlaylistLevelType.SUBTITLE)}},m.onError=function(_,b){var u,h=b.frag;if(!h||h.type!==f.PlaylistLevelType.SUBTITLE)return;(u=this.fragCurrent)!==null&&u!==void 0&&u.loader&&this.fragCurrent.loader.abort(),this.state=g.State.IDLE},m.onSubtitleTracksUpdated=function(_,b){var u=this,h=b.subtitleTracks;this.tracksBuffered=[],this.levels=h.map(function(c){return new o.Level(c)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(c){u.tracksBuffered[c.id]=[]}),this.mediaBuffer=null},m.onSubtitleTrackSwitch=function(_,b){if(this.currentTrackId=b.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var u=this.levels[this.currentTrackId];u!=null&&u.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,u&&this.setInterval(i)},m.onSubtitleTrackLoaded=function(_,b){var u,h=b.details,c=b.id,d=this.currentTrackId,E=this.levels;if(!E.length)return;var y=E[d];if(c>=E.length||c!==d||!y)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,h.live||(u=y.details)!==null&&u!==void 0&&u.live){var T=this.mainDetails;if(h.deltaUpdateFailed||!T)return;var D=T.fragments[0];if(!y.details)h.hasProgramDateTime&&T.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(h,T):D&&Object(e.addSliding)(h,D.start);else{var L=this.alignPlaylists(h,y.details);L===0&&D&&Object(e.addSliding)(h,D.start)}}if(y.details=h,this.levelLastLoaded=c,this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===g.State.IDLE){var x=Object(j.findFragmentByPTS)(null,h.fragments,this.media.currentTime,0);x||(this.warn("Subtitle playlist not aligned with playback"),y.details=void 0)}},m._handleFragmentLoadComplete=function(_){var b=_.frag,u=_.payload,h=b.decryptdata,c=this.hls;if(this.fragContextChanged(b))return;if(u&&u.byteLength>0&&h&&h.key&&h.iv&&h.method==="AES-128"){var d=performance.now();this.decrypter.webCryptoDecrypt(new Uint8Array(u),h.key.buffer,h.iv.buffer).then(function(E){var y=performance.now();c.trigger(H.Events.FRAG_DECRYPTED,{frag:b,payload:E,stats:{tstart:d,tdecrypt:y}})})}},m.doTick=function(){if(!this.media){this.state=g.State.IDLE;return}if(this.state===g.State.IDLE){var _,b=this.currentTrackId,u=this.levels;if(!u.length||!u[b]||!u[b].details)return;var h=u[b].details,c=h.targetduration,d=this.config,E=this.media,y=C.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,E.currentTime-c,d.maxBufferHole),T=y.end,D=y.len,L=this.getMaxBufferLength()+c;if(D>L)return;console.assert(h,"Subtitle track details are defined on idle subtitle stream controller tick");var x=h.fragments,k=x.length,U=h.edge,R,V=this.fragPrevious;if(T<U){var Z=d.maxFragLookUpTolerance;V&&h.hasProgramDateTime&&(R=Object(j.findFragmentByPDT)(x,V.endProgramDateTime,Z)),R||(R=Object(j.findFragmentByPTS)(V,x,T,Z),!R&&V&&V.start<x[0].start&&(R=x[0]))}else R=x[k-1];(_=R)!==null&&_!==void 0&&_.encrypted?(I.logger.log("Loading key for "+R.sn),this.state=g.State.KEY_LOADING,this.hls.trigger(H.Events.KEY_LOADING,{frag:R})):R&&this.fragmentTracker.getState(R)===w.FragmentState.NOT_LOADED&&this.loadFragment(R,h,T)}},m.loadFragment=function(_,b,u){this.fragCurrent=_,t.prototype.loadFragment.call(this,_,b,u)},a(v,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),v}(g.default)},"./src/controller/subtitle-track-controller.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/events.ts"),I=O("./src/utils/texttrack-utils.ts"),C=O("./src/controller/base-playlist-controller.ts"),j=O("./src/types/loader.ts");function N(n,a){for(var l=0;l<a.length;l++){var s=a[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(n,s.key,s)}}function e(n,a,l){return a&&N(n.prototype,a),l&&N(n,l),n}function w(n,a){n.prototype=Object.create(a.prototype),n.prototype.constructor=n,g(n,a)}function g(n,a){return g=Object.setPrototypeOf||function(s,i){return s.__proto__=i,s},g(n,a)}var f=function(n){w(a,n);function a(s){var i;return i=n.call(this,s,"[subtitle-track-controller]")||this,i.media=null,i.tracks=[],i.groupId=null,i.tracksInGroup=[],i.trackId=-1,i.selectDefaultTrack=!0,i.queuedDefaultTrack=-1,i.trackChangeListener=function(){return i.onTextTracksChanged()},i.asyncPollTrackChange=function(){return i.pollTrackChange(0)},i.useTextTrackPolling=!1,i.subtitlePollingInterval=-1,i.subtitleDisplay=!0,i.registerListeners(),i}var l=a.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,n.prototype.destroy.call(this)},l.registerListeners=function(){var i=this.hls;i.on(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.on(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.on(H.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.on(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.on(H.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var i=this.hls;i.off(H.Events.MEDIA_ATTACHED,this.onMediaAttached,this),i.off(H.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.off(H.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(H.Events.MANIFEST_PARSED,this.onManifestParsed,this),i.off(H.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(H.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),i.off(H.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),i.off(H.Events.ERROR,this.onError,this)},l.onMediaAttached=function(i,r){if(this.media=r.media,!this.media)return;this.queuedDefaultTrack>-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)},l.pollTrackChange=function(i){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,i)},l.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 i=o(this.media.textTracks);i.forEach(function(r){Object(I.clearCurrentCues)(r)}),this.subtitleTrack=-1,this.media=null},l.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},l.onManifestParsed=function(i,r){this.tracks=r.subtitleTracks},l.onSubtitleTrackLoaded=function(i,r){var t=r.id,v=r.details,m=this.trackId,p=this.tracksInGroup[m];if(!p){this.warn("Invalid subtitle track id "+t);return}var _=p.details;p.details=r.details,this.log("subtitle track "+t+" loaded ["+v.startSN+"-"+v.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,r,_))},l.onLevelLoading=function(i,r){this.switchLevel(r.level)},l.onLevelSwitching=function(i,r){this.switchLevel(r.level)},l.switchLevel=function(i){var r=this.hls.levels[i];if(!(r!=null&&r.textGroupIds))return;var t=r.textGroupIds[r.urlId];if(this.groupId!==t){var v=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(b){return!t||b.groupId===t});this.tracksInGroup=m;var p=this.findTrackId(v==null?void 0:v.name)||this.findTrackId();this.groupId=t;var _={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(H.Events.SUBTITLE_TRACKS_UPDATED,_),p!==-1&&this.setSubtitleTrack(p,v)}},l.findTrackId=function(i){for(var r=this.tracksInGroup,t=0;t<r.length;t++){var v=r[t];if((!this.selectDefaultTrack||v.default)&&(!i||i===v.name))return v.id}return-1},l.onError=function(i,r){if(n.prototype.onError.call(this,i,r),r.fatal||!r.context)return;r.context.type===j.PlaylistContextType.SUBTITLE_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},l.loadPlaylist=function(i){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var t=r.id,v=r.groupId,m=r.url;if(i)try{m=i.addDirectives(m)}catch(p){this.warn("Could not construct new URL with HLS Delivery Directives: "+p)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(H.Events.SUBTITLE_TRACK_LOADING,{url:m,id:t,groupId:v,deliveryDirectives:i||null})}},l.toggleTrackModes=function(i){var r=this,t=this.media,v=this.subtitleDisplay,m=this.trackId;if(!t)return;var p=o(t.textTracks),_=p.filter(function(h){return h.groupId===r.groupId});if(i===-1)[].slice.call(p).forEach(function(h){h.mode="disabled"});else{var b=_[m];b&&(b.mode="disabled")}var u=_[i];u&&(u.mode=v?"showing":"hidden")},l.setSubtitleTrack=function(i,r){var t,v=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=i;return}if(this.trackId!==i&&this.toggleTrackModes(i),this.trackId===i&&(i===-1||(t=v[i])!==null&&t!==void 0&&t.details)||i<-1||i>=v.length)return;this.clearTimer();var m=v[i];if(this.log("Switching to subtitle track "+i),this.trackId=i,m){var p=m.id,_=m.groupId,b=_===void 0?"":_,u=m.name,h=m.type,c=m.url;this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:p,groupId:b,name:u,type:h,url:c});var d=this.switchParams(m.url,r==null?void 0:r.details);this.loadPlaylist(d)}else this.hls.trigger(H.Events.SUBTITLE_TRACK_SWITCH,{id:i})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var i=-1,r=o(this.media.textTracks),t=0;t<r.length;t++)if(r[t].mode==="hidden")i=t;else if(r[t].mode==="showing"){i=t;break}this.subtitleTrack!==i&&(this.subtitleTrack=i)},e(a,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(i){this.selectDefaultTrack=!1;var r=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(i,r)}}]),a}(C.default);function o(n){for(var a=[],l=0;l<n.length;l++){var s=n[l];s.kind==="subtitles"&&s.label&&a.push(n[l])}return a}B.default=f},"./src/controller/timeline-controller.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"TimelineController",function(){return o});var H=O("./src/polyfills/number.ts"),I=O("./src/events.ts"),C=O("./src/utils/cea-608-parser.ts"),j=O("./src/utils/output-filter.ts"),N=O("./src/utils/webvtt-parser.ts"),e=O("./src/utils/texttrack-utils.ts"),w=O("./src/utils/imsc1-ttml-parser.ts"),g=O("./src/types/loader.ts"),f=O("./src/utils/logger.ts"),o=function(){function s(r){if(this.hls=void 0,this.media=null,this.config=void 0,this.enabled=!0,this.Cues=void 0,this.textTracks=[],this.tracks=[],this.initPTS=[],this.timescale=[],this.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this.captionsProperties=void 0,this.hls=r,this.config=r.config,this.Cues=r.config.cueHandler,this.captionsProperties={textTrack1:{label:this.config.captionsTextTrack1Label,languageCode:this.config.captionsTextTrack1LanguageCode},textTrack2:{label:this.config.captionsTextTrack2Label,languageCode:this.config.captionsTextTrack2LanguageCode},textTrack3:{label:this.config.captionsTextTrack3Label,languageCode:this.config.captionsTextTrack3LanguageCode},textTrack4:{label:this.config.captionsTextTrack4Label,languageCode:this.config.captionsTextTrack4LanguageCode}},this.config.enableCEA708Captions){var t=new j.default(this,"textTrack1"),v=new j.default(this,"textTrack2"),m=new j.default(this,"textTrack3"),p=new j.default(this,"textTrack4");this.cea608Parser1=new C.default(1,t,v),this.cea608Parser2=new C.default(3,m,p)}r.on(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),r.on(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),r.on(I.Events.FRAG_LOADING,this.onFragLoading,this),r.on(I.Events.FRAG_LOADED,this.onFragLoaded,this),r.on(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),r.on(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),r.on(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),r.on(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),r.on(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var i=s.prototype;return i.destroy=function(){var t=this.hls;t.off(I.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(I.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(I.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(I.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(I.Events.FRAG_LOADING,this.onFragLoading,this),t.off(I.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(I.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(I.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(I.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(I.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(I.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},i.addCues=function(t,v,m,p,_){for(var b=!1,u=_.length;u--;){var h=_[u],c=a(h[0],h[1],v,m);if(c>=0&&(h[0]=Math.min(h[0],v),h[1]=Math.max(h[1],m),b=!0,c/(m-v)>.5))return}if(b||_.push([v,m]),this.config.renderTextTracksNatively){var d=this.captionsTracks[t];this.Cues.newCue(d,v,m,p)}else{var E=this.Cues.newCue(null,v,m,p);this.hls.trigger(I.Events.CUES_PARSED,{type:"captions",cues:E,track:t})}},i.onInitPtsFound=function(t,v){var m=this,p=v.frag,_=v.id,b=v.initPTS,u=v.timescale,h=this.unparsedVttFrags;_==="main"&&(this.initPTS[p.cc]=b,this.timescale[p.cc]=u),h.length&&(this.unparsedVttFrags=[],h.forEach(function(c){m.onFragLoaded(I.Events.FRAG_LOADED,c)}))},i.getExistingTrack=function(t){var v=this.media;if(v)for(var m=0;m<v.textTracks.length;m++){var p=v.textTracks[m];if(p[t])return p}return null},i.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},i.createNativeTrack=function(t){if(this.captionsTracks[t])return;var v=this.captionsProperties,m=this.captionsTracks,p=this.media,_=v[t],b=_.label,u=_.languageCode,h=this.getExistingTrack(t);if(h)m[t]=h,Object(e.clearCurrentCues)(m[t]),Object(e.sendAddTrackEvent)(m[t],p);else{var c=this.createTextTrack("captions",b,u);c&&(c[t]=!0,m[t]=c)}},i.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var v=this.captionsProperties[t];if(!v)return;var m=v.label,p={_id:t,label:m,kind:"captions",default:v.media?!!v.media.default:!1,closedCaptions:v.media};this.nonNativeCaptionsTracks[t]=p,this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[p]})},i.createTextTrack=function(t,v,m){var p=this.media;return p?p.addTextTrack(t,v,m):void 0},i.onMediaAttaching=function(t,v){this.media=v.media,this._cleanTracks()},i.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(v){Object(e.clearCurrentCues)(t[v]),delete t[v]}),this.nonNativeCaptionsTracks={}},i.onManifestLoading=function(){this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=l(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=this.unparsedVttFrags||[],this.initPTS=[],this.timescale=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())},i._cleanTracks=function(){var t=this.media;if(!t)return;var v=t.textTracks;if(v)for(var m=0;m<v.length;m++)Object(e.clearCurrentCues)(v[m])},i.onSubtitleTracksUpdated=function(t,v){var m=this;this.textTracks=[];var p=v.subtitleTracks||[],_=p.some(function(c){return c.textCodec===w.IMSC1_CODEC});if(this.config.enableWebVTT||_&&this.config.enableIMSC1){var b=this.tracks&&p&&this.tracks.length===p.length;if(this.tracks=p||[],this.config.renderTextTracksNatively){var u=this.media?this.media.textTracks:[];this.tracks.forEach(function(c,d){var E;if(d<u.length){for(var y=null,T=0;T<u.length;T++)if(n(u[T],c)){y=u[T];break}y&&(E=y)}E?Object(e.clearCurrentCues)(E):(E=m.createTextTrack("subtitles",c.name,c.lang),E&&(E.mode="disabled")),E&&(E.groupId=c.groupId,m.textTracks.push(E))})}else if(!b&&this.tracks&&this.tracks.length){var h=this.tracks.map(function(c){return{label:c.name,kind:c.type.toLowerCase(),default:c.default,subtitleTrack:c}});this.hls.trigger(I.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:h})}}},i.onManifestLoaded=function(t,v){var m=this;this.config.enableCEA708Captions&&v.captions&&v.captions.forEach(function(p){var _=/(?:CC|SERVICE)([1-4])/.exec(p.instreamId);if(!_)return;var b="textTrack"+_[1],u=m.captionsProperties[b];if(!u)return;u.label=p.name,p.lang&&(u.languageCode=p.lang),u.media=p})},i.onFragLoading=function(t,v){var m=this.cea608Parser1,p=this.cea608Parser2,_=this.lastSn,b=this.lastPartIndex;if(!this.enabled||!(m&&p))return;if(v.frag.type===g.PlaylistLevelType.MAIN){var u,h,c=v.frag.sn,d=(u=v==null||((h=v.part)===null||h===void 0)?void 0:h.index)!=null?u:-1;c===_+1||c===_&&d===b+1||(m.reset(),p.reset()),this.lastSn=c,this.lastPartIndex=d}},i.onFragLoaded=function(t,v){var m=v.frag,p=v.payload,_=this.initPTS,b=this.unparsedVttFrags;if(m.type===g.PlaylistLevelType.SUBTITLE)if(p.byteLength){if(!Object(H.isFiniteNumber)(_[m.cc])){b.push(v),_.length&&this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Missing initial subtitle PTS")});return}var u=m.decryptdata;if(u==null||u.key==null||u.method!=="AES-128"){var h=this.tracks[m.level],c=this.vttCCs;c[m.cc]||(c[m.cc]={start:m.start,prevCC:this.prevCC,new:!0},this.prevCC=m.cc),h&&h.textCodec===w.IMSC1_CODEC?this._parseIMSC1(m,p):this._parseVTTs(m,p,c)}}else this.hls.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},i._parseIMSC1=function(t,v){var m=this,p=this.hls;Object(w.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(_){m._appendCues(_,t.level),p.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){f.logger.log("Failed to parse IMSC1: "+_),p.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},i._parseVTTs=function(t,v,m){var p=this,_=this.hls;Object(N.parseWebVTT)(v,this.initPTS[t.cc],this.timescale[t.cc],m,t.cc,t.start,function(b){p._appendCues(b,t.level),_.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(b){p._fallbackToIMSC1(t,v),f.logger.log("Failed to parse VTT cue: "+b),_.trigger(I.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:b})})},i._fallbackToIMSC1=function(t,v){var m=this,p=this.tracks[t.level];p.textCodec||Object(w.parseIMSC1)(v,this.initPTS[t.cc],this.timescale[t.cc],function(){p.textCodec=w.IMSC1_CODEC,m._parseIMSC1(t,v)},function(){p.textCodec="wvtt"})},i._appendCues=function(t,v){var m=this.hls;if(this.config.renderTextTracksNatively){var p=this.textTracks[v];if(p.mode==="disabled")return;t.forEach(function(u){return Object(e.addCueToTrack)(p,u)})}else{var _=this.tracks[v],b=_.default?"default":"subtitles"+v;m.trigger(I.Events.CUES_PARSED,{type:"subtitles",cues:t,track:b})}},i.onFragDecrypted=function(t,v){var m=v.frag;if(m.type===g.PlaylistLevelType.SUBTITLE){if(!Object(H.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(v);return}this.onFragLoaded(I.Events.FRAG_LOADED,v)}},i.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},i.onFragParsingUserdata=function(t,v){var m=this.cea608Parser1,p=this.cea608Parser2;if(!this.enabled||!(m&&p))return;for(var _=0;_<v.samples.length;_++){var b=v.samples[_].bytes;if(b){var u=this.extractCea608Data(b);m.addData(v.samples[_].pts,u[0]),p.addData(v.samples[_].pts,u[1])}}},i.onBufferFlushing=function(t,v){var m=v.startOffset,p=v.endOffset,_=v.endOffsetSubtitles,b=v.type,u=this.media;if(!u||u.currentTime<p)return;if(!b||b==="video"){var h=this.captionsTracks;Object.keys(h).forEach(function(d){return Object(e.removeCuesInRange)(h[d],m,p)})}if(this.config.renderTextTracksNatively&&(m===0&&_!==void 0)){var c=this.textTracks;Object.keys(c).forEach(function(d){return Object(e.removeCuesInRange)(c[d],m,_)})}},i.extractCea608Data=function(t){for(var v=t[0]&31,m=2,p=[[],[]],_=0;_<v;_++){var b=t[m++],u=127&t[m++],h=127&t[m++],c=(4&b)!==0,d=3&b;if(u===0&&h===0)continue;c&&((d===0||d===1)&&(p[d].push(u),p[d].push(h)))}return p},s}();function n(s,i){return s&&s.label===i.name&&!(s.textTrack1||s.textTrack2)}function a(s,i,r,t){return Math.min(i,t)-Math.max(s,r)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return H});var H=function(){function I(j,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=j,this.aesIV=N}var C=I.prototype;return C.decrypt=function(N,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,N)},I}()},"./src/crypt/aes-decryptor.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"removePadding",function(){return I}),O.d(B,"default",function(){return C});var H=O("./src/utils/typed-array.ts");function I(j){var N=j.byteLength,e=N&&new DataView(j.buffer).getUint8(N-1);return e?Object(H.sliceUint8)(j,0,N-e):j}var C=function(){function j(){this.rcon=[0,1,2,4,8,16,32,64,128,27,54],this.subMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.invSubMix=[new Uint32Array(256),new Uint32Array(256),new Uint32Array(256),new Uint32Array(256)],this.sBox=new Uint32Array(256),this.invSBox=new Uint32Array(256),this.key=new Uint32Array(0),this.ksRows=0,this.keySize=0,this.keySchedule=void 0,this.invKeySchedule=void 0,this.initTable()}var N=j.prototype;return N.uint8ArrayToUint32Array_=function(w){for(var g=new DataView(w),f=new Uint32Array(4),o=0;o<4;o++)f[o]=g.getUint32(o*4);return f},N.initTable=function(){var w=this.sBox,g=this.invSBox,f=this.subMix,o=f[0],n=f[1],a=f[2],l=f[3],s=this.invSubMix,i=s[0],r=s[1],t=s[2],v=s[3],m=new Uint32Array(256),p=0,_=0,b=0;for(b=0;b<256;b++)b<128?m[b]=b<<1:m[b]=b<<1^283;for(b=0;b<256;b++){var u=_^_<<1^_<<2^_<<3^_<<4;u=u>>>8^u&255^99,w[p]=u,g[u]=p;var h=m[p],c=m[h],d=m[c],E=m[u]*257^u*16843008;o[p]=E<<24|E>>>8,n[p]=E<<16|E>>>16,a[p]=E<<8|E>>>24,l[p]=E,E=d*16843009^c*65537^h*257^p*16843008,i[u]=E<<24|E>>>8,r[u]=E<<16|E>>>16,t[u]=E<<8|E>>>24,v[u]=E,p?(p=h^m[m[m[d^h]]],_^=m[m[_]]):p=_=1}},N.expandKey=function(w){for(var g=this.uint8ArrayToUint32Array_(w),f=!0,o=0;o<g.length&&f;)f=g[o]===this.key[o],o++;if(f)return;this.key=g;var n=this.keySize=g.length;if(n!==4&&n!==6&&n!==8)throw new Error("Invalid aes key size="+n);var a=this.ksRows=(n+6+1)*4,l,s,i=this.keySchedule=new Uint32Array(a),r=this.invKeySchedule=new Uint32Array(a),t=this.sBox,v=this.rcon,m=this.invSubMix,p=m[0],_=m[1],b=m[2],u=m[3],h,c;for(l=0;l<a;l++){if(l<n){h=i[l]=g[l];continue}c=h,l%n===0?(c=c<<8|c>>>24,c=t[c>>>24]<<24|t[c>>>16&255]<<16|t[c>>>8&255]<<8|t[c&255],c^=v[l/n|0]<<24):n>6&&l%n===4&&(c=t[c>>>24]<<24|t[c>>>16&255]<<16|t[c>>>8&255]<<8|t[c&255]),i[l]=h=(i[l-n]^c)>>>0}for(s=0;s<a;s++)l=a-s,s&3?c=i[l]:c=i[l-4],s<4||l<=4?r[s]=c:r[s]=p[t[c>>>24]]^_[t[c>>>16&255]]^b[t[c>>>8&255]]^u[t[c&255]],r[s]=r[s]>>>0},N.networkToHostOrderSwap=function(w){return w<<24|(w&65280)<<8|(w&16711680)>>8|w>>>24},N.decrypt=function(w,g,f){for(var o=this.keySize+6,n=this.invKeySchedule,a=this.invSBox,l=this.invSubMix,s=l[0],i=l[1],r=l[2],t=l[3],v=this.uint8ArrayToUint32Array_(f),m=v[0],p=v[1],_=v[2],b=v[3],u=new Int32Array(w),h=new Int32Array(u.length),c,d,E,y,T,D,L,x,k,U,R,V,Z,ue,le=this.networkToHostOrderSwap;g<u.length;){for(k=le(u[g]),U=le(u[g+1]),R=le(u[g+2]),V=le(u[g+3]),T=k^n[0],D=V^n[1],L=R^n[2],x=U^n[3],Z=4,ue=1;ue<o;ue++)c=s[T>>>24]^i[D>>16&255]^r[L>>8&255]^t[x&255]^n[Z],d=s[D>>>24]^i[L>>16&255]^r[x>>8&255]^t[T&255]^n[Z+1],E=s[L>>>24]^i[x>>16&255]^r[T>>8&255]^t[D&255]^n[Z+2],y=s[x>>>24]^i[T>>16&255]^r[D>>8&255]^t[L&255]^n[Z+3],T=c,D=d,L=E,x=y,Z=Z+4;c=a[T>>>24]<<24^a[D>>16&255]<<16^a[L>>8&255]<<8^a[x&255]^n[Z],d=a[D>>>24]<<24^a[L>>16&255]<<16^a[x>>8&255]<<8^a[T&255]^n[Z+1],E=a[L>>>24]<<24^a[x>>16&255]<<16^a[T>>8&255]<<8^a[D&255]^n[Z+2],y=a[x>>>24]<<24^a[T>>16&255]<<16^a[D>>8&255]<<8^a[L&255]^n[Z+3],h[g]=le(c^m),h[g+1]=le(y^p),h[g+2]=le(E^_),h[g+3]=le(d^b),m=k,p=U,_=R,b=V,g=g+4}return h.buffer},j}()},"./src/crypt/decrypter.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return g});var H=O("./src/crypt/aes-crypto.ts"),I=O("./src/crypt/fast-aes-key.ts"),C=O("./src/crypt/aes-decryptor.ts"),j=O("./src/utils/logger.ts"),N=O("./src/utils/mp4-tools.ts"),e=O("./src/utils/typed-array.ts"),w=16,g=function(){function f(n,a,l){var s=l===void 0?{}:l,i=s.removePKCS7Padding,r=i===void 0?!0:i;if(this.logEnabled=!0,this.observer=void 0,this.config=void 0,this.removePKCS7Padding=void 0,this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null,this.observer=n,this.config=a,this.removePKCS7Padding=r,r)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(v){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var o=f.prototype;return o.destroy=function(){this.observer=null},o.isSync=function(){return this.config.enableSoftwareAES},o.flush=function(){var a=this.currentResult;if(!a){this.reset();return}var l=new Uint8Array(a);return this.reset(),this.removePKCS7Padding?Object(C.removePadding)(l):l},o.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},o.decrypt=function(a,l,s,i){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(a),l,s);var r=this.flush();r&&i(r.buffer)}else this.webCryptoDecrypt(new Uint8Array(a),l,s).then(i)},o.softwareDecrypt=function(a,l,s){var i=this.currentIV,r=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(a=Object(N.appendUint8Array)(t,a),this.remainderData=null);var v=this.getValidChunk(a);if(!v.length)return null;i&&(s=i);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new C.default),m.expandKey(l);var p=r;return this.currentResult=m.decrypt(v.buffer,0,s),this.currentIV=Object(e.sliceUint8)(v,-16).buffer,p||null},o.webCryptoDecrypt=function(a,l,s){var i=this,r=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new I.default(r,l)),this.fastAesKey.expandKey().then(function(t){if(!r)return Promise.reject(new Error("web crypto not initialized"));var v=new H.default(r,s);return v.decrypt(a.buffer,t)}).catch(function(t){return i.onWebCryptoError(t,a,l,s)})},o.onWebCryptoError=function(a,l,s,i){return j.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",a),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,s,i)},o.getValidChunk=function(a){var l=a,s=a.length-a.length%w;return s!==a.length&&(l=Object(e.sliceUint8)(a,0,s),this.remainderData=Object(e.sliceUint8)(a,s)),l},o.logOnce=function(a){if(!this.logEnabled)return;j.logger.log("[decrypter.ts]: "+a),this.logEnabled=!1},f}()},"./src/crypt/fast-aes-key.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return H});var H=function(){function I(j,N){this.subtle=void 0,this.key=void 0,this.subtle=j,this.key=N}var C=I.prototype;return C.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},I}()},"./src/demux/aacdemuxer.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/demux/base-audio-demuxer.ts"),I=O("./src/demux/adts.ts"),C=O("./src/utils/logger.ts"),j=O("./src/demux/id3.ts");function N(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,e(g,f)}function e(g,f){return e=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},e(g,f)}var w=function(g){N(f,g);function f(n,a){var l;return l=g.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=n,l.config=a,l}var o=f.prototype;return o.resetInitSegment=function(a,l,s){g.prototype.resetInitSegment.call(this,a,l,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:a,duration:s,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var l=j.getID3Data(a,0)||[],s=l.length,i=a.length;s<i;s++)if(I.probe(a,s))return C.logger.log("ADTS sync word found !"),!0;return!1},o.canParse=function(a,l){return I.canParse(a,l)},o.appendFrame=function(a,l,s){I.initTrackConfig(a,this.observer,l,s,a.manifestCodec);var i=I.appendFrame(a,l,s,this.initPTS,this.frameIndex);if(i&&i.missing===0)return i},f}(H.default);w.minProbeByteLength=9,B.default=w},"./src/demux/adts.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"getAudioConfig",function(){return j}),O.d(B,"isHeaderPattern",function(){return N}),O.d(B,"getHeaderLength",function(){return e}),O.d(B,"getFullFrameLength",function(){return w}),O.d(B,"canGetFrameLength",function(){return g}),O.d(B,"isHeader",function(){return f}),O.d(B,"canParse",function(){return o}),O.d(B,"probe",function(){return n}),O.d(B,"initTrackConfig",function(){return a}),O.d(B,"getFrameDuration",function(){return l}),O.d(B,"parseFrameHeader",function(){return s}),O.d(B,"appendFrame",function(){return i});var H=O("./src/utils/logger.ts"),I=O("./src/errors.ts"),C=O("./src/events.ts");function j(r,t,v,m){var p,_,b,u,h=navigator.userAgent.toLowerCase(),c=m,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];p=((t[v+2]&192)>>>6)+1;var E=(t[v+2]&60)>>>2;if(E>d.length-1){r.trigger(C.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+E});return}return b=(t[v+2]&1)<<2,b|=(t[v+3]&192)>>>6,H.logger.log("manifest codec:"+m+", ADTS type:"+p+", samplingIndex:"+E),/firefox/i.test(h)?E>=6?(p=5,u=new Array(4),_=E-3):(p=2,u=new Array(2),_=E):h.indexOf("android")!==-1?(p=2,u=new Array(2),_=E):(p=5,u=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&E>=6?_=E-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(E>=6&&b===1||/vivaldi/i.test(h))||!m&&b===1)&&(p=2,u=new Array(2)),_=E)),u[0]=p<<3,u[0]|=(E&14)>>1,u[1]|=(E&1)<<7,u[1]|=b<<3,p===5&&(u[1]|=(_&14)>>1,u[2]=(_&1)<<7,u[2]|=2<<2,u[3]=0),{config:u,samplerate:d[E],channelCount:b,codec:"mp4a.40."+p,manifestCodec:c}}function N(r,t){return r[t]===255&&(r[t+1]&246)===240}function e(r,t){return r[t+1]&1?7:9}function w(r,t){return(r[t+3]&3)<<11|r[t+4]<<3|(r[t+5]&224)>>>5}function g(r,t){return t+5<r.length}function f(r,t){return t+1<r.length&&N(r,t)}function o(r,t){return g(r,t)&&N(r,t)&&w(r,t)<=r.length-t}function n(r,t){if(f(r,t)){var v=e(r,t);if(t+v>=r.length)return!1;var m=w(r,t);if(m<=v)return!1;var p=t+m;return p===r.length||f(r,p)}return!1}function a(r,t,v,m,p){if(!r.samplerate){var _=j(t,v,m,p);if(!_)return;r.config=_.config,r.samplerate=_.samplerate,r.channelCount=_.channelCount,r.codec=_.codec,r.manifestCodec=_.manifestCodec,H.logger.log("parsed codec:"+r.codec+", rate:"+_.samplerate+", channels:"+_.channelCount)}}function l(r){return 1024*9e4/r}function s(r,t,v,m,p){var _=e(r,t),b=w(r,t);if(b-=_,b>0){var u=v+m*p;return{headerLength:_,frameLength:b,stamp:u}}}function i(r,t,v,m,p){var _=l(r.samplerate),b=s(t,v,m,p,_);if(b){var u=b.frameLength,h=b.headerLength,c=b.stamp,d=h+u,E=Math.max(0,v+d-t.length),y;E?(y=new Uint8Array(d-h),y.set(t.subarray(v+h,t.length),0)):y=t.subarray(v+h,v+d);var T={unit:y,pts:c};return E||r.samples.push(T),{sample:T,length:d,missing:E}}}},"./src/demux/base-audio-demuxer.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"initPTSFn",function(){return w});var H=O("./src/polyfills/number.ts"),I=O("./src/demux/id3.ts"),C=O("./src/demux/dummy-demuxed-track.ts"),j=O("./src/utils/mp4-tools.ts"),N=O("./src/utils/typed-array.ts"),e=function(){function g(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var f=g.prototype;return f.resetInitSegment=function(n,a,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},f.resetTimeStamp=function(){},f.resetContiguity=function(){},f.canParse=function(n,a){return!1},f.appendFrame=function(n,a,l){},f.demux=function(n,a){this.cachedData&&(n=Object(j.appendUint8Array)(this.cachedData,n),this.cachedData=null);var l=I.getID3Data(n,0),s=l?l.length:0,i,r,t=this._audioTrack,v=this._id3Track,m=l?I.getTimeStamp(l):void 0,p=n.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=w(m,a)),l&&l.length>0&&v.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),r=this.initPTS;s<p;){if(this.canParse(n,s)){var _=this.appendFrame(t,n,s);_?(this.frameIndex++,r=_.sample.pts,s+=_.length,i=s):s=p}else I.canParse(n,s)?(l=I.getID3Data(n,s),v.samples.push({pts:r,dts:r,data:l}),s+=l.length,i=s):s++;if(s===p&&i!==p){var b=Object(N.sliceUint8)(n,i);this.cachedData?this.cachedData=Object(j.appendUint8Array)(this.cachedData,b):this.cachedData=b}}return{audioTrack:t,avcTrack:Object(C.dummyTrack)(),id3Track:v,textTrack:Object(C.dummyTrack)()}},f.demuxSampleAes=function(n,a,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},f.flush=function(n){var a=this.cachedData;return a&&(this.cachedData=null,this.demux(a,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(C.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(C.dummyTrack)()}},f.destroy=function(){},g}(),w=function(f,o){return Object(H.isFiniteNumber)(f)?f*90:o*9e4};B.default=e},"./src/demux/chunk-cache.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return H});var H=function(){function C(){this.chunks=[],this.dataLength=0}var j=C.prototype;return j.push=function(e){this.chunks.push(e),this.dataLength+=e.length},j.flush=function(){var e=this.chunks,w=this.dataLength,g;if(e.length)e.length===1?g=e[0]:g=I(e,w);else return new Uint8Array(0);return this.reset(),g},j.reset=function(){this.chunks.length=0,this.dataLength=0},C}();function I(C,j){for(var N=new Uint8Array(j),e=0,w=0;w<C.length;w++){var g=C[w];N.set(g,e),e+=g.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"dummyTrack",function(){return H});function H(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/utils/logger.ts"),I=function(){function C(N){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=N,this.bytesAvailable=N.byteLength,this.word=0,this.bitsAvailable=0}var j=C.prototype;return j.loadWord=function(){var e=this.data,w=this.bytesAvailable,g=e.byteLength-w,f=new Uint8Array(4),o=Math.min(4,w);if(o===0)throw new Error("no bytes available");f.set(e.subarray(g,g+o)),this.word=new DataView(f.buffer).getUint32(0),this.bitsAvailable=o*8,this.bytesAvailable-=o},j.skipBits=function(e){var w;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,w=e>>3,e-=w>>3,this.bytesAvailable-=w,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},j.readBits=function(e){var w=Math.min(this.bitsAvailable,e),g=this.word>>>32-w;return e>32&&H.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=w,this.bitsAvailable>0?this.word<<=w:this.bytesAvailable>0&&this.loadWord(),w=e-w,w>0&&this.bitsAvailable?g<<w|this.readBits(w):g},j.skipLZ=function(){var e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()},j.skipUEG=function(){this.skipBits(1+this.skipLZ())},j.skipEG=function(){this.skipBits(1+this.skipLZ())},j.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},j.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},j.readBoolean=function(){return this.readBits(1)===1},j.readUByte=function(){return this.readBits(8)},j.readUShort=function(){return this.readBits(16)},j.readUInt=function(){return this.readBits(32)},j.skipScalingList=function(e){for(var w=8,g=8,f,o=0;o<e;o++)g!==0&&(f=this.readEG(),g=(w+f+256)%256),w=g===0?w:g},j.readSPS=function(){var e=0,w=0,g=0,f=0,o,n,a,l=this.readUByte.bind(this),s=this.readBits.bind(this),i=this.readUEG.bind(this),r=this.readBoolean.bind(this),t=this.skipBits.bind(this),v=this.skipEG.bind(this),m=this.skipUEG.bind(this),p=this.skipScalingList.bind(this);l();var _=l();if(s(5),t(3),l(),m(),_===100||_===110||_===122||_===244||_===44||_===83||_===86||_===118||_===128){var b=i();if(b===3&&t(1),m(),m(),t(1),r())for(n=b!==3?8:12,a=0;a<n;a++)r()&&(a<6?p(16):p(64))}m();var u=i();if(u===0)i();else if(u===1)for(t(1),v(),v(),o=i(),a=0;a<o;a++)v();m(),t(1);var h=i(),c=i(),d=s(1);d===0&&t(1),t(1),r()&&(e=i(),w=i(),g=i(),f=i());var E=[1,1];if(r()&&r()){var y=l();switch(y){case 1:E=[1,1];break;case 2:E=[12,11];break;case 3:E=[10,11];break;case 4:E=[16,11];break;case 5:E=[40,33];break;case 6:E=[24,11];break;case 7:E=[20,11];break;case 8:E=[32,11];break;case 9:E=[80,33];break;case 10:E=[18,11];break;case 11:E=[15,11];break;case 12:E=[64,33];break;case 13:E=[160,99];break;case 14:E=[4,3];break;case 15:E=[3,2];break;case 16:E=[2,1];break;case 255:{E=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((h+1)*16-e*2-w*2),height:(2-d)*(c+1)*16-(d?2:4)*(g+f),pixelRatio:E}},j.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},C}();B.default=I},"./src/demux/id3.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"isHeader",function(){return H}),O.d(B,"isFooter",function(){return I}),O.d(B,"getID3Data",function(){return C}),O.d(B,"canParse",function(){return N}),O.d(B,"getTimeStamp",function(){return e}),O.d(B,"isTimeStampFrame",function(){return w}),O.d(B,"getID3Frames",function(){return f}),O.d(B,"decodeFrame",function(){return o}),O.d(B,"utf8ArrayToStr",function(){return i}),O.d(B,"testables",function(){return r});var H=function(p,_){return _+10<=p.length&&(p[_]===73&&p[_+1]===68&&p[_+2]===51&&(p[_+3]<255&&p[_+4]<255&&(p[_+6]<128&&p[_+7]<128&&p[_+8]<128&&p[_+9]<128)))},I=function(p,_){return _+10<=p.length&&(p[_]===51&&p[_+1]===68&&p[_+2]===73&&(p[_+3]<255&&p[_+4]<255&&(p[_+6]<128&&p[_+7]<128&&p[_+8]<128&&p[_+9]<128)))},C=function(p,_){for(var b=_,u=0;H(p,_);){u+=10;var h=j(p,_+6);u+=h,I(p,_+10)&&(u+=10),_+=u}return u>0?p.subarray(b,b+u):void 0},j=function(p,_){var b=0;return b=(p[_]&127)<<21,b|=(p[_+1]&127)<<14,b|=(p[_+2]&127)<<7,b|=p[_+3]&127,b},N=function(p,_){return H(p,_)&&j(p,_+6)+10<=p.length-_},e=function(p){for(var _=f(p),b=0;b<_.length;b++){var u=_[b];if(w(u))return s(u)}return},w=function(p){return p&&p.key==="PRIV"&&p.info==="com.apple.streaming.transportStreamTimestamp"},g=function(p){var _=String.fromCharCode(p[0],p[1],p[2],p[3]),b=j(p,4),u=10;return{type:_,size:b,data:p.subarray(u,u+b)}},f=function(p){for(var _=0,b=[];H(p,_);){var u=j(p,_+6);_+=10;for(var h=_+u;_+8<h;){var c=g(p.subarray(_)),d=o(c);d&&b.push(d),_+=c.size+10}I(p,_)&&(_+=10)}return b},o=function(p){return p.type==="PRIV"?n(p):p.type[0]==="W"?l(p):a(p)},n=function(p){if(p.size<2)return;var _=i(p.data,!0),b=new Uint8Array(p.data.subarray(_.length+1));return{key:p.type,info:_,data:b.buffer}},a=function(p){if(p.size<2)return;if(p.type==="TXXX"){var _=1,b=i(p.data.subarray(_),!0);_+=b.length+1;var u=i(p.data.subarray(_));return{key:p.type,info:b,data:u}}var h=i(p.data.subarray(1));return{key:p.type,data:h}},l=function(p){if(p.type==="WXXX"){if(p.size<2)return;var _=1,b=i(p.data.subarray(_),!0);_+=b.length+1;var u=i(p.data.subarray(_));return{key:p.type,info:b,data:u}}var h=i(p.data);return{key:p.type,data:h}},s=function(p){if(p.data.byteLength===8){var _=new Uint8Array(p.data),b=_[3]&1,u=(_[4]<<23)+(_[5]<<15)+(_[6]<<7)+_[7];return u/=45,b&&(u+=4772185884e-2),Math.round(u)}return},i=function(p,_){_===void 0&&(_=!1);var b=v();if(b){var u=b.decode(p);if(_){var h=u.indexOf("\0");return h!==-1?u.substring(0,h):u}return u.replace(/\0/g,"")}for(var c=p.length,d,E,y,T="",D=0;D<c;){if(d=p[D++],d===0&&_)return T;if(d===0||d===3)continue;switch(d>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:T+=String.fromCharCode(d);break;case 12:case 13:E=p[D++],T+=String.fromCharCode((d&31)<<6|E&63);break;case 14:E=p[D++],y=p[D++],T+=String.fromCharCode((d&15)<<12|(E&63)<<6|(y&63)<<0);break;default:}}return T},r={decodeTextFrame:a},t;function v(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/demux/base-audio-demuxer.ts"),I=O("./src/demux/id3.ts"),C=O("./src/utils/logger.ts"),j=O("./src/demux/mpegaudio.ts");function N(g,f){g.prototype=Object.create(f.prototype),g.prototype.constructor=g,e(g,f)}function e(g,f){return e=Object.setPrototypeOf||function(n,a){return n.__proto__=a,n},e(g,f)}var w=function(g){N(f,g);function f(){return g.apply(this,arguments)||this}var o=f.prototype;return o.resetInitSegment=function(a,l,s){g.prototype.resetInitSegment.call(this,a,l,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:a,duration:s,inputTimeScale:9e4,dropped:0}},f.probe=function(a){if(!a)return!1;for(var l=I.getID3Data(a,0)||[],s=l.length,i=a.length;s<i;s++)if(j.probe(a,s))return C.logger.log("MPEG Audio sync word found !"),!0;return!1},o.canParse=function(a,l){return j.canParse(a,l)},o.appendFrame=function(a,l,s){return this.initPTS===null?void 0:j.appendFrame(a,l,s,this.initPTS,this.frameIndex)},f}(H.default);w.minProbeByteLength=4,B.default=w},"./src/demux/mp4demuxer.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/utils/mp4-tools.ts"),I=O("./src/demux/dummy-demuxed-track.ts"),C=function(){function j(e,w){this.remainderData=null,this.config=void 0,this.config=w}var N=j.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},j.probe=function(w){return Object(H.findBox)({data:w,start:0,end:Math.min(w.length,16384)},["moof"]).length>0},N.demux=function(w){var g=w,f=Object(I.dummyTrack)();if(this.config.progressive){this.remainderData&&(g=Object(H.appendUint8Array)(this.remainderData,w));var o=Object(H.segmentValidRange)(g);this.remainderData=o.remainder,f.samples=o.valid||new Uint8Array}else f.samples=g;return{audioTrack:Object(I.dummyTrack)(),avcTrack:f,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},N.flush=function(){var w=Object(I.dummyTrack)();return w.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(I.dummyTrack)(),avcTrack:w,id3Track:Object(I.dummyTrack)(),textTrack:Object(I.dummyTrack)()}},N.demuxSampleAes=function(w,g,f){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},j}();C.minProbeByteLength=1024,B.default=C},"./src/demux/mpegaudio.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"appendFrame",function(){return e}),O.d(B,"parseHeader",function(){return w}),O.d(B,"isHeaderPattern",function(){return g}),O.d(B,"isHeader",function(){return f}),O.d(B,"canParse",function(){return o}),O.d(B,"probe",function(){return n});var H=null,I=[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],C=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],j=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function e(a,l,s,i,r){if(s+24>l.length)return;var t=w(l,s);if(t&&s+t.frameLength<=l.length){var v=t.samplesPerFrame*9e4/t.sampleRate,m=i+r*v,p={unit:l.subarray(s,s+t.frameLength),pts:m,dts:m};return a.config=[],a.channelCount=t.channelCount,a.samplerate=t.sampleRate,a.samples.push(p),{sample:p,length:t.frameLength,missing:0}}}function w(a,l){var s=a[l+1]>>3&3,i=a[l+1]>>1&3,r=a[l+2]>>4&15,t=a[l+2]>>2&3;if(s!==1&&r!==0&&r!==15&&t!==3){var v=a[l+2]>>1&1,m=a[l+3]>>6,p=s===3?3-i:i===3?3:4,_=I[p*14+r-1]*1e3,b=s===3?0:s===2?1:2,u=C[b*3+t],h=m===3?1:2,c=j[s][i],d=N[i],E=c*8*d,y=Math.floor(c*_/u+v)*d;if(H===null){var T=navigator.userAgent||"",D=T.match(/Chrome\/(\d+)/i);H=D?parseInt(D[1]):0}var L=!!H&&H<=87;return L&&i===2&&_>=224e3&&m===0&&(a[l+3]=a[l+3]|128),{sampleRate:u,channelCount:h,frameLength:y,samplesPerFrame:E}}}function g(a,l){return a[l]===255&&(a[l+1]&224)===224&&(a[l+1]&6)!==0}function f(a,l){return l+1<a.length&&g(a,l)}function o(a,l){var s=4;return g(a,l)&&s<=a.length-l}function n(a,l){if(l+1<a.length&&g(a,l)){var s=4,i=w(a,l),r=s;i!=null&&i.frameLength&&(r=i.frameLength);var t=l+r;return t===a.length||f(a,t)}return!1}},"./src/demux/sample-aes.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/crypt/decrypter.ts"),I=O("./src/demux/tsdemuxer.ts"),C=function(){function j(e,w,g){this.keyData=void 0,this.decrypter=void 0,this.keyData=g,this.decrypter=new H.default(e,w,{removePKCS7Padding:!1})}var N=j.prototype;return N.decryptBuffer=function(w,g){this.decrypter.decrypt(w,this.keyData.key.buffer,this.keyData.iv.buffer,g)},N.decryptAacSample=function(w,g,f,o){var n=w[g].unit,a=n.subarray(16,n.length-n.length%16),l=a.buffer.slice(a.byteOffset,a.byteOffset+a.length),s=this;this.decryptBuffer(l,function(i){var r=new Uint8Array(i);n.set(r,16),o||s.decryptAacSamples(w,g+1,f)})},N.decryptAacSamples=function(w,g,f){for(;;g++){if(g>=w.length){f();return}if(w[g].unit.length<32)continue;var o=this.decrypter.isSync();if(this.decryptAacSample(w,g,f,o),!o)return}},N.getAvcEncryptedData=function(w){for(var g=Math.floor((w.length-48)/160)*16+16,f=new Int8Array(g),o=0,n=32;n<=w.length-16;n+=160,o+=16)f.set(w.subarray(n,n+16),o);return f},N.getAvcDecryptedUnit=function(w,g){for(var f=new Uint8Array(g),o=0,n=32;n<=w.length-16;n+=160,o+=16)w.set(f.subarray(o,o+16),n);return w},N.decryptAvcSample=function(w,g,f,o,n,a){var l=Object(I.discardEPB)(n.data),s=this.getAvcEncryptedData(l),i=this;this.decryptBuffer(s.buffer,function(r){n.data=i.getAvcDecryptedUnit(l,r),a||i.decryptAvcSamples(w,g,f+1,o)})},N.decryptAvcSamples=function(w,g,f,o){if(w instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;g++,f=0){if(g>=w.length){o();return}for(var n=w[g].units;!(f>=n.length);f++){var a=n[f];if(a.data.length<=48||a.type!==1&&a.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(w,g,f,o,a,l),!l)return}}},j}();B.default=C},"./src/demux/transmuxer-interface.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return n});var H=O("./node_modules/webworkify-webpack/index.js"),I=O.n(H),C=O("./src/events.ts"),j=O("./src/demux/transmuxer.ts"),N=O("./src/utils/logger.ts"),e=O("./src/errors.ts"),w=O("./src/utils/mediasource-helper.ts"),g=O("./node_modules/eventemitter3/index.js"),f=O.n(g),o=Object(w.getMediaSource)()||{isTypeSupported:function(){return!1}},n=function(){function a(s,i,r,t){var v=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=s,this.id=i,this.onTransmuxComplete=r,this.onFlush=t;var m=s.config,p=function(c,d){d=d||{},d.frag=v.frag,d.id=v.id,s.trigger(c,d)};this.observer=new g.EventEmitter,this.observer.on(C.Events.FRAG_DECRYPTED,p),this.observer.on(C.Events.ERROR,p);var _={mp4:o.isTypeSupported("video/mp4"),mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"')},b=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var u;try{u=this.worker=H("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),u.addEventListener("message",this.onwmsg),u.onerror=function(h){s.trigger(C.Events.ERROR,{type:e.ErrorTypes.OTHER_ERROR,details:e.ErrorDetails.INTERNAL_EXCEPTION,fatal:!0,event:"demuxerWorker",error:new Error(h.message+" ("+h.filename+":"+h.lineno+")")})},u.postMessage({cmd:"init",typeSupported:_,vendor:b,id:i,config:JSON.stringify(m)})}catch(h){N.logger.warn("Error in worker:",h),N.logger.error("Error while initializing DemuxerWorker, fallback to inline"),u&&self.URL.revokeObjectURL(u.objectURL),this.transmuxer=new j.default(this.observer,_,m,b,i),this.worker=null}}else this.transmuxer=new j.default(this.observer,_,m,b,i)}var l=a.prototype;return l.destroy=function(){var i=this.worker;if(i)i.removeEventListener("message",this.onwmsg),i.terminate(),this.worker=null;else{var r=this.transmuxer;r&&(r.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},l.push=function(i,r,t,v,m,p,_,b,u,h){var c=this;u.transmuxing.start=self.performance.now();var d=this.transmuxer,E=this.worker,y=p?p.start:m.start,T=m.decryptdata,D=this.frag,L=!(D&&m.cc===D.cc),x=!(D&&u.level===D.level),k=D?u.sn-D.sn:-1,U=this.part?u.part-this.part.index:1,R=!x&&(k===1||k===0&&U===1),V=self.performance.now();(x||k||m.stats.parsing.start===0)&&(m.stats.parsing.start=V),p&&(U||!R)&&(p.stats.parsing.start=V);var Z=new j.TransmuxState(L,R,b,x,y);if(!R||L){N.logger.log("[transmuxer-interface, "+m.type+"]: Starting new transmux session for sn: "+u.sn+" p: "+u.part+" level: "+u.level+" id: "+u.id+`
discontinuity: `+L+`
trackSwitch: `+x+`
contiguous: `+R+`
accurateTimeOffset: `+b+`
timeOffset: `+y);var ue=new j.TransmuxConfig(t,v,r,_,h);this.configureTransmuxer(ue)}if(this.frag=m,this.part=p,E)E.postMessage({cmd:"demux",data:i,decryptdata:T,chunkMeta:u,state:Z},i instanceof ArrayBuffer?[i]:[]);else if(d){var le=d.push(i,T,u,Z);Object(j.isPromise)(le)?le.then(function(ge){c.handleTransmuxComplete(ge)}):this.handleTransmuxComplete(le)}},l.flush=function(i){var r=this;i.transmuxing.start=self.performance.now();var t=this.transmuxer,v=this.worker;if(v)v.postMessage({cmd:"flush",chunkMeta:i});else if(t){var m=t.flush(i);Object(j.isPromise)(m)?m.then(function(p){r.handleFlushResult(p,i)}):this.handleFlushResult(m,i)}},l.handleFlushResult=function(i,r){var t=this;i.forEach(function(v){t.handleTransmuxComplete(v)}),this.onFlush(r)},l.onWorkerMessage=function(i){var r=i.data,t=this.hls;switch(r.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(r.data);break}case"flush":{this.onFlush(r.data);break}default:{r.data=r.data||{},r.data.frag=this.frag,r.data.id=this.id,t.trigger(r.event,r.data);break}}},l.configureTransmuxer=function(i){var r=this.worker,t=this.transmuxer;r?r.postMessage({cmd:"configure",config:i}):t&&t.configure(i)},l.handleTransmuxComplete=function(i){i.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(i)},a}()},"./src/demux/transmuxer-worker.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return e});var H=O("./src/demux/transmuxer.ts"),I=O("./src/events.ts"),C=O("./src/utils/logger.ts"),j=O("./node_modules/eventemitter3/index.js"),N=O.n(j);function e(n){var a=new j.EventEmitter,l=function(i,r){n.postMessage({event:i,data:r})};a.on(I.Events.FRAG_DECRYPTED,l),a.on(I.Events.ERROR,l),n.addEventListener("message",function(s){var i=s.data;switch(i.cmd){case"init":{var r=JSON.parse(i.config);n.transmuxer=new H.default(a,i.typeSupported,r,i.vendor,i.id),Object(C.enableLogs)(r.debug),l("init",null);break}case"configure":{n.transmuxer.configure(i.config);break}case"demux":{var t=n.transmuxer.push(i.data,i.decryptdata,i.chunkMeta,i.state);Object(H.isPromise)(t)?t.then(function(p){w(n,p)}):w(n,t);break}case"flush":{var v=i.chunkMeta,m=n.transmuxer.flush(v);Object(H.isPromise)(m)?m.then(function(p){f(n,p,v)}):f(n,m,v);break}default:break}})}function w(n,a){if(o(a.remuxResult))return;var l=[],s=a.remuxResult,i=s.audio,r=s.video;i&&g(l,i),r&&g(l,r),n.postMessage({event:"transmuxComplete",data:a},l)}function g(n,a){a.data1&&n.push(a.data1.buffer),a.data2&&n.push(a.data2.buffer)}function f(n,a,l){a.forEach(function(s){w(n,s)}),n.postMessage({event:"flush",data:l})}function o(n){return!n.audio&&!n.video&&!n.text&&!n.id3&&!n.initSegment}},"./src/demux/transmuxer.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return r}),O.d(B,"isPromise",function(){return m}),O.d(B,"TransmuxConfig",function(){return p}),O.d(B,"TransmuxState",function(){return _});var H=O("./src/events.ts"),I=O("./src/errors.ts"),C=O("./src/crypt/decrypter.ts"),j=O("./src/demux/aacdemuxer.ts"),N=O("./src/demux/mp4demuxer.ts"),e=O("./src/demux/tsdemuxer.ts"),w=O("./src/demux/mp3demuxer.ts"),g=O("./src/remux/mp4-remuxer.ts"),f=O("./src/remux/passthrough-remuxer.ts"),o=O("./src/demux/chunk-cache.ts"),n=O("./src/utils/mp4-tools.ts"),a=O("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(b){a.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var s=[{demux:e.default,remux:g.default},{demux:N.default,remux:f.default},{demux:j.default,remux:g.default},{demux:w.default,remux:g.default}],i=1024;s.forEach(function(b){var u=b.demux;i=Math.max(i,u.minProbeByteLength)});var r=function(){function b(h,c,d,E,y){this.observer=void 0,this.typeSupported=void 0,this.config=void 0,this.vendor=void 0,this.id=void 0,this.demuxer=void 0,this.remuxer=void 0,this.decrypter=void 0,this.probe=void 0,this.decryptionPromise=null,this.transmuxConfig=void 0,this.currentTransmuxState=void 0,this.cache=new o.default,this.observer=h,this.typeSupported=c,this.config=d,this.vendor=E,this.id=y}var u=b.prototype;return u.configure=function(c){this.transmuxConfig=c,this.decrypter&&this.decrypter.reset()},u.push=function(c,d,E,y){var T=this,D=E.transmuxing;D.executeStart=l();var L=new Uint8Array(c),x=this.cache,k=this.config,U=this.currentTransmuxState,R=this.transmuxConfig;y&&(this.currentTransmuxState=y);var V=t(L,d);if(V&&V.method==="AES-128"){var Z=this.getDecrypter();if(k.enableSoftwareAES){var ue=Z.softwareDecrypt(L,V.key.buffer,V.iv.buffer);if(!ue)return D.executeEnd=l(),v(E);L=new Uint8Array(ue)}else return this.decryptionPromise=Z.webCryptoDecrypt(L,V.key.buffer,V.iv.buffer).then(function(he){var ye=T.push(he,null,E);return T.decryptionPromise=null,ye}),this.decryptionPromise}var le=y||U,ge=le.contiguous,pe=le.discontinuity,ae=le.trackSwitch,ne=le.accurateTimeOffset,fe=le.timeOffset,q=R.audioCodec,M=R.videoCodec,S=R.defaultInitPts,A=R.duration,F=R.initSegmentData;if((pe||ae)&&this.resetInitSegment(F,q,M,A),pe&&this.resetInitialTimestamp(S),ge||this.resetContiguity(),this.needsProbing(L,pe,ae)){if(x.dataLength){var K=x.flush();L=Object(n.appendUint8Array)(K,L)}this.configureTransmuxer(L,R)}var P=this.transmux(L,V,fe,ne,E),re=this.currentTransmuxState;return re.contiguous=!0,re.discontinuity=!1,re.trackSwitch=!1,D.executeEnd=l(),P},u.flush=function(c){var d=this,E=c.transmuxing;E.executeStart=l();var y=this.decrypter,T=this.cache,D=this.currentTransmuxState,L=this.decryptionPromise;if(L)return L.then(function(){return d.flush(c)});var x=[],k=D.timeOffset;if(y){var U=y.flush();U&&x.push(this.push(U,null,c))}var R=T.dataLength;T.reset();var V=this.demuxer,Z=this.remuxer;if(!V||!Z)return R>=i&&this.observer.emit(H.Events.ERROR,H.Events.ERROR,{type:I.ErrorTypes.MEDIA_ERROR,details:I.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),E.executeEnd=l(),[v(c)];var ue=V.flush(k);return m(ue)?ue.then(function(le){return d.flushRemux(x,le,c),x}):(this.flushRemux(x,ue,c),x)},u.flushRemux=function(c,d,E){var y=d.audioTrack,T=d.avcTrack,D=d.id3Track,L=d.textTrack,x=this.currentTransmuxState,k=x.accurateTimeOffset,U=x.timeOffset;a.logger.log("[transmuxer.ts]: Flushed fragment "+E.sn+(E.part>-1?" p: "+E.part:"")+" of level "+E.level);var R=this.remuxer.remux(y,T,D,L,U,k,!0,this.id);c.push({remuxResult:R,chunkMeta:E}),E.transmuxing.executeEnd=l()},u.resetInitialTimestamp=function(c){var d=this.demuxer,E=this.remuxer;if(!d||!E)return;d.resetTimeStamp(c),E.resetTimeStamp(c)},u.resetContiguity=function(){var c=this.demuxer,d=this.remuxer;if(!c||!d)return;c.resetContiguity(),d.resetNextTimestamp()},u.resetInitSegment=function(c,d,E,y){var T=this.demuxer,D=this.remuxer;if(!T||!D)return;T.resetInitSegment(d,E,y),D.resetInitSegment(c,d,E)},u.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},u.transmux=function(c,d,E,y,T){var D;return d&&d.method==="SAMPLE-AES"?D=this.transmuxSampleAes(c,d,E,y,T):D=this.transmuxUnencrypted(c,E,y,T),D},u.transmuxUnencrypted=function(c,d,E,y){var T=this.demuxer.demux(c,d,!1,!this.config.progressive),D=T.audioTrack,L=T.avcTrack,x=T.id3Track,k=T.textTrack,U=this.remuxer.remux(D,L,x,k,d,E,!1,this.id);return{remuxResult:U,chunkMeta:y}},u.transmuxSampleAes=function(c,d,E,y,T){var D=this;return this.demuxer.demuxSampleAes(c,d,E).then(function(L){var x=D.remuxer.remux(L.audioTrack,L.avcTrack,L.id3Track,L.textTrack,E,y,!1,D.id);return{remuxResult:x,chunkMeta:T}})},u.configureTransmuxer=function(c,d){for(var E=this.config,y=this.observer,T=this.typeSupported,D=this.vendor,L=d.audioCodec,x=d.defaultInitPts,k=d.duration,U=d.initSegmentData,R=d.videoCodec,V,Z=0,ue=s.length;Z<ue;Z++)if(s[Z].demux.probe(c)){V=s[Z];break}V||(a.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),V={demux:N.default,remux:f.default});var le=this.demuxer,ge=this.remuxer,pe=V.remux,ae=V.demux;(!ge||!(ge instanceof pe))&&(this.remuxer=new pe(y,E,T,D)),(!le||!(le instanceof ae))&&(this.demuxer=new ae(y,E,T),this.probe=ae.probe),this.resetInitSegment(U,L,R,k),this.resetInitialTimestamp(x)},u.needsProbing=function(c,d,E){return!this.demuxer||!this.remuxer||d||E},u.getDecrypter=function(){var c=this.decrypter;return c||(c=this.decrypter=new C.default(this.observer,this.config)),c},b}();function t(b,u){var h=null;return b.byteLength>0&&u!=null&&u.key!=null&&u.iv!==null&&u.method!=null&&(h=u),h}var v=function(u){return{remuxResult:{},chunkMeta:u}};function m(b){return"then"in b&&b.then instanceof Function}var p=function(u,h,c,d,E){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=u,this.videoCodec=h,this.initSegmentData=c,this.duration=d,this.defaultInitPts=E},_=function(u,h,c,d,E){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.discontinuity=u,this.contiguous=h,this.accurateTimeOffset=c,this.trackSwitch=d,this.timeOffset=E}},"./src/demux/tsdemuxer.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"discardEPB",function(){return v});var H=O("./src/demux/adts.ts"),I=O("./src/demux/mpegaudio.ts"),C=O("./src/demux/exp-golomb.ts"),j=O("./src/demux/id3.ts"),N=O("./src/demux/sample-aes.ts"),e=O("./src/events.ts"),w=O("./src/utils/mp4-tools.ts"),g=O("./src/utils/logger.ts"),f=O("./src/errors.ts"),o={video:1,audio:2,id3:3,text:4},n=function(){function m(_,b,u){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=_,this.config=b,this.typeSupported=u}m.probe=function(b){var u=m.syncOffset(b);return u<0?!1:(u&&g.logger.warn("MPEG2-TS detected but first sync word found @ offset "+u+", junk ahead ?"),!0)},m.syncOffset=function(b){for(var u=Math.min(1e3,b.length-3*188),h=0;h<u;){if(b[h]===71&&b[h+188]===71&&b[h+2*188]===71)return h;h++}return-1},m.createTrack=function(b,u){return{container:b==="video"||b==="audio"?"video/mp2t":void 0,type:b,id:o[b],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:b==="audio"?u:void 0}};var p=m.prototype;return p.resetInitSegment=function(b,u,h){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=m.createTrack("video",h),this._audioTrack=m.createTrack("audio",h),this._id3Track=m.createTrack("id3",h),this._txtTrack=m.createTrack("text",h),this._audioTrack.isAAC=!0,this.aacOverFlow=null,this.aacLastPTS=null,this.avcSample=null,this.audioCodec=b,this.videoCodec=u,this._duration=h},p.resetTimeStamp=function(){},p.resetContiguity=function(){var b=this._audioTrack,u=this._avcTrack,h=this._id3Track;b&&(b.pesData=null),u&&(u.pesData=null),h&&(h.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},p.demux=function(b,u,h,c){h===void 0&&(h=!1),c===void 0&&(c=!1),h||(this.sampleAes=null);var d,E=this._avcTrack,y=this._audioTrack,T=this._id3Track,D=E.pid,L=E.pesData,x=y.pid,k=T.pid,U=y.pesData,R=T.pesData,V=!1,Z=this.pmtParsed,ue=this._pmtId,le=b.length;if(this.remainderData&&(b=Object(w.appendUint8Array)(this.remainderData,b),le=b.length,this.remainderData=null),le<188&&!c)return this.remainderData=b,{audioTrack:y,avcTrack:E,id3Track:T,textTrack:this._txtTrack};var ge=Math.max(0,m.syncOffset(b));le-=(le+ge)%188,le<b.byteLength&&!c&&(this.remainderData=new Uint8Array(b.buffer,le,b.buffer.byteLength-le));for(var pe=ge;pe<le;pe+=188)if(b[pe]===71){var ae=!!(b[pe+1]&64),ne=((b[pe+1]&31)<<8)+b[pe+2],fe=(b[pe+3]&48)>>4,q=void 0;if(fe>1){if(q=pe+5+b[pe+4],q===pe+188)continue}else q=pe+4;switch(ne){case D:ae&&(L&&(d=i(L))&&this.parseAVCPES(d,!1),L={data:[],size:0}),L&&(L.data.push(b.subarray(q,pe+188)),L.size+=pe+188-q);break;case x:ae&&(U&&(d=i(U))&&(y.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),U={data:[],size:0}),U&&(U.data.push(b.subarray(q,pe+188)),U.size+=pe+188-q);break;case k:ae&&(R&&(d=i(R))&&this.parseID3PES(d),R={data:[],size:0}),R&&(R.data.push(b.subarray(q,pe+188)),R.size+=pe+188-q);break;case 0:ae&&(q+=b[q]+1),ue=this._pmtId=l(b,q);break;case ue:{ae&&(q+=b[q]+1);var M=s(b,q,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,h);D=M.avc,D>0&&(E.pid=D),x=M.audio,x>0&&(y.pid=x,y.isAAC=M.isAAC),k=M.id3,k>0&&(T.pid=k),V&&!Z&&(g.logger.log("reparse from beginning"),V=!1,pe=ge-188),Z=this.pmtParsed=!0;break}case 17:case 8191:break;default:V=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});E.pesData=L,y.pesData=U,T.pesData=R;var S={audioTrack:y,avcTrack:E,id3Track:T,textTrack:this._txtTrack};return c&&this.extractRemainingSamples(S),S},p.flush=function(){var b=this.remainderData;this.remainderData=null;var u;return b?u=this.demux(b,-1,!1,!0):u={audioTrack:this._audioTrack,avcTrack:this._avcTrack,textTrack:this._txtTrack,id3Track:this._id3Track},this.extractRemainingSamples(u),this.sampleAes?this.decrypt(u,this.sampleAes):u},p.extractRemainingSamples=function(b){var u=b.audioTrack,h=b.avcTrack,c=b.id3Track,d=h.pesData,E=u.pesData,y=c.pesData,T;d&&(T=i(d))?(this.parseAVCPES(T,!0),h.pesData=null):h.pesData=d,E&&(T=i(E))?(u.isAAC?this.parseAACPES(T):this.parseMPEGPES(T),u.pesData=null):(E!=null&&E.size&&g.logger.log("last AAC PES packet truncated,might overlap between fragments"),u.pesData=E),y&&(T=i(y))?(this.parseID3PES(T),c.pesData=null):c.pesData=y},p.demuxSampleAes=function(b,u,h){var c=this.demux(b,h,!0,!this.config.progressive),d=this.sampleAes=new N.default(this.observer,this.config,u);return this.decrypt(c,d)},p.decrypt=function(b,u){return new Promise(function(h){var c=b.audioTrack,d=b.avcTrack;c.samples&&c.isAAC?u.decryptAacSamples(c.samples,0,function(){d.samples?u.decryptAvcSamples(d.samples,0,0,function(){h(b)}):h(b)}):d.samples&&u.decryptAvcSamples(d.samples,0,0,function(){h(b)})})},p.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},p.parseAVCPES=function(b,u){var h=this,c=this._avcTrack,d=this.parseAVCNALu(b.data),E=!1,y=this.avcSample,T,D=!1;b.data=null,y&&d.length&&!c.audFound&&(r(y,c),y=this.avcSample=a(!1,b.pts,b.dts,"")),d.forEach(function(L){switch(L.type){case 1:{T=!0,y||(y=h.avcSample=a(!0,b.pts,b.dts,"")),E&&(y.debug+="NDR "),y.frame=!0;var x=L.data;if(D&&x.length>4){var k=new C.default(x).readSliceType();(k===2||k===4||k===7||k===9)&&(y.key=!0)}break}case 5:T=!0,y||(y=h.avcSample=a(!0,b.pts,b.dts,"")),E&&(y.debug+="IDR "),y.key=!0,y.frame=!0;break;case 6:{T=!0,E&&y&&(y.debug+="SEI ");var U=new C.default(v(L.data));U.readUByte();for(var R=0,V=0,Z=!1,ue=0;!Z&&U.bytesAvailable>1;){R=0;do ue=U.readUByte(),R+=ue;while(ue===255);V=0;do ue=U.readUByte(),V+=ue;while(ue===255);if(R===4&&U.bytesAvailable!==0){Z=!0;var le=U.readUByte();if(le===181){var ge=U.readUShort();if(ge===49){var pe=U.readUInt();if(pe===1195456820){var ae=U.readUByte();if(ae===3){for(var ne=U.readUByte(),fe=U.readUByte(),q=31&ne,M=[ne,fe],S=0;S<q;S++)M.push(U.readUByte()),M.push(U.readUByte()),M.push(U.readUByte());t(h._txtTrack.samples,{type:3,pts:b.pts,bytes:M})}}}}}else if(R===5&&U.bytesAvailable!==0){if(Z=!0,V>16){for(var A=[],F=0;F<16;F++)A.push(U.readUByte().toString(16)),(F===3||F===5||F===7||F===9)&&A.push("-");for(var K=V-16,P=new Uint8Array(K),re=0;re<K;re++)P[re]=U.readUByte();t(h._txtTrack.samples,{pts:b.pts,payloadType:R,uuid:A.join(""),userData:Object(j.utf8ArrayToStr)(P),userDataBytes:P})}}else if(V<U.bytesAvailable)for(var he=0;he<V;he++)U.readUByte()}break}case 7:if(T=!0,D=!0,E&&y&&(y.debug+="SPS "),!c.sps){var ye=new C.default(L.data),J=ye.readSPS();c.width=J.width,c.height=J.height,c.pixelRatio=J.pixelRatio,c.sps=[L.data],c.duration=h._duration;for(var se=L.data.subarray(1,4),me="avc1.",_e=0;_e<3;_e++){var Ce=se[_e].toString(16);Ce.length<2&&(Ce="0"+Ce),me+=Ce}c.codec=me}break;case 8:T=!0,E&&y&&(y.debug+="PPS "),c.pps||(c.pps=[L.data]);break;case 9:T=!1,c.audFound=!0,y&&r(y,c),y=h.avcSample=a(!1,b.pts,b.dts,E?"AUD ":"");break;case 12:T=!1;break;default:T=!1,y&&(y.debug+="unknown NAL "+L.type+" ");break}if(y&&T){var de=y.units;de.push(L)}}),u&&y&&(r(y,c),this.avcSample=null)},p.getLastNalUnit=function(){var b,u=this.avcSample,h;if(!u||u.units.length===0){var c=this._avcTrack.samples;u=c[c.length-1]}if((b=u)!==null&&b!==void 0&&b.units){var d=u.units;h=d[d.length-1]}return h},p.parseAVCNALu=function(b){var u=b.byteLength,h=this._avcTrack,c=h.naluState||0,d=c,E=[],y=0,T,D,L,x=-1,k=0;for(c===-1&&(x=0,k=b[0]&31,c=0,y=1);y<u;){if(T=b[y++],!c){c=T?0:1;continue}if(c===1){c=T?0:2;continue}if(!T)c=3;else if(T===1){if(x>=0){var U={data:b.subarray(x,y-c-1),type:k};E.push(U)}else{var R=this.getLastNalUnit();if(R&&(d&&y<=4-d&&(R.state&&(R.data=R.data.subarray(0,R.data.byteLength-d))),D=y-c-1,D>0)){var V=new Uint8Array(R.data.byteLength+D);V.set(R.data,0),V.set(b.subarray(0,D),R.data.byteLength),R.data=V,R.state=0}}y<u?(L=b[y]&31,x=y,k=L,c=0):c=-1}else c=0}if(x>=0&&c>=0){var Z={data:b.subarray(x,u),type:k,state:c};E.push(Z)}if(E.length===0){var ue=this.getLastNalUnit();if(ue){var le=new Uint8Array(ue.data.byteLength+b.byteLength);le.set(ue.data,0),le.set(b,ue.data.byteLength),ue.data=le}}return h.naluState=c,E},p.parseAACPES=function(b){var u=0,h=this._audioTrack,c=this.aacOverFlow,d=b.data;if(c){this.aacOverFlow=null;var E=c.sample.unit.byteLength,y=Math.min(c.missing,E),T=E-y;c.sample.unit.set(d.subarray(0,y),T),h.samples.push(c.sample),u=c.missing}var D,L;for(D=u,L=d.length;D<L-1&&!H.isHeader(d,D);D++);if(D!==u){var x,k;if(D<L-1?(x="AAC PES did not start with ADTS header,offset:"+D,k=!1):(x="no ADTS header found in AAC PES",k=!0),g.logger.warn("parsing error:"+x),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:f.ErrorTypes.MEDIA_ERROR,details:f.ErrorDetails.FRAG_PARSING_ERROR,fatal:k,reason:x}),k)return}H.initTrackConfig(h,this.observer,d,D,this.audioCodec);var U;if(b.pts!==void 0)U=b.pts;else if(c){var R=H.getFrameDuration(h.samplerate);U=c.sample.pts+R}else{g.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var V=0;D<L;)if(H.isHeader(d,D)){if(D+5<L){var Z=H.appendFrame(h,d,D,U,V);if(Z)if(Z.missing)this.aacOverFlow=Z;else{D+=Z.length,V++;continue}}break}else D++},p.parseMPEGPES=function(b){var u=b.data,h=u.length,c=0,d=0,E=b.pts;if(E===void 0){g.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<h;)if(I.isHeader(u,d)){var y=I.appendFrame(this._audioTrack,u,d,E,c);if(y)d+=y.length,c++;else break}else d++},p.parseID3PES=function(b){if(b.pts===void 0){g.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(b)},m}();n.minProbeByteLength=188;function a(m,p,_,b){return{key:m,frame:!1,pts:p,dts:_,units:[],debug:b,length:0}}function l(m,p){return(m[p+10]&31)<<8|m[p+11]}function s(m,p,_,b){var u={audio:-1,avc:-1,id3:-1,isAAC:!0},h=(m[p+1]&15)<<8|m[p+2],c=p+3+h-4,d=(m[p+10]&15)<<8|m[p+11];for(p+=12+d;p<c;){var E=(m[p+1]&31)<<8|m[p+2];switch(m[p]){case 207:if(!b){g.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:u.audio===-1&&(u.audio=E);break;case 21:u.id3===-1&&(u.id3=E);break;case 219:if(!b){g.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:u.avc===-1&&(u.avc=E);break;case 3:case 4:_?u.audio===-1&&(u.audio=E,u.isAAC=!1):g.logger.log("MPEG audio found, not supported in this browser");break;case 36:g.logger.warn("Unsupported HEVC stream type found");break;default:break}p+=((m[p+3]&15)<<8|m[p+4])+5}return u}function i(m){var p=0,_,b,u,h,c,d=m.data;if(!m||m.size===0)return null;for(;d[0].length<19&&d.length>1;){var E=new Uint8Array(d[0].length+d[1].length);E.set(d[0]),E.set(d[1],d[0].length),d[0]=E,d.splice(1,1)}_=d[0];var y=(_[0]<<16)+(_[1]<<8)+_[2];if(y===1){if(b=(_[4]<<8)+_[5],b&&b>m.size-6)return null;var T=_[7];T&192&&(h=(_[9]&14)*536870912+(_[10]&255)*4194304+(_[11]&254)*16384+(_[12]&255)*128+(_[13]&254)/2,T&64?(c=(_[14]&14)*536870912+(_[15]&255)*4194304+(_[16]&254)*16384+(_[17]&255)*128+(_[18]&254)/2,h-c>60*9e4&&(g.logger.warn(Math.round((h-c)/9e4)+"s delta between PTS and DTS, align them"),h=c)):c=h),u=_[8];var D=u+9;if(m.size<=D)return null;m.size-=D;for(var L=new Uint8Array(m.size),x=0,k=d.length;x<k;x++){_=d[x];var U=_.byteLength;if(D)if(D>U){D-=U;continue}else _=_.subarray(D),U-=D,D=0;L.set(_,p),p+=U}return b&&(b-=u+3),{data:L,pts:h,dts:c,len:b}}return null}function r(m,p){if(m.units.length&&m.frame){if(m.pts===void 0){var _=p.samples,b=_.length;if(b){var u=_[b-1];m.pts=u.pts,m.dts=u.dts}else{p.dropped++;return}}p.samples.push(m)}m.debug.length&&g.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function t(m,p){var _=m.length;if(_>0){if(p.pts>=m[_-1].pts)m.push(p);else for(var b=_-1;b>=0;b--)if(p.pts<m[b].pts){m.splice(b,0,p);break}}else m.push(p)}function v(m){for(var p=m.byteLength,_=[],b=1;b<p-2;)m[b]===0&&m[b+1]===0&&m[b+2]===3?(_.push(b+2),b+=2):b++;if(_.length===0)return m;var u=p-_.length,h=new Uint8Array(u),c=0;for(b=0;b<u;c++,b++)c===_[0]&&(c++,_.shift()),h[b]=m[c];return h}B.default=n},"./src/errors.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"ErrorTypes",function(){return H}),O.d(B,"ErrorDetails",function(){return I});var H;(function(C){C.NETWORK_ERROR="networkError",C.MEDIA_ERROR="mediaError",C.KEY_SYSTEM_ERROR="keySystemError",C.MUX_ERROR="muxError",C.OTHER_ERROR="otherError"})(H||(H={}));var I;(function(C){C.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",C.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",C.KEY_SYSTEM_NO_SESSION="keySystemNoSession",C.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",C.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",C.MANIFEST_LOAD_ERROR="manifestLoadError",C.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",C.MANIFEST_PARSING_ERROR="manifestParsingError",C.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",C.LEVEL_EMPTY_ERROR="levelEmptyError",C.LEVEL_LOAD_ERROR="levelLoadError",C.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",C.LEVEL_SWITCH_ERROR="levelSwitchError",C.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",C.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",C.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",C.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",C.FRAG_LOAD_ERROR="fragLoadError",C.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",C.FRAG_DECRYPT_ERROR="fragDecryptError",C.FRAG_PARSING_ERROR="fragParsingError",C.REMUX_ALLOC_ERROR="remuxAllocError",C.KEY_LOAD_ERROR="keyLoadError",C.KEY_LOAD_TIMEOUT="keyLoadTimeOut",C.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",C.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",C.BUFFER_APPEND_ERROR="bufferAppendError",C.BUFFER_APPENDING_ERROR="bufferAppendingError",C.BUFFER_STALLED_ERROR="bufferStalledError",C.BUFFER_FULL_ERROR="bufferFullError",C.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",C.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",C.INTERNAL_EXCEPTION="internalException",C.INTERNAL_ABORTED="aborted",C.UNKNOWN="unknown"})(I||(I={}))},"./src/events.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"Events",function(){return H});var H;(function(I){I.MEDIA_ATTACHING="hlsMediaAttaching",I.MEDIA_ATTACHED="hlsMediaAttached",I.MEDIA_DETACHING="hlsMediaDetaching",I.MEDIA_DETACHED="hlsMediaDetached",I.BUFFER_RESET="hlsBufferReset",I.BUFFER_CODECS="hlsBufferCodecs",I.BUFFER_CREATED="hlsBufferCreated",I.BUFFER_APPENDING="hlsBufferAppending",I.BUFFER_APPENDED="hlsBufferAppended",I.BUFFER_EOS="hlsBufferEos",I.BUFFER_FLUSHING="hlsBufferFlushing",I.BUFFER_FLUSHED="hlsBufferFlushed",I.MANIFEST_LOADING="hlsManifestLoading",I.MANIFEST_LOADED="hlsManifestLoaded",I.MANIFEST_PARSED="hlsManifestParsed",I.LEVEL_SWITCHING="hlsLevelSwitching",I.LEVEL_SWITCHED="hlsLevelSwitched",I.LEVEL_LOADING="hlsLevelLoading",I.LEVEL_LOADED="hlsLevelLoaded",I.LEVEL_UPDATED="hlsLevelUpdated",I.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",I.LEVELS_UPDATED="hlsLevelsUpdated",I.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",I.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",I.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",I.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",I.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",I.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",I.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",I.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",I.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",I.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",I.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",I.CUES_PARSED="hlsCuesParsed",I.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",I.INIT_PTS_FOUND="hlsInitPtsFound",I.FRAG_LOADING="hlsFragLoading",I.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",I.FRAG_LOADED="hlsFragLoaded",I.FRAG_DECRYPTED="hlsFragDecrypted",I.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",I.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",I.FRAG_PARSING_METADATA="hlsFragParsingMetadata",I.FRAG_PARSED="hlsFragParsed",I.FRAG_BUFFERED="hlsFragBuffered",I.FRAG_CHANGED="hlsFragChanged",I.FPS_DROP="hlsFpsDrop",I.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",I.ERROR="hlsError",I.DESTROYING="hlsDestroying",I.KEY_LOADING="hlsKeyLoading",I.KEY_LOADED="hlsKeyLoaded",I.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",I.BACK_BUFFER_REACHED="hlsBackBufferReached"})(H||(H={}))},"./src/hls.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return m});var H=O("./node_modules/url-toolkit/src/url-toolkit.js"),I=O.n(H),C=O("./src/loader/playlist-loader.ts"),j=O("./src/loader/key-loader.ts"),N=O("./src/controller/id3-track-controller.ts"),e=O("./src/controller/latency-controller.ts"),w=O("./src/controller/level-controller.ts"),g=O("./src/controller/fragment-tracker.ts"),f=O("./src/controller/stream-controller.ts"),o=O("./src/is-supported.ts"),n=O("./src/utils/logger.ts"),a=O("./src/config.ts"),l=O("./node_modules/eventemitter3/index.js"),s=O.n(l),i=O("./src/events.ts"),r=O("./src/errors.ts");function t(p,_){for(var b=0;b<_.length;b++){var u=_[b];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,u.key,u)}}function v(p,_,b){return _&&t(p.prototype,_),b&&t(p,b),p}var m=function(){p.isSupported=function(){return Object(o.isSupported)()};function p(b){b===void 0&&(b={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new l.EventEmitter,this._autoLevelCapping=void 0,this.abrController=void 0,this.bufferController=void 0,this.capLevelController=void 0,this.latencyController=void 0,this.levelController=void 0,this.streamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this.url=null;var u=this.config=Object(a.mergeConfig)(p.DefaultConfig,b);this.userConfig=b,Object(n.enableLogs)(u.debug),this._autoLevelCapping=-1,u.progressive&&Object(a.enableStreamingMode)(u);var h=u.abrController,c=u.bufferController,d=u.capLevelController,E=u.fpsController,y=this.abrController=new h(this),T=this.bufferController=new c(this),D=this.capLevelController=new d(this),L=new E(this),x=new C.default(this),k=new j.default(this),U=new N.default(this),R=this.levelController=new w.default(this),V=new g.FragmentTracker(this),Z=this.streamController=new f.default(this,V);D.setStreamController(Z),L.setStreamController(Z);var ue=[R,Z];this.networkControllers=ue;var le=[x,k,y,T,D,L,U,V];this.audioTrackController=this.createController(u.audioTrackController,null,ue),this.createController(u.audioStreamController,V,ue),this.subtitleTrackController=this.createController(u.subtitleTrackController,null,ue),this.createController(u.subtitleStreamController,V,ue),this.createController(u.timelineController,null,le),this.emeController=this.createController(u.emeController,null,le),this.cmcdController=this.createController(u.cmcdController,null,le),this.latencyController=this.createController(e.default,null,le),this.coreComponents=le}var _=p.prototype;return _.createController=function(u,h,c){if(u){var d=h?new u(this,h):new u(this);return c&&c.push(d),d}return null},_.on=function(u,h,c){c===void 0&&(c=this),this._emitter.on(u,h,c)},_.once=function(u,h,c){c===void 0&&(c=this),this._emitter.once(u,h,c)},_.removeAllListeners=function(u){this._emitter.removeAllListeners(u)},_.off=function(u,h,c,d){c===void 0&&(c=this),this._emitter.off(u,h,c,d)},_.listeners=function(u){return this._emitter.listeners(u)},_.emit=function(u,h,c){return this._emitter.emit(u,h,c)},_.trigger=function(u,h){if(this.config.debug)return this.emit(u,u,h);try{return this.emit(u,u,h)}catch(c){n.logger.error("An internal error happened while handling event "+u+'. Error message: "'+c.message+'". Here is a stacktrace:',c),this.trigger(i.Events.ERROR,{type:r.ErrorTypes.OTHER_ERROR,details:r.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:u,error:c})}return!1},_.listenerCount=function(u){return this._emitter.listenerCount(u)},_.destroy=function(){n.logger.log("destroy"),this.trigger(i.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(u){return u.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(u){return u.destroy()}),this.coreComponents.length=0},_.attachMedia=function(u){n.logger.log("attachMedia"),this._media=u,this.trigger(i.Events.MEDIA_ATTACHING,{media:u})},_.detachMedia=function(){n.logger.log("detachMedia"),this.trigger(i.Events.MEDIA_DETACHING,void 0),this._media=null},_.loadSource=function(u){this.stopLoad();var h=this.media,c=this.url,d=this.url=H.buildAbsoluteURL(self.location.href,u,{alwaysNormalize:!0});n.logger.log("loadSource:"+d),h&&c&&c!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(h)),this.trigger(i.Events.MANIFEST_LOADING,{url:u})},_.startLoad=function(u){u===void 0&&(u=-1),n.logger.log("startLoad("+u+")"),this.networkControllers.forEach(function(h){h.startLoad(u)})},_.stopLoad=function(){n.logger.log("stopLoad"),this.networkControllers.forEach(function(u){u.stopLoad()})},_.swapAudioCodec=function(){n.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},_.recoverMediaError=function(){n.logger.log("recoverMediaError");var u=this._media;this.detachMedia(),u&&this.attachMedia(u)},_.removeLevel=function(u,h){h===void 0&&(h=0),this.levelController.removeLevel(u,h)},v(p,[{key:"levels",get:function(){var u=this.levelController.levels;return u||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(u){n.logger.log("set currentLevel:"+u),this.loadLevel=u,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(u){n.logger.log("set nextLevel:"+u),this.levelController.manualLevel=u,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(u){n.logger.log("set loadLevel:"+u),this.levelController.manualLevel=u}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(u){this.levelController.nextLoadLevel=u}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(u){n.logger.log("set firstLevel:"+u),this.levelController.firstLevel=u}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(u){n.logger.log("set startLevel:"+u),u!==-1&&(u=Math.max(u,this.minAutoLevel)),this.levelController.startLevel=u}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(u){var h=!!u;h!==this.config.capLevelToPlayerSize&&(h?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=h)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(u){this._autoLevelCapping!==u&&(n.logger.log("set autoLevelCapping:"+u),this._autoLevelCapping=u)}},{key:"bandwidthEstimate",get:function(){var u=this.abrController.bwEstimator;return u?u.getEstimate():NaN}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var u=this.levels,h=this.config.minAutoBitrate;if(!u)return 0;for(var c=u.length,d=0;d<c;d++)if(u[d].maxBitrate>h)return d;return 0}},{key:"maxAutoLevel",get:function(){var u=this.levels,h=this.autoLevelCapping,c;return h===-1&&u&&u.length?c=u.length-1:c=h,c}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(u){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,u)}},{key:"audioTracks",get:function(){var u=this.audioTrackController;return u?u.audioTracks:[]}},{key:"audioTrack",get:function(){var u=this.audioTrackController;return u?u.audioTrack:-1},set:function(u){var h=this.audioTrackController;h&&(h.audioTrack=u)}},{key:"subtitleTracks",get:function(){var u=this.subtitleTrackController;return u?u.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var u=this.subtitleTrackController;return u?u.subtitleTrack:-1},set:function(u){var h=this.subtitleTrackController;h&&(h.subtitleTrack=u)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var u=this.subtitleTrackController;return u?u.subtitleDisplay:!1},set:function(u){var h=this.subtitleTrackController;h&&(h.subtitleDisplay=u)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(u){this.config.lowLatencyMode=u}},{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 i.Events}},{key:"ErrorTypes",get:function(){return r.ErrorTypes}},{key:"ErrorDetails",get:function(){return r.ErrorDetails}},{key:"DefaultConfig",get:function(){return p.defaultConfig?p.defaultConfig:a.hlsDefaultConfig},set:function(u){p.defaultConfig=u}}]),p}();m.defaultConfig=void 0},"./src/is-supported.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"isSupported",function(){return C}),O.d(B,"changeTypeSupported",function(){return j});var H=O("./src/utils/mediasource-helper.ts");function I(){return self.SourceBuffer||self.WebKitSourceBuffer}function C(){var N=Object(H.getMediaSource)();if(!N)return!1;var e=I(),w=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),g=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!w&&!!g}function j(){var N,e=I();return typeof(e==null||((N=e.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return n}),O.d(B,"LoadError",function(){return l});var H=O("./src/polyfills/number.ts"),I=O("./src/errors.ts");function C(s,i){s.prototype=Object.create(i.prototype),s.prototype.constructor=s,g(s,i)}function j(s){var i=typeof Map=="function"?new Map:void 0;return j=function(t){if(t===null||!w(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof i!="undefined"){if(i.has(t))return i.get(t);i.set(t,v)}function v(){return N(t,arguments,f(this).constructor)}return v.prototype=Object.create(t.prototype,{constructor:{value:v,enumerable:!1,writable:!0,configurable:!0}}),g(v,t)},j(s)}function N(s,i,r){return e()?N=Reflect.construct:N=function(v,m,p){var _=[null];_.push.apply(_,m);var b=Function.bind.apply(v,_),u=new b;return p&&g(u,p.prototype),u},N.apply(null,arguments)}function e(){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 w(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function g(s,i){return g=Object.setPrototypeOf||function(t,v){return t.__proto__=v,t},g(s,i)}function f(s){return f=Object.setPrototypeOf?Object.getPrototypeOf:function(r){return r.__proto__||Object.getPrototypeOf(r)},f(s)}var o=Math.pow(2,17),n=function(){function s(r){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=r}var i=s.prototype;return i.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},i.abort=function(){this.loader&&this.loader.abort()},i.load=function(t,v){var m=this,p=t.url;if(!p)return Promise.reject(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(p?"part list":"url")));this.abort();var _=this.config,b=_.fLoader,u=_.loader;return new Promise(function(h,c){m.loader&&m.loader.destroy();var d=m.loader=t.loader=b?new b(_):new u(_),E=a(t),y={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:o};t.stats=d.stats,d.load(E,y,{onSuccess:function(D,L,x,k){m.resetLoader(t,d),h({frag:t,part:null,payload:D.data,networkDetails:k})},onError:function(D,L,x){m.resetLoader(t,d),c(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:D,networkDetails:x}))},onAbort:function(D,L,x){m.resetLoader(t,d),c(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:x}))},onTimeout:function(D,L,x){m.resetLoader(t,d),c(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:x}))},onProgress:function(D,L,x,k){v&&v({frag:t,part:null,payload:x,networkDetails:k})}})})},i.loadPart=function(t,v,m){var p=this;this.abort();var _=this.config,b=_.fLoader,u=_.loader;return new Promise(function(h,c){p.loader&&p.loader.destroy();var d=p.loader=t.loader=b?new b(_):new u(_),E=a(t,v),y={timeout:_.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:_.fragLoadingMaxRetryTimeout,highWaterMark:o};v.stats=d.stats,d.load(E,y,{onSuccess:function(D,L,x,k){p.resetLoader(t,d),p.updateStatsFromPart(t,v);var U={frag:t,part:v,payload:D.data,networkDetails:k};m(U),h(U)},onError:function(D,L,x){p.resetLoader(t,d),c(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:v,response:D,networkDetails:x}))},onAbort:function(D,L,x){t.stats.aborted=v.stats.aborted,p.resetLoader(t,d),c(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:v,networkDetails:x}))},onTimeout:function(D,L,x){p.resetLoader(t,d),c(new l({type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:v,networkDetails:x}))}})})},i.updateStatsFromPart=function(t,v){var m=t.stats,p=v.stats,_=p.total;if(m.loaded+=p.loaded,_){var b=Math.round(t.duration/v.duration),u=Math.min(Math.round(m.loaded/_),b),h=b-u,c=h*Math.round(m.loaded/u);m.total=m.loaded+c}else m.total=Math.max(m.loaded,m.total);var d=m.loading,E=p.loading;d.start?d.first+=E.first-E.start:(d.start=E.start,d.first=E.first),d.end=E.end},i.resetLoader=function(t,v){t.loader=null,this.loader===v&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),v.destroy()},s}();function a(s,i){i===void 0&&(i=null);var r=i||s,t={frag:s,part:i,responseType:"arraybuffer",url:r.url,headers:{},rangeStart:0,rangeEnd:0},v=r.byteRangeStartOffset,m=r.byteRangeEndOffset;return Object(H.isFiniteNumber)(v)&&Object(H.isFiniteNumber)(m)&&(t.rangeStart=v,t.rangeEnd=m),t}var l=function(s){C(i,s);function i(r){for(var t,v=arguments.length,m=new Array(v>1?v-1:0),p=1;p<v;p++)m[p-1]=arguments[p];return t=s.call.apply(s,[this].concat(m))||this,t.data=void 0,t.data=r,t}return i}(j(Error))},"./src/loader/fragment.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"ElementaryStreamTypes",function(){return n}),O.d(B,"BaseSegment",function(){return a}),O.d(B,"Fragment",function(){return l}),O.d(B,"Part",function(){return s});var H=O("./src/polyfills/number.ts"),I=O("./node_modules/url-toolkit/src/url-toolkit.js"),C=O.n(I),j=O("./src/utils/logger.ts"),N=O("./src/loader/level-key.ts"),e=O("./src/loader/load-stats.ts");function w(i,r){i.prototype=Object.create(r.prototype),i.prototype.constructor=i,g(i,r)}function g(i,r){return g=Object.setPrototypeOf||function(v,m){return v.__proto__=m,v},g(i,r)}function f(i,r){for(var t=0;t<r.length;t++){var v=r[t];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(i,v.key,v)}}function o(i,r,t){return r&&f(i.prototype,r),t&&f(i,t),i}var n;(function(i){i.AUDIO="audio",i.VIDEO="video",i.AUDIOVIDEO="audiovideo"})(n||(n={}));var a=function(){function i(t){var v;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(v={},v[n.AUDIO]=null,v[n.VIDEO]=null,v[n.AUDIOVIDEO]=null,v),this.baseurl=t}var r=i.prototype;return r.setByteRange=function(v,m){var p=v.split("@",2),_=[];p.length===1?_[0]=m?m.byteRangeEndOffset:0:_[0]=parseInt(p[1]),_[1]=parseInt(p[0])+_[0],this._byteRange=_},o(i,[{key:"byteRange",get:function(){return this._byteRange?this._byteRange:[]}},{key:"byteRangeStartOffset",get:function(){return this.byteRange[0]}},{key:"byteRangeEndOffset",get:function(){return this.byteRange[1]}},{key:"url",get:function(){return!this._url&&this.baseurl&&this.relurl&&(this._url=Object(I.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(v){this._url=v}}]),i}(),l=function(i){w(r,i);function r(v,m){var p;return p=i.call(this,m)||this,p._decryptdata=null,p.rawProgramDateTime=null,p.programDateTime=null,p.tagList=[],p.duration=0,p.sn=0,p.levelkey=void 0,p.type=void 0,p.loader=null,p.level=-1,p.cc=0,p.startPTS=void 0,p.endPTS=void 0,p.appendedPTS=void 0,p.startDTS=void 0,p.endDTS=void 0,p.start=0,p.deltaPTS=void 0,p.maxStartPTS=void 0,p.minEndPTS=void 0,p.stats=new e.LoadStats,p.urlId=0,p.data=void 0,p.bitrateTest=!1,p.title=null,p.initSegment=null,p.type=v,p}var t=r.prototype;return t.createInitializationVector=function(m){for(var p=new Uint8Array(16),_=12;_<16;_++)p[_]=m>>8*(15-_)&255;return p},t.setDecryptDataFromLevelKey=function(m,p){var _=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(_=N.LevelKey.fromURI(m.uri),_.method=m.method,_.iv=this.createInitializationVector(p),_.keyFormat="identity"),_},t.setElementaryStreamInfo=function(m,p,_,b,u,h){h===void 0&&(h=!1);var c=this.elementaryStreams,d=c[m];if(!d){c[m]={startPTS:p,endPTS:_,startDTS:b,endDTS:u,partial:h};return}d.startPTS=Math.min(d.startPTS,p),d.endPTS=Math.max(d.endPTS,_),d.startDTS=Math.min(d.startDTS,b),d.endDTS=Math.max(d.endDTS,u)},t.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[n.AUDIO]=null,m[n.VIDEO]=null,m[n.AUDIOVIDEO]=null},o(r,[{key:"decryptdata",get:function(){if(!this.levelkey&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkey){var m=this.sn;typeof m!="number"&&(this.levelkey&&this.levelkey.method==="AES-128"&&!this.levelkey.iv&&j.logger.warn('missing IV for initialization segment with method="'+this.levelkey.method+'" - compliance issue'),m=0),this._decryptdata=this.setDecryptDataFromLevelKey(this.levelkey,m)}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null)return null;if(!Object(H.isFiniteNumber)(this.programDateTime))return null;var m=Object(H.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+m*1e3}},{key:"encrypted",get:function(){var m;return!!((m=this.decryptdata)!==null&&m!==void 0&&m.keyFormat&&this.decryptdata.uri)}}]),r}(a),s=function(i){w(r,i);function r(t,v,m,p,_){var b;b=i.call(this,m)||this,b.fragOffset=0,b.duration=0,b.gap=!1,b.independent=!1,b.relurl=void 0,b.fragment=void 0,b.index=void 0,b.stats=new e.LoadStats,b.duration=t.decimalFloatingPoint("DURATION"),b.gap=t.bool("GAP"),b.independent=t.bool("INDEPENDENT"),b.relurl=t.enumeratedString("URI"),b.fragment=v,b.index=p;var u=t.enumeratedString("BYTERANGE");return u&&b.setByteRange(u,_),_&&(b.fragOffset=_.fragOffset+_.duration),b}return o(r,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var v=this.elementaryStreams;return!!(v.audio||v.video||v.audiovideo)}}]),r}(a)},"./src/loader/key-loader.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return j});var H=O("./src/events.ts"),I=O("./src/errors.ts"),C=O("./src/utils/logger.ts"),j=function(){function N(w){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=w,this._registerListeners()}var e=N.prototype;return e._registerListeners=function(){this.hls.on(H.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(H.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var g in this.loaders){var f=this.loaders[g];f&&f.destroy()}this.loaders={}},e.onKeyLoading=function(g,f){var o=f.frag,n=o.type,a=this.loaders[n];if(!o.decryptdata){C.logger.warn("Missing decryption data on fragment in onKeyLoading");return}var l=o.decryptdata.uri;if(l!==this.decrypturl||this.decryptkey===null){var s=this.hls.config;if(a&&(C.logger.warn("abort previous key loader for type:"+n),a.abort()),!l){C.logger.warn("key uri is falsy");return}var i=s.loader,r=o.loader=this.loaders[n]=new i(s);this.decrypturl=l,this.decryptkey=null;var t={url:l,frag:o,responseType:"arraybuffer"},v={timeout:s.fragLoadingTimeOut,maxRetry:0,retryDelay:s.fragLoadingRetryDelay,maxRetryDelay:s.fragLoadingMaxRetryTimeout,highWaterMark:0},m={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};r.load(t,v,m)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(H.Events.KEY_LOADED,{frag:o}))},e.loadsuccess=function(g,f,o){var n=o.frag;if(!n.decryptdata){C.logger.error("after key load, decryptdata unset");return}this.decryptkey=n.decryptdata.key=new Uint8Array(g.data),n.loader=null,delete this.loaders[n.type],this.hls.trigger(H.Events.KEY_LOADED,{frag:n})},e.loaderror=function(g,f){var o=f.frag,n=o.loader;n&&n.abort(),delete this.loaders[o.type],this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:g})},e.loadtimeout=function(g,f){var o=f.frag,n=o.loader;n&&n.abort(),delete this.loaders[o.type],this.hls.trigger(H.Events.ERROR,{type:I.ErrorTypes.NETWORK_ERROR,details:I.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},N}()},"./src/loader/level-details.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"LevelDetails",function(){return N});var H=O("./src/polyfills/number.ts");function I(e,w){for(var g=0;g<w.length;g++){var f=w[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}function C(e,w,g){return w&&I(e.prototype,w),g&&I(e,g),e}var j=10,N=function(){function e(g){this.PTSKnown=!1,this.alignedSliding=!1,this.averagetargetduration=void 0,this.endCC=0,this.endSN=0,this.fragments=void 0,this.fragmentHint=void 0,this.partList=null,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,this.needSidxRanges=!1,this.startCC=0,this.startSN=0,this.startTimeOffset=null,this.targetduration=0,this.totalduration=0,this.type=null,this.url=void 0,this.m3u8="",this.version=null,this.canBlockReload=!1,this.canSkipUntil=0,this.canSkipDateRanges=!1,this.skippedSegments=0,this.recentlyRemovedDateranges=void 0,this.partHoldBack=0,this.holdBack=0,this.partTarget=0,this.preloadHint=void 0,this.renditionReports=void 0,this.tuneInGoal=0,this.deltaUpdateFailed=void 0,this.driftStartTime=0,this.driftEndTime=0,this.driftStart=0,this.driftEnd=0,this.fragments=[],this.url=g}var w=e.prototype;return w.reloaded=function(f){if(!f){this.advanced=!0,this.updated=!0;return}var o=this.lastPartSn-f.lastPartSn,n=this.lastPartIndex-f.lastPartIndex;this.updated=this.endSN!==f.endSN||!!n||!!o,this.advanced=this.endSN>f.endSN||o>0||o===0&&n>0,this.updated||this.advanced?this.misses=Math.floor(f.misses*.6):this.misses=f.misses+1,this.availabilityDelay=f.availabilityDelay},C(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(H.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||j}},{key:"drift",get:function(){var f=this.driftEndTime-this.driftStartTime;if(f>0){var o=this.driftEnd-this.driftStart;return o*1e3/f}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var f;return(f=this.fragments)!==null&&f!==void 0&&f.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 f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var f;return(f=this.partList)!==null&&f!==void 0&&f.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"LevelKey",function(){return N});var H=O("./node_modules/url-toolkit/src/url-toolkit.js"),I=O.n(H);function C(e,w){for(var g=0;g<w.length;g++){var f=w[g];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(e,f.key,f)}}function j(e,w,g){return w&&C(e.prototype,w),g&&C(e,g),e}var N=function(){e.fromURL=function(g,f){return new e(g,f)},e.fromURI=function(g){return new e(g)};function e(w,g){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,g?this._uri=Object(H.buildAbsoluteURL)(w,g,{alwaysNormalize:!0}):this._uri=w}return j(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"LoadStats",function(){return H});var H=function(){this.aborted=!1,this.loaded=0,this.retry=0,this.total=0,this.chunkCount=0,this.bwEstimate=0,this.loading={start:0,first:0,end:0},this.parsing={start:0,end:0},this.buffering={start:0,first:0,end:0}}},"./src/loader/m3u8-parser.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return r});var H=O("./src/polyfills/number.ts"),I=O("./node_modules/url-toolkit/src/url-toolkit.js"),C=O.n(I),j=O("./src/loader/fragment.ts"),N=O("./src/loader/level-details.ts"),e=O("./src/loader/level-key.ts"),w=O("./src/utils/attr-list.ts"),g=O("./src/utils/logger.ts"),f=O("./src/utils/codecs.ts"),o=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+/g,n=/#EXT-X-MEDIA:(.*)/g,a=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),l=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(PLAYLIST-TYPE):(.+)/.source,/#EXT-X-(MEDIA-SEQUENCE): *(\d+)/.source,/#EXT-X-(SKIP):(.+)/.source,/#EXT-X-(TARGETDURATION): *(\d+)/.source,/#EXT-X-(KEY):(.+)/.source,/#EXT-X-(START):(.+)/.source,/#EXT-X-(ENDLIST)/.source,/#EXT-X-(DISCONTINUITY-SEQ)UENCE: *(\d+)/.source,/#EXT-X-(DIS)CONTINUITY/.source,/#EXT-X-(VERSION):(\d+)/.source,/#EXT-X-(MAP):(.+)/.source,/#EXT-X-(SERVER-CONTROL):(.+)/.source,/#EXT-X-(PART-INF):(.+)/.source,/#EXT-X-(GAP)/.source,/#EXT-X-(BITRATE):\s*(\d+)/.source,/#EXT-X-(PART):(.+)/.source,/#EXT-X-(PRELOAD-HINT):(.+)/.source,/#EXT-X-(RENDITION-REPORT):(.+)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),s=/\.(mp4|m4s|m4v|m4a)$/i;function i(_){var b,u;return s.test((b=(u=I.parseURL(_))===null||u===void 0?void 0:u.path)!=null?b:"")}var r=function(){function _(){}return _.findGroup=function(u,h){for(var c=0;c<u.length;c++){var d=u[c];if(d.id===h)return d}},_.convertAVC1ToAVCOTI=function(u){var h=u.split(".");if(h.length>2){var c=h.shift()+".";return c+=parseInt(h.shift()).toString(16),c+=("000"+parseInt(h.shift()).toString(16)).substr(-4),c}return u},_.resolve=function(u,h){return I.buildAbsoluteURL(h,u,{alwaysNormalize:!0})},_.parseMasterPlaylist=function(u,h){var c=[],d={},E=!1;o.lastIndex=0;for(var y;(y=o.exec(u))!=null;)if(y[1]){var T=new w.AttrList(y[1]),D={attrs:T,bitrate:T.decimalInteger("AVERAGE-BANDWIDTH")||T.decimalInteger("BANDWIDTH"),name:T.NAME,url:_.resolve(y[2],h)},L=T.decimalResolution("RESOLUTION");L&&(D.width=L.width,D.height=L.height),t((T.CODECS||"").split(/[ ,]+/).filter(function(k){return k}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=_.convertAVC1ToAVCOTI(D.videoCodec)),c.push(D)}else if(y[3]){var x=new w.AttrList(y[3]);x["DATA-ID"]&&(E=!0,d[x["DATA-ID"]]=x)}return{levels:c,sessionData:E?d:null}},_.parseMasterPlaylistMedia=function(u,h,c,d){d===void 0&&(d=[]);var E,y=[],T=0;for(n.lastIndex=0;(E=n.exec(u))!==null;){var D=new w.AttrList(E[1]);if(D.TYPE===c){var L={attrs:D,bitrate:0,id:T++,groupId:D["GROUP-ID"],instreamId:D["INSTREAM-ID"],name:D.NAME||D.LANGUAGE||"",type:c,default:D.bool("DEFAULT"),autoselect:D.bool("AUTOSELECT"),forced:D.bool("FORCED"),lang:D.LANGUAGE,url:D.URI?_.resolve(D.URI,h):""};if(d.length){var x=_.findGroup(d,L.groupId)||d[0];v(L,x,"audioCodec"),v(L,x,"textCodec")}y.push(L)}}return y},_.parseLevelPlaylist=function(u,h,c,d,E){var y=new N.LevelDetails(h),T=y.fragments,D=null,L=0,x=0,k=0,U=0,R=null,V=new j.Fragment(d,h),Z,ue,le,ge=-1,pe=!1;for(a.lastIndex=0,y.m3u8=u;(Z=a.exec(u))!==null;){pe&&(pe=!1,V=new j.Fragment(d,h),V.start=k,V.sn=L,V.cc=U,V.level=c,D&&(V.initSegment=D,V.rawProgramDateTime=D.rawProgramDateTime));var ae=Z[1];if(ae){V.duration=parseFloat(ae);var ne=(" "+Z[2]).slice(1);V.title=ne||null,V.tagList.push(ne?["INF",ae,ne]:["INF",ae])}else if(Z[3])Object(H.isFiniteNumber)(V.duration)&&(V.start=k,le&&(V.levelkey=le),V.sn=L,V.level=c,V.cc=U,V.urlId=E,T.push(V),V.relurl=(" "+Z[3]).slice(1),p(V,R),R=V,k+=V.duration,L++,x=0,pe=!0);else if(Z[4]){var fe=(" "+Z[4]).slice(1);R?V.setByteRange(fe,R):V.setByteRange(fe)}else if(Z[5])V.rawProgramDateTime=(" "+Z[5]).slice(1),V.tagList.push(["PROGRAM-DATE-TIME",V.rawProgramDateTime]),ge===-1&&(ge=T.length);else{if(Z=Z[0].match(l),!Z){g.logger.warn("No matches on slow regex match for level playlist!");continue}for(ue=1;ue<Z.length&&!(typeof Z[ue]!="undefined");ue++);var q=(" "+Z[ue]).slice(1),M=(" "+Z[ue+1]).slice(1),S=Z[ue+2]?(" "+Z[ue+2]).slice(1):"";switch(q){case"PLAYLIST-TYPE":y.type=M.toUpperCase();break;case"MEDIA-SEQUENCE":L=y.startSN=parseInt(M);break;case"SKIP":{var A=new w.AttrList(M),F=A.decimalInteger("SKIPPED-SEGMENTS");if(Object(H.isFiniteNumber)(F)){y.skippedSegments=F;for(var K=F;K--;)T.unshift(null);L+=F}var P=A.enumeratedString("RECENTLY-REMOVED-DATERANGES");P&&(y.recentlyRemovedDateranges=P.split(" "));break}case"TARGETDURATION":y.targetduration=parseFloat(M);break;case"VERSION":y.version=parseInt(M);break;case"EXTM3U":break;case"ENDLIST":y.live=!1;break;case"#":(M||S)&&V.tagList.push(S?[M,S]:[M]);break;case"DIS":U++;case"GAP":V.tagList.push([q]);break;case"BITRATE":V.tagList.push([q,M]);break;case"DISCONTINUITY-SEQ":U=parseInt(M);break;case"KEY":{var re,he=new w.AttrList(M),ye=he.enumeratedString("METHOD"),J=he.URI,se=he.hexadecimalInteger("IV"),me=he.enumeratedString("KEYFORMATVERSIONS"),_e=he.enumeratedString("KEYID"),Ce=(re=he.enumeratedString("KEYFORMAT"))!=null?re:"identity",de=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(de.indexOf(Ce)>-1){g.logger.warn("Keyformat "+Ce+" is not supported from the manifest");continue}else if(Ce!=="identity")continue;ye&&(le=e.LevelKey.fromURL(h,J),J&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(ye)>=0&&(le.method=ye,le.keyFormat=Ce,_e&&(le.keyID=_e),me&&(le.keyFormatVersions=me),le.iv=se));break}case"START":{var Ee=new w.AttrList(M),Te=Ee.decimalFloatingPoint("TIME-OFFSET");Object(H.isFiniteNumber)(Te)&&(y.startTimeOffset=Te);break}case"MAP":{var Se=new w.AttrList(M);V.relurl=Se.URI,Se.BYTERANGE&&V.setByteRange(Se.BYTERANGE),V.level=c,V.sn="initSegment",le&&(V.levelkey=le),V.initSegment=null,D=V,pe=!0;break}case"SERVER-CONTROL":{var we=new w.AttrList(M);y.canBlockReload=we.bool("CAN-BLOCK-RELOAD"),y.canSkipUntil=we.optionalFloat("CAN-SKIP-UNTIL",0),y.canSkipDateRanges=y.canSkipUntil>0&&we.bool("CAN-SKIP-DATERANGES"),y.partHoldBack=we.optionalFloat("PART-HOLD-BACK",0),y.holdBack=we.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ae=new w.AttrList(M);y.partTarget=Ae.decimalFloatingPoint("PART-TARGET");break}case"PART":{var xe=y.partList;xe||(xe=y.partList=[]);var Re=x>0?xe[xe.length-1]:void 0,Ie=x++,Q=new j.Part(new w.AttrList(M),V,h,Ie,Re);xe.push(Q),V.duration+=Q.duration;break}case"PRELOAD-HINT":{var W=new w.AttrList(M);y.preloadHint=W;break}case"RENDITION-REPORT":{var G=new w.AttrList(M);y.renditionReports=y.renditionReports||[],y.renditionReports.push(G);break}default:g.logger.warn("line parsed but not handled: "+Z);break}}}R&&!R.relurl?(T.pop(),k-=R.duration,y.partList&&(y.fragmentHint=R)):y.partList&&(p(V,R),V.cc=U,y.fragmentHint=V);var X=T.length,ee=T[0],Y=T[X-1];if(k+=y.skippedSegments*y.targetduration,k>0&&X&&Y){y.averagetargetduration=k/X;var $=Y.sn;y.endSN=$!=="initSegment"?$:0,ee&&(y.startCC=ee.cc,ee.initSegment||y.fragments.every(function(te){return te.relurl&&i(te.relurl)})&&(g.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),V=new j.Fragment(d,h),V.relurl=Y.relurl,V.level=c,V.sn="initSegment",ee.initSegment=V,y.needSidxRanges=!0))}else y.endSN=0,y.startCC=0;return y.fragmentHint&&(k+=y.fragmentHint.duration),y.totalduration=k,y.endCC=U,ge>0&&m(T,ge),y},_}();function t(_,b){["video","audio","text"].forEach(function(u){var h=_.filter(function(d){return Object(f.isCodecType)(d,u)});if(h.length){var c=h.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});b[u+"Codec"]=c.length>0?c[0]:h[0],_=_.filter(function(d){return h.indexOf(d)===-1})}}),b.unknownCodecs=_}function v(_,b,u){var h=b[u];h&&(_[u]=h)}function m(_,b){for(var u=_[b],h=b;h--;){var c=_[h];if(!c)return;c.programDateTime=u.programDateTime-c.duration*1e3,u=c}}function p(_,b){_.rawProgramDateTime?_.programDateTime=Date.parse(_.rawProgramDateTime):b!=null&&b.programDateTime&&(_.programDateTime=b.endProgramDateTime),Object(H.isFiniteNumber)(_.programDateTime)||(_.programDateTime=null,_.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/polyfills/number.ts"),I=O("./src/events.ts"),C=O("./src/errors.ts"),j=O("./src/utils/logger.ts"),N=O("./src/utils/mp4-tools.ts"),e=O("./src/loader/m3u8-parser.ts"),w=O("./src/types/loader.ts"),g=O("./src/utils/attr-list.ts");function f(a){var l=a.type;switch(l){case w.PlaylistContextType.AUDIO_TRACK:return w.PlaylistLevelType.AUDIO;case w.PlaylistContextType.SUBTITLE_TRACK:return w.PlaylistLevelType.SUBTITLE;default:return w.PlaylistLevelType.MAIN}}function o(a,l){var s=a.url;return(s===void 0||s.indexOf("data:")===0)&&(s=l.url),s}var n=function(){function a(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var l=a.prototype;return l.registerListeners=function(){var i=this.hls;i.on(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(I.Events.LEVEL_LOADING,this.onLevelLoading,this),i.on(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.on(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var i=this.hls;i.off(I.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.off(I.Events.LEVEL_LOADING,this.onLevelLoading,this),i.off(I.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),i.off(I.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(i){var r=this.hls.config,t=r.pLoader,v=r.loader,m=t||v,p=new m(r);return i.loader=p,this.loaders[i.type]=p,p},l.getInternalLoader=function(i){return this.loaders[i.type]},l.resetInternalLoader=function(i){this.loaders[i]&&delete this.loaders[i]},l.destroyInternalLoaders=function(){for(var i in this.loaders){var r=this.loaders[i];r&&r.destroy(),this.resetInternalLoader(i)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(i,r){var t=r.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:w.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},l.onLevelLoading=function(i,r){var t=r.id,v=r.level,m=r.url,p=r.deliveryDirectives;this.load({id:t,groupId:null,level:v,responseType:"text",type:w.PlaylistContextType.LEVEL,url:m,deliveryDirectives:p})},l.onAudioTrackLoading=function(i,r){var t=r.id,v=r.groupId,m=r.url,p=r.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:p})},l.onSubtitleTrackLoading=function(i,r){var t=r.id,v=r.groupId,m=r.url,p=r.deliveryDirectives;this.load({id:t,groupId:v,level:null,responseType:"text",type:w.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:p})},l.load=function(i){var r,t=this.hls.config,v=this.getInternalLoader(i);if(v){var m=v.context;if(m&&m.url===i.url){j.logger.trace("[playlist-loader]: playlist request ongoing");return}j.logger.log("[playlist-loader]: aborting previous loader for type: "+i.type),v.abort()}var p,_,b,u;switch(i.type){case w.PlaylistContextType.MANIFEST:p=t.manifestLoadingMaxRetry,_=t.manifestLoadingTimeOut,b=t.manifestLoadingRetryDelay,u=t.manifestLoadingMaxRetryTimeout;break;case w.PlaylistContextType.LEVEL:case w.PlaylistContextType.AUDIO_TRACK:case w.PlaylistContextType.SUBTITLE_TRACK:p=0,_=t.levelLoadingTimeOut;break;default:p=t.levelLoadingMaxRetry,_=t.levelLoadingTimeOut,b=t.levelLoadingRetryDelay,u=t.levelLoadingMaxRetryTimeout;break}if(v=this.createInternalLoader(i),(r=i.deliveryDirectives)!==null&&r!==void 0&&r.part){var h;if(i.type===w.PlaylistContextType.LEVEL&&i.level!==null?h=this.hls.levels[i.level].details:i.type===w.PlaylistContextType.AUDIO_TRACK&&i.id!==null?h=this.hls.audioTracks[i.id].details:i.type===w.PlaylistContextType.SUBTITLE_TRACK&&i.id!==null&&(h=this.hls.subtitleTracks[i.id].details),h){var c=h.partTarget,d=h.targetduration;c&&d&&(_=Math.min(Math.max(c*3,d*.8)*1e3,_))}}var E={timeout:_,maxRetry:p,retryDelay:b,maxRetryDelay:u,highWaterMark:0},y={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};v.load(i,E,y)},l.loadsuccess=function(i,r,t,v){if(v===void 0&&(v=null),t.isSidxRequest){this.handleSidxRequest(i,t),this.handlePlaylistLoaded(i,r,t,v);return}this.resetInternalLoader(t.type);var m=i.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(i,t,"no EXTM3U delimiter",v);return}r.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(i,r,t,v):this.handleMasterPlaylist(i,r,t,v)},l.loaderror=function(i,r,t){t===void 0&&(t=null),this.handleNetworkError(r,t,!1,i)},l.loadtimeout=function(i,r,t){t===void 0&&(t=null),this.handleNetworkError(r,t,!0)},l.handleMasterPlaylist=function(i,r,t,v){var m=this.hls,p=i.data,_=o(i,t),b=e.default.parseMasterPlaylist(p,_),u=b.levels,h=b.sessionData;if(!u.length){this.handleManifestParsingError(i,t,"no level found in manifest",v);return}var c=u.map(function(L){return{id:L.attrs.AUDIO,audioCodec:L.audioCodec}}),d=u.map(function(L){return{id:L.attrs.SUBTITLES,textCodec:L.textCodec}}),E=e.default.parseMasterPlaylistMedia(p,_,"AUDIO",c),y=e.default.parseMasterPlaylistMedia(p,_,"SUBTITLES",d),T=e.default.parseMasterPlaylistMedia(p,_,"CLOSED-CAPTIONS");if(E.length){var D=E.some(function(L){return!L.url});!D&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(j.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),E.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new g.AttrList({}),bitrate:0,url:""}))}m.trigger(I.Events.MANIFEST_LOADED,{levels:u,audioTracks:E,subtitles:y,captions:T,url:_,stats:r,networkDetails:v,sessionData:h})},l.handleTrackOrLevelPlaylist=function(i,r,t,v){var m=this.hls,p=t.id,_=t.level,b=t.type,u=o(i,t),h=Object(H.isFiniteNumber)(p)?p:0,c=Object(H.isFiniteNumber)(_)?_:h,d=f(t),E=e.default.parseLevelPlaylist(i.data,u,c,d,h);if(!E.fragments.length){m.trigger(I.Events.ERROR,{type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:u,reason:"no fragments found in level",level:typeof t.level=="number"?t.level:void 0});return}if(b===w.PlaylistContextType.MANIFEST){var y={attrs:new g.AttrList({}),bitrate:0,details:E,name:"",url:u};m.trigger(I.Events.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:u,stats:r,networkDetails:v,sessionData:null})}if(r.parsing.end=performance.now(),E.needSidxRanges){var T,D=(T=E.fragments[0].initSegment)===null||T===void 0?void 0:T.url;this.load({url:D,isSidxRequest:!0,type:b,level:_,levelDetails:E,id:p,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=E,this.handlePlaylistLoaded(i,r,t,v)},l.handleSidxRequest=function(i,r){var t=Object(N.parseSegmentIndex)(new Uint8Array(i.data));if(!t)return;var v=t.references,m=r.levelDetails;v.forEach(function(p,_){var b=p.info,u=m.fragments[_];u.byteRange.length===0&&u.setByteRange(String(1+b.end-b.start)+"@"+String(b.start)),u.initSegment&&u.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(i,r,t,v){this.hls.trigger(I.Events.ERROR,{type:C.ErrorTypes.NETWORK_ERROR,details:C.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:r.type===w.PlaylistContextType.MANIFEST,url:i.url,reason:t,response:i,context:r,networkDetails:v})},l.handleNetworkError=function(i,r,t,v){t===void 0&&(t=!1),j.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+i.type+" level: "+i.level+" id: "+i.id+' group-id: "'+i.groupId+'"');var m=C.ErrorDetails.UNKNOWN,p=!1,_=this.getInternalLoader(i);switch(i.type){case w.PlaylistContextType.MANIFEST:m=t?C.ErrorDetails.MANIFEST_LOAD_TIMEOUT:C.ErrorDetails.MANIFEST_LOAD_ERROR,p=!0;break;case w.PlaylistContextType.LEVEL:m=t?C.ErrorDetails.LEVEL_LOAD_TIMEOUT:C.ErrorDetails.LEVEL_LOAD_ERROR,p=!1;break;case w.PlaylistContextType.AUDIO_TRACK:m=t?C.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:C.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,p=!1;break;case w.PlaylistContextType.SUBTITLE_TRACK:m=t?C.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:C.ErrorDetails.SUBTITLE_LOAD_ERROR,p=!1;break}_&&this.resetInternalLoader(i.type);var b={type:C.ErrorTypes.NETWORK_ERROR,details:m,fatal:p,url:i.url,loader:_,context:i,networkDetails:r};v&&(b.response=v),this.hls.trigger(I.Events.ERROR,b)},l.handlePlaylistLoaded=function(i,r,t,v){var m=t.type,p=t.level,_=t.id,b=t.groupId,u=t.loader,h=t.levelDetails,c=t.deliveryDirectives;if(!(h!=null&&h.targetduration)){this.handleManifestParsingError(i,t,"invalid target duration",v);return}if(!u)return;h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),(!u.getCacheAge||isNaN(h.ageHeader))&&(h.ageHeader=0));switch(m){case w.PlaylistContextType.MANIFEST:case w.PlaylistContextType.LEVEL:this.hls.trigger(I.Events.LEVEL_LOADED,{details:h,level:p||0,id:_||0,stats:r,networkDetails:v,deliveryDirectives:c});break;case w.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(I.Events.AUDIO_TRACK_LOADED,{details:h,id:_||0,groupId:b||"",stats:r,networkDetails:v,deliveryDirectives:c});break;case w.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(I.Events.SUBTITLE_TRACK_LOADED,{details:h,id:_||0,groupId:b||"",stats:r,networkDetails:v,deliveryDirectives:c});break}},a}();B.default=n},"./src/polyfills/number.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"isFiniteNumber",function(){return H}),O.d(B,"MAX_SAFE_INTEGER",function(){return I});var H=Number.isFinite||function(C){return typeof C=="number"&&isFinite(C)},I=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(oe,B,O){"use strict";O.r(B);var H=function(){function I(){}return I.getSilentFrame=function(j,N){switch(j){case"mp4a.40.2":if(N===1)return new Uint8Array([0,200,0,128,35,128]);if(N===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(N===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(N===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(N===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(N===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(N===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(N===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(N===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},I}();B.default=H},"./src/remux/mp4-generator.ts":function(oe,B,O){"use strict";O.r(B);var H=Math.pow(2,32)-1,I=function(){function C(){}return C.init=function(){C.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 N;for(N in C.types)C.types.hasOwnProperty(N)&&(C.types[N]=[N.charCodeAt(0),N.charCodeAt(1),N.charCodeAt(2),N.charCodeAt(3)]);var e=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]),w=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]);C.HDLR_TYPES={video:e,audio:w};var g=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),f=new Uint8Array([0,0,0,0,0,0,0,0]);C.STTS=C.STSC=C.STCO=f,C.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),C.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),C.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),C.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),n=new Uint8Array([97,118,99,49]),a=new Uint8Array([0,0,0,1]);C.FTYP=C.box(C.types.ftyp,o,a,o,n),C.DINF=C.box(C.types.dinf,C.box(C.types.dref,g))},C.box=function(N){for(var e=8,w=arguments.length,g=new Array(w>1?w-1:0),f=1;f<w;f++)g[f-1]=arguments[f];for(var o=g.length,n=o;o--;)e+=g[o].byteLength;var a=new Uint8Array(e);for(a[0]=e>>24&255,a[1]=e>>16&255,a[2]=e>>8&255,a[3]=e&255,a.set(N,4),o=0,e=8;o<n;o++)a.set(g[o],e),e+=g[o].byteLength;return a},C.hdlr=function(N){return C.box(C.types.hdlr,C.HDLR_TYPES[N])},C.mdat=function(N){return C.box(C.types.mdat,N)},C.mdhd=function(N,e){e*=N;var w=Math.floor(e/(H+1)),g=Math.floor(e%(H+1));return C.box(C.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,w>>24,w>>16&255,w>>8&255,w&255,g>>24,g>>16&255,g>>8&255,g&255,85,196,0,0]))},C.mdia=function(N){return C.box(C.types.mdia,C.mdhd(N.timescale,N.duration),C.hdlr(N.type),C.minf(N))},C.mfhd=function(N){return C.box(C.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},C.minf=function(N){return N.type==="audio"?C.box(C.types.minf,C.box(C.types.smhd,C.SMHD),C.DINF,C.stbl(N)):C.box(C.types.minf,C.box(C.types.vmhd,C.VMHD),C.DINF,C.stbl(N))},C.moof=function(N,e,w){return C.box(C.types.moof,C.mfhd(N),C.traf(w,e))},C.moov=function(N){for(var e=N.length,w=[];e--;)w[e]=C.trak(N[e]);return C.box.apply(null,[C.types.moov,C.mvhd(N[0].timescale,N[0].duration)].concat(w).concat(C.mvex(N)))},C.mvex=function(N){for(var e=N.length,w=[];e--;)w[e]=C.trex(N[e]);return C.box.apply(null,[C.types.mvex].concat(w))},C.mvhd=function(N,e){e*=N;var w=Math.floor(e/(H+1)),g=Math.floor(e%(H+1)),f=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,N>>24&255,N>>16&255,N>>8&255,N&255,w>>24,w>>16&255,w>>8&255,w&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 C.box(C.types.mvhd,f)},C.sdtp=function(N){var e=N.samples||[],w=new Uint8Array(4+e.length),g,f;for(g=0;g<e.length;g++)f=e[g].flags,w[g+4]=f.dependsOn<<4|f.isDependedOn<<2|f.hasRedundancy;return C.box(C.types.sdtp,w)},C.stbl=function(N){return C.box(C.types.stbl,C.stsd(N),C.box(C.types.stts,C.STTS),C.box(C.types.stsc,C.STSC),C.box(C.types.stsz,C.STSZ),C.box(C.types.stco,C.STCO))},C.avc1=function(N){var e=[],w=[],g,f,o;for(g=0;g<N.sps.length;g++)f=N.sps[g],o=f.byteLength,e.push(o>>>8&255),e.push(o&255),e=e.concat(Array.prototype.slice.call(f));for(g=0;g<N.pps.length;g++)f=N.pps[g],o=f.byteLength,w.push(o>>>8&255),w.push(o&255),w=w.concat(Array.prototype.slice.call(f));var n=C.box(C.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|N.sps.length].concat(e).concat([N.pps.length]).concat(w))),a=N.width,l=N.height,s=N.pixelRatio[0],i=N.pixelRatio[1];return C.box(C.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,a>>8&255,a&255,l>>8&255,l&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]),n,C.box(C.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),C.box(C.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,i>>24,i>>16&255,i>>8&255,i&255])))},C.esds=function(N){var e=N.config.length;return new Uint8Array([0,0,0,0,3,23+e,0,1,0,4,15+e,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([e]).concat(N.config).concat([6,1,2]))},C.mp4a=function(N){var e=N.samplerate;return C.box(C.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]),C.box(C.types.esds,C.esds(N)))},C.mp3=function(N){var e=N.samplerate;return C.box(C.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,N.channelCount,0,16,0,0,0,0,e>>8&255,e&255,0,0]))},C.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?C.box(C.types.stsd,C.STSD,C.mp3(N)):C.box(C.types.stsd,C.STSD,C.mp4a(N)):C.box(C.types.stsd,C.STSD,C.avc1(N))},C.tkhd=function(N){var e=N.id,w=N.duration*N.timescale,g=N.width,f=N.height,o=Math.floor(w/(H+1)),n=Math.floor(w%(H+1));return C.box(C.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,n>>24,n>>16&255,n>>8&255,n&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,f>>8&255,f&255,0,0]))},C.traf=function(N,e){var w=C.sdtp(N),g=N.id,f=Math.floor(e/(H+1)),o=Math.floor(e%(H+1));return C.box(C.types.traf,C.box(C.types.tfhd,new Uint8Array([0,0,0,0,g>>24,g>>16&255,g>>8&255,g&255])),C.box(C.types.tfdt,new Uint8Array([1,0,0,0,f>>24,f>>16&255,f>>8&255,f&255,o>>24,o>>16&255,o>>8&255,o&255])),C.trun(N,w.length+16+20+8+16+8+8),w)},C.trak=function(N){return N.duration=N.duration||4294967295,C.box(C.types.trak,C.tkhd(N),C.mdia(N))},C.trex=function(N){var e=N.id;return C.box(C.types.trex,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},C.trun=function(N,e){var w=N.samples||[],g=w.length,f=12+16*g,o=new Uint8Array(f),n,a,l,s,i,r;for(e+=8+f,o.set([0,0,15,1,g>>>24&255,g>>>16&255,g>>>8&255,g&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),n=0;n<g;n++)a=w[n],l=a.duration,s=a.size,i=a.flags,r=a.cts,o.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,s>>>24&255,s>>>16&255,s>>>8&255,s&255,i.isLeading<<2|i.dependsOn,i.isDependedOn<<6|i.hasRedundancy<<4|i.paddingValue<<1|i.isNonSync,i.degradPrio&240<<8,i.degradPrio&15,r>>>24&255,r>>>16&255,r>>>8&255,r&255],12+16*n);return C.box(C.types.trun,o)},C.initSegment=function(N){C.types||C.init();var e=C.moov(N),w=new Uint8Array(C.FTYP.byteLength+e.byteLength);return w.set(C.FTYP),w.set(e,C.FTYP.byteLength),w},C}();I.types=void 0,I.HDLR_TYPES=void 0,I.STTS=void 0,I.STSC=void 0,I.STCO=void 0,I.STSZ=void 0,I.VMHD=void 0,I.SMHD=void 0,I.STSD=void 0,I.FTYP=void 0,I.DINF=void 0,B.default=I},"./src/remux/mp4-remuxer.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return r}),O.d(B,"normalizePts",function(){return t});var H=O("./src/polyfills/number.ts"),I=O("./src/remux/aac-helper.ts"),C=O("./src/remux/mp4-generator.ts"),j=O("./src/events.ts"),N=O("./src/errors.ts"),e=O("./src/utils/logger.ts"),w=O("./src/types/loader.ts"),g=O("./src/utils/timescale-conversion.ts");function f(){return f=Object.assign||function(_){for(var b=1;b<arguments.length;b++){var u=arguments[b];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(_[h]=u[h])}return _},f.apply(this,arguments)}var o=10*1e3,n=1024,a=1152,l=null,s=null,i=!1,r=function(){function _(u,h,c,d){if(d===void 0&&(d=""),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=void 0,this._initDTS=void 0,this.nextAvcDts=null,this.nextAudioPts=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=u,this.config=h,this.typeSupported=c,this.ISGenerated=!1,l===null){var E=navigator.userAgent||"",y=E.match(/Chrome\/(\d+)/i);l=y?parseInt(y[1]):0}if(s===null){var T=navigator.userAgent.match(/Safari\/(\d+)/i);s=T?parseInt(T[1]):0}i=!!l&&l<75||!!s&&s<600}var b=_.prototype;return b.destroy=function(){},b.resetTimeStamp=function(h){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=h},b.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},b.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},b.getVideoStartPts=function(h){var c=!1,d=h.reduce(function(E,y){var T=y.pts-E;return T<-4294967296?(c=!0,t(E,y.pts)):T>0?E:y.pts},h[0].pts);return c&&e.logger.debug("PTS rollover detected"),d},b.remux=function(h,c,d,E,y,T,D,L){var x,k,U,R,V,Z,ue=y,le=y,ge=h.pid>-1,pe=c.pid>-1,ae=c.samples.length,ne=h.samples.length>0,fe=ae>1,q=(!ge||ne)&&(!pe||fe)||this.ISGenerated||D;if(q){this.ISGenerated||(U=this.generateIS(h,c,y));var M=this.isVideoContiguous,S=-1;if(fe&&(S=v(c.samples),!M&&this.config.forceKeyFrameOnDiscontinuity))if(Z=!0,S>0){e.logger.warn("[mp4-remuxer]: Dropped "+S+" out of "+ae+" video samples due to a missing keyframe");var A=this.getVideoStartPts(c.samples);c.samples=c.samples.slice(S),c.dropped+=S,le+=(c.samples[0].pts-A)/(c.timescale||9e4)}else S===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+ae+" video samples"),Z=!1);if(this.ISGenerated){if(ne&&fe){var F=this.getVideoStartPts(c.samples),K=t(h.samples[0].pts,F)-F,P=K/c.inputTimeScale;ue+=Math.max(0,P),le+=Math.max(0,-P)}if(ne){if(h.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(h,c,y)),k=this.remuxAudio(h,ue,this.isAudioContiguous,T,pe||fe||L===w.PlaylistLevelType.AUDIO?le:void 0),fe){var re=k?k.endPTS-k.startPTS:0;c.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(h,c,y)),x=this.remuxVideo(c,le,M,re)}}else fe&&(x=this.remuxVideo(c,le,M,0));x&&(x.firstKeyFrame=S,x.independent=S!==-1)}}return this.ISGenerated&&(d.samples.length&&(V=this.remuxID3(d,y)),E.samples.length&&(R=this.remuxText(E,y))),{audio:k,video:x,initSegment:U,independent:Z,text:R,id3:V}},b.generateIS=function(h,c,d){var E=h.samples,y=c.samples,T=this.typeSupported,D={},L=!Object(H.isFiniteNumber)(this._initPTS),x="audio/mp4",k,U,R;if(L&&(k=U=Infinity),h.config&&E.length&&(h.timescale=h.samplerate,h.isAAC||(T.mpeg?(x="audio/mpeg",h.codec=""):T.mp3&&(h.codec="mp3")),D.audio={id:"audio",container:x,codec:h.codec,initSegment:!h.isAAC&&T.mpeg?new Uint8Array(0):C.default.initSegment([h]),metadata:{channelCount:h.channelCount}},L&&(R=h.inputTimeScale,k=U=E[0].pts-Math.round(R*d))),c.sps&&c.pps&&y.length&&(c.timescale=c.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:c.codec,initSegment:C.default.initSegment([c]),metadata:{width:c.width,height:c.height}},L)){R=c.inputTimeScale;var V=this.getVideoStartPts(y),Z=Math.round(R*d);U=Math.min(U,t(y[0].dts,V)-Z),k=Math.min(k,V-Z)}if(Object.keys(D).length)return this.ISGenerated=!0,L&&(this._initPTS=k,this._initDTS=U),{tracks:D,initPTS:k,timescale:R}},b.remuxVideo=function(h,c,d,E){var y=h.inputTimeScale,T=h.samples,D=[],L=T.length,x=this._initPTS,k=this.nextAvcDts,U=8,R,V,Z,ue=Number.POSITIVE_INFINITY,le=Number.NEGATIVE_INFINITY,ge=0,pe=!1;if(!d||k===null){var ae=c*y,ne=T[0].pts-t(T[0].dts,T[0].pts);k=ae-ne}for(var fe=0;fe<L;fe++){var q=T[fe];if(q.pts=t(q.pts-x,k),q.dts=t(q.dts-x,k),q.dts>q.pts){var M=9e4*.2;ge=Math.max(Math.min(ge,q.pts-q.dts),-1*M)}q.dts<T[fe>0?fe-1:fe].dts&&(pe=!0)}pe&&T.sort(function(Ge,Ke){var Ue=Ge.dts-Ke.dts,it=Ge.pts-Ke.pts;return Ue||it}),V=T[0].dts,Z=T[T.length-1].dts;var S=Math.round((Z-V)/(L-1));if(ge<0){if(ge<S*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(g.toMsFromMpegTsClock)(-S,!0)+" ms");for(var A=ge,F=0;F<L;F++)T[F].dts=A=Math.max(A,T[F].pts-S),T[F].pts=Math.max(A,T[F].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(g.toMsFromMpegTsClock)(ge,!0)+" ms to overcome this issue");for(var K=0;K<L;K++)T[K].dts=T[K].dts+ge}V=T[0].dts}if(d){var P=V-k,re=P>S,he=P<-1;if(re||he){re?e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(P,!0)+" ms ("+P+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(g.toMsFromMpegTsClock)(-P,!0)+" ms ("+P+"dts) overlapping between fragments detected"),V=k;var ye=T[0].pts-P;T[0].dts=V,T[0].pts=ye,e.logger.log("Video: First PTS/DTS adjusted: "+Object(g.toMsFromMpegTsClock)(ye,!0)+"/"+Object(g.toMsFromMpegTsClock)(V,!0)+", delta: "+Object(g.toMsFromMpegTsClock)(P,!0)+" ms")}}i&&(V=Math.max(0,V));for(var J=0,se=0,me=0;me<L;me++){for(var _e=T[me],Ce=_e.units,de=Ce.length,Ee=0,Te=0;Te<de;Te++)Ee+=Ce[Te].data.length;se+=Ee,J+=de,_e.length=Ee,_e.dts=Math.max(_e.dts,V),_e.pts=Math.max(_e.pts,_e.dts,0),ue=Math.min(_e.pts,ue),le=Math.max(_e.pts,le)}Z=T[L-1].dts;var Se=se+4*J+8,we;try{we=new Uint8Array(Se)}catch(Ge){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:Se,reason:"fail allocating video mdat "+Se});return}var Ae=new DataView(we.buffer);Ae.setUint32(0,Se),we.set(C.default.types.mdat,4);for(var xe=0;xe<L;xe++){for(var Re=T[xe],Ie=Re.units,Q=0,W=0,G=Ie.length;W<G;W++){var X=Ie[W],ee=X.data,Y=X.data.byteLength;Ae.setUint32(U,Y),U+=4,we.set(ee,U),U+=Y,Q+=4+Y}if(xe<L-1)R=T[xe+1].dts-Re.dts;else{var $=this.config,te=Re.dts-T[xe>0?xe-1:xe].dts;if($.stretchShortVideoTrack&&this.nextAudioPts!==null){var ie=Math.floor($.maxBufferHole*y),be=(E?ue+E*y:this.nextAudioPts)-Re.pts;be>ie?(R=be-te,R<0&&(R=te),e.logger.log("[mp4-remuxer]: It is approximately "+be/90+" ms to the next segment; using duration "+R/90+" ms for the last video frame.")):R=te}else R=te}var ve=Math.round(Re.pts-Re.dts);D.push(new m(Re.key,R,Q,ve))}if(D.length&&l&&l<70){var Oe=D[0].flags;Oe.dependsOn=2,Oe.isNonSync=0}console.assert(R!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=k=Z+R,this.isVideoContiguous=!0;var Le=C.default.moof(h.sequenceNumber++,V,f({},h,{samples:D})),Pe="video",ke={data1:Le,data2:we,startPTS:ue/y,endPTS:(le+R)/y,startDTS:V/y,endDTS:k/y,type:Pe,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:h.dropped};return h.samples=[],h.dropped=0,console.assert(we.length,"MDAT length must not be zero"),ke},b.remuxAudio=function(h,c,d,E,y){var T=h.inputTimeScale,D=h.samplerate?h.samplerate:T,L=T/D,x=h.isAAC?n:a,k=x*L,U=this._initPTS,R=!h.isAAC&&this.typeSupported.mpeg,V=[],Z=h.samples,ue=R?0:8,le=this.nextAudioPts||-1,ge=c*T;if(this.isAudioContiguous=d=d||Z.length&&le>0&&(E&&Math.abs(ge-le)<9e3||Math.abs(t(Z[0].pts-U,ge)-le)<20*k),Z.forEach(function(ee){ee.pts=t(ee.pts-U,ge)}),!d||le<0){if(Z=Z.filter(function(ee){return ee.pts>=0}),!Z.length)return;y===0?le=0:E?le=Math.max(0,ge):le=Z[0].pts}if(h.isAAC)for(var pe=y!==void 0,ae=this.config.maxAudioFramesDrift,ne=0,fe=le;ne<Z.length;ne++){var q=Z[ne],M=q.pts,S=M-fe,A=Math.abs(1e3*S/T);if(S<=-ae*k&&pe)ne===0&&(e.logger.warn("Audio frame @ "+(M/T).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*S/T)+" ms."),this.nextAudioPts=le=fe=M);else if(S>=ae*k&&A<o&&pe){var F=Math.round(S/k);fe=M-F*k,fe<0&&(F--,fe+=k),ne===0&&(this.nextAudioPts=le=fe),e.logger.warn("[mp4-remuxer]: Injecting "+F+" audio frame @ "+(fe/T).toFixed(3)+"s due to "+Math.round(1e3*S/T)+" ms gap.");for(var K=0;K<F;K++){var P=Math.max(fe,0),re=I.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);re||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),re=q.unit.subarray()),Z.splice(ne,0,{unit:re,pts:P}),fe+=k,ne++}}q.pts=fe,fe+=k}for(var he=null,ye=null,J,se=0,me=Z.length;me--;)se+=Z[me].unit.byteLength;for(var _e=0,Ce=Z.length;_e<Ce;_e++){var de=Z[_e],Ee=de.unit,Te=de.pts;if(ye!==null){var Se=V[_e-1];Se.duration=Math.round((Te-ye)/L)}else if(d&&h.isAAC&&(Te=le),he=Te,se>0){se+=ue;try{J=new Uint8Array(se)}catch(ee){this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:se,reason:"fail allocating audio mdat "+se});return}if(!R){var we=new DataView(J.buffer);we.setUint32(0,se),J.set(C.default.types.mdat,4)}}else return;J.set(Ee,ue);var Ae=Ee.byteLength;ue+=Ae,V.push(new m(!0,x,Ae,0)),ye=Te}var xe=V.length;if(!xe)return;var Re=V[V.length-1];this.nextAudioPts=le=ye+L*Re.duration;var Ie=R?new Uint8Array(0):C.default.moof(h.sequenceNumber++,he/L,f({},h,{samples:V}));h.samples=[];var Q=he/T,W=le/T,G="audio",X={data1:Ie,data2:J,startPTS:Q,endPTS:W,startDTS:Q,endDTS:W,type:G,hasAudio:!0,hasVideo:!1,nb:xe};return this.isAudioContiguous=!0,console.assert(J.length,"MDAT length must not be zero"),X},b.remuxEmptyAudio=function(h,c,d,E){var y=h.inputTimeScale,T=h.samplerate?h.samplerate:y,D=y/T,L=this.nextAudioPts,x=(L!==null?L:E.startDTS*y)+this._initDTS,k=E.endDTS*y+this._initDTS,U=D*n,R=Math.ceil((k-x)/U),V=I.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!V){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var Z=[],ue=0;ue<R;ue++){var le=x+ue*U;Z.push({unit:V,pts:le,dts:le})}return h.samples=Z,this.remuxAudio(h,c,d,!1)},b.remuxID3=function(h,c){var d=h.samples.length;if(!d)return;for(var E=h.inputTimeScale,y=this._initPTS,T=this._initDTS,D=0;D<d;D++){var L=h.samples[D];L.pts=t(L.pts-y,c*E)/E,L.dts=t(L.dts-T,c*E)/E}var x=h.samples;return h.samples=[],{samples:x}},b.remuxText=function(h,c){var d=h.samples.length;if(!d)return;for(var E=h.inputTimeScale,y=this._initPTS,T=0;T<d;T++){var D=h.samples[T];D.pts=t(D.pts-y,c*E)/E}h.samples.sort(function(x,k){return x.pts-k.pts});var L=h.samples;return h.samples=[],{samples:L}},_}();function t(_,b){var u;if(b===null)return _;for(b<_?u=-8589934592:u=8589934592;Math.abs(_-b)>4294967296;)_+=u;return _}function v(_){for(var b=0;b<_.length;b++)if(_[b].key)return b;return-1}var m=function(b,u,h,c){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=u,this.size=h,this.cts=c,this.flags=new p(b)},p=function(b){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=b?2:1,this.isNonSync=b?0:1}},"./src/remux/passthrough-remuxer.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/polyfills/number.ts"),I=O("./src/utils/mp4-tools.ts"),C=O("./src/loader/fragment.ts"),j=O("./src/utils/logger.ts"),N=function(){function g(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndDTS=null}var f=g.prototype;return f.destroy=function(){},f.resetTimeStamp=function(n){this.initPTS=n,this.lastEndDTS=null},f.resetNextTimestamp=function(){this.lastEndDTS=null},f.resetInitSegment=function(n,a,l){this.audioCodec=a,this.videoCodec=l,this.generateInitSegment(n),this.emitInitSegment=!0},f.generateInitSegment=function(n){var a=this.audioCodec,l=this.videoCodec;if(!n||!n.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(I.parseInitSegment)(n);a||(a=w(s.audio,C.ElementaryStreamTypes.AUDIO)),l||(l=w(s.video,C.ElementaryStreamTypes.VIDEO));var i={};s.audio&&s.video?i.audiovideo={container:"video/mp4",codec:a+","+l,initSegment:n,id:"main"}:s.audio?i.audio={container:"audio/mp4",codec:a,initSegment:n,id:"audio"}:s.video?i.video={container:"video/mp4",codec:l,initSegment:n,id:"main"}:j.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=i},f.remux=function(n,a,l,s,i){var r=this.initPTS,t=this.lastEndDTS,v={audio:void 0,video:void 0,text:s,id3:l,initSegment:void 0};Object(H.isFiniteNumber)(t)||(t=this.lastEndDTS=i||0);var m=a.samples;if(!m||!m.length)return v;var p={initPTS:void 0,timescale:1},_=this.initData;if((!_||!_.length)&&(this.generateInitSegment(m),_=this.initData),!_||!_.length)return j.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),v;this.emitInitSegment&&(p.tracks=this.initTracks,this.emitInitSegment=!1),Object(H.isFiniteNumber)(r)||(this.initPTS=p.initPTS=r=e(_,m,t));var b=Object(I.getDuration)(m,_),u=t,h=b+u;Object(I.offsetStartDTS)(_,m,r),b>0?this.lastEndDTS=h:(j.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var c=!!_.audio,d=!!_.video,E="";c&&(E+="audio"),d&&(E+="video");var y={data1:m,startPTS:u,startDTS:u,endPTS:h,endDTS:h,type:E,hasAudio:c,hasVideo:d,nb:1,dropped:0};return v.audio=y.type==="audio"?y:void 0,v.video=y.type!=="audio"?y:void 0,v.text=s,v.id3=l,v.initSegment=p,v},g}(),e=function(f,o,n){return Object(I.getStartDTS)(f,o)-n};function w(g,f){var o=g==null?void 0:g.codec;return o&&o.length>4?o:o==="hvc1"?"hvc1.1.c.L120.90":o==="av01"?"av01.0.04M.08":o==="avc1"||f===C.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}B.default=N},"./src/task-loop.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return H});var H=function(){function I(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var C=I.prototype;return C.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},C.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},C.onHandlerDestroyed=function(){},C.hasInterval=function(){return!!this._tickInterval},C.hasNextTick=function(){return!!this._tickTimer},C.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},C.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},C.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},C.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},C.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},C.doTick=function(){},I}()},"./src/types/cmcd.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"CMCDVersion",function(){return H}),O.d(B,"CMCDObjectType",function(){return I}),O.d(B,"CMCDStreamingFormat",function(){return C}),O.d(B,"CMCDStreamType",function(){return j});var H=1,I;(function(N){N.MANIFEST="m",N.AUDIO="a",N.VIDEO="v",N.MUXED="av",N.INIT="i",N.CAPTION="c",N.TIMED_TEXT="tt",N.KEY="k",N.OTHER="o"})(I||(I={}));var C;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(C||(C={}));var j;(function(N){N.VOD="v",N.LIVE="l"})(j||(j={}))},"./src/types/level.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"HlsSkip",function(){return C}),O.d(B,"getSkipValue",function(){return j}),O.d(B,"HlsUrlParameters",function(){return N}),O.d(B,"Level",function(){return e});function H(w,g){for(var f=0;f<g.length;f++){var o=g[f];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(w,o.key,o)}}function I(w,g,f){return g&&H(w.prototype,g),f&&H(w,f),w}var C;(function(w){w.No="",w.Yes="YES",w.v2="v2"})(C||(C={}));function j(w,g){var f=w.canSkipUntil,o=w.canSkipDateRanges,n=w.endSN,a=g!==void 0?g-n:0;return f&&a<f?o?C.v2:C.Yes:C.No}var N=function(){function w(f,o,n){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=f,this.part=o,this.skip=n}var g=w.prototype;return g.addDirectives=function(o){var n=new self.URL(o);return this.msn!==void 0&&n.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&n.searchParams.set("_HLS_part",this.part.toString()),this.skip&&n.searchParams.set("_HLS_skip",this.skip),n.toString()},w}(),e=function(){function w(g){this.attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.videoCodec=void 0,this.width=void 0,this.unknownCodecs=void 0,this.audioGroupIds=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.textGroupIds=void 0,this.url=void 0,this._urlId=0,this.url=[g.url],this.attrs=g.attrs,this.bitrate=g.bitrate,g.details&&(this.details=g.details),this.id=g.id||0,this.name=g.name,this.width=g.width||0,this.height=g.height||0,this.audioCodec=g.audioCodec,this.videoCodec=g.videoCodec,this.unknownCodecs=g.unknownCodecs,this.codecSet=[g.videoCodec,g.audioCodec].filter(function(f){return f}).join(",").replace(/\.[^.,]+/g,"")}return I(w,[{key:"maxBitrate",get:function(){return Math.max(this.realBitrate,this.bitrate)}},{key:"uri",get:function(){return this.url[this._urlId]||""}},{key:"urlId",get:function(){return this._urlId},set:function(f){var o=f%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),w}()},"./src/types/loader.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"PlaylistContextType",function(){return H}),O.d(B,"PlaylistLevelType",function(){return I});var H;(function(C){C.MANIFEST="manifest",C.LEVEL="level",C.AUDIO_TRACK="audioTrack",C.SUBTITLE_TRACK="subtitleTrack"})(H||(H={}));var I;(function(C){C.MAIN="main",C.AUDIO="audio",C.SUBTITLE="subtitle"})(I||(I={}))},"./src/types/transmuxer.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"ChunkMetadata",function(){return H});var H=function(j,N,e,w,g,f){w===void 0&&(w=0),g===void 0&&(g=-1),f===void 0&&(f=!1),this.level=void 0,this.sn=void 0,this.part=void 0,this.id=void 0,this.size=void 0,this.partial=void 0,this.transmuxing=I(),this.buffering={audio:I(),video:I(),audiovideo:I()},this.level=j,this.sn=N,this.id=e,this.size=w,this.part=g,this.partial=f};function I(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"AttrList",function(){return C});var H=/^(\d+)x(\d+)$/,I=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,C=function(){function j(e){typeof e=="string"&&(e=j.parseAttrList(e));for(var w in e)e.hasOwnProperty(w)&&(this[w]=e[w])}var N=j.prototype;return N.decimalInteger=function(w){var g=parseInt(this[w],10);return g>Number.MAX_SAFE_INTEGER?Infinity:g},N.hexadecimalInteger=function(w){if(this[w]){var g=(this[w]||"0x").slice(2);g=(g.length&1?"0":"")+g;for(var f=new Uint8Array(g.length/2),o=0;o<g.length/2;o++)f[o]=parseInt(g.slice(o*2,o*2+2),16);return f}else return null},N.hexadecimalIntegerAsNumber=function(w){var g=parseInt(this[w],16);return g>Number.MAX_SAFE_INTEGER?Infinity:g},N.decimalFloatingPoint=function(w){return parseFloat(this[w])},N.optionalFloat=function(w,g){var f=this[w];return f?parseFloat(f):g},N.enumeratedString=function(w){return this[w]},N.bool=function(w){return this[w]==="YES"},N.decimalResolution=function(w){var g=H.exec(this[w]);return g===null?void 0:{width:parseInt(g[1],10),height:parseInt(g[2],10)}},j.parseAttrList=function(w){var g,f={},o='"';for(I.lastIndex=0;(g=I.exec(w))!==null;){var n=g[2];n.indexOf(o)===0&&n.lastIndexOf(o)===n.length-1&&(n=n.slice(1,-1)),f[g[1]]=n}return f},j}()},"./src/utils/binary-search.ts":function(oe,B,O){"use strict";O.r(B);var H={search:function(C,j){for(var N=0,e=C.length-1,w=null,g=null;N<=e;){w=(N+e)/2|0,g=C[w];var f=j(g);if(f>0)N=w+1;else if(f<0)e=w-1;else return g}return null}};B.default=H},"./src/utils/buffer-helper.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"BufferHelper",function(){return C});var H=O("./src/utils/logger.ts"),I={length:0,start:function(){return 0},end:function(){return 0}},C=function(){function j(){}return j.isBuffered=function(e,w){try{if(e){for(var g=j.getBuffered(e),f=0;f<g.length;f++)if(w>=g.start(f)&&w<=g.end(f))return!0}}catch(o){}return!1},j.bufferInfo=function(e,w,g){try{if(e){var f=j.getBuffered(e),o=[],n;for(n=0;n<f.length;n++)o.push({start:f.start(n),end:f.end(n)});return this.bufferedInfo(o,w,g)}}catch(a){}return{len:0,start:w,end:w,nextStart:void 0}},j.bufferedInfo=function(e,w,g){w=Math.max(0,w),e.sort(function(p,_){var b=p.start-_.start;return b||_.end-p.end});var f=[];if(g)for(var o=0;o<e.length;o++){var n=f.length;if(n){var a=f[n-1].end;e[o].start-a<g?e[o].end>a&&(f[n-1].end=e[o].end):f.push(e[o])}else f.push(e[o])}else f=e;for(var l=0,s,i=w,r=w,t=0;t<f.length;t++){var v=f[t].start,m=f[t].end;if(w+g>=v&&w<m)i=v,r=m,l=r-w;else if(w+g<v){s=v;break}}return{len:l,start:i||0,end:r||0,nextStart:s}},j.getBuffered=function(e){try{return e.buffered}catch(w){return H.logger.log("failed to get media.buffered",w),I}},j}()},"./src/utils/cea-608-parser.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"Row",function(){return r}),O.d(B,"CaptionScreen",function(){return t});var H=O("./src/utils/logger.ts"),I={42:225,92:233,94:237,95:243,96:250,123:231,124:247,125:209,126:241,127:9608,128:174,129:176,130:189,131:191,132:8482,133:162,134:163,135:9834,136:224,137:32,138:232,139:226,140:234,141:238,142:244,143:251,144:193,145:201,146:211,147:218,148:220,149:252,150:8216,151:161,152:42,153:8217,154:9473,155:169,156:8480,157:8226,158:8220,159:8221,160:192,161:194,162:199,163:200,164:202,165:203,166:235,167:206,168:207,169:239,170:212,171:217,172:249,173:219,174:171,175:187,176:195,177:227,178:205,179:204,180:236,181:210,182:242,183:213,184:245,185:123,186:125,187:92,188:94,189:95,190:124,191:8764,192:196,193:228,194:214,195:246,196:223,197:165,198:164,199:9475,200:197,201:229,202:216,203:248,204:9487,205:9491,206:9495,207:9499},C=function(h){var c=h;return I.hasOwnProperty(h)&&(c=I[h]),String.fromCharCode(c)},j=15,N=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},w={17:2,18:4,21:6,22:8,23:10,19:13,20:15},g={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},f={25:2,26:4,29:6,30:8,31:10,27:13,28:15},o=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],n;(function(u){u[u.ERROR=0]="ERROR",u[u.TEXT=1]="TEXT",u[u.WARNING=2]="WARNING",u[u.INFO=2]="INFO",u[u.DEBUG=3]="DEBUG",u[u.DATA=3]="DATA"})(n||(n={}));var a=function(){function u(){this.time=null,this.verboseLevel=n.ERROR}var h=u.prototype;return h.log=function(d,E){this.verboseLevel>=d&&H.logger.log(this.time+" ["+d+"] "+E)},u}(),l=function(h){for(var c=[],d=0;d<h.length;d++)c.push(h[d].toString(16));return c},s=function(){function u(c,d,E,y,T){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=c||"white",this.underline=d||!1,this.italics=E||!1,this.background=y||"black",this.flash=T||!1}var h=u.prototype;return h.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},h.setStyles=function(d){for(var E=["foreground","underline","italics","background","flash"],y=0;y<E.length;y++){var T=E[y];d.hasOwnProperty(T)&&(this[T]=d[T])}},h.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},h.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},h.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},h.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},u}(),i=function(){function u(c,d,E,y,T,D){this.uchar=void 0,this.penState=void 0,this.uchar=c||" ",this.penState=new s(d,E,y,T,D)}var h=u.prototype;return h.reset=function(){this.uchar=" ",this.penState.reset()},h.setChar=function(d,E){this.uchar=d,this.penState.copy(E)},h.setPenState=function(d){this.penState.copy(d)},h.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},h.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},h.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},u}(),r=function(){function u(c){this.chars=void 0,this.pos=void 0,this.currPenState=void 0,this.cueStartTime=void 0,this.logger=void 0,this.chars=[];for(var d=0;d<N;d++)this.chars.push(new i);this.logger=c,this.pos=0,this.currPenState=new s}var h=u.prototype;return h.equals=function(d){for(var E=!0,y=0;y<N;y++)if(!this.chars[y].equals(d.chars[y])){E=!1;break}return E},h.copy=function(d){for(var E=0;E<N;E++)this.chars[E].copy(d.chars[E])},h.isEmpty=function(){for(var d=!0,E=0;E<N;E++)if(!this.chars[E].isEmpty()){d=!1;break}return d},h.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(n.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(n.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},h.moveCursor=function(d){var E=this.pos+d;if(d>1)for(var y=this.pos+1;y<E+1;y++)this.chars[y].setPenState(this.currPenState);this.setCursor(E)},h.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},h.insertChar=function(d){d>=144&&this.backSpace();var E=C(d);if(this.pos>=N){this.logger.log(n.ERROR,"Cannot insert "+d.toString(16)+" ("+E+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(E,this.currPenState),this.moveCursor(1)},h.clearFromPos=function(d){var E;for(E=d;E<N;E++)this.chars[E].reset()},h.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},h.clearToEndOfRow=function(){this.clearFromPos(this.pos)},h.getTextString=function(){for(var d=[],E=!0,y=0;y<N;y++){var T=this.chars[y].uchar;T!==" "&&(E=!1),d.push(T)}return E?"":d.join("")},h.setPenStyles=function(d){this.currPenState.setStyles(d);var E=this.chars[this.pos];E.setPenState(this.currPenState)},u}(),t=function(){function u(c){this.rows=void 0,this.currRow=void 0,this.nrRollUpRows=void 0,this.lastOutputScreen=void 0,this.logger=void 0,this.rows=[];for(var d=0;d<j;d++)this.rows.push(new r(c));this.logger=c,this.currRow=j-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var h=u.prototype;return h.reset=function(){for(var d=0;d<j;d++)this.rows[d].clear();this.currRow=j-1},h.equals=function(d){for(var E=!0,y=0;y<j;y++)if(!this.rows[y].equals(d.rows[y])){E=!1;break}return E},h.copy=function(d){for(var E=0;E<j;E++)this.rows[E].copy(d.rows[E])},h.isEmpty=function(){for(var d=!0,E=0;E<j;E++)if(!this.rows[E].isEmpty()){d=!1;break}return d},h.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},h.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},h.insertChar=function(d){var E=this.rows[this.currRow];E.insertChar(d)},h.setPen=function(d){var E=this.rows[this.currRow];E.setPenStyles(d)},h.moveCursor=function(d){var E=this.rows[this.currRow];E.moveCursor(d)},h.setCursor=function(d){this.logger.log(n.INFO,"setCursor: "+d);var E=this.rows[this.currRow];E.setCursor(d)},h.setPAC=function(d){this.logger.log(n.INFO,"pacData = "+JSON.stringify(d));var E=d.row-1;if(this.nrRollUpRows&&E<this.nrRollUpRows-1&&(E=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==E){for(var y=0;y<j;y++)this.rows[y].clear();var T=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var L=D.rows[T].cueStartTime,x=this.logger.time;if(L&&x!==null&&L<x)for(var k=0;k<this.nrRollUpRows;k++)this.rows[E-this.nrRollUpRows+k+1].copy(D.rows[T+k])}}this.currRow=E;var U=this.rows[this.currRow];if(d.indent!==null){var R=d.indent,V=Math.max(R-1,0);U.setCursor(d.indent),d.color=U.chars[V].penState.foreground}var Z={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(Z)},h.setBkgData=function(d){this.logger.log(n.INFO,"bkgData = "+JSON.stringify(d)),this.backSpace(),this.setPen(d),this.insertChar(32)},h.setRollUpRows=function(d){this.nrRollUpRows=d},h.rollUp=function(){if(this.nrRollUpRows===null){this.logger.log(n.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(n.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,E=this.rows.splice(d,1)[0];E.clear(),this.rows.splice(this.currRow,0,E),this.logger.log(n.INFO,"Rolling up")},h.getDisplayText=function(d){d=d||!1;for(var E=[],y="",T=-1,D=0;D<j;D++){var L=this.rows[D].getTextString();L&&(T=D+1,d?E.push("Row "+T+": '"+L+"'"):E.push(L.trim()))}return E.length>0&&(d?y="["+E.join(" | ")+"]":y=E.join(`
`)),y},h.getTextAndFormat=function(){return this.rows},u}(),v=function(){function u(c,d,E){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=c,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new t(E),this.nonDisplayedMemory=new t(E),this.lastOutputScreen=new t(E),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=E}var h=u.prototype;return h.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[j-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},h.getHandler=function(){return this.outputFilter},h.setHandler=function(d){this.outputFilter=d},h.setPAC=function(d){this.writeScreen.setPAC(d)},h.setBkgData=function(d){this.writeScreen.setBkgData(d)},h.setMode=function(d){if(d===this.mode)return;this.mode=d,this.logger.log(n.INFO,"MODE="+d),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=d},h.insertChars=function(d){for(var E=0;E<d.length;E++)this.writeScreen.insertChar(d[E]);var y=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(n.INFO,y+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(n.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},h.ccRCL=function(){this.logger.log(n.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},h.ccBS=function(){if(this.logger.log(n.INFO,"BS - BackSpace"),this.mode==="MODE_TEXT")return;this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate()},h.ccAOF=function(){},h.ccAON=function(){},h.ccDER=function(){this.logger.log(n.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},h.ccRU=function(d){this.logger.log(n.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},h.ccFON=function(){this.logger.log(n.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},h.ccRDC=function(){this.logger.log(n.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},h.ccTR=function(){this.logger.log(n.INFO,"TR"),this.setMode("MODE_TEXT")},h.ccRTD=function(){this.logger.log(n.INFO,"RTD"),this.setMode("MODE_TEXT")},h.ccEDM=function(){this.logger.log(n.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},h.ccCR=function(){this.logger.log(n.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},h.ccENM=function(){this.logger.log(n.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},h.ccEOC=function(){if(this.logger.log(n.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var d=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=d,this.writeScreen=this.nonDisplayedMemory,this.logger.log(n.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},h.ccTO=function(d){this.logger.log(n.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},h.ccMIDROW=function(d){var E={flash:!1};if(E.underline=d%2===1,E.italics=d>=46,E.italics)E.foreground="white";else{var y=Math.floor(d/2)-16,T=["white","green","blue","cyan","red","yellow","magenta"];E.foreground=T[y]}this.logger.log(n.INFO,"MIDROW: "+JSON.stringify(E)),this.writeScreen.setPen(E)},h.outputDataUpdate=function(d){d===void 0&&(d=!1);var E=this.logger.time;if(E===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=E:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,E,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:E),this.lastOutputScreen.copy(this.displayedMemory))},h.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},u}(),m=function(){function u(c,d,E){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var y=new a;this.channels=[null,new v(c,d,y),new v(c+1,E,y)],this.cmdHistory=b(),this.logger=y}var h=u.prototype;return h.getHandler=function(d){return this.channels[d].getHandler()},h.setHandler=function(d,E){this.channels[d].setHandler(E)},h.addData=function(d,E){var y,T,D,L=!1;this.logger.time=d;for(var x=0;x<E.length;x+=2){if(T=E[x]&127,D=E[x+1]&127,T===0&&D===0)continue;if(this.logger.log(n.DATA,"["+l([E[x],E[x+1]])+"] -> ("+l([T,D])+")"),y=this.parseCmd(T,D),y||(y=this.parseMidrow(T,D)),y||(y=this.parsePAC(T,D)),y||(y=this.parseBackgroundAttributes(T,D)),!y&&(L=this.parseChars(T,D),L)){var k=this.currentChannel;if(k&&k>0){var U=this.channels[k];U.insertChars(L)}else this.logger.log(n.WARNING,"No channel found yet. TEXT-MODE?")}!y&&!L&&this.logger.log(n.WARNING,"Couldn't parse cleaned data "+l([T,D])+" orig: "+l([E[x],E[x+1]]))}},h.parseCmd=function(d,E){var y=this.cmdHistory,T=(d===20||d===28||d===21||d===29)&&E>=32&&E<=47,D=(d===23||d===31)&&E>=33&&E<=35;if(!(T||D))return!1;if(_(d,E,y))return p(null,null,y),this.logger.log(n.DEBUG,"Repeated command ("+l([d,E])+") is dropped"),!0;var L=d===20||d===21||d===23?1:2,x=this.channels[L];return d===20||d===21||d===28||d===29?E===32?x.ccRCL():E===33?x.ccBS():E===34?x.ccAOF():E===35?x.ccAON():E===36?x.ccDER():E===37?x.ccRU(2):E===38?x.ccRU(3):E===39?x.ccRU(4):E===40?x.ccFON():E===41?x.ccRDC():E===42?x.ccTR():E===43?x.ccRTD():E===44?x.ccEDM():E===45?x.ccCR():E===46?x.ccENM():E===47&&x.ccEOC():x.ccTO(E-32),p(d,E,y),this.currentChannel=L,!0},h.parseMidrow=function(d,E){var y=0;if((d===17||d===25)&&E>=32&&E<=47){if(d===17?y=1:y=2,y!==this.currentChannel)return this.logger.log(n.ERROR,"Mismatch channel in midrow parsing"),!1;var T=this.channels[y];return T?(T.ccMIDROW(E),this.logger.log(n.DEBUG,"MIDROW ("+l([d,E])+")"),!0):!1}return!1},h.parsePAC=function(d,E){var y,T=this.cmdHistory,D=(d>=17&&d<=23||d>=25&&d<=31)&&E>=64&&E<=127,L=(d===16||d===24)&&E>=64&&E<=95;if(!(D||L))return!1;if(_(d,E,T))return p(null,null,T),!0;var x=d<=23?1:2;E>=64&&E<=95?y=x===1?e[d]:g[d]:y=x===1?w[d]:f[d];var k=this.channels[x];return k?(k.setPAC(this.interpretPAC(y,E)),p(d,E,T),this.currentChannel=x,!0):!1},h.interpretPAC=function(d,E){var y,T={color:null,italics:!1,indent:null,underline:!1,row:d};return E>95?y=E-96:y=E-64,T.underline=(y&1)===1,y<=13?T.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(y/2)]:y<=15?(T.italics=!0,T.color="white"):T.indent=Math.floor((y-16)/2)*4,T},h.parseChars=function(d,E){var y,T=null,D=null;if(d>=25?(y=2,D=d-8):(y=1,D=d),D>=17&&D<=19){var L;D===17?L=E+80:D===18?L=E+112:L=E+144,this.logger.log(n.INFO,"Special char '"+C(L)+"' in channel "+y),T=[L]}else d>=32&&d<=127&&(T=E===0?[d]:[d,E]);if(T){var x=l(T);this.logger.log(n.DEBUG,"Char codes = "+x.join(",")),p(d,E,this.cmdHistory)}return T},h.parseBackgroundAttributes=function(d,E){var y=(d===16||d===24)&&E>=32&&E<=47,T=(d===23||d===31)&&E>=45&&E<=47;if(!(y||T))return!1;var D,L={};d===16||d===24?(D=Math.floor((E-32)/2),L.background=o[D],E%2===1&&(L.background=L.background+"_semi")):E===45?L.background="transparent":(L.foreground="black",E===47&&(L.underline=!0));var x=d<=23?1:2,k=this.channels[x];return k.setBkgData(L),p(d,E,this.cmdHistory),!0},h.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var E=this.channels[d];E&&E.reset()}this.cmdHistory=b()},h.cueSplitAtTime=function(d){for(var E=0;E<this.channels.length;E++){var y=this.channels[E];y&&y.cueSplitAtTime(d)}},u}();function p(u,h,c){c.a=u,c.b=h}function _(u,h,c){return c.a===u&&c.b===h}function b(){return{a:null,b:null}}B.default=m},"./src/utils/codecs.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"isCodecType",function(){return I}),O.d(B,"isCodecSupportedInMp4",function(){return C});var H={audio:{a3ds:!0,"ac-3":!0,"ac-4":!0,alac:!0,alaw:!0,dra1:!0,"dts+":!0,"dts-":!0,dtsc:!0,dtse:!0,dtsh:!0,"ec-3":!0,enca:!0,g719:!0,g726:!0,m4ae:!0,mha1:!0,mha2:!0,mhm1:!0,mhm2:!0,mlpa:!0,mp4a:!0,"raw ":!0,Opus:!0,samr:!0,sawb:!0,sawp:!0,sevc:!0,sqcp:!0,ssmv:!0,twos:!0,ulaw:!0},video:{avc1:!0,avc2:!0,avc3:!0,avc4:!0,avcp:!0,av01:!0,drac:!0,dvav:!0,dvhe:!0,encv:!0,hev1:!0,hvc1:!0,mjp2:!0,mp4v:!0,mvc1:!0,mvc2:!0,mvc3:!0,mvc4:!0,resv:!0,rv60:!0,s263:!0,svc1:!0,svc2:!0,"vc-1":!0,vp08:!0,vp09:!0},text:{stpp:!0,wvtt:!0}};function I(j,N){var e=H[N];return!!e&&e[j.slice(0,4)]===!0}function C(j,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+j+'"')}},"./src/utils/cues.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/utils/vttparser.ts"),I=O("./src/utils/webvtt-parser.ts"),C=O("./src/utils/texttrack-utils.ts"),j=/\s/,N={newCue:function(w,g,f,o){for(var n=[],a,l,s,i,r,t=self.VTTCue||self.TextTrackCue,v=0;v<o.rows.length;v++)if(a=o.rows[v],s=!0,i=0,r="",!a.isEmpty()){for(var m=0;m<a.chars.length;m++)j.test(a.chars[m].uchar)&&s?i++:(r+=a.chars[m].uchar,s=!1);a.cueStartTime=g,g===f&&(f+=1e-4),i>=16?i--:i++;var p=Object(H.fixLineBreaks)(r.trim()),_=Object(I.generateCueId)(g,f,p);(!w||!w.cues||!w.cues.getCueById(_))&&(l=new t(g,f,p),l.id=_,l.line=v+1,l.align="left",l.position=10+Math.min(80,Math.floor(i*8/32)*10),n.push(l))}return w&&n.length&&(n.sort(function(b,u){return b.line==="auto"||u.line==="auto"?0:b.line>8&&u.line>8?u.line-b.line:b.line-u.line}),n.forEach(function(b){return Object(C.addCueToTrack)(w,b)})),n}};B.default=N},"./src/utils/discontinuities.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"findFirstFragWithCC",function(){return j}),O.d(B,"shouldAlignOnDiscontinuities",function(){return N}),O.d(B,"findDiscontinuousReferenceFrag",function(){return e}),O.d(B,"adjustSlidingStart",function(){return g}),O.d(B,"alignStream",function(){return f}),O.d(B,"alignPDT",function(){return n}),O.d(B,"alignFragmentByPDTDelta",function(){return a}),O.d(B,"alignMediaPlaylistByPDT",function(){return l});var H=O("./src/polyfills/number.ts"),I=O("./src/utils/logger.ts"),C=O("./src/controller/level-helper.ts");function j(s,i){for(var r=null,t=0,v=s.length;t<v;t++){var m=s[t];if(m&&m.cc===i){r=m;break}}return r}function N(s,i,r){return!!(i.details&&(r.endCC>r.startCC||s&&s.cc<r.startCC))}function e(s,i){var r=s.fragments,t=i.fragments;if(!t.length||!r.length){I.logger.log("No fragments to align");return}var v=j(r,t[0].cc);if(!v||v&&!v.startPTS){I.logger.log("No frag in previous level to align on");return}return v}function w(s,i){if(s){var r=s.start+i;s.start=s.startPTS=r,s.endPTS=r+s.duration}}function g(s,i){for(var r=i.fragments,t=0,v=r.length;t<v;t++)w(r[t],s);i.fragmentHint&&w(i.fragmentHint,s),i.alignedSliding=!0}function f(s,i,r){if(!i)return;o(s,r,i),!r.alignedSliding&&i.details&&n(r,i.details),!r.alignedSliding&&i.details&&!r.skippedSegments&&Object(C.adjustSliding)(i.details,r)}function o(s,i,r){if(N(s,r,i)){var t=e(r.details,i);t&&Object(H.isFiniteNumber)(t.start)&&(I.logger.log("Adjusting PTS using last level due to CC increase within current level "+i.url),g(t.start,i))}}function n(s,i){if(!i.fragments.length||!s.hasProgramDateTime||!i.hasProgramDateTime)return;var r=i.fragments[0].programDateTime,t=s.fragments[0].programDateTime,v=(t-r)/1e3+i.fragments[0].start;v&&Object(H.isFiniteNumber)(v)&&(I.logger.log("Adjusting PTS using programDateTime delta "+(t-r)+"ms, sliding:"+v.toFixed(3)+" "+s.url+" "),g(v,s))}function a(s,i){var r=s.programDateTime;if(!r)return;var t=(r-i)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function l(s,i){if(!i.fragments.length||!s.hasProgramDateTime||!i.hasProgramDateTime)return;var r=i.fragments[0].programDateTime,t=i.fragments[0].start,v=r-t*1e3;s.fragments.forEach(function(m){a(m,v)}),s.fragmentHint&&a(s.fragmentHint,v),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/utils/ewma.ts"),I=function(){function C(N,e,w){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=w,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new H.default(N),this.fast_=new H.default(e)}var j=C.prototype;return j.update=function(e,w){var g=this.slow_,f=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new H.default(e,g.getEstimate(),g.getTotalWeight())),this.fast_.halfLife!==w&&(this.fast_=new H.default(w,f.getEstimate(),f.getTotalWeight()))},j.sample=function(e,w){e=Math.max(e,this.minDelayMs_);var g=8*w,f=e/1e3,o=g/f;this.fast_.sample(f,o),this.slow_.sample(f,o)},j.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},j.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},j.destroy=function(){},C}();B.default=I},"./src/utils/ewma.ts":function(oe,B,O){"use strict";O.r(B);var H=function(){function I(j,N,e){N===void 0&&(N=0),e===void 0&&(e=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=j,this.alpha_=j?Math.exp(Math.log(.5)/j):0,this.estimate_=N,this.totalWeight_=e}var C=I.prototype;return C.sample=function(N,e){var w=Math.pow(this.alpha_,N);this.estimate_=e*(1-w)+w*this.estimate_,this.totalWeight_+=N},C.getTotalWeight=function(){return this.totalWeight_},C.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},I}();B.default=H},"./src/utils/fetch-loader.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"fetchSupported",function(){return a});var H=O("./src/polyfills/number.ts"),I=O("./src/loader/load-stats.ts"),C=O("./src/demux/chunk-cache.ts");function j(t,v){t.prototype=Object.create(v.prototype),t.prototype.constructor=t,f(t,v)}function N(t){var v=typeof Map=="function"?new Map:void 0;return N=function(p){if(p===null||!g(p))return p;if(typeof p!="function")throw new TypeError("Super expression must either be null or a function");if(typeof v!="undefined"){if(v.has(p))return v.get(p);v.set(p,_)}function _(){return e(p,arguments,o(this).constructor)}return _.prototype=Object.create(p.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),f(_,p)},N(t)}function e(t,v,m){return w()?e=Reflect.construct:e=function(_,b,u){var h=[null];h.push.apply(h,b);var c=Function.bind.apply(_,h),d=new c;return u&&f(d,u.prototype),d},e.apply(null,arguments)}function w(){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(t){return!1}}function g(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function f(t,v){return f=Object.setPrototypeOf||function(p,_){return p.__proto__=_,p},f(t,v)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},o(t)}function n(){return n=Object.assign||function(t){for(var v=1;v<arguments.length;v++){var m=arguments[v];for(var p in m)Object.prototype.hasOwnProperty.call(m,p)&&(t[p]=m[p])}return t},n.apply(this,arguments)}function a(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(t){}return!1}var l=function(){function t(m){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=void 0,this.response=void 0,this.controller=void 0,this.context=void 0,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=m.fetchSetup||i,this.controller=new self.AbortController,this.stats=new I.LoadStats}var v=t.prototype;return v.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},v.abortInternal=function(){var p=this.response;(!p||!p.ok)&&(this.stats.aborted=!0,this.controller.abort())},v.abort=function(){var p;this.abortInternal(),(p=this.callbacks)!==null&&p!==void 0&&p.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},v.load=function(p,_,b){var u=this,h=this.stats;if(h.loading.start)throw new Error("Loader can only be used once.");h.loading.start=self.performance.now();var c=s(p,this.controller.signal),d=b.onProgress,E=p.responseType==="arraybuffer",y=E?"byteLength":"length";this.context=p,this.config=_,this.callbacks=b,this.request=this.fetchSetup(p,c),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){u.abortInternal(),b.onTimeout(h,p,u.response)},_.timeout),self.fetch(this.request).then(function(T){if(u.response=u.loader=T,!T.ok){var D=T.status,L=T.statusText;throw new r(L||"fetch, bad network response",D,T)}return h.loading.first=Math.max(self.performance.now(),h.loading.start),h.total=parseInt(T.headers.get("Content-Length")||"0"),d&&Object(H.isFiniteNumber)(_.highWaterMark)?u.loadProgressively(T,h,p,_.highWaterMark,d):E?T.arrayBuffer():T.text()}).then(function(T){var D=u.response;self.clearTimeout(u.requestTimeout),h.loading.end=Math.max(self.performance.now(),h.loading.first),h.loaded=h.total=T[y];var L={url:D.url,data:T};d&&!Object(H.isFiniteNumber)(_.highWaterMark)&&d(h,p,T,D),b.onSuccess(L,h,p,D)}).catch(function(T){if(self.clearTimeout(u.requestTimeout),h.aborted)return;var D=T.code||0;b.onError({code:D,text:T.message},p,T.details)})},v.getCacheAge=function(){var p=null;if(this.response){var _=this.response.headers.get("age");p=_?parseFloat(_):null}return p},v.loadProgressively=function(p,_,b,u,h){u===void 0&&(u=0);var c=new C.default,d=p.body.getReader(),E=function y(){return d.read().then(function(T){if(T.done)return c.dataLength&&h(_,b,c.flush(),p),Promise.resolve(new ArrayBuffer(0));var D=T.value,L=D.length;return _.loaded+=L,L<u||c.dataLength?(c.push(D),c.dataLength>=u&&h(_,b,c.flush(),p)):h(_,b,D,p),y()}).catch(function(){return Promise.reject()})};return E()},t}();function s(t,v){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:v,headers:new self.Headers(n({},t.headers))};return t.rangeEnd&&m.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),m}function i(t,v){return new self.Request(t.url,v)}var r=function(t){j(v,t);function v(m,p,_){var b;return b=t.call(this,m)||this,b.code=void 0,b.details=void 0,b.code=p,b.details=_,b}return v}(N(Error));B.default=l},"./src/utils/imsc1-ttml-parser.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"IMSC1_CODEC",function(){return g}),O.d(B,"parseIMSC1",function(){return a});var H=O("./src/utils/mp4-tools.ts"),I=O("./src/utils/vttparser.ts"),C=O("./src/utils/vttcue.ts"),j=O("./src/demux/id3.ts"),N=O("./src/utils/timescale-conversion.ts"),e=O("./src/utils/webvtt-parser.ts");function w(){return w=Object.assign||function(u){for(var h=1;h<arguments.length;h++){var c=arguments[h];for(var d in c)Object.prototype.hasOwnProperty.call(c,d)&&(u[d]=c[d])}return u},w.apply(this,arguments)}var g="stpp.ttml.im1t",f=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,n={left:"start",center:"center",right:"end",start:"start",end:"end"};function a(u,h,c,d,E){var y=Object(H.findBox)(new Uint8Array(u),["mdat"]);if(y.length===0){E(new Error("Could not parse IMSC1 mdat"));return}var T=y[0],D=Object(j.utf8ArrayToStr)(new Uint8Array(u,T.start,T.end-T.start)),L=Object(N.toTimescaleFromScale)(h,1,c);try{d(l(D,L))}catch(x){E(x)}}function l(u,h){var c=new DOMParser,d=c.parseFromString(u,"text/xml"),E=d.getElementsByTagName("tt")[0];if(!E)throw new Error("Invalid ttml");var y={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},T=Object.keys(y).reduce(function(U,R){return U[R]=E.getAttribute("ttp:"+R)||y[R],U},{}),D=E.getAttribute("xml:space")!=="preserve",L=i(s(E,"styling","style")),x=i(s(E,"layout","region")),k=s(E,"body","[begin]");return[].map.call(k,function(U){var R=r(U,D);if(!R||!U.hasAttribute("begin"))return null;var V=p(U.getAttribute("begin"),T),Z=p(U.getAttribute("dur"),T),ue=p(U.getAttribute("end"),T);if(V===null)throw m(U);if(ue===null){if(Z===null)throw m(U);ue=V+Z}var le=new C.default(V-h,ue-h,R);le.id=Object(e.generateCueId)(le.startTime,le.endTime,le.text);var ge=x[U.getAttribute("region")],pe=L[U.getAttribute("style")];le.position=10,le.size=80;var ae=t(ge,pe),ne=ae.textAlign;if(ne){var fe=n[ne];fe&&(le.lineAlign=fe),le.align=ne}return w(le,ae),le}).filter(function(U){return U!==null})}function s(u,h,c){var d=u.getElementsByTagName(h)[0];return d?[].slice.call(d.querySelectorAll(c)):[]}function i(u){return u.reduce(function(h,c){var d=c.getAttribute("xml:id");return d&&(h[d]=c),h},{})}function r(u,h){return[].slice.call(u.childNodes).reduce(function(c,d,E){var y;return d.nodeName==="br"&&E?c+`
`:(y=d.childNodes)!==null&&y!==void 0&&y.length?r(d,h):h?c+d.textContent.trim().replace(/\s+/g," "):c+d.textContent},"")}function t(u,h){var c="http://www.w3.org/ns/ttml#styling",d=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"];return d.reduce(function(E,y){var T=v(h,c,y)||v(u,c,y);return T&&(E[y]=T),E},{})}function v(u,h,c){return u.hasAttributeNS(h,c)?u.getAttributeNS(h,c):null}function m(u){return new Error("Could not parse ttml timestamp "+u)}function p(u,h){if(!u)return null;var c=Object(I.parseTimeStamp)(u);return c===null&&(f.test(u)?c=_(u,h):o.test(u)&&(c=b(u,h))),c}function _(u,h){var c=f.exec(u),d=(c[4]|0)+(c[5]|0)/h.subFrameRate;return(c[1]|0)*3600+(c[2]|0)*60+(c[3]|0)+d/h.frameRate}function b(u,h){var c=o.exec(u),d=Number(c[1]),E=c[2];switch(E){case"h":return d*3600;case"m":return d*60;case"ms":return d*1e3;case"f":return d/h.frameRate;case"t":return d/h.tickRate}return d}},"./src/utils/logger.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"enableLogs",function(){return e}),O.d(B,"logger",function(){return w});var H=function(){},I={trace:H,debug:H,log:H,warn:H,info:H,error:H},C=I;function j(g){var f=self.console[g];return f?f.bind(self.console,"["+g+"] >"):H}function N(g){for(var f=arguments.length,o=new Array(f>1?f-1:0),n=1;n<f;n++)o[n-1]=arguments[n];o.forEach(function(a){C[a]=g[a]?g[a].bind(g):j(a)})}function e(g){if(self.console&&g===!0||typeof g=="object"){N(g,"debug","log","info","warn","error");try{C.log()}catch(f){C=I}}else C=I}var w=C},"./src/utils/mediakeys-helper.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"KeySystems",function(){return H}),O.d(B,"requestMediaKeySystemAccess",function(){return I});var H;(function(C){C.WIDEVINE="com.widevine.alpha",C.PLAYREADY="com.microsoft.playready"})(H||(H={}));var I=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"getMediaSource",function(){return H});function H(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"bin2str",function(){return N}),O.d(B,"readUint16",function(){return e}),O.d(B,"readUint32",function(){return w}),O.d(B,"writeUint32",function(){return g}),O.d(B,"findBox",function(){return f}),O.d(B,"parseSegmentIndex",function(){return o}),O.d(B,"parseInitSegment",function(){return n}),O.d(B,"getStartDTS",function(){return a}),O.d(B,"getDuration",function(){return l}),O.d(B,"computeRawDurationFromSamples",function(){return s}),O.d(B,"offsetStartDTS",function(){return i}),O.d(B,"segmentValidRange",function(){return r}),O.d(B,"appendUint8Array",function(){return t});var H=O("./src/utils/typed-array.ts"),I=O("./src/loader/fragment.ts"),C=Math.pow(2,32)-1,j=[].push;function N(v){return String.fromCharCode.apply(null,v)}function e(v,m){"data"in v&&(m+=v.start,v=v.data);var p=v[m]<<8|v[m+1];return p<0?65536+p:p}function w(v,m){"data"in v&&(m+=v.start,v=v.data);var p=v[m]<<24|v[m+1]<<16|v[m+2]<<8|v[m+3];return p<0?4294967296+p:p}function g(v,m,p){"data"in v&&(m+=v.start,v=v.data),v[m]=p>>24,v[m+1]=p>>16&255,v[m+2]=p>>8&255,v[m+3]=p&255}function f(v,m){var p=[];if(!m.length)return p;var _,b,u;"data"in v?(_=v.data,b=v.start,u=v.end):(_=v,b=0,u=_.byteLength);for(var h=b;h<u;){var c=w(_,h),d=N(_.subarray(h+4,h+8)),E=c>1?h+c:u;if(d===m[0])if(m.length===1)p.push({data:_,start:h+8,end:E});else{var y=f({data:_,start:h+8,end:E},m.slice(1));y.length&&j.apply(p,y)}h=E}return p}function o(v){var m=f(v,["moov"]),p=m[0],_=p?p.end:null,b=f(v,["sidx"]);if(!b||!b[0])return null;var u=[],h=b[0],c=h.data[0],d=c===0?8:16,E=w(h,d);d+=4;var y=0,T=0;c===0?d+=8:d+=16,d+=2;var D=h.end+T,L=e(h,d);d+=2;for(var x=0;x<L;x++){var k=d,U=w(h,k);k+=4;var R=U&2147483647,V=(U&2147483648)>>>31;if(V===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var Z=w(h,k);k+=4,u.push({referenceSize:R,subsegmentDuration:Z,info:{duration:Z/E,start:D,end:D+R-1}}),D+=R,k+=4,d=k}return{earliestPresentationTime:y,timescale:E,version:c,referencesCount:L,references:u,moovEndOffset:_}}function n(v){for(var m=[],p=f(v,["moov","trak"]),_=0;_<p.length;_++){var b=p[_],u=f(b,["tkhd"])[0];if(u){var h=u.data[u.start],c=h===0?12:20,d=w(u,c),E=f(b,["mdia","mdhd"])[0];if(E){h=E.data[E.start],c=h===0?12:20;var y=w(E,c),T=f(b,["mdia","hdlr"])[0];if(T){var D=N(T.data.subarray(T.start+8,T.start+12)),L={soun:I.ElementaryStreamTypes.AUDIO,vide:I.ElementaryStreamTypes.VIDEO}[D];if(L){var x=f(b,["mdia","minf","stbl","stsd"])[0],k=void 0;x&&(k=N(x.data.subarray(x.start+12,x.start+16))),m[d]={timescale:y,type:L},m[L]={timescale:y,id:d,codec:k}}}}}}var U=f(v,["moov","mvex","trex"]);return U.forEach(function(R){var V=w(R,4),Z=m[V];Z&&(Z.default={duration:w(R,12),flags:w(R,20)})}),m}function a(v,m){return f(m,["moof","traf"]).reduce(function(p,_){var b=f(_,["tfdt"])[0],u=b.data[b.start],h=f(_,["tfhd"]).reduce(function(c,d){var E=w(d,4),y=v[E];if(y){var T=w(b,4);u===1&&(T*=Math.pow(2,32),T+=w(b,8));var D=y.timescale||9e4,L=T/D;if(isFinite(L)&&(c===null||L<c))return L}return c},null);return h!==null&&isFinite(h)&&(p===null||h<p)?h:p},null)||0}function l(v,m){for(var p=0,_=0,b=0,u=f(v,["moof","traf"]),h=0;h<u.length;h++){var c=u[h],d=f(c,["tfhd"])[0],E=w(d,4),y=m[E];if(!y)continue;var T=y.default,D=w(d,0)|(T==null?void 0:T.flags),L=T==null?void 0:T.duration;D&8&&(D&2?L=w(d,12):L=w(d,8));for(var x=y.timescale||9e4,k=f(c,["trun"]),U=0;U<k.length;U++){if(L){var R=w(k[U],4);p=L*R}else p=s(k[U]);y.type===I.ElementaryStreamTypes.VIDEO?_+=p/x:y.type===I.ElementaryStreamTypes.AUDIO&&(b+=p/x)}}if(_===0&&b===0){var V=o(v);if(V!=null&&V.references)return V.references.reduce(function(Z,ue){return Z+ue.info.duration||0},0)}return _||b}function s(v){var m=w(v,0),p=8;m&1&&(p+=4),m&4&&(p+=4);for(var _=0,b=w(v,4),u=0;u<b;u++){if(m&256){var h=w(v,p);_+=h,p+=4}m&512&&(p+=4),m&1024&&(p+=4),m&2048&&(p+=4)}return _}function i(v,m,p){f(m,["moof","traf"]).forEach(function(_){f(_,["tfhd"]).forEach(function(b){var u=w(b,4),h=v[u];if(!h)return;var c=h.timescale||9e4;f(_,["tfdt"]).forEach(function(d){var E=d.data[d.start],y=w(d,4);if(E===0)g(d,4,y-p*c);else{y*=Math.pow(2,32),y+=w(d,8),y-=p*c,y=Math.max(y,0);var T=Math.floor(y/(C+1)),D=Math.floor(y%(C+1));g(d,4,T),g(d,8,D)}})})})}function r(v){var m={valid:null,remainder:null},p=f(v,["moof"]);if(p){if(p.length<2)return m.remainder=v,m}else return m;var _=p[p.length-1];return m.valid=Object(H.sliceUint8)(v,0,_.start-8),m.remainder=Object(H.sliceUint8)(v,_.start-8),m}function t(v,m){var p=new Uint8Array(v.length+m.length);return p.set(v),p.set(m,v.length),p}},"./src/utils/output-filter.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"default",function(){return H});var H=function(){function I(j,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=j,this.trackName=N}var C=I.prototype;return C.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},C.newCue=function(N,e,w){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=e,this.screen=w,this.timelineController.createCaptionsTrack(this.trackName)},C.reset=function(){this.cueRanges=[]},I}()},"./src/utils/texttrack-utils.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"sendAddTrackEvent",function(){return I}),O.d(B,"addCueToTrack",function(){return C}),O.d(B,"clearCurrentCues",function(){return j}),O.d(B,"removeCuesInRange",function(){return N}),O.d(B,"getCuesInRange",function(){return w});var H=O("./src/utils/logger.ts");function I(g,f){var o;try{o=new Event("addtrack")}catch(n){o=document.createEvent("Event"),o.initEvent("addtrack",!1,!1)}o.track=g,f.dispatchEvent(o)}function C(g,f){var o=g.mode;if(o==="disabled"&&(g.mode="hidden"),g.cues&&!g.cues.getCueById(f.id))try{if(g.addCue(f),!g.cues.getCueById(f.id))throw new Error("addCue is failed for: "+f)}catch(a){H.logger.debug("[texttrack-utils]: "+a);var n=new self.TextTrackCue(f.startTime,f.endTime,f.text);n.id=f.id,g.addCue(n)}o==="disabled"&&(g.mode=o)}function j(g){var f=g.mode;if(f==="disabled"&&(g.mode="hidden"),g.cues)for(var o=g.cues.length;o--;)g.removeCue(g.cues[o]);f==="disabled"&&(g.mode=f)}function N(g,f,o){var n=g.mode;if(n==="disabled"&&(g.mode="hidden"),g.cues&&g.cues.length>0)for(var a=w(g.cues,f,o),l=0;l<a.length;l++)g.removeCue(a[l]);n==="disabled"&&(g.mode=n)}function e(g,f){if(f<g[0].startTime)return 0;var o=g.length-1;if(f>g[o].endTime)return-1;for(var n=0,a=o;n<=a;){var l=Math.floor((a+n)/2);if(f<g[l].startTime)a=l-1;else if(f>g[l].startTime&&n<o)n=l+1;else return l}return g[n].startTime-f<f-g[a].startTime?n:a}function w(g,f,o){var n=[],a=e(g,f);if(a>-1)for(var l=a,s=g.length;l<s;l++){var i=g[l];if(i.startTime>=f&&i.endTime<=o)n.push(i);else if(i.startTime>o)return n}return n}},"./src/utils/time-ranges.ts":function(oe,B,O){"use strict";O.r(B);var H={toString:function(C){for(var j="",N=C.length,e=0;e<N;e++)j+="["+C.start(e).toFixed(3)+","+C.end(e).toFixed(3)+"]";return j}};B.default=H},"./src/utils/timescale-conversion.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"toTimescaleFromBase",function(){return I}),O.d(B,"toTimescaleFromScale",function(){return C}),O.d(B,"toMsFromMpegTsClock",function(){return j}),O.d(B,"toMpegTsClockFromTimescale",function(){return N});var H=9e4;function I(e,w,g,f){g===void 0&&(g=1),f===void 0&&(f=!1);var o=e*w*g;return f?Math.round(o):o}function C(e,w,g,f){return g===void 0&&(g=1),f===void 0&&(f=!1),I(e,w,1/g,f)}function j(e,w){return w===void 0&&(w=!1),I(e,1e3,1/H,w)}function N(e,w){return w===void 0&&(w=1),I(e,H,1/w)}},"./src/utils/typed-array.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"sliceUint8",function(){return H});function H(I,C,j){return Uint8Array.prototype.slice?I.slice(C,j):new Uint8Array(Array.prototype.slice.call(I,C,j))}},"./src/utils/vttcue.ts":function(oe,B,O){"use strict";O.r(B),B.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var H=["","lr","rl"],I=["start","middle","end","left","right"];function C(g,f){if(typeof f!="string")return!1;if(!Array.isArray(g))return!1;var o=f.toLowerCase();return~g.indexOf(o)?o:!1}function j(g){return C(H,g)}function N(g){return C(I,g)}function e(g){for(var f=arguments.length,o=new Array(f>1?f-1:0),n=1;n<f;n++)o[n-1]=arguments[n];for(var a=1;a<arguments.length;a++){var l=arguments[a];for(var s in l)g[s]=l[s]}return g}function w(g,f,o){var n=this,a={enumerable:!0};n.hasBeenReset=!1;var l="",s=!1,i=g,r=f,t=o,v=null,m="",p=!0,_="auto",b="start",u=50,h="middle",c=50,d="middle";Object.defineProperty(n,"id",e({},a,{get:function(){return l},set:function(y){l=""+y}})),Object.defineProperty(n,"pauseOnExit",e({},a,{get:function(){return s},set:function(y){s=!!y}})),Object.defineProperty(n,"startTime",e({},a,{get:function(){return i},set:function(y){if(typeof y!="number")throw new TypeError("Start time must be set to a number.");i=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"endTime",e({},a,{get:function(){return r},set:function(y){if(typeof y!="number")throw new TypeError("End time must be set to a number.");r=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"text",e({},a,{get:function(){return t},set:function(y){t=""+y,this.hasBeenReset=!0}})),Object.defineProperty(n,"region",e({},a,{get:function(){return v},set:function(y){v=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"vertical",e({},a,{get:function(){return m},set:function(y){var T=j(y);if(T===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=T,this.hasBeenReset=!0}})),Object.defineProperty(n,"snapToLines",e({},a,{get:function(){return p},set:function(y){p=!!y,this.hasBeenReset=!0}})),Object.defineProperty(n,"line",e({},a,{get:function(){return _},set:function(y){if(typeof y!="number"&&y!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");_=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"lineAlign",e({},a,{get:function(){return b},set:function(y){var T=N(y);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");b=T,this.hasBeenReset=!0}})),Object.defineProperty(n,"position",e({},a,{get:function(){return u},set:function(y){if(y<0||y>100)throw new Error("Position must be between 0 and 100.");u=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"positionAlign",e({},a,{get:function(){return h},set:function(y){var T=N(y);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");h=T,this.hasBeenReset=!0}})),Object.defineProperty(n,"size",e({},a,{get:function(){return c},set:function(y){if(y<0||y>100)throw new Error("Size must be between 0 and 100.");c=y,this.hasBeenReset=!0}})),Object.defineProperty(n,"align",e({},a,{get:function(){return d},set:function(y){var T=N(y);if(!T)throw new SyntaxError("An invalid or illegal string was specified.");d=T,this.hasBeenReset=!0}})),n.displayState=void 0}return w.prototype.getCueAsHTML=function(){var g=self.WebVTT;return g.convertCueToDOMTree(self,this.text)},w}()},"./src/utils/vttparser.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"parseTimeStamp",function(){return C}),O.d(B,"fixLineBreaks",function(){return f}),O.d(B,"VTTParser",function(){return o});var H=O("./src/utils/vttcue.ts"),I=function(){function n(){}var a=n.prototype;return a.decode=function(s,i){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},n}();function C(n){function a(s,i,r,t){return(s|0)*3600+(i|0)*60+(r|0)+parseFloat(t||0)}var l=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?a(l[2],l[3],0,l[4]):a(l[1],l[2],l[3],l[4]):null}var j=function(){function n(){this.values=Object.create(null)}var a=n.prototype;return a.set=function(s,i){!this.get(s)&&i!==""&&(this.values[s]=i)},a.get=function(s,i,r){return r?this.has(s)?this.values[s]:i[r]:this.has(s)?this.values[s]:i},a.has=function(s){return s in this.values},a.alt=function(s,i,r){for(var t=0;t<r.length;++t)if(i===r[t]){this.set(s,i);break}},a.integer=function(s,i){/^-?\d+$/.test(i)&&this.set(s,parseInt(i,10))},a.percent=function(s,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){var r=parseFloat(i);if(r>=0&&r<=100)return this.set(s,r),!0}return!1},n}();function N(n,a,l,s){var i=s?n.split(s):[n];for(var r in i){if(typeof i[r]!="string")continue;var t=i[r].split(l);if(t.length!==2)continue;var v=t[0],m=t[1];a(v,m)}}var e=new H.default(0,0,""),w=e.align==="middle"?"middle":"center";function g(n,a,l){var s=n;function i(){var v=C(n);if(v===null)throw new Error("Malformed timestamp: "+s);return n=n.replace(/^[^\sa-zA-Z-]+/,""),v}function r(v,m){var p=new j;N(v,function(u,h){var c;switch(u){case"region":for(var d=l.length-1;d>=0;d--)if(l[d].id===h){p.set(u,l[d].region);break}break;case"vertical":p.alt(u,h,["rl","lr"]);break;case"line":c=h.split(","),p.integer(u,c[0]),p.percent(u,c[0])&&p.set("snapToLines",!1),p.alt(u,c[0],["auto"]),c.length===2&&p.alt("lineAlign",c[1],["start",w,"end"]);break;case"position":c=h.split(","),p.percent(u,c[0]),c.length===2&&p.alt("positionAlign",c[1],["start",w,"end","line-left","line-right","auto"]);break;case"size":p.percent(u,h);break;case"align":p.alt(u,h,["start",w,"end","left","right"]);break}},/:/,/\s/),m.region=p.get("region",null),m.vertical=p.get("vertical","");var _=p.get("line","auto");_==="auto"&&e.line===-1&&(_=-1),m.line=_,m.lineAlign=p.get("lineAlign","start"),m.snapToLines=p.get("snapToLines",!0),m.size=p.get("size",100),m.align=p.get("align",w);var b=p.get("position","auto");b==="auto"&&e.position===50&&(b=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=b}function t(){n=n.replace(/^\s+/,"")}if(t(),a.startTime=i(),t(),n.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);n=n.substr(3),t(),a.endTime=i(),t(),r(n,a)}function f(n){return n.replace(/<br(?: \/)?>/gi,`
`)}var o=function(){function n(){this.state="INITIAL",this.buffer="",this.decoder=new I,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var a=n.prototype;return a.parse=function(s){var i=this;s&&(i.buffer+=i.decoder.decode(s,{stream:!0}));function r(){var b=i.buffer,u=0;for(b=f(b);u<b.length&&b[u]!=="\r"&&b[u]!==`
`;)++u;var h=b.substr(0,u);return b[u]==="\r"&&++u,b[u]===`
`&&++u,i.buffer=b.substr(u),h}function t(b){N(b,function(u,h){},/:/)}try{var v="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;v=r();var m=v.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");i.state="HEADER"}for(var p=!1;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;p?p=!1:v=r();switch(i.state){case"HEADER":/:/.test(v)?t(v):v||(i.state="ID");continue;case"NOTE":v||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(v)){i.state="NOTE";break}if(!v)continue;if(i.cue=new H.default(0,0,""),i.state="CUE",v.indexOf("-->")===-1){i.cue.id=v;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{g(v,i.cue,i.regionList)}catch(b){i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{var _=v.indexOf("-->")!==-1;if(!v||_&&(p=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
`),i.cue.text+=v}continue;case"BADCUE":v||(i.state="ID")}}}catch(b){i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},a.flush=function(){var s=this;try{if((s.cue||s.state==="HEADER")&&(s.buffer+=`
`,s.parse()),s.state==="INITIAL"||s.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){s.onparsingerror&&s.onparsingerror(i)}return s.onflush&&s.onflush(),this},n}()},"./src/utils/webvtt-parser.ts":function(oe,B,O){"use strict";O.r(B),O.d(B,"generateCueId",function(){return o}),O.d(B,"parseWebVTT",function(){return a});var H=O("./src/polyfills/number.ts"),I=O("./src/utils/vttparser.ts"),C=O("./src/demux/id3.ts"),j=O("./src/utils/timescale-conversion.ts"),N=O("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,w=function(s,i,r){return r===void 0&&(r=0),s.substr(r,i.length)===i},g=function(s){var i=parseInt(s.substr(-3)),r=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),v=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(H.isFiniteNumber)(i)||!Object(H.isFiniteNumber)(r)||!Object(H.isFiniteNumber)(t)||!Object(H.isFiniteNumber)(v))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return i+=1e3*r,i+=60*1e3*t,i+=60*60*1e3*v,i},f=function(s){for(var i=5381,r=s.length;r;)i=i*33^s.charCodeAt(--r);return(i>>>0).toString()};function o(l,s,i){return f(l.toString())+f(s.toString())+f(i)}var n=function(s,i,r){var t=s[i],v=s[t.prevCC];if(!v||!v.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(m=v)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=t.start-v.start,t.new=!1,t=v,v=s[t.prevCC]}s.presentationOffset=r};function a(l,s,i,r,t,v,m,p){var _=new I.VTTParser,b=Object(C.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(e,`
`).split(`
`),u=[],h=Object(j.toMpegTsClockFromTimescale)(s,i),c="00:00.000",d=0,E=0,y,T=!0,D=!1;_.oncue=function(L){var x=r[t],k=r.ccOffset,U=(d-h)/9e4;if(x!=null&&x.new&&(E!==void 0?k=r.ccOffset=x.start:n(r,t,U)),U&&(k=U-r.presentationOffset),D){var R=L.endTime-L.startTime,V=Object(N.normalizePts)((L.startTime+k-E)*9e4,v*9e4)/9e4;L.startTime=V,L.endTime=V+R}var Z=L.text.trim();L.text=decodeURIComponent(encodeURIComponent(Z)),L.id||(L.id=o(L.startTime,L.endTime,Z)),L.endTime>0&&u.push(L)},_.onparsingerror=function(L){y=L},_.onflush=function(){if(y){p(y);return}m(u)},b.forEach(function(L){if(T)if(w(L,"X-TIMESTAMP-MAP=")){T=!1,D=!0,L.substr(16).split(",").forEach(function(x){w(x,"LOCAL:")?c=x.substr(6):w(x,"MPEGTS:")&&(d=parseInt(x.substr(7)))});try{E=g(c)/1e3}catch(x){D=!1,y=x}return}else L===""&&(T=!1);_.parse(L+`
`)}),_.flush()}},"./src/utils/xhr-loader.ts":function(oe,B,O){"use strict";O.r(B);var H=O("./src/utils/logger.ts"),I=O("./src/loader/load-stats.ts"),C=/^age:\s*[\d.]+\s*$/m,j=function(){function N(w){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=w?w.xhrSetup:null,this.stats=new I.LoadStats,this.retryDelay=0}var e=N.prototype;return e.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},e.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()))},e.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(g,f,o){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=f,this.callbacks=o,this.retryDelay=f.retryDelay,this.loadInternal()},e.loadInternal=function(){var g=this.config,f=this.context;if(!g)return;var o=this.loader=new self.XMLHttpRequest,n=this.stats;n.loading.first=0,n.loaded=0;var a=this.xhrSetup;try{if(a)try{a(o,f.url)}catch(i){o.open("GET",f.url,!0),a(o,f.url)}o.readyState||o.open("GET",f.url,!0);var l=this.context.headers;if(l)for(var s in l)o.setRequestHeader(s,l[s])}catch(i){this.callbacks.onError({code:o.status,text:i.message},f,o);return}f.rangeEnd&&o.setRequestHeader("Range","bytes="+f.rangeStart+"-"+(f.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=f.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),g.timeout),o.send()},e.readystatechange=function(){var g=this.context,f=this.loader,o=this.stats;if(!g||!f)return;var n=f.readyState,a=this.config;if(o.aborted)return;if(n>=2)if(self.clearTimeout(this.requestTimeout),o.loading.first===0&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),n===4){f.onreadystatechange=null,f.onprogress=null;var l=f.status;if(l>=200&&l<300){o.loading.end=Math.max(self.performance.now(),o.loading.first);var s,i;if(g.responseType==="arraybuffer"?(s=f.response,i=s.byteLength):(s=f.responseText,i=s.length),o.loaded=o.total=i,!this.callbacks)return;var r=this.callbacks.onProgress;if(r&&r(o,g,s,f),!this.callbacks)return;var t={url:f.responseURL,data:s};this.callbacks.onSuccess(t,o,g,f)}else o.retry>=a.maxRetry||l>=400&&l<499?(H.logger.error(l+" while loading "+g.url),this.callbacks.onError({code:l,text:f.statusText},g,f)):(H.logger.warn(l+" 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,a.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.timeout)},e.loadtimeout=function(){H.logger.warn("timeout while loading "+this.context.url);var g=this.callbacks;g&&(this.abortInternal(),g.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(g){var f=this.stats;f.loaded=g.loaded,g.lengthComputable&&(f.total=g.total)},e.getCacheAge=function(){var g=null;if(this.loader&&C.test(this.loader.getAllResponseHeaders())){var f=this.loader.getResponseHeader("age");g=f?parseFloat(f):null}return g},N}();B.default=j}}).default})},vHTk:function(Fe,ce,z){Fe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);