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.
403 lines
944 KiB
403 lines
944 KiB
(window.webpackJsonp=window.webpackJsonp||[]).push([[218,5,7],{"+ua5":function(Qe,ue,W){},"/cxE":function(Qe,ue,W){"use strict";W.d(ue,"f",function(){return C}),W.d(ue,"g",function(){return j}),W.d(ue,"h",function(){return L}),W.d(ue,"e",function(){return B}),W.d(ue,"b",function(){return N}),W.d(ue,"c",function(){return e}),W.d(ue,"d",function(){return A}),W.d(ue,"a",function(){return f});class te{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(p){setTimeout(()=>{throw p.stack?new Error(p.message+`
|
|
|
|
`+p.stack):p},0)}}emit(p){this.listeners.forEach(o=>{o(p)})}onUnexpectedError(p){this.unexpectedErrorHandler(p),this.emit(p)}onUnexpectedExternalError(p){this.unexpectedErrorHandler(p)}}const H=new te;function C(p){B(p)||H.onUnexpectedError(p);return}function j(p){B(p)||H.onUnexpectedExternalError(p);return}function L(p){if(p instanceof Error){let{name:o,message:a}=p;const n=p.stacktrace||p.stack;return{$isError:!0,name:o,message:a,stack:n}}return p}const R="Canceled";function B(p){return p instanceof Error&&p.name===R&&p.message===R}function N(){const p=new Error(R);return p.name=p.message,p}function e(p){return p?new Error(`Illegal argument: ${p}`):new Error("Illegal argument")}function A(p){return p?new Error(`Illegal state: ${p}`):new Error("Illegal state")}class f extends Error{constructor(p){super("NotSupported");p&&(this.message=p)}}},"24hK":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return H});class te{constructor(C){this.element=C,this.next=te.Undefined,this.prev=te.Undefined}}te.Undefined=new te(void 0);class H{constructor(){this._first=te.Undefined,this._last=te.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===te.Undefined}clear(){let C=this._first;for(;C!==te.Undefined;){const j=C.next;C.prev=te.Undefined,C.next=te.Undefined,C=j}this._first=te.Undefined,this._last=te.Undefined,this._size=0}unshift(C){return this._insert(C,!1)}push(C){return this._insert(C,!0)}_insert(C,j){const L=new te(C);if(this._first===te.Undefined)this._first=L,this._last=L;else if(j){const B=this._last;this._last=L,L.prev=B,B.next=L}else{const B=this._first;this._first=L,L.next=B,B.prev=L}this._size+=1;let R=!1;return()=>{R||(R=!0,this._remove(L))}}shift(){if(this._first===te.Undefined)return;{const C=this._first.element;return this._remove(this._first),C}}pop(){if(this._last===te.Undefined)return;{const C=this._last.element;return this._remove(this._last),C}}_remove(C){if(C.prev!==te.Undefined&&C.next!==te.Undefined){const j=C.prev;j.next=C.next,C.next.prev=j}else C.prev===te.Undefined&&C.next===te.Undefined?(this._first=te.Undefined,this._last=te.Undefined):C.next===te.Undefined?(this._last=this._last.prev,this._last.next=te.Undefined):C.prev===te.Undefined&&(this._first=this._first.next,this._first.prev=te.Undefined);this._size-=1}*[Symbol.iterator](){let C=this._first;for(;C!==te.Undefined;)yield C.element,C=C.next}}},"3/fG":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return H});function te(C,j){let L;return j.length===0?L=C:L=C.replace(/\{(\d+)\}/g,function(R,B){const N=B[0];return typeof j[N]!="undefined"?j[N]:R}),L}function H(C,j,...L){return te(j,L)}},"55Ip":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return i});var te=W("Ty5D"),H=W("dI71"),C=W("q1tI"),j=W.n(C),L=W("YS25"),R=W("17x9"),B=W.n(R),N=W("wx14"),e=W("zLVn"),A=W("9R94"),f=function(h){Object(H.a)(c,h);function c(){for(var T,b=arguments.length,S=new Array(b),D=0;D<b;D++)S[D]=arguments[D];return T=h.call.apply(h,[this].concat(S))||this,T.history=Object(L.a)(T.props),T}var d=c.prototype;return d.render=function(){return j.a.createElement(te.c,{history:this.history,children:this.props.children})},c}(j.a.Component),p=function(h){Object(H.a)(c,h);function c(){for(var T,b=arguments.length,S=new Array(b),D=0;D<b;D++)S[D]=arguments[D];return T=h.call.apply(h,[this].concat(S))||this,T.history=Object(L.b)(T.props),T}var d=c.prototype;return d.render=function(){return j.a.createElement(te.c,{history:this.history,children:this.props.children})},c}(j.a.Component),o=function(c,d){return typeof c=="function"?c(d):c},a=function(c,d){return typeof c=="string"?Object(L.c)(c,null,null,d):c},n=function(c){return c},l=j.a.forwardRef;typeof l=="undefined"&&(l=n);function s(h){return!!(h.metaKey||h.altKey||h.ctrlKey||h.shiftKey)}var r=l(function(h,c){var d=h.innerRef,T=h.navigate,b=h.onClick,S=Object(e.a)(h,["innerRef","navigate","onClick"]),D=S.target,I=Object(N.a)({},S,{onClick:function(P){try{b&&b(P)}catch(U){throw P.preventDefault(),U}!P.defaultPrevented&&P.button===0&&(!D||D==="_self")&&!s(P)&&(P.preventDefault(),T())}});return n!==l?I.ref=c||d:I.ref=d,j.a.createElement("a",I)}),i=l(function(h,c){var d=h.component,T=d===void 0?r:d,b=h.replace,S=h.to,D=h.innerRef,I=Object(e.a)(h,["component","replace","to","innerRef"]);return j.a.createElement(te.e.Consumer,null,function(w){w||Object(A.a)(!1);var P=w.history,U=a(o(S,w.location),w.location),O=U?P.createHref(U):"",G=Object(N.a)({},I,{href:O,navigate:function(){var ae=o(S,w.location),ie=b?P.replace:P.push;ie(ae)}});return n!==l?G.ref=c||D:G.innerRef=D,j.a.createElement(T,G)})});if(!1)var t,y;var m=function(c){return c},g=j.a.forwardRef;typeof g=="undefined"&&(g=m);function E(){for(var h=arguments.length,c=new Array(h),d=0;d<h;d++)c[d]=arguments[d];return c.filter(function(T){return T}).join(" ")}var _=g(function(h,c){var d=h["aria-current"],T=d===void 0?"page":d,b=h.activeClassName,S=b===void 0?"active":b,D=h.activeStyle,I=h.className,w=h.exact,P=h.isActive,U=h.location,O=h.sensitive,G=h.strict,V=h.style,ae=h.to,ie=h.innerRef,fe=Object(e.a)(h,["aria-current","activeClassName","activeStyle","className","exact","isActive","location","sensitive","strict","style","to","innerRef"]);return j.a.createElement(te.e.Consumer,null,function(ce){ce||Object(A.a)(!1);var J=U||ce.location,Z=a(o(ae,J),J),he=Z.pathname,X=he&&he.replace(/([.+*?=^!:${}()[\]|/\\])/g,"\\$1"),$=X?Object(te.f)(J.pathname,{path:X,exact:w,sensitive:O,strict:G}):null,ye=!!(P?P($,J):$),Le=ye?E(I,S):I,Re=ye?Object(N.a)({},V,{},D):V,Ie=Object(N.a)({"aria-current":ye&&T||null,className:Le,style:Re,to:Z},fe);return m!==g?Ie.ref=c||ie:Ie.innerRef=ie,j.a.createElement(i,Ie)})});if(!1)var u},"5VLF":function(Qe,ue,W){"use strict";var te,H;function C(j,L,R){var B=function(N,e){return j.js_beautify(N,e)};return B.js=j.js_beautify,B.css=L.css_beautify,B.html=R.html_beautify,B.js_beautify=j.js_beautify,B.css_beautify=L.css_beautify,B.html_beautify=R.html_beautify,B}!(te=[W("6UM0"),W("TXwP"),W("psGv")],H=function(j,L,R){return C(j,L,R)}.apply(ue,te),H!==void 0&&(Qe.exports=H))},"5Y4S":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return C});var te=W("MNsG");const H=te.b.performance&&typeof te.b.performance.now=="function";class C{constructor(j){this._highResolution=H&&j,this._startTime=this._now(),this._stopTime=-1}static create(j=!0){return new C(j)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?te.b.performance.now():Date.now()}}},"6UM0":function(Qe,ue,W){var te,H;(function(){var C;(function(){"use strict";var L=[function(e,A,f){var p=f(1).Beautifier,o=f(5).Options;function a(n,l){var s=new p(n,l);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new o}},function(e,A,f){var p=f(2).Output,o=f(3).Token,a=f(4),n=f(5).Options,l=f(7).Tokenizer,s=f(7).line_starters,r=f(7).positionable_operators,i=f(7).TOKEN;function t(O,G){return G.indexOf(O)!==-1}function y(O){return O.replace(/^\s+/g,"")}function m(O){for(var G={},V=0;V<O.length;V++)G[O[V].replace(/-/g,"_")]=O[V];return G}function g(O,G){return O&&O.type===i.RESERVED&&O.text===G}function E(O,G){return O&&O.type===i.RESERVED&&t(O.text,G)}var _=["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 T(O,G){if(G.multiline_frame||G.mode===d.ForInitializer||G.mode===d.Conditional)return;O.remove_indent(G.start_line_index)}function b(O){O=O.replace(a.allLineBreaks,`
|
|
`);for(var G=[],V=O.indexOf(`
|
|
`);V!==-1;)G.push(O.substring(0,V)),O=O.substring(V+1),V=O.indexOf(`
|
|
`);return O.length&&G.push(O),G}function S(O){return O===d.ArrayLiteral}function D(O){return t(O,[d.Expression,d.ForInitializer,d.Conditional])}function I(O,G){for(var V=0;V<O.length;V++){var ae=O[V].trim();if(ae.charAt(0)!==G)return!1}return!0}function w(O,G){for(var V=0,ae=O.length,ie;V<ae;V++)if(ie=O[V],ie&&ie.indexOf(G)!==0)return!1;return!0}function P(O,G){G=G||{},this._source_text=O||"",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 n(G)}P.prototype.create_flags=function(O,G){var V=0;O&&(V=O.indentation_level,!this._output.just_added_newline()&&O.line_indent_level>V&&(V=O.line_indent_level));var ae={mode:G,parent:O,last_token:O?O.last_token:new o(i.START_BLOCK,""),last_word:O?O.last_word:"",declaration_statement:!1,declaration_assignment:!1,multiline_frame:!1,inline_frame:!1,if_block:!1,else_block:!1,class_start_block:!1,do_block:!1,do_while:!1,import_block:!1,in_case_statement:!1,in_case:!1,case_body:!1,case_block:!1,indentation_level:V,alignment:0,line_indent_level:O?O.line_indent_level:V,start_line_index:this._output.get_line_number(),ternary_depth:0};return ae},P.prototype._reset=function(O){var G=O.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new p(this._options,G),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(d.BlockStatement);var V=new l(O,this._options);return this._tokens=V.tokenize(),O},P.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var O,G=this._reset(this._source_text),V=this._options.eol;this._options.eol==="auto"&&(V=`
|
|
`,G&&a.lineBreak.test(G||"")&&(V=G.match(a.lineBreak)[0]));for(var ae=this._tokens.next();ae;)this.handle_token(ae),this._last_last_text=this._flags.last_token.text,this._flags.last_token=ae,ae=this._tokens.next();return O=this._output.get_code(V),O},P.prototype.handle_token=function(O,G){O.type===i.START_EXPR?this.handle_start_expr(O):O.type===i.END_EXPR?this.handle_end_expr(O):O.type===i.START_BLOCK?this.handle_start_block(O):O.type===i.END_BLOCK?this.handle_end_block(O):O.type===i.WORD?this.handle_word(O):O.type===i.RESERVED?this.handle_word(O):O.type===i.SEMICOLON?this.handle_semicolon(O):O.type===i.STRING?this.handle_string(O):O.type===i.EQUALS?this.handle_equals(O):O.type===i.OPERATOR?this.handle_operator(O):O.type===i.COMMA?this.handle_comma(O):O.type===i.BLOCK_COMMENT?this.handle_block_comment(O,G):O.type===i.COMMENT?this.handle_comment(O,G):O.type===i.DOT?this.handle_dot(O):O.type===i.EOF?this.handle_eof(O):O.type===i.UNKNOWN?this.handle_unknown(O,G):this.handle_unknown(O,G)},P.prototype.handle_whitespace_and_comments=function(O,G){var V=O.newlines,ae=this._options.keep_array_indentation&&S(this._flags.mode);if(O.comments_before)for(var ie=O.comments_before.next();ie;)this.handle_whitespace_and_comments(ie,G),this.handle_token(ie,G),ie=O.comments_before.next();if(ae)for(var fe=0;fe<V;fe+=1)this.print_newline(fe>0,G);else if(this._options.max_preserve_newlines&&V>this._options.max_preserve_newlines&&(V=this._options.max_preserve_newlines),this._options.preserve_newlines&&V>1){this.print_newline(!1,G);for(var ce=1;ce<V;ce+=1)this.print_newline(!0,G)}};var U=["async","break","continue","return","throw","yield"];P.prototype.allow_wrap_or_preserved_newline=function(O,G){if(G=G===void 0?!1:G,this._output.just_added_newline())return;var V=this._options.preserve_newlines&&O.newlines||G,ae=t(this._flags.last_token.text,r)||t(O.text,r);if(ae){var ie=t(this._flags.last_token.text,r)&&t(this._options.operator_position,c)||t(O.text,r);V=V&&ie}if(V)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(E(this._flags.last_token,U))return;this._output.set_wrap_point()}},P.prototype.print_newline=function(O,G){if(!G&&(this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")))for(var V=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&g(V,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(O)&&(this._flags.multiline_frame=!0)},P.prototype.print_token_line_indentation=function(O){this._output.just_added_newline()&&(this._options.keep_array_indentation&&O.newlines&&(O.text==="["||S(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(O.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))},P.prototype.print_token=function(O){if(this._output.raw){this._output.add_raw_token(O);return}if(this._options.comma_first&&O.previous&&O.previous.type===i.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var G=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(G),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(O),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(O),this._output.non_breaking_space=!0,this._output.add_token(O.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},P.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.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))},P.prototype.set_mode=function(O){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,O),this._flags=this.create_flags(this._previous_flags,O),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},P.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&&T(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},P.prototype.start_of_object_property=function(){return this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"]))},P.prototype.start_of_statement=function(O){var G=!1;return G=G||E(this._flags.last_token,["var","let","const"])&&O.type===i.WORD,G=G||g(this._flags.last_token,"do"),G=G||!(this._flags.parent.mode===d.ObjectLiteral&&this._flags.mode===d.Statement)&&E(this._flags.last_token,U)&&!O.newlines,G=G||g(this._flags.last_token,"else")&&!(g(O,"if")&&!O.comments_before),G=G||this._flags.last_token.type===i.END_EXPR&&(this._previous_flags.mode===d.ForInitializer||this._previous_flags.mode===d.Conditional),G=G||this._flags.last_token.type===i.WORD&&this._flags.mode===d.BlockStatement&&!this._flags.in_case&&!(O.text==="--"||O.text==="++")&&this._last_last_text!=="function"&&O.type!==i.WORD&&O.type!==i.RESERVED,G=G||this._flags.mode===d.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||E(this._flags.last_token,["get","set"])),G?(this.set_mode(d.Statement),this.indent(),this.handle_whitespace_and_comments(O,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O,E(O,["do","for","if","while"])),!0):!1},P.prototype.handle_start_expr=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O);var G=d.Expression;if(O.text==="["){if(this._flags.last_token.type===i.WORD||this._flags.last_token.text===")"){E(this._flags.last_token,s)&&(this._output.space_before_token=!0),this.print_token(O),this.set_mode(G),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}G=d.ArrayLiteral,S(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,[i.START_EXPR,i.END_EXPR,i.WORD,i.OPERATOR,i.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===i.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,G=d.ForInitializer):t(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,G=d.Conditional):t(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&O.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===i.EQUALS||this._flags.last_token.type===i.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O);else if(this._flags.last_token.type===i.WORD){this._output.space_before_token=!1;var V=this._tokens.peek(-3);if(this._options.space_after_named_function&&V){var ae=this._tokens.peek(-4);E(V,["async","function"])||V.text==="*"&&E(ae,["async","function"])?this._output.space_before_token=!0:this._flags.mode===d.ObjectLiteral?(V.text==="{"||V.text===","||V.text==="*"&&(ae.text==="{"||ae.text===","))&&(this._output.space_before_token=!0):this._flags.parent&&this._flags.parent.class_start_block&&(this._output.space_before_token=!0)}}else this.allow_wrap_or_preserved_newline(O);(this._flags.last_token.type===i.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===i.START_BLOCK?this.print_newline():(this._flags.last_token.type===i.END_EXPR||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===i.COMMA)&&this.allow_wrap_or_preserved_newline(O,O.newlines),this.print_token(O),this.set_mode(G),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},P.prototype.handle_end_expr=function(O){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(O,O.text==="]"&&S(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===i.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(O),this.restore_mode(),T(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)},P.prototype.handle_start_block=function(O){this.handle_whitespace_and_comments(O);var G=this._tokens.peek(),V=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===i.END_EXPR?(this.set_mode(d.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(d.BlockStatement):V&&(t(V.text,[":",","])&&t(G.type,[i.STRING,i.WORD,i.RESERVED])||t(G.text,["get","set","..."])&&t(V.type,[i.WORD,i.RESERVED]))?t(this._last_last_text,["class","interface"])&&!t(V.text,[":",","])?this.set_mode(d.BlockStatement):this.set_mode(d.ObjectLiteral):this._flags.last_token.type===i.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(d.BlockStatement):t(this._flags.last_token.type,[i.EQUALS,i.START_EXPR,i.COMMA,i.OPERATOR])||E(this._flags.last_token,["return","throw","import","default"])?this.set_mode(d.ObjectLiteral):this.set_mode(d.BlockStatement),this._flags.last_token&&(E(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0));var ae=!G.comments_before&&G.text==="}",ie=ae&&this._flags.last_word==="function"&&this._flags.last_token.type===i.END_EXPR;if(this._options.brace_preserve_inline){var fe=0,ce=null;this._flags.inline_frame=!0;do if(fe+=1,ce=this._tokens.peek(fe-1),ce.newlines){this._flags.inline_frame=!1;break}while(ce.type!==i.EOF&&!(ce.type===i.END_BLOCK&&ce.opened===O))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==i.OPERATOR&&(ie||this._flags.last_token.type===i.EQUALS||E(this._flags.last_token,_)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(S(this._previous_flags.mode)&&(this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.COMMA)&&((this._flags.last_token.type===i.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(O),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==i.OPERATOR&&this._flags.last_token.type!==i.START_EXPR&&(this._flags.last_token.type===i.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(O),this.indent(),!ae&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},P.prototype.handle_end_block=function(O){for(this.handle_whitespace_and_comments(O);this._flags.mode===d.Statement;)this.restore_mode();var G=this._flags.last_token.type===i.START_BLOCK;this._flags.inline_frame&&!G?this._output.space_before_token=!0:this._options.brace_style==="expand"?G||this.print_newline():G||(S(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(O)},P.prototype.handle_word=function(O){if(O.type===i.RESERVED){if(t(O.text,["set","get"])&&this._flags.mode!==d.ObjectLiteral)O.type=i.WORD;else if(O.text==="import"&&t(this._tokens.peek().text,["(","."]))O.type=i.WORD;else if(t(O.text,["as","from"])&&!this._flags.import_block)O.type=i.WORD;else if(this._flags.mode===d.ObjectLiteral){var G=this._tokens.peek();G.text===":"&&(O.type=i.WORD)}}if(this.start_of_statement(O)?E(this._flags.last_token,["var","let","const"])&&O.type===i.WORD&&(this._flags.declaration_statement=!0):O.newlines&&!D(this._flags.mode)&&(this._flags.last_token.type!==i.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==i.EQUALS&&(this._options.preserve_newlines||!E(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(O),this.print_newline()):this.handle_whitespace_and_comments(O),this._flags.do_block&&!this._flags.do_while)if(g(O,"while")){this._output.space_before_token=!0,this.print_token(O),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&&g(O,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===d.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&E(O,["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(O),this._flags.in_case=!0;return}if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O)),g(O,"function")){(t(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(t(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===i.OPERATOR))&&(!this._output.just_added_blankline()&&!O.comments_before&&(this.print_newline(),this.print_newline(!0))),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD?E(this._flags.last_token,["get","set","new","export"])||E(this._flags.last_token,U)?this._output.space_before_token=!0:g(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===i.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(D(this._flags.mode)||S(this._flags.mode))||this.print_newline(),this.print_token(O),this._flags.last_word=O.text;return}var V="NONE";if(this._flags.last_token.type===i.END_BLOCK?this._previous_flags.inline_frame?V="SPACE":E(O,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines?V="NEWLINE":(V="SPACE",this._output.space_before_token=!0):V="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&this._flags.mode===d.BlockStatement?V="NEWLINE":this._flags.last_token.type===i.SEMICOLON&&D(this._flags.mode)?V="SPACE":this._flags.last_token.type===i.STRING?V="NEWLINE":this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.last_token.text==="*"&&(t(this._last_last_text,["function","yield"])||this._flags.mode===d.ObjectLiteral&&t(this._last_last_text,["{",","]))?V="SPACE":this._flags.last_token.type===i.START_BLOCK?this._flags.inline_frame?V="SPACE":V="NEWLINE":this._flags.last_token.type===i.END_EXPR&&(this._output.space_before_token=!0,V="NEWLINE"),E(O,s)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?V="SPACE":V="NEWLINE"),E(O,["else","catch","finally"]))if((!(this._flags.last_token.type===i.END_BLOCK&&this._previous_flags.mode===d.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&O.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var ae=this._output.current_line;ae.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else V==="NEWLINE"?E(this._flags.last_token,_)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&E(O,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==i.END_EXPR?(this._flags.last_token.type!==i.START_EXPR||!E(O,["var","let","const"]))&&this._flags.last_token.text!==":"&&(g(O,"if")&&g(O.previous,"else")?this._output.space_before_token=!0:this.print_newline()):E(O,s)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&S(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():V==="SPACE"&&(this._output.space_before_token=!0);O.previous&&(O.previous.type===i.WORD||O.previous.type===i.RESERVED)&&(this._output.space_before_token=!0),this.print_token(O),this._flags.last_word=O.text,O.type===i.RESERVED&&(O.text==="do"?this._flags.do_block=!0:O.text==="if"?this._flags.if_block=!0:O.text==="import"?this._flags.import_block=!0:this._flags.import_block&&g(O,"from")&&(this._flags.import_block=!1))},P.prototype.handle_semicolon=function(O){this.start_of_statement(O)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(O);for(var G=this._tokens.peek();this._flags.mode===d.Statement&&!(this._flags.if_block&&g(G,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(O)},P.prototype.handle_string=function(O){O.text.startsWith("`")&&O.newlines===0&&O.whitespace_before===""&&(O.previous.text===")"||this._flags.last_token.type===i.WORD)||(this.start_of_statement(O)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(O),this._flags.last_token.type===i.RESERVED||this._flags.last_token.type===i.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR||this._flags.last_token.type===i.EQUALS||this._flags.last_token.type===i.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(O):O.text.startsWith("`")&&this._flags.last_token.type===i.END_EXPR&&(O.previous.text==="]"||O.previous.text===")")&&O.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(O)},P.prototype.handle_equals=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0},P.prototype.handle_comma=function(O){this.handle_whitespace_and_comments(O,!0),this.print_token(O),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(O)):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(O)},P.prototype.handle_operator=function(O){var G=O.text==="*"&&(E(this._flags.last_token,["function","yield"])||t(this._flags.last_token.type,[i.START_BLOCK,i.COMMA,i.END_BLOCK,i.SEMICOLON])),V=t(O.text,["-","+"])&&(t(this._flags.last_token.type,[i.START_BLOCK,i.START_EXPR,i.EQUALS,i.OPERATOR])||t(this._flags.last_token.text,s)||this._flags.last_token.text===",");if(!this.start_of_statement(O)){var ae=!G;this.handle_whitespace_and_comments(O,ae)}if(O.text==="*"&&this._flags.last_token.type===i.DOT){this.print_token(O);return}if(O.text==="::"){this.print_token(O);return}if(this._flags.last_token.type===i.OPERATOR&&t(this._options.operator_position,c)&&this.allow_wrap_or_preserved_newline(O),O.text===":"&&this._flags.in_case){this.print_token(O),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==i.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 ie=!0,fe=!0,ce=!1;if(O.text===":"?this._flags.ternary_depth===0?ie=!1:(this._flags.ternary_depth-=1,ce=!0):O.text==="?"&&(this._flags.ternary_depth+=1),!V&&!G&&this._options.preserve_newlines&&t(O.text,r)){var J=O.text===":",Z=J&&ce,he=J&&!ce;switch(this._options.operator_position){case h.before_newline:this._output.space_before_token=!he,this.print_token(O),(!J||Z)&&this.allow_wrap_or_preserved_newline(O),this._output.space_before_token=!0;return;case h.after_newline:this._output.space_before_token=!0,!J||Z?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(O):this._output.space_before_token=!1,this.print_token(O),this._output.space_before_token=!0;return;case h.preserve_newline:he||this.allow_wrap_or_preserved_newline(O),ie=!(this._output.just_added_newline()||he),this._output.space_before_token=ie,this.print_token(O),this._output.space_before_token=!0;return}}if(G){this.allow_wrap_or_preserved_newline(O),ie=!1;var X=this._tokens.peek();fe=X&&t(X.type,[i.WORD,i.RESERVED])}else if(O.text==="...")this.allow_wrap_or_preserved_newline(O),ie=this._flags.last_token.type===i.START_BLOCK,fe=!1;else if(t(O.text,["--","++","!","~"])||V){if((this._flags.last_token.type===i.COMMA||this._flags.last_token.type===i.START_EXPR)&&this.allow_wrap_or_preserved_newline(O),ie=!1,fe=!1,O.newlines&&(O.text==="--"||O.text==="++"||O.text==="~")){var $=E(this._flags.last_token,_)&&O.newlines;$&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline($,!0)}this._flags.last_token.text===";"&&D(this._flags.mode)&&(ie=!0),this._flags.last_token.type===i.RESERVED?ie=!0:this._flags.last_token.type===i.END_EXPR?ie=!(this._flags.last_token.text==="]"&&(O.text==="--"||O.text==="++")):this._flags.last_token.type===i.OPERATOR&&(ie=t(O.text,["--","-","++","+"])&&t(this._flags.last_token.text,["--","-","++","+"]),t(O.text,["+","-"])&&t(this._flags.last_token.text,["--","++"])&&(fe=!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||ie,this.print_token(O),this._output.space_before_token=fe},P.prototype.handle_block_comment=function(O,G){if(this._output.raw){this._output.add_raw_token(O),O.directives&&O.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(O.directives){this.print_newline(!1,G),this.print_token(O),O.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!a.newline.test(O.text)&&!O.newlines){this._output.space_before_token=!0,this.print_token(O),this._output.space_before_token=!0;return}else this.print_block_commment(O,G)},P.prototype.print_block_commment=function(O,G){var V=b(O.text),ae,ie=!1,fe=!1,ce=O.whitespace_before,J=ce.length;if(this.print_newline(!1,G),this.print_token_line_indentation(O),this._output.add_token(V[0]),this.print_newline(!1,G),V.length>1){for(V=V.slice(1),ie=I(V,"*"),fe=w(V,ce),ie&&(this._flags.alignment=1),ae=0;ae<V.length;ae++)ie?(this.print_token_line_indentation(O),this._output.add_token(y(V[ae]))):fe&&V[ae]?(this.print_token_line_indentation(O),this._output.add_token(V[ae].substring(J))):(this._output.current_line.set_indent(-1),this._output.add_token(V[ae])),this.print_newline(!1,G);this._flags.alignment=0}},P.prototype.handle_comment=function(O,G){O.newlines?this.print_newline(!1,G):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(O),this.print_newline(!1,G)},P.prototype.handle_dot=function(O){this.start_of_statement(O)||this.handle_whitespace_and_comments(O,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),E(this._flags.last_token,_)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(O,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(O)},P.prototype.handle_unknown=function(O,G){this.print_token(O),O.text[O.text.length-1]===`
|
|
`&&this.print_newline(!1,G)},P.prototype.handle_eof=function(O){for(;this._flags.mode===d.Statement;)this.restore_mode();this.handle_whitespace_and_comments(O)},e.exports.Beautifier=P},function(e){function A(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=[]}A.prototype.clone_empty=function(){var o=new A(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},A.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},A.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},A.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.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},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},A.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.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 f(o,a){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)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}f.prototype.get_indent_size=function(o,a){var n=this.__base_string_length;return a=a||0,o<0&&(n=0),n+=o*this.__indent_size,n+=a,n},f.prototype.get_indent_string=function(o,a){var n=this.__base_string;return a=a||0,o<0&&(o=0,n=""),a+=o*this.__indent_size,this.__ensure_cache(a),n+=this.__cache[a],n},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,a=0,n="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,n=new Array(a+1).join(this.__indent_string)),o&&(n+=new Array(o+1).join(" ")),this.__cache.push(n)};function p(o,a){this.__indent_cache=new f(o,a),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 A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},p.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(n=n.replace(/[\n]/g,o)),n},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)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},p.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()},p.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(" "))},p.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},p.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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(o,a){for(var n=this.__lines.length-2;n>=0;){var l=this.__lines[n];if(l.is_empty())break;if(l.item(0).indexOf(o)!==0&&l.item(-1)!==a){this.__lines.splice(n+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},e.exports.Output=p},function(e){function A(f,p,o,a){this.type=f,this.text=p,this.comments_before=null,this.newlines=o||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}e.exports.Token=A},function(e,A){var f="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",p="\\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",a="\\u0300-\\u036f\\u0483-\\u0487\\u0591-\\u05bd\\u05bf\\u05c1\\u05c2\\u05c4\\u05c5\\u05c7\\u0610-\\u061a\\u0620-\\u0649\\u0672-\\u06d3\\u06e7-\\u06e8\\u06fb-\\u06fc\\u0730-\\u074a\\u0800-\\u0814\\u081b-\\u0823\\u0825-\\u0827\\u0829-\\u082d\\u0840-\\u0857\\u08e4-\\u08fe\\u0900-\\u0903\\u093a-\\u093c\\u093e-\\u094f\\u0951-\\u0957\\u0962-\\u0963\\u0966-\\u096f\\u0981-\\u0983\\u09bc\\u09be-\\u09c4\\u09c7\\u09c8\\u09d7\\u09df-\\u09e0\\u0a01-\\u0a03\\u0a3c\\u0a3e-\\u0a42\\u0a47\\u0a48\\u0a4b-\\u0a4d\\u0a51\\u0a66-\\u0a71\\u0a75\\u0a81-\\u0a83\\u0abc\\u0abe-\\u0ac5\\u0ac7-\\u0ac9\\u0acb-\\u0acd\\u0ae2-\\u0ae3\\u0ae6-\\u0aef\\u0b01-\\u0b03\\u0b3c\\u0b3e-\\u0b44\\u0b47\\u0b48\\u0b4b-\\u0b4d\\u0b56\\u0b57\\u0b5f-\\u0b60\\u0b66-\\u0b6f\\u0b82\\u0bbe-\\u0bc2\\u0bc6-\\u0bc8\\u0bca-\\u0bcd\\u0bd7\\u0be6-\\u0bef\\u0c01-\\u0c03\\u0c46-\\u0c48\\u0c4a-\\u0c4d\\u0c55\\u0c56\\u0c62-\\u0c63\\u0c66-\\u0c6f\\u0c82\\u0c83\\u0cbc\\u0cbe-\\u0cc4\\u0cc6-\\u0cc8\\u0cca-\\u0ccd\\u0cd5\\u0cd6\\u0ce2-\\u0ce3\\u0ce6-\\u0cef\\u0d02\\u0d03\\u0d46-\\u0d48\\u0d57\\u0d62-\\u0d63\\u0d66-\\u0d6f\\u0d82\\u0d83\\u0dca\\u0dcf-\\u0dd4\\u0dd6\\u0dd8-\\u0ddf\\u0df2\\u0df3\\u0e34-\\u0e3a\\u0e40-\\u0e45\\u0e50-\\u0e59\\u0eb4-\\u0eb9\\u0ec8-\\u0ecd\\u0ed0-\\u0ed9\\u0f18\\u0f19\\u0f20-\\u0f29\\u0f35\\u0f37\\u0f39\\u0f41-\\u0f47\\u0f71-\\u0f84\\u0f86-\\u0f87\\u0f8d-\\u0f97\\u0f99-\\u0fbc\\u0fc6\\u1000-\\u1029\\u1040-\\u1049\\u1067-\\u106d\\u1071-\\u1074\\u1082-\\u108d\\u108f-\\u109d\\u135d-\\u135f\\u170e-\\u1710\\u1720-\\u1730\\u1740-\\u1750\\u1772\\u1773\\u1780-\\u17b2\\u17dd\\u17e0-\\u17e9\\u180b-\\u180d\\u1810-\\u1819\\u1920-\\u192b\\u1930-\\u193b\\u1951-\\u196d\\u19b0-\\u19c0\\u19c8-\\u19c9\\u19d0-\\u19d9\\u1a00-\\u1a15\\u1a20-\\u1a53\\u1a60-\\u1a7c\\u1a7f-\\u1a89\\u1a90-\\u1a99\\u1b46-\\u1b4b\\u1b50-\\u1b59\\u1b6b-\\u1b73\\u1bb0-\\u1bb9\\u1be6-\\u1bf3\\u1c00-\\u1c22\\u1c40-\\u1c49\\u1c5b-\\u1c7d\\u1cd0-\\u1cd2\\u1d00-\\u1dbe\\u1e01-\\u1f15\\u200c\\u200d\\u203f\\u2040\\u2054\\u20d0-\\u20dc\\u20e1\\u20e5-\\u20f0\\u2d81-\\u2d96\\u2de0-\\u2dff\\u3021-\\u3028\\u3099\\u309a\\ua640-\\ua66d\\ua674-\\ua67d\\ua69f\\ua6f0-\\ua6f1\\ua7f8-\\ua800\\ua806\\ua80b\\ua823-\\ua827\\ua880-\\ua881\\ua8b4-\\ua8c4\\ua8d0-\\ua8d9\\ua8f3-\\ua8f7\\ua900-\\ua909\\ua926-\\ua92d\\ua930-\\ua945\\ua980-\\ua983\\ua9b3-\\ua9c0\\uaa00-\\uaa27\\uaa40-\\uaa41\\uaa4c-\\uaa4d\\uaa50-\\uaa59\\uaa7b\\uaae0-\\uaae9\\uaaf2-\\uaaf3\\uabc0-\\uabe1\\uabec\\uabed\\uabf0-\\uabf9\\ufb20-\\ufb28\\ufe00-\\ufe0f\\ufe20-\\ufe26\\ufe33\\ufe34\\ufe4d-\\ufe4f\\uff10-\\uff19\\uff3f",n="(?:\\\\u[0-9a-fA-F]{4}|["+f+o+"])",l="(?:\\\\u[0-9a-fA-F]{4}|["+p+o+a+"])*";A.identifier=new RegExp(n+l,"g"),A.identifierStart=new RegExp(n),A.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+p+o+a+"])+");var s=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;A.newline=/[\n\r\u2028\u2029]/,A.lineBreak=new RegExp(`\r
|
|
|`+A.newline.source),A.allLineBreaks=new RegExp(A.lineBreak.source,"g")},function(e,A,f){var p=f(6).Options,o=["before-newline","after-newline","preserve-newline"];function a(n){p.call(this,n,"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 r=0;r<s.length;r++)s[r]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=s[r];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)}a.prototype=new p,e.exports.Options=a},function(e){function A(o,a){this.raw_options=f(o,a),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"])}A.prototype._get_array=function(o,a){var n=this.raw_options[o],l=a||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(l=n.concat()):typeof n=="string"&&(l=n.split(/[^a-zA-Z0-9_\/\-]+/)),l},A.prototype._get_boolean=function(o,a){var n=this.raw_options[o],l=n===void 0?!!a:!!n;return l},A.prototype._get_characters=function(o,a){var n=this.raw_options[o],l=a||"";return typeof n=="string"&&(l=n.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},A.prototype._get_number=function(o,a){var n=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var l=parseInt(n,10);return isNaN(l)&&(l=a),l},A.prototype._get_selection=function(o,a,n){var l=this._get_selection_list(o,a,n);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return l[0]},A.prototype._get_selection_list=function(o,a,n){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[a[0]],!this._is_valid_selection(n,a))throw new Error("Invalid Default Value!");var l=this._get_array(o,n);if(!this._is_valid_selection(l,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return l},A.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(n){return a.indexOf(n)===-1})};function f(o,a){var n={};o=p(o);var l;for(l in o)l!==a&&(n[l]=o[l]);if(a&&o[a])for(l in o[a])n[l]=o[a][l];return n}function p(o){var a={},n;for(n in o){var l=n.replace(/-/g,"_");a[l]=o[n]}return a}e.exports.Options=A,e.exports.normalizeOpts=p,e.exports.mergeOpts=f},function(e,A,f){var p=f(8).InputScanner,o=f(9).Tokenizer,a=f(9).TOKEN,n=f(13).Directives,l=f(4),s=f(12).Pattern,r=f(14).TemplatablePattern;function i(I,w){return w.indexOf(I)!==-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:a.START,RAW:a.RAW,EOF:a.EOF},y=new n(/\/\*/,/\*\//),m=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,g=/[0-9]/,E=/[^\d\.]/,_=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".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"]),T=new RegExp("^(?:"+d.join("|")+")$"),b,S=function(I,w){o.call(this,I,w),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var P=new s(this._input),U=new r(this._input).read_options(this._options);this.__patterns={template:U,identifier:U.starting_with(l.identifier).matching(l.identifierMatch),number:P.matching(m),punct:P.matching(h),comment:P.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:P.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:P.matching(/<!--/),html_comment_end:P.matching(/-->/),include:P.starting_with(/#include/).until_after(l.lineBreak),shebang:P.starting_with(/#!/).until_after(l.lineBreak),xml:P.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(/[`}\\]/)}};S.prototype=new o,S.prototype._is_comment=function(I){return I.type===t.COMMENT||I.type===t.BLOCK_COMMENT||I.type===t.UNKNOWN},S.prototype._is_opening=function(I){return I.type===t.START_BLOCK||I.type===t.START_EXPR},S.prototype._is_closing=function(I,w){return(I.type===t.END_BLOCK||I.type===t.END_EXPR)&&w&&(I.text==="]"&&w.text==="["||I.text===")"&&w.text==="("||I.text==="}"&&w.text==="{")},S.prototype._reset=function(){b=!1},S.prototype._get_next_token=function(I,w){var P=null;this._readWhitespace();var U=this._input.peek();return U===null?this._create_token(t.EOF,""):(P=P||this._read_non_javascript(U),P=P||this._read_string(U),P=P||this._read_word(I),P=P||this._read_singles(U),P=P||this._read_comment(U),P=P||this._read_regexp(U,I),P=P||this._read_xml(U,I),P=P||this._read_punctuation(),P=P||this._create_token(t.UNKNOWN,this._input.next()),P)},S.prototype._read_word=function(I){var w;if(w=this.__patterns.identifier.read(),w!=="")return w=w.replace(l.allLineBreaks,`
|
|
`),!(I.type===t.DOT||I.type===t.RESERVED&&(I.text==="set"||I.text==="get"))&&T.test(w)?(w==="in"||w==="of")&&(I.type===t.WORD||I.type===t.STRING)?this._create_token(t.OPERATOR,w):this._create_token(t.RESERVED,w):this._create_token(t.WORD,w);if(w=this.__patterns.number.read(),w!=="")return this._create_token(t.WORD,w)},S.prototype._read_singles=function(I){var w=null;return I==="("||I==="["?w=this._create_token(t.START_EXPR,I):I===")"||I==="]"?w=this._create_token(t.END_EXPR,I):I==="{"?w=this._create_token(t.START_BLOCK,I):I==="}"?w=this._create_token(t.END_BLOCK,I):I===";"?w=this._create_token(t.SEMICOLON,I):I==="."&&E.test(this._input.peek(1))?w=this._create_token(t.DOT,I):I===","&&(w=this._create_token(t.COMMA,I)),w&&this._input.next(),w},S.prototype._read_punctuation=function(){var I=this.__patterns.punct.read();if(I!=="")return I==="="?this._create_token(t.EQUALS,I):I==="?."?this._create_token(t.DOT,I):this._create_token(t.OPERATOR,I)},S.prototype._read_non_javascript=function(I){var w="";if(I==="#"){if(this._is_first_token()&&(w=this.__patterns.shebang.read(),w))return this._create_token(t.UNKNOWN,w.trim()+`
|
|
`);if(w=this.__patterns.include.read(),w)return this._create_token(t.UNKNOWN,w.trim()+`
|
|
`);I=this._input.next();var P="#";if(this._input.hasNext()&&this._input.testChar(g)){do I=this._input.next(),P+=I;while(this._input.hasNext()&&I!=="#"&&I!=="=");return I==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(P+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(P+="{}",this._input.next(),this._input.next())),this._create_token(t.WORD,P)}this._input.back()}else if(I==="<"&&this._is_first_token()){if(w=this.__patterns.html_comment_start.read(),w){for(;this._input.hasNext()&&!this._input.testChar(l.newline);)w+=this._input.next();return b=!0,this._create_token(t.COMMENT,w)}}else if(b&&I==="-"&&(w=this.__patterns.html_comment_end.read(),w))return b=!1,this._create_token(t.COMMENT,w);return null},S.prototype._read_comment=function(I){var w=null;if(I==="/"){var P="";if(this._input.peek(1)==="*"){P=this.__patterns.block_comment.read();var U=y.get_directives(P);U&&U.ignore==="start"&&(P+=y.readIgnored(this._input)),P=P.replace(l.allLineBreaks,`
|
|
`),w=this._create_token(t.BLOCK_COMMENT,P),w.directives=U}else this._input.peek(1)==="/"&&(P=this.__patterns.comment.read(),w=this._create_token(t.COMMENT,P))}return w},S.prototype._read_string=function(I){if(I==="`"||I==="'"||I==='"'){var w=this._input.next();return this.has_char_escapes=!1,I==="`"?w+=this._read_string_recursive("`",!0,"${"):w+=this._read_string_recursive(I),this.has_char_escapes&&this._options.unescape_strings&&(w=D(w)),this._input.peek()===I&&(w+=this._input.next()),w=w.replace(l.allLineBreaks,`
|
|
`),this._create_token(t.STRING,w)}return null},S.prototype._allow_regexp_or_xml=function(I){return I.type===t.RESERVED&&i(I.text,["return","case","throw","else","do","typeof","yield"])||I.type===t.END_EXPR&&I.text===")"&&I.opened.previous.type===t.RESERVED&&i(I.opened.previous.text,["if","while","for"])||i(I.type,[t.COMMENT,t.START_EXPR,t.START_BLOCK,t.START,t.END_BLOCK,t.OPERATOR,t.EQUALS,t.EOF,t.SEMICOLON,t.COMMA])},S.prototype._read_regexp=function(I,w){if(I==="/"&&this._allow_regexp_or_xml(w)){for(var P=this._input.next(),U=!1,O=!1;this._input.hasNext()&&(U||O||this._input.peek()!==I)&&!this._input.testChar(l.newline);)P+=this._input.peek(),U?U=!1:(U=this._input.peek()==="\\",this._input.peek()==="["?O=!0:this._input.peek()==="]"&&(O=!1)),this._input.next();return this._input.peek()===I&&(P+=this._input.next(),P+=this._input.read(l.identifier)),this._create_token(t.STRING,P)}return null},S.prototype._read_xml=function(I,w){if(this._options.e4x&&I==="<"&&this._allow_regexp_or_xml(w)){var P="",U=this.__patterns.xml.read_match();if(U){for(var O=U[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),G=O.indexOf("{")===0,V=0;U;){var ae=!!U[1],ie=U[2],fe=!!U[U.length-1]||ie.slice(0,8)==="![CDATA[";if(!fe&&(ie===O||G&&ie.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(ae?--V:++V),P+=U[0],V<=0)break;U=this.__patterns.xml.read_match()}return U||(P+=this._input.match(/[\s\S]*/g)[0]),P=P.replace(l.allLineBreaks,`
|
|
`),this._create_token(t.STRING,P)}}return null};function D(I){for(var w="",P=0,U=new p(I),O=null;U.hasNext();)if(O=U.match(/([\s]|[^\\]|\\\\)+/g),O&&(w+=O[0]),U.peek()==="\\"){if(U.next(),U.peek()==="x")O=U.match(/x([0-9A-Fa-f]{2})/g);else if(U.peek()==="u")O=U.match(/u([0-9A-Fa-f]{4})/g);else{w+="\\",U.hasNext()&&(w+=U.next());continue}if(!O)return I;if(P=parseInt(O[1],16),P>126&&P<=255&&O[0].indexOf("x")===0)return I;if(P>=0&&P<32){w+="\\"+O[0];continue}else P===34||P===39||P===92?w+="\\"+String.fromCharCode(P):w+=String.fromCharCode(P)}return w}S.prototype._read_string_recursive=function(I,w,P){var U,O;I==="'"?O=this.__patterns.single_quote:I==='"'?O=this.__patterns.double_quote:I==="`"?O=this.__patterns.template_text:I==="}"&&(O=this.__patterns.template_expression);for(var G=O.read(),V="";this._input.hasNext();){if(V=this._input.next(),V===I||!w&&l.newline.test(V)){this._input.back();break}else V==="\\"&&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(),V+=this._input.next()):P&&(P==="${"&&V==="$"&&this._input.peek()==="{"&&(V+=this._input.next()),P===V&&(I==="`"?V+=this._read_string_recursive("}",w,"`"):V+=this._read_string_recursive("`",w,"${"),this._input.hasNext()&&(V+=this._input.next())));V+=O.read(),G+=V}return G},e.exports.Tokenizer=S,e.exports.TOKEN=t,e.exports.positionable_operators=_.slice(),e.exports.line_starters=c.slice()},function(e){var A=RegExp.prototype.hasOwnProperty("sticky");function f(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},f.prototype.peek=function(p){var o=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(o=this.__input.charAt(p)),o},f.prototype.__match=function(p,o){p.lastIndex=o;var a=p.exec(this.__input);return a&&!(A&&p.sticky)&&(a.index!==o&&(a=null)),a},f.prototype.test=function(p,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(p,o):!1},f.prototype.testChar=function(p,o){var a=this.peek(o);return p.lastIndex=0,a!==null&&p.test(a)},f.prototype.match=function(p){var o=this.__match(p,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(p,o,a){var n="",l;return p&&(l=this.match(p),l&&(n+=l[0])),o&&(l||!p)&&(n+=this.readUntil(o,a)),n},f.prototype.readUntil=function(p,o){var a="",n=this.__position;p.lastIndex=this.__position;var l=p.exec(this.__input);return l?(n=l.index,o&&(n+=l[0].length)):n=this.__input_length,a=this.__input.substring(this.__position,n),this.__position=n,a},f.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},f.prototype.get_regexp=function(p,o){var a=null,n="g";return o&&A&&(n="y"),typeof p=="string"&&p!==""?a=new RegExp(p,n):p&&(a=new RegExp(p.source,n)),a},f.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(p){var o=this.__position,a=this.readUntilAfter(p);return this.__position=o,a},f.prototype.lookBack=function(p){var o=this.__position-1;return o>=p.length&&this.__input.substring(o-p.length,o).toLowerCase()===p},e.exports.InputScanner=f},function(e,A,f){var p=f(8).InputScanner,o=f(3).Token,a=f(10).TokenStream,n=f(11).WhitespacePattern,l={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},s=function(r,i){this._input=new p(r),this._options=i||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new n(this._input)};s.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var r,i=new o(l.START,""),t=null,y=[],m=new a;i.type!==l.EOF;){for(r=this._get_next_token(i,t);this._is_comment(r);)m.add(r),r=this._get_next_token(i,t);m.isEmpty()||(r.comments_before=m,m=new a),r.parent=t,this._is_opening(r)?(y.push(t),t=r):t&&this._is_closing(r,t)&&(r.opened=t,t.closed=r,t=y.pop(),r.parent=t),r.previous=i,i.next=r,this.__tokens.add(r),i=r}return this.__tokens},s.prototype._is_first_token=function(){return this.__tokens.isEmpty()},s.prototype._reset=function(){},s.prototype._get_next_token=function(r,i){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(r){return!1},s.prototype._is_opening=function(r){return!1},s.prototype._is_closing=function(r,i){return!1},s.prototype._create_token=function(r,i){var t=new o(r,i,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 A(f){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=f}A.prototype.restart=function(){this.__position=0},A.prototype.isEmpty=function(){return this.__tokens_length===0},A.prototype.hasNext=function(){return this.__position<this.__tokens_length},A.prototype.next=function(){var f=null;return this.hasNext()&&(f=this.__tokens[this.__position],this.__position+=1),f},A.prototype.peek=function(f){var p=null;return f=f||0,f+=this.__position,f>=0&&f<this.__tokens_length&&(p=this.__tokens[f]),p},A.prototype.add=function(f){this.__parent_token&&(f.parent=this.__parent_token),this.__tokens.push(f),this.__tokens_length+=1},e.exports.TokenStream=A},function(e,A,f){var p=f(12).Pattern;function o(a,n){p.call(this,a,n),n?this._line_regexp=this._input.get_regexp(n._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}o.prototype=new p,o.prototype.__set_whitespace_patterns=function(a,n){a+="\\t ",n+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+n+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+n+"]")},o.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var a=this._input.read(this._match_pattern);if(a===" ")this.whitespace_before_token=" ";else if(a){var n=this.__split(this._newline_regexp,a);this.newline_count=n.length-1,this.whitespace_before_token=n[this.newline_count]}return a},o.prototype.matching=function(a,n){var l=this._create();return l.__set_whitespace_patterns(a,n),l._update(),l},o.prototype._create=function(){return new o(this._input,this)},o.prototype.__split=function(a,n){a.lastIndex=0;for(var l=0,s=[],r=a.exec(n);r;)s.push(n.substring(l,r.index)),l=r.index+r[0].length,r=a.exec(n);return l<n.length?s.push(n.substring(l,n.length)):s.push(""),s},e.exports.WhitespacePattern=o},function(e){function A(f,p){this._input=f,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,p&&(this._starting_pattern=this._input.get_regexp(p._starting_pattern,!0),this._match_pattern=this._input.get_regexp(p._match_pattern,!0),this._until_pattern=this._input.get_regexp(p._until_pattern),this._until_after=p._until_after)}A.prototype.read=function(){var f=this._input.read(this._starting_pattern);return(!this._starting_pattern||f)&&(f+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),f},A.prototype.read_match=function(){return this._input.match(this._match_pattern)},A.prototype.until_after=function(f){var p=this._create();return p._until_after=!0,p._until_pattern=this._input.get_regexp(f),p._update(),p},A.prototype.until=function(f){var p=this._create();return p._until_after=!1,p._until_pattern=this._input.get_regexp(f),p._update(),p},A.prototype.starting_with=function(f){var p=this._create();return p._starting_pattern=this._input.get_regexp(f,!0),p._update(),p},A.prototype.matching=function(f){var p=this._create();return p._match_pattern=this._input.get_regexp(f,!0),p._update(),p},A.prototype._create=function(){return new A(this._input,this)},A.prototype._update=function(){},e.exports.Pattern=A},function(e){function A(f,p){f=typeof f=="string"?f:f.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+p,"g")}A.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)p[o[1]]=o[2],o=this.__directive_pattern.exec(f);return p},A.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=A},function(e,A,f){var p=f(12).Pattern,o={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(n,l){p.call(this,n,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 p(n);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}/)}}a.prototype=new p,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(n){var l=this._create();return l._disabled[n]=!0,l._update(),l},a.prototype.read_options=function(n){var l=this._create();for(var s in o)l._disabled[s]=n.templating.indexOf(s)===-1;return l._update(),l},a.prototype.exclude=function(n){var l=this._create();return l._excluded[n]=!0,l._update(),l},a.prototype.read=function(){var n="";this._match_pattern?n=this._input.read(this._starting_pattern):n=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),n+=l,l=this._read_template();return this._until_after&&(n+=this._input.readUntilAfter(this._until_pattern)),n},a.prototype.__set_templated_pattern=function(){var n=[];this._disabled.php||n.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||n.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||n.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(n.push(this.__patterns.django._starting_pattern.source),n.push(this.__patterns.django_value._starting_pattern.source),n.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||n.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&n.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+n.join("|")+")")},a.prototype._read_template=function(){var n="",l=this._input.peek();if(l==="<"){var s=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&s==="?"&&(n=n||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&s==="%"&&(n=n||this.__patterns.erb.read())}else l==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(n=n||this.__patterns.handlebars_comment.read(),n=n||this.__patterns.handlebars_unescaped.read(),n=n||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(n=n||this.__patterns.django_value.read()),this._excluded.django||(n=n||this.__patterns.django_comment.read(),n=n||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(n=n||this.__patterns.smarty_comment.read(),n=n||this.__patterns.smarty_literal.read(),n=n||this.__patterns.smarty.read()));return n},e.exports.TemplatablePattern=a}],R={};function B(e){var A=R[e];if(A!==void 0)return A.exports;var f=R[e]={exports:{}};return L[e](f,f.exports,B),f.exports}var N=B(0);C=N})();var j=C;!(te=[],H=function(){return{js_beautify:j}}.apply(ue,te),H!==void 0&&(Qe.exports=H))})()},"746U":function(Qe,ue,W){"use strict";W.d(ue,"f",function(){return te}),W.d(ue,"l",function(){return H}),W.d(ue,"k",function(){return C}),W.d(ue,"j",function(){return j}),W.d(ue,"g",function(){return L}),W.d(ue,"m",function(){return R}),W.d(ue,"h",function(){return B}),W.d(ue,"n",function(){return N}),W.d(ue,"c",function(){return e}),W.d(ue,"a",function(){return A}),W.d(ue,"i",function(){return f}),W.d(ue,"o",function(){return p}),W.d(ue,"e",function(){return n}),W.d(ue,"d",function(){return l}),W.d(ue,"p",function(){return s}),W.d(ue,"b",function(){return r});function te(i){return Array.isArray(i)}function H(i){return typeof i=="string"}function C(i){return typeof i=="object"&&i!==null&&!Array.isArray(i)&&!(i instanceof RegExp)&&!(i instanceof Date)}function j(i){return typeof i=="number"&&!isNaN(i)}function L(i){return i===!0||i===!1}function R(i){return typeof i=="undefined"}function B(i){return!N(i)}function N(i){return R(i)||i===null}function e(i,t){if(!i)throw new Error(t?`Unexpected type, expected '${t}'`:"Unexpected type")}function A(i){if(N(i))throw new Error("Assertion Failed: argument is undefined or null");return i}function f(i){return typeof i=="function"}function p(i,t){const y=Math.min(i.length,t.length);for(let m=0;m<y;m++)o(i[m],t[m])}function o(i,t){if(H(t)){if(typeof i!==t)throw new Error(`argument does not match constraint: typeof ${t}`)}else if(f(t)){try{if(i instanceof t)return}catch(y){}if(!N(i)&&i.constructor===t)return;if(t.length===1&&t.call(void 0,i)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function a(i){let t=[],y=Object.getPrototypeOf(i);for(;Object.prototype!==y;)t=t.concat(Object.getOwnPropertyNames(y)),y=Object.getPrototypeOf(y);return t}function n(i){const t=[];for(const y of a(i))typeof i[y]=="function"&&t.push(y);return t}function l(i,t){const y=g=>function(){const E=Array.prototype.slice.call(arguments,0);return t(g,E)};let m={};for(const g of i)m[g]=y(g);return m}function s(i){return i===null?void 0:i}function r(i,t="Unreachable"){throw new Error(t)}},"815F":function(Qe,ue,W){"use strict";W.d(ue,"e",function(){return B}),W.d(ue,"c",function(){return e}),W.d(ue,"d",function(){return A}),W.d(ue,"a",function(){return p}),W.d(ue,"f",function(){return o}),W.d(ue,"b",function(){return a});var te=W("KQm4"),H=W("VTBJ"),C=W("Ff2n"),j=W("Zm9Q"),L=W("Kwbf"),R=W("OZM5");function B(n,l){return n!=null?n:l}function N(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],l=new Map;function s(r){var i=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"";(r||[]).forEach(function(t){var y=t.key,m=t.children;Object(L.a)(y!=null,"Tree node must have a certain key: [".concat(i).concat(y,"]"));var g=String(y);Object(L.a)(!l.has(g)||y===null||y===void 0,"Same 'key' exist in the Tree: ".concat(g)),l.set(g,!0),s(m,"".concat(i).concat(g," > "))})}s(n)}function e(n){function l(s){var r=Object(j.a)(s);return r.map(function(i){if(!Object(R.i)(i))return Object(L.a)(!i,"Tree/TreeNode can only accept TreeNode as children."),null;var t=i.key,y=i.props,m=y.children,g=Object(C.a)(y,["children"]),E=Object(H.a)({key:t},g),_=l(m);return _.length&&(E.children=_),E}).filter(function(i){return i})}return l(n)}function A(){var n=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),r=[];function i(t){var y=arguments.length>1&&arguments[1]!==void 0?arguments[1]:null;return t.map(function(m,g){var E=Object(R.h)(y?y.pos:"0",g),_=B(m.key,E),u=Object(H.a)(Object(H.a)({},m),{},{parent:y,pos:E,children:null,data:m,isStart:[].concat(Object(te.a)(y?y.isStart:[]),[g===0]),isEnd:[].concat(Object(te.a)(y?y.isEnd:[]),[g===t.length-1])});return r.push(u),l===!0||s.has(_)?u.children=i(m.children||[],u):u.children=[],u})}return i(n),r}function f(n,l,s){var r;s?typeof s=="string"?r=function(y){return y[s]}:typeof s=="function"&&(r=function(y){return s(y)}):r=function(y,m){return B(y.key,m)};function i(t,y,m){var g=t?t.children:n,E=t?Object(R.h)(m.pos,y):"0";if(t){var _=r(t,E),u={node:t,index:y,pos:E,key:_,parentPos:m.node?m.pos:null,level:m.level+1};l(u)}g&&g.forEach(function(h,c){i(h,c,{node:t,pos:E,level:m?m.level+1:-1})})}i(null)}function p(n){var l=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},s=l.initWrapper,r=l.processEntity,i=l.onProcessFinished,t=arguments.length>2?arguments[2]:void 0,y={},m={},g={posEntities:y,keyEntities:m};return s&&(g=s(g)||g),f(n,function(E){var _=E.node,u=E.index,h=E.pos,c=E.key,d=E.parentPos,T=E.level,b={node:_,index:u,key:c,pos:h,level:T},S=B(c,h);y[h]=b,m[S]=b,b.parent=y[d],b.parent&&(b.parent.children=b.parent.children||[],b.parent.children.push(b)),r&&r(b,g)},t),i&&i(g),g}function o(n,l){var s=l.expandedKeys,r=l.selectedKeys,i=l.loadedKeys,t=l.loadingKeys,y=l.checkedKeys,m=l.halfCheckedKeys,g=l.dragOverNodeKey,E=l.dropPosition,_=l.keyEntities,u=_[n],h={eventKey:n,expanded:s.indexOf(n)!==-1,selected:r.indexOf(n)!==-1,loaded:i.indexOf(n)!==-1,loading:t.indexOf(n)!==-1,checked:y.indexOf(n)!==-1,halfChecked:m.indexOf(n)!==-1,pos:String(u?u.pos:""),dragOver:g===n&&E===0,dragOverGapTop:g===n&&E===-1,dragOverGapBottom:g===n&&E===1};return h}function a(n){var l=n.data,s=n.expanded,r=n.selected,i=n.checked,t=n.loaded,y=n.loading,m=n.halfChecked,g=n.dragOver,E=n.dragOverGapTop,_=n.dragOverGapBottom,u=n.pos,h=n.active,c=Object(H.a)(Object(H.a)({},l),{},{expanded:s,selected:r,checked:i,loaded:t,loading:y,halfChecked:m,dragOver:g,dragOverGapTop:E,dragOverGapBottom:_,pos:u,active:h});return"props"in c||Object.defineProperty(c,"props",{get:function(){return Object(L.a)(!1,"Second param return from event is node data instead of TreeNode instance. Please read value directly instead of reading from `props`."),n}}),c}},"8HAY":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return L}),W.d(ue,"b",function(){return R}),W.d(ue,"d",function(){return B}),W.d(ue,"e",function(){return N}),W.d(ue,"c",function(){return e});var te=W("MI8n"),H=W("pmY6"),C=W("3/fG"),j=function(A,f,p,o){function a(n){return n instanceof p?n:new p(function(l){l(n)})}return new(p||(p=Promise))(function(n,l){function s(t){try{i(o.next(t))}catch(y){l(y)}}function r(t){try{i(o.throw(t))}catch(y){l(y)}}function i(t){t.done?n(t.value):a(t.value).then(s,r)}i((o=o.apply(A,f||[])).next())})};class L extends H.a{constructor(A,f="",p="",o=!0,a){super();this._onDidChange=this._register(new te.b),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=A,this._label=f,this._cssClass=p,this._enabled=o,this._actionCallback=a}get id(){return this._id}get label(){return this._label}set label(A){this._setLabel(A)}_setLabel(A){this._label!==A&&(this._label=A,this._onDidChange.fire({label:A}))}get tooltip(){return this._tooltip||""}set tooltip(A){this._setTooltip(A)}_setTooltip(A){this._tooltip!==A&&(this._tooltip=A,this._onDidChange.fire({tooltip:A}))}get class(){return this._cssClass}set class(A){this._setClass(A)}_setClass(A){this._cssClass!==A&&(this._cssClass=A,this._onDidChange.fire({class:A}))}get enabled(){return this._enabled}set enabled(A){this._setEnabled(A)}_setEnabled(A){this._enabled!==A&&(this._enabled=A,this._onDidChange.fire({enabled:A}))}get checked(){return this._checked}set checked(A){this._setChecked(A)}_setChecked(A){this._checked!==A&&(this._checked=A,this._onDidChange.fire({checked:A}))}run(A,f){return j(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(A))})}}class R extends H.a{constructor(){super(...arguments);this._onBeforeRun=this._register(new te.b),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new te.b),this.onDidRun=this._onDidRun.event}run(A,f){return j(this,void 0,void 0,function*(){if(!A.enabled)return;this._onBeforeRun.fire({action:A});let p;try{yield this.runAction(A,f)}catch(o){p=o}this._onDidRun.fire({action:A,error:p})})}runAction(A,f){return j(this,void 0,void 0,function*(){yield A.run(f)})}}class B extends L{constructor(A){super(B.ID,A,A?"separator text":"separator");this.checked=!1,this.enabled=!1}}B.ID="vs.actions.separator";class N{constructor(A,f,p,o){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=A,this.label=f,this.class=o,this._actions=p}get actions(){return this._actions}dispose(){}run(){return j(this,void 0,void 0,function*(){})}}class e extends L{constructor(){super(e.ID,C.a("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},"8Jsi":function(Qe,ue,W){"use strict";W.d(ue,"d",function(){return d}),W.d(ue,"a",function(){return Re}),W.d(ue,"b",function(){return Ne}),W.d(ue,"c",function(){return Ie});var te=W("1OyB"),H=W("vuIU"),C=W("Ji7U"),j=W("LK+K"),L=W("KQm4"),R=W("U8pU"),B=W("ODXe"),N=W("VTBJ"),e=W("q1tI"),A=W("qNPg"),f=W("2Qr1"),p=W("815F"),o=W("NvD2"),a=W("wPlo"),n=W("6cGi"),l=W("Kwbf"),s=W("4IlW"),r=W("YrtM"),i=W("fAei"),t=e.createContext(null);function y(oe,me){if(!oe)return!0;var be=oe.data,xe=be.disabled,Ce=be.disableCheckbox;switch(me){case"select":return xe;case"checkbox":return xe||Ce}return!1}function m(oe,me){var be=e.useCallback(function(Ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",Se=arguments.length>2?arguments[2]:void 0,Ue=oe.get(Ce);return!Se&&y(Ue,Oe)?null:Ue},[oe]),xe=e.useCallback(function(Ce){var Oe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"select",Se=arguments.length>2?arguments[2]:void 0,Ue=me.get(Ce);return!Se&&y(Ue,Oe)?null:Ue},[me]);return[be,xe]}function g(oe){return e.useMemo(function(){var me=new Map,be=new Map;return oe.forEach(function(xe){me.set(xe.key,xe),be.set(xe.data.value,xe)}),[me,be]},[oe])}var E={width:0,height:0,display:"flex",overflow:"hidden",opacity:0,border:0,padding:0,margin:0},_=function(me,be){var xe=me.prefixCls,Ce=me.height,Oe=me.itemHeight,Se=me.virtual,Ue=me.options,Be=me.flattenOptions,Te=me.multiple,De=me.searchValue,de=me.onSelect,re=me.onToggleOpen,le=me.open,z=me.notFoundContent,Q=me.onMouseEnter,q=e.useContext(t),ee=q.checkable,ve=q.checkedKeys,we=q.halfCheckedKeys,Fe=q.treeExpandedKeys,Ge=q.treeDefaultExpandAll,Je=q.treeDefaultExpandedKeys,ze=q.onTreeExpand,qe=q.treeIcon,nt=q.showTreeIcon,$e=q.switcherIcon,gt=q.treeLine,ht=q.treeNodeFilterProp,bt=q.loadData,pt=q.treeLoadedKeys,it=q.treeMotion,_t=q.onTreeLoad,Tt=e.useRef(),Ve=Object(r.a)(function(){return Ue},[le,Ue],function(He,Pe){return Pe[0]&&He[1]!==Pe[1]}),At=g(Be),We=Object(B.a)(At,2),Ye=We[0],rt=We[1],dt=m(Ye,rt),vt=Object(B.a)(dt,2),ut=vt[0],tt=vt[1],Ze=e.useMemo(function(){return ve.map(function(He){var Pe=tt(He);return Pe?Pe.key:null})},[ve]),et=e.useMemo(function(){return ee?{checked:Ze,halfChecked:we}:null},[Ze,we,ee]);e.useEffect(function(){if(le&&!Te&&Ze.length){var He;(He=Tt.current)===null||He===void 0||He.scrollTo({key:Ze[0]})}},[le]);var st=String(De).toLowerCase(),ot=function(Pe){return st?String(Pe[ht]).toLowerCase().includes(st):!1},lt=e.useState(Je),ct=Object(B.a)(lt,2),Ct=ct[0],Mt=ct[1],Nt=e.useState(null),Wt=Object(B.a)(Nt,2),jt=Wt[0],Vt=Wt[1],Kt=e.useMemo(function(){return Fe?Object(L.a)(Fe):De?jt:Ct},[Ct,jt,st,Fe]);e.useEffect(function(){De&&Vt(Be.map(function(He){return He.key}))},[De]);var F=function(Pe){Mt(Pe),Vt(Pe),ze&&ze(Pe)},v=function(Pe){Pe.preventDefault()},x=function(Pe,Xe){var Ke=Xe.node.key,at=ut(Ke,ee?"checkbox":"select");at!==null&&de(at.data.value,{selected:!ve.includes(at.data.value)}),Te||re(!1)},k=e.useState(null),K=Object(B.a)(k,2),M=K[0],ne=K[1],Me=ut(M);if(e.useImperativeHandle(be,function(){return{onKeyDown:function(Pe){var Xe,Ke=Pe.which;switch(Ke){case s.a.UP:case s.a.DOWN:case s.a.LEFT:case s.a.RIGHT:(Xe=Tt.current)===null||Xe===void 0||Xe.onKeyDown(Pe);break;case s.a.ENTER:{Me!==null&&x(null,{node:{key:M},selected:!ve.includes(Me.data.value)});break}case s.a.ESC:re(!1)}},onKeyUp:function(){}}}),Ve.length===0)return e.createElement("div",{role:"listbox",className:"".concat(xe,"-empty"),onMouseDown:v},z);var je={};return pt&&(je.loadedKeys=pt),Kt&&(je.expandedKeys=Kt),e.createElement("div",{onMouseDown:v,onMouseEnter:Q},Me&&le&&e.createElement("span",{style:E,"aria-live":"assertive"},Me.data.value),e.createElement(i.b,Object.assign({ref:Tt,focusable:!1,prefixCls:"".concat(xe,"-tree"),treeData:Ve,height:Ce,itemHeight:Oe,virtual:Se,multiple:Te,icon:qe,showIcon:nt,switcherIcon:$e,showLine:gt,loadData:De?null:bt,motion:it,checkable:ee,checkStrictly:!0,checkedKeys:et,selectedKeys:ee?[]:Ze,defaultExpandAll:Ge},je,{onActiveChange:ne,onSelect:x,onCheck:x,onExpand:F,onLoad:_t,filterTreeNode:ot})))},u=e.forwardRef(_);u.displayName="OptionList";var h=u,c=function(){return null},d=c,T=W("Ff2n"),b=W("Zm9Q");function S(oe){return Object(b.a)(oe).map(function(me){if(!e.isValidElement(me)||!me.type)return null;var be=me.key,xe=me.props,Ce=xe.children,Oe=xe.value,Se=Object(T.a)(xe,["children","value"]),Ue=Object(N.a)({key:be,value:Oe},Se),Be=S(Ce);return Be.length&&(Ue.children=Be),Ue}).filter(function(me){return me})}function D(oe){if(!oe)return oe;var me=Object(N.a)({},oe);return"props"in me||Object.defineProperty(me,"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."),me}}),me}function I(oe,me,be,xe,Ce){var Oe=null,Se=null;function Ue(){function Be(Te){var De=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"0",de=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!1;return Te.map(function(re,le){var z="".concat(De,"-").concat(le),Q=be.includes(re.value),q=Be(re.children||[],z,Q),ee=e.createElement(d,Object.assign({},re),q.map(function(we){return we.node}));if(me===re.value&&(Oe=ee),Q){var ve={pos:z,node:ee,children:q};return de||Se.push(ve),ve}return null}).filter(function(re){return re})}Se||(Se=[],Be(xe),Se.sort(function(Te,De){var de=Te.node.props.value,re=De.node.props.value,le=be.indexOf(de),z=be.indexOf(re);return le-z}))}Object.defineProperty(oe,"triggerNode",{get:function(){return Object(l.a)(!1,"`triggerNode` is deprecated. Please consider decoupling data with node."),Ue(),Oe}}),Object.defineProperty(oe,"allCheckedNodes",{get:function(){return Object(l.a)(!1,"`allCheckedNodes` is deprecated. Please consider decoupling data with node."),Ue(),Ce?Se:Se.map(function(Te){var De=Te.node;return De})}})}function w(oe){return Array.isArray(oe)?oe:oe!==void 0?[oe]:[]}function P(oe,me){var be=new Map;return me.forEach(function(xe){var Ce=xe.data;be.set(Ce.value,Ce)}),oe.map(function(xe){return D(be.get(xe))})}function U(oe,me){var be=P([oe],me)[0];return be?be.disabled:!1}function O(oe){return oe.disabled||oe.disableCheckbox||oe.checkable===!1}function G(oe){for(var me=oe.parent,be=0,xe=me;xe;)xe=xe.parent,be+=1;return be}function V(oe){function me(xe){return(xe||[]).map(function(Ce){var Oe=Ce.value,Se=Ce.key,Ue=Ce.children,Be=Object(N.a)(Object(N.a)({},Ce),{},{key:"key"in Ce?Se:Oe});return Ue&&(Be.children=me(Ue)),Be})}var be=Object(p.d)(me(oe),!0);return be.map(function(xe){return{key:xe.data.key,data:xe.data,level:G(xe)}})}function ae(oe){return function(me,be){var xe=be[oe];return String(xe).toLowerCase().includes(String(me).toLowerCase())}}function ie(oe,me,be){var xe=be.optionFilterProp,Ce=be.filterOption;if(Ce===!1)return me;var Oe;typeof Ce=="function"?Oe=Ce:Oe=ae(xe);function Se(Ue){var Be=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1;return Ue.map(function(Te){var De=Te.children,de=Be||Oe(oe,D(Te)),re=Se(De||[],de);return de||re.length?Object(N.a)(Object(N.a)({},Te),{},{children:re}):null}).filter(function(Te){return Te})}return Se(me)}function fe(oe,me,be,xe){var Ce=new Map;return w(me).forEach(function(Oe){Oe&&Object(R.a)(Oe)==="object"&&"value"in Oe&&Ce.set(Oe.value,Oe)}),oe.map(function(Oe){var Se={value:Oe},Ue=be(Oe,"select",!0),Be=Ue?xe(Ue.data):Oe;if(Ce.has(Oe)){var Te=Ce.get(Oe);Se.label="label"in Te?Te.label:Be,"halfChecked"in Te&&(Se.halfChecked=Te.halfChecked)}else Se.label=Be;return Se})}function ce(oe,me){var be=new Set(oe);return be.add(me),Array.from(be)}function J(oe,me){var be=new Set(oe);return be.delete(me),Array.from(be)}function Z(oe){var me=oe.searchPlaceholder,be=oe.treeCheckStrictly,xe=oe.treeCheckable,Ce=oe.labelInValue,Oe=oe.value,Se=oe.multiple;Object(l.a)(!me,"`searchPlaceholder` has been removed."),be&&Ce===!1&&Object(l.a)(!1,"`treeCheckStrictly` will force set `labelInValue` to `true`."),(Ce||be)&&Object(l.a)(w(Oe).every(function(Ue){return Ue&&Object(R.a)(Ue)==="object"&&"value"in Ue}),"Invalid prop `value` supplied to `TreeSelect`. You should use { label: string, value: string | number } or [{ label: string, value: string | number }] instead."),be||Se||xe?Object(l.a)(!Oe||Array.isArray(Oe),"`value` should be an array when `TreeSelect` is checkable or multiple."):Object(l.a)(!Array.isArray(Oe),"`value` should not be array when `TreeSelect` is single mode.")}var he=Z,X=10;function $(oe,me){var be=me.id,xe=me.pId,Ce=me.rootPId,Oe={},Se=[],Ue=oe.map(function(Be){var Te=Object(N.a)({},Be),De=Te[be];return Oe[De]=Te,Te.key=Te.key||De,Te});return Ue.forEach(function(Be){var Te=Be[xe],De=Oe[Te];De&&(De.children=De.children||[],De.children.push(Be)),(Te===Ce||!De&&Ce===null)&&Se.push(Be)}),Se}function ye(oe,me){var be=0,xe=new Set;function Ce(Oe){return(Oe||[]).map(function(Se){var Ue=Se.key,Be=Se.value,Te=Se.children,De=Object(T.a)(Se,["key","value","children"]),de="value"in Se?Be:Ue,re=Object(N.a)(Object(N.a)({},De),{},{key:Ue!=null?Ue:de,value:de,title:me(Se)});return"children"in Se&&(re.children=Ce(Te)),re})}return Ce(oe)}function Le(oe,me,be){var xe=be.getLabelProp,Ce=be.simpleMode,Oe=e.useRef({});return oe?(Oe.current.formatTreeData=Oe.current.treeData===oe?Oe.current.formatTreeData:ye(Ce?$(oe,Object(N.a)({id:"id",pId:"pId",rootPId:null},Ce!==!0?Ce:{})):oe,xe),Oe.current.treeData=oe):Oe.current.formatTreeData=Oe.current.children===me?Oe.current.formatTreeData:ye(S(me),xe),Oe.current.formatTreeData}var Re="SHOW_ALL",Ie="SHOW_PARENT",Ne="SHOW_CHILD";function _e(oe,me,be){var xe=new Set(oe);return me===Ne?oe.filter(function(Ce){var Oe=be[Ce];return!(Oe&&Oe.children&&Oe.children.every(function(Se){var Ue=Se.node;return O(Ue)||xe.has(Ue.key)}))}):me===Ie?oe.filter(function(Ce){var Oe=be[Ce],Se=Oe?Oe.parent:null;return!(Se&&!O(Se.node)&&xe.has(Se.node.key))}):oe}function Ee(oe,me){var be=me.value,xe=me.getEntityByValue,Ce=me.getEntityByKey,Oe=me.treeConduction,Se=me.showCheckedStrategy,Ue=me.conductKeyEntities,Be=me.getLabelProp;return e.useMemo(function(){var Te=oe;if(Oe){var De=_e(oe.map(function(de){var re=xe(de);return re?re.key:de}),Se,Ue);Te=De.map(function(de){var re=Ce(de);return re?re.data.value:de})}return fe(Te,be,xe,Be)},[oe,be,Oe,Se,xe])}var Ae=["expandedKeys","treeData","treeCheckable","showCheckedStrategy","searchPlaceholder","treeLine","treeIcon","showTreeIcon","switcherIcon","treeNodeFilterProp","filterTreeNode","dropdownPopupAlign","treeDefaultExpandAll","treeCheckStrictly","treeExpandedKeys","treeLoadedKeys","treeMotion","onTreeExpand","onTreeLoad","loadData","treeDataSimpleMode","treeNodeLabelProp","treeDefaultExpandedKeys"],Y=Object(A.a)({prefixCls:"rc-tree-select",components:{optionList:h},convertChildrenToData:function(){return null},flattenOptions:V,getLabeledValue:f.e,filterOptions:ie,isValueDisabled:U,findValueOption:P,omitDOMProps:function(me){var be=Object(N.a)({},me);return Ae.forEach(function(xe){delete be[xe]}),be}});Y.displayName="Select";var se=e.forwardRef(function(oe,me){var be=oe.multiple,xe=oe.treeCheckable,Ce=oe.treeCheckStrictly,Oe=oe.showCheckedStrategy,Se=Oe===void 0?"SHOW_CHILD":Oe,Ue=oe.labelInValue,Be=oe.loadData,Te=oe.treeLoadedKeys,De=oe.treeNodeFilterProp,de=De===void 0?"value":De,re=oe.treeNodeLabelProp,le=oe.treeDataSimpleMode,z=oe.treeData,Q=oe.treeExpandedKeys,q=oe.treeDefaultExpandedKeys,ee=oe.treeDefaultExpandAll,ve=oe.children,we=oe.treeIcon,Fe=oe.showTreeIcon,Ge=oe.switcherIcon,Je=oe.treeLine,ze=oe.treeMotion,qe=oe.filterTreeNode,nt=oe.dropdownPopupAlign,$e=oe.onChange,gt=oe.onTreeExpand,ht=oe.onTreeLoad,bt=oe.onDropdownVisibleChange,pt=oe.onSelect,it=oe.onDeselect,_t=xe||Ce,Tt=be||_t,Ve=xe&&!Ce,At=Ce||Ue,We=e.useRef(null);e.useImperativeHandle(me,function(){return{focus:We.current.focus,blur:We.current.blur}});var Ye=function(Ke){return z&&Ke.label||Ke.title},rt=function(Ke){return re?Ke[re]:Ye(Ke)},dt=Le(z,ve,{getLabelProp:Ye,simpleMode:le}),vt=Object(e.useMemo)(function(){return V(dt)},[dt]),ut=g(vt),tt=Object(B.a)(ut,2),Ze=tt[0],et=tt[1],st=m(Ze,et),ot=Object(B.a)(st,2),lt=ot[0],ct=ot[1],Ct=Object(e.useMemo)(function(){return Ve?Object(p.a)(dt):{keyEntities:null}},[dt,xe,Ce]),Mt=Ct.keyEntities,Nt=Object(n.a)(oe.defaultValue,{value:oe.value}),Wt=Object(B.a)(Nt,2),jt=Wt[0],Vt=Wt[1],Kt=function(Ke){var at=[],St=[];return Ke.forEach(function(xt){ct(xt)?St.push(xt):at.push(xt)}),{missingRawValues:at,existRawValues:St}},F=Object(e.useMemo)(function(){var Xe=[],Ke=[];if(w(jt).forEach(function(yt){if(yt&&Object(R.a)(yt)==="object"&&"value"in yt)if(yt.halfChecked&&Ce){var Rt=ct(yt.value);Xe.push(Rt?Rt.key:yt.value)}else Ke.push(yt.value);else Ke.push(yt)}),Ve){var at=Kt(Ke),St=at.missingRawValues,xt=at.existRawValues,Et=xt.map(function(yt){return ct(yt).key}),Ot=Object(o.a)(Et,!0,Mt),Ht=Ot.checkedKeys,Ft=Ot.halfCheckedKeys;return[[].concat(Object(L.a)(St),Object(L.a)(Ht.map(function(yt){return lt(yt).data.value}))),Ft]}return[Ke,Xe]},[jt,Tt,At,xe,Ce]),v=Object(B.a)(F,2),x=v[0],k=v[1],K=Ee(x,{treeConduction:Ve,value:jt,showCheckedStrategy:Se,conductKeyEntities:Mt,getEntityByValue:ct,getEntityByKey:lt,getLabelProp:rt}),M=function(Ke,at,St){if(Vt(Tt?Ke:Ke[0]),$e){var xt=Ke;if(Ve&&Se!=="SHOW_ALL"){var Et=Ke.map(function(It){var kt=ct(It);return kt?kt.key:It}),Ot=_e(Et,Se,Mt);xt=Ot.map(function(It){var kt=lt(It);return kt?kt.data.value:It})}var Ht=at||{triggerValue:void 0,selected:void 0},Ft=Ht.triggerValue,yt=Ht.selected,Rt=At?fe(xt,jt,ct,rt):xt;if(Ce){var Gt=k.map(function(It){var kt=lt(It);return kt?kt.data.value:It}).filter(function(It){return!xt.includes(It)});Rt=[].concat(Object(L.a)(Rt),Object(L.a)(fe(Gt,jt,ct,rt)))}var Lt={preValue:K,triggerValue:Ft},Yt=!0;(Ce||St==="selection"&&!yt)&&(Yt=!1),I(Lt,Ft,Ke,dt,Yt),_t?Lt.checked=yt:Lt.selected=yt,$e(Tt?Rt:Rt[0],At?null:xt.map(function(It){var kt=ct(It);return kt?rt(kt.data):null}),Lt)}},ne=function(Ke,at,St){var xt=Ke;if(!Tt)M([Ke],{selected:!0,triggerValue:Ke},St);else{var Et=ce(x,Ke);if(Ve){var Ot=Kt(Et),Ht=Ot.missingRawValues,Ft=Ot.existRawValues,yt=Ft.map(function(Lt){return ct(Lt).key}),Rt=Object(o.a)(yt,!0,Mt),Gt=Rt.checkedKeys;Et=[].concat(Object(L.a)(Ht),Object(L.a)(Gt.map(function(Lt){return lt(Lt).data.value})))}M(Et,{selected:!0,triggerValue:Ke},St)}pt&&pt(xt,at)},Me=function(Ke,at,St){var xt=Ke,Et=J(x,Ke);if(Ve){var Ot=Kt(Et),Ht=Ot.missingRawValues,Ft=Ot.existRawValues,yt=Ft.map(function(Lt){return ct(Lt).key}),Rt=Object(o.a)(yt,{checked:!1,halfCheckedKeys:k},Mt),Gt=Rt.checkedKeys;Et=[].concat(Object(L.a)(Ht),Object(L.a)(Gt.map(function(Lt){return lt(Lt).data.value})))}M(Et,{selected:!1,triggerValue:Ke},St),it&&it(xt,at)},je=function(){M([],null,"clear")},He=e.useCallback(function(Xe){if(bt){var Ke={};Object.defineProperty(Ke,"documentClickClose",{get:function(){return Object(l.a)(!1,"Second param of `onDropdownVisibleChange` has been removed."),!1}}),bt(Xe,Ke)}},[bt]),Pe={optionLabelProp:null,optionFilterProp:de,dropdownAlign:nt,internalProps:{mark:a.a,onClear:je,skipTriggerChange:!0,skipTriggerSelect:!0,onRawSelect:ne,onRawDeselect:Me}};return"filterTreeNode"in oe&&(Pe.filterOption=qe),e.createElement(t.Provider,{value:{checkable:_t,loadData:Be,treeLoadedKeys:Te,onTreeLoad:ht,checkedKeys:x,halfCheckedKeys:k,treeDefaultExpandAll:ee,treeExpandedKeys:Q,treeDefaultExpandedKeys:q,onTreeExpand:gt,treeIcon:we,treeMotion:ze,showTreeIcon:Fe,switcherIcon:Ge,treeLine:Je,treeNodeFilterProp:de}},e.createElement(Y,Object.assign({ref:We,mode:Tt?"multiple":null},oe,Pe,{value:K,labelInValue:!0,options:dt,onChange:null,onSelect:null,onDeselect:null,onDropdownVisibleChange:He})))}),pe=function(oe){Object(C.a)(be,oe);var me=Object(j.a)(be);function be(){var xe;return Object(te.a)(this,be),xe=me.apply(this,arguments),xe.selectRef=e.createRef(),xe.focus=function(){xe.selectRef.current.focus()},xe.blur=function(){xe.selectRef.current.blur()},xe}return Object(H.a)(be,[{key:"render",value:function(){return e.createElement(se,Object.assign({ref:this.selectRef},this.props))}}]),be}(e.Component);pe.TreeNode=d,pe.SHOW_ALL=Re,pe.SHOW_PARENT=Ie,pe.SHOW_CHILD=Ne;var ge=pe,ke=ue.e=ge},"8hTe":function(Qe,ue,W){Qe.exports={button:"button___1wy9m"}},"9Bee":function(Qe,ue,W){"use strict";var te=W("DYRE"),H=W("zeV3"),C=W("+L6B"),j=W("2/Rp"),L=W("k1fw"),R=W("9og8"),B=W("tJVT"),N=W("WmNS"),e=W.n(N),A=W("q1tI"),f=W.n(A),p=W("vg9a"),o=W("DlQD"),a=W.n(o),n=W("rUJ1");function l(F,v){var x=F.match(/^(\s+)(?:```)/);if(x===null)return v;var k=x[1];return v.split(`
|
|
`).map(function(K){var M=K.match(/^\s+/);if(M===null)return K;var ne=Object(B.a)(M,1),Me=ne[0];return Me.length>=k.length?K.slice(k.length):K}).join(`
|
|
`)}var s=[],r=["<ul>"],i=new a.a.Renderer,t=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function y(){s.length=0,r=["<ul>"]}var m={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function g(F,v,x,k){if(v>=F.length||F[v].level<=x)return v;var K=F[v];k.push("<li><a href='#"+K.anchor+"'>"+K.text+"</a>"),v++;var M=[];return v=g(F,v,K.level,M),M.length>0&&(k.push("<ul>"),M.forEach(function(ne){k.push(ne)}),k.push("</ul>")),k.push("</li>"),v=g(F,v,x,k),v}function E(){return g(s,0,0,r),r.push("</ul>"),r.join("")}var _={heading:function(v){var x=t.exec(v);if(x)return{type:"heading",raw:x[0],depth:x[1].length,text:x[2]}},fences:function(v){var x=this.rules.block.fences.exec(v);if(x){var k=x[0],K=l(k,x[3]||""),M=x[2]?x[2].trim():x[2];if(["latex","katex","math"].indexOf(M)>=0){var ne=c(),Me=K;K=ne,d[ne]={type:"block",expression:Me}}return{type:"code",raw:k,lang:M,text:K}}}},u=/(?:\${2})([^\n`]+?)(?:\${2})/gi,h=0,c=function(){return"__special_katext_id_".concat(h++,"__")},d={};function T(){return d}function b(){h=0,d={}}function S(F){return F=F.replace(u,function(v,x){var k=c();return d[k]={type:"inline",expression:x},k}),F}var D=i.listitem;i.listitem=function(F){return D(S(F))};var I=i.paragraph;i.paragraph=function(F){return I(S(F))};var w=i.tablecell;i.tablecell=function(F,v){return w(S(F),v)},i.code=function(F,v,x){var k=(v||"").match(/\S*/)[0];return k?["latex","katex","math"].indexOf(k)>=0?"<p class='editormd-tex'>".concat(F,"</p>"):'<pre class="prettyprint linenums"><code class="language-'.concat(v,'">').concat(x?F:Object(n.escape)(F,!0),`</code></pre>
|
|
`):'<pre class="prettyprint linenums"><code>'+(x?F:Object(n.escape)(F,!0))+"</code></pre>"},i.heading=function(F,v,x){var k=this.options.headerPrefix+x.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return s.push({anchor:k,level:v,text:F}),"<h"+v+' id="'+k+'">'+F+"</h"+v+">"},a.a.setOptions({silent:!0,gfm:!0,pedantic:!1}),a.a.use({tokenizer:_,renderer:i});var P=a.a,U=W("SJMd"),O=W("ulZh"),G=W.n(O),V=W("m3rI"),ae=W("Oy/b"),ie=W("p5ED"),fe=W("ErOA");/*! *****************************************************************************
|
|
Copyright (c) Microsoft Corporation.
|
|
|
|
Permission to use, copy, modify, and/or distribute this software for any
|
|
purpose with or without fee is hereby granted.
|
|
|
|
THE SOFTWARE IS PROVIDED "AS IS" AND THE AUTHOR DISCLAIMS ALL WARRANTIES WITH
|
|
REGARD TO THIS SOFTWARE INCLUDING ALL IMPLIED WARRANTIES OF MERCHANTABILITY
|
|
AND FITNESS. IN NO EVENT SHALL THE AUTHOR BE LIABLE FOR ANY SPECIAL, DIRECT,
|
|
INDIRECT, OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES WHATSOEVER RESULTING FROM
|
|
LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION OF CONTRACT, NEGLIGENCE OR
|
|
OTHER TORTIOUS ACTION, ARISING OUT OF OR IN CONNECTION WITH THE USE OR
|
|
PERFORMANCE OF THIS SOFTWARE.
|
|
***************************************************************************** */var ce=function(F,v){return(ce=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,k){x.__proto__=k}||function(x,k){for(var K in k)Object.prototype.hasOwnProperty.call(k,K)&&(x[K]=k[K])})(F,v)};function J(F,v){function x(){this.constructor=F}ce(F,v),F.prototype=v===null?Object.create(v):(x.prototype=v.prototype,new x)}function Z(F,v,x,k){return new(x||(x=Promise))(function(K,M){function ne(He){try{je(k.next(He))}catch(Pe){M(Pe)}}function Me(He){try{je(k.throw(He))}catch(Pe){M(Pe)}}function je(He){var Pe;He.done?K(He.value):(Pe=He.value,Pe instanceof x?Pe:new x(function(Xe){Xe(Pe)})).then(ne,Me)}je((k=k.apply(F,v||[])).next())})}function he(F,v){var x,k,K,M,ne={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return M={next:Me(0),throw:Me(1),return:Me(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function Me(je){return function(He){return function(Pe){if(x)throw new TypeError("Generator is already executing.");for(;ne;)try{if(x=1,k&&(K=2&Pe[0]?k.return:Pe[0]?k.throw||((K=k.return)&&K.call(k),0):k.next)&&!(K=K.call(k,Pe[1])).done)return K;switch(k=0,K&&(Pe=[2&Pe[0],K.value]),Pe[0]){case 0:case 1:K=Pe;break;case 4:return ne.label++,{value:Pe[1],done:!1};case 5:ne.label++,k=Pe[1],Pe=[0];continue;case 7:Pe=ne.ops.pop(),ne.trys.pop();continue;default:if(!(K=ne.trys,(K=K.length>0&&K[K.length-1])||Pe[0]!==6&&Pe[0]!==2)){ne=0;continue}if(Pe[0]===3&&(!K||Pe[1]>K[0]&&Pe[1]<K[3])){ne.label=Pe[1];break}if(Pe[0]===6&&ne.label<K[1]){ne.label=K[1],K=Pe;break}if(K&&ne.label<K[2]){ne.label=K[2],ne.ops.push(Pe);break}K[2]&&ne.ops.pop(),ne.trys.pop();continue}Pe=v.call(F,ne)}catch(Xe){Pe=[6,Xe],k=0}finally{x=K=0}if(5&Pe[0])throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}([je,He])}}}function X(){for(var F=0,v=0,x=arguments.length;v<x;v++)F+=arguments[v].length;var k=Array(F),K=0;for(v=0;v<x;v++)for(var M=arguments[v],ne=0,Me=M.length;ne<Me;ne++,K++)k[K]=M[ne];return k}var $=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(v,x){for(var k=0,K=x;k<K.length;k++){var M=K[k],ne=M[0],Me=M[1];v.setAttribute(ne,Me)}},F.createRect=function(v,x,k){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",v.toString()),K.setAttribute("height",x.toString()),k&&F.setAttributes(K,k),K},F.createLine=function(v,x,k,K,M){var ne=document.createElementNS("http://www.w3.org/2000/svg","line");return ne.setAttribute("x1",v.toString()),ne.setAttribute("y1",x.toString()),ne.setAttribute("x2",k.toString()),ne.setAttribute("y2",K.toString()),M&&F.setAttributes(ne,M),ne},F.createPolygon=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",v),x&&F.setAttributes(k,x),k},F.createCircle=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(v/2).toString()),k.setAttribute("cy",(v/2).toString()),k.setAttribute("r",v.toString()),x&&F.setAttributes(k,x),k},F.createEllipse=function(v,x,k){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(v/2).toString()),K.setAttribute("cy",(x/2).toString()),K.setAttribute("rx",(v/2).toString()),K.setAttribute("ry",(x/2).toString()),k&&F.setAttributes(K,k),K},F.createGroup=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&F.setAttributes(x,v),x},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(v,x,k,K,M,ne,Me){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(je,[["id",v],["orient",x],["markerWidth",k.toString()],["markerHeight",K.toString()],["refX",M.toString()],["refY",ne.toString()]]),je.appendChild(Me),je},F.createText=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","text");return x.setAttribute("x","0"),x.setAttribute("y","0"),v&&F.setAttributes(x,v),x},F.createTSpan=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=v,x&&F.setAttributes(k,x),k},F.createImage=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&F.setAttributes(x,v),x},F.createPoint=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=v,k.y=x,k},F.createPath=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",v),x&&F.setAttributes(k,x),k},F}(),ye=function(){function F(){}return F.addKey=function(v){F.key=v},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^MJS2-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),Le=function(){function F(){this.naturalSize=!1,this.imageType="image/png",this.markersOnly=!1}return F.prototype.rasterize=function(v,x,k){var K=this;return new Promise(function(M){var ne=k!==void 0?k:document.createElement("canvas");v===null&&(K.markersOnly=!0,K.naturalSize=!1);var Me=document.createElementNS("http://www.w3.org/2000/svg","svg");Me.setAttribute("xmlns","http://www.w3.org/2000/svg"),Me.setAttribute("width",x.width.baseVal.valueAsString),Me.setAttribute("height",x.height.baseVal.valueAsString),Me.setAttribute("viewBox","0 0 "+x.viewBox.baseVal.width.toString()+" "+x.viewBox.baseVal.height.toString()),Me.innerHTML=x.innerHTML,K.naturalSize===!0?(Me.width.baseVal.value=v.naturalWidth,Me.height.baseVal.value=v.naturalHeight):K.width!==void 0&&K.height!==void 0&&(Me.width.baseVal.value=K.width,Me.height.baseVal.value=K.height),ne.width=Me.width.baseVal.value,ne.height=Me.height.baseVal.value;var je=Me.outerHTML,He=ne.getContext("2d");K.markersOnly!==!0&&He.drawImage(v,0,0,ne.width,ne.height);var Pe=window.URL,Xe=new Image(ne.width,ne.height);Xe.setAttribute("crossOrigin","anonymous");var Ke=new Blob([je],{type:"image/svg+xml"}),at=Pe.createObjectURL(Ke);Xe.onload=function(){He.drawImage(Xe,0,0),Pe.revokeObjectURL(at);var St=ne.toDataURL(K.imageType,K.imageQuality);M(St)},Xe.src=at})},F}(),Re=function(){},Ie=function(){function F(v){this._classNamePrefixBase="__markerjs2_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.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(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},F.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new Ne("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new Ne("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new _e("fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new _e("fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},F.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),Ne=function(F,v){this.selector=F,this.style=v},_e=function(F,v){this.localName=F,this.style=v},Ee=function(){function F(v,x,k,K,M){this.buttons=[],this.markerButtons=[],this.buttonClickListeners=[],this.markerjsContainer=v,this.displayMode=x,this.markerItems=k,this.uiStyleSettings=K,this.styles=M,this.addStyles(),this.adjustLayout=this.adjustLayout.bind(this),this.overflowButtonClicked=this.overflowButtonClicked.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this)}return F.prototype.show=function(v){var x=this;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolbarStyleClass.name+" "+this.styles.fadeInAnimationClassName+" "+(this.uiStyleSettings.toolbarStyleColorsClassName?this.uiStyleSettings.toolbarStyleColorsClassName:this.toolbarStyleColorsClass.name);var k=document.createElement("div");k.className=this.toolbarBlockStyleClass.name,k.style.whiteSpace="nowrap",this.uiContainer.appendChild(k),this.addActionButton(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(k,'<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(M){var ne=document.createElement("div");ne.className=""+x.toolbarButtonStyleClass.name,ne.setAttribute("data-type-name",M.typeName),ne.innerHTML=M.icon,ne.addEventListener("click",function(){x.markerToolbarButtonClicked(ne,M)}),x.buttons.push(ne),x.markerButtons.push(ne)}),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()},F.prototype.addButtonClickListener=function(v){this.buttonClickListeners.push(v)},F.prototype.removeButtonClickListener=function(v){this.buttonClickListeners.indexOf(v)>-1&&this.buttonClickListeners.splice(this.buttonClickListeners.indexOf(v),1)},F.prototype.setSelectMode=function(){this.resetButtonStyles(),this.setActiveButton(this.buttons[0])},F.prototype.adjustLayout=function(){if(this.markerButtons&&this.markerButtons.length>0){var v=Math.floor(this.markerButtonBlock.clientWidth/this.uiStyleSettings.toolbarHeight)-1;this.markerButtonBlock.innerHTML="",this.markerButtonOverflowBlock.innerHTML="";for(var x=0;x<this.markerButtons.length;x++)x<v||x===v&&this.markerButtons.length-1===v?this.markerButtonBlock.appendChild(this.markerButtons[x]):(x===v&&this.markerButtonBlock.appendChild(this.overflowButton),this.markerButtonOverflowBlock.appendChild(this.markerButtons[x]))}},F.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")},F.prototype.resetButtonStyles=function(){var v=this;this.buttons.forEach(function(x){x.className=x.className.replace(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name,"").trim(),x.className=x.className.replace(v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?v.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:v.toolbarActiveButtonStyleColorsClass.name,"").trim(),x.className+=" "+(v.uiStyleSettings.toolbarButtonStyleColorsClassName?v.uiStyleSettings.toolbarButtonStyleColorsClassName:v.toolbarButtonStyleColorsClass.name)})},F.prototype.addActionButton=function(v,x,k){var K=this,M=document.createElement("div");switch(M.className=""+this.toolbarButtonStyleClass.name,M.innerHTML=x,M.setAttribute("data-action",k),M.addEventListener("click",function(){K.actionToolbarButtonClicked(M,k)}),k){case"select":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"delete":case"clear":M.style.fill=this.uiStyleSettings.deleteButtonColor;break;case"undo":case"redo":M.style.fill=this.uiStyleSettings.selectButtonColor;break;case"render":M.style.fill=this.uiStyleSettings.okButtonColor;break;case"close":M.style.fill=this.uiStyleSettings.closeButtonColor}v.appendChild(M),this.buttons.push(M)},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new _e("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 _e("toolbar_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
box-shadow: 0px 3px rgba(33, 33, 33, 0.1);
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new _e("toolbar-block",`
|
|
display: inline-block;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarOverflowBlockStyleClass=this.styles.addClass(new _e("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 _e("toolbar-overflow-block_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`));var v=this.uiStyleSettings.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new _e("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new _e("toolbar_button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new _e("toolbar_active_button",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new Ne("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`))},F.prototype.markerToolbarButtonClicked=function(v,x){this.setActiveButton(v),this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("marker",x)}),this.markerButtonOverflowBlock.style.display="none"},F.prototype.actionToolbarButtonClicked=function(v,x){this.buttonClickListeners&&this.buttonClickListeners.length>0&&this.buttonClickListeners.forEach(function(k){return k("action",x)}),this.markerButtonOverflowBlock.style.display="none",this.setActiveButton(this.buttons[0])},F.prototype.setActiveButton=function(v){this.resetButtonStyles(),v.className=v.className.replace(this.uiStyleSettings.toolbarButtonStyleColorsClassName?this.uiStyleSettings.toolbarButtonStyleColorsClassName:this.toolbarButtonStyleColorsClass.name,"").trim(),v.className+=" "+(this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName?this.uiStyleSettings.toolbarActiveButtonStyleColorsClassName:this.toolbarActiveButtonStyleColorsClass.name)},F.prototype.setActiveMarkerButton=function(v){var x=this.markerButtons.find(function(k){return k.getAttribute("data-type-name")===v});x&&this.setActiveButton(x)},F.prototype.setCurrentMarker=function(v){var x=this;this.currentMarker=v,this.buttons.filter(function(k){return/delete|notes/.test(k.getAttribute("data-action"))}).forEach(function(k){x.currentMarker===void 0?(k.style.fillOpacity="0.4",k.style.pointerEvents="none"):(k.style.fillOpacity="1",k.style.pointerEvents="all")})},F}(),Ae=function(){function F(v,x,k,K){this.panels=[],this.panelButtons=[],this.markerjsContainer=v,this.displayMode=x,this.uiStyleSettings=k,this.styles=K,this.panelButtonClick=this.panelButtonClick.bind(this),this.addStyles()}return F.prototype.addStyles=function(){var v;this.toolboxStyleClass=this.styles.addClass(new _e("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 _e("toolbox_colors",`
|
|
color: `+this.uiStyleSettings.toolboxColor+`;
|
|
`));var x=this.uiStyleSettings.toolbarHeight/4;this.toolboxButtonRowStyleClass=this.styles.addClass(new _e("toolbox-button-row",`
|
|
display: flex;
|
|
cursor: default;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonRowStyleColorsClass=this.styles.addClass(new _e("toolbox-button-row_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundColor+`;
|
|
`)),this.toolboxPanelRowStyleClass=this.styles.addClass(new _e("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 _e("toolbox-panel-row_colors",`
|
|
background-color: `+((v=this.uiStyleSettings.toolboxBackgroundColor)!==null&&v!==void 0?v:this.uiStyleSettings.toolbarBackgroundHoverColor)+`;
|
|
`)),this.toolboxButtonStyleClass=this.styles.addClass(new _e("toolbox_button",`
|
|
display: inline-block;
|
|
width: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
|
|
height: `+(this.uiStyleSettings.toolbarHeight-2*x)+`px;
|
|
padding: `+x+`px;
|
|
box-sizing: content-box;
|
|
`)),this.toolboxButtonStyleColorsClass=this.styles.addClass(new _e("toolbox-button_colors",`
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.toolboxActiveButtonStyleColorsClass=this.styles.addClass(new _e("toolbox-active-button_colors",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`;
|
|
fill: `+this.uiStyleSettings.toolbarColor+`;
|
|
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.uiStyleSettings.toolbarBackgroundHoverColor+`
|
|
`)),this.styles.addRule(new Ne("."+this.toolboxButtonStyleClass.name+" svg",`
|
|
height: `+this.uiStyleSettings.toolbarHeight/2+`px;
|
|
`))},F.prototype.show=function(v){var x;this.uiContainer=document.createElement("div"),this.uiContainer.style.visibility=v,this.uiContainer.className=this.toolboxStyleClass.name+" "+((x=this.uiStyleSettings.toolboxStyleColorsClassName)!==null&&x!==void 0?x:this.toolboxStyleColorsClass.name),this.markerjsContainer.appendChild(this.uiContainer)},F.prototype.setPanelButtons=function(v){var x,k,K=this;this.panels=v,this.uiContainer!==void 0&&(this.uiContainer.innerHTML="",this.panelRow=document.createElement("div"),this.panelRow.className=this.toolboxPanelRowStyleClass.name+" "+((x=this.uiStyleSettings.toolboxPanelRowStyleColorsClassName)!==null&&x!==void 0?x:this.toolboxPanelRowStyleColorsClass.name),this.uiContainer.appendChild(this.panelRow),this.buttonRow=document.createElement("div"),this.buttonRow.className=this.toolboxButtonRowStyleClass.name+" "+((k=this.uiStyleSettings.toolboxButtonRowStyleColorsClassName)!==null&&k!==void 0?k:this.toolboxButtonRowStyleColorsClass.name)+" ",this.uiContainer.appendChild(this.buttonRow),this.panelButtons.splice(0),this.panels.forEach(function(M){var ne;M.uiStyleSettings=K.uiStyleSettings;var Me=document.createElement("div");Me.className=K.toolboxButtonStyleClass.name+" "+((ne=K.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&ne!==void 0?ne:K.toolboxButtonStyleColorsClass.name),Me.innerHTML=M.icon,Me.title=M.title,Me.addEventListener("click",function(){K.panelButtonClick(M)}),K.panelButtons.push(Me),K.buttonRow.appendChild(Me)}),this.displayMode==="inline"?this.panelRow.style.display="none":this.panelRow.style.visibility="hidden")},F.prototype.panelButtonClick=function(v){var x=this,k=-1;if(v!==this.activePanel){k=this.panels.indexOf(v),this.panelRow.innerHTML="";var K=v.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=v}else this.activePanel=void 0,this.panelRow.className=this.panelRow.className.replace(this.styles.fadeInAnimationClassName,""),this.panelRow.className+=" "+this.styles.fadeOutAnimationClassName,setTimeout(function(){x.displayMode==="inline"?x.panelRow.style.display="none":x.panelRow.style.visibility="hidden"},200);this.panelButtons.forEach(function(M,ne){var Me,je;M.className=x.toolboxButtonStyleClass.name+" "+(ne===k?""+((Me=x.uiStyleSettings.toolboxActiveButtonStyleColorsClassName)!==null&&Me!==void 0?Me:x.toolboxActiveButtonStyleColorsClass.name):""+((je=x.uiStyleSettings.toolboxButtonStyleColorsClassName)!==null&&je!==void 0?je:x.toolboxButtonStyleColorsClass.name))})},F}(),Y=function(F,v){this.title=F,this.icon=v},se=function(F){function v(x,k,K,M){var ne=F.call(this,x,M||'<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 ne.colors=[],ne.addTransparent=!1,ne.colorBoxes=[],ne.colors=k,ne.currentColor=K,ne.setCurrentColor=ne.setCurrentColor.bind(ne),ne.getColorBox=ne.getColorBox.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.whiteSpace="nowrap",this.colors.forEach(function(K){var M=x.getColorBox(K);k.appendChild(M),x.colorBoxes.push(M)}),k},v.prototype.getColorBox=function(x){var k=this,K=this.uiStyleSettings.toolbarHeight/4,M=this.uiStyleSettings.toolbarHeight-K,ne=document.createElement("div");ne.style.display="inline-block",ne.style.boxSizing="content-box",ne.style.width=M-2+"px",ne.style.height=M-2+"px",ne.style.padding="1px",ne.style.marginRight="2px",ne.style.marginBottom="2px",ne.style.borderWidth="2px",ne.style.borderStyle="solid",ne.style.borderRadius=(M+2)/2+"px",ne.style.borderColor=x===this.currentColor?this.uiStyleSettings.toolboxAccentColor:"transparent",ne.addEventListener("click",function(){k.setCurrentColor(x,ne)});var Me=document.createElement("div");return Me.style.display="inline-block",Me.style.width=M-2+"px",Me.style.height=M-2+"px",Me.style.backgroundColor=x,Me.style.borderRadius=M/2+"px",x==="transparent"&&(Me.style.fill=this.uiStyleSettings.toolboxAccentColor,Me.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>`),ne.appendChild(Me),ne},v.prototype.setCurrentColor=function(x,k){var K=this;this.currentColor=x,this.colorBoxes.forEach(function(M){M.style.borderColor=M===k?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onColorChanged&&this.onColorChanged(x)},v}(Y),pe=function(){function F(v,x,k){this._state="new",this._isSelected=!1,this._container=v,this._overlayContainer=x,this.globalSettings=k,this.stateChanged=this.stateChanged.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this)}return Object.defineProperty(F.prototype,"typeName",{get:function(){return Object.getPrototypeOf(this).constructor.typeName},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"container",{get:function(){return this._container},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"overlayContainer",{get:function(){return this._overlayContainer},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"state",{get:function(){return this._state},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"toolboxPanels",{get:function(){return[]},enumerable:!1,configurable:!0}),F.prototype.ownsTarget=function(v){return!1},Object.defineProperty(F.prototype,"isSelected",{get:function(){return this._isSelected},enumerable:!1,configurable:!0}),F.prototype.select=function(){this.container.style.cursor="move",this._isSelected=!0,this.manipulationStartState=this.getState()},F.prototype.deselect=function(){this.container.style.cursor="default",this._isSelected=!1,this.stateChanged()},F.prototype.pointerDown=function(v,x){},F.prototype.dblClick=function(v,x){},F.prototype.manipulate=function(v){},F.prototype.pointerUp=function(v){this.stateChanged()},F.prototype.dispose=function(){},F.prototype.addMarkerVisualToContainer=function(v){this.container.childNodes.length>0?this.container.insertBefore(v,this.container.childNodes[0]):this.container.appendChild(v)},F.prototype.getState=function(){return{typeName:F.typeName,state:this.state,notes:this.notes}},F.prototype.restoreState=function(v){this._state=v.state,this.notes=v.notes},F.prototype.scale=function(v,x){},F.prototype.colorChanged=function(v){this.onColorChanged&&this.onColorChanged(v),this.stateChanged()},F.prototype.fillColorChanged=function(v){this.onFillColorChanged&&this.onFillColorChanged(v),this.stateChanged()},F.prototype.stateChanged=function(){if(this.onStateChanged&&this.state!=="creating"&&this.state!=="new"){var v=this.getState();this.manipulationStartState!==void 0&&(this.manipulationStartState.state="select"),v.state="select",JSON.stringify(this.manipulationStartState)!=JSON.stringify(v)&&this.onStateChanged(this)}},F.typeName="MarkerBase",F}(),ge=function(){function F(){this.findGripByVisual=this.findGripByVisual.bind(this)}return F.prototype.findGripByVisual=function(v){return this.topLeft.ownsTarget(v)?this.topLeft:this.topCenter.ownsTarget(v)?this.topCenter:this.topRight.ownsTarget(v)?this.topRight:this.centerLeft.ownsTarget(v)?this.centerLeft:this.centerRight.ownsTarget(v)?this.centerRight:this.bottomLeft.ownsTarget(v)?this.bottomLeft:this.bottomCenter.ownsTarget(v)?this.bottomCenter:this.bottomRight.ownsTarget(v)?this.bottomRight:void 0},F}(),ke=function(){function F(){this.GRIP_SIZE=10,this.visual=$.createGroup(),this.visual.appendChild($.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild($.createCircle(this.GRIP_SIZE,[["fill","#cccccc"],["fill-opacity","0.7"],["stroke","#333333"],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},F}(),oe=function(){function F(){}return F.toITransformMatrix=function(v){return{a:v.a,b:v.b,c:v.c,d:v.d,e:v.e,f:v.f}},F.toSVGMatrix=function(v,x){return v.a=x.a,v.b=x.b,v.c=x.c,v.d=x.d,v.e=x.e,v.f=x.f,v},F}(),me=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.left=0,M.top=0,M.width=0,M.height=0,M.defaultSize={x:50,y:20},M.offsetX=0,M.offsetY=0,M.rotationAngle=0,M.CB_DISTANCE=10,M._suppressMarkerCreateEvent=!1,M.container.transform.baseVal.appendItem($.createTransform()),M.setupControlBox(),M}return J(v,F),Object.defineProperty(v.prototype,"centerX",{get:function(){return this.left+this.width/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"centerY",{get:function(){return this.top+this.height/2},enumerable:!1,configurable:!0}),Object.defineProperty(v.prototype,"visual",{get:function(){return this._visual},set:function(x){this._visual=x;var k=$.createTransform();this._visual.transform.baseVal.appendItem(k)},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(x){return!!F.prototype.ownsTarget.call(this,x)||!!(this.controlGrips.findGripByVisual(x)!==void 0||this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(x))},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.state==="new"&&(this.left=x.x,this.top=x.y),this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.manipulationStartWidth=this.width,this.manipulationStartHeight=this.height;var K=this.unrotatePoint(x);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(k),this.activeGrip!==void 0)this._state="resize";else if(this.rotatorGrip!==void 0&&this.rotatorGrip.ownsTarget(k)){this.activeGrip=this.rotatorGrip;var M=this.rotatePoint({x:this.centerX,y:this.centerY});this.left=M.x-this.width/2,this.top=M.y-this.height/2,this.moveVisual({x:this.left,y:this.top});var ne=this.container.transform.baseVal.getItem(0);ne.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(ne,0),this.adjustControlBox(),this._state="rotate"}else this._state="move"},v.prototype.pointerUp=function(x){var k=this.state;F.prototype.pointerUp.call(this,x),this.state==="creating"&&this.width<10&&this.height<10?(this.width=this.defaultSize.x,this.height=this.defaultSize.y):this.manipulate(x),this._state="select",k==="creating"&&this.onMarkerCreated&&this._suppressMarkerCreateEvent===!1&&this.onMarkerCreated(this)},v.prototype.moveVisual=function(x){this.visual.style.transform="translate("+x.x+"px, "+x.y+"px)"},v.prototype.manipulate=function(x){var k=this.unrotatePoint(x);this.state==="creating"?this.resize(x):this.state==="move"?(this.left=this.manipulationStartLeft+(k.x-this.manipulationStartLeft)-this.offsetX,this.top=this.manipulationStartTop+(k.y-this.manipulationStartTop)-this.offsetY,this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()):this.state==="resize"?this.resize(k):this.state==="rotate"&&this.rotate(x)},v.prototype.resize=function(x){var k=this.manipulationStartLeft,K=this.manipulationStartWidth,M=this.manipulationStartTop,ne=this.manipulationStartHeight;switch(this.activeGrip){case this.controlGrips.bottomLeft:case this.controlGrips.centerLeft:case this.controlGrips.topLeft:k=this.manipulationStartLeft+x.x-this.manipulationStartX,K=this.manipulationStartWidth+this.manipulationStartLeft-k;break;case this.controlGrips.bottomRight:case this.controlGrips.centerRight:case this.controlGrips.topRight:case void 0:K=this.manipulationStartWidth+x.x-this.manipulationStartX}switch(this.activeGrip){case this.controlGrips.topCenter:case this.controlGrips.topLeft:case this.controlGrips.topRight:M=this.manipulationStartTop+x.y-this.manipulationStartY,ne=this.manipulationStartHeight+this.manipulationStartTop-M;break;case this.controlGrips.bottomCenter:case this.controlGrips.bottomLeft:case this.controlGrips.bottomRight:case void 0:ne=this.manipulationStartHeight+x.y-this.manipulationStartY}K>=0?(this.left=k,this.width=K):(this.left=k+K,this.width=-K),ne>=0?(this.top=M,this.height=ne):(this.top=M+ne,this.height=-ne),this.setSize()},v.prototype.setSize=function(){this.moveVisual({x:this.left,y:this.top}),this.adjustControlBox()},v.prototype.rotate=function(x){if(Math.abs(x.x-this.centerX)>.1){var k=Math.sign(x.x-this.centerX);this.rotationAngle=180*Math.atan((x.y-this.centerY)/(x.x-this.centerX))/Math.PI+90*k,this.applyRotation()}},v.prototype.applyRotation=function(){var x=this.container.transform.baseVal.getItem(0);x.setRotate(this.rotationAngle,this.centerX,this.centerY),this.container.transform.baseVal.replaceItem(x,0)},v.prototype.rotatePoint=function(x){if(this.rotationAngle===0)return x;var k=this.container.getCTM(),K=$.createPoint(x.x,x.y);return{x:(K=K.matrixTransform(k)).x,y:K.y}},v.prototype.unrotatePoint=function(x){if(this.rotationAngle===0)return x;var k=this.container.getCTM();k=k.inverse();var K=$.createPoint(x.x,x.y);return{x:(K=K.matrixTransform(k)).x,y:K.y}},v.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=$.createGroup();var x=$.createTransform();x.setTranslate(-this.CB_DISTANCE/2,-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.appendItem(x),this.container.appendChild(this.controlBox),this.controlRect=$.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=$.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 ge,this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){var x=this.controlBox.transform.baseVal.getItem(0);x.setTranslate(this.left-this.CB_DISTANCE/2,this.top-this.CB_DISTANCE/2),this.controlBox.transform.baseVal.replaceItem(x,0),this.controlRect.setAttribute("width",(this.width+this.CB_DISTANCE).toString()),this.controlRect.setAttribute("height",(this.height+this.CB_DISTANCE).toString()),this.rotatorGripLine!==void 0&&(this.rotatorGripLine.setAttribute("x1",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y1",(-this.CB_DISTANCE/2).toString()),this.rotatorGripLine.setAttribute("x2",((this.width+this.CB_DISTANCE)/2).toString()),this.rotatorGripLine.setAttribute("y2",(3*-this.CB_DISTANCE).toString())),this.positionGrips()},v.prototype.addControlGrips=function(){this.controlGrips.topLeft=this.createGrip(),this.controlGrips.topCenter=this.createGrip(),this.controlGrips.topRight=this.createGrip(),this.controlGrips.centerLeft=this.createGrip(),this.controlGrips.centerRight=this.createGrip(),this.controlGrips.bottomLeft=this.createGrip(),this.controlGrips.bottomCenter=this.createGrip(),this.controlGrips.bottomRight=this.createGrip(),this.globalSettings.disableRotation!==!0&&(this.rotatorGrip=this.createGrip()),this.positionGrips()},v.prototype.createGrip=function(){var x=new ke;return x.visual.transform.baseVal.appendItem($.createTransform()),this.controlBox.appendChild(x.visual),x},v.prototype.positionGrips=function(){var x=this.controlGrips.topLeft.GRIP_SIZE,k=-x/2,K=k,M=(this.width+this.CB_DISTANCE)/2-x/2,ne=(this.height+this.CB_DISTANCE)/2-x/2,Me=this.height+this.CB_DISTANCE-x/2,je=this.width+this.CB_DISTANCE-x/2;this.positionGrip(this.controlGrips.topLeft.visual,k,K),this.positionGrip(this.controlGrips.topCenter.visual,M,K),this.positionGrip(this.controlGrips.topRight.visual,je,K),this.positionGrip(this.controlGrips.centerLeft.visual,k,ne),this.positionGrip(this.controlGrips.centerRight.visual,je,ne),this.positionGrip(this.controlGrips.bottomLeft.visual,k,Me),this.positionGrip(this.controlGrips.bottomCenter.visual,M,Me),this.positionGrip(this.controlGrips.bottomRight.visual,je,Me),this.rotatorGrip!==void 0&&this.positionGrip(this.rotatorGrip.visual,M,K-3*this.CB_DISTANCE)},v.prototype.positionGrip=function(x,k,K){var M=x.transform.baseVal.getItem(0);M.setTranslate(k,K),x.transform.baseVal.replaceItem(M,0)},v.prototype.hideControlBox=function(){this.controlBox.style.display="none"},v.prototype.showControlBox=function(){this.controlBox.style.display=""},v.prototype.getState=function(){return Object.assign({left:this.left,top:this.top,width:this.width,height:this.height,rotationAngle:this.rotationAngle,visualTransformMatrix:oe.toITransformMatrix(this.visual.transform.baseVal.getItem(0).matrix),containerTransformMatrix:oe.toITransformMatrix(this.container.transform.baseVal.getItem(0).matrix)},F.prototype.getState.call(this))},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var k=x;this.left=k.left,this.top=k.top,this.width=k.width,this.height=k.height,this.rotationAngle=k.rotationAngle,this.visual.transform.baseVal.getItem(0).setMatrix(oe.toSVGMatrix(this.visual.transform.baseVal.getItem(0).matrix,k.visualTransformMatrix)),this.container.transform.baseVal.getItem(0).setMatrix(oe.toSVGMatrix(this.container.transform.baseVal.getItem(0).matrix,k.containerTransformMatrix))},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k);var K=this.rotatePoint({x:this.left,y:this.top}),M=this.unrotatePoint({x:K.x*x,y:K.y*k});this.left=M.x,this.top=M.y,this.width=this.width*x,this.height=this.height*k,this.adjustControlBox()},v}(pe),be=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.createVisual=M.createVisual.bind(M),M}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual)},v.prototype.createVisual=function(){this.visual=$.createRect(1,1,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},v.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.setSize()},v.prototype.setSize=function(){F.prototype.setSize.call(this),$.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(x){F.prototype.pointerUp.call(this,x),this.setSize()},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.visual&&$.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(x),this.stateChanged()},v.prototype.setFillColor=function(x){this.fillColor=x,this.visual&&$.setAttributes(this.visual,[["fill",this.fillColor]]),this.stateChanged()},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.visual&&$.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.visual&&$.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.getState=function(){return Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this))},v.prototype.restoreState=function(x){var k=x;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.setSize()},v.title="Rectangle marker",v}(me),xe=function(F){function v(x,k,K,M){var ne=F.call(this,x,M||'<svg viewBox="0 0 24 24"><path d="M3 17h18v-2H3v2m0 3h18v-1H3v1m0-7h18v-3H3v3m0-9v4h18V4H3z"/></svg>')||this;return ne.widths=[],ne.widthBoxes=[],ne.widths=k,ne.currentWidth=K,ne.setCurrentWidth=ne.setCurrentWidth.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.widths.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.flexGrow="2",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=K===x.currentWidth?x.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){x.setCurrentWidth(K,M)}),k.appendChild(M);var ne=document.createElement("div");ne.innerText=K.toString(),ne.style.marginRight="5px",M.appendChild(ne);var Me=document.createElement("div");Me.style.minHeight="20px",Me.style.flexGrow="2",Me.style.display="flex",Me.style.alignItems="center";var je=document.createElement("hr");je.style.minWidth="20px",je.style.border="0px",je.style.borderTop=K+"px solid "+x.uiStyleSettings.toolboxColor,je.style.flexGrow="2",Me.appendChild(je),M.appendChild(Me),x.widthBoxes.push(M)}),k},v.prototype.setCurrentWidth=function(x,k){var K=this;this.currentWidth=x,this.widthBoxes.forEach(function(M){M.style.borderColor=M===k?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onWidthChanged&&this.onWidthChanged(this.currentWidth)},v}(Y),Ce=function(F){function v(x,k,K,M){var ne=F.call(this,x,M||'<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 ne.styles=[],ne.styleBoxes=[],ne.styles=k,ne.currentStyle=K,ne.setCurrentStyle=ne.setCurrentStyle.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",this.styles.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/x.styles.length-5+"%",M.style.borderColor=K===x.currentStyle?x.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){x.setCurrentStyle(K,M)}),k.appendChild(M);var ne=document.createElement("div");ne.style.minHeight="20px",ne.style.flexGrow="2",ne.style.overflow="hidden";var Me=`<svg width="100" height="20">
|
|
<line x1="0" y1="10" x2="100" y2="10" stroke="`+x.uiStyleSettings.toolboxColor+'" stroke-width="3" '+(K!==""?'stroke-dasharray="'+K+'"':"")+` />
|
|
</svg>`;ne.innerHTML=Me,M.appendChild(ne),x.styleBoxes.push(M)}),k},v.prototype.setCurrentStyle=function(x,k){var K=this;this.currentStyle=x,this.styleBoxes.forEach(function(M){M.style.borderColor=M===k?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onStyleChanged&&this.onStyleChanged(this.currentStyle)},v}(Y),Oe=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new se("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new xe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return J(v,F),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="FrameMarker",v.title="Frame marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4m14 11H6V8h12v9z"/></svg>',v}(be),Se=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},Ue=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.x1=0,M.y1=0,M.x2=0,M.y2=0,M.defaultLength=50,M.manipulationStartX=0,M.manipulationStartY=0,M.manipulationStartX1=0,M.manipulationStartY1=0,M.manipulationStartX2=0,M.manipulationStartY2=0,M.setupControlBox(),M}return J(v,F),v.prototype.ownsTarget=function(x){return!!F.prototype.ownsTarget.call(this,x)||!(!this.grip1.ownsTarget(x)&&!this.grip2.ownsTarget(x))},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.manipulationStartX=x.x,this.manipulationStartY=x.y,this.state==="new"&&(this.x1=x.x,this.y1=x.y,this.x2=x.x,this.y2=x.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(k)?this.activeGrip=this.grip1:this.grip2.ownsTarget(k)?this.activeGrip=this.grip2:this.activeGrip=void 0,this.activeGrip?this._state="resize":this._state="move")},v.prototype.pointerUp=function(x){var k=this.state;F.prototype.pointerUp.call(this,x),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(x),this._state="select",k==="creating"&&this.onMarkerCreated&&this.onMarkerCreated(this)},v.prototype.adjustVisual=function(){},v.prototype.manipulate=function(x){this.state==="creating"?this.resize(x):this.state==="move"?(this.x1=this.manipulationStartX1+x.x-this.manipulationStartX,this.y1=this.manipulationStartY1+x.y-this.manipulationStartY,this.x2=this.manipulationStartX2+x.x-this.manipulationStartX,this.y2=this.manipulationStartY2+x.y-this.manipulationStartY,this.adjustVisual(),this.adjustControlBox()):this.state==="resize"&&this.resize(x)},v.prototype.resize=function(x){switch(this.activeGrip){case this.grip1:this.x1=x.x,this.y1=x.y;break;case this.grip2:case void 0:this.x2=x.x,this.y2=x.y}this.adjustVisual(),this.adjustControlBox()},v.prototype.select=function(){F.prototype.select.call(this),this.adjustControlBox(),this.controlBox.style.display=""},v.prototype.deselect=function(){F.prototype.deselect.call(this),this.controlBox.style.display="none"},v.prototype.setupControlBox=function(){this.controlBox=$.createGroup(),this.container.appendChild(this.controlBox),this.addControlGrips(),this.controlBox.style.display="none"},v.prototype.adjustControlBox=function(){this.positionGrips()},v.prototype.addControlGrips=function(){this.grip1=this.createGrip(),this.grip2=this.createGrip(),this.positionGrips()},v.prototype.createGrip=function(){var x=new ke;return x.visual.transform.baseVal.appendItem($.createTransform()),this.controlBox.appendChild(x.visual),x},v.prototype.positionGrips=function(){var x=this.grip1.GRIP_SIZE;this.positionGrip(this.grip1.visual,this.x1-x/2,this.y1-x/2),this.positionGrip(this.grip2.visual,this.x2-x/2,this.y2-x/2)},v.prototype.positionGrip=function(x,k,K){var M=x.transform.baseVal.getItem(0);M.setTranslate(k,K),x.transform.baseVal.replaceItem(M,0)},v.prototype.getState=function(){return Object.assign({x1:this.x1,y1:this.y1,x2:this.x2,y2:this.y2},F.prototype.getState.call(this))},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var k=x;this.x1=k.x1,this.y1=k.y1,this.x2=k.x2,this.y2=k.y2},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.x1=this.x1*x,this.y1=this.y1*k,this.x2=this.x2*x,this.y2=this.y2*k,this.adjustVisual(),this.adjustControlBox()},v}(pe),Be=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new se("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new xe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.selectorLine&&x!==this.visibleLine)},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.selectorLine=$.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()]]),this.visibleLine=$.createLine(this.x1,this.y1,this.x2,this.y2,[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()]]),this.visual.appendChild(this.selectorLine),this.visual.appendChild(this.visibleLine),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.state==="new"&&(this.createVisual(),this.adjustVisual(),this._state="creating")},v.prototype.adjustVisual=function(){this.selectorLine&&this.visibleLine&&(this.selectorLine.setAttribute("x1",this.x1.toString()),this.selectorLine.setAttribute("y1",this.y1.toString()),this.selectorLine.setAttribute("x2",this.x2.toString()),this.selectorLine.setAttribute("y2",this.y2.toString()),this.visibleLine.setAttribute("x1",this.x1.toString()),this.visibleLine.setAttribute("y1",this.y1.toString()),this.visibleLine.setAttribute("x2",this.x2.toString()),this.visibleLine.setAttribute("y2",this.y2.toString()),$.setAttributes(this.visibleLine,[["stroke",this.strokeColor]]),$.setAttributes(this.visibleLine,[["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.visibleLine,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.adjustVisual(),this.colorChanged(x)},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.adjustVisual()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var k=x;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.createVisual(),this.adjustVisual()},v.typeName="LineMarker",v.title="Line marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 13H5v-2h14v2z"/></svg>',v}(Ue),Te=function(F){function v(x,k,K,M){var ne=F.call(this,x,M||'<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 ne.fonts=[],ne.fontBoxes=[],ne.fonts=k,ne.currentFont=K,ne.setCurrentFont=ne.setCurrentFont.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.overflow="hidden",k.style.flexGrow="2",this.fonts.forEach(function(K){var M=document.createElement("div");M.style.display="inline-block",M.style.alignItems="center",M.style.justifyContent="space-between",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.overflow="hidden",M.style.maxWidth=100/x.fonts.length-5+"%",M.style.borderColor=K===x.currentFont?x.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){x.setCurrentFont(K,M)}),k.appendChild(M);var ne=document.createElement("div");ne.style.display="flex",ne.style.minHeight="20px",ne.style.flexGrow="2",ne.style.fontFamily=K,ne.style.overflow="hidden";var Me=document.createElement("div");Me.style.whiteSpace="nowrap",Me.style.overflow="hidden",Me.style.textOverflow="ellipsis",Me.innerHTML="The quick brown fox jumps over the lazy dog",ne.appendChild(Me),M.appendChild(ne),x.fontBoxes.push(M)}),k},v.prototype.setCurrentFont=function(x,k){var K=this;this.currentFont=x,this.fontBoxes.forEach(function(M){M.style.borderColor=M===k?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onFontChanged&&this.onFontChanged(this.currentFont)},v}(Y),De=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.color="transparent",M.padding=5,M.DEFAULT_TEXT="your text here",M.text=M.DEFAULT_TEXT,M.isMoved=!1,M.color=K.defaultColor,M.fontFamily=K.defaultFontFamily,M.defaultSize={x:100,y:30},M.setColor=M.setColor.bind(M),M.setFont=M.setFont.bind(M),M.renderText=M.renderText.bind(M),M.sizeText=M.sizeText.bind(M),M.textEditDivClicked=M.textEditDivClicked.bind(M),M.showTextEditor=M.showTextEditor.bind(M),M.setSize=M.setSize.bind(M),M.positionTextEditor=M.positionTextEditor.bind(M),M.colorPanel=new se("Color",K.defaultColorSet,K.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.fontFamilyPanel=new Te("Font",K.defaultFontFamilies,K.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M}return J(v,F),v.prototype.ownsTarget=function(x){if(F.prototype.ownsTarget.call(this,x)||x===this.visual||x===this.textElement||x===this.bgRectangle)return!0;var k=!1;return this.textElement.childNodes.forEach(function(K){K===x&&(k=!0)}),k},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.bgRectangle=$.createRect(1,1,[["fill","transparent"]]),this.visual.appendChild(this.bgRectangle),this.textElement=$.createText([["fill",this.color],["font-family",this.fontFamily],["font-size","16px"],["x","0"],["y","0"]]),this.textElement.transform.baseVal.appendItem($.createTransform()),this.textElement.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.textElement),this.addMarkerVisualToContainer(this.visual),this.renderText()},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.isMoved=!1,this.pointerDownPoint=x,this.pointerDownTimestamp=Date.now(),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},v.prototype.renderText=function(){var x=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(k){x.textElement.appendChild($.createTSpan(k.trim()===""?" ":k.trim(),[["x","0"],["dy","1.2em"]]))}),setTimeout(this.sizeText,10)}},v.prototype.getTextScale=function(){var x=this.textElement.getBBox(),k=1;if(x.width>0&&x.height>0){var K=(1*this.width-this.width*this.padding*2/100)/x.width,M=(1*this.height-this.height*this.padding*2/100)/x.height;k=Math.min(K,M)}return k},v.prototype.getTextPosition=function(x){var k=this.textElement.getBBox(),K=0,M=0;return k.width>0&&k.height>0&&(K=(this.width-k.width*x)/2,M=this.height/2-k.height*x/2),{x:K,y:M}},v.prototype.sizeText=function(){var x=this.textElement.getBBox(),k=this.getTextScale(),K=this.getTextPosition(k);K.y-=x.y*k,navigator.userAgent.indexOf("Edge/")>-1?this.textElement.style.transform="translate("+K.x+"px, "+K.y+"px) scale("+k+", "+k+")":(this.textElement.transform.baseVal.getItem(0).setTranslate(K.x,K.y),this.textElement.transform.baseVal.getItem(1).setScale(k,k))},v.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x),this.pointerDownPoint!==void 0&&(this.isMoved=Math.abs(x.x-this.pointerDownPoint.x)>5||Math.abs(x.y-this.pointerDownPoint.y)>5)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.isMoved=!0,this.setSize(),this.sizeText()},v.prototype.setSize=function(){F.prototype.setSize.call(this),this.visual&&this.bgRectangle&&($.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.bgRectangle,[["width",this.width.toString()],["height",this.height.toString()]]))},v.prototype.pointerUp=function(x){var k=this.state;k==="creating"&&(this._suppressMarkerCreateEvent=!0),F.prototype.pointerUp.call(this,x),this.setSize(),(k==="creating"||!this.isMoved&&Date.now()-this.pointerDownTimestamp>500)&&this.showTextEditor(),this.pointerDownPoint=void 0},v.prototype.showTextEditor=function(){var x=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(k){k.stopPropagation()}),this.textEditor.addEventListener("input",function(){for(var k=Number.parseFloat(x.textEditor.style.fontSize);x.textEditor.clientWidth>=Number.parseInt(x.textEditor.style.maxWidth)&&k>.9;)k-=.1,x.textEditor.style.fontSize=Math.max(k,.9)+"em"}),this.textEditor.addEventListener("keyup",function(k){k.cancelBubble=!0}),this.textEditor.addEventListener("paste",function(k){if(k.clipboardData){var K=k.clipboardData.getData("text"),M=window.getSelection();if(!M.rangeCount)return!1;M.deleteFromDocument(),M.getRangeAt(0).insertNode(document.createTextNode(K)),k.preventDefault()}}),this.textEditDiv.addEventListener("pointerup",function(){x.textEditDivClicked(x.textEditor.innerText)}),this.textEditDiv.appendChild(this.textEditor),this.overlayContainer.appendChild(this.textEditDiv),this.hideVisual(),this.textEditor.focus(),document.execCommand("selectAll")},v.prototype.positionTextEditor=function(){if(this.state==="edit")if(this.textEditor===void 0)this.showTextEditor();else{this.textElement.style.display="";var x=this.getTextScale(),k=this.rotatePoint({x:this.left+this.width/2,y:this.top+this.height/2}),K=this.textElement.getBBox(),M={x:K.width*x,y:K.height*x};k.x-=M.x/2,k.y-=M.y/2,this.textEditor.style.top=k.y+"px",this.textEditor.style.left=k.x+"px",this.textEditor.style.maxWidth=this.overlayContainer.offsetWidth-k.x+"px",this.textEditor.style.fontSize=Math.max(16*x,12)+"px",this.textElement.style.display="none"}},v.prototype.textEditDivClicked=function(x){this.text=x.trim(),this.overlayContainer.innerHTML="",this.renderText(),this.showVisual(),this._suppressMarkerCreateEvent&&(this._suppressMarkerCreateEvent=!1,this.onMarkerCreated&&this.onMarkerCreated(this)),this.stateChanged()},v.prototype.select=function(){F.prototype.select.call(this),this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText)},v.prototype.deselect=function(){this.state==="edit"&&this.textEditDivClicked(this.textEditor.innerText),F.prototype.deselect.call(this)},v.prototype.dblClick=function(x,k){F.prototype.dblClick.call(this,x,k),this.showTextEditor()},v.prototype.setColor=function(x){this.textElement&&$.setAttributes(this.textElement,[["fill",x]]),this.color=x,this.textEditor&&(this.textEditor.style.color=this.color),this.colorChanged(x)},v.prototype.setFont=function(x){this.textElement&&$.setAttributes(this.textElement,[["font-family",x]]),this.fontFamily=x,this.textEditor&&(this.textEditor.style.fontFamily=this.fontFamily),this.renderText(),this.stateChanged()},v.prototype.hideVisual=function(){this.textElement.style.display="none",this.hideControlBox()},v.prototype.showVisual=function(){this.state==="edit"&&(this._state="select"),this.textElement.style.display="",this.showControlBox()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({color:this.color,fontFamily:this.fontFamily,padding:this.padding,text:this.text},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){var k=x;this.color=k.color,this.fontFamily=k.fontFamily,this.padding=k.padding,this.text=k.text,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.setSize(),this.sizeText(),this.positionTextEditor()},v.typeName="TextMarker",v.title="Text marker",v.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>',v}(me),de=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.color="transparent",M.lineWidth=3,M.drawing=!1,M.pixelRatio=1,M.color=K.defaultColor,M.lineWidth=K.defaultStrokeWidth,M.pixelRatio=K.freehandPixelRatio,M.setColor=M.setColor.bind(M),M.addCanvas=M.addCanvas.bind(M),M.finishCreation=M.finishCreation.bind(M),M.setLineWidth=M.setLineWidth.bind(M),M.colorPanel=new se("Color",K.defaultColorSet,K.defaultColor),M.colorPanel.onColorChanged=M.setColor,M.lineWidthPanel=new xe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.lineWidthPanel.onWidthChanged=M.setLineWidth,M}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.drawingImage)},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.drawingImage=$.createImage(),this.visual.appendChild(this.drawingImage);var x=$.createTransform();this.visual.transform.baseVal.appendItem(x),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,k){this.state==="new"&&(this.addCanvas(),this.createVisual(),this._state="creating"),this.state==="creating"?(this.canvasContext.strokeStyle=this.color,this.canvasContext.lineWidth=this.lineWidth,this.canvasContext.beginPath(),this.canvasContext.moveTo(x.x,x.y),this.drawing=!0):F.prototype.pointerDown.call(this,x,k)},v.prototype.manipulate=function(x){this.state==="creating"?this.drawing&&(this.canvasContext.lineTo(x.x,x.y),this.canvasContext.stroke()):F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),$.setAttributes(this.visual,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]])},v.prototype.pointerUp=function(x){this._state==="creating"?this.drawing&&(this.canvasContext.closePath(),this.drawing=!1,this.globalSettings.newFreehandMarkerOnPointerUp&&this.finishCreation()):F.prototype.pointerUp.call(this,x)},v.prototype.addCanvas=function(){this.overlayContainer.innerHTML="",this.canvasElement=document.createElement("canvas"),this.canvasElement.width=this.overlayContainer.clientWidth*this.pixelRatio,this.canvasElement.height=this.overlayContainer.clientHeight*this.pixelRatio,this.canvasContext=this.canvasElement.getContext("2d"),this.canvasContext.scale(this.pixelRatio,this.pixelRatio),this.overlayContainer.appendChild(this.canvasElement)},v.prototype.select=function(){this.state==="creating"&&this.finishCreation(),F.prototype.select.call(this)},v.prototype.deselect=function(){this.state==="creating"&&this.finishCreation(),F.prototype.deselect.call(this)},v.prototype.finishCreation=function(){for(var x=this.canvasContext.getImageData(0,0,this.canvasElement.width,this.canvasElement.height),k=[this.canvasElement.width+1,this.canvasElement.height+1,-1,-1],K=k[0],M=k[1],ne=k[2],Me=k[3],je=!1,He=0;He<this.canvasElement.height;He++)for(var Pe=0;Pe<this.canvasElement.width;Pe++)x.data[He*this.canvasElement.width*4+4*Pe+3]>0&&(je=!0,He<M&&(M=He),Pe<K&&(K=Pe),He>Me&&(Me=He),Pe>ne&&(ne=Pe));if(je){this.left=K/this.pixelRatio,this.top=M/this.pixelRatio,this.width=(ne-K)/this.pixelRatio,this.height=(Me-M)/this.pixelRatio;var Xe=document.createElement("canvas");Xe.width=ne-K,Xe.height=Me-M,Xe.getContext("2d").putImageData(this.canvasContext.getImageData(K,M,ne-K,Me-M),0,0),this.drawingImgUrl=Xe.toDataURL("image/png"),this.setDrawingImage(),this._state="select",this.onMarkerCreated&&this.onMarkerCreated(this)}this.overlayContainer.innerHTML=""},v.prototype.setDrawingImage=function(){$.setAttributes(this.drawingImage,[["width",this.width.toString()],["height",this.height.toString()]]),$.setAttributes(this.drawingImage,[["href",this.drawingImgUrl]]),this.moveVisual({x:this.left,y:this.top})},v.prototype.setColor=function(x){this.color=x,this.colorChanged(x)},v.prototype.setLineWidth=function(x){this.lineWidth=x},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return this.state==="new"||this.state==="creating"?[this.colorPanel,this.lineWidthPanel]:[]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({drawingImgUrl:this.drawingImgUrl},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){this.createVisual(),F.prototype.restoreState.call(this,x),this.drawingImgUrl=x.drawingImgUrl,this.setDrawingImage()},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.setDrawingImage()},v.typeName="FreehandMarker",v.title="Freehand marker",v.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>',v}(me),re=function(F){function v(x,k,K){var M=F.call(this,x,K||'<svg viewBox="0 0 24 24"><path d="M8 14v4l-6-6 6-6v4h8V6l6 6-6 6v-4H8z"/></svg>')||this;return M.typeBoxes=[],M.currentType=k,M.setCurrentType=M.setCurrentType.bind(M),M}return J(v,F),v.prototype.getUi=function(){var x=this,k=document.createElement("div");k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2";for(var K=function(Me){var je="both";switch(Me){case 0:je="both";break;case 1:je="start";break;case 2:je="end";break;case 3:je="none"}var He=document.createElement("div");if(He.style.display="flex",He.style.flexGrow="2",He.style.alignItems="center",He.style.justifyContent="space-between",He.style.padding="5px",He.style.borderWidth="2px",He.style.borderStyle="solid",He.style.borderColor=je===M.currentType?M.uiStyleSettings.toolboxAccentColor:"transparent",He.addEventListener("click",function(){x.setCurrentType(je,He)}),k.appendChild(He),je==="both"||je==="start"){var Pe=document.createElement("div");Pe.style.display="flex",Pe.style.alignItems="center",Pe.style.minHeight="20px",Pe.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="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,Pe.style.marginLeft="5px",He.appendChild(Pe)}var Xe=document.createElement("div");Xe.style.display="flex",Xe.style.alignItems="center",Xe.style.minHeight="20px",Xe.style.flexGrow="2";var Ke=document.createElement("hr");if(Ke.style.minWidth="20px",Ke.style.border="0px",Ke.style.borderTop="3px solid "+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee"),Ke.style.flexGrow="2",Xe.appendChild(Ke),He.appendChild(Xe),je==="both"||je==="end"){var at=document.createElement("div");at.style.display="flex",at.style.alignItems="center",at.style.minHeight="20px",at.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="`+(M.uiStyleSettings!==void 0?M.uiStyleSettings.toolboxColor:"#eeeeee")+`" />
|
|
</svg>`,at.style.marginRight="5px",He.appendChild(at)}M.typeBoxes.push(He)},M=this,ne=0;ne<4;ne++)K(ne);return k},v.prototype.setCurrentType=function(x,k){var K=this;this.currentType=x,this.typeBoxes.forEach(function(M){M.style.borderColor=M===k?K.uiStyleSettings!==void 0?K.uiStyleSettings.toolboxAccentColor:"#3080c3":"transparent"}),this.onArrowTypeChanged&&this.onArrowTypeChanged(this.currentType)},v}(Y),le=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.arrowType="end",M.arrowBaseHeight=10,M.arrowBaseWidth=10,M.getArrowPoints=M.getArrowPoints.bind(M),M.setArrowType=M.setArrowType.bind(M),M.arrowTypePanel=new re("Arrow type","end"),M.arrowTypePanel.onArrowTypeChanged=M.setArrowType,M}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.arrow1&&x!==this.arrow2)},v.prototype.getArrowPoints=function(x,k){var K=this.arrowBaseWidth+2*this.strokeWidth,M=this.arrowBaseHeight+2*this.strokeWidth;return x-K/2+","+(k+M/2)+" "+x+","+(k-M/2)+" "+(x+K/2)+","+(k+M/2)},v.prototype.createTips=function(){this.arrow1=$.createPolygon(this.getArrowPoints(this.x1,this.y1),[["fill",this.strokeColor]]),this.arrow1.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.arrow1),this.arrow2=$.createPolygon(this.getArrowPoints(this.x2,this.y2),[["fill",this.strokeColor]]),this.arrow2.transform.baseVal.appendItem($.createTransform()),this.visual.appendChild(this.arrow2)},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(F.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",$.setAttributes(this.arrow1,[["points",this.getArrowPoints(this.x1,this.y1)],["fill",this.strokeColor]]),$.setAttributes(this.arrow2,[["points",this.getArrowPoints(this.x2,this.y2)],["fill",this.strokeColor]]),Math.abs(this.x1-this.x2)>.1)){var x=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.arrow1.transform.baseVal.getItem(0);k.setRotate(x,this.x1,this.y1),this.arrow1.transform.baseVal.replaceItem(k,0);var K=this.arrow2.transform.baseVal.getItem(0);K.setRotate(x+180,this.x2,this.y2),this.arrow2.transform.baseVal.replaceItem(K,0)}},v.prototype.setArrowType=function(x){this.arrowType=x,this.adjustVisual(),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel,this.arrowTypePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({arrowType:this.arrowType},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var k=x;this.arrowType=k.arrowType,this.createTips(),this.adjustVisual()},v.typeName="ArrowMarker",v.title="Arrow marker",v.icon='<svg viewBox="0 0 24 24"><path d="M19 6.41L17.59 5 7 15.59V9H5v10h10v-2H8.41L19 6.41z"/></svg>',v}(Be),z=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.fillColor=K.defaultFillColor,M.strokeWidth=0,M.fillPanel=new se("Color",K.defaultColorSet,K.defaultFillColor),M.fillPanel.onColorChanged=M.setFillColor,M}return J(v,F),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="CoverMarker",v.title="Cover marker",v.icon='<svg viewBox="0 0 24 24"><path d="M4 6v13h16V6H4z"/></svg>',v}(be),Q=function(F){function v(x,k,K,M){var ne=F.call(this,x,M||'<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 ne.opacities=[],ne.opacityBoxes=[],ne.opacities=k,ne.currentOpacity=K,ne.setCurrentOpacity=ne.setCurrentOpacity.bind(ne),ne}return J(v,F),v.prototype.getUi=function(){var x=this,k=document.createElement("div");return k.style.display="flex",k.style.overflow="hidden",k.style.flexGrow="2",k.style.justifyContent="space-between",this.opacities.forEach(function(K){var M=document.createElement("div");M.style.display="flex",M.style.alignItems="center",M.style.justifyContent="center",M.style.padding="5px",M.style.borderWidth="2px",M.style.borderStyle="solid",M.style.borderColor=K===x.currentOpacity?x.uiStyleSettings.toolboxAccentColor:"transparent",M.addEventListener("click",function(){x.setCurrentOpacity(K,M)}),k.appendChild(M);var ne=document.createElement("div");ne.innerText=100*K+"%",M.appendChild(ne),x.opacityBoxes.push(M)}),k},v.prototype.setCurrentOpacity=function(x,k){var K=this;this.currentOpacity=x,this.opacityBoxes.forEach(function(M){M.style.borderColor=M===k?K.uiStyleSettings.toolboxAccentColor:"transparent"}),this.onOpacityChanged&&this.onOpacityChanged(this.currentOpacity)},v}(Y),q=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.setOpacity=M.setOpacity.bind(M),M.fillColor=K.defaultHighlightColor,M.strokeWidth=0,M.opacity=K.defaultHighlightOpacity,M.fillPanel=new se("Color",K.defaultColorSet,M.fillColor),M.fillPanel.onColorChanged=M.setFillColor,M.opacityPanel=new Q("Opacity",K.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return J(v,F),v.prototype.setOpacity=function(x){this.opacity=x,this.visual&&$.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.fillPanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="HighlightMarker",v.title="Highlight marker",v.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>',v}(z),ee='<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>',ve=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.bgColor="transparent",M.tipPosition={x:0,y:0},M.tipBase1Position={x:0,y:0},M.tipBase2Position={x:0,y:0},M.tipMoving=!1,M.color=K.defaultStrokeColor,M.bgColor=K.defaultFillColor,M.fontFamily=K.defaultFontFamily,M.defaultSize={x:100,y:30},M.setBgColor=M.setBgColor.bind(M),M.getTipPoints=M.getTipPoints.bind(M),M.positionTip=M.positionTip.bind(M),M.setTipPoints=M.setTipPoints.bind(M),M.colorPanel=new se("Text color",K.defaultColorSet,M.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>'),M.colorPanel.onColorChanged=M.setColor,M.bgColorPanel=new se("Fill color",K.defaultColorSet,M.bgColor,ee),M.bgColorPanel.onColorChanged=M.setBgColor,M.fontFamilyPanel=new Te("Font",K.defaultFontFamilies,K.defaultFontFamily),M.fontFamilyPanel.onFontChanged=M.setFont,M.tipGrip=new ke,M.tipGrip.visual.transform.baseVal.appendItem($.createTransform()),M.controlBox.appendChild(M.tipGrip.visual),M}return J(v,F),v.prototype.ownsTarget=function(x){return F.prototype.ownsTarget.call(this,x)||this.tipGrip.ownsTarget(x)||this.tip===x},v.prototype.createTip=function(){$.setAttributes(this.bgRectangle,[["fill",this.bgColor],["rx","10px"]]),this.tip=$.createPolygon(this.getTipPoints(),[["fill",this.bgColor]]),this.visual.appendChild(this.tip)},v.prototype.pointerDown=function(x,k){this.state==="new"&&F.prototype.pointerDown.call(this,x,k),this.state==="creating"?this.createTip():this.tipGrip.ownsTarget(k)?(this.manipulationStartLeft=this.left,this.manipulationStartTop=this.top,this.tipMoving=!0):F.prototype.pointerDown.call(this,x,k)},v.prototype.pointerUp=function(x){if(this.tipMoving)this.tipMoving=!1,this.isMoved=!0,F.prototype.pointerUp.call(this,x);else{var k=this.state==="creating";F.prototype.pointerUp.call(this,x),this.setTipPoints(k),this.positionTip()}},v.prototype.manipulate=function(x){if(this.tipMoving){var k=this.unrotatePoint(x);this.tipPosition={x:k.x-this.manipulationStartLeft,y:k.y-this.manipulationStartTop},this.positionTip()}else F.prototype.manipulate.call(this,x)},v.prototype.setBgColor=function(x){this.bgRectangle&&this.tip&&($.setAttributes(this.bgRectangle,[["fill",x]]),$.setAttributes(this.tip,[["fill",x]])),this.bgColor=x,this.fillColorChanged(x)},v.prototype.getTipPoints=function(){return this.setTipPoints(this.state==="creating"),this.tipBase1Position.x+","+this.tipBase1Position.y+" "+this.tipBase2Position.x+","+this.tipBase2Position.y+" "+this.tipPosition.x+","+this.tipPosition.y},v.prototype.setTipPoints=function(x){x===void 0&&(x=!1);var k=Math.min(this.height/2,15),K=this.height/5;x&&(this.tipPosition={x:k+K/2,y:this.height+20});var M=Math.atan(this.height/2/(this.width/2));this.tipPosition.x<this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.width/2-this.tipPosition.x))?(K=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:0},this.tipBase2Position={x:k+K,y:0}):(this.tipBase1Position={x:0,y:k},this.tipBase2Position={x:0,y:k+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y<this.height/2?M<Math.atan((this.height/2-this.tipPosition.y)/(this.tipPosition.x-this.width/2))?(K=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-K,y:0},this.tipBase2Position={x:this.width-k,y:0}):(this.tipBase1Position={x:this.width,y:k},this.tipBase2Position={x:this.width,y:k+K}):this.tipPosition.x>=this.width/2&&this.tipPosition.y>=this.height/2?M<Math.atan((this.tipPosition.y-this.height/2)/(this.tipPosition.x-this.width/2))?(K=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:this.width-k-K,y:this.height},this.tipBase2Position={x:this.width-k,y:this.height}):(this.tipBase1Position={x:this.width,y:this.height-k-K},this.tipBase2Position={x:this.width,y:this.height-k}):M<Math.atan((this.tipPosition.y-this.height/2)/(this.width/2-this.tipPosition.x))?(K=this.width/5,k=Math.min(this.width/2,15),this.tipBase1Position={x:k,y:this.height},this.tipBase2Position={x:k+K,y:this.height}):(this.tipBase1Position={x:0,y:this.height-k},this.tipBase2Position={x:0,y:this.height-k-K})},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.positionTip()},v.prototype.positionTip=function(){$.setAttributes(this.tip,[["points",this.getTipPoints()]]);var x=this.tipGrip.visual.transform.baseVal.getItem(0);x.setTranslate(this.tipPosition.x,this.tipPosition.y),this.tipGrip.visual.transform.baseVal.replaceItem(x,0)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.colorPanel,this.bgColorPanel,this.fontFamilyPanel]},enumerable:!1,configurable:!0}),v.prototype.select=function(){this.positionTip(),F.prototype.select.call(this)},v.prototype.getState=function(){var x=Object.assign({bgColor:this.bgColor,tipPosition:this.tipPosition},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){var k=x;this.bgColor=k.bgColor,this.tipPosition=k.tipPosition,F.prototype.restoreState.call(this,x),this.createTip(),this.setTipPoints()},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.tipPosition={x:this.tipPosition.x*x,y:this.tipPosition.y*k},this.positionTip()},v.typeName="CalloutMarker",v.title="Callout marker",v.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>',v}(De),we=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.fillColor="transparent",M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.opacity=1,M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.fillColor=K.defaultFillColor,M.setStrokeColor=M.setStrokeColor.bind(M),M.setFillColor=M.setFillColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.setOpacity=M.setOpacity.bind(M),M.createVisual=M.createVisual.bind(M),M.strokePanel=new se("Line color",X(K.defaultColorSet,["transparent"]),K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.fillPanel=new se("Fill color",X(K.defaultColorSet,["transparent"]),M.fillColor,ee),M.fillPanel.onColorChanged=M.setFillColor,M.strokeWidthPanel=new xe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M.opacityPanel=new Q("Opacity",K.defaultOpacitySteps,M.opacity),M.opacityPanel.onOpacityChanged=M.setOpacity,M}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual)},v.prototype.createVisual=function(){this.visual=$.createEllipse(this.width/2,this.height/2,[["fill",this.fillColor],["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["stroke-dasharray",this.strokeDasharray],["opacity",this.opacity.toString()]]),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.state==="new"&&(this.createVisual(),this.moveVisual(x),this._state="creating")},v.prototype.manipulate=function(x){F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){F.prototype.resize.call(this,x),this.setSize()},v.prototype.setSize=function(){F.prototype.setSize.call(this),$.setAttributes(this.visual,[["cx",(this.width/2).toString()],["cy",(this.height/2).toString()],["rx",(this.width/2).toString()],["ry",(this.height/2).toString()]])},v.prototype.pointerUp=function(x){F.prototype.pointerUp.call(this,x),this.setSize()},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.visual&&$.setAttributes(this.visual,[["stroke",this.strokeColor]]),this.colorChanged(x),this.stateChanged()},v.prototype.setFillColor=function(x){this.fillColor=x,this.visual&&$.setAttributes(this.visual,[["fill",this.fillColor]]),this.fillColorChanged(x),this.stateChanged()},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.visual&&$.setAttributes(this.visual,[["stroke-width",this.strokeWidth.toString()]]),this.stateChanged()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.visual&&$.setAttributes(this.visual,[["stroke-dasharray",this.strokeDasharray]]),this.stateChanged()},v.prototype.setOpacity=function(x){this.opacity=x,this.visual&&$.setAttributes(this.visual,[["opacity",this.opacity.toString()]]),this.stateChanged()},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.fillPanel,this.strokeWidthPanel,this.strokeStylePanel,this.opacityPanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({fillColor:this.fillColor,strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,opacity:this.opacity},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){var k=x;this.fillColor=k.fillColor,this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.opacity=k.opacity,this.createVisual(),F.prototype.restoreState.call(this,x),this.setSize()},v.prototype.scale=function(x,k){F.prototype.scale.call(this,x,k),this.setSize()},v.typeName="EllipseMarker",v.title="Ellipse marker",v.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>',v}(me),Fe=function(F){function v(x,k,K){return F.call(this,x,k,K)||this}return J(v,F),Object.defineProperty(v.prototype,"tipLength",{get:function(){return 10+3*this.strokeWidth},enumerable:!1,configurable:!0}),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.tip1&&x!==this.tip2)},v.prototype.createTips=function(){this.tip1=$.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($.createTransform()),this.visual.appendChild(this.tip1),this.tip2=$.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($.createTransform()),this.visual.appendChild(this.tip2)},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.state==="creating"&&this.createTips()},v.prototype.adjustVisual=function(){if(F.prototype.adjustVisual.call(this),this.tip1&&this.tip2&&($.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()]]),$.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 x=180*Math.atan((this.y2-this.y1)/(this.x2-this.x1))/Math.PI+90*Math.sign(this.x1-this.x2),k=this.tip1.transform.baseVal.getItem(0);k.setRotate(x,this.x1,this.y1),this.tip1.transform.baseVal.replaceItem(k,0);var K=this.tip2.transform.baseVal.getItem(0);K.setRotate(x+180,this.x2,this.y2),this.tip2.transform.baseVal.replaceItem(K,0)}},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x),this.createTips(),this.adjustVisual()},v.typeName="MeasurementMarker",v.title="Measurement marker",v.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>',v}(Be),Ge=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.strokePanel.colors=K.defaultColorSet,M.fillColor="transparent",M}return J(v,F),Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=F.prototype.getState.call(this);return x.typeName=v.typeName,x},v.typeName="EllipseFrameMarker",v.title="Ellipse frame marker",v.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>',v}(we),Je=function(){function F(){this.undoStack=[],this.redoStack=[]}return Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return this.undoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return this.redoStack.length>0},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"undoStepCount",{get:function(){return this.undoStack.length},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"redoStepCount",{get:function(){return this.redoStack.length},enumerable:!1,configurable:!0}),F.prototype.addUndoStep=function(v){this.undoStack.length!==0&&JSON.stringify(this.undoStack[this.undoStack.length-1])===JSON.stringify(v)||(this.undoStack.push(v),JSON.stringify(this.lastRedoStep)!==JSON.stringify(v)&&this.redoStack.splice(0,this.redoStack.length))},F.prototype.replaceLastUndoStep=function(v){this.undoStack.length>0&&(this.undoStack[this.undoStack.length-1]=v)},F.prototype.getLastUndoStep=function(){return this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0},F.prototype.undo=function(){if(this.undoStack.length>1){var v=this.undoStack.pop();return v!==void 0&&this.redoStack.push(v),this.undoStack.length>0?this.undoStack[this.undoStack.length-1]:void 0}},F.prototype.redo=function(){return this.lastRedoStep=this.redoStack.pop(),this.lastRedoStep},F}(),ze=function(F){function v(x,k,K){var M=F.call(this,x,k,K)||this;return M.strokeColor="transparent",M.strokeWidth=0,M.strokeDasharray="",M.curveX=0,M.curveY=0,M.manipulationStartCurveX=0,M.manipulationStartCurveY=0,M.setStrokeColor=M.setStrokeColor.bind(M),M.setStrokeWidth=M.setStrokeWidth.bind(M),M.setStrokeDasharray=M.setStrokeDasharray.bind(M),M.positionGrips=M.positionGrips.bind(M),M.addControlGrips=M.addControlGrips.bind(M),M.adjustVisual=M.adjustVisual.bind(M),M.setupControlBox=M.setupControlBox.bind(M),M.resize=M.resize.bind(M),M.strokeColor=K.defaultColor,M.strokeWidth=K.defaultStrokeWidth,M.strokeDasharray=K.defaultStrokeDasharray,M.strokePanel=new se("Line color",K.defaultColorSet,K.defaultColor),M.strokePanel.onColorChanged=M.setStrokeColor,M.strokeWidthPanel=new xe("Line width",K.defaultStrokeWidths,K.defaultStrokeWidth),M.strokeWidthPanel.onWidthChanged=M.setStrokeWidth,M.strokeStylePanel=new Ce("Line style",K.defaultStrokeDasharrays,K.defaultStrokeDasharray),M.strokeStylePanel.onStyleChanged=M.setStrokeDasharray,M}return J(v,F),v.prototype.ownsTarget=function(x){return!(!F.prototype.ownsTarget.call(this,x)&&x!==this.visual&&x!==this.selectorCurve&&x!==this.visibleCurve&&!this.curveGrip.ownsTarget(x))},v.prototype.getPathD=function(){return"M "+this.x1+" "+this.y1+" Q "+this.curveX+" "+this.curveY+", "+this.x2+" "+this.y2},v.prototype.createVisual=function(){this.visual=$.createGroup(),this.selectorCurve=$.createPath(this.getPathD(),[["stroke","transparent"],["stroke-width",(this.strokeWidth+10).toString()],["fill","transparent"]]),this.visibleCurve=$.createPath(this.getPathD(),[["stroke",this.strokeColor],["stroke-width",this.strokeWidth.toString()],["fill","transparent"]]),this.visual.appendChild(this.selectorCurve),this.visual.appendChild(this.visibleCurve),this.addMarkerVisualToContainer(this.visual)},v.prototype.pointerDown=function(x,k){F.prototype.pointerDown.call(this,x,k),this.manipulationStartCurveX=this.curveX,this.manipulationStartCurveY=this.curveY,this.state==="new"&&(this.curveX=x.x,this.curveY=x.y),this.state==="new"?(this.createVisual(),this.adjustVisual(),this._state="creating"):this.curveGrip.ownsTarget(k)&&(this.activeGrip=this.curveGrip,this._state="resize")},v.prototype.adjustVisual=function(){this.selectorCurve&&this.visibleCurve&&(this.selectorCurve.setAttribute("d",this.getPathD()),this.visibleCurve.setAttribute("d",this.getPathD()),$.setAttributes(this.visibleCurve,[["stroke",this.strokeColor]]),$.setAttributes(this.visibleCurve,[["stroke-width",this.strokeWidth.toString()]]),$.setAttributes(this.visibleCurve,[["stroke-dasharray",this.strokeDasharray.toString()]]))},v.prototype.setupControlBox=function(){F.prototype.setupControlBox.call(this),this.curveControlLine1=$.createLine(this.x1,this.y1,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.curveControlLine2=$.createLine(this.x2,this.y2,this.curveX,this.curveY,[["stroke","black"],["stroke-width","1"],["stroke-opacity","0.5"],["stroke-dasharray","3, 2"]]),this.controlBox.insertBefore(this.curveControlLine1,this.controlBox.firstChild),this.controlBox.insertBefore(this.curveControlLine2,this.controlBox.firstChild)},v.prototype.addControlGrips=function(){this.curveGrip=this.createGrip(),this.curveX=0,this.curveY=0,F.prototype.addControlGrips.call(this)},v.prototype.positionGrips=function(){F.prototype.positionGrips.call(this);var x=this.curveGrip.GRIP_SIZE;this.positionGrip(this.curveGrip.visual,this.curveX-x/2,this.curveY-x/2),this.curveControlLine1&&this.curveControlLine2&&(this.curveControlLine1.setAttribute("x1",this.x1.toString()),this.curveControlLine1.setAttribute("y1",this.y1.toString()),this.curveControlLine1.setAttribute("x2",this.curveX.toString()),this.curveControlLine1.setAttribute("y2",this.curveY.toString()),this.curveControlLine2.setAttribute("x1",this.x2.toString()),this.curveControlLine2.setAttribute("y1",this.y2.toString()),this.curveControlLine2.setAttribute("x2",this.curveX.toString()),this.curveControlLine2.setAttribute("y2",this.curveY.toString()))},v.prototype.manipulate=function(x){this.state==="move"&&(this.curveX=this.manipulationStartCurveX+x.x-this.manipulationStartX,this.curveY=this.manipulationStartCurveY+x.y-this.manipulationStartY),F.prototype.manipulate.call(this,x)},v.prototype.resize=function(x){this.activeGrip===this.curveGrip&&(this.curveX=x.x,this.curveY=x.y),F.prototype.resize.call(this,x),this.state==="creating"&&(this.curveX=this.x1+(this.x2-this.x1)/2,this.curveY=this.y1+(this.y2-this.y1)/2)},v.prototype.setStrokeColor=function(x){this.strokeColor=x,this.adjustVisual(),this.colorChanged(x)},v.prototype.setStrokeWidth=function(x){this.strokeWidth=x,this.adjustVisual()},v.prototype.setStrokeDasharray=function(x){this.strokeDasharray=x,this.adjustVisual()},v.prototype.scale=function(x,k){this.curveX=this.curveX*x,this.curveY=this.curveY*k,F.prototype.scale.call(this,x,k)},Object.defineProperty(v.prototype,"toolboxPanels",{get:function(){return[this.strokePanel,this.strokeWidthPanel,this.strokeStylePanel]},enumerable:!1,configurable:!0}),v.prototype.getState=function(){var x=Object.assign({strokeColor:this.strokeColor,strokeWidth:this.strokeWidth,strokeDasharray:this.strokeDasharray,curveX:this.curveX,curveY:this.curveY},F.prototype.getState.call(this));return x.typeName=v.typeName,x},v.prototype.restoreState=function(x){F.prototype.restoreState.call(this,x);var k=x;this.strokeColor=k.strokeColor,this.strokeWidth=k.strokeWidth,this.strokeDasharray=k.strokeDasharray,this.curveX=k.curveX,this.curveY=k.curveY,this.createVisual(),this.adjustVisual()},v.typeName="CurveMarker",v.title="Curve marker",v.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>',v}(Ue),qe=function(){function F(v,x){x===void 0&&(x=!1),this.cancelable=!1,this._defaultPrevented=!1,this.markerArea=v,this.cancelable=x}return Object.defineProperty(F.prototype,"defaultPrevented",{get:function(){return this._defaultPrevented},enumerable:!1,configurable:!0}),F.prototype.preventDefault=function(){this._defaultPrevented=!0},F}(),nt=function(F){function v(x,k,K){var M=F.call(this,x,!1)||this;return M.dataUrl=k,M.state=K,M}return J(v,F),v}(qe),$e=function(F){function v(x,k,K){K===void 0&&(K=!1);var M=F.call(this,x,K)||this;return M.marker=k,M}return J(v,F),v}(qe),gt=function(){function F(){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 F.prototype.addEventListener=function(v,x){this[v].push(x)},F.prototype.removeEventListener=function(v,x){var k=this[v].indexOf(x);k>-1&&this[v].splice(k,1)},F}(),ht=function(){function F(v){this.touchPoints=0,this._availableMarkerTypes=this.DEFAULT_MARKER_TYPES,this.mode="select",this.markers=[],this.isDragging=!1,this.renderEventListeners=[],this.closeEventListeners=[],this.settings=new Se,this._isOpen=!1,this.undoRedoManager=new Je,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 gt,this._silentRenderMode=!1,this._isFocused=!1,this._instanceNo=F.instanceCounter++,this.styles=new Ie(this.instanceNo),this.uiStyleSettings=this.styles.settings,this.target=v,this.targetRoot=document.body,this.width=v.clientWidth,this.height=v.clientHeight,this.styles.removeStyleSheet(),this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.toolbarButtonClicked=this.toolbarButtonClicked.bind(this),this.createNewMarker=this.createNewMarker.bind(this),this.addNewMarker=this.addNewMarker.bind(this),this.markerCreated=this.markerCreated.bind(this),this.setCurrentMarker=this.setCurrentMarker.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onDblClick=this.onDblClick.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.onPointerOut=this.onPointerOut.bind(this),this.onKeyUp=this.onKeyUp.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.deleteSelectedMarker=this.deleteSelectedMarker.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.removeMarker=this.removeMarker.bind(this),this.colorChanged=this.colorChanged.bind(this),this.fillColorChanged=this.fillColorChanged.bind(this),this.onPopupTargetResize=this.onPopupTargetResize.bind(this),this.showNotesEditor=this.showNotesEditor.bind(this),this.hideNotesEditor=this.hideNotesEditor.bind(this),this.stepZoom=this.stepZoom.bind(this),this.focus=this.focus.bind(this),this.blur=this.blur.bind(this),this.markerStateChanged=this.markerStateChanged.bind(this),this.switchToSelectMode=this.switchToSelectMode.bind(this),this.addDefs=this.addDefs.bind(this),this.addDefsToImage=this.addDefsToImage.bind(this)}return Object.defineProperty(F.prototype,"ALL_MARKER_TYPES",{get:function(){return[Oe,de,le,De,Ge,we,q,ve,Fe,z,Be,ze]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"DEFAULT_MARKER_TYPES",{get:function(){return[Oe,de,le,De,we,q,ve]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"BASIC_MARKER_TYPES",{get:function(){return[Oe,de,le,De,q]},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"availableMarkerTypes",{get:function(){return this._availableMarkerTypes},set:function(v){var x=this;this._availableMarkerTypes.splice(0),v.forEach(function(k){if(typeof k=="string"){var K=x.ALL_MARKER_TYPES.find(function(M){return M.typeName===k});K!==void 0&&x._availableMarkerTypes.push(K)}else x._availableMarkerTypes.push(k)})},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"currentMarker",{get:function(){return this._currentMarker},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isUndoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isUndoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isRedoPossible",{get:function(){return!(!this.undoRedoManager||!this.undoRedoManager.isRedoPossible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomLevel",{get:function(){return this._zoomLevel},set:function(v){this._zoomLevel=v,this.editorCanvas&&this.contentDiv&&(this.editorCanvas.style.transform="scale("+this._zoomLevel+")",this.contentDiv.scrollTo({left:(this.editorCanvas.clientWidth*this._zoomLevel-this.contentDiv.clientWidth)/2,top:(this.editorCanvas.clientHeight*this._zoomLevel-this.contentDiv.clientHeight)/2}))},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),F.prototype.open=function(){this.setupResizeObserver(),this.setEditingTarget(),this.setTopLeft(),this.initMarkerCanvas(),this.initOverlay(),this.attachEvents(),this.settings.displayMode==="popup"&&this.onPopupTargetResize(),ye.isLicensed||this.addLogo(),this._isOpen=!0,this._isFocused=!0},F.prototype.show=function(){var v=this;this.styles.styleSheetRoot===void 0&&Re.styleSheetRoot!==void 0&&(this.styles.styleSheetRoot=Re.styleSheetRoot),this.setWindowHeight(),this.showUI(),this.open(),this.eventListeners.show.forEach(function(x){return x(new qe(v))})},F.prototype.render=function(){return Z(this,void 0,void 0,function(){var v;return he(this,function(x){switch(x.label){case 0:return this.setCurrentMarker(),(v=new Le).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.markersOnly=this.renderMarkersOnly,v.width=this.renderWidth,v.height=this.renderHeight,[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 1:return x.sent(),[4,v.rasterize(this.target instanceof HTMLImageElement?this.target:null,this.markerImage,this.renderTarget)];case 2:return[2,x.sent()]}})})},F.prototype.close=function(v){var x=this;if(v===void 0&&(v=!1),this.isOpen){var k=!1;v||this.eventListeners.beforeclose.forEach(function(K){var M=new qe(x,!0);K(M),M.defaultPrevented&&(k=!0)}),k||(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 qe(x))}),this.detachEvents(),this._isOpen=!1)}},F.prototype.addMarkersToToolbar=function(){for(var v,x=[],k=0;k<arguments.length;k++)x[k]=arguments[k];(v=this._availableMarkerTypes).push.apply(v,x)},F.prototype.addRenderEventListener=function(v){this.addEventListener("render",function(x){v(x.dataUrl,x.state)})},F.prototype.removeRenderEventListener=function(v){},F.prototype.addCloseEventListener=function(v){this.addEventListener("close",function(){v()})},F.prototype.removeCloseEventListener=function(v){},F.prototype.setupResizeObserver=function(){var v=this;this.settings.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.settings.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){return v.onPopupTargetResize()}),this.targetObserver.observe(this.editorCanvas)),window.addEventListener("resize",this.setWindowHeight))},F.prototype.onPopupTargetResize=function(){var v=1*this.target.clientWidth/this.target.clientHeight,x=this.editorCanvas.clientWidth/v>this.editorCanvas.clientHeight?this.editorCanvas.clientHeight*v:this.editorCanvas.clientWidth,k=x<this.editorCanvas.clientWidth?this.editorCanvas.clientHeight:this.editorCanvas.clientWidth/v;this.resize(x,k)},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.prototype.resize=function(v,x){this._isResizing=!0;var k=v/this.imageWidth,K=x/this.imageHeight;this.imageWidth=Math.round(v),this.imageHeight=Math.round(x),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(k,K),this._isResizing=!1},F.prototype.scaleMarkers=function(v,x){var k,K=this;this._currentMarker&&this._currentMarker instanceof De?this._currentMarker.scale(v,x):(k=this._currentMarker,this.setCurrentMarker()),this.markers.forEach(function(M){M!==K._currentMarker&&M.scale(v,x)}),k!==void 0&&this.setCurrentMarker(k)},F.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"},F.prototype.setTopLeft=function(){var v=this.editingTarget.getBoundingClientRect(),x=this.editorCanvas.getBoundingClientRect();this.left=v.left-x.left,this.top=v.top-x.top},F.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)},F.prototype.addDefs=function(){for(var v,x=[],k=0;k<arguments.length;k++)x[k]=arguments[k];this.defs=$.createDefs(),this.addDefsToImage(),(v=this.defs).append.apply(v,x)},F.prototype.addDefsToImage=function(){this.defs&&this.markerImage.insertBefore(this.defs,this.markerImage.firstChild)},F.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)},F.prototype.positionMarkerImage=function(){this.markerImageHolder.style.top=this.top/this.zoomLevel+"px",this.markerImageHolder.style.left=this.left/this.zoomLevel+"px"},F.prototype.attachEvents=function(){this.markerImage.addEventListener("pointerdown",this.onPointerDown),this.markerImage.addEventListener("dblclick",this.onDblClick),this.attachWindowEvents()},F.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)},F.prototype.detachEvents=function(){this.markerImage.removeEventListener("pointerdown",this.onPointerDown),this.markerImage.removeEventListener("dblclick",this.onDblClick),this.detachWindowEvents()},F.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)},F.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 v=document.createElement("a");v.href="https://markerjs.com/",v.target="_blank",v.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>',v.title="Powered by marker.js",v.style.display="grid",v.style.alignItems="center",v.style.justifyItems="center",v.style.padding="3px",v.style.width="20px",v.style.height="20px",this.logoUI.appendChild(v),this.editorCanvas.appendChild(this.logoUI),this.logoUI.style.position="absolute",this.logoUI.style.pointerEvents="all",this.positionLogo()},F.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")},F.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"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.prototype.showUI=function(){switch(this.settings.displayMode==="popup"&&this.overrideOverflow(),this.coverDiv=document.createElement("div"),this.coverDiv.style.visibility=this._silentRenderMode?"hidden":"visible",this.coverDiv.className=this.styles.classNamePrefixBase+" "+this.styles.classNamePrefix,this.coverDiv.style.fontSize="16px",this.coverDiv.style.userSelect="none",this.settings.displayMode){case"inline":this.coverDiv.style.position="absolute";var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px",this.coverDiv.style.width=this.target.offsetWidth.toString()+"px",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"5";break;case"popup":this.coverDiv.style.position="absolute",this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=window.innerHeight+"px",this.coverDiv.style.backgroundColor="rgba(0, 0, 0, 0.75)",this.coverDiv.style.zIndex=this.uiStyleSettings.zIndex!==void 0?this.uiStyleSettings.zIndex:"1000",this.coverDiv.style.display="flex"}this.targetRoot.appendChild(this.coverDiv),this.uiDiv=document.createElement("div"),this.uiDiv.style.display="flex",this.uiDiv.style.flexDirection="column",this.uiDiv.style.flexGrow="2",this.uiDiv.style.margin=this.settings.displayMode==="popup"?this.settings.popupMargin+"px":"0px",this.uiDiv.style.border="0px",this.coverDiv.appendChild(this.uiDiv),this.toolbar=new Ee(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 Ae(this.uiDiv,this.settings.displayMode,this.uiStyleSettings,this.styles),this.toolbox.show(this._silentRenderMode||this.uiStyleSettings.hideToolbox?"hidden":"visible")},F.prototype.closeUI=function(){this.settings.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.removeMarker=function(v){this.markerImage.removeChild(v.container),this.markers.indexOf(v)>-1&&this.markers.splice(this.markers.indexOf(v),1),v.dispose()},F.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())},F.prototype.toolbarButtonClicked=function(v,x){if(v==="marker"&&x!==void 0)this.createNewMarker(x);else if(v==="action")switch(x){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()}},F.prototype.deleteSelectedMarker=function(){var v=this;if(this._currentMarker!==void 0){var x=!1;if(this.eventListeners.markerbeforedelete.forEach(function(K){var M=new $e(v,v._currentMarker,!0);K(M),M.defaultPrevented&&(x=!0)}),!x){var k=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 $e(v,k))})}}},F.prototype.clear=function(){var v=this,x=!1;if(this.markers.length>0&&(this.eventListeners.markerbeforedelete.forEach(function(ne){var Me=new $e(v,void 0,!0);ne(Me),Me.defaultPrevented&&(x=!0)}),!x)){this.setCurrentMarker();for(var k=function(ne){var Me=K.markers[ne];K.setCurrentMarker(K.markers[ne]),K._currentMarker.dispose(),K.markerImage.removeChild(K._currentMarker.container),K.markers.splice(K.markers.indexOf(K._currentMarker),1),K.eventListeners.markerdelete.forEach(function(je){return je(new $e(v,Me))})},K=this,M=this.markers.length-1;M>=0;M--)k(M);this.addUndoStep()}},Object.defineProperty(F.prototype,"isNotesAreaOpen",{get:function(){return this.notesArea!==void 0},enumerable:!1,configurable:!0}),F.prototype.showNotesEditor=function(){var v;this._currentMarker!==void 0&&(this.overlayContainer.innerHTML="",this.notesArea=document.createElement("textarea"),this.notesArea.className=this.uiStyleSettings.notesAreaStyleClassName,this.notesArea.style.pointerEvents="auto",this.notesArea.style.alignSelf="stretch",this.notesArea.style.width="100%",this.notesArea.style.margin=this.uiStyleSettings.toolbarHeight/4+"px",this.notesArea.value=(v=this._currentMarker.notes)!==null&&v!==void 0?v:"",this.overlayContainer.appendChild(this.notesArea))},F.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)},F.prototype.selectLastMarker=function(){this.markers.length>0?this.setCurrentMarker(this.markers[this.markers.length-1]):this.setCurrentMarker()},F.prototype.addUndoStep=function(){var v=this;if(this._currentMarker===void 0||this._currentMarker.state!=="edit"){var x=this.getState(),k=this.undoRedoManager.getLastUndoStep();if(!k||k.width===x.width&&k.height===x.height){var K=this.undoRedoManager.undoStepCount;this.undoRedoManager.addUndoStep(x),K<this.undoRedoManager.undoStepCount&&this.eventListeners.statechange.forEach(function(M){return M(new qe(v))})}else this.undoRedoManager.replaceLastUndoStep(x),this.eventListeners.statechange.forEach(function(M){return M(new qe(v))})}},F.prototype.undo=function(){this.switchToSelectMode(),this.addUndoStep(),this.undoStep()},F.prototype.undoStep=function(){var v=this,x=this.undoRedoManager.undo();x!==void 0&&(this.restoreState(x),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new qe(v))}))},F.prototype.redo=function(){this.switchToSelectMode(),this.redoStep()},F.prototype.redoStep=function(){var v=this,x=this.undoRedoManager.redo();x!==void 0&&(this.restoreState(x),this.addDefsToImage(),this.selectLastMarker(),this.eventListeners.statechange.forEach(function(k){return k(new qe(v))}))},F.prototype.stepZoom=function(){var v=this.zoomSteps.indexOf(this.zoomLevel);this.zoomLevel=v<this.zoomSteps.length-1?this.zoomSteps[v+1]:this.zoomSteps[0]},F.prototype.panTo=function(v){this.contentDiv.scrollBy({left:this.prevPanPoint.x-v.x,top:this.prevPanPoint.y-v.y}),this.prevPanPoint=v},F.prototype.startRenderAndClose=function(){return Z(this,void 0,void 0,function(){var v,x,k=this;return he(this,function(K){switch(K.label){case 0:return[4,this.render()];case 1:return v=K.sent(),x=this.getState(),this.eventListeners.render.forEach(function(M){return M(new nt(k,v,x))}),this.close(!0),[2]}})})},F.prototype.getState=function(v){v===!0&&this.setCurrentMarker();var x={width:this.imageWidth,height:this.imageHeight,markers:[]};return this.markers.forEach(function(k){return x.markers.push(k.getState())}),x},F.prototype.restoreState=function(v){var x=this;for(this.markers.splice(0);this.markerImage.lastChild;)this.markerImage.removeChild(this.markerImage.lastChild);v.markers.forEach(function(k){var K=x._availableMarkerTypes.find(function(ne){return ne.typeName===k.typeName});if(K!==void 0){var M=x.addNewMarker(K);M.restoreState(k),x.markers.push(M)}}),v.width&&v.height&&(v.width!==this.imageWidth||v.height!==this.imageHeight)&&this.scaleMarkers(this.imageWidth/v.width,this.imageHeight/v.height),this.eventListeners.restorestate.forEach(function(k){return k(new qe(x))})},F.prototype.addNewMarker=function(v){var x=$.createGroup();return this.markerImage.appendChild(x),new v(x,this.overlayContainer,this.settings)},F.prototype.createNewMarker=function(v){var x,k=this;(x=typeof v=="string"?this._availableMarkerTypes.find(function(K){return K.typeName===v}):v)&&(this.setCurrentMarker(),this.addUndoStep(),this._currentMarker=this.addNewMarker(x),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(x.typeName),this.toolbox.setPanelButtons(this._currentMarker.toolboxPanels),this.eventListeners.markercreating.forEach(function(K){return K(new $e(k,k._currentMarker))}))},F.prototype.markerCreated=function(v){var x=this;this.mode="select",this.markerImage.style.cursor="default",this.markers.push(v),this.setCurrentMarker(v),v instanceof de&&this.settings.newFreehandMarkerOnPointerUp?this.createNewMarker(de):this.toolbar.setSelectMode(),this.addUndoStep(),this.eventListeners.markercreate.forEach(function(k){return k(new $e(x,x._currentMarker))})},F.prototype.colorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultColor=v,this.settings.defaultStrokeColor=v)},F.prototype.fillColorChanged=function(v){this.settings.defaultColorsFollowCurrentColors&&(this.settings.defaultFillColor=v)},F.prototype.markerStateChanged=function(v){var x=this;this.eventListeners.markerchange.forEach(function(k){return k(new $e(x,v))})},F.prototype.setCurrentMarker=function(v){var x=this;this._currentMarker!==v&&this._currentMarker!==void 0&&(this._currentMarker.deselect(),this.toolbar.setCurrentMarker(),this.toolbox.setPanelButtons([]),this._isResizing||this.eventListeners.markerdeselect.forEach(function(k){return k(new $e(x,x._currentMarker))})),this._currentMarker=v,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(k){return k(new $e(x,x._currentMarker))}))},F.prototype.onPointerDown=function(v){if(this._isFocused||this.focus(),this.touchPoints++,this.touchPoints===1||v.pointerType!=="touch")if(this._currentMarker===void 0||this._currentMarker.state!=="new"&&this._currentMarker.state!=="creating"){if(this.mode==="select"){var x=this.markers.find(function(k){return k.ownsTarget(v.target)});x!==void 0?(this.setCurrentMarker(x),this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target)):(this.setCurrentMarker(),this.isDragging=!0,this.prevPanPoint={x:v.clientX,y:v.clientY})}}else this.isDragging=!0,this._currentMarker.pointerDown(this.clientToLocalCoordinates(v.clientX,v.clientY))},F.prototype.onDblClick=function(v){if(this._isFocused||this.focus(),this.mode==="select"){var x=this.markers.find(function(k){return k.ownsTarget(v.target)});x!==void 0&&x!==this._currentMarker&&this.setCurrentMarker(x),this._currentMarker!==void 0?this._currentMarker.dblClick(this.clientToLocalCoordinates(v.clientX,v.clientY),v.target):this.setCurrentMarker()}},F.prototype.onPointerMove=function(v){this.touchPoints!==1&&v.pointerType==="touch"||(this._currentMarker!==void 0||this.isDragging)&&(this._currentMarker!==void 0&&this._currentMarker.state==="edit"||v.preventDefault(),this._currentMarker!==void 0?this._currentMarker.manipulate(this.clientToLocalCoordinates(v.clientX,v.clientY)):this.zoomLevel>1&&this.panTo({x:v.clientX,y:v.clientY}))},F.prototype.onPointerUp=function(v){this.touchPoints>0&&this.touchPoints--,this.touchPoints===0&&this.isDragging&&this._currentMarker!==void 0&&this._currentMarker.pointerUp(this.clientToLocalCoordinates(v.clientX,v.clientY)),this.isDragging=!1,this.addUndoStep()},F.prototype.onPointerOut=function(){this.touchPoints>0&&this.touchPoints--},F.prototype.onKeyUp=function(v){this._currentMarker===void 0||this.notesArea!==void 0||v.key!=="Delete"&&v.key!=="Backspace"||this.deleteSelectedMarker()},F.prototype.clientToLocalCoordinates=function(v,x){var k=this.markerImage.getBoundingClientRect();return{x:(v-k.left)/this.zoomLevel,y:(x-k.top)/this.zoomLevel}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.settings.displayMode){case"inline":var v=this.target.getClientRects().item(0).y>this.styles.settings.toolbarHeight?this.target.offsetTop-this.styles.settings.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight=this.windowHeight-2*this.settings.popupMargin-3.5*this.styles.settings.toolbarHeight+"px"}this.positionMarkerImage(),this.positionLogo()},F.prototype.addLicenseKey=function(v){ye.addKey(v)},F.prototype.addEventListener=function(v,x){this.eventListeners.addEventListener(v,x)},F.prototype.removeEventListener=function(v,x){this.eventListeners.removeEventListener(v,x)},F.prototype.renderState=function(v){this._silentRenderMode=!0,this.settings.displayMode="inline",this.isOpen||this.show(),this.restoreState(v),this.startRenderAndClose(),this._silentRenderMode=!1},Object.defineProperty(F.prototype,"isFocused",{get:function(){return this._isFocused},enumerable:!1,configurable:!0}),F.prototype.focus=function(){var v=this;this._isFocused||(this.attachWindowEvents(),this._isFocused=!0,this._previousCurrentMarker!==void 0&&this.setCurrentMarker(this._previousCurrentMarker),this.eventListeners.focus.forEach(function(x){return x(new qe(v))}))},F.prototype.blur=function(){var v=this;this._isFocused&&(this.detachWindowEvents(),this._isFocused=!1,this._previousCurrentMarker=this._currentMarker,this.setCurrentMarker(),this.eventListeners.blur.forEach(function(x){return x(new qe(v))}))},F.instanceCounter=0,F}();/* **********************************
|
|
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 bt=function(F,v){return(bt=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(x,k){x.__proto__=k}||function(x,k){for(var K in k)Object.prototype.hasOwnProperty.call(k,K)&&(x[K]=k[K])})(F,v)};function pt(F,v){if(typeof v!="function"&&v!==null)throw new TypeError("Class extends value "+String(v)+" is not a constructor or null");function x(){this.constructor=F}bt(F,v),F.prototype=v===null?Object.create(v):(x.prototype=v.prototype,new x)}function it(F,v,x,k){return new(x||(x=Promise))(function(K,M){function ne(He){try{je(k.next(He))}catch(Pe){M(Pe)}}function Me(He){try{je(k.throw(He))}catch(Pe){M(Pe)}}function je(He){var Pe;He.done?K(He.value):(Pe=He.value,Pe instanceof x?Pe:new x(function(Xe){Xe(Pe)})).then(ne,Me)}je((k=k.apply(F,v||[])).next())})}function _t(F,v){var x,k,K,M,ne={label:0,sent:function(){if(1&K[0])throw K[1];return K[1]},trys:[],ops:[]};return M={next:Me(0),throw:Me(1),return:Me(2)},typeof Symbol=="function"&&(M[Symbol.iterator]=function(){return this}),M;function Me(je){return function(He){return function(Pe){if(x)throw new TypeError("Generator is already executing.");for(;ne;)try{if(x=1,k&&(K=2&Pe[0]?k.return:Pe[0]?k.throw||((K=k.return)&&K.call(k),0):k.next)&&!(K=K.call(k,Pe[1])).done)return K;switch(k=0,K&&(Pe=[2&Pe[0],K.value]),Pe[0]){case 0:case 1:K=Pe;break;case 4:return ne.label++,{value:Pe[1],done:!1};case 5:ne.label++,k=Pe[1],Pe=[0];continue;case 7:Pe=ne.ops.pop(),ne.trys.pop();continue;default:if(!(K=ne.trys,(K=K.length>0&&K[K.length-1])||Pe[0]!==6&&Pe[0]!==2)){ne=0;continue}if(Pe[0]===3&&(!K||Pe[1]>K[0]&&Pe[1]<K[3])){ne.label=Pe[1];break}if(Pe[0]===6&&ne.label<K[1]){ne.label=K[1],K=Pe;break}if(K&&ne.label<K[2]){ne.label=K[2],ne.ops.push(Pe);break}K[2]&&ne.ops.pop(),ne.trys.pop();continue}Pe=v.call(F,ne)}catch(Xe){Pe=[6,Xe],k=0}finally{x=K=0}if(5&Pe[0])throw Pe[1];return{value:Pe[0]?Pe[1]:void 0,done:!0}}([je,He])}}}var Tt=function(){function F(){}return F.addKey=function(v){F.key=v},Object.defineProperty(F,"isLicensed",{get:function(){return!!F.key&&new RegExp(/^CRPR-[A-Z][0-9]{3}-[A-Z][0-9]{3}-[0-9]{4}$/,"i").test(F.key)},enumerable:!1,configurable:!0}),F}(),Ve=function(){function F(){}return F.createDefs=function(){return document.createElementNS("http://www.w3.org/2000/svg","defs")},F.setAttributes=function(v,x){for(var k=0,K=x;k<K.length;k++){var M=K[k],ne=M[0],Me=M[1];v.setAttribute(ne,Me)}},F.createRect=function(v,x,k){var K=document.createElementNS("http://www.w3.org/2000/svg","rect");return K.setAttribute("width",v.toString()),K.setAttribute("height",x.toString()),k&&F.setAttributes(K,k),K},F.createLine=function(v,x,k,K,M){var ne=document.createElementNS("http://www.w3.org/2000/svg","line");return ne.setAttribute("x1",v.toString()),ne.setAttribute("y1",x.toString()),ne.setAttribute("x2",k.toString()),ne.setAttribute("y2",K.toString()),M&&F.setAttributes(ne,M),ne},F.createPolygon=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","polygon");return k.setAttribute("points",v),x&&F.setAttributes(k,x),k},F.createCircle=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","circle");return k.setAttribute("cx",(v/2).toString()),k.setAttribute("cy",(v/2).toString()),k.setAttribute("r",v.toString()),x&&F.setAttributes(k,x),k},F.createEllipse=function(v,x,k){var K=document.createElementNS("http://www.w3.org/2000/svg","ellipse");return K.setAttribute("cx",(v/2).toString()),K.setAttribute("cy",(x/2).toString()),K.setAttribute("rx",(v/2).toString()),K.setAttribute("ry",(x/2).toString()),k&&F.setAttributes(K,k),K},F.createGroup=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","g");return v&&F.setAttributes(x,v),x},F.createTransform=function(){return document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGTransform()},F.createMarker=function(v,x,k,K,M,ne,Me){var je=document.createElementNS("http://www.w3.org/2000/svg","marker");return F.setAttributes(je,[["id",v],["orient",x],["markerWidth",k.toString()],["markerHeight",K.toString()],["refX",M.toString()],["refY",ne.toString()]]),je.appendChild(Me),je},F.createText=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","text");return x.setAttribute("x","0"),x.setAttribute("y","0"),v&&F.setAttributes(x,v),x},F.createTSpan=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","tspan");return k.textContent=v,x&&F.setAttributes(k,x),k},F.createImage=function(v){var x=document.createElementNS("http://www.w3.org/2000/svg","image");return v&&F.setAttributes(x,v),x},F.createPoint=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","svg").createSVGPoint();return k.x=v,k.y=x,k},F.createPath=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg","path");return k.setAttribute("d",v),x&&F.setAttributes(k,x),k},F.createElement=function(v,x){var k=document.createElementNS("http://www.w3.org/2000/svg",v);return x&&F.setAttributes(k,x),k},F.getHollowRectanglePath=function(v,x,k,K,M,ne,Me,je){return"M"+v+","+x+"V"+(x+K)+"H"+(v+k)+"V"+x+"H"+M+"V"+ne+"H"+(M+Me)+"V"+(ne+je)+"H"+M+"V"+x+"Z"},F}(),At=function(){function F(v){this._classNamePrefixBase="__cropro_",this.classes=[],this.rules=[],this.settings=this.defaultSettings,this._classNamePrefix=this._classNamePrefixBase+"_"+v+"_"}return Object.defineProperty(F.prototype,"classNamePrefixBase",{get:function(){return this._classNamePrefixBase},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"classNamePrefix",{get:function(){return this._classNamePrefix},enumerable:!1,configurable:!0}),Object.defineProperty(F.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(F.prototype,"fadeInAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_in"},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"fadeOutAnimationClassName",{get:function(){return this.classNamePrefix+"_fade_out"},enumerable:!1,configurable:!0}),F.prototype.addClass=function(v){return this.styleSheet===void 0&&this.addStyleSheet(),v.name=""+this.classNamePrefix+v.localName,this.classes.push(v),this.styleSheet.sheet.insertRule("."+v.name+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length),v},F.prototype.addRule=function(v){this.styleSheet===void 0&&this.addStyleSheet(),this.rules.push(v),this.styleSheet.sheet.insertRule(v.selector+" {"+v.style+"}",this.styleSheet.sheet.cssRules.length)},F.prototype.addStyleSheet=function(){var v;this.styleSheet=document.createElement("style"),((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).appendChild(this.styleSheet),this.addRule(new We("."+this.classNamePrefix+" h3","font-family: sans-serif")),this.addRule(new We("@keyframes "+this.classNamePrefix+"_fade_in_animation_frames",`
|
|
from {
|
|
opacity: 0;
|
|
}
|
|
to {
|
|
opacity: 1;
|
|
}
|
|
`)),this.addRule(new We("@keyframes "+this.classNamePrefix+"_fade_out_animation_frames",`
|
|
from {
|
|
opacity: 1;
|
|
}
|
|
to {
|
|
opacity: 0;
|
|
}
|
|
`)),this.addClass(new Ye("_fade_in",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_in_animation_frames;
|
|
`)),this.addClass(new Ye("_fade_out",`
|
|
animation-duration: 0.3s;
|
|
animation-name: `+this.classNamePrefix+`_fade_out_animation_frames;
|
|
`))},F.prototype.removeStyleSheet=function(){var v;this.styleSheet&&(((v=this.styleSheetRoot)!==null&&v!==void 0?v:document.head).removeChild(this.styleSheet),this.styleSheet=void 0)},F}(),We=function(F,v){this.selector=F,this.style=v},Ye=function(F,v){this.localName=F,this.style=v},rt=function(){function F(){this.blocks=[],this.display=""}return F.prototype.addButtonBlock=function(v){v.className=this.blockClassName,v.buttonClassName=this.buttonClassName,v.buttonColorsClassName=this.buttonColorsClassName,v.buttonActiveColorsClassName=this.buttonActiveColorsClassName,this.blocks.push(v)},F.prototype.addElementBlock=function(v){v.className===void 0&&(v.className=this.blockClassName),this.blocks.push(v)},F.prototype.getUI=function(){var v=document.createElement("div");return v.className=this.className+" "+this.colorsClassName+" "+this.fadeInClassName,v.style.display=this.display,this.blocks.forEach(function(x){return v.appendChild(x.getUI())}),v},F}(),dt=function(){function F(){}return F.prototype.getUI=function(){var v=document.createElement("div");if(v.className=this.className,this.minWidth!==void 0&&(v.style.minWidth=this.minWidth),this.contentAlign!==void 0)switch(this.contentAlign){case"start":v.style.justifyContent="flex-start";break;case"center":v.style.justifyContent="center";break;case"end":v.style.justifyContent="flex-end"}return v.style.whiteSpace="nowrap",v},F}(),vt=function(F){function v(){var x=F!==null&&F.apply(this,arguments)||this;return x.buttons=[],x}return pt(v,F),v.prototype.addButton=function(x){x.className=this.buttonClassName,x.colorsClassName=this.buttonColorsClassName,x.activeColorsClassName=this.buttonActiveColorsClassName,this.buttons.push(x)},v.prototype.getUI=function(){var x=F.prototype.getUI.call(this);return this.buttons.forEach(function(k){return x.appendChild(k.getUI())}),x},v}(dt),ut=function(){function F(v,x){this._isActive=!1,this._isHidden=!1,this._icon=v,this.title=x,this.uiContainer=document.createElement("div"),this.adjustClassName=this.adjustClassName.bind(this)}return Object.defineProperty(F.prototype,"icon",{get:function(){return this._icon},set:function(v){this._icon=v,this.buttonContainer.innerHTML=this._icon},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isActive",{get:function(){return this._isActive},set:function(v){this._isActive=v,this.adjustClassName()},enumerable:!1,configurable:!0}),F.prototype.getUI=function(){var v=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 v.onClick()}),this.uiContainer.appendChild(this.buttonContainer),this.uiContainer.style.display=this._isHidden?"none":"inline-block",this.uiContainer},F.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,"")))},F.prototype.hide=function(){this._isHidden=!0},F}(),tt=function(F){function v(){var x=F!==null&&F.apply(this,arguments)||this;return x.elements=[],x}return pt(v,F),v.prototype.addElement=function(x){this.elements.push(x)},v.prototype.getUI=function(){var x=F.prototype.getUI.call(this);return this.elements.forEach(function(k){return x.appendChild(k)}),x},v}(dt),Ze=function(){function F(v,x){this.horizontal=v,this.vertical=x}return Object.defineProperty(F.prototype,"ratio",{get:function(){return 1*this.horizontal/this.vertical},enumerable:!1,configurable:!0}),F.prototype.getVerticalLength=function(v){return v/this.ratio},F.prototype.getHorizontalLength=function(v){return v*this.ratio},F}(),et=function(){function F(){}return F.getIcon=function(v,x){if(v>0&&x>0){var k=new Ze(v,x),K=k.ratio>=1?20:k.getHorizontalLength(20),M=k.ratio<1?20:k.getVerticalLength(20),ne=document.createElementNS("http://www.w3.org/2000/svg","svg");ne.setAttribute("xmlns","http://www.w3.org/2000/svg"),ne.setAttribute("viewBox","0 0 24 24"),document.body.appendChild(ne);var Me=Ve.createDefs();ne.appendChild(Me);var je=Ve.createElement("clipPath",[["id","text-bg-clip"]]);Me.appendChild(je);var He=Ve.createPath(Ve.getHollowRectanglePath((24-K)/2,(24-M)/2,K,M,(24-K)/2+2,(24-M)/2+2,K-4,M-4));ne.appendChild(He);var Pe=Ve.createText([["x","0"],["y","0"],["font-size","7px"],["font-family","monospace"]]);Pe.appendChild(Ve.createTSpan(v+":"+x)),ne.appendChild(Pe);var Xe=Pe.getBBox();Ve.setAttributes(Pe,[["x",((24-Xe.width)/2).toString()],["y",((24-Xe.height)/2-Xe.y).toString()]]);var Ke=Ve.createPath(Ve.getHollowRectanglePath(0,0,24,24,(24-Math.ceil(Xe.width))/2,(24-Math.ceil(Xe.height))/2,Math.ceil(Xe.width),Math.ceil(Xe.height)));return je.appendChild(Ke),Ve.setAttributes(He,[["clip-path","url(#text-bg-clip)"]]),document.body.removeChild(ne),ne.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>'},F}(),st=function(F){function v(x,k,K){var M=F.call(this,x,k)||this;return M.isDropdownOpen=!1,M.onClick=M.dropdownButtonClicked,M.dropdownButtons=K,M}return pt(v,F),v.prototype.setupDropdown=function(){var x=this;this.dropdownBlock=document.createElement("div"),this.dropdownBlock.className=this.dropdownClassName+" "+this.dropdownColorsClassName,this.dropdownBlock.style.display="none",this.dropdownButtons.forEach(function(k){k.className=x.className,k.colorsClassName=x.colorsClassName,x.dropdownBlock.appendChild(k.getUI())}),this.uiContainer.appendChild(this.dropdownBlock)},v.prototype.positionDropdown=function(){this.dropdownBlock.style.left=this.uiContainer.clientLeft+"px",this.dropdownBlock.style.top=this.uiContainer.clientTop+this.uiContainer.clientHeight+"px"},v.prototype.dropdownButtonClicked=function(){this.dropdownBlock===void 0&&this.setupDropdown(),this.isDropdownOpen=!this.isDropdownOpen,this.toggleDropdown()},v.prototype.toggleDropdown=function(){this.positionDropdown(),this.dropdownBlock.style.display=this.isDropdownOpen?"inline-block":"none"},v.prototype.showDropdown=function(){this.isDropdownOpen=!0,this.toggleDropdown()},v.prototype.hideDropdown=function(){this.isDropdownOpen=!1,this.toggleDropdown()},v}(ut),ot=function(){function F(v,x){this.GRIP_SIZE=10,this.color=v,this.fillColor=x,this.visual=Ve.createGroup(),this.visual.appendChild(Ve.createCircle(1.5*this.GRIP_SIZE,[["fill","transparent"]])),this.visual.appendChild(Ve.createCircle(this.GRIP_SIZE,[["fill",this.fillColor],["fill-opacity","0.9"],["stroke",this.color],["stroke-width","2"],["stroke-opacity","0.7"]]))}return F.prototype.ownsTarget=function(v){return v===this.visual||v===this.visual.childNodes[0]||v===this.visual.childNodes[1]},F.prototype.setCenter=function(v,x){this.visual.childNodes.forEach(function(k){return Ve.setAttributes(k,[["cx",v.toString()],["cy",x.toString()]])})},F}(),lt=function(){function F(v,x,k,K){this.isMoving=!1,this._isGridVisible=!0,this.numberOfGridLines=2,this.horizontalGridLines=[],this.verticalGridLines=[],this._zoomFactor=1,this.cropRectChanged=!1,this.canvasWidth=v,this.canvasHeight=x,this.margin=k,this.container=K,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(F.prototype,"aspectRatio",{get:function(){return this._aspectRatio},set:function(v){this._aspectRatio=v,this.adjustCropRect(),this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.gridContainer&&Ve.setAttributes(this.gridContainer,[["display",this._isGridVisible?"":"none"]])},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomFactor",{get:function(){return this._zoomFactor},set:function(v){this._zoomFactor=v,this.setCropRectangle(this.cropRect)},enumerable:!1,configurable:!0}),F.prototype.open=function(){var v=this;this.cropShadeElement=Ve.createPath("M0,0Z",[["fill",this.cropShadeColor],["fill-opacity","0.8"]]),this.container.appendChild(this.cropShadeElement),this.gridContainer=Ve.createGroup([["display",this.isGridVisible?"":"none"]]),this.container.appendChild(this.gridContainer);for(var x=0;x<this.numberOfGridLines;x++)this.horizontalGridLines.push(Ve.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]])),this.verticalGridLines.push(Ve.createLine(0,0,0,0,[["stroke",this.cropFrameColor],["stroke-width","1"],["stroke-dasharray","3 1"],["opacity","0.7"]]));this.horizontalGridLines.forEach(function(k){return v.gridContainer.appendChild(k)}),this.verticalGridLines.forEach(function(k){return v.gridContainer.appendChild(k)}),this.cropRectElement=Ve.createRect(0,0,[["stroke",this.cropFrameColor],["stroke-width","3"],["fill","transparent"]]),this.container.appendChild(this.cropRectElement),this.topLeftGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topLeftGrip.visual),this.topRightGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.topRightGrip.visual),this.bottomLeftGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomLeftGrip.visual),this.bottomRightGrip=new ot(this.gripColor,this.gripFillColor),this.container.appendChild(this.bottomRightGrip.visual),this.attachEvents()},F.prototype.setCropRectangle=function(v){this.cropRect=v;var x=Object.assign({},this.cropRect);this.zoomFactor!==1&&(x.width=this.cropRect.width*this.zoomFactor,x.height=this.cropRect.height*this.zoomFactor,x.x=this.cropRect.height/this.cropRect.width<this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasWidth/2-x.width/2,x.y=this.cropRect.height/this.cropRect.width>this.canvasHeight/this.canvasWidth?this.margin:this.margin+this.canvasHeight/2-x.height/2),Ve.setAttributes(this.cropRectElement,[["x",x.x.toString()],["y",x.y.toString()],["width",x.width.toString()],["height",x.height.toString()]]);var k=x.height/(this.numberOfGridLines+1);this.horizontalGridLines.forEach(function(M,ne){var Me=x.y+k*(ne+1);Ve.setAttributes(M,[["x1",""+x.x],["y1",""+Me],["x2",""+(x.x+x.width)],["y2",""+Me]])});var K=x.width/(this.numberOfGridLines+1);this.verticalGridLines.forEach(function(M,ne){var Me=x.x+K*(ne+1);Ve.setAttributes(M,[["x1",""+Me],["y1",""+x.y],["x2",""+Me],["y2",""+(x.y+x.height)]])}),Ve.setAttributes(this.cropShadeElement,[["d",Ve.getHollowRectanglePath(0,0,this.canvasWidth+2*this.margin,this.canvasHeight+2*this.margin,x.x,x.y,x.width,x.height)]]),this.topLeftGrip.setCenter(x.x,x.y),this.topRightGrip.setCenter(x.x+x.width,x.y),this.bottomLeftGrip.setCenter(x.x,x.y+x.height),this.bottomRightGrip.setCenter(x.x+x.width,x.y+x.height),this.cropRectChanged&&this.onCropChange&&(this.cropRectChanged=!1,this.onCropChange(this.cropRect)),this.cropRectChanged=!1},F.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)},F.prototype.clientToLocalCoordinates=function(v,x){var k=this.container.getBoundingClientRect();return{x:v-k.left+this.margin,y:x-k.top+this.margin}},F.prototype.onPointerDown=function(v){this.container.setPointerCapture(v.pointerId),this.previousPoint=this.clientToLocalCoordinates(v.clientX,v.clientY),this.cropRectElement===v.target?this.isMoving=!0:this.topLeftGrip.ownsTarget(v.target)?this.activeGrip=this.topLeftGrip:this.bottomLeftGrip.ownsTarget(v.target)?this.activeGrip=this.bottomLeftGrip:this.topRightGrip.ownsTarget(v.target)?this.activeGrip=this.topRightGrip:this.bottomRightGrip.ownsTarget(v.target)&&(this.activeGrip=this.bottomRightGrip)},F.prototype.onPointerMove=function(v){if(this.isMoving)this.move(this.clientToLocalCoordinates(v.clientX,v.clientY));else if(this.activeGrip){var x=this.clientToLocalCoordinates(v.clientX,v.clientY);this.resize(x)}v.preventDefault()},F.prototype.onPointerUp=function(v){this.activeGrip=void 0,this.isMoving=!1,this.container.releasePointerCapture(v.pointerId)},F.prototype.move=function(v){var x=v.x-this.previousPoint.x,k=v.y-this.previousPoint.y;this.zoomFactor!==1&&(x=-x/this.zoomFactor,k=-k/this.zoomFactor),this.cropRect.x=Math.min(Math.max(this.margin,this.cropRect.x+x),this.canvasWidth-this.cropRect.width+this.margin),this.cropRect.y=Math.min(Math.max(this.margin,this.cropRect.y+k),this.canvasHeight-this.cropRect.height+this.margin),this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect),this.previousPoint=v},F.prototype.resize=function(v){var x=Object.assign({},this.cropRect),k=v.x-this.previousPoint.x,K=v.y-this.previousPoint.y;switch(this.activeGrip){case this.bottomLeftGrip:case this.topLeftGrip:x.x+k<this.margin&&(k=this.margin-x.x),x.x+=k,x.width=this.cropRect.x+this.cropRect.width-x.x;break;case this.bottomRightGrip:case this.topRightGrip:x.width+k>this.canvasWidth*this.zoomFactor&&(k=this.canvasWidth*this.zoomFactor-x.width),x.width+=k}switch(this.activeGrip){case this.topLeftGrip:case this.topRightGrip:this.aspectRatio?(x.y=this.cropRect.y-(this.activeGrip===this.topLeftGrip?-1:1)*this.aspectRatio.getVerticalLength(k),x.height=this.aspectRatio.getVerticalLength(x.width)):(x.y+=K,x.height=this.cropRect.y+this.cropRect.height-x.y);break;case this.bottomLeftGrip:case this.bottomRightGrip:this.aspectRatio?x.height=this.aspectRatio.getVerticalLength(x.width):x.height+=K}x.width<10&&(x.x=this.cropRect.x,x.width=10),x.height<10&&(x.y=this.cropRect.y,x.height=10),this.previousPoint=v,x.x>=this.margin&&x.y>=this.margin&&x.x-this.margin+x.width<=this.canvasWidth&&x.y-this.margin+x.height<=this.canvasHeight&&(this.cropRect=x,this.onCropChange?(this.cropRectChanged=!0,this.onCropChange(this.cropRect)):this.setCropRectangle(this.cropRect))},F.prototype.adjustCropRect=function(){if(this.aspectRatio&&Math.round(this.cropRect.height)!==Math.round(this.aspectRatio.getVerticalLength(this.cropRect.width))){var v=this.cropRect.x+this.cropRect.width/2,x=this.cropRect.y+this.cropRect.height/2,k=this.aspectRatio.getHorizontalLength(this.cropRect.height),K=this.aspectRatio.getVerticalLength(this.cropRect.width);k/this.canvasWidth<K/this.canvasHeight?this.cropRect.width=k:this.cropRect.height=K,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=v-this.cropRect.width/2,this.cropRect.y=x-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)}},F.prototype.getRescaledRect=function(v,x,k,K,M,ne){var Me=k/v,je=K/x;return{x:(M.x-ne)*Me+ne,y:(M.y-ne)*je+ne,width:M.width*Me,height:M.height*je}},F.prototype.scaleCanvas=function(v,x){var k=this.getRescaledRect(this.canvasWidth,this.canvasHeight,v,x,this.cropRect,this.margin);this.canvasWidth=v,this.canvasHeight=x,this.onCropChange&&this.onCropChange(k),this.setCropRectangle(k)},F}(),ct=function(){function F(v){this._angle=0,this.isDragging=!1,this.width=401,this.height=24,this.title=v,this.uiContainer=document.createElement("div"),this.getUI=this.getUI.bind(this),this.onPointerDown=this.onPointerDown.bind(this),this.onPointerMove=this.onPointerMove.bind(this),this.onPointerUp=this.onPointerUp.bind(this),this.setAngleLabel=this.setAngleLabel.bind(this),this.positionScaleShape=this.positionScaleShape.bind(this)}return Object.defineProperty(F.prototype,"angle",{get:function(){return this._angle},set:function(v){this._angle=v,this.setAngleLabel(),this.positionScaleShape()},enumerable:!1,configurable:!0}),F.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},F.prototype.onPointerDown=function(v){this.controlContainer.setPointerCapture(v.pointerId),this.isDragging=!0,this.previousPoint={x:v.clientX,y:v.clientY}},F.prototype.onPointerMove=function(v){this.isDragging&&(this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.previousPoint.x=v.clientX)},F.prototype.onPointerUp=function(v){this.isDragging&&this.onAngleChange&&this.onAngleChange((v.clientX-this.previousPoint.x)/5),this.isDragging=!1,this.controlContainer.releasePointerCapture(v.pointerId)},F.prototype.setAngleLabel=function(){if(this.angleLabelText){this.angleLabelText.innerHTML=""+Math.round(this._angle);var v=this.angleLabelText.getBBox();Ve.setAttributes(this.angleLabelElement,[["x",((this.width-v.width)/2).toString()],["y",(this.height/2).toString()]])}},F.prototype.positionScaleShape=function(){if(this.scaleShape){var v=this.scaleShape.transform.baseVal.getItem(0);v.setTranslate(this._angle%5*5-25,0),this.scaleShape.transform.baseVal.replaceItem(v,0)}},F.prototype.getVisual=function(){var v=document.createElementNS("http://www.w3.org/2000/svg","svg");v.setAttribute("xmlns","http://www.w3.org/2000/svg"),v.setAttribute("width",this.width+"px"),v.setAttribute("height",this.height+"px"),v.setAttribute("viewBox","0 0 "+this.width+" "+this.height),v.style.flexShrink="0",document.body.appendChild(v);for(var x="M0,"+(this.height-1)+" v"+-this.height/3+"h1v"+this.height/3,k=1;k<=this.width/5+10;k++){var K=k%5==0?this.height/3:this.height/6;x+="h4v"+-K+"h1v"+K}x+="v1H0Z",this.scaleShape=Ve.createPath(x);var M=Ve.createTransform();this.scaleShape.transform.baseVal.appendItem(M),v.appendChild(this.scaleShape),this.angleLabelElement=Ve.createText([["x","0"],["y","0"],["font-size","10px"],["font-family","monospace"]]),this.angleLabelText=Ve.createTSpan(""),this.angleLabelElement.appendChild(this.angleLabelText);var ne=Ve.createTSpan("");return ne.innerHTML="°",this.angleLabelElement.appendChild(ne),v.appendChild(this.angleLabelElement),document.body.removeChild(v),v},F}(),Ct=function(){function F(){this.naturalSize=!1,this.imageType="image/png"}return F.prototype.rasterize=function(v,x,k,K,M,ne,Me){var je=this;return new Promise(function(He){var Pe=document.createElement("canvas");Pe.width=v.width.baseVal.value-2*K,Pe.height=v.height.baseVal.value-2*K;var Xe=1,Ke=1;je.naturalSize===!0?(Xe=x.naturalWidth/(v.width.baseVal.value-2*K)/ne,Ke=x.naturalHeight/(v.height.baseVal.value-2*K)/Me,Pe.width=x.naturalWidth/ne,Pe.height=x.naturalHeight/Me):je.width!==void 0&&je.height!==void 0&&(Xe=je.width/k.width,Ke=je.height/k.height,Pe.width*=Xe,Pe.height*=Ke);var at=Pe.getContext("2d");at.translate(Pe.width/2,Pe.height/2),at.rotate(M*Math.PI/180),at.scale(ne,Me),at.translate(-Pe.width/2,-Pe.height/2),at.drawImage(x,0,0,Pe.width,Pe.height);var St=document.createElement("canvas");St.width=k.width*Xe,St.height=k.height*Ke,St.getContext("2d").putImageData(at.getImageData((k.x-K)*Xe,(k.y-K)*Ke,k.width*Xe,k.height*Ke),0,0),He(St.toDataURL(je.imageType,je.imageQuality))})},F}(),Mt=function(){function F(v){this._zoomToCropEnabled=!0,this.zoomFactor=1,this.flippedHorizontally=!1,this.flippedVertically=!1,this._isGridVisible=!0,this._gridLines=2,this._rotationAngle=0,this.scaleFactor=1,this.renderEventListeners=[],this.closeEventListeners=[],this._isOpen=!1,this.CANVAS_MARGIN=20,this.renderAtNaturalSize=!1,this.renderImageType="image/png",this.displayMode="inline",this.popupMargin=30,this.toolbarHeight=40,this.aspectRatios=[{horizontal:0,vertical:0},{horizontal:4,vertical:3},{horizontal:3,vertical:2},{horizontal:16,vertical:9},{horizontal:1,vertical:1},{horizontal:3,vertical:4},{horizontal:2,vertical:3},{horizontal:9,vertical:16}],this._instanceNo=F.instanceCounter++,this.styles=new At(this.instanceNo),this.target=v,this.targetRoot=document.body,this.open=this.open.bind(this),this.setTopLeft=this.setTopLeft.bind(this),this.overrideOverflow=this.overrideOverflow.bind(this),this.restoreOverflow=this.restoreOverflow.bind(this),this.close=this.close.bind(this),this.closeUI=this.closeUI.bind(this),this.addCloseEventListener=this.addCloseEventListener.bind(this),this.removeCloseEventListener=this.removeCloseEventListener.bind(this),this.addRenderEventListener=this.addRenderEventListener.bind(this),this.removeRenderEventListener=this.removeRenderEventListener.bind(this),this.clientToLocalCoordinates=this.clientToLocalCoordinates.bind(this),this.onWindowResize=this.onWindowResize.bind(this),this.setWindowHeight=this.setWindowHeight.bind(this),this.rotateBy=this.rotateBy.bind(this),this.applyRotation=this.applyRotation.bind(this),this.cropRectChanged=this.cropRectChanged.bind(this),this.zoomToCrop=this.zoomToCrop.bind(this),this.unzoomFromCrop=this.unzoomFromCrop.bind(this),this.rotateLeftButtonClicked=this.rotateLeftButtonClicked.bind(this),this.rotateRightButtonClicked=this.rotateRightButtonClicked.bind(this),this.flipHorizontallyButtonClicked=this.flipHorizontallyButtonClicked.bind(this),this.flipVerticallyButtonClicked=this.flipVerticallyButtonClicked.bind(this),this.applyFlip=this.applyFlip.bind(this),this.startRenderAndClose=this.startRenderAndClose.bind(this),this.render=this.render.bind(this),this.onPopupResize=this.onPopupResize.bind(this),this.applyAspectRatio=this.applyAspectRatio.bind(this)}return Object.defineProperty(F.prototype,"instanceNo",{get:function(){return this._instanceNo},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"zoomToCropEnabled",{get:function(){return this._zoomToCropEnabled},set:function(v){this._zoomToCropEnabled=v,v?this.zoomToCrop():this.unzoomFromCrop()},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isGridVisible",{get:function(){return this._isGridVisible},set:function(v){this._isGridVisible=v,this.cropLayer&&(this.cropLayer.isGridVisible=this._isGridVisible)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"gridLines",{get:function(){return this._gridLines},set:function(v){this._gridLines=v,this.cropLayer&&(this.cropLayer.numberOfGridLines=this._gridLines)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"rotationAngle",{get:function(){return this._rotationAngle},set:function(v){this._rotationAngle=v,this.straightener&&(this.straightener.angle=this._rotationAngle)},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageWidth",{get:function(){return this.imageWidth+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"paddedImageHeight",{get:function(){return this.imageHeight+2*this.CANVAS_MARGIN},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"isOpen",{get:function(){return this._isOpen},enumerable:!1,configurable:!0}),Object.defineProperty(F.prototype,"aspectRatio",{get:function(){var v;return(v=this._aspectRatio)!==null&&v!==void 0?v:this.aspectRatios[0]},set:function(v){this._aspectRatio=v},enumerable:!1,configurable:!0}),F.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},F.prototype.show=function(){this.showUI(),this.open()},F.prototype.close=function(v){v===void 0&&(v=!1),this.isOpen&&(this.coverDiv&&this.closeUI(),this.targetObserver&&this.targetObserver.unobserve(this.target),this.displayMode==="popup"&&window.removeEventListener("resize",this.setWindowHeight),v||this.closeEventListeners.forEach(function(x){return x()}),this._isOpen=!1)},F.prototype.addRenderEventListener=function(v){this.renderEventListeners.push(v)},F.prototype.removeRenderEventListener=function(v){this.renderEventListeners.indexOf(v)>-1&&this.renderEventListeners.splice(this.renderEventListeners.indexOf(v),1)},F.prototype.addCloseEventListener=function(v){this.closeEventListeners.push(v)},F.prototype.removeCloseEventListener=function(v){this.closeEventListeners.indexOf(v)>-1&&this.closeEventListeners.splice(this.closeEventListeners.indexOf(v),1)},F.prototype.setupResizeObserver=function(){var v=this;this.displayMode==="inline"?window.ResizeObserver&&(this.targetObserver=new ResizeObserver(function(){v.resize(v.target.clientWidth,v.target.clientHeight)}),this.targetObserver.observe(this.target)):this.displayMode==="popup"&&(window.ResizeObserver&&(this.targetObserver=new ResizeObserver(this.onPopupResize),this.targetObserver.observe(this.contentDiv)),window.addEventListener("resize",this.setWindowHeight))},F.prototype.onPopupResize=function(){if(this.contentDiv.clientWidth>0&&this.contentDiv.clientHeight>0){var v=1*this.target.clientWidth/this.target.clientHeight,x=this.contentDiv.clientWidth/v>this.contentDiv.clientHeight?(this.contentDiv.clientHeight-2*this.CANVAS_MARGIN)*v:this.contentDiv.clientWidth-2*this.CANVAS_MARGIN,k=x+2*this.CANVAS_MARGIN<this.contentDiv.clientWidth?this.contentDiv.clientHeight-2*this.CANVAS_MARGIN:(this.contentDiv.clientWidth-2*this.CANVAS_MARGIN)/v;this.resize(x,k)}},F.prototype.setWindowHeight=function(){this.windowHeight=window.innerHeight},F.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",Ve.setAttributes(this.editingTarget,[["width",""+this.imageWidth],["height",""+this.imageHeight]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px"},F.prototype.resize=function(v,x){this.imageWidth=Math.round(v),this.imageHeight=Math.round(x),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()},F.prototype.setEditingTarget=function(){var v=document.createElement("canvas");v.width=this.target.naturalWidth,v.height=this.target.naturalHeight,v.getContext("2d").drawImage(this.target,0,0,this.target.naturalWidth,this.target.naturalHeight);var x=v.toDataURL();Ve.setAttributes(this.editingTarget,[["href",x]]),this.setEditingTargetSize()},F.prototype.setTopLeft=function(){var v=this.target.getBoundingClientRect(),x=this.editorCanvas.getBoundingClientRect();this.left=v.left-x.left-this.CANVAS_MARGIN,this.top=v.top-x.top-this.CANVAS_MARGIN},F.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=Ve.createDefs(),this.cropImage.appendChild(this.defs),this.editingTarget=Ve.createImage([["href",""]]),this.editingTarget.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationContainer=Ve.createGroup(),this.editingTargetRotationScaleContainer=Ve.createGroup(),this.editingTargetRotationScaleContainer.appendChild(this.editingTarget),this.editingTargetRotationContainer.appendChild(this.editingTargetRotationScaleContainer);var v=Ve.createTransform();this.editingTargetRotationContainer.transform.baseVal.appendItem(v);var x=Ve.createTransform();this.editingTargetRotationScaleContainer.transform.baseVal.appendItem(x),this.editingTargetContainer=Ve.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)},F.prototype.positionCropImage=function(){this.cropImageHolder.style.top=this.top+"px",this.cropImageHolder.style.left=this.left+"px"},F.prototype.initCropLayer=function(){this.cropRect={x:this.CANVAS_MARGIN,y:this.CANVAS_MARGIN,width:this.imageWidth,height:this.imageHeight},this.cropLayerContainer=Ve.createGroup(),this.cropImage.appendChild(this.cropLayerContainer),this.cropLayer=new lt(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()},F.prototype.zoomToCrop=function(){if(this.cropRect){var v=this.cropRect.x-this.CANVAS_MARGIN+this.cropRect.width/2,x=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=v+"px "+x+"px",this.editingTargetContainer.style.transform="translate("+(this.imageWidth/2-v+this.CANVAS_MARGIN)+"px,"+(this.imageHeight/2-x+this.CANVAS_MARGIN)+"px) scale("+this.zoomFactor+")",this.cropLayer.zoomFactor=this.zoomFactor)}},F.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)},F.prototype.cropRectChanged=function(v){this.cropRect=v,this.zoomToCropEnabled?this.zoomToCrop():this.cropLayer.zoomFactor=1},F.prototype.attachEvents=function(){window.addEventListener("resize",this.onWindowResize)},F.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"},F.prototype.restoreOverflow=function(){document.body.style.overflow=this.bodyOverflowState,window.scroll({top:this.scrollYState,left:this.scrollXState})},F.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 v=this.styles.settings.hideTopToolbar?0:this.toolbarHeight,x=this.target.offsetTop>v+this.CANVAS_MARGIN?this.target.offsetTop-(v+this.CANVAS_MARGIN):0;this.coverDiv.style.top=x+"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},F.prototype.addToolbars=function(){this.addTopToolbar(),this.addBottomToolbar()},F.prototype.addTopToolbar=function(){var v=this;this.topToolbar=new rt,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 x=new vt;x.minWidth=3*this.toolbarHeight+"px",this.topToolbar.addButtonBlock(x);var k=[];this.aspectRatios.forEach(function(Ke){var at=new ut(et.getIcon(Ke.horizontal,Ke.vertical),Ke.horizontal===0&&Ke.vertical===0?"FREE":Ke.horizontal+":"+Ke.vertical);at.onClick=function(){return v.ratioButtonClicked(Ke)},k.push(at)}),this.aspectRatioButton=new st(et.getIcon(0,0),"Aspect ratio",k),this.aspectRatioButton.dropdownClassName=this.toolbarDropdownStyleClass.name,this.aspectRatioButton.dropdownColorsClassName=this.styles.settings.toolbarDropdownStyleColorsClassName?this.styles.settings.toolbarDropdownStyleColorsClassName:this.toolbarDropdownStyleColorsClass.name,x.addButton(this.aspectRatioButton),this.aspectRatios.length<2&&this.aspectRatioButton.hide();var K=new ut('<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");K.isActive=this.isGridVisible,K.onClick=function(){v.isGridVisible=!v.isGridVisible,K.isActive=v.isGridVisible},x.addButton(K);var M=new ut('<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(M.isActive=this.zoomToCropEnabled,M.onClick=function(){v.zoomToCropEnabled=!v.zoomToCropEnabled,M.isActive=v.zoomToCropEnabled},x.addButton(M),!Tt.isLicensed){var ne=new tt;this.topToolbar.addElementBlock(ne);var Me=document.createElement("div");Me.className=this.topToolbar.buttonClassName+" "+this.topToolbar.buttonColorsClassName;var je=document.createElement("a");je.style.color="currentColor",je.href="https://markerjs.com/products/cropro",je.target="_blank",je.innerHTML='<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>',Me.appendChild(je),ne.addElement(Me)}var He=new vt;He.minWidth=3*this.toolbarHeight+"px",He.contentAlign="end",this.topToolbar.addButtonBlock(He);var Pe=new ut('<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");Pe.onClick=this.startRenderAndClose,He.addButton(Pe),this.styles.settings.toolbarOkButtonStyleColorsClassName&&(Pe.colorsClassName=this.styles.settings.toolbarOkButtonStyleColorsClassName);var Xe=new ut('<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");Xe.onClick=this.close,He.addButton(Xe),this.styles.settings.toolbarCloseButtonStyleColorsClassName&&(Xe.colorsClassName=this.styles.settings.toolbarCloseButtonStyleColorsClassName)},F.prototype.addBottomToolbar=function(){var v=this;this.bottomToolbar=new rt,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 x=new vt;x.minWidth=2*this.toolbarHeight+"px",this.bottomToolbar.addButtonBlock(x);var k=new ut('<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");k.onClick=this.rotateLeftButtonClicked,x.addButton(k);var K=new ut('<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");K.onClick=this.rotateRightButtonClicked,x.addButton(K);var M=new tt;M.className=this.toolbarStraightenerBlockStyleClass.name,this.bottomToolbar.addElementBlock(M),this.straightener=new ct("Straighten"),this.straightener.className=this.toolbarStraightenerStyleClass.name,this.straightener.colorsClassName=this.styles.settings.toolbarStraightenerColorsClassName?this.styles.settings.toolbarStraightenerColorsClassName:this.toolbarStraightenerStyleColorsClass.name,this.straightener.onAngleChange=function(He){v.rotateBy(He),v.straightener.angle=v.rotationAngle},M.addElement(this.straightener.getUI());var ne=new vt;ne.minWidth=2*this.toolbarHeight+"px",ne.contentAlign="end",this.bottomToolbar.addButtonBlock(ne);var Me=new ut('<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");Me.onClick=this.flipHorizontallyButtonClicked,ne.addButton(Me);var je=new ut('<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");je.onClick=this.flipVerticallyButtonClicked,ne.addButton(je)},F.prototype.ratioButtonClicked=function(v){this.aspectRatio=v,this.applyAspectRatio(),this.aspectRatioButton.hideDropdown()},F.prototype.applyAspectRatio=function(){this.setCropLayerAspectRatio(),this.aspectRatioButton.icon=et.getIcon(this.aspectRatio.horizontal,this.aspectRatio.vertical)},F.prototype.setCropLayerAspectRatio=function(){this.cropLayer&&(this.aspectRatio&&this.aspectRatio.horizontal!==0&&this.aspectRatio.vertical!==0?this.cropLayer.aspectRatio=new Ze(this.aspectRatio.horizontal,this.aspectRatio.vertical):this.cropLayer.aspectRatio=void 0)},F.prototype.closeUI=function(){this.displayMode==="popup"&&this.restoreOverflow(),this.targetRoot.removeChild(this.coverDiv)},F.prototype.getState=function(){return{width:this.imageWidth,height:this.imageHeight,rotationAngle:this.rotationAngle,flippedHorizontally:this.flippedHorizontally,flippedVertically:this.flippedVertically,cropRect:Object.assign({},this.cropRect)}},F.prototype.restoreState=function(v){if(v){var x=this.cropLayer.getRescaledRect(v.width,v.height,this.imageWidth,this.imageHeight,v.cropRect,this.CANVAS_MARGIN);this.cropLayer.setCropRectangle(x),this.cropRectChanged(x),this.flippedHorizontally=v.flippedHorizontally,this.flippedVertically=v.flippedVertically,this.applyFlip(),this.rotationAngle=v.rotationAngle,this.applyRotation()}},F.prototype.clientToLocalCoordinates=function(v,x){var k=this.cropImage.getBoundingClientRect();return{x:v-k.left,y:x-k.top}},F.prototype.onWindowResize=function(){this.positionUI()},F.prototype.positionUI=function(){switch(this.setTopLeft(),this.displayMode){case"inline":var v=this.target.offsetTop>this.toolbarHeight?this.target.offsetTop-this.toolbarHeight:0;this.coverDiv.style.top=v+"px",this.coverDiv.style.left=this.target.offsetLeft.toString()+"px";break;case"popup":this.coverDiv.style.top="0px",this.coverDiv.style.left="0px",this.coverDiv.style.width="100vw",this.coverDiv.style.height=this.windowHeight+"px",this.contentDiv.style.maxHeight="calc(100vh - "+(2*this.popupMargin+2*this.toolbarHeight)+"px)"}this.positionCropImage()},F.prototype.rotateLeftButtonClicked=function(){var v=this.rotationAngle-90;this.rotationAngle%90!=0&&(v+=this.rotationAngle>=0?90-this.rotationAngle%90:-this.rotationAngle%90),this.rotateTo(v)},F.prototype.rotateRightButtonClicked=function(){var v=this.rotationAngle+90;this.rotationAngle%90!=0&&(v-=this.rotationAngle>=0?this.rotationAngle%90:90+this.rotationAngle%90),this.rotateTo(v)},F.prototype.rotateTo=function(v){v=(v=v>180?v-360:v)<=-180?v+360:v,this.rotationAngle=v,this.applyRotation()},F.prototype.rotateBy=function(v){this.rotateTo((this.rotationAngle+v)%360)},F.prototype.applyRotation=function(){var v=this.zoomToCropEnabled;this.zoomToCropEnabled=!1,this.editingTargetRotationScaleContainer.style.transformOrigin=this.imageWidth/2+"px "+this.imageHeight/2+"px",this.editingTargetRotationScaleContainer.style.transform="scale(1)";var x=this.editingTargetRotationContainer.transform.baseVal.getItem(0);x.setRotate(this.rotationAngle,this.imageWidth/2,this.imageHeight/2),this.editingTargetRotationContainer.transform.baseVal.replaceItem(x,0);var k=this.editingTarget.getBoundingClientRect();this.scaleFactor=Math.min(this.imageWidth/k.width,this.imageHeight/k.height),this.editingTargetRotationScaleContainer.style.transform="scale("+this.scaleFactor+")",this.zoomToCropEnabled=v},F.prototype.flipHorizontallyButtonClicked=function(){this.flippedHorizontally=!this.flippedHorizontally,this.applyFlip()},F.prototype.flipVerticallyButtonClicked=function(){this.flippedVertically=!this.flippedVertically,this.applyFlip()},F.prototype.applyFlip=function(){this.editingTarget.style.transform="scale("+(this.flippedHorizontally?-1:1)+","+(this.flippedVertically?-1:1)+")"},F.prototype.startRenderAndClose=function(){return it(this,void 0,void 0,function(){var v,x;return _t(this,function(k){switch(k.label){case 0:return[4,this.render()];case 1:return v=k.sent(),x=this.getState(),this.renderEventListeners.forEach(function(K){return K(v,x)}),this.close(!0),[2]}})})},F.prototype.render=function(){return it(this,void 0,void 0,function(){var v;return _t(this,function(x){switch(x.label){case 0:return(v=new Ct).naturalSize=this.renderAtNaturalSize,v.imageType=this.renderImageType,v.imageQuality=this.renderImageQuality,v.width=this.renderWidth,v.height=this.renderHeight,this.unzoomFromCrop(),Ve.setAttributes(this.cropLayerContainer,[["display","none"]]),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 1:return x.sent(),[4,v.rasterize(this.cropImage,this.target,{x:this.cropRect.x,y:this.cropRect.y,width:this.cropRect.width,height:this.cropRect.height},this.CANVAS_MARGIN,this.rotationAngle,this.scaleFactor*(this.flippedHorizontally?-1:1),this.scaleFactor*(this.flippedVertically?-1:1))];case 2:return[2,x.sent()]}})})},F.prototype.addStyles=function(){this.toolbarStyleClass=this.styles.addClass(new Ye("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 Ye("toolbar_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarBlockStyleClass=this.styles.addClass(new Ye("toolbar-block",`
|
|
display: flex;
|
|
align-items: center;
|
|
box-sizing: content-box;
|
|
`));var v=this.toolbarHeight/4;this.toolbarButtonStyleClass=this.styles.addClass(new Ye("toolbar_button",`
|
|
display: inline-block;
|
|
width: `+(this.toolbarHeight-2*v)+`px;
|
|
height: `+(this.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_button_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`)),this.toolbarActiveButtonStyleColorsClass=this.styles.addClass(new Ye("toolbar_active_button",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
background-color: `+this.styles.settings.toolbarBackgroundActiveColor+`
|
|
`)),this.styles.addRule(new We("."+this.toolbarButtonStyleClass.name+" svg",`
|
|
height: `+this.toolbarHeight/2+`px;
|
|
`)),this.styles.addRule(new We("."+this.toolbarButtonStyleColorsClass.name+":hover",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundHoverColor+`
|
|
`)),this.toolbarDropdownStyleClass=this.styles.addClass(new Ye("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 Ye("toolbar_dropdown_colors",`
|
|
background-color: `+this.styles.settings.toolbarBackgroundColor+`;
|
|
`)),this.toolbarStraightenerBlockStyleClass=this.styles.addClass(new Ye("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 Ye("toolbar_straightener",`
|
|
display: flex;
|
|
overflow: hidden;
|
|
justify-content: center;
|
|
height: `+(this.toolbarHeight-2*v)+`px;
|
|
padding: `+v+`px;
|
|
cursor: default;
|
|
user-select: none;
|
|
box-sizing: content-box;
|
|
`)),this.toolbarStraightenerStyleColorsClass=this.styles.addClass(new Ye("toolbar_straightener_colors",`
|
|
color: `+this.styles.settings.toolbarColor+`;
|
|
fill: currentColor;
|
|
`))},F.instanceCounter=0,F}(),Nt=W("8hTe"),Wt=W.n(Nt),jt=/<pre[^>]*>/g;function Vt(F){var v=document.createElement("div");return v.innerHTML=F,v.childNodes.length===0?"":v.childNodes[0].nodeValue}var Kt=ue.a=function(F){var v=F.value,x=v===void 0?"":v,k=F.edit,K=k===void 0?!1:k,M=F.className,ne=F.showTextOnly,Me=F.showLines,je=F.replaces,He=F.zoomImg,Pe=F.hasMask,Xe=F.style,Ke=Xe===void 0?{}:Xe,at=F.stylesPrev,St=at===void 0?{}:at,xt=String(x),Et=Object(A.useRef)(),Ot=Object(A.useRef)(),Ht=Object(A.useState)(""),Ft=Object(B.a)(Ht,2),yt=Ft[0],Rt=Ft[1],Gt=Object(A.useState)("office"),Lt=Object(B.a)(Gt,2),Yt=Lt[0],It=Lt[1],kt=function(){var mt=new Mt(Ot.current);mt.displayMode="popup",mt.addRenderEventListener(function(){var Ut=Object(R.a)(e.a.mark(function ft(Bt){var wt;return e.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:return Et.current.style.display="none",Pt.next=3,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Bt}});case 3:wt=Pt.sent,wt!=null&&wt.id&&je(Ot.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 5:case"end":return Pt.stop()}},ft)}));return function(ft){return Ut.apply(this,arguments)}}()),mt.show()},Zt=function(){var mt=new ht(Ot.current);mt.settings.displayMode="popup",mt.addEventListener("render",function(){var Ut=Object(R.a)(e.a.mark(function ft(Bt){var wt;return e.a.wrap(function(Pt){for(;;)switch(Pt.prev=Pt.next){case 0:if(Et.current.style.display="none",!Ot.current){Pt.next=6;break}return Pt.next=4,Object(fe.a)("/api/attachments.json",{method:"post",body:{file_type:"base64",original_filename:"educoder.png",file:Bt.dataUrl}});case 4:wt=Pt.sent,wt!=null&&wt.id&&je(Ot.current.getAttribute("src").replace(V.a.API_SERVER,""),"/api/attachments/".concat(wt==null?void 0:wt.id,"?type=").concat(wt.content_type));case 6:case"end":return Pt.stop()}},ft)}));return function(ft){return Ut.apply(this,arguments)}}()),mt.show(),window.markerArea=mt},Xt=Object(A.useMemo)(function(){Et.current&&(Et.current.style.zIndex=-1);try{var Dt=/\(\s+\/api\/attachments\/|\(\/api\/attachments\/|\(\/attachments\/download\//g,mt=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ut=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g;xt=xt.replace(Dt,"("+V.a.API_SERVER+"/api/attachments/").replace(mt,'"'+V.a.API_SERVER+"/api/attachments/").replace(Ut,'"'+V.a.API_SERVER+"/files/uploads/").replaceAll("http://video.educoder","https://video.educoder").replaceAll("http://www.educoder.net/api","https://data.educoder.net/api").replaceAll("https://www.educoder.net/api","https://data.educoder.net/api").replace(/\r\n/g,`
|
|
`)}catch(Qt){}var ft=P(xt),Bt=T();if(xt.match(/\[TOC\]/)&&(ft=ft.replace("<p>[TOC]</p>",E()),y()),ft=ft.replace(/(__special_katext_id_\d+__)/g,function(Qt,Pt){var Jt=Bt[Pt],ti=Jt.type,ii=Jt.expression;return Object(ae.renderToString)(Vt(ii)||"",{displayMode:ti==="block",throwOnError:!1,output:"html"})}),ft=ft.replace(/▁/g,"\u2581\u2581\u2581"),b(),ne){var wt=document.createElement("div");return wt.innerHTML=ft,wt.innerText}return setTimeout(function(){return qt()},500),ft},[xt]),zt=Object(A.useRef)();m.WebkitLineClamp=Me,Me&&(Ke=Object(L.a)(Object(L.a)({},Ke),m));function $t(Dt){var mt=Dt.target;if(mt.tagName.toUpperCase()==="IMG"){if(He){var Ut=mt.getAttribute("src");Rt(Ut),It("image")}}else if(mt.tagName.toUpperCase()==="A"){var ft=mt.getAttribute("href");if(ft.indexOf("office")>-1)Dt.preventDefault(),Rt(ft),It("office");else if(ft.indexOf("application/pdf")>-1)Dt.preventDefault(),Rt(ft),It("pdf");else if(ft.indexOf("text/html")>-1)Dt.preventDefault(),Rt(ft),It("html");else if(ft.startsWith("#")){Dt.preventDefault();var Bt=document.getElementById(ft.replace("#",""));Bt&&Bt.scrollIntoView(!0)}}}var qt=function(){var mt,Ut=(mt=zt.current)===null||mt===void 0?void 0:mt.querySelectorAll("video");Ut==null||Ut.forEach(function(ft){if(ft.oncontextmenu=function(){return!1},ft.src.indexOf(".m3u8")>-1&&!ft.canPlayType("application/vnd.apple.mpegurl")){if(G.a.isSupported()){var Bt=new G.a;Bt.loadSource(ft.src),Bt.attachMedia(ft)}}})};Object(A.useEffect)(function(){if(zt.current&&Xt&&(Xt.match(jt)&&window.PR.prettyPrint()),zt.current)return zt.current.addEventListener("click",$t),function(){zt.current.removeEventListener("click",$t),b(),y()}},[Xt,zt.current,$t]);var ei=function(mt){if(!K)return;mt.target.nodeName==="IMG"?(Et.current.style.zIndex=1,Et.current.style.display="flex",Et.current.style.width=mt.target.clientWidth+"px",Et.current.style.height=mt.target.clientHeight+"px",Et.current.style.top=mt.target.offsetTop+"px",Et.current.style.left=mt.target.offsetLeft+"px",Ot.current.src=mt.target.getAttribute("src")):Et.current.style.display="none"};return f.a.createElement("div",{style:{position:"relative"}},f.a.createElement("div",{ref:zt,style:Object(L.a)({},Ke),className:"".concat(M||""," markdown-body ").concat(Wt.a.mdBody),onMouseOver:ei,dangerouslySetInnerHTML:{__html:Xt}}),f.a.createElement("div",{ref:Et,className:Wt.a.button},f.a.createElement(H.a,null,f.a.createElement(j.a,{onClick:function(){return kt()}},"\u88C1\u526A"),f.a.createElement(j.a,{onClick:function(){return Zt()}},"\u7F16\u8F91"))),f.a.createElement("img",{ref:Ot,src:"",alt:"sample",crossOrigin:"anonymous",style:{maxWidth:"90%",opacity:0,position:"absolute",zIndex:-1}}),f.a.createElement(ie.a,{close:!0,data:yt,type:yt!=null&&yt.length?Yt:"",style:Object(L.a)({},St),onClose:function(){return Rt("")}}))}},BU3w:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return R});var te=W("MNnm"),H="rc-util-key";function C(B){if(B.attachTo)return B.attachTo;var N=document.querySelector("head");return N||document.body}function j(B){var N,e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!Object(te.a)())return null;var A=document.createElement("style");if((N=e.csp)===null||N===void 0?void 0:N.nonce){var f;A.nonce=(f=e.csp)===null||f===void 0?void 0:f.nonce}A.innerHTML=B;var p=C(e),o=p.firstChild;return e.prepend&&p.prepend?p.prepend(A):e.prepend&&o?p.insertBefore(A,o):p.appendChild(A),A}var L=new Map;function R(B,N){var e=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},A=C(e);if(!L.has(A)){var f=j("",e),p=f.parentNode;L.set(A,p),p.removeChild(f)}var o=Array.from(L.get(A).children).find(function(r){return r.tagName==="STYLE"&&r[H]===N});if(o){var a,n;if(((a=e.csp)===null||a===void 0?void 0:a.nonce)&&o.nonce!==((n=e.csp)===null||n===void 0?void 0:n.nonce)){var l;o.nonce=(l=e.csp)===null||l===void 0?void 0:l.nonce}return o.innerHTML!==B&&(o.innerHTML=B),o}var s=j(B,e);return s[H]=N,s}},"C/vA":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return te});function te(H){const C=this;let j=!1,L;return function(){return j||(j=!0,L=H.apply(C,arguments)),L}}},"Cg/j":function(Qe,ue,W){"use strict";W.d(ue,"b",function(){return te}),W.d(ue,"a",function(){return H}),W.d(ue,"c",function(){return j}),W.d(ue,"d",function(){return L});var te;(function(R){R.serviceIds=new Map,R.DI_TARGET="$di$target",R.DI_DEPENDENCIES="$di$dependencies";function B(N){return N[R.DI_DEPENDENCIES]||[]}R.getServiceDependencies=B})(te||(te={}));const H=j("instantiationService");function C(R,B,N,e){B[te.DI_TARGET]===B?B[te.DI_DEPENDENCIES].push({id:R,index:N,optional:e}):(B[te.DI_DEPENDENCIES]=[{id:R,index:N,optional:e}],B[te.DI_TARGET]=B)}function j(R){if(te.serviceIds.has(R))return te.serviceIds.get(R);const B=function(N,e,A){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");C(B,N,A,!1)};return B.toString=()=>R,te.serviceIds.set(R,B),B}function L(R){return function(B,N,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");C(R,B,e,!0)}}},DlQD:function(Qe,ue,W){(function(te,H){Qe.exports=H()})(this,function(){"use strict";function te(de,re){for(var le=0;le<re.length;le++){var z=re[le];z.enumerable=z.enumerable||!1,z.configurable=!0,"value"in z&&(z.writable=!0),Object.defineProperty(de,z.key,z)}}function H(de,re,le){return re&&te(de.prototype,re),le&&te(de,le),de}function C(de,re){if(!de)return;if(typeof de=="string")return j(de,re);var le=Object.prototype.toString.call(de).slice(8,-1);if(le==="Object"&&de.constructor&&(le=de.constructor.name),le==="Map"||le==="Set")return Array.from(de);if(le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le))return j(de,re)}function j(de,re){(re==null||re>de.length)&&(re=de.length);for(var le=0,z=new Array(re);le<re;le++)z[le]=de[le];return z}function L(de,re){var le;if(typeof Symbol=="undefined"||de[Symbol.iterator]==null){if(Array.isArray(de)||(le=C(de))||re&&de&&typeof de.length=="number"){le&&(de=le);var z=0;return function(){return z>=de.length?{done:!0}:{done:!1,value:de[z++]}}}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 le=de[Symbol.iterator](),le.next.bind(le)}function R(de,re){return re={exports:{}},de(re,re.exports),re.exports}var B=R(function(de){function re(){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 le(z){de.exports.defaults=z}de.exports={defaults:re(),getDefaults:re,changeDefaults:le}}),N=B.defaults,e=B.getDefaults,A=B.changeDefaults,f=/[&<>"']/,p=/[&<>"']/g,o=/[<>"']|&(?!#?\w+;)/,a=/[<>"']|&(?!#?\w+;)/g,n={"&":"&","<":"<",">":">",'"':""","'":"'"},l=function(re){return n[re]};function s(de,re){if(re){if(f.test(de))return de.replace(p,l)}else if(o.test(de))return de.replace(a,l);return de}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(de){return de.replace(r,function(re,le){return le=le.toLowerCase(),le==="colon"?":":le.charAt(0)==="#"?le.charAt(1)==="x"?String.fromCharCode(parseInt(le.substring(2),16)):String.fromCharCode(+le.substring(1)):""})}var t=/(^|[^\[])\^/g;function y(de,re){de=de.source||de,re=re||"";var le={replace:function(Q,q){return q=q.source||q,q=q.replace(t,"$1"),de=de.replace(Q,q),le},getRegex:function(){return new RegExp(de,re)}};return le}var m=/[^\w:]/g,g=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function E(de,re,le){if(de){var z;try{z=decodeURIComponent(i(le)).replace(m,"").toLowerCase()}catch(Q){return null}if(z.indexOf("javascript:")===0||z.indexOf("vbscript:")===0||z.indexOf("data:")===0)return null}re&&!g.test(le)&&(le=d(re,le));try{le=encodeURI(le).replace(/%25/g,"%")}catch(Q){return null}return le}var _={},u=/^[^:]+:\/*[^/]*$/,h=/^([^:]+:)[\s\S]*$/,c=/^([^:]+:\/*[^/]*)[\s\S]*$/;function d(de,re){_[" "+de]||(u.test(de)?_[" "+de]=de+"/":_[" "+de]=D(de,"/",!0)),de=_[" "+de];var le=de.indexOf(":")===-1;return re.substring(0,2)==="//"?le?re:de.replace(h,"$1")+re:re.charAt(0)==="/"?le?re:de.replace(c,"$1")+re:de+re}var T={exec:function(){}};function b(de){for(var re=1,le,z;re<arguments.length;re++){le=arguments[re];for(z in le)Object.prototype.hasOwnProperty.call(le,z)&&(de[z]=le[z])}return de}function S(de,re){var le=de.replace(/\|/g,function(q,ee,ve){for(var we=!1,Fe=ee;--Fe>=0&&ve[Fe]==="\\";)we=!we;return we?"|":" |"}),z=le.split(/ \|/),Q=0;if(z.length>re)z.splice(re);else for(;z.length<re;)z.push("");for(;Q<z.length;Q++)z[Q]=z[Q].trim().replace(/\\\|/g,"|");return z}function D(de,re,le){var z=de.length;if(z===0)return"";for(var Q=0;Q<z;){var q=de.charAt(z-Q-1);if(q===re&&!le)Q++;else if(q!==re&&le)Q++;else break}return de.substr(0,z-Q)}function I(de,re){if(de.indexOf(re[1])===-1)return-1;for(var le=de.length,z=0,Q=0;Q<le;Q++)if(de[Q]==="\\")Q++;else if(de[Q]===re[0])z++;else if(de[Q]===re[1]&&(z--,z<0))return Q;return-1}function w(de){de&&de.sanitize&&!de.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 P={escape:s,unescape:i,edit:y,cleanUrl:E,resolveUrl:d,noopTest:T,merge:b,splitCells:S,rtrim:D,findClosingBracket:I,checkSanitizeDeprecation:w},U=B.defaults,O=P.rtrim,G=P.splitCells,V=P.escape,ae=P.findClosingBracket;function ie(de,re,le){var z=re.href,Q=re.title?V(re.title):null,q=de[1].replace(/\\([\[\]])/g,"$1");return de[0].charAt(0)!=="!"?{type:"link",raw:le,href:z,title:Q,text:q}:{type:"image",raw:le,href:z,title:Q,text:V(q)}}function fe(de,re){var le=de.match(/^(\s+)(?:```)/);if(le===null)return re;var z=le[1];return re.split(`
|
|
`).map(function(Q){var q=Q.match(/^\s+/);if(q===null)return Q;var ee=q[0];return ee.length>=z.length?Q.slice(z.length):Q}).join(`
|
|
`)}var ce=function(){function de(le){this.options=le||U}var re=de.prototype;return re.space=function(z){var Q=this.rules.block.newline.exec(z);if(Q)return Q[0].length>1?{type:"space",raw:Q[0]}:{raw:`
|
|
`}},re.code=function(z,Q){var q=this.rules.block.code.exec(z);if(q){var ee=Q[Q.length-1];if(ee&&ee.type==="paragraph")return{raw:q[0],text:q[0].trimRight()};var ve=q[0].replace(/^ {4}/gm,"");return{type:"code",raw:q[0],codeBlockStyle:"indented",text:this.options.pedantic?ve:O(ve,`
|
|
`)}}},re.fences=function(z){var Q=this.rules.block.fences.exec(z);if(Q){var q=Q[0],ee=fe(q,Q[3]||"");return{type:"code",raw:q,lang:Q[2]?Q[2].trim():Q[2],text:ee}}},re.heading=function(z){var Q=this.rules.block.heading.exec(z);if(Q)return{type:"heading",raw:Q[0],depth:Q[1].length,text:Q[2]}},re.nptable=function(z){var Q=this.rules.block.nptable.exec(z);if(Q){var q={type:"table",header:G(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
|
|
`):[],raw:Q[0]};if(q.header.length===q.align.length){var ee=q.align.length,ve;for(ve=0;ve<ee;ve++)/^ *-+: *$/.test(q.align[ve])?q.align[ve]="right":/^ *:-+: *$/.test(q.align[ve])?q.align[ve]="center":/^ *:-+ *$/.test(q.align[ve])?q.align[ve]="left":q.align[ve]=null;for(ee=q.cells.length,ve=0;ve<ee;ve++)q.cells[ve]=G(q.cells[ve],q.header.length);return q}}},re.hr=function(z){var Q=this.rules.block.hr.exec(z);if(Q)return{type:"hr",raw:Q[0]}},re.blockquote=function(z){var Q=this.rules.block.blockquote.exec(z);if(Q){var q=Q[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:Q[0],text:q}}},re.list=function(z){var Q=this.rules.block.list.exec(z);if(Q){for(var q=Q[0],ee=Q[2],ve=ee.length>1,we=ee[ee.length-1]===")",Fe={type:"list",raw:q,ordered:ve,start:ve?+ee.slice(0,-1):"",loose:!1,items:[]},Ge=Q[0].match(this.rules.block.item),Je=!1,ze,qe,nt,$e,gt,ht,bt,pt=Ge.length,it=0;it<pt;it++)ze=Ge[it],q=ze,qe=ze.length,ze=ze.replace(/^ *([*+-]|\d+[.)]) */,""),~ze.indexOf(`
|
|
`)&&(qe-=ze.length,ze=this.options.pedantic?ze.replace(/^ {1,4}/gm,""):ze.replace(new RegExp("^ {1,"+qe+"}","gm"),"")),it!==pt-1&&(nt=this.rules.block.bullet.exec(Ge[it+1])[0],(ve?nt.length===1||!we&&nt[nt.length-1]===")":nt.length>1||this.options.smartLists&&nt!==ee)&&($e=Ge.slice(it+1).join(`
|
|
`),Fe.raw=Fe.raw.substring(0,Fe.raw.length-$e.length),it=pt-1)),gt=Je||/\n\n(?!\s*$)/.test(ze),it!==pt-1&&(Je=ze.charAt(ze.length-1)===`
|
|
`,gt||(gt=Je)),gt&&(Fe.loose=!0),ht=/^\[[ xX]\] /.test(ze),bt=void 0,ht&&(bt=ze[1]!==" ",ze=ze.replace(/^\[[ xX]\] +/,"")),Fe.items.push({type:"list_item",raw:q,task:ht,checked:bt,loose:gt,text:ze});return Fe}},re.html=function(z){var Q=this.rules.block.html.exec(z);if(Q)return{type:this.options.sanitize?"paragraph":"html",raw:Q[0],pre:!this.options.sanitizer&&(Q[1]==="pre"||Q[1]==="script"||Q[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(Q[0]):V(Q[0]):Q[0]}},re.def=function(z){var Q=this.rules.block.def.exec(z);if(Q){Q[3]&&(Q[3]=Q[3].substring(1,Q[3].length-1));var q=Q[1].toLowerCase().replace(/\s+/g," ");return{tag:q,raw:Q[0],href:Q[2],title:Q[3]}}},re.table=function(z){var Q=this.rules.block.table.exec(z);if(Q){var q={type:"table",header:G(Q[1].replace(/^ *| *\| *$/g,"")),align:Q[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:Q[3]?Q[3].replace(/\n$/,"").split(`
|
|
`):[]};if(q.header.length===q.align.length){q.raw=Q[0];var ee=q.align.length,ve;for(ve=0;ve<ee;ve++)/^ *-+: *$/.test(q.align[ve])?q.align[ve]="right":/^ *:-+: *$/.test(q.align[ve])?q.align[ve]="center":/^ *:-+ *$/.test(q.align[ve])?q.align[ve]="left":q.align[ve]=null;for(ee=q.cells.length,ve=0;ve<ee;ve++)q.cells[ve]=G(q.cells[ve].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},re.lheading=function(z){var Q=this.rules.block.lheading.exec(z);if(Q)return{type:"heading",raw:Q[0],depth:Q[2].charAt(0)==="="?1:2,text:Q[1]}},re.paragraph=function(z){var Q=this.rules.block.paragraph.exec(z);if(Q)return{type:"paragraph",raw:Q[0],text:Q[1].charAt(Q[1].length-1)===`
|
|
`?Q[1].slice(0,-1):Q[1]}},re.text=function(z,Q){var q=this.rules.block.text.exec(z);if(q){var ee=Q[Q.length-1];return ee&&ee.type==="text"?{raw:q[0],text:q[0]}:{type:"text",raw:q[0],text:q[0]}}},re.escape=function(z){var Q=this.rules.inline.escape.exec(z);if(Q)return{type:"escape",raw:Q[0],text:V(Q[1])}},re.tag=function(z,Q,q){var ee=this.rules.inline.tag.exec(z);if(ee)return!Q&&/^<a /i.test(ee[0])?Q=!0:Q&&/^<\/a>/i.test(ee[0])&&(Q=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(ee[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(ee[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:ee[0],inLink:Q,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):V(ee[0]):ee[0]}},re.link=function(z){var Q=this.rules.inline.link.exec(z);if(Q){var q=ae(Q[2],"()");if(q>-1){var ee=Q[0].indexOf("!")===0?5:4,ve=ee+Q[1].length+q;Q[2]=Q[2].substring(0,q),Q[0]=Q[0].substring(0,ve).trim(),Q[3]=""}var we=Q[2],Fe="";if(this.options.pedantic){var Ge=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(we);Ge?(we=Ge[1],Fe=Ge[3]):Fe=""}else Fe=Q[3]?Q[3].slice(1,-1):"";we=we.trim().replace(/^<([\s\S]*)>$/,"$1");var Je=ie(Q,{href:we&&we.replace(this.rules.inline._escapes,"$1"),title:Fe&&Fe.replace(this.rules.inline._escapes,"$1")},Q[0]);return Je}},re.reflink=function(z,Q){var q;if((q=this.rules.inline.reflink.exec(z))||(q=this.rules.inline.nolink.exec(z))){var ee=(q[2]||q[1]).replace(/\s+/g," ");if(ee=Q[ee.toLowerCase()],!ee||!ee.href){var ve=q[0].charAt(0);return{type:"text",raw:ve,text:ve}}var we=ie(q,ee,q[0]);return we}},re.strong=function(z,Q,q){q===void 0&&(q="");var ee=this.rules.inline.strong.start.exec(z);if(ee&&(!ee[1]||ee[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Q=Q.slice(-1*z.length);var ve=ee[0]==="**"?this.rules.inline.strong.endAst:this.rules.inline.strong.endUnd;ve.lastIndex=0;for(var we;(ee=ve.exec(Q))!=null;)if(we=this.rules.inline.strong.middle.exec(Q.slice(0,ee.index+3)),we)return{type:"strong",raw:z.slice(0,we[0].length),text:z.slice(2,we[0].length-2)}}},re.em=function(z,Q,q){q===void 0&&(q="");var ee=this.rules.inline.em.start.exec(z);if(ee&&(!ee[1]||ee[1]&&(q===""||this.rules.inline.punctuation.exec(q)))){Q=Q.slice(-1*z.length);var ve=ee[0]==="*"?this.rules.inline.em.endAst:this.rules.inline.em.endUnd;ve.lastIndex=0;for(var we;(ee=ve.exec(Q))!=null;)if(we=this.rules.inline.em.middle.exec(Q.slice(0,ee.index+2)),we)return{type:"em",raw:z.slice(0,we[0].length),text:z.slice(1,we[0].length-1)}}},re.codespan=function(z){var Q=this.rules.inline.code.exec(z);if(Q){var q=Q[2].replace(/\n/g," "),ee=/[^ ]/.test(q),ve=q.startsWith(" ")&&q.endsWith(" ");return ee&&ve&&(q=q.substring(1,q.length-1)),q=V(q,!0),{type:"codespan",raw:Q[0],text:q}}},re.br=function(z){var Q=this.rules.inline.br.exec(z);if(Q)return{type:"br",raw:Q[0]}},re.del=function(z){var Q=this.rules.inline.del.exec(z);if(Q)return{type:"del",raw:Q[0],text:Q[1]}},re.autolink=function(z,Q){var q=this.rules.inline.autolink.exec(z);if(q){var ee,ve;return q[2]==="@"?(ee=V(this.options.mangle?Q(q[1]):q[1]),ve="mailto:"+ee):(ee=V(q[1]),ve=ee),{type:"link",raw:q[0],text:ee,href:ve,tokens:[{type:"text",raw:ee,text:ee}]}}},re.url=function(z,Q){var q;if(q=this.rules.inline.url.exec(z)){var ee,ve;if(q[2]==="@")ee=V(this.options.mangle?Q(q[0]):q[0]),ve="mailto:"+ee;else{var we;do we=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(we!==q[0]);ee=V(q[0]),q[1]==="www."?ve="http://"+ee:ve=ee}return{type:"link",raw:q[0],text:ee,href:ve,tokens:[{type:"text",raw:ee,text:ee}]}}},re.inlineText=function(z,Q,q){var ee=this.rules.inline.text.exec(z);if(ee){var ve;return Q?ve=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(ee[0]):V(ee[0]):ee[0]:ve=V(this.options.smartypants?q(ee[0]):ee[0]),{type:"text",raw:ee[0],text:ve}}},de}(),J=P.noopTest,Z=P.edit,he=P.merge,X={newline:/^\n+/,code:/^( {4}[^\n]+\n*)+/,fences:/^ {0,3}(`{3,}(?=[^`\n]*\n)|~{3,})([^\n]*)\n(?:|([\s\S]*?)\n)(?: {0,3}\1[~`]* *(?:\n+|$)|$)/,hr:/^ {0,3}((?:- *){3,}|(?:_ *){3,}|(?:\* *){3,})(?:\n+|$)/,heading:/^ {0,3}(#{1,6}) +([^\n]*?)(?: +#+)? *(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?!\1bull )\n*|\s*$)/,html:"^ {0,3}(?:<(script|pre|style)[\\s>][\\s\\S]*?(?:</\\1>[^\\n]*\\n+|$)|comment[^\\n]*(\\n+|$)|<\\?[\\s\\S]*?\\?>\\n*|<![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:J,table:J,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html)[^\n]+)*)/,text:/^[^\n]+/};X._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,X._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,X.def=Z(X.def).replace("label",X._label).replace("title",X._title).getRegex(),X.bullet=/(?:[*+-]|\d{1,9}[.)])/,X.item=/^( *)(bull) ?[^\n]*(?:\n(?!\1bull ?)[^\n]*)*/,X.item=Z(X.item,"gm").replace(/bull/g,X.bullet).getRegex(),X.list=Z(X.list).replace(/bull/g,X.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+X.def.source+")").getRegex(),X._tag="address|article|aside|base|basefont|blockquote|body|caption|center|col|colgroup|dd|details|dialog|dir|div|dl|dt|fieldset|figcaption|figure|footer|form|frame|frameset|h[1-6]|head|header|hr|html|iframe|legend|li|link|main|menu|menuitem|meta|nav|noframes|ol|optgroup|option|p|param|section|source|summary|table|tbody|td|tfoot|th|thead|title|tr|track|ul",X._comment=/<!--(?!-?>)[\s\S]*?-->/,X.html=Z(X.html,"i").replace("comment",X._comment).replace("tag",X._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),X.paragraph=Z(X._paragraph).replace("hr",X.hr).replace("heading"," {0,3}#{1,6} ").replace("|lheading","").replace("blockquote"," {0,3}>").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",X._tag).getRegex(),X.blockquote=Z(X.blockquote).replace("paragraph",X.paragraph).getRegex(),X.normal=he({},X),X.gfm=he({},X.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n *([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n *\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),X.gfm.nptable=Z(X.gfm.nptable).replace("hr",X.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",X._tag).getRegex(),X.gfm.table=Z(X.gfm.table).replace("hr",X.hr).replace("heading"," {0,3}#{1,6} ").replace("blockquote"," {0,3}>").replace("code"," {4}[^\\n]").replace("fences"," {0,3}(?:`{3,}(?=[^`\\n]*\\n)|~{3,})[^\\n]*\\n").replace("list"," {0,3}(?:[*+-]|1[.)]) ").replace("html","</?(?:tag)(?: +|\\n|/?>)|<(?:script|pre|style|!--)").replace("tag",X._tag).getRegex(),X.pedantic=he({},X.normal,{html:Z(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",X._comment).replace(/tag/g,"(?!(?:a|em|strong|small|s|cite|q|dfn|abbr|data|time|code|var|samp|kbd|sub|sup|i|b|u|mark|ruby|rt|rp|bdi|bdo|span|br|wbr|ins|del|img)\\b)\\w+(?!:|[^\\w\\s@]*@)\\b").getRegex(),def:/^ *\[([^\]]+)\]: *<?([^\s>]+)>?(?: +(["(][^\n]+[")]))? *(?:\n+|$)/,heading:/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/,fences:J,paragraph:Z(X.normal._paragraph).replace("hr",X.hr).replace("heading",` *#{1,6} *[^
|
|
]`).replace("lheading",X.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var $={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:J,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:J,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*]|\b_|$)|[^ ](?= {2,}\n))|(?= {2,}\n))/,punctuation:/^([\s*punctuation])/};$._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",$.punctuation=Z($.punctuation).replace(/punctuation/g,$._punctuation).getRegex(),$._blockSkip="\\[[^\\]]*?\\]\\([^\\)]*?\\)|`[^`]*?`|<[^>]*?>",$._overlapSkip="__[^_]*?__|\\*\\*\\[^\\*\\]*?\\*\\*",$.em.start=Z($.em.start).replace(/punctuation/g,$._punctuation).getRegex(),$.em.middle=Z($.em.middle).replace(/punctuation/g,$._punctuation).replace(/overlapSkip/g,$._overlapSkip).getRegex(),$.em.endAst=Z($.em.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.em.endUnd=Z($.em.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.start=Z($.strong.start).replace(/punctuation/g,$._punctuation).getRegex(),$.strong.middle=Z($.strong.middle).replace(/punctuation/g,$._punctuation).replace(/blockSkip/g,$._blockSkip).getRegex(),$.strong.endAst=Z($.strong.endAst,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.strong.endUnd=Z($.strong.endUnd,"g").replace(/punctuation/g,$._punctuation).getRegex(),$.blockSkip=Z($._blockSkip,"g").getRegex(),$.overlapSkip=Z($._overlapSkip,"g").getRegex(),$._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,$._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,$._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])?)+(?![-_])/,$.autolink=Z($.autolink).replace("scheme",$._scheme).replace("email",$._email).getRegex(),$._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,$.tag=Z($.tag).replace("comment",X._comment).replace("attribute",$._attribute).getRegex(),$._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,$._href=/<(?:\\[<>]?|[^\s<>\\])*>|[^\s\x00-\x1f]*/,$._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,$.link=Z($.link).replace("label",$._label).replace("href",$._href).replace("title",$._title).getRegex(),$.reflink=Z($.reflink).replace("label",$._label).getRegex(),$.reflinkSearch=Z($.reflinkSearch,"g").replace("reflink",$.reflink).replace("nolink",$.nolink).getRegex(),$.normal=he({},$),$.pedantic=he({},$.normal,{strong:{start:/^__|\*\*/,middle:/^__(?=\S)([\s\S]*?\S)__(?!_)|^\*\*(?=\S)([\s\S]*?\S)\*\*(?!\*)/,endAst:/\*\*(?!\*)/g,endUnd:/__(?!_)/g},em:{start:/^_|\*/,middle:/^()\*(?=\S)([\s\S]*?\S)\*(?!\*)|^_(?=\S)([\s\S]*?\S)_(?!_)/,endAst:/\*(?!\*)/g,endUnd:/_(?!_)/g},link:Z(/^!?\[(label)\]\((.*?)\)/).replace("label",$._label).getRegex(),reflink:Z(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",$._label).getRegex()}),$.gfm=he({},$.normal,{escape:Z($.escape).replace("])","~|])").getRegex(),_extended_email:/[A-Za-z0-9._+-]+(@)[a-zA-Z0-9-_]+(?:\.[a-zA-Z0-9-_]*[a-zA-Z0-9])+(?![-_])/,url:/^((?:ftp|https?):\/\/|www\.)(?:[a-zA-Z0-9\-]+\.?)+[^\s<]*|^email/,_backpedal:/(?:[^?!.,:;*_~()&]+|\([^)]*\)|&(?![a-zA-Z0-9]+;$)|[?!.,:;*_~)]+(?!$))+/,del:/^~+(?=\S)([\s\S]*?\S)~+/,text:/^(`+|[^`])(?:[\s\S]*?(?:(?=[\\<!\[`*~]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))|(?= {2,}\n|[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@))/}),$.gfm.url=Z($.gfm.url,"i").replace("email",$.gfm._extended_email).getRegex(),$.breaks=he({},$.gfm,{br:Z($.br).replace("{2,}","*").getRegex(),text:Z($.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ye={block:X,inline:$},Le=B.defaults,Re=ye.block,Ie=ye.inline;function Ne(de){return de.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 _e(de){var re="",le,z,Q=de.length;for(le=0;le<Q;le++)z=de.charCodeAt(le),Math.random()>.5&&(z="x"+z.toString(16)),re+="&#"+z+";";return re}var Ee=function(){function de(le){this.tokens=[],this.tokens.links=Object.create(null),this.options=le||Le,this.options.tokenizer=this.options.tokenizer||new ce,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var z={block:Re.normal,inline:Ie.normal};this.options.pedantic?(z.block=Re.pedantic,z.inline=Ie.pedantic):this.options.gfm&&(z.block=Re.gfm,this.options.breaks?z.inline=Ie.breaks:z.inline=Ie.gfm),this.tokenizer.rules=z}de.lex=function(z,Q){var q=new de(Q);return q.lex(z)};var re=de.prototype;return re.lex=function(z){return z=z.replace(/\r\n|\r/g,`
|
|
`).replace(/\t/g," "),this.blockTokens(z,this.tokens,!0),this.inline(this.tokens),this.tokens},re.blockTokens=function(z,Q,q){Q===void 0&&(Q=[]),q===void 0&&(q=!0),z=z.replace(/^ +$/gm,"");for(var ee,ve,we,Fe;z;){if(ee=this.tokenizer.space(z)){z=z.substring(ee.raw.length),ee.type&&Q.push(ee);continue}if(ee=this.tokenizer.code(z,Q)){z=z.substring(ee.raw.length),ee.type?Q.push(ee):(Fe=Q[Q.length-1],Fe.raw+=`
|
|
`+ee.raw,Fe.text+=`
|
|
`+ee.text);continue}if(ee=this.tokenizer.fences(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.heading(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.nptable(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.hr(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.blockquote(z)){z=z.substring(ee.raw.length),ee.tokens=this.blockTokens(ee.text,[],q),Q.push(ee);continue}if(ee=this.tokenizer.list(z)){for(z=z.substring(ee.raw.length),we=ee.items.length,ve=0;ve<we;ve++)ee.items[ve].tokens=this.blockTokens(ee.items[ve].text,[],!1);Q.push(ee);continue}if(ee=this.tokenizer.html(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(q&&(ee=this.tokenizer.def(z))){z=z.substring(ee.raw.length),this.tokens.links[ee.tag]||(this.tokens.links[ee.tag]={href:ee.href,title:ee.title});continue}if(ee=this.tokenizer.table(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.lheading(z)){z=z.substring(ee.raw.length),Q.push(ee);continue}if(q&&(ee=this.tokenizer.paragraph(z))){z=z.substring(ee.raw.length),Q.push(ee);continue}if(ee=this.tokenizer.text(z,Q)){z=z.substring(ee.raw.length),ee.type?Q.push(ee):(Fe=Q[Q.length-1],Fe.raw+=`
|
|
`+ee.raw,Fe.text+=`
|
|
`+ee.text);continue}if(z){var Ge="Infinite loop on byte: "+z.charCodeAt(0);if(this.options.silent){console.error(Ge);break}else throw new Error(Ge)}}return Q},re.inline=function(z){var Q,q,ee,ve,we,Fe,Ge=z.length;for(Q=0;Q<Ge;Q++){Fe=z[Q];switch(Fe.type){case"paragraph":case"text":case"heading":{Fe.tokens=[],this.inlineTokens(Fe.text,Fe.tokens);break}case"table":{for(Fe.tokens={header:[],cells:[]},ve=Fe.header.length,q=0;q<ve;q++)Fe.tokens.header[q]=[],this.inlineTokens(Fe.header[q],Fe.tokens.header[q]);for(ve=Fe.cells.length,q=0;q<ve;q++)for(we=Fe.cells[q],Fe.tokens.cells[q]=[],ee=0;ee<we.length;ee++)Fe.tokens.cells[q][ee]=[],this.inlineTokens(we[ee],Fe.tokens.cells[q][ee]);break}case"blockquote":{this.inline(Fe.tokens);break}case"list":{for(ve=Fe.items.length,q=0;q<ve;q++)this.inline(Fe.items[q].tokens);break}}}return z},re.inlineTokens=function(z,Q,q,ee,ve){Q===void 0&&(Q=[]),q===void 0&&(q=!1),ee===void 0&&(ee=!1),ve===void 0&&(ve="");var we,Fe=z,Ge;if(this.tokens.links){var Je=Object.keys(this.tokens.links);if(Je.length>0)for(;(Ge=this.tokenizer.rules.inline.reflinkSearch.exec(Fe))!=null;)Je.includes(Ge[0].slice(Ge[0].lastIndexOf("[")+1,-1))&&(Fe=Fe.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+Fe.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(Ge=this.tokenizer.rules.inline.blockSkip.exec(Fe))!=null;)Fe=Fe.slice(0,Ge.index)+"["+"a".repeat(Ge[0].length-2)+"]"+Fe.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;z;){if(we=this.tokenizer.escape(z)){z=z.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.tag(z,q,ee)){z=z.substring(we.raw.length),q=we.inLink,ee=we.inRawBlock,Q.push(we);continue}if(we=this.tokenizer.link(z)){z=z.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ee)),Q.push(we);continue}if(we=this.tokenizer.reflink(z,this.tokens.links)){z=z.substring(we.raw.length),we.type==="link"&&(we.tokens=this.inlineTokens(we.text,[],!0,ee)),Q.push(we);continue}if(we=this.tokenizer.strong(z,Fe,ve)){z=z.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],q,ee),Q.push(we);continue}if(we=this.tokenizer.em(z,Fe,ve)){z=z.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],q,ee),Q.push(we);continue}if(we=this.tokenizer.codespan(z)){z=z.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.br(z)){z=z.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.del(z)){z=z.substring(we.raw.length),we.tokens=this.inlineTokens(we.text,[],q,ee),Q.push(we);continue}if(we=this.tokenizer.autolink(z,_e)){z=z.substring(we.raw.length),Q.push(we);continue}if(!q&&(we=this.tokenizer.url(z,_e))){z=z.substring(we.raw.length),Q.push(we);continue}if(we=this.tokenizer.inlineText(z,ee,Ne)){z=z.substring(we.raw.length),ve=we.raw.slice(-1),Q.push(we);continue}if(z){var ze="Infinite loop on byte: "+z.charCodeAt(0);if(this.options.silent){console.error(ze);break}else throw new Error(ze)}}return Q},H(de,null,[{key:"rules",get:function(){return{block:Re,inline:Ie}}}]),de}(),Ae=B.defaults,Y=P.cleanUrl,se=P.escape,pe=function(){function de(le){this.options=le||Ae}var re=de.prototype;return re.code=function(z,Q,q){var ee=(Q||"").match(/\S*/)[0];if(this.options.highlight){var ve=this.options.highlight(z,ee);ve!=null&&ve!==z&&(q=!0,z=ve)}return ee?'<pre><code class="'+this.options.langPrefix+se(ee,!0)+'">'+(q?z:se(z,!0))+`</code></pre>
|
|
`:"<pre><code>"+(q?z:se(z,!0))+`</code></pre>
|
|
`},re.blockquote=function(z){return`<blockquote>
|
|
`+z+`</blockquote>
|
|
`},re.html=function(z){return z},re.heading=function(z,Q,q,ee){return this.options.headerIds?"<h"+Q+' id="'+this.options.headerPrefix+ee.slug(q)+'">'+z+"</h"+Q+`>
|
|
`:"<h"+Q+">"+z+"</h"+Q+`>
|
|
`},re.hr=function(){return this.options.xhtml?`<hr/>
|
|
`:`<hr>
|
|
`},re.list=function(z,Q,q){var ee=Q?"ol":"ul",ve=Q&&q!==1?' start="'+q+'"':"";return"<"+ee+ve+`>
|
|
`+z+"</"+ee+`>
|
|
`},re.listitem=function(z){return"<li>"+z+`</li>
|
|
`},re.checkbox=function(z){return"<input "+(z?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},re.paragraph=function(z){return"<p>"+z+`</p>
|
|
`},re.table=function(z,Q){return Q&&(Q="<tbody>"+Q+"</tbody>"),`<table>
|
|
<thead>
|
|
`+z+`</thead>
|
|
`+Q+`</table>
|
|
`},re.tablerow=function(z){return`<tr>
|
|
`+z+`</tr>
|
|
`},re.tablecell=function(z,Q){var q=Q.header?"th":"td",ee=Q.align?"<"+q+' align="'+Q.align+'">':"<"+q+">";return ee+z+"</"+q+`>
|
|
`},re.strong=function(z){return"<strong>"+z+"</strong>"},re.em=function(z){return"<em>"+z+"</em>"},re.codespan=function(z){return"<code>"+z+"</code>"},re.br=function(){return this.options.xhtml?"<br/>":"<br>"},re.del=function(z){return"<del>"+z+"</del>"},re.link=function(z,Q,q){if(z=Y(this.options.sanitize,this.options.baseUrl,z),z===null)return q;var ee='<a href="'+se(z)+'"';return Q&&(ee+=' title="'+Q+'"'),ee+=">"+q+"</a>",ee},re.image=function(z,Q,q){if(z=Y(this.options.sanitize,this.options.baseUrl,z),z===null)return q;var ee='<img src="'+z+'" alt="'+q+'"';return Q&&(ee+=' title="'+Q+'"'),ee+=this.options.xhtml?"/>":">",ee},re.text=function(z){return z},de}(),ge=function(){function de(){}var re=de.prototype;return re.strong=function(z){return z},re.em=function(z){return z},re.codespan=function(z){return z},re.del=function(z){return z},re.html=function(z){return z},re.text=function(z){return z},re.link=function(z,Q,q){return""+q},re.image=function(z,Q,q){return""+q},re.br=function(){return""},de}(),ke=function(){function de(){this.seen={}}var re=de.prototype;return re.slug=function(z){var Q=z.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-");if(this.seen.hasOwnProperty(Q)){var q=Q;do this.seen[q]++,Q=q+"-"+this.seen[q];while(this.seen.hasOwnProperty(Q))}return this.seen[Q]=0,Q},de}(),oe=B.defaults,me=P.unescape,be=function(){function de(le){this.options=le||oe,this.options.renderer=this.options.renderer||new pe,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new ge,this.slugger=new ke}de.parse=function(z,Q){var q=new de(Q);return q.parse(z)};var re=de.prototype;return re.parse=function(z,Q){Q===void 0&&(Q=!0);var q="",ee,ve,we,Fe,Ge,Je,ze,qe,nt,$e,gt,ht,bt,pt,it,_t,Tt,Ve,At=z.length;for(ee=0;ee<At;ee++){$e=z[ee];switch($e.type){case"space":continue;case"hr":{q+=this.renderer.hr();continue}case"heading":{q+=this.renderer.heading(this.parseInline($e.tokens),$e.depth,me(this.parseInline($e.tokens,this.textRenderer)),this.slugger);continue}case"code":{q+=this.renderer.code($e.text,$e.lang,$e.escaped);continue}case"table":{for(qe="",ze="",Fe=$e.header.length,ve=0;ve<Fe;ve++)ze+=this.renderer.tablecell(this.parseInline($e.tokens.header[ve]),{header:!0,align:$e.align[ve]});for(qe+=this.renderer.tablerow(ze),nt="",Fe=$e.cells.length,ve=0;ve<Fe;ve++){for(Je=$e.tokens.cells[ve],ze="",Ge=Je.length,we=0;we<Ge;we++)ze+=this.renderer.tablecell(this.parseInline(Je[we]),{header:!1,align:$e.align[we]});nt+=this.renderer.tablerow(ze)}q+=this.renderer.table(qe,nt);continue}case"blockquote":{nt=this.parse($e.tokens),q+=this.renderer.blockquote(nt);continue}case"list":{for(gt=$e.ordered,ht=$e.start,bt=$e.loose,Fe=$e.items.length,nt="",ve=0;ve<Fe;ve++)it=$e.items[ve],_t=it.checked,Tt=it.task,pt="",it.task&&(Ve=this.renderer.checkbox(_t),bt?it.tokens.length>0&&it.tokens[0].type==="text"?(it.tokens[0].text=Ve+" "+it.tokens[0].text,it.tokens[0].tokens&&it.tokens[0].tokens.length>0&&it.tokens[0].tokens[0].type==="text"&&(it.tokens[0].tokens[0].text=Ve+" "+it.tokens[0].tokens[0].text)):it.tokens.unshift({type:"text",text:Ve}):pt+=Ve),pt+=this.parse(it.tokens,bt),nt+=this.renderer.listitem(pt,Tt,_t);q+=this.renderer.list(nt,gt,ht);continue}case"html":{q+=this.renderer.html($e.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(nt=$e.tokens?this.parseInline($e.tokens):$e.text;ee+1<At&&z[ee+1].type==="text";)$e=z[++ee],nt+=`
|
|
`+($e.tokens?this.parseInline($e.tokens):$e.text);q+=Q?this.renderer.paragraph(nt):nt;continue}default:{var We='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(We);return}else throw new Error(We)}}}return q},re.parseInline=function(z,Q){Q=Q||this.renderer;var q="",ee,ve,we=z.length;for(ee=0;ee<we;ee++){ve=z[ee];switch(ve.type){case"escape":{q+=Q.text(ve.text);break}case"html":{q+=Q.html(ve.text);break}case"link":{q+=Q.link(ve.href,ve.title,this.parseInline(ve.tokens,Q));break}case"image":{q+=Q.image(ve.href,ve.title,ve.text);break}case"strong":{q+=Q.strong(this.parseInline(ve.tokens,Q));break}case"em":{q+=Q.em(this.parseInline(ve.tokens,Q));break}case"codespan":{q+=Q.codespan(ve.text);break}case"br":{q+=Q.br();break}case"del":{q+=Q.del(this.parseInline(ve.tokens,Q));break}case"text":{q+=Q.text(ve.text);break}default:{var Fe='Token with "'+ve.type+'" type was not found.';if(this.options.silent){console.error(Fe);return}else throw new Error(Fe)}}}return q},de}(),xe=P.merge,Ce=P.checkSanitizeDeprecation,Oe=P.escape,Se=B.getDefaults,Ue=B.changeDefaults,Be=B.defaults;function Te(de,re,le){if(typeof de=="undefined"||de===null)throw new Error("marked(): input parameter is undefined or null");if(typeof de!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(de)+", string expected");if(typeof re=="function"&&(le=re,re=null),re=xe({},Te.defaults,re||{}),Ce(re),le){var z=re.highlight,Q;try{Q=Ee.lex(de,re)}catch(we){return le(we)}var q=function(Fe){var Ge;if(!Fe)try{Ge=be.parse(Q,re)}catch(Je){Fe=Je}return re.highlight=z,Fe?le(Fe):le(null,Ge)};if(!z||z.length<3)return q();if(delete re.highlight,!Q.length)return q();var ee=0;Te.walkTokens(Q,function(we){we.type==="code"&&(ee++,setTimeout(function(){z(we.text,we.lang,function(Fe,Ge){if(Fe)return q(Fe);Ge!=null&&Ge!==we.text&&(we.text=Ge,we.escaped=!0),ee--,ee===0&&q()})},0))}),ee===0&&q();return}try{var ve=Ee.lex(de,re);return re.walkTokens&&Te.walkTokens(ve,re.walkTokens),be.parse(ve,re)}catch(we){if(we.message+=`
|
|
Please report this to https://github.com/markedjs/marked.`,re.silent)return"<p>An error occurred:</p><pre>"+Oe(we.message+"",!0)+"</pre>";throw we}}Te.options=Te.setOptions=function(de){return xe(Te.defaults,de),Ue(Te.defaults),Te},Te.getDefaults=Se,Te.defaults=Be,Te.use=function(de){var re=xe({},de);if(de.renderer&&function(){var z=Te.defaults.renderer||new pe,Q=function(ve){var we=z[ve];z[ve]=function(){for(var Fe=arguments.length,Ge=new Array(Fe),Je=0;Je<Fe;Je++)Ge[Je]=arguments[Je];var ze=de.renderer[ve].apply(z,Ge);return ze===!1&&(ze=we.apply(z,Ge)),ze}};for(var q in de.renderer)Q(q);re.renderer=z}(),de.tokenizer&&function(){var z=Te.defaults.tokenizer||new ce,Q=function(ve){var we=z[ve];z[ve]=function(){for(var Fe=arguments.length,Ge=new Array(Fe),Je=0;Je<Fe;Je++)Ge[Je]=arguments[Je];var ze=de.tokenizer[ve].apply(z,Ge);return ze===!1&&(ze=we.apply(z,Ge)),ze}};for(var q in de.tokenizer)Q(q);re.tokenizer=z}(),de.walkTokens){var le=Te.defaults.walkTokens;re.walkTokens=function(z){de.walkTokens(z),le&&le(z)}}Te.setOptions(re)},Te.walkTokens=function(de,re){for(var le=L(de),z;!(z=le()).done;){var Q=z.value;re(Q);switch(Q.type){case"table":{for(var q=L(Q.tokens.header),ee;!(ee=q()).done;){var ve=ee.value;Te.walkTokens(ve,re)}for(var we=L(Q.tokens.cells),Fe;!(Fe=we()).done;)for(var Ge=Fe.value,Je=L(Ge),ze;!(ze=Je()).done;){var qe=ze.value;Te.walkTokens(qe,re)}break}case"list":{Te.walkTokens(Q.items,re);break}default:Q.tokens&&Te.walkTokens(Q.tokens,re)}}},Te.Parser=be,Te.parser=be.parse,Te.Renderer=pe,Te.TextRenderer=ge,Te.Lexer=Ee,Te.lexer=Ee.lex,Te.Tokenizer=ce,Te.Slugger=ke,Te.parse=Te;var De=Te;return De})},Etsf:function(Qe,ue,W){"use strict";W.r(ue);var te=W("5Dmo"),H=W("3S7+"),C=W("14J3"),j=W("BMrR"),L=W("jCWc"),R=W("kPKH"),B=W("sPJy"),N=W("bE4q"),e=W("k1fw"),A=W("9og8"),f=W("y8nQ"),p=W("Vl3Y"),o=W("tJVT"),a=W("PpiC"),n=W("WmNS"),l=W.n(n),s=W("q1tI"),r=W.n(s),i=W("55Ip"),t=W("9kvl"),y=W("9Bee"),m=W("xKgJ"),g=W("U/Y8"),E=W.n(g),_=W("Q9mQ"),u=W("diRs"),h=W("miYZ"),c=W("tsqr"),d=W("2qtc"),T=W("kLXV"),b=W("oBTY"),S=W("ozfa"),D=W("MJZm"),I=W("5NDa"),w=W("5rEg"),P=W("jrin"),U=W("nRaC"),O=W("5RzL"),G=W("ErOA"),V=W("Ty5D"),ae=O.a.TreeNode,ie=function(Ae){var Y=Ae.restful,se=Ae.loading,pe=Ae.dispatch,ge=Object(V.i)(),ke=Object(V.h)(),oe=Object(s.useState)(!1),me=Object(o.a)(oe,2),be=me[0],xe=me[1],Ce=Object(s.useState)(),Oe=Object(o.a)(Ce,2),Se=Oe[0],Ue=Oe[1],Be=Y.actionTabs,Te=p.a.useForm(),De=Object(o.a)(Te,1),de=De[0];return Object(s.useEffect)(function(){Y.actionTabs.key=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"&&de.resetFields()},[Y.actionTabs.key]),Y.actionTabs.key!=="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"?null:r.a.createElement(T.a,{centered:!0,title:"\u65B0\u5EFA\u76EE\u5F55",visible:Y.actionTabs.key==="\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:be,onOk:Object(A.a)(l.a.mark(function re(){var le,z,Q;return l.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,de.validateFields();case 2:return le=de.getFieldValue(),xe(!0),z="/api/restfuls.json",ee.next=7,Object(G.a)(z,{method:"post",body:Object(e.a)({file_type:1},le)});case 7:Q=ee.sent,Q.status===0&&(c.b.success("\u6DFB\u52A0\u6210\u529F"),pe({type:"restful/setActionTabs",payload:{}}),pe({type:"restful/getRestful"})),xe(!1);case 10:case"end":return ee.stop()}},re)})),onCancel:function(){pe({type:"restful/setActionTabs",payload:{}})}},r.a.createElement("div",{className:"pl30 pr30"},r.a.createElement(p.a,{form:de,initialValues:Object(P.a)({},"name","")},r.a.createElement(p.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u76EE\u5F55\u540D\u79F0"}]},r.a.createElement(j.a,{className:"mt30"},r.a.createElement(R.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),r.a.createElement(R.a,{flex:"1"},r.a.createElement(w.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},fe=Object(t.a)(function(Ee){var Ae=Ee.restful,Y=Ee.loading;return{restful:Ae,loading:Y}})(ie),ce=O.a.TreeNode,J=function(Ae){var Y=Ae.restful,se=Ae.loading,pe=Ae.dispatch,ge=Object(V.i)(),ke=Object(V.h)(),oe=Object(s.useState)(!1),me=Object(o.a)(oe,2),be=me[0],xe=me[1],Ce=Object(s.useState)(),Oe=Object(o.a)(Ce,2),Se=Oe[0],Ue=Oe[1],Be=Y.actionTabs,Te=p.a.useForm(),De=Object(o.a)(Te,1),de=De[0];return Object(s.useEffect)(function(){Y.actionTabs.key=="\u91CD\u547D\u540D"&&(de.resetFields(),de.setFieldsValue({name:Y.actionTabs.data.title}))},[Y.actionTabs.key]),Y.actionTabs.key!=="\u91CD\u547D\u540D"?null:r.a.createElement(T.a,{centered:!0,title:"\u91CD\u547D\u540D",visible:Y.actionTabs.key==="\u91CD\u547D\u540D",okText:"\u786E\u5B9A",cancelText:"\u53D6\u6D88",bodyStyle:{minHeight:150},confirmLoading:be,onOk:Object(A.a)(l.a.mark(function re(){var le,z,Q;return l.a.wrap(function(ee){for(;;)switch(ee.prev=ee.next){case 0:return ee.next=2,de.validateFields();case 2:return le=de.getFieldValue(),xe(!0),z="/api/restfuls/".concat(Y.actionTabs.data.id,".json"),ee.next=7,Object(G.a)(z,{method:"put",body:Object(e.a)({file_type:1},le)});case 7:Q=ee.sent,Q.status===0&&(c.b.success("\u4FEE\u6539\u6210\u529F"),pe({type:"restful/setActionTabs",payload:{}}),pe({type:"restful/getRestful"})),xe(!1);case 10:case"end":return ee.stop()}},re)})),onCancel:function(){pe({type:"restful/setActionTabs",payload:{}})}},r.a.createElement("div",{className:"pl30 pr30"},r.a.createElement(p.a,{form:de,initialValues:Object(P.a)({},"name","")},r.a.createElement(j.a,{className:"mt30"},r.a.createElement(R.a,{flex:"80px",className:"font14"},"\u76EE\u5F55\u540D\u79F0\uFF1A"),r.a.createElement(R.a,{flex:"1"},r.a.createElement(p.a.Item,{name:"name",rules:[{required:!0,message:"\u8BF7\u8F93\u5165\u65B0\u540D\u79F0"}]},r.a.createElement(w.a,{placeholder:"\u8BF7\u8F93\u5165\u540D\u79F0\uFF0C\u6700\u5927\u9650\u523660\u4E2A\u5B57\u7B26 ",maxLength:60})))))))},Z=Object(t.a)(function(Ee){var Ae=Ee.restful,Y=Ee.loading;return{restful:Ae,loading:Y}})(J),he=W("s7vb"),X=W("P48q"),$=W.n(X),ye=w.a.Search,Le=D.a.DirectoryTree,Re=function(Ae){var Y=Ae.user,se=Ae.globalSetting,pe=Ae.loading,ge=Ae.dispatch,ke=Ae.restful,oe=Object(a.a)(Ae,["user","globalSetting","loading","dispatch","restful"]),me=Object(s.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),be=Object(o.a)(me,2),xe=be[0],Ce=be[1],Oe=Object(s.useState)(!0),Se=Object(o.a)(Oe,2),Ue=Se[0],Be=Se[1],Te=p.a.useForm(),De=Object(o.a)(Te,1),de=De[0],re=Object(s.useState)(""),le=Object(o.a)(re,2),z=le[0],Q=le[1],q=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"}]),ee=Object(o.a)(q,1),ve=ee[0],we=Object(s.useState)([]),Fe=Object(o.a)(we,2),Ge=Fe[0],Je=Fe[1],ze=Object(s.useState)([]),qe=Object(o.a)(ze,2),nt=qe[0],$e=qe[1],gt=Object(s.useState)(!1),ht=Object(o.a)(gt,2),bt=ht[0],pt=ht[1],it=Object(s.useState)([]),_t=Object(o.a)(it,2),Tt=_t[0],Ve=_t[1];Object(s.useEffect)(function(){var ut;if((ut=ke.restful)!==null&&ut!==void 0&&ut.data){var tt,Ze,et;Ve(Object(b.a)((tt=ke.restful)===null||tt===void 0?void 0:tt.data));var st=0,ot;if((Ze=ke.restful)===null||Ze===void 0||((et=Ze.data)===null||et===void 0)||et.map(function(lt){var ct;lt.id==oe.match.params.id&&(st=lt.id),lt.file_type==0&&!ot&&(ot=lt.id),lt==null||((ct=lt.children)===null||ct===void 0)||ct.map(function(Ct){ot||(ot=Ct.id),Ct.id==oe.match.params.id&&(st=lt.id)}),!lt.children&&!ot&&(ot=lt.id)}),!oe.match.params.id&&ot){oe.history.push("/ch/rest/".concat(ot));return}st&&setTimeout(function(){Je([st]),$e([Number(oe.match.params.id||ot)])},200)}},[ke.restful]);var At=function(tt,Ze){Ze.node.file_type===0?oe.history.push("/ch/rest/".concat(tt[0])):$e(Object(b.a)(tt)),console.log("Trigger Select",tt,Ze)},We=function(tt){Je(tt),console.log("Trigger Expand",tt)},Ye=function(tt){return r.a.createElement("div",null,ve.map(function(Ze,et){return r.a.createElement("p",{key:Ze.id,className:"current",onClick:function(){switch(Ze.id){case 1:oe.history.push("/ch/rest/edit/".concat(tt.id,"/0"));break;case 2:case 3:ge({type:"restful/setActionTabs",payload:{key:Ze.name,data:tt}});break;case 4:document.location.href="/ch/rest/edit/".concat(tt.pid||0,"/").concat(tt.id);break;case 5:T.a.confirm({title:"\u63D0\u793A",content:"\u662F\u5426\u786E\u5B9A\u5220\u9664\uFF1F",onOk:function(){var ot=Object(A.a)(l.a.mark(function ct(){var Ct;return l.a.wrap(function(Nt){for(;;)switch(Nt.prev=Nt.next){case 0:return Nt.next=2,Object(he.a)({id:tt.id});case 2:Ct=Nt.sent,(Ct==null?void 0:Ct.status)==0&&(c.b.success("\u5220\u9664\u6210\u529F"),ge({type:"restful/getRestful"}));case 4:case"end":return Nt.stop()}},ct)}));function lt(){return ot.apply(this,arguments)}return lt}()});break}}},Ze.name)}).filter(function(Ze){return!!Ze}).filter(function(Ze){return tt.pid||tt.file_type==0?Ze.key>3:Ze.key!=4}))},rt=function ut(tt){return tt.map(function(Ze){var et=Ze.title.indexOf(z),st=Ze.title.substr(0,et),ot=Ze.title.substr(et+z.length),lt=r.a.createElement("span",null,st,r.a.createElement("span",{className:"c-blue"},z),ot,Object(m.o)()&&r.a.createElement(u.a,{placement:"right",title:z,content:function(){return Ye(Ze)},trigger:"hover"},r.a.createElement("span",{className:"iconfont icon-sandian ".concat($.a.actions)})));if(z!==""){var ct;if(et===-1&&!((ct=Ze.children)!==null&&ct!==void 0&&ct.length))return null}return Ze.children&&Ze.file_type===1?Object(e.a)(Object(e.a)({},Ze),{},{title:lt,key:Ze.key,children:ut(Ze.children)}):Object(e.a)(Object(e.a)({},Ze),{},{title:lt,key:Ze.key,isLeaf:!0})}).filter(function(Ze){return!!Ze})},dt=function ut(tt,Ze){for(var et,st=0;st<Ze.length;st++){var ot=Ze[st];ot.children&&(ot.children.some(function(lt){return lt.key===tt})?et=ot.key:ut(tt,ot.children)&&(et=ut(tt,ot.children)))}return et},vt=function(tt){var Ze=tt.target.value,et=Tt.map(function(st){if(st!=null&&st.children){var ot;return st!=null&&(ot=st.children.filter(function(lt){return lt.title.indexOf(Ze)>-1}))!==null&&ot!==void 0&&ot.length?st.id:null}return null});Q(Ze),pt(!0),console.log("expandedKeys:",et),Je(et)};return console.log("loop(treeData):",rt(Tt)),r.a.createElement("div",{className:$.a.tree},r.a.createElement(ye,{style:{marginBottom:8},placeholder:"\u8F93\u5165\u5173\u952E\u5B57\u68C0\u7D22",onChange:vt}),r.a.createElement(Le,{multiple:!0,defaultExpandAll:!0,onSelect:At,onExpand:We,expandedKeys:Ge,selectedKeys:nt,autoExpandParent:bt,treeData:rt(Tt)}),r.a.createElement(fe,null),r.a.createElement(Z,null))},Ie=Object(t.a)(function(Ee){var Ae=Ee.user,Y=Ee.loading,se=Ee.globalSetting,pe=Ee.restful;return{user:Ae,globalSetting:se,restful:pe,loading:Y.models.index}})(Re),Ne=function(Ae){var Y,se,pe=Ae.user,ge=Ae.globalSetting,ke=Ae.loading,oe=Ae.dispatch,me=Ae.restful,be=Object(a.a)(Ae,["user","globalSetting","loading","dispatch","restful"]),xe=Object(s.useState)({content:"",message:"",status:0,contacts:[],address:"",data:[]}),Ce=Object(o.a)(xe,2),Oe=Ce[0],Se=Ce[1],Ue=Object(s.useState)(!0),Be=Object(o.a)(Ue,2),Te=Be[0],De=Be[1],de=p.a.useForm(),re=Object(o.a)(de,1),le=re[0],z=be.match.params,Q=function(){var ve=Object(A.a)(l.a.mark(function we(){return l.a.wrap(function(Ge){for(;;)switch(Ge.prev=Ge.next){case 0:oe({type:"restful/getRestful"}),z.id&&oe({type:"restful/getRestfulDetail",payload:Object(e.a)({},z)});case 2:case"end":return Ge.stop()}},we)}));return function(){return ve.apply(this,arguments)}}();Object(s.useEffect)(function(){De(!0),Q()},[z.id]);var q=function(){oe({type:"restful/setActionTabs",payload:{key:"\u65B0\u5EFA\u540C\u7EA7\u76EE\u5F55"}})},ee=function(){var we;if((we=me.restful)!==null&&we!==void 0&&we.data){var Fe,Ge,Je=0;return(Fe=me.restful)===null||Fe===void 0||((Ge=Fe.data)===null||Ge===void 0)||Ge.map(function(ze){var qe;ze==null||((qe=ze.children)===null||qe===void 0)||qe.map(function(nt){nt.id==be.match.params.id&&(Je=ze.id)}),!ze.children&&!Je&&(Je=ze.id)}),Je}return 0};return r.a.createElement("section",null,r.a.createElement("aside",{className:"edu-container mt20"},r.a.createElement(N.a,null,r.a.createElement(N.a.Item,null,r.a.createElement(i.a,{to:"/"},"\u9996\u9875")),r.a.createElement(N.a.Item,null,r.a.createElement(i.a,{to:"/ch/rest"},"API\u6587\u6863"))),r.a.createElement("div",{className:"mt20"},r.a.createElement(j.a,{gutter:[20,20]},r.a.createElement(R.a,{flex:"300px"},r.a.createElement(Ie,be)),r.a.createElement(R.a,{flex:"1"},r.a.createElement("div",{className:E.a.info},r.a.createElement("h1",{style:{fontSize:28,paddingBottom:15,borderBottom:"1px solid #eaeaea",textAlign:"center"}},(Y=me.restfulDetail)===null||Y===void 0?void 0:Y.name),r.a.createElement(y.a,{value:(se=me.restfulDetail)===null||se===void 0?void 0:se.description}))))),Object(m.o)()&&r.a.createElement("div",{className:E.a.bar},r.a.createElement(j.a,null,!!ee()&&r.a.createElement(R.a,null,r.a.createElement(H.a,{title:"\u7F16\u8F91\u6587\u4EF6"},r.a.createElement(i.a,{to:"/ch/rest/edit/".concat(ee(),"/").concat(be.match.params.id),className:"icon-zhongmingming current"}))),r.a.createElement(R.a,null,r.a.createElement(H.a,{title:"\u6DFB\u52A0\u6587\u4EF6"},r.a.createElement(i.a,{to:"/ch/rest/edit/".concat(ee(),"/0"),className:"icon-tianjiatimu current"}))),r.a.createElement(R.a,null,r.a.createElement(H.a,{title:"\u65B0\u5EFA\u6587\u4EF6\u5939"},r.a.createElement("span",{className:"icon-wenjianjia1 current",onClick:q})))))))},_e=ue.default=Object(t.a)(function(Ee){var Ae=Ee.user,Y=Ee.loading,se=Ee.globalSetting,pe=Ee.restful;return{user:Ae,globalSetting:se,restful:pe,loading:Y.models.index}})(Ne)},FWmy:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return te});function te(H,C){if(!H)throw new Error(C?`Assertion failed (${C})`:"Assertion Failed")}},JYp7:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return te});var te;(function(H){function C(t){return t&&typeof t=="object"&&typeof t[Symbol.iterator]=="function"}H.is=C;const j=Object.freeze([]);function L(){return j}H.empty=L;function*R(t){yield t}H.single=R;function B(t){return t||j}H.from=B;function N(t){return!t||t[Symbol.iterator]().next().done===!0}H.isEmpty=N;function e(t){return t[Symbol.iterator]().next().value}H.first=e;function A(t,y){for(const m of t)if(y(m))return!0;return!1}H.some=A;function f(t,y){for(const m of t)if(y(m))return m;return}H.find=f;function*p(t,y){for(const m of t)y(m)&&(yield m)}H.filter=p;function*o(t,y){let m=0;for(const g of t)yield y(g,m++)}H.map=o;function*a(...t){for(const y of t)for(const m of y)yield m}H.concat=a;function*n(t){for(const y of t)for(const m of y)yield m}H.concatNested=n;function l(t,y,m){let g=m;for(const E of t)g=y(g,E);return g}H.reduce=l;function*s(t,y,m=t.length){for(y<0&&(y+=t.length),m<0?m+=t.length:m>t.length&&(m=t.length);y<m;y++)yield t[y]}H.slice=s;function r(t,y=Number.POSITIVE_INFINITY){const m=[];if(y===0)return[m,t];const g=t[Symbol.iterator]();for(let E=0;E<y;E++){const _=g.next();if(_.done)return[m,H.empty()];m.push(_.value)}return[m,{[Symbol.iterator](){return g}}]}H.consume=r;function i(t,y,m=(g,E)=>g===E){const g=t[Symbol.iterator](),E=y[Symbol.iterator]();for(;;){const _=g.next(),u=E.next();if(_.done!==u.done)return!1;if(_.done)return!0;if(!m(_.value,u.value))return!1}}H.equals=i})(te||(te={}))},MI8n:function(Qe,ue,W){"use strict";W.d(ue,"c",function(){return L}),W.d(ue,"b",function(){return e}),W.d(ue,"e",function(){return A}),W.d(ue,"a",function(){return f}),W.d(ue,"d",function(){return p}),W.d(ue,"f",function(){return o});var te=W("/cxE"),H=W("pmY6"),C=W("24hK"),j=W("5Y4S"),L;(function(a){a.None=()=>H.a.None;function n(S){return(D,I=null,w)=>{let P=!1,U;return U=S(O=>P?void 0:(U?U.dispose():P=!0,D.call(I,O)),null,w),P&&U.dispose(),U}}a.once=n;function l(S,D){return m((I,w=null,P)=>S(U=>I.call(w,D(U)),null,P))}a.map=l;function s(S,D){return m((I,w=null,P)=>S(U=>{D(U),I.call(w,U)},null,P))}a.forEach=s;function r(S,D){return m((I,w=null,P)=>S(U=>D(U)&&I.call(w,U),null,P))}a.filter=r;function i(S){return S}a.signal=i;function t(...S){return(D,I=null,w)=>Object(H.e)(...S.map(P=>P(U=>D.call(I,U),null,w)))}a.any=t;function y(S,D,I){let w=I;return l(S,P=>(w=D(w,P),w))}a.reduce=y;function m(S){let D;const I=new e({onFirstListenerAdd(){D=S(I.fire,I)},onLastListenerRemove(){D.dispose()}});return I.event}function g(S,D,I=100,w=!1,P){let U,O,G,V=0;const ae=new e({leakWarningThreshold:P,onFirstListenerAdd(){U=S(ie=>{V++,O=D(O,ie),w&&!G&&(ae.fire(O),O=void 0),clearTimeout(G),G=setTimeout(()=>{const fe=O;O=void 0,G=void 0,(!w||V>1)&&ae.fire(fe),V=0},I)})},onLastListenerRemove(){U.dispose()}});return ae.event}a.debounce=g;function E(S,D=(I,w)=>I===w){let I=!0,w;return r(S,P=>{const U=I||!D(P,w);return I=!1,w=P,U})}a.latch=E;function _(S,D){return[a.filter(S,D),a.filter(S,I=>!D(I))]}a.split=_;function u(S,D=!1,I=[]){let w=I.slice(),P=S(G=>{w?w.push(G):O.fire(G)});const U=()=>{w&&w.forEach(G=>O.fire(G)),w=null},O=new e({onFirstListenerAdd(){P||(P=S(G=>O.fire(G)))},onFirstListenerDidAdd(){w&&(D?setTimeout(U):U())},onLastListenerRemove(){P&&P.dispose(),P=null}});return O.event}a.buffer=u;class h{constructor(S){this.event=S}map(S){return new h(l(this.event,S))}forEach(S){return new h(s(this.event,S))}filter(S){return new h(r(this.event,S))}reduce(S,D){return new h(y(this.event,S,D))}latch(){return new h(E(this.event))}debounce(S,D=100,I=!1,w){return new h(g(this.event,S,D,I,w))}on(S,D,I){return this.event(S,D,I)}once(S,D,I){return n(this.event)(S,D,I)}}function c(S){return new h(S)}a.chain=c;function d(S,D,I=w=>w){const w=(...G)=>O.fire(I(...G)),P=()=>S.on(D,w),U=()=>S.removeListener(D,w),O=new e({onFirstListenerAdd:P,onLastListenerRemove:U});return O.event}a.fromNodeEventEmitter=d;function T(S,D,I=w=>w){const w=(...G)=>O.fire(I(...G)),P=()=>S.addEventListener(D,w),U=()=>S.removeEventListener(D,w),O=new e({onFirstListenerAdd:P,onLastListenerRemove:U});return O.event}a.fromDOMEventEmitter=T;function b(S){return new Promise(D=>n(S)(D))}a.toPromise=b})(L||(L={}));class R{constructor(a){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${a}_${R._idPool++}`}start(a){this._stopWatch=new j.a(!0),this._listenerCount=a}stop(){if(this._stopWatch){const a=this._stopWatch.elapsed();this._elapsedOverall+=a,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${a.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}R._idPool=0;let B=-1;class N{constructor(a,n=Math.random().toString(18).slice(2,5)){this.customThreshold=a,this.name=n,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(a){let n=B;if(typeof this.customThreshold=="number"&&(n=this.customThreshold),n<=0||a<n)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=n*.5;let r,i=0;for(const[t,y]of this._stacks)(!r||i<y)&&(r=t,i=y);console.warn(`[${this.name}] potential listener LEAK detected, having ${a} listeners already. MOST frequent listener (${i}):`),console.warn(r)}return()=>{const r=this._stacks.get(l)||0;this._stacks.set(l,r-1)}}}class e{constructor(a){var n;this._disposed=!1,this._options=a,this._leakageMon=B>0?new N(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=((n=this._options)===null||n===void 0?void 0:n._profName)?new R(this._options._profName):void 0}get event(){return this._event||(this._event=(a,n,l)=>{var s;this._listeners||(this._listeners=new C.a);const r=this._listeners.isEmpty();r&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const i=this._listeners.push(n?[a,n]:a);r&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,a,n);const t=(s=this._leakageMon)===null||s===void 0?void 0:s.check(this._listeners.size),y=Object(H.i)(()=>{if(t&&t(),!this._disposed&&(i(),this._options&&this._options.onLastListenerRemove)){const m=this._listeners&&!this._listeners.isEmpty();m||this._options.onLastListenerRemove(this)}});return l instanceof H.b?l.add(y):Array.isArray(l)&&l.push(y),y}),this._event}fire(a){var n,l;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new C.a);for(let s of this._listeners)this._deliveryQueue.push([s,a]);for((n=this._perfMon)===null||n===void 0||n.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[s,r]=this._deliveryQueue.shift();try{typeof s=="function"?s.call(void 0,r):s[0].call(s[1],r)}catch(i){Object(te.f)(i)}}(l=this._perfMon)===null||l===void 0||l.stop()}}dispose(){var a,n,l,s,r;this._disposed||(this._disposed=!0,(a=this._listeners)===null||a===void 0||a.clear(),(n=this._deliveryQueue)===null||n===void 0||n.clear(),(s=(l=this._options)===null||l===void 0?void 0:l.onLastListenerRemove)===null||s===void 0||s.call(l),(r=this._leakageMon)===null||r===void 0||r.dispose())}}class A extends e{constructor(a){super(a);this._isPaused=0,this._eventQueue=new C.a,this._mergeFn=a==null?void 0:a.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const a=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(a))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(a){this._listeners&&(this._isPaused!==0?this._eventQueue.push(a):super.fire(a))}}class f extends A{constructor(a){var n;super(a);this._delay=(n=a.delay)!==null&&n!==void 0?n:100}fire(a){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(a)}}class p{constructor(){this.buffers=[]}wrapEvent(a){return(n,l,s)=>a(r=>{const i=this.buffers[this.buffers.length-1];i?i.push(()=>n.call(l,r)):n.call(l,r)},void 0,s)}bufferEvents(a){const n=[];this.buffers.push(n);const l=a();return this.buffers.pop(),n.forEach(s=>s()),l}}class o{constructor(){this.listening=!1,this.inputEvent=L.None,this.inputEventListener=H.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(a){this.inputEvent=a,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=a(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},MNsG:function(Qe,ue,W){"use strict";(function(te,H){W.d(ue,"b",function(){return l}),W.d(ue,"i",function(){return t}),W.d(ue,"f",function(){return y}),W.d(ue,"d",function(){return m}),W.d(ue,"g",function(){return g}),W.d(ue,"h",function(){return E}),W.d(ue,"c",function(){return _}),W.d(ue,"k",function(){return u}),W.d(ue,"j",function(){return h}),W.d(ue,"a",function(){return c}),W.d(ue,"e",function(){return b});var C;const j="en";let L=!1,R=!1,B=!1,N=!1,e=!1,A=!1,f=!1,p,o=j,a,n;const l=typeof self=="object"?self:typeof te=="object"?te:{};let s;typeof l.vscode!="undefined"&&typeof l.vscode.process!="undefined"?s=l.vscode.process:typeof H!="undefined"&&(s=H);const r=typeof((C=s==null?void 0:s.versions)===null||C===void 0?void 0:C.electron)=="string"&&s.type==="renderer";if(typeof navigator=="object"&&!r)n=navigator.userAgent,L=n.indexOf("Windows")>=0,R=n.indexOf("Macintosh")>=0,f=(n.indexOf("Macintosh")>=0||n.indexOf("iPad")>=0||n.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,B=n.indexOf("Linux")>=0,A=!0,p=navigator.language,o=p;else if(typeof s=="object"){L=s.platform==="win32",R=s.platform==="darwin",B=s.platform==="linux",N=B&&!!s.env.SNAP&&!!s.env.SNAP_REVISION,p=j,o=j;const S=s.env.VSCODE_NLS_CONFIG;if(S)try{const D=JSON.parse(S),I=D.availableLanguages["*"];p=D.locale,o=I||j,a=D._translationsConfigFile}catch(D){}e=!0}else console.error("Unable to resolve platform.");let i=0;R?i=1:L?i=3:B&&(i=2);const t=L,y=R,m=B,g=e,E=A,_=f,u=n,h=function(){if(l.setImmediate)return l.setImmediate.bind(l);if(typeof l.postMessage=="function"&&!l.importScripts){let I=[];l.addEventListener("message",P=>{if(P.data&&P.data.vscodeSetImmediateId)for(let U=0,O=I.length;U<O;U++){const G=I[U];if(G.id===P.data.vscodeSetImmediateId){I.splice(U,1),G.callback();return}}});let w=0;return P=>{const U=++w;I.push({id:U,callback:P}),l.postMessage({vscodeSetImmediateId:U},"*")}}if(typeof(s==null?void 0:s.nextTick)=="function")return s.nextTick.bind(s);const D=Promise.resolve();return I=>D.then(I)}(),c=R||f?2:L?1:3;let d=!0,T=!1;function b(){if(!T){T=!0;const S=new Uint8Array(2);S[0]=1,S[1]=2;const D=new Uint16Array(S.buffer);d=D[0]===(2<<8)+1}return d}}).call(this,W("IyRk"),W("Q2Ig"))},N0LK:function(Qe,ue,W){"use strict";W.d(ue,"C",function(){return te}),W.d(ue,"v",function(){return C}),W.d(ue,"s",function(){return j}),W.d(ue,"t",function(){return L}),W.d(ue,"U",function(){return R}),W.d(ue,"J",function(){return B}),W.d(ue,"O",function(){return N}),W.d(ue,"p",function(){return e}),W.d(ue,"T",function(){return A}),W.d(ue,"q",function(){return f}),W.d(ue,"N",function(){return p}),W.d(ue,"M",function(){return o}),W.d(ue,"Q",function(){return a}),W.d(ue,"u",function(){return n}),W.d(ue,"x",function(){return l}),W.d(ue,"I",function(){return s}),W.d(ue,"f",function(){return r}),W.d(ue,"h",function(){return i}),W.d(ue,"g",function(){return t}),W.d(ue,"i",function(){return y}),W.d(ue,"G",function(){return m}),W.d(ue,"H",function(){return g}),W.d(ue,"r",function(){return E}),W.d(ue,"R",function(){return _}),W.d(ue,"d",function(){return u}),W.d(ue,"e",function(){return h}),W.d(ue,"E",function(){return c}),W.d(ue,"F",function(){return d}),W.d(ue,"j",function(){return T}),W.d(ue,"z",function(){return b}),W.d(ue,"K",function(){return D}),W.d(ue,"L",function(){return I}),W.d(ue,"m",function(){return P}),W.d(ue,"k",function(){return O}),W.d(ue,"A",function(){return V}),W.d(ue,"a",function(){return ae}),W.d(ue,"n",function(){return ie}),W.d(ue,"l",function(){return fe}),W.d(ue,"D",function(){return ce}),W.d(ue,"B",function(){return J}),W.d(ue,"b",function(){return Z}),W.d(ue,"S",function(){return he}),W.d(ue,"o",function(){return X}),W.d(ue,"P",function(){return $}),W.d(ue,"w",function(){return ye}),W.d(ue,"c",function(){return Le}),W.d(ue,"y",function(){return Ne});function te(Y){return!Y||typeof Y!="string"?!0:Y.trim().length===0}const H=/{(\d+)}/g;function C(Y,...se){return se.length===0?Y:Y.replace(H,function(pe,ge){const ke=parseInt(ge,10);return isNaN(ke)||ke<0||ke>=se.length?pe:se[ke]})}function j(Y){return Y.replace(/[<>&]/g,function(se){switch(se){case"<":return"<";case">":return">";case"&":return"&";default:return se}})}function L(Y){return Y.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function R(Y,se=" "){const pe=B(Y,se);return N(pe,se)}function B(Y,se){if(!Y||!se)return Y;const pe=se.length;if(pe===0||Y.length===0)return Y;let ge=0;for(;Y.indexOf(se,ge)===ge;)ge=ge+pe;return Y.substring(ge)}function N(Y,se){if(!Y||!se)return Y;const pe=se.length,ge=Y.length;if(pe===0||ge===0)return Y;let ke=ge,oe=-1;for(;!(oe=Y.lastIndexOf(se,ke-1),oe===-1||oe+pe!==ke);){if(oe===0)return"";ke=oe}return Y.substring(0,ke)}function e(Y){return Y.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function A(Y){return Y.replace(/\*/g,"")}function f(Y,se,pe={}){if(!Y)throw new Error("Cannot create regex from empty string");se||(Y=L(Y)),pe.wholeWord&&(/\B/.test(Y.charAt(0))||(Y="\\b"+Y),/\B/.test(Y.charAt(Y.length-1))||(Y=Y+"\\b"));let ge="";return pe.global&&(ge+="g"),pe.matchCase||(ge+="i"),pe.multiline&&(ge+="m"),pe.unicode&&(ge+="u"),new RegExp(Y,ge)}function p(Y){if(Y.source==="^"||Y.source==="^$"||Y.source==="$"||Y.source==="^\\s*$")return!1;const se=Y.exec("");return!!(se&&Y.lastIndex===0)}function o(Y){return(Y.global?"g":"")+(Y.ignoreCase?"i":"")+(Y.multiline?"m":"")+(Y.unicode?"u":"")}function a(Y){return Y.split(/\r\n|\r|\n/)}function n(Y){for(let se=0,pe=Y.length;se<pe;se++){const ge=Y.charCodeAt(se);if(ge!==32&&ge!==9)return se}return-1}function l(Y,se=0,pe=Y.length){for(let ge=se;ge<pe;ge++){const ke=Y.charCodeAt(ge);if(ke!==32&&ke!==9)return Y.substring(se,ge)}return Y.substring(se,pe)}function s(Y,se=Y.length-1){for(let pe=se;pe>=0;pe--){const ge=Y.charCodeAt(pe);if(ge!==32&&ge!==9)return pe}return-1}function r(Y,se){return Y<se?-1:Y>se?1:0}function i(Y,se,pe=0,ge=Y.length,ke=0,oe=se.length){for(;pe<ge&&ke<oe;pe++,ke++){let xe=Y.charCodeAt(pe),Ce=se.charCodeAt(ke);if(xe<Ce)return-1;if(xe>Ce)return 1}const me=ge-pe,be=oe-ke;return me<be?-1:me>be?1:0}function t(Y,se){return y(Y,se,0,Y.length,0,se.length)}function y(Y,se,pe=0,ge=Y.length,ke=0,oe=se.length){for(;pe<ge&&ke<oe;pe++,ke++){let xe=Y.charCodeAt(pe),Ce=se.charCodeAt(ke);if(xe===Ce)continue;if(xe>=128||Ce>=128)return i(Y.toLowerCase(),se.toLowerCase(),pe,ge,ke,oe);m(xe)&&(xe-=32),m(Ce)&&(Ce-=32);const Oe=xe-Ce;if(Oe===0)continue;return Oe}const me=ge-pe,be=oe-ke;return me<be?-1:me>be?1:0}function m(Y){return Y>=97&&Y<=122}function g(Y){return Y>=65&&Y<=90}function E(Y,se){return Y.length===se.length&&y(Y,se)===0}function _(Y,se){const pe=se.length;return se.length>Y.length?!1:y(Y,se,0,pe)===0}function u(Y,se){let pe,ge=Math.min(Y.length,se.length);for(pe=0;pe<ge;pe++)if(Y.charCodeAt(pe)!==se.charCodeAt(pe))return pe;return ge}function h(Y,se){let pe,ge=Math.min(Y.length,se.length);const ke=Y.length-1,oe=se.length-1;for(pe=0;pe<ge;pe++)if(Y.charCodeAt(ke-pe)!==se.charCodeAt(oe-pe))return pe;return ge}function c(Y){return 55296<=Y&&Y<=56319}function d(Y){return 56320<=Y&&Y<=57343}function T(Y,se){return(Y-55296<<10)+(se-56320)+65536}function b(Y,se,pe){const ge=Y.charCodeAt(pe);if(c(ge)&&pe+1<se){const ke=Y.charCodeAt(pe+1);if(d(ke))return T(ge,ke)}return ge}function S(Y,se){const pe=Y.charCodeAt(se-1);if(d(pe)&&se>1){const ge=Y.charCodeAt(se-2);if(c(ge))return T(ge,pe)}return pe}function D(Y,se){const pe=Re.getInstance(),ge=se,ke=Y.length,oe=b(Y,ke,se);se+=oe>=65536?2:1;let me=pe.getGraphemeBreakType(oe);for(;se<ke;){const be=b(Y,ke,se),xe=pe.getGraphemeBreakType(be);if(Le(me,xe))break;se+=be>=65536?2:1,me=xe}return se-ge}function I(Y,se){const pe=Re.getInstance(),ge=se,ke=S(Y,se);se-=ke>=65536?2:1;let oe=pe.getGraphemeBreakType(ke);for(;se>0;){const me=S(Y,se),be=pe.getGraphemeBreakType(me);if(Le(be,oe))break;se-=me>=65536?2:1,oe=be}return ge-se}const w=/(?:[\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 P(Y){return w.test(Y)}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 O(Y){return U.test(Y)}const G=/^[\t\n\r\x20-\x7E]*$/;function V(Y){return G.test(Y)}const ae=/[\u2028\u2029]/;function ie(Y){return ae.test(Y)}function fe(Y){for(let se=0,pe=Y.length;se<pe;se++)if(ce(Y.charCodeAt(se)))return!0;return!1}function ce(Y){return Y=+Y,Y>=11904&&Y<=55215||Y>=63744&&Y<=64255||Y>=65281&&Y<=65374}function J(Y){return Y>=127462&&Y<=127487||Y===8986||Y===8987||Y===9200||Y===9203||Y>=9728&&Y<=10175||Y===11088||Y===11093||Y>=127744&&Y<=128591||Y>=128640&&Y<=128764||Y>=128992&&Y<=129003||Y>=129280&&Y<=129535||Y>=129648&&Y<=129750}const Z=String.fromCharCode(65279);function he(Y){return!!(Y&&Y.length>0&&Y.charCodeAt(0)===65279)}function X(Y,se=!1){return Y?(se&&(Y=Y.replace(/\\./g,"")),Y.toLowerCase()!==Y):!1}function $(Y){const se=90-65+1;return Y=Y%(2*se),Y<se?String.fromCharCode(97+Y):String.fromCharCode(65+Y-se)}function ye(Y){const se=Re.getInstance();return se.getGraphemeBreakType(Y)}function Le(Y,se){return Y===0?se!==5&&se!==7:Y===2&&se===3?!1:Y===4||Y===2||Y===3||(se===4||se===2||se===3)?!0:Y===8&&(se===8||se===9||se===11||se===12)||((Y===11||Y===9)&&(se===9||se===10)||((Y===12||Y===10)&&se===10||(se===5||se===13||(se===7||(Y===1||Y===13&&se===14)))))?!1:!(Y===6&&se===6)}class Re{constructor(){this._data=Ie()}static getInstance(){return Re._INSTANCE||(Re._INSTANCE=new Re),Re._INSTANCE}getGraphemeBreakType(Y){if(Y<32)return Y===10?3:Y===13?2:4;if(Y<127)return 0;const se=this._data,pe=se.length/3;let ge=1;for(;ge<=pe;)if(Y<se[3*ge])ge=2*ge;else if(Y>se[3*ge+1])ge=2*ge+1;else return se[3*ge+2];return 0}}Re._INSTANCE=null;function Ie(){return JSON.parse("[0,0,0,51592,51592,11,44424,44424,11,72251,72254,5,7150,7150,7,48008,48008,11,55176,55176,11,128420,128420,14,3276,3277,5,9979,9980,14,46216,46216,11,49800,49800,11,53384,53384,11,70726,70726,5,122915,122916,5,129320,129327,14,2558,2558,5,5906,5908,5,9762,9763,14,43360,43388,8,45320,45320,11,47112,47112,11,48904,48904,11,50696,50696,11,52488,52488,11,54280,54280,11,70082,70083,1,71350,71350,7,73111,73111,5,127892,127893,14,128726,128727,14,129473,129474,14,2027,2035,5,2901,2902,5,3784,3789,5,6754,6754,5,8418,8420,5,9877,9877,14,11088,11088,14,44008,44008,5,44872,44872,11,45768,45768,11,46664,46664,11,47560,47560,11,48456,48456,11,49352,49352,11,50248,50248,11,51144,51144,11,52040,52040,11,52936,52936,11,53832,53832,11,54728,54728,11,69811,69814,5,70459,70460,5,71096,71099,7,71998,71998,5,72874,72880,5,119149,119149,7,127374,127374,14,128335,128335,14,128482,128482,14,128765,128767,14,129399,129400,14,129680,129685,14,1476,1477,5,2377,2380,7,2759,2760,5,3137,3140,7,3458,3459,7,4153,4154,5,6432,6434,5,6978,6978,5,7675,7679,5,9723,9726,14,9823,9823,14,9919,9923,14,10035,10036,14,42736,42737,5,43596,43596,5,44200,44200,11,44648,44648,11,45096,45096,11,45544,45544,11,45992,45992,11,46440,46440,11,46888,46888,11,47336,47336,11,47784,47784,11,48232,48232,11,48680,48680,11,49128,49128,11,49576,49576,11,50024,50024,11,50472,50472,11,50920,50920,11,51368,51368,11,51816,51816,11,52264,52264,11,52712,52712,11,53160,53160,11,53608,53608,11,54056,54056,11,54504,54504,11,54952,54952,11,68108,68111,5,69933,69940,5,70197,70197,7,70498,70499,7,70845,70845,5,71229,71229,5,71727,71735,5,72154,72155,5,72344,72345,5,73023,73029,5,94095,94098,5,121403,121452,5,126981,127182,14,127538,127546,14,127990,127990,14,128391,128391,14,128445,128449,14,128500,128505,14,128752,128752,14,129160,129167,14,129356,129356,14,129432,129442,14,129648,129651,14,129751,131069,14,173,173,4,1757,1757,1,2274,2274,1,2494,2494,5,2641,2641,5,2876,2876,5,3014,3016,7,3262,3262,7,3393,3396,5,3570,3571,7,3968,3972,5,4228,4228,7,6086,6086,5,6679,6680,5,6912,6915,5,7080,7081,5,7380,7392,5,8252,8252,14,9096,9096,14,9748,9749,14,9784,9786,14,9833,9850,14,9890,9894,14,9938,9938,14,9999,9999,14,10085,10087,14,12349,12349,14,43136,43137,7,43454,43456,7,43755,43755,7,44088,44088,11,44312,44312,11,44536,44536,11,44760,44760,11,44984,44984,11,45208,45208,11,45432,45432,11,45656,45656,11,45880,45880,11,46104,46104,11,46328,46328,11,46552,46552,11,46776,46776,11,47000,47000,11,47224,47224,11,47448,47448,11,47672,47672,11,47896,47896,11,48120,48120,11,48344,48344,11,48568,48568,11,48792,48792,11,49016,49016,11,49240,49240,11,49464,49464,11,49688,49688,11,49912,49912,11,50136,50136,11,50360,50360,11,50584,50584,11,50808,50808,11,51032,51032,11,51256,51256,11,51480,51480,11,51704,51704,11,51928,51928,11,52152,52152,11,52376,52376,11,52600,52600,11,52824,52824,11,53048,53048,11,53272,53272,11,53496,53496,11,53720,53720,11,53944,53944,11,54168,54168,11,54392,54392,11,54616,54616,11,54840,54840,11,55064,55064,11,65438,65439,5,69633,69633,5,69837,69837,1,70018,70018,7,70188,70190,7,70368,70370,7,70465,70468,7,70712,70719,5,70835,70840,5,70850,70851,5,71132,71133,5,71340,71340,7,71458,71461,5,71985,71989,7,72002,72002,7,72193,72202,5,72281,72283,5,72766,72766,7,72885,72886,5,73104,73105,5,92912,92916,5,113824,113827,4,119173,119179,5,121505,121519,5,125136,125142,5,127279,127279,14,127489,127490,14,127570,127743,14,127900,127901,14,128254,128254,14,128369,128370,14,128400,128400,14,128425,128432,14,128468,128475,14,128489,128494,14,128715,128720,14,128745,128745,14,128759,128760,14,129004,129023,14,129296,129304,14,129340,129342,14,129388,129392,14,129404,129407,14,129454,129455,14,129485,129487,14,129659,129663,14,129719,129727,14,917536,917631,5,13,13,2,1160,1161,5,1564,1564,4,1807,1807,1,2085,2087,5,2363,2363,7,2402,2403,5,2507,2508,7,2622,2624,7,2691,2691,7,2786,2787,5,2881,2884,5,3006,3006,5,3072,3072,5,3170,3171,5,3267,3268,7,3330,3331,7,3406,3406,1,3538,3540,5,3655,3662,5,3897,3897,5,4038,4038,5,4184,4185,5,4352,4447,8,6068,6069,5,6155,6157,5,6448,6449,7,6742,6742,5,6783,6783,5,6966,6970,5,7042,7042,7,7143,7143,7,7212,7219,5,7412,7412,5,8206,8207,4,8294,8303,4,8596,8601,14,9410,9410,14,9742,9742,14,9757,9757,14,9770,9770,14,9794,9794,14,9828,9828,14,9855,9855,14,9882,9882,14,9900,9903,14,9929,9933,14,9963,9967,14,9987,9988,14,10006,10006,14,10062,10062,14,10175,10175,14,11744,11775,5,42607,42607,5,43043,43044,7,43263,43263,5,43444,43445,7,43569,43570,5,43698,43700,5,43766,43766,5,44032,44032,11,44144,44144,11,44256,44256,11,44368,44368,11,44480,44480,11,44592,44592,11,44704,44704,11,44816,44816,11,44928,44928,11,45040,45040,11,45152,45152,11,45264,45264,11,45376,45376,11,45488,45488,11,45600,45600,11,45712,45712,11,45824,45824,11,45936,45936,11,46048,46048,11,46160,46160,11,46272,46272,11,46384,46384,11,46496,46496,11,46608,46608,11,46720,46720,11,46832,46832,11,46944,46944,11,47056,47056,11,47168,47168,11,47280,47280,11,47392,47392,11,47504,47504,11,47616,47616,11,47728,47728,11,47840,47840,11,47952,47952,11,48064,48064,11,48176,48176,11,48288,48288,11,48400,48400,11,48512,48512,11,48624,48624,11,48736,48736,11,48848,48848,11,48960,48960,11,49072,49072,11,49184,49184,11,49296,49296,11,49408,49408,11,49520,49520,11,49632,49632,11,49744,49744,11,49856,49856,11,49968,49968,11,50080,50080,11,50192,50192,11,50304,50304,11,50416,50416,11,50528,50528,11,50640,50640,11,50752,50752,11,50864,50864,11,50976,50976,11,51088,51088,11,51200,51200,11,51312,51312,11,51424,51424,11,51536,51536,11,51648,51648,11,51760,51760,11,51872,51872,11,51984,51984,11,52096,52096,11,52208,52208,11,52320,52320,11,52432,52432,11,52544,52544,11,52656,52656,11,52768,52768,11,52880,52880,11,52992,52992,11,53104,53104,11,53216,53216,11,53328,53328,11,53440,53440,11,53552,53552,11,53664,53664,11,53776,53776,11,53888,53888,11,54000,54000,11,54112,54112,11,54224,54224,11,54336,54336,11,54448,54448,11,54560,54560,11,54672,54672,11,54784,54784,11,54896,54896,11,55008,55008,11,55120,55120,11,64286,64286,5,66272,66272,5,68900,68903,5,69762,69762,7,69817,69818,5,69927,69931,5,70003,70003,5,70070,70078,5,70094,70094,7,70194,70195,7,70206,70206,5,70400,70401,5,70463,70463,7,70475,70477,7,70512,70516,5,70722,70724,5,70832,70832,5,70842,70842,5,70847,70848,5,71088,71089,7,71102,71102,7,71219,71226,5,71231,71232,5,71342,71343,7,71453,71455,5,71463,71467,5,71737,71738,5,71995,71996,5,72000,72000,7,72145,72147,7,72160,72160,5,72249,72249,7,72273,72278,5,72330,72342,5,72752,72758,5,72850,72871,5,72882,72883,5,73018,73018,5,73031,73031,5,73109,73109,5,73461,73462,7,94031,94031,5,94192,94193,7,119142,119142,7,119155,119162,4,119362,119364,5,121476,121476,5,122888,122904,5,123184,123190,5,126976,126979,14,127184,127231,14,127344,127345,14,127405,127461,14,127514,127514,14,127561,127567,14,127778,127779,14,127896,127896,14,127985,127986,14,127995,127999,5,128326,128328,14,128360,128366,14,128378,128378,14,128394,128397,14,128405,128406,14,128422,128423,14,128435,128443,14,128453,128464,14,128479,128480,14,128484,128487,14,128496,128498,14,128640,128709,14,128723,128724,14,128736,128741,14,128747,128748,14,128755,128755,14,128762,128762,14,128981,128991,14,129096,129103,14,129292,129292,14,129311,129311,14,129329,129330,14,129344,129349,14,129360,129374,14,129394,129394,14,129402,129402,14,129413,129425,14,129445,129450,14,129466,129471,14,129483,129483,14,129511,129535,14,129653,129655,14,129667,129670,14,129705,129711,14,129731,129743,14,917505,917505,4,917760,917999,5,10,10,3,127,159,4,768,879,5,1471,1471,5,1536,1541,1,1648,1648,5,1767,1768,5,1840,1866,5,2070,2073,5,2137,2139,5,2307,2307,7,2366,2368,7,2382,2383,7,2434,2435,7,2497,2500,5,2519,2519,5,2563,2563,7,2631,2632,5,2677,2677,5,2750,2752,7,2763,2764,7,2817,2817,5,2879,2879,5,2891,2892,7,2914,2915,5,3008,3008,5,3021,3021,5,3076,3076,5,3146,3149,5,3202,3203,7,3264,3265,7,3271,3272,7,3298,3299,5,3390,3390,5,3402,3404,7,3426,3427,5,3535,3535,5,3544,3550,7,3635,3635,7,3763,3763,7,3893,3893,5,3953,3966,5,3981,3991,5,4145,4145,7,4157,4158,5,4209,4212,5,4237,4237,5,4520,4607,10,5970,5971,5,6071,6077,5,6089,6099,5,6277,6278,5,6439,6440,5,6451,6456,7,6683,6683,5,6744,6750,5,6765,6770,7,6846,6846,5,6964,6964,5,6972,6972,5,7019,7027,5,7074,7077,5,7083,7085,5,7146,7148,7,7154,7155,7,7222,7223,5,7394,7400,5,7416,7417,5,8204,8204,5,8233,8233,4,8288,8292,4,8413,8416,5,8482,8482,14,8986,8987,14,9193,9203,14,9654,9654,14,9733,9733,14,9745,9745,14,9752,9752,14,9760,9760,14,9766,9766,14,9774,9775,14,9792,9792,14,9800,9811,14,9825,9826,14,9831,9831,14,9852,9853,14,9872,9873,14,9880,9880,14,9885,9887,14,9896,9897,14,9906,9916,14,9926,9927,14,9936,9936,14,9941,9960,14,9974,9974,14,9982,9985,14,9992,9997,14,10002,10002,14,10017,10017,14,10055,10055,14,10071,10071,14,10145,10145,14,11013,11015,14,11503,11505,5,12334,12335,5,12951,12951,14,42612,42621,5,43014,43014,5,43047,43047,7,43204,43205,5,43335,43345,5,43395,43395,7,43450,43451,7,43561,43566,5,43573,43574,5,43644,43644,5,43710,43711,5,43758,43759,7,44005,44005,5,44012,44012,7,44060,44060,11,44116,44116,11,44172,44172,11,44228,44228,11,44284,44284,11,44340,44340,11,44396,44396,11,44452,44452,11,44508,44508,11,44564,44564,11,44620,44620,11,44676,44676,11,44732,44732,11,44788,44788,11,44844,44844,11,44900,44900,11,44956,44956,11,45012,45012,11,45068,45068,11,45124,45124,11,45180,45180,11,45236,45236,11,45292,45292,11,45348,45348,11,45404,45404,11,45460,45460,11,45516,45516,11,45572,45572,11,45628,45628,11,45684,45684,11,45740,45740,11,45796,45796,11,45852,45852,11,45908,45908,11,45964,45964,11,46020,46020,11,46076,46076,11,46132,46132,11,46188,46188,11,46244,46244,11,46300,46300,11,46356,46356,11,46412,46412,11,46468,46468,11,46524,46524,11,46580,46580,11,46636,46636,11,46692,46692,11,46748,46748,11,46804,46804,11,46860,46860,11,46916,46916,11,46972,46972,11,47028,47028,11,47084,47084,11,47140,47140,11,47196,47196,11,47252,47252,11,47308,47308,11,47364,47364,11,47420,47420,11,47476,47476,11,47532,47532,11,47588,47588,11,47644,47644,11,47700,47700,11,47756,47756,11,47812,47812,11,47868,47868,11,47924,47924,11,47980,47980,11,48036,48036,11,48092,48092,11,48148,48148,11,48204,48204,11,48260,48260,11,48316,48316,11,48372,48372,11,48428,48428,11,48484,48484,11,48540,48540,11,48596,48596,11,48652,48652,11,48708,48708,11,48764,48764,11,48820,48820,11,48876,48876,11,48932,48932,11,48988,48988,11,49044,49044,11,49100,49100,11,49156,49156,11,49212,49212,11,49268,49268,11,49324,49324,11,49380,49380,11,49436,49436,11,49492,49492,11,49548,49548,11,49604,49604,11,49660,49660,11,49716,49716,11,49772,49772,11,49828,49828,11,49884,49884,11,49940,49940,11,49996,49996,11,50052,50052,11,50108,50108,11,50164,50164,11,50220,50220,11,50276,50276,11,50332,50332,11,50388,50388,11,50444,50444,11,50500,50500,11,50556,50556,11,50612,50612,11,50668,50668,11,50724,50724,11,50780,50780,11,50836,50836,11,50892,50892,11,50948,50948,11,51004,51004,11,51060,51060,11,51116,51116,11,51172,51172,11,51228,51228,11,51284,51284,11,51340,51340,11,51396,51396,11,51452,51452,11,51508,51508,11,51564,51564,11,51620,51620,11,51676,51676,11,51732,51732,11,51788,51788,11,51844,51844,11,51900,51900,11,51956,51956,11,52012,52012,11,52068,52068,11,52124,52124,11,52180,52180,11,52236,52236,11,52292,52292,11,52348,52348,11,52404,52404,11,52460,52460,11,52516,52516,11,52572,52572,11,52628,52628,11,52684,52684,11,52740,52740,11,52796,52796,11,52852,52852,11,52908,52908,11,52964,52964,11,53020,53020,11,53076,53076,11,53132,53132,11,53188,53188,11,53244,53244,11,53300,53300,11,53356,53356,11,53412,53412,11,53468,53468,11,53524,53524,11,53580,53580,11,53636,53636,11,53692,53692,11,53748,53748,11,53804,53804,11,53860,53860,11,53916,53916,11,53972,53972,11,54028,54028,11,54084,54084,11,54140,54140,11,54196,54196,11,54252,54252,11,54308,54308,11,54364,54364,11,54420,54420,11,54476,54476,11,54532,54532,11,54588,54588,11,54644,54644,11,54700,54700,11,54756,54756,11,54812,54812,11,54868,54868,11,54924,54924,11,54980,54980,11,55036,55036,11,55092,55092,11,55148,55148,11,55216,55238,9,65056,65071,5,65529,65531,4,68097,68099,5,68159,68159,5,69446,69456,5,69688,69702,5,69808,69810,7,69815,69816,7,69821,69821,1,69888,69890,5,69932,69932,7,69957,69958,7,70016,70017,5,70067,70069,7,70079,70080,7,70089,70092,5,70095,70095,5,70191,70193,5,70196,70196,5,70198,70199,5,70367,70367,5,70371,70378,5,70402,70403,7,70462,70462,5,70464,70464,5,70471,70472,7,70487,70487,5,70502,70508,5,70709,70711,7,70720,70721,7,70725,70725,7,70750,70750,5,70833,70834,7,70841,70841,7,70843,70844,7,70846,70846,7,70849,70849,7,71087,71087,5,71090,71093,5,71100,71101,5,71103,71104,5,71216,71218,7,71227,71228,7,71230,71230,7,71339,71339,5,71341,71341,5,71344,71349,5,71351,71351,5,71456,71457,7,71462,71462,7,71724,71726,7,71736,71736,7,71984,71984,5,71991,71992,7,71997,71997,7,71999,71999,1,72001,72001,1,72003,72003,5,72148,72151,5,72156,72159,7,72164,72164,7,72243,72248,5,72250,72250,1,72263,72263,5,72279,72280,7,72324,72329,1,72343,72343,7,72751,72751,7,72760,72765,5,72767,72767,5,72873,72873,7,72881,72881,7,72884,72884,7,73009,73014,5,73020,73021,5,73030,73030,1,73098,73102,7,73107,73108,7,73110,73110,7,73459,73460,5,78896,78904,4,92976,92982,5,94033,94087,7,94180,94180,5,113821,113822,5,119141,119141,5,119143,119145,5,119150,119154,5,119163,119170,5,119210,119213,5,121344,121398,5,121461,121461,5,121499,121503,5,122880,122886,5,122907,122913,5,122918,122922,5,123628,123631,5,125252,125258,5,126980,126980,14,127183,127183,14,127245,127247,14,127340,127343,14,127358,127359,14,127377,127386,14,127462,127487,6,127491,127503,14,127535,127535,14,127548,127551,14,127568,127569,14,127744,127777,14,127780,127891,14,127894,127895,14,127897,127899,14,127902,127984,14,127987,127989,14,127991,127994,14,128000,128253,14,128255,128317,14,128329,128334,14,128336,128359,14,128367,128368,14,128371,128377,14,128379,128390,14,128392,128393,14,128398,128399,14,128401,128404,14,128407,128419,14,128421,128421,14,128424,128424,14,128433,128434,14,128444,128444,14,128450,128452,14,128465,128467,14,128476,128478,14,128481,128481,14,128483,128483,14,128488,128488,14,128495,128495,14,128499,128499,14,128506,128591,14,128710,128714,14,128721,128722,14,128725,128725,14,128728,128735,14,128742,128744,14,128746,128746,14,128749,128751,14,128753,128754,14,128756,128758,14,128761,128761,14,128763,128764,14,128884,128895,14,128992,129003,14,129036,129039,14,129114,129119,14,129198,129279,14,129293,129295,14,129305,129310,14,129312,129319,14,129328,129328,14,129331,129338,14,129343,129343,14,129351,129355,14,129357,129359,14,129375,129387,14,129393,129393,14,129395,129398,14,129401,129401,14,129403,129403,14,129408,129412,14,129426,129431,14,129443,129444,14,129451,129453,14,129456,129465,14,129472,129472,14,129475,129482,14,129484,129484,14,129488,129510,14,129536,129647,14,129652,129652,14,129656,129658,14,129664,129666,14,129671,129679,14,129686,129704,14,129712,129718,14,129728,129730,14,129744,129750,14,917504,917504,4,917506,917535,4,917632,917759,4,918000,921599,4,0,9,4,11,12,4,14,31,4,169,169,14,174,174,14,1155,1159,5,1425,1469,5,1473,1474,5,1479,1479,5,1552,1562,5,1611,1631,5,1750,1756,5,1759,1764,5,1770,1773,5,1809,1809,5,1958,1968,5,2045,2045,5,2075,2083,5,2089,2093,5,2259,2273,5,2275,2306,5,2362,2362,5,2364,2364,5,2369,2376,5,2381,2381,5,2385,2391,5,2433,2433,5,2492,2492,5,2495,2496,7,2503,2504,7,2509,2509,5,2530,2531,5,2561,2562,5,2620,2620,5,2625,2626,5,2635,2637,5,2672,2673,5,2689,2690,5,2748,2748,5,2753,2757,5,2761,2761,7,2765,2765,5,2810,2815,5,2818,2819,7,2878,2878,5,2880,2880,7,2887,2888,7,2893,2893,5,2903,2903,5,2946,2946,5,3007,3007,7,3009,3010,7,3018,3020,7,3031,3031,5,3073,3075,7,3134,3136,5,3142,3144,5,3157,3158,5,3201,3201,5,3260,3260,5,3263,3263,5,3266,3266,5,3270,3270,5,3274,3275,7,3285,3286,5,3328,3329,5,3387,3388,5,3391,3392,7,3398,3400,7,3405,3405,5,3415,3415,5,3457,3457,5,3530,3530,5,3536,3537,7,3542,3542,5,3551,3551,5,3633,3633,5,3636,3642,5,3761,3761,5,3764,3772,5,3864,3865,5,3895,3895,5,3902,3903,7,3967,3967,7,3974,3975,5,3993,4028,5,4141,4144,5,4146,4151,5,4155,4156,7,4182,4183,7,4190,4192,5,4226,4226,5,4229,4230,5,4253,4253,5,4448,4519,9,4957,4959,5,5938,5940,5,6002,6003,5,6070,6070,7,6078,6085,7,6087,6088,7,6109,6109,5,6158,6158,4,6313,6313,5,6435,6438,7,6441,6443,7,6450,6450,5,6457,6459,5,6681,6682,7,6741,6741,7,6743,6743,7,6752,6752,5,6757,6764,5,6771,6780,5,6832,6845,5,6847,6848,5,6916,6916,7,6965,6965,5,6971,6971,7,6973,6977,7,6979,6980,7,7040,7041,5,7073,7073,7,7078,7079,7,7082,7082,7,7142,7142,5,7144,7145,5,7149,7149,5,7151,7153,5,7204,7211,7,7220,7221,7,7376,7378,5,7393,7393,7,7405,7405,5,7415,7415,7,7616,7673,5,8203,8203,4,8205,8205,13,8232,8232,4,8234,8238,4,8265,8265,14,8293,8293,4,8400,8412,5,8417,8417,5,8421,8432,5,8505,8505,14,8617,8618,14,9000,9000,14,9167,9167,14,9208,9210,14,9642,9643,14,9664,9664,14,9728,9732,14,9735,9741,14,9743,9744,14,9746,9746,14,9750,9751,14,9753,9756,14,9758,9759,14,9761,9761,14,9764,9765,14,9767,9769,14,9771,9773,14,9776,9783,14,9787,9791,14,9793,9793,14,9795,9799,14,9812,9822,14,9824,9824,14,9827,9827,14,9829,9830,14,9832,9832,14,9851,9851,14,9854,9854,14,9856,9861,14,9874,9876,14,9878,9879,14,9881,9881,14,9883,9884,14,9888,9889,14,9895,9895,14,9898,9899,14,9904,9905,14,9917,9918,14,9924,9925,14,9928,9928,14,9934,9935,14,9937,9937,14,9939,9940,14,9961,9962,14,9968,9973,14,9975,9978,14,9981,9981,14,9986,9986,14,9989,9989,14,9998,9998,14,10000,10001,14,10004,10004,14,10013,10013,14,10024,10024,14,10052,10052,14,10060,10060,14,10067,10069,14,10083,10084,14,10133,10135,14,10160,10160,14,10548,10549,14,11035,11036,14,11093,11093,14,11647,11647,5,12330,12333,5,12336,12336,14,12441,12442,5,12953,12953,14,42608,42610,5,42654,42655,5,43010,43010,5,43019,43019,5,43045,43046,5,43052,43052,5,43188,43203,7,43232,43249,5,43302,43309,5,43346,43347,7,43392,43394,5,43443,43443,5,43446,43449,5,43452,43453,5,43493,43493,5,43567,43568,7,43571,43572,7,43587,43587,5,43597,43597,7,43696,43696,5,43703,43704,5,43713,43713,5,43756,43757,5,43765,43765,7,44003,44004,7,44006,44007,7,44009,44010,7,44013,44013,5,44033,44059,12,44061,44087,12,44089,44115,12,44117,44143,12,44145,44171,12,44173,44199,12,44201,44227,12,44229,44255,12,44257,44283,12,44285,44311,12,44313,44339,12,44341,44367,12,44369,44395,12,44397,44423,12,44425,44451,12,44453,44479,12,44481,44507,12,44509,44535,12,44537,44563,12,44565,44591,12,44593,44619,12,44621,44647,12,44649,44675,12,44677,44703,12,44705,44731,12,44733,44759,12,44761,44787,12,44789,44815,12,44817,44843,12,44845,44871,12,44873,44899,12,44901,44927,12,44929,44955,12,44957,44983,12,44985,45011,12,45013,45039,12,45041,45067,12,45069,45095,12,45097,45123,12,45125,45151,12,45153,45179,12,45181,45207,12,45209,45235,12,45237,45263,12,45265,45291,12,45293,45319,12,45321,45347,12,45349,45375,12,45377,45403,12,45405,45431,12,45433,45459,12,45461,45487,12,45489,45515,12,45517,45543,12,45545,45571,12,45573,45599,12,45601,45627,12,45629,45655,12,45657,45683,12,45685,45711,12,45713,45739,12,45741,45767,12,45769,45795,12,45797,45823,12,45825,45851,12,45853,45879,12,45881,45907,12,45909,45935,12,45937,45963,12,45965,45991,12,45993,46019,12,46021,46047,12,46049,46075,12,46077,46103,12,46105,46131,12,46133,46159,12,46161,46187,12,46189,46215,12,46217,46243,12,46245,46271,12,46273,46299,12,46301,46327,12,46329,46355,12,46357,46383,12,46385,46411,12,46413,46439,12,46441,46467,12,46469,46495,12,46497,46523,12,46525,46551,12,46553,46579,12,46581,46607,12,46609,46635,12,46637,46663,12,46665,46691,12,46693,46719,12,46721,46747,12,46749,46775,12,46777,46803,12,46805,46831,12,46833,46859,12,46861,46887,12,46889,46915,12,46917,46943,12,46945,46971,12,46973,46999,12,47001,47027,12,47029,47055,12,47057,47083,12,47085,47111,12,47113,47139,12,47141,47167,12,47169,47195,12,47197,47223,12,47225,47251,12,47253,47279,12,47281,47307,12,47309,47335,12,47337,47363,12,47365,47391,12,47393,47419,12,47421,47447,12,47449,47475,12,47477,47503,12,47505,47531,12,47533,47559,12,47561,47587,12,47589,47615,12,47617,47643,12,47645,47671,12,47673,47699,12,47701,47727,12,47729,47755,12,47757,47783,12,47785,47811,12,47813,47839,12,47841,47867,12,47869,47895,12,47897,47923,12,47925,47951,12,47953,47979,12,47981,48007,12,48009,48035,12,48037,48063,12,48065,48091,12,48093,48119,12,48121,48147,12,48149,48175,12,48177,48203,12,48205,48231,12,48233,48259,12,48261,48287,12,48289,48315,12,48317,48343,12,48345,48371,12,48373,48399,12,48401,48427,12,48429,48455,12,48457,48483,12,48485,48511,12,48513,48539,12,48541,48567,12,48569,48595,12,48597,48623,12,48625,48651,12,48653,48679,12,48681,48707,12,48709,48735,12,48737,48763,12,48765,48791,12,48793,48819,12,48821,48847,12,48849,48875,12,48877,48903,12,48905,48931,12,48933,48959,12,48961,48987,12,48989,49015,12,49017,49043,12,49045,49071,12,49073,49099,12,49101,49127,12,49129,49155,12,49157,49183,12,49185,49211,12,49213,49239,12,49241,49267,12,49269,49295,12,49297,49323,12,49325,49351,12,49353,49379,12,49381,49407,12,49409,49435,12,49437,49463,12,49465,49491,12,49493,49519,12,49521,49547,12,49549,49575,12,49577,49603,12,49605,49631,12,49633,49659,12,49661,49687,12,49689,49715,12,49717,49743,12,49745,49771,12,49773,49799,12,49801,49827,12,49829,49855,12,49857,49883,12,49885,49911,12,49913,49939,12,49941,49967,12,49969,49995,12,49997,50023,12,50025,50051,12,50053,50079,12,50081,50107,12,50109,50135,12,50137,50163,12,50165,50191,12,50193,50219,12,50221,50247,12,50249,50275,12,50277,50303,12,50305,50331,12,50333,50359,12,50361,50387,12,50389,50415,12,50417,50443,12,50445,50471,12,50473,50499,12,50501,50527,12,50529,50555,12,50557,50583,12,50585,50611,12,50613,50639,12,50641,50667,12,50669,50695,12,50697,50723,12,50725,50751,12,50753,50779,12,50781,50807,12,50809,50835,12,50837,50863,12,50865,50891,12,50893,50919,12,50921,50947,12,50949,50975,12,50977,51003,12,51005,51031,12,51033,51059,12,51061,51087,12,51089,51115,12,51117,51143,12,51145,51171,12,51173,51199,12,51201,51227,12,51229,51255,12,51257,51283,12,51285,51311,12,51313,51339,12,51341,51367,12,51369,51395,12,51397,51423,12,51425,51451,12,51453,51479,12,51481,51507,12,51509,51535,12,51537,51563,12,51565,51591,12,51593,51619,12,51621,51647,12,51649,51675,12,51677,51703,12,51705,51731,12,51733,51759,12,51761,51787,12,51789,51815,12,51817,51843,12,51845,51871,12,51873,51899,12,51901,51927,12,51929,51955,12,51957,51983,12,51985,52011,12,52013,52039,12,52041,52067,12,52069,52095,12,52097,52123,12,52125,52151,12,52153,52179,12,52181,52207,12,52209,52235,12,52237,52263,12,52265,52291,12,52293,52319,12,52321,52347,12,52349,52375,12,52377,52403,12,52405,52431,12,52433,52459,12,52461,52487,12,52489,52515,12,52517,52543,12,52545,52571,12,52573,52599,12,52601,52627,12,52629,52655,12,52657,52683,12,52685,52711,12,52713,52739,12,52741,52767,12,52769,52795,12,52797,52823,12,52825,52851,12,52853,52879,12,52881,52907,12,52909,52935,12,52937,52963,12,52965,52991,12,52993,53019,12,53021,53047,12,53049,53075,12,53077,53103,12,53105,53131,12,53133,53159,12,53161,53187,12,53189,53215,12,53217,53243,12,53245,53271,12,53273,53299,12,53301,53327,12,53329,53355,12,53357,53383,12,53385,53411,12,53413,53439,12,53441,53467,12,53469,53495,12,53497,53523,12,53525,53551,12,53553,53579,12,53581,53607,12,53609,53635,12,53637,53663,12,53665,53691,12,53693,53719,12,53721,53747,12,53749,53775,12,53777,53803,12,53805,53831,12,53833,53859,12,53861,53887,12,53889,53915,12,53917,53943,12,53945,53971,12,53973,53999,12,54001,54027,12,54029,54055,12,54057,54083,12,54085,54111,12,54113,54139,12,54141,54167,12,54169,54195,12,54197,54223,12,54225,54251,12,54253,54279,12,54281,54307,12,54309,54335,12,54337,54363,12,54365,54391,12,54393,54419,12,54421,54447,12,54449,54475,12,54477,54503,12,54505,54531,12,54533,54559,12,54561,54587,12,54589,54615,12,54617,54643,12,54645,54671,12,54673,54699,12,54701,54727,12,54729,54755,12,54757,54783,12,54785,54811,12,54813,54839,12,54841,54867,12,54869,54895,12,54897,54923,12,54925,54951,12,54953,54979,12,54981,55007,12,55009,55035,12,55037,55063,12,55065,55091,12,55093,55119,12,55121,55147,12,55149,55175,12,55177,55203,12,55243,55291,10,65024,65039,5,65279,65279,4,65520,65528,4,66045,66045,5,66422,66426,5,68101,68102,5,68152,68154,5,68325,68326,5,69291,69292,5,69632,69632,7,69634,69634,7,69759,69761,5]")}function Ne(Y,se){if(Y===0)return 0;const pe=_e(Y,se);if(pe!==void 0)return pe;const ge=S(se,Y);return Y-=Ee(ge),Y}function _e(Y,se){let pe=S(se,Y);for(Y-=Ee(pe);Ae(pe)||pe===65039||pe===8419;){if(Y===0)return;pe=S(se,Y),Y-=Ee(pe)}if(!J(pe))return;if(Y>=0){const ge=S(se,Y);ge===8205&&(Y-=Ee(ge))}return Y}function Ee(Y){return Y>=65536?2:1}function Ae(Y){return 127995<=Y&&Y<=127999}},NvD2:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return R});var te=W("Kwbf");function H(B,N){var e=new Set;return B.forEach(function(A){N.has(A)||e.add(A)}),e}function C(B){var N=B||{},e=N.disabled,A=N.disableCheckbox,f=N.checkable;return!!(e||A)||f===!1}function j(B,N,e,A){for(var f=new Set(B),p=new Set,o=0;o<=e;o+=1){var a=N.get(o)||new Set;a.forEach(function(r){var i=r.key,t=r.node,y=r.children,m=y===void 0?[]:y;f.has(i)&&!A(t)&&m.filter(function(g){return!A(g.node)}).forEach(function(g){f.add(g.key)})})}for(var n=new Set,l=e;l>=0;l-=1){var s=N.get(l)||new Set;s.forEach(function(r){var i=r.parent,t=r.node;if(A(t)||!r.parent||n.has(r.parent.key))return;if(A(r.parent.node)){n.add(i.key);return}var y=!0,m=!1;(i.children||[]).filter(function(g){return!A(g.node)}).forEach(function(g){var E=g.key,_=f.has(E);y&&!_&&(y=!1),!m&&(_||p.has(E))&&(m=!0)}),y&&f.add(i.key),m&&p.add(i.key),n.add(i.key)})}return{checkedKeys:Array.from(f),halfCheckedKeys:Array.from(H(p,f))}}function L(B,N,e,A,f){for(var p=new Set(B),o=new Set(N),a=0;a<=A;a+=1){var n=e.get(a)||new Set;n.forEach(function(i){var t=i.key,y=i.node,m=i.children,g=m===void 0?[]:m;!p.has(t)&&!o.has(t)&&!f(y)&&g.filter(function(E){return!f(E.node)}).forEach(function(E){p.delete(E.key)})})}o=new Set;for(var l=new Set,s=A;s>=0;s-=1){var r=e.get(s)||new Set;r.forEach(function(i){var t=i.parent,y=i.node;if(f(y)||!i.parent||l.has(i.parent.key))return;if(f(i.parent.node)){l.add(t.key);return}var m=!0,g=!1;(t.children||[]).filter(function(E){return!f(E.node)}).forEach(function(E){var _=E.key,u=p.has(_);m&&!u&&(m=!1),!g&&(u||o.has(_))&&(g=!0)}),m||p.delete(t.key),g&&o.add(t.key),l.add(t.key)})}return{checkedKeys:Array.from(p),halfCheckedKeys:Array.from(H(o,p))}}function R(B,N,e,A){var f=[],p;A?p=A:p=C;var o=new Set(B.filter(function(s){var r=!!e[s];return r||f.push(s),r})),a=new Map,n=0;Object.keys(e).forEach(function(s){var r=e[s],i=r.level,t=a.get(i);t||(t=new Set,a.set(i,t)),t.add(r),n=Math.max(n,i)}),Object(te.a)(!f.length,"Tree missing follow keys: ".concat(f.slice(0,100).map(function(s){return"'".concat(s,"'")}).join(", ")));var l;return N===!0?l=j(o,a,n,p):l=L(o,N.halfCheckedKeys,a,n,p),l}},OZM5:function(Qe,ue,W){"use strict";W.d(ue,"b",function(){return A}),W.d(ue,"a",function(){return f}),W.d(ue,"k",function(){return p}),W.d(ue,"h",function(){return o}),W.d(ue,"i",function(){return a}),W.d(ue,"g",function(){return n}),W.d(ue,"c",function(){return l}),W.d(ue,"d",function(){return s}),W.d(ue,"j",function(){return t}),W.d(ue,"e",function(){return y}),W.d(ue,"f",function(){return m});var te=W("KQm4"),H=W("U8pU"),C=W("Ff2n"),j=W("q1tI"),L=W.n(j),R=W("Kwbf"),B=W("WaYH"),N=.25,e=2;function A(g,E){var _=g.slice(),u=_.indexOf(E);return u>=0&&_.splice(u,1),_}function f(g,E){var _=g.slice();return _.indexOf(E)===-1&&_.push(E),_}function p(g){return g.split("-")}function o(g,E){return"".concat(g,"-").concat(E)}function a(g){return g&&g.type&&g.type.isTreeNode}function n(g,E){var _=[g],u=E[g];function h(){var c=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];c.forEach(function(d){var T=d.key,b=d.children;_.push(T),h(b)})}return h(u.children),_}function l(g,E){var _=g.clientY,u=E.selectHandle.getBoundingClientRect(),h=u.top,c=u.bottom,d=u.height,T=Math.max(d*N,e);return _<=h+T?-1:_>=c-T?1:0}function s(g,E){if(!g)return;var _=E.multiple;return _?g.slice():g.length?[g[0]]:g}var r=function(E){return E};function i(g,E){if(!g)return[];var _=E||{},u=_.processProps,h=u===void 0?r:u,c=Array.isArray(g)?g:[g];return c.map(function(d){var T=d.children,b=Object(C.a)(d,["children"]),S=i(T,E);return L.a.createElement(B.a,Object.assign({},h(b)),S)})}function t(g){if(!g)return null;var E;if(Array.isArray(g))E={checkedKeys:g,halfCheckedKeys:void 0};else if(Object(H.a)(g)==="object")E={checkedKeys:g.checked||void 0,halfCheckedKeys:g.halfChecked||void 0};else return Object(R.a)(!1,"`checkedKeys` is not an array or an object"),null;return E}function y(g,E){var _=new Set;function u(h){if(_.has(h))return;var c=E[h];if(!c)return;_.add(h);var d=c.parent,T=c.node;if(T.disabled)return;d&&u(d.key)}return(g||[]).forEach(function(h){u(h)}),Object(te.a)(_)}function m(g){var E={};return Object.keys(g).forEach(function(_){(_.startsWith("data-")||_.startsWith("aria-"))&&(E[_]=g[_])}),E}},P48q:function(Qe,ue,W){Qe.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(Qe,ue){/**
|
|
* @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 W,te,H,C=!1,j,L;window.PR_SHOULD_USE_CONTINUATION=!0;var R,B;(function(){var N=window,e=["break,continue,do,else,for,if,return,while"],A=[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"],f=[A,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],p=[f,"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=[f,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],a=[f,"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"],n="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=[f,"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",r=[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"],i=[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"],y=[p,a,o,l,s,r,i,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/,g="str",E="kwd",_="com",u="typ",h="lit",c="pun",d="pln",T="tag",b="dec",S="src",D="atn",I="atv",w="nocode",P="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function U(_e){for(var Ee=0,Ae=!1,Y=!1,se=0,pe=_e.length;se<pe;++se){var ge=_e[se];if(ge.ignoreCase)Y=!0;else if(/[a-z]/i.test(ge.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Ae=!0,Y=!1;break}}var ke={b:8,t:9,n:10,v:11,f:12,r:13};function oe(Oe){var Se=Oe.charCodeAt(0);if(Se!==92)return Se;var Ue=Oe.charAt(1);return Se=ke[Ue],Se||("0"<=Ue&&Ue<="7"?parseInt(Oe.substring(1),8):Ue==="u"||Ue==="x"?parseInt(Oe.substring(2),16):Oe.charCodeAt(1))}function me(Oe){if(Oe<32)return(Oe<16?"\\x0":"\\x")+Oe.toString(16);var Se=String.fromCharCode(Oe);return Se==="\\"||Se==="-"||Se==="]"||Se==="^"?"\\"+Se:Se}function be(Oe){var Se=Oe.substring(1,Oe.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")),Ue=[],Be=Se[0]==="^",Te=["["];Be&&Te.push("^");for(var De=Be?1:0,de=Se.length;De<de;++De){var re=Se[De];if(/\\[bdsw]/i.test(re))Te.push(re);else{var le=oe(re),z;De+2<de&&Se[De+1]==="-"?(z=oe(Se[De+2]),De+=2):z=le,Ue.push([le,z]),z<65||le>122||(z<65||le>90||Ue.push([Math.max(65,le)|32,Math.min(z,90)|32]),z<97||le>122||Ue.push([Math.max(97,le)&~32,Math.min(z,122)&~32]))}}Ue.sort(function(ve,we){return ve[0]-we[0]||we[1]-ve[1]});for(var Q=[],q=[],De=0;De<Ue.length;++De){var ee=Ue[De];ee[0]<=q[1]+1?q[1]=Math.max(q[1],ee[1]):Q.push(q=ee)}for(var De=0;De<Q.length;++De){var ee=Q[De];Te.push(me(ee[0])),ee[1]>ee[0]&&(ee[1]+1>ee[0]&&Te.push("-"),Te.push(me(ee[1])))}return Te.push("]"),Te.join("")}function xe(Oe){for(var Se=Oe.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")),Ue=Se.length,Be=[],Te=0,De=0;Te<Ue;++Te){var de=Se[Te];if(de==="(")++De;else if(de.charAt(0)==="\\"){var re=+de.substring(1);re&&(re<=De?Be[re]=-1:Se[Te]=me(re))}}for(var Te=1;Te<Be.length;++Te)Be[Te]===-1&&(Be[Te]=++Ee);for(var Te=0,De=0;Te<Ue;++Te){var de=Se[Te];if(de==="(")++De,Be[De]||(Se[Te]="(?:");else if(de.charAt(0)==="\\"){var re=+de.substring(1);re&&re<=De&&(Se[Te]="\\"+Be[re])}}for(var Te=0;Te<Ue;++Te)Se[Te]==="^"&&Se[Te+1]!=="^"&&(Se[Te]="");if(Oe.ignoreCase&&Ae)for(var Te=0;Te<Ue;++Te){var de=Se[Te],le=de.charAt(0);de.length>=2&&le==="["?Se[Te]=be(de):le!=="\\"&&(Se[Te]=de.replace(/[a-zA-Z]/g,function(q){var ee=q.charCodeAt(0);return"["+String.fromCharCode(ee&~32,ee|32)+"]"}))}return Se.join("")}for(var Ce=[],se=0,pe=_e.length;se<pe;++se){var ge=_e[se];if(ge.global||ge.multiline)throw new Error(""+ge);Ce.push("(?:"+xe(ge)+")")}return new RegExp(Ce.join("|"),Y?"gi":"g")}function O(_e,Ee){var Ae=/(?:^|\s)nocode(?:\s|$)/,Y=[],se=0,pe=[],ge=0;function ke(oe){var me=oe.nodeType;if(me==1){if(Ae.test(oe.className))return;for(var be=oe.firstChild;be;be=be.nextSibling)ke(be);var xe=oe.nodeName.toLowerCase();(xe==="br"||xe==="li")&&(Y[ge]=`
|
|
`,pe[ge<<1]=se++,pe[ge++<<1|1]=oe)}else if(me==3||me==4){var Ce=oe.nodeValue;Ce.length&&(Ee?Ce=Ce.replace(/\r\n?/g,`
|
|
`):Ce=Ce.replace(/[ \t\r\n]+/g," "),Y[ge]=Ce,pe[ge<<1]=se,se+=Ce.length,pe[ge++<<1|1]=oe)}}return ke(_e),{sourceCode:Y.join("").replace(/\n$/,""),spans:pe}}function G(_e,Ee,Ae,Y,se){if(!Ae)return;var pe={sourceNode:_e,pre:1,langExtension:null,numberLines:null,sourceCode:Ae,spans:null,basePos:Ee,decorations:null};Y(pe),se.push.apply(se,pe.decorations)}var V=/\S/;function ae(_e){for(var Ee=void 0,Ae=_e.firstChild;Ae;Ae=Ae.nextSibling){var Y=Ae.nodeType;Ee=Y===1?Ee?_e:Ae:Y===3&&V.test(Ae.nodeValue)?_e:Ee}return Ee===_e?void 0:Ee}function ie(_e,Ee){var Ae={},Y;(function(){for(var ge=_e.concat(Ee),ke=[],oe={},me=0,be=ge.length;me<be;++me){var xe=ge[me],Ce=xe[3];if(Ce)for(var Oe=Ce.length;--Oe>=0;)Ae[Ce.charAt(Oe)]=xe;var Se=xe[1],Ue=""+Se;oe.hasOwnProperty(Ue)||(ke.push(Se),oe[Ue]=null)}ke.push(/[\0-\uffff]/),Y=U(ke)})();var se=Ee.length,pe=function(ge){for(var ke=ge.sourceCode,oe=ge.basePos,me=ge.sourceNode,be=[oe,d],xe=0,Ce=ke.match(Y)||[],Oe={},Se=0,Ue=Ce.length;Se<Ue;++Se){var Be=Ce[Se],Te=Oe[Be],De=void 0,de;if(typeof Te=="string")de=!1;else{var re=Ae[Be.charAt(0)];if(re)De=Be.match(re[1]),Te=re[0];else{for(var le=0;le<se;++le)if(re=Ee[le],De=Be.match(re[1]),De){Te=re[0];break}De||(Te=d)}de=Te.length>=5&&Te.substring(0,5)==="lang-",de&&!(De&&typeof De[1]=="string")&&(de=!1,Te=S),de||(Oe[Be]=Te)}var z=xe;if(xe+=Be.length,!de)be.push(oe+z,Te);else{var Q=De[1],q=Be.indexOf(Q),ee=q+Q.length;De[2]&&(ee=Be.length-De[2].length,q=ee-Q.length);var ve=Te.substring(5);G(me,oe+z,Be.substring(0,q),pe,be),G(me,oe+z+q,Q,$(ve,Q),be),G(me,oe+z+ee,Be.substring(ee),pe,be)}}ge.decorations=be};return pe}function fe(_e){var Ee=[],Ae=[];_e.tripleQuotedStrings?Ee.push([g,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):_e.multiLineStrings?Ee.push([g,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):Ee.push([g,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),_e.verbatimStrings&&Ae.push([g,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Y=_e.hashComments;Y&&(_e.cStyleComments?(Y>1?Ee.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):Ee.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Ae.push([g,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):Ee.push([_,/^#[^\r\n]*/,null,"#"])),_e.cStyleComments&&(Ae.push([_,/^\/\/[^\r\n]*/,null]),Ae.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var se=_e.regexLiterals;if(se){var pe=se>1?"":`
|
|
\r`,ge=pe?".":"[\\S\\s]",ke="/(?=[^/*"+pe+"])(?:[^/\\x5B\\x5C"+pe+"]|\\x5C"+ge+"|\\x5B(?:[^\\x5C\\x5D"+pe+"]|\\x5C"+ge+")*(?:\\x5D|$))+/";Ae.push(["lang-regex",RegExp("^"+P+"("+ke+")")])}var oe=_e.types;oe&&Ae.push([u,oe]);var me=(""+_e.keywords).replace(/^ | $/g,"");me.length&&Ae.push([E,new RegExp("^(?:"+me.replace(/[\s,]+/g,"|")+")\\b"),null]),Ee.push([d,/^\s+/,null,` \r
|
|
\xA0`]);var be="^.[^\\s\\w.$@'\"`/\\\\]*";return _e.regexLiterals&&(be+="(?!s*/)"),Ae.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(be),null]),ie(Ee,Ae)}var ce=fe({keywords:y,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function J(_e,Ee,Ae){for(var Y=/(?:^|\s)nocode(?:\s|$)/,se=/\r\n?|\n/,pe=_e.ownerDocument,ge=pe.createElement("li");_e.firstChild;)ge.appendChild(_e.firstChild);var ke=[ge];function oe(Se){var Ue=Se.nodeType;if(Ue==1&&!Y.test(Se.className))if(Se.nodeName==="br")me(Se),Se.parentNode&&Se.parentNode.removeChild(Se);else for(var Be=Se.firstChild;Be;Be=Be.nextSibling)oe(Be);else if((Ue==3||Ue==4)&&Ae){var Te=Se.nodeValue,De=Te.match(se);if(De){var de=Te.substring(0,De.index);Se.nodeValue=de;var re=Te.substring(De.index+De[0].length);if(re){var le=Se.parentNode;le.insertBefore(pe.createTextNode(re),Se.nextSibling)}me(Se),de||Se.parentNode.removeChild(Se)}}}function me(Se){for(;!Se.nextSibling;)if(Se=Se.parentNode,!Se)return;function Ue(De,de){var re=de?De.cloneNode(!1):De,le=De.parentNode;if(le){var z=Ue(le,1),Q=De.nextSibling;z.appendChild(re);for(var q=Q;q;q=Q)Q=q.nextSibling,z.appendChild(q)}return re}for(var Be=Ue(Se.nextSibling,0),Te;(Te=Be.parentNode)&&Te.nodeType===1;)Be=Te;ke.push(Be)}for(var be=0;be<ke.length;++be)oe(ke[be]);Ee===(Ee|0)&&ke[0].setAttribute("value",Ee);var xe=pe.createElement("ol");xe.className="linenums";for(var Ce=Math.max(0,Ee-1|0)||0,be=0,Oe=ke.length;be<Oe;++be)ge=ke[be],ge.className="L"+(be+Ce)%10,ge.firstChild||ge.appendChild(pe.createTextNode("\xA0")),xe.appendChild(ge);_e.appendChild(xe)}function Z(_e){var Ee=/\bMSIE\s(\d+)/.exec(navigator.userAgent);Ee=Ee&&+Ee[1]<=8;var Ae=/\n/g,Y=_e.sourceCode,se=Y.length,pe=0,ge=_e.spans,ke=ge.length,oe=0,me=_e.decorations,be=me.length,xe=0;me[be]=se;var Ce,Oe;for(Oe=Ce=0;Oe<be;)me[Oe]!==me[Oe+2]?(me[Ce++]=me[Oe++],me[Ce++]=me[Oe++]):Oe+=2;for(be=Ce,Oe=Ce=0;Oe<be;){for(var Se=me[Oe],Ue=me[Oe+1],Be=Oe+2;Be+2<=be&&me[Be+1]===Ue;)Be+=2;me[Ce++]=Se,me[Ce++]=Ue,Oe=Be}be=me.length=Ce;var Te=_e.sourceNode,De="";Te&&(De=Te.style.display,Te.style.display="none");try{for(var de=null;oe<ke;){var re=ge[oe],le=ge[oe+2]||se,z=me[xe+2]||se,Be=Math.min(le,z),Q=ge[oe+1],q;if(Q.nodeType!==1&&(q=Y.substring(pe,Be))){Ee&&(q=q.replace(Ae,"\r")),Q.nodeValue=q;var ee=Q.ownerDocument,ve=ee.createElement("span");ve.className=me[xe+1];var we=Q.parentNode;we.replaceChild(ve,Q),ve.appendChild(Q),pe<le&&(ge[oe+1]=Q=ee.createTextNode(Y.substring(Be,le)),we.insertBefore(Q,ve.nextSibling))}pe=Be,pe>=le&&(oe+=2),pe>=z&&(xe+=2)}}finally{Te&&(Te.style.display=De)}}var he={};function X(_e,Ee){for(var Ae=Ee.length;--Ae>=0;){var Y=Ee[Ae];he.hasOwnProperty(Y)?N.console&&console.warn("cannot override language handler %s",Y):he[Y]=_e}}function $(_e,Ee){return _e&&he.hasOwnProperty(_e)||(_e=/^\s*</.test(Ee)?"default-markup":"default-code"),he[_e]}X(ce,["default-code"]),X(ie([],[[d,/^[^<?]+/],[b,/^<!\w[^>]*(?:>|$)/],[_,/^<\!--[\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"]),X(ie([[d,/^[\s]+/,null,` \r
|
|
`],[I,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[T,/^^<\/?[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"]),X(ie([],[[I,/^[\s\S]+/]]),["uq.val"]),X(fe({keywords:p,hashComments:!0,cStyleComments:!0,types:m}),["c","cc","cpp","cxx","cyc","m"]),X(fe({keywords:"null,true,false"}),["json"]),X(fe({keywords:a,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:m}),["cs"]),X(fe({keywords:o,cStyleComments:!0}),["java"]),X(fe({keywords:t,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),X(fe({keywords:r,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),X(fe({keywords:s,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),X(fe({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),X(fe({keywords:l,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),X(fe({keywords:n,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),X(ie([],[[g,/^[\s\S]+/]]),["regex"]);function ye(_e){var Ee=_e.langExtension;try{var Ae=O(_e.sourceNode,_e.pre),Y=Ae.sourceCode;_e.sourceCode=Y,_e.spans=Ae.spans,_e.basePos=0,$(Ee,Y)(_e),Z(_e)}catch(se){N.console&&console.log(se&&se.stack||se)}}function Le(_e,Ee,Ae){var Y=Ae||!1,se=Ee||null,pe=document.createElement("div");pe.innerHTML="<pre>"+_e+"</pre>",pe=pe.firstChild,Y&&J(pe,Y,!0);var ge={langExtension:se,numberLines:Y,sourceNode:pe,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ye(ge),pe.innerHTML}function Re(_e,Ee){var Ae=Ee||document.body,Y=Ae.ownerDocument||document;function se(re){return Ae.getElementsByTagName(re)}for(var pe=[se("pre"),se("code"),se("xmp")],ge=[],ke=0;ke<pe.length;++ke)for(var oe=0,me=pe[ke].length;oe<me;++oe)ge.push(pe[ke][oe]);pe=null;var be=Date;be.now||(be={now:function(){return+new Date}});var xe=0,Ce=/\blang(?:uage)?-([\w.]+)(?!\S)/,Oe=/\bprettyprint\b/,Se=/\bprettyprinted\b/,Ue=/pre|xmp/i,Be=/^code$/i,Te=/^(?:pre|code|xmp)$/i,De={};function de(){for(var re=N.PR_SHOULD_USE_CONTINUATION?be.now()+250:Infinity;xe<ge.length&&be.now()<re;xe++){for(var le=ge[xe],z=De,Q=le;Q=Q.previousSibling;){var q=Q.nodeType,ee=(q===7||q===8)&&Q.nodeValue;if(ee?!/^\??prettify\b/.test(ee):q!==3||/\S/.test(Q.nodeValue))break;if(ee){z={},ee.replace(/\b(\w+)=([\w:.%+-]+)/g,function(pt,it,_t){z[it]=_t});break}}var ve=le.className;if((z!==De||Oe.test(ve))&&!Se.test(ve)){for(var we=!1,Fe=le.parentNode;Fe;Fe=Fe.parentNode){var Ge=Fe.tagName;if(Te.test(Ge)&&Fe.className&&Oe.test(Fe.className)){we=!0;break}}if(!we){le.className+=" prettyprinted";var Je=z.lang;if(!Je){Je=ve.match(Ce);var ze;!Je&&(ze=ae(le))&&Be.test(ze.tagName)&&(Je=ze.className.match(Ce)),Je&&(Je=Je[1])}var qe;if(Ue.test(le.tagName))qe=1;else{var nt=le.currentStyle,$e=Y.defaultView,gt=nt?nt.whiteSpace:$e&&$e.getComputedStyle?$e.getComputedStyle(le,null).getPropertyValue("white-space"):0;qe=gt&>.substring(0,3)==="pre"}var ht=z.linenums;(ht=ht==="true"||+ht)||(ht=ve.match(/\blinenums\b(?::(\d+))?/),ht=ht?ht[1]&&ht[1].length?+ht[1]:!0:!1),ht&&J(le,ht,qe);var bt={langExtension:Je,sourceNode:le,numberLines:ht,pre:qe,sourceCode:null,basePos:null,spans:null,decorations:null};ye(bt)}}}xe<ge.length?N.setTimeout(de,250):typeof _e=="function"&&_e()}de()}var Ie=N.PR={createSimpleLexer:ie,registerLangHandler:X,sourceDecorator:fe,PR_ATTRIB_NAME:D,PR_ATTRIB_VALUE:I,PR_COMMENT:_,PR_DECLARATION:b,PR_KEYWORD:E,PR_LITERAL:h,PR_NOCODE:w,PR_PLAIN:d,PR_PUNCTUATION:c,PR_SOURCE:S,PR_STRING:g,PR_TAG:T,PR_TYPE:u,prettyPrintOne:C?N.prettyPrintOne=Le:R=Le,prettyPrint:B=C?N.prettyPrint=Re:B=Re},Ne=N.define;typeof Ne=="function"&&Ne.amd&&Ne("google-code-prettify",[],function(){return Ie})})()},T8No:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return B}),W.d(ue,"e",function(){return N}),W.d(ue,"c",function(){return c}),W.d(ue,"b",function(){return d}),W.d(ue,"d",function(){return T}),W.d(ue,"f",function(){return D});var te=W("MNsG"),H=W("N0LK"),C=W("Cg/j");let j=te.k||"";const L=new Map;L.set("false",!1),L.set("true",!0),L.set("isMac",te.f),L.set("isLinux",te.d),L.set("isWindows",te.i),L.set("isWeb",te.h),L.set("isMacNative",te.f&&!te.h),L.set("isEdge",j.indexOf("Edg/")>=0),L.set("isFirefox",j.indexOf("Firefox")>=0),L.set("isChrome",j.indexOf("Chrome")>=0),L.set("isSafari",j.indexOf("Safari")>=0);const R=Object.prototype.hasOwnProperty;class B{static has(w){return p.create(w)}static equals(w,P){return o.create(w,P)}static regex(w,P){return g.create(w,P)}static not(w){return s.create(w)}static and(...w){return u.create(w,null)}static or(...w){return h.create(w,null,!0)}static deserialize(w,P=!1){return w?this._deserializeOrExpression(w,P):void 0}static _deserializeOrExpression(w,P){let U=w.split("||");return h.create(U.map(O=>this._deserializeAndExpression(O,P)),null,!0)}static _deserializeAndExpression(w,P){let U=w.split("&&");return u.create(U.map(O=>this._deserializeOne(O,P)),null)}static _deserializeOne(w,P){if(w=w.trim(),w.indexOf("!=")>=0){let U=w.split("!=");return l.create(U[0].trim(),this._deserializeValue(U[1],P))}if(w.indexOf("==")>=0){let U=w.split("==");return o.create(U[0].trim(),this._deserializeValue(U[1],P))}if(w.indexOf("=~")>=0){let U=w.split("=~");return g.create(U[0].trim(),this._deserializeRegexValue(U[1],P))}if(w.indexOf(" in ")>=0){let U=w.split(" in ");return a.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(w)){const U=w.split(">=");return t.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(w)){const U=w.split(">");return i.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(w)){const U=w.split("<=");return m.create(U[0].trim(),U[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(w)){const U=w.split("<");return y.create(U[0].trim(),U[1].trim())}return/^\!\s*/.test(w)?s.create(w.substr(1).trim()):p.create(w)}static _deserializeValue(w,P){if(w=w.trim(),w==="true")return!0;if(w==="false")return!1;let U=/^'([^']*)'$/.exec(w);return U?U[1].trim():w}static _deserializeRegexValue(w,P){if(Object(H.C)(w)){if(P)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let U=w.indexOf("/"),O=w.lastIndexOf("/");if(U===O||U<0){if(P)throw new Error(`bad regexp-value '${w}', missing /-enclosure`);return console.warn(`bad regexp-value '${w}', missing /-enclosure`),null}let G=w.slice(U+1,O),V=w[O+1]==="i"?"i":"";try{return new RegExp(G,V)}catch(ae){if(P)throw new Error(`bad regexp-value '${w}', parse error: ${ae}`);return console.warn(`bad regexp-value '${w}', parse error: ${ae}`),null}}}function N(w,P){const U=w?w.substituteConstants():void 0,O=P?P.substituteConstants():void 0;return!U&&!O?!0:!U||!O?!1:U.equals(O)}function e(w,P){return w.cmp(P)}class A{constructor(){this.type=0}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!1}serialize(){return"false"}keys(){return[]}negate(){return f.INSTANCE}}A.INSTANCE=new A;class f{constructor(){this.type=1}cmp(w){return this.type-w.type}equals(w){return w.type===this.type}substituteConstants(){return this}evaluate(w){return!0}serialize(){return"true"}keys(){return[]}negate(){return A.INSTANCE}}f.INSTANCE=new f;class p{constructor(w,P){this.key=w,this.negated=P,this.type=2}static create(w,P=null){const U=L.get(w);return typeof U=="boolean"?U?f.INSTANCE:A.INSTANCE:new p(w,P)}cmp(w){return w.type!==this.type?this.type-w.type:b(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=L.get(this.key);return typeof w=="boolean"?w?f.INSTANCE:A.INSTANCE:this}evaluate(w){return!!w.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(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=4}static create(w,P,U=null){if(typeof P=="boolean")return P?p.create(w,U):s.create(w,U);const O=L.get(w);if(typeof O=="boolean"){const G=O?"true":"false";return P===G?f.INSTANCE:A.INSTANCE}return new o(w,P,U)}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=L.get(this.key);if(typeof w=="boolean"){const P=w?"true":"false";return this.value===P?f.INSTANCE:A.INSTANCE}return this}evaluate(w){return w.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 a{constructor(w,P){this.key=w,this.valueKey=P,this.type=10,this.negated=null}static create(w,P){return new a(w,P)}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.valueKey,w.key,w.valueKey)}equals(w){return w.type===this.type?this.key===w.key&&this.valueKey===w.valueKey:!1}substituteConstants(){return this}evaluate(w){const P=w.getValue(this.valueKey),U=w.getValue(this.key);return Array.isArray(P)?P.indexOf(U)>=0:typeof U=="string"&&typeof P=="object"&&P!==null?R.call(P,U):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=n.create(this)),this.negated}}class n{constructor(w){this._actual=w,this.type=11}static create(w){return new n(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class l{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=5}static create(w,P,U=null){if(typeof P=="boolean")return P?s.create(w,U):p.create(w,U);const O=L.get(w);if(typeof O=="boolean"){const G=O?"true":"false";return P===G?A.INSTANCE:f.INSTANCE}return new l(w,P,U)}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){const w=L.get(this.key);if(typeof w=="boolean"){const P=w?"true":"false";return this.value===P?A.INSTANCE:f.INSTANCE}return this}evaluate(w){return w.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(w,P){this.key=w,this.negated=P,this.type=3}static create(w,P=null){const U=L.get(w);return typeof U=="boolean"?U?A.INSTANCE:f.INSTANCE:new s(w,P)}cmp(w){return w.type!==this.type?this.type-w.type:b(this.key,w.key)}equals(w){return w.type===this.type?this.key===w.key:!1}substituteConstants(){const w=L.get(this.key);return typeof w=="boolean"?w?A.INSTANCE:f.INSTANCE:this}evaluate(w){return!w.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=p.create(this.key,this)),this.negated}}function r(w,P){if(typeof w=="string"){const U=parseFloat(w);isNaN(U)||(w=U)}return typeof w=="string"||typeof w=="number"?P(w):A.INSTANCE}class i{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=12}static create(w,P,U=null){return r(P,O=>new i(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.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(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=13}static create(w,P,U=null){return r(P,O=>new t(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this.key,this.value,this)),this.negated}}class y{constructor(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=14}static create(w,P,U=null){return r(P,O=>new y(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.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(w,P,U){this.key=w,this.value=P,this.negated=U,this.type=15}static create(w,P,U=null){return r(P,O=>new m(w,O,U))}cmp(w){return w.type!==this.type?this.type-w.type:S(this.key,this.value,w.key,w.value)}equals(w){return w.type===this.type?this.key===w.key&&this.value===w.value:!1}substituteConstants(){return this}evaluate(w){return typeof this.value=="string"?!1:parseFloat(w.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=i.create(this.key,this.value,this)),this.negated}}class g{constructor(w,P){this.key=w,this.regexp=P,this.type=7,this.negated=null}static create(w,P){return new g(w,P)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.key<w.key)return-1;if(this.key>w.key)return 1;const P=this.regexp?this.regexp.source:"",U=w.regexp?w.regexp.source:"";return P<U?-1:P>U?1:0}equals(w){if(w.type===this.type){const P=this.regexp?this.regexp.source:"",U=w.regexp?w.regexp.source:"";return this.key===w.key&&P===U}return!1}substituteConstants(){return this}evaluate(w){let P=w.getValue(this.key);return this.regexp?this.regexp.test(P):!1}serialize(){const w=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${w}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=E.create(this)),this.negated}}class E{constructor(w){this._actual=w,this.type=8}static create(w){return new E(w)}cmp(w){return w.type!==this.type?this.type-w.type:this._actual.cmp(w._actual)}equals(w){return w.type===this.type?this._actual.equals(w._actual):!1}substituteConstants(){return this}evaluate(w){return!this._actual.evaluate(w)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function _(w){let P=null;for(let U=0,O=w.length;U<O;U++){const G=w[U].substituteConstants();if(w[U]!==G&&P===null){P=[];for(let V=0;V<U;V++)P[V]=w[V]}P!==null&&(P[U]=G)}return P===null?w:P}class u{constructor(w,P){this.expr=w,this.negated=P,this.type=6}static create(w,P){return u._normalizeArr(w,P)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let P=0,U=this.expr.length;P<U;P++){const O=e(this.expr[P],w.expr[P]);if(O!==0)return O}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let P=0,U=this.expr.length;P<U;P++)if(!this.expr[P].equals(w.expr[P]))return!1;return!0}return!1}substituteConstants(){const w=_(this.expr);return w===this.expr?this:u.create(w,this.negated)}evaluate(w){for(let P=0,U=this.expr.length;P<U;P++)if(!this.expr[P].evaluate(w))return!1;return!0}static _normalizeArr(w,P){const U=[];let O=!1;for(const G of w){if(!G)continue;if(G.type===1){O=!0;continue}if(G.type===0)return A.INSTANCE;if(G.type===6){U.push(...G.expr);continue}U.push(G)}if(U.length===0&&O)return f.INSTANCE;if(U.length===0)return;if(U.length===1)return U[0];U.sort(e);for(let G=1;G<U.length;G++)U[G-1].equals(U[G])&&(U.splice(G,1),G--);if(U.length===1)return U[0];for(;U.length>1;){const G=U[U.length-1];if(G.type!==9)break;U.pop();const V=U.pop(),ae=U.length===0,ie=h.create(G.expr.map(fe=>u.create([fe,V],null)),null,ae);ie&&(U.push(ie),U.sort(e))}return U.length===1?U[0]:new u(U,P)}serialize(){return this.expr.map(w=>w.serialize()).join(" && ")}keys(){const w=[];for(let P of this.expr)w.push(...P.keys());return w}negate(){if(!this.negated){const w=[];for(let P of this.expr)w.push(P.negate());this.negated=h.create(w,this,!0)}return this.negated}}class h{constructor(w,P){this.expr=w,this.negated=P,this.type=9}static create(w,P,U){return h._normalizeArr(w,P,U)}cmp(w){if(w.type!==this.type)return this.type-w.type;if(this.expr.length<w.expr.length)return-1;if(this.expr.length>w.expr.length)return 1;for(let P=0,U=this.expr.length;P<U;P++){const O=e(this.expr[P],w.expr[P]);if(O!==0)return O}return 0}equals(w){if(w.type===this.type){if(this.expr.length!==w.expr.length)return!1;for(let P=0,U=this.expr.length;P<U;P++)if(!this.expr[P].equals(w.expr[P]))return!1;return!0}return!1}substituteConstants(){const w=_(this.expr);return w===this.expr?this:h.create(w,this.negated,!1)}evaluate(w){for(let P=0,U=this.expr.length;P<U;P++)if(this.expr[P].evaluate(w))return!0;return!1}static _normalizeArr(w,P,U){let O=[],G=!1;if(w){for(let V=0,ae=w.length;V<ae;V++){const ie=w[V];if(!ie)continue;if(ie.type===0){G=!0;continue}if(ie.type===1)return f.INSTANCE;if(ie.type===9){O=O.concat(ie.expr);continue}O.push(ie)}if(O.length===0&&G)return A.INSTANCE;O.sort(e)}if(O.length===0)return;if(O.length===1)return O[0];for(let V=1;V<O.length;V++)O[V-1].equals(O[V])&&(O.splice(V,1),V--);if(O.length===1)return O[0];if(U){for(let V=0;V<O.length;V++)for(let ae=V+1;ae<O.length;ae++)D(O[V],O[ae])&&(O.splice(ae,1),ae--);if(O.length===1)return O[0]}return new h(O,P)}serialize(){return this.expr.map(w=>w.serialize()).join(" || ")}keys(){const w=[];for(let P of this.expr)w.push(...P.keys());return w}negate(){if(!this.negated){let w=[];for(let P of this.expr)w.push(P.negate());for(;w.length>1;){const P=w.shift(),U=w.shift(),O=[];for(const V of I(P))for(const ae of I(U))O.push(u.create([V,ae],null));const G=w.length===0;w.unshift(h.create(O,null,G))}this.negated=w[0]}return this.negated}}class c extends p{constructor(w,P,U){super(w,null);this._defaultValue=P,typeof U=="object"?c._info.push(Object.assign(Object.assign({},U),{key:w})):U!==!0&&c._info.push({key:w,description:U,type:P!=null?typeof P:void 0})}static all(){return c._info.values()}bindTo(w){return w.createKey(this.key,this._defaultValue)}getValue(w){return w.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(w){return o.create(this.key,w)}}c._info=[];const d=Object(C.c)("contextKeyService"),T="setContext";function b(w,P){return w<P?-1:w>P?1:0}function S(w,P,U,O){return w<U?-1:w>U?1:P<O?-1:P>O?1:0}function D(w,P){if(P.type===6&&w.type!==9&&w.type!==6){for(const G of P.expr)if(w.equals(G))return!0}const U=w.negate(),O=I(U).concat(I(P));O.sort(e);for(let G=0;G<O.length;G++){const V=O[G],ae=V.negate();for(let ie=G+1;ie<O.length;ie++){const fe=O[ie];if(ae.equals(fe))return!0}}return!1}function I(w){return w.type===9?w.expr:[w]}},TXwP:function(Qe,ue,W){var te,H;(function(){var C;(function(){"use strict";var L=[,,function(e){function A(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=[]}A.prototype.clone_empty=function(){var o=new A(this.__parent);return o.set_indent(this.__indent_count,this.__alignment_count),o},A.prototype.item=function(o){return o<0?this.__items[this.__items.length+o]:this.__items[o]},A.prototype.has_match=function(o){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(o))return!0;return!1},A.prototype.set_indent=function(o,a){this.is_empty()&&(this.__indent_count=o||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},A.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)},A.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},A.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},A.prototype.is_empty=function(){return this.__items.length===0},A.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},A.prototype.push=function(o){this.__items.push(o);var a=o.lastIndexOf(`
|
|
`);a!==-1?this.__character_count=o.length-a:this.__character_count+=o.length},A.prototype.pop=function(){var o=null;return this.is_empty()||(o=this.__items.pop(),this.__character_count-=o.length),o},A.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},A.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},A.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},A.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 f(o,a){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)),a=a||"",o.indent_level>0&&(a=new Array(o.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}f.prototype.get_indent_size=function(o,a){var n=this.__base_string_length;return a=a||0,o<0&&(n=0),n+=o*this.__indent_size,n+=a,n},f.prototype.get_indent_string=function(o,a){var n=this.__base_string;return a=a||0,o<0&&(o=0,n=""),a+=o*this.__indent_size,this.__ensure_cache(a),n+=this.__cache[a],n},f.prototype.__ensure_cache=function(o){for(;o>=this.__cache.length;)this.__add_column()},f.prototype.__add_column=function(){var o=this.__cache.length,a=0,n="";this.__indent_size&&o>=this.__indent_size&&(a=Math.floor(o/this.__indent_size),o-=a*this.__indent_size,n=new Array(a+1).join(this.__indent_string)),o&&(n+=new Array(o+1).join(" ")),this.__cache.push(n)};function p(o,a){this.__indent_cache=new f(o,a),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 A(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}p.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},p.prototype.get_line_number=function(){return this.__lines.length},p.prototype.get_indent_string=function(o,a){return this.__indent_cache.get_indent_string(o,a)},p.prototype.get_indent_size=function(o,a){return this.__indent_cache.get_indent_size(o,a)},p.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},p.prototype.add_new_line=function(o){return this.is_empty()||!o&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},p.prototype.get_code=function(o){this.trim(!0);var a=this.current_line.pop();a&&(a[a.length-1]===`
|
|
`&&(a=a.replace(/\n+$/g,"")),this.current_line.push(a)),this._end_with_newline&&this.__add_outputline();var n=this.__lines.join(`
|
|
`);return o!==`
|
|
`&&(n=n.replace(/[\n]/g,o)),n},p.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},p.prototype.set_indent=function(o,a){return o=o||0,a=a||0,this.next_line.set_indent(o,a),this.__lines.length>1?(this.current_line.set_indent(o,a),!0):(this.current_line.set_indent(),!1)},p.prototype.add_raw_token=function(o){for(var a=0;a<o.newlines;a++)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},p.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()},p.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(" "))},p.prototype.remove_indent=function(o){for(var a=this.__lines.length;o<a;)this.__lines[o]._remove_indent(),o++;this.current_line._remove_wrap_indent()},p.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},p.prototype.just_added_newline=function(){return this.current_line.is_empty()},p.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},p.prototype.ensure_empty_line_above=function(o,a){for(var n=this.__lines.length-2;n>=0;){var l=this.__lines[n];if(l.is_empty())break;if(l.item(0).indexOf(o)!==0&&l.item(-1)!==a){this.__lines.splice(n+1,0,new A(this)),this.previous_line=this.__lines[this.__lines.length-2];break}n--}},e.exports.Output=p},,,,function(e){function A(o,a){this.raw_options=f(o,a),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"])}A.prototype._get_array=function(o,a){var n=this.raw_options[o],l=a||[];return typeof n=="object"?n!==null&&typeof n.concat=="function"&&(l=n.concat()):typeof n=="string"&&(l=n.split(/[^a-zA-Z0-9_\/\-]+/)),l},A.prototype._get_boolean=function(o,a){var n=this.raw_options[o],l=n===void 0?!!a:!!n;return l},A.prototype._get_characters=function(o,a){var n=this.raw_options[o],l=a||"";return typeof n=="string"&&(l=n.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),l},A.prototype._get_number=function(o,a){var n=this.raw_options[o];a=parseInt(a,10),isNaN(a)&&(a=0);var l=parseInt(n,10);return isNaN(l)&&(l=a),l},A.prototype._get_selection=function(o,a,n){var l=this._get_selection_list(o,a,n);if(l.length!==1)throw new Error("Invalid Option Value: The option '"+o+`' can only be one of the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return l[0]},A.prototype._get_selection_list=function(o,a,n){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(n=n||[a[0]],!this._is_valid_selection(n,a))throw new Error("Invalid Default Value!");var l=this._get_array(o,n);if(!this._is_valid_selection(l,a))throw new Error("Invalid Option Value: The option '"+o+`' can contain only the following values:
|
|
`+a+`
|
|
You passed in: '`+this.raw_options[o]+"'");return l},A.prototype._is_valid_selection=function(o,a){return o.length&&a.length&&!o.some(function(n){return a.indexOf(n)===-1})};function f(o,a){var n={};o=p(o);var l;for(l in o)l!==a&&(n[l]=o[l]);if(a&&o[a])for(l in o[a])n[l]=o[a][l];return n}function p(o){var a={},n;for(n in o){var l=n.replace(/-/g,"_");a[l]=o[n]}return a}e.exports.Options=A,e.exports.normalizeOpts=p,e.exports.mergeOpts=f},,function(e){var A=RegExp.prototype.hasOwnProperty("sticky");function f(p){this.__input=p||"",this.__input_length=this.__input.length,this.__position=0}f.prototype.restart=function(){this.__position=0},f.prototype.back=function(){this.__position>0&&(this.__position-=1)},f.prototype.hasNext=function(){return this.__position<this.__input_length},f.prototype.next=function(){var p=null;return this.hasNext()&&(p=this.__input.charAt(this.__position),this.__position+=1),p},f.prototype.peek=function(p){var o=null;return p=p||0,p+=this.__position,p>=0&&p<this.__input_length&&(o=this.__input.charAt(p)),o},f.prototype.__match=function(p,o){p.lastIndex=o;var a=p.exec(this.__input);return a&&!(A&&p.sticky)&&(a.index!==o&&(a=null)),a},f.prototype.test=function(p,o){return o=o||0,o+=this.__position,o>=0&&o<this.__input_length?!!this.__match(p,o):!1},f.prototype.testChar=function(p,o){var a=this.peek(o);return p.lastIndex=0,a!==null&&p.test(a)},f.prototype.match=function(p){var o=this.__match(p,this.__position);return o?this.__position+=o[0].length:o=null,o},f.prototype.read=function(p,o,a){var n="",l;return p&&(l=this.match(p),l&&(n+=l[0])),o&&(l||!p)&&(n+=this.readUntil(o,a)),n},f.prototype.readUntil=function(p,o){var a="",n=this.__position;p.lastIndex=this.__position;var l=p.exec(this.__input);return l?(n=l.index,o&&(n+=l[0].length)):n=this.__input_length,a=this.__input.substring(this.__position,n),this.__position=n,a},f.prototype.readUntilAfter=function(p){return this.readUntil(p,!0)},f.prototype.get_regexp=function(p,o){var a=null,n="g";return o&&A&&(n="y"),typeof p=="string"&&p!==""?a=new RegExp(p,n):p&&(a=new RegExp(p.source,n)),a},f.prototype.get_literal_regexp=function(p){return RegExp(p.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},f.prototype.peekUntilAfter=function(p){var o=this.__position,a=this.readUntilAfter(p);return this.__position=o,a},f.prototype.lookBack=function(p){var o=this.__position-1;return o>=p.length&&this.__input.substring(o-p.length,o).toLowerCase()===p},e.exports.InputScanner=f},,,,,function(e){function A(f,p){f=typeof f=="string"?f:f.source,p=typeof p=="string"?p:p.source,this.__directives_block_pattern=new RegExp(f+/ beautify( \w+[:]\w+)+ /.source+p,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(f+/\sbeautify\signore:end\s/.source+p,"g")}A.prototype.get_directives=function(f){if(!f.match(this.__directives_block_pattern))return null;var p={};this.__directive_pattern.lastIndex=0;for(var o=this.__directive_pattern.exec(f);o;)p[o[1]]=o[2],o=this.__directive_pattern.exec(f);return p},A.prototype.readIgnored=function(f){return f.readUntilAfter(this.__directives_end_ignore_pattern)},e.exports.Directives=A},,function(e,A,f){var p=f(16).Beautifier,o=f(17).Options;function a(n,l){var s=new p(n,l);return s.beautify()}e.exports=a,e.exports.defaultOptions=function(){return new o}},function(e,A,f){var p=f(17).Options,o=f(2).Output,a=f(8).InputScanner,n=f(13).Directives,l=new n(/\/\*/,/\*\//),s=/\r\n|[\r\n]/,r=/\r\n|[\r\n]/g,i=/\s/,t=/(?:\s|\n)+/g,y=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,m=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function g(E,_){this._source_text=E||"",this._options=new p(_),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"]}g.prototype.eatString=function(E){var _="";for(this._ch=this._input.next();this._ch;){if(_+=this._ch,this._ch==="\\")_+=this._input.next();else if(E.indexOf(this._ch)!==-1||this._ch===`
|
|
`)break;this._ch=this._input.next()}return _},g.prototype.eatWhitespace=function(E){for(var _=i.test(this._input.peek()),u=0;i.test(this._input.peek());)this._ch=this._input.next(),E&&this._ch===`
|
|
`&&((u===0||u<this._options.max_preserve_newlines)&&(u++,this._output.add_new_line(!0)));return _},g.prototype.foundNestedPseudoClass=function(){for(var E=0,_=1,u=this._input.peek(_);u;){if(u==="{")return!0;if(u==="(")E+=1;else if(u===")"){if(E===0)return!1;E-=1}else if(u===";"||u==="}")return!1;_++,u=this._input.peek(_)}return!1},g.prototype.print_string=function(E){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(E)},g.prototype.preserveSingleSpace=function(E){E&&(this._output.space_before_token=!0)},g.prototype.indent=function(){this._indentLevel++},g.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},g.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var E=this._source_text,_=this._options.eol;_==="auto"&&(_=`
|
|
`,E&&s.test(E||"")&&(_=E.match(s)[0])),E=E.replace(r,`
|
|
`);var u=E.match(/^[\t ]*/)[0];this._output=new o(this._options,u),this._input=new a(E),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var h=0,c=!1,d=!1,T=!1,b=!1,S=!1,D=!1,I=this._ch,w=!1,P,U,O;P=this._input.read(t),U=P!=="",O=I,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),I=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var G=this._input.read(y),V=l.get_directives(G);V&&V.ignore==="start"&&(G+=l.readIgnored(this._input)),this.print_string(G),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 ae=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);ae.match(/[ :]$/)&&(ae=this.eatString(": ").replace(/\s$/,""),this.print_string(ae),this._output.space_before_token=!0),ae=ae.replace(/\s$/,""),ae==="extend"?b=!0:ae==="import"&&(S=!0),ae in this.NESTED_AT_RULE?(this._nestedLevel+=1,ae in this.CONDITIONAL_GROUP_RULE&&(T=!0)):!c&&h===0&&ae.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()),T?(T=!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)):(O==="("?this._output.space_before_token=!1:O!==","&&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(),O==="{"&&this._output.trim(!0),S=!1,b=!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 ie=0;ie<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;ie++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[ie])){w=!0;break}(c||T)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!b&&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 fe=O==='"'||O==="'";this.preserveSingleSpace(fe||U),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")w=!1,h===0?(d&&(this.outdent(),d=!1),b=!1,S=!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 ce=!1;this._input.lookBack("with")&&(ce=!0),this.preserveSingleSpace(U||ce),this.print_string(this._ch),d&&O==="$"&&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&&!S&&!b?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&&i.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("="),i.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 J=O==='"'||O==="'";this.preserveSingleSpace(J||U),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
|
|
`&&w&&this._output.add_new_line()}var Z=this._output.get_code(_);return Z},e.exports.Beautifier=g},function(e,A,f){var p=f(6).Options;function o(a){p.call(this,a,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var n=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||n;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 p,e.exports.Options=o}],R={};function B(e){var A=R[e];if(A!==void 0)return A.exports;var f=R[e]={exports:{}};return L[e](f,f.exports,B),f.exports}var N=B(15);C=N})();var j=C;!(te=[],H=function(){return{css_beautify:j}}.apply(ue,te),H!==void 0&&(Qe.exports=H))})()},"U/Y8":function(Qe,ue,W){Qe.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(Qe,ue,W){"use strict";W.d(ue,"d",function(){return j}),W.d(ue,"e",function(){return L}),W.d(ue,"c",function(){return R}),W.d(ue,"b",function(){return B}),W.d(ue,"a",function(){return N});var te=W("MI8n");class H{constructor(){this._icons=new Map,this._onDidRegister=new te.b}add(e){const A=this._icons.get(e.id);A?e.description?A.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 C=new H,j=C;function L(e,A){return new B(e,A)}function R(e){return e?e.replace(/\$\((.*?)\)/g,(A,f)=>` ${f} `).trim():""}class B{constructor(e,A,f){this.id=e,this.definition=A,this.description=f,C.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 A=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function f(a){if(a instanceof B)return["codicon","codicon-"+a.id];const n=A.exec(a.id);if(!n)return f(B.error);let[,l,s]=n;const r=["codicon","codicon-"+l];return s&&r.push("codicon-modifier-"+s.substr(1)),r}e.asClassNameArray=f;function p(a){return f(a).join(" ")}e.asClassName=p;function o(a){return"."+f(a).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"})}(B||(B={}))},WaYH:function(Qe,ue,W){"use strict";var te=W("rePB"),H=W("Ff2n"),C=W("VTBJ"),j=W("1OyB"),L=W("vuIU"),R=W("JX7q"),B=W("Ji7U"),N=W("LK+K"),e=W("q1tI"),A=W("TSYQ"),f=W.n(A),p=W("sboe"),o=W("OZM5"),a=function(E){var _=E.prefixCls,u=E.level,h=E.isStart,c=E.isEnd;if(!u)return null;for(var d="".concat(_,"-indent-unit"),T=[],b=0;b<u;b+=1){var S;T.push(e.createElement("span",{key:b,className:f()(d,(S={},Object(te.a)(S,"".concat(d,"-start"),h[b+1]),Object(te.a)(S,"".concat(d,"-end"),c[b+1]),Object(te.a)(S,"".concat(d,"-end-first-level"),!b&&c[0]),S))}))}return e.createElement("span",{"aria-hidden":"true",className:"".concat(_,"-indent")},T)},n=a,l=W("815F"),s="open",r="close",i="---",t=function(g){Object(B.a)(_,g);var E=Object(N.a)(_);function _(){var u;return Object(j.a)(this,_),u=E.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,T=c.checked,b=u.props.context.onNodeCheck;if(!u.isCheckable()||d)return;h.preventDefault();var S=!T;b(h,Object(l.b)(u.props),S)},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(R.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(R.a)(u))},u.onDragOver=function(h){var c=u.props.context.onNodeDragOver;h.preventDefault(),h.stopPropagation(),c(h,Object(R.a)(u))},u.onDragLeave=function(h){var c=u.props.context.onNodeDragLeave;h.stopPropagation(),c(h,Object(R.a)(u))},u.onDragEnd=function(h){var c=u.props.context.onNodeDragEnd;h.stopPropagation(),u.setState({dragNodeHighlight:!1}),c(h,Object(R.a)(u))},u.onDrop=function(h){var c=u.props.context.onNodeDrop;h.preventDefault(),h.stopPropagation(),u.setState({dragNodeHighlight:!1}),c(h,Object(R.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:r},u.hasChildren=function(){var h=u.props.eventKey,c=u.props.context.keyEntities,d=c[h]||{},T=d.children;return!!(T||[]).length},u.isLeaf=function(){var h=u.props,c=h.isLeaf,d=h.loaded,T=u.props.context.loadData,b=u.hasChildren();return c===!1?!1:c||!T&&!b||T&&d&&!b},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,T=h.loaded,b=u.props.context,S=b.loadData,D=b.onNodeLoad;if(d)return;S&&c&&!u.isLeaf()&&(!u.hasChildren()&&!T&&D(Object(l.b)(u.props)))},u.renderSwitcher=function(){var h=u.props,c=h.expanded,d=h.switcherIcon,T=u.props.context,b=T.prefixCls,S=T.switcherIcon,D=d||S;if(u.isLeaf())return e.createElement("span",{className:f()("".concat(b,"-switcher"),"".concat(b,"-switcher-noop"))},typeof D=="function"?D(Object(C.a)(Object(C.a)({},u.props),{},{isLeaf:!0})):D);var I=f()("".concat(b,"-switcher"),"".concat(b,"-switcher_").concat(c?s:r));return e.createElement("span",{onClick:u.onExpand,className:I},typeof D=="function"?D(Object(C.a)(Object(C.a)({},u.props),{},{isLeaf:!1})):D)},u.renderCheckbox=function(){var h=u.props,c=h.checked,d=h.halfChecked,T=h.disableCheckbox,b=u.props.context.prefixCls,S=u.isDisabled(),D=u.isCheckable();if(!D)return null;var I=typeof D!="boolean"?D:null;return e.createElement("span",{className:f()("".concat(b,"-checkbox"),c&&"".concat(b,"-checkbox-checked"),!c&&d&&"".concat(b,"-checkbox-indeterminate"),(S||T)&&"".concat(b,"-checkbox-disabled")),onClick:u.onCheck},I)},u.renderIcon=function(){var h=u.props.loading,c=u.props.context.prefixCls;return e.createElement("span",{className:f()("".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,T=c.selected,b=c.icon,S=c.loading,D=c.data,I=u.props.context,w=I.prefixCls,P=I.showIcon,U=I.icon,O=I.draggable,G=I.loadData,V=I.titleRender,ae=u.isDisabled(),ie="".concat(w,"-node-content-wrapper"),fe;if(P){var ce=b||U;fe=ce?e.createElement("span",{className:f()("".concat(w,"-iconEle"),"".concat(w,"-icon__customize"))},typeof ce=="function"?ce(u.props):ce):u.renderIcon()}else G&&S&&(fe=u.renderIcon());var J;typeof d=="function"?J=d(D):V?J=V(D):J=d;var Z=e.createElement("span",{className:"".concat(w,"-title")},J);return e.createElement("span",{ref:u.setSelectHandle,title:typeof d=="string"?d:"",className:f()("".concat(ie),"".concat(ie,"-").concat(u.getNodeState()||"normal"),!ae&&(T||h)&&"".concat(w,"-node-selected"),!ae&&O&&"draggable"),draggable:!ae&&O||void 0,"aria-grabbed":!ae&&O||void 0,onMouseEnter:u.onMouseEnter,onMouseLeave:u.onMouseLeave,onContextMenu:u.onContextMenu,onClick:u.onSelectorClick,onDoubleClick:u.onSelectorDoubleClick,onDragStart:O?u.onDragStart:void 0},fe,Z)},u}return Object(L.a)(_,[{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,T=c.className,b=c.style,S=c.dragOver,D=c.dragOverGapTop,I=c.dragOverGapBottom,w=c.isLeaf,P=c.isStart,U=c.isEnd,O=c.expanded,G=c.selected,V=c.checked,ae=c.halfChecked,ie=c.loading,fe=c.domRef,ce=c.active,J=c.onMouseMove,Z=Object(H.a)(c,["eventKey","className","style","dragOver","dragOverGapTop","dragOverGapBottom","isLeaf","isStart","isEnd","expanded","selected","checked","halfChecked","loading","domRef","active","onMouseMove"]),he=this.props.context,X=he.prefixCls,$=he.filterTreeNode,ye=he.draggable,Le=he.keyEntities,Re=this.isDisabled(),Ie=Object(o.f)(Z),Ne=Le[d]||{},_e=Ne.level,Ee=U[U.length-1];return e.createElement("div",Object.assign({ref:fe,className:f()(T,"".concat(X,"-treenode"),(h={},Object(te.a)(h,"".concat(X,"-treenode-disabled"),Re),Object(te.a)(h,"".concat(X,"-treenode-switcher-").concat(O?"open":"close"),!w),Object(te.a)(h,"".concat(X,"-treenode-checkbox-checked"),V),Object(te.a)(h,"".concat(X,"-treenode-checkbox-indeterminate"),ae),Object(te.a)(h,"".concat(X,"-treenode-selected"),G),Object(te.a)(h,"".concat(X,"-treenode-loading"),ie),Object(te.a)(h,"".concat(X,"-treenode-active"),ce),Object(te.a)(h,"".concat(X,"-treenode-leaf-last"),Ee),Object(te.a)(h,"drag-over",!Re&&S),Object(te.a)(h,"drag-over-gap-top",!Re&&D),Object(te.a)(h,"drag-over-gap-bottom",!Re&&I),Object(te.a)(h,"filter-node",$&&$(Object(l.b)(this.props))),h)),style:b,onDragEnter:ye?this.onDragEnter:void 0,onDragOver:ye?this.onDragOver:void 0,onDragLeave:ye?this.onDragLeave:void 0,onDrop:ye?this.onDrop:void 0,onDragEnd:ye?this.onDragEnd:void 0,onMouseMove:J},Ie),e.createElement(n,{prefixCls:X,level:_e,isStart:P,isEnd:U}),this.renderSwitcher(),this.renderCheckbox(),this.renderSelector())}}]),_}(e.Component),y=function(E){return e.createElement(p.a.Consumer,null,function(_){return e.createElement(t,Object.assign({},E,{context:_}))})};y.displayName="TreeNode",y.defaultProps={title:i},y.isTreeNode=1;var m=ue.a=y},Y1PL:function(Qe,ue,W){"use strict";W.r(ue),W.d(ue,"ResizableTextArea",function(){return ae});var te=W("wx14"),H=W("1OyB"),C=W("vuIU"),j=W("Ji7U"),L=W("LK+K"),R=W("q1tI"),B=W("VTBJ"),N=W("rePB"),e=W("Zm9Q"),A=W("Kwbf"),f=W("c+Xe"),p=W("m+aA"),o=W("bdgK"),a=new Map;function n(ce){ce.forEach(function(J){var Z,he=J.target;(Z=a.get(he))===null||Z===void 0||Z.forEach(function(X){return X(he)})})}var l=new o.default(n),s=null,r=null;function i(ce,J){a.has(ce)||(a.set(ce,new Set),l.observe(ce)),a.get(ce).add(J)}function t(ce,J){a.has(ce)&&(a.get(ce).delete(J),a.get(ce).size||(l.unobserve(ce),a.delete(ce)))}var y=function(ce){Object(j.a)(Z,ce);var J=Object(L.a)(Z);function Z(){return Object(H.a)(this,Z),J.apply(this,arguments)}return Object(C.a)(Z,[{key:"render",value:function(){return this.props.children}}]),Z}(R.Component),m=R.createContext(null);function g(ce){var J=ce.children,Z=ce.onBatchResize,he=R.useRef(0),X=R.useRef([]),$=R.useContext(m),ye=R.useCallback(function(Le,Re,Ie){he.current+=1;var Ne=he.current;X.current.push({size:Le,element:Re,data:Ie}),Promise.resolve().then(function(){Ne===he.current&&(Z==null||Z(X.current),X.current=[])}),$==null||$(Le,Re,Ie)},[Z,$]);return R.createElement(m.Provider,{value:ye},J)}function E(ce){var J=ce.children,Z=ce.disabled,he=R.useRef(null),X=R.useRef(null),$=R.useContext(m),ye=R.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),Le=R.isValidElement(J)&&Object(f.c)(J),Re=Le?J.ref:null,Ie=R.useMemo(function(){return Object(f.a)(Re,he)},[Re,he]),Ne=R.useRef(ce);Ne.current=ce;var _e=R.useCallback(function(Ee){var Ae=Ne.current,Y=Ae.onResize,se=Ae.data,pe=Ee.getBoundingClientRect(),ge=pe.width,ke=pe.height,oe=Ee.offsetWidth,me=Ee.offsetHeight,be=Math.floor(ge),xe=Math.floor(ke);if(ye.current.width!==be||ye.current.height!==xe||ye.current.offsetWidth!==oe||ye.current.offsetHeight!==me){var Ce={width:be,height:xe,offsetWidth:oe,offsetHeight:me};ye.current=Ce;var Oe=oe===Math.round(ge)?ge:oe,Se=me===Math.round(ke)?ke:me,Ue=Object(B.a)(Object(B.a)({},Ce),{},{offsetWidth:Oe,offsetHeight:Se});$==null||$(Ue,Ee,se),Y&&Promise.resolve().then(function(){Y(Ue,Ee)})}},[]);return R.useEffect(function(){var Ee=Object(p.a)(he.current)||Object(p.a)(X.current);return Ee&&!Z&&i(Ee,_e),function(){return t(Ee,_e)}},[he.current,Z]),R.createElement(y,{ref:X},Le?R.cloneElement(J,{ref:Ie}):J)}var _="rc-observer-key";function u(ce){var J=ce.children,Z=Object(e.a)(J);return Z.map(function(he,X){var $=(he==null?void 0:he.key)||"".concat(_,"-").concat(X);return R.createElement(E,Object(te.a)({},ce,{key:$}),he)})}u.Collection=g;var h=u,c=W("bT9E"),d=W("TSYQ"),T=W.n(d),b=`
|
|
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
|
|
`,S=["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={},I;function w(ce){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=ce.getAttribute("id")||ce.getAttribute("data-reactid")||ce.getAttribute("name");if(J&&D[Z])return D[Z];var he=window.getComputedStyle(ce),X=he.getPropertyValue("box-sizing")||he.getPropertyValue("-moz-box-sizing")||he.getPropertyValue("-webkit-box-sizing"),$=parseFloat(he.getPropertyValue("padding-bottom"))+parseFloat(he.getPropertyValue("padding-top")),ye=parseFloat(he.getPropertyValue("border-bottom-width"))+parseFloat(he.getPropertyValue("border-top-width")),Le=S.map(function(Ie){return"".concat(Ie,":").concat(he.getPropertyValue(Ie))}).join(";"),Re={sizingStyle:Le,paddingSize:$,borderSize:ye,boxSizing:X};return J&&Z&&(D[Z]=Re),Re}function P(ce){var J=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,Z=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null,he=arguments.length>3&&arguments[3]!==void 0?arguments[3]:null;I||(I=document.createElement("textarea"),I.setAttribute("tab-index","-1"),I.setAttribute("aria-hidden","true"),document.body.appendChild(I)),ce.getAttribute("wrap")?I.setAttribute("wrap",ce.getAttribute("wrap")):I.removeAttribute("wrap");var X=w(ce,J),$=X.paddingSize,ye=X.borderSize,Le=X.boxSizing,Re=X.sizingStyle;I.setAttribute("style","".concat(Re,";").concat(b)),I.value=ce.value||ce.placeholder||"";var Ie=Number.MIN_SAFE_INTEGER,Ne=Number.MAX_SAFE_INTEGER,_e=I.scrollHeight,Ee;if(Le==="border-box"?_e+=ye:Le==="content-box"&&(_e-=$),Z!==null||he!==null){I.value=" ";var Ae=I.scrollHeight-$;Z!==null&&(Ie=Ae*Z,Le==="border-box"&&(Ie=Ie+$+ye),_e=Math.max(Ie,_e)),he!==null&&(Ne=Ae*he,Le==="border-box"&&(Ne=Ne+$+ye),Ee=_e>Ne?"":"hidden",_e=Math.min(Ne,_e))}return{height:_e,minHeight:Ie,maxHeight:Ne,overflowY:Ee,resize:"none"}}var U=W("Gytx"),O=W.n(U),G;(function(ce){ce[ce.NONE=0]="NONE",ce[ce.RESIZING=1]="RESIZING",ce[ce.RESIZED=2]="RESIZED"})(G||(G={}));var V=function(ce){Object(j.a)(Z,ce);var J=Object(L.a)(Z);function Z(he){var X;return Object(H.a)(this,Z),X=J.call(this,he),X.nextFrameActionId=void 0,X.resizeFrameId=void 0,X.textArea=void 0,X.saveTextArea=function($){X.textArea=$},X.handleResize=function($){var ye=X.state.resizeStatus,Le=X.props,Re=Le.autoSize,Ie=Le.onResize;if(ye!==G.NONE)return;typeof Ie=="function"&&Ie($),Re&&X.resizeOnNextFrame()},X.resizeOnNextFrame=function(){cancelAnimationFrame(X.nextFrameActionId),X.nextFrameActionId=requestAnimationFrame(X.resizeTextarea)},X.resizeTextarea=function(){var $=X.props.autoSize;if(!$||!X.textArea)return;var ye=$.minRows,Le=$.maxRows,Re=P(X.textArea,!1,ye,Le);X.setState({textareaStyles:Re,resizeStatus:G.RESIZING},function(){cancelAnimationFrame(X.resizeFrameId),X.resizeFrameId=requestAnimationFrame(function(){X.setState({resizeStatus:G.RESIZED},function(){X.resizeFrameId=requestAnimationFrame(function(){X.setState({resizeStatus:G.NONE}),X.fixFirefoxAutoScroll()})})})})},X.renderTextArea=function(){var $=X.props,ye=$.prefixCls,Le=ye===void 0?"rc-textarea":ye,Re=$.autoSize,Ie=$.onResize,Ne=$.className,_e=$.disabled,Ee=X.state,Ae=Ee.textareaStyles,Y=Ee.resizeStatus,se=Object(c.a)(X.props,["prefixCls","onPressEnter","autoSize","defaultValue","onResize"]),pe=T()(Le,Ne,Object(N.a)({},"".concat(Le,"-disabled"),_e));"value"in se&&(se.value=se.value||"");var ge=Object(B.a)(Object(B.a)(Object(B.a)({},X.props.style),Ae),Y===G.RESIZING?{overflowX:"hidden",overflowY:"hidden"}:null);return R.createElement(h,{onResize:X.handleResize,disabled:!(Re||Ie)},R.createElement("textarea",Object(te.a)({},se,{className:pe,style:ge,ref:X.saveTextArea})))},X.state={textareaStyles:{},resizeStatus:G.NONE},X}return Object(C.a)(Z,[{key:"componentDidUpdate",value:function(X){(X.value!==this.props.value||!O()(X.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 X=this.textArea.selectionStart,$=this.textArea.selectionEnd;this.textArea.setSelectionRange(X,$)}}catch(ye){}}},{key:"render",value:function(){return this.renderTextArea()}}]),Z}(R.Component),ae=V,ie=function(ce){Object(j.a)(Z,ce);var J=Object(L.a)(Z);function Z(he){var X;Object(H.a)(this,Z),X=J.call(this,he),X.resizableTextArea=void 0,X.focus=function(){X.resizableTextArea.textArea.focus()},X.saveTextArea=function(ye){X.resizableTextArea=ye},X.handleChange=function(ye){var Le=X.props.onChange;X.setValue(ye.target.value,function(){X.resizableTextArea.resizeTextarea()}),Le&&Le(ye)},X.handleKeyDown=function(ye){var Le=X.props,Re=Le.onPressEnter,Ie=Le.onKeyDown;ye.keyCode===13&&Re&&Re(ye),Ie&&Ie(ye)};var $=typeof he.value=="undefined"||he.value===null?he.defaultValue:he.value;return X.state={value:$},X}return Object(C.a)(Z,[{key:"setValue",value:function(X,$){"value"in this.props||this.setState({value:X},$)}},{key:"blur",value:function(){this.resizableTextArea.textArea.blur()}},{key:"render",value:function(){return R.createElement(ae,Object(te.a)({},this.props,{value:this.state.value,onKeyDown:this.handleKeyDown,onChange:this.handleChange,ref:this.saveTextArea}))}}],[{key:"getDerivedStateFromProps",value:function(X){return"value"in X?{value:X.value}:null}}]),Z}(R.Component),fe=ue.default=ie},ZW9T:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return U});var te=W("k1fw"),H=W("oBTY"),C=W("miYZ"),j=W("tsqr"),L=W("rAM+"),R=W("tJVT"),B=W("PpiC"),N=W("q1tI"),e=W.n(N),A=W("bdgK"),f=W("9og8"),p=W("WmNS"),o=W.n(p),a={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"]},n={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(`
|
|
`)}]},r=W("5VLF"),i=W.n(r),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"]}},y=function(G,V){return V.map(function(ae){return{label:ae,kind:G.languages.CompletionItemKind.Keyword,insertText:ae}})},m=function(G){return Object.keys(t.tables).map(function(V){return{label:V,kind:G.languages.CompletionItemKind.Variable,insertText:V}})},g=function(G,V){var ae=t.tables[G];return ae?ae.map(function(ie){return{label:ie,kind:V.languages.CompletionItemKind.Field,insertText:ie}}):[]};function E(O,G,V,ae,ie){var fe=G.getWordUntilPosition(V),ce={startLineNumber:V.lineNumber,endLineNumber:V.lineNumber,startColumn:fe.startColumn,endColumn:fe.endColumn},J=ae.map(function(Z){return{label:Z,kind:O.languages.CompletionItemKind.Keyword,insertText:Z,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:ce}});return ie.map(function(Z){J.push(Object(te.a)(Object(te.a)({},Z),{},{range:ce}))}),J}var _=function(O){t.languages.map(function(ie){return O.languages.registerDocumentFormattingEditProvider(ie,{provideDocumentFormattingEdits:function(ce,J,Z){return Object(f.a)(o.a.mark(function he(){var X;return o.a.wrap(function(ye){for(;;)switch(ye.prev=ye.next){case 0:return X=i()(ce.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}),ye.abrupt("return",[{range:ce.getFullModelRange(),text:X}]);case 2:case"end":return ye.stop()}},he)}))()}}),ie});var G=l.quickKey.map(function(ie){return{label:ie.label,kind:O.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),V=s.quickKey.map(function(ie){return{label:ie.label,kind:O.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}}),ae=n.quickKey.map(function(ie){return{label:ie.label,kind:O.languages.CompletionItemKind.Method,insertText:ie.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet}});O.languages.registerCompletionItemProvider("cpp",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},he=fe.getLineContent(ce.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(H.a)(l.keywords.map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Function,documentation:X,insertText:X,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})),Object(H.a)(l.quickKey.map(function(X){return{label:X.label,kind:O.languages.CompletionItemKind.Function,documentation:X.content,insertText:he.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})))}}}),O.languages.registerCompletionItemProvider("c",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn};return{suggestions:Object(H.a)(a.keywords.map(function(he){return{label:he,kind:O.languages.CompletionItemKind.Function,documentation:he,insertText:he,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}}))}}}),O.languages.registerCompletionItemProvider("java",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},he=fe.getLineContent(ce.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(H.a)(n.keywords.map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Function,documentation:X,insertText:X,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})),Object(H.a)(n.quickKey.map(function(X){return{label:X.label,kind:O.languages.CompletionItemKind.Function,documentation:X.content,insertText:he.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})))}}}),O.languages.registerCompletionItemProvider("python",{provideCompletionItems:function(fe,ce){var J=fe.getWordUntilPosition(ce),Z={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:J.startColumn,endColumn:J.endColumn},he=fe.getLineContent(ce.lineNumber).substring(J.startColumn-2,J.endColumn);return{suggestions:[].concat(Object(H.a)(s.keywords.map(function(X){return{label:X,kind:O.languages.CompletionItemKind.Function,documentation:X,insertText:X,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})),Object(H.a)(s.quickKey.map(function(X){return{label:X.label,kind:O.languages.CompletionItemKind.Function,documentation:X.content,insertText:he.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:O.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Z}})))}}})},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=W("fjLI"),c=W("LvDl"),d=W("+ua5");function T(O){return/^\d+$/.test(O)?"".concat(O,"px"):O}function b(){}var S=!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 I(){var O=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],G=O;if(Array.isArray(O)){for(var V=0;V<O.length;V++){var ae=D[O[V]];if(ae)return ae}return G[0]}return D[G]||G}var w=null,P=ue.b=function(O){var G=O.width,V=G===void 0?"100%":G,ae=O.height,ie=ae===void 0?"100%":ae,fe=O.value,ce=O.language,J=ce===void 0?"javascript":ce,Z=O.style,he=Z===void 0?{}:Z,X=O.options,$=X===void 0?{}:X,ye=O.overrideServices,Le=ye===void 0?{}:ye,Re=O.theme,Ie=Re===void 0?"vs-dark":Re,Ne=O.onEditBlur,_e=O.onSave,Ee=O.autoHeight,Ae=Ee===void 0?!1:Ee,Y=O.forbidCopy,se=Y===void 0?!1:Y,pe=O.onChange,ge=pe===void 0?b:pe,ke=O.editorDidMount,oe=ke===void 0?b:ke,me=O.onFocus,be=me===void 0?b:me,xe=O.filename,Ce=xe===void 0?"educoder.txt":xe,Oe=O.errorLine,Se=O.errorContent,Ue=Se===void 0?"":Se,Be=Object(B.a)(O,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","filename","errorLine","errorContent"]),Te=Object(N.useRef)(),De=Object(N.useRef)({}),de=Object(N.useRef)(),re=Object(N.useRef)(),le=Object(N.useRef)(!1),z=Object(N.useRef)(),Q=Object(N.useState)(!1),q=Object(R.a)(Q,2),ee=q[0],ve=q[1];function we(){var We;return Te.current&&(We=new A.default(function(Ye){var rt=Object(L.a)(Ye),dt;try{for(rt.s();!(dt=rt.n()).done;){var vt=dt.value;(vt.target.offsetHeight>0||vt.target.offsetWidth>0)&&De.current.instance.layout()}}catch(ut){rt.e(ut)}finally{rt.f()}}),We.observe(Te.current)),We}function Fe(){j.b.warn(decodeURIComponent(u))}var Ge=function(){var Ye=De.current.instance;if(fe!=null&&Ye&&ee){var rt=Ye.getModel();rt&&fe!==rt.getValue()&&(S=!0,rt.setValue(fe),Ye.layout(),S=!1)}};Object(N.useEffect)(function(){re.current&&clearTimeout(re.current),re.current=setTimeout(function(){Ge()},500)},[fe,ee,De.current]),Object(N.useEffect)(function(){if(Oe&&De.current&&De.current.instance){var We=De.current.instance;We.changeViewZones(function(rt){var dt=document.createElement("div");dt.style.padding="10px 20px",dt.style.width="calc(100% - 20px)",dt.className="my-error-line-wrp",dt.innerHTML=Ue,rt.addZone({afterLineNumber:Oe||11,heightInLines:3,domNode:dt})});var Ye={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}};We.addOverlayWidget(Ye),We.revealPositionInCenter({lineNumber:20,column:1})}},[Oe,De.current,ee]);function Je(){var We=De.current.instance;if(We){var Ye=We.getSelection(),rt=De.current.pastePos||{},dt=new w.Range(rt.startLineNumber||Ye.endLineNumber,rt.startColumn||Ye.endColumn,rt.endLineNumber||Ye.endLineNumber,rt.endColumn||Ye.endColumn);setTimeout(function(){We.executeEdits("",[{range:dt,text:""}])},300)}}function ze(We){(window.navigator.platform.match("Mac")?We.metaKey:We.ctrlKey)&&We.keyCode==83&&(We.preventDefault(),_e())}var qe=function(){if(Ae&&De.current.instance){var Ye=De.current.instance.getContentHeight();Ve(Ye<ie?ie:Ye)}else Ve(ie)};function nt(We){var Ye=document.createEvent("MouseEvents");Ye.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),We.dispatchEvent(Ye)}function $e(We,Ye){var rt=window.URL||window.webkitURL||window,dt=new Blob([Ye]),vt=document.createElementNS("http://www.w3.org/1999/xhtml","a");vt.href=rt.createObjectURL(dt),vt.download=We,nt(vt)}Object(N.useEffect)(function(){qe()},[qe]),Object(N.useEffect)(function(){Te.current&&!ee&&Promise.all([W.e(16),W.e(28)]).then(W.t.bind(null,"M/lh",7)).then(function(We){try{w=We,De.current.instance=w.editor.create(Te.current,{value:fe,language:I(J),theme:Ie,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0},Le);var Ye=De.current.instance,rt=h.d._menuItems,dt=Object(H.a)(rt).find(function(et){return et[0]._debugName=="EditorContext"}),vt=dt[1],ut=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],tt=function(st,ot){var lt=st._first;do{var ct,Ct,Mt=ot.includes((ct=lt.element)===null||ct===void 0||((Ct=ct.command)===null||Ct===void 0)?void 0:Ct.id);Mt&&st._remove(lt)}while(lt=lt.next)};if(oe(Ye,w),setTimeout(function(){qe(),De.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:function(){$e(Ce||"educoder.txt",Ye.getValue())}}),Ye.getDomNode().addEventListener("input",function(){de.current.autoFormat&&Ye.getAction("editor.action.formatDocument").run()})},500),De.current.subscription=Ye.onDidChangeModelContent(function(et){le.current?clearTimeout(z.current):(qe(),ge(Ye.getValue(),et)),z.current=setTimeout(function(){le.current=!1},500)}),window.Monaco||_(w,I(J)),se&&(tt(vt,ut),Te.current.classList.add("noCopyPaste"),Ye.onKeyDown(function(et){var st=et.keyCode,ot=et.ctrlKey,lt=et.metaKey;(st===33||st===52)&&(lt||ot)&&(Fe(),et.preventDefault())})),window.Monaco=w,Ne&&Ye.onDidBlurEditorWidget(function(){Ne(Ye.getValue())}),be&&Ye.onDidFocusEditorText(function(){be(Ye.getValue())}),se){Ye.addCommand(w.KeyMod.CtrlCmd|w.KeyCode.KEY_V,function(){return Fe(),null}),Ye.onDidPaste(function(et){De.current.pastePos=et});try{window.addEventListener("paste",Je)}catch(et){}}var Ze=we();return ve(!0),function(){var et=De.current.instance;et.dispose();var st=et.getModel();st&&st.dispose(),De.current.subscription&&De.current.subscription.dispose(),se&&window.removeEventListener("paste",Je),Ze.unobserve(Te.current)}}catch(et){}})},[]),Object(N.useEffect)(function(){var We=De.current.instance;if(We&&ee)return document.addEventListener("keydown",ze,!1),function(){document.removeEventListener("keydown",ze)}},[_e,ee]),Object(N.useEffect)(function(){var We=De.current.instance;if(We&&ee){var Ye=I(J);w.editor.setModelLanguage(We.getModel(),Ye),console.log("language:",J,We.getModel(),Ye)}},[J,ee]),Object(N.useEffect)(function(){var We=De.current.instance;We&&ee&&w.editor.setTheme(Ie)},[Ie,ee]),Object(N.useEffect)(function(){var We=De.current.instance;de.current=$,We&&ee&&(We.updateOptions(Object(te.a)({},$)),setTimeout(function(){We.getModel().updateOptions(Object(te.a)({},$))},200))},[JSON.stringify($),ee]),Object(N.useEffect)(function(){var We=De.current.instance;We&&ee&&We.layout()},[V,ie,ee]);var gt=Object(N.useState)(T(V)),ht=Object(R.a)(gt,2),bt=ht[0],pt=ht[1],it=Object(N.useState)(T(ie)),_t=Object(R.a)(it,2),Tt=_t[0],Ve=_t[1],At=Object(te.a)(Object(te.a)({},he),{},{width:bt,height:Tt});return e.a.createElement("div",{className:"my-monaco-editor",ref:Te,style:At})};function U(O){var G=O.width,V=G===void 0?"100%":G,ae=O.height,ie=ae===void 0?"100%":ae,fe=O.original,ce=O.modified,J=O.language,Z=O.options,he=Z===void 0?{}:Z,X=Object(N.useRef)(),$=Object(N.useState)(null),ye=Object(R.a)($,2),Le=ye[0],Re=ye[1];function Ie(Ae){var Y;return X.current&&(Y=new A.default(function(se){var pe=Object(L.a)(se),ge;try{for(pe.s();!(ge=pe.n()).done;){var ke=ge.value;(ke.target.offsetHeight>0||ke.target.offsetWidth>0)&&Ae.layout()}}catch(oe){pe.e(oe)}finally{pe.f()}}),Y.observe(X.current)),Y}Object(N.useEffect)(function(){X.current&&Promise.all([W.e(16),W.e(28)]).then(W.t.bind(null,"M/lh",7)).then(function(Ae){w=Ae;var Y=w.editor.createDiffEditor(X.current,Object(te.a)(Object(te.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},he),{},{wordWrap:!0}));Re(Y);var se=Ie(Y);return function(){Y.dispose();var pe=Y.getModel();pe&&pe.dispose(),se.unobserve(X.current)}})},[]),Object(N.useEffect)(function(){Le&&Le.setModel({original:w.editor.createModel(fe,J),modified:w.editor.createModel(ce,J)})},[fe,ce,J,Le]);var Ne=T(V),_e=T(ie),Ee={width:Ne,height:_e};return e.a.createElement("div",{className:"my-diff-editor",ref:X,style:Ee})}},ZpRC:function(Qe,ue,W){"use strict";function te(f){return typeof f=="object"&&f!=null&&f.nodeType===1}function H(f,p){return(!p||f!=="hidden")&&f!=="visible"&&f!=="clip"}function C(f,p){if(f.clientHeight<f.scrollHeight||f.clientWidth<f.scrollWidth){var o=getComputedStyle(f,null);return H(o.overflowY,p)||H(o.overflowX,p)||function(a){var n=function(l){if(!l.ownerDocument||!l.ownerDocument.defaultView)return null;try{return l.ownerDocument.defaultView.frameElement}catch(s){return null}}(a);return!!n&&(n.clientHeight<a.scrollHeight||n.clientWidth<a.scrollWidth)}(f)}return!1}function j(f,p,o,a,n,l,s,r){return l<f&&s>p||l>f&&s<p?0:l<=f&&r<=o||s>=p&&r>=o?l-f-a:s>p&&r<o||l<f&&r>o?s-p+n:0}var L=function(f,p){var o=window,a=p.scrollMode,n=p.block,l=p.inline,s=p.boundary,r=p.skipOverflowHiddenElements,i=typeof s=="function"?s:function(Ae){return Ae!==s};if(!te(f))throw new TypeError("Invalid target");for(var t=document.scrollingElement||document.documentElement,y=[],m=f;te(m)&&i(m);){if((m=m.parentElement)===t){y.push(m);break}m!=null&&m===document.body&&C(m)&&!C(document.documentElement)||m!=null&&C(m,r)&&y.push(m)}for(var g=o.visualViewport?o.visualViewport.width:innerWidth,E=o.visualViewport?o.visualViewport.height:innerHeight,_=window.scrollX||pageXOffset,u=window.scrollY||pageYOffset,h=f.getBoundingClientRect(),c=h.height,d=h.width,T=h.top,b=h.right,S=h.bottom,D=h.left,I=n==="start"||n==="nearest"?T:n==="end"?S:T+c/2,w=l==="center"?D+d/2:l==="end"?b:D,P=[],U=0;U<y.length;U++){var O=y[U],G=O.getBoundingClientRect(),V=G.height,ae=G.width,ie=G.top,fe=G.right,ce=G.bottom,J=G.left;if(a==="if-needed"&&T>=0&&D>=0&&S<=E&&b<=g&&T>=ie&&S<=ce&&D>=J&&b<=fe)return P;var Z=getComputedStyle(O),he=parseInt(Z.borderLeftWidth,10),X=parseInt(Z.borderTopWidth,10),$=parseInt(Z.borderRightWidth,10),ye=parseInt(Z.borderBottomWidth,10),Le=0,Re=0,Ie="offsetWidth"in O?O.offsetWidth-O.clientWidth-he-$:0,Ne="offsetHeight"in O?O.offsetHeight-O.clientHeight-X-ye:0;if(t===O)Le=n==="start"?I:n==="end"?I-E:n==="nearest"?j(u,u+E,E,X,ye,u+I,u+I+c,c):I-E/2,Re=l==="start"?w:l==="center"?w-g/2:l==="end"?w-g:j(_,_+g,g,he,$,_+w,_+w+d,d),Le=Math.max(0,Le+u),Re=Math.max(0,Re+_);else{Le=n==="start"?I-ie-X:n==="end"?I-ce+ye+Ne:n==="nearest"?j(ie,ce,V,X,ye+Ne,I,I+c,c):I-(ie+V/2)+Ne/2,Re=l==="start"?w-J-he:l==="center"?w-(J+ae/2)+Ie/2:l==="end"?w-fe+$+Ie:j(J,fe,ae,he,$+Ie,w,w+d,d);var _e=O.scrollLeft,Ee=O.scrollTop;I+=Ee-(Le=Math.max(0,Math.min(Ee+Le,O.scrollHeight-V+Ne))),w+=_e-(Re=Math.max(0,Math.min(_e+Re,O.scrollWidth-ae+Ie)))}P.push({el:O,top:Le,left:Re})}return P};function R(f){return f===Object(f)&&Object.keys(f).length!==0}function B(f,p){p===void 0&&(p="auto");var o="scrollBehavior"in document.body.style;f.forEach(function(a){var n=a.el,l=a.top,s=a.left;n.scroll&&o?n.scroll({top:l,left:s,behavior:p}):(n.scrollTop=l,n.scrollLeft=s)})}function N(f){return f===!1?{block:"end",inline:"nearest"}:R(f)?f:{block:"start",inline:"nearest"}}function e(f,p){var o=!f.ownerDocument.documentElement.contains(f);if(R(p)&&typeof p.behavior=="function")return p.behavior(o?[]:L(f,p));if(o)return;var a=N(p);return B(L(f,a),a.behavior)}var A=ue.a=e},bT9E:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return H});var te=W("VTBJ");function H(C,j){var L=Object(te.a)({},C);return Array.isArray(j)&&j.forEach(function(R){delete L[R]}),L}},fAei:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return t.a});var te=W("rePB"),H=W("VTBJ"),C=W("KQm4"),j=W("1OyB"),L=W("vuIU"),R=W("Ji7U"),B=W("LK+K"),N=W("q1tI"),e=W("4IlW"),A=W("Kwbf"),f=W("TSYQ"),p=W.n(f),o=W("sboe"),a=W("OZM5"),n=W("815F"),l=W("ODXe"),s=W("Ff2n"),r=W("+nKL"),i=W("8XRh"),t=W("WaYH"),y=function(fe,ce){var J=fe.className,Z=fe.style,he=fe.motion,X=fe.motionNodes,$=fe.motionType,ye=fe.onMotionStart,Le=fe.onMotionEnd,Re=fe.active,Ie=fe.treeNodeRequiredProps,Ne=Object(s.a)(fe,["className","style","motion","motionNodes","motionType","onMotionStart","onMotionEnd","active","treeNodeRequiredProps"]),_e=N.useState(!0),Ee=Object(l.a)(_e,2),Ae=Ee[0],Y=Ee[1],se=N.useContext(o.a),pe=se.prefixCls,ge=N.useRef(!1),ke=function(){ge.current||Le(),ge.current=!0};return Object(N.useEffect)(function(){X&&$==="hide"&&Ae&&Y(!1)},[X]),Object(N.useEffect)(function(){return X&&ye(),function(){X&&ke()}},[]),X?N.createElement(i.default,Object.assign({ref:ce,visible:Ae},he,{motionAppear:$==="show",onAppearEnd:ke,onLeaveEnd:ke}),function(oe,me){var be=oe.className,xe=oe.style;return N.createElement("div",{ref:me,className:p()("".concat(pe,"-treenode-motion"),be),style:xe},X.map(function(Ce){var Oe=Ce.data,Se=Oe.key,Ue=Object(s.a)(Oe,["key"]),Be=Ce.isStart,Te=Ce.isEnd;delete Ue.children;var De=Object(n.f)(Se,Ie);return N.createElement(t.a,Object.assign({},Ue,De,{active:Re,data:Ce.data,key:Se,isStart:Be,isEnd:Te}))}))}):N.createElement(t.a,Object.assign({domRef:ce,className:J,style:Z},Ne,{active:Re}))};y.displayName="MotionTreeNode";var m=N.forwardRef(y),g=m;function E(){var ie=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],ce=ie.length,J=fe.length;if(Math.abs(ce-J)!==1)return{add:!1,key:null};function Z(he,X){var $=new Map;he.forEach(function(Le){$.set(Le,!0)});var ye=X.filter(function(Le){return!$.has(Le)});return ye.length===1?ye[0]:null}return ce<J?{add:!0,key:Z(ie,fe)}:{add:!1,key:Z(fe,ie)}}function _(ie,fe,ce){var J=ie.findIndex(function($){var ye=$.data;return ye.key===ce}),Z=ie[J+1],he=fe.findIndex(function($){var ye=$.data;return ye.key===ce});if(Z){var X=fe.findIndex(function($){var ye=$.data;return ye.key===Z.data.key});return fe.slice(he+1,X)}return fe.slice(he+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},T={key:c,level:0,index:0,pos:"0",node:d},b={parent:null,children:[],pos:T.pos,data:d,isStart:[],isEnd:[]};function S(ie,fe,ce,J){return fe===!1||!ce?ie:ie.slice(0,Math.ceil(ce/J)+1)}function D(ie){var fe=ie.data.key,ce=ie.pos;return Object(n.e)(fe,ce)}function I(ie){for(var fe=String(ie.data.key),ce=ie;ce.parent;)ce=ce.parent,fe="".concat(ce.data.key," > ").concat(fe);return fe}var w=function(fe,ce){var J=fe.prefixCls,Z=fe.data,he=fe.selectable,X=fe.checkable,$=fe.expandedKeys,ye=fe.selectedKeys,Le=fe.checkedKeys,Re=fe.loadedKeys,Ie=fe.loadingKeys,Ne=fe.halfCheckedKeys,_e=fe.keyEntities,Ee=fe.disabled,Ae=fe.dragging,Y=fe.dragOverNodeKey,se=fe.dropPosition,pe=fe.motion,ge=fe.height,ke=fe.itemHeight,oe=fe.virtual,me=fe.focusable,be=fe.activeItem,xe=fe.focused,Ce=fe.tabIndex,Oe=fe.onKeyDown,Se=fe.onFocus,Ue=fe.onBlur,Be=fe.onActiveChange,Te=fe.onListChangeStart,De=fe.onListChangeEnd,de=Object(s.a)(fe,["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"]),re=N.useRef(null);N.useImperativeHandle(ce,function(){return{scrollTo:function(Ye){re.current.scrollTo(Ye)}}});var le=N.useState($),z=Object(l.a)(le,2),Q=z[0],q=z[1],ee=N.useState(Z),ve=Object(l.a)(ee,2),we=ve[0],Fe=ve[1],Ge=N.useState(Z),Je=Object(l.a)(Ge,2),ze=Je[0],qe=Je[1],nt=N.useState([]),$e=Object(l.a)(nt,2),gt=$e[0],ht=$e[1],bt=N.useState(null),pt=Object(l.a)(bt,2),it=pt[0],_t=pt[1];function Tt(){Fe(Z),qe(Z),ht([]),_t(null),De()}N.useEffect(function(){q($);var We=E(Q,$);if(We.key!==null)if(We.add){var Ye=we.findIndex(function(Ze){var et=Ze.data.key;return et===We.key}),rt=S(_(we,Z,We.key),oe,ge,ke),dt=we.slice();dt.splice(Ye+1,0,b),qe(dt),ht(rt),_t("show")}else{var vt=Z.findIndex(function(Ze){var et=Ze.data.key;return et===We.key}),ut=S(_(Z,we,We.key),oe,ge,ke),tt=Z.slice();tt.splice(vt+1,0,b),qe(tt),ht(ut),_t("hide")}else we!==Z&&(Fe(Z),qe(Z))},[$,Z]),N.useEffect(function(){Ae||Tt()},[Ae]);var Ve=pe?ze:Z,At={expandedKeys:$,selectedKeys:ye,loadedKeys:Re,loadingKeys:Ie,checkedKeys:Le,halfCheckedKeys:Ne,dragOverNodeKey:Y,dropPosition:se,keyEntities:_e};return N.createElement(N.Fragment,null,xe&&be&&N.createElement("span",{style:u,"aria-live":"assertive"},I(be)),N.createElement("div",{role:"tree"},N.createElement("input",{style:u,disabled:me===!1||Ee,tabIndex:me!==!1?Ce:null,onKeyDown:Oe,onFocus:Se,onBlur:Ue,value:"",onChange:h})),N.createElement(r.a,Object.assign({},de,{data:Ve,itemKey:D,height:ge,fullHeight:!1,virtual:oe,itemHeight:ke,prefixCls:"".concat(J,"-list"),ref:re}),function(We){var Ye=We.pos,rt=We.data,dt=rt.key,vt=Object(s.a)(rt,["key"]),ut=We.isStart,tt=We.isEnd,Ze=Object(n.e)(dt,Ye);delete vt.children;var et=Object(n.f)(Ze,At);return N.createElement(g,Object.assign({},vt,et,{active:be&&dt===be.data.key,pos:Ye,data:We.data,isStart:ut,isEnd:tt,motion:pe,motionNodes:dt===c?gt:null,motionType:it,onMotionStart:Te,onMotionEnd:Tt,treeNodeRequiredProps:At,onMouseMove:function(){Be(null)}}))}))},P=N.forwardRef(w);P.displayName="NodeList";var U=P,O=W("NvD2"),G=function(ie){Object(R.a)(ce,ie);var fe=Object(B.a)(ce);function ce(){var J;return Object(j.a)(this,ce),J=fe.apply(this,arguments),J.destroyed=!1,J.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},J.listRef=N.createRef(),J.onNodeDragStart=function(Z,he){var X=J.state,$=X.expandedKeys,ye=X.keyEntities,Le=J.props.onDragStart,Re=he.props.eventKey;J.dragNode=he;var Ie=Object(a.b)($,Re);J.setState({dragging:!0,dragNodesKeys:Object(a.g)(Re,ye)}),J.setExpandedKeys(Ie),Le&&Le({event:Z,node:Object(n.b)(he.props)})},J.onNodeDragEnter=function(Z,he){var X=J.state,$=X.expandedKeys,ye=X.keyEntities,Le=X.dragNodesKeys,Re=J.props.onDragEnter,Ie=he.props,Ne=Ie.pos,_e=Ie.eventKey;if(!J.dragNode||Le.indexOf(_e)!==-1)return;var Ee=Object(a.c)(Z,he);if(J.dragNode.props.eventKey===_e&&Ee===0){J.setState({dragOverNodeKey:"",dropPosition:null});return}setTimeout(function(){J.setState({dragOverNodeKey:_e,dropPosition:Ee}),J.delayedDragEnterLogic||(J.delayedDragEnterLogic={}),Object.keys(J.delayedDragEnterLogic).forEach(function(Ae){clearTimeout(J.delayedDragEnterLogic[Ae])}),J.delayedDragEnterLogic[Ne]=window.setTimeout(function(){if(!J.state.dragging)return;var Ae=Object(C.a)($),Y=ye[_e];Y&&(Y.children||[]).length&&(Ae=Object(a.a)($,_e)),"expandedKeys"in J.props||J.setExpandedKeys(Ae),Re&&Re({event:Z,node:Object(n.b)(he.props),expandedKeys:Ae})},400)},0)},J.onNodeDragOver=function(Z,he){var X=J.state.dragNodesKeys,$=J.props.onDragOver,ye=he.props.eventKey;if(X.indexOf(ye)!==-1)return;if(J.dragNode&&ye===J.state.dragOverNodeKey){var Le=Object(a.c)(Z,he);if(Le===J.state.dropPosition)return;J.setState({dropPosition:Le})}$&&$({event:Z,node:Object(n.b)(he.props)})},J.onNodeDragLeave=function(Z,he){var X=J.props.onDragLeave;J.setState({dragOverNodeKey:""}),X&&X({event:Z,node:Object(n.b)(he.props)})},J.onNodeDragEnd=function(Z,he){var X=J.props.onDragEnd;J.setState({dragOverNodeKey:""}),J.cleanDragState(),X&&X({event:Z,node:Object(n.b)(he.props)}),J.dragNode=null},J.onNodeDrop=function(Z,he){var X=J.state,$=X.dragNodesKeys,ye=$===void 0?[]:$,Le=X.dropPosition,Re=J.props.onDrop,Ie=he.props,Ne=Ie.eventKey,_e=Ie.pos;if(J.setState({dragOverNodeKey:""}),J.cleanDragState(),ye.indexOf(Ne)!==-1){Object(A.a)(!1,"Can not drop to dragNode(include it's children node)");return}var Ee=Object(a.k)(_e),Ae={event:Z,node:Object(n.b)(he.props),dragNode:J.dragNode?Object(n.b)(J.dragNode.props):null,dragNodesKeys:ye.slice(),dropPosition:Le+Number(Ee[Ee.length-1]),dropToGap:!1};Le!==0&&(Ae.dropToGap=!0),Re&&Re(Ae),J.dragNode=null},J.cleanDragState=function(){var Z=J.state.dragging;Z&&J.setState({dragging:!1})},J.onNodeClick=function(Z,he){var X=J.props.onClick;X&&X(Z,he)},J.onNodeDoubleClick=function(Z,he){var X=J.props.onDoubleClick;X&&X(Z,he)},J.onNodeSelect=function(Z,he){var X=J.state.selectedKeys,$=J.state.keyEntities,ye=J.props,Le=ye.onSelect,Re=ye.multiple,Ie=he.selected,Ne=he.key,_e=!Ie;_e?Re?X=Object(a.a)(X,Ne):X=[Ne]:X=Object(a.b)(X,Ne);var Ee=X.map(function(Ae){var Y=$[Ae];return Y?Y.node:null}).filter(function(Ae){return Ae});J.setUncontrolledState({selectedKeys:X}),Le&&Le(X,{event:"select",selected:_e,node:he,selectedNodes:Ee,nativeEvent:Z.nativeEvent})},J.onNodeCheck=function(Z,he,X){var $=J.state,ye=$.keyEntities,Le=$.checkedKeys,Re=$.halfCheckedKeys,Ie=J.props,Ne=Ie.checkStrictly,_e=Ie.onCheck,Ee=he.key,Ae,Y={event:"check",node:he,checked:X,nativeEvent:Z.nativeEvent};if(Ne){var se=X?Object(a.a)(Le,Ee):Object(a.b)(Le,Ee),pe=Object(a.b)(Re,Ee);Ae={checked:se,halfChecked:pe},Y.checkedNodes=se.map(function(xe){return ye[xe]}).filter(function(xe){return xe}).map(function(xe){return xe.node}),J.setUncontrolledState({checkedKeys:se})}else{var ge=Object(O.a)([].concat(Object(C.a)(Le),[Ee]),!0,ye),ke=ge.checkedKeys,oe=ge.halfCheckedKeys;if(!X){var me=new Set(ke);me.delete(Ee);var be=Object(O.a)(Array.from(me),{checked:!1,halfCheckedKeys:oe},ye);ke=be.checkedKeys,oe=be.halfCheckedKeys}Ae=ke,Y.checkedNodes=[],Y.checkedNodesPositions=[],Y.halfCheckedKeys=oe,ke.forEach(function(xe){var Ce=ye[xe];if(!Ce)return;var Oe=Ce.node,Se=Ce.pos;Y.checkedNodes.push(Oe),Y.checkedNodesPositions.push({node:Oe,pos:Se})}),J.setUncontrolledState({checkedKeys:ke},!1,{halfCheckedKeys:oe})}_e&&_e(Ae,Y)},J.onNodeLoad=function(Z){return new Promise(function(he){J.setState(function(X){var $=X.loadedKeys,ye=$===void 0?[]:$,Le=X.loadingKeys,Re=Le===void 0?[]:Le,Ie=J.props,Ne=Ie.loadData,_e=Ie.onLoad,Ee=Z.key;if(!Ne||ye.indexOf(Ee)!==-1||Re.indexOf(Ee)!==-1)return{};var Ae=Ne(Z);return Ae.then(function(){var Y=J.state,se=Y.loadedKeys,pe=Y.loadingKeys,ge=Object(a.a)(se,Ee),ke=Object(a.b)(pe,Ee);_e&&_e(ge,{event:"load",node:Z}),J.setUncontrolledState({loadedKeys:ge}),J.setState({loadingKeys:ke}),he()}),{loadingKeys:Object(a.a)(Re,Ee)}})})},J.onNodeMouseEnter=function(Z,he){var X=J.props.onMouseEnter;X&&X({event:Z,node:he})},J.onNodeMouseLeave=function(Z,he){var X=J.props.onMouseLeave;X&&X({event:Z,node:he})},J.onNodeContextMenu=function(Z,he){var X=J.props.onRightClick;X&&(Z.preventDefault(),X({event:Z,node:he}))},J.onFocus=function(){var Z=J.props.onFocus;J.setState({focused:!0}),Z&&Z.apply(void 0,arguments)},J.onBlur=function(){var Z=J.props.onBlur;J.setState({focused:!1}),J.onActiveChange(null),Z&&Z.apply(void 0,arguments)},J.getTreeNodeRequiredProps=function(){var Z=J.state,he=Z.expandedKeys,X=Z.selectedKeys,$=Z.loadedKeys,ye=Z.loadingKeys,Le=Z.checkedKeys,Re=Z.halfCheckedKeys,Ie=Z.dragOverNodeKey,Ne=Z.dropPosition,_e=Z.keyEntities;return{expandedKeys:he||[],selectedKeys:X||[],loadedKeys:$||[],loadingKeys:ye||[],checkedKeys:Le||[],halfCheckedKeys:Re||[],dragOverNodeKey:Ie,dropPosition:Ne,keyEntities:_e}},J.setExpandedKeys=function(Z){var he=J.state.treeData,X=Object(n.d)(he,Z);J.setUncontrolledState({expandedKeys:Z,flattenNodes:X},!0)},J.onNodeExpand=function(Z,he){var X=J.state.expandedKeys,$=J.state.listChanging,ye=J.props,Le=ye.onExpand,Re=ye.loadData,Ie=he.key,Ne=he.expanded;if($)return;var _e=X.indexOf(Ie),Ee=!Ne;if(Object(A.a)(Ne&&_e!==-1||!Ne&&_e===-1,"Expand state not sync with index check"),Ee?X=Object(a.a)(X,Ie):X=Object(a.b)(X,Ie),J.setExpandedKeys(X),Le&&Le(X,{node:he,expanded:Ee,nativeEvent:Z.nativeEvent}),Ee&&Re){var Ae=J.onNodeLoad(he);Ae&&Ae.then(function(){var Y=Object(n.d)(J.state.treeData,X);J.setUncontrolledState({flattenNodes:Y})})}},J.onListChangeStart=function(){J.setUncontrolledState({listChanging:!0})},J.onListChangeEnd=function(){setTimeout(function(){J.setUncontrolledState({listChanging:!1})})},J.onActiveChange=function(Z){var he=J.state.activeKey,X=J.props.onActiveChange;if(he===Z)return;J.setState({activeKey:Z}),Z!==null&&J.scrollTo({key:Z}),X&&X(Z)},J.getActiveItem=function(){var Z=J.state,he=Z.activeKey,X=Z.flattenNodes;return he===null?null:X.find(function($){var ye=$.data.key;return ye===he})||null},J.offsetActiveKey=function(Z){var he=J.state,X=he.flattenNodes,$=he.activeKey,ye=X.findIndex(function(Ie){var Ne=Ie.data.key;return Ne===$});ye===-1&&Z<0&&(ye=X.length),ye=(ye+Z+X.length)%X.length;var Le=X[ye];if(Le){var Re=Le.data.key;J.onActiveChange(Re)}else J.onActiveChange(null)},J.onKeyDown=function(Z){var he=J.state,X=he.activeKey,$=he.expandedKeys,ye=he.checkedKeys,Le=J.props,Re=Le.onKeyDown,Ie=Le.checkable,Ne=Le.selectable;switch(Z.which){case e.a.UP:{J.offsetActiveKey(-1),Z.preventDefault();break}case e.a.DOWN:{J.offsetActiveKey(1),Z.preventDefault();break}}var _e=J.getActiveItem();if(_e&&_e.data){var Ee=J.getTreeNodeRequiredProps(),Ae=_e.data.isLeaf===!1||!!(_e.data.children||[]).length,Y=Object(n.b)(Object(H.a)(Object(H.a)({},Object(n.f)(X,Ee)),{},{data:_e.data,active:!0}));switch(Z.which){case e.a.LEFT:{Ae&&$.includes(X)?J.onNodeExpand({},Y):_e.parent&&J.onActiveChange(_e.parent.data.key),Z.preventDefault();break}case e.a.RIGHT:{Ae&&!$.includes(X)?J.onNodeExpand({},Y):_e.children&&_e.children.length&&J.onActiveChange(_e.children[0].data.key),Z.preventDefault();break}case e.a.ENTER:case e.a.SPACE:{Ie&&!Y.disabled&&Y.checkable!==!1&&!Y.disableCheckbox?J.onNodeCheck({},Y,!ye.includes(X)):!Ie&&Ne&&!Y.disabled&&Y.selectable!==!1&&J.onNodeSelect({},Y);break}}}Re&&Re(Z)},J.setUncontrolledState=function(Z){var he=arguments.length>1&&arguments[1]!==void 0?arguments[1]:!1,X=arguments.length>2&&arguments[2]!==void 0?arguments[2]:null;if(J.destroyed)return;var $=!1,ye=!0,Le={};Object.keys(Z).forEach(function(Re){if(Re in J.props){ye=!1;return}$=!0,Le[Re]=Z[Re]}),$&&(!he||ye)&&J.setState(Object(H.a)(Object(H.a)({},Le),X))},J.scrollTo=function(Z){J.listRef.current.scrollTo(Z)},J}return Object(L.a)(ce,[{key:"componentWillUnmount",value:function(){this.destroyed=!0}},{key:"render",value:function(){var Z,he=this.state,X=he.focused,$=he.flattenNodes,ye=he.keyEntities,Le=he.dragging,Re=he.activeKey,Ie=this.props,Ne=Ie.prefixCls,_e=Ie.className,Ee=Ie.style,Ae=Ie.showLine,Y=Ie.focusable,se=Ie.tabIndex,pe=se===void 0?0:se,ge=Ie.selectable,ke=Ie.showIcon,oe=Ie.icon,me=Ie.switcherIcon,be=Ie.draggable,xe=Ie.checkable,Ce=Ie.checkStrictly,Oe=Ie.disabled,Se=Ie.motion,Ue=Ie.loadData,Be=Ie.filterTreeNode,Te=Ie.height,De=Ie.itemHeight,de=Ie.virtual,re=Ie.titleRender,le=Ie.onContextMenu,z=Object(a.f)(this.props);return N.createElement(o.a.Provider,{value:{prefixCls:Ne,selectable:ge,showIcon:ke,icon:oe,switcherIcon:me,draggable:be,checkable:xe,checkStrictly:Ce,disabled:Oe,keyEntities:ye,loadData:Ue,filterTreeNode:Be,titleRender:re,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:p()(Ne,_e,(Z={},Object(te.a)(Z,"".concat(Ne,"-show-line"),Ae),Object(te.a)(Z,"".concat(Ne,"-focused"),X),Object(te.a)(Z,"".concat(Ne,"-active-focused"),Re!==null),Z))},N.createElement(U,Object.assign({ref:this.listRef,prefixCls:Ne,style:Ee,data:$,disabled:Oe,selectable:ge,checkable:!!xe,motion:Se,dragging:Le,height:Te,itemHeight:De,virtual:de,focusable:Y,focused:X,tabIndex:pe,activeItem:this.getActiveItem(),onFocus:this.onFocus,onBlur:this.onBlur,onKeyDown:this.onKeyDown,onActiveChange:this.onActiveChange,onListChangeStart:this.onListChangeStart,onListChangeEnd:this.onListChangeEnd,onContextMenu:le},this.getTreeNodeRequiredProps(),z))))}}],[{key:"getDerivedStateFromProps",value:function(Z,he){var X=he.prevProps,$={prevProps:Z};function ye(oe){return!X&&oe in Z||X&&X[oe]!==Z[oe]}var Le;if(ye("treeData")?Le=Z.treeData:ye("children")&&(Object(A.a)(!1,"`children` of Tree is deprecated. Please use `treeData` instead."),Le=Object(n.c)(Z.children)),Le){$.treeData=Le;var Re=Object(n.a)(Le);$.keyEntities=Object(H.a)(Object(te.a)({},c,T),Re.keyEntities)}var Ie=$.keyEntities||he.keyEntities;if(ye("expandedKeys")||X&&ye("autoExpandParent"))$.expandedKeys=Z.autoExpandParent||!X&&Z.defaultExpandParent?Object(a.e)(Z.expandedKeys,Ie):Z.expandedKeys;else if(!X&&Z.defaultExpandAll){var Ne=Object(H.a)({},Ie);delete Ne[c],$.expandedKeys=Object.keys(Ne).map(function(oe){return Ne[oe].key})}else!X&&Z.defaultExpandedKeys&&($.expandedKeys=Z.autoExpandParent||Z.defaultExpandParent?Object(a.e)(Z.defaultExpandedKeys,Ie):Z.defaultExpandedKeys);if($.expandedKeys||delete $.expandedKeys,Le||$.expandedKeys){var _e=Object(n.d)(Le||he.treeData,$.expandedKeys||he.expandedKeys);$.flattenNodes=_e}if(Z.selectable&&(ye("selectedKeys")?$.selectedKeys=Object(a.d)(Z.selectedKeys,Z):!X&&Z.defaultSelectedKeys&&($.selectedKeys=Object(a.d)(Z.defaultSelectedKeys,Z))),Z.checkable){var Ee;if(ye("checkedKeys")?Ee=Object(a.j)(Z.checkedKeys)||{}:!X&&Z.defaultCheckedKeys?Ee=Object(a.j)(Z.defaultCheckedKeys)||{}:Le&&(Ee=Object(a.j)(Z.checkedKeys)||{checkedKeys:he.checkedKeys,halfCheckedKeys:he.halfCheckedKeys}),Ee){var Ae=Ee,Y=Ae.checkedKeys,se=Y===void 0?[]:Y,pe=Ae.halfCheckedKeys,ge=pe===void 0?[]:pe;if(!Z.checkStrictly){var ke=Object(O.a)(se,!0,Ie);se=ke.checkedKeys,ge=ke.halfCheckedKeys}$.checkedKeys=se,$.halfCheckedKeys=ge}}return ye("loadedKeys")&&($.loadedKeys=Z.loadedKeys),$}}]),ce}(N.Component);G.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:[]},G.TreeNode=t.a;var V=G,ae=ue.b=V},fjLI:function(Qe,ue,W){"use strict";W.d(ue,"f",function(){return o}),W.d(ue,"b",function(){return a}),W.d(ue,"a",function(){return n}),W.d(ue,"d",function(){return l}),W.d(ue,"e",function(){return s}),W.d(ue,"c",function(){return r});var te=W("8HAY"),H=W("Vhoy"),C=W("MI8n"),j=W("JYp7"),L=W("pmY6"),R=W("24hK"),B=W("nnTU"),N=W("T8No"),e=W("Cg/j"),A=W("t9D7"),f=function(i,t,y,m){var g=arguments.length,E=g<3?t:m===null?m=Object.getOwnPropertyDescriptor(t,y):m,_;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")E=Reflect.decorate(i,t,y,m);else for(var u=i.length-1;u>=0;u--)(_=i[u])&&(E=(g<3?_(E):g>3?_(t,y,E):_(t,y))||E);return g>3&&E&&Object.defineProperty(t,y,E),E},p=function(i,t){return function(y,m){t(y,m,i)}};function o(i){return i.command!==void 0}class a{constructor(i){this.id=a._idPool++,this._debugName=i}}a._idPool=0,a.CommandPalette=new a("CommandPalette"),a.EditorContext=new a("EditorContext"),a.SimpleEditorContext=new a("SimpleEditorContext"),a.EditorContextCopy=new a("EditorContextCopy"),a.EditorContextPeek=new a("EditorContextPeek"),a.MenubarEditMenu=new a("MenubarEditMenu"),a.MenubarCopy=new a("MenubarCopy"),a.MenubarGoMenu=new a("MenubarGoMenu"),a.MenubarSelectionMenu=new a("MenubarSelectionMenu"),a.InlineCompletionsActions=new a("InlineCompletionsActions");const n=Object(e.c)("menuService"),l=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new C.b,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:i=>i===a.CommandPalette}}addCommand(i){return this.addCommands(j.a.single(i))}addCommands(i){for(const t of i)this._commands.set(t.id,t);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),Object(L.i)(()=>{let t=!1;for(const y of i)t=this._commands.delete(y.id)||t;t&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(i){return this._commands.get(i)}getCommands(){const i=new Map;return this._commands.forEach((t,y)=>i.set(y,t)),i}appendMenuItem(i,t){return this.appendMenuItems(j.a.single({id:i,item:t}))}appendMenuItems(i){const t=new Set,y=new R.a;for(const{id:m,item:g}of i){let E=this._menuItems.get(m);E||(E=new R.a,this._menuItems.set(m,E)),y.push(E.push(g)),t.add(m)}return this._onDidChangeMenu.fire(t),Object(L.i)(()=>{if(y.size>0){for(let m of y)m();this._onDidChangeMenu.fire(t),y.clear()}})}getMenuItems(i){let t;return this._menuItems.has(i)?t=[...this._menuItems.get(i)]:t=[],i===a.CommandPalette&&this._appendImplicitItems(t),t}_appendImplicitItems(i){const t=new Set;for(const y of i)o(y)&&(t.add(y.command.id),y.alt&&t.add(y.alt.id));this._commands.forEach((y,m)=>{t.has(m)||i.push({command:y})})}};class s extends te.e{constructor(i,t,y,m){super(`submenuitem.${i.submenu.id}`,typeof i.title=="string"?i.title:i.title.value,[],"submenu");this.item=i,this._menuService=t,this._contextKeyService=y,this._options=m}get actions(){const i=[],t=this._menuService.createMenu(this.item.submenu,this._contextKeyService),y=t.getActions(this._options);t.dispose();for(const[,m]of y)m.length>0&&(i.push(...m),i.push(new te.d));return i.length&&i.pop(),i}}let r=class i{constructor(t,y,m,g,E){var _,u;if(this._commandService=E,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:(_=t.tooltip)===null||_===void 0?void 0:_.value)!==null&&u!==void 0?u:"",this.enabled=!t.precondition||g.contextMatchesRules(t.precondition),this.checked=void 0,t.toggled){const h=t.toggled.condition?t.toggled:{condition:t.toggled};this.checked=g.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=y?new i(y,void 0,m,g,E):void 0,this._options=m,A.d.isThemeIcon(t.icon)&&(this.class=H.a.asClassName(t.icon))}dispose(){}run(...t){var y,m;let g=[];return((y=this._options)===null||y===void 0?void 0:y.arg)&&(g=[...g,this._options.arg]),((m=this._options)===null||m===void 0?void 0:m.shouldForwardArgs)&&(g=[...g,...t]),this._commandService.executeCommand(this.id,...g)}};r=f([p(3,N.b),p(4,B.b)],r)},ic2d:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return j});var te=W("FWmy"),H=W("746U");class C{constructor(){this.data=new Map}add(L,R){te.a(H.l(L)),te.a(H.k(R)),te.a(!this.data.has(L),"There is already an extension with this id"),this.data.set(L,R)}as(L){return this.data.get(L)||null}}const j=new C},nEHx:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return te});var te;(function(H){H.DARK="dark",H.LIGHT="light",H.HIGH_CONTRAST="hc"})(te||(te={}))},nnTU:function(Qe,ue,W){"use strict";W.d(ue,"b",function(){return B}),W.d(ue,"a",function(){return N});var te=W("MI8n"),H=W("JYp7"),C=W("pmY6"),j=W("24hK"),L=W("746U"),R=W("Cg/j");const B=Object(R.c)("commandService"),N=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new te.b,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,A){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!A)throw new Error("invalid command");return this.registerCommand({id:e,handler:A})}if(e.description){const n=[];for(let s of e.description.args)n.push(s.constraint);const l=e.handler;e.handler=function(s,...r){return Object(L.o)(r,n),l(s,...r)}}const{id:f}=e;let p=this._commands.get(f);p||(p=new j.a,this._commands.set(f,p));let o=p.unshift(e),a=Object(C.i)(()=>{o();const n=this._commands.get(f);(n==null?void 0:n.isEmpty())&&this._commands.delete(f)});return this._onDidRegisterCommand.fire(f),a}registerCommandAlias(e,A){return N.registerCommand(e,(f,...p)=>f.get(B).executeCommand(A,...p))}getCommand(e){const A=this._commands.get(e);return!A||A.isEmpty()?void 0:H.a.first(A)}getCommands(){const e=new Map;for(const A of this._commands.keys()){const f=this.getCommand(A);f&&e.set(A,f)}return e}};N.registerCommand("noop",()=>{})},p5ED:function(Qe,ue,W){"use strict";var te=W("+L6B"),H=W("2/Rp"),C=W("5Dmo"),j=W("3S7+"),L=W("k1fw"),R=W("9og8"),B=W("tJVT"),N=W("WmNS"),e=W.n(N),A=W("q1tI"),f=W.n(A),p=W("vHTk"),o=W.n(p),a=W("yEEn"),n=W("ZW9T"),l=W("1vsH"),s=W("V0Rq"),r=W("m3rI");ue.a=function(i){var t,y,m,g,E,_,u,h=i.editOffice,c=h===void 0?"view":h,d=i.data,T=i.theme,b=i.type,S=i.filename,D=i.monacoEditor,I=i.className,w=i.style,P=i.close,U=i.onClose,O=i.hasMask,G=i.disabledDownload,V=Object(A.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),ae=Object(B.a)(V,2),ie=ae[0],fe=ae[1],ce=Object(A.useState)(""),J=Object(B.a)(ce,2),Z=J[0],he=J[1],X=Object(A.useState)(),$=Object(B.a)(X,2),ye=$[0],Le=$[1],Re=window.ENV==="build"?"/react/build":"",Ie=r.a.PROXY_SERVER||location.origin,Ne,_e=1024*1024,Ee=10*_e,Ae=Object(A.useRef)();(t=d)!==null&&t!==void 0&&t.startsWith("/api")&&b!=="txt"&&(d=r.a.API_SERVER+d),b==="office"&&(Ne=Object(l.T)(d).filesize,Ne>Ee&&(b="other")),S&&D&&(D.filename=S),Object(A.useEffect)(function(){var ge,ke,oe=(ge=document.cookie)===null||ge===void 0||((ke=ge.replace(/\s/g,""))===null||ke===void 0)?void 0:ke.split(";");oe==null||oe.map(function(me){var be=me.split("=");be[0]==="_educoder_session"&&he(be[1])})},[]),Object(A.useEffect)(function(){b==="office"&&Y()},[b,d]);var Y=function(){var ge=Object(R.a)(e.a.mark(function ke(){var oe,me,be;return e.a.wrap(function(Ce){for(;;)switch(Ce.prev=Ce.next){case 0:return console.log("data:",d),oe=d,d.startsWith("http")||(oe=location.origin+oe),me=new URL(oe).pathname.split("/").pop(),Ce.next=6,Object(s.W)({attachment_id:me});case 6:be=Ce.sent,Le(be);case 8:case"end":return Ce.stop()}},ke)}));return function(){return ge.apply(this,arguments)}}(),se=function(){if(d.startsWith("http")||d.startsWith("blob:")){pe();return}Object(l.z)(S||"educoder",d,S)},pe=function(){Object(l.x)(S||"educoder",decodeURIComponent(d))};return f.a.createElement("div",{style:Object(L.a)({},w||{}),className:"".concat(O&&o.a.bgBlack," ").concat(b?o.a.wrp:"hide")},P&&f.a.createElement("div",{className:o.a.close,ref:Ae},!G&&f.a.createElement(j.a,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:function(){return Ae.current}},f.a.createElement("span",{onClick:pe},f.a.createElement("i",{className:"icon-quxiaozhiding"}))),f.a.createElement(j.a,{title:"\u5173\u95ED",getPopupContainer:function(){return Ae.current}},f.a.createElement("span",{className:"",onClick:U},f.a.createElement("i",{className:"icon-guanbi1"})))),f.a.createElement("div",{className:"".concat(o.a[I]," ").concat(I," ").concat(o.a.monaco," ").concat(b==="txt"?"show":"hide")},b==="txt"&&f.a.createElement(n.b,D)),b==="audio"&&f.a.createElement("audio",{src:"".concat(((y=d)===null||y===void 0?void 0:y.indexOf("http://"))>-1||((m=d)===null||m===void 0?void 0:m.indexOf("https://"))>-1?"":"data:audio/mp3;base64,").concat(d),autoPlay:!0}),b==="video"&&f.a.createElement(f.a.Fragment,null,((g=d)===null||g===void 0?void 0:g.indexOf("http"))>-1?f.a.createElement("video",{controls:!0,src:"".concat(d),autoPlay:!0}):f.a.createElement("video",{controls:!0,src:"data:video/mp4;base64,".concat(d),autoPlay:!0})),b==="office"&&ye&&f.a.createElement("iframe",{src:"".concat(Re,"/office.html?key=").concat(ye.key,"&url=").concat(Ie+ye.url,"&callbackUrl=").concat(Ie+ye.callbackUrl,"&fileType=").concat(ye.fileType,"&title=").concat(ye.title,"&model=").concat(c,"&officeServer=").concat(r.a.OFFICE_SERVER,"&disabledDownload=").concat(!!G)}),b==="html"&&f.a.createElement("iframe",{src:d+"&disposition=inline"}),b==="pdf"&&f.a.createElement("iframe",{src:"".concat(Re,"/js/pdfview/index.html?url=").concat(d,"&disabledDownload=").concat(!!G)}),b==="image"&&f.a.createElement("img",{src:"".concat(((E=d)===null||E===void 0?void 0:E.indexOf("http://"))>-1||((_=d)===null||_===void 0?void 0:_.indexOf("https://"))>-1||(u=d)!==null&&u!==void 0&&u.startsWith("/api")?"":"data:image/png;base64,").concat(d)}),b==="other"&&f.a.createElement("div",null,f.a.createElement(H.a,{type:"primary",size:"large",onClick:se},f.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D")),b==="download"&&f.a.createElement(H.a,{type:"primary",size:"large",onClick:se},f.a.createElement(a.a,null),"\u70B9\u51FB\u4E0B\u8F7D"))}},pmY6:function(Qe,ue,W){"use strict";W.d(ue,"h",function(){return A}),W.d(ue,"g",function(){return p}),W.d(ue,"f",function(){return o}),W.d(ue,"e",function(){return a}),W.d(ue,"i",function(){return n}),W.d(ue,"b",function(){return l}),W.d(ue,"a",function(){return s}),W.d(ue,"d",function(){return r}),W.d(ue,"c",function(){return i});var te=W("C/vA"),H=W("JYp7");const C=!1;let j=null;function L(t){j=t}if(C){const t="__is_disposable_tracked__";L(new class{trackDisposable(y){const m=new Error("Potentially leaked disposable").stack;setTimeout(()=>{y[t]||console.log(m)},3e3)}setParent(y,m){if(y&&y!==s.None)try{y[t]=!0}catch(g){}}markAsDisposed(y){if(y&&y!==s.None)try{y[t]=!0}catch(m){}}markAsSingleton(y){}})}function R(t){return j==null||j.trackDisposable(t),t}function B(t){j==null||j.markAsDisposed(t)}function N(t,y){j==null||j.setParent(t,y)}function e(t,y){if(!j)return;for(const m of t)j.setParent(m,y)}function A(t){return j==null||j.markAsSingleton(t),t}class f extends Error{constructor(t){super(`Encountered errors while disposing of store. Errors: [${t.join(", ")}]`);this.errors=t}}function p(t){return typeof t.dispose=="function"&&t.dispose.length===0}function o(t){if(H.a.is(t)){let y=[];for(const m of t)if(m)try{m.dispose()}catch(g){y.push(g)}if(y.length===1)throw y[0];if(y.length>1)throw new f(y);return Array.isArray(t)?[]:t}else if(t)return t.dispose(),t}function a(...t){const y=n(()=>o(t));return e(t,y),y}function n(t){const y=R({dispose:Object(te.a)(()=>{B(y),t()})});return y}class l{constructor(){this._toDispose=new Set,this._isDisposed=!1,R(this)}dispose(){if(this._isDisposed)return;B(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,R(this),N(this._store,this)}dispose(){B(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 r{constructor(){this._isDisposed=!1,R(this)}get value(){return this._isDisposed?void 0:this._value}set value(t){var y;if(this._isDisposed||t===this._value)return;(y=this._value)===null||y===void 0||y.dispose(),t&&N(t,this),this._value=t}clear(){this.value=void 0}dispose(){var t;this._isDisposed=!0,B(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 i{constructor(t){this.object=t}dispose(){}}},psGv:function(Qe,ue,W){var te,H;(function(){var C;(function(){"use strict";var B=[,,function(f){function p(n){this.__parent=n,this.__character_count=0,this.__indent_count=-1,this.__alignment_count=0,this.__wrap_point_index=0,this.__wrap_point_character_count=0,this.__wrap_point_indent_count=-1,this.__wrap_point_alignment_count=0,this.__items=[]}p.prototype.clone_empty=function(){var n=new p(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},p.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},p.prototype.has_match=function(n){for(var l=this.__items.length-1;l>=0;l--)if(this.__items[l].match(n))return!0;return!1},p.prototype.set_indent=function(n,l){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=l||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},p.prototype._set_wrap_point=function(){this.__parent.wrap_line_length&&(this.__wrap_point_index=this.__items.length,this.__wrap_point_character_count=this.__character_count,this.__wrap_point_indent_count=this.__parent.next_line.__indent_count,this.__wrap_point_alignment_count=this.__parent.next_line.__alignment_count)},p.prototype._should_wrap=function(){return this.__wrap_point_index&&this.__character_count>this.__parent.wrap_line_length&&this.__wrap_point_character_count>this.__parent.next_line.__character_count},p.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var n=this.__parent.current_line;return n.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),n.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),n.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,n.__items[0]===" "&&(n.__items.splice(0,1),n.__character_count-=1),!0}return!1},p.prototype.is_empty=function(){return this.__items.length===0},p.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},p.prototype.push=function(n){this.__items.push(n);var l=n.lastIndexOf(`
|
|
`);l!==-1?this.__character_count=n.length-l:this.__character_count+=n.length},p.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},p.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},p.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},p.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},p.prototype.toString=function(){var n="";return this.is_empty()?this.__parent.indent_empty_lines&&(n=this.__parent.get_indent_string(this.__indent_count)):(n=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),n+=this.__items.join("")),n};function o(n,l){this.__cache=[""],this.__indent_size=n.indent_size,this.__indent_string=n.indent_char,n.indent_with_tabs||(this.__indent_string=new Array(n.indent_size+1).join(n.indent_char)),l=l||"",n.indent_level>0&&(l=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=l,this.__base_string_length=l.length}o.prototype.get_indent_size=function(n,l){var s=this.__base_string_length;return l=l||0,n<0&&(s=0),s+=n*this.__indent_size,s+=l,s},o.prototype.get_indent_string=function(n,l){var s=this.__base_string;return l=l||0,n<0&&(n=0,s=""),l+=n*this.__indent_size,this.__ensure_cache(l),s+=this.__cache[l],s},o.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},o.prototype.__add_column=function(){var n=this.__cache.length,l=0,s="";this.__indent_size&&n>=this.__indent_size&&(l=Math.floor(n/this.__indent_size),n-=l*this.__indent_size,s=new Array(l+1).join(this.__indent_string)),n&&(s+=new Array(n+1).join(" ")),this.__cache.push(s)};function a(n,l){this.__indent_cache=new o(n,l),this.raw=!1,this._end_with_newline=n.end_with_newline,this.indent_size=n.indent_size,this.wrap_line_length=n.wrap_line_length,this.indent_empty_lines=n.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new p(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}a.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},a.prototype.get_line_number=function(){return this.__lines.length},a.prototype.get_indent_string=function(n,l){return this.__indent_cache.get_indent_string(n,l)},a.prototype.get_indent_size=function(n,l){return this.__indent_cache.get_indent_size(n,l)},a.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},a.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},a.prototype.get_code=function(n){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 n!==`
|
|
`&&(s=s.replace(/[\n]/g,n)),s},a.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},a.prototype.set_indent=function(n,l){return n=n||0,l=l||0,this.next_line.set_indent(n,l),this.__lines.length>1?(this.current_line.set_indent(n,l),!0):(this.current_line.set_indent(),!1)},a.prototype.add_raw_token=function(n){for(var l=0;l<n.newlines;l++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(n.whitespace_before),this.current_line.push(n.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},a.prototype.add_token=function(n){this.__add_space_before_token(),this.current_line.push(n),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},a.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(" "))},a.prototype.remove_indent=function(n){for(var l=this.__lines.length;n<l;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},a.prototype.trim=function(n){for(n=n===void 0?!1:n,this.current_line.trim();n&&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},a.prototype.just_added_newline=function(){return this.current_line.is_empty()},a.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},a.prototype.ensure_empty_line_above=function(n,l){for(var s=this.__lines.length-2;s>=0;){var r=this.__lines[s];if(r.is_empty())break;if(r.item(0).indexOf(n)!==0&&r.item(-1)!==l){this.__lines.splice(s+1,0,new p(this)),this.previous_line=this.__lines[this.__lines.length-2];break}s--}},f.exports.Output=a},function(f){function p(o,a,n,l){this.type=o,this.text=a,this.comments_before=null,this.newlines=n||0,this.whitespace_before=l||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}f.exports.Token=p},,,function(f){function p(n,l){this.raw_options=o(n,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"])}p.prototype._get_array=function(n,l){var s=this.raw_options[n],r=l||[];return typeof s=="object"?s!==null&&typeof s.concat=="function"&&(r=s.concat()):typeof s=="string"&&(r=s.split(/[^a-zA-Z0-9_\/\-]+/)),r},p.prototype._get_boolean=function(n,l){var s=this.raw_options[n],r=s===void 0?!!l:!!s;return r},p.prototype._get_characters=function(n,l){var s=this.raw_options[n],r=l||"";return typeof s=="string"&&(r=s.replace(/\\r/,"\r").replace(/\\n/,`
|
|
`).replace(/\\t/," ")),r},p.prototype._get_number=function(n,l){var s=this.raw_options[n];l=parseInt(l,10),isNaN(l)&&(l=0);var r=parseInt(s,10);return isNaN(r)&&(r=l),r},p.prototype._get_selection=function(n,l,s){var r=this._get_selection_list(n,l,s);if(r.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[n]+"'");return r[0]},p.prototype._get_selection_list=function(n,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 r=this._get_array(n,s);if(!this._is_valid_selection(r,l))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
|
|
`+l+`
|
|
You passed in: '`+this.raw_options[n]+"'");return r},p.prototype._is_valid_selection=function(n,l){return n.length&&l.length&&!n.some(function(s){return l.indexOf(s)===-1})};function o(n,l){var s={};n=a(n);var r;for(r in n)r!==l&&(s[r]=n[r]);if(l&&n[l])for(r in n[l])s[r]=n[l][r];return s}function a(n){var l={},s;for(s in n){var r=s.replace(/-/g,"_");l[r]=n[s]}return l}f.exports.Options=p,f.exports.normalizeOpts=a,f.exports.mergeOpts=o},,function(f){var p=RegExp.prototype.hasOwnProperty("sticky");function o(a){this.__input=a||"",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 a=null;return this.hasNext()&&(a=this.__input.charAt(this.__position),this.__position+=1),a},o.prototype.peek=function(a){var n=null;return a=a||0,a+=this.__position,a>=0&&a<this.__input_length&&(n=this.__input.charAt(a)),n},o.prototype.__match=function(a,n){a.lastIndex=n;var l=a.exec(this.__input);return l&&!(p&&a.sticky)&&(l.index!==n&&(l=null)),l},o.prototype.test=function(a,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(a,n):!1},o.prototype.testChar=function(a,n){var l=this.peek(n);return a.lastIndex=0,l!==null&&a.test(l)},o.prototype.match=function(a){var n=this.__match(a,this.__position);return n?this.__position+=n[0].length:n=null,n},o.prototype.read=function(a,n,l){var s="",r;return a&&(r=this.match(a),r&&(s+=r[0])),n&&(r||!a)&&(s+=this.readUntil(n,l)),s},o.prototype.readUntil=function(a,n){var l="",s=this.__position;a.lastIndex=this.__position;var r=a.exec(this.__input);return r?(s=r.index,n&&(s+=r[0].length)):s=this.__input_length,l=this.__input.substring(this.__position,s),this.__position=s,l},o.prototype.readUntilAfter=function(a){return this.readUntil(a,!0)},o.prototype.get_regexp=function(a,n){var l=null,s="g";return n&&p&&(s="y"),typeof a=="string"&&a!==""?l=new RegExp(a,s):a&&(l=new RegExp(a.source,s)),l},o.prototype.get_literal_regexp=function(a){return RegExp(a.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},o.prototype.peekUntilAfter=function(a){var n=this.__position,l=this.readUntilAfter(a);return this.__position=n,l},o.prototype.lookBack=function(a){var n=this.__position-1;return n>=a.length&&this.__input.substring(n-a.length,n).toLowerCase()===a},f.exports.InputScanner=o},function(f,p,o){var a=o(8).InputScanner,n=o(3).Token,l=o(10).TokenStream,s=o(11).WhitespacePattern,r={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},i=function(t,y){this._input=new a(t),this._options=y||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new s(this._input)};i.prototype.tokenize=function(){this._input.restart(),this.__tokens=new l,this._reset();for(var t,y=new n(r.START,""),m=null,g=[],E=new l;y.type!==r.EOF;){for(t=this._get_next_token(y,m);this._is_comment(t);)E.add(t),t=this._get_next_token(y,m);E.isEmpty()||(t.comments_before=E,E=new l),t.parent=m,this._is_opening(t)?(g.push(m),m=t):m&&this._is_closing(t,m)&&(t.opened=m,m.closed=t,m=g.pop(),t.parent=m),t.previous=y,y.next=t,this.__tokens.add(t),y=t}return this.__tokens},i.prototype._is_first_token=function(){return this.__tokens.isEmpty()},i.prototype._reset=function(){},i.prototype._get_next_token=function(t,y){this._readWhitespace();var m=this._input.read(/.+/g);return m?this._create_token(r.RAW,m):this._create_token(r.EOF,"")},i.prototype._is_comment=function(t){return!1},i.prototype._is_opening=function(t){return!1},i.prototype._is_closing=function(t,y){return!1},i.prototype._create_token=function(t,y){var m=new n(t,y,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return m},i.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},f.exports.Tokenizer=i,f.exports.TOKEN=r},function(f){function p(o){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=o}p.prototype.restart=function(){this.__position=0},p.prototype.isEmpty=function(){return this.__tokens_length===0},p.prototype.hasNext=function(){return this.__position<this.__tokens_length},p.prototype.next=function(){var o=null;return this.hasNext()&&(o=this.__tokens[this.__position],this.__position+=1),o},p.prototype.peek=function(o){var a=null;return o=o||0,o+=this.__position,o>=0&&o<this.__tokens_length&&(a=this.__tokens[o]),a},p.prototype.add=function(o){this.__parent_token&&(o.parent=this.__parent_token),this.__tokens.push(o),this.__tokens_length+=1},f.exports.TokenStream=p},function(f,p,o){var a=o(12).Pattern;function n(l,s){a.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=""}n.prototype=new a,n.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+"]")},n.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},n.prototype.matching=function(l,s){var r=this._create();return r.__set_whitespace_patterns(l,s),r._update(),r},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(l,s){l.lastIndex=0;for(var r=0,i=[],t=l.exec(s);t;)i.push(s.substring(r,t.index)),r=t.index+t[0].length,t=l.exec(s);return r<s.length?i.push(s.substring(r,s.length)):i.push(""),i},f.exports.WhitespacePattern=n},function(f){function p(o,a){this._input=o,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,a&&(this._starting_pattern=this._input.get_regexp(a._starting_pattern,!0),this._match_pattern=this._input.get_regexp(a._match_pattern,!0),this._until_pattern=this._input.get_regexp(a._until_pattern),this._until_after=a._until_after)}p.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},p.prototype.read_match=function(){return this._input.match(this._match_pattern)},p.prototype.until_after=function(o){var a=this._create();return a._until_after=!0,a._until_pattern=this._input.get_regexp(o),a._update(),a},p.prototype.until=function(o){var a=this._create();return a._until_after=!1,a._until_pattern=this._input.get_regexp(o),a._update(),a},p.prototype.starting_with=function(o){var a=this._create();return a._starting_pattern=this._input.get_regexp(o,!0),a._update(),a},p.prototype.matching=function(o){var a=this._create();return a._match_pattern=this._input.get_regexp(o,!0),a._update(),a},p.prototype._create=function(){return new p(this._input,this)},p.prototype._update=function(){},f.exports.Pattern=p},function(f){function p(o,a){o=typeof o=="string"?o:o.source,a=typeof a=="string"?a:a.source,this.__directives_block_pattern=new RegExp(o+/ beautify( \w+[:]\w+)+ /.source+a,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(o+/\sbeautify\signore:end\s/.source+a,"g")}p.prototype.get_directives=function(o){if(!o.match(this.__directives_block_pattern))return null;var a={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(o);n;)a[n[1]]=n[2],n=this.__directive_pattern.exec(o);return a},p.prototype.readIgnored=function(o){return o.readUntilAfter(this.__directives_end_ignore_pattern)},f.exports.Directives=p},function(f,p,o){var a=o(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function l(s,r){a.call(this,s,r),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),r&&(this.__template_pattern=this._input.get_regexp(r.__template_pattern),this._excluded=Object.assign(this._excluded,r._excluded),this._disabled=Object.assign(this._disabled,r._disabled));var i=new a(s);this.__patterns={handlebars_comment:i.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:i.starting_with(/{{{/).until_after(/}}}/),handlebars:i.starting_with(/{{/).until_after(/}}/),php:i.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:i.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:i.starting_with(/{%/).until_after(/%}/),django_value:i.starting_with(/{{/).until_after(/}}/),django_comment:i.starting_with(/{#/).until_after(/#}/),smarty:i.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:i.starting_with(/{\*/).until_after(/\*}/),smarty_literal:i.starting_with(/{literal}/).until_after(/{\/literal}/)}}l.prototype=new a,l.prototype._create=function(){return new l(this._input,this)},l.prototype._update=function(){this.__set_templated_pattern()},l.prototype.disable=function(s){var r=this._create();return r._disabled[s]=!0,r._update(),r},l.prototype.read_options=function(s){var r=this._create();for(var i in n)r._disabled[i]=s.templating.indexOf(i)===-1;return r._update(),r},l.prototype.exclude=function(s){var r=this._create();return r._excluded[s]=!0,r._update(),r},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 r=this._read_template();r;)this._match_pattern?r+=this._input.read(this._match_pattern):r+=this._input.readUntil(this.__template_pattern),s+=r,r=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="",r=this._input.peek();if(r==="<"){var i=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&i==="?"&&(s=s||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&i==="%"&&(s=s||this.__patterns.erb.read())}else r==="{"&&(!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},f.exports.TemplatablePattern=l},,,,function(f,p,o){var a=o(19).Beautifier,n=o(20).Options;function l(s,r,i,t){var y=new a(s,r,i,t);return y.beautify()}f.exports=l,f.exports.defaultOptions=function(){return new n}},function(f,p,o){var a=o(20).Options,n=o(2).Output,l=o(21).Tokenizer,s=o(21).TOKEN,r=/\r\n|[\r\n]/,i=/\r\n|[\r\n]/g,t=function(T,b){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=T.max_preserve_newlines,this.preserve_newlines=T.preserve_newlines,this._output=new n(T,b)};t.prototype.current_line_has_match=function(T){return this._output.current_line.has_match(T)},t.prototype.set_space_before_token=function(T,b){this._output.space_before_token=T,this._output.non_breaking_space=b},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(T){this._output.add_raw_token(T)},t.prototype.print_preserved_newlines=function(T){var b=0;T.type!==s.TEXT&&T.previous.type!==s.TEXT&&(b=T.newlines?1:0),this.preserve_newlines&&(b=T.newlines<this.max_preserve_newlines+1?T.newlines:this.max_preserve_newlines+1);for(var S=0;S<b;S++)this.print_newline(S>0);return b!==0},t.prototype.traverse_whitespace=function(T){return T.whitespace_before||T.newlines?(this.print_preserved_newlines(T)||(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(T){this._output.add_new_line(T)},t.prototype.print_token=function(T){T.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(T.text))},t.prototype.indent=function(){this.indent_level++},t.prototype.get_full_indent=function(T){return T=this.indent_level+(T||0),T<1?"":this._output.get_indent_string(T)};var y=function(T){for(var b=null,S=T.next;S.type!==s.EOF&&T.closed!==S;){if(S.type===s.ATTRIBUTE&&S.text==="type"){S.next&&S.next.type===s.EQUALS&&S.next.next&&S.next.next.type===s.VALUE&&(b=S.next.next.text);break}S=S.next}return b},m=function(T,b){var S=null,D=null;return b.closed?(T==="script"?S="text/javascript":T==="style"&&(S="text/css"),S=y(b)||S,S.search("text/css")>-1?D="css":S.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?D="javascript":S.search(/(text|application|dojo)\/(x-)?(html)/)>-1?D="html":S.search(/test\/null/)>-1&&(D="null"),D):null};function g(T,b){return b.indexOf(T)!==-1}function E(T,b,S){this.parent=T||null,this.tag=b?b.tag_name:"",this.indent_level=S||0,this.parser_token=b||null}function _(T){this._printer=T,this._current_frame=null}_.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},_.prototype.record_tag=function(T){var b=new E(this._current_frame,T,this._printer.indent_level);this._current_frame=b},_.prototype._try_pop_frame=function(T){var b=null;return T&&(b=T.parser_token,this._printer.indent_level=T.indent_level,this._current_frame=T.parent),b},_.prototype._get_frame=function(T,b){for(var S=this._current_frame;S&&!(T.indexOf(S.tag)!==-1);){if(b&&b.indexOf(S.tag)!==-1){S=null;break}S=S.parent}return S},_.prototype.try_pop=function(T,b){var S=this._get_frame([T],b);return this._try_pop_frame(S)},_.prototype.indent_to_tag=function(T){var b=this._get_frame(T);b&&(this._printer.indent_level=b.indent_level)};function u(T,b,S,D){this._source_text=T||"",b=b||{},this._js_beautify=S,this._css_beautify=D,this._tag_stack=null;var I=new a(b,"html");this._options=I,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 T=this._source_text,b=this._options.eol;this._options.eol==="auto"&&(b=`
|
|
`,T&&r.test(T)&&(b=T.match(r)[0])),T=T.replace(i,`
|
|
`);var S=T.match(/^[\t ]*/)[0],D={text:"",type:""},I=new h,w=new t(this._options,S),P=new l(T,this._options).tokenize();this._tag_stack=new _(w);for(var U=null,O=P.next();O.type!==s.EOF;)O.type===s.TAG_OPEN||O.type===s.COMMENT?(U=this._handle_tag_open(w,O,I,D),I=U):O.type===s.ATTRIBUTE||O.type===s.EQUALS||O.type===s.VALUE||O.type===s.TEXT&&!I.tag_complete?U=this._handle_inside_tag(w,O,I,P):O.type===s.TAG_CLOSE?U=this._handle_tag_close(w,O,I):O.type===s.TEXT?U=this._handle_text(w,O,I):w.add_raw_token(O),D=U,O=P.next();var G=w._output.get_code(b);return G},u.prototype._handle_tag_close=function(T,b,S){var D={text:b.text,type:b.type};return T.alignment_size=0,S.tag_complete=!0,T.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),S.is_unformatted?T.add_raw_token(b):(S.tag_start_char==="<"&&(T.set_space_before_token(b.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&S.has_wrapped_attrs&&T.print_newline(!1)),T.print_token(b)),S.indent_content&&!(S.is_unformatted||S.is_content_unformatted)&&(T.indent(),S.indent_content=!1),!S.is_inline_element&&!(S.is_unformatted||S.is_content_unformatted)&&T.set_wrap_point(),D},u.prototype._handle_inside_tag=function(T,b,S,D){var I=S.has_wrapped_attrs,w={text:b.text,type:b.type};if(T.set_space_before_token(b.newlines||b.whitespace_before!=="",!0),S.is_unformatted)T.add_raw_token(b);else if(S.tag_start_char==="{"&&b.type===s.TEXT)T.print_preserved_newlines(b)?(b.newlines=0,T.add_raw_token(b)):T.print_token(b);else{if(b.type===s.ATTRIBUTE?(T.set_space_before_token(!0),S.attr_count+=1):(b.type===s.EQUALS||b.type===s.VALUE&&b.previous.type===s.EQUALS)&&T.set_space_before_token(!1),b.type===s.ATTRIBUTE&&S.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(T.traverse_whitespace(b),I=I||b.newlines!==0),this._is_wrap_attributes_force)){var P=S.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&S.attr_count===1){var U=!0,O=0,G;do{if(G=D.peek(O),G.type===s.ATTRIBUTE){U=!1;break}O+=1}while(O<4&&G.type!==s.EOF&&G.type!==s.TAG_CLOSE);P=!U}P&&(T.print_newline(!1),I=!0)}T.print_token(b),I=I||T.previous_token_wrapped(),S.has_wrapped_attrs=I}return w},u.prototype._handle_text=function(T,b,S){var D={text:b.text,type:"TK_CONTENT"};return S.custom_beautifier_name?this._print_custom_beatifier_text(T,b,S):S.is_unformatted||S.is_content_unformatted?T.add_raw_token(b):(T.traverse_whitespace(b),T.print_token(b)),D},u.prototype._print_custom_beatifier_text=function(T,b,S){var D=this;if(b.text!==""){var I=b.text,w,P=1,U="",O="";S.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?w=this._js_beautify:S.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?w=this._css_beautify:S.custom_beautifier_name==="html"&&(w=function(ce,J){var Z=new u(ce,J,D._js_beautify,D._css_beautify);return Z.beautify()}),this._options.indent_scripts==="keep"?P=0:this._options.indent_scripts==="separate"&&(P=-T.indent_level);var G=T.get_full_indent(P);if(I=I.replace(/\n[ \t]*$/,""),S.custom_beautifier_name!=="html"&&I[0]==="<"&&I.match(/^(<!--|<!\[CDATA\[)/)){var V=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(I);if(!V){T.add_raw_token(b);return}U=G+V[1]+`
|
|
`,I=V[4],V[5]&&(O=G+V[5]),I=I.replace(/\n[ \t]*$/,""),(V[2]||V[3].indexOf(`
|
|
`)!==-1)&&(V=V[3].match(/[ \t]+$/),V&&(b.whitespace_before=V[0]))}if(I)if(w){var ae=function(){this.eol=`
|
|
`};ae.prototype=this._options.raw_options;var ie=new ae;I=w(G+I,ie)}else{var fe=b.whitespace_before;fe&&(I=I.replace(new RegExp(`
|
|
(`+fe+")?","g"),`
|
|
`)),I=G+I.replace(/\n/g,`
|
|
`+G)}U&&(I?I=U+I+`
|
|
`+O:I=U+O),T.print_newline(!1),I&&(b.text=I,b.whitespace_before="",b.newlines=0,T.add_raw_token(b),T.print_newline(!0))}},u.prototype._handle_tag_open=function(T,b,S,D){var I=this._get_tag_open_token(b);return(S.is_unformatted||S.is_content_unformatted)&&!S.is_empty_element&&b.type===s.TAG_OPEN&&b.text.indexOf("</")===0?(T.add_raw_token(b),I.start_tag_token=this._tag_stack.try_pop(I.tag_name)):(T.traverse_whitespace(b),this._set_tag_position(T,b,I,S,D),I.is_inline_element||T.set_wrap_point(),T.print_token(b)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(I.alignment_size=b.text.length+1),!I.tag_complete&&!I.is_unformatted&&(T.alignment_size=I.alignment_size),I};var h=function(T,b){if(this.parent=T||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="",!b)this.tag_complete=!0;else{var S;this.tag_start_char=b.text[0],this.text=b.text,this.tag_start_char==="<"?(S=b.text.match(/^<([^\s>]*)/),this.tag_check=S?S[1]:""):(S=b.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=S?S[1]:"",(b.text.startsWith("{{#>")||b.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&b.next!==null?this.tag_check=b.next.text.split(" ")[0]:this.tag_check=b.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),b.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||b.closed&&b.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(T){var b=new h(this._tag_stack.get_parser_token(),T);return b.alignment_size=this._options.wrap_attributes_indent_size,b.is_end_tag=b.is_end_tag||g(b.tag_check,this._options.void_elements),b.is_empty_element=b.tag_complete||b.is_start_tag&&b.is_end_tag,b.is_unformatted=!b.tag_complete&&g(b.tag_check,this._options.unformatted),b.is_content_unformatted=!b.is_empty_element&&g(b.tag_check,this._options.content_unformatted),b.is_inline_element=g(b.tag_name,this._options.inline)||b.tag_name.includes("-")||b.tag_start_char==="{",b},u.prototype._set_tag_position=function(T,b,S,D,I){if(S.is_empty_element||(S.is_end_tag?S.start_tag_token=this._tag_stack.try_pop(S.tag_name):(this._do_optional_end_element(S)&&(S.is_inline_element||T.print_newline(!1)),this._tag_stack.record_tag(S),(S.tag_name==="script"||S.tag_name==="style")&&!(S.is_unformatted||S.is_content_unformatted)&&(S.custom_beautifier_name=m(S.tag_check,b)))),g(S.tag_check,this._options.extra_liners)&&(T.print_newline(!1),T._output.just_added_blankline()||T.print_newline(!0)),S.is_empty_element){if(S.tag_start_char==="{"&&S.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),S.indent_content=!0;var w=T.current_line_has_match(/{{#if/);w||T.print_newline(!1)}S.tag_name==="!--"&&I.type===s.TAG_CLOSE&&D.is_end_tag&&S.text.indexOf(`
|
|
`)===-1||(S.is_inline_element||S.is_unformatted||T.print_newline(!1),this._calcluate_parent_multiline(T,S))}else if(S.is_end_tag){var P=!1;P=S.start_tag_token&&S.start_tag_token.multiline_content,P=P||!S.is_inline_element&&!(D.is_inline_element||D.is_unformatted)&&!(I.type===s.TAG_CLOSE&&S.start_tag_token===D)&&I.type!=="TK_CONTENT",(S.is_content_unformatted||S.is_unformatted)&&(P=!1),P&&T.print_newline(!1)}else S.indent_content=!S.custom_beautifier_name,S.tag_start_char==="<"&&(S.tag_name==="html"?S.indent_content=this._options.indent_inner_html:S.tag_name==="head"?S.indent_content=this._options.indent_head_inner_html:S.tag_name==="body"&&(S.indent_content=this._options.indent_body_inner_html)),!(S.is_inline_element||S.is_unformatted)&&(I.type!=="TK_CONTENT"||S.is_content_unformatted)&&T.print_newline(!1),this._calcluate_parent_multiline(T,S)},u.prototype._calcluate_parent_multiline=function(T,b){b.parent&&T._output.just_added_newline()&&!((b.is_inline_element||b.is_unformatted)&&b.parent.is_inline_element)&&(b.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(T){var b=null;if(T.is_empty_element||!T.is_start_tag||!T.parent)return;if(T.tag_name==="body")b=b||this._tag_stack.try_pop("head");else if(T.tag_name==="li")b=b||this._tag_stack.try_pop("li",["ol","ul"]);else if(T.tag_name==="dd"||T.tag_name==="dt")b=b||this._tag_stack.try_pop("dt",["dl"]),b=b||this._tag_stack.try_pop("dd",["dl"]);else if(T.parent.tag_name==="p"&&c.indexOf(T.tag_name)!==-1){var S=T.parent.parent;(!S||d.indexOf(S.tag_name)===-1)&&(b=b||this._tag_stack.try_pop("p"))}else T.tag_name==="rp"||T.tag_name==="rt"?(b=b||this._tag_stack.try_pop("rt",["ruby","rtc"]),b=b||this._tag_stack.try_pop("rp",["ruby","rtc"])):T.tag_name==="optgroup"?b=b||this._tag_stack.try_pop("optgroup",["select"]):T.tag_name==="option"?b=b||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):T.tag_name==="colgroup"?b=b||this._tag_stack.try_pop("caption",["table"]):T.tag_name==="thead"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"])):T.tag_name==="tbody"||T.tag_name==="tfoot"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("thead",["table"]),b=b||this._tag_stack.try_pop("tbody",["table"])):T.tag_name==="tr"?(b=b||this._tag_stack.try_pop("caption",["table"]),b=b||this._tag_stack.try_pop("colgroup",["table"]),b=b||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(T.tag_name==="th"||T.tag_name==="td")&&(b=b||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),b=b||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return T.parent=this._tag_stack.get_parser_token(),b},f.exports.Beautifier=u},function(f,p,o){var a=o(6).Options;function n(l){a.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"])}n.prototype=new a,f.exports.Options=n},function(f,p,o){var a=o(9).Tokenizer,n=o(9).TOKEN,l=o(13).Directives,s=o(14).TemplatablePattern,r=o(12).Pattern,i={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:n.START,RAW:n.RAW,EOF:n.EOF},t=new l(/<\!--/,/-->/),y=function(m,g){a.call(this,m,g),this._current_tag_name="";var E=new s(this._input).read_options(this._options),_=new r(this._input);if(this.__patterns={word:E.until(/[\n\r\t <]/),single_quote:E.until_after(/'/),double_quote:E.until_after(/"/),attribute:E.until(/[\n\r\t =>]|\/>/),element_name:E.until(/[\n\r\t >\/]/),handlebars_comment:_.starting_with(/{{!--/).until_after(/--}}/),handlebars:_.starting_with(/{{/).until_after(/}}/),handlebars_open:_.until(/[\n\r\t }]/),handlebars_raw_close:_.until(/}}/),comment:_.starting_with(/<!--/).until_after(/-->/),cdata:_.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:_.starting_with(/<!\[/).until_after(/]>/),processing:_.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=_.matching(u).until_after(u)}};y.prototype=new a,y.prototype._is_comment=function(m){return!1},y.prototype._is_opening=function(m){return m.type===i.TAG_OPEN},y.prototype._is_closing=function(m,g){return m.type===i.TAG_CLOSE&&g&&((m.text===">"||m.text==="/>")&&g.text[0]==="<"||m.text==="}}"&&g.text[0]==="{"&&g.text[1]==="{")},y.prototype._reset=function(){this._current_tag_name=""},y.prototype._get_next_token=function(m,g){var E=null;this._readWhitespace();var _=this._input.peek();return _===null?this._create_token(i.EOF,""):(E=E||this._read_open_handlebars(_,g),E=E||this._read_attribute(_,m,g),E=E||this._read_close(_,g),E=E||this._read_raw_content(_,m,g),E=E||this._read_content_word(_),E=E||this._read_comment_or_cdata(_),E=E||this._read_processing(_),E=E||this._read_open(_,g),E=E||this._create_token(i.UNKNOWN,this._input.next()),E)},y.prototype._read_comment_or_cdata=function(m){var g=null,E=null,_=null;if(m==="<"){var u=this._input.peek(1);u==="!"&&(E=this.__patterns.comment.read(),E?(_=t.get_directives(E),_&&_.ignore==="start"&&(E+=t.readIgnored(this._input))):E=this.__patterns.cdata.read()),E&&(g=this._create_token(i.COMMENT,E),g.directives=_)}return g},y.prototype._read_processing=function(m){var g=null,E=null,_=null;if(m==="<"){var u=this._input.peek(1);(u==="!"||u==="?")&&(E=this.__patterns.conditional_comment.read(),E=E||this.__patterns.processing.read()),E&&(g=this._create_token(i.COMMENT,E),g.directives=_)}return g},y.prototype._read_open=function(m,g){var E=null,_=null;return g||m==="<"&&(E=this._input.next(),this._input.peek()==="/"&&(E+=this._input.next()),E+=this.__patterns.element_name.read(),_=this._create_token(i.TAG_OPEN,E)),_},y.prototype._read_open_handlebars=function(m,g){var E=null,_=null;return g||this._options.indent_handlebars&&m==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(E=this.__patterns.handlebars_comment.read(),E=E||this.__patterns.handlebars.read(),_=this._create_token(i.COMMENT,E)):(E=this.__patterns.handlebars_open.read(),_=this._create_token(i.TAG_OPEN,E))),_},y.prototype._read_close=function(m,g){var E=null,_=null;return g&&(g.text[0]==="<"&&(m===">"||m==="/"&&this._input.peek(1)===">")?(E=this._input.next(),m==="/"&&(E+=this._input.next()),_=this._create_token(i.TAG_CLOSE,E)):g.text[0]==="{"&&m==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),_=this._create_token(i.TAG_CLOSE,"}}"))),_},y.prototype._read_attribute=function(m,g,E){var _=null,u="";if(E&&E.text[0]==="<")if(m==="=")_=this._create_token(i.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(),_=this._create_token(i.VALUE,h)}else u=this.__patterns.attribute.read(),u&&(g.type===i.EQUALS?_=this._create_token(i.VALUE,u):_=this._create_token(i.ATTRIBUTE,u));return _},y.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)},y.prototype._read_raw_content=function(m,g,E){var _="";if(E&&E.text[0]==="{")_=this.__patterns.handlebars_raw_close.read();else if(g.type===i.TAG_CLOSE&&g.opened.text[0]==="<"&&g.text[0]!=="/"){var u=g.opened.text.substr(1).toLowerCase();if(u==="script"||u==="style"){var h=this._read_comment_or_cdata(m);if(h)return h.type=i.TEXT,h;_=this._input.readUntil(new RegExp("</"+u+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(u)&&(_=this._input.readUntil(new RegExp("</"+u+"[\\n\\r\\t ]*?>","ig")))}return _?this._create_token(i.TEXT,_):null},y.prototype._read_content_word=function(m){var g="";if(this._options.unformatted_content_delimiter&&(m===this._options.unformatted_content_delimiter[0]&&(g=this.__patterns.unformatted_content_delimiter.read())),g||(g=this.__patterns.word.read()),g)return this._create_token(i.TEXT,g)},f.exports.Tokenizer=y,f.exports.TOKEN=i}],N={};function e(f){var p=N[f];if(p!==void 0)return p.exports;var o=N[f]={exports:{}};return B[f](o,o.exports,e),o.exports}var A=e(18);C=A})();var j=C;if(!0)!(te=[W,W("6UM0"),W("TXwP")],H=function(B){var N=W("6UM0"),e=W("TXwP");return{html_beautify:function(A,f){return j(A,f,N.js_beautify,e.css_beautify)}}}.apply(ue,te),H!==void 0&&(Qe.exports=H));else var L,R})()},"rAM+":function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return H});var te=W("Qw5x");function H(C,j){var L;if(typeof Symbol=="undefined"||C[Symbol.iterator]==null){if(Array.isArray(C)||(L=Object(te.a)(C))||j&&C&&typeof C.length=="number"){L&&(C=L);var R=0,B=function(){};return{s:B,n:function(){return R>=C.length?{done:!0}:{done:!1,value:C[R++]}},e:function(p){throw p},f:B}}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,A;return{s:function(){L=C[Symbol.iterator]()},n:function(){var p=L.next();return N=p.done,p},e:function(p){e=!0,A=p},f:function(){try{!N&&L.return!=null&&L.return()}finally{if(e)throw A}}}}},rUJ1:function(Qe,ue){const W=/[&<>"']/,te=/[&<>"']/g,H=/[<>"']|&(?!#?\w+;)/,C=/[<>"']|&(?!#?\w+;)/g,j={"&":"&","<":"<",">":">",'"':""","'":"'"},L=_=>j[_];function R(_,u){if(u){if(W.test(_))return _.replace(te,L)}else if(H.test(_))return _.replace(C,L);return _}const B=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function N(_){return _.replace(B,(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 A(_,u){_=_.source||_,u=u||"";const h={replace:(c,d)=>(d=d.source||d,d=d.replace(e,"$1"),_=_.replace(c,d),h),getRegex:()=>new RegExp(_,u)};return h}const f=/[^\w:]/g,p=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(_,u,h){if(_){let c;try{c=decodeURIComponent(N(h)).replace(f,"").toLowerCase()}catch(d){return null}if(c.indexOf("javascript:")===0||c.indexOf("vbscript:")===0||c.indexOf("data:")===0)return null}u&&!p.test(h)&&(h=r(u,h));try{h=encodeURI(h).replace(/%25/g,"%")}catch(c){return null}return h}const a={},n=/^[^:]+:\/*[^/]*$/,l=/^([^:]+:)[\s\S]*$/,s=/^([^:]+:\/*[^/]*)[\s\S]*$/;function r(_,u){a[" "+_]||(n.test(_)?a[" "+_]=_+"/":a[" "+_]=m(_,"/",!0)),_=a[" "+_];const h=_.indexOf(":")===-1;return u.substring(0,2)==="//"?h?u:_.replace(l,"$1")+u:u.charAt(0)==="/"?h?u:_.replace(s,"$1")+u:_+u}const i={exec:function(){}};function t(_){let u=1,h,c;for(;u<arguments.length;u++){h=arguments[u];for(c in h)Object.prototype.hasOwnProperty.call(h,c)&&(_[c]=h[c])}return _}function y(_,u){const h=_.replace(/\|/g,(T,b,S)=>{let D=!1,I=b;for(;--I>=0&&S[I]==="\\";)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(_,u,h){const c=_.length;if(c===0)return"";let d=0;for(;d<c;){const T=_.charAt(c-d-1);if(T===u&&!h)d++;else if(T!==u&&h)d++;else break}return _.substr(0,c-d)}function g(_,u){if(_.indexOf(u[1])===-1)return-1;const h=_.length;let c=0,d=0;for(;d<h;d++)if(_[d]==="\\")d++;else if(_[d]===u[0])c++;else if(_[d]===u[1]&&(c--,c<0))return d;return-1}function E(_){_&&_.sanitize&&!_.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")}Qe.exports={escape:R,unescape:N,edit:A,cleanUrl:o,resolveUrl:r,noopTest:i,merge:t,splitCells:y,rtrim:m,findClosingBracket:g,checkSanitizeDeprecation:E}},sboe:function(Qe,ue,W){"use strict";W.d(ue,"a",function(){return C});var te=W("q1tI"),H=W.n(te),C=te.createContext(null)},t9D7:function(Qe,ue,W){"use strict";W.d(ue,"b",function(){return B}),W.d(ue,"g",function(){return e}),W.d(ue,"d",function(){return A}),W.d(ue,"e",function(){return f}),W.d(ue,"a",function(){return p}),W.d(ue,"f",function(){return n}),W.d(ue,"c",function(){return l});var te=W("Vhoy"),H=W("MI8n"),C=W("pmY6"),j=W("Cg/j"),L=W("ic2d"),R=W("nEHx");const B=Object(j.c)("themeService");var N;(function(s){function r(i){return i&&typeof i=="object"&&typeof i.id=="string"}s.isThemeColor=r})(N||(N={}));function e(s){return{id:s}}var A;(function(s){function r(E){return E&&typeof E=="object"&&typeof E.id=="string"&&(typeof E.color=="undefined"||N.isThemeColor(E.color))}s.isThemeIcon=r;const i=new RegExp(`^\\$\\((${te.a.iconNameExpression}(?:${te.a.iconModifierExpression})?)\\)$`);function t(E){const _=i.exec(E);if(!_)return;let[,u]=_;return{id:u}}s.fromString=t;function y(E,_){let u=E.id;const h=u.lastIndexOf("~");return h!==-1&&(u=u.substring(0,h)),_&&(u=`${u}~${_}`),{id:u}}s.modify=y;function m(E,_){var u,h;return E.id===_.id&&((u=E.color)===null||u===void 0?void 0:u.id)===((h=_.color)===null||h===void 0?void 0:h.id)}s.isEqual=m;function g(E,_){return{id:E.id,color:_?e(_):void 0}}s.asThemeIcon=g,s.asClassNameArray=te.a.asClassNameArray,s.asClassName=te.a.asClassName,s.asCSSSelector=te.a.asCSSSelector})(A||(A={}));function f(s){switch(s){case R.a.DARK:return"vs-dark";case R.a.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const p={ThemingContribution:"base.contributions.theming"};class o{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new H.b}onColorThemeChange(s){return this.themingParticipants.push(s),this.onThemingParticipantAddedEmitter.fire(s),Object(C.i)(()=>{const r=this.themingParticipants.indexOf(s);this.themingParticipants.splice(r,1)})}getThemingParticipants(){return this.themingParticipants}}let a=new o;L.a.add(p.ThemingContribution,a);function n(s){return a.onColorThemeChange(s)}class l extends C.a{constructor(s){super();this.themeService=s,this.theme=s.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(r=>this.onThemeChange(r)))}onThemeChange(s){this.theme=s,this.updateStyles()}updateStyles(){}}},ulZh:function(Qe,ue,W){typeof window!="undefined"&&function(H,C){Qe.exports=C()}(this,function(){return function(te){var H={};function C(j){if(H[j])return H[j].exports;var L=H[j]={i:j,l:!1,exports:{}};return te[j].call(L.exports,L,L.exports,C),L.l=!0,L.exports}return C.m=te,C.c=H,C.d=function(j,L,R){C.o(j,L)||Object.defineProperty(j,L,{enumerable:!0,get:R})},C.r=function(j){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(j,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(j,"__esModule",{value:!0})},C.t=function(j,L){if(L&1&&(j=C(j)),L&8)return j;if(L&4&&typeof j=="object"&&j&&j.__esModule)return j;var R=Object.create(null);if(C.r(R),Object.defineProperty(R,"default",{enumerable:!0,value:j}),L&2&&typeof j!="string")for(var B in j)C.d(R,B,function(N){return j[N]}.bind(null,B));return R},C.n=function(j){var L=j&&j.__esModule?function(){return j.default}:function(){return j};return C.d(L,"a",L),L},C.o=function(j,L){return Object.prototype.hasOwnProperty.call(j,L)},C.p="/dist/",C(C.s="./src/hls.ts")}({"./node_modules/eventemitter3/index.js":function(te,H,C){"use strict";var j=Object.prototype.hasOwnProperty,L="~";function R(){}Object.create&&(R.prototype=Object.create(null),new R().__proto__||(L=!1));function B(f,p,o){this.fn=f,this.context=p,this.once=o||!1}function N(f,p,o,a,n){if(typeof o!="function")throw new TypeError("The listener must be a function");var l=new B(o,a||f,n),s=L?L+p:p;return f._events[s]?f._events[s].fn?f._events[s]=[f._events[s],l]:f._events[s].push(l):(f._events[s]=l,f._eventsCount++),f}function e(f,p){--f._eventsCount===0?f._events=new R:delete f._events[p]}function A(){this._events=new R,this._eventsCount=0}A.prototype.eventNames=function(){var p=[],o,a;if(this._eventsCount===0)return p;for(a in o=this._events)j.call(o,a)&&p.push(L?a.slice(1):a);return Object.getOwnPropertySymbols?p.concat(Object.getOwnPropertySymbols(o)):p},A.prototype.listeners=function(p){var o=L?L+p:p,a=this._events[o];if(!a)return[];if(a.fn)return[a.fn];for(var n=0,l=a.length,s=new Array(l);n<l;n++)s[n]=a[n].fn;return s},A.prototype.listenerCount=function(p){var o=L?L+p:p,a=this._events[o];return a?a.fn?1:a.length:0},A.prototype.emit=function(p,o,a,n,l,s){var r=L?L+p:p;if(!this._events[r])return!1;var i=this._events[r],t=arguments.length,y,m;if(i.fn){i.once&&this.removeListener(p,i.fn,void 0,!0);switch(t){case 1:return i.fn.call(i.context),!0;case 2:return i.fn.call(i.context,o),!0;case 3:return i.fn.call(i.context,o,a),!0;case 4:return i.fn.call(i.context,o,a,n),!0;case 5:return i.fn.call(i.context,o,a,n,l),!0;case 6:return i.fn.call(i.context,o,a,n,l,s),!0}for(m=1,y=new Array(t-1);m<t;m++)y[m-1]=arguments[m];i.fn.apply(i.context,y)}else{var g=i.length,E;for(m=0;m<g;m++){i[m].once&&this.removeListener(p,i[m].fn,void 0,!0);switch(t){case 1:i[m].fn.call(i[m].context);break;case 2:i[m].fn.call(i[m].context,o);break;case 3:i[m].fn.call(i[m].context,o,a);break;case 4:i[m].fn.call(i[m].context,o,a,n);break;default:if(!y)for(E=1,y=new Array(t-1);E<t;E++)y[E-1]=arguments[E];i[m].fn.apply(i[m].context,y)}}}return!0},A.prototype.on=function(p,o,a){return N(this,p,o,a,!1)},A.prototype.once=function(p,o,a){return N(this,p,o,a,!0)},A.prototype.removeListener=function(p,o,a,n){var l=L?L+p:p;if(!this._events[l])return this;if(!o)return e(this,l),this;var s=this._events[l];if(s.fn)s.fn===o&&(!n||s.once)&&(!a||s.context===a)&&e(this,l);else{for(var r=0,i=[],t=s.length;r<t;r++)(s[r].fn!==o||n&&!s[r].once||a&&s[r].context!==a)&&i.push(s[r]);i.length?this._events[l]=i.length===1?i[0]:i:e(this,l)}return this},A.prototype.removeAllListeners=function(p){var o;return p?(o=L?L+p:p,this._events[o]&&e(this,o)):(this._events=new R,this._eventsCount=0),this},A.prototype.off=A.prototype.removeListener,A.prototype.addListener=A.prototype.on,A.prefixed=L,A.EventEmitter=A,te.exports=A},"./node_modules/url-toolkit/src/url-toolkit.js":function(te,H,C){(function(j){var L=/^((?:[a-zA-Z0-9+\-.]+:)?)(\/\/[^\/?#]*)?((?:[^\/?#]*\/)*[^;?#]*)?(;[^?#]*)?(\?[^#]*)?(#[^]*)?$/,R=/^([^\/?#]*)([^]*)$/,B=/(?:\/|^)\.(?=\/)/g,N=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(A,f,p){if(p=p||{},A=A.trim(),f=f.trim(),!f){if(!p.alwaysNormalize)return A;var o=e.parseURL(A);if(!o)throw new Error("Error trying to parse base URL.");return o.path=e.normalizePath(o.path),e.buildURLFromParts(o)}var a=e.parseURL(f);if(!a)throw new Error("Error trying to parse relative URL.");if(a.scheme)return p.alwaysNormalize?(a.path=e.normalizePath(a.path),e.buildURLFromParts(a)):f;var n=e.parseURL(A);if(!n)throw new Error("Error trying to parse base URL.");if(!n.netLoc&&n.path&&n.path[0]!=="/"){var l=R.exec(n.path);n.netLoc=l[1],n.path=l[2]}n.netLoc&&!n.path&&(n.path="/");var s={scheme:n.scheme,netLoc:a.netLoc,path:null,params:a.params,query:a.query,fragment:a.fragment};if(!a.netLoc&&(s.netLoc=n.netLoc,a.path[0]!=="/"))if(!a.path)s.path=n.path,a.params||(s.params=n.params,a.query||(s.query=n.query));else{var r=n.path,i=r.substring(0,r.lastIndexOf("/")+1)+a.path;s.path=e.normalizePath(i)}return s.path===null&&(s.path=p.alwaysNormalize?e.normalizePath(a.path):a.path),e.buildURLFromParts(s)},parseURL:function(A){var f=L.exec(A);return f?{scheme:f[1]||"",netLoc:f[2]||"",path:f[3]||"",params:f[4]||"",query:f[5]||"",fragment:f[6]||""}:null},normalizePath:function(A){for(A=A.split("").reverse().join("").replace(B,"");A.length!==(A=A.replace(N,"")).length;);return A.split("").reverse().join("")},buildURLFromParts:function(A){return A.scheme+A.netLoc+A.path+A.params+A.query+A.fragment}};te.exports=e})(this)},"./node_modules/webworkify-webpack/index.js":function(te,H,C){function j(p){var o={};function a(l){if(o[l])return o[l].exports;var s=o[l]={i:l,l:!1,exports:{}};return p[l].call(s.exports,s,s.exports,a),s.l=!0,s.exports}a.m=p,a.c=o,a.i=function(l){return l},a.d=function(l,s,r){a.o(l,s)||Object.defineProperty(l,s,{configurable:!1,enumerable:!0,get:r})},a.r=function(l){Object.defineProperty(l,"__esModule",{value:!0})},a.n=function(l){var s=l&&l.__esModule?function(){return l.default}:function(){return l};return a.d(s,"a",s),s},a.o=function(l,s){return Object.prototype.hasOwnProperty.call(l,s)},a.p="/",a.oe=function(l){throw console.error(l),l};var n=a(a.s=ENTRY_MODULE);return n.default||n}var L="[\\.|\\-|\\+|\\w|/|@]+",R="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+L+").*?\\)";function B(p){return(p+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function N(p){return!isNaN(1*p)}function e(p,o,a){var n={};n[a]=[];var l=o.toString(),s=l.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/);if(!s)return n;for(var r=s[1],i=new RegExp("(\\\\n|\\W)"+B(r)+R,"g"),t;t=i.exec(l);){if(t[3]==="dll-reference")continue;n[a].push(t[3])}for(i=new RegExp("\\("+B(r)+'\\("(dll-reference\\s('+L+'))"\\)\\)'+R,"g");t=i.exec(l);)p[t[2]]||(n[a].push(t[1]),p[t[2]]=C(t[1]).m),n[t[2]]=n[t[2]]||[],n[t[2]].push(t[4]);for(var y=Object.keys(n),m=0;m<y.length;m++)for(var g=0;g<n[y[m]].length;g++)N(n[y[m]][g])&&(n[y[m]][g]=1*n[y[m]][g]);return n}function A(p){var o=Object.keys(p);return o.reduce(function(a,n){return a||p[n].length>0},!1)}function f(p,o){for(var a={main:[o]},n={main:[]},l={main:{}};A(a);)for(var s=Object.keys(a),r=0;r<s.length;r++){var i=s[r],t=a[i],y=t.pop();if(l[i]=l[i]||{},l[i][y]||!p[i][y])continue;l[i][y]=!0,n[i]=n[i]||[],n[i].push(y);for(var m=e(p,p[i][y],i),g=Object.keys(m),E=0;E<g.length;E++)a[g[E]]=a[g[E]]||[],a[g[E]]=a[g[E]].concat(m[g[E]])}return n}te.exports=function(p,o){o=o||{};var a={main:C.m},n=o.all?{main:Object.keys(a.main)}:f(a,p),l="";Object.keys(n).filter(function(y){return y!=="main"}).forEach(function(y){for(var m=0;n[y][m];)m++;n[y].push(m),a[y][m]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",l=l+"var "+y+" = ("+j.toString().replace("ENTRY_MODULE",JSON.stringify(m))+")({"+n[y].map(function(g){return""+JSON.stringify(g)+": "+a[y][g].toString()}).join(",")+`});
|
|
`}),l=l+"new (("+j.toString().replace("ENTRY_MODULE",JSON.stringify(p))+")({"+n.main.map(function(y){return""+JSON.stringify(y)+": "+a.main[y].toString()}).join(",")+"}))(self);";var s=new window.Blob([l],{type:"text/javascript"});if(o.bare)return s;var r=window.URL||window.webkitURL||window.mozURL||window.msURL,i=r.createObjectURL(s),t=new window.Worker(i);return t.objectURL=i,t}},"./src/config.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"hlsDefaultConfig",function(){return E}),C.d(H,"mergeConfig",function(){return u}),C.d(H,"enableStreamingMode",function(){return h});var j=C("./src/controller/abr-controller.ts"),L=C("./src/controller/audio-stream-controller.ts"),R=C("./src/controller/audio-track-controller.ts"),B=C("./src/controller/subtitle-stream-controller.ts"),N=C("./src/controller/subtitle-track-controller.ts"),e=C("./src/controller/buffer-controller.ts"),A=C("./src/controller/timeline-controller.ts"),f=C("./src/controller/cap-level-controller.ts"),p=C("./src/controller/fps-controller.ts"),o=C("./src/controller/eme-controller.ts"),a=C("./src/controller/cmcd-controller.ts"),n=C("./src/utils/xhr-loader.ts"),l=C("./src/utils/fetch-loader.ts"),s=C("./src/utils/cues.ts"),r=C("./src/utils/mediakeys-helper.ts"),i=C("./src/utils/logger.ts");function t(){return t=Object.assign||function(c){for(var d=1;d<arguments.length;d++){var T=arguments[d];for(var b in T)Object.prototype.hasOwnProperty.call(T,b)&&(c[b]=T[b])}return c},t.apply(this,arguments)}function y(c,d){var T=Object.keys(c);if(Object.getOwnPropertySymbols){var b=Object.getOwnPropertySymbols(c);d&&(b=b.filter(function(S){return Object.getOwnPropertyDescriptor(c,S).enumerable})),T.push.apply(T,b)}return T}function m(c){for(var d=1;d<arguments.length;d++){var T=arguments[d]!=null?arguments[d]:{};d%2?y(Object(T),!0).forEach(function(b){g(c,b,T[b])}):Object.getOwnPropertyDescriptors?Object.defineProperties(c,Object.getOwnPropertyDescriptors(T)):y(Object(T)).forEach(function(b){Object.defineProperty(c,b,Object.getOwnPropertyDescriptor(T,b))})}return c}function g(c,d,T){return d in c?Object.defineProperty(c,d,{value:T,enumerable:!0,configurable:!0,writable:!0}):c[d]=T,c}var E=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:n.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:j.default,bufferController:e.default,capLevelController:f.default,fpsController:p.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:r.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0},_()),{},{subtitleStreamController:B.SubtitleStreamController,subtitleTrackController:N.default,timelineController:A.TimelineController,audioStreamController:L.default,audioTrackController:R.default,emeController:o.default,cmcdController:a.default});function _(){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!==n.default)i.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),c.progressive=!1;else{var T=Object(l.fetchSupported)();T&&(c.loader=l.default,c.progressive=!0,c.enableSoftwareAES=!0,i.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/utils/ewma-bandwidth-estimator.ts"),R=C("./src/events.ts"),B=C("./src/utils/buffer-helper.ts"),N=C("./src/errors.ts"),e=C("./src/types/loader.ts"),A=C("./src/utils/logger.ts");function f(a,n){for(var l=0;l<n.length;l++){var s=n[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function p(a,n,l){return n&&f(a.prototype,n),l&&f(a,l),a}var o=function(){function a(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 L.default(s.abrEwmaSlowVoD,s.abrEwmaFastVoD,s.abrEwmaDefaultEstimate),this.registerListeners()}var n=a.prototype;return n.registerListeners=function(){var s=this.hls;s.on(R.Events.FRAG_LOADING,this.onFragLoading,this),s.on(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.on(R.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var s=this.hls;s.off(R.Events.FRAG_LOADING,this.onFragLoading,this),s.off(R.Events.FRAG_LOADED,this.onFragLoaded,this),s.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this),s.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),s.off(R.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},n.onFragLoading=function(s,r){var i=r.frag;if(i.type===e.PlaylistLevelType.MAIN&&!this.timer){var t;this.fragCurrent=i,this.partCurrent=(t=r.part)!=null?t:null,this.timer=self.setInterval(this.onCheck,100)}},n.onLevelLoaded=function(s,r){var i=this.hls.config;r.details.live?this.bwEstimator.update(i.abrEwmaSlowLive,i.abrEwmaFastLive):this.bwEstimator.update(i.abrEwmaSlowVoD,i.abrEwmaFastVoD)},n._abandonRulesCheck=function(){var s=this.fragCurrent,r=this.partCurrent,i=this.hls,t=i.autoLevelEnabled,y=i.config,m=i.media;if(!s||!m)return;var g=r?r.stats:s.stats,E=r?r.duration:s.duration;if(g.aborted){A.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 _=performance.now()-g.loading.start,u=Math.abs(m.playbackRate);if(_<=500*E/u)return;var h=i.levels,c=i.minAutoLevel,d=h[s.level],T=g.total||Math.max(g.loaded,Math.round(E*d.maxBitrate/8)),b=Math.max(1,g.bwEstimate?g.bwEstimate/8:g.loaded*1e3/_),S=(T-g.loaded)/b,D=m.currentTime,I=(B.BufferHelper.bufferInfo(m,D,y.maxBufferHole).end-D)/u;if(I>=2*E/u||S<=I)return;var w=Number.POSITIVE_INFINITY,P;for(P=s.level-1;P>c;P--){var U=h[P].maxBitrate;if(w=E*U/(8*.8*b),w<I)break}if(w>=S)return;var O=this.bwEstimator.getEstimate();A.logger.warn("Fragment "+s.sn+(r?" part "+r.index:"")+" of level "+s.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+P+`
|
|
Current BW estimate: `+(Object(j.isFiniteNumber)(O)?(O/1024).toFixed(3):"Unknown")+` Kb/s
|
|
Estimated load time for current fragment: `+S.toFixed(3)+` s
|
|
Estimated load time for the next fragment: `+w.toFixed(3)+` s
|
|
Time to underbuffer: `+I.toFixed(3)+" s"),i.nextLoadLevel=P,this.bwEstimator.sample(_,g.loaded),this.clearTimer(),s.loader&&(this.fragCurrent=this.partCurrent=null,s.loader.abort()),i.trigger(R.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:r,stats:g})},n.onFragLoaded=function(s,r){var i=r.frag,t=r.part;if(i.type===e.PlaylistLevelType.MAIN&&Object(j.isFiniteNumber)(i.sn)){var y=t?t.stats:i.stats,m=t?t.duration:i.duration;if(this.clearTimer(),this.lastLoadedFragLevel=i.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var g=this.hls.levels[i.level],E=(g.loaded?g.loaded.bytes:0)+y.loaded,_=(g.loaded?g.loaded.duration:0)+m;g.loaded={bytes:E,duration:_},g.realBitrate=Math.round(8*E/_)}if(i.bitrateTest){var u={stats:y,frag:i,part:t,id:i.type};this.onFragBuffered(R.Events.FRAG_BUFFERED,u),i.bitrateTest=!1}}},n.onFragBuffered=function(s,r){var i=r.frag,t=r.part,y=t?t.stats:i.stats;if(y.aborted)return;if(i.type!==e.PlaylistLevelType.MAIN||i.sn==="initSegment")return;var m=y.parsing.end-y.loading.start;this.bwEstimator.sample(m,y.loaded),y.bwEstimate=this.bwEstimator.getEstimate(),i.bitrateTest?this.bitrateTestDelay=m/1e3:this.bitrateTestDelay=0},n.onError=function(s,r){switch(r.details){case N.ErrorDetails.FRAG_LOAD_ERROR:case N.ErrorDetails.FRAG_LOAD_TIMEOUT:this.clearTimer();break;default:break}},n.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},n.getNextABRAutoLevel=function(){var s=this.fragCurrent,r=this.partCurrent,i=this.hls,t=i.maxAutoLevel,y=i.config,m=i.minAutoLevel,g=i.media,E=r?r.duration:s?s.duration:0,_=g?g.currentTime:0,u=g&&g.playbackRate!==0?Math.abs(g.playbackRate):1,h=this.bwEstimator?this.bwEstimator.getEstimate():y.abrEwmaDefaultEstimate,c=(B.BufferHelper.bufferInfo(g,_,y.maxBufferHole).end-_)/u,d=this.findBestLevel(h,m,t,c,y.abrBandWidthFactor,y.abrBandWidthUpFactor);if(d>=0)return d;A.logger.trace((c?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var T=E?Math.min(E,y.maxStarvationDelay):y.maxStarvationDelay,b=y.abrBandWidthFactor,S=y.abrBandWidthUpFactor;if(!c){var D=this.bitrateTestDelay;if(D){var I=E?Math.min(E,y.maxLoadingDelay):y.maxLoadingDelay;T=I-D,A.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*T)+" ms"),b=S=1}}return d=this.findBestLevel(h,m,t,c+T,b,S),Math.max(d,0)},n.findBestLevel=function(s,r,i,t,y,m){for(var g,E=this.fragCurrent,_=this.partCurrent,u=this.lastLoadedFragLevel,h=this.hls.levels,c=h[u],d=!!(c!=null&&(g=c.details)!==null&&g!==void 0&&g.live),T=c==null?void 0:c.codecSet,b=_?_.duration:E?E.duration:0,S=i;S>=r;S--){var D=h[S];if(!D||T&&D.codecSet!==T)continue;var I=D.details,w=(_?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||b,P=void 0;S<=u?P=y*s:P=m*s;var U=h[S].maxBitrate,O=U*w/P;if(A.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+S+"/"+Math.round(P)+"/"+U+"/"+w+"/"+t+"/"+O),P>U&&(!O||d&&!this.bitrateTestDelay||O<t))return S}return-1},p(a,[{key:"nextAutoLevel",get:function(){var s=this._nextAutoLevel,r=this.bwEstimator;if(s!==-1&&(!r||!r.canEstimate()))return s;var i=this.getNextABRAutoLevel();return s!==-1&&(i=Math.min(s,i)),i},set:function(s){this._nextAutoLevel=s}}]),a}();H.default=o},"./src/controller/audio-stream-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/controller/base-stream-controller.ts"),R=C("./src/events.ts"),B=C("./src/utils/buffer-helper.ts"),N=C("./src/controller/fragment-tracker.ts"),e=C("./src/types/level.ts"),A=C("./src/types/loader.ts"),f=C("./src/loader/fragment.ts"),p=C("./src/demux/chunk-cache.ts"),o=C("./src/demux/transmuxer-interface.ts"),a=C("./src/types/transmuxer.ts"),n=C("./src/controller/fragment-finders.ts"),l=C("./src/utils/discontinuities.ts"),s=C("./src/errors.ts"),r=C("./src/utils/logger.ts");function i(){return i=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var u=arguments[_];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(E[h]=u[h])}return E},i.apply(this,arguments)}function t(E,_){E.prototype=Object.create(_.prototype),E.prototype.constructor=E,y(E,_)}function y(E,_){return y=Object.setPrototypeOf||function(h,c){return h.__proto__=c,h},y(E,_)}var m=100,g=function(E){t(_,E);function _(h,c){var d;return d=E.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=_.prototype;return u.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},u._registerListeners=function(){var c=this.hls;c.on(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.on(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),c.on(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.on(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(R.Events.ERROR,this.onError,this),c.on(R.Events.BUFFER_RESET,this.onBufferReset,this),c.on(R.Events.BUFFER_CREATED,this.onBufferCreated,this),c.on(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.on(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},u._unregisterListeners=function(){var c=this.hls;c.off(R.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(R.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(R.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(R.Events.LEVEL_LOADED,this.onLevelLoaded,this),c.off(R.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),c.off(R.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),c.off(R.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(R.Events.ERROR,this.onError,this),c.off(R.Events.BUFFER_RESET,this.onBufferReset,this),c.off(R.Events.BUFFER_CREATED,this.onBufferCreated,this),c.off(R.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),c.off(R.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.off(R.Events.FRAG_BUFFERED,this.onFragBuffered,this)},u.onInitPtsFound=function(c,d){var T=d.frag,b=d.id,S=d.initPTS;if(b==="main"){var D=T.cc;this.initPTS[T.cc]=S,this.log("InitPTS for cc: "+D+" found from main: "+S),this.videoTrackCC=D,this.state===L.State.WAITING_INIT_PTS&&this.tick()}},u.startLoad=function(c){if(!this.levels){this.startPosition=c,this.state=L.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=L.State.IDLE):(this.loadedmetadata=!1,this.state=L.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=c,this.tick()},u.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_TRACK:{var c,d=this.levels,T=this.trackId,b=d==null||((c=d[T])===null||c===void 0)?void 0:c.details;if(b){if(this.waitForCdnTuneIn(b))break;this.state=L.State.WAITING_INIT_PTS}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var S,D=performance.now(),I=this.retryDate;(!I||D>=I||(S=this.media)!==null&&S!==void 0&&S.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.state=L.State.IDLE);break}case L.State.WAITING_INIT_PTS:{var w=this.waitingData;if(w){var P=w.frag,U=w.part,O=w.cache,G=w.complete;if(this.initPTS[P.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=L.State.FRAG_LOADING;var V=O.flush(),ae={frag:P,part:U,payload:V,networkDetails:null};this._handleFragmentLoadProgress(ae),G&&E.prototype._handleFragmentLoadComplete.call(this,ae)}else if(this.videoTrackCC!==this.waitingVideoCC)r.logger.log("Waiting fragment cc ("+P.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var ie=this.getLoadPosition(),fe=B.BufferHelper.bufferInfo(this.mediaBuffer,ie,this.config.maxBufferHole),ce=Object(n.fragmentWithinToleranceTest)(fe.end,this.config.maxFragLookUpTolerance,P);ce<0&&(r.logger.log("Waiting fragment cc ("+P.cc+") @ "+P.start+" cancelled because another fragment at "+fe.end+" is needed"),this.clearWaitingFragment())}}else this.state=L.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=L.State.IDLE)},u.onTickEnd=function(){var c=this.media;if(!c||!c.readyState)return;var d=this.mediaBuffer?this.mediaBuffer:c,T=d.buffered;!this.loadedmetadata&&T.length&&(this.loadedmetadata=!0),this.lastCurrentTime=c.currentTime},u.doTickIdle=function(){var c,d,T=this.hls,b=this.levels,S=this.media,D=this.trackId,I=T.config;if(!b||!b[D])return;if(!S&&(this.startFragRequested||!I.startFragPrefetch))return;var w=b[D],P=w.details;if(!P||P.live&&this.levelLastLoaded!==D||this.waitForCdnTuneIn(P)){this.state=L.State.WAITING_TRACK;return}this.bufferFlushed&&(this.bufferFlushed=!1,this.afterBufferFlushed(this.mediaBuffer?this.mediaBuffer:this.media,f.ElementaryStreamTypes.AUDIO,A.PlaylistLevelType.AUDIO));var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,A.PlaylistLevelType.AUDIO);if(U===null)return;var O=U.len,G=this.getMaxBufferLength(),V=this.audioSwitch;if(O>=G&&!V)return;if(!V&&this._streamEnded(U,P)){T.trigger(R.Events.BUFFER_EOS,{type:"audio"}),this.state=L.State.ENDED;return}var ae=P.fragments,ie=ae[0].start,fe=U.end;if(V){var ce=this.getLoadPosition();fe=ce,P.PTSKnown&&ce<ie&&((U.end>ie||U.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),S.currentTime=ie+.05))}var J=this.getNextFragment(fe,P);if(!J){this.bufferFlushed=!0;return}((c=J.decryptdata)===null||c===void 0?void 0:c.keyFormat)==="identity"&&!((d=J.decryptdata)!==null&&d!==void 0&&d.key)?this.loadKey(J,P):this.loadFragment(J,P,fe)},u.getMaxBufferLength=function(){var c=E.prototype.getMaxBufferLength.call(this),d=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,A.PlaylistLevelType.MAIN);return d===null?c:Math.max(c,d.len)},u.onMediaDetaching=function(){this.videoBuffer=null,E.prototype.onMediaDetaching.call(this)},u.onAudioTracksUpdated=function(c,d){var T=d.audioTracks;this.resetTransmuxer(),this.levels=T.map(function(b){return new e.Level(b)})},u.onAudioTrackSwitching=function(c,d){var T=!!d.url;this.trackId=d.id;var b=this.fragCurrent;b!=null&&b.loader&&b.loader.abort(),this.fragCurrent=null,this.clearWaitingFragment(),T?this.setInterval(m):this.resetTransmuxer(),T?(this.audioSwitch=!0,this.state=L.State.IDLE):this.state=L.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 T,b=this.levels,S=d.details,D=d.id;if(!b){this.warn("Audio tracks were reset while loading level "+D);return}this.log("Track "+D+" loaded ["+S.startSN+","+S.endSN+"],duration:"+S.totalduration);var I=b[D],w=0;if(S.live||(T=I.details)!==null&&T!==void 0&&T.live){var P=this.mainDetails;if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed||!P)return;!I.details&&S.hasProgramDateTime&&P.hasProgramDateTime?(Object(l.alignMediaPlaylistByPDT)(S,P),w=S.fragments[0].start):w=this.alignPlaylists(S,I.details)}I.details=S,this.levelLastLoaded=D,!this.startFragRequested&&(this.mainDetails||!S.live)&&this.setStartPosition(I.details,w),this.state===L.State.WAITING_TRACK&&!this.waitForCdnTuneIn(S)&&(this.state=L.State.IDLE),this.tick()},u._handleFragmentLoadProgress=function(c){var d,T=c.frag,b=c.part,S=c.payload,D=this.config,I=this.trackId,w=this.levels;if(!w){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+T.sn+" of level "+T.level+" will not be buffered");return}var P=w[I];console.assert(P,"Audio track is defined on fragment load progress");var U=P.details;console.assert(U,"Audio track details are defined on fragment load progress");var O=D.defaultAudioCodec||P.audioCodec||"mp4a.40.2",G=this.transmuxer;G||(G=this.transmuxer=new o.default(this.hls,A.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var V=this.initPTS[T.cc],ae=(d=T.initSegment)===null||d===void 0?void 0:d.data;if(V!==void 0){var ie=!1,fe=b?b.index:-1,ce=fe!==-1,J=new a.ChunkMetadata(T.level,T.sn,T.stats.chunkCount,S.byteLength,fe,ce);G.push(S,ae,O,"",T,b,U.totalduration,ie,J,V)}else{r.logger.log("Unknown video PTS for cc "+T.cc+", waiting for video PTS before demuxing audio frag "+T.sn+" of ["+U.startSN+" ,"+U.endSN+"],track "+I);var Z=this.waitingData=this.waitingData||{frag:T,part:b,cache:new p.default,complete:!1},he=Z.cache;he.push(new Uint8Array(S)),this.waitingVideoCC=this.videoTrackCC,this.state=L.State.WAITING_INIT_PTS}},u._handleFragmentLoadComplete=function(c){if(this.waitingData){this.waitingData.complete=!0;return}E.prototype._handleFragmentLoadComplete.call(this,c)},u.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},u.onBufferCreated=function(c,d){var T=d.tracks.audio;T&&(this.mediaBuffer=T.buffer),d.tracks.video&&(this.videoBuffer=d.tracks.video.buffer)},u.onFragBuffered=function(c,d){var T=d.frag,b=d.part;if(T.type!==A.PlaylistLevelType.AUDIO)return;if(this.fragContextChanged(T)){this.warn("Fragment "+T.sn+(b?" p: "+b.index:"")+" of level "+T.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}T.sn!=="initSegment"&&(this.fragPrevious=T,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(T,b)},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(A.PlaylistLevelType.AUDIO,d);break;case s.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case s.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==L.State.ERROR&&this.state!==L.State.STOPPED&&(this.state=d.fatal?L.State.ERROR:L.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===L.State.PARSING||this.state===L.State.PARSED)){var T=!0,b=this.getFwdBufferInfo(this.mediaBuffer,A.PlaylistLevelType.AUDIO);b&&b.len>.5&&(T=!this.reduceMaxBufferLength(b.len)),T&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},u.onBufferFlushed=function(c,d){var T=d.type;T===f.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0)},u._handleTransmuxComplete=function(c){var d,T="audio",b=this.hls,S=c.remuxResult,D=c.chunkMeta,I=this.getCurrentContext(D);if(!I){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 w=I.frag,P=I.part,U=S.audio,O=S.text,G=S.id3,V=S.initSegment;if(this.fragContextChanged(w))return;if(this.state=L.State.PARSING,this.audioSwitch&&U&&this.completeAudioSwitch(),V!=null&&V.tracks&&(this._bufferInitSegment(V.tracks,w,D),b.trigger(R.Events.FRAG_PARSING_INIT_SEGMENT,{frag:w,id:T,tracks:V.tracks})),U){var ae=U.startPTS,ie=U.endPTS,fe=U.startDTS,ce=U.endDTS;P&&(P.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:ae,endPTS:ie,startDTS:fe,endDTS:ce}),w.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,ae,ie,fe,ce),this.bufferFragmentData(U,w,P,D)}if(G!=null&&(d=G.samples)!==null&&d!==void 0&&d.length){var J=i({frag:w,id:T},G);b.trigger(R.Events.FRAG_PARSING_METADATA,J)}if(O){var Z=i({frag:w,id:T},O);b.trigger(R.Events.FRAG_PARSING_USERDATA,Z)}},u._bufferInitSegment=function(c,d,T){if(this.state!==L.State.PARSING)return;c.video&&delete c.video;var b=c.audio;if(!b)return;b.levelCodec=b.codec,b.id="audio",this.log("Init audio buffer, container:"+b.container+", codecs[parsed]=["+b.codec+"]"),this.hls.trigger(R.Events.BUFFER_CODECS,c);var S=b.initSegment;if(S!=null&&S.byteLength){var D={type:"audio",frag:d,part:null,chunkMeta:T,parent:d.type,data:S};this.hls.trigger(R.Events.BUFFER_APPENDING,D)}this.tick()},u.loadFragment=function(c,d,T){var b=this.fragmentTracker.getState(c);this.fragCurrent=c,(this.audioSwitch||b===N.FragmentState.NOT_LOADED||b===N.FragmentState.PARTIAL)&&(c.sn==="initSegment"?this._loadInitSegment(c):d.live&&!Object(j.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=L.State.WAITING_INIT_PTS):(this.startFragRequested=!0,E.prototype.loadFragment.call(this,c,d,T)))},u.completeAudioSwitch=function(){var c=this.hls,d=this.media,T=this.trackId;d&&(this.log("Switching audio track : flushing all audio"),E.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,c.trigger(R.Events.AUDIO_TRACK_SWITCHED,{id:T})},_}(L.default);H.default=g},"./src/controller/audio-track-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/controller/base-playlist-controller.ts"),B=C("./src/types/loader.ts");function N(o,a){for(var n=0;n<a.length;n++){var l=a[n];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(o,l.key,l)}}function e(o,a,n){return a&&N(o.prototype,a),n&&N(o,n),o}function A(o,a){o.prototype=Object.create(a.prototype),o.prototype.constructor=o,f(o,a)}function f(o,a){return f=Object.setPrototypeOf||function(l,s){return l.__proto__=s,l},f(o,a)}var p=function(o){A(a,o);function a(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 n=a.prototype;return n.registerListeners=function(){var s=this.hls;s.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),s.on(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.on(j.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.on(j.Events.ERROR,this.onError,this)},n.unregisterListeners=function(){var s=this.hls;s.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),s.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),s.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),s.off(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),s.off(j.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),s.off(j.Events.ERROR,this.onError,this)},n.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,o.prototype.destroy.call(this)},n.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},n.onManifestParsed=function(s,r){this.tracks=r.audioTracks||[]},n.onAudioTrackLoaded=function(s,r){var i=r.id,t=r.details,y=this.tracksInGroup[i];if(!y){this.warn("Invalid audio track id "+i);return}var m=y.details;y.details=r.details,this.log("audioTrack "+i+" loaded ["+t.startSN+"-"+t.endSN+"]"),i===this.trackId&&(this.retryCount=0,this.playlistLoaded(i,r,m))},n.onLevelLoading=function(s,r){this.switchLevel(r.level)},n.onLevelSwitching=function(s,r){this.switchLevel(r.level)},n.switchLevel=function(s){var r=this.hls.levels[s];if(!(r!=null&&r.audioGroupIds))return;var i=r.audioGroupIds[r.urlId];if(this.groupId!==i){this.groupId=i;var t=this.tracks.filter(function(m){return!i||m.groupId===i});this.selectDefaultTrack&&!t.some(function(m){return m.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=t;var y={audioTracks:t};this.log("Updating audio tracks, "+t.length+' track(s) found in "'+i+'" group-id'),this.hls.trigger(j.Events.AUDIO_TRACKS_UPDATED,y),this.selectInitialTrack()}},n.onError=function(s,r){if(o.prototype.onError.call(this,s,r),r.fatal||!r.context)return;r.context.type===B.PlaylistContextType.AUDIO_TRACK&&r.context.id===this.trackId&&r.context.groupId===this.groupId&&this.retryLoadingOrFail(r)},n.setAudioTrack=function(s){var r=this.tracksInGroup;if(s<0||s>=r.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var i=r[this.trackId];this.log("Now switching to audio-track index "+s);var t=r[s],y=t.id,m=t.groupId,g=m===void 0?"":m,E=t.name,_=t.type,u=t.url;if(this.trackId=s,this.trackName=E,this.selectDefaultTrack=!1,this.hls.trigger(j.Events.AUDIO_TRACK_SWITCHING,{id:y,groupId:g,name:E,type:_,url:u}),t.details&&!t.details.live)return;var h=this.switchParams(t.url,i==null?void 0:i.details);this.loadPlaylist(h)},n.selectInitialTrack=function(){var s=this.tracksInGroup;console.assert(s.length,"Initial audio track should be selected when tracks are known");var r=this.trackName,i=this.findTrackId(r)||this.findTrackId();i!==-1?this.setAudioTrack(i):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},n.findTrackId=function(s){for(var r=this.tracksInGroup,i=0;i<r.length;i++){var t=r[i];if((!this.selectDefaultTrack||t.default)&&(!s||s===t.name))return t.id}return-1},n.loadPlaylist=function(s){var r=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(r)){var i=r.id,t=r.groupId,y=r.url;if(s)try{y=s.addDirectives(y)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("loading audio-track playlist for id: "+i),this.clearTimer(),this.hls.trigger(j.Events.AUDIO_TRACK_LOADING,{url:y,id:i,groupId:t,deliveryDirectives:s||null})}},e(a,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(s){this.selectDefaultTrack=!1,this.setAudioTrack(s)}}]),a}(R.default);H.default=p},"./src/controller/base-playlist-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return e});var j=C("./src/polyfills/number.ts"),L=C("./src/types/level.ts"),R=C("./src/controller/level-helper.ts"),B=C("./src/utils/logger.ts"),N=C("./src/errors.ts"),e=function(){function A(p,o){this.hls=void 0,this.timer=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=B.logger.log.bind(B.logger,o+":"),this.warn=B.logger.warn.bind(B.logger,o+":"),this.hls=p}var f=A.prototype;return f.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},f.onError=function(o,a){a.fatal&&a.type===N.ErrorTypes.NETWORK_ERROR&&this.clearTimer()},f.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},f.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.loadPlaylist()},f.stopLoad=function(){this.canLoad=!1,this.clearTimer()},f.switchParams=function(o,a){var n=a==null?void 0:a.renditionReports;if(n)for(var l=0;l<n.length;l++){var s=n[l],r=""+s.URI;if(r===o.substr(-r.length)){var i=parseInt(s["LAST-MSN"]),t=parseInt(s["LAST-PART"]);if(a&&this.hls.config.lowLatencyMode){var y=Math.min(a.age-a.partTarget,a.targetduration);t!==void 0&&y>a.partTarget&&(t+=1)}if(Object(j.isFiniteNumber)(i))return new L.HlsUrlParameters(i,Object(j.isFiniteNumber)(t)?t:void 0,L.HlsSkip.No)}}},f.loadPlaylist=function(o){},f.shouldLoadTrack=function(o){return this.canLoad&&o&&!!o.url&&(!o.details||o.details.live)},f.playlistLoaded=function(o,a,n){var l=this,s=a.details,r=a.stats,i=r.loading.end?Math.max(0,self.performance.now()-r.loading.end):0;if(s.advancedDateTime=Date.now()-i,s.live||n!=null&&n.live){if(s.reloaded(n),n&&this.log("live playlist "+o+" "+(s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:"MISSED")),n&&s.fragments.length>0&&Object(R.mergeDetails)(n,s),!this.canLoad||!s.live)return;var t,y=void 0,m=void 0;if(s.canBlockReload&&s.endSN&&s.advanced){var g=this.hls.config.lowLatencyMode,E=s.lastPartSn,_=s.endSN,u=s.lastPartIndex,h=u!==-1,c=E===_,d=g?0:u;h?(y=c?_+1:E,m=c?d:u+1):y=_+1;var T=s.age,b=T+s.ageHeader,S=Math.min(b-s.partTarget,s.targetduration*1.5);if(S>0){if(n&&S>n.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+n.tuneInGoal+" to: "+S+" with playlist age: "+s.age),S=0;else{var D=Math.floor(S/s.targetduration);if(y+=D,m!==void 0){var I=Math.round(S%s.targetduration/s.partTarget);m+=I}this.log("CDN Tune-in age: "+s.ageHeader+"s last advanced "+T.toFixed(2)+"s goal: "+S+" skip sn "+D+" to part "+m)}s.tuneInGoal=S}if(t=this.getDeliveryDirectives(s,a.deliveryDirectives,y,m),g||!c){this.loadPlaylist(t);return}}else t=this.getDeliveryDirectives(s,a.deliveryDirectives,y,m);var w=Object(R.computeReloadInterval)(s,r);y!==void 0&&s.canBlockReload&&(w-=s.partTarget||1),this.log("reload live playlist "+o+" in "+Math.round(w)+" ms"),this.timer=self.setTimeout(function(){return l.loadPlaylist(t)},w)}else this.clearTimer()},f.getDeliveryDirectives=function(o,a,n,l){var s=Object(L.getSkipValue)(o,n);return a!=null&&a.skip&&o.deltaUpdateFailed&&(n=a.msn,l=a.part,s=L.HlsSkip.No),new L.HlsUrlParameters(n,l,s)},f.retryLoadingOrFail=function(o){var a=this,n=this.hls.config,l=this.retryCount<n.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 r=Math.min(Math.pow(2,this.retryCount)*n.levelLoadingRetryDelay,n.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return a.loadPlaylist()},r),this.warn("retry playlist loading #"+this.retryCount+" in "+r+' ms after "'+o.details+'"')}}else this.warn('cannot recover from error "'+o.details+'"'),this.clearTimer(),o.fatal=!0;return l},A}()},"./src/controller/base-stream-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"State",function(){return _}),C.d(H,"default",function(){return u});var j=C("./src/polyfills/number.ts"),L=C("./src/task-loop.ts"),R=C("./src/controller/fragment-tracker.ts"),B=C("./src/utils/buffer-helper.ts"),N=C("./src/utils/logger.ts"),e=C("./src/events.ts"),A=C("./src/errors.ts"),f=C("./src/types/transmuxer.ts"),p=C("./src/utils/mp4-tools.ts"),o=C("./src/utils/discontinuities.ts"),a=C("./src/controller/fragment-finders.ts"),n=C("./src/controller/level-helper.ts"),l=C("./src/loader/fragment-loader.ts"),s=C("./src/crypt/decrypter.ts"),r=C("./src/utils/time-ranges.ts"),i=C("./src/types/loader.ts");function t(h,c){for(var d=0;d<c.length;d++){var T=c[d];T.enumerable=T.enumerable||!1,T.configurable=!0,"value"in T&&(T.writable=!0),Object.defineProperty(h,T.key,T)}}function y(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 g(h,c){h.prototype=Object.create(c.prototype),h.prototype.constructor=h,E(h,c)}function E(h,c){return E=Object.setPrototypeOf||function(T,b){return T.__proto__=b,T},E(h,c)}var _={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){g(c,h);function c(T,b,S){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=_.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=S,D.log=N.logger.log.bind(N.logger,S+":"),D.warn=N.logger.warn.bind(N.logger,S+":"),D.hls=T,D.fragmentLoader=new l.default(T.config),D.fragmentTracker=b,D.config=T.config,D.decrypter=new s.default(T,T.config),T.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(b){},d.stopLoad=function(){this.fragmentLoader.abort();var b=this.fragCurrent;b&&this.fragmentTracker.removeFragment(b),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=_.STOPPED},d._streamEnded=function(b,S){var D=this.fragCurrent,I=this.fragmentTracker;if(!S.live&&D&&D.sn===S.endSN&&!b.nextStart){var w=I.getState(D);return w===R.FragmentState.PARTIAL||w===R.FragmentState.OK}return!1},d.onMediaAttached=function(b,S){var D=this.media=this.mediaBuffer=S.media;this.onvseeking=this.onMediaSeeking.bind(this),this.onvended=this.onMediaEnded.bind(this),D.addEventListener("seeking",this.onvseeking),D.addEventListener("ended",this.onvended);var I=this.config;this.levels&&I.autoStartLoad&&this.state===_.STOPPED&&this.startLoad(I.startPosition)},d.onMediaDetaching=function(){var b=this.media;b!=null&&b.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),b&&(b.removeEventListener("seeking",this.onvseeking),b.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 b=this.config,S=this.fragCurrent,D=this.media,I=this.mediaBuffer,w=this.state,P=D?D.currentTime:0,U=B.BufferHelper.bufferInfo(I||D,P,b.maxBufferHole);if(this.log("media seeking to "+(Object(j.isFiniteNumber)(P)?P.toFixed(3):P)+", state: "+w),w===_.ENDED)this.resetLoadingState();else if(S&&!U.len){var O=b.maxFragLookUpTolerance,G=S.start-O,V=S.start+S.duration+O,ae=P>V;(P<G||ae)&&(ae&&S.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),S.loader.abort()),this.resetLoadingState())}D&&(this.lastCurrentTime=P),!this.loadedmetadata&&!U.len&&(this.nextLoadPosition=this.startPosition=P),this.tickImmediate()},d.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},d.onKeyLoaded=function(b,S){if(this.state!==_.KEY_LOADING||S.frag!==this.fragCurrent||!this.levels)return;this.state=_.IDLE;var D=this.levels[S.frag.level].details;D&&this.loadFragment(S.frag,D,S.frag.start)},d.onHandlerDestroying=function(){this.stopLoad(),h.prototype.onHandlerDestroying.call(this)},d.onHandlerDestroyed=function(){this.state=_.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(b,S){this.log("Loading key for "+b.sn+" of ["+S.startSN+"-"+S.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level),this.state=_.KEY_LOADING,this.fragCurrent=b,this.hls.trigger(e.Events.KEY_LOADING,{frag:b})},d.loadFragment=function(b,S,D){this._loadFragForPlayback(b,S,D)},d._loadFragForPlayback=function(b,S,D){var I=this,w=function(U){if(I.fragContextChanged(b)){I.warn("Fragment "+b.sn+(U.part?" p: "+U.part.index:"")+" of level "+b.level+" was dropped during download."),I.fragmentTracker.removeFragment(b);return}b.stats.chunkCount++,I._handleFragmentLoadProgress(U)};this._doFragLoad(b,S,D,w).then(function(P){if(!P)return;I.fragLoadError=0;var U=I.state;if(I.fragContextChanged(b)){(U===_.FRAG_LOADING||U===_.BACKTRACKING||!I.fragCurrent&&U===_.PARSING)&&(I.fragmentTracker.removeFragment(b),I.state=_.IDLE);return}if("payload"in P&&(I.log("Loaded fragment "+b.sn+" of level "+b.level),I.hls.trigger(e.Events.FRAG_LOADED,P),I.state===_.BACKTRACKING)){I.fragmentTracker.backtrack(b,P),I.resetFragmentLoading(b);return}I._handleFragmentLoadComplete(P)}).catch(function(P){I.warn(P),I.resetFragmentLoading(b)})},d.flushMainBuffer=function(b,S,D){if(D===void 0&&(D=null),!(b-S))return;var I={startOffset:b,endOffset:S,type:D};this.fragLoadError=0,this.hls.trigger(e.Events.BUFFER_FLUSHING,I)},d._loadInitSegment=function(b){var S=this;this._doFragLoad(b).then(function(D){if(!D||S.fragContextChanged(b)||!S.levels)throw new Error("init load aborted");return D}).then(function(D){var I=S.hls,w=D.payload,P=b.decryptdata;if(w&&w.byteLength>0&&P&&P.key&&P.iv&&P.method==="AES-128"){var U=self.performance.now();return S.decrypter.webCryptoDecrypt(new Uint8Array(w),P.key.buffer,P.iv.buffer).then(function(O){var G=self.performance.now();return I.trigger(e.Events.FRAG_DECRYPTED,{frag:b,payload:O,stats:{tstart:U,tdecrypt:G}}),D.payload=O,D})}return D}).then(function(D){var I=S.fragCurrent,w=S.hls,P=S.levels;if(!P)throw new Error("init load aborted, missing levels");var U=P[b.level].details;console.assert(U,"Level details are defined when init segment is loaded");var O=b.stats;S.state=_.IDLE,S.fragLoadError=0,b.data=new Uint8Array(D.payload),O.parsing.start=O.buffering.start=self.performance.now(),O.parsing.end=O.buffering.end=self.performance.now(),D.frag===I&&w.trigger(e.Events.FRAG_BUFFERED,{stats:O,frag:I,part:null,id:b.type}),S.tick()}).catch(function(D){S.warn(D),S.resetFragmentLoading(b)})},d.fragContextChanged=function(b){var S=this.fragCurrent;return!b||!S||b.level!==S.level||b.sn!==S.sn||b.urlId!==S.urlId},d.fragBufferedComplete=function(b,S){var D=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+b.type+" sn: "+b.sn+(S?" part: "+S.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+b.level+" "+r.default.toString(B.BufferHelper.getBuffered(D))),this.state=_.IDLE,this.tick()},d._handleFragmentLoadComplete=function(b){var S=this.transmuxer;if(!S)return;var D=b.frag,I=b.part,w=b.partsLoaded,P=!w||w.length===0||w.some(function(O){return!O}),U=new f.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,I?I.index:-1,!P);S.flush(U)},d._handleFragmentLoadProgress=function(b){},d._doFragLoad=function(b,S,D,I){var w=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");if(D=Math.max(b.start,D||0),this.config.lowLatencyMode&&S){var P=S.partList;if(P&&I){D>b.end&&S.fragmentHint&&(b=S.fragmentHint);var U=this.getNextPart(P,b,D);if(U>-1){var O=P[U];return this.log("Loading part sn: "+b.sn+" p: "+O.index+" cc: "+b.cc+" of playlist ["+S.startSN+"-"+S.endSN+"] parts [0-"+U+"-"+(P.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=O.start+O.duration,this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:b,part:P[U],targetBufferTime:D}),this.doFragPartsLoad(b,P,U,I).catch(function(G){return w.handleFragLoadError(G)})}else if(!b.url||this.loadedEndOfParts(P,D))return Promise.resolve(null)}}return this.log("Loading fragment "+b.sn+" cc: "+b.cc+" "+(S?"of ["+S.startSN+"-"+S.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+b.level+", target: "+parseFloat(D.toFixed(3))),Object(j.isFiniteNumber)(b.sn)&&!this.bitrateTest&&(this.nextLoadPosition=b.start+b.duration),this.state=_.FRAG_LOADING,this.hls.trigger(e.Events.FRAG_LOADING,{frag:b,targetBufferTime:D}),this.fragmentLoader.load(b,I).catch(function(G){return w.handleFragLoadError(G)})},d.doFragPartsLoad=function(b,S,D,I){var w=this;return new Promise(function(P,U){var O=[],G=function V(ae){var ie=S[ae];w.fragmentLoader.loadPart(b,ie,I).then(function(fe){O[ie.index]=fe;var ce=fe.part;w.hls.trigger(e.Events.FRAG_LOADED,fe);var J=S[ae+1];if(J&&J.fragment===b)V(ae+1);else return P({frag:b,part:ce,partsLoaded:O})}).catch(U)};G(D)})},d.handleFragLoadError=function(b){var S=b.data;return S&&S.details===A.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(S.frag,S.part):this.hls.trigger(e.Events.ERROR,S),null},d._handleTransmuxerFlush=function(b){var S=this.getCurrentContext(b);if(!S||this.state!==_.PARSING){this.fragCurrent||(this.state=_.IDLE);return}var D=S.frag,I=S.part,w=S.level,P=self.performance.now();D.stats.parsing.end=P,I&&(I.stats.parsing.end=P),this.updateLevelTiming(D,I,w,b.partial)},d.getCurrentContext=function(b){var S=this.levels,D=b.level,I=b.sn,w=b.part;if(!S||!S[D])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+D+". The current chunk will not be buffered."),null;var P=S[D],U=w>-1?Object(n.getPartWith)(P,I,w):null,O=U?U.fragment:Object(n.getFragmentWithSN)(P,I,this.fragCurrent);return O?{frag:O,part:U,level:P}:null},d.bufferFragmentData=function(b,S,D,I){if(!b||this.state!==_.PARSING)return;var w=b.data1,P=b.data2,U=w;if(w&&P&&(U=Object(p.appendUint8Array)(w,P)),!U||!U.length)return;var O={type:b.type,frag:S,part:D,chunkMeta:I,parent:S.type,data:U};this.hls.trigger(e.Events.BUFFER_APPENDING,O),b.dropped&&b.independent&&!D&&this.flushBufferGap(S)},d.flushBufferGap=function(b){var S=this.media;if(!S)return;if(!B.BufferHelper.isBuffered(S,S.currentTime)){this.flushMainBuffer(0,b.start);return}var D=S.currentTime,I=B.BufferHelper.bufferInfo(S,D,0),w=b.duration,P=Math.min(this.config.maxFragLookUpTolerance*2,w*.25),U=Math.max(Math.min(b.start-P,I.end-P),D+P);b.start-U>P&&this.flushMainBuffer(U,b.start)},d.getFwdBufferInfo=function(b,S){var D=this.config,I=this.getLoadPosition();if(!Object(j.isFiniteNumber)(I))return null;var w=B.BufferHelper.bufferInfo(b,I,D.maxBufferHole);if(w.len===0&&w.nextStart!==void 0){var P=this.fragmentTracker.getBufferedFrag(I,S);if(P&&w.nextStart<P.end)return B.BufferHelper.bufferInfo(b,I,Math.max(w.nextStart,D.maxBufferHole))}return w},d.getMaxBufferLength=function(b){var S=this.config,D;return b?D=Math.max(8*S.maxBufferSize/b,S.maxBufferLength):D=S.maxBufferLength,Math.min(D,S.maxMaxBufferLength)},d.reduceMaxBufferLength=function(b){var S=this.config,D=b||S.maxBufferLength;return S.maxMaxBufferLength>=D?(S.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+S.maxMaxBufferLength+"s"),!0):!1},d.getNextFragment=function(b,S){var D,I,w=S.fragments,P=w.length;if(!P)return null;var U=this.config,O=w[0].start,G;if(S.live){var V=U.initialLiveManifestSize;if(P<V)return this.warn("Not enough fragments to start playback (have: "+P+", need: "+V+")"),null;!S.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(G=this.getInitialLiveFragment(S,w),this.startPosition=G?this.hls.liveSyncPosition||G.start:b)}else b<=O&&(G=w[0]);if(!G){var ae=U.lowLatencyMode?S.partEnd:S.fragmentEnd;G=this.getFragmentAtPosition(b,ae,S)}return(D=G)!==null&&D!==void 0&&D.initSegment&&!((I=G)!==null&&I!==void 0&&I.initSegment.data)&&!this.bitrateTest&&(G=G.initSegment),G},d.getNextPart=function(b,S,D){for(var I=-1,w=!1,P=!0,U=0,O=b.length;U<O;U++){var G=b[U];if(P=P&&!G.independent,I>-1&&D<G.start)break;var V=G.loaded;!V&&(w||G.independent||P)&&G.fragment===S&&(I=U),w=V}return I},d.loadedEndOfParts=function(b,S){var D=b[b.length-1];return D&&S>D.start&&D.loaded},d.getInitialLiveFragment=function(b,S){var D=this.fragPrevious,I=null;if(D){if(b.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),I=Object(a.findFragmentByPDT)(S,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var w=D.sn+1;if(w>=b.startSN&&w<=b.endSN){var P=S[w-b.startSN];D.cc===P.cc&&(I=P,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=Object(a.findFragWithCC)(S,D.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var U=this.hls.liveSyncPosition;U!==null&&(I=this.getFragmentAtPosition(U,this.bitrateTest?b.fragmentEnd:b.edge,b))}return I},d.getFragmentAtPosition=function(b,S,D){var I=this.config,w=this.fragPrevious,P=D.fragments,U=D.endSN,O=D.fragmentHint,G=I.maxFragLookUpTolerance,V=!!(I.lowLatencyMode&&D.partList&&O);V&&O&&!this.bitrateTest&&(P=P.concat(O),U=O.sn);var ae;if(b<S){var ie=b>S-G?0:G;ae=Object(a.findFragmentByPTS)(w,P,b,ie)}else ae=P[P.length-1];if(ae){var fe=ae.sn-D.startSN,ce=w&&ae.level===w.level,J=P[fe+1],Z=this.fragmentTracker.getState(ae);if(Z===R.FragmentState.BACKTRACKED){ae=null;for(var he=fe;P[he]&&this.fragmentTracker.getState(P[he])===R.FragmentState.BACKTRACKED;)w?ae=P[he--]:ae=P[--he];ae||(ae=J)}else w&&ae.sn===w.sn&&!V&&(ce&&(ae.sn<U&&this.fragmentTracker.getState(J)!==R.FragmentState.OK?(this.log("SN "+ae.sn+" just loaded, load next one: "+J.sn),ae=J):ae=null))}return ae},d.synchronizeToLiveEdge=function(b){var S=this.config,D=this.media;if(!D)return;var I=this.hls.liveSyncPosition,w=D.currentTime,P=b.fragments[0].start,U=b.edge,O=w>=P-S.maxFragLookUpTolerance&&w<=U;if(I!==null&&D.duration>I&&(w<I||!O)){var G=S.liveMaxLatencyDuration!==void 0?S.liveMaxLatencyDuration:S.liveMaxLatencyDurationCount*b.targetduration;(!O&&D.readyState<4||w<U-G)&&(this.loadedmetadata||(this.nextLoadPosition=I),D.readyState&&(this.warn("Playback: "+w.toFixed(3)+" is located too far from the end of live sliding playlist: "+U+", reset currentTime to : "+I.toFixed(3)),D.currentTime=I))}},d.alignPlaylists=function(b,S){var D=this.levels,I=this.levelLastLoaded,w=this.fragPrevious,P=I!==null?D[I]:null,U=b.fragments.length;if(!U)return this.warn("No fragments in live playlist"),0;var O=b.fragments[0].start,G=!S,V=b.alignedSliding&&Object(j.isFiniteNumber)(O);if(G||!V&&!O){Object(o.alignStream)(w,P,b);var ae=b.fragments[0].start;return this.log("Live playlist sliding: "+ae.toFixed(2)+" start-sn: "+(S?S.startSN:"na")+"->"+b.startSN+" prev-sn: "+(w?w.sn:"na")+" fragments: "+U),ae}return O},d.waitForCdnTuneIn=function(b){var S=3;return b.live&&b.canBlockReload&&b.tuneInGoal>Math.max(b.partHoldBack,b.partTarget*S)},d.setStartPosition=function(b,S){var D=this.startPosition;if(D<S&&(D=-1),D===-1||this.lastCurrentTime===-1){var I=b.startTimeOffset;Object(j.isFiniteNumber)(I)?(D=S+I,I<0&&(D+=b.totalduration),D=Math.min(Math.max(S,D),S+b.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+D),this.startPosition=D):b.live?D=this.hls.liveSyncPosition||S:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},d.getLoadPosition=function(){var b=this.media,S=0;return this.loadedmetadata&&b?S=b.currentTime:this.nextLoadPosition&&(S=this.nextLoadPosition),S},d.handleFragLoadAborted=function(b,S){this.transmuxer&&b.sn!=="initSegment"&&b.stats.aborted&&(this.warn("Fragment "+b.sn+(S?" part"+S.index:"")+" of level "+b.level+" was aborted"),this.resetFragmentLoading(b))},d.resetFragmentLoading=function(b){(!this.fragCurrent||!this.fragContextChanged(b))&&(this.state=_.IDLE)},d.onFragmentOrKeyLoadError=function(b,S){if(S.fatal)return;var D=S.frag;if(!D||D.type!==b)return;var I=this.fragCurrent;console.assert(I&&D.sn===I.sn&&D.level===I.level&&D.urlId===I.urlId,"Frag load error must match current frag to retry");var w=this.config;if(this.fragLoadError+1<=w.fragLoadingMaxRetry){if(this.resetLiveStartWhenNotLoaded(D.level))return;var P=Math.min(Math.pow(2,this.fragLoadError)*w.fragLoadingRetryDelay,w.fragLoadingMaxRetryTimeout);this.warn("Fragment "+D.sn+" of "+b+" "+D.level+" failed to load, retrying in "+P+"ms"),this.retryDate=self.performance.now()+P,this.fragLoadError++,this.state=_.FRAG_LOADING_WAITING_RETRY}else S.levelRetry?(b===i.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=_.IDLE):(N.logger.error(S.details+" reaches max retry, redispatch as fatal ..."),S.fatal=!0,this.hls.stopLoad(),this.state=_.ERROR)},d.afterBufferFlushed=function(b,S,D){if(!b)return;var I=B.BufferHelper.getBuffered(b);this.fragmentTracker.detectEvictedFragments(S,I,D),this.state===_.ENDED&&this.resetLoadingState()},d.resetLoadingState=function(){this.fragCurrent=null,this.fragPrevious=null,this.state=_.IDLE},d.resetLiveStartWhenNotLoaded=function(b){if(!this.loadedmetadata){this.startFragRequested=!1;var S=this.levels?this.levels[b].details:null;if(S!=null&&S.live)return this.startPosition=-1,this.setStartPosition(S,0),this.resetLoadingState(),!0;this.nextLoadPosition=this.startPosition}return!1},d.updateLevelTiming=function(b,S,D,I){var w=this,P=D.details;console.assert(!!P,"level.details must be defined");var U=Object.keys(b.elementaryStreams).reduce(function(O,G){var V=b.elementaryStreams[G];if(V){var ae=V.endPTS-V.startPTS;if(ae<=0)return w.warn("Could not parse fragment "+b.sn+" "+G+" duration reliably ("+ae+") resetting transmuxer to fallback to playlist timing"),w.resetTransmuxer(),O||!1;var ie=I?0:Object(n.updateFragPTSDTS)(P,b,V.startPTS,V.endPTS,V.startDTS,V.endDTS);return w.hls.trigger(e.Events.LEVEL_PTS_UPDATED,{details:P,level:D,drift:ie,type:G,frag:b,start:V.startPTS,end:V.endPTS}),!0}return O},!1);U?(this.state=_.PARSED,this.hls.trigger(e.Events.FRAG_PARSED,{frag:b,part:S})):this.resetLoadingState()},d.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},y(c,[{key:"state",get:function(){return this._state},set:function(b){var S=this._state;S!==b&&(this._state=b,this.log(S+"->"+b))}}]),c}(L.default)},"./src/controller/buffer-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return a});var j=C("./src/polyfills/number.ts"),L=C("./src/events.ts"),R=C("./src/utils/logger.ts"),B=C("./src/errors.ts"),N=C("./src/utils/buffer-helper.ts"),e=C("./src/utils/mediasource-helper.ts"),A=C("./src/loader/fragment.ts"),f=C("./src/controller/buffer-operation-queue.ts"),p=Object(e.getMediaSource)(),o=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function n(s){var r=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 i=r.hls,t=r.media,y=r.mediaSource;R.logger.log("[buffer-controller]: Media source opened"),t&&(r.updateMediaElementDuration(),i.trigger(L.Events.MEDIA_ATTACHED,{media:t})),y&&y.removeEventListener("sourceopen",r._onMediaSourceOpen),r.checkPendingTracks()},this._onMediaSourceClose=function(){R.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){R.logger.log("[buffer-controller]: Media source ended")},this.hls=s,this._initSourceBuffer(),this.registerListeners()}var l=n.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 r=this.hls;r.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(L.Events.BUFFER_RESET,this.onBufferReset,this),r.on(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.on(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.on(L.Events.BUFFER_EOS,this.onBufferEos,this),r.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.on(L.Events.FRAG_PARSED,this.onFragParsed,this),r.on(L.Events.FRAG_CHANGED,this.onFragChanged,this)},l.unregisterListeners=function(){var r=this.hls;r.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),r.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(L.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(L.Events.BUFFER_RESET,this.onBufferReset,this),r.off(L.Events.BUFFER_APPENDING,this.onBufferAppending,this),r.off(L.Events.BUFFER_CODECS,this.onBufferCodecs,this),r.off(L.Events.BUFFER_EOS,this.onBufferEos,this),r.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),r.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),r.off(L.Events.FRAG_PARSED,this.onFragParsed,this),r.off(L.Events.FRAG_CHANGED,this.onFragChanged,this)},l._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new f.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]}},l.onManifestParsed=function(r,i){var t=2;(i.audio&&!i.video||!i.altAudio)&&(t=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=t,this.details=null,R.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},l.onMediaAttaching=function(r,i){var t=this.media=i.media;if(t&&p){var y=this.mediaSource=new p;y.addEventListener("sourceopen",this._onMediaSourceOpen),y.addEventListener("sourceended",this._onMediaSourceEnded),y.addEventListener("sourceclose",this._onMediaSourceClose),t.src=self.URL.createObjectURL(y),this._objectUrl=t.src}},l.onMediaDetaching=function(){var r=this.media,i=this.mediaSource,t=this._objectUrl;if(i){if(R.logger.log("[buffer-controller]: media source detaching"),i.readyState==="open")try{i.endOfStream()}catch(y){R.logger.warn("[buffer-controller]: onMediaDetaching: "+y.message+" while calling endOfStream")}this.onBufferReset(),i.removeEventListener("sourceopen",this._onMediaSourceOpen),i.removeEventListener("sourceended",this._onMediaSourceEnded),i.removeEventListener("sourceclose",this._onMediaSourceClose),r&&(t&&self.URL.revokeObjectURL(t),r.src===t?(r.removeAttribute("src"),r.load()):R.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(L.Events.MEDIA_DETACHED,void 0)},l.onBufferReset=function(){var r=this;this.getSourceBufferTypes().forEach(function(i){var t=r.sourceBuffer[i];try{t&&(r.removeBufferListeners(i),r.mediaSource&&r.mediaSource.removeSourceBuffer(t),r.sourceBuffer[i]=void 0)}catch(y){R.logger.warn("[buffer-controller]: Failed to reset the "+i+" buffer",y)}}),this._initSourceBuffer()},l.onBufferCodecs=function(r,i){var t=this,y=this.getSourceBufferTypes().length;if(Object.keys(i).forEach(function(m){if(y){var g=t.tracks[m];if(g&&typeof g.buffer.changeType=="function"){var E=i[m],_=E.codec,u=E.levelCodec,h=E.container,c=(g.levelCodec||g.codec).replace(o,"$1"),d=(u||_).replace(o,"$1");if(c!==d){var T=h+";codecs="+(u||_);t.appendChangeType(m,T)}}}else t.pendingTracks[m]=i[m]}),y)return;this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks()},l.appendChangeType=function(r,i){var t=this,y=this.operationQueue,m={execute:function(){var E=t.sourceBuffer[r];E&&(R.logger.log("[buffer-controller]: changing "+r+" sourceBuffer type to "+i),E.changeType(i)),y.shiftAndExecuteNext(r)},onStart:function(){},onComplete:function(){},onError:function(E){R.logger.warn("[buffer-controller]: Failed to change "+r+" SourceBuffer type",E)}};y.append(m,r)},l.onBufferAppending=function(r,i){var t=this,y=this.hls,m=this.operationQueue,g=this.tracks,E=i.data,_=i.type,u=i.frag,h=i.part,c=i.chunkMeta,d=c.buffering[_],T=self.performance.now();d.start=T;var b=u.stats.buffering,S=h?h.stats.buffering:null;b.start===0&&(b.start=T),S&&S.start===0&&(S.start=T);var D=g.audio,I=_==="audio"&&c.id===1&&(D==null?void 0:D.container)==="audio/mpeg",w={execute:function(){if(d.executeStart=self.performance.now(),I){var U=t.sourceBuffer[_];if(U){var O=u.start-U.timestampOffset;Math.abs(O)>=.1&&(R.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+u.start+" (delta: "+O+") sn: "+u.sn+")"),U.timestampOffset=u.start)}}t.appendExecutor(E,_)},onStart:function(){},onComplete:function(){var U=self.performance.now();d.executeEnd=d.end=U,b.first===0&&(b.first=U),S&&S.first===0&&(S.first=U);var O=t.sourceBuffer,G={};for(var V in O)G[V]=N.BufferHelper.getBuffered(O[V]);t.appendError=0,t.hls.trigger(L.Events.BUFFER_APPENDED,{type:_,frag:u,part:h,chunkMeta:c,parent:u.type,timeRanges:G})},onError:function(U){R.logger.error("[buffer-controller]: Error encountered while trying to append to the "+_+" SourceBuffer",U);var O={type:B.ErrorTypes.MEDIA_ERROR,parent:u.type,details:B.ErrorDetails.BUFFER_APPEND_ERROR,err:U,fatal:!1};U.code===DOMException.QUOTA_EXCEEDED_ERR?O.details=B.ErrorDetails.BUFFER_FULL_ERROR:(t.appendError++,O.details=B.ErrorDetails.BUFFER_APPEND_ERROR,t.appendError>y.config.appendErrorMaxRetry&&(R.logger.error("[buffer-controller]: Failed "+y.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),O.fatal=!0)),y.trigger(L.Events.ERROR,O)}};m.append(w,_)},l.onBufferFlushing=function(r,i){var t=this,y=this.operationQueue,m=function(E){return{execute:t.removeExecutor.bind(t,E,i.startOffset,i.endOffset),onStart:function(){},onComplete:function(){t.hls.trigger(L.Events.BUFFER_FLUSHED,{type:E})},onError:function(u){R.logger.warn("[buffer-controller]: Failed to remove from "+E+" SourceBuffer",u)}}};i.type?y.append(m(i.type),i.type):this.getSourceBufferTypes().forEach(function(g){y.append(m(g),g)})},l.onFragParsed=function(r,i){var t=this,y=i.frag,m=i.part,g=[],E=m?m.elementaryStreams:y.elementaryStreams;E[A.ElementaryStreamTypes.AUDIOVIDEO]?g.push("audiovideo"):(E[A.ElementaryStreamTypes.AUDIO]&&g.push("audio"),E[A.ElementaryStreamTypes.VIDEO]&&g.push("video"));var _=function(){var h=self.performance.now();y.stats.buffering.end=h,m&&(m.stats.buffering.end=h);var c=m?m.stats:y.stats;t.hls.trigger(L.Events.FRAG_BUFFERED,{frag:y,part:m,stats:c,id:y.type})};g.length===0&&R.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+y.type+" level: "+y.level+" sn: "+y.sn),this.blockBuffers(_,g)},l.onFragChanged=function(r,i){this.flushBackBuffer()},l.onBufferEos=function(r,i){var t=this,y=this.getSourceBufferTypes().reduce(function(m,g){var E=t.sourceBuffer[g];return(!i.type||i.type===g)&&(E&&!E.ended&&(E.ended=!0,R.logger.log("[buffer-controller]: "+g+" sourceBuffer now EOS"))),m&&!!(!E||E.ended)},!0);y&&this.blockBuffers(function(){var m=t.mediaSource;if(!m||m.readyState!=="open")return;m.endOfStream()})},l.onLevelUpdated=function(r,i){var t=i.details;if(!t.fragments.length)return;this.details=t,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration()},l.flushBackBuffer=function(){var r=this.hls,i=this.details,t=this.media,y=this.sourceBuffer;if(!t||i===null)return;var m=this.getSourceBufferTypes();if(!m.length)return;var g=i.live&&r.config.liveBackBufferLength!==null?r.config.liveBackBufferLength:r.config.backBufferLength;if(!Object(j.isFiniteNumber)(g)||g<0)return;var E=t.currentTime,_=i.levelTargetDuration,u=Math.max(g,_),h=Math.floor(E/_)*_-u;m.forEach(function(c){var d=y[c];if(d){var T=N.BufferHelper.getBuffered(d);T.length>0&&h>T.start(0)&&(r.trigger(L.Events.BACK_BUFFER_REACHED,{bufferEnd:h}),i.live&&r.trigger(L.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:h}),r.trigger(L.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 r=this.details,i=this.hls,t=this.media,y=this.mediaSource,m=r.fragments[0].start+r.totalduration,g=t.duration,E=Object(j.isFiniteNumber)(y.duration)?y.duration:0;r.live&&i.config.liveDurationInfinity?(R.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),y.duration=Infinity,this.updateSeekableRange(r)):(m>E&&m>g||!Object(j.isFiniteNumber)(g))&&(R.logger.log("[buffer-controller]: Updating Media Source duration to "+m.toFixed(3)),y.duration=m)},l.updateSeekableRange=function(r){var i=this.mediaSource,t=r.fragments,y=t.length;if(y&&r.live&&i!==null&&i!==void 0&&i.setLiveSeekableRange){var m=Math.max(0,t[0].start),g=Math.max(m,m+r.totalduration);i.setLiveSeekableRange(m,g)}},l.checkPendingTracks=function(){var r=this.bufferCodecEventsExpected,i=this.operationQueue,t=this.pendingTracks,y=Object.keys(t).length;if(y&&!r||y===2){this.createSourceBuffers(t),this.pendingTracks={};var m=this.getSourceBufferTypes();if(m.length===0){this.hls.trigger(L.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}m.forEach(function(g){i.executeNext(g)})}},l.createSourceBuffers=function(r){var i=this.sourceBuffer,t=this.mediaSource;if(!t)throw Error("createSourceBuffers called when mediaSource was null");var y=0;for(var m in r)if(!i[m]){var g=r[m];if(!g)throw Error("source buffer exists for track "+m+", however track does not");var E=g.levelCodec||g.codec,_=g.container+";codecs="+E;R.logger.log("[buffer-controller]: creating sourceBuffer("+_+")");try{var u=i[m]=t.addSourceBuffer(_),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:E,container:g.container,levelCodec:g.levelCodec,id:g.id},y++}catch(c){R.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+c.message),this.hls.trigger(L.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:c,mimeType:_})}}y&&this.hls.trigger(L.Events.BUFFER_CREATED,{tracks:this.tracks})},l._onSBUpdateStart=function(r){var i=this.operationQueue,t=i.current(r);t.onStart()},l._onSBUpdateEnd=function(r){var i=this.operationQueue,t=i.current(r);t.onComplete(),i.shiftAndExecuteNext(r)},l._onSBUpdateError=function(r,i){R.logger.error("[buffer-controller]: "+r+" SourceBuffer error",i),this.hls.trigger(L.Events.ERROR,{type:B.ErrorTypes.MEDIA_ERROR,details:B.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var t=this.operationQueue.current(r);t&&t.onError(i)},l.removeExecutor=function(r,i,t){var y=this.media,m=this.mediaSource,g=this.operationQueue,E=this.sourceBuffer,_=E[r];if(!y||!m||!_){R.logger.warn("[buffer-controller]: Attempting to remove from the "+r+" SourceBuffer, but it does not exist"),g.shiftAndExecuteNext(r);return}var u=Object(j.isFiniteNumber)(y.duration)?y.duration:Infinity,h=Object(j.isFiniteNumber)(m.duration)?m.duration:Infinity,c=Math.max(0,i),d=Math.min(t,u,h);d>c?(R.logger.log("[buffer-controller]: Removing ["+c+","+d+"] from the "+r+" SourceBuffer"),console.assert(!_.updating,r+" sourceBuffer must not be updating"),_.remove(c,d)):g.shiftAndExecuteNext(r)},l.appendExecutor=function(r,i){var t=this.operationQueue,y=this.sourceBuffer,m=y[i];if(!m){R.logger.warn("[buffer-controller]: Attempting to append to the "+i+" SourceBuffer, but it does not exist"),t.shiftAndExecuteNext(i);return}m.ended=!1,console.assert(!m.updating,i+" sourceBuffer must not be updating"),m.appendBuffer(r)},l.blockBuffers=function(r,i){var t=this;if(i===void 0&&(i=this.getSourceBufferTypes()),!i.length){R.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve(r);return}var y=this.operationQueue,m=i.map(function(g){return y.appendBlocker(g)});Promise.all(m).then(function(){r(),i.forEach(function(g){var E=t.sourceBuffer[g];(!E||!E.updating)&&y.shiftAndExecuteNext(g)})})},l.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},l.addBufferListener=function(r,i,t){var y=this.sourceBuffer[r];if(!y)return;var m=t.bind(this,r);this.listeners[r].push({event:i,listener:m}),y.addEventListener(i,m)},l.removeBufferListeners=function(r){var i=this.sourceBuffer[r];if(!i)return;this.listeners[r].forEach(function(t){i.removeEventListener(t.event,t.listener)})},n}()},"./src/controller/buffer-operation-queue.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return L});var j=C("./src/utils/logger.ts"),L=function(){function R(N){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=N}var B=R.prototype;return B.append=function(e,A){var f=this.queues[A];f.push(e),f.length===1&&this.buffers[A]&&this.executeNext(A)},B.insertAbort=function(e,A){var f=this.queues[A];f.unshift(e),this.executeNext(A)},B.appendBlocker=function(e){var A,f=new Promise(function(o){A=o}),p={execute:A,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(p,e),f},B.executeNext=function(e){var A=this.buffers,f=this.queues,p=A[e],o=f[e];if(o.length){var a=o[0];try{a.execute()}catch(n){j.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(n),(!p||!p.updating)&&(o.shift(),this.executeNext(e))}}},B.shiftAndExecuteNext=function(e){this.queues[e].shift(),this.executeNext(e)},B.current=function(e){return this.queues[e][0]},R}()},"./src/controller/cap-level-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts");function L(N,e){for(var A=0;A<e.length;A++){var f=e[A];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(N,f.key,f)}}function R(N,e,A){return e&&L(N.prototype,e),A&&L(N,A),N}var B=function(){function N(A){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=A,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(f){this.streamController=f},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 f=this.hls;f.on(j.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.on(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.unregisterListener=function(){var f=this.hls;f.off(j.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),f.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),f.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),f.off(j.Events.BUFFER_CODECS,this.onBufferCodecs,this),f.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},e.onFpsDropLevelCapping=function(f,p){N.isLevelAllowed(p.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(p.droppedLevel)},e.onMediaAttaching=function(f,p){this.media=p.media instanceof HTMLVideoElement?p.media:null},e.onManifestParsed=function(f,p){var o=this.hls;this.restrictedLevels=[],this.firstLevel=p.firstLevel,o.config.capLevelToPlayerSize&&p.video&&this.startCapping()},e.onBufferCodecs=function(f,p){var o=this.hls;o.config.capLevelToPlayerSize&&p.video&&this.startCapping()},e.onMediaDetaching=function(){this.stopCapping()},e.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var f=this.hls.levels;if(f.length){var p=this.hls;p.autoLevelCapping=this.getMaxLevel(f.length-1),p.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=p.autoLevelCapping}}},e.getMaxLevel=function(f){var p=this,o=this.hls.levels;if(!o.length)return-1;var a=o.filter(function(n,l){return N.isLevelAllowed(l,p.restrictedLevels)&&l<=f});return this.clientRect=null,N.getMaxLevelByMediaSize(a,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 f=this.media,p={width:0,height:0};if(f){var o=f.getBoundingClientRect();p.width=o.width,p.height=o.height,!p.width&&!p.height&&(p.width=o.right-o.left||f.width||0,p.height=o.bottom-o.top||f.height||0)}return this.clientRect=p,p},N.isLevelAllowed=function(f,p){return p===void 0&&(p=[]),p.indexOf(f)===-1},N.getMaxLevelByMediaSize=function(f,p,o){if(!f||!f.length)return-1;for(var a=function(i,t){return t?i.width!==t.width||i.height!==t.height:!0},n=f.length-1,l=0;l<f.length;l+=1){var s=f[l];if((s.width>=p||s.height>=o)&&a(s,f[l+1])){n=l;break}}return n},R(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 f=1;try{f=self.devicePixelRatio}catch(p){}return f}}]),N}();H.default=B},"./src/controller/cmcd-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return a});var j=C("./src/events.ts"),L=C("./src/types/cmcd.ts"),R=C("./src/utils/buffer-helper.ts"),B=C("./src/utils/logger.ts");function N(n,l){for(var s=0;s<l.length;s++){var r=l[s];r.enumerable=r.enumerable||!1,r.configurable=!0,"value"in r&&(r.writable=!0),Object.defineProperty(n,r.key,r)}}function e(n,l,s){return l&&N(n.prototype,l),s&&N(n,s),n}function A(n,l){var s=typeof Symbol!="undefined"&&n[Symbol.iterator]||n["@@iterator"];if(s)return(s=s.call(n)).next.bind(s);if(Array.isArray(n)||(s=f(n))||l&&n&&typeof n.length=="number"){s&&(n=s);var r=0;return function(){return r>=n.length?{done:!0}:{done:!1,value:n[r++]}}}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 f(n,l){if(!n)return;if(typeof n=="string")return p(n,l);var s=Object.prototype.toString.call(n).slice(8,-1);if(s==="Object"&&n.constructor&&(s=n.constructor.name),s==="Map"||s==="Set")return Array.from(n);if(s==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(s))return p(n,l)}function p(n,l){(l==null||l>n.length)&&(l=n.length);for(var s=0,r=new Array(l);s<l;s++)r[s]=n[s];return r}function o(){return o=Object.assign||function(n){for(var l=1;l<arguments.length;l++){var s=arguments[l];for(var r in s)Object.prototype.hasOwnProperty.call(s,r)&&(n[r]=s[r])}return n},o.apply(this,arguments)}var a=function(){function n(s){var r=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(){r.initialized&&(r.starved=!0),r.buffering=!0},this.onPlaying=function(){r.initialized||(r.initialized=!0),r.buffering=!1},this.applyPlaylistData=function(y){try{r.apply(y,{ot:L.CMCDObjectType.MANIFEST,su:!r.initialized})}catch(m){B.logger.warn("Could not generate manifest CMCD data.",m)}},this.applyFragmentData=function(y){try{var m=y.frag,g=r.hls.levels[m.level],E=r.getObjectType(m),_={d:m.duration*1e3,ot:E};(E===L.CMCDObjectType.VIDEO||E===L.CMCDObjectType.AUDIO||E==L.CMCDObjectType.MUXED)&&(_.br=g.bitrate/1e3,_.tb=r.getTopBandwidth(E),_.bl=r.getBufferLength(E)),r.apply(y,_)}catch(u){B.logger.warn("Could not generate segment CMCD data.",u)}},this.hls=s;var i=this.config=s.config,t=i.cmcd;t!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=t.sessionId||n.uuid(),this.cid=t.contentId,this.useHeaders=t.useHeaders===!0,this.registerListeners())}var l=n.prototype;return l.registerListeners=function(){var r=this.hls;r.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.on(j.Events.BUFFER_CREATED,this.onBufferCreated,this)},l.unregisterListeners=function(){var r=this.hls;r.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),r.off(j.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(r,i){this.media=i.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(r,i){var t,y;this.audioBuffer=(t=i.tracks.audio)===null||t===void 0?void 0:t.buffer,this.videoBuffer=(y=i.tracks.video)===null||y===void 0?void 0:y.buffer},l.createData=function(){var r;return{v:L.CMCDVersion,sf:L.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(r=this.media)===null||r===void 0?void 0:r.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},l.apply=function(r,i){i===void 0&&(i={}),o(i,this.createData());var t=i.ot===L.CMCDObjectType.INIT||i.ot===L.CMCDObjectType.VIDEO||i.ot===L.CMCDObjectType.MUXED;if(this.starved&&t&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering),this.useHeaders){var y=n.toHeaders(i);if(!Object.keys(y).length)return;r.headers||(r.headers={}),o(r.headers,y)}else{var m=n.toQuery(i);if(!m)return;r.url=n.appendQueryToUri(r.url,m)}},l.getObjectType=function(r){var i=r.type;return i==="subtitle"?L.CMCDObjectType.TIMED_TEXT:r.sn==="initSegment"?L.CMCDObjectType.INIT:i==="audio"?L.CMCDObjectType.AUDIO:i==="main"?this.hls.audioTracks.length?L.CMCDObjectType.VIDEO:L.CMCDObjectType.MUXED:void 0},l.getTopBandwidth=function(r){for(var i=0,t=r===L.CMCDObjectType.AUDIO?this.hls.audioTracks:this.hls.levels,y=A(t),m;!(m=y()).done;){var g=m.value;g.bitrate>i&&(i=g.bitrate)}return i>0?i:NaN},l.getBufferLength=function(r){var i=this.hls.media,t=r===L.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!t||!i)return NaN;var y=R.BufferHelper.bufferInfo(t,i.currentTime,this.config.maxBufferHole);return y.len*1e3},l.createPlaylistLoader=function(){var r=this.config.pLoader,i=this.applyPlaylistData,t=r||this.config.loader;return function(){function y(g){this.loader=void 0,this.loader=new t(g)}var m=y.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,_,u){i(E),this.loader.load(E,_,u)},e(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},l.createFragmentLoader=function(){var r=this.config.fLoader,i=this.applyFragmentData,t=r||this.config.loader;return function(){function y(g){this.loader=void 0,this.loader=new t(g)}var m=y.prototype;return m.destroy=function(){this.loader.destroy()},m.abort=function(){this.loader.abort()},m.load=function(E,_,u){i(E),this.loader.load(E,_,u)},e(y,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),y}()},n.uuid=function(){var r=URL.createObjectURL(new Blob),i=r.toString();return URL.revokeObjectURL(r),i.substr(i.lastIndexOf("/")+1)},n.serialize=function(r){for(var i=[],t=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},y=function(I){return Math.round(I)},m=function(I){return y(I/100)*100},g=function(I){return encodeURIComponent(I)},E={br:y,d:y,bl:m,dl:m,mtp:m,nor:g,rtp:m,tb:y},_=Object.keys(r||{}).sort(),u=A(_),h;!(h=u()).done;){var c=h.value,d=r[c];if(!t(d))continue;if(c==="v"&&d===1)continue;if(c=="pr"&&d===1)continue;var T=E[c];T&&(d=T(d));var b=typeof d,S=void 0;c==="ot"||c==="sf"||c==="st"?S=c+"="+d:b==="boolean"?S=c:b==="number"?S=c+"="+d:S=c+"="+JSON.stringify(d),i.push(S)}return i.join(",")},n.toHeaders=function(r){for(var i=Object.keys(r),t={},y=["Object","Request","Session","Status"],m=[{},{},{},{}],g={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},E=0,_=i;E<_.length;E++){var u=_[E],h=g[u]!=null?g[u]:1;m[h][u]=r[u]}for(var c=0;c<m.length;c++){var d=n.serialize(m[c]);d&&(t["CMCD-"+y[c]]=d)}return t},n.toQuery=function(r){return"CMCD="+encodeURIComponent(n.serialize(r))},n.appendQueryToUri=function(r,i){if(!i)return r;var t=r.includes("?")?"&":"?";return""+r+t+i},n}()},"./src/controller/eme-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/utils/logger.ts"),B=C("./src/utils/mediakeys-helper.ts");function N(a,n){for(var l=0;l<n.length;l++){var s=n[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,n,l){return n&&N(a.prototype,n),l&&N(a,l),a}var A=3,f=function(n,l,s){var r={audioCapabilities:[],videoCapabilities:[]};return n.forEach(function(i){r.audioCapabilities.push({contentType:'audio/mp4; codecs="'+i+'"',robustness:s.audioRobustness||""})}),l.forEach(function(i){r.videoCapabilities.push({contentType:'video/mp4; codecs="'+i+'"',robustness:s.videoRobustness||""})}),[r]},p=function(n,l,s,r){switch(n){case B.KeySystems.WIDEVINE:return f(l,s,r);default:throw new Error("Unknown key-system: "+n)}},o=function(){function a(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 n=a.prototype;return n.destroy=function(){this._unregisterListeners(),this.hls=this._onMediaEncrypted=null,this._requestMediaKeySystemAccess=null},n._registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this)},n._unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(j.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this)},n.getLicenseServerUrl=function(s){switch(s){case B.KeySystems.WIDEVINE:if(!this._widevineLicenseUrl)break;return this._widevineLicenseUrl}throw new Error('no license server URL configured for key-system "'+s+'"')},n._attemptKeySystemAccess=function(s,r,i){var t=this,y=p(s,r,i,this._drmSystemOptions);R.logger.log("Requesting encrypted media key-system access");var m=this.requestMediaKeySystemAccess(s,y);this.mediaKeysPromise=m.then(function(g){return t._onMediaKeySystemAccessObtained(s,g)}),m.catch(function(g){R.logger.error('Failed to obtain key-system "'+s+'" access:',g)})},n._onMediaKeySystemAccessObtained=function(s,r){var i=this;R.logger.log('Access for key-system "'+s+'" obtained');var t={mediaKeysSessionInitialized:!1,mediaKeySystemAccess:r,mediaKeySystemDomain:s};this._mediaKeysList.push(t);var y=Promise.resolve().then(function(){return r.createMediaKeys()}).then(function(m){return t.mediaKeys=m,R.logger.log('Media-keys created for key-system "'+s+'"'),i._onMediaKeysCreated(),m});return y.catch(function(m){R.logger.error("Failed to create media-keys:",m)}),y},n._onMediaKeysCreated=function(){var s=this;this._mediaKeysList.forEach(function(r){r.mediaKeysSession||(r.mediaKeysSession=r.mediaKeys.createSession(),s._onNewMediaKeySession(r.mediaKeysSession))})},n._onNewMediaKeySession=function(s){var r=this;R.logger.log("New key-system session "+s.sessionId),s.addEventListener("message",function(i){r._onKeySessionMessage(s,i.message)},!1)},n._onKeySessionMessage=function(s,r){R.logger.log("Got EME message event, creating license request"),this._requestLicense(r,function(i){R.logger.log("Received license data (length: "+(i&&i.byteLength)+"), updating key-session"),s.update(i)})},n.onMediaEncrypted=function(s){var r=this;if(R.logger.log('Media is encrypted using "'+s.initDataType+'" init data type'),!this.mediaKeysPromise){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been requested"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}var i=function(y){if(!r._media)return;r._attemptSetMediaKeys(y),r._generateRequestWithPreferredKeySession(s.initDataType,s.initData)};this.mediaKeysPromise.then(i).catch(i)},n._attemptSetMediaKeys=function(s){if(!this._media)throw new Error("Attempted to set mediaKeys without first attaching a media element");if(!this._hasSetMediaKeys){var r=this._mediaKeysList[0];if(!r||!r.mediaKeys){R.logger.error("Fatal: Media is encrypted but no CDM access or no keys have been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_KEYS,fatal:!0});return}R.logger.log("Setting keys for encrypted media"),this._media.setMediaKeys(r.mediaKeys),this._hasSetMediaKeys=!0}},n._generateRequestWithPreferredKeySession=function(s,r){var i=this,t=this._mediaKeysList[0];if(!t){R.logger.error("Fatal: Media is encrypted but not any key-system access has been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}if(t.mediaKeysSessionInitialized){R.logger.warn("Key-Session already initialized but requested again");return}var y=t.mediaKeysSession;if(!y){R.logger.error("Fatal: Media is encrypted but no key-session existing"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!0});return}if(!r){R.logger.warn("Fatal: initData required for generating a key session is null"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_INIT_DATA,fatal:!0});return}R.logger.log('Generating key-session request for "'+s+'" init data type'),t.mediaKeysSessionInitialized=!0,y.generateRequest(s,r).then(function(){R.logger.debug("Key-session generation succeeded")}).catch(function(m){R.logger.error("Error generating key-session request:",m),i.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_SESSION,fatal:!1})})},n._createLicenseXhr=function(s,r,i){var t=new XMLHttpRequest;t.responseType="arraybuffer",t.onreadystatechange=this._onLicenseRequestReadyStageChange.bind(this,t,s,r,i);var y=this._licenseXhrSetup;if(y)try{y.call(this.hls,t,s),y=void 0}catch(m){R.logger.error(m)}try{t.readyState||t.open("POST",s,!0),y&&y.call(this.hls,t,s)}catch(m){throw new Error("issue setting up KeySystem license XHR "+m)}return t},n._onLicenseRequestReadyStageChange=function(s,r,i,t){switch(s.readyState){case 4:if(s.status===200){this._requestLicenseFailureCount=0,R.logger.log("License request succeeded");var y=s.response,m=this._licenseResponseCallback;if(m)try{y=m.call(this.hls,s,r)}catch(E){R.logger.error(E)}t(y)}else{if(R.logger.error("License Request XHR failed ("+r+"). Status: "+s.status+" ("+s.statusText+")"),this._requestLicenseFailureCount++,this._requestLicenseFailureCount>A){this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0});return}var g=A-this._requestLicenseFailureCount+1;R.logger.warn("Retrying license request, "+g+" attempts left"),this._requestLicense(i,t)}break}},n._generateLicenseRequestChallenge=function(s,r){switch(s.mediaKeySystemDomain){case B.KeySystems.WIDEVINE:return r}throw new Error("unsupported key-system: "+s.mediaKeySystemDomain)},n._requestLicense=function(s,r){R.logger.log("Requesting content license for key-system");var i=this._mediaKeysList[0];if(!i){R.logger.error("Fatal error: Media is encrypted but no key-system access has been obtained yet"),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_NO_ACCESS,fatal:!0});return}try{var t=this.getLicenseServerUrl(i.mediaKeySystemDomain),y=this._createLicenseXhr(t,s,r);R.logger.log("Sending license request to URL: "+t);var m=this._generateLicenseRequestChallenge(i,s);y.send(m)}catch(g){R.logger.error("Failure requesting DRM license: "+g),this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.KEY_SYSTEM_ERROR,details:L.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0})}},n.onMediaAttached=function(s,r){if(!this._emeEnabled)return;var i=r.media;this._media=i,i.addEventListener("encrypted",this._onMediaEncrypted)},n.onMediaDetached=function(){var s=this._media,r=this._mediaKeysList;if(!s)return;s.removeEventListener("encrypted",this._onMediaEncrypted),this._media=null,this._mediaKeysList=[],Promise.all(r.map(function(i){if(i.mediaKeysSession)return i.mediaKeysSession.close().catch(function(){})})).then(function(){return s.setMediaKeys(null)}).catch(function(){})},n.onManifestParsed=function(s,r){if(!this._emeEnabled)return;var i=r.levels.map(function(y){return y.audioCodec}).filter(function(y){return!!y}),t=r.levels.map(function(y){return y.videoCodec}).filter(function(y){return!!y});this._attemptKeySystemAccess(B.KeySystems.WIDEVINE,i,t)},e(a,[{key:"requestMediaKeySystemAccess",get:function(){if(!this._requestMediaKeySystemAccess)throw new Error("No requestMediaKeySystemAccess function configured");return this._requestMediaKeySystemAccess}}]),a}();H.default=o},"./src/controller/fps-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/utils/logger.ts"),R=function(){function B(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=B.prototype;return N.setStreamController=function(A){this.streamController=A},N.registerListeners=function(){this.hls.on(j.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},N.unregisterListeners=function(){this.hls.off(j.Events.MEDIA_ATTACHING,this.onMediaAttaching)},N.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},N.onMediaAttaching=function(A,f){var p=this.hls.config;if(p.capLevelOnFPSDrop){var o=f.media instanceof self.HTMLVideoElement?f.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),p.fpsDroppedMonitoringPeriod)}},N.checkFPS=function(A,f,p){var o=performance.now();if(f){if(this.lastTime){var a=o-this.lastTime,n=p-this.lastDroppedFrames,l=f-this.lastDecodedFrames,s=1e3*n/a,r=this.hls;if(r.trigger(j.Events.FPS_DROP,{currentDropped:n,currentDecoded:l,totalDroppedFrames:p}),s>0&&n>r.config.fpsDroppedMonitoringThreshold*l){var i=r.currentLevel;L.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+i),i>0&&(r.autoLevelCapping===-1||r.autoLevelCapping>=i)&&(i=i-1,r.trigger(j.Events.FPS_DROP_LEVEL_CAPPING,{level:i,droppedLevel:r.currentLevel}),r.autoLevelCapping=i,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=p,this.lastDecodedFrames=f}},N.checkFPSInterval=function(){var A=this.media;if(A)if(this.isVideoPlaybackQualityAvailable){var f=A.getVideoPlaybackQuality();this.checkFPS(A,f.totalVideoFrames,f.droppedVideoFrames)}else this.checkFPS(A,A.webkitDecodedFrameCount,A.webkitDroppedFrameCount)},B}();H.default=R},"./src/controller/fragment-finders.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"findFragmentByPDT",function(){return R}),C.d(H,"findFragmentByPTS",function(){return B}),C.d(H,"fragmentWithinToleranceTest",function(){return N}),C.d(H,"pdtWithinToleranceTest",function(){return e}),C.d(H,"findFragWithCC",function(){return A});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/binary-search.ts");function R(f,p,o){if(p===null||!Array.isArray(f)||!f.length||!Object(j.isFiniteNumber)(p))return null;var a=f[0].programDateTime;if(p<(a||0))return null;var n=f[f.length-1].endProgramDateTime;if(p>=(n||0))return null;o=o||0;for(var l=0;l<f.length;++l){var s=f[l];if(e(p,o,s))return s}return null}function B(f,p,o,a){o===void 0&&(o=0),a===void 0&&(a=0);var n=null;if(f?n=p[f.sn-p[0].sn+1]||null:o===0&&p[0].start===0&&(n=p[0]),n&&N(o,a,n)===0)return n;var l=L.default.search(p,N.bind(null,o,a));return l||n}function N(f,p,o){f===void 0&&(f=0),p===void 0&&(p=0);var a=Math.min(p,o.duration+(o.deltaPTS?o.deltaPTS:0));return o.start+o.duration-a<=f?1:o.start-a>f&&o.start?-1:0}function e(f,p,o){var a=Math.min(p,o.duration+(o.deltaPTS?o.deltaPTS:0))*1e3,n=o.endProgramDateTime||0;return n-a>f}function A(f,p){return L.default.search(f,function(o){return o.cc<p?1:o.cc>p?-1:0})}},"./src/controller/fragment-tracker.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"FragmentState",function(){return R}),C.d(H,"FragmentTracker",function(){return B});var j=C("./src/events.ts"),L=C("./src/types/loader.ts"),R;(function(A){A.NOT_LOADED="NOT_LOADED",A.BACKTRACKED="BACKTRACKED",A.APPENDING="APPENDING",A.PARTIAL="PARTIAL",A.OK="OK"})(R||(R={}));var B=function(){function A(p){this.activeFragment=null,this.activeParts=null,this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=p,this._registerListeners()}var f=A.prototype;return f._registerListeners=function(){var o=this.hls;o.on(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.on(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.on(j.Events.FRAG_LOADED,this.onFragLoaded,this)},f._unregisterListeners=function(){var o=this.hls;o.off(j.Events.BUFFER_APPENDED,this.onBufferAppended,this),o.off(j.Events.FRAG_BUFFERED,this.onFragBuffered,this),o.off(j.Events.FRAG_LOADED,this.onFragLoaded,this)},f.destroy=function(){this._unregisterListeners(),this.fragments=this.timeRanges=null},f.getAppendedFrag=function(o,a){if(a===L.PlaylistLevelType.MAIN){var n=this.activeFragment,l=this.activeParts;if(!n)return null;if(l)for(var s=l.length;s--;){var r=l[s],i=r?r.end:n.appendedPTS;if(r.start<=o&&i!==void 0&&o<=i)return s>9&&(this.activeParts=l.slice(s-9)),r}else if(n.start<=o&&n.appendedPTS!==void 0&&o<=n.appendedPTS)return n}return this.getBufferedFrag(o,a)},f.getBufferedFrag=function(o,a){for(var n=this.fragments,l=Object.keys(n),s=l.length;s--;){var r=n[l[s]];if((r==null?void 0:r.body.type)===a&&r.buffered){var i=r.body;if(i.start<=o&&o<=i.end)return i}}return null},f.detectEvictedFragments=function(o,a,n){var l=this;Object.keys(this.fragments).forEach(function(s){var r=l.fragments[s];if(!r)return;if(!r.buffered){r.body.type===n&&l.removeFragment(r.body);return}var i=r.range[o];if(!i)return;i.time.some(function(t){var y=!l.isTimeBuffered(t.startPTS,t.endPTS,a);return y&&l.removeFragment(r.body),y})})},f.detectPartialFragments=function(o){var a=this,n=this.timeRanges,l=o.frag,s=o.part;if(!n||l.sn==="initSegment")return;var r=e(l),i=this.fragments[r];if(!i)return;Object.keys(n).forEach(function(t){var y=l.elementaryStreams[t];if(!y)return;var m=n[t],g=s!==null||y.partial===!0;i.range[t]=a.getBufferedTimes(l,s,g,m)}),i.backtrack=i.loaded=null,Object.keys(i.range).length?i.buffered=!0:this.removeFragment(i.body)},f.fragBuffered=function(o){var a=e(o),n=this.fragments[a];n&&(n.backtrack=n.loaded=null,n.buffered=!0)},f.getBufferedTimes=function(o,a,n,l){for(var s={time:[],partial:n},r=a?a.start:o.start,i=a?a.end:o.end,t=o.minEndPTS||i,y=o.maxStartPTS||r,m=0;m<l.length;m++){var g=l.start(m)-this.bufferPadding,E=l.end(m)+this.bufferPadding;if(y>=g&&t<=E){s.time.push({startPTS:Math.max(r,l.start(m)),endPTS:Math.min(i,l.end(m))});break}else if(r<E&&i>g)s.partial=!0,s.time.push({startPTS:Math.max(r,l.start(m)),endPTS:Math.min(i,l.end(m))});else if(i<=g)break}return s},f.getPartialFragment=function(o){var a=null,n,l,s,r=0,i=this.bufferPadding,t=this.fragments;return Object.keys(t).forEach(function(y){var m=t[y];if(!m)return;N(m)&&(l=m.body.start-i,s=m.body.end+i,o>=l&&o<=s&&(n=Math.min(o-l,s-o),r<=n&&(a=m.body,r=n)))}),a},f.getState=function(o){var a=e(o),n=this.fragments[a];return n?n.buffered?N(n)?R.PARTIAL:R.OK:n.backtrack?R.BACKTRACKED:R.APPENDING:R.NOT_LOADED},f.backtrack=function(o,a){var n=e(o),l=this.fragments[n];if(!l||l.backtrack)return null;var s=l.backtrack=a||l.loaded;return l.loaded=null,s},f.getBacktrackData=function(o){var a=e(o),n=this.fragments[a];if(n){var l,s=n.backtrack;if(s!=null&&(l=s.payload)!==null&&l!==void 0&&l.byteLength)return s;this.removeFragment(o)}return null},f.isTimeBuffered=function(o,a,n){for(var l,s,r=0;r<n.length;r++){if(l=n.start(r)-this.bufferPadding,s=n.end(r)+this.bufferPadding,o>=l&&a<=s)return!0;if(a<=l)return!1}return!1},f.onFragLoaded=function(o,a){var n=a.frag,l=a.part;if(n.sn==="initSegment"||n.bitrateTest||l)return;var s=e(n);this.fragments[s]={body:n,loaded:a,backtrack:null,buffered:!1,range:Object.create(null)}},f.onBufferAppended=function(o,a){var n=this,l=a.frag,s=a.part,r=a.timeRanges;if(l.type===L.PlaylistLevelType.MAIN)if(this.activeFragment=l,s){var i=this.activeParts;i||(this.activeParts=i=[]),i.push(s)}else this.activeParts=null;this.timeRanges=r,Object.keys(r).forEach(function(t){var y=r[t];if(n.detectEvictedFragments(t,y),!s)for(var m=0;m<y.length;m++)l.appendedPTS=Math.max(y.end(m),l.appendedPTS||0)})},f.onFragBuffered=function(o,a){this.detectPartialFragments(a)},f.hasFragment=function(o){var a=e(o);return!!this.fragments[a]},f.removeFragmentsInRange=function(o,a,n){var l=this;Object.keys(this.fragments).forEach(function(s){var r=l.fragments[s];if(!r)return;if(r.buffered){var i=r.body;i.type===n&&i.start<a&&i.end>o&&l.removeFragment(i)}})},f.removeFragment=function(o){var a=e(o);o.stats.loaded=0,o.clearElementaryStreamInfo(),delete this.fragments[a]},f.removeAllFragments=function(){this.fragments=Object.create(null),this.activeFragment=null,this.activeParts=null},A}();function N(A){var f,p;return A.buffered&&(((f=A.range.video)===null||f===void 0?void 0:f.partial)||((p=A.range.audio)===null||p===void 0?void 0:p.partial))}function e(A){return A.type+"_"+A.level+"_"+A.urlId+"_"+A.sn}},"./src/controller/gap-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"STALL_MINIMUM_DURATION_MS",function(){return N}),C.d(H,"MAX_START_GAP_JUMP",function(){return e}),C.d(H,"SKIP_BUFFER_HOLE_STEP_SECONDS",function(){return A}),C.d(H,"SKIP_BUFFER_RANGE_START",function(){return f}),C.d(H,"default",function(){return p});var j=C("./src/utils/buffer-helper.ts"),L=C("./src/errors.ts"),R=C("./src/events.ts"),B=C("./src/utils/logger.ts"),N=250,e=2,A=.1,f=.05,p=function(){function o(n,l,s,r){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=n,this.media=l,this.fragmentTracker=s,this.hls=r}var a=o.prototype;return a.destroy=function(){this.hls=this.fragmentTracker=this.media=null},a.poll=function(l){var s=this.config,r=this.media,i=this.stalled,t=r.currentTime,y=r.seeking,m=this.seeking&&!y,g=!this.seeking&&y;if(this.seeking=y,t!==l){if(this.moved=!0,i!==null){if(this.stallReported){var E=self.performance.now()-i;B.logger.warn("playback not stuck anymore @"+t+", after "+Math.round(E)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((g||m)&&(this.stalled=null),r.paused||r.ended||r.playbackRate===0||!j.BufferHelper.getBuffered(r).length)return;var _=j.BufferHelper.bufferInfo(r,t,0),u=_.len>0,h=_.nextStart||0;if(!u&&!h)return;if(y){var c=_.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 T,b=Math.max(h,_.start||0)-t,S=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,D=S==null||((T=S.details)===null||T===void 0)?void 0:T.live,I=D?S.details.targetduration*2:e;if(b>0&&b<=I){this._trySkipBufferHole(null);return}}var w=self.performance.now();if(i===null){this.stalled=w;return}var P=w-i;!y&&P>=N&&this._reportStall(_.len);var U=j.BufferHelper.bufferInfo(r,t,s.maxBufferHole);this._tryFixBufferStall(U,P)},a._tryFixBufferStall=function(l,s){var r=this.config,i=this.fragmentTracker,t=this.media,y=t.currentTime,m=i.getPartialFragment(y);if(m){var g=this._trySkipBufferHole(m);if(g)return}l.len>r.maxBufferHole&&s>r.highBufferWatchdogPeriod*1e3&&(B.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())},a._reportStall=function(l){var s=this.hls,r=this.media,i=this.stallReported;i||(this.stallReported=!0,B.logger.warn("Playback stalling at @"+r.currentTime+" due to low buffer (buffer="+l+")"),s.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:l}))},a._trySkipBufferHole=function(l){for(var s=this.config,r=this.hls,i=this.media,t=i.currentTime,y=0,m=j.BufferHelper.getBuffered(i),g=0;g<m.length;g++){var E=m.start(g);if(t+s.maxBufferHole>=y&&t<E){var _=Math.max(E+f,i.currentTime+A);return B.logger.warn("skipping hole, adjusting currentTime from "+t+" to "+_),this.moved=!0,this.stalled=null,i.currentTime=_,l&&r.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+t+" to "+_,frag:l}),_}y=m.end(g)}return 0},a._tryNudgeBuffer=function(){var l=this.config,s=this.hls,r=this.media,i=r.currentTime,t=(this.nudgeRetry||0)+1;if(this.nudgeRetry=t,t<l.nudgeMaxRetry){var y=i+t*l.nudgeOffset;B.logger.warn("Nudging 'currentTime' from "+i+" to "+y),r.currentTime=y,s.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else B.logger.error("Playhead still not moving while enough data buffered @"+i+" after "+l.nudgeMaxRetry+" nudges"),s.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})},o}()},"./src/controller/id3-track-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/utils/texttrack-utils.ts"),R=C("./src/demux/id3.ts"),B=.25,N=function(){function e(f){this.hls=void 0,this.id3Track=null,this.media=null,this.hls=f,this._registerListeners()}var A=e.prototype;return A.destroy=function(){this._unregisterListeners()},A._registerListeners=function(){var p=this.hls;p.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.on(j.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A._unregisterListeners=function(){var p=this.hls;p.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),p.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),p.off(j.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),p.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},A.onMediaAttached=function(p,o){this.media=o.media},A.onMediaDetaching=function(){if(!this.id3Track)return;Object(L.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null},A.getID3Track=function(p){if(!this.media)return;for(var o=0;o<p.length;o++){var a=p[o];if(a.kind==="metadata"&&a.label==="id3")return Object(L.sendAddTrackEvent)(a,this.media),a}return this.media.addTextTrack("metadata","id3")},A.onFragParsingMetadata=function(p,o){if(!this.media)return;var a=o.frag,n=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<n.length;s++){var r=R.getID3Frames(n[s].data);if(r){var i=n[s].pts,t=s<n.length-1?n[s+1].pts:a.end,y=t-i;y<=0&&(t=i+B);for(var m=0;m<r.length;m++){var g=r[m];if(!R.isTimeStampFrame(g)){var E=new l(i,t,"");E.value=g,this.id3Track.addCue(E)}}}}},A.onBufferFlushing=function(p,o){var a=o.startOffset,n=o.endOffset,l=o.type;if(!l||l==="audio"){var s=this.id3Track;s&&Object(L.removeCuesInRange)(s,a,n)}},e}();H.default=N},"./src/controller/latency-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return e});var j=C("./src/errors.ts"),L=C("./src/events.ts"),R=C("./src/utils/logger.ts");function B(A,f){for(var p=0;p<f.length;p++){var o=f[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function N(A,f,p){return f&&B(A.prototype,f),p&&B(A,p),A}var e=function(){function A(p){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=p,this.config=p.config,this.registerListeners()}var f=A.prototype;return f.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},f.registerListeners=function(){this.hls.on(L.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(L.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(L.Events.ERROR,this.onError,this)},f.unregisterListeners=function(){this.hls.off(L.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(L.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(L.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(L.Events.ERROR,this.onError)},f.onMediaAttached=function(o,a){this.media=a.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},f.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},f.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},f.onLevelUpdated=function(o,a){var n=a.details;this.levelDetails=n,n.advanced&&this.timeupdate(),!n.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},f.onError=function(o,a){if(a.details!==j.ErrorDetails.BUFFER_STALLED_ERROR)return;this.stallCount++,R.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency")},f.timeupdate=function(){var o=this.media,a=this.levelDetails;if(!o||!a)return;this.currentTime=o.currentTime;var n=this.computeLatency();if(n===null)return;this._latency=n;var l=this.config,s=l.lowLatencyMode,r=l.maxLiveSyncPlaybackRate;if(!s||r===1)return;var i=this.targetLatency;if(i===null)return;var t=n-i,y=Math.min(this.maxLatency,i+a.targetduration),m=t<y;if(a.live&&m&&t>.05&&this.forwardBufferLength>1){var g=Math.min(2,Math.max(1,r)),E=Math.round(2/(1+Math.exp(-.75*t-this.edgeStalled))*20)/20;o.playbackRate=Math.min(g,Math.max(1,E))}else o.playbackRate!==1&&o.playbackRate!==0&&(o.playbackRate=1)},f.estimateLiveEdge=function(){var o=this.levelDetails;return o===null?null:o.edge+o.age},f.computeLatency=function(){var o=this.estimateLiveEdge();return o===null?null:o-this.currentTime},N(A,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var o=this.config,a=this.levelDetails;return o.liveMaxLatencyDuration!==void 0?o.liveMaxLatencyDuration:a?o.liveMaxLatencyDurationCount*a.targetduration:0}},{key:"targetLatency",get:function(){var o=this.levelDetails;if(o===null)return null;var a=o.holdBack,n=o.partHoldBack,l=o.targetduration,s=this.config,r=s.liveSyncDuration,i=s.liveSyncDurationCount,t=s.lowLatencyMode,y=this.hls.userConfig,m=t&&n||a;(y.liveSyncDuration||y.liveSyncDurationCount||m===0)&&(m=r!==void 0?r:i*l);var g=l,E=1;return m+Math.min(this.stallCount*E,g)}},{key:"liveSyncPosition",get:function(){var o=this.estimateLiveEdge(),a=this.targetLatency,n=this.levelDetails;if(o===null||a===null||n===null)return null;var l=n.edge,s=o-a-this.edgeStalled,r=l-n.totalduration,i=l-(this.config.lowLatencyMode&&n.partTarget||n.targetduration);return Math.min(Math.max(r,s),i)}},{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 a=(this.config.lowLatencyMode&&o.partTarget||o.targetduration)*3;return Math.max(o.age-a,0)}},{key:"forwardBufferLength",get:function(){var o=this.media,a=this.levelDetails;if(!o||!a)return 0;var n=o.buffered.length;return n?o.buffered.end(n-1):a.edge-this.currentTime}}]),A}()},"./src/controller/level-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return s});var j=C("./src/types/level.ts"),L=C("./src/events.ts"),R=C("./src/errors.ts"),B=C("./src/utils/codecs.ts"),N=C("./src/controller/level-helper.ts"),e=C("./src/controller/base-playlist-controller.ts"),A=C("./src/types/loader.ts");function f(){return f=Object.assign||function(r){for(var i=1;i<arguments.length;i++){var t=arguments[i];for(var y in t)Object.prototype.hasOwnProperty.call(t,y)&&(r[y]=t[y])}return r},f.apply(this,arguments)}function p(r,i){for(var t=0;t<i.length;t++){var y=i[t];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(r,y.key,y)}}function o(r,i,t){return i&&p(r.prototype,i),t&&p(r,t),r}function a(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,n(r,i)}function n(r,i){return n=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},n(r,i)}var l=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),s=function(r){a(i,r);function i(y){var m;return m=r.call(this,y,"[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=i.prototype;return t._registerListeners=function(){var m=this.hls;m.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.on(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.on(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),m.on(L.Events.ERROR,this.onError,this)},t._unregisterListeners=function(){var m=this.hls;m.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),m.off(L.Events.LEVEL_LOADED,this.onLevelLoaded,this),m.off(L.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),m.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),m.off(L.Events.ERROR,this.onError,this)},t.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,r.prototype.destroy.call(this)},t.startLoad=function(){var m=this._levels;m.forEach(function(g){g.loadError=0}),r.prototype.startLoad.call(this)},t.onManifestLoaded=function(m,g){var E=[],_=[],u=[],h,c={},d,T=!1,b=!1,S=!1;if(g.levels.forEach(function(P){var U=P.attrs;T=T||!!(P.width&&P.height),b=b||!!P.videoCodec,S=S||!!P.audioCodec,l&&P.audioCodec&&P.audioCodec.indexOf("mp4a.40.34")!==-1&&(P.audioCodec=void 0);var O=P.bitrate+"-"+P.attrs.RESOLUTION+"-"+P.attrs.CODECS;d=c[O],d?d.url.push(P.url):(d=new j.Level(P),c[O]=d,E.push(d)),U&&(U.AUDIO&&Object(N.addGroupId)(d,"audio",U.AUDIO),U.SUBTITLES&&Object(N.addGroupId)(d,"text",U.SUBTITLES))}),(T||b)&&S&&(E=E.filter(function(P){var U=P.videoCodec,O=P.width,G=P.height;return!!U||!!(O&&G)})),E=E.filter(function(P){var U=P.audioCodec,O=P.videoCodec;return(!U||Object(B.isCodecSupportedInMp4)(U,"audio"))&&(!O||Object(B.isCodecSupportedInMp4)(O,"video"))}),g.audioTracks&&(_=g.audioTracks.filter(function(P){return!P.audioCodec||Object(B.isCodecSupportedInMp4)(P.audioCodec,"audio")}),Object(N.assignTrackIdsByGroup)(_)),g.subtitles&&(u=g.subtitles,Object(N.assignTrackIdsByGroup)(u)),E.length>0){h=E[0].bitrate,E.sort(function(P,U){return P.bitrate-U.bitrate}),this._levels=E;for(var D=0;D<E.length;D++)if(E[D].bitrate===h){this._firstLevel=D,this.log("manifest loaded, "+E.length+" level(s) found, first bitrate: "+h);break}var I=S&&!b,w={levels:E,audioTracks:_,subtitleTracks:u,firstLevel:this._firstLevel,stats:g.stats,audio:S,video:b,altAudio:!I&&_.some(function(P){return!!P.url})};this.hls.trigger(L.Events.MANIFEST_PARSED,w),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(L.Events.ERROR,{type:R.ErrorTypes.MEDIA_ERROR,details:R.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:g.url,reason:"no level with compatible codecs found in manifest"})},t.onError=function(m,g){if(r.prototype.onError.call(this,m,g),g.fatal)return;var E=g.context,_=this._levels[this.currentLevelIndex];if(E&&(E.type===A.PlaylistContextType.AUDIO_TRACK&&_.audioGroupIds&&E.groupId===_.audioGroupIds[_.urlId]||E.type===A.PlaylistContextType.SUBTITLE_TRACK&&_.textGroupIds&&E.groupId===_.textGroupIds[_.urlId])){this.redundantFailover(this.currentLevelIndex);return}var u=!1,h=!0,c;switch(g.details){case R.ErrorDetails.FRAG_LOAD_ERROR:case R.ErrorDetails.FRAG_LOAD_TIMEOUT:case R.ErrorDetails.KEY_LOAD_ERROR:case R.ErrorDetails.KEY_LOAD_TIMEOUT:if(g.frag){var d=this._levels[g.frag.level];d?(d.fragmentError++,d.fragmentError>this.hls.config.fragLoadingMaxRetry&&(c=g.frag.level)):c=g.frag.level}break;case R.ErrorDetails.LEVEL_LOAD_ERROR:case R.ErrorDetails.LEVEL_LOAD_TIMEOUT:E&&(E.deliveryDirectives&&(h=!1),c=E.level),u=!0;break;case R.ErrorDetails.REMUX_ALLOC_ERROR:c=g.level,u=!0;break}c!==void 0&&this.recoverLevel(g,c,u,h)},t.recoverLevel=function(m,g,E,_){var u=m.details,h=this._levels[g];if(h.loadError++,E){var c=this.retryLoadingOrFail(m);if(c)m.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(_){var d=h.url.length;if(d>1&&h.loadError<d)m.levelRetry=!0,this.redundantFailover(g);else if(this.manualLevelIndex===-1){var T=g===0?this._levels.length-1:g-1;this.currentLevelIndex!==T&&this._levels[T].loadError===0&&(this.warn(u+": switch to "+T),m.levelRetry=!0,this.hls.nextAutoLevel=T)}}},t.redundantFailover=function(m){var g=this._levels[m],E=g.url.length;if(E>1){var _=(g.urlId+1)%E;this.warn("Switching to redundant URL-id "+_),this._levels.forEach(function(u){u.urlId=_}),this.level=m}},t.onFragLoaded=function(m,g){var E=g.frag;if(E!==void 0&&E.type===A.PlaylistLevelType.MAIN){var _=this._levels[E.level];_!==void 0&&(_.fragmentError=0,_.loadError=0)}},t.onLevelLoaded=function(m,g){var E,_=g.level,u=g.details,h=this._levels[_];if(!h){var c;this.warn("Invalid level index "+_),(c=g.deliveryDirectives)!==null&&c!==void 0&&c.skip&&(u.deltaUpdateFailed=!0);return}_===this.currentLevelIndex?(h.fragmentError===0&&(h.loadError=0,this.retryCount=0),this.playlistLoaded(_,g,h.details)):(E=g.deliveryDirectives)!==null&&E!==void 0&&E.skip&&(u.deltaUpdateFailed=!0)},t.onAudioTrackSwitched=function(m,g){var E=this.hls.levels[this.currentLevelIndex];if(!E)return;if(E.audioGroupIds){for(var _=-1,u=this.hls.audioTracks[g.id].groupId,h=0;h<E.audioGroupIds.length;h++)if(E.audioGroupIds[h]===u){_=h;break}_!==E.urlId&&(E.urlId=_,this.startLoad())}},t.loadPlaylist=function(m){var g=this.currentLevelIndex,E=this._levels[g];if(this.canLoad&&E&&E.url.length>0){var _=E.urlId,u=E.url[_];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 "+g+(m?" at sn "+m.msn+" part "+m.part:"")+" with URL-id "+_+" "+u),this.clearTimer(),this.hls.trigger(L.Events.LEVEL_LOADING,{url:u,level:g,id:_,deliveryDirectives:m||null})}},t.removeLevel=function(m,g){var E=function(h,c){return c!==g},_=this._levels.filter(function(u,h){return h!==m?!0:u.url.length>1&&g!==void 0?(u.url=u.url.filter(E),u.audioGroupIds&&(u.audioGroupIds=u.audioGroupIds.filter(E)),u.textGroupIds&&(u.textGroupIds=u.textGroupIds.filter(E)),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=_,this.hls.trigger(L.Events.LEVELS_UPDATED,{levels:_})},o(i,[{key:"levels",get:function(){return this._levels.length===0?null:this._levels}},{key:"level",get:function(){return this.currentLevelIndex},set:function(m){var g,E=this._levels;if(E.length===0)return;if(this.currentLevelIndex===m&&(g=E[m])!==null&&g!==void 0&&g.details)return;if(m<0||m>=E.length){var _=m<0;if(this.hls.trigger(L.Events.ERROR,{type:R.ErrorTypes.OTHER_ERROR,details:R.ErrorDetails.LEVEL_SWITCH_ERROR,level:m,fatal:_,reason:"invalid level idx"}),_)return;m=Math.min(m,E.length-1)}this.clearTimer();var u=this.currentLevelIndex,h=E[u],c=E[m];this.log("switching to level "+m+" from "+u),this.currentLevelIndex=m;var d=f({},c,{level:m,maxBitrate:c.maxBitrate,uri:c.uri,urlId:c.urlId});delete d._urlId,this.hls.trigger(L.Events.LEVEL_SWITCHING,d);var T=c.details;if(!T||T.live){var b=this.switchParams(c.uri,h==null?void 0:h.details);this.loadPlaylist(b)}}},{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)}}]),i}(e.default)},"./src/controller/level-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"addGroupId",function(){return R}),C.d(H,"assignTrackIdsByGroup",function(){return B}),C.d(H,"updatePTS",function(){return N}),C.d(H,"updateFragPTSDTS",function(){return A}),C.d(H,"mergeDetails",function(){return f}),C.d(H,"mapPartIntersection",function(){return p}),C.d(H,"mapFragmentIntersection",function(){return o}),C.d(H,"adjustSliding",function(){return a}),C.d(H,"addSliding",function(){return n}),C.d(H,"computeReloadInterval",function(){return l}),C.d(H,"getFragmentWithSN",function(){return s}),C.d(H,"getPartWith",function(){return r});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/logger.ts");function R(i,t,y){switch(t){case"audio":i.audioGroupIds||(i.audioGroupIds=[]),i.audioGroupIds.push(y);break;case"text":i.textGroupIds||(i.textGroupIds=[]),i.textGroupIds.push(y);break}}function B(i){var t={};i.forEach(function(y){var m=y.groupId||"";y.id=t[m]=t[m]||0,t[m]++})}function N(i,t,y){var m=i[t],g=i[y];e(m,g)}function e(i,t){var y=t.startPTS;if(Object(j.isFiniteNumber)(y)){var m=0,g;t.sn>i.sn?(m=y-i.start,g=i):(m=i.start-y,g=t),g.duration!==m&&(g.duration=m)}else if(t.sn>i.sn){var E=i.cc===t.cc;E&&i.minEndPTS?t.start=i.start+(i.minEndPTS-i.start):t.start=i.start+i.duration}else t.start=Math.max(i.start-t.duration,0)}function A(i,t,y,m,g,E){var _=m-y;_<=0&&(L.logger.warn("Fragment should have a positive duration",t),m=y+t.duration,E=g+t.duration);var u=y,h=m,c=t.startPTS,d=t.endPTS;if(Object(j.isFiniteNumber)(c)){var T=Math.abs(c-y);Object(j.isFiniteNumber)(t.deltaPTS)?t.deltaPTS=Math.max(T,t.deltaPTS):t.deltaPTS=T,u=Math.max(y,c),y=Math.min(y,c),g=Math.min(g,t.startDTS),h=Math.min(m,d),m=Math.max(m,d),E=Math.max(E,t.endDTS)}t.duration=m-y;var b=y-t.start;t.appendedPTS=m,t.start=t.startPTS=y,t.maxStartPTS=u,t.startDTS=g,t.endPTS=m,t.minEndPTS=h,t.endDTS=E;var S=t.sn;if(!i||S<i.startSN||S>i.endSN)return 0;var D,I=S-i.startSN,w=i.fragments;for(w[I]=t,D=I;D>0;D--)e(w[D],w[D-1]);for(D=I;D<w.length-1;D++)e(w[D],w[D+1]);return i.fragmentHint&&e(w[w.length-1],i.fragmentHint),i.PTSKnown=i.alignedSliding=!0,b}function f(i,t){for(var y=null,m=i.fragments,g=m.length-1;g>=0;g--){var E=m[g].initSegment;if(E){y=E;break}}i.fragmentHint&&delete i.fragmentHint.endPTS;var _=0,u;if(o(i,t,function(D,I){D.relurl&&(_=D.cc-I.cc),Object(j.isFiniteNumber)(D.startPTS)&&Object(j.isFiniteNumber)(D.endPTS)&&(I.start=I.startPTS=D.startPTS,I.startDTS=D.startDTS,I.appendedPTS=D.appendedPTS,I.maxStartPTS=D.maxStartPTS,I.endPTS=D.endPTS,I.endDTS=D.endDTS,I.minEndPTS=D.minEndPTS,I.duration=D.endPTS-D.startPTS,I.duration&&(u=I),t.PTSKnown=t.alignedSliding=!0),I.elementaryStreams=D.elementaryStreams,I.loader=D.loader,I.stats=D.stats,I.urlId=D.urlId,D.initSegment&&(I.initSegment=D.initSegment,y=D.initSegment)}),y){var h=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments;h.forEach(function(D){var I;(!D.initSegment||D.initSegment.relurl===((I=y)===null||I===void 0?void 0:I.relurl))&&(D.initSegment=y)})}if(t.skippedSegments&&(t.deltaUpdateFailed=t.fragments.some(function(D){return!D}),t.deltaUpdateFailed)){L.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(_){L.logger.warn("discontinuity sliding from playlist, take drift into account");for(var T=0;T<d.length;T++)d[T].cc+=_}t.skippedSegments&&(t.startCC=t.fragments[0].cc),p(i.partList,t.partList,function(D,I){I.elementaryStreams=D.elementaryStreams,I.stats=D.stats}),u?A(t,u,u.startPTS,u.endPTS,u.startDTS,u.endDTS):a(i,t),d.length&&(t.totalduration=t.edge-d[0].start),t.driftStartTime=i.driftStartTime,t.driftStart=i.driftStart;var b=t.advancedDateTime;if(t.advanced&&b){var S=t.edge;t.driftStart||(t.driftStartTime=b,t.driftStart=S),t.driftEndTime=b,t.driftEnd=S}else t.driftEndTime=i.driftEndTime,t.driftEnd=i.driftEnd,t.advancedDateTime=i.advancedDateTime}function p(i,t,y){if(i&&t)for(var m=0,g=0,E=i.length;g<=E;g++){var _=i[g],u=t[g+m];_&&u&&_.index===u.index&&_.fragment.sn===u.fragment.sn?y(_,u):m--}}function o(i,t,y){for(var m=t.skippedSegments,g=Math.max(i.startSN,t.startSN)-t.startSN,E=(i.fragmentHint?1:0)+(m?t.endSN:Math.min(i.endSN,t.endSN))-t.startSN,_=t.startSN-i.startSN,u=t.fragmentHint?t.fragments.concat(t.fragmentHint):t.fragments,h=i.fragmentHint?i.fragments.concat(i.fragmentHint):i.fragments,c=g;c<=E;c++){var d=h[_+c],T=u[c];m&&!T&&c<m&&(T=t.fragments[c]=d),d&&T&&y(d,T)}}function a(i,t){var y=t.startSN+t.skippedSegments-i.startSN,m=i.fragments;if(y<0||y>=m.length)return;n(t,m[y].start)}function n(i,t){if(t){for(var y=i.fragments,m=i.skippedSegments;m<y.length;m++)y[m].start+=t;i.fragmentHint&&(i.fragmentHint.start+=t)}}function l(i,t){var y=1e3*i.levelTargetDuration,m=y/2,g=i.age,E=g>0&&g<y*3,_=t.loading.end-t.loading.start,u,h=i.availabilityDelay;if(i.updated===!1)if(E){var c=333*i.misses;u=Math.max(Math.min(m,_*2),c),i.availabilityDelay=(i.availabilityDelay||0)+u}else u=m;else E?(h=Math.min(h||y/2,g),i.availabilityDelay=h,u=h+y-g):u=y-_;return Math.round(u)}function s(i,t,y){if(!i||!i.details)return null;var m=i.details,g=m.fragments[t-m.startSN];return g||(g=m.fragmentHint,g&&g.sn===t?g:t<m.startSN&&y&&y.sn===t?y:null)}function r(i,t,y){if(!i||!i.details)return null;var m=i.details.partList;if(m)for(var g=m.length;g--;){var E=m[g];if(E.index===y&&E.fragment.sn===t)return E}return null}},"./src/controller/stream-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return m});var j=C("./src/polyfills/number.ts"),L=C("./src/controller/base-stream-controller.ts"),R=C("./src/is-supported.ts"),B=C("./src/events.ts"),N=C("./src/utils/buffer-helper.ts"),e=C("./src/controller/fragment-tracker.ts"),A=C("./src/types/loader.ts"),f=C("./src/loader/fragment.ts"),p=C("./src/demux/transmuxer-interface.ts"),o=C("./src/types/transmuxer.ts"),a=C("./src/controller/gap-controller.ts"),n=C("./src/errors.ts"),l=C("./src/utils/logger.ts");function s(g,E){for(var _=0;_<E.length;_++){var u=E[_];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}function r(g,E,_){return E&&s(g.prototype,E),_&&s(g,_),g}function i(g,E){g.prototype=Object.create(E.prototype),g.prototype.constructor=g,t(g,E)}function t(g,E){return t=Object.setPrototypeOf||function(u,h){return u.__proto__=h,u},t(g,E)}var y=100,m=function(g){i(E,g);function E(u,h){var c;return c=g.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 _=E.prototype;return _._registerListeners=function(){var h=this.hls;h.on(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.on(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.on(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.on(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.on(B.Events.LEVEL_LOADING,this.onLevelLoading,this),h.on(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.on(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.on(B.Events.ERROR,this.onError,this),h.on(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.on(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.on(B.Events.BUFFER_CREATED,this.onBufferCreated,this),h.on(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.on(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.on(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_._unregisterListeners=function(){var h=this.hls;h.off(B.Events.MEDIA_ATTACHED,this.onMediaAttached,this),h.off(B.Events.MEDIA_DETACHING,this.onMediaDetaching,this),h.off(B.Events.MANIFEST_LOADING,this.onManifestLoading,this),h.off(B.Events.MANIFEST_PARSED,this.onManifestParsed,this),h.off(B.Events.LEVEL_LOADED,this.onLevelLoaded,this),h.off(B.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),h.off(B.Events.ERROR,this.onError,this),h.off(B.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),h.off(B.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),h.off(B.Events.BUFFER_CREATED,this.onBufferCreated,this),h.off(B.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),h.off(B.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),h.off(B.Events.FRAG_BUFFERED,this.onFragBuffered,this)},_.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},_.startLoad=function(h){if(this.levels){var c=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(y),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var T=d.startLevel;T===-1&&(d.config.testBandwidth?(T=0,this.bitrateTest=!0):T=d.nextAutoLevel),this.level=d.nextLoadLevel=T,this.loadedmetadata=!1}c>0&&h===-1&&(this.log("Override startPosition with lastCurrentTime @"+c.toFixed(3)),h=c),this.state=L.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=h,this.tick()}else this._forceStartLoad=!0,this.state=L.State.STOPPED},_.stopLoad=function(){this._forceStartLoad=!1,g.prototype.stopLoad.call(this)},_.doTick=function(){switch(this.state){case L.State.IDLE:this.doTickIdle();break;case L.State.WAITING_LEVEL:{var h,c=this.levels,d=this.level,T=c==null||((h=c[d])===null||h===void 0)?void 0:h.details;if(T&&(!T.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(T))break;this.state=L.State.IDLE;break}break}case L.State.FRAG_LOADING_WAITING_RETRY:{var b,S=self.performance.now(),D=this.retryDate;(!D||S>=D||(b=this.media)!==null&&b!==void 0&&b.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.state=L.State.IDLE)}break;default:break}this.onTickEnd()},_.onTickEnd=function(){g.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},_.doTickIdle=function(){var h,c,d=this.hls,T=this.levelLastLoaded,b=this.levels,S=this.media,D=d.config,I=d.nextLoadLevel;if(T===null||!S&&(this.startFragRequested||!D.startFragPrefetch))return;if(this.altAudio&&this.audioOnly)return;if(!b||!b[I])return;var w=b[I];this.level=d.nextLoadLevel=I;var P=w.details;if(!P||this.state===L.State.WAITING_LEVEL||P.live&&this.levelLastLoaded!==I){this.state=L.State.WAITING_LEVEL;return}var U=this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:S,A.PlaylistLevelType.MAIN);if(U===null)return;var O=U.len,G=this.getMaxBufferLength(w.maxBitrate);if(O>=G)return;if(this._streamEnded(U,P)){var V={};this.altAudio&&(V.type="video"),this.hls.trigger(B.Events.BUFFER_EOS,V),this.state=L.State.ENDED;return}var ae=U.end,ie=this.getNextFragment(ae,P);if(this.couldBacktrack&&!this.fragPrevious&&ie&&ie.sn!=="initSegment"){var fe=ie.sn-P.startSN;fe>1&&(ie=P.fragments[fe-1],this.fragmentTracker.removeFragment(ie))}if(ie&&this.fragmentTracker.getState(ie)===e.FragmentState.OK&&this.nextLoadPosition>ae){var ce=this.audioOnly&&!this.altAudio?f.ElementaryStreamTypes.AUDIO:f.ElementaryStreamTypes.VIDEO;this.afterBufferFlushed(S,ce,A.PlaylistLevelType.MAIN),ie=this.getNextFragment(this.nextLoadPosition,P)}if(!ie)return;ie.initSegment&&!ie.initSegment.data&&!this.bitrateTest&&(ie=ie.initSegment),((h=ie.decryptdata)===null||h===void 0?void 0:h.keyFormat)==="identity"&&!((c=ie.decryptdata)!==null&&c!==void 0&&c.key)?this.loadKey(ie,P):this.loadFragment(ie,P,ae)},_.loadFragment=function(h,c,d){var T,b=this.fragmentTracker.getState(h);if(this.fragCurrent=h,b===e.FragmentState.BACKTRACKED){var S=this.fragmentTracker.getBacktrackData(h);if(S){this._handleFragmentLoadProgress(S),this._handleFragmentLoadComplete(S);return}else b=e.FragmentState.NOT_LOADED}b===e.FragmentState.NOT_LOADED||b===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,g.prototype.loadFragment.call(this,h,c,d)):b===e.FragmentState.APPENDING?this.reduceMaxBufferLength(h.duration)&&this.fragmentTracker.removeFragment(h):((T=this.media)===null||T===void 0?void 0:T.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},_.getAppendedFrag=function(h){var c=this.fragmentTracker.getAppendedFrag(h,A.PlaylistLevelType.MAIN);return c&&"fragment"in c?c.fragment:c},_.getBufferedFrag=function(h){return this.fragmentTracker.getBufferedFrag(h,A.PlaylistLevelType.MAIN)},_.followingBufferedFrag=function(h){return h?this.getBufferedFrag(h.end+.5):null},_.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},_.nextLevelSwitch=function(){var h=this.levels,c=this.media;if(c!=null&&c.readyState){var d,T=this.getAppendedFrag(c.currentTime);if(T&&T.start>1&&this.flushMainBuffer(0,T.start-1),!c.paused&&h){var b=this.hls.nextLoadLevel,S=h[b],D=this.fragLastKbps;D&&this.fragCurrent?d=this.fragCurrent.duration*S.maxBitrate/(1e3*D)+1:d=0}else d=0;var I=this.getBufferedFrag(c.currentTime+d);if(I){var w=this.followingBufferedFrag(I);if(w){this.abortCurrentFrag();var P=w.maxStartPTS?w.maxStartPTS:w.start,U=w.duration,O=Math.max(I.end,P+Math.min(Math.max(U-this.config.maxFragLookUpTolerance,U*.5),U*.75));this.flushMainBuffer(O,Number.POSITIVE_INFINITY)}}}},_.abortCurrentFrag=function(){var h=this.fragCurrent;this.fragCurrent=null,h!=null&&h.loader&&h.loader.abort(),this.state===L.State.KEY_LOADING&&(this.state=L.State.IDLE),this.nextLoadPosition=this.getLoadPosition()},_.flushMainBuffer=function(h,c){g.prototype.flushMainBuffer.call(this,h,c,this.altAudio?"video":null)},_.onMediaAttached=function(h,c){g.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 a.default(this.config,d,this.fragmentTracker,this.hls)},_.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),g.prototype.onMediaDetaching.call(this)},_.onMediaPlaying=function(){this.tick()},_.onMediaSeeked=function(){var h=this.media,c=h?h.currentTime:null;Object(j.isFiniteNumber)(c)&&this.log("Media seeked to "+c.toFixed(3)),this.tick()},_.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(B.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=this.stalled=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null},_.onManifestParsed=function(h,c){var d=!1,T=!1,b;c.levels.forEach(function(S){b=S.audioCodec,b&&(b.indexOf("mp4a.40.2")!==-1&&(d=!0),b.indexOf("mp4a.40.5")!==-1&&(T=!0))}),this.audioCodecSwitch=d&&T&&!Object(R.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},_.onLevelLoading=function(h,c){var d=this.levels;if(!d||this.state!==L.State.IDLE)return;var T=d[c.level];(!T.details||T.details.live&&this.levelLastLoaded!==c.level||this.waitForCdnTuneIn(T.details))&&(this.state=L.State.WAITING_LEVEL)},_.onLevelLoaded=function(h,c){var d,T=this.levels,b=c.level,S=c.details,D=S.totalduration;if(!T){this.warn("Levels were reset while loading level "+b);return}this.log("Level "+b+" loaded ["+S.startSN+","+S.endSN+"], cc ["+S.startCC+", "+S.endCC+"] duration:"+D);var I=this.fragCurrent;I&&(this.state===L.State.FRAG_LOADING||this.state===L.State.FRAG_LOADING_WAITING_RETRY)&&(I.level!==c.level&&I.loader&&(this.state=L.State.IDLE,I.loader.abort()));var w=T[b],P=0;if(S.live||(d=w.details)!==null&&d!==void 0&&d.live){if(S.fragments[0]||(S.deltaUpdateFailed=!0),S.deltaUpdateFailed)return;P=this.alignPlaylists(S,w.details)}if(w.details=S,this.levelLastLoaded=b,this.hls.trigger(B.Events.LEVEL_UPDATED,{details:S,level:b}),this.state===L.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(S))return;this.state=L.State.IDLE}this.startFragRequested?S.live&&this.synchronizeToLiveEdge(S):this.setStartPosition(S,P),this.tick()},_._handleFragmentLoadProgress=function(h){var c,d=h.frag,T=h.part,b=h.payload,S=this.levels;if(!S){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=S[d.level],I=D.details;if(!I){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var w=D.videoCodec,P=I.PTSKnown||!I.live,U=(c=d.initSegment)===null||c===void 0?void 0:c.data,O=this._getAudioCodec(D),G=this.transmuxer=this.transmuxer||new p.default(this.hls,A.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),V=T?T.index:-1,ae=V!==-1,ie=new o.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,b.byteLength,V,ae),fe=this.initPTS[d.cc];G.push(b,U,O,w,d,T,I.totalduration,P,ie,fe)},_.onAudioTrackSwitching=function(h,c){var d=this.altAudio,T=!!c.url,b=c.id;if(!T){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var S=this.fragCurrent;S!=null&&S.loader&&(this.log("Switching to main audio track, cancel main fragment load"),S.loader.abort()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var D=this.hls;d&&D.trigger(B.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),D.trigger(B.Events.AUDIO_TRACK_SWITCHED,{id:b})}},_.onAudioTrackSwitched=function(h,c){var d=c.id,T=!!this.hls.audioTracks[d].url;if(T){var b=this.videoBuffer;b&&this.mediaBuffer!==b&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=b)}this.altAudio=T,this.tick()},_.onBufferCreated=function(h,c){var d=c.tracks,T,b,S=!1;for(var D in d){var I=d[D];if(I.id==="main"){if(b=D,T=I,D==="video"){var w=d[D];w&&(this.videoBuffer=w.buffer)}}else S=!0}S&&T?(this.log("Alternate track found, use "+b+".buffered to schedule main fragment loading"),this.mediaBuffer=T.buffer):this.mediaBuffer=this.media},_.onFragBuffered=function(h,c){var d=c.frag,T=c.part;if(d&&d.type!==A.PlaylistLevelType.MAIN)return;if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(T?" p: "+T.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===L.State.PARSED&&(this.state=L.State.IDLE);return}var b=T?T.stats:d.stats;this.fragLastKbps=Math.round(8*b.total/(b.buffering.end-b.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,T)},_.onError=function(h,c){switch(c.details){case n.ErrorDetails.FRAG_LOAD_ERROR:case n.ErrorDetails.FRAG_LOAD_TIMEOUT:case n.ErrorDetails.KEY_LOAD_ERROR:case n.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(A.PlaylistLevelType.MAIN,c);break;case n.ErrorDetails.LEVEL_LOAD_ERROR:case n.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==L.State.ERROR&&(c.fatal?(this.warn(""+c.details),this.state=L.State.ERROR):!c.levelRetry&&this.state===L.State.WAITING_LEVEL&&(this.state=L.State.IDLE));break;case n.ErrorDetails.BUFFER_FULL_ERROR:if(c.parent==="main"&&(this.state===L.State.PARSING||this.state===L.State.PARSED)){var d=!0,T=this.getFwdBufferInfo(this.media,A.PlaylistLevelType.MAIN);T&&T.len>.5&&(d=!this.reduceMaxBufferLength(T.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},_.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},_.onFragLoadEmergencyAborted=function(){this.state=L.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},_.onBufferFlushed=function(h,c){var d=c.type;if(d!==f.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var T=(d===f.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(T,d,A.PlaylistLevelType.MAIN)}},_.onLevelsUpdated=function(h,c){this.levels=c.levels},_.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},_.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 T=N.BufferHelper.getBuffered(h),b=T.length?T.start(0):0,S=b-d;S>0&&(S<this.config.maxBufferHole||S<this.config.maxFragLookUpTolerance)&&(l.logger.log("adjusting start position by "+S+" to match buffer start"),d+=S,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+c),h.currentTime=d}},_._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},_._loadBitrateTestFrag=function(h){var c=this;this._doFragLoad(h).then(function(d){var T=c.hls;if(!d||T.nextLoadLevel||c.fragContextChanged(h))return;c.fragLoadError=0,c.state=L.State.IDLE,c.startFragRequested=!1,c.bitrateTest=!1;var b=h.stats;b.parsing.start=b.parsing.end=b.buffering.start=b.buffering.end=self.performance.now(),T.trigger(B.Events.FRAG_LOADED,d)})},_._handleTransmuxComplete=function(h){var c,d="main",T=this.hls,b=h.remuxResult,S=h.chunkMeta,D=this.getCurrentContext(S);if(!D){this.warn("The loading context changed while buffering fragment "+S.sn+" of level "+S.level+". This chunk will not be buffered."),this.resetLiveStartWhenNotLoaded(S.level);return}var I=D.frag,w=D.part,P=D.level,U=b.video,O=b.text,G=b.id3,V=b.initSegment,ae=this.altAudio?void 0:b.audio;if(this.fragContextChanged(I))return;if(this.state=L.State.PARSING,V){V.tracks&&(this._bufferInitSegment(P,V.tracks,I,S),T.trigger(B.Events.FRAG_PARSING_INIT_SEGMENT,{frag:I,id:d,tracks:V.tracks}));var ie=V.initPTS,fe=V.timescale;Object(j.isFiniteNumber)(ie)&&(this.initPTS[I.cc]=ie,T.trigger(B.Events.INIT_PTS_FOUND,{frag:I,id:d,initPTS:ie,timescale:fe}))}if(U&&b.independent!==!1){if(P.details){var ce=U.startPTS,J=U.endPTS,Z=U.startDTS,he=U.endDTS;if(w)w.elementaryStreams[U.type]={startPTS:ce,endPTS:J,startDTS:Z,endDTS:he};else if(U.firstKeyFrame&&U.independent&&(this.couldBacktrack=!0),U.dropped&&U.independent){var X=this.getLoadPosition()+this.config.maxBufferHole;if(X<ce){this.backtrack(I);return}I.setElementaryStreamInfo(U.type,I.start,J,I.start,he,!0)}I.setElementaryStreamInfo(U.type,ce,J,Z,he),this.bufferFragmentData(U,I,w,S)}}else if(b.independent===!1){this.backtrack(I);return}if(ae){var $=ae.startPTS,ye=ae.endPTS,Le=ae.startDTS,Re=ae.endDTS;w&&(w.elementaryStreams[f.ElementaryStreamTypes.AUDIO]={startPTS:$,endPTS:ye,startDTS:Le,endDTS:Re}),I.setElementaryStreamInfo(f.ElementaryStreamTypes.AUDIO,$,ye,Le,Re),this.bufferFragmentData(ae,I,w,S)}if(G!=null&&(c=G.samples)!==null&&c!==void 0&&c.length){var Ie={frag:I,id:d,samples:G.samples};T.trigger(B.Events.FRAG_PARSING_METADATA,Ie)}if(O){var Ne={frag:I,id:d,samples:O.samples};T.trigger(B.Events.FRAG_PARSING_USERDATA,Ne)}},_._bufferInitSegment=function(h,c,d,T){var b=this;if(this.state!==L.State.PARSING)return;this.audioOnly=!!c.audio&&!c.video,this.altAudio&&!this.audioOnly&&delete c.audio;var S=c.audio,D=c.video,I=c.audiovideo;if(S){var w=h.audioCodec,P=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(w&&(w.indexOf("mp4a.40.5")!==-1?w="mp4a.40.2":w="mp4a.40.5"),S.metadata.channelCount!==1&&P.indexOf("firefox")===-1&&(w="mp4a.40.5")),P.indexOf("android")!==-1&&S.container!=="audio/mpeg"&&(w="mp4a.40.2",this.log("Android: force audio codec to "+w)),h.audioCodec&&h.audioCodec!==w&&this.log('Swapping manifest audio codec "'+h.audioCodec+'" for "'+w+'"'),S.levelCodec=w,S.id="main",this.log("Init audio buffer, container:"+S.container+", codecs[selected/level/parsed]=["+(w||"")+"/"+(h.audioCodec||"")+"/"+S.codec+"]")}D&&(D.levelCodec=h.videoCodec,D.id="main",this.log("Init video buffer, container:"+D.container+", codecs[level/parsed]=["+(h.videoCodec||"")+"/"+D.codec+"]")),I&&this.log("Init audiovideo buffer, container:"+I.container+", codecs[level/parsed]=["+(h.attrs.CODECS||"")+"/"+I.codec+"]"),this.hls.trigger(B.Events.BUFFER_CODECS,c),Object.keys(c).forEach(function(U){var O=c[U],G=O.initSegment;G!=null&&G.byteLength&&b.hls.trigger(B.Events.BUFFER_APPENDING,{type:U,data:G,frag:d,part:null,chunkMeta:T,parent:d.type})}),this.tick()},_.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=L.State.BACKTRACKING},_.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 T=this.fragPlaying,b=c.level;(!T||c.sn!==T.sn||T.level!==b||c.urlId!==T.urlId)&&(this.hls.trigger(B.Events.FRAG_CHANGED,{frag:c}),(!T||T.level!==b)&&this.hls.trigger(B.Events.LEVEL_SWITCHED,{level:b}),this.fragPlaying=c)}}},r(E,[{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}}]),E}(L.default)},"./src/controller/subtitle-stream-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"SubtitleStreamController",function(){return i});var j=C("./src/events.ts"),L=C("./src/utils/logger.ts"),R=C("./src/utils/buffer-helper.ts"),B=C("./src/controller/fragment-finders.ts"),N=C("./src/utils/discontinuities.ts"),e=C("./src/controller/level-helper.ts"),A=C("./src/controller/fragment-tracker.ts"),f=C("./src/controller/base-stream-controller.ts"),p=C("./src/types/loader.ts"),o=C("./src/types/level.ts");function a(t,y){for(var m=0;m<y.length;m++){var g=y[m];g.enumerable=g.enumerable||!1,g.configurable=!0,"value"in g&&(g.writable=!0),Object.defineProperty(t,g.key,g)}}function n(t,y,m){return y&&a(t.prototype,y),m&&a(t,m),t}function l(t,y){t.prototype=Object.create(y.prototype),t.prototype.constructor=t,s(t,y)}function s(t,y){return s=Object.setPrototypeOf||function(g,E){return g.__proto__=E,g},s(t,y)}var r=500,i=function(t){l(y,t);function y(g,E){var _;return _=t.call(this,g,E,"[subtitle-stream-controller]")||this,_.levels=[],_.currentTrackId=-1,_.tracksBuffered=[],_.mainDetails=null,_._registerListeners(),_}var m=y.prototype;return m.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},m._registerListeners=function(){var E=this.hls;E.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.on(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.on(j.Events.ERROR,this.onError,this),E.on(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.on(j.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.on(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.on(j.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.on(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m._unregisterListeners=function(){var E=this.hls;E.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),E.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),E.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),E.off(j.Events.LEVEL_LOADED,this.onLevelLoaded,this),E.off(j.Events.ERROR,this.onError,this),E.off(j.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),E.off(j.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),E.off(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),E.off(j.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),E.off(j.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)},m.startLoad=function(){this.stopLoad(),this.state=f.State.IDLE,this.setInterval(r),this.tick()},m.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},m.onLevelLoaded=function(E,_){this.mainDetails=_.details},m.onSubtitleFragProcessed=function(E,_){var u=_.frag,h=_.success;if(this.fragPrevious=u,this.state=f.State.IDLE,!h)return;var c=this.tracksBuffered[this.currentTrackId];if(!c)return;for(var d,T=u.start,b=0;b<c.length;b++)if(T>=c[b].start&&T<=c[b].end){d=c[b];break}var S=u.start+u.duration;d?d.end=S:(d={start:T,end:S},c.push(d)),this.fragmentTracker.fragBuffered(u)},m.onBufferFlushing=function(E,_){var u=_.startOffset,h=_.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 T=d[c].details,b=T.targetduration,S=h-b;if(S<=0)return;_.endOffsetSubtitles=Math.max(0,S),this.tracksBuffered.forEach(function(D){for(var I=0;I<D.length;){if(D[I].end<=S){D.shift();continue}else if(D[I].start<S)D[I].start=S;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(u,S,p.PlaylistLevelType.SUBTITLE)}},m.onError=function(E,_){var u,h=_.frag;if(!h||h.type!==p.PlaylistLevelType.SUBTITLE)return;(u=this.fragCurrent)!==null&&u!==void 0&&u.loader&&this.fragCurrent.loader.abort(),this.state=f.State.IDLE},m.onSubtitleTracksUpdated=function(E,_){var u=this,h=_.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(E,_){if(this.currentTrackId=_.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(r)},m.onSubtitleTrackLoaded=function(E,_){var u,h=_.details,c=_.id,d=this.currentTrackId,T=this.levels;if(!T.length)return;var b=T[d];if(c>=T.length||c!==d||!b)return;if(this.mediaBuffer=this.mediaBufferTimeRanges,h.live||(u=b.details)!==null&&u!==void 0&&u.live){var S=this.mainDetails;if(h.deltaUpdateFailed||!S)return;var D=S.fragments[0];if(!b.details)h.hasProgramDateTime&&S.hasProgramDateTime?Object(N.alignMediaPlaylistByPDT)(h,S):D&&Object(e.addSliding)(h,D.start);else{var I=this.alignPlaylists(h,b.details);I===0&&D&&Object(e.addSliding)(h,D.start)}}if(b.details=h,this.levelLastLoaded=c,this.tick(),h.live&&!this.fragCurrent&&this.media&&this.state===f.State.IDLE){var w=Object(B.findFragmentByPTS)(null,h.fragments,this.media.currentTime,0);w||(this.warn("Subtitle playlist not aligned with playback"),b.details=void 0)}},m._handleFragmentLoadComplete=function(E){var _=E.frag,u=E.payload,h=_.decryptdata,c=this.hls;if(this.fragContextChanged(_))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(T){var b=performance.now();c.trigger(j.Events.FRAG_DECRYPTED,{frag:_,payload:T,stats:{tstart:d,tdecrypt:b}})})}},m.doTick=function(){if(!this.media){this.state=f.State.IDLE;return}if(this.state===f.State.IDLE){var E,_=this.currentTrackId,u=this.levels;if(!u.length||!u[_]||!u[_].details)return;var h=u[_].details,c=h.targetduration,d=this.config,T=this.media,b=R.BufferHelper.bufferedInfo(this.mediaBufferTimeRanges,T.currentTime-c,d.maxBufferHole),S=b.end,D=b.len,I=this.getMaxBufferLength()+c;if(D>I)return;console.assert(h,"Subtitle track details are defined on idle subtitle stream controller tick");var w=h.fragments,P=w.length,U=h.edge,O,G=this.fragPrevious;if(S<U){var V=d.maxFragLookUpTolerance;G&&h.hasProgramDateTime&&(O=Object(B.findFragmentByPDT)(w,G.endProgramDateTime,V)),O||(O=Object(B.findFragmentByPTS)(G,w,S,V),!O&&G&&G.start<w[0].start&&(O=w[0]))}else O=w[P-1];(E=O)!==null&&E!==void 0&&E.encrypted?(L.logger.log("Loading key for "+O.sn),this.state=f.State.KEY_LOADING,this.hls.trigger(j.Events.KEY_LOADING,{frag:O})):O&&this.fragmentTracker.getState(O)===A.FragmentState.NOT_LOADED&&this.loadFragment(O,h,S)}},m.loadFragment=function(E,_,u){this.fragCurrent=E,t.prototype.loadFragment.call(this,E,_,u)},n(y,[{key:"mediaBufferTimeRanges",get:function(){return this.tracksBuffered[this.currentTrackId]||[]}}]),y}(f.default)},"./src/controller/subtitle-track-controller.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/events.ts"),L=C("./src/utils/texttrack-utils.ts"),R=C("./src/controller/base-playlist-controller.ts"),B=C("./src/types/loader.ts");function N(a,n){for(var l=0;l<n.length;l++){var s=n[l];s.enumerable=s.enumerable||!1,s.configurable=!0,"value"in s&&(s.writable=!0),Object.defineProperty(a,s.key,s)}}function e(a,n,l){return n&&N(a.prototype,n),l&&N(a,l),a}function A(a,n){a.prototype=Object.create(n.prototype),a.prototype.constructor=a,f(a,n)}function f(a,n){return f=Object.setPrototypeOf||function(s,r){return s.__proto__=r,s},f(a,n)}var p=function(a){A(n,a);function n(s){var r;return r=a.call(this,s,"[subtitle-track-controller]")||this,r.media=null,r.tracks=[],r.groupId=null,r.tracksInGroup=[],r.trackId=-1,r.selectDefaultTrack=!0,r.queuedDefaultTrack=-1,r.trackChangeListener=function(){return r.onTextTracksChanged()},r.asyncPollTrackChange=function(){return r.pollTrackChange(0)},r.useTextTrackPolling=!1,r.subtitlePollingInterval=-1,r.subtitleDisplay=!0,r.registerListeners(),r}var l=n.prototype;return l.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,a.prototype.destroy.call(this)},l.registerListeners=function(){var r=this.hls;r.on(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.on(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.on(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.on(j.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.on(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.on(j.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var r=this.hls;r.off(j.Events.MEDIA_ATTACHED,this.onMediaAttached,this),r.off(j.Events.MEDIA_DETACHING,this.onMediaDetaching,this),r.off(j.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(j.Events.MANIFEST_PARSED,this.onManifestParsed,this),r.off(j.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(j.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),r.off(j.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),r.off(j.Events.ERROR,this.onError,this)},l.onMediaAttached=function(r,i){if(this.media=i.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(r){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,r)},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 r=o(this.media.textTracks);r.forEach(function(i){Object(L.clearCurrentCues)(i)}),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(r,i){this.tracks=i.subtitleTracks},l.onSubtitleTrackLoaded=function(r,i){var t=i.id,y=i.details,m=this.trackId,g=this.tracksInGroup[m];if(!g){this.warn("Invalid subtitle track id "+t);return}var E=g.details;g.details=i.details,this.log("subtitle track "+t+" loaded ["+y.startSN+"-"+y.endSN+"]"),t===this.trackId&&(this.retryCount=0,this.playlistLoaded(t,i,E))},l.onLevelLoading=function(r,i){this.switchLevel(i.level)},l.onLevelSwitching=function(r,i){this.switchLevel(i.level)},l.switchLevel=function(r){var i=this.hls.levels[r];if(!(i!=null&&i.textGroupIds))return;var t=i.textGroupIds[i.urlId];if(this.groupId!==t){var y=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,m=this.tracks.filter(function(_){return!t||_.groupId===t});this.tracksInGroup=m;var g=this.findTrackId(y==null?void 0:y.name)||this.findTrackId();this.groupId=t;var E={subtitleTracks:m};this.log("Updating subtitle tracks, "+m.length+' track(s) found in "'+t+'" group-id'),this.hls.trigger(j.Events.SUBTITLE_TRACKS_UPDATED,E),g!==-1&&this.setSubtitleTrack(g,y)}},l.findTrackId=function(r){for(var i=this.tracksInGroup,t=0;t<i.length;t++){var y=i[t];if((!this.selectDefaultTrack||y.default)&&(!r||r===y.name))return y.id}return-1},l.onError=function(r,i){if(a.prototype.onError.call(this,r,i),i.fatal||!i.context)return;i.context.type===B.PlaylistContextType.SUBTITLE_TRACK&&i.context.id===this.trackId&&i.context.groupId===this.groupId&&this.retryLoadingOrFail(i)},l.loadPlaylist=function(r){var i=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(i)){var t=i.id,y=i.groupId,m=i.url;if(r)try{m=r.addDirectives(m)}catch(g){this.warn("Could not construct new URL with HLS Delivery Directives: "+g)}this.log("Loading subtitle playlist for id "+t),this.hls.trigger(j.Events.SUBTITLE_TRACK_LOADING,{url:m,id:t,groupId:y,deliveryDirectives:r||null})}},l.toggleTrackModes=function(r){var i=this,t=this.media,y=this.subtitleDisplay,m=this.trackId;if(!t)return;var g=o(t.textTracks),E=g.filter(function(h){return h.groupId===i.groupId});if(r===-1)[].slice.call(g).forEach(function(h){h.mode="disabled"});else{var _=E[m];_&&(_.mode="disabled")}var u=E[r];u&&(u.mode=y?"showing":"hidden")},l.setSubtitleTrack=function(r,i){var t,y=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=r;return}if(this.trackId!==r&&this.toggleTrackModes(r),this.trackId===r&&(r===-1||(t=y[r])!==null&&t!==void 0&&t.details)||r<-1||r>=y.length)return;this.clearTimer();var m=y[r];if(this.log("Switching to subtitle track "+r),this.trackId=r,m){var g=m.id,E=m.groupId,_=E===void 0?"":E,u=m.name,h=m.type,c=m.url;this.hls.trigger(j.Events.SUBTITLE_TRACK_SWITCH,{id:g,groupId:_,name:u,type:h,url:c});var d=this.switchParams(m.url,i==null?void 0:i.details);this.loadPlaylist(d)}else this.hls.trigger(j.Events.SUBTITLE_TRACK_SWITCH,{id:r})},l.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;for(var r=-1,i=o(this.media.textTracks),t=0;t<i.length;t++)if(i[t].mode==="hidden")r=t;else if(i[t].mode==="showing"){r=t;break}this.subtitleTrack!==r&&(this.subtitleTrack=r)},e(n,[{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(r){this.selectDefaultTrack=!1;var i=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(r,i)}}]),n}(R.default);function o(a){for(var n=[],l=0;l<a.length;l++){var s=a[l];s.kind==="subtitles"&&s.label&&n.push(a[l])}return n}H.default=p},"./src/controller/timeline-controller.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"TimelineController",function(){return o});var j=C("./src/polyfills/number.ts"),L=C("./src/events.ts"),R=C("./src/utils/cea-608-parser.ts"),B=C("./src/utils/output-filter.ts"),N=C("./src/utils/webvtt-parser.ts"),e=C("./src/utils/texttrack-utils.ts"),A=C("./src/utils/imsc1-ttml-parser.ts"),f=C("./src/types/loader.ts"),p=C("./src/utils/logger.ts"),o=function(){function s(i){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=i,this.config=i.config,this.Cues=i.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 B.default(this,"textTrack1"),y=new B.default(this,"textTrack2"),m=new B.default(this,"textTrack3"),g=new B.default(this,"textTrack4");this.cea608Parser1=new R.default(1,t,y),this.cea608Parser2=new R.default(3,m,g)}i.on(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),i.on(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),i.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),i.on(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),i.on(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),i.on(L.Events.FRAG_LOADING,this.onFragLoading,this),i.on(L.Events.FRAG_LOADED,this.onFragLoaded,this),i.on(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),i.on(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),i.on(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),i.on(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),i.on(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var r=s.prototype;return r.destroy=function(){var t=this.hls;t.off(L.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),t.off(L.Events.MEDIA_DETACHING,this.onMediaDetaching,this),t.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),t.off(L.Events.MANIFEST_LOADED,this.onManifestLoaded,this),t.off(L.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),t.off(L.Events.FRAG_LOADING,this.onFragLoading,this),t.off(L.Events.FRAG_LOADED,this.onFragLoaded,this),t.off(L.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),t.off(L.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),t.off(L.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),t.off(L.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),t.off(L.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},r.addCues=function(t,y,m,g,E){for(var _=!1,u=E.length;u--;){var h=E[u],c=n(h[0],h[1],y,m);if(c>=0&&(h[0]=Math.min(h[0],y),h[1]=Math.max(h[1],m),_=!0,c/(m-y)>.5))return}if(_||E.push([y,m]),this.config.renderTextTracksNatively){var d=this.captionsTracks[t];this.Cues.newCue(d,y,m,g)}else{var T=this.Cues.newCue(null,y,m,g);this.hls.trigger(L.Events.CUES_PARSED,{type:"captions",cues:T,track:t})}},r.onInitPtsFound=function(t,y){var m=this,g=y.frag,E=y.id,_=y.initPTS,u=y.timescale,h=this.unparsedVttFrags;E==="main"&&(this.initPTS[g.cc]=_,this.timescale[g.cc]=u),h.length&&(this.unparsedVttFrags=[],h.forEach(function(c){m.onFragLoaded(L.Events.FRAG_LOADED,c)}))},r.getExistingTrack=function(t){var y=this.media;if(y)for(var m=0;m<y.textTracks.length;m++){var g=y.textTracks[m];if(g[t])return g}return null},r.createCaptionsTrack=function(t){this.config.renderTextTracksNatively?this.createNativeTrack(t):this.createNonNativeTrack(t)},r.createNativeTrack=function(t){if(this.captionsTracks[t])return;var y=this.captionsProperties,m=this.captionsTracks,g=this.media,E=y[t],_=E.label,u=E.languageCode,h=this.getExistingTrack(t);if(h)m[t]=h,Object(e.clearCurrentCues)(m[t]),Object(e.sendAddTrackEvent)(m[t],g);else{var c=this.createTextTrack("captions",_,u);c&&(c[t]=!0,m[t]=c)}},r.createNonNativeTrack=function(t){if(this.nonNativeCaptionsTracks[t])return;var y=this.captionsProperties[t];if(!y)return;var m=y.label,g={_id:t,label:m,kind:"captions",default:y.media?!!y.media.default:!1,closedCaptions:y.media};this.nonNativeCaptionsTracks[t]=g,this.hls.trigger(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[g]})},r.createTextTrack=function(t,y,m){var g=this.media;return g?g.addTextTrack(t,y,m):void 0},r.onMediaAttaching=function(t,y){this.media=y.media,this._cleanTracks()},r.onMediaDetaching=function(){var t=this.captionsTracks;Object.keys(t).forEach(function(y){Object(e.clearCurrentCues)(t[y]),delete t[y]}),this.nonNativeCaptionsTracks={}},r.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())},r._cleanTracks=function(){var t=this.media;if(!t)return;var y=t.textTracks;if(y)for(var m=0;m<y.length;m++)Object(e.clearCurrentCues)(y[m])},r.onSubtitleTracksUpdated=function(t,y){var m=this;this.textTracks=[];var g=y.subtitleTracks||[],E=g.some(function(c){return c.textCodec===A.IMSC1_CODEC});if(this.config.enableWebVTT||E&&this.config.enableIMSC1){var _=this.tracks&&g&&this.tracks.length===g.length;if(this.tracks=g||[],this.config.renderTextTracksNatively){var u=this.media?this.media.textTracks:[];this.tracks.forEach(function(c,d){var T;if(d<u.length){for(var b=null,S=0;S<u.length;S++)if(a(u[S],c)){b=u[S];break}b&&(T=b)}T?Object(e.clearCurrentCues)(T):(T=m.createTextTrack("subtitles",c.name,c.lang),T&&(T.mode="disabled")),T&&(T.groupId=c.groupId,m.textTracks.push(T))})}else if(!_&&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(L.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:h})}}},r.onManifestLoaded=function(t,y){var m=this;this.config.enableCEA708Captions&&y.captions&&y.captions.forEach(function(g){var E=/(?:CC|SERVICE)([1-4])/.exec(g.instreamId);if(!E)return;var _="textTrack"+E[1],u=m.captionsProperties[_];if(!u)return;u.label=g.name,g.lang&&(u.languageCode=g.lang),u.media=g})},r.onFragLoading=function(t,y){var m=this.cea608Parser1,g=this.cea608Parser2,E=this.lastSn,_=this.lastPartIndex;if(!this.enabled||!(m&&g))return;if(y.frag.type===f.PlaylistLevelType.MAIN){var u,h,c=y.frag.sn,d=(u=y==null||((h=y.part)===null||h===void 0)?void 0:h.index)!=null?u:-1;c===E+1||c===E&&d===_+1||(m.reset(),g.reset()),this.lastSn=c,this.lastPartIndex=d}},r.onFragLoaded=function(t,y){var m=y.frag,g=y.payload,E=this.initPTS,_=this.unparsedVttFrags;if(m.type===f.PlaylistLevelType.SUBTITLE)if(g.byteLength){if(!Object(j.isFiniteNumber)(E[m.cc])){_.push(y),E.length&&this.hls.trigger(L.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===A.IMSC1_CODEC?this._parseIMSC1(m,g):this._parseVTTs(m,g,c)}}else this.hls.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:m,error:new Error("Empty subtitle payload")})},r._parseIMSC1=function(t,y){var m=this,g=this.hls;Object(A.parseIMSC1)(y,this.initPTS[t.cc],this.timescale[t.cc],function(E){m._appendCues(E,t.level),g.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(E){p.logger.log("Failed to parse IMSC1: "+E),g.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:E})})},r._parseVTTs=function(t,y,m){var g=this,E=this.hls;Object(N.parseWebVTT)(y,this.initPTS[t.cc],this.timescale[t.cc],m,t.cc,t.start,function(_){g._appendCues(_,t.level),E.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:t})},function(_){g._fallbackToIMSC1(t,y),p.logger.log("Failed to parse VTT cue: "+_),E.trigger(L.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:t,error:_})})},r._fallbackToIMSC1=function(t,y){var m=this,g=this.tracks[t.level];g.textCodec||Object(A.parseIMSC1)(y,this.initPTS[t.cc],this.timescale[t.cc],function(){g.textCodec=A.IMSC1_CODEC,m._parseIMSC1(t,y)},function(){g.textCodec="wvtt"})},r._appendCues=function(t,y){var m=this.hls;if(this.config.renderTextTracksNatively){var g=this.textTracks[y];if(g.mode==="disabled")return;t.forEach(function(u){return Object(e.addCueToTrack)(g,u)})}else{var E=this.tracks[y],_=E.default?"default":"subtitles"+y;m.trigger(L.Events.CUES_PARSED,{type:"subtitles",cues:t,track:_})}},r.onFragDecrypted=function(t,y){var m=y.frag;if(m.type===f.PlaylistLevelType.SUBTITLE){if(!Object(j.isFiniteNumber)(this.initPTS[m.cc])){this.unparsedVttFrags.push(y);return}this.onFragLoaded(L.Events.FRAG_LOADED,y)}},r.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},r.onFragParsingUserdata=function(t,y){var m=this.cea608Parser1,g=this.cea608Parser2;if(!this.enabled||!(m&&g))return;for(var E=0;E<y.samples.length;E++){var _=y.samples[E].bytes;if(_){var u=this.extractCea608Data(_);m.addData(y.samples[E].pts,u[0]),g.addData(y.samples[E].pts,u[1])}}},r.onBufferFlushing=function(t,y){var m=y.startOffset,g=y.endOffset,E=y.endOffsetSubtitles,_=y.type,u=this.media;if(!u||u.currentTime<g)return;if(!_||_==="video"){var h=this.captionsTracks;Object.keys(h).forEach(function(d){return Object(e.removeCuesInRange)(h[d],m,g)})}if(this.config.renderTextTracksNatively&&(m===0&&E!==void 0)){var c=this.textTracks;Object.keys(c).forEach(function(d){return Object(e.removeCuesInRange)(c[d],m,E)})}},r.extractCea608Data=function(t){for(var y=t[0]&31,m=2,g=[[],[]],E=0;E<y;E++){var _=t[m++],u=127&t[m++],h=127&t[m++],c=(4&_)!==0,d=3&_;if(u===0&&h===0)continue;c&&((d===0||d===1)&&(g[d].push(u),g[d].push(h)))}return g},s}();function a(s,r){return s&&s.label===r.name&&!(s.textTrack1||s.textTrack2)}function n(s,r,i,t){return Math.min(r,t)-Math.max(s,i)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!1}}}},"./src/crypt/aes-crypto.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(B,N){this.subtle=void 0,this.aesIV=void 0,this.subtle=B,this.aesIV=N}var R=L.prototype;return R.decrypt=function(N,e){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},e,N)},L}()},"./src/crypt/aes-decryptor.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"removePadding",function(){return L}),C.d(H,"default",function(){return R});var j=C("./src/utils/typed-array.ts");function L(B){var N=B.byteLength,e=N&&new DataView(B.buffer).getUint8(N-1);return e?Object(j.sliceUint8)(B,0,N-e):B}var R=function(){function B(){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=B.prototype;return N.uint8ArrayToUint32Array_=function(A){for(var f=new DataView(A),p=new Uint32Array(4),o=0;o<4;o++)p[o]=f.getUint32(o*4);return p},N.initTable=function(){var A=this.sBox,f=this.invSBox,p=this.subMix,o=p[0],a=p[1],n=p[2],l=p[3],s=this.invSubMix,r=s[0],i=s[1],t=s[2],y=s[3],m=new Uint32Array(256),g=0,E=0,_=0;for(_=0;_<256;_++)_<128?m[_]=_<<1:m[_]=_<<1^283;for(_=0;_<256;_++){var u=E^E<<1^E<<2^E<<3^E<<4;u=u>>>8^u&255^99,A[g]=u,f[u]=g;var h=m[g],c=m[h],d=m[c],T=m[u]*257^u*16843008;o[g]=T<<24|T>>>8,a[g]=T<<16|T>>>16,n[g]=T<<8|T>>>24,l[g]=T,T=d*16843009^c*65537^h*257^g*16843008,r[u]=T<<24|T>>>8,i[u]=T<<16|T>>>16,t[u]=T<<8|T>>>24,y[u]=T,g?(g=h^m[m[m[d^h]]],E^=m[m[E]]):g=E=1}},N.expandKey=function(A){for(var f=this.uint8ArrayToUint32Array_(A),p=!0,o=0;o<f.length&&p;)p=f[o]===this.key[o],o++;if(p)return;this.key=f;var a=this.keySize=f.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var n=this.ksRows=(a+6+1)*4,l,s,r=this.keySchedule=new Uint32Array(n),i=this.invKeySchedule=new Uint32Array(n),t=this.sBox,y=this.rcon,m=this.invSubMix,g=m[0],E=m[1],_=m[2],u=m[3],h,c;for(l=0;l<n;l++){if(l<a){h=r[l]=f[l];continue}c=h,l%a===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^=y[l/a|0]<<24):a>6&&l%a===4&&(c=t[c>>>24]<<24|t[c>>>16&255]<<16|t[c>>>8&255]<<8|t[c&255]),r[l]=h=(r[l-a]^c)>>>0}for(s=0;s<n;s++)l=n-s,s&3?c=r[l]:c=r[l-4],s<4||l<=4?i[s]=c:i[s]=g[t[c>>>24]]^E[t[c>>>16&255]]^_[t[c>>>8&255]]^u[t[c&255]],i[s]=i[s]>>>0},N.networkToHostOrderSwap=function(A){return A<<24|(A&65280)<<8|(A&16711680)>>8|A>>>24},N.decrypt=function(A,f,p){for(var o=this.keySize+6,a=this.invKeySchedule,n=this.invSBox,l=this.invSubMix,s=l[0],r=l[1],i=l[2],t=l[3],y=this.uint8ArrayToUint32Array_(p),m=y[0],g=y[1],E=y[2],_=y[3],u=new Int32Array(A),h=new Int32Array(u.length),c,d,T,b,S,D,I,w,P,U,O,G,V,ae,ie=this.networkToHostOrderSwap;f<u.length;){for(P=ie(u[f]),U=ie(u[f+1]),O=ie(u[f+2]),G=ie(u[f+3]),S=P^a[0],D=G^a[1],I=O^a[2],w=U^a[3],V=4,ae=1;ae<o;ae++)c=s[S>>>24]^r[D>>16&255]^i[I>>8&255]^t[w&255]^a[V],d=s[D>>>24]^r[I>>16&255]^i[w>>8&255]^t[S&255]^a[V+1],T=s[I>>>24]^r[w>>16&255]^i[S>>8&255]^t[D&255]^a[V+2],b=s[w>>>24]^r[S>>16&255]^i[D>>8&255]^t[I&255]^a[V+3],S=c,D=d,I=T,w=b,V=V+4;c=n[S>>>24]<<24^n[D>>16&255]<<16^n[I>>8&255]<<8^n[w&255]^a[V],d=n[D>>>24]<<24^n[I>>16&255]<<16^n[w>>8&255]<<8^n[S&255]^a[V+1],T=n[I>>>24]<<24^n[w>>16&255]<<16^n[S>>8&255]<<8^n[D&255]^a[V+2],b=n[w>>>24]<<24^n[S>>16&255]<<16^n[D>>8&255]<<8^n[I&255]^a[V+3],h[f]=ie(c^m),h[f+1]=ie(b^g),h[f+2]=ie(T^E),h[f+3]=ie(d^_),m=P,g=U,E=O,_=G,f=f+4}return h.buffer},B}()},"./src/crypt/decrypter.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return f});var j=C("./src/crypt/aes-crypto.ts"),L=C("./src/crypt/fast-aes-key.ts"),R=C("./src/crypt/aes-decryptor.ts"),B=C("./src/utils/logger.ts"),N=C("./src/utils/mp4-tools.ts"),e=C("./src/utils/typed-array.ts"),A=16,f=function(){function p(a,n,l){var s=l===void 0?{}:l,r=s.removePKCS7Padding,i=r===void 0?!0:r;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=a,this.config=n,this.removePKCS7Padding=i,i)try{var t=self.crypto;t&&(this.subtle=t.subtle||t.webkitSubtle)}catch(y){}this.subtle===null&&(this.config.enableSoftwareAES=!0)}var o=p.prototype;return o.destroy=function(){this.observer=null},o.isSync=function(){return this.config.enableSoftwareAES},o.flush=function(){var n=this.currentResult;if(!n){this.reset();return}var l=new Uint8Array(n);return this.reset(),this.removePKCS7Padding?Object(R.removePadding)(l):l},o.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},o.decrypt=function(n,l,s,r){if(this.config.enableSoftwareAES){this.softwareDecrypt(new Uint8Array(n),l,s);var i=this.flush();i&&r(i.buffer)}else this.webCryptoDecrypt(new Uint8Array(n),l,s).then(r)},o.softwareDecrypt=function(n,l,s){var r=this.currentIV,i=this.currentResult,t=this.remainderData;this.logOnce("JS AES decrypt"),t&&(n=Object(N.appendUint8Array)(t,n),this.remainderData=null);var y=this.getValidChunk(n);if(!y.length)return null;r&&(s=r);var m=this.softwareDecrypter;m||(m=this.softwareDecrypter=new R.default),m.expandKey(l);var g=i;return this.currentResult=m.decrypt(y.buffer,0,s),this.currentIV=Object(e.sliceUint8)(y,-16).buffer,g||null},o.webCryptoDecrypt=function(n,l,s){var r=this,i=this.subtle;return(this.key!==l||!this.fastAesKey)&&(this.key=l,this.fastAesKey=new L.default(i,l)),this.fastAesKey.expandKey().then(function(t){if(!i)return Promise.reject(new Error("web crypto not initialized"));var y=new j.default(i,s);return y.decrypt(n.buffer,t)}).catch(function(t){return r.onWebCryptoError(t,n,l,s)})},o.onWebCryptoError=function(n,l,s,r){return B.logger.warn("[decrypter.ts]: WebCrypto Error, disable WebCrypto API:",n),this.config.enableSoftwareAES=!0,this.logEnabled=!0,this.softwareDecrypt(l,s,r)},o.getValidChunk=function(n){var l=n,s=n.length-n.length%A;return s!==n.length&&(l=Object(e.sliceUint8)(n,0,s),this.remainderData=Object(e.sliceUint8)(n,s)),l},o.logOnce=function(n){if(!this.logEnabled)return;B.logger.log("[decrypter.ts]: "+n),this.logEnabled=!1},p}()},"./src/crypt/fast-aes-key.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(B,N){this.subtle=void 0,this.key=void 0,this.subtle=B,this.key=N}var R=L.prototype;return R.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},L}()},"./src/demux/aacdemuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/demux/base-audio-demuxer.ts"),L=C("./src/demux/adts.ts"),R=C("./src/utils/logger.ts"),B=C("./src/demux/id3.ts");function N(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,e(f,p)}function e(f,p){return e=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},e(f,p)}var A=function(f){N(p,f);function p(a,n){var l;return l=f.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=a,l.config=n,l}var o=p.prototype;return o.resetInitSegment=function(n,l,s){f.prototype.resetInitSegment.call(this,n,l,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!0,samples:[],manifestCodec:n,duration:s,inputTimeScale:9e4,dropped:0}},p.probe=function(n){if(!n)return!1;for(var l=B.getID3Data(n,0)||[],s=l.length,r=n.length;s<r;s++)if(L.probe(n,s))return R.logger.log("ADTS sync word found !"),!0;return!1},o.canParse=function(n,l){return L.canParse(n,l)},o.appendFrame=function(n,l,s){L.initTrackConfig(n,this.observer,l,s,n.manifestCodec);var r=L.appendFrame(n,l,s,this.initPTS,this.frameIndex);if(r&&r.missing===0)return r},p}(j.default);A.minProbeByteLength=9,H.default=A},"./src/demux/adts.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"getAudioConfig",function(){return B}),C.d(H,"isHeaderPattern",function(){return N}),C.d(H,"getHeaderLength",function(){return e}),C.d(H,"getFullFrameLength",function(){return A}),C.d(H,"canGetFrameLength",function(){return f}),C.d(H,"isHeader",function(){return p}),C.d(H,"canParse",function(){return o}),C.d(H,"probe",function(){return a}),C.d(H,"initTrackConfig",function(){return n}),C.d(H,"getFrameDuration",function(){return l}),C.d(H,"parseFrameHeader",function(){return s}),C.d(H,"appendFrame",function(){return r});var j=C("./src/utils/logger.ts"),L=C("./src/errors.ts"),R=C("./src/events.ts");function B(i,t,y,m){var g,E,_,u,h=navigator.userAgent.toLowerCase(),c=m,d=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];g=((t[y+2]&192)>>>6)+1;var T=(t[y+2]&60)>>>2;if(T>d.length-1){i.trigger(R.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+T});return}return _=(t[y+2]&1)<<2,_|=(t[y+3]&192)>>>6,j.logger.log("manifest codec:"+m+", ADTS type:"+g+", samplingIndex:"+T),/firefox/i.test(h)?T>=6?(g=5,u=new Array(4),E=T-3):(g=2,u=new Array(2),E=T):h.indexOf("android")!==-1?(g=2,u=new Array(2),E=T):(g=5,u=new Array(4),m&&(m.indexOf("mp4a.40.29")!==-1||m.indexOf("mp4a.40.5")!==-1)||!m&&T>=6?E=T-3:((m&&m.indexOf("mp4a.40.2")!==-1&&(T>=6&&_===1||/vivaldi/i.test(h))||!m&&_===1)&&(g=2,u=new Array(2)),E=T)),u[0]=g<<3,u[0]|=(T&14)>>1,u[1]|=(T&1)<<7,u[1]|=_<<3,g===5&&(u[1]|=(E&14)>>1,u[2]=(E&1)<<7,u[2]|=2<<2,u[3]=0),{config:u,samplerate:d[T],channelCount:_,codec:"mp4a.40."+g,manifestCodec:c}}function N(i,t){return i[t]===255&&(i[t+1]&246)===240}function e(i,t){return i[t+1]&1?7:9}function A(i,t){return(i[t+3]&3)<<11|i[t+4]<<3|(i[t+5]&224)>>>5}function f(i,t){return t+5<i.length}function p(i,t){return t+1<i.length&&N(i,t)}function o(i,t){return f(i,t)&&N(i,t)&&A(i,t)<=i.length-t}function a(i,t){if(p(i,t)){var y=e(i,t);if(t+y>=i.length)return!1;var m=A(i,t);if(m<=y)return!1;var g=t+m;return g===i.length||p(i,g)}return!1}function n(i,t,y,m,g){if(!i.samplerate){var E=B(t,y,m,g);if(!E)return;i.config=E.config,i.samplerate=E.samplerate,i.channelCount=E.channelCount,i.codec=E.codec,i.manifestCodec=E.manifestCodec,j.logger.log("parsed codec:"+i.codec+", rate:"+E.samplerate+", channels:"+E.channelCount)}}function l(i){return 1024*9e4/i}function s(i,t,y,m,g){var E=e(i,t),_=A(i,t);if(_-=E,_>0){var u=y+m*g;return{headerLength:E,frameLength:_,stamp:u}}}function r(i,t,y,m,g){var E=l(i.samplerate),_=s(t,y,m,g,E);if(_){var u=_.frameLength,h=_.headerLength,c=_.stamp,d=h+u,T=Math.max(0,y+d-t.length),b;T?(b=new Uint8Array(d-h),b.set(t.subarray(y+h,t.length),0)):b=t.subarray(y+h,y+d);var S={unit:b,pts:c};return T||i.samples.push(S),{sample:S,length:d,missing:T}}}},"./src/demux/base-audio-demuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"initPTSFn",function(){return A});var j=C("./src/polyfills/number.ts"),L=C("./src/demux/id3.ts"),R=C("./src/demux/dummy-demuxed-track.ts"),B=C("./src/utils/mp4-tools.ts"),N=C("./src/utils/typed-array.ts"),e=function(){function f(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.initPTS=null}var p=f.prototype;return p.resetInitSegment=function(a,n,l){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},p.resetTimeStamp=function(){},p.resetContiguity=function(){},p.canParse=function(a,n){return!1},p.appendFrame=function(a,n,l){},p.demux=function(a,n){this.cachedData&&(a=Object(B.appendUint8Array)(this.cachedData,a),this.cachedData=null);var l=L.getID3Data(a,0),s=l?l.length:0,r,i,t=this._audioTrack,y=this._id3Track,m=l?L.getTimeStamp(l):void 0,g=a.length;for((this.frameIndex===0||this.initPTS===null)&&(this.initPTS=A(m,n)),l&&l.length>0&&y.samples.push({pts:this.initPTS,dts:this.initPTS,data:l}),i=this.initPTS;s<g;){if(this.canParse(a,s)){var E=this.appendFrame(t,a,s);E?(this.frameIndex++,i=E.sample.pts,s+=E.length,r=s):s=g}else L.canParse(a,s)?(l=L.getID3Data(a,s),y.samples.push({pts:i,dts:i,data:l}),s+=l.length,r=s):s++;if(s===g&&r!==g){var _=Object(N.sliceUint8)(a,r);this.cachedData?this.cachedData=Object(B.appendUint8Array)(this.cachedData,_):this.cachedData=_}}return{audioTrack:t,avcTrack:Object(R.dummyTrack)(),id3Track:y,textTrack:Object(R.dummyTrack)()}},p.demuxSampleAes=function(a,n,l){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},p.flush=function(a){var n=this.cachedData;return n&&(this.cachedData=null,this.demux(n,0)),this.frameIndex=0,{audioTrack:this._audioTrack,avcTrack:Object(R.dummyTrack)(),id3Track:this._id3Track,textTrack:Object(R.dummyTrack)()}},p.destroy=function(){},f}(),A=function(p,o){return Object(j.isFiniteNumber)(p)?p*90:o*9e4};H.default=e},"./src/demux/chunk-cache.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function R(){this.chunks=[],this.dataLength=0}var B=R.prototype;return B.push=function(e){this.chunks.push(e),this.dataLength+=e.length},B.flush=function(){var e=this.chunks,A=this.dataLength,f;if(e.length)e.length===1?f=e[0]:f=L(e,A);else return new Uint8Array(0);return this.reset(),f},B.reset=function(){this.chunks.length=0,this.dataLength=0},R}();function L(R,B){for(var N=new Uint8Array(B),e=0,A=0;A<R.length;A++){var f=R[A];N.set(f,e),e+=f.length}return N}},"./src/demux/dummy-demuxed-track.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"dummyTrack",function(){return j});function j(){return{type:"",id:-1,pid:-1,inputTimeScale:9e4,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/logger.ts"),L=function(){function R(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 B=R.prototype;return B.loadWord=function(){var e=this.data,A=this.bytesAvailable,f=e.byteLength-A,p=new Uint8Array(4),o=Math.min(4,A);if(o===0)throw new Error("no bytes available");p.set(e.subarray(f,f+o)),this.word=new DataView(p.buffer).getUint32(0),this.bitsAvailable=o*8,this.bytesAvailable-=o},B.skipBits=function(e){var A;this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,A=e>>3,e-=A>>3,this.bytesAvailable-=A,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)},B.readBits=function(e){var A=Math.min(this.bitsAvailable,e),f=this.word>>>32-A;return e>32&&j.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=A,this.bitsAvailable>0?this.word<<=A:this.bytesAvailable>0&&this.loadWord(),A=e-A,A>0&&this.bitsAvailable?f<<A|this.readBits(A):f},B.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()},B.skipUEG=function(){this.skipBits(1+this.skipLZ())},B.skipEG=function(){this.skipBits(1+this.skipLZ())},B.readUEG=function(){var e=this.skipLZ();return this.readBits(e+1)-1},B.readEG=function(){var e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)},B.readBoolean=function(){return this.readBits(1)===1},B.readUByte=function(){return this.readBits(8)},B.readUShort=function(){return this.readBits(16)},B.readUInt=function(){return this.readBits(32)},B.skipScalingList=function(e){for(var A=8,f=8,p,o=0;o<e;o++)f!==0&&(p=this.readEG(),f=(A+p+256)%256),A=f===0?A:f},B.readSPS=function(){var e=0,A=0,f=0,p=0,o,a,n,l=this.readUByte.bind(this),s=this.readBits.bind(this),r=this.readUEG.bind(this),i=this.readBoolean.bind(this),t=this.skipBits.bind(this),y=this.skipEG.bind(this),m=this.skipUEG.bind(this),g=this.skipScalingList.bind(this);l();var E=l();if(s(5),t(3),l(),m(),E===100||E===110||E===122||E===244||E===44||E===83||E===86||E===118||E===128){var _=r();if(_===3&&t(1),m(),m(),t(1),i())for(a=_!==3?8:12,n=0;n<a;n++)i()&&(n<6?g(16):g(64))}m();var u=r();if(u===0)r();else if(u===1)for(t(1),y(),y(),o=r(),n=0;n<o;n++)y();m(),t(1);var h=r(),c=r(),d=s(1);d===0&&t(1),t(1),i()&&(e=r(),A=r(),f=r(),p=r());var T=[1,1];if(i()&&i()){var b=l();switch(b){case 1:T=[1,1];break;case 2:T=[12,11];break;case 3:T=[10,11];break;case 4:T=[16,11];break;case 5:T=[40,33];break;case 6:T=[24,11];break;case 7:T=[20,11];break;case 8:T=[32,11];break;case 9:T=[80,33];break;case 10:T=[18,11];break;case 11:T=[15,11];break;case 12:T=[64,33];break;case 13:T=[160,99];break;case 14:T=[4,3];break;case 15:T=[3,2];break;case 16:T=[2,1];break;case 255:{T=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((h+1)*16-e*2-A*2),height:(2-d)*(c+1)*16-(d?2:4)*(f+p),pixelRatio:T}},B.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},R}();H.default=L},"./src/demux/id3.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isHeader",function(){return j}),C.d(H,"isFooter",function(){return L}),C.d(H,"getID3Data",function(){return R}),C.d(H,"canParse",function(){return N}),C.d(H,"getTimeStamp",function(){return e}),C.d(H,"isTimeStampFrame",function(){return A}),C.d(H,"getID3Frames",function(){return p}),C.d(H,"decodeFrame",function(){return o}),C.d(H,"utf8ArrayToStr",function(){return r}),C.d(H,"testables",function(){return i});var j=function(g,E){return E+10<=g.length&&(g[E]===73&&g[E+1]===68&&g[E+2]===51&&(g[E+3]<255&&g[E+4]<255&&(g[E+6]<128&&g[E+7]<128&&g[E+8]<128&&g[E+9]<128)))},L=function(g,E){return E+10<=g.length&&(g[E]===51&&g[E+1]===68&&g[E+2]===73&&(g[E+3]<255&&g[E+4]<255&&(g[E+6]<128&&g[E+7]<128&&g[E+8]<128&&g[E+9]<128)))},R=function(g,E){for(var _=E,u=0;j(g,E);){u+=10;var h=B(g,E+6);u+=h,L(g,E+10)&&(u+=10),E+=u}return u>0?g.subarray(_,_+u):void 0},B=function(g,E){var _=0;return _=(g[E]&127)<<21,_|=(g[E+1]&127)<<14,_|=(g[E+2]&127)<<7,_|=g[E+3]&127,_},N=function(g,E){return j(g,E)&&B(g,E+6)+10<=g.length-E},e=function(g){for(var E=p(g),_=0;_<E.length;_++){var u=E[_];if(A(u))return s(u)}return},A=function(g){return g&&g.key==="PRIV"&&g.info==="com.apple.streaming.transportStreamTimestamp"},f=function(g){var E=String.fromCharCode(g[0],g[1],g[2],g[3]),_=B(g,4),u=10;return{type:E,size:_,data:g.subarray(u,u+_)}},p=function(g){for(var E=0,_=[];j(g,E);){var u=B(g,E+6);E+=10;for(var h=E+u;E+8<h;){var c=f(g.subarray(E)),d=o(c);d&&_.push(d),E+=c.size+10}L(g,E)&&(E+=10)}return _},o=function(g){return g.type==="PRIV"?a(g):g.type[0]==="W"?l(g):n(g)},a=function(g){if(g.size<2)return;var E=r(g.data,!0),_=new Uint8Array(g.data.subarray(E.length+1));return{key:g.type,info:E,data:_.buffer}},n=function(g){if(g.size<2)return;if(g.type==="TXXX"){var E=1,_=r(g.data.subarray(E),!0);E+=_.length+1;var u=r(g.data.subarray(E));return{key:g.type,info:_,data:u}}var h=r(g.data.subarray(1));return{key:g.type,data:h}},l=function(g){if(g.type==="WXXX"){if(g.size<2)return;var E=1,_=r(g.data.subarray(E),!0);E+=_.length+1;var u=r(g.data.subarray(E));return{key:g.type,info:_,data:u}}var h=r(g.data);return{key:g.type,data:h}},s=function(g){if(g.data.byteLength===8){var E=new Uint8Array(g.data),_=E[3]&1,u=(E[4]<<23)+(E[5]<<15)+(E[6]<<7)+E[7];return u/=45,_&&(u+=4772185884e-2),Math.round(u)}return},r=function(g,E){E===void 0&&(E=!1);var _=y();if(_){var u=_.decode(g);if(E){var h=u.indexOf("\0");return h!==-1?u.substring(0,h):u}return u.replace(/\0/g,"")}for(var c=g.length,d,T,b,S="",D=0;D<c;){if(d=g[D++],d===0&&E)return S;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:S+=String.fromCharCode(d);break;case 12:case 13:T=g[D++],S+=String.fromCharCode((d&31)<<6|T&63);break;case 14:T=g[D++],b=g[D++],S+=String.fromCharCode((d&15)<<12|(T&63)<<6|(b&63)<<0);break;default:}}return S},i={decodeTextFrame:n},t;function y(){return!t&&typeof self.TextDecoder!="undefined"&&(t=new self.TextDecoder("utf-8")),t}},"./src/demux/mp3demuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/demux/base-audio-demuxer.ts"),L=C("./src/demux/id3.ts"),R=C("./src/utils/logger.ts"),B=C("./src/demux/mpegaudio.ts");function N(f,p){f.prototype=Object.create(p.prototype),f.prototype.constructor=f,e(f,p)}function e(f,p){return e=Object.setPrototypeOf||function(a,n){return a.__proto__=n,a},e(f,p)}var A=function(f){N(p,f);function p(){return f.apply(this,arguments)||this}var o=p.prototype;return o.resetInitSegment=function(n,l,s){f.prototype.resetInitSegment.call(this,n,l,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,isAAC:!1,samples:[],manifestCodec:n,duration:s,inputTimeScale:9e4,dropped:0}},p.probe=function(n){if(!n)return!1;for(var l=L.getID3Data(n,0)||[],s=l.length,r=n.length;s<r;s++)if(B.probe(n,s))return R.logger.log("MPEG Audio sync word found !"),!0;return!1},o.canParse=function(n,l){return B.canParse(n,l)},o.appendFrame=function(n,l,s){return this.initPTS===null?void 0:B.appendFrame(n,l,s,this.initPTS,this.frameIndex)},p}(j.default);A.minProbeByteLength=4,H.default=A},"./src/demux/mp4demuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/mp4-tools.ts"),L=C("./src/demux/dummy-demuxed-track.ts"),R=function(){function B(e,A){this.remainderData=null,this.config=void 0,this.config=A}var N=B.prototype;return N.resetTimeStamp=function(){},N.resetInitSegment=function(){},N.resetContiguity=function(){},B.probe=function(A){return Object(j.findBox)({data:A,start:0,end:Math.min(A.length,16384)},["moof"]).length>0},N.demux=function(A){var f=A,p=Object(L.dummyTrack)();if(this.config.progressive){this.remainderData&&(f=Object(j.appendUint8Array)(this.remainderData,A));var o=Object(j.segmentValidRange)(f);this.remainderData=o.remainder,p.samples=o.valid||new Uint8Array}else p.samples=f;return{audioTrack:Object(L.dummyTrack)(),avcTrack:p,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},N.flush=function(){var A=Object(L.dummyTrack)();return A.samples=this.remainderData||new Uint8Array,this.remainderData=null,{audioTrack:Object(L.dummyTrack)(),avcTrack:A,id3Track:Object(L.dummyTrack)(),textTrack:Object(L.dummyTrack)()}},N.demuxSampleAes=function(A,f,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},N.destroy=function(){},B}();R.minProbeByteLength=1024,H.default=R},"./src/demux/mpegaudio.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"appendFrame",function(){return e}),C.d(H,"parseHeader",function(){return A}),C.d(H,"isHeaderPattern",function(){return f}),C.d(H,"isHeader",function(){return p}),C.d(H,"canParse",function(){return o}),C.d(H,"probe",function(){return a});var j=null,L=[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],R=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],B=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],N=[0,1,1,4];function e(n,l,s,r,i){if(s+24>l.length)return;var t=A(l,s);if(t&&s+t.frameLength<=l.length){var y=t.samplesPerFrame*9e4/t.sampleRate,m=r+i*y,g={unit:l.subarray(s,s+t.frameLength),pts:m,dts:m};return n.config=[],n.channelCount=t.channelCount,n.samplerate=t.sampleRate,n.samples.push(g),{sample:g,length:t.frameLength,missing:0}}}function A(n,l){var s=n[l+1]>>3&3,r=n[l+1]>>1&3,i=n[l+2]>>4&15,t=n[l+2]>>2&3;if(s!==1&&i!==0&&i!==15&&t!==3){var y=n[l+2]>>1&1,m=n[l+3]>>6,g=s===3?3-r:r===3?3:4,E=L[g*14+i-1]*1e3,_=s===3?0:s===2?1:2,u=R[_*3+t],h=m===3?1:2,c=B[s][r],d=N[r],T=c*8*d,b=Math.floor(c*E/u+y)*d;if(j===null){var S=navigator.userAgent||"",D=S.match(/Chrome\/(\d+)/i);j=D?parseInt(D[1]):0}var I=!!j&&j<=87;return I&&r===2&&E>=224e3&&m===0&&(n[l+3]=n[l+3]|128),{sampleRate:u,channelCount:h,frameLength:b,samplesPerFrame:T}}}function f(n,l){return n[l]===255&&(n[l+1]&224)===224&&(n[l+1]&6)!==0}function p(n,l){return l+1<n.length&&f(n,l)}function o(n,l){var s=4;return f(n,l)&&s<=n.length-l}function a(n,l){if(l+1<n.length&&f(n,l)){var s=4,r=A(n,l),i=s;r!=null&&r.frameLength&&(i=r.frameLength);var t=l+i;return t===n.length||p(n,t)}return!1}},"./src/demux/sample-aes.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/crypt/decrypter.ts"),L=C("./src/demux/tsdemuxer.ts"),R=function(){function B(e,A,f){this.keyData=void 0,this.decrypter=void 0,this.keyData=f,this.decrypter=new j.default(e,A,{removePKCS7Padding:!1})}var N=B.prototype;return N.decryptBuffer=function(A,f){this.decrypter.decrypt(A,this.keyData.key.buffer,this.keyData.iv.buffer,f)},N.decryptAacSample=function(A,f,p,o){var a=A[f].unit,n=a.subarray(16,a.length-a.length%16),l=n.buffer.slice(n.byteOffset,n.byteOffset+n.length),s=this;this.decryptBuffer(l,function(r){var i=new Uint8Array(r);a.set(i,16),o||s.decryptAacSamples(A,f+1,p)})},N.decryptAacSamples=function(A,f,p){for(;;f++){if(f>=A.length){p();return}if(A[f].unit.length<32)continue;var o=this.decrypter.isSync();if(this.decryptAacSample(A,f,p,o),!o)return}},N.getAvcEncryptedData=function(A){for(var f=Math.floor((A.length-48)/160)*16+16,p=new Int8Array(f),o=0,a=32;a<=A.length-16;a+=160,o+=16)p.set(A.subarray(a,a+16),o);return p},N.getAvcDecryptedUnit=function(A,f){for(var p=new Uint8Array(f),o=0,a=32;a<=A.length-16;a+=160,o+=16)A.set(p.subarray(o,o+16),a);return A},N.decryptAvcSample=function(A,f,p,o,a,n){var l=Object(L.discardEPB)(a.data),s=this.getAvcEncryptedData(l),r=this;this.decryptBuffer(s.buffer,function(i){a.data=r.getAvcDecryptedUnit(l,i),n||r.decryptAvcSamples(A,f,p+1,o)})},N.decryptAvcSamples=function(A,f,p,o){if(A instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;f++,p=0){if(f>=A.length){o();return}for(var a=A[f].units;!(p>=a.length);p++){var n=a[p];if(n.data.length<=48||n.type!==1&&n.type!==5)continue;var l=this.decrypter.isSync();if(this.decryptAvcSample(A,f,p,o,n,l),!l)return}}},B}();H.default=R},"./src/demux/transmuxer-interface.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return a});var j=C("./node_modules/webworkify-webpack/index.js"),L=C.n(j),R=C("./src/events.ts"),B=C("./src/demux/transmuxer.ts"),N=C("./src/utils/logger.ts"),e=C("./src/errors.ts"),A=C("./src/utils/mediasource-helper.ts"),f=C("./node_modules/eventemitter3/index.js"),p=C.n(f),o=Object(A.getMediaSource)()||{isTypeSupported:function(){return!1}},a=function(){function n(s,r,i,t){var y=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=r,this.onTransmuxComplete=i,this.onFlush=t;var m=s.config,g=function(c,d){d=d||{},d.frag=y.frag,d.id=y.id,s.trigger(c,d)};this.observer=new f.EventEmitter,this.observer.on(R.Events.FRAG_DECRYPTED,g),this.observer.on(R.Events.ERROR,g);var E={mp4:o.isTypeSupported("video/mp4"),mpeg:o.isTypeSupported("audio/mpeg"),mp3:o.isTypeSupported('audio/mp4; codecs="mp3"')},_=navigator.vendor;if(m.enableWorker&&typeof Worker!="undefined"){N.logger.log("demuxing in webworker");var u;try{u=this.worker=j("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),u.addEventListener("message",this.onwmsg),u.onerror=function(h){s.trigger(R.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:E,vendor:_,id:r,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 B.default(this.observer,E,m,_,r),this.worker=null}}else this.transmuxer=new B.default(this.observer,E,m,_,r)}var l=n.prototype;return l.destroy=function(){var r=this.worker;if(r)r.removeEventListener("message",this.onwmsg),r.terminate(),this.worker=null;else{var i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}var t=this.observer;t&&t.removeAllListeners(),this.observer=null},l.push=function(r,i,t,y,m,g,E,_,u,h){var c=this;u.transmuxing.start=self.performance.now();var d=this.transmuxer,T=this.worker,b=g?g.start:m.start,S=m.decryptdata,D=this.frag,I=!(D&&m.cc===D.cc),w=!(D&&u.level===D.level),P=D?u.sn-D.sn:-1,U=this.part?u.part-this.part.index:1,O=!w&&(P===1||P===0&&U===1),G=self.performance.now();(w||P||m.stats.parsing.start===0)&&(m.stats.parsing.start=G),g&&(U||!O)&&(g.stats.parsing.start=G);var V=new B.TransmuxState(I,O,_,w,b);if(!O||I){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: `+I+`
|
|
trackSwitch: `+w+`
|
|
contiguous: `+O+`
|
|
accurateTimeOffset: `+_+`
|
|
timeOffset: `+b);var ae=new B.TransmuxConfig(t,y,i,E,h);this.configureTransmuxer(ae)}if(this.frag=m,this.part=g,T)T.postMessage({cmd:"demux",data:r,decryptdata:S,chunkMeta:u,state:V},r instanceof ArrayBuffer?[r]:[]);else if(d){var ie=d.push(r,S,u,V);Object(B.isPromise)(ie)?ie.then(function(fe){c.handleTransmuxComplete(fe)}):this.handleTransmuxComplete(ie)}},l.flush=function(r){var i=this;r.transmuxing.start=self.performance.now();var t=this.transmuxer,y=this.worker;if(y)y.postMessage({cmd:"flush",chunkMeta:r});else if(t){var m=t.flush(r);Object(B.isPromise)(m)?m.then(function(g){i.handleFlushResult(g,r)}):this.handleFlushResult(m,r)}},l.handleFlushResult=function(r,i){var t=this;r.forEach(function(y){t.handleTransmuxComplete(y)}),this.onFlush(i)},l.onWorkerMessage=function(r){var i=r.data,t=this.hls;switch(i.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(i.data);break}case"flush":{this.onFlush(i.data);break}default:{i.data=i.data||{},i.data.frag=this.frag,i.data.id=this.id,t.trigger(i.event,i.data);break}}},l.configureTransmuxer=function(r){var i=this.worker,t=this.transmuxer;i?i.postMessage({cmd:"configure",config:r}):t&&t.configure(r)},l.handleTransmuxComplete=function(r){r.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(r)},n}()},"./src/demux/transmuxer-worker.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return e});var j=C("./src/demux/transmuxer.ts"),L=C("./src/events.ts"),R=C("./src/utils/logger.ts"),B=C("./node_modules/eventemitter3/index.js"),N=C.n(B);function e(a){var n=new B.EventEmitter,l=function(r,i){a.postMessage({event:r,data:i})};n.on(L.Events.FRAG_DECRYPTED,l),n.on(L.Events.ERROR,l),a.addEventListener("message",function(s){var r=s.data;switch(r.cmd){case"init":{var i=JSON.parse(r.config);a.transmuxer=new j.default(n,r.typeSupported,i,r.vendor,r.id),Object(R.enableLogs)(i.debug),l("init",null);break}case"configure":{a.transmuxer.configure(r.config);break}case"demux":{var t=a.transmuxer.push(r.data,r.decryptdata,r.chunkMeta,r.state);Object(j.isPromise)(t)?t.then(function(g){A(a,g)}):A(a,t);break}case"flush":{var y=r.chunkMeta,m=a.transmuxer.flush(y);Object(j.isPromise)(m)?m.then(function(g){p(a,g,y)}):p(a,m,y);break}default:break}})}function A(a,n){if(o(n.remuxResult))return;var l=[],s=n.remuxResult,r=s.audio,i=s.video;r&&f(l,r),i&&f(l,i),a.postMessage({event:"transmuxComplete",data:n},l)}function f(a,n){n.data1&&a.push(n.data1.buffer),n.data2&&a.push(n.data2.buffer)}function p(a,n,l){n.forEach(function(s){A(a,s)}),a.postMessage({event:"flush",data:l})}function o(a){return!a.audio&&!a.video&&!a.text&&!a.id3&&!a.initSegment}},"./src/demux/transmuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return i}),C.d(H,"isPromise",function(){return m}),C.d(H,"TransmuxConfig",function(){return g}),C.d(H,"TransmuxState",function(){return E});var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/crypt/decrypter.ts"),B=C("./src/demux/aacdemuxer.ts"),N=C("./src/demux/mp4demuxer.ts"),e=C("./src/demux/tsdemuxer.ts"),A=C("./src/demux/mp3demuxer.ts"),f=C("./src/remux/mp4-remuxer.ts"),p=C("./src/remux/passthrough-remuxer.ts"),o=C("./src/demux/chunk-cache.ts"),a=C("./src/utils/mp4-tools.ts"),n=C("./src/utils/logger.ts"),l;try{l=self.performance.now.bind(self.performance)}catch(_){n.logger.debug("Unable to use Performance API on this environment"),l=self.Date.now}var s=[{demux:e.default,remux:f.default},{demux:N.default,remux:p.default},{demux:B.default,remux:f.default},{demux:A.default,remux:f.default}],r=1024;s.forEach(function(_){var u=_.demux;r=Math.max(r,u.minProbeByteLength)});var i=function(){function _(h,c,d,T,b){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=T,this.id=b}var u=_.prototype;return u.configure=function(c){this.transmuxConfig=c,this.decrypter&&this.decrypter.reset()},u.push=function(c,d,T,b){var S=this,D=T.transmuxing;D.executeStart=l();var I=new Uint8Array(c),w=this.cache,P=this.config,U=this.currentTransmuxState,O=this.transmuxConfig;b&&(this.currentTransmuxState=b);var G=t(I,d);if(G&&G.method==="AES-128"){var V=this.getDecrypter();if(P.enableSoftwareAES){var ae=V.softwareDecrypt(I,G.key.buffer,G.iv.buffer);if(!ae)return D.executeEnd=l(),y(T);I=new Uint8Array(ae)}else return this.decryptionPromise=V.webCryptoDecrypt(I,G.key.buffer,G.iv.buffer).then(function(Ee){var Ae=S.push(Ee,null,T);return S.decryptionPromise=null,Ae}),this.decryptionPromise}var ie=b||U,fe=ie.contiguous,ce=ie.discontinuity,J=ie.trackSwitch,Z=ie.accurateTimeOffset,he=ie.timeOffset,X=O.audioCodec,$=O.videoCodec,ye=O.defaultInitPts,Le=O.duration,Re=O.initSegmentData;if((ce||J)&&this.resetInitSegment(Re,X,$,Le),ce&&this.resetInitialTimestamp(ye),fe||this.resetContiguity(),this.needsProbing(I,ce,J)){if(w.dataLength){var Ie=w.flush();I=Object(a.appendUint8Array)(Ie,I)}this.configureTransmuxer(I,O)}var Ne=this.transmux(I,G,he,Z,T),_e=this.currentTransmuxState;return _e.contiguous=!0,_e.discontinuity=!1,_e.trackSwitch=!1,D.executeEnd=l(),Ne},u.flush=function(c){var d=this,T=c.transmuxing;T.executeStart=l();var b=this.decrypter,S=this.cache,D=this.currentTransmuxState,I=this.decryptionPromise;if(I)return I.then(function(){return d.flush(c)});var w=[],P=D.timeOffset;if(b){var U=b.flush();U&&w.push(this.push(U,null,c))}var O=S.dataLength;S.reset();var G=this.demuxer,V=this.remuxer;if(!G||!V)return O>=r&&this.observer.emit(j.Events.ERROR,j.Events.ERROR,{type:L.ErrorTypes.MEDIA_ERROR,details:L.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),T.executeEnd=l(),[y(c)];var ae=G.flush(P);return m(ae)?ae.then(function(ie){return d.flushRemux(w,ie,c),w}):(this.flushRemux(w,ae,c),w)},u.flushRemux=function(c,d,T){var b=d.audioTrack,S=d.avcTrack,D=d.id3Track,I=d.textTrack,w=this.currentTransmuxState,P=w.accurateTimeOffset,U=w.timeOffset;n.logger.log("[transmuxer.ts]: Flushed fragment "+T.sn+(T.part>-1?" p: "+T.part:"")+" of level "+T.level);var O=this.remuxer.remux(b,S,D,I,U,P,!0,this.id);c.push({remuxResult:O,chunkMeta:T}),T.transmuxing.executeEnd=l()},u.resetInitialTimestamp=function(c){var d=this.demuxer,T=this.remuxer;if(!d||!T)return;d.resetTimeStamp(c),T.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,T,b){var S=this.demuxer,D=this.remuxer;if(!S||!D)return;S.resetInitSegment(d,T,b),D.resetInitSegment(c,d,T)},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,T,b,S){var D;return d&&d.method==="SAMPLE-AES"?D=this.transmuxSampleAes(c,d,T,b,S):D=this.transmuxUnencrypted(c,T,b,S),D},u.transmuxUnencrypted=function(c,d,T,b){var S=this.demuxer.demux(c,d,!1,!this.config.progressive),D=S.audioTrack,I=S.avcTrack,w=S.id3Track,P=S.textTrack,U=this.remuxer.remux(D,I,w,P,d,T,!1,this.id);return{remuxResult:U,chunkMeta:b}},u.transmuxSampleAes=function(c,d,T,b,S){var D=this;return this.demuxer.demuxSampleAes(c,d,T).then(function(I){var w=D.remuxer.remux(I.audioTrack,I.avcTrack,I.id3Track,I.textTrack,T,b,!1,D.id);return{remuxResult:w,chunkMeta:S}})},u.configureTransmuxer=function(c,d){for(var T=this.config,b=this.observer,S=this.typeSupported,D=this.vendor,I=d.audioCodec,w=d.defaultInitPts,P=d.duration,U=d.initSegmentData,O=d.videoCodec,G,V=0,ae=s.length;V<ae;V++)if(s[V].demux.probe(c)){G=s[V];break}G||(n.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),G={demux:N.default,remux:p.default});var ie=this.demuxer,fe=this.remuxer,ce=G.remux,J=G.demux;(!fe||!(fe instanceof ce))&&(this.remuxer=new ce(b,T,S,D)),(!ie||!(ie instanceof J))&&(this.demuxer=new J(b,T,S),this.probe=J.probe),this.resetInitSegment(U,I,O,P),this.resetInitialTimestamp(w)},u.needsProbing=function(c,d,T){return!this.demuxer||!this.remuxer||d||T},u.getDecrypter=function(){var c=this.decrypter;return c||(c=this.decrypter=new R.default(this.observer,this.config)),c},_}();function t(_,u){var h=null;return _.byteLength>0&&u!=null&&u.key!=null&&u.iv!==null&&u.method!=null&&(h=u),h}var y=function(u){return{remuxResult:{},chunkMeta:u}};function m(_){return"then"in _&&_.then instanceof Function}var g=function(u,h,c,d,T){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=T},E=function(u,h,c,d,T){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=T}},"./src/demux/tsdemuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"discardEPB",function(){return y});var j=C("./src/demux/adts.ts"),L=C("./src/demux/mpegaudio.ts"),R=C("./src/demux/exp-golomb.ts"),B=C("./src/demux/id3.ts"),N=C("./src/demux/sample-aes.ts"),e=C("./src/events.ts"),A=C("./src/utils/mp4-tools.ts"),f=C("./src/utils/logger.ts"),p=C("./src/errors.ts"),o={video:1,audio:2,id3:3,text:4},a=function(){function m(E,_,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=E,this.config=_,this.typeSupported=u}m.probe=function(_){var u=m.syncOffset(_);return u<0?!1:(u&&f.logger.warn("MPEG2-TS detected but first sync word found @ offset "+u+", junk ahead ?"),!0)},m.syncOffset=function(_){for(var u=Math.min(1e3,_.length-3*188),h=0;h<u;){if(_[h]===71&&_[h+188]===71&&_[h+2*188]===71)return h;h++}return-1},m.createTrack=function(_,u){return{container:_==="video"||_==="audio"?"video/mp2t":void 0,type:_,id:o[_],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:_==="audio"?u:void 0}};var g=m.prototype;return g.resetInitSegment=function(_,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=_,this.videoCodec=u,this._duration=h},g.resetTimeStamp=function(){},g.resetContiguity=function(){var _=this._audioTrack,u=this._avcTrack,h=this._id3Track;_&&(_.pesData=null),u&&(u.pesData=null),h&&(h.pesData=null),this.aacOverFlow=null,this.aacLastPTS=null},g.demux=function(_,u,h,c){h===void 0&&(h=!1),c===void 0&&(c=!1),h||(this.sampleAes=null);var d,T=this._avcTrack,b=this._audioTrack,S=this._id3Track,D=T.pid,I=T.pesData,w=b.pid,P=S.pid,U=b.pesData,O=S.pesData,G=!1,V=this.pmtParsed,ae=this._pmtId,ie=_.length;if(this.remainderData&&(_=Object(A.appendUint8Array)(this.remainderData,_),ie=_.length,this.remainderData=null),ie<188&&!c)return this.remainderData=_,{audioTrack:b,avcTrack:T,id3Track:S,textTrack:this._txtTrack};var fe=Math.max(0,m.syncOffset(_));ie-=(ie+fe)%188,ie<_.byteLength&&!c&&(this.remainderData=new Uint8Array(_.buffer,ie,_.buffer.byteLength-ie));for(var ce=fe;ce<ie;ce+=188)if(_[ce]===71){var J=!!(_[ce+1]&64),Z=((_[ce+1]&31)<<8)+_[ce+2],he=(_[ce+3]&48)>>4,X=void 0;if(he>1){if(X=ce+5+_[ce+4],X===ce+188)continue}else X=ce+4;switch(Z){case D:J&&(I&&(d=r(I))&&this.parseAVCPES(d,!1),I={data:[],size:0}),I&&(I.data.push(_.subarray(X,ce+188)),I.size+=ce+188-X);break;case w:J&&(U&&(d=r(U))&&(b.isAAC?this.parseAACPES(d):this.parseMPEGPES(d)),U={data:[],size:0}),U&&(U.data.push(_.subarray(X,ce+188)),U.size+=ce+188-X);break;case P:J&&(O&&(d=r(O))&&this.parseID3PES(d),O={data:[],size:0}),O&&(O.data.push(_.subarray(X,ce+188)),O.size+=ce+188-X);break;case 0:J&&(X+=_[X]+1),ae=this._pmtId=l(_,X);break;case ae:{J&&(X+=_[X]+1);var $=s(_,X,this.typeSupported.mpeg===!0||this.typeSupported.mp3===!0,h);D=$.avc,D>0&&(T.pid=D),w=$.audio,w>0&&(b.pid=w,b.isAAC=$.isAAC),P=$.id3,P>0&&(S.pid=P),G&&!V&&(f.logger.log("reparse from beginning"),G=!1,ce=fe-188),V=this.pmtParsed=!0;break}case 17:case 8191:break;default:G=!0;break}}else this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"TS packet did not start with 0x47"});T.pesData=I,b.pesData=U,S.pesData=O;var ye={audioTrack:b,avcTrack:T,id3Track:S,textTrack:this._txtTrack};return c&&this.extractRemainingSamples(ye),ye},g.flush=function(){var _=this.remainderData;this.remainderData=null;var u;return _?u=this.demux(_,-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},g.extractRemainingSamples=function(_){var u=_.audioTrack,h=_.avcTrack,c=_.id3Track,d=h.pesData,T=u.pesData,b=c.pesData,S;d&&(S=r(d))?(this.parseAVCPES(S,!0),h.pesData=null):h.pesData=d,T&&(S=r(T))?(u.isAAC?this.parseAACPES(S):this.parseMPEGPES(S),u.pesData=null):(T!=null&&T.size&&f.logger.log("last AAC PES packet truncated,might overlap between fragments"),u.pesData=T),b&&(S=r(b))?(this.parseID3PES(S),c.pesData=null):c.pesData=b},g.demuxSampleAes=function(_,u,h){var c=this.demux(_,h,!0,!this.config.progressive),d=this.sampleAes=new N.default(this.observer,this.config,u);return this.decrypt(c,d)},g.decrypt=function(_,u){return new Promise(function(h){var c=_.audioTrack,d=_.avcTrack;c.samples&&c.isAAC?u.decryptAacSamples(c.samples,0,function(){d.samples?u.decryptAvcSamples(d.samples,0,0,function(){h(_)}):h(_)}):d.samples&&u.decryptAvcSamples(d.samples,0,0,function(){h(_)})})},g.destroy=function(){this._initPTS=this._initDTS=null,this._duration=0},g.parseAVCPES=function(_,u){var h=this,c=this._avcTrack,d=this.parseAVCNALu(_.data),T=!1,b=this.avcSample,S,D=!1;_.data=null,b&&d.length&&!c.audFound&&(i(b,c),b=this.avcSample=n(!1,_.pts,_.dts,"")),d.forEach(function(I){switch(I.type){case 1:{S=!0,b||(b=h.avcSample=n(!0,_.pts,_.dts,"")),T&&(b.debug+="NDR "),b.frame=!0;var w=I.data;if(D&&w.length>4){var P=new R.default(w).readSliceType();(P===2||P===4||P===7||P===9)&&(b.key=!0)}break}case 5:S=!0,b||(b=h.avcSample=n(!0,_.pts,_.dts,"")),T&&(b.debug+="IDR "),b.key=!0,b.frame=!0;break;case 6:{S=!0,T&&b&&(b.debug+="SEI ");var U=new R.default(y(I.data));U.readUByte();for(var O=0,G=0,V=!1,ae=0;!V&&U.bytesAvailable>1;){O=0;do ae=U.readUByte(),O+=ae;while(ae===255);G=0;do ae=U.readUByte(),G+=ae;while(ae===255);if(O===4&&U.bytesAvailable!==0){V=!0;var ie=U.readUByte();if(ie===181){var fe=U.readUShort();if(fe===49){var ce=U.readUInt();if(ce===1195456820){var J=U.readUByte();if(J===3){for(var Z=U.readUByte(),he=U.readUByte(),X=31&Z,$=[Z,he],ye=0;ye<X;ye++)$.push(U.readUByte()),$.push(U.readUByte()),$.push(U.readUByte());t(h._txtTrack.samples,{type:3,pts:_.pts,bytes:$})}}}}}else if(O===5&&U.bytesAvailable!==0){if(V=!0,G>16){for(var Le=[],Re=0;Re<16;Re++)Le.push(U.readUByte().toString(16)),(Re===3||Re===5||Re===7||Re===9)&&Le.push("-");for(var Ie=G-16,Ne=new Uint8Array(Ie),_e=0;_e<Ie;_e++)Ne[_e]=U.readUByte();t(h._txtTrack.samples,{pts:_.pts,payloadType:O,uuid:Le.join(""),userData:Object(B.utf8ArrayToStr)(Ne),userDataBytes:Ne})}}else if(G<U.bytesAvailable)for(var Ee=0;Ee<G;Ee++)U.readUByte()}break}case 7:if(S=!0,D=!0,T&&b&&(b.debug+="SPS "),!c.sps){var Ae=new R.default(I.data),Y=Ae.readSPS();c.width=Y.width,c.height=Y.height,c.pixelRatio=Y.pixelRatio,c.sps=[I.data],c.duration=h._duration;for(var se=I.data.subarray(1,4),pe="avc1.",ge=0;ge<3;ge++){var ke=se[ge].toString(16);ke.length<2&&(ke="0"+ke),pe+=ke}c.codec=pe}break;case 8:S=!0,T&&b&&(b.debug+="PPS "),c.pps||(c.pps=[I.data]);break;case 9:S=!1,c.audFound=!0,b&&i(b,c),b=h.avcSample=n(!1,_.pts,_.dts,T?"AUD ":"");break;case 12:S=!1;break;default:S=!1,b&&(b.debug+="unknown NAL "+I.type+" ");break}if(b&&S){var oe=b.units;oe.push(I)}}),u&&b&&(i(b,c),this.avcSample=null)},g.getLastNalUnit=function(){var _,u=this.avcSample,h;if(!u||u.units.length===0){var c=this._avcTrack.samples;u=c[c.length-1]}if((_=u)!==null&&_!==void 0&&_.units){var d=u.units;h=d[d.length-1]}return h},g.parseAVCNALu=function(_){var u=_.byteLength,h=this._avcTrack,c=h.naluState||0,d=c,T=[],b=0,S,D,I,w=-1,P=0;for(c===-1&&(w=0,P=_[0]&31,c=0,b=1);b<u;){if(S=_[b++],!c){c=S?0:1;continue}if(c===1){c=S?0:2;continue}if(!S)c=3;else if(S===1){if(w>=0){var U={data:_.subarray(w,b-c-1),type:P};T.push(U)}else{var O=this.getLastNalUnit();if(O&&(d&&b<=4-d&&(O.state&&(O.data=O.data.subarray(0,O.data.byteLength-d))),D=b-c-1,D>0)){var G=new Uint8Array(O.data.byteLength+D);G.set(O.data,0),G.set(_.subarray(0,D),O.data.byteLength),O.data=G,O.state=0}}b<u?(I=_[b]&31,w=b,P=I,c=0):c=-1}else c=0}if(w>=0&&c>=0){var V={data:_.subarray(w,u),type:P,state:c};T.push(V)}if(T.length===0){var ae=this.getLastNalUnit();if(ae){var ie=new Uint8Array(ae.data.byteLength+_.byteLength);ie.set(ae.data,0),ie.set(_,ae.data.byteLength),ae.data=ie}}return h.naluState=c,T},g.parseAACPES=function(_){var u=0,h=this._audioTrack,c=this.aacOverFlow,d=_.data;if(c){this.aacOverFlow=null;var T=c.sample.unit.byteLength,b=Math.min(c.missing,T),S=T-b;c.sample.unit.set(d.subarray(0,b),S),h.samples.push(c.sample),u=c.missing}var D,I;for(D=u,I=d.length;D<I-1&&!j.isHeader(d,D);D++);if(D!==u){var w,P;if(D<I-1?(w="AAC PES did not start with ADTS header,offset:"+D,P=!1):(w="no ADTS header found in AAC PES",P=!0),f.logger.warn("parsing error:"+w),this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:p.ErrorTypes.MEDIA_ERROR,details:p.ErrorDetails.FRAG_PARSING_ERROR,fatal:P,reason:w}),P)return}j.initTrackConfig(h,this.observer,d,D,this.audioCodec);var U;if(_.pts!==void 0)U=_.pts;else if(c){var O=j.getFrameDuration(h.samplerate);U=c.sample.pts+O}else{f.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var G=0;D<I;)if(j.isHeader(d,D)){if(D+5<I){var V=j.appendFrame(h,d,D,U,G);if(V)if(V.missing)this.aacOverFlow=V;else{D+=V.length,G++;continue}}break}else D++},g.parseMPEGPES=function(_){var u=_.data,h=u.length,c=0,d=0,T=_.pts;if(T===void 0){f.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<h;)if(L.isHeader(u,d)){var b=L.appendFrame(this._audioTrack,u,d,T,c);if(b)d+=b.length,c++;else break}else d++},g.parseID3PES=function(_){if(_.pts===void 0){f.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}this._id3Track.samples.push(_)},m}();a.minProbeByteLength=188;function n(m,g,E,_){return{key:m,frame:!1,pts:g,dts:E,units:[],debug:_,length:0}}function l(m,g){return(m[g+10]&31)<<8|m[g+11]}function s(m,g,E,_){var u={audio:-1,avc:-1,id3:-1,isAAC:!0},h=(m[g+1]&15)<<8|m[g+2],c=g+3+h-4,d=(m[g+10]&15)<<8|m[g+11];for(g+=12+d;g<c;){var T=(m[g+1]&31)<<8|m[g+2];switch(m[g]){case 207:if(!_){f.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:u.audio===-1&&(u.audio=T);break;case 21:u.id3===-1&&(u.id3=T);break;case 219:if(!_){f.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:u.avc===-1&&(u.avc=T);break;case 3:case 4:E?u.audio===-1&&(u.audio=T,u.isAAC=!1):f.logger.log("MPEG audio found, not supported in this browser");break;case 36:f.logger.warn("Unsupported HEVC stream type found");break;default:break}g+=((m[g+3]&15)<<8|m[g+4])+5}return u}function r(m){var g=0,E,_,u,h,c,d=m.data;if(!m||m.size===0)return null;for(;d[0].length<19&&d.length>1;){var T=new Uint8Array(d[0].length+d[1].length);T.set(d[0]),T.set(d[1],d[0].length),d[0]=T,d.splice(1,1)}E=d[0];var b=(E[0]<<16)+(E[1]<<8)+E[2];if(b===1){if(_=(E[4]<<8)+E[5],_&&_>m.size-6)return null;var S=E[7];S&192&&(h=(E[9]&14)*536870912+(E[10]&255)*4194304+(E[11]&254)*16384+(E[12]&255)*128+(E[13]&254)/2,S&64?(c=(E[14]&14)*536870912+(E[15]&255)*4194304+(E[16]&254)*16384+(E[17]&255)*128+(E[18]&254)/2,h-c>60*9e4&&(f.logger.warn(Math.round((h-c)/9e4)+"s delta between PTS and DTS, align them"),h=c)):c=h),u=E[8];var D=u+9;if(m.size<=D)return null;m.size-=D;for(var I=new Uint8Array(m.size),w=0,P=d.length;w<P;w++){E=d[w];var U=E.byteLength;if(D)if(D>U){D-=U;continue}else E=E.subarray(D),U-=D,D=0;I.set(E,g),g+=U}return _&&(_-=u+3),{data:I,pts:h,dts:c,len:_}}return null}function i(m,g){if(m.units.length&&m.frame){if(m.pts===void 0){var E=g.samples,_=E.length;if(_){var u=E[_-1];m.pts=u.pts,m.dts=u.dts}else{g.dropped++;return}}g.samples.push(m)}m.debug.length&&f.logger.log(m.pts+"/"+m.dts+":"+m.debug)}function t(m,g){var E=m.length;if(E>0){if(g.pts>=m[E-1].pts)m.push(g);else for(var _=E-1;_>=0;_--)if(g.pts<m[_].pts){m.splice(_,0,g);break}}else m.push(g)}function y(m){for(var g=m.byteLength,E=[],_=1;_<g-2;)m[_]===0&&m[_+1]===0&&m[_+2]===3?(E.push(_+2),_+=2):_++;if(E.length===0)return m;var u=g-E.length,h=new Uint8Array(u),c=0;for(_=0;_<u;c++,_++)c===E[0]&&(c++,E.shift()),h[_]=m[c];return h}H.default=a},"./src/errors.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"ErrorTypes",function(){return j}),C.d(H,"ErrorDetails",function(){return L});var j;(function(R){R.NETWORK_ERROR="networkError",R.MEDIA_ERROR="mediaError",R.KEY_SYSTEM_ERROR="keySystemError",R.MUX_ERROR="muxError",R.OTHER_ERROR="otherError"})(j||(j={}));var L;(function(R){R.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",R.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",R.KEY_SYSTEM_NO_SESSION="keySystemNoSession",R.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",R.KEY_SYSTEM_NO_INIT_DATA="keySystemNoInitData",R.MANIFEST_LOAD_ERROR="manifestLoadError",R.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",R.MANIFEST_PARSING_ERROR="manifestParsingError",R.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",R.LEVEL_EMPTY_ERROR="levelEmptyError",R.LEVEL_LOAD_ERROR="levelLoadError",R.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",R.LEVEL_SWITCH_ERROR="levelSwitchError",R.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",R.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",R.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",R.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",R.FRAG_LOAD_ERROR="fragLoadError",R.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",R.FRAG_DECRYPT_ERROR="fragDecryptError",R.FRAG_PARSING_ERROR="fragParsingError",R.REMUX_ALLOC_ERROR="remuxAllocError",R.KEY_LOAD_ERROR="keyLoadError",R.KEY_LOAD_TIMEOUT="keyLoadTimeOut",R.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",R.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",R.BUFFER_APPEND_ERROR="bufferAppendError",R.BUFFER_APPENDING_ERROR="bufferAppendingError",R.BUFFER_STALLED_ERROR="bufferStalledError",R.BUFFER_FULL_ERROR="bufferFullError",R.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",R.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",R.INTERNAL_EXCEPTION="internalException",R.INTERNAL_ABORTED="aborted",R.UNKNOWN="unknown"})(L||(L={}))},"./src/events.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"Events",function(){return j});var j;(function(L){L.MEDIA_ATTACHING="hlsMediaAttaching",L.MEDIA_ATTACHED="hlsMediaAttached",L.MEDIA_DETACHING="hlsMediaDetaching",L.MEDIA_DETACHED="hlsMediaDetached",L.BUFFER_RESET="hlsBufferReset",L.BUFFER_CODECS="hlsBufferCodecs",L.BUFFER_CREATED="hlsBufferCreated",L.BUFFER_APPENDING="hlsBufferAppending",L.BUFFER_APPENDED="hlsBufferAppended",L.BUFFER_EOS="hlsBufferEos",L.BUFFER_FLUSHING="hlsBufferFlushing",L.BUFFER_FLUSHED="hlsBufferFlushed",L.MANIFEST_LOADING="hlsManifestLoading",L.MANIFEST_LOADED="hlsManifestLoaded",L.MANIFEST_PARSED="hlsManifestParsed",L.LEVEL_SWITCHING="hlsLevelSwitching",L.LEVEL_SWITCHED="hlsLevelSwitched",L.LEVEL_LOADING="hlsLevelLoading",L.LEVEL_LOADED="hlsLevelLoaded",L.LEVEL_UPDATED="hlsLevelUpdated",L.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",L.LEVELS_UPDATED="hlsLevelsUpdated",L.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",L.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",L.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",L.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",L.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",L.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",L.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",L.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",L.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",L.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",L.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",L.CUES_PARSED="hlsCuesParsed",L.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",L.INIT_PTS_FOUND="hlsInitPtsFound",L.FRAG_LOADING="hlsFragLoading",L.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",L.FRAG_LOADED="hlsFragLoaded",L.FRAG_DECRYPTED="hlsFragDecrypted",L.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",L.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",L.FRAG_PARSING_METADATA="hlsFragParsingMetadata",L.FRAG_PARSED="hlsFragParsed",L.FRAG_BUFFERED="hlsFragBuffered",L.FRAG_CHANGED="hlsFragChanged",L.FPS_DROP="hlsFpsDrop",L.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",L.ERROR="hlsError",L.DESTROYING="hlsDestroying",L.KEY_LOADING="hlsKeyLoading",L.KEY_LOADED="hlsKeyLoaded",L.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",L.BACK_BUFFER_REACHED="hlsBackBufferReached"})(j||(j={}))},"./src/hls.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return m});var j=C("./node_modules/url-toolkit/src/url-toolkit.js"),L=C.n(j),R=C("./src/loader/playlist-loader.ts"),B=C("./src/loader/key-loader.ts"),N=C("./src/controller/id3-track-controller.ts"),e=C("./src/controller/latency-controller.ts"),A=C("./src/controller/level-controller.ts"),f=C("./src/controller/fragment-tracker.ts"),p=C("./src/controller/stream-controller.ts"),o=C("./src/is-supported.ts"),a=C("./src/utils/logger.ts"),n=C("./src/config.ts"),l=C("./node_modules/eventemitter3/index.js"),s=C.n(l),r=C("./src/events.ts"),i=C("./src/errors.ts");function t(g,E){for(var _=0;_<E.length;_++){var u=E[_];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(g,u.key,u)}}function y(g,E,_){return E&&t(g.prototype,E),_&&t(g,_),g}var m=function(){g.isSupported=function(){return Object(o.isSupported)()};function g(_){_===void 0&&(_={}),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(n.mergeConfig)(g.DefaultConfig,_);this.userConfig=_,Object(a.enableLogs)(u.debug),this._autoLevelCapping=-1,u.progressive&&Object(n.enableStreamingMode)(u);var h=u.abrController,c=u.bufferController,d=u.capLevelController,T=u.fpsController,b=this.abrController=new h(this),S=this.bufferController=new c(this),D=this.capLevelController=new d(this),I=new T(this),w=new R.default(this),P=new B.default(this),U=new N.default(this),O=this.levelController=new A.default(this),G=new f.FragmentTracker(this),V=this.streamController=new p.default(this,G);D.setStreamController(V),I.setStreamController(V);var ae=[O,V];this.networkControllers=ae;var ie=[w,P,b,S,D,I,U,G];this.audioTrackController=this.createController(u.audioTrackController,null,ae),this.createController(u.audioStreamController,G,ae),this.subtitleTrackController=this.createController(u.subtitleTrackController,null,ae),this.createController(u.subtitleStreamController,G,ae),this.createController(u.timelineController,null,ie),this.emeController=this.createController(u.emeController,null,ie),this.cmcdController=this.createController(u.cmcdController,null,ie),this.latencyController=this.createController(e.default,null,ie),this.coreComponents=ie}var E=g.prototype;return E.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},E.on=function(u,h,c){c===void 0&&(c=this),this._emitter.on(u,h,c)},E.once=function(u,h,c){c===void 0&&(c=this),this._emitter.once(u,h,c)},E.removeAllListeners=function(u){this._emitter.removeAllListeners(u)},E.off=function(u,h,c,d){c===void 0&&(c=this),this._emitter.off(u,h,c,d)},E.listeners=function(u){return this._emitter.listeners(u)},E.emit=function(u,h,c){return this._emitter.emit(u,h,c)},E.trigger=function(u,h){if(this.config.debug)return this.emit(u,u,h);try{return this.emit(u,u,h)}catch(c){a.logger.error("An internal error happened while handling event "+u+'. Error message: "'+c.message+'". Here is a stacktrace:',c),this.trigger(r.Events.ERROR,{type:i.ErrorTypes.OTHER_ERROR,details:i.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:u,error:c})}return!1},E.listenerCount=function(u){return this._emitter.listenerCount(u)},E.destroy=function(){a.logger.log("destroy"),this.trigger(r.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},E.attachMedia=function(u){a.logger.log("attachMedia"),this._media=u,this.trigger(r.Events.MEDIA_ATTACHING,{media:u})},E.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(r.Events.MEDIA_DETACHING,void 0),this._media=null},E.loadSource=function(u){this.stopLoad();var h=this.media,c=this.url,d=this.url=j.buildAbsoluteURL(self.location.href,u,{alwaysNormalize:!0});a.logger.log("loadSource:"+d),h&&c&&c!==d&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(h)),this.trigger(r.Events.MANIFEST_LOADING,{url:u})},E.startLoad=function(u){u===void 0&&(u=-1),a.logger.log("startLoad("+u+")"),this.networkControllers.forEach(function(h){h.startLoad(u)})},E.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(u){u.stopLoad()})},E.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},E.recoverMediaError=function(){a.logger.log("recoverMediaError");var u=this._media;this.detachMedia(),u&&this.attachMedia(u)},E.removeLevel=function(u,h){h===void 0&&(h=0),this.levelController.removeLevel(u,h)},y(g,[{key:"levels",get:function(){var u=this.levelController.levels;return u||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(u){a.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){a.logger.log("set nextLevel:"+u),this.levelController.manualLevel=u,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(u){a.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){a.logger.log("set firstLevel:"+u),this.levelController.firstLevel=u}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(u){a.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&&(a.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 r.Events}},{key:"ErrorTypes",get:function(){return i.ErrorTypes}},{key:"ErrorDetails",get:function(){return i.ErrorDetails}},{key:"DefaultConfig",get:function(){return g.defaultConfig?g.defaultConfig:n.hlsDefaultConfig},set:function(u){g.defaultConfig=u}}]),g}();m.defaultConfig=void 0},"./src/is-supported.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isSupported",function(){return R}),C.d(H,"changeTypeSupported",function(){return B});var j=C("./src/utils/mediasource-helper.ts");function L(){return self.SourceBuffer||self.WebKitSourceBuffer}function R(){var N=Object(j.getMediaSource)();if(!N)return!1;var e=L(),A=N&&typeof N.isTypeSupported=="function"&&N.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),f=!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function";return!!A&&!!f}function B(){var N,e=L();return typeof(e==null||((N=e.prototype)===null||N===void 0)?void 0:N.changeType)=="function"}},"./src/loader/fragment-loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return a}),C.d(H,"LoadError",function(){return l});var j=C("./src/polyfills/number.ts"),L=C("./src/errors.ts");function R(s,r){s.prototype=Object.create(r.prototype),s.prototype.constructor=s,f(s,r)}function B(s){var r=typeof Map=="function"?new Map:void 0;return B=function(t){if(t===null||!A(t))return t;if(typeof t!="function")throw new TypeError("Super expression must either be null or a function");if(typeof r!="undefined"){if(r.has(t))return r.get(t);r.set(t,y)}function y(){return N(t,arguments,p(this).constructor)}return y.prototype=Object.create(t.prototype,{constructor:{value:y,enumerable:!1,writable:!0,configurable:!0}}),f(y,t)},B(s)}function N(s,r,i){return e()?N=Reflect.construct:N=function(y,m,g){var E=[null];E.push.apply(E,m);var _=Function.bind.apply(y,E),u=new _;return g&&f(u,g.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 A(s){return Function.toString.call(s).indexOf("[native code]")!==-1}function f(s,r){return f=Object.setPrototypeOf||function(t,y){return t.__proto__=y,t},f(s,r)}function p(s){return p=Object.setPrototypeOf?Object.getPrototypeOf:function(i){return i.__proto__||Object.getPrototypeOf(i)},p(s)}var o=Math.pow(2,17),a=function(){function s(i){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=i}var r=s.prototype;return r.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},r.abort=function(){this.loader&&this.loader.abort()},r.load=function(t,y){var m=this,g=t.url;if(!g)return Promise.reject(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,networkDetails:null},"Fragment does not have a "+(g?"part list":"url")));this.abort();var E=this.config,_=E.fLoader,u=E.loader;return new Promise(function(h,c){m.loader&&m.loader.destroy();var d=m.loader=t.loader=_?new _(E):new u(E),T=n(t),b={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:o};t.stats=d.stats,d.load(T,b,{onSuccess:function(D,I,w,P){m.resetLoader(t,d),h({frag:t,part:null,payload:D.data,networkDetails:P})},onError:function(D,I,w){m.resetLoader(t,d),c(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,response:D,networkDetails:w}))},onAbort:function(D,I,w){m.resetLoader(t,d),c(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,networkDetails:w}))},onTimeout:function(D,I,w){m.resetLoader(t,d),c(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,networkDetails:w}))},onProgress:function(D,I,w,P){y&&y({frag:t,part:null,payload:w,networkDetails:P})}})})},r.loadPart=function(t,y,m){var g=this;this.abort();var E=this.config,_=E.fLoader,u=E.loader;return new Promise(function(h,c){g.loader&&g.loader.destroy();var d=g.loader=t.loader=_?new _(E):new u(E),T=n(t,y),b={timeout:E.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:E.fragLoadingMaxRetryTimeout,highWaterMark:o};y.stats=d.stats,d.load(T,b,{onSuccess:function(D,I,w,P){g.resetLoader(t,d),g.updateStatsFromPart(t,y);var U={frag:t,part:y,payload:D.data,networkDetails:P};m(U),h(U)},onError:function(D,I,w){g.resetLoader(t,d),c(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:t,part:y,response:D,networkDetails:w}))},onAbort:function(D,I,w){t.stats.aborted=y.stats.aborted,g.resetLoader(t,d),c(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:t,part:y,networkDetails:w}))},onTimeout:function(D,I,w){g.resetLoader(t,d),c(new l({type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:t,part:y,networkDetails:w}))}})})},r.updateStatsFromPart=function(t,y){var m=t.stats,g=y.stats,E=g.total;if(m.loaded+=g.loaded,E){var _=Math.round(t.duration/y.duration),u=Math.min(Math.round(m.loaded/E),_),h=_-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,T=g.loading;d.start?d.first+=T.first-T.start:(d.start=T.start,d.first=T.first),d.end=T.end},r.resetLoader=function(t,y){t.loader=null,this.loader===y&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),y.destroy()},s}();function n(s,r){r===void 0&&(r=null);var i=r||s,t={frag:s,part:r,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},y=i.byteRangeStartOffset,m=i.byteRangeEndOffset;return Object(j.isFiniteNumber)(y)&&Object(j.isFiniteNumber)(m)&&(t.rangeStart=y,t.rangeEnd=m),t}var l=function(s){R(r,s);function r(i){for(var t,y=arguments.length,m=new Array(y>1?y-1:0),g=1;g<y;g++)m[g-1]=arguments[g];return t=s.call.apply(s,[this].concat(m))||this,t.data=void 0,t.data=i,t}return r}(B(Error))},"./src/loader/fragment.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"ElementaryStreamTypes",function(){return a}),C.d(H,"BaseSegment",function(){return n}),C.d(H,"Fragment",function(){return l}),C.d(H,"Part",function(){return s});var j=C("./src/polyfills/number.ts"),L=C("./node_modules/url-toolkit/src/url-toolkit.js"),R=C.n(L),B=C("./src/utils/logger.ts"),N=C("./src/loader/level-key.ts"),e=C("./src/loader/load-stats.ts");function A(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,f(r,i)}function f(r,i){return f=Object.setPrototypeOf||function(y,m){return y.__proto__=m,y},f(r,i)}function p(r,i){for(var t=0;t<i.length;t++){var y=i[t];y.enumerable=y.enumerable||!1,y.configurable=!0,"value"in y&&(y.writable=!0),Object.defineProperty(r,y.key,y)}}function o(r,i,t){return i&&p(r.prototype,i),t&&p(r,t),r}var a;(function(r){r.AUDIO="audio",r.VIDEO="video",r.AUDIOVIDEO="audiovideo"})(a||(a={}));var n=function(){function r(t){var y;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(y={},y[a.AUDIO]=null,y[a.VIDEO]=null,y[a.AUDIOVIDEO]=null,y),this.baseurl=t}var i=r.prototype;return i.setByteRange=function(y,m){var g=y.split("@",2),E=[];g.length===1?E[0]=m?m.byteRangeEndOffset:0:E[0]=parseInt(g[1]),E[1]=parseInt(g[0])+E[0],this._byteRange=E},o(r,[{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(L.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(y){this._url=y}}]),r}(),l=function(r){A(i,r);function i(y,m){var g;return g=r.call(this,m)||this,g._decryptdata=null,g.rawProgramDateTime=null,g.programDateTime=null,g.tagList=[],g.duration=0,g.sn=0,g.levelkey=void 0,g.type=void 0,g.loader=null,g.level=-1,g.cc=0,g.startPTS=void 0,g.endPTS=void 0,g.appendedPTS=void 0,g.startDTS=void 0,g.endDTS=void 0,g.start=0,g.deltaPTS=void 0,g.maxStartPTS=void 0,g.minEndPTS=void 0,g.stats=new e.LoadStats,g.urlId=0,g.data=void 0,g.bitrateTest=!1,g.title=null,g.initSegment=null,g.type=y,g}var t=i.prototype;return t.createInitializationVector=function(m){for(var g=new Uint8Array(16),E=12;E<16;E++)g[E]=m>>8*(15-E)&255;return g},t.setDecryptDataFromLevelKey=function(m,g){var E=m;return(m==null?void 0:m.method)==="AES-128"&&m.uri&&!m.iv&&(E=N.LevelKey.fromURI(m.uri),E.method=m.method,E.iv=this.createInitializationVector(g),E.keyFormat="identity"),E},t.setElementaryStreamInfo=function(m,g,E,_,u,h){h===void 0&&(h=!1);var c=this.elementaryStreams,d=c[m];if(!d){c[m]={startPTS:g,endPTS:E,startDTS:_,endDTS:u,partial:h};return}d.startPTS=Math.min(d.startPTS,g),d.endPTS=Math.max(d.endPTS,E),d.startDTS=Math.min(d.startDTS,_),d.endDTS=Math.max(d.endDTS,u)},t.clearElementaryStreamInfo=function(){var m=this.elementaryStreams;m[a.AUDIO]=null,m[a.VIDEO]=null,m[a.AUDIOVIDEO]=null},o(i,[{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&&B.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(j.isFiniteNumber)(this.programDateTime))return null;var m=Object(j.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)}}]),i}(n),s=function(r){A(i,r);function i(t,y,m,g,E){var _;_=r.call(this,m)||this,_.fragOffset=0,_.duration=0,_.gap=!1,_.independent=!1,_.relurl=void 0,_.fragment=void 0,_.index=void 0,_.stats=new e.LoadStats,_.duration=t.decimalFloatingPoint("DURATION"),_.gap=t.bool("GAP"),_.independent=t.bool("INDEPENDENT"),_.relurl=t.enumeratedString("URI"),_.fragment=y,_.index=g;var u=t.enumeratedString("BYTERANGE");return u&&_.setByteRange(u,E),E&&(_.fragOffset=E.fragOffset+E.duration),_}return o(i,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var y=this.elementaryStreams;return!!(y.audio||y.video||y.audiovideo)}}]),i}(n)},"./src/loader/key-loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return B});var j=C("./src/events.ts"),L=C("./src/errors.ts"),R=C("./src/utils/logger.ts"),B=function(){function N(A){this.hls=void 0,this.loaders={},this.decryptkey=null,this.decrypturl=null,this.hls=A,this._registerListeners()}var e=N.prototype;return e._registerListeners=function(){this.hls.on(j.Events.KEY_LOADING,this.onKeyLoading,this)},e._unregisterListeners=function(){this.hls.off(j.Events.KEY_LOADING,this.onKeyLoading)},e.destroy=function(){this._unregisterListeners();for(var f in this.loaders){var p=this.loaders[f];p&&p.destroy()}this.loaders={}},e.onKeyLoading=function(f,p){var o=p.frag,a=o.type,n=this.loaders[a];if(!o.decryptdata){R.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(n&&(R.logger.warn("abort previous key loader for type:"+a),n.abort()),!l){R.logger.warn("key uri is falsy");return}var r=s.loader,i=o.loader=this.loaders[a]=new r(s);this.decrypturl=l,this.decryptkey=null;var t={url:l,frag:o,responseType:"arraybuffer"},y={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)};i.load(t,y,m)}else this.decryptkey&&(o.decryptdata.key=this.decryptkey,this.hls.trigger(j.Events.KEY_LOADED,{frag:o}))},e.loadsuccess=function(f,p,o){var a=o.frag;if(!a.decryptdata){R.logger.error("after key load, decryptdata unset");return}this.decryptkey=a.decryptdata.key=new Uint8Array(f.data),a.loader=null,delete this.loaders[a.type],this.hls.trigger(j.Events.KEY_LOADED,{frag:a})},e.loaderror=function(f,p){var o=p.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_ERROR,fatal:!1,frag:o,response:f})},e.loadtimeout=function(f,p){var o=p.frag,a=o.loader;a&&a.abort(),delete this.loaders[o.type],this.hls.trigger(j.Events.ERROR,{type:L.ErrorTypes.NETWORK_ERROR,details:L.ErrorDetails.KEY_LOAD_TIMEOUT,fatal:!1,frag:o})},N}()},"./src/loader/level-details.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"LevelDetails",function(){return N});var j=C("./src/polyfills/number.ts");function L(e,A){for(var f=0;f<A.length;f++){var p=A[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(e,p.key,p)}}function R(e,A,f){return A&&L(e.prototype,A),f&&L(e,f),e}var B=10,N=function(){function e(f){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=f}var A=e.prototype;return A.reloaded=function(p){if(!p){this.advanced=!0,this.updated=!0;return}var o=this.lastPartSn-p.lastPartSn,a=this.lastPartIndex-p.lastPartIndex;this.updated=this.endSN!==p.endSN||!!a||!!o,this.advanced=this.endSN>p.endSN||o>0||o===0&&a>0,this.updated||this.advanced?this.misses=Math.floor(p.misses*.6):this.misses=p.misses+1,this.availabilityDelay=p.availabilityDelay},R(e,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?Object(j.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||B}},{key:"drift",get:function(){var p=this.driftEndTime-this.driftStartTime;if(p>0){var o=this.driftEnd-this.driftStart;return o*1e3/p}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var p;return(p=this.fragments)!==null&&p!==void 0&&p.length?this.fragments[this.fragments.length-1].end:0}},{key:"age",get:function(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}},{key:"lastPartIndex",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var p;return(p=this.partList)!==null&&p!==void 0&&p.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),e}()},"./src/loader/level-key.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"LevelKey",function(){return N});var j=C("./node_modules/url-toolkit/src/url-toolkit.js"),L=C.n(j);function R(e,A){for(var f=0;f<A.length;f++){var p=A[f];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(e,p.key,p)}}function B(e,A,f){return A&&R(e.prototype,A),f&&R(e,f),e}var N=function(){e.fromURL=function(f,p){return new e(f,p)},e.fromURI=function(f){return new e(f)};function e(A,f){this._uri=null,this.method=null,this.keyFormat=null,this.keyFormatVersions=null,this.keyID=null,this.key=null,this.iv=null,f?this._uri=Object(j.buildAbsoluteURL)(A,f,{alwaysNormalize:!0}):this._uri=A}return B(e,[{key:"uri",get:function(){return this._uri}}]),e}()},"./src/loader/load-stats.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"LoadStats",function(){return j});var j=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(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return i});var j=C("./src/polyfills/number.ts"),L=C("./node_modules/url-toolkit/src/url-toolkit.js"),R=C.n(L),B=C("./src/loader/fragment.ts"),N=C("./src/loader/level-details.ts"),e=C("./src/loader/level-key.ts"),A=C("./src/utils/attr-list.ts"),f=C("./src/utils/logger.ts"),p=C("./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,a=/#EXT-X-MEDIA:(.*)/g,n=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 r(E){var _,u;return s.test((_=(u=L.parseURL(E))===null||u===void 0?void 0:u.path)!=null?_:"")}var i=function(){function E(){}return E.findGroup=function(u,h){for(var c=0;c<u.length;c++){var d=u[c];if(d.id===h)return d}},E.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},E.resolve=function(u,h){return L.buildAbsoluteURL(h,u,{alwaysNormalize:!0})},E.parseMasterPlaylist=function(u,h){var c=[],d={},T=!1;o.lastIndex=0;for(var b;(b=o.exec(u))!=null;)if(b[1]){var S=new A.AttrList(b[1]),D={attrs:S,bitrate:S.decimalInteger("AVERAGE-BANDWIDTH")||S.decimalInteger("BANDWIDTH"),name:S.NAME,url:E.resolve(b[2],h)},I=S.decimalResolution("RESOLUTION");I&&(D.width=I.width,D.height=I.height),t((S.CODECS||"").split(/[ ,]+/).filter(function(P){return P}),D),D.videoCodec&&D.videoCodec.indexOf("avc1")!==-1&&(D.videoCodec=E.convertAVC1ToAVCOTI(D.videoCodec)),c.push(D)}else if(b[3]){var w=new A.AttrList(b[3]);w["DATA-ID"]&&(T=!0,d[w["DATA-ID"]]=w)}return{levels:c,sessionData:T?d:null}},E.parseMasterPlaylistMedia=function(u,h,c,d){d===void 0&&(d=[]);var T,b=[],S=0;for(a.lastIndex=0;(T=a.exec(u))!==null;){var D=new A.AttrList(T[1]);if(D.TYPE===c){var I={attrs:D,bitrate:0,id:S++,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?E.resolve(D.URI,h):""};if(d.length){var w=E.findGroup(d,I.groupId)||d[0];y(I,w,"audioCodec"),y(I,w,"textCodec")}b.push(I)}}return b},E.parseLevelPlaylist=function(u,h,c,d,T){var b=new N.LevelDetails(h),S=b.fragments,D=null,I=0,w=0,P=0,U=0,O=null,G=new B.Fragment(d,h),V,ae,ie,fe=-1,ce=!1;for(n.lastIndex=0,b.m3u8=u;(V=n.exec(u))!==null;){ce&&(ce=!1,G=new B.Fragment(d,h),G.start=P,G.sn=I,G.cc=U,G.level=c,D&&(G.initSegment=D,G.rawProgramDateTime=D.rawProgramDateTime));var J=V[1];if(J){G.duration=parseFloat(J);var Z=(" "+V[2]).slice(1);G.title=Z||null,G.tagList.push(Z?["INF",J,Z]:["INF",J])}else if(V[3])Object(j.isFiniteNumber)(G.duration)&&(G.start=P,ie&&(G.levelkey=ie),G.sn=I,G.level=c,G.cc=U,G.urlId=T,S.push(G),G.relurl=(" "+V[3]).slice(1),g(G,O),O=G,P+=G.duration,I++,w=0,ce=!0);else if(V[4]){var he=(" "+V[4]).slice(1);O?G.setByteRange(he,O):G.setByteRange(he)}else if(V[5])G.rawProgramDateTime=(" "+V[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),fe===-1&&(fe=S.length);else{if(V=V[0].match(l),!V){f.logger.warn("No matches on slow regex match for level playlist!");continue}for(ae=1;ae<V.length&&!(typeof V[ae]!="undefined");ae++);var X=(" "+V[ae]).slice(1),$=(" "+V[ae+1]).slice(1),ye=V[ae+2]?(" "+V[ae+2]).slice(1):"";switch(X){case"PLAYLIST-TYPE":b.type=$.toUpperCase();break;case"MEDIA-SEQUENCE":I=b.startSN=parseInt($);break;case"SKIP":{var Le=new A.AttrList($),Re=Le.decimalInteger("SKIPPED-SEGMENTS");if(Object(j.isFiniteNumber)(Re)){b.skippedSegments=Re;for(var Ie=Re;Ie--;)S.unshift(null);I+=Re}var Ne=Le.enumeratedString("RECENTLY-REMOVED-DATERANGES");Ne&&(b.recentlyRemovedDateranges=Ne.split(" "));break}case"TARGETDURATION":b.targetduration=parseFloat($);break;case"VERSION":b.version=parseInt($);break;case"EXTM3U":break;case"ENDLIST":b.live=!1;break;case"#":($||ye)&&G.tagList.push(ye?[$,ye]:[$]);break;case"DIS":U++;case"GAP":G.tagList.push([X]);break;case"BITRATE":G.tagList.push([X,$]);break;case"DISCONTINUITY-SEQ":U=parseInt($);break;case"KEY":{var _e,Ee=new A.AttrList($),Ae=Ee.enumeratedString("METHOD"),Y=Ee.URI,se=Ee.hexadecimalInteger("IV"),pe=Ee.enumeratedString("KEYFORMATVERSIONS"),ge=Ee.enumeratedString("KEYID"),ke=(_e=Ee.enumeratedString("KEYFORMAT"))!=null?_e:"identity",oe=["com.apple.streamingkeydelivery","com.microsoft.playready","urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed","com.widevine"];if(oe.indexOf(ke)>-1){f.logger.warn("Keyformat "+ke+" is not supported from the manifest");continue}else if(ke!=="identity")continue;Ae&&(ie=e.LevelKey.fromURL(h,Y),Y&&["AES-128","SAMPLE-AES","SAMPLE-AES-CENC"].indexOf(Ae)>=0&&(ie.method=Ae,ie.keyFormat=ke,ge&&(ie.keyID=ge),pe&&(ie.keyFormatVersions=pe),ie.iv=se));break}case"START":{var me=new A.AttrList($),be=me.decimalFloatingPoint("TIME-OFFSET");Object(j.isFiniteNumber)(be)&&(b.startTimeOffset=be);break}case"MAP":{var xe=new A.AttrList($);G.relurl=xe.URI,xe.BYTERANGE&&G.setByteRange(xe.BYTERANGE),G.level=c,G.sn="initSegment",ie&&(G.levelkey=ie),G.initSegment=null,D=G,ce=!0;break}case"SERVER-CONTROL":{var Ce=new A.AttrList($);b.canBlockReload=Ce.bool("CAN-BLOCK-RELOAD"),b.canSkipUntil=Ce.optionalFloat("CAN-SKIP-UNTIL",0),b.canSkipDateRanges=b.canSkipUntil>0&&Ce.bool("CAN-SKIP-DATERANGES"),b.partHoldBack=Ce.optionalFloat("PART-HOLD-BACK",0),b.holdBack=Ce.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Oe=new A.AttrList($);b.partTarget=Oe.decimalFloatingPoint("PART-TARGET");break}case"PART":{var Se=b.partList;Se||(Se=b.partList=[]);var Ue=w>0?Se[Se.length-1]:void 0,Be=w++,Te=new B.Part(new A.AttrList($),G,h,Be,Ue);Se.push(Te),G.duration+=Te.duration;break}case"PRELOAD-HINT":{var De=new A.AttrList($);b.preloadHint=De;break}case"RENDITION-REPORT":{var de=new A.AttrList($);b.renditionReports=b.renditionReports||[],b.renditionReports.push(de);break}default:f.logger.warn("line parsed but not handled: "+V);break}}}O&&!O.relurl?(S.pop(),P-=O.duration,b.partList&&(b.fragmentHint=O)):b.partList&&(g(G,O),G.cc=U,b.fragmentHint=G);var re=S.length,le=S[0],z=S[re-1];if(P+=b.skippedSegments*b.targetduration,P>0&&re&&z){b.averagetargetduration=P/re;var Q=z.sn;b.endSN=Q!=="initSegment"?Q:0,le&&(b.startCC=le.cc,le.initSegment||b.fragments.every(function(q){return q.relurl&&r(q.relurl)})&&(f.logger.warn("MP4 fragments found but no init segment (probably no MAP, incomplete M3U8), trying to fetch SIDX"),G=new B.Fragment(d,h),G.relurl=z.relurl,G.level=c,G.sn="initSegment",le.initSegment=G,b.needSidxRanges=!0))}else b.endSN=0,b.startCC=0;return b.fragmentHint&&(P+=b.fragmentHint.duration),b.totalduration=P,b.endCC=U,fe>0&&m(S,fe),b},E}();function t(E,_){["video","audio","text"].forEach(function(u){var h=E.filter(function(d){return Object(p.isCodecType)(d,u)});if(h.length){var c=h.filter(function(d){return d.lastIndexOf("avc1",0)===0||d.lastIndexOf("mp4a",0)===0});_[u+"Codec"]=c.length>0?c[0]:h[0],E=E.filter(function(d){return h.indexOf(d)===-1})}}),_.unknownCodecs=E}function y(E,_,u){var h=_[u];h&&(E[u]=h)}function m(E,_){for(var u=E[_],h=_;h--;){var c=E[h];if(!c)return;c.programDateTime=u.programDateTime-c.duration*1e3,u=c}}function g(E,_){E.rawProgramDateTime?E.programDateTime=Date.parse(E.rawProgramDateTime):_!=null&&_.programDateTime&&(E.programDateTime=_.endProgramDateTime),Object(j.isFiniteNumber)(E.programDateTime)||(E.programDateTime=null,E.rawProgramDateTime=null)}},"./src/loader/playlist-loader.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/events.ts"),R=C("./src/errors.ts"),B=C("./src/utils/logger.ts"),N=C("./src/utils/mp4-tools.ts"),e=C("./src/loader/m3u8-parser.ts"),A=C("./src/types/loader.ts"),f=C("./src/utils/attr-list.ts");function p(n){var l=n.type;switch(l){case A.PlaylistContextType.AUDIO_TRACK:return A.PlaylistLevelType.AUDIO;case A.PlaylistContextType.SUBTITLE_TRACK:return A.PlaylistLevelType.SUBTITLE;default:return A.PlaylistLevelType.MAIN}}function o(n,l){var s=n.url;return(s===void 0||s.indexOf("data:")===0)&&(s=l.url),s}var a=function(){function n(s){this.hls=void 0,this.loaders=Object.create(null),this.hls=s,this.registerListeners()}var l=n.prototype;return l.registerListeners=function(){var r=this.hls;r.on(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.on(L.Events.LEVEL_LOADING,this.onLevelLoading,this),r.on(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.on(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.unregisterListeners=function(){var r=this.hls;r.off(L.Events.MANIFEST_LOADING,this.onManifestLoading,this),r.off(L.Events.LEVEL_LOADING,this.onLevelLoading,this),r.off(L.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),r.off(L.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},l.createInternalLoader=function(r){var i=this.hls.config,t=i.pLoader,y=i.loader,m=t||y,g=new m(i);return r.loader=g,this.loaders[r.type]=g,g},l.getInternalLoader=function(r){return this.loaders[r.type]},l.resetInternalLoader=function(r){this.loaders[r]&&delete this.loaders[r]},l.destroyInternalLoaders=function(){for(var r in this.loaders){var i=this.loaders[r];i&&i.destroy(),this.resetInternalLoader(r)}},l.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},l.onManifestLoading=function(r,i){var t=i.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:A.PlaylistContextType.MANIFEST,url:t,deliveryDirectives:null})},l.onLevelLoading=function(r,i){var t=i.id,y=i.level,m=i.url,g=i.deliveryDirectives;this.load({id:t,groupId:null,level:y,responseType:"text",type:A.PlaylistContextType.LEVEL,url:m,deliveryDirectives:g})},l.onAudioTrackLoading=function(r,i){var t=i.id,y=i.groupId,m=i.url,g=i.deliveryDirectives;this.load({id:t,groupId:y,level:null,responseType:"text",type:A.PlaylistContextType.AUDIO_TRACK,url:m,deliveryDirectives:g})},l.onSubtitleTrackLoading=function(r,i){var t=i.id,y=i.groupId,m=i.url,g=i.deliveryDirectives;this.load({id:t,groupId:y,level:null,responseType:"text",type:A.PlaylistContextType.SUBTITLE_TRACK,url:m,deliveryDirectives:g})},l.load=function(r){var i,t=this.hls.config,y=this.getInternalLoader(r);if(y){var m=y.context;if(m&&m.url===r.url){B.logger.trace("[playlist-loader]: playlist request ongoing");return}B.logger.log("[playlist-loader]: aborting previous loader for type: "+r.type),y.abort()}var g,E,_,u;switch(r.type){case A.PlaylistContextType.MANIFEST:g=t.manifestLoadingMaxRetry,E=t.manifestLoadingTimeOut,_=t.manifestLoadingRetryDelay,u=t.manifestLoadingMaxRetryTimeout;break;case A.PlaylistContextType.LEVEL:case A.PlaylistContextType.AUDIO_TRACK:case A.PlaylistContextType.SUBTITLE_TRACK:g=0,E=t.levelLoadingTimeOut;break;default:g=t.levelLoadingMaxRetry,E=t.levelLoadingTimeOut,_=t.levelLoadingRetryDelay,u=t.levelLoadingMaxRetryTimeout;break}if(y=this.createInternalLoader(r),(i=r.deliveryDirectives)!==null&&i!==void 0&&i.part){var h;if(r.type===A.PlaylistContextType.LEVEL&&r.level!==null?h=this.hls.levels[r.level].details:r.type===A.PlaylistContextType.AUDIO_TRACK&&r.id!==null?h=this.hls.audioTracks[r.id].details:r.type===A.PlaylistContextType.SUBTITLE_TRACK&&r.id!==null&&(h=this.hls.subtitleTracks[r.id].details),h){var c=h.partTarget,d=h.targetduration;c&&d&&(E=Math.min(Math.max(c*3,d*.8)*1e3,E))}}var T={timeout:E,maxRetry:g,retryDelay:_,maxRetryDelay:u,highWaterMark:0},b={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};y.load(r,T,b)},l.loadsuccess=function(r,i,t,y){if(y===void 0&&(y=null),t.isSidxRequest){this.handleSidxRequest(r,t),this.handlePlaylistLoaded(r,i,t,y);return}this.resetInternalLoader(t.type);var m=r.data;if(m.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(r,t,"no EXTM3U delimiter",y);return}i.parsing.start=performance.now(),m.indexOf("#EXTINF:")>0||m.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(r,i,t,y):this.handleMasterPlaylist(r,i,t,y)},l.loaderror=function(r,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!1,r)},l.loadtimeout=function(r,i,t){t===void 0&&(t=null),this.handleNetworkError(i,t,!0)},l.handleMasterPlaylist=function(r,i,t,y){var m=this.hls,g=r.data,E=o(r,t),_=e.default.parseMasterPlaylist(g,E),u=_.levels,h=_.sessionData;if(!u.length){this.handleManifestParsingError(r,t,"no level found in manifest",y);return}var c=u.map(function(I){return{id:I.attrs.AUDIO,audioCodec:I.audioCodec}}),d=u.map(function(I){return{id:I.attrs.SUBTITLES,textCodec:I.textCodec}}),T=e.default.parseMasterPlaylistMedia(g,E,"AUDIO",c),b=e.default.parseMasterPlaylistMedia(g,E,"SUBTITLES",d),S=e.default.parseMasterPlaylistMedia(g,E,"CLOSED-CAPTIONS");if(T.length){var D=T.some(function(I){return!I.url});!D&&u[0].audioCodec&&!u[0].attrs.AUDIO&&(B.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),T.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new f.AttrList({}),bitrate:0,url:""}))}m.trigger(L.Events.MANIFEST_LOADED,{levels:u,audioTracks:T,subtitles:b,captions:S,url:E,stats:i,networkDetails:y,sessionData:h})},l.handleTrackOrLevelPlaylist=function(r,i,t,y){var m=this.hls,g=t.id,E=t.level,_=t.type,u=o(r,t),h=Object(j.isFiniteNumber)(g)?g:0,c=Object(j.isFiniteNumber)(E)?E:h,d=p(t),T=e.default.parseLevelPlaylist(r.data,u,c,d,h);if(!T.fragments.length){m.trigger(L.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.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(_===A.PlaylistContextType.MANIFEST){var b={attrs:new f.AttrList({}),bitrate:0,details:T,name:"",url:u};m.trigger(L.Events.MANIFEST_LOADED,{levels:[b],audioTracks:[],url:u,stats:i,networkDetails:y,sessionData:null})}if(i.parsing.end=performance.now(),T.needSidxRanges){var S,D=(S=T.fragments[0].initSegment)===null||S===void 0?void 0:S.url;this.load({url:D,isSidxRequest:!0,type:_,level:E,levelDetails:T,id:g,groupId:null,rangeStart:0,rangeEnd:2048,responseType:"arraybuffer",deliveryDirectives:null});return}t.levelDetails=T,this.handlePlaylistLoaded(r,i,t,y)},l.handleSidxRequest=function(r,i){var t=Object(N.parseSegmentIndex)(new Uint8Array(r.data));if(!t)return;var y=t.references,m=i.levelDetails;y.forEach(function(g,E){var _=g.info,u=m.fragments[E];u.byteRange.length===0&&u.setByteRange(String(1+_.end-_.start)+"@"+String(_.start)),u.initSegment&&u.initSegment.setByteRange(String(t.moovEndOffset)+"@0")})},l.handleManifestParsingError=function(r,i,t,y){this.hls.trigger(L.Events.ERROR,{type:R.ErrorTypes.NETWORK_ERROR,details:R.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:i.type===A.PlaylistContextType.MANIFEST,url:r.url,reason:t,response:r,context:i,networkDetails:y})},l.handleNetworkError=function(r,i,t,y){t===void 0&&(t=!1),B.logger.warn("[playlist-loader]: A network "+(t?"timeout":"error")+" occurred while loading "+r.type+" level: "+r.level+" id: "+r.id+' group-id: "'+r.groupId+'"');var m=R.ErrorDetails.UNKNOWN,g=!1,E=this.getInternalLoader(r);switch(r.type){case A.PlaylistContextType.MANIFEST:m=t?R.ErrorDetails.MANIFEST_LOAD_TIMEOUT:R.ErrorDetails.MANIFEST_LOAD_ERROR,g=!0;break;case A.PlaylistContextType.LEVEL:m=t?R.ErrorDetails.LEVEL_LOAD_TIMEOUT:R.ErrorDetails.LEVEL_LOAD_ERROR,g=!1;break;case A.PlaylistContextType.AUDIO_TRACK:m=t?R.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:R.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,g=!1;break;case A.PlaylistContextType.SUBTITLE_TRACK:m=t?R.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:R.ErrorDetails.SUBTITLE_LOAD_ERROR,g=!1;break}E&&this.resetInternalLoader(r.type);var _={type:R.ErrorTypes.NETWORK_ERROR,details:m,fatal:g,url:r.url,loader:E,context:r,networkDetails:i};y&&(_.response=y),this.hls.trigger(L.Events.ERROR,_)},l.handlePlaylistLoaded=function(r,i,t,y){var m=t.type,g=t.level,E=t.id,_=t.groupId,u=t.loader,h=t.levelDetails,c=t.deliveryDirectives;if(!(h!=null&&h.targetduration)){this.handleManifestParsingError(r,t,"invalid target duration",y);return}if(!u)return;h.live&&(u.getCacheAge&&(h.ageHeader=u.getCacheAge()||0),(!u.getCacheAge||isNaN(h.ageHeader))&&(h.ageHeader=0));switch(m){case A.PlaylistContextType.MANIFEST:case A.PlaylistContextType.LEVEL:this.hls.trigger(L.Events.LEVEL_LOADED,{details:h,level:g||0,id:E||0,stats:i,networkDetails:y,deliveryDirectives:c});break;case A.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(L.Events.AUDIO_TRACK_LOADED,{details:h,id:E||0,groupId:_||"",stats:i,networkDetails:y,deliveryDirectives:c});break;case A.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(L.Events.SUBTITLE_TRACK_LOADED,{details:h,id:E||0,groupId:_||"",stats:i,networkDetails:y,deliveryDirectives:c});break}},n}();H.default=a},"./src/polyfills/number.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isFiniteNumber",function(){return j}),C.d(H,"MAX_SAFE_INTEGER",function(){return L});var j=Number.isFinite||function(R){return typeof R=="number"&&isFinite(R)},L=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":function(te,H,C){"use strict";C.r(H);var j=function(){function L(){}return L.getSilentFrame=function(B,N){switch(B){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},L}();H.default=j},"./src/remux/mp4-generator.ts":function(te,H,C){"use strict";C.r(H);var j=Math.pow(2,32)-1,L=function(){function R(){}return R.init=function(){R.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 R.types)R.types.hasOwnProperty(N)&&(R.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]),A=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]);R.HDLR_TYPES={video:e,audio:A};var f=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),p=new Uint8Array([0,0,0,0,0,0,0,0]);R.STTS=R.STSC=R.STCO=p,R.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),R.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),R.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),R.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var o=new Uint8Array([105,115,111,109]),a=new Uint8Array([97,118,99,49]),n=new Uint8Array([0,0,0,1]);R.FTYP=R.box(R.types.ftyp,o,n,o,a),R.DINF=R.box(R.types.dinf,R.box(R.types.dref,f))},R.box=function(N){for(var e=8,A=arguments.length,f=new Array(A>1?A-1:0),p=1;p<A;p++)f[p-1]=arguments[p];for(var o=f.length,a=o;o--;)e+=f[o].byteLength;var n=new Uint8Array(e);for(n[0]=e>>24&255,n[1]=e>>16&255,n[2]=e>>8&255,n[3]=e&255,n.set(N,4),o=0,e=8;o<a;o++)n.set(f[o],e),e+=f[o].byteLength;return n},R.hdlr=function(N){return R.box(R.types.hdlr,R.HDLR_TYPES[N])},R.mdat=function(N){return R.box(R.types.mdat,N)},R.mdhd=function(N,e){e*=N;var A=Math.floor(e/(j+1)),f=Math.floor(e%(j+1));return R.box(R.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,A>>24,A>>16&255,A>>8&255,A&255,f>>24,f>>16&255,f>>8&255,f&255,85,196,0,0]))},R.mdia=function(N){return R.box(R.types.mdia,R.mdhd(N.timescale,N.duration),R.hdlr(N.type),R.minf(N))},R.mfhd=function(N){return R.box(R.types.mfhd,new Uint8Array([0,0,0,0,N>>24,N>>16&255,N>>8&255,N&255]))},R.minf=function(N){return N.type==="audio"?R.box(R.types.minf,R.box(R.types.smhd,R.SMHD),R.DINF,R.stbl(N)):R.box(R.types.minf,R.box(R.types.vmhd,R.VMHD),R.DINF,R.stbl(N))},R.moof=function(N,e,A){return R.box(R.types.moof,R.mfhd(N),R.traf(A,e))},R.moov=function(N){for(var e=N.length,A=[];e--;)A[e]=R.trak(N[e]);return R.box.apply(null,[R.types.moov,R.mvhd(N[0].timescale,N[0].duration)].concat(A).concat(R.mvex(N)))},R.mvex=function(N){for(var e=N.length,A=[];e--;)A[e]=R.trex(N[e]);return R.box.apply(null,[R.types.mvex].concat(A))},R.mvhd=function(N,e){e*=N;var A=Math.floor(e/(j+1)),f=Math.floor(e%(j+1)),p=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,A>>24,A>>16&255,A>>8&255,A&255,f>>24,f>>16&255,f>>8&255,f&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 R.box(R.types.mvhd,p)},R.sdtp=function(N){var e=N.samples||[],A=new Uint8Array(4+e.length),f,p;for(f=0;f<e.length;f++)p=e[f].flags,A[f+4]=p.dependsOn<<4|p.isDependedOn<<2|p.hasRedundancy;return R.box(R.types.sdtp,A)},R.stbl=function(N){return R.box(R.types.stbl,R.stsd(N),R.box(R.types.stts,R.STTS),R.box(R.types.stsc,R.STSC),R.box(R.types.stsz,R.STSZ),R.box(R.types.stco,R.STCO))},R.avc1=function(N){var e=[],A=[],f,p,o;for(f=0;f<N.sps.length;f++)p=N.sps[f],o=p.byteLength,e.push(o>>>8&255),e.push(o&255),e=e.concat(Array.prototype.slice.call(p));for(f=0;f<N.pps.length;f++)p=N.pps[f],o=p.byteLength,A.push(o>>>8&255),A.push(o&255),A=A.concat(Array.prototype.slice.call(p));var a=R.box(R.types.avcC,new Uint8Array([1,e[3],e[4],e[5],252|3,224|N.sps.length].concat(e).concat([N.pps.length]).concat(A))),n=N.width,l=N.height,s=N.pixelRatio[0],r=N.pixelRatio[1];return R.box(R.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,n>>8&255,n&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]),a,R.box(R.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),R.box(R.types.pasp,new Uint8Array([s>>24,s>>16&255,s>>8&255,s&255,r>>24,r>>16&255,r>>8&255,r&255])))},R.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]))},R.mp4a=function(N){var e=N.samplerate;return R.box(R.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]),R.box(R.types.esds,R.esds(N)))},R.mp3=function(N){var e=N.samplerate;return R.box(R.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]))},R.stsd=function(N){return N.type==="audio"?!N.isAAC&&N.codec==="mp3"?R.box(R.types.stsd,R.STSD,R.mp3(N)):R.box(R.types.stsd,R.STSD,R.mp4a(N)):R.box(R.types.stsd,R.STSD,R.avc1(N))},R.tkhd=function(N){var e=N.id,A=N.duration*N.timescale,f=N.width,p=N.height,o=Math.floor(A/(j+1)),a=Math.floor(A%(j+1));return R.box(R.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,a>>24,a>>16&255,a>>8&255,a&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,f>>8&255,f&255,0,0,p>>8&255,p&255,0,0]))},R.traf=function(N,e){var A=R.sdtp(N),f=N.id,p=Math.floor(e/(j+1)),o=Math.floor(e%(j+1));return R.box(R.types.traf,R.box(R.types.tfhd,new Uint8Array([0,0,0,0,f>>24,f>>16&255,f>>8&255,f&255])),R.box(R.types.tfdt,new Uint8Array([1,0,0,0,p>>24,p>>16&255,p>>8&255,p&255,o>>24,o>>16&255,o>>8&255,o&255])),R.trun(N,A.length+16+20+8+16+8+8),A)},R.trak=function(N){return N.duration=N.duration||4294967295,R.box(R.types.trak,R.tkhd(N),R.mdia(N))},R.trex=function(N){var e=N.id;return R.box(R.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]))},R.trun=function(N,e){var A=N.samples||[],f=A.length,p=12+16*f,o=new Uint8Array(p),a,n,l,s,r,i;for(e+=8+p,o.set([0,0,15,1,f>>>24&255,f>>>16&255,f>>>8&255,f&255,e>>>24&255,e>>>16&255,e>>>8&255,e&255],0),a=0;a<f;a++)n=A[a],l=n.duration,s=n.size,r=n.flags,i=n.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,r.isLeading<<2|r.dependsOn,r.isDependedOn<<6|r.hasRedundancy<<4|r.paddingValue<<1|r.isNonSync,r.degradPrio&240<<8,r.degradPrio&15,i>>>24&255,i>>>16&255,i>>>8&255,i&255],12+16*a);return R.box(R.types.trun,o)},R.initSegment=function(N){R.types||R.init();var e=R.moov(N),A=new Uint8Array(R.FTYP.byteLength+e.byteLength);return A.set(R.FTYP),A.set(e,R.FTYP.byteLength),A},R}();L.types=void 0,L.HDLR_TYPES=void 0,L.STTS=void 0,L.STSC=void 0,L.STCO=void 0,L.STSZ=void 0,L.VMHD=void 0,L.SMHD=void 0,L.STSD=void 0,L.FTYP=void 0,L.DINF=void 0,H.default=L},"./src/remux/mp4-remuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return i}),C.d(H,"normalizePts",function(){return t});var j=C("./src/polyfills/number.ts"),L=C("./src/remux/aac-helper.ts"),R=C("./src/remux/mp4-generator.ts"),B=C("./src/events.ts"),N=C("./src/errors.ts"),e=C("./src/utils/logger.ts"),A=C("./src/types/loader.ts"),f=C("./src/utils/timescale-conversion.ts");function p(){return p=Object.assign||function(E){for(var _=1;_<arguments.length;_++){var u=arguments[_];for(var h in u)Object.prototype.hasOwnProperty.call(u,h)&&(E[h]=u[h])}return E},p.apply(this,arguments)}var o=10*1e3,a=1024,n=1152,l=null,s=null,r=!1,i=function(){function E(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 T=navigator.userAgent||"",b=T.match(/Chrome\/(\d+)/i);l=b?parseInt(b[1]):0}if(s===null){var S=navigator.userAgent.match(/Safari\/(\d+)/i);s=S?parseInt(S[1]):0}r=!!l&&l<75||!!s&&s<600}var _=E.prototype;return _.destroy=function(){},_.resetTimeStamp=function(h){e.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=h},_.resetNextTimestamp=function(){e.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},_.resetInitSegment=function(){e.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},_.getVideoStartPts=function(h){var c=!1,d=h.reduce(function(T,b){var S=b.pts-T;return S<-4294967296?(c=!0,t(T,b.pts)):S>0?T:b.pts},h[0].pts);return c&&e.logger.debug("PTS rollover detected"),d},_.remux=function(h,c,d,T,b,S,D,I){var w,P,U,O,G,V,ae=b,ie=b,fe=h.pid>-1,ce=c.pid>-1,J=c.samples.length,Z=h.samples.length>0,he=J>1,X=(!fe||Z)&&(!ce||he)||this.ISGenerated||D;if(X){this.ISGenerated||(U=this.generateIS(h,c,b));var $=this.isVideoContiguous,ye=-1;if(he&&(ye=y(c.samples),!$&&this.config.forceKeyFrameOnDiscontinuity))if(V=!0,ye>0){e.logger.warn("[mp4-remuxer]: Dropped "+ye+" out of "+J+" video samples due to a missing keyframe");var Le=this.getVideoStartPts(c.samples);c.samples=c.samples.slice(ye),c.dropped+=ye,ie+=(c.samples[0].pts-Le)/(c.timescale||9e4)}else ye===-1&&(e.logger.warn("[mp4-remuxer]: No keyframe found out of "+J+" video samples"),V=!1);if(this.ISGenerated){if(Z&&he){var Re=this.getVideoStartPts(c.samples),Ie=t(h.samples[0].pts,Re)-Re,Ne=Ie/c.inputTimeScale;ae+=Math.max(0,Ne),ie+=Math.max(0,-Ne)}if(Z){if(h.samplerate||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),U=this.generateIS(h,c,b)),P=this.remuxAudio(h,ae,this.isAudioContiguous,S,ce||he||I===A.PlaylistLevelType.AUDIO?ie:void 0),he){var _e=P?P.endPTS-P.startPTS:0;c.inputTimeScale||(e.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),U=this.generateIS(h,c,b)),w=this.remuxVideo(c,ie,$,_e)}}else he&&(w=this.remuxVideo(c,ie,$,0));w&&(w.firstKeyFrame=ye,w.independent=ye!==-1)}}return this.ISGenerated&&(d.samples.length&&(G=this.remuxID3(d,b)),T.samples.length&&(O=this.remuxText(T,b))),{audio:P,video:w,initSegment:U,independent:V,text:O,id3:G}},_.generateIS=function(h,c,d){var T=h.samples,b=c.samples,S=this.typeSupported,D={},I=!Object(j.isFiniteNumber)(this._initPTS),w="audio/mp4",P,U,O;if(I&&(P=U=Infinity),h.config&&T.length&&(h.timescale=h.samplerate,h.isAAC||(S.mpeg?(w="audio/mpeg",h.codec=""):S.mp3&&(h.codec="mp3")),D.audio={id:"audio",container:w,codec:h.codec,initSegment:!h.isAAC&&S.mpeg?new Uint8Array(0):R.default.initSegment([h]),metadata:{channelCount:h.channelCount}},I&&(O=h.inputTimeScale,P=U=T[0].pts-Math.round(O*d))),c.sps&&c.pps&&b.length&&(c.timescale=c.inputTimeScale,D.video={id:"main",container:"video/mp4",codec:c.codec,initSegment:R.default.initSegment([c]),metadata:{width:c.width,height:c.height}},I)){O=c.inputTimeScale;var G=this.getVideoStartPts(b),V=Math.round(O*d);U=Math.min(U,t(b[0].dts,G)-V),P=Math.min(P,G-V)}if(Object.keys(D).length)return this.ISGenerated=!0,I&&(this._initPTS=P,this._initDTS=U),{tracks:D,initPTS:P,timescale:O}},_.remuxVideo=function(h,c,d,T){var b=h.inputTimeScale,S=h.samples,D=[],I=S.length,w=this._initPTS,P=this.nextAvcDts,U=8,O,G,V,ae=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,fe=0,ce=!1;if(!d||P===null){var J=c*b,Z=S[0].pts-t(S[0].dts,S[0].pts);P=J-Z}for(var he=0;he<I;he++){var X=S[he];if(X.pts=t(X.pts-w,P),X.dts=t(X.dts-w,P),X.dts>X.pts){var $=9e4*.2;fe=Math.max(Math.min(fe,X.pts-X.dts),-1*$)}X.dts<S[he>0?he-1:he].dts&&(ce=!0)}ce&&S.sort(function(qe,nt){var $e=qe.dts-nt.dts,gt=qe.pts-nt.pts;return $e||gt}),G=S[0].dts,V=S[S.length-1].dts;var ye=Math.round((V-G)/(I-1));if(fe<0){if(fe<ye*-2){e.logger.warn("PTS < DTS detected in video samples, offsetting DTS from PTS by "+Object(f.toMsFromMpegTsClock)(-ye,!0)+" ms");for(var Le=fe,Re=0;Re<I;Re++)S[Re].dts=Le=Math.max(Le,S[Re].pts-ye),S[Re].pts=Math.max(Le,S[Re].pts)}else{e.logger.warn("PTS < DTS detected in video samples, shifting DTS by "+Object(f.toMsFromMpegTsClock)(fe,!0)+" ms to overcome this issue");for(var Ie=0;Ie<I;Ie++)S[Ie].dts=S[Ie].dts+fe}G=S[0].dts}if(d){var Ne=G-P,_e=Ne>ye,Ee=Ne<-1;if(_e||Ee){_e?e.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(Ne,!0)+" ms ("+Ne+"dts) hole between fragments detected, filling it"):e.logger.warn("AVC: "+Object(f.toMsFromMpegTsClock)(-Ne,!0)+" ms ("+Ne+"dts) overlapping between fragments detected"),G=P;var Ae=S[0].pts-Ne;S[0].dts=G,S[0].pts=Ae,e.logger.log("Video: First PTS/DTS adjusted: "+Object(f.toMsFromMpegTsClock)(Ae,!0)+"/"+Object(f.toMsFromMpegTsClock)(G,!0)+", delta: "+Object(f.toMsFromMpegTsClock)(Ne,!0)+" ms")}}r&&(G=Math.max(0,G));for(var Y=0,se=0,pe=0;pe<I;pe++){for(var ge=S[pe],ke=ge.units,oe=ke.length,me=0,be=0;be<oe;be++)me+=ke[be].data.length;se+=me,Y+=oe,ge.length=me,ge.dts=Math.max(ge.dts,G),ge.pts=Math.max(ge.pts,ge.dts,0),ae=Math.min(ge.pts,ae),ie=Math.max(ge.pts,ie)}V=S[I-1].dts;var xe=se+4*Y+8,Ce;try{Ce=new Uint8Array(xe)}catch(qe){this.observer.emit(B.Events.ERROR,B.Events.ERROR,{type:N.ErrorTypes.MUX_ERROR,details:N.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:xe,reason:"fail allocating video mdat "+xe});return}var Oe=new DataView(Ce.buffer);Oe.setUint32(0,xe),Ce.set(R.default.types.mdat,4);for(var Se=0;Se<I;Se++){for(var Ue=S[Se],Be=Ue.units,Te=0,De=0,de=Be.length;De<de;De++){var re=Be[De],le=re.data,z=re.data.byteLength;Oe.setUint32(U,z),U+=4,Ce.set(le,U),U+=z,Te+=4+z}if(Se<I-1)O=S[Se+1].dts-Ue.dts;else{var Q=this.config,q=Ue.dts-S[Se>0?Se-1:Se].dts;if(Q.stretchShortVideoTrack&&this.nextAudioPts!==null){var ee=Math.floor(Q.maxBufferHole*b),ve=(T?ae+T*b:this.nextAudioPts)-Ue.pts;ve>ee?(O=ve-q,O<0&&(O=q),e.logger.log("[mp4-remuxer]: It is approximately "+ve/90+" ms to the next segment; using duration "+O/90+" ms for the last video frame.")):O=q}else O=q}var we=Math.round(Ue.pts-Ue.dts);D.push(new m(Ue.key,O,Te,we))}if(D.length&&l&&l<70){var Fe=D[0].flags;Fe.dependsOn=2,Fe.isNonSync=0}console.assert(O!==void 0,"mp4SampleDuration must be computed"),this.nextAvcDts=P=V+O,this.isVideoContiguous=!0;var Ge=R.default.moof(h.sequenceNumber++,G,p({},h,{samples:D})),Je="video",ze={data1:Ge,data2:Ce,startPTS:ae/b,endPTS:(ie+O)/b,startDTS:G/b,endDTS:P/b,type:Je,hasAudio:!1,hasVideo:!0,nb:D.length,dropped:h.dropped};return h.samples=[],h.dropped=0,console.assert(Ce.length,"MDAT length must not be zero"),ze},_.remuxAudio=function(h,c,d,T,b){var S=h.inputTimeScale,D=h.samplerate?h.samplerate:S,I=S/D,w=h.isAAC?a:n,P=w*I,U=this._initPTS,O=!h.isAAC&&this.typeSupported.mpeg,G=[],V=h.samples,ae=O?0:8,ie=this.nextAudioPts||-1,fe=c*S;if(this.isAudioContiguous=d=d||V.length&&ie>0&&(T&&Math.abs(fe-ie)<9e3||Math.abs(t(V[0].pts-U,fe)-ie)<20*P),V.forEach(function(le){le.pts=t(le.pts-U,fe)}),!d||ie<0){if(V=V.filter(function(le){return le.pts>=0}),!V.length)return;b===0?ie=0:T?ie=Math.max(0,fe):ie=V[0].pts}if(h.isAAC)for(var ce=b!==void 0,J=this.config.maxAudioFramesDrift,Z=0,he=ie;Z<V.length;Z++){var X=V[Z],$=X.pts,ye=$-he,Le=Math.abs(1e3*ye/S);if(ye<=-J*P&&ce)Z===0&&(e.logger.warn("Audio frame @ "+($/S).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ye/S)+" ms."),this.nextAudioPts=ie=he=$);else if(ye>=J*P&&Le<o&&ce){var Re=Math.round(ye/P);he=$-Re*P,he<0&&(Re--,he+=P),Z===0&&(this.nextAudioPts=ie=he),e.logger.warn("[mp4-remuxer]: Injecting "+Re+" audio frame @ "+(he/S).toFixed(3)+"s due to "+Math.round(1e3*ye/S)+" ms gap.");for(var Ie=0;Ie<Re;Ie++){var Ne=Math.max(he,0),_e=L.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);_e||(e.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),_e=X.unit.subarray()),V.splice(Z,0,{unit:_e,pts:Ne}),he+=P,Z++}}X.pts=he,he+=P}for(var Ee=null,Ae=null,Y,se=0,pe=V.length;pe--;)se+=V[pe].unit.byteLength;for(var ge=0,ke=V.length;ge<ke;ge++){var oe=V[ge],me=oe.unit,be=oe.pts;if(Ae!==null){var xe=G[ge-1];xe.duration=Math.round((be-Ae)/I)}else if(d&&h.isAAC&&(be=ie),Ee=be,se>0){se+=ae;try{Y=new Uint8Array(se)}catch(le){this.observer.emit(B.Events.ERROR,B.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(!O){var Ce=new DataView(Y.buffer);Ce.setUint32(0,se),Y.set(R.default.types.mdat,4)}}else return;Y.set(me,ae);var Oe=me.byteLength;ae+=Oe,G.push(new m(!0,w,Oe,0)),Ae=be}var Se=G.length;if(!Se)return;var Ue=G[G.length-1];this.nextAudioPts=ie=Ae+I*Ue.duration;var Be=O?new Uint8Array(0):R.default.moof(h.sequenceNumber++,Ee/I,p({},h,{samples:G}));h.samples=[];var Te=Ee/S,De=ie/S,de="audio",re={data1:Be,data2:Y,startPTS:Te,endPTS:De,startDTS:Te,endDTS:De,type:de,hasAudio:!0,hasVideo:!1,nb:Se};return this.isAudioContiguous=!0,console.assert(Y.length,"MDAT length must not be zero"),re},_.remuxEmptyAudio=function(h,c,d,T){var b=h.inputTimeScale,S=h.samplerate?h.samplerate:b,D=b/S,I=this.nextAudioPts,w=(I!==null?I:T.startDTS*b)+this._initDTS,P=T.endDTS*b+this._initDTS,U=D*a,O=Math.ceil((P-w)/U),G=L.default.getSilentFrame(h.manifestCodec||h.codec,h.channelCount);if(e.logger.warn("[mp4-remuxer]: remux empty Audio"),!G){e.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var V=[],ae=0;ae<O;ae++){var ie=w+ae*U;V.push({unit:G,pts:ie,dts:ie})}return h.samples=V,this.remuxAudio(h,c,d,!1)},_.remuxID3=function(h,c){var d=h.samples.length;if(!d)return;for(var T=h.inputTimeScale,b=this._initPTS,S=this._initDTS,D=0;D<d;D++){var I=h.samples[D];I.pts=t(I.pts-b,c*T)/T,I.dts=t(I.dts-S,c*T)/T}var w=h.samples;return h.samples=[],{samples:w}},_.remuxText=function(h,c){var d=h.samples.length;if(!d)return;for(var T=h.inputTimeScale,b=this._initPTS,S=0;S<d;S++){var D=h.samples[S];D.pts=t(D.pts-b,c*T)/T}h.samples.sort(function(w,P){return w.pts-P.pts});var I=h.samples;return h.samples=[],{samples:I}},E}();function t(E,_){var u;if(_===null)return E;for(_<E?u=-8589934592:u=8589934592;Math.abs(E-_)>4294967296;)E+=u;return E}function y(E){for(var _=0;_<E.length;_++)if(E[_].key)return _;return-1}var m=function(_,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 g(_)},g=function(_){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=_?2:1,this.isNonSync=_?0:1}},"./src/remux/passthrough-remuxer.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/polyfills/number.ts"),L=C("./src/utils/mp4-tools.ts"),R=C("./src/loader/fragment.ts"),B=C("./src/utils/logger.ts"),N=function(){function f(){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 p=f.prototype;return p.destroy=function(){},p.resetTimeStamp=function(a){this.initPTS=a,this.lastEndDTS=null},p.resetNextTimestamp=function(){this.lastEndDTS=null},p.resetInitSegment=function(a,n,l){this.audioCodec=n,this.videoCodec=l,this.generateInitSegment(a),this.emitInitSegment=!0},p.generateInitSegment=function(a){var n=this.audioCodec,l=this.videoCodec;if(!a||!a.byteLength){this.initTracks=void 0,this.initData=void 0;return}var s=this.initData=Object(L.parseInitSegment)(a);n||(n=A(s.audio,R.ElementaryStreamTypes.AUDIO)),l||(l=A(s.video,R.ElementaryStreamTypes.VIDEO));var r={};s.audio&&s.video?r.audiovideo={container:"video/mp4",codec:n+","+l,initSegment:a,id:"main"}:s.audio?r.audio={container:"audio/mp4",codec:n,initSegment:a,id:"audio"}:s.video?r.video={container:"video/mp4",codec:l,initSegment:a,id:"main"}:B.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=r},p.remux=function(a,n,l,s,r){var i=this.initPTS,t=this.lastEndDTS,y={audio:void 0,video:void 0,text:s,id3:l,initSegment:void 0};Object(j.isFiniteNumber)(t)||(t=this.lastEndDTS=r||0);var m=n.samples;if(!m||!m.length)return y;var g={initPTS:void 0,timescale:1},E=this.initData;if((!E||!E.length)&&(this.generateInitSegment(m),E=this.initData),!E||!E.length)return B.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),y;this.emitInitSegment&&(g.tracks=this.initTracks,this.emitInitSegment=!1),Object(j.isFiniteNumber)(i)||(this.initPTS=g.initPTS=i=e(E,m,t));var _=Object(L.getDuration)(m,E),u=t,h=_+u;Object(L.offsetStartDTS)(E,m,i),_>0?this.lastEndDTS=h:(B.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var c=!!E.audio,d=!!E.video,T="";c&&(T+="audio"),d&&(T+="video");var b={data1:m,startPTS:u,startDTS:u,endPTS:h,endDTS:h,type:T,hasAudio:c,hasVideo:d,nb:1,dropped:0};return y.audio=b.type==="audio"?b:void 0,y.video=b.type!=="audio"?b:void 0,y.text=s,y.id3=l,y.initSegment=g,y},f}(),e=function(p,o,a){return Object(L.getStartDTS)(p,o)-a};function A(f,p){var o=f==null?void 0:f.codec;return o&&o.length>4?o:o==="hvc1"?"hvc1.1.c.L120.90":o==="av01"?"av01.0.04M.08":o==="avc1"||p===R.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}H.default=N},"./src/task-loop.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var R=L.prototype;return R.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},R.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},R.onHandlerDestroyed=function(){},R.hasInterval=function(){return!!this._tickInterval},R.hasNextTick=function(){return!!this._tickTimer},R.setInterval=function(N){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,N),!0)},R.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},R.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},R.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},R.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},R.doTick=function(){},L}()},"./src/types/cmcd.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"CMCDVersion",function(){return j}),C.d(H,"CMCDObjectType",function(){return L}),C.d(H,"CMCDStreamingFormat",function(){return R}),C.d(H,"CMCDStreamType",function(){return B});var j=1,L;(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"})(L||(L={}));var R;(function(N){N.DASH="d",N.HLS="h",N.SMOOTH="s",N.OTHER="o"})(R||(R={}));var B;(function(N){N.VOD="v",N.LIVE="l"})(B||(B={}))},"./src/types/level.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"HlsSkip",function(){return R}),C.d(H,"getSkipValue",function(){return B}),C.d(H,"HlsUrlParameters",function(){return N}),C.d(H,"Level",function(){return e});function j(A,f){for(var p=0;p<f.length;p++){var o=f[p];o.enumerable=o.enumerable||!1,o.configurable=!0,"value"in o&&(o.writable=!0),Object.defineProperty(A,o.key,o)}}function L(A,f,p){return f&&j(A.prototype,f),p&&j(A,p),A}var R;(function(A){A.No="",A.Yes="YES",A.v2="v2"})(R||(R={}));function B(A,f){var p=A.canSkipUntil,o=A.canSkipDateRanges,a=A.endSN,n=f!==void 0?f-a:0;return p&&n<p?o?R.v2:R.Yes:R.No}var N=function(){function A(p,o,a){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=p,this.part=o,this.skip=a}var f=A.prototype;return f.addDirectives=function(o){var a=new self.URL(o);return this.msn!==void 0&&a.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&a.searchParams.set("_HLS_part",this.part.toString()),this.skip&&a.searchParams.set("_HLS_skip",this.skip),a.toString()},A}(),e=function(){function A(f){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=[f.url],this.attrs=f.attrs,this.bitrate=f.bitrate,f.details&&(this.details=f.details),this.id=f.id||0,this.name=f.name,this.width=f.width||0,this.height=f.height||0,this.audioCodec=f.audioCodec,this.videoCodec=f.videoCodec,this.unknownCodecs=f.unknownCodecs,this.codecSet=[f.videoCodec,f.audioCodec].filter(function(p){return p}).join(",").replace(/\.[^.,]+/g,"")}return L(A,[{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(p){var o=p%this.url.length;this._urlId!==o&&(this.details=void 0,this._urlId=o)}}]),A}()},"./src/types/loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"PlaylistContextType",function(){return j}),C.d(H,"PlaylistLevelType",function(){return L});var j;(function(R){R.MANIFEST="manifest",R.LEVEL="level",R.AUDIO_TRACK="audioTrack",R.SUBTITLE_TRACK="subtitleTrack"})(j||(j={}));var L;(function(R){R.MAIN="main",R.AUDIO="audio",R.SUBTITLE="subtitle"})(L||(L={}))},"./src/types/transmuxer.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"ChunkMetadata",function(){return j});var j=function(B,N,e,A,f,p){A===void 0&&(A=0),f===void 0&&(f=-1),p===void 0&&(p=!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=L(),this.buffering={audio:L(),video:L(),audiovideo:L()},this.level=B,this.sn=N,this.id=e,this.size=A,this.part=f,this.partial=p};function L(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"AttrList",function(){return R});var j=/^(\d+)x(\d+)$/,L=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,R=function(){function B(e){typeof e=="string"&&(e=B.parseAttrList(e));for(var A in e)e.hasOwnProperty(A)&&(this[A]=e[A])}var N=B.prototype;return N.decimalInteger=function(A){var f=parseInt(this[A],10);return f>Number.MAX_SAFE_INTEGER?Infinity:f},N.hexadecimalInteger=function(A){if(this[A]){var f=(this[A]||"0x").slice(2);f=(f.length&1?"0":"")+f;for(var p=new Uint8Array(f.length/2),o=0;o<f.length/2;o++)p[o]=parseInt(f.slice(o*2,o*2+2),16);return p}else return null},N.hexadecimalIntegerAsNumber=function(A){var f=parseInt(this[A],16);return f>Number.MAX_SAFE_INTEGER?Infinity:f},N.decimalFloatingPoint=function(A){return parseFloat(this[A])},N.optionalFloat=function(A,f){var p=this[A];return p?parseFloat(p):f},N.enumeratedString=function(A){return this[A]},N.bool=function(A){return this[A]==="YES"},N.decimalResolution=function(A){var f=j.exec(this[A]);return f===null?void 0:{width:parseInt(f[1],10),height:parseInt(f[2],10)}},B.parseAttrList=function(A){var f,p={},o='"';for(L.lastIndex=0;(f=L.exec(A))!==null;){var a=f[2];a.indexOf(o)===0&&a.lastIndexOf(o)===a.length-1&&(a=a.slice(1,-1)),p[f[1]]=a}return p},B}()},"./src/utils/binary-search.ts":function(te,H,C){"use strict";C.r(H);var j={search:function(R,B){for(var N=0,e=R.length-1,A=null,f=null;N<=e;){A=(N+e)/2|0,f=R[A];var p=B(f);if(p>0)N=A+1;else if(p<0)e=A-1;else return f}return null}};H.default=j},"./src/utils/buffer-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"BufferHelper",function(){return R});var j=C("./src/utils/logger.ts"),L={length:0,start:function(){return 0},end:function(){return 0}},R=function(){function B(){}return B.isBuffered=function(e,A){try{if(e){for(var f=B.getBuffered(e),p=0;p<f.length;p++)if(A>=f.start(p)&&A<=f.end(p))return!0}}catch(o){}return!1},B.bufferInfo=function(e,A,f){try{if(e){var p=B.getBuffered(e),o=[],a;for(a=0;a<p.length;a++)o.push({start:p.start(a),end:p.end(a)});return this.bufferedInfo(o,A,f)}}catch(n){}return{len:0,start:A,end:A,nextStart:void 0}},B.bufferedInfo=function(e,A,f){A=Math.max(0,A),e.sort(function(g,E){var _=g.start-E.start;return _||E.end-g.end});var p=[];if(f)for(var o=0;o<e.length;o++){var a=p.length;if(a){var n=p[a-1].end;e[o].start-n<f?e[o].end>n&&(p[a-1].end=e[o].end):p.push(e[o])}else p.push(e[o])}else p=e;for(var l=0,s,r=A,i=A,t=0;t<p.length;t++){var y=p[t].start,m=p[t].end;if(A+f>=y&&A<m)r=y,i=m,l=i-A;else if(A+f<y){s=y;break}}return{len:l,start:r||0,end:i||0,nextStart:s}},B.getBuffered=function(e){try{return e.buffered}catch(A){return j.logger.log("failed to get media.buffered",A),L}},B}()},"./src/utils/cea-608-parser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"Row",function(){return i}),C.d(H,"CaptionScreen",function(){return t});var j=C("./src/utils/logger.ts"),L={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},R=function(h){var c=h;return L.hasOwnProperty(h)&&(c=L[h]),String.fromCharCode(c)},B=15,N=100,e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},A={17:2,18:4,21:6,22:8,23:10,19:13,20:15},f={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},p={25:2,26:4,29:6,30:8,31:10,27:13,28:15},o=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(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"})(a||(a={}));var n=function(){function u(){this.time=null,this.verboseLevel=a.ERROR}var h=u.prototype;return h.log=function(d,T){this.verboseLevel>=d&&j.logger.log(this.time+" ["+d+"] "+T)},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,T,b,S){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=T||!1,this.background=b||"black",this.flash=S||!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 T=["foreground","underline","italics","background","flash"],b=0;b<T.length;b++){var S=T[b];d.hasOwnProperty(S)&&(this[S]=d[S])}},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}(),r=function(){function u(c,d,T,b,S,D){this.uchar=void 0,this.penState=void 0,this.uchar=c||" ",this.penState=new s(d,T,b,S,D)}var h=u.prototype;return h.reset=function(){this.uchar=" ",this.penState.reset()},h.setChar=function(d,T){this.uchar=d,this.penState.copy(T)},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}(),i=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 r);this.logger=c,this.pos=0,this.currPenState=new s}var h=u.prototype;return h.equals=function(d){for(var T=!0,b=0;b<N;b++)if(!this.chars[b].equals(d.chars[b])){T=!1;break}return T},h.copy=function(d){for(var T=0;T<N;T++)this.chars[T].copy(d.chars[T])},h.isEmpty=function(){for(var d=!0,T=0;T<N;T++)if(!this.chars[T].isEmpty()){d=!1;break}return d},h.setCursor=function(d){this.pos!==d&&(this.pos=d),this.pos<0?(this.logger.log(a.DEBUG,"Negative cursor position "+this.pos),this.pos=0):this.pos>N&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=N)},h.moveCursor=function(d){var T=this.pos+d;if(d>1)for(var b=this.pos+1;b<T+1;b++)this.chars[b].setPenState(this.currPenState);this.setCursor(T)},h.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},h.insertChar=function(d){d>=144&&this.backSpace();var T=R(d);if(this.pos>=N){this.logger.log(a.ERROR,"Cannot insert "+d.toString(16)+" ("+T+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(T,this.currPenState),this.moveCursor(1)},h.clearFromPos=function(d){var T;for(T=d;T<N;T++)this.chars[T].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=[],T=!0,b=0;b<N;b++){var S=this.chars[b].uchar;S!==" "&&(T=!1),d.push(S)}return T?"":d.join("")},h.setPenStyles=function(d){this.currPenState.setStyles(d);var T=this.chars[this.pos];T.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<B;d++)this.rows.push(new i(c));this.logger=c,this.currRow=B-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var h=u.prototype;return h.reset=function(){for(var d=0;d<B;d++)this.rows[d].clear();this.currRow=B-1},h.equals=function(d){for(var T=!0,b=0;b<B;b++)if(!this.rows[b].equals(d.rows[b])){T=!1;break}return T},h.copy=function(d){for(var T=0;T<B;T++)this.rows[T].copy(d.rows[T])},h.isEmpty=function(){for(var d=!0,T=0;T<B;T++)if(!this.rows[T].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 T=this.rows[this.currRow];T.insertChar(d)},h.setPen=function(d){var T=this.rows[this.currRow];T.setPenStyles(d)},h.moveCursor=function(d){var T=this.rows[this.currRow];T.moveCursor(d)},h.setCursor=function(d){this.logger.log(a.INFO,"setCursor: "+d);var T=this.rows[this.currRow];T.setCursor(d)},h.setPAC=function(d){this.logger.log(a.INFO,"pacData = "+JSON.stringify(d));var T=d.row-1;if(this.nrRollUpRows&&T<this.nrRollUpRows-1&&(T=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==T){for(var b=0;b<B;b++)this.rows[b].clear();var S=this.currRow+1-this.nrRollUpRows,D=this.lastOutputScreen;if(D){var I=D.rows[S].cueStartTime,w=this.logger.time;if(I&&w!==null&&I<w)for(var P=0;P<this.nrRollUpRows;P++)this.rows[T-this.nrRollUpRows+P+1].copy(D.rows[S+P])}}this.currRow=T;var U=this.rows[this.currRow];if(d.indent!==null){var O=d.indent,G=Math.max(O-1,0);U.setCursor(d.indent),d.color=U.chars[G].penState.foreground}var V={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(V)},h.setBkgData=function(d){this.logger.log(a.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(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,this.getDisplayText());var d=this.currRow+1-this.nrRollUpRows,T=this.rows.splice(d,1)[0];T.clear(),this.rows.splice(this.currRow,0,T),this.logger.log(a.INFO,"Rolling up")},h.getDisplayText=function(d){d=d||!1;for(var T=[],b="",S=-1,D=0;D<B;D++){var I=this.rows[D].getTextString();I&&(S=D+1,d?T.push("Row "+S+": '"+I+"'"):T.push(I.trim()))}return T.length>0&&(d?b="["+T.join(" | ")+"]":b=T.join(`
|
|
`)),b},h.getTextAndFormat=function(){return this.rows},u}(),y=function(){function u(c,d,T){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(T),this.nonDisplayedMemory=new t(T),this.lastOutputScreen=new t(T),this.currRollUpRow=this.displayedMemory.rows[B-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=T}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[B-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(a.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 T=0;T<d.length;T++)this.writeScreen.insertChar(d[T]);var b=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,b+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())},h.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},h.ccBS=function(){if(this.logger.log(a.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(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},h.ccRU=function(d){this.logger.log(a.INFO,"RU("+d+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(d)},h.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},h.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},h.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},h.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},h.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},h.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},h.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},h.ccEOC=function(){if(this.logger.log(a.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(a.TEXT,"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)},h.ccTO=function(d){this.logger.log(a.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},h.ccMIDROW=function(d){var T={flash:!1};if(T.underline=d%2===1,T.italics=d>=46,T.italics)T.foreground="white";else{var b=Math.floor(d/2)-16,S=["white","green","blue","cyan","red","yellow","magenta"];T.foreground=S[b]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(T)),this.writeScreen.setPen(T)},h.outputDataUpdate=function(d){d===void 0&&(d=!1);var T=this.logger.time;if(T===null)return;this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=T:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,T,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:T),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,T){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var b=new n;this.channels=[null,new y(c,d,b),new y(c+1,T,b)],this.cmdHistory=_(),this.logger=b}var h=u.prototype;return h.getHandler=function(d){return this.channels[d].getHandler()},h.setHandler=function(d,T){this.channels[d].setHandler(T)},h.addData=function(d,T){var b,S,D,I=!1;this.logger.time=d;for(var w=0;w<T.length;w+=2){if(S=T[w]&127,D=T[w+1]&127,S===0&&D===0)continue;if(this.logger.log(a.DATA,"["+l([T[w],T[w+1]])+"] -> ("+l([S,D])+")"),b=this.parseCmd(S,D),b||(b=this.parseMidrow(S,D)),b||(b=this.parsePAC(S,D)),b||(b=this.parseBackgroundAttributes(S,D)),!b&&(I=this.parseChars(S,D),I)){var P=this.currentChannel;if(P&&P>0){var U=this.channels[P];U.insertChars(I)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!b&&!I&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+l([S,D])+" orig: "+l([T[w],T[w+1]]))}},h.parseCmd=function(d,T){var b=this.cmdHistory,S=(d===20||d===28||d===21||d===29)&&T>=32&&T<=47,D=(d===23||d===31)&&T>=33&&T<=35;if(!(S||D))return!1;if(E(d,T,b))return g(null,null,b),this.logger.log(a.DEBUG,"Repeated command ("+l([d,T])+") is dropped"),!0;var I=d===20||d===21||d===23?1:2,w=this.channels[I];return d===20||d===21||d===28||d===29?T===32?w.ccRCL():T===33?w.ccBS():T===34?w.ccAOF():T===35?w.ccAON():T===36?w.ccDER():T===37?w.ccRU(2):T===38?w.ccRU(3):T===39?w.ccRU(4):T===40?w.ccFON():T===41?w.ccRDC():T===42?w.ccTR():T===43?w.ccRTD():T===44?w.ccEDM():T===45?w.ccCR():T===46?w.ccENM():T===47&&w.ccEOC():w.ccTO(T-32),g(d,T,b),this.currentChannel=I,!0},h.parseMidrow=function(d,T){var b=0;if((d===17||d===25)&&T>=32&&T<=47){if(d===17?b=1:b=2,b!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var S=this.channels[b];return S?(S.ccMIDROW(T),this.logger.log(a.DEBUG,"MIDROW ("+l([d,T])+")"),!0):!1}return!1},h.parsePAC=function(d,T){var b,S=this.cmdHistory,D=(d>=17&&d<=23||d>=25&&d<=31)&&T>=64&&T<=127,I=(d===16||d===24)&&T>=64&&T<=95;if(!(D||I))return!1;if(E(d,T,S))return g(null,null,S),!0;var w=d<=23?1:2;T>=64&&T<=95?b=w===1?e[d]:f[d]:b=w===1?A[d]:p[d];var P=this.channels[w];return P?(P.setPAC(this.interpretPAC(b,T)),g(d,T,S),this.currentChannel=w,!0):!1},h.interpretPAC=function(d,T){var b,S={color:null,italics:!1,indent:null,underline:!1,row:d};return T>95?b=T-96:b=T-64,S.underline=(b&1)===1,b<=13?S.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(b/2)]:b<=15?(S.italics=!0,S.color="white"):S.indent=Math.floor((b-16)/2)*4,S},h.parseChars=function(d,T){var b,S=null,D=null;if(d>=25?(b=2,D=d-8):(b=1,D=d),D>=17&&D<=19){var I;D===17?I=T+80:D===18?I=T+112:I=T+144,this.logger.log(a.INFO,"Special char '"+R(I)+"' in channel "+b),S=[I]}else d>=32&&d<=127&&(S=T===0?[d]:[d,T]);if(S){var w=l(S);this.logger.log(a.DEBUG,"Char codes = "+w.join(",")),g(d,T,this.cmdHistory)}return S},h.parseBackgroundAttributes=function(d,T){var b=(d===16||d===24)&&T>=32&&T<=47,S=(d===23||d===31)&&T>=45&&T<=47;if(!(b||S))return!1;var D,I={};d===16||d===24?(D=Math.floor((T-32)/2),I.background=o[D],T%2===1&&(I.background=I.background+"_semi")):T===45?I.background="transparent":(I.foreground="black",T===47&&(I.underline=!0));var w=d<=23?1:2,P=this.channels[w];return P.setBkgData(I),g(d,T,this.cmdHistory),!0},h.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var T=this.channels[d];T&&T.reset()}this.cmdHistory=_()},h.cueSplitAtTime=function(d){for(var T=0;T<this.channels.length;T++){var b=this.channels[T];b&&b.cueSplitAtTime(d)}},u}();function g(u,h,c){c.a=u,c.b=h}function E(u,h,c){return c.a===u&&c.b===h}function _(){return{a:null,b:null}}H.default=m},"./src/utils/codecs.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"isCodecType",function(){return L}),C.d(H,"isCodecSupportedInMp4",function(){return R});var j={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 L(B,N){var e=j[N];return!!e&&e[B.slice(0,4)]===!0}function R(B,N){return MediaSource.isTypeSupported((N||"video")+'/mp4;codecs="'+B+'"')}},"./src/utils/cues.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/vttparser.ts"),L=C("./src/utils/webvtt-parser.ts"),R=C("./src/utils/texttrack-utils.ts"),B=/\s/,N={newCue:function(A,f,p,o){for(var a=[],n,l,s,r,i,t=self.VTTCue||self.TextTrackCue,y=0;y<o.rows.length;y++)if(n=o.rows[y],s=!0,r=0,i="",!n.isEmpty()){for(var m=0;m<n.chars.length;m++)B.test(n.chars[m].uchar)&&s?r++:(i+=n.chars[m].uchar,s=!1);n.cueStartTime=f,f===p&&(p+=1e-4),r>=16?r--:r++;var g=Object(j.fixLineBreaks)(i.trim()),E=Object(L.generateCueId)(f,p,g);(!A||!A.cues||!A.cues.getCueById(E))&&(l=new t(f,p,g),l.id=E,l.line=y+1,l.align="left",l.position=10+Math.min(80,Math.floor(r*8/32)*10),a.push(l))}return A&&a.length&&(a.sort(function(_,u){return _.line==="auto"||u.line==="auto"?0:_.line>8&&u.line>8?u.line-_.line:_.line-u.line}),a.forEach(function(_){return Object(R.addCueToTrack)(A,_)})),a}};H.default=N},"./src/utils/discontinuities.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"findFirstFragWithCC",function(){return B}),C.d(H,"shouldAlignOnDiscontinuities",function(){return N}),C.d(H,"findDiscontinuousReferenceFrag",function(){return e}),C.d(H,"adjustSlidingStart",function(){return f}),C.d(H,"alignStream",function(){return p}),C.d(H,"alignPDT",function(){return a}),C.d(H,"alignFragmentByPDTDelta",function(){return n}),C.d(H,"alignMediaPlaylistByPDT",function(){return l});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/logger.ts"),R=C("./src/controller/level-helper.ts");function B(s,r){for(var i=null,t=0,y=s.length;t<y;t++){var m=s[t];if(m&&m.cc===r){i=m;break}}return i}function N(s,r,i){return!!(r.details&&(i.endCC>i.startCC||s&&s.cc<i.startCC))}function e(s,r){var i=s.fragments,t=r.fragments;if(!t.length||!i.length){L.logger.log("No fragments to align");return}var y=B(i,t[0].cc);if(!y||y&&!y.startPTS){L.logger.log("No frag in previous level to align on");return}return y}function A(s,r){if(s){var i=s.start+r;s.start=s.startPTS=i,s.endPTS=i+s.duration}}function f(s,r){for(var i=r.fragments,t=0,y=i.length;t<y;t++)A(i[t],s);r.fragmentHint&&A(r.fragmentHint,s),r.alignedSliding=!0}function p(s,r,i){if(!r)return;o(s,i,r),!i.alignedSliding&&r.details&&a(i,r.details),!i.alignedSliding&&r.details&&!i.skippedSegments&&Object(R.adjustSliding)(r.details,i)}function o(s,r,i){if(N(s,i,r)){var t=e(i.details,r);t&&Object(j.isFiniteNumber)(t.start)&&(L.logger.log("Adjusting PTS using last level due to CC increase within current level "+r.url),f(t.start,r))}}function a(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,t=s.fragments[0].programDateTime,y=(t-i)/1e3+r.fragments[0].start;y&&Object(j.isFiniteNumber)(y)&&(L.logger.log("Adjusting PTS using programDateTime delta "+(t-i)+"ms, sliding:"+y.toFixed(3)+" "+s.url+" "),f(y,s))}function n(s,r){var i=s.programDateTime;if(!i)return;var t=(i-r)/1e3;s.start=s.startPTS=t,s.endPTS=t+s.duration}function l(s,r){if(!r.fragments.length||!s.hasProgramDateTime||!r.hasProgramDateTime)return;var i=r.fragments[0].programDateTime,t=r.fragments[0].start,y=i-t*1e3;s.fragments.forEach(function(m){n(m,y)}),s.fragmentHint&&n(s.fragmentHint,y),s.alignedSliding=!0}},"./src/utils/ewma-bandwidth-estimator.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/ewma.ts"),L=function(){function R(N,e,A){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=A,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new j.default(N),this.fast_=new j.default(e)}var B=R.prototype;return B.update=function(e,A){var f=this.slow_,p=this.fast_;this.slow_.halfLife!==e&&(this.slow_=new j.default(e,f.getEstimate(),f.getTotalWeight())),this.fast_.halfLife!==A&&(this.fast_=new j.default(A,p.getEstimate(),p.getTotalWeight()))},B.sample=function(e,A){e=Math.max(e,this.minDelayMs_);var f=8*A,p=e/1e3,o=f/p;this.fast_.sample(p,o),this.slow_.sample(p,o)},B.canEstimate=function(){var e=this.fast_;return e&&e.getTotalWeight()>=this.minWeight_},B.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},B.destroy=function(){},R}();H.default=L},"./src/utils/ewma.ts":function(te,H,C){"use strict";C.r(H);var j=function(){function L(B,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=B,this.alpha_=B?Math.exp(Math.log(.5)/B):0,this.estimate_=N,this.totalWeight_=e}var R=L.prototype;return R.sample=function(N,e){var A=Math.pow(this.alpha_,N);this.estimate_=e*(1-A)+A*this.estimate_,this.totalWeight_+=N},R.getTotalWeight=function(){return this.totalWeight_},R.getEstimate=function(){if(this.alpha_){var N=1-Math.pow(this.alpha_,this.totalWeight_);if(N)return this.estimate_/N}return this.estimate_},L}();H.default=j},"./src/utils/fetch-loader.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"fetchSupported",function(){return n});var j=C("./src/polyfills/number.ts"),L=C("./src/loader/load-stats.ts"),R=C("./src/demux/chunk-cache.ts");function B(t,y){t.prototype=Object.create(y.prototype),t.prototype.constructor=t,p(t,y)}function N(t){var y=typeof Map=="function"?new Map:void 0;return N=function(g){if(g===null||!f(g))return g;if(typeof g!="function")throw new TypeError("Super expression must either be null or a function");if(typeof y!="undefined"){if(y.has(g))return y.get(g);y.set(g,E)}function E(){return e(g,arguments,o(this).constructor)}return E.prototype=Object.create(g.prototype,{constructor:{value:E,enumerable:!1,writable:!0,configurable:!0}}),p(E,g)},N(t)}function e(t,y,m){return A()?e=Reflect.construct:e=function(E,_,u){var h=[null];h.push.apply(h,_);var c=Function.bind.apply(E,h),d=new c;return u&&p(d,u.prototype),d},e.apply(null,arguments)}function A(){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 f(t){return Function.toString.call(t).indexOf("[native code]")!==-1}function p(t,y){return p=Object.setPrototypeOf||function(g,E){return g.__proto__=E,g},p(t,y)}function o(t){return o=Object.setPrototypeOf?Object.getPrototypeOf:function(m){return m.__proto__||Object.getPrototypeOf(m)},o(t)}function a(){return a=Object.assign||function(t){for(var y=1;y<arguments.length;y++){var m=arguments[y];for(var g in m)Object.prototype.hasOwnProperty.call(m,g)&&(t[g]=m[g])}return t},a.apply(this,arguments)}function n(){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||r,this.controller=new self.AbortController,this.stats=new L.LoadStats}var y=t.prototype;return y.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},y.abortInternal=function(){var g=this.response;(!g||!g.ok)&&(this.stats.aborted=!0,this.controller.abort())},y.abort=function(){var g;this.abortInternal(),(g=this.callbacks)!==null&&g!==void 0&&g.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},y.load=function(g,E,_){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(g,this.controller.signal),d=_.onProgress,T=g.responseType==="arraybuffer",b=T?"byteLength":"length";this.context=g,this.config=E,this.callbacks=_,this.request=this.fetchSetup(g,c),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){u.abortInternal(),_.onTimeout(h,g,u.response)},E.timeout),self.fetch(this.request).then(function(S){if(u.response=u.loader=S,!S.ok){var D=S.status,I=S.statusText;throw new i(I||"fetch, bad network response",D,S)}return h.loading.first=Math.max(self.performance.now(),h.loading.start),h.total=parseInt(S.headers.get("Content-Length")||"0"),d&&Object(j.isFiniteNumber)(E.highWaterMark)?u.loadProgressively(S,h,g,E.highWaterMark,d):T?S.arrayBuffer():S.text()}).then(function(S){var D=u.response;self.clearTimeout(u.requestTimeout),h.loading.end=Math.max(self.performance.now(),h.loading.first),h.loaded=h.total=S[b];var I={url:D.url,data:S};d&&!Object(j.isFiniteNumber)(E.highWaterMark)&&d(h,g,S,D),_.onSuccess(I,h,g,D)}).catch(function(S){if(self.clearTimeout(u.requestTimeout),h.aborted)return;var D=S.code||0;_.onError({code:D,text:S.message},g,S.details)})},y.getCacheAge=function(){var g=null;if(this.response){var E=this.response.headers.get("age");g=E?parseFloat(E):null}return g},y.loadProgressively=function(g,E,_,u,h){u===void 0&&(u=0);var c=new R.default,d=g.body.getReader(),T=function b(){return d.read().then(function(S){if(S.done)return c.dataLength&&h(E,_,c.flush(),g),Promise.resolve(new ArrayBuffer(0));var D=S.value,I=D.length;return E.loaded+=I,I<u||c.dataLength?(c.push(D),c.dataLength>=u&&h(E,_,c.flush(),g)):h(E,_,D,g),b()}).catch(function(){return Promise.reject()})};return T()},t}();function s(t,y){var m={method:"GET",mode:"cors",credentials:"same-origin",signal:y,headers:new self.Headers(a({},t.headers))};return t.rangeEnd&&m.headers.set("Range","bytes="+t.rangeStart+"-"+String(t.rangeEnd-1)),m}function r(t,y){return new self.Request(t.url,y)}var i=function(t){B(y,t);function y(m,g,E){var _;return _=t.call(this,m)||this,_.code=void 0,_.details=void 0,_.code=g,_.details=E,_}return y}(N(Error));H.default=l},"./src/utils/imsc1-ttml-parser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"IMSC1_CODEC",function(){return f}),C.d(H,"parseIMSC1",function(){return n});var j=C("./src/utils/mp4-tools.ts"),L=C("./src/utils/vttparser.ts"),R=C("./src/utils/vttcue.ts"),B=C("./src/demux/id3.ts"),N=C("./src/utils/timescale-conversion.ts"),e=C("./src/utils/webvtt-parser.ts");function A(){return A=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},A.apply(this,arguments)}var f="stpp.ttml.im1t",p=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,o=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function n(u,h,c,d,T){var b=Object(j.findBox)(new Uint8Array(u),["mdat"]);if(b.length===0){T(new Error("Could not parse IMSC1 mdat"));return}var S=b[0],D=Object(B.utf8ArrayToStr)(new Uint8Array(u,S.start,S.end-S.start)),I=Object(N.toTimescaleFromScale)(h,1,c);try{d(l(D,I))}catch(w){T(w)}}function l(u,h){var c=new DOMParser,d=c.parseFromString(u,"text/xml"),T=d.getElementsByTagName("tt")[0];if(!T)throw new Error("Invalid ttml");var b={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},S=Object.keys(b).reduce(function(U,O){return U[O]=T.getAttribute("ttp:"+O)||b[O],U},{}),D=T.getAttribute("xml:space")!=="preserve",I=r(s(T,"styling","style")),w=r(s(T,"layout","region")),P=s(T,"body","[begin]");return[].map.call(P,function(U){var O=i(U,D);if(!O||!U.hasAttribute("begin"))return null;var G=g(U.getAttribute("begin"),S),V=g(U.getAttribute("dur"),S),ae=g(U.getAttribute("end"),S);if(G===null)throw m(U);if(ae===null){if(V===null)throw m(U);ae=G+V}var ie=new R.default(G-h,ae-h,O);ie.id=Object(e.generateCueId)(ie.startTime,ie.endTime,ie.text);var fe=w[U.getAttribute("region")],ce=I[U.getAttribute("style")];ie.position=10,ie.size=80;var J=t(fe,ce),Z=J.textAlign;if(Z){var he=a[Z];he&&(ie.lineAlign=he),ie.align=Z}return A(ie,J),ie}).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 r(u){return u.reduce(function(h,c){var d=c.getAttribute("xml:id");return d&&(h[d]=c),h},{})}function i(u,h){return[].slice.call(u.childNodes).reduce(function(c,d,T){var b;return d.nodeName==="br"&&T?c+`
|
|
`:(b=d.childNodes)!==null&&b!==void 0&&b.length?i(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(T,b){var S=y(h,c,b)||y(u,c,b);return S&&(T[b]=S),T},{})}function y(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 g(u,h){if(!u)return null;var c=Object(L.parseTimeStamp)(u);return c===null&&(p.test(u)?c=E(u,h):o.test(u)&&(c=_(u,h))),c}function E(u,h){var c=p.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 _(u,h){var c=o.exec(u),d=Number(c[1]),T=c[2];switch(T){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(te,H,C){"use strict";C.r(H),C.d(H,"enableLogs",function(){return e}),C.d(H,"logger",function(){return A});var j=function(){},L={trace:j,debug:j,log:j,warn:j,info:j,error:j},R=L;function B(f){var p=self.console[f];return p?p.bind(self.console,"["+f+"] >"):j}function N(f){for(var p=arguments.length,o=new Array(p>1?p-1:0),a=1;a<p;a++)o[a-1]=arguments[a];o.forEach(function(n){R[n]=f[n]?f[n].bind(f):B(n)})}function e(f){if(self.console&&f===!0||typeof f=="object"){N(f,"debug","log","info","warn","error");try{R.log()}catch(p){R=L}}else R=L}var A=R},"./src/utils/mediakeys-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"KeySystems",function(){return j}),C.d(H,"requestMediaKeySystemAccess",function(){return L});var j;(function(R){R.WIDEVINE="com.widevine.alpha",R.PLAYREADY="com.microsoft.playready"})(j||(j={}));var L=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}()},"./src/utils/mediasource-helper.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"getMediaSource",function(){return j});function j(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"bin2str",function(){return N}),C.d(H,"readUint16",function(){return e}),C.d(H,"readUint32",function(){return A}),C.d(H,"writeUint32",function(){return f}),C.d(H,"findBox",function(){return p}),C.d(H,"parseSegmentIndex",function(){return o}),C.d(H,"parseInitSegment",function(){return a}),C.d(H,"getStartDTS",function(){return n}),C.d(H,"getDuration",function(){return l}),C.d(H,"computeRawDurationFromSamples",function(){return s}),C.d(H,"offsetStartDTS",function(){return r}),C.d(H,"segmentValidRange",function(){return i}),C.d(H,"appendUint8Array",function(){return t});var j=C("./src/utils/typed-array.ts"),L=C("./src/loader/fragment.ts"),R=Math.pow(2,32)-1,B=[].push;function N(y){return String.fromCharCode.apply(null,y)}function e(y,m){"data"in y&&(m+=y.start,y=y.data);var g=y[m]<<8|y[m+1];return g<0?65536+g:g}function A(y,m){"data"in y&&(m+=y.start,y=y.data);var g=y[m]<<24|y[m+1]<<16|y[m+2]<<8|y[m+3];return g<0?4294967296+g:g}function f(y,m,g){"data"in y&&(m+=y.start,y=y.data),y[m]=g>>24,y[m+1]=g>>16&255,y[m+2]=g>>8&255,y[m+3]=g&255}function p(y,m){var g=[];if(!m.length)return g;var E,_,u;"data"in y?(E=y.data,_=y.start,u=y.end):(E=y,_=0,u=E.byteLength);for(var h=_;h<u;){var c=A(E,h),d=N(E.subarray(h+4,h+8)),T=c>1?h+c:u;if(d===m[0])if(m.length===1)g.push({data:E,start:h+8,end:T});else{var b=p({data:E,start:h+8,end:T},m.slice(1));b.length&&B.apply(g,b)}h=T}return g}function o(y){var m=p(y,["moov"]),g=m[0],E=g?g.end:null,_=p(y,["sidx"]);if(!_||!_[0])return null;var u=[],h=_[0],c=h.data[0],d=c===0?8:16,T=A(h,d);d+=4;var b=0,S=0;c===0?d+=8:d+=16,d+=2;var D=h.end+S,I=e(h,d);d+=2;for(var w=0;w<I;w++){var P=d,U=A(h,P);P+=4;var O=U&2147483647,G=(U&2147483648)>>>31;if(G===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var V=A(h,P);P+=4,u.push({referenceSize:O,subsegmentDuration:V,info:{duration:V/T,start:D,end:D+O-1}}),D+=O,P+=4,d=P}return{earliestPresentationTime:b,timescale:T,version:c,referencesCount:I,references:u,moovEndOffset:E}}function a(y){for(var m=[],g=p(y,["moov","trak"]),E=0;E<g.length;E++){var _=g[E],u=p(_,["tkhd"])[0];if(u){var h=u.data[u.start],c=h===0?12:20,d=A(u,c),T=p(_,["mdia","mdhd"])[0];if(T){h=T.data[T.start],c=h===0?12:20;var b=A(T,c),S=p(_,["mdia","hdlr"])[0];if(S){var D=N(S.data.subarray(S.start+8,S.start+12)),I={soun:L.ElementaryStreamTypes.AUDIO,vide:L.ElementaryStreamTypes.VIDEO}[D];if(I){var w=p(_,["mdia","minf","stbl","stsd"])[0],P=void 0;w&&(P=N(w.data.subarray(w.start+12,w.start+16))),m[d]={timescale:b,type:I},m[I]={timescale:b,id:d,codec:P}}}}}}var U=p(y,["moov","mvex","trex"]);return U.forEach(function(O){var G=A(O,4),V=m[G];V&&(V.default={duration:A(O,12),flags:A(O,20)})}),m}function n(y,m){return p(m,["moof","traf"]).reduce(function(g,E){var _=p(E,["tfdt"])[0],u=_.data[_.start],h=p(E,["tfhd"]).reduce(function(c,d){var T=A(d,4),b=y[T];if(b){var S=A(_,4);u===1&&(S*=Math.pow(2,32),S+=A(_,8));var D=b.timescale||9e4,I=S/D;if(isFinite(I)&&(c===null||I<c))return I}return c},null);return h!==null&&isFinite(h)&&(g===null||h<g)?h:g},null)||0}function l(y,m){for(var g=0,E=0,_=0,u=p(y,["moof","traf"]),h=0;h<u.length;h++){var c=u[h],d=p(c,["tfhd"])[0],T=A(d,4),b=m[T];if(!b)continue;var S=b.default,D=A(d,0)|(S==null?void 0:S.flags),I=S==null?void 0:S.duration;D&8&&(D&2?I=A(d,12):I=A(d,8));for(var w=b.timescale||9e4,P=p(c,["trun"]),U=0;U<P.length;U++){if(I){var O=A(P[U],4);g=I*O}else g=s(P[U]);b.type===L.ElementaryStreamTypes.VIDEO?E+=g/w:b.type===L.ElementaryStreamTypes.AUDIO&&(_+=g/w)}}if(E===0&&_===0){var G=o(y);if(G!=null&&G.references)return G.references.reduce(function(V,ae){return V+ae.info.duration||0},0)}return E||_}function s(y){var m=A(y,0),g=8;m&1&&(g+=4),m&4&&(g+=4);for(var E=0,_=A(y,4),u=0;u<_;u++){if(m&256){var h=A(y,g);E+=h,g+=4}m&512&&(g+=4),m&1024&&(g+=4),m&2048&&(g+=4)}return E}function r(y,m,g){p(m,["moof","traf"]).forEach(function(E){p(E,["tfhd"]).forEach(function(_){var u=A(_,4),h=y[u];if(!h)return;var c=h.timescale||9e4;p(E,["tfdt"]).forEach(function(d){var T=d.data[d.start],b=A(d,4);if(T===0)f(d,4,b-g*c);else{b*=Math.pow(2,32),b+=A(d,8),b-=g*c,b=Math.max(b,0);var S=Math.floor(b/(R+1)),D=Math.floor(b%(R+1));f(d,4,S),f(d,8,D)}})})})}function i(y){var m={valid:null,remainder:null},g=p(y,["moof"]);if(g){if(g.length<2)return m.remainder=y,m}else return m;var E=g[g.length-1];return m.valid=Object(j.sliceUint8)(y,0,E.start-8),m.remainder=Object(j.sliceUint8)(y,E.start-8),m}function t(y,m){var g=new Uint8Array(y.length+m.length);return g.set(y),g.set(m,y.length),g}},"./src/utils/output-filter.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"default",function(){return j});var j=function(){function L(B,N){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=B,this.trackName=N}var R=L.prototype;return R.dispatchCue=function(){if(this.startTime===null)return;this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null},R.newCue=function(N,e,A){(this.startTime===null||this.startTime>N)&&(this.startTime=N),this.endTime=e,this.screen=A,this.timelineController.createCaptionsTrack(this.trackName)},R.reset=function(){this.cueRanges=[]},L}()},"./src/utils/texttrack-utils.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"sendAddTrackEvent",function(){return L}),C.d(H,"addCueToTrack",function(){return R}),C.d(H,"clearCurrentCues",function(){return B}),C.d(H,"removeCuesInRange",function(){return N}),C.d(H,"getCuesInRange",function(){return A});var j=C("./src/utils/logger.ts");function L(f,p){var o;try{o=new Event("addtrack")}catch(a){o=document.createEvent("Event"),o.initEvent("addtrack",!1,!1)}o.track=f,p.dispatchEvent(o)}function R(f,p){var o=f.mode;if(o==="disabled"&&(f.mode="hidden"),f.cues&&!f.cues.getCueById(p.id))try{if(f.addCue(p),!f.cues.getCueById(p.id))throw new Error("addCue is failed for: "+p)}catch(n){j.logger.debug("[texttrack-utils]: "+n);var a=new self.TextTrackCue(p.startTime,p.endTime,p.text);a.id=p.id,f.addCue(a)}o==="disabled"&&(f.mode=o)}function B(f){var p=f.mode;if(p==="disabled"&&(f.mode="hidden"),f.cues)for(var o=f.cues.length;o--;)f.removeCue(f.cues[o]);p==="disabled"&&(f.mode=p)}function N(f,p,o){var a=f.mode;if(a==="disabled"&&(f.mode="hidden"),f.cues&&f.cues.length>0)for(var n=A(f.cues,p,o),l=0;l<n.length;l++)f.removeCue(n[l]);a==="disabled"&&(f.mode=a)}function e(f,p){if(p<f[0].startTime)return 0;var o=f.length-1;if(p>f[o].endTime)return-1;for(var a=0,n=o;a<=n;){var l=Math.floor((n+a)/2);if(p<f[l].startTime)n=l-1;else if(p>f[l].startTime&&a<o)a=l+1;else return l}return f[a].startTime-p<p-f[n].startTime?a:n}function A(f,p,o){var a=[],n=e(f,p);if(n>-1)for(var l=n,s=f.length;l<s;l++){var r=f[l];if(r.startTime>=p&&r.endTime<=o)a.push(r);else if(r.startTime>o)return a}return a}},"./src/utils/time-ranges.ts":function(te,H,C){"use strict";C.r(H);var j={toString:function(R){for(var B="",N=R.length,e=0;e<N;e++)B+="["+R.start(e).toFixed(3)+","+R.end(e).toFixed(3)+"]";return B}};H.default=j},"./src/utils/timescale-conversion.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"toTimescaleFromBase",function(){return L}),C.d(H,"toTimescaleFromScale",function(){return R}),C.d(H,"toMsFromMpegTsClock",function(){return B}),C.d(H,"toMpegTsClockFromTimescale",function(){return N});var j=9e4;function L(e,A,f,p){f===void 0&&(f=1),p===void 0&&(p=!1);var o=e*A*f;return p?Math.round(o):o}function R(e,A,f,p){return f===void 0&&(f=1),p===void 0&&(p=!1),L(e,A,1/f,p)}function B(e,A){return A===void 0&&(A=!1),L(e,1e3,1/j,A)}function N(e,A){return A===void 0&&(A=1),L(e,j,1/A)}},"./src/utils/typed-array.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"sliceUint8",function(){return j});function j(L,R,B){return Uint8Array.prototype.slice?L.slice(R,B):new Uint8Array(Array.prototype.slice.call(L,R,B))}},"./src/utils/vttcue.ts":function(te,H,C){"use strict";C.r(H),H.default=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var j=["","lr","rl"],L=["start","middle","end","left","right"];function R(f,p){if(typeof p!="string")return!1;if(!Array.isArray(f))return!1;var o=p.toLowerCase();return~f.indexOf(o)?o:!1}function B(f){return R(j,f)}function N(f){return R(L,f)}function e(f){for(var p=arguments.length,o=new Array(p>1?p-1:0),a=1;a<p;a++)o[a-1]=arguments[a];for(var n=1;n<arguments.length;n++){var l=arguments[n];for(var s in l)f[s]=l[s]}return f}function A(f,p,o){var a=this,n={enumerable:!0};a.hasBeenReset=!1;var l="",s=!1,r=f,i=p,t=o,y=null,m="",g=!0,E="auto",_="start",u=50,h="middle",c=50,d="middle";Object.defineProperty(a,"id",e({},n,{get:function(){return l},set:function(b){l=""+b}})),Object.defineProperty(a,"pauseOnExit",e({},n,{get:function(){return s},set:function(b){s=!!b}})),Object.defineProperty(a,"startTime",e({},n,{get:function(){return r},set:function(b){if(typeof b!="number")throw new TypeError("Start time must be set to a number.");r=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"endTime",e({},n,{get:function(){return i},set:function(b){if(typeof b!="number")throw new TypeError("End time must be set to a number.");i=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"text",e({},n,{get:function(){return t},set:function(b){t=""+b,this.hasBeenReset=!0}})),Object.defineProperty(a,"region",e({},n,{get:function(){return y},set:function(b){y=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"vertical",e({},n,{get:function(){return m},set:function(b){var S=B(b);if(S===!1)throw new SyntaxError("An invalid or illegal string was specified.");m=S,this.hasBeenReset=!0}})),Object.defineProperty(a,"snapToLines",e({},n,{get:function(){return g},set:function(b){g=!!b,this.hasBeenReset=!0}})),Object.defineProperty(a,"line",e({},n,{get:function(){return E},set:function(b){if(typeof b!="number"&&b!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");E=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"lineAlign",e({},n,{get:function(){return _},set:function(b){var S=N(b);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");_=S,this.hasBeenReset=!0}})),Object.defineProperty(a,"position",e({},n,{get:function(){return u},set:function(b){if(b<0||b>100)throw new Error("Position must be between 0 and 100.");u=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"positionAlign",e({},n,{get:function(){return h},set:function(b){var S=N(b);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");h=S,this.hasBeenReset=!0}})),Object.defineProperty(a,"size",e({},n,{get:function(){return c},set:function(b){if(b<0||b>100)throw new Error("Size must be between 0 and 100.");c=b,this.hasBeenReset=!0}})),Object.defineProperty(a,"align",e({},n,{get:function(){return d},set:function(b){var S=N(b);if(!S)throw new SyntaxError("An invalid or illegal string was specified.");d=S,this.hasBeenReset=!0}})),a.displayState=void 0}return A.prototype.getCueAsHTML=function(){var f=self.WebVTT;return f.convertCueToDOMTree(self,this.text)},A}()},"./src/utils/vttparser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"parseTimeStamp",function(){return R}),C.d(H,"fixLineBreaks",function(){return p}),C.d(H,"VTTParser",function(){return o});var j=C("./src/utils/vttcue.ts"),L=function(){function a(){}var n=a.prototype;return n.decode=function(s,r){if(!s)return"";if(typeof s!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(s))},a}();function R(a){function n(s,r,i,t){return(s|0)*3600+(r|0)*60+(i|0)+parseFloat(t||0)}var l=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return l?parseFloat(l[2])>59?n(l[2],l[3],0,l[4]):n(l[1],l[2],l[3],l[4]):null}var B=function(){function a(){this.values=Object.create(null)}var n=a.prototype;return n.set=function(s,r){!this.get(s)&&r!==""&&(this.values[s]=r)},n.get=function(s,r,i){return i?this.has(s)?this.values[s]:r[i]:this.has(s)?this.values[s]:r},n.has=function(s){return s in this.values},n.alt=function(s,r,i){for(var t=0;t<i.length;++t)if(r===i[t]){this.set(s,r);break}},n.integer=function(s,r){/^-?\d+$/.test(r)&&this.set(s,parseInt(r,10))},n.percent=function(s,r){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(r)){var i=parseFloat(r);if(i>=0&&i<=100)return this.set(s,i),!0}return!1},a}();function N(a,n,l,s){var r=s?a.split(s):[a];for(var i in r){if(typeof r[i]!="string")continue;var t=r[i].split(l);if(t.length!==2)continue;var y=t[0],m=t[1];n(y,m)}}var e=new j.default(0,0,""),A=e.align==="middle"?"middle":"center";function f(a,n,l){var s=a;function r(){var y=R(a);if(y===null)throw new Error("Malformed timestamp: "+s);return a=a.replace(/^[^\sa-zA-Z-]+/,""),y}function i(y,m){var g=new B;N(y,function(u,h){var c;switch(u){case"region":for(var d=l.length-1;d>=0;d--)if(l[d].id===h){g.set(u,l[d].region);break}break;case"vertical":g.alt(u,h,["rl","lr"]);break;case"line":c=h.split(","),g.integer(u,c[0]),g.percent(u,c[0])&&g.set("snapToLines",!1),g.alt(u,c[0],["auto"]),c.length===2&&g.alt("lineAlign",c[1],["start",A,"end"]);break;case"position":c=h.split(","),g.percent(u,c[0]),c.length===2&&g.alt("positionAlign",c[1],["start",A,"end","line-left","line-right","auto"]);break;case"size":g.percent(u,h);break;case"align":g.alt(u,h,["start",A,"end","left","right"]);break}},/:/,/\s/),m.region=g.get("region",null),m.vertical=g.get("vertical","");var E=g.get("line","auto");E==="auto"&&e.line===-1&&(E=-1),m.line=E,m.lineAlign=g.get("lineAlign","start"),m.snapToLines=g.get("snapToLines",!0),m.size=g.get("size",100),m.align=g.get("align",A);var _=g.get("position","auto");_==="auto"&&e.position===50&&(_=m.align==="start"||m.align==="left"?0:m.align==="end"||m.align==="right"?100:50),m.position=_}function t(){a=a.replace(/^\s+/,"")}if(t(),n.startTime=r(),t(),a.substr(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);a=a.substr(3),t(),n.endTime=r(),t(),i(a,n)}function p(a){return a.replace(/<br(?: \/)?>/gi,`
|
|
`)}var o=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new L,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var n=a.prototype;return n.parse=function(s){var r=this;s&&(r.buffer+=r.decoder.decode(s,{stream:!0}));function i(){var _=r.buffer,u=0;for(_=p(_);u<_.length&&_[u]!=="\r"&&_[u]!==`
|
|
`;)++u;var h=_.substr(0,u);return _[u]==="\r"&&++u,_[u]===`
|
|
`&&++u,r.buffer=_.substr(u),h}function t(_){N(_,function(u,h){},/:/)}try{var y="";if(r.state==="INITIAL"){if(!/\r\n|\n/.test(r.buffer))return this;y=i();var m=y.match(/^()?WEBVTT([ \t].*)?$/);if(!m||!m[0])throw new Error("Malformed WebVTT signature.");r.state="HEADER"}for(var g=!1;r.buffer;){if(!/\r\n|\n/.test(r.buffer))return this;g?g=!1:y=i();switch(r.state){case"HEADER":/:/.test(y)?t(y):y||(r.state="ID");continue;case"NOTE":y||(r.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(y)){r.state="NOTE";break}if(!y)continue;if(r.cue=new j.default(0,0,""),r.state="CUE",y.indexOf("-->")===-1){r.cue.id=y;continue}case"CUE":if(!r.cue){r.state="BADCUE";continue}try{f(y,r.cue,r.regionList)}catch(_){r.cue=null,r.state="BADCUE";continue}r.state="CUETEXT";continue;case"CUETEXT":{var E=y.indexOf("-->")!==-1;if(!y||E&&(g=!0)){r.oncue&&r.cue&&r.oncue(r.cue),r.cue=null,r.state="ID";continue}if(r.cue===null)continue;r.cue.text&&(r.cue.text+=`
|
|
`),r.cue.text+=y}continue;case"BADCUE":y||(r.state="ID")}}}catch(_){r.state==="CUETEXT"&&r.cue&&r.oncue&&r.oncue(r.cue),r.cue=null,r.state=r.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},n.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(r){s.onparsingerror&&s.onparsingerror(r)}return s.onflush&&s.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":function(te,H,C){"use strict";C.r(H),C.d(H,"generateCueId",function(){return o}),C.d(H,"parseWebVTT",function(){return n});var j=C("./src/polyfills/number.ts"),L=C("./src/utils/vttparser.ts"),R=C("./src/demux/id3.ts"),B=C("./src/utils/timescale-conversion.ts"),N=C("./src/remux/mp4-remuxer.ts"),e=/\r\n|\n\r|\n|\r/g,A=function(s,r,i){return i===void 0&&(i=0),s.substr(i,r.length)===r},f=function(s){var r=parseInt(s.substr(-3)),i=parseInt(s.substr(-6,2)),t=parseInt(s.substr(-9,2)),y=s.length>9?parseInt(s.substr(0,s.indexOf(":"))):0;if(!Object(j.isFiniteNumber)(r)||!Object(j.isFiniteNumber)(i)||!Object(j.isFiniteNumber)(t)||!Object(j.isFiniteNumber)(y))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+s);return r+=1e3*i,r+=60*1e3*t,r+=60*60*1e3*y,r},p=function(s){for(var r=5381,i=s.length;i;)r=r*33^s.charCodeAt(--i);return(r>>>0).toString()};function o(l,s,r){return p(l.toString())+p(s.toString())+p(r)}var a=function(s,r,i){var t=s[r],y=s[t.prevCC];if(!y||!y.new&&t.new){s.ccOffset=s.presentationOffset=t.start,t.new=!1;return}for(;(m=y)!==null&&m!==void 0&&m.new;){var m;s.ccOffset+=t.start-y.start,t.new=!1,t=y,y=s[t.prevCC]}s.presentationOffset=i};function n(l,s,r,i,t,y,m,g){var E=new L.VTTParser,_=Object(R.utf8ArrayToStr)(new Uint8Array(l)).trim().replace(e,`
|
|
`).split(`
|
|
`),u=[],h=Object(B.toMpegTsClockFromTimescale)(s,r),c="00:00.000",d=0,T=0,b,S=!0,D=!1;E.oncue=function(I){var w=i[t],P=i.ccOffset,U=(d-h)/9e4;if(w!=null&&w.new&&(T!==void 0?P=i.ccOffset=w.start:a(i,t,U)),U&&(P=U-i.presentationOffset),D){var O=I.endTime-I.startTime,G=Object(N.normalizePts)((I.startTime+P-T)*9e4,y*9e4)/9e4;I.startTime=G,I.endTime=G+O}var V=I.text.trim();I.text=decodeURIComponent(encodeURIComponent(V)),I.id||(I.id=o(I.startTime,I.endTime,V)),I.endTime>0&&u.push(I)},E.onparsingerror=function(I){b=I},E.onflush=function(){if(b){g(b);return}m(u)},_.forEach(function(I){if(S)if(A(I,"X-TIMESTAMP-MAP=")){S=!1,D=!0,I.substr(16).split(",").forEach(function(w){A(w,"LOCAL:")?c=w.substr(6):A(w,"MPEGTS:")&&(d=parseInt(w.substr(7)))});try{T=f(c)/1e3}catch(w){D=!1,b=w}return}else I===""&&(S=!1);E.parse(I+`
|
|
`)}),E.flush()}},"./src/utils/xhr-loader.ts":function(te,H,C){"use strict";C.r(H);var j=C("./src/utils/logger.ts"),L=C("./src/loader/load-stats.ts"),R=/^age:\s*[\d.]+\s*$/m,B=function(){function N(A){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=A?A.xhrSetup:null,this.stats=new L.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 f=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),f&&(f.onreadystatechange=null,f.onprogress=null,f.readyState!==4&&(this.stats.aborted=!0,f.abort()))},e.abort=function(){var f;this.abortInternal(),(f=this.callbacks)!==null&&f!==void 0&&f.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},e.load=function(f,p,o){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=f,this.config=p,this.callbacks=o,this.retryDelay=p.retryDelay,this.loadInternal()},e.loadInternal=function(){var f=this.config,p=this.context;if(!f)return;var o=this.loader=new self.XMLHttpRequest,a=this.stats;a.loading.first=0,a.loaded=0;var n=this.xhrSetup;try{if(n)try{n(o,p.url)}catch(r){o.open("GET",p.url,!0),n(o,p.url)}o.readyState||o.open("GET",p.url,!0);var l=this.context.headers;if(l)for(var s in l)o.setRequestHeader(s,l[s])}catch(r){this.callbacks.onError({code:o.status,text:r.message},p,o);return}p.rangeEnd&&o.setRequestHeader("Range","bytes="+p.rangeStart+"-"+(p.rangeEnd-1)),o.onreadystatechange=this.readystatechange.bind(this),o.onprogress=this.loadprogress.bind(this),o.responseType=p.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),f.timeout),o.send()},e.readystatechange=function(){var f=this.context,p=this.loader,o=this.stats;if(!f||!p)return;var a=p.readyState,n=this.config;if(o.aborted)return;if(a>=2)if(self.clearTimeout(this.requestTimeout),o.loading.first===0&&(o.loading.first=Math.max(self.performance.now(),o.loading.start)),a===4){p.onreadystatechange=null,p.onprogress=null;var l=p.status;if(l>=200&&l<300){o.loading.end=Math.max(self.performance.now(),o.loading.first);var s,r;if(f.responseType==="arraybuffer"?(s=p.response,r=s.byteLength):(s=p.responseText,r=s.length),o.loaded=o.total=r,!this.callbacks)return;var i=this.callbacks.onProgress;if(i&&i(o,f,s,p),!this.callbacks)return;var t={url:p.responseURL,data:s};this.callbacks.onSuccess(t,o,f,p)}else o.retry>=n.maxRetry||l>=400&&l<499?(j.logger.error(l+" while loading "+f.url),this.callbacks.onError({code:l,text:p.statusText},f,p)):(j.logger.warn(l+" while loading "+f.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,n.maxRetryDelay),o.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),n.timeout)},e.loadtimeout=function(){j.logger.warn("timeout while loading "+this.context.url);var f=this.callbacks;f&&(this.abortInternal(),f.onTimeout(this.stats,this.context,this.loader))},e.loadprogress=function(f){var p=this.stats;p.loaded=f.loaded,f.lengthComputable&&(p.total=f.total)},e.getCacheAge=function(){var f=null;if(this.loader&&R.test(this.loader.getAllResponseHeaders())){var p=this.loader.getResponseHeader("age");f=p?parseFloat(p):null}return f},N}();H.default=B}}).default})},vHTk:function(Qe,ue,W){Qe.exports={wrp:"wrp___z2l1F",bgBlack:"bgBlack___3ezfX",monaco:"monaco___1ypjT",darkBlue:"darkBlue___2ViJc",close:"close___3q-z4",embed:"embed___3dQqc"}}}]);
|