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

1024 lines
1.1 MiB

This file contains invisible Unicode characters!

This file contains invisible Unicode characters that may be processed differently from what appears below. If your use case is intentional and legitimate, you can safely ignore this warning. Use the Escape button to reveal hidden characters.

(self.webpackChunk=self.webpackChunk||[]).push([[9716],{98280:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return cs}});function N(H){"@babel/helpers - typeof";return N=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},N(H)}function B(H,$){if(N(H)!="object"||!H)return H;var Y=H[Symbol.toPrimitive];if(Y!==void 0){var oe=Y.call(H,$||"default");if(N(oe)!="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(H)}function U(H){var $=B(H,"string");return N($)=="symbol"?$:$+""}function k(H,$,Y){return($=U($))in H?Object.defineProperty(H,$,{value:Y,enumerable:!0,configurable:!0,writable:!0}):H[$]=Y,H}function S(H,$){var Y=Object.keys(H);if(Object.getOwnPropertySymbols){var oe=Object.getOwnPropertySymbols(H);$&&(oe=oe.filter(function(Re){return Object.getOwnPropertyDescriptor(H,Re).enumerable})),Y.push.apply(Y,oe)}return Y}function P(H){for(var $=1;$<arguments.length;$++){var Y=arguments[$]!=null?arguments[$]:{};$%2?S(Object(Y),!0).forEach(function(oe){k(H,oe,Y[oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(Y)):S(Object(Y)).forEach(function(oe){Object.defineProperty(H,oe,Object.getOwnPropertyDescriptor(Y,oe))})}return H}function T(H){if(Array.isArray(H))return H}function b(H,$){var Y=H==null?null:typeof Symbol!="undefined"&&H[Symbol.iterator]||H["@@iterator"];if(Y!=null){var oe,Re,He,Xe,tt=[],rt=!0,ct=!1;try{if(He=(Y=Y.call(H)).next,$===0){if(Object(Y)!==Y)return;rt=!1}else for(;!(rt=(oe=He.call(Y)).done)&&(tt.push(oe.value),tt.length!==$);rt=!0);}catch(St){ct=!0,Re=St}finally{try{if(!rt&&Y.return!=null&&(Xe=Y.return(),Object(Xe)!==Xe))return}finally{if(ct)throw Re}}return tt}}function e(H,$){($==null||$>H.length)&&($=H.length);for(var Y=0,oe=Array($);Y<$;Y++)oe[Y]=H[Y];return oe}function E(H,$){if(H){if(typeof H=="string")return e(H,$);var Y={}.toString.call(H).slice(8,-1);return Y==="Object"&&H.constructor&&(Y=H.constructor.name),Y==="Map"||Y==="Set"?Array.from(H):Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y)?e(H,$):void 0}}function s(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function n(H,$){return T(H)||b(H,$)||E(H,$)||s()}function t(H,$){if(H==null)return{};var Y={};for(var oe in H)if({}.hasOwnProperty.call(H,oe)){if($.indexOf(oe)!==-1)continue;Y[oe]=H[oe]}return Y}function r(H,$){if(H==null)return{};var Y,oe,Re=t(H,$);if(Object.getOwnPropertySymbols){var He=Object.getOwnPropertySymbols(H);for(oe=0;oe<He.length;oe++)Y=He[oe],$.indexOf(Y)===-1&&{}.propertyIsEnumerable.call(H,Y)&&(Re[Y]=H[Y])}return Re}function i(H){if(Array.isArray(H))return H}function a(H,$){var Y=H==null?null:typeof Symbol!="undefined"&&H[Symbol.iterator]||H["@@iterator"];if(Y!=null){var oe,Re,He,Xe,tt=[],rt=!0,ct=!1;try{if(He=(Y=Y.call(H)).next,$===0){if(Object(Y)!==Y)return;rt=!1}else for(;!(rt=(oe=He.call(Y)).done)&&(tt.push(oe.value),tt.length!==$);rt=!0);}catch(St){ct=!0,Re=St}finally{try{if(!rt&&Y.return!=null&&(Xe=Y.return(),Object(Xe)!==Xe))return}finally{if(ct)throw Re}}return tt}}function v(H,$){($==null||$>H.length)&&($=H.length);for(var Y=0,oe=new Array($);Y<$;Y++)oe[Y]=H[Y];return oe}function p(H,$){if(H){if(typeof H=="string")return v(H,$);var Y=Object.prototype.toString.call(H).slice(8,-1);if(Y==="Object"&&H.constructor&&(Y=H.constructor.name),Y==="Map"||Y==="Set")return Array.from(H);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return v(H,$)}}function l(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function o(H,$){return i(H)||a(H,$)||p(H,$)||l()}var u=M(67294),c=M.t(u,2),_=M(73935);function y(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var f={};function C(H,$){}function L(H,$){}function R(){f={}}function O(H,$,Y){!$&&!f[Y]&&(H(!1,Y),f[Y]=!0)}function g(H,$){O(C,H,$)}function m(H,$){O(L,H,$)}var d=null;function h(H){"@babel/helpers - typeof";return h=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},h(H)}var A=M(81640);function w(H,$,Y){var oe=u.useRef({});return(!("value"in oe.current)||Y(oe.current.condition,$))&&(oe.current.value=H(),oe.current.condition=$),oe.current.value}function x(H,$){typeof H=="function"?H($):h(H)==="object"&&H&&"current"in H&&(H.current=$)}function D(){for(var H=arguments.length,$=new Array(H),Y=0;Y<H;Y++)$[Y]=arguments[Y];var oe=$.filter(function(Re){return Re});return oe.length<=1?oe[0]:function(Re){$.forEach(function(He){x(He,Re)})}}function I(){for(var H=arguments.length,$=new Array(H),Y=0;Y<H;Y++)$[Y]=arguments[Y];return w(function(){return D.apply(void 0,$)},$,function(oe,Re){return oe.length===Re.length&&oe.every(function(He,Xe){return He===Re[Xe]})})}function F(H){var $,Y,oe=(0,A.isMemo)(H)?H.type.type:H.type;return!(typeof oe=="function"&&!(($=oe.prototype)!==null&&$!==void 0&&$.render)||typeof H=="function"&&!((Y=H.prototype)!==null&&Y!==void 0&&Y.render))}var K=u.createContext(null),W=K;function z(H){if(Array.isArray(H))return v(H)}function j(H){if(typeof Symbol!="undefined"&&H[Symbol.iterator]!=null||H["@@iterator"]!=null)return Array.from(H)}function G(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z(H){return z(H)||j(H)||p(H)||G()}var Q=y()?u.useLayoutEffect:u.useEffect,ue=Q,ee=function($,Y){var oe=React.useRef(!0);Q(function(){if(!oe.current)return $()},Y),Q(function(){return oe.current=!1,function(){oe.current=!0}},[])},ae=[];function _e(H,$){var Y=u.useState(function(){if(!y())return null;var dt=document.createElement("div");return dt}),oe=o(Y,1),Re=oe[0],He=u.useRef(!1),Xe=u.useContext(W),tt=u.useState(ae),rt=o(tt,2),ct=rt[0],St=rt[1],pt=Xe||(He.current?void 0:function(dt){St(function(Mt){var wt=[dt].concat(Z(Mt));return wt})});function Et(){Re.parentElement||document.body.appendChild(Re),He.current=!0}function lt(){var dt;(dt=Re.parentElement)===null||dt===void 0||dt.removeChild(Re),He.current=!1}return ue(function(){return H?Xe?Xe(Et):Et():lt(),lt},[H]),ue(function(){ct.length&&(ct.forEach(function(dt){return dt()}),St(ae))},[ct]),[Re,pt]}function xe(H,$){if(!H)return!1;if(H.contains)return H.contains($);for(var Y=$;Y;){if(Y===H)return!0;Y=Y.parentNode}return!1}var ge="data-rc-order",ce="rc-util-key",he=new Map;function Se(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},$=H.mark;return $?$.startsWith("data-")?$:"data-".concat($):ce}function Te(H){if(H.attachTo)return H.attachTo;var $=document.querySelector("head");return $||document.body}function ke(H){return H==="queue"?"prependQueue":H?"prepend":"append"}function X(H){return Array.from((he.get(H)||H).children).filter(function($){return $.tagName==="STYLE"})}function te(H){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(!y())return null;var Y=$.csp,oe=$.prepend,Re=document.createElement("style");Re.setAttribute(ge,ke(oe)),Y!=null&&Y.nonce&&(Re.nonce=Y==null?void 0:Y.nonce),Re.innerHTML=H;var He=Te($),Xe=He.firstChild;if(oe){if(oe==="queue"){var tt=X(He).filter(function(rt){return["prepend","prependQueue"].includes(rt.getAttribute(ge))});if(tt.length)return He.insertBefore(Re,tt[tt.length-1].nextSibling),Re}He.insertBefore(Re,Xe)}else He.appendChild(Re);return Re}function pe(H){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=Te($);return X(Y).find(function(oe){return oe.getAttribute(Se($))===H})}function me(H){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},Y=pe(H,$);if(Y){var oe=Te($);oe.removeChild(Y)}}function be(H,$){var Y=he.get(H);if(!Y||!xe(document,Y)){var oe=te("",$),Re=oe.parentNode;he.set(H,Re),H.removeChild(oe)}}function de(){he.clear()}function Be(H,$){var Y=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{},oe=Te(Y);be(oe,Y);var Re=pe($,Y);if(Re){var He,Xe;if((He=Y.csp)!==null&&He!==void 0&&He.nonce&&Re.nonce!==((Xe=Y.csp)===null||Xe===void 0?void 0:Xe.nonce)){var tt;Re.nonce=(tt=Y.csp)===null||tt===void 0?void 0:tt.nonce}return Re.innerHTML!==H&&(Re.innerHTML=H),Re}var rt=te(H,Y);return rt.setAttribute(Se(Y),$),rt}var we;function Le(H){if(typeof document=="undefined")return 0;if(H||we===void 0){var $=document.createElement("div");$.style.width="100%",$.style.height="200px";var Y=document.createElement("div"),oe=Y.style;oe.position="absolute",oe.top="0",oe.left="0",oe.pointerEvents="none",oe.visibility="hidden",oe.width="200px",oe.height="150px",oe.overflow="hidden",Y.appendChild($),document.body.appendChild(Y);var Re=$.offsetWidth;Y.style.overflow="scroll";var He=$.offsetWidth;Re===He&&(He=Y.clientWidth),document.body.removeChild(Y),we=Re-He}return we}function Ae(H){var $=H.match(/^(.*)px$/),Y=Number($==null?void 0:$[1]);return Number.isNaN(Y)?Le():Y}function Ve(H){if(typeof document=="undefined"||!H||!(H instanceof Element))return{width:0,height:0};var $=getComputedStyle(H,"::-webkit-scrollbar"),Y=$.width,oe=$.height;return{width:Ae(Y),height:Ae(oe)}}function De(){return document.body.scrollHeight>(window.innerHeight||document.documentElement.clientHeight)&&window.innerWidth>document.body.offsetWidth}var ye="rc-util-locker-".concat(Date.now()),Ee=0;function Oe(H){var $=!!H,Y=u.useState(function(){return Ee+=1,"".concat(ye,"_").concat(Ee)}),oe=o(Y,1),Re=oe[0];ue(function(){if($){var He=Ve(document.body).width,Xe=De();Be(`
html body {
overflow-y: hidden;
`.concat(Xe?"width: calc(100% - ".concat(He,"px);"):"",`
}`),Re)}else me(Re);return function(){me(Re)}},[$,Re])}var Fe=!1;function Ke(H){return typeof H=="boolean"&&(Fe=H),Fe}var ze=function($){return $===!1?!1:!y()||!$?null:typeof $=="string"?document.querySelector($):typeof $=="function"?$():$},Ye=u.forwardRef(function(H,$){var Y=H.open,oe=H.autoLock,Re=H.getContainer,He=H.debug,Xe=H.autoDestroy,tt=Xe===void 0?!0:Xe,rt=H.children,ct=u.useState(Y),St=o(ct,2),pt=St[0],Et=St[1],lt=pt||Y;u.useEffect(function(){(tt||Y)&&Et(Y)},[Y,tt]);var dt=u.useState(function(){return ze(Re)}),Mt=o(dt,2),wt=Mt[0],Ht=Mt[1];u.useEffect(function(){var nr=ze(Re);Ht(nr!=null?nr:null)});var Ut=_e(lt&&!wt,He),xt=o(Ut,2),Bt=xt[0],Ot=xt[1],ut=wt!=null?wt:Bt;Oe(oe&&Y&&y()&&(ut===Bt||ut===document.body));var vr=null;if(rt&&F(rt)&&$){var xr=rt;vr=xr.ref}var gr=I(vr,$);if(!lt||!y()||wt===void 0)return null;var Dr=ut===!1||Ke(),mr=rt;return $&&(mr=u.cloneElement(rt,{ref:gr})),u.createElement(W.Provider,{value:Ot},Dr?mr:(0,_.createPortal)(mr,ut))}),Ie=Ye,je=Ie,qe=M(94184),Pe=M.n(qe),Ze=M(48555);function se(H){return H instanceof HTMLElement||H instanceof SVGElement}function ie(H){return H&&_typeof(H)==="object"&&se(H.nativeElement)?H.nativeElement:se(H)?H:null}function le(H){var $=ie(H);if($)return $;if(H instanceof React.Component){var Y;return(Y=ReactDOM.findDOMNode)===null||Y===void 0?void 0:Y.call(ReactDOM,H)}return null}function V(H){var $;return H==null||($=H.getRootNode)===null||$===void 0?void 0:$.call(H)}function J(H){return V(H)instanceof ShadowRoot}function q(H){return J(H)?V(H):null}function fe(H){var $=u.useRef();$.current=H;var Y=u.useCallback(function(){for(var oe,Re=arguments.length,He=new Array(Re),Xe=0;Xe<Re;Xe++)He[Xe]=arguments[Xe];return(oe=$.current)===null||oe===void 0?void 0:oe.call.apply(oe,[$].concat(He))},[]);return Y}function ne(H){if(Array.isArray(H))return H}function ve(H,$){var Y=H==null?null:typeof Symbol!="undefined"&&H[Symbol.iterator]||H["@@iterator"];if(Y!=null){var oe,Re,He,Xe,tt=[],rt=!0,ct=!1;try{if(He=(Y=Y.call(H)).next,$===0){if(Object(Y)!==Y)return;rt=!1}else for(;!(rt=(oe=He.call(Y)).done)&&(tt.push(oe.value),tt.length!==$);rt=!0);}catch(St){ct=!0,Re=St}finally{try{if(!rt&&Y.return!=null&&(Xe=Y.return(),Object(Xe)!==Xe))return}finally{if(ct)throw Re}}return tt}}function Ce(H,$){($==null||$>H.length)&&($=H.length);for(var Y=0,oe=new Array($);Y<$;Y++)oe[Y]=H[Y];return oe}function Ue(H,$){if(H){if(typeof H=="string")return Ce(H,$);var Y=Object.prototype.toString.call(H).slice(8,-1);if(Y==="Object"&&H.constructor&&(Y=H.constructor.name),Y==="Map"||Y==="Set")return Array.from(H);if(Y==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(Y))return Ce(H,$)}}function We(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function nt(H,$){return ne(H)||ve(H,$)||Ue(H,$)||We()}function et(H){"@babel/helpers - typeof";return et=typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?function($){return typeof $}:function($){return $&&typeof Symbol=="function"&&$.constructor===Symbol&&$!==Symbol.prototype?"symbol":typeof $},et(H)}function Je(H,$){if(et(H)!=="object"||H===null)return H;var Y=H[Symbol.toPrimitive];if(Y!==void 0){var oe=Y.call(H,$||"default");if(et(oe)!=="object")return oe;throw new TypeError("@@toPrimitive must return a primitive value.")}return($==="string"?String:Number)(H)}function $e(H){var $=Je(H,"string");return et($)==="symbol"?$:String($)}function ft(H,$,Y){return $=$e($),$ in H?Object.defineProperty(H,$,{value:Y,enumerable:!0,configurable:!0,writable:!0}):H[$]=Y,H}function at(H,$){var Y=Object.keys(H);if(Object.getOwnPropertySymbols){var oe=Object.getOwnPropertySymbols(H);$&&(oe=oe.filter(function(Re){return Object.getOwnPropertyDescriptor(H,Re).enumerable})),Y.push.apply(Y,oe)}return Y}function ot(H){for(var $=1;$<arguments.length;$++){var Y=arguments[$]!=null?arguments[$]:{};$%2?at(Object(Y),!0).forEach(function(oe){ft(H,oe,Y[oe])}):Object.getOwnPropertyDescriptors?Object.defineProperties(H,Object.getOwnPropertyDescriptors(Y)):at(Object(Y)).forEach(function(oe){Object.defineProperty(H,oe,Object.getOwnPropertyDescriptor(Y,oe))})}return H}function _t(){var H=ot({},c);return H.useId}var Me=0;function Ne(){}var it=_t(),ht=it?function($){var Y=it();return $||Y}:function($){var Y=u.useState("ssr-id"),oe=nt(Y,2),Re=oe[0],He=oe[1];return u.useEffect(function(){var Xe=Me;Me+=1,He("rc_unique_".concat(Xe))},[]),$||Re};function Ct(){return!!(typeof window!="undefined"&&window.document&&window.document.createElement)}var Ft=Ct()?u.useLayoutEffect:u.useEffect,Vt=function($,Y){var oe=u.useRef(!0);Ft(function(){return $(oe.current)},Y),Ft(function(){return oe.current=!1,function(){oe.current=!0}},[])},pr=function($,Y){Vt(function(oe){if(!oe)return $()},Y)},gt=Vt,Jt=function(){if(typeof navigator=="undefined"||typeof window=="undefined")return!1;var H=navigator.userAgent||navigator.vendor||window.opera;return/(android|bb\d+|meego).+mobile|avantgo|bada\/|blackberry|blazer|compal|elaine|fennec|hiptop|iemobile|ip(hone|od)|iris|kindle|lge |maemo|midp|mmp|mobile.+firefox|netfront|opera m(ob|in)i|palm( os)?|phone|p(ixi|re)\/|plucker|pocket|psp|series(4|6)0|symbian|treo|up\.(browser|link)|vodafone|wap|windows ce|xda|xiino|android|ipad|playbook|silk/i.test(H)||/1207|6310|6590|3gso|4thp|50[1-6]i|770s|802s|a wa|abac|ac(er|oo|s-)|ai(ko|rn)|al(av|ca|co)|amoi|an(ex|ny|yw)|aptu|ar(ch|go)|as(te|us)|attw|au(di|-m|r |s )|avan|be(ck|ll|nq)|bi(lb|rd)|bl(ac|az)|br(e|v)w|bumb|bw-(n|u)|c55\/|capi|ccwa|cdm-|cell|chtm|cldc|cmd-|co(mp|nd)|craw|da(it|ll|ng)|dbte|dc-s|devi|dica|dmob|do(c|p)o|ds(12|-d)|el(49|ai)|em(l2|ul)|er(ic|k0)|esl8|ez([4-7]0|os|wa|ze)|fetc|fly(-|_)|g1 u|g560|gene|gf-5|g-mo|go(\.w|od)|gr(ad|un)|haie|hcit|hd-(m|p|t)|hei-|hi(pt|ta)|hp( i|ip)|hs-c|ht(c(-| |_|a|g|p|s|t)|tp)|hu(aw|tc)|i-(20|go|ma)|i230|iac( |-|\/)|ibro|idea|ig01|ikom|im1k|inno|ipaq|iris|ja(t|v)a|jbro|jemu|jigs|kddi|keji|kgt( |\/)|klon|kpt |kwc-|kyo(c|k)|le(no|xi)|lg( g|\/(k|l|u)|50|54|-[a-w])|libw|lynx|m1-w|m3ga|m50\/|ma(te|ui|xo)|mc(01|21|ca)|m-cr|me(rc|ri)|mi(o8|oa|ts)|mmef|mo(01|02|bi|de|do|t(-| |o|v)|zz)|mt(50|p1|v )|mwbp|mywa|n10[0-2]|n20[2-3]|n30(0|2)|n50(0|2|5)|n7(0(0|1)|10)|ne((c|m)-|on|tf|wf|wg|wt)|nok(6|i)|nzph|o2im|op(ti|wv)|oran|owg1|p800|pan(a|d|t)|pdxg|pg(13|-([1-8]|c))|phil|pire|pl(ay|uc)|pn-2|po(ck|rt|se)|prox|psio|pt-g|qa-a|qc(07|12|21|32|60|-[2-7]|i-)|qtek|r380|r600|raks|rim9|ro(ve|zo)|s55\/|sa(ge|ma|mm|ms|ny|va)|sc(01|h-|oo|p-)|sdk\/|se(c(-|0|1)|47|mc|nd|ri)|sgh-|shar|sie(-|m)|sk-0|sl(45|id)|sm(al|ar|b3|it|t5)|so(ft|ny)|sp(01|h-|v-|v )|sy(01|mb)|t2(18|50)|t6(00|10|18)|ta(gt|lk)|tcl-|tdg-|tel(i|m)|tim-|t-mo|to(pl|sh)|ts(70|m-|m3|m5)|tx-9|up(\.b|g1|si)|utst|v400|v750|veri|vi(rg|te)|vk(40|5[0-3]|-v)|vm40|voda|vulc|vx(52|53|60|61|70|80|81|83|85|98)|w3c(-| )|webc|whit|wi(g |nc|nw)|wmlb|wonu|x700|yas-|your|zeto|zte-/i.test(H==null?void 0:H.substr(0,4))};function Zt(){return Zt=Object.assign?Object.assign.bind():function(H){for(var $=1;$<arguments.length;$++){var Y=arguments[$];for(var oe in Y)({}).hasOwnProperty.call(Y,oe)&&(H[oe]=Y[oe])}return H},Zt.apply(null,arguments)}var _r=M(62874),Yt=M(52481);function cn(H,$,Y){var oe=u.useRef({});return(!("value"in oe.current)||Y(oe.current.condition,$))&&(oe.current.value=H(),oe.current.condition=$),oe.current.value}var mt=Symbol.for("react.element"),yt=Symbol.for("react.transitional.element"),vt=Symbol.for("react.fragment");function jt(H){return H&&et(H)==="object"&&(H.$$typeof===mt||H.$$typeof===yt)&&H.type===vt}var Nt=Number(u.version.split(".")[0]),Wt=function($,Y){typeof $=="function"?$(Y):et($)==="object"&&$&&"current"in $&&($.current=Y)},Pt=function(){for(var $=arguments.length,Y=new Array($),oe=0;oe<$;oe++)Y[oe]=arguments[oe];var Re=Y.filter(Boolean);return Re.length<=1?Re[0]:function(He){Y.forEach(function(Xe){Wt(Xe,He)})}},It=function(){for(var $=arguments.length,Y=new Array($),oe=0;oe<$;oe++)Y[oe]=arguments[oe];return cn(function(){return Pt.apply(void 0,Y)},Y,function(Re,He){return Re.length!==He.length||Re.every(function(Xe,tt){return Xe!==He[tt]})})},zt=function($){var Y,oe;if(!$)return!1;if(Wr($)&&Nt>=19)return!0;var Re=(0,Yt.isMemo)($)?$.type.type:$.type;return!(typeof Re=="function"&&!((Y=Re.prototype)!==null&&Y!==void 0&&Y.render)&&Re.$$typeof!==Yt.ForwardRef||typeof $=="function"&&!((oe=$.prototype)!==null&&oe!==void 0&&oe.render)&&$.$$typeof!==Yt.ForwardRef)};function Wr(H){return(0,u.isValidElement)(H)&&!jt(H)}var fs=function($){return Wr($)&&zt($)},Fi=function($){if($&&Wr($)){var Y=$;return Y.props.propertyIsEnumerable("ref")?Y.props.ref:Y.ref}return null};function Bi(H){var $=H.prefixCls,Y=H.align,oe=H.arrow,Re=H.arrowPos,He=oe||{},Xe=He.className,tt=He.content,rt=Re.x,ct=rt===void 0?0:rt,St=Re.y,pt=St===void 0?0:St,Et=u.useRef();if(!Y||!Y.points)return null;var lt={position:"absolute"};if(Y.autoArrow!==!1){var dt=Y.points[0],Mt=Y.points[1],wt=dt[0],Ht=dt[1],Ut=Mt[0],xt=Mt[1];wt===Ut||!["t","b"].includes(wt)?lt.top=pt:wt==="t"?lt.top=0:lt.bottom=0,Ht===xt||!["l","r"].includes(Ht)?lt.left=ct:Ht==="l"?lt.left=0:lt.right=0}return u.createElement("div",{ref:Et,className:Pe()("".concat($,"-arrow"),Xe),style:lt},tt)}function Ni(H){var $=H.prefixCls,Y=H.open,oe=H.zIndex,Re=H.mask,He=H.motion;return Re?u.createElement(_r.Z,Zt({},He,{motionAppear:!0,visible:Y,removeOnLeave:!0}),function(Xe){var tt=Xe.className;return u.createElement("div",{style:{zIndex:oe},className:Pe()("".concat($,"-mask"),tt)})}):null}var Ui=u.memo(function(H){var $=H.children;return $},function(H,$){return $.cache}),Ki=Ui,Wi=u.forwardRef(function(H,$){var Y=H.popup,oe=H.className,Re=H.prefixCls,He=H.style,Xe=H.target,tt=H.onVisibleChanged,rt=H.open,ct=H.keepDom,St=H.fresh,pt=H.onClick,Et=H.mask,lt=H.arrow,dt=H.arrowPos,Mt=H.align,wt=H.motion,Ht=H.maskMotion,Ut=H.forceRender,xt=H.getPopupContainer,Bt=H.autoDestroy,Ot=H.portal,ut=H.zIndex,vr=H.onMouseEnter,xr=H.onMouseLeave,gr=H.onPointerEnter,Dr=H.onPointerDownCapture,mr=H.ready,nr=H.offsetX,Mr=H.offsetY,Tr=H.offsetR,Fr=H.offsetB,ir=H.onAlign,Br=H.onPrepare,Xt=H.stretch,Qt=H.targetWidth,bt=H.targetHeight,Jr=typeof Y=="function"?Y():Y,yr=rt||ct,$t=(xt==null?void 0:xt.length)>0,Dt=u.useState(!xt||!$t),sr=n(Dt,2),Qr=sr[0],En=sr[1];if(gt(function(){!Qr&&$t&&Xe&&En(!0)},[Qr,$t,Xe]),!Qr)return null;var Ar="auto",ar={left:"-1000vw",top:"-1000vh",right:Ar,bottom:Ar};if(mr||!rt){var jr,qr=Mt.points,lr=Mt.dynamicInset||((jr=Mt._experimental)===null||jr===void 0?void 0:jr.dynamicInset),Lr=lr&&qr[0][1]==="r",br=lr&&qr[0][0]==="b";Lr?(ar.right=Tr,ar.left=Ar):(ar.left=nr,ar.right=Ar),br?(ar.bottom=Fr,ar.top=Ar):(ar.top=Mr,ar.bottom=Ar)}var rr={};return Xt&&(Xt.includes("height")&&bt?rr.height=bt:Xt.includes("minHeight")&&bt&&(rr.minHeight=bt),Xt.includes("width")&&Qt?rr.width=Qt:Xt.includes("minWidth")&&Qt&&(rr.minWidth=Qt)),rt||(rr.pointerEvents="none"),u.createElement(Ot,{open:Ut||yr,getContainer:xt&&function(){return xt(Xe)},autoDestroy:Bt},u.createElement(Ni,{prefixCls:Re,open:rt,zIndex:ut,mask:Et,motion:Ht}),u.createElement(Ze.Z,{onResize:ir,disabled:!rt},function(Sn){return u.createElement(_r.Z,Zt({motionAppear:!0,motionEnter:!0,motionLeave:!0,removeOnLeave:!1,forceRender:Ut,leavedClassName:"".concat(Re,"-hidden")},wt,{onAppearPrepare:Br,onEnterPrepare:Br,visible:rt,onVisibleChanged:function(ur){var Rr;wt==null||(Rr=wt.onVisibleChanged)===null||Rr===void 0||Rr.call(wt,ur),tt(ur)}}),function(zr,ur){var Rr=zr.className,en=zr.style,qt=Pe()(Re,Rr,oe);return u.createElement("div",{ref:Pt(Sn,$,ur),className:qt,style:P(P(P(P({"--arrow-x":"".concat(dt.x||0,"px"),"--arrow-y":"".concat(dt.y||0,"px")},ar),rr),en),{},{boxSizing:"border-box",zIndex:ut},He),onMouseEnter:vr,onMouseLeave:xr,onPointerEnter:gr,onClick:pt,onPointerDownCapture:Dr},lt&&u.createElement(Bi,{prefixCls:Re,arrow:lt,arrowPos:dt,align:Mt}),u.createElement(Ki,{cache:!rt&&!St},Jr))})}))}),Hi=Wi,ji=u.forwardRef(function(H,$){var Y=H.children,oe=H.getTriggerDOMNode,Re=zt(Y),He=u.useCallback(function(tt){Wt($,oe?oe(tt):tt)},[oe]),Xe=It(He,Fi(Y));return Re?u.cloneElement(Y,{ref:Xe}):Y}),zi=ji,Gi=u.createContext(null),wi=Gi;function xi(H){return H?Array.isArray(H)?H:[H]:[]}function Vi(H,$,Y,oe){return u.useMemo(function(){var Re=xi(Y!=null?Y:$),He=xi(oe!=null?oe:$),Xe=new Set(Re),tt=new Set(He);return H&&(Xe.has("hover")&&(Xe.delete("hover"),Xe.add("click")),tt.has("hover")&&(tt.delete("hover"),tt.add("click"))),[Xe,tt]},[H,$,Y,oe])}var Zi=function(H){if(!H)return!1;if(H instanceof Element){if(H.offsetParent)return!0;if(H.getBBox){var $=H.getBBox(),Y=$.width,oe=$.height;if(Y||oe)return!0}if(H.getBoundingClientRect){var Re=H.getBoundingClientRect(),He=Re.width,Xe=Re.height;if(He||Xe)return!0}}return!1};function Yi(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],$=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Y=arguments.length>2?arguments[2]:void 0;return Y?H[0]===$[0]:H[0]===$[0]&&H[1]===$[1]}function Xi(H,$,Y,oe){for(var Re=Y.points,He=Object.keys(H),Xe=0;Xe<He.length;Xe+=1){var tt,rt=He[Xe];if(Yi((tt=H[rt])===null||tt===void 0?void 0:tt.points,Re,oe))return"".concat($,"-placement-").concat(rt)}return""}function Di(H,$,Y,oe){return $||(Y?{motionName:"".concat(H,"-").concat(Y)}:oe?{motionName:oe}:null)}function mn(H){return H.ownerDocument.defaultView}function Jn(H){for(var $=[],Y=H==null?void 0:H.parentElement,oe=["hidden","scroll","clip","auto"];Y;){var Re=mn(Y).getComputedStyle(Y),He=Re.overflowX,Xe=Re.overflowY,tt=Re.overflow;[He,Xe,tt].some(function(rt){return oe.includes(rt)})&&$.push(Y),Y=Y.parentElement}return $}function yn(H){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:1;return Number.isNaN(H)?$:H}function bn(H){return yn(parseFloat(H),0)}function Ti(H,$){var Y=P({},H);return($||[]).forEach(function(oe){if(!(oe instanceof HTMLBodyElement||oe instanceof HTMLHtmlElement)){var Re=mn(oe).getComputedStyle(oe),He=Re.overflow,Xe=Re.overflowClipMargin,tt=Re.borderTopWidth,rt=Re.borderBottomWidth,ct=Re.borderLeftWidth,St=Re.borderRightWidth,pt=oe.getBoundingClientRect(),Et=oe.offsetHeight,lt=oe.clientHeight,dt=oe.offsetWidth,Mt=oe.clientWidth,wt=bn(tt),Ht=bn(rt),Ut=bn(ct),xt=bn(St),Bt=yn(Math.round(pt.width/dt*1e3)/1e3),Ot=yn(Math.round(pt.height/Et*1e3)/1e3),ut=(dt-Mt-Ut-xt)*Bt,vr=(Et-lt-wt-Ht)*Ot,xr=wt*Ot,gr=Ht*Ot,Dr=Ut*Bt,mr=xt*Bt,nr=0,Mr=0;if(He==="clip"){var Tr=bn(Xe);nr=Tr*Bt,Mr=Tr*Ot}var Fr=pt.x+Dr-nr,ir=pt.y+xr-Mr,Br=Fr+pt.width+2*nr-Dr-mr-ut,Xt=ir+pt.height+2*Mr-xr-gr-vr;Y.left=Math.max(Y.left,Fr),Y.top=Math.max(Y.top,ir),Y.right=Math.min(Y.right,Br),Y.bottom=Math.min(Y.bottom,Xt)}}),Y}function Ai(H){var $=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,Y="".concat($),oe=Y.match(/^(.*)\%$/);return oe?H*(parseFloat(oe[1])/100):parseFloat(Y)}function Li(H,$){var Y=$||[],oe=n(Y,2),Re=oe[0],He=oe[1];return[Ai(H.width,Re),Ai(H.height,He)]}function Ri(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:"";return[H[0],H[1]]}function fn(H,$){var Y=$[0],oe=$[1],Re,He;return Y==="t"?He=H.y:Y==="b"?He=H.y+H.height:He=H.y+H.height/2,oe==="l"?Re=H.x:oe==="r"?Re=H.x+H.width:Re=H.x+H.width/2,{x:Re,y:He}}function Hr(H,$){var Y={t:"b",b:"t",l:"r",r:"l"};return H.map(function(oe,Re){return Re===$?Y[oe]||"c":oe}).join("")}function $i(H,$,Y,oe,Re,He,Xe){var tt=u.useState({ready:!1,offsetX:0,offsetY:0,offsetR:0,offsetB:0,arrowX:0,arrowY:0,scaleX:1,scaleY:1,align:Re[oe]||{}}),rt=n(tt,2),ct=rt[0],St=rt[1],pt=u.useRef(0),Et=u.useMemo(function(){return $?Jn($):[]},[$]),lt=u.useRef({}),dt=function(){lt.current={}};H||dt();var Mt=fe(function(){if($&&Y&&H){let dr=function(gn,Xr){var $r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:Pn,Rn=Dt.x+gn,Yn=Dt.y+Xr,bi=Rn+Lr,Ei=Yn+lr,Si=Math.max(Rn,$r.left),Qe=Math.max(Yn,$r.top),st=Math.min(bi,$r.right),Rt=Math.min(Ei,$r.bottom);return Math.max(0,(st-Si)*(Rt-Qe))},Zn=function(){sn=Dt.y+Lt,an=sn+lr,Ur=Dt.x+Tt,dn=Ur+Lr};var Ut,xt,Bt,Ot,ut=$,vr=ut.ownerDocument,xr=mn(ut),gr=xr.getComputedStyle(ut),Dr=gr.width,mr=gr.height,nr=gr.position,Mr=ut.style.left,Tr=ut.style.top,Fr=ut.style.right,ir=ut.style.bottom,Br=ut.style.overflow,Xt=P(P({},Re[oe]),He),Qt=vr.createElement("div");(Ut=ut.parentElement)===null||Ut===void 0||Ut.appendChild(Qt),Qt.style.left="".concat(ut.offsetLeft,"px"),Qt.style.top="".concat(ut.offsetTop,"px"),Qt.style.position=nr,Qt.style.height="".concat(ut.offsetHeight,"px"),Qt.style.width="".concat(ut.offsetWidth,"px"),ut.style.left="0",ut.style.top="0",ut.style.right="auto",ut.style.bottom="auto",ut.style.overflow="hidden";var bt;if(Array.isArray(Y))bt={x:Y[0],y:Y[1],width:0,height:0};else{var Jr,yr,$t=Y.getBoundingClientRect();$t.x=(Jr=$t.x)!==null&&Jr!==void 0?Jr:$t.left,$t.y=(yr=$t.y)!==null&&yr!==void 0?yr:$t.top,bt={x:$t.x,y:$t.y,width:$t.width,height:$t.height}}var Dt=ut.getBoundingClientRect();Dt.x=(xt=Dt.x)!==null&&xt!==void 0?xt:Dt.left,Dt.y=(Bt=Dt.y)!==null&&Bt!==void 0?Bt:Dt.top;var sr=vr.documentElement,Qr=sr.clientWidth,En=sr.clientHeight,Ar=sr.scrollWidth,ar=sr.scrollHeight,jr=sr.scrollTop,qr=sr.scrollLeft,lr=Dt.height,Lr=Dt.width,br=bt.height,rr=bt.width,Sn={left:0,top:0,right:Qr,bottom:En},zr={left:-qr,top:-jr,right:Ar-qr,bottom:ar-jr},ur=Xt.htmlRegion,Rr="visible",en="visibleFirst";ur!=="scroll"&&ur!==en&&(ur=Rr);var qt=ur===en,ei=Ti(zr,Et),At=Ti(Sn,Et),Pn=ur===Rr?At:ei,tn=qt?At:Pn;ut.style.left="auto",ut.style.top="auto",ut.style.right="0",ut.style.bottom="0";var er=ut.getBoundingClientRect();ut.style.left=Mr,ut.style.top=Tr,ut.style.right=Fr,ut.style.bottom=ir,ut.style.overflow=Br,(Ot=ut.parentElement)===null||Ot===void 0||Ot.removeChild(Qt);var Gr=yn(Math.round(Lr/parseFloat(Dr)*1e3)/1e3),Nr=yn(Math.round(lr/parseFloat(mr)*1e3)/1e3);if(Gr===0||Nr===0||se(Y)&&!Zi(Y))return;var ti=Xt.offset,ri=Xt.targetOffset,On=Li(Dt,ti),Er=n(On,2),Sr=Er[0],cr=Er[1],ni=Li(bt,ri),rn=n(ni,2),fr=rn[0],Vr=rn[1];bt.x-=fr,bt.y-=Vr;var ii=Xt.points||[],kn=n(ii,2),si=kn[0],ai=kn[1],Pr=Ri(ai),or=Ri(si),Cn=fn(bt,Pr),tr=fn(Dt,or),Zr=P({},Xt),Tt=Cn.x-tr.x+Sr,Lt=Cn.y-tr.y+cr,Cr=dr(Tt,Lt),nn=dr(Tt,Lt,At),wn=fn(bt,["t","l"]),hr=fn(Dt,["t","l"]),In=fn(bt,["b","r"]),xn=fn(Dt,["b","r"]),Yr=Xt.overflow||{},Mn=Yr.adjustX,oi=Yr.adjustY,Dn=Yr.shiftX,hn=Yr.shiftY,Tn=function(Xr){return typeof Xr=="boolean"?Xr:Xr>=0},sn,an,Ur,dn;Zn();var on=Tn(oi),Fn=or[0]===Pr[0];if(on&&or[0]==="t"&&(an>tn.bottom||lt.current.bt)){var Gt=Lt;Fn?Gt-=lr-br:Gt=wn.y-xn.y-cr;var Bn=dr(Tt,Gt),li=dr(Tt,Gt,At);Bn>Cr||Bn===Cr&&(!qt||li>=nn)?(lt.current.bt=!0,Lt=Gt,cr=-cr,Zr.points=[Hr(or,0),Hr(Pr,0)]):lt.current.bt=!1}if(on&&or[0]==="b"&&(sn<tn.top||lt.current.tb)){var ln=Lt;Fn?ln+=lr-br:ln=In.y-hr.y-cr;var Nn=dr(Tt,ln),ui=dr(Tt,ln,At);Nn>Cr||Nn===Cr&&(!qt||ui>=nn)?(lt.current.tb=!0,Lt=ln,cr=-cr,Zr.points=[Hr(or,0),Hr(Pr,0)]):lt.current.tb=!1}var Un=Tn(Mn),Kn=or[1]===Pr[1];if(Un&&or[1]==="l"&&(dn>tn.right||lt.current.rl)){var un=Tt;Kn?un-=Lr-rr:un=wn.x-xn.x-Sr;var Wn=dr(un,Lt),pn=dr(un,Lt,At);Wn>Cr||Wn===Cr&&(!qt||pn>=nn)?(lt.current.rl=!0,Tt=un,Sr=-Sr,Zr.points=[Hr(or,1),Hr(Pr,1)]):lt.current.rl=!1}if(Un&&or[1]==="r"&&(Ur<tn.left||lt.current.lr)){var Kr=Tt;Kn?Kr+=Lr-rr:Kr=In.x-hr.x-Sr;var Hn=dr(Kr,Lt),jn=dr(Kr,Lt,At);Hn>Cr||Hn===Cr&&(!qt||jn>=nn)?(lt.current.lr=!0,Tt=Kr,Sr=-Sr,Zr.points=[Hr(or,1),Hr(Pr,1)]):lt.current.lr=!1}Zn();var Or=Dn===!0?0:Dn;typeof Or=="number"&&(Ur<At.left&&(Tt-=Ur-At.left-Sr,bt.x+rr<At.left+Or&&(Tt+=bt.x-At.left+rr-Or)),dn>At.right&&(Tt-=dn-At.right-Sr,bt.x>At.right-Or&&(Tt+=bt.x-At.right+Or)));var wr=hn===!0?0:hn;typeof wr=="number"&&(sn<At.top&&(Lt-=sn-At.top-cr,bt.y+br<At.top+wr&&(Lt+=bt.y-At.top+br-wr)),an>At.bottom&&(Lt-=an-At.bottom-cr,bt.y>At.bottom-wr&&(Lt+=bt.y-At.bottom+wr)));var _n=Dt.x+Tt,vn=_n+Lr,kr=Dt.y+Lt,ci=kr+lr,zn=bt.x,fi=zn+rr,An=bt.y,hi=An+br,di=Math.max(_n,zn),pi=Math.min(vn,fi),Gn=(di+pi)/2,_i=Gn-_n,vi=Math.max(kr,An),Vn=Math.min(ci,hi),gi=(vi+Vn)/2,mi=gi-kr;Xe==null||Xe($,Zr);var Ln=er.right-Dt.x-(Tt+Dt.width),Ir=er.bottom-Dt.y-(Lt+Dt.height);Gr===1&&(Tt=Math.round(Tt),Ln=Math.round(Ln)),Nr===1&&(Lt=Math.round(Lt),Ir=Math.round(Ir));var yi={ready:!0,offsetX:Tt/Gr,offsetY:Lt/Nr,offsetR:Ln/Gr,offsetB:Ir/Nr,arrowX:_i/Gr,arrowY:mi/Nr,scaleX:Gr,scaleY:Nr,align:Zr};St(yi)}}),wt=function(){pt.current+=1;var xt=pt.current;Promise.resolve().then(function(){pt.current===xt&&Mt()})},Ht=function(){St(function(xt){return P(P({},xt),{},{ready:!1})})};return gt(Ht,[oe]),gt(function(){H||Ht()},[H]),[ct.ready,ct.offsetX,ct.offsetY,ct.offsetR,ct.offsetB,ct.arrowX,ct.arrowY,ct.scaleX,ct.scaleY,ct.align,wt]}function Ji(H){if(Array.isArray(H))return e(H)}function Qi(H){if(typeof Symbol!="undefined"&&H[Symbol.iterator]!=null||H["@@iterator"]!=null)return Array.from(H)}function qi(){throw new TypeError(`Invalid attempt to spread non-iterable instance.
In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Pi(H){return Ji(H)||Qi(H)||E(H)||qi()}function es(H,$,Y,oe,Re){gt(function(){if(H&&$&&Y){let pt=function(){oe(),Re()};var He=$,Xe=Y,tt=Jn(He),rt=Jn(Xe),ct=mn(Xe),St=new Set([ct].concat(Pi(tt),Pi(rt)));return St.forEach(function(Et){Et.addEventListener("scroll",pt,{passive:!0})}),ct.addEventListener("resize",pt,{passive:!0}),oe(),function(){St.forEach(function(Et){Et.removeEventListener("scroll",pt),ct.removeEventListener("resize",pt)})}}},[H,$,Y])}var Qn={},ts=[],rs=function($){ts.push($)};function ns(H,$){if(0)var Y}function is(H,$){if(0)var Y}function ss(){Qn={}}function Oi(H,$,Y){!$&&!Qn[Y]&&(H(!1,Y),Qn[Y]=!0)}function qn(H,$){Oi(ns,H,$)}function as(H,$){Oi(is,H,$)}qn.preMessage=rs,qn.resetWarned=ss,qn.noteOnce=as;var hs=null;function os(H,$,Y,oe,Re,He,Xe,tt){var rt=u.useRef(H);rt.current=H;var ct=u.useRef(!1);u.useEffect(function(){if($&&oe&&(!Re||He)){var pt=function(){ct.current=!1},Et=function(Bt){var Ot;rt.current&&!Xe(((Ot=Bt.composedPath)===null||Ot===void 0||(Ot=Ot.call(Bt))===null||Ot===void 0?void 0:Ot[0])||Bt.target)&&!ct.current&&tt(!1)},lt=mn(oe);lt.addEventListener("pointerdown",pt,!0),lt.addEventListener("mousedown",Et,!0),lt.addEventListener("contextmenu",Et,!0);var dt=q(Y);if(dt&&(dt.addEventListener("mousedown",Et,!0),dt.addEventListener("contextmenu",Et,!0)),0)var Mt,wt,Ht,Ut;return function(){lt.removeEventListener("pointerdown",pt,!0),lt.removeEventListener("mousedown",Et,!0),lt.removeEventListener("contextmenu",Et,!0),dt&&(dt.removeEventListener("mousedown",Et,!0),dt.removeEventListener("contextmenu",Et,!0))}}},[$,Y,oe,Re,He]);function St(){ct.current=!0}return St}var ls=["prefixCls","children","action","showAction","hideAction","popupVisible","defaultPopupVisible","onPopupVisibleChange","afterPopupVisibleChange","mouseEnterDelay","mouseLeaveDelay","focusDelay","blurDelay","mask","maskClosable","getPopupContainer","forceRender","autoDestroy","destroyPopupOnHide","popup","popupClassName","popupStyle","popupPlacement","builtinPlacements","popupAlign","zIndex","stretch","getPopupClassNameFromAlign","fresh","alignPoint","onPopupClick","onPopupAlign","arrow","popupMotion","maskMotion","popupTransitionName","popupAnimation","maskTransitionName","maskAnimation","className","getTriggerDOMNode"];function us(){var H=arguments.length>0&&arguments[0]!==void 0?arguments[0]:je,$=u.forwardRef(function(Y,oe){var Re=Y.prefixCls,He=Re===void 0?"rc-trigger-popup":Re,Xe=Y.children,tt=Y.action,rt=tt===void 0?"hover":tt,ct=Y.showAction,St=Y.hideAction,pt=Y.popupVisible,Et=Y.defaultPopupVisible,lt=Y.onPopupVisibleChange,dt=Y.afterPopupVisibleChange,Mt=Y.mouseEnterDelay,wt=Y.mouseLeaveDelay,Ht=wt===void 0?.1:wt,Ut=Y.focusDelay,xt=Y.blurDelay,Bt=Y.mask,Ot=Y.maskClosable,ut=Ot===void 0?!0:Ot,vr=Y.getPopupContainer,xr=Y.forceRender,gr=Y.autoDestroy,Dr=Y.destroyPopupOnHide,mr=Y.popup,nr=Y.popupClassName,Mr=Y.popupStyle,Tr=Y.popupPlacement,Fr=Y.builtinPlacements,ir=Fr===void 0?{}:Fr,Br=Y.popupAlign,Xt=Y.zIndex,Qt=Y.stretch,bt=Y.getPopupClassNameFromAlign,Jr=Y.fresh,yr=Y.alignPoint,$t=Y.onPopupClick,Dt=Y.onPopupAlign,sr=Y.arrow,Qr=Y.popupMotion,En=Y.maskMotion,Ar=Y.popupTransitionName,ar=Y.popupAnimation,jr=Y.maskTransitionName,qr=Y.maskAnimation,lr=Y.className,Lr=Y.getTriggerDOMNode,br=r(Y,ls),rr=gr||Dr||!1,Sn=u.useState(!1),zr=n(Sn,2),ur=zr[0],Rr=zr[1];gt(function(){Rr(Jt())},[]);var en=u.useRef({}),qt=u.useContext(wi),ei=u.useMemo(function(){return{registerSubPopup:function(st,Rt){en.current[st]=Rt,qt==null||qt.registerSubPopup(st,Rt)}}},[qt]),At=ht(),Pn=u.useState(null),tn=n(Pn,2),er=tn[0],Gr=tn[1],Nr=u.useRef(null),ti=fe(function(Qe){Nr.current=Qe,se(Qe)&&er!==Qe&&Gr(Qe),qt==null||qt.registerSubPopup(At,Qe)}),ri=u.useState(null),On=n(ri,2),Er=On[0],Sr=On[1],cr=u.useRef(null),ni=fe(function(Qe){se(Qe)&&Er!==Qe&&(Sr(Qe),cr.current=Qe)}),rn=u.Children.only(Xe),fr=(rn==null?void 0:rn.props)||{},Vr={},ii=fe(function(Qe){var st,Rt,Kt=Er;return(Kt==null?void 0:Kt.contains(Qe))||((st=q(Kt))===null||st===void 0?void 0:st.host)===Qe||Qe===Kt||(er==null?void 0:er.contains(Qe))||((Rt=q(er))===null||Rt===void 0?void 0:Rt.host)===Qe||Qe===er||Object.values(en.current).some(function(kt){return(kt==null?void 0:kt.contains(Qe))||Qe===kt})}),kn=Di(He,Qr,ar,Ar),si=Di(He,En,qr,jr),ai=u.useState(Et||!1),Pr=n(ai,2),or=Pr[0],Cn=Pr[1],tr=pt!=null?pt:or,Zr=fe(function(Qe){pt===void 0&&Cn(Qe)});gt(function(){Cn(pt||!1)},[pt]);var Tt=u.useRef(tr);Tt.current=tr;var Lt=u.useRef([]);Lt.current=[];var Cr=fe(function(Qe){var st;Zr(Qe),((st=Lt.current[Lt.current.length-1])!==null&&st!==void 0?st:tr)!==Qe&&(Lt.current.push(Qe),lt==null||lt(Qe))}),nn=u.useRef(),wn=function(){clearTimeout(nn.current)},hr=function(st){var Rt=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0;wn(),Rt===0?Cr(st):nn.current=setTimeout(function(){Cr(st)},Rt*1e3)};u.useEffect(function(){return wn},[]);var In=u.useState(!1),xn=n(In,2),Yr=xn[0],Mn=xn[1];gt(function(Qe){(!Qe||tr)&&Mn(!0)},[tr]);var oi=u.useState(null),Dn=n(oi,2),hn=Dn[0],Tn=Dn[1],sn=u.useState(null),an=n(sn,2),Ur=an[0],dn=an[1],on=function(st){dn([st.clientX,st.clientY])},Fn=$i(tr,er,yr&&Ur!==null?Ur:Er,Tr,ir,Br,Dt),Gt=n(Fn,11),Bn=Gt[0],li=Gt[1],ln=Gt[2],Nn=Gt[3],ui=Gt[4],Un=Gt[5],Kn=Gt[6],un=Gt[7],Wn=Gt[8],pn=Gt[9],Kr=Gt[10],Hn=Vi(ur,rt,ct,St),jn=n(Hn,2),Or=jn[0],wr=jn[1],_n=Or.has("click"),vn=wr.has("click")||wr.has("contextMenu"),kr=fe(function(){Yr||Kr()}),ci=function(){Tt.current&&yr&&vn&&hr(!1)};es(tr,Er,er,kr,ci),gt(function(){kr()},[Ur,Tr]),gt(function(){tr&&!(ir!=null&&ir[Tr])&&kr()},[JSON.stringify(Br)]);var zn=u.useMemo(function(){var Qe=Xi(ir,He,pn,yr);return Pe()(Qe,bt==null?void 0:bt(pn))},[pn,bt,ir,He,yr]);u.useImperativeHandle(oe,function(){return{nativeElement:cr.current,popupElement:Nr.current,forceAlign:kr}});var fi=u.useState(0),An=n(fi,2),hi=An[0],di=An[1],pi=u.useState(0),Gn=n(pi,2),_i=Gn[0],vi=Gn[1],Vn=function(){if(Qt&&Er){var st=Er.getBoundingClientRect();di(st.width),vi(st.height)}},gi=function(){Vn(),kr()},mi=function(st){Mn(!1),Kr(),dt==null||dt(st)},Ln=function(){return new Promise(function(st){Vn(),Tn(function(){return st})})};gt(function(){hn&&(Kr(),hn(),Tn(null))},[hn]);function Ir(Qe,st,Rt,Kt){Vr[Qe]=function(kt){var Xn;Kt==null||Kt(kt),hr(st,Rt);for(var Ci=arguments.length,ki=new Array(Ci>1?Ci-1:0),$n=1;$n<Ci;$n++)ki[$n-1]=arguments[$n];(Xn=fr[Qe])===null||Xn===void 0||Xn.call.apply(Xn,[fr,kt].concat(ki))}}(_n||vn)&&(Vr.onClick=function(Qe){var st;Tt.current&&vn?hr(!1):!Tt.current&&_n&&(on(Qe),hr(!0));for(var Rt=arguments.length,Kt=new Array(Rt>1?Rt-1:0),kt=1;kt<Rt;kt++)Kt[kt-1]=arguments[kt];(st=fr.onClick)===null||st===void 0||st.call.apply(st,[fr,Qe].concat(Kt))});var yi=os(tr,vn,Er,er,Bt,ut,ii,hr),dr=Or.has("hover"),Zn=wr.has("hover"),gn,Xr;dr&&(Ir("onMouseEnter",!0,Mt,function(Qe){on(Qe)}),Ir("onPointerEnter",!0,Mt,function(Qe){on(Qe)}),gn=function(st){(tr||Yr)&&er!==null&&er!==void 0&&er.contains(st.target)&&hr(!0,Mt)},yr&&(Vr.onMouseMove=function(Qe){var st;(st=fr.onMouseMove)===null||st===void 0||st.call(fr,Qe)})),Zn&&(Ir("onMouseLeave",!1,Ht),Ir("onPointerLeave",!1,Ht),Xr=function(){hr(!1,Ht)}),Or.has("focus")&&Ir("onFocus",!0,Ut),wr.has("focus")&&Ir("onBlur",!1,xt),Or.has("contextMenu")&&(Vr.onContextMenu=function(Qe){var st;Tt.current&&wr.has("contextMenu")?hr(!1):(on(Qe),hr(!0)),Qe.preventDefault();for(var Rt=arguments.length,Kt=new Array(Rt>1?Rt-1:0),kt=1;kt<Rt;kt++)Kt[kt-1]=arguments[kt];(st=fr.onContextMenu)===null||st===void 0||st.call.apply(st,[fr,Qe].concat(Kt))}),lr&&(Vr.className=Pe()(fr.className,lr));var $r=P(P({},fr),Vr),Rn={},Yn=["onContextMenu","onClick","onMouseDown","onTouchStart","onMouseEnter","onMouseLeave","onFocus","onBlur"];Yn.forEach(function(Qe){br[Qe]&&(Rn[Qe]=function(){for(var st,Rt=arguments.length,Kt=new Array(Rt),kt=0;kt<Rt;kt++)Kt[kt]=arguments[kt];(st=$r[Qe])===null||st===void 0||st.call.apply(st,[$r].concat(Kt)),br[Qe].apply(br,Kt)})});var bi=u.cloneElement(rn,P(P({},$r),Rn)),Ei={x:Un,y:Kn},Si=sr?P({},sr!==!0?sr:{}):null;return u.createElement(u.Fragment,null,u.createElement(Ze.Z,{disabled:!tr,ref:ni,onResize:gi},u.createElement(zi,{getTriggerDOMNode:Lr},bi)),u.createElement(wi.Provider,{value:ei},u.createElement(Hi,{portal:H,ref:ti,prefixCls:He,popup:mr,className:Pe()(nr,zn),style:Mr,target:Er,onMouseEnter:gn,onMouseLeave:Xr,onPointerEnter:gn,zIndex:Xt,open:tr,keepDom:Yr,fresh:Jr,onClick:$t,onPointerDownCapture:yi,mask:Bt,motion:kn,maskMotion:si,onVisibleChanged:mi,onPrepare:Ln,forceRender:xr,autoDestroy:rr,getPopupContainer:vr,align:pn,arrow:Si,arrowPos:Ei,ready:Bn,offsetX:li,offsetY:ln,offsetR:Nn,offsetB:ui,onAlign:kr,stretch:Qt,targetWidth:hi/un,targetHeight:_i/Wn})))});return $}var cs=us(je)},31632:function(Ge,re){"use strict";var M;var N=typeof Symbol=="function"&&Symbol.for,B=N?Symbol.for("react.element"):60103,U=N?Symbol.for("react.portal"):60106,k=N?Symbol.for("react.fragment"):60107,S=N?Symbol.for("react.strict_mode"):60108,P=N?Symbol.for("react.profiler"):60114,T=N?Symbol.for("react.provider"):60109,b=N?Symbol.for("react.context"):60110,e=N?Symbol.for("react.async_mode"):60111,E=N?Symbol.for("react.concurrent_mode"):60111,s=N?Symbol.for("react.forward_ref"):60112,n=N?Symbol.for("react.suspense"):60113,t=N?Symbol.for("react.suspense_list"):60120,r=N?Symbol.for("react.memo"):60115,i=N?Symbol.for("react.lazy"):60116,a=N?Symbol.for("react.block"):60121,v=N?Symbol.for("react.fundamental"):60117,p=N?Symbol.for("react.responder"):60118,l=N?Symbol.for("react.scope"):60119;function o(c){if(typeof c=="object"&&c!==null){var _=c.$$typeof;switch(_){case B:switch(c=c.type,c){case e:case E:case k:case P:case S:case n:return c;default:switch(c=c&&c.$$typeof,c){case b:case s:case i:case r:case T:return c;default:return _}}case U:return _}}}function u(c){return o(c)===E}M=e,M=E,M=b,M=T,M=B,M=s,M=k,M=i,M=r,M=U,M=P,M=S,M=n,M=function(c){return u(c)||o(c)===e},M=u,M=function(c){return o(c)===b},M=function(c){return o(c)===T},M=function(c){return typeof c=="object"&&c!==null&&c.$$typeof===B},M=function(c){return o(c)===s},M=function(c){return o(c)===k},M=function(c){return o(c)===i},re.isMemo=function(c){return o(c)===r},M=function(c){return o(c)===U},M=function(c){return o(c)===P},M=function(c){return o(c)===S},M=function(c){return o(c)===n},M=function(c){return typeof c=="string"||typeof c=="function"||c===k||c===E||c===P||c===S||c===n||c===t||typeof c=="object"&&c!==null&&(c.$$typeof===i||c.$$typeof===r||c.$$typeof===T||c.$$typeof===b||c.$$typeof===s||c.$$typeof===v||c.$$typeof===p||c.$$typeof===l||c.$$typeof===a)},M=o},81640:function(Ge,re,M){"use strict";Ge.exports=M(31632)},48482:function(Ge,re){"use strict";var M;var N=Symbol.for("react.element"),B=Symbol.for("react.portal"),U=Symbol.for("react.fragment"),k=Symbol.for("react.strict_mode"),S=Symbol.for("react.profiler"),P=Symbol.for("react.provider"),T=Symbol.for("react.context"),b=Symbol.for("react.server_context"),e=Symbol.for("react.forward_ref"),E=Symbol.for("react.suspense"),s=Symbol.for("react.suspense_list"),n=Symbol.for("react.memo"),t=Symbol.for("react.lazy"),r=Symbol.for("react.offscreen"),i;i=Symbol.for("react.module.reference");function a(v){if(typeof v=="object"&&v!==null){var p=v.$$typeof;switch(p){case N:switch(v=v.type,v){case U:case S:case k:case E:case s:return v;default:switch(v=v&&v.$$typeof,v){case b:case T:case e:case t:case n:case P:return v;default:return p}}case B:return p}}}M=T,M=P,M=N,re.ForwardRef=e,M=U,M=t,M=n,M=B,M=S,M=k,M=E,M=s,M=function(){return!1},M=function(){return!1},M=function(v){return a(v)===T},M=function(v){return a(v)===P},M=function(v){return typeof v=="object"&&v!==null&&v.$$typeof===N},M=function(v){return a(v)===e},M=function(v){return a(v)===U},M=function(v){return a(v)===t},re.isMemo=function(v){return a(v)===n},M=function(v){return a(v)===B},M=function(v){return a(v)===S},M=function(v){return a(v)===k},M=function(v){return a(v)===E},M=function(v){return a(v)===s},M=function(v){return typeof v=="string"||typeof v=="function"||v===U||v===S||v===k||v===E||v===s||v===r||typeof v=="object"&&v!==null&&(v.$$typeof===t||v.$$typeof===n||v.$$typeof===P||v.$$typeof===T||v.$$typeof===e||v.$$typeof===i||v.getModuleId!==void 0)},M=a},52481:function(Ge,re,M){"use strict";Ge.exports=M(48482)},77969:function(Ge,re){"use strict";re.Z={header:"header___HqHSe",checkboxs:"checkboxs___ObBnD",field:"field___w_sM6","oj-form-container":"oj-form-container____odYP","oj-left-panel":"oj-left-panel___emEB2","oj-form-info":"oj-form-info___m00Ag",footer:"footer___O4iSJ",collapse:"collapse___Ltfkj","test-case-name":"test-case-name___miZcb","btn-remove-case":"btn-remove-case___cHap2","icon-tag":"icon-tag___gmyTb",btn_back:"btn_back___tNmX3",testJi:"testJi___L3fHb",upBtn:"upBtn___RGH6X",djs:"djs____TS0n",time:"time___IAdHc"}},26194:function(Ge,re,M){"use strict";var N=M(67294),B=M(4977),U=M(85804),k=Object.defineProperty,S=Object.defineProperties,P=Object.getOwnPropertyDescriptors,T=Object.getOwnPropertySymbols,b=Object.prototype.hasOwnProperty,e=Object.prototype.propertyIsEnumerable,E=(r,i,a)=>i in r?k(r,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):r[i]=a,s=(r,i)=>{for(var a in i||(i={}))b.call(i,a)&&E(r,a,i[a]);if(T)for(var a of T(i))e.call(i,a)&&E(r,a,i[a]);return r},n=(r,i)=>S(r,P(i));const t=({img:r,buttonProps:i={},styles:a={},customText:v,ButtonText:p,ButtonClick:l,Buttonclass:o,ButtonTwo:u,imgStyles:c,loading:_=!1,className:y=""})=>N.createElement("section",{className:`tc animated fadeIn ${y}`,style:s({color:"#999",margin:"100px auto",visibility:_?"hidden":"visible"},a)},N.createElement("img",{src:r||B,style:n(s({},c),{pointerEvents:"none",userSelect:"none"})}),N.createElement("p",{className:"mt20 font14"},v||"\u6682\u65F6\u8FD8\u6CA1\u6709\u76F8\u5173\u6570\u636E\u54E6!"),p&&N.createElement(U.ZP,s({className:o,onClick:l},i),p),u&&u);re.Z=t},20819:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return o}});var N=M(67294),B={wrp:"wrp___dq7YK",bgBlack:"bgBlack___ARIUV",monaco:"monaco___VnZC3",darkBlue:"darkBlue___UprA9",close:"close___LKoWu",embed:"embed___hvpEJ"},U=M(85804),k=M(30153),S=M(36295),P=M(83062),T=M(28706),b=M(15835),e=M(26194),E=M(11320),s=M(66540),n=M(67294),t=Object.defineProperty,r=Object.getOwnPropertySymbols,i=Object.prototype.hasOwnProperty,a=Object.prototype.propertyIsEnumerable,v=(u,c,_)=>c in u?t(u,c,{enumerable:!0,configurable:!0,writable:!0,value:_}):u[c]=_,p=(u,c)=>{for(var _ in c||(c={}))i.call(c,_)&&v(u,_,c[_]);if(r)for(var _ of r(c))a.call(c,_)&&v(u,_,c[_]);return u},l=(u,c,_)=>new Promise((y,f)=>{var C=O=>{try{R(_.next(O))}catch(g){f(g)}},L=O=>{try{R(_.throw(O))}catch(g){f(g)}},R=O=>O.done?y(O.value):Promise.resolve(O.value).then(C,L);R((_=_.apply(u,c)).next())}),o=({editOffice:u="view",data:c,issaver:_,onSaver:y,theme:f,type:C,filename:L,monacoEditor:R,className:O,style:g,close:m,onClose:d,hasMask:h,disabledDownload:A,onImgDimensions:w,showNodata:x,recordInfo:D})=>{const[I,F]=(0,N.useState)("https://view.officeapps.live.com/op/view.aspx?src=http://testgs.educoder.net//rails/active_storage/blobs/eyJfcmFpbHMiOnsibWVzc2FnZSI6IkJBaHBCZz09IiwiZXhwIjpudWxsLCJwdXIiOiJibG9iX2lkIn19--03541f6234b93d7ac3b2d84e7eb0e6594a952945/1.ppt"),[K,W]=(0,N.useState)(""),[z,j]=(0,N.useState)(),G=window.ENV==="build"?"/react/build":"",Z=location.host.startsWith("localhost")?E.Z.PROXY_SERVER:E.Z.API_SERVER,ue=10*(1024*1024),ee=(0,N.useRef)();c!=null&&c.startsWith("/api")&&C!=="txt"&&(c=E.Z.API_SERVER+c);const ae=he=>he.substring(he.lastIndexOf("/")+1).split(".").pop();L&&R&&(R.filename=L),(0,N.useEffect)(()=>{var he,Se;const Te=(Se=(he=document.cookie)==null?void 0:he.replace(/\s/g,""))==null?void 0:Se.split(";");Te==null||Te.map(ke=>{let X=ke.split("=");X[0]==="_educoder_session"&&W(X[1])})},[]),(0,N.useEffect)(()=>{C==="office"&&(c.indexOf("bigfilescdn.")>-1||c.indexOf("bigfiles1")>-1?j({url:c,fileType:ae(c),model:c.indexOf("model=edit")?"edit":"view"}):xe())},[C,c]);function _e(he){return l(this,null,function*(){he.data.type==="pdfdata"&&(y(he.data.data),window.removeEventListener("message",_e,!1)),console.log("mess---:",he.data)})}const xe=()=>l(void 0,null,function*(){console.log("data:",c);let he=c;c.startsWith("http")||(he=location.origin+he);let Se=new URL(he).pathname.split("/").pop();const Te=yield(0,b.gJ)({attachment_id:Se});Te.url=Z+Te.url,j(Te)}),ge=()=>{if(c.startsWith("http")||c.startsWith("blob:")){ce();return}(0,T.Sv)(L||"educoder",c,L)},ce=()=>{D&&(0,s.fc)({id:D==null?void 0:D.id,watch_type:1,course_id:D==null?void 0:D.course_id}),(0,T.Nd)(L||"educoder",decodeURIComponent(c))};return n.createElement("div",{style:p({},g||{}),className:`${h&&B.bgBlack} ${C?B.wrp:"hide"}`},m&&n.createElement("div",{className:B.close,ref:ee},!!w&&n.createElement(P.Z,{title:"\u70B9\u51FB\u5BF9\u56FE\u7247\u8FDB\u884C\u6279\u6CE8",getPopupContainer:()=>ee.current},n.createElement("span",{onClick:()=>{d(),w()}},n.createElement("i",{className:"icon-yulanpizhu"}))),!A&&n.createElement(P.Z,{title:"\u70B9\u51FB\u4E0B\u8F7D\u6B64\u6587\u4EF6",getPopupContainer:()=>ee.current},n.createElement("span",{onClick:ce},n.createElement("i",{className:"icon-quxiaozhiding"}))),_&&n.createElement(P.Z,{title:"\u4FDD\u5B58pdf\u5E76\u9000\u51FA",getPopupContainer:()=>ee.current},n.createElement("span",{className:"",onClick:()=>{const he=document.getElementById("pdfiframe");window.addEventListener("message",_e,!1),setTimeout(()=>{he.contentWindow.postMessage("getData","*")},300)}},n.createElement("i",{className:"icon-baocun"}))),n.createElement(P.Z,{title:"\u5173\u95ED",getPopupContainer:()=>ee.current},n.createElement("span",{className:"",onClick:()=>{d()}},n.createElement("i",{className:"icon-guanbi1"})))),n.createElement("div",{className:`${B[O]} ${O} ${B.monaco} ${C==="txt"?"show":"hide"}`},C==="txt"&&n.createElement(n.Fragment,null,n.createElement(S.ZP,p({},R)))),C==="audio"&&n.createElement("audio",{src:`${(c==null?void 0:c.indexOf("http://"))>-1||(c==null?void 0:c.indexOf("https://"))>-1?"":"data:audio/mp3;base64,"}${c}`,autoPlay:!0}),C==="video"&&n.createElement(n.Fragment,null,(c==null?void 0:c.indexOf("http"))>-1?n.createElement("video",{controls:!0,src:`${c}`,autoPlay:!0}):n.createElement("video",{controls:!0,src:`data:video/mp4;base64,${c}`,autoPlay:!0})),C==="office"&&z&&n.createElement("iframe",{src:`${G}/office.html?key=${z.key}&url=${btoa(z.url)}&callbackUrl=${Z+(z.callbackUrl||"")}&fileType=${z.fileType}&title=${z.title||""}&model=${u}&officeServer=${E.Z.ONLYOFFICE}&disabledDownload=${!!A}`}),C==="html"&&n.createElement("iframe",{src:c+"&disposition=inline"}),C==="pdf"&&n.createElement("iframe",{id:"pdfiframe",src:`${G}/js/pdfview/index.html?filename=${L||"educoder.pdf"}&url=${encodeURIComponent(c)}&disabledDownload=${!!A}&model=${u}`}),C==="image"&&n.createElement("img",{src:`${(c==null?void 0:c.indexOf("http://"))>-1||(c==null?void 0:c.indexOf("https://"))>-1?"":"data:image/png;base64,"}${c}`}),(C==="other"||C==="download")&&n.createElement(n.Fragment,null,x?n.createElement(e.Z,{customText:"\u5F53\u524D\u6587\u4EF6\u4E0D\u652F\u6301\u9884\u89C8\uFF0C\u53EF\u70B9\u51FB\u4E0B\u8F7D\u67E5\u770B",ButtonTwo:n.createElement(U.ZP,{icon:n.createElement("i",{className:"iconfont icon-xiazai4 font14"}),type:"primary",size:"middle",onClick:ge,disabled:A},"\u4E0B\u8F7D")}):n.createElement(U.ZP,{type:"primary",size:"middle",onClick:ge,disabled:A},n.createElement(k.Z,null),"\u70B9\u51FB\u4E0B\u8F7D")))}},65226:function(Ge,re,M){"use strict";M.d(re,{z:function(){return C},Z:function(){return L}});var N=M(67294),B=M(81897),U=M(51161),k=M(11771),S=M(67631),P=M.n(S),T=M(11320),b=M(28706),e=M(20527),E=M(25934),s=M(20819),n=M(67294),r=({html:R})=>{const O=(0,N.useRef)(null),g=(0,N.useRef)(null),m=`.markdown-body p {
margin: 0 0 16px 0 !important;
line-height: 28px;
white-space: pre-wrap;
}
ol,
ul,
li {
list-style-type: none
}
ol,
ul,
dl {
margin-bottom: 0px;
}
.markdown-body {
-ms-text-size-adjust: 100%;
-webkit-text-size-adjust: 100%;
color: #333;
overflow: hidden;
font-family: "Microsoft YaHei", Helvetica, "Meiryo UI", "Malgun Gothic", "Segoe UI", "Trebuchet MS", "Monaco", monospace, Tahoma, STXihei, "\u534E\u6587\u7EC6\u9ED1", STHeiti, "Helvetica Neue", "Droid Sans", "wenquanyi micro hei", FreeSans, Arimo, Arial, SimSun, "\u5B8B\u4F53", Heiti, "\u9ED1\u4F53", sans-serif;
word-break: break-word;
font-size: 16px;
line-height: 1.6;
white-space: normal;
word-wrap: break-word;
position: relative;
}
.markdown-body ul>li {
list-style-type: disc;
}
.markdown-body ol>li {
list-style-type: decimal;
}
.markdown-body a {
background: transparent;
}
.markdown-body a:active,
.markdown-body a:hover {
outline: 0;
}
.markdown-body strong {
font-weight: bold;
}
.markdown-body h1 {
font-size: 2em;
margin: 0.67em 0;
}
.markdown-body img {
border: 0;
}
.markdown-body hr {
-moz-box-sizing: content-box;
box-sizing: content-box;
height: 0;
}
.markdown-body pre {
overflow: auto;
}
.markdown-body code,
.markdown-body kbd,
.markdown-body pre {
font-family: "Meiryo UI", "YaHei Consolas Hybrid", Consolas, "Malgun Gothic", "Segoe UI", "Trebuchet MS", Helvetica, monospace, monospace;
font-size: 1em;
}
.markdown-body input {
color: inherit;
font: inherit;
margin: 0;
}
.markdown-body html input[disabled] {
cursor: default;
}
.markdown-body input {
line-height: normal;
}
.markdown-body input[type="checkbox"] {
-moz-box-sizing: border-box;
box-sizing: border-box;
padding: 0;
}
.markdown-body table {
border-collapse: collapse;
border-spacing: 0;
}
.markdown-body td,
.markdown-body th {
padding: 0;
}
.markdown-body * {
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body input {
font: 13px/1.4 Helvetica, arial, freesans, clean, sans-serif, "Segoe UI Emoji", "Segoe UI Symbol";
}
.markdown-body a {
color: #4183c4;
text-decoration: none;
}
.markdown-body a:hover,
.markdown-body a:active {
text-decoration: underline;
}
.markdown-body hr {
height: 0;
margin: 15px 0;
overflow: hidden;
background: transparent;
border: 0;
border-bottom: 1px solid #ddd;
}
.markdown-body hr:before {
display: table;
content: "";
}
.markdown-body hr:after {
display: table;
clear: both;
content: "";
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
margin-top: 15px;
margin-bottom: 15px;
line-height: 1.1;
}
.markdown-body h1 {
font-size: 30px;
}
.markdown-body h2 {
font-size: 21px;
}
.markdown-body h3 {
font-size: 16px;
}
.markdown-body h4 {
font-size: 14px;
}
.markdown-body h5 {
font-size: 12px;
}
.markdown-body h6 {
font-size: 11px;
}
.markdown-body blockquote {
margin: 0;
}
.markdown-body ul,
.markdown-body ol {
padding: 0;
margin-top: 0;
margin-bottom: 0;
}
ul.linenums,
ol.linenums {
padding: 16px 0 0 56px !important;
}
.markdown-body ul,
.markdown-body ol {
padding-left: 2em;
}
.markdown-body ol ol,
.markdown-body ul ol {
list-style-type: lower-roman;
}
.markdown-body ul ul ol,
.markdown-body ul ol ol,
.markdown-body ol ul ol,
.markdown-body ol ol ol {
list-style-type: lower-alpha;
}
.markdown-body dd {
margin-left: 0;
}
.markdown-body code {
font-family: Consolas, "Liberation Mono", Menlo, Courier, monospace;
font-size: 12px;
}
.markdown-body pre {
margin-top: 0;
margin-bottom: 0;
font: 12px Consolas, "Liberation Mono", Menlo, Courier, monospace;
}
.markdown-body .octicon {
font: normal normal 16px octicons-anchor;
line-height: 1;
display: inline-block;
text-decoration: none;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
-webkit-user-select: none;
-moz-user-select: none;
-ms-user-select: none;
user-select: none;
}
.markdown-body .octicon-link:before {
content: '\f05c';
}
.markdown-body>*:first-child {
margin-top: 0 !important;
}
.markdown-body>*:last-child {
margin-bottom: 0 !important;
}
.markdown-body .anchor {
position: absolute;
top: 0;
left: 0;
display: block;
padding-right: 6px;
padding-left: 30px;
margin-left: -30px;
}
.markdown-body .anchor:focus {
outline: none;
}
.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
position: relative;
margin-top: 1em;
margin-bottom: 16px;
font-weight: bold;
line-height: 1.4;
}
.markdown-body h1 .octicon-link,
.markdown-body h2 .octicon-link,
.markdown-body h3 .octicon-link,
.markdown-body h4 .octicon-link,
.markdown-body h5 .octicon-link,
.markdown-body h6 .octicon-link {
display: none;
color: #000;
vertical-align: middle;
}
.markdown-body h1:hover .anchor,
.markdown-body h2:hover .anchor,
.markdown-body h3:hover .anchor,
.markdown-body h4:hover .anchor,
.markdown-body h5:hover .anchor,
.markdown-body h6:hover .anchor {
padding-left: 8px;
margin-left: -30px;
text-decoration: none;
}
.markdown-body h1:hover .anchor .octicon-link,
.markdown-body h2:hover .anchor .octicon-link,
.markdown-body h3:hover .anchor .octicon-link,
.markdown-body h4:hover .anchor .octicon-link,
.markdown-body h5:hover .anchor .octicon-link,
.markdown-body h6:hover .anchor .octicon-link {
display: inline-block;
}
.markdown-body h1 {
padding-bottom: 0.3em;
font-size: 2.25em;
line-height: 1.2;
border-bottom: 1px solid #eee;
}
.markdown-body h1 .anchor {
line-height: 1;
}
.markdown-body h2 {
padding-bottom: 0.3em;
font-size: 1.75em;
line-height: 1.225;
border-bottom: 1px solid #eee;
}
.markdown-body h2 .anchor {
line-height: 1;
}
.markdown-body h3 {
font-size: 1.5em;
line-height: 1.43;
}
.markdown-body h3 .anchor {
line-height: 1.2;
}
.markdown-body h4 {
font-size: 1.25em;
}
.markdown-body h4 .anchor {
line-height: 1.2;
}
.markdown-body h5 {
font-size: 1em;
}
.markdown-body h5 .anchor {
line-height: 1.1;
}
.markdown-body h6 {
font-size: 1em;
color: #777;
}
.markdown-body h6 .anchor {
line-height: 1.1;
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}
.markdown-body ul ul,
.markdown-body ul ol,
.markdown-body ol ol,
.markdown-body ol ul {
margin-top: 0;
margin-bottom: 0;
}
.markdown-body li>p {
margin-top: 16px;
}
.markdown-body dl {
padding: 0;
}
.markdown-body dl dt {
padding: 0;
margin-top: 16px;
font-size: 1em;
font-style: italic;
font-weight: bold;
}
.markdown-body dl dd {
padding: 0 16px;
margin-bottom: 16px;
}
.markdown-body blockquote {
padding: 0 15px;
color: #777;
border-left: 4px solid #ddd;
}
.markdown-body blockquote> :first-child {
margin-top: 0;
}
.markdown-body blockquote> :last-child {
margin-bottom: 0;
}
.markdown-body table {
display: block;
width: 100%;
overflow: auto;
word-break: normal;
word-break: keep-all;
}
.markdown-body table th {
font-weight: bold;
text-align: revert;
}
.markdown-body table th,
.markdown-body table td {
padding: 6px 13px;
border: 1px solid #ddd;
}
.markdown-body table tr {
background-color: #fff;
border-top: 1px solid #ccc;
}
.markdown-body table tr:nth-child(2n) {
background-color: #f8f8f8;
}
.markdown-body img {
max-width: 100%;
-moz-box-sizing: border-box;
box-sizing: border-box;
}
.markdown-body code {
padding: 0;
padding-top: 0.2em;
padding-bottom: 0.2em;
margin: 0;
font-size: 85%;
background-color: rgba(0, 0, 0, 0.04);
border-radius: 3px;
}
.markdown-body code:has(.katex) {
background-color: transparent;
}
.markdown-body code:before,
.markdown-body code:after {
letter-spacing: -0.2em;
content: "\\00a0";
}
.markdown-body pre>code {
padding: 0;
margin: 0;
font-size: 100%;
word-break: normal;
white-space: pre;
background: transparent;
border: 0;
}
.markdown-body .highlight {
margin-bottom: 16px;
}
.markdown-body .highlight pre,
.markdown-body pre {
padding: 16px;
overflow: auto;
font-size: 85%;
line-height: 1.45;
background-color: #f7f7f7;
border-radius: 3px;
}
.markdown-body .highlight pre {
margin-bottom: 0;
word-break: normal;
}
.markdown-body pre {
word-wrap: normal;
}
.markdown-body pre code {
display: inline;
max-width: initial;
padding: 0;
margin: 0;
overflow: initial;
line-height: inherit;
word-wrap: normal;
background-color: transparent;
border: 0;
}
.markdown-body pre code:before,
.markdown-body pre code:after {
content: normal;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font-size: 11px;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .pl-c {
color: #969896;
}
.markdown-body .pl-c1,
.markdown-body .pl-mdh,
.markdown-body .pl-mm,
.markdown-body .pl-mp,
.markdown-body .pl-mr,
.markdown-body .pl-s1 .pl-v,
.markdown-body .pl-s3,
.markdown-body .pl-sc,
.markdown-body .pl-sv {
color: #0086b3;
}
.markdown-body .pl-e,
.markdown-body .pl-en {
color: #795da3;
}
.markdown-body .pl-s1 .pl-s2,
.markdown-body .pl-smi,
.markdown-body .pl-smp,
.markdown-body .pl-stj,
.markdown-body .pl-vo,
.markdown-body .pl-vpf {
color: #333;
}
.markdown-body .pl-ent {
color: #63a35c;
}
.markdown-body .pl-k,
.markdown-body .pl-s,
.markdown-body .pl-st {
color: #a71d5d;
}
.markdown-body .pl-pds,
.markdown-body .pl-s1,
.markdown-body .pl-s1 .pl-pse .pl-s2,
.markdown-body .pl-sr,
.markdown-body .pl-sr .pl-cce,
.markdown-body .pl-sr .pl-sra,
.markdown-body .pl-sr .pl-sre,
.markdown-body .pl-src {
color: #df5000;
}
.markdown-body .pl-mo,
.markdown-body .pl-v {
color: #1d3e81;
}
.markdown-body .pl-id {
color: #b52a1d;
}
.markdown-body .pl-ii {
background-color: #b52a1d;
color: #f8f8f8;
}
.markdown-body .pl-sr .pl-cce {
color: #63a35c;
font-weight: bold;
}
.markdown-body .pl-ml {
color: #693a17;
}
.markdown-body .pl-mh,
.markdown-body .pl-mh .pl-en,
.markdown-body .pl-ms {
color: #1d3e81;
font-weight: bold;
}
.markdown-body .pl-mq {
color: #008080;
}
.markdown-body .pl-mi {
color: #333;
font-style: italic;
}
.markdown-body .pl-mb {
color: #333;
font-weight: bold;
}
.markdown-body .pl-md,
.markdown-body .pl-mdhf {
background-color: #ffecec;
color: #bd2c00;
}
.markdown-body .pl-mdht,
.markdown-body .pl-mi1 {
background-color: #eaffea;
color: #55a532;
}
.markdown-body .pl-mdr {
color: #795da3;
font-weight: bold;
}
.markdown-body kbd {
display: inline-block;
padding: 3px 5px;
font: 11px Consolas, "Liberation Mono", Menlo, Courier, monospace;
line-height: 10px;
color: #555;
vertical-align: middle;
background-color: #fcfcfc;
border: solid 1px #ccc;
border-bottom-color: #bbb;
border-radius: 3px;
box-shadow: inset 0 -1px 0 #bbb;
}
.markdown-body .task-list-item {
list-style-type: none;
}
.markdown-body .task-list-item+.task-list-item {
margin-top: 3px;
}
.markdown-body .task-list-item input {
float: left;
margin: 0.3em 0 0.25em -1.6em;
vertical-align: middle;
}
.markdown-body :checked+.radio-label {
z-index: 1;
position: relative;
border-color: #4183c4;
}
/*! Pretty printing styles. Used with prettify.js. */
/* SPAN elements with the classes below are added by prettyprint. */
.pln {
color: #000
}
/* plain text */
@media screen {
.str {
color: #080
}
/* string content */
.kwd {
color: #008
}
/* a keyword */
.com {
color: #800
}
/* a comment */
.typ {
color: #606
}
/* a type name */
.lit {
color: #066
}
/* a literal value */
/* punctuation, lisp open bracket, lisp close bracket */
.pun,
.opn,
.clo {
color: #660
}
.tag {
color: #008
}
/* a markup tag name */
.atn {
color: #606
}
/* a markup attribute name */
.atv {
color: #080
}
/* a markup attribute value */
.dec,
.var {
color: #606
}
/* a declaration; a variable name */
.fun {
color: red
}
/* a function name */
}
/* Use higher contrast and text-weight for printable form. */
@media print,
projection {
.str {
color: #060
}
.kwd {
color: #006;
font-weight: bold
}
.com {
color: #600;
font-style: italic
}
.typ {
color: #404;
font-weight: bold
}
.lit {
color: #044
}
.pun,
.opn,
.clo {
color: #440
}
.tag {
color: #006;
font-weight: bold
}
.atn {
color: #404
}
.atv {
color: #060
}
}
/* Put a border around prettyprinted code snippets. */
pre.prettyprint {
padding: 2px;
/* border: 1px solid #888 */
}
/* Specify class=linenums on a pre to get line numbering */
ol.linenums {
margin-top: 0;
margin-bottom: 0
}
/* IE indents via margin-left */
li.L0,
li.L1,
li.L2,
li.L3,
li.L5,
li.L6,
li.L7,
li.L8 {
list-style-type: none
}
/* Alternate shading for lines */
li.L1,
li.L3,
li.L5,
li.L7,
li.L9 {
background: #eee
}
.markdown-body p,
.markdown-body blockquote,
.markdown-body ul,
.markdown-body ol,
.markdown-body dl,
.markdown-body table,
.markdown-body pre {
margin-top: 0;
margin-bottom: 16px;
}`;return(0,N.useEffect)(()=>{const d=O.current.attachShadow({mode:"open"});g.current=document.createElement("div"),g.current.className="markdown-body",g.current.innerHTML=R,d.appendChild(g.current);const h=document.createElement("style");return h.textContent=m,d.appendChild(h),()=>{d.innerHTML=""}},[]),(0,N.useEffect)(()=>{g.current&&(g.current.innerHTML=R)},[R]),n.createElement("div",{ref:O})};function i(R){const O=["onabort","onanimationend","onanimationiteration","onanimationstart","onauxclick","onblur","oncancel","oncanplay","oncanplaythrough","onchange","onclick","onclose","oncontextmenu","oncopy","oncut","ondblclick","ondrag","ondragend","ondragenter","ondragleave","ondragover","ondragstart","ondrop","ondurationchange","onemptied","onended","onerror","onfocus","onformdata","ongotpointercapture","oninput","oninvalid","onkeydown","onkeypress","onkeyup","onload","onloadeddata","onloadedmetadata","onloadstart","onlostpointercapture","onmousedown","onmousemove","onmouseout","onmouseover","onmouseup","onpaste","onpause","onplay","onplaying","onpointercancel","onpointerdown","onpointerenter","onpointerleave","onpointermove","onpointerout","onpointerover","onpointerup","onprogress","onratechange","onreset","onresize","onscroll","onsecuritypolicyviolation","onseeked","onseeking","onselect","onslotchange","onstalled","onsubmit","onsuspend","ontimeupdate","ontoggle","ontouchcancel","ontouchend","ontouchmove","ontouchstart","ontransitionend","onvolumechange","onwaiting","onwheel"],g=new RegExp(`\\b(${O.join("|")})\\s*=\\s*(?:"[^"]*"|'[^']*'|[^\\s>]*)`,"gi");return R.replace(g,"").trim()}var a=Object.defineProperty,v=Object.getOwnPropertySymbols,p=Object.prototype.hasOwnProperty,l=Object.prototype.propertyIsEnumerable,o=(R,O,g)=>O in R?a(R,O,{enumerable:!0,configurable:!0,writable:!0,value:g}):R[O]=g,u=(R,O)=>{for(var g in O||(O={}))p.call(O,g)&&o(R,g,O[g]);if(v)for(var g of v(O))l.call(O,g)&&o(R,g,O[g]);return R};const c="@\u2581\u2581@",_="@\u2581@",y=/<pre[^>]*>/g;function f(R){let O=document.createElement("div");return O.innerHTML=R,O.childNodes.length===0?"":O.childNodes[0].nodeValue}const C=(R,O)=>{R=R||"";const g=/(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?\)|(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,m=/\"(?:https?:\/\/[^\/]+)?\/api\/attachments\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,d=/\(\s+(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?|\"(?:https?:\/\/[^\/]+)?\/files\/uploads\/([A-Za-z0-9+/=]+)(\?.*?)?\//g,h=/(?:https?:\/\/[^\/]+)?\/attachments\/download\/([A-Za-z0-9+/=]+)(\?.*?)?\//g;return O?R.replaceAll("https://www.educoder.net","").replaceAll("https://www-cdn.educoder.net","").replaceAll("//api/attachments","/api/attachments").replace(g,(A,w,x,D,I,F,K)=>{const W=w||D||F,z=x||I||K||"?";return T.Z.API_SERVER+"/api/attachments/"+W+z+"&t="+(0,b.Jn)(W,Date.now())+(A.indexOf(")")>-1?")":"&")}).replaceAll('src="(','src="').replaceAll("src='(",'src="'):(R=R.replace(h,(A,w,x,D,I,F,K)=>{const W=w||D||F,z=x||I||K||"?";return T.Z.API_SERVER+"/attachments/download/"+W+z+"&t="+(0,b.Jn)(W,Date.now())+(A.indexOf(")")>-1?")":"&")}).replace(g,(A,w,x,D,I,F,K)=>{const W=w||D||F,z=x||I||K||"?";return T.Z.API_SERVER+"/api/attachments/"+W+z+"&t="+(0,b.Jn)(W,Date.now())+(A.indexOf(")")>-1?")":"&")}).replace(m,(A,w,x,D,I)=>{const F=w||D,K=x||I||"";return'"'+T.Z.API_SERVER+"/api/attachments/"+F+K+F+K+"&t="+(0,b.Jn)(F,Date.now())}).replace(d,(A,w,x,D,I)=>{const F=w||D,K=x||I||"";return"("+T.Z.API_SERVER+"/files/uploads/"+F+K+F+K+"&t="+(0,b.Jn)(F,Date.now())}).replaceAll('src="(','src="').replaceAll("src='(",'src="').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,`
`),R)};var L=({value:R="",className:O,showTextOnly:g,showLines:m,style:d={},stylesPrev:h={},highlightKeywords:A,showProgramFill:w,isProgramFill:x,disabledFill:D=!1,programFillValue:I,onFillChange:F=z=>{},onFillBlur:K=()=>{},onFillFocus:W=()=>{}})=>{let z=i(String(R||""));const[j,G]=(0,N.useState)(""),[Z,Q]=(0,N.useState)("office"),[ue,ee]=(0,N.useState)([]),ae=(0,N.useRef)("a"+(0,E.Z)()),_e={},xe=de=>/<style[\s\S]*?>/i.test(de||""),ge=(de,Be,we)=>{const Le=document.createElement(de===_?"input":"textarea");Le.style.width="100%",Le.style.height=de===_?"40px":"151px",Le.rows=5,Le.spellcheck=!1,Le.name="edu-program-fill",Le.placeholder="\u8BF7\u8F93\u5165",Le.dataset.id=Be;const Ae=Object.keys(_e).length;return _e[Ae]=Le,`<span class="edu-program-fill-wrap ${de===_?"":"show"}" style="width:${de===_?"600px":"100%"}" title=${we||""}><span>${Le.outerHTML}<span class="edu-program-fill-score" style="margin:0 6px"></span></span></span>`};function ce(de){return de=de.replace(/!\[.*?\]\(.*?\)/g,""),de=de.replace(/\[.*?\]\(.*?\)/g,""),de=de.replace(new RegExp("<iframe.*?<\\/iframe>","gs"),""),de=de.replace(/<embed.*?>/g,""),de=de.replace(/<img.*?>/g,""),de=de.replace(new RegExp("<video.*?>.*?<\\/video>","gs"),""),de=de.replace(new RegExp("<audio.*?>.*?<\\/audio>","gs"),""),de=de.replace(new RegExp("<style.*?>.*?<\\/style>","gs"),""),de=de.replace(new RegExp("<script.*?>.*?<\\/script>","gs"),""),de}const he=de=>!g&&xe(z)?de:de.replace(/<style.*?>([\s\S]+?)<\/style>/gim,function(Be,we){let Le=we.replace(/(\n|\r)/g,"").split("}"),Ae=[];return Le.map(Ve=>{Ve!=""&&Ae.push(`.${ae.current} ${Ve}`)}),`<style>${Ae.join("}")}</style>`}),Se=(0,N.useMemo)(()=>{try{const Le=/\(\s+\/api\/attachments\/|\(\/api\/attachments\//g,Ae=/\"\/api\/attachments\/|\"\/attachments\/download\//g,Ve=/\(\s+\/files\/uploads\/|\"\/files\/uploads\//g,De=/\(\/attachments\/download\//g;z=z.replace(De,"("+T.Z.API_SERVER+"/attachments/download/").replace(Le,"("+T.Z.API_SERVER+"/api/attachments/").replace(Ae,'"'+T.Z.API_SERVER+"/api/attachments/").replace(Ve,'"'+T.Z.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(Le){}if(w){let Le=-1;return z=z.replaceAll("<","&lt;").replaceAll(">","&gt;").replace(/(@▁▁@|@▁@)/g,function(Ae,Ve,De){var ye;return++Le,ge(Ae,Le,(ye=I==null?void 0:I[Le])==null?void 0:ye.value.replaceAll("<","&lt;").replaceAll(">","&gt;"))}),`<pre style="background:#fff;padding:4px">${he(z||"")}</pre>`}let de=he(z);de=(0,U.ZP)(de);const Be=(0,U.ez)();z.match(/\[TOC\]/)&&(de=de.replace("<p>[TOC]</p>",(0,U.Qv)()),(0,U.Iy)()),de=de.replace(/(__special_katext_id_\d+__)/g,(Le,Ae)=>{const{type:Ve,expression:De}=Be[Ae];return(0,e.renderToString)(f(De)||"",{displayMode:Ve==="block",throwOnError:!1,output:"html"})}),de=de.replace(/▁/g,"\u2581\u2581\u2581\u2581\u2581"),(0,U.AL)();const we=document.createElement("div");if(we.innerHTML=de,g)return we.innerText;if(A){const Le=A.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");return te(we,Le),we.innerHTML}return setTimeout(()=>be(),500),we.innerHTML},[z,A]);(0,N.useEffect)(()=>{pe.current&&pe.current.querySelectorAll(["input","textarea"]).forEach(Be=>{Be.oninput=Te,Be.onblur=ke,Be.onfocus=X})},[ue]),(0,N.useEffect)(()=>{var de,Be,we,Le,Ae;if(I!=null&&I.length)try{const Ve=pe.current.querySelectorAll(".edu-program-fill-score"),De=pe.current.querySelectorAll('[name="edu-program-fill"]');for(const[ye,Ee]of De.entries())Ee.value=((de=I==null?void 0:I[ye])==null?void 0:de.value)||"",((Be=I==null?void 0:I[ye])==null?void 0:Be.type)==="warning"?Ee.className="program-fill-warning":((we=I==null?void 0:I[ye])==null?void 0:we.type)==="success"?Ee.className="program-fill-success":Ee.className="";for(const[ye,Ee]of Ve.entries())Ee.innerHTML=(Le=I==null?void 0:I[ye])!=null&&Le.score?`${(Ae=I==null?void 0:I[ye])==null?void 0:Ae.score}\u5206`:"";ee(I)}catch(Ve){console.log(Ve,"error")}},[I]);const Te=de=>{ue[de.target.dataset.id]=ue[de.target.dataset.id]||{},ue[de.target.dataset.id].value=de.target.value,ee([...ue]),F(ue,de.target.dataset.id)},ke=de=>{ue[de.target.dataset.id]=ue[de.target.dataset.id]||{},ue[de.target.dataset.id].value=de.target.value,ee([...ue]),K(ue,de.target.dataset.id)},X=de=>{ue[de.target.dataset.id]=ue[de.target.dataset.id]||{},ue[de.target.dataset.id].value=de.target.value,ee([...ue]),W(ue,de.target.dataset.id)};function te(de,Be){return de.childNodes.forEach(we=>{var Le;if(we.childNodes.length>0)te(we,Be);else if(we.nodeName!=="IMG")if(we.innerHTML)we.innerHTML=(Le=we.innerHTML)==null?void 0:Le.replace(new RegExp(Be,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>');else{const Ae=document.createElement("span");Ae.innerHTML=we.textContent.replace(new RegExp(Be,"gi"),'<span style="color:#0152d9;background-color:#1890ff33">$&</span>'),we.replaceWith(Ae)}})}const pe=(0,N.useRef)();U.jb.WebkitLineClamp=m,m&&(d=u(u({},d),U.jb));function me(de){let Be=de.target;if(Be.tagName.toUpperCase()==="A"){let we=Be.getAttribute("href");if(we.indexOf("office")>-1)de.preventDefault(),G(we),Q("office");else if(we.indexOf("application/pdf")>-1)de.preventDefault(),G(we),Q("pdf");else if(we.indexOf("text/html")>-1)de.preventDefault(),G(we),Q("html");else if(we.startsWith("#")){de.preventDefault();let Le=document.getElementById(we.replace("#",""));Le&&Le.scrollIntoView(!0)}}}const be=()=>{var de;const Be=(de=pe.current)==null?void 0:de.querySelectorAll("video");Be==null||Be.forEach(we=>{if(we.oncontextmenu=()=>!1,we.src.indexOf(".m3u8")>-1&&!we.canPlayType("application/vnd.apple.mpegurl")){if(P().isSupported()){var Le=new(P());Le.loadSource(we.src),Le.attachMedia(we)}}})};return(0,N.useEffect)(()=>{if(pe.current&&Se&&Se.match(y)&&window.PR.prettyPrint(),pe.current)return pe.current.addEventListener("click",me),()=>{var de;(de=pe.current)==null||de.removeEventListener("click",me),(0,U.AL)(),(0,U.Iy)()}},[Se,pe.current,me]),(0,N.useEffect)(()=>{var de;const Be=we=>{we.preventDefault(),we.clipboardData.setData("text",window.getSelection().toString())};return(de=pe.current)==null||de.addEventListener("copy",Be),()=>{var we;(we=pe.current)==null||we.removeEventListener("copy",Be)}},[pe.current]),N.createElement(N.Fragment,null,g&&N.createElement("div",{ref:pe},Se),!g&&!xe(Se)&&N.createElement("div",{ref:pe,style:u({},d),className:`${O||""} ${D?"disabled-fill":""} markdown-body ${ae.current}`,dangerouslySetInnerHTML:{__html:Se}}),!g&&xe(Se)&&N.createElement(r,{html:Se}),N.createElement(s.Z,{close:!0,data:j,type:j!=null&&j.length?Z:"",style:u({},h),onClose:()=>G("")}))}},7621:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return k}});var N=M(35973),B={ldsRing:"ldsRing___mpBZC",idsRingWrapper:"idsRingWrapper___Of9_n",ldsring:"ldsring___o0w2t"},U=M(67294),k=({message:S,className:P,children:T,style:b={}})=>U.createElement("div",{className:`custom-spinner ${B.idsRingWrapper} ${P}`},U.createElement("div",{className:B.ldsRing},U.createElement("div",null),U.createElement("div",null),U.createElement("div",null),U.createElement("div",null)),S?U.createElement("p",{style:b},S):null,T,U.createElement(N.Outlet,null))},38658:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return P}});var N=M(67294),B={flex_box_center:"flex_box_center___Gc4dd",flex_space_between:"flex_space_between___K2f1v",flex_box_vertical_center:"flex_box_vertical_center___pupRp",flex_box_center_end:"flex_box_center_end___UDLRC",flex_box_column:"flex_box_column___a5uDo",result:"result___gu5zt",title:"title___xrnx2",left:"left___IAxp9",leftNode:"leftNode___HL8fG",right:"right___ZXYmw",rightNode:"rightNode___jYL5_"},U=M(94184),k=M.n(U),P=({className:T,style:b={},leftNode:e,leftTitle:E="\u81EA\u6D4B\u8F93\u5165",rightNode:s,rightTitle:n="\u8FD0\u884C\u7ED3\u679C"})=>N.createElement("div",{className:k()(B.result,T),style:b},N.createElement("div",{className:B.left},N.createElement("div",{className:B.title},N.createElement("i",{style:{color:"#08CF76"},className:"iconfont iconfont icon-zidingyiceshiyongli font14 mr5"}),N.createElement("span",null,E)),N.createElement("div",{className:B.leftNode},e)),N.createElement("div",{className:B.right},N.createElement("div",{className:B.title},N.createElement("i",{style:{color:"#00DFFF"},className:"iconfont iconfont icon-daimazhihangjieguo font14 mr5"}),N.createElement("span",null,n)),N.createElement("div",{className:B.rightNode},s)))},36295:function(Ge,re,M){"use strict";M.d(re,{SV:function(){return ue},ZP:function(){return Q}});var N=M(67294),B=M(91033);const U={keywords:["print","auto","break","case","char","const","continue","default","do","double","else","enum","extern","float","for","goto","if","int","long","register","return","short","signed","sizeof","static","struct","switch","typedef","union","unsigned","void","volatile","while"]},k={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"]},S={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(`
`)}]},P={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(`
`)}]},T={keywords:["asInstanceOf","catch","class","classOf","def","do","else","extends","finally","for","foreach","forSome","if","import","isInstanceOf","macro","match","new","object","package","return","throw","trait","try","type","until","val","var","while","with","yield","given","enum","then"],quickKey:[{label:"println",content:["println($0)"].join(`
`)}]};var b=M(84204),e=M.n(b),E=(ee,ae,_e)=>new Promise((xe,ge)=>{var ce=Te=>{try{Se(_e.next(Te))}catch(ke){ge(ke)}},he=Te=>{try{Se(_e.throw(Te))}catch(ke){ge(ke)}},Se=Te=>Te.done?xe(Te.value):Promise.resolve(Te.value).then(ce,he);Se((_e=_e.apply(ee,ae)).next())});const s={languages:["c","abap","apex","azcli","bat","cameligo","clojure","coffee","cpp","csharp","csp","css","dockerfile","fsharp","go","graphql","handlebars","html","ini","java","javascript","json","kotlin","less","lua","markdown","mips","msdax","mysql","objective-c","pascal","pascaligo","perl","pgsql","php","postiats","powerquery","powershell","pug","python","r","razor","redis","redshift","restructuredtext","ruby","rust","sb","scheme","scss","shell","solidity","sophia","sql","st","swift","tcl","twig","vb","xml","yaml'"],tables:{users:["name","id","email","phone","password"],roles:["id","name","order","created_at","updated_at","deleted_at"]}},n=(ee,ae,_e,xe)=>{const ge=ae.getValueInRange({startLineNumber:1,startColumn:1,endLineNumber:_e.lineNumber,endColumn:_e.column});return Array.from(new Set(ge.match(/\b\w{2,}\b/g)||[])).map(he=>({label:he,kind:ee.languages.CompletionItemKind.Text,insertText:he,range:xe}))},t=(ee,ae,_e,xe)=>{ee.languages.registerCompletionItemProvider(ae,{provideCompletionItems(ge,ce){const he=ge.getWordUntilPosition(ce),Se={startLineNumber:ce.lineNumber,endLineNumber:ce.lineNumber,startColumn:he.startColumn,endColumn:he.endColumn},Te=ge.getLineContent(ce.lineNumber).substring(he.startColumn-2,he.endColumn);return{suggestions:[...n(ee,ge,ce,Se),..._e.map(X=>({label:X,kind:ee.languages.CompletionItemKind.Keyword,documentation:X,insertText:X,insertTextRules:ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se})),...xe.map(X=>({label:X.label,kind:ee.languages.CompletionItemKind.Snippet,documentation:X.content,insertText:Te.startsWith("#")?X.content.replace(/#/,""):X.content,insertTextRules:ee.languages.CompletionItemInsertTextRule.InsertAsSnippet,range:Se}))]}}})};var r=ee=>{s.languages.forEach(ae=>{ee.languages.registerDocumentFormattingEditProvider(ae,{provideDocumentFormattingEdits(_e){return E(this,null,function*(){const xe=e()(_e.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});return[{range:_e.getFullModelRange(),text:xe}]})}})}),t(ee,"java",k.keywords,k.quickKey),t(ee,"cpp",S.keywords,S.quickKey),t(ee,"c",U.keywords,[]),t(ee,"python",P.keywords,P.quickKey),t(ee,"scala",T.keywords,T.quickKey)};const i="\u8BE5\u4EFB\u52A1\u5173\u5361\u8BBE\u7F6E\u4E86\u7981\u6B62\u590D\u5236\u7C98\u8D34\uFF0C\u8BF7\u624B\u52A8\u8F93\u5165\u4EE3\u7801\u3002";var a=Object.defineProperty,v=(ee,ae,_e)=>ae in ee?a(ee,ae,{enumerable:!0,configurable:!0,writable:!0,value:_e}):ee[ae]=_e,p=(ee,ae,_e)=>v(ee,typeof ae!="symbol"?ae+"":ae,_e);const l=class Ii{constructor(ae,_e,xe){this.placeholder=ae,this.editor=_e,this.monaco=xe,_e.onDidChangeModelContent(()=>this.onDidChangeModelContent()),this.onDidChangeModelContent()}onDidChangeModelContent(){this.editor.getValue()===""?this.editor.addContentWidget(this):this.editor.removeContentWidget(this)}getId(){return Ii.ID}getDomNode(){return this.domNode||(this.domNode=document.createElement("div"),this.domNode.style.width="max-content",this.domNode.textContent=this.placeholder,this.domNode.style.fontStyle="initial",this.domNode.style.color="#D7D7D7",this.domNode.style.pointerEvents="none",this.editor.applyFontInfo(this.domNode)),this.domNode}getPosition(){return{position:{lineNumber:1,column:1},preference:[this.monaco.editor.ContentWidgetPositionPreference.EXACT]}}dispose(){this.editor.removeContentWidget(this)}};p(l,"ID","editor.widget.placeholderHint");var u=l,c=M(84144),_=M(2453),y=M(83062),f=M(96486),C=M(33054),L=M(74855),R=Object.defineProperty,O=Object.defineProperties,g=Object.getOwnPropertyDescriptors,m=Object.getOwnPropertySymbols,d=Object.prototype.hasOwnProperty,h=Object.prototype.propertyIsEnumerable,A=(ee,ae,_e)=>ae in ee?R(ee,ae,{enumerable:!0,configurable:!0,writable:!0,value:_e}):ee[ae]=_e,w=(ee,ae)=>{for(var _e in ae||(ae={}))d.call(ae,_e)&&A(ee,_e,ae[_e]);if(m)for(var _e of m(ae))h.call(ae,_e)&&A(ee,_e,ae[_e]);return ee},x=(ee,ae)=>O(ee,g(ae)),D=(ee,ae)=>{var _e={};for(var xe in ee)d.call(ee,xe)&&ae.indexOf(xe)<0&&(_e[xe]=ee[xe]);if(ee!=null&&m)for(var xe of m(ee))ae.indexOf(xe)<0&&h.call(ee,xe)&&(_e[xe]=ee[xe]);return _e},I=(ee,ae,_e)=>new Promise((xe,ge)=>{var ce=Te=>{try{Se(_e.next(Te))}catch(ke){ge(ke)}},he=Te=>{try{Se(_e.throw(Te))}catch(ke){ge(ke)}},Se=Te=>Te.done?xe(Te.value):Promise.resolve(Te.value).then(ce,he);Se((_e=_e.apply(ee,ae)).next())});function F(ee){return/^\d+$/.test(ee)?`${ee}px`:ee}function K(){}let W=!1;const z={"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",Scala:"scale",solidity:"sol"};function j(ee=[]){let ae=ee;if(Array.isArray(ee)){for(let _e=0;_e<ee.length;_e++){let xe=z[ee[_e]];if(xe)return xe}return ae[0]}return z[ae]||ae}let G=null;const Z=()=>I(void 0,null,function*(){try{yield navigator.clipboard.writeText(" "),console.log("\u5185\u5BB9\u5DF2\u81EA\u52A8\u590D\u5236\u5230\u526A\u8D34\u677F:")}catch(ee){console.error("\u81EA\u52A8\u590D\u5236\u5931\u8D25:",ee)}});var Q=ee=>{var ae=ee,{width:_e="100%",height:xe="100%",value:ge,language:ce="javascript",style:he={},options:Se={},overrideServices:Te={},theme:ke="vs-dark",onEditBlur:X,isCopy:te=!1,onSave:pe,autoHeight:me=!1,forbidCopy:be=!1,onChange:de=K,editorDidMount:Be=K,onFocus:we=K,onBreakPoint:Le=K,breakPointValue:Ae=[],filename:Ve="educoder.txt",errorLine:De,errorContent:ye="",highlightLine:Ee,openBreakPoint:Oe=!1,placeholder:Fe="",showMiniMap:Ke=!0}=ae,ze=D(ae,["width","height","value","language","style","options","overrideServices","theme","onEditBlur","isCopy","onSave","autoHeight","forbidCopy","onChange","editorDidMount","onFocus","onBreakPoint","breakPointValue","filename","errorLine","errorContent","highlightLine","openBreakPoint","placeholder","showMiniMap"]);const Ye=(0,N.useRef)(),Ie=(0,N.useRef)({}),je=(0,N.useRef)(),qe=(0,N.useRef)(),Pe=(0,N.useRef)([]),Ze=(0,N.useRef)(!1),se=(0,N.useRef)(),ie=(0,N.useRef)(),le=(0,N.useRef)(!1),[V,J]=(0,N.useState)(!1);function q(){let Me;return Ye.current&&(Me=new B.Z(Ne=>{for(let it of Ne)(it.target.offsetHeight>0||it.target.offsetWidth>0)&&Ie.current.instance.layout()}),Me.observe(Ye.current)),Me}function fe(){_.ZP.warning({content:decodeURIComponent(i),key:"monaco-editor-tip"})}const ne=()=>{let Me=Ie.current.instance;if(ge!=null&&Me&&V){const Ne=Me.getModel();Ne&&ge!==Ne.getValue()&&(W=!0,Ne.setValue(ge),Me.layout(),W=!1)}};(0,N.useEffect)(()=>{const Me=C.Z.subscribe("formatDocument",Ne=>{var it;let ht=Ie.current.instance;(it=ht==null?void 0:ht.getAction)==null||it.call(ht,"editor.action.formatDocument").run()});return window.updateMonacoValue=Ne=>{de(Ne)},Me},[]),(0,N.useEffect)(()=>{var Me;let Ne=Ie.current.instance;qe.current&&clearTimeout(qe.current),qe.current=setTimeout(()=>{ne()},500),ge&&(ge!=null&&ge.length)&&((Me=Ne==null?void 0:Ne.updateOptions)==null||Me.call(Ne,{lineNumbersMinChars:Math.max(Math.floor(Math.log10(ge.split(/\r\n|\r|\n/g).length))+3,5)}))},[ge,V,Ie.current]),(0,N.useEffect)(()=>{if(De&&Ie.current&&Ie.current.instance){let Ne=Ie.current.instance;Ne.changeViewZones(function(it){var ht=document.createElement("div");ht.style.padding="10px 20px",ht.style.width="calc(100% - 20px)",ht.className="my-error-line-wrp",ht.innerHTML=ye,it.addZone({afterLineNumber:De||11,heightInLines:3,domNode:ht})});var Me={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}};Ne.addOverlayWidget(Me),Ne.revealPositionInCenter({lineNumber:20,column:1})}},[De,Ie.current,V]);const ve=(Me="",Ne)=>{if(!Me||Me.trim()==="")return!0;const ht=Ie.current.instance.getModel().getLineTokens(Ne);let Ct=!1;for(let Ft=0;Ft<2;Ft++)ht.getStandardTokenType(Ft)===1&&(Ct=!0);return Ct};(0,N.useEffect)(()=>{var Me;const Ne=(Me=Ie.current)==null?void 0:Me.instance;if(Ne&&V&&be){const it=Ne.onDidBlurEditorWidget(()=>{le.current=!1}),ht=Ne.onDidFocusEditorText(()=>{le.current=!0});return()=>{it.dispose(),ht.dispose()}}},[Ie.current,V,be]),(0,N.useEffect)(()=>{var Me;if((Me=Ie.current)!=null&&Me.instance&&V&&Oe){let Ne=Ie.current.instance,it=Ne.getModel();if(!it)return;(()=>{var mt;let yt=[],vt=[];const jt=it.getAllDecorations();for(let Wt of jt)Wt.options.className==="highlighted-line"&&(yt.push((mt=Wt==null?void 0:Wt.range)==null?void 0:mt.startLineNumber),vt.push(Wt==null?void 0:Wt.id));if(Ee===yt[0])return;it.deltaDecorations(vt,[]);const Nt=it.getLineCount();Ee&&Ee<=Nt&&(Ne.deltaDecorations([],[{range:new G.Range(Ee,1,Ee,it.getLineMaxColumn(Ee)),options:{isWholeLine:!0,className:"highlighted-line"}}]),Ne.revealLineInCenter(Ee))})();const Ct=(mt=!1)=>{var yt;let vt=[],jt=[];const Nt=it.getAllDecorations();for(let Wt of Nt)Wt.options.linesDecorationsClassName==="breakpoints-select"&&(vt.push((yt=Wt==null?void 0:Wt.range)==null?void 0:yt.startLineNumber),jt.push(Wt==null?void 0:Wt.id));if(mt)return{lines:vt,ids:jt};Le(vt)},Ft=mt=>I(void 0,null,function*(){let yt={range:new G.Range(mt,1,mt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}};yield it.deltaDecorations([],[yt]),Ct()}),Vt=mt=>I(void 0,null,function*(){let yt=[];const vt=Ne.getLineDecorations(mt);for(let jt of vt)jt.options.linesDecorationsClassName==="breakpoints-select"&&yt.push(jt.id);yield it.deltaDecorations(yt,[]),Ct()}),pr=mt=>{let yt=Ne.getLineDecorations(mt);for(let vt of yt)if(vt.options.linesDecorationsClassName==="breakpoints-select")return!0;return!1};if(!(0,f.isEqual)(Ae,Ct(!0).lines)){it.deltaDecorations(Ct(!0).ids,[]);const mt=Ae.map(yt=>({range:new G.Range(yt,1,yt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-select"}}));it.deltaDecorations([],mt)}const gt=Ne.onDidChangeModelContent(mt=>{let yt=Ne.getPosition();if(yt){let vt=yt.lineNumber;clearTimeout(ie.current),ie.current=setTimeout(()=>{ve(it.getLineContent(vt),vt)?Vt(vt):pr(vt)?(Vt(vt),Ft(vt)):Ct()},100)}}),Jt=Ne.onMouseDown(mt=>{var yt,vt,jt;if(mt.target.detail&&((jt=(vt=(yt=mt.target)==null?void 0:yt.element)==null?void 0:vt.className)!=null&&jt.includes("line-numbers"))){let Nt=mt.target.position.lineNumber;if(ve(it.getLineContent(Nt),Nt))return;pr(Nt)?Vt(Nt):Ft(Nt)}}),Zt=mt=>{let yt={range:new G.Range(mt,1,mt,1),options:{isWholeLine:!1,linesDecorationsClassName:"breakpoints-fake"}};Pe.current=Ne.deltaDecorations(Pe.current,[yt])},_r=()=>{Pe.current=Ne.deltaDecorations(Pe.current,[])},Yt=Ne.onMouseMove(mt=>{var yt,vt,jt;if(_r(),mt.target.detail&&((jt=(vt=(yt=mt.target)==null?void 0:yt.element)==null?void 0:vt.className)!=null&&jt.includes("line-numbers"))){let Nt=mt.target.position.lineNumber;if(ve(it.getLineContent(Nt),Nt))return;Zt(Nt)}}),cn=Ne.onMouseLeave(()=>{_r()});return()=>{gt.dispose(),Jt.dispose(),Yt.dispose(),cn.dispose()}}},[Ie.current,V,Ae,Ee,Oe,ce]),(0,N.useEffect)(()=>{var Me;(Me=Ie.current)!=null&&Me.instance&&Oe&&Ie.current.instance.setPosition({lineNumber:0,column:0})},[Ee]);function Ce(){let Me=Ie.current.instance;if(Me){const Ne=Me.getSelection(),it=Ie.current.pastePos||{},ht=new G.Range(it.startLineNumber||Ne.endLineNumber,it.startColumn||Ne.endColumn,it.endLineNumber||Ne.endLineNumber,it.endColumn||Ne.endColumn);setTimeout(()=>{Me.executeEdits("",[{range:ht,text:""}])},300)}}function Ue(Me){(window.navigator.platform.match("Mac")?Me.metaKey:Me.ctrlKey)&&Me.keyCode==83&&(Me.preventDefault(),pe())}const We=()=>{if(me&&Ie.current.instance){const Me=Ie.current.instance.getContentHeight();ot(Me<xe?xe:Me)}else ot(xe)};function nt(Me){var Ne=document.createEvent("MouseEvents");Ne.initMouseEvent("click",!0,!1,window,0,0,0,0,0,!1,!1,!1,!1,0,null),Me.dispatchEvent(Ne)}const et=Me=>{if(!le.current)return;const{keyCode:Ne,ctrlKey:it,metaKey:ht,target:Ct,type:Ft}=Me;return(Ft==="paste"||(Ne===67||Ne===86)&&(ht||it))&&Ct.nodeName==="TEXTAREA"&&(fe(),Me.preventDefault()),!1};function Je(Me,Ne){var it=window.URL||window.webkitURL||window,ht=new Blob([Ne]),Ct=document.createElementNS("http://www.w3.org/1999/xhtml","a");Ct.href=it.createObjectURL(ht),Ct.download=Me,nt(Ct)}(0,N.useEffect)(()=>{We()},[We]),(0,N.useEffect)(()=>{Ye.current&&!V&&Promise.all([M.e(5552),M.e(9651)]).then(M.bind(M,55826)).then(Me=>{try{G=Me,Ie.current.instance=G.editor.create(Ye.current,{value:ge,language:j(ce),theme:ke,requireConfig:{"vs/nls":{availableLanguages:{"*":"zh-cn"}}},wordWrap:!0,autoIndent:!0,contextmenu:!0,formatOnType:!0,minimap:{enabled:Ke||!1}},Te);const Ne=Ie.current.instance;let Ct=[...c.BH._menuItems].find(gt=>gt[0]._debugName=="EditorContext")[1],Ft=["editor.action.clipboardCopyWithSyntaxHighlightingAction","editor.action.quickCommand","editor.action.clipboardCopyAction","editor.action.clipboardPasteAction","editor.action.clipboardCutAction"],Vt=(gt,Jt)=>{var Zt,_r;let Yt=gt._first;do Jt.includes((_r=(Zt=Yt.element)==null?void 0:Zt.command)==null?void 0:_r.id)&&gt._remove(Yt);while(Yt=Yt.next)};if(Be(Ne,G),setTimeout(()=>{We(),Ie.current.instance.addAction({id:"d123123",label:"Download File",contextMenuGroupId:"9_cutcopypaste",run:()=>{Je(Ve||"educoder.txt",Ne.getValue())}})},500),Ie.current.subscription=Ne.onDidChangeModelContent(gt=>{Ze.current?clearTimeout(se.current):(We(),de(Ne.getValue(),gt)),se.current=setTimeout(()=>{Ze.current=!1},500)}),window.Monaco||r(G,j(ce)),be&&(Vt(Ct,Ft),Ye.current.classList.add("noCopyPaste"),window.removeEventListener("keydown",et),window.removeEventListener("paste",et),window.addEventListener("keydown",et),window.addEventListener("paste",et)),window.Monaco=G,X&&Ne.onDidBlurEditorWidget(()=>{X(Ne.getValue())}),we&&Ne.onDidFocusEditorText(()=>{be&&Z(),we(Ne.getValue())}),be){Z();try{Ne.onDidPaste(gt=>{const Jt=Ne.getSelection(),Zt=Ie.current.pastePos||{},_r=new G.Range(Zt.startLineNumber||Jt.endLineNumber,Zt.startColumn||Jt.endColumn,Zt.endLineNumber||Jt.endLineNumber,Zt.endColumn||Jt.endColumn);Ne.executeEdits("",[{range:gt.range,text:""}])})}catch(gt){}}let pr=q();return Fe&&typeof Fe=="string"&&new u(Fe,Ne,G),J(!0),()=>{const gt=Ie.current.instance;gt.dispose();const Jt=gt.getModel();Jt&&Jt.dispose(),Ie.current.subscription&&Ie.current.subscription.dispose(),pr.unobserve(Ye.current)}}catch(Ne){}})},[]),(0,N.useEffect)(()=>{if(Ie.current.instance&&V)return document.addEventListener("keydown",Ue,!1),()=>{document.removeEventListener("keydown",Ue)}},[pe,V]),(0,N.useEffect)(()=>{let Me=Ie.current.instance;if(Me&&V){let Ne=j(ce);G.editor.setModelLanguage(Me.getModel(),Ne)}},[ce,V]),(0,N.useEffect)(()=>{Ie.current.instance&&V&&G.editor.setTheme(ke)},[ke,V]),(0,N.useEffect)(()=>{let Me=Ie.current.instance;je.current=Se,Me&&V&&(Me.updateOptions(w({},Se)),setTimeout(()=>{Me.getModel().updateOptions(w({},Se))},200))},[JSON.stringify(Se),V]),(0,N.useEffect)(()=>{let Me=Ie.current.instance;Me&&V&&Me.layout()},[_e,xe,V]);const[$e,ft]=(0,N.useState)(F(_e)),[at,ot]=(0,N.useState)(F(xe)),_t=x(w({},he),{width:$e,height:at,position:"relative"});return N.createElement("div",{className:"my-monaco-editor",ref:Ye,style:_t},te&&N.createElement(L.CopyToClipboard,{text:ge,onCopy:()=>_.ZP.success("\u590D\u5236\u6210\u529F")},N.createElement(y.Z,{title:"\u590D\u5236\u4EE3\u7801"},N.createElement("div",{style:{position:"absolute",top:0,right:10,cursor:"pointer",zIndex:10,color:"#165DFF"}},N.createElement("i",{className:"iconfont icon-fuzhi8",style:{fontSize:14}})," \u590D\u5236\u4EE3\u7801"))))};function ue({width:ee="100%",height:ae="100%",original:_e,modified:xe,language:ge,options:ce={}}){const he=(0,N.useRef)(),[Se,Te]=(0,N.useState)(null);function ke(me){let be;return he.current&&(be=new B.Z(de=>{for(let Be of de)(Be.target.offsetHeight>0||Be.target.offsetWidth>0)&&me.layout()}),be.observe(he.current)),be}(0,N.useEffect)(()=>(he.current&&Promise.all([M.e(5552),M.e(9404)]).then(M.bind(M,50048)).then(me=>{G=me;const be=G.editor.createDiffEditor(he.current,x(w({enableSplitViewResizing:!1,scrollBeyondLastLine:!1,roundedSelection:!1,renderIndicators:!1,useShadows:!1,horizontal:"hidden",lineNumbers:"off",wordWrap:"off",ignoreTrimWhitespace:!1,"semanticHighlighting.enabled":!0,followsCaret:!0,ignoreCharChanges:!0,minimap:{enabled:!1},readOnly:!0},ce),{wordWrap:!0}));Te(be);let de=ke(be);return()=>{be.dispose();const Be=be.getModel();Be&&Be.dispose(),de.unobserve(he.current)}}),()=>{window.removeEventListener("keydown",checkPaste),window.removeEventListener("paste",checkPaste)}),[]),(0,N.useEffect)(()=>{Se&&Se.setModel({original:G.editor.createModel(_e,ge),modified:G.editor.createModel(xe,ge)})},[_e,xe,ge,Se]);const X=F(ee),te=F(ae),pe={width:X,height:te};return N.createElement("div",{className:"my-diff-editor",ref:he,style:pe})}},57560:function(Ge,re,M){"use strict";M.r(re),M.d(re,{default:function(){return t}});var N=M(67294),B=M(77969),U=M(11320),k=M(35973),S=M(74330),P=M(33227),T=M(72971),b=M(36295),e=M(19575),E=M(94699),s=M.n(E),n=(r,i,a)=>new Promise((v,p)=>{var l=c=>{try{u(a.next(c))}catch(_){p(_)}},o=c=>{try{u(a.throw(c))}catch(_){p(_)}},u=c=>c.done?v(c.value):Promise.resolve(c.value).then(l,o);u((a=a.apply(r,i)).next())}),t=()=>{const{submitId:r,id:i}=(0,k.useParams)(),[a,v]=(0,N.useState)(void 0);console.log((0,k.useLocation)(),33);const p=(0,k.useLocation)();function l(){var I;k.history.push(`/problems/${i}/oj/${(I=p==null?void 0:p.query)==null?void 0:I.backId}?tab=1`)}(0,N.useEffect)(()=>((0,k.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!1}),(0,k.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!0}),()=>{(0,k.getDvaApp)()._store.dispatch({type:"globalSetting/headerFooterToggle",payload:!0}),(0,k.getDvaApp)()._store.dispatch({type:"globalSetting/onlyShowBackTopToggle",payload:!1})}),[]),(0,N.useEffect)(()=>{document.title="\u5728\u7EBF\u5237\u9898"}),(0,N.useEffect)(()=>{r&&function(){return n(this,null,function*(){const F=yield(0,P.X6)(r);v(F.data)})}()},[r]);const{status:o,created_at:u,code:c,name:_,language:y,pass_sets_count:f,set_count:C,error_msg:L,output:R,input:O,expected_output:g,execute_memory:m,user:d,execute_time:h,input_file_url:A,output_file_url:w,is_file:x,expected_output_file_url:D}=a||{};return N.createElement(S.Z,{spinning:!a,delay:500},N.createElement("div",{className:"record-detail-info"},a?N.createElement(N.Fragment,null,N.createElement("header",{className:B.Z.header},N.createElement("div",null,N.createElement("img",{src:`${U.Z.IMG_SERVER}/images/${d.image_url}`,alt:"user",width:30}),N.createElement("span",null,d.name)),N.createElement("h2",null," ",_," "),N.createElement("button",{className:"ant-btn",onClick:l,style:{border:"1px solid #bacffe",color:"#3061d0"}},"\u8FD4\u56DE\u8BE5\u9898")),N.createElement("div",{className:"record-detail-body"},N.createElement("h2",null," \u63D0\u4EA4\u8BB0\u5F55 "),N.createElement("ul",{className:"record-info"},N.createElement("li",null," \u72B6\u6001\uFF1A",N.createElement("span",{className:o===0?"c-green":"c-red"},T.Im[o])," "),N.createElement("li",null," \u63D0\u4EA4\u65F6\u95F4\uFF1A",N.createElement("span",null,s()(u).format("YYYY-MM-DD HH:mm:ss"))," "),N.createElement("li",null," \u8BED\u8A00\uFF1A",N.createElement("span",null,y)," "),N.createElement("li",null," \u6267\u884C\u7528\u65F6\uFF1A",N.createElement("span",null,h*1e3,"ms")," "),N.createElement("li",null," ",`${f} / ${C} \u4E2A\u901A\u8FC7\u7684\u6D4B\u8BD5\u7528\u4F8B`," ")),(0,T.gZ)({status:o,error_msg:L,execute_time:h,output:R,input:O,expected_output:g,input_file_url:A,output_file_url:w,is_file:x,expected_output_file_url:D}),N.createElement("h2",null," \u63D0\u4EA4\u7684\u5185\u5BB9 "),N.createElement(b.ZP,{height:"200px",width:"100%",language:y==null?void 0:y.toLocaleLowerCase(),value:e.Base64.decode(c),options:{readOnly:!0}}))):null))}},72971:function(Ge,re,M){"use strict";M.d(re,{Im:function(){return L},ZP:function(){return h},gZ:function(){return m}});var N=M(67294),B=M(28802),U=M(85804),k=M(42922),S=M(53978),P=M(94189),T=M(19575),b=M(7621),e=M(65226),E=M(28706),s=M(38658),n=M(12320),t=M(94184),r=M.n(t),i=M(67294),a=Object.defineProperty,v=Object.defineProperties,p=Object.getOwnPropertyDescriptors,l=Object.getOwnPropertySymbols,o=Object.prototype.hasOwnProperty,u=Object.prototype.propertyIsEnumerable,c=(A,w,x)=>w in A?a(A,w,{enumerable:!0,configurable:!0,writable:!0,value:x}):A[w]=x,_=(A,w)=>{for(var x in w||(w={}))o.call(w,x)&&c(A,x,w[x]);if(l)for(var x of l(w))u.call(w,x)&&c(A,x,w[x]);return A},y=(A,w)=>v(A,p(w));const{TextArea:f}=B.default,C={visible:!1,tabIndex:"0"},L={[P.h.HIDE_COMPILE_STATUS]:"\u6682\u4E0D\u652F\u6301\u67E5\u770B",[P.h.NOMATCH]:"\u6D4B\u8BD5\u7528\u4F8B\u7ED3\u679C\u4E0D\u5339\u914D",[P.h.OK]:"\u8C03\u8BD5\u901A\u8FC7",2:"\u8C03\u8BD5\u8D85\u65F6",3:"\u8C03\u8BD5pod\u5931\u8D25",4:"\u7F16\u8BD1\u5931\u8D25",5:"\u6267\u884C\u5931\u8D25"};var R=(A=>(A[A.SET_VISIBLE=0]="SET_VISIBLE",A[A.SET_TABINDEX=1]="SET_TABINDEX",A))(R||{});function O(A,w){switch(w.type){case 0:return y(_({},A),{visible:w.payload});case 1:return y(_({},A),{tabIndex:w.payload});default:throw new Error}}function g({value:A,className:w}){const[x,D]=(0,N.useState)(!1),I=(0,N.useRef)(),F=(0,N.useRef)();return(0,N.useEffect)(()=>{x&&(F.current.reset(),F.current.write((0,E.pp)(A||"")))},[A,x]),(0,N.useEffect)(()=>{var K,W,z,j;if(I.current){F.current=new n.Terminal({fontSize:14,disableStdin:!0}),F.current.open(I.current);const G=I.current.offsetWidth-14,Z=((j=(z=(W=(K=F.current)==null?void 0:K._core)==null?void 0:W._renderService)==null?void 0:z.dimensions)==null?void 0:j.actualCellWidth)||9.5,Q=Math.ceil(G/Z);F.current.resize(Q,8),D(!0)}},[]),i.createElement("div",{ref:I,className:r()("XtermText-valueRef",w)})}function m(A){const{status:w,error_msg:x,output:D,input:I,expected_output:F,is_file:K,input_file_url:W,output_file_url:z,expected_output_file_url:j}=A;let G=null;const Z={minHeight:150,marginBottom:10,paddingLeft:24,background:"#070f19",color:"#fff"};switch(w){case P.h.NOMATCH:G=i.createElement(i.Fragment,null,i.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u5165\uFF1A"),!K&&i.createElement(g,{className:"mb10",value:I}),K&&i.createElement("div",{style:Z},i.createElement("a",{onClick:()=>(0,E.LR)(W,I)},I)),i.createElement("p",{className:"c-red"},"\u5B9E\u9645\u8F93\u51FA\uFF1A"),!K&&i.createElement(g,{className:"mb10",value:D&&T.Base64.decode(D)||""}),K&&i.createElement("div",{style:Z},i.createElement("a",{onClick:()=>(0,E.LR)(z,D)},D)),i.createElement("p",{className:"c-red"},"\u9884\u671F\u8F93\u51FA\uFF1A"),!K&&i.createElement(g,{className:"mb10",value:F&&T.Base64.decode(F)||""}),K&&i.createElement("div",{style:Z},i.createElement("a",{onClick:()=>(0,E.LR)(j,F)},F)));break;case P.h.EXECUTEFAILURE:G=i.createElement(i.Fragment,null,i.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!K&&i.createElement(e.Z,{value:I,style:Z}),K&&i.createElement("div",{style:Z},i.createElement("a",{onClick:()=>(0,E.LR)(W,I)},I)),i.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),i.createElement("pre",{className:"error"},T.Base64.decode(x)));break;case P.h.COMPILEFAILURE:G=i.createElement(i.Fragment,null,i.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A"),!K&&i.createElement(e.Z,{value:I,style:Z}),K&&i.createElement("div",{style:Z},i.createElement("a",{onClick:()=>(0,E.LR)(W,I)},I)),i.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),i.createElement("pre",{className:"error"},T.Base64.decode(x)));break;case P.h.PODFAILURE:G=i.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case P.h.TIMEOUT:G=i.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return i.createElement(i.Fragment,null," ",G," ")}function d(A){const{status:w,error_msg:x,execute_time:D,output:I,input:F,expected_output:K,is_file:W,input_file_url:z,output_file_url:j,expected_output_file_url:G}=A;let Z=null;switch(w){case P.h.OK:Z=i.createElement(i.Fragment,null,i.createElement("p",null,"\u6267\u884C\u7528\u65F6\uFF1A",D,"\u79D2"),i.createElement("p",null,"\u6267\u884C\u7ED3\u679C\uFF1A"),i.createElement("pre",null,T.Base64.decode(I)));break;case P.h.NOMATCH:Z=i.createElement(i.Fragment,null,i.createElement("p",null,"\u8F93\u5165\uFF1A",i.createElement("pre",null,F)),i.createElement("p",null,"\u8F93\u51FA\uFF1A",I&&T.Base64.decode(I)),i.createElement("p",null,"\u9884\u671F\u8F93\u51FA\uFF1A",K&&T.Base64.decode(K)));break;case P.h.EXECUTEFAILURE:Z=i.createElement(i.Fragment,null,i.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",i.createElement("pre",null,F)),i.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),i.createElement("pre",{className:"error"},T.Base64.decode(x)));break;case P.h.COMPILEFAILURE:Z=i.createElement(i.Fragment,null,i.createElement("p",null,"\u6700\u540E\u6267\u884C\u7684\u8F93\u5165\uFF1A",i.createElement("pre",null,F)),i.createElement("p",null,"\u6267\u884C\u51FA\u9519\u4FE1\u606F\uFF1A"),i.createElement("pre",{className:"error"},T.Base64.decode(x)));break;case P.h.PODFAILURE:Z=i.createElement("p",null,"\u521B\u5EFApod\u5931\u8D25\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break;case P.h.TIMEOUT:Z=i.createElement("p",null,"\u8BC4\u6D4B\u8D85\u65F6\uFF0C\u8BF7\u7A0D\u540E\u91CD\u8BD5");break}return i.createElement(i.Fragment,null," ",Z," ")}var h=({id:A,is_file:w,input:x,debuging:D,submitting:I,executingMessage:F,debugResult:K,onChangeInput:W,onDebugCode:z,onSubmitCode:j})=>{const[G,Z]=(0,N.useReducer)(O,C),{visible:Q,tabIndex:ue}=G;(0,N.useEffect)(()=>{Z({type:0,payload:!1})},[A]);function ee(ge){let ce=ge.target.id;Z({type:1,payload:ce})}function ae(){Z({type:0,payload:!Q})}const _e=(0,N.useMemo)(()=>{if(K){const{status:ge}=K;return i.createElement(i.Fragment,null,d(K))}return null},[K]);function xe(){Z({type:0,payload:!0}),Z({type:1,payload:"1"}),z()}return i.createElement("div",{className:"test-case-panel"},i.createElement("div",{className:`test-case-panel-body ${Q?"active":""}`},i.createElement("ul",{className:"s-navs"},i.createElement("li",null,i.createElement("a",{className:"active"},"\u8C03\u8BD5\u4EE3\u7801\u7ED3\u679C"))),i.createElement(s.Z,{leftTitle:"\u81EA\u5B9A\u4E49\u6D4B\u8BD5\u7528\u4F8B",rightTitle:"\u4EE3\u7801\u6267\u884C\u7ED3\u679C",style:{height:240},leftNode:i.createElement(f,{placeholder:"\u8BF7\u8F93\u5165\u81EA\u6D4B\u7528\u4F8B\uFF08\u5982\u679C\u672A\u586B\u5199\uFF0C\u9996\u6B21\u81EA\u6D4B\u8FD0\u884C\u65F6\uFF0C\u7CFB\u7EDF\u4F1A\u81EA\u52A8\u586B\u5145\u7B2C\u4E00\u4E2A\u975E\u9690\u85CF\u7684\u6587\u672C\u7C7B\u578B\u7684\u6D4B\u8BD5\u7528\u4F8B\uFF09",value:w?"":x,onChange:W}),rightNode:D?i.createElement(b.Z,{message:"\u4EE3\u7801\u6267\u884C\u4E2D..."}):K?_e:i.createElement("p",{style:{color:"#536879"}},"\u8BF7\u586B\u5199\u6D4B\u8BD5\u7528\u4F8B\u7684\u8F93\u5165\u503C\uFF0C\u70B9\u51FB\u201C\u8C03\u8BD5\u4EE3\u7801\u201D")})),i.createElement("a",{className:`btn-collapse ${Q?"up":""}`,onClick:ae},Q?i.createElement(k.Z,null):i.createElement(S.Z,null)),i.createElement("footer",{className:"footer"},i.createElement("span",{style:{visibility:"hidden"}},"\u63A7\u5236\u53F0"),i.createElement("div",{className:"flex-container"},i.createElement(U.ZP,{id:"oj-prev",className:"btn-blue",type:"ghost"},"\u4E0A\u4E00\u9898"),i.createElement(U.ZP,{id:"oj-next",className:"btn-blue",type:"ghost"},"\u4E0B\u4E00\u9898"),i.createElement(U.ZP,{className:"btn-green",type:"ghost",loading:D,onClick:xe},"\u8C03\u8BD5\u4EE3\u7801"),i.createElement(U.ZP,{type:"primary",className:"custom-ant-disabled",loading:I,disabled:I,onClick:()=>{Z({type:0,payload:!1}),j()}},"\u8BC4\u6D4B\u5E76\u63D0\u4EA4"))))}},94189:function(Ge,re,M){"use strict";M.d(re,{h:function(){return N}});var N=(B=>(B[B.NOMATCH=-1]="NOMATCH",B[B.OK=0]="OK",B[B.TIMEOUT=2]="TIMEOUT",B[B.PODFAILURE=3]="PODFAILURE",B[B.COMPILEFAILURE=4]="COMPILEFAILURE",B[B.EXECUTEFAILURE=5]="EXECUTEFAILURE",B[B.HIDE_COMPILE_STATUS=11]="HIDE_COMPILE_STATUS",B))(N||{})},33227:function(Ge,re,M){"use strict";M.d(re,{H7:function(){return e},KC:function(){return r},M3:function(){return p},MK:function(){return b},MU:function(){return k},Rg:function(){return u},WH:function(){return i},X6:function(){return P},bM:function(){return U},bx:function(){return a},dd:function(){return n},de:function(){return _},fi:function(){return E},fu:function(){return B},gu:function(){return v},n4:function(){return s},qe:function(){return o},rL:function(){return c},rX:function(){return T},uc:function(){return y},vl:function(){return t},wO:function(){return l},zO:function(){return S}});var N=M(33170);function B(f){return(0,N.U2)(`mypractices/${f}.json`,{hidePopLogin:!0})}function U(f,C){return(0,N.v_)(`mypractices/${f}/code_submit.json`,C)}function k(f,C){return(0,N.v_)(`mypractices/${f}/code_debug.json`,C)}function S(f,C){return C.language&&(C.language=encodeURIComponent(C.language)),(0,N.U2)(`mypractices/${f}/submit_records.json`,C)}function P(f){return(0,N.U2)("mypractices/record_detail.json",{id:f})}function T(f,C){return(0,N.U2)(`mypractices/${f}/result.json`,{mode:C})}function b(f,C){return(0,N.v_)(`mypractices/${f}/add_notes.json`,C)}function e(f,C){return(0,N.v_)(`mypractices/${f}/restore_initial_code.json`,C)}function E(f,C){return(0,N.v_)(`mypractices/${f}/sync_code.json`,C)}function s(f,C){return(0,N.v_)(`mypractices/${f}/update_code.json`,C)}function n(f){return(0,N.v_)(`mypractices/${f}/initial_codes.json`)}function t(f,C){return(0,N.v_)(`discusses/${f}/plus.json`,C)}function r(f){return(0,N.U2)("practices/practices_list.json",f)}function i(f,C){return(0,N.U2)(`practices/${f}/question_solution_articles`,C)}function a(f,C){return(0,N.v_)(`practices/${f}/question_solution_articles`,C)}function v(f,C){return(0,N.gz)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}`,C)}function p(f,C){return(0,N.U2)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}/edit`,C)}function l(f,C){return(0,N.U2)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}`,C)}function o(f,C){return(0,N.v_)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}/set_authority_or_excellent`,C)}function u(f,C){return(0,N.v_)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}/praise_or_treads`,C)}function c(f,C){return(0,N.v_)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}/hide`)}function _(f,C){return(0,N.IV)(`practices/${f}/question_solution_articles/${C==null?void 0:C.active}`,C)}function y(f,C){return(0,N.v_)(`mypractices/${f}/update_practice_time_sum`,C)}},51161:function(Ge,re,M){"use strict";M.d(re,{AL:function(){return u},Iy:function(){return s},Qv:function(){return r},ez:function(){return o},jb:function(){return n}});var N=M(47084),B=M.n(N),U=M(90621),k=M.n(U);let S=1;function P(C,L){const R=C.match(/^(\s+)(?:```)/);if(R===null)return L;const O=R[1];return L.split(`
`).map(g=>{const m=g.match(/^\s+/);if(m===null)return g;const[d]=m;return d.length>=O.length?g.slice(O.length):g}).join(`
`)}let T=[],b=["<ul>"];const e=new(B()).Renderer,E=/^ *(#{1,6}) *([^\n]+?) *(?:#+ *)?(?:\n+|$)/;function s(){T.length=0,b=["<ul>"]}const n={overflow:"hidden",WebkitBoxOrient:"vertical",display:"-webkit-box",WebkitLineClamp:2};function t(C,L,R,O){if(L>=C.length||C[L].level<=R)return L;var g=C[L];O.push("<li><a href='#"+S+g.anchor+"'>"+g.text+"</a>"),L++;var m=[];return L=t(C,L,g.level,m),m.length>0&&(O.push("<ul>"),m.forEach(function(d){O.push(d)}),O.push("</ul>")),O.push("</li>"),L=t(C,L,R,O),L}function r(){return t(T,0,0,b),b.push("</ul>"),b.join("")}const i={heading(C){const L=E.exec(C);if(S+=1,L)return{type:"heading",raw:L[0],depth:L[1].length,text:L[2]}},fences(C){const L=this.rules.block.fences.exec(C);if(L){const R=L[0];let O=P(R,L[3]||"");const g=L[2]?L[2].trim():L[2];if(["latex","katex","math"].indexOf(g)>=0){const m=p(),d=O;O=m,l[m]={type:"block",expression:d}}return{type:"code",raw:R,lang:g,text:O}}}},a=/(?:\${2})([^\n`]+?)(?:\${2})/gi;let v=0;const p=()=>`__special_katext_id_${v++}__`;let l={};function o(){return l}function u(){v=0,l={}}function c(C){return C=C.replace(a,(L,R)=>{const O=p();return l[O]={type:"inline",expression:R},O}),C}const _=e.listitem;e.listitem=function(C){return _(c(C))};const y=e.paragraph;e.paragraph=function(C){return y(c(C))};const f=e.tablecell;e.tablecell=function(C,L){return f(c(C),L)},e.code=function(C,L,R){const O=(L||"").match(/\S*/)[0];return O?["latex","katex","math"].indexOf(O)>=0?`<p class='editormd-tex'>${C}</p>`:`<pre class="prettyprint linenums"><code class="language-${L}">${R?C:(0,U.escape)(C,!0)}</code></pre>
`:'<pre class="prettyprint linenums"><code>'+(R?C:(0,U.escape)(C,!0))+"</code></pre>"},e.heading=function(C,L,R){let O=this.options.headerPrefix+R.toLowerCase().replace(/[^\w\\u4e00-\\u9fa5]]+/g,"-");return T.push({anchor:O,level:L,text:C}),"<h"+L+' id="'+S+O+'">'+C+"</h"+L+">"},B().setOptions({silent:!0,gfm:!0,pedantic:!1}),B().use({tokenizer:i,renderer:e}),re.ZP=B()},11771:function(){var Ge,re,M,N=!1,B,U;window.PR_SHOULD_USE_CONTINUATION=!0;var k,S;(function(){var P=window,T=["break,continue,do,else,for,if,return,while"],b=[T,"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"],e=[b,"catch,class,delete,false,import,new,operator,private,protected,public,this,throw,true,try,typeof"],E=[e,"alignas,alignof,align_union,asm,axiom,bool,concept,concept_map,const_cast,constexpr,decltype,delegate,dynamic_cast,explicit,export,friend,generic,late_check,mutable,namespace,noexcept,noreturn,nullptr,property,reinterpret_cast,static_assert,static_cast,template,typeid,typename,using,virtual,where"],s=[e,"abstract,assert,boolean,byte,extends,finally,final,implements,import,instanceof,interface,null,native,package,strictfp,super,synchronized,throws,transient"],n=[e,"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"],t="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",r=[e,"abstract,async,await,constructor,debugger,enum,eval,export,function,get,implements,instanceof,interface,let,null,set,undefined,var,with,yield,Infinity,NaN"],i="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",a=[T,"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"],v=[T,"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"],p=[T,"case,done,elif,esac,eval,fi,function,in,local,set,then,until"],l=[E,n,s,r,i,a,v,p],o=/^(DIR|FILE|array|vector|(de|priority_)?queue|(forward_)?list|stack|(const_)?(reverse_)?iterator|(unordered_)?(multi)?(set|map)|bitset|u?(int|float)\d*)\b/,u="str",c="kwd",_="com",y="typ",f="lit",C="pun",L="pln",R="tag",O="dec",g="src",m="atn",d="atv",h="nocode",A="(?:^^\\.?|[+-]|[!=]=?=?|\\#|%=?|&&?=?|\\(|\\*=?|[+\\-]=|->|\\/=?|::?|<<?=?|>>?>?=?|,|;|\\?|@|\\[|~|{|\\^\\^?=?|\\|\\|?=?|break|case|continue|delete|do|else|finally|instanceof|return|throw|try|typeof)\\s*";function w(ce){for(var he=0,Se=!1,Te=!1,ke=0,X=ce.length;ke<X;++ke){var te=ce[ke];if(te.ignoreCase)Te=!0;else if(/[a-z]/i.test(te.source.replace(/\\u[0-9a-f]{4}|\\x[0-9a-f]{2}|\\[^ux]/gi,""))){Se=!0,Te=!1;break}}var pe={b:8,t:9,n:10,v:11,f:12,r:13};function me(Le){var Ae=Le.charCodeAt(0);if(Ae!==92)return Ae;var Ve=Le.charAt(1);return Ae=pe[Ve],Ae||("0"<=Ve&&Ve<="7"?parseInt(Le.substring(1),8):Ve==="u"||Ve==="x"?parseInt(Le.substring(2),16):Le.charCodeAt(1))}function be(Le){if(Le<32)return(Le<16?"\\x0":"\\x")+Le.toString(16);var Ae=String.fromCharCode(Le);return Ae==="\\"||Ae==="-"||Ae==="]"||Ae==="^"?"\\"+Ae:Ae}function de(Le){var Ae=Le.substring(1,Le.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")),Ve=[],De=Ae[0]==="^",ye=["["];De&&ye.push("^");for(var Ee=De?1:0,Oe=Ae.length;Ee<Oe;++Ee){var Fe=Ae[Ee];if(/\\[bdsw]/i.test(Fe))ye.push(Fe);else{var Ke=me(Fe),ze;Ee+2<Oe&&Ae[Ee+1]==="-"?(ze=me(Ae[Ee+2]),Ee+=2):ze=Ke,Ve.push([Ke,ze]),ze<65||Ke>122||(ze<65||Ke>90||Ve.push([Math.max(65,Ke)|32,Math.min(ze,90)|32]),ze<97||Ke>122||Ve.push([Math.max(97,Ke)&-33,Math.min(ze,122)&-33]))}}Ve.sort(function(qe,Pe){return qe[0]-Pe[0]||Pe[1]-qe[1]});for(var Ye=[],Ie=[],Ee=0;Ee<Ve.length;++Ee){var je=Ve[Ee];je[0]<=Ie[1]+1?Ie[1]=Math.max(Ie[1],je[1]):Ye.push(Ie=je)}for(var Ee=0;Ee<Ye.length;++Ee){var je=Ye[Ee];ye.push(be(je[0])),je[1]>je[0]&&(je[1]+1>je[0]&&ye.push("-"),ye.push(be(je[1])))}return ye.push("]"),ye.join("")}function Be(Le){for(var Ae=Le.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")),Ve=Ae.length,De=[],ye=0,Ee=0;ye<Ve;++ye){var Oe=Ae[ye];if(Oe==="(")++Ee;else if(Oe.charAt(0)==="\\"){var Fe=+Oe.substring(1);Fe&&(Fe<=Ee?De[Fe]=-1:Ae[ye]=be(Fe))}}for(var ye=1;ye<De.length;++ye)De[ye]===-1&&(De[ye]=++he);for(var ye=0,Ee=0;ye<Ve;++ye){var Oe=Ae[ye];if(Oe==="(")++Ee,De[Ee]||(Ae[ye]="(?:");else if(Oe.charAt(0)==="\\"){var Fe=+Oe.substring(1);Fe&&Fe<=Ee&&(Ae[ye]="\\"+De[Fe])}}for(var ye=0;ye<Ve;++ye)Ae[ye]==="^"&&Ae[ye+1]!=="^"&&(Ae[ye]="");if(Le.ignoreCase&&Se)for(var ye=0;ye<Ve;++ye){var Oe=Ae[ye],Ke=Oe.charAt(0);Oe.length>=2&&Ke==="["?Ae[ye]=de(Oe):Ke!=="\\"&&(Ae[ye]=Oe.replace(/[a-zA-Z]/g,function(Ie){var je=Ie.charCodeAt(0);return"["+String.fromCharCode(je&-33,je|32)+"]"}))}return Ae.join("")}for(var we=[],ke=0,X=ce.length;ke<X;++ke){var te=ce[ke];if(te.global||te.multiline)throw new Error(""+te);we.push("(?:"+Be(te)+")")}return new RegExp(we.join("|"),Te?"gi":"g")}function x(ce,he){var Se=/(?:^|\s)nocode(?:\s|$)/,Te=[],ke=0,X=[],te=0;function pe(me){var be=me.nodeType;if(be==1){if(Se.test(me.className))return;for(var de=me.firstChild;de;de=de.nextSibling)pe(de);var Be=me.nodeName.toLowerCase();(Be==="br"||Be==="li")&&(Te[te]=`
`,X[te<<1]=ke++,X[te++<<1|1]=me)}else if(be==3||be==4){var we=me.nodeValue;we.length&&(he?we=we.replace(/\r\n?/g,`
`):we=we.replace(/[ \t\r\n]+/g," "),Te[te]=we,X[te<<1]=ke,ke+=we.length,X[te++<<1|1]=me)}}return pe(ce),{sourceCode:Te.join("").replace(/\n$/,""),spans:X}}function D(ce,he,Se,Te,ke){if(Se){var X={sourceNode:ce,pre:1,langExtension:null,numberLines:null,sourceCode:Se,spans:null,basePos:he,decorations:null};Te(X),ke.push.apply(ke,X.decorations)}}var I=/\S/;function F(ce){for(var he=void 0,Se=ce.firstChild;Se;Se=Se.nextSibling){var Te=Se.nodeType;he=Te===1?he?ce:Se:Te===3&&I.test(Se.nodeValue)?ce:he}return he===ce?void 0:he}function K(ce,he){var Se={},Te;(function(){for(var te=ce.concat(he),pe=[],me={},be=0,de=te.length;be<de;++be){var Be=te[be],we=Be[3];if(we)for(var Le=we.length;--Le>=0;)Se[we.charAt(Le)]=Be;var Ae=Be[1],Ve=""+Ae;me.hasOwnProperty(Ve)||(pe.push(Ae),me[Ve]=null)}pe.push(/[\0-\uffff]/),Te=w(pe)})();var ke=he.length,X=function(te){for(var pe=te.sourceCode,me=te.basePos,be=te.sourceNode,de=[me,L],Be=0,we=pe.match(Te)||[],Le={},Ae=0,Ve=we.length;Ae<Ve;++Ae){var De=we[Ae],ye=Le[De],Ee=void 0,Oe;if(typeof ye=="string")Oe=!1;else{var Fe=Se[De.charAt(0)];if(Fe)Ee=De.match(Fe[1]),ye=Fe[0];else{for(var Ke=0;Ke<ke;++Ke)if(Fe=he[Ke],Ee=De.match(Fe[1]),Ee){ye=Fe[0];break}Ee||(ye=L)}Oe=ye.length>=5&&ye.substring(0,5)==="lang-",Oe&&!(Ee&&typeof Ee[1]=="string")&&(Oe=!1,ye=g),Oe||(Le[De]=ye)}var ze=Be;if(Be+=De.length,!Oe)de.push(me+ze,ye);else{var Ye=Ee[1],Ie=De.indexOf(Ye),je=Ie+Ye.length;Ee[2]&&(je=De.length-Ee[2].length,Ie=je-Ye.length);var qe=ye.substring(5);D(be,me+ze,De.substring(0,Ie),X,de),D(be,me+ze+Ie,Ye,ue(qe,Ye),de),D(be,me+ze+je,De.substring(je),X,de)}}te.decorations=de};return X}function W(ce){var he=[],Se=[];ce.tripleQuotedStrings?he.push([u,/^(?:\'\'\'(?:[^\'\\]|\\[\s\S]|\'{1,2}(?=[^\']))*(?:\'\'\'|$)|\"\"\"(?:[^\"\\]|\\[\s\S]|\"{1,2}(?=[^\"]))*(?:\"\"\"|$)|\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$))/,null,`'"`]):ce.multiLineStrings?he.push([u,/^(?:\'(?:[^\\\']|\\[\s\S])*(?:\'|$)|\"(?:[^\\\"]|\\[\s\S])*(?:\"|$)|\`(?:[^\\\`]|\\[\s\S])*(?:\`|$))/,null,"'\"`"]):he.push([u,/^(?:\'(?:[^\\\'\r\n]|\\.)*(?:\'|$)|\"(?:[^\\\"\r\n]|\\.)*(?:\"|$))/,null,`"'`]),ce.verbatimStrings&&Se.push([u,/^@\"(?:[^\"]|\"\")*(?:\"|$)/,null]);var Te=ce.hashComments;Te&&(ce.cStyleComments?(Te>1?he.push([_,/^#(?:##(?:[^#]|#(?!##))*(?:###|$)|.*)/,null,"#"]):he.push([_,/^#(?:(?:define|e(?:l|nd)if|else|error|ifn?def|include|line|pragma|undef|warning)\b|[^\r\n]*)/,null,"#"]),Se.push([u,/^<(?:(?:(?:\.\.\/)*|\/?)(?:[\w-]+(?:\/[\w-]+)+)?[\w-]+\.h(?:h|pp|\+\+)?|[a-z]\w*)>/,null])):he.push([_,/^#[^\r\n]*/,null,"#"])),ce.cStyleComments&&(Se.push([_,/^\/\/[^\r\n]*/,null]),Se.push([_,/^\/\*[\s\S]*?(?:\*\/|$)/,null]));var ke=ce.regexLiterals;if(ke){var X=ke>1?"":`
\r`,te=X?".":"[\\S\\s]",pe="/(?=[^/*"+X+"])(?:[^/\\x5B\\x5C"+X+"]|\\x5C"+te+"|\\x5B(?:[^\\x5C\\x5D"+X+"]|\\x5C"+te+")*(?:\\x5D|$))+/";Se.push(["lang-regex",RegExp("^"+A+"("+pe+")")])}var me=ce.types;me&&Se.push([y,me]);var be=(""+ce.keywords).replace(/^ | $/g,"");be.length&&Se.push([c,new RegExp("^(?:"+be.replace(/[\s,]+/g,"|")+")\\b"),null]),he.push([L,/^\s+/,null,` \r
\xA0`]);var de="^.[^\\s\\w.$@'\"`/\\\\]*";return ce.regexLiterals&&(de+="(?!s*/)"),Se.push([f,/^@[a-z_$][a-z_$@0-9]*/i,null],[y,/^(?:[@_]?[A-Z]+[a-z][A-Za-z_$@0-9]*|\w+_t\b)/,null],[L,/^[a-z_$][a-z_$@0-9]*/i,null],[f,new RegExp("^(?:0x[a-f0-9]+|(?:\\d(?:_\\d+)*\\d*(?:\\.\\d*)?|\\.\\d\\+)(?:e[+\\-]?\\d+)?)[a-z]*","i"),null,"0123456789"],[L,/^\\[\s\S]?/,null],[C,new RegExp(de),null]),K(he,Se)}var z=W({keywords:l,hashComments:!0,cStyleComments:!0,multiLineStrings:!0,regexLiterals:!0});function j(ce,he,Se){for(var Te=/(?:^|\s)nocode(?:\s|$)/,ke=/\r\n?|\n/,X=ce.ownerDocument,te=X.createElement("li");ce.firstChild;)te.appendChild(ce.firstChild);var pe=[te];function me(Ae){var Ve=Ae.nodeType;if(Ve==1&&!Te.test(Ae.className))if(Ae.nodeName==="br")be(Ae),Ae.parentNode&&Ae.parentNode.removeChild(Ae);else for(var De=Ae.firstChild;De;De=De.nextSibling)me(De);else if((Ve==3||Ve==4)&&Se){var ye=Ae.nodeValue,Ee=ye.match(ke);if(Ee){var Oe=ye.substring(0,Ee.index);Ae.nodeValue=Oe;var Fe=ye.substring(Ee.index+Ee[0].length);if(Fe){var Ke=Ae.parentNode;Ke.insertBefore(X.createTextNode(Fe),Ae.nextSibling)}be(Ae),Oe||Ae.parentNode.removeChild(Ae)}}}function be(Ae){for(;!Ae.nextSibling;)if(Ae=Ae.parentNode,!Ae)return;function Ve(Ee,Oe){var Fe=Oe?Ee.cloneNode(!1):Ee,Ke=Ee.parentNode;if(Ke){var ze=Ve(Ke,1),Ye=Ee.nextSibling;ze.appendChild(Fe);for(var Ie=Ye;Ie;Ie=Ye)Ye=Ie.nextSibling,ze.appendChild(Ie)}return Fe}for(var De=Ve(Ae.nextSibling,0),ye;(ye=De.parentNode)&&ye.nodeType===1;)De=ye;pe.push(De)}for(var de=0;de<pe.length;++de)me(pe[de]);he===(he|0)&&pe[0].setAttribute("value",he);var Be=X.createElement("ol");Be.className="linenums";for(var we=Math.max(0,he-1|0)||0,de=0,Le=pe.length;de<Le;++de)te=pe[de],te.className="L"+(de+we)%10,te.firstChild||te.appendChild(X.createTextNode("\xA0")),Be.appendChild(te);ce.appendChild(Be)}function G(ce){var he=/\bMSIE\s(\d+)/.exec(navigator.userAgent);he=he&&+he[1]<=8;var Se=/\n/g,Te=ce.sourceCode,ke=Te.length,X=0,te=ce.spans,pe=te.length,me=0,be=ce.decorations,de=be.length,Be=0;be[de]=ke;var we,Le;for(Le=we=0;Le<de;)be[Le]!==be[Le+2]?(be[we++]=be[Le++],be[we++]=be[Le++]):Le+=2;for(de=we,Le=we=0;Le<de;){for(var Ae=be[Le],Ve=be[Le+1],De=Le+2;De+2<=de&&be[De+1]===Ve;)De+=2;be[we++]=Ae,be[we++]=Ve,Le=De}de=be.length=we;var ye=ce.sourceNode,Ee="";ye&&(Ee=ye.style.display,ye.style.display="none");try{for(var Oe=null;me<pe;){var Fe=te[me],Ke=te[me+2]||ke,ze=be[Be+2]||ke,De=Math.min(Ke,ze),Ye=te[me+1],Ie;if(Ye.nodeType!==1&&(Ie=Te.substring(X,De))){he&&(Ie=Ie.replace(Se,"\r")),Ye.nodeValue=Ie;var je=Ye.ownerDocument,qe=je.createElement("span");qe.className=be[Be+1];var Pe=Ye.parentNode;Pe.replaceChild(qe,Ye),qe.appendChild(Ye),X<Ke&&(te[me+1]=Ye=je.createTextNode(Te.substring(De,Ke)),Pe.insertBefore(Ye,qe.nextSibling))}X=De,X>=Ke&&(me+=2),X>=ze&&(Be+=2)}}finally{ye&&(ye.style.display=Ee)}}var Z={};function Q(ce,he){for(var Se=he.length;--Se>=0;){var Te=he[Se];Z.hasOwnProperty(Te)?P.console&&console.warn("cannot override language handler %s",Te):Z[Te]=ce}}function ue(ce,he){return ce&&Z.hasOwnProperty(ce)||(ce=/^\s*</.test(he)?"default-markup":"default-code"),Z[ce]}Q(z,["default-code"]),Q(K([],[[L,/^[^<?]+/],[O,/^<!\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"]),Q(K([[L,/^[\s]+/,null,` \r
`],[d,/^(?:\"[^\"]*\"?|\'[^\']*\'?)/,null,`"'`]],[[R,/^^<\/?[a-z](?:[\w.:-]*\w)?|\/?>$/i],[m,/^(?!style[\s=]|on)[a-z](?:[\w:-]*\w)?/i],["lang-uq.val",/^=\s*([^>\'\"\s]*(?:[^>\'\"\s\/]|\/(?=\s)))/],[C,/^[=<>\/]+/],["lang-js",/^on\w+\s*=\s*\"([^\"]+)\"/i],["lang-js",/^on\w+\s*=\s*\'([^\']+)\'/i],["lang-js",/^on\w+\s*=\s*([^\"\'>\s]+)/i],["lang-css",/^style\s*=\s*\"([^\"]+)\"/i],["lang-css",/^style\s*=\s*\'([^\']+)\'/i],["lang-css",/^style\s*=\s*([^\"\'>\s]+)/i]]),["in.tag"]),Q(K([],[[d,/^[\s\S]+/]]),["uq.val"]),Q(W({keywords:E,hashComments:!0,cStyleComments:!0,types:o}),["c","cc","cpp","cxx","cyc","m"]),Q(W({keywords:"null,true,false"}),["json"]),Q(W({keywords:n,hashComments:!0,cStyleComments:!0,verbatimStrings:!0,types:o}),["cs"]),Q(W({keywords:s,cStyleComments:!0}),["java"]),Q(W({keywords:p,hashComments:!0,multiLineStrings:!0}),["bash","bsh","csh","sh"]),Q(W({keywords:a,hashComments:!0,multiLineStrings:!0,tripleQuotedStrings:!0}),["cv","py","python"]),Q(W({keywords:i,hashComments:!0,multiLineStrings:!0,regexLiterals:2}),["perl","pl","pm"]),Q(W({keywords:v,hashComments:!0,multiLineStrings:!0,regexLiterals:!0}),["rb","ruby"]),Q(W({keywords:r,cStyleComments:!0,regexLiterals:!0}),["javascript","js","ts","typescript"]),Q(W({keywords:t,hashComments:3,cStyleComments:!0,multilineStrings:!0,tripleQuotedStrings:!0,regexLiterals:!0}),["coffee"]),Q(K([],[[u,/^[\s\S]+/]]),["regex"]);function ee(ce){var he=ce.langExtension;try{var Se=x(ce.sourceNode,ce.pre),Te=Se.sourceCode;ce.sourceCode=Te,ce.spans=Se.spans,ce.basePos=0,ue(he,Te)(ce),G(ce)}catch(ke){P.console&&console.log(ke&&ke.stack||ke)}}function ae(ce,he,Se){var Te=Se||!1,ke=he||null,X=document.createElement("div");X.innerHTML="<pre>"+ce+"</pre>",X=X.firstChild,Te&&j(X,Te,!0);var te={langExtension:ke,numberLines:Te,sourceNode:X,pre:1,sourceCode:null,basePos:null,spans:null,decorations:null};return ee(te),X.innerHTML}function _e(ce,he){var Se=he||document.body,Te=Se.ownerDocument||document;function ke(Fe){return Se.getElementsByTagName(Fe)}for(var X=[ke("pre"),ke("code"),ke("xmp")],te=[],pe=0;pe<X.length;++pe)for(var me=0,be=X[pe].length;me<be;++me)te.push(X[pe][me]);X=null;var de=Date;de.now||(de={now:function(){return+new Date}});var Be=0,we=/\blang(?:uage)?-([\w.]+)(?!\S)/,Le=/\bprettyprint\b/,Ae=/\bprettyprinted\b/,Ve=/pre|xmp/i,De=/^code$/i,ye=/^(?:pre|code|xmp)$/i,Ee={};function Oe(){for(var Fe=P.PR_SHOULD_USE_CONTINUATION?de.now()+250:1/0;Be<te.length&&de.now()<Fe;Be++){for(var Ke=te[Be],ze=Ee,Ye=Ke;Ye=Ye.previousSibling;){var Ie=Ye.nodeType,je=(Ie===7||Ie===8)&&Ye.nodeValue;if(je?!/^\??prettify\b/.test(je):Ie!==3||/\S/.test(Ye.nodeValue))break;if(je){ze={},je.replace(/\b(\w+)=([\w:.%+-]+)/g,function(Ce,Ue,We){ze[Ue]=We});break}}var qe=Ke.className;if((ze!==Ee||Le.test(qe))&&!Ae.test(qe)){for(var Pe=!1,Ze=Ke.parentNode;Ze;Ze=Ze.parentNode){var se=Ze.tagName;if(ye.test(se)&&Ze.className&&Le.test(Ze.className)){Pe=!0;break}}if(!Pe){Ke.className+=" prettyprinted";var ie=ze.lang;if(!ie){ie=qe.match(we);var le;!ie&&(le=F(Ke))&&De.test(le.tagName)&&(ie=le.className.match(we)),ie&&(ie=ie[1])}var V;if(Ve.test(Ke.tagName))V=1;else{var J=Ke.currentStyle,q=Te.defaultView,fe=J?J.whiteSpace:q&&q.getComputedStyle?q.getComputedStyle(Ke,null).getPropertyValue("white-space"):0;V=fe&&fe.substring(0,3)==="pre"}var ne=ze.linenums;(ne=ne==="true"||+ne)||(ne=qe.match(/\blinenums\b(?::(\d+))?/),ne=ne?ne[1]&&ne[1].length?+ne[1]:!0:!1),ne&&j(Ke,ne,V);var ve={langExtension:ie,sourceNode:Ke,numberLines:ne,pre:V,sourceCode:null,basePos:null,spans:null,decorations:null};ee(ve)}}}Be<te.length?P.setTimeout(Oe,250):typeof ce=="function"&&ce()}Oe()}var xe=P.PR={createSimpleLexer:K,registerLangHandler:Q,sourceDecorator:W,PR_ATTRIB_NAME:m,PR_ATTRIB_VALUE:d,PR_COMMENT:_,PR_DECLARATION:O,PR_KEYWORD:c,PR_LITERAL:f,PR_NOCODE:h,PR_PLAIN:L,PR_PUNCTUATION:C,PR_SOURCE:g,PR_STRING:u,PR_TAG:R,PR_TYPE:y,prettyPrintOne:N?P.prettyPrintOne=ae:k=ae,prettyPrint:S=N?P.prettyPrint=_e:S=_e},ge=P.define;typeof ge=="function"&&ge.amd&&ge("google-code-prettify",[],function(){return xe})})()},20640:function(Ge,re,M){"use strict";var N=M(11742),B={"text/plain":"Text","text/html":"Url",default:"Text"},U="Copy to clipboard: #{key}, Enter";function k(P){var T=(/mac os x/i.test(navigator.userAgent)?"\u2318":"Ctrl")+"+C";return P.replace(/#{\s*key\s*}/g,T)}function S(P,T){var b,e,E,s,n,t,r=!1;T||(T={}),b=T.debug||!1;try{E=N(),s=document.createRange(),n=document.getSelection(),t=document.createElement("span"),t.textContent=P,t.ariaHidden="true",t.style.all="unset",t.style.position="fixed",t.style.top=0,t.style.clip="rect(0, 0, 0, 0)",t.style.whiteSpace="pre",t.style.webkitUserSelect="text",t.style.MozUserSelect="text",t.style.msUserSelect="text",t.style.userSelect="text",t.addEventListener("copy",function(a){if(a.stopPropagation(),T.format)if(a.preventDefault(),typeof a.clipboardData=="undefined"){b&&console.warn("unable to use e.clipboardData"),b&&console.warn("trying IE specific stuff"),window.clipboardData.clearData();var v=B[T.format]||B.default;window.clipboardData.setData(v,P)}else a.clipboardData.clearData(),a.clipboardData.setData(T.format,P);T.onCopy&&(a.preventDefault(),T.onCopy(a.clipboardData))}),document.body.appendChild(t),s.selectNodeContents(t),n.addRange(s);var i=document.execCommand("copy");if(!i)throw new Error("copy command was unsuccessful");r=!0}catch(a){b&&console.error("unable to copy using execCommand: ",a),b&&console.warn("trying IE specific stuff");try{window.clipboardData.setData(T.format||"text",P),T.onCopy&&T.onCopy(window.clipboardData),r=!0}catch(v){b&&console.error("unable to copy using clipboardData: ",v),b&&console.error("falling back to prompt"),e=k("message"in T?T.message:U),window.prompt(e,P)}}finally{n&&(typeof n.removeRange=="function"?n.removeRange(s):n.removeAllRanges()),t&&document.body.removeChild(t),E()}return r}Ge.exports=S},67631:function(Ge){typeof window!="undefined"&&function(M,N){Ge.exports=N()}(this,()=>(()=>{var re={"./src/config.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{enableStreamingMode:()=>m,hlsDefaultConfig:()=>R,mergeConfig:()=>g});var P=S("./src/controller/abr-controller.ts"),T=S("./src/controller/audio-stream-controller.ts"),b=S("./src/controller/audio-track-controller.ts"),e=S("./src/controller/subtitle-stream-controller.ts"),E=S("./src/controller/subtitle-track-controller.ts"),s=S("./src/controller/buffer-controller.ts"),n=S("./src/controller/timeline-controller.ts"),t=S("./src/controller/cap-level-controller.ts"),r=S("./src/controller/fps-controller.ts"),i=S("./src/controller/eme-controller.ts"),a=S("./src/controller/cmcd-controller.ts"),v=S("./src/utils/xhr-loader.ts"),p=S("./src/utils/fetch-loader.ts"),l=S("./src/utils/cues.ts"),o=S("./src/utils/mediakeys-helper.ts"),u=S("./src/utils/logger.ts");function c(){return c=Object.assign?Object.assign.bind():function(d){for(var h=1;h<arguments.length;h++){var A=arguments[h];for(var w in A)Object.prototype.hasOwnProperty.call(A,w)&&(d[w]=A[w])}return d},c.apply(this,arguments)}function _(d,h){var A=Object.keys(d);if(Object.getOwnPropertySymbols){var w=Object.getOwnPropertySymbols(d);h&&(w=w.filter(function(x){return Object.getOwnPropertyDescriptor(d,x).enumerable})),A.push.apply(A,w)}return A}function y(d){for(var h=1;h<arguments.length;h++){var A=arguments[h]!=null?arguments[h]:{};h%2?_(Object(A),!0).forEach(function(w){f(d,w,A[w])}):Object.getOwnPropertyDescriptors?Object.defineProperties(d,Object.getOwnPropertyDescriptors(A)):_(Object(A)).forEach(function(w){Object.defineProperty(d,w,Object.getOwnPropertyDescriptor(A,w))})}return d}function f(d,h,A){return h=C(h),h in d?Object.defineProperty(d,h,{value:A,enumerable:!0,configurable:!0,writable:!0}):d[h]=A,d}function C(d){var h=L(d,"string");return typeof h=="symbol"?h:String(h)}function L(d,h){if(typeof d!="object"||d===null)return d;var A=d[Symbol.toPrimitive];if(A!==void 0){var w=A.call(d,h||"default");if(typeof w!="object")return w;throw new TypeError("@@toPrimitive must return a primitive value.")}return(h==="string"?String:Number)(d)}var R=y(y({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,maxBufferSize:60*1e3*1e3,maxBufferHole:.1,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,maxFragLookUpTolerance:.25,liveSyncDurationCount:3,liveMaxLatencyDurationCount:1/0,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:v.default,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:P.default,bufferController:s.default,capLevelController:t.default,fpsController:r.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,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:o.requestMediaKeySystemAccess,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableID3MetadataCues:!0},O()),{},{subtitleStreamController:e.SubtitleStreamController,subtitleTrackController:E.default,timelineController:n.TimelineController,audioStreamController:T.default,audioTrackController:b.default,emeController:i.default,cmcdController:a.default});function O(){return{cueHandler:l.default,enableWebVTT:!0,enableIMSC1:!0,enableCEA708Captions:!0,captionsTextTrack1Label:"English",captionsTextTrack1LanguageCode:"en",captionsTextTrack2Label:"Spanish",captionsTextTrack2LanguageCode:"es",captionsTextTrack3Label:"Unknown CC",captionsTextTrack3LanguageCode:"",captionsTextTrack4Label:"Unknown CC",captionsTextTrack4LanguageCode:"",renderTextTracksNatively:!0}}function g(d,h){if((h.liveSyncDurationCount||h.liveMaxLatencyDurationCount)&&(h.liveSyncDuration||h.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(h.liveMaxLatencyDurationCount!==void 0&&(h.liveSyncDurationCount===void 0||h.liveMaxLatencyDurationCount<=h.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(h.liveMaxLatencyDuration!==void 0&&(h.liveSyncDuration===void 0||h.liveMaxLatencyDuration<=h.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');return c({},d,h)}function m(d){var h=d.loader;if(h!==p.default&&h!==v.default)u.logger.log("[config]: Custom loader detected, cannot enable progressive streaming"),d.progressive=!1;else{var A=(0,p.fetchSupported)();A&&(d.loader=p.default,d.progressive=!0,d.enableSoftwareAES=!0,u.logger.log("[config]: Progressive streaming enabled, using FetchLoader"))}}},"./src/controller/abr-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>v});var P=S("./src/polyfills/number.ts"),T=S("./src/utils/ewma-bandwidth-estimator.ts"),b=S("./src/events.ts"),e=S("./src/errors.ts"),E=S("./src/types/loader.ts"),s=S("./src/utils/logger.ts");function n(p,l){for(var o=0;o<l.length;o++){var u=l[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,r(u.key),u)}}function t(p,l,o){return l&&n(p.prototype,l),o&&n(p,o),Object.defineProperty(p,"prototype",{writable:!1}),p}function r(p){var l=i(p,"string");return typeof l=="symbol"?l:String(l)}function i(p,l){if(typeof p!="object"||p===null)return p;var o=p[Symbol.toPrimitive];if(o!==void 0){var u=o.call(p,l||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(p)}var a=function(){function p(o){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=o;var u=o.config;this.bwEstimator=new T.default(u.abrEwmaSlowVoD,u.abrEwmaFastVoD,u.abrEwmaDefaultEstimate),this.registerListeners()}var l=p.prototype;return l.registerListeners=function(){var u=this.hls;u.on(b.Events.FRAG_LOADING,this.onFragLoading,this),u.on(b.Events.FRAG_LOADED,this.onFragLoaded,this),u.on(b.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.on(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.on(b.Events.ERROR,this.onError,this)},l.unregisterListeners=function(){var u=this.hls;u.off(b.Events.FRAG_LOADING,this.onFragLoading,this),u.off(b.Events.FRAG_LOADED,this.onFragLoaded,this),u.off(b.Events.FRAG_BUFFERED,this.onFragBuffered,this),u.off(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),u.off(b.Events.ERROR,this.onError,this)},l.destroy=function(){this.unregisterListeners(),this.clearTimer(),this.hls=this.onCheck=null,this.fragCurrent=this.partCurrent=null},l.onFragLoading=function(u,c){var _=c.frag;if(_.type===E.PlaylistLevelType.MAIN&&!this.timer){var y;this.fragCurrent=_,this.partCurrent=(y=c.part)!=null?y:null,this.timer=self.setInterval(this.onCheck,100)}},l.onLevelLoaded=function(u,c){var _=this.hls.config;c.details.live?this.bwEstimator.update(_.abrEwmaSlowLive,_.abrEwmaFastLive):this.bwEstimator.update(_.abrEwmaSlowVoD,_.abrEwmaFastVoD)},l._abandonRulesCheck=function(){var u=this.fragCurrent,c=this.partCurrent,_=this.hls,y=_.autoLevelEnabled,f=_.media;if(!(!u||!f)){var C=c?c.stats:u.stats,L=c?c.duration:u.duration;if(C.aborted||C.loaded&&C.loaded===C.total||u.level===0){this.clearTimer(),this._nextAutoLevel=-1;return}if(!(!y||f.paused||!f.playbackRate||!f.readyState)){var R=_.mainForwardBufferInfo;if(R!==null){var O=performance.now()-C.loading.start,g=Math.abs(f.playbackRate);if(!(O<=500*L/g)){var m=C.loaded&&C.loading.first,d=this.bwEstimator.getEstimate(),h=_.levels,A=_.minAutoLevel,w=h[u.level],x=C.total||Math.max(C.loaded,Math.round(L*w.maxBitrate/8)),D=m?C.loaded*1e3/O:0,I=D?(x-C.loaded)/D:x*8/d,F=R.len/g;if(!(I<=F)){var K=Number.POSITIVE_INFINITY,W;for(W=u.level-1;W>A;W--){var z=h[W].maxBitrate;if(K=D?L*z/(8*.8*D):L*z/d,K<F)break}K>=I||(s.logger.warn("Fragment "+u.sn+(c?" part "+c.index:"")+" of level "+u.level+" is loading too slowly and will cause an underbuffer; aborting and switching to level "+W+`
Current BW estimate: `+((0,P.isFiniteNumber)(d)?(d/1024).toFixed(3):"Unknown")+` Kb/s
Estimated load time for current fragment: `+I.toFixed(3)+` s
Estimated load time for the next fragment: `+K.toFixed(3)+` s
Time to underbuffer: `+F.toFixed(3)+" s"),_.nextLoadLevel=W,m&&this.bwEstimator.sample(O,C.loaded),this.clearTimer(),(u.loader||u.keyLoader)&&(this.fragCurrent=this.partCurrent=null,u.abortRequests()),_.trigger(b.Events.FRAG_LOAD_EMERGENCY_ABORTED,{frag:u,part:c,stats:C}))}}}}}},l.onFragLoaded=function(u,c){var _=c.frag,y=c.part;if(_.type===E.PlaylistLevelType.MAIN&&(0,P.isFiniteNumber)(_.sn)){var f=y?y.stats:_.stats,C=y?y.duration:_.duration;if(this.clearTimer(),this.lastLoadedFragLevel=_.level,this._nextAutoLevel=-1,this.hls.config.abrMaxWithRealBitrate){var L=this.hls.levels[_.level],R=(L.loaded?L.loaded.bytes:0)+f.loaded,O=(L.loaded?L.loaded.duration:0)+C;L.loaded={bytes:R,duration:O},L.realBitrate=Math.round(8*R/O)}if(_.bitrateTest){var g={stats:f,frag:_,part:y,id:_.type};this.onFragBuffered(b.Events.FRAG_BUFFERED,g)}}},l.onFragBuffered=function(u,c){var _=c.frag,y=c.part,f=y?y.stats:_.stats;if(!f.aborted&&!(_.type!==E.PlaylistLevelType.MAIN||_.sn==="initSegment")){var C=f.parsing.end-f.loading.start;this.bwEstimator.sample(C,f.loaded),f.bwEstimate=this.bwEstimator.getEstimate(),_.bitrateTest?this.bitrateTestDelay=C/1e3:this.bitrateTestDelay=0}},l.onError=function(u,c){var _;if(((_=c.frag)===null||_===void 0?void 0:_.type)===E.PlaylistLevelType.MAIN){if(c.type===e.ErrorTypes.KEY_SYSTEM_ERROR){this.clearTimer();return}switch(c.details){case e.ErrorDetails.FRAG_LOAD_ERROR:case e.ErrorDetails.FRAG_LOAD_TIMEOUT:case e.ErrorDetails.KEY_LOAD_ERROR:case e.ErrorDetails.KEY_LOAD_TIMEOUT:this.clearTimer();break;default:break}}},l.clearTimer=function(){self.clearInterval(this.timer),this.timer=void 0},l.getNextABRAutoLevel=function(){var u=this.fragCurrent,c=this.partCurrent,_=this.hls,y=_.maxAutoLevel,f=_.config,C=_.minAutoLevel,L=_.media,R=c?c.duration:u?u.duration:0,O=L&&L.playbackRate!==0?Math.abs(L.playbackRate):1,g=this.bwEstimator?this.bwEstimator.getEstimate():f.abrEwmaDefaultEstimate,m=_.mainForwardBufferInfo,d=(m?m.len:0)/O,h=this.findBestLevel(g,C,y,d,f.abrBandWidthFactor,f.abrBandWidthUpFactor);if(h>=0)return h;s.logger.trace((d?"rebuffering expected":"buffer is empty")+", finding optimal quality level");var A=R?Math.min(R,f.maxStarvationDelay):f.maxStarvationDelay,w=f.abrBandWidthFactor,x=f.abrBandWidthUpFactor;if(!d){var D=this.bitrateTestDelay;if(D){var I=R?Math.min(R,f.maxLoadingDelay):f.maxLoadingDelay;A=I-D,s.logger.trace("bitrate test took "+Math.round(1e3*D)+"ms, set first fragment max fetchDuration to "+Math.round(1e3*A)+" ms"),w=x=1}}return h=this.findBestLevel(g,C,y,d+A,w,x),Math.max(h,0)},l.findBestLevel=function(u,c,_,y,f,C){for(var L,R=this.fragCurrent,O=this.partCurrent,g=this.lastLoadedFragLevel,m=this.hls.levels,d=m[g],h=!!(d!=null&&(L=d.details)!==null&&L!==void 0&&L.live),A=d==null?void 0:d.codecSet,w=O?O.duration:R?R.duration:0,x=_;x>=c;x--){var D=m[x];if(!(!D||A&&D.codecSet!==A)){var I=D.details,F=(O?I==null?void 0:I.partTarget:I==null?void 0:I.averagetargetduration)||w,K=void 0;x<=g?K=f*u:K=C*u;var W=m[x].maxBitrate,z=W*F/K;if(s.logger.trace("level/adjustedbw/bitrate/avgDuration/maxFetchDuration/fetchDuration: "+x+"/"+Math.round(K)+"/"+W+"/"+F+"/"+y+"/"+z),K>W&&(z===0||!(0,P.isFiniteNumber)(z)||h&&!this.bitrateTestDelay||z<y))return x}}return-1},t(p,[{key:"nextAutoLevel",get:function(){var u=this._nextAutoLevel,c=this.bwEstimator;if(u!==-1&&!c.canEstimate())return u;var _=this.getNextABRAutoLevel();return u!==-1&&this.hls.levels[_].loadError?u:(u!==-1&&(_=Math.min(u,_)),_)},set:function(u){this._nextAutoLevel=u}}]),p}();const v=a},"./src/controller/audio-stream-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>f});var P=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),b=S("./src/events.ts"),e=S("./src/utils/buffer-helper.ts"),E=S("./src/controller/fragment-tracker.ts"),s=S("./src/types/level.ts"),n=S("./src/types/loader.ts"),t=S("./src/loader/fragment.ts"),r=S("./src/demux/chunk-cache.ts"),i=S("./src/demux/transmuxer-interface.ts"),a=S("./src/types/transmuxer.ts"),v=S("./src/controller/fragment-finders.ts"),p=S("./src/utils/discontinuities.ts"),l=S("./src/errors.ts");function o(){return o=Object.assign?Object.assign.bind():function(C){for(var L=1;L<arguments.length;L++){var R=arguments[L];for(var O in R)Object.prototype.hasOwnProperty.call(R,O)&&(C[O]=R[O])}return C},o.apply(this,arguments)}function u(C,L){C.prototype=Object.create(L.prototype),C.prototype.constructor=C,c(C,L)}function c(C,L){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,g){return O.__proto__=g,O},c(C,L)}var _=100,y=function(C){u(L,C);function L(O,g,m){var d;return d=C.call(this,O,g,m,"[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.cachedTrackLoadedData=null,d._registerListeners(),d}var R=L.prototype;return R.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},R._registerListeners=function(){var g=this.hls;g.on(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(b.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.on(b.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(b.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.on(b.Events.ERROR,this.onError,this),g.on(b.Events.BUFFER_RESET,this.onBufferReset,this),g.on(b.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(b.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(b.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.on(b.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var g=this.hls;g.off(b.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(b.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(b.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(b.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(b.Events.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),g.off(b.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(b.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),g.off(b.Events.ERROR,this.onError,this),g.off(b.Events.BUFFER_RESET,this.onBufferReset,this),g.off(b.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(b.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(b.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),g.off(b.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onInitPtsFound=function(g,m){var d=m.frag,h=m.id,A=m.initPTS;if(h==="main"){var w=d.cc;this.initPTS[d.cc]=A,this.log("InitPTS for cc: "+w+" found from main: "+A),this.videoTrackCC=w,this.state===T.State.WAITING_INIT_PTS&&this.tick()}},R.startLoad=function(g){if(!this.levels){this.startPosition=g,this.state=T.State.STOPPED;return}var m=this.lastCurrentTime;this.stopLoad(),this.setInterval(_),this.fragLoadError=0,m>0&&g===-1?(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),g=m,this.state=T.State.IDLE):(this.loadedmetadata=!1,this.state=T.State.WAITING_TRACK),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()},R.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_TRACK:{var g,m=this.levels,d=this.trackId,h=m==null||(g=m[d])===null||g===void 0?void 0:g.details;if(h){if(this.waitForCdnTuneIn(h))break;this.state=T.State.WAITING_INIT_PTS}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var A,w=performance.now(),x=this.retryDate;(!x||w>=x||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("RetryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.trackId),this.state=T.State.IDLE);break}case T.State.WAITING_INIT_PTS:{var D=this.waitingData;if(D){var I=D.frag,F=D.part,K=D.cache,W=D.complete;if(this.initPTS[I.cc]!==void 0){this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.FRAG_LOADING;var z=K.flush(),j={frag:I,part:F,payload:z,networkDetails:null};this._handleFragmentLoadProgress(j),W&&C.prototype._handleFragmentLoadComplete.call(this,j)}else if(this.videoTrackCC!==this.waitingVideoCC)this.log("Waiting fragment cc ("+I.cc+") cancelled because video is at cc "+this.videoTrackCC),this.clearWaitingFragment();else{var G=this.getLoadPosition(),Z=e.BufferHelper.bufferInfo(this.mediaBuffer,G,this.config.maxBufferHole),Q=(0,v.fragmentWithinToleranceTest)(Z.end,this.config.maxFragLookUpTolerance,I);Q<0&&(this.log("Waiting fragment cc ("+I.cc+") @ "+I.start+" cancelled because another fragment at "+Z.end+" is needed"),this.clearWaitingFragment())}}else this.state=T.State.IDLE}}this.onTickEnd()},R.clearWaitingFragment=function(){var g=this.waitingData;g&&(this.fragmentTracker.removeFragment(g.frag),this.waitingData=null,this.waitingVideoCC=-1,this.state=T.State.IDLE)},R.resetLoadingState=function(){this.clearWaitingFragment(),C.prototype.resetLoadingState.call(this)},R.onTickEnd=function(){var g=this.media;!g||!g.readyState||(this.lastCurrentTime=g.currentTime)},R.doTickIdle=function(){var g=this.hls,m=this.levels,d=this.media,h=this.trackId,A=g.config;if(!(!m||!m[h])&&!(!d&&(this.startFragRequested||!A.startFragPrefetch))){var w=m[h],x=w.details;if(!x||x.live&&this.levelLastLoaded!==h||this.waitForCdnTuneIn(x)){this.state=T.State.WAITING_TRACK;return}var D=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&D&&(this.bufferFlushed=!1,this.afterBufferFlushed(D,t.ElementaryStreamTypes.AUDIO,n.PlaylistLevelType.AUDIO));var I=this.getFwdBufferInfo(D,n.PlaylistLevelType.AUDIO);if(I!==null){var F=this.audioSwitch;if(!F&&this._streamEnded(I,x)){g.trigger(b.Events.BUFFER_EOS,{type:"audio"}),this.state=T.State.ENDED;return}var K=this.getFwdBufferInfo(this.videoBuffer?this.videoBuffer:this.media,n.PlaylistLevelType.MAIN),W=I.len,z=this.getMaxBufferLength(K==null?void 0:K.len);if(!(W>=z&&!F)){var j=x.fragments,G=j[0].start,Z=I.end;if(F&&d){var Q=this.getLoadPosition();Z=Q,x.PTSKnown&&Q<G&&(I.end>G||I.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),d.currentTime=G+.05)}if(!(K&&Z>K.end+x.targetduration)&&!((!K||!K.len)&&I.len)){var ue=this.getNextFragment(Z,x);if(!ue){this.bufferFlushed=!0;return}this.loadFragment(ue,x,Z)}}}}},R.getMaxBufferLength=function(g){var m=C.prototype.getMaxBufferLength.call(this);return g?Math.max(m,g):m},R.onMediaDetaching=function(){this.videoBuffer=null,C.prototype.onMediaDetaching.call(this)},R.onAudioTracksUpdated=function(g,m){var d=m.audioTracks;this.resetTransmuxer(),this.levels=d.map(function(h){return new s.Level(h)})},R.onAudioTrackSwitching=function(g,m){var d=!!m.url;this.trackId=m.id;var h=this.fragCurrent;h&&h.abortRequests(),this.fragCurrent=null,this.clearWaitingFragment(),d?this.setInterval(_):this.resetTransmuxer(),d?(this.audioSwitch=!0,this.state=T.State.IDLE):this.state=T.State.STOPPED,this.tick()},R.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments(),this.startPosition=this.lastCurrentTime=0,this.bufferFlushed=!1},R.onLevelLoaded=function(g,m){this.mainDetails=m.details,this.cachedTrackLoadedData!==null&&(this.hls.trigger(b.Events.AUDIO_TRACK_LOADED,this.cachedTrackLoadedData),this.cachedTrackLoadedData=null)},R.onAudioTrackLoaded=function(g,m){var d;if(this.mainDetails==null){this.cachedTrackLoadedData=m;return}var h=this.levels,A=m.details,w=m.id;if(!h){this.warn("Audio tracks were reset while loading level "+w);return}this.log("Track "+w+" loaded ["+A.startSN+","+A.endSN+"],duration:"+A.totalduration);var x=h[w],D=0;if(A.live||(d=x.details)!==null&&d!==void 0&&d.live){var I=this.mainDetails;if(A.fragments[0]||(A.deltaUpdateFailed=!0),A.deltaUpdateFailed||!I)return;!x.details&&A.hasProgramDateTime&&I.hasProgramDateTime?((0,p.alignMediaPlaylistByPDT)(A,I),D=A.fragments[0].start):D=this.alignPlaylists(A,x.details)}x.details=A,this.levelLastLoaded=w,!this.startFragRequested&&(this.mainDetails||!A.live)&&this.setStartPosition(x.details,D),this.state===T.State.WAITING_TRACK&&!this.waitForCdnTuneIn(A)&&(this.state=T.State.IDLE),this.tick()},R._handleFragmentLoadProgress=function(g){var m,d=g.frag,h=g.part,A=g.payload,w=this.config,x=this.trackId,D=this.levels;if(!D){this.warn("Audio tracks were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var I=D[x];console.assert(I,"Audio track is defined on fragment load progress");var F=I.details;console.assert(F,"Audio track details are defined on fragment load progress");var K=w.defaultAudioCodec||I.audioCodec||"mp4a.40.2",W=this.transmuxer;W||(W=this.transmuxer=new i.default(this.hls,n.PlaylistLevelType.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));var z=this.initPTS[d.cc],j=(m=d.initSegment)===null||m===void 0?void 0:m.data;if(z!==void 0){var G=!1,Z=h?h.index:-1,Q=Z!==-1,ue=new a.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,A.byteLength,Z,Q);W.push(A,j,K,"",d,h,F.totalduration,G,ue,z)}else{this.log("Unknown video PTS for cc "+d.cc+", waiting for video PTS before demuxing audio frag "+d.sn+" of ["+F.startSN+" ,"+F.endSN+"],track "+x);var ee=this.waitingData=this.waitingData||{frag:d,part:h,cache:new r.default,complete:!1},ae=ee.cache;ae.push(new Uint8Array(A)),this.waitingVideoCC=this.videoTrackCC,this.state=T.State.WAITING_INIT_PTS}},R._handleFragmentLoadComplete=function(g){if(this.waitingData){this.waitingData.complete=!0;return}C.prototype._handleFragmentLoadComplete.call(this,g)},R.onBufferReset=function(){this.mediaBuffer=this.videoBuffer=null,this.loadedmetadata=!1},R.onBufferCreated=function(g,m){var d=m.tracks.audio;d&&(this.mediaBuffer=d.buffer||null),m.tracks.video&&(this.videoBuffer=m.tracks.video.buffer||null)},R.onFragBuffered=function(g,m){var d=m.frag,h=m.part;if(d.type!==n.PlaylistLevelType.AUDIO){if(!this.loadedmetadata&&d.type===n.PlaylistLevelType.MAIN){var A;(A=this.videoBuffer||this.media)!==null&&A!==void 0&&A.buffered.length&&(this.loadedmetadata=!0)}return}if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(h?" p: "+h.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state+", audioSwitch: "+this.audioSwitch);return}d.sn!=="initSegment"&&(this.fragPrevious=d,this.audioSwitch&&(this.audioSwitch=!1,this.hls.trigger(b.Events.AUDIO_TRACK_SWITCHED,{id:this.trackId}))),this.fragBufferedComplete(d,h)},R.onError=function(g,m){if(m.type===l.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(n.PlaylistLevelType.AUDIO,m);return}switch(m.details){case l.ErrorDetails.FRAG_LOAD_ERROR:case l.ErrorDetails.FRAG_LOAD_TIMEOUT:case l.ErrorDetails.FRAG_PARSING_ERROR:case l.ErrorDetails.KEY_LOAD_ERROR:case l.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(n.PlaylistLevelType.AUDIO,m);break;case l.ErrorDetails.AUDIO_TRACK_LOAD_ERROR:case l.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:this.state!==T.State.ERROR&&this.state!==T.State.STOPPED&&(this.state=m.fatal?T.State.ERROR:T.State.IDLE,this.warn(m.details+" while loading frag, switching to "+this.state+" state"));break;case l.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="audio"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var d=!0,h=this.getFwdBufferInfo(this.mediaBuffer,n.PlaylistLevelType.AUDIO);h&&h.len>.5&&(d=!this.reduceMaxBufferLength(h.len)),d&&(this.warn("Buffer full error also media.currentTime is not buffered, flush audio buffer"),this.fragCurrent=null,C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.resetLoadingState()}break;default:break}},R.onBufferFlushed=function(g,m){var d=m.type;d===t.ElementaryStreamTypes.AUDIO&&(this.bufferFlushed=!0,this.state===T.State.ENDED&&(this.state=T.State.IDLE))},R._handleTransmuxComplete=function(g){var m,d="audio",h=this.hls,A=g.remuxResult,w=g.chunkMeta,x=this.getCurrentContext(w);if(!x){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(w.level);return}var D=x.frag,I=x.part,F=x.level.details,K=A.audio,W=A.text,z=A.id3,j=A.initSegment;if(!(this.fragContextChanged(D)||!F)){if(this.state=T.State.PARSING,this.audioSwitch&&K&&this.completeAudioSwitch(),j!=null&&j.tracks&&(this._bufferInitSegment(j.tracks,D,w),h.trigger(b.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:d,tracks:j.tracks})),K){var G=K.startPTS,Z=K.endPTS,Q=K.startDTS,ue=K.endDTS;I&&(I.elementaryStreams[t.ElementaryStreamTypes.AUDIO]={startPTS:G,endPTS:Z,startDTS:Q,endDTS:ue}),D.setElementaryStreamInfo(t.ElementaryStreamTypes.AUDIO,G,Z,Q,ue),this.bufferFragmentData(K,D,I,w)}if(z!=null&&(m=z.samples)!==null&&m!==void 0&&m.length){var ee=o({id:d,frag:D,details:F},z);h.trigger(b.Events.FRAG_PARSING_METADATA,ee)}if(W){var ae=o({id:d,frag:D,details:F},W);h.trigger(b.Events.FRAG_PARSING_USERDATA,ae)}}},R._bufferInitSegment=function(g,m,d){if(this.state===T.State.PARSING){g.video&&delete g.video;var h=g.audio;if(h){h.levelCodec=h.codec,h.id="audio",this.log("Init audio buffer, container:"+h.container+", codecs[parsed]=["+h.codec+"]"),this.hls.trigger(b.Events.BUFFER_CODECS,g);var A=h.initSegment;if(A!=null&&A.byteLength){var w={type:"audio",frag:m,part:null,chunkMeta:d,parent:m.type,data:A};this.hls.trigger(b.Events.BUFFER_APPENDING,w)}this.tick()}}},R.loadFragment=function(g,m,d){var h=this.fragmentTracker.getState(g);this.fragCurrent=g,(this.audioSwitch||h===E.FragmentState.NOT_LOADED||h===E.FragmentState.PARTIAL)&&(g.sn==="initSegment"?this._loadInitSegment(g,m):m.live&&!(0,P.isFiniteNumber)(this.initPTS[g.cc])?(this.log("Waiting for video PTS in continuity counter "+g.cc+" of live stream before loading audio fragment "+g.sn+" of level "+this.trackId),this.state=T.State.WAITING_INIT_PTS):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,g,m,d)))},R.completeAudioSwitch=function(){var g=this.hls,m=this.media,d=this.trackId;m&&(this.log("Switching audio track : flushing all audio"),C.prototype.flushMainBuffer.call(this,0,Number.POSITIVE_INFINITY,"audio")),this.audioSwitch=!1,g.trigger(b.Events.AUDIO_TRACK_SWITCHED,{id:d})},L}(T.default);const f=y},"./src/controller/audio-track-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>v});var P=S("./src/events.ts"),T=S("./src/errors.ts"),b=S("./src/controller/base-playlist-controller.ts"),e=S("./src/types/loader.ts");function E(p,l){for(var o=0;o<l.length;o++){var u=l[o];u.enumerable=u.enumerable||!1,u.configurable=!0,"value"in u&&(u.writable=!0),Object.defineProperty(p,n(u.key),u)}}function s(p,l,o){return l&&E(p.prototype,l),o&&E(p,o),Object.defineProperty(p,"prototype",{writable:!1}),p}function n(p){var l=t(p,"string");return typeof l=="symbol"?l:String(l)}function t(p,l){if(typeof p!="object"||p===null)return p;var o=p[Symbol.toPrimitive];if(o!==void 0){var u=o.call(p,l||"default");if(typeof u!="object")return u;throw new TypeError("@@toPrimitive must return a primitive value.")}return(l==="string"?String:Number)(p)}function r(p,l){p.prototype=Object.create(l.prototype),p.prototype.constructor=p,i(p,l)}function i(p,l){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(u,c){return u.__proto__=c,u},i(p,l)}var a=function(p){r(l,p);function l(u){var c;return c=p.call(this,u,"[audio-track-controller]")||this,c.tracks=[],c.groupId=null,c.tracksInGroup=[],c.trackId=-1,c.trackName="",c.selectDefaultTrack=!0,c.registerListeners(),c}var o=l.prototype;return o.registerListeners=function(){var c=this.hls;c.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),c.on(P.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.on(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.on(P.Events.ERROR,this.onError,this)},o.unregisterListeners=function(){var c=this.hls;c.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),c.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),c.off(P.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),c.off(P.Events.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),c.off(P.Events.ERROR,this.onError,this)},o.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,p.prototype.destroy.call(this)},o.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.trackName="",this.selectDefaultTrack=!0},o.onManifestParsed=function(c,_){this.tracks=_.audioTracks||[]},o.onAudioTrackLoaded=function(c,_){var y=_.id,f=_.details,C=this.tracksInGroup[y];if(!C){this.warn("Invalid audio track id "+y);return}var L=C.details;C.details=_.details,this.log("audioTrack "+y+" loaded ["+f.startSN+"-"+f.endSN+"]"),y===this.trackId&&(this.retryCount=0,this.playlistLoaded(y,_,L))},o.onLevelLoading=function(c,_){this.switchLevel(_.level)},o.onLevelSwitching=function(c,_){this.switchLevel(_.level)},o.switchLevel=function(c){var _=this.hls.levels[c];if(_!=null&&_.audioGroupIds){var y=_.audioGroupIds[_.urlId];if(this.groupId!==y){this.groupId=y;var f=this.tracks.filter(function(L){return!y||L.groupId===y});this.selectDefaultTrack&&!f.some(function(L){return L.default})&&(this.selectDefaultTrack=!1),this.tracksInGroup=f;var C={audioTracks:f};this.log("Updating audio tracks, "+f.length+' track(s) found in "'+y+'" group-id'),this.hls.trigger(P.Events.AUDIO_TRACKS_UPDATED,C),this.selectInitialTrack()}}},o.onError=function(c,_){p.prototype.onError.call(this,c,_),!(_.fatal||!_.context)&&_.context.type===e.PlaylistContextType.AUDIO_TRACK&&_.context.id===this.trackId&&_.context.groupId===this.groupId&&this.retryLoadingOrFail(_)},o.setAudioTrack=function(c){var _=this.tracksInGroup;if(c<0||c>=_.length){this.warn("Invalid id passed to audio-track controller");return}this.clearTimer();var y=_[this.trackId];this.log("Now switching to audio-track index "+c);var f=_[c],C=f.id,L=f.groupId,R=L===void 0?"":L,O=f.name,g=f.type,m=f.url;if(this.trackId=c,this.trackName=O,this.selectDefaultTrack=!1,this.hls.trigger(P.Events.AUDIO_TRACK_SWITCHING,{id:C,groupId:R,name:O,type:g,url:m}),!(f.details&&!f.details.live)){var d=this.switchParams(f.url,y==null?void 0:y.details);this.loadPlaylist(d)}},o.selectInitialTrack=function(){var c=this.tracksInGroup;console.assert(c.length,"Initial audio track should be selected when tracks are known");var _=this.trackName,y=this.findTrackId(_)||this.findTrackId();y!==-1?this.setAudioTrack(y):(this.warn("No track found for running audio group-ID: "+this.groupId),this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,fatal:!0}))},o.findTrackId=function(c){for(var _=this.tracksInGroup,y=0;y<_.length;y++){var f=_[y];if((!this.selectDefaultTrack||f.default)&&(!c||c===f.name))return f.id}return-1},o.loadPlaylist=function(c){p.prototype.loadPlaylist.call(this);var _=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(_)){var y=_.id,f=_.groupId,C=_.url;if(c)try{C=c.addDirectives(C)}catch(L){this.warn("Could not construct new URL with HLS Delivery Directives: "+L)}this.log("loading audio-track playlist for id: "+y),this.clearTimer(),this.hls.trigger(P.Events.AUDIO_TRACK_LOADING,{url:C,id:y,groupId:f,deliveryDirectives:c||null})}},s(l,[{key:"audioTracks",get:function(){return this.tracksInGroup}},{key:"audioTrack",get:function(){return this.trackId},set:function(c){this.selectDefaultTrack=!1,this.setAudioTrack(c)}}]),l}(b.default);const v=a},"./src/controller/base-playlist-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>E});var P=S("./src/types/level.ts"),T=S("./src/controller/level-helper.ts"),b=S("./src/utils/logger.ts"),e=S("./src/errors.ts"),E=function(){function s(t,r){this.hls=void 0,this.timer=-1,this.requestScheduled=-1,this.canLoad=!1,this.retryCount=0,this.log=void 0,this.warn=void 0,this.log=b.logger.log.bind(b.logger,r+":"),this.warn=b.logger.warn.bind(b.logger,r+":"),this.hls=t}var n=s.prototype;return n.destroy=function(){this.clearTimer(),this.hls=this.log=this.warn=null},n.onError=function(r,i){i.fatal&&(i.type===e.ErrorTypes.NETWORK_ERROR||i.type===e.ErrorTypes.KEY_SYSTEM_ERROR)&&this.stopLoad()},n.clearTimer=function(){clearTimeout(this.timer),this.timer=-1},n.startLoad=function(){this.canLoad=!0,this.retryCount=0,this.requestScheduled=-1,this.loadPlaylist()},n.stopLoad=function(){this.canLoad=!1,this.clearTimer()},n.switchParams=function(r,i){var a=i==null?void 0:i.renditionReports;if(a)for(var v=0;v<a.length;v++){var p=a[v],l=void 0;try{l=new self.URL(p.URI,i.url).href}catch(_){b.logger.warn("Could not construct new URL for Rendition Report: "+_),l=p.URI||""}if(l===r.slice(-l.length)){var o=parseInt(p["LAST-MSN"])||(i==null?void 0:i.lastPartSn),u=parseInt(p["LAST-PART"])||(i==null?void 0:i.lastPartIndex);if(this.hls.config.lowLatencyMode){var c=Math.min(i.age-i.partTarget,i.targetduration);u>=0&&c>i.partTarget&&(u+=1)}return new P.HlsUrlParameters(o,u>=0?u:void 0,P.HlsSkip.No)}}},n.loadPlaylist=function(r){this.requestScheduled===-1&&(this.requestScheduled=self.performance.now())},n.shouldLoadTrack=function(r){return this.canLoad&&r&&!!r.url&&(!r.details||r.details.live)},n.playlistLoaded=function(r,i,a){var v=this,p=i.details,l=i.stats,o=self.performance.now(),u=l.loading.first?Math.max(0,o-l.loading.first):0;if(p.advancedDateTime=Date.now()-u,p.live||a!=null&&a.live){if(p.reloaded(a),a&&this.log("live playlist "+r+" "+(p.advanced?"REFRESHED "+p.lastPartSn+"-"+p.lastPartIndex:"MISSED")),a&&p.fragments.length>0&&(0,T.mergeDetails)(a,p),!this.canLoad||!p.live)return;var c,_=void 0,y=void 0;if(p.canBlockReload&&p.endSN&&p.advanced){var f=this.hls.config.lowLatencyMode,C=p.lastPartSn,L=p.endSN,R=p.lastPartIndex,O=R!==-1,g=C===L,m=f?0:R;O?(_=g?L+1:C,y=g?m:R+1):_=L+1;var d=p.age,h=d+p.ageHeader,A=Math.min(h-p.partTarget,p.targetduration*1.5);if(A>0){if(a&&A>a.tuneInGoal)this.warn("CDN Tune-in goal increased from: "+a.tuneInGoal+" to: "+A+" with playlist age: "+p.age),A=0;else{var w=Math.floor(A/p.targetduration);if(_+=w,y!==void 0){var x=Math.round(A%p.targetduration/p.partTarget);y+=x}this.log("CDN Tune-in age: "+p.ageHeader+"s last advanced "+d.toFixed(2)+"s goal: "+A+" skip sn "+w+" to part "+y)}p.tuneInGoal=A}if(c=this.getDeliveryDirectives(p,i.deliveryDirectives,_,y),f||!g){this.loadPlaylist(c);return}}else c=this.getDeliveryDirectives(p,i.deliveryDirectives,_,y);var D=this.hls.mainForwardBufferInfo,I=D?D.end-D.len:0,F=(p.edge-I)*1e3,K=(0,T.computeReloadInterval)(p,F);p.updated?o>this.requestScheduled+K&&(this.requestScheduled=l.loading.start):this.requestScheduled=-1,_!==void 0&&p.canBlockReload?this.requestScheduled=l.loading.first+K-(p.partTarget*1e3||1e3):this.requestScheduled=(this.requestScheduled===-1?o:this.requestScheduled)+K;var W=this.requestScheduled-o;W=Math.max(0,W),this.log("reload live playlist "+r+" in "+Math.round(W)+" ms"),this.timer=self.setTimeout(function(){return v.loadPlaylist(c)},W)}else this.clearTimer()},n.getDeliveryDirectives=function(r,i,a,v){var p=(0,P.getSkipValue)(r,a);return i!=null&&i.skip&&r.deltaUpdateFailed&&(a=i.msn,v=i.part,p=P.HlsSkip.No),new P.HlsUrlParameters(a,v,p)},n.retryLoadingOrFail=function(r){var i=this,a=this.hls.config,v=this.retryCount<a.levelLoadingMaxRetry;if(v){var p;if(this.requestScheduled=-1,this.retryCount++,r.details.indexOf("LoadTimeOut")>-1&&(p=r.context)!==null&&p!==void 0&&p.deliveryDirectives)this.warn("retry playlist loading #"+this.retryCount+' after "'+r.details+'"'),this.loadPlaylist();else{var l=Math.min(Math.pow(2,this.retryCount)*a.levelLoadingRetryDelay,a.levelLoadingMaxRetryTimeout);this.timer=self.setTimeout(function(){return i.loadPlaylist()},l),this.warn("retry playlist loading #"+this.retryCount+" in "+l+' ms after "'+r.details+'"')}}else this.warn('cannot recover from error "'+r.details+'"'),this.clearTimer(),r.fatal=!0;return v},s}()},"./src/controller/base-stream-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{State:()=>O,default:()=>g});var P=S("./src/polyfills/number.ts"),T=S("./src/task-loop.ts"),b=S("./src/controller/fragment-tracker.ts"),e=S("./src/utils/buffer-helper.ts"),E=S("./src/utils/logger.ts"),s=S("./src/events.ts"),n=S("./src/errors.ts"),t=S("./src/types/transmuxer.ts"),r=S("./src/utils/mp4-tools.ts"),i=S("./src/utils/discontinuities.ts"),a=S("./src/controller/fragment-finders.ts"),v=S("./src/controller/level-helper.ts"),p=S("./src/loader/fragment-loader.ts"),l=S("./src/crypt/decrypter.ts"),o=S("./src/utils/time-ranges.ts"),u=S("./src/types/loader.ts");function c(m,d){for(var h=0;h<d.length;h++){var A=d[h];A.enumerable=A.enumerable||!1,A.configurable=!0,"value"in A&&(A.writable=!0),Object.defineProperty(m,y(A.key),A)}}function _(m,d,h){return d&&c(m.prototype,d),h&&c(m,h),Object.defineProperty(m,"prototype",{writable:!1}),m}function y(m){var d=f(m,"string");return typeof d=="symbol"?d:String(d)}function f(m,d){if(typeof m!="object"||m===null)return m;var h=m[Symbol.toPrimitive];if(h!==void 0){var A=h.call(m,d||"default");if(typeof A!="object")return A;throw new TypeError("@@toPrimitive must return a primitive value.")}return(d==="string"?String:Number)(m)}function C(m){if(m===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return m}function L(m,d){m.prototype=Object.create(d.prototype),m.prototype.constructor=m,R(m,d)}function R(m,d){return R=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(A,w){return A.__proto__=w,A},R(m,d)}var O={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",ENDED:"ENDED",ERROR:"ERROR",WAITING_INIT_PTS:"WAITING_INIT_PTS",WAITING_LEVEL:"WAITING_LEVEL"},g=function(m){L(d,m);function d(A,w,x,D){var I;return I=m.call(this)||this,I.hls=void 0,I.fragPrevious=null,I.fragCurrent=null,I.fragmentTracker=void 0,I.transmuxer=null,I._state=O.STOPPED,I.media=null,I.mediaBuffer=null,I.config=void 0,I.bitrateTest=!1,I.lastCurrentTime=0,I.nextLoadPosition=0,I.startPosition=0,I.loadedmetadata=!1,I.fragLoadError=0,I.retryDate=0,I.levels=null,I.fragmentLoader=void 0,I.keyLoader=void 0,I.levelLastLoaded=null,I.startFragRequested=!1,I.decrypter=void 0,I.initPTS=[],I.onvseeking=null,I.onvended=null,I.logPrefix="",I.log=void 0,I.warn=void 0,I.logPrefix=D,I.log=E.logger.log.bind(E.logger,D+":"),I.warn=E.logger.warn.bind(E.logger,D+":"),I.hls=A,I.fragmentLoader=new p.default(A.config),I.keyLoader=x,I.fragmentTracker=w,I.config=A.config,I.decrypter=new l.default(A.config),A.on(s.Events.LEVEL_SWITCHING,I.onLevelSwitching,C(I)),I}var h=d.prototype;return h.doTick=function(){this.onTickEnd()},h.onTickEnd=function(){},h.startLoad=function(w){},h.stopLoad=function(){this.fragmentLoader.abort(),this.keyLoader.abort();var w=this.fragCurrent;w&&(w.abortRequests(),this.fragmentTracker.removeFragment(w)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=O.STOPPED},h._streamEnded=function(w,x){if(x.live||w.nextStart||!w.end||!this.media)return!1;var D=x.partList;if(D!=null&&D.length){var I=D[D.length-1],F=e.BufferHelper.isBuffered(this.media,I.start+I.duration/2);return F}var K=x.fragments[x.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(K)},h.getLevelDetails=function(){if(this.levels&&this.levelLastLoaded!==null){var w;return(w=this.levels[this.levelLastLoaded])===null||w===void 0?void 0:w.details}},h.onMediaAttached=function(w,x){var D=this.media=this.mediaBuffer=x.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===O.STOPPED&&this.startLoad(I.startPosition)},h.onMediaDetaching=function(){var w=this.media;w!=null&&w.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),w&&this.onvseeking&&this.onvended&&(w.removeEventListener("seeking",this.onvseeking),w.removeEventListener("ended",this.onvended),this.onvseeking=this.onvended=null),this.keyLoader&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loadedmetadata=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()},h.onMediaSeeking=function(){var w=this.config,x=this.fragCurrent,D=this.media,I=this.mediaBuffer,F=this.state,K=D?D.currentTime:0,W=e.BufferHelper.bufferInfo(I||D,K,w.maxBufferHole);if(this.log("media seeking to "+((0,P.isFiniteNumber)(K)?K.toFixed(3):K)+", state: "+F),this.state===O.ENDED)this.resetLoadingState();else if(x){var z=w.maxFragLookUpTolerance,j=x.start-z,G=x.start+x.duration+z;if(!W.len||G<W.start||j>W.end){var Z=K>G;(K<j||Z)&&(Z&&x.loader&&(this.log("seeking outside of buffer while fragment load in progress, cancel fragment load"),x.abortRequests()),this.resetLoadingState())}}D&&(this.lastCurrentTime=K),!this.loadedmetadata&&!W.len&&(this.nextLoadPosition=this.startPosition=K),this.tickImmediate()},h.onMediaEnded=function(){this.startPosition=this.lastCurrentTime=0},h.onLevelSwitching=function(w,x){this.fragLoadError=0},h.onHandlerDestroying=function(){this.stopLoad(),m.prototype.onHandlerDestroying.call(this)},h.onHandlerDestroyed=function(){this.state=O.STOPPED,this.hls.off(s.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),this.fragmentLoader&&this.fragmentLoader.destroy(),this.keyLoader&&this.keyLoader.destroy(),this.decrypter&&this.decrypter.destroy(),this.hls=this.log=this.warn=this.decrypter=this.keyLoader=this.fragmentLoader=this.fragmentTracker=null,m.prototype.onHandlerDestroyed.call(this)},h.loadFragment=function(w,x,D){this._loadFragForPlayback(w,x,D)},h._loadFragForPlayback=function(w,x,D){var I=this,F=function(W){if(I.fragContextChanged(w)){I.warn("Fragment "+w.sn+(W.part?" p: "+W.part.index:"")+" of level "+w.level+" was dropped during download."),I.fragmentTracker.removeFragment(w);return}w.stats.chunkCount++,I._handleFragmentLoadProgress(W)};this._doFragLoad(w,x,D,F).then(function(K){if(K){I.fragLoadError=0;var W=I.state;if(I.fragContextChanged(w)){(W===O.FRAG_LOADING||!I.fragCurrent&&W===O.PARSING)&&(I.fragmentTracker.removeFragment(w),I.state=O.IDLE);return}"payload"in K&&(I.log("Loaded fragment "+w.sn+" of level "+w.level),I.hls.trigger(s.Events.FRAG_LOADED,K)),I._handleFragmentLoadComplete(K)}}).catch(function(K){I.state===O.STOPPED||I.state===O.ERROR||(I.warn(K),I.resetFragmentLoading(w))})},h.flushMainBuffer=function(w,x,D){if(D===void 0&&(D=null),!!(w-x)){var I={startOffset:w,endOffset:x,type:D};this.fragLoadError=0,this.hls.trigger(s.Events.BUFFER_FLUSHING,I)}},h._loadInitSegment=function(w,x){var D=this;this._doFragLoad(w,x).then(function(I){if(!I||D.fragContextChanged(w)||!D.levels)throw new Error("init load aborted");return I}).then(function(I){var F=D.hls,K=I.payload,W=w.decryptdata;if(K&&K.byteLength>0&&W&&W.key&&W.iv&&W.method==="AES-128"){var z=self.performance.now();return D.decrypter.decrypt(new Uint8Array(K),W.key.buffer,W.iv.buffer).then(function(j){var G=self.performance.now();return F.trigger(s.Events.FRAG_DECRYPTED,{frag:w,payload:j,stats:{tstart:z,tdecrypt:G}}),I.payload=j,I})}return I}).then(function(I){var F=D.fragCurrent,K=D.hls,W=D.levels;if(!W)throw new Error("init load aborted, missing levels");var z=W[w.level].details;console.assert(z,"Level details are defined when init segment is loaded");var j=w.stats;D.state=O.IDLE,D.fragLoadError=0,w.data=new Uint8Array(I.payload),j.parsing.start=j.buffering.start=self.performance.now(),j.parsing.end=j.buffering.end=self.performance.now(),I.frag===F&&K.trigger(s.Events.FRAG_BUFFERED,{stats:j,frag:F,part:null,id:w.type}),D.tick()}).catch(function(I){D.state===O.STOPPED||D.state===O.ERROR||(D.warn(I),D.resetFragmentLoading(w))})},h.fragContextChanged=function(w){var x=this.fragCurrent;return!w||!x||w.level!==x.level||w.sn!==x.sn||w.urlId!==x.urlId},h.fragBufferedComplete=function(w,x){var D,I,F,K,W=this.mediaBuffer?this.mediaBuffer:this.media;this.log("Buffered "+w.type+" sn: "+w.sn+(x?" part: "+x.index:"")+" of "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level+" (frag:["+((D=w.startPTS)!=null?D:NaN).toFixed(3)+"-"+((I=w.endPTS)!=null?I:NaN).toFixed(3)+"] > buffer:"+(W?o.default.toString(e.BufferHelper.getBuffered(W)):"(detached)")+")"),this.state=O.IDLE,W&&(!this.loadedmetadata&&w.type==u.PlaylistLevelType.MAIN&&W.buffered.length&&((F=this.fragCurrent)===null||F===void 0?void 0:F.sn)===((K=this.fragPrevious)===null||K===void 0?void 0:K.sn)&&(this.loadedmetadata=!0,this.seekToStartPos()),this.tick())},h.seekToStartPos=function(){},h._handleFragmentLoadComplete=function(w){var x=this.transmuxer;if(x){var D=w.frag,I=w.part,F=w.partsLoaded,K=!F||F.length===0||F.some(function(z){return!z}),W=new t.ChunkMetadata(D.level,D.sn,D.stats.chunkCount+1,0,I?I.index:-1,!K);x.flush(W)}},h._handleFragmentLoadProgress=function(w){},h._doFragLoad=function(w,x,D,I){var F,K=this;if(D===void 0&&(D=null),!this.levels)throw new Error("frag load aborted, missing levels");var W=null;if(w.encrypted&&!((F=w.decryptdata)!==null&&F!==void 0&&F.key)?(this.log("Loading key for "+w.sn+" of ["+x.startSN+"-"+x.endSN+"], "+(this.logPrefix==="[stream-controller]"?"level":"track")+" "+w.level),this.state=O.KEY_LOADING,this.fragCurrent=w,W=this.keyLoader.load(w).then(function(Q){if(!K.fragContextChanged(Q.frag))return K.hls.trigger(s.Events.KEY_LOADED,Q),K.state===O.KEY_LOADING&&(K.state=O.IDLE),Q}),this.hls.trigger(s.Events.KEY_LOADING,{frag:w}),this.throwIfFragContextChanged("KEY_LOADING")):!w.encrypted&&x.encryptedFragments.length&&this.keyLoader.loadClear(w,x.encryptedFragments),D=Math.max(w.start,D||0),this.config.lowLatencyMode&&x){var z=x.partList;if(z&&I){D>w.end&&x.fragmentHint&&(w=x.fragmentHint);var j=this.getNextPart(z,w,D);if(j>-1){var G=z[j];return this.log("Loading part sn: "+w.sn+" p: "+G.index+" cc: "+w.cc+" of playlist ["+x.startSN+"-"+x.endSN+"] parts [0-"+j+"-"+(z.length-1)+"] "+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(D.toFixed(3))),this.nextLoadPosition=G.start+G.duration,this.state=O.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:w,part:z[j],targetBufferTime:D}),this.throwIfFragContextChanged("FRAG_LOADING parts"),W?W.then(function(Q){return!Q||K.fragContextChanged(Q.frag)?null:K.doFragPartsLoad(w,z,j,I)}).catch(function(Q){return K.handleFragLoadError(Q)}):this.doFragPartsLoad(w,z,j,I).catch(function(Q){return K.handleFragLoadError(Q)})}else if(!w.url||this.loadedEndOfParts(z,D))return Promise.resolve(null)}}this.log("Loading fragment "+w.sn+" cc: "+w.cc+" "+(x?"of ["+x.startSN+"-"+x.endSN+"] ":"")+(this.logPrefix==="[stream-controller]"?"level":"track")+": "+w.level+", target: "+parseFloat(D.toFixed(3))),(0,P.isFiniteNumber)(w.sn)&&!this.bitrateTest&&(this.nextLoadPosition=w.start+w.duration),this.state=O.FRAG_LOADING,this.hls.trigger(s.Events.FRAG_LOADING,{frag:w,targetBufferTime:D}),this.throwIfFragContextChanged("FRAG_LOADING");var Z=this.config.progressive;return Z&&W?W.then(function(Q){return!Q||K.fragContextChanged(Q==null?void 0:Q.frag)?null:K.fragmentLoader.load(w,I)}).catch(function(Q){return K.handleFragLoadError(Q)}):Promise.all([this.fragmentLoader.load(w,Z?I:void 0),W]).then(function(Q){var ue=Q[0];return!Z&&ue&&I&&I(ue),ue}).catch(function(Q){return K.handleFragLoadError(Q)})},h.throwIfFragContextChanged=function(w){if(this.fragCurrent===null)throw new Error("frag load aborted, context changed in "+w)},h.doFragPartsLoad=function(w,x,D,I){var F=this;return new Promise(function(K,W){var z=[],j=function G(Z){var Q=x[Z];F.fragmentLoader.loadPart(w,Q,I).then(function(ue){z[Q.index]=ue;var ee=ue.part;F.hls.trigger(s.Events.FRAG_LOADED,ue);var ae=x[Z+1];if(ae&&ae.fragment===w)G(Z+1);else return K({frag:w,part:ee,partsLoaded:z})}).catch(W)};j(D)})},h.handleFragLoadError=function(w){if("data"in w){var x=w.data;w.data&&x.details===n.ErrorDetails.INTERNAL_ABORTED?this.handleFragLoadAborted(x.frag,x.part):this.hls.trigger(s.Events.ERROR,x)}else this.hls.trigger(s.Events.ERROR,{type:n.ErrorTypes.OTHER_ERROR,details:n.ErrorDetails.INTERNAL_EXCEPTION,err:w,fatal:!0});return null},h._handleTransmuxerFlush=function(w){var x=this.getCurrentContext(w);if(!x||this.state!==O.PARSING){!this.fragCurrent&&this.state!==O.STOPPED&&this.state!==O.ERROR&&(this.state=O.IDLE);return}var D=x.frag,I=x.part,F=x.level,K=self.performance.now();D.stats.parsing.end=K,I&&(I.stats.parsing.end=K),this.updateLevelTiming(D,I,F,w.partial)},h.getCurrentContext=function(w){var x=this.levels,D=w.level,I=w.sn,F=w.part;if(!x||!x[D])return this.warn("Levels object was unset while buffering fragment "+I+" of level "+D+". The current chunk will not be buffered."),null;var K=x[D],W=F>-1?(0,v.getPartWith)(K,I,F):null,z=W?W.fragment:(0,v.getFragmentWithSN)(K,I,this.fragCurrent);return z?{frag:z,part:W,level:K}:null},h.bufferFragmentData=function(w,x,D,I){if(!(!w||this.state!==O.PARSING)){var F=w.data1,K=w.data2,W=F;if(F&&K&&(W=(0,r.appendUint8Array)(F,K)),!(!W||!W.length)){var z={type:w.type,frag:x,part:D,chunkMeta:I,parent:x.type,data:W};this.hls.trigger(s.Events.BUFFER_APPENDING,z),w.dropped&&w.independent&&!D&&this.flushBufferGap(x)}}},h.flushBufferGap=function(w){var x=this.media;if(x){if(!e.BufferHelper.isBuffered(x,x.currentTime)){this.flushMainBuffer(0,w.start);return}var D=x.currentTime,I=e.BufferHelper.bufferInfo(x,D,0),F=w.duration,K=Math.min(this.config.maxFragLookUpTolerance*2,F*.25),W=Math.max(Math.min(w.start-K,I.end-K),D+K);w.start-W>K&&this.flushMainBuffer(W,w.start)}},h.getFwdBufferInfo=function(w,x){var D=this.config,I=this.getLoadPosition();if(!(0,P.isFiniteNumber)(I))return null;var F=e.BufferHelper.bufferInfo(w,I,D.maxBufferHole);if(F.len===0&&F.nextStart!==void 0){var K=this.fragmentTracker.getBufferedFrag(I,x);if(K&&F.nextStart<K.end)return e.BufferHelper.bufferInfo(w,I,Math.max(F.nextStart,D.maxBufferHole))}return F},h.getMaxBufferLength=function(w){var x=this.config,D;return w?D=Math.max(8*x.maxBufferSize/w,x.maxBufferLength):D=x.maxBufferLength,Math.min(D,x.maxMaxBufferLength)},h.reduceMaxBufferLength=function(w){var x=this.config,D=w||x.maxBufferLength;return x.maxMaxBufferLength>=D?(x.maxMaxBufferLength/=2,this.warn("Reduce max buffer length to "+x.maxMaxBufferLength+"s"),!0):!1},h.getNextFragment=function(w,x){var D=x.fragments,I=D.length;if(!I)return null;var F=this.config,K=D[0].start,W;if(x.live){var z=F.initialLiveManifestSize;if(I<z)return this.warn("Not enough fragments to start playback (have: "+I+", need: "+z+")"),null;!x.PTSKnown&&!this.startFragRequested&&this.startPosition===-1&&(W=this.getInitialLiveFragment(x,D),this.startPosition=W?this.hls.liveSyncPosition||W.start:w)}else w<=K&&(W=D[0]);if(!W){var j=F.lowLatencyMode?x.partEnd:x.fragmentEnd;W=this.getFragmentAtPosition(w,j,x)}return this.mapToInitFragWhenRequired(W)},h.mapToInitFragWhenRequired=function(w){return w!=null&&w.initSegment&&!(w!=null&&w.initSegment.data)&&!this.bitrateTest?w.initSegment:w},h.getNextPart=function(w,x,D){for(var I=-1,F=!1,K=!0,W=0,z=w.length;W<z;W++){var j=w[W];if(K=K&&!j.independent,I>-1&&D<j.start)break;var G=j.loaded;G?I=-1:(F||j.independent||K)&&j.fragment===x&&(I=W),F=G}return I},h.loadedEndOfParts=function(w,x){var D=w[w.length-1];return D&&x>D.start&&D.loaded},h.getInitialLiveFragment=function(w,x){var D=this.fragPrevious,I=null;if(D){if(w.hasProgramDateTime&&(this.log("Live playlist, switching playlist, load frag with same PDT: "+D.programDateTime),I=(0,a.findFragmentByPDT)(x,D.endProgramDateTime,this.config.maxFragLookUpTolerance)),!I){var F=D.sn+1;if(F>=w.startSN&&F<=w.endSN){var K=x[F-w.startSN];D.cc===K.cc&&(I=K,this.log("Live playlist, switching playlist, load frag with next SN: "+I.sn))}I||(I=(0,a.findFragWithCC)(x,D.cc),I&&this.log("Live playlist, switching playlist, load frag with same CC: "+I.sn))}}else{var W=this.hls.liveSyncPosition;W!==null&&(I=this.getFragmentAtPosition(W,this.bitrateTest?w.fragmentEnd:w.edge,w))}return I},h.getFragmentAtPosition=function(w,x,D){var I=this.config,F=this.fragPrevious,K=D.fragments,W=D.endSN,z=D.fragmentHint,j=I.maxFragLookUpTolerance,G=!!(I.lowLatencyMode&&D.partList&&z);G&&z&&!this.bitrateTest&&(K=K.concat(z),W=z.sn);var Z;if(w<x){var Q=w>x-j?0:j;Z=(0,a.findFragmentByPTS)(F,K,w,Q)}else Z=K[K.length-1];if(Z){var ue=Z.sn-D.startSN;if(this.fragmentTracker.getState(Z)===b.FragmentState.OK&&(F=Z),F&&Z.sn===F.sn&&!G){var ee=F&&Z.level===F.level;if(ee){var ae=K[ue+1];Z.sn<W&&this.fragmentTracker.getState(ae)!==b.FragmentState.OK?(this.log("SN "+Z.sn+" just loaded, load next one: "+ae.sn),Z=ae):Z=null}}}return Z},h.synchronizeToLiveEdge=function(w){var x=this.config,D=this.media;if(D){var I=this.hls.liveSyncPosition,F=D.currentTime,K=w.fragments[0].start,W=w.edge,z=F>=K-x.maxFragLookUpTolerance&&F<=W;if(I!==null&&D.duration>I&&(F<I||!z)){var j=x.liveMaxLatencyDuration!==void 0?x.liveMaxLatencyDuration:x.liveMaxLatencyDurationCount*w.targetduration;(!z&&D.readyState<4||F<W-j)&&(this.loadedmetadata||(this.nextLoadPosition=I),D.readyState&&(this.warn("Playback: "+F.toFixed(3)+" is located too far from the end of live sliding playlist: "+W+", reset currentTime to : "+I.toFixed(3)),D.currentTime=I))}}},h.alignPlaylists=function(w,x){var D=this.levels,I=this.levelLastLoaded,F=this.fragPrevious,K=I!==null?D[I]:null,W=w.fragments.length;if(!W)return this.warn("No fragments in live playlist"),0;var z=w.fragments[0].start,j=!x,G=w.alignedSliding&&(0,P.isFiniteNumber)(z);if(j||!G&&!z){(0,i.alignStream)(F,K,w);var Z=w.fragments[0].start;return this.log("Live playlist sliding: "+Z.toFixed(2)+" start-sn: "+(x?x.startSN:"na")+"->"+w.startSN+" prev-sn: "+(F?F.sn:"na")+" fragments: "+W),Z}return z},h.waitForCdnTuneIn=function(w){var x=3;return w.live&&w.canBlockReload&&w.partTarget&&w.tuneInGoal>Math.max(w.partHoldBack,w.partTarget*x)},h.setStartPosition=function(w,x){var D=this.startPosition;if(D<x&&(D=-1),D===-1||this.lastCurrentTime===-1){var I=w.startTimeOffset;(0,P.isFiniteNumber)(I)?(D=x+I,I<0&&(D+=w.totalduration),D=Math.min(Math.max(x,D),x+w.totalduration),this.log("Start time offset "+I+" found in playlist, adjust startPosition to "+D),this.startPosition=D):w.live?D=this.hls.liveSyncPosition||x:this.startPosition=D=0,this.lastCurrentTime=D}this.nextLoadPosition=D},h.getLoadPosition=function(){var w=this.media,x=0;return this.loadedmetadata&&w?x=w.currentTime:this.nextLoadPosition&&(x=this.nextLoadPosition),x},h.handleFragLoadAborted=function(w,x){this.transmuxer&&w.sn!=="initSegment"&&w.stats.aborted&&(this.warn("Fragment "+w.sn+(x?" part"+x.index:"")+" of level "+w.level+" was aborted"),this.resetFragmentLoading(w))},h.resetFragmentLoading=function(w){(!this.fragCurrent||!this.fragContextChanged(w)&&this.state!==O.FRAG_LOADING_WAITING_RETRY)&&(this.state=O.IDLE)},h.onFragmentOrKeyLoadError=function(w,x){if(x.fatal){this.stopLoad(),this.state=O.ERROR;return}var D=this.config;if(x.chunkMeta){var I=this.getCurrentContext(x.chunkMeta);I&&(x.frag=I.frag,x.levelRetry=!0,this.fragLoadError=D.fragLoadingMaxRetry)}var F=x.frag;if(!(!F||F.type!==w)){var K=this.fragCurrent;if(console.assert(K&&F.sn===K.sn&&F.level===K.level&&F.urlId===K.urlId,"Frag load error must match current frag to retry"),this.fragLoadError+1<=D.fragLoadingMaxRetry){this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition);var W=Math.min(Math.pow(2,this.fragLoadError)*D.fragLoadingRetryDelay,D.fragLoadingMaxRetryTimeout);this.warn("Fragment "+F.sn+" of "+w+" "+F.level+" failed to load, retrying in "+W+"ms"),this.retryDate=self.performance.now()+W,this.fragLoadError++,this.state=O.FRAG_LOADING_WAITING_RETRY}else x.levelRetry?(w===u.PlaylistLevelType.AUDIO&&(this.fragCurrent=null),this.fragLoadError=0,this.state=O.IDLE):(E.logger.error(x.details+" reaches max retry, redispatch as fatal ..."),x.fatal=!0,this.hls.stopLoad(),this.state=O.ERROR)}},h.afterBufferFlushed=function(w,x,D){if(w){var I=e.BufferHelper.getBuffered(w);this.fragmentTracker.detectEvictedFragments(x,I,D),this.state===O.ENDED&&this.resetLoadingState()}},h.resetLoadingState=function(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state=O.IDLE},h.resetStartWhenNotLoaded=function(w){if(!this.loadedmetadata){this.startFragRequested=!1;var x=this.levels?this.levels[w].details:null;x!=null&&x.live?(this.startPosition=-1,this.setStartPosition(x,0),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}},h.updateLevelTiming=function(w,x,D,I){var F=this,K=D.details;console.assert(!!K,"level.details must be defined");var W=Object.keys(w.elementaryStreams).reduce(function(z,j){var G=w.elementaryStreams[j];if(G){var Z=G.endPTS-G.startPTS;if(Z<=0)return F.warn("Could not parse fragment "+w.sn+" "+j+" duration reliably ("+Z+")"),z||!1;var Q=I?0:(0,v.updateFragPTSDTS)(K,w,G.startPTS,G.endPTS,G.startDTS,G.endDTS);return F.hls.trigger(s.Events.LEVEL_PTS_UPDATED,{details:K,level:D,drift:Q,type:j,frag:w,start:G.startPTS,end:G.endPTS}),!0}return z},!1);W||(this.warn("Found no media in fragment "+w.sn+" of level "+D.id+" resetting transmuxer to fallback to playlist timing"),this.resetTransmuxer()),this.state=O.PARSED,this.hls.trigger(s.Events.FRAG_PARSED,{frag:w,part:x})},h.resetTransmuxer=function(){this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null)},_(d,[{key:"state",get:function(){return this._state},set:function(w){var x=this._state;x!==w&&(this._state=w,this.log(x+"->"+w))}}]),d}(T.default)},"./src/controller/buffer-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>a});var P=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),b=S("./src/utils/logger.ts"),e=S("./src/errors.ts"),E=S("./src/utils/buffer-helper.ts"),s=S("./src/utils/mediasource-helper.ts"),n=S("./src/loader/fragment.ts"),t=S("./src/controller/buffer-operation-queue.ts"),r=(0,s.getMediaSource)(),i=/([ha]vc.)(?:\.[^.,]+)+/,a=function(){function v(l){var o=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.lastMpegAudioChunk=null,this.appendError=0,this.tracks={},this.pendingTracks={},this.sourceBuffer=void 0,this._onMediaSourceOpen=function(){var u=o.media,c=o.mediaSource;b.logger.log("[buffer-controller]: Media source opened"),u&&(u.removeEventListener("emptied",o._onMediaEmptied),o.updateMediaElementDuration(),o.hls.trigger(T.Events.MEDIA_ATTACHED,{media:u})),c&&c.removeEventListener("sourceopen",o._onMediaSourceOpen),o.checkPendingTracks()},this._onMediaSourceClose=function(){b.logger.log("[buffer-controller]: Media source closed")},this._onMediaSourceEnded=function(){b.logger.log("[buffer-controller]: Media source ended")},this._onMediaEmptied=function(){var u=o.media,c=o._objectUrl;u&&u.src!==c&&b.logger.error("Media element src was set while attaching MediaSource ("+c+" > "+u.src+")")},this.hls=l,this._initSourceBuffer(),this.registerListeners()}var p=v.prototype;return p.hasSourceTypes=function(){return this.getSourceBufferTypes().length>0||Object.keys(this.pendingTracks).length>0},p.destroy=function(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=null},p.registerListeners=function(){var o=this.hls;o.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.on(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.on(T.Events.BUFFER_RESET,this.onBufferReset,this),o.on(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.on(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.on(T.Events.BUFFER_EOS,this.onBufferEos,this),o.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.on(T.Events.FRAG_PARSED,this.onFragParsed,this),o.on(T.Events.FRAG_CHANGED,this.onFragChanged,this)},p.unregisterListeners=function(){var o=this.hls;o.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),o.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),o.off(T.Events.MANIFEST_PARSED,this.onManifestParsed,this),o.off(T.Events.BUFFER_RESET,this.onBufferReset,this),o.off(T.Events.BUFFER_APPENDING,this.onBufferAppending,this),o.off(T.Events.BUFFER_CODECS,this.onBufferCodecs,this),o.off(T.Events.BUFFER_EOS,this.onBufferEos,this),o.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),o.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),o.off(T.Events.FRAG_PARSED,this.onFragParsed,this),o.off(T.Events.FRAG_CHANGED,this.onFragChanged,this)},p._initSourceBuffer=function(){this.sourceBuffer={},this.operationQueue=new t.default(this.sourceBuffer),this.listeners={audio:[],video:[],audiovideo:[]},this.lastMpegAudioChunk=null},p.onManifestParsed=function(o,u){var c=2;(u.audio&&!u.video||!u.altAudio)&&(c=1),this.bufferCodecEventsExpected=this._bufferCodecEventsTotal=c,this.details=null,b.logger.log(this.bufferCodecEventsExpected+" bufferCodec event(s) expected")},p.onMediaAttaching=function(o,u){var c=this.media=u.media;if(c&&r){var _=this.mediaSource=new r;_.addEventListener("sourceopen",this._onMediaSourceOpen),_.addEventListener("sourceended",this._onMediaSourceEnded),_.addEventListener("sourceclose",this._onMediaSourceClose),c.src=self.URL.createObjectURL(_),this._objectUrl=c.src,c.addEventListener("emptied",this._onMediaEmptied)}},p.onMediaDetaching=function(){var o=this.media,u=this.mediaSource,c=this._objectUrl;if(u){if(b.logger.log("[buffer-controller]: media source detaching"),u.readyState==="open")try{u.endOfStream()}catch(_){b.logger.warn("[buffer-controller]: onMediaDetaching: "+_.message+" while calling endOfStream")}this.onBufferReset(),u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),o&&(o.removeEventListener("emptied",this._onMediaEmptied),c&&self.URL.revokeObjectURL(c),o.src===c?(o.removeAttribute("src"),o.load()):b.logger.warn("[buffer-controller]: media.src was changed by a third party - skip cleanup")),this.mediaSource=null,this.media=null,this._objectUrl=null,this.bufferCodecEventsExpected=this._bufferCodecEventsTotal,this.pendingTracks={},this.tracks={}}this.hls.trigger(T.Events.MEDIA_DETACHED,void 0)},p.onBufferReset=function(){var o=this;this.getSourceBufferTypes().forEach(function(u){var c=o.sourceBuffer[u];try{c&&(o.removeBufferListeners(u),o.mediaSource&&o.mediaSource.removeSourceBuffer(c),o.sourceBuffer[u]=void 0)}catch(_){b.logger.warn("[buffer-controller]: Failed to reset the "+u+" buffer",_)}}),this._initSourceBuffer()},p.onBufferCodecs=function(o,u){var c=this,_=this.getSourceBufferTypes().length;Object.keys(u).forEach(function(y){if(_){var f=c.tracks[y];if(f&&typeof f.buffer.changeType=="function"){var C=u[y],L=C.id,R=C.codec,O=C.levelCodec,g=C.container,m=C.metadata,d=(f.levelCodec||f.codec).replace(i,"$1"),h=(O||R).replace(i,"$1");if(d!==h){var A=g+";codecs="+(O||R);c.appendChangeType(y,A),b.logger.log("[buffer-controller]: switching codec "+d+" to "+h),c.tracks[y]={buffer:f.buffer,codec:R,container:g,levelCodec:O,metadata:m,id:L}}}}else c.pendingTracks[y]=u[y]}),!_&&(this.bufferCodecEventsExpected=Math.max(this.bufferCodecEventsExpected-1,0),this.mediaSource&&this.mediaSource.readyState==="open"&&this.checkPendingTracks())},p.appendChangeType=function(o,u){var c=this,_=this.operationQueue,y={execute:function(){var C=c.sourceBuffer[o];C&&(b.logger.log("[buffer-controller]: changing "+o+" sourceBuffer type to "+u),C.changeType(u)),_.shiftAndExecuteNext(o)},onStart:function(){},onComplete:function(){},onError:function(C){b.logger.warn("[buffer-controller]: Failed to change "+o+" SourceBuffer type",C)}};_.append(y,o)},p.onBufferAppending=function(o,u){var c=this,_=this.hls,y=this.operationQueue,f=this.tracks,C=u.data,L=u.type,R=u.frag,O=u.part,g=u.chunkMeta,m=g.buffering[L],d=self.performance.now();m.start=d;var h=R.stats.buffering,A=O?O.stats.buffering:null;h.start===0&&(h.start=d),A&&A.start===0&&(A.start=d);var w=f.audio,x=!1;L==="audio"&&(w==null?void 0:w.container)==="audio/mpeg"&&(x=!this.lastMpegAudioChunk||g.id===1||this.lastMpegAudioChunk.sn!==g.sn,this.lastMpegAudioChunk=g);var D=R.start,I={execute:function(){if(m.executeStart=self.performance.now(),x){var K=c.sourceBuffer[L];if(K){var W=D-K.timestampOffset;Math.abs(W)>=.1&&(b.logger.log("[buffer-controller]: Updating audio SourceBuffer timestampOffset to "+D+" (delta: "+W+") sn: "+R.sn+")"),K.timestampOffset=D)}}c.appendExecutor(C,L)},onStart:function(){},onComplete:function(){var K=self.performance.now();m.executeEnd=m.end=K,h.first===0&&(h.first=K),A&&A.first===0&&(A.first=K);var W=c.sourceBuffer,z={};for(var j in W)z[j]=E.BufferHelper.getBuffered(W[j]);c.appendError=0,c.hls.trigger(T.Events.BUFFER_APPENDED,{type:L,frag:R,part:O,chunkMeta:g,parent:R.type,timeRanges:z})},onError:function(K){b.logger.error("[buffer-controller]: Error encountered while trying to append to the "+L+" SourceBuffer",K);var W={type:e.ErrorTypes.MEDIA_ERROR,parent:R.type,details:e.ErrorDetails.BUFFER_APPEND_ERROR,err:K,fatal:!1};K.code===DOMException.QUOTA_EXCEEDED_ERR?W.details=e.ErrorDetails.BUFFER_FULL_ERROR:(c.appendError++,W.details=e.ErrorDetails.BUFFER_APPEND_ERROR,c.appendError>_.config.appendErrorMaxRetry&&(b.logger.error("[buffer-controller]: Failed "+_.config.appendErrorMaxRetry+" times to append segment in sourceBuffer"),W.fatal=!0,_.stopLoad())),_.trigger(T.Events.ERROR,W)}};y.append(I,L)},p.onBufferFlushing=function(o,u){var c=this,_=this.operationQueue,y=function(C){return{execute:c.removeExecutor.bind(c,C,u.startOffset,u.endOffset),onStart:function(){},onComplete:function(){c.hls.trigger(T.Events.BUFFER_FLUSHED,{type:C})},onError:function(R){b.logger.warn("[buffer-controller]: Failed to remove from "+C+" SourceBuffer",R)}}};u.type?_.append(y(u.type),u.type):this.getSourceBufferTypes().forEach(function(f){_.append(y(f),f)})},p.onFragParsed=function(o,u){var c=this,_=u.frag,y=u.part,f=[],C=y?y.elementaryStreams:_.elementaryStreams;C[n.ElementaryStreamTypes.AUDIOVIDEO]?f.push("audiovideo"):(C[n.ElementaryStreamTypes.AUDIO]&&f.push("audio"),C[n.ElementaryStreamTypes.VIDEO]&&f.push("video"));var L=function(){var O=self.performance.now();_.stats.buffering.end=O,y&&(y.stats.buffering.end=O);var g=y?y.stats:_.stats;c.hls.trigger(T.Events.FRAG_BUFFERED,{frag:_,part:y,stats:g,id:_.type})};f.length===0&&b.logger.warn("Fragments must have at least one ElementaryStreamType set. type: "+_.type+" level: "+_.level+" sn: "+_.sn),this.blockBuffers(L,f)},p.onFragChanged=function(o,u){this.flushBackBuffer()},p.onBufferEos=function(o,u){var c=this,_=this.getSourceBufferTypes().reduce(function(y,f){var C=c.sourceBuffer[f];return C&&(!u.type||u.type===f)&&(C.ending=!0,C.ended||(C.ended=!0,b.logger.log("[buffer-controller]: "+f+" sourceBuffer now EOS"))),y&&!!(!C||C.ended)},!0);_&&(b.logger.log("[buffer-controller]: Queueing mediaSource.endOfStream()"),this.blockBuffers(function(){c.getSourceBufferTypes().forEach(function(f){var C=c.sourceBuffer[f];C&&(C.ending=!1)});var y=c.mediaSource;if(!y||y.readyState!=="open"){y&&b.logger.info("[buffer-controller]: Could not call mediaSource.endOfStream(). mediaSource.readyState: "+y.readyState);return}b.logger.log("[buffer-controller]: Calling mediaSource.endOfStream()"),y.endOfStream()}))},p.onLevelUpdated=function(o,u){var c=u.details;c.fragments.length&&(this.details=c,this.getSourceBufferTypes().length?this.blockBuffers(this.updateMediaElementDuration.bind(this)):this.updateMediaElementDuration())},p.flushBackBuffer=function(){var o=this.hls,u=this.details,c=this.media,_=this.sourceBuffer;if(!(!c||u===null)){var y=this.getSourceBufferTypes();if(y.length){var f=u.live&&o.config.liveBackBufferLength!==null?o.config.liveBackBufferLength:o.config.backBufferLength;if(!(!(0,P.isFiniteNumber)(f)||f<0)){var C=c.currentTime,L=u.levelTargetDuration,R=Math.max(f,L),O=Math.floor(C/L)*L-R;y.forEach(function(g){var m=_[g];if(m){var d=E.BufferHelper.getBuffered(m);if(d.length>0&&O>d.start(0)){if(o.trigger(T.Events.BACK_BUFFER_REACHED,{bufferEnd:O}),u.live)o.trigger(T.Events.LIVE_BACK_BUFFER_REACHED,{bufferEnd:O});else if(m.ended&&d.end(d.length-1)-C<L*2){b.logger.info("[buffer-controller]: Cannot flush "+g+" back buffer while SourceBuffer is in ended state");return}o.trigger(T.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:O,type:g})}}})}}}},p.updateMediaElementDuration=function(){if(!(!this.details||!this.media||!this.mediaSource||this.mediaSource.readyState!=="open")){var o=this.details,u=this.hls,c=this.media,_=this.mediaSource,y=o.fragments[0].start+o.totalduration,f=c.duration,C=(0,P.isFiniteNumber)(_.duration)?_.duration:0;o.live&&u.config.liveDurationInfinity?(b.logger.log("[buffer-controller]: Media Source duration is set to Infinity"),_.duration=1/0,this.updateSeekableRange(o)):(y>C&&y>f||!(0,P.isFiniteNumber)(f))&&(b.logger.log("[buffer-controller]: Updating Media Source duration to "+y.toFixed(3)),_.duration=y)}},p.updateSeekableRange=function(o){var u=this.mediaSource,c=o.fragments,_=c.length;if(_&&o.live&&u!==null&&u!==void 0&&u.setLiveSeekableRange){var y=Math.max(0,c[0].start),f=Math.max(y,y+o.totalduration);u.setLiveSeekableRange(y,f)}},p.checkPendingTracks=function(){var o=this.bufferCodecEventsExpected,u=this.operationQueue,c=this.pendingTracks,_=Object.keys(c).length;if(_&&!o||_===2){this.createSourceBuffers(c),this.pendingTracks={};var y=this.getSourceBufferTypes();if(y.length===0){this.hls.trigger(T.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,reason:"could not create source buffer for media codec(s)"});return}y.forEach(function(f){u.executeNext(f)})}},p.createSourceBuffers=function(o){var u=this.sourceBuffer,c=this.mediaSource;if(!c)throw Error("createSourceBuffers called when mediaSource was null");var _=0;for(var y in o)if(!u[y]){var f=o[y];if(!f)throw Error("source buffer exists for track "+y+", however track does not");var C=f.levelCodec||f.codec,L=f.container+";codecs="+C;b.logger.log("[buffer-controller]: creating sourceBuffer("+L+")");try{var R=u[y]=c.addSourceBuffer(L),O=y;this.addBufferListener(O,"updatestart",this._onSBUpdateStart),this.addBufferListener(O,"updateend",this._onSBUpdateEnd),this.addBufferListener(O,"error",this._onSBUpdateError),this.tracks[y]={buffer:R,codec:C,container:f.container,levelCodec:f.levelCodec,metadata:f.metadata,id:f.id},_++}catch(g){b.logger.error("[buffer-controller]: error while trying to add sourceBuffer: "+g.message),this.hls.trigger(T.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:g,mimeType:L})}}_&&this.hls.trigger(T.Events.BUFFER_CREATED,{tracks:this.tracks})},p._onSBUpdateStart=function(o){var u=this.operationQueue,c=u.current(o);c.onStart()},p._onSBUpdateEnd=function(o){var u=this.operationQueue,c=u.current(o);c.onComplete(),u.shiftAndExecuteNext(o)},p._onSBUpdateError=function(o,u){b.logger.error("[buffer-controller]: "+o+" SourceBuffer error",u),this.hls.trigger(T.Events.ERROR,{type:e.ErrorTypes.MEDIA_ERROR,details:e.ErrorDetails.BUFFER_APPENDING_ERROR,fatal:!1});var c=this.operationQueue.current(o);c&&c.onError(u)},p.removeExecutor=function(o,u,c){var _=this.media,y=this.mediaSource,f=this.operationQueue,C=this.sourceBuffer,L=C[o];if(!_||!y||!L){b.logger.warn("[buffer-controller]: Attempting to remove from the "+o+" SourceBuffer, but it does not exist"),f.shiftAndExecuteNext(o);return}var R=(0,P.isFiniteNumber)(_.duration)?_.duration:1/0,O=(0,P.isFiniteNumber)(y.duration)?y.duration:1/0,g=Math.max(0,u),m=Math.min(c,R,O);m>g&&!L.ending?(L.ended=!1,b.logger.log("[buffer-controller]: Removing ["+g+","+m+"] from the "+o+" SourceBuffer"),console.assert(!L.updating,o+" sourceBuffer must not be updating"),L.remove(g,m)):f.shiftAndExecuteNext(o)},p.appendExecutor=function(o,u){var c=this.operationQueue,_=this.sourceBuffer,y=_[u];if(!y){b.logger.warn("[buffer-controller]: Attempting to append to the "+u+" SourceBuffer, but it does not exist"),c.shiftAndExecuteNext(u);return}y.ended=!1,console.assert(!y.updating,u+" sourceBuffer must not be updating"),y.appendBuffer(o)},p.blockBuffers=function(o,u){var c=this;if(u===void 0&&(u=this.getSourceBufferTypes()),!u.length){b.logger.log("[buffer-controller]: Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(o);return}var _=this.operationQueue,y=u.map(function(f){return _.appendBlocker(f)});Promise.all(y).then(function(){o(),u.forEach(function(f){var C=c.sourceBuffer[f];(!C||!C.updating)&&_.shiftAndExecuteNext(f)})})},p.getSourceBufferTypes=function(){return Object.keys(this.sourceBuffer)},p.addBufferListener=function(o,u,c){var _=this.sourceBuffer[o];if(_){var y=c.bind(this,o);this.listeners[o].push({event:u,listener:y}),_.addEventListener(u,y)}},p.removeBufferListeners=function(o){var u=this.sourceBuffer[o];u&&this.listeners[o].forEach(function(c){u.removeEventListener(c.event,c.listener)})},v}()},"./src/controller/buffer-operation-queue.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>T});var P=S("./src/utils/logger.ts"),T=function(){function b(E){this.buffers=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.buffers=E}var e=b.prototype;return e.append=function(s,n){var t=this.queues[n];t.push(s),t.length===1&&this.buffers[n]&&this.executeNext(n)},e.insertAbort=function(s,n){var t=this.queues[n];t.unshift(s),this.executeNext(n)},e.appendBlocker=function(s){var n,t=new Promise(function(i){n=i}),r={execute:n,onStart:function(){},onComplete:function(){},onError:function(){}};return this.append(r,s),t},e.executeNext=function(s){var n=this.buffers,t=this.queues,r=n[s],i=t[s];if(i.length){var a=i[0];try{a.execute()}catch(v){P.logger.warn("[buffer-operation-queue]: Unhandled exception executing the current operation"),a.onError(v),(!r||!r.updating)&&(i.shift(),this.executeNext(s))}}},e.shiftAndExecuteNext=function(s){this.queues[s].shift(),this.executeNext(s)},e.current=function(s){return this.queues[s][0]},b}()},"./src/controller/cap-level-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>n});var P=S("./src/events.ts");function T(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,e(a.key),a)}}function b(t,r,i){return r&&T(t.prototype,r),i&&T(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function e(t){var r=E(t,"string");return typeof r=="symbol"?r:String(r)}function E(t,r){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var a=i.call(t,r||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}var s=function(){function t(i){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=i,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}var r=t.prototype;return r.setStreamController=function(a){this.streamController=a},r.destroy=function(){this.unregisterListener(),this.hls.config.capLevelToPlayerSize&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null},r.registerListeners=function(){var a=this.hls;a.on(P.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),a.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.on(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.unregisterListener=function(){var a=this.hls;a.off(P.Events.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),a.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),a.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),a.off(P.Events.BUFFER_CODECS,this.onBufferCodecs,this),a.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this)},r.onFpsDropLevelCapping=function(a,v){t.isLevelAllowed(v.droppedLevel,this.restrictedLevels)&&this.restrictedLevels.push(v.droppedLevel)},r.onMediaAttaching=function(a,v){this.media=v.media instanceof HTMLVideoElement?v.media:null,this.clientRect=null},r.onManifestParsed=function(a,v){var p=this.hls;this.restrictedLevels=[],this.firstLevel=v.firstLevel,p.config.capLevelToPlayerSize&&v.video&&this.startCapping()},r.onBufferCodecs=function(a,v){var p=this.hls;p.config.capLevelToPlayerSize&&v.video&&this.startCapping()},r.onMediaDetaching=function(){this.stopCapping()},r.detectPlayerSize=function(){if(this.media&&this.mediaHeight>0&&this.mediaWidth>0){var a=this.hls.levels;if(a.length){var v=this.hls;v.autoLevelCapping=this.getMaxLevel(a.length-1),v.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=v.autoLevelCapping}}},r.getMaxLevel=function(a){var v=this,p=this.hls.levels;if(!p.length)return-1;var l=p.filter(function(o,u){return t.isLevelAllowed(u,v.restrictedLevels)&&u<=a});return this.clientRect=null,t.getMaxLevelByMediaSize(l,this.mediaWidth,this.mediaHeight)},r.startCapping=function(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,this.hls.firstLevel=this.getMaxLevel(this.firstLevel),self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())},r.stopCapping=function(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)},r.getDimensions=function(){if(this.clientRect)return this.clientRect;var a=this.media,v={width:0,height:0};if(a){var p=a.getBoundingClientRect();v.width=p.width,v.height=p.height,!v.width&&!v.height&&(v.width=p.right-p.left||a.width||0,v.height=p.bottom-p.top||a.height||0)}return this.clientRect=v,v},t.isLevelAllowed=function(a,v){return v===void 0&&(v=[]),v.indexOf(a)===-1},t.getMaxLevelByMediaSize=function(a,v,p){if(!a||!a.length)return-1;for(var l=function(y,f){return f?y.width!==f.width||y.height!==f.height:!0},o=a.length-1,u=0;u<a.length;u+=1){var c=a[u];if((c.width>=v||c.height>=p)&&l(c,a[u+1])){o=u;break}}return o},b(t,[{key:"mediaWidth",get:function(){return this.getDimensions().width*this.contentScaleFactor}},{key:"mediaHeight",get:function(){return this.getDimensions().height*this.contentScaleFactor}},{key:"contentScaleFactor",get:function(){var a=1;if(!this.hls.config.ignoreDevicePixelRatio)try{a=self.devicePixelRatio}catch(v){}return a}}]),t}();const n=s},"./src/controller/cmcd-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>p});var P=S("./src/events.ts"),T=S("./src/types/cmcd.ts"),b=S("./src/utils/buffer-helper.ts"),e=S("./src/utils/logger.ts");function E(l,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,n(c.key),c)}}function s(l,o,u){return o&&E(l.prototype,o),u&&E(l,u),Object.defineProperty(l,"prototype",{writable:!1}),l}function n(l){var o=t(l,"string");return typeof o=="symbol"?o:String(o)}function t(l,o){if(typeof l!="object"||l===null)return l;var u=l[Symbol.toPrimitive];if(u!==void 0){var c=u.call(l,o||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(l)}function r(l,o){var u=typeof Symbol!="undefined"&&l[Symbol.iterator]||l["@@iterator"];if(u)return(u=u.call(l)).next.bind(u);if(Array.isArray(l)||(u=i(l))||o&&l&&typeof l.length=="number"){u&&(l=u);var c=0;return function(){return c>=l.length?{done:!0}:{done:!1,value:l[c++]}}}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 i(l,o){if(l){if(typeof l=="string")return a(l,o);var u=Object.prototype.toString.call(l).slice(8,-1);if(u==="Object"&&l.constructor&&(u=l.constructor.name),u==="Map"||u==="Set")return Array.from(l);if(u==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(u))return a(l,o)}}function a(l,o){(o==null||o>l.length)&&(o=l.length);for(var u=0,c=new Array(o);u<o;u++)c[u]=l[u];return c}function v(){return v=Object.assign?Object.assign.bind():function(l){for(var o=1;o<arguments.length;o++){var u=arguments[o];for(var c in u)Object.prototype.hasOwnProperty.call(u,c)&&(l[c]=u[c])}return l},v.apply(this,arguments)}var p=function(){function l(u){var c=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(){c.initialized&&(c.starved=!0),c.buffering=!0},this.onPlaying=function(){c.initialized||(c.initialized=!0),c.buffering=!1},this.applyPlaylistData=function(f){try{c.apply(f,{ot:T.CMCDObjectType.MANIFEST,su:!c.initialized})}catch(C){e.logger.warn("Could not generate manifest CMCD data.",C)}},this.applyFragmentData=function(f){try{var C=f.frag,L=c.hls.levels[C.level],R=c.getObjectType(C),O={d:C.duration*1e3,ot:R};(R===T.CMCDObjectType.VIDEO||R===T.CMCDObjectType.AUDIO||R==T.CMCDObjectType.MUXED)&&(O.br=L.bitrate/1e3,O.tb=c.getTopBandwidth(R)/1e3,O.bl=c.getBufferLength(R)),c.apply(f,O)}catch(g){e.logger.warn("Could not generate segment CMCD data.",g)}},this.hls=u;var _=this.config=u.config,y=_.cmcd;y!=null&&(_.pLoader=this.createPlaylistLoader(),_.fLoader=this.createFragmentLoader(),this.sid=y.sessionId||l.uuid(),this.cid=y.contentId,this.useHeaders=y.useHeaders===!0,this.registerListeners())}var o=l.prototype;return o.registerListeners=function(){var c=this.hls;c.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(P.Events.MEDIA_DETACHED,this.onMediaDetached,this),c.on(P.Events.BUFFER_CREATED,this.onBufferCreated,this)},o.unregisterListeners=function(){var c=this.hls;c.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(P.Events.MEDIA_DETACHED,this.onMediaDetached,this),c.off(P.Events.BUFFER_CREATED,this.onBufferCreated,this),this.onMediaDetached()},o.destroy=function(){this.unregisterListeners(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null},o.onMediaAttached=function(c,_){this.media=_.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)},o.onMediaDetached=function(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)},o.onBufferCreated=function(c,_){var y,f;this.audioBuffer=(y=_.tracks.audio)===null||y===void 0?void 0:y.buffer,this.videoBuffer=(f=_.tracks.video)===null||f===void 0?void 0:f.buffer},o.createData=function(){var c;return{v:T.CMCDVersion,sf:T.CMCDStreamingFormat.HLS,sid:this.sid,cid:this.cid,pr:(c=this.media)===null||c===void 0?void 0:c.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}},o.apply=function(c,_){_===void 0&&(_={}),v(_,this.createData());var y=_.ot===T.CMCDObjectType.INIT||_.ot===T.CMCDObjectType.VIDEO||_.ot===T.CMCDObjectType.MUXED;if(this.starved&&y&&(_.bs=!0,_.su=!0,this.starved=!1),_.su==null&&(_.su=this.buffering),this.useHeaders){var f=l.toHeaders(_);if(!Object.keys(f).length)return;c.headers||(c.headers={}),v(c.headers,f)}else{var C=l.toQuery(_);if(!C)return;c.url=l.appendQueryToUri(c.url,C)}},o.getObjectType=function(c){var _=c.type;if(_==="subtitle")return T.CMCDObjectType.TIMED_TEXT;if(c.sn==="initSegment")return T.CMCDObjectType.INIT;if(_==="audio")return T.CMCDObjectType.AUDIO;if(_==="main")return this.hls.audioTracks.length?T.CMCDObjectType.VIDEO:T.CMCDObjectType.MUXED},o.getTopBandwidth=function(c){var _=0,y,f=this.hls;if(c===T.CMCDObjectType.AUDIO)y=f.audioTracks;else{var C=f.maxAutoLevel,L=C>-1?C+1:f.levels.length;y=f.levels.slice(0,L)}for(var R=r(y),O;!(O=R()).done;){var g=O.value;g.bitrate>_&&(_=g.bitrate)}return _>0?_:NaN},o.getBufferLength=function(c){var _=this.hls.media,y=c===T.CMCDObjectType.AUDIO?this.audioBuffer:this.videoBuffer;if(!y||!_)return NaN;var f=b.BufferHelper.bufferInfo(y,_.currentTime,this.config.maxBufferHole);return f.len*1e3},o.createPlaylistLoader=function(){var c=this.config.pLoader,_=this.applyPlaylistData,y=c||this.config.loader;return function(){function f(L){this.loader=void 0,this.loader=new y(L)}var C=f.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(R,O,g){_(R),this.loader.load(R,O,g)},s(f,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),f}()},o.createFragmentLoader=function(){var c=this.config.fLoader,_=this.applyFragmentData,y=c||this.config.loader;return function(){function f(L){this.loader=void 0,this.loader=new y(L)}var C=f.prototype;return C.destroy=function(){this.loader.destroy()},C.abort=function(){this.loader.abort()},C.load=function(R,O,g){_(R),this.loader.load(R,O,g)},s(f,[{key:"stats",get:function(){return this.loader.stats}},{key:"context",get:function(){return this.loader.context}}]),f}()},l.uuid=function(){var c=URL.createObjectURL(new Blob),_=c.toString();return URL.revokeObjectURL(c),_.slice(_.lastIndexOf("/")+1)},l.serialize=function(c){for(var _=[],y=function(I){return!Number.isNaN(I)&&I!=null&&I!==""&&I!==!1},f=function(I){return Math.round(I)},C=function(I){return f(I/100)*100},L=function(I){return encodeURIComponent(I)},R={br:f,d:f,bl:C,dl:C,mtp:C,nor:L,rtp:C,tb:f},O=Object.keys(c||{}).sort(),g=r(O),m;!(m=g()).done;){var d=m.value,h=c[d];if(y(h)&&!(d==="v"&&h===1)&&!(d=="pr"&&h===1)){var A=R[d];A&&(h=A(h));var w=typeof h,x=void 0;d==="ot"||d==="sf"||d==="st"?x=d+"="+h:w==="boolean"?x=d:w==="number"?x=d+"="+h:x=d+"="+JSON.stringify(h),_.push(x)}}return _.join(",")},l.toHeaders=function(c){for(var _=Object.keys(c),y={},f=["Object","Request","Session","Status"],C=[{},{},{},{}],L={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},R=0,O=_;R<O.length;R++){var g=O[R],m=L[g]!=null?L[g]:1;C[m][g]=c[g]}for(var d=0;d<C.length;d++){var h=l.serialize(C[d]);h&&(y["CMCD-"+f[d]]=h)}return y},l.toQuery=function(c){return"CMCD="+encodeURIComponent(l.serialize(c))},l.appendQueryToUri=function(c,_){if(!_)return c;var y=c.includes("?")?"&":"?";return""+c+y+_},l}()},"./src/controller/eme-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>R});var P=S("./src/events.ts"),T=S("./src/errors.ts"),b=S("./src/utils/logger.ts"),e=S("./src/utils/mediakeys-helper.ts"),E=S("./src/utils/keysystem-util.ts"),s=S("./src/utils/numeric-encoding-utils.ts"),n=S("./src/loader/level-key.ts"),t=S("./src/utils/hex.ts"),r=S("./src/utils/mp4-tools.ts"),i=S("./node_modules/eventemitter3/index.js"),a=S.n(i);function v(O,g){O.prototype=Object.create(g.prototype),O.prototype.constructor=O,c(O,g)}function p(O){var g=typeof Map=="function"?new Map:void 0;return p=function(d){if(d===null||!u(d))return d;if(typeof d!="function")throw new TypeError("Super expression must either be null or a function");if(typeof g!="undefined"){if(g.has(d))return g.get(d);g.set(d,h)}function h(){return l(d,arguments,_(this).constructor)}return h.prototype=Object.create(d.prototype,{constructor:{value:h,enumerable:!1,writable:!0,configurable:!0}}),c(h,d)},p(O)}function l(O,g,m){return o()?l=Reflect.construct.bind():l=function(h,A,w){var x=[null];x.push.apply(x,A);var D=Function.bind.apply(h,x),I=new D;return w&&c(I,w.prototype),I},l.apply(null,arguments)}function o(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(O){return!1}}function u(O){return Function.toString.call(O).indexOf("[native code]")!==-1}function c(O,g){return c=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(d,h){return d.__proto__=h,d},c(O,g)}function _(O){return _=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(m){return m.__proto__||Object.getPrototypeOf(m)},_(O)}var y=3,f="[eme]",C=function(){function O(m){this.hls=void 0,this.config=void 0,this.media=null,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.setMediaKeysQueue=O.CDMCleanupPromise?[O.CDMCleanupPromise]:[],this.onMediaEncrypted=this._onMediaEncrypted.bind(this),this.onWaitingForKey=this._onWaitingForKey.bind(this),this.debug=b.logger.debug.bind(b.logger,f),this.log=b.logger.log.bind(b.logger,f),this.warn=b.logger.warn.bind(b.logger,f),this.error=b.logger.error.bind(b.logger,f),this.hls=m,this.config=m.config,this.registerListeners()}var g=O.prototype;return g.destroy=function(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.onMediaEncrypted=this.onWaitingForKey=this.keyIdToKeySessionPromise=null},g.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(P.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},g.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(P.Events.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(P.Events.MANIFEST_LOADED,this.onManifestLoaded,this)},g.getLicenseServerUrl=function(d){var h=this.config,A=h.drmSystems,w=h.widevineLicenseUrl,x=A[d];if(x)return x.licenseUrl;if(d===e.KeySystems.WIDEVINE&&w)return w;throw new Error('no license server URL configured for key-system "'+d+'"')},g.getServerCertificateUrl=function(d){var h=this.config.drmSystems,A=h[d];if(A)return A.serverCertificateUrl;this.log('No Server Certificate in config.drmSystems["'+d+'"]')},g.attemptKeySystemAccess=function(d){var h=this,A=this.hls.levels,w=function(F,K,W){return!!F&&W.indexOf(F)===K},x=A.map(function(I){return I.audioCodec}).filter(w),D=A.map(function(I){return I.videoCodec}).filter(w);return x.length+D.length===0&&D.push("avc1.42e01e"),new Promise(function(I,F){var K=function W(z){var j=z.shift();h.getMediaKeysPromise(j,x,D).then(function(G){return I({keySystem:j,mediaKeys:G})}).catch(function(G){z.length?W(z):G instanceof L?F(G):F(new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_ACCESS,error:G,fatal:!0},G.message))})};K(d)})},g.requestMediaKeySystemAccess=function(d,h){var A=this.config.requestMediaKeySystemAccessFunc;if(typeof A!="function"){var w="Configured requestMediaKeySystemAccess is not a function "+A;return e.requestMediaKeySystemAccess===null&&self.location.protocol==="http:"&&(w="navigator.requestMediaKeySystemAccess is not available over insecure protocol "+location.protocol),Promise.reject(new Error(w))}return A(d,h)},g.getMediaKeysPromise=function(d,h,A){var w=this,x=(0,e.getSupportedMediaKeySystemConfigurations)(d,h,A,this.config.drmSystemOptions),D=this.keySystemAccessPromises[d],I=D==null?void 0:D.keySystemAccess;if(!I){this.log('Requesting encrypted media "'+d+'" key-system access with config: '+JSON.stringify(x)),I=this.requestMediaKeySystemAccess(d,x);var F=this.keySystemAccessPromises[d]={keySystemAccess:I};return I.catch(function(K){w.log('Failed to obtain access to key-system "'+d+'": '+K)}),I.then(function(K){w.log('Access for key-system "'+K.keySystem+'" obtained');var W=w.fetchServerCertificate(d);return w.log('Create media-keys for "'+d+'"'),F.mediaKeys=K.createMediaKeys().then(function(z){return w.log('Media-keys created for "'+d+'"'),W.then(function(j){return j?w.setMediaKeysServerCertificate(z,d,j):z})}),F.mediaKeys.catch(function(z){w.error('Failed to create media-keys for "'+d+'"}: '+z)}),F.mediaKeys})}return I.then(function(){return D.mediaKeys})},g.createMediaKeySessionContext=function(d){var h=d.decryptdata,A=d.keySystem,w=d.mediaKeys;console.assert(!!w,"mediaKeys is defined"),this.log('Creating key-system session "'+A+'" keyId: '+t.default.hexDump(h.keyId||[]));var x=w.createSession(),D={decryptdata:h,keySystem:A,mediaKeys:w,mediaKeysSession:x,keyStatus:"status-pending"};return this.mediaKeySessions.push(D),D},g.renewKeySession=function(d){var h=d.decryptdata;if(h.pssh){var A=this.createMediaKeySessionContext(d),w=this.getKeyIdString(h),x="cenc";this.keyIdToKeySessionPromise[w]=this.generateRequestWithPreferredKeySession(A,x,h.pssh,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(d)},g.getKeyIdString=function(d){if(!d)throw new Error("Could not read keyId of undefined decryptdata");if(d.keyId===null)throw new Error("keyId is null");return t.default.hexDump(d.keyId)},g.updateKeySession=function(d,h){var A,w=d.mediaKeysSession;return this.log('Updating key-session "'+w.sessionId+'" for keyID '+t.default.hexDump(((A=d.decryptdata)===null||A===void 0?void 0:A.keyId)||[])+`
} (data length: `+(h&&h.byteLength)+")"),w.update(h)},g.selectKeySystemFormat=function(d){var h=Object.keys(d.levelkeys||{});return this.keyFormatPromise||(this.log("Selecting key-system from fragment (sn: "+d.sn+" "+d.type+": "+d.level+") key formats "+h.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(h)),this.keyFormatPromise},g.getKeyFormatPromise=function(d){var h=this;return new Promise(function(A,w){var x=(0,e.getKeySystemsForConfig)(h.config),D=d.map(e.keySystemFormatToKeySystemDomain).filter(function(I){return!!I&&x.indexOf(I)!==-1});return h.getKeySystemSelectionPromise(D).then(function(I){var F=I.keySystem,K=(0,e.keySystemDomainToKeySystemFormat)(F);K?A(K):w(new Error('Unable to find format for key-system "'+F+'"'))}).catch(w)})},g.loadKey=function(d){var h=this,A=d.keyInfo.decryptdata,w=this.getKeyIdString(A),x="(keyId: "+w+' format: "'+A.keyFormat+'" method: '+A.method+" uri: "+A.uri+")";this.log("Starting session for key "+x);var D=this.keyIdToKeySessionPromise[w];return D||(D=this.keyIdToKeySessionPromise[w]=this.getKeySystemForKeyPromise(A).then(function(I){var F=I.keySystem,K=I.mediaKeys;return h.throwIfDestroyed(),h.log("Handle encrypted media sn: "+d.frag.sn+" "+d.frag.type+": "+d.frag.level+" using key "+x),h.attemptSetMediaKeys(F,K).then(function(){h.throwIfDestroyed();var W=h.createMediaKeySessionContext({keySystem:F,mediaKeys:K,decryptdata:A}),z="cenc";return h.generateRequestWithPreferredKeySession(W,z,A.pssh,"playlist-key")})}),D.catch(function(I){return h.handleError(I)})),D},g.throwIfDestroyed=function(d){if(d===void 0&&(d="Invalid state"),!this.hls)throw new Error("invalid state")},g.handleError=function(d){this.hls&&(this.error(d.message),d instanceof L?this.hls.trigger(P.Events.ERROR,d.data):this.hls.trigger(P.Events.ERROR,{type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_KEYS,error:d,fatal:!0}))},g.getKeySystemForKeyPromise=function(d){var h=this.getKeyIdString(d),A=this.keyIdToKeySessionPromise[h];if(!A){var w=(0,e.keySystemFormatToKeySystemDomain)(d.keyFormat),x=w?[w]:(0,e.getKeySystemsForConfig)(this.config);return this.attemptKeySystemAccess(x)}return A},g.getKeySystemSelectionPromise=function(d){if(d.length||(d=(0,e.getKeySystemsForConfig)(this.config)),d.length===0)throw new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},"Missing key-system license configuration options "+JSON.stringify({drmSystems:this.config.drmSystems}));return this.attemptKeySystemAccess(d)},g._onMediaEncrypted=function(d){var h=this,A=d.initDataType,w=d.initData;if(this.debug('"'+d.type+'" event: init data type: "'+A+'"'),w!==null){var x,D;if(A==="sinf"&&this.config.drmSystems[e.KeySystems.FAIRPLAY]){var I=(0,r.bin2str)(new Uint8Array(w));try{var F=(0,s.base64Decode)(JSON.parse(I).sinf),K=(0,r.parseSinf)(new Uint8Array(F));if(!K)return;x=K.subarray(8,24),D=e.KeySystems.FAIRPLAY}catch(ae){this.warn('Failed to parse sinf "encrypted" event message initData');return}}else{var W=(0,r.parsePssh)(w);if(W===null)return;W.version===0&&W.systemId===e.KeySystemIds.WIDEVINE&&W.data&&(x=W.data.subarray(8,24)),D=(0,e.keySystemIdToKeySystemDomain)(W.systemId)}if(!(!D||!x)){for(var z=t.default.hexDump(x),j=this.keyIdToKeySessionPromise,G=this.mediaKeySessions,Z=j[z],Q=function(_e){var xe=G[_e],ge=xe.decryptdata;if(ge.pssh||!ge.keyId)return"continue";var ce=t.default.hexDump(ge.keyId);if(z===ce||ge.uri.replace(/-/g,"").indexOf(z)!==-1)return Z=j[ce],delete j[ce],ge.pssh=new Uint8Array(w),ge.keyId=x,Z=j[z]=Z.then(function(){return h.generateRequestWithPreferredKeySession(xe,A,w,"encrypted-event-key-match")}),"break"},ue=0;ue<G.length;ue++){var ee=Q(ue);if(ee!=="continue"&&ee==="break")break}Z||(Z=j[z]=this.getKeySystemSelectionPromise([D]).then(function(ae){var _e,xe=ae.keySystem,ge=ae.mediaKeys;h.throwIfDestroyed();var ce=new n.LevelKey("ISO-23001-7",z,(_e=(0,e.keySystemDomainToKeySystemFormat)(xe))!=null?_e:"");return ce.pssh=new Uint8Array(w),ce.keyId=x,h.attemptSetMediaKeys(xe,ge).then(function(){h.throwIfDestroyed();var he=h.createMediaKeySessionContext({decryptdata:ce,keySystem:xe,mediaKeys:ge});return h.generateRequestWithPreferredKeySession(he,A,w,"encrypted-event-no-match")})})),Z.catch(function(ae){return h.handleError(ae)})}}},g._onWaitingForKey=function(d){this.log('"'+d.type+'" event')},g.attemptSetMediaKeys=function(d,h){var A=this,w=this.setMediaKeysQueue.slice();this.log('Setting media-keys for "'+d+'"');var x=Promise.all(w).then(function(){if(!A.media)throw new Error("Attempted to set mediaKeys without media element attached");return A.media.setMediaKeys(h)});return this.setMediaKeysQueue.push(x),x.then(function(){A.log('Media-keys set for "'+d+'"'),w.push(x),A.setMediaKeysQueue=A.setMediaKeysQueue.filter(function(D){return w.indexOf(D)===-1})})},g.generateRequestWithPreferredKeySession=function(d,h,A,w){var x,D,I=this,F=(x=this.config.drmSystems)===null||x===void 0||(D=x[d.keySystem])===null||D===void 0?void 0:D.generateRequest;if(F)try{var K=F.call(this.hls,h,A,d);if(!K)throw new Error("Invalid response from configured generateRequest filter");h=K.initDataType,A=d.decryptdata.pssh=K.initData?new Uint8Array(K.initData):null}catch(Z){var W;if(this.warn(Z.message),(W=this.hls)!==null&&W!==void 0&&W.config.debug)throw Z}if(A===null)return this.log('Skipping key-session request for "'+w+'" (no initData)'),Promise.resolve(d);var z=this.getKeyIdString(d.decryptdata);this.log('Generating key-session request for "'+w+'": '+z+" (init data type: "+h+" length: "+(A?A.byteLength:null)+")");var j=new(a());d.mediaKeysSession.onmessage=function(Z){var Q=d.mediaKeysSession;if(!Q){j.emit("error",new Error("invalid state"));return}var ue=Z.messageType,ee=Z.message;I.log('"'+ue+'" message event for session "'+Q.sessionId+'" message size: '+ee.byteLength),ue==="license-request"||ue==="license-renewal"?I.renewLicense(d,ee).catch(function(ae){I.handleError(ae),j.emit("error",ae)}):ue==="license-release"?d.keySystem===e.KeySystems.FAIRPLAY&&(I.updateKeySession(d,(0,E.strToUtf8array)("acknowledged")),I.removeSession(d)):I.warn('unhandled media key message type "'+ue+'"')},d.mediaKeysSession.onkeystatuseschange=function(Z){var Q=d.mediaKeysSession;if(!Q){j.emit("error",new Error("invalid state"));return}I.onKeyStatusChange(d);var ue=d.keyStatus;j.emit("keyStatus",ue),ue==="expired"&&(I.warn(d.keySystem+" expired for key "+z),I.renewKeySession(d))};var G=new Promise(function(Z,Q){j.on("error",Q),j.on("keyStatus",function(ue){ue.startsWith("usable")?Z():ue==="output-restricted"?Q(new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED,fatal:!1},"HDCP level output restricted")):ue==="internal-error"?Q(new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_STATUS_INTERNAL_ERROR,fatal:!0},'key status changed to "'+ue+'"')):ue==="expired"?Q(new Error("key expired while generating request")):I.warn('unhandled key status change "'+ue+'"')})});return d.mediaKeysSession.generateRequest(h,A).then(function(){var Z;I.log('Request generated for key-session "'+((Z=d.mediaKeysSession)===null||Z===void 0?void 0:Z.sessionId)+'" keyId: '+z)}).catch(function(Z){throw new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_NO_SESSION,error:Z,fatal:!1},"Error generating key-session request: "+Z)}).then(function(){return G}).catch(function(Z){throw j.removeAllListeners(),I.removeSession(d),Z}).then(function(){return j.removeAllListeners(),d})},g.onKeyStatusChange=function(d){var h=this;d.mediaKeysSession.keyStatuses.forEach(function(A,w){h.log('key status change "'+A+'" for keyStatuses keyId: '+t.default.hexDump("buffer"in w?new Uint8Array(w.buffer,w.byteOffset,w.byteLength):new Uint8Array(w))+" session keyId: "+t.default.hexDump(new Uint8Array(d.decryptdata.keyId||[]))+" uri: "+d.decryptdata.uri),d.keyStatus=A})},g.fetchServerCertificate=function(d){var h=this;return new Promise(function(A,w){var x=h.getServerCertificateUrl(d);if(!x)return A();h.log('Fetching serverCertificate for "'+d+'"');var D=new XMLHttpRequest;D.open("GET",x,!0),D.responseType="arraybuffer",D.onreadystatechange=function(){D.readyState===XMLHttpRequest.DONE&&(D.status===200?A(D.response):w(new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:D},'"'+d+'" certificate request XHR failed ('+x+"). Status: "+D.status+" ("+D.statusText+")")))},D.send()})},g.setMediaKeysServerCertificate=function(d,h,A){var w=this;return new Promise(function(x,D){d.setServerCertificate(A).then(function(I){w.log("setServerCertificate "+(I?"success":"not supported by CDM")+" ("+(A==null?void 0:A.byteLength)+') on "'+h+'"'),x(d)}).catch(function(I){D(new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:I,fatal:!0},I.message))})})},g.renewLicense=function(d,h){var A=this;return this.requestLicense(d,new Uint8Array(h)).then(function(w){return A.updateKeySession(d,new Uint8Array(w)).catch(function(x){throw new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_SESSION_UPDATE_FAILED,error:x,fatal:!0},x.message)})})},g.setupLicenseXHR=function(d,h,A,w){var x=this,D=this.config.licenseXhrSetup;return D?Promise.resolve().then(function(){if(!A.decryptdata)throw new Error("Key removed");return D.call(x.hls,d,h,A,w)}).catch(function(I){if(!A.decryptdata)throw I;return d.open("POST",h,!0),D.call(x.hls,d,h,A,w)}).then(function(I){d.readyState||d.open("POST",h,!0);var F=I||w;return{xhr:d,licenseChallenge:F}}):(d.open("POST",h,!0),Promise.resolve({xhr:d,licenseChallenge:w}))},g.requestLicense=function(d,h){var A=this;return new Promise(function(w,x){var D=A.getLicenseServerUrl(d.keySystem);A.log("Sending license request to URL: "+D);var I=new XMLHttpRequest;I.responseType="arraybuffer",I.onreadystatechange=function(){if(!A.hls||!d.mediaKeysSession)return x(new Error("invalid state"));if(I.readyState===4)if(I.status===200){A._requestLicenseFailureCount=0;var F=I.response;A.log("License received "+(F instanceof ArrayBuffer?F.byteLength:F));var K=A.config.licenseResponseCallback;if(K)try{F=K.call(A.hls,I,D,d)}catch(z){A.error(z)}w(F)}else if(A._requestLicenseFailureCount++,A._requestLicenseFailureCount>y||I.status>=400&&I.status<500)x(new L({type:T.ErrorTypes.KEY_SYSTEM_ERROR,details:T.ErrorDetails.KEY_SYSTEM_LICENSE_REQUEST_FAILED,fatal:!0,networkDetails:I},"License Request XHR failed ("+D+"). Status: "+I.status+" ("+I.statusText+")"));else{var W=y-A._requestLicenseFailureCount+1;A.warn("Retrying license request, "+W+" attempts left"),A.requestLicense(d,h).then(w,x)}},d.licenseXhr&&d.licenseXhr.readyState!==XMLHttpRequest.DONE&&d.licenseXhr.abort(),d.licenseXhr=I,A.setupLicenseXHR(I,D,d,h).then(function(F){var K=F.xhr,W=F.licenseChallenge;K.send(W)})})},g.onMediaAttached=function(d,h){if(this.config.emeEnabled){var A=h.media;this.media=A,A.addEventListener("encrypted",this.onMediaEncrypted),A.addEventListener("waitingforkey",this.onWaitingForKey)}},g.onMediaDetached=function(){var d=this,h=this.media,A=this.mediaKeySessions;h&&(h.removeEventListener("encrypted",this.onMediaEncrypted),h.removeEventListener("waitingforkey",this.onWaitingForKey),this.media=null),this._requestLicenseFailureCount=0,this.setMediaKeysQueue=[],this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},n.LevelKey.clearKeyUriToKeyIdMap();var w=A.length;O.CDMCleanupPromise=Promise.all(A.map(function(x){return d.removeSession(x)}).concat(h==null?void 0:h.setMediaKeys(null).catch(function(x){d.log("Could not clear media keys: "+x+". media.src: "+(h==null?void 0:h.src))}))).then(function(){w&&(d.log("finished closing key sessions and clearing media keys"),A.length=0)}).catch(function(x){d.log("Could not close sessions and clear media keys: "+x+". media.src: "+(h==null?void 0:h.src))})},g.onManifestLoaded=function(d,h){var A=h.sessionKeys;if(!(!A||!this.config.emeEnabled)&&!this.keyFormatPromise){var w=A.reduce(function(x,D){return x.indexOf(D.keyFormat)===-1&&x.push(D.keyFormat),x},[]);this.log("Selecting key-system from session-keys "+w.join(", ")),this.keyFormatPromise=this.getKeyFormatPromise(w)}},g.removeSession=function(d){var h=this,A=d.mediaKeysSession,w=d.licenseXhr;if(A){this.log("Remove licenses and keys and close session "+A.sessionId),A.onmessage=null,A.onkeystatuseschange=null,w&&w.readyState!==XMLHttpRequest.DONE&&w.abort(),d.mediaKeysSession=d.decryptdata=d.licenseXhr=void 0;var x=this.mediaKeySessions.indexOf(d);return x>-1&&this.mediaKeySessions.splice(x,1),A.remove().catch(function(D){h.log("Could not remove session: "+D)}).then(function(){return A.close()}).catch(function(D){h.log("Could not close session: "+D)})}},O}();C.CDMCleanupPromise=void 0;var L=function(O){v(g,O);function g(m,d){var h;return h=O.call(this,d)||this,h.data=void 0,h.data=m,m.err=m.error,h}return g}(p(Error));const R=C},"./src/controller/fps-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>e});var P=S("./src/events.ts"),T=S("./src/utils/logger.ts"),b=function(){function E(n){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=n,this.registerListeners()}var s=E.prototype;return s.setStreamController=function(t){this.streamController=t},s.registerListeners=function(){this.hls.on(P.Events.MEDIA_ATTACHING,this.onMediaAttaching,this)},s.unregisterListeners=function(){this.hls.off(P.Events.MEDIA_ATTACHING,this.onMediaAttaching)},s.destroy=function(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null},s.onMediaAttaching=function(t,r){var i=this.hls.config;if(i.capLevelOnFPSDrop){var a=r.media instanceof self.HTMLVideoElement?r.media:null;this.media=a,a&&typeof a.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),i.fpsDroppedMonitoringPeriod)}},s.checkFPS=function(t,r,i){var a=performance.now();if(r){if(this.lastTime){var v=a-this.lastTime,p=i-this.lastDroppedFrames,l=r-this.lastDecodedFrames,o=1e3*p/v,u=this.hls;if(u.trigger(P.Events.FPS_DROP,{currentDropped:p,currentDecoded:l,totalDroppedFrames:i}),o>0&&p>u.config.fpsDroppedMonitoringThreshold*l){var c=u.currentLevel;T.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+c),c>0&&(u.autoLevelCapping===-1||u.autoLevelCapping>=c)&&(c=c-1,u.trigger(P.Events.FPS_DROP_LEVEL_CAPPING,{level:c,droppedLevel:u.currentLevel}),u.autoLevelCapping=c,this.streamController.nextLevelSwitch())}}this.lastTime=a,this.lastDroppedFrames=i,this.lastDecodedFrames=r}},s.checkFPSInterval=function(){var t=this.media;if(t)if(this.isVideoPlaybackQualityAvailable){var r=t.getVideoPlaybackQuality();this.checkFPS(t,r.totalVideoFrames,r.droppedVideoFrames)}else this.checkFPS(t,t.webkitDecodedFrameCount,t.webkitDroppedFrameCount)},E}();const e=b},"./src/controller/fragment-finders.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{findFragWithCC:()=>n,findFragmentByPDT:()=>b,findFragmentByPTS:()=>e,fragmentWithinToleranceTest:()=>E,pdtWithinToleranceTest:()=>s});var P=S("./src/polyfills/number.ts"),T=S("./src/utils/binary-search.ts");function b(t,r,i){if(r===null||!Array.isArray(t)||!t.length||!(0,P.isFiniteNumber)(r))return null;var a=t[0].programDateTime;if(r<(a||0))return null;var v=t[t.length-1].endProgramDateTime;if(r>=(v||0))return null;i=i||0;for(var p=0;p<t.length;++p){var l=t[p];if(s(r,i,l))return l}return null}function e(t,r,i,a){i===void 0&&(i=0),a===void 0&&(a=0);var v=null;if(t?v=r[t.sn-r[0].sn+1]||null:i===0&&r[0].start===0&&(v=r[0]),v&&E(i,a,v)===0)return v;var p=T.default.search(r,E.bind(null,i,a));return p&&(p!==t||!v)?p:v}function E(t,r,i){if(t===void 0&&(t=0),r===void 0&&(r=0),i.start<=t&&i.start+i.duration>t)return 0;var a=Math.min(r,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-a<=t?1:i.start-a>t&&i.start?-1:0}function s(t,r,i){var a=Math.min(r,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3,v=i.endProgramDateTime||0;return v-a>t}function n(t,r){return T.default.search(t,function(i){return i.cc<r?1:i.cc>r?-1:0})}},"./src/controller/fragment-tracker.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{FragmentState:()=>b,FragmentTracker:()=>e});var P=S("./src/events.ts"),T=S("./src/types/loader.ts"),b;(function(n){n.NOT_LOADED="NOT_LOADED",n.APPENDING="APPENDING",n.PARTIAL="PARTIAL",n.OK="OK"})(b||(b={}));var e=function(){function n(r){this.activeFragment=null,this.activeParts=null,this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hls=r,this._registerListeners()}var t=n.prototype;return t._registerListeners=function(){var i=this.hls;i.on(P.Events.BUFFER_APPENDED,this.onBufferAppended,this),i.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.on(P.Events.FRAG_LOADED,this.onFragLoaded,this)},t._unregisterListeners=function(){var i=this.hls;i.off(P.Events.BUFFER_APPENDED,this.onBufferAppended,this),i.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this),i.off(P.Events.FRAG_LOADED,this.onFragLoaded,this)},t.destroy=function(){this._unregisterListeners(),this.fragments=this.endListFragments=this.timeRanges=this.activeFragment=this.activeParts=null},t.getAppendedFrag=function(i,a){if(a===T.PlaylistLevelType.MAIN){var v=this.activeFragment,p=this.activeParts;if(!v)return null;if(p)for(var l=p.length;l--;){var o=p[l],u=o?o.end:v.appendedPTS;if(o.start<=i&&u!==void 0&&i<=u)return l>9&&(this.activeParts=p.slice(l-9)),o}else if(v.start<=i&&v.appendedPTS!==void 0&&i<=v.appendedPTS)return v}return this.getBufferedFrag(i,a)},t.getBufferedFrag=function(i,a){for(var v=this.fragments,p=Object.keys(v),l=p.length;l--;){var o=v[p[l]];if((o==null?void 0:o.body.type)===a&&o.buffered){var u=o.body;if(u.start<=i&&i<=u.end)return u}}return null},t.detectEvictedFragments=function(i,a,v){var p=this;this.timeRanges&&(this.timeRanges[i]=a),Object.keys(this.fragments).forEach(function(l){var o=p.fragments[l];if(o){if(!o.buffered&&!o.loaded){o.body.type===v&&p.removeFragment(o.body);return}var u=o.range[i];u&&u.time.some(function(c){var _=!p.isTimeBuffered(c.startPTS,c.endPTS,a);return _&&p.removeFragment(o.body),_})}})},t.detectPartialFragments=function(i){var a=this,v=this.timeRanges,p=i.frag,l=i.part;if(!(!v||p.sn==="initSegment")){var o=s(p),u=this.fragments[o];u&&(Object.keys(v).forEach(function(c){var _=p.elementaryStreams[c];if(_){var y=v[c],f=l!==null||_.partial===!0;u.range[c]=a.getBufferedTimes(p,l,f,y)}}),u.loaded=null,Object.keys(u.range).length?(u.buffered=!0,u.body.endList&&(this.endListFragments[u.body.type]=u)):this.removeFragment(u.body))}},t.fragBuffered=function(i){var a=s(i),v=this.fragments[a];v&&(v.loaded=null,v.buffered=!0)},t.getBufferedTimes=function(i,a,v,p){for(var l={time:[],partial:v},o=a?a.start:i.start,u=a?a.end:i.end,c=i.minEndPTS||u,_=i.maxStartPTS||o,y=0;y<p.length;y++){var f=p.start(y)-this.bufferPadding,C=p.end(y)+this.bufferPadding;if(_>=f&&c<=C){l.time.push({startPTS:Math.max(o,p.start(y)),endPTS:Math.min(u,p.end(y))});break}else if(o<C&&u>f)l.partial=!0,l.time.push({startPTS:Math.max(o,p.start(y)),endPTS:Math.min(u,p.end(y))});else if(u<=f)break}return l},t.getPartialFragment=function(i){var a=null,v,p,l,o=0,u=this.bufferPadding,c=this.fragments;return Object.keys(c).forEach(function(_){var y=c[_];y&&E(y)&&(p=y.body.start-u,l=y.body.end+u,i>=p&&i<=l&&(v=Math.min(i-p,l-i),o<=v&&(a=y.body,o=v)))}),a},t.isEndListAppended=function(i){var a=this.endListFragments[i];return a!==void 0&&(a.buffered||E(a))},t.getState=function(i){var a=s(i),v=this.fragments[a];return v?v.buffered?E(v)?b.PARTIAL:b.OK:b.APPENDING:b.NOT_LOADED},t.isTimeBuffered=function(i,a,v){for(var p,l,o=0;o<v.length;o++){if(p=v.start(o)-this.bufferPadding,l=v.end(o)+this.bufferPadding,i>=p&&a<=l)return!0;if(a<=p)return!1}return!1},t.onFragLoaded=function(i,a){var v=a.frag,p=a.part;if(!(v.sn==="initSegment"||v.bitrateTest||p)){var l=s(v);this.fragments[l]={body:v,loaded:a,buffered:!1,range:Object.create(null)}}},t.onBufferAppended=function(i,a){var v=this,p=a.frag,l=a.part,o=a.timeRanges;if(p.type===T.PlaylistLevelType.MAIN)if(this.activeFragment!==p&&(this.activeFragment=p,p.appendedPTS=void 0),l){var u=this.activeParts;u||(this.activeParts=u=[]),u.push(l)}else this.activeParts=null;this.timeRanges=o,Object.keys(o).forEach(function(c){var _=o[c];if(v.detectEvictedFragments(c,_),!l&&p.type===T.PlaylistLevelType.MAIN){var y=p.elementaryStreams[c];if(!y)return;for(var f=0;f<_.length;f++){var C=_.end(f);C<=y.endPTS&&C>y.startPTS?p.appendedPTS=Math.max(C,p.appendedPTS||0):p.appendedPTS=y.endPTS}}})},t.onFragBuffered=function(i,a){this.detectPartialFragments(a)},t.hasFragment=function(i){var a=s(i);return!!this.fragments[a]},t.removeFragmentsInRange=function(i,a,v){var p=this;Object.keys(this.fragments).forEach(function(l){var o=p.fragments[l];if(o&&o.buffered){var u=o.body;u.type===v&&u.start<a&&u.end>i&&p.removeFragment(u)}})},t.removeFragment=function(i){var a=s(i);i.stats.loaded=0,i.clearElementaryStreamInfo(),i.appendedPTS=void 0,delete this.fragments[a],i.endList&&delete this.endListFragments[i.type]},t.removeAllFragments=function(){this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activeFragment=null,this.activeParts=null},n}();function E(n){var t,r;return n.buffered&&(((t=n.range.video)===null||t===void 0?void 0:t.partial)||((r=n.range.audio)===null||r===void 0?void 0:r.partial))}function s(n){return n.type+"_"+n.level+"_"+n.urlId+"_"+n.sn}},"./src/controller/gap-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{MAX_START_GAP_JUMP:()=>s,SKIP_BUFFER_HOLE_STEP_SECONDS:()=>n,SKIP_BUFFER_RANGE_START:()=>t,STALL_MINIMUM_DURATION_MS:()=>E,default:()=>r});var P=S("./src/utils/buffer-helper.ts"),T=S("./src/errors.ts"),b=S("./src/events.ts"),e=S("./src/utils/logger.ts"),E=250,s=2,n=.1,t=.05,r=function(){function i(v,p,l,o){this.config=void 0,this.media=null,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=v,this.media=p,this.fragmentTracker=l,this.hls=o}var a=i.prototype;return a.destroy=function(){this.media=null,this.hls=this.fragmentTracker=null},a.poll=function(p,l){var o=this.config,u=this.media,c=this.stalled;if(u!==null){var _=u.currentTime,y=u.seeking,f=this.seeking&&!y,C=!this.seeking&&y;if(this.seeking=y,_!==p){if(this.moved=!0,c!==null){if(this.stallReported){var L=self.performance.now()-c;e.logger.warn("playback not stuck anymore @"+_+", after "+Math.round(L)+"ms"),this.stallReported=!1}this.stalled=null,this.nudgeRetry=0}return}if((C||f)&&(this.stalled=null),!(u.paused&&!y||u.ended||u.playbackRate===0||!P.BufferHelper.getBuffered(u).length)){var R=P.BufferHelper.bufferInfo(u,_,0),O=R.len>0,g=R.nextStart||0;if(!(!O&&!g)){if(y){var m=R.len>s,d=!g||l&&l.start<=_||g-_>s&&!this.fragmentTracker.getPartialFragment(_);if(m||d)return;this.moved=!1}if(!this.moved&&this.stalled!==null){var h,A=Math.max(g,R.start||0)-_,w=this.hls.levels?this.hls.levels[this.hls.currentLevel]:null,x=w==null||(h=w.details)===null||h===void 0?void 0:h.live,D=x?w.details.targetduration*2:s;if(A>0&&A<=D){this._trySkipBufferHole(null);return}}var I=self.performance.now();if(c===null){this.stalled=I;return}var F=I-c;if(!(!y&&F>=E&&(this._reportStall(R),!this.media))){var K=P.BufferHelper.bufferInfo(u,_,o.maxBufferHole);this._tryFixBufferStall(K,F)}}}}},a._tryFixBufferStall=function(p,l){var o=this.config,u=this.fragmentTracker,c=this.media;if(c!==null){var _=c.currentTime,y=u.getPartialFragment(_);if(y){var f=this._trySkipBufferHole(y);if(f||!this.media)return}p.len>o.maxBufferHole&&l>o.highBufferWatchdogPeriod*1e3&&(e.logger.warn("Trying to nudge playhead over buffer-hole"),this.stalled=null,this._tryNudgeBuffer())}},a._reportStall=function(p){var l=this.hls,o=this.media,u=this.stallReported;!u&&o&&(this.stallReported=!0,e.logger.warn("Playback stalling at @"+o.currentTime+" due to low buffer ("+JSON.stringify(p)+")"),l.trigger(b.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!1,buffer:p.len}))},a._trySkipBufferHole=function(p){var l=this.config,o=this.hls,u=this.media;if(u===null)return 0;for(var c=u.currentTime,_=0,y=P.BufferHelper.getBuffered(u),f=0;f<y.length;f++){var C=y.start(f);if(c+l.maxBufferHole>=_&&c<C){var L=Math.max(C+t,u.currentTime+n);return e.logger.warn("skipping hole, adjusting currentTime from "+c+" to "+L),this.moved=!0,this.stalled=null,u.currentTime=L,p&&o.trigger(b.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_SEEK_OVER_HOLE,fatal:!1,reason:"fragment loaded with buffer holes, seeking from "+c+" to "+L,frag:p}),L}_=y.end(f)}return 0},a._tryNudgeBuffer=function(){var p=this.config,l=this.hls,o=this.media,u=this.nudgeRetry;if(o!==null){var c=o.currentTime;if(this.nudgeRetry++,u<p.nudgeMaxRetry){var _=c+(u+1)*p.nudgeOffset;e.logger.warn("Nudging 'currentTime' from "+c+" to "+_),o.currentTime=_,l.trigger(b.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_NUDGE_ON_STALL,fatal:!1})}else e.logger.error("Playhead still not moving while enough data buffered @"+c+" after "+p.nudgeMaxRetry+" nudges"),l.trigger(b.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.BUFFER_STALLED_ERROR,fatal:!0})}},i}()},"./src/controller/id3-track-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>p});var P=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),b=S("./src/utils/texttrack-utils.ts"),e=S("./src/demux/id3.ts"),E=S("./src/loader/date-range.ts"),s=S("./src/types/demuxer.ts"),n=.25;function t(){return self.WebKitDataCue||self.VTTCue||self.TextTrackCue}var r=function(){var l=t();try{new l(0,Number.POSITIVE_INFINITY,"")}catch(o){return Number.MAX_VALUE}return Number.POSITIVE_INFINITY}();function i(l,o){return l.getTime()/1e3-o}function a(l){return Uint8Array.from(l.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}var v=function(){function l(u){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=u,this._registerListeners()}var o=l.prototype;return o.destroy=function(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=null},o._registerListeners=function(){var c=this.hls;c.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(T.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),c.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},o._unregisterListeners=function(){var c=this.hls;c.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),c.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.off(T.Events.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),c.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),c.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this)},o.onMediaAttached=function(c,_){this.media=_.media},o.onMediaDetaching=function(){this.id3Track&&((0,b.clearCurrentCues)(this.id3Track),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={})},o.onManifestLoading=function(){this.dateRangeCuesAppended={}},o.createTrack=function(c){var _=this.getID3Track(c.textTracks);return _.mode="hidden",_},o.getID3Track=function(c){if(this.media){for(var _=0;_<c.length;_++){var y=c[_];if(y.kind==="metadata"&&y.label==="id3")return(0,b.sendAddTrackEvent)(y,this.media),y}return this.media.addTextTrack("metadata","id3")}},o.onFragParsingMetadata=function(c,_){if(this.media){var y=this.hls.config,f=y.enableEmsgMetadataCues,C=y.enableID3MetadataCues;if(!(!f&&!C)){var L=_.samples;this.id3Track||(this.id3Track=this.createTrack(this.media));for(var R=t(),O=0;O<L.length;O++){var g=L[O].type;if(!(g===s.MetadataSchema.emsg&&!f||!C)){var m=e.getID3Frames(L[O].data);if(m){var d=L[O].pts,h=d+L[O].duration;h>r&&(h=r);var A=h-d;A<=0&&(h=d+n);for(var w=0;w<m.length;w++){var x=m[w];if(!e.isTimeStampFrame(x)){this.updateId3CueEnds(d);var D=new R(d,h,"");D.value=x,g&&(D.type=g),this.id3Track.addCue(D)}}}}}}}},o.updateId3CueEnds=function(c){var _,y=(_=this.id3Track)===null||_===void 0?void 0:_.cues;if(y)for(var f=y.length;f--;){var C=y[f];C.startTime<c&&C.endTime===r&&(C.endTime=c)}},o.onBufferFlushing=function(c,_){var y=_.startOffset,f=_.endOffset,C=_.type,L=this.id3Track,R=this.hls;if(R){var O=R.config,g=O.enableEmsgMetadataCues,m=O.enableID3MetadataCues;if(L&&(g||m)){var d;C==="audio"?d=function(A){return A.type===s.MetadataSchema.audioId3&&m}:C==="video"?d=function(A){return A.type===s.MetadataSchema.emsg&&g}:d=function(A){return A.type===s.MetadataSchema.audioId3&&m||A.type===s.MetadataSchema.emsg&&g},(0,b.removeCuesInRange)(L,y,f,d)}}},o.onLevelUpdated=function(c,_){var y=this,f=_.details;if(!(!this.media||!f.hasProgramDateTime||!this.hls.config.enableDateRangeMetadataCues)){var C=this.dateRangeCuesAppended,L=this.id3Track,R=f.dateRanges,O=Object.keys(R);if(L)for(var g=Object.keys(C).filter(function(I){return!O.includes(I)}),m=function(F){var K=g[F];Object.keys(C[K].cues).forEach(function(W){L.removeCue(C[K].cues[W])}),delete C[K]},d=g.length;d--;)m(d);var h=f.fragments[f.fragments.length-1];if(!(O.length===0||!(0,P.isFiniteNumber)(h==null?void 0:h.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(var A=h.programDateTime/1e3-h.start,w=t(),x=function(F){var K=O[F],W=R[K],z=C[K],j=(z==null?void 0:z.cues)||{},G=(z==null?void 0:z.durationKnown)||!1,Z=i(W.startDate,A),Q=r,ue=W.endDate;if(ue)Q=i(ue,A),G=!0;else if(W.endOnNext&&!G){var ee=O.reduce(function(he,Se){var Te=R[Se];return Te.class===W.class&&Te.id!==Se&&Te.startDate>W.startDate&&he.push(Te),he},[]).sort(function(he,Se){return he.startDate.getTime()-Se.startDate.getTime()})[0];ee&&(Q=i(ee.startDate,A),G=!0)}for(var ae=Object.keys(W.attr),_e=0;_e<ae.length;_e++){var xe=ae[_e];if(!(xe===E.DateRangeAttribute.ID||xe===E.DateRangeAttribute.CLASS||xe===E.DateRangeAttribute.START_DATE||xe===E.DateRangeAttribute.DURATION||xe===E.DateRangeAttribute.END_DATE||xe===E.DateRangeAttribute.END_ON_NEXT)){var ge=j[xe];if(ge)G&&!z.durationKnown&&(ge.endTime=Q);else{var ce=W.attr[xe];ge=new w(Z,Q,""),(xe===E.DateRangeAttribute.SCTE35_OUT||xe===E.DateRangeAttribute.SCTE35_IN)&&(ce=a(ce)),ge.value={key:xe,data:ce},ge.type=s.MetadataSchema.dateRange,y.id3Track.addCue(ge),j[xe]=ge}}}C[K]={cues:j,dateRange:W,durationKnown:G}},D=0;D<O.length;D++)x(D)}}},l}();const p=v},"./src/controller/latency-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>t});var P=S("./src/errors.ts"),T=S("./src/events.ts"),b=S("./src/utils/logger.ts");function e(r,i){for(var a=0;a<i.length;a++){var v=i[a];v.enumerable=v.enumerable||!1,v.configurable=!0,"value"in v&&(v.writable=!0),Object.defineProperty(r,s(v.key),v)}}function E(r,i,a){return i&&e(r.prototype,i),a&&e(r,a),Object.defineProperty(r,"prototype",{writable:!1}),r}function s(r){var i=n(r,"string");return typeof i=="symbol"?i:String(i)}function n(r,i){if(typeof r!="object"||r===null)return r;var a=r[Symbol.toPrimitive];if(a!==void 0){var v=a.call(r,i||"default");if(typeof v!="object")return v;throw new TypeError("@@toPrimitive must return a primitive value.")}return(i==="string"?String:Number)(r)}var t=function(){function r(a){var v=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 v.timeupdate()},this.hls=a,this.config=a.config,this.registerListeners()}var i=r.prototype;return i.destroy=function(){this.unregisterListeners(),this.onMediaDetaching(),this.levelDetails=null,this.hls=this.timeupdateHandler=null},i.registerListeners=function(){this.hls.on(T.Events.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),this.hls.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(T.Events.LEVEL_UPDATED,this.onLevelUpdated,this),this.hls.on(T.Events.ERROR,this.onError,this)},i.unregisterListeners=function(){this.hls.off(T.Events.MEDIA_ATTACHED,this.onMediaAttached),this.hls.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching),this.hls.off(T.Events.MANIFEST_LOADING,this.onManifestLoading),this.hls.off(T.Events.LEVEL_UPDATED,this.onLevelUpdated),this.hls.off(T.Events.ERROR,this.onError)},i.onMediaAttached=function(v,p){this.media=p.media,this.media.addEventListener("timeupdate",this.timeupdateHandler)},i.onMediaDetaching=function(){this.media&&(this.media.removeEventListener("timeupdate",this.timeupdateHandler),this.media=null)},i.onManifestLoading=function(){this.levelDetails=null,this._latency=null,this.stallCount=0},i.onLevelUpdated=function(v,p){var l=p.details;this.levelDetails=l,l.advanced&&this.timeupdate(),!l.live&&this.media&&this.media.removeEventListener("timeupdate",this.timeupdateHandler)},i.onError=function(v,p){p.details===P.ErrorDetails.BUFFER_STALLED_ERROR&&(this.stallCount++,b.logger.warn("[playback-rate-controller]: Stall detected, adjusting target latency"))},i.timeupdate=function(){var v=this.media,p=this.levelDetails;if(!(!v||!p)){this.currentTime=v.currentTime;var l=this.computeLatency();if(l!==null){this._latency=l;var o=this.config,u=o.lowLatencyMode,c=o.maxLiveSyncPlaybackRate;if(!(!u||c===1)){var _=this.targetLatency;if(_!==null){var y=l-_,f=Math.min(this.maxLatency,_+p.targetduration),C=y<f;if(p.live&&C&&y>.05&&this.forwardBufferLength>1){var L=Math.min(2,Math.max(1,c)),R=Math.round(2/(1+Math.exp(-.75*y-this.edgeStalled))*20)/20;v.playbackRate=Math.min(L,Math.max(1,R))}else v.playbackRate!==1&&v.playbackRate!==0&&(v.playbackRate=1)}}}}},i.estimateLiveEdge=function(){var v=this.levelDetails;return v===null?null:v.edge+v.age},i.computeLatency=function(){var v=this.estimateLiveEdge();return v===null?null:v-this.currentTime},E(r,[{key:"latency",get:function(){return this._latency||0}},{key:"maxLatency",get:function(){var v=this.config,p=this.levelDetails;return v.liveMaxLatencyDuration!==void 0?v.liveMaxLatencyDuration:p?v.liveMaxLatencyDurationCount*p.targetduration:0}},{key:"targetLatency",get:function(){var v=this.levelDetails;if(v===null)return null;var p=v.holdBack,l=v.partHoldBack,o=v.targetduration,u=this.config,c=u.liveSyncDuration,_=u.liveSyncDurationCount,y=u.lowLatencyMode,f=this.hls.userConfig,C=y&&l||p;(f.liveSyncDuration||f.liveSyncDurationCount||C===0)&&(C=c!==void 0?c:_*o);var L=o,R=1;return C+Math.min(this.stallCount*R,L)}},{key:"liveSyncPosition",get:function(){var v=this.estimateLiveEdge(),p=this.targetLatency,l=this.levelDetails;if(v===null||p===null||l===null)return null;var o=l.edge,u=v-p-this.edgeStalled,c=o-l.totalduration,_=o-(this.config.lowLatencyMode&&l.partTarget||l.targetduration);return Math.min(Math.max(c,u),_)}},{key:"drift",get:function(){var v=this.levelDetails;return v===null?1:v.drift}},{key:"edgeStalled",get:function(){var v=this.levelDetails;if(v===null)return 0;var p=(this.config.lowLatencyMode&&v.partTarget||v.targetduration)*3;return Math.max(v.age-p,0)}},{key:"forwardBufferLength",get:function(){var v=this.media,p=this.levelDetails;if(!v||!p)return 0;var l=v.buffered.length;return(l?v.buffered.end(l-1):p.edge)-this.currentTime}}]),r}()},"./src/controller/level-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>u});var P=S("./src/types/level.ts"),T=S("./src/events.ts"),b=S("./src/errors.ts"),e=S("./src/utils/codecs.ts"),E=S("./src/controller/level-helper.ts"),s=S("./src/controller/base-playlist-controller.ts"),n=S("./src/types/loader.ts");function t(){return t=Object.assign?Object.assign.bind():function(c){for(var _=1;_<arguments.length;_++){var y=arguments[_];for(var f in y)Object.prototype.hasOwnProperty.call(y,f)&&(c[f]=y[f])}return c},t.apply(this,arguments)}function r(c,_){for(var y=0;y<_.length;y++){var f=_[y];f.enumerable=f.enumerable||!1,f.configurable=!0,"value"in f&&(f.writable=!0),Object.defineProperty(c,a(f.key),f)}}function i(c,_,y){return _&&r(c.prototype,_),y&&r(c,y),Object.defineProperty(c,"prototype",{writable:!1}),c}function a(c){var _=v(c,"string");return typeof _=="symbol"?_:String(_)}function v(c,_){if(typeof c!="object"||c===null)return c;var y=c[Symbol.toPrimitive];if(y!==void 0){var f=y.call(c,_||"default");if(typeof f!="object")return f;throw new TypeError("@@toPrimitive must return a primitive value.")}return(_==="string"?String:Number)(c)}function p(c,_){c.prototype=Object.create(_.prototype),c.prototype.constructor=c,l(c,_)}function l(c,_){return l=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(f,C){return f.__proto__=C,f},l(c,_)}var o=/chrome|firefox/.test(navigator.userAgent.toLowerCase()),u=function(c){p(_,c);function _(f){var C;return C=c.call(this,f,"[level-controller]")||this,C._levels=[],C._firstLevel=-1,C._startLevel=void 0,C.currentLevelIndex=-1,C.manualLevelIndex=-1,C.onParsedComplete=void 0,C._registerListeners(),C}var y=_.prototype;return y._registerListeners=function(){var C=this.hls;C.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.on(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.on(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),C.on(T.Events.ERROR,this.onError,this)},y._unregisterListeners=function(){var C=this.hls;C.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),C.off(T.Events.LEVEL_LOADED,this.onLevelLoaded,this),C.off(T.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),C.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),C.off(T.Events.ERROR,this.onError,this)},y.destroy=function(){this._unregisterListeners(),this.manualLevelIndex=-1,this._levels.length=0,c.prototype.destroy.call(this)},y.startLoad=function(){var C=this._levels;C.forEach(function(L){L.loadError=0}),c.prototype.startLoad.call(this)},y.onManifestLoaded=function(C,L){var R=[],O=[],g=[],m,d={},h,A=!1,w=!1,x=!1;if(L.levels.forEach(function(K){var W=K.attrs;A=A||!!(K.width&&K.height),w=w||!!K.videoCodec,x=x||!!K.audioCodec,o&&K.audioCodec&&K.audioCodec.indexOf("mp4a.40.34")!==-1&&(K.audioCodec=void 0);var z=K.bitrate+"-"+K.attrs.RESOLUTION+"-"+K.attrs.CODECS;h=d[z],h?h.url.push(K.url):(h=new P.Level(K),d[z]=h,R.push(h)),W&&(W.AUDIO&&(0,E.addGroupId)(h,"audio",W.AUDIO),W.SUBTITLES&&(0,E.addGroupId)(h,"text",W.SUBTITLES))}),(A||w)&&x&&(R=R.filter(function(K){var W=K.videoCodec,z=K.width,j=K.height;return!!W||!!(z&&j)})),R=R.filter(function(K){var W=K.audioCodec,z=K.videoCodec;return(!W||(0,e.isCodecSupportedInMp4)(W,"audio"))&&(!z||(0,e.isCodecSupportedInMp4)(z,"video"))}),L.audioTracks&&(O=L.audioTracks.filter(function(K){return!K.audioCodec||(0,e.isCodecSupportedInMp4)(K.audioCodec,"audio")}),(0,E.assignTrackIdsByGroup)(O)),L.subtitles&&(g=L.subtitles,(0,E.assignTrackIdsByGroup)(g)),R.length>0){m=R[0].bitrate,R.sort(function(K,W){return K.attrs["HDCP-LEVEL"]!==W.attrs["HDCP-LEVEL"]?(K.attrs["HDCP-LEVEL"]||"")>(W.attrs["HDCP-LEVEL"]||"")?1:-1:K.bitrate!==W.bitrate?K.bitrate-W.bitrate:K.attrs.SCORE!==W.attrs.SCORE?K.attrs.decimalFloatingPoint("SCORE")-W.attrs.decimalFloatingPoint("SCORE"):A&&K.height!==W.height?K.height-W.height:0}),this._levels=R;for(var D=0;D<R.length;D++)if(R[D].bitrate===m){this._firstLevel=D,this.log("manifest loaded, "+R.length+" level(s) found, first bitrate: "+m);break}var I=x&&!w,F={levels:R,audioTracks:O,subtitleTracks:g,sessionData:L.sessionData,sessionKeys:L.sessionKeys,firstLevel:this._firstLevel,stats:L.stats,audio:x,video:w,altAudio:!I&&O.some(function(K){return!!K.url})};this.hls.trigger(T.Events.MANIFEST_PARSED,F),(this.hls.config.autoStartLoad||this.hls.forceStartLoad)&&this.hls.startLoad(this.hls.config.startPosition)}else this.hls.trigger(T.Events.ERROR,{type:b.ErrorTypes.MEDIA_ERROR,details:b.ErrorDetails.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:L.url,reason:"no level with compatible codecs found in manifest"})},y.onError=function(C,L){var R,O;if(c.prototype.onError.call(this,C,L),!L.fatal){var g=L.context,m=this._levels[this.currentLevelIndex];if(g&&(g.type===n.PlaylistContextType.AUDIO_TRACK&&m.audioGroupIds&&g.groupId===m.audioGroupIds[m.urlId]||g.type===n.PlaylistContextType.SUBTITLE_TRACK&&m.textGroupIds&&g.groupId===m.textGroupIds[m.urlId])){this.redundantFailover(this.currentLevelIndex);return}var d=!1,h=!0,A;switch(L.details){case b.ErrorDetails.FRAG_LOAD_ERROR:case b.ErrorDetails.FRAG_LOAD_TIMEOUT:case b.ErrorDetails.KEY_LOAD_ERROR:case b.ErrorDetails.KEY_LOAD_TIMEOUT:if(L.frag){var w=L.frag.type===n.PlaylistLevelType.MAIN?L.frag.level:this.currentLevelIndex,x=this._levels[w];x?(x.fragmentError++,x.fragmentError>this.hls.config.fragLoadingMaxRetry&&(A=w)):A=w}break;case b.ErrorDetails.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:{var D=m.attrs["HDCP-LEVEL"];D&&(this.hls.maxHdcpLevel=P.HdcpLevels[P.HdcpLevels.indexOf(D)-1],this.warn('Restricting playback to HDCP-LEVEL of "'+this.hls.maxHdcpLevel+'" or lower'))}case b.ErrorDetails.FRAG_PARSING_ERROR:case b.ErrorDetails.KEY_SYSTEM_NO_SESSION:A=((R=L.frag)===null||R===void 0?void 0:R.type)===n.PlaylistLevelType.MAIN?L.frag.level:this.currentLevelIndex,L.levelRetry=!1;break;case b.ErrorDetails.LEVEL_LOAD_ERROR:case b.ErrorDetails.LEVEL_LOAD_TIMEOUT:g&&(g.deliveryDirectives&&(h=!1),A=g.level),d=!0;break;case b.ErrorDetails.REMUX_ALLOC_ERROR:A=(O=L.level)!=null?O:this.currentLevelIndex,d=!0;break}A!==void 0&&this.recoverLevel(L,A,d,h)}},y.recoverLevel=function(C,L,R,O){var g=C.details,m=this._levels[L];if(m.loadError++,R){var d=this.retryLoadingOrFail(C);if(d)C.levelRetry=!0;else{this.currentLevelIndex=-1;return}}if(O){var h=m.url.length;if(h>1&&m.loadError<h)C.levelRetry=!0,this.redundantFailover(L);else if(this.manualLevelIndex===-1){for(var A=-1,w=this._levels,x=w.length;x--;){var D=(x+this.currentLevelIndex)%w.length;if(D!==this.currentLevelIndex&&w[D].loadError===0){A=D;break}}A>-1&&this.currentLevelIndex!==A?(this.warn(g+": switch to "+A),C.levelRetry=!0,this.hls.nextAutoLevel=A):C.levelRetry===!1&&(C.fatal=!0)}}},y.redundantFailover=function(C){var L=this._levels[C],R=L.url.length;if(R>1){var O=(L.urlId+1)%R;this.warn("Switching to redundant URL-id "+O),this._levels.forEach(function(g){g.urlId=O}),this.level=C}},y.onFragLoaded=function(C,L){var R=L.frag;if(R!==void 0&&R.type===n.PlaylistLevelType.MAIN){var O=this._levels[R.level];O!==void 0&&(O.fragmentError=0,O.loadError=0)}},y.onLevelLoaded=function(C,L){var R,O=L.level,g=L.details,m=this._levels[O];if(!m){var d;this.warn("Invalid level index "+O),(d=L.deliveryDirectives)!==null&&d!==void 0&&d.skip&&(g.deltaUpdateFailed=!0);return}O===this.currentLevelIndex?(m.fragmentError===0&&(m.loadError=0,this.retryCount=0),this.playlistLoaded(O,L,m.details)):(R=L.deliveryDirectives)!==null&&R!==void 0&&R.skip&&(g.deltaUpdateFailed=!0)},y.onAudioTrackSwitched=function(C,L){var R=this.hls.levels[this.currentLevelIndex];if(R&&R.audioGroupIds){for(var O=-1,g=this.hls.audioTracks[L.id].groupId,m=0;m<R.audioGroupIds.length;m++)if(R.audioGroupIds[m]===g){O=m;break}O!==R.urlId&&(R.urlId=O,this.startLoad())}},y.loadPlaylist=function(C){c.prototype.loadPlaylist.call(this);var L=this.currentLevelIndex,R=this._levels[L];if(this.canLoad&&R&&R.url.length>0){var O=R.urlId,g=R.url[O];if(C)try{g=C.addDirectives(g)}catch(m){this.warn("Could not construct new URL with HLS Delivery Directives: "+m)}this.log("Attempt loading level index "+L+((C==null?void 0:C.msn)!==void 0?" at sn "+C.msn+" part "+C.part:"")+" with URL-id "+O+" "+g),this.clearTimer(),this.hls.trigger(T.Events.LEVEL_LOADING,{url:g,level:L,id:O,deliveryDirectives:C||null})}},y.removeLevel=function(C,L){var R=function(m,d){return d!==L},O=this._levels.filter(function(g,m){return m!==C?!0:g.url.length>1&&L!==void 0?(g.url=g.url.filter(R),g.audioGroupIds&&(g.audioGroupIds=g.audioGroupIds.filter(R)),g.textGroupIds&&(g.textGroupIds=g.textGroupIds.filter(R)),g.urlId=0,!0):!1}).map(function(g,m){var d=g.details;return d!=null&&d.fragments&&d.fragments.forEach(function(h){h.level=m}),g});this._levels=O,this.hls.trigger(T.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(C){var L,R=this._levels;if(R.length!==0&&!(this.currentLevelIndex===C&&(L=R[C])!==null&&L!==void 0&&L.details)){if(C<0||C>=R.length){var O=C<0;if(this.hls.trigger(T.Events.ERROR,{type:b.ErrorTypes.OTHER_ERROR,details:b.ErrorDetails.LEVEL_SWITCH_ERROR,level:C,fatal:O,reason:"invalid level idx"}),O)return;C=Math.min(C,R.length-1)}this.clearTimer();var g=this.currentLevelIndex,m=R[g],d=R[C];this.log("switching to level "+C+" from "+g),this.currentLevelIndex=C;var h=t({},d,{level:C,maxBitrate:d.maxBitrate,uri:d.uri,urlId:d.urlId});delete h._urlId,this.hls.trigger(T.Events.LEVEL_SWITCHING,h);var A=d.details;if(!A||A.live){var w=this.switchParams(d.uri,m==null?void 0:m.details);this.loadPlaylist(w)}}}},{key:"manualLevel",get:function(){return this.manualLevelIndex},set:function(C){this.manualLevelIndex=C,this._startLevel===void 0&&(this._startLevel=C),C!==-1&&(this.level=C)}},{key:"firstLevel",get:function(){return this._firstLevel},set:function(C){this._firstLevel=C}},{key:"startLevel",get:function(){if(this._startLevel===void 0){var C=this.hls.config.startLevel;return C!==void 0?C:this._firstLevel}else return this._startLevel},set:function(C){this._startLevel=C}},{key:"nextLoadLevel",get:function(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel},set:function(C){this.level=C,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=C)}}]),_}(s.default)},"./src/controller/level-helper.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{addGroupId:()=>E,addSliding:()=>o,adjustSliding:()=>l,assignTrackIdsByGroup:()=>s,computeReloadInterval:()=>u,getFragmentWithSN:()=>c,getPartWith:()=>_,mapFragmentIntersection:()=>p,mapPartIntersection:()=>v,mergeDetails:()=>i,updateFragPTSDTS:()=>r,updatePTS:()=>n});var P=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts"),b=S("./src/loader/date-range.ts");function e(){return e=Object.assign?Object.assign.bind():function(y){for(var f=1;f<arguments.length;f++){var C=arguments[f];for(var L in C)Object.prototype.hasOwnProperty.call(C,L)&&(y[L]=C[L])}return y},e.apply(this,arguments)}function E(y,f,C){switch(f){case"audio":y.audioGroupIds||(y.audioGroupIds=[]),y.audioGroupIds.push(C);break;case"text":y.textGroupIds||(y.textGroupIds=[]),y.textGroupIds.push(C);break}}function s(y){var f={};y.forEach(function(C){var L=C.groupId||"";C.id=f[L]=f[L]||0,f[L]++})}function n(y,f,C){var L=y[f],R=y[C];t(L,R)}function t(y,f){var C=f.startPTS;if((0,P.isFiniteNumber)(C)){var L=0,R;f.sn>y.sn?(L=C-y.start,R=y):(L=y.start-C,R=f),R.duration!==L&&(R.duration=L)}else if(f.sn>y.sn){var O=y.cc===f.cc;O&&y.minEndPTS?f.start=y.start+(y.minEndPTS-y.start):f.start=y.start+y.duration}else f.start=Math.max(y.start-f.duration,0)}function r(y,f,C,L,R,O){var g=L-C;g<=0&&(T.logger.warn("Fragment should have a positive duration",f),L=C+f.duration,O=R+f.duration);var m=C,d=L,h=f.startPTS,A=f.endPTS;if((0,P.isFiniteNumber)(h)){var w=Math.abs(h-C);(0,P.isFiniteNumber)(f.deltaPTS)?f.deltaPTS=Math.max(w,f.deltaPTS):f.deltaPTS=w,m=Math.max(C,h),C=Math.min(C,h),R=Math.min(R,f.startDTS),d=Math.min(L,A),L=Math.max(L,A),O=Math.max(O,f.endDTS)}f.duration=L-C;var x=C-f.start;f.start=f.startPTS=C,f.maxStartPTS=m,f.startDTS=R,f.endPTS=L,f.minEndPTS=d,f.endDTS=O;var D=f.sn;if(!y||D<y.startSN||D>y.endSN)return 0;var I,F=D-y.startSN,K=y.fragments;for(K[F]=f,I=F;I>0;I--)t(K[I],K[I-1]);for(I=F;I<K.length-1;I++)t(K[I],K[I+1]);return y.fragmentHint&&t(K[K.length-1],y.fragmentHint),y.PTSKnown=y.alignedSliding=!0,x}function i(y,f){for(var C=null,L=y.fragments,R=L.length-1;R>=0;R--){var O=L[R].initSegment;if(O){C=O;break}}y.fragmentHint&&delete y.fragmentHint.endPTS;var g=0,m;if(p(y,f,function(I,F){I.relurl&&(g=I.cc-F.cc),(0,P.isFiniteNumber)(I.startPTS)&&(0,P.isFiniteNumber)(I.endPTS)&&(F.start=F.startPTS=I.startPTS,F.startDTS=I.startDTS,F.appendedPTS=I.appendedPTS,F.maxStartPTS=I.maxStartPTS,F.endPTS=I.endPTS,F.endDTS=I.endDTS,F.minEndPTS=I.minEndPTS,F.duration=I.endPTS-I.startPTS,F.duration&&(m=F),f.PTSKnown=f.alignedSliding=!0),F.elementaryStreams=I.elementaryStreams,F.loader=I.loader,F.stats=I.stats,F.urlId=I.urlId,I.initSegment&&(F.initSegment=I.initSegment,C=I.initSegment)}),C){var d=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments;d.forEach(function(I){var F;(!I.initSegment||I.initSegment.relurl===((F=C)===null||F===void 0?void 0:F.relurl))&&(I.initSegment=C)})}if(f.skippedSegments)if(f.deltaUpdateFailed=f.fragments.some(function(I){return!I}),f.deltaUpdateFailed){T.logger.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(var h=f.skippedSegments;h--;)f.fragments.shift();f.startSN=f.fragments[0].sn,f.startCC=f.fragments[0].cc}else f.canSkipDateRanges&&(f.dateRanges=a(y.dateRanges,f.dateRanges,f.recentlyRemovedDateranges));var A=f.fragments;if(g){T.logger.warn("discontinuity sliding from playlist, take drift into account");for(var w=0;w<A.length;w++)A[w].cc+=g}f.skippedSegments&&(f.startCC=f.fragments[0].cc),v(y.partList,f.partList,function(I,F){F.elementaryStreams=I.elementaryStreams,F.stats=I.stats}),m?r(f,m,m.startPTS,m.endPTS,m.startDTS,m.endDTS):l(y,f),A.length&&(f.totalduration=f.edge-A[0].start),f.driftStartTime=y.driftStartTime,f.driftStart=y.driftStart;var x=f.advancedDateTime;if(f.advanced&&x){var D=f.edge;f.driftStart||(f.driftStartTime=x,f.driftStart=D),f.driftEndTime=x,f.driftEnd=D}else f.driftEndTime=y.driftEndTime,f.driftEnd=y.driftEnd,f.advancedDateTime=y.advancedDateTime}function a(y,f,C){var L=e({},y);return C&&C.forEach(function(R){delete L[R]}),Object.keys(f).forEach(function(R){var O=new b.DateRange(f[R].attr,L[R]);O.isValid?L[R]=O:T.logger.warn('Ignoring invalid Playlist Delta Update DATERANGE tag: "'+JSON.stringify(f[R].attr)+'"')}),L}function v(y,f,C){if(y&&f)for(var L=0,R=0,O=y.length;R<=O;R++){var g=y[R],m=f[R+L];g&&m&&g.index===m.index&&g.fragment.sn===m.fragment.sn?C(g,m):L--}}function p(y,f,C){for(var L=f.skippedSegments,R=Math.max(y.startSN,f.startSN)-f.startSN,O=(y.fragmentHint?1:0)+(L?f.endSN:Math.min(y.endSN,f.endSN))-f.startSN,g=f.startSN-y.startSN,m=f.fragmentHint?f.fragments.concat(f.fragmentHint):f.fragments,d=y.fragmentHint?y.fragments.concat(y.fragmentHint):y.fragments,h=R;h<=O;h++){var A=d[g+h],w=m[h];L&&!w&&h<L&&(w=f.fragments[h]=A),A&&w&&C(A,w)}}function l(y,f){var C=f.startSN+f.skippedSegments-y.startSN,L=y.fragments;C<0||C>=L.length||o(f,L[C].start)}function o(y,f){if(f){for(var C=y.fragments,L=y.skippedSegments;L<C.length;L++)C[L].start+=f;y.fragmentHint&&(y.fragmentHint.start+=f)}}function u(y,f){f===void 0&&(f=1/0);var C=1e3*y.targetduration;if(y.updated){var L=y.fragments,R=4;if(L.length&&C*R>f){var O=L[L.length-1].duration*1e3;O<C&&(C=O)}}else C/=2;return Math.round(C)}function c(y,f,C){if(!y||!y.details)return null;var L=y.details,R=L.fragments[f-L.startSN];return R||(R=L.fragmentHint,R&&R.sn===f)?R:f<L.startSN&&C&&C.sn===f?C:null}function _(y,f,C){if(!y||!y.details)return null;var L=y.details.partList;if(L)for(var R=L.length;R--;){var O=L[R];if(O.index===C&&O.fragment.sn===f)return O}return null}},"./src/controller/stream-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>f});var P=S("./src/polyfills/number.ts"),T=S("./src/controller/base-stream-controller.ts"),b=S("./src/is-supported.ts"),e=S("./src/events.ts"),E=S("./src/utils/buffer-helper.ts"),s=S("./src/controller/fragment-tracker.ts"),n=S("./src/types/loader.ts"),t=S("./src/loader/fragment.ts"),r=S("./src/demux/transmuxer-interface.ts"),i=S("./src/types/transmuxer.ts"),a=S("./src/controller/gap-controller.ts"),v=S("./src/errors.ts");function p(C,L){for(var R=0;R<L.length;R++){var O=L[R];O.enumerable=O.enumerable||!1,O.configurable=!0,"value"in O&&(O.writable=!0),Object.defineProperty(C,o(O.key),O)}}function l(C,L,R){return L&&p(C.prototype,L),R&&p(C,R),Object.defineProperty(C,"prototype",{writable:!1}),C}function o(C){var L=u(C,"string");return typeof L=="symbol"?L:String(L)}function u(C,L){if(typeof C!="object"||C===null)return C;var R=C[Symbol.toPrimitive];if(R!==void 0){var O=R.call(C,L||"default");if(typeof O!="object")return O;throw new TypeError("@@toPrimitive must return a primitive value.")}return(L==="string"?String:Number)(C)}function c(C,L){C.prototype=Object.create(L.prototype),C.prototype.constructor=C,_(C,L)}function _(C,L){return _=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(O,g){return O.__proto__=g,O},_(C,L)}var y=100,f=function(C){c(L,C);function L(O,g,m){var d;return d=C.call(this,O,g,m,"[stream-controller]")||this,d.audioCodecSwap=!1,d.gapController=null,d.level=-1,d._forceStartLoad=!1,d.altAudio=!1,d.audioOnly=!1,d.fragPlaying=null,d.onvplaying=null,d.onvseeked=null,d.fragLastKbps=0,d.couldBacktrack=!1,d.backtrackFragment=null,d.audioCodecSwitch=!1,d.videoBuffer=null,d._registerListeners(),d}var R=L.prototype;return R._registerListeners=function(){var g=this.hls;g.on(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.on(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.on(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.on(e.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.on(e.Events.LEVEL_LOADING,this.onLevelLoading,this),g.on(e.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.on(e.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),g.on(e.Events.ERROR,this.onError,this),g.on(e.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.on(e.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.on(e.Events.BUFFER_CREATED,this.onBufferCreated,this),g.on(e.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.on(e.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),g.on(e.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R._unregisterListeners=function(){var g=this.hls;g.off(e.Events.MEDIA_ATTACHED,this.onMediaAttached,this),g.off(e.Events.MEDIA_DETACHING,this.onMediaDetaching,this),g.off(e.Events.MANIFEST_LOADING,this.onManifestLoading,this),g.off(e.Events.MANIFEST_PARSED,this.onManifestParsed,this),g.off(e.Events.LEVEL_LOADED,this.onLevelLoaded,this),g.off(e.Events.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),g.off(e.Events.ERROR,this.onError,this),g.off(e.Events.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),g.off(e.Events.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),g.off(e.Events.BUFFER_CREATED,this.onBufferCreated,this),g.off(e.Events.BUFFER_FLUSHED,this.onBufferFlushed,this),g.off(e.Events.LEVELS_UPDATED,this.onLevelsUpdated,this),g.off(e.Events.FRAG_BUFFERED,this.onFragBuffered,this)},R.onHandlerDestroying=function(){this._unregisterListeners(),this.onMediaDetaching()},R.startLoad=function(g){if(this.levels){var m=this.lastCurrentTime,d=this.hls;if(this.stopLoad(),this.setInterval(y),this.level=-1,this.fragLoadError=0,!this.startFragRequested){var h=d.startLevel;h===-1&&(d.config.testBandwidth&&this.levels.length>1?(h=0,this.bitrateTest=!0):h=d.nextAutoLevel),this.level=d.nextLoadLevel=h,this.loadedmetadata=!1}m>0&&g===-1&&(this.log("Override startPosition with lastCurrentTime @"+m.toFixed(3)),g=m),this.state=T.State.IDLE,this.nextLoadPosition=this.startPosition=this.lastCurrentTime=g,this.tick()}else this._forceStartLoad=!0,this.state=T.State.STOPPED},R.stopLoad=function(){this._forceStartLoad=!1,C.prototype.stopLoad.call(this)},R.doTick=function(){switch(this.state){case T.State.IDLE:this.doTickIdle();break;case T.State.WAITING_LEVEL:{var g,m=this.levels,d=this.level,h=m==null||(g=m[d])===null||g===void 0?void 0:g.details;if(h&&(!h.live||this.levelLastLoaded===this.level)){if(this.waitForCdnTuneIn(h))break;this.state=T.State.IDLE;break}break}case T.State.FRAG_LOADING_WAITING_RETRY:{var A,w=self.performance.now(),x=this.retryDate;(!x||w>=x||(A=this.media)!==null&&A!==void 0&&A.seeking)&&(this.log("retryDate reached, switch back to IDLE state"),this.resetStartWhenNotLoaded(this.level),this.state=T.State.IDLE)}break;default:break}this.onTickEnd()},R.onTickEnd=function(){C.prototype.onTickEnd.call(this),this.checkBuffer(),this.checkFragmentChanged()},R.doTickIdle=function(){var g=this.hls,m=this.levelLastLoaded,d=this.levels,h=this.media,A=g.config,w=g.nextLoadLevel;if(!(m===null||!h&&(this.startFragRequested||!A.startFragPrefetch))&&!(this.altAudio&&this.audioOnly)&&!(!d||!d[w])){var x=d[w],D=this.getMainFwdBufferInfo();if(D!==null){var I=this.getLevelDetails();if(I&&this._streamEnded(D,I)){var F={};this.altAudio&&(F.type="video"),this.hls.trigger(e.Events.BUFFER_EOS,F),this.state=T.State.ENDED;return}this.level=g.nextLoadLevel=w;var K=x.details;if(!K||this.state===T.State.WAITING_LEVEL||K.live&&this.levelLastLoaded!==w){this.level=w,this.state=T.State.WAITING_LEVEL;return}var W=D.len,z=this.getMaxBufferLength(x.maxBitrate);if(!(W>=z)){this.backtrackFragment&&this.backtrackFragment.start>D.end&&(this.backtrackFragment=null);var j=this.backtrackFragment?this.backtrackFragment.start:D.end,G=this.getNextFragment(j,K);if(this.couldBacktrack&&!this.fragPrevious&&G&&G.sn!=="initSegment"&&this.fragmentTracker.getState(G)!==s.FragmentState.OK){var Z,Q=((Z=this.backtrackFragment)!=null?Z:G).sn,ue=Q-K.startSN,ee=K.fragments[ue-1];ee&&G.cc===ee.cc&&(G=ee,this.fragmentTracker.removeFragment(ee))}else this.backtrackFragment&&D.len&&(this.backtrackFragment=null);if(G&&this.fragmentTracker.getState(G)===s.FragmentState.OK&&this.nextLoadPosition>j){var ae=this.audioOnly&&!this.altAudio?t.ElementaryStreamTypes.AUDIO:t.ElementaryStreamTypes.VIDEO,_e=(ae===t.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;_e&&this.afterBufferFlushed(_e,ae,n.PlaylistLevelType.MAIN),G=this.getNextFragment(this.nextLoadPosition,K)}G&&(G.initSegment&&!G.initSegment.data&&!this.bitrateTest&&(G=G.initSegment),this.loadFragment(G,K,j))}}}},R.loadFragment=function(g,m,d){var h,A=this.fragmentTracker.getState(g);this.fragCurrent=g,A===s.FragmentState.NOT_LOADED?g.sn==="initSegment"?this._loadInitSegment(g,m):this.bitrateTest?(this.log("Fragment "+g.sn+" of level "+g.level+" is being downloaded to test bitrate and will not be buffered"),this._loadBitrateTestFrag(g,m)):(this.startFragRequested=!0,C.prototype.loadFragment.call(this,g,m,d)):A===s.FragmentState.APPENDING?this.reduceMaxBufferLength(g.duration)&&this.fragmentTracker.removeFragment(g):((h=this.media)===null||h===void 0?void 0:h.buffered.length)===0&&this.fragmentTracker.removeAllFragments()},R.getAppendedFrag=function(g){var m=this.fragmentTracker.getAppendedFrag(g,n.PlaylistLevelType.MAIN);return m&&"fragment"in m?m.fragment:m},R.getBufferedFrag=function(g){return this.fragmentTracker.getBufferedFrag(g,n.PlaylistLevelType.MAIN)},R.followingBufferedFrag=function(g){return g?this.getBufferedFrag(g.end+.5):null},R.immediateLevelSwitch=function(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)},R.nextLevelSwitch=function(){var g=this.levels,m=this.media;if(m!=null&&m.readyState){var d,h=this.getAppendedFrag(m.currentTime);if(h&&h.start>1&&this.flushMainBuffer(0,h.start-1),!m.paused&&g){var A=this.hls.nextLoadLevel,w=g[A],x=this.fragLastKbps;x&&this.fragCurrent?d=this.fragCurrent.duration*w.maxBitrate/(1e3*x)+1:d=0}else d=0;var D=this.getBufferedFrag(m.currentTime+d);if(D){var I=this.followingBufferedFrag(D);if(I){this.abortCurrentFrag();var F=I.maxStartPTS?I.maxStartPTS:I.start,K=I.duration,W=Math.max(D.end,F+Math.min(Math.max(K-this.config.maxFragLookUpTolerance,K*.5),K*.75));this.flushMainBuffer(W,Number.POSITIVE_INFINITY)}}}},R.abortCurrentFrag=function(){var g=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,g&&g.abortRequests(),this.state){case T.State.KEY_LOADING:case T.State.FRAG_LOADING:case T.State.FRAG_LOADING_WAITING_RETRY:case T.State.PARSING:case T.State.PARSED:this.state=T.State.IDLE;break}this.nextLoadPosition=this.getLoadPosition()},R.flushMainBuffer=function(g,m){C.prototype.flushMainBuffer.call(this,g,m,this.altAudio?"video":null)},R.onMediaAttached=function(g,m){C.prototype.onMediaAttached.call(this,g,m);var d=m.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)},R.onMediaDetaching=function(){var g=this.media;g&&this.onvplaying&&this.onvseeked&&(g.removeEventListener("playing",this.onvplaying),g.removeEventListener("seeked",this.onvseeked),this.onvplaying=this.onvseeked=null,this.videoBuffer=null),this.fragPlaying=null,this.gapController&&(this.gapController.destroy(),this.gapController=null),C.prototype.onMediaDetaching.call(this)},R.onMediaPlaying=function(){this.tick()},R.onMediaSeeked=function(){var g=this.media,m=g?g.currentTime:null;(0,P.isFiniteNumber)(m)&&this.log("Media seeked to "+m.toFixed(3)),this.tick()},R.onManifestLoading=function(){this.log("Trigger BUFFER_RESET"),this.hls.trigger(e.Events.BUFFER_RESET,void 0),this.fragmentTracker.removeAllFragments(),this.couldBacktrack=!1,this.startPosition=this.lastCurrentTime=0,this.fragPlaying=null,this.backtrackFragment=null},R.onManifestParsed=function(g,m){var d=!1,h=!1,A;m.levels.forEach(function(w){A=w.audioCodec,A&&(A.indexOf("mp4a.40.2")!==-1&&(d=!0),A.indexOf("mp4a.40.5")!==-1&&(h=!0))}),this.audioCodecSwitch=d&&h&&!(0,b.changeTypeSupported)(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=m.levels,this.startFragRequested=!1},R.onLevelLoading=function(g,m){var d=this.levels;if(!(!d||this.state!==T.State.IDLE)){var h=d[m.level];(!h.details||h.details.live&&this.levelLastLoaded!==m.level||this.waitForCdnTuneIn(h.details))&&(this.state=T.State.WAITING_LEVEL)}},R.onLevelLoaded=function(g,m){var d,h=this.levels,A=m.level,w=m.details,x=w.totalduration;if(!h){this.warn("Levels were reset while loading level "+A);return}this.log("Level "+A+" loaded ["+w.startSN+","+w.endSN+"], cc ["+w.startCC+", "+w.endCC+"] duration:"+x);var D=this.fragCurrent;D&&(this.state===T.State.FRAG_LOADING||this.state===T.State.FRAG_LOADING_WAITING_RETRY)&&D.level!==m.level&&D.loader&&(this.state=T.State.IDLE,this.backtrackFragment=null,D.abortRequests());var I=h[A],F=0;if(w.live||(d=I.details)!==null&&d!==void 0&&d.live){if(w.fragments[0]||(w.deltaUpdateFailed=!0),w.deltaUpdateFailed)return;F=this.alignPlaylists(w,I.details)}if(I.details=w,this.levelLastLoaded=A,this.hls.trigger(e.Events.LEVEL_UPDATED,{details:w,level:A}),this.state===T.State.WAITING_LEVEL){if(this.waitForCdnTuneIn(w))return;this.state=T.State.IDLE}this.startFragRequested?w.live&&this.synchronizeToLiveEdge(w):this.setStartPosition(w,F),this.tick()},R._handleFragmentLoadProgress=function(g){var m,d=g.frag,h=g.part,A=g.payload,w=this.levels;if(!w){this.warn("Levels were reset while fragment load was in progress. Fragment "+d.sn+" of level "+d.level+" will not be buffered");return}var x=w[d.level],D=x.details;if(!D){this.warn("Dropping fragment "+d.sn+" of level "+d.level+" after level details were reset");return}var I=x.videoCodec,F=D.PTSKnown||!D.live,K=(m=d.initSegment)===null||m===void 0?void 0:m.data,W=this._getAudioCodec(x),z=this.transmuxer=this.transmuxer||new r.default(this.hls,n.PlaylistLevelType.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),j=h?h.index:-1,G=j!==-1,Z=new i.ChunkMetadata(d.level,d.sn,d.stats.chunkCount,A.byteLength,j,G),Q=this.initPTS[d.cc];z.push(A,K,W,I,d,h,D.totalduration,F,Z,Q)},R.onAudioTrackSwitching=function(g,m){var d=this.altAudio,h=!!m.url,A=m.id;if(!h){if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;var w=this.fragCurrent;w&&(this.log("Switching to main audio track, cancel main fragment load"),w.abortRequests()),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();var x=this.hls;d&&x.trigger(e.Events.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:"audio"}),x.trigger(e.Events.AUDIO_TRACK_SWITCHED,{id:A})}},R.onAudioTrackSwitched=function(g,m){var d=m.id,h=!!this.hls.audioTracks[d].url;if(h){var A=this.videoBuffer;A&&this.mediaBuffer!==A&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=A)}this.altAudio=h,this.tick()},R.onBufferCreated=function(g,m){var d=m.tracks,h,A,w=!1;for(var x in d){var D=d[x];if(D.id==="main"){if(A=x,h=D,x==="video"){var I=d[x];I&&(this.videoBuffer=I.buffer)}}else w=!0}w&&h?(this.log("Alternate track found, use "+A+".buffered to schedule main fragment loading"),this.mediaBuffer=h.buffer):this.mediaBuffer=this.media},R.onFragBuffered=function(g,m){var d=m.frag,h=m.part;if(!(d&&d.type!==n.PlaylistLevelType.MAIN)){if(this.fragContextChanged(d)){this.warn("Fragment "+d.sn+(h?" p: "+h.index:"")+" of level "+d.level+" finished buffering, but was aborted. state: "+this.state),this.state===T.State.PARSED&&(this.state=T.State.IDLE);return}var A=h?h.stats:d.stats;this.fragLastKbps=Math.round(8*A.total/(A.buffering.end-A.loading.first)),d.sn!=="initSegment"&&(this.fragPrevious=d),this.fragBufferedComplete(d,h)}},R.onError=function(g,m){if(m.type===v.ErrorTypes.KEY_SYSTEM_ERROR){this.onFragmentOrKeyLoadError(n.PlaylistLevelType.MAIN,m);return}switch(m.details){case v.ErrorDetails.FRAG_LOAD_ERROR:case v.ErrorDetails.FRAG_LOAD_TIMEOUT:case v.ErrorDetails.FRAG_PARSING_ERROR:case v.ErrorDetails.KEY_LOAD_ERROR:case v.ErrorDetails.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(n.PlaylistLevelType.MAIN,m);break;case v.ErrorDetails.LEVEL_LOAD_ERROR:case v.ErrorDetails.LEVEL_LOAD_TIMEOUT:this.state!==T.State.ERROR&&(m.fatal?(this.warn(""+m.details),this.state=T.State.ERROR):!m.levelRetry&&this.state===T.State.WAITING_LEVEL&&(this.state=T.State.IDLE));break;case v.ErrorDetails.BUFFER_FULL_ERROR:if(m.parent==="main"&&(this.state===T.State.PARSING||this.state===T.State.PARSED)){var d=!0,h=this.getFwdBufferInfo(this.media,n.PlaylistLevelType.MAIN);h&&h.len>.5&&(d=!this.reduceMaxBufferLength(h.len)),d&&(this.warn("buffer full error also media.currentTime is not buffered, flush main"),this.immediateLevelSwitch()),this.resetLoadingState()}break;default:break}},R.checkBuffer=function(){var g=this.media,m=this.gapController;if(!(!g||!m||!g.readyState)){if(this.loadedmetadata||!E.BufferHelper.getBuffered(g).length){var d=this.state!==T.State.IDLE?this.fragCurrent:null;m.poll(this.lastCurrentTime,d)}this.lastCurrentTime=g.currentTime}},R.onFragLoadEmergencyAborted=function(){this.state=T.State.IDLE,this.loadedmetadata||(this.startFragRequested=!1,this.nextLoadPosition=this.startPosition),this.tickImmediate()},R.onBufferFlushed=function(g,m){var d=m.type;if(d!==t.ElementaryStreamTypes.AUDIO||this.audioOnly&&!this.altAudio){var h=(d===t.ElementaryStreamTypes.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;this.afterBufferFlushed(h,d,n.PlaylistLevelType.MAIN)}},R.onLevelsUpdated=function(g,m){this.levels=m.levels},R.swapAudioCodec=function(){this.audioCodecSwap=!this.audioCodecSwap},R.seekToStartPos=function(){var g=this.media;if(g){var m=g.currentTime,d=this.startPosition;if(d>=0&&m<d){if(g.seeking){this.log("could not seek to "+d+", already seeking at "+m);return}var h=E.BufferHelper.getBuffered(g),A=h.length?h.start(0):0,w=A-d;w>0&&(w<this.config.maxBufferHole||w<this.config.maxFragLookUpTolerance)&&(this.log("adjusting start position by "+w+" to match buffer start"),d+=w,this.startPosition=d),this.log("seek to target start position "+d+" from current time "+m),g.currentTime=d}}},R._getAudioCodec=function(g){var m=this.config.defaultAudioCodec||g.audioCodec;return this.audioCodecSwap&&m&&(this.log("Swapping audio codec"),m.indexOf("mp4a.40.5")!==-1?m="mp4a.40.2":m="mp4a.40.5"),m},R._loadBitrateTestFrag=function(g,m){var d=this;g.bitrateTest=!0,this._doFragLoad(g,m).then(function(h){var A=d.hls;if(!(!h||d.fragContextChanged(g))){d.fragLoadError=0,d.state=T.State.IDLE,d.startFragRequested=!1,d.bitrateTest=!1;var w=g.stats;w.parsing.start=w.parsing.end=w.buffering.start=w.buffering.end=self.performance.now(),A.trigger(e.Events.FRAG_LOADED,h),g.bitrateTest=!1}})},R._handleTransmuxComplete=function(g){var m,d="main",h=this.hls,A=g.remuxResult,w=g.chunkMeta,x=this.getCurrentContext(w);if(!x){this.warn("The loading context changed while buffering fragment "+w.sn+" of level "+w.level+". This chunk will not be buffered."),this.resetStartWhenNotLoaded(w.level);return}var D=x.frag,I=x.part,F=x.level,K=A.video,W=A.text,z=A.id3,j=A.initSegment,G=F.details,Z=this.altAudio?void 0:A.audio;if(!this.fragContextChanged(D)){if(this.state=T.State.PARSING,j){j.tracks&&(this._bufferInitSegment(F,j.tracks,D,w),h.trigger(e.Events.FRAG_PARSING_INIT_SEGMENT,{frag:D,id:d,tracks:j.tracks}));var Q=j.initPTS,ue=j.timescale;(0,P.isFiniteNumber)(Q)&&(this.initPTS[D.cc]=Q,h.trigger(e.Events.INIT_PTS_FOUND,{frag:D,id:d,initPTS:Q,timescale:ue}))}if(K&&A.independent!==!1){if(G){var ee=K.startPTS,ae=K.endPTS,_e=K.startDTS,xe=K.endDTS;if(I)I.elementaryStreams[K.type]={startPTS:ee,endPTS:ae,startDTS:_e,endDTS:xe};else if(K.firstKeyFrame&&K.independent&&w.id===1&&(this.couldBacktrack=!0),K.dropped&&K.independent){var ge=this.getMainFwdBufferInfo(),ce=(ge?ge.end:this.getLoadPosition())+this.config.maxBufferHole,he=K.firstKeyFramePTS?K.firstKeyFramePTS:ee;if(ce<he-this.config.maxBufferHole){this.backtrack(D);return}D.setElementaryStreamInfo(K.type,D.start,ae,D.start,xe,!0)}D.setElementaryStreamInfo(K.type,ee,ae,_e,xe),this.backtrackFragment&&(this.backtrackFragment=D),this.bufferFragmentData(K,D,I,w)}}else if(A.independent===!1){this.backtrack(D);return}if(Z){var Se=Z.startPTS,Te=Z.endPTS,ke=Z.startDTS,X=Z.endDTS;I&&(I.elementaryStreams[t.ElementaryStreamTypes.AUDIO]={startPTS:Se,endPTS:Te,startDTS:ke,endDTS:X}),D.setElementaryStreamInfo(t.ElementaryStreamTypes.AUDIO,Se,Te,ke,X),this.bufferFragmentData(Z,D,I,w)}if(G&&z!==null&&z!==void 0&&(m=z.samples)!==null&&m!==void 0&&m.length){var te={id:d,frag:D,details:G,samples:z.samples};h.trigger(e.Events.FRAG_PARSING_METADATA,te)}if(G&&W){var pe={id:d,frag:D,details:G,samples:W.samples};h.trigger(e.Events.FRAG_PARSING_USERDATA,pe)}}},R._bufferInitSegment=function(g,m,d,h){var A=this;if(this.state===T.State.PARSING){this.audioOnly=!!m.audio&&!m.video,this.altAudio&&!this.audioOnly&&delete m.audio;var w=m.audio,x=m.video,D=m.audiovideo;if(w){var I=g.audioCodec,F=navigator.userAgent.toLowerCase();this.audioCodecSwitch&&(I&&(I.indexOf("mp4a.40.5")!==-1?I="mp4a.40.2":I="mp4a.40.5"),w.metadata.channelCount!==1&&F.indexOf("firefox")===-1&&(I="mp4a.40.5")),F.indexOf("android")!==-1&&w.container!=="audio/mpeg"&&(I="mp4a.40.2",this.log("Android: force audio codec to "+I)),g.audioCodec&&g.audioCodec!==I&&this.log('Swapping manifest audio codec "'+g.audioCodec+'" for "'+I+'"'),w.levelCodec=I,w.id="main",this.log("Init audio buffer, container:"+w.container+", codecs[selected/level/parsed]=["+(I||"")+"/"+(g.audioCodec||"")+"/"+w.codec+"]")}x&&(x.levelCodec=g.videoCodec,x.id="main",this.log("Init video buffer, container:"+x.container+", codecs[level/parsed]=["+(g.videoCodec||"")+"/"+x.codec+"]")),D&&this.log("Init audiovideo buffer, container:"+D.container+", codecs[level/parsed]=["+(g.attrs.CODECS||"")+"/"+D.codec+"]"),this.hls.trigger(e.Events.BUFFER_CODECS,m),Object.keys(m).forEach(function(K){var W=m[K],z=W.initSegment;z!=null&&z.byteLength&&A.hls.trigger(e.Events.BUFFER_APPENDING,{type:K,data:z,frag:d,part:null,chunkMeta:h,parent:d.type})}),this.tick()}},R.getMainFwdBufferInfo=function(){return this.getFwdBufferInfo(this.mediaBuffer?this.mediaBuffer:this.media,n.PlaylistLevelType.MAIN)},R.backtrack=function(g){this.couldBacktrack=!0,this.backtrackFragment=g,this.resetTransmuxer(),this.flushBufferGap(g),this.fragmentTracker.removeFragment(g),this.fragPrevious=null,this.nextLoadPosition=g.start,this.state=T.State.IDLE},R.checkFragmentChanged=function(){var g=this.media,m=null;if(g&&g.readyState>1&&g.seeking===!1){var d=g.currentTime;if(E.BufferHelper.isBuffered(g,d)?m=this.getAppendedFrag(d):E.BufferHelper.isBuffered(g,d+.1)&&(m=this.getAppendedFrag(d+.1)),m){this.backtrackFragment=null;var h=this.fragPlaying,A=m.level;(!h||m.sn!==h.sn||h.level!==A||m.urlId!==h.urlId)&&(this.fragPlaying=m,this.hls.trigger(e.Events.FRAG_CHANGED,{frag:m}),(!h||h.level!==A)&&this.hls.trigger(e.Events.LEVEL_SWITCHED,{level:A}))}}},l(L,[{key:"nextLevel",get:function(){var g=this.nextBufferedFrag;return g?g.level:-1}},{key:"currentFrag",get:function(){var g=this.media;return g?this.fragPlaying||this.getAppendedFrag(g.currentTime):null}},{key:"currentProgramDateTime",get:function(){var g=this.media;if(g){var m=g.currentTime,d=this.currentFrag;if(d&&(0,P.isFiniteNumber)(m)&&(0,P.isFiniteNumber)(d.programDateTime)){var h=d.programDateTime+(m-d.start)*1e3;return new Date(h)}}return null}},{key:"currentLevel",get:function(){var g=this.currentFrag;return g?g.level:-1}},{key:"nextBufferedFrag",get:function(){var g=this.currentFrag;return g?this.followingBufferedFrag(g):null}},{key:"forceStartLoad",get:function(){return this._forceStartLoad}}]),L}(T.default)},"./src/controller/subtitle-stream-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{SubtitleStreamController:()=>c});var P=S("./src/events.ts"),T=S("./src/utils/buffer-helper.ts"),b=S("./src/controller/fragment-finders.ts"),e=S("./src/utils/discontinuities.ts"),E=S("./src/controller/level-helper.ts"),s=S("./src/controller/fragment-tracker.ts"),n=S("./src/controller/base-stream-controller.ts"),t=S("./src/types/loader.ts"),r=S("./src/types/level.ts");function i(y,f){for(var C=0;C<f.length;C++){var L=f[C];L.enumerable=L.enumerable||!1,L.configurable=!0,"value"in L&&(L.writable=!0),Object.defineProperty(y,v(L.key),L)}}function a(y,f,C){return f&&i(y.prototype,f),C&&i(y,C),Object.defineProperty(y,"prototype",{writable:!1}),y}function v(y){var f=p(y,"string");return typeof f=="symbol"?f:String(f)}function p(y,f){if(typeof y!="object"||y===null)return y;var C=y[Symbol.toPrimitive];if(C!==void 0){var L=C.call(y,f||"default");if(typeof L!="object")return L;throw new TypeError("@@toPrimitive must return a primitive value.")}return(f==="string"?String:Number)(y)}function l(y,f){y.prototype=Object.create(f.prototype),y.prototype.constructor=y,o(y,f)}function o(y,f){return o=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(L,R){return L.__proto__=R,L},o(y,f)}var u=500,c=function(y){l(f,y);function f(L,R,O){var g;return g=y.call(this,L,R,O,"[subtitle-stream-controller]")||this,g.levels=[],g.currentTrackId=-1,g.tracksBuffered=[],g.mainDetails=null,g._registerListeners(),g}var C=f.prototype;return C.onHandlerDestroying=function(){this._unregisterListeners(),this.mainDetails=null},C._registerListeners=function(){var R=this.hls;R.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.on(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.on(P.Events.ERROR,this.onError,this),R.on(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.on(P.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.on(P.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.on(P.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.on(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),R.on(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C._unregisterListeners=function(){var R=this.hls;R.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),R.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),R.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),R.off(P.Events.LEVEL_LOADED,this.onLevelLoaded,this),R.off(P.Events.ERROR,this.onError,this),R.off(P.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),R.off(P.Events.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),R.off(P.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),R.off(P.Events.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),R.off(P.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),R.off(P.Events.FRAG_BUFFERED,this.onFragBuffered,this)},C.startLoad=function(R){this.stopLoad(),this.state=n.State.IDLE,this.setInterval(u),this.nextLoadPosition=this.startPosition=this.lastCurrentTime=R,this.tick()},C.onManifestLoading=function(){this.mainDetails=null,this.fragmentTracker.removeAllFragments()},C.onLevelLoaded=function(R,O){this.mainDetails=O.details},C.onSubtitleFragProcessed=function(R,O){var g=O.frag,m=O.success;if(this.fragPrevious=g,this.state=n.State.IDLE,!!m){var d=this.tracksBuffered[this.currentTrackId];if(d){for(var h,A=g.start,w=0;w<d.length;w++)if(A>=d[w].start&&A<=d[w].end){h=d[w];break}var x=g.start+g.duration;h?h.end=x:(h={start:A,end:x},d.push(h)),this.fragmentTracker.fragBuffered(g)}}},C.onBufferFlushing=function(R,O){var g=O.startOffset,m=O.endOffset;if(g===0&&m!==Number.POSITIVE_INFINITY){var d=this.currentTrackId,h=this.levels;if(!h.length||!h[d]||!h[d].details)return;var A=h[d].details,w=A.targetduration,x=m-w;if(x<=0)return;O.endOffsetSubtitles=Math.max(0,x),this.tracksBuffered.forEach(function(D){for(var I=0;I<D.length;){if(D[I].end<=x){D.shift();continue}else if(D[I].start<x)D[I].start=x;else break;I++}}),this.fragmentTracker.removeFragmentsInRange(g,x,t.PlaylistLevelType.SUBTITLE)}},C.onFragBuffered=function(R,O){if(!this.loadedmetadata&&O.frag.type===t.PlaylistLevelType.MAIN){var g;(g=this.media)!==null&&g!==void 0&&g.buffered.length&&(this.loadedmetadata=!0)}},C.onError=function(R,O){var g=O.frag;!g||g.type!==t.PlaylistLevelType.SUBTITLE||(this.fragCurrent&&this.fragCurrent.abortRequests(),this.state=n.State.IDLE)},C.onSubtitleTracksUpdated=function(R,O){var g=this,m=O.subtitleTracks;this.tracksBuffered=[],this.levels=m.map(function(d){return new r.Level(d)}),this.fragmentTracker.removeAllFragments(),this.fragPrevious=null,this.levels.forEach(function(d){g.tracksBuffered[d.id]=[]}),this.mediaBuffer=null},C.onSubtitleTrackSwitch=function(R,O){if(this.currentTrackId=O.id,!this.levels.length||this.currentTrackId===-1){this.clearInterval();return}var g=this.levels[this.currentTrackId];g!=null&&g.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,g&&this.setInterval(u)},C.onSubtitleTrackLoaded=function(R,O){var g,m=O.details,d=O.id,h=this.currentTrackId,A=this.levels;if(A.length){var w=A[h];if(!(d>=A.length||d!==h||!w)){this.mediaBuffer=this.mediaBufferTimeRanges;var x=0;if(m.live||(g=w.details)!==null&&g!==void 0&&g.live){var D=this.mainDetails;if(m.deltaUpdateFailed||!D)return;var I=D.fragments[0];w.details?(x=this.alignPlaylists(m,w.details),x===0&&I&&(x=I.start,(0,E.addSliding)(m,x))):m.hasProgramDateTime&&D.hasProgramDateTime?((0,e.alignMediaPlaylistByPDT)(m,D),x=m.fragments[0].start):I&&(x=I.start,(0,E.addSliding)(m,x))}if(w.details=m,this.levelLastLoaded=d,!this.startFragRequested&&(this.mainDetails||!m.live)&&this.setStartPosition(w.details,x),this.tick(),m.live&&!this.fragCurrent&&this.media&&this.state===n.State.IDLE){var F=(0,b.findFragmentByPTS)(null,m.fragments,this.media.currentTime,0);F||(this.warn("Subtitle playlist not aligned with playback"),w.details=void 0)}}}},C._handleFragmentLoadComplete=function(R){var O=this,g=R.frag,m=R.payload,d=g.decryptdata,h=this.hls;if(!this.fragContextChanged(g)&&m&&m.byteLength>0&&d&&d.key&&d.iv&&d.method==="AES-128"){var A=performance.now();this.decrypter.decrypt(new Uint8Array(m),d.key.buffer,d.iv.buffer).then(function(w){var x=performance.now();h.trigger(P.Events.FRAG_DECRYPTED,{frag:g,payload:w,stats:{tstart:A,tdecrypt:x}})}).catch(function(w){O.warn(w.name+": "+w.message),O.state=n.State.IDLE})}},C.doTick=function(){if(!this.media){this.state=n.State.IDLE;return}if(this.state===n.State.IDLE){var R=this.currentTrackId,O=this.levels;if(!O.length||!O[R]||!O[R].details)return;var g=O[R].details,m=g.targetduration,d=this.config,h=this.getLoadPosition(),A=T.BufferHelper.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],h-m,d.maxBufferHole),w=A.end,x=A.len,D=this.getFwdBufferInfo(this.media,t.PlaylistLevelType.MAIN),I=this.getMaxBufferLength(D==null?void 0:D.len)+m;if(x>I)return;console.assert(g,"Subtitle track details are defined on idle subtitle stream controller tick");var F=g.fragments,K=F.length,W=g.edge,z=null,j=this.fragPrevious;if(w<W){var G=d.maxFragLookUpTolerance;z=(0,b.findFragmentByPTS)(j,F,Math.max(F[0].start,w),G),!z&&j&&j.start<F[0].start&&(z=F[0])}else z=F[K-1];if(!z)return;z=this.mapToInitFragWhenRequired(z),this.fragmentTracker.getState(z)===s.FragmentState.NOT_LOADED&&this.loadFragment(z,g,w)}},C.getMaxBufferLength=function(R){var O=y.prototype.getMaxBufferLength.call(this);return R?Math.max(O,R):O},C.loadFragment=function(R,O,g){this.fragCurrent=R,R.sn==="initSegment"?this._loadInitSegment(R,O):(this.startFragRequested=!0,y.prototype.loadFragment.call(this,R,O,g))},a(f,[{key:"mediaBufferTimeRanges",get:function(){return new _(this.tracksBuffered[this.currentTrackId]||[])}}]),f}(n.default),_=function(f){this.buffered=void 0;var C=function(R,O,g){if(O=O>>>0,O>g-1)throw new DOMException("Failed to execute '"+R+"' on 'TimeRanges': The index provided ("+O+") is greater than the maximum bound ("+g+")");return f[O][R]};this.buffered={get length(){return f.length},end:function(R){return C("end",R,f.length)},start:function(R){return C("start",R,f.length)}}}},"./src/controller/subtitle-track-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>p});var P=S("./src/events.ts"),T=S("./src/utils/texttrack-utils.ts"),b=S("./src/controller/base-playlist-controller.ts"),e=S("./src/types/loader.ts");function E(l,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,n(c.key),c)}}function s(l,o,u){return o&&E(l.prototype,o),u&&E(l,u),Object.defineProperty(l,"prototype",{writable:!1}),l}function n(l){var o=t(l,"string");return typeof o=="symbol"?o:String(o)}function t(l,o){if(typeof l!="object"||l===null)return l;var u=l[Symbol.toPrimitive];if(u!==void 0){var c=u.call(l,o||"default");if(typeof c!="object")return c;throw new TypeError("@@toPrimitive must return a primitive value.")}return(o==="string"?String:Number)(l)}function r(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,i(l,o)}function i(l,o){return i=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,_){return c.__proto__=_,c},i(l,o)}var a=function(l){r(o,l);function o(c){var _;return _=l.call(this,c,"[subtitle-track-controller]")||this,_.media=null,_.tracks=[],_.groupId=null,_.tracksInGroup=[],_.trackId=-1,_.selectDefaultTrack=!0,_.queuedDefaultTrack=-1,_.trackChangeListener=function(){return _.onTextTracksChanged()},_.asyncPollTrackChange=function(){return _.pollTrackChange(0)},_.useTextTrackPolling=!1,_.subtitlePollingInterval=-1,_._subtitleDisplay=!0,_.registerListeners(),_}var u=o.prototype;return u.destroy=function(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.trackChangeListener=this.asyncPollTrackChange=null,l.prototype.destroy.call(this)},u.registerListeners=function(){var _=this.hls;_.on(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.on(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.on(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.on(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.on(P.Events.LEVEL_LOADING,this.onLevelLoading,this),_.on(P.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),_.on(P.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.on(P.Events.ERROR,this.onError,this)},u.unregisterListeners=function(){var _=this.hls;_.off(P.Events.MEDIA_ATTACHED,this.onMediaAttached,this),_.off(P.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(P.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(P.Events.MANIFEST_PARSED,this.onManifestParsed,this),_.off(P.Events.LEVEL_LOADING,this.onLevelLoading,this),_.off(P.Events.LEVEL_SWITCHING,this.onLevelSwitching,this),_.off(P.Events.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),_.off(P.Events.ERROR,this.onError,this)},u.onMediaAttached=function(_,y){this.media=y.media,this.media&&(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))},u.pollTrackChange=function(_){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.trackChangeListener,_)},u.onMediaDetaching=function(){if(this.media){self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||this.media.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId);var _=v(this.media.textTracks);_.forEach(function(y){(0,T.clearCurrentCues)(y)}),this.subtitleTrack=-1,this.media=null}},u.onManifestLoading=function(){this.tracks=[],this.groupId=null,this.tracksInGroup=[],this.trackId=-1,this.selectDefaultTrack=!0},u.onManifestParsed=function(_,y){this.tracks=y.subtitleTracks},u.onSubtitleTrackLoaded=function(_,y){var f=y.id,C=y.details,L=this.trackId,R=this.tracksInGroup[L];if(!R){this.warn("Invalid subtitle track id "+f);return}var O=R.details;R.details=y.details,this.log("subtitle track "+f+" loaded ["+C.startSN+"-"+C.endSN+"]"),f===this.trackId&&(this.retryCount=0,this.playlistLoaded(f,y,O))},u.onLevelLoading=function(_,y){this.switchLevel(y.level)},u.onLevelSwitching=function(_,y){this.switchLevel(y.level)},u.switchLevel=function(_){var y=this.hls.levels[_];if(y!=null&&y.textGroupIds){var f=y.textGroupIds[y.urlId];if(this.groupId!==f){var C=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0,L=this.tracks.filter(function(g){return!f||g.groupId===f});this.tracksInGroup=L;var R=this.findTrackId(C==null?void 0:C.name)||this.findTrackId();this.groupId=f;var O={subtitleTracks:L};this.log("Updating subtitle tracks, "+L.length+' track(s) found in "'+f+'" group-id'),this.hls.trigger(P.Events.SUBTITLE_TRACKS_UPDATED,O),R!==-1&&this.setSubtitleTrack(R,C)}}},u.findTrackId=function(_){for(var y=this.tracksInGroup,f=0;f<y.length;f++){var C=y[f];if((!this.selectDefaultTrack||C.default)&&(!_||_===C.name))return C.id}return-1},u.onError=function(_,y){l.prototype.onError.call(this,_,y),!(y.fatal||!y.context)&&y.context.type===e.PlaylistContextType.SUBTITLE_TRACK&&y.context.id===this.trackId&&y.context.groupId===this.groupId&&this.retryLoadingOrFail(y)},u.loadPlaylist=function(_){l.prototype.loadPlaylist.call(this);var y=this.tracksInGroup[this.trackId];if(this.shouldLoadTrack(y)){var f=y.id,C=y.groupId,L=y.url;if(_)try{L=_.addDirectives(L)}catch(R){this.warn("Could not construct new URL with HLS Delivery Directives: "+R)}this.log("Loading subtitle playlist for id "+f),this.hls.trigger(P.Events.SUBTITLE_TRACK_LOADING,{url:L,id:f,groupId:C,deliveryDirectives:_||null})}},u.toggleTrackModes=function(_){var y=this,f=this.media,C=this.trackId;if(f){var L=v(f.textTracks),R=L.filter(function(m){return m.groupId===y.groupId});if(_===-1)[].slice.call(L).forEach(function(m){m.mode="disabled"});else{var O=R[C];O&&(O.mode="disabled")}var g=R[_];g&&(g.mode=this.subtitleDisplay?"showing":"hidden")}},u.setSubtitleTrack=function(_,y){var f,C=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=_;return}if(this.trackId!==_&&this.toggleTrackModes(_),!(this.trackId===_&&(_===-1||(f=C[_])!==null&&f!==void 0&&f.details)||_<-1||_>=C.length)){this.clearTimer();var L=C[_];if(this.log("Switching to subtitle track "+_),this.trackId=_,L){var R=L.id,O=L.groupId,g=O===void 0?"":O,m=L.name,d=L.type,h=L.url;this.hls.trigger(P.Events.SUBTITLE_TRACK_SWITCH,{id:R,groupId:g,name:m,type:d,url:h});var A=this.switchParams(L.url,y==null?void 0:y.details);this.loadPlaylist(A)}else this.hls.trigger(P.Events.SUBTITLE_TRACK_SWITCH,{id:_})}},u.onTextTracksChanged=function(){if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!(!this.media||!this.hls.config.renderTextTracksNatively)){for(var _=-1,y=v(this.media.textTracks),f=0;f<y.length;f++)if(y[f].mode==="hidden")_=f;else if(y[f].mode==="showing"){_=f;break}this.subtitleTrack!==_&&(this.subtitleTrack=_)}},s(o,[{key:"subtitleDisplay",get:function(){return this._subtitleDisplay},set:function(_){this._subtitleDisplay=_,this.trackId>-1&&this.toggleTrackModes(this.trackId)}},{key:"subtitleTracks",get:function(){return this.tracksInGroup}},{key:"subtitleTrack",get:function(){return this.trackId},set:function(_){this.selectDefaultTrack=!1;var y=this.tracksInGroup?this.tracksInGroup[this.trackId]:void 0;this.setSubtitleTrack(_,y)}}]),o}(b.default);function v(l){for(var o=[],u=0;u<l.length;u++){var c=l[u];(c.kind==="subtitles"||c.kind==="captions")&&c.label&&o.push(l[u])}return o}const p=a},"./src/controller/timeline-controller.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{TimelineController:()=>a});var P=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),b=S("./src/utils/cea-608-parser.ts"),e=S("./src/utils/output-filter.ts"),E=S("./src/utils/webvtt-parser.ts"),s=S("./src/utils/texttrack-utils.ts"),n=S("./src/utils/imsc1-ttml-parser.ts"),t=S("./src/utils/mp4-tools.ts"),r=S("./src/types/loader.ts"),i=S("./src/utils/logger.ts"),a=function(){function o(c){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=c,this.config=c.config,this.Cues=c.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 _=new e.default(this,"textTrack1"),y=new e.default(this,"textTrack2"),f=new e.default(this,"textTrack3"),C=new e.default(this,"textTrack4");this.cea608Parser1=new b.default(1,_,y),this.cea608Parser2=new b.default(3,f,C)}c.on(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),c.on(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),c.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),c.on(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),c.on(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),c.on(T.Events.FRAG_LOADING,this.onFragLoading,this),c.on(T.Events.FRAG_LOADED,this.onFragLoaded,this),c.on(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),c.on(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),c.on(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),c.on(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),c.on(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this)}var u=o.prototype;return u.destroy=function(){var _=this.hls;_.off(T.Events.MEDIA_ATTACHING,this.onMediaAttaching,this),_.off(T.Events.MEDIA_DETACHING,this.onMediaDetaching,this),_.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),_.off(T.Events.MANIFEST_LOADED,this.onManifestLoaded,this),_.off(T.Events.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),_.off(T.Events.FRAG_LOADING,this.onFragLoading,this),_.off(T.Events.FRAG_LOADED,this.onFragLoaded,this),_.off(T.Events.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),_.off(T.Events.FRAG_DECRYPTED,this.onFragDecrypted,this),_.off(T.Events.INIT_PTS_FOUND,this.onInitPtsFound,this),_.off(T.Events.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),_.off(T.Events.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.cea608Parser1=this.cea608Parser2=null},u.addCues=function(_,y,f,C,L){for(var R=!1,O=L.length;O--;){var g=L[O],m=p(g[0],g[1],y,f);if(m>=0&&(g[0]=Math.min(g[0],y),g[1]=Math.max(g[1],f),R=!0,m/(f-y)>.5))return}if(R||L.push([y,f]),this.config.renderTextTracksNatively){var d=this.captionsTracks[_];this.Cues.newCue(d,y,f,C)}else{var h=this.Cues.newCue(null,y,f,C);this.hls.trigger(T.Events.CUES_PARSED,{type:"captions",cues:h,track:_})}},u.onInitPtsFound=function(_,y){var f=this,C=y.frag,L=y.id,R=y.initPTS,O=y.timescale,g=this.unparsedVttFrags;L==="main"&&(this.initPTS[C.cc]=R,this.timescale[C.cc]=O),g.length&&(this.unparsedVttFrags=[],g.forEach(function(m){f.onFragLoaded(T.Events.FRAG_LOADED,m)}))},u.getExistingTrack=function(_){var y=this.media;if(y)for(var f=0;f<y.textTracks.length;f++){var C=y.textTracks[f];if(C[_])return C}return null},u.createCaptionsTrack=function(_){this.config.renderTextTracksNatively?this.createNativeTrack(_):this.createNonNativeTrack(_)},u.createNativeTrack=function(_){if(!this.captionsTracks[_]){var y=this.captionsProperties,f=this.captionsTracks,C=this.media,L=y[_],R=L.label,O=L.languageCode,g=this.getExistingTrack(_);if(g)f[_]=g,(0,s.clearCurrentCues)(f[_]),(0,s.sendAddTrackEvent)(f[_],C);else{var m=this.createTextTrack("captions",R,O);m&&(m[_]=!0,f[_]=m)}}},u.createNonNativeTrack=function(_){if(!this.nonNativeCaptionsTracks[_]){var y=this.captionsProperties[_];if(y){var f=y.label,C={_id:_,label:f,kind:"captions",default:y.media?!!y.media.default:!1,closedCaptions:y.media};this.nonNativeCaptionsTracks[_]=C,this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[C]})}}},u.createTextTrack=function(_,y,f){var C=this.media;if(C)return C.addTextTrack(_,y,f)},u.onMediaAttaching=function(_,y){this.media=y.media,this._cleanTracks()},u.onMediaDetaching=function(){var _=this.captionsTracks;Object.keys(_).forEach(function(y){(0,s.clearCurrentCues)(_[y]),delete _[y]}),this.nonNativeCaptionsTracks={}},u.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())},u._cleanTracks=function(){var _=this.media;if(_){var y=_.textTracks;if(y)for(var f=0;f<y.length;f++)(0,s.clearCurrentCues)(y[f])}},u.onSubtitleTracksUpdated=function(_,y){var f=this;this.textTracks=[];var C=y.subtitleTracks||[],L=C.some(function(m){return m.textCodec===n.IMSC1_CODEC});if(this.config.enableWebVTT||L&&this.config.enableIMSC1){var R=this.tracks&&C&&this.tracks.length===C.length;if(this.tracks=C||[],this.config.renderTextTracksNatively){var O=this.media?this.media.textTracks:[];this.tracks.forEach(function(m,d){var h;if(d<O.length){for(var A=null,w=0;w<O.length;w++)if(v(O[w],m)){A=O[w];break}A&&(h=A)}if(h)(0,s.clearCurrentCues)(h);else{var x=f._captionsOrSubtitlesFromCharacteristics(m);h=f.createTextTrack(x,m.name,m.lang),h&&(h.mode="disabled")}h&&(h.groupId=m.groupId,f.textTracks.push(h))})}else if(!R&&this.tracks&&this.tracks.length){var g=this.tracks.map(function(m){return{label:m.name,kind:m.type.toLowerCase(),default:m.default,subtitleTrack:m}});this.hls.trigger(T.Events.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:g})}}},u._captionsOrSubtitlesFromCharacteristics=function(_){var y;if((y=_.attrs)!==null&&y!==void 0&&y.CHARACTERISTICS){var f=/transcribes-spoken-dialog/gi.test(_.attrs.CHARACTERISTICS),C=/describes-music-and-sound/gi.test(_.attrs.CHARACTERISTICS);if(f&&C)return"captions"}return"subtitles"},u.onManifestLoaded=function(_,y){var f=this;this.config.enableCEA708Captions&&y.captions&&y.captions.forEach(function(C){var L=/(?:CC|SERVICE)([1-4])/.exec(C.instreamId);if(L){var R="textTrack"+L[1],O=f.captionsProperties[R];O&&(O.label=C.name,C.lang&&(O.languageCode=C.lang),O.media=C)}})},u.closedCaptionsForLevel=function(_){var y=this.hls.levels[_.level];return y==null?void 0:y.attrs["CLOSED-CAPTIONS"]},u.onFragLoading=function(_,y){var f=this.cea608Parser1,C=this.cea608Parser2,L=this.lastSn,R=this.lastPartIndex;if(!(!this.enabled||!(f&&C))&&y.frag.type===r.PlaylistLevelType.MAIN){var O,g,m=y.frag.sn,d=(O=y==null||(g=y.part)===null||g===void 0?void 0:g.index)!=null?O:-1;m===L+1||m===L&&d===R+1||(f.reset(),C.reset()),this.lastSn=m,this.lastPartIndex=d}},u.onFragLoaded=function(_,y){var f=y.frag,C=y.payload,L=this.initPTS,R=this.unparsedVttFrags;if(f.type===r.PlaylistLevelType.SUBTITLE)if(C.byteLength){if(!(0,P.isFiniteNumber)(L[f.cc])){R.push(y),L.length&&this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Missing initial subtitle PTS")});return}var O=f.decryptdata,g="stats"in y;if(O==null||!O.encrypted||g){var m=this.tracks[f.level],d=this.vttCCs;d[f.cc]||(d[f.cc]={start:f.start,prevCC:this.prevCC,new:!0},this.prevCC=f.cc),m&&m.textCodec===n.IMSC1_CODEC?this._parseIMSC1(f,C):this._parseVTTs(f,C,d)}}else this.hls.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:f,error:new Error("Empty subtitle payload")})},u._parseIMSC1=function(_,y){var f=this,C=this.hls;(0,n.parseIMSC1)(y,this.initPTS[_.cc],this.timescale[_.cc],function(L){f._appendCues(L,_.level),C.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:_})},function(L){i.logger.log("Failed to parse IMSC1: "+L),C.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:L})})},u._parseVTTs=function(_,y,f){var C,L=this,R=this.hls,O=(C=_.initSegment)!==null&&C!==void 0&&C.data?(0,t.appendUint8Array)(_.initSegment.data,new Uint8Array(y)):y;(0,E.parseWebVTT)(O,this.initPTS[_.cc],this.timescale[_.cc],f,_.cc,_.start,function(g){L._appendCues(g,_.level),R.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:_})},function(g){L._fallbackToIMSC1(_,y),i.logger.log("Failed to parse VTT cue: "+g),R.trigger(T.Events.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:_,error:g})})},u._fallbackToIMSC1=function(_,y){var f=this,C=this.tracks[_.level];C.textCodec||(0,n.parseIMSC1)(y,this.initPTS[_.cc],this.timescale[_.cc],function(){C.textCodec=n.IMSC1_CODEC,f._parseIMSC1(_,y)},function(){C.textCodec="wvtt"})},u._appendCues=function(_,y){var f=this.hls;if(this.config.renderTextTracksNatively){var C=this.textTracks[y];if(!C||C.mode==="disabled")return;_.forEach(function(O){return(0,s.addCueToTrack)(C,O)})}else{var L=this.tracks[y];if(!L)return;var R=L.default?"default":"subtitles"+y;f.trigger(T.Events.CUES_PARSED,{type:"subtitles",cues:_,track:R})}},u.onFragDecrypted=function(_,y){var f=y.frag;if(f.type===r.PlaylistLevelType.SUBTITLE){if(!(0,P.isFiniteNumber)(this.initPTS[f.cc])){this.unparsedVttFrags.push(y);return}this.onFragLoaded(T.Events.FRAG_LOADED,y)}},u.onSubtitleTracksCleared=function(){this.tracks=[],this.captionsTracks={}},u.onFragParsingUserdata=function(_,y){var f=this.cea608Parser1,C=this.cea608Parser2;if(!(!this.enabled||!(f&&C))){var L=y.frag,R=y.samples;if(!(L.type===r.PlaylistLevelType.MAIN&&this.closedCaptionsForLevel(L)==="NONE"))for(var O=0;O<R.length;O++){var g=R[O].bytes;if(g){var m=this.extractCea608Data(g);f.addData(R[O].pts,m[0]),C.addData(R[O].pts,m[1])}}}},u.onBufferFlushing=function(_,y){var f=y.startOffset,C=y.endOffset,L=y.endOffsetSubtitles,R=y.type,O=this.media;if(!(!O||O.currentTime<C)){if(!R||R==="video"){var g=this.captionsTracks;Object.keys(g).forEach(function(d){return(0,s.removeCuesInRange)(g[d],f,C)})}if(this.config.renderTextTracksNatively&&f===0&&L!==void 0){var m=this.textTracks;Object.keys(m).forEach(function(d){return(0,s.removeCuesInRange)(m[d],f,L)})}}},u.extractCea608Data=function(_){for(var y=[[],[]],f=_[0]&31,C=2,L=0;L<f;L++){var R=_[C++],O=127&_[C++],g=127&_[C++];if(!(O===0&&g===0)){var m=(4&R)!==0;if(m){var d=3&R;(d===0||d===1)&&(y[d].push(O),y[d].push(g))}}}return y},o}();function v(o,u){return o&&o.label===u.name&&!(o.textTrack1||o.textTrack2)}function p(o,u,c,_){return Math.min(u,_)-Math.max(o,c)}function l(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}},"./src/crypt/aes-crypto.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>P});var P=function(){function T(e,E){this.subtle=void 0,this.aesIV=void 0,this.subtle=e,this.aesIV=E}var b=T.prototype;return b.decrypt=function(E,s){return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},s,E)},T}()},"./src/crypt/aes-decryptor.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>b,removePadding:()=>T});var P=S("./src/utils/typed-array.ts");function T(e){var E=e.byteLength,s=E&&new DataView(e.buffer).getUint8(E-1);return s?(0,P.sliceUint8)(e,0,E-s):e}var b=function(){function e(){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 E=e.prototype;return E.uint8ArrayToUint32Array_=function(n){for(var t=new DataView(n),r=new Uint32Array(4),i=0;i<4;i++)r[i]=t.getUint32(i*4);return r},E.initTable=function(){var n=this.sBox,t=this.invSBox,r=this.subMix,i=r[0],a=r[1],v=r[2],p=r[3],l=this.invSubMix,o=l[0],u=l[1],c=l[2],_=l[3],y=new Uint32Array(256),f=0,C=0,L=0;for(L=0;L<256;L++)L<128?y[L]=L<<1:y[L]=L<<1^283;for(L=0;L<256;L++){var R=C^C<<1^C<<2^C<<3^C<<4;R=R>>>8^R&255^99,n[f]=R,t[R]=f;var O=y[f],g=y[O],m=y[g],d=y[R]*257^R*16843008;i[f]=d<<24|d>>>8,a[f]=d<<16|d>>>16,v[f]=d<<8|d>>>24,p[f]=d,d=m*16843009^g*65537^O*257^f*16843008,o[R]=d<<24|d>>>8,u[R]=d<<16|d>>>16,c[R]=d<<8|d>>>24,_[R]=d,f?(f=O^y[y[y[m^O]]],C^=y[y[C]]):f=C=1}},E.expandKey=function(n){for(var t=this.uint8ArrayToUint32Array_(n),r=!0,i=0;i<t.length&&r;)r=t[i]===this.key[i],i++;if(!r){this.key=t;var a=this.keySize=t.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);var v=this.ksRows=(a+6+1)*4,p,l,o=this.keySchedule=new Uint32Array(v),u=this.invKeySchedule=new Uint32Array(v),c=this.sBox,_=this.rcon,y=this.invSubMix,f=y[0],C=y[1],L=y[2],R=y[3],O,g;for(p=0;p<v;p++){if(p<a){O=o[p]=t[p];continue}g=O,p%a===0?(g=g<<8|g>>>24,g=c[g>>>24]<<24|c[g>>>16&255]<<16|c[g>>>8&255]<<8|c[g&255],g^=_[p/a|0]<<24):a>6&&p%a===4&&(g=c[g>>>24]<<24|c[g>>>16&255]<<16|c[g>>>8&255]<<8|c[g&255]),o[p]=O=(o[p-a]^g)>>>0}for(l=0;l<v;l++)p=v-l,l&3?g=o[p]:g=o[p-4],l<4||p<=4?u[l]=g:u[l]=f[c[g>>>24]]^C[c[g>>>16&255]]^L[c[g>>>8&255]]^R[c[g&255]],u[l]=u[l]>>>0}},E.networkToHostOrderSwap=function(n){return n<<24|(n&65280)<<8|(n&16711680)>>8|n>>>24},E.decrypt=function(n,t,r){for(var i=this.keySize+6,a=this.invKeySchedule,v=this.invSBox,p=this.invSubMix,l=p[0],o=p[1],u=p[2],c=p[3],_=this.uint8ArrayToUint32Array_(r),y=_[0],f=_[1],C=_[2],L=_[3],R=new Int32Array(n),O=new Int32Array(R.length),g,m,d,h,A,w,x,D,I,F,K,W,z,j,G=this.networkToHostOrderSwap;t<R.length;){for(I=G(R[t]),F=G(R[t+1]),K=G(R[t+2]),W=G(R[t+3]),A=I^a[0],w=W^a[1],x=K^a[2],D=F^a[3],z=4,j=1;j<i;j++)g=l[A>>>24]^o[w>>16&255]^u[x>>8&255]^c[D&255]^a[z],m=l[w>>>24]^o[x>>16&255]^u[D>>8&255]^c[A&255]^a[z+1],d=l[x>>>24]^o[D>>16&255]^u[A>>8&255]^c[w&255]^a[z+2],h=l[D>>>24]^o[A>>16&255]^u[w>>8&255]^c[x&255]^a[z+3],A=g,w=m,x=d,D=h,z=z+4;g=v[A>>>24]<<24^v[w>>16&255]<<16^v[x>>8&255]<<8^v[D&255]^a[z],m=v[w>>>24]<<24^v[x>>16&255]<<16^v[D>>8&255]<<8^v[A&255]^a[z+1],d=v[x>>>24]<<24^v[D>>16&255]<<16^v[A>>8&255]<<8^v[w&255]^a[z+2],h=v[D>>>24]<<24^v[A>>16&255]<<16^v[w>>8&255]<<8^v[x&255]^a[z+3],O[t]=G(g^y),O[t+1]=G(h^f),O[t+2]=G(d^C),O[t+3]=G(m^L),y=I,f=F,C=K,L=W,t=t+4}return O.buffer},e}()},"./src/crypt/decrypter.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>t});var P=S("./src/crypt/aes-crypto.ts"),T=S("./src/crypt/fast-aes-key.ts"),b=S("./src/crypt/aes-decryptor.ts"),e=S("./src/utils/logger.ts"),E=S("./src/utils/mp4-tools.ts"),s=S("./src/utils/typed-array.ts"),n=16,t=function(){function r(a,v){var p=v===void 0?{}:v,l=p.removePKCS7Padding,o=l===void 0?!0:l;if(this.logEnabled=!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.useSoftware=void 0,this.useSoftware=a.enableSoftwareAES,this.removePKCS7Padding=o,o)try{var u=self.crypto;u&&(this.subtle=u.subtle||u.webkitSubtle)}catch(c){}this.subtle===null&&(this.useSoftware=!0)}var i=r.prototype;return i.destroy=function(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null},i.isSync=function(){return this.useSoftware},i.flush=function(){var v=this.currentResult,p=this.remainderData;if(!v||p)return this.reset(),null;var l=new Uint8Array(v);return this.reset(),this.removePKCS7Padding?(0,b.removePadding)(l):l},i.reset=function(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)},i.decrypt=function(v,p,l){var o=this;return this.useSoftware?new Promise(function(u,c){o.softwareDecrypt(new Uint8Array(v),p,l);var _=o.flush();_?u(_.buffer):c(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(v),p,l)},i.softwareDecrypt=function(v,p,l){var o=this.currentIV,u=this.currentResult,c=this.remainderData;this.logOnce("JS AES decrypt"),c&&(v=(0,E.appendUint8Array)(c,v),this.remainderData=null);var _=this.getValidChunk(v);if(!_.length)return null;o&&(l=o);var y=this.softwareDecrypter;y||(y=this.softwareDecrypter=new b.default),y.expandKey(p);var f=u;return this.currentResult=y.decrypt(_.buffer,0,l),this.currentIV=(0,s.sliceUint8)(_,-16).buffer,f||null},i.webCryptoDecrypt=function(v,p,l){var o=this,u=this.subtle;return(this.key!==p||!this.fastAesKey)&&(this.key=p,this.fastAesKey=new T.default(u,p)),this.fastAesKey.expandKey().then(function(c){if(!u)return Promise.reject(new Error("web crypto not initialized"));o.logOnce("WebCrypto AES decrypt");var _=new P.default(u,new Uint8Array(l));return _.decrypt(v.buffer,c)}).catch(function(c){return e.logger.warn("[decrypter]: WebCrypto Error, disable WebCrypto API, "+c.name+": "+c.message),o.onWebCryptoError(v,p,l)})},i.onWebCryptoError=function(v,p,l){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(v,p,l);var o=this.flush();if(o)return o.buffer;throw new Error("WebCrypto and softwareDecrypt: failed to decrypt data")},i.getValidChunk=function(v){var p=v,l=v.length-v.length%n;return l!==v.length&&(p=(0,s.sliceUint8)(v,0,l),this.remainderData=(0,s.sliceUint8)(v,l)),p},i.logOnce=function(v){this.logEnabled&&(e.logger.log("[decrypter]: "+v),this.logEnabled=!1)},r}()},"./src/crypt/fast-aes-key.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>P});var P=function(){function T(e,E){this.subtle=void 0,this.key=void 0,this.subtle=e,this.key=E}var b=T.prototype;return b.expandKey=function(){return this.subtle.importKey("raw",this.key,{name:"AES-CBC"},!1,["encrypt","decrypt"])},T}()},"./src/demux/aacdemuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>t});var P=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/adts.ts"),b=S("./src/utils/logger.ts"),e=S("./src/demux/id3.ts");function E(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,s(r,i)}function s(r,i){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,p){return v.__proto__=p,v},s(r,i)}var n=function(r){E(i,r);function i(v,p){var l;return l=r.call(this)||this,l.observer=void 0,l.config=void 0,l.observer=v,l.config=p,l}var a=i.prototype;return a.resetInitSegment=function(p,l,o,u){r.prototype.resetInitSegment.call(this,p,l,o,u),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:l,duration:u,inputTimeScale:9e4,dropped:0}},i.probe=function(p){if(!p)return!1;for(var l=e.getID3Data(p,0)||[],o=l.length,u=p.length;o<u;o++)if(T.probe(p,o))return b.logger.log("ADTS sync word found !"),!0;return!1},a.canParse=function(p,l){return T.canParse(p,l)},a.appendFrame=function(p,l,o){T.initTrackConfig(p,this.observer,l,o,p.manifestCodec);var u=T.appendFrame(p,l,o,this.basePTS,this.frameIndex);if(u&&u.missing===0)return u},i}(P.default);const t=n},"./src/demux/adts.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{appendFrame:()=>o,canGetFrameLength:()=>t,canParse:()=>i,getAudioConfig:()=>e,getFrameDuration:()=>p,getFullFrameLength:()=>n,getHeaderLength:()=>s,initTrackConfig:()=>v,isHeader:()=>r,isHeaderPattern:()=>E,parseFrameHeader:()=>l,probe:()=>a});var P=S("./src/utils/logger.ts"),T=S("./src/errors.ts"),b=S("./src/events.ts");function e(u,c,_,y){var f,C,L,R,O=navigator.userAgent.toLowerCase(),g=y,m=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350];f=((c[_+2]&192)>>>6)+1;var d=(c[_+2]&60)>>>2;if(d>m.length-1){u.trigger(b.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"invalid ADTS sampling index:"+d});return}return L=(c[_+2]&1)<<2,L|=(c[_+3]&192)>>>6,P.logger.log("manifest codec:"+y+", ADTS type:"+f+", samplingIndex:"+d),/firefox/i.test(O)?d>=6?(f=5,R=new Array(4),C=d-3):(f=2,R=new Array(2),C=d):O.indexOf("android")!==-1?(f=2,R=new Array(2),C=d):(f=5,R=new Array(4),y&&(y.indexOf("mp4a.40.29")!==-1||y.indexOf("mp4a.40.5")!==-1)||!y&&d>=6?C=d-3:((y&&y.indexOf("mp4a.40.2")!==-1&&(d>=6&&L===1||/vivaldi/i.test(O))||!y&&L===1)&&(f=2,R=new Array(2)),C=d)),R[0]=f<<3,R[0]|=(d&14)>>1,R[1]|=(d&1)<<7,R[1]|=L<<3,f===5&&(R[1]|=(C&14)>>1,R[2]=(C&1)<<7,R[2]|=8,R[3]=0),{config:R,samplerate:m[d],channelCount:L,codec:"mp4a.40."+f,manifestCodec:g}}function E(u,c){return u[c]===255&&(u[c+1]&246)===240}function s(u,c){return u[c+1]&1?7:9}function n(u,c){return(u[c+3]&3)<<11|u[c+4]<<3|(u[c+5]&224)>>>5}function t(u,c){return c+5<u.length}function r(u,c){return c+1<u.length&&E(u,c)}function i(u,c){return t(u,c)&&E(u,c)&&n(u,c)<=u.length-c}function a(u,c){if(r(u,c)){var _=s(u,c);if(c+_>=u.length)return!1;var y=n(u,c);if(y<=_)return!1;var f=c+y;return f===u.length||r(u,f)}return!1}function v(u,c,_,y,f){if(!u.samplerate){var C=e(c,_,y,f);if(!C)return;u.config=C.config,u.samplerate=C.samplerate,u.channelCount=C.channelCount,u.codec=C.codec,u.manifestCodec=C.manifestCodec,P.logger.log("parsed codec:"+u.codec+", rate:"+C.samplerate+", channels:"+C.channelCount)}}function p(u){return 9216e4/u}function l(u,c){var _=s(u,c);if(c+_<=u.length){var y=n(u,c)-_;if(y>0)return{headerLength:_,frameLength:y}}}function o(u,c,_,y,f){var C=p(u.samplerate),L=y+f*C,R=l(c,_),O;if(R){var g=R.frameLength,m=R.headerLength,d=m+g,h=Math.max(0,_+d-c.length);h?(O=new Uint8Array(d-m),O.set(c.subarray(_+m,c.length),0)):O=c.subarray(_+m,_+d);var A={unit:O,pts:L};return h||u.samples.push(A),{sample:A,length:d,missing:h}}var w=c.length-_;O=new Uint8Array(w),O.set(c.subarray(_,c.length),0);var x={unit:O,pts:L};return{sample:x,length:w,missing:-1}}},"./src/demux/base-audio-demuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>r,initPTSFn:()=>t});var P=S("./src/polyfills/number.ts"),T=S("./src/demux/id3.ts"),b=S("./src/types/demuxer.ts"),e=S("./src/demux/dummy-demuxed-track.ts"),E=S("./src/utils/mp4-tools.ts"),s=S("./src/utils/typed-array.ts"),n=function(){function i(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}var a=i.prototype;return a.resetInitSegment=function(p,l,o,u){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}},a.resetTimeStamp=function(p){this.initPTS=p,this.resetContiguity()},a.resetContiguity=function(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0},a.canParse=function(p,l){return!1},a.appendFrame=function(p,l,o){},a.demux=function(p,l){this.cachedData&&(p=(0,E.appendUint8Array)(this.cachedData,p),this.cachedData=null);var o=T.getID3Data(p,0),u=o?o.length:0,c,_=this._audioTrack,y=this._id3Track,f=o?T.getTimeStamp(o):void 0,C=p.length;for((this.basePTS===null||this.frameIndex===0&&(0,P.isFiniteNumber)(f))&&(this.basePTS=t(f,l,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),o&&o.length>0&&y.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:o,type:b.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});u<C;){if(this.canParse(p,u)){var L=this.appendFrame(_,p,u);L?(this.frameIndex++,this.lastPTS=L.sample.pts,u+=L.length,c=u):u=C}else T.canParse(p,u)?(o=T.getID3Data(p,u),y.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:o,type:b.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY}),u+=o.length,c=u):u++;if(u===C&&c!==C){var R=(0,s.sliceUint8)(p,c);this.cachedData?this.cachedData=(0,E.appendUint8Array)(this.cachedData,R):this.cachedData=R}}return{audioTrack:_,videoTrack:(0,e.dummyTrack)(),id3Track:y,textTrack:(0,e.dummyTrack)()}},a.demuxSampleAes=function(p,l,o){return Promise.reject(new Error("["+this+"] This demuxer does not support Sample-AES decryption"))},a.flush=function(p){var l=this.cachedData;return l&&(this.cachedData=null,this.demux(l,0)),{audioTrack:this._audioTrack,videoTrack:(0,e.dummyTrack)(),id3Track:this._id3Track,textTrack:(0,e.dummyTrack)()}},a.destroy=function(){},i}(),t=function(a,v,p){return(0,P.isFiniteNumber)(a)?a*90:v*9e4+(p||0)};const r=n},"./src/demux/chunk-cache.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>P});var P=function(){function b(){this.chunks=[],this.dataLength=0}var e=b.prototype;return e.push=function(s){this.chunks.push(s),this.dataLength+=s.length},e.flush=function(){var s=this.chunks,n=this.dataLength,t;if(s.length)s.length===1?t=s[0]:t=T(s,n);else return new Uint8Array(0);return this.reset(),t},e.reset=function(){this.chunks.length=0,this.dataLength=0},b}();function T(b,e){for(var E=new Uint8Array(e),s=0,n=0;n<b.length;n++){var t=b[n];E.set(t,s),s+=t.length}return E}},"./src/demux/dummy-demuxed-track.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{dummyTrack:()=>P});function P(T,b){return T===void 0&&(T=""),b===void 0&&(b=9e4),{type:T,id:-1,pid:-1,inputTimeScale:b,sequenceNumber:-1,samples:[],dropped:0}}},"./src/demux/exp-golomb.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>b});var P=S("./src/utils/logger.ts"),T=function(){function e(s){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=s,this.bytesAvailable=s.byteLength,this.word=0,this.bitsAvailable=0}var E=e.prototype;return E.loadWord=function(){var n=this.data,t=this.bytesAvailable,r=n.byteLength-t,i=new Uint8Array(4),a=Math.min(4,t);if(a===0)throw new Error("no bytes available");i.set(n.subarray(r,r+a)),this.word=new DataView(i.buffer).getUint32(0),this.bitsAvailable=a*8,this.bytesAvailable-=a},E.skipBits=function(n){var t;n=Math.min(n,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>n?(this.word<<=n,this.bitsAvailable-=n):(n-=this.bitsAvailable,t=n>>3,n-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=n,this.bitsAvailable-=n)},E.readBits=function(n){var t=Math.min(this.bitsAvailable,n),r=this.word>>>32-t;if(n>32&&P.logger.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=n-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r},E.skipLZ=function(){var n;for(n=0;n<this.bitsAvailable;++n)if(this.word&2147483648>>>n)return this.word<<=n,this.bitsAvailable-=n,n;return this.loadWord(),n+this.skipLZ()},E.skipUEG=function(){this.skipBits(1+this.skipLZ())},E.skipEG=function(){this.skipBits(1+this.skipLZ())},E.readUEG=function(){var n=this.skipLZ();return this.readBits(n+1)-1},E.readEG=function(){var n=this.readUEG();return 1&n?1+n>>>1:-1*(n>>>1)},E.readBoolean=function(){return this.readBits(1)===1},E.readUByte=function(){return this.readBits(8)},E.readUShort=function(){return this.readBits(16)},E.readUInt=function(){return this.readBits(32)},E.skipScalingList=function(n){for(var t=8,r=8,i,a=0;a<n;a++)r!==0&&(i=this.readEG(),r=(t+i+256)%256),t=r===0?t:r},E.readSPS=function(){var n=0,t=0,r=0,i=0,a,v,p,l=this.readUByte.bind(this),o=this.readBits.bind(this),u=this.readUEG.bind(this),c=this.readBoolean.bind(this),_=this.skipBits.bind(this),y=this.skipEG.bind(this),f=this.skipUEG.bind(this),C=this.skipScalingList.bind(this);l();var L=l();if(o(5),_(3),l(),f(),L===100||L===110||L===122||L===244||L===44||L===83||L===86||L===118||L===128){var R=u();if(R===3&&_(1),f(),f(),_(1),c())for(v=R!==3?8:12,p=0;p<v;p++)c()&&(p<6?C(16):C(64))}f();var O=u();if(O===0)u();else if(O===1)for(_(1),y(),y(),a=u(),p=0;p<a;p++)y();f(),_(1);var g=u(),m=u(),d=o(1);d===0&&_(1),_(1),c()&&(n=u(),t=u(),r=u(),i=u());var h=[1,1];if(c()&&c()){var A=l();switch(A){case 1:h=[1,1];break;case 2:h=[12,11];break;case 3:h=[10,11];break;case 4:h=[16,11];break;case 5:h=[40,33];break;case 6:h=[24,11];break;case 7:h=[20,11];break;case 8:h=[32,11];break;case 9:h=[80,33];break;case 10:h=[18,11];break;case 11:h=[15,11];break;case 12:h=[64,33];break;case 13:h=[160,99];break;case 14:h=[4,3];break;case 15:h=[3,2];break;case 16:h=[2,1];break;case 255:{h=[l()<<8|l(),l()<<8|l()];break}}}return{width:Math.ceil((g+1)*16-n*2-t*2),height:(2-d)*(m+1)*16-(d?2:4)*(r+i),pixelRatio:h}},E.readSliceType=function(){return this.readUByte(),this.readUEG(),this.readUEG()},e}();const b=T},"./src/demux/id3.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{canParse:()=>E,decodeFrame:()=>i,getID3Data:()=>b,getID3Frames:()=>r,getTimeStamp:()=>s,isFooter:()=>T,isHeader:()=>P,isTimeStampFrame:()=>n,testables:()=>u,utf8ArrayToStr:()=>o});var P=function(f,C){return C+10<=f.length&&f[C]===73&&f[C+1]===68&&f[C+2]===51&&f[C+3]<255&&f[C+4]<255&&f[C+6]<128&&f[C+7]<128&&f[C+8]<128&&f[C+9]<128},T=function(f,C){return C+10<=f.length&&f[C]===51&&f[C+1]===68&&f[C+2]===73&&f[C+3]<255&&f[C+4]<255&&f[C+6]<128&&f[C+7]<128&&f[C+8]<128&&f[C+9]<128},b=function(f,C){for(var L=C,R=0;P(f,C);){R+=10;var O=e(f,C+6);R+=O,T(f,C+10)&&(R+=10),C+=R}if(R>0)return f.subarray(L,L+R)},e=function(f,C){var L=0;return L=(f[C]&127)<<21,L|=(f[C+1]&127)<<14,L|=(f[C+2]&127)<<7,L|=f[C+3]&127,L},E=function(f,C){return P(f,C)&&e(f,C+6)+10<=f.length-C},s=function(f){for(var C=r(f),L=0;L<C.length;L++){var R=C[L];if(n(R))return l(R)}},n=function(f){return f&&f.key==="PRIV"&&f.info==="com.apple.streaming.transportStreamTimestamp"},t=function(f){var C=String.fromCharCode(f[0],f[1],f[2],f[3]),L=e(f,4),R=10;return{type:C,size:L,data:f.subarray(R,R+L)}},r=function(f){for(var C=0,L=[];P(f,C);){var R=e(f,C+6);C+=10;for(var O=C+R;C+8<O;){var g=t(f.subarray(C)),m=i(g);m&&L.push(m),C+=g.size+10}T(f,C)&&(C+=10)}return L},i=function(f){return f.type==="PRIV"?a(f):f.type[0]==="W"?p(f):v(f)},a=function(f){if(!(f.size<2)){var C=o(f.data,!0),L=new Uint8Array(f.data.subarray(C.length+1));return{key:f.type,info:C,data:L.buffer}}},v=function(f){if(!(f.size<2)){if(f.type==="TXXX"){var C=1,L=o(f.data.subarray(C),!0);C+=L.length+1;var R=o(f.data.subarray(C));return{key:f.type,info:L,data:R}}var O=o(f.data.subarray(1));return{key:f.type,data:O}}},p=function(f){if(f.type==="WXXX"){if(f.size<2)return;var C=1,L=o(f.data.subarray(C),!0);C+=L.length+1;var R=o(f.data.subarray(C));return{key:f.type,info:L,data:R}}var O=o(f.data);return{key:f.type,data:O}},l=function(f){if(f.data.byteLength===8){var C=new Uint8Array(f.data),L=C[3]&1,R=(C[4]<<23)+(C[5]<<15)+(C[6]<<7)+C[7];return R/=45,L&&(R+=4772185884e-2),Math.round(R)}},o=function(f,C){C===void 0&&(C=!1);var L=_();if(L){var R=L.decode(f);if(C){var O=R.indexOf("\0");return O!==-1?R.substring(0,O):R}return R.replace(/\0/g,"")}for(var g=f.length,m,d,h,A="",w=0;w<g;){if(m=f[w++],m===0&&C)return A;if(m===0||m===3)continue;switch(m>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:A+=String.fromCharCode(m);break;case 12:case 13:d=f[w++],A+=String.fromCharCode((m&31)<<6|d&63);break;case 14:d=f[w++],h=f[w++],A+=String.fromCharCode((m&15)<<12|(d&63)<<6|(h&63)<<0);break;default:}}return A},u={decodeTextFrame:v},c;function _(){return!c&&typeof self.TextDecoder!="undefined"&&(c=new self.TextDecoder("utf-8")),c}},"./src/demux/mp3demuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>t});var P=S("./src/demux/base-audio-demuxer.ts"),T=S("./src/demux/id3.ts"),b=S("./src/utils/logger.ts"),e=S("./src/demux/mpegaudio.ts");function E(r,i){r.prototype=Object.create(i.prototype),r.prototype.constructor=r,s(r,i)}function s(r,i){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(v,p){return v.__proto__=p,v},s(r,i)}var n=function(r){E(i,r);function i(){return r.apply(this,arguments)||this}var a=i.prototype;return a.resetInitSegment=function(p,l,o,u){r.prototype.resetInitSegment.call(this,p,l,o,u),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:l,duration:u,inputTimeScale:9e4,dropped:0}},i.probe=function(p){if(!p)return!1;for(var l=T.getID3Data(p,0)||[],o=l.length,u=p.length;o<u;o++)if(e.probe(p,o))return b.logger.log("MPEG Audio sync word found !"),!0;return!1},a.canParse=function(p,l){return e.canParse(p,l)},a.appendFrame=function(p,l,o){if(this.basePTS!==null)return e.appendFrame(p,l,o,this.basePTS,this.frameIndex)},i}(P.default);const t=n},"./src/demux/mp4demuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>n});var P=S("./src/polyfills/number.ts"),T=S("./src/types/demuxer.ts"),b=S("./src/utils/mp4-tools.ts"),e=S("./src/demux/dummy-demuxed-track.ts"),E=/\/emsg[-/]ID3/i,s=function(){function t(i,a){this.remainderData=null,this.timeOffset=0,this.config=void 0,this.videoTrack=void 0,this.audioTrack=void 0,this.id3Track=void 0,this.txtTrack=void 0,this.config=a}var r=t.prototype;return r.resetTimeStamp=function(){},r.resetInitSegment=function(a,v,p,l){var o=this.videoTrack=(0,e.dummyTrack)("video",1),u=this.audioTrack=(0,e.dummyTrack)("audio",1),c=this.txtTrack=(0,e.dummyTrack)("text",1);if(this.id3Track=(0,e.dummyTrack)("id3",1),this.timeOffset=0,!(!a||!a.byteLength)){var _=(0,b.parseInitSegment)(a);if(_.video){var y=_.video,f=y.id,C=y.timescale,L=y.codec;o.id=f,o.timescale=c.timescale=C,o.codec=L}if(_.audio){var R=_.audio,O=R.id,g=R.timescale,m=R.codec;u.id=O,u.timescale=g,u.codec=m}c.id=b.RemuxerTrackIdConfig.text,o.sampleDuration=0,o.duration=u.duration=l}},r.resetContiguity=function(){},t.probe=function(a){return a=a.length>16384?a.subarray(0,16384):a,(0,b.findBox)(a,["moof"]).length>0},r.demux=function(a,v){this.timeOffset=v;var p=a,l=this.videoTrack,o=this.txtTrack;if(this.config.progressive){this.remainderData&&(p=(0,b.appendUint8Array)(this.remainderData,a));var u=(0,b.segmentValidRange)(p);this.remainderData=u.remainder,l.samples=u.valid||new Uint8Array}else l.samples=p;var c=this.extractID3Track(l,v);return o.samples=(0,b.parseSamples)(v,l),{videoTrack:l,audioTrack:this.audioTrack,id3Track:c,textTrack:this.txtTrack}},r.flush=function(){var a=this.timeOffset,v=this.videoTrack,p=this.txtTrack;v.samples=this.remainderData||new Uint8Array,this.remainderData=null;var l=this.extractID3Track(v,this.timeOffset);return p.samples=(0,b.parseSamples)(a,v),{videoTrack:v,audioTrack:(0,e.dummyTrack)(),id3Track:l,textTrack:(0,e.dummyTrack)()}},r.extractID3Track=function(a,v){var p=this.id3Track;if(a.samples.length){var l=(0,b.findBox)(a.samples,["emsg"]);l&&l.forEach(function(o){var u=(0,b.parseEmsg)(o);if(E.test(u.schemeIdUri)){var c=(0,P.isFiniteNumber)(u.presentationTime)?u.presentationTime/u.timeScale:v+u.presentationTimeDelta/u.timeScale,_=u.eventDuration===4294967295?Number.POSITIVE_INFINITY:u.eventDuration/u.timeScale;_<=.001&&(_=Number.POSITIVE_INFINITY);var y=u.payload;p.samples.push({data:y,len:y.byteLength,dts:c,pts:c,type:T.MetadataSchema.emsg,duration:_})}})}return p},r.demuxSampleAes=function(a,v,p){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))},r.destroy=function(){},t}();const n=s},"./src/demux/mpegaudio.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{appendFrame:()=>s,canParse:()=>i,isHeader:()=>r,isHeaderPattern:()=>t,parseHeader:()=>n,probe:()=>a});var P=null,T=[32,64,96,128,160,192,224,256,288,320,352,384,416,448,32,48,56,64,80,96,112,128,160,192,224,256,320,384,32,40,48,56,64,80,96,112,128,160,192,224,256,320,32,48,56,64,80,96,112,128,144,160,176,192,224,256,8,16,24,32,40,48,56,64,80,96,112,128,144,160],b=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],e=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],E=[0,1,1,4];function s(v,p,l,o,u){if(!(l+24>p.length)){var c=n(p,l);if(c&&l+c.frameLength<=p.length){var _=c.samplesPerFrame*9e4/c.sampleRate,y=o+u*_,f={unit:p.subarray(l,l+c.frameLength),pts:y,dts:y};return v.config=[],v.channelCount=c.channelCount,v.samplerate=c.sampleRate,v.samples.push(f),{sample:f,length:c.frameLength,missing:0}}}}function n(v,p){var l=v[p+1]>>3&3,o=v[p+1]>>1&3,u=v[p+2]>>4&15,c=v[p+2]>>2&3;if(l!==1&&u!==0&&u!==15&&c!==3){var _=v[p+2]>>1&1,y=v[p+3]>>6,f=l===3?3-o:o===3?3:4,C=T[f*14+u-1]*1e3,L=l===3?0:l===2?1:2,R=b[L*3+c],O=y===3?1:2,g=e[l][o],m=E[o],d=g*8*m,h=Math.floor(g*C/R+_)*m;if(P===null){var A=navigator.userAgent||"",w=A.match(/Chrome\/(\d+)/i);P=w?parseInt(w[1]):0}var x=!!P&&P<=87;return x&&o===2&&C>=224e3&&y===0&&(v[p+3]=v[p+3]|128),{sampleRate:R,channelCount:O,frameLength:h,samplesPerFrame:d}}}function t(v,p){return v[p]===255&&(v[p+1]&224)===224&&(v[p+1]&6)!==0}function r(v,p){return p+1<v.length&&t(v,p)}function i(v,p){var l=4;return t(v,p)&&l<=v.length-p}function a(v,p){if(p+1<v.length&&t(v,p)){var l=4,o=n(v,p),u=l;o!=null&&o.frameLength&&(u=o.frameLength);var c=p+u;return c===v.length||r(v,c)}return!1}},"./src/demux/sample-aes.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>e});var P=S("./src/crypt/decrypter.ts"),T=S("./src/utils/mp4-tools.ts"),b=function(){function E(n,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new P.default(t,{removePKCS7Padding:!1})}var s=E.prototype;return s.decryptBuffer=function(t){return this.decrypter.decrypt(t,this.keyData.key.buffer,this.keyData.iv.buffer)},s.decryptAacSample=function(t,r,i){var a=this,v=t[r].unit;if(!(v.length<=16)){var p=v.subarray(16,v.length-v.length%16),l=p.buffer.slice(p.byteOffset,p.byteOffset+p.length);this.decryptBuffer(l).then(function(o){var u=new Uint8Array(o);v.set(u,16),a.decrypter.isSync()||a.decryptAacSamples(t,r+1,i)})}},s.decryptAacSamples=function(t,r,i){for(;;r++){if(r>=t.length){i();return}if(!(t[r].unit.length<32)&&(this.decryptAacSample(t,r,i),!this.decrypter.isSync()))return}},s.getAvcEncryptedData=function(t){for(var r=Math.floor((t.length-48)/160)*16+16,i=new Int8Array(r),a=0,v=32;v<t.length-16;v+=160,a+=16)i.set(t.subarray(v,v+16),a);return i},s.getAvcDecryptedUnit=function(t,r){for(var i=new Uint8Array(r),a=0,v=32;v<t.length-16;v+=160,a+=16)t.set(i.subarray(a,a+16),v);return t},s.decryptAvcSample=function(t,r,i,a,v){var p=this,l=(0,T.discardEPB)(v.data),o=this.getAvcEncryptedData(l);this.decryptBuffer(o.buffer).then(function(u){v.data=p.getAvcDecryptedUnit(l,u),p.decrypter.isSync()||p.decryptAvcSamples(t,r,i+1,a)})},s.decryptAvcSamples=function(t,r,i,a){if(t instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;r++,i=0){if(r>=t.length){a();return}for(var v=t[r].units;!(i>=v.length);i++){var p=v[i];if(!(p.data.length<=48||p.type!==1&&p.type!==5)&&(this.decryptAvcSample(t,r,i,a,p),!this.decrypter.isSync()))return}}},E}();const e=b},"./src/demux/transmuxer-interface.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>i});var P=S("./src/demux/webworkify-webpack.js"),T=S("./src/events.ts"),b=S("./src/demux/transmuxer.ts"),e=S("./src/utils/logger.ts"),E=S("./src/errors.ts"),s=S("./src/utils/mediasource-helper.ts"),n=S("./node_modules/eventemitter3/index.js"),t=S.n(n),r=(0,s.getMediaSource)()||{isTypeSupported:function(){return!1}},i=function(){function a(p,l,o,u){var c=this;this.hls=void 0,this.id=void 0,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.worker=void 0,this.onwmsg=void 0,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0;var _=p.config;this.hls=p,this.id=l,this.useWorker=!!_.enableWorker,this.onTransmuxComplete=o,this.onFlush=u;var y=function(O,g){g=g||{},g.frag=c.frag,g.id=c.id,c.hls.trigger(O,g)};this.observer=new n.EventEmitter,this.observer.on(T.Events.FRAG_DECRYPTED,y),this.observer.on(T.Events.ERROR,y);var f={mp4:r.isTypeSupported("video/mp4"),mpeg:r.isTypeSupported("audio/mpeg"),mp3:r.isTypeSupported('audio/mp4; codecs="mp3"')},C=navigator.vendor;if(this.useWorker&&typeof Worker!="undefined"){e.logger.log("demuxing in webworker");var L;try{L=this.worker=(0,P.default)("./src/demux/transmuxer-worker.ts"),this.onwmsg=this.onWorkerMessage.bind(this),L.addEventListener("message",this.onwmsg),L.onerror=function(R){c.useWorker=!1,e.logger.warn("Exception in webworker, fallback to inline"),c.hls.trigger(T.Events.ERROR,{type:E.ErrorTypes.OTHER_ERROR,details:E.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:new Error(R.message+" ("+R.filename+":"+R.lineno+")")})},L.postMessage({cmd:"init",typeSupported:f,vendor:C,id:l,config:JSON.stringify(_)})}catch(R){e.logger.warn("Error in worker:",R),e.logger.error("Error while initializing DemuxerWorker, fallback to inline"),L&&self.URL.revokeObjectURL(L.objectURL),this.transmuxer=new b.default(this.observer,f,_,C,l),this.worker=null}}else this.transmuxer=new b.default(this.observer,f,_,C,l)}var v=a.prototype;return v.destroy=function(){var l=this.worker;if(l)l.removeEventListener("message",this.onwmsg),l.terminate(),this.worker=null,this.onwmsg=void 0;else{var o=this.transmuxer;o&&(o.destroy(),this.transmuxer=null)}var u=this.observer;u&&u.removeAllListeners(),this.frag=null,this.observer=null,this.hls=null},v.push=function(l,o,u,c,_,y,f,C,L,R){var O,g,m=this;L.transmuxing.start=self.performance.now();var d=this.transmuxer,h=this.worker,A=y?y.start:_.start,w=_.decryptdata,x=this.frag,D=!(x&&_.cc===x.cc),I=!(x&&L.level===x.level),F=x?L.sn-x.sn:-1,K=this.part?L.part-this.part.index:-1,W=F===0&&L.id>1&&L.id===(x==null?void 0:x.stats.chunkCount),z=!I&&(F===1||F===0&&(K===1||W&&K<=0)),j=self.performance.now();(I||F||_.stats.parsing.start===0)&&(_.stats.parsing.start=j),y&&(K||!z)&&(y.stats.parsing.start=j);var G=!(x&&((O=_.initSegment)===null||O===void 0?void 0:O.url)===((g=x.initSegment)===null||g===void 0?void 0:g.url)),Z=new b.TransmuxState(D,z,C,I,A,G);if(!z||D||G){e.logger.log("[transmuxer-interface, "+_.type+"]: Starting new transmux session for sn: "+L.sn+" p: "+L.part+" level: "+L.level+" id: "+L.id+`
discontinuity: `+D+`
trackSwitch: `+I+`
contiguous: `+z+`
accurateTimeOffset: `+C+`
timeOffset: `+A+`
initSegmentChange: `+G);var Q=new b.TransmuxConfig(u,c,o,f,R);this.configureTransmuxer(Q)}if(this.frag=_,this.part=y,h)h.postMessage({cmd:"demux",data:l,decryptdata:w,chunkMeta:L,state:Z},l instanceof ArrayBuffer?[l]:[]);else if(d){var ue=d.push(l,w,L,Z);(0,b.isPromise)(ue)?(d.async=!0,ue.then(function(ee){m.handleTransmuxComplete(ee)}).catch(function(ee){m.transmuxerError(ee,L,"transmuxer-interface push error")})):(d.async=!1,this.handleTransmuxComplete(ue))}},v.flush=function(l){var o=this;l.transmuxing.start=self.performance.now();var u=this.transmuxer,c=this.worker;if(c)c.postMessage({cmd:"flush",chunkMeta:l});else if(u){var _=u.flush(l),y=(0,b.isPromise)(_);y||u.async?((0,b.isPromise)(_)||(_=Promise.resolve(_)),_.then(function(f){o.handleFlushResult(f,l)}).catch(function(f){o.transmuxerError(f,l,"transmuxer-interface flush error")})):this.handleFlushResult(_,l)}},v.transmuxerError=function(l,o,u){this.hls&&this.hls.trigger(T.Events.ERROR,{type:E.ErrorTypes.MEDIA_ERROR,details:E.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:o,fatal:!1,error:l,err:l,reason:u})},v.handleFlushResult=function(l,o){var u=this;l.forEach(function(c){u.handleTransmuxComplete(c)}),this.onFlush(o)},v.onWorkerMessage=function(l){var o=l.data,u=this.hls;switch(o.event){case"init":{self.URL.revokeObjectURL(this.worker.objectURL);break}case"transmuxComplete":{this.handleTransmuxComplete(o.data);break}case"flush":{this.onFlush(o.data);break}case"workerLog":e.logger[o.data.logType]&&e.logger[o.data.logType](o.data.message);break;default:{o.data=o.data||{},o.data.frag=this.frag,o.data.id=this.id,u.trigger(o.event,o.data);break}}},v.configureTransmuxer=function(l){var o=this.worker,u=this.transmuxer;o?o.postMessage({cmd:"configure",config:l}):u&&u.configure(l)},v.handleTransmuxComplete=function(l){l.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(l)},a}()},"./src/demux/transmuxer-worker.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>n});var P=S("./src/demux/transmuxer.ts"),T=S("./src/events.ts"),b=S("./src/utils/logger.ts"),e=S("./node_modules/eventemitter3/index.js"),E=S.n(e),s=S("./src/errors.ts");function n(v){var p=new e.EventEmitter,l=function(c,_){v.postMessage({event:c,data:_})};p.on(T.Events.FRAG_DECRYPTED,l),p.on(T.Events.ERROR,l);var o=function(){var c=function(f){var C=function(R){l("workerLog",{logType:f,message:R})};b.logger[f]=C};for(var _ in b.logger)c(_)};v.addEventListener("message",function(u){var c=u.data;switch(c.cmd){case"init":{var _=JSON.parse(c.config);v.transmuxer=new P.default(p,c.typeSupported,_,c.vendor,c.id),(0,b.enableLogs)(_.debug,c.id),o(),l("init",null);break}case"configure":{v.transmuxer.configure(c.config);break}case"demux":{var y=v.transmuxer.push(c.data,c.decryptdata,c.chunkMeta,c.state);(0,P.isPromise)(y)?(v.transmuxer.async=!0,y.then(function(R){t(v,R)}).catch(function(R){l(T.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:c.chunkMeta,fatal:!1,error:R,err:R,reason:"transmuxer-worker push error"})})):(v.transmuxer.async=!1,t(v,y));break}case"flush":{var f=c.chunkMeta,C=v.transmuxer.flush(f),L=(0,P.isPromise)(C);L||v.transmuxer.async?((0,P.isPromise)(C)||(C=Promise.resolve(C)),C.then(function(R){i(v,R,f)}).catch(function(R){l(T.Events.ERROR,{type:s.ErrorTypes.MEDIA_ERROR,details:s.ErrorDetails.FRAG_PARSING_ERROR,chunkMeta:c.chunkMeta,fatal:!1,error:R,err:R,reason:"transmuxer-worker flush error"})})):i(v,C,f);break}default:break}})}function t(v,p){if(a(p.remuxResult))return!1;var l=[],o=p.remuxResult,u=o.audio,c=o.video;return u&&r(l,u),c&&r(l,c),v.postMessage({event:"transmuxComplete",data:p},l),!0}function r(v,p){p.data1&&v.push(p.data1.buffer),p.data2&&v.push(p.data2.buffer)}function i(v,p,l){var o=p.reduce(function(u,c){return t(v,c)||u},!1);o||v.postMessage({event:"transmuxComplete",data:p[0]}),v.postMessage({event:"flush",data:l})}function a(v){return!v.audio&&!v.video&&!v.text&&!v.id3&&!v.initSegment}},"./src/demux/transmuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{TransmuxConfig:()=>c,TransmuxState:()=>_,default:()=>p,isPromise:()=>u});var P=S("./src/events.ts"),T=S("./src/errors.ts"),b=S("./src/crypt/decrypter.ts"),e=S("./src/demux/aacdemuxer.ts"),E=S("./src/demux/mp4demuxer.ts"),s=S("./src/demux/tsdemuxer.ts"),n=S("./src/demux/mp3demuxer.ts"),t=S("./src/remux/mp4-remuxer.ts"),r=S("./src/remux/passthrough-remuxer.ts"),i=S("./src/utils/logger.ts"),a;try{a=self.performance.now.bind(self.performance)}catch(y){i.logger.debug("Unable to use Performance API on this environment"),a=self.Date.now}var v=[{demux:E.default,remux:r.default},{demux:s.default,remux:t.default},{demux:e.default,remux:t.default},{demux:n.default,remux:t.default}],p=function(){function y(C,L,R,O,g){this.async=!1,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.observer=C,this.typeSupported=L,this.config=R,this.vendor=O,this.id=g}var f=y.prototype;return f.configure=function(L){this.transmuxConfig=L,this.decrypter&&this.decrypter.reset()},f.push=function(L,R,O,g){var m=this,d=O.transmuxing;d.executeStart=a();var h=new Uint8Array(L),A=this.currentTransmuxState,w=this.transmuxConfig;g&&(this.currentTransmuxState=g);var x=g||A,D=x.contiguous,I=x.discontinuity,F=x.trackSwitch,K=x.accurateTimeOffset,W=x.timeOffset,z=x.initSegmentChange,j=w.audioCodec,G=w.videoCodec,Z=w.defaultInitPts,Q=w.duration,ue=w.initSegmentData,ee=l(h,R);if(ee&&ee.method==="AES-128"){var ae=this.getDecrypter();if(ae.isSync()){var _e=ae.softwareDecrypt(h,ee.key.buffer,ee.iv.buffer),xe=O.part>-1;if(xe&&(_e=ae.flush()),!_e)return d.executeEnd=a(),o(O);h=new Uint8Array(_e)}else return this.decryptionPromise=ae.webCryptoDecrypt(h,ee.key.buffer,ee.iv.buffer).then(function(Se){var Te=m.push(Se,null,O);return m.decryptionPromise=null,Te}),this.decryptionPromise}var ge=this.needsProbing(I,F);ge&&this.configureTransmuxer(h),(I||F||z||ge)&&this.resetInitSegment(ue,j,G,Q,R),(I||z||ge)&&this.resetInitialTimestamp(Z),D||this.resetContiguity();var ce=this.transmux(h,ee,W,K,O),he=this.currentTransmuxState;return he.contiguous=!0,he.discontinuity=!1,he.trackSwitch=!1,d.executeEnd=a(),ce},f.flush=function(L){var R=this,O=L.transmuxing;O.executeStart=a();var g=this.decrypter,m=this.currentTransmuxState,d=this.decryptionPromise;if(d)return d.then(function(){return R.flush(L)});var h=[],A=m.timeOffset;if(g){var w=g.flush();w&&h.push(this.push(w,null,L))}var x=this.demuxer,D=this.remuxer;if(!x||!D)return this.observer.emit(P.Events.ERROR,P.Events.ERROR,{type:T.ErrorTypes.MEDIA_ERROR,details:T.ErrorDetails.FRAG_PARSING_ERROR,fatal:!0,reason:"no demux matching with content found"}),O.executeEnd=a(),[o(L)];var I=x.flush(A);return u(I)?I.then(function(F){return R.flushRemux(h,F,L),h}):(this.flushRemux(h,I,L),h)},f.flushRemux=function(L,R,O){var g=R.audioTrack,m=R.videoTrack,d=R.id3Track,h=R.textTrack,A=this.currentTransmuxState,w=A.accurateTimeOffset,x=A.timeOffset;i.logger.log("[transmuxer.ts]: Flushed fragment "+O.sn+(O.part>-1?" p: "+O.part:"")+" of level "+O.level);var D=this.remuxer.remux(g,m,d,h,x,w,!0,this.id);L.push({remuxResult:D,chunkMeta:O}),O.transmuxing.executeEnd=a()},f.resetInitialTimestamp=function(L){var R=this.demuxer,O=this.remuxer;!R||!O||(R.resetTimeStamp(L),O.resetTimeStamp(L))},f.resetContiguity=function(){var L=this.demuxer,R=this.remuxer;!L||!R||(L.resetContiguity(),R.resetNextTimestamp())},f.resetInitSegment=function(L,R,O,g,m){var d=this.demuxer,h=this.remuxer;!d||!h||(d.resetInitSegment(L,R,O,g),h.resetInitSegment(L,R,O,m))},f.destroy=function(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)},f.transmux=function(L,R,O,g,m){var d;return R&&R.method==="SAMPLE-AES"?d=this.transmuxSampleAes(L,R,O,g,m):d=this.transmuxUnencrypted(L,O,g,m),d},f.transmuxUnencrypted=function(L,R,O,g){var m=this.demuxer.demux(L,R,!1,!this.config.progressive),d=m.audioTrack,h=m.videoTrack,A=m.id3Track,w=m.textTrack,x=this.remuxer.remux(d,h,A,w,R,O,!1,this.id);return{remuxResult:x,chunkMeta:g}},f.transmuxSampleAes=function(L,R,O,g,m){var d=this;return this.demuxer.demuxSampleAes(L,R,O).then(function(h){var A=d.remuxer.remux(h.audioTrack,h.videoTrack,h.id3Track,h.textTrack,O,g,!1,d.id);return{remuxResult:A,chunkMeta:m}})},f.configureTransmuxer=function(L){for(var R=this.config,O=this.observer,g=this.typeSupported,m=this.vendor,d,h=0,A=v.length;h<A;h++)if(v[h].demux.probe(L)){d=v[h];break}d||(i.logger.warn("Failed to find demuxer by probing frag, treating as mp4 passthrough"),d={demux:E.default,remux:r.default});var w=this.demuxer,x=this.remuxer,D=d.remux,I=d.demux;(!x||!(x instanceof D))&&(this.remuxer=new D(O,R,g,m)),(!w||!(w instanceof I))&&(this.demuxer=new I(O,R,g),this.probe=I.probe)},f.needsProbing=function(L,R){return!this.demuxer||!this.remuxer||L||R},f.getDecrypter=function(){var L=this.decrypter;return L||(L=this.decrypter=new b.default(this.config)),L},y}();function l(y,f){var C=null;return y.byteLength>0&&f!=null&&f.key!=null&&f.iv!==null&&f.method!=null&&(C=f),C}var o=function(f){return{remuxResult:{},chunkMeta:f}};function u(y){return"then"in y&&y.then instanceof Function}var c=function(f,C,L,R,O){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=f,this.videoCodec=C,this.initSegmentData=L,this.duration=R,this.defaultInitPts=O},_=function(f,C,L,R,O,g){this.discontinuity=void 0,this.contiguous=void 0,this.accurateTimeOffset=void 0,this.trackSwitch=void 0,this.timeOffset=void 0,this.initSegmentChange=void 0,this.discontinuity=f,this.contiguous=C,this.accurateTimeOffset=L,this.trackSwitch=R,this.timeOffset=O,this.initSegmentChange=g}},"./src/demux/tsdemuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>y});var P=S("./src/demux/adts.ts"),T=S("./src/demux/mpegaudio.ts"),b=S("./src/demux/exp-golomb.ts"),e=S("./src/demux/sample-aes.ts"),E=S("./src/events.ts"),s=S("./src/utils/mp4-tools.ts"),n=S("./src/utils/logger.ts"),t=S("./src/errors.ts"),r=S("./src/types/demuxer.ts");function i(){return i=Object.assign?Object.assign.bind():function(f){for(var C=1;C<arguments.length;C++){var L=arguments[C];for(var R in L)Object.prototype.hasOwnProperty.call(L,R)&&(f[R]=L[R])}return f},i.apply(this,arguments)}var a=188,v=function(){function f(L,R,O){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._pmtId=-1,this._avcTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.observer=L,this.config=R,this.typeSupported=O}f.probe=function(R){var O=f.syncOffset(R);return O>0&&n.logger.warn("MPEG2-TS detected but first sync word found @ offset "+O),O!==-1},f.syncOffset=function(R){for(var O=R.length,g=Math.min(a*5,R.length-a)+1,m=0;m<g;){for(var d=!1,h=m;h<O&&R[h]===71;h+=a)if(!d&&l(R,h)===0&&(d=!0),d&&h+a>g)return m;m++}return-1},f.createTrack=function(R,O){return{container:R==="video"||R==="audio"?"video/mp2t":void 0,type:R,id:s.RemuxerTrackIdConfig[R],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:R==="audio"?O:void 0}};var C=f.prototype;return C.resetInitSegment=function(R,O,g,m){this.pmtParsed=!1,this._pmtId=-1,this._avcTrack=f.createTrack("video"),this._audioTrack=f.createTrack("audio",m),this._id3Track=f.createTrack("id3"),this._txtTrack=f.createTrack("text"),this._audioTrack.segmentCodec="aac",this.aacOverFlow=null,this.avcSample=null,this.remainderData=null,this.audioCodec=O,this.videoCodec=g,this._duration=m},C.resetTimeStamp=function(){},C.resetContiguity=function(){var R=this._audioTrack,O=this._avcTrack,g=this._id3Track;R&&(R.pesData=null),O&&(O.pesData=null),g&&(g.pesData=null),this.aacOverFlow=null,this.avcSample=null,this.remainderData=null},C.demux=function(R,O,g,m){g===void 0&&(g=!1),m===void 0&&(m=!1),g||(this.sampleAes=null);var d,h=this._avcTrack,A=this._audioTrack,w=this._id3Track,x=this._txtTrack,D=h.pid,I=h.pesData,F=A.pid,K=w.pid,W=A.pesData,z=w.pesData,j=null,G=this.pmtParsed,Z=this._pmtId,Q=R.length;if(this.remainderData&&(R=(0,s.appendUint8Array)(this.remainderData,R),Q=R.length,this.remainderData=null),Q<a&&!m)return this.remainderData=R,{audioTrack:A,videoTrack:h,id3Track:w,textTrack:x};var ue=Math.max(0,f.syncOffset(R));Q-=(Q-ue)%a,Q<R.byteLength&&!m&&(this.remainderData=new Uint8Array(R.buffer,Q,R.buffer.byteLength-Q));for(var ee=0,ae=ue;ae<Q;ae+=a)if(R[ae]===71){var _e=!!(R[ae+1]&64),xe=l(R,ae),ge=(R[ae+3]&48)>>4,ce=void 0;if(ge>1){if(ce=ae+5+R[ae+4],ce===ae+a)continue}else ce=ae+4;switch(xe){case D:_e&&(I&&(d=c(I))&&this.parseAVCPES(h,x,d,!1),I={data:[],size:0}),I&&(I.data.push(R.subarray(ce,ae+a)),I.size+=ae+a-ce);break;case F:if(_e){if(W&&(d=c(W)))switch(A.segmentCodec){case"aac":this.parseAACPES(A,d);break;case"mp3":this.parseMPEGPES(A,d);break}W={data:[],size:0}}W&&(W.data.push(R.subarray(ce,ae+a)),W.size+=ae+a-ce);break;case K:_e&&(z&&(d=c(z))&&this.parseID3PES(w,d),z={data:[],size:0}),z&&(z.data.push(R.subarray(ce,ae+a)),z.size+=ae+a-ce);break;case 0:_e&&(ce+=R[ce]+1),Z=this._pmtId=o(R,ce);break;case Z:{_e&&(ce+=R[ce]+1);var he=u(R,ce,this.typeSupported,g);D=he.avc,D>0&&(h.pid=D),F=he.audio,F>0&&(A.pid=F,A.segmentCodec=he.segmentCodec),K=he.id3,K>0&&(w.pid=K),j!==null&&!G&&(n.logger.warn("MPEG-TS PMT found at "+ae+" after unknown PID '"+j+"'. Backtracking to sync byte @"+ue+" to parse all TS packets."),j=null,ae=ue-188),G=this.pmtParsed=!0;break}case 17:case 8191:break;default:j=xe;break}}else ee++;ee>0&&this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:t.ErrorTypes.MEDIA_ERROR,details:t.ErrorDetails.FRAG_PARSING_ERROR,fatal:!1,reason:"Found "+ee+" TS packet/s that do not start with 0x47"}),h.pesData=I,A.pesData=W,w.pesData=z;var Se={audioTrack:A,videoTrack:h,id3Track:w,textTrack:x};return m&&this.extractRemainingSamples(Se),Se},C.flush=function(){var R=this.remainderData;this.remainderData=null;var O;return R?O=this.demux(R,-1,!1,!0):O={videoTrack:this._avcTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(O),this.sampleAes?this.decrypt(O,this.sampleAes):O},C.extractRemainingSamples=function(R){var O=R.audioTrack,g=R.videoTrack,m=R.id3Track,d=R.textTrack,h=g.pesData,A=O.pesData,w=m.pesData,x;if(h&&(x=c(h))?(this.parseAVCPES(g,d,x,!0),g.pesData=null):g.pesData=h,A&&(x=c(A))){switch(O.segmentCodec){case"aac":this.parseAACPES(O,x);break;case"mp3":this.parseMPEGPES(O,x);break}O.pesData=null}else A!=null&&A.size&&n.logger.log("last AAC PES packet truncated,might overlap between fragments"),O.pesData=A;w&&(x=c(w))?(this.parseID3PES(m,x),m.pesData=null):m.pesData=w},C.demuxSampleAes=function(R,O,g){var m=this.demux(R,g,!0,!this.config.progressive),d=this.sampleAes=new e.default(this.observer,this.config,O);return this.decrypt(m,d)},C.decrypt=function(R,O){return new Promise(function(g){var m=R.audioTrack,d=R.videoTrack;m.samples&&m.segmentCodec==="aac"?O.decryptAacSamples(m.samples,0,function(){d.samples?O.decryptAvcSamples(d.samples,0,0,function(){g(R)}):g(R)}):d.samples&&O.decryptAvcSamples(d.samples,0,0,function(){g(R)})})},C.destroy=function(){this._duration=0},C.parseAVCPES=function(R,O,g,m){var d=this,h=this.parseAVCNALu(R,g.data),A=!1,w=this.avcSample,x,D=!1;g.data=null,w&&h.length&&!R.audFound&&(_(w,R),w=this.avcSample=p(!1,g.pts,g.dts,"")),h.forEach(function(I){switch(I.type){case 1:{x=!0,w||(w=d.avcSample=p(!0,g.pts,g.dts,"")),A&&(w.debug+="NDR "),w.frame=!0;var F=I.data;if(D&&F.length>4){var K=new b.default(F).readSliceType();(K===2||K===4||K===7||K===9)&&(w.key=!0)}break}case 5:x=!0,w||(w=d.avcSample=p(!0,g.pts,g.dts,"")),A&&(w.debug+="IDR "),w.key=!0,w.frame=!0;break;case 6:{x=!0,A&&w&&(w.debug+="SEI "),(0,s.parseSEIMessageFromNALu)(I.data,1,g.pts,O.samples);break}case 7:if(x=!0,D=!0,A&&w&&(w.debug+="SPS "),!R.sps){var W=new b.default(I.data),z=W.readSPS();R.width=z.width,R.height=z.height,R.pixelRatio=z.pixelRatio,R.sps=[I.data],R.duration=d._duration;for(var j=I.data.subarray(1,4),G="avc1.",Z=0;Z<3;Z++){var Q=j[Z].toString(16);Q.length<2&&(Q="0"+Q),G+=Q}R.codec=G}break;case 8:x=!0,A&&w&&(w.debug+="PPS "),R.pps||(R.pps=[I.data]);break;case 9:x=!1,R.audFound=!0,w&&_(w,R),w=d.avcSample=p(!1,g.pts,g.dts,A?"AUD ":"");break;case 12:x=!0;break;default:x=!1,w&&(w.debug+="unknown NAL "+I.type+" ");break}if(w&&x){var ue=w.units;ue.push(I)}}),m&&w&&(_(w,R),this.avcSample=null)},C.getLastNalUnit=function(R){var O,g=this.avcSample,m;if((!g||g.units.length===0)&&(g=R[R.length-1]),(O=g)!==null&&O!==void 0&&O.units){var d=g.units;m=d[d.length-1]}return m},C.parseAVCNALu=function(R,O){var g=O.byteLength,m=R.naluState||0,d=m,h=[],A=0,w,x,D,I=-1,F=0;for(m===-1&&(I=0,F=O[0]&31,m=0,A=1);A<g;){if(w=O[A++],!m){m=w?0:1;continue}if(m===1){m=w?0:2;continue}if(!w)m=3;else if(w===1){if(I>=0){var K={data:O.subarray(I,A-m-1),type:F};h.push(K)}else{var W=this.getLastNalUnit(R.samples);if(W&&(d&&A<=4-d&&W.state&&(W.data=W.data.subarray(0,W.data.byteLength-d)),x=A-m-1,x>0)){var z=new Uint8Array(W.data.byteLength+x);z.set(W.data,0),z.set(O.subarray(0,x),W.data.byteLength),W.data=z,W.state=0}}A<g?(D=O[A]&31,I=A,F=D,m=0):m=-1}else m=0}if(I>=0&&m>=0){var j={data:O.subarray(I,g),type:F,state:m};h.push(j)}if(h.length===0){var G=this.getLastNalUnit(R.samples);if(G){var Z=new Uint8Array(G.data.byteLength+O.byteLength);Z.set(G.data,0),Z.set(O,G.data.byteLength),G.data=Z}}return R.naluState=m,h},C.parseAACPES=function(R,O){var g=0,m=this.aacOverFlow,d=O.data;if(m){this.aacOverFlow=null;var h=m.missing,A=m.sample.unit.byteLength;if(h===-1){var w=new Uint8Array(A+d.byteLength);w.set(m.sample.unit,0),w.set(d,A),d=w}else{var x=A-h;m.sample.unit.set(d.subarray(0,h),x),R.samples.push(m.sample),g=m.missing}}var D,I;for(D=g,I=d.length;D<I-1&&!P.isHeader(d,D);D++);if(D!==g){var F,K;if(D<I-1?(F="AAC PES did not start with ADTS header,offset:"+D,K=!1):(F="no ADTS header found in AAC PES",K=!0),n.logger.warn("parsing error:"+F),this.observer.emit(E.Events.ERROR,E.Events.ERROR,{type:t.ErrorTypes.MEDIA_ERROR,details:t.ErrorDetails.FRAG_PARSING_ERROR,fatal:K,reason:F}),K)return}P.initTrackConfig(R,this.observer,d,D,this.audioCodec);var W;if(O.pts!==void 0)W=O.pts;else if(m){var z=P.getFrameDuration(R.samplerate);W=m.sample.pts+z}else{n.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}for(var j=0,G;D<I;)if(G=P.appendFrame(R,d,D,W,j),D+=G.length,G.missing){this.aacOverFlow=G;break}else for(j++;D<I-1&&!P.isHeader(d,D);D++);},C.parseMPEGPES=function(R,O){var g=O.data,m=g.length,d=0,h=0,A=O.pts;if(A===void 0){n.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;h<m;)if(T.isHeader(g,h)){var w=T.appendFrame(R,g,h,A,d);if(w)h+=w.length,d++;else break}else h++},C.parseID3PES=function(R,O){if(O.pts===void 0){n.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}var g=i({},O,{type:this._avcTrack?r.MetadataSchema.emsg:r.MetadataSchema.audioId3,duration:Number.POSITIVE_INFINITY});R.samples.push(g)},f}();function p(f,C,L,R){return{key:f,frame:!1,pts:C,dts:L,units:[],debug:R,length:0}}function l(f,C){return((f[C+1]&31)<<8)+f[C+2]}function o(f,C){return(f[C+10]&31)<<8|f[C+11]}function u(f,C,L,R){var O={audio:-1,avc:-1,id3:-1,segmentCodec:"aac"},g=(f[C+1]&15)<<8|f[C+2],m=C+3+g-4,d=(f[C+10]&15)<<8|f[C+11];for(C+=12+d;C<m;){var h=l(f,C);switch(f[C]){case 207:if(!R){n.logger.log("ADTS AAC with AES-128-CBC frame encryption found in unencrypted stream");break}case 15:O.audio===-1&&(O.audio=h);break;case 21:O.id3===-1&&(O.id3=h);break;case 219:if(!R){n.logger.log("H.264 with AES-128-CBC slice encryption found in unencrypted stream");break}case 27:O.avc===-1&&(O.avc=h);break;case 3:case 4:L.mpeg!==!0&&L.mp3!==!0?n.logger.log("MPEG audio found, not supported in this browser"):O.audio===-1&&(O.audio=h,O.segmentCodec="mp3");break;case 36:n.logger.warn("Unsupported HEVC stream type found");break;default:break}C+=((f[C+3]&15)<<8|f[C+4])+5}return O}function c(f){var C=0,L,R,O,g,m,d=f.data;if(!f||f.size===0)return null;for(;d[0].length<19&&d.length>1;){var h=new Uint8Array(d[0].length+d[1].length);h.set(d[0]),h.set(d[1],d[0].length),d[0]=h,d.splice(1,1)}L=d[0];var A=(L[0]<<16)+(L[1]<<8)+L[2];if(A===1){if(R=(L[4]<<8)+L[5],R&&R>f.size-6)return null;var w=L[7];w&192&&(g=(L[9]&14)*536870912+(L[10]&255)*4194304+(L[11]&254)*16384+(L[12]&255)*128+(L[13]&254)/2,w&64?(m=(L[14]&14)*536870912+(L[15]&255)*4194304+(L[16]&254)*16384+(L[17]&255)*128+(L[18]&254)/2,g-m>54e5&&(n.logger.warn(Math.round((g-m)/9e4)+"s delta between PTS and DTS, align them"),g=m)):m=g),O=L[8];var x=O+9;if(f.size<=x)return null;f.size-=x;for(var D=new Uint8Array(f.size),I=0,F=d.length;I<F;I++){L=d[I];var K=L.byteLength;if(x)if(x>K){x-=K;continue}else L=L.subarray(x),K-=x,x=0;D.set(L,C),C+=K}return R&&(R-=O+3),{data:D,pts:g,dts:m,len:R}}return null}function _(f,C){if(f.units.length&&f.frame){if(f.pts===void 0){var L=C.samples,R=L.length;if(R){var O=L[R-1];f.pts=O.pts,f.dts=O.dts}else{C.dropped++;return}}C.samples.push(f)}f.debug.length&&n.logger.log(f.pts+"/"+f.dts+":"+f.debug)}const y=v},"./src/demux/webworkify-webpack.js":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>a});var P=function(){var p=ENTRY_MODULE,l={},o=function c(_){var y=l[_];if(y!==void 0)return y.exports;var f=l[_]={exports:{}};return p[_].call(f.exports,f,f.exports,c),f.exports};o.m=p,function(){o.n=function(c){var _=c&&c.__esModule?function(){return c.default}:function(){return c};return o.d(_,{a:_}),_}}(),function(){o.d=function(c,_){for(var y in _)o.o(_,y)&&!o.o(c,y)&&Object.defineProperty(c,y,{enumerable:!0,get:_[y]})}}(),function(){o.o=function(c,_){return Object.prototype.hasOwnProperty.call(c,_)}}(),function(){o.r=function(c){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(c,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(c,"__esModule",{value:!0})}}();var u=o(ENTRY_MODULE);return u.default||u},T=P.toString().split("ENTRY_MODULE"),b="[\\.|\\-|\\+|\\w|/|@]+",e="\\(\\s*(/\\*.*?\\*/)?\\s*.*?("+b+").*?\\)";function E(v){return(v+"").replace(/[.?*+^$[\]\\(){}|-]/g,"\\$&")}function s(v){return!isNaN(1*v)}function n(v,p,l){var o={};o[l]=[];var u=p.toString().replace(/^"[^"]+"/,"function"),c=u.match(/^function\s?\w*\(\w+,\s*\w+,\s*(\w+)\)/)||u.match(/^\(\w+,\s*\w+,\s*(\w+)\)\s?\=\s?\>/);if(!c)return o;for(var _=c[1],y=new RegExp("(\\\\n|\\W)"+E(_)+e,"g"),f;f=y.exec(u);)f[3]!=="dll-reference"&&o[l].push(f[3]);for(y=new RegExp("\\("+E(_)+'\\("(dll-reference\\s('+b+'))"\\)\\)'+e,"g");f=y.exec(u);)v[f[2]]||(o[l].push(f[1]),v[f[2]]=S(f[1]).m),o[f[2]]=o[f[2]]||[],o[f[2]].push(f[4]);for(var C=Object.keys(o),L=0;L<C.length;L++)for(var R=0;R<o[C[L]].length;R++)s(o[C[L]][R])&&(o[C[L]][R]=1*o[C[L]][R]);return o}function t(v){var p=Object.keys(v);return p.reduce(function(l,o){return l||v[o].length>0},!1)}function r(v,p){for(var l={main:[p]},o={main:[]},u={main:{}};t(l);)for(var c=Object.keys(l),_=0;_<c.length;_++){var y=c[_],f=l[y],C=f.pop();if(u[y]=u[y]||{},!(u[y][C]||!v[y][C])){u[y][C]=!0,o[y]=o[y]||[],o[y].push(C);for(var L=n(v,v[y][C],y),R=Object.keys(L),O=0;O<R.length;O++)l[R[O]]=l[R[O]]||[],l[R[O]]=l[R[O]].concat(L[R[O]])}}return o}function i(v,p,l,o){var u=v[o].map(function(c){return'"'+c+'": '+p[o][c].toString().replace(/^"[^"]+"/,"function")}).join(",");return T[0]+"{"+u+"}"+T[1]+'"'+l+'"'+T[2]}function a(v,p){p=p||{};var l={main:S.m},o=p.all?{main:Object.keys(l.main)}:r(l,v),u="";Object.keys(o).filter(function(C){return C!=="main"}).forEach(function(C){for(var L=0;o[C][L];)L++;o[C].push(L),l[C][L]="(function(module, exports, __webpack_require__) { module.exports = __webpack_require__; })",u=u+("var "+C+" = ("+i(o,l,L,modules)+`)();
`)}),u=u+("new (("+i(o,l,v,"main")+")())(self);");var c=new window.Blob([u],{type:"text/javascript"}),_=window.URL||window.webkitURL||window.mozURL||window.msURL,y=_.createObjectURL(c),f=new window.Worker(y);return f.objectURL=y,f}},"./src/errors.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{ErrorDetails:()=>T,ErrorTypes:()=>P});var P;(function(b){b.NETWORK_ERROR="networkError",b.MEDIA_ERROR="mediaError",b.KEY_SYSTEM_ERROR="keySystemError",b.MUX_ERROR="muxError",b.OTHER_ERROR="otherError"})(P||(P={}));var T;(function(b){b.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",b.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",b.KEY_SYSTEM_NO_SESSION="keySystemNoSession",b.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",b.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",b.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",b.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",b.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",b.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",b.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",b.MANIFEST_LOAD_ERROR="manifestLoadError",b.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",b.MANIFEST_PARSING_ERROR="manifestParsingError",b.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",b.LEVEL_EMPTY_ERROR="levelEmptyError",b.LEVEL_LOAD_ERROR="levelLoadError",b.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",b.LEVEL_SWITCH_ERROR="levelSwitchError",b.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",b.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",b.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",b.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",b.FRAG_LOAD_ERROR="fragLoadError",b.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",b.FRAG_DECRYPT_ERROR="fragDecryptError",b.FRAG_PARSING_ERROR="fragParsingError",b.REMUX_ALLOC_ERROR="remuxAllocError",b.KEY_LOAD_ERROR="keyLoadError",b.KEY_LOAD_TIMEOUT="keyLoadTimeOut",b.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",b.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",b.BUFFER_APPEND_ERROR="bufferAppendError",b.BUFFER_APPENDING_ERROR="bufferAppendingError",b.BUFFER_STALLED_ERROR="bufferStalledError",b.BUFFER_FULL_ERROR="bufferFullError",b.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",b.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",b.INTERNAL_EXCEPTION="internalException",b.INTERNAL_ABORTED="aborted",b.UNKNOWN="unknown"})(T||(T={}))},"./src/events.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{Events:()=>P});var P;(function(T){T.MEDIA_ATTACHING="hlsMediaAttaching",T.MEDIA_ATTACHED="hlsMediaAttached",T.MEDIA_DETACHING="hlsMediaDetaching",T.MEDIA_DETACHED="hlsMediaDetached",T.BUFFER_RESET="hlsBufferReset",T.BUFFER_CODECS="hlsBufferCodecs",T.BUFFER_CREATED="hlsBufferCreated",T.BUFFER_APPENDING="hlsBufferAppending",T.BUFFER_APPENDED="hlsBufferAppended",T.BUFFER_EOS="hlsBufferEos",T.BUFFER_FLUSHING="hlsBufferFlushing",T.BUFFER_FLUSHED="hlsBufferFlushed",T.MANIFEST_LOADING="hlsManifestLoading",T.MANIFEST_LOADED="hlsManifestLoaded",T.MANIFEST_PARSED="hlsManifestParsed",T.LEVEL_SWITCHING="hlsLevelSwitching",T.LEVEL_SWITCHED="hlsLevelSwitched",T.LEVEL_LOADING="hlsLevelLoading",T.LEVEL_LOADED="hlsLevelLoaded",T.LEVEL_UPDATED="hlsLevelUpdated",T.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",T.LEVELS_UPDATED="hlsLevelsUpdated",T.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",T.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",T.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",T.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",T.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",T.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",T.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",T.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",T.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",T.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",T.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",T.CUES_PARSED="hlsCuesParsed",T.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",T.INIT_PTS_FOUND="hlsInitPtsFound",T.FRAG_LOADING="hlsFragLoading",T.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",T.FRAG_LOADED="hlsFragLoaded",T.FRAG_DECRYPTED="hlsFragDecrypted",T.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",T.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",T.FRAG_PARSING_METADATA="hlsFragParsingMetadata",T.FRAG_PARSED="hlsFragParsed",T.FRAG_BUFFERED="hlsFragBuffered",T.FRAG_CHANGED="hlsFragChanged",T.FPS_DROP="hlsFpsDrop",T.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",T.ERROR="hlsError",T.DESTROYING="hlsDestroying",T.KEY_LOADING="hlsKeyLoading",T.KEY_LOADED="hlsKeyLoaded",T.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",T.BACK_BUFFER_REACHED="hlsBackBufferReached"})(P||(P={}))},"./src/hls.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>L});var P=S("./node_modules/url-toolkit/src/url-toolkit.js"),T=S.n(P),b=S("./src/loader/playlist-loader.ts"),e=S("./src/controller/id3-track-controller.ts"),E=S("./src/controller/latency-controller.ts"),s=S("./src/controller/level-controller.ts"),n=S("./src/controller/fragment-tracker.ts"),t=S("./src/loader/key-loader.ts"),r=S("./src/controller/stream-controller.ts"),i=S("./src/is-supported.ts"),a=S("./src/utils/logger.ts"),v=S("./src/config.ts"),p=S("./node_modules/eventemitter3/index.js"),l=S.n(p),o=S("./src/events.ts"),u=S("./src/errors.ts"),c=S("./src/types/level.ts");function _(R,O){for(var g=0;g<O.length;g++){var m=O[g];m.enumerable=m.enumerable||!1,m.configurable=!0,"value"in m&&(m.writable=!0),Object.defineProperty(R,f(m.key),m)}}function y(R,O,g){return O&&_(R.prototype,O),g&&_(R,g),Object.defineProperty(R,"prototype",{writable:!1}),R}function f(R){var O=C(R,"string");return typeof O=="symbol"?O:String(O)}function C(R,O){if(typeof R!="object"||R===null)return R;var g=R[Symbol.toPrimitive];if(g!==void 0){var m=g.call(R,O||"default");if(typeof m!="object")return m;throw new TypeError("@@toPrimitive must return a primitive value.")}return(O==="string"?String:Number)(R)}var L=function(){R.isSupported=function(){return(0,i.isSupported)()};function R(g){g===void 0&&(g={}),this.config=void 0,this.userConfig=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new p.EventEmitter,this._autoLevelCapping=void 0,this._maxHdcpLevel=null,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 m=this.config=(0,v.mergeConfig)(R.DefaultConfig,g);this.userConfig=g,(0,a.enableLogs)(m.debug,"Hls instance"),this._autoLevelCapping=-1,m.progressive&&(0,v.enableStreamingMode)(m);var d=m.abrController,h=m.bufferController,A=m.capLevelController,w=m.fpsController,x=this.abrController=new d(this),D=this.bufferController=new h(this),I=this.capLevelController=new A(this),F=new w(this),K=new b.default(this),W=new e.default(this),z=this.levelController=new s.default(this),j=new n.FragmentTracker(this),G=new t.default(this.config),Z=this.streamController=new r.default(this,j,G);I.setStreamController(Z),F.setStreamController(Z);var Q=[K,z,Z];this.networkControllers=Q;var ue=[x,D,I,F,W,j];this.audioTrackController=this.createController(m.audioTrackController,Q);var ee=m.audioStreamController;ee&&Q.push(new ee(this,j,G)),this.subtitleTrackController=this.createController(m.subtitleTrackController,Q);var ae=m.subtitleStreamController;ae&&Q.push(new ae(this,j,G)),this.createController(m.timelineController,ue),G.emeController=this.emeController=this.createController(m.emeController,ue),this.cmcdController=this.createController(m.cmcdController,ue),this.latencyController=this.createController(E.default,ue),this.coreComponents=ue}var O=R.prototype;return O.createController=function(m,d){if(m){var h=new m(this);return d&&d.push(h),h}return null},O.on=function(m,d,h){h===void 0&&(h=this),this._emitter.on(m,d,h)},O.once=function(m,d,h){h===void 0&&(h=this),this._emitter.once(m,d,h)},O.removeAllListeners=function(m){this._emitter.removeAllListeners(m)},O.off=function(m,d,h,A){h===void 0&&(h=this),this._emitter.off(m,d,h,A)},O.listeners=function(m){return this._emitter.listeners(m)},O.emit=function(m,d,h){return this._emitter.emit(m,d,h)},O.trigger=function(m,d){if(this.config.debug)return this.emit(m,m,d);try{return this.emit(m,m,d)}catch(h){a.logger.error("An internal error happened while handling event "+m+'. Error message: "'+h.message+'". Here is a stacktrace:',h),this.trigger(o.Events.ERROR,{type:u.ErrorTypes.OTHER_ERROR,details:u.ErrorDetails.INTERNAL_EXCEPTION,fatal:!1,event:m,error:h})}return!1},O.listenerCount=function(m){return this._emitter.listenerCount(m)},O.destroy=function(){a.logger.log("destroy"),this.trigger(o.Events.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this.url=null,this.networkControllers.forEach(function(m){return m.destroy()}),this.networkControllers.length=0,this.coreComponents.forEach(function(m){return m.destroy()}),this.coreComponents.length=0},O.attachMedia=function(m){a.logger.log("attachMedia"),this._media=m,this.trigger(o.Events.MEDIA_ATTACHING,{media:m})},O.detachMedia=function(){a.logger.log("detachMedia"),this.trigger(o.Events.MEDIA_DETACHING,void 0),this._media=null},O.loadSource=function(m){this.stopLoad();var d=this.media,h=this.url,A=this.url=P.buildAbsoluteURL(self.location.href,m,{alwaysNormalize:!0});a.logger.log("loadSource:"+A),d&&h&&h!==A&&this.bufferController.hasSourceTypes()&&(this.detachMedia(),this.attachMedia(d)),this.trigger(o.Events.MANIFEST_LOADING,{url:m})},O.startLoad=function(m){m===void 0&&(m=-1),a.logger.log("startLoad("+m+")"),this.networkControllers.forEach(function(d){d.startLoad(m)})},O.stopLoad=function(){a.logger.log("stopLoad"),this.networkControllers.forEach(function(m){m.stopLoad()})},O.swapAudioCodec=function(){a.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()},O.recoverMediaError=function(){a.logger.log("recoverMediaError");var m=this._media;this.detachMedia(),m&&this.attachMedia(m)},O.removeLevel=function(m,d){d===void 0&&(d=0),this.levelController.removeLevel(m,d)},y(R,[{key:"levels",get:function(){var m=this.levelController.levels;return m||[]}},{key:"currentLevel",get:function(){return this.streamController.currentLevel},set:function(m){a.logger.log("set currentLevel:"+m),this.loadLevel=m,this.abrController.clearTimer(),this.streamController.immediateLevelSwitch()}},{key:"nextLevel",get:function(){return this.streamController.nextLevel},set:function(m){a.logger.log("set nextLevel:"+m),this.levelController.manualLevel=m,this.streamController.nextLevelSwitch()}},{key:"loadLevel",get:function(){return this.levelController.level},set:function(m){a.logger.log("set loadLevel:"+m),this.levelController.manualLevel=m}},{key:"nextLoadLevel",get:function(){return this.levelController.nextLoadLevel},set:function(m){this.levelController.nextLoadLevel=m}},{key:"firstLevel",get:function(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)},set:function(m){a.logger.log("set firstLevel:"+m),this.levelController.firstLevel=m}},{key:"startLevel",get:function(){return this.levelController.startLevel},set:function(m){a.logger.log("set startLevel:"+m),m!==-1&&(m=Math.max(m,this.minAutoLevel)),this.levelController.startLevel=m}},{key:"capLevelToPlayerSize",get:function(){return this.config.capLevelToPlayerSize},set:function(m){var d=!!m;d!==this.config.capLevelToPlayerSize&&(d?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=d)}},{key:"autoLevelCapping",get:function(){return this._autoLevelCapping},set:function(m){this._autoLevelCapping!==m&&(a.logger.log("set autoLevelCapping:"+m),this._autoLevelCapping=m)}},{key:"bandwidthEstimate",get:function(){var m=this.abrController.bwEstimator;return m?m.getEstimate():NaN}},{key:"maxHdcpLevel",get:function(){return this._maxHdcpLevel},set:function(m){c.HdcpLevels.indexOf(m)>-1&&(this._maxHdcpLevel=m)}},{key:"autoLevelEnabled",get:function(){return this.levelController.manualLevel===-1}},{key:"manualLevel",get:function(){return this.levelController.manualLevel}},{key:"minAutoLevel",get:function(){var m=this.levels,d=this.config.minAutoBitrate;if(!m)return 0;for(var h=m.length,A=0;A<h;A++)if(m[A].maxBitrate>=d)return A;return 0}},{key:"maxAutoLevel",get:function(){var m=this.levels,d=this.autoLevelCapping,h=this.maxHdcpLevel,A;if(d===-1&&m&&m.length?A=m.length-1:A=d,h)for(var w=A;w--;){var x=m[w].attrs["HDCP-LEVEL"];if(x&&x<=h)return w}return A}},{key:"nextAutoLevel",get:function(){return Math.min(Math.max(this.abrController.nextAutoLevel,this.minAutoLevel),this.maxAutoLevel)},set:function(m){this.abrController.nextAutoLevel=Math.max(this.minAutoLevel,m)}},{key:"playingDate",get:function(){return this.streamController.currentProgramDateTime}},{key:"mainForwardBufferInfo",get:function(){return this.streamController.getMainFwdBufferInfo()}},{key:"audioTracks",get:function(){var m=this.audioTrackController;return m?m.audioTracks:[]}},{key:"audioTrack",get:function(){var m=this.audioTrackController;return m?m.audioTrack:-1},set:function(m){var d=this.audioTrackController;d&&(d.audioTrack=m)}},{key:"subtitleTracks",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTracks:[]}},{key:"subtitleTrack",get:function(){var m=this.subtitleTrackController;return m?m.subtitleTrack:-1},set:function(m){var d=this.subtitleTrackController;d&&(d.subtitleTrack=m)}},{key:"media",get:function(){return this._media}},{key:"subtitleDisplay",get:function(){var m=this.subtitleTrackController;return m?m.subtitleDisplay:!1},set:function(m){var d=this.subtitleTrackController;d&&(d.subtitleDisplay=m)}},{key:"lowLatencyMode",get:function(){return this.config.lowLatencyMode},set:function(m){this.config.lowLatencyMode=m}},{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.3.5"}},{key:"Events",get:function(){return o.Events}},{key:"ErrorTypes",get:function(){return u.ErrorTypes}},{key:"ErrorDetails",get:function(){return u.ErrorDetails}},{key:"DefaultConfig",get:function(){return R.defaultConfig?R.defaultConfig:v.hlsDefaultConfig},set:function(m){R.defaultConfig=m}}]),R}();L.defaultConfig=void 0},"./src/is-supported.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{changeTypeSupported:()=>e,isSupported:()=>b});var P=S("./src/utils/mediasource-helper.ts");function T(){return self.SourceBuffer||self.WebKitSourceBuffer}function b(){var E=(0,P.getMediaSource)();if(!E)return!1;var s=T(),n=E&&typeof E.isTypeSupported=="function"&&E.isTypeSupported('video/mp4; codecs="avc1.42E01E,mp4a.40.2"'),t=!s||s.prototype&&typeof s.prototype.appendBuffer=="function"&&typeof s.prototype.remove=="function";return!!n&&!!t}function e(){var E,s=T();return typeof(s==null||(E=s.prototype)===null||E===void 0?void 0:E.changeType)=="function"}},"./src/loader/date-range.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{DateRange:()=>i,DateRangeAttribute:()=>r});var P=S("./src/polyfills/number.ts"),T=S("./src/utils/attr-list.ts"),b=S("./src/utils/logger.ts");function e(){return e=Object.assign?Object.assign.bind():function(a){for(var v=1;v<arguments.length;v++){var p=arguments[v];for(var l in p)Object.prototype.hasOwnProperty.call(p,l)&&(a[l]=p[l])}return a},e.apply(this,arguments)}function E(a,v){for(var p=0;p<v.length;p++){var l=v[p];l.enumerable=l.enumerable||!1,l.configurable=!0,"value"in l&&(l.writable=!0),Object.defineProperty(a,n(l.key),l)}}function s(a,v,p){return v&&E(a.prototype,v),p&&E(a,p),Object.defineProperty(a,"prototype",{writable:!1}),a}function n(a){var v=t(a,"string");return typeof v=="symbol"?v:String(v)}function t(a,v){if(typeof a!="object"||a===null)return a;var p=a[Symbol.toPrimitive];if(p!==void 0){var l=p.call(a,v||"default");if(typeof l!="object")return l;throw new TypeError("@@toPrimitive must return a primitive value.")}return(v==="string"?String:Number)(a)}var r;(function(a){a.ID="ID",a.CLASS="CLASS",a.START_DATE="START-DATE",a.DURATION="DURATION",a.END_DATE="END-DATE",a.END_ON_NEXT="END-ON-NEXT",a.PLANNED_DURATION="PLANNED-DURATION",a.SCTE35_OUT="SCTE35-OUT",a.SCTE35_IN="SCTE35-IN"})(r||(r={}));var i=function(){function a(v,p){if(this.attr=void 0,this._startDate=void 0,this._endDate=void 0,this._badValueForSameId=void 0,p){var l=p.attr;for(var o in l)if(Object.prototype.hasOwnProperty.call(v,o)&&v[o]!==l[o]){b.logger.warn('DATERANGE tag attribute: "'+o+'" does not match for tags with ID: "'+v.ID+'"'),this._badValueForSameId=o;break}v=e(new T.AttrList({}),l,v)}if(this.attr=v,this._startDate=new Date(v[r.START_DATE]),r.END_DATE in this.attr){var u=new Date(this.attr[r.END_DATE]);(0,P.isFiniteNumber)(u.getTime())&&(this._endDate=u)}}return s(a,[{key:"id",get:function(){return this.attr.ID}},{key:"class",get:function(){return this.attr.CLASS}},{key:"startDate",get:function(){return this._startDate}},{key:"endDate",get:function(){if(this._endDate)return this._endDate;var p=this.duration;return p!==null?new Date(this._startDate.getTime()+p*1e3):null}},{key:"duration",get:function(){if(r.DURATION in this.attr){var p=this.attr.decimalFloatingPoint(r.DURATION);if((0,P.isFiniteNumber)(p))return p}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}},{key:"plannedDuration",get:function(){return r.PLANNED_DURATION in this.attr?this.attr.decimalFloatingPoint(r.PLANNED_DURATION):null}},{key:"endOnNext",get:function(){return this.attr.bool(r.END_ON_NEXT)}},{key:"isValid",get:function(){return!!this.id&&!this._badValueForSameId&&(0,P.isFiniteNumber)(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)}}]),a}()},"./src/loader/fragment-loader.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{LoadError:()=>p,default:()=>a});var P=S("./src/polyfills/number.ts"),T=S("./src/errors.ts");function b(l,o){l.prototype=Object.create(o.prototype),l.prototype.constructor=l,t(l,o)}function e(l){var o=typeof Map=="function"?new Map:void 0;return e=function(c){if(c===null||!n(c))return c;if(typeof c!="function")throw new TypeError("Super expression must either be null or a function");if(typeof o!="undefined"){if(o.has(c))return o.get(c);o.set(c,_)}function _(){return E(c,arguments,r(this).constructor)}return _.prototype=Object.create(c.prototype,{constructor:{value:_,enumerable:!1,writable:!0,configurable:!0}}),t(_,c)},e(l)}function E(l,o,u){return s()?E=Reflect.construct.bind():E=function(_,y,f){var C=[null];C.push.apply(C,y);var L=Function.bind.apply(_,C),R=new L;return f&&t(R,f.prototype),R},E.apply(null,arguments)}function s(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(l){return!1}}function n(l){return Function.toString.call(l).indexOf("[native code]")!==-1}function t(l,o){return t=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(c,_){return c.__proto__=_,c},t(l,o)}function r(l){return r=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(u){return u.__proto__||Object.getPrototypeOf(u)},r(l)}var i=Math.pow(2,17),a=function(){function l(u){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=u}var o=l.prototype;return o.destroy=function(){this.loader&&(this.loader.destroy(),this.loader=null)},o.abort=function(){this.loader&&this.loader.abort()},o.load=function(c,_){var y=this,f=c.url;if(!f)return Promise.reject(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,networkDetails:null},"Fragment does not have a "+(f?"part list":"url")));this.abort();var C=this.config,L=C.fLoader,R=C.loader;return new Promise(function(O,g){y.loader&&y.loader.destroy();var m=y.loader=c.loader=L?new L(C):new R(C),d=v(c),h={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:c.sn==="initSegment"?1/0:i};c.stats=m.stats,m.load(d,h,{onSuccess:function(w,x,D,I){y.resetLoader(c,m);var F=w.data;D.resetIV&&c.decryptdata&&(c.decryptdata.iv=new Uint8Array(F.slice(0,16)),F=F.slice(16)),O({frag:c,part:null,payload:F,networkDetails:I})},onError:function(w,x,D){y.resetLoader(c,m),g(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,response:w,networkDetails:D}))},onAbort:function(w,x,D){y.resetLoader(c,m),g(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,networkDetails:D}))},onTimeout:function(w,x,D){y.resetLoader(c,m),g(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,networkDetails:D}))},onProgress:function(w,x,D,I){_&&_({frag:c,part:null,payload:D,networkDetails:I})}})})},o.loadPart=function(c,_,y){var f=this;this.abort();var C=this.config,L=C.fLoader,R=C.loader;return new Promise(function(O,g){f.loader&&f.loader.destroy();var m=f.loader=c.loader=L?new L(C):new R(C),d=v(c,_),h={timeout:C.fragLoadingTimeOut,maxRetry:0,retryDelay:0,maxRetryDelay:C.fragLoadingMaxRetryTimeout,highWaterMark:i};_.stats=m.stats,m.load(d,h,{onSuccess:function(w,x,D,I){f.resetLoader(c,m),f.updateStatsFromPart(c,_);var F={frag:c,part:_,payload:w.data,networkDetails:I};y(F),O(F)},onError:function(w,x,D){f.resetLoader(c,m),g(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_ERROR,fatal:!1,frag:c,part:_,response:w,networkDetails:D}))},onAbort:function(w,x,D){c.stats.aborted=_.stats.aborted,f.resetLoader(c,m),g(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.INTERNAL_ABORTED,fatal:!1,frag:c,part:_,networkDetails:D}))},onTimeout:function(w,x,D){f.resetLoader(c,m),g(new p({type:T.ErrorTypes.NETWORK_ERROR,details:T.ErrorDetails.FRAG_LOAD_TIMEOUT,fatal:!1,frag:c,part:_,networkDetails:D}))}})})},o.updateStatsFromPart=function(c,_){var y=c.stats,f=_.stats,C=f.total;if(y.loaded+=f.loaded,C){var L=Math.round(c.duration/_.duration),R=Math.min(Math.round(y.loaded/C),L),O=L-R,g=O*Math.round(y.loaded/R);y.total=y.loaded+g}else y.total=Math.max(y.loaded,y.total);var m=y.loading,d=f.loading;m.start?m.first+=d.first-d.start:(m.start=d.start,m.first=d.first),m.end=d.end},o.resetLoader=function(c,_){c.loader=null,this.loader===_&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),_.destroy()},l}();function v(l,o){o===void 0&&(o=null);var u=o||l,c={frag:l,part:o,responseType:"arraybuffer",url:u.url,headers:{},rangeStart:0,rangeEnd:0},_=u.byteRangeStartOffset,y=u.byteRangeEndOffset;if((0,P.isFiniteNumber)(_)&&(0,P.isFiniteNumber)(y)){var f,C=_,L=y;if(l.sn==="initSegment"&&((f=l.decryptdata)===null||f===void 0?void 0:f.method)==="AES-128"){var R=y-_;R%16&&(L=y+(16-R%16)),_!==0&&(c.resetIV=!0,C=_-16)}c.rangeStart=C,c.rangeEnd=L}return c}var p=function(l){b(o,l);function o(u){for(var c,_=arguments.length,y=new Array(_>1?_-1:0),f=1;f<_;f++)y[f-1]=arguments[f];return c=l.call.apply(l,[this].concat(y))||this,c.data=void 0,c.data=u,c}return o}(e(Error))},"./src/loader/fragment.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{BaseSegment:()=>v,ElementaryStreamTypes:()=>a,Fragment:()=>p,Part:()=>l});var P=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),b=S.n(T),e=S("./src/loader/load-stats.ts");function E(o,u){o.prototype=Object.create(u.prototype),o.prototype.constructor=o,s(o,u)}function s(o,u){return s=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(_,y){return _.__proto__=y,_},s(o,u)}function n(o,u){for(var c=0;c<u.length;c++){var _=u[c];_.enumerable=_.enumerable||!1,_.configurable=!0,"value"in _&&(_.writable=!0),Object.defineProperty(o,r(_.key),_)}}function t(o,u,c){return u&&n(o.prototype,u),c&&n(o,c),Object.defineProperty(o,"prototype",{writable:!1}),o}function r(o){var u=i(o,"string");return typeof u=="symbol"?u:String(u)}function i(o,u){if(typeof o!="object"||o===null)return o;var c=o[Symbol.toPrimitive];if(c!==void 0){var _=c.call(o,u||"default");if(typeof _!="object")return _;throw new TypeError("@@toPrimitive must return a primitive value.")}return(u==="string"?String:Number)(o)}var a;(function(o){o.AUDIO="audio",o.VIDEO="video",o.AUDIOVIDEO="audiovideo"})(a||(a={}));var v=function(){function o(c){var _;this._byteRange=null,this._url=null,this.baseurl=void 0,this.relurl=void 0,this.elementaryStreams=(_={},_[a.AUDIO]=null,_[a.VIDEO]=null,_[a.AUDIOVIDEO]=null,_),this.baseurl=c}var u=o.prototype;return u.setByteRange=function(_,y){var f=_.split("@",2),C=[];f.length===1?C[0]=y?y.byteRangeEndOffset:0:C[0]=parseInt(f[1]),C[1]=parseInt(f[0])+C[0],this._byteRange=C},t(o,[{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=(0,T.buildAbsoluteURL)(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""},set:function(_){this._url=_}}]),o}(),p=function(o){E(u,o);function u(_,y){var f;return f=o.call(this,y)||this,f._decryptdata=null,f.rawProgramDateTime=null,f.programDateTime=null,f.tagList=[],f.duration=0,f.sn=0,f.levelkeys=void 0,f.type=void 0,f.loader=null,f.keyLoader=null,f.level=-1,f.cc=0,f.startPTS=void 0,f.endPTS=void 0,f.appendedPTS=void 0,f.startDTS=void 0,f.endDTS=void 0,f.start=0,f.deltaPTS=void 0,f.maxStartPTS=void 0,f.minEndPTS=void 0,f.stats=new e.LoadStats,f.urlId=0,f.data=void 0,f.bitrateTest=!1,f.title=null,f.initSegment=null,f.endList=void 0,f.type=_,f}var c=u.prototype;return c.setKeyFormat=function(y){if(this.levelkeys){var f=this.levelkeys[y];f&&!this._decryptdata&&(this._decryptdata=f.getDecryptData(this.sn))}},c.abortRequests=function(){var y,f;(y=this.loader)===null||y===void 0||y.abort(),(f=this.keyLoader)===null||f===void 0||f.abort()},c.setElementaryStreamInfo=function(y,f,C,L,R,O){O===void 0&&(O=!1);var g=this.elementaryStreams,m=g[y];if(!m){g[y]={startPTS:f,endPTS:C,startDTS:L,endDTS:R,partial:O};return}m.startPTS=Math.min(m.startPTS,f),m.endPTS=Math.max(m.endPTS,C),m.startDTS=Math.min(m.startDTS,L),m.endDTS=Math.max(m.endDTS,R)},c.clearElementaryStreamInfo=function(){var y=this.elementaryStreams;y[a.AUDIO]=null,y[a.VIDEO]=null,y[a.AUDIOVIDEO]=null},t(u,[{key:"decryptdata",get:function(){var y=this.levelkeys;if(!y&&!this._decryptdata)return null;if(!this._decryptdata&&this.levelkeys&&!this.levelkeys.NONE){var f=this.levelkeys.identity;if(f)this._decryptdata=f.getDecryptData(this.sn);else{var C=Object.keys(this.levelkeys);if(C.length===1)return this._decryptdata=this.levelkeys[C[0]].getDecryptData(this.sn)}}return this._decryptdata}},{key:"end",get:function(){return this.start+this.duration}},{key:"endProgramDateTime",get:function(){if(this.programDateTime===null||!(0,P.isFiniteNumber)(this.programDateTime))return null;var y=(0,P.isFiniteNumber)(this.duration)?this.duration:0;return this.programDateTime+y*1e3}},{key:"encrypted",get:function(){var y;if((y=this._decryptdata)!==null&&y!==void 0&&y.encrypted)return!0;if(this.levelkeys){var f=Object.keys(this.levelkeys),C=f.length;if(C>1||C===1&&this.levelkeys[f[0]].encrypted)return!0}return!1}}]),u}(v),l=function(o){E(u,o);function u(c,_,y,f,C){var L;L=o.call(this,y)||this,L.fragOffset=0,L.duration=0,L.gap=!1,L.independent=!1,L.relurl=void 0,L.fragment=void 0,L.index=void 0,L.stats=new e.LoadStats,L.duration=c.decimalFloatingPoint("DURATION"),L.gap=c.bool("GAP"),L.independent=c.bool("INDEPENDENT"),L.relurl=c.enumeratedString("URI"),L.fragment=_,L.index=f;var R=c.enumeratedString("BYTERANGE");return R&&L.setByteRange(R,C),C&&(L.fragOffset=C.fragOffset+C.duration),L}return t(u,[{key:"start",get:function(){return this.fragment.start+this.fragOffset}},{key:"end",get:function(){return this.start+this.duration}},{key:"loaded",get:function(){var _=this.elementaryStreams;return!!(_.audio||_.video||_.audiovideo)}}]),u}(v)},"./src/loader/key-loader.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>b});var P=S("./src/errors.ts"),T=S("./src/loader/fragment-loader.ts"),b=function(){function e(s){this.config=void 0,this.keyUriToKeyInfo={},this.emeController=null,this.config=s}var E=e.prototype;return E.abort=function(){for(var n in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[n].loader;t&&t.abort()}},E.detach=function(){for(var n in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[n];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyUriToKeyInfo[n]}},E.destroy=function(){this.detach();for(var n in this.keyUriToKeyInfo){var t=this.keyUriToKeyInfo[n].loader;t&&t.destroy()}this.keyUriToKeyInfo={}},E.createKeyLoadError=function(n,t,r,i){return t===void 0&&(t=P.ErrorDetails.KEY_LOAD_ERROR),new T.LoadError({type:P.ErrorTypes.NETWORK_ERROR,details:t,fatal:!1,frag:n,networkDetails:r})},E.loadClear=function(n,t){var r=this;if(this.emeController&&this.config.emeEnabled)for(var i=n.sn,a=n.cc,v=function(u){var c=t[u];if(a<=c.cc&&(i==="initSegment"||i<c.sn))return r.emeController.selectKeySystemFormat(c).then(function(_){c.setKeyFormat(_)}),"break"},p=0;p<t.length;p++){var l=v(p);if(l==="break")break}},E.load=function(n){var t=this;return!n.decryptdata&&n.encrypted&&this.emeController?this.emeController.selectKeySystemFormat(n).then(function(r){return t.loadInternal(n,r)}):this.loadInternal(n)},E.loadInternal=function(n,t){var r,i;t&&n.setKeyFormat(t);var a=n.decryptdata;if(!a){var v=t?"Expected frag.decryptdata to be defined after setting format "+t:"Missing decryption data on fragment in onKeyLoading";return Promise.reject(this.createKeyLoadError(n,P.ErrorDetails.KEY_LOAD_ERROR,null,v))}var p=a.uri;if(!p)return Promise.reject(this.createKeyLoadError(n,P.ErrorDetails.KEY_LOAD_ERROR,null,'Invalid key URI: "'+p+'"'));var l=this.keyUriToKeyInfo[p];if((r=l)!==null&&r!==void 0&&r.decryptdata.key)return a.key=l.decryptdata.key,Promise.resolve({frag:n,keyInfo:l});if((i=l)!==null&&i!==void 0&&i.keyLoadPromise){var o;switch((o=l.mediaKeySessionContext)===null||o===void 0?void 0:o.keyStatus){case void 0:case"status-pending":case"usable":case"usable-in-future":return l.keyLoadPromise.then(function(u){return a.key=u.keyInfo.decryptdata.key,{frag:n,keyInfo:l}})}}switch(l=this.keyUriToKeyInfo[p]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"ISO-23001-7":case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return a.keyFormat==="identity"?this.loadKeyHTTP(l,n):this.loadKeyEME(l,n);case"AES-128":return this.loadKeyHTTP(l,n);default:return Promise.reject(this.createKeyLoadError(n,P.ErrorDetails.KEY_LOAD_ERROR,null,'Key supplied with unsupported METHOD: "'+a.method+'"'))}},E.loadKeyEME=function(n,t){var r={frag:t,keyInfo:n};if(this.emeController&&this.config.emeEnabled){var i=this.emeController.loadKey(r);if(i)return(n.keyLoadPromise=i.then(function(a){return n.mediaKeySessionContext=a,r})).catch(function(a){throw n.keyLoadPromise=null,a})}return Promise.resolve(r)},E.loadKeyHTTP=function(n,t){var r=this,i=this.config,a=i.loader,v=new a(i);return t.keyLoader=n.loader=v,n.keyLoadPromise=new Promise(function(p,l){var o={keyInfo:n,frag:t,responseType:"arraybuffer",url:n.decryptdata.uri},u={timeout:i.fragLoadingTimeOut,maxRetry:0,retryDelay:i.fragLoadingRetryDelay,maxRetryDelay:i.fragLoadingMaxRetryTimeout,highWaterMark:0},c={onSuccess:function(y,f,C,L){var R=C.frag,O=C.keyInfo,g=C.url;if(!R.decryptdata||O!==r.keyUriToKeyInfo[g])return l(r.createKeyLoadError(R,P.ErrorDetails.KEY_LOAD_ERROR,L,"after key load, decryptdata unset or changed"));O.decryptdata.key=R.decryptdata.key=new Uint8Array(y.data),R.keyLoader=null,O.loader=null,p({frag:R,keyInfo:O})},onError:function(y,f,C){r.resetLoader(f),l(r.createKeyLoadError(t,P.ErrorDetails.KEY_LOAD_ERROR,C))},onTimeout:function(y,f,C){r.resetLoader(f),l(r.createKeyLoadError(t,P.ErrorDetails.KEY_LOAD_TIMEOUT,C))},onAbort:function(y,f,C){r.resetLoader(f),l(r.createKeyLoadError(t,P.ErrorDetails.INTERNAL_ABORTED,C))}};v.load(o,u,c)})},E.resetLoader=function(n){var t=n.frag,r=n.keyInfo,i=n.url,a=r.loader;t.keyLoader===a&&(t.keyLoader=null,r.loader=null),delete this.keyUriToKeyInfo[i],a&&a.destroy()},e}()},"./src/loader/level-details.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{LevelDetails:()=>n});var P=S("./src/polyfills/number.ts");function T(t,r){for(var i=0;i<r.length;i++){var a=r[i];a.enumerable=a.enumerable||!1,a.configurable=!0,"value"in a&&(a.writable=!0),Object.defineProperty(t,e(a.key),a)}}function b(t,r,i){return r&&T(t.prototype,r),i&&T(t,i),Object.defineProperty(t,"prototype",{writable:!1}),t}function e(t){var r=E(t,"string");return typeof r=="symbol"?r:String(r)}function E(t,r){if(typeof t!="object"||t===null)return t;var i=t[Symbol.toPrimitive];if(i!==void 0){var a=i.call(t,r||"default");if(typeof a!="object")return a;throw new TypeError("@@toPrimitive must return a primitive value.")}return(r==="string"?String:Number)(t)}var s=10,n=function(){function t(i){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.dateRanges=void 0,this.live=!0,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!0,this.availabilityDelay=void 0,this.misses=0,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.encryptedFragments=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=i}var r=t.prototype;return r.reloaded=function(a){if(!a){this.advanced=!0,this.updated=!0;return}var v=this.lastPartSn-a.lastPartSn,p=this.lastPartIndex-a.lastPartIndex;this.updated=this.endSN!==a.endSN||!!p||!!v,this.advanced=this.endSN>a.endSN||v>0||v===0&&p>0,this.updated||this.advanced?this.misses=Math.floor(a.misses*.6):this.misses=a.misses+1,this.availabilityDelay=a.availabilityDelay},b(t,[{key:"hasProgramDateTime",get:function(){return this.fragments.length?(0,P.isFiniteNumber)(this.fragments[this.fragments.length-1].programDateTime):!1}},{key:"levelTargetDuration",get:function(){return this.averagetargetduration||this.targetduration||s}},{key:"drift",get:function(){var a=this.driftEndTime-this.driftStartTime;if(a>0){var v=this.driftEnd-this.driftStart;return v*1e3/a}return 1}},{key:"edge",get:function(){return this.partEnd||this.fragmentEnd}},{key:"partEnd",get:function(){var a;return(a=this.partList)!==null&&a!==void 0&&a.length?this.partList[this.partList.length-1].end:this.fragmentEnd}},{key:"fragmentEnd",get:function(){var a;return(a=this.fragments)!==null&&a!==void 0&&a.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 a;return(a=this.partList)!==null&&a!==void 0&&a.length?this.partList[this.partList.length-1].index:-1}},{key:"lastPartSn",get:function(){var a;return(a=this.partList)!==null&&a!==void 0&&a.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}}]),t}()},"./src/loader/level-key.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{LevelKey:()=>n});var P=S("./src/utils/keysystem-util.ts"),T=S("./src/utils/mediakeys-helper.ts"),b=S("./src/utils/mp4-tools.ts"),e=S("./src/utils/logger.ts"),E=S("./src/utils/numeric-encoding-utils.ts"),s={},n=function(){r.clearKeyUriToKeyIdMap=function(){s={}};function r(a,v,p,l,o){l===void 0&&(l=[1]),o===void 0&&(o=null),this.uri=void 0,this.method=void 0,this.keyFormat=void 0,this.keyFormatVersions=void 0,this.encrypted=void 0,this.isCommonEncryption=void 0,this.iv=null,this.key=null,this.keyId=null,this.pssh=null,this.method=a,this.uri=v,this.keyFormat=p,this.keyFormatVersions=l,this.iv=o,this.encrypted=a?a!=="NONE":!1,this.isCommonEncryption=this.encrypted&&a!=="AES-128"}var i=r.prototype;return i.isSupported=function(){if(this.method){if(this.method==="AES-128"||this.method==="NONE")return!0;switch(this.keyFormat){case"identity":return this.method==="SAMPLE-AES";case T.KeySystemFormats.FAIRPLAY:case T.KeySystemFormats.WIDEVINE:case T.KeySystemFormats.PLAYREADY:case T.KeySystemFormats.CLEARKEY:return["ISO-23001-7","SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1},i.getDecryptData=function(v){if(!this.encrypted||!this.uri)return null;if(this.method==="AES-128"&&this.uri&&!this.iv){typeof v!="number"&&(this.method==="AES-128"&&!this.iv&&e.logger.warn('missing IV for initialization segment with method="'+this.method+'" - compliance issue'),v=0);var p=t(v),l=new r(this.method,this.uri,"identity",this.keyFormatVersions,p);return l}var o=(0,P.convertDataUriToArrayBytes)(this.uri);if(o)switch(this.keyFormat){case T.KeySystemFormats.WIDEVINE:this.pssh=o,o.length>=22&&(this.keyId=o.subarray(o.length-22,o.length-6));break;case T.KeySystemFormats.PLAYREADY:{var u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=(0,b.mp4pssh)(u,null,o);var c=new Uint16Array(o.buffer,o.byteOffset,o.byteLength/2),_=String.fromCharCode.apply(null,Array.from(c)),y=_.substring(_.indexOf("<"),_.length),f=new DOMParser,C=f.parseFromString(y,"text/xml"),L=C.getElementsByTagName("KID")[0];if(L){var R=L.childNodes[0]?L.childNodes[0].nodeValue:L.getAttribute("VALUE");if(R){var O=(0,E.base64Decode)(R).subarray(0,16);(0,P.changeEndianness)(O),this.keyId=O}}break}default:{var g=o.subarray(0,16);if(g.length!==16){var m=new Uint8Array(16);m.set(g,16-g.length),g=m}this.keyId=g;break}}if(!this.keyId||this.keyId.byteLength!==16){var d=s[this.uri];if(!d){var h=Object.keys(s).length%Number.MAX_SAFE_INTEGER;d=new Uint8Array(16);var A=new DataView(d.buffer,12,4);A.setUint32(0,h),s[this.uri]=d}this.keyId=d}return this},r}();function t(r){for(var i=new Uint8Array(16),a=12;a<16;a++)i[a]=r>>8*(15-a)&255;return i}},"./src/loader/load-stats.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{LoadStats:()=>P});var P=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":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>u});var P=S("./src/polyfills/number.ts"),T=S("./node_modules/url-toolkit/src/url-toolkit.js"),b=S.n(T),e=S("./src/loader/date-range.ts"),E=S("./src/loader/fragment.ts"),s=S("./src/loader/level-details.ts"),n=S("./src/loader/level-key.ts"),t=S("./src/utils/attr-list.ts"),r=S("./src/utils/logger.ts"),i=S("./src/utils/codecs.ts");function a(){return a=Object.assign?Object.assign.bind():function(O){for(var g=1;g<arguments.length;g++){var m=arguments[g];for(var d in m)Object.prototype.hasOwnProperty.call(m,d)&&(O[d]=m[d])}return O},a.apply(this,arguments)}var v=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-SESSION-DATA:([^\r\n]*)[\r\n]+|#EXT-X-SESSION-KEY:([^\n\r]*)[\r\n]+/g,p=/#EXT-X-MEDIA:(.*)/g,l=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[\S ]*)/.source,/#EXT-X-BYTERANGE:*(.+)/.source,/#EXT-X-PROGRAM-DATE-TIME:(.+)/.source,/#.*/.source].join("|"),"g"),o=new RegExp([/#(EXTM3U)/.source,/#EXT-X-(DATERANGE|KEY|MAP|PART|PART-INF|PLAYLIST-TYPE|PRELOAD-HINT|RENDITION-REPORT|SERVER-CONTROL|SKIP|START):(.+)/.source,/#EXT-X-(BITRATE|DISCONTINUITY-SEQUENCE|MEDIA-SEQUENCE|TARGETDURATION|VERSION): *(\d+)/.source,/#EXT-X-(DISCONTINUITY|ENDLIST|GAP)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|")),u=function(){function O(){}return O.findGroup=function(m,d){for(var h=0;h<m.length;h++){var A=m[h];if(A.id===d)return A}},O.convertAVC1ToAVCOTI=function(m){var d=m.split(".");if(d.length>2){var h=d.shift()+".";return h+=parseInt(d.shift()).toString(16),h+=("000"+parseInt(d.shift()).toString(16)).slice(-4),h}return m},O.resolve=function(m,d){return(0,T.buildAbsoluteURL)(d,m,{alwaysNormalize:!0})},O.parseMasterPlaylist=function(m,d){var h=[],A=[],w={},x=[],D=!1;v.lastIndex=0;for(var I;(I=v.exec(m))!=null;)if(I[1]){var F,K=new t.AttrList(I[1]),W={attrs:K,bitrate:K.decimalInteger("AVERAGE-BANDWIDTH")||K.decimalInteger("BANDWIDTH"),name:K.NAME,url:O.resolve(I[2],d)},z=K.decimalResolution("RESOLUTION");z&&(W.width=z.width,W.height=z.height),_((K.CODECS||"").split(/[ ,]+/).filter(function(ue){return ue}),W),W.videoCodec&&W.videoCodec.indexOf("avc1")!==-1&&(W.videoCodec=O.convertAVC1ToAVCOTI(W.videoCodec)),(F=W.unknownCodecs)!==null&&F!==void 0&&F.length||A.push(W),h.push(W)}else if(I[3]){var j=new t.AttrList(I[3]);j["DATA-ID"]&&(D=!0,w[j["DATA-ID"]]=j)}else if(I[4]){var G=I[4],Z=c(G,d);Z.encrypted&&Z.isSupported()?x.push(Z):r.logger.warn('[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "'+G+'"')}var Q=A.length>0&&A.length<h.length;return{levels:Q?A:h,sessionData:D?w:null,sessionKeys:x.length?x:null}},O.parseMasterPlaylistMedia=function(m,d,h,A){A===void 0&&(A=[]);var w,x=[],D=0;for(p.lastIndex=0;(w=p.exec(m))!==null;){var I=new t.AttrList(w[1]);if(I.TYPE===h){var F={attrs:I,bitrate:0,id:D++,groupId:I["GROUP-ID"],instreamId:I["INSTREAM-ID"],name:I.NAME||I.LANGUAGE||"",type:h,default:I.bool("DEFAULT"),autoselect:I.bool("AUTOSELECT"),forced:I.bool("FORCED"),lang:I.LANGUAGE,url:I.URI?O.resolve(I.URI,d):""};if(A.length){var K=O.findGroup(A,F.groupId)||A[0];y(F,K,"audioCodec"),y(F,K,"textCodec")}x.push(F)}}return x},O.parseLevelPlaylist=function(m,d,h,A,w){var x=new s.LevelDetails(d),D=x.fragments,I=null,F=0,K=0,W=0,z=0,j=null,G=new E.Fragment(A,d),Z,Q,ue,ee=-1,ae=!1;for(l.lastIndex=0,x.m3u8=m;(Z=l.exec(m))!==null;){ae&&(ae=!1,G=new E.Fragment(A,d),G.start=W,G.sn=F,G.cc=z,G.level=h,I&&(G.initSegment=I,G.rawProgramDateTime=I.rawProgramDateTime,I.rawProgramDateTime=null));var _e=Z[1];if(_e){G.duration=parseFloat(_e);var xe=(" "+Z[2]).slice(1);G.title=xe||null,G.tagList.push(xe?["INF",_e,xe]:["INF",_e])}else if(Z[3])(0,P.isFiniteNumber)(G.duration)&&(G.start=W,ue&&R(G,ue,x),G.sn=F,G.level=h,G.cc=z,G.urlId=w,D.push(G),G.relurl=(" "+Z[3]).slice(1),C(G,j),j=G,W+=G.duration,F++,K=0,ae=!0);else if(Z[4]){var ge=(" "+Z[4]).slice(1);j?G.setByteRange(ge,j):G.setByteRange(ge)}else if(Z[5])G.rawProgramDateTime=(" "+Z[5]).slice(1),G.tagList.push(["PROGRAM-DATE-TIME",G.rawProgramDateTime]),ee===-1&&(ee=D.length);else{if(Z=Z[0].match(o),!Z){r.logger.warn("No matches on slow regex match for level playlist!");continue}for(Q=1;Q<Z.length&&typeof Z[Q]=="undefined";Q++);var ce=(" "+Z[Q]).slice(1),he=(" "+Z[Q+1]).slice(1),Se=Z[Q+2]?(" "+Z[Q+2]).slice(1):"";switch(ce){case"PLAYLIST-TYPE":x.type=he.toUpperCase();break;case"MEDIA-SEQUENCE":F=x.startSN=parseInt(he);break;case"SKIP":{var Te=new t.AttrList(he),ke=Te.decimalInteger("SKIPPED-SEGMENTS");if((0,P.isFiniteNumber)(ke)){x.skippedSegments=ke;for(var X=ke;X--;)D.unshift(null);F+=ke}var te=Te.enumeratedString("RECENTLY-REMOVED-DATERANGES");te&&(x.recentlyRemovedDateranges=te.split(" "));break}case"TARGETDURATION":x.targetduration=parseFloat(he);break;case"VERSION":x.version=parseInt(he);break;case"EXTM3U":break;case"ENDLIST":x.live=!1;break;case"#":(he||Se)&&G.tagList.push(Se?[he,Se]:[he]);break;case"DISCONTINUITY":z++,G.tagList.push(["DIS"]);break;case"GAP":G.tagList.push([ce]);break;case"BITRATE":G.tagList.push([ce,he]);break;case"DATERANGE":{var pe=new t.AttrList(he),me=new e.DateRange(pe,x.dateRanges[pe.ID]);me.isValid||x.skippedSegments?x.dateRanges[me.id]=me:r.logger.warn('Ignoring invalid DATERANGE tag: "'+he+'"'),G.tagList.push(["EXT-X-DATERANGE",he]);break}case"DISCONTINUITY-SEQUENCE":z=parseInt(he);break;case"KEY":{var be=c(he,d);if(be.isSupported()){if(be.method==="NONE"){ue=void 0;break}ue||(ue={}),ue[be.keyFormat]&&(ue=a({},ue)),ue[be.keyFormat]=be}else r.logger.warn('[Keys] Ignoring invalid EXT-X-KEY tag: "'+he+'"');break}case"START":{var de=new t.AttrList(he),Be=de.decimalFloatingPoint("TIME-OFFSET");(0,P.isFiniteNumber)(Be)&&(x.startTimeOffset=Be);break}case"MAP":{var we=new t.AttrList(he);if(G.duration){var Le=new E.Fragment(A,d);L(Le,we,h,ue),I=Le,G.initSegment=I,I.rawProgramDateTime&&!G.rawProgramDateTime&&(G.rawProgramDateTime=I.rawProgramDateTime)}else L(G,we,h,ue),I=G,ae=!0;break}case"SERVER-CONTROL":{var Ae=new t.AttrList(he);x.canBlockReload=Ae.bool("CAN-BLOCK-RELOAD"),x.canSkipUntil=Ae.optionalFloat("CAN-SKIP-UNTIL",0),x.canSkipDateRanges=x.canSkipUntil>0&&Ae.bool("CAN-SKIP-DATERANGES"),x.partHoldBack=Ae.optionalFloat("PART-HOLD-BACK",0),x.holdBack=Ae.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{var Ve=new t.AttrList(he);x.partTarget=Ve.decimalFloatingPoint("PART-TARGET");break}case"PART":{var De=x.partList;De||(De=x.partList=[]);var ye=K>0?De[De.length-1]:void 0,Ee=K++,Oe=new E.Part(new t.AttrList(he),G,d,Ee,ye);De.push(Oe),G.duration+=Oe.duration;break}case"PRELOAD-HINT":{var Fe=new t.AttrList(he);x.preloadHint=Fe;break}case"RENDITION-REPORT":{var Ke=new t.AttrList(he);x.renditionReports=x.renditionReports||[],x.renditionReports.push(Ke);break}default:r.logger.warn("line parsed but not handled: "+Z);break}}}j&&!j.relurl?(D.pop(),W-=j.duration,x.partList&&(x.fragmentHint=j)):x.partList&&(C(G,j),G.cc=z,x.fragmentHint=G,ue&&R(G,ue,x));var ze=D.length,Ye=D[0],Ie=D[ze-1];if(W+=x.skippedSegments*x.targetduration,W>0&&ze&&Ie){x.averagetargetduration=W/ze;var je=Ie.sn;x.endSN=je!=="initSegment"?je:0,x.live||(Ie.endList=!0),Ye&&(x.startCC=Ye.cc)}else x.endSN=0,x.startCC=0;return x.fragmentHint&&(W+=x.fragmentHint.duration),x.totalduration=W,x.endCC=z,ee>0&&f(D,ee),x},O}();function c(O,g){var m,d,h=new t.AttrList(O),A=(m=h.enumeratedString("METHOD"))!=null?m:"",w=h.URI,x=h.hexadecimalInteger("IV"),D=h.enumeratedString("KEYFORMATVERSIONS"),I=(d=h.enumeratedString("KEYFORMAT"))!=null?d:"identity";w&&h.IV&&!x&&r.logger.error("Invalid IV: "+h.IV);var F=w?u.resolve(w,g):"",K=(D||"1").split("/").map(Number).filter(Number.isFinite);return new n.LevelKey(A,F,I,K,x)}function _(O,g){["video","audio","text"].forEach(function(m){var d=O.filter(function(A){return(0,i.isCodecType)(A,m)});if(d.length){var h=d.filter(function(A){return A.lastIndexOf("avc1",0)===0||A.lastIndexOf("mp4a",0)===0});g[m+"Codec"]=h.length>0?h[0]:d[0],O=O.filter(function(A){return d.indexOf(A)===-1})}}),g.unknownCodecs=O}function y(O,g,m){var d=g[m];d&&(O[m]=d)}function f(O,g){for(var m=O[g],d=g;d--;){var h=O[d];if(!h)return;h.programDateTime=m.programDateTime-h.duration*1e3,m=h}}function C(O,g){O.rawProgramDateTime?O.programDateTime=Date.parse(O.rawProgramDateTime):g!=null&&g.programDateTime&&(O.programDateTime=g.endProgramDateTime),(0,P.isFiniteNumber)(O.programDateTime)||(O.programDateTime=null,O.rawProgramDateTime=null)}function L(O,g,m,d){O.relurl=g.URI,g.BYTERANGE&&O.setByteRange(g.BYTERANGE),O.level=m,O.sn="initSegment",d&&(O.levelkeys=d),O.initSegment=null}function R(O,g,m){O.levelkeys=g;var d=m.encryptedFragments;(!d.length||d[d.length-1].levelkeys!==g)&&Object.keys(g).some(function(h){return g[h].isCommonEncryption})&&d.push(O)}},"./src/loader/playlist-loader.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>a});var P=S("./src/polyfills/number.ts"),T=S("./src/events.ts"),b=S("./src/errors.ts"),e=S("./src/utils/logger.ts"),E=S("./src/loader/m3u8-parser.ts"),s=S("./src/types/loader.ts"),n=S("./src/utils/attr-list.ts");function t(v){var p=v.type;switch(p){case s.PlaylistContextType.AUDIO_TRACK:return s.PlaylistLevelType.AUDIO;case s.PlaylistContextType.SUBTITLE_TRACK:return s.PlaylistLevelType.SUBTITLE;default:return s.PlaylistLevelType.MAIN}}function r(v,p){var l=v.url;return(l===void 0||l.indexOf("data:")===0)&&(l=p.url),l}var i=function(){function v(l){this.hls=void 0,this.loaders=Object.create(null),this.hls=l,this.registerListeners()}var p=v.prototype;return p.startLoad=function(o){},p.stopLoad=function(){this.destroyInternalLoaders()},p.registerListeners=function(){var o=this.hls;o.on(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.on(T.Events.LEVEL_LOADING,this.onLevelLoading,this),o.on(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.on(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.unregisterListeners=function(){var o=this.hls;o.off(T.Events.MANIFEST_LOADING,this.onManifestLoading,this),o.off(T.Events.LEVEL_LOADING,this.onLevelLoading,this),o.off(T.Events.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),o.off(T.Events.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this)},p.createInternalLoader=function(o){var u=this.hls.config,c=u.pLoader,_=u.loader,y=c||_,f=new y(u);return o.loader=f,this.loaders[o.type]=f,f},p.getInternalLoader=function(o){return this.loaders[o.type]},p.resetInternalLoader=function(o){this.loaders[o]&&delete this.loaders[o]},p.destroyInternalLoaders=function(){for(var o in this.loaders){var u=this.loaders[o];u&&u.destroy(),this.resetInternalLoader(o)}},p.destroy=function(){this.unregisterListeners(),this.destroyInternalLoaders()},p.onManifestLoading=function(o,u){var c=u.url;this.load({id:null,groupId:null,level:0,responseType:"text",type:s.PlaylistContextType.MANIFEST,url:c,deliveryDirectives:null})},p.onLevelLoading=function(o,u){var c=u.id,_=u.level,y=u.url,f=u.deliveryDirectives;this.load({id:c,groupId:null,level:_,responseType:"text",type:s.PlaylistContextType.LEVEL,url:y,deliveryDirectives:f})},p.onAudioTrackLoading=function(o,u){var c=u.id,_=u.groupId,y=u.url,f=u.deliveryDirectives;this.load({id:c,groupId:_,level:null,responseType:"text",type:s.PlaylistContextType.AUDIO_TRACK,url:y,deliveryDirectives:f})},p.onSubtitleTrackLoading=function(o,u){var c=u.id,_=u.groupId,y=u.url,f=u.deliveryDirectives;this.load({id:c,groupId:_,level:null,responseType:"text",type:s.PlaylistContextType.SUBTITLE_TRACK,url:y,deliveryDirectives:f})},p.load=function(o){var u,c=this.hls.config,_=this.getInternalLoader(o);if(_){var y=_.context;if(y&&y.url===o.url){e.logger.trace("[playlist-loader]: playlist request ongoing");return}e.logger.log("[playlist-loader]: aborting previous loader for type: "+o.type),_.abort()}var f,C,L,R;switch(o.type){case s.PlaylistContextType.MANIFEST:f=c.manifestLoadingMaxRetry,C=c.manifestLoadingTimeOut,L=c.manifestLoadingRetryDelay,R=c.manifestLoadingMaxRetryTimeout;break;case s.PlaylistContextType.LEVEL:case s.PlaylistContextType.AUDIO_TRACK:case s.PlaylistContextType.SUBTITLE_TRACK:f=0,C=c.levelLoadingTimeOut;break;default:f=c.levelLoadingMaxRetry,C=c.levelLoadingTimeOut,L=c.levelLoadingRetryDelay,R=c.levelLoadingMaxRetryTimeout;break}if(_=this.createInternalLoader(o),(u=o.deliveryDirectives)!==null&&u!==void 0&&u.part){var O;if(o.type===s.PlaylistContextType.LEVEL&&o.level!==null?O=this.hls.levels[o.level].details:o.type===s.PlaylistContextType.AUDIO_TRACK&&o.id!==null?O=this.hls.audioTracks[o.id].details:o.type===s.PlaylistContextType.SUBTITLE_TRACK&&o.id!==null&&(O=this.hls.subtitleTracks[o.id].details),O){var g=O.partTarget,m=O.targetduration;g&&m&&(C=Math.min(Math.max(g*3,m*.8)*1e3,C))}}var d={timeout:C,maxRetry:f,retryDelay:L,maxRetryDelay:R,highWaterMark:0},h={onSuccess:this.loadsuccess.bind(this),onError:this.loaderror.bind(this),onTimeout:this.loadtimeout.bind(this)};_.load(o,d,h)},p.loadsuccess=function(o,u,c,_){_===void 0&&(_=null),this.resetInternalLoader(c.type);var y=o.data;if(y.indexOf("#EXTM3U")!==0){this.handleManifestParsingError(o,c,"no EXTM3U delimiter",_);return}u.parsing.start=performance.now(),y.indexOf("#EXTINF:")>0||y.indexOf("#EXT-X-TARGETDURATION:")>0?this.handleTrackOrLevelPlaylist(o,u,c,_):this.handleMasterPlaylist(o,u,c,_)},p.loaderror=function(o,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!1,o)},p.loadtimeout=function(o,u,c){c===void 0&&(c=null),this.handleNetworkError(u,c,!0)},p.handleMasterPlaylist=function(o,u,c,_){var y=this.hls,f=o.data,C=r(o,c),L=E.default.parseMasterPlaylist(f,C),R=L.levels,O=L.sessionData,g=L.sessionKeys;if(!R.length){this.handleManifestParsingError(o,c,"no level found in manifest",_);return}var m=R.map(function(D){return{id:D.attrs.AUDIO,audioCodec:D.audioCodec}}),d=R.map(function(D){return{id:D.attrs.SUBTITLES,textCodec:D.textCodec}}),h=E.default.parseMasterPlaylistMedia(f,C,"AUDIO",m),A=E.default.parseMasterPlaylistMedia(f,C,"SUBTITLES",d),w=E.default.parseMasterPlaylistMedia(f,C,"CLOSED-CAPTIONS");if(h.length){var x=h.some(function(D){return!D.url});!x&&R[0].audioCodec&&!R[0].attrs.AUDIO&&(e.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),h.unshift({type:"main",name:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new n.AttrList({}),bitrate:0,url:""}))}y.trigger(T.Events.MANIFEST_LOADED,{levels:R,audioTracks:h,subtitles:A,captions:w,url:C,stats:u,networkDetails:_,sessionData:O,sessionKeys:g})},p.handleTrackOrLevelPlaylist=function(o,u,c,_){var y=this.hls,f=c.id,C=c.level,L=c.type,R=r(o,c),O=(0,P.isFiniteNumber)(f)?f:0,g=(0,P.isFiniteNumber)(C)?C:O,m=t(c),d=E.default.parseLevelPlaylist(o.data,R,g,m,O);if(!d.fragments.length){y.trigger(T.Events.ERROR,{type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.LEVEL_EMPTY_ERROR,fatal:!1,url:R,reason:"no fragments found in level",level:typeof c.level=="number"?c.level:void 0});return}if(L===s.PlaylistContextType.MANIFEST){var h={attrs:new n.AttrList({}),bitrate:0,details:d,name:"",url:R};y.trigger(T.Events.MANIFEST_LOADED,{levels:[h],audioTracks:[],url:R,stats:u,networkDetails:_,sessionData:null,sessionKeys:null})}u.parsing.end=performance.now(),c.levelDetails=d,this.handlePlaylistLoaded(o,u,c,_)},p.handleManifestParsingError=function(o,u,c,_){this.hls.trigger(T.Events.ERROR,{type:b.ErrorTypes.NETWORK_ERROR,details:b.ErrorDetails.MANIFEST_PARSING_ERROR,fatal:u.type===s.PlaylistContextType.MANIFEST,url:o.url,reason:c,response:o,context:u,networkDetails:_})},p.handleNetworkError=function(o,u,c,_){c===void 0&&(c=!1),e.logger.warn("[playlist-loader]: A network "+(c?"timeout":"error")+" occurred while loading "+o.type+" level: "+o.level+" id: "+o.id+' group-id: "'+o.groupId+'"');var y=b.ErrorDetails.UNKNOWN,f=!1,C=this.getInternalLoader(o);switch(o.type){case s.PlaylistContextType.MANIFEST:y=c?b.ErrorDetails.MANIFEST_LOAD_TIMEOUT:b.ErrorDetails.MANIFEST_LOAD_ERROR,f=!0;break;case s.PlaylistContextType.LEVEL:y=c?b.ErrorDetails.LEVEL_LOAD_TIMEOUT:b.ErrorDetails.LEVEL_LOAD_ERROR,f=!1;break;case s.PlaylistContextType.AUDIO_TRACK:y=c?b.ErrorDetails.AUDIO_TRACK_LOAD_TIMEOUT:b.ErrorDetails.AUDIO_TRACK_LOAD_ERROR,f=!1;break;case s.PlaylistContextType.SUBTITLE_TRACK:y=c?b.ErrorDetails.SUBTITLE_TRACK_LOAD_TIMEOUT:b.ErrorDetails.SUBTITLE_LOAD_ERROR,f=!1;break}C&&this.resetInternalLoader(o.type);var L={type:b.ErrorTypes.NETWORK_ERROR,details:y,fatal:f,url:o.url,loader:C,context:o,networkDetails:u};_&&(L.response=_),this.hls.trigger(T.Events.ERROR,L)},p.handlePlaylistLoaded=function(o,u,c,_){var y=c.type,f=c.level,C=c.id,L=c.groupId,R=c.loader,O=c.levelDetails,g=c.deliveryDirectives;if(!(O!=null&&O.targetduration)){this.handleManifestParsingError(o,c,"invalid target duration",_);return}if(R)switch(O.live&&(R.getCacheAge&&(O.ageHeader=R.getCacheAge()||0),(!R.getCacheAge||isNaN(O.ageHeader))&&(O.ageHeader=0)),y){case s.PlaylistContextType.MANIFEST:case s.PlaylistContextType.LEVEL:this.hls.trigger(T.Events.LEVEL_LOADED,{details:O,level:f||0,id:C||0,stats:u,networkDetails:_,deliveryDirectives:g});break;case s.PlaylistContextType.AUDIO_TRACK:this.hls.trigger(T.Events.AUDIO_TRACK_LOADED,{details:O,id:C||0,groupId:L||"",stats:u,networkDetails:_,deliveryDirectives:g});break;case s.PlaylistContextType.SUBTITLE_TRACK:this.hls.trigger(T.Events.SUBTITLE_TRACK_LOADED,{details:O,id:C||0,groupId:L||"",stats:u,networkDetails:_,deliveryDirectives:g});break}},v}();const a=i},"./src/polyfills/number.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{MAX_SAFE_INTEGER:()=>T,isFiniteNumber:()=>P});var P=Number.isFinite||function(b){return typeof b=="number"&&isFinite(b)},T=Number.MAX_SAFE_INTEGER||9007199254740991},"./src/remux/aac-helper.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>T});var P=function(){function b(){}return b.getSilentFrame=function(E,s){switch(E){case"mp4a.40.2":if(s===1)return new Uint8Array([0,200,0,128,35,128]);if(s===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(s===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(s===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(s===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(s===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(s===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(s===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(s===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}},b}();const T=P},"./src/remux/mp4-generator.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>b});var P=Math.pow(2,32)-1,T=function(){function e(){}return e.init=function(){e.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 s;for(s in e.types)e.types.hasOwnProperty(s)&&(e.types[s]=[s.charCodeAt(0),s.charCodeAt(1),s.charCodeAt(2),s.charCodeAt(3)]);var n=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]),t=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]);e.HDLR_TYPES={video:n,audio:t};var r=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),i=new Uint8Array([0,0,0,0,0,0,0,0]);e.STTS=e.STSC=e.STCO=i,e.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),e.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),e.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),e.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);var a=new Uint8Array([105,115,111,109]),v=new Uint8Array([97,118,99,49]),p=new Uint8Array([0,0,0,1]);e.FTYP=e.box(e.types.ftyp,a,p,a,v),e.DINF=e.box(e.types.dinf,e.box(e.types.dref,r))},e.box=function(s){for(var n=8,t=arguments.length,r=new Array(t>1?t-1:0),i=1;i<t;i++)r[i-1]=arguments[i];for(var a=r.length,v=a;a--;)n+=r[a].byteLength;var p=new Uint8Array(n);for(p[0]=n>>24&255,p[1]=n>>16&255,p[2]=n>>8&255,p[3]=n&255,p.set(s,4),a=0,n=8;a<v;a++)p.set(r[a],n),n+=r[a].byteLength;return p},e.hdlr=function(s){return e.box(e.types.hdlr,e.HDLR_TYPES[s])},e.mdat=function(s){return e.box(e.types.mdat,s)},e.mdhd=function(s,n){n*=s;var t=Math.floor(n/(P+1)),r=Math.floor(n%(P+1));return e.box(e.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,t>>24,t>>16&255,t>>8&255,t&255,r>>24,r>>16&255,r>>8&255,r&255,85,196,0,0]))},e.mdia=function(s){return e.box(e.types.mdia,e.mdhd(s.timescale,s.duration),e.hdlr(s.type),e.minf(s))},e.mfhd=function(s){return e.box(e.types.mfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255]))},e.minf=function(s){return s.type==="audio"?e.box(e.types.minf,e.box(e.types.smhd,e.SMHD),e.DINF,e.stbl(s)):e.box(e.types.minf,e.box(e.types.vmhd,e.VMHD),e.DINF,e.stbl(s))},e.moof=function(s,n,t){return e.box(e.types.moof,e.mfhd(s),e.traf(t,n))},e.moov=function(s){for(var n=s.length,t=[];n--;)t[n]=e.trak(s[n]);return e.box.apply(null,[e.types.moov,e.mvhd(s[0].timescale,s[0].duration)].concat(t).concat(e.mvex(s)))},e.mvex=function(s){for(var n=s.length,t=[];n--;)t[n]=e.trex(s[n]);return e.box.apply(null,[e.types.mvex].concat(t))},e.mvhd=function(s,n){n*=s;var t=Math.floor(n/(P+1)),r=Math.floor(n%(P+1)),i=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,s>>24&255,s>>16&255,s>>8&255,s&255,t>>24,t>>16&255,t>>8&255,t&255,r>>24,r>>16&255,r>>8&255,r&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 e.box(e.types.mvhd,i)},e.sdtp=function(s){var n=s.samples||[],t=new Uint8Array(4+n.length),r,i;for(r=0;r<n.length;r++)i=n[r].flags,t[r+4]=i.dependsOn<<4|i.isDependedOn<<2|i.hasRedundancy;return e.box(e.types.sdtp,t)},e.stbl=function(s){return e.box(e.types.stbl,e.stsd(s),e.box(e.types.stts,e.STTS),e.box(e.types.stsc,e.STSC),e.box(e.types.stsz,e.STSZ),e.box(e.types.stco,e.STCO))},e.avc1=function(s){var n=[],t=[],r,i,a;for(r=0;r<s.sps.length;r++)i=s.sps[r],a=i.byteLength,n.push(a>>>8&255),n.push(a&255),n=n.concat(Array.prototype.slice.call(i));for(r=0;r<s.pps.length;r++)i=s.pps[r],a=i.byteLength,t.push(a>>>8&255),t.push(a&255),t=t.concat(Array.prototype.slice.call(i));var v=e.box(e.types.avcC,new Uint8Array([1,n[3],n[4],n[5],255,224|s.sps.length].concat(n).concat([s.pps.length]).concat(t))),p=s.width,l=s.height,o=s.pixelRatio[0],u=s.pixelRatio[1];return e.box(e.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,p>>8&255,p&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]),v,e.box(e.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),e.box(e.types.pasp,new Uint8Array([o>>24,o>>16&255,o>>8&255,o&255,u>>24,u>>16&255,u>>8&255,u&255])))},e.esds=function(s){var n=s.config.length;return new Uint8Array([0,0,0,0,3,23+n,0,1,0,4,15+n,64,21,0,0,0,0,0,0,0,0,0,0,0,5].concat([n]).concat(s.config).concat([6,1,2]))},e.mp4a=function(s){var n=s.samplerate;return e.box(e.types.mp4a,new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,s.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]),e.box(e.types.esds,e.esds(s)))},e.mp3=function(s){var n=s.samplerate;return e.box(e.types[".mp3"],new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,s.channelCount,0,16,0,0,0,0,n>>8&255,n&255,0,0]))},e.stsd=function(s){return s.type==="audio"?s.segmentCodec==="mp3"&&s.codec==="mp3"?e.box(e.types.stsd,e.STSD,e.mp3(s)):e.box(e.types.stsd,e.STSD,e.mp4a(s)):e.box(e.types.stsd,e.STSD,e.avc1(s))},e.tkhd=function(s){var n=s.id,t=s.duration*s.timescale,r=s.width,i=s.height,a=Math.floor(t/(P+1)),v=Math.floor(t%(P+1));return e.box(e.types.tkhd,new Uint8Array([1,0,0,7,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,0,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,v>>24,v>>16&255,v>>8&255,v&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,r>>8&255,r&255,0,0,i>>8&255,i&255,0,0]))},e.traf=function(s,n){var t=e.sdtp(s),r=s.id,i=Math.floor(n/(P+1)),a=Math.floor(n%(P+1));return e.box(e.types.traf,e.box(e.types.tfhd,new Uint8Array([0,0,0,0,r>>24,r>>16&255,r>>8&255,r&255])),e.box(e.types.tfdt,new Uint8Array([1,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,a>>24,a>>16&255,a>>8&255,a&255])),e.trun(s,t.length+16+20+8+16+8+8),t)},e.trak=function(s){return s.duration=s.duration||4294967295,e.box(e.types.trak,e.tkhd(s),e.mdia(s))},e.trex=function(s){var n=s.id;return e.box(e.types.trex,new Uint8Array([0,0,0,0,n>>24,n>>16&255,n>>8&255,n&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))},e.trun=function(s,n){var t=s.samples||[],r=t.length,i=12+16*r,a=new Uint8Array(i),v,p,l,o,u,c;for(n+=8+i,a.set([s.type==="video"?1:0,0,15,1,r>>>24&255,r>>>16&255,r>>>8&255,r&255,n>>>24&255,n>>>16&255,n>>>8&255,n&255],0),v=0;v<r;v++)p=t[v],l=p.duration,o=p.size,u=p.flags,c=p.cts,a.set([l>>>24&255,l>>>16&255,l>>>8&255,l&255,o>>>24&255,o>>>16&255,o>>>8&255,o&255,u.isLeading<<2|u.dependsOn,u.isDependedOn<<6|u.hasRedundancy<<4|u.paddingValue<<1|u.isNonSync,u.degradPrio&61440,u.degradPrio&15,c>>>24&255,c>>>16&255,c>>>8&255,c&255],12+16*v);return e.box(e.types.trun,a)},e.initSegment=function(s){e.types||e.init();var n=e.moov(s),t=new Uint8Array(e.FTYP.byteLength+n.byteLength);return t.set(e.FTYP),t.set(n,e.FTYP.byteLength),t},e}();T.types=void 0,T.HDLR_TYPES=void 0,T.STTS=void 0,T.STSC=void 0,T.STCO=void 0,T.STSZ=void 0,T.VMHD=void 0,T.SMHD=void 0,T.STSD=void 0,T.FTYP=void 0,T.DINF=void 0;const b=T},"./src/remux/mp4-remuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>o,flushTextTrackMetadataCueSamples:()=>_,flushTextTrackUserdataCueSamples:()=>y,normalizePts:()=>u});var P=S("./src/polyfills/number.ts"),T=S("./src/remux/aac-helper.ts"),b=S("./src/remux/mp4-generator.ts"),e=S("./src/events.ts"),E=S("./src/errors.ts"),s=S("./src/utils/logger.ts"),n=S("./src/types/loader.ts"),t=S("./src/utils/timescale-conversion.ts");function r(){return r=Object.assign?Object.assign.bind():function(L){for(var R=1;R<arguments.length;R++){var O=arguments[R];for(var g in O)Object.prototype.hasOwnProperty.call(O,g)&&(L[g]=O[g])}return L},r.apply(this,arguments)}var i=10*1e3,a=1024,v=1152,p=null,l=null,o=function(){function L(O,g,m,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.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.observer=O,this.config=g,this.typeSupported=m,this.ISGenerated=!1,p===null){var h=navigator.userAgent||"",A=h.match(/Chrome\/(\d+)/i);p=A?parseInt(A[1]):0}if(l===null){var w=navigator.userAgent.match(/Safari\/(\d+)/i);l=w?parseInt(w[1]):0}}var R=L.prototype;return R.destroy=function(){},R.resetTimeStamp=function(g){s.logger.log("[mp4-remuxer]: initPTS & initDTS reset"),this._initPTS=this._initDTS=g},R.resetNextTimestamp=function(){s.logger.log("[mp4-remuxer]: reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1},R.resetInitSegment=function(){s.logger.log("[mp4-remuxer]: ISGenerated flag reset"),this.ISGenerated=!1},R.getVideoStartPts=function(g){var m=!1,d=g.reduce(function(h,A){var w=A.pts-h;return w<-4294967296?(m=!0,u(h,A.pts)):w>0?h:A.pts},g[0].pts);return m&&s.logger.debug("PTS rollover detected"),d},R.remux=function(g,m,d,h,A,w,x,D){var I,F,K,W,z,j,G=A,Z=A,Q=g.pid>-1,ue=m.pid>-1,ee=m.samples.length,ae=g.samples.length>0,_e=x&&ee>0||ee>1,xe=(!Q||ae)&&(!ue||_e)||this.ISGenerated||x;if(xe){this.ISGenerated||(K=this.generateIS(g,m,A));var ge=this.isVideoContiguous,ce=-1,he;if(_e&&(ce=c(m.samples),!ge&&this.config.forceKeyFrameOnDiscontinuity))if(j=!0,ce>0){s.logger.warn("[mp4-remuxer]: Dropped "+ce+" out of "+ee+" video samples due to a missing keyframe");var Se=this.getVideoStartPts(m.samples);m.samples=m.samples.slice(ce),m.dropped+=ce,Z+=(m.samples[0].pts-Se)/m.inputTimeScale,he=Z}else ce===-1&&(s.logger.warn("[mp4-remuxer]: No keyframe found out of "+ee+" video samples"),j=!1);if(this.ISGenerated){if(ae&&_e){var Te=this.getVideoStartPts(m.samples),ke=u(g.samples[0].pts,Te)-Te,X=ke/m.inputTimeScale;G+=Math.max(0,X),Z+=Math.max(0,-X)}if(ae){if(g.samplerate||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as audio detected"),K=this.generateIS(g,m,A)),F=this.remuxAudio(g,G,this.isAudioContiguous,w,ue||_e||D===n.PlaylistLevelType.AUDIO?Z:void 0),_e){var te=F?F.endPTS-F.startPTS:0;m.inputTimeScale||(s.logger.warn("[mp4-remuxer]: regenerate InitSegment as video detected"),K=this.generateIS(g,m,A)),I=this.remuxVideo(m,Z,ge,te)}}else _e&&(I=this.remuxVideo(m,Z,ge,0));I&&(I.firstKeyFrame=ce,I.independent=ce!==-1,I.firstKeyFramePTS=he)}}return this.ISGenerated&&(d.samples.length&&(z=_(d,A,this._initPTS,this._initDTS)),h.samples.length&&(W=y(h,A,this._initPTS))),{audio:F,video:I,initSegment:K,independent:j,text:W,id3:z}},R.generateIS=function(g,m,d){var h=g.samples,A=m.samples,w=this.typeSupported,x={},D=!(0,P.isFiniteNumber)(this._initPTS),I="audio/mp4",F,K,W;if(D&&(F=K=1/0),g.config&&h.length){switch(g.timescale=g.samplerate,g.segmentCodec){case"mp3":w.mpeg?(I="audio/mpeg",g.codec=""):w.mp3&&(g.codec="mp3");break}x.audio={id:"audio",container:I,codec:g.codec,initSegment:g.segmentCodec==="mp3"&&w.mpeg?new Uint8Array(0):b.default.initSegment([g]),metadata:{channelCount:g.channelCount}},D&&(W=g.inputTimeScale,F=K=h[0].pts-Math.round(W*d))}if(m.sps&&m.pps&&A.length&&(m.timescale=m.inputTimeScale,x.video={id:"main",container:"video/mp4",codec:m.codec,initSegment:b.default.initSegment([m]),metadata:{width:m.width,height:m.height}},D)){W=m.inputTimeScale;var z=this.getVideoStartPts(A),j=Math.round(W*d);K=Math.min(K,u(A[0].dts,z)-j),F=Math.min(F,z-j)}if(Object.keys(x).length)return this.ISGenerated=!0,D&&(this._initPTS=F,this._initDTS=K),{tracks:x,initPTS:F,timescale:W}},R.remuxVideo=function(g,m,d,h){var A=g.inputTimeScale,w=g.samples,x=[],D=w.length,I=this._initPTS,F=this.nextAvcDts,K=8,W=this.videoSampleDuration,z,j,G=Number.POSITIVE_INFINITY,Z=Number.NEGATIVE_INFINITY,Q=!1;if(!d||F===null){var ue=m*A,ee=w[0].pts-u(w[0].dts,w[0].pts);F=ue-ee}for(var ae=0;ae<D;ae++){var _e=w[ae];_e.pts=u(_e.pts-I,F),_e.dts=u(_e.dts-I,F),_e.dts<w[ae>0?ae-1:ae].dts&&(Q=!0)}Q&&w.sort(function(ft,at){var ot=ft.dts-at.dts,_t=ft.pts-at.pts;return ot||_t}),z=w[0].dts,j=w[w.length-1].dts;var xe=j-z,ge=xe?Math.round(xe/(D-1)):W||g.inputTimeScale/30;if(d){var ce=z-F,he=ce>ge,Se=ce<-1;if((he||Se)&&(he?s.logger.warn("AVC: "+(0,t.toMsFromMpegTsClock)(ce,!0)+" ms ("+ce+"dts) hole between fragments detected, filling it"):s.logger.warn("AVC: "+(0,t.toMsFromMpegTsClock)(-ce,!0)+" ms ("+ce+"dts) overlapping between fragments detected"),!Se||F>w[0].pts)){z=F;var Te=w[0].pts-ce;w[0].dts=z,w[0].pts=Te,s.logger.log("Video: First PTS/DTS adjusted: "+(0,t.toMsFromMpegTsClock)(Te,!0)+"/"+(0,t.toMsFromMpegTsClock)(z,!0)+", delta: "+(0,t.toMsFromMpegTsClock)(ce,!0)+" ms")}}z=Math.max(0,z);for(var ke=0,X=0,te=0;te<D;te++){for(var pe=w[te],me=pe.units,be=me.length,de=0,Be=0;Be<be;Be++)de+=me[Be].data.length;X+=de,ke+=be,pe.length=de,pe.dts=Math.max(pe.dts,z),G=Math.min(pe.pts,G),Z=Math.max(pe.pts,Z)}j=w[D-1].dts;var we=X+4*ke+8,Le;try{Le=new Uint8Array(we)}catch(ft){this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:E.ErrorTypes.MUX_ERROR,details:E.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:we,reason:"fail allocating video mdat "+we});return}var Ae=new DataView(Le.buffer);Ae.setUint32(0,we),Le.set(b.default.types.mdat,4);for(var Ve=!1,De=Number.POSITIVE_INFINITY,ye=Number.POSITIVE_INFINITY,Ee=Number.NEGATIVE_INFINITY,Oe=Number.NEGATIVE_INFINITY,Fe=0;Fe<D;Fe++){for(var Ke=w[Fe],ze=Ke.units,Ye=0,Ie=0,je=ze.length;Ie<je;Ie++){var qe=ze[Ie],Pe=qe.data,Ze=qe.data.byteLength;Ae.setUint32(K,Ze),K+=4,Le.set(Pe,K),K+=Ze,Ye+=4+Ze}var se=void 0;if(Fe<D-1)W=w[Fe+1].dts-Ke.dts,se=w[Fe+1].pts-Ke.pts;else{var ie=this.config,le=Fe>0?Ke.dts-w[Fe-1].dts:ge;if(se=Fe>0?Ke.pts-w[Fe-1].pts:ge,ie.stretchShortVideoTrack&&this.nextAudioPts!==null){var V=Math.floor(ie.maxBufferHole*A),J=(h?G+h*A:this.nextAudioPts)-Ke.pts;J>V?(W=J-le,W<0?W=le:Ve=!0,s.logger.log("[mp4-remuxer]: It is approximately "+J/90+" ms to the next segment; using duration "+W/90+" ms for the last video frame.")):W=le}else W=le}var q=Math.round(Ke.pts-Ke.dts);De=Math.min(De,W),Ee=Math.max(Ee,W),ye=Math.min(ye,se),Oe=Math.max(Oe,se),x.push(new f(Ke.key,W,Ye,q))}if(x.length){if(p){if(p<70){var fe=x[0].flags;fe.dependsOn=2,fe.isNonSync=0}}else if(l&&Oe-ye<Ee-De&&ge/Ee<.025&&x[0].cts===0){s.logger.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");for(var ne=z,ve=0,Ce=x.length;ve<Ce;ve++){var Ue=ne+x[ve].duration,We=ne+x[ve].cts;if(ve<Ce-1){var nt=Ue+x[ve+1].cts;x[ve].duration=nt-We}else x[ve].duration=ve?x[ve-1].duration:ge;x[ve].cts=0,ne=Ue}}}console.assert(W!==null,"mp4SampleDuration must be computed"),W=Ve||!W?ge:W,this.nextAvcDts=F=j+W,this.videoSampleDuration=W,this.isVideoContiguous=!0;var et=b.default.moof(g.sequenceNumber++,z,r({},g,{samples:x})),Je="video",$e={data1:et,data2:Le,startPTS:G/A,endPTS:(Z+W)/A,startDTS:z/A,endDTS:F/A,type:Je,hasAudio:!1,hasVideo:!0,nb:x.length,dropped:g.dropped};return g.samples=[],g.dropped=0,console.assert(Le.length,"MDAT length must not be zero"),$e},R.remuxAudio=function(g,m,d,h,A){var w=g.inputTimeScale,x=g.samplerate?g.samplerate:w,D=w/x,I=g.segmentCodec==="aac"?a:v,F=I*D,K=this._initPTS,W=g.segmentCodec==="mp3"&&this.typeSupported.mpeg,z=[],j=A!==void 0,G=g.samples,Z=W?0:8,Q=this.nextAudioPts||-1,ue=m*w;if(this.isAudioContiguous=d=d||G.length&&Q>0&&(h&&Math.abs(ue-Q)<9e3||Math.abs(u(G[0].pts-K,ue)-Q)<20*F),G.forEach(function(qe){qe.pts=u(qe.pts-K,ue)}),!d||Q<0){if(G=G.filter(function(qe){return qe.pts>=0}),!G.length)return;A===0?Q=0:h&&!j?Q=Math.max(0,ue):Q=G[0].pts}if(g.segmentCodec==="aac")for(var ee=this.config.maxAudioFramesDrift,ae=0,_e=Q;ae<G.length;ae++){var xe=G[ae],ge=xe.pts,ce=ge-_e,he=Math.abs(1e3*ce/w);if(ce<=-ee*F&&j)ae===0&&(s.logger.warn("Audio frame @ "+(ge/w).toFixed(3)+"s overlaps nextAudioPts by "+Math.round(1e3*ce/w)+" ms."),this.nextAudioPts=Q=_e=ge);else if(ce>=ee*F&&he<i&&j){var Se=Math.round(ce/F);_e=ge-Se*F,_e<0&&(Se--,_e+=F),ae===0&&(this.nextAudioPts=Q=_e),s.logger.warn("[mp4-remuxer]: Injecting "+Se+" audio frame @ "+(_e/w).toFixed(3)+"s due to "+Math.round(1e3*ce/w)+" ms gap.");for(var Te=0;Te<Se;Te++){var ke=Math.max(_e,0),X=T.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);X||(s.logger.log("[mp4-remuxer]: Unable to get silent frame for given audio codec; duplicating last frame instead."),X=xe.unit.subarray()),G.splice(ae,0,{unit:X,pts:ke}),_e+=F,ae++}}xe.pts=_e,_e+=F}for(var te=null,pe=null,me,be=0,de=G.length;de--;)be+=G[de].unit.byteLength;for(var Be=0,we=G.length;Be<we;Be++){var Le=G[Be],Ae=Le.unit,Ve=Le.pts;if(pe!==null){var De=z[Be-1];De.duration=Math.round((Ve-pe)/D)}else if(d&&g.segmentCodec==="aac"&&(Ve=Q),te=Ve,be>0){be+=Z;try{me=new Uint8Array(be)}catch(qe){this.observer.emit(e.Events.ERROR,e.Events.ERROR,{type:E.ErrorTypes.MUX_ERROR,details:E.ErrorDetails.REMUX_ALLOC_ERROR,fatal:!1,bytes:be,reason:"fail allocating audio mdat "+be});return}if(!W){var ye=new DataView(me.buffer);ye.setUint32(0,be),me.set(b.default.types.mdat,4)}}else return;me.set(Ae,Z);var Ee=Ae.byteLength;Z+=Ee,z.push(new f(!0,I,Ee,0)),pe=Ve}var Oe=z.length;if(Oe){var Fe=z[z.length-1];this.nextAudioPts=Q=pe+D*Fe.duration;var Ke=W?new Uint8Array(0):b.default.moof(g.sequenceNumber++,te/D,r({},g,{samples:z}));g.samples=[];var ze=te/w,Ye=Q/w,Ie="audio",je={data1:Ke,data2:me,startPTS:ze,endPTS:Ye,startDTS:ze,endDTS:Ye,type:Ie,hasAudio:!0,hasVideo:!1,nb:Oe};return this.isAudioContiguous=!0,console.assert(me.length,"MDAT length must not be zero"),je}},R.remuxEmptyAudio=function(g,m,d,h){var A=g.inputTimeScale,w=g.samplerate?g.samplerate:A,x=A/w,D=this.nextAudioPts,I=(D!==null?D:h.startDTS*A)+this._initDTS,F=h.endDTS*A+this._initDTS,K=x*a,W=Math.ceil((F-I)/K),z=T.default.getSilentFrame(g.manifestCodec||g.codec,g.channelCount);if(s.logger.warn("[mp4-remuxer]: remux empty Audio"),!z){s.logger.trace("[mp4-remuxer]: Unable to remuxEmptyAudio since we were unable to get a silent frame for given audio codec");return}for(var j=[],G=0;G<W;G++){var Z=I+G*K;j.push({unit:z,pts:Z,dts:Z})}return g.samples=j,this.remuxAudio(g,m,d,!1)},L}();function u(L,R){var O;if(R===null)return L;for(R<L?O=-8589934592:O=8589934592;Math.abs(L-R)>4294967296;)L+=O;return L}function c(L){for(var R=0;R<L.length;R++)if(L[R].key)return R;return-1}function _(L,R,O,g){var m=L.samples.length;if(m){for(var d=L.inputTimeScale,h=0;h<m;h++){var A=L.samples[h];A.pts=u(A.pts-O,R*d)/d,A.dts=u(A.dts-g,R*d)/d}var w=L.samples;return L.samples=[],{samples:w}}}function y(L,R,O){var g=L.samples.length;if(g){for(var m=L.inputTimeScale,d=0;d<g;d++){var h=L.samples[d];h.pts=u(h.pts-O,R*m)/m}L.samples.sort(function(w,x){return w.pts-x.pts});var A=L.samples;return L.samples=[],{samples:A}}}var f=function(R,O,g,m){this.size=void 0,this.duration=void 0,this.cts=void 0,this.flags=void 0,this.duration=O,this.size=g,this.cts=m,this.flags=new C(R)},C=function(R){this.isLeading=0,this.isDependedOn=0,this.hasRedundancy=0,this.degradPrio=0,this.dependsOn=1,this.isNonSync=1,this.dependsOn=R?2:1,this.isNonSync=R?0:1}},"./src/remux/passthrough-remuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>t});var P=S("./src/polyfills/number.ts"),T=S("./src/remux/mp4-remuxer.ts"),b=S("./src/utils/mp4-tools.ts"),e=S("./src/loader/fragment.ts"),E=S("./src/utils/logger.ts"),s=function(){function r(){this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=void 0,this.initTracks=void 0,this.lastEndTime=null}var i=r.prototype;return i.destroy=function(){},i.resetTimeStamp=function(v){this.initPTS=v,this.lastEndTime=null},i.resetNextTimestamp=function(){this.lastEndTime=null},i.resetInitSegment=function(v,p,l,o){this.audioCodec=p,this.videoCodec=l,this.generateInitSegment((0,b.patchEncyptionData)(v,o)),this.emitInitSegment=!0},i.generateInitSegment=function(v){var p=this.audioCodec,l=this.videoCodec;if(!v||!v.byteLength){this.initTracks=void 0,this.initData=void 0;return}var o=this.initData=(0,b.parseInitSegment)(v);p||(p=n(o.audio,e.ElementaryStreamTypes.AUDIO)),l||(l=n(o.video,e.ElementaryStreamTypes.VIDEO));var u={};o.audio&&o.video?u.audiovideo={container:"video/mp4",codec:p+","+l,initSegment:v,id:"main"}:o.audio?u.audio={container:"audio/mp4",codec:p,initSegment:v,id:"audio"}:o.video?u.video={container:"video/mp4",codec:l,initSegment:v,id:"main"}:E.logger.warn("[passthrough-remuxer.ts]: initSegment does not contain moov or trak boxes."),this.initTracks=u},i.remux=function(v,p,l,o,u){var c,_=this.initPTS,y=this.lastEndTime,f={audio:void 0,video:void 0,text:o,id3:l,initSegment:void 0};(0,P.isFiniteNumber)(y)||(y=this.lastEndTime=u||0);var C=p.samples;if(!C||!C.length)return f;var L={initPTS:void 0,timescale:1},R=this.initData;if((!R||!R.length)&&(this.generateInitSegment(C),R=this.initData),!R||!R.length)return E.logger.warn("[passthrough-remuxer.ts]: Failed to generate initSegment."),f;this.emitInitSegment&&(L.tracks=this.initTracks,this.emitInitSegment=!1);var O=(0,b.getStartDTS)(R,C);(0,P.isFiniteNumber)(_)||(this.initPTS=L.initPTS=_=O-u);var g=(0,b.getDuration)(C,R),m=v?O-_:y,d=m+g;(0,b.offsetStartDTS)(R,C,_),g>0?this.lastEndTime=d:(E.logger.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());var h=!!R.audio,A=!!R.video,w="";h&&(w+="audio"),A&&(w+="video");var x={data1:C,startPTS:m,startDTS:m,endPTS:d,endDTS:d,type:w,hasAudio:h,hasVideo:A,nb:1,dropped:0};f.audio=x.type==="audio"?x:void 0,f.video=x.type!=="audio"?x:void 0,f.initSegment=L;var D=(c=this.initPTS)!=null?c:0;return f.id3=(0,T.flushTextTrackMetadataCueSamples)(l,u,D,D),o.samples.length&&(f.text=(0,T.flushTextTrackUserdataCueSamples)(o,u,D)),f},r}();function n(r,i){var a=r==null?void 0:r.codec;return a&&a.length>4?a:a==="hvc1"||a==="hev1"?"hvc1.1.c.L120.90":a==="av01"?"av01.0.04M.08":a==="avc1"||i===e.ElementaryStreamTypes.VIDEO?"avc1.42e01e":"mp4a.40.5"}const t=s},"./src/task-loop.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>P});var P=function(){function T(){this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}var b=T.prototype;return b.destroy=function(){this.onHandlerDestroying(),this.onHandlerDestroyed()},b.onHandlerDestroying=function(){this.clearNextTick(),this.clearInterval()},b.onHandlerDestroyed=function(){},b.hasInterval=function(){return!!this._tickInterval},b.hasNextTick=function(){return!!this._tickTimer},b.setInterval=function(E){return this._tickInterval?!1:(this._tickInterval=self.setInterval(this._boundTick,E),!0)},b.clearInterval=function(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1},b.clearNextTick=function(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1},b.tick=function(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)},b.tickImmediate=function(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)},b.doTick=function(){},T}()},"./src/types/cmcd.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{CMCDObjectType:()=>T,CMCDStreamType:()=>e,CMCDStreamingFormat:()=>b,CMCDVersion:()=>P});var P=1,T;(function(E){E.MANIFEST="m",E.AUDIO="a",E.VIDEO="v",E.MUXED="av",E.INIT="i",E.CAPTION="c",E.TIMED_TEXT="tt",E.KEY="k",E.OTHER="o"})(T||(T={}));var b;(function(E){E.DASH="d",E.HLS="h",E.SMOOTH="s",E.OTHER="o"})(b||(b={}));var e;(function(E){E.VOD="v",E.LIVE="l"})(e||(e={}))},"./src/types/demuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{MetadataSchema:()=>P});var P;(function(T){T.audioId3="org.id3",T.dateRange="com.apple.quicktime.HLS",T.emsg="https://aomedia.org/emsg/ID3"})(P||(P={}))},"./src/types/level.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{HdcpLevels:()=>E,HlsSkip:()=>s,HlsUrlParameters:()=>t,Level:()=>r,getSkipValue:()=>n});function P(i,a){for(var v=0;v<a.length;v++){var p=a[v];p.enumerable=p.enumerable||!1,p.configurable=!0,"value"in p&&(p.writable=!0),Object.defineProperty(i,b(p.key),p)}}function T(i,a,v){return a&&P(i.prototype,a),v&&P(i,v),Object.defineProperty(i,"prototype",{writable:!1}),i}function b(i){var a=e(i,"string");return typeof a=="symbol"?a:String(a)}function e(i,a){if(typeof i!="object"||i===null)return i;var v=i[Symbol.toPrimitive];if(v!==void 0){var p=v.call(i,a||"default");if(typeof p!="object")return p;throw new TypeError("@@toPrimitive must return a primitive value.")}return(a==="string"?String:Number)(i)}var E=["NONE","TYPE-0","TYPE-1","TYPE-2",null],s;(function(i){i.No="",i.Yes="YES",i.v2="v2"})(s||(s={}));function n(i,a){var v=i.canSkipUntil,p=i.canSkipDateRanges,l=i.endSN,o=a!==void 0?a-l:0;return v&&o<v?p?s.v2:s.Yes:s.No}var t=function(){function i(v,p,l){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=v,this.part=p,this.skip=l}var a=i.prototype;return a.addDirectives=function(p){var l=new self.URL(p);return this.msn!==void 0&&l.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&l.searchParams.set("_HLS_part",this.part.toString()),this.skip&&l.searchParams.set("_HLS_skip",this.skip),l.href},i}(),r=function(){function i(a){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=[a.url],this.attrs=a.attrs,this.bitrate=a.bitrate,a.details&&(this.details=a.details),this.id=a.id||0,this.name=a.name,this.width=a.width||0,this.height=a.height||0,this.audioCodec=a.audioCodec,this.videoCodec=a.videoCodec,this.unknownCodecs=a.unknownCodecs,this.codecSet=[a.videoCodec,a.audioCodec].filter(function(v){return v}).join(",").replace(/\.[^.,]+/g,"")}return T(i,[{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(v){var p=v%this.url.length;this._urlId!==p&&(this.details=void 0,this._urlId=p)}}]),i}()},"./src/types/loader.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{PlaylistContextType:()=>P,PlaylistLevelType:()=>T});var P;(function(b){b.MANIFEST="manifest",b.LEVEL="level",b.AUDIO_TRACK="audioTrack",b.SUBTITLE_TRACK="subtitleTrack"})(P||(P={}));var T;(function(b){b.MAIN="main",b.AUDIO="audio",b.SUBTITLE="subtitle"})(T||(T={}))},"./src/types/transmuxer.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{ChunkMetadata:()=>P});var P=function(e,E,s,n,t,r){n===void 0&&(n=0),t===void 0&&(t=-1),r===void 0&&(r=!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=T(),this.buffering={audio:T(),video:T(),audiovideo:T()},this.level=e,this.sn=E,this.id=s,this.size=n,this.part=t,this.partial=r};function T(){return{start:0,executeStart:0,executeEnd:0,end:0}}},"./src/utils/attr-list.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{AttrList:()=>b});var P=/^(\d+)x(\d+)$/,T=/\s*(.+?)\s*=((?:\".*?\")|.*?)(?:,|$)/g,b=function(){function e(s){typeof s=="string"&&(s=e.parseAttrList(s));for(var n in s)s.hasOwnProperty(n)&&(this[n]=s[n])}var E=e.prototype;return E.decimalInteger=function(n){var t=parseInt(this[n],10);return t>Number.MAX_SAFE_INTEGER?1/0:t},E.hexadecimalInteger=function(n){if(this[n]){var t=(this[n]||"0x").slice(2);t=(t.length&1?"0":"")+t;for(var r=new Uint8Array(t.length/2),i=0;i<t.length/2;i++)r[i]=parseInt(t.slice(i*2,i*2+2),16);return r}else return null},E.hexadecimalIntegerAsNumber=function(n){var t=parseInt(this[n],16);return t>Number.MAX_SAFE_INTEGER?1/0:t},E.decimalFloatingPoint=function(n){return parseFloat(this[n])},E.optionalFloat=function(n,t){var r=this[n];return r?parseFloat(r):t},E.enumeratedString=function(n){return this[n]},E.bool=function(n){return this[n]==="YES"},E.decimalResolution=function(n){var t=P.exec(this[n]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}},e.parseAttrList=function(n){var t,r={},i='"';for(T.lastIndex=0;(t=T.exec(n))!==null;){var a=t[2];a.indexOf(i)===0&&a.lastIndexOf(i)===a.length-1&&(a=a.slice(1,-1)),r[t[1]]=a}return r},e}()},"./src/utils/binary-search.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>T});var P={search:function(e,E){for(var s=0,n=e.length-1,t=null,r=null;s<=n;){t=(s+n)/2|0,r=e[t];var i=E(r);if(i>0)s=t+1;else if(i<0)n=t-1;else return r}return null}};const T=P},"./src/utils/buffer-helper.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{BufferHelper:()=>b});var P=S("./src/utils/logger.ts"),T={length:0,start:function(){return 0},end:function(){return 0}},b=function(){function e(){}return e.isBuffered=function(s,n){try{if(s){for(var t=e.getBuffered(s),r=0;r<t.length;r++)if(n>=t.start(r)&&n<=t.end(r))return!0}}catch(i){}return!1},e.bufferInfo=function(s,n,t){try{if(s){var r=e.getBuffered(s),i=[],a;for(a=0;a<r.length;a++)i.push({start:r.start(a),end:r.end(a)});return this.bufferedInfo(i,n,t)}}catch(v){}return{len:0,start:n,end:n,nextStart:void 0}},e.bufferedInfo=function(s,n,t){n=Math.max(0,n),s.sort(function(f,C){var L=f.start-C.start;return L||C.end-f.end});var r=[];if(t)for(var i=0;i<s.length;i++){var a=r.length;if(a){var v=r[a-1].end;s[i].start-v<t?s[i].end>v&&(r[a-1].end=s[i].end):r.push(s[i])}else r.push(s[i])}else r=s;for(var p=0,l,o=n,u=n,c=0;c<r.length;c++){var _=r[c].start,y=r[c].end;if(n+t>=_&&n<y)o=_,u=y,p=u-n;else if(n+t<_){l=_;break}}return{len:p,start:o||0,end:u||0,nextStart:l}},e.getBuffered=function(s){try{return s.buffered}catch(n){return P.logger.log("failed to get media.buffered",n),T}},e}()},"./src/utils/cea-608-parser.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{CaptionScreen:()=>c,Row:()=>u,default:()=>R});var P=S("./src/utils/logger.ts"),T={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},b=function(g){var m=g;return T.hasOwnProperty(g)&&(m=T[g]),String.fromCharCode(m)},e=15,E=100,s={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},n={17:2,18:4,21:6,22:8,23:10,19:13,20:15},t={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},r={25:2,26:4,29:6,30:8,31:10,27:13,28:15},i=["white","green","blue","cyan","red","yellow","magenta","black","transparent"],a;(function(O){O[O.ERROR=0]="ERROR",O[O.TEXT=1]="TEXT",O[O.WARNING=2]="WARNING",O[O.INFO=2]="INFO",O[O.DEBUG=3]="DEBUG",O[O.DATA=3]="DATA"})(a||(a={}));var v=function(){function O(){this.time=null,this.verboseLevel=a.ERROR}var g=O.prototype;return g.log=function(d,h){if(this.verboseLevel>=d){var A=typeof h=="function"?h():h;P.logger.log(this.time+" ["+d+"] "+A)}},O}(),p=function(g){for(var m=[],d=0;d<g.length;d++)m.push(g[d].toString(16));return m},l=function(){function O(m,d,h,A,w){this.foreground=void 0,this.underline=void 0,this.italics=void 0,this.background=void 0,this.flash=void 0,this.foreground=m||"white",this.underline=d||!1,this.italics=h||!1,this.background=A||"black",this.flash=w||!1}var g=O.prototype;return g.reset=function(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1},g.setStyles=function(d){for(var h=["foreground","underline","italics","background","flash"],A=0;A<h.length;A++){var w=h[A];d.hasOwnProperty(w)&&(this[w]=d[w])}},g.isDefault=function(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash},g.equals=function(d){return this.foreground===d.foreground&&this.underline===d.underline&&this.italics===d.italics&&this.background===d.background&&this.flash===d.flash},g.copy=function(d){this.foreground=d.foreground,this.underline=d.underline,this.italics=d.italics,this.background=d.background,this.flash=d.flash},g.toString=function(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash},O}(),o=function(){function O(m,d,h,A,w,x){this.uchar=void 0,this.penState=void 0,this.uchar=m||" ",this.penState=new l(d,h,A,w,x)}var g=O.prototype;return g.reset=function(){this.uchar=" ",this.penState.reset()},g.setChar=function(d,h){this.uchar=d,this.penState.copy(h)},g.setPenState=function(d){this.penState.copy(d)},g.equals=function(d){return this.uchar===d.uchar&&this.penState.equals(d.penState)},g.copy=function(d){this.uchar=d.uchar,this.penState.copy(d.penState)},g.isEmpty=function(){return this.uchar===" "&&this.penState.isDefault()},O}(),u=function(){function O(m){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<E;d++)this.chars.push(new o);this.logger=m,this.pos=0,this.currPenState=new l}var g=O.prototype;return g.equals=function(d){for(var h=!0,A=0;A<E;A++)if(!this.chars[A].equals(d.chars[A])){h=!1;break}return h},g.copy=function(d){for(var h=0;h<E;h++)this.chars[h].copy(d.chars[h])},g.isEmpty=function(){for(var d=!0,h=0;h<E;h++)if(!this.chars[h].isEmpty()){d=!1;break}return d},g.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>E&&(this.logger.log(a.DEBUG,"Too large cursor position "+this.pos),this.pos=E)},g.moveCursor=function(d){var h=this.pos+d;if(d>1)for(var A=this.pos+1;A<h+1;A++)this.chars[A].setPenState(this.currPenState);this.setCursor(h)},g.backSpace=function(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)},g.insertChar=function(d){var h=this;d>=144&&this.backSpace();var A=b(d);if(this.pos>=E){this.logger.log(a.ERROR,function(){return"Cannot insert "+d.toString(16)+" ("+A+") at position "+h.pos+". Skipping it!"});return}this.chars[this.pos].setChar(A,this.currPenState),this.moveCursor(1)},g.clearFromPos=function(d){var h;for(h=d;h<E;h++)this.chars[h].reset()},g.clear=function(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()},g.clearToEndOfRow=function(){this.clearFromPos(this.pos)},g.getTextString=function(){for(var d=[],h=!0,A=0;A<E;A++){var w=this.chars[A].uchar;w!==" "&&(h=!1),d.push(w)}return h?"":d.join("")},g.setPenStyles=function(d){this.currPenState.setStyles(d);var h=this.chars[this.pos];h.setPenState(this.currPenState)},O}(),c=function(){function O(m){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<e;d++)this.rows.push(new u(m));this.logger=m,this.currRow=e-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.reset()}var g=O.prototype;return g.reset=function(){for(var d=0;d<e;d++)this.rows[d].clear();this.currRow=e-1},g.equals=function(d){for(var h=!0,A=0;A<e;A++)if(!this.rows[A].equals(d.rows[A])){h=!1;break}return h},g.copy=function(d){for(var h=0;h<e;h++)this.rows[h].copy(d.rows[h])},g.isEmpty=function(){for(var d=!0,h=0;h<e;h++)if(!this.rows[h].isEmpty()){d=!1;break}return d},g.backSpace=function(){var d=this.rows[this.currRow];d.backSpace()},g.clearToEndOfRow=function(){var d=this.rows[this.currRow];d.clearToEndOfRow()},g.insertChar=function(d){var h=this.rows[this.currRow];h.insertChar(d)},g.setPen=function(d){var h=this.rows[this.currRow];h.setPenStyles(d)},g.moveCursor=function(d){var h=this.rows[this.currRow];h.moveCursor(d)},g.setCursor=function(d){this.logger.log(a.INFO,"setCursor: "+d);var h=this.rows[this.currRow];h.setCursor(d)},g.setPAC=function(d){this.logger.log(a.INFO,function(){return"pacData = "+JSON.stringify(d)});var h=d.row-1;if(this.nrRollUpRows&&h<this.nrRollUpRows-1&&(h=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==h){for(var A=0;A<e;A++)this.rows[A].clear();var w=this.currRow+1-this.nrRollUpRows,x=this.lastOutputScreen;if(x){var D=x.rows[w].cueStartTime,I=this.logger.time;if(D&&I!==null&&D<I)for(var F=0;F<this.nrRollUpRows;F++)this.rows[h-this.nrRollUpRows+F+1].copy(x.rows[w+F])}}this.currRow=h;var K=this.rows[this.currRow];if(d.indent!==null){var W=d.indent,z=Math.max(W-1,0);K.setCursor(d.indent),d.color=K.chars[z].penState.foreground}var j={foreground:d.color,underline:d.underline,italics:d.italics,background:"black",flash:!1};this.setPen(j)},g.setBkgData=function(d){this.logger.log(a.INFO,function(){return"bkgData = "+JSON.stringify(d)}),this.backSpace(),this.setPen(d),this.insertChar(32)},g.setRollUpRows=function(d){this.nrRollUpRows=d},g.rollUp=function(){var d=this;if(this.nrRollUpRows===null){this.logger.log(a.DEBUG,"roll_up but nrRollUpRows not set yet");return}this.logger.log(a.TEXT,function(){return d.getDisplayText()});var h=this.currRow+1-this.nrRollUpRows,A=this.rows.splice(h,1)[0];A.clear(),this.rows.splice(this.currRow,0,A),this.logger.log(a.INFO,"Rolling up")},g.getDisplayText=function(d){d=d||!1;for(var h=[],A="",w=-1,x=0;x<e;x++){var D=this.rows[x].getTextString();D&&(w=x+1,d?h.push("Row "+w+": '"+D+"'"):h.push(D.trim()))}return h.length>0&&(d?A="["+h.join(" | ")+"]":A=h.join(`
`)),A},g.getTextAndFormat=function(){return this.rows},O}(),_=function(){function O(m,d,h){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=m,this.outputFilter=d,this.mode=null,this.verbose=0,this.displayedMemory=new c(h),this.nonDisplayedMemory=new c(h),this.lastOutputScreen=new c(h),this.currRollUpRow=this.displayedMemory.rows[e-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=h}var g=O.prototype;return g.reset=function(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[e-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null},g.getHandler=function(){return this.outputFilter},g.setHandler=function(d){this.outputFilter=d},g.setPAC=function(d){this.writeScreen.setPAC(d)},g.setBkgData=function(d){this.writeScreen.setBkgData(d)},g.setMode=function(d){d!==this.mode&&(this.mode=d,this.logger.log(a.INFO,function(){return"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)},g.insertChars=function(d){for(var h=this,A=0;A<d.length;A++)this.writeScreen.insertChar(d[A]);var w=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(a.INFO,function(){return w+": "+h.writeScreen.getDisplayText(!0)}),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(a.TEXT,function(){return"DISPLAYED: "+h.displayedMemory.getDisplayText(!0)}),this.outputDataUpdate())},g.ccRCL=function(){this.logger.log(a.INFO,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")},g.ccBS=function(){this.logger.log(a.INFO,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())},g.ccAOF=function(){},g.ccAON=function(){},g.ccDER=function(){this.logger.log(a.INFO,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()},g.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)},g.ccFON=function(){this.logger.log(a.INFO,"FON - Flash On"),this.writeScreen.setPen({flash:!0})},g.ccRDC=function(){this.logger.log(a.INFO,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")},g.ccTR=function(){this.logger.log(a.INFO,"TR"),this.setMode("MODE_TEXT")},g.ccRTD=function(){this.logger.log(a.INFO,"RTD"),this.setMode("MODE_TEXT")},g.ccEDM=function(){this.logger.log(a.INFO,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)},g.ccCR=function(){this.logger.log(a.INFO,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)},g.ccENM=function(){this.logger.log(a.INFO,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()},g.ccEOC=function(){var d=this;if(this.logger.log(a.INFO,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){var h=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=h,this.writeScreen=this.nonDisplayedMemory,this.logger.log(a.TEXT,function(){return"DISP: "+d.displayedMemory.getDisplayText()})}this.outputDataUpdate(!0)},g.ccTO=function(d){this.logger.log(a.INFO,"TO("+d+") - Tab Offset"),this.writeScreen.moveCursor(d)},g.ccMIDROW=function(d){var h={flash:!1};if(h.underline=d%2===1,h.italics=d>=46,h.italics)h.foreground="white";else{var A=Math.floor(d/2)-16,w=["white","green","blue","cyan","red","yellow","magenta"];h.foreground=w[A]}this.logger.log(a.INFO,"MIDROW: "+JSON.stringify(h)),this.writeScreen.setPen(h)},g.outputDataUpdate=function(d){d===void 0&&(d=!1);var h=this.logger.time;h!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=h:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,h,this.lastOutputScreen),d&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:h),this.lastOutputScreen.copy(this.displayedMemory))},g.cueSplitAtTime=function(d){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,d,this.displayedMemory),this.cueStartTime=d))},O}(),y=function(){function O(m,d,h){this.channels=void 0,this.currentChannel=0,this.cmdHistory=void 0,this.logger=void 0;var A=new v;this.channels=[null,new _(m,d,A),new _(m+1,h,A)],this.cmdHistory=L(),this.logger=A}var g=O.prototype;return g.getHandler=function(d){return this.channels[d].getHandler()},g.setHandler=function(d,h){this.channels[d].setHandler(h)},g.addData=function(d,h){var A,w,x,D=!1;this.logger.time=d;for(var I=0;I<h.length;I+=2)if(w=h[I]&127,x=h[I+1]&127,!(w===0&&x===0)){if(this.logger.log(a.DATA,"["+p([h[I],h[I+1]])+"] -> ("+p([w,x])+")"),A=this.parseCmd(w,x),A||(A=this.parseMidrow(w,x)),A||(A=this.parsePAC(w,x)),A||(A=this.parseBackgroundAttributes(w,x)),!A&&(D=this.parseChars(w,x),D)){var F=this.currentChannel;if(F&&F>0){var K=this.channels[F];K.insertChars(D)}else this.logger.log(a.WARNING,"No channel found yet. TEXT-MODE?")}!A&&!D&&this.logger.log(a.WARNING,"Couldn't parse cleaned data "+p([w,x])+" orig: "+p([h[I],h[I+1]]))}},g.parseCmd=function(d,h){var A=this.cmdHistory,w=(d===20||d===28||d===21||d===29)&&h>=32&&h<=47,x=(d===23||d===31)&&h>=33&&h<=35;if(!(w||x))return!1;if(C(d,h,A))return f(null,null,A),this.logger.log(a.DEBUG,"Repeated command ("+p([d,h])+") is dropped"),!0;var D=d===20||d===21||d===23?1:2,I=this.channels[D];return d===20||d===21||d===28||d===29?h===32?I.ccRCL():h===33?I.ccBS():h===34?I.ccAOF():h===35?I.ccAON():h===36?I.ccDER():h===37?I.ccRU(2):h===38?I.ccRU(3):h===39?I.ccRU(4):h===40?I.ccFON():h===41?I.ccRDC():h===42?I.ccTR():h===43?I.ccRTD():h===44?I.ccEDM():h===45?I.ccCR():h===46?I.ccENM():h===47&&I.ccEOC():I.ccTO(h-32),f(d,h,A),this.currentChannel=D,!0},g.parseMidrow=function(d,h){var A=0;if((d===17||d===25)&&h>=32&&h<=47){if(d===17?A=1:A=2,A!==this.currentChannel)return this.logger.log(a.ERROR,"Mismatch channel in midrow parsing"),!1;var w=this.channels[A];return w?(w.ccMIDROW(h),this.logger.log(a.DEBUG,"MIDROW ("+p([d,h])+")"),!0):!1}return!1},g.parsePAC=function(d,h){var A,w=this.cmdHistory,x=(d>=17&&d<=23||d>=25&&d<=31)&&h>=64&&h<=127,D=(d===16||d===24)&&h>=64&&h<=95;if(!(x||D))return!1;if(C(d,h,w))return f(null,null,w),!0;var I=d<=23?1:2;h>=64&&h<=95?A=I===1?s[d]:t[d]:A=I===1?n[d]:r[d];var F=this.channels[I];return F?(F.setPAC(this.interpretPAC(A,h)),f(d,h,w),this.currentChannel=I,!0):!1},g.interpretPAC=function(d,h){var A,w={color:null,italics:!1,indent:null,underline:!1,row:d};return h>95?A=h-96:A=h-64,w.underline=(A&1)===1,A<=13?w.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(A/2)]:A<=15?(w.italics=!0,w.color="white"):w.indent=Math.floor((A-16)/2)*4,w},g.parseChars=function(d,h){var A,w=null,x=null;if(d>=25?(A=2,x=d-8):(A=1,x=d),x>=17&&x<=19){var D;x===17?D=h+80:x===18?D=h+112:D=h+144,this.logger.log(a.INFO,"Special char '"+b(D)+"' in channel "+A),w=[D]}else d>=32&&d<=127&&(w=h===0?[d]:[d,h]);if(w){var I=p(w);this.logger.log(a.DEBUG,"Char codes = "+I.join(",")),f(d,h,this.cmdHistory)}return w},g.parseBackgroundAttributes=function(d,h){var A=(d===16||d===24)&&h>=32&&h<=47,w=(d===23||d===31)&&h>=45&&h<=47;if(!(A||w))return!1;var x,D={};d===16||d===24?(x=Math.floor((h-32)/2),D.background=i[x],h%2===1&&(D.background=D.background+"_semi")):h===45?D.background="transparent":(D.foreground="black",h===47&&(D.underline=!0));var I=d<=23?1:2,F=this.channels[I];return F.setBkgData(D),f(d,h,this.cmdHistory),!0},g.reset=function(){for(var d=0;d<Object.keys(this.channels).length;d++){var h=this.channels[d];h&&h.reset()}this.cmdHistory=L()},g.cueSplitAtTime=function(d){for(var h=0;h<this.channels.length;h++){var A=this.channels[h];A&&A.cueSplitAtTime(d)}},O}();function f(O,g,m){m.a=O,m.b=g}function C(O,g,m){return m.a===O&&m.b===g}function L(){return{a:null,b:null}}const R=y},"./src/utils/codecs.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{isCodecSupportedInMp4:()=>b,isCodecType:()=>T});var P={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,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,dva1:!0,dvav:!0,dvh1:!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 T(e,E){var s=P[E];return!!s&&s[e.slice(0,4)]===!0}function b(e,E){return MediaSource.isTypeSupported((E||"video")+'/mp4;codecs="'+e+'"')}},"./src/utils/cues.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>s});var P=S("./src/utils/vttparser.ts"),T=S("./src/utils/webvtt-parser.ts"),b=S("./src/utils/texttrack-utils.ts"),e=/\s/,E={newCue:function(t,r,i,a){for(var v=[],p,l,o,u,c,_=self.VTTCue||self.TextTrackCue,y=0;y<a.rows.length;y++)if(p=a.rows[y],o=!0,u=0,c="",!p.isEmpty()){for(var f=0;f<p.chars.length;f++)e.test(p.chars[f].uchar)&&o?u++:(c+=p.chars[f].uchar,o=!1);p.cueStartTime=r,r===i&&(i+=1e-4),u>=16?u--:u++;var C=(0,P.fixLineBreaks)(c.trim()),L=(0,T.generateCueId)(r,i,C);(!t||!t.cues||!t.cues.getCueById(L))&&(l=new _(r,i,C),l.id=L,l.line=y+1,l.align="left",l.position=10+Math.min(80,Math.floor(u*8/32)*10),v.push(l))}return t&&v.length&&(v.sort(function(R,O){return R.line==="auto"||O.line==="auto"?0:R.line>8&&O.line>8?O.line-R.line:R.line-O.line}),v.forEach(function(R){return(0,b.addCueToTrack)(t,R)})),v}};const s=E},"./src/utils/discontinuities.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{adjustSlidingStart:()=>t,alignMediaPlaylistByPDT:()=>v,alignPDT:()=>a,alignStream:()=>r,findDiscontinuousReferenceFrag:()=>s,findFirstFragWithCC:()=>e,shouldAlignOnDiscontinuities:()=>E});var P=S("./src/polyfills/number.ts"),T=S("./src/utils/logger.ts"),b=S("./src/controller/level-helper.ts");function e(p,l){for(var o=null,u=0,c=p.length;u<c;u++){var _=p[u];if(_&&_.cc===l){o=_;break}}return o}function E(p,l,o){return!!(l.details&&(o.endCC>o.startCC||p&&p.cc<o.startCC))}function s(p,l,o){o===void 0&&(o=0);var u=p.fragments,c=l.fragments;if(!c.length||!u.length){T.logger.log("No fragments to align");return}var _=e(u,c[0].cc);if(!_||_&&!_.startPTS){T.logger.log("No frag in previous level to align on");return}return _}function n(p,l){if(p){var o=p.start+l;p.start=p.startPTS=o,p.endPTS=o+p.duration}}function t(p,l){for(var o=l.fragments,u=0,c=o.length;u<c;u++)n(o[u],p);l.fragmentHint&&n(l.fragmentHint,p),l.alignedSliding=!0}function r(p,l,o){l&&(i(p,o,l),!o.alignedSliding&&l.details&&a(o,l.details),!o.alignedSliding&&l.details&&!o.skippedSegments&&(0,b.adjustSliding)(l.details,o))}function i(p,l,o){if(E(p,o,l)){var u=s(o.details,l);u&&(0,P.isFiniteNumber)(u.start)&&(T.logger.log("Adjusting PTS using last level due to CC increase within current level "+l.url),t(u.start,l))}}function a(p,l){if(!(!l.fragments.length||!p.hasProgramDateTime||!l.hasProgramDateTime)){var o=l.fragments[0].programDateTime,u=p.fragments[0].programDateTime,c=(u-o)/1e3+l.fragments[0].start;c&&(0,P.isFiniteNumber)(c)&&(T.logger.log("Adjusting PTS using programDateTime delta "+(u-o)+"ms, sliding:"+c.toFixed(3)+" "+p.url+" "),t(c,p))}}function v(p,l){if(!(!p.hasProgramDateTime||!l.hasProgramDateTime)){var o=p.fragments,u=l.fragments;if(!(!o.length||!u.length)){var c=Math.round(u.length/2)-1,_=u[c],y=e(o,_.cc)||o[Math.round(o.length/2)-1],f=_.programDateTime,C=y.programDateTime;if(!(f===null||C===null)){var L=(C-f)/1e3-(y.start-_.start);t(L,p)}}}}},"./src/utils/ewma-bandwidth-estimator.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>b});var P=S("./src/utils/ewma.ts"),T=function(){function e(s,n,t){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultEstimate_=t,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new P.default(s),this.fast_=new P.default(n)}var E=e.prototype;return E.update=function(n,t){var r=this.slow_,i=this.fast_;this.slow_.halfLife!==n&&(this.slow_=new P.default(n,r.getEstimate(),r.getTotalWeight())),this.fast_.halfLife!==t&&(this.fast_=new P.default(t,i.getEstimate(),i.getTotalWeight()))},E.sample=function(n,t){n=Math.max(n,this.minDelayMs_);var r=8*t,i=n/1e3,a=r/i;this.fast_.sample(i,a),this.slow_.sample(i,a)},E.canEstimate=function(){var n=this.fast_;return n&&n.getTotalWeight()>=this.minWeight_},E.getEstimate=function(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_},E.destroy=function(){},e}();const b=T},"./src/utils/ewma.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>T});var P=function(){function b(E,s,n){s===void 0&&(s=0),n===void 0&&(n=0),this.halfLife=void 0,this.alpha_=void 0,this.estimate_=void 0,this.totalWeight_=void 0,this.halfLife=E,this.alpha_=E?Math.exp(Math.log(.5)/E):0,this.estimate_=s,this.totalWeight_=n}var e=b.prototype;return e.sample=function(s,n){var t=Math.pow(this.alpha_,s);this.estimate_=n*(1-t)+t*this.estimate_,this.totalWeight_+=s},e.getTotalWeight=function(){return this.totalWeight_},e.getEstimate=function(){if(this.alpha_){var s=1-Math.pow(this.alpha_,this.totalWeight_);if(s)return this.estimate_/s}return this.estimate_},b}();const T=P},"./src/utils/fetch-loader.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>c,fetchSupported:()=>v});var P=S("./src/polyfills/number.ts"),T=S("./src/loader/load-stats.ts"),b=S("./src/demux/chunk-cache.ts");function e(_,y){_.prototype=Object.create(y.prototype),_.prototype.constructor=_,r(_,y)}function E(_){var y=typeof Map=="function"?new Map:void 0;return E=function(C){if(C===null||!t(C))return C;if(typeof C!="function")throw new TypeError("Super expression must either be null or a function");if(typeof y!="undefined"){if(y.has(C))return y.get(C);y.set(C,L)}function L(){return s(C,arguments,i(this).constructor)}return L.prototype=Object.create(C.prototype,{constructor:{value:L,enumerable:!1,writable:!0,configurable:!0}}),r(L,C)},E(_)}function s(_,y,f){return n()?s=Reflect.construct.bind():s=function(L,R,O){var g=[null];g.push.apply(g,R);var m=Function.bind.apply(L,g),d=new m;return O&&r(d,O.prototype),d},s.apply(null,arguments)}function n(){if(typeof Reflect=="undefined"||!Reflect.construct||Reflect.construct.sham)return!1;if(typeof Proxy=="function")return!0;try{return Boolean.prototype.valueOf.call(Reflect.construct(Boolean,[],function(){})),!0}catch(_){return!1}}function t(_){return Function.toString.call(_).indexOf("[native code]")!==-1}function r(_,y){return r=Object.setPrototypeOf?Object.setPrototypeOf.bind():function(C,L){return C.__proto__=L,C},r(_,y)}function i(_){return i=Object.setPrototypeOf?Object.getPrototypeOf.bind():function(f){return f.__proto__||Object.getPrototypeOf(f)},i(_)}function a(){return a=Object.assign?Object.assign.bind():function(_){for(var y=1;y<arguments.length;y++){var f=arguments[y];for(var C in f)Object.prototype.hasOwnProperty.call(f,C)&&(_[C]=f[C])}return _},a.apply(this,arguments)}function v(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch(_){}return!1}var p=function(){function _(f){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=f.fetchSetup||o,this.controller=new self.AbortController,this.stats=new T.LoadStats}var y=_.prototype;return y.destroy=function(){this.loader=this.callbacks=null,this.abortInternal()},y.abortInternal=function(){var C=this.response;(!C||!C.ok)&&(this.stats.aborted=!0,this.controller.abort())},y.abort=function(){var C;this.abortInternal(),(C=this.callbacks)!==null&&C!==void 0&&C.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)},y.load=function(C,L,R){var O=this,g=this.stats;if(g.loading.start)throw new Error("Loader can only be used once.");g.loading.start=self.performance.now();var m=l(C,this.controller.signal),d=R.onProgress,h=C.responseType==="arraybuffer",A=h?"byteLength":"length";this.context=C,this.config=L,this.callbacks=R,this.request=this.fetchSetup(C,m),self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(function(){O.abortInternal(),R.onTimeout(g,C,O.response)},L.timeout),self.fetch(this.request).then(function(w){if(O.response=O.loader=w,!w.ok){var x=w.status,D=w.statusText;throw new u(D||"fetch, bad network response",x,w)}return g.loading.first=Math.max(self.performance.now(),g.loading.start),g.total=parseInt(w.headers.get("Content-Length")||"0"),d&&(0,P.isFiniteNumber)(L.highWaterMark)?O.loadProgressively(w,g,C,L.highWaterMark,d):h?w.arrayBuffer():w.text()}).then(function(w){var x=O.response;self.clearTimeout(O.requestTimeout),g.loading.end=Math.max(self.performance.now(),g.loading.first);var D=w[A];D&&(g.loaded=g.total=D);var I={url:x.url,data:w};d&&!(0,P.isFiniteNumber)(L.highWaterMark)&&d(g,C,w,x),R.onSuccess(I,g,C,x)}).catch(function(w){if(self.clearTimeout(O.requestTimeout),!g.aborted){var x=w&&w.code||0,D=w?w.message:null;R.onError({code:x,text:D},C,w?w.details:null)}})},y.getCacheAge=function(){var C=null;if(this.response){var L=this.response.headers.get("age");C=L?parseFloat(L):null}return C},y.loadProgressively=function(C,L,R,O,g){O===void 0&&(O=0);var m=new b.default,d=C.body.getReader(),h=function A(){return d.read().then(function(w){if(w.done)return m.dataLength&&g(L,R,m.flush(),C),Promise.resolve(new ArrayBuffer(0));var x=w.value,D=x.length;return L.loaded+=D,D<O||m.dataLength?(m.push(x),m.dataLength>=O&&g(L,R,m.flush(),C)):g(L,R,x,C),A()}).catch(function(){return Promise.reject()})};return h()},_}();function l(_,y){var f={method:"GET",mode:"cors",credentials:"same-origin",signal:y,headers:new self.Headers(a({},_.headers))};return _.rangeEnd&&f.headers.set("Range","bytes="+_.rangeStart+"-"+String(_.rangeEnd-1)),f}function o(_,y){return new self.Request(_.url,y)}var u=function(_){e(y,_);function y(f,C,L){var R;return R=_.call(this,f)||this,R.code=void 0,R.details=void 0,R.code=C,R.details=L,R}return y}(E(Error));const c=p},"./src/utils/hex.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>T});var P={hexDump:function(e){for(var E="",s=0;s<e.length;s++){var n=e[s].toString(16);n.length<2&&(n="0"+n),E+=n}return E}};const T=P},"./src/utils/imsc1-ttml-parser.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{IMSC1_CODEC:()=>t,parseIMSC1:()=>v});var P=S("./src/utils/mp4-tools.ts"),T=S("./src/utils/vttparser.ts"),b=S("./src/utils/vttcue.ts"),e=S("./src/demux/id3.ts"),E=S("./src/utils/timescale-conversion.ts"),s=S("./src/utils/webvtt-parser.ts");function n(){return n=Object.assign?Object.assign.bind():function(R){for(var O=1;O<arguments.length;O++){var g=arguments[O];for(var m in g)Object.prototype.hasOwnProperty.call(g,m)&&(R[m]=g[m])}return R},n.apply(this,arguments)}var t="stpp.ttml.im1t",r=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,i=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,a={left:"start",center:"center",right:"end",start:"start",end:"end"};function v(R,O,g,m,d){var h=(0,P.findBox)(new Uint8Array(R),["mdat"]);if(h.length===0){d(new Error("Could not parse IMSC1 mdat"));return}var A=h.map(function(x){return(0,e.utf8ArrayToStr)(x)}),w=(0,E.toTimescaleFromScale)(O,1,g);try{A.forEach(function(x){return m(p(x,w))})}catch(x){d(x)}}function p(R,O){var g=new DOMParser,m=g.parseFromString(R,"text/xml"),d=m.getElementsByTagName("tt")[0];if(!d)throw new Error("Invalid ttml");var h={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},A=Object.keys(h).reduce(function(F,K){return F[K]=d.getAttribute("ttp:"+K)||h[K],F},{}),w=d.getAttribute("xml:space")!=="preserve",x=o(l(d,"styling","style")),D=o(l(d,"layout","region")),I=l(d,"body","[begin]");return[].map.call(I,function(F){var K=u(F,w);if(!K||!F.hasAttribute("begin"))return null;var W=f(F.getAttribute("begin"),A),z=f(F.getAttribute("dur"),A),j=f(F.getAttribute("end"),A);if(W===null)throw y(F);if(j===null){if(z===null)throw y(F);j=W+z}var G=new b.default(W-O,j-O,K);G.id=(0,s.generateCueId)(G.startTime,G.endTime,G.text);var Z=D[F.getAttribute("region")],Q=x[F.getAttribute("style")],ue=c(Z,Q,x),ee=ue.textAlign;if(ee){var ae=a[ee];ae&&(G.lineAlign=ae),G.align=ee}return n(G,ue),G}).filter(function(F){return F!==null})}function l(R,O,g){var m=R.getElementsByTagName(O)[0];return m?[].slice.call(m.querySelectorAll(g)):[]}function o(R){return R.reduce(function(O,g){var m=g.getAttribute("xml:id");return m&&(O[m]=g),O},{})}function u(R,O){return[].slice.call(R.childNodes).reduce(function(g,m,d){var h;return m.nodeName==="br"&&d?g+`
`:(h=m.childNodes)!==null&&h!==void 0&&h.length?u(m,O):O?g+m.textContent.trim().replace(/\s+/g," "):g+m.textContent},"")}function c(R,O,g){var m="http://www.w3.org/ns/ttml#styling",d=null,h=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],A=R!=null&&R.hasAttribute("style")?R.getAttribute("style"):null;return A&&g.hasOwnProperty(A)&&(d=g[A]),h.reduce(function(w,x){var D=_(O,m,x)||_(R,m,x)||_(d,m,x);return D&&(w[x]=D),w},{})}function _(R,O,g){return R&&R.hasAttributeNS(O,g)?R.getAttributeNS(O,g):null}function y(R){return new Error("Could not parse ttml timestamp "+R)}function f(R,O){if(!R)return null;var g=(0,T.parseTimeStamp)(R);return g===null&&(r.test(R)?g=C(R,O):i.test(R)&&(g=L(R,O))),g}function C(R,O){var g=r.exec(R),m=(g[4]|0)+(g[5]|0)/O.subFrameRate;return(g[1]|0)*3600+(g[2]|0)*60+(g[3]|0)+m/O.frameRate}function L(R,O){var g=i.exec(R),m=Number(g[1]),d=g[2];switch(d){case"h":return m*3600;case"m":return m*60;case"ms":return m*1e3;case"f":return m/O.frameRate;case"t":return m/O.tickRate}return m}},"./src/utils/keysystem-util.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{changeEndianness:()=>b,convertDataUriToArrayBytes:()=>e,strToUtf8array:()=>E});var P=S("./src/utils/numeric-encoding-utils.ts");function T(s){var n=E(s).subarray(0,16),t=new Uint8Array(16);return t.set(n,16-n.length),t}function b(s){var n=function(r,i,a){var v=r[i];r[i]=r[a],r[a]=v};n(s,0,3),n(s,1,2),n(s,4,5),n(s,6,7)}function e(s){var n=s.split(":"),t=null;if(n[0]==="data"&&n.length===2){var r=n[1].split(";"),i=r[r.length-1].split(",");if(i.length===2){var a=i[0]==="base64",v=i[1];a?(r.splice(-1,1),t=(0,P.base64Decode)(v)):t=T(v)}}return t}function E(s){return Uint8Array.from(unescape(encodeURIComponent(s)),function(n){return n.charCodeAt(0)})}},"./src/utils/logger.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{enableLogs:()=>s,logger:()=>n});var P=function(){},T={trace:P,debug:P,log:P,warn:P,info:P,error:P},b=T;function e(t){var r=self.console[t];return r?r.bind(self.console,"["+t+"] >"):P}function E(t){for(var r=arguments.length,i=new Array(r>1?r-1:0),a=1;a<r;a++)i[a-1]=arguments[a];i.forEach(function(v){b[v]=t[v]?t[v].bind(t):e(v)})}function s(t,r){if(self.console&&t===!0||typeof t=="object"){E(t,"debug","log","info","warn","error");try{b.log('Debug logs enabled for "'+r+'"')}catch(i){b=T}}else b=T}var n=b},"./src/utils/mediakeys-helper.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{KeySystemFormats:()=>T,KeySystemIds:()=>e,KeySystems:()=>P,getKeySystemsForConfig:()=>n,getSupportedMediaKeySystemConfigurations:()=>r,keySystemDomainToKeySystemFormat:()=>s,keySystemFormatToKeySystemDomain:()=>b,keySystemIdToKeySystemDomain:()=>E,requestMediaKeySystemAccess:()=>t});var P;(function(a){a.CLEARKEY="org.w3.clearkey",a.FAIRPLAY="com.apple.fps",a.PLAYREADY="com.microsoft.playready",a.WIDEVINE="com.widevine.alpha"})(P||(P={}));var T;(function(a){a.CLEARKEY="org.w3.clearkey",a.FAIRPLAY="com.apple.streamingkeydelivery",a.PLAYREADY="com.microsoft.playready",a.WIDEVINE="urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"})(T||(T={}));function b(a){switch(a){case T.FAIRPLAY:return P.FAIRPLAY;case T.PLAYREADY:return P.PLAYREADY;case T.WIDEVINE:return P.WIDEVINE;case T.CLEARKEY:return P.CLEARKEY}}var e;(function(a){a.WIDEVINE="edef8ba979d64acea3c827dcd51d21ed"})(e||(e={}));function E(a){if(a===e.WIDEVINE)return P.WIDEVINE}function s(a){switch(a){case P.FAIRPLAY:return T.FAIRPLAY;case P.PLAYREADY:return T.PLAYREADY;case P.WIDEVINE:return T.WIDEVINE;case P.CLEARKEY:return T.CLEARKEY}}function n(a){var v=a.drmSystems,p=a.widevineLicenseUrl,l=v?[P.FAIRPLAY,P.WIDEVINE,P.PLAYREADY,P.CLEARKEY].filter(function(o){return!!v[o]}):[];return!l[P.WIDEVINE]&&p&&l.push(P.WIDEVINE),l}var t=function(){return typeof self!="undefined"&&self.navigator&&self.navigator.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function r(a,v,p,l){var o;switch(a){case P.FAIRPLAY:o=["cenc","sinf"];break;case P.WIDEVINE:case P.PLAYREADY:o=["cenc"];break;case P.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error("Unknown key-system: "+a)}return i(o,v,p,l)}function i(a,v,p,l){var o={initDataTypes:a,persistentState:l.persistentState||"not-allowed",distinctiveIdentifier:l.distinctiveIdentifier||"not-allowed",sessionTypes:l.sessionTypes||[l.sessionType||"temporary"],audioCapabilities:v.map(function(u){return{contentType:'audio/mp4; codecs="'+u+'"',robustness:l.audioRobustness||"",encryptionScheme:l.audioEncryptionScheme||null}}),videoCapabilities:p.map(function(u){return{contentType:'video/mp4; codecs="'+u+'"',robustness:l.videoRobustness||"",encryptionScheme:l.videoEncryptionScheme||null}})};return[o]}},"./src/utils/mediasource-helper.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{getMediaSource:()=>P});function P(){return self.MediaSource||self.WebKitMediaSource}},"./src/utils/mp4-tools.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{RemuxerTrackIdConfig:()=>t,appendUint8Array:()=>O,bin2str:()=>r,computeRawDurationFromSamples:()=>C,discardEPB:()=>A,findBox:()=>l,getDuration:()=>f,getStartDTS:()=>y,mp4Box:()=>x,mp4pssh:()=>D,offsetStartDTS:()=>L,parseEmsg:()=>w,parseInitSegment:()=>u,parsePssh:()=>I,parseSEIMessageFromNALu:()=>h,parseSamples:()=>g,parseSegmentIndex:()=>o,parseSinf:()=>_,patchEncyptionData:()=>c,readSint32:()=>v,readUint16:()=>i,readUint32:()=>a,segmentValidRange:()=>R,writeUint32:()=>p});var P=S("./src/loader/fragment.ts"),T=S("./src/utils/typed-array.ts"),b=S("./src/demux/id3.ts"),e=S("./src/utils/logger.ts"),E=S("./src/utils/hex.ts"),s=Math.pow(2,32)-1,n=[].push,t={video:1,audio:2,id3:3,text:4};function r(F){return String.fromCharCode.apply(null,F)}function i(F,K){var W=F[K]<<8|F[K+1];return W<0?65536+W:W}function a(F,K){var W=v(F,K);return W<0?4294967296+W:W}function v(F,K){return F[K]<<24|F[K+1]<<16|F[K+2]<<8|F[K+3]}function p(F,K,W){F[K]=W>>24,F[K+1]=W>>16&255,F[K+2]=W>>8&255,F[K+3]=W&255}function l(F,K){var W=[];if(!K.length)return W;for(var z=F.byteLength,j=0;j<z;){var G=a(F,j),Z=r(F.subarray(j+4,j+8)),Q=G>1?j+G:z;if(Z===K[0])if(K.length===1)W.push(F.subarray(j+8,Q));else{var ue=l(F.subarray(j+8,Q),K.slice(1));ue.length&&n.apply(W,ue)}j=Q}return W}function o(F){var K=[],W=F[0],z=8,j=a(F,z);z+=4;var G=0,Z=0;W===0?z+=8:z+=16,z+=2;var Q=F.length+Z,ue=i(F,z);z+=2;for(var ee=0;ee<ue;ee++){var ae=z,_e=a(F,ae);ae+=4;var xe=_e&2147483647,ge=(_e&2147483648)>>>31;if(ge===1)return console.warn("SIDX has hierarchical references (not supported)"),null;var ce=a(F,ae);ae+=4,K.push({referenceSize:xe,subsegmentDuration:ce,info:{duration:ce/j,start:Q,end:Q+xe-1}}),Q+=xe,ae+=4,z=ae}return{earliestPresentationTime:G,timescale:j,version:W,referencesCount:ue,references:K}}function u(F){for(var K=[],W=l(F,["moov","trak"]),z=0;z<W.length;z++){var j=W[z],G=l(j,["tkhd"])[0];if(G){var Z=G[0],Q=Z===0?12:20,ue=a(G,Q),ee=l(j,["mdia","mdhd"])[0];if(ee){Z=ee[0],Q=Z===0?12:20;var ae=a(ee,Q),_e=l(j,["mdia","hdlr"])[0];if(_e){var xe=r(_e.subarray(8,12)),ge={soun:P.ElementaryStreamTypes.AUDIO,vide:P.ElementaryStreamTypes.VIDEO}[xe];if(ge){var ce=l(j,["mdia","minf","stbl","stsd"])[0],he=void 0;ce&&(he=r(ce.subarray(12,16))),K[ue]={timescale:ae,type:ge},K[ge]={timescale:ae,id:ue,codec:he}}}}}}var Se=l(F,["moov","mvex","trex"]);return Se.forEach(function(Te){var ke=a(Te,4),X=K[ke];X&&(X.default={duration:a(Te,12),flags:a(Te,20)})}),K}function c(F,K){if(!F||!K)return F;var W=K.keyId;if(W&&K.isCommonEncryption){var z=l(F,["moov","trak"]);z.forEach(function(j){var G=l(j,["mdia","minf","stbl","stsd"])[0],Z=G.subarray(8),Q=l(Z,["enca"]),ue=Q.length>0;ue||(Q=l(Z,["encv"])),Q.forEach(function(ee){var ae=ue?ee.subarray(28):ee.subarray(78),_e=l(ae,["sinf"]);_e.forEach(function(xe){var ge=_(xe);if(ge){var ce=ge.subarray(8,24);ce.some(function(he){return he!==0})||(e.logger.log("[eme] Patching keyId in 'enc"+(ue?"a":"v")+">sinf>>tenc' box: "+E.default.hexDump(ce)+" -> "+E.default.hexDump(W)),ge.set(W,8))}})})})}return F}function _(F){var K=l(F,["schm"])[0];if(K){var W=r(K.subarray(4,8));if(W==="cbcs"||W==="cenc")return l(F,["schi","tenc"])[0]}return e.logger.error("[eme] missing 'schm' box"),null}function y(F,K){return l(K,["moof","traf"]).reduce(function(W,z){var j=l(z,["tfdt"])[0],G=j[0],Z=l(z,["tfhd"]).reduce(function(Q,ue){var ee=a(ue,4),ae=F[ee];if(ae){var _e=a(j,4);G===1&&(_e*=Math.pow(2,32),_e+=a(j,8));var xe=ae.timescale||9e4,ge=_e/xe;if(isFinite(ge)&&(Q===null||ge<Q))return ge}return Q},null);return Z!==null&&isFinite(Z)&&(W===null||Z<W)?Z:W},null)||0}function f(F,K){for(var W=0,z=0,j=0,G=l(F,["moof","traf"]),Z=0;Z<G.length;Z++){var Q=G[Z],ue=l(Q,["tfhd"])[0],ee=a(ue,4),ae=K[ee];if(ae){var _e=ae.default,xe=a(ue,0)|(_e==null?void 0:_e.flags),ge=_e==null?void 0:_e.duration;xe&8&&(xe&2?ge=a(ue,12):ge=a(ue,8));for(var ce=ae.timescale||9e4,he=l(Q,["trun"]),Se=0;Se<he.length;Se++){if(W=C(he[Se]),!W&&ge){var Te=a(he[Se],4);W=ge*Te}ae.type===P.ElementaryStreamTypes.VIDEO?z+=W/ce:ae.type===P.ElementaryStreamTypes.AUDIO&&(j+=W/ce)}}}if(z===0&&j===0){for(var ke=0,X=l(F,["sidx"]),te=0;te<X.length;te++){var pe=o(X[te]);pe!=null&&pe.references&&(ke+=pe.references.reduce(function(me,be){return me+be.info.duration||0},0))}return ke}return z||j}function C(F){var K=a(F,0),W=8;K&1&&(W+=4),K&4&&(W+=4);for(var z=0,j=a(F,4),G=0;G<j;G++){if(K&256){var Z=a(F,W);z+=Z,W+=4}K&512&&(W+=4),K&1024&&(W+=4),K&2048&&(W+=4)}return z}function L(F,K,W){l(K,["moof","traf"]).forEach(function(z){l(z,["tfhd"]).forEach(function(j){var G=a(j,4),Z=F[G];if(Z){var Q=Z.timescale||9e4;l(z,["tfdt"]).forEach(function(ue){var ee=ue[0],ae=a(ue,4);if(ee===0)ae-=W*Q,ae=Math.max(ae,0),p(ue,4,ae);else{ae*=Math.pow(2,32),ae+=a(ue,8),ae-=W*Q,ae=Math.max(ae,0);var _e=Math.floor(ae/(s+1)),xe=Math.floor(ae%(s+1));p(ue,4,_e),p(ue,8,xe)}})}})})}function R(F){var K={valid:null,remainder:null},W=l(F,["moof"]);if(W){if(W.length<2)return K.remainder=F,K}else return K;var z=W[W.length-1];return K.valid=(0,T.sliceUint8)(F,0,z.byteOffset-8),K.remainder=(0,T.sliceUint8)(F,z.byteOffset-8),K}function O(F,K){var W=new Uint8Array(F.length+K.length);return W.set(F),W.set(K,F.length),W}function g(F,K){var W=[],z=K.samples,j=K.timescale,G=K.id,Z=!1,Q=l(z,["moof"]);return Q.map(function(ue){var ee=ue.byteOffset-8,ae=l(ue,["traf"]);ae.map(function(_e){var xe=l(_e,["tfdt"]).map(function(ge){var ce=ge[0],he=a(ge,4);return ce===1&&(he*=Math.pow(2,32),he+=a(ge,8)),he/j})[0];return xe!==void 0&&(F=xe),l(_e,["tfhd"]).map(function(ge){var ce=a(ge,4),he=a(ge,0)&16777215,Se=(he&1)!==0,Te=(he&2)!==0,ke=(he&8)!==0,X=0,te=(he&16)!==0,pe=0,me=(he&32)!==0,be=8;ce===G&&(Se&&(be+=8),Te&&(be+=4),ke&&(X=a(ge,be),be+=4),te&&(pe=a(ge,be),be+=4),me&&(be+=4),K.type==="video"&&(Z=m(K.codec)),l(_e,["trun"]).map(function(de){var Be=de[0],we=a(de,0)&16777215,Le=(we&1)!==0,Ae=0,Ve=(we&4)!==0,De=(we&256)!==0,ye=0,Ee=(we&512)!==0,Oe=0,Fe=(we&1024)!==0,Ke=(we&2048)!==0,ze=0,Ye=a(de,4),Ie=8;Le&&(Ae=a(de,Ie),Ie+=4),Ve&&(Ie+=4);for(var je=Ae+ee,qe=0;qe<Ye;qe++){if(De?(ye=a(de,Ie),Ie+=4):ye=X,Ee?(Oe=a(de,Ie),Ie+=4):Oe=pe,Fe&&(Ie+=4),Ke&&(Be===0?ze=a(de,Ie):ze=v(de,Ie),Ie+=4),K.type===P.ElementaryStreamTypes.VIDEO)for(var Pe=0;Pe<Oe;){var Ze=a(z,je);if(je+=4,d(Z,z[je])){var se=z.subarray(je,je+Ze);h(se,Z?2:1,F+ze/j,W)}je+=Ze,Pe+=Ze+4}F+=ye/j}}))})})}),W}function m(F){if(!F)return!1;var K=F.indexOf("."),W=K<0?F:F.substring(0,K);return W==="hvc1"||W==="hev1"||W==="dvh1"||W==="dvhe"}function d(F,K){if(F){var W=K>>1&63;return W===39||W===40}else{var z=K&31;return z===6}}function h(F,K,W,z){var j=A(F),G=0;G+=K;for(var Z=0,Q=0,ue=!1,ee=0;G<j.length;){Z=0;do{if(G>=j.length)break;ee=j[G++],Z+=ee}while(ee===255);Q=0;do{if(G>=j.length)break;ee=j[G++],Q+=ee}while(ee===255);var ae=j.length-G;if(!ue&&Z===4&&G<j.length){ue=!0;var _e=j[G++];if(_e===181){var xe=i(j,G);if(G+=2,xe===49){var ge=a(j,G);if(G+=4,ge===1195456820){var ce=j[G++];if(ce===3){var he=j[G++],Se=31&he,Te=64&he,ke=Te?2+Se*3:0,X=new Uint8Array(ke);if(Te){X[0]=he;for(var te=1;te<ke;te++)X[te]=j[G++]}z.push({type:ce,payloadType:Z,pts:W,bytes:X})}}}}}else if(Z===5&&Q<ae){if(ue=!0,Q>16){for(var pe=[],me=0;me<16;me++){var be=j[G++].toString(16);pe.push(be.length==1?"0"+be:be),(me===3||me===5||me===7||me===9)&&pe.push("-")}for(var de=Q-16,Be=new Uint8Array(de),we=0;we<de;we++)Be[we]=j[G++];z.push({payloadType:Z,pts:W,uuid:pe.join(""),userData:(0,b.utf8ArrayToStr)(Be),userDataBytes:Be})}}else if(Q<ae)G+=Q;else if(Q>ae)break}}function A(F){for(var K=F.byteLength,W=[],z=1;z<K-2;)F[z]===0&&F[z+1]===0&&F[z+2]===3?(W.push(z+2),z+=2):z++;if(W.length===0)return F;var j=K-W.length,G=new Uint8Array(j),Z=0;for(z=0;z<j;Z++,z++)Z===W[0]&&(Z++,W.shift()),G[z]=F[Z];return G}function w(F){var K=F[0],W="",z="",j=0,G=0,Z=0,Q=0,ue=0,ee=0;if(K===0){for(;r(F.subarray(ee,ee+1))!=="\0";)W+=r(F.subarray(ee,ee+1)),ee+=1;for(W+=r(F.subarray(ee,ee+1)),ee+=1;r(F.subarray(ee,ee+1))!=="\0";)z+=r(F.subarray(ee,ee+1)),ee+=1;z+=r(F.subarray(ee,ee+1)),ee+=1,j=a(F,12),G=a(F,16),Q=a(F,20),ue=a(F,24),ee=28}else if(K===1){ee+=4,j=a(F,ee),ee+=4;var ae=a(F,ee);ee+=4;var _e=a(F,ee);for(ee+=4,Z=Math.pow(2,32)*ae+_e,Number.isSafeInteger(Z)||(Z=Number.MAX_SAFE_INTEGER,console.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),Q=a(F,ee),ee+=4,ue=a(F,ee),ee+=4;r(F.subarray(ee,ee+1))!=="\0";)W+=r(F.subarray(ee,ee+1)),ee+=1;for(W+=r(F.subarray(ee,ee+1)),ee+=1;r(F.subarray(ee,ee+1))!=="\0";)z+=r(F.subarray(ee,ee+1)),ee+=1;z+=r(F.subarray(ee,ee+1)),ee+=1}var xe=F.subarray(ee,F.byteLength);return{schemeIdUri:W,value:z,timeScale:j,presentationTime:Z,presentationTimeDelta:G,eventDuration:Q,id:ue,payload:xe}}function x(F){for(var K=arguments.length,W=new Array(K>1?K-1:0),z=1;z<K;z++)W[z-1]=arguments[z];for(var j=W.length,G=8,Z=j;Z--;)G+=W[Z].byteLength;var Q=new Uint8Array(G);for(Q[0]=G>>24&255,Q[1]=G>>16&255,Q[2]=G>>8&255,Q[3]=G&255,Q.set(F,4),Z=0,G=8;Z<j;Z++)Q.set(W[Z],G),G+=W[Z].byteLength;return Q}function D(F,K,W){if(F.byteLength!==16)throw new RangeError("Invalid system id");var z,j;if(K){z=1,j=new Uint8Array(K.length*16);for(var G=0;G<K.length;G++){var Z=K[G];if(Z.byteLength!==16)throw new RangeError("Invalid key");j.set(Z,G*16)}}else z=0,j=new Uint8Array;var Q;z>0?(Q=new Uint8Array(4),K.length>0&&new DataView(Q.buffer).setUint32(0,K.length,!1)):Q=new Uint8Array;var ue=new Uint8Array(4);return W&&W.byteLength>0&&new DataView(ue.buffer).setUint32(0,W.byteLength,!1),x([112,115,115,104],new Uint8Array([z,0,0,0]),F,Q,j,ue,W||new Uint8Array)}function I(F){if(!(F instanceof ArrayBuffer)||F.byteLength<32)return null;var K={version:0,systemId:"",kids:null,data:null},W=new DataView(F),z=W.getUint32(0);if(F.byteLength!==z&&z>44)return null;var j=W.getUint32(4);if(j!==1886614376||(K.version=W.getUint32(8)>>>24,K.version>1))return null;K.systemId=E.default.hexDump(new Uint8Array(F,12,16));var G=W.getUint32(28);if(K.version===0){if(z-32<G)return null;K.data=new Uint8Array(F,32,G)}else if(K.version===1){K.kids=[];for(var Z=0;Z<G;Z++)K.kids.push(new Uint8Array(F,32+Z*16,16))}return K}},"./src/utils/numeric-encoding-utils.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{base64Decode:()=>s,base64DecodeToStr:()=>b,base64Encode:()=>e,base64ToBase64Url:()=>P,base64UrlEncode:()=>E,strToBase64Encode:()=>T});function P(n){return n.replace(/\+/g,"-").replace(/\//g,"_").replace(/=+$/,"")}function T(n){return btoa(n)}function b(n){return atob(n)}function e(n){return btoa(String.fromCharCode.apply(String,n))}function E(n){return P(e(n))}function s(n){return Uint8Array.from(atob(n),function(t){return t.charCodeAt(0)})}},"./src/utils/output-filter.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>P});var P=function(){function T(e,E){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=E}var b=T.prototype;return b.dispatchCue=function(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)},b.newCue=function(E,s,n){(this.startTime===null||this.startTime>E)&&(this.startTime=E),this.endTime=s,this.screen=n,this.timelineController.createCaptionsTrack(this.trackName)},b.reset=function(){this.cueRanges=[],this.startTime=null},T}()},"./src/utils/texttrack-utils.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{addCueToTrack:()=>b,clearCurrentCues:()=>e,getCuesInRange:()=>n,removeCuesInRange:()=>E,sendAddTrackEvent:()=>T});var P=S("./src/utils/logger.ts");function T(t,r){var i;try{i=new Event("addtrack")}catch(a){i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=t,r.dispatchEvent(i)}function b(t,r){var i=t.mode;if(i==="disabled"&&(t.mode="hidden"),t.cues&&!t.cues.getCueById(r.id))try{if(t.addCue(r),!t.cues.getCueById(r.id))throw new Error("addCue is failed for: "+r)}catch(v){P.logger.debug("[texttrack-utils]: "+v);var a=new self.TextTrackCue(r.startTime,r.endTime,r.text);a.id=r.id,t.addCue(a)}i==="disabled"&&(t.mode=i)}function e(t){var r=t.mode;if(r==="disabled"&&(t.mode="hidden"),t.cues)for(var i=t.cues.length;i--;)t.removeCue(t.cues[i]);r==="disabled"&&(t.mode=r)}function E(t,r,i,a){var v=t.mode;if(v==="disabled"&&(t.mode="hidden"),t.cues&&t.cues.length>0)for(var p=n(t.cues,r,i),l=0;l<p.length;l++)(!a||a(p[l]))&&t.removeCue(p[l]);v==="disabled"&&(t.mode=v)}function s(t,r){if(r<t[0].startTime)return 0;var i=t.length-1;if(r>t[i].endTime)return-1;for(var a=0,v=i;a<=v;){var p=Math.floor((v+a)/2);if(r<t[p].startTime)v=p-1;else if(r>t[p].startTime&&a<i)a=p+1;else return p}return t[a].startTime-r<r-t[v].startTime?a:v}function n(t,r,i){var a=[],v=s(t,r);if(v>-1)for(var p=v,l=t.length;p<l;p++){var o=t[p];if(o.startTime>=r&&o.endTime<=i)a.push(o);else if(o.startTime>i)return a}return a}},"./src/utils/time-ranges.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>T});var P={toString:function(e){for(var E="",s=e.length,n=0;n<s;n++)E+="["+e.start(n).toFixed(3)+"-"+e.end(n).toFixed(3)+"]";return E}};const T=P},"./src/utils/timescale-conversion.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{toMpegTsClockFromTimescale:()=>E,toMsFromMpegTsClock:()=>e,toTimescaleFromBase:()=>T,toTimescaleFromScale:()=>b});var P=9e4;function T(s,n,t,r){t===void 0&&(t=1),r===void 0&&(r=!1);var i=s*n*t;return r?Math.round(i):i}function b(s,n,t,r){return t===void 0&&(t=1),r===void 0&&(r=!1),T(s,n,1/t,r)}function e(s,n){return n===void 0&&(n=!1),T(s,1e3,1/P,n)}function E(s,n){return n===void 0&&(n=1),T(s,P,1/n)}},"./src/utils/typed-array.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{sliceUint8:()=>P});function P(T,b,e){return Uint8Array.prototype.slice?T.slice(b,e):new Uint8Array(Array.prototype.slice.call(T,b,e))}},"./src/utils/vttcue.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>P});const P=function(){if(typeof self!="undefined"&&self.VTTCue)return self.VTTCue;var T=["","lr","rl"],b=["start","middle","end","left","right"];function e(r,i){if(typeof i!="string"||!Array.isArray(r))return!1;var a=i.toLowerCase();return~r.indexOf(a)?a:!1}function E(r){return e(T,r)}function s(r){return e(b,r)}function n(r){for(var i=arguments.length,a=new Array(i>1?i-1:0),v=1;v<i;v++)a[v-1]=arguments[v];for(var p=1;p<arguments.length;p++){var l=arguments[p];for(var o in l)r[o]=l[o]}return r}function t(r,i,a){var v=this,p={enumerable:!0};v.hasBeenReset=!1;var l="",o=!1,u=r,c=i,_=a,y=null,f="",C=!0,L="auto",R="start",O=50,g="middle",m=50,d="middle";Object.defineProperty(v,"id",n({},p,{get:function(){return l},set:function(A){l=""+A}})),Object.defineProperty(v,"pauseOnExit",n({},p,{get:function(){return o},set:function(A){o=!!A}})),Object.defineProperty(v,"startTime",n({},p,{get:function(){return u},set:function(A){if(typeof A!="number")throw new TypeError("Start time must be set to a number.");u=A,this.hasBeenReset=!0}})),Object.defineProperty(v,"endTime",n({},p,{get:function(){return c},set:function(A){if(typeof A!="number")throw new TypeError("End time must be set to a number.");c=A,this.hasBeenReset=!0}})),Object.defineProperty(v,"text",n({},p,{get:function(){return _},set:function(A){_=""+A,this.hasBeenReset=!0}})),Object.defineProperty(v,"region",n({},p,{get:function(){return y},set:function(A){y=A,this.hasBeenReset=!0}})),Object.defineProperty(v,"vertical",n({},p,{get:function(){return f},set:function(A){var w=E(A);if(w===!1)throw new SyntaxError("An invalid or illegal string was specified.");f=w,this.hasBeenReset=!0}})),Object.defineProperty(v,"snapToLines",n({},p,{get:function(){return C},set:function(A){C=!!A,this.hasBeenReset=!0}})),Object.defineProperty(v,"line",n({},p,{get:function(){return L},set:function(A){if(typeof A!="number"&&A!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");L=A,this.hasBeenReset=!0}})),Object.defineProperty(v,"lineAlign",n({},p,{get:function(){return R},set:function(A){var w=s(A);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");R=w,this.hasBeenReset=!0}})),Object.defineProperty(v,"position",n({},p,{get:function(){return O},set:function(A){if(A<0||A>100)throw new Error("Position must be between 0 and 100.");O=A,this.hasBeenReset=!0}})),Object.defineProperty(v,"positionAlign",n({},p,{get:function(){return g},set:function(A){var w=s(A);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");g=w,this.hasBeenReset=!0}})),Object.defineProperty(v,"size",n({},p,{get:function(){return m},set:function(A){if(A<0||A>100)throw new Error("Size must be between 0 and 100.");m=A,this.hasBeenReset=!0}})),Object.defineProperty(v,"align",n({},p,{get:function(){return d},set:function(A){var w=s(A);if(!w)throw new SyntaxError("An invalid or illegal string was specified.");d=w,this.hasBeenReset=!0}})),v.displayState=void 0}return t.prototype.getCueAsHTML=function(){var r=self.WebVTT;return r.convertCueToDOMTree(self,this.text)},t}()},"./src/utils/vttparser.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{VTTParser:()=>i,fixLineBreaks:()=>r,parseTimeStamp:()=>b});var P=S("./src/utils/vttcue.ts"),T=function(){function a(){}var v=a.prototype;return v.decode=function(l,o){if(!l)return"";if(typeof l!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(l))},a}();function b(a){function v(l,o,u,c){return(l|0)*3600+(o|0)*60+(u|0)+parseFloat(c||0)}var p=a.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return p?parseFloat(p[2])>59?v(p[2],p[3],0,p[4]):v(p[1],p[2],p[3],p[4]):null}var e=function(){function a(){this.values=Object.create(null)}var v=a.prototype;return v.set=function(l,o){!this.get(l)&&o!==""&&(this.values[l]=o)},v.get=function(l,o,u){return u?this.has(l)?this.values[l]:o[u]:this.has(l)?this.values[l]:o},v.has=function(l){return l in this.values},v.alt=function(l,o,u){for(var c=0;c<u.length;++c)if(o===u[c]){this.set(l,o);break}},v.integer=function(l,o){/^-?\d+$/.test(o)&&this.set(l,parseInt(o,10))},v.percent=function(l,o){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(o)){var u=parseFloat(o);if(u>=0&&u<=100)return this.set(l,u),!0}return!1},a}();function E(a,v,p,l){var o=l?a.split(l):[a];for(var u in o)if(typeof o[u]=="string"){var c=o[u].split(p);if(c.length===2){var _=c[0],y=c[1];v(_,y)}}}var s=new P.default(0,0,""),n=s.align==="middle"?"middle":"center";function t(a,v,p){var l=a;function o(){var _=b(a);if(_===null)throw new Error("Malformed timestamp: "+l);return a=a.replace(/^[^\sa-zA-Z-]+/,""),_}function u(_,y){var f=new e;E(_,function(R,O){var g;switch(R){case"region":for(var m=p.length-1;m>=0;m--)if(p[m].id===O){f.set(R,p[m].region);break}break;case"vertical":f.alt(R,O,["rl","lr"]);break;case"line":g=O.split(","),f.integer(R,g[0]),f.percent(R,g[0])&&f.set("snapToLines",!1),f.alt(R,g[0],["auto"]),g.length===2&&f.alt("lineAlign",g[1],["start",n,"end"]);break;case"position":g=O.split(","),f.percent(R,g[0]),g.length===2&&f.alt("positionAlign",g[1],["start",n,"end","line-left","line-right","auto"]);break;case"size":f.percent(R,O);break;case"align":f.alt(R,O,["start",n,"end","left","right"]);break}},/:/,/\s/),y.region=f.get("region",null),y.vertical=f.get("vertical","");var C=f.get("line","auto");C==="auto"&&s.line===-1&&(C=-1),y.line=C,y.lineAlign=f.get("lineAlign","start"),y.snapToLines=f.get("snapToLines",!0),y.size=f.get("size",100),y.align=f.get("align",n);var L=f.get("position","auto");L==="auto"&&s.position===50&&(L=y.align==="start"||y.align==="left"?0:y.align==="end"||y.align==="right"?100:50),y.position=L}function c(){a=a.replace(/^\s+/,"")}if(c(),v.startTime=o(),c(),a.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+l);a=a.slice(3),c(),v.endTime=o(),c(),u(a,v)}function r(a){return a.replace(/<br(?: \/)?>/gi,`
`)}var i=function(){function a(){this.state="INITIAL",this.buffer="",this.decoder=new T,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}var v=a.prototype;return v.parse=function(l){var o=this;l&&(o.buffer+=o.decoder.decode(l,{stream:!0}));function u(){var L=o.buffer,R=0;for(L=r(L);R<L.length&&L[R]!=="\r"&&L[R]!==`
`;)++R;var O=L.slice(0,R);return L[R]==="\r"&&++R,L[R]===`
`&&++R,o.buffer=L.slice(R),O}function c(L){E(L,function(R,O){},/:/)}try{var _="";if(o.state==="INITIAL"){if(!/\r\n|\n/.test(o.buffer))return this;_=u();var y=_.match(/^()?WEBVTT([ \t].*)?$/);if(!y||!y[0])throw new Error("Malformed WebVTT signature.");o.state="HEADER"}for(var f=!1;o.buffer;){if(!/\r\n|\n/.test(o.buffer))return this;switch(f?f=!1:_=u(),o.state){case"HEADER":/:/.test(_)?c(_):_||(o.state="ID");continue;case"NOTE":_||(o.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(_)){o.state="NOTE";break}if(!_)continue;if(o.cue=new P.default(0,0,""),o.state="CUE",_.indexOf("-->")===-1){o.cue.id=_;continue}case"CUE":if(!o.cue){o.state="BADCUE";continue}try{t(_,o.cue,o.regionList)}catch(L){o.cue=null,o.state="BADCUE";continue}o.state="CUETEXT";continue;case"CUETEXT":{var C=_.indexOf("-->")!==-1;if(!_||C&&(f=!0)){o.oncue&&o.cue&&o.oncue(o.cue),o.cue=null,o.state="ID";continue}if(o.cue===null)continue;o.cue.text&&(o.cue.text+=`
`),o.cue.text+=_}continue;case"BADCUE":_||(o.state="ID")}}}catch(L){o.state==="CUETEXT"&&o.cue&&o.oncue&&o.oncue(o.cue),o.cue=null,o.state=o.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this},v.flush=function(){var l=this;try{if((l.cue||l.state==="HEADER")&&(l.buffer+=`
`,l.parse()),l.state==="INITIAL"||l.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(o){l.onparsingerror&&l.onparsingerror(o)}return l.onflush&&l.onflush(),this},a}()},"./src/utils/webvtt-parser.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{generateCueId:()=>i,parseWebVTT:()=>v});var P=S("./src/polyfills/number.ts"),T=S("./src/utils/vttparser.ts"),b=S("./src/demux/id3.ts"),e=S("./src/utils/timescale-conversion.ts"),E=S("./src/remux/mp4-remuxer.ts"),s=/\r\n|\n\r|\n|\r/g,n=function(l,o,u){return u===void 0&&(u=0),l.slice(u,u+o.length)===o},t=function(l){var o=parseInt(l.slice(-3)),u=parseInt(l.slice(-6,-4)),c=parseInt(l.slice(-9,-7)),_=l.length>9?parseInt(l.substring(0,l.indexOf(":"))):0;if(!(0,P.isFiniteNumber)(o)||!(0,P.isFiniteNumber)(u)||!(0,P.isFiniteNumber)(c)||!(0,P.isFiniteNumber)(_))throw Error("Malformed X-TIMESTAMP-MAP: Local:"+l);return o+=1e3*u,o+=60*1e3*c,o+=60*60*1e3*_,o},r=function(l){for(var o=5381,u=l.length;u;)o=o*33^l.charCodeAt(--u);return(o>>>0).toString()};function i(p,l,o){return r(p.toString())+r(l.toString())+r(o)}var a=function(l,o,u){var c=l[o],_=l[c.prevCC];if(!_||!_.new&&c.new){l.ccOffset=l.presentationOffset=c.start,c.new=!1;return}for(;(y=_)!==null&&y!==void 0&&y.new;){var y;l.ccOffset+=c.start-_.start,c.new=!1,c=_,_=l[c.prevCC]}l.presentationOffset=u};function v(p,l,o,u,c,_,y,f){var C=new T.VTTParser,L=(0,b.utf8ArrayToStr)(new Uint8Array(p)).trim().replace(s,`
`).split(`
`),R=[],O=(0,e.toMpegTsClockFromTimescale)(l,o),g="00:00.000",m=0,d=0,h,A=!0;C.oncue=function(w){var x=u[c],D=u.ccOffset,I=(m-O)/9e4;x!=null&&x.new&&(d!==void 0?D=u.ccOffset=x.start:a(u,c,I)),I&&(D=I-u.presentationOffset);var F=w.endTime-w.startTime,K=(0,E.normalizePts)((w.startTime+D-d)*9e4,_*9e4)/9e4;w.startTime=Math.max(K,0),w.endTime=Math.max(K+F,0);var W=w.text.trim();w.text=decodeURIComponent(encodeURIComponent(W)),w.id||(w.id=i(w.startTime,w.endTime,W)),w.endTime>0&&R.push(w)},C.onparsingerror=function(w){h=w},C.onflush=function(){if(h){f(h);return}y(R)},L.forEach(function(w){if(A)if(n(w,"X-TIMESTAMP-MAP=")){A=!1,w.slice(16).split(",").forEach(function(x){n(x,"LOCAL:")?g=x.slice(6):n(x,"MPEGTS:")&&(m=parseInt(x.slice(7)))});try{d=t(g)/1e3}catch(x){h=x}return}else w===""&&(A=!1);C.parse(w+`
`)}),C.flush()}},"./src/utils/xhr-loader.ts":(U,k,S)=>{"use strict";S.r(k),S.d(k,{default:()=>E});var P=S("./src/utils/logger.ts"),T=S("./src/loader/load-stats.ts"),b=/^age:\s*[\d.]+\s*$/m,e=function(){function s(t){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=t?t.xhrSetup:null,this.stats=new T.LoadStats,this.retryDelay=0}var n=s.prototype;return n.destroy=function(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null},n.abortInternal=function(){var r=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),r&&(r.onreadystatechange=null,r.onprogress=null,r.readyState!==4&&(this.stats.aborted=!0,r.abort()))},n.abort=function(){var r;this.abortInternal(),(r=this.callbacks)!==null&&r!==void 0&&r.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)},n.load=function(r,i,a){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=r,this.config=i,this.callbacks=a,this.retryDelay=i.retryDelay,this.loadInternal()},n.loadInternal=function(){var r=this.config,i=this.context;if(r){var a=this.loader=new self.XMLHttpRequest,v=this.stats;v.loading.first=0,v.loaded=0;var p=this.xhrSetup;try{if(p)try{p(a,i.url)}catch(u){a.open("GET",i.url,!0),p(a,i.url)}a.readyState||a.open("GET",i.url,!0);var l=this.context.headers;if(l)for(var o in l)a.setRequestHeader(o,l[o])}catch(u){this.callbacks.onError({code:a.status,text:u.message},i,a);return}i.rangeEnd&&a.setRequestHeader("Range","bytes="+i.rangeStart+"-"+(i.rangeEnd-1)),a.onreadystatechange=this.readystatechange.bind(this),a.onprogress=this.loadprogress.bind(this),a.responseType=i.responseType,self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),a.send()}},n.readystatechange=function(){var r=this.context,i=this.loader,a=this.stats;if(!(!r||!i)){var v=i.readyState,p=this.config;if(!a.aborted&&v>=2)if(self.clearTimeout(this.requestTimeout),a.loading.first===0&&(a.loading.first=Math.max(self.performance.now(),a.loading.start)),v===4){i.onreadystatechange=null,i.onprogress=null;var l=i.status,o=i.responseType==="arraybuffer";if(l>=200&&l<300&&(o&&i.response||i.responseText!==null)){a.loading.end=Math.max(self.performance.now(),a.loading.first);var u,c;if(o?(u=i.response,c=u.byteLength):(u=i.responseText,c=u.length),a.loaded=a.total=c,!this.callbacks)return;var _=this.callbacks.onProgress;if(_&&_(a,r,u,i),!this.callbacks)return;var y={url:i.responseURL,data:u};this.callbacks.onSuccess(y,a,r,i)}else a.retry>=p.maxRetry||l>=400&&l<499?(P.logger.error(l+" while loading "+r.url),this.callbacks.onError({code:l,text:i.statusText},r,i)):(P.logger.warn(l+" while loading "+r.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,p.maxRetryDelay),a.retry++)}else self.clearTimeout(this.requestTimeout),this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),p.timeout)}},n.loadtimeout=function(){P.logger.warn("timeout while loading "+this.context.url);var r=this.callbacks;r&&(this.abortInternal(),r.onTimeout(this.stats,this.context,this.loader))},n.loadprogress=function(r){var i=this.stats;i.loaded=r.loaded,r.lengthComputable&&(i.total=r.total)},n.getCacheAge=function(){var r=null;if(this.loader&&b.test(this.loader.getAllResponseHeaders())){var i=this.loader.getResponseHeader("age");r=i?parseFloat(i):null}return r},s}();const E=e},"./node_modules/eventemitter3/index.js":U=>{"use strict";var k=Object.prototype.hasOwnProperty,S="~";function P(){}Object.create&&(P.prototype=Object.create(null),new P().__proto__||(S=!1));function T(s,n,t){this.fn=s,this.context=n,this.once=t||!1}function b(s,n,t,r,i){if(typeof t!="function")throw new TypeError("The listener must be a function");var a=new T(t,r||s,i),v=S?S+n:n;return s._events[v]?s._events[v].fn?s._events[v]=[s._events[v],a]:s._events[v].push(a):(s._events[v]=a,s._eventsCount++),s}function e(s,n){--s._eventsCount===0?s._events=new P:delete s._events[n]}function E(){this._events=new P,this._eventsCount=0}E.prototype.eventNames=function(){var n=[],t,r;if(this._eventsCount===0)return n;for(r in t=this._events)k.call(t,r)&&n.push(S?r.slice(1):r);return Object.getOwnPropertySymbols?n.concat(Object.getOwnPropertySymbols(t)):n},E.prototype.listeners=function(n){var t=S?S+n:n,r=this._events[t];if(!r)return[];if(r.fn)return[r.fn];for(var i=0,a=r.length,v=new Array(a);i<a;i++)v[i]=r[i].fn;return v},E.prototype.listenerCount=function(n){var t=S?S+n:n,r=this._events[t];return r?r.fn?1:r.length:0},E.prototype.emit=function(n,t,r,i,a,v){var p=S?S+n:n;if(!this._events[p])return!1;var l=this._events[p],o=arguments.length,u,c;if(l.fn){switch(l.once&&this.removeListener(n,l.fn,void 0,!0),o){case 1:return l.fn.call(l.context),!0;case 2:return l.fn.call(l.context,t),!0;case 3:return l.fn.call(l.context,t,r),!0;case 4:return l.fn.call(l.context,t,r,i),!0;case 5:return l.fn.call(l.context,t,r,i,a),!0;case 6:return l.fn.call(l.context,t,r,i,a,v),!0}for(c=1,u=new Array(o-1);c<o;c++)u[c-1]=arguments[c];l.fn.apply(l.context,u)}else{var _=l.length,y;for(c=0;c<_;c++)switch(l[c].once&&this.removeListener(n,l[c].fn,void 0,!0),o){case 1:l[c].fn.call(l[c].context);break;case 2:l[c].fn.call(l[c].context,t);break;case 3:l[c].fn.call(l[c].context,t,r);break;case 4:l[c].fn.call(l[c].context,t,r,i);break;default:if(!u)for(y=1,u=new Array(o-1);y<o;y++)u[y-1]=arguments[y];l[c].fn.apply(l[c].context,u)}}return!0},E.prototype.on=function(n,t,r){return b(this,n,t,r,!1)},E.prototype.once=function(n,t,r){return b(this,n,t,r,!0)},E.prototype.removeListener=function(n,t,r,i){var a=S?S+n:n;if(!this._events[a])return this;if(!t)return e(this,a),this;var v=this._events[a];if(v.fn)v.fn===t&&(!i||v.once)&&(!r||v.context===r)&&e(this,a);else{for(var p=0,l=[],o=v.length;p<o;p++)(v[p].fn!==t||i&&!v[p].once||r&&v[p].context!==r)&&l.push(v[p]);l.length?this._events[a]=l.length===1?l[0]:l:e(this,a)}return this},E.prototype.removeAllListeners=function(n){var t;return n?(t=S?S+n:n,this._events[t]&&e(this,t)):(this._events=new P,this._eventsCount=0),this},E.prototype.off=E.prototype.removeListener,E.prototype.addListener=E.prototype.on,E.prefixed=S,E.EventEmitter=E,U.exports=E},"./node_modules/url-toolkit/src/url-toolkit.js":function(U){(function(k){var S=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,P=/^(?=([^\/?#]*))\1([^]*)$/,T=/(?:\/|^)\.(?=\/)/g,b=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,e={buildAbsoluteURL:function(E,s,n){if(n=n||{},E=E.trim(),s=s.trim(),!s){if(!n.alwaysNormalize)return E;var t=e.parseURL(E);if(!t)throw new Error("Error trying to parse base URL.");return t.path=e.normalizePath(t.path),e.buildURLFromParts(t)}var r=e.parseURL(s);if(!r)throw new Error("Error trying to parse relative URL.");if(r.scheme)return n.alwaysNormalize?(r.path=e.normalizePath(r.path),e.buildURLFromParts(r)):s;var i=e.parseURL(E);if(!i)throw new Error("Error trying to parse base URL.");if(!i.netLoc&&i.path&&i.path[0]!=="/"){var a=P.exec(i.path);i.netLoc=a[1],i.path=a[2]}i.netLoc&&!i.path&&(i.path="/");var v={scheme:i.scheme,netLoc:r.netLoc,path:null,params:r.params,query:r.query,fragment:r.fragment};if(!r.netLoc&&(v.netLoc=i.netLoc,r.path[0]!=="/"))if(!r.path)v.path=i.path,r.params||(v.params=i.params,r.query||(v.query=i.query));else{var p=i.path,l=p.substring(0,p.lastIndexOf("/")+1)+r.path;v.path=e.normalizePath(l)}return v.path===null&&(v.path=n.alwaysNormalize?e.normalizePath(r.path):r.path),e.buildURLFromParts(v)},parseURL:function(E){var s=S.exec(E);return s?{scheme:s[1]||"",netLoc:s[2]||"",path:s[3]||"",params:s[4]||"",query:s[5]||"",fragment:s[6]||""}:null},normalizePath:function(E){for(E=E.split("").reverse().join("").replace(T,"");E.length!==(E=E.replace(b,"")).length;);return E.split("").reverse().join("")},buildURLFromParts:function(E){return E.scheme+E.netLoc+E.path+E.params+E.query+E.fragment}};U.exports=e})(this)}},M={};function N(U){var k=M[U];if(k!==void 0)return k.exports;var S=M[U]={exports:{}};return re[U].call(S.exports,S,S.exports,N),S.exports}N.m=re,N.n=U=>{var k=U&&U.__esModule?()=>U.default:()=>U;return N.d(k,{a:k}),k},N.d=(U,k)=>{for(var S in k)N.o(k,S)&&!N.o(U,S)&&Object.defineProperty(U,S,{enumerable:!0,get:k[S]})},N.o=(U,k)=>Object.prototype.hasOwnProperty.call(U,k),N.r=U=>{typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(U,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(U,"__esModule",{value:!0})};var B=N("./src/hls.ts");return B=B.default,B})())},19575:function(Ge,re,M){var N,B;(function(U,k){Ge.exports=k(U)})(typeof self!="undefined"?self:typeof window!="undefined"?window:typeof M.g!="undefined"?M.g:this,function(U){"use strict";U=U||{};var k=U.Base64,S="2.6.4",P="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+/",T=function(m){for(var d={},h=0,A=m.length;h<A;h++)d[m.charAt(h)]=h;return d}(P),b=String.fromCharCode,e=function(m){if(m.length<2){var d=m.charCodeAt(0);return d<128?m:d<2048?b(192|d>>>6)+b(128|d&63):b(224|d>>>12&15)+b(128|d>>>6&63)+b(128|d&63)}else{var d=65536+(m.charCodeAt(0)-55296)*1024+(m.charCodeAt(1)-56320);return b(240|d>>>18&7)+b(128|d>>>12&63)+b(128|d>>>6&63)+b(128|d&63)}},E=/[\uD800-\uDBFF][\uDC00-\uDFFFF]|[^\x00-\x7F]/g,s=function(m){return m.replace(E,e)},n=function(m){var d=[0,2,1][m.length%3],h=m.charCodeAt(0)<<16|(m.length>1?m.charCodeAt(1):0)<<8|(m.length>2?m.charCodeAt(2):0),A=[P.charAt(h>>>18),P.charAt(h>>>12&63),d>=2?"=":P.charAt(h>>>6&63),d>=1?"=":P.charAt(h&63)];return A.join("")},t=U.btoa&&typeof U.btoa=="function"?function(m){return U.btoa(m)}:function(m){if(m.match(/[^\x00-\xFF]/))throw new RangeError("The string contains invalid characters.");return m.replace(/[\s\S]{1,3}/g,n)},r=function(m){return t(s(String(m)))},i=function(m){return m.replace(/[+\/]/g,function(d){return d=="+"?"-":"_"}).replace(/=/g,"")},a=function(m,d){return d?i(r(m)):r(m)},v=function(m){return a(m,!0)},p;U.Uint8Array&&(p=function(m,d){for(var h="",A=0,w=m.length;A<w;A+=3){var x=m[A],D=m[A+1],I=m[A+2],F=x<<16|D<<8|I;h+=P.charAt(F>>>18)+P.charAt(F>>>12&63)+(typeof D!="undefined"?P.charAt(F>>>6&63):"=")+(typeof I!="undefined"?P.charAt(F&63):"=")}return d?i(h):h});var l=/[\xC0-\xDF][\x80-\xBF]|[\xE0-\xEF][\x80-\xBF]{2}|[\xF0-\xF7][\x80-\xBF]{3}/g,o=function(m){switch(m.length){case 4:var d=(7&m.charCodeAt(0))<<18|(63&m.charCodeAt(1))<<12|(63&m.charCodeAt(2))<<6|63&m.charCodeAt(3),h=d-65536;return b((h>>>10)+55296)+b((h&1023)+56320);case 3:return b((15&m.charCodeAt(0))<<12|(63&m.charCodeAt(1))<<6|63&m.charCodeAt(2));default:return b((31&m.charCodeAt(0))<<6|63&m.charCodeAt(1))}},u=function(m){return m.replace(l,o)},c=function(m){var d=m.length,h=d%4,A=(d>0?T[m.charAt(0)]<<18:0)|(d>1?T[m.charAt(1)]<<12:0)|(d>2?T[m.charAt(2)]<<6:0)|(d>3?T[m.charAt(3)]:0),w=[b(A>>>16),b(A>>>8&255),b(A&255)];return w.length-=[0,0,2,1][h],w.join("")},_=U.atob&&typeof U.atob=="function"?function(m){return U.atob(m)}:function(m){return m.replace(/\S{1,4}/g,c)},y=function(m){return _(String(m).replace(/[^A-Za-z0-9\+\/]/g,""))},f=function(m){return u(_(m))},C=function(m){return String(m).replace(/[-_]/g,function(d){return d=="-"?"+":"/"}).replace(/[^A-Za-z0-9\+\/]/g,"")},L=function(m){return f(C(m))},R;U.Uint8Array&&(R=function(m){return Uint8Array.from(y(C(m)),function(d){return d.charCodeAt(0)})});var O=function(){var m=U.Base64;return U.Base64=k,m};if(U.Base64={VERSION:S,atob:y,btoa:t,fromBase64:L,toBase64:a,utob:s,encode:a,encodeURI:v,btou:u,decode:L,noConflict:O,fromUint8Array:p,toUint8Array:R},typeof Object.defineProperty=="function"){var g=function(m){return{value:m,enumerable:!1,writable:!0,configurable:!0}};U.Base64.extendString=function(){Object.defineProperty(String.prototype,"fromBase64",g(function(){return L(this)})),Object.defineProperty(String.prototype,"toBase64",g(function(m){return a(this,m)})),Object.defineProperty(String.prototype,"toBase64URI",g(function(){return a(this,!0)}))}}return U.Meteor&&(Base64=U.Base64),Ge.exports?Ge.exports.Base64=U.Base64:(N=[],B=function(){return U.Base64}.apply(re,N),B!==void 0&&(Ge.exports=B)),{Base64:U.Base64}})},84204:function(Ge,re,M){"use strict";var N,B;function U(k,S,P){var T=function(b,e){return k.js_beautify(b,e)};return T.js=k.js_beautify,T.css=S.css_beautify,T.html=P.html_beautify,T.js_beautify=k.js_beautify,T.css_beautify=S.css_beautify,T.html_beautify=P.html_beautify,T}N=[M(77937),M(85040),M(3566)],B=function(k,S,P){return U(k,S,P)}.apply(re,N),B!==void 0&&(Ge.exports=B)},85040:function(Ge,re){var M,N;(function(){var B;(function(){"use strict";var k=[,,function(b){function e(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=[]}e.prototype.clone_empty=function(){var n=new e(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},e.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},e.prototype.has_match=function(n){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(n))return!0;return!1},e.prototype.set_indent=function(n,t){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.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},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(n){this.__items.push(n);var t=n.lastIndexOf(`
`);t!==-1?this.__character_count=n.length-t:this.__character_count+=n.length},e.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.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 E(n,t){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)),t=t||"",n.indent_level>0&&(t=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}E.prototype.get_indent_size=function(n,t){var r=this.__base_string_length;return t=t||0,n<0&&(r=0),r+=n*this.__indent_size,r+=t,r},E.prototype.get_indent_string=function(n,t){var r=this.__base_string;return t=t||0,n<0&&(n=0,r=""),t+=n*this.__indent_size,this.__ensure_cache(t),r+=this.__cache[t],r},E.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var n=this.__cache.length,t=0,r="";this.__indent_size&&n>=this.__indent_size&&(t=Math.floor(n/this.__indent_size),n-=t*this.__indent_size,r=new Array(t+1).join(this.__indent_string)),n&&(r+=new Array(n+1).join(" ")),this.__cache.push(r)};function s(n,t){this.__indent_cache=new E(n,t),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 e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(n,t){return this.__indent_cache.get_indent_string(n,t)},s.prototype.get_indent_size=function(n,t){return this.__indent_cache.get_indent_size(n,t)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(n){this.trim(!0);var t=this.current_line.pop();t&&(t[t.length-1]===`
`&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return n!==`
`&&(r=r.replace(/[\n]/g,n)),r},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(n,t){return n=n||0,t=t||0,this.next_line.set_indent(n,t),this.__lines.length>1?(this.current_line.set_indent(n,t),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(n){for(var t=0;t<n.newlines;t++)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},s.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()},s.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(" "))},s.prototype.remove_indent=function(n){for(var t=this.__lines.length;n<t;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},s.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},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(n,t){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(i.item(0).indexOf(n)!==0&&i.item(-1)!==t){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},b.exports.Output=s},,,,function(b){function e(n,t){this.raw_options=E(n,t),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"])}e.prototype._get_array=function(n,t){var r=this.raw_options[n],i=t||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(i=r.concat()):typeof r=="string"&&(i=r.split(/[^a-zA-Z0-9_\/\-]+/)),i},e.prototype._get_boolean=function(n,t){var r=this.raw_options[n],i=r===void 0?!!t:!!r;return i},e.prototype._get_characters=function(n,t){var r=this.raw_options[n],i=t||"";return typeof r=="string"&&(i=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),i},e.prototype._get_number=function(n,t){var r=this.raw_options[n];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(r,10);return isNaN(i)&&(i=t),i},e.prototype._get_selection=function(n,t,r){var i=this._get_selection_list(n,t,r);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
`+t+`
You passed in: '`+this.raw_options[n]+"'");return i[0]},e.prototype._get_selection_list=function(n,t,r){if(!t||t.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[t[0]],!this._is_valid_selection(r,t))throw new Error("Invalid Default Value!");var i=this._get_array(n,r);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
`+t+`
You passed in: '`+this.raw_options[n]+"'");return i},e.prototype._is_valid_selection=function(n,t){return n.length&&t.length&&!n.some(function(r){return t.indexOf(r)===-1})};function E(n,t){var r={};n=s(n);var i;for(i in n)i!==t&&(r[i]=n[i]);if(t&&n[t])for(i in n[t])r[i]=n[t][i];return r}function s(n){var t={},r;for(r in n){var i=r.replace(/-/g,"_");t[i]=n[r]}return t}b.exports.Options=e,b.exports.normalizeOpts=s,b.exports.mergeOpts=E},,function(b){var e=RegExp.prototype.hasOwnProperty("sticky");function E(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},E.prototype.peek=function(s){var n=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(n=this.__input.charAt(s)),n},E.prototype.__match=function(s,n){s.lastIndex=n;var t=s.exec(this.__input);return t&&!(e&&s.sticky)&&t.index!==n&&(t=null),t},E.prototype.test=function(s,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(s,n):!1},E.prototype.testChar=function(s,n){var t=this.peek(n);return s.lastIndex=0,t!==null&&s.test(t)},E.prototype.match=function(s){var n=this.__match(s,this.__position);return n?this.__position+=n[0].length:n=null,n},E.prototype.read=function(s,n,t){var r="",i;return s&&(i=this.match(s),i&&(r+=i[0])),n&&(i||!s)&&(r+=this.readUntil(n,t)),r},E.prototype.readUntil=function(s,n){var t="",r=this.__position;s.lastIndex=this.__position;var i=s.exec(this.__input);return i?(r=i.index,n&&(r+=i[0].length)):r=this.__input_length,t=this.__input.substring(this.__position,r),this.__position=r,t},E.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},E.prototype.get_regexp=function(s,n){var t=null,r="g";return n&&e&&(r="y"),typeof s=="string"&&s!==""?t=new RegExp(s,r):s&&(t=new RegExp(s.source,r)),t},E.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(s){var n=this.__position,t=this.readUntilAfter(s);return this.__position=n,t},E.prototype.lookBack=function(s){var n=this.__position-1;return n>=s.length&&this.__input.substring(n-s.length,n).toLowerCase()===s},b.exports.InputScanner=E},,,,,function(b){function e(E,s){E=typeof E=="string"?E:E.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+s,"g")}e.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(E);n;)s[n[1]]=n[2],n=this.__directive_pattern.exec(E);return s},e.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=e},,function(b,e,E){var s=E(16).Beautifier,n=E(17).Options;function t(r,i){var a=new s(r,i);return a.beautify()}b.exports=t,b.exports.defaultOptions=function(){return new n}},function(b,e,E){var s=E(17).Options,n=E(2).Output,t=E(8).InputScanner,r=E(13).Directives,i=new r(/\/\*/,/\*\//),a=/\r\n|[\r\n]/,v=/\r\n|[\r\n]/g,p=/\s/,l=/(?:\s|\n)+/g,o=/\/\*(?:[\s\S]*?)((?:\*\/)|$)/g,u=/\/\/(?:[^\n\r\u2028\u2029]*)/g;function c(_,y){this._source_text=_||"",this._options=new s(y),this._ch=null,this._input=null,this.NESTED_AT_RULE={"@page":!0,"@font-face":!0,"@keyframes":!0,"@media":!0,"@supports":!0,"@document":!0},this.CONDITIONAL_GROUP_RULE={"@media":!0,"@supports":!0,"@document":!0},this.NON_SEMICOLON_NEWLINE_PROPERTY=["grid-template-areas","grid-template"]}c.prototype.eatString=function(_){var y="";for(this._ch=this._input.next();this._ch;){if(y+=this._ch,this._ch==="\\")y+=this._input.next();else if(_.indexOf(this._ch)!==-1||this._ch===`
`)break;this._ch=this._input.next()}return y},c.prototype.eatWhitespace=function(_){for(var y=p.test(this._input.peek()),f=0;p.test(this._input.peek());)this._ch=this._input.next(),_&&this._ch===`
`&&(f===0||f<this._options.max_preserve_newlines)&&(f++,this._output.add_new_line(!0));return y},c.prototype.foundNestedPseudoClass=function(){for(var _=0,y=1,f=this._input.peek(y);f;){if(f==="{")return!0;if(f==="(")_+=1;else if(f===")"){if(_===0)return!1;_-=1}else if(f===";"||f==="}")return!1;y++,f=this._input.peek(y)}return!1},c.prototype.print_string=function(_){this._output.set_indent(this._indentLevel),this._output.non_breaking_space=!0,this._output.add_token(_)},c.prototype.preserveSingleSpace=function(_){_&&(this._output.space_before_token=!0)},c.prototype.indent=function(){this._indentLevel++},c.prototype.outdent=function(){this._indentLevel>0&&this._indentLevel--},c.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var _=this._source_text,y=this._options.eol;y==="auto"&&(y=`
`,_&&a.test(_||"")&&(y=_.match(a)[0])),_=_.replace(v,`
`);var f=_.match(/^[\t ]*/)[0];this._output=new n(this._options,f),this._input=new t(_),this._indentLevel=0,this._nestedLevel=0,this._ch=null;for(var C=0,L=!1,R=!1,O=!1,g=!1,m=!1,d=!1,h=this._ch,A=!1,w,x,D;w=this._input.read(l),x=w!=="",D=h,this._ch=this._input.next(),this._ch==="\\"&&this._input.hasNext()&&(this._ch+=this._input.next()),h=this._ch,this._ch;)if(this._ch==="/"&&this._input.peek()==="*"){this._output.add_new_line(),this._input.back();var I=this._input.read(o),F=i.get_directives(I);F&&F.ignore==="start"&&(I+=i.readIgnored(this._input)),this.print_string(I),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(u)),this.eatWhitespace(!0);else if(this._ch==="@"||this._ch==="$")if(this.preserveSingleSpace(x),this._input.peek()==="{")this.print_string(this._ch+this.eatString("}"));else{this.print_string(this._ch);var K=this._input.peekUntilAfter(/[: ,;{}()[\]\/='"]/g);K.match(/[ :]$/)&&(K=this.eatString(": ").replace(/\s$/,""),this.print_string(K),this._output.space_before_token=!0),K=K.replace(/\s$/,""),K==="extend"?g=!0:K==="import"&&(m=!0),K in this.NESTED_AT_RULE?(this._nestedLevel+=1,K in this.CONDITIONAL_GROUP_RULE&&(O=!0)):!L&&C===0&&K.indexOf(":")!==-1&&(R=!0,this.indent())}else if(this._ch==="#"&&this._input.peek()==="{")this.preserveSingleSpace(x),this.print_string(this._ch+this.eatString("}"));else if(this._ch==="{")R&&(R=!1,this.outdent()),O?(O=!1,L=this._indentLevel>=this._nestedLevel):L=this._indentLevel>=this._nestedLevel-1,this._options.newline_between_rules&&L&&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)):(D==="("?this._output.space_before_token=!1:D!==","&&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(),D==="{"&&this._output.trim(!0),m=!1,g=!1,R&&(this.outdent(),R=!1),this.print_string(this._ch),L=!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 W=0;W<this.NON_SEMICOLON_NEWLINE_PROPERTY.length;W++)if(this._input.lookBack(this.NON_SEMICOLON_NEWLINE_PROPERTY[W])){A=!0;break}(L||O)&&!(this._input.lookBack("&")||this.foundNestedPseudoClass())&&!this._input.lookBack("(")&&!g&&C===0?(this.print_string(":"),R||(R=!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 z=D==='"'||D==="'";this.preserveSingleSpace(z||x),this.print_string(this._ch+this.eatString(this._ch)),this.eatWhitespace(!0)}else if(this._ch===";")A=!1,C===0?(R&&(this.outdent(),R=!1),g=!1,m=!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(),C++,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(")")),C&&(C--,this.outdent()));else{var j=!1;this._input.lookBack("with")&&(j=!0),this.preserveSingleSpace(x||j),this.print_string(this._ch),R&&D==="$"&&this._options.selector_separator_newline?(this._output.add_new_line(),d=!0):(this.eatWhitespace(),C++,this.indent())}else if(this._ch===")")C&&(C--,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&&(!R||d)&&C===0&&!m&&!g?this._output.add_new_line():this._output.space_before_token=!0;else if((this._ch===">"||this._ch==="+"||this._ch==="~")&&!R&&C===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&&p.test(this._ch)&&(this._ch=""));else if(this._ch==="]")this.print_string(this._ch);else if(this._ch==="[")this.preserveSingleSpace(x),this.print_string(this._ch);else if(this._ch==="=")this.eatWhitespace(),this.print_string("="),p.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 G=D==='"'||D==="'";this.preserveSingleSpace(G||x),this.print_string(this._ch),!this._output.just_added_newline()&&this._input.peek()===`
`&&A&&this._output.add_new_line()}var Z=this._output.get_code(y);return Z},b.exports.Beautifier=c},function(b,e,E){var s=E(6).Options;function n(t){s.call(this,t,"css"),this.selector_separator_newline=this._get_boolean("selector_separator_newline",!0),this.newline_between_rules=this._get_boolean("newline_between_rules",!0);var r=this._get_boolean("space_around_selector_separator");this.space_around_combinator=this._get_boolean("space_around_combinator")||r;var i=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_style="collapse";for(var a=0;a<i.length;a++)i[a]!=="expand"?this.brace_style="collapse":this.brace_style=i[a]}n.prototype=new s,b.exports.Options=n}],S={};function P(b){var e=S[b];if(e!==void 0)return e.exports;var E=S[b]={exports:{}};return k[b](E,E.exports,P),E.exports}var T=P(15);B=T})();var U=B;M=[],N=function(){return{css_beautify:U}}.apply(re,M),N!==void 0&&(Ge.exports=N)})()},3566:function(Ge,re,M){var N,B;(function(){var U;(function(){"use strict";var T=[,,function(s){function n(i){this.__parent=i,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=[]}n.prototype.clone_empty=function(){var i=new n(this.__parent);return i.set_indent(this.__indent_count,this.__alignment_count),i},n.prototype.item=function(i){return i<0?this.__items[this.__items.length+i]:this.__items[i]},n.prototype.has_match=function(i){for(var a=this.__items.length-1;a>=0;a--)if(this.__items[a].match(i))return!0;return!1},n.prototype.set_indent=function(i,a){this.is_empty()&&(this.__indent_count=i||0,this.__alignment_count=a||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},n.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)},n.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},n.prototype._allow_wrap=function(){if(this._should_wrap()){this.__parent.add_new_line();var i=this.__parent.current_line;return i.set_indent(this.__wrap_point_indent_count,this.__wrap_point_alignment_count),i.__items=this.__items.slice(this.__wrap_point_index),this.__items=this.__items.slice(0,this.__wrap_point_index),i.__character_count+=this.__character_count-this.__wrap_point_character_count,this.__character_count=this.__wrap_point_character_count,i.__items[0]===" "&&(i.__items.splice(0,1),i.__character_count-=1),!0}return!1},n.prototype.is_empty=function(){return this.__items.length===0},n.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},n.prototype.push=function(i){this.__items.push(i);var a=i.lastIndexOf(`
`);a!==-1?this.__character_count=i.length-a:this.__character_count+=i.length},n.prototype.pop=function(){var i=null;return this.is_empty()||(i=this.__items.pop(),this.__character_count-=i.length),i},n.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},n.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},n.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},n.prototype.toString=function(){var i="";return this.is_empty()?this.__parent.indent_empty_lines&&(i=this.__parent.get_indent_string(this.__indent_count)):(i=this.__parent.get_indent_string(this.__indent_count,this.__alignment_count),i+=this.__items.join("")),i};function t(i,a){this.__cache=[""],this.__indent_size=i.indent_size,this.__indent_string=i.indent_char,i.indent_with_tabs||(this.__indent_string=new Array(i.indent_size+1).join(i.indent_char)),a=a||"",i.indent_level>0&&(a=new Array(i.indent_level+1).join(this.__indent_string)),this.__base_string=a,this.__base_string_length=a.length}t.prototype.get_indent_size=function(i,a){var v=this.__base_string_length;return a=a||0,i<0&&(v=0),v+=i*this.__indent_size,v+=a,v},t.prototype.get_indent_string=function(i,a){var v=this.__base_string;return a=a||0,i<0&&(i=0,v=""),a+=i*this.__indent_size,this.__ensure_cache(a),v+=this.__cache[a],v},t.prototype.__ensure_cache=function(i){for(;i>=this.__cache.length;)this.__add_column()},t.prototype.__add_column=function(){var i=this.__cache.length,a=0,v="";this.__indent_size&&i>=this.__indent_size&&(a=Math.floor(i/this.__indent_size),i-=a*this.__indent_size,v=new Array(a+1).join(this.__indent_string)),i&&(v+=new Array(i+1).join(" ")),this.__cache.push(v)};function r(i,a){this.__indent_cache=new t(i,a),this.raw=!1,this._end_with_newline=i.end_with_newline,this.indent_size=i.indent_size,this.wrap_line_length=i.wrap_line_length,this.indent_empty_lines=i.indent_empty_lines,this.__lines=[],this.previous_line=null,this.current_line=null,this.next_line=new n(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}r.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},r.prototype.get_line_number=function(){return this.__lines.length},r.prototype.get_indent_string=function(i,a){return this.__indent_cache.get_indent_string(i,a)},r.prototype.get_indent_size=function(i,a){return this.__indent_cache.get_indent_size(i,a)},r.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},r.prototype.add_new_line=function(i){return this.is_empty()||!i&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},r.prototype.get_code=function(i){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 v=this.__lines.join(`
`);return i!==`
`&&(v=v.replace(/[\n]/g,i)),v},r.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},r.prototype.set_indent=function(i,a){return i=i||0,a=a||0,this.next_line.set_indent(i,a),this.__lines.length>1?(this.current_line.set_indent(i,a),!0):(this.current_line.set_indent(),!1)},r.prototype.add_raw_token=function(i){for(var a=0;a<i.newlines;a++)this.__add_outputline();this.current_line.set_indent(-1),this.current_line.push(i.whitespace_before),this.current_line.push(i.text),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1},r.prototype.add_token=function(i){this.__add_space_before_token(),this.current_line.push(i),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=this.current_line._allow_wrap()},r.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(" "))},r.prototype.remove_indent=function(i){for(var a=this.__lines.length;i<a;)this.__lines[i]._remove_indent(),i++;this.current_line._remove_wrap_indent()},r.prototype.trim=function(i){for(i=i===void 0?!1:i,this.current_line.trim();i&&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},r.prototype.just_added_newline=function(){return this.current_line.is_empty()},r.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},r.prototype.ensure_empty_line_above=function(i,a){for(var v=this.__lines.length-2;v>=0;){var p=this.__lines[v];if(p.is_empty())break;if(p.item(0).indexOf(i)!==0&&p.item(-1)!==a){this.__lines.splice(v+1,0,new n(this)),this.previous_line=this.__lines[this.__lines.length-2];break}v--}},s.exports.Output=r},function(s){function n(t,r,i,a){this.type=t,this.text=r,this.comments_before=null,this.newlines=i||0,this.whitespace_before=a||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}s.exports.Token=n},,,function(s){function n(i,a){this.raw_options=t(i,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"])}n.prototype._get_array=function(i,a){var v=this.raw_options[i],p=a||[];return typeof v=="object"?v!==null&&typeof v.concat=="function"&&(p=v.concat()):typeof v=="string"&&(p=v.split(/[^a-zA-Z0-9_\/\-]+/)),p},n.prototype._get_boolean=function(i,a){var v=this.raw_options[i],p=v===void 0?!!a:!!v;return p},n.prototype._get_characters=function(i,a){var v=this.raw_options[i],p=a||"";return typeof v=="string"&&(p=v.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),p},n.prototype._get_number=function(i,a){var v=this.raw_options[i];a=parseInt(a,10),isNaN(a)&&(a=0);var p=parseInt(v,10);return isNaN(p)&&(p=a),p},n.prototype._get_selection=function(i,a,v){var p=this._get_selection_list(i,a,v);if(p.length!==1)throw new Error("Invalid Option Value: The option '"+i+`' can only be one of the following values:
`+a+`
You passed in: '`+this.raw_options[i]+"'");return p[0]},n.prototype._get_selection_list=function(i,a,v){if(!a||a.length===0)throw new Error("Selection list cannot be empty.");if(v=v||[a[0]],!this._is_valid_selection(v,a))throw new Error("Invalid Default Value!");var p=this._get_array(i,v);if(!this._is_valid_selection(p,a))throw new Error("Invalid Option Value: The option '"+i+`' can contain only the following values:
`+a+`
You passed in: '`+this.raw_options[i]+"'");return p},n.prototype._is_valid_selection=function(i,a){return i.length&&a.length&&!i.some(function(v){return a.indexOf(v)===-1})};function t(i,a){var v={};i=r(i);var p;for(p in i)p!==a&&(v[p]=i[p]);if(a&&i[a])for(p in i[a])v[p]=i[a][p];return v}function r(i){var a={},v;for(v in i){var p=v.replace(/-/g,"_");a[p]=i[v]}return a}s.exports.Options=n,s.exports.normalizeOpts=r,s.exports.mergeOpts=t},,function(s){var n=RegExp.prototype.hasOwnProperty("sticky");function t(r){this.__input=r||"",this.__input_length=this.__input.length,this.__position=0}t.prototype.restart=function(){this.__position=0},t.prototype.back=function(){this.__position>0&&(this.__position-=1)},t.prototype.hasNext=function(){return this.__position<this.__input_length},t.prototype.next=function(){var r=null;return this.hasNext()&&(r=this.__input.charAt(this.__position),this.__position+=1),r},t.prototype.peek=function(r){var i=null;return r=r||0,r+=this.__position,r>=0&&r<this.__input_length&&(i=this.__input.charAt(r)),i},t.prototype.__match=function(r,i){r.lastIndex=i;var a=r.exec(this.__input);return a&&!(n&&r.sticky)&&a.index!==i&&(a=null),a},t.prototype.test=function(r,i){return i=i||0,i+=this.__position,i>=0&&i<this.__input_length?!!this.__match(r,i):!1},t.prototype.testChar=function(r,i){var a=this.peek(i);return r.lastIndex=0,a!==null&&r.test(a)},t.prototype.match=function(r){var i=this.__match(r,this.__position);return i?this.__position+=i[0].length:i=null,i},t.prototype.read=function(r,i,a){var v="",p;return r&&(p=this.match(r),p&&(v+=p[0])),i&&(p||!r)&&(v+=this.readUntil(i,a)),v},t.prototype.readUntil=function(r,i){var a="",v=this.__position;r.lastIndex=this.__position;var p=r.exec(this.__input);return p?(v=p.index,i&&(v+=p[0].length)):v=this.__input_length,a=this.__input.substring(this.__position,v),this.__position=v,a},t.prototype.readUntilAfter=function(r){return this.readUntil(r,!0)},t.prototype.get_regexp=function(r,i){var a=null,v="g";return i&&n&&(v="y"),typeof r=="string"&&r!==""?a=new RegExp(r,v):r&&(a=new RegExp(r.source,v)),a},t.prototype.get_literal_regexp=function(r){return RegExp(r.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},t.prototype.peekUntilAfter=function(r){var i=this.__position,a=this.readUntilAfter(r);return this.__position=i,a},t.prototype.lookBack=function(r){var i=this.__position-1;return i>=r.length&&this.__input.substring(i-r.length,i).toLowerCase()===r},s.exports.InputScanner=t},function(s,n,t){var r=t(8).InputScanner,i=t(3).Token,a=t(10).TokenStream,v=t(11).WhitespacePattern,p={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},l=function(o,u){this._input=new r(o),this._options=u||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new v(this._input)};l.prototype.tokenize=function(){this._input.restart(),this.__tokens=new a,this._reset();for(var o,u=new i(p.START,""),c=null,_=[],y=new a;u.type!==p.EOF;){for(o=this._get_next_token(u,c);this._is_comment(o);)y.add(o),o=this._get_next_token(u,c);y.isEmpty()||(o.comments_before=y,y=new a),o.parent=c,this._is_opening(o)?(_.push(c),c=o):c&&this._is_closing(o,c)&&(o.opened=c,c.closed=o,c=_.pop(),o.parent=c),o.previous=u,u.next=o,this.__tokens.add(o),u=o}return this.__tokens},l.prototype._is_first_token=function(){return this.__tokens.isEmpty()},l.prototype._reset=function(){},l.prototype._get_next_token=function(o,u){this._readWhitespace();var c=this._input.read(/.+/g);return c?this._create_token(p.RAW,c):this._create_token(p.EOF,"")},l.prototype._is_comment=function(o){return!1},l.prototype._is_opening=function(o){return!1},l.prototype._is_closing=function(o,u){return!1},l.prototype._create_token=function(o,u){var c=new i(o,u,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return c},l.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},s.exports.Tokenizer=l,s.exports.TOKEN=p},function(s){function n(t){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=t}n.prototype.restart=function(){this.__position=0},n.prototype.isEmpty=function(){return this.__tokens_length===0},n.prototype.hasNext=function(){return this.__position<this.__tokens_length},n.prototype.next=function(){var t=null;return this.hasNext()&&(t=this.__tokens[this.__position],this.__position+=1),t},n.prototype.peek=function(t){var r=null;return t=t||0,t+=this.__position,t>=0&&t<this.__tokens_length&&(r=this.__tokens[t]),r},n.prototype.add=function(t){this.__parent_token&&(t.parent=this.__parent_token),this.__tokens.push(t),this.__tokens_length+=1},s.exports.TokenStream=n},function(s,n,t){var r=t(12).Pattern;function i(a,v){r.call(this,a,v),v?this._line_regexp=this._input.get_regexp(v._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}i.prototype=new r,i.prototype.__set_whitespace_patterns=function(a,v){a+="\\t ",v+="\\n\\r",this._match_pattern=this._input.get_regexp("["+a+v+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+v+"]")},i.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 v=this.__split(this._newline_regexp,a);this.newline_count=v.length-1,this.whitespace_before_token=v[this.newline_count]}return a},i.prototype.matching=function(a,v){var p=this._create();return p.__set_whitespace_patterns(a,v),p._update(),p},i.prototype._create=function(){return new i(this._input,this)},i.prototype.__split=function(a,v){a.lastIndex=0;for(var p=0,l=[],o=a.exec(v);o;)l.push(v.substring(p,o.index)),p=o.index+o[0].length,o=a.exec(v);return p<v.length?l.push(v.substring(p,v.length)):l.push(""),l},s.exports.WhitespacePattern=i},function(s){function n(t,r){this._input=t,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,r&&(this._starting_pattern=this._input.get_regexp(r._starting_pattern,!0),this._match_pattern=this._input.get_regexp(r._match_pattern,!0),this._until_pattern=this._input.get_regexp(r._until_pattern),this._until_after=r._until_after)}n.prototype.read=function(){var t=this._input.read(this._starting_pattern);return(!this._starting_pattern||t)&&(t+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),t},n.prototype.read_match=function(){return this._input.match(this._match_pattern)},n.prototype.until_after=function(t){var r=this._create();return r._until_after=!0,r._until_pattern=this._input.get_regexp(t),r._update(),r},n.prototype.until=function(t){var r=this._create();return r._until_after=!1,r._until_pattern=this._input.get_regexp(t),r._update(),r},n.prototype.starting_with=function(t){var r=this._create();return r._starting_pattern=this._input.get_regexp(t,!0),r._update(),r},n.prototype.matching=function(t){var r=this._create();return r._match_pattern=this._input.get_regexp(t,!0),r._update(),r},n.prototype._create=function(){return new n(this._input,this)},n.prototype._update=function(){},s.exports.Pattern=n},function(s){function n(t,r){t=typeof t=="string"?t:t.source,r=typeof r=="string"?r:r.source,this.__directives_block_pattern=new RegExp(t+/ beautify( \w+[:]\w+)+ /.source+r,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(t+/\sbeautify\signore:end\s/.source+r,"g")}n.prototype.get_directives=function(t){if(!t.match(this.__directives_block_pattern))return null;var r={};this.__directive_pattern.lastIndex=0;for(var i=this.__directive_pattern.exec(t);i;)r[i[1]]=i[2],i=this.__directive_pattern.exec(t);return r},n.prototype.readIgnored=function(t){return t.readUntilAfter(this.__directives_end_ignore_pattern)},s.exports.Directives=n},function(s,n,t){var r=t(12).Pattern,i={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function a(v,p){r.call(this,v,p),this.__template_pattern=null,this._disabled=Object.assign({},i),this._excluded=Object.assign({},i),p&&(this.__template_pattern=this._input.get_regexp(p.__template_pattern),this._excluded=Object.assign(this._excluded,p._excluded),this._disabled=Object.assign(this._disabled,p._disabled));var l=new r(v);this.__patterns={handlebars_comment:l.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:l.starting_with(/{{{/).until_after(/}}}/),handlebars:l.starting_with(/{{/).until_after(/}}/),php:l.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:l.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:l.starting_with(/{%/).until_after(/%}/),django_value:l.starting_with(/{{/).until_after(/}}/),django_comment:l.starting_with(/{#/).until_after(/#}/),smarty:l.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:l.starting_with(/{\*/).until_after(/\*}/),smarty_literal:l.starting_with(/{literal}/).until_after(/{\/literal}/)}}a.prototype=new r,a.prototype._create=function(){return new a(this._input,this)},a.prototype._update=function(){this.__set_templated_pattern()},a.prototype.disable=function(v){var p=this._create();return p._disabled[v]=!0,p._update(),p},a.prototype.read_options=function(v){var p=this._create();for(var l in i)p._disabled[l]=v.templating.indexOf(l)===-1;return p._update(),p},a.prototype.exclude=function(v){var p=this._create();return p._excluded[v]=!0,p._update(),p},a.prototype.read=function(){var v="";this._match_pattern?v=this._input.read(this._starting_pattern):v=this._input.read(this._starting_pattern,this.__template_pattern);for(var p=this._read_template();p;)this._match_pattern?p+=this._input.read(this._match_pattern):p+=this._input.readUntil(this.__template_pattern),v+=p,p=this._read_template();return this._until_after&&(v+=this._input.readUntilAfter(this._until_pattern)),v},a.prototype.__set_templated_pattern=function(){var v=[];this._disabled.php||v.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||v.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||v.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(v.push(this.__patterns.django._starting_pattern.source),v.push(this.__patterns.django_value._starting_pattern.source),v.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||v.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&v.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+v.join("|")+")")},a.prototype._read_template=function(){var v="",p=this._input.peek();if(p==="<"){var l=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&l==="?"&&(v=v||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&l==="%"&&(v=v||this.__patterns.erb.read())}else p==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(v=v||this.__patterns.handlebars_comment.read(),v=v||this.__patterns.handlebars_unescaped.read(),v=v||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(v=v||this.__patterns.django_value.read()),this._excluded.django||(v=v||this.__patterns.django_comment.read(),v=v||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(v=v||this.__patterns.smarty_comment.read(),v=v||this.__patterns.smarty_literal.read(),v=v||this.__patterns.smarty.read()));return v},s.exports.TemplatablePattern=a},,,,function(s,n,t){var r=t(19).Beautifier,i=t(20).Options;function a(v,p,l,o){var u=new r(v,p,l,o);return u.beautify()}s.exports=a,s.exports.defaultOptions=function(){return new i}},function(s,n,t){var r=t(20).Options,i=t(2).Output,a=t(21).Tokenizer,v=t(21).TOKEN,p=/\r\n|[\r\n]/,l=/\r\n|[\r\n]/g,o=function(g,m){this.indent_level=0,this.alignment_size=0,this.max_preserve_newlines=g.max_preserve_newlines,this.preserve_newlines=g.preserve_newlines,this._output=new i(g,m)};o.prototype.current_line_has_match=function(g){return this._output.current_line.has_match(g)},o.prototype.set_space_before_token=function(g,m){this._output.space_before_token=g,this._output.non_breaking_space=m},o.prototype.set_wrap_point=function(){this._output.set_indent(this.indent_level,this.alignment_size),this._output.set_wrap_point()},o.prototype.add_raw_token=function(g){this._output.add_raw_token(g)},o.prototype.print_preserved_newlines=function(g){var m=0;g.type!==v.TEXT&&g.previous.type!==v.TEXT&&(m=g.newlines?1:0),this.preserve_newlines&&(m=g.newlines<this.max_preserve_newlines+1?g.newlines:this.max_preserve_newlines+1);for(var d=0;d<m;d++)this.print_newline(d>0);return m!==0},o.prototype.traverse_whitespace=function(g){return g.whitespace_before||g.newlines?(this.print_preserved_newlines(g)||(this._output.space_before_token=!0),!0):!1},o.prototype.previous_token_wrapped=function(){return this._output.previous_token_wrapped},o.prototype.print_newline=function(g){this._output.add_new_line(g)},o.prototype.print_token=function(g){g.text&&(this._output.set_indent(this.indent_level,this.alignment_size),this._output.add_token(g.text))},o.prototype.indent=function(){this.indent_level++},o.prototype.get_full_indent=function(g){return g=this.indent_level+(g||0),g<1?"":this._output.get_indent_string(g)};var u=function(g){for(var m=null,d=g.next;d.type!==v.EOF&&g.closed!==d;){if(d.type===v.ATTRIBUTE&&d.text==="type"){d.next&&d.next.type===v.EQUALS&&d.next.next&&d.next.next.type===v.VALUE&&(m=d.next.next.text);break}d=d.next}return m},c=function(g,m){var d=null,h=null;return m.closed?(g==="script"?d="text/javascript":g==="style"&&(d="text/css"),d=u(m)||d,d.search("text/css")>-1?h="css":d.search(/module|((text|application|dojo)\/(x-)?(javascript|ecmascript|jscript|livescript|(ld\+)?json|method|aspect))/)>-1?h="javascript":d.search(/(text|application|dojo)\/(x-)?(html)/)>-1?h="html":d.search(/test\/null/)>-1&&(h="null"),h):null};function _(g,m){return m.indexOf(g)!==-1}function y(g,m,d){this.parent=g||null,this.tag=m?m.tag_name:"",this.indent_level=d||0,this.parser_token=m||null}function f(g){this._printer=g,this._current_frame=null}f.prototype.get_parser_token=function(){return this._current_frame?this._current_frame.parser_token:null},f.prototype.record_tag=function(g){var m=new y(this._current_frame,g,this._printer.indent_level);this._current_frame=m},f.prototype._try_pop_frame=function(g){var m=null;return g&&(m=g.parser_token,this._printer.indent_level=g.indent_level,this._current_frame=g.parent),m},f.prototype._get_frame=function(g,m){for(var d=this._current_frame;d&&g.indexOf(d.tag)===-1;){if(m&&m.indexOf(d.tag)!==-1){d=null;break}d=d.parent}return d},f.prototype.try_pop=function(g,m){var d=this._get_frame([g],m);return this._try_pop_frame(d)},f.prototype.indent_to_tag=function(g){var m=this._get_frame(g);m&&(this._printer.indent_level=m.indent_level)};function C(g,m,d,h){this._source_text=g||"",m=m||{},this._js_beautify=d,this._css_beautify=h,this._tag_stack=null;var A=new r(m,"html");this._options=A,this._is_wrap_attributes_force=this._options.wrap_attributes.substr(0,5)==="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,8)==="preserve",this._is_wrap_attributes_preserve_aligned=this._options.wrap_attributes==="preserve-aligned"}C.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var g=this._source_text,m=this._options.eol;this._options.eol==="auto"&&(m=`
`,g&&p.test(g)&&(m=g.match(p)[0])),g=g.replace(l,`
`);var d=g.match(/^[\t ]*/)[0],h={text:"",type:""},A=new L,w=new o(this._options,d),x=new a(g,this._options).tokenize();this._tag_stack=new f(w);for(var D=null,I=x.next();I.type!==v.EOF;)I.type===v.TAG_OPEN||I.type===v.COMMENT?(D=this._handle_tag_open(w,I,A,h),A=D):I.type===v.ATTRIBUTE||I.type===v.EQUALS||I.type===v.VALUE||I.type===v.TEXT&&!A.tag_complete?D=this._handle_inside_tag(w,I,A,x):I.type===v.TAG_CLOSE?D=this._handle_tag_close(w,I,A):I.type===v.TEXT?D=this._handle_text(w,I,A):w.add_raw_token(I),h=D,I=x.next();var F=w._output.get_code(m);return F},C.prototype._handle_tag_close=function(g,m,d){var h={text:m.text,type:m.type};return g.alignment_size=0,d.tag_complete=!0,g.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),d.is_unformatted?g.add_raw_token(m):(d.tag_start_char==="<"&&(g.set_space_before_token(m.text[0]==="/",!0),this._is_wrap_attributes_force_expand_multiline&&d.has_wrapped_attrs&&g.print_newline(!1)),g.print_token(m)),d.indent_content&&!(d.is_unformatted||d.is_content_unformatted)&&(g.indent(),d.indent_content=!1),!d.is_inline_element&&!(d.is_unformatted||d.is_content_unformatted)&&g.set_wrap_point(),h},C.prototype._handle_inside_tag=function(g,m,d,h){var A=d.has_wrapped_attrs,w={text:m.text,type:m.type};if(g.set_space_before_token(m.newlines||m.whitespace_before!=="",!0),d.is_unformatted)g.add_raw_token(m);else if(d.tag_start_char==="{"&&m.type===v.TEXT)g.print_preserved_newlines(m)?(m.newlines=0,g.add_raw_token(m)):g.print_token(m);else{if(m.type===v.ATTRIBUTE?(g.set_space_before_token(!0),d.attr_count+=1):(m.type===v.EQUALS||m.type===v.VALUE&&m.previous.type===v.EQUALS)&&g.set_space_before_token(!1),m.type===v.ATTRIBUTE&&d.tag_start_char==="<"&&((this._is_wrap_attributes_preserve||this._is_wrap_attributes_preserve_aligned)&&(g.traverse_whitespace(m),A=A||m.newlines!==0),this._is_wrap_attributes_force)){var x=d.attr_count>1;if(this._is_wrap_attributes_force_expand_multiline&&d.attr_count===1){var D=!0,I=0,F;do{if(F=h.peek(I),F.type===v.ATTRIBUTE){D=!1;break}I+=1}while(I<4&&F.type!==v.EOF&&F.type!==v.TAG_CLOSE);x=!D}x&&(g.print_newline(!1),A=!0)}g.print_token(m),A=A||g.previous_token_wrapped(),d.has_wrapped_attrs=A}return w},C.prototype._handle_text=function(g,m,d){var h={text:m.text,type:"TK_CONTENT"};return d.custom_beautifier_name?this._print_custom_beatifier_text(g,m,d):d.is_unformatted||d.is_content_unformatted?g.add_raw_token(m):(g.traverse_whitespace(m),g.print_token(m)),h},C.prototype._print_custom_beatifier_text=function(g,m,d){var h=this;if(m.text!==""){var A=m.text,w,x=1,D="",I="";d.custom_beautifier_name==="javascript"&&typeof this._js_beautify=="function"?w=this._js_beautify:d.custom_beautifier_name==="css"&&typeof this._css_beautify=="function"?w=this._css_beautify:d.custom_beautifier_name==="html"&&(w=function(G,Z){var Q=new C(G,Z,h._js_beautify,h._css_beautify);return Q.beautify()}),this._options.indent_scripts==="keep"?x=0:this._options.indent_scripts==="separate"&&(x=-g.indent_level);var F=g.get_full_indent(x);if(A=A.replace(/\n[ \t]*$/,""),d.custom_beautifier_name!=="html"&&A[0]==="<"&&A.match(/^(<!--|<!\[CDATA\[)/)){var K=/^(<!--[^\n]*|<!\[CDATA\[)(\n?)([ \t\n]*)([\s\S]*)(-->|]]>)$/.exec(A);if(!K){g.add_raw_token(m);return}D=F+K[1]+`
`,A=K[4],K[5]&&(I=F+K[5]),A=A.replace(/\n[ \t]*$/,""),(K[2]||K[3].indexOf(`
`)!==-1)&&(K=K[3].match(/[ \t]+$/),K&&(m.whitespace_before=K[0]))}if(A)if(w){var W=function(){this.eol=`
`};W.prototype=this._options.raw_options;var z=new W;A=w(F+A,z)}else{var j=m.whitespace_before;j&&(A=A.replace(new RegExp(`
(`+j+")?","g"),`
`)),A=F+A.replace(/\n/g,`
`+F)}D&&(A?A=D+A+`
`+I:A=D+I),g.print_newline(!1),A&&(m.text=A,m.whitespace_before="",m.newlines=0,g.add_raw_token(m),g.print_newline(!0))}},C.prototype._handle_tag_open=function(g,m,d,h){var A=this._get_tag_open_token(m);return(d.is_unformatted||d.is_content_unformatted)&&!d.is_empty_element&&m.type===v.TAG_OPEN&&m.text.indexOf("</")===0?(g.add_raw_token(m),A.start_tag_token=this._tag_stack.try_pop(A.tag_name)):(g.traverse_whitespace(m),this._set_tag_position(g,m,A,d,h),A.is_inline_element||g.set_wrap_point(),g.print_token(m)),(this._is_wrap_attributes_force_aligned||this._is_wrap_attributes_aligned_multiple||this._is_wrap_attributes_preserve_aligned)&&(A.alignment_size=m.text.length+1),!A.tag_complete&&!A.is_unformatted&&(g.alignment_size=A.alignment_size),A};var L=function(g,m){if(this.parent=g||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="",!m)this.tag_complete=!0;else{var d;this.tag_start_char=m.text[0],this.text=m.text,this.tag_start_char==="<"?(d=m.text.match(/^<([^\s>]*)/),this.tag_check=d?d[1]:""):(d=m.text.match(/^{{~?(?:[\^]|#\*?)?([^\s}]+)/),this.tag_check=d?d[1]:"",(m.text.startsWith("{{#>")||m.text.startsWith("{{~#>"))&&this.tag_check[0]===">"&&(this.tag_check===">"&&m.next!==null?this.tag_check=m.next.text.split(" ")[0]:this.tag_check=m.text.split(">")[1])),this.tag_check=this.tag_check.toLowerCase(),m.type===v.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||m.closed&&m.closed.text==="/>";var h=2;this.tag_start_char==="{"&&this.text.length>=3&&this.text.charAt(2)==="~"&&(h=3),this.is_end_tag=this.is_end_tag||this.tag_start_char==="{"&&(this.text.length<3||/[^#\^]/.test(this.text.charAt(h)))}};C.prototype._get_tag_open_token=function(g){var m=new L(this._tag_stack.get_parser_token(),g);return m.alignment_size=this._options.wrap_attributes_indent_size,m.is_end_tag=m.is_end_tag||_(m.tag_check,this._options.void_elements),m.is_empty_element=m.tag_complete||m.is_start_tag&&m.is_end_tag,m.is_unformatted=!m.tag_complete&&_(m.tag_check,this._options.unformatted),m.is_content_unformatted=!m.is_empty_element&&_(m.tag_check,this._options.content_unformatted),m.is_inline_element=_(m.tag_name,this._options.inline)||m.tag_name.includes("-")||m.tag_start_char==="{",m},C.prototype._set_tag_position=function(g,m,d,h,A){if(d.is_empty_element||(d.is_end_tag?d.start_tag_token=this._tag_stack.try_pop(d.tag_name):(this._do_optional_end_element(d)&&(d.is_inline_element||g.print_newline(!1)),this._tag_stack.record_tag(d),(d.tag_name==="script"||d.tag_name==="style")&&!(d.is_unformatted||d.is_content_unformatted)&&(d.custom_beautifier_name=c(d.tag_check,m)))),_(d.tag_check,this._options.extra_liners)&&(g.print_newline(!1),g._output.just_added_blankline()||g.print_newline(!0)),d.is_empty_element){if(d.tag_start_char==="{"&&d.tag_check==="else"){this._tag_stack.indent_to_tag(["if","unless","each"]),d.indent_content=!0;var w=g.current_line_has_match(/{{#if/);w||g.print_newline(!1)}d.tag_name==="!--"&&A.type===v.TAG_CLOSE&&h.is_end_tag&&d.text.indexOf(`
`)===-1||(d.is_inline_element||d.is_unformatted||g.print_newline(!1),this._calcluate_parent_multiline(g,d))}else if(d.is_end_tag){var x=!1;x=d.start_tag_token&&d.start_tag_token.multiline_content,x=x||!d.is_inline_element&&!(h.is_inline_element||h.is_unformatted)&&!(A.type===v.TAG_CLOSE&&d.start_tag_token===h)&&A.type!=="TK_CONTENT",(d.is_content_unformatted||d.is_unformatted)&&(x=!1),x&&g.print_newline(!1)}else d.indent_content=!d.custom_beautifier_name,d.tag_start_char==="<"&&(d.tag_name==="html"?d.indent_content=this._options.indent_inner_html:d.tag_name==="head"?d.indent_content=this._options.indent_head_inner_html:d.tag_name==="body"&&(d.indent_content=this._options.indent_body_inner_html)),!(d.is_inline_element||d.is_unformatted)&&(A.type!=="TK_CONTENT"||d.is_content_unformatted)&&g.print_newline(!1),this._calcluate_parent_multiline(g,d)},C.prototype._calcluate_parent_multiline=function(g,m){m.parent&&g._output.just_added_newline()&&!((m.is_inline_element||m.is_unformatted)&&m.parent.is_inline_element)&&(m.parent.multiline_content=!0)};var R=["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"],O=["a","audio","del","ins","map","noscript","video"];C.prototype._do_optional_end_element=function(g){var m=null;if(!(g.is_empty_element||!g.is_start_tag||!g.parent)){if(g.tag_name==="body")m=m||this._tag_stack.try_pop("head");else if(g.tag_name==="li")m=m||this._tag_stack.try_pop("li",["ol","ul"]);else if(g.tag_name==="dd"||g.tag_name==="dt")m=m||this._tag_stack.try_pop("dt",["dl"]),m=m||this._tag_stack.try_pop("dd",["dl"]);else if(g.parent.tag_name==="p"&&R.indexOf(g.tag_name)!==-1){var d=g.parent.parent;(!d||O.indexOf(d.tag_name)===-1)&&(m=m||this._tag_stack.try_pop("p"))}else g.tag_name==="rp"||g.tag_name==="rt"?(m=m||this._tag_stack.try_pop("rt",["ruby","rtc"]),m=m||this._tag_stack.try_pop("rp",["ruby","rtc"])):g.tag_name==="optgroup"?m=m||this._tag_stack.try_pop("optgroup",["select"]):g.tag_name==="option"?m=m||this._tag_stack.try_pop("option",["select","datalist","optgroup"]):g.tag_name==="colgroup"?m=m||this._tag_stack.try_pop("caption",["table"]):g.tag_name==="thead"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"])):g.tag_name==="tbody"||g.tag_name==="tfoot"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("thead",["table"]),m=m||this._tag_stack.try_pop("tbody",["table"])):g.tag_name==="tr"?(m=m||this._tag_stack.try_pop("caption",["table"]),m=m||this._tag_stack.try_pop("colgroup",["table"]),m=m||this._tag_stack.try_pop("tr",["table","thead","tbody","tfoot"])):(g.tag_name==="th"||g.tag_name==="td")&&(m=m||this._tag_stack.try_pop("td",["table","thead","tbody","tfoot","tr"]),m=m||this._tag_stack.try_pop("th",["table","thead","tbody","tfoot","tr"]));return g.parent=this._tag_stack.get_parser_token(),m}},s.exports.Beautifier=C},function(s,n,t){var r=t(6).Options;function i(a){r.call(this,a,"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"])}i.prototype=new r,s.exports.Options=i},function(s,n,t){var r=t(9).Tokenizer,i=t(9).TOKEN,a=t(13).Directives,v=t(14).TemplatablePattern,p=t(12).Pattern,l={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:i.START,RAW:i.RAW,EOF:i.EOF},o=new a(/<\!--/,/-->/),u=function(c,_){r.call(this,c,_),this._current_tag_name="";var y=new v(this._input).read_options(this._options),f=new p(this._input);if(this.__patterns={word:y.until(/[\n\r\t <]/),single_quote:y.until_after(/'/),double_quote:y.until_after(/"/),attribute:y.until(/[\n\r\t =>]|\/>/),element_name:y.until(/[\n\r\t >\/]/),handlebars_comment:f.starting_with(/{{!--/).until_after(/--}}/),handlebars:f.starting_with(/{{/).until_after(/}}/),handlebars_open:f.until(/[\n\r\t }]/),handlebars_raw_close:f.until(/}}/),comment:f.starting_with(/<!--/).until_after(/-->/),cdata:f.starting_with(/<!\[CDATA\[/).until_after(/]]>/),conditional_comment:f.starting_with(/<!\[/).until_after(/]>/),processing:f.starting_with(/<\?/).until_after(/\?>/)},this._options.indent_handlebars&&(this.__patterns.word=this.__patterns.word.exclude("handlebars")),this._unformatted_content_delimiter=null,this._options.unformatted_content_delimiter){var C=this._input.get_literal_regexp(this._options.unformatted_content_delimiter);this.__patterns.unformatted_content_delimiter=f.matching(C).until_after(C)}};u.prototype=new r,u.prototype._is_comment=function(c){return!1},u.prototype._is_opening=function(c){return c.type===l.TAG_OPEN},u.prototype._is_closing=function(c,_){return c.type===l.TAG_CLOSE&&_&&((c.text===">"||c.text==="/>")&&_.text[0]==="<"||c.text==="}}"&&_.text[0]==="{"&&_.text[1]==="{")},u.prototype._reset=function(){this._current_tag_name=""},u.prototype._get_next_token=function(c,_){var y=null;this._readWhitespace();var f=this._input.peek();return f===null?this._create_token(l.EOF,""):(y=y||this._read_open_handlebars(f,_),y=y||this._read_attribute(f,c,_),y=y||this._read_close(f,_),y=y||this._read_raw_content(f,c,_),y=y||this._read_content_word(f),y=y||this._read_comment_or_cdata(f),y=y||this._read_processing(f),y=y||this._read_open(f,_),y=y||this._create_token(l.UNKNOWN,this._input.next()),y)},u.prototype._read_comment_or_cdata=function(c){var _=null,y=null,f=null;if(c==="<"){var C=this._input.peek(1);C==="!"&&(y=this.__patterns.comment.read(),y?(f=o.get_directives(y),f&&f.ignore==="start"&&(y+=o.readIgnored(this._input))):y=this.__patterns.cdata.read()),y&&(_=this._create_token(l.COMMENT,y),_.directives=f)}return _},u.prototype._read_processing=function(c){var _=null,y=null,f=null;if(c==="<"){var C=this._input.peek(1);(C==="!"||C==="?")&&(y=this.__patterns.conditional_comment.read(),y=y||this.__patterns.processing.read()),y&&(_=this._create_token(l.COMMENT,y),_.directives=f)}return _},u.prototype._read_open=function(c,_){var y=null,f=null;return _||c==="<"&&(y=this._input.next(),this._input.peek()==="/"&&(y+=this._input.next()),y+=this.__patterns.element_name.read(),f=this._create_token(l.TAG_OPEN,y)),f},u.prototype._read_open_handlebars=function(c,_){var y=null,f=null;return _||this._options.indent_handlebars&&c==="{"&&this._input.peek(1)==="{"&&(this._input.peek(2)==="!"?(y=this.__patterns.handlebars_comment.read(),y=y||this.__patterns.handlebars.read(),f=this._create_token(l.COMMENT,y)):(y=this.__patterns.handlebars_open.read(),f=this._create_token(l.TAG_OPEN,y))),f},u.prototype._read_close=function(c,_){var y=null,f=null;return _&&(_.text[0]==="<"&&(c===">"||c==="/"&&this._input.peek(1)===">")?(y=this._input.next(),c==="/"&&(y+=this._input.next()),f=this._create_token(l.TAG_CLOSE,y)):_.text[0]==="{"&&c==="}"&&this._input.peek(1)==="}"&&(this._input.next(),this._input.next(),f=this._create_token(l.TAG_CLOSE,"}}"))),f},u.prototype._read_attribute=function(c,_,y){var f=null,C="";if(y&&y.text[0]==="<")if(c==="=")f=this._create_token(l.EQUALS,this._input.next());else if(c==='"'||c==="'"){var L=this._input.next();c==='"'?L+=this.__patterns.double_quote.read():L+=this.__patterns.single_quote.read(),f=this._create_token(l.VALUE,L)}else C=this.__patterns.attribute.read(),C&&(_.type===l.EQUALS?f=this._create_token(l.VALUE,C):f=this._create_token(l.ATTRIBUTE,C));return f},u.prototype._is_content_unformatted=function(c){return this._options.void_elements.indexOf(c)===-1&&(this._options.content_unformatted.indexOf(c)!==-1||this._options.unformatted.indexOf(c)!==-1)},u.prototype._read_raw_content=function(c,_,y){var f="";if(y&&y.text[0]==="{")f=this.__patterns.handlebars_raw_close.read();else if(_.type===l.TAG_CLOSE&&_.opened.text[0]==="<"&&_.text[0]!=="/"){var C=_.opened.text.substr(1).toLowerCase();if(C==="script"||C==="style"){var L=this._read_comment_or_cdata(c);if(L)return L.type=l.TEXT,L;f=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig"))}else this._is_content_unformatted(C)&&(f=this._input.readUntil(new RegExp("</"+C+"[\\n\\r\\t ]*?>","ig")))}return f?this._create_token(l.TEXT,f):null},u.prototype._read_content_word=function(c){var _="";if(this._options.unformatted_content_delimiter&&c===this._options.unformatted_content_delimiter[0]&&(_=this.__patterns.unformatted_content_delimiter.read()),_||(_=this.__patterns.word.read()),_)return this._create_token(l.TEXT,_)},s.exports.Tokenizer=u,s.exports.TOKEN=l}],b={};function e(s){var n=b[s];if(n!==void 0)return n.exports;var t=b[s]={exports:{}};return T[s](t,t.exports,e),t.exports}var E=e(18);U=E})();var k=U;if(1)N=[M,M(77937),M(85040)],B=function(T){var b=M(77937),e=M(85040);return{html_beautify:function(E,s){return k(E,s,b.js_beautify,e.css_beautify)}}}.apply(re,N),B!==void 0&&(Ge.exports=B);else var S,P})()},77937:function(Ge,re){var M,N;(function(){var B;(function(){"use strict";var k=[function(b,e,E){var s=E(1).Beautifier,n=E(5).Options;function t(r,i){var a=new s(r,i);return a.beautify()}b.exports=t,b.exports.defaultOptions=function(){return new n}},function(b,e,E){var s=E(2).Output,n=E(3).Token,t=E(4),r=E(5).Options,i=E(7).Tokenizer,a=E(7).line_starters,v=E(7).positionable_operators,p=E(7).TOKEN;function l(D,I){return I.indexOf(D)!==-1}function o(D){return D.replace(/^\s+/g,"")}function u(D){for(var I={},F=0;F<D.length;F++)I[D[F].replace(/-/g,"_")]=D[F];return I}function c(D,I){return D&&D.type===p.RESERVED&&D.text===I}function _(D,I){return D&&D.type===p.RESERVED&&l(D.text,I)}var y=["case","return","do","if","throw","else","await","break","continue","async"],f=["before-newline","after-newline","preserve-newline"],C=u(f),L=[C.before_newline,C.preserve_newline],R={BlockStatement:"BlockStatement",Statement:"Statement",ObjectLiteral:"ObjectLiteral",ArrayLiteral:"ArrayLiteral",ForInitializer:"ForInitializer",Conditional:"Conditional",Expression:"Expression"};function O(D,I){I.multiline_frame||I.mode===R.ForInitializer||I.mode===R.Conditional||D.remove_indent(I.start_line_index)}function g(D){D=D.replace(t.allLineBreaks,`
`);for(var I=[],F=D.indexOf(`
`);F!==-1;)I.push(D.substring(0,F)),D=D.substring(F+1),F=D.indexOf(`
`);return D.length&&I.push(D),I}function m(D){return D===R.ArrayLiteral}function d(D){return l(D,[R.Expression,R.ForInitializer,R.Conditional])}function h(D,I){for(var F=0;F<D.length;F++){var K=D[F].trim();if(K.charAt(0)!==I)return!1}return!0}function A(D,I){for(var F=0,K=D.length,W;F<K;F++)if(W=D[F],W&&W.indexOf(I)!==0)return!1;return!0}function w(D,I){I=I||{},this._source_text=D||"",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 r(I)}w.prototype.create_flags=function(D,I){var F=0;D&&(F=D.indentation_level,!this._output.just_added_newline()&&D.line_indent_level>F&&(F=D.line_indent_level));var K={mode:I,parent:D,last_token:D?D.last_token:new n(p.START_BLOCK,""),last_word:D?D.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:F,alignment:0,line_indent_level:D?D.line_indent_level:F,start_line_index:this._output.get_line_number(),ternary_depth:0};return K},w.prototype._reset=function(D){var I=D.match(/^[\t ]*/)[0];this._last_last_text="",this._output=new s(this._options,I),this._output.raw=this._options.test_output_raw,this._flag_store=[],this.set_mode(R.BlockStatement);var F=new i(D,this._options);return this._tokens=F.tokenize(),D},w.prototype.beautify=function(){if(this._options.disabled)return this._source_text;var D,I=this._reset(this._source_text),F=this._options.eol;this._options.eol==="auto"&&(F=`
`,I&&t.lineBreak.test(I||"")&&(F=I.match(t.lineBreak)[0]));for(var K=this._tokens.next();K;)this.handle_token(K),this._last_last_text=this._flags.last_token.text,this._flags.last_token=K,K=this._tokens.next();return D=this._output.get_code(F),D},w.prototype.handle_token=function(D,I){D.type===p.START_EXPR?this.handle_start_expr(D):D.type===p.END_EXPR?this.handle_end_expr(D):D.type===p.START_BLOCK?this.handle_start_block(D):D.type===p.END_BLOCK?this.handle_end_block(D):D.type===p.WORD?this.handle_word(D):D.type===p.RESERVED?this.handle_word(D):D.type===p.SEMICOLON?this.handle_semicolon(D):D.type===p.STRING?this.handle_string(D):D.type===p.EQUALS?this.handle_equals(D):D.type===p.OPERATOR?this.handle_operator(D):D.type===p.COMMA?this.handle_comma(D):D.type===p.BLOCK_COMMENT?this.handle_block_comment(D,I):D.type===p.COMMENT?this.handle_comment(D,I):D.type===p.DOT?this.handle_dot(D):D.type===p.EOF?this.handle_eof(D):D.type===p.UNKNOWN?this.handle_unknown(D,I):this.handle_unknown(D,I)},w.prototype.handle_whitespace_and_comments=function(D,I){var F=D.newlines,K=this._options.keep_array_indentation&&m(this._flags.mode);if(D.comments_before)for(var W=D.comments_before.next();W;)this.handle_whitespace_and_comments(W,I),this.handle_token(W,I),W=D.comments_before.next();if(K)for(var z=0;z<F;z+=1)this.print_newline(z>0,I);else if(this._options.max_preserve_newlines&&F>this._options.max_preserve_newlines&&(F=this._options.max_preserve_newlines),this._options.preserve_newlines&&F>1){this.print_newline(!1,I);for(var j=1;j<F;j+=1)this.print_newline(!0,I)}};var x=["async","break","continue","return","throw","yield"];w.prototype.allow_wrap_or_preserved_newline=function(D,I){if(I=I===void 0?!1:I,!this._output.just_added_newline()){var F=this._options.preserve_newlines&&D.newlines||I,K=l(this._flags.last_token.text,v)||l(D.text,v);if(K){var W=l(this._flags.last_token.text,v)&&l(this._options.operator_position,L)||l(D.text,v);F=F&&W}if(F)this.print_newline(!1,!0);else if(this._options.wrap_line_length){if(_(this._flags.last_token,x))return;this._output.set_wrap_point()}}},w.prototype.print_newline=function(D,I){if(!I&&this._flags.last_token.text!==";"&&this._flags.last_token.text!==","&&this._flags.last_token.text!=="="&&(this._flags.last_token.type!==p.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++"))for(var F=this._tokens.peek();this._flags.mode===R.Statement&&!(this._flags.if_block&&c(F,"else"))&&!this._flags.do_block;)this.restore_mode();this._output.add_new_line(D)&&(this._flags.multiline_frame=!0)},w.prototype.print_token_line_indentation=function(D){this._output.just_added_newline()&&(this._options.keep_array_indentation&&D.newlines&&(D.text==="["||m(this._flags.mode))?(this._output.current_line.set_indent(-1),this._output.current_line.push(D.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))},w.prototype.print_token=function(D){if(this._output.raw){this._output.add_raw_token(D);return}if(this._options.comma_first&&D.previous&&D.previous.type===p.COMMA&&this._output.just_added_newline()&&this._output.previous_line.last()===","){var I=this._output.previous_line.pop();this._output.previous_line.is_empty()&&(this._output.previous_line.push(I),this._output.trim(!0),this._output.current_line.pop(),this._output.trim()),this.print_token_line_indentation(D),this._output.add_token(","),this._output.space_before_token=!0}this.print_token_line_indentation(D),this._output.non_breaking_space=!0,this._output.add_token(D.text),this._output.previous_token_wrapped&&(this._flags.multiline_frame=!0)},w.prototype.indent=function(){this._flags.indentation_level+=1,this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},w.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))},w.prototype.set_mode=function(D){this._flags?(this._flag_store.push(this._flags),this._previous_flags=this._flags):this._previous_flags=this.create_flags(null,D),this._flags=this.create_flags(this._previous_flags,D),this._output.set_indent(this._flags.indentation_level,this._flags.alignment)},w.prototype.restore_mode=function(){this._flag_store.length>0&&(this._previous_flags=this._flags,this._flags=this._flag_store.pop(),this._previous_flags.mode===R.Statement&&O(this._output,this._previous_flags),this._output.set_indent(this._flags.indentation_level,this._flags.alignment))},w.prototype.start_of_object_property=function(){return this._flags.parent.mode===R.ObjectLiteral&&this._flags.mode===R.Statement&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||_(this._flags.last_token,["get","set"]))},w.prototype.start_of_statement=function(D){var I=!1;return I=I||_(this._flags.last_token,["var","let","const"])&&D.type===p.WORD,I=I||c(this._flags.last_token,"do"),I=I||!(this._flags.parent.mode===R.ObjectLiteral&&this._flags.mode===R.Statement)&&_(this._flags.last_token,x)&&!D.newlines,I=I||c(this._flags.last_token,"else")&&!(c(D,"if")&&!D.comments_before),I=I||this._flags.last_token.type===p.END_EXPR&&(this._previous_flags.mode===R.ForInitializer||this._previous_flags.mode===R.Conditional),I=I||this._flags.last_token.type===p.WORD&&this._flags.mode===R.BlockStatement&&!this._flags.in_case&&!(D.text==="--"||D.text==="++")&&this._last_last_text!=="function"&&D.type!==p.WORD&&D.type!==p.RESERVED,I=I||this._flags.mode===R.ObjectLiteral&&(this._flags.last_token.text===":"&&this._flags.ternary_depth===0||_(this._flags.last_token,["get","set"])),I?(this.set_mode(R.Statement),this.indent(),this.handle_whitespace_and_comments(D,!0),this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D,_(D,["do","for","if","while"])),!0):!1},w.prototype.handle_start_expr=function(D){this.start_of_statement(D)||this.handle_whitespace_and_comments(D);var I=R.Expression;if(D.text==="["){if(this._flags.last_token.type===p.WORD||this._flags.last_token.text===")"){_(this._flags.last_token,a)&&(this._output.space_before_token=!0),this.print_token(D),this.set_mode(I),this.indent(),this._options.space_in_paren&&(this._output.space_before_token=!0);return}I=R.ArrayLiteral,m(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()),l(this._flags.last_token.type,[p.START_EXPR,p.END_EXPR,p.WORD,p.OPERATOR,p.DOT])||(this._output.space_before_token=!0)}else{if(this._flags.last_token.type===p.RESERVED)this._flags.last_token.text==="for"?(this._output.space_before_token=this._options.space_before_conditional,I=R.ForInitializer):l(this._flags.last_token.text,["if","while","switch"])?(this._output.space_before_token=this._options.space_before_conditional,I=R.Conditional):l(this._flags.last_word,["await","async"])?this._output.space_before_token=!0:this._flags.last_token.text==="import"&&D.whitespace_before===""?this._output.space_before_token=!1:(l(this._flags.last_token.text,a)||this._flags.last_token.text==="catch")&&(this._output.space_before_token=!0);else if(this._flags.last_token.type===p.EQUALS||this._flags.last_token.type===p.OPERATOR)this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D);else if(this._flags.last_token.type===p.WORD){this._output.space_before_token=!1;var F=this._tokens.peek(-3);if(this._options.space_after_named_function&&F){var K=this._tokens.peek(-4);_(F,["async","function"])||F.text==="*"&&_(K,["async","function"])?this._output.space_before_token=!0:this._flags.mode===R.ObjectLiteral?(F.text==="{"||F.text===","||F.text==="*"&&(K.text==="{"||K.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(D);(this._flags.last_token.type===p.RESERVED&&(this._flags.last_word==="function"||this._flags.last_word==="typeof")||this._flags.last_token.text==="*"&&(l(this._last_last_text,["function","yield"])||this._flags.mode===R.ObjectLiteral&&l(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===p.START_BLOCK?this.print_newline():(this._flags.last_token.type===p.END_EXPR||this._flags.last_token.type===p.START_EXPR||this._flags.last_token.type===p.END_BLOCK||this._flags.last_token.text==="."||this._flags.last_token.type===p.COMMA)&&this.allow_wrap_or_preserved_newline(D,D.newlines),this.print_token(D),this.set_mode(I),this._options.space_in_paren&&(this._output.space_before_token=!0),this.indent()},w.prototype.handle_end_expr=function(D){for(;this._flags.mode===R.Statement;)this.restore_mode();this.handle_whitespace_and_comments(D),this._flags.multiline_frame&&this.allow_wrap_or_preserved_newline(D,D.text==="]"&&m(this._flags.mode)&&!this._options.keep_array_indentation),this._options.space_in_paren&&(this._flags.last_token.type===p.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(D),this.restore_mode(),O(this._output,this._previous_flags),this._flags.do_while&&this._previous_flags.mode===R.Conditional&&(this._previous_flags.mode=R.Expression,this._flags.do_block=!1,this._flags.do_while=!1)},w.prototype.handle_start_block=function(D){this.handle_whitespace_and_comments(D);var I=this._tokens.peek(),F=this._tokens.peek(1);this._flags.last_word==="switch"&&this._flags.last_token.type===p.END_EXPR?(this.set_mode(R.BlockStatement),this._flags.in_case_statement=!0):this._flags.case_body?this.set_mode(R.BlockStatement):F&&(l(F.text,[":",","])&&l(I.type,[p.STRING,p.WORD,p.RESERVED])||l(I.text,["get","set","..."])&&l(F.type,[p.WORD,p.RESERVED]))?l(this._last_last_text,["class","interface"])&&!l(F.text,[":",","])?this.set_mode(R.BlockStatement):this.set_mode(R.ObjectLiteral):this._flags.last_token.type===p.OPERATOR&&this._flags.last_token.text==="=>"?this.set_mode(R.BlockStatement):l(this._flags.last_token.type,[p.EQUALS,p.START_EXPR,p.COMMA,p.OPERATOR])||_(this._flags.last_token,["return","throw","import","default"])?this.set_mode(R.ObjectLiteral):this.set_mode(R.BlockStatement),this._flags.last_token&&_(this._flags.last_token.previous,["class","extends"])&&(this._flags.class_start_block=!0);var K=!I.comments_before&&I.text==="}",W=K&&this._flags.last_word==="function"&&this._flags.last_token.type===p.END_EXPR;if(this._options.brace_preserve_inline){var z=0,j=null;this._flags.inline_frame=!0;do if(z+=1,j=this._tokens.peek(z-1),j.newlines){this._flags.inline_frame=!1;break}while(j.type!==p.EOF&&!(j.type===p.END_BLOCK&&j.opened===D))}(this._options.brace_style==="expand"||this._options.brace_style==="none"&&D.newlines)&&!this._flags.inline_frame?this._flags.last_token.type!==p.OPERATOR&&(W||this._flags.last_token.type===p.EQUALS||_(this._flags.last_token,y)&&this._flags.last_token.text!=="else")?this._output.space_before_token=!0:this.print_newline(!1,!0):(m(this._previous_flags.mode)&&(this._flags.last_token.type===p.START_EXPR||this._flags.last_token.type===p.COMMA)&&((this._flags.last_token.type===p.COMMA||this._options.space_in_paren)&&(this._output.space_before_token=!0),(this._flags.last_token.type===p.COMMA||this._flags.last_token.type===p.START_EXPR&&this._flags.inline_frame)&&(this.allow_wrap_or_preserved_newline(D),this._previous_flags.multiline_frame=this._previous_flags.multiline_frame||this._flags.multiline_frame,this._flags.multiline_frame=!1)),this._flags.last_token.type!==p.OPERATOR&&this._flags.last_token.type!==p.START_EXPR&&(this._flags.last_token.type===p.START_BLOCK&&!this._flags.inline_frame?this.print_newline():this._output.space_before_token=!0)),this.print_token(D),this.indent(),!K&&!(this._options.brace_preserve_inline&&this._flags.inline_frame)&&this.print_newline()},w.prototype.handle_end_block=function(D){for(this.handle_whitespace_and_comments(D);this._flags.mode===R.Statement;)this.restore_mode();var I=this._flags.last_token.type===p.START_BLOCK;this._flags.inline_frame&&!I?this._output.space_before_token=!0:this._options.brace_style==="expand"?I||this.print_newline():I||(m(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(D)},w.prototype.handle_word=function(D){if(D.type===p.RESERVED){if(l(D.text,["set","get"])&&this._flags.mode!==R.ObjectLiteral)D.type=p.WORD;else if(D.text==="import"&&l(this._tokens.peek().text,["(","."]))D.type=p.WORD;else if(l(D.text,["as","from"])&&!this._flags.import_block)D.type=p.WORD;else if(this._flags.mode===R.ObjectLiteral){var I=this._tokens.peek();I.text===":"&&(D.type=p.WORD)}}if(this.start_of_statement(D)?_(this._flags.last_token,["var","let","const"])&&D.type===p.WORD&&(this._flags.declaration_statement=!0):D.newlines&&!d(this._flags.mode)&&(this._flags.last_token.type!==p.OPERATOR||this._flags.last_token.text==="--"||this._flags.last_token.text==="++")&&this._flags.last_token.type!==p.EQUALS&&(this._options.preserve_newlines||!_(this._flags.last_token,["var","let","const","set","get"]))?(this.handle_whitespace_and_comments(D),this.print_newline()):this.handle_whitespace_and_comments(D),this._flags.do_block&&!this._flags.do_while)if(c(D,"while")){this._output.space_before_token=!0,this.print_token(D),this._output.space_before_token=!0,this._flags.do_while=!0;return}else this.print_newline(),this._flags.do_block=!1;if(this._flags.if_block)if(!this._flags.else_block&&c(D,"else"))this._flags.else_block=!0;else{for(;this._flags.mode===R.Statement;)this.restore_mode();this._flags.if_block=!1,this._flags.else_block=!1}if(this._flags.in_case_statement&&_(D,["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(D),this._flags.in_case=!0;return}if((this._flags.last_token.type===p.COMMA||this._flags.last_token.type===p.START_EXPR||this._flags.last_token.type===p.EQUALS||this._flags.last_token.type===p.OPERATOR)&&(this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D)),c(D,"function")){(l(this._flags.last_token.text,["}",";"])||this._output.just_added_newline()&&!(l(this._flags.last_token.text,["(","[","{",":","=",","])||this._flags.last_token.type===p.OPERATOR))&&!this._output.just_added_blankline()&&!D.comments_before&&(this.print_newline(),this.print_newline(!0)),this._flags.last_token.type===p.RESERVED||this._flags.last_token.type===p.WORD?_(this._flags.last_token,["get","set","new","export"])||_(this._flags.last_token,x)?this._output.space_before_token=!0:c(this._flags.last_token,"default")&&this._last_last_text==="export"?this._output.space_before_token=!0:this._flags.last_token.text==="declare"?this._output.space_before_token=!0:this.print_newline():this._flags.last_token.type===p.OPERATOR||this._flags.last_token.text==="="?this._output.space_before_token=!0:!this._flags.multiline_frame&&(d(this._flags.mode)||m(this._flags.mode))||this.print_newline(),this.print_token(D),this._flags.last_word=D.text;return}var F="NONE";if(this._flags.last_token.type===p.END_BLOCK?this._previous_flags.inline_frame?F="SPACE":_(D,["else","catch","finally","from"])?this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&D.newlines?F="NEWLINE":(F="SPACE",this._output.space_before_token=!0):F="NEWLINE":this._flags.last_token.type===p.SEMICOLON&&this._flags.mode===R.BlockStatement?F="NEWLINE":this._flags.last_token.type===p.SEMICOLON&&d(this._flags.mode)?F="SPACE":this._flags.last_token.type===p.STRING?F="NEWLINE":this._flags.last_token.type===p.RESERVED||this._flags.last_token.type===p.WORD||this._flags.last_token.text==="*"&&(l(this._last_last_text,["function","yield"])||this._flags.mode===R.ObjectLiteral&&l(this._last_last_text,["{",","]))?F="SPACE":this._flags.last_token.type===p.START_BLOCK?this._flags.inline_frame?F="SPACE":F="NEWLINE":this._flags.last_token.type===p.END_EXPR&&(this._output.space_before_token=!0,F="NEWLINE"),_(D,a)&&this._flags.last_token.text!==")"&&(this._flags.inline_frame||this._flags.last_token.text==="else"||this._flags.last_token.text==="export"?F="SPACE":F="NEWLINE"),_(D,["else","catch","finally"]))if((!(this._flags.last_token.type===p.END_BLOCK&&this._previous_flags.mode===R.BlockStatement)||this._options.brace_style==="expand"||this._options.brace_style==="end-expand"||this._options.brace_style==="none"&&D.newlines)&&!this._flags.inline_frame)this.print_newline();else{this._output.trim(!0);var K=this._output.current_line;K.last()!=="}"&&this.print_newline(),this._output.space_before_token=!0}else F==="NEWLINE"?_(this._flags.last_token,y)?this._output.space_before_token=!0:this._flags.last_token.text==="declare"&&_(D,["var","let","const"])?this._output.space_before_token=!0:this._flags.last_token.type!==p.END_EXPR?(this._flags.last_token.type!==p.START_EXPR||!_(D,["var","let","const"]))&&this._flags.last_token.text!==":"&&(c(D,"if")&&c(D.previous,"else")?this._output.space_before_token=!0:this.print_newline()):_(D,a)&&this._flags.last_token.text!==")"&&this.print_newline():this._flags.multiline_frame&&m(this._flags.mode)&&this._flags.last_token.text===","&&this._last_last_text==="}"?this.print_newline():F==="SPACE"&&(this._output.space_before_token=!0);D.previous&&(D.previous.type===p.WORD||D.previous.type===p.RESERVED)&&(this._output.space_before_token=!0),this.print_token(D),this._flags.last_word=D.text,D.type===p.RESERVED&&(D.text==="do"?this._flags.do_block=!0:D.text==="if"?this._flags.if_block=!0:D.text==="import"?this._flags.import_block=!0:this._flags.import_block&&c(D,"from")&&(this._flags.import_block=!1))},w.prototype.handle_semicolon=function(D){this.start_of_statement(D)?this._output.space_before_token=!1:this.handle_whitespace_and_comments(D);for(var I=this._tokens.peek();this._flags.mode===R.Statement&&!(this._flags.if_block&&c(I,"else"))&&!this._flags.do_block;)this.restore_mode();this._flags.import_block&&(this._flags.import_block=!1),this.print_token(D)},w.prototype.handle_string=function(D){D.text.startsWith("`")&&D.newlines===0&&D.whitespace_before===""&&(D.previous.text===")"||this._flags.last_token.type===p.WORD)||(this.start_of_statement(D)?this._output.space_before_token=!0:(this.handle_whitespace_and_comments(D),this._flags.last_token.type===p.RESERVED||this._flags.last_token.type===p.WORD||this._flags.inline_frame?this._output.space_before_token=!0:this._flags.last_token.type===p.COMMA||this._flags.last_token.type===p.START_EXPR||this._flags.last_token.type===p.EQUALS||this._flags.last_token.type===p.OPERATOR?this.start_of_object_property()||this.allow_wrap_or_preserved_newline(D):D.text.startsWith("`")&&this._flags.last_token.type===p.END_EXPR&&(D.previous.text==="]"||D.previous.text===")")&&D.newlines===0?this._output.space_before_token=!0:this.print_newline())),this.print_token(D)},w.prototype.handle_equals=function(D){this.start_of_statement(D)||this.handle_whitespace_and_comments(D),this._flags.declaration_statement&&(this._flags.declaration_assignment=!0),this._output.space_before_token=!0,this.print_token(D),this._output.space_before_token=!0},w.prototype.handle_comma=function(D){this.handle_whitespace_and_comments(D,!0),this.print_token(D),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(D)):this._flags.mode===R.ObjectLiteral||this._flags.mode===R.Statement&&this._flags.parent.mode===R.ObjectLiteral?(this._flags.mode===R.Statement&&this.restore_mode(),this._flags.inline_frame||this.print_newline()):this._options.comma_first&&this.allow_wrap_or_preserved_newline(D)},w.prototype.handle_operator=function(D){var I=D.text==="*"&&(_(this._flags.last_token,["function","yield"])||l(this._flags.last_token.type,[p.START_BLOCK,p.COMMA,p.END_BLOCK,p.SEMICOLON])),F=l(D.text,["-","+"])&&(l(this._flags.last_token.type,[p.START_BLOCK,p.START_EXPR,p.EQUALS,p.OPERATOR])||l(this._flags.last_token.text,a)||this._flags.last_token.text===",");if(!this.start_of_statement(D)){var K=!I;this.handle_whitespace_and_comments(D,K)}if(D.text==="*"&&this._flags.last_token.type===p.DOT){this.print_token(D);return}if(D.text==="::"){this.print_token(D);return}if(this._flags.last_token.type===p.OPERATOR&&l(this._options.operator_position,L)&&this.allow_wrap_or_preserved_newline(D),D.text===":"&&this._flags.in_case){this.print_token(D),this._flags.in_case=!1,this._flags.case_body=!0,this._tokens.peek().type!==p.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 W=!0,z=!0,j=!1;if(D.text===":"?this._flags.ternary_depth===0?W=!1:(this._flags.ternary_depth-=1,j=!0):D.text==="?"&&(this._flags.ternary_depth+=1),!F&&!I&&this._options.preserve_newlines&&l(D.text,v)){var G=D.text===":",Z=G&&j,Q=G&&!j;switch(this._options.operator_position){case C.before_newline:this._output.space_before_token=!Q,this.print_token(D),(!G||Z)&&this.allow_wrap_or_preserved_newline(D),this._output.space_before_token=!0;return;case C.after_newline:this._output.space_before_token=!0,!G||Z?this._tokens.peek().newlines?this.print_newline(!1,!0):this.allow_wrap_or_preserved_newline(D):this._output.space_before_token=!1,this.print_token(D),this._output.space_before_token=!0;return;case C.preserve_newline:Q||this.allow_wrap_or_preserved_newline(D),W=!(this._output.just_added_newline()||Q),this._output.space_before_token=W,this.print_token(D),this._output.space_before_token=!0;return}}if(I){this.allow_wrap_or_preserved_newline(D),W=!1;var ue=this._tokens.peek();z=ue&&l(ue.type,[p.WORD,p.RESERVED])}else if(D.text==="...")this.allow_wrap_or_preserved_newline(D),W=this._flags.last_token.type===p.START_BLOCK,z=!1;else if(l(D.text,["--","++","!","~"])||F){if((this._flags.last_token.type===p.COMMA||this._flags.last_token.type===p.START_EXPR)&&this.allow_wrap_or_preserved_newline(D),W=!1,z=!1,D.newlines&&(D.text==="--"||D.text==="++"||D.text==="~")){var ee=_(this._flags.last_token,y)&&D.newlines;ee&&(this._previous_flags.if_block||this._previous_flags.else_block)&&this.restore_mode(),this.print_newline(ee,!0)}this._flags.last_token.text===";"&&d(this._flags.mode)&&(W=!0),this._flags.last_token.type===p.RESERVED?W=!0:this._flags.last_token.type===p.END_EXPR?W=!(this._flags.last_token.text==="]"&&(D.text==="--"||D.text==="++")):this._flags.last_token.type===p.OPERATOR&&(W=l(D.text,["--","-","++","+"])&&l(this._flags.last_token.text,["--","-","++","+"]),l(D.text,["+","-"])&&l(this._flags.last_token.text,["--","++"])&&(z=!0)),(this._flags.mode===R.BlockStatement&&!this._flags.inline_frame||this._flags.mode===R.Statement)&&(this._flags.last_token.text==="{"||this._flags.last_token.text===";")&&this.print_newline()}this._output.space_before_token=this._output.space_before_token||W,this.print_token(D),this._output.space_before_token=z},w.prototype.handle_block_comment=function(D,I){if(this._output.raw){this._output.add_raw_token(D),D.directives&&D.directives.preserve==="end"&&(this._output.raw=this._options.test_output_raw);return}if(D.directives){this.print_newline(!1,I),this.print_token(D),D.directives.preserve==="start"&&(this._output.raw=!0),this.print_newline(!1,!0);return}if(!t.newline.test(D.text)&&!D.newlines){this._output.space_before_token=!0,this.print_token(D),this._output.space_before_token=!0;return}else this.print_block_commment(D,I)},w.prototype.print_block_commment=function(D,I){var F=g(D.text),K,W=!1,z=!1,j=D.whitespace_before,G=j.length;if(this.print_newline(!1,I),this.print_token_line_indentation(D),this._output.add_token(F[0]),this.print_newline(!1,I),F.length>1){for(F=F.slice(1),W=h(F,"*"),z=A(F,j),W&&(this._flags.alignment=1),K=0;K<F.length;K++)W?(this.print_token_line_indentation(D),this._output.add_token(o(F[K]))):z&&F[K]?(this.print_token_line_indentation(D),this._output.add_token(F[K].substring(G))):(this._output.current_line.set_indent(-1),this._output.add_token(F[K])),this.print_newline(!1,I);this._flags.alignment=0}},w.prototype.handle_comment=function(D,I){D.newlines?this.print_newline(!1,I):this._output.trim(!0),this._output.space_before_token=!0,this.print_token(D),this.print_newline(!1,I)},w.prototype.handle_dot=function(D){this.start_of_statement(D)||this.handle_whitespace_and_comments(D,!0),this._flags.last_token.text.match("^[0-9]+$")&&(this._output.space_before_token=!0),_(this._flags.last_token,y)?this._output.space_before_token=!1:this.allow_wrap_or_preserved_newline(D,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(D)},w.prototype.handle_unknown=function(D,I){this.print_token(D),D.text[D.text.length-1]===`
`&&this.print_newline(!1,I)},w.prototype.handle_eof=function(D){for(;this._flags.mode===R.Statement;)this.restore_mode();this.handle_whitespace_and_comments(D)},b.exports.Beautifier=w},function(b){function e(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=[]}e.prototype.clone_empty=function(){var n=new e(this.__parent);return n.set_indent(this.__indent_count,this.__alignment_count),n},e.prototype.item=function(n){return n<0?this.__items[this.__items.length+n]:this.__items[n]},e.prototype.has_match=function(n){for(var t=this.__items.length-1;t>=0;t--)if(this.__items[t].match(n))return!0;return!1},e.prototype.set_indent=function(n,t){this.is_empty()&&(this.__indent_count=n||0,this.__alignment_count=t||0,this.__character_count=this.__parent.get_indent_size(this.__indent_count,this.__alignment_count))},e.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)},e.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},e.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},e.prototype.is_empty=function(){return this.__items.length===0},e.prototype.last=function(){return this.is_empty()?null:this.__items[this.__items.length-1]},e.prototype.push=function(n){this.__items.push(n);var t=n.lastIndexOf(`
`);t!==-1?this.__character_count=n.length-t:this.__character_count+=n.length},e.prototype.pop=function(){var n=null;return this.is_empty()||(n=this.__items.pop(),this.__character_count-=n.length),n},e.prototype._remove_indent=function(){this.__indent_count>0&&(this.__indent_count-=1,this.__character_count-=this.__parent.indent_size)},e.prototype._remove_wrap_indent=function(){this.__wrap_point_indent_count>0&&(this.__wrap_point_indent_count-=1)},e.prototype.trim=function(){for(;this.last()===" ";)this.__items.pop(),this.__character_count-=1},e.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 E(n,t){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)),t=t||"",n.indent_level>0&&(t=new Array(n.indent_level+1).join(this.__indent_string)),this.__base_string=t,this.__base_string_length=t.length}E.prototype.get_indent_size=function(n,t){var r=this.__base_string_length;return t=t||0,n<0&&(r=0),r+=n*this.__indent_size,r+=t,r},E.prototype.get_indent_string=function(n,t){var r=this.__base_string;return t=t||0,n<0&&(n=0,r=""),t+=n*this.__indent_size,this.__ensure_cache(t),r+=this.__cache[t],r},E.prototype.__ensure_cache=function(n){for(;n>=this.__cache.length;)this.__add_column()},E.prototype.__add_column=function(){var n=this.__cache.length,t=0,r="";this.__indent_size&&n>=this.__indent_size&&(t=Math.floor(n/this.__indent_size),n-=t*this.__indent_size,r=new Array(t+1).join(this.__indent_string)),n&&(r+=new Array(n+1).join(" ")),this.__cache.push(r)};function s(n,t){this.__indent_cache=new E(n,t),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 e(this),this.space_before_token=!1,this.non_breaking_space=!1,this.previous_token_wrapped=!1,this.__add_outputline()}s.prototype.__add_outputline=function(){this.previous_line=this.current_line,this.current_line=this.next_line.clone_empty(),this.__lines.push(this.current_line)},s.prototype.get_line_number=function(){return this.__lines.length},s.prototype.get_indent_string=function(n,t){return this.__indent_cache.get_indent_string(n,t)},s.prototype.get_indent_size=function(n,t){return this.__indent_cache.get_indent_size(n,t)},s.prototype.is_empty=function(){return!this.previous_line&&this.current_line.is_empty()},s.prototype.add_new_line=function(n){return this.is_empty()||!n&&this.just_added_newline()?!1:(this.raw||this.__add_outputline(),!0)},s.prototype.get_code=function(n){this.trim(!0);var t=this.current_line.pop();t&&(t[t.length-1]===`
`&&(t=t.replace(/\n+$/g,"")),this.current_line.push(t)),this._end_with_newline&&this.__add_outputline();var r=this.__lines.join(`
`);return n!==`
`&&(r=r.replace(/[\n]/g,n)),r},s.prototype.set_wrap_point=function(){this.current_line._set_wrap_point()},s.prototype.set_indent=function(n,t){return n=n||0,t=t||0,this.next_line.set_indent(n,t),this.__lines.length>1?(this.current_line.set_indent(n,t),!0):(this.current_line.set_indent(),!1)},s.prototype.add_raw_token=function(n){for(var t=0;t<n.newlines;t++)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},s.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()},s.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(" "))},s.prototype.remove_indent=function(n){for(var t=this.__lines.length;n<t;)this.__lines[n]._remove_indent(),n++;this.current_line._remove_wrap_indent()},s.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},s.prototype.just_added_newline=function(){return this.current_line.is_empty()},s.prototype.just_added_blankline=function(){return this.is_empty()||this.current_line.is_empty()&&this.previous_line.is_empty()},s.prototype.ensure_empty_line_above=function(n,t){for(var r=this.__lines.length-2;r>=0;){var i=this.__lines[r];if(i.is_empty())break;if(i.item(0).indexOf(n)!==0&&i.item(-1)!==t){this.__lines.splice(r+1,0,new e(this)),this.previous_line=this.__lines[this.__lines.length-2];break}r--}},b.exports.Output=s},function(b){function e(E,s,n,t){this.type=E,this.text=s,this.comments_before=null,this.newlines=n||0,this.whitespace_before=t||"",this.parent=null,this.next=null,this.previous=null,this.opened=null,this.closed=null,this.directives=null}b.exports.Token=e},function(b,e){var E="\\x23\\x24\\x40\\x41-\\x5a\\x5f\\x61-\\x7a",s="\\x24\\x30-\\x39\\x41-\\x5a\\x5f\\x61-\\x7a",n="\\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",t="\\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",r="(?:\\\\u[0-9a-fA-F]{4}|["+E+n+"])",i="(?:\\\\u[0-9a-fA-F]{4}|["+s+n+t+"])*";e.identifier=new RegExp(r+i,"g"),e.identifierStart=new RegExp(r),e.identifierMatch=new RegExp("(?:\\\\u[0-9a-fA-F]{4}|["+s+n+t+"])+");var a=/[\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff]/;e.newline=/[\n\r\u2028\u2029]/,e.lineBreak=new RegExp(`\r
|`+e.newline.source),e.allLineBreaks=new RegExp(e.lineBreak.source,"g")},function(b,e,E){var s=E(6).Options,n=["before-newline","after-newline","preserve-newline"];function t(r){s.call(this,r,"js");var i=this.raw_options.brace_style||null;i==="expand-strict"?this.raw_options.brace_style="expand":i==="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 a=this._get_selection_list("brace_style",["collapse","expand","end-expand","none","preserve-inline"]);this.brace_preserve_inline=!1,this.brace_style="collapse";for(var v=0;v<a.length;v++)a[v]==="preserve-inline"?this.brace_preserve_inline=!0:this.brace_style=a[v];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",n),this.test_output_raw=this._get_boolean("test_output_raw"),this.jslint_happy&&(this.space_after_anon_function=!0)}t.prototype=new s,b.exports.Options=t},function(b){function e(n,t){this.raw_options=E(n,t),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"])}e.prototype._get_array=function(n,t){var r=this.raw_options[n],i=t||[];return typeof r=="object"?r!==null&&typeof r.concat=="function"&&(i=r.concat()):typeof r=="string"&&(i=r.split(/[^a-zA-Z0-9_\/\-]+/)),i},e.prototype._get_boolean=function(n,t){var r=this.raw_options[n],i=r===void 0?!!t:!!r;return i},e.prototype._get_characters=function(n,t){var r=this.raw_options[n],i=t||"";return typeof r=="string"&&(i=r.replace(/\\r/,"\r").replace(/\\n/,`
`).replace(/\\t/," ")),i},e.prototype._get_number=function(n,t){var r=this.raw_options[n];t=parseInt(t,10),isNaN(t)&&(t=0);var i=parseInt(r,10);return isNaN(i)&&(i=t),i},e.prototype._get_selection=function(n,t,r){var i=this._get_selection_list(n,t,r);if(i.length!==1)throw new Error("Invalid Option Value: The option '"+n+`' can only be one of the following values:
`+t+`
You passed in: '`+this.raw_options[n]+"'");return i[0]},e.prototype._get_selection_list=function(n,t,r){if(!t||t.length===0)throw new Error("Selection list cannot be empty.");if(r=r||[t[0]],!this._is_valid_selection(r,t))throw new Error("Invalid Default Value!");var i=this._get_array(n,r);if(!this._is_valid_selection(i,t))throw new Error("Invalid Option Value: The option '"+n+`' can contain only the following values:
`+t+`
You passed in: '`+this.raw_options[n]+"'");return i},e.prototype._is_valid_selection=function(n,t){return n.length&&t.length&&!n.some(function(r){return t.indexOf(r)===-1})};function E(n,t){var r={};n=s(n);var i;for(i in n)i!==t&&(r[i]=n[i]);if(t&&n[t])for(i in n[t])r[i]=n[t][i];return r}function s(n){var t={},r;for(r in n){var i=r.replace(/-/g,"_");t[i]=n[r]}return t}b.exports.Options=e,b.exports.normalizeOpts=s,b.exports.mergeOpts=E},function(b,e,E){var s=E(8).InputScanner,n=E(9).Tokenizer,t=E(9).TOKEN,r=E(13).Directives,i=E(4),a=E(12).Pattern,v=E(14).TemplatablePattern;function p(h,A){return A.indexOf(h)!==-1}var l={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:t.START,RAW:t.RAW,EOF:t.EOF},o=new r(/\/\*/,/\*\//),u=/0[xX][0123456789abcdefABCDEF_]*n?|0[oO][01234567_]*n?|0[bB][01_]*n?|\d[\d_]*n|(?:\.\d[\d_]*|\d[\d_]*\.?[\d_]*)(?:[eE][+-]?[\d_]+)?/,c=/[0-9]/,_=/[^\d\.]/,y=">>> === !== &&= ??= ||= << && >= ** != == <= >> || ?? |> < / - + > : & % ? ^ | *".split(" "),f=">>>= ... >>= <<= === >>> !== **= &&= ??= ||= => ^= :: /= << <= == && -= >= >> != -- += ** || ?? ++ %= &= *= |= |> = ! ? > < : / ^ - + * & % ~ |";f=f.replace(/[-[\]{}()*+?.,\\^$|#]/g,"\\$&"),f="\\?\\.(?!\\d) "+f,f=f.replace(/ /g,"|");var C=new RegExp(f),L="continue,try,throw,return,var,let,const,if,switch,case,default,for,while,break,function,import,export".split(","),R=L.concat(["do","in","of","else","get","set","new","catch","finally","typeof","yield","async","await","from","as","class","extends"]),O=new RegExp("^(?:"+R.join("|")+")$"),g,m=function(h,A){n.call(this,h,A),this._patterns.whitespace=this._patterns.whitespace.matching(/\u00A0\u1680\u180e\u2000-\u200a\u202f\u205f\u3000\ufeff/.source,/\u2028\u2029/.source);var w=new a(this._input),x=new v(this._input).read_options(this._options);this.__patterns={template:x,identifier:x.starting_with(i.identifier).matching(i.identifierMatch),number:w.matching(u),punct:w.matching(C),comment:w.starting_with(/\/\//).until(/[\n\r\u2028\u2029]/),block_comment:w.starting_with(/\/\*/).until_after(/\*\//),html_comment_start:w.matching(/<!--/),html_comment_end:w.matching(/-->/),include:w.starting_with(/#include/).until_after(i.lineBreak),shebang:w.starting_with(/#!/).until_after(i.lineBreak),xml:w.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:x.until(/['\\\n\r\u2028\u2029]/),double_quote:x.until(/["\\\n\r\u2028\u2029]/),template_text:x.until(/[`\\$]/),template_expression:x.until(/[`}\\]/)}};m.prototype=new n,m.prototype._is_comment=function(h){return h.type===l.COMMENT||h.type===l.BLOCK_COMMENT||h.type===l.UNKNOWN},m.prototype._is_opening=function(h){return h.type===l.START_BLOCK||h.type===l.START_EXPR},m.prototype._is_closing=function(h,A){return(h.type===l.END_BLOCK||h.type===l.END_EXPR)&&A&&(h.text==="]"&&A.text==="["||h.text===")"&&A.text==="("||h.text==="}"&&A.text==="{")},m.prototype._reset=function(){g=!1},m.prototype._get_next_token=function(h,A){var w=null;this._readWhitespace();var x=this._input.peek();return x===null?this._create_token(l.EOF,""):(w=w||this._read_non_javascript(x),w=w||this._read_string(x),w=w||this._read_word(h),w=w||this._read_singles(x),w=w||this._read_comment(x),w=w||this._read_regexp(x,h),w=w||this._read_xml(x,h),w=w||this._read_punctuation(),w=w||this._create_token(l.UNKNOWN,this._input.next()),w)},m.prototype._read_word=function(h){var A;if(A=this.__patterns.identifier.read(),A!=="")return A=A.replace(i.allLineBreaks,`
`),!(h.type===l.DOT||h.type===l.RESERVED&&(h.text==="set"||h.text==="get"))&&O.test(A)?(A==="in"||A==="of")&&(h.type===l.WORD||h.type===l.STRING)?this._create_token(l.OPERATOR,A):this._create_token(l.RESERVED,A):this._create_token(l.WORD,A);if(A=this.__patterns.number.read(),A!=="")return this._create_token(l.WORD,A)},m.prototype._read_singles=function(h){var A=null;return h==="("||h==="["?A=this._create_token(l.START_EXPR,h):h===")"||h==="]"?A=this._create_token(l.END_EXPR,h):h==="{"?A=this._create_token(l.START_BLOCK,h):h==="}"?A=this._create_token(l.END_BLOCK,h):h===";"?A=this._create_token(l.SEMICOLON,h):h==="."&&_.test(this._input.peek(1))?A=this._create_token(l.DOT,h):h===","&&(A=this._create_token(l.COMMA,h)),A&&this._input.next(),A},m.prototype._read_punctuation=function(){var h=this.__patterns.punct.read();if(h!=="")return h==="="?this._create_token(l.EQUALS,h):h==="?."?this._create_token(l.DOT,h):this._create_token(l.OPERATOR,h)},m.prototype._read_non_javascript=function(h){var A="";if(h==="#"){if(this._is_first_token()&&(A=this.__patterns.shebang.read(),A))return this._create_token(l.UNKNOWN,A.trim()+`
`);if(A=this.__patterns.include.read(),A)return this._create_token(l.UNKNOWN,A.trim()+`
`);h=this._input.next();var w="#";if(this._input.hasNext()&&this._input.testChar(c)){do h=this._input.next(),w+=h;while(this._input.hasNext()&&h!=="#"&&h!=="=");return h==="#"||(this._input.peek()==="["&&this._input.peek(1)==="]"?(w+="[]",this._input.next(),this._input.next()):this._input.peek()==="{"&&this._input.peek(1)==="}"&&(w+="{}",this._input.next(),this._input.next())),this._create_token(l.WORD,w)}this._input.back()}else if(h==="<"&&this._is_first_token()){if(A=this.__patterns.html_comment_start.read(),A){for(;this._input.hasNext()&&!this._input.testChar(i.newline);)A+=this._input.next();return g=!0,this._create_token(l.COMMENT,A)}}else if(g&&h==="-"&&(A=this.__patterns.html_comment_end.read(),A))return g=!1,this._create_token(l.COMMENT,A);return null},m.prototype._read_comment=function(h){var A=null;if(h==="/"){var w="";if(this._input.peek(1)==="*"){w=this.__patterns.block_comment.read();var x=o.get_directives(w);x&&x.ignore==="start"&&(w+=o.readIgnored(this._input)),w=w.replace(i.allLineBreaks,`
`),A=this._create_token(l.BLOCK_COMMENT,w),A.directives=x}else this._input.peek(1)==="/"&&(w=this.__patterns.comment.read(),A=this._create_token(l.COMMENT,w))}return A},m.prototype._read_string=function(h){if(h==="`"||h==="'"||h==='"'){var A=this._input.next();return this.has_char_escapes=!1,h==="`"?A+=this._read_string_recursive("`",!0,"${"):A+=this._read_string_recursive(h),this.has_char_escapes&&this._options.unescape_strings&&(A=d(A)),this._input.peek()===h&&(A+=this._input.next()),A=A.replace(i.allLineBreaks,`
`),this._create_token(l.STRING,A)}return null},m.prototype._allow_regexp_or_xml=function(h){return h.type===l.RESERVED&&p(h.text,["return","case","throw","else","do","typeof","yield"])||h.type===l.END_EXPR&&h.text===")"&&h.opened.previous.type===l.RESERVED&&p(h.opened.previous.text,["if","while","for"])||p(h.type,[l.COMMENT,l.START_EXPR,l.START_BLOCK,l.START,l.END_BLOCK,l.OPERATOR,l.EQUALS,l.EOF,l.SEMICOLON,l.COMMA])},m.prototype._read_regexp=function(h,A){if(h==="/"&&this._allow_regexp_or_xml(A)){for(var w=this._input.next(),x=!1,D=!1;this._input.hasNext()&&(x||D||this._input.peek()!==h)&&!this._input.testChar(i.newline);)w+=this._input.peek(),x?x=!1:(x=this._input.peek()==="\\",this._input.peek()==="["?D=!0:this._input.peek()==="]"&&(D=!1)),this._input.next();return this._input.peek()===h&&(w+=this._input.next(),w+=this._input.read(i.identifier)),this._create_token(l.STRING,w)}return null},m.prototype._read_xml=function(h,A){if(this._options.e4x&&h==="<"&&this._allow_regexp_or_xml(A)){var w="",x=this.__patterns.xml.read_match();if(x){for(var D=x[2].replace(/^{\s+/,"{").replace(/\s+}$/,"}"),I=D.indexOf("{")===0,F=0;x;){var K=!!x[1],W=x[2],z=!!x[x.length-1]||W.slice(0,8)==="![CDATA[";if(!z&&(W===D||I&&W.replace(/^{\s+/,"{").replace(/\s+}$/,"}"))&&(K?--F:++F),w+=x[0],F<=0)break;x=this.__patterns.xml.read_match()}return x||(w+=this._input.match(/[\s\S]*/g)[0]),w=w.replace(i.allLineBreaks,`
`),this._create_token(l.STRING,w)}}return null};function d(h){for(var A="",w=0,x=new s(h),D=null;x.hasNext();)if(D=x.match(/([\s]|[^\\]|\\\\)+/g),D&&(A+=D[0]),x.peek()==="\\"){if(x.next(),x.peek()==="x")D=x.match(/x([0-9A-Fa-f]{2})/g);else if(x.peek()==="u")D=x.match(/u([0-9A-Fa-f]{4})/g);else{A+="\\",x.hasNext()&&(A+=x.next());continue}if(!D||(w=parseInt(D[1],16),w>126&&w<=255&&D[0].indexOf("x")===0))return h;if(w>=0&&w<32){A+="\\"+D[0];continue}else w===34||w===39||w===92?A+="\\"+String.fromCharCode(w):A+=String.fromCharCode(w)}return A}m.prototype._read_string_recursive=function(h,A,w){var x,D;h==="'"?D=this.__patterns.single_quote:h==='"'?D=this.__patterns.double_quote:h==="`"?D=this.__patterns.template_text:h==="}"&&(D=this.__patterns.template_expression);for(var I=D.read(),F="";this._input.hasNext();){if(F=this._input.next(),F===h||!A&&i.newline.test(F)){this._input.back();break}else F==="\\"&&this._input.hasNext()?(x=this._input.peek(),x==="x"||x==="u"?this.has_char_escapes=!0:x==="\r"&&this._input.peek(1)===`
`&&this._input.next(),F+=this._input.next()):w&&(w==="${"&&F==="$"&&this._input.peek()==="{"&&(F+=this._input.next()),w===F&&(h==="`"?F+=this._read_string_recursive("}",A,"`"):F+=this._read_string_recursive("`",A,"${"),this._input.hasNext()&&(F+=this._input.next())));F+=D.read(),I+=F}return I},b.exports.Tokenizer=m,b.exports.TOKEN=l,b.exports.positionable_operators=y.slice(),b.exports.line_starters=L.slice()},function(b){var e=RegExp.prototype.hasOwnProperty("sticky");function E(s){this.__input=s||"",this.__input_length=this.__input.length,this.__position=0}E.prototype.restart=function(){this.__position=0},E.prototype.back=function(){this.__position>0&&(this.__position-=1)},E.prototype.hasNext=function(){return this.__position<this.__input_length},E.prototype.next=function(){var s=null;return this.hasNext()&&(s=this.__input.charAt(this.__position),this.__position+=1),s},E.prototype.peek=function(s){var n=null;return s=s||0,s+=this.__position,s>=0&&s<this.__input_length&&(n=this.__input.charAt(s)),n},E.prototype.__match=function(s,n){s.lastIndex=n;var t=s.exec(this.__input);return t&&!(e&&s.sticky)&&t.index!==n&&(t=null),t},E.prototype.test=function(s,n){return n=n||0,n+=this.__position,n>=0&&n<this.__input_length?!!this.__match(s,n):!1},E.prototype.testChar=function(s,n){var t=this.peek(n);return s.lastIndex=0,t!==null&&s.test(t)},E.prototype.match=function(s){var n=this.__match(s,this.__position);return n?this.__position+=n[0].length:n=null,n},E.prototype.read=function(s,n,t){var r="",i;return s&&(i=this.match(s),i&&(r+=i[0])),n&&(i||!s)&&(r+=this.readUntil(n,t)),r},E.prototype.readUntil=function(s,n){var t="",r=this.__position;s.lastIndex=this.__position;var i=s.exec(this.__input);return i?(r=i.index,n&&(r+=i[0].length)):r=this.__input_length,t=this.__input.substring(this.__position,r),this.__position=r,t},E.prototype.readUntilAfter=function(s){return this.readUntil(s,!0)},E.prototype.get_regexp=function(s,n){var t=null,r="g";return n&&e&&(r="y"),typeof s=="string"&&s!==""?t=new RegExp(s,r):s&&(t=new RegExp(s.source,r)),t},E.prototype.get_literal_regexp=function(s){return RegExp(s.replace(/[-\/\\^$*+?.()|[\]{}]/g,"\\$&"))},E.prototype.peekUntilAfter=function(s){var n=this.__position,t=this.readUntilAfter(s);return this.__position=n,t},E.prototype.lookBack=function(s){var n=this.__position-1;return n>=s.length&&this.__input.substring(n-s.length,n).toLowerCase()===s},b.exports.InputScanner=E},function(b,e,E){var s=E(8).InputScanner,n=E(3).Token,t=E(10).TokenStream,r=E(11).WhitespacePattern,i={START:"TK_START",RAW:"TK_RAW",EOF:"TK_EOF"},a=function(v,p){this._input=new s(v),this._options=p||{},this.__tokens=null,this._patterns={},this._patterns.whitespace=new r(this._input)};a.prototype.tokenize=function(){this._input.restart(),this.__tokens=new t,this._reset();for(var v,p=new n(i.START,""),l=null,o=[],u=new t;p.type!==i.EOF;){for(v=this._get_next_token(p,l);this._is_comment(v);)u.add(v),v=this._get_next_token(p,l);u.isEmpty()||(v.comments_before=u,u=new t),v.parent=l,this._is_opening(v)?(o.push(l),l=v):l&&this._is_closing(v,l)&&(v.opened=l,l.closed=v,l=o.pop(),v.parent=l),v.previous=p,p.next=v,this.__tokens.add(v),p=v}return this.__tokens},a.prototype._is_first_token=function(){return this.__tokens.isEmpty()},a.prototype._reset=function(){},a.prototype._get_next_token=function(v,p){this._readWhitespace();var l=this._input.read(/.+/g);return l?this._create_token(i.RAW,l):this._create_token(i.EOF,"")},a.prototype._is_comment=function(v){return!1},a.prototype._is_opening=function(v){return!1},a.prototype._is_closing=function(v,p){return!1},a.prototype._create_token=function(v,p){var l=new n(v,p,this._patterns.whitespace.newline_count,this._patterns.whitespace.whitespace_before_token);return l},a.prototype._readWhitespace=function(){return this._patterns.whitespace.read()},b.exports.Tokenizer=a,b.exports.TOKEN=i},function(b){function e(E){this.__tokens=[],this.__tokens_length=this.__tokens.length,this.__position=0,this.__parent_token=E}e.prototype.restart=function(){this.__position=0},e.prototype.isEmpty=function(){return this.__tokens_length===0},e.prototype.hasNext=function(){return this.__position<this.__tokens_length},e.prototype.next=function(){var E=null;return this.hasNext()&&(E=this.__tokens[this.__position],this.__position+=1),E},e.prototype.peek=function(E){var s=null;return E=E||0,E+=this.__position,E>=0&&E<this.__tokens_length&&(s=this.__tokens[E]),s},e.prototype.add=function(E){this.__parent_token&&(E.parent=this.__parent_token),this.__tokens.push(E),this.__tokens_length+=1},b.exports.TokenStream=e},function(b,e,E){var s=E(12).Pattern;function n(t,r){s.call(this,t,r),r?this._line_regexp=this._input.get_regexp(r._line_regexp):this.__set_whitespace_patterns("",""),this.newline_count=0,this.whitespace_before_token=""}n.prototype=new s,n.prototype.__set_whitespace_patterns=function(t,r){t+="\\t ",r+="\\n\\r",this._match_pattern=this._input.get_regexp("["+t+r+"]+",!0),this._newline_regexp=this._input.get_regexp("\\r\\n|["+r+"]")},n.prototype.read=function(){this.newline_count=0,this.whitespace_before_token="";var t=this._input.read(this._match_pattern);if(t===" ")this.whitespace_before_token=" ";else if(t){var r=this.__split(this._newline_regexp,t);this.newline_count=r.length-1,this.whitespace_before_token=r[this.newline_count]}return t},n.prototype.matching=function(t,r){var i=this._create();return i.__set_whitespace_patterns(t,r),i._update(),i},n.prototype._create=function(){return new n(this._input,this)},n.prototype.__split=function(t,r){t.lastIndex=0;for(var i=0,a=[],v=t.exec(r);v;)a.push(r.substring(i,v.index)),i=v.index+v[0].length,v=t.exec(r);return i<r.length?a.push(r.substring(i,r.length)):a.push(""),a},b.exports.WhitespacePattern=n},function(b){function e(E,s){this._input=E,this._starting_pattern=null,this._match_pattern=null,this._until_pattern=null,this._until_after=!1,s&&(this._starting_pattern=this._input.get_regexp(s._starting_pattern,!0),this._match_pattern=this._input.get_regexp(s._match_pattern,!0),this._until_pattern=this._input.get_regexp(s._until_pattern),this._until_after=s._until_after)}e.prototype.read=function(){var E=this._input.read(this._starting_pattern);return(!this._starting_pattern||E)&&(E+=this._input.read(this._match_pattern,this._until_pattern,this._until_after)),E},e.prototype.read_match=function(){return this._input.match(this._match_pattern)},e.prototype.until_after=function(E){var s=this._create();return s._until_after=!0,s._until_pattern=this._input.get_regexp(E),s._update(),s},e.prototype.until=function(E){var s=this._create();return s._until_after=!1,s._until_pattern=this._input.get_regexp(E),s._update(),s},e.prototype.starting_with=function(E){var s=this._create();return s._starting_pattern=this._input.get_regexp(E,!0),s._update(),s},e.prototype.matching=function(E){var s=this._create();return s._match_pattern=this._input.get_regexp(E,!0),s._update(),s},e.prototype._create=function(){return new e(this._input,this)},e.prototype._update=function(){},b.exports.Pattern=e},function(b){function e(E,s){E=typeof E=="string"?E:E.source,s=typeof s=="string"?s:s.source,this.__directives_block_pattern=new RegExp(E+/ beautify( \w+[:]\w+)+ /.source+s,"g"),this.__directive_pattern=/ (\w+)[:](\w+)/g,this.__directives_end_ignore_pattern=new RegExp(E+/\sbeautify\signore:end\s/.source+s,"g")}e.prototype.get_directives=function(E){if(!E.match(this.__directives_block_pattern))return null;var s={};this.__directive_pattern.lastIndex=0;for(var n=this.__directive_pattern.exec(E);n;)s[n[1]]=n[2],n=this.__directive_pattern.exec(E);return s},e.prototype.readIgnored=function(E){return E.readUntilAfter(this.__directives_end_ignore_pattern)},b.exports.Directives=e},function(b,e,E){var s=E(12).Pattern,n={django:!1,erb:!1,handlebars:!1,php:!1,smarty:!1};function t(r,i){s.call(this,r,i),this.__template_pattern=null,this._disabled=Object.assign({},n),this._excluded=Object.assign({},n),i&&(this.__template_pattern=this._input.get_regexp(i.__template_pattern),this._excluded=Object.assign(this._excluded,i._excluded),this._disabled=Object.assign(this._disabled,i._disabled));var a=new s(r);this.__patterns={handlebars_comment:a.starting_with(/{{!--/).until_after(/--}}/),handlebars_unescaped:a.starting_with(/{{{/).until_after(/}}}/),handlebars:a.starting_with(/{{/).until_after(/}}/),php:a.starting_with(/<\?(?:[= ]|php)/).until_after(/\?>/),erb:a.starting_with(/<%[^%]/).until_after(/[^%]%>/),django:a.starting_with(/{%/).until_after(/%}/),django_value:a.starting_with(/{{/).until_after(/}}/),django_comment:a.starting_with(/{#/).until_after(/#}/),smarty:a.starting_with(/{(?=[^}{\s\n])/).until_after(/[^\s\n]}/),smarty_comment:a.starting_with(/{\*/).until_after(/\*}/),smarty_literal:a.starting_with(/{literal}/).until_after(/{\/literal}/)}}t.prototype=new s,t.prototype._create=function(){return new t(this._input,this)},t.prototype._update=function(){this.__set_templated_pattern()},t.prototype.disable=function(r){var i=this._create();return i._disabled[r]=!0,i._update(),i},t.prototype.read_options=function(r){var i=this._create();for(var a in n)i._disabled[a]=r.templating.indexOf(a)===-1;return i._update(),i},t.prototype.exclude=function(r){var i=this._create();return i._excluded[r]=!0,i._update(),i},t.prototype.read=function(){var r="";this._match_pattern?r=this._input.read(this._starting_pattern):r=this._input.read(this._starting_pattern,this.__template_pattern);for(var i=this._read_template();i;)this._match_pattern?i+=this._input.read(this._match_pattern):i+=this._input.readUntil(this.__template_pattern),r+=i,i=this._read_template();return this._until_after&&(r+=this._input.readUntilAfter(this._until_pattern)),r},t.prototype.__set_templated_pattern=function(){var r=[];this._disabled.php||r.push(this.__patterns.php._starting_pattern.source),this._disabled.handlebars||r.push(this.__patterns.handlebars._starting_pattern.source),this._disabled.erb||r.push(this.__patterns.erb._starting_pattern.source),this._disabled.django||(r.push(this.__patterns.django._starting_pattern.source),r.push(this.__patterns.django_value._starting_pattern.source),r.push(this.__patterns.django_comment._starting_pattern.source)),this._disabled.smarty||r.push(this.__patterns.smarty._starting_pattern.source),this._until_pattern&&r.push(this._until_pattern.source),this.__template_pattern=this._input.get_regexp("(?:"+r.join("|")+")")},t.prototype._read_template=function(){var r="",i=this._input.peek();if(i==="<"){var a=this._input.peek(1);!this._disabled.php&&!this._excluded.php&&a==="?"&&(r=r||this.__patterns.php.read()),!this._disabled.erb&&!this._excluded.erb&&a==="%"&&(r=r||this.__patterns.erb.read())}else i==="{"&&(!this._disabled.handlebars&&!this._excluded.handlebars&&(r=r||this.__patterns.handlebars_comment.read(),r=r||this.__patterns.handlebars_unescaped.read(),r=r||this.__patterns.handlebars.read()),this._disabled.django||(!this._excluded.django&&!this._excluded.handlebars&&(r=r||this.__patterns.django_value.read()),this._excluded.django||(r=r||this.__patterns.django_comment.read(),r=r||this.__patterns.django.read())),this._disabled.smarty||this._disabled.django&&this._disabled.handlebars&&(r=r||this.__patterns.smarty_comment.read(),r=r||this.__patterns.smarty_literal.read(),r=r||this.__patterns.smarty.read()));return r},b.exports.TemplatablePattern=t}],S={};function P(b){var e=S[b];if(e!==void 0)return e.exports;var E=S[b]={exports:{}};return k[b](E,E.exports,P),E.exports}var T=P(0);B=T})();var U=B;M=[],N=function(){return{js_beautify:U}}.apply(re,M),N!==void 0&&(Ge.exports=N)})()},47084:function(Ge){(function(re,M){Ge.exports=M()})(this,function(){"use strict";function re(se,ie){for(var le=0;le<ie.length;le++){var V=ie[le];V.enumerable=V.enumerable||!1,V.configurable=!0,"value"in V&&(V.writable=!0),Object.defineProperty(se,V.key,V)}}function M(se,ie,le){return ie&&re(se.prototype,ie),le&&re(se,le),se}function N(se,ie){if(se){if(typeof se=="string")return B(se,ie);var le=Object.prototype.toString.call(se).slice(8,-1);if(le==="Object"&&se.constructor&&(le=se.constructor.name),le==="Map"||le==="Set")return Array.from(se);if(le==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(le))return B(se,ie)}}function B(se,ie){(ie==null||ie>se.length)&&(ie=se.length);for(var le=0,V=new Array(ie);le<ie;le++)V[le]=se[le];return V}function U(se,ie){var le=typeof Symbol!="undefined"&&se[Symbol.iterator]||se["@@iterator"];if(le)return(le=le.call(se)).next.bind(le);if(Array.isArray(se)||(le=N(se))||ie&&se&&typeof se.length=="number"){le&&(se=le);var V=0;return function(){return V>=se.length?{done:!0}:{done:!1,value:se[V++]}}}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 k={exports:{}};function S(){return{baseUrl:null,breaks:!1,extensions:null,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 P(se){k.exports.defaults=se}k.exports={defaults:S(),getDefaults:S,changeDefaults:P};var T=/[&<>"']/,b=/[&<>"']/g,e=/[<>"']|&(?!#?\w+;)/,E=/[<>"']|&(?!#?\w+;)/g,s={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},n=function(ie){return s[ie]};function t(se,ie){if(ie){if(T.test(se))return se.replace(b,n)}else if(e.test(se))return se.replace(E,n);return se}var r=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function i(se){return se.replace(r,function(ie,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 a=/(^|[^\[])\^/g;function v(se,ie){se=se.source||se,ie=ie||"";var le={replace:function(J,q){return q=q.source||q,q=q.replace(a,"$1"),se=se.replace(J,q),le},getRegex:function(){return new RegExp(se,ie)}};return le}var p=/[^\w:]/g,l=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function o(se,ie,le){if(se){var V;try{V=decodeURIComponent(i(le)).replace(p,"").toLowerCase()}catch(J){return null}if(V.indexOf("javascript:")===0||V.indexOf("vbscript:")===0||V.indexOf("data:")===0)return null}ie&&!l.test(le)&&(le=f(ie,le));try{le=encodeURI(le).replace(/%25/g,"%")}catch(J){return null}return le}var u={},c=/^[^:]+:\/*[^/]*$/,_=/^([^:]+:)[\s\S]*$/,y=/^([^:]+:\/*[^/]*)[\s\S]*$/;function f(se,ie){u[" "+se]||(c.test(se)?u[" "+se]=se+"/":u[" "+se]=O(se,"/",!0)),se=u[" "+se];var le=se.indexOf(":")===-1;return ie.substring(0,2)==="//"?le?ie:se.replace(_,"$1")+ie:ie.charAt(0)==="/"?le?ie:se.replace(y,"$1")+ie:se+ie}var C={exec:function(){}};function L(se){for(var ie=1,le,V;ie<arguments.length;ie++){le=arguments[ie];for(V in le)Object.prototype.hasOwnProperty.call(le,V)&&(se[V]=le[V])}return se}function R(se,ie){var le=se.replace(/\|/g,function(q,fe,ne){for(var ve=!1,Ce=fe;--Ce>=0&&ne[Ce]==="\\";)ve=!ve;return ve?"|":" |"}),V=le.split(/ \|/),J=0;if(V.length>ie)V.splice(ie);else for(;V.length<ie;)V.push("");for(;J<V.length;J++)V[J]=V[J].trim().replace(/\\\|/g,"|");return V}function O(se,ie,le){var V=se.length;if(V===0)return"";for(var J=0;J<V;){var q=se.charAt(V-J-1);if(q===ie&&!le)J++;else if(q!==ie&&le)J++;else break}return se.substr(0,V-J)}function g(se,ie){if(se.indexOf(ie[1])===-1)return-1;for(var le=se.length,V=0,J=0;J<le;J++)if(se[J]==="\\")J++;else if(se[J]===ie[0])V++;else if(se[J]===ie[1]&&(V--,V<0))return J;return-1}function m(se){se&&se.sanitize&&!se.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")}function d(se,ie){if(ie<1)return"";for(var le="";ie>1;)ie&1&&(le+=se),ie>>=1,se+=se;return le+se}var h={escape:t,unescape:i,edit:v,cleanUrl:o,resolveUrl:f,noopTest:C,merge:L,splitCells:R,rtrim:O,findClosingBracket:g,checkSanitizeDeprecation:m,repeatString:d},A=k.exports.defaults,w=h.rtrim,x=h.splitCells,D=h.escape,I=h.findClosingBracket;function F(se,ie,le){var V=ie.href,J=ie.title?D(ie.title):null,q=se[1].replace(/\\([\[\]])/g,"$1");return se[0].charAt(0)!=="!"?{type:"link",raw:le,href:V,title:J,text:q}:{type:"image",raw:le,href:V,title:J,text:D(q)}}function K(se,ie){var le=se.match(/^(\s+)(?:```)/);if(le===null)return ie;var V=le[1];return ie.split(`
`).map(function(J){var q=J.match(/^\s+/);if(q===null)return J;var fe=q[0];return fe.length>=V.length?J.slice(V.length):J}).join(`
`)}var W=function(){function se(le){this.options=le||A}var ie=se.prototype;return ie.space=function(V){var J=this.rules.block.newline.exec(V);if(J)return J[0].length>1?{type:"space",raw:J[0]}:{raw:`
`}},ie.code=function(V){var J=this.rules.block.code.exec(V);if(J){var q=J[0].replace(/^ {1,4}/gm,"");return{type:"code",raw:J[0],codeBlockStyle:"indented",text:this.options.pedantic?q:w(q,`
`)}}},ie.fences=function(V){var J=this.rules.block.fences.exec(V);if(J){var q=J[0],fe=K(q,J[3]||"");return{type:"code",raw:q,lang:J[2]?J[2].trim():J[2],text:fe}}},ie.heading=function(V){var J=this.rules.block.heading.exec(V);if(J){var q=J[2].trim();if(/#$/.test(q)){var fe=w(q,"#");(this.options.pedantic||!fe||/ $/.test(fe))&&(q=fe.trim())}return{type:"heading",raw:J[0],depth:J[1].length,text:q}}},ie.nptable=function(V){var J=this.rules.block.nptable.exec(V);if(J){var q={type:"table",header:x(J[1].replace(/^ *| *\| *$/g,"")),align:J[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:J[3]?J[3].replace(/\n$/,"").split(`
`):[],raw:J[0]};if(q.header.length===q.align.length){var fe=q.align.length,ne;for(ne=0;ne<fe;ne++)/^ *-+: *$/.test(q.align[ne])?q.align[ne]="right":/^ *:-+: *$/.test(q.align[ne])?q.align[ne]="center":/^ *:-+ *$/.test(q.align[ne])?q.align[ne]="left":q.align[ne]=null;for(fe=q.cells.length,ne=0;ne<fe;ne++)q.cells[ne]=x(q.cells[ne],q.header.length);return q}}},ie.hr=function(V){var J=this.rules.block.hr.exec(V);if(J)return{type:"hr",raw:J[0]}},ie.blockquote=function(V){var J=this.rules.block.blockquote.exec(V);if(J){var q=J[0].replace(/^ *> ?/gm,"");return{type:"blockquote",raw:J[0],text:q}}},ie.list=function(V){var J=this.rules.block.list.exec(V);if(J){var q=J[0],fe=J[2],ne=fe.length>1,ve={type:"list",raw:q,ordered:ne,start:ne?+fe.slice(0,-1):"",loose:!1,items:[]},Ce=J[0].match(this.rules.block.item),Ue=!1,We,nt,et,Je,$e,ft,at,ot,_t,Me=Ce.length;et=this.rules.block.listItemStart.exec(Ce[0]);for(var Ne=0;Ne<Me;Ne++){if(We=Ce[Ne],q=We,this.options.pedantic||(_t=We.match(new RegExp("\\n\\s*\\n {0,"+(et[0].length-1)+"}\\S")),_t&&($e=We.length-_t.index+Ce.slice(Ne+1).join(`
`).length,ve.raw=ve.raw.substring(0,ve.raw.length-$e),We=We.substring(0,_t.index),q=We,Me=Ne+1)),Ne!==Me-1){if(Je=this.rules.block.listItemStart.exec(Ce[Ne+1]),this.options.pedantic?Je[1].length>et[1].length:Je[1].length>=et[0].length||Je[1].length>3){Ce.splice(Ne,2,Ce[Ne]+(!this.options.pedantic&&Je[1].length<et[0].length&&!Ce[Ne].match(/\n$/)?"":`
`)+Ce[Ne+1]),Ne--,Me--;continue}else(!this.options.pedantic||this.options.smartLists?Je[2][Je[2].length-1]!==fe[fe.length-1]:ne===(Je[2].length===1))&&($e=Ce.slice(Ne+1).join(`
`).length,ve.raw=ve.raw.substring(0,ve.raw.length-$e),Ne=Me-1);et=Je}nt=We.length,We=We.replace(/^ *([*+-]|\d+[.)]) ?/,""),~We.indexOf(`
`)&&(nt-=We.length,We=this.options.pedantic?We.replace(/^ {1,4}/gm,""):We.replace(new RegExp("^ {1,"+nt+"}","gm"),"")),We=w(We,`
`),Ne!==Me-1&&(q=q+`
`),ft=Ue||/\n\n(?!\s*$)/.test(q),Ne!==Me-1&&(Ue=q.slice(-2)===`
`,ft||(ft=Ue)),ft&&(ve.loose=!0),this.options.gfm&&(at=/^\[[ xX]\] /.test(We),ot=void 0,at&&(ot=We[1]!==" ",We=We.replace(/^\[[ xX]\] +/,""))),ve.items.push({type:"list_item",raw:q,task:at,checked:ot,loose:ft,text:We})}return ve}},ie.html=function(V){var J=this.rules.block.html.exec(V);if(J)return{type:this.options.sanitize?"paragraph":"html",raw:J[0],pre:!this.options.sanitizer&&(J[1]==="pre"||J[1]==="script"||J[1]==="style"),text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(J[0]):D(J[0]):J[0]}},ie.def=function(V){var J=this.rules.block.def.exec(V);if(J){J[3]&&(J[3]=J[3].substring(1,J[3].length-1));var q=J[1].toLowerCase().replace(/\s+/g," ");return{type:"def",tag:q,raw:J[0],href:J[2],title:J[3]}}},ie.table=function(V){var J=this.rules.block.table.exec(V);if(J){var q={type:"table",header:x(J[1].replace(/^ *| *\| *$/g,"")),align:J[2].replace(/^ *|\| *$/g,"").split(/ *\| */),cells:J[3]?J[3].replace(/\n$/,"").split(`
`):[]};if(q.header.length===q.align.length){q.raw=J[0];var fe=q.align.length,ne;for(ne=0;ne<fe;ne++)/^ *-+: *$/.test(q.align[ne])?q.align[ne]="right":/^ *:-+: *$/.test(q.align[ne])?q.align[ne]="center":/^ *:-+ *$/.test(q.align[ne])?q.align[ne]="left":q.align[ne]=null;for(fe=q.cells.length,ne=0;ne<fe;ne++)q.cells[ne]=x(q.cells[ne].replace(/^ *\| *| *\| *$/g,""),q.header.length);return q}}},ie.lheading=function(V){var J=this.rules.block.lheading.exec(V);if(J)return{type:"heading",raw:J[0],depth:J[2].charAt(0)==="="?1:2,text:J[1]}},ie.paragraph=function(V){var J=this.rules.block.paragraph.exec(V);if(J)return{type:"paragraph",raw:J[0],text:J[1].charAt(J[1].length-1)===`
`?J[1].slice(0,-1):J[1]}},ie.text=function(V){var J=this.rules.block.text.exec(V);if(J)return{type:"text",raw:J[0],text:J[0]}},ie.escape=function(V){var J=this.rules.inline.escape.exec(V);if(J)return{type:"escape",raw:J[0],text:D(J[1])}},ie.tag=function(V,J,q){var fe=this.rules.inline.tag.exec(V);if(fe)return!J&&/^<a /i.test(fe[0])?J=!0:J&&/^<\/a>/i.test(fe[0])&&(J=!1),!q&&/^<(pre|code|kbd|script)(\s|>)/i.test(fe[0])?q=!0:q&&/^<\/(pre|code|kbd|script)(\s|>)/i.test(fe[0])&&(q=!1),{type:this.options.sanitize?"text":"html",raw:fe[0],inLink:J,inRawBlock:q,text:this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):D(fe[0]):fe[0]}},ie.link=function(V){var J=this.rules.inline.link.exec(V);if(J){var q=J[2].trim();if(!this.options.pedantic&&/^</.test(q)){if(!/>$/.test(q))return;var fe=w(q.slice(0,-1),"\\");if((q.length-fe.length)%2===0)return}else{var ne=I(J[2],"()");if(ne>-1){var ve=J[0].indexOf("!")===0?5:4,Ce=ve+J[1].length+ne;J[2]=J[2].substring(0,ne),J[0]=J[0].substring(0,Ce).trim(),J[3]=""}}var Ue=J[2],We="";if(this.options.pedantic){var nt=/^([^'"]*[^\s])\s+(['"])(.*)\2/.exec(Ue);nt&&(Ue=nt[1],We=nt[3])}else We=J[3]?J[3].slice(1,-1):"";return Ue=Ue.trim(),/^</.test(Ue)&&(this.options.pedantic&&!/>$/.test(q)?Ue=Ue.slice(1):Ue=Ue.slice(1,-1)),F(J,{href:Ue&&Ue.replace(this.rules.inline._escapes,"$1"),title:We&&We.replace(this.rules.inline._escapes,"$1")},J[0])}},ie.reflink=function(V,J){var q;if((q=this.rules.inline.reflink.exec(V))||(q=this.rules.inline.nolink.exec(V))){var fe=(q[2]||q[1]).replace(/\s+/g," ");if(fe=J[fe.toLowerCase()],!fe||!fe.href){var ne=q[0].charAt(0);return{type:"text",raw:ne,text:ne}}return F(q,fe,q[0])}},ie.emStrong=function(V,J,q){q===void 0&&(q="");var fe=this.rules.inline.emStrong.lDelim.exec(V);if(fe&&!(fe[3]&&q.match(/(?:[0-9A-Za-z\xAA\xB2\xB3\xB5\xB9\xBA\xBC-\xBE\xC0-\xD6\xD8-\xF6\xF8-\u02C1\u02C6-\u02D1\u02E0-\u02E4\u02EC\u02EE\u0370-\u0374\u0376\u0377\u037A-\u037D\u037F\u0386\u0388-\u038A\u038C\u038E-\u03A1\u03A3-\u03F5\u03F7-\u0481\u048A-\u052F\u0531-\u0556\u0559\u0560-\u0588\u05D0-\u05EA\u05EF-\u05F2\u0620-\u064A\u0660-\u0669\u066E\u066F\u0671-\u06D3\u06D5\u06E5\u06E6\u06EE-\u06FC\u06FF\u0710\u0712-\u072F\u074D-\u07A5\u07B1\u07C0-\u07EA\u07F4\u07F5\u07FA\u0800-\u0815\u081A\u0824\u0828\u0840-\u0858\u0860-\u086A\u08A0-\u08B4\u08B6-\u08C7\u0904-\u0939\u093D\u0950\u0958-\u0961\u0966-\u096F\u0971-\u0980\u0985-\u098C\u098F\u0990\u0993-\u09A8\u09AA-\u09B0\u09B2\u09B6-\u09B9\u09BD\u09CE\u09DC\u09DD\u09DF-\u09E1\u09E6-\u09F1\u09F4-\u09F9\u09FC\u0A05-\u0A0A\u0A0F\u0A10\u0A13-\u0A28\u0A2A-\u0A30\u0A32\u0A33\u0A35\u0A36\u0A38\u0A39\u0A59-\u0A5C\u0A5E\u0A66-\u0A6F\u0A72-\u0A74\u0A85-\u0A8D\u0A8F-\u0A91\u0A93-\u0AA8\u0AAA-\u0AB0\u0AB2\u0AB3\u0AB5-\u0AB9\u0ABD\u0AD0\u0AE0\u0AE1\u0AE6-\u0AEF\u0AF9\u0B05-\u0B0C\u0B0F\u0B10\u0B13-\u0B28\u0B2A-\u0B30\u0B32\u0B33\u0B35-\u0B39\u0B3D\u0B5C\u0B5D\u0B5F-\u0B61\u0B66-\u0B6F\u0B71-\u0B77\u0B83\u0B85-\u0B8A\u0B8E-\u0B90\u0B92-\u0B95\u0B99\u0B9A\u0B9C\u0B9E\u0B9F\u0BA3\u0BA4\u0BA8-\u0BAA\u0BAE-\u0BB9\u0BD0\u0BE6-\u0BF2\u0C05-\u0C0C\u0C0E-\u0C10\u0C12-\u0C28\u0C2A-\u0C39\u0C3D\u0C58-\u0C5A\u0C60\u0C61\u0C66-\u0C6F\u0C78-\u0C7E\u0C80\u0C85-\u0C8C\u0C8E-\u0C90\u0C92-\u0CA8\u0CAA-\u0CB3\u0CB5-\u0CB9\u0CBD\u0CDE\u0CE0\u0CE1\u0CE6-\u0CEF\u0CF1\u0CF2\u0D04-\u0D0C\u0D0E-\u0D10\u0D12-\u0D3A\u0D3D\u0D4E\u0D54-\u0D56\u0D58-\u0D61\u0D66-\u0D78\u0D7A-\u0D7F\u0D85-\u0D96\u0D9A-\u0DB1\u0DB3-\u0DBB\u0DBD\u0DC0-\u0DC6\u0DE6-\u0DEF\u0E01-\u0E30\u0E32\u0E33\u0E40-\u0E46\u0E50-\u0E59\u0E81\u0E82\u0E84\u0E86-\u0E8A\u0E8C-\u0EA3\u0EA5\u0EA7-\u0EB0\u0EB2\u0EB3\u0EBD\u0EC0-\u0EC4\u0EC6\u0ED0-\u0ED9\u0EDC-\u0EDF\u0F00\u0F20-\u0F33\u0F40-\u0F47\u0F49-\u0F6C\u0F88-\u0F8C\u1000-\u102A\u103F-\u1049\u1050-\u1055\u105A-\u105D\u1061\u1065\u1066\u106E-\u1070\u1075-\u1081\u108E\u1090-\u1099\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\u1369-\u137C\u1380-\u138F\u13A0-\u13F5\u13F8-\u13FD\u1401-\u166C\u166F-\u167F\u1681-\u169A\u16A0-\u16EA\u16EE-\u16F8\u1700-\u170C\u170E-\u1711\u1720-\u1731\u1740-\u1751\u1760-\u176C\u176E-\u1770\u1780-\u17B3\u17D7\u17DC\u17E0-\u17E9\u17F0-\u17F9\u1810-\u1819\u1820-\u1878\u1880-\u1884\u1887-\u18A8\u18AA\u18B0-\u18F5\u1900-\u191E\u1946-\u196D\u1970-\u1974\u1980-\u19AB\u19B0-\u19C9\u19D0-\u19DA\u1A00-\u1A16\u1A20-\u1A54\u1A80-\u1A89\u1A90-\u1A99\u1AA7\u1B05-\u1B33\u1B45-\u1B4B\u1B50-\u1B59\u1B83-\u1BA0\u1BAE-\u1BE5\u1C00-\u1C23\u1C40-\u1C49\u1C4D-\u1C7D\u1C80-\u1C88\u1C90-\u1CBA\u1CBD-\u1CBF\u1CE9-\u1CEC\u1CEE-\u1CF3\u1CF5\u1CF6\u1CFA\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\u2070\u2071\u2074-\u2079\u207F-\u2089\u2090-\u209C\u2102\u2107\u210A-\u2113\u2115\u2119-\u211D\u2124\u2126\u2128\u212A-\u212D\u212F-\u2139\u213C-\u213F\u2145-\u2149\u214E\u2150-\u2189\u2460-\u249B\u24EA-\u24FF\u2776-\u2793\u2C00-\u2C2E\u2C30-\u2C5E\u2C60-\u2CE4\u2CEB-\u2CEE\u2CF2\u2CF3\u2CFD\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-\u312F\u3131-\u318E\u3192-\u3195\u31A0-\u31BF\u31F0-\u31FF\u3220-\u3229\u3248-\u324F\u3251-\u325F\u3280-\u3289\u32B1-\u32BF\u3400-\u4DBF\u4E00-\u9FFC\uA000-\uA48C\uA4D0-\uA4FD\uA500-\uA60C\uA610-\uA62B\uA640-\uA66E\uA67F-\uA69D\uA6A0-\uA6EF\uA717-\uA71F\uA722-\uA788\uA78B-\uA7BF\uA7C2-\uA7CA\uA7F5-\uA801\uA803-\uA805\uA807-\uA80A\uA80C-\uA822\uA830-\uA835\uA840-\uA873\uA882-\uA8B3\uA8D0-\uA8D9\uA8F2-\uA8F7\uA8FB\uA8FD\uA8FE\uA900-\uA925\uA930-\uA946\uA960-\uA97C\uA984-\uA9B2\uA9CF-\uA9D9\uA9E0-\uA9E4\uA9E6-\uA9FE\uAA00-\uAA28\uAA40-\uAA42\uAA44-\uAA4B\uAA50-\uAA59\uAA60-\uAA76\uAA7A\uAA7E-\uAAAF\uAAB1\uAAB5\uAAB6\uAAB9-\uAABD\uAAC0\uAAC2\uAADB-\uAADD\uAAE0-\uAAEA\uAAF2-\uAAF4\uAB01-\uAB06\uAB09-\uAB0E\uAB11-\uAB16\uAB20-\uAB26\uAB28-\uAB2E\uAB30-\uAB5A\uAB5C-\uAB69\uAB70-\uABE2\uABF0-\uABF9\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\uFF10-\uFF19\uFF21-\uFF3A\uFF41-\uFF5A\uFF66-\uFFBE\uFFC2-\uFFC7\uFFCA-\uFFCF\uFFD2-\uFFD7\uFFDA-\uFFDC]|\uD800[\uDC00-\uDC0B\uDC0D-\uDC26\uDC28-\uDC3A\uDC3C\uDC3D\uDC3F-\uDC4D\uDC50-\uDC5D\uDC80-\uDCFA\uDD07-\uDD33\uDD40-\uDD78\uDD8A\uDD8B\uDE80-\uDE9C\uDEA0-\uDED0\uDEE1-\uDEFB\uDF00-\uDF23\uDF2D-\uDF4A\uDF50-\uDF75\uDF80-\uDF9D\uDFA0-\uDFC3\uDFC8-\uDFCF\uDFD1-\uDFD5]|\uD801[\uDC00-\uDC9D\uDCA0-\uDCA9\uDCB0-\uDCD3\uDCD8-\uDCFB\uDD00-\uDD27\uDD30-\uDD63\uDE00-\uDF36\uDF40-\uDF55\uDF60-\uDF67]|\uD802[\uDC00-\uDC05\uDC08\uDC0A-\uDC35\uDC37\uDC38\uDC3C\uDC3F-\uDC55\uDC58-\uDC76\uDC79-\uDC9E\uDCA7-\uDCAF\uDCE0-\uDCF2\uDCF4\uDCF5\uDCFB-\uDD1B\uDD20-\uDD39\uDD80-\uDDB7\uDDBC-\uDDCF\uDDD2-\uDE00\uDE10-\uDE13\uDE15-\uDE17\uDE19-\uDE35\uDE40-\uDE48\uDE60-\uDE7E\uDE80-\uDE9F\uDEC0-\uDEC7\uDEC9-\uDEE4\uDEEB-\uDEEF\uDF00-\uDF35\uDF40-\uDF55\uDF58-\uDF72\uDF78-\uDF91\uDFA9-\uDFAF]|\uD803[\uDC00-\uDC48\uDC80-\uDCB2\uDCC0-\uDCF2\uDCFA-\uDD23\uDD30-\uDD39\uDE60-\uDE7E\uDE80-\uDEA9\uDEB0\uDEB1\uDF00-\uDF27\uDF30-\uDF45\uDF51-\uDF54\uDFB0-\uDFCB\uDFE0-\uDFF6]|\uD804[\uDC03-\uDC37\uDC52-\uDC6F\uDC83-\uDCAF\uDCD0-\uDCE8\uDCF0-\uDCF9\uDD03-\uDD26\uDD36-\uDD3F\uDD44\uDD47\uDD50-\uDD72\uDD76\uDD83-\uDDB2\uDDC1-\uDDC4\uDDD0-\uDDDA\uDDDC\uDDE1-\uDDF4\uDE00-\uDE11\uDE13-\uDE2B\uDE80-\uDE86\uDE88\uDE8A-\uDE8D\uDE8F-\uDE9D\uDE9F-\uDEA8\uDEB0-\uDEDE\uDEF0-\uDEF9\uDF05-\uDF0C\uDF0F\uDF10\uDF13-\uDF28\uDF2A-\uDF30\uDF32\uDF33\uDF35-\uDF39\uDF3D\uDF50\uDF5D-\uDF61]|\uD805[\uDC00-\uDC34\uDC47-\uDC4A\uDC50-\uDC59\uDC5F-\uDC61\uDC80-\uDCAF\uDCC4\uDCC5\uDCC7\uDCD0-\uDCD9\uDD80-\uDDAE\uDDD8-\uDDDB\uDE00-\uDE2F\uDE44\uDE50-\uDE59\uDE80-\uDEAA\uDEB8\uDEC0-\uDEC9\uDF00-\uDF1A\uDF30-\uDF3B]|\uD806[\uDC00-\uDC2B\uDCA0-\uDCF2\uDCFF-\uDD06\uDD09\uDD0C-\uDD13\uDD15\uDD16\uDD18-\uDD2F\uDD3F\uDD41\uDD50-\uDD59\uDDA0-\uDDA7\uDDAA-\uDDD0\uDDE1\uDDE3\uDE00\uDE0B-\uDE32\uDE3A\uDE50\uDE5C-\uDE89\uDE9D\uDEC0-\uDEF8]|\uD807[\uDC00-\uDC08\uDC0A-\uDC2E\uDC40\uDC50-\uDC6C\uDC72-\uDC8F\uDD00-\uDD06\uDD08\uDD09\uDD0B-\uDD30\uDD46\uDD50-\uDD59\uDD60-\uDD65\uDD67\uDD68\uDD6A-\uDD89\uDD98\uDDA0-\uDDA9\uDEE0-\uDEF2\uDFB0\uDFC0-\uDFD4]|\uD808[\uDC00-\uDF99]|\uD809[\uDC00-\uDC6E\uDC80-\uDD43]|[\uD80C\uD81C-\uD820\uD822\uD840-\uD868\uD86A-\uD86C\uD86F-\uD872\uD874-\uD879\uD880-\uD883][\uDC00-\uDFFF]|\uD80D[\uDC00-\uDC2E]|\uD811[\uDC00-\uDE46]|\uD81A[\uDC00-\uDE38\uDE40-\uDE5E\uDE60-\uDE69\uDED0-\uDEED\uDF00-\uDF2F\uDF40-\uDF43\uDF50-\uDF59\uDF5B-\uDF61\uDF63-\uDF77\uDF7D-\uDF8F]|\uD81B[\uDE40-\uDE96\uDF00-\uDF4A\uDF50\uDF93-\uDF9F\uDFE0\uDFE1\uDFE3]|\uD821[\uDC00-\uDFF7]|\uD823[\uDC00-\uDCD5\uDD00-\uDD08]|\uD82C[\uDC00-\uDD1E\uDD50-\uDD52\uDD64-\uDD67\uDD70-\uDEFB]|\uD82F[\uDC00-\uDC6A\uDC70-\uDC7C\uDC80-\uDC88\uDC90-\uDC99]|\uD834[\uDEE0-\uDEF3\uDF60-\uDF78]|\uD835[\uDC00-\uDC54\uDC56-\uDC9C\uDC9E\uDC9F\uDCA2\uDCA5\uDCA6\uDCA9-\uDCAC\uDCAE-\uDCB9\uDCBB\uDCBD-\uDCC3\uDCC5-\uDD05\uDD07-\uDD0A\uDD0D-\uDD14\uDD16-\uDD1C\uDD1E-\uDD39\uDD3B-\uDD3E\uDD40-\uDD44\uDD46\uDD4A-\uDD50\uDD52-\uDEA5\uDEA8-\uDEC0\uDEC2-\uDEDA\uDEDC-\uDEFA\uDEFC-\uDF14\uDF16-\uDF34\uDF36-\uDF4E\uDF50-\uDF6E\uDF70-\uDF88\uDF8A-\uDFA8\uDFAA-\uDFC2\uDFC4-\uDFCB\uDFCE-\uDFFF]|\uD838[\uDD00-\uDD2C\uDD37-\uDD3D\uDD40-\uDD49\uDD4E\uDEC0-\uDEEB\uDEF0-\uDEF9]|\uD83A[\uDC00-\uDCC4\uDCC7-\uDCCF\uDD00-\uDD43\uDD4B\uDD50-\uDD59]|\uD83B[\uDC71-\uDCAB\uDCAD-\uDCAF\uDCB1-\uDCB4\uDD01-\uDD2D\uDD2F-\uDD3D\uDE00-\uDE03\uDE05-\uDE1F\uDE21\uDE22\uDE24\uDE27\uDE29-\uDE32\uDE34-\uDE37\uDE39\uDE3B\uDE42\uDE47\uDE49\uDE4B\uDE4D-\uDE4F\uDE51\uDE52\uDE54\uDE57\uDE59\uDE5B\uDE5D\uDE5F\uDE61\uDE62\uDE64\uDE67-\uDE6A\uDE6C-\uDE72\uDE74-\uDE77\uDE79-\uDE7C\uDE7E\uDE80-\uDE89\uDE8B-\uDE9B\uDEA1-\uDEA3\uDEA5-\uDEA9\uDEAB-\uDEBB]|\uD83C[\uDD00-\uDD0C]|\uD83E[\uDFF0-\uDFF9]|\uD869[\uDC00-\uDEDD\uDF00-\uDFFF]|\uD86D[\uDC00-\uDF34\uDF40-\uDFFF]|\uD86E[\uDC00-\uDC1D\uDC20-\uDFFF]|\uD873[\uDC00-\uDEA1\uDEB0-\uDFFF]|\uD87A[\uDC00-\uDFE0]|\uD87E[\uDC00-\uDE1D]|\uD884[\uDC00-\uDF4A])/))){var ne=fe[1]||fe[2]||"";if(!ne||ne&&(q===""||this.rules.inline.punctuation.exec(q))){var ve=fe[0].length-1,Ce,Ue,We=ve,nt=0,et=fe[0][0]==="*"?this.rules.inline.emStrong.rDelimAst:this.rules.inline.emStrong.rDelimUnd;for(et.lastIndex=0,J=J.slice(-1*V.length+ve);(fe=et.exec(J))!=null;)if(Ce=fe[1]||fe[2]||fe[3]||fe[4]||fe[5]||fe[6],!!Ce){if(Ue=Ce.length,fe[3]||fe[4]){We+=Ue;continue}else if((fe[5]||fe[6])&&ve%3&&!((ve+Ue)%3)){nt+=Ue;continue}if(We-=Ue,!(We>0))return Ue=Math.min(Ue,Ue+We+nt),Math.min(ve,Ue)%2?{type:"em",raw:V.slice(0,ve+fe.index+Ue+1),text:V.slice(1,ve+fe.index+Ue)}:{type:"strong",raw:V.slice(0,ve+fe.index+Ue+1),text:V.slice(2,ve+fe.index+Ue-1)}}}}},ie.codespan=function(V){var J=this.rules.inline.code.exec(V);if(J){var q=J[2].replace(/\n/g," "),fe=/[^ ]/.test(q),ne=/^ /.test(q)&&/ $/.test(q);return fe&&ne&&(q=q.substring(1,q.length-1)),q=D(q,!0),{type:"codespan",raw:J[0],text:q}}},ie.br=function(V){var J=this.rules.inline.br.exec(V);if(J)return{type:"br",raw:J[0]}},ie.del=function(V){var J=this.rules.inline.del.exec(V);if(J)return{type:"del",raw:J[0],text:J[2]}},ie.autolink=function(V,J){var q=this.rules.inline.autolink.exec(V);if(q){var fe,ne;return q[2]==="@"?(fe=D(this.options.mangle?J(q[1]):q[1]),ne="mailto:"+fe):(fe=D(q[1]),ne=fe),{type:"link",raw:q[0],text:fe,href:ne,tokens:[{type:"text",raw:fe,text:fe}]}}},ie.url=function(V,J){var q;if(q=this.rules.inline.url.exec(V)){var fe,ne;if(q[2]==="@")fe=D(this.options.mangle?J(q[0]):q[0]),ne="mailto:"+fe;else{var ve;do ve=q[0],q[0]=this.rules.inline._backpedal.exec(q[0])[0];while(ve!==q[0]);fe=D(q[0]),q[1]==="www."?ne="http://"+fe:ne=fe}return{type:"link",raw:q[0],text:fe,href:ne,tokens:[{type:"text",raw:fe,text:fe}]}}},ie.inlineText=function(V,J,q){var fe=this.rules.inline.text.exec(V);if(fe){var ne;return J?ne=this.options.sanitize?this.options.sanitizer?this.options.sanitizer(fe[0]):D(fe[0]):fe[0]:ne=D(this.options.smartypants?q(fe[0]):fe[0]),{type:"text",raw:fe[0],text:ne}}},se}(),z=h.noopTest,j=h.edit,G=h.merge,Z={newline:/^(?: *(?:\n|$))+/,code:/^( {4}[^\n]+(?:\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})(?=\s|$)(.*)(?:\n+|$)/,blockquote:/^( {0,3}> ?(paragraph|[^\n]*)(?:\n|$))+/,list:/^( {0,3})(bull) [\s\S]+?(?:hr|def|\n{2,}(?! )(?! {0,3}bull )\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 *)+\\n|$)|<(?!script|pre|style)([a-z][\\w-]*)(?:attribute)*? */?>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$)|</(?!script|pre|style)[a-z][\\w-]*\\s*>(?=[ \\t]*(?:\\n|$))[\\s\\S]*?(?:(?:\\n *)+\\n|$))",def:/^ {0,3}\[(label)\]: *\n? *<?([^\s>]+)>?(?:(?: +\n? *| *\n *)(title))? *(?:\n+|$)/,nptable:z,table:z,lheading:/^([^\n]+)\n {0,3}(=+|-+) *(?:\n+|$)/,_paragraph:/^([^\n]+(?:\n(?!hr|heading|lheading|blockquote|fences|list|html| +\n)[^\n]+)*)/,text:/^[^\n]+/};Z._label=/(?!\s*\])(?:\\[\[\]]|[^\[\]])+/,Z._title=/(?:"(?:\\"?|[^"\\])*"|'[^'\n]*(?:\n[^'\n]+)*\n?'|\([^()]*\))/,Z.def=j(Z.def).replace("label",Z._label).replace("title",Z._title).getRegex(),Z.bullet=/(?:[*+-]|\d{1,9}[.)])/,Z.item=/^( *)(bull) ?[^\n]*(?:\n(?! *bull ?)[^\n]*)*/,Z.item=j(Z.item,"gm").replace(/bull/g,Z.bullet).getRegex(),Z.listItemStart=j(/^( *)(bull) */).replace("bull",Z.bullet).getRegex(),Z.list=j(Z.list).replace(/bull/g,Z.bullet).replace("hr","\\n+(?=\\1?(?:(?:- *){3,}|(?:_ *){3,}|(?:\\* *){3,})(?:\\n+|$))").replace("def","\\n+(?="+Z.def.source+")").getRegex(),Z._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",Z._comment=/<!--(?!-?>)[\s\S]*?(?:-->|$)/,Z.html=j(Z.html,"i").replace("comment",Z._comment).replace("tag",Z._tag).replace("attribute",/ +[a-zA-Z:_][\w.:-]*(?: *= *"[^"\n]*"| *= *'[^'\n]*'| *= *[^\s"'=<>`]+)?/).getRegex(),Z.paragraph=j(Z._paragraph).replace("hr",Z.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",Z._tag).getRegex(),Z.blockquote=j(Z.blockquote).replace("paragraph",Z.paragraph).getRegex(),Z.normal=G({},Z),Z.gfm=G({},Z.normal,{nptable:"^ *([^|\\n ].*\\|.*)\\n {0,3}([-:]+ *\\|[-| :]*)(?:\\n((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)",table:"^ *\\|(.+)\\n {0,3}\\|?( *[-:]+[-| :]*)(?:\\n *((?:(?!\\n|hr|heading|blockquote|code|fences|list|html).*(?:\\n|$))*)\\n*|$)"}),Z.gfm.nptable=j(Z.gfm.nptable).replace("hr",Z.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",Z._tag).getRegex(),Z.gfm.table=j(Z.gfm.table).replace("hr",Z.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",Z._tag).getRegex(),Z.pedantic=G({},Z.normal,{html:j(`^ *(?:comment *(?:\\n|\\s*$)|<(tag)[\\s\\S]+?</\\1> *(?:\\n{2,}|\\s*$)|<tag(?:"[^"]*"|'[^']*'|\\s[^'"/>\\s]*)*?/?> *(?:\\n{2,}|\\s*$))`).replace("comment",Z._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+|$)/,fences:z,paragraph:j(Z.normal._paragraph).replace("hr",Z.hr).replace("heading",` *#{1,6} *[^
]`).replace("lheading",Z.lheading).replace("blockquote"," {0,3}>").replace("|fences","").replace("|list","").replace("|html","").getRegex()});var Q={escape:/^\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/,autolink:/^<(scheme:[^\s\x00-\x1f<>]*|email)>/,url:z,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(?!\\()",emStrong:{lDelim:/^(?:\*+(?:([punct_])|[^\s*]))|^_+(?:([punct*])|([^\s_]))/,rDelimAst:/\_\_[^_*]*?\*[^_*]*?\_\_|[punct_](\*+)(?=[\s]|$)|[^punct*_\s](\*+)(?=[punct_\s]|$)|[punct_\s](\*+)(?=[^punct*_\s])|[\s](\*+)(?=[punct_])|[punct_](\*+)(?=[punct_])|[^punct*_\s](\*+)(?=[^punct*_\s])/,rDelimUnd:/\*\*[^_*]*?\_[^_*]*?\*\*|[punct*](\_+)(?=[\s]|$)|[^punct*_\s](\_+)(?=[punct*\s]|$)|[punct*\s](\_+)(?=[^punct*_\s])|[\s](\_+)(?=[punct*])|[punct*](\_+)(?=[punct*])/},code:/^(`+)([^`]|[^`][\s\S]*?[^`])\1(?!`)/,br:/^( {2,}|\\)\n(?!\s*$)/,del:z,text:/^(`+|[^`])(?:(?= {2,}\n)|[\s\S]*?(?:(?=[\\<!\[`*_]|\b_|$)|[^ ](?= {2,}\n)))/,punctuation:/^([\spunctuation])/};Q._punctuation="!\"#$%&'()+\\-.,/:;<=>?@\\[\\]`^{|}~",Q.punctuation=j(Q.punctuation).replace(/punctuation/g,Q._punctuation).getRegex(),Q.blockSkip=/\[[^\]]*?\]\([^\)]*?\)|`[^`]*?`|<[^>]*?>/g,Q.escapedEmSt=/\\\*|\\_/g,Q._comment=j(Z._comment).replace("(?:-->|$)","-->").getRegex(),Q.emStrong.lDelim=j(Q.emStrong.lDelim).replace(/punct/g,Q._punctuation).getRegex(),Q.emStrong.rDelimAst=j(Q.emStrong.rDelimAst,"g").replace(/punct/g,Q._punctuation).getRegex(),Q.emStrong.rDelimUnd=j(Q.emStrong.rDelimUnd,"g").replace(/punct/g,Q._punctuation).getRegex(),Q._escapes=/\\([!"#$%&'()*+,\-./:;<=>?@\[\]\\^_`{|}~])/g,Q._scheme=/[a-zA-Z][a-zA-Z0-9+.-]{1,31}/,Q._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])?)+(?![-_])/,Q.autolink=j(Q.autolink).replace("scheme",Q._scheme).replace("email",Q._email).getRegex(),Q._attribute=/\s+[a-zA-Z:_][\w.:-]*(?:\s*=\s*"[^"]*"|\s*=\s*'[^']*'|\s*=\s*[^\s"'=<>`]+)?/,Q.tag=j(Q.tag).replace("comment",Q._comment).replace("attribute",Q._attribute).getRegex(),Q._label=/(?:\[(?:\\.|[^\[\]\\])*\]|\\.|`[^`]*`|[^\[\]\\`])*?/,Q._href=/<(?:\\.|[^\n<>\\])+>|[^\s\x00-\x1f]*/,Q._title=/"(?:\\"?|[^"\\])*"|'(?:\\'?|[^'\\])*'|\((?:\\\)?|[^)\\])*\)/,Q.link=j(Q.link).replace("label",Q._label).replace("href",Q._href).replace("title",Q._title).getRegex(),Q.reflink=j(Q.reflink).replace("label",Q._label).getRegex(),Q.reflinkSearch=j(Q.reflinkSearch,"g").replace("reflink",Q.reflink).replace("nolink",Q.nolink).getRegex(),Q.normal=G({},Q),Q.pedantic=G({},Q.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:j(/^!?\[(label)\]\((.*?)\)/).replace("label",Q._label).getRegex(),reflink:j(/^!?\[(label)\]\s*\[([^\]]*)\]/).replace("label",Q._label).getRegex()}),Q.gfm=G({},Q.normal,{escape:j(Q.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~])\1(?=[^~]|$)/,text:/^([`~]+|[^`~])(?:(?= {2,}\n)|(?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)|[\s\S]*?(?:(?=[\\<!\[`*~_]|\b_|https?:\/\/|ftp:\/\/|www\.|$)|[^ ](?= {2,}\n)|[^a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-](?=[a-zA-Z0-9.!#$%&'*+\/=?_`{\|}~-]+@)))/}),Q.gfm.url=j(Q.gfm.url,"i").replace("email",Q.gfm._extended_email).getRegex(),Q.breaks=G({},Q.gfm,{br:j(Q.br).replace("{2,}","*").getRegex(),text:j(Q.gfm.text).replace("\\b_","\\b_| {2,}\\n").replace(/\{2,\}/g,"*").getRegex()});var ue={block:Z,inline:Q},ee=W,ae=k.exports.defaults,_e=ue.block,xe=ue.inline,ge=h.repeatString;function ce(se){return se.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 he(se){var ie="",le,V,J=se.length;for(le=0;le<J;le++)V=se.charCodeAt(le),Math.random()>.5&&(V="x"+V.toString(16)),ie+="&#"+V+";";return ie}var Se=function(){function se(le){this.tokens=[],this.tokens.links=Object.create(null),this.options=le||ae,this.options.tokenizer=this.options.tokenizer||new ee,this.tokenizer=this.options.tokenizer,this.tokenizer.options=this.options;var V={block:_e.normal,inline:xe.normal};this.options.pedantic?(V.block=_e.pedantic,V.inline=xe.pedantic):this.options.gfm&&(V.block=_e.gfm,this.options.breaks?V.inline=xe.breaks:V.inline=xe.gfm),this.tokenizer.rules=V}se.lex=function(V,J){var q=new se(J);return q.lex(V)},se.lexInline=function(V,J){var q=new se(J);return q.inlineTokens(V)};var ie=se.prototype;return ie.lex=function(V){return V=V.replace(/\r\n|\r/g,`
`).replace(/\t/g," "),this.blockTokens(V,this.tokens,!0),this.inline(this.tokens),this.tokens},ie.blockTokens=function(V,J,q){var fe=this;J===void 0&&(J=[]),q===void 0&&(q=!0),this.options.pedantic&&(V=V.replace(/^ +$/gm,""));for(var ne,ve,Ce,Ue,We,nt;V;){var et,Je,$e;if(!((et=this.options)!=null&&(Je=et.extensions)!=null&&Je.block&&this.options.extensions.block.some(function(at){return(ne=at.call(fe,V,J))?(V=V.substring(ne.raw.length),J.push(ne),!0):!1}))){if(ne=this.tokenizer.space(V)){V=V.substring(ne.raw.length),ne.type&&J.push(ne);continue}if(ne=this.tokenizer.code(V)){V=V.substring(ne.raw.length),Ue=J[J.length-1],Ue&&Ue.type==="paragraph"?(Ue.raw+=`
`+ne.raw,Ue.text+=`
`+ne.text):J.push(ne);continue}if(ne=this.tokenizer.fences(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(ne=this.tokenizer.heading(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(ne=this.tokenizer.nptable(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(ne=this.tokenizer.hr(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(ne=this.tokenizer.blockquote(V)){V=V.substring(ne.raw.length),ne.tokens=this.blockTokens(ne.text,[],q),J.push(ne);continue}if(ne=this.tokenizer.list(V)){for(V=V.substring(ne.raw.length),Ce=ne.items.length,ve=0;ve<Ce;ve++)ne.items[ve].tokens=this.blockTokens(ne.items[ve].text,[],!1);J.push(ne);continue}if(ne=this.tokenizer.html(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(q&&(ne=this.tokenizer.def(V))){V=V.substring(ne.raw.length),this.tokens.links[ne.tag]||(this.tokens.links[ne.tag]={href:ne.href,title:ne.title});continue}if(ne=this.tokenizer.table(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(ne=this.tokenizer.lheading(V)){V=V.substring(ne.raw.length),J.push(ne);continue}if(We=V,($e=this.options.extensions)!=null&&$e.startBlock&&function(){var at=1/0,ot=V.slice(1),_t=void 0;fe.options.extensions.startBlock.forEach(function(Me){_t=Me.call(this,ot),typeof _t=="number"&&_t>=0&&(at=Math.min(at,_t))}),at<1/0&&at>=0&&(We=V.substring(0,at+1))}(),q&&(ne=this.tokenizer.paragraph(We))){Ue=J[J.length-1],nt&&Ue.type==="paragraph"?(Ue.raw+=`
`+ne.raw,Ue.text+=`
`+ne.text):J.push(ne),nt=We.length!==V.length,V=V.substring(ne.raw.length);continue}if(ne=this.tokenizer.text(V)){V=V.substring(ne.raw.length),Ue=J[J.length-1],Ue&&Ue.type==="text"?(Ue.raw+=`
`+ne.raw,Ue.text+=`
`+ne.text):J.push(ne);continue}if(V){var ft="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(ft);break}else throw new Error(ft)}}}return J},ie.inline=function(V){var J,q,fe,ne,ve,Ce,Ue=V.length;for(J=0;J<Ue;J++)switch(Ce=V[J],Ce.type){case"paragraph":case"text":case"heading":{Ce.tokens=[],this.inlineTokens(Ce.text,Ce.tokens);break}case"table":{for(Ce.tokens={header:[],cells:[]},ne=Ce.header.length,q=0;q<ne;q++)Ce.tokens.header[q]=[],this.inlineTokens(Ce.header[q],Ce.tokens.header[q]);for(ne=Ce.cells.length,q=0;q<ne;q++)for(ve=Ce.cells[q],Ce.tokens.cells[q]=[],fe=0;fe<ve.length;fe++)Ce.tokens.cells[q][fe]=[],this.inlineTokens(ve[fe],Ce.tokens.cells[q][fe]);break}case"blockquote":{this.inline(Ce.tokens);break}case"list":{for(ne=Ce.items.length,q=0;q<ne;q++)this.inline(Ce.items[q].tokens);break}}return V},ie.inlineTokens=function(V,J,q,fe){var ne=this;J===void 0&&(J=[]),q===void 0&&(q=!1),fe===void 0&&(fe=!1);var ve,Ce,Ue,We=V,nt,et,Je;if(this.tokens.links){var $e=Object.keys(this.tokens.links);if($e.length>0)for(;(nt=this.tokenizer.rules.inline.reflinkSearch.exec(We))!=null;)$e.includes(nt[0].slice(nt[0].lastIndexOf("[")+1,-1))&&(We=We.slice(0,nt.index)+"["+ge("a",nt[0].length-2)+"]"+We.slice(this.tokenizer.rules.inline.reflinkSearch.lastIndex))}for(;(nt=this.tokenizer.rules.inline.blockSkip.exec(We))!=null;)We=We.slice(0,nt.index)+"["+ge("a",nt[0].length-2)+"]"+We.slice(this.tokenizer.rules.inline.blockSkip.lastIndex);for(;(nt=this.tokenizer.rules.inline.escapedEmSt.exec(We))!=null;)We=We.slice(0,nt.index)+"++"+We.slice(this.tokenizer.rules.inline.escapedEmSt.lastIndex);for(;V;){var ft,at,ot;if(et||(Je=""),et=!1,!((ft=this.options)!=null&&(at=ft.extensions)!=null&&at.inline&&this.options.extensions.inline.some(function(Me){return(ve=Me.call(ne,V,J))?(V=V.substring(ve.raw.length),J.push(ve),!0):!1}))){if(ve=this.tokenizer.escape(V)){V=V.substring(ve.raw.length),J.push(ve);continue}if(ve=this.tokenizer.tag(V,q,fe)){V=V.substring(ve.raw.length),q=ve.inLink,fe=ve.inRawBlock,Ce=J[J.length-1],Ce&&ve.type==="text"&&Ce.type==="text"?(Ce.raw+=ve.raw,Ce.text+=ve.text):J.push(ve);continue}if(ve=this.tokenizer.link(V)){V=V.substring(ve.raw.length),ve.type==="link"&&(ve.tokens=this.inlineTokens(ve.text,[],!0,fe)),J.push(ve);continue}if(ve=this.tokenizer.reflink(V,this.tokens.links)){V=V.substring(ve.raw.length),Ce=J[J.length-1],ve.type==="link"?(ve.tokens=this.inlineTokens(ve.text,[],!0,fe),J.push(ve)):Ce&&ve.type==="text"&&Ce.type==="text"?(Ce.raw+=ve.raw,Ce.text+=ve.text):J.push(ve);continue}if(ve=this.tokenizer.emStrong(V,We,Je)){V=V.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],q,fe),J.push(ve);continue}if(ve=this.tokenizer.codespan(V)){V=V.substring(ve.raw.length),J.push(ve);continue}if(ve=this.tokenizer.br(V)){V=V.substring(ve.raw.length),J.push(ve);continue}if(ve=this.tokenizer.del(V)){V=V.substring(ve.raw.length),ve.tokens=this.inlineTokens(ve.text,[],q,fe),J.push(ve);continue}if(ve=this.tokenizer.autolink(V,he)){V=V.substring(ve.raw.length),J.push(ve);continue}if(!q&&(ve=this.tokenizer.url(V,he))){V=V.substring(ve.raw.length),J.push(ve);continue}if(Ue=V,(ot=this.options.extensions)!=null&&ot.startInline&&function(){var Me=1/0,Ne=V.slice(1),it=void 0;ne.options.extensions.startInline.forEach(function(ht){it=ht.call(this,Ne),typeof it=="number"&&it>=0&&(Me=Math.min(Me,it))}),Me<1/0&&Me>=0&&(Ue=V.substring(0,Me+1))}(),ve=this.tokenizer.inlineText(Ue,fe,ce)){V=V.substring(ve.raw.length),ve.raw.slice(-1)!=="_"&&(Je=ve.raw.slice(-1)),et=!0,Ce=J[J.length-1],Ce&&Ce.type==="text"?(Ce.raw+=ve.raw,Ce.text+=ve.text):J.push(ve);continue}if(V){var _t="Infinite loop on byte: "+V.charCodeAt(0);if(this.options.silent){console.error(_t);break}else throw new Error(_t)}}}return J},M(se,null,[{key:"rules",get:function(){return{block:_e,inline:xe}}}]),se}(),Te=k.exports.defaults,ke=h.cleanUrl,X=h.escape,te=function(){function se(le){this.options=le||Te}var ie=se.prototype;return ie.code=function(V,J,q){var fe=(J||"").match(/\S*/)[0];if(this.options.highlight){var ne=this.options.highlight(V,fe);ne!=null&&ne!==V&&(q=!0,V=ne)}return V=V.replace(/\n$/,"")+`
`,fe?'<pre><code class="'+this.options.langPrefix+X(fe,!0)+'">'+(q?V:X(V,!0))+`</code></pre>
`:"<pre><code>"+(q?V:X(V,!0))+`</code></pre>
`},ie.blockquote=function(V){return`<blockquote>
`+V+`</blockquote>
`},ie.html=function(V){return V},ie.heading=function(V,J,q,fe){return this.options.headerIds?"<h"+J+' id="'+this.options.headerPrefix+fe.slug(q)+'">'+V+"</h"+J+`>
`:"<h"+J+">"+V+"</h"+J+`>
`},ie.hr=function(){return this.options.xhtml?`<hr/>
`:`<hr>
`},ie.list=function(V,J,q){var fe=J?"ol":"ul",ne=J&&q!==1?' start="'+q+'"':"";return"<"+fe+ne+`>
`+V+"</"+fe+`>
`},ie.listitem=function(V){return"<li>"+V+`</li>
`},ie.checkbox=function(V){return"<input "+(V?'checked="" ':"")+'disabled="" type="checkbox"'+(this.options.xhtml?" /":"")+"> "},ie.paragraph=function(V){return"<p>"+V+`</p>
`},ie.table=function(V,J){return J&&(J="<tbody>"+J+"</tbody>"),`<table>
<thead>
`+V+`</thead>
`+J+`</table>
`},ie.tablerow=function(V){return`<tr>
`+V+`</tr>
`},ie.tablecell=function(V,J){var q=J.header?"th":"td",fe=J.align?"<"+q+' align="'+J.align+'">':"<"+q+">";return fe+V+"</"+q+`>
`},ie.strong=function(V){return"<strong>"+V+"</strong>"},ie.em=function(V){return"<em>"+V+"</em>"},ie.codespan=function(V){return"<code>"+V+"</code>"},ie.br=function(){return this.options.xhtml?"<br/>":"<br>"},ie.del=function(V){return"<del>"+V+"</del>"},ie.link=function(V,J,q){if(V=ke(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var fe='<a href="'+X(V)+'"';return J&&(fe+=' title="'+J+'"'),fe+=">"+q+"</a>",fe},ie.image=function(V,J,q){if(V=ke(this.options.sanitize,this.options.baseUrl,V),V===null)return q;var fe='<img src="'+V+'" alt="'+q+'"';return J&&(fe+=' title="'+J+'"'),fe+=this.options.xhtml?"/>":">",fe},ie.text=function(V){return V},se}(),pe=function(){function se(){}var ie=se.prototype;return ie.strong=function(V){return V},ie.em=function(V){return V},ie.codespan=function(V){return V},ie.del=function(V){return V},ie.html=function(V){return V},ie.text=function(V){return V},ie.link=function(V,J,q){return""+q},ie.image=function(V,J,q){return""+q},ie.br=function(){return""},se}(),me=function(){function se(){this.seen={}}var ie=se.prototype;return ie.serialize=function(V){return V.toLowerCase().trim().replace(/<[!\/a-z].*?>/ig,"").replace(/[\u2000-\u206F\u2E00-\u2E7F\\'!"#$%&()*+,./:;<=>?@[\]^`{|}~]/g,"").replace(/\s/g,"-")},ie.getNextSafeSlug=function(V,J){var q=V,fe=0;if(this.seen.hasOwnProperty(q)){fe=this.seen[V];do fe++,q=V+"-"+fe;while(this.seen.hasOwnProperty(q))}return J||(this.seen[V]=fe,this.seen[q]=0),q},ie.slug=function(V,J){J===void 0&&(J={});var q=this.serialize(V);return this.getNextSafeSlug(q,J.dryrun)},se}(),be=te,de=pe,Be=me,we=k.exports.defaults,Le=h.unescape,Ae=function(){function se(le){this.options=le||we,this.options.renderer=this.options.renderer||new be,this.renderer=this.options.renderer,this.renderer.options=this.options,this.textRenderer=new de,this.slugger=new Be}se.parse=function(V,J){var q=new se(J);return q.parse(V)},se.parseInline=function(V,J){var q=new se(J);return q.parseInline(V)};var ie=se.prototype;return ie.parse=function(V,J){J===void 0&&(J=!0);var q="",fe,ne,ve,Ce,Ue,We,nt,et,Je,$e,ft,at,ot,_t,Me,Ne,it,ht,Ct,Ft=V.length;for(fe=0;fe<Ft;fe++){var Vt,pr;if($e=V[fe],(Vt=this.options.extensions)!=null&&(pr=Vt.renderers)!=null&&pr[$e.type]&&(Ct=this.options.extensions.renderers[$e.type].call(this,$e),Ct!==!1||!["space","hr","heading","code","table","blockquote","list","html","paragraph","text"].includes($e.type))){q+=Ct||"";continue}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,Le(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(et="",nt="",Ce=$e.header.length,ne=0;ne<Ce;ne++)nt+=this.renderer.tablecell(this.parseInline($e.tokens.header[ne]),{header:!0,align:$e.align[ne]});for(et+=this.renderer.tablerow(nt),Je="",Ce=$e.cells.length,ne=0;ne<Ce;ne++){for(We=$e.tokens.cells[ne],nt="",Ue=We.length,ve=0;ve<Ue;ve++)nt+=this.renderer.tablecell(this.parseInline(We[ve]),{header:!1,align:$e.align[ve]});Je+=this.renderer.tablerow(nt)}q+=this.renderer.table(et,Je);continue}case"blockquote":{Je=this.parse($e.tokens),q+=this.renderer.blockquote(Je);continue}case"list":{for(ft=$e.ordered,at=$e.start,ot=$e.loose,Ce=$e.items.length,Je="",ne=0;ne<Ce;ne++)Me=$e.items[ne],Ne=Me.checked,it=Me.task,_t="",Me.task&&(ht=this.renderer.checkbox(Ne),ot?Me.tokens.length>0&&Me.tokens[0].type==="text"?(Me.tokens[0].text=ht+" "+Me.tokens[0].text,Me.tokens[0].tokens&&Me.tokens[0].tokens.length>0&&Me.tokens[0].tokens[0].type==="text"&&(Me.tokens[0].tokens[0].text=ht+" "+Me.tokens[0].tokens[0].text)):Me.tokens.unshift({type:"text",text:ht}):_t+=ht),_t+=this.parse(Me.tokens,ot),Je+=this.renderer.listitem(_t,it,Ne);q+=this.renderer.list(Je,ft,at);continue}case"html":{q+=this.renderer.html($e.text);continue}case"paragraph":{q+=this.renderer.paragraph(this.parseInline($e.tokens));continue}case"text":{for(Je=$e.tokens?this.parseInline($e.tokens):$e.text;fe+1<Ft&&V[fe+1].type==="text";)$e=V[++fe],Je+=`
`+($e.tokens?this.parseInline($e.tokens):$e.text);q+=J?this.renderer.paragraph(Je):Je;continue}default:{var gt='Token with "'+$e.type+'" type was not found.';if(this.options.silent){console.error(gt);return}else throw new Error(gt)}}}return q},ie.parseInline=function(V,J){J=J||this.renderer;var q="",fe,ne,ve,Ce=V.length;for(fe=0;fe<Ce;fe++){var Ue,We;if(ne=V[fe],(Ue=this.options.extensions)!=null&&(We=Ue.renderers)!=null&&We[ne.type]&&(ve=this.options.extensions.renderers[ne.type].call(this,ne),ve!==!1||!["escape","html","link","image","strong","em","codespan","br","del","text"].includes(ne.type))){q+=ve||"";continue}switch(ne.type){case"escape":{q+=J.text(ne.text);break}case"html":{q+=J.html(ne.text);break}case"link":{q+=J.link(ne.href,ne.title,this.parseInline(ne.tokens,J));break}case"image":{q+=J.image(ne.href,ne.title,ne.text);break}case"strong":{q+=J.strong(this.parseInline(ne.tokens,J));break}case"em":{q+=J.em(this.parseInline(ne.tokens,J));break}case"codespan":{q+=J.codespan(ne.text);break}case"br":{q+=J.br();break}case"del":{q+=J.del(this.parseInline(ne.tokens,J));break}case"text":{q+=J.text(ne.text);break}default:{var nt='Token with "'+ne.type+'" type was not found.';if(this.options.silent){console.error(nt);return}else throw new Error(nt)}}}return q},se}(),Ve=Se,De=Ae,ye=W,Ee=te,Oe=pe,Fe=me,Ke=h.merge,ze=h.checkSanitizeDeprecation,Ye=h.escape,Ie=k.exports.getDefaults,je=k.exports.changeDefaults,qe=k.exports.defaults;function Pe(se,ie,le){if(typeof se=="undefined"||se===null)throw new Error("marked(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");if(typeof ie=="function"&&(le=ie,ie=null),ie=Ke({},Pe.defaults,ie||{}),ze(ie),le){var V=ie.highlight,J;try{J=Ve.lex(se,ie)}catch(ve){return le(ve)}var q=function(Ce){var Ue;if(!Ce)try{ie.walkTokens&&Pe.walkTokens(J,ie.walkTokens),Ue=De.parse(J,ie)}catch(We){Ce=We}return ie.highlight=V,Ce?le(Ce):le(null,Ue)};if(!V||V.length<3||(delete ie.highlight,!J.length))return q();var fe=0;Pe.walkTokens(J,function(ve){ve.type==="code"&&(fe++,setTimeout(function(){V(ve.text,ve.lang,function(Ce,Ue){if(Ce)return q(Ce);Ue!=null&&Ue!==ve.text&&(ve.text=Ue,ve.escaped=!0),fe--,fe===0&&q()})},0))}),fe===0&&q();return}try{var ne=Ve.lex(se,ie);return ie.walkTokens&&Pe.walkTokens(ne,ie.walkTokens),De.parse(ne,ie)}catch(ve){if(ve.message+=`
Please report this to https://github.com/markedjs/marked.`,ie.silent)return"<p>An error occurred:</p><pre>"+Ye(ve.message+"",!0)+"</pre>";throw ve}}Pe.options=Pe.setOptions=function(se){return Ke(Pe.defaults,se),je(Pe.defaults),Pe},Pe.getDefaults=Ie,Pe.defaults=qe,Pe.use=function(){for(var se=this,ie=arguments.length,le=new Array(ie),V=0;V<ie;V++)le[V]=arguments[V];var J=Ke.apply(void 0,[{}].concat(le)),q=Pe.defaults.extensions||{renderers:{},childTokens:{}},fe;le.forEach(function(ne){if(ne.extensions&&(fe=!0,ne.extensions.forEach(function(Ce){if(!Ce.name)throw new Error("extension name required");if(Ce.renderer){var Ue,We=(Ue=q.renderers)==null?void 0:Ue[Ce.name];We?q.renderers[Ce.name]=function(){for(var nt=arguments.length,et=new Array(nt),Je=0;Je<nt;Je++)et[Je]=arguments[Je];var $e=Ce.renderer.apply(this,et);return $e===!1&&($e=We.apply(this,et)),$e}:q.renderers[Ce.name]=Ce.renderer}if(Ce.tokenizer){if(!Ce.level||Ce.level!=="block"&&Ce.level!=="inline")throw new Error("extension level must be 'block' or 'inline'");q[Ce.level]?q[Ce.level].unshift(Ce.tokenizer):q[Ce.level]=[Ce.tokenizer],Ce.start&&(Ce.level==="block"?q.startBlock?q.startBlock.push(Ce.start):q.startBlock=[Ce.start]:Ce.level==="inline"&&(q.startInline?q.startInline.push(Ce.start):q.startInline=[Ce.start]))}Ce.childTokens&&(q.childTokens[Ce.name]=Ce.childTokens)})),ne.renderer&&function(){var Ce=Pe.defaults.renderer||new Ee,Ue=function(et){var Je=Ce[et];Ce[et]=function(){for(var $e=arguments.length,ft=new Array($e),at=0;at<$e;at++)ft[at]=arguments[at];var ot=ne.renderer[et].apply(Ce,ft);return ot===!1&&(ot=Je.apply(Ce,ft)),ot}};for(var We in ne.renderer)Ue(We);J.renderer=Ce}(),ne.tokenizer&&function(){var Ce=Pe.defaults.tokenizer||new ye,Ue=function(et){var Je=Ce[et];Ce[et]=function(){for(var $e=arguments.length,ft=new Array($e),at=0;at<$e;at++)ft[at]=arguments[at];var ot=ne.tokenizer[et].apply(Ce,ft);return ot===!1&&(ot=Je.apply(Ce,ft)),ot}};for(var We in ne.tokenizer)Ue(We);J.tokenizer=Ce}(),ne.walkTokens){var ve=Pe.defaults.walkTokens;J.walkTokens=function(Ce){ne.walkTokens.call(se,Ce),ve&&ve(Ce)}}fe&&(J.extensions=q),Pe.setOptions(J)})},Pe.walkTokens=function(se,ie){for(var le=function(){var fe=J.value;switch(ie(fe),fe.type){case"table":{for(var ne=U(fe.tokens.header),ve;!(ve=ne()).done;){var Ce=ve.value;Pe.walkTokens(Ce,ie)}for(var Ue=U(fe.tokens.cells),We;!(We=Ue()).done;)for(var nt=We.value,et=U(nt),Je;!(Je=et()).done;){var $e=Je.value;Pe.walkTokens($e,ie)}break}case"list":{Pe.walkTokens(fe.items,ie);break}default:{var ft,at,ot,_t,Me;if((ft=Pe.defaults)!=null&&(at=ft.extensions)!=null&&(ot=at.childTokens)!=null&&ot[fe.type]){var Ne;(Ne=Pe.defaults)==null||Ne.extensions.childTokens[fe.type].forEach(function(it){Pe.walkTokens(fe[it],ie)})}fe.tokens&&!((_t=Pe.defaults)!=null&&(Me=_t.extensions)!=null&&Me.childTokens[fe.type])&&Pe.walkTokens(fe.tokens,ie)}}},V=U(se),J;!(J=V()).done;)le()},Pe.parseInline=function(se,ie){if(typeof se=="undefined"||se===null)throw new Error("marked.parseInline(): input parameter is undefined or null");if(typeof se!="string")throw new Error("marked.parseInline(): input parameter is of type "+Object.prototype.toString.call(se)+", string expected");ie=Ke({},Pe.defaults,ie||{}),ze(ie);try{var le=Ve.lexInline(se,ie);return ie.walkTokens&&Pe.walkTokens(le,ie.walkTokens),De.parseInline(le,ie)}catch(V){if(V.message+=`
Please report this to https://github.com/markedjs/marked.`,ie.silent)return"<p>An error occurred:</p><pre>"+Ye(V.message+"",!0)+"</pre>";throw V}},Pe.Parser=De,Pe.parser=De.parse,Pe.Renderer=Ee,Pe.TextRenderer=Oe,Pe.Lexer=Ve,Pe.lexer=Ve.lex,Pe.Tokenizer=ye,Pe.Slugger=Fe,Pe.parse=Pe;var Ze=Pe;return Ze})},90621:function(Ge){const re=/[&<>"']/,M=/[&<>"']/g,N=/[<>"']|&(?!#?\w+;)/,B=/[<>"']|&(?!#?\w+;)/g,U={"&":"&amp;","<":"&lt;",">":"&gt;",'"':"&quot;","'":"&#39;"},k=f=>U[f];function S(f,C){if(C){if(re.test(f))return f.replace(M,k)}else if(N.test(f))return f.replace(B,k);return f}const P=/&(#(?:\d+)|(?:#x[0-9A-Fa-f]+)|(?:\w+));?/ig;function T(f){return f.replace(P,(C,L)=>(L=L.toLowerCase(),L==="colon"?":":L.charAt(0)==="#"?L.charAt(1)==="x"?String.fromCharCode(parseInt(L.substring(2),16)):String.fromCharCode(+L.substring(1)):""))}const b=/(^|[^\[])\^/g;function e(f,C){f=f.source||f,C=C||"";const L={replace:(R,O)=>(O=O.source||O,O=O.replace(b,"$1"),f=f.replace(R,O),L),getRegex:()=>new RegExp(f,C)};return L}const E=/[^\w:]/g,s=/^$|^[a-z][a-z0-9+.-]*:|^[?#]/i;function n(f,C,L){if(f){let R;try{R=decodeURIComponent(T(L)).replace(E,"").toLowerCase()}catch(O){return null}if(R.indexOf("javascript:")===0||R.indexOf("vbscript:")===0||R.indexOf("data:")===0)return null}C&&!s.test(L)&&(L=v(C,L));try{L=encodeURI(L).replace(/%25/g,"%")}catch(R){return null}return L}const t={},r=/^[^:]+:\/*[^/]*$/,i=/^([^:]+:)[\s\S]*$/,a=/^([^:]+:\/*[^/]*)[\s\S]*$/;function v(f,C){t[" "+f]||(r.test(f)?t[" "+f]=f+"/":t[" "+f]=u(f,"/",!0)),f=t[" "+f];const L=f.indexOf(":")===-1;return C.substring(0,2)==="//"?L?C:f.replace(i,"$1")+C:C.charAt(0)==="/"?L?C:f.replace(a,"$1")+C:f+C}const p={exec:function(){}};function l(f){let C=1,L,R;for(;C<arguments.length;C++){L=arguments[C];for(R in L)Object.prototype.hasOwnProperty.call(L,R)&&(f[R]=L[R])}return f}function o(f,C){const L=f.replace(/\|/g,(g,m,d)=>{let h=!1,A=m;for(;--A>=0&&d[A]==="\\";)h=!h;return h?"|":" |"}),R=L.split(/ \|/);let O=0;if(R.length>C)R.splice(C);else for(;R.length<C;)R.push("");for(;O<R.length;O++)R[O]=R[O].trim().replace(/\\\|/g,"|");return R}function u(f,C,L){const R=f.length;if(R===0)return"";let O=0;for(;O<R;){const g=f.charAt(R-O-1);if(g===C&&!L)O++;else if(g!==C&&L)O++;else break}return f.substr(0,R-O)}function c(f,C){if(f.indexOf(C[1])===-1)return-1;const L=f.length;let R=0,O=0;for(;O<L;O++)if(f[O]==="\\")O++;else if(f[O]===C[0])R++;else if(f[O]===C[1]&&(R--,R<0))return O;return-1}function _(f){f&&f.sanitize&&!f.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")}function y(f,C){if(C<1)return"";let L="";for(;C>1;)C&1&&(L+=f),C>>=1,f+=f;return L+f}Ge.exports={escape:S,unescape:T,edit:e,cleanUrl:n,resolveUrl:v,noopTest:p,merge:l,splitCells:o,rtrim:u,findClosingBracket:c,checkSanitizeDeprecation:_,repeatString:y}},74741:function(Ge,re,M){"use strict";M.d(re,{Wi:function(){return P},Z0:function(){return T},aU:function(){return S},eZ:function(){return e},wY:function(){return b}});var N=M(4669),B=M(9917),U=M(63580),k=function(E,s,n,t){function r(i){return i instanceof n?i:new n(function(a){a(i)})}return new(n||(n=Promise))(function(i,a){function v(o){try{l(t.next(o))}catch(u){a(u)}}function p(o){try{l(t.throw(o))}catch(u){a(u)}}function l(o){o.done?i(o.value):r(o.value).then(v,p)}l((t=t.apply(E,s||[])).next())})};class S extends B.JT{constructor(s,n="",t="",r=!0,i){super(),this._onDidChange=this._register(new N.Q5),this.onDidChange=this._onDidChange.event,this._enabled=!0,this._id=s,this._label=n,this._cssClass=t,this._enabled=r,this._actionCallback=i}get id(){return this._id}get label(){return this._label}set label(s){this._setLabel(s)}_setLabel(s){this._label!==s&&(this._label=s,this._onDidChange.fire({label:s}))}get tooltip(){return this._tooltip||""}set tooltip(s){this._setTooltip(s)}_setTooltip(s){this._tooltip!==s&&(this._tooltip=s,this._onDidChange.fire({tooltip:s}))}get class(){return this._cssClass}set class(s){this._setClass(s)}_setClass(s){this._cssClass!==s&&(this._cssClass=s,this._onDidChange.fire({class:s}))}get enabled(){return this._enabled}set enabled(s){this._setEnabled(s)}_setEnabled(s){this._enabled!==s&&(this._enabled=s,this._onDidChange.fire({enabled:s}))}get checked(){return this._checked}set checked(s){this._setChecked(s)}_setChecked(s){this._checked!==s&&(this._checked=s,this._onDidChange.fire({checked:s}))}run(s,n){return k(this,void 0,void 0,function*(){this._actionCallback&&(yield this._actionCallback(s))})}}class P extends B.JT{constructor(){super(...arguments),this._onBeforeRun=this._register(new N.Q5),this.onBeforeRun=this._onBeforeRun.event,this._onDidRun=this._register(new N.Q5),this.onDidRun=this._onDidRun.event}run(s,n){return k(this,void 0,void 0,function*(){if(!s.enabled)return;this._onBeforeRun.fire({action:s});let t;try{yield this.runAction(s,n)}catch(r){t=r}this._onDidRun.fire({action:s,error:t})})}runAction(s,n){return k(this,void 0,void 0,function*(){yield s.run(n)})}}class T extends S{constructor(s){super(T.ID,s,s?"separator text":"separator"),this.checked=!1,this.enabled=!1}}T.ID="vs.actions.separator";class b{constructor(s,n,t,r){this.tooltip="",this.enabled=!0,this.checked=!1,this.id=s,this.label=n,this.class=r,this._actions=t}get actions(){return this._actions}dispose(){}run(){return k(this,void 0,void 0,function*(){})}}class e extends S{constructor(){super(e.ID,U.N("submenu.empty","(empty)"),void 0,!1)}}e.ID="vs.actions.empty"},35146:function(Ge,re,M){"use strict";M.d(re,{ok:function(){return N}});function N(B,U){if(!B)throw new Error(U?`Assertion failed (${U})`:"Assertion Failed")}},73046:function(Ge,re,M){"use strict";M.d(re,{CM:function(){return S},JL:function(){return P},dT:function(){return b},fK:function(){return k},lA:function(){return T}});var N=M(4669);class B{constructor(){this._icons=new Map,this._onDidRegister=new N.Q5}add(E){const s=this._icons.get(E.id);s?E.description?s.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 U=new B,k=U;function S(e,E){return new T(e,E)}function P(e){return e?e.replace(/\$\((.*?)\)/g,(E,s)=>` ${s} `).trim():""}class T{constructor(E,s,n){this.id=E,this.definition=s,this.description=n,U.add(this)}get classNames(){return"codicon codicon-"+this.id}get classNamesArray(){return["codicon","codicon-"+this.id]}get cssSelector(){return".codicon.codicon-"+this.id}}var b;(function(e){e.iconNameSegment="[A-Za-z0-9]+",e.iconNameExpression="[A-Za-z0-9\\-]+",e.iconModifierExpression="~[A-Za-z]+";const E=new RegExp(`^(${e.iconNameExpression})(${e.iconModifierExpression})?$`);function s(r){if(r instanceof T)return["codicon","codicon-"+r.id];const i=E.exec(r.id);if(!i)return s(T.error);let[,a,v]=i;const p=["codicon","codicon-"+a];return v&&p.push("codicon-modifier-"+v.substr(1)),p}e.asClassNameArray=s;function n(r){return s(r).join(" ")}e.asClassName=n;function t(r){return"."+s(r).join(".")}e.asCSSSelector=t})(b||(b={})),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"})}(T||(T={}))},17301:function(Ge,re,M){"use strict";M.d(re,{B8:function(){return s},Cp:function(){return k},F0:function(){return b},L6:function(){return E},VV:function(){return T},b1:function(){return e},dL:function(){return U},ri:function(){return S}});class N{constructor(){this.listeners=[],this.unexpectedErrorHandler=function(t){setTimeout(()=>{throw t.stack?new Error(t.message+`
`+t.stack):t},0)}}emit(t){this.listeners.forEach(r=>{r(t)})}onUnexpectedError(t){this.unexpectedErrorHandler(t),this.emit(t)}onUnexpectedExternalError(t){this.unexpectedErrorHandler(t)}}const B=new N;function U(n){T(n)||B.onUnexpectedError(n)}function k(n){T(n)||B.onUnexpectedExternalError(n)}function S(n){if(n instanceof Error){let{name:t,message:r}=n;const i=n.stacktrace||n.stack;return{$isError:!0,name:t,message:r,stack:i}}return n}const P="Canceled";function T(n){return n instanceof Error&&n.name===P&&n.message===P}function b(){const n=new Error(P);return n.name=n.message,n}function e(n){return n?new Error(`Illegal argument: ${n}`):new Error("Illegal argument")}function E(n){return n?new Error(`Illegal state: ${n}`):new Error("Illegal state")}class s extends Error{constructor(t){super("NotSupported"),t&&(this.message=t)}}},4669:function(Ge,re,M){"use strict";M.d(re,{D0:function(){return s},E7:function(){return n},K3:function(){return E},Q5:function(){return e},ZD:function(){return t},ju:function(){return S}});var N=M(17301),B=M(9917),U=M(91741),k=M(84013),S;(function(r){r.None=()=>B.JT.None;function i(d){return(h,A=null,w)=>{let x=!1,D;return D=d(I=>{if(!x)return D?D.dispose():x=!0,h.call(A,I)},null,w),x&&D.dispose(),D}}r.once=i;function a(d,h){return c((A,w=null,x)=>d(D=>A.call(w,h(D)),null,x))}r.map=a;function v(d,h){return c((A,w=null,x)=>d(D=>{h(D),A.call(w,D)},null,x))}r.forEach=v;function p(d,h){return c((A,w=null,x)=>d(D=>h(D)&&A.call(w,D),null,x))}r.filter=p;function l(d){return d}r.signal=l;function o(...d){return(h,A=null,w)=>(0,B.F8)(...d.map(x=>x(D=>h.call(A,D),null,w)))}r.any=o;function u(d,h,A){let w=A;return a(d,x=>(w=h(w,x),w))}r.reduce=u;function c(d){let h;const A=new e({onFirstListenerAdd(){h=d(A.fire,A)},onLastListenerRemove(){h.dispose()}});return A.event}function _(d,h,A=100,w=!1,x){let D,I,F,K=0;const W=new e({leakWarningThreshold:x,onFirstListenerAdd(){D=d(z=>{K++,I=h(I,z),w&&!F&&(W.fire(I),I=void 0),clearTimeout(F),F=setTimeout(()=>{const j=I;I=void 0,F=void 0,(!w||K>1)&&W.fire(j),K=0},A)})},onLastListenerRemove(){D.dispose()}});return W.event}r.debounce=_;function y(d,h=(A,w)=>A===w){let A=!0,w;return p(d,x=>{const D=A||!h(x,w);return A=!1,w=x,D})}r.latch=y;function f(d,h){return[r.filter(d,h),r.filter(d,A=>!h(A))]}r.split=f;function C(d,h=!1,A=[]){let w=A.slice(),x=d(F=>{w?w.push(F):I.fire(F)});const D=()=>{w&&w.forEach(F=>I.fire(F)),w=null},I=new e({onFirstListenerAdd(){x||(x=d(F=>I.fire(F)))},onFirstListenerDidAdd(){w&&(h?setTimeout(D):D())},onLastListenerRemove(){x&&x.dispose(),x=null}});return I.event}r.buffer=C;class L{constructor(h){this.event=h}map(h){return new L(a(this.event,h))}forEach(h){return new L(v(this.event,h))}filter(h){return new L(p(this.event,h))}reduce(h,A){return new L(u(this.event,h,A))}latch(){return new L(y(this.event))}debounce(h,A=100,w=!1,x){return new L(_(this.event,h,A,w,x))}on(h,A,w){return this.event(h,A,w)}once(h,A,w){return i(this.event)(h,A,w)}}function R(d){return new L(d)}r.chain=R;function O(d,h,A=w=>w){const w=(...F)=>I.fire(A(...F)),x=()=>d.on(h,w),D=()=>d.removeListener(h,w),I=new e({onFirstListenerAdd:x,onLastListenerRemove:D});return I.event}r.fromNodeEventEmitter=O;function g(d,h,A=w=>w){const w=(...F)=>I.fire(A(...F)),x=()=>d.addEventListener(h,w),D=()=>d.removeEventListener(h,w),I=new e({onFirstListenerAdd:x,onLastListenerRemove:D});return I.event}r.fromDOMEventEmitter=g;function m(d){return new Promise(h=>i(d)(h))}r.toPromise=m})(S||(S={}));class P{constructor(i){this._listenerCount=0,this._invocationCount=0,this._elapsedOverall=0,this._name=`${i}_${P._idPool++}`}start(i){this._stopWatch=new k.G(!0),this._listenerCount=i}stop(){if(this._stopWatch){const i=this._stopWatch.elapsed();this._elapsedOverall+=i,this._invocationCount+=1,console.info(`did FIRE ${this._name}: elapsed_ms: ${i.toFixed(5)}, listener: ${this._listenerCount} (elapsed_overall: ${this._elapsedOverall.toFixed(2)}, invocations: ${this._invocationCount})`),this._stopWatch=void 0}}}P._idPool=0;let T=-1;class b{constructor(i,a=Math.random().toString(18).slice(2,5)){this.customThreshold=i,this.name=a,this._warnCountdown=0}dispose(){this._stacks&&this._stacks.clear()}check(i){let a=T;if(typeof this.customThreshold=="number"&&(a=this.customThreshold),a<=0||i<a)return;this._stacks||(this._stacks=new Map);const v=new Error().stack.split(`
`).slice(3).join(`
`),p=this._stacks.get(v)||0;if(this._stacks.set(v,p+1),this._warnCountdown-=1,this._warnCountdown<=0){this._warnCountdown=a*.5;let l,o=0;for(const[u,c]of this._stacks)(!l||o<c)&&(l=u,o=c);console.warn(`[${this.name}] potential listener LEAK detected, having ${i} listeners already. MOST frequent listener (${o}):`),console.warn(l)}return()=>{const l=this._stacks.get(v)||0;this._stacks.set(v,l-1)}}}class e{constructor(i){var a;this._disposed=!1,this._options=i,this._leakageMon=T>0?new b(this._options&&this._options.leakWarningThreshold):void 0,this._perfMon=!((a=this._options)===null||a===void 0)&&a._profName?new P(this._options._profName):void 0}get event(){return this._event||(this._event=(i,a,v)=>{var p;this._listeners||(this._listeners=new U.S);const l=this._listeners.isEmpty();l&&this._options&&this._options.onFirstListenerAdd&&this._options.onFirstListenerAdd(this);const o=this._listeners.push(a?[i,a]:i);l&&this._options&&this._options.onFirstListenerDidAdd&&this._options.onFirstListenerDidAdd(this),this._options&&this._options.onListenerDidAdd&&this._options.onListenerDidAdd(this,i,a);const u=(p=this._leakageMon)===null||p===void 0?void 0:p.check(this._listeners.size),c=(0,B.OF)(()=>{u&&u(),this._disposed||(o(),this._options&&this._options.onLastListenerRemove&&(this._listeners&&!this._listeners.isEmpty()||this._options.onLastListenerRemove(this)))});return v instanceof B.SL?v.add(c):Array.isArray(v)&&v.push(c),c}),this._event}fire(i){var a,v;if(this._listeners){this._deliveryQueue||(this._deliveryQueue=new U.S);for(let p of this._listeners)this._deliveryQueue.push([p,i]);for((a=this._perfMon)===null||a===void 0||a.start(this._deliveryQueue.size);this._deliveryQueue.size>0;){const[p,l]=this._deliveryQueue.shift();try{typeof p=="function"?p.call(void 0,l):p[0].call(p[1],l)}catch(o){(0,N.dL)(o)}}(v=this._perfMon)===null||v===void 0||v.stop()}}dispose(){var i,a,v,p,l;this._disposed||(this._disposed=!0,(i=this._listeners)===null||i===void 0||i.clear(),(a=this._deliveryQueue)===null||a===void 0||a.clear(),(p=(v=this._options)===null||v===void 0?void 0:v.onLastListenerRemove)===null||p===void 0||p.call(v),(l=this._leakageMon)===null||l===void 0||l.dispose())}}class E extends e{constructor(i){super(i),this._isPaused=0,this._eventQueue=new U.S,this._mergeFn=i==null?void 0:i.merge}pause(){this._isPaused++}resume(){if(this._isPaused!==0&&--this._isPaused===0)if(this._mergeFn){const i=Array.from(this._eventQueue);this._eventQueue.clear(),super.fire(this._mergeFn(i))}else for(;!this._isPaused&&this._eventQueue.size!==0;)super.fire(this._eventQueue.shift())}fire(i){this._listeners&&(this._isPaused!==0?this._eventQueue.push(i):super.fire(i))}}class s extends E{constructor(i){var a;super(i),this._delay=(a=i.delay)!==null&&a!==void 0?a:100}fire(i){this._handle||(this.pause(),this._handle=setTimeout(()=>{this._handle=void 0,this.resume()},this._delay)),super.fire(i)}}class n{constructor(){this.buffers=[]}wrapEvent(i){return(a,v,p)=>i(l=>{const o=this.buffers[this.buffers.length-1];o?o.push(()=>a.call(v,l)):a.call(v,l)},void 0,p)}bufferEvents(i){const a=[];this.buffers.push(a);const v=i();return this.buffers.pop(),a.forEach(p=>p()),v}}class t{constructor(){this.listening=!1,this.inputEvent=S.None,this.inputEventListener=B.JT.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(i){this.inputEvent=i,this.listening&&(this.inputEventListener.dispose(),this.inputEventListener=i(this.emitter.fire,this.emitter))}dispose(){this.inputEventListener.dispose(),this.emitter.dispose()}}},88289:function(Ge,re,M){"use strict";M.d(re,{I:function(){return N}});function N(B){const U=this;let k=!1,S;return function(){return k||(k=!0,S=B.apply(U,arguments)),S}}},53725:function(Ge,re,M){"use strict";M.d(re,{$:function(){return N}});var N;(function(B){function U(o){return o&&typeof o=="object"&&typeof o[Symbol.iterator]=="function"}B.is=U;const k=Object.freeze([]);function S(){return k}B.empty=S;function*P(o){yield o}B.single=P;function T(o){return o||k}B.from=T;function b(o){return!o||o[Symbol.iterator]().next().done===!0}B.isEmpty=b;function e(o){return o[Symbol.iterator]().next().value}B.first=e;function E(o,u){for(const c of o)if(u(c))return!0;return!1}B.some=E;function s(o,u){for(const c of o)if(u(c))return c}B.find=s;function*n(o,u){for(const c of o)u(c)&&(yield c)}B.filter=n;function*t(o,u){let c=0;for(const _ of o)yield u(_,c++)}B.map=t;function*r(...o){for(const u of o)for(const c of u)yield c}B.concat=r;function*i(o){for(const u of o)for(const c of u)yield c}B.concatNested=i;function a(o,u,c){let _=c;for(const y of o)_=u(_,y);return _}B.reduce=a;function*v(o,u,c=o.length){for(u<0&&(u+=o.length),c<0?c+=o.length:c>o.length&&(c=o.length);u<c;u++)yield o[u]}B.slice=v;function p(o,u=Number.POSITIVE_INFINITY){const c=[];if(u===0)return[c,o];const _=o[Symbol.iterator]();for(let y=0;y<u;y++){const f=_.next();if(f.done)return[c,B.empty()];c.push(f.value)}return[c,{[Symbol.iterator](){return _}}]}B.consume=p;function l(o,u,c=(_,y)=>_===y){const _=o[Symbol.iterator](),y=u[Symbol.iterator]();for(;;){const f=_.next(),C=y.next();if(f.done!==C.done)return!1;if(f.done)return!0;if(!c(f.value,C.value))return!1}}B.equals=l})(N||(N={}))},9917:function(Ge,re,M){"use strict";M.d(re,{B9:function(){return t},F8:function(){return r},JT:function(){return v},Jz:function(){return l},OF:function(){return i},SL:function(){return a},Wf:function(){return n},XK:function(){return p},dk:function(){return E}});var N=M(88289),B=M(53725);const U=!1;let k=null;function S(o){k=o}if(U){const o="__is_disposable_tracked__";S(new class{trackDisposable(u){const c=new Error("Potentially leaked disposable").stack;setTimeout(()=>{u[o]||console.log(c)},3e3)}setParent(u,c){if(u&&u!==v.None)try{u[o]=!0}catch(_){}}markAsDisposed(u){if(u&&u!==v.None)try{u[o]=!0}catch(c){}}markAsSingleton(u){}})}function P(o){return k==null||k.trackDisposable(o),o}function T(o){k==null||k.markAsDisposed(o)}function b(o,u){k==null||k.setParent(o,u)}function e(o,u){if(k)for(const c of o)k.setParent(c,u)}function E(o){return k==null||k.markAsSingleton(o),o}class s extends Error{constructor(u){super(`Encountered errors while disposing of store. Errors: [${u.join(", ")}]`),this.errors=u}}function n(o){return typeof o.dispose=="function"&&o.dispose.length===0}function t(o){if(B.$.is(o)){let u=[];for(const c of o)if(c)try{c.dispose()}catch(_){u.push(_)}if(u.length===1)throw u[0];if(u.length>1)throw new s(u);return Array.isArray(o)?[]:o}else if(o)return o.dispose(),o}function r(...o){const u=i(()=>t(o));return e(o,u),u}function i(o){const u=P({dispose:(0,N.I)(()=>{T(u),o()})});return u}class a{constructor(){this._toDispose=new Set,this._isDisposed=!1,P(this)}dispose(){this._isDisposed||(T(this),this._isDisposed=!0,this.clear())}clear(){try{t(this._toDispose.values())}finally{this._toDispose.clear()}}add(u){if(!u)return u;if(u===this)throw new Error("Cannot register a disposable on itself!");return b(u,this),this._isDisposed?a.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(u),u}}a.DISABLE_DISPOSED_WARNING=!1;class v{constructor(){this._store=new a,P(this),b(this._store,this)}dispose(){T(this),this._store.dispose()}_register(u){if(u===this)throw new Error("Cannot register a disposable on itself!");return this._store.add(u)}}v.None=Object.freeze({dispose(){}});class p{constructor(){this._isDisposed=!1,P(this)}get value(){return this._isDisposed?void 0:this._value}set value(u){var c;this._isDisposed||u===this._value||((c=this._value)===null||c===void 0||c.dispose(),u&&b(u,this),this._value=u)}clear(){this.value=void 0}dispose(){var u;this._isDisposed=!0,T(this),(u=this._value)===null||u===void 0||u.dispose(),this._value=void 0}clearAndLeak(){const u=this._value;return this._value=void 0,u&&b(u,null),u}}class l{constructor(u){this.object=u}dispose(){}}},91741:function(Ge,re,M){"use strict";M.d(re,{S:function(){return B}});class N{constructor(k){this.element=k,this.next=N.Undefined,this.prev=N.Undefined}}N.Undefined=new N(void 0);class B{constructor(){this._first=N.Undefined,this._last=N.Undefined,this._size=0}get size(){return this._size}isEmpty(){return this._first===N.Undefined}clear(){let k=this._first;for(;k!==N.Undefined;){const S=k.next;k.prev=N.Undefined,k.next=N.Undefined,k=S}this._first=N.Undefined,this._last=N.Undefined,this._size=0}unshift(k){return this._insert(k,!1)}push(k){return this._insert(k,!0)}_insert(k,S){const P=new N(k);if(this._first===N.Undefined)this._first=P,this._last=P;else if(S){const b=this._last;this._last=P,P.prev=b,b.next=P}else{const b=this._first;this._first=P,P.next=b,b.prev=P}this._size+=1;let T=!1;return()=>{T||(T=!0,this._remove(P))}}shift(){if(this._first!==N.Undefined){const k=this._first.element;return this._remove(this._first),k}}pop(){if(this._last!==N.Undefined){const k=this._last.element;return this._remove(this._last),k}}_remove(k){if(k.prev!==N.Undefined&&k.next!==N.Undefined){const S=k.prev;S.next=k.next,k.next.prev=S}else k.prev===N.Undefined&&k.next===N.Undefined?(this._first=N.Undefined,this._last=N.Undefined):k.next===N.Undefined?(this._last=this._last.prev,this._last.next=N.Undefined):k.prev===N.Undefined&&(this._first=this._first.next,this._first.prev=N.Undefined);this._size-=1}*[Symbol.iterator](){let k=this._first;for(;k!==N.Undefined;)yield k.element,k=k.next}}},1432:function(Ge,re,M){"use strict";M.d(re,{$L:function(){return _},ED:function(){return l},IJ:function(){return u},OS:function(){return L},WE:function(){return f},dz:function(){return o},gn:function(){return y},li:function(){return i},r:function(){return g},tY:function(){return c},xS:function(){return C}});var N=M(34155),B;const U="en";let k=!1,S=!1,P=!1,T=!1,b=!1,e=!1,E=!1,s,n=null,t=null,r;const i=typeof self=="object"?self:typeof M.g=="object"?M.g:{};let a;typeof i.vscode!="undefined"&&typeof i.vscode.process!="undefined"?a=i.vscode.process:typeof N!="undefined"&&(a=N);const v=typeof((B=a==null?void 0:a.versions)===null||B===void 0?void 0:B.electron)=="string"&&a.type==="renderer";if(typeof navigator=="object"&&!v)r=navigator.userAgent,k=r.indexOf("Windows")>=0,S=r.indexOf("Macintosh")>=0,E=(r.indexOf("Macintosh")>=0||r.indexOf("iPad")>=0||r.indexOf("iPhone")>=0)&&!!navigator.maxTouchPoints&&navigator.maxTouchPoints>0,P=r.indexOf("Linux")>=0,e=!0,s=navigator.language,n=s;else if(typeof a=="object"){k=a.platform==="win32",S=a.platform==="darwin",P=a.platform==="linux",T=P&&!!a.env.SNAP&&!!a.env.SNAP_REVISION,s=U,n=U;const m=a.env.VSCODE_NLS_CONFIG;if(m)try{const d=JSON.parse(m),h=d.availableLanguages["*"];s=d.locale,n=h||U,t=d._translationsConfigFile}catch(d){}b=!0}else console.error("Unable to resolve platform.");let p=0;S?p=1:k?p=3:P&&(p=2);const l=k,o=S,u=P,c=b,_=e,y=E,f=r,C=function(){if(i.setImmediate)return i.setImmediate.bind(i);if(typeof i.postMessage=="function"&&!i.importScripts){let h=[];i.addEventListener("message",w=>{if(w.data&&w.data.vscodeSetImmediateId)for(let x=0,D=h.length;x<D;x++){const I=h[x];if(I.id===w.data.vscodeSetImmediateId){h.splice(x,1),I.callback();return}}});let A=0;return w=>{const x=++A;h.push({id:x,callback:w}),i.postMessage({vscodeSetImmediateId:x},"*")}}if(typeof(a==null?void 0:a.nextTick)=="function")return a.nextTick.bind(a);const d=Promise.resolve();return h=>d.then(h)}(),L=S||E?2:k?1:3;let R=!0,O=!1;function g(){if(!O){O=!0;const m=new Uint8Array(2);m[0]=1,m[1]=2,R=new Uint16Array(m.buffer)[0]===513}return R}},84013:function(Ge,re,M){"use strict";M.d(re,{G:function(){return U}});var N=M(1432);const B=N.li.performance&&typeof N.li.performance.now=="function";class U{constructor(S){this._highResolution=B&&S,this._startTime=this._now(),this._stopTime=-1}static create(S=!0){return new U(S)}stop(){this._stopTime=this._now()}elapsed(){return this._stopTime!==-1?this._stopTime-this._startTime:this._now()-this._startTime}_now(){return this._highResolution?N.li.performance.now():Date.now()}}},97295:function(Ge,re,M){"use strict";M.d(re,{$i:function(){return K},C8:function(){return Z},GF:function(){return s},HO:function(){return A},IO:function(){return n},K7:function(){return G},Kw:function(){return ee},LC:function(){return i},Mh:function(){return C},P1:function(){return L},PJ:function(){return ae},Qe:function(){return W},R1:function(){return E},RP:function(){return I},S6:function(){return _e},TT:function(){return l},Ut:function(){return x},V8:function(){return a},WU:function(){return U},YK:function(){return O},YU:function(){return k},ZG:function(){return R},ZH:function(){return m},ab:function(){return z},c1:function(){return Q},df:function(){return _},ec:function(){return S},fi:function(){return xe},fy:function(){return P},j3:function(){return T},j_:function(){return u},m5:function(){return N},mK:function(){return c},mr:function(){return t},oH:function(){return he},oL:function(){return b},ok:function(){return f},ow:function(){return v},qq:function(){return y},qu:function(){return p},rL:function(){return g},uS:function(){return ue},un:function(){return e},uq:function(){return r},vH:function(){return h},xe:function(){return j},zY:function(){return o}});function N(X){return!X||typeof X!="string"?!0:X.trim().length===0}const B=/{(\d+)}/g;function U(X,...te){return te.length===0?X:X.replace(B,function(pe,me){const be=parseInt(me,10);return isNaN(be)||be<0||be>=te.length?pe:te[be]})}function k(X){return X.replace(/[<>&]/g,function(te){switch(te){case"<":return"&lt;";case">":return"&gt;";case"&":return"&amp;";default:return te}})}function S(X){return X.replace(/[\\\{\}\*\+\?\|\^\$\.\[\]\(\)]/g,"\\$&")}function P(X,te=" "){const pe=T(X,te);return b(pe,te)}function T(X,te){if(!X||!te)return X;const pe=te.length;if(pe===0||X.length===0)return X;let me=0;for(;X.indexOf(te,me)===me;)me=me+pe;return X.substring(me)}function b(X,te){if(!X||!te)return X;const pe=te.length,me=X.length;if(pe===0||me===0)return X;let be=me,de=-1;for(;de=X.lastIndexOf(te,be-1),!(de===-1||de+pe!==be);){if(de===0)return"";be=de}return X.substring(0,be)}function e(X){return X.replace(/[\-\\\{\}\+\?\|\^\$\.\,\[\]\(\)\#\s]/g,"\\$&").replace(/[\*]/g,".*")}function E(X){return X.replace(/\*/g,"")}function s(X,te,pe={}){if(!X)throw new Error("Cannot create regex from empty string");te||(X=S(X)),pe.wholeWord&&(/\B/.test(X.charAt(0))||(X="\\b"+X),/\B/.test(X.charAt(X.length-1))||(X=X+"\\b"));let me="";return pe.global&&(me+="g"),pe.matchCase||(me+="i"),pe.multiline&&(me+="m"),pe.unicode&&(me+="u"),new RegExp(X,me)}function n(X){return X.source==="^"||X.source==="^$"||X.source==="$"||X.source==="^\\s*$"?!1:!!(X.exec("")&&X.lastIndex===0)}function t(X){return(X.global?"g":"")+(X.ignoreCase?"i":"")+(X.multiline?"m":"")+(X.unicode?"u":"")}function r(X){return X.split(/\r\n|\r|\n/)}function i(X){for(let te=0,pe=X.length;te<pe;te++){const me=X.charCodeAt(te);if(me!==32&&me!==9)return te}return-1}function a(X,te=0,pe=X.length){for(let me=te;me<pe;me++){const be=X.charCodeAt(me);if(be!==32&&be!==9)return X.substring(te,me)}return X.substring(te,pe)}function v(X,te=X.length-1){for(let pe=te;pe>=0;pe--){const me=X.charCodeAt(pe);if(me!==32&&me!==9)return pe}return-1}function p(X,te){return X<te?-1:X>te?1:0}function l(X,te,pe=0,me=X.length,be=0,de=te.length){for(;pe<me&&be<de;pe++,be++){let Le=X.charCodeAt(pe),Ae=te.charCodeAt(be);if(Le<Ae)return-1;if(Le>Ae)return 1}const Be=me-pe,we=de-be;return Be<we?-1:Be>we?1:0}function o(X,te){return u(X,te,0,X.length,0,te.length)}function u(X,te,pe=0,me=X.length,be=0,de=te.length){for(;pe<me&&be<de;pe++,be++){let Le=X.charCodeAt(pe),Ae=te.charCodeAt(be);if(Le===Ae)continue;if(Le>=128||Ae>=128)return l(X.toLowerCase(),te.toLowerCase(),pe,me,be,de);c(Le)&&(Le-=32),c(Ae)&&(Ae-=32);const Ve=Le-Ae;if(Ve!==0)return Ve}const Be=me-pe,we=de-be;return Be<we?-1:Be>we?1:0}function c(X){return X>=97&&X<=122}function _(X){return X>=65&&X<=90}function y(X,te){return X.length===te.length&&u(X,te)===0}function f(X,te){const pe=te.length;return te.length>X.length?!1:u(X,te,0,pe)===0}function C(X,te){let pe,me=Math.min(X.length,te.length);for(pe=0;pe<me;pe++)if(X.charCodeAt(pe)!==te.charCodeAt(pe))return pe;return me}function L(X,te){let pe,me=Math.min(X.length,te.length);const be=X.length-1,de=te.length-1;for(pe=0;pe<me;pe++)if(X.charCodeAt(be-pe)!==te.charCodeAt(de-pe))return pe;return me}function R(X){return 55296<=X&&X<=56319}function O(X){return 56320<=X&&X<=57343}function g(X,te){return(X-55296<<10)+(te-56320)+65536}function m(X,te,pe){const me=X.charCodeAt(pe);if(R(me)&&pe+1<te){const be=X.charCodeAt(pe+1);if(O(be))return g(me,be)}return me}function d(X,te){const pe=X.charCodeAt(te-1);if(O(pe)&&te>1){const me=X.charCodeAt(te-2);if(R(me))return g(me,pe)}return pe}function h(X,te){const pe=ge.getInstance(),me=te,be=X.length,de=m(X,be,te);te+=de>=65536?2:1;let Be=pe.getGraphemeBreakType(de);for(;te<be;){const we=m(X,be,te),Le=pe.getGraphemeBreakType(we);if(xe(Be,Le))break;te+=we>=65536?2:1,Be=Le}return te-me}function A(X,te){const pe=ge.getInstance(),me=te,be=d(X,te);te-=be>=65536?2:1;let de=pe.getGraphemeBreakType(be);for(;te>0;){const Be=d(X,te),we=pe.getGraphemeBreakType(Be);if(xe(we,de))break;te-=Be>=65536?2:1,de=we}return me-te}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 x(X){return w.test(X)}const D=/(?:[\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 I(X){return D.test(X)}const F=/^[\t\n\r\x20-\x7E]*$/;function K(X){return F.test(X)}const W=/[\u2028\u2029]/;function z(X){return W.test(X)}function j(X){for(let te=0,pe=X.length;te<pe;te++)if(G(X.charCodeAt(te)))return!0;return!1}function G(X){return X=+X,X>=11904&&X<=55215||X>=63744&&X<=64255||X>=65281&&X<=65374}function Z(X){return X>=127462&&X<=127487||X===8986||X===8987||X===9200||X===9203||X>=9728&&X<=10175||X===11088||X===11093||X>=127744&&X<=128591||X>=128640&&X<=128764||X>=128992&&X<=129003||X>=129280&&X<=129535||X>=129648&&X<=129750}const Q="\uFEFF";function ue(X){return!!(X&&X.length>0&&X.charCodeAt(0)===65279)}function ee(X,te=!1){return X?(te&&(X=X.replace(/\\./g,"")),X.toLowerCase()!==X):!1}function ae(X){return X=X%(2*26),X<26?String.fromCharCode(97+X):String.fromCharCode(65+X-26)}function _e(X){return ge.getInstance().getGraphemeBreakType(X)}function xe(X,te){return X===0?te!==5&&te!==7:X===2&&te===3?!1:X===4||X===2||X===3||te===4||te===2||te===3?!0:!(X===8&&(te===8||te===9||te===11||te===12)||(X===11||X===9)&&(te===9||te===10)||(X===12||X===10)&&te===10||te===5||te===13||te===7||X===1||X===13&&te===14||X===6&&te===6)}class ge{constructor(){this._data=ce()}static getInstance(){return ge._INSTANCE||(ge._INSTANCE=new ge),ge._INSTANCE}getGraphemeBreakType(te){if(te<32)return te===10?3:te===13?2:4;if(te<127)return 0;const pe=this._data,me=pe.length/3;let be=1;for(;be<=me;)if(te<pe[3*be])be=2*be;else if(te>pe[3*be+1])be=2*be+1;else return pe[3*be+2];return 0}}ge._INSTANCE=null;function ce(){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 he(X,te){if(X===0)return 0;const pe=Se(X,te);if(pe!==void 0)return pe;const me=d(te,X);return X-=Te(me),X}function Se(X,te){let pe=d(te,X);for(X-=Te(pe);ke(pe)||pe===65039||pe===8419;){if(X===0)return;pe=d(te,X),X-=Te(pe)}if(Z(pe)){if(X>=0){const me=d(te,X);me===8205&&(X-=Te(me))}return X}}function Te(X){return X>=65536?2:1}function ke(X){return 127995<=X&&X<=127999}},98401:function(Ge,re,M){"use strict";M.d(re,{$E:function(){return i},$K:function(){return T},D8:function(){return n},HD:function(){return B},IU:function(){return a},Jp:function(){return b},Kn:function(){return U},cW:function(){return E},f6:function(){return v},hj:function(){return k},jn:function(){return S},kJ:function(){return N},mf:function(){return s},o8:function(){return P},p_:function(){return e},vE:function(){return p}});function N(l){return Array.isArray(l)}function B(l){return typeof l=="string"}function U(l){return typeof l=="object"&&l!==null&&!Array.isArray(l)&&!(l instanceof RegExp)&&!(l instanceof Date)}function k(l){return typeof l=="number"&&!isNaN(l)}function S(l){return l===!0||l===!1}function P(l){return typeof l=="undefined"}function T(l){return!b(l)}function b(l){return P(l)||l===null}function e(l,o){if(!l)throw new Error(o?`Unexpected type, expected '${o}'`:"Unexpected type")}function E(l){if(b(l))throw new Error("Assertion Failed: argument is undefined or null");return l}function s(l){return typeof l=="function"}function n(l,o){const u=Math.min(l.length,o.length);for(let c=0;c<u;c++)t(l[c],o[c])}function t(l,o){if(B(o)){if(typeof l!==o)throw new Error(`argument does not match constraint: typeof ${o}`)}else if(s(o)){try{if(l instanceof o)return}catch(u){}if(!b(l)&&l.constructor===o||o.length===1&&o.call(void 0,l)===!0)return;throw new Error("argument does not match one of these constraints: arg instanceof constraint, arg.constructor === constraint, nor constraint(arg) === true")}}function r(l){let o=[],u=Object.getPrototypeOf(l);for(;Object.prototype!==u;)o=o.concat(Object.getOwnPropertyNames(u)),u=Object.getPrototypeOf(u);return o}function i(l){const o=[];for(const u of r(l))typeof l[u]=="function"&&o.push(u);return o}function a(l,o){const u=_=>function(){const y=Array.prototype.slice.call(arguments,0);return o(_,y)};let c={};for(const _ of l)c[_]=u(_);return c}function v(l){return l===null?void 0:l}function p(l,o="Unreachable"){throw new Error(o)}},63580:function(Ge,re,M){"use strict";M.d(re,{N:function(){return B}});function N(U,k){let S;return k.length===0?S=U:S=U.replace(/\{(\d+)\}/g,function(P,T){const b=T[0];return typeof k[b]!="undefined"?k[b]:P}),S}function B(U,k,...S){return N(k,S)}},84144:function(Ge,re,M){"use strict";M.d(re,{BH:function(){return a},NZ:function(){return v},U8:function(){return p},co:function(){return i},eH:function(){return r},vr:function(){return t}});var N=M(74741),B=M(73046),U=M(4669),k=M(53725),S=M(9917),P=M(91741),T=M(94565),b=M(38819),e=M(72065),E=M(97781),s=function(l,o,u,c){var _=arguments.length,y=_<3?o:c===null?c=Object.getOwnPropertyDescriptor(o,u):c,f;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(l,o,u,c);else for(var C=l.length-1;C>=0;C--)(f=l[C])&&(y=(_<3?f(y):_>3?f(o,u,y):f(o,u))||y);return _>3&&y&&Object.defineProperty(o,u,y),y},n=function(l,o){return function(u,c){o(u,c,l)}};function t(l){return l.command!==void 0}class r{constructor(o){this.id=r._idPool++,this._debugName=o}}r._idPool=0,r.CommandPalette=new r("CommandPalette"),r.EditorContext=new r("EditorContext"),r.SimpleEditorContext=new r("SimpleEditorContext"),r.EditorContextCopy=new r("EditorContextCopy"),r.EditorContextPeek=new r("EditorContextPeek"),r.MenubarEditMenu=new r("MenubarEditMenu"),r.MenubarCopy=new r("MenubarCopy"),r.MenubarGoMenu=new r("MenubarGoMenu"),r.MenubarSelectionMenu=new r("MenubarSelectionMenu"),r.InlineCompletionsActions=new r("InlineCompletionsActions");const i=(0,e.yh)("menuService"),a=new class{constructor(){this._commands=new Map,this._menuItems=new Map,this._onDidChangeMenu=new U.Q5,this.onDidChangeMenu=this._onDidChangeMenu.event,this._commandPaletteChangeEvent={has:l=>l===r.CommandPalette}}addCommand(l){return this.addCommands(k.$.single(l))}addCommands(l){for(const o of l)this._commands.set(o.id,o);return this._onDidChangeMenu.fire(this._commandPaletteChangeEvent),(0,S.OF)(()=>{let o=!1;for(const u of l)o=this._commands.delete(u.id)||o;o&&this._onDidChangeMenu.fire(this._commandPaletteChangeEvent)})}getCommand(l){return this._commands.get(l)}getCommands(){const l=new Map;return this._commands.forEach((o,u)=>l.set(u,o)),l}appendMenuItem(l,o){return this.appendMenuItems(k.$.single({id:l,item:o}))}appendMenuItems(l){const o=new Set,u=new P.S;for(const{id:c,item:_}of l){let y=this._menuItems.get(c);y||(y=new P.S,this._menuItems.set(c,y)),u.push(y.push(_)),o.add(c)}return this._onDidChangeMenu.fire(o),(0,S.OF)(()=>{if(u.size>0){for(let c of u)c();this._onDidChangeMenu.fire(o),u.clear()}})}getMenuItems(l){let o;return this._menuItems.has(l)?o=[...this._menuItems.get(l)]:o=[],l===r.CommandPalette&&this._appendImplicitItems(o),o}_appendImplicitItems(l){const o=new Set;for(const u of l)t(u)&&(o.add(u.command.id),u.alt&&o.add(u.alt.id));this._commands.forEach((u,c)=>{o.has(c)||l.push({command:u})})}};class v extends N.wY{constructor(o,u,c,_){super(`submenuitem.${o.submenu.id}`,typeof o.title=="string"?o.title:o.title.value,[],"submenu"),this.item=o,this._menuService=u,this._contextKeyService=c,this._options=_}get actions(){const o=[],u=this._menuService.createMenu(this.item.submenu,this._contextKeyService),c=u.getActions(this._options);u.dispose();for(const[,_]of c)_.length>0&&(o.push(..._),o.push(new N.Z0));return o.length&&o.pop(),o}}let p=class Mi{constructor(o,u,c,_,y){var f,C;if(this._commandService=y,this.id=o.id,this.label=c!=null&&c.renderShortTitle&&o.shortTitle?typeof o.shortTitle=="string"?o.shortTitle:o.shortTitle.value:typeof o.title=="string"?o.title:o.title.value,this.tooltip=(C=typeof o.tooltip=="string"?o.tooltip:(f=o.tooltip)===null||f===void 0?void 0:f.value)!==null&&C!==void 0?C:"",this.enabled=!o.precondition||_.contextMatchesRules(o.precondition),this.checked=void 0,o.toggled){const L=o.toggled.condition?o.toggled:{condition:o.toggled};this.checked=_.contextMatchesRules(L.condition),this.checked&&L.tooltip&&(this.tooltip=typeof L.tooltip=="string"?L.tooltip:L.tooltip.value),L.title&&(this.label=typeof L.title=="string"?L.title:L.title.value)}this.item=o,this.alt=u?new Mi(u,void 0,c,_,y):void 0,this._options=c,E.kS.isThemeIcon(o.icon)&&(this.class=B.dT.asClassName(o.icon))}dispose(){}run(...o){var u,c;let _=[];return!((u=this._options)===null||u===void 0)&&u.arg&&(_=[..._,this._options.arg]),!((c=this._options)===null||c===void 0)&&c.shouldForwardArgs&&(_=[..._,...o]),this._commandService.executeCommand(this.id,..._)}};p=s([n(3,b.i6),n(4,T.H)],p)},94565:function(Ge,re,M){"use strict";M.d(re,{H:function(){return T},P:function(){return b}});var N=M(4669),B=M(53725),U=M(9917),k=M(91741),S=M(98401),P=M(72065);const T=(0,P.yh)("commandService"),b=new class{constructor(){this._commands=new Map,this._onDidRegisterCommand=new N.Q5,this.onDidRegisterCommand=this._onDidRegisterCommand.event}registerCommand(e,E){if(!e)throw new Error("invalid command");if(typeof e=="string"){if(!E)throw new Error("invalid command");return this.registerCommand({id:e,handler:E})}if(e.description){const i=[];for(let v of e.description.args)i.push(v.constraint);const a=e.handler;e.handler=function(v,...p){return(0,S.D8)(p,i),a(v,...p)}}const{id:s}=e;let n=this._commands.get(s);n||(n=new k.S,this._commands.set(s,n));let t=n.unshift(e),r=(0,U.OF)(()=>{t();const i=this._commands.get(s);i!=null&&i.isEmpty()&&this._commands.delete(s)});return this._onDidRegisterCommand.fire(s),r}registerCommandAlias(e,E){return b.registerCommand(e,(s,...n)=>s.get(T).executeCommand(E,...n))}getCommand(e){const E=this._commands.get(e);if(!(!E||E.isEmpty()))return B.$.first(E)}getCommands(){const e=new Map;for(const E of this._commands.keys()){const s=this.getCommand(E);s&&e.set(E,s)}return e}};b.registerCommand("noop",()=>{})},38819:function(Ge,re,M){"use strict";M.d(re,{Ao:function(){return T},Eq:function(){return g},Fb:function(){return b},K8:function(){return h},i6:function(){return O},uy:function(){return R}});var N=M(1432),B=M(97295),U=M(72065);let k=N.WE||"";const S=new Map;S.set("false",!1),S.set("true",!0),S.set("isMac",N.dz),S.set("isLinux",N.IJ),S.set("isWindows",N.ED),S.set("isWeb",N.$L),S.set("isMacNative",N.dz&&!N.$L),S.set("isEdge",k.indexOf("Edg/")>=0),S.set("isFirefox",k.indexOf("Firefox")>=0),S.set("isChrome",k.indexOf("Chrome")>=0),S.set("isSafari",k.indexOf("Safari")>=0);const P=Object.prototype.hasOwnProperty;class T{static has(x){return n.create(x)}static equals(x,D){return t.create(x,D)}static regex(x,D){return _.create(x,D)}static not(x){return v.create(x)}static and(...x){return C.create(x,null)}static or(...x){return L.create(x,null,!0)}static deserialize(x,D=!1){if(x)return this._deserializeOrExpression(x,D)}static _deserializeOrExpression(x,D){let I=x.split("||");return L.create(I.map(F=>this._deserializeAndExpression(F,D)),null,!0)}static _deserializeAndExpression(x,D){let I=x.split("&&");return C.create(I.map(F=>this._deserializeOne(F,D)),null)}static _deserializeOne(x,D){if(x=x.trim(),x.indexOf("!=")>=0){let I=x.split("!=");return a.create(I[0].trim(),this._deserializeValue(I[1],D))}if(x.indexOf("==")>=0){let I=x.split("==");return t.create(I[0].trim(),this._deserializeValue(I[1],D))}if(x.indexOf("=~")>=0){let I=x.split("=~");return _.create(I[0].trim(),this._deserializeRegexValue(I[1],D))}if(x.indexOf(" in ")>=0){let I=x.split(" in ");return r.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>=[^<=>]+$/.test(x)){const I=x.split(">=");return o.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+>[^<=>]+$/.test(x)){const I=x.split(">");return l.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<=[^<=>]+$/.test(x)){const I=x.split("<=");return c.create(I[0].trim(),I[1].trim())}if(/^[^<=>]+<[^<=>]+$/.test(x)){const I=x.split("<");return u.create(I[0].trim(),I[1].trim())}return/^\!\s*/.test(x)?v.create(x.substr(1).trim()):n.create(x)}static _deserializeValue(x,D){if(x=x.trim(),x==="true")return!0;if(x==="false")return!1;let I=/^'([^']*)'$/.exec(x);return I?I[1].trim():x}static _deserializeRegexValue(x,D){if((0,B.m5)(x)){if(D)throw new Error("missing regexp-value for =~-expression");return console.warn("missing regexp-value for =~-expression"),null}let I=x.indexOf("/"),F=x.lastIndexOf("/");if(I===F||I<0){if(D)throw new Error(`bad regexp-value '${x}', missing /-enclosure`);return console.warn(`bad regexp-value '${x}', missing /-enclosure`),null}let K=x.slice(I+1,F),W=x[F+1]==="i"?"i":"";try{return new RegExp(K,W)}catch(z){if(D)throw new Error(`bad regexp-value '${x}', parse error: ${z}`);return console.warn(`bad regexp-value '${x}', parse error: ${z}`),null}}}function b(w,x){const D=w?w.substituteConstants():void 0,I=x?x.substituteConstants():void 0;return!D&&!I?!0:!D||!I?!1:D.equals(I)}function e(w,x){return w.cmp(x)}class E{constructor(){this.type=0}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!1}serialize(){return"false"}keys(){return[]}negate(){return s.INSTANCE}}E.INSTANCE=new E;class s{constructor(){this.type=1}cmp(x){return this.type-x.type}equals(x){return x.type===this.type}substituteConstants(){return this}evaluate(x){return!0}serialize(){return"true"}keys(){return[]}negate(){return E.INSTANCE}}s.INSTANCE=new s;class n{constructor(x,D){this.key=x,this.negated=D,this.type=2}static create(x,D=null){const I=S.get(x);return typeof I=="boolean"?I?s.INSTANCE:E.INSTANCE:new n(x,D)}cmp(x){return x.type!==this.type?this.type-x.type:m(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=S.get(this.key);return typeof x=="boolean"?x?s.INSTANCE:E.INSTANCE:this}evaluate(x){return!!x.getValue(this.key)}serialize(){return this.key}keys(){return[this.key]}negate(){return this.negated||(this.negated=v.create(this.key,this)),this.negated}}class t{constructor(x,D,I){this.key=x,this.value=D,this.negated=I,this.type=4}static create(x,D,I=null){if(typeof D=="boolean")return D?n.create(x,I):v.create(x,I);const F=S.get(x);return typeof F=="boolean"?D===(F?"true":"false")?s.INSTANCE:E.INSTANCE:new t(x,D,I)}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=S.get(this.key);if(typeof x=="boolean"){const D=x?"true":"false";return this.value===D?s.INSTANCE:E.INSTANCE}return this}evaluate(x){return x.getValue(this.key)==this.value}serialize(){return`${this.key} == '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=a.create(this.key,this.value,this)),this.negated}}class r{constructor(x,D){this.key=x,this.valueKey=D,this.type=10,this.negated=null}static create(x,D){return new r(x,D)}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.valueKey,x.key,x.valueKey)}equals(x){return x.type===this.type?this.key===x.key&&this.valueKey===x.valueKey:!1}substituteConstants(){return this}evaluate(x){const D=x.getValue(this.valueKey),I=x.getValue(this.key);return Array.isArray(D)?D.indexOf(I)>=0:typeof I=="string"&&typeof D=="object"&&D!==null?P.call(D,I):!1}serialize(){return`${this.key} in '${this.valueKey}'`}keys(){return[this.key,this.valueKey]}negate(){return this.negated||(this.negated=i.create(this)),this.negated}}class i{constructor(x){this._actual=x,this.type=11}static create(x){return new i(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}class a{constructor(x,D,I){this.key=x,this.value=D,this.negated=I,this.type=5}static create(x,D,I=null){if(typeof D=="boolean")return D?v.create(x,I):n.create(x,I);const F=S.get(x);return typeof F=="boolean"?D===(F?"true":"false")?E.INSTANCE:s.INSTANCE:new a(x,D,I)}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){const x=S.get(this.key);if(typeof x=="boolean"){const D=x?"true":"false";return this.value===D?E.INSTANCE:s.INSTANCE}return this}evaluate(x){return x.getValue(this.key)!=this.value}serialize(){return`${this.key} != '${this.value}'`}keys(){return[this.key]}negate(){return this.negated||(this.negated=t.create(this.key,this.value,this)),this.negated}}class v{constructor(x,D){this.key=x,this.negated=D,this.type=3}static create(x,D=null){const I=S.get(x);return typeof I=="boolean"?I?E.INSTANCE:s.INSTANCE:new v(x,D)}cmp(x){return x.type!==this.type?this.type-x.type:m(this.key,x.key)}equals(x){return x.type===this.type?this.key===x.key:!1}substituteConstants(){const x=S.get(this.key);return typeof x=="boolean"?x?E.INSTANCE:s.INSTANCE:this}evaluate(x){return!x.getValue(this.key)}serialize(){return`!${this.key}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=n.create(this.key,this)),this.negated}}function p(w,x){if(typeof w=="string"){const D=parseFloat(w);isNaN(D)||(w=D)}return typeof w=="string"||typeof w=="number"?x(w):E.INSTANCE}class l{constructor(x,D,I){this.key=x,this.value=D,this.negated=I,this.type=12}static create(x,D,I=null){return p(D,F=>new l(x,F,I))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>this.value}serialize(){return`${this.key} > ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=c.create(this.key,this.value,this)),this.negated}}class o{constructor(x,D,I){this.key=x,this.value=D,this.negated=I,this.type=13}static create(x,D,I=null){return p(D,F=>new o(x,F,I))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))>=this.value}serialize(){return`${this.key} >= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=u.create(this.key,this.value,this)),this.negated}}class u{constructor(x,D,I){this.key=x,this.value=D,this.negated=I,this.type=14}static create(x,D,I=null){return p(D,F=>new u(x,F,I))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<this.value}serialize(){return`${this.key} < ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=o.create(this.key,this.value,this)),this.negated}}class c{constructor(x,D,I){this.key=x,this.value=D,this.negated=I,this.type=15}static create(x,D,I=null){return p(D,F=>new c(x,F,I))}cmp(x){return x.type!==this.type?this.type-x.type:d(this.key,this.value,x.key,x.value)}equals(x){return x.type===this.type?this.key===x.key&&this.value===x.value:!1}substituteConstants(){return this}evaluate(x){return typeof this.value=="string"?!1:parseFloat(x.getValue(this.key))<=this.value}serialize(){return`${this.key} <= ${this.value}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=l.create(this.key,this.value,this)),this.negated}}class _{constructor(x,D){this.key=x,this.regexp=D,this.type=7,this.negated=null}static create(x,D){return new _(x,D)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.key<x.key)return-1;if(this.key>x.key)return 1;const D=this.regexp?this.regexp.source:"",I=x.regexp?x.regexp.source:"";return D<I?-1:D>I?1:0}equals(x){if(x.type===this.type){const D=this.regexp?this.regexp.source:"",I=x.regexp?x.regexp.source:"";return this.key===x.key&&D===I}return!1}substituteConstants(){return this}evaluate(x){let D=x.getValue(this.key);return this.regexp?this.regexp.test(D):!1}serialize(){const x=this.regexp?`/${this.regexp.source}/${this.regexp.ignoreCase?"i":""}`:"/invalid/";return`${this.key} =~ ${x}`}keys(){return[this.key]}negate(){return this.negated||(this.negated=y.create(this)),this.negated}}class y{constructor(x){this._actual=x,this.type=8}static create(x){return new y(x)}cmp(x){return x.type!==this.type?this.type-x.type:this._actual.cmp(x._actual)}equals(x){return x.type===this.type?this._actual.equals(x._actual):!1}substituteConstants(){return this}evaluate(x){return!this._actual.evaluate(x)}serialize(){throw new Error("Method not implemented.")}keys(){return this._actual.keys()}negate(){return this._actual}}function f(w){let x=null;for(let D=0,I=w.length;D<I;D++){const F=w[D].substituteConstants();if(w[D]!==F&&x===null){x=[];for(let K=0;K<D;K++)x[K]=w[K]}x!==null&&(x[D]=F)}return x===null?w:x}class C{constructor(x,D){this.expr=x,this.negated=D,this.type=6}static create(x,D){return C._normalizeArr(x,D)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let D=0,I=this.expr.length;D<I;D++){const F=e(this.expr[D],x.expr[D]);if(F!==0)return F}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let D=0,I=this.expr.length;D<I;D++)if(!this.expr[D].equals(x.expr[D]))return!1;return!0}return!1}substituteConstants(){const x=f(this.expr);return x===this.expr?this:C.create(x,this.negated)}evaluate(x){for(let D=0,I=this.expr.length;D<I;D++)if(!this.expr[D].evaluate(x))return!1;return!0}static _normalizeArr(x,D){const I=[];let F=!1;for(const K of x)if(K){if(K.type===1){F=!0;continue}if(K.type===0)return E.INSTANCE;if(K.type===6){I.push(...K.expr);continue}I.push(K)}if(I.length===0&&F)return s.INSTANCE;if(I.length!==0){if(I.length===1)return I[0];I.sort(e);for(let K=1;K<I.length;K++)I[K-1].equals(I[K])&&(I.splice(K,1),K--);if(I.length===1)return I[0];for(;I.length>1;){const K=I[I.length-1];if(K.type!==9)break;I.pop();const W=I.pop(),z=I.length===0,j=L.create(K.expr.map(G=>C.create([G,W],null)),null,z);j&&(I.push(j),I.sort(e))}return I.length===1?I[0]:new C(I,D)}}serialize(){return this.expr.map(x=>x.serialize()).join(" && ")}keys(){const x=[];for(let D of this.expr)x.push(...D.keys());return x}negate(){if(!this.negated){const x=[];for(let D of this.expr)x.push(D.negate());this.negated=L.create(x,this,!0)}return this.negated}}class L{constructor(x,D){this.expr=x,this.negated=D,this.type=9}static create(x,D,I){return L._normalizeArr(x,D,I)}cmp(x){if(x.type!==this.type)return this.type-x.type;if(this.expr.length<x.expr.length)return-1;if(this.expr.length>x.expr.length)return 1;for(let D=0,I=this.expr.length;D<I;D++){const F=e(this.expr[D],x.expr[D]);if(F!==0)return F}return 0}equals(x){if(x.type===this.type){if(this.expr.length!==x.expr.length)return!1;for(let D=0,I=this.expr.length;D<I;D++)if(!this.expr[D].equals(x.expr[D]))return!1;return!0}return!1}substituteConstants(){const x=f(this.expr);return x===this.expr?this:L.create(x,this.negated,!1)}evaluate(x){for(let D=0,I=this.expr.length;D<I;D++)if(this.expr[D].evaluate(x))return!0;return!1}static _normalizeArr(x,D,I){let F=[],K=!1;if(x){for(let W=0,z=x.length;W<z;W++){const j=x[W];if(j){if(j.type===0){K=!0;continue}if(j.type===1)return s.INSTANCE;if(j.type===9){F=F.concat(j.expr);continue}F.push(j)}}if(F.length===0&&K)return E.INSTANCE;F.sort(e)}if(F.length!==0){if(F.length===1)return F[0];for(let W=1;W<F.length;W++)F[W-1].equals(F[W])&&(F.splice(W,1),W--);if(F.length===1)return F[0];if(I){for(let W=0;W<F.length;W++)for(let z=W+1;z<F.length;z++)h(F[W],F[z])&&(F.splice(z,1),z--);if(F.length===1)return F[0]}return new L(F,D)}}serialize(){return this.expr.map(x=>x.serialize()).join(" || ")}keys(){const x=[];for(let D of this.expr)x.push(...D.keys());return x}negate(){if(!this.negated){let x=[];for(let D of this.expr)x.push(D.negate());for(;x.length>1;){const D=x.shift(),I=x.shift(),F=[];for(const W of A(D))for(const z of A(I))F.push(C.create([W,z],null));const K=x.length===0;x.unshift(L.create(F,null,K))}this.negated=x[0]}return this.negated}}class R extends n{constructor(x,D,I){super(x,null),this._defaultValue=D,typeof I=="object"?R._info.push(Object.assign(Object.assign({},I),{key:x})):I!==!0&&R._info.push({key:x,description:I,type:D!=null?typeof D:void 0})}static all(){return R._info.values()}bindTo(x){return x.createKey(this.key,this._defaultValue)}getValue(x){return x.getContextKeyValue(this.key)}toNegated(){return this.negate()}isEqualTo(x){return t.create(this.key,x)}}R._info=[];const O=(0,U.yh)("contextKeyService"),g="setContext";function m(w,x){return w<x?-1:w>x?1:0}function d(w,x,D,I){return w<D?-1:w>D?1:x<I?-1:x>I?1:0}function h(w,x){if(x.type===6&&w.type!==9&&w.type!==6){for(const F of x.expr)if(w.equals(F))return!0}const D=w.negate(),I=A(D).concat(A(x));I.sort(e);for(let F=0;F<I.length;F++){const W=I[F].negate();for(let z=F+1;z<I.length;z++){const j=I[z];if(W.equals(j))return!0}}return!1}function A(w){return w.type===9?w.expr:[w]}},72065:function(Ge,re,M){"use strict";M.d(re,{I8:function(){return N},TG:function(){return B},jt:function(){return S},yh:function(){return k}});var N;(function(P){P.serviceIds=new Map,P.DI_TARGET="$di$target",P.DI_DEPENDENCIES="$di$dependencies";function T(b){return b[P.DI_DEPENDENCIES]||[]}P.getServiceDependencies=T})(N||(N={}));const B=k("instantiationService");function U(P,T,b,e){T[N.DI_TARGET]===T?T[N.DI_DEPENDENCIES].push({id:P,index:b,optional:e}):(T[N.DI_DEPENDENCIES]=[{id:P,index:b,optional:e}],T[N.DI_TARGET]=T)}function k(P){if(N.serviceIds.has(P))return N.serviceIds.get(P);const T=function(b,e,E){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");U(T,b,E,!1)};return T.toString=()=>P,N.serviceIds.set(P,T),T}function S(P){return function(T,b,e){if(arguments.length!==3)throw new Error("@optional-decorator can only be used to decorate a parameter");U(P,T,e,!0)}}},89872:function(Ge,re,M){"use strict";M.d(re,{B:function(){return k}});var N=M(35146),B=M(98401);class U{constructor(){this.data=new Map}add(P,T){N.ok(B.HD(P)),N.ok(B.Kn(T)),N.ok(!this.data.has(P),"There is already an extension with this id"),this.data.set(P,T)}as(P){return this.data.get(P)||null}}const k=new U},92321:function(Ge,re,M){"use strict";M.d(re,{e:function(){return N}});var N;(function(B){B.DARK="dark",B.LIGHT="light",B.HIGH_CONTRAST="hc"})(N||(N={}))},97781:function(Ge,re,M){"use strict";M.d(re,{EN:function(){return e},IP:function(){return n},Ic:function(){return i},XE:function(){return T},bB:function(){return a},kS:function(){return E},m6:function(){return s}});var N=M(73046),B=M(4669),U=M(9917),k=M(72065),S=M(89872),P=M(92321);const T=(0,k.yh)("themeService");var b;(function(v){function p(l){return l&&typeof l=="object"&&typeof l.id=="string"}v.isThemeColor=p})(b||(b={}));function e(v){return{id:v}}var E;(function(v){function p(y){return y&&typeof y=="object"&&typeof y.id=="string"&&(typeof y.color=="undefined"||b.isThemeColor(y.color))}v.isThemeIcon=p;const l=new RegExp(`^\\$\\((${N.dT.iconNameExpression}(?:${N.dT.iconModifierExpression})?)\\)$`);function o(y){const f=l.exec(y);if(!f)return;let[,C]=f;return{id:C}}v.fromString=o;function u(y,f){let C=y.id;const L=C.lastIndexOf("~");return L!==-1&&(C=C.substring(0,L)),f&&(C=`${C}~${f}`),{id:C}}v.modify=u;function c(y,f){var C,L;return y.id===f.id&&((C=y.color)===null||C===void 0?void 0:C.id)===((L=f.color)===null||L===void 0?void 0:L.id)}v.isEqual=c;function _(y,f){return{id:y.id,color:f?e(f):void 0}}v.asThemeIcon=_,v.asClassNameArray=N.dT.asClassNameArray,v.asClassName=N.dT.asClassName,v.asCSSSelector=N.dT.asCSSSelector})(E||(E={}));function s(v){switch(v){case P.e.DARK:return"vs-dark";case P.e.HIGH_CONTRAST:return"hc-black";default:return"vs"}}const n={ThemingContribution:"base.contributions.theming"};class t{constructor(){this.themingParticipants=[],this.themingParticipants=[],this.onThemingParticipantAddedEmitter=new B.Q5}onColorThemeChange(p){return this.themingParticipants.push(p),this.onThemingParticipantAddedEmitter.fire(p),(0,U.OF)(()=>{const l=this.themingParticipants.indexOf(p);this.themingParticipants.splice(l,1)})}getThemingParticipants(){return this.themingParticipants}}let r=new t;S.B.add(n.ThemingContribution,r);function i(v){return r.onColorThemeChange(v)}class a extends U.JT{constructor(p){super(),this.themeService=p,this.theme=p.getColorTheme(),this._register(this.themeService.onDidColorThemeChange(l=>this.onThemeChange(l)))}onThemeChange(p){this.theme=p,this.updateStyles()}updateStyles(){}}},82234:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return T}});var N=M(45987),B=M(1413),U=M(71002),k=M(67294),S=["show"];function P(b,e){if(!e.max)return!0;var E=e.strategy(b);return E<=e.max}function T(b,e){return k.useMemo(function(){var E={};e&&(E.show=(0,U.Z)(e)==="object"&&e.formatter?e.formatter:!!e),E=(0,B.Z)((0,B.Z)({},E),b);var s=E,n=s.show,t=(0,N.Z)(s,S);return(0,B.Z)((0,B.Z)({},t),{},{show:!!n,showFormatter:typeof n=="function"?n:void 0,strategy:t.strategy||function(r){return r.length}})},[b,e])}},67656:function(Ge,re,M){"use strict";M.r(re),M.d(re,{BaseInput:function(){return E},default:function(){return o}});var N=M(1413),B=M(87462),U=M(4942),k=M(71002),S=M(94184),P=M.n(S),T=M(67294),b=M(87887),e=T.forwardRef(function(u,c){var _,y,f,C=u.inputElement,L=u.children,R=u.prefixCls,O=u.prefix,g=u.suffix,m=u.addonBefore,d=u.addonAfter,h=u.className,A=u.style,w=u.disabled,x=u.readOnly,D=u.focused,I=u.triggerFocus,F=u.allowClear,K=u.value,W=u.handleReset,z=u.hidden,j=u.classes,G=u.classNames,Z=u.dataAttrs,Q=u.styles,ue=u.components,ee=u.onClear,ae=L!=null?L:C,_e=(ue==null?void 0:ue.affixWrapper)||"span",xe=(ue==null?void 0:ue.groupWrapper)||"span",ge=(ue==null?void 0:ue.wrapper)||"span",ce=(ue==null?void 0:ue.groupAddon)||"span",he=(0,T.useRef)(null),Se=function(Oe){var Fe;(Fe=he.current)!==null&&Fe!==void 0&&Fe.contains(Oe.target)&&(I==null||I())},Te=(0,b.X3)(u),ke=(0,T.cloneElement)(ae,{value:K,className:P()((_=ae.props)===null||_===void 0?void 0:_.className,!Te&&(G==null?void 0:G.variant))||null}),X=(0,T.useRef)(null);if(T.useImperativeHandle(c,function(){return{nativeElement:X.current||he.current}}),Te){var te=null;if(F){var pe=!w&&!x&&K,me="".concat(R,"-clear-icon"),be=(0,k.Z)(F)==="object"&&F!==null&&F!==void 0&&F.clearIcon?F.clearIcon:"\u2716";te=T.createElement("button",{type:"button",tabIndex:-1,onClick:function(Oe){W==null||W(Oe),ee==null||ee()},onMouseDown:function(Oe){return Oe.preventDefault()},className:P()(me,(0,U.Z)((0,U.Z)({},"".concat(me,"-hidden"),!pe),"".concat(me,"-has-suffix"),!!g))},be)}var de="".concat(R,"-affix-wrapper"),Be=P()(de,(0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)((0,U.Z)({},"".concat(R,"-disabled"),w),"".concat(de,"-disabled"),w),"".concat(de,"-focused"),D),"".concat(de,"-readonly"),x),"".concat(de,"-input-with-clear-btn"),g&&F&&K),j==null?void 0:j.affixWrapper,G==null?void 0:G.affixWrapper,G==null?void 0:G.variant),we=(g||F)&&T.createElement("span",{className:P()("".concat(R,"-suffix"),G==null?void 0:G.suffix),style:Q==null?void 0:Q.suffix},te,g);ke=T.createElement(_e,(0,B.Z)({className:Be,style:Q==null?void 0:Q.affixWrapper,onClick:Se},Z==null?void 0:Z.affixWrapper,{ref:he}),O&&T.createElement("span",{className:P()("".concat(R,"-prefix"),G==null?void 0:G.prefix),style:Q==null?void 0:Q.prefix},O),ke,we)}if((0,b.He)(u)){var Le="".concat(R,"-group"),Ae="".concat(Le,"-addon"),Ve="".concat(Le,"-wrapper"),De=P()("".concat(R,"-wrapper"),Le,j==null?void 0:j.wrapper,G==null?void 0:G.wrapper),ye=P()(Ve,(0,U.Z)({},"".concat(Ve,"-disabled"),w),j==null?void 0:j.group,G==null?void 0:G.groupWrapper);ke=T.createElement(xe,{className:ye,ref:X},T.createElement(ge,{className:De},m&&T.createElement(ce,{className:Ae},m),ke,d&&T.createElement(ce,{className:Ae},d)))}return T.cloneElement(ke,{className:P()((y=ke.props)===null||y===void 0?void 0:y.className,h)||null,style:(0,N.Z)((0,N.Z)({},(f=ke.props)===null||f===void 0?void 0:f.style),A),hidden:z})}),E=e,s=M(74902),n=M(97685),t=M(45987),r=M(21770),i=M(98423),a=M(82234),v=["autoComplete","onChange","onFocus","onBlur","onPressEnter","onKeyDown","onKeyUp","prefixCls","disabled","htmlSize","className","maxLength","suffix","showCount","count","type","classes","classNames","styles","onCompositionStart","onCompositionEnd"],p=(0,T.forwardRef)(function(u,c){var _=u.autoComplete,y=u.onChange,f=u.onFocus,C=u.onBlur,L=u.onPressEnter,R=u.onKeyDown,O=u.onKeyUp,g=u.prefixCls,m=g===void 0?"rc-input":g,d=u.disabled,h=u.htmlSize,A=u.className,w=u.maxLength,x=u.suffix,D=u.showCount,I=u.count,F=u.type,K=F===void 0?"text":F,W=u.classes,z=u.classNames,j=u.styles,G=u.onCompositionStart,Z=u.onCompositionEnd,Q=(0,t.Z)(u,v),ue=(0,T.useState)(!1),ee=(0,n.Z)(ue,2),ae=ee[0],_e=ee[1],xe=(0,T.useRef)(!1),ge=(0,T.useRef)(!1),ce=(0,T.useRef)(null),he=(0,T.useRef)(null),Se=function(Ze){ce.current&&(0,b.nH)(ce.current,Ze)},Te=(0,r.Z)(u.defaultValue,{value:u.value}),ke=(0,n.Z)(Te,2),X=ke[0],te=ke[1],pe=X==null?"":String(X),me=(0,T.useState)(null),be=(0,n.Z)(me,2),de=be[0],Be=be[1],we=(0,a.Z)(I,D),Le=we.max||w,Ae=we.strategy(pe),Ve=!!Le&&Ae>Le;(0,T.useImperativeHandle)(c,function(){var Pe;return{focus:Se,blur:function(){var se;(se=ce.current)===null||se===void 0||se.blur()},setSelectionRange:function(se,ie,le){var V;(V=ce.current)===null||V===void 0||V.setSelectionRange(se,ie,le)},select:function(){var se;(se=ce.current)===null||se===void 0||se.select()},input:ce.current,nativeElement:((Pe=he.current)===null||Pe===void 0?void 0:Pe.nativeElement)||ce.current}}),(0,T.useEffect)(function(){ge.current&&(ge.current=!1),_e(function(Pe){return Pe&&d?!1:Pe})},[d]);var De=function(Ze,se,ie){var le=se;if(!xe.current&&we.exceedFormatter&&we.max&&we.strategy(se)>we.max){if(le=we.exceedFormatter(se,{max:we.max}),se!==le){var V,J;Be([((V=ce.current)===null||V===void 0?void 0:V.selectionStart)||0,((J=ce.current)===null||J===void 0?void 0:J.selectionEnd)||0])}}else if(ie.source==="compositionEnd")return;te(le),ce.current&&(0,b.rJ)(ce.current,Ze,y,le)};(0,T.useEffect)(function(){if(de){var Pe;(Pe=ce.current)===null||Pe===void 0||Pe.setSelectionRange.apply(Pe,(0,s.Z)(de))}},[de]);var ye=function(Ze){De(Ze,Ze.target.value,{source:"change"})},Ee=function(Ze){xe.current=!1,De(Ze,Ze.currentTarget.value,{source:"compositionEnd"}),Z==null||Z(Ze)},Oe=function(Ze){L&&Ze.key==="Enter"&&!ge.current&&(ge.current=!0,L(Ze)),R==null||R(Ze)},Fe=function(Ze){Ze.key==="Enter"&&(ge.current=!1),O==null||O(Ze)},Ke=function(Ze){_e(!0),f==null||f(Ze)},ze=function(Ze){ge.current&&(ge.current=!1),_e(!1),C==null||C(Ze)},Ye=function(Ze){te(""),Se(),ce.current&&(0,b.rJ)(ce.current,Ze,y)},Ie=Ve&&"".concat(m,"-out-of-range"),je=function(){var Ze=(0,i.Z)(u,["prefixCls","onPressEnter","addonBefore","addonAfter","prefix","suffix","allowClear","defaultValue","showCount","count","classes","htmlSize","styles","classNames","onClear"]);return T.createElement("input",(0,B.Z)({autoComplete:_},Ze,{onChange:ye,onFocus:Ke,onBlur:ze,onKeyDown:Oe,onKeyUp:Fe,className:P()(m,(0,U.Z)({},"".concat(m,"-disabled"),d),z==null?void 0:z.input),style:j==null?void 0:j.input,ref:ce,size:h,type:K,onCompositionStart:function(ie){xe.current=!0,G==null||G(ie)},onCompositionEnd:Ee}))},qe=function(){var Ze=Number(Le)>0;if(x||we.show){var se=we.showFormatter?we.showFormatter({value:pe,count:Ae,maxLength:Le}):"".concat(Ae).concat(Ze?" / ".concat(Le):"");return T.createElement(T.Fragment,null,we.show&&T.createElement("span",{className:P()("".concat(m,"-show-count-suffix"),(0,U.Z)({},"".concat(m,"-show-count-has-suffix"),!!x),z==null?void 0:z.count),style:(0,N.Z)({},j==null?void 0:j.count)},se),x)}return null};return T.createElement(E,(0,B.Z)({},Q,{prefixCls:m,className:P()(A,Ie),handleReset:Ye,value:pe,focused:ae,triggerFocus:Se,suffix:qe(),disabled:d,classes:W,classNames:z,styles:j}),je())}),l=p,o=l},87887:function(Ge,re,M){"use strict";M.d(re,{He:function(){return N},X3:function(){return B},nH:function(){return S},rJ:function(){return k}});function N(P){return!!(P.addonBefore||P.addonAfter)}function B(P){return!!(P.prefix||P.suffix||P.allowClear)}function U(P,T,b){var e=T.cloneNode(!0),E=Object.create(P,{target:{value:e},currentTarget:{value:e}});return e.value=b,typeof T.selectionStart=="number"&&typeof T.selectionEnd=="number"&&(e.selectionStart=T.selectionStart,e.selectionEnd=T.selectionEnd),e.setSelectionRange=function(){T.setSelectionRange.apply(T,arguments)},E}function k(P,T,b,e){if(b){var E=T;if(T.type==="click"){E=U(T,P,""),b(E);return}if(P.type!=="file"&&e!==void 0){E=U(T,P,e),b(E);return}b(E)}}function S(P,T){if(P){P.focus(T);var b=T||{},e=b.cursor;if(e){var E=P.value.length;switch(e){case"start":P.setSelectionRange(0,0);break;case"end":P.setSelectionRange(E,E);break;default:P.setSelectionRange(0,E)}}}}},62874:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return Ve}});var N=M(4942),B=M(1413),U=M(97685),k=M(71002),S=M(67294),P=M(34203),T=M(42550),b=M(94184),e=M.n(b),E=M(98924);function s(De,ye){var Ee={};return Ee[De.toLowerCase()]=ye.toLowerCase(),Ee["Webkit".concat(De)]="webkit".concat(ye),Ee["Moz".concat(De)]="moz".concat(ye),Ee["ms".concat(De)]="MS".concat(ye),Ee["O".concat(De)]="o".concat(ye.toLowerCase()),Ee}function n(De,ye){var Ee={animationend:s("Animation","AnimationEnd"),transitionend:s("Transition","TransitionEnd")};return De&&("AnimationEvent"in ye||delete Ee.animationend.animation,"TransitionEvent"in ye||delete Ee.transitionend.transition),Ee}var t=n((0,E.Z)(),typeof window!="undefined"?window:{}),r={};if((0,E.Z)()){var i=document.createElement("div");r=i.style}var a={};function v(De){if(a[De])return a[De];var ye=t[De];if(ye)for(var Ee=Object.keys(ye),Oe=Ee.length,Fe=0;Fe<Oe;Fe+=1){var Ke=Ee[Fe];if(Object.prototype.hasOwnProperty.call(ye,Ke)&&Ke in r)return a[De]=ye[Ke],a[De]}return""}var p=v("animationend"),l=v("transitionend"),o=!!(p&&l),u=p||"animationend",c=l||"transitionend";function _(De,ye){if(!De)return null;if((0,k.Z)(De)==="object"){var Ee=ye.replace(/-\w/g,function(Oe){return Oe[1].toUpperCase()});return De[Ee]}return"".concat(De,"-").concat(ye)}var y="none",f="appear",C="enter",L="leave",R="none",O="prepare",g="start",m="active",d="end",h=M(63896),A=M(75164),w=function(){var De=S.useRef(null);function ye(){A.Z.cancel(De.current)}function Ee(Oe){var Fe=arguments.length>1&&arguments[1]!==void 0?arguments[1]:2;ye();var Ke=(0,A.Z)(function(){Fe<=1?Oe({isCanceled:function(){return Ke!==De.current}}):Ee(Oe,Fe-1)});De.current=Ke}return S.useEffect(function(){return function(){ye()}},[]),[Ee,ye]},x=(0,E.Z)()?S.useLayoutEffect:S.useEffect,D=x,I=[O,g,m,d],F=!1,K=!0;function W(De){return De===m||De===d}var z=function(De,ye){var Ee=(0,h.Z)(R),Oe=(0,U.Z)(Ee,2),Fe=Oe[0],Ke=Oe[1],ze=w(),Ye=(0,U.Z)(ze,2),Ie=Ye[0],je=Ye[1];function qe(){Ke(O,!0)}return D(function(){if(Fe!==R&&Fe!==d){var Pe=I.indexOf(Fe),Ze=I[Pe+1],se=ye(Fe);se===F?Ke(Ze,!0):Ie(function(ie){function le(){ie.isCanceled()||Ke(Ze,!0)}se===!0?le():Promise.resolve(se).then(le)})}},[De,Fe]),S.useEffect(function(){return function(){je()}},[]),[qe,Fe]},j=function(De){var ye=(0,S.useRef)(),Ee=(0,S.useRef)(De);Ee.current=De;var Oe=S.useCallback(function(ze){Ee.current(ze)},[]);function Fe(ze){ze&&(ze.removeEventListener(c,Oe),ze.removeEventListener(u,Oe))}function Ke(ze){ye.current&&ye.current!==ze&&Fe(ye.current),ze&&ze!==ye.current&&(ze.addEventListener(c,Oe),ze.addEventListener(u,Oe),ye.current=ze)}return S.useEffect(function(){return function(){Fe(ye.current)}},[]),[Ke,Fe]};function G(De,ye,Ee,Oe){var Fe=Oe.motionEnter,Ke=Fe===void 0?!0:Fe,ze=Oe.motionAppear,Ye=ze===void 0?!0:ze,Ie=Oe.motionLeave,je=Ie===void 0?!0:Ie,qe=Oe.motionDeadline,Pe=Oe.motionLeaveImmediately,Ze=Oe.onAppearPrepare,se=Oe.onEnterPrepare,ie=Oe.onLeavePrepare,le=Oe.onAppearStart,V=Oe.onEnterStart,J=Oe.onLeaveStart,q=Oe.onAppearActive,fe=Oe.onEnterActive,ne=Oe.onLeaveActive,ve=Oe.onAppearEnd,Ce=Oe.onEnterEnd,Ue=Oe.onLeaveEnd,We=Oe.onVisibleChanged,nt=(0,h.Z)(),et=(0,U.Z)(nt,2),Je=et[0],$e=et[1],ft=(0,h.Z)(y),at=(0,U.Z)(ft,2),ot=at[0],_t=at[1],Me=(0,h.Z)(null),Ne=(0,U.Z)(Me,2),it=Ne[0],ht=Ne[1],Ct=(0,S.useRef)(!1),Ft=(0,S.useRef)(null);function Vt(){return Ee()}var pr=(0,S.useRef)(!1);function gt(Pt){var It=Vt();if(!(Pt&&!Pt.deadline&&Pt.target!==It)){var zt=pr.current,Wr;ot===f&&zt?Wr=ve==null?void 0:ve(It,Pt):ot===C&&zt?Wr=Ce==null?void 0:Ce(It,Pt):ot===L&&zt&&(Wr=Ue==null?void 0:Ue(It,Pt)),ot!==y&&zt&&Wr!==!1&&(_t(y,!0),ht(null,!0))}}var Jt=j(gt),Zt=(0,U.Z)(Jt,1),_r=Zt[0],Yt=S.useMemo(function(){var Pt,It,zt;switch(ot){case f:return Pt={},(0,N.Z)(Pt,O,Ze),(0,N.Z)(Pt,g,le),(0,N.Z)(Pt,m,q),Pt;case C:return It={},(0,N.Z)(It,O,se),(0,N.Z)(It,g,V),(0,N.Z)(It,m,fe),It;case L:return zt={},(0,N.Z)(zt,O,ie),(0,N.Z)(zt,g,J),(0,N.Z)(zt,m,ne),zt;default:return{}}},[ot]),cn=z(ot,function(Pt){if(Pt===O){var It=Yt[O];return It?It(Vt()):F}if(vt in Yt){var zt;ht(((zt=Yt[vt])===null||zt===void 0?void 0:zt.call(Yt,Vt(),null))||null)}return vt===m&&(_r(Vt()),qe>0&&(clearTimeout(Ft.current),Ft.current=setTimeout(function(){gt({deadline:!0})},qe))),K}),mt=(0,U.Z)(cn,2),yt=mt[0],vt=mt[1],jt=W(vt);pr.current=jt,D(function(){$e(ye);var Pt=Ct.current;if(Ct.current=!0,!!De){var It;!Pt&&ye&&Ye&&(It=f),Pt&&ye&&Ke&&(It=C),(Pt&&!ye&&je||!Pt&&Pe&&!ye&&je)&&(It=L),It&&(_t(It),yt())}},[ye]),(0,S.useEffect)(function(){(ot===f&&!Ye||ot===C&&!Ke||ot===L&&!je)&&_t(y)},[Ye,Ke,je]),(0,S.useEffect)(function(){return function(){Ct.current=!1,clearTimeout(Ft.current)}},[]);var Nt=S.useRef(!1);(0,S.useEffect)(function(){Je&&(Nt.current=!0),Je!==void 0&&ot===y&&((Nt.current||Je)&&(We==null||We(Je)),Nt.current=!0)},[Je,ot]);var Wt=it;return Yt[O]&&vt===g&&(Wt=(0,B.Z)({transition:"none"},Wt)),[ot,vt,Wt,Je!=null?Je:ye]}var Z=M(15671),Q=M(43144),ue=M(60136),ee=M(29388),ae=function(De){(0,ue.Z)(Ee,De);var ye=(0,ee.Z)(Ee);function Ee(){return(0,Z.Z)(this,Ee),ye.apply(this,arguments)}return(0,Q.Z)(Ee,[{key:"render",value:function(){return this.props.children}}]),Ee}(S.Component),_e=ae;function xe(De){var ye=De;(0,k.Z)(De)==="object"&&(ye=De.transitionSupport);function Ee(Fe){return!!(Fe.motionName&&ye)}var Oe=S.forwardRef(function(Fe,Ke){var ze=Fe.visible,Ye=ze===void 0?!0:ze,Ie=Fe.removeOnLeave,je=Ie===void 0?!0:Ie,qe=Fe.forceRender,Pe=Fe.children,Ze=Fe.motionName,se=Fe.leavedClassName,ie=Fe.eventProps,le=Ee(Fe),V=(0,S.useRef)(),J=(0,S.useRef)();function q(){try{return V.current instanceof HTMLElement?V.current:(0,P.Z)(J.current)}catch(Me){return null}}var fe=G(le,Ye,q,Fe),ne=(0,U.Z)(fe,4),ve=ne[0],Ce=ne[1],Ue=ne[2],We=ne[3],nt=S.useRef(We);We&&(nt.current=!0);var et=S.useCallback(function(Me){V.current=Me,(0,T.mH)(Ke,Me)},[Ke]),Je,$e=(0,B.Z)((0,B.Z)({},ie),{},{visible:Ye});if(!Pe)Je=null;else if(ve===y||!Ee(Fe))We?Je=Pe((0,B.Z)({},$e),et):!je&&nt.current&&se?Je=Pe((0,B.Z)((0,B.Z)({},$e),{},{className:se}),et):qe||!je&&!se?Je=Pe((0,B.Z)((0,B.Z)({},$e),{},{style:{display:"none"}}),et):Je=null;else{var ft,at;Ce===O?at="prepare":W(Ce)?at="active":Ce===g&&(at="start"),Je=Pe((0,B.Z)((0,B.Z)({},$e),{},{className:e()(_(Ze,ve),(ft={},(0,N.Z)(ft,_(Ze,"".concat(ve,"-").concat(at)),at),(0,N.Z)(ft,Ze,typeof Ze=="string"),ft)),style:Ue}),et)}if(S.isValidElement(Je)&&(0,T.Yr)(Je)){var ot=Je,_t=ot.ref;_t||(Je=S.cloneElement(Je,{ref:et}))}return S.createElement(_e,{ref:J},Je)});return Oe.displayName="CSSMotion",Oe}var ge=xe(o),ce=M(87462),he=M(45987),Se=M(97326),Te="add",ke="keep",X="remove",te="removed";function pe(De){var ye;return De&&(0,k.Z)(De)==="object"&&"key"in De?ye=De:ye={key:De},(0,B.Z)((0,B.Z)({},ye),{},{key:String(ye.key)})}function me(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[];return De.map(pe)}function be(){var De=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:[],Ee=[],Oe=0,Fe=ye.length,Ke=me(De),ze=me(ye);Ke.forEach(function(je){for(var qe=!1,Pe=Oe;Pe<Fe;Pe+=1){var Ze=ze[Pe];if(Ze.key===je.key){Oe<Pe&&(Ee=Ee.concat(ze.slice(Oe,Pe).map(function(se){return(0,B.Z)((0,B.Z)({},se),{},{status:Te})})),Oe=Pe),Ee.push((0,B.Z)((0,B.Z)({},Ze),{},{status:ke})),Oe+=1,qe=!0;break}}qe||Ee.push((0,B.Z)((0,B.Z)({},je),{},{status:X}))}),Oe<Fe&&(Ee=Ee.concat(ze.slice(Oe).map(function(je){return(0,B.Z)((0,B.Z)({},je),{},{status:Te})})));var Ye={};Ee.forEach(function(je){var qe=je.key;Ye[qe]=(Ye[qe]||0)+1});var Ie=Object.keys(Ye).filter(function(je){return Ye[je]>1});return Ie.forEach(function(je){Ee=Ee.filter(function(qe){var Pe=qe.key,Ze=qe.status;return Pe!==je||Ze!==X}),Ee.forEach(function(qe){qe.key===je&&(qe.status=ke)})}),Ee}var de=["component","children","onVisibleChanged","onAllRemoved"],Be=["status"],we=["eventProps","visible","children","motionName","motionAppear","motionEnter","motionLeave","motionLeaveImmediately","motionDeadline","removeOnLeave","leavedClassName","onAppearStart","onAppearActive","onAppearEnd","onEnterStart","onEnterActive","onEnterEnd","onLeaveStart","onLeaveActive","onLeaveEnd"];function Le(De){var ye=arguments.length>1&&arguments[1]!==void 0?arguments[1]:ge,Ee=function(Oe){(0,ue.Z)(Ke,Oe);var Fe=(0,ee.Z)(Ke);function Ke(){var ze;(0,Z.Z)(this,Ke);for(var Ye=arguments.length,Ie=new Array(Ye),je=0;je<Ye;je++)Ie[je]=arguments[je];return ze=Fe.call.apply(Fe,[this].concat(Ie)),(0,N.Z)((0,Se.Z)(ze),"state",{keyEntities:[]}),(0,N.Z)((0,Se.Z)(ze),"removeKey",function(qe){var Pe=ze.state.keyEntities,Ze=Pe.map(function(se){return se.key!==qe?se:(0,B.Z)((0,B.Z)({},se),{},{status:te})});return ze.setState({keyEntities:Ze}),Ze.filter(function(se){var ie=se.status;return ie!==te}).length}),ze}return(0,Q.Z)(Ke,[{key:"render",value:function(){var Ye=this,Ie=this.state.keyEntities,je=this.props,qe=je.component,Pe=je.children,Ze=je.onVisibleChanged,se=je.onAllRemoved,ie=(0,he.Z)(je,de),le=qe||S.Fragment,V={};return we.forEach(function(J){V[J]=ie[J],delete ie[J]}),delete ie.keys,S.createElement(le,ie,Ie.map(function(J){var q=J.status,fe=(0,he.Z)(J,Be),ne=q===Te||q===ke;return S.createElement(ye,(0,ce.Z)({},V,{key:fe.key,visible:ne,eventProps:fe,onVisibleChanged:function(Ce){if(Ze==null||Ze(Ce,{key:fe.key}),!Ce){var Ue=Ye.removeKey(fe.key);Ue===0&&se&&se()}}}),Pe)}))}}],[{key:"getDerivedStateFromProps",value:function(Ye,Ie){var je=Ye.keys,qe=Ie.keyEntities,Pe=me(je),Ze=be(qe,Pe);return{keyEntities:Ze.filter(function(se){var ie=qe.find(function(le){var V=le.key;return se.key===V});return!(ie&&ie.status===te&&se.status===X)})}}}]),Ke}(S.Component);return(0,N.Z)(Ee,"defaultProps",{component:"div"}),Ee}var Ae=Le(o),Ve=ge},48555:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return O}});var N=M(87462),B=M(67294),U=M(50344),k=M(80334),S=M(1413),P=M(42550),T=M(34203),b=M(91033),e=new Map;function E(g){g.forEach(function(m){var d,h=m.target;(d=e.get(h))===null||d===void 0||d.forEach(function(A){return A(h)})})}var s=new b.Z(E),n=null,t=null;function r(g,m){e.has(g)||(e.set(g,new Set),s.observe(g)),e.get(g).add(m)}function i(g,m){e.has(g)&&(e.get(g).delete(m),e.get(g).size||(s.unobserve(g),e.delete(g)))}var a=M(15671),v=M(43144),p=M(60136),l=M(29388),o=function(g){(0,p.Z)(d,g);var m=(0,l.Z)(d);function d(){return(0,a.Z)(this,d),m.apply(this,arguments)}return(0,v.Z)(d,[{key:"render",value:function(){return this.props.children}}]),d}(B.Component),u=B.createContext(null);function c(g){var m=g.children,d=g.onBatchResize,h=B.useRef(0),A=B.useRef([]),w=B.useContext(u),x=B.useCallback(function(D,I,F){h.current+=1;var K=h.current;A.current.push({size:D,element:I,data:F}),Promise.resolve().then(function(){K===h.current&&(d==null||d(A.current),A.current=[])}),w==null||w(D,I,F)},[d,w]);return B.createElement(u.Provider,{value:x},m)}function _(g,m){var d=g.children,h=g.disabled,A=B.useRef(null),w=B.useRef(null),x=B.useContext(u),D=typeof d=="function",I=D?d(A):d,F=B.useRef({width:-1,height:-1,offsetWidth:-1,offsetHeight:-1}),K=!D&&B.isValidElement(I)&&(0,P.Yr)(I),W=K?I.ref:null,z=B.useMemo(function(){return(0,P.sQ)(W,A)},[W,A]),j=function(){return(0,T.Z)(A.current)||(0,T.Z)(w.current)};B.useImperativeHandle(m,function(){return j()});var G=B.useRef(g);G.current=g;var Z=B.useCallback(function(Q){var ue=G.current,ee=ue.onResize,ae=ue.data,_e=Q.getBoundingClientRect(),xe=_e.width,ge=_e.height,ce=Q.offsetWidth,he=Q.offsetHeight,Se=Math.floor(xe),Te=Math.floor(ge);if(F.current.width!==Se||F.current.height!==Te||F.current.offsetWidth!==ce||F.current.offsetHeight!==he){var ke={width:Se,height:Te,offsetWidth:ce,offsetHeight:he};F.current=ke;var X=ce===Math.round(xe)?xe:ce,te=he===Math.round(ge)?ge:he,pe=(0,S.Z)((0,S.Z)({},ke),{},{offsetWidth:X,offsetHeight:te});x==null||x(pe,Q,ae),ee&&Promise.resolve().then(function(){ee(pe,Q)})}},[]);return B.useEffect(function(){var Q=j();return Q&&!h&&r(Q,Z),function(){return i(Q,Z)}},[A.current,h]),B.createElement(o,{ref:w},K?B.cloneElement(I,{ref:z}):I)}var y=B.forwardRef(_),f=y,C="rc-observer-key";function L(g,m){var d=g.children,h=typeof d=="function"?[d]:(0,U.Z)(d);return h.map(function(A,w){var x=(A==null?void 0:A.key)||"".concat(C,"-").concat(w);return B.createElement(f,(0,N.Z)({},g,{key:x,ref:w===0?m:void 0}),A)})}var R=B.forwardRef(L);R.Collection=c;var O=R},36697:function(Ge,re,M){"use strict";M.d(re,{G:function(){return S},Z:function(){return y}});var N=M(94184),B=M.n(N),U=M(67294),k=M.t(U,2);function S(f){var C=f.children,L=f.prefixCls,R=f.id,O=f.overlayInnerStyle,g=f.bodyClassName,m=f.className,d=f.style;return U.createElement("div",{className:B()("".concat(L,"-content"),m),style:d},U.createElement("div",{className:B()("".concat(L,"-inner"),g),id:R,role:"tooltip",style:O},typeof C=="function"?C():C))}var P=M(87462),T=M(1413),b=M(45987),e=M(98280),E={shiftX:64,adjustY:1},s={adjustX:1,shiftY:!0},n=[0,0],t={left:{points:["cr","cl"],overflow:s,offset:[-4,0],targetOffset:n},right:{points:["cl","cr"],overflow:s,offset:[4,0],targetOffset:n},top:{points:["bc","tc"],overflow:E,offset:[0,-4],targetOffset:n},bottom:{points:["tc","bc"],overflow:E,offset:[0,4],targetOffset:n},topLeft:{points:["bl","tl"],overflow:E,offset:[0,-4],targetOffset:n},leftTop:{points:["tr","tl"],overflow:s,offset:[-4,0],targetOffset:n},topRight:{points:["br","tr"],overflow:E,offset:[0,-4],targetOffset:n},rightTop:{points:["tl","tr"],overflow:s,offset:[4,0],targetOffset:n},bottomRight:{points:["tr","br"],overflow:E,offset:[0,4],targetOffset:n},rightBottom:{points:["bl","br"],overflow:s,offset:[4,0],targetOffset:n},bottomLeft:{points:["tl","bl"],overflow:E,offset:[0,4],targetOffset:n},leftBottom:{points:["br","bl"],overflow:s,offset:[-4,0],targetOffset:n}},r=null,i=M(97685);function a(){var f=(0,T.Z)({},k);return f.useId}var v=0;function p(){}var l=a(),o=l?function(C){var L=l();return C||L}:function(C){var L=U.useState("ssr-id"),R=(0,i.Z)(L,2),O=R[0],g=R[1];return U.useEffect(function(){var m=v;v+=1,g("rc_unique_".concat(m))},[]),C||O},u=["overlayClassName","trigger","mouseEnterDelay","mouseLeaveDelay","overlayStyle","prefixCls","children","onVisibleChange","afterVisibleChange","transitionName","animation","motion","placement","align","destroyTooltipOnHide","defaultVisible","getTooltipContainer","overlayInnerStyle","arrowContent","overlay","id","showArrow","classNames","styles"],c=function(C,L){var R=C.overlayClassName,O=C.trigger,g=O===void 0?["hover"]:O,m=C.mouseEnterDelay,d=m===void 0?0:m,h=C.mouseLeaveDelay,A=h===void 0?.1:h,w=C.overlayStyle,x=C.prefixCls,D=x===void 0?"rc-tooltip":x,I=C.children,F=C.onVisibleChange,K=C.afterVisibleChange,W=C.transitionName,z=C.animation,j=C.motion,G=C.placement,Z=G===void 0?"right":G,Q=C.align,ue=Q===void 0?{}:Q,ee=C.destroyTooltipOnHide,ae=ee===void 0?!1:ee,_e=C.defaultVisible,xe=C.getTooltipContainer,ge=C.overlayInnerStyle,ce=C.arrowContent,he=C.overlay,Se=C.id,Te=C.showArrow,ke=Te===void 0?!0:Te,X=C.classNames,te=C.styles,pe=(0,b.Z)(C,u),me=o(Se),be=(0,U.useRef)(null);(0,U.useImperativeHandle)(L,function(){return be.current});var de=(0,T.Z)({},pe);"visible"in C&&(de.popupVisible=C.visible);var Be=function(){return U.createElement(S,{key:"content",prefixCls:D,id:me,bodyClassName:X==null?void 0:X.body,overlayInnerStyle:(0,T.Z)((0,T.Z)({},ge),te==null?void 0:te.body)},he)},we=function(){var Ae=U.Children.only(I),Ve=(Ae==null?void 0:Ae.props)||{},De=(0,T.Z)((0,T.Z)({},Ve),{},{"aria-describedby":he?me:null});return U.cloneElement(I,De)};return U.createElement(e.Z,(0,P.Z)({popupClassName:B()(R,X==null?void 0:X.root),prefixCls:D,popup:Be,action:g,builtinPlacements:t,popupPlacement:Z,ref:be,popupAlign:ue,getPopupContainer:xe,onPopupVisibleChange:F,afterPopupVisibleChange:K,popupTransitionName:W,popupAnimation:z,popupMotion:j,defaultPopupVisible:_e,autoDestroy:ae,mouseLeaveDelay:A,popupStyle:(0,T.Z)((0,T.Z)({},w),te==null?void 0:te.root),mouseEnterDelay:d,arrow:ke},de),we())},_=(0,U.forwardRef)(c),y=_},50344:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return U}});var N=M(67294),B=M(59864);function U(k){var S=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{},P=[];return N.Children.forEach(k,function(T){T==null&&!S.keepEmpty||(Array.isArray(T)?P=P.concat(U(T)):(0,B.isFragment)(T)&&T.props?P=P.concat(U(T.props.children,S)):P.push(T))}),P}},66680:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return B}});var N=M(67294);function B(U){var k=N.useRef();k.current=U;var S=N.useCallback(function(){for(var P,T=arguments.length,b=new Array(T),e=0;e<T;e++)b[e]=arguments[e];return(P=k.current)===null||P===void 0?void 0:P.call.apply(P,[k].concat(b))},[]);return S}},21770:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return P}});var N=M(97685),B=M(66680),U=M(8410),k=M(63896);function S(T){return T!==void 0}function P(T,b){var e=b||{},E=e.defaultValue,s=e.value,n=e.onChange,t=e.postState,r=(0,k.Z)(function(){return S(s)?s:S(E)?typeof E=="function"?E():E:typeof T=="function"?T():T}),i=(0,N.Z)(r,2),a=i[0],v=i[1],p=s!==void 0?s:a,l=t?t(p):p,o=(0,B.Z)(n),u=(0,k.Z)([p]),c=(0,N.Z)(u,2),_=c[0],y=c[1];(0,U.o)(function(){var C=_[0];a!==C&&o(a,C)},[_]),(0,U.o)(function(){S(s)||v(s)},[s]);var f=(0,B.Z)(function(C,L){v(C,L),y([p],L)});return[l,f]}},98423:function(Ge,re,M){"use strict";M.d(re,{Z:function(){return B}});var N=M(1413);function B(U,k){var S=(0,N.Z)({},U);return Array.isArray(k)&&k.forEach(function(P){delete S[P]}),S}},80334:function(Ge,re,M){"use strict";var N={};function B(b,e){}function U(b,e){}function k(){N={}}function S(b,e,E){!e&&!N[E]&&(b(!1,E),N[E]=!0)}function P(b,e){S(B,b,e)}function T(b,e){S(U,b,e)}re.ZP=P},74300:function(Ge,re,M){"use strict";Object.defineProperty(re,"__esModule",{value:!0}),re.CopyToClipboard=void 0;var N=U(M(67294)),B=U(M(20640));function U(l){return l&&l.__esModule?l:{default:l}}function k(l){return typeof Symbol=="function"&&typeof Symbol.iterator=="symbol"?k=function(u){return typeof u}:k=function(u){return u&&typeof Symbol=="function"&&u.constructor===Symbol&&u!==Symbol.prototype?"symbol":typeof u},k(l)}function S(l,o){var u=Object.keys(l);if(Object.getOwnPropertySymbols){var c=Object.getOwnPropertySymbols(l);o&&(c=c.filter(function(_){return Object.getOwnPropertyDescriptor(l,_).enumerable})),u.push.apply(u,c)}return u}function P(l){for(var o=1;o<arguments.length;o++){var u=arguments[o]!=null?arguments[o]:{};o%2?S(u,!0).forEach(function(c){v(l,c,u[c])}):Object.getOwnPropertyDescriptors?Object.defineProperties(l,Object.getOwnPropertyDescriptors(u)):S(u).forEach(function(c){Object.defineProperty(l,c,Object.getOwnPropertyDescriptor(u,c))})}return l}function T(l,o){if(l==null)return{};var u=b(l,o),c,_;if(Object.getOwnPropertySymbols){var y=Object.getOwnPropertySymbols(l);for(_=0;_<y.length;_++)c=y[_],!(o.indexOf(c)>=0)&&Object.prototype.propertyIsEnumerable.call(l,c)&&(u[c]=l[c])}return u}function b(l,o){if(l==null)return{};var u={},c=Object.keys(l),_,y;for(y=0;y<c.length;y++)_=c[y],!(o.indexOf(_)>=0)&&(u[_]=l[_]);return u}function e(l,o){if(!(l instanceof o))throw new TypeError("Cannot call a class as a function")}function E(l,o){for(var u=0;u<o.length;u++){var c=o[u];c.enumerable=c.enumerable||!1,c.configurable=!0,"value"in c&&(c.writable=!0),Object.defineProperty(l,c.key,c)}}function s(l,o,u){return o&&E(l.prototype,o),u&&E(l,u),l}function n(l,o){return o&&(k(o)==="object"||typeof o=="function")?o:r(l)}function t(l){return t=Object.setPrototypeOf?Object.getPrototypeOf:function(u){return u.__proto__||Object.getPrototypeOf(u)},t(l)}function r(l){if(l===void 0)throw new ReferenceError("this hasn't been initialised - super() hasn't been called");return l}function i(l,o){if(typeof o!="function"&&o!==null)throw new TypeError("Super expression must either be null or a function");l.prototype=Object.create(o&&o.prototype,{constructor:{value:l,writable:!0,configurable:!0}}),o&&a(l,o)}function a(l,o){return a=Object.setPrototypeOf||function(c,_){return c.__proto__=_,c},a(l,o)}function v(l,o,u){return o in l?Object.defineProperty(l,o,{value:u,enumerable:!0,configurable:!0,writable:!0}):l[o]=u,l}var p=function(l){i(o,l);function o(){var u,c;e(this,o);for(var _=arguments.length,y=new Array(_),f=0;f<_;f++)y[f]=arguments[f];return c=n(this,(u=t(o)).call.apply(u,[this].concat(y))),v(r(c),"onClick",function(C){var L=c.props,R=L.text,O=L.onCopy,g=L.children,m=L.options,d=N.default.Children.only(g),h=(0,B.default)(R,m);O&&O(R,h),d&&d.props&&typeof d.props.onClick=="function"&&d.props.onClick(C)}),c}return s(o,[{key:"render",value:function(){var c=this.props,_=c.text,y=c.onCopy,f=c.options,C=c.children,L=T(c,["text","onCopy","options","children"]),R=N.default.Children.only(C);return N.default.cloneElement(R,P({},L,{onClick:this.onClick}))}}]),o}(N.default.PureComponent);re.CopyToClipboard=p,v(p,"defaultProps",{onCopy:void 0,options:void 0})},74855:function(Ge,re,M){"use strict";var N=M(74300),B=N.CopyToClipboard;B.CopyToClipboard=B,Ge.exports=B},91033:function(Ge,re,M){"use strict";var N=function(){if(typeof Map!="undefined")return Map;function g(m,d){var h=-1;return m.some(function(A,w){return A[0]===d?(h=w,!0):!1}),h}return function(){function m(){this.__entries__=[]}return Object.defineProperty(m.prototype,"size",{get:function(){return this.__entries__.length},enumerable:!0,configurable:!0}),m.prototype.get=function(d){var h=g(this.__entries__,d),A=this.__entries__[h];return A&&A[1]},m.prototype.set=function(d,h){var A=g(this.__entries__,d);~A?this.__entries__[A][1]=h:this.__entries__.push([d,h])},m.prototype.delete=function(d){var h=this.__entries__,A=g(h,d);~A&&h.splice(A,1)},m.prototype.has=function(d){return!!~g(this.__entries__,d)},m.prototype.clear=function(){this.__entries__.splice(0)},m.prototype.forEach=function(d,h){h===void 0&&(h=null);for(var A=0,w=this.__entries__;A<w.length;A++){var x=w[A];d.call(h,x[1],x[0])}},m}()}(),B=typeof window!="undefined"&&typeof document!="undefined"&&window.document===document,U=function(){return typeof M.g!="undefined"&&M.g.Math===Math?M.g:typeof self!="undefined"&&self.Math===Math?self:typeof window!="undefined"&&window.Math===Math?window:Function("return this")()}(),k=function(){return typeof requestAnimationFrame=="function"?requestAnimationFrame.bind(U):function(g){return setTimeout(function(){return g(Date.now())},1e3/60)}}(),S=2;function P(g,m){var d=!1,h=!1,A=0;function w(){d&&(d=!1,g()),h&&D()}function x(){k(w)}function D(){var I=Date.now();if(d){if(I-A<S)return;h=!0}else d=!0,h=!1,setTimeout(x,m);A=I}return D}var T=20,b=["top","right","bottom","left","width","height","size","weight"],e=typeof MutationObserver!="undefined",E=function(){function g(){this.connected_=!1,this.mutationEventsAdded_=!1,this.mutationsObserver_=null,this.observers_=[],this.onTransitionEnd_=this.onTransitionEnd_.bind(this),this.refresh=P(this.refresh.bind(this),T)}return g.prototype.addObserver=function(m){~this.observers_.indexOf(m)||this.observers_.push(m),this.connected_||this.connect_()},g.prototype.removeObserver=function(m){var d=this.observers_,h=d.indexOf(m);~h&&d.splice(h,1),!d.length&&this.connected_&&this.disconnect_()},g.prototype.refresh=function(){var m=this.updateObservers_();m&&this.refresh()},g.prototype.updateObservers_=function(){var m=this.observers_.filter(function(d){return d.gatherActive(),d.hasActive()});return m.forEach(function(d){return d.broadcastActive()}),m.length>0},g.prototype.connect_=function(){!B||this.connected_||(document.addEventListener("transitionend",this.onTransitionEnd_),window.addEventListener("resize",this.refresh),e?(this.mutationsObserver_=new MutationObserver(this.refresh),this.mutationsObserver_.observe(document,{attributes:!0,childList:!0,characterData:!0,subtree:!0})):(document.addEventListener("DOMSubtreeModified",this.refresh),this.mutationEventsAdded_=!0),this.connected_=!0)},g.prototype.disconnect_=function(){!B||!this.connected_||(document.removeEventListener("transitionend",this.onTransitionEnd_),window.removeEventListener("resize",this.refresh),this.mutationsObserver_&&this.mutationsObserver_.disconnect(),this.mutationEventsAdded_&&document.removeEventListener("DOMSubtreeModified",this.refresh),this.mutationsObserver_=null,this.mutationEventsAdded_=!1,this.connected_=!1)},g.prototype.onTransitionEnd_=function(m){var d=m.propertyName,h=d===void 0?"":d,A=b.some(function(w){return!!~h.indexOf(w)});A&&this.refresh()},g.getInstance=function(){return this.instance_||(this.instance_=new g),this.instance_},g.instance_=null,g}(),s=function(g,m){for(var d=0,h=Object.keys(m);d<h.length;d++){var A=h[d];Object.defineProperty(g,A,{value:m[A],enumerable:!1,writable:!1,configurable:!0})}return g},n=function(g){var m=g&&g.ownerDocument&&g.ownerDocument.defaultView;return m||U},t=_(0,0,0,0);function r(g){return parseFloat(g)||0}function i(g){for(var m=[],d=1;d<arguments.length;d++)m[d-1]=arguments[d];return m.reduce(function(h,A){var w=g["border-"+A+"-width"];return h+r(w)},0)}function a(g){for(var m=["top","right","bottom","left"],d={},h=0,A=m;h<A.length;h++){var w=A[h],x=g["padding-"+w];d[w]=r(x)}return d}function v(g){var m=g.getBBox();return _(0,0,m.width,m.height)}function p(g){var m=g.clientWidth,d=g.clientHeight;if(!m&&!d)return t;var h=n(g).getComputedStyle(g),A=a(h),w=A.left+A.right,x=A.top+A.bottom,D=r(h.width),I=r(h.height);if(h.boxSizing==="border-box"&&(Math.round(D+w)!==m&&(D-=i(h,"left","right")+w),Math.round(I+x)!==d&&(I-=i(h,"top","bottom")+x)),!o(g)){var F=Math.round(D+w)-m,K=Math.round(I+x)-d;Math.abs(F)!==1&&(D-=F),Math.abs(K)!==1&&(I-=K)}return _(A.left,A.top,D,I)}var l=function(){return typeof SVGGraphicsElement!="undefined"?function(g){return g instanceof n(g).SVGGraphicsElement}:function(g){return g instanceof n(g).SVGElement&&typeof g.getBBox=="function"}}();function o(g){return g===n(g).document.documentElement}function u(g){return B?l(g)?v(g):p(g):t}function c(g){var m=g.x,d=g.y,h=g.width,A=g.height,w=typeof DOMRectReadOnly!="undefined"?DOMRectReadOnly:Object,x=Object.create(w.prototype);return s(x,{x:m,y:d,width:h,height:A,top:d,right:m+h,bottom:A+d,left:m}),x}function _(g,m,d,h){return{x:g,y:m,width:d,height:h}}var y=function(){function g(m){this.broadcastWidth=0,this.broadcastHeight=0,this.contentRect_=_(0,0,0,0),this.target=m}return g.prototype.isActive=function(){var m=u(this.target);return this.contentRect_=m,m.width!==this.broadcastWidth||m.height!==this.broadcastHeight},g.prototype.broadcastRect=function(){var m=this.contentRect_;return this.broadcastWidth=m.width,this.broadcastHeight=m.height,m},g}(),f=function(){function g(m,d){var h=c(d);s(this,{target:m,contentRect:h})}return g}(),C=function(){function g(m,d,h){if(this.activeObservations_=[],this.observations_=new N,typeof m!="function")throw new TypeError("The callback provided as parameter 1 is not a function.");this.callback_=m,this.controller_=d,this.callbackCtx_=h}return g.prototype.observe=function(m){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(m instanceof n(m).Element))throw new TypeError('parameter 1 is not of type "Element".');var d=this.observations_;d.has(m)||(d.set(m,new y(m)),this.controller_.addObserver(this),this.controller_.refresh())}},g.prototype.unobserve=function(m){if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");if(!(typeof Element=="undefined"||!(Element instanceof Object))){if(!(m instanceof n(m).Element))throw new TypeError('parameter 1 is not of type "Element".');var d=this.observations_;d.has(m)&&(d.delete(m),d.size||this.controller_.removeObserver(this))}},g.prototype.disconnect=function(){this.clearActive(),this.observations_.clear(),this.controller_.removeObserver(this)},g.prototype.gatherActive=function(){var m=this;this.clearActive(),this.observations_.forEach(function(d){d.isActive()&&m.activeObservations_.push(d)})},g.prototype.broadcastActive=function(){if(this.hasActive()){var m=this.callbackCtx_,d=this.activeObservations_.map(function(h){return new f(h.target,h.broadcastRect())});this.callback_.call(m,d,m),this.clearActive()}},g.prototype.clearActive=function(){this.activeObservations_.splice(0)},g.prototype.hasActive=function(){return this.activeObservations_.length>0},g}(),L=typeof WeakMap!="undefined"?new WeakMap:new N,R=function(){function g(m){if(!(this instanceof g))throw new TypeError("Cannot call a class as a function.");if(!arguments.length)throw new TypeError("1 argument required, but only 0 present.");var d=E.getInstance(),h=new C(m,d,this);L.set(this,h)}return g}();["observe","unobserve","disconnect"].forEach(function(g){R.prototype[g]=function(){var m;return(m=L.get(this))[g].apply(m,arguments)}});var O=function(){return typeof U.ResizeObserver!="undefined"?U.ResizeObserver:R}();re.Z=O},11742:function(Ge){Ge.exports=function(){var re=document.getSelection();if(!re.rangeCount)return function(){};for(var M=document.activeElement,N=[],B=0;B<re.rangeCount;B++)N.push(re.getRangeAt(B));switch(M.tagName.toUpperCase()){case"INPUT":case"TEXTAREA":M.blur();break;default:M=null;break}return re.removeAllRanges(),function(){re.type==="Caret"&&re.removeAllRanges(),re.rangeCount||N.forEach(function(U){re.addRange(U)}),M&&M.focus()}}},12320:function(Ge){(function(re,M){if(1)Ge.exports=M();else var N,B})(window,function(){return function(re){var M={};function N(B){if(M[B])return M[B].exports;var U=M[B]={i:B,l:!1,exports:{}};return re[B].call(U.exports,U,U.exports,N),U.l=!0,U.exports}return N.m=re,N.c=M,N.d=function(B,U,k){N.o(B,U)||Object.defineProperty(B,U,{enumerable:!0,get:k})},N.r=function(B){typeof Symbol!="undefined"&&Symbol.toStringTag&&Object.defineProperty(B,Symbol.toStringTag,{value:"Module"}),Object.defineProperty(B,"__esModule",{value:!0})},N.t=function(B,U){if(1&U&&(B=N(B)),8&U||4&U&&typeof B=="object"&&B&&B.__esModule)return B;var k=Object.create(null);if(N.r(k),Object.defineProperty(k,"default",{enumerable:!0,value:B}),2&U&&typeof B!="string")for(var S in B)N.d(k,S,function(P){return B[P]}.bind(null,S));return k},N.n=function(B){var U=B&&B.__esModule?function(){return B.default}:function(){return B};return N.d(U,"a",U),U},N.o=function(B,U){return Object.prototype.hasOwnProperty.call(B,U)},N.p="",N(N.s=34)}([function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.forwardEvent=M.EventEmitter=void 0;var B=function(){function U(){this._listeners=[],this._disposed=!1}return Object.defineProperty(U.prototype,"event",{get:function(){var k=this;return this._event||(this._event=function(S){return k._listeners.push(S),{dispose:function(){if(!k._disposed){for(var P=0;P<k._listeners.length;P++)if(k._listeners[P]===S)return void k._listeners.splice(P,1)}}}}),this._event},enumerable:!1,configurable:!0}),U.prototype.fire=function(k,S){for(var P=[],T=0;T<this._listeners.length;T++)P.push(this._listeners[T]);for(T=0;T<P.length;T++)P[T].call(void 0,k,S)},U.prototype.dispose=function(){this._listeners&&(this._listeners.length=0),this._disposed=!0},U}();M.EventEmitter=B,M.forwardEvent=function(U,k){return U(function(S){return k.fire(S)})}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.IUnicodeService=M.IOptionsService=M.ILogService=M.IInstantiationService=M.IDirtyRowService=M.ICharsetService=M.ICoreService=M.ICoreMouseService=M.IBufferService=void 0;var B=N(14);M.IBufferService=B.createDecorator("BufferService"),M.ICoreMouseService=B.createDecorator("CoreMouseService"),M.ICoreService=B.createDecorator("CoreService"),M.ICharsetService=B.createDecorator("CharsetService"),M.IDirtyRowService=B.createDecorator("DirtyRowService"),M.IInstantiationService=B.createDecorator("InstantiationService"),M.ILogService=B.createDecorator("LogService"),M.IOptionsService=B.createDecorator("OptionsService"),M.IUnicodeService=B.createDecorator("UnicodeService")},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.getDisposeArrayDisposable=M.disposeArray=M.Disposable=void 0;var B=function(){function k(){this._disposables=[],this._isDisposed=!1}return k.prototype.dispose=function(){this._isDisposed=!0;for(var S=0,P=this._disposables;S<P.length;S++)P[S].dispose();this._disposables.length=0},k.prototype.register=function(S){return this._disposables.push(S),S},k.prototype.unregister=function(S){var P=this._disposables.indexOf(S);P!==-1&&this._disposables.splice(P,1)},k}();function U(k){for(var S=0,P=k;S<P.length;S++)P[S].dispose();k.length=0}M.Disposable=B,M.disposeArray=U,M.getDisposeArrayDisposable=function(k){return{dispose:function(){return U(k)}}}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.WHITESPACE_CELL_CODE=M.WHITESPACE_CELL_WIDTH=M.WHITESPACE_CELL_CHAR=M.NULL_CELL_CODE=M.NULL_CELL_WIDTH=M.NULL_CELL_CHAR=M.CHAR_DATA_CODE_INDEX=M.CHAR_DATA_WIDTH_INDEX=M.CHAR_DATA_CHAR_INDEX=M.CHAR_DATA_ATTR_INDEX=M.DEFAULT_ATTR=M.DEFAULT_COLOR=void 0,M.DEFAULT_COLOR=256,M.DEFAULT_ATTR=256|M.DEFAULT_COLOR<<9,M.CHAR_DATA_ATTR_INDEX=0,M.CHAR_DATA_CHAR_INDEX=1,M.CHAR_DATA_WIDTH_INDEX=2,M.CHAR_DATA_CODE_INDEX=3,M.NULL_CELL_CHAR="",M.NULL_CELL_WIDTH=1,M.NULL_CELL_CODE=0,M.WHITESPACE_CELL_CHAR=" ",M.WHITESPACE_CELL_WIDTH=1,M.WHITESPACE_CELL_CODE=32},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(b,e){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,s){E.__proto__=s}||function(E,s){for(var n in s)s.hasOwnProperty(n)&&(E[n]=s[n])})(b,e)},function(b,e){function E(){this.constructor=b}B(b,e),b.prototype=e===null?Object.create(e):(E.prototype=e.prototype,new E)});Object.defineProperty(M,"__esModule",{value:!0}),M.CellData=void 0;var k=N(8),S=N(3),P=N(6),T=function(b){function e(){var E=b!==null&&b.apply(this,arguments)||this;return E.content=0,E.fg=0,E.bg=0,E.extended=new P.ExtendedAttrs,E.combinedData="",E}return U(e,b),e.fromCharData=function(E){var s=new e;return s.setFromCharData(E),s},e.prototype.isCombined=function(){return 2097152&this.content},e.prototype.getWidth=function(){return this.content>>22},e.prototype.getChars=function(){return 2097152&this.content?this.combinedData:2097151&this.content?k.stringFromCodePoint(2097151&this.content):""},e.prototype.getCode=function(){return this.isCombined()?this.combinedData.charCodeAt(this.combinedData.length-1):2097151&this.content},e.prototype.setFromCharData=function(E){this.fg=E[S.CHAR_DATA_ATTR_INDEX],this.bg=0;var s=!1;if(E[S.CHAR_DATA_CHAR_INDEX].length>2)s=!0;else if(E[S.CHAR_DATA_CHAR_INDEX].length===2){var n=E[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0);if(55296<=n&&n<=56319){var t=E[S.CHAR_DATA_CHAR_INDEX].charCodeAt(1);56320<=t&&t<=57343?this.content=1024*(n-55296)+t-56320+65536|E[S.CHAR_DATA_WIDTH_INDEX]<<22:s=!0}else s=!0}else this.content=E[S.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|E[S.CHAR_DATA_WIDTH_INDEX]<<22;s&&(this.combinedData=E[S.CHAR_DATA_CHAR_INDEX],this.content=2097152|E[S.CHAR_DATA_WIDTH_INDEX]<<22)},e.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},e}(P.AttributeData);M.CellData=T},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.ISoundService=M.ISelectionService=M.IRenderService=M.IMouseService=M.ICoreBrowserService=M.ICharSizeService=void 0;var B=N(14);M.ICharSizeService=B.createDecorator("CharSizeService"),M.ICoreBrowserService=B.createDecorator("CoreBrowserService"),M.IMouseService=B.createDecorator("MouseService"),M.IRenderService=B.createDecorator("RenderService"),M.ISelectionService=B.createDecorator("SelectionService"),M.ISoundService=B.createDecorator("SoundService")},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.ExtendedAttrs=M.AttributeData=void 0;var B=function(){function k(){this.fg=0,this.bg=0,this.extended=new U}return k.toColorRGB=function(S){return[S>>>16&255,S>>>8&255,255&S]},k.fromColorRGB=function(S){return(255&S[0])<<16|(255&S[1])<<8|255&S[2]},k.prototype.clone=function(){var S=new k;return S.fg=this.fg,S.bg=this.bg,S.extended=this.extended.clone(),S},k.prototype.isInverse=function(){return 67108864&this.fg},k.prototype.isBold=function(){return 134217728&this.fg},k.prototype.isUnderline=function(){return 268435456&this.fg},k.prototype.isBlink=function(){return 536870912&this.fg},k.prototype.isInvisible=function(){return 1073741824&this.fg},k.prototype.isItalic=function(){return 67108864&this.bg},k.prototype.isDim=function(){return 134217728&this.bg},k.prototype.getFgColorMode=function(){return 50331648&this.fg},k.prototype.getBgColorMode=function(){return 50331648&this.bg},k.prototype.isFgRGB=function(){return(50331648&this.fg)==50331648},k.prototype.isBgRGB=function(){return(50331648&this.bg)==50331648},k.prototype.isFgPalette=function(){return(50331648&this.fg)==16777216||(50331648&this.fg)==33554432},k.prototype.isBgPalette=function(){return(50331648&this.bg)==16777216||(50331648&this.bg)==33554432},k.prototype.isFgDefault=function(){return(50331648&this.fg)==0},k.prototype.isBgDefault=function(){return(50331648&this.bg)==0},k.prototype.isAttributeDefault=function(){return this.fg===0&&this.bg===0},k.prototype.getFgColor=function(){switch(50331648&this.fg){case 16777216:case 33554432:return 255&this.fg;case 50331648:return 16777215&this.fg;default:return-1}},k.prototype.getBgColor=function(){switch(50331648&this.bg){case 16777216:case 33554432:return 255&this.bg;case 50331648:return 16777215&this.bg;default:return-1}},k.prototype.hasExtendedAttrs=function(){return 268435456&this.bg},k.prototype.updateExtended=function(){this.extended.isEmpty()?this.bg&=-268435457:this.bg|=268435456},k.prototype.getUnderlineColor=function(){if(268435456&this.bg&&~this.extended.underlineColor)switch(50331648&this.extended.underlineColor){case 16777216:case 33554432:return 255&this.extended.underlineColor;case 50331648:return 16777215&this.extended.underlineColor;default:return this.getFgColor()}return this.getFgColor()},k.prototype.getUnderlineColorMode=function(){return 268435456&this.bg&&~this.extended.underlineColor?50331648&this.extended.underlineColor:this.getFgColorMode()},k.prototype.isUnderlineColorRGB=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==50331648:this.isFgRGB()},k.prototype.isUnderlineColorPalette=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==16777216||(50331648&this.extended.underlineColor)==33554432:this.isFgPalette()},k.prototype.isUnderlineColorDefault=function(){return 268435456&this.bg&&~this.extended.underlineColor?(50331648&this.extended.underlineColor)==0:this.isFgDefault()},k.prototype.getUnderlineStyle=function(){return 268435456&this.fg?268435456&this.bg?this.extended.underlineStyle:1:0},k}();M.AttributeData=B;var U=function(){function k(S,P){S===void 0&&(S=0),P===void 0&&(P=-1),this.underlineStyle=S,this.underlineColor=P}return k.prototype.clone=function(){return new k(this.underlineStyle,this.underlineColor)},k.prototype.isEmpty=function(){return this.underlineStyle===0},k}();M.ExtendedAttrs=U},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.addDisposableDomListener=void 0,M.addDisposableDomListener=function(B,U,k,S){B.addEventListener(U,k,S);var P=!1;return{dispose:function(){P||(P=!0,B.removeEventListener(U,k,S))}}}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.Utf8ToUtf32=M.StringToUtf32=M.utf32ToString=M.stringFromCodePoint=void 0,M.stringFromCodePoint=function(k){return k>65535?(k-=65536,String.fromCharCode(55296+(k>>10))+String.fromCharCode(k%1024+56320)):String.fromCharCode(k)},M.utf32ToString=function(k,S,P){S===void 0&&(S=0),P===void 0&&(P=k.length);for(var T="",b=S;b<P;++b){var e=k[b];e>65535?(e-=65536,T+=String.fromCharCode(55296+(e>>10))+String.fromCharCode(e%1024+56320)):T+=String.fromCharCode(e)}return T};var B=function(){function k(){this._interim=0}return k.prototype.clear=function(){this._interim=0},k.prototype.decode=function(S,P){var T=S.length;if(!T)return 0;var b=0,e=0;this._interim&&(56320<=(n=S.charCodeAt(e++))&&n<=57343?P[b++]=1024*(this._interim-55296)+n-56320+65536:(P[b++]=this._interim,P[b++]=n),this._interim=0);for(var E=e;E<T;++E){var s=S.charCodeAt(E);if(55296<=s&&s<=56319){if(++E>=T)return this._interim=s,b;var n;56320<=(n=S.charCodeAt(E))&&n<=57343?P[b++]=1024*(s-55296)+n-56320+65536:(P[b++]=s,P[b++]=n)}else P[b++]=s}return b},k}();M.StringToUtf32=B;var U=function(){function k(){this.interim=new Uint8Array(3)}return k.prototype.clear=function(){this.interim.fill(0)},k.prototype.decode=function(S,P){var T=S.length;if(!T)return 0;var b,e,E,s,n=0,t=0,r=0;if(this.interim[0]){var i=!1,a=this.interim[0];a&=(224&a)==192?31:(240&a)==224?15:7;for(var v=0,p=void 0;(p=63&this.interim[++v])&&v<4;)a<<=6,a|=p;for(var l=(224&this.interim[0])==192?2:(240&this.interim[0])==224?3:4,o=l-v;r<o;){if(r>=T)return 0;if((192&(p=S[r++]))!=128){r--,i=!0;break}this.interim[v++]=p,a<<=6,a|=63&p}i||(l===2?a<128?r--:P[n++]=a:l===3?a<2048||a>=55296&&a<=57343||(P[n++]=a):a<65536||a>1114111||(P[n++]=a)),this.interim.fill(0)}for(var u=T-4,c=r;c<T;){for(;!(!(c<u)||128&(b=S[c])||128&(e=S[c+1])||128&(E=S[c+2])||128&(s=S[c+3]));)P[n++]=b,P[n++]=e,P[n++]=E,P[n++]=s,c+=4;if((b=S[c++])<128)P[n++]=b;else if((224&b)==192){if(c>=T)return this.interim[0]=b,n;if((192&(e=S[c++]))!=128){c--;continue}if((t=(31&b)<<6|63&e)<128){c--;continue}P[n++]=t}else if((240&b)==224){if(c>=T)return this.interim[0]=b,n;if((192&(e=S[c++]))!=128){c--;continue}if(c>=T)return this.interim[0]=b,this.interim[1]=e,n;if((192&(E=S[c++]))!=128){c--;continue}if((t=(15&b)<<12|(63&e)<<6|63&E)<2048||t>=55296&&t<=57343)continue;P[n++]=t}else if((248&b)==240){if(c>=T)return this.interim[0]=b,n;if((192&(e=S[c++]))!=128){c--;continue}if(c>=T)return this.interim[0]=b,this.interim[1]=e,n;if((192&(E=S[c++]))!=128){c--;continue}if(c>=T)return this.interim[0]=b,this.interim[1]=e,this.interim[2]=E,n;if((192&(s=S[c++]))!=128){c--;continue}if((t=(7&b)<<18|(63&e)<<12|(63&E)<<6|63&s)<65536||t>1114111)continue;P[n++]=t}}return n},k}();M.Utf8ToUtf32=U},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.CHAR_ATLAS_CELL_SPACING=M.DIM_OPACITY=M.INVERTED_DEFAULT_COLOR=void 0,M.INVERTED_DEFAULT_COLOR=257,M.DIM_OPACITY=.5,M.CHAR_ATLAS_CELL_SPACING=1},function(re,M,N){"use strict";var B,U,k,S;function P(b){var e=b.toString(16);return e.length<2?"0"+e:e}function T(b,e){return b<e?(e+.05)/(b+.05):(b+.05)/(e+.05)}Object.defineProperty(M,"__esModule",{value:!0}),M.contrastRatio=M.toPaddedHex=M.rgba=M.rgb=M.css=M.color=M.channels=void 0,function(b){b.toCss=function(e,E,s,n){return n!==void 0?"#"+P(e)+P(E)+P(s)+P(n):"#"+P(e)+P(E)+P(s)},b.toRgba=function(e,E,s,n){return n===void 0&&(n=255),(e<<24|E<<16|s<<8|n)>>>0}}(B=M.channels||(M.channels={})),(U=M.color||(M.color={})).blend=function(b,e){var E=(255&e.rgba)/255;if(E===1)return{css:e.css,rgba:e.rgba};var s=e.rgba>>24&255,n=e.rgba>>16&255,t=e.rgba>>8&255,r=b.rgba>>24&255,i=b.rgba>>16&255,a=b.rgba>>8&255,v=r+Math.round((s-r)*E),p=i+Math.round((n-i)*E),l=a+Math.round((t-a)*E);return{css:B.toCss(v,p,l),rgba:B.toRgba(v,p,l)}},U.isOpaque=function(b){return(255&b.rgba)==255},U.ensureContrastRatio=function(b,e,E){var s=S.ensureContrastRatio(b.rgba,e.rgba,E);if(s)return S.toColor(s>>24&255,s>>16&255,s>>8&255)},U.opaque=function(b){var e=(255|b.rgba)>>>0,E=S.toChannels(e),s=E[0],n=E[1],t=E[2];return{css:B.toCss(s,n,t),rgba:e}},U.opacity=function(b,e){var E=Math.round(255*e),s=S.toChannels(b.rgba),n=s[0],t=s[1],r=s[2];return{css:B.toCss(n,t,r,E),rgba:B.toRgba(n,t,r,E)}},(M.css||(M.css={})).toColor=function(b){switch(b.length){case 7:return{css:b,rgba:(parseInt(b.slice(1),16)<<8|255)>>>0};case 9:return{css:b,rgba:parseInt(b.slice(1),16)>>>0}}throw new Error("css.toColor: Unsupported css format")},function(b){function e(E,s,n){var t=E/255,r=s/255,i=n/255;return .2126*(t<=.03928?t/12.92:Math.pow((t+.055)/1.055,2.4))+.7152*(r<=.03928?r/12.92:Math.pow((r+.055)/1.055,2.4))+.0722*(i<=.03928?i/12.92:Math.pow((i+.055)/1.055,2.4))}b.relativeLuminance=function(E){return e(E>>16&255,E>>8&255,255&E)},b.relativeLuminance2=e}(k=M.rgb||(M.rgb={})),function(b){function e(s,n,t){for(var r=s>>24&255,i=s>>16&255,a=s>>8&255,v=n>>24&255,p=n>>16&255,l=n>>8&255,o=T(k.relativeLuminance2(v,l,p),k.relativeLuminance2(r,i,a));o<t&&(v>0||p>0||l>0);)v-=Math.max(0,Math.ceil(.1*v)),p-=Math.max(0,Math.ceil(.1*p)),l-=Math.max(0,Math.ceil(.1*l)),o=T(k.relativeLuminance2(v,l,p),k.relativeLuminance2(r,i,a));return(v<<24|p<<16|l<<8|255)>>>0}function E(s,n,t){for(var r=s>>24&255,i=s>>16&255,a=s>>8&255,v=n>>24&255,p=n>>16&255,l=n>>8&255,o=T(k.relativeLuminance2(v,l,p),k.relativeLuminance2(r,i,a));o<t&&(v<255||p<255||l<255);)v=Math.min(255,v+Math.ceil(.1*(255-v))),p=Math.min(255,p+Math.ceil(.1*(255-p))),l=Math.min(255,l+Math.ceil(.1*(255-l))),o=T(k.relativeLuminance2(v,l,p),k.relativeLuminance2(r,i,a));return(v<<24|p<<16|l<<8|255)>>>0}b.ensureContrastRatio=function(s,n,t){var r=k.relativeLuminance(s>>8),i=k.relativeLuminance(n>>8);if(T(r,i)<t)return i<r?e(s,n,t):E(s,n,t)},b.reduceLuminance=e,b.increaseLuminance=E,b.toChannels=function(s){return[s>>24&255,s>>16&255,s>>8&255,255&s]},b.toColor=function(s,n,t){return{css:B.toCss(s,n,t),rgba:B.toRgba(s,n,t)}}}(S=M.rgba||(M.rgba={})),M.toPaddedHex=P,M.contrastRatio=T},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.isLinux=M.isWindows=M.isIphone=M.isIpad=M.isMac=M.isSafari=M.isFirefox=void 0;var B=typeof navigator=="undefined",U=B?"node":navigator.userAgent,k=B?"node":navigator.platform;function S(P,T){return P.indexOf(T)>=0}M.isFirefox=!!~U.indexOf("Firefox"),M.isSafari=/^((?!chrome|android).)*safari/i.test(U),M.isMac=S(["Macintosh","MacIntel","MacPPC","Mac68K"],k),M.isIpad=k==="iPad",M.isIphone=k==="iPhone",M.isWindows=S(["Windows","Win16","Win32","WinCE"],k),M.isLinux=k.indexOf("Linux")>=0},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.C1=M.C0=void 0,function(B){B.NUL="\0",B.SOH="",B.STX="",B.ETX="",B.EOT="",B.ENQ="",B.ACK="",B.BEL="\x07",B.BS="\b",B.HT=" ",B.LF=`
`,B.VT="\v",B.FF="\f",B.CR="\r",B.SO="",B.SI="",B.DLE="",B.DC1="",B.DC2="",B.DC3="",B.DC4="",B.NAK="",B.SYN="",B.ETB="",B.CAN="",B.EM="",B.SUB="",B.ESC="\x1B",B.FS="",B.GS="",B.RS="",B.US="",B.SP=" ",B.DEL="\x7F"}(M.C0||(M.C0={})),function(B){B.PAD="\x80",B.HOP="\x81",B.BPH="\x82",B.NBH="\x83",B.IND="\x84",B.NEL="\x85",B.SSA="\x86",B.ESA="\x87",B.HTS="\x88",B.HTJ="\x89",B.VTS="\x8A",B.PLD="\x8B",B.PLU="\x8C",B.RI="\x8D",B.SS2="\x8E",B.SS3="\x8F",B.DCS="\x90",B.PU1="\x91",B.PU2="\x92",B.STS="\x93",B.CCH="\x94",B.MW="\x95",B.SPA="\x96",B.EPA="\x97",B.SOS="\x98",B.SGCI="\x99",B.SCI="\x9A",B.CSI="\x9B",B.ST="\x9C",B.OSC="\x9D",B.PM="\x9E",B.APC="\x9F"}(M.C1||(M.C1={}))},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.BaseRenderLayer=void 0;var B=N(3),U=N(9),k=N(25),S=N(6),P=N(28),T=N(10),b=N(17),e=function(){function E(s,n,t,r,i,a,v,p){this._container=s,this._alpha=r,this._colors=i,this._rendererId=a,this._bufferService=v,this._optionsService=p,this._scaledCharWidth=0,this._scaledCharHeight=0,this._scaledCellWidth=0,this._scaledCellHeight=0,this._scaledCharLeft=0,this._scaledCharTop=0,this._currentGlyphIdentifier={chars:"",code:0,bg:0,fg:0,bold:!1,dim:!1,italic:!1},this._canvas=document.createElement("canvas"),this._canvas.classList.add("xterm-"+n+"-layer"),this._canvas.style.zIndex=t.toString(),this._initCanvas(),this._container.appendChild(this._canvas)}return E.prototype.dispose=function(){var s;b.removeElementFromParent(this._canvas),(s=this._charAtlas)===null||s===void 0||s.dispose()},E.prototype._initCanvas=function(){this._ctx=P.throwIfFalsy(this._canvas.getContext("2d",{alpha:this._alpha})),this._alpha||this._clearAll()},E.prototype.onOptionsChanged=function(){},E.prototype.onBlur=function(){},E.prototype.onFocus=function(){},E.prototype.onCursorMove=function(){},E.prototype.onGridChanged=function(s,n){},E.prototype.onSelectionChanged=function(s,n,t){t===void 0&&(t=!1)},E.prototype.setColors=function(s){this._refreshCharAtlas(s)},E.prototype._setTransparency=function(s){if(s!==this._alpha){var n=this._canvas;this._alpha=s,this._canvas=this._canvas.cloneNode(),this._initCanvas(),this._container.replaceChild(this._canvas,n),this._refreshCharAtlas(this._colors),this.onGridChanged(0,this._bufferService.rows-1)}},E.prototype._refreshCharAtlas=function(s){this._scaledCharWidth<=0&&this._scaledCharHeight<=0||(this._charAtlas=k.acquireCharAtlas(this._optionsService.options,this._rendererId,s,this._scaledCharWidth,this._scaledCharHeight),this._charAtlas.warmUp())},E.prototype.resize=function(s){this._scaledCellWidth=s.scaledCellWidth,this._scaledCellHeight=s.scaledCellHeight,this._scaledCharWidth=s.scaledCharWidth,this._scaledCharHeight=s.scaledCharHeight,this._scaledCharLeft=s.scaledCharLeft,this._scaledCharTop=s.scaledCharTop,this._canvas.width=s.scaledCanvasWidth,this._canvas.height=s.scaledCanvasHeight,this._canvas.style.width=s.canvasWidth+"px",this._canvas.style.height=s.canvasHeight+"px",this._alpha||this._clearAll(),this._refreshCharAtlas(this._colors)},E.prototype._fillCells=function(s,n,t,r){this._ctx.fillRect(s*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight)},E.prototype._fillBottomLineAtCells=function(s,n,t){t===void 0&&(t=1),this._ctx.fillRect(s*this._scaledCellWidth,(n+1)*this._scaledCellHeight-window.devicePixelRatio-1,t*this._scaledCellWidth,window.devicePixelRatio)},E.prototype._fillLeftLineAtCell=function(s,n,t){this._ctx.fillRect(s*this._scaledCellWidth,n*this._scaledCellHeight,window.devicePixelRatio*t,this._scaledCellHeight)},E.prototype._strokeRectAtCell=function(s,n,t,r){this._ctx.lineWidth=window.devicePixelRatio,this._ctx.strokeRect(s*this._scaledCellWidth+window.devicePixelRatio/2,n*this._scaledCellHeight+window.devicePixelRatio/2,t*this._scaledCellWidth-window.devicePixelRatio,r*this._scaledCellHeight-window.devicePixelRatio)},E.prototype._clearAll=function(){this._alpha?this._ctx.clearRect(0,0,this._canvas.width,this._canvas.height):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(0,0,this._canvas.width,this._canvas.height))},E.prototype._clearCells=function(s,n,t,r){this._alpha?this._ctx.clearRect(s*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight):(this._ctx.fillStyle=this._colors.background.css,this._ctx.fillRect(s*this._scaledCellWidth,n*this._scaledCellHeight,t*this._scaledCellWidth,r*this._scaledCellHeight))},E.prototype._fillCharTrueColor=function(s,n,t){this._ctx.font=this._getFont(!1,!1),this._ctx.textBaseline="middle",this._clipRow(t),this._ctx.fillText(s.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2)},E.prototype._drawChars=function(s,n,t){var r,i,a=this._getContrastColor(s);a||s.isFgRGB()||s.isBgRGB()?this._drawUncachedChars(s,n,t,a):(s.isInverse()?(r=s.isBgDefault()?U.INVERTED_DEFAULT_COLOR:s.getBgColor(),i=s.isFgDefault()?U.INVERTED_DEFAULT_COLOR:s.getFgColor()):(i=s.isBgDefault()?B.DEFAULT_COLOR:s.getBgColor(),r=s.isFgDefault()?B.DEFAULT_COLOR:s.getFgColor()),r+=this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&r<8?8:0,this._currentGlyphIdentifier.chars=s.getChars()||B.WHITESPACE_CELL_CHAR,this._currentGlyphIdentifier.code=s.getCode()||B.WHITESPACE_CELL_CODE,this._currentGlyphIdentifier.bg=i,this._currentGlyphIdentifier.fg=r,this._currentGlyphIdentifier.bold=!!s.isBold(),this._currentGlyphIdentifier.dim=!!s.isDim(),this._currentGlyphIdentifier.italic=!!s.isItalic(),this._charAtlas&&this._charAtlas.draw(this._ctx,this._currentGlyphIdentifier,n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop)||this._drawUncachedChars(s,n,t))},E.prototype._drawUncachedChars=function(s,n,t,r){if(this._ctx.save(),this._ctx.font=this._getFont(!!s.isBold(),!!s.isItalic()),this._ctx.textBaseline="middle",s.isInverse())if(r)this._ctx.fillStyle=r.css;else if(s.isBgDefault())this._ctx.fillStyle=T.color.opaque(this._colors.background).css;else if(s.isBgRGB())this._ctx.fillStyle="rgb("+S.AttributeData.toColorRGB(s.getBgColor()).join(",")+")";else{var i=s.getBgColor();this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&i<8&&(i+=8),this._ctx.fillStyle=this._colors.ansi[i].css}else if(r)this._ctx.fillStyle=r.css;else if(s.isFgDefault())this._ctx.fillStyle=this._colors.foreground.css;else if(s.isFgRGB())this._ctx.fillStyle="rgb("+S.AttributeData.toColorRGB(s.getFgColor()).join(",")+")";else{var a=s.getFgColor();this._optionsService.options.drawBoldTextInBrightColors&&s.isBold()&&a<8&&(a+=8),this._ctx.fillStyle=this._colors.ansi[a].css}this._clipRow(t),s.isDim()&&(this._ctx.globalAlpha=U.DIM_OPACITY),this._ctx.fillText(s.getChars(),n*this._scaledCellWidth+this._scaledCharLeft,t*this._scaledCellHeight+this._scaledCharTop+this._scaledCharHeight/2),this._ctx.restore()},E.prototype._clipRow=function(s){this._ctx.beginPath(),this._ctx.rect(0,s*this._scaledCellHeight,this._bufferService.cols*this._scaledCellWidth,this._scaledCellHeight),this._ctx.clip()},E.prototype._getFont=function(s,n){return(n?"italic":"")+" "+(s?this._optionsService.options.fontWeightBold:this._optionsService.options.fontWeight)+" "+this._optionsService.options.fontSize*window.devicePixelRatio+"px "+this._optionsService.options.fontFamily},E.prototype._getContrastColor=function(s){if(this._optionsService.options.minimumContrastRatio!==1){var n=this._colors.contrastCache.getColor(s.bg,s.fg);if(n!==void 0)return n||void 0;var t=s.getFgColor(),r=s.getFgColorMode(),i=s.getBgColor(),a=s.getBgColorMode(),v=!!s.isInverse(),p=!!s.isInverse();if(v){var l=t;t=i,i=l;var o=r;r=a,a=o}var u=this._resolveBackgroundRgba(a,i,v),c=this._resolveForegroundRgba(r,t,v,p),_=T.rgba.ensureContrastRatio(u,c,this._optionsService.options.minimumContrastRatio);if(_){var y={css:T.channels.toCss(_>>24&255,_>>16&255,_>>8&255),rgba:_};return this._colors.contrastCache.setColor(s.bg,s.fg,y),y}this._colors.contrastCache.setColor(s.bg,s.fg,null)}},E.prototype._resolveBackgroundRgba=function(s,n,t){switch(s){case 16777216:case 33554432:return this._colors.ansi[n].rgba;case 50331648:return n<<8;case 0:default:return t?this._colors.foreground.rgba:this._colors.background.rgba}},E.prototype._resolveForegroundRgba=function(s,n,t,r){switch(s){case 16777216:case 33554432:return this._optionsService.options.drawBoldTextInBrightColors&&r&&n<8&&(n+=8),this._colors.ansi[n].rgba;case 50331648:return n<<8;case 0:default:return t?this._colors.background.rgba:this._colors.foreground.rgba}},E}();M.BaseRenderLayer=e},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.createDecorator=M.getServiceDependencies=M.serviceRegistry=void 0;function B(U,k,S){k.di$target===k?k.di$dependencies.push({id:U,index:S}):(k.di$dependencies=[{id:U,index:S}],k.di$target=k)}M.serviceRegistry=new Map,M.getServiceDependencies=function(U){return U.di$dependencies||[]},M.createDecorator=function(U){if(M.serviceRegistry.has(U))return M.serviceRegistry.get(U);var k=function(S,P,T){if(arguments.length!==3)throw new Error("@IServiceName-decorator can only be used to decorate a parameter");B(k,S,T)};return k.toString=function(){return U},M.serviceRegistry.set(U,k),k}},function(re,M,N){"use strict";function B(U,k,S,P){if(S===void 0&&(S=0),P===void 0&&(P=U.length),S>=U.length)return U;S=(U.length+S)%U.length,P=P>=U.length?U.length:(U.length+P)%U.length;for(var T=S;T<P;++T)U[T]=k;return U}Object.defineProperty(M,"__esModule",{value:!0}),M.concat=M.fillFallback=M.fill=void 0,M.fill=function(U,k,S,P){return U.fill?U.fill(k,S,P):B(U,k,S,P)},M.fillFallback=B,M.concat=function(U,k){var S=new U.constructor(U.length+k.length);return S.set(U),S.set(k,U.length),S}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.BufferLine=M.DEFAULT_ATTR_DATA=void 0;var B=N(8),U=N(3),k=N(4),S=N(6);M.DEFAULT_ATTR_DATA=Object.freeze(new S.AttributeData);var P=function(){function T(b,e,E){E===void 0&&(E=!1),this.isWrapped=E,this._combined={},this._extendedAttrs={},this._data=new Uint32Array(3*b);for(var s=e||k.CellData.fromCharData([0,U.NULL_CELL_CHAR,U.NULL_CELL_WIDTH,U.NULL_CELL_CODE]),n=0;n<b;++n)this.setCell(n,s);this.length=b}return T.prototype.get=function(b){var e=this._data[3*b+0],E=2097151&e;return[this._data[3*b+1],2097152&e?this._combined[b]:E?B.stringFromCodePoint(E):"",e>>22,2097152&e?this._combined[b].charCodeAt(this._combined[b].length-1):E]},T.prototype.set=function(b,e){this._data[3*b+1]=e[U.CHAR_DATA_ATTR_INDEX],e[U.CHAR_DATA_CHAR_INDEX].length>1?(this._combined[b]=e[1],this._data[3*b+0]=2097152|b|e[U.CHAR_DATA_WIDTH_INDEX]<<22):this._data[3*b+0]=e[U.CHAR_DATA_CHAR_INDEX].charCodeAt(0)|e[U.CHAR_DATA_WIDTH_INDEX]<<22},T.prototype.getWidth=function(b){return this._data[3*b+0]>>22},T.prototype.hasWidth=function(b){return 12582912&this._data[3*b+0]},T.prototype.getFg=function(b){return this._data[3*b+1]},T.prototype.getBg=function(b){return this._data[3*b+2]},T.prototype.hasContent=function(b){return 4194303&this._data[3*b+0]},T.prototype.getCodePoint=function(b){var e=this._data[3*b+0];return 2097152&e?this._combined[b].charCodeAt(this._combined[b].length-1):2097151&e},T.prototype.isCombined=function(b){return 2097152&this._data[3*b+0]},T.prototype.getString=function(b){var e=this._data[3*b+0];return 2097152&e?this._combined[b]:2097151&e?B.stringFromCodePoint(2097151&e):""},T.prototype.loadCell=function(b,e){var E=3*b;return e.content=this._data[E+0],e.fg=this._data[E+1],e.bg=this._data[E+2],2097152&e.content&&(e.combinedData=this._combined[b]),268435456&e.bg&&(e.extended=this._extendedAttrs[b]),e},T.prototype.setCell=function(b,e){2097152&e.content&&(this._combined[b]=e.combinedData),268435456&e.bg&&(this._extendedAttrs[b]=e.extended),this._data[3*b+0]=e.content,this._data[3*b+1]=e.fg,this._data[3*b+2]=e.bg},T.prototype.setCellFromCodePoint=function(b,e,E,s,n,t){268435456&n&&(this._extendedAttrs[b]=t),this._data[3*b+0]=e|E<<22,this._data[3*b+1]=s,this._data[3*b+2]=n},T.prototype.addCodepointToCell=function(b,e){var E=this._data[3*b+0];2097152&E?this._combined[b]+=B.stringFromCodePoint(e):(2097151&E?(this._combined[b]=B.stringFromCodePoint(2097151&E)+B.stringFromCodePoint(e),E&=-2097152,E|=2097152):E=e|1<<22,this._data[3*b+0]=E)},T.prototype.insertCells=function(b,e,E,s){if((b%=this.length)&&this.getWidth(b-1)===2&&this.setCellFromCodePoint(b-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new S.ExtendedAttrs),e<this.length-b){for(var n=new k.CellData,t=this.length-b-e-1;t>=0;--t)this.setCell(b+e+t,this.loadCell(b+t,n));for(t=0;t<e;++t)this.setCell(b+t,E)}else for(t=b;t<this.length;++t)this.setCell(t,E);this.getWidth(this.length-1)===2&&this.setCellFromCodePoint(this.length-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new S.ExtendedAttrs)},T.prototype.deleteCells=function(b,e,E,s){if(b%=this.length,e<this.length-b){for(var n=new k.CellData,t=0;t<this.length-b-e;++t)this.setCell(b+t,this.loadCell(b+e+t,n));for(t=this.length-e;t<this.length;++t)this.setCell(t,E)}else for(t=b;t<this.length;++t)this.setCell(t,E);b&&this.getWidth(b-1)===2&&this.setCellFromCodePoint(b-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new S.ExtendedAttrs),this.getWidth(b)!==0||this.hasContent(b)||this.setCellFromCodePoint(b,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new S.ExtendedAttrs)},T.prototype.replaceCells=function(b,e,E,s){for(b&&this.getWidth(b-1)===2&&this.setCellFromCodePoint(b-1,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new S.ExtendedAttrs),e<this.length&&this.getWidth(e-1)===2&&this.setCellFromCodePoint(e,0,1,(s==null?void 0:s.fg)||0,(s==null?void 0:s.bg)||0,(s==null?void 0:s.extended)||new S.ExtendedAttrs);b<e&&b<this.length;)this.setCell(b++,E)},T.prototype.resize=function(b,e){if(b!==this.length){if(b>this.length){var E=new Uint32Array(3*b);this.length&&(3*b<this._data.length?E.set(this._data.subarray(0,3*b)):E.set(this._data)),this._data=E;for(var s=this.length;s<b;++s)this.setCell(s,e)}else if(b){(E=new Uint32Array(3*b)).set(this._data.subarray(0,3*b)),this._data=E;var n=Object.keys(this._combined);for(s=0;s<n.length;s++){var t=parseInt(n[s],10);t>=b&&delete this._combined[t]}}else this._data=new Uint32Array(0),this._combined={};this.length=b}},T.prototype.fill=function(b){this._combined={},this._extendedAttrs={};for(var e=0;e<this.length;++e)this.setCell(e,b)},T.prototype.copyFrom=function(b){for(var e in this.length!==b.length?this._data=new Uint32Array(b._data):this._data.set(b._data),this.length=b.length,this._combined={},b._combined)this._combined[e]=b._combined[e];for(var e in this._extendedAttrs={},b._extendedAttrs)this._extendedAttrs[e]=b._extendedAttrs[e];this.isWrapped=b.isWrapped},T.prototype.clone=function(){var b=new T(0);for(var e in b._data=new Uint32Array(this._data),b.length=this.length,this._combined)b._combined[e]=this._combined[e];for(var e in this._extendedAttrs)b._extendedAttrs[e]=this._extendedAttrs[e];return b.isWrapped=this.isWrapped,b},T.prototype.getTrimmedLength=function(){for(var b=this.length-1;b>=0;--b)if(4194303&this._data[3*b+0])return b+(this._data[3*b+0]>>22);return 0},T.prototype.copyCellsFrom=function(b,e,E,s,n){var t=b._data;if(n)for(var r=s-1;r>=0;r--)for(var i=0;i<3;i++)this._data[3*(E+r)+i]=t[3*(e+r)+i];else for(r=0;r<s;r++)for(i=0;i<3;i++)this._data[3*(E+r)+i]=t[3*(e+r)+i];var a=Object.keys(b._combined);for(i=0;i<a.length;i++){var v=parseInt(a[i],10);v>=e&&(this._combined[v-e+E]=b._combined[v])}},T.prototype.translateToString=function(b,e,E){b===void 0&&(b=!1),e===void 0&&(e=0),E===void 0&&(E=this.length),b&&(E=Math.min(E,this.getTrimmedLength()));for(var s="";e<E;){var n=this._data[3*e+0],t=2097151&n;s+=2097152&n?this._combined[e]:t?B.stringFromCodePoint(t):U.WHITESPACE_CELL_CHAR,e+=n>>22||1}return s},T}();M.BufferLine=P},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.removeElementFromParent=void 0,M.removeElementFromParent=function(){for(var B,U=[],k=0;k<arguments.length;k++)U[k]=arguments[k];for(var S=0,P=U;S<P.length;S++){var T=P[S];(B=T==null?void 0:T.parentElement)===null||B===void 0||B.removeChild(T)}}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.tooMuchOutput=M.promptLabel=void 0,M.promptLabel="Terminal input",M.tooMuchOutput="Too much output to announce, navigate to rows manually to read"},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(c,_){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(y,f){y.__proto__=f}||function(y,f){for(var C in f)f.hasOwnProperty(C)&&(y[C]=f[C])})(c,_)},function(c,_){function y(){this.constructor=c}B(c,_),c.prototype=_===null?Object.create(_):(y.prototype=_.prototype,new y)});Object.defineProperty(M,"__esModule",{value:!0}),M.InputHandler=M.WindowsOptionsReportType=void 0;var k,S=N(12),P=N(20),T=N(39),b=N(2),e=N(15),E=N(8),s=N(16),n=N(0),t=N(3),r=N(4),i=N(6),a=N(22),v=N(24),p={"(":0,")":1,"*":2,"+":3,"-":1,".":2};function l(c,_){if(c>24)return _.setWinLines||!1;switch(c){case 1:return!!_.restoreWin;case 2:return!!_.minimizeWin;case 3:return!!_.setWinPosition;case 4:return!!_.setWinSizePixels;case 5:return!!_.raiseWin;case 6:return!!_.lowerWin;case 7:return!!_.refreshWin;case 8:return!!_.setWinSizeChars;case 9:return!!_.maximizeWin;case 10:return!!_.fullscreenWin;case 11:return!!_.getWinState;case 13:return!!_.getWinPosition;case 14:return!!_.getWinSizePixels;case 15:return!!_.getScreenSizePixels;case 16:return!!_.getCellSizePixels;case 18:return!!_.getWinSizeChars;case 19:return!!_.getScreenSizeChars;case 20:return!!_.getIconTitle;case 21:return!!_.getWinTitle;case 22:return!!_.pushTitle;case 23:return!!_.popTitle;case 24:return!!_.setWinLines}return!1}(function(c){c[c.GET_WIN_SIZE_PIXELS=0]="GET_WIN_SIZE_PIXELS",c[c.GET_CELL_SIZE_PIXELS=1]="GET_CELL_SIZE_PIXELS"})(k=M.WindowsOptionsReportType||(M.WindowsOptionsReportType={}));var o=function(){function c(_,y,f,C){this._bufferService=_,this._coreService=y,this._logService=f,this._optionsService=C,this._data=new Uint32Array(0)}return c.prototype.hook=function(_){this._data=new Uint32Array(0)},c.prototype.put=function(_,y,f){this._data=e.concat(this._data,_.subarray(y,f))},c.prototype.unhook=function(_){if(_){var y=E.utf32ToString(this._data);switch(this._data=new Uint32Array(0),y){case'"q':return this._coreService.triggerDataEvent(S.C0.ESC+'P1$r0"q'+S.C0.ESC+"\\");case'"p':return this._coreService.triggerDataEvent(S.C0.ESC+'P1$r61;1"p'+S.C0.ESC+"\\");case"r":var f=this._bufferService.buffer.scrollTop+1+";"+(this._bufferService.buffer.scrollBottom+1)+"r";return this._coreService.triggerDataEvent(S.C0.ESC+"P1$r"+f+S.C0.ESC+"\\");case"m":return this._coreService.triggerDataEvent(S.C0.ESC+"P1$r0m"+S.C0.ESC+"\\");case" q":var C={block:2,underline:4,bar:6}[this._optionsService.options.cursorStyle];return C-=this._optionsService.options.cursorBlink?1:0,this._coreService.triggerDataEvent(S.C0.ESC+"P1$r"+C+" q"+S.C0.ESC+"\\");default:this._logService.debug("Unknown DCS $q %s",y),this._coreService.triggerDataEvent(S.C0.ESC+"P0$r"+S.C0.ESC+"\\")}}else this._data=new Uint32Array(0)},c}(),u=function(c){function _(y,f,C,L,R,O,g,m,d){d===void 0&&(d=new T.EscapeSequenceParser);var h=c.call(this)||this;h._bufferService=y,h._charsetService=f,h._coreService=C,h._dirtyRowService=L,h._logService=R,h._optionsService=O,h._coreMouseService=g,h._unicodeService=m,h._parser=d,h._parseBuffer=new Uint32Array(4096),h._stringDecoder=new E.StringToUtf32,h._utf8Decoder=new E.Utf8ToUtf32,h._workCell=new r.CellData,h._windowTitle="",h._iconName="",h._windowTitleStack=[],h._iconNameStack=[],h._curAttrData=s.DEFAULT_ATTR_DATA.clone(),h._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone(),h._onRequestBell=new n.EventEmitter,h._onRequestRefreshRows=new n.EventEmitter,h._onRequestReset=new n.EventEmitter,h._onRequestScroll=new n.EventEmitter,h._onRequestSyncScrollBar=new n.EventEmitter,h._onRequestWindowsOptionsReport=new n.EventEmitter,h._onA11yChar=new n.EventEmitter,h._onA11yTab=new n.EventEmitter,h._onCursorMove=new n.EventEmitter,h._onLineFeed=new n.EventEmitter,h._onScroll=new n.EventEmitter,h._onTitleChange=new n.EventEmitter,h.register(h._parser),h._parser.setCsiHandlerFallback(function(D,I){h._logService.debug("Unknown CSI code: ",{identifier:h._parser.identToString(D),params:I.toArray()})}),h._parser.setEscHandlerFallback(function(D){h._logService.debug("Unknown ESC code: ",{identifier:h._parser.identToString(D)})}),h._parser.setExecuteHandlerFallback(function(D){h._logService.debug("Unknown EXECUTE code: ",{code:D})}),h._parser.setOscHandlerFallback(function(D,I,F){h._logService.debug("Unknown OSC code: ",{identifier:D,action:I,data:F})}),h._parser.setDcsHandlerFallback(function(D,I,F){I==="HOOK"&&(F=F.toArray()),h._logService.debug("Unknown DCS code: ",{identifier:h._parser.identToString(D),action:I,payload:F})}),h._parser.setPrintHandler(function(D,I,F){return h.print(D,I,F)}),h._parser.setCsiHandler({final:"@"},function(D){return h.insertChars(D)}),h._parser.setCsiHandler({intermediates:" ",final:"@"},function(D){return h.scrollLeft(D)}),h._parser.setCsiHandler({final:"A"},function(D){return h.cursorUp(D)}),h._parser.setCsiHandler({intermediates:" ",final:"A"},function(D){return h.scrollRight(D)}),h._parser.setCsiHandler({final:"B"},function(D){return h.cursorDown(D)}),h._parser.setCsiHandler({final:"C"},function(D){return h.cursorForward(D)}),h._parser.setCsiHandler({final:"D"},function(D){return h.cursorBackward(D)}),h._parser.setCsiHandler({final:"E"},function(D){return h.cursorNextLine(D)}),h._parser.setCsiHandler({final:"F"},function(D){return h.cursorPrecedingLine(D)}),h._parser.setCsiHandler({final:"G"},function(D){return h.cursorCharAbsolute(D)}),h._parser.setCsiHandler({final:"H"},function(D){return h.cursorPosition(D)}),h._parser.setCsiHandler({final:"I"},function(D){return h.cursorForwardTab(D)}),h._parser.setCsiHandler({final:"J"},function(D){return h.eraseInDisplay(D)}),h._parser.setCsiHandler({prefix:"?",final:"J"},function(D){return h.eraseInDisplay(D)}),h._parser.setCsiHandler({final:"K"},function(D){return h.eraseInLine(D)}),h._parser.setCsiHandler({prefix:"?",final:"K"},function(D){return h.eraseInLine(D)}),h._parser.setCsiHandler({final:"L"},function(D){return h.insertLines(D)}),h._parser.setCsiHandler({final:"M"},function(D){return h.deleteLines(D)}),h._parser.setCsiHandler({final:"P"},function(D){return h.deleteChars(D)}),h._parser.setCsiHandler({final:"S"},function(D){return h.scrollUp(D)}),h._parser.setCsiHandler({final:"T"},function(D){return h.scrollDown(D)}),h._parser.setCsiHandler({final:"X"},function(D){return h.eraseChars(D)}),h._parser.setCsiHandler({final:"Z"},function(D){return h.cursorBackwardTab(D)}),h._parser.setCsiHandler({final:"`"},function(D){return h.charPosAbsolute(D)}),h._parser.setCsiHandler({final:"a"},function(D){return h.hPositionRelative(D)}),h._parser.setCsiHandler({final:"b"},function(D){return h.repeatPrecedingCharacter(D)}),h._parser.setCsiHandler({final:"c"},function(D){return h.sendDeviceAttributesPrimary(D)}),h._parser.setCsiHandler({prefix:">",final:"c"},function(D){return h.sendDeviceAttributesSecondary(D)}),h._parser.setCsiHandler({final:"d"},function(D){return h.linePosAbsolute(D)}),h._parser.setCsiHandler({final:"e"},function(D){return h.vPositionRelative(D)}),h._parser.setCsiHandler({final:"f"},function(D){return h.hVPosition(D)}),h._parser.setCsiHandler({final:"g"},function(D){return h.tabClear(D)}),h._parser.setCsiHandler({final:"h"},function(D){return h.setMode(D)}),h._parser.setCsiHandler({prefix:"?",final:"h"},function(D){return h.setModePrivate(D)}),h._parser.setCsiHandler({final:"l"},function(D){return h.resetMode(D)}),h._parser.setCsiHandler({prefix:"?",final:"l"},function(D){return h.resetModePrivate(D)}),h._parser.setCsiHandler({final:"m"},function(D){return h.charAttributes(D)}),h._parser.setCsiHandler({final:"n"},function(D){return h.deviceStatus(D)}),h._parser.setCsiHandler({prefix:"?",final:"n"},function(D){return h.deviceStatusPrivate(D)}),h._parser.setCsiHandler({intermediates:"!",final:"p"},function(D){return h.softReset(D)}),h._parser.setCsiHandler({intermediates:" ",final:"q"},function(D){return h.setCursorStyle(D)}),h._parser.setCsiHandler({final:"r"},function(D){return h.setScrollRegion(D)}),h._parser.setCsiHandler({final:"s"},function(D){return h.saveCursor(D)}),h._parser.setCsiHandler({final:"t"},function(D){return h.windowOptions(D)}),h._parser.setCsiHandler({final:"u"},function(D){return h.restoreCursor(D)}),h._parser.setCsiHandler({intermediates:"'",final:"}"},function(D){return h.insertColumns(D)}),h._parser.setCsiHandler({intermediates:"'",final:"~"},function(D){return h.deleteColumns(D)}),h._parser.setExecuteHandler(S.C0.BEL,function(){return h.bell()}),h._parser.setExecuteHandler(S.C0.LF,function(){return h.lineFeed()}),h._parser.setExecuteHandler(S.C0.VT,function(){return h.lineFeed()}),h._parser.setExecuteHandler(S.C0.FF,function(){return h.lineFeed()}),h._parser.setExecuteHandler(S.C0.CR,function(){return h.carriageReturn()}),h._parser.setExecuteHandler(S.C0.BS,function(){return h.backspace()}),h._parser.setExecuteHandler(S.C0.HT,function(){return h.tab()}),h._parser.setExecuteHandler(S.C0.SO,function(){return h.shiftOut()}),h._parser.setExecuteHandler(S.C0.SI,function(){return h.shiftIn()}),h._parser.setExecuteHandler(S.C1.IND,function(){return h.index()}),h._parser.setExecuteHandler(S.C1.NEL,function(){return h.nextLine()}),h._parser.setExecuteHandler(S.C1.HTS,function(){return h.tabSet()}),h._parser.setOscHandler(0,new a.OscHandler(function(D){h.setTitle(D),h.setIconName(D)})),h._parser.setOscHandler(1,new a.OscHandler(function(D){return h.setIconName(D)})),h._parser.setOscHandler(2,new a.OscHandler(function(D){return h.setTitle(D)})),h._parser.setEscHandler({final:"7"},function(){return h.saveCursor()}),h._parser.setEscHandler({final:"8"},function(){return h.restoreCursor()}),h._parser.setEscHandler({final:"D"},function(){return h.index()}),h._parser.setEscHandler({final:"E"},function(){return h.nextLine()}),h._parser.setEscHandler({final:"H"},function(){return h.tabSet()}),h._parser.setEscHandler({final:"M"},function(){return h.reverseIndex()}),h._parser.setEscHandler({final:"="},function(){return h.keypadApplicationMode()}),h._parser.setEscHandler({final:">"},function(){return h.keypadNumericMode()}),h._parser.setEscHandler({final:"c"},function(){return h.fullReset()}),h._parser.setEscHandler({final:"n"},function(){return h.setgLevel(2)}),h._parser.setEscHandler({final:"o"},function(){return h.setgLevel(3)}),h._parser.setEscHandler({final:"|"},function(){return h.setgLevel(3)}),h._parser.setEscHandler({final:"}"},function(){return h.setgLevel(2)}),h._parser.setEscHandler({final:"~"},function(){return h.setgLevel(1)}),h._parser.setEscHandler({intermediates:"%",final:"@"},function(){return h.selectDefaultCharset()}),h._parser.setEscHandler({intermediates:"%",final:"G"},function(){return h.selectDefaultCharset()});var A=function(D){w._parser.setEscHandler({intermediates:"(",final:D},function(){return h.selectCharset("("+D)}),w._parser.setEscHandler({intermediates:")",final:D},function(){return h.selectCharset(")"+D)}),w._parser.setEscHandler({intermediates:"*",final:D},function(){return h.selectCharset("*"+D)}),w._parser.setEscHandler({intermediates:"+",final:D},function(){return h.selectCharset("+"+D)}),w._parser.setEscHandler({intermediates:"-",final:D},function(){return h.selectCharset("-"+D)}),w._parser.setEscHandler({intermediates:".",final:D},function(){return h.selectCharset("."+D)}),w._parser.setEscHandler({intermediates:"/",final:D},function(){return h.selectCharset("/"+D)})},w=this;for(var x in P.CHARSETS)A(x);return h._parser.setEscHandler({intermediates:"#",final:"8"},function(){return h.screenAlignmentPattern()}),h._parser.setErrorHandler(function(D){return h._logService.error("Parsing error: ",D),D}),h._parser.setDcsHandler({intermediates:"$",final:"q"},new o(h._bufferService,h._coreService,h._logService,h._optionsService)),h}return U(_,c),Object.defineProperty(_.prototype,"onRequestBell",{get:function(){return this._onRequestBell.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestRefreshRows",{get:function(){return this._onRequestRefreshRows.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestReset",{get:function(){return this._onRequestReset.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestScroll",{get:function(){return this._onRequestScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestSyncScrollBar",{get:function(){return this._onRequestSyncScrollBar.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onRequestWindowsOptionsReport",{get:function(){return this._onRequestWindowsOptionsReport.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onA11yChar",{get:function(){return this._onA11yChar.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onA11yTab",{get:function(){return this._onA11yTab.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(_.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),_.prototype.dispose=function(){c.prototype.dispose.call(this)},_.prototype.parse=function(y){var f=this._bufferService.buffer,C=f.x,L=f.y;if(this._logService.debug("parsing data",y),this._parseBuffer.length<y.length&&this._parseBuffer.length<131072&&(this._parseBuffer=new Uint32Array(Math.min(y.length,131072))),this._dirtyRowService.clearRange(),y.length>131072)for(var R=0;R<y.length;R+=131072){var O=R+131072<y.length?R+131072:y.length,g=typeof y=="string"?this._stringDecoder.decode(y.substring(R,O),this._parseBuffer):this._utf8Decoder.decode(y.subarray(R,O),this._parseBuffer);this._parser.parse(this._parseBuffer,g)}else g=typeof y=="string"?this._stringDecoder.decode(y,this._parseBuffer):this._utf8Decoder.decode(y,this._parseBuffer),this._parser.parse(this._parseBuffer,g);(f=this._bufferService.buffer).x===C&&f.y===L||this._onCursorMove.fire(),this._onRequestRefreshRows.fire(this._dirtyRowService.start,this._dirtyRowService.end)},_.prototype.print=function(y,f,C){var L,R,O=this._bufferService.buffer,g=this._charsetService.charset,m=this._optionsService.options.screenReaderMode,d=this._bufferService.cols,h=this._coreService.decPrivateModes.wraparound,A=this._coreService.modes.insertMode,w=this._curAttrData,x=O.lines.get(O.ybase+O.y);this._dirtyRowService.markDirty(O.y),O.x&&C-f>0&&x.getWidth(O.x-1)===2&&x.setCellFromCodePoint(O.x-1,0,1,w.fg,w.bg,w.extended);for(var D=f;D<C;++D){if(L=y[D],R=this._unicodeService.wcwidth(L),L<127&&g){var I=g[String.fromCharCode(L)];I&&(L=I.charCodeAt(0))}if(m&&this._onA11yChar.fire(E.stringFromCodePoint(L)),R||!O.x){if(O.x+R-1>=d){if(h){for(;O.x<d;)x.setCellFromCodePoint(O.x++,0,1,w.fg,w.bg,w.extended);O.x=0,O.y++,O.y===O.scrollBottom+1?(O.y--,this._onRequestScroll.fire(this._eraseAttrData(),!0)):(O.y>=this._bufferService.rows&&(O.y=this._bufferService.rows-1),O.lines.get(O.ybase+O.y).isWrapped=!0),x=O.lines.get(O.ybase+O.y)}else if(O.x=d-1,R===2)continue}if(A&&(x.insertCells(O.x,R,O.getNullCell(w),w),x.getWidth(d-1)===2&&x.setCellFromCodePoint(d-1,t.NULL_CELL_CODE,t.NULL_CELL_WIDTH,w.fg,w.bg,w.extended)),x.setCellFromCodePoint(O.x++,L,R,w.fg,w.bg,w.extended),R>0)for(;--R;)x.setCellFromCodePoint(O.x++,0,0,w.fg,w.bg,w.extended)}else x.getWidth(O.x-1)?x.addCodepointToCell(O.x-1,L):x.addCodepointToCell(O.x-2,L)}C-f>0&&(x.loadCell(O.x-1,this._workCell),this._workCell.getWidth()===2||this._workCell.getCode()>65535?this._parser.precedingCodepoint=0:this._workCell.isCombined()?this._parser.precedingCodepoint=this._workCell.getChars().charCodeAt(0):this._parser.precedingCodepoint=this._workCell.content),O.x<d&&C-f>0&&x.getWidth(O.x)===0&&!x.hasContent(O.x)&&x.setCellFromCodePoint(O.x,0,1,w.fg,w.bg,w.extended),this._dirtyRowService.markDirty(O.y)},_.prototype.addCsiHandler=function(y,f){var C=this;return y.final!=="t"||y.prefix||y.intermediates?this._parser.addCsiHandler(y,f):this._parser.addCsiHandler(y,function(L){return!l(L.params[0],C._optionsService.options.windowOptions)||f(L)})},_.prototype.addDcsHandler=function(y,f){return this._parser.addDcsHandler(y,new v.DcsHandler(f))},_.prototype.addEscHandler=function(y,f){return this._parser.addEscHandler(y,f)},_.prototype.addOscHandler=function(y,f){return this._parser.addOscHandler(y,new a.OscHandler(f))},_.prototype.bell=function(){this._onRequestBell.fire()},_.prototype.lineFeed=function(){var y=this._bufferService.buffer;this._dirtyRowService.markDirty(y.y),this._optionsService.options.convertEol&&(y.x=0),y.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),y.x>=this._bufferService.cols&&y.x--,this._dirtyRowService.markDirty(y.y),this._onLineFeed.fire()},_.prototype.carriageReturn=function(){this._bufferService.buffer.x=0},_.prototype.backspace=function(){var y,f=this._bufferService.buffer;if(!this._coreService.decPrivateModes.reverseWraparound)return this._restrictCursor(),void(f.x>0&&f.x--);if(this._restrictCursor(this._bufferService.cols),f.x>0)f.x--;else if(f.x===0&&f.y>f.scrollTop&&f.y<=f.scrollBottom&&(!((y=f.lines.get(f.ybase+f.y))===null||y===void 0)&&y.isWrapped)){f.lines.get(f.ybase+f.y).isWrapped=!1,f.y--,f.x=this._bufferService.cols-1;var C=f.lines.get(f.ybase+f.y);C.hasWidth(f.x)&&!C.hasContent(f.x)&&f.x--}this._restrictCursor()},_.prototype.tab=function(){if(!(this._bufferService.buffer.x>=this._bufferService.cols)){var y=this._bufferService.buffer.x;this._bufferService.buffer.x=this._bufferService.buffer.nextStop(),this._optionsService.options.screenReaderMode&&this._onA11yTab.fire(this._bufferService.buffer.x-y)}},_.prototype.shiftOut=function(){this._charsetService.setgLevel(1)},_.prototype.shiftIn=function(){this._charsetService.setgLevel(0)},_.prototype._restrictCursor=function(y){y===void 0&&(y=this._bufferService.cols-1),this._bufferService.buffer.x=Math.min(y,Math.max(0,this._bufferService.buffer.x)),this._bufferService.buffer.y=this._coreService.decPrivateModes.origin?Math.min(this._bufferService.buffer.scrollBottom,Math.max(this._bufferService.buffer.scrollTop,this._bufferService.buffer.y)):Math.min(this._bufferService.rows-1,Math.max(0,this._bufferService.buffer.y)),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype._setCursor=function(y,f){this._dirtyRowService.markDirty(this._bufferService.buffer.y),this._coreService.decPrivateModes.origin?(this._bufferService.buffer.x=y,this._bufferService.buffer.y=this._bufferService.buffer.scrollTop+f):(this._bufferService.buffer.x=y,this._bufferService.buffer.y=f),this._restrictCursor(),this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype._moveCursor=function(y,f){this._restrictCursor(),this._setCursor(this._bufferService.buffer.x+y,this._bufferService.buffer.y+f)},_.prototype.cursorUp=function(y){var f=this._bufferService.buffer.y-this._bufferService.buffer.scrollTop;f>=0?this._moveCursor(0,-Math.min(f,y.params[0]||1)):this._moveCursor(0,-(y.params[0]||1))},_.prototype.cursorDown=function(y){var f=this._bufferService.buffer.scrollBottom-this._bufferService.buffer.y;f>=0?this._moveCursor(0,Math.min(f,y.params[0]||1)):this._moveCursor(0,y.params[0]||1)},_.prototype.cursorForward=function(y){this._moveCursor(y.params[0]||1,0)},_.prototype.cursorBackward=function(y){this._moveCursor(-(y.params[0]||1),0)},_.prototype.cursorNextLine=function(y){this.cursorDown(y),this._bufferService.buffer.x=0},_.prototype.cursorPrecedingLine=function(y){this.cursorUp(y),this._bufferService.buffer.x=0},_.prototype.cursorCharAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.cursorPosition=function(y){this._setCursor(y.length>=2?(y.params[1]||1)-1:0,(y.params[0]||1)-1)},_.prototype.charPosAbsolute=function(y){this._setCursor((y.params[0]||1)-1,this._bufferService.buffer.y)},_.prototype.hPositionRelative=function(y){this._moveCursor(y.params[0]||1,0)},_.prototype.linePosAbsolute=function(y){this._setCursor(this._bufferService.buffer.x,(y.params[0]||1)-1)},_.prototype.vPositionRelative=function(y){this._moveCursor(0,y.params[0]||1)},_.prototype.hVPosition=function(y){this.cursorPosition(y)},_.prototype.tabClear=function(y){var f=y.params[0];f===0?delete this._bufferService.buffer.tabs[this._bufferService.buffer.x]:f===3&&(this._bufferService.buffer.tabs={})},_.prototype.cursorForwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var f=y.params[0]||1;f--;)this._bufferService.buffer.x=this._bufferService.buffer.nextStop()},_.prototype.cursorBackwardTab=function(y){if(!(this._bufferService.buffer.x>=this._bufferService.cols))for(var f=y.params[0]||1,C=this._bufferService.buffer;f--;)C.x=C.prevStop()},_.prototype._eraseInBufferLine=function(y,f,C,L){L===void 0&&(L=!1);var R=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);R.replaceCells(f,C,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),L&&(R.isWrapped=!1)},_.prototype._resetBufferLine=function(y){var f=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+y);f.fill(this._bufferService.buffer.getNullCell(this._eraseAttrData())),f.isWrapped=!1},_.prototype.eraseInDisplay=function(y){var f;switch(this._restrictCursor(),y.params[0]){case 0:for(f=this._bufferService.buffer.y,this._dirtyRowService.markDirty(f),this._eraseInBufferLine(f++,this._bufferService.buffer.x,this._bufferService.cols,this._bufferService.buffer.x===0);f<this._bufferService.rows;f++)this._resetBufferLine(f);this._dirtyRowService.markDirty(f);break;case 1:for(f=this._bufferService.buffer.y,this._dirtyRowService.markDirty(f),this._eraseInBufferLine(f,0,this._bufferService.buffer.x+1,!0),this._bufferService.buffer.x+1>=this._bufferService.cols&&(this._bufferService.buffer.lines.get(f+1).isWrapped=!1);f--;)this._resetBufferLine(f);this._dirtyRowService.markDirty(0);break;case 2:for(f=this._bufferService.rows,this._dirtyRowService.markDirty(f-1);f--;)this._resetBufferLine(f);this._dirtyRowService.markDirty(0);break;case 3:var C=this._bufferService.buffer.lines.length-this._bufferService.rows;C>0&&(this._bufferService.buffer.lines.trimStart(C),this._bufferService.buffer.ybase=Math.max(this._bufferService.buffer.ybase-C,0),this._bufferService.buffer.ydisp=Math.max(this._bufferService.buffer.ydisp-C,0),this._onScroll.fire(0))}},_.prototype.eraseInLine=function(y){switch(this._restrictCursor(),y.params[0]){case 0:this._eraseInBufferLine(this._bufferService.buffer.y,this._bufferService.buffer.x,this._bufferService.cols);break;case 1:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.buffer.x+1);break;case 2:this._eraseInBufferLine(this._bufferService.buffer.y,0,this._bufferService.cols)}this._dirtyRowService.markDirty(this._bufferService.buffer.y)},_.prototype.insertLines=function(y){this._restrictCursor();var f=y.params[0]||1,C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){for(var L=C.ybase+C.y,R=this._bufferService.rows-1-C.scrollBottom,O=this._bufferService.rows-1+C.ybase-R+1;f--;)C.lines.splice(O-1,1),C.lines.splice(L,0,C.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(C.y,C.scrollBottom),C.x=0}},_.prototype.deleteLines=function(y){this._restrictCursor();var f=y.params[0]||1,C=this._bufferService.buffer;if(!(C.y>C.scrollBottom||C.y<C.scrollTop)){var L,R=C.ybase+C.y;for(L=this._bufferService.rows-1-C.scrollBottom,L=this._bufferService.rows-1+C.ybase-L;f--;)C.lines.splice(R,1),C.lines.splice(L,0,C.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(C.y,C.scrollBottom),C.x=0}},_.prototype.insertChars=function(y){this._restrictCursor();var f=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);f&&(f.insertCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.deleteChars=function(y){this._restrictCursor();var f=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);f&&(f.deleteCells(this._bufferService.buffer.x,y.params[0]||1,this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.scrollUp=function(y){for(var f=y.params[0]||1,C=this._bufferService.buffer;f--;)C.lines.splice(C.ybase+C.scrollTop,1),C.lines.splice(C.ybase+C.scrollBottom,0,C.getBlankLine(this._eraseAttrData()));this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)},_.prototype.scrollDown=function(y){for(var f=y.params[0]||1,C=this._bufferService.buffer;f--;)C.lines.splice(C.ybase+C.scrollBottom,1),C.lines.splice(C.ybase+C.scrollTop,0,C.getBlankLine(s.DEFAULT_ATTR_DATA));this._dirtyRowService.markRangeDirty(C.scrollTop,C.scrollBottom)},_.prototype.scrollLeft=function(y){var f=this._bufferService.buffer;if(!(f.y>f.scrollBottom||f.y<f.scrollTop)){for(var C=y.params[0]||1,L=f.scrollTop;L<=f.scrollBottom;++L){var R=f.lines.get(f.ybase+L);R.deleteCells(0,C,f.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}this._dirtyRowService.markRangeDirty(f.scrollTop,f.scrollBottom)}},_.prototype.scrollRight=function(y){var f=this._bufferService.buffer;if(!(f.y>f.scrollBottom||f.y<f.scrollTop)){for(var C=y.params[0]||1,L=f.scrollTop;L<=f.scrollBottom;++L){var R=f.lines.get(f.ybase+L);R.insertCells(0,C,f.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}this._dirtyRowService.markRangeDirty(f.scrollTop,f.scrollBottom)}},_.prototype.insertColumns=function(y){var f=this._bufferService.buffer;if(!(f.y>f.scrollBottom||f.y<f.scrollTop)){for(var C=y.params[0]||1,L=f.scrollTop;L<=f.scrollBottom;++L){var R=this._bufferService.buffer.lines.get(f.ybase+L);R.insertCells(f.x,C,f.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}this._dirtyRowService.markRangeDirty(f.scrollTop,f.scrollBottom)}},_.prototype.deleteColumns=function(y){var f=this._bufferService.buffer;if(!(f.y>f.scrollBottom||f.y<f.scrollTop)){for(var C=y.params[0]||1,L=f.scrollTop;L<=f.scrollBottom;++L){var R=f.lines.get(f.ybase+L);R.deleteCells(f.x,C,f.getNullCell(this._eraseAttrData()),this._eraseAttrData()),R.isWrapped=!1}this._dirtyRowService.markRangeDirty(f.scrollTop,f.scrollBottom)}},_.prototype.eraseChars=function(y){this._restrictCursor();var f=this._bufferService.buffer.lines.get(this._bufferService.buffer.ybase+this._bufferService.buffer.y);f&&(f.replaceCells(this._bufferService.buffer.x,this._bufferService.buffer.x+(y.params[0]||1),this._bufferService.buffer.getNullCell(this._eraseAttrData()),this._eraseAttrData()),this._dirtyRowService.markDirty(this._bufferService.buffer.y))},_.prototype.repeatPrecedingCharacter=function(y){if(this._parser.precedingCodepoint){for(var f=y.params[0]||1,C=new Uint32Array(f),L=0;L<f;++L)C[L]=this._parser.precedingCodepoint;this.print(C,0,C.length)}},_.prototype.sendDeviceAttributesPrimary=function(y){y.params[0]>0||(this._is("xterm")||this._is("rxvt-unicode")||this._is("screen")?this._coreService.triggerDataEvent(S.C0.ESC+"[?1;2c"):this._is("linux")&&this._coreService.triggerDataEvent(S.C0.ESC+"[?6c"))},_.prototype.sendDeviceAttributesSecondary=function(y){y.params[0]>0||(this._is("xterm")?this._coreService.triggerDataEvent(S.C0.ESC+"[>0;276;0c"):this._is("rxvt-unicode")?this._coreService.triggerDataEvent(S.C0.ESC+"[>85;95;0c"):this._is("linux")?this._coreService.triggerDataEvent(y.params[0]+"c"):this._is("screen")&&this._coreService.triggerDataEvent(S.C0.ESC+"[>83;40003;0c"))},_.prototype._is=function(y){return(this._optionsService.options.termName+"").indexOf(y)===0},_.prototype.setMode=function(y){for(var f=0;f<y.length;f++)switch(y.params[f]){case 4:this._coreService.modes.insertMode=!0}},_.prototype.setModePrivate=function(y){for(var f=0;f<y.length;f++)switch(y.params[f]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!0;break;case 2:this._charsetService.setgCharset(0,P.DEFAULT_CHARSET),this._charsetService.setgCharset(1,P.DEFAULT_CHARSET),this._charsetService.setgCharset(2,P.DEFAULT_CHARSET),this._charsetService.setgCharset(3,P.DEFAULT_CHARSET);break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(132,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!0,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!0;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!0;break;case 66:this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire();break;case 9:this._coreMouseService.activeProtocol="X10";break;case 1e3:this._coreMouseService.activeProtocol="VT200";break;case 1002:this._coreMouseService.activeProtocol="DRAG";break;case 1003:this._coreMouseService.activeProtocol="ANY";break;case 1004:this._coreService.decPrivateModes.sendFocus=!0;break;case 1005:this._logService.debug("DECSET 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="SGR";break;case 1015:this._logService.debug("DECSET 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!1;break;case 1048:this.saveCursor();break;case 1049:this.saveCursor();case 47:case 1047:this._bufferService.buffers.activateAltBuffer(this._eraseAttrData()),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!0}},_.prototype.resetMode=function(y){for(var f=0;f<y.length;f++)switch(y.params[f]){case 4:this._coreService.modes.insertMode=!1}},_.prototype.resetModePrivate=function(y){for(var f=0;f<y.length;f++)switch(y.params[f]){case 1:this._coreService.decPrivateModes.applicationCursorKeys=!1;break;case 3:this._optionsService.options.windowOptions.setWinLines&&(this._bufferService.resize(80,this._bufferService.rows),this._onRequestReset.fire());break;case 6:this._coreService.decPrivateModes.origin=!1,this._setCursor(0,0);break;case 7:this._coreService.decPrivateModes.wraparound=!1;break;case 12:break;case 45:this._coreService.decPrivateModes.reverseWraparound=!1;break;case 66:this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire();break;case 9:case 1e3:case 1002:case 1003:this._coreMouseService.activeProtocol="NONE";break;case 1004:this._coreService.decPrivateModes.sendFocus=!1;break;case 1005:this._logService.debug("DECRST 1005 not supported (see #2507)");break;case 1006:this._coreMouseService.activeEncoding="DEFAULT";break;case 1015:this._logService.debug("DECRST 1015 not supported (see #2507)");break;case 25:this._coreService.isCursorHidden=!0;break;case 1048:this.restoreCursor();break;case 1049:case 47:case 1047:this._bufferService.buffers.activateNormalBuffer(),y.params[f]===1049&&this.restoreCursor(),this._coreService.isCursorInitialized=!0,this._onRequestRefreshRows.fire(0,this._bufferService.rows-1),this._onRequestSyncScrollBar.fire();break;case 2004:this._coreService.decPrivateModes.bracketedPasteMode=!1}},_.prototype._updateAttrColor=function(y,f,C,L,R){return f===2?(y|=50331648,y&=-16777216,y|=i.AttributeData.fromColorRGB([C,L,R])):f===5&&(y&=-50331904,y|=33554432|255&C),y},_.prototype._extractColor=function(y,f,C){var L=[0,0,-1,0,0,0],R=0,O=0;do{if(L[O+R]=y.params[f+O],y.hasSubParams(f+O)){var g=y.getSubParams(f+O),m=0;do L[1]===5&&(R=1),L[O+m+1+R]=g[m];while(++m<g.length&&m+O+1+R<L.length);break}if(L[1]===5&&O+R>=2||L[1]===2&&O+R>=5)break;L[1]&&(R=1)}while(++O+f<y.length&&O+R<L.length);for(m=2;m<L.length;++m)L[m]===-1&&(L[m]=0);switch(L[0]){case 38:C.fg=this._updateAttrColor(C.fg,L[1],L[3],L[4],L[5]);break;case 48:C.bg=this._updateAttrColor(C.bg,L[1],L[3],L[4],L[5]);break;case 58:C.extended=C.extended.clone(),C.extended.underlineColor=this._updateAttrColor(C.extended.underlineColor,L[1],L[3],L[4],L[5])}return O},_.prototype._processUnderline=function(y,f){f.extended=f.extended.clone(),(!~y||y>5)&&(y=1),f.extended.underlineStyle=y,f.fg|=268435456,y===0&&(f.fg&=-268435457),f.updateExtended()},_.prototype.charAttributes=function(y){if(y.length===1&&y.params[0]===0)return this._curAttrData.fg=s.DEFAULT_ATTR_DATA.fg,void(this._curAttrData.bg=s.DEFAULT_ATTR_DATA.bg);for(var f,C=y.length,L=this._curAttrData,R=0;R<C;R++)(f=y.params[R])>=30&&f<=37?(L.fg&=-50331904,L.fg|=16777216|f-30):f>=40&&f<=47?(L.bg&=-50331904,L.bg|=16777216|f-40):f>=90&&f<=97?(L.fg&=-50331904,L.fg|=16777224|f-90):f>=100&&f<=107?(L.bg&=-50331904,L.bg|=16777224|f-100):f===0?(L.fg=s.DEFAULT_ATTR_DATA.fg,L.bg=s.DEFAULT_ATTR_DATA.bg):f===1?L.fg|=134217728:f===3?L.bg|=67108864:f===4?(L.fg|=268435456,this._processUnderline(y.hasSubParams(R)?y.getSubParams(R)[0]:1,L)):f===5?L.fg|=536870912:f===7?L.fg|=67108864:f===8?L.fg|=1073741824:f===2?L.bg|=134217728:f===21?this._processUnderline(2,L):f===22?(L.fg&=-134217729,L.bg&=-134217729):f===23?L.bg&=-67108865:f===24?L.fg&=-268435457:f===25?L.fg&=-536870913:f===27?L.fg&=-67108865:f===28?L.fg&=-1073741825:f===39?(L.fg&=-67108864,L.fg|=16777215&s.DEFAULT_ATTR_DATA.fg):f===49?(L.bg&=-67108864,L.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):f===38||f===48||f===58?R+=this._extractColor(y,R,L):f===59?(L.extended=L.extended.clone(),L.extended.underlineColor=-1,L.updateExtended()):f===100?(L.fg&=-67108864,L.fg|=16777215&s.DEFAULT_ATTR_DATA.fg,L.bg&=-67108864,L.bg|=16777215&s.DEFAULT_ATTR_DATA.bg):this._logService.debug("Unknown SGR attribute: %d.",f)},_.prototype.deviceStatus=function(y){switch(y.params[0]){case 5:this._coreService.triggerDataEvent(S.C0.ESC+"[0n");break;case 6:var f=this._bufferService.buffer.y+1,C=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(S.C0.ESC+"["+f+";"+C+"R")}},_.prototype.deviceStatusPrivate=function(y){switch(y.params[0]){case 6:var f=this._bufferService.buffer.y+1,C=this._bufferService.buffer.x+1;this._coreService.triggerDataEvent(S.C0.ESC+"[?"+f+";"+C+"R")}},_.prototype.softReset=function(y){this._coreService.isCursorHidden=!1,this._onRequestSyncScrollBar.fire(),this._bufferService.buffer.scrollTop=0,this._bufferService.buffer.scrollBottom=this._bufferService.rows-1,this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._coreService.reset(),this._charsetService.reset(),this._bufferService.buffer.savedX=0,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset,this._coreService.decPrivateModes.origin=!1},_.prototype.setCursorStyle=function(y){var f=y.params[0]||1;switch(f){case 1:case 2:this._optionsService.options.cursorStyle="block";break;case 3:case 4:this._optionsService.options.cursorStyle="underline";break;case 5:case 6:this._optionsService.options.cursorStyle="bar"}var C=f%2==1;this._optionsService.options.cursorBlink=C},_.prototype.setScrollRegion=function(y){var f,C=y.params[0]||1;(y.length<2||(f=y.params[1])>this._bufferService.rows||f===0)&&(f=this._bufferService.rows),f>C&&(this._bufferService.buffer.scrollTop=C-1,this._bufferService.buffer.scrollBottom=f-1,this._setCursor(0,0))},_.prototype.windowOptions=function(y){if(l(y.params[0],this._optionsService.options.windowOptions)){var f=y.length>1?y.params[1]:0;switch(y.params[0]){case 14:f!==2&&this._onRequestWindowsOptionsReport.fire(k.GET_WIN_SIZE_PIXELS);break;case 16:this._onRequestWindowsOptionsReport.fire(k.GET_CELL_SIZE_PIXELS);break;case 18:this._bufferService&&this._coreService.triggerDataEvent(S.C0.ESC+"[8;"+this._bufferService.rows+";"+this._bufferService.cols+"t");break;case 22:f!==0&&f!==2||(this._windowTitleStack.push(this._windowTitle),this._windowTitleStack.length>10&&this._windowTitleStack.shift()),f!==0&&f!==1||(this._iconNameStack.push(this._iconName),this._iconNameStack.length>10&&this._iconNameStack.shift());break;case 23:f!==0&&f!==2||this._windowTitleStack.length&&this.setTitle(this._windowTitleStack.pop()),f!==0&&f!==1||this._iconNameStack.length&&this.setIconName(this._iconNameStack.pop())}}},_.prototype.saveCursor=function(y){this._bufferService.buffer.savedX=this._bufferService.buffer.x,this._bufferService.buffer.savedY=this._bufferService.buffer.ybase+this._bufferService.buffer.y,this._bufferService.buffer.savedCurAttrData.fg=this._curAttrData.fg,this._bufferService.buffer.savedCurAttrData.bg=this._curAttrData.bg,this._bufferService.buffer.savedCharset=this._charsetService.charset},_.prototype.restoreCursor=function(y){this._bufferService.buffer.x=this._bufferService.buffer.savedX||0,this._bufferService.buffer.y=Math.max(this._bufferService.buffer.savedY-this._bufferService.buffer.ybase,0),this._curAttrData.fg=this._bufferService.buffer.savedCurAttrData.fg,this._curAttrData.bg=this._bufferService.buffer.savedCurAttrData.bg,this._charsetService.charset=this._savedCharset,this._bufferService.buffer.savedCharset&&(this._charsetService.charset=this._bufferService.buffer.savedCharset),this._restrictCursor()},_.prototype.setTitle=function(y){this._windowTitle=y,this._onTitleChange.fire(y)},_.prototype.setIconName=function(y){this._iconName=y},_.prototype.nextLine=function(){this._bufferService.buffer.x=0,this.index()},_.prototype.keypadApplicationMode=function(){this._logService.debug("Serial port requested application keypad."),this._coreService.decPrivateModes.applicationKeypad=!0,this._onRequestSyncScrollBar.fire()},_.prototype.keypadNumericMode=function(){this._logService.debug("Switching back to normal keypad."),this._coreService.decPrivateModes.applicationKeypad=!1,this._onRequestSyncScrollBar.fire()},_.prototype.selectDefaultCharset=function(){this._charsetService.setgLevel(0),this._charsetService.setgCharset(0,P.DEFAULT_CHARSET)},_.prototype.selectCharset=function(y){y.length===2?y[0]!=="/"&&this._charsetService.setgCharset(p[y[0]],P.CHARSETS[y[1]]||P.DEFAULT_CHARSET):this.selectDefaultCharset()},_.prototype.index=function(){this._restrictCursor();var y=this._bufferService.buffer;this._bufferService.buffer.y++,y.y===y.scrollBottom+1?(y.y--,this._onRequestScroll.fire(this._eraseAttrData())):y.y>=this._bufferService.rows&&(y.y=this._bufferService.rows-1),this._restrictCursor()},_.prototype.tabSet=function(){this._bufferService.buffer.tabs[this._bufferService.buffer.x]=!0},_.prototype.reverseIndex=function(){this._restrictCursor();var y=this._bufferService.buffer;if(y.y===y.scrollTop){var f=y.scrollBottom-y.scrollTop;y.lines.shiftElements(y.ybase+y.y,f,1),y.lines.set(y.ybase+y.y,y.getBlankLine(this._eraseAttrData())),this._dirtyRowService.markRangeDirty(y.scrollTop,y.scrollBottom)}else y.y--,this._restrictCursor()},_.prototype.fullReset=function(){this._parser.reset(),this._onRequestReset.fire()},_.prototype.reset=function(){this._curAttrData=s.DEFAULT_ATTR_DATA.clone(),this._eraseAttrDataInternal=s.DEFAULT_ATTR_DATA.clone()},_.prototype._eraseAttrData=function(){return this._eraseAttrDataInternal.bg&=-67108864,this._eraseAttrDataInternal.bg|=67108863&this._curAttrData.bg,this._eraseAttrDataInternal},_.prototype.setgLevel=function(y){this._charsetService.setgLevel(y)},_.prototype.screenAlignmentPattern=function(){var y=new r.CellData;y.content=1<<22|69,y.fg=this._curAttrData.fg,y.bg=this._curAttrData.bg;var f=this._bufferService.buffer;this._setCursor(0,0);for(var C=0;C<this._bufferService.rows;++C){var L=f.ybase+f.y+C,R=f.lines.get(L);R&&(R.fill(y),R.isWrapped=!1)}this._dirtyRowService.markAllDirty(),this._setCursor(0,0)},_}(b.Disposable);M.InputHandler=u},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.DEFAULT_CHARSET=M.CHARSETS=void 0,M.CHARSETS={},M.DEFAULT_CHARSET=M.CHARSETS.B,M.CHARSETS[0]={"`":"\u25C6",a:"\u2592",b:"\u2409",c:"\u240C",d:"\u240D",e:"\u240A",f:"\xB0",g:"\xB1",h:"\u2424",i:"\u240B",j:"\u2518",k:"\u2510",l:"\u250C",m:"\u2514",n:"\u253C",o:"\u23BA",p:"\u23BB",q:"\u2500",r:"\u23BC",s:"\u23BD",t:"\u251C",u:"\u2524",v:"\u2534",w:"\u252C",x:"\u2502",y:"\u2264",z:"\u2265","{":"\u03C0","|":"\u2260","}":"\xA3","~":"\xB7"},M.CHARSETS.A={"#":"\xA3"},M.CHARSETS.B=void 0,M.CHARSETS[4]={"#":"\xA3","@":"\xBE","[":"ij","\\":"\xBD","]":"|","{":"\xA8","|":"f","}":"\xBC","~":"\xB4"},M.CHARSETS.C=M.CHARSETS[5]={"[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},M.CHARSETS.R={"#":"\xA3","@":"\xE0","[":"\xB0","\\":"\xE7","]":"\xA7","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xA8"},M.CHARSETS.Q={"@":"\xE0","[":"\xE2","\\":"\xE7","]":"\xEA","^":"\xEE","`":"\xF4","{":"\xE9","|":"\xF9","}":"\xE8","~":"\xFB"},M.CHARSETS.K={"@":"\xA7","[":"\xC4","\\":"\xD6","]":"\xDC","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xDF"},M.CHARSETS.Y={"#":"\xA3","@":"\xA7","[":"\xB0","\\":"\xE7","]":"\xE9","`":"\xF9","{":"\xE0","|":"\xF2","}":"\xE8","~":"\xEC"},M.CHARSETS.E=M.CHARSETS[6]={"@":"\xC4","[":"\xC6","\\":"\xD8","]":"\xC5","^":"\xDC","`":"\xE4","{":"\xE6","|":"\xF8","}":"\xE5","~":"\xFC"},M.CHARSETS.Z={"#":"\xA3","@":"\xA7","[":"\xA1","\\":"\xD1","]":"\xBF","{":"\xB0","|":"\xF1","}":"\xE7"},M.CHARSETS.H=M.CHARSETS[7]={"@":"\xC9","[":"\xC4","\\":"\xD6","]":"\xC5","^":"\xDC","`":"\xE9","{":"\xE4","|":"\xF6","}":"\xE5","~":"\xFC"},M.CHARSETS["="]={"#":"\xF9","@":"\xE0","[":"\xE9","\\":"\xE7","]":"\xEA","^":"\xEE",_:"\xE8","`":"\xF4","{":"\xE4","|":"\xF6","}":"\xFC","~":"\xFB"}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.Params=void 0;var B=function(){function U(k,S){if(k===void 0&&(k=32),S===void 0&&(S=32),this.maxLength=k,this.maxSubParamsLength=S,S>256)throw new Error("maxSubParamsLength must not be greater than 256");this.params=new Int32Array(k),this.length=0,this._subParams=new Int32Array(S),this._subParamsLength=0,this._subParamsIdx=new Uint16Array(k),this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1}return U.fromArray=function(k){var S=new U;if(!k.length)return S;for(var P=k[0]instanceof Array?1:0;P<k.length;++P){var T=k[P];if(T instanceof Array)for(var b=0;b<T.length;++b)S.addSubParam(T[b]);else S.addParam(T)}return S},U.prototype.clone=function(){var k=new U(this.maxLength,this.maxSubParamsLength);return k.params.set(this.params),k.length=this.length,k._subParams.set(this._subParams),k._subParamsLength=this._subParamsLength,k._subParamsIdx.set(this._subParamsIdx),k._rejectDigits=this._rejectDigits,k._rejectSubDigits=this._rejectSubDigits,k._digitIsSub=this._digitIsSub,k},U.prototype.toArray=function(){for(var k=[],S=0;S<this.length;++S){k.push(this.params[S]);var P=this._subParamsIdx[S]>>8,T=255&this._subParamsIdx[S];T-P>0&&k.push(Array.prototype.slice.call(this._subParams,P,T))}return k},U.prototype.reset=function(){this.length=0,this._subParamsLength=0,this._rejectDigits=!1,this._rejectSubDigits=!1,this._digitIsSub=!1},U.prototype.addParam=function(k){if(this._digitIsSub=!1,this.length>=this.maxLength)this._rejectDigits=!0;else{if(k<-1)throw new Error("values lesser than -1 are not allowed");this._subParamsIdx[this.length]=this._subParamsLength<<8|this._subParamsLength,this.params[this.length++]=k>2147483647?2147483647:k}},U.prototype.addSubParam=function(k){if(this._digitIsSub=!0,this.length)if(this._rejectDigits||this._subParamsLength>=this.maxSubParamsLength)this._rejectSubDigits=!0;else{if(k<-1)throw new Error("values lesser than -1 are not allowed");this._subParams[this._subParamsLength++]=k>2147483647?2147483647:k,this._subParamsIdx[this.length-1]++}},U.prototype.hasSubParams=function(k){return(255&this._subParamsIdx[k])-(this._subParamsIdx[k]>>8)>0},U.prototype.getSubParams=function(k){var S=this._subParamsIdx[k]>>8,P=255&this._subParamsIdx[k];return P-S>0?this._subParams.subarray(S,P):null},U.prototype.getSubParamsAll=function(){for(var k={},S=0;S<this.length;++S){var P=this._subParamsIdx[S]>>8,T=255&this._subParamsIdx[S];T-P>0&&(k[S]=this._subParams.slice(P,T))}return k},U.prototype.addDigit=function(k){var S;if(!(this._rejectDigits||!(S=this._digitIsSub?this._subParamsLength:this.length)||this._digitIsSub&&this._rejectSubDigits)){var P=this._digitIsSub?this._subParams:this.params,T=P[S-1];P[S-1]=~T?Math.min(10*T+k,2147483647):k}},U}();M.Params=B},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.OscHandler=M.OscParser=void 0;var B=N(23),U=N(8),k=function(){function P(){this._state=0,this._id=-1,this._handlers=Object.create(null),this._handlerFb=function(){}}return P.prototype.addHandler=function(T,b){this._handlers[T]===void 0&&(this._handlers[T]=[]);var e=this._handlers[T];return e.push(b),{dispose:function(){var E=e.indexOf(b);E!==-1&&e.splice(E,1)}}},P.prototype.setHandler=function(T,b){this._handlers[T]=[b]},P.prototype.clearHandler=function(T){this._handlers[T]&&delete this._handlers[T]},P.prototype.setHandlerFallback=function(T){this._handlerFb=T},P.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},P.prototype.reset=function(){this._state===2&&this.end(!1),this._id=-1,this._state=0},P.prototype._start=function(){var T=this._handlers[this._id];if(T)for(var b=T.length-1;b>=0;b--)T[b].start();else this._handlerFb(this._id,"START")},P.prototype._put=function(T,b,e){var E=this._handlers[this._id];if(E)for(var s=E.length-1;s>=0;s--)E[s].put(T,b,e);else this._handlerFb(this._id,"PUT",U.utf32ToString(T,b,e))},P.prototype._end=function(T){var b=this._handlers[this._id];if(b){for(var e=b.length-1;e>=0&&b[e].end(T)===!1;e--);for(e--;e>=0;e--)b[e].end(!1)}else this._handlerFb(this._id,"END",T)},P.prototype.start=function(){this.reset(),this._id=-1,this._state=1},P.prototype.put=function(T,b,e){if(this._state!==3){if(this._state===1)for(;b<e;){var E=T[b++];if(E===59){this._state=2,this._start();break}if(E<48||57<E)return void(this._state=3);this._id===-1&&(this._id=0),this._id=10*this._id+E-48}this._state===2&&e-b>0&&this._put(T,b,e)}},P.prototype.end=function(T){this._state!==0&&(this._state!==3&&(this._state===1&&this._start(),this._end(T)),this._id=-1,this._state=0)},P}();M.OscParser=k;var S=function(){function P(T){this._handler=T,this._data="",this._hitLimit=!1}return P.prototype.start=function(){this._data="",this._hitLimit=!1},P.prototype.put=function(T,b,e){this._hitLimit||(this._data+=U.utf32ToString(T,b,e),this._data.length>B.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},P.prototype.end=function(T){var b;return this._hitLimit?b=!1:T&&(b=this._handler(this._data)),this._data="",this._hitLimit=!1,b},P}();M.OscHandler=S},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.PAYLOAD_LIMIT=void 0,M.PAYLOAD_LIMIT=1e7},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.DcsHandler=M.DcsParser=void 0;var B=N(8),U=N(21),k=N(23),S=[],P=function(){function b(){this._handlers=Object.create(null),this._active=S,this._ident=0,this._handlerFb=function(){}}return b.prototype.dispose=function(){this._handlers=Object.create(null),this._handlerFb=function(){}},b.prototype.addHandler=function(e,E){this._handlers[e]===void 0&&(this._handlers[e]=[]);var s=this._handlers[e];return s.push(E),{dispose:function(){var n=s.indexOf(E);n!==-1&&s.splice(n,1)}}},b.prototype.setHandler=function(e,E){this._handlers[e]=[E]},b.prototype.clearHandler=function(e){this._handlers[e]&&delete this._handlers[e]},b.prototype.setHandlerFallback=function(e){this._handlerFb=e},b.prototype.reset=function(){this._active.length&&this.unhook(!1),this._active=S,this._ident=0},b.prototype.hook=function(e,E){if(this.reset(),this._ident=e,this._active=this._handlers[e]||S,this._active.length)for(var s=this._active.length-1;s>=0;s--)this._active[s].hook(E);else this._handlerFb(this._ident,"HOOK",E)},b.prototype.put=function(e,E,s){if(this._active.length)for(var n=this._active.length-1;n>=0;n--)this._active[n].put(e,E,s);else this._handlerFb(this._ident,"PUT",B.utf32ToString(e,E,s))},b.prototype.unhook=function(e){if(this._active.length){for(var E=this._active.length-1;E>=0&&this._active[E].unhook(e)===!1;E--);for(E--;E>=0;E--)this._active[E].unhook(!1)}else this._handlerFb(this._ident,"UNHOOK",e);this._active=S,this._ident=0},b}();M.DcsParser=P;var T=function(){function b(e){this._handler=e,this._data="",this._hitLimit=!1}return b.prototype.hook=function(e){this._params=e.clone(),this._data="",this._hitLimit=!1},b.prototype.put=function(e,E,s){this._hitLimit||(this._data+=B.utf32ToString(e,E,s),this._data.length>k.PAYLOAD_LIMIT&&(this._data="",this._hitLimit=!0))},b.prototype.unhook=function(e){var E;return this._hitLimit?E=!1:e&&(E=this._handler(this._data,this._params||new U.Params)),this._params=void 0,this._data="",this._hitLimit=!1,E},b}();M.DcsHandler=T},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.removeTerminalFromCache=M.acquireCharAtlas=void 0;var B=N(26),U=N(43),k=[];M.acquireCharAtlas=function(S,P,T,b,e){for(var E=B.generateConfig(b,e,S,T),s=0;s<k.length;s++){var n=(t=k[s]).ownedBy.indexOf(P);if(n>=0){if(B.configEquals(t.config,E))return t.atlas;t.ownedBy.length===1?(t.atlas.dispose(),k.splice(s,1)):t.ownedBy.splice(n,1);break}}for(s=0;s<k.length;s++){var t=k[s];if(B.configEquals(t.config,E))return t.ownedBy.push(P),t.atlas}var r={atlas:new U.DynamicCharAtlas(document,E),config:E,ownedBy:[P]};return k.push(r),r.atlas},M.removeTerminalFromCache=function(S){for(var P=0;P<k.length;P++){var T=k[P].ownedBy.indexOf(S);if(T!==-1){k[P].ownedBy.length===1?(k[P].atlas.dispose(),k.splice(P,1)):k[P].ownedBy.splice(T,1);break}}}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.is256Color=M.configEquals=M.generateConfig=void 0;var B=N(3);M.generateConfig=function(U,k,S,P){var T={foreground:P.foreground,background:P.background,cursor:void 0,cursorAccent:void 0,selection:void 0,ansi:P.ansi.slice(0,16)};return{devicePixelRatio:window.devicePixelRatio,scaledCharWidth:U,scaledCharHeight:k,fontFamily:S.fontFamily,fontSize:S.fontSize,fontWeight:S.fontWeight,fontWeightBold:S.fontWeightBold,allowTransparency:S.allowTransparency,colors:T}},M.configEquals=function(U,k){for(var S=0;S<U.colors.ansi.length;S++)if(U.colors.ansi[S].rgba!==k.colors.ansi[S].rgba)return!1;return U.devicePixelRatio===k.devicePixelRatio&&U.fontFamily===k.fontFamily&&U.fontSize===k.fontSize&&U.fontWeight===k.fontWeight&&U.fontWeightBold===k.fontWeightBold&&U.allowTransparency===k.allowTransparency&&U.scaledCharWidth===k.scaledCharWidth&&U.scaledCharHeight===k.scaledCharHeight&&U.colors.foreground===k.colors.foreground&&U.colors.background===k.colors.background},M.is256Color=function(U){return U<B.DEFAULT_COLOR}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.ColorManager=M.DEFAULT_ANSI_COLORS=void 0;var B=N(10),U=N(45),k=B.css.toColor("#ffffff"),S=B.css.toColor("#000000"),P=B.css.toColor("#ffffff"),T=B.css.toColor("#000000"),b={css:"rgba(255, 255, 255, 0.3)",rgba:4294967117};M.DEFAULT_ANSI_COLORS=function(){for(var E=[B.css.toColor("#2e3436"),B.css.toColor("#cc0000"),B.css.toColor("#4e9a06"),B.css.toColor("#c4a000"),B.css.toColor("#3465a4"),B.css.toColor("#75507b"),B.css.toColor("#06989a"),B.css.toColor("#d3d7cf"),B.css.toColor("#555753"),B.css.toColor("#ef2929"),B.css.toColor("#8ae234"),B.css.toColor("#fce94f"),B.css.toColor("#729fcf"),B.css.toColor("#ad7fa8"),B.css.toColor("#34e2e2"),B.css.toColor("#eeeeec")],s=[0,95,135,175,215,255],n=0;n<216;n++){var t=s[n/36%6|0],r=s[n/6%6|0],i=s[n%6];E.push({css:B.channels.toCss(t,r,i),rgba:B.channels.toRgba(t,r,i)})}for(n=0;n<24;n++){var a=8+10*n;E.push({css:B.channels.toCss(a,a,a),rgba:B.channels.toRgba(a,a,a)})}return E}();var e=function(){function E(s,n){this.allowTransparency=n;var t=s.createElement("canvas");t.width=1,t.height=1;var r=t.getContext("2d");if(!r)throw new Error("Could not get rendering context");this._ctx=r,this._ctx.globalCompositeOperation="copy",this._litmusColor=this._ctx.createLinearGradient(0,0,1,1),this._contrastCache=new U.ColorContrastCache,this.colors={foreground:k,background:S,cursor:P,cursorAccent:T,selectionTransparent:b,selectionOpaque:B.color.blend(S,b),ansi:M.DEFAULT_ANSI_COLORS.slice(),contrastCache:this._contrastCache}}return E.prototype.onOptionsChange=function(s){s==="minimumContrastRatio"&&this._contrastCache.clear()},E.prototype.setTheme=function(s){s===void 0&&(s={}),this.colors.foreground=this._parseColor(s.foreground,k),this.colors.background=this._parseColor(s.background,S),this.colors.cursor=this._parseColor(s.cursor,P,!0),this.colors.cursorAccent=this._parseColor(s.cursorAccent,T,!0),this.colors.selectionTransparent=this._parseColor(s.selection,b,!0),this.colors.selectionOpaque=B.color.blend(this.colors.background,this.colors.selectionTransparent),B.color.isOpaque(this.colors.selectionTransparent)&&(this.colors.selectionTransparent=B.color.opacity(this.colors.selectionTransparent,.3)),this.colors.ansi[0]=this._parseColor(s.black,M.DEFAULT_ANSI_COLORS[0]),this.colors.ansi[1]=this._parseColor(s.red,M.DEFAULT_ANSI_COLORS[1]),this.colors.ansi[2]=this._parseColor(s.green,M.DEFAULT_ANSI_COLORS[2]),this.colors.ansi[3]=this._parseColor(s.yellow,M.DEFAULT_ANSI_COLORS[3]),this.colors.ansi[4]=this._parseColor(s.blue,M.DEFAULT_ANSI_COLORS[4]),this.colors.ansi[5]=this._parseColor(s.magenta,M.DEFAULT_ANSI_COLORS[5]),this.colors.ansi[6]=this._parseColor(s.cyan,M.DEFAULT_ANSI_COLORS[6]),this.colors.ansi[7]=this._parseColor(s.white,M.DEFAULT_ANSI_COLORS[7]),this.colors.ansi[8]=this._parseColor(s.brightBlack,M.DEFAULT_ANSI_COLORS[8]),this.colors.ansi[9]=this._parseColor(s.brightRed,M.DEFAULT_ANSI_COLORS[9]),this.colors.ansi[10]=this._parseColor(s.brightGreen,M.DEFAULT_ANSI_COLORS[10]),this.colors.ansi[11]=this._parseColor(s.brightYellow,M.DEFAULT_ANSI_COLORS[11]),this.colors.ansi[12]=this._parseColor(s.brightBlue,M.DEFAULT_ANSI_COLORS[12]),this.colors.ansi[13]=this._parseColor(s.brightMagenta,M.DEFAULT_ANSI_COLORS[13]),this.colors.ansi[14]=this._parseColor(s.brightCyan,M.DEFAULT_ANSI_COLORS[14]),this.colors.ansi[15]=this._parseColor(s.brightWhite,M.DEFAULT_ANSI_COLORS[15]),this._contrastCache.clear()},E.prototype._parseColor=function(s,n,t){if(t===void 0&&(t=this.allowTransparency),s===void 0)return n;if(this._ctx.fillStyle=this._litmusColor,this._ctx.fillStyle=s,typeof this._ctx.fillStyle!="string")return console.warn("Color: "+s+" is invalid using fallback "+n.css),n;this._ctx.fillRect(0,0,1,1);var r=this._ctx.getImageData(0,0,1,1).data;if(r[3]!==255){if(!t)return console.warn("Color: "+s+" is using transparency, but allowTransparency is false. Using fallback "+n.css+"."),n;var i=this._ctx.fillStyle.substring(5,this._ctx.fillStyle.length-1).split(",").map(function(u){return Number(u)}),a=i[0],v=i[1],p=i[2],l=i[3],o=Math.round(255*l);return{rgba:B.channels.toRgba(a,v,p,o),css:s}}return{css:this._ctx.fillStyle,rgba:B.channels.toRgba(r[0],r[1],r[2],r[3])}},E}();M.ColorManager=e},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.throwIfFalsy=void 0,M.throwIfFalsy=function(B){if(!B)throw new Error("value must not be falsy");return B}},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(e,E){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(s,n){s.__proto__=n}||function(s,n){for(var t in n)n.hasOwnProperty(t)&&(s[t]=n[t])})(e,E)},function(e,E){function s(){this.constructor=e}B(e,E),e.prototype=E===null?Object.create(E):(s.prototype=E.prototype,new s)});Object.defineProperty(M,"__esModule",{value:!0}),M.CharacterJoinerRegistry=M.JoinedCellData=void 0;var k=N(6),S=N(3),P=N(4),T=function(e){function E(s,n,t){var r=e.call(this)||this;return r.content=0,r.combinedData="",r.fg=s.fg,r.bg=s.bg,r.combinedData=n,r._width=t,r}return U(E,e),E.prototype.isCombined=function(){return 2097152},E.prototype.getWidth=function(){return this._width},E.prototype.getChars=function(){return this.combinedData},E.prototype.getCode=function(){return 2097151},E.prototype.setFromCharData=function(s){throw new Error("not implemented")},E.prototype.getAsCharData=function(){return[this.fg,this.getChars(),this.getWidth(),this.getCode()]},E}(k.AttributeData);M.JoinedCellData=T;var b=function(){function e(E){this._bufferService=E,this._characterJoiners=[],this._nextCharacterJoinerId=0,this._workCell=new P.CellData}return e.prototype.registerCharacterJoiner=function(E){var s={id:this._nextCharacterJoinerId++,handler:E};return this._characterJoiners.push(s),s.id},e.prototype.deregisterCharacterJoiner=function(E){for(var s=0;s<this._characterJoiners.length;s++)if(this._characterJoiners[s].id===E)return this._characterJoiners.splice(s,1),!0;return!1},e.prototype.getJoinedCharacters=function(E){if(this._characterJoiners.length===0)return[];var s=this._bufferService.buffer.lines.get(E);if(!s||s.length===0)return[];for(var n=[],t=s.translateToString(!0),r=0,i=0,a=0,v=s.getFg(0),p=s.getBg(0),l=0;l<s.getTrimmedLength();l++)if(s.loadCell(l,this._workCell),this._workCell.getWidth()!==0){if(this._workCell.fg!==v||this._workCell.bg!==p){if(l-r>1)for(var o=this._getJoinedRanges(t,a,i,s,r),u=0;u<o.length;u++)n.push(o[u]);r=l,a=i,v=this._workCell.fg,p=this._workCell.bg}i+=this._workCell.getChars().length||S.WHITESPACE_CELL_CHAR.length}if(this._bufferService.cols-r>1)for(o=this._getJoinedRanges(t,a,i,s,r),u=0;u<o.length;u++)n.push(o[u]);return n},e.prototype._getJoinedRanges=function(E,s,n,t,r){for(var i=E.substring(s,n),a=this._characterJoiners[0].handler(i),v=1;v<this._characterJoiners.length;v++)for(var p=this._characterJoiners[v].handler(i),l=0;l<p.length;l++)e._mergeRanges(a,p[l]);return this._stringRangesToCellRanges(a,t,r),a},e.prototype._stringRangesToCellRanges=function(E,s,n){var t=0,r=!1,i=0,a=E[t];if(a){for(var v=n;v<this._bufferService.cols;v++){var p=s.getWidth(v),l=s.getString(v).length||S.WHITESPACE_CELL_CHAR.length;if(p!==0){if(!r&&a[0]<=i&&(a[0]=v,r=!0),a[1]<=i){if(a[1]=v,!(a=E[++t]))break;a[0]<=i?(a[0]=v,r=!0):r=!1}i+=l}}a&&(a[1]=this._bufferService.cols)}},e._mergeRanges=function(E,s){for(var n=!1,t=0;t<E.length;t++){var r=E[t];if(n){if(s[1]<=r[0])return E[t-1][1]=s[1],E;if(s[1]<=r[1])return E[t-1][1]=Math.max(s[1],r[1]),E.splice(t,1),E;E.splice(t,1),t--}else{if(s[1]<=r[0])return E.splice(t,0,s),E;if(s[1]<=r[1])return r[0]=Math.min(s[0],r[0]),E;s[0]<r[1]&&(r[0]=Math.min(s[0],r[0]),n=!0)}}return n?E[E.length-1][1]=s[1]:E.push(s),E},e}();M.CharacterJoinerRegistry=b},function(re,M,N){"use strict";function B(U,k){var S=k.getBoundingClientRect();return[U.clientX-S.left,U.clientY-S.top]}Object.defineProperty(M,"__esModule",{value:!0}),M.getRawByteCoords=M.getCoords=M.getCoordsRelativeToElement=void 0,M.getCoordsRelativeToElement=B,M.getCoords=function(U,k,S,P,T,b,e,E){if(T){var s=B(U,k);if(s)return s[0]=Math.ceil((s[0]+(E?b/2:0))/b),s[1]=Math.ceil(s[1]/e),s[0]=Math.min(Math.max(s[0],1),S+(E?1:0)),s[1]=Math.min(Math.max(s[1],1),P),s}},M.getRawByteCoords=function(U){if(U)return{x:U[0]+32,y:U[1]+32}}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.RenderDebouncer=void 0;var B=function(){function U(k){this._renderCallback=k}return U.prototype.dispose=function(){this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},U.prototype.refresh=function(k,S,P){var T=this;this._rowCount=P,k=k!==void 0?k:0,S=S!==void 0?S:this._rowCount-1,this._rowStart=this._rowStart!==void 0?Math.min(this._rowStart,k):k,this._rowEnd=this._rowEnd!==void 0?Math.max(this._rowEnd,S):S,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){return T._innerRefresh()}))},U.prototype._innerRefresh=function(){if(this._rowStart!==void 0&&this._rowEnd!==void 0&&this._rowCount!==void 0){var k=Math.max(this._rowStart,0),S=Math.min(this._rowEnd,this._rowCount-1);this._rowStart=void 0,this._rowEnd=void 0,this._animationFrame=void 0,this._renderCallback(k,S)}},U}();M.RenderDebouncer=B},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(S,P){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,b){T.__proto__=b}||function(T,b){for(var e in b)b.hasOwnProperty(e)&&(T[e]=b[e])})(S,P)},function(S,P){function T(){this.constructor=S}B(S,P),S.prototype=P===null?Object.create(P):(T.prototype=P.prototype,new T)});Object.defineProperty(M,"__esModule",{value:!0}),M.ScreenDprMonitor=void 0;var k=function(S){function P(){var T=S!==null&&S.apply(this,arguments)||this;return T._currentDevicePixelRatio=window.devicePixelRatio,T}return U(P,S),P.prototype.setListener=function(T){var b=this;this._listener&&this.clearListener(),this._listener=T,this._outerListener=function(){b._listener&&(b._listener(window.devicePixelRatio,b._currentDevicePixelRatio),b._updateDpr())},this._updateDpr()},P.prototype.dispose=function(){S.prototype.dispose.call(this),this.clearListener()},P.prototype._updateDpr=function(){var T;this._outerListener&&((T=this._resolutionMediaMatchList)===null||T===void 0||T.removeListener(this._outerListener),this._currentDevicePixelRatio=window.devicePixelRatio,this._resolutionMediaMatchList=window.matchMedia("screen and (resolution: "+window.devicePixelRatio+"dppx)"),this._resolutionMediaMatchList.addListener(this._outerListener))},P.prototype.clearListener=function(){this._resolutionMediaMatchList&&this._listener&&this._outerListener&&(this._resolutionMediaMatchList.removeListener(this._outerListener),this._resolutionMediaMatchList=void 0,this._listener=void 0,this._outerListener=void 0)},P}(N(2).Disposable);M.ScreenDprMonitor=k},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.clone=void 0,M.clone=function B(U,k){if(k===void 0&&(k=5),typeof U!="object")return U;var S=Array.isArray(U)?[]:{};for(var P in U)S[P]=k<=1?U[P]:U[P]?B(U[P],k-1):U[P];return S}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.Terminal=void 0;var B=N(4),U=N(35),k=N(18),S=N(0),P=N(83),T=function(){function t(r){this._core=new U.Terminal(r),this._addonManager=new P.AddonManager}return t.prototype._checkProposedApi=function(){if(!this._core.optionsService.options.allowProposedApi)throw new Error("You must set the allowProposedApi option to true to use proposed API")},Object.defineProperty(t.prototype,"onCursorMove",{get:function(){return this._core.onCursorMove},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onLineFeed",{get:function(){return this._core.onLineFeed},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onSelectionChange",{get:function(){return this._core.onSelectionChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onData",{get:function(){return this._core.onData},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onBinary",{get:function(){return this._core.onBinary},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onTitleChange",{get:function(){return this._core.onTitleChange},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onScroll",{get:function(){return this._core.onScroll},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onKey",{get:function(){return this._core.onKey},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onRender",{get:function(){return this._core.onRender},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"onResize",{get:function(){return this._core.onResize},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"element",{get:function(){return this._core.element},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"parser",{get:function(){return this._checkProposedApi(),this._parser||(this._parser=new s(this._core)),this._parser},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"unicode",{get:function(){return this._checkProposedApi(),new n(this._core)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"textarea",{get:function(){return this._core.textarea},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"rows",{get:function(){return this._core.rows},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cols",{get:function(){return this._core.cols},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"buffer",{get:function(){return this._checkProposedApi(),new e(this._core.buffers)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"markers",{get:function(){return this._checkProposedApi(),this._core.markers},enumerable:!1,configurable:!0}),t.prototype.blur=function(){this._core.blur()},t.prototype.focus=function(){this._core.focus()},t.prototype.resize=function(r,i){this._verifyIntegers(r,i),this._core.resize(r,i)},t.prototype.open=function(r){this._core.open(r)},t.prototype.attachCustomKeyEventHandler=function(r){this._core.attachCustomKeyEventHandler(r)},t.prototype.registerLinkMatcher=function(r,i,a){return this._checkProposedApi(),this._core.registerLinkMatcher(r,i,a)},t.prototype.deregisterLinkMatcher=function(r){this._checkProposedApi(),this._core.deregisterLinkMatcher(r)},t.prototype.registerLinkProvider=function(r){return this._checkProposedApi(),this._core.registerLinkProvider(r)},t.prototype.registerCharacterJoiner=function(r){return this._checkProposedApi(),this._core.registerCharacterJoiner(r)},t.prototype.deregisterCharacterJoiner=function(r){this._checkProposedApi(),this._core.deregisterCharacterJoiner(r)},t.prototype.registerMarker=function(r){return this._checkProposedApi(),this._verifyIntegers(r),this._core.addMarker(r)},t.prototype.addMarker=function(r){return this.registerMarker(r)},t.prototype.hasSelection=function(){return this._core.hasSelection()},t.prototype.select=function(r,i,a){this._verifyIntegers(r,i,a),this._core.select(r,i,a)},t.prototype.getSelection=function(){return this._core.getSelection()},t.prototype.getSelectionPosition=function(){return this._core.getSelectionPosition()},t.prototype.clearSelection=function(){this._core.clearSelection()},t.prototype.selectAll=function(){this._core.selectAll()},t.prototype.selectLines=function(r,i){this._verifyIntegers(r,i),this._core.selectLines(r,i)},t.prototype.dispose=function(){this._addonManager.dispose(),this._core.dispose()},t.prototype.scrollLines=function(r){this._verifyIntegers(r),this._core.scrollLines(r)},t.prototype.scrollPages=function(r){this._verifyIntegers(r),this._core.scrollPages(r)},t.prototype.scrollToTop=function(){this._core.scrollToTop()},t.prototype.scrollToBottom=function(){this._core.scrollToBottom()},t.prototype.scrollToLine=function(r){this._verifyIntegers(r),this._core.scrollToLine(r)},t.prototype.clear=function(){this._core.clear()},t.prototype.write=function(r,i){this._core.write(r,i)},t.prototype.writeUtf8=function(r,i){this._core.write(r,i)},t.prototype.writeln=function(r,i){this._core.write(r),this._core.write(`\r
`,i)},t.prototype.paste=function(r){this._core.paste(r)},t.prototype.getOption=function(r){return this._core.optionsService.getOption(r)},t.prototype.setOption=function(r,i){this._core.optionsService.setOption(r,i)},t.prototype.refresh=function(r,i){this._verifyIntegers(r,i),this._core.refresh(r,i)},t.prototype.reset=function(){this._core.reset()},t.prototype.loadAddon=function(r){return this._addonManager.loadAddon(this,r)},Object.defineProperty(t,"strings",{get:function(){return k},enumerable:!1,configurable:!0}),t.prototype._verifyIntegers=function(){for(var r=[],i=0;i<arguments.length;i++)r[i]=arguments[i];for(var a=0,v=r;a<v.length;a++){var p=v[a];if(p===1/0||isNaN(p)||p%1!=0)throw new Error("This API only accepts integers")}},t}();M.Terminal=T;var b=function(){function t(r,i){this._buffer=r,this.type=i}return t.prototype.init=function(r){return this._buffer=r,this},Object.defineProperty(t.prototype,"cursorY",{get:function(){return this._buffer.y},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"cursorX",{get:function(){return this._buffer.x},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"viewportY",{get:function(){return this._buffer.ydisp},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"baseY",{get:function(){return this._buffer.ybase},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._buffer.lines.length},enumerable:!1,configurable:!0}),t.prototype.getLine=function(r){var i=this._buffer.lines.get(r);if(i)return new E(i)},t.prototype.getNullCell=function(){return new B.CellData},t}(),e=function(){function t(r){var i=this;this._buffers=r,this._onBufferChange=new S.EventEmitter,this._normal=new b(this._buffers.normal,"normal"),this._alternate=new b(this._buffers.alt,"alternate"),this._buffers.onBufferActivate(function(){return i._onBufferChange.fire(i.active)})}return Object.defineProperty(t.prototype,"onBufferChange",{get:function(){return this._onBufferChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"active",{get:function(){if(this._buffers.active===this._buffers.normal)return this.normal;if(this._buffers.active===this._buffers.alt)return this.alternate;throw new Error("Active buffer is neither normal nor alternate")},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"normal",{get:function(){return this._normal.init(this._buffers.normal)},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"alternate",{get:function(){return this._alternate.init(this._buffers.alt)},enumerable:!1,configurable:!0}),t}(),E=function(){function t(r){this._line=r}return Object.defineProperty(t.prototype,"isWrapped",{get:function(){return this._line.isWrapped},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"length",{get:function(){return this._line.length},enumerable:!1,configurable:!0}),t.prototype.getCell=function(r,i){if(!(r<0||r>=this._line.length))return i?(this._line.loadCell(r,i),i):this._line.loadCell(r,new B.CellData)},t.prototype.translateToString=function(r,i,a){return this._line.translateToString(r,i,a)},t}(),s=function(){function t(r){this._core=r}return t.prototype.registerCsiHandler=function(r,i){return this._core.addCsiHandler(r,function(a){return i(a.toArray())})},t.prototype.addCsiHandler=function(r,i){return this.registerCsiHandler(r,i)},t.prototype.registerDcsHandler=function(r,i){return this._core.addDcsHandler(r,function(a,v){return i(a,v.toArray())})},t.prototype.addDcsHandler=function(r,i){return this.registerDcsHandler(r,i)},t.prototype.registerEscHandler=function(r,i){return this._core.addEscHandler(r,i)},t.prototype.addEscHandler=function(r,i){return this.registerEscHandler(r,i)},t.prototype.registerOscHandler=function(r,i){return this._core.addOscHandler(r,i)},t.prototype.addOscHandler=function(r,i){return this.registerOscHandler(r,i)},t}(),n=function(){function t(r){this._core=r}return t.prototype.register=function(r){this._core.unicodeService.register(r)},Object.defineProperty(t.prototype,"versions",{get:function(){return this._core.unicodeService.versions},enumerable:!1,configurable:!0}),Object.defineProperty(t.prototype,"activeVersion",{get:function(){return this._core.unicodeService.activeVersion},set:function(r){this._core.unicodeService.activeVersion=r},enumerable:!1,configurable:!0}),t}()},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(d,h){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(A,w){A.__proto__=w}||function(A,w){for(var x in w)w.hasOwnProperty(x)&&(A[x]=w[x])})(d,h)},function(d,h){function A(){this.constructor=d}B(d,h),d.prototype=h===null?Object.create(h):(A.prototype=h.prototype,new A)});Object.defineProperty(M,"__esModule",{value:!0}),M.Terminal=void 0;var k=N(36),S=N(37),P=N(38),T=N(12),b=N(19),e=N(40),E=N(50),s=N(51),n=N(11),t=N(7),r=N(18),i=N(54),a=N(55),v=N(56),p=N(57),l=N(59),o=N(0),u=N(16),c=N(27),_=N(60),y=N(5),f=N(61),C=N(62),L=N(63),R=N(64),O=N(65),g=typeof window!="undefined"?window.document:null,m=function(d){function h(A){A===void 0&&(A={});var w=d.call(this,A)||this;return w.browser=n,w._keyDownHandled=!1,w._onCursorMove=new o.EventEmitter,w._onKey=new o.EventEmitter,w._onRender=new o.EventEmitter,w._onSelectionChange=new o.EventEmitter,w._onTitleChange=new o.EventEmitter,w._onFocus=new o.EventEmitter,w._onBlur=new o.EventEmitter,w._onA11yCharEmitter=new o.EventEmitter,w._onA11yTabEmitter=new o.EventEmitter,w._setup(),w.linkifier=w._instantiationService.createInstance(E.Linkifier),w.linkifier2=w.register(w._instantiationService.createInstance(L.Linkifier2)),w.register(w._inputHandler.onRequestBell(function(){return w.bell()})),w.register(w._inputHandler.onRequestRefreshRows(function(x,D){return w.refresh(x,D)})),w.register(w._inputHandler.onRequestReset(function(){return w.reset()})),w.register(w._inputHandler.onRequestScroll(function(x,D){return w.scroll(x,D||void 0)})),w.register(w._inputHandler.onRequestWindowsOptionsReport(function(x){return w._reportWindowsOptions(x)})),w.register(o.forwardEvent(w._inputHandler.onCursorMove,w._onCursorMove)),w.register(o.forwardEvent(w._inputHandler.onTitleChange,w._onTitleChange)),w.register(o.forwardEvent(w._inputHandler.onA11yChar,w._onA11yCharEmitter)),w.register(o.forwardEvent(w._inputHandler.onA11yTab,w._onA11yTabEmitter)),w.register(w._bufferService.onResize(function(x){return w._afterResize(x.cols,x.rows)})),w}return U(h,d),Object.defineProperty(h.prototype,"options",{get:function(){return this.optionsService.options},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onCursorMove",{get:function(){return this._onCursorMove.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onKey",{get:function(){return this._onKey.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onRender",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onTitleChange",{get:function(){return this._onTitleChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onFocus",{get:function(){return this._onFocus.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onBlur",{get:function(){return this._onBlur.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onA11yChar",{get:function(){return this._onA11yCharEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(h.prototype,"onA11yTab",{get:function(){return this._onA11yTabEmitter.event},enumerable:!1,configurable:!0}),h.prototype.dispose=function(){var A,w,x;this._isDisposed||(d.prototype.dispose.call(this),(A=this._renderService)===null||A===void 0||A.dispose(),this._customKeyEventHandler=void 0,this.write=function(){},(x=(w=this.element)===null||w===void 0?void 0:w.parentNode)===null||x===void 0||x.removeChild(this.element))},h.prototype._setup=function(){d.prototype._setup.call(this),this._customKeyEventHandler=void 0},Object.defineProperty(h.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),h.prototype.focus=function(){this.textarea&&this.textarea.focus({preventScroll:!0})},h.prototype._updateOptions=function(A){var w,x,D,I;switch(d.prototype._updateOptions.call(this,A),A){case"fontFamily":case"fontSize":(w=this._renderService)===null||w===void 0||w.clear(),(x=this._charSizeService)===null||x===void 0||x.measure();break;case"cursorBlink":case"cursorStyle":this.refresh(this.buffer.y,this.buffer.y);break;case"drawBoldTextInBrightColors":case"letterSpacing":case"lineHeight":case"fontWeight":case"fontWeightBold":case"minimumContrastRatio":this._renderService&&(this._renderService.clear(),this._renderService.onResize(this.cols,this.rows),this.refresh(0,this.rows-1));break;case"rendererType":this._renderService&&(this._renderService.setRenderer(this._createRenderer()),this._renderService.onResize(this.cols,this.rows));break;case"scrollback":(D=this.viewport)===null||D===void 0||D.syncScrollArea();break;case"screenReaderMode":this.optionsService.options.screenReaderMode?!this._accessibilityManager&&this._renderService&&(this._accessibilityManager=new v.AccessibilityManager(this,this._renderService)):((I=this._accessibilityManager)===null||I===void 0||I.dispose(),this._accessibilityManager=void 0);break;case"tabStopWidth":this.buffers.setupTabStops();break;case"theme":this._setTheme(this.optionsService.options.theme)}},h.prototype._onTextAreaFocus=function(A){this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(T.C0.ESC+"[I"),this.updateCursorStyle(A),this.element.classList.add("focus"),this._showCursor(),this._onFocus.fire()},h.prototype.blur=function(){var A;return(A=this.textarea)===null||A===void 0?void 0:A.blur()},h.prototype._onTextAreaBlur=function(){this.textarea.value="",this.refresh(this.buffer.y,this.buffer.y),this._coreService.decPrivateModes.sendFocus&&this._coreService.triggerDataEvent(T.C0.ESC+"[O"),this.element.classList.remove("focus"),this._onBlur.fire()},h.prototype._syncTextArea=function(){if(this.textarea&&this.buffer.isCursorInViewport&&!this._compositionHelper.isComposing){var A=Math.ceil(this._charSizeService.height*this.optionsService.options.lineHeight),w=this._bufferService.buffer.y*A,x=this._bufferService.buffer.x*this._charSizeService.width;this.textarea.style.left=x+"px",this.textarea.style.top=w+"px",this.textarea.style.width=this._charSizeService.width+"px",this.textarea.style.height=A+"px",this.textarea.style.lineHeight=A+"px",this.textarea.style.zIndex="-5"}},h.prototype._initGlobal=function(){var A=this;this._bindKeys(),this.register(t.addDisposableDomListener(this.element,"copy",function(x){A.hasSelection()&&P.copyHandler(x,A._selectionService)}));var w=function(x){return P.handlePasteEvent(x,A.textarea,A._coreService)};this.register(t.addDisposableDomListener(this.textarea,"paste",w)),this.register(t.addDisposableDomListener(this.element,"paste",w)),n.isFirefox?this.register(t.addDisposableDomListener(this.element,"mousedown",function(x){x.button===2&&P.rightClickHandler(x,A.textarea,A.screenElement,A._selectionService,A.options.rightClickSelectsWord)})):this.register(t.addDisposableDomListener(this.element,"contextmenu",function(x){P.rightClickHandler(x,A.textarea,A.screenElement,A._selectionService,A.options.rightClickSelectsWord)})),n.isLinux&&this.register(t.addDisposableDomListener(this.element,"auxclick",function(x){x.button===1&&P.moveTextAreaUnderMouseCursor(x,A.textarea,A.screenElement)}))},h.prototype._bindKeys=function(){var A=this;this.register(t.addDisposableDomListener(this.textarea,"keyup",function(w){return A._keyUp(w)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keydown",function(w){return A._keyDown(w)},!0)),this.register(t.addDisposableDomListener(this.textarea,"keypress",function(w){return A._keyPress(w)},!0)),this.register(t.addDisposableDomListener(this.textarea,"compositionstart",function(){return A._compositionHelper.compositionstart()})),this.register(t.addDisposableDomListener(this.textarea,"compositionupdate",function(w){return A._compositionHelper.compositionupdate(w)})),this.register(t.addDisposableDomListener(this.textarea,"compositionend",function(){return A._compositionHelper.compositionend()})),this.register(this.onRender(function(){return A._compositionHelper.updateCompositionElements()})),this.register(this.onRender(function(w){return A._queueLinkification(w.start,w.end)}))},h.prototype.open=function(A){var w=this;if(!A)throw new Error("Terminal requires a parent element.");g.body.contains(A)||this._logService.debug("Terminal.open was called on an element that was not attached to the DOM"),this._document=A.ownerDocument,this.element=this._document.createElement("div"),this.element.dir="ltr",this.element.classList.add("terminal"),this.element.classList.add("xterm"),this.element.setAttribute("tabindex","0"),A.appendChild(this.element);var x=g.createDocumentFragment();this._viewportElement=g.createElement("div"),this._viewportElement.classList.add("xterm-viewport"),x.appendChild(this._viewportElement),this._viewportScrollArea=g.createElement("div"),this._viewportScrollArea.classList.add("xterm-scroll-area"),this._viewportElement.appendChild(this._viewportScrollArea),this.screenElement=g.createElement("div"),this.screenElement.classList.add("xterm-screen"),this._helperContainer=g.createElement("div"),this._helperContainer.classList.add("xterm-helpers"),this.screenElement.appendChild(this._helperContainer),x.appendChild(this.screenElement),this.textarea=g.createElement("textarea"),this.textarea.classList.add("xterm-helper-textarea"),this.textarea.setAttribute("aria-label",r.promptLabel),this.textarea.setAttribute("aria-multiline","false"),this.textarea.setAttribute("autocorrect","off"),this.textarea.setAttribute("autocapitalize","off"),this.textarea.setAttribute("spellcheck","false"),this.textarea.tabIndex=0,this.register(t.addDisposableDomListener(this.textarea,"focus",function(F){return w._onTextAreaFocus(F)})),this.register(t.addDisposableDomListener(this.textarea,"blur",function(){return w._onTextAreaBlur()})),this._helperContainer.appendChild(this.textarea);var D=this._instantiationService.createInstance(R.CoreBrowserService,this.textarea);this._instantiationService.setService(y.ICoreBrowserService,D),this._charSizeService=this._instantiationService.createInstance(f.CharSizeService,this._document,this._helperContainer),this._instantiationService.setService(y.ICharSizeService,this._charSizeService),this._compositionView=g.createElement("div"),this._compositionView.classList.add("composition-view"),this._compositionHelper=this._instantiationService.createInstance(k.CompositionHelper,this.textarea,this._compositionView),this._helperContainer.appendChild(this._compositionView),this.element.appendChild(x),this._theme=this.options.theme||this._theme,this._colorManager=new c.ColorManager(g,this.options.allowTransparency),this.register(this.optionsService.onOptionChange(function(F){return w._colorManager.onOptionsChange(F)})),this._colorManager.setTheme(this._theme);var I=this._createRenderer();this._renderService=this.register(this._instantiationService.createInstance(_.RenderService,I,this.rows,this.screenElement)),this._instantiationService.setService(y.IRenderService,this._renderService),this.register(this._renderService.onRenderedBufferChange(function(F){return w._onRender.fire(F)})),this.onResize(function(F){return w._renderService.resize(F.cols,F.rows)}),this._soundService=this._instantiationService.createInstance(i.SoundService),this._instantiationService.setService(y.ISoundService,this._soundService),this._mouseService=this._instantiationService.createInstance(C.MouseService),this._instantiationService.setService(y.IMouseService,this._mouseService),this.viewport=this._instantiationService.createInstance(S.Viewport,function(F,K){return w.scrollLines(F,K)},this._viewportElement,this._viewportScrollArea),this.viewport.onThemeChange(this._colorManager.colors),this.register(this._inputHandler.onRequestSyncScrollBar(function(){return w.viewport.syncScrollArea()})),this.register(this.viewport),this.register(this.onCursorMove(function(){w._renderService.onCursorMove(),w._syncTextArea()})),this.register(this.onResize(function(){return w._renderService.onResize(w.cols,w.rows)})),this.register(this.onBlur(function(){return w._renderService.onBlur()})),this.register(this.onFocus(function(){return w._renderService.onFocus()})),this.register(this._renderService.onDimensionsChange(function(){return w.viewport.syncScrollArea()})),this._selectionService=this.register(this._instantiationService.createInstance(s.SelectionService,this.element,this.screenElement)),this._instantiationService.setService(y.ISelectionService,this._selectionService),this.register(this._selectionService.onRequestScrollLines(function(F){return w.scrollLines(F.amount,F.suppressScrollEvent)})),this.register(this._selectionService.onSelectionChange(function(){return w._onSelectionChange.fire()})),this.register(this._selectionService.onRequestRedraw(function(F){return w._renderService.onSelectionChanged(F.start,F.end,F.columnSelectMode)})),this.register(this._selectionService.onLinuxMouseSelection(function(F){w.textarea.value=F,w.textarea.focus(),w.textarea.select()})),this.register(this.onScroll(function(){w.viewport.syncScrollArea(),w._selectionService.refresh()})),this.register(t.addDisposableDomListener(this._viewportElement,"scroll",function(){return w._selectionService.refresh()})),this._mouseZoneManager=this._instantiationService.createInstance(a.MouseZoneManager,this.element,this.screenElement),this.register(this._mouseZoneManager),this.register(this.onScroll(function(){return w._mouseZoneManager.clearAll()})),this.linkifier.attachToDom(this.element,this._mouseZoneManager),this.linkifier2.attachToDom(this.element,this._mouseService,this._renderService),this.register(t.addDisposableDomListener(this.element,"mousedown",function(F){return w._selectionService.onMouseDown(F)})),this._coreMouseService.areMouseEventsActive?(this._selectionService.disable(),this.element.classList.add("enable-mouse-events")):this._selectionService.enable(),this.options.screenReaderMode&&(this._accessibilityManager=new v.AccessibilityManager(this,this._renderService)),this._charSizeService.measure(),this.refresh(0,this.rows-1),this._initGlobal(),this.bindMouse()},h.prototype._createRenderer=function(){switch(this.options.rendererType){case"canvas":return this._instantiationService.createInstance(e.Renderer,this._colorManager.colors,this.screenElement,this.linkifier,this.linkifier2);case"dom":return this._instantiationService.createInstance(p.DomRenderer,this._colorManager.colors,this.element,this.screenElement,this._viewportElement,this.linkifier,this.linkifier2);default:throw new Error('Unrecognized rendererType "'+this.options.rendererType+'"')}},h.prototype._setTheme=function(A){var w,x,D;this._theme=A,(w=this._colorManager)===null||w===void 0||w.setTheme(A),(x=this._renderService)===null||x===void 0||x.setColors(this._colorManager.colors),(D=this.viewport)===null||D===void 0||D.onThemeChange(this._colorManager.colors)},h.prototype.bindMouse=function(){var A=this,w=this,x=this.element;function D(j){var G,Z,Q=w._mouseService.getRawByteCoords(j,w.screenElement,w.cols,w.rows);if(!Q)return!1;switch(j.overrideType||j.type){case"mousemove":Z=32,j.buttons===void 0?(G=3,j.button!==void 0&&(G=j.button<3?j.button:3)):G=1&j.buttons?0:4&j.buttons?1:2&j.buttons?2:3;break;case"mouseup":Z=0,G=j.button<3?j.button:3;break;case"mousedown":Z=1,G=j.button<3?j.button:3;break;case"wheel":j.deltaY!==0&&(Z=j.deltaY<0?0:1),G=4;break;default:return!1}return!(Z===void 0||G===void 0||G>4)&&w._coreMouseService.triggerMouseEvent({col:Q.x-33,row:Q.y-33,button:G,action:Z,ctrl:j.ctrlKey,alt:j.altKey,shift:j.shiftKey})}var I={mouseup:null,wheel:null,mousedrag:null,mousemove:null},F=function(j){return D(j),j.buttons||(A._document.removeEventListener("mouseup",I.mouseup),I.mousedrag&&A._document.removeEventListener("mousemove",I.mousedrag)),A.cancel(j)},K=function(j){return D(j),j.preventDefault(),A.cancel(j)},W=function(j){j.buttons&&D(j)},z=function(j){j.buttons||D(j)};this.register(this._coreMouseService.onProtocolChange(function(j){j?(A.optionsService.options.logLevel==="debug"&&A._logService.debug("Binding to mouse events:",A._coreMouseService.explainEvents(j)),A.element.classList.add("enable-mouse-events"),A._selectionService.disable()):(A._logService.debug("Unbinding from mouse events."),A.element.classList.remove("enable-mouse-events"),A._selectionService.enable()),8&j?I.mousemove||(x.addEventListener("mousemove",z),I.mousemove=z):(x.removeEventListener("mousemove",I.mousemove),I.mousemove=null),16&j?I.wheel||(x.addEventListener("wheel",K,{passive:!1}),I.wheel=K):(x.removeEventListener("wheel",I.wheel),I.wheel=null),2&j?I.mouseup||(I.mouseup=F):(A._document.removeEventListener("mouseup",I.mouseup),I.mouseup=null),4&j?I.mousedrag||(I.mousedrag=W):(A._document.removeEventListener("mousemove",I.mousedrag),I.mousedrag=null)})),this._coreMouseService.activeProtocol=this._coreMouseService.activeProtocol,this.register(t.addDisposableDomListener(x,"mousedown",function(j){if(j.preventDefault(),A.focus(),A._coreMouseService.areMouseEventsActive&&!A._selectionService.shouldForceSelection(j))return D(j),I.mouseup&&A._document.addEventListener("mouseup",I.mouseup),I.mousedrag&&A._document.addEventListener("mousemove",I.mousedrag),A.cancel(j)})),this.register(t.addDisposableDomListener(x,"wheel",function(j){if(!I.wheel){if(!A.buffer.hasScrollback){var G=A.viewport.getLinesScrolled(j);if(G===0)return;for(var Z=T.C0.ESC+(A._coreService.decPrivateModes.applicationCursorKeys?"O":"[")+(j.deltaY<0?"A":"B"),Q="",ue=0;ue<Math.abs(G);ue++)Q+=Z;A._coreService.triggerDataEvent(Q,!0)}}},{passive:!0})),this.register(t.addDisposableDomListener(x,"wheel",function(j){if(!I.wheel)return A.viewport.onWheel(j)?void 0:A.cancel(j)},{passive:!1})),this.register(t.addDisposableDomListener(x,"touchstart",function(j){if(!A._coreMouseService.areMouseEventsActive)return A.viewport.onTouchStart(j),A.cancel(j)},{passive:!0})),this.register(t.addDisposableDomListener(x,"touchmove",function(j){if(!A._coreMouseService.areMouseEventsActive)return A.viewport.onTouchMove(j)?void 0:A.cancel(j)},{passive:!1}))},h.prototype.refresh=function(A,w){var x;(x=this._renderService)===null||x===void 0||x.refreshRows(A,w)},h.prototype._queueLinkification=function(A,w){var x;(x=this.linkifier)===null||x===void 0||x.linkifyRows(A,w)},h.prototype.updateCursorStyle=function(A){this._selectionService&&this._selectionService.shouldColumnSelect(A)?this.element.classList.add("column-select"):this.element.classList.remove("column-select")},h.prototype._showCursor=function(){this._coreService.isCursorInitialized||(this._coreService.isCursorInitialized=!0,this.refresh(this.buffer.y,this.buffer.y))},h.prototype.scrollLines=function(A,w){d.prototype.scrollLines.call(this,A,w),this.refresh(0,this.rows-1)},h.prototype.paste=function(A){P.paste(A,this.textarea,this._coreService)},h.prototype.attachCustomKeyEventHandler=function(A){this._customKeyEventHandler=A},h.prototype.registerLinkMatcher=function(A,w,x){var D=this.linkifier.registerLinkMatcher(A,w,x);return this.refresh(0,this.rows-1),D},h.prototype.deregisterLinkMatcher=function(A){this.linkifier.deregisterLinkMatcher(A)&&this.refresh(0,this.rows-1)},h.prototype.registerLinkProvider=function(A){return this.linkifier2.registerLinkProvider(A)},h.prototype.registerCharacterJoiner=function(A){var w=this._renderService.registerCharacterJoiner(A);return this.refresh(0,this.rows-1),w},h.prototype.deregisterCharacterJoiner=function(A){this._renderService.deregisterCharacterJoiner(A)&&this.refresh(0,this.rows-1)},Object.defineProperty(h.prototype,"markers",{get:function(){return this.buffer.markers},enumerable:!1,configurable:!0}),h.prototype.addMarker=function(A){if(this.buffer===this.buffers.normal)return this.buffer.addMarker(this.buffer.ybase+this.buffer.y+A)},h.prototype.hasSelection=function(){return!!this._selectionService&&this._selectionService.hasSelection},h.prototype.select=function(A,w,x){this._selectionService.setSelection(A,w,x)},h.prototype.getSelection=function(){return this._selectionService?this._selectionService.selectionText:""},h.prototype.getSelectionPosition=function(){if(this._selectionService&&this._selectionService.hasSelection)return{startColumn:this._selectionService.selectionStart[0],startRow:this._selectionService.selectionStart[1],endColumn:this._selectionService.selectionEnd[0],endRow:this._selectionService.selectionEnd[1]}},h.prototype.clearSelection=function(){var A;(A=this._selectionService)===null||A===void 0||A.clearSelection()},h.prototype.selectAll=function(){var A;(A=this._selectionService)===null||A===void 0||A.selectAll()},h.prototype.selectLines=function(A,w){var x;(x=this._selectionService)===null||x===void 0||x.selectLines(A,w)},h.prototype._keyDown=function(A){if(this._keyDownHandled=!1,this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(!this._compositionHelper.keydown(A))return this.buffer.ybase!==this.buffer.ydisp&&this.scrollToBottom(),!1;var w=l.evaluateKeyboardEvent(A,this._coreService.decPrivateModes.applicationCursorKeys,this.browser.isMac,this.options.macOptionIsMeta);if(this.updateCursorStyle(A),w.type===3||w.type===2){var x=this.rows-1;return this.scrollLines(w.type===2?-x:x),this.cancel(A,!0)}return w.type===1&&this.selectAll(),!!this._isThirdLevelShift(this.browser,A)||(w.cancel&&this.cancel(A,!0),!w.key||(w.key!==T.C0.ETX&&w.key!==T.C0.CR||(this.textarea.value=""),this._onKey.fire({key:w.key,domEvent:A}),this._showCursor(),this._coreService.triggerDataEvent(w.key,!0),this.optionsService.options.screenReaderMode?void(this._keyDownHandled=!0):this.cancel(A,!0)))},h.prototype._isThirdLevelShift=function(A,w){var x=A.isMac&&!this.options.macOptionIsMeta&&w.altKey&&!w.ctrlKey&&!w.metaKey||A.isWindows&&w.altKey&&w.ctrlKey&&!w.metaKey;return w.type==="keypress"?x:x&&(!w.keyCode||w.keyCode>47)},h.prototype._keyUp=function(A){this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1||(function(w){return w.keyCode===16||w.keyCode===17||w.keyCode===18}(A)||this.focus(),this.updateCursorStyle(A))},h.prototype._keyPress=function(A){var w;if(this._keyDownHandled||this._customKeyEventHandler&&this._customKeyEventHandler(A)===!1)return!1;if(this.cancel(A),A.charCode)w=A.charCode;else if(A.which===null||A.which===void 0)w=A.keyCode;else{if(A.which===0||A.charCode===0)return!1;w=A.which}return!(!w||(A.altKey||A.ctrlKey||A.metaKey)&&!this._isThirdLevelShift(this.browser,A))&&(w=String.fromCharCode(w),this._onKey.fire({key:w,domEvent:A}),this._showCursor(),this._coreService.triggerDataEvent(w,!0),!0)},h.prototype.bell=function(){this._soundBell()&&this._soundService.playBellSound()},h.prototype.resize=function(A,w){A!==this.cols||w!==this.rows?d.prototype.resize.call(this,A,w):this._charSizeService&&!this._charSizeService.hasValidSize&&this._charSizeService.measure()},h.prototype._afterResize=function(A,w){var x,D;(x=this._charSizeService)===null||x===void 0||x.measure(),(D=this.viewport)===null||D===void 0||D.syncScrollArea(!0)},h.prototype.clear=function(){if(this.buffer.ybase!==0||this.buffer.y!==0){this.buffer.lines.set(0,this.buffer.lines.get(this.buffer.ybase+this.buffer.y)),this.buffer.lines.length=1,this.buffer.ydisp=0,this.buffer.ybase=0,this.buffer.y=0;for(var A=1;A<this.rows;A++)this.buffer.lines.push(this.buffer.getBlankLine(u.DEFAULT_ATTR_DATA));this.refresh(0,this.rows-1),this._onScroll.fire(this.buffer.ydisp)}},h.prototype.reset=function(){var A,w;this.options.rows=this.rows,this.options.cols=this.cols;var x=this._customKeyEventHandler;this._setup(),d.prototype.reset.call(this),(A=this._selectionService)===null||A===void 0||A.reset(),this._customKeyEventHandler=x,this.refresh(0,this.rows-1),(w=this.viewport)===null||w===void 0||w.syncScrollArea()},h.prototype._reportWindowsOptions=function(A){if(this._renderService)switch(A){case b.WindowsOptionsReportType.GET_WIN_SIZE_PIXELS:var w=this._renderService.dimensions.scaledCanvasWidth.toFixed(0),x=this._renderService.dimensions.scaledCanvasHeight.toFixed(0);this._coreService.triggerDataEvent(T.C0.ESC+"[4;"+x+";"+w+"t");break;case b.WindowsOptionsReportType.GET_CELL_SIZE_PIXELS:var D=this._renderService.dimensions.scaledCellWidth.toFixed(0),I=this._renderService.dimensions.scaledCellHeight.toFixed(0);this._coreService.triggerDataEvent(T.C0.ESC+"[6;"+I+";"+D+"t")}},h.prototype.cancel=function(A,w){if(this.options.cancelEvents||w)return A.preventDefault(),A.stopPropagation(),!1},h.prototype._visualBell=function(){return!1},h.prototype._soundBell=function(){return this.options.bellStyle==="sound"},h}(O.CoreTerminal);M.Terminal=m},function(re,M,N){"use strict";var B=this&&this.__decorate||function(T,b,e,E){var s,n=arguments.length,t=n<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,e):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(T,b,e,E);else for(var r=T.length-1;r>=0;r--)(s=T[r])&&(t=(n<3?s(t):n>3?s(b,e,t):s(b,e))||t);return n>3&&t&&Object.defineProperty(b,e,t),t},U=this&&this.__param||function(T,b){return function(e,E){b(e,E,T)}};Object.defineProperty(M,"__esModule",{value:!0}),M.CompositionHelper=void 0;var k=N(5),S=N(1),P=function(){function T(b,e,E,s,n,t){this._textarea=b,this._compositionView=e,this._bufferService=E,this._optionsService=s,this._charSizeService=n,this._coreService=t,this._isComposing=!1,this._isSendingComposition=!1,this._compositionPosition={start:0,end:0}}return Object.defineProperty(T.prototype,"isComposing",{get:function(){return this._isComposing},enumerable:!1,configurable:!0}),T.prototype.compositionstart=function(){this._isComposing=!0,this._compositionPosition.start=this._textarea.value.length,this._compositionView.textContent="",this._compositionView.classList.add("active")},T.prototype.compositionupdate=function(b){var e=this;this._compositionView.textContent=b.data,this.updateCompositionElements(),setTimeout(function(){e._compositionPosition.end=e._textarea.value.length},0)},T.prototype.compositionend=function(){this._finalizeComposition(!0)},T.prototype.keydown=function(b){if(this._isComposing||this._isSendingComposition){if(b.keyCode===229||b.keyCode===16||b.keyCode===17||b.keyCode===18)return!1;this._finalizeComposition(!1)}return b.keyCode!==229||(this._handleAnyTextareaChanges(),!1)},T.prototype._finalizeComposition=function(b){var e=this;if(this._compositionView.classList.remove("active"),this._isComposing=!1,b){var E={start:this._compositionPosition.start,end:this._compositionPosition.end};this._isSendingComposition=!0,setTimeout(function(){if(e._isSendingComposition){e._isSendingComposition=!1;var n=void 0;n=e._isComposing?e._textarea.value.substring(E.start,E.end):e._textarea.value.substring(E.start),e._coreService.triggerDataEvent(n,!0)}},0)}else{this._isSendingComposition=!1;var s=this._textarea.value.substring(this._compositionPosition.start,this._compositionPosition.end);this._coreService.triggerDataEvent(s,!0)}},T.prototype._handleAnyTextareaChanges=function(){var b=this,e=this._textarea.value;setTimeout(function(){if(!b._isComposing){var E=b._textarea.value.replace(e,"");E.length>0&&b._coreService.triggerDataEvent(E,!0)}},0)},T.prototype.updateCompositionElements=function(b){var e=this;if(this._isComposing){if(this._bufferService.buffer.isCursorInViewport){var E=Math.ceil(this._charSizeService.height*this._optionsService.options.lineHeight),s=this._bufferService.buffer.y*E,n=this._bufferService.buffer.x*this._charSizeService.width;this._compositionView.style.left=n+"px",this._compositionView.style.top=s+"px",this._compositionView.style.height=E+"px",this._compositionView.style.lineHeight=E+"px",this._compositionView.style.fontFamily=this._optionsService.options.fontFamily,this._compositionView.style.fontSize=this._optionsService.options.fontSize+"px";var t=this._compositionView.getBoundingClientRect();this._textarea.style.left=n+"px",this._textarea.style.top=s+"px",this._textarea.style.width=t.width+"px",this._textarea.style.height=t.height+"px",this._textarea.style.lineHeight=t.height+"px"}b||setTimeout(function(){return e.updateCompositionElements(!0)},0)}},T=B([U(2,S.IBufferService),U(3,S.IOptionsService),U(4,k.ICharSizeService),U(5,S.ICoreService)],T)}();M.CompositionHelper=P},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(s,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(s,n)},function(s,n){function t(){this.constructor=s}B(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),k=this&&this.__decorate||function(s,n,t,r){var i,a=arguments.length,v=a<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,n,t,r);else for(var p=s.length-1;p>=0;p--)(i=s[p])&&(v=(a<3?i(v):a>3?i(n,t,v):i(n,t))||v);return a>3&&v&&Object.defineProperty(n,t,v),v},S=this&&this.__param||function(s,n){return function(t,r){n(t,r,s)}};Object.defineProperty(M,"__esModule",{value:!0}),M.Viewport=void 0;var P=N(2),T=N(7),b=N(5),e=N(1),E=function(s){function n(t,r,i,a,v,p,l){var o=s.call(this)||this;return o._scrollLines=t,o._viewportElement=r,o._scrollArea=i,o._bufferService=a,o._optionsService=v,o._charSizeService=p,o._renderService=l,o.scrollBarWidth=0,o._currentRowHeight=0,o._lastRecordedBufferLength=0,o._lastRecordedViewportHeight=0,o._lastRecordedBufferHeight=0,o._lastTouchY=0,o._lastScrollTop=0,o._wheelPartialScroll=0,o._refreshAnimationFrame=null,o._ignoreNextScrollEvent=!1,o.scrollBarWidth=o._viewportElement.offsetWidth-o._scrollArea.offsetWidth||15,o.register(T.addDisposableDomListener(o._viewportElement,"scroll",o._onScroll.bind(o))),setTimeout(function(){return o.syncScrollArea()},0),o}return U(n,s),n.prototype.onThemeChange=function(t){this._viewportElement.style.backgroundColor=t.background.css},n.prototype._refresh=function(t){var r=this;if(t)return this._innerRefresh(),void(this._refreshAnimationFrame!==null&&cancelAnimationFrame(this._refreshAnimationFrame));this._refreshAnimationFrame===null&&(this._refreshAnimationFrame=requestAnimationFrame(function(){return r._innerRefresh()}))},n.prototype._innerRefresh=function(){if(this._charSizeService.height>0){this._currentRowHeight=this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio,this._lastRecordedViewportHeight=this._viewportElement.offsetHeight;var t=Math.round(this._currentRowHeight*this._lastRecordedBufferLength)+(this._lastRecordedViewportHeight-this._renderService.dimensions.canvasHeight);this._lastRecordedBufferHeight!==t&&(this._lastRecordedBufferHeight=t,this._scrollArea.style.height=this._lastRecordedBufferHeight+"px")}var r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._viewportElement.scrollTop!==r&&(this._ignoreNextScrollEvent=!0,this._viewportElement.scrollTop=r),this._refreshAnimationFrame=null},n.prototype.syncScrollArea=function(t){if(t===void 0&&(t=!1),this._lastRecordedBufferLength!==this._bufferService.buffer.lines.length)return this._lastRecordedBufferLength=this._bufferService.buffer.lines.length,void this._refresh(t);if(this._lastRecordedViewportHeight===this._renderService.dimensions.canvasHeight){var r=this._bufferService.buffer.ydisp*this._currentRowHeight;this._lastScrollTop===r&&this._lastScrollTop===this._viewportElement.scrollTop&&this._renderService.dimensions.scaledCellHeight/window.devicePixelRatio===this._currentRowHeight||this._refresh(t)}else this._refresh(t)},n.prototype._onScroll=function(t){if(this._lastScrollTop=this._viewportElement.scrollTop,this._viewportElement.offsetParent)if(this._ignoreNextScrollEvent)this._ignoreNextScrollEvent=!1;else{var r=Math.round(this._lastScrollTop/this._currentRowHeight)-this._bufferService.buffer.ydisp;this._scrollLines(r,!0)}},n.prototype._bubbleScroll=function(t,r){var i=this._viewportElement.scrollTop+this._lastRecordedViewportHeight;return!(r<0&&this._viewportElement.scrollTop!==0||r>0&&i<this._lastRecordedBufferHeight)||(t.cancelable&&t.preventDefault(),!1)},n.prototype.onWheel=function(t){var r=this._getPixelsScrolled(t);return r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(t,r))},n.prototype._getPixelsScrolled=function(t){if(t.deltaY===0)return 0;var r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_LINE?r*=this._currentRowHeight:t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._currentRowHeight*this._bufferService.rows),r},n.prototype.getLinesScrolled=function(t){if(t.deltaY===0)return 0;var r=this._applyScrollModifier(t.deltaY,t);return t.deltaMode===WheelEvent.DOM_DELTA_PIXEL?(r/=this._currentRowHeight+0,this._wheelPartialScroll+=r,r=Math.floor(Math.abs(this._wheelPartialScroll))*(this._wheelPartialScroll>0?1:-1),this._wheelPartialScroll%=1):t.deltaMode===WheelEvent.DOM_DELTA_PAGE&&(r*=this._bufferService.rows),r},n.prototype._applyScrollModifier=function(t,r){var i=this._optionsService.options.fastScrollModifier;return i==="alt"&&r.altKey||i==="ctrl"&&r.ctrlKey||i==="shift"&&r.shiftKey?t*this._optionsService.options.fastScrollSensitivity*this._optionsService.options.scrollSensitivity:t*this._optionsService.options.scrollSensitivity},n.prototype.onTouchStart=function(t){this._lastTouchY=t.touches[0].pageY},n.prototype.onTouchMove=function(t){var r=this._lastTouchY-t.touches[0].pageY;return this._lastTouchY=t.touches[0].pageY,r!==0&&(this._viewportElement.scrollTop+=r,this._bubbleScroll(t,r))},n=k([S(3,e.IBufferService),S(4,e.IOptionsService),S(5,b.ICharSizeService),S(6,b.IRenderService)],n)}(P.Disposable);M.Viewport=E},function(re,M,N){"use strict";function B(P){return P.replace(/\r?\n/g,"\r")}function U(P,T){return T?"\x1B[200~"+P+"\x1B[201~":P}function k(P,T,b){P=U(P=B(P),b.decPrivateModes.bracketedPasteMode),b.triggerDataEvent(P,!0),T.value=""}function S(P,T,b){var e=b.getBoundingClientRect(),E=P.clientX-e.left-10,s=P.clientY-e.top-10;T.style.width="20px",T.style.height="20px",T.style.left=E+"px",T.style.top=s+"px",T.style.zIndex="1000",T.focus()}Object.defineProperty(M,"__esModule",{value:!0}),M.rightClickHandler=M.moveTextAreaUnderMouseCursor=M.paste=M.handlePasteEvent=M.copyHandler=M.bracketTextForPaste=M.prepareTextForTerminal=void 0,M.prepareTextForTerminal=B,M.bracketTextForPaste=U,M.copyHandler=function(P,T){P.clipboardData&&P.clipboardData.setData("text/plain",T.selectionText),P.preventDefault()},M.handlePasteEvent=function(P,T,b){P.stopPropagation(),P.clipboardData&&k(P.clipboardData.getData("text/plain"),T,b)},M.paste=k,M.moveTextAreaUnderMouseCursor=S,M.rightClickHandler=function(P,T,b,e,E){S(P,T,b),E&&!e.isClickInSelection(P)&&e.selectWordAtCursor(P),T.value=e.selectionText,T.select()}},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(s,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(s,n)},function(s,n){function t(){this.constructor=s}B(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)});Object.defineProperty(M,"__esModule",{value:!0}),M.EscapeSequenceParser=M.VT500_TRANSITION_TABLE=M.TransitionTable=void 0;var k=N(2),S=N(15),P=N(21),T=N(22),b=N(24),e=function(){function s(n){this.table=new Uint8Array(n)}return s.prototype.setDefault=function(n,t){S.fill(this.table,n<<4|t)},s.prototype.add=function(n,t,r,i){this.table[t<<8|n]=r<<4|i},s.prototype.addMany=function(n,t,r,i){for(var a=0;a<n.length;a++)this.table[t<<8|n[a]]=r<<4|i},s}();M.TransitionTable=e,M.VT500_TRANSITION_TABLE=function(){var s=new e(4095),n=Array.apply(null,Array(256)).map(function(p,l){return l}),t=function(p,l){return n.slice(p,l)},r=t(32,127),i=t(0,24);i.push(25),i.push.apply(i,t(28,32));var a,v=t(0,14);for(a in s.setDefault(1,0),s.addMany(r,0,2,0),v)s.addMany([24,26,153,154],a,3,0),s.addMany(t(128,144),a,3,0),s.addMany(t(144,152),a,3,0),s.add(156,a,0,0),s.add(27,a,11,1),s.add(157,a,4,8),s.addMany([152,158,159],a,0,7),s.add(155,a,11,3),s.add(144,a,11,9);return s.addMany(i,0,3,0),s.addMany(i,1,3,1),s.add(127,1,0,1),s.addMany(i,8,0,8),s.addMany(i,3,3,3),s.add(127,3,0,3),s.addMany(i,4,3,4),s.add(127,4,0,4),s.addMany(i,6,3,6),s.addMany(i,5,3,5),s.add(127,5,0,5),s.addMany(i,2,3,2),s.add(127,2,0,2),s.add(93,1,4,8),s.addMany(r,8,5,8),s.add(127,8,5,8),s.addMany([156,27,24,26,7],8,6,0),s.addMany(t(28,32),8,0,8),s.addMany([88,94,95],1,0,7),s.addMany(r,7,0,7),s.addMany(i,7,0,7),s.add(156,7,0,0),s.add(127,7,0,7),s.add(91,1,11,3),s.addMany(t(64,127),3,7,0),s.addMany(t(48,60),3,8,4),s.addMany([60,61,62,63],3,9,4),s.addMany(t(48,60),4,8,4),s.addMany(t(64,127),4,7,0),s.addMany([60,61,62,63],4,0,6),s.addMany(t(32,64),6,0,6),s.add(127,6,0,6),s.addMany(t(64,127),6,0,0),s.addMany(t(32,48),3,9,5),s.addMany(t(32,48),5,9,5),s.addMany(t(48,64),5,0,6),s.addMany(t(64,127),5,7,0),s.addMany(t(32,48),4,9,5),s.addMany(t(32,48),1,9,2),s.addMany(t(32,48),2,9,2),s.addMany(t(48,127),2,10,0),s.addMany(t(48,80),1,10,0),s.addMany(t(81,88),1,10,0),s.addMany([89,90,92],1,10,0),s.addMany(t(96,127),1,10,0),s.add(80,1,11,9),s.addMany(i,9,0,9),s.add(127,9,0,9),s.addMany(t(28,32),9,0,9),s.addMany(t(32,48),9,9,12),s.addMany(t(48,60),9,8,10),s.addMany([60,61,62,63],9,9,10),s.addMany(i,11,0,11),s.addMany(t(32,128),11,0,11),s.addMany(t(28,32),11,0,11),s.addMany(i,10,0,10),s.add(127,10,0,10),s.addMany(t(28,32),10,0,10),s.addMany(t(48,60),10,8,10),s.addMany([60,61,62,63],10,0,11),s.addMany(t(32,48),10,9,12),s.addMany(i,12,0,12),s.add(127,12,0,12),s.addMany(t(28,32),12,0,12),s.addMany(t(32,48),12,9,12),s.addMany(t(48,64),12,0,11),s.addMany(t(64,127),12,12,13),s.addMany(t(64,127),10,12,13),s.addMany(t(64,127),9,12,13),s.addMany(i,13,13,13),s.addMany(r,13,13,13),s.add(127,13,0,13),s.addMany([27,156,24,26],13,14,0),s.add(160,0,2,0),s.add(160,8,5,8),s.add(160,6,0,6),s.add(160,11,0,11),s.add(160,13,13,13),s}();var E=function(s){function n(t){t===void 0&&(t=M.VT500_TRANSITION_TABLE);var r=s.call(this)||this;return r._transitions=t,r.initialState=0,r.currentState=r.initialState,r._params=new P.Params,r._params.addParam(0),r._collect=0,r.precedingCodepoint=0,r._printHandlerFb=function(i,a,v){},r._executeHandlerFb=function(i){},r._csiHandlerFb=function(i,a){},r._escHandlerFb=function(i){},r._errorHandlerFb=function(i){return i},r._printHandler=r._printHandlerFb,r._executeHandlers=Object.create(null),r._csiHandlers=Object.create(null),r._escHandlers=Object.create(null),r._oscParser=new T.OscParser,r._dcsParser=new b.DcsParser,r._errorHandler=r._errorHandlerFb,r.setEscHandler({final:"\\"},function(){}),r}return U(n,s),n.prototype._identifier=function(t,r){r===void 0&&(r=[64,126]);var i=0;if(t.prefix){if(t.prefix.length>1)throw new Error("only one byte as prefix supported");if((i=t.prefix.charCodeAt(0))&&60>i||i>63)throw new Error("prefix must be in range 0x3c .. 0x3f")}if(t.intermediates){if(t.intermediates.length>2)throw new Error("only two bytes as intermediates are supported");for(var a=0;a<t.intermediates.length;++a){var v=t.intermediates.charCodeAt(a);if(32>v||v>47)throw new Error("intermediate must be in range 0x20 .. 0x2f");i<<=8,i|=v}}if(t.final.length!==1)throw new Error("final must be a single byte");var p=t.final.charCodeAt(0);if(r[0]>p||p>r[1])throw new Error("final must be in range "+r[0]+" .. "+r[1]);return i<<=8,i|=p},n.prototype.identToString=function(t){for(var r=[];t;)r.push(String.fromCharCode(255&t)),t>>=8;return r.reverse().join("")},n.prototype.dispose=function(){this._csiHandlers=Object.create(null),this._executeHandlers=Object.create(null),this._escHandlers=Object.create(null),this._oscParser.dispose(),this._dcsParser.dispose()},n.prototype.setPrintHandler=function(t){this._printHandler=t},n.prototype.clearPrintHandler=function(){this._printHandler=this._printHandlerFb},n.prototype.addEscHandler=function(t,r){var i=this._identifier(t,[48,126]);this._escHandlers[i]===void 0&&(this._escHandlers[i]=[]);var a=this._escHandlers[i];return a.push(r),{dispose:function(){var v=a.indexOf(r);v!==-1&&a.splice(v,1)}}},n.prototype.setEscHandler=function(t,r){this._escHandlers[this._identifier(t,[48,126])]=[r]},n.prototype.clearEscHandler=function(t){this._escHandlers[this._identifier(t,[48,126])]&&delete this._escHandlers[this._identifier(t,[48,126])]},n.prototype.setEscHandlerFallback=function(t){this._escHandlerFb=t},n.prototype.setExecuteHandler=function(t,r){this._executeHandlers[t.charCodeAt(0)]=r},n.prototype.clearExecuteHandler=function(t){this._executeHandlers[t.charCodeAt(0)]&&delete this._executeHandlers[t.charCodeAt(0)]},n.prototype.setExecuteHandlerFallback=function(t){this._executeHandlerFb=t},n.prototype.addCsiHandler=function(t,r){var i=this._identifier(t);this._csiHandlers[i]===void 0&&(this._csiHandlers[i]=[]);var a=this._csiHandlers[i];return a.push(r),{dispose:function(){var v=a.indexOf(r);v!==-1&&a.splice(v,1)}}},n.prototype.setCsiHandler=function(t,r){this._csiHandlers[this._identifier(t)]=[r]},n.prototype.clearCsiHandler=function(t){this._csiHandlers[this._identifier(t)]&&delete this._csiHandlers[this._identifier(t)]},n.prototype.setCsiHandlerFallback=function(t){this._csiHandlerFb=t},n.prototype.addDcsHandler=function(t,r){return this._dcsParser.addHandler(this._identifier(t),r)},n.prototype.setDcsHandler=function(t,r){this._dcsParser.setHandler(this._identifier(t),r)},n.prototype.clearDcsHandler=function(t){this._dcsParser.clearHandler(this._identifier(t))},n.prototype.setDcsHandlerFallback=function(t){this._dcsParser.setHandlerFallback(t)},n.prototype.addOscHandler=function(t,r){return this._oscParser.addHandler(t,r)},n.prototype.setOscHandler=function(t,r){this._oscParser.setHandler(t,r)},n.prototype.clearOscHandler=function(t){this._oscParser.clearHandler(t)},n.prototype.setOscHandlerFallback=function(t){this._oscParser.setHandlerFallback(t)},n.prototype.setErrorHandler=function(t){this._errorHandler=t},n.prototype.clearErrorHandler=function(){this._errorHandler=this._errorHandlerFb},n.prototype.reset=function(){this.currentState=this.initialState,this._oscParser.reset(),this._dcsParser.reset(),this._params.reset(),this._params.addParam(0),this._collect=0,this.precedingCodepoint=0},n.prototype.parse=function(t,r){for(var i=0,a=0,v=this.currentState,p=this._oscParser,l=this._dcsParser,o=this._collect,u=this._params,c=this._transitions.table,_=0;_<r;++_){switch((a=c[v<<8|((i=t[_])<160?i:160)])>>4){case 2:for(var y=_+1;;++y){if(y>=r||(i=t[y])<32||i>126&&i<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(i=t[y])<32||i>126&&i<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(i=t[y])<32||i>126&&i<160){this._printHandler(t,_,y),_=y-1;break}if(++y>=r||(i=t[y])<32||i>126&&i<160){this._printHandler(t,_,y),_=y-1;break}}break;case 3:this._executeHandlers[i]?this._executeHandlers[i]():this._executeHandlerFb(i),this.precedingCodepoint=0;break;case 0:break;case 1:if(this._errorHandler({position:_,code:i,currentState:v,collect:o,params:u,abort:!1}).abort)return;break;case 7:for(var f=this._csiHandlers[o<<8|i],C=f?f.length-1:-1;C>=0&&f[C](u)===!1;C--);C<0&&this._csiHandlerFb(o<<8|i,u),this.precedingCodepoint=0;break;case 8:do switch(i){case 59:u.addParam(0);break;case 58:u.addSubParam(-1);break;default:u.addDigit(i-48)}while(++_<r&&(i=t[_])>47&&i<60);_--;break;case 9:o<<=8,o|=i;break;case 10:for(var L=this._escHandlers[o<<8|i],R=L?L.length-1:-1;R>=0&&L[R]()===!1;R--);R<0&&this._escHandlerFb(o<<8|i),this.precedingCodepoint=0;break;case 11:u.reset(),u.addParam(0),o=0;break;case 12:l.hook(o<<8|i,u);break;case 13:for(var O=_+1;;++O)if(O>=r||(i=t[O])===24||i===26||i===27||i>127&&i<160){l.put(t,_,O),_=O-1;break}break;case 14:l.unhook(i!==24&&i!==26),i===27&&(a|=1),u.reset(),u.addParam(0),o=0,this.precedingCodepoint=0;break;case 4:p.start();break;case 5:for(var g=_+1;;g++)if(g>=r||(i=t[g])<32||i>127&&i<=159){p.put(t,_,g),_=g-1;break}break;case 6:p.end(i!==24&&i!==26),i===27&&(a|=1),u.reset(),u.addParam(0),o=0,this.precedingCodepoint=0}v=15&a}this._collect=o,this.currentState=v},n}(k.Disposable);M.EscapeSequenceParser=E},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(p,l){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var c in u)u.hasOwnProperty(c)&&(o[c]=u[c])})(p,l)},function(p,l){function o(){this.constructor=p}B(p,l),p.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}),k=this&&this.__decorate||function(p,l,o,u){var c,_=arguments.length,y=_<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(p,l,o,u);else for(var f=p.length-1;f>=0;f--)(c=p[f])&&(y=(_<3?c(y):_>3?c(l,o,y):c(l,o))||y);return _>3&&y&&Object.defineProperty(l,o,y),y},S=this&&this.__param||function(p,l){return function(o,u){l(o,u,p)}};Object.defineProperty(M,"__esModule",{value:!0}),M.Renderer=void 0;var P=N(41),T=N(47),b=N(48),e=N(49),E=N(29),s=N(2),n=N(5),t=N(1),r=N(25),i=N(0),a=1,v=function(p){function l(o,u,c,_,y,f,C,L,R){var O=p.call(this)||this;O._colors=o,O._screenElement=u,O._bufferService=y,O._charSizeService=f,O._optionsService=C,O._id=a++,O._onRequestRedraw=new i.EventEmitter;var g=O._optionsService.options.allowTransparency;return O._characterJoinerRegistry=new E.CharacterJoinerRegistry(O._bufferService),O._renderLayers=[new P.TextRenderLayer(O._screenElement,0,O._colors,O._characterJoinerRegistry,g,O._id,O._bufferService,C),new T.SelectionRenderLayer(O._screenElement,1,O._colors,O._id,O._bufferService,C),new e.LinkRenderLayer(O._screenElement,2,O._colors,O._id,c,_,O._bufferService,C),new b.CursorRenderLayer(O._screenElement,3,O._colors,O._id,O._onRequestRedraw,O._bufferService,C,L,R)],O.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},O._devicePixelRatio=window.devicePixelRatio,O._updateDimensions(),O.onOptionsChanged(),O}return U(l,p),Object.defineProperty(l.prototype,"onRequestRedraw",{get:function(){return this._onRequestRedraw.event},enumerable:!1,configurable:!0}),l.prototype.dispose=function(){for(var o=0,u=this._renderLayers;o<u.length;o++)u[o].dispose();p.prototype.dispose.call(this),r.removeTerminalFromCache(this._id)},l.prototype.onDevicePixelRatioChange=function(){this._devicePixelRatio!==window.devicePixelRatio&&(this._devicePixelRatio=window.devicePixelRatio,this.onResize(this._bufferService.cols,this._bufferService.rows))},l.prototype.setColors=function(o){this._colors=o;for(var u=0,c=this._renderLayers;u<c.length;u++){var _=c[u];_.setColors(this._colors),_.reset()}},l.prototype.onResize=function(o,u){this._updateDimensions();for(var c=0,_=this._renderLayers;c<_.length;c++)_[c].resize(this.dimensions);this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},l.prototype.onCharSizeChanged=function(){this.onResize(this._bufferService.cols,this._bufferService.rows)},l.prototype.onBlur=function(){this._runOperation(function(o){return o.onBlur()})},l.prototype.onFocus=function(){this._runOperation(function(o){return o.onFocus()})},l.prototype.onSelectionChanged=function(o,u,c){c===void 0&&(c=!1),this._runOperation(function(_){return _.onSelectionChanged(o,u,c)})},l.prototype.onCursorMove=function(){this._runOperation(function(o){return o.onCursorMove()})},l.prototype.onOptionsChanged=function(){this._runOperation(function(o){return o.onOptionsChanged()})},l.prototype.clear=function(){this._runOperation(function(o){return o.reset()})},l.prototype._runOperation=function(o){for(var u=0,c=this._renderLayers;u<c.length;u++)o(c[u])},l.prototype.renderRows=function(o,u){for(var c=0,_=this._renderLayers;c<_.length;c++)_[c].onGridChanged(o,u)},l.prototype._updateDimensions=function(){this._charSizeService.hasValidSize&&(this.dimensions.scaledCharWidth=Math.floor(this._charSizeService.width*window.devicePixelRatio),this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharTop=this._optionsService.options.lineHeight===1?0:Math.round((this.dimensions.scaledCellHeight-this.dimensions.scaledCharHeight)/2),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCharLeft=Math.floor(this._optionsService.options.letterSpacing/2),this.dimensions.scaledCanvasHeight=this._bufferService.rows*this.dimensions.scaledCellHeight,this.dimensions.scaledCanvasWidth=this._bufferService.cols*this.dimensions.scaledCellWidth,this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows,this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols)},l.prototype.registerCharacterJoiner=function(o){return this._characterJoinerRegistry.registerCharacterJoiner(o)},l.prototype.deregisterCharacterJoiner=function(o){return this._characterJoinerRegistry.deregisterCharacterJoiner(o)},l=k([S(4,t.IBufferService),S(5,n.ICharSizeService),S(6,t.IOptionsService),S(7,t.ICoreService),S(8,n.ICoreBrowserService)],l)}(s.Disposable);M.Renderer=v},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(s,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(s,n)},function(s,n){function t(){this.constructor=s}B(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)});Object.defineProperty(M,"__esModule",{value:!0}),M.TextRenderLayer=void 0;var k=N(42),S=N(13),P=N(6),T=N(3),b=N(29),e=N(4),E=function(s){function n(t,r,i,a,v,p,l,o){var u=s.call(this,t,"text",r,v,i,p,l,o)||this;return u._characterWidth=0,u._characterFont="",u._characterOverlapCache={},u._workCell=new e.CellData,u._state=new k.GridCache,u._characterJoinerRegistry=a,u}return U(n,s),n.prototype.resize=function(t){s.prototype.resize.call(this,t);var r=this._getFont(!1,!1);this._characterWidth===t.scaledCharWidth&&this._characterFont===r||(this._characterWidth=t.scaledCharWidth,this._characterFont=r,this._characterOverlapCache={}),this._state.clear(),this._state.resize(this._bufferService.cols,this._bufferService.rows)},n.prototype.reset=function(){this._state.clear(),this._clearAll()},n.prototype._forEachCell=function(t,r,i,a){for(var v=t;v<=r;v++)for(var p=v+this._bufferService.buffer.ydisp,l=this._bufferService.buffer.lines.get(p),o=i?i.getJoinedCharacters(p):[],u=0;u<this._bufferService.cols;u++){l.loadCell(u,this._workCell);var c=this._workCell,_=!1,y=u;if(c.getWidth()!==0){if(o.length>0&&u===o[0][0]){_=!0;var f=o.shift();c=new b.JoinedCellData(this._workCell,l.translateToString(!0,f[0],f[1]),f[1]-f[0]),y=f[1]-1}!_&&this._isOverlapping(c)&&y<l.length-1&&l.getCodePoint(y+1)===T.NULL_CELL_CODE&&(c.content&=-12582913,c.content|=2<<22),a(c,u,v),u=y}}},n.prototype._drawBackground=function(t,r){var i=this,a=this._ctx,v=this._bufferService.cols,p=0,l=0,o=null;a.save(),this._forEachCell(t,r,null,function(u,c,_){var y=null;u.isInverse()?y=u.isFgDefault()?i._colors.foreground.css:u.isFgRGB()?"rgb("+P.AttributeData.toColorRGB(u.getFgColor()).join(",")+")":i._colors.ansi[u.getFgColor()].css:u.isBgRGB()?y="rgb("+P.AttributeData.toColorRGB(u.getBgColor()).join(",")+")":u.isBgPalette()&&(y=i._colors.ansi[u.getBgColor()].css),o===null&&(p=c,l=_),_!==l?(a.fillStyle=o||"",i._fillCells(p,l,v-p,1),p=c,l=_):o!==y&&(a.fillStyle=o||"",i._fillCells(p,l,c-p,1),p=c,l=_),o=y}),o!==null&&(a.fillStyle=o,this._fillCells(p,l,v-p,1)),a.restore()},n.prototype._drawForeground=function(t,r){var i=this;this._forEachCell(t,r,this._characterJoinerRegistry,function(a,v,p){if(!a.isInvisible()&&(i._drawChars(a,v,p),a.isUnderline())){if(i._ctx.save(),a.isInverse())if(a.isBgDefault())i._ctx.fillStyle=i._colors.background.css;else if(a.isBgRGB())i._ctx.fillStyle="rgb("+P.AttributeData.toColorRGB(a.getBgColor()).join(",")+")";else{var l=a.getBgColor();i._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&l<8&&(l+=8),i._ctx.fillStyle=i._colors.ansi[l].css}else if(a.isFgDefault())i._ctx.fillStyle=i._colors.foreground.css;else if(a.isFgRGB())i._ctx.fillStyle="rgb("+P.AttributeData.toColorRGB(a.getFgColor()).join(",")+")";else{var o=a.getFgColor();i._optionsService.options.drawBoldTextInBrightColors&&a.isBold()&&o<8&&(o+=8),i._ctx.fillStyle=i._colors.ansi[o].css}i._fillBottomLineAtCells(v,p,a.getWidth()),i._ctx.restore()}})},n.prototype.onGridChanged=function(t,r){this._state.cache.length!==0&&(this._charAtlas&&this._charAtlas.beginFrame(),this._clearCells(0,t,this._bufferService.cols,r-t+1),this._drawBackground(t,r),this._drawForeground(t,r))},n.prototype.onOptionsChanged=function(){this._setTransparency(this._optionsService.options.allowTransparency)},n.prototype._isOverlapping=function(t){if(t.getWidth()!==1||t.getCode()<256)return!1;var r=t.getChars();if(this._characterOverlapCache.hasOwnProperty(r))return this._characterOverlapCache[r];this._ctx.save(),this._ctx.font=this._characterFont;var i=Math.floor(this._ctx.measureText(r).width)>this._characterWidth;return this._ctx.restore(),this._characterOverlapCache[r]=i,i},n}(S.BaseRenderLayer);M.TextRenderLayer=E},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.GridCache=void 0;var B=function(){function U(){this.cache=[]}return U.prototype.resize=function(k,S){for(var P=0;P<k;P++){this.cache.length<=P&&this.cache.push([]);for(var T=this.cache[P].length;T<S;T++)this.cache[P].push(void 0);this.cache[P].length=S}this.cache.length=k},U.prototype.clear=function(){for(var k=0;k<this.cache.length;k++)for(var S=0;S<this.cache[k].length;S++)this.cache[k][S]=void 0},U}();M.GridCache=B},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(i,a){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(v,p){v.__proto__=p}||function(v,p){for(var l in p)p.hasOwnProperty(l)&&(v[l]=p[l])})(i,a)},function(i,a){function v(){this.constructor=i}B(i,a),i.prototype=a===null?Object.create(a):(v.prototype=a.prototype,new v)});Object.defineProperty(M,"__esModule",{value:!0}),M.NoneCharAtlas=M.DynamicCharAtlas=M.getGlyphCacheKey=void 0;var k=N(9),S=N(44),P=N(27),T=N(46),b=N(11),e=N(28),E=N(10),s={css:"rgba(0, 0, 0, 0)",rgba:0};function n(i){return i.code<<21|i.bg<<12|i.fg<<3|(i.bold?0:4)+(i.dim?0:2)+(i.italic?0:1)}M.getGlyphCacheKey=n;var t=function(i){function a(v,p){var l=i.call(this)||this;l._config=p,l._drawToCacheCount=0,l._glyphsWaitingOnBitmap=[],l._bitmapCommitTimeout=null,l._bitmap=null,l._cacheCanvas=v.createElement("canvas"),l._cacheCanvas.width=1024,l._cacheCanvas.height=1024,l._cacheCtx=e.throwIfFalsy(l._cacheCanvas.getContext("2d",{alpha:!0}));var o=v.createElement("canvas");o.width=l._config.scaledCharWidth,o.height=l._config.scaledCharHeight,l._tmpCtx=e.throwIfFalsy(o.getContext("2d",{alpha:l._config.allowTransparency})),l._width=Math.floor(1024/l._config.scaledCharWidth),l._height=Math.floor(1024/l._config.scaledCharHeight);var u=l._width*l._height;return l._cacheMap=new T.LRUMap(u),l._cacheMap.prealloc(u),l}return U(a,i),a.prototype.dispose=function(){this._bitmapCommitTimeout!==null&&(window.clearTimeout(this._bitmapCommitTimeout),this._bitmapCommitTimeout=null)},a.prototype.beginFrame=function(){this._drawToCacheCount=0},a.prototype.draw=function(v,p,l,o){if(p.code===32)return!0;if(!this._canCache(p))return!1;var u=n(p),c=this._cacheMap.get(u);if(c!=null)return this._drawFromCache(v,c,l,o),!0;if(this._drawToCacheCount<100){var _=void 0;_=this._cacheMap.size<this._cacheMap.capacity?this._cacheMap.size:this._cacheMap.peek().index;var y=this._drawToCache(p,_);return this._cacheMap.set(u,y),this._drawFromCache(v,y,l,o),!0}return!1},a.prototype._canCache=function(v){return v.code<256},a.prototype._toCoordinateX=function(v){return v%this._width*this._config.scaledCharWidth},a.prototype._toCoordinateY=function(v){return Math.floor(v/this._width)*this._config.scaledCharHeight},a.prototype._drawFromCache=function(v,p,l,o){if(!p.isEmpty){var u=this._toCoordinateX(p.index),c=this._toCoordinateY(p.index);v.drawImage(p.inBitmap?this._bitmap:this._cacheCanvas,u,c,this._config.scaledCharWidth,this._config.scaledCharHeight,l,o,this._config.scaledCharWidth,this._config.scaledCharHeight)}},a.prototype._getColorFromAnsiIndex=function(v){return v<this._config.colors.ansi.length?this._config.colors.ansi[v]:P.DEFAULT_ANSI_COLORS[v]},a.prototype._getBackgroundColor=function(v){return this._config.allowTransparency?s:v.bg===k.INVERTED_DEFAULT_COLOR?this._config.colors.foreground:v.bg<256?this._getColorFromAnsiIndex(v.bg):this._config.colors.background},a.prototype._getForegroundColor=function(v){return v.fg===k.INVERTED_DEFAULT_COLOR?E.color.opaque(this._config.colors.background):v.fg<256?this._getColorFromAnsiIndex(v.fg):this._config.colors.foreground},a.prototype._drawToCache=function(v,p){this._drawToCacheCount++,this._tmpCtx.save();var l=this._getBackgroundColor(v);this._tmpCtx.globalCompositeOperation="copy",this._tmpCtx.fillStyle=l.css,this._tmpCtx.fillRect(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),this._tmpCtx.globalCompositeOperation="source-over";var o=v.bold?this._config.fontWeightBold:this._config.fontWeight,u=v.italic?"italic":"";this._tmpCtx.font=u+" "+o+" "+this._config.fontSize*this._config.devicePixelRatio+"px "+this._config.fontFamily,this._tmpCtx.textBaseline="middle",this._tmpCtx.fillStyle=this._getForegroundColor(v).css,v.dim&&(this._tmpCtx.globalAlpha=k.DIM_OPACITY),this._tmpCtx.fillText(v.chars,0,this._config.scaledCharHeight/2),this._tmpCtx.restore();var c=this._tmpCtx.getImageData(0,0,this._config.scaledCharWidth,this._config.scaledCharHeight),_=!1;this._config.allowTransparency||(_=function(L,R){for(var O=!0,g=R.rgba>>>24,m=R.rgba>>>16&255,d=R.rgba>>>8&255,h=0;h<L.data.length;h+=4)L.data[h]===g&&L.data[h+1]===m&&L.data[h+2]===d?L.data[h+3]=0:O=!1;return O}(c,l));var y=this._toCoordinateX(p),f=this._toCoordinateY(p);this._cacheCtx.putImageData(c,y,f);var C={index:p,isEmpty:_,inBitmap:!1};return this._addGlyphToBitmap(C),C},a.prototype._addGlyphToBitmap=function(v){var p=this;!("createImageBitmap"in window)||b.isFirefox||b.isSafari||(this._glyphsWaitingOnBitmap.push(v),this._bitmapCommitTimeout===null&&(this._bitmapCommitTimeout=window.setTimeout(function(){return p._generateBitmap()},100)))},a.prototype._generateBitmap=function(){var v=this,p=this._glyphsWaitingOnBitmap;this._glyphsWaitingOnBitmap=[],window.createImageBitmap(this._cacheCanvas).then(function(l){v._bitmap=l;for(var o=0;o<p.length;o++)p[o].inBitmap=!0}),this._bitmapCommitTimeout=null},a}(S.BaseCharAtlas);M.DynamicCharAtlas=t;var r=function(i){function a(v,p){return i.call(this)||this}return U(a,i),a.prototype.draw=function(v,p,l,o){return!1},a}(S.BaseCharAtlas);M.NoneCharAtlas=r},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.BaseCharAtlas=void 0;var B=function(){function U(){this._didWarmUp=!1}return U.prototype.dispose=function(){},U.prototype.warmUp=function(){this._didWarmUp||(this._doWarmUp(),this._didWarmUp=!0)},U.prototype._doWarmUp=function(){},U.prototype.beginFrame=function(){},U}();M.BaseCharAtlas=B},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.ColorContrastCache=void 0;var B=function(){function U(){this._color={},this._rgba={}}return U.prototype.clear=function(){this._color={},this._rgba={}},U.prototype.setCss=function(k,S,P){this._rgba[k]||(this._rgba[k]={}),this._rgba[k][S]=P},U.prototype.getCss=function(k,S){return this._rgba[k]?this._rgba[k][S]:void 0},U.prototype.setColor=function(k,S,P){this._color[k]||(this._color[k]={}),this._color[k][S]=P},U.prototype.getColor=function(k,S){return this._color[k]?this._color[k][S]:void 0},U}();M.ColorContrastCache=B},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.LRUMap=void 0;var B=function(){function U(k){this.capacity=k,this._map={},this._head=null,this._tail=null,this._nodePool=[],this.size=0}return U.prototype._unlinkNode=function(k){var S=k.prev,P=k.next;k===this._head&&(this._head=P),k===this._tail&&(this._tail=S),S!==null&&(S.next=P),P!==null&&(P.prev=S)},U.prototype._appendNode=function(k){var S=this._tail;S!==null&&(S.next=k),k.prev=S,k.next=null,this._tail=k,this._head===null&&(this._head=k)},U.prototype.prealloc=function(k){for(var S=this._nodePool,P=0;P<k;P++)S.push({prev:null,next:null,key:null,value:null})},U.prototype.get=function(k){var S=this._map[k];return S!==void 0?(this._unlinkNode(S),this._appendNode(S),S.value):null},U.prototype.peekValue=function(k){var S=this._map[k];return S!==void 0?S.value:null},U.prototype.peek=function(){var k=this._head;return k===null?null:k.value},U.prototype.set=function(k,S){var P=this._map[k];if(P!==void 0)P=this._map[k],this._unlinkNode(P),P.value=S;else if(this.size>=this.capacity)P=this._head,this._unlinkNode(P),delete this._map[P.key],P.key=k,P.value=S,this._map[k]=P;else{var T=this._nodePool;T.length>0?((P=T.pop()).key=k,P.value=S):P={prev:null,next:null,key:k,value:S},this._map[k]=P,this.size++}this._appendNode(P)},U}();M.LRUMap=B},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(S,P){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(T,b){T.__proto__=b}||function(T,b){for(var e in b)b.hasOwnProperty(e)&&(T[e]=b[e])})(S,P)},function(S,P){function T(){this.constructor=S}B(S,P),S.prototype=P===null?Object.create(P):(T.prototype=P.prototype,new T)});Object.defineProperty(M,"__esModule",{value:!0}),M.SelectionRenderLayer=void 0;var k=function(S){function P(T,b,e,E,s,n){var t=S.call(this,T,"selection",b,!0,e,E,s,n)||this;return t._clearState(),t}return U(P,S),P.prototype._clearState=function(){this._state={start:void 0,end:void 0,columnSelectMode:void 0,ydisp:void 0}},P.prototype.resize=function(T){S.prototype.resize.call(this,T),this._clearState()},P.prototype.reset=function(){this._state.start&&this._state.end&&(this._clearState(),this._clearAll())},P.prototype.onSelectionChanged=function(T,b,e){if(this._didStateChange(T,b,e,this._bufferService.buffer.ydisp))if(this._clearAll(),T&&b){var E=T[1]-this._bufferService.buffer.ydisp,s=b[1]-this._bufferService.buffer.ydisp,n=Math.max(E,0),t=Math.min(s,this._bufferService.rows-1);if(!(n>=this._bufferService.rows||t<0)){if(this._ctx.fillStyle=this._colors.selectionTransparent.css,e){var r=T[0],i=b[0]-r,a=t-n+1;this._fillCells(r,n,i,a)}else{r=E===n?T[0]:0;var v=n===t?b[0]:this._bufferService.cols;this._fillCells(r,n,v-r,1);var p=Math.max(t-n-1,0);if(this._fillCells(0,n+1,this._bufferService.cols,p),n!==t){var l=s===t?b[0]:this._bufferService.cols;this._fillCells(0,t,l,1)}}this._state.start=[T[0],T[1]],this._state.end=[b[0],b[1]],this._state.columnSelectMode=e,this._state.ydisp=this._bufferService.buffer.ydisp}}else this._clearState()},P.prototype._didStateChange=function(T,b,e,E){return!this._areCoordinatesEqual(T,this._state.start)||!this._areCoordinatesEqual(b,this._state.end)||e!==this._state.columnSelectMode||E!==this._state.ydisp},P.prototype._areCoordinatesEqual=function(T,b){return!(!T||!b)&&T[0]===b[0]&&T[1]===b[1]},P}(N(13).BaseRenderLayer);M.SelectionRenderLayer=k},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(b,e){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,s){E.__proto__=s}||function(E,s){for(var n in s)s.hasOwnProperty(n)&&(E[n]=s[n])})(b,e)},function(b,e){function E(){this.constructor=b}B(b,e),b.prototype=e===null?Object.create(e):(E.prototype=e.prototype,new E)});Object.defineProperty(M,"__esModule",{value:!0}),M.CursorRenderLayer=void 0;var k=N(13),S=N(4),P=function(b){function e(E,s,n,t,r,i,a,v,p){var l=b.call(this,E,"cursor",s,!0,n,t,i,a)||this;return l._onRequestRedraw=r,l._coreService=v,l._coreBrowserService=p,l._cell=new S.CellData,l._state={x:0,y:0,isFocused:!1,style:"",width:0},l._cursorRenderers={bar:l._renderBarCursor.bind(l),block:l._renderBlockCursor.bind(l),underline:l._renderUnderlineCursor.bind(l)},l}return U(e,b),e.prototype.resize=function(E){b.prototype.resize.call(this,E),this._state={x:0,y:0,isFocused:!1,style:"",width:0}},e.prototype.reset=function(){this._clearCursor(),this._cursorBlinkStateManager&&(this._cursorBlinkStateManager.dispose(),this._cursorBlinkStateManager=void 0,this.onOptionsChanged())},e.prototype.onBlur=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.pause(),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},e.prototype.onFocus=function(){this._cursorBlinkStateManager?this._cursorBlinkStateManager.resume():this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},e.prototype.onOptionsChanged=function(){var E,s=this;this._optionsService.options.cursorBlink?this._cursorBlinkStateManager||(this._cursorBlinkStateManager=new T(this._coreBrowserService.isFocused,function(){s._render(!0)})):((E=this._cursorBlinkStateManager)===null||E===void 0||E.dispose(),this._cursorBlinkStateManager=void 0),this._onRequestRedraw.fire({start:this._bufferService.buffer.y,end:this._bufferService.buffer.y})},e.prototype.onCursorMove=function(){this._cursorBlinkStateManager&&this._cursorBlinkStateManager.restartBlinkAnimation()},e.prototype.onGridChanged=function(E,s){!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isPaused?this._render(!1):this._cursorBlinkStateManager.restartBlinkAnimation()},e.prototype._render=function(E){if(this._coreService.isCursorInitialized&&!this._coreService.isCursorHidden){var s=this._bufferService.buffer.ybase+this._bufferService.buffer.y,n=s-this._bufferService.buffer.ydisp;if(n<0||n>=this._bufferService.rows)this._clearCursor();else{var t=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1);if(this._bufferService.buffer.lines.get(s).loadCell(t,this._cell),this._cell.content!==void 0){if(!this._coreBrowserService.isFocused){this._clearCursor(),this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css;var r=this._optionsService.options.cursorStyle;return r&&r!=="block"?this._cursorRenderers[r](t,n,this._cell):this._renderBlurCursor(t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=r,void(this._state.width=this._cell.getWidth())}if(!this._cursorBlinkStateManager||this._cursorBlinkStateManager.isCursorVisible){if(this._state){if(this._state.x===t&&this._state.y===n&&this._state.isFocused===this._coreBrowserService.isFocused&&this._state.style===this._optionsService.options.cursorStyle&&this._state.width===this._cell.getWidth())return;this._clearCursor()}this._ctx.save(),this._cursorRenderers[this._optionsService.options.cursorStyle||"block"](t,n,this._cell),this._ctx.restore(),this._state.x=t,this._state.y=n,this._state.isFocused=!1,this._state.style=this._optionsService.options.cursorStyle,this._state.width=this._cell.getWidth()}else this._clearCursor()}}}else this._clearCursor()},e.prototype._clearCursor=function(){this._state&&(this._clearCells(this._state.x,this._state.y,this._state.width,1),this._state={x:0,y:0,isFocused:!1,style:"",width:0})},e.prototype._renderBarCursor=function(E,s,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillLeftLineAtCell(E,s,this._optionsService.options.cursorWidth),this._ctx.restore()},e.prototype._renderBlockCursor=function(E,s,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillCells(E,s,n.getWidth(),1),this._ctx.fillStyle=this._colors.cursorAccent.css,this._fillCharTrueColor(n,E,s),this._ctx.restore()},e.prototype._renderUnderlineCursor=function(E,s,n){this._ctx.save(),this._ctx.fillStyle=this._colors.cursor.css,this._fillBottomLineAtCells(E,s),this._ctx.restore()},e.prototype._renderBlurCursor=function(E,s,n){this._ctx.save(),this._ctx.strokeStyle=this._colors.cursor.css,this._strokeRectAtCell(E,s,n.getWidth(),1),this._ctx.restore()},e}(k.BaseRenderLayer);M.CursorRenderLayer=P;var T=function(){function b(e,E){this._renderCallback=E,this.isCursorVisible=!0,e&&this._restartInterval()}return Object.defineProperty(b.prototype,"isPaused",{get:function(){return!(this._blinkStartTimeout||this._blinkInterval)},enumerable:!1,configurable:!0}),b.prototype.dispose=function(){this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},b.prototype.restartBlinkAnimation=function(){var e=this;this.isPaused||(this._animationTimeRestarted=Date.now(),this.isCursorVisible=!0,this._animationFrame||(this._animationFrame=window.requestAnimationFrame(function(){e._renderCallback(),e._animationFrame=void 0})))},b.prototype._restartInterval=function(e){var E=this;e===void 0&&(e=600),this._blinkInterval&&window.clearInterval(this._blinkInterval),this._blinkStartTimeout=window.setTimeout(function(){if(E._animationTimeRestarted){var s=600-(Date.now()-E._animationTimeRestarted);if(E._animationTimeRestarted=void 0,s>0)return void E._restartInterval(s)}E.isCursorVisible=!1,E._animationFrame=window.requestAnimationFrame(function(){E._renderCallback(),E._animationFrame=void 0}),E._blinkInterval=window.setInterval(function(){if(E._animationTimeRestarted){var n=600-(Date.now()-E._animationTimeRestarted);return E._animationTimeRestarted=void 0,void E._restartInterval(n)}E.isCursorVisible=!E.isCursorVisible,E._animationFrame=window.requestAnimationFrame(function(){E._renderCallback(),E._animationFrame=void 0})},600)},e)},b.prototype.pause=function(){this.isCursorVisible=!0,this._blinkInterval&&(window.clearInterval(this._blinkInterval),this._blinkInterval=void 0),this._blinkStartTimeout&&(window.clearTimeout(this._blinkStartTimeout),this._blinkStartTimeout=void 0),this._animationFrame&&(window.cancelAnimationFrame(this._animationFrame),this._animationFrame=void 0)},b.prototype.resume=function(){this.pause(),this._animationTimeRestarted=void 0,this._restartInterval(),this.restartBlinkAnimation()},b}()},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(b,e){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(E,s){E.__proto__=s}||function(E,s){for(var n in s)s.hasOwnProperty(n)&&(E[n]=s[n])})(b,e)},function(b,e){function E(){this.constructor=b}B(b,e),b.prototype=e===null?Object.create(e):(E.prototype=e.prototype,new E)});Object.defineProperty(M,"__esModule",{value:!0}),M.LinkRenderLayer=void 0;var k=N(13),S=N(9),P=N(26),T=function(b){function e(E,s,n,t,r,i,a,v){var p=b.call(this,E,"link",s,!0,n,t,a,v)||this;return r.onShowLinkUnderline(function(l){return p._onShowLinkUnderline(l)}),r.onHideLinkUnderline(function(l){return p._onHideLinkUnderline(l)}),i.onShowLinkUnderline(function(l){return p._onShowLinkUnderline(l)}),i.onHideLinkUnderline(function(l){return p._onHideLinkUnderline(l)}),p}return U(e,b),e.prototype.resize=function(E){b.prototype.resize.call(this,E),this._state=void 0},e.prototype.reset=function(){this._clearCurrentLink()},e.prototype._clearCurrentLink=function(){if(this._state){this._clearCells(this._state.x1,this._state.y1,this._state.cols-this._state.x1,1);var E=this._state.y2-this._state.y1-1;E>0&&this._clearCells(0,this._state.y1+1,this._state.cols,E),this._clearCells(0,this._state.y2,this._state.x2,1),this._state=void 0}},e.prototype._onShowLinkUnderline=function(E){if(E.fg===S.INVERTED_DEFAULT_COLOR?this._ctx.fillStyle=this._colors.background.css:E.fg&&P.is256Color(E.fg)?this._ctx.fillStyle=this._colors.ansi[E.fg].css:this._ctx.fillStyle=this._colors.foreground.css,E.y1===E.y2)this._fillBottomLineAtCells(E.x1,E.y1,E.x2-E.x1);else{this._fillBottomLineAtCells(E.x1,E.y1,E.cols-E.x1);for(var s=E.y1+1;s<E.y2;s++)this._fillBottomLineAtCells(0,s,E.cols);this._fillBottomLineAtCells(0,E.y2,E.x2)}this._state=E},e.prototype._onHideLinkUnderline=function(E){this._clearCurrentLink()},e}(k.BaseRenderLayer);M.LinkRenderLayer=T},function(re,M,N){"use strict";var B=this&&this.__decorate||function(b,e,E,s){var n,t=arguments.length,r=t<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,E):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(b,e,E,s);else for(var i=b.length-1;i>=0;i--)(n=b[i])&&(r=(t<3?n(r):t>3?n(e,E,r):n(e,E))||r);return t>3&&r&&Object.defineProperty(e,E,r),r},U=this&&this.__param||function(b,e){return function(E,s){e(E,s,b)}};Object.defineProperty(M,"__esModule",{value:!0}),M.MouseZone=M.Linkifier=void 0;var k=N(0),S=N(1),P=function(){function b(e,E,s){this._bufferService=e,this._logService=E,this._unicodeService=s,this._linkMatchers=[],this._nextLinkMatcherId=0,this._onShowLinkUnderline=new k.EventEmitter,this._onHideLinkUnderline=new k.EventEmitter,this._onLinkTooltip=new k.EventEmitter,this._rowsToLinkify={start:void 0,end:void 0}}return Object.defineProperty(b.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onLinkTooltip",{get:function(){return this._onLinkTooltip.event},enumerable:!1,configurable:!0}),b.prototype.attachToDom=function(e,E){this._element=e,this._mouseZoneManager=E},b.prototype.linkifyRows=function(e,E){var s=this;this._mouseZoneManager&&(this._rowsToLinkify.start===void 0||this._rowsToLinkify.end===void 0?(this._rowsToLinkify.start=e,this._rowsToLinkify.end=E):(this._rowsToLinkify.start=Math.min(this._rowsToLinkify.start,e),this._rowsToLinkify.end=Math.max(this._rowsToLinkify.end,E)),this._mouseZoneManager.clearAll(e,E),this._rowsTimeoutId&&clearTimeout(this._rowsTimeoutId),this._rowsTimeoutId=setTimeout(function(){return s._linkifyRows()},b._timeBeforeLatency))},b.prototype._linkifyRows=function(){this._rowsTimeoutId=void 0;var e=this._bufferService.buffer;if(this._rowsToLinkify.start!==void 0&&this._rowsToLinkify.end!==void 0){var E=e.ydisp+this._rowsToLinkify.start;if(!(E>=e.lines.length)){for(var s=e.ydisp+Math.min(this._rowsToLinkify.end,this._bufferService.rows)+1,n=Math.ceil(2e3/this._bufferService.cols),t=this._bufferService.buffer.iterator(!1,E,s,n,n);t.hasNext();)for(var r=t.next(),i=0;i<this._linkMatchers.length;i++)this._doLinkifyRow(r.range.first,r.content,this._linkMatchers[i]);this._rowsToLinkify.start=void 0,this._rowsToLinkify.end=void 0}}else this._logService.debug("_rowToLinkify was unset before _linkifyRows was called")},b.prototype.registerLinkMatcher=function(e,E,s){if(s===void 0&&(s={}),!E)throw new Error("handler must be defined");var n={id:this._nextLinkMatcherId++,regex:e,handler:E,matchIndex:s.matchIndex,validationCallback:s.validationCallback,hoverTooltipCallback:s.tooltipCallback,hoverLeaveCallback:s.leaveCallback,willLinkActivate:s.willLinkActivate,priority:s.priority||0};return this._addLinkMatcherToList(n),n.id},b.prototype._addLinkMatcherToList=function(e){if(this._linkMatchers.length!==0){for(var E=this._linkMatchers.length-1;E>=0;E--)if(e.priority<=this._linkMatchers[E].priority)return void this._linkMatchers.splice(E+1,0,e);this._linkMatchers.splice(0,0,e)}else this._linkMatchers.push(e)},b.prototype.deregisterLinkMatcher=function(e){for(var E=0;E<this._linkMatchers.length;E++)if(this._linkMatchers[E].id===e)return this._linkMatchers.splice(E,1),!0;return!1},b.prototype._doLinkifyRow=function(e,E,s){for(var n,t=this,r=new RegExp(s.regex.source,(s.regex.flags||"")+"g"),i=-1,a=function(){var p=n[typeof s.matchIndex!="number"?0:s.matchIndex];if(!p)return v._logService.debug("match found without corresponding matchIndex",n,s),"break";if(i=E.indexOf(p,i+1),r.lastIndex=i+p.length,i<0)return"break";var l=v._bufferService.buffer.stringIndexToBufferIndex(e,i);if(l[0]<0)return"break";var o=v._bufferService.buffer.lines.get(l[0]);if(!o)return"break";var u=o.getFg(l[1]),c=u?u>>9&511:void 0;s.validationCallback?s.validationCallback(p,function(_){t._rowsTimeoutId||_&&t._addLink(l[1],l[0]-t._bufferService.buffer.ydisp,p,s,c)}):v._addLink(l[1],l[0]-v._bufferService.buffer.ydisp,p,s,c)},v=this;(n=r.exec(E))!==null&&a()!=="break";);},b.prototype._addLink=function(e,E,s,n,t){var r=this;if(this._mouseZoneManager&&this._element){var i=this._unicodeService.getStringCellWidth(s),a=e%this._bufferService.cols,v=E+Math.floor(e/this._bufferService.cols),p=(a+i)%this._bufferService.cols,l=v+Math.floor((a+i)/this._bufferService.cols);p===0&&(p=this._bufferService.cols,l--),this._mouseZoneManager.add(new T(a+1,v+1,p+1,l+1,function(o){if(n.handler)return n.handler(o,s);var u=window.open();u?(u.opener=null,u.location.href=s):console.warn("Opening link blocked as opener could not be cleared")},function(){r._onShowLinkUnderline.fire(r._createLinkHoverEvent(a,v,p,l,t)),r._element.classList.add("xterm-cursor-pointer")},function(o){r._onLinkTooltip.fire(r._createLinkHoverEvent(a,v,p,l,t)),n.hoverTooltipCallback&&n.hoverTooltipCallback(o,s,{start:{x:a,y:v},end:{x:p,y:l}})},function(){r._onHideLinkUnderline.fire(r._createLinkHoverEvent(a,v,p,l,t)),r._element.classList.remove("xterm-cursor-pointer"),n.hoverLeaveCallback&&n.hoverLeaveCallback()},function(o){return!n.willLinkActivate||n.willLinkActivate(o,s)}))}},b.prototype._createLinkHoverEvent=function(e,E,s,n,t){return{x1:e,y1:E,x2:s,y2:n,cols:this._bufferService.cols,fg:t}},b._timeBeforeLatency=200,b=B([U(0,S.IBufferService),U(1,S.ILogService),U(2,S.IUnicodeService)],b)}();M.Linkifier=P;var T=function(b,e,E,s,n,t,r,i,a){this.x1=b,this.y1=e,this.x2=E,this.y2=s,this.clickCallback=n,this.hoverCallback=t,this.tooltipCallback=r,this.leaveCallback=i,this.willLinkActivate=a};M.MouseZone=T},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(p,l){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(o,u){o.__proto__=u}||function(o,u){for(var c in u)u.hasOwnProperty(c)&&(o[c]=u[c])})(p,l)},function(p,l){function o(){this.constructor=p}B(p,l),p.prototype=l===null?Object.create(l):(o.prototype=l.prototype,new o)}),k=this&&this.__decorate||function(p,l,o,u){var c,_=arguments.length,y=_<3?l:u===null?u=Object.getOwnPropertyDescriptor(l,o):u;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")y=Reflect.decorate(p,l,o,u);else for(var f=p.length-1;f>=0;f--)(c=p[f])&&(y=(_<3?c(y):_>3?c(l,o,y):c(l,o))||y);return _>3&&y&&Object.defineProperty(l,o,y),y},S=this&&this.__param||function(p,l){return function(o,u){l(o,u,p)}};Object.defineProperty(M,"__esModule",{value:!0}),M.SelectionService=void 0;var P=N(11),T=N(52),b=N(4),e=N(0),E=N(5),s=N(1),n=N(30),t=N(53),r=N(2),i="\xA0",a=new RegExp(i,"g"),v=function(p){function l(o,u,c,_,y,f,C){var L=p.call(this)||this;return L._element=o,L._screenElement=u,L._bufferService=c,L._coreService=_,L._mouseService=y,L._optionsService=f,L._renderService=C,L._dragScrollAmount=0,L._enabled=!0,L._workCell=new b.CellData,L._mouseDownTimeStamp=0,L._onLinuxMouseSelection=L.register(new e.EventEmitter),L._onRedrawRequest=L.register(new e.EventEmitter),L._onSelectionChange=L.register(new e.EventEmitter),L._onRequestScrollLines=L.register(new e.EventEmitter),L._mouseMoveListener=function(R){return L._onMouseMove(R)},L._mouseUpListener=function(R){return L._onMouseUp(R)},L._coreService.onUserInput(function(){L.hasSelection&&L.clearSelection()}),L._trimListener=L._bufferService.buffer.lines.onTrim(function(R){return L._onTrim(R)}),L.register(L._bufferService.buffers.onBufferActivate(function(R){return L._onBufferActivate(R)})),L.enable(),L._model=new T.SelectionModel(L._bufferService),L._activeSelectionMode=0,L}return U(l,p),Object.defineProperty(l.prototype,"onLinuxMouseSelection",{get:function(){return this._onLinuxMouseSelection.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onRequestRedraw",{get:function(){return this._onRedrawRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onSelectionChange",{get:function(){return this._onSelectionChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"onRequestScrollLines",{get:function(){return this._onRequestScrollLines.event},enumerable:!1,configurable:!0}),l.prototype.dispose=function(){this._removeMouseDownListeners()},l.prototype.reset=function(){this.clearSelection()},l.prototype.disable=function(){this.clearSelection(),this._enabled=!1},l.prototype.enable=function(){this._enabled=!0},Object.defineProperty(l.prototype,"selectionStart",{get:function(){return this._model.finalSelectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"selectionEnd",{get:function(){return this._model.finalSelectionEnd},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"hasSelection",{get:function(){var o=this._model.finalSelectionStart,u=this._model.finalSelectionEnd;return!(!o||!u)&&(o[0]!==u[0]||o[1]!==u[1])},enumerable:!1,configurable:!0}),Object.defineProperty(l.prototype,"selectionText",{get:function(){var o=this._model.finalSelectionStart,u=this._model.finalSelectionEnd;if(!o||!u)return"";var c=this._bufferService.buffer,_=[];if(this._activeSelectionMode===3){if(o[0]===u[0])return"";for(var y=o[1];y<=u[1];y++){var f=c.translateBufferLineToString(y,!0,o[0],u[0]);_.push(f)}}else{var C=o[1]===u[1]?u[0]:void 0;for(_.push(c.translateBufferLineToString(o[1],!0,o[0],C)),y=o[1]+1;y<=u[1]-1;y++){var L=c.lines.get(y);f=c.translateBufferLineToString(y,!0),L&&L.isWrapped?_[_.length-1]+=f:_.push(f)}o[1]!==u[1]&&(L=c.lines.get(u[1]),f=c.translateBufferLineToString(u[1],!0,0,u[0]),L&&L.isWrapped?_[_.length-1]+=f:_.push(f))}return _.map(function(R){return R.replace(a," ")}).join(P.isWindows?`\r
`:`
`)},enumerable:!1,configurable:!0}),l.prototype.clearSelection=function(){this._model.clearSelection(),this._removeMouseDownListeners(),this.refresh(),this._onSelectionChange.fire()},l.prototype.refresh=function(o){var u=this;this._refreshAnimationFrame||(this._refreshAnimationFrame=window.requestAnimationFrame(function(){return u._refresh()})),P.isLinux&&o&&this.selectionText.length&&this._onLinuxMouseSelection.fire(this.selectionText)},l.prototype._refresh=function(){this._refreshAnimationFrame=void 0,this._onRedrawRequest.fire({start:this._model.finalSelectionStart,end:this._model.finalSelectionEnd,columnSelectMode:this._activeSelectionMode===3})},l.prototype.isClickInSelection=function(o){var u=this._getMouseBufferCoords(o),c=this._model.finalSelectionStart,_=this._model.finalSelectionEnd;return!!(c&&_&&u)&&this._areCoordsInSelection(u,c,_)},l.prototype._areCoordsInSelection=function(o,u,c){return o[1]>u[1]&&o[1]<c[1]||u[1]===c[1]&&o[1]===u[1]&&o[0]>=u[0]&&o[0]<c[0]||u[1]<c[1]&&o[1]===c[1]&&o[0]<c[0]||u[1]<c[1]&&o[1]===u[1]&&o[0]>=u[0]},l.prototype.selectWordAtCursor=function(o){var u=this._getMouseBufferCoords(o);u&&(this._selectWordAt(u,!1),this._model.selectionEnd=void 0,this.refresh(!0))},l.prototype.selectAll=function(){this._model.isSelectAllActive=!0,this.refresh(),this._onSelectionChange.fire()},l.prototype.selectLines=function(o,u){this._model.clearSelection(),o=Math.max(o,0),u=Math.min(u,this._bufferService.buffer.lines.length-1),this._model.selectionStart=[0,o],this._model.selectionEnd=[this._bufferService.cols,u],this.refresh(),this._onSelectionChange.fire()},l.prototype._onTrim=function(o){this._model.onTrim(o)&&this.refresh()},l.prototype._getMouseBufferCoords=function(o){var u=this._mouseService.getCoords(o,this._screenElement,this._bufferService.cols,this._bufferService.rows,!0);if(u)return u[0]--,u[1]--,u[1]+=this._bufferService.buffer.ydisp,u},l.prototype._getMouseEventScrollAmount=function(o){var u=n.getCoordsRelativeToElement(o,this._screenElement)[1],c=this._renderService.dimensions.canvasHeight;return u>=0&&u<=c?0:(u>c&&(u-=c),u=Math.min(Math.max(u,-50),50),(u/=50)/Math.abs(u)+Math.round(14*u))},l.prototype.shouldForceSelection=function(o){return P.isMac?o.altKey&&this._optionsService.options.macOptionClickForcesSelection:o.shiftKey},l.prototype.onMouseDown=function(o){if(this._mouseDownTimeStamp=o.timeStamp,(o.button!==2||!this.hasSelection)&&o.button===0){if(!this._enabled){if(!this.shouldForceSelection(o))return;o.stopPropagation()}o.preventDefault(),this._dragScrollAmount=0,this._enabled&&o.shiftKey?this._onIncrementalClick(o):o.detail===1?this._onSingleClick(o):o.detail===2?this._onDoubleClick(o):o.detail===3&&this._onTripleClick(o),this._addMouseDownListeners(),this.refresh(!0)}},l.prototype._addMouseDownListeners=function(){var o=this;this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.addEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.addEventListener("mouseup",this._mouseUpListener)),this._dragScrollIntervalTimer=window.setInterval(function(){return o._dragScroll()},50)},l.prototype._removeMouseDownListeners=function(){this._screenElement.ownerDocument&&(this._screenElement.ownerDocument.removeEventListener("mousemove",this._mouseMoveListener),this._screenElement.ownerDocument.removeEventListener("mouseup",this._mouseUpListener)),clearInterval(this._dragScrollIntervalTimer),this._dragScrollIntervalTimer=void 0},l.prototype._onIncrementalClick=function(o){this._model.selectionStart&&(this._model.selectionEnd=this._getMouseBufferCoords(o))},l.prototype._onSingleClick=function(o){if(this._model.selectionStartLength=0,this._model.isSelectAllActive=!1,this._activeSelectionMode=this.shouldColumnSelect(o)?3:0,this._model.selectionStart=this._getMouseBufferCoords(o),this._model.selectionStart){this._model.selectionEnd=void 0;var u=this._bufferService.buffer.lines.get(this._model.selectionStart[1]);u&&u.length!==this._model.selectionStart[0]&&u.hasWidth(this._model.selectionStart[0])===0&&this._model.selectionStart[0]++}},l.prototype._onDoubleClick=function(o){var u=this._getMouseBufferCoords(o);u&&(this._activeSelectionMode=1,this._selectWordAt(u,!0))},l.prototype._onTripleClick=function(o){var u=this._getMouseBufferCoords(o);u&&(this._activeSelectionMode=2,this._selectLineAt(u[1]))},l.prototype.shouldColumnSelect=function(o){return o.altKey&&!(P.isMac&&this._optionsService.options.macOptionClickForcesSelection)},l.prototype._onMouseMove=function(o){if(o.stopImmediatePropagation(),this._model.selectionStart){var u=this._model.selectionEnd?[this._model.selectionEnd[0],this._model.selectionEnd[1]]:null;if(this._model.selectionEnd=this._getMouseBufferCoords(o),this._model.selectionEnd){this._activeSelectionMode===2?this._model.selectionEnd[1]<this._model.selectionStart[1]?this._model.selectionEnd[0]=0:this._model.selectionEnd[0]=this._bufferService.cols:this._activeSelectionMode===1&&this._selectToWordAt(this._model.selectionEnd),this._dragScrollAmount=this._getMouseEventScrollAmount(o),this._activeSelectionMode!==3&&(this._dragScrollAmount>0?this._model.selectionEnd[0]=this._bufferService.cols:this._dragScrollAmount<0&&(this._model.selectionEnd[0]=0));var c=this._bufferService.buffer;if(this._model.selectionEnd[1]<c.lines.length){var _=c.lines.get(this._model.selectionEnd[1]);_&&_.hasWidth(this._model.selectionEnd[0])===0&&this._model.selectionEnd[0]++}u&&u[0]===this._model.selectionEnd[0]&&u[1]===this._model.selectionEnd[1]||this.refresh(!0)}else this.refresh(!0)}},l.prototype._dragScroll=function(){if(this._model.selectionEnd&&this._model.selectionStart&&this._dragScrollAmount){this._onRequestScrollLines.fire({amount:this._dragScrollAmount,suppressScrollEvent:!1});var o=this._bufferService.buffer;this._dragScrollAmount>0?(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=this._bufferService.cols),this._model.selectionEnd[1]=Math.min(o.ydisp+this._bufferService.rows,o.lines.length-1)):(this._activeSelectionMode!==3&&(this._model.selectionEnd[0]=0),this._model.selectionEnd[1]=o.ydisp),this.refresh()}},l.prototype._onMouseUp=function(o){var u=o.timeStamp-this._mouseDownTimeStamp;if(this._removeMouseDownListeners(),this.selectionText.length<=1&&u<500&&o.altKey){if(this._bufferService.buffer.ybase===this._bufferService.buffer.ydisp){var c=this._mouseService.getCoords(o,this._element,this._bufferService.cols,this._bufferService.rows,!1);if(c&&c[0]!==void 0&&c[1]!==void 0){var _=t.moveToCellSequence(c[0]-1,c[1]-1,this._bufferService,this._coreService.decPrivateModes.applicationCursorKeys);this._coreService.triggerDataEvent(_,!0)}}}else this.hasSelection&&this._onSelectionChange.fire()},l.prototype._onBufferActivate=function(o){var u=this;this.clearSelection(),this._trimListener.dispose(),this._trimListener=o.activeBuffer.lines.onTrim(function(c){return u._onTrim(c)})},l.prototype._convertViewportColToCharacterIndex=function(o,u){for(var c=u[0],_=0;u[0]>=_;_++){var y=o.loadCell(_,this._workCell).getChars().length;this._workCell.getWidth()===0?c--:y>1&&u[0]!==_&&(c+=y-1)}return c},l.prototype.setSelection=function(o,u,c){this._model.clearSelection(),this._removeMouseDownListeners(),this._model.selectionStart=[o,u],this._model.selectionStartLength=c,this.refresh()},l.prototype._getWordAt=function(o,u,c,_){if(c===void 0&&(c=!0),_===void 0&&(_=!0),!(o[0]>=this._bufferService.cols)){var y=this._bufferService.buffer,f=y.lines.get(o[1]);if(f){var C=y.translateBufferLineToString(o[1],!1),L=this._convertViewportColToCharacterIndex(f,o),R=L,O=o[0]-L,g=0,m=0,d=0,h=0;if(C.charAt(L)===" "){for(;L>0&&C.charAt(L-1)===" ";)L--;for(;R<C.length&&C.charAt(R+1)===" ";)R++}else{var A=o[0],w=o[0];f.getWidth(A)===0&&(g++,A--),f.getWidth(w)===2&&(m++,w++);var x=f.getString(w).length;for(x>1&&(h+=x-1,R+=x-1);A>0&&L>0&&!this._isCharWordSeparator(f.loadCell(A-1,this._workCell));){f.loadCell(A-1,this._workCell);var D=this._workCell.getChars().length;this._workCell.getWidth()===0?(g++,A--):D>1&&(d+=D-1,L-=D-1),L--,A--}for(;w<f.length&&R+1<C.length&&!this._isCharWordSeparator(f.loadCell(w+1,this._workCell));){f.loadCell(w+1,this._workCell);var I=this._workCell.getChars().length;this._workCell.getWidth()===2?(m++,w++):I>1&&(h+=I-1,R+=I-1),R++,w++}}R++;var F=L+O-g+d,K=Math.min(this._bufferService.cols,R-L+g+m-d-h);if(u||C.slice(L,R).trim()!==""){if(c&&F===0&&f.getCodePoint(0)!==32){var W=y.lines.get(o[1]-1);if(W&&f.isWrapped&&W.getCodePoint(this._bufferService.cols-1)!==32){var z=this._getWordAt([this._bufferService.cols-1,o[1]-1],!1,!0,!1);if(z){var j=this._bufferService.cols-z.start;F-=j,K+=j}}}if(_&&F+K===this._bufferService.cols&&f.getCodePoint(this._bufferService.cols-1)!==32){var G=y.lines.get(o[1]+1);if(G&&G.isWrapped&&G.getCodePoint(0)!==32){var Z=this._getWordAt([0,o[1]+1],!1,!1,!0);Z&&(K+=Z.length)}}return{start:F,length:K}}}}},l.prototype._selectWordAt=function(o,u){var c=this._getWordAt(o,u);if(c){for(;c.start<0;)c.start+=this._bufferService.cols,o[1]--;this._model.selectionStart=[c.start,o[1]],this._model.selectionStartLength=c.length}},l.prototype._selectToWordAt=function(o){var u=this._getWordAt(o,!0);if(u){for(var c=o[1];u.start<0;)u.start+=this._bufferService.cols,c--;if(!this._model.areSelectionValuesReversed())for(;u.start+u.length>this._bufferService.cols;)u.length-=this._bufferService.cols,c++;this._model.selectionEnd=[this._model.areSelectionValuesReversed()?u.start:u.start+u.length,c]}},l.prototype._isCharWordSeparator=function(o){return o.getWidth()!==0&&this._optionsService.options.wordSeparator.indexOf(o.getChars())>=0},l.prototype._selectLineAt=function(o){var u=this._bufferService.buffer.getWrappedRangeForLine(o);this._model.selectionStart=[0,u.first],this._model.selectionEnd=[this._bufferService.cols,u.last],this._model.selectionStartLength=0},l=k([S(2,s.IBufferService),S(3,s.ICoreService),S(4,E.IMouseService),S(5,s.IOptionsService),S(6,E.IRenderService)],l)}(r.Disposable);M.SelectionService=v},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.SelectionModel=void 0;var B=function(){function U(k){this._bufferService=k,this.isSelectAllActive=!1,this.selectionStartLength=0}return U.prototype.clearSelection=function(){this.selectionStart=void 0,this.selectionEnd=void 0,this.isSelectAllActive=!1,this.selectionStartLength=0},Object.defineProperty(U.prototype,"finalSelectionStart",{get:function(){return this.isSelectAllActive?[0,0]:this.selectionEnd&&this.selectionStart&&this.areSelectionValuesReversed()?this.selectionEnd:this.selectionStart},enumerable:!1,configurable:!0}),Object.defineProperty(U.prototype,"finalSelectionEnd",{get:function(){if(this.isSelectAllActive)return[this._bufferService.cols,this._bufferService.buffer.ybase+this._bufferService.rows-1];if(this.selectionStart){if(!this.selectionEnd||this.areSelectionValuesReversed()){var k=this.selectionStart[0]+this.selectionStartLength;return k>this._bufferService.cols?[k%this._bufferService.cols,this.selectionStart[1]+Math.floor(k/this._bufferService.cols)]:[k,this.selectionStart[1]]}return this.selectionStartLength&&this.selectionEnd[1]===this.selectionStart[1]?[Math.max(this.selectionStart[0]+this.selectionStartLength,this.selectionEnd[0]),this.selectionEnd[1]]:this.selectionEnd}},enumerable:!1,configurable:!0}),U.prototype.areSelectionValuesReversed=function(){var k=this.selectionStart,S=this.selectionEnd;return!(!k||!S)&&(k[1]>S[1]||k[1]===S[1]&&k[0]>S[0])},U.prototype.onTrim=function(k){return this.selectionStart&&(this.selectionStart[1]-=k),this.selectionEnd&&(this.selectionEnd[1]-=k),this.selectionEnd&&this.selectionEnd[1]<0?(this.clearSelection(),!0):(this.selectionStart&&this.selectionStart[1]<0&&(this.selectionStart[1]=0),!1)},U}();M.SelectionModel=B},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.moveToCellSequence=void 0;var B=N(12);function U(e,E,s,n){var t=e-k(s,e),r=E-k(s,E);return b(Math.abs(t-r)-function(i,a,v){for(var p=0,l=i-k(v,i),o=a-k(v,a),u=0;u<Math.abs(l-o);u++){var c=S(i,a)==="A"?-1:1,_=v.buffer.lines.get(l+c*u);_&&_.isWrapped&&p++}return p}(e,E,s),T(S(e,E),n))}function k(e,E){for(var s=0,n=e.buffer.lines.get(E),t=n&&n.isWrapped;t&&E>=0&&E<e.rows;)s++,t=(n=e.buffer.lines.get(--E))&&n.isWrapped;return s}function S(e,E){return e>E?"A":"B"}function P(e,E,s,n,t,r){for(var i=e,a=E,v="";i!==s||a!==n;)i+=t?1:-1,t&&i>r.cols-1?(v+=r.buffer.translateBufferLineToString(a,!1,e,i),i=0,e=0,a++):!t&&i<0&&(v+=r.buffer.translateBufferLineToString(a,!1,0,e+1),e=i=r.cols-1,a--);return v+r.buffer.translateBufferLineToString(a,!1,e,i)}function T(e,E){var s=E?"O":"[";return B.C0.ESC+s+e}function b(e,E){e=Math.floor(e);for(var s="",n=0;n<e;n++)s+=E;return s}M.moveToCellSequence=function(e,E,s,n){var t,r=s.buffer.x,i=s.buffer.y;if(!s.buffer.hasScrollback)return function(v,p,l,o,u,c){return U(p,o,u,c).length===0?"":b(P(v,p,v,p-k(u,p),!1,u).length,T("D",c))}(r,i,0,E,s,n)+U(i,E,s,n)+function(v,p,l,o,u,c){var _;_=U(p,o,u,c).length>0?o-k(u,o):p;var y=o,f=function(C,L,R,O,g,m){var d;return d=U(R,O,g,m).length>0?O-k(g,O):L,C<R&&d<=O||C>=R&&d<O?"C":"D"}(v,p,l,o,u,c);return b(P(v,_,l,y,f==="C",u).length,T(f,c))}(r,i,e,E,s,n);if(i===E)return t=r>e?"D":"C",b(Math.abs(r-e),T(t,n));t=i>E?"D":"C";var a=Math.abs(i-E);return b(function(v,p){return p.cols-v}(i>E?e:r,s)+(a-1)*s.cols+1+((i>E?r:e)-1),T(t,n))}},function(re,M,N){"use strict";var B=this&&this.__decorate||function(P,T,b,e){var E,s=arguments.length,n=s<3?T:e===null?e=Object.getOwnPropertyDescriptor(T,b):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(P,T,b,e);else for(var t=P.length-1;t>=0;t--)(E=P[t])&&(n=(s<3?E(n):s>3?E(T,b,n):E(T,b))||n);return s>3&&n&&Object.defineProperty(T,b,n),n},U=this&&this.__param||function(P,T){return function(b,e){T(b,e,P)}};Object.defineProperty(M,"__esModule",{value:!0}),M.SoundService=void 0;var k=N(1),S=function(){function P(T){this._optionsService=T}return Object.defineProperty(P,"audioContext",{get:function(){if(!P._audioContext){var T=window.AudioContext||window.webkitAudioContext;if(!T)return console.warn("Web Audio API is not supported by this browser. Consider upgrading to the latest version"),null;P._audioContext=new T}return P._audioContext},enumerable:!1,configurable:!0}),P.prototype.playBellSound=function(){var T=P.audioContext;if(T){var b=T.createBufferSource();T.decodeAudioData(this._base64ToArrayBuffer(this._removeMimeType(this._optionsService.options.bellSound)),function(e){b.buffer=e,b.connect(T.destination),b.start(0)})}},P.prototype._base64ToArrayBuffer=function(T){for(var b=window.atob(T),e=b.length,E=new Uint8Array(e),s=0;s<e;s++)E[s]=b.charCodeAt(s);return E.buffer},P.prototype._removeMimeType=function(T){return T.split(",")[1]},P=B([U(0,k.IOptionsService)],P)}();M.SoundService=S},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(s,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(s,n)},function(s,n){function t(){this.constructor=s}B(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),k=this&&this.__decorate||function(s,n,t,r){var i,a=arguments.length,v=a<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,n,t,r);else for(var p=s.length-1;p>=0;p--)(i=s[p])&&(v=(a<3?i(v):a>3?i(n,t,v):i(n,t))||v);return a>3&&v&&Object.defineProperty(n,t,v),v},S=this&&this.__param||function(s,n){return function(t,r){n(t,r,s)}};Object.defineProperty(M,"__esModule",{value:!0}),M.MouseZoneManager=void 0;var P=N(2),T=N(7),b=N(5),e=N(1),E=function(s){function n(t,r,i,a,v,p){var l=s.call(this)||this;return l._element=t,l._screenElement=r,l._bufferService=i,l._mouseService=a,l._selectionService=v,l._optionsService=p,l._zones=[],l._areZonesActive=!1,l._lastHoverCoords=[void 0,void 0],l._initialSelectionLength=0,l.register(T.addDisposableDomListener(l._element,"mousedown",function(o){return l._onMouseDown(o)})),l._mouseMoveListener=function(o){return l._onMouseMove(o)},l._mouseLeaveListener=function(o){return l._onMouseLeave(o)},l._clickListener=function(o){return l._onClick(o)},l}return U(n,s),n.prototype.dispose=function(){s.prototype.dispose.call(this),this._deactivate()},n.prototype.add=function(t){this._zones.push(t),this._zones.length===1&&this._activate()},n.prototype.clearAll=function(t,r){if(this._zones.length!==0){t&&r||(t=0,r=this._bufferService.rows-1);for(var i=0;i<this._zones.length;i++){var a=this._zones[i];(a.y1>t&&a.y1<=r+1||a.y2>t&&a.y2<=r+1||a.y1<t&&a.y2>r+1)&&(this._currentZone&&this._currentZone===a&&(this._currentZone.leaveCallback(),this._currentZone=void 0),this._zones.splice(i--,1))}this._zones.length===0&&this._deactivate()}},n.prototype._activate=function(){this._areZonesActive||(this._areZonesActive=!0,this._element.addEventListener("mousemove",this._mouseMoveListener),this._element.addEventListener("mouseleave",this._mouseLeaveListener),this._element.addEventListener("click",this._clickListener))},n.prototype._deactivate=function(){this._areZonesActive&&(this._areZonesActive=!1,this._element.removeEventListener("mousemove",this._mouseMoveListener),this._element.removeEventListener("mouseleave",this._mouseLeaveListener),this._element.removeEventListener("click",this._clickListener))},n.prototype._onMouseMove=function(t){this._lastHoverCoords[0]===t.pageX&&this._lastHoverCoords[1]===t.pageY||(this._onHover(t),this._lastHoverCoords=[t.pageX,t.pageY])},n.prototype._onHover=function(t){var r=this,i=this._findZoneEventAt(t);i!==this._currentZone&&(this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout)),i&&(this._currentZone=i,i.hoverCallback&&i.hoverCallback(t),this._tooltipTimeout=window.setTimeout(function(){return r._onTooltip(t)},this._optionsService.options.linkTooltipHoverDuration)))},n.prototype._onTooltip=function(t){this._tooltipTimeout=void 0;var r=this._findZoneEventAt(t);r&&r.tooltipCallback&&r.tooltipCallback(t)},n.prototype._onMouseDown=function(t){if(this._initialSelectionLength=this._getSelectionLength(),this._areZonesActive){var r=this._findZoneEventAt(t);r!=null&&r.willLinkActivate(t)&&(t.preventDefault(),t.stopImmediatePropagation())}},n.prototype._onMouseLeave=function(t){this._currentZone&&(this._currentZone.leaveCallback(),this._currentZone=void 0,this._tooltipTimeout&&clearTimeout(this._tooltipTimeout))},n.prototype._onClick=function(t){var r=this._findZoneEventAt(t),i=this._getSelectionLength();r&&i===this._initialSelectionLength&&(r.clickCallback(t),t.preventDefault(),t.stopImmediatePropagation())},n.prototype._getSelectionLength=function(){var t=this._selectionService.selectionText;return t?t.length:0},n.prototype._findZoneEventAt=function(t){var r=this._mouseService.getCoords(t,this._screenElement,this._bufferService.cols,this._bufferService.rows);if(r)for(var i=r[0],a=r[1],v=0;v<this._zones.length;v++){var p=this._zones[v];if(p.y1===p.y2){if(a===p.y1&&i>=p.x1&&i<p.x2)return p}else if(a===p.y1&&i>=p.x1||a===p.y2&&i<p.x2||a>p.y1&&a<p.y2)return p}},n=k([S(2,e.IBufferService),S(3,b.IMouseService),S(4,b.ISelectionService),S(5,e.IOptionsService)],n)}(P.Disposable);M.MouseZoneManager=E},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(n,t){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(r,i){r.__proto__=i}||function(r,i){for(var a in i)i.hasOwnProperty(a)&&(r[a]=i[a])})(n,t)},function(n,t){function r(){this.constructor=n}B(n,t),n.prototype=t===null?Object.create(t):(r.prototype=t.prototype,new r)});Object.defineProperty(M,"__esModule",{value:!0}),M.AccessibilityManager=void 0;var k=N(18),S=N(11),P=N(31),T=N(7),b=N(2),e=N(32),E=N(17),s=function(n){function t(r,i){var a=n.call(this)||this;a._terminal=r,a._renderService=i,a._liveRegionLineCount=0,a._charsToConsume=[],a._charsToAnnounce="",a._accessibilityTreeRoot=document.createElement("div"),a._accessibilityTreeRoot.classList.add("xterm-accessibility"),a._rowContainer=document.createElement("div"),a._rowContainer.classList.add("xterm-accessibility-tree"),a._rowContainer.setAttribute("role","list"),a._rowElements=[];for(var v=0;v<a._terminal.rows;v++)a._rowElements[v]=a._createAccessibilityTreeNode(),a._rowContainer.appendChild(a._rowElements[v]);if(a._topBoundaryFocusListener=function(p){return a._onBoundaryFocus(p,0)},a._bottomBoundaryFocusListener=function(p){return a._onBoundaryFocus(p,1)},a._rowElements[0].addEventListener("focus",a._topBoundaryFocusListener),a._rowElements[a._rowElements.length-1].addEventListener("focus",a._bottomBoundaryFocusListener),a._refreshRowsDimensions(),a._accessibilityTreeRoot.appendChild(a._rowContainer),a._renderRowsDebouncer=new P.RenderDebouncer(a._renderRows.bind(a)),a._refreshRows(),a._liveRegion=document.createElement("div"),a._liveRegion.classList.add("live-region"),a._liveRegion.setAttribute("aria-live","assertive"),a._accessibilityTreeRoot.appendChild(a._liveRegion),!a._terminal.element)throw new Error("Cannot enable accessibility before Terminal.open");return a._terminal.element.insertAdjacentElement("afterbegin",a._accessibilityTreeRoot),a.register(a._renderRowsDebouncer),a.register(a._terminal.onResize(function(p){return a._onResize(p.rows)})),a.register(a._terminal.onRender(function(p){return a._refreshRows(p.start,p.end)})),a.register(a._terminal.onScroll(function(){return a._refreshRows()})),a.register(a._terminal.onA11yChar(function(p){return a._onChar(p)})),a.register(a._terminal.onLineFeed(function(){return a._onChar(`
`)})),a.register(a._terminal.onA11yTab(function(p){return a._onTab(p)})),a.register(a._terminal.onKey(function(p){return a._onKey(p.key)})),a.register(a._terminal.onBlur(function(){return a._clearLiveRegion()})),a.register(a._renderService.onDimensionsChange(function(){return a._refreshRowsDimensions()})),a._screenDprMonitor=new e.ScreenDprMonitor,a.register(a._screenDprMonitor),a._screenDprMonitor.setListener(function(){return a._refreshRowsDimensions()}),a.register(T.addDisposableDomListener(window,"resize",function(){return a._refreshRowsDimensions()})),a}return U(t,n),t.prototype.dispose=function(){n.prototype.dispose.call(this),E.removeElementFromParent(this._accessibilityTreeRoot),this._rowElements.length=0},t.prototype._onBoundaryFocus=function(r,i){var a=r.target,v=this._rowElements[i===0?1:this._rowElements.length-2];if(a.getAttribute("aria-posinset")!==(i===0?"1":""+this._terminal.buffer.lines.length)&&r.relatedTarget===v){var p,l;if(i===0?(p=a,l=this._rowElements.pop(),this._rowContainer.removeChild(l)):(p=this._rowElements.shift(),l=a,this._rowContainer.removeChild(p)),p.removeEventListener("focus",this._topBoundaryFocusListener),l.removeEventListener("focus",this._bottomBoundaryFocusListener),i===0){var o=this._createAccessibilityTreeNode();this._rowElements.unshift(o),this._rowContainer.insertAdjacentElement("afterbegin",o)}else o=this._createAccessibilityTreeNode(),this._rowElements.push(o),this._rowContainer.appendChild(o);this._rowElements[0].addEventListener("focus",this._topBoundaryFocusListener),this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._terminal.scrollLines(i===0?-1:1),this._rowElements[i===0?1:this._rowElements.length-2].focus(),r.preventDefault(),r.stopImmediatePropagation()}},t.prototype._onResize=function(r){this._rowElements[this._rowElements.length-1].removeEventListener("focus",this._bottomBoundaryFocusListener);for(var i=this._rowContainer.children.length;i<this._terminal.rows;i++)this._rowElements[i]=this._createAccessibilityTreeNode(),this._rowContainer.appendChild(this._rowElements[i]);for(;this._rowElements.length>r;)this._rowContainer.removeChild(this._rowElements.pop());this._rowElements[this._rowElements.length-1].addEventListener("focus",this._bottomBoundaryFocusListener),this._refreshRowsDimensions()},t.prototype._createAccessibilityTreeNode=function(){var r=document.createElement("div");return r.setAttribute("role","listitem"),r.tabIndex=-1,this._refreshRowDimensions(r),r},t.prototype._onTab=function(r){for(var i=0;i<r;i++)this._onChar(" ")},t.prototype._onChar=function(r){var i=this;this._liveRegionLineCount<21&&(this._charsToConsume.length>0?this._charsToConsume.shift()!==r&&(this._charsToAnnounce+=r):this._charsToAnnounce+=r,r===`
`&&(this._liveRegionLineCount++,this._liveRegionLineCount===21&&(this._liveRegion.textContent+=k.tooMuchOutput)),S.isMac&&this._liveRegion.textContent&&this._liveRegion.textContent.length>0&&!this._liveRegion.parentNode&&setTimeout(function(){i._accessibilityTreeRoot.appendChild(i._liveRegion)},0))},t.prototype._clearLiveRegion=function(){this._liveRegion.textContent="",this._liveRegionLineCount=0,S.isMac&&E.removeElementFromParent(this._liveRegion)},t.prototype._onKey=function(r){this._clearLiveRegion(),this._charsToConsume.push(r)},t.prototype._refreshRows=function(r,i){this._renderRowsDebouncer.refresh(r,i,this._terminal.rows)},t.prototype._renderRows=function(r,i){for(var a=this._terminal.buffer,v=a.lines.length.toString(),p=r;p<=i;p++){var l=a.translateBufferLineToString(a.ydisp+p,!0),o=(a.ydisp+p+1).toString(),u=this._rowElements[p];u&&(l.length===0?u.innerHTML="&nbsp;":u.textContent=l,u.setAttribute("aria-posinset",o),u.setAttribute("aria-setsize",v))}this._announceCharacters()},t.prototype._refreshRowsDimensions=function(){if(this._renderService.dimensions.actualCellHeight){this._rowElements.length!==this._terminal.rows&&this._onResize(this._terminal.rows);for(var r=0;r<this._terminal.rows;r++)this._refreshRowDimensions(this._rowElements[r])}},t.prototype._refreshRowDimensions=function(r){r.style.height=this._renderService.dimensions.actualCellHeight+"px"},t.prototype._announceCharacters=function(){this._charsToAnnounce.length!==0&&(this._liveRegion.textContent+=this._charsToAnnounce,this._charsToAnnounce="")},t}(b.Disposable);M.AccessibilityManager=s},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(a,v){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(p,l){p.__proto__=l}||function(p,l){for(var o in l)l.hasOwnProperty(o)&&(p[o]=l[o])})(a,v)},function(a,v){function p(){this.constructor=a}B(a,v),a.prototype=v===null?Object.create(v):(p.prototype=v.prototype,new p)}),k=this&&this.__decorate||function(a,v,p,l){var o,u=arguments.length,c=u<3?v:l===null?l=Object.getOwnPropertyDescriptor(v,p):l;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")c=Reflect.decorate(a,v,p,l);else for(var _=a.length-1;_>=0;_--)(o=a[_])&&(c=(u<3?o(c):u>3?o(v,p,c):o(v,p))||c);return u>3&&c&&Object.defineProperty(v,p,c),c},S=this&&this.__param||function(a,v){return function(p,l){v(p,l,a)}};Object.defineProperty(M,"__esModule",{value:!0}),M.DomRenderer=void 0;var P=N(58),T=N(9),b=N(2),e=N(5),E=N(1),s=N(0),n=N(10),t=N(17),r=1,i=function(a){function v(p,l,o,u,c,_,y,f,C){var L=a.call(this)||this;return L._colors=p,L._element=l,L._screenElement=o,L._viewportElement=u,L._linkifier=c,L._linkifier2=_,L._charSizeService=y,L._optionsService=f,L._bufferService=C,L._terminalClass=r++,L._rowElements=[],L._rowContainer=document.createElement("div"),L._rowContainer.classList.add("xterm-rows"),L._rowContainer.style.lineHeight="normal",L._rowContainer.setAttribute("aria-hidden","true"),L._refreshRowElements(L._bufferService.cols,L._bufferService.rows),L._selectionContainer=document.createElement("div"),L._selectionContainer.classList.add("xterm-selection"),L._selectionContainer.setAttribute("aria-hidden","true"),L.dimensions={scaledCharWidth:0,scaledCharHeight:0,scaledCellWidth:0,scaledCellHeight:0,scaledCharLeft:0,scaledCharTop:0,scaledCanvasWidth:0,scaledCanvasHeight:0,canvasWidth:0,canvasHeight:0,actualCellWidth:0,actualCellHeight:0},L._updateDimensions(),L._injectCss(),L._rowFactory=new P.DomRendererRowFactory(document,L._optionsService,L._colors),L._element.classList.add("xterm-dom-renderer-owner-"+L._terminalClass),L._screenElement.appendChild(L._rowContainer),L._screenElement.appendChild(L._selectionContainer),L._linkifier.onShowLinkUnderline(function(R){return L._onLinkHover(R)}),L._linkifier.onHideLinkUnderline(function(R){return L._onLinkLeave(R)}),L._linkifier2.onShowLinkUnderline(function(R){return L._onLinkHover(R)}),L._linkifier2.onHideLinkUnderline(function(R){return L._onLinkLeave(R)}),L}return U(v,a),Object.defineProperty(v.prototype,"onRequestRedraw",{get:function(){return new s.EventEmitter().event},enumerable:!1,configurable:!0}),v.prototype.dispose=function(){this._element.classList.remove("xterm-dom-renderer-owner-"+this._terminalClass),t.removeElementFromParent(this._rowContainer,this._selectionContainer,this._themeStyleElement,this._dimensionsStyleElement),a.prototype.dispose.call(this)},v.prototype._updateDimensions=function(){this.dimensions.scaledCharWidth=this._charSizeService.width*window.devicePixelRatio,this.dimensions.scaledCharHeight=Math.ceil(this._charSizeService.height*window.devicePixelRatio),this.dimensions.scaledCellWidth=this.dimensions.scaledCharWidth+Math.round(this._optionsService.options.letterSpacing),this.dimensions.scaledCellHeight=Math.floor(this.dimensions.scaledCharHeight*this._optionsService.options.lineHeight),this.dimensions.scaledCharLeft=0,this.dimensions.scaledCharTop=0,this.dimensions.scaledCanvasWidth=this.dimensions.scaledCellWidth*this._bufferService.cols,this.dimensions.scaledCanvasHeight=this.dimensions.scaledCellHeight*this._bufferService.rows,this.dimensions.canvasWidth=Math.round(this.dimensions.scaledCanvasWidth/window.devicePixelRatio),this.dimensions.canvasHeight=Math.round(this.dimensions.scaledCanvasHeight/window.devicePixelRatio),this.dimensions.actualCellWidth=this.dimensions.canvasWidth/this._bufferService.cols,this.dimensions.actualCellHeight=this.dimensions.canvasHeight/this._bufferService.rows;for(var p=0,l=this._rowElements;p<l.length;p++){var o=l[p];o.style.width=this.dimensions.canvasWidth+"px",o.style.height=this.dimensions.actualCellHeight+"px",o.style.lineHeight=this.dimensions.actualCellHeight+"px",o.style.overflow="hidden"}this._dimensionsStyleElement||(this._dimensionsStyleElement=document.createElement("style"),this._screenElement.appendChild(this._dimensionsStyleElement));var u=this._terminalSelector+" .xterm-rows span { display: inline-block; height: 100%; vertical-align: top; width: "+this.dimensions.actualCellWidth+"px}";this._dimensionsStyleElement.innerHTML=u,this._selectionContainer.style.height=this._viewportElement.style.height,this._screenElement.style.width=this.dimensions.canvasWidth+"px",this._screenElement.style.height=this.dimensions.canvasHeight+"px"},v.prototype.setColors=function(p){this._colors=p,this._injectCss()},v.prototype._injectCss=function(){var p=this;this._themeStyleElement||(this._themeStyleElement=document.createElement("style"),this._screenElement.appendChild(this._themeStyleElement));var l=this._terminalSelector+" .xterm-rows { color: "+this._colors.foreground.css+"; font-family: "+this._optionsService.options.fontFamily+"; font-size: "+this._optionsService.options.fontSize+"px;}";l+=this._terminalSelector+" span:not(."+P.BOLD_CLASS+") { font-weight: "+this._optionsService.options.fontWeight+";}"+this._terminalSelector+" span."+P.BOLD_CLASS+" { font-weight: "+this._optionsService.options.fontWeightBold+";}"+this._terminalSelector+" span."+P.ITALIC_CLASS+" { font-style: italic;}",l+="@keyframes blink_box_shadow_"+this._terminalClass+" { 50% { box-shadow: none; }}",l+="@keyframes blink_block_"+this._terminalClass+" { 0% { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+"; } 50% { background-color: "+this._colors.cursorAccent.css+"; color: "+this._colors.cursor.css+"; }}",l+=this._terminalSelector+" .xterm-rows:not(.xterm-focus) ."+P.CURSOR_CLASS+"."+P.CURSOR_STYLE_BLOCK_CLASS+" { outline: 1px solid "+this._colors.cursor.css+"; outline-offset: -1px;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+P.CURSOR_CLASS+"."+P.CURSOR_BLINK_CLASS+":not(."+P.CURSOR_STYLE_BLOCK_CLASS+") { animation: blink_box_shadow_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+P.CURSOR_CLASS+"."+P.CURSOR_BLINK_CLASS+"."+P.CURSOR_STYLE_BLOCK_CLASS+" { animation: blink_block_"+this._terminalClass+" 1s step-end infinite;}"+this._terminalSelector+" .xterm-rows.xterm-focus ."+P.CURSOR_CLASS+"."+P.CURSOR_STYLE_BLOCK_CLASS+" { background-color: "+this._colors.cursor.css+"; color: "+this._colors.cursorAccent.css+";}"+this._terminalSelector+" .xterm-rows ."+P.CURSOR_CLASS+"."+P.CURSOR_STYLE_BAR_CLASS+" { box-shadow: "+this._optionsService.options.cursorWidth+"px 0 0 "+this._colors.cursor.css+" inset;}"+this._terminalSelector+" .xterm-rows ."+P.CURSOR_CLASS+"."+P.CURSOR_STYLE_UNDERLINE_CLASS+" { box-shadow: 0 -1px 0 "+this._colors.cursor.css+" inset;}",l+=this._terminalSelector+" .xterm-selection { position: absolute; top: 0; left: 0; z-index: 1; pointer-events: none;}"+this._terminalSelector+" .xterm-selection div { position: absolute; background-color: "+this._colors.selectionTransparent.css+";}",this._colors.ansi.forEach(function(o,u){l+=p._terminalSelector+" .xterm-fg-"+u+" { color: "+o.css+"; }"+p._terminalSelector+" .xterm-bg-"+u+" { background-color: "+o.css+"; }"}),l+=this._terminalSelector+" .xterm-fg-"+T.INVERTED_DEFAULT_COLOR+" { color: "+n.color.opaque(this._colors.background).css+"; }"+this._terminalSelector+" .xterm-bg-"+T.INVERTED_DEFAULT_COLOR+" { background-color: "+this._colors.foreground.css+"; }",this._themeStyleElement.innerHTML=l},v.prototype.onDevicePixelRatioChange=function(){this._updateDimensions()},v.prototype._refreshRowElements=function(p,l){for(var o=this._rowElements.length;o<=l;o++){var u=document.createElement("div");this._rowContainer.appendChild(u),this._rowElements.push(u)}for(;this._rowElements.length>l;)this._rowContainer.removeChild(this._rowElements.pop())},v.prototype.onResize=function(p,l){this._refreshRowElements(p,l),this._updateDimensions()},v.prototype.onCharSizeChanged=function(){this._updateDimensions()},v.prototype.onBlur=function(){this._rowContainer.classList.remove("xterm-focus")},v.prototype.onFocus=function(){this._rowContainer.classList.add("xterm-focus")},v.prototype.onSelectionChanged=function(p,l,o){for(;this._selectionContainer.children.length;)this._selectionContainer.removeChild(this._selectionContainer.children[0]);if(p&&l){var u=p[1]-this._bufferService.buffer.ydisp,c=l[1]-this._bufferService.buffer.ydisp,_=Math.max(u,0),y=Math.min(c,this._bufferService.rows-1);if(!(_>=this._bufferService.rows||y<0)){var f=document.createDocumentFragment();if(o)f.appendChild(this._createSelectionElement(_,p[0],l[0],y-_+1));else{var C=u===_?p[0]:0,L=_===y?l[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(_,C,L));var R=y-_-1;if(f.appendChild(this._createSelectionElement(_+1,0,this._bufferService.cols,R)),_!==y){var O=c===y?l[0]:this._bufferService.cols;f.appendChild(this._createSelectionElement(y,0,O))}}this._selectionContainer.appendChild(f)}}},v.prototype._createSelectionElement=function(p,l,o,u){u===void 0&&(u=1);var c=document.createElement("div");return c.style.height=u*this.dimensions.actualCellHeight+"px",c.style.top=p*this.dimensions.actualCellHeight+"px",c.style.left=l*this.dimensions.actualCellWidth+"px",c.style.width=this.dimensions.actualCellWidth*(o-l)+"px",c},v.prototype.onCursorMove=function(){},v.prototype.onOptionsChanged=function(){this._updateDimensions(),this._injectCss()},v.prototype.clear=function(){for(var p=0,l=this._rowElements;p<l.length;p++)l[p].innerHTML=""},v.prototype.renderRows=function(p,l){for(var o=this._bufferService.buffer.ybase+this._bufferService.buffer.y,u=Math.min(this._bufferService.buffer.x,this._bufferService.cols-1),c=this._optionsService.options.cursorBlink,_=p;_<=l;_++){var y=this._rowElements[_];y.innerHTML="";var f=_+this._bufferService.buffer.ydisp,C=this._bufferService.buffer.lines.get(f),L=this._optionsService.options.cursorStyle;y.appendChild(this._rowFactory.createRow(C,f===o,L,u,c,this.dimensions.actualCellWidth,this._bufferService.cols))}},Object.defineProperty(v.prototype,"_terminalSelector",{get:function(){return".xterm-dom-renderer-owner-"+this._terminalClass},enumerable:!1,configurable:!0}),v.prototype.registerCharacterJoiner=function(p){return-1},v.prototype.deregisterCharacterJoiner=function(p){return!1},v.prototype._onLinkHover=function(p){this._setCellUnderline(p.x1,p.x2,p.y1,p.y2,p.cols,!0)},v.prototype._onLinkLeave=function(p){this._setCellUnderline(p.x1,p.x2,p.y1,p.y2,p.cols,!1)},v.prototype._setCellUnderline=function(p,l,o,u,c,_){for(;p!==l||o!==u;){var y=this._rowElements[o];if(!y)return;var f=y.children[p];f&&(f.style.textDecoration=_?"underline":"none"),++p>=c&&(p=0,o++)}},v=k([S(6,e.ICharSizeService),S(7,E.IOptionsService),S(8,E.IBufferService)],v)}(b.Disposable);M.DomRenderer=i},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.DomRendererRowFactory=M.CURSOR_STYLE_UNDERLINE_CLASS=M.CURSOR_STYLE_BAR_CLASS=M.CURSOR_STYLE_BLOCK_CLASS=M.CURSOR_BLINK_CLASS=M.CURSOR_CLASS=M.UNDERLINE_CLASS=M.ITALIC_CLASS=M.DIM_CLASS=M.BOLD_CLASS=void 0;var B=N(9),U=N(3),k=N(4),S=N(10);M.BOLD_CLASS="xterm-bold",M.DIM_CLASS="xterm-dim",M.ITALIC_CLASS="xterm-italic",M.UNDERLINE_CLASS="xterm-underline",M.CURSOR_CLASS="xterm-cursor",M.CURSOR_BLINK_CLASS="xterm-cursor-blink",M.CURSOR_STYLE_BLOCK_CLASS="xterm-cursor-block",M.CURSOR_STYLE_BAR_CLASS="xterm-cursor-bar",M.CURSOR_STYLE_UNDERLINE_CLASS="xterm-cursor-underline";var P=function(){function b(e,E,s){this._document=e,this._optionsService=E,this._colors=s,this._workCell=new k.CellData}return b.prototype.setColors=function(e){this._colors=e},b.prototype.createRow=function(e,E,s,n,t,r,i){for(var a=this._document.createDocumentFragment(),v=0,p=Math.min(e.length,i)-1;p>=0;p--)if(e.loadCell(p,this._workCell).getCode()!==U.NULL_CELL_CODE||E&&p===n){v=p+1;break}for(p=0;p<v;p++){e.loadCell(p,this._workCell);var l=this._workCell.getWidth();if(l!==0){var o=this._document.createElement("span");if(l>1&&(o.style.width=r*l+"px"),E&&p===n)switch(o.classList.add(M.CURSOR_CLASS),t&&o.classList.add(M.CURSOR_BLINK_CLASS),s){case"bar":o.classList.add(M.CURSOR_STYLE_BAR_CLASS);break;case"underline":o.classList.add(M.CURSOR_STYLE_UNDERLINE_CLASS);break;default:o.classList.add(M.CURSOR_STYLE_BLOCK_CLASS)}this._workCell.isBold()&&o.classList.add(M.BOLD_CLASS),this._workCell.isItalic()&&o.classList.add(M.ITALIC_CLASS),this._workCell.isDim()&&o.classList.add(M.DIM_CLASS),this._workCell.isUnderline()&&o.classList.add(M.UNDERLINE_CLASS),this._workCell.isInvisible()?o.textContent=U.WHITESPACE_CELL_CHAR:o.textContent=this._workCell.getChars()||U.WHITESPACE_CELL_CHAR;var u=this._workCell.getFgColor(),c=this._workCell.getFgColorMode(),_=this._workCell.getBgColor(),y=this._workCell.getBgColorMode(),f=!!this._workCell.isInverse();if(f){var C=u;u=_,_=C;var L=c;c=y,y=L}switch(c){case 16777216:case 33554432:this._workCell.isBold()&&u<8&&this._optionsService.options.drawBoldTextInBrightColors&&(u+=8),this._applyMinimumContrast(o,this._colors.background,this._colors.ansi[u])||o.classList.add("xterm-fg-"+u);break;case 50331648:var R=S.rgba.toColor(u>>16&255,u>>8&255,255&u);this._applyMinimumContrast(o,this._colors.background,R)||this._addStyle(o,"color:#"+T(u.toString(16),"0",6));break;case 0:default:this._applyMinimumContrast(o,this._colors.background,this._colors.foreground)||f&&o.classList.add("xterm-fg-"+B.INVERTED_DEFAULT_COLOR)}switch(y){case 16777216:case 33554432:o.classList.add("xterm-bg-"+_);break;case 50331648:this._addStyle(o,"background-color:#"+T(_.toString(16),"0",6));break;case 0:default:f&&o.classList.add("xterm-bg-"+B.INVERTED_DEFAULT_COLOR)}a.appendChild(o)}}return a},b.prototype._applyMinimumContrast=function(e,E,s){if(this._optionsService.options.minimumContrastRatio===1)return!1;var n=this._colors.contrastCache.getColor(this._workCell.bg,this._workCell.fg);return n===void 0&&(n=S.color.ensureContrastRatio(E,s,this._optionsService.options.minimumContrastRatio),this._colors.contrastCache.setColor(this._workCell.bg,this._workCell.fg,n!=null?n:null)),!!n&&(this._addStyle(e,"color:"+n.css),!0)},b.prototype._addStyle=function(e,E){e.setAttribute("style",""+(e.getAttribute("style")||"")+E+";")},b}();function T(b,e,E){for(;b.length<E;)b=e+b;return b}M.DomRendererRowFactory=P},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.evaluateKeyboardEvent=void 0;var B=N(12),U={48:["0",")"],49:["1","!"],50:["2","@"],51:["3","#"],52:["4","$"],53:["5","%"],54:["6","^"],55:["7","&"],56:["8","*"],57:["9","("],186:[";",":"],187:["=","+"],188:[",","<"],189:["-","_"],190:[".",">"],191:["/","?"],192:["`","~"],219:["[","{"],220:["\\","|"],221:["]","}"],222:["'",'"']};M.evaluateKeyboardEvent=function(k,S,P,T){var b={type:0,cancel:!1,key:void 0},e=(k.shiftKey?1:0)|(k.altKey?2:0)|(k.ctrlKey?4:0)|(k.metaKey?8:0);switch(k.keyCode){case 0:k.key==="UIKeyInputUpArrow"?b.key=S?B.C0.ESC+"OA":B.C0.ESC+"[A":k.key==="UIKeyInputLeftArrow"?b.key=S?B.C0.ESC+"OD":B.C0.ESC+"[D":k.key==="UIKeyInputRightArrow"?b.key=S?B.C0.ESC+"OC":B.C0.ESC+"[C":k.key==="UIKeyInputDownArrow"&&(b.key=S?B.C0.ESC+"OB":B.C0.ESC+"[B");break;case 8:if(k.shiftKey){b.key=B.C0.BS;break}if(k.altKey){b.key=B.C0.ESC+B.C0.DEL;break}b.key=B.C0.DEL;break;case 9:if(k.shiftKey){b.key=B.C0.ESC+"[Z";break}b.key=B.C0.HT,b.cancel=!0;break;case 13:b.key=k.altKey?B.C0.ESC+B.C0.CR:B.C0.CR,b.cancel=!0;break;case 27:b.key=B.C0.ESC,k.altKey&&(b.key=B.C0.ESC+B.C0.ESC),b.cancel=!0;break;case 37:if(k.metaKey)break;e?(b.key=B.C0.ESC+"[1;"+(e+1)+"D",b.key===B.C0.ESC+"[1;3D"&&(b.key=B.C0.ESC+(P?"b":"[1;5D"))):b.key=S?B.C0.ESC+"OD":B.C0.ESC+"[D";break;case 39:if(k.metaKey)break;e?(b.key=B.C0.ESC+"[1;"+(e+1)+"C",b.key===B.C0.ESC+"[1;3C"&&(b.key=B.C0.ESC+(P?"f":"[1;5C"))):b.key=S?B.C0.ESC+"OC":B.C0.ESC+"[C";break;case 38:if(k.metaKey)break;e?(b.key=B.C0.ESC+"[1;"+(e+1)+"A",P||b.key!==B.C0.ESC+"[1;3A"||(b.key=B.C0.ESC+"[1;5A")):b.key=S?B.C0.ESC+"OA":B.C0.ESC+"[A";break;case 40:if(k.metaKey)break;e?(b.key=B.C0.ESC+"[1;"+(e+1)+"B",P||b.key!==B.C0.ESC+"[1;3B"||(b.key=B.C0.ESC+"[1;5B")):b.key=S?B.C0.ESC+"OB":B.C0.ESC+"[B";break;case 45:k.shiftKey||k.ctrlKey||(b.key=B.C0.ESC+"[2~");break;case 46:b.key=e?B.C0.ESC+"[3;"+(e+1)+"~":B.C0.ESC+"[3~";break;case 36:b.key=e?B.C0.ESC+"[1;"+(e+1)+"H":S?B.C0.ESC+"OH":B.C0.ESC+"[H";break;case 35:b.key=e?B.C0.ESC+"[1;"+(e+1)+"F":S?B.C0.ESC+"OF":B.C0.ESC+"[F";break;case 33:k.shiftKey?b.type=2:b.key=B.C0.ESC+"[5~";break;case 34:k.shiftKey?b.type=3:b.key=B.C0.ESC+"[6~";break;case 112:b.key=e?B.C0.ESC+"[1;"+(e+1)+"P":B.C0.ESC+"OP";break;case 113:b.key=e?B.C0.ESC+"[1;"+(e+1)+"Q":B.C0.ESC+"OQ";break;case 114:b.key=e?B.C0.ESC+"[1;"+(e+1)+"R":B.C0.ESC+"OR";break;case 115:b.key=e?B.C0.ESC+"[1;"+(e+1)+"S":B.C0.ESC+"OS";break;case 116:b.key=e?B.C0.ESC+"[15;"+(e+1)+"~":B.C0.ESC+"[15~";break;case 117:b.key=e?B.C0.ESC+"[17;"+(e+1)+"~":B.C0.ESC+"[17~";break;case 118:b.key=e?B.C0.ESC+"[18;"+(e+1)+"~":B.C0.ESC+"[18~";break;case 119:b.key=e?B.C0.ESC+"[19;"+(e+1)+"~":B.C0.ESC+"[19~";break;case 120:b.key=e?B.C0.ESC+"[20;"+(e+1)+"~":B.C0.ESC+"[20~";break;case 121:b.key=e?B.C0.ESC+"[21;"+(e+1)+"~":B.C0.ESC+"[21~";break;case 122:b.key=e?B.C0.ESC+"[23;"+(e+1)+"~":B.C0.ESC+"[23~";break;case 123:b.key=e?B.C0.ESC+"[24;"+(e+1)+"~":B.C0.ESC+"[24~";break;default:if(!k.ctrlKey||k.shiftKey||k.altKey||k.metaKey)if(P&&!T||!k.altKey||k.metaKey)P&&!k.altKey&&!k.ctrlKey&&k.metaKey?k.keyCode===65&&(b.type=1):k.key&&!k.ctrlKey&&!k.altKey&&!k.metaKey&&k.keyCode>=48&&k.key.length===1?b.key=k.key:k.key&&k.ctrlKey&&k.key==="_"&&(b.key=B.C0.US);else{var E=U[k.keyCode],s=E&&E[k.shiftKey?1:0];if(s)b.key=B.C0.ESC+s;else if(k.keyCode>=65&&k.keyCode<=90){var n=k.ctrlKey?k.keyCode-64:k.keyCode+32;b.key=B.C0.ESC+String.fromCharCode(n)}}else k.keyCode>=65&&k.keyCode<=90?b.key=String.fromCharCode(k.keyCode-64):k.keyCode===32?b.key=B.C0.NUL:k.keyCode>=51&&k.keyCode<=55?b.key=String.fromCharCode(k.keyCode-51+27):k.keyCode===56?b.key=B.C0.DEL:k.keyCode===219?b.key=B.C0.ESC:k.keyCode===220?b.key=B.C0.FS:k.keyCode===221&&(b.key=B.C0.GS)}return b}},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(r,i){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(a,v){a.__proto__=v}||function(a,v){for(var p in v)v.hasOwnProperty(p)&&(a[p]=v[p])})(r,i)},function(r,i){function a(){this.constructor=r}B(r,i),r.prototype=i===null?Object.create(i):(a.prototype=i.prototype,new a)}),k=this&&this.__decorate||function(r,i,a,v){var p,l=arguments.length,o=l<3?i:v===null?v=Object.getOwnPropertyDescriptor(i,a):v;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")o=Reflect.decorate(r,i,a,v);else for(var u=r.length-1;u>=0;u--)(p=r[u])&&(o=(l<3?p(o):l>3?p(i,a,o):p(i,a))||o);return l>3&&o&&Object.defineProperty(i,a,o),o},S=this&&this.__param||function(r,i){return function(a,v){i(a,v,r)}};Object.defineProperty(M,"__esModule",{value:!0}),M.RenderService=void 0;var P=N(31),T=N(0),b=N(2),e=N(32),E=N(7),s=N(1),n=N(5),t=function(r){function i(a,v,p,l,o,u){var c=r.call(this)||this;if(c._renderer=a,c._rowCount=v,c._isPaused=!1,c._needsFullRefresh=!1,c._isNextRenderRedrawOnly=!0,c._needsSelectionRefresh=!1,c._canvasWidth=0,c._canvasHeight=0,c._selectionState={start:void 0,end:void 0,columnSelectMode:!1},c._onDimensionsChange=new T.EventEmitter,c._onRender=new T.EventEmitter,c._onRefreshRequest=new T.EventEmitter,c.register({dispose:function(){return c._renderer.dispose()}}),c._renderDebouncer=new P.RenderDebouncer(function(y,f){return c._renderRows(y,f)}),c.register(c._renderDebouncer),c._screenDprMonitor=new e.ScreenDprMonitor,c._screenDprMonitor.setListener(function(){return c.onDevicePixelRatioChange()}),c.register(c._screenDprMonitor),c.register(u.onResize(function(y){return c._fullRefresh()})),c.register(l.onOptionChange(function(){return c._renderer.onOptionsChanged()})),c.register(o.onCharSizeChange(function(){return c.onCharSizeChanged()})),c._renderer.onRequestRedraw(function(y){return c.refreshRows(y.start,y.end,!0)}),c.register(E.addDisposableDomListener(window,"resize",function(){return c.onDevicePixelRatioChange()})),"IntersectionObserver"in window){var _=new IntersectionObserver(function(y){return c._onIntersectionChange(y[y.length-1])},{threshold:0});_.observe(p),c.register({dispose:function(){return _.disconnect()}})}return c}return U(i,r),Object.defineProperty(i.prototype,"onDimensionsChange",{get:function(){return this._onDimensionsChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRenderedBufferChange",{get:function(){return this._onRender.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"onRefreshRequest",{get:function(){return this._onRefreshRequest.event},enumerable:!1,configurable:!0}),Object.defineProperty(i.prototype,"dimensions",{get:function(){return this._renderer.dimensions},enumerable:!1,configurable:!0}),i.prototype._onIntersectionChange=function(a){this._isPaused=a.intersectionRatio===0,!this._isPaused&&this._needsFullRefresh&&(this.refreshRows(0,this._rowCount-1),this._needsFullRefresh=!1)},i.prototype.refreshRows=function(a,v,p){p===void 0&&(p=!1),this._isPaused?this._needsFullRefresh=!0:(p||(this._isNextRenderRedrawOnly=!1),this._renderDebouncer.refresh(a,v,this._rowCount))},i.prototype._renderRows=function(a,v){this._renderer.renderRows(a,v),this._needsSelectionRefresh&&(this._renderer.onSelectionChanged(this._selectionState.start,this._selectionState.end,this._selectionState.columnSelectMode),this._needsSelectionRefresh=!1),this._isNextRenderRedrawOnly||this._onRender.fire({start:a,end:v}),this._isNextRenderRedrawOnly=!0},i.prototype.resize=function(a,v){this._rowCount=v,this._fireOnCanvasResize()},i.prototype.changeOptions=function(){this._renderer.onOptionsChanged(),this.refreshRows(0,this._rowCount-1),this._fireOnCanvasResize()},i.prototype._fireOnCanvasResize=function(){this._renderer.dimensions.canvasWidth===this._canvasWidth&&this._renderer.dimensions.canvasHeight===this._canvasHeight||this._onDimensionsChange.fire(this._renderer.dimensions)},i.prototype.dispose=function(){r.prototype.dispose.call(this)},i.prototype.setRenderer=function(a){var v=this;this._renderer.dispose(),this._renderer=a,this._renderer.onRequestRedraw(function(p){return v.refreshRows(p.start,p.end,!0)}),this._needsSelectionRefresh=!0,this._fullRefresh()},i.prototype._fullRefresh=function(){this._isPaused?this._needsFullRefresh=!0:this.refreshRows(0,this._rowCount-1)},i.prototype.setColors=function(a){this._renderer.setColors(a),this._fullRefresh()},i.prototype.onDevicePixelRatioChange=function(){this._renderer.onDevicePixelRatioChange(),this.refreshRows(0,this._rowCount-1)},i.prototype.onResize=function(a,v){this._renderer.onResize(a,v),this._fullRefresh()},i.prototype.onCharSizeChanged=function(){this._renderer.onCharSizeChanged()},i.prototype.onBlur=function(){this._renderer.onBlur()},i.prototype.onFocus=function(){this._renderer.onFocus()},i.prototype.onSelectionChanged=function(a,v,p){this._selectionState.start=a,this._selectionState.end=v,this._selectionState.columnSelectMode=p,this._renderer.onSelectionChanged(a,v,p)},i.prototype.onCursorMove=function(){this._renderer.onCursorMove()},i.prototype.clear=function(){this._renderer.clear()},i.prototype.registerCharacterJoiner=function(a){return this._renderer.registerCharacterJoiner(a)},i.prototype.deregisterCharacterJoiner=function(a){return this._renderer.deregisterCharacterJoiner(a)},i=k([S(3,s.IOptionsService),S(4,n.ICharSizeService),S(5,s.IBufferService)],i)}(b.Disposable);M.RenderService=t},function(re,M,N){"use strict";var B=this&&this.__decorate||function(b,e,E,s){var n,t=arguments.length,r=t<3?e:s===null?s=Object.getOwnPropertyDescriptor(e,E):s;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")r=Reflect.decorate(b,e,E,s);else for(var i=b.length-1;i>=0;i--)(n=b[i])&&(r=(t<3?n(r):t>3?n(e,E,r):n(e,E))||r);return t>3&&r&&Object.defineProperty(e,E,r),r},U=this&&this.__param||function(b,e){return function(E,s){e(E,s,b)}};Object.defineProperty(M,"__esModule",{value:!0}),M.CharSizeService=void 0;var k=N(1),S=N(0),P=function(){function b(e,E,s){this._optionsService=s,this.width=0,this.height=0,this._onCharSizeChange=new S.EventEmitter,this._measureStrategy=new T(e,E,this._optionsService)}return Object.defineProperty(b.prototype,"hasValidSize",{get:function(){return this.width>0&&this.height>0},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"onCharSizeChange",{get:function(){return this._onCharSizeChange.event},enumerable:!1,configurable:!0}),b.prototype.measure=function(){var e=this._measureStrategy.measure();e.width===this.width&&e.height===this.height||(this.width=e.width,this.height=e.height,this._onCharSizeChange.fire())},b=B([U(2,k.IOptionsService)],b)}();M.CharSizeService=P;var T=function(){function b(e,E,s){this._document=e,this._parentElement=E,this._optionsService=s,this._result={width:0,height:0},this._measureElement=this._document.createElement("span"),this._measureElement.classList.add("xterm-char-measure-element"),this._measureElement.textContent="W",this._measureElement.setAttribute("aria-hidden","true"),this._parentElement.appendChild(this._measureElement)}return b.prototype.measure=function(){this._measureElement.style.fontFamily=this._optionsService.options.fontFamily,this._measureElement.style.fontSize=this._optionsService.options.fontSize+"px";var e=this._measureElement.getBoundingClientRect();return e.width!==0&&e.height!==0&&(this._result.width=e.width,this._result.height=Math.ceil(e.height)),this._result},b}()},function(re,M,N){"use strict";var B=this&&this.__decorate||function(T,b,e,E){var s,n=arguments.length,t=n<3?b:E===null?E=Object.getOwnPropertyDescriptor(b,e):E;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")t=Reflect.decorate(T,b,e,E);else for(var r=T.length-1;r>=0;r--)(s=T[r])&&(t=(n<3?s(t):n>3?s(b,e,t):s(b,e))||t);return n>3&&t&&Object.defineProperty(b,e,t),t},U=this&&this.__param||function(T,b){return function(e,E){b(e,E,T)}};Object.defineProperty(M,"__esModule",{value:!0}),M.MouseService=void 0;var k=N(5),S=N(30),P=function(){function T(b,e){this._renderService=b,this._charSizeService=e}return T.prototype.getCoords=function(b,e,E,s,n){return S.getCoords(b,e,E,s,this._charSizeService.hasValidSize,this._renderService.dimensions.actualCellWidth,this._renderService.dimensions.actualCellHeight,n)},T.prototype.getRawByteCoords=function(b,e,E,s){var n=this.getCoords(b,e,E,s);return S.getRawByteCoords(n)},T=B([U(0,k.IRenderService),U(1,k.ICharSizeService)],T)}();M.MouseService=P},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(s,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(s,n)},function(s,n){function t(){this.constructor=s}B(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),k=this&&this.__decorate||function(s,n,t,r){var i,a=arguments.length,v=a<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,n,t,r);else for(var p=s.length-1;p>=0;p--)(i=s[p])&&(v=(a<3?i(v):a>3?i(n,t,v):i(n,t))||v);return a>3&&v&&Object.defineProperty(n,t,v),v},S=this&&this.__param||function(s,n){return function(t,r){n(t,r,s)}};Object.defineProperty(M,"__esModule",{value:!0}),M.Linkifier2=void 0;var P=N(1),T=N(0),b=N(2),e=N(7),E=function(s){function n(t){var r=s.call(this)||this;return r._bufferService=t,r._linkProviders=[],r._linkCacheDisposables=[],r._isMouseOut=!0,r._activeLine=-1,r._onShowLinkUnderline=r.register(new T.EventEmitter),r._onHideLinkUnderline=r.register(new T.EventEmitter),r.register(b.getDisposeArrayDisposable(r._linkCacheDisposables)),r}return U(n,s),Object.defineProperty(n.prototype,"onShowLinkUnderline",{get:function(){return this._onShowLinkUnderline.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"onHideLinkUnderline",{get:function(){return this._onHideLinkUnderline.event},enumerable:!1,configurable:!0}),n.prototype.registerLinkProvider=function(t){var r=this;return this._linkProviders.push(t),{dispose:function(){var i=r._linkProviders.indexOf(t);i!==-1&&r._linkProviders.splice(i,1)}}},n.prototype.attachToDom=function(t,r,i){var a=this;this._element=t,this._mouseService=r,this._renderService=i,this.register(e.addDisposableDomListener(this._element,"mouseleave",function(){a._isMouseOut=!0,a._clearCurrentLink()})),this.register(e.addDisposableDomListener(this._element,"mousemove",this._onMouseMove.bind(this))),this.register(e.addDisposableDomListener(this._element,"click",this._onClick.bind(this)))},n.prototype._onMouseMove=function(t){if(this._lastMouseEvent=t,this._element&&this._mouseService){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);if(r){this._isMouseOut=!1;for(var i=t.composedPath(),a=0;a<i.length;a++){var v=i[a];if(v.classList.contains("xterm"))break;if(v.classList.contains("xterm-hover"))return}this._lastBufferCell&&r.x===this._lastBufferCell.x&&r.y===this._lastBufferCell.y||(this._onHover(r),this._lastBufferCell=r)}}},n.prototype._onHover=function(t){if(this._activeLine!==t.y)return this._clearCurrentLink(),void this._askForLink(t,!1);this._currentLink&&this._linkAtPosition(this._currentLink.link,t)||(this._clearCurrentLink(),this._askForLink(t,!0))},n.prototype._askForLink=function(t,r){var i=this;this._activeProviderReplies&&r||(this._activeProviderReplies=new Map,this._activeLine=t.y);var a=!1;this._linkProviders.forEach(function(v,p){var l;r?!((l=i._activeProviderReplies)===null||l===void 0)&&l.get(p)&&(a=i._checkLinkProviderResult(p,t,a)):v.provideLinks(t.y,function(o){var u,c;if(!i._isMouseOut){var _=o==null?void 0:o.map(function(y){return{link:y}});(u=i._activeProviderReplies)===null||u===void 0||u.set(p,_),a=i._checkLinkProviderResult(p,t,a),((c=i._activeProviderReplies)===null||c===void 0?void 0:c.size)===i._linkProviders.length&&i._removeIntersectingLinks(t.y,i._activeProviderReplies)}})})},n.prototype._removeIntersectingLinks=function(t,r){for(var i=new Set,a=0;a<r.size;a++){var v=r.get(a);if(v)for(var p=0;p<v.length;p++)for(var l=v[p],o=l.link.range.start.y<t?0:l.link.range.start.x,u=l.link.range.end.y>t?this._bufferService.cols:l.link.range.end.x,c=o;c<=u;c++){if(i.has(c)){v.splice(p--,1);break}i.add(c)}}},n.prototype._checkLinkProviderResult=function(t,r,i){var a,v=this;if(!this._activeProviderReplies)return i;for(var p=this._activeProviderReplies.get(t),l=!1,o=0;o<t;o++)this._activeProviderReplies.has(o)&&!this._activeProviderReplies.get(o)||(l=!0);if(!l&&p){var u=p.find(function(_){return v._linkAtPosition(_.link,r)});u&&(i=!0,this._handleNewLink(u))}if(this._activeProviderReplies.size===this._linkProviders.length&&!i)for(o=0;o<this._activeProviderReplies.size;o++){var c=(a=this._activeProviderReplies.get(o))===null||a===void 0?void 0:a.find(function(_){return v._linkAtPosition(_.link,r)});if(c){i=!0,this._handleNewLink(c);break}}return i},n.prototype._onClick=function(t){if(this._element&&this._mouseService&&this._currentLink){var r=this._positionFromMouseEvent(t,this._element,this._mouseService);r&&this._linkAtPosition(this._currentLink.link,r)&&this._currentLink.link.activate(t,this._currentLink.link.text)}},n.prototype._clearCurrentLink=function(t,r){this._element&&this._currentLink&&this._lastMouseEvent&&(!t||!r||this._currentLink.link.range.start.y>=t&&this._currentLink.link.range.end.y<=r)&&(this._linkLeave(this._element,this._currentLink.link,this._lastMouseEvent),this._currentLink=void 0,b.disposeArray(this._linkCacheDisposables))},n.prototype._handleNewLink=function(t){var r=this;if(this._element&&this._lastMouseEvent&&this._mouseService){var i=this._positionFromMouseEvent(this._lastMouseEvent,this._element,this._mouseService);i&&this._linkAtPosition(t.link,i)&&(this._currentLink=t,this._currentLink.state={decorations:{underline:t.link.decorations===void 0||t.link.decorations.underline,pointerCursor:t.link.decorations===void 0||t.link.decorations.pointerCursor},isHovered:!0},this._linkHover(this._element,t.link,this._lastMouseEvent),t.link.decorations={},Object.defineProperties(t.link.decorations,{pointerCursor:{get:function(){var a,v;return(v=(a=r._currentLink)===null||a===void 0?void 0:a.state)===null||v===void 0?void 0:v.decorations.pointerCursor},set:function(a){var v,p;!((v=r._currentLink)===null||v===void 0)&&v.state&&r._currentLink.state.decorations.pointerCursor!==a&&(r._currentLink.state.decorations.pointerCursor=a,r._currentLink.state.isHovered&&((p=r._element)===null||p===void 0||p.classList.toggle("xterm-cursor-pointer",a)))}},underline:{get:function(){var a,v;return(v=(a=r._currentLink)===null||a===void 0?void 0:a.state)===null||v===void 0?void 0:v.decorations.underline},set:function(a){var v,p,l;!((v=r._currentLink)===null||v===void 0)&&v.state&&((l=(p=r._currentLink)===null||p===void 0?void 0:p.state)===null||l===void 0?void 0:l.decorations.underline)!==a&&(r._currentLink.state.decorations.underline=a,r._currentLink.state.isHovered&&r._fireUnderlineEvent(t.link,a))}}}),this._renderService&&this._linkCacheDisposables.push(this._renderService.onRenderedBufferChange(function(a){var v=a.start===0?0:a.start+1+r._bufferService.buffer.ydisp;r._clearCurrentLink(v,a.end+1+r._bufferService.buffer.ydisp)})))}},n.prototype._linkHover=function(t,r,i){var a;!((a=this._currentLink)===null||a===void 0)&&a.state&&(this._currentLink.state.isHovered=!0,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!0),this._currentLink.state.decorations.pointerCursor&&t.classList.add("xterm-cursor-pointer")),r.hover&&r.hover(i,r.text)},n.prototype._fireUnderlineEvent=function(t,r){var i=t.range,a=this._bufferService.buffer.ydisp,v=this._createLinkUnderlineEvent(i.start.x-1,i.start.y-a-1,i.end.x,i.end.y-a-1,void 0);(r?this._onShowLinkUnderline:this._onHideLinkUnderline).fire(v)},n.prototype._linkLeave=function(t,r,i){var a;!((a=this._currentLink)===null||a===void 0)&&a.state&&(this._currentLink.state.isHovered=!1,this._currentLink.state.decorations.underline&&this._fireUnderlineEvent(r,!1),this._currentLink.state.decorations.pointerCursor&&t.classList.remove("xterm-cursor-pointer")),r.leave&&r.leave(i,r.text)},n.prototype._linkAtPosition=function(t,r){var i=t.range.start.y===t.range.end.y,a=t.range.start.y<r.y,v=t.range.end.y>r.y;return(i&&t.range.start.x<=r.x&&t.range.end.x>=r.x||a&&t.range.end.x>=r.x||v&&t.range.start.x<=r.x||a&&v)&&t.range.start.y<=r.y&&t.range.end.y>=r.y},n.prototype._positionFromMouseEvent=function(t,r,i){var a=i.getCoords(t,r,this._bufferService.cols,this._bufferService.rows);if(a)return{x:a[0],y:a[1]+this._bufferService.buffer.ydisp}},n.prototype._createLinkUnderlineEvent=function(t,r,i,a,v){return{x1:t,y1:r,x2:i,y2:a,cols:this._bufferService.cols,fg:v}},n=k([S(0,P.IBufferService)],n)}(b.Disposable);M.Linkifier2=E},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.CoreBrowserService=void 0;var B=function(){function U(k){this._textarea=k}return Object.defineProperty(U.prototype,"isFocused",{get:function(){return document.activeElement===this._textarea&&document.hasFocus()},enumerable:!1,configurable:!0}),U}();M.CoreBrowserService=B},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(o,u){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(c,_){c.__proto__=_}||function(c,_){for(var y in _)_.hasOwnProperty(y)&&(c[y]=_[y])})(o,u)},function(o,u){function c(){this.constructor=o}B(o,u),o.prototype=u===null?Object.create(u):(c.prototype=u.prototype,new c)});Object.defineProperty(M,"__esModule",{value:!0}),M.CoreTerminal=void 0;var k=N(2),S=N(1),P=N(66),T=N(67),b=N(68),e=N(74),E=N(75),s=N(0),n=N(76),t=N(77),r=N(78),i=N(80),a=N(81),v=N(19),p=N(82),l=function(o){function u(c){var _=o.call(this)||this;return _._onBinary=new s.EventEmitter,_._onData=new s.EventEmitter,_._onLineFeed=new s.EventEmitter,_._onResize=new s.EventEmitter,_._onScroll=new s.EventEmitter,_._instantiationService=new P.InstantiationService,_.optionsService=new e.OptionsService(c),_._instantiationService.setService(S.IOptionsService,_.optionsService),_._bufferService=_.register(_._instantiationService.createInstance(b.BufferService)),_._instantiationService.setService(S.IBufferService,_._bufferService),_._logService=_._instantiationService.createInstance(T.LogService),_._instantiationService.setService(S.ILogService,_._logService),_._coreService=_.register(_._instantiationService.createInstance(E.CoreService,function(){return _.scrollToBottom()})),_._instantiationService.setService(S.ICoreService,_._coreService),_._coreMouseService=_._instantiationService.createInstance(n.CoreMouseService),_._instantiationService.setService(S.ICoreMouseService,_._coreMouseService),_._dirtyRowService=_._instantiationService.createInstance(t.DirtyRowService),_._instantiationService.setService(S.IDirtyRowService,_._dirtyRowService),_.unicodeService=_._instantiationService.createInstance(r.UnicodeService),_._instantiationService.setService(S.IUnicodeService,_.unicodeService),_._charsetService=_._instantiationService.createInstance(i.CharsetService),_._instantiationService.setService(S.ICharsetService,_._charsetService),_._inputHandler=new v.InputHandler(_._bufferService,_._charsetService,_._coreService,_._dirtyRowService,_._logService,_.optionsService,_._coreMouseService,_.unicodeService),_.register(s.forwardEvent(_._inputHandler.onLineFeed,_._onLineFeed)),_.register(_._inputHandler),_.register(s.forwardEvent(_._bufferService.onResize,_._onResize)),_.register(s.forwardEvent(_._coreService.onData,_._onData)),_.register(s.forwardEvent(_._coreService.onBinary,_._onBinary)),_.register(_.optionsService.onOptionChange(function(y){return _._updateOptions(y)})),_._writeBuffer=new p.WriteBuffer(function(y){return _._inputHandler.parse(y)}),_}return U(u,o),Object.defineProperty(u.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onLineFeed",{get:function(){return this._onLineFeed.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"onScroll",{get:function(){return this._onScroll.event},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"cols",{get:function(){return this._bufferService.cols},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"rows",{get:function(){return this._bufferService.rows},enumerable:!1,configurable:!0}),Object.defineProperty(u.prototype,"buffers",{get:function(){return this._bufferService.buffers},enumerable:!1,configurable:!0}),u.prototype.dispose=function(){var c;this._isDisposed||(o.prototype.dispose.call(this),(c=this._windowsMode)===null||c===void 0||c.dispose(),this._windowsMode=void 0)},u.prototype.write=function(c,_){this._writeBuffer.write(c,_)},u.prototype.writeSync=function(c){this._writeBuffer.writeSync(c)},u.prototype.resize=function(c,_){isNaN(c)||isNaN(_)||(c=Math.max(c,b.MINIMUM_COLS),_=Math.max(_,b.MINIMUM_ROWS),this._bufferService.resize(c,_))},u.prototype.scroll=function(c,_){_===void 0&&(_=!1);var y,f=this._bufferService.buffer;(y=this._cachedBlankLine)&&y.length===this.cols&&y.getFg(0)===c.fg&&y.getBg(0)===c.bg||(y=f.getBlankLine(c,_),this._cachedBlankLine=y),y.isWrapped=_;var C=f.ybase+f.scrollTop,L=f.ybase+f.scrollBottom;if(f.scrollTop===0){var R=f.lines.isFull;L===f.lines.length-1?R?f.lines.recycle().copyFrom(y):f.lines.push(y.clone()):f.lines.splice(L+1,0,y.clone()),R?this._bufferService.isUserScrolling&&(f.ydisp=Math.max(f.ydisp-1,0)):(f.ybase++,this._bufferService.isUserScrolling||f.ydisp++)}else{var O=L-C+1;f.lines.shiftElements(C+1,O-1,-1),f.lines.set(L,y.clone())}this._bufferService.isUserScrolling||(f.ydisp=f.ybase),this._dirtyRowService.markRangeDirty(f.scrollTop,f.scrollBottom),this._onScroll.fire(f.ydisp)},u.prototype.scrollLines=function(c,_){var y=this._bufferService.buffer;if(c<0){if(y.ydisp===0)return;this._bufferService.isUserScrolling=!0}else c+y.ydisp>=y.ybase&&(this._bufferService.isUserScrolling=!1);var f=y.ydisp;y.ydisp=Math.max(Math.min(y.ydisp+c,y.ybase),0),f!==y.ydisp&&(_||this._onScroll.fire(y.ydisp))},u.prototype.scrollPages=function(c){this.scrollLines(c*(this.rows-1))},u.prototype.scrollToTop=function(){this.scrollLines(-this._bufferService.buffer.ydisp)},u.prototype.scrollToBottom=function(){this.scrollLines(this._bufferService.buffer.ybase-this._bufferService.buffer.ydisp)},u.prototype.scrollToLine=function(c){var _=c-this._bufferService.buffer.ydisp;_!==0&&this.scrollLines(_)},u.prototype.addEscHandler=function(c,_){return this._inputHandler.addEscHandler(c,_)},u.prototype.addDcsHandler=function(c,_){return this._inputHandler.addDcsHandler(c,_)},u.prototype.addCsiHandler=function(c,_){return this._inputHandler.addCsiHandler(c,_)},u.prototype.addOscHandler=function(c,_){return this._inputHandler.addOscHandler(c,_)},u.prototype._setup=function(){this.optionsService.options.windowsMode&&this._enableWindowsMode()},u.prototype.reset=function(){this._inputHandler.reset(),this._bufferService.reset(),this._charsetService.reset(),this._coreService.reset(),this._coreMouseService.reset()},u.prototype._updateOptions=function(c){var _;switch(c){case"scrollback":this.buffers.resize(this.cols,this.rows);break;case"windowsMode":this.optionsService.options.windowsMode?this._enableWindowsMode():((_=this._windowsMode)===null||_===void 0||_.dispose(),this._windowsMode=void 0)}},u.prototype._enableWindowsMode=function(){var c=this;if(!this._windowsMode){var _=[];_.push(this.onLineFeed(a.updateWindowsModeWrappedState.bind(null,this._bufferService))),_.push(this.addCsiHandler({final:"H"},function(){return a.updateWindowsModeWrappedState(c._bufferService),!1})),this._windowsMode={dispose:function(){for(var y=0,f=_;y<f.length;y++)f[y].dispose()}}}},u}(k.Disposable);M.CoreTerminal=l},function(re,M,N){"use strict";var B=this&&this.__spreadArrays||function(){for(var T=0,b=0,e=arguments.length;b<e;b++)T+=arguments[b].length;var E=Array(T),s=0;for(b=0;b<e;b++)for(var n=arguments[b],t=0,r=n.length;t<r;t++,s++)E[s]=n[t];return E};Object.defineProperty(M,"__esModule",{value:!0}),M.InstantiationService=M.ServiceCollection=void 0;var U=N(1),k=N(14),S=function(){function T(){for(var b=[],e=0;e<arguments.length;e++)b[e]=arguments[e];this._entries=new Map;for(var E=0,s=b;E<s.length;E++){var n=s[E],t=n[0],r=n[1];this.set(t,r)}}return T.prototype.set=function(b,e){var E=this._entries.get(b);return this._entries.set(b,e),E},T.prototype.forEach=function(b){this._entries.forEach(function(e,E){return b(E,e)})},T.prototype.has=function(b){return this._entries.has(b)},T.prototype.get=function(b){return this._entries.get(b)},T}();M.ServiceCollection=S;var P=function(){function T(){this._services=new S,this._services.set(U.IInstantiationService,this)}return T.prototype.setService=function(b,e){this._services.set(b,e)},T.prototype.getService=function(b){return this._services.get(b)},T.prototype.createInstance=function(b){for(var e=[],E=1;E<arguments.length;E++)e[E-1]=arguments[E];for(var s=k.getServiceDependencies(b).sort(function(p,l){return p.index-l.index}),n=[],t=0,r=s;t<r.length;t++){var i=r[t],a=this._services.get(i.id);if(!a)throw new Error("[createInstance] "+b.name+" depends on UNKNOWN service "+i.id+".");n.push(a)}var v=s.length>0?s[0].index:e.length;if(e.length!==v)throw new Error("[createInstance] First service dependency of "+b.name+" at position "+(v+1)+" conflicts with "+e.length+" static arguments");return new(b.bind.apply(b,B([void 0],B(e,n))))},T}();M.InstantiationService=P},function(re,M,N){"use strict";var B=this&&this.__decorate||function(e,E,s,n){var t,r=arguments.length,i=r<3?E:n===null?n=Object.getOwnPropertyDescriptor(E,s):n;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")i=Reflect.decorate(e,E,s,n);else for(var a=e.length-1;a>=0;a--)(t=e[a])&&(i=(r<3?t(i):r>3?t(E,s,i):t(E,s))||i);return r>3&&i&&Object.defineProperty(E,s,i),i},U=this&&this.__param||function(e,E){return function(s,n){E(s,n,e)}},k=this&&this.__spreadArrays||function(){for(var e=0,E=0,s=arguments.length;E<s;E++)e+=arguments[E].length;var n=Array(e),t=0;for(E=0;E<s;E++)for(var r=arguments[E],i=0,a=r.length;i<a;i++,t++)n[t]=r[i];return n};Object.defineProperty(M,"__esModule",{value:!0}),M.LogService=M.LogLevel=void 0;var S,P=N(1);(function(e){e[e.DEBUG=0]="DEBUG",e[e.INFO=1]="INFO",e[e.WARN=2]="WARN",e[e.ERROR=3]="ERROR",e[e.OFF=4]="OFF"})(S=M.LogLevel||(M.LogLevel={}));var T={debug:S.DEBUG,info:S.INFO,warn:S.WARN,error:S.ERROR,off:S.OFF},b=function(){function e(E){var s=this;this._optionsService=E,this._updateLogLevel(),this._optionsService.onOptionChange(function(n){n==="logLevel"&&s._updateLogLevel()})}return e.prototype._updateLogLevel=function(){this._logLevel=T[this._optionsService.options.logLevel]},e.prototype._evalLazyOptionalParams=function(E){for(var s=0;s<E.length;s++)typeof E[s]=="function"&&(E[s]=E[s]())},e.prototype._log=function(E,s,n){this._evalLazyOptionalParams(n),E.call.apply(E,k([console,"xterm.js: "+s],n))},e.prototype.debug=function(E){for(var s=[],n=1;n<arguments.length;n++)s[n-1]=arguments[n];this._logLevel<=S.DEBUG&&this._log(console.log,E,s)},e.prototype.info=function(E){for(var s=[],n=1;n<arguments.length;n++)s[n-1]=arguments[n];this._logLevel<=S.INFO&&this._log(console.info,E,s)},e.prototype.warn=function(E){for(var s=[],n=1;n<arguments.length;n++)s[n-1]=arguments[n];this._logLevel<=S.WARN&&this._log(console.warn,E,s)},e.prototype.error=function(E){for(var s=[],n=1;n<arguments.length;n++)s[n-1]=arguments[n];this._logLevel<=S.ERROR&&this._log(console.error,E,s)},e=B([U(0,P.IOptionsService)],e)}();M.LogService=b},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(s,n){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var i in r)r.hasOwnProperty(i)&&(t[i]=r[i])})(s,n)},function(s,n){function t(){this.constructor=s}B(s,n),s.prototype=n===null?Object.create(n):(t.prototype=n.prototype,new t)}),k=this&&this.__decorate||function(s,n,t,r){var i,a=arguments.length,v=a<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,n,t,r);else for(var p=s.length-1;p>=0;p--)(i=s[p])&&(v=(a<3?i(v):a>3?i(n,t,v):i(n,t))||v);return a>3&&v&&Object.defineProperty(n,t,v),v},S=this&&this.__param||function(s,n){return function(t,r){n(t,r,s)}};Object.defineProperty(M,"__esModule",{value:!0}),M.BufferService=M.MINIMUM_ROWS=M.MINIMUM_COLS=void 0;var P=N(1),T=N(69),b=N(0),e=N(2);M.MINIMUM_COLS=2,M.MINIMUM_ROWS=1;var E=function(s){function n(t){var r=s.call(this)||this;return r._optionsService=t,r.isUserScrolling=!1,r._onResize=new b.EventEmitter,r.cols=Math.max(t.options.cols,M.MINIMUM_COLS),r.rows=Math.max(t.options.rows,M.MINIMUM_ROWS),r.buffers=new T.BufferSet(t,r),r}return U(n,s),Object.defineProperty(n.prototype,"onResize",{get:function(){return this._onResize.event},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"buffer",{get:function(){return this.buffers.active},enumerable:!1,configurable:!0}),n.prototype.dispose=function(){s.prototype.dispose.call(this),this.buffers.dispose()},n.prototype.resize=function(t,r){this.cols=t,this.rows=r,this.buffers.resize(t,r),this.buffers.setupTabStops(this.cols),this._onResize.fire({cols:t,rows:r})},n.prototype.reset=function(){this.buffers.dispose(),this.buffers=new T.BufferSet(this._optionsService,this),this.isUserScrolling=!1},n=k([S(0,P.IOptionsService)],n)}(e.Disposable);M.BufferService=E},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(T,b){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(e,E){e.__proto__=E}||function(e,E){for(var s in E)E.hasOwnProperty(s)&&(e[s]=E[s])})(T,b)},function(T,b){function e(){this.constructor=T}B(T,b),T.prototype=b===null?Object.create(b):(e.prototype=b.prototype,new e)});Object.defineProperty(M,"__esModule",{value:!0}),M.BufferSet=void 0;var k=N(70),S=N(0),P=function(T){function b(e,E){var s=T.call(this)||this;return s._onBufferActivate=s.register(new S.EventEmitter),s._normal=new k.Buffer(!0,e,E),s._normal.fillViewportRows(),s._alt=new k.Buffer(!1,e,E),s._activeBuffer=s._normal,s.setupTabStops(),s}return U(b,T),Object.defineProperty(b.prototype,"onBufferActivate",{get:function(){return this._onBufferActivate.event},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"alt",{get:function(){return this._alt},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"active",{get:function(){return this._activeBuffer},enumerable:!1,configurable:!0}),Object.defineProperty(b.prototype,"normal",{get:function(){return this._normal},enumerable:!1,configurable:!0}),b.prototype.activateNormalBuffer=function(){this._activeBuffer!==this._normal&&(this._normal.x=this._alt.x,this._normal.y=this._alt.y,this._alt.clear(),this._activeBuffer=this._normal,this._onBufferActivate.fire({activeBuffer:this._normal,inactiveBuffer:this._alt}))},b.prototype.activateAltBuffer=function(e){this._activeBuffer!==this._alt&&(this._alt.fillViewportRows(e),this._alt.x=this._normal.x,this._alt.y=this._normal.y,this._activeBuffer=this._alt,this._onBufferActivate.fire({activeBuffer:this._alt,inactiveBuffer:this._normal}))},b.prototype.resize=function(e,E){this._normal.resize(e,E),this._alt.resize(e,E)},b.prototype.setupTabStops=function(e){this._normal.setupTabStops(e),this._alt.setupTabStops(e)},b}(N(2).Disposable);M.BufferSet=P},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.BufferStringIterator=M.Buffer=M.MAX_BUFFER_SIZE=void 0;var B=N(71),U=N(16),k=N(4),S=N(3),P=N(72),T=N(73),b=N(20),e=N(6);M.MAX_BUFFER_SIZE=4294967295;var E=function(){function n(t,r,i){this._hasScrollback=t,this._optionsService=r,this._bufferService=i,this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.savedY=0,this.savedX=0,this.savedCurAttrData=U.DEFAULT_ATTR_DATA.clone(),this.savedCharset=b.DEFAULT_CHARSET,this.markers=[],this._nullCell=k.CellData.fromCharData([0,S.NULL_CELL_CHAR,S.NULL_CELL_WIDTH,S.NULL_CELL_CODE]),this._whitespaceCell=k.CellData.fromCharData([0,S.WHITESPACE_CELL_CHAR,S.WHITESPACE_CELL_WIDTH,S.WHITESPACE_CELL_CODE]),this._cols=this._bufferService.cols,this._rows=this._bufferService.rows,this.lines=new B.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()}return n.prototype.getNullCell=function(t){return t?(this._nullCell.fg=t.fg,this._nullCell.bg=t.bg,this._nullCell.extended=t.extended):(this._nullCell.fg=0,this._nullCell.bg=0,this._nullCell.extended=new e.ExtendedAttrs),this._nullCell},n.prototype.getWhitespaceCell=function(t){return t?(this._whitespaceCell.fg=t.fg,this._whitespaceCell.bg=t.bg,this._whitespaceCell.extended=t.extended):(this._whitespaceCell.fg=0,this._whitespaceCell.bg=0,this._whitespaceCell.extended=new e.ExtendedAttrs),this._whitespaceCell},n.prototype.getBlankLine=function(t,r){return new U.BufferLine(this._bufferService.cols,this.getNullCell(t),r)},Object.defineProperty(n.prototype,"hasScrollback",{get:function(){return this._hasScrollback&&this.lines.maxLength>this._rows},enumerable:!1,configurable:!0}),Object.defineProperty(n.prototype,"isCursorInViewport",{get:function(){var t=this.ybase+this.y-this.ydisp;return t>=0&&t<this._rows},enumerable:!1,configurable:!0}),n.prototype._getCorrectBufferLength=function(t){if(!this._hasScrollback)return t;var r=t+this._optionsService.options.scrollback;return r>M.MAX_BUFFER_SIZE?M.MAX_BUFFER_SIZE:r},n.prototype.fillViewportRows=function(t){if(this.lines.length===0){t===void 0&&(t=U.DEFAULT_ATTR_DATA);for(var r=this._rows;r--;)this.lines.push(this.getBlankLine(t))}},n.prototype.clear=function(){this.ydisp=0,this.ybase=0,this.y=0,this.x=0,this.lines=new B.CircularList(this._getCorrectBufferLength(this._rows)),this.scrollTop=0,this.scrollBottom=this._rows-1,this.setupTabStops()},n.prototype.resize=function(t,r){var i=this.getNullCell(U.DEFAULT_ATTR_DATA),a=this._getCorrectBufferLength(r);if(a>this.lines.maxLength&&(this.lines.maxLength=a),this.lines.length>0){if(this._cols<t)for(var v=0;v<this.lines.length;v++)this.lines.get(v).resize(t,i);var p=0;if(this._rows<r)for(var l=this._rows;l<r;l++)this.lines.length<r+this.ybase&&(this._optionsService.options.windowsMode?this.lines.push(new U.BufferLine(t,i)):this.ybase>0&&this.lines.length<=this.ybase+this.y+p+1?(this.ybase--,p++,this.ydisp>0&&this.ydisp--):this.lines.push(new U.BufferLine(t,i)));else for(l=this._rows;l>r;l--)this.lines.length>r+this.ybase&&(this.lines.length>this.ybase+this.y+1?this.lines.pop():(this.ybase++,this.ydisp++));if(a<this.lines.maxLength){var o=this.lines.length-a;o>0&&(this.lines.trimStart(o),this.ybase=Math.max(this.ybase-o,0),this.ydisp=Math.max(this.ydisp-o,0),this.savedY=Math.max(this.savedY-o,0)),this.lines.maxLength=a}this.x=Math.min(this.x,t-1),this.y=Math.min(this.y,r-1),p&&(this.y+=p),this.savedX=Math.min(this.savedX,t-1),this.scrollTop=0}if(this.scrollBottom=r-1,this._isReflowEnabled&&(this._reflow(t,r),this._cols>t))for(v=0;v<this.lines.length;v++)this.lines.get(v).resize(t,i);this._cols=t,this._rows=r},Object.defineProperty(n.prototype,"_isReflowEnabled",{get:function(){return this._hasScrollback&&!this._optionsService.options.windowsMode},enumerable:!1,configurable:!0}),n.prototype._reflow=function(t,r){this._cols!==t&&(t>this._cols?this._reflowLarger(t,r):this._reflowSmaller(t,r))},n.prototype._reflowLarger=function(t,r){var i=P.reflowLargerGetLinesToRemove(this.lines,this._cols,t,this.ybase+this.y,this.getNullCell(U.DEFAULT_ATTR_DATA));if(i.length>0){var a=P.reflowLargerCreateNewLayout(this.lines,i);P.reflowLargerApplyNewLayout(this.lines,a.layout),this._reflowLargerAdjustViewport(t,r,a.countRemoved)}},n.prototype._reflowLargerAdjustViewport=function(t,r,i){for(var a=this.getNullCell(U.DEFAULT_ATTR_DATA),v=i;v-- >0;)this.ybase===0?(this.y>0&&this.y--,this.lines.length<r&&this.lines.push(new U.BufferLine(t,a))):(this.ydisp===this.ybase&&this.ydisp--,this.ybase--);this.savedY=Math.max(this.savedY-i,0)},n.prototype._reflowSmaller=function(t,r){for(var i=this.getNullCell(U.DEFAULT_ATTR_DATA),a=[],v=0,p=this.lines.length-1;p>=0;p--){var l=this.lines.get(p);if(!(!l||!l.isWrapped&&l.getTrimmedLength()<=t)){for(var o=[l];l.isWrapped&&p>0;)l=this.lines.get(--p),o.unshift(l);var u=this.ybase+this.y;if(!(u>=p&&u<p+o.length)){var c=o[o.length-1].getTrimmedLength(),_=P.reflowSmallerGetNewLineLengths(o,this._cols,t),y=_.length-o.length,f=void 0;f=this.ybase===0&&this.y!==this.lines.length-1?Math.max(0,this.y-this.lines.maxLength+y):Math.max(0,this.lines.length-this.lines.maxLength+y);for(var C=[],L=0;L<y;L++){var R=this.getBlankLine(U.DEFAULT_ATTR_DATA,!0);C.push(R)}C.length>0&&(a.push({start:p+o.length+v,newLines:C}),v+=C.length),o.push.apply(o,C);var O=_.length-1,g=_[O];g===0&&(g=_[--O]);for(var m=o.length-y-1,d=c;m>=0;){var h=Math.min(d,g);if(o[O].copyCellsFrom(o[m],d-h,g-h,h,!0),(g-=h)===0&&(g=_[--O]),(d-=h)===0){m--;var A=Math.max(m,0);d=P.getWrappedLineTrimmedLength(o,A,this._cols)}}for(L=0;L<o.length;L++)_[L]<t&&o[L].setCell(_[L],i);for(var w=y-f;w-- >0;)this.ybase===0?this.y<r-1?(this.y++,this.lines.pop()):(this.ybase++,this.ydisp++):this.ybase<Math.min(this.lines.maxLength,this.lines.length+v)-r&&(this.ybase===this.ydisp&&this.ydisp++,this.ybase++);this.savedY=Math.min(this.savedY+y,this.ybase+r-1)}}}if(a.length>0){var x=[],D=[];for(L=0;L<this.lines.length;L++)D.push(this.lines.get(L));var I=this.lines.length,F=I-1,K=0,W=a[K];this.lines.length=Math.min(this.lines.maxLength,this.lines.length+v);var z=0;for(L=Math.min(this.lines.maxLength-1,I+v-1);L>=0;L--)if(W&&W.start>F+z){for(var j=W.newLines.length-1;j>=0;j--)this.lines.set(L--,W.newLines[j]);L++,x.push({index:F+1,amount:W.newLines.length}),z+=W.newLines.length,W=a[++K]}else this.lines.set(L,D[F--]);var G=0;for(L=x.length-1;L>=0;L--)x[L].index+=G,this.lines.onInsertEmitter.fire(x[L]),G+=x[L].amount;var Z=Math.max(0,I+v-this.lines.maxLength);Z>0&&this.lines.onTrimEmitter.fire(Z)}},n.prototype.stringIndexToBufferIndex=function(t,r,i){for(i===void 0&&(i=!1);r;){var a=this.lines.get(t);if(!a)return[-1,-1];for(var v=i?a.getTrimmedLength():a.length,p=0;p<v;++p)if(a.get(p)[S.CHAR_DATA_WIDTH_INDEX]&&(r-=a.get(p)[S.CHAR_DATA_CHAR_INDEX].length||1),r<0)return[t,p];t++}return[t,0]},n.prototype.translateBufferLineToString=function(t,r,i,a){i===void 0&&(i=0);var v=this.lines.get(t);return v?v.translateToString(r,i,a):""},n.prototype.getWrappedRangeForLine=function(t){for(var r=t,i=t;r>0&&this.lines.get(r).isWrapped;)r--;for(;i+1<this.lines.length&&this.lines.get(i+1).isWrapped;)i++;return{first:r,last:i}},n.prototype.setupTabStops=function(t){for(t!=null?this.tabs[t]||(t=this.prevStop(t)):(this.tabs={},t=0);t<this._cols;t+=this._optionsService.options.tabStopWidth)this.tabs[t]=!0},n.prototype.prevStop=function(t){for(t==null&&(t=this.x);!this.tabs[--t]&&t>0;);return t>=this._cols?this._cols-1:t<0?0:t},n.prototype.nextStop=function(t){for(t==null&&(t=this.x);!this.tabs[++t]&&t<this._cols;);return t>=this._cols?this._cols-1:t<0?0:t},n.prototype.addMarker=function(t){var r=this,i=new T.Marker(t);return this.markers.push(i),i.register(this.lines.onTrim(function(a){i.line-=a,i.line<0&&i.dispose()})),i.register(this.lines.onInsert(function(a){i.line>=a.index&&(i.line+=a.amount)})),i.register(this.lines.onDelete(function(a){i.line>=a.index&&i.line<a.index+a.amount&&i.dispose(),i.line>a.index&&(i.line-=a.amount)})),i.register(i.onDispose(function(){return r._removeMarker(i)})),i},n.prototype._removeMarker=function(t){this.markers.splice(this.markers.indexOf(t),1)},n.prototype.iterator=function(t,r,i,a,v){return new s(this,t,r,i,a,v)},n}();M.Buffer=E;var s=function(){function n(t,r,i,a,v,p){i===void 0&&(i=0),a===void 0&&(a=t.lines.length),v===void 0&&(v=0),p===void 0&&(p=0),this._buffer=t,this._trimRight=r,this._startIndex=i,this._endIndex=a,this._startOverscan=v,this._endOverscan=p,this._startIndex<0&&(this._startIndex=0),this._endIndex>this._buffer.lines.length&&(this._endIndex=this._buffer.lines.length),this._current=this._startIndex}return n.prototype.hasNext=function(){return this._current<this._endIndex},n.prototype.next=function(){var t=this._buffer.getWrappedRangeForLine(this._current);t.first<this._startIndex-this._startOverscan&&(t.first=this._startIndex-this._startOverscan),t.last>this._endIndex+this._endOverscan&&(t.last=this._endIndex+this._endOverscan),t.first=Math.max(t.first,0),t.last=Math.min(t.last,this._buffer.lines.length);for(var r="",i=t.first;i<=t.last;++i)r+=this._buffer.translateBufferLineToString(i,this._trimRight);return this._current=t.last+1,{range:t,content:r}},n}();M.BufferStringIterator=s},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.CircularList=void 0;var B=N(0),U=function(){function k(S){this._maxLength=S,this.onDeleteEmitter=new B.EventEmitter,this.onInsertEmitter=new B.EventEmitter,this.onTrimEmitter=new B.EventEmitter,this._array=new Array(this._maxLength),this._startIndex=0,this._length=0}return Object.defineProperty(k.prototype,"onDelete",{get:function(){return this.onDeleteEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onInsert",{get:function(){return this.onInsertEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"onTrim",{get:function(){return this.onTrimEmitter.event},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"maxLength",{get:function(){return this._maxLength},set:function(S){if(this._maxLength!==S){for(var P=new Array(S),T=0;T<Math.min(S,this.length);T++)P[T]=this._array[this._getCyclicIndex(T)];this._array=P,this._maxLength=S,this._startIndex=0}},enumerable:!1,configurable:!0}),Object.defineProperty(k.prototype,"length",{get:function(){return this._length},set:function(S){if(S>this._length)for(var P=this._length;P<S;P++)this._array[P]=void 0;this._length=S},enumerable:!1,configurable:!0}),k.prototype.get=function(S){return this._array[this._getCyclicIndex(S)]},k.prototype.set=function(S,P){this._array[this._getCyclicIndex(S)]=P},k.prototype.push=function(S){this._array[this._getCyclicIndex(this._length)]=S,this._length===this._maxLength?(this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1)):this._length++},k.prototype.recycle=function(){if(this._length!==this._maxLength)throw new Error("Can only recycle when the buffer is full");return this._startIndex=++this._startIndex%this._maxLength,this.onTrimEmitter.fire(1),this._array[this._getCyclicIndex(this._length-1)]},Object.defineProperty(k.prototype,"isFull",{get:function(){return this._length===this._maxLength},enumerable:!1,configurable:!0}),k.prototype.pop=function(){return this._array[this._getCyclicIndex(this._length---1)]},k.prototype.splice=function(S,P){for(var T=[],b=2;b<arguments.length;b++)T[b-2]=arguments[b];if(P){for(var e=S;e<this._length-P;e++)this._array[this._getCyclicIndex(e)]=this._array[this._getCyclicIndex(e+P)];this._length-=P}for(e=this._length-1;e>=S;e--)this._array[this._getCyclicIndex(e+T.length)]=this._array[this._getCyclicIndex(e)];for(e=0;e<T.length;e++)this._array[this._getCyclicIndex(S+e)]=T[e];if(this._length+T.length>this._maxLength){var E=this._length+T.length-this._maxLength;this._startIndex+=E,this._length=this._maxLength,this.onTrimEmitter.fire(E)}else this._length+=T.length},k.prototype.trimStart=function(S){S>this._length&&(S=this._length),this._startIndex+=S,this._length-=S,this.onTrimEmitter.fire(S)},k.prototype.shiftElements=function(S,P,T){if(!(P<=0)){if(S<0||S>=this._length)throw new Error("start argument out of range");if(S+T<0)throw new Error("Cannot shift elements in list beyond index 0");if(T>0){for(var b=P-1;b>=0;b--)this.set(S+b+T,this.get(S+b));var e=S+P+T-this._length;if(e>0)for(this._length+=e;this._length>this._maxLength;)this._length--,this._startIndex++,this.onTrimEmitter.fire(1)}else for(b=0;b<P;b++)this.set(S+b+T,this.get(S+b))}},k.prototype._getCyclicIndex=function(S){return(this._startIndex+S)%this._maxLength},k}();M.CircularList=U},function(re,M,N){"use strict";function B(U,k,S){if(k===U.length-1)return U[k].getTrimmedLength();var P=!U[k].hasContent(S-1)&&U[k].getWidth(S-1)===1,T=U[k+1].getWidth(0)===2;return P&&T?S-1:S}Object.defineProperty(M,"__esModule",{value:!0}),M.getWrappedLineTrimmedLength=M.reflowSmallerGetNewLineLengths=M.reflowLargerApplyNewLayout=M.reflowLargerCreateNewLayout=M.reflowLargerGetLinesToRemove=void 0,M.reflowLargerGetLinesToRemove=function(U,k,S,P,T){for(var b=[],e=0;e<U.length-1;e++){var E=e,s=U.get(++E);if(s.isWrapped){for(var n=[U.get(e)];E<U.length&&s.isWrapped;)n.push(s),s=U.get(++E);if(P>=e&&P<E)e+=n.length-1;else{for(var t=0,r=B(n,t,k),i=1,a=0;i<n.length;){var v=B(n,i,k),p=v-a,l=S-r,o=Math.min(p,l);n[t].copyCellsFrom(n[i],a,r,o,!1),(r+=o)===S&&(t++,r=0),(a+=o)===v&&(i++,a=0),r===0&&t!==0&&n[t-1].getWidth(S-1)===2&&(n[t].copyCellsFrom(n[t-1],S-1,r++,1,!1),n[t-1].setCell(S-1,T))}n[t].replaceCells(r,S,T);for(var u=0,c=n.length-1;c>0&&(c>t||n[c].getTrimmedLength()===0);c--)u++;u>0&&(b.push(e+n.length-u),b.push(u)),e+=n.length-1}}}return b},M.reflowLargerCreateNewLayout=function(U,k){for(var S=[],P=0,T=k[P],b=0,e=0;e<U.length;e++)if(T===e){var E=k[++P];U.onDeleteEmitter.fire({index:e-b,amount:E}),e+=E-1,b+=E,T=k[++P]}else S.push(e);return{layout:S,countRemoved:b}},M.reflowLargerApplyNewLayout=function(U,k){for(var S=[],P=0;P<k.length;P++)S.push(U.get(k[P]));for(P=0;P<S.length;P++)U.set(P,S[P]);U.length=k.length},M.reflowSmallerGetNewLineLengths=function(U,k,S){for(var P=[],T=U.map(function(r,i){return B(U,i,k)}).reduce(function(r,i){return r+i}),b=0,e=0,E=0;E<T;){if(T-E<S){P.push(T-E);break}b+=S;var s=B(U,e,k);b>s&&(b-=s,e++);var n=U[e].getWidth(b-1)===2;n&&b--;var t=n?S-1:S;P.push(t),E+=t}return P},M.getWrappedLineTrimmedLength=B},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(P,T){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(b,e){b.__proto__=e}||function(b,e){for(var E in e)e.hasOwnProperty(E)&&(b[E]=e[E])})(P,T)},function(P,T){function b(){this.constructor=P}B(P,T),P.prototype=T===null?Object.create(T):(b.prototype=T.prototype,new b)});Object.defineProperty(M,"__esModule",{value:!0}),M.Marker=void 0;var k=N(0),S=function(P){function T(b){var e=P.call(this)||this;return e.line=b,e._id=T._nextId++,e.isDisposed=!1,e._onDispose=new k.EventEmitter,e}return U(T,P),Object.defineProperty(T.prototype,"id",{get:function(){return this._id},enumerable:!1,configurable:!0}),Object.defineProperty(T.prototype,"onDispose",{get:function(){return this._onDispose.event},enumerable:!1,configurable:!0}),T.prototype.dispose=function(){this.isDisposed||(this.isDisposed=!0,this.line=-1,this._onDispose.fire())},T._nextId=1,T}(N(2).Disposable);M.Marker=S},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.OptionsService=M.DEFAULT_OPTIONS=M.DEFAULT_BELL_SOUND=void 0;var B=N(0),U=N(11),k=N(33);M.DEFAULT_BELL_SOUND="data:audio/mp3;base64,SUQzBAAAAAAAI1RTU0UAAAAPAAADTGF2ZjU4LjMyLjEwNAAAAAAAAAAAAAAA//tQxAADB8AhSmxhIIEVCSiJrDCQBTcu3UrAIwUdkRgQbFAZC1CQEwTJ9mjRvBA4UOLD8nKVOWfh+UlK3z/177OXrfOdKl7pyn3Xf//WreyTRUoAWgBgkOAGbZHBgG1OF6zM82DWbZaUmMBptgQhGjsyYqc9ae9XFz280948NMBWInljyzsNRFLPWdnZGWrddDsjK1unuSrVN9jJsK8KuQtQCtMBjCEtImISdNKJOopIpBFpNSMbIHCSRpRR5iakjTiyzLhchUUBwCgyKiweBv/7UsQbg8isVNoMPMjAAAA0gAAABEVFGmgqK////9bP/6XCykxBTUUzLjEwMKqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqqq",M.DEFAULT_OPTIONS=Object.freeze({cols:80,rows:24,cursorBlink:!1,cursorStyle:"block",cursorWidth:1,bellSound:M.DEFAULT_BELL_SOUND,bellStyle:"none",drawBoldTextInBrightColors:!0,fastScrollModifier:"alt",fastScrollSensitivity:5,fontFamily:"courier-new, courier, monospace",fontSize:15,fontWeight:"normal",fontWeightBold:"bold",lineHeight:1,linkTooltipHoverDuration:500,letterSpacing:0,logLevel:"info",scrollback:1e3,scrollSensitivity:1,screenReaderMode:!1,macOptionIsMeta:!1,macOptionClickForcesSelection:!1,minimumContrastRatio:1,disableStdin:!1,allowProposedApi:!0,allowTransparency:!1,tabStopWidth:8,theme:{},rightClickSelectsWord:U.isMac,rendererType:"canvas",windowOptions:{},windowsMode:!1,wordSeparator:" ()[]{}',\"`",convertEol:!1,termName:"xterm",cancelEvents:!1});var S=["cols","rows"],P=function(){function T(b){this._onOptionChange=new B.EventEmitter,this.options=k.clone(M.DEFAULT_OPTIONS);for(var e=0,E=Object.keys(b);e<E.length;e++){var s=E[e];if(s in this.options){var n=b[s];this.options[s]=n}}}return Object.defineProperty(T.prototype,"onOptionChange",{get:function(){return this._onOptionChange.event},enumerable:!1,configurable:!0}),T.prototype.setOption=function(b,e){if(!(b in M.DEFAULT_OPTIONS))throw new Error('No option with key "'+b+'"');if(S.indexOf(b)!==-1)throw new Error('Option "'+b+'" can only be set in the constructor');this.options[b]!==e&&(e=this._sanitizeAndValidateOption(b,e),this.options[b]!==e&&(this.options[b]=e,this._onOptionChange.fire(b)))},T.prototype._sanitizeAndValidateOption=function(b,e){switch(b){case"bellStyle":case"cursorStyle":case"fontWeight":case"fontWeightBold":case"rendererType":case"wordSeparator":e||(e=M.DEFAULT_OPTIONS[b]);break;case"cursorWidth":e=Math.floor(e);case"lineHeight":case"tabStopWidth":if(e<1)throw new Error(b+" cannot be less than 1, value: "+e);break;case"minimumContrastRatio":e=Math.max(1,Math.min(21,Math.round(10*e)/10));break;case"scrollback":if((e=Math.min(e,4294967295))<0)throw new Error(b+" cannot be less than 0, value: "+e);break;case"fastScrollSensitivity":case"scrollSensitivity":if(e<=0)throw new Error(b+" cannot be less than or equal to 0, value: "+e)}return e},T.prototype.getOption=function(b){if(!(b in M.DEFAULT_OPTIONS))throw new Error('No option with key "'+b+'"');return this.options[b]},T}();M.OptionsService=P},function(re,M,N){"use strict";var B,U=this&&this.__extends||(B=function(t,r){return(B=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(i,a){i.__proto__=a}||function(i,a){for(var v in a)a.hasOwnProperty(v)&&(i[v]=a[v])})(t,r)},function(t,r){function i(){this.constructor=t}B(t,r),t.prototype=r===null?Object.create(r):(i.prototype=r.prototype,new i)}),k=this&&this.__decorate||function(t,r,i,a){var v,p=arguments.length,l=p<3?r:a===null?a=Object.getOwnPropertyDescriptor(r,i):a;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")l=Reflect.decorate(t,r,i,a);else for(var o=t.length-1;o>=0;o--)(v=t[o])&&(l=(p<3?v(l):p>3?v(r,i,l):v(r,i))||l);return p>3&&l&&Object.defineProperty(r,i,l),l},S=this&&this.__param||function(t,r){return function(i,a){r(i,a,t)}};Object.defineProperty(M,"__esModule",{value:!0}),M.CoreService=void 0;var P=N(1),T=N(0),b=N(33),e=N(2),E=Object.freeze({insertMode:!1}),s=Object.freeze({applicationCursorKeys:!1,applicationKeypad:!1,bracketedPasteMode:!1,origin:!1,reverseWraparound:!1,sendFocus:!1,wraparound:!0}),n=function(t){function r(i,a,v,p){var l=t.call(this)||this;return l._bufferService=a,l._logService=v,l._optionsService=p,l.isCursorInitialized=!1,l.isCursorHidden=!1,l._onData=l.register(new T.EventEmitter),l._onUserInput=l.register(new T.EventEmitter),l._onBinary=l.register(new T.EventEmitter),l._scrollToBottom=i,l.register({dispose:function(){return l._scrollToBottom=void 0}}),l.modes=b.clone(E),l.decPrivateModes=b.clone(s),l}return U(r,t),Object.defineProperty(r.prototype,"onData",{get:function(){return this._onData.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onUserInput",{get:function(){return this._onUserInput.event},enumerable:!1,configurable:!0}),Object.defineProperty(r.prototype,"onBinary",{get:function(){return this._onBinary.event},enumerable:!1,configurable:!0}),r.prototype.reset=function(){this.modes=b.clone(E),this.decPrivateModes=b.clone(s)},r.prototype.triggerDataEvent=function(i,a){if(a===void 0&&(a=!1),!this._optionsService.options.disableStdin){var v=this._bufferService.buffer;v.ybase!==v.ydisp&&this._scrollToBottom(),a&&this._onUserInput.fire(),this._logService.debug('sending data "'+i+'"',function(){return i.split("").map(function(p){return p.charCodeAt(0)})}),this._onData.fire(i)}},r.prototype.triggerBinaryEvent=function(i){this._optionsService.options.disableStdin||(this._logService.debug('sending binary "'+i+'"',function(){return i.split("").map(function(a){return a.charCodeAt(0)})}),this._onBinary.fire(i))},r=k([S(1,P.IBufferService),S(2,P.ILogService),S(3,P.IOptionsService)],r)}(e.Disposable);M.CoreService=n},function(re,M,N){"use strict";var B=this&&this.__decorate||function(s,n,t,r){var i,a=arguments.length,v=a<3?n:r===null?r=Object.getOwnPropertyDescriptor(n,t):r;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")v=Reflect.decorate(s,n,t,r);else for(var p=s.length-1;p>=0;p--)(i=s[p])&&(v=(a<3?i(v):a>3?i(n,t,v):i(n,t))||v);return a>3&&v&&Object.defineProperty(n,t,v),v},U=this&&this.__param||function(s,n){return function(t,r){n(t,r,s)}};Object.defineProperty(M,"__esModule",{value:!0}),M.CoreMouseService=void 0;var k=N(1),S=N(0),P={NONE:{events:0,restrict:function(){return!1}},X10:{events:1,restrict:function(s){return s.button!==4&&s.action===1&&(s.ctrl=!1,s.alt=!1,s.shift=!1,!0)}},VT200:{events:19,restrict:function(s){return s.action!==32}},DRAG:{events:23,restrict:function(s){return s.action!==32||s.button!==3}},ANY:{events:31,restrict:function(s){return!0}}};function T(s,n){var t=(s.ctrl?16:0)|(s.shift?4:0)|(s.alt?8:0);return s.button===4?(t|=64,t|=s.action):(t|=3&s.button,4&s.button&&(t|=64),8&s.button&&(t|=128),s.action===32?t|=32:s.action!==0||n||(t|=3)),t}var b=String.fromCharCode,e={DEFAULT:function(s){var n=[T(s,!1)+32,s.col+32,s.row+32];return n[0]>255||n[1]>255||n[2]>255?"":"\x1B[M"+b(n[0])+b(n[1])+b(n[2])},SGR:function(s){var n=s.action===0&&s.button!==4?"m":"M";return"\x1B[<"+T(s,!0)+";"+s.col+";"+s.row+n}},E=function(){function s(n,t){this._bufferService=n,this._coreService=t,this._protocols={},this._encodings={},this._activeProtocol="",this._activeEncoding="",this._onProtocolChange=new S.EventEmitter,this._lastEvent=null;for(var r=0,i=Object.keys(P);r<i.length;r++){var a=i[r];this.addProtocol(a,P[a])}for(var v=0,p=Object.keys(e);v<p.length;v++){var l=p[v];this.addEncoding(l,e[l])}this.reset()}return s.prototype.addProtocol=function(n,t){this._protocols[n]=t},s.prototype.addEncoding=function(n,t){this._encodings[n]=t},Object.defineProperty(s.prototype,"activeProtocol",{get:function(){return this._activeProtocol},set:function(n){if(!this._protocols[n])throw new Error('unknown protocol "'+n+'"');this._activeProtocol=n,this._onProtocolChange.fire(this._protocols[n].events)},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"areMouseEventsActive",{get:function(){return this._protocols[this._activeProtocol].events!==0},enumerable:!1,configurable:!0}),Object.defineProperty(s.prototype,"activeEncoding",{get:function(){return this._activeEncoding},set:function(n){if(!this._encodings[n])throw new Error('unknown encoding "'+n+'"');this._activeEncoding=n},enumerable:!1,configurable:!0}),s.prototype.reset=function(){this.activeProtocol="NONE",this.activeEncoding="DEFAULT",this._lastEvent=null},Object.defineProperty(s.prototype,"onProtocolChange",{get:function(){return this._onProtocolChange.event},enumerable:!1,configurable:!0}),s.prototype.triggerMouseEvent=function(n){if(n.col<0||n.col>=this._bufferService.cols||n.row<0||n.row>=this._bufferService.rows||n.button===4&&n.action===32||n.button===3&&n.action!==32||n.button!==4&&(n.action===2||n.action===3)||(n.col++,n.row++,n.action===32&&this._lastEvent&&this._compareEvents(this._lastEvent,n))||!this._protocols[this._activeProtocol].restrict(n))return!1;var t=this._encodings[this._activeEncoding](n);return t&&(this._activeEncoding==="DEFAULT"?this._coreService.triggerBinaryEvent(t):this._coreService.triggerDataEvent(t,!0)),this._lastEvent=n,!0},s.prototype.explainEvents=function(n){return{down:!!(1&n),up:!!(2&n),drag:!!(4&n),move:!!(8&n),wheel:!!(16&n)}},s.prototype._compareEvents=function(n,t){return n.col===t.col&&n.row===t.row&&n.button===t.button&&n.action===t.action&&n.ctrl===t.ctrl&&n.alt===t.alt&&n.shift===t.shift},s=B([U(0,k.IBufferService),U(1,k.ICoreService)],s)}();M.CoreMouseService=E},function(re,M,N){"use strict";var B=this&&this.__decorate||function(P,T,b,e){var E,s=arguments.length,n=s<3?T:e===null?e=Object.getOwnPropertyDescriptor(T,b):e;if(typeof Reflect=="object"&&typeof Reflect.decorate=="function")n=Reflect.decorate(P,T,b,e);else for(var t=P.length-1;t>=0;t--)(E=P[t])&&(n=(s<3?E(n):s>3?E(T,b,n):E(T,b))||n);return s>3&&n&&Object.defineProperty(T,b,n),n},U=this&&this.__param||function(P,T){return function(b,e){T(b,e,P)}};Object.defineProperty(M,"__esModule",{value:!0}),M.DirtyRowService=void 0;var k=N(1),S=function(){function P(T){this._bufferService=T,this.clearRange()}return Object.defineProperty(P.prototype,"start",{get:function(){return this._start},enumerable:!1,configurable:!0}),Object.defineProperty(P.prototype,"end",{get:function(){return this._end},enumerable:!1,configurable:!0}),P.prototype.clearRange=function(){this._start=this._bufferService.buffer.y,this._end=this._bufferService.buffer.y},P.prototype.markDirty=function(T){T<this._start?this._start=T:T>this._end&&(this._end=T)},P.prototype.markRangeDirty=function(T,b){if(T>b){var e=T;T=b,b=e}T<this._start&&(this._start=T),b>this._end&&(this._end=b)},P.prototype.markAllDirty=function(){this.markRangeDirty(0,this._bufferService.rows-1)},P=B([U(0,k.IBufferService)],P)}();M.DirtyRowService=S},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.UnicodeService=void 0;var B=N(0),U=N(79),k=function(){function S(){this._providers=Object.create(null),this._active="",this._onChange=new B.EventEmitter;var P=new U.UnicodeV6;this.register(P),this._active=P.version,this._activeProvider=P}return Object.defineProperty(S.prototype,"onChange",{get:function(){return this._onChange.event},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"versions",{get:function(){return Object.keys(this._providers)},enumerable:!1,configurable:!0}),Object.defineProperty(S.prototype,"activeVersion",{get:function(){return this._active},set:function(P){if(!this._providers[P])throw new Error('unknown Unicode version "'+P+'"');this._active=P,this._activeProvider=this._providers[P],this._onChange.fire(P)},enumerable:!1,configurable:!0}),S.prototype.register=function(P){this._providers[P.version]=P},S.prototype.wcwidth=function(P){return this._activeProvider.wcwidth(P)},S.prototype.getStringCellWidth=function(P){for(var T=0,b=P.length,e=0;e<b;++e){var E=P.charCodeAt(e);if(55296<=E&&E<=56319){if(++e>=b)return T+this.wcwidth(E);var s=P.charCodeAt(e);56320<=s&&s<=57343?E=1024*(E-55296)+s-56320+65536:T+=this.wcwidth(s)}T+=this.wcwidth(E)}return T},S}();M.UnicodeService=k},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.UnicodeV6=void 0;var B,U=N(15),k=[[768,879],[1155,1158],[1160,1161],[1425,1469],[1471,1471],[1473,1474],[1476,1477],[1479,1479],[1536,1539],[1552,1557],[1611,1630],[1648,1648],[1750,1764],[1767,1768],[1770,1773],[1807,1807],[1809,1809],[1840,1866],[1958,1968],[2027,2035],[2305,2306],[2364,2364],[2369,2376],[2381,2381],[2385,2388],[2402,2403],[2433,2433],[2492,2492],[2497,2500],[2509,2509],[2530,2531],[2561,2562],[2620,2620],[2625,2626],[2631,2632],[2635,2637],[2672,2673],[2689,2690],[2748,2748],[2753,2757],[2759,2760],[2765,2765],[2786,2787],[2817,2817],[2876,2876],[2879,2879],[2881,2883],[2893,2893],[2902,2902],[2946,2946],[3008,3008],[3021,3021],[3134,3136],[3142,3144],[3146,3149],[3157,3158],[3260,3260],[3263,3263],[3270,3270],[3276,3277],[3298,3299],[3393,3395],[3405,3405],[3530,3530],[3538,3540],[3542,3542],[3633,3633],[3636,3642],[3655,3662],[3761,3761],[3764,3769],[3771,3772],[3784,3789],[3864,3865],[3893,3893],[3895,3895],[3897,3897],[3953,3966],[3968,3972],[3974,3975],[3984,3991],[3993,4028],[4038,4038],[4141,4144],[4146,4146],[4150,4151],[4153,4153],[4184,4185],[4448,4607],[4959,4959],[5906,5908],[5938,5940],[5970,5971],[6002,6003],[6068,6069],[6071,6077],[6086,6086],[6089,6099],[6109,6109],[6155,6157],[6313,6313],[6432,6434],[6439,6440],[6450,6450],[6457,6459],[6679,6680],[6912,6915],[6964,6964],[6966,6970],[6972,6972],[6978,6978],[7019,7027],[7616,7626],[7678,7679],[8203,8207],[8234,8238],[8288,8291],[8298,8303],[8400,8431],[12330,12335],[12441,12442],[43014,43014],[43019,43019],[43045,43046],[64286,64286],[65024,65039],[65056,65059],[65279,65279],[65529,65531]],S=[[68097,68099],[68101,68102],[68108,68111],[68152,68154],[68159,68159],[119143,119145],[119155,119170],[119173,119179],[119210,119213],[119362,119364],[917505,917505],[917536,917631],[917760,917999]],P=function(){function T(){if(this.version="6",!B){B=new Uint8Array(65536),U.fill(B,1),B[0]=0,U.fill(B,0,1,32),U.fill(B,0,127,160),U.fill(B,2,4352,4448),B[9001]=2,B[9002]=2,U.fill(B,2,11904,42192),B[12351]=1,U.fill(B,2,44032,55204),U.fill(B,2,63744,64256),U.fill(B,2,65040,65050),U.fill(B,2,65072,65136),U.fill(B,2,65280,65377),U.fill(B,2,65504,65511);for(var b=0;b<k.length;++b)U.fill(B,0,k[b][0],k[b][1]+1)}}return T.prototype.wcwidth=function(b){return b<32?0:b<127?1:b<65536?B[b]:function(e,E){var s,n=0,t=E.length-1;if(e<E[0][0]||e>E[t][1])return!1;for(;t>=n;)if(e>E[s=n+t>>1][1])n=s+1;else{if(!(e<E[s][0]))return!0;t=s-1}return!1}(b,S)?0:b>=131072&&b<=196605||b>=196608&&b<=262141?2:1},T}();M.UnicodeV6=P},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.CharsetService=void 0;var B=function(){function U(){this.glevel=0,this._charsets=[]}return U.prototype.reset=function(){this.charset=void 0,this._charsets=[],this.glevel=0},U.prototype.setgLevel=function(k){this.glevel=k,this.charset=this._charsets[k]},U.prototype.setgCharset=function(k,S){this._charsets[k]=S,this.glevel===k&&(this.charset=S)},U}();M.CharsetService=B},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.updateWindowsModeWrappedState=void 0;var B=N(3);M.updateWindowsModeWrappedState=function(U){var k=U.buffer.lines.get(U.buffer.ybase+U.buffer.y-1),S=k==null?void 0:k.get(U.cols-1),P=U.buffer.lines.get(U.buffer.ybase+U.buffer.y);P&&S&&(P.isWrapped=S[B.CHAR_DATA_CODE_INDEX]!==B.NULL_CELL_CODE&&S[B.CHAR_DATA_CODE_INDEX]!==B.WHITESPACE_CELL_CODE)}},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.WriteBuffer=void 0;var B=function(){function U(k){this._action=k,this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0}return U.prototype.writeSync=function(k){if(this._writeBuffer.length){for(var S=this._bufferOffset;S<this._writeBuffer.length;++S){var P=this._writeBuffer[S],T=this._callbacks[S];this._action(P),T&&T()}this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=2147483647}this._action(k)},U.prototype.write=function(k,S){var P=this;if(this._pendingData>5e7)throw new Error("write data discarded, use flow control to avoid losing data");this._writeBuffer.length||(this._bufferOffset=0,setTimeout(function(){return P._innerWrite()})),this._pendingData+=k.length,this._writeBuffer.push(k),this._callbacks.push(S)},U.prototype._innerWrite=function(){for(var k=this,S=Date.now();this._writeBuffer.length>this._bufferOffset;){var P=this._writeBuffer[this._bufferOffset],T=this._callbacks[this._bufferOffset];if(this._bufferOffset++,this._action(P),this._pendingData-=P.length,T&&T(),Date.now()-S>=12)break}this._writeBuffer.length>this._bufferOffset?(this._bufferOffset>50&&(this._writeBuffer=this._writeBuffer.slice(this._bufferOffset),this._callbacks=this._callbacks.slice(this._bufferOffset),this._bufferOffset=0),setTimeout(function(){return k._innerWrite()},0)):(this._writeBuffer=[],this._callbacks=[],this._pendingData=0,this._bufferOffset=0)},U}();M.WriteBuffer=B},function(re,M,N){"use strict";Object.defineProperty(M,"__esModule",{value:!0}),M.AddonManager=void 0;var B=function(){function U(){this._addons=[]}return U.prototype.dispose=function(){for(var k=this._addons.length-1;k>=0;k--)this._addons[k].instance.dispose()},U.prototype.loadAddon=function(k,S){var P=this,T={instance:S,dispose:S.dispose,isDisposed:!1};this._addons.push(T),S.dispose=function(){return P._wrappedAddonDispose(T)},S.activate(k)},U.prototype._wrappedAddonDispose=function(k){if(!k.isDisposed){for(var S=-1,P=0;P<this._addons.length;P++)if(this._addons[P]===k){S=P;break}if(S===-1)throw new Error("Could not dispose an addon that has not been loaded");k.isDisposed=!0,k.dispose.apply(k.instance),this._addons.splice(S,1)}},U}();M.AddonManager=B}])})},4977:function(Ge){"use strict";Ge.exports="data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAMwAAACaCAYAAADl9acYAAAAAXNSR0IArs4c6QAAIABJREFUeF7tXQd4U1Ubfs/NaJtO9kzLahFQEJkiUBBFUFFkCCjiAAVFERT5FREQQQXBBcpysWRP2RtkKRsEOphNodCZdDfjnv85CU2TZt2bhABNDw9PmtzvrO+c957xLQIP0pkz1yrQIEmwwcDzHhTj91klEo7jpcG5zetWUJdmRjmPvTM9GI9JgSGvadOoLE9KJJ5kPp2YXLtZdO1kT8ooz2vigCNelvPYezPEG7z0CDAn4pJqPvJA5A3vdcl/S3LEy3Iee29OeIOX5YDx3nh4VFI5YDxin6DM5YARxKb7g6gcMHd+nMoBc+d57LKGhCQ1ZURBCoVL2nKCO8sBZWW50x1TOWDuLP8FlV4OGEFs8glROWB8wmbPKikHjGf882bucsB4k5t3qKxywNwhxrpRbJkGTOx0ehlA3d9e5VEtzA3ulGe55zmg1QOfrCVo34BgQGvr5rLDRl4RRZG+5NjBESBc4FHw1LlrCAuPsCo0JjKi7J5hYqfTXADBq4byCJLf82Nf3kA3OfD9LgKdgeCzZ4CUTJ1VKQFyKQgpmeMSjiKvQC+oplspN/wOMDcBVFv0Bo+KwYJ4VE50H3Jg7j6CWzkEX74A3MrSgTfeKZpSaBCHcAVn/JunBHlFPDR5BkG9LMjPt7mZLOtbskQADea9wqOW9coqiGHlRPcHBxYcJriQQvB9P+v2cqCwWFxgoOJk6JeTNX4HmJMAHv6xP4/6VXw/+OxNx/bM/pIohdUE9VW/VxwjOHiJYO5A6xolpGSpYW3jIW4w/A8wM+h+UHSY2pvHgzV9NXymeor0wPc7Cf7XzWJ/4Nsm+Ly2LzZx+OwZ3yuVbzhNsPEMwcI3rM8wMikHiURi5gNbbQoKrc84zpjkj2eYzQC6f96DomUd305ctrp8tp5gSk/f1utzlFhUOHYthy9f8D1gdpwnWHiEYOVQ6zNM6QM/AY+CImHnF9YtfwTMCgB9P+5G0SHa9xP3bk2gT9cBU3r6Hjp95nBYNcz3gDlwkRhX843vlfS59PmFHfjFzgC/2pJ1nEEnEIpIAG+834Wia2Ox7PJ8wt0twLz7J8Gsl3zf316zCVYPsz5oe85F1yUcu0YwcQPBjlElZyjL8wsrQeyBn+XxK8DETqefgyACFCPe6kjxfDPfT6C7BpilBLMG+L6/A34h+P1VikCZ60nuTYpzN4AxqznjCqPOMZ1RSp9f2OVLYZH1lbOrNvjVlswIGEAKYOyrj1K82NL3E+huAWbEMnbFSn1+Qzd4AcE3fajPZV6X04D3lnHGM4xOawKFJwLLYiD5H2AoCkHwJQMLA42v090CzJjVBBN7UCh8rN3AgDrqCYq6lX3L6RQ1MGQRhwWvA7UrALbnFzCJjOhG+d2WjFCkUYKZPZpSDIv1PWDGrycY34NCahI0+yxN/Ivg3c4UlUN8VqWxok/XEfRrSdG0tm/rzcoHBv7KYc5AILqqLWDcOb/45RmGEFyhFL8/0Yga33y+Tl9uJhjxOEVIoG9rnrqVKSJSRFb0fb3tG1A81sC39TLRSu85HL57Eaii0Bm3oqEKqZXSJaUURUxTU0Tyuy0ZAc5SYCUbxE+6+x4w3+0kGNiWooqP3/Qz9xB0bUTRsLqI2eEFUlbvA9WBJxv5ltdMit9jFocpLwB1InQIkBEQTmLUHStOBoMBOr24K2+/AwwPHOKArS2iKCY9VzKIg34jyMgTv6f1wpwqL8JLHKgUTLHwjZIxZTKg0V2Bzg2tLzvYBYA75xe/25J1mkEnGAzYyXE40KQmMK23uLeLN8b1j0ME7epTxFTzRmnCy/jzXyCqIny+NVryDzFeKfd+xLcrDOMMO8MMfgx45iFrOZA7AstiTvvVoZ91usM3tClHcLpeZWDmAN8DZtlRgkY1KJr5+BC87hQQLAeebCwcZN6gXH6MgG2P+rfyDmD+WLoV8xZugkIRiNh2TTHghcfRoF4tFBZpkXgpGQ81rmdu9puLOLzwMPBYPR1Cgzw/v7CC/WpLxjrc/jtaT2LApRrhwC+DfA+Y9aeI0dKzbT3vTCChk3r7eaBABzzfTGgO79CtPUmM9b7U2jv9bf3kOyjSlihLcoSg93MdkZ2Th227j2Hoq8/inTeeNzZ+xFIOsTHAsw/pAeL5+cUvAdPuG1pVRnArQgEsGex7wGw7RxAgBTo19M4EEjqtD1wEkrPYm15oDu/QbfkPSM0hHsu8du0/gSnfLkFGVrbThjFLynULJ6FOZHUw2RNbyd/qUJLFHZV+ywr9aksWO4Ou0BK8KueRz/bVq++CUuD+RGbhB3R/0LeAOZEEnFIRvPGYb+vdGw+cvU7w3uOe1dv+mfeRk5svCMUfvz8AA3o9jgkbCJQVgPe7lGTz5MDvj4f+VXs/JH1ip1PmAkHy17u8z42bjl4lxjf9C809m0CCZo4FUVwKsDPOJLz0ZTp6Fdh6jtnWe1bvuCm/4q/tRwQ1/b03e2LIwGfw1RaCkADg425AOvPkYCHZd0cG43dbsk4zaDFgWHiHcG85wjBQoEhnMhAzf5r/Jihkf9/+fjXDtDXqGA108+Eqcy0DYAfwMU95NnEFzVgLovibwK8HCab19qze61s24Pf5K7A5KwB5vHM1CblMij9m/Q87rtc1jsek54CMPIBayGD0BgP0ImUw/gwYFiqjllhHGAcvAkuPcijU8cgv0KGgSGv8LNJqweu1MOh14A3ss+S78W+Dzuo3RsPoTy0YgIjQALFz0C36tBzg570EE3p4NnHFVn5TA0zaSPDzy57Vu2bIS6jF67BDHYBHgnVI0kow+6ZjLyZNm9RD+35jkZINfNO7ZIVhEn+e16NQ6157/OqWjJ1h9n1IXoydTi8AeGD+KzxqinCEsfkswfBJC2HQacXOG7v0B+e9CGXVUK+U5aoQdm5iE3eqh296R/XoDEBu0e3/hcz3FzF+Z292trI91Zgav7N2tKrDrrfFTdgTI4dAl61BipZDDXYINRCMvBrusNvBikAMHT8LTM3/pwElK4xMAuQV6uBuKK4yA5hEVfY8SvmmHCETGyjDtzqbQLHf0KMgaCnWEcaW/whGT1mAHHZP6oW09bueaFy3khdKcl0EO+y+v4xgphs2MWxbs+K46bLCDIoi6+9iVLKY4PbTp8UB5t8h/UB53qimz1aJA9lyLExz7H1vyMCnUa15L/x9EfhtkIk/nh74y9ShPz5JnUGA26qFZIdcTofWqR5xxd5Uip1O9wDoJNYRxs4LBB9PXYxUdaHrGSqAYuWUp9GmSQ0BlN4h8cTq8qVfOGgKStpBeAoJb4DEYPrPsU89b/5e/LvEYPubLCIQX06NEtWpfwa/yA4h0FEgqVCK71OCUeTARdLLfbpg9PAXsfGsBBtOA0uHmKpyV0PZsqFl5lo5QaXWgRqNw4pTHiEYGa2M+KX0yMROpxsA9BDrCGNvAsG4GcuQdMt45eJx+nXsk3iyNbOY9k161wOry8/GqZCr1t4GBA/O3T0Nm7gSDl/89IBRHiU0nRk3CgU3knEmT4pZN51rrjI5TN2oGmCOMP44BKx7B8jINemP8ZRCK2Y5LNXAMrMlS0hSpwKw9TRGME+XHf5ekybEfPCInU7/BDBArCOMw5cIPvt+JRJUGqHj7JRu2rsd0P+JGBuanELTTVpwwO3/cnjFxNcTwMz95hquxud5pd+skIEfR6NJA+F2y6o1S3Fj4xpj/X9lBmK7OsDuChMUKMf+v36AXC4Fc4QxYwew/X0gM8/k5VKvN0BvcF9gfc8CJuGWuh4twgoQnJSBzK+nDP+3eLTsBahJSNL8DdD29kaUAFsDSU4vpVJp3FTETqdzAbwl1hHGySSCCTPX41RimlcmzthBrTCsV1Obss5cJ2hWXQupTIoiHUW+1nRYZkcn5kRbTzlIOQq5hBmimfRu2RwoeU4gl5rAFiI3Odpmb/NRK0zXu+zgKzZtWZWK/VvTxWZzSP/EK5HoEivcxsFQWIBzk8caVxmWmMT+g6thNlfMg/p1xYfv9DXSMEcYEzYAu247wnBXQ9myE/fslixRpf6FUgw2N5bgDChmk6Lw33MMqkqlg8JeVKmn8hRjHI0QIdgbiJynGWhiZ9AZoPhgaEeK50Q4wmDCvwmzt+HwGe8EcH67V1N8MshWV4UBpnlNLQID3Lcn5nkKrZ6iUEex4azEqC08di0BW1XDgsTP+2NHsrH6F+/0m9Xetns1PN9b3IWHPi8XyetXIOPoEeg1WbhYKMGK9CCoiiSoWq0SnuvWzqhLVuyoz+wI411mmi3epZI9Lt2zgElIUht9INtpdDJPMUsSGf59NCFFxc8TknI6AoZ9LqbCmj+V4X33zMAEAOMHtaXoJ0KLVpUJjJuzD3v+vSh+xtnJ0ffxaMwY0dHuCtO8pg6BAcK3LI4axCTai/4hRsBM3kww5DGK6o5vYx32S52pw9QxbEi8k6o2DMeoj2q5VVhqNnB29JsI0TP5M6Dj5Gg7dwmkpVZOsyOMtyg4joDyBhRq3d+Osbru3S2ZSp0LCmf+9ZM5CUY3qBWx3LREUy5RpbkKQOl0FAimvrksPAME08Q6wmD74DGz/8H2A/+5NdClM8U2r4VFE7rZBcwjtXQIkHsOGLbSLP7XBJhvdxD0fJiinhs+pVk5n41IBM/UFryQSHggvpxRooovpsgdFwjoD8MQri3ZIso/XYzm9a2FwDfUAFPxX/AaRYSCeCR/KW7fvQuYJE0RQF3vSQh2UQn3bsOaYXEJSZrPADrJBfP5BceCVx+4LO0r1hGG3gC8//Np/LXrmJjxdUhbv1YE9vzU22eAmbOPBRmieNCNFzvP8/jhaxVSL3vn4M9zBJN/bgSZgJsyplZ0KQ24oSZgq8vmE4V4+9hrkNIS8O5uPhbNOz+CprWpWRhd7Ahj9svMYM871rT38pbM/q2XvelHoeU4bpxBgt+Jjr8MAqfi80NXZEW/H1UEuOMIY/zCRPyxZr9XABMSJMP5pbelahYlsjNMi1p6402Pp8lyhWEhIBpVp2hdV1yp6nwgPAhYvzQF/+zOEpfZCfXgz6LRIMrxKsq0B5YcKsL6UxRFvBygelBdLjhZGMCx/RfTKWMCUGZzbAClvJEmtiGH97oEGLdhzBHGjL4UDyvLOmBUmn9AaamAay7GimAXgdErzG1RlX36k9el+PlgsPFtK9YRxtwtNzBl7havTZoLywYhuJRbSCNgauvBlAg9TQYDjyVHOeOWbOVxoEoo0Mn2JttpNZvOcmhfn0KTXoTr8TlITSnCrRSt8TMvV7gj79KVPDskCo+1tb/rZkLScavzcTlTARBrZUu+MB1coHNHZ8rQXEzvH4T+8yWY9DzQrj6QptFDzzRlPUj37JbM5pZMeCfZK5CNgsPt3PlbEny3LwSlHWEIqWLzcTWGfbFaCKkgml0zeyNaaa3QdqcAs+msSa2k+4OCmmYm2nyWQ98W9idabo4eqSla3EopMn6m3mRgKkJ6KlM6dV5Plz418ES3CjZE7Ar9w2X5UGXbv3bmC1NBAiqBEOf34zFhKlzLq40PuxK0i8qFutBzRdd7FjDx1zSDCKELxA2tmZoyyztqqc9tUdDlDAm+2hUCdxxhHIwrwOAJy5EvIkSCsz78Nq4rnmhpfU/BANOytgEydwQmpSpjQro/b68we+JNArzej4jjKouz0q+luDwGAzWCxnI1Kr0qPfpEZTzXv6pVwUzf6+MVBTiX6vi+hxoKQfUF4AJswWZZGF+UCUN2IsYMaINnbcVd4jp0m/qePcNcvJlTldcaUm5vVN3qnKNM1zUcJm4LhTuOMP65qMWYGWtxJcU76jGT3nwUrz1j7ZnCCBilAbLS96RucIFJtv88ZpLD/HMZSEgFXmkrrqANp2yjEYsroYRar6f44I3zxh9qNwnH8FHWNxBLj2ix6F85SKltmGV9lBrAF6RConCuh8fotCn7MSC2Fob3ELkPddDBexYwrL2JSZqtFPQpdwfHUT7mf+zjTWFwxxHG8St6zPhtCw6cZXcSnqdhLzTF2FethZcMMK2UBki9DBgmbz18mYAJbMUk5shiYBsxORzT5ucZ8PHbcUaC4OpBGDe55AbiShqP9/40gHLOt058UZbxXMPJnQuUKK+DLi8DEs0R/PJBLIIVwjULHPXgnt2SsQbHq7JeIJSYFIi8mNgeeeT6cFRQAItFOsL4L5li0do9WLrLriK06FZ2e7QO5v3PwugcgDcBo9MbsPT2CnMxFcYwdiNFuMhlKjcs/J23AMMEoONHJhj5JA2T44tvS2TTo5cX4kKqY5X9YuYacq9CEhzlMngmr8uGQasFLUpDPcUV/DCiKwrcNBwrrvueBsyKFVTSvG32aQraRPRMdJKBWaa+vSrcqNAo1hEGsyD8Y/1R/LzmjFea1EBZAbtn9rIqywiYSB5Siecey3U6A5YeN23JmCCPORIcK8IWhV0ps1Wpj8hzjyPmsDPN5P+ZNCWInMOXPz9g/PtgohZfbpEZ3SE5TxSGXBUkIa61vPnCDLCzFEuGrOMY1q02Xunq2VS6p7dkrKOJ17N7UAPP1PG9moatCoOBJ9go0hEGe+P+vC4e3yw84JX2VAoLxMmFL9sApnUkD4kXAKPV6bHsuNQIGDb5p28nmCwixmZSJnA5jeCZh1x3NzfpKi7M/xlFGRmo0qoNqnfohPAG1mcH1dUCfDP+sqkwjuCreY2Mf478swiJGa6V3Az518EFVgHhXMu0DYUZ4G8Dhuqy0Sg0EfM+8myHf88DhjEzIUmzAaA9XA+ZcIqR60KRp+XgjiOM3Sdu4s0vtyAkSIrgQCmCg6QIYZ+BMuPf7Dfzs9vP2bPi34ICZTh2szJ6NM41HuyrV7f2G8tWmNZRPCSc5yuMJWCYGcjHawm+7Sv8DPPfdSBfS9C5oWveHhg+GFqNyfRBEhgIeWgY2kz7AZysRDh5KT4fP0y5vZ0lwBdzGoO9FwbOK4S6KMDpCkP1eaD6fCNghCSDNhe8zmTsVznrMD59XIGa7Wx194SUVUxzT2/JihuZmJJThWoNZ0HgNY/EH28MRUY+B7GOMFibcrJzkJuXB3Z1zXHc7U9ivNlh0mX2aXpm/7ekLA57E6R44zHm5slWAs0A0ybKpDDoaWLhHJafMK0wLIm1ujx0iYD56WgrQO3ryuplSN6xzajkqM83+RCr1aUrol95A5zUJIT971QO5n2bZPybXYRNntsYvx4guLJrL1qkbsD2moOQHP6wlUskRkt5PfiCm5AEC/exa9DmgNcVoVL2KQy59RsqhAQg6tPvwAU5U1F0zvH7AjCsC4mqnE6UGpitvsfSJ0IIHb8lmNzIlkCsIwxPJzDLf10NrDtJMNyBjzDvAkaH5SdkbgOGOf5oVAN4sKawnl+YOwspf+81EzPIh9VvgCbvfoDAKlVx9JAai+ZcNz4PVBBE9W+M07uPo9/laeBgknSeC22ObbVeQ06QCRzselivuQhZBNveCX+JGAoyEZEThyE3fkIYNa00yh69UPdF6y2wsJ6ZqO6LLZl5pUlW9wHFMkrh6mTokgdf7QzG5UwpxDrCcFmwAAImPPztIMHorva3RkbA1GEhGoRPDkfVMj/EVoARaabM2vliCxj9QQtJ1GDAtU3rcGPXDmjVWWDfWWJbtHp9BiCwRScU6KQICJRg4VEp4g8ex4tXvrFSpGT0JxXNsKraIEgVFaHLuQ5ZSE1wAeLsEioRFZ5PnAVlTok5hiQwCG1+mAupwr1V5r4CDGNkgkrzEij93Znqi5CB/XafAhduySDWEYaQsl3RFGiB6Tsce4NkgGlbx+WtqatqjM9ZlOAVJ0tWmPeWEvzYX3gYcOY9cuKzsLE1EVK5oagQJ7/4DDlXS67gZTVqI6dlXxwNaIXrJ06j75UZkFhoHbNyK7Zqh2E3usHAlCupDgFhtSAJEmdsxsqJqZSHevmJaHPoC6vm1nvpNdTu7t6R+L4DjAk06t7M+tKuDb+QkQTw00EFTl2XQawjDIHFOyVj6h+frSeY4uC2it1MRVXgIeUIpBLTWcjdxMJArDgpN2/JPlpF8PlzwoPDjl9v0vZ1N2k1apz+ehJyVaZzS3HimUMKIoWUWrusqtDqUTR46308/bUKekghU1QBkbq+PbPXPkNuEog8DAOS5+ABzVEzSWj9GDSf+JVbXbovAcNs+oODFYSjsp8oqCm2gcj06z9BOHJNbjTZ7RDt/oQQWa2ZXEw0ZWY1yYzYGdCYuj5L7AJNwgBlvHRgj3mjnfvtx0YlS/Zcp9dj6wU5nmpiysccdLMYm5UECr3HruHwQ3/P+KPLzcWZ6VOQfdG5xWbVzl0R9fJgEI7DjO0Eu85rQSTuH1lbV45HbmYSzl1OR+2im4g0ZEJpyETdAC26zpnv1tDdt4AptulPNJ1rplMKUY6uFh8PxL5LARDrCMMtLtvJJAYw3qqTlcOCw7JYLUoBwWHZWWvBIYJxz3jeAiZxv7R0AZJ3bIetdT1B7T4voebTPc0VMbe2G08Wur26sII+6JyD5x4JQU6+FkfOp+DA2es4fO4GsvO1qFk5BE3qVEaTupWNn9G1K0AmILT1fQ8YxhhKqfTi9ewBoPQjSiFAxAasOh2AbfGBRr0qMY4wPJ86phLuFmBm7ibo2oSioYAL+uPXgKvpBIMe9VavgctnE5C7fyuyz58Bc2oRVKMWaj7XBxVbWGuELjxMsOxIAYjUtaqMo9Z90CkHz7WwXkoNPMXZy2k4ePYGDvx3HVdSTHIjBqCVn7verJQJwBQzjKnzJyRlPcZJuJ6UxwsAHEoP/joXgA3nAiHWEYa3ps7dAgyTeTwSRdHcuecDYzdXHCN4oBrwaH3v9Fqr55GWmY2ICNe3XWtOEvyy17MVZmRsLnq2dH4bdv5qBt6Ytg3d29TDOAFvhjIFmNLDGp+c1UxCycs8xTu3jcrMJDvi5VhxOghiHWF4Z+rcvRXGGBy2EvCYABB8sZHggycpqoa6f+lgya/MXC20RUUIDXV9gGJueb/d5tkZ5r0OOejd2nldm/+5gkkLDuOzQe3QrY1r2+0yDZjiwbp4PUNJeelKSqlZSX3/ZRkWHVNArCMMbwFm/AaC8c9Qt65rPWkDCw7Lggw9YVLhcprWnCCoH5qKGmHUaC4tl8sgl0kgl7FPqWhdt6upuQiWc1AoXN96MSd849ez62/31YPeeSwHL7Z1DpixvxzA7hNJWP9lL1RmjgtcJL8ADOOBSkWDCqiGaQoYlYn+TZJh/hEF3HGE4YqpQp7/sC0PrzRPhYxPg9yQjmCkoTA/HUV5aZDq0wBZBQQ0my6kKFE028/BGODpOYHBYfPy8qDT6aDT6Y2flolpUxeDhznscAWkfxKzEFNDAbncteIk8xIzYinxSBj1VrtcvPSo4y0Zs0Z96qPVqFpBgcXjnhXEx/saMCZfZNmTQCjTmZCAEC0oUglPU3iOnDEYtCcb16nCrDaN6ZxKU1HK0xOEIOrMDSlmHnDPEYZLzhoKAW0aivLSQXRpCKRp4HTpKMxNAy1KN36XE+cRAHjKIb/pckhk7h967bXz70STao47wWHZ9bZebwJOMYDY38Zrb4vEtKwZeAKMq5IJSDKZFOuPpqFr8yqCNBjYDd3AXwwgnPu+2Qa3zccrjzleNY7G3cR7P+7G8+2jMWaAMH8r9zVg4pKynudA1jmawExnjKf8fwRkAwF+j46MuJSoyupEKdkdnyoh0/e65wjDUX1c3MdA3hUEEO+YL6fU+BwRNUQa07tAM7v5OpNM8LoXg8PqDXrotHrojUDSQafXgXmrKZ3i0uV4vKkwiT2TJ/WcqYWBBLp8PzkieK1NIV5r71iO8/2qE1i2O8542GeHfiHpvgbMRVX2RzzlpwnpKCGEOa76i5dynxCeTriaTvpP2RnqliMMhwC9MBaBBaeFNEcQTU7FvpDWeU0QrVCiCynA7jjHip9Cy3FFxxz/mVYi0//sPD2u5wWgXUOBSmkAXvtVj7R819s3R215ta0Orz/m2FVVnwkbkJyWa7xOZtfKQtJ9DZiEpKzXAfKbkI6W0JAiQrDyZjZ5adyWUM4dRxiO6qOqRVCkLRPXHCfUt2gjhLXw7jmGBYdl18Uf+Tg47K4LBCz0uZh6P1oJnL/p/qH/5dYGvNnBfv5rN7PRb9JGVAoLwoavrC1enQ3gfQ2YC1ey6kil3CV2lhE7S7MKuMIxf4UGuuMIw1FdhszjCLk6XmxTHNLrqRT5TVdAJnNfPaR04cbgsPsIJjzrmbqL2E4evgxsPy+uXubM7+Vfmbss9661X2lDMdhuABRgyc4LmLnmJGKbKfHlW8KNyu5rwLBBS0zSbKBuWGOyWCoj1rrnCMPRZNEX5SLk3ACmVih2PjmkV9WYiso1RHrec1I7i1HJ5Ct3Kjiso6rPXgeY9P6bPsKB2uSRWKSlZbjNy3FjhuOTD5kIzja9891OnEhMxVs9muHVbsL5e98DJu5ydkNOxh934enfhmPsUDl0ZRgCZUS0IwyHWzJmqPPfcATorrk9yKUzZld5DTKlKUCQNxLr98jlJhV/X6ZrmcBXmwnmDBReb2R0CxQWmiOaiG5uj+5dsOyPH23yMd2ybmNWg6nJfDv8cbRpLDzO6H0PGMaN2zYyi8Q6/Ru+Ogw6A8FfIh1hOBs5evE7KLJ3ih5cRxluSR5FWLNxXiuPFeRJ6D53G5KWC3y4gmDhG8IAw7Ssa9Vlpsrup8jaNXHh+A6bAnYcu4bPfjto/H3z1D4IZ5JcgalMAIb1NVGlHkwpmQ1QwRf3H6wPRU6Re44wHPHXcGMTQm7+LJD9rsnU+soIaO2ux1z75Yu163fdStcUuYXA6wsIVg4VBpjMLDUeaOrgAOK6OjNFcvwhVCiluzbh90PYdvQqqlcMxuovSjSkhRRbZgDDOnsxOaczpYaFlEKQp4Sxm0KQlidxyxGGI+Zqs+IRfuUDIbwXTJMWsxghIc79CAsu7C6Ndg0lAAAdVklEQVStMEws88Jsgg3DhQEmSXUdLdt55hLJuIKs/g2x7UvcdrJtWPcxq40q/h2bKfGViAM/K69MAYZ16NKlzHCDlHwBwr0FUKdr7efbQpCs8a4jjMKCfITHDQRH3d97l578qmqTUblWczGYcErLzjDT+/hej63HLA5r32YOCl135dyFeHTuahtsynVOa4qvPv8II4aVyLJOXUzFsG9NW+bXuz+EISK9lJc5wBSz69KNzEheLxlFQVnEIrvmUlN3B+NiuncdYWi1OsjjP0KQznvxIDVVh0Bem1kreCcZg8N2pwhzX4juVkN6zebwx+u8oHr/OXoCPXrZBpsSW/GAvj3wy6yvzdl+WnsKi3aYnKFPHtIBnZu79qBpWWeZBUxxJ69coYE6ae4zlOqfIyBPM59uxc++36/AuZvedYTBJNz6+OkIL3AVn1b40N8K6oawRu8Jz+CCcvImgiEdKKoLF7p7pe4B8zl8148XVO+uPQcwYNAwj+tt0iga/+4t0Z4a8MUms9HY0vE9ECnUHc7tlpR5wFhyfA+l0lqq7L4A/QlAhTmHgnA8We51Rxh5FxejcvZSjwe7uIAk/cOo0nqK18qbsYPghebUGO7Dl+n1Pzh89iwvqN71G7fhzbc/9Lh5LALCzr+PQVMkR2w0Na4u566m49J1tVElRqyDEb8CTDH3LyblPMhTw67fjwZVPXTV+44wspP2oVq6IBU3QRPiprYWwtvOE0QrhGj2PoKO0dSoR+fL9O5SDm/H8oLq/XP5Gowc7R2tic9/XIlNyU2wY5RH1gJGVvklYFjHL6k0Ty85EbhxV6KceNsRRuatS6h1fYTX5mK+IQR5TZcbDb+8kVhw2MY1KFrV8UZpwsv4ZC3BCw8LC0o7/7fF+HRCydnDWS1FOSmQh1S363aX5XtlxGTEBfbCxveAIMFCB/s1+i1gGDsGL9Cvvpgm6eVtRxgZGZmomTQYHNUKn01OKHlIcEG5AfWE+eB2WefKY0DVMCDWO0G5XNZXTMDOTu3qUzxuinDhNH0/cx6+nGYrpS+diflxLkhPgFRRGfIQ+wzq9OxA5DUei5VDgYruObw0V+vXgOn8LR3L85jibUcY6iw1KiV9CLnhpqt5Ieg5DxkOV16PRyKFyTBcFbrxDPNZJj44rKtyXT1nvsYaVqeC4k1OmfoDfpjl2ncYb9CiMOOS0edyUOVoEGM4cuvUuGkrBHdbgIVvALWs4++6arLNc78GTOx0yq6efvS2I4zs7ByEJY1HkNYUactZ4kkg9FwE9JIKMEgijH8bjN/Z36bftCQcudLaeKC6q9KEPd8dB2Tliw8OK6x0x1Q/7SWoGkrRt4XrksZN/Brzfl3skpB59S9IN13hy0KrQxZkK+ANCQ1Do7ePYO5AoIF1DFqX5Zcm8G/AfENfB8Fv3naEkZubi6CkbxCou2yc9CZARJgBwcCRVlgZV3KC0aSmAhwnQYBcYowHI5FIwIN9MjPfkt/shcUQPdq3Mxy5DLDwfQNFBod1t77ifMyxuVxCBdX7wZgJWLzUdXh3Zh7NtmSgPCQBIQgIt+8/qtmw3fj5zep4yDoGregu+TVgOk2nTNl8pbcdYeTnFyA9U2MMDhQYIIFcwoGTSGCgnHHLECTnIJVIMG2H1BjywtcCRBYc9shlgrdEBocVPbtKZVjyDwGLLyqk3mHvjsGa9ZtdV0k4FGZdBa/NM/JbUcX+wSy692z8PDoWAjwpOa3TvwEzjXajHLa0b0DxSXfvnA9cj3AJxfe7TG5bq4aKyeU5bWIqsOkswcguvu3zyuPE6IBDSL2DBr+Hrdv3uOxshVqNkZqwH7q8NCNtYKUG4CS2V2G1OozE7ClvoZOHFx3+DZjptD0F/m4RRTHpOd9OHja4c/cRdHuQGh3r+TKxScuMuXz9kmDRmM/dgKB6+wwYgv0HjrhkS6+Bb2PlbzNQpDbZILEtGdualU4VH3gaX0/92ii89HZSVpY7NQllzvOLfYG7W7d7Nqe3a/NGA1hR7WfQZhKKU0yAN62396wkhTKFyUPa1qVo6KXDvNB62YH/2x0EXzzv/cnjrA07zhPsT4SgepkeGdMnc5V++nE6Phz/PTITmEIlhSykOmQK24M/W3mmzV2Lpxp7f5z9BjCPT6P1DRwuetMRhqsBtnzOnFHEVAMeVvp24hbpmata4lHcFzH9LKZl8TJXn4Cgep98+kWcPmtSknSWVi/7BZNmrsc/G2eC1xVAqqgEeYjtVRjhpPji1wN49qE7x+uYyAi7C4E3XvA+XWFU6Vo1ABsP2MzJwvDlMnjTEYarAbZ8zrYoVUKBR+vduUF01J67YUR2OhmYs49g9suu+9uhy/OIT2DyFedpz/bVWLXtFL77/F3o8zMhCQxHQJh9nZ/RU5diYJc7p95QZgCTnKHLppTaHK3Zm3bwYhkqKIDFg72/VLsabLZFYbYhnRu6nkCuyhL7/G4AJuEWwKT9QsyUWz3WDdeSkl1268zR3ThwLgtDBzyFIo0KnDwYgRH2VfYrP/jCzKTdX3pPZ8ll60wE990Kk5yhi6OU2kSaZx5OBy2UIkDqPUcYAnloJDtwkSC7AHj6Dm4THK4wIoPDiumXI1pVJjBqBcGqYa5fEA+16IxbqaabL2cp+dJJ3MqRoGXL1si7cRKcNAiBFe2vIopqDZemn133kqsyvf38fgTMJkops4WxSUOWSFGoI9joRUcYQhl+SgUkZZK7EtBp3DpgsjhzdqHdckiXlQcMWcReTq4Bw+z5mV2/sxQcrMCVuH+NoQof7DwESf/+aTz4B1WyH8tDHl7zhDpxlwA9A4+7alXAfQcYVYb2V1C8YY8N7y6XQl1AsGoojyD3vZK6zWHm9siDmK9u13u3Mgrtb71GbZCbm+e0mbVq1cDJIyavMK99OAvrfp0IfVEOFJWj7earUKUG9mxZ45WuOzqv2Cv8vgNMcqZuCuXpWHudGb1GipvZxKuOMLwyIn5eSGSDR8AiQDtLDzZ+ALu3rTKSzPrzAMa//xK0OSlQVLHZfd8uhuDQ/p1QKDyPiFCmAaNK17KD3g/2mP/ZXxJcyeAw/xUeNT3UZPXzOe7V7tes2wx6vcFpme3btcaa5SbX2gfP56Dnk62NipiKqo7tB1at+BMPPdjE47a6kr1YVnD/rTAZ+r6U8ivscWnyVgnibnL4sT+P+l6yN/F4NMoLQLXIh2zizpRmy9PduuCP+ab3YE4h8OCjzyMzfrvDMwyjm/rVZPR8vofHHC7TgLmRpetoMFC7Ximm75TgVDJn1G96srHrw6jHnC4vQBAHqipd+zvu/2JP/Dhjsrm8zv0n4sSWHx3KYRjh0DcH44NRnt8sl2nApGTROnqD7oq9kZq1T4IjV0Q7/xc06OVE7nPg6DS2bXL+AqvW4hVEdvnEXEna2bW4uGY4pEGO99ZPPv4YZs3y3DNpmQYM42hyujaBAjbXJxvOcFhxggHGI+UD92dGeU67HDg6/SGAd36GqfHoMNTuULJaFGZexem5T4CTOL7ufCCmAf7dv0EQ11MyrWN6WmYq84C5lqEdyVF8J4hTlkQc+URZUSbMG4PowsVlSEhSO3zlBtm5+alR0UOPD+KaZ5fa0aQryM+3oi/d/ocfaYOCQudxQCeOHYUPRrxpLocZk8U0i8Wt1HSHLQ+Qy3Hj0jFjzE1Xya8Bw4IuJWfoFgJ42RWjip8TQlbVqijtbwz3dw8kfwJM23YdkaXWOOX6tMljMWzIQCuawW9/hJVrNznNt37Fr+jc8VGXI+rXgCnmjipT353w/Es80IIALDAIM56QMFBQSpmkLAUEJzmeX1qrSuBfLrnqQwJ/AkyXJ7sh+bo5ALZdLs+cPgmvDuxj9ezPFesxbETJucZexrfeeAnTv3QdQqTMAyY5TdeZEspcjdjXjfDm5Ka4REDerF1F5tos0Ev1+hNger7QGxfiLzrl3PyfpqJfb+sr4vSMTDR4qCOYy15HSVmrJs4ddx3Dp8wDRpWhvQQKYfGjvTGJCS4rK8nvPDhvt9WfADPwlUE4etx5ROpFv/6A55950mYkn+zxMv45etLpCB/esw5NGjm3Vy77gEnX+lyQIua2xFOM+hNghg8fjp17Djhl2aolc9C1i21A1x9//h3jJn3jNO+EsaPwocWFgT3isg+Y8hXGatzv51uyTz75GGvWb3E66Teu+h0dLYIlFRNfuapCs7bOgzG1a9MCW9ezKI+OU5kHTPkZxnrw72fAfP3VFPy+yK42k7mTOzf+idYt7cfB7PBkH6cmzsz/29ULhxAe5thlT5kHjOV0SUzKfp6CLwkMAnIjJjLcyo3bRZV6Kk8xxpyPIjsmqiQgYkKS5jpAzfauBFzP6Miw9Z5urdzN709bsjmzZ+K7mb84ZdWBnavR9MFGdmm+/XE+Jn7pXOy2cP536NnD8UrkX4BRaSZQSieauUnIphhl+LNWoFJpFlFKSy7yCYmLUYabRyBBpdkISp8pzkMImRitDP/c3QnvaT5/AsyyJQswYcq3Tll29O+NaBht/45HyLZs0Et9MOvbSQ7r8DfArKOUPm/BjSkxkRFWl++JKvUuSvF4CSCwO1oZ0aX4e0KSmmn2fWoBmPXRynAf2ymW9MCfALNt8zqMGD3BKWDOHt2BKKVj36+du/XD8VNnHZZRu2YNnD+xqxwwjAOJKvU1SlHiDYGgT4wywspZb8I19QUQlBhPULokJqqCecVJUKl7g8JkocS0zQiSopURUZ6uFO7m9yfA/HtoL14Z8r5TViWe2Y9qVR2HUftp7kJ84iLGjLNVqsysMKcTk2s3i67t0KXIheTsSlJK0yilJRqVFPVjoiIuW59z1Ew5q8T9EsE3McoI85km4Zq6HgjMvn4IIVRPSJVGtcMy3J30nuTzJ8AkXjiJZ3uXRD+2xzdV/BGEhzsO1JlyMxWNHnncqRDzmymfYuhg+9pS3gKMq/kqZE54pBp85sy1CjRIEmww2BfnKoKC23NEsrzk/IKc/PycRjzTzrudQoLCAi3BwH6mlH6eV5Bjjo3HEUIUitALoDBfpfDU0C+/IM+5gEAIB9ygCVGEXXeUrawpX2bcvIx2jzuPHJ167SQCA5yHZevR9w3s+9uxy9mnn+qMZQtYyFPb5Awwaek3BcUBkEg4jhQY8po2jcpyY8gtprAnuV3kTVCpPwKFOcgkIdgbrYzobJntokrTgKfUKjY4B/RvEBlRAjTT1m4Ppehk0fIxMcoI51KxO9Q3f1phaFEmHmhuNWQ2XNWknHMYpq+YePGytXhnpPkYalNGSEgwkuIOQyq11V721grjjeng0QrjqgGJKs0SSqmF/ynyfUxk+CjLfAlJWR0BYmWFKZVyHevVDPvbmk7zHUBHFv9GCPkzWhkuWOPZVVvFPPcnwFQI5lE1qrlD9jA1/bSkUy7Zl52TiwYPdkBhUZFD2u0blqBta9u6/AcwSZrzFNR8PcxR8mqDqHCm2m9O8Uma/gTUKjY4R0h0A2W4lcbfxWuaQTyhC8yAAbkQHRne2OVI3QECfwIME7pWr9sC+QUFdjkZFhqK5MR/BHH5taEfOtUa+GT0u/hk9Ds2ZfkFYG7coIo8gyabUpiDHUqItGl9ZYjV/WJikmYUBbW66A+RhgfXrEmsLJsuqXIfMlD9mZIVBoZgSXhYaTpBI+chkb8BpknLJ6BKvmGXa1WrVMbFs/sFcXT7rv3o8/Iwh7SO1GT8AjCJydmPUp4/ZMGdwmhleCghRG+11VKpp4HiI4vfNDGRETbG4JRSaaJKk8Ni9ZhBw3HtomuHHRY0Wl4kEgsYL1bt9aJcWVyyCnv1HYBz5+x78K9Zswb27NwqqF16gwGxnZ9Eerr9y01mffnv4QNQKIIElceIfKl0y+q7Y2eY+CTNOwS05NqDkKMxyvDWpTmRqNIsppRanEXIhRgHW60ElYb5I21VXAYFGd4wMtxzTwqCh8dE6G+AGfzW2zhwwPLdV8KwunXqYOtm4VpKX0+bjt//cKxs+cu8n9Gh/WOCR6TMACZRlT2PUr7E0Jtw82KUYUNLcyL+mno3ISi5hiFkV4wy/Al7HEtQZc8F5d8q2ZZx86OVYebvgrnsIaG/Aeaj/43Fhr/smxs3bBiDDWtXCubohbg49OzVzyH9kMGv46MPzXc7LsstO4BJ0hyloC3Nkxt4JzoyYnZpDiRcU8eBwOxTlFK6uGFUhVfscSoxSf02BcwrCgE5Fh0Zbl5xXHLXSwRiAXM/ayuztn88/mv8PM/qrsbMyRbNH8KeLVYSAJdcZnKd/87H26Vr3uxB7NtmrR1d5s8w7LxxUZWdQ0Etzhvk0eja4TaSq4Qko4cFs5iYI9y0Bsqw/9kFTLKmLeWp+cxCQAobKMNszkUuR8xDAn8DzLTv5mDy1B/tcq1d25bYus4+mByxedacBRg7cardxxzH4VrcYSt1/zIPmMuqzKZ6ylnatRpCpPlhNWvWtLr5unmTBmdrNbmWnCOUjIqOCv/eHjdv3LihyNUrspmzjOLnUsI3q6esaL498xALgrL7G2B+W7gcI8fYVw5/PPYxrFvO3DcIT2npGWj4cGfo9Vb3P+YCmMSfSf6LU5kHTPy17FcJ4f8o2Y6R89GR4Taepy+pNNEGShOsAYN+0VERDi2WEpM05yioWf5CKfdaw6gws3xG+LC5T+lvgNmwaQcGDravgNm9a2csX2hfpcUZh/u/+i42b9ttl2T40Ffx1eclm4wyD5jEJM131FoqvyRaGW7tuMqo7pIVSynZa8k1Cr5jw8iKVlJ+y+elb9UIyPfRpbQH3IeCsJz+BphDR46jW0+7x0qj4RczABObNm7ZhZdef89uNmaMxozS/GaFSVSp91KKWAtufBQTGTG9NHcuXtf05w3WUn4CNIiOjHAYhTQhST0agFmHjBDsi1ZGlOiYiR05N+j9DTDxiZfRqoOVzZ+Za/369MD8WfbPI85Yq9Pp0fDhTmDumEondo5hZssRtzWgy/QKw1T5L6o0WZbq+pTiiYZRETYWQolJ2R9Q8DMsGRakDFcoCbGvhwEg/pq6CyEwO7MigKaBMrwCU/l3Y+67lcXfAMNC9tVp1M4ur159uQ9mznBsLemMwWMnTMOsueaduxXp0j9m4ZluJpvCMg2YxCR1fQqY9cDYRA4MC6usDCc2r5KEJDVbKdiKUZzUMZERFZwxWaXSVCwE0i1tbFytSm6hwkkmR4Cxp9rPirnfr5WZM75KymYwGGw99Qr1XmmPnefjEtG2k6UxbgmV5TmmbAMmWd2H8jBLsgjBtWhlhN1wuglJmiWAlTbz+Rg7lwOlmZ2oUl+lFGaLS8Khb3TtCLNFprcBUro8fwMM6z/zYpmaZutc/L23X8eUCZaaTeK437l7Pxw/aWu+3Oyhxvh7h2lIyzZgktRTKGCOY0kI1kUrI+xaICUkqZl715LzB8WumKgIu1J+y2FIVKnXUgqzTT8BvoyOjHBsbCFuDF1SiwWMywLvIoEQXTLWvB49+yAhwcpsydjqYUOHYNT79g/vQrq1bPkqTPj8CxtSdo759/DfCA1lLrcdp/te0p+g0myCRWhx5jGmYVQFu5f4CSpNHCg1S/kJIYuileGDXDE6/lrWBOY5xkxHyOYYZbjZq4yr/J4+90fAvPbGWzh8xFaNf8S772D4OzYaT4JZnJubi/Ydu9gNqTF39kx0irX1qGlZuM8Bc+PGZa86k8jVVzwGwOwRQQLD4CCpxq5LkFxDxXOgCC5mAOEwO5jLdHnlUqAP72KA5FcLxqWHSDPNajiCR8tNwlx9xav2sjo6w9ymTeCobjTR3bpjQlaDvLbddjnrptAV5oPRH2PTZlsPmLVrVv1q7+bf57rJSmO2Zu36TM3LLzArmAVWqo+qD/dD96c6Y1T3CiASx/F1JNpku9t9T9rjLO8d01a+Uw0uL/fucCCoSqPvCYGN9JJS8n5B2nn7ejMCmxpUpUl7TsL9HRHdBVWbD0CYspXRNZA+Lz394IQq91SI4HLACBxUfydTVGs8FpROseUDHZafGufRCtNxOh1nyM+YKFVUMqs86fLSaW7y0U1n5j/teahlLw5eOWC8yMyyXJSiWqMhoLBRGiOUvpaXFueRalLsdPongAGMfwUZl6G4sARtcw4e/XrXNhv7qbvN43sCMGcSUyy1Asw8aRpdw+gcw9FzMcwrLktMnnLaEg4oqjV8DpSzsRSjPAYUpF9Y5gmvOs2gbXke069tm8A9l7enaYNQWXCAhKMNK4ZFdl6yxqHfO0/qdDfvPQEYdxtfns93HIj9xpBm0BVUpgYteH0ReL0W1FAEWXDl/w5+VvEhIS1JSbli98VYnLdGjbr7furWZVGYXDawYlAAgmTSMY8vXn1XXGk56k+ZBYw3ViV7TLvXVipXk1DIRHZGwyYxex47nf4LwJ6xXuK+0cR5CDERjdjzWs8IXsvdvJRTGDDt7HXt9QLtmIJbF34QUcQdJS2zgLmjXPPHwmu2UCj0+SxYr1XiCN8l91a8fT19kXwqBv9Xg975fuHZaw9reZN6YLWqlfYe2rGoRO4motxiwIvI4pS0HDDe4qSflDPrqS5aA6UyAtAR23dz3u52gyffH3vj9HYWrcE0Nyl0lCOjC255dnXtrXaWA8ZbnPSTcna/3PsyBa0LILPLkjWVvN3tyk2emp+fljTEVC5N43j0zU2Ps/KM6u06xZRXDhgx3Cqnxe6Xe12gYKFJSF6XJaudK3qJ5xdRVG3ETNvZJcI5nqPPFt6ME629IL5a4TnKNGAopfLkbIRIDAgBj2BQnUJPiUIqQRD7JNSgAIgCBIGUkkCOIIAHH0gIFwBKAkH5QEogJwRyUCKn4OWEcDJCIQeBnFLIACoFAfOgLQX7TnH7O5UCHAdQCQjhQKkEIKbvAGf8m4DAFAqEEGIcCnLbbMH4m3FDAtDbtj70dtADCmb7w/6B8gB4gBiMfxNiAGW/se8sogLRg0IPYvyvA2D6DqIn7DuFlhJoKeV1BJwWhGophZZQaEG4QhBaSClfxIEr/HbR1mZrli2unp/8X6tcHW92bhJdv/6cLRvW/AIiyweHPIMEubXDkEsI0QqfhibK4KqNXqEA86hxOF9X1B1Zl5mDlHsq3dOASU2lIQYZKuv0usrgSCUJIRUBvgLlSQVKEMGBhPOgEaB8OEDCKBBGYAyJEUKBEAI2ocuTOxw4dfoMzp0/j/j4RJw5+x/i4uJZGBKbotq0boWFf9jGwKSAjgDMwUkuBXIIkA3QbBBOw4GoeVANoVATjmYBXJaB0syWrR79SSaX33rhuef7zpr2P/u+ad3pjBfz3BXAUEq5lCzUNhj0dQmhUQBRArQWBalBCGoAtBqlqAZAuM9QLzKlvCjgzaHDceCgydslc+Eqk8nNoSiYIRn7r9PpUCEiAn/vMxvAepN1BYTgFkBuUYoUApoCEBYcWEUpuSaRSK/UqIBkQghbZX2W7jhgKKWylCx9WwOPdoTQhylIE0IRbemzzGe9La+oTHGA+aWjBIkE9Byl5JSEw6EaFaRHCCFs+3lH0h0FTHK6bjIFhoNtm8pTOQd8wgGiJsBPtSvLrAIPe6vqOw8YguGg5YDx1oCVl+OCA4SoCb1PAcO6Zt6SAe0IpQ9TigcBRANwHhSxfGaUc8A1B1g4s0RC8B8l5JQE9/mWzFF/iw/9hOjrGkCiYKDmQz9AaxKCqpSSagAtP/S7njRllIIUEELZgT+VgqZwIDeMh34JUUlAr1FaRg/9noxm8bUy1esq6+1cK5vORiS8/FrZEy7fmbzOrpUBqgGImhCoCUqulaU8zSBSWbpEh/SqVYmVz+0700rxpd7RM4z45ng3hz3BJSREoadQSDkSZKBQgPIKUAeCS8IHMiElE16aBZeAnICTWQouCYHUJMQ0Ci9vCy6JlIJKOJOAkqNMcGkrwCTMFJdYCCwtBZilBZbsO5NWwiQPoaUFlsQouGQSS8oTkzCzRHAJGIWVtLTgEryOAtpiwSUTWjJhJqi14JKnKCKEFoKgEITLlxDk63laICXIh4Hme0Nw6d3RvzOl/R8AdGoXzom1qQAAAABJRU5ErkJggg=="}}]);