strataplayer 1.0.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -0,0 +1,603 @@
1
+ (function(Bi,$e){typeof exports=="object"&&typeof module<"u"?$e(exports,require("react"),require("react-dom")):typeof define=="function"&&define.amd?define(["exports","react","react-dom"],$e):(Bi=typeof globalThis<"u"?globalThis:Bi||self,$e(Bi.StrataPlayer={},Bi.React,Bi.ReactDOM))})(this,function(Bi,$e,Ef){"use strict";var TU=Object.defineProperty;var bU=(Bi,$e,Ef)=>$e in Bi?TU(Bi,$e,{enumerable:!0,configurable:!0,writable:!0,value:Ef}):Bi[$e]=Ef;var sn=(Bi,$e,Ef)=>bU(Bi,typeof $e!="symbol"?$e+"":$e,Ef);var fT={exports:{}},qg={},av={exports:{}},dT={};/**
2
+ * @license React
3
+ * scheduler.production.js
4
+ *
5
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
6
+ *
7
+ * This source code is licensed under the MIT license found in the
8
+ * LICENSE file in the root directory of this source tree.
9
+ */var ix;function O_(){return ix||(ix=1,function(h){function e(F,ne){var le=F.length;F.push(ne);e:for(;0<le;){var xe=le-1>>>1,_e=F[xe];if(0<o(_e,ne))F[xe]=ne,F[le]=_e,le=xe;else break e}}function i(F){return F.length===0?null:F[0]}function s(F){if(F.length===0)return null;var ne=F[0],le=F.pop();if(le!==ne){F[0]=le;e:for(var xe=0,_e=F.length,Q=_e>>>1;xe<Q;){var de=2*(xe+1)-1,Le=F[de],Ce=de+1,Fe=F[Ce];if(0>o(Le,le))Ce<_e&&0>o(Fe,Le)?(F[xe]=Fe,F[Ce]=le,xe=Ce):(F[xe]=Le,F[de]=le,xe=de);else if(Ce<_e&&0>o(Fe,le))F[xe]=Fe,F[Ce]=le,xe=Ce;else break e}}return ne}function o(F,ne){var le=F.sortIndex-ne.sortIndex;return le!==0?le:F.id-ne.id}if(h.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var u=performance;h.unstable_now=function(){return u.now()}}else{var d=Date,g=d.now();h.unstable_now=function(){return d.now()-g}}var S=[],v=[],E=1,b=null,R=3,_=!1,D=!1,I=!1,M=!1,w=typeof setTimeout=="function"?setTimeout:null,B=typeof clearTimeout=="function"?clearTimeout:null,z=typeof setImmediate<"u"?setImmediate:null;function G(F){for(var ne=i(v);ne!==null;){if(ne.callback===null)s(v);else if(ne.startTime<=F)s(v),ne.sortIndex=ne.expirationTime,e(S,ne);else break;ne=i(v)}}function K(F){if(I=!1,G(F),!D)if(i(S)!==null)D=!0,ae||(ae=!0,Ee());else{var ne=i(v);ne!==null&&Oe(K,ne.startTime-F)}}var ae=!1,q=-1,Z=5,te=-1;function $(){return M?!0:!(h.unstable_now()-te<Z)}function me(){if(M=!1,ae){var F=h.unstable_now();te=F;var ne=!0;try{e:{D=!1,I&&(I=!1,B(q),q=-1),_=!0;var le=R;try{t:{for(G(F),b=i(S);b!==null&&!(b.expirationTime>F&&$());){var xe=b.callback;if(typeof xe=="function"){b.callback=null,R=b.priorityLevel;var _e=xe(b.expirationTime<=F);if(F=h.unstable_now(),typeof _e=="function"){b.callback=_e,G(F),ne=!0;break t}b===i(S)&&s(S),G(F)}else s(S);b=i(S)}if(b!==null)ne=!0;else{var Q=i(v);Q!==null&&Oe(K,Q.startTime-F),ne=!1}}break e}finally{b=null,R=le,_=!1}ne=void 0}}finally{ne?Ee():ae=!1}}}var Ee;if(typeof z=="function")Ee=function(){z(me)};else if(typeof MessageChannel<"u"){var De=new MessageChannel,Ie=De.port2;De.port1.onmessage=me,Ee=function(){Ie.postMessage(null)}}else Ee=function(){w(me,0)};function Oe(F,ne){q=w(function(){F(h.unstable_now())},ne)}h.unstable_IdlePriority=5,h.unstable_ImmediatePriority=1,h.unstable_LowPriority=4,h.unstable_NormalPriority=3,h.unstable_Profiling=null,h.unstable_UserBlockingPriority=2,h.unstable_cancelCallback=function(F){F.callback=null},h.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):Z=0<F?Math.floor(1e3/F):5},h.unstable_getCurrentPriorityLevel=function(){return R},h.unstable_next=function(F){switch(R){case 1:case 2:case 3:var ne=3;break;default:ne=R}var le=R;R=ne;try{return F()}finally{R=le}},h.unstable_requestPaint=function(){M=!0},h.unstable_runWithPriority=function(F,ne){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var le=R;R=F;try{return ne()}finally{R=le}},h.unstable_scheduleCallback=function(F,ne,le){var xe=h.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?xe+le:xe):le=xe,F){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=le+_e,F={id:E++,callback:ne,priorityLevel:F,startTime:le,expirationTime:_e,sortIndex:-1},le>xe?(F.sortIndex=le,e(v,F),i(S)===null&&F===i(v)&&(I?(B(q),q=-1):I=!0,Oe(K,le-xe))):(F.sortIndex=_e,e(S,F),D||_||(D=!0,ae||(ae=!0,Ee()))),F},h.unstable_shouldYield=$,h.unstable_wrapCallback=function(F){var ne=R;return function(){var le=R;R=ne;try{return F.apply(this,arguments)}finally{R=le}}}}(dT)),dT}var hT={};/**
10
+ * @license React
11
+ * scheduler.development.js
12
+ *
13
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
14
+ *
15
+ * This source code is licensed under the MIT license found in the
16
+ * LICENSE file in the root directory of this source tree.
17
+ */var ax;function M_(){return ax||(ax=1,function(h){process.env.NODE_ENV!=="production"&&function(){function e(){if(K=!1,te){var F=h.unstable_now();Ee=F;var ne=!0;try{e:{z=!1,G&&(G=!1,q($),$=-1),B=!0;var le=w;try{t:{for(d(F),M=s(_);M!==null&&!(M.expirationTime>F&&S());){var xe=M.callback;if(typeof xe=="function"){M.callback=null,w=M.priorityLevel;var _e=xe(M.expirationTime<=F);if(F=h.unstable_now(),typeof _e=="function"){M.callback=_e,d(F),ne=!0;break t}M===s(_)&&o(_),d(F)}else o(_);M=s(_)}if(M!==null)ne=!0;else{var Q=s(D);Q!==null&&v(g,Q.startTime-F),ne=!1}}break e}finally{M=null,w=le,B=!1}ne=void 0}}finally{ne?De():te=!1}}}function i(F,ne){var le=F.length;F.push(ne);e:for(;0<le;){var xe=le-1>>>1,_e=F[xe];if(0<u(_e,ne))F[xe]=ne,F[le]=_e,le=xe;else break e}}function s(F){return F.length===0?null:F[0]}function o(F){if(F.length===0)return null;var ne=F[0],le=F.pop();if(le!==ne){F[0]=le;e:for(var xe=0,_e=F.length,Q=_e>>>1;xe<Q;){var de=2*(xe+1)-1,Le=F[de],Ce=de+1,Fe=F[Ce];if(0>u(Le,le))Ce<_e&&0>u(Fe,Le)?(F[xe]=Fe,F[Ce]=le,xe=Ce):(F[xe]=Le,F[de]=le,xe=de);else if(Ce<_e&&0>u(Fe,le))F[xe]=Fe,F[Ce]=le,xe=Ce;else break e}}return ne}function u(F,ne){var le=F.sortIndex-ne.sortIndex;return le!==0?le:F.id-ne.id}function d(F){for(var ne=s(D);ne!==null;){if(ne.callback===null)o(D);else if(ne.startTime<=F)o(D),ne.sortIndex=ne.expirationTime,i(_,ne);else break;ne=s(D)}}function g(F){if(G=!1,d(F),!z)if(s(_)!==null)z=!0,te||(te=!0,De());else{var ne=s(D);ne!==null&&v(g,ne.startTime-F)}}function S(){return K?!0:!(h.unstable_now()-Ee<me)}function v(F,ne){$=ae(function(){F(h.unstable_now())},ne)}if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error()),h.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var E=performance;h.unstable_now=function(){return E.now()}}else{var b=Date,R=b.now();h.unstable_now=function(){return b.now()-R}}var _=[],D=[],I=1,M=null,w=3,B=!1,z=!1,G=!1,K=!1,ae=typeof setTimeout=="function"?setTimeout:null,q=typeof clearTimeout=="function"?clearTimeout:null,Z=typeof setImmediate<"u"?setImmediate:null,te=!1,$=-1,me=5,Ee=-1;if(typeof Z=="function")var De=function(){Z(e)};else if(typeof MessageChannel<"u"){var Ie=new MessageChannel,Oe=Ie.port2;Ie.port1.onmessage=e,De=function(){Oe.postMessage(null)}}else De=function(){ae(e,0)};h.unstable_IdlePriority=5,h.unstable_ImmediatePriority=1,h.unstable_LowPriority=4,h.unstable_NormalPriority=3,h.unstable_Profiling=null,h.unstable_UserBlockingPriority=2,h.unstable_cancelCallback=function(F){F.callback=null},h.unstable_forceFrameRate=function(F){0>F||125<F?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):me=0<F?Math.floor(1e3/F):5},h.unstable_getCurrentPriorityLevel=function(){return w},h.unstable_next=function(F){switch(w){case 1:case 2:case 3:var ne=3;break;default:ne=w}var le=w;w=ne;try{return F()}finally{w=le}},h.unstable_requestPaint=function(){K=!0},h.unstable_runWithPriority=function(F,ne){switch(F){case 1:case 2:case 3:case 4:case 5:break;default:F=3}var le=w;w=F;try{return ne()}finally{w=le}},h.unstable_scheduleCallback=function(F,ne,le){var xe=h.unstable_now();switch(typeof le=="object"&&le!==null?(le=le.delay,le=typeof le=="number"&&0<le?xe+le:xe):le=xe,F){case 1:var _e=-1;break;case 2:_e=250;break;case 5:_e=1073741823;break;case 4:_e=1e4;break;default:_e=5e3}return _e=le+_e,F={id:I++,callback:ne,priorityLevel:F,startTime:le,expirationTime:_e,sortIndex:-1},le>xe?(F.sortIndex=le,i(D,F),s(_)===null&&F===s(D)&&(G?(q($),$=-1):G=!0,v(g,le-xe))):(F.sortIndex=_e,i(_,F),z||B||(z=!0,te||(te=!0,De()))),F},h.unstable_shouldYield=S,h.unstable_wrapCallback=function(F){var ne=w;return function(){var le=w;w=ne;try{return F.apply(this,arguments)}finally{w=le}}},typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()}(hT)),hT}var sx;function lx(){return sx||(sx=1,process.env.NODE_ENV==="production"?av.exports=O_():av.exports=M_()),av.exports}/**
18
+ * @license React
19
+ * react-dom-client.production.js
20
+ *
21
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
22
+ *
23
+ * This source code is licensed under the MIT license found in the
24
+ * LICENSE file in the root directory of this source tree.
25
+ */var rx;function I_(){if(rx)return qg;rx=1;var h=lx(),e=$e,i=Ef;function s(a){var r="https://react.dev/errors/"+a;if(1<arguments.length){r+="?args[]="+encodeURIComponent(arguments[1]);for(var c=2;c<arguments.length;c++)r+="&args[]="+encodeURIComponent(arguments[c])}return"Minified React error #"+a+"; visit "+r+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function o(a){return!(!a||a.nodeType!==1&&a.nodeType!==9&&a.nodeType!==11)}function u(a){var r=a,c=a;if(a.alternate)for(;r.return;)r=r.return;else{a=r;do r=a,r.flags&4098&&(c=r.return),a=r.return;while(a)}return r.tag===3?c:null}function d(a){if(a.tag===13){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function g(a){if(a.tag===31){var r=a.memoizedState;if(r===null&&(a=a.alternate,a!==null&&(r=a.memoizedState)),r!==null)return r.dehydrated}return null}function S(a){if(u(a)!==a)throw Error(s(188))}function v(a){var r=a.alternate;if(!r){if(r=u(a),r===null)throw Error(s(188));return r!==a?null:a}for(var c=a,m=r;;){var T=c.return;if(T===null)break;var x=T.alternate;if(x===null){if(m=T.return,m!==null){c=m;continue}break}if(T.child===x.child){for(x=T.child;x;){if(x===c)return S(T),a;if(x===m)return S(T),r;x=x.sibling}throw Error(s(188))}if(c.return!==m.return)c=T,m=x;else{for(var C=!1,k=T.child;k;){if(k===c){C=!0,c=T,m=x;break}if(k===m){C=!0,m=T,c=x;break}k=k.sibling}if(!C){for(k=x.child;k;){if(k===c){C=!0,c=x,m=T;break}if(k===m){C=!0,m=x,c=T;break}k=k.sibling}if(!C)throw Error(s(189))}}if(c.alternate!==m)throw Error(s(190))}if(c.tag!==3)throw Error(s(188));return c.stateNode.current===c?a:r}function E(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a;for(a=a.child;a!==null;){if(r=E(a),r!==null)return r;a=a.sibling}return null}var b=Object.assign,R=Symbol.for("react.element"),_=Symbol.for("react.transitional.element"),D=Symbol.for("react.portal"),I=Symbol.for("react.fragment"),M=Symbol.for("react.strict_mode"),w=Symbol.for("react.profiler"),B=Symbol.for("react.consumer"),z=Symbol.for("react.context"),G=Symbol.for("react.forward_ref"),K=Symbol.for("react.suspense"),ae=Symbol.for("react.suspense_list"),q=Symbol.for("react.memo"),Z=Symbol.for("react.lazy"),te=Symbol.for("react.activity"),$=Symbol.for("react.memo_cache_sentinel"),me=Symbol.iterator;function Ee(a){return a===null||typeof a!="object"?null:(a=me&&a[me]||a["@@iterator"],typeof a=="function"?a:null)}var De=Symbol.for("react.client.reference");function Ie(a){if(a==null)return null;if(typeof a=="function")return a.$$typeof===De?null:a.displayName||a.name||null;if(typeof a=="string")return a;switch(a){case I:return"Fragment";case w:return"Profiler";case M:return"StrictMode";case K:return"Suspense";case ae:return"SuspenseList";case te:return"Activity"}if(typeof a=="object")switch(a.$$typeof){case D:return"Portal";case z:return a.displayName||"Context";case B:return(a._context.displayName||"Context")+".Consumer";case G:var r=a.render;return a=a.displayName,a||(a=r.displayName||r.name||"",a=a!==""?"ForwardRef("+a+")":"ForwardRef"),a;case q:return r=a.displayName||null,r!==null?r:Ie(a.type)||"Memo";case Z:r=a._payload,a=a._init;try{return Ie(a(r))}catch{}}return null}var Oe=Array.isArray,F=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,ne=i.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,le={pending:!1,data:null,method:null,action:null},xe=[],_e=-1;function Q(a){return{current:a}}function de(a){0>_e||(a.current=xe[_e],xe[_e]=null,_e--)}function Le(a,r){_e++,xe[_e]=a.current,a.current=r}var Ce=Q(null),Fe=Q(null),Ve=Q(null),at=Q(null);function At(a,r){switch(Le(Ve,r),Le(Fe,a),Le(Ce,null),r.nodeType){case 9:case 11:a=(a=r.documentElement)&&(a=a.namespaceURI)?nE(a):0;break;default:if(a=r.tagName,r=r.namespaceURI)r=nE(r),a=Wp(r,a);else switch(a){case"svg":a=1;break;case"math":a=2;break;default:a=0}}de(Ce),Le(Ce,a)}function kt(){de(Ce),de(Fe),de(Ve)}function vi(a){a.memoizedState!==null&&Le(at,a);var r=Ce.current,c=Wp(r,a.type);r!==c&&(Le(Fe,a),Le(Ce,c))}function we(a){Fe.current===a&&(de(Ce),de(Fe)),at.current===a&&(de(at),Gd._currentValue=le)}var ya,Gi;function ei(a){if(ya===void 0)try{throw Error()}catch(c){var r=c.stack.trim().match(/\n( *(at )?)/);ya=r&&r[1]||"",Gi=-1<c.stack.indexOf(`
26
+ at`)?" (<anonymous>)":-1<c.stack.indexOf("@")?"@unknown:0:0":""}return`
27
+ `+ya+a+Gi}var ja=!1;function Pe(a,r){if(!a||ja)return"";ja=!0;var c=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var m={DetermineComponentFrameRoot:function(){try{if(r){var Ae=function(){throw Error()};if(Object.defineProperty(Ae.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(Ae,[])}catch(pe){var ce=pe}Reflect.construct(a,[],Ae)}else{try{Ae.call()}catch(pe){ce=pe}a.call(Ae.prototype)}}else{try{throw Error()}catch(pe){ce=pe}(Ae=a())&&typeof Ae.catch=="function"&&Ae.catch(function(){})}}catch(pe){if(pe&&ce&&typeof pe.stack=="string")return[pe.stack,ce.stack]}return[null,null]}};m.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var T=Object.getOwnPropertyDescriptor(m.DetermineComponentFrameRoot,"name");T&&T.configurable&&Object.defineProperty(m.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var x=m.DetermineComponentFrameRoot(),C=x[0],k=x[1];if(C&&k){var Y=C.split(`
28
+ `),ue=k.split(`
29
+ `);for(T=m=0;m<Y.length&&!Y[m].includes("DetermineComponentFrameRoot");)m++;for(;T<ue.length&&!ue[T].includes("DetermineComponentFrameRoot");)T++;if(m===Y.length||T===ue.length)for(m=Y.length-1,T=ue.length-1;1<=m&&0<=T&&Y[m]!==ue[T];)T--;for(;1<=m&&0<=T;m--,T--)if(Y[m]!==ue[T]){if(m!==1||T!==1)do if(m--,T--,0>T||Y[m]!==ue[T]){var ve=`
30
+ `+Y[m].replace(" at new "," at ");return a.displayName&&ve.includes("<anonymous>")&&(ve=ve.replace("<anonymous>",a.displayName)),ve}while(1<=m&&0<=T);break}}}finally{ja=!1,Error.prepareStackTrace=c}return(c=a?a.displayName||a.name:"")?ei(c):""}function cn(a,r){switch(a.tag){case 26:case 27:case 5:return ei(a.type);case 16:return ei("Lazy");case 13:return a.child!==r&&r!==null?ei("Suspense Fallback"):ei("Suspense");case 19:return ei("SuspenseList");case 0:case 15:return Pe(a.type,!1);case 11:return Pe(a.type.render,!1);case 1:return Pe(a.type,!0);case 31:return ei("Activity");default:return""}}function zn(a){try{var r="",c=null;do r+=cn(a,c),c=a,a=a.return;while(a);return r}catch(m){return`
31
+ Error generating stack: `+m.message+`
32
+ `+m.stack}}var la=Object.prototype.hasOwnProperty,ut=h.unstable_scheduleCallback,Va=h.unstable_cancelCallback,Fn=h.unstable_shouldYield,jl=h.unstable_requestPaint,fn=h.unstable_now,To=h.unstable_getCurrentPriorityLevel,Ya=h.unstable_ImmediatePriority,Vl=h.unstable_UserBlockingPriority,Pn=h.unstable_NormalPriority,qa=h.unstable_LowPriority,bo=h.unstable_IdlePriority,_i=h.log,Lf=h.unstable_setDisableYieldValue,Zs=null,Si=null;function Ka(a){if(typeof _i=="function"&&Lf(a),Si&&typeof Si.setStrictMode=="function")try{Si.setStrictMode(Zs,a)}catch{}}var ye=Math.clz32?Math.clz32:Yn,rt=Math.log,Ht=Math.LN2;function Yn(a){return a>>>=0,a===0?32:31-(rt(a)/Ht|0)|0}var $i=256,vs=262144,Cr=4194304;function Xa(a){var r=a&42;if(r!==0)return r;switch(a&-a){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return a&261888;case 262144:case 524288:case 1048576:case 2097152:return a&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return a&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return a}}function On(a,r,c){var m=a.pendingLanes;if(m===0)return 0;var T=0,x=a.suspendedLanes,C=a.pingedLanes;a=a.warmLanes;var k=m&134217727;return k!==0?(m=k&~x,m!==0?T=Xa(m):(C&=k,C!==0?T=Xa(C):c||(c=k&~a,c!==0&&(T=Xa(c))))):(k=m&~x,k!==0?T=Xa(k):C!==0?T=Xa(C):c||(c=m&~a,c!==0&&(T=Xa(c)))),T===0?0:r!==0&&r!==T&&!(r&x)&&(x=T&-T,c=r&-r,x>=c||x===32&&(c&4194048)!==0)?r:T}function Ss(a,r){return(a.pendingLanes&~(a.suspendedLanes&~a.pingedLanes)&r)===0}function Gu(a,r){switch(a){case 1:case 2:case 4:case 8:case 64:return r+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function xo(){var a=Cr;return Cr<<=1,!(Cr&62914560)&&(Cr=4194304),a}function _f(a){for(var r=[],c=0;31>c;c++)r.push(a);return r}function $u(a,r){a.pendingLanes|=r,r!==268435456&&(a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0)}function Lh(a,r,c,m,T,x){var C=a.pendingLanes;a.pendingLanes=c,a.suspendedLanes=0,a.pingedLanes=0,a.warmLanes=0,a.expiredLanes&=c,a.entangledLanes&=c,a.errorRecoveryDisabledLanes&=c,a.shellSuspendCounter=0;var k=a.entanglements,Y=a.expirationTimes,ue=a.hiddenUpdates;for(c=C&~c;0<c;){var ve=31-ye(c),Ae=1<<ve;k[ve]=0,Y[ve]=-1;var ce=ue[ve];if(ce!==null)for(ue[ve]=null,ve=0;ve<ce.length;ve++){var pe=ce[ve];pe!==null&&(pe.lane&=-536870913)}c&=~Ae}m!==0&&Cf(a,m,0),x!==0&&T===0&&a.tag!==0&&(a.suspendedLanes|=x&~(C&~r))}function Cf(a,r,c){a.pendingLanes|=r,a.suspendedLanes&=~r;var m=31-ye(r);a.entangledLanes|=r,a.entanglements[m]=a.entanglements[m]|1073741824|c&261930}function Js(a,r){var c=a.entangledLanes|=r;for(a=a.entanglements;c;){var m=31-ye(c),T=1<<m;T&r|a[m]&r&&(a[m]|=r),c&=~T}}function va(a,r){var c=r&-r;return c=c&42?1:_h(c),c&(a.suspendedLanes|r)?0:c}function _h(a){switch(a){case 2:a=1;break;case 8:a=4;break;case 32:a=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:a=128;break;case 268435456:a=134217728;break;default:a=0}return a}function u0(a){return a&=-a,2<a?8<a?a&134217727?32:268435456:8:2}function Ch(){var a=ne.p;return a!==0?a:(a=window.event,a===void 0?32:$d(a.type))}function c0(a,r){var c=ne.p;try{return ne.p=a,r()}finally{ne.p=c}}var Es=Math.random().toString(36).slice(2),jt="__reactFiber$"+Es,Hi="__reactProps$"+Es,Or="__reactContainer$"+Es,Oh="__reactEvents$"+Es,f0="__reactListeners$"+Es,jv="__reactHandles$"+Es,d0="__reactResources$"+Es,Ws="__reactMarker$"+Es;function Mh(a){delete a[jt],delete a[Hi],delete a[Oh],delete a[f0],delete a[jv]}function Ao(a){var r=a[jt];if(r)return r;for(var c=a.parentNode;c;){if(r=c[Or]||c[jt]){if(c=r.alternate,r.child!==null||c!==null&&c.child!==null)for(a=Gs(a);a!==null;){if(c=a[jt])return c;a=Gs(a)}return r}a=c,c=a.parentNode}return null}function Ro(a){if(a=a[jt]||a[Or]){var r=a.tag;if(r===5||r===6||r===13||r===31||r===26||r===27||r===3)return a}return null}function Hu(a){var r=a.tag;if(r===5||r===26||r===27||r===6)return a.stateNode;throw Error(s(33))}function Do(a){var r=a[d0];return r||(r=a[d0]={hoistableStyles:new Map,hoistableScripts:new Map}),r}function Bt(a){a[Ws]=!0}var Lo=new Set,Mr={};function Ir(a,r){el(a,r),el(a+"Capture",r)}function el(a,r){for(Mr[a]=r,a=0;a<r.length;a++)Lo.add(r[a])}var Ih=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),wh={},ju={};function Vu(a){return la.call(ju,a)?!0:la.call(wh,a)?!1:Ih.test(a)?ju[a]=!0:(wh[a]=!0,!1)}function Yu(a,r,c){if(Vu(r))if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":a.removeAttribute(r);return;case"boolean":var m=r.toLowerCase().slice(0,5);if(m!=="data-"&&m!=="aria-"){a.removeAttribute(r);return}}a.setAttribute(r,""+c)}}function Nh(a,r,c){if(c===null)a.removeAttribute(r);else{switch(typeof c){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(r);return}a.setAttribute(r,""+c)}}function Yl(a,r,c,m){if(m===null)a.removeAttribute(c);else{switch(typeof m){case"undefined":case"function":case"symbol":case"boolean":a.removeAttribute(c);return}a.setAttributeNS(r,c,""+m)}}function Sa(a){switch(typeof a){case"bigint":case"boolean":case"number":case"string":case"undefined":return a;case"object":return a;default:return""}}function Uh(a){var r=a.type;return(a=a.nodeName)&&a.toLowerCase()==="input"&&(r==="checkbox"||r==="radio")}function h0(a,r,c){var m=Object.getOwnPropertyDescriptor(a.constructor.prototype,r);if(!a.hasOwnProperty(r)&&typeof m<"u"&&typeof m.get=="function"&&typeof m.set=="function"){var T=m.get,x=m.set;return Object.defineProperty(a,r,{configurable:!0,get:function(){return T.call(this)},set:function(C){c=""+C,x.call(this,C)}}),Object.defineProperty(a,r,{enumerable:m.enumerable}),{getValue:function(){return c},setValue:function(C){c=""+C},stopTracking:function(){a._valueTracker=null,delete a[r]}}}}function kh(a){if(!a._valueTracker){var r=Uh(a)?"checked":"value";a._valueTracker=h0(a,r,""+a[r])}}function m0(a){if(!a)return!1;var r=a._valueTracker;if(!r)return!0;var c=r.getValue(),m="";return a&&(m=Uh(a)?a.checked?"true":"false":a.value),a=m,a!==c?(r.setValue(a),!0):!1}function Of(a){if(a=a||(typeof document<"u"?document:void 0),typeof a>"u")return null;try{return a.activeElement||a.body}catch{return a.body}}var Ib=/[\n"\\]/g;function Ea(a){return a.replace(Ib,function(r){return"\\"+r.charCodeAt(0).toString(16)+" "})}function Mf(a,r,c,m,T,x,C,k){a.name="",C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"?a.type=C:a.removeAttribute("type"),r!=null?C==="number"?(r===0&&a.value===""||a.value!=r)&&(a.value=""+Sa(r)):a.value!==""+Sa(r)&&(a.value=""+Sa(r)):C!=="submit"&&C!=="reset"||a.removeAttribute("value"),r!=null?_o(a,C,Sa(r)):c!=null?_o(a,C,Sa(c)):m!=null&&a.removeAttribute("value"),T==null&&x!=null&&(a.defaultChecked=!!x),T!=null&&(a.checked=T&&typeof T!="function"&&typeof T!="symbol"),k!=null&&typeof k!="function"&&typeof k!="symbol"&&typeof k!="boolean"?a.name=""+Sa(k):a.removeAttribute("name")}function If(a,r,c,m,T,x,C,k){if(x!=null&&typeof x!="function"&&typeof x!="symbol"&&typeof x!="boolean"&&(a.type=x),r!=null||c!=null){if(!(x!=="submit"&&x!=="reset"||r!=null)){kh(a);return}c=c!=null?""+Sa(c):"",r=r!=null?""+Sa(r):c,k||r===a.value||(a.value=r),a.defaultValue=r}m=m??T,m=typeof m!="function"&&typeof m!="symbol"&&!!m,a.checked=k?a.checked:!!m,a.defaultChecked=!!m,C!=null&&typeof C!="function"&&typeof C!="symbol"&&typeof C!="boolean"&&(a.name=C),kh(a)}function _o(a,r,c){r==="number"&&Of(a.ownerDocument)===a||a.defaultValue===""+c||(a.defaultValue=""+c)}function qu(a,r,c,m){if(a=a.options,r){r={};for(var T=0;T<c.length;T++)r["$"+c[T]]=!0;for(c=0;c<a.length;c++)T=r.hasOwnProperty("$"+a[c].value),a[c].selected!==T&&(a[c].selected=T),T&&m&&(a[c].defaultSelected=!0)}else{for(c=""+Sa(c),r=null,T=0;T<a.length;T++){if(a[T].value===c){a[T].selected=!0,m&&(a[T].defaultSelected=!0);return}r!==null||a[T].disabled||(r=a[T])}r!==null&&(r.selected=!0)}}function g0(a,r,c){if(r!=null&&(r=""+Sa(r),r!==a.value&&(a.value=r),c==null)){a.defaultValue!==r&&(a.defaultValue=r);return}a.defaultValue=c!=null?""+Sa(c):""}function p0(a,r,c,m){if(r==null){if(m!=null){if(c!=null)throw Error(s(92));if(Oe(m)){if(1<m.length)throw Error(s(93));m=m[0]}c=m}c==null&&(c=""),r=c}c=Sa(r),a.defaultValue=c,m=a.textContent,m===c&&m!==""&&m!==null&&(a.value=m),kh(a)}function tl(a,r){if(r){var c=a.firstChild;if(c&&c===a.lastChild&&c.nodeType===3){c.nodeValue=r;return}}a.textContent=r}var Vv=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" "));function Yv(a,r,c){var m=r.indexOf("--")===0;c==null||typeof c=="boolean"||c===""?m?a.setProperty(r,""):r==="float"?a.cssFloat="":a[r]="":m?a.setProperty(r,c):typeof c!="number"||c===0||Vv.has(r)?r==="float"?a.cssFloat=c:a[r]=(""+c).trim():a[r]=c+"px"}function qv(a,r,c){if(r!=null&&typeof r!="object")throw Error(s(62));if(a=a.style,c!=null){for(var m in c)!c.hasOwnProperty(m)||r!=null&&r.hasOwnProperty(m)||(m.indexOf("--")===0?a.setProperty(m,""):m==="float"?a.cssFloat="":a[m]="");for(var T in r)m=r[T],r.hasOwnProperty(T)&&c[T]!==m&&Yv(a,T,m)}else for(var x in r)r.hasOwnProperty(x)&&Yv(a,x,r[x])}function y0(a){if(a.indexOf("-")===-1)return!1;switch(a){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}var wb=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),wf=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i;function Qa(a){return wf.test(""+a)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":a}function Ts(){}var Bh=null;function zh(a){return a=a.target||a.srcElement||window,a.correspondingUseElement&&(a=a.correspondingUseElement),a.nodeType===3?a.parentNode:a}var nl=null,Co=null;function Nf(a){var r=Ro(a);if(r&&(a=r.stateNode)){var c=a[Hi]||null;e:switch(a=r.stateNode,r.type){case"input":if(Mf(a,c.value,c.defaultValue,c.defaultValue,c.checked,c.defaultChecked,c.type,c.name),r=c.name,c.type==="radio"&&r!=null){for(c=a;c.parentNode;)c=c.parentNode;for(c=c.querySelectorAll('input[name="'+Ea(""+r)+'"][type="radio"]'),r=0;r<c.length;r++){var m=c[r];if(m!==a&&m.form===a.form){var T=m[Hi]||null;if(!T)throw Error(s(90));Mf(m,T.value,T.defaultValue,T.defaultValue,T.checked,T.defaultChecked,T.type,T.name)}}for(r=0;r<c.length;r++)m=c[r],m.form===a.form&&m0(m)}break e;case"textarea":g0(a,c.value,c.defaultValue);break e;case"select":r=c.value,r!=null&&qu(a,!!c.multiple,r,!1)}}}var Ku=!1;function v0(a,r,c){if(Ku)return a(r,c);Ku=!0;try{var m=a(r);return m}finally{if(Ku=!1,(nl!==null||Co!==null)&&(Oc(),nl&&(r=nl,a=Co,Co=nl=null,Nf(r),a)))for(r=0;r<a.length;r++)Nf(a[r])}}function ti(a,r){var c=a.stateNode;if(c===null)return null;var m=c[Hi]||null;if(m===null)return null;c=m[r];e:switch(r){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(m=!m.disabled)||(a=a.type,m=!(a==="button"||a==="input"||a==="select"||a==="textarea")),a=!m;break e;default:a=!1}if(a)return null;if(c&&typeof c!="function")throw Error(s(231,r,typeof c));return c}var ql=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Uf=!1;if(ql)try{var Xu={};Object.defineProperty(Xu,"passive",{get:function(){Uf=!0}}),window.addEventListener("test",Xu,Xu),window.removeEventListener("test",Xu,Xu)}catch{Uf=!1}var Kl=null,S0=null,Fh=null;function E0(){if(Fh)return Fh;var a,r=S0,c=r.length,m,T="value"in Kl?Kl.value:Kl.textContent,x=T.length;for(a=0;a<c&&r[a]===T[a];a++);var C=c-a;for(m=1;m<=C&&r[c-m]===T[x-m];m++);return Fh=T.slice(a,1<m?1-m:void 0)}function Ph(a){var r=a.keyCode;return"charCode"in a?(a=a.charCode,a===0&&r===13&&(a=13)):a=r,a===10&&(a=13),32<=a||a===13?a:0}function kf(){return!0}function Kv(){return!1}function Ei(a){function r(c,m,T,x,C){this._reactName=c,this._targetInst=T,this.type=m,this.nativeEvent=x,this.target=C,this.currentTarget=null;for(var k in a)a.hasOwnProperty(k)&&(c=a[k],this[k]=c?c(x):x[k]);return this.isDefaultPrevented=(x.defaultPrevented!=null?x.defaultPrevented:x.returnValue===!1)?kf:Kv,this.isPropagationStopped=Kv,this}return b(r.prototype,{preventDefault:function(){this.defaultPrevented=!0;var c=this.nativeEvent;c&&(c.preventDefault?c.preventDefault():typeof c.returnValue!="unknown"&&(c.returnValue=!1),this.isDefaultPrevented=kf)},stopPropagation:function(){var c=this.nativeEvent;c&&(c.stopPropagation?c.stopPropagation():typeof c.cancelBubble!="unknown"&&(c.cancelBubble=!0),this.isPropagationStopped=kf)},persist:function(){},isPersistent:kf}),r}var wr={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(a){return a.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Bf=Ei(wr),Qu=b({},wr,{view:0,detail:0}),Nb=Ei(Qu),T0,b0,zf,Gh=b({},Qu,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Za,button:0,buttons:0,relatedTarget:function(a){return a.relatedTarget===void 0?a.fromElement===a.srcElement?a.toElement:a.fromElement:a.relatedTarget},movementX:function(a){return"movementX"in a?a.movementX:(a!==zf&&(zf&&a.type==="mousemove"?(T0=a.screenX-zf.screenX,b0=a.screenY-zf.screenY):b0=T0=0,zf=a),T0)},movementY:function(a){return"movementY"in a?a.movementY:b0}}),Zu=Ei(Gh),Xv=b({},Gh,{dataTransfer:0}),Qv=Ei(Xv),Zv=b({},Qu,{relatedTarget:0}),$h=Ei(Zv),x0=b({},wr,{animationName:0,elapsedTime:0,pseudoElement:0}),Jv=Ei(x0),Oo=b({},wr,{clipboardData:function(a){return"clipboardData"in a?a.clipboardData:window.clipboardData}}),Mo=Ei(Oo),bs=b({},wr,{data:0}),Wv=Ei(bs),A0={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},il={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},eS={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function xs(a){var r=this.nativeEvent;return r.getModifierState?r.getModifierState(a):(a=eS[a])?!!r[a]:!1}function Za(){return xs}var Hh=b({},Qu,{key:function(a){if(a.key){var r=A0[a.key]||a.key;if(r!=="Unidentified")return r}return a.type==="keypress"?(a=Ph(a),a===13?"Enter":String.fromCharCode(a)):a.type==="keydown"||a.type==="keyup"?il[a.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Za,charCode:function(a){return a.type==="keypress"?Ph(a):0},keyCode:function(a){return a.type==="keydown"||a.type==="keyup"?a.keyCode:0},which:function(a){return a.type==="keypress"?Ph(a):a.type==="keydown"||a.type==="keyup"?a.keyCode:0}}),jh=Ei(Hh),R0=b({},Gh,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),As=Ei(R0),Ub=b({},Qu,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Za}),tS=Ei(Ub),nS=b({},wr,{propertyName:0,elapsedTime:0,pseudoElement:0}),kb=Ei(nS),D0=b({},Gh,{deltaX:function(a){return"deltaX"in a?a.deltaX:"wheelDeltaX"in a?-a.wheelDeltaX:0},deltaY:function(a){return"deltaY"in a?a.deltaY:"wheelDeltaY"in a?-a.wheelDeltaY:"wheelDelta"in a?-a.wheelDelta:0},deltaZ:0,deltaMode:0}),Bb=Ei(D0),iS=b({},wr,{newState:0,oldState:0}),L0=Ei(iS),Vh=[9,13,27,32],Ju=ql&&"CompositionEvent"in window,Io=null;ql&&"documentMode"in document&&(Io=document.documentMode);var Ci=ql&&"TextEvent"in window&&!Io,_0=ql&&(!Ju||Io&&8<Io&&11>=Io),Ff=" ",Nr=!1;function Yh(a,r){switch(a){case"keyup":return Vh.indexOf(r.keyCode)!==-1;case"keydown":return r.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function C0(a){return a=a.detail,typeof a=="object"&&"data"in a?a.data:null}var wo=!1;function aS(a,r){switch(a){case"compositionend":return C0(r);case"keypress":return r.which!==32?null:(Nr=!0,Ff);case"textInput":return a=r.data,a===Ff&&Nr?null:a;default:return null}}function zb(a,r){if(wo)return a==="compositionend"||!Ju&&Yh(a,r)?(a=E0(),Fh=S0=Kl=null,wo=!1,a):null;switch(a){case"paste":return null;case"keypress":if(!(r.ctrlKey||r.altKey||r.metaKey)||r.ctrlKey&&r.altKey){if(r.char&&1<r.char.length)return r.char;if(r.which)return String.fromCharCode(r.which)}return null;case"compositionend":return _0&&r.locale!=="ko"?null:r.data;default:return null}}var O0={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0};function al(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r==="input"?!!O0[a.type]:r==="textarea"}function M0(a,r,c,m){nl?Co?Co.push(m):Co=[m]:nl=m,r=Ud(r,"onChange"),0<r.length&&(c=new Bf("onChange","change",null,c,m),a.push({event:c,listeners:r}))}var No=null,Ur=null;function Uo(a){WS(a,0)}function Wu(a){var r=Hu(a);if(m0(r))return a}function I0(a,r){if(a==="change")return r}var qh=!1;if(ql){var ji;if(ql){var Rs="oninput"in document;if(!Rs){var w0=document.createElement("div");w0.setAttribute("oninput","return;"),Rs=typeof w0.oninput=="function"}ji=Rs}else ji=!1;qh=ji&&(!document.documentMode||9<document.documentMode)}function Kh(){No&&(No.detachEvent("onpropertychange",Xh),Ur=No=null)}function Xh(a){if(a.propertyName==="value"&&Wu(Ur)){var r=[];M0(r,Ur,a,zh(a)),v0(Uo,r)}}function sS(a,r,c){a==="focusin"?(Kh(),No=r,Ur=c,No.attachEvent("onpropertychange",Xh)):a==="focusout"&&Kh()}function lS(a){if(a==="selectionchange"||a==="keyup"||a==="keydown")return Wu(Ur)}function kr(a,r){if(a==="click")return Wu(r)}function ko(a,r){if(a==="input"||a==="change")return Wu(r)}function rS(a,r){return a===r&&(a!==0||1/a===1/r)||a!==a&&r!==r}var Oi=typeof Object.is=="function"?Object.is:rS;function Ja(a,r){if(Oi(a,r))return!0;if(typeof a!="object"||a===null||typeof r!="object"||r===null)return!1;var c=Object.keys(a),m=Object.keys(r);if(c.length!==m.length)return!1;for(m=0;m<c.length;m++){var T=c[m];if(!la.call(r,T)||!Oi(a[T],r[T]))return!1}return!0}function N0(a){for(;a&&a.firstChild;)a=a.firstChild;return a}function U0(a,r){var c=N0(a);a=0;for(var m;c;){if(c.nodeType===3){if(m=a+c.textContent.length,a<=r&&m>=r)return{node:c,offset:r-a};a=m}e:{for(;c;){if(c.nextSibling){c=c.nextSibling;break e}c=c.parentNode}c=void 0}c=N0(c)}}function Bo(a,r){return a&&r?a===r?!0:a&&a.nodeType===3?!1:r&&r.nodeType===3?Bo(a,r.parentNode):"contains"in a?a.contains(r):a.compareDocumentPosition?!!(a.compareDocumentPosition(r)&16):!1:!1}function Br(a){a=a!=null&&a.ownerDocument!=null&&a.ownerDocument.defaultView!=null?a.ownerDocument.defaultView:window;for(var r=Of(a.document);r instanceof a.HTMLIFrameElement;){try{var c=typeof r.contentWindow.location.href=="string"}catch{c=!1}if(c)a=r.contentWindow;else break;r=Of(a.document)}return r}function Pf(a){var r=a&&a.nodeName&&a.nodeName.toLowerCase();return r&&(r==="input"&&(a.type==="text"||a.type==="search"||a.type==="tel"||a.type==="url"||a.type==="password")||r==="textarea"||a.contentEditable==="true")}var Gf=ql&&"documentMode"in document&&11>=document.documentMode,zr=null,ec=null,Wa=null,Ds=!1;function Qh(a,r,c){var m=c.window===c?c.document:c.nodeType===9?c:c.ownerDocument;Ds||zr==null||zr!==Of(m)||(m=zr,"selectionStart"in m&&Pf(m)?m={start:m.selectionStart,end:m.selectionEnd}:(m=(m.ownerDocument&&m.ownerDocument.defaultView||window).getSelection(),m={anchorNode:m.anchorNode,anchorOffset:m.anchorOffset,focusNode:m.focusNode,focusOffset:m.focusOffset}),Wa&&Ja(Wa,m)||(Wa=m,m=Ud(ec,"onSelect"),0<m.length&&(r=new Bf("onSelect","select",null,r,c),a.push({event:r,listeners:m}),r.target=zr)))}function Xl(a,r){var c={};return c[a.toLowerCase()]=r.toLowerCase(),c["Webkit"+a]="webkit"+r,c["Moz"+a]="moz"+r,c}var Ls={animationend:Xl("Animation","AnimationEnd"),animationiteration:Xl("Animation","AnimationIteration"),animationstart:Xl("Animation","AnimationStart"),transitionrun:Xl("Transition","TransitionRun"),transitionstart:Xl("Transition","TransitionStart"),transitioncancel:Xl("Transition","TransitionCancel"),transitionend:Xl("Transition","TransitionEnd")},tc={},Fr={};ql&&(Fr=document.createElement("div").style,"AnimationEvent"in window||(delete Ls.animationend.animation,delete Ls.animationiteration.animation,delete Ls.animationstart.animation),"TransitionEvent"in window||delete Ls.transitionend.transition);function wt(a){if(tc[a])return tc[a];if(!Ls[a])return a;var r=Ls[a],c;for(c in r)if(r.hasOwnProperty(c)&&c in Fr)return tc[a]=r[c];return a}var $f=wt("animationend"),k0=wt("animationiteration"),Zh=wt("animationstart"),zo=wt("transitionrun"),Hf=wt("transitionstart"),sl=wt("transitioncancel"),oS=wt("transitionend"),ll=new Map,nc="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");nc.push("scrollEnd");function Vi(a,r){ll.set(a,r),Ir(r,[a])}var Fo=typeof reportError=="function"?reportError:function(a){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var r=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof a=="object"&&a!==null&&typeof a.message=="string"?String(a.message):String(a),error:a});if(!window.dispatchEvent(r))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",a);return}console.error(a)},dn=[],ni=0,es=0;function Ta(){for(var a=ni,r=es=ni=0;r<a;){var c=dn[r];dn[r++]=null;var m=dn[r];dn[r++]=null;var T=dn[r];dn[r++]=null;var x=dn[r];if(dn[r++]=null,m!==null&&T!==null){var C=m.pending;C===null?T.next=T:(T.next=C.next,C.next=T),m.pending=T}x!==0&&Jh(c,T,x)}}function ba(a,r,c,m){dn[ni++]=a,dn[ni++]=r,dn[ni++]=c,dn[ni++]=m,es|=m,a.lanes|=m,a=a.alternate,a!==null&&(a.lanes|=m)}function ts(a,r,c,m){return ba(a,r,c,m),jf(a)}function Ql(a,r){return ba(a,null,null,r),jf(a)}function Jh(a,r,c){a.lanes|=c;var m=a.alternate;m!==null&&(m.lanes|=c);for(var T=!1,x=a.return;x!==null;)x.childLanes|=c,m=x.alternate,m!==null&&(m.childLanes|=c),x.tag===22&&(a=x.stateNode,a===null||a._visibility&1||(T=!0)),a=x,x=x.return;return a.tag===3?(x=a.stateNode,T&&r!==null&&(T=31-ye(c),a=x.hiddenUpdates,m=a[T],m===null?a[T]=[r]:m.push(r),r.lane=c|536870912),x):null}function jf(a){if(50<Cc)throw Cc=0,Dd=null,Error(s(185));for(var r=a.return;r!==null;)a=r,r=a.return;return a.tag===3?a.stateNode:null}var Yi={};function uS(a,r,c,m){this.tag=a,this.key=c,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=r,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=m,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function xn(a,r,c,m){return new uS(a,r,c,m)}function Po(a){return a=a.prototype,!(!a||!a.isReactComponent)}function Zl(a,r){var c=a.alternate;return c===null?(c=xn(a.tag,r,a.key,a.mode),c.elementType=a.elementType,c.type=a.type,c.stateNode=a.stateNode,c.alternate=a,a.alternate=c):(c.pendingProps=r,c.type=a.type,c.flags=0,c.subtreeFlags=0,c.deletions=null),c.flags=a.flags&65011712,c.childLanes=a.childLanes,c.lanes=a.lanes,c.child=a.child,c.memoizedProps=a.memoizedProps,c.memoizedState=a.memoizedState,c.updateQueue=a.updateQueue,r=a.dependencies,c.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext},c.sibling=a.sibling,c.index=a.index,c.ref=a.ref,c.refCleanup=a.refCleanup,c}function B0(a,r){a.flags&=65011714;var c=a.alternate;return c===null?(a.childLanes=0,a.lanes=r,a.child=null,a.subtreeFlags=0,a.memoizedProps=null,a.memoizedState=null,a.updateQueue=null,a.dependencies=null,a.stateNode=null):(a.childLanes=c.childLanes,a.lanes=c.lanes,a.child=c.child,a.subtreeFlags=0,a.deletions=null,a.memoizedProps=c.memoizedProps,a.memoizedState=c.memoizedState,a.updateQueue=c.updateQueue,a.type=c.type,r=c.dependencies,a.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a}function Wh(a,r,c,m,T,x){var C=0;if(m=a,typeof a=="function")Po(a)&&(C=1);else if(typeof a=="string")C=ly(a,c,Ce.current)?26:a==="html"||a==="head"||a==="body"?27:5;else e:switch(a){case te:return a=xn(31,c,r,T),a.elementType=te,a.lanes=x,a;case I:return Jl(c.children,T,x,r);case M:C=8,T|=24;break;case w:return a=xn(12,c,r,T|2),a.elementType=w,a.lanes=x,a;case K:return a=xn(13,c,r,T),a.elementType=K,a.lanes=x,a;case ae:return a=xn(19,c,r,T),a.elementType=ae,a.lanes=x,a;default:if(typeof a=="object"&&a!==null)switch(a.$$typeof){case z:C=10;break e;case B:C=9;break e;case G:C=11;break e;case q:C=14;break e;case Z:C=16,m=null;break e}C=29,c=Error(s(130,a===null?"null":typeof a,"")),m=null}return r=xn(C,c,r,T),r.elementType=a,r.type=m,r.lanes=x,r}function Jl(a,r,c,m){return a=xn(7,a,m,r),a.lanes=c,a}function ic(a,r,c){return a=xn(6,a,null,r),a.lanes=c,a}function z0(a){var r=xn(18,null,null,0);return r.stateNode=a,r}function em(a,r,c){return r=xn(4,a.children!==null?a.children:[],a.key,r),r.lanes=c,r.stateNode={containerInfo:a.containerInfo,pendingChildren:null,implementation:a.implementation},r}var F0=new WeakMap;function xa(a,r){if(typeof a=="object"&&a!==null){var c=F0.get(a);return c!==void 0?c:(r={value:a,source:r,stack:zn(r)},F0.set(a,r),r)}return{value:a,source:r,stack:zn(r)}}var Aa=[],Go=0,Vf=null,Mn=0,ra=[],qi=0,_s=null,oa=1,Cs="";function ns(a,r){Aa[Go++]=Mn,Aa[Go++]=Vf,Vf=a,Mn=r}function P0(a,r,c){ra[qi++]=oa,ra[qi++]=Cs,ra[qi++]=_s,_s=a;var m=oa;a=Cs;var T=32-ye(m)-1;m&=~(1<<T),c+=1;var x=32-ye(r)+T;if(30<x){var C=T-T%5;x=(m&(1<<C)-1).toString(32),m>>=C,T-=C,oa=1<<32-ye(r)+T|c<<T|m,Cs=x+a}else oa=1<<x|c<<T|m,Cs=a}function ac(a){a.return!==null&&(ns(a,1),P0(a,1,0))}function tm(a){for(;a===Vf;)Vf=Aa[--Go],Aa[Go]=null,Mn=Aa[--Go],Aa[Go]=null;for(;a===_s;)_s=ra[--qi],ra[qi]=null,Cs=ra[--qi],ra[qi]=null,oa=ra[--qi],ra[qi]=null}function Yf(a,r){ra[qi++]=oa,ra[qi++]=Cs,ra[qi++]=_s,oa=r.id,Cs=r.overflow,_s=a}var ii=null,Wt=null,Tt=!1,rl=null,qn=!1,ol=Error(s(519));function is(a){var r=Error(s(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw lc(xa(r,a)),ol}function qf(a){var r=a.stateNode,c=a.type,m=a.memoizedProps;switch(r[jt]=a,r[Hi]=m,c){case"dialog":St("cancel",r),St("close",r);break;case"iframe":case"object":case"embed":St("load",r);break;case"video":case"audio":for(c=0;c<Uc.length;c++)St(Uc[c],r);break;case"source":St("error",r);break;case"img":case"image":case"link":St("error",r),St("load",r);break;case"details":St("toggle",r);break;case"input":St("invalid",r),If(r,m.value,m.defaultValue,m.checked,m.defaultChecked,m.type,m.name,!0);break;case"select":St("invalid",r);break;case"textarea":St("invalid",r),p0(r,m.value,m.defaultValue,m.children)}c=m.children,typeof c!="string"&&typeof c!="number"&&typeof c!="bigint"||r.textContent===""+c||m.suppressHydrationWarning===!0||Xp(r.textContent,c)?(m.popover!=null&&(St("beforetoggle",r),St("toggle",r)),m.onScroll!=null&&St("scroll",r),m.onScrollEnd!=null&&St("scrollend",r),m.onClick!=null&&(r.onclick=Ts),r=!0):r=!1,r||is(a,!0)}function sc(a){for(ii=a.return;ii;)switch(ii.tag){case 5:case 31:case 13:qn=!1;return;case 27:case 3:qn=!0;return;default:ii=ii.return}}function ul(a){if(a!==ii)return!1;if(!Tt)return sc(a),Tt=!0,!1;var r=a.tag,c;if((c=r!==3&&r!==27)&&((c=r===5)&&(c=a.type,c=!(c!=="form"&&c!=="button")||Bc(a.type,a.memoizedProps)),c=!c),c&&Wt&&is(a),sc(a),r===13){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));Wt=ag(a)}else if(r===31){if(a=a.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(317));Wt=ag(a)}else r===27?(r=Wt,Ps(a.type)?(a=zd,zd=null,Wt=a):Wt=r):Wt=ii?ia(a.stateNode.nextSibling):null;return!0}function Pr(){Wt=ii=null,Tt=!1}function G0(){var a=rl;return a!==null&&(Tn===null?Tn=a:Tn.push.apply(Tn,a),rl=null),a}function lc(a){rl===null?rl=[a]:rl.push(a)}var nm=Q(null),Wl=null,Os=null;function Ki(a,r,c){Le(nm,r._currentValue),r._currentValue=c}function Ms(a){a._currentValue=nm.current,de(nm)}function im(a,r,c){for(;a!==null;){var m=a.alternate;if((a.childLanes&r)!==r?(a.childLanes|=r,m!==null&&(m.childLanes|=r)):m!==null&&(m.childLanes&r)!==r&&(m.childLanes|=r),a===c)break;a=a.return}}function cl(a,r,c,m){var T=a.child;for(T!==null&&(T.return=a);T!==null;){var x=T.dependencies;if(x!==null){var C=T.child;x=x.firstContext;e:for(;x!==null;){var k=x;x=T;for(var Y=0;Y<r.length;Y++)if(k.context===r[Y]){x.lanes|=c,k=x.alternate,k!==null&&(k.lanes|=c),im(x.return,c,a),m||(C=null);break e}x=k.next}}else if(T.tag===18){if(C=T.return,C===null)throw Error(s(341));C.lanes|=c,x=C.alternate,x!==null&&(x.lanes|=c),im(C,c,a),C=null}else C=T.child;if(C!==null)C.return=T;else for(C=T;C!==null;){if(C===a){C=null;break}if(T=C.sibling,T!==null){T.return=C.return,C=T;break}C=C.return}T=C}}function ai(a,r,c,m){a=null;for(var T=r,x=!1;T!==null;){if(!x){if(T.flags&524288)x=!0;else if(T.flags&262144)break}if(T.tag===10){var C=T.alternate;if(C===null)throw Error(s(387));if(C=C.memoizedProps,C!==null){var k=T.type;Oi(T.pendingProps.value,C.value)||(a!==null?a.push(k):a=[k])}}else if(T===at.current){if(C=T.alternate,C===null)throw Error(s(387));C.memoizedState.memoizedState!==T.memoizedState.memoizedState&&(a!==null?a.push(Gd):a=[Gd])}T=T.return}a!==null&&cl(r,a,c,m),r.flags|=262144}function $o(a){for(a=a.firstContext;a!==null;){if(!Oi(a.context._currentValue,a.memoizedValue))return!0;a=a.next}return!1}function et(a){Wl=a,Os=null,a=a.dependencies,a!==null&&(a.firstContext=null)}function Re(a){return Kf(Wl,a)}function er(a,r){return Wl===null&&et(a),Kf(a,r)}function Kf(a,r){var c=r._currentValue;if(r={context:r,memoizedValue:c,next:null},Os===null){if(a===null)throw Error(s(308));Os=r,a.dependencies={lanes:0,firstContext:r},a.flags|=524288}else Os=Os.next=r;return c}var An=typeof AbortController<"u"?AbortController:function(){var a=[],r=this.signal={aborted:!1,addEventListener:function(c,m){a.push(m)}};this.abort=function(){r.aborted=!0,a.forEach(function(c){return c()})}},$0=h.unstable_scheduleCallback,H0=h.unstable_NormalPriority,In={$$typeof:z,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function Xf(){return{controller:new An,data:new Map,refCount:0}}function Qf(a){a.refCount--,a.refCount===0&&$0(H0,function(){a.controller.abort()})}var Ho=null,Zf=0,Gr=0,Gn=null;function zt(a,r){if(Ho===null){var c=Ho=[];Zf=0,Gr=Qm(),Gn={status:"pending",value:void 0,then:function(m){c.push(m)}}}return Zf++,r.then(Jf,Jf),r}function Jf(){if(--Zf===0&&Ho!==null){Gn!==null&&(Gn.status="fulfilled");var a=Ho;Ho=null,Gr=0,Gn=null;for(var r=0;r<a.length;r++)(0,a[r])()}}function Wf(a,r){var c=[],m={status:"pending",value:null,reason:null,then:function(T){c.push(T)}};return a.then(function(){m.status="fulfilled",m.value=r;for(var T=0;T<c.length;T++)(0,c[T])(r)},function(T){for(m.status="rejected",m.reason=T,T=0;T<c.length;T++)(0,c[T])(void 0)}),m}var tr=F.S;F.S=function(a,r){kp=fn(),typeof r=="object"&&r!==null&&typeof r.then=="function"&&zt(a,r),tr!==null&&tr(a,r)};var Ra=Q(null);function Da(){var a=Ra.current;return a!==null?a:Yt.pooledCache}function rc(a,r){r===null?Le(Ra,Ra.current):Le(Ra,r.pool)}function jo(){var a=Da();return a===null?null:{parent:In._currentValue,pool:a}}var $r=Error(s(460)),Vo=Error(s(474)),oc=Error(s(542)),Yo={then:function(){}};function j0(a){return a=a.status,a==="fulfilled"||a==="rejected"}function V0(a,r,c){switch(c=a[c],c===void 0?a.push(r):c!==r&&(r.then(Ts,Ts),r=c),r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,am(a),a;default:if(typeof r.status=="string")r.then(Ts,Ts);else{if(a=Yt,a!==null&&100<a.shellSuspendCounter)throw Error(s(482));a=r,a.status="pending",a.then(function(m){if(r.status==="pending"){var T=r;T.status="fulfilled",T.value=m}},function(m){if(r.status==="pending"){var T=r;T.status="rejected",T.reason=m}})}switch(r.status){case"fulfilled":return r.value;case"rejected":throw a=r.reason,am(a),a}throw jr=r,$r}}function Hr(a){try{var r=a._init;return r(a._payload)}catch(c){throw c!==null&&typeof c=="object"&&typeof c.then=="function"?(jr=c,$r):c}}var jr=null;function Y0(){if(jr===null)throw Error(s(459));var a=jr;return jr=null,a}function am(a){if(a===$r||a===oc)throw Error(s(483))}var Vr=null,qo=0;function ed(a){var r=qo;return qo+=1,Vr===null&&(Vr=[]),V0(Vr,a,r)}function uc(a,r){r=r.props.ref,a.ref=r!==void 0?r:null}function td(a,r){throw r.$$typeof===R?Error(s(525)):(a=Object.prototype.toString.call(r),Error(s(31,a==="[object Object]"?"object with keys {"+Object.keys(r).join(", ")+"}":a)))}function cS(a){function r(ie,W){if(a){var oe=ie.deletions;oe===null?(ie.deletions=[W],ie.flags|=16):oe.push(W)}}function c(ie,W){if(!a)return null;for(;W!==null;)r(ie,W),W=W.sibling;return null}function m(ie){for(var W=new Map;ie!==null;)ie.key!==null?W.set(ie.key,ie):W.set(ie.index,ie),ie=ie.sibling;return W}function T(ie,W){return ie=Zl(ie,W),ie.index=0,ie.sibling=null,ie}function x(ie,W,oe){return ie.index=oe,a?(oe=ie.alternate,oe!==null?(oe=oe.index,oe<W?(ie.flags|=67108866,W):oe):(ie.flags|=67108866,W)):(ie.flags|=1048576,W)}function C(ie){return a&&ie.alternate===null&&(ie.flags|=67108866),ie}function k(ie,W,oe,Te){return W===null||W.tag!==6?(W=ic(oe,ie.mode,Te),W.return=ie,W):(W=T(W,oe),W.return=ie,W)}function Y(ie,W,oe,Te){var Ye=oe.type;return Ye===I?ve(ie,W,oe.props.children,Te,oe.key):W!==null&&(W.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===Z&&Hr(Ye)===W.type)?(W=T(W,oe.props),uc(W,oe),W.return=ie,W):(W=Wh(oe.type,oe.key,oe.props,null,ie.mode,Te),uc(W,oe),W.return=ie,W)}function ue(ie,W,oe,Te){return W===null||W.tag!==4||W.stateNode.containerInfo!==oe.containerInfo||W.stateNode.implementation!==oe.implementation?(W=em(oe,ie.mode,Te),W.return=ie,W):(W=T(W,oe.children||[]),W.return=ie,W)}function ve(ie,W,oe,Te,Ye){return W===null||W.tag!==7?(W=Jl(oe,ie.mode,Te,Ye),W.return=ie,W):(W=T(W,oe),W.return=ie,W)}function Ae(ie,W,oe){if(typeof W=="string"&&W!==""||typeof W=="number"||typeof W=="bigint")return W=ic(""+W,ie.mode,oe),W.return=ie,W;if(typeof W=="object"&&W!==null){switch(W.$$typeof){case _:return oe=Wh(W.type,W.key,W.props,null,ie.mode,oe),uc(oe,W),oe.return=ie,oe;case D:return W=em(W,ie.mode,oe),W.return=ie,W;case Z:return W=Hr(W),Ae(ie,W,oe)}if(Oe(W)||Ee(W))return W=Jl(W,ie.mode,oe,null),W.return=ie,W;if(typeof W.then=="function")return Ae(ie,ed(W),oe);if(W.$$typeof===z)return Ae(ie,er(ie,W),oe);td(ie,W)}return null}function ce(ie,W,oe,Te){var Ye=W!==null?W.key:null;if(typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint")return Ye!==null?null:k(ie,W,""+oe,Te);if(typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case _:return oe.key===Ye?Y(ie,W,oe,Te):null;case D:return oe.key===Ye?ue(ie,W,oe,Te):null;case Z:return oe=Hr(oe),ce(ie,W,oe,Te)}if(Oe(oe)||Ee(oe))return Ye!==null?null:ve(ie,W,oe,Te,null);if(typeof oe.then=="function")return ce(ie,W,ed(oe),Te);if(oe.$$typeof===z)return ce(ie,W,er(ie,oe),Te);td(ie,oe)}return null}function pe(ie,W,oe,Te,Ye){if(typeof Te=="string"&&Te!==""||typeof Te=="number"||typeof Te=="bigint")return ie=ie.get(oe)||null,k(W,ie,""+Te,Ye);if(typeof Te=="object"&&Te!==null){switch(Te.$$typeof){case _:return ie=ie.get(Te.key===null?oe:Te.key)||null,Y(W,ie,Te,Ye);case D:return ie=ie.get(Te.key===null?oe:Te.key)||null,ue(W,ie,Te,Ye);case Z:return Te=Hr(Te),pe(ie,W,oe,Te,Ye)}if(Oe(Te)||Ee(Te))return ie=ie.get(oe)||null,ve(W,ie,Te,Ye,null);if(typeof Te.then=="function")return pe(ie,W,oe,ed(Te),Ye);if(Te.$$typeof===z)return pe(ie,W,oe,er(W,Te),Ye);td(W,Te)}return null}function ze(ie,W,oe,Te){for(var Ye=null,Ct=null,Ge=W,st=W=0,ft=null;Ge!==null&&st<oe.length;st++){Ge.index>st?(ft=Ge,Ge=null):ft=Ge.sibling;var It=ce(ie,Ge,oe[st],Te);if(It===null){Ge===null&&(Ge=ft);break}a&&Ge&&It.alternate===null&&r(ie,Ge),W=x(It,W,st),Ct===null?Ye=It:Ct.sibling=It,Ct=It,Ge=ft}if(st===oe.length)return c(ie,Ge),Tt&&ns(ie,st),Ye;if(Ge===null){for(;st<oe.length;st++)Ge=Ae(ie,oe[st],Te),Ge!==null&&(W=x(Ge,W,st),Ct===null?Ye=Ge:Ct.sibling=Ge,Ct=Ge);return Tt&&ns(ie,st),Ye}for(Ge=m(Ge);st<oe.length;st++)ft=pe(Ge,ie,st,oe[st],Te),ft!==null&&(a&&ft.alternate!==null&&Ge.delete(ft.key===null?st:ft.key),W=x(ft,W,st),Ct===null?Ye=ft:Ct.sibling=ft,Ct=ft);return a&&Ge.forEach(function(Hs){return r(ie,Hs)}),Tt&&ns(ie,st),Ye}function Xe(ie,W,oe,Te){if(oe==null)throw Error(s(151));for(var Ye=null,Ct=null,Ge=W,st=W=0,ft=null,It=oe.next();Ge!==null&&!It.done;st++,It=oe.next()){Ge.index>st?(ft=Ge,Ge=null):ft=Ge.sibling;var Hs=ce(ie,Ge,It.value,Te);if(Hs===null){Ge===null&&(Ge=ft);break}a&&Ge&&Hs.alternate===null&&r(ie,Ge),W=x(Hs,W,st),Ct===null?Ye=Hs:Ct.sibling=Hs,Ct=Hs,Ge=ft}if(It.done)return c(ie,Ge),Tt&&ns(ie,st),Ye;if(Ge===null){for(;!It.done;st++,It=oe.next())It=Ae(ie,It.value,Te),It!==null&&(W=x(It,W,st),Ct===null?Ye=It:Ct.sibling=It,Ct=It);return Tt&&ns(ie,st),Ye}for(Ge=m(Ge);!It.done;st++,It=oe.next())It=pe(Ge,ie,st,It.value,Te),It!==null&&(a&&It.alternate!==null&&Ge.delete(It.key===null?st:It.key),W=x(It,W,st),Ct===null?Ye=It:Ct.sibling=It,Ct=It);return a&&Ge.forEach(function(mE){return r(ie,mE)}),Tt&&ns(ie,st),Ye}function Kt(ie,W,oe,Te){if(typeof oe=="object"&&oe!==null&&oe.type===I&&oe.key===null&&(oe=oe.props.children),typeof oe=="object"&&oe!==null){switch(oe.$$typeof){case _:e:{for(var Ye=oe.key;W!==null;){if(W.key===Ye){if(Ye=oe.type,Ye===I){if(W.tag===7){c(ie,W.sibling),Te=T(W,oe.props.children),Te.return=ie,ie=Te;break e}}else if(W.elementType===Ye||typeof Ye=="object"&&Ye!==null&&Ye.$$typeof===Z&&Hr(Ye)===W.type){c(ie,W.sibling),Te=T(W,oe.props),uc(Te,oe),Te.return=ie,ie=Te;break e}c(ie,W);break}else r(ie,W);W=W.sibling}oe.type===I?(Te=Jl(oe.props.children,ie.mode,Te,oe.key),Te.return=ie,ie=Te):(Te=Wh(oe.type,oe.key,oe.props,null,ie.mode,Te),uc(Te,oe),Te.return=ie,ie=Te)}return C(ie);case D:e:{for(Ye=oe.key;W!==null;){if(W.key===Ye)if(W.tag===4&&W.stateNode.containerInfo===oe.containerInfo&&W.stateNode.implementation===oe.implementation){c(ie,W.sibling),Te=T(W,oe.children||[]),Te.return=ie,ie=Te;break e}else{c(ie,W);break}else r(ie,W);W=W.sibling}Te=em(oe,ie.mode,Te),Te.return=ie,ie=Te}return C(ie);case Z:return oe=Hr(oe),Kt(ie,W,oe,Te)}if(Oe(oe))return ze(ie,W,oe,Te);if(Ee(oe)){if(Ye=Ee(oe),typeof Ye!="function")throw Error(s(150));return oe=Ye.call(oe),Xe(ie,W,oe,Te)}if(typeof oe.then=="function")return Kt(ie,W,ed(oe),Te);if(oe.$$typeof===z)return Kt(ie,W,er(ie,oe),Te);td(ie,oe)}return typeof oe=="string"&&oe!==""||typeof oe=="number"||typeof oe=="bigint"?(oe=""+oe,W!==null&&W.tag===6?(c(ie,W.sibling),Te=T(W,oe),Te.return=ie,ie=Te):(c(ie,W),Te=ic(oe,ie.mode,Te),Te.return=ie,ie=Te),C(ie)):c(ie,W)}return function(ie,W,oe,Te){try{qo=0;var Ye=Kt(ie,W,oe,Te);return Vr=null,Ye}catch(Ge){if(Ge===$r||Ge===oc)throw Ge;var Ct=xn(29,Ge,null,ie.mode);return Ct.lanes=Te,Ct.return=ie,Ct}finally{}}}var Yr=cS(!0),q0=cS(!1),nr=!1;function nd(a){a.updateQueue={baseState:a.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function sm(a,r){a=a.updateQueue,r.updateQueue===a&&(r.updateQueue={baseState:a.baseState,firstBaseUpdate:a.firstBaseUpdate,lastBaseUpdate:a.lastBaseUpdate,shared:a.shared,callbacks:null})}function ir(a){return{lane:a,tag:0,payload:null,callback:null,next:null}}function La(a,r,c){var m=a.updateQueue;if(m===null)return null;if(m=m.shared,Mt&2){var T=m.pending;return T===null?r.next=r:(r.next=T.next,T.next=r),m.pending=r,r=jf(a),Jh(a,null,c),r}return ba(a,m,r,c),jf(a)}function qr(a,r,c){if(r=r.updateQueue,r!==null&&(r=r.shared,(c&4194048)!==0)){var m=r.lanes;m&=a.pendingLanes,c|=m,r.lanes=c,Js(a,c)}}function lm(a,r){var c=a.updateQueue,m=a.alternate;if(m!==null&&(m=m.updateQueue,c===m)){var T=null,x=null;if(c=c.firstBaseUpdate,c!==null){do{var C={lane:c.lane,tag:c.tag,payload:c.payload,callback:null,next:null};x===null?T=x=C:x=x.next=C,c=c.next}while(c!==null);x===null?T=x=r:x=x.next=r}else T=x=r;c={baseState:m.baseState,firstBaseUpdate:T,lastBaseUpdate:x,shared:m.shared,callbacks:m.callbacks},a.updateQueue=c;return}a=c.lastBaseUpdate,a===null?c.firstBaseUpdate=r:a.next=r,c.lastBaseUpdate=r}var K0=!1;function Kr(){if(K0){var a=Gn;if(a!==null)throw a}}function fl(a,r,c,m){K0=!1;var T=a.updateQueue;nr=!1;var x=T.firstBaseUpdate,C=T.lastBaseUpdate,k=T.shared.pending;if(k!==null){T.shared.pending=null;var Y=k,ue=Y.next;Y.next=null,C===null?x=ue:C.next=ue,C=Y;var ve=a.alternate;ve!==null&&(ve=ve.updateQueue,k=ve.lastBaseUpdate,k!==C&&(k===null?ve.firstBaseUpdate=ue:k.next=ue,ve.lastBaseUpdate=Y))}if(x!==null){var Ae=T.baseState;C=0,ve=ue=Y=null,k=x;do{var ce=k.lane&-536870913,pe=ce!==k.lane;if(pe?(yt&ce)===ce:(m&ce)===ce){ce!==0&&ce===Gr&&(K0=!0),ve!==null&&(ve=ve.next={lane:0,tag:k.tag,payload:k.payload,callback:null,next:null});e:{var ze=a,Xe=k;ce=r;var Kt=c;switch(Xe.tag){case 1:if(ze=Xe.payload,typeof ze=="function"){Ae=ze.call(Kt,Ae,ce);break e}Ae=ze;break e;case 3:ze.flags=ze.flags&-65537|128;case 0:if(ze=Xe.payload,ce=typeof ze=="function"?ze.call(Kt,Ae,ce):ze,ce==null)break e;Ae=b({},Ae,ce);break e;case 2:nr=!0}}ce=k.callback,ce!==null&&(a.flags|=64,pe&&(a.flags|=8192),pe=T.callbacks,pe===null?T.callbacks=[ce]:pe.push(ce))}else pe={lane:ce,tag:k.tag,payload:k.payload,callback:k.callback,next:null},ve===null?(ue=ve=pe,Y=Ae):ve=ve.next=pe,C|=ce;if(k=k.next,k===null){if(k=T.shared.pending,k===null)break;pe=k,k=pe.next,pe.next=null,T.lastBaseUpdate=pe,T.shared.pending=null}}while(!0);ve===null&&(Y=Ae),T.baseState=Y,T.firstBaseUpdate=ue,T.lastBaseUpdate=ve,x===null&&(T.shared.lanes=0),zs|=C,a.lanes=C,a.memoizedState=Ae}}function rm(a,r){if(typeof a!="function")throw Error(s(191,a));a.call(r)}function Xr(a,r){var c=a.callbacks;if(c!==null)for(a.callbacks=null,a=0;a<c.length;a++)rm(c[a],r)}var Kn=Q(null),Ko=Q(0);function fS(a,r){a=Bs,Le(Ko,a),Le(Kn,r),Bs=a|r.baseLanes}function id(){Le(Ko,Bs),Le(Kn,Kn.current)}function cc(){Bs=Ko.current,de(Kn),de(Ko)}var Xi=Q(null),_a=null;function dl(a){var r=a.alternate;Le(hn,hn.current&1),Le(Xi,a),_a===null&&(r===null||Kn.current!==null||r.memoizedState!==null)&&(_a=a)}function fc(a){Le(hn,hn.current),Le(Xi,a),_a===null&&(_a=a)}function om(a){a.tag===22?(Le(hn,hn.current),Le(Xi,a),_a===null&&(_a=a)):Is()}function Is(){Le(hn,hn.current),Le(Xi,Xi.current)}function Qi(a){de(Xi),_a===a&&(_a=null),de(hn)}var hn=Q(0);function dc(a){for(var r=a;r!==null;){if(r.tag===13){var c=r.memoizedState;if(c!==null&&(c=c.dehydrated,c===null||rs(c)||ro(c)))return r}else if(r.tag===19&&(r.memoizedProps.revealOrder==="forwards"||r.memoizedProps.revealOrder==="backwards"||r.memoizedProps.revealOrder==="unstable_legacy-backwards"||r.memoizedProps.revealOrder==="together")){if(r.flags&128)return r}else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return null;r=r.return}r.sibling.return=r.return,r=r.sibling}return null}var hl=0,ot=null,Ft=null,wn=null,Xo=!1,Qo=!1,ar=!1,ad=0,hc=0,Qr=null,dS=0;function Sn(){throw Error(s(321))}function sr(a,r){if(r===null)return!1;for(var c=0;c<r.length&&c<a.length;c++)if(!Oi(a[c],r[c]))return!1;return!0}function sd(a,r,c,m,T,x){return hl=x,ot=r,r.memoizedState=null,r.updateQueue=null,r.lanes=0,F.H=a===null||a.memoizedState===null?ES:Rm,ar=!1,x=c(m,T),ar=!1,Qo&&(x=hS(r,c,m,T)),um(a),x}function um(a){F.H=md;var r=Ft!==null&&Ft.next!==null;if(hl=0,wn=Ft=ot=null,Xo=!1,hc=0,Qr=null,r)throw Error(s(300));a===null||Nn||(a=a.dependencies,a!==null&&$o(a)&&(Nn=!0))}function hS(a,r,c,m){ot=a;var T=0;do{if(Qo&&(Qr=null),hc=0,Qo=!1,25<=T)throw Error(s(301));if(T+=1,wn=Ft=null,a.updateQueue!=null){var x=a.updateQueue;x.lastEffect=null,x.events=null,x.stores=null,x.memoCache!=null&&(x.memoCache.index=0)}F.H=TS,x=r(c,m)}while(Qo);return x}function Fb(){var a=F.H,r=a.useState()[0];return r=typeof r.then=="function"?Jo(r):r,a=a.useState()[0],(Ft!==null?Ft.memoizedState:null)!==a&&(ot.flags|=1024),r}function cm(){var a=ad!==0;return ad=0,a}function Zo(a,r,c){r.updateQueue=a.updateQueue,r.flags&=-2053,a.lanes&=~c}function ld(a){if(Xo){for(a=a.memoizedState;a!==null;){var r=a.queue;r!==null&&(r.pending=null),a=a.next}Xo=!1}hl=0,wn=Ft=ot=null,Qo=!1,hc=ad=0,Qr=null}function si(){var a={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return wn===null?ot.memoizedState=wn=a:wn=wn.next=a,wn}function Rn(){if(Ft===null){var a=ot.alternate;a=a!==null?a.memoizedState:null}else a=Ft.next;var r=wn===null?ot.memoizedState:wn.next;if(r!==null)wn=r,Ft=a;else{if(a===null)throw ot.alternate===null?Error(s(467)):Error(s(310));Ft=a,a={memoizedState:Ft.memoizedState,baseState:Ft.baseState,baseQueue:Ft.baseQueue,queue:Ft.queue,next:null},wn===null?ot.memoizedState=wn=a:wn=wn.next=a}return wn}function rd(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Jo(a){var r=hc;return hc+=1,Qr===null&&(Qr=[]),a=V0(Qr,a,r),r=ot,(wn===null?r.memoizedState:wn.next)===null&&(r=r.alternate,F.H=r===null||r.memoizedState===null?ES:Rm),a}function mc(a){if(a!==null&&typeof a=="object"){if(typeof a.then=="function")return Jo(a);if(a.$$typeof===z)return Re(a)}throw Error(s(438,String(a)))}function fm(a){var r=null,c=ot.updateQueue;if(c!==null&&(r=c.memoCache),r==null){var m=ot.alternate;m!==null&&(m=m.updateQueue,m!==null&&(m=m.memoCache,m!=null&&(r={data:m.data.map(function(T){return T.slice()}),index:0})))}if(r==null&&(r={data:[],index:0}),c===null&&(c=rd(),ot.updateQueue=c),c.memoCache=r,c=r.data[r.index],c===void 0)for(c=r.data[r.index]=Array(a),m=0;m<a;m++)c[m]=$;return r.index++,c}function ml(a,r){return typeof r=="function"?r(a):r}function gl(a){var r=Rn();return dm(r,Ft,a)}function dm(a,r,c){var m=a.queue;if(m===null)throw Error(s(311));m.lastRenderedReducer=c;var T=a.baseQueue,x=m.pending;if(x!==null){if(T!==null){var C=T.next;T.next=x.next,x.next=C}r.baseQueue=T=x,m.pending=null}if(x=a.baseState,T===null)a.memoizedState=x;else{r=T.next;var k=C=null,Y=null,ue=r,ve=!1;do{var Ae=ue.lane&-536870913;if(Ae!==ue.lane?(yt&Ae)===Ae:(hl&Ae)===Ae){var ce=ue.revertLane;if(ce===0)Y!==null&&(Y=Y.next={lane:0,revertLane:0,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null}),Ae===Gr&&(ve=!0);else if((hl&ce)===ce){ue=ue.next,ce===Gr&&(ve=!0);continue}else Ae={lane:0,revertLane:ue.revertLane,gesture:null,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(k=Y=Ae,C=x):Y=Y.next=Ae,ot.lanes|=ce,zs|=ce;Ae=ue.action,ar&&c(x,Ae),x=ue.hasEagerState?ue.eagerState:c(x,Ae)}else ce={lane:Ae,revertLane:ue.revertLane,gesture:ue.gesture,action:ue.action,hasEagerState:ue.hasEagerState,eagerState:ue.eagerState,next:null},Y===null?(k=Y=ce,C=x):Y=Y.next=ce,ot.lanes|=Ae,zs|=Ae;ue=ue.next}while(ue!==null&&ue!==r);if(Y===null?C=x:Y.next=k,!Oi(x,a.memoizedState)&&(Nn=!0,ve&&(c=Gn,c!==null)))throw c;a.memoizedState=x,a.baseState=C,a.baseQueue=Y,m.lastRenderedState=x}return T===null&&(m.lanes=0),[a.memoizedState,m.dispatch]}function hm(a){var r=Rn(),c=r.queue;if(c===null)throw Error(s(311));c.lastRenderedReducer=a;var m=c.dispatch,T=c.pending,x=r.memoizedState;if(T!==null){c.pending=null;var C=T=T.next;do x=a(x,C.action),C=C.next;while(C!==T);Oi(x,r.memoizedState)||(Nn=!0),r.memoizedState=x,r.baseQueue===null&&(r.baseState=x),c.lastRenderedState=x}return[x,m]}function X0(a,r,c){var m=ot,T=Rn(),x=Tt;if(x){if(c===void 0)throw Error(s(407));c=c()}else c=r();var C=!Oi((Ft||T).memoizedState,c);if(C&&(T.memoizedState=c,Nn=!0),T=T.queue,vm(mm.bind(null,m,T,a),[a]),T.getSnapshot!==r||C||wn!==null&&wn.memoizedState.tag&1){if(m.flags|=2048,eu(9,{destroy:void 0},Q0.bind(null,m,T,c,r),null),Yt===null)throw Error(s(349));x||hl&127||od(m,r,c)}return c}function od(a,r,c){a.flags|=16384,a={getSnapshot:r,value:c},r=ot.updateQueue,r===null?(r=rd(),ot.updateQueue=r,r.stores=[a]):(c=r.stores,c===null?r.stores=[a]:c.push(a))}function Q0(a,r,c,m){r.value=c,r.getSnapshot=m,gm(r)&&pm(a)}function mm(a,r,c){return c(function(){gm(r)&&pm(a)})}function gm(a){var r=a.getSnapshot;a=a.value;try{var c=r();return!Oi(a,c)}catch{return!0}}function pm(a){var r=Ql(a,2);r!==null&&na(r,a,2)}function Z0(a){var r=si();if(typeof a=="function"){var c=a;if(a=c(),ar){Ka(!0);try{c()}finally{Ka(!1)}}}return r.memoizedState=r.baseState=a,r.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ml,lastRenderedState:a},r}function li(a,r,c,m){return a.baseState=c,dm(a,Ft,typeof m=="function"?m:ml)}function mS(a,r,c,m,T){if(hd(a))throw Error(s(485));if(a=r.action,a!==null){var x={payload:T,action:a,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(C){x.listeners.push(C)}};F.T!==null?c(!0):x.isTransition=!1,m(x),c=r.pending,c===null?(x.next=r.pending=x,J0(r,x)):(x.next=c.next,r.pending=c.next=x)}}function J0(a,r){var c=r.action,m=r.payload,T=a.state;if(r.isTransition){var x=F.T,C={};F.T=C;try{var k=c(T,m),Y=F.S;Y!==null&&Y(C,k),W0(a,r,k)}catch(ue){Wo(a,r,ue)}finally{x!==null&&C.types!==null&&(x.types=C.types),F.T=x}}else try{x=c(T,m),W0(a,r,x)}catch(ue){Wo(a,r,ue)}}function W0(a,r,c){c!==null&&typeof c=="object"&&typeof c.then=="function"?c.then(function(m){ep(a,r,m)},function(m){return Wo(a,r,m)}):ep(a,r,c)}function ep(a,r,c){r.status="fulfilled",r.value=c,tp(r),a.state=c,r=a.pending,r!==null&&(c=r.next,c===r?a.pending=null:(c=c.next,r.next=c,J0(a,c)))}function Wo(a,r,c){var m=a.pending;if(a.pending=null,m!==null){m=m.next;do r.status="rejected",r.reason=c,tp(r),r=r.next;while(r!==m)}a.action=null}function tp(a){a=a.listeners;for(var r=0;r<a.length;r++)(0,a[r])()}function ud(a,r){return r}function np(a,r){if(Tt){var c=Yt.formState;if(c!==null){e:{var m=ot;if(Tt){if(Wt){t:{for(var T=Wt,x=qn;T.nodeType!==8;){if(!x){T=null;break t}if(T=ia(T.nextSibling),T===null){T=null;break t}}x=T.data,T=x==="F!"||x==="F"?T:null}if(T){Wt=ia(T.nextSibling),m=T.data==="F!";break e}}is(m)}m=!1}m&&(r=c[0])}}return c=si(),c.memoizedState=c.baseState=r,m={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ud,lastRenderedState:r},c.queue=m,c=xm.bind(null,ot,m),m.dispatch=c,m=Z0(!1),x=Zr.bind(null,ot,!1,m.queue),m=si(),T={state:r,dispatch:null,action:a,pending:null},m.queue=T,c=mS.bind(null,ot,T,x,c),T.dispatch=c,m.memoizedState=a,[r,c,!1]}function gS(a){var r=Rn();return cd(r,Ft,a)}function cd(a,r,c){if(r=dm(a,r,ud)[0],a=gl(ml)[0],typeof r=="object"&&r!==null&&typeof r.then=="function")try{var m=Jo(r)}catch(C){throw C===$r?oc:C}else m=r;r=Rn();var T=r.queue,x=T.dispatch;return c!==r.memoizedState&&(ot.flags|=2048,eu(9,{destroy:void 0},ip.bind(null,T,c),null)),[m,x,a]}function ip(a,r){a.action=r}function ap(a){var r=Rn(),c=Ft;if(c!==null)return cd(r,c,a);Rn(),r=r.memoizedState,c=Rn();var m=c.queue.dispatch;return c.memoizedState=a,[r,m,!1]}function eu(a,r,c,m){return a={tag:a,create:c,deps:m,inst:r,next:null},r=ot.updateQueue,r===null&&(r=rd(),ot.updateQueue=r),c=r.lastEffect,c===null?r.lastEffect=a.next=a:(m=c.next,c.next=a,a.next=m,r.lastEffect=a),a}function sp(){return Rn().memoizedState}function gc(a,r,c,m){var T=si();ot.flags|=a,T.memoizedState=eu(1|r,{destroy:void 0},c,m===void 0?null:m)}function pc(a,r,c,m){var T=Rn();m=m===void 0?null:m;var x=T.memoizedState.inst;Ft!==null&&m!==null&&sr(m,Ft.memoizedState.deps)?T.memoizedState=eu(r,x,c,m):(ot.flags|=a,T.memoizedState=eu(1|r,x,c,m))}function ym(a,r){gc(8390656,8,a,r)}function vm(a,r){pc(2048,8,a,r)}function lp(a){ot.flags|=4;var r=ot.updateQueue;if(r===null)r=rd(),ot.updateQueue=r,r.events=[a];else{var c=r.events;c===null?r.events=[a]:c.push(a)}}function fd(a){var r=Rn().memoizedState;return lp({ref:r,nextImpl:a}),function(){if(Mt&2)throw Error(s(440));return r.impl.apply(void 0,arguments)}}function Sm(a,r){return pc(4,2,a,r)}function rp(a,r){return pc(4,4,a,r)}function Em(a,r){if(typeof r=="function"){a=a();var c=r(a);return function(){typeof c=="function"?c():r(null)}}if(r!=null)return a=a(),r.current=a,function(){r.current=null}}function op(a,r,c){c=c!=null?c.concat([a]):null,pc(4,4,Em.bind(null,r,a),c)}function ws(){}function Tm(a,r){var c=Rn();r=r===void 0?null:r;var m=c.memoizedState;return r!==null&&sr(r,m[1])?m[0]:(c.memoizedState=[a,r],a)}function pS(a,r){var c=Rn();r=r===void 0?null:r;var m=c.memoizedState;if(r!==null&&sr(r,m[1]))return m[0];if(m=a(),ar){Ka(!0);try{a()}finally{Ka(!1)}}return c.memoizedState=[m,r],m}function dd(a,r,c){return c===void 0||hl&1073741824&&!(yt&261930)?a.memoizedState=r:(a.memoizedState=c,a=MS(),ot.lanes|=a,zs|=a,c)}function pl(a,r,c,m){return Oi(c,r)?c:Kn.current!==null?(a=dd(a,c,m),Oi(a,r)||(Nn=!0),a):!(hl&42)||hl&1073741824&&!(yt&261930)?(Nn=!0,a.memoizedState=c):(a=MS(),ot.lanes|=a,zs|=a,r)}function bm(a,r,c,m,T){var x=ne.p;ne.p=x!==0&&8>x?x:8;var C=F.T,k={};F.T=k,Zr(a,!1,r,c);try{var Y=T(),ue=F.S;if(ue!==null&&ue(k,Y),Y!==null&&typeof Y=="object"&&typeof Y.then=="function"){var ve=Wf(Y,m);lr(a,r,ve,da(a))}else lr(a,r,m,da(a))}catch(Ae){lr(a,r,{then:function(){},status:"rejected",reason:Ae},da())}finally{ne.p=x,C!==null&&k.types!==null&&(C.types=k.types),F.T=C}}function yS(){}function yc(a,r,c,m){if(a.tag!==5)throw Error(s(476));var T=vc(a).queue;bm(a,T,r,le,c===null?yS:function(){return Vt(a),c(m)})}function vc(a){var r=a.memoizedState;if(r!==null)return r;r={memoizedState:le,baseState:le,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ml,lastRenderedState:le},next:null};var c={};return r.next={memoizedState:c,baseState:c,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ml,lastRenderedState:c},next:null},a.memoizedState=r,a=a.alternate,a!==null&&(a.memoizedState=r),r}function Vt(a){var r=vc(a);r.next===null&&(r=a.alternate.memoizedState),lr(a,r.next.queue,{},da())}function up(){return Re(Gd)}function vS(){return Rn().memoizedState}function cp(){return Rn().memoizedState}function yl(a){for(var r=a.return;r!==null;){switch(r.tag){case 24:case 3:var c=da();a=ir(c);var m=La(r,a,c);m!==null&&(na(m,r,c),qr(m,r,c)),r={cache:Xf()},a.payload=r;return}r=r.return}}function SS(a,r,c){var m=da();c={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null},hd(a)?Am(r,c):(c=ts(a,r,c,m),c!==null&&(na(c,a,m),fp(c,r,m)))}function xm(a,r,c){var m=da();lr(a,r,c,m)}function lr(a,r,c,m){var T={lane:m,revertLane:0,gesture:null,action:c,hasEagerState:!1,eagerState:null,next:null};if(hd(a))Am(r,T);else{var x=a.alternate;if(a.lanes===0&&(x===null||x.lanes===0)&&(x=r.lastRenderedReducer,x!==null))try{var C=r.lastRenderedState,k=x(C,c);if(T.hasEagerState=!0,T.eagerState=k,Oi(k,C))return ba(a,r,T,0),Yt===null&&Ta(),!1}catch{}finally{}if(c=ts(a,r,T,m),c!==null)return na(c,a,m),fp(c,r,m),!0}return!1}function Zr(a,r,c,m){if(m={lane:2,revertLane:Qm(),gesture:null,action:m,hasEagerState:!1,eagerState:null,next:null},hd(a)){if(r)throw Error(s(479))}else r=ts(a,c,m,2),r!==null&&na(r,a,2)}function hd(a){var r=a.alternate;return a===ot||r!==null&&r===ot}function Am(a,r){Qo=Xo=!0;var c=a.pending;c===null?r.next=r:(r.next=c.next,c.next=r),a.pending=r}function fp(a,r,c){if(c&4194048){var m=r.lanes;m&=a.pendingLanes,c|=m,r.lanes=c,Js(a,c)}}var md={readContext:Re,use:mc,useCallback:Sn,useContext:Sn,useEffect:Sn,useImperativeHandle:Sn,useLayoutEffect:Sn,useInsertionEffect:Sn,useMemo:Sn,useReducer:Sn,useRef:Sn,useState:Sn,useDebugValue:Sn,useDeferredValue:Sn,useTransition:Sn,useSyncExternalStore:Sn,useId:Sn,useHostTransitionStatus:Sn,useFormState:Sn,useActionState:Sn,useOptimistic:Sn,useMemoCache:Sn,useCacheRefresh:Sn};md.useEffectEvent=Sn;var ES={readContext:Re,use:mc,useCallback:function(a,r){return si().memoizedState=[a,r===void 0?null:r],a},useContext:Re,useEffect:ym,useImperativeHandle:function(a,r,c){c=c!=null?c.concat([a]):null,gc(4194308,4,Em.bind(null,r,a),c)},useLayoutEffect:function(a,r){return gc(4194308,4,a,r)},useInsertionEffect:function(a,r){gc(4,2,a,r)},useMemo:function(a,r){var c=si();r=r===void 0?null:r;var m=a();if(ar){Ka(!0);try{a()}finally{Ka(!1)}}return c.memoizedState=[m,r],m},useReducer:function(a,r,c){var m=si();if(c!==void 0){var T=c(r);if(ar){Ka(!0);try{c(r)}finally{Ka(!1)}}}else T=r;return m.memoizedState=m.baseState=T,a={pending:null,lanes:0,dispatch:null,lastRenderedReducer:a,lastRenderedState:T},m.queue=a,a=a.dispatch=SS.bind(null,ot,a),[m.memoizedState,a]},useRef:function(a){var r=si();return a={current:a},r.memoizedState=a},useState:function(a){a=Z0(a);var r=a.queue,c=xm.bind(null,ot,r);return r.dispatch=c,[a.memoizedState,c]},useDebugValue:ws,useDeferredValue:function(a,r){var c=si();return dd(c,a,r)},useTransition:function(){var a=Z0(!1);return a=bm.bind(null,ot,a.queue,!0,!1),si().memoizedState=a,[!1,a]},useSyncExternalStore:function(a,r,c){var m=ot,T=si();if(Tt){if(c===void 0)throw Error(s(407));c=c()}else{if(c=r(),Yt===null)throw Error(s(349));yt&127||od(m,r,c)}T.memoizedState=c;var x={value:c,getSnapshot:r};return T.queue=x,ym(mm.bind(null,m,x,a),[a]),m.flags|=2048,eu(9,{destroy:void 0},Q0.bind(null,m,x,c,r),null),c},useId:function(){var a=si(),r=Yt.identifierPrefix;if(Tt){var c=Cs,m=oa;c=(m&~(1<<32-ye(m)-1)).toString(32)+c,r="_"+r+"R_"+c,c=ad++,0<c&&(r+="H"+c.toString(32)),r+="_"}else c=dS++,r="_"+r+"r_"+c.toString(32)+"_";return a.memoizedState=r},useHostTransitionStatus:up,useFormState:np,useActionState:np,useOptimistic:function(a){var r=si();r.memoizedState=r.baseState=a;var c={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return r.queue=c,r=Zr.bind(null,ot,!0,c),c.dispatch=r,[a,r]},useMemoCache:fm,useCacheRefresh:function(){return si().memoizedState=yl.bind(null,ot)},useEffectEvent:function(a){var r=si(),c={impl:a};return r.memoizedState=c,function(){if(Mt&2)throw Error(s(440));return c.impl.apply(void 0,arguments)}}},Rm={readContext:Re,use:mc,useCallback:Tm,useContext:Re,useEffect:vm,useImperativeHandle:op,useInsertionEffect:Sm,useLayoutEffect:rp,useMemo:pS,useReducer:gl,useRef:sp,useState:function(){return gl(ml)},useDebugValue:ws,useDeferredValue:function(a,r){var c=Rn();return pl(c,Ft.memoizedState,a,r)},useTransition:function(){var a=gl(ml)[0],r=Rn().memoizedState;return[typeof a=="boolean"?a:Jo(a),r]},useSyncExternalStore:X0,useId:vS,useHostTransitionStatus:up,useFormState:gS,useActionState:gS,useOptimistic:function(a,r){var c=Rn();return li(c,Ft,a,r)},useMemoCache:fm,useCacheRefresh:cp};Rm.useEffectEvent=fd;var TS={readContext:Re,use:mc,useCallback:Tm,useContext:Re,useEffect:vm,useImperativeHandle:op,useInsertionEffect:Sm,useLayoutEffect:rp,useMemo:pS,useReducer:hm,useRef:sp,useState:function(){return hm(ml)},useDebugValue:ws,useDeferredValue:function(a,r){var c=Rn();return Ft===null?dd(c,a,r):pl(c,Ft.memoizedState,a,r)},useTransition:function(){var a=hm(ml)[0],r=Rn().memoizedState;return[typeof a=="boolean"?a:Jo(a),r]},useSyncExternalStore:X0,useId:vS,useHostTransitionStatus:up,useFormState:ap,useActionState:ap,useOptimistic:function(a,r){var c=Rn();return Ft!==null?li(c,Ft,a,r):(c.baseState=a,[a,c.queue.dispatch])},useMemoCache:fm,useCacheRefresh:cp};TS.useEffectEvent=fd;function tu(a,r,c,m){r=a.memoizedState,c=c(m,r),c=c==null?r:b({},r,c),a.memoizedState=c,a.lanes===0&&(a.updateQueue.baseState=c)}var as={enqueueSetState:function(a,r,c){a=a._reactInternals;var m=da(),T=ir(m);T.payload=r,c!=null&&(T.callback=c),r=La(a,T,m),r!==null&&(na(r,a,m),qr(r,a,m))},enqueueReplaceState:function(a,r,c){a=a._reactInternals;var m=da(),T=ir(m);T.tag=1,T.payload=r,c!=null&&(T.callback=c),r=La(a,T,m),r!==null&&(na(r,a,m),qr(r,a,m))},enqueueForceUpdate:function(a,r){a=a._reactInternals;var c=da(),m=ir(c);m.tag=2,r!=null&&(m.callback=r),r=La(a,m,c),r!==null&&(na(r,a,c),qr(r,a,c))}};function dp(a,r,c,m,T,x,C){return a=a.stateNode,typeof a.shouldComponentUpdate=="function"?a.shouldComponentUpdate(m,x,C):r.prototype&&r.prototype.isPureReactComponent?!Ja(c,m)||!Ja(T,x):!0}function bS(a,r,c,m){a=r.state,typeof r.componentWillReceiveProps=="function"&&r.componentWillReceiveProps(c,m),typeof r.UNSAFE_componentWillReceiveProps=="function"&&r.UNSAFE_componentWillReceiveProps(c,m),r.state!==a&&as.enqueueReplaceState(r,r.state,null)}function Jr(a,r){var c=r;if("ref"in r){c={};for(var m in r)m!=="ref"&&(c[m]=r[m])}if(a=a.defaultProps){c===r&&(c=b({},c));for(var T in a)c[T]===void 0&&(c[T]=a[T])}return c}function Dm(a){Fo(a)}function hp(a){console.error(a)}function Lm(a){Fo(a)}function Sc(a,r){try{var c=a.onUncaughtError;c(r.value,{componentStack:r.stack})}catch(m){setTimeout(function(){throw m})}}function gd(a,r,c){try{var m=a.onCaughtError;m(c.value,{componentStack:c.stack,errorBoundary:r.tag===1?r.stateNode:null})}catch(T){setTimeout(function(){throw T})}}function mp(a,r,c){return c=ir(c),c.tag=3,c.payload={element:null},c.callback=function(){Sc(a,r)},c}function gp(a){return a=ir(a),a.tag=3,a}function pp(a,r,c,m){var T=c.type.getDerivedStateFromError;if(typeof T=="function"){var x=m.value;a.payload=function(){return T(x)},a.callback=function(){gd(r,c,m)}}var C=c.stateNode;C!==null&&typeof C.componentDidCatch=="function"&&(a.callback=function(){gd(r,c,m),typeof T!="function"&&(mn===null?mn=new Set([this]):mn.add(this));var k=m.stack;this.componentDidCatch(m.value,{componentStack:k!==null?k:""})})}function Pb(a,r,c,m,T){if(c.flags|=32768,m!==null&&typeof m=="object"&&typeof m.then=="function"){if(r=c.alternate,r!==null&&ai(r,c,T,!0),c=Xi.current,c!==null){switch(c.tag){case 31:case 13:return _a===null?Ym():c.alternate===null&&tn===0&&(tn=3),c.flags&=-257,c.flags|=65536,c.lanes=T,m===Yo?c.flags|=16384:(r=c.updateQueue,r===null?c.updateQueue=new Set([m]):r.add(m),Cd(a,m,T)),!1;case 22:return c.flags|=65536,m===Yo?c.flags|=16384:(r=c.updateQueue,r===null?(r={transitions:null,markerInstances:null,retryQueue:new Set([m])},c.updateQueue=r):(c=r.retryQueue,c===null?r.retryQueue=new Set([m]):c.add(m)),Cd(a,m,T)),!1}throw Error(s(435,c.tag))}return Cd(a,m,T),Ym(),!1}if(Tt)return r=Xi.current,r!==null?(!(r.flags&65536)&&(r.flags|=256),r.flags|=65536,r.lanes=T,m!==ol&&(a=Error(s(422),{cause:m}),lc(xa(a,c)))):(m!==ol&&(r=Error(s(423),{cause:m}),lc(xa(r,c))),a=a.current.alternate,a.flags|=65536,T&=-T,a.lanes|=T,m=xa(m,c),T=mp(a.stateNode,m,T),lm(a,T),tn!==4&&(tn=2)),!1;var x=Error(s(520),{cause:m});if(x=xa(x,c),Rd===null?Rd=[x]:Rd.push(x),tn!==4&&(tn=2),r===null)return!0;m=xa(m,c),c=r;do{switch(c.tag){case 3:return c.flags|=65536,a=T&-T,c.lanes|=a,a=mp(c.stateNode,m,a),lm(c,a),!1;case 1:if(r=c.type,x=c.stateNode,(c.flags&128)===0&&(typeof r.getDerivedStateFromError=="function"||x!==null&&typeof x.componentDidCatch=="function"&&(mn===null||!mn.has(x))))return c.flags|=65536,T&=-T,c.lanes|=T,T=gp(T),pp(T,a,c,m),lm(c,T),!1}c=c.return}while(c!==null);return!1}var _m=Error(s(461)),Nn=!1;function on(a,r,c,m){r.child=a===null?q0(r,null,c,m):Yr(r,a.child,c,m)}function yp(a,r,c,m,T){c=c.render;var x=r.ref;if("ref"in m){var C={};for(var k in m)k!=="ref"&&(C[k]=m[k])}else C=m;return et(r),m=sd(a,r,c,C,x,T),k=cm(),a!==null&&!Nn?(Zo(a,r,T),Ma(a,r,T)):(Tt&&k&&ac(r),r.flags|=1,on(a,r,m,T),r.child)}function vp(a,r,c,m,T){if(a===null){var x=c.type;return typeof x=="function"&&!Po(x)&&x.defaultProps===void 0&&c.compare===null?(r.tag=15,r.type=x,Sp(a,r,x,m,T)):(a=Wh(c.type,null,m,r,r.mode,T),a.ref=r.ref,a.return=r,r.child=a)}if(x=a.child,!Mm(a,T)){var C=x.memoizedProps;if(c=c.compare,c=c!==null?c:Ja,c(C,m)&&a.ref===r.ref)return Ma(a,r,T)}return r.flags|=1,a=Zl(x,m),a.ref=r.ref,a.return=r,r.child=a}function Sp(a,r,c,m,T){if(a!==null){var x=a.memoizedProps;if(Ja(x,m)&&a.ref===r.ref)if(Nn=!1,r.pendingProps=m=x,Mm(a,T))a.flags&131072&&(Nn=!0);else return r.lanes=a.lanes,Ma(a,r,T)}return Cm(a,r,c,m,T)}function xS(a,r,c,m){var T=m.children,x=a!==null?a.memoizedState:null;if(a===null&&r.stateNode===null&&(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),m.mode==="hidden"){if(r.flags&128){if(x=x!==null?x.baseLanes|c:c,a!==null){for(m=r.child=a.child,T=0;m!==null;)T=T|m.lanes|m.childLanes,m=m.sibling;m=T&~x}else m=0,r.child=null;return Zi(a,r,x,c,m)}if(c&536870912)r.memoizedState={baseLanes:0,cachePool:null},a!==null&&rc(r,x!==null?x.cachePool:null),x!==null?fS(r,x):id(),om(r);else return m=r.lanes=536870912,Zi(a,r,x!==null?x.baseLanes|c:c,c,m)}else x!==null?(rc(r,x.cachePool),fS(r,x),Is(),r.memoizedState=null):(a!==null&&rc(r,null),id(),Is());return on(a,r,T,c),r.child}function Wr(a,r){return a!==null&&a.tag===22||r.stateNode!==null||(r.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),r.sibling}function Zi(a,r,c,m,T){var x=Da();return x=x===null?null:{parent:In._currentValue,pool:x},r.memoizedState={baseLanes:c,cachePool:x},a!==null&&rc(r,null),id(),om(r),a!==null&&ai(a,r,m,!0),r.childLanes=T,null}function pd(a,r){return r=Sd({mode:r.mode,children:r.children},a.mode),r.ref=a.ref,a.child=r,r.return=a,r}function Ji(a,r,c){return Yr(r,a.child,null,c),a=pd(r,r.pendingProps),a.flags|=2,Qi(r),r.memoizedState=null,a}function AS(a,r,c){var m=r.pendingProps,T=(r.flags&128)!==0;if(r.flags&=-129,a===null){if(Tt){if(m.mode==="hidden")return a=pd(r,m),r.lanes=536870912,Wr(null,a);if(fc(r),(a=Wt)?(a=sE(a,qn),a=a!==null&&a.data==="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:_s!==null?{id:oa,overflow:Cs}:null,retryLane:536870912,hydrationErrors:null},c=z0(a),c.return=r,r.child=c,ii=r,Wt=null)):a=null,a===null)throw is(r);return r.lanes=536870912,null}return pd(r,m)}var x=a.memoizedState;if(x!==null){var C=x.dehydrated;if(fc(r),T)if(r.flags&256)r.flags&=-257,r=Ji(a,r,c);else if(r.memoizedState!==null)r.child=a.child,r.flags|=128,r=null;else throw Error(s(558));else if(Nn||ai(a,r,c,!1),T=(c&a.childLanes)!==0,Nn||T){if(m=Yt,m!==null&&(C=va(m,c),C!==0&&C!==x.retryLane))throw x.retryLane=C,Ql(a,C),na(m,a,C),_m;Ym(),r=Ji(a,r,c)}else a=x.treeContext,Wt=ia(C.nextSibling),ii=r,Tt=!0,rl=null,qn=!1,a!==null&&Yf(r,a),r=pd(r,m),r.flags|=4096;return r}return a=Zl(a.child,{mode:m.mode,children:m.children}),a.ref=r.ref,r.child=a,a.return=r,a}function Ca(a,r){var c=r.ref;if(c===null)a!==null&&a.ref!==null&&(r.flags|=4194816);else{if(typeof c!="function"&&typeof c!="object")throw Error(s(284));(a===null||a.ref!==c)&&(r.flags|=4194816)}}function Cm(a,r,c,m,T){return et(r),c=sd(a,r,c,m,void 0,T),m=cm(),a!==null&&!Nn?(Zo(a,r,T),Ma(a,r,T)):(Tt&&m&&ac(r),r.flags|=1,on(a,r,c,T),r.child)}function eo(a,r,c,m,T,x){return et(r),r.updateQueue=null,c=hS(r,m,c,T),um(a),m=cm(),a!==null&&!Nn?(Zo(a,r,x),Ma(a,r,x)):(Tt&&m&&ac(r),r.flags|=1,on(a,r,c,x),r.child)}function Ep(a,r,c,m,T){if(et(r),r.stateNode===null){var x=Yi,C=c.contextType;typeof C=="object"&&C!==null&&(x=Re(C)),x=new c(m,x),r.memoizedState=x.state!==null&&x.state!==void 0?x.state:null,x.updater=as,r.stateNode=x,x._reactInternals=r,x=r.stateNode,x.props=m,x.state=r.memoizedState,x.refs={},nd(r),C=c.contextType,x.context=typeof C=="object"&&C!==null?Re(C):Yi,x.state=r.memoizedState,C=c.getDerivedStateFromProps,typeof C=="function"&&(tu(r,c,C,m),x.state=r.memoizedState),typeof c.getDerivedStateFromProps=="function"||typeof x.getSnapshotBeforeUpdate=="function"||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(C=x.state,typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount(),C!==x.state&&as.enqueueReplaceState(x,x.state,null),fl(r,m,x,T),Kr(),x.state=r.memoizedState),typeof x.componentDidMount=="function"&&(r.flags|=4194308),m=!0}else if(a===null){x=r.stateNode;var k=r.memoizedProps,Y=Jr(c,k);x.props=Y;var ue=x.context,ve=c.contextType;C=Yi,typeof ve=="object"&&ve!==null&&(C=Re(ve));var Ae=c.getDerivedStateFromProps;ve=typeof Ae=="function"||typeof x.getSnapshotBeforeUpdate=="function",k=r.pendingProps!==k,ve||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(k||ue!==C)&&bS(r,x,m,C),nr=!1;var ce=r.memoizedState;x.state=ce,fl(r,m,x,T),Kr(),ue=r.memoizedState,k||ce!==ue||nr?(typeof Ae=="function"&&(tu(r,c,Ae,m),ue=r.memoizedState),(Y=nr||dp(r,c,Y,m,ce,ue,C))?(ve||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(r.flags|=4194308)):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),r.memoizedProps=m,r.memoizedState=ue),x.props=m,x.state=ue,x.context=C,m=Y):(typeof x.componentDidMount=="function"&&(r.flags|=4194308),m=!1)}else{x=r.stateNode,sm(a,r),C=r.memoizedProps,ve=Jr(c,C),x.props=ve,Ae=r.pendingProps,ce=x.context,ue=c.contextType,Y=Yi,typeof ue=="object"&&ue!==null&&(Y=Re(ue)),k=c.getDerivedStateFromProps,(ue=typeof k=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(C!==Ae||ce!==Y)&&bS(r,x,m,Y),nr=!1,ce=r.memoizedState,x.state=ce,fl(r,m,x,T),Kr();var pe=r.memoizedState;C!==Ae||ce!==pe||nr||a!==null&&a.dependencies!==null&&$o(a.dependencies)?(typeof k=="function"&&(tu(r,c,k,m),pe=r.memoizedState),(ve=nr||dp(r,c,ve,m,ce,pe,Y)||a!==null&&a.dependencies!==null&&$o(a.dependencies))?(ue||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(m,pe,Y),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(m,pe,Y)),typeof x.componentDidUpdate=="function"&&(r.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(r.flags|=1024)):(typeof x.componentDidUpdate!="function"||C===a.memoizedProps&&ce===a.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ce===a.memoizedState||(r.flags|=1024),r.memoizedProps=m,r.memoizedState=pe),x.props=m,x.state=pe,x.context=Y,m=ve):(typeof x.componentDidUpdate!="function"||C===a.memoizedProps&&ce===a.memoizedState||(r.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||C===a.memoizedProps&&ce===a.memoizedState||(r.flags|=1024),m=!1)}return x=m,Ca(a,r),m=(r.flags&128)!==0,x||m?(x=r.stateNode,c=m&&typeof c.getDerivedStateFromError!="function"?null:x.render(),r.flags|=1,a!==null&&m?(r.child=Yr(r,a.child,null,T),r.child=Yr(r,null,c,T)):on(a,r,c,T),r.memoizedState=x.state,a=r.child):a=Ma(a,r,T),a}function Ns(a,r,c,m){return Pr(),r.flags|=256,on(a,r,c,m),r.child}var yd={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function vd(a){return{baseLanes:a,cachePool:jo()}}function Oa(a,r,c){return a=a!==null?a.childLanes&~c:0,r&&(a|=ta),a}function Tp(a,r,c){var m=r.pendingProps,T=!1,x=(r.flags&128)!==0,C;if((C=x)||(C=a!==null&&a.memoizedState===null?!1:(hn.current&2)!==0),C&&(T=!0,r.flags&=-129),C=(r.flags&32)!==0,r.flags&=-33,a===null){if(Tt){if(T?dl(r):Is(),(a=Wt)?(a=sE(a,qn),a=a!==null&&a.data!=="&"?a:null,a!==null&&(r.memoizedState={dehydrated:a,treeContext:_s!==null?{id:oa,overflow:Cs}:null,retryLane:536870912,hydrationErrors:null},c=z0(a),c.return=r,r.child=c,ii=r,Wt=null)):a=null,a===null)throw is(r);return ro(a)?r.lanes=32:r.lanes=536870912,null}var k=m.children;return m=m.fallback,T?(Is(),T=r.mode,k=Sd({mode:"hidden",children:k},T),m=Jl(m,T,c,null),k.return=r,m.return=r,k.sibling=m,r.child=k,m=r.child,m.memoizedState=vd(c),m.childLanes=Oa(a,C,c),r.memoizedState=yd,Wr(null,m)):(dl(r),to(r,k))}var Y=a.memoizedState;if(Y!==null&&(k=Y.dehydrated,k!==null)){if(x)r.flags&256?(dl(r),r.flags&=-257,r=nu(a,r,c)):r.memoizedState!==null?(Is(),r.child=a.child,r.flags|=128,r=null):(Is(),k=m.fallback,T=r.mode,m=Sd({mode:"visible",children:m.children},T),k=Jl(k,T,c,null),k.flags|=2,m.return=r,k.return=r,m.sibling=k,r.child=m,Yr(r,a.child,null,c),m=r.child,m.memoizedState=vd(c),m.childLanes=Oa(a,C,c),r.memoizedState=yd,r=Wr(null,m));else if(dl(r),ro(k)){if(C=k.nextSibling&&k.nextSibling.dataset,C)var ue=C.dgst;C=ue,m=Error(s(419)),m.stack="",m.digest=C,lc({value:m,source:null,stack:null}),r=nu(a,r,c)}else if(Nn||ai(a,r,c,!1),C=(c&a.childLanes)!==0,Nn||C){if(C=Yt,C!==null&&(m=va(C,c),m!==0&&m!==Y.retryLane))throw Y.retryLane=m,Ql(a,m),na(C,a,m),_m;rs(k)||Ym(),r=nu(a,r,c)}else rs(k)?(r.flags|=192,r.child=a.child,r=null):(a=Y.treeContext,Wt=ia(k.nextSibling),ii=r,Tt=!0,rl=null,qn=!1,a!==null&&Yf(r,a),r=to(r,m.children),r.flags|=4096);return r}return T?(Is(),k=m.fallback,T=r.mode,Y=a.child,ue=Y.sibling,m=Zl(Y,{mode:"hidden",children:m.children}),m.subtreeFlags=Y.subtreeFlags&65011712,ue!==null?k=Zl(ue,k):(k=Jl(k,T,c,null),k.flags|=2),k.return=r,m.return=r,m.sibling=k,r.child=m,Wr(null,m),m=r.child,k=a.child.memoizedState,k===null?k=vd(c):(T=k.cachePool,T!==null?(Y=In._currentValue,T=T.parent!==Y?{parent:Y,pool:Y}:T):T=jo(),k={baseLanes:k.baseLanes|c,cachePool:T}),m.memoizedState=k,m.childLanes=Oa(a,C,c),r.memoizedState=yd,Wr(a.child,m)):(dl(r),c=a.child,a=c.sibling,c=Zl(c,{mode:"visible",children:m.children}),c.return=r,c.sibling=null,a!==null&&(C=r.deletions,C===null?(r.deletions=[a],r.flags|=16):C.push(a)),r.child=c,r.memoizedState=null,c)}function to(a,r){return r=Sd({mode:"visible",children:r},a.mode),r.return=a,a.child=r}function Sd(a,r){return a=xn(22,a,null,r),a.lanes=0,a}function nu(a,r,c){return Yr(r,a.child,null,c),a=to(r,r.pendingProps.children),a.flags|=2,r.memoizedState=null,a}function iu(a,r,c){a.lanes|=r;var m=a.alternate;m!==null&&(m.lanes|=r),im(a.return,r,c)}function Om(a,r,c,m,T,x){var C=a.memoizedState;C===null?a.memoizedState={isBackwards:r,rendering:null,renderingStartTime:0,last:m,tail:c,tailMode:T,treeForkCount:x}:(C.isBackwards=r,C.rendering=null,C.renderingStartTime=0,C.last=m,C.tail=c,C.tailMode=T,C.treeForkCount=x)}function bp(a,r,c){var m=r.pendingProps,T=m.revealOrder,x=m.tail;m=m.children;var C=hn.current,k=(C&2)!==0;if(k?(C=C&1|2,r.flags|=128):C&=1,Le(hn,C),on(a,r,m,c),m=Tt?Mn:0,!k&&a!==null&&a.flags&128)e:for(a=r.child;a!==null;){if(a.tag===13)a.memoizedState!==null&&iu(a,c,r);else if(a.tag===19)iu(a,c,r);else if(a.child!==null){a.child.return=a,a=a.child;continue}if(a===r)break e;for(;a.sibling===null;){if(a.return===null||a.return===r)break e;a=a.return}a.sibling.return=a.return,a=a.sibling}switch(T){case"forwards":for(c=r.child,T=null;c!==null;)a=c.alternate,a!==null&&dc(a)===null&&(T=c),c=c.sibling;c=T,c===null?(T=r.child,r.child=null):(T=c.sibling,c.sibling=null),Om(r,!1,T,c,x,m);break;case"backwards":case"unstable_legacy-backwards":for(c=null,T=r.child,r.child=null;T!==null;){if(a=T.alternate,a!==null&&dc(a)===null){r.child=T;break}a=T.sibling,T.sibling=c,c=T,T=a}Om(r,!0,c,null,x,m);break;case"together":Om(r,!1,null,null,void 0,m);break;default:r.memoizedState=null}return r.child}function Ma(a,r,c){if(a!==null&&(r.dependencies=a.dependencies),zs|=r.lanes,!(c&r.childLanes))if(a!==null){if(ai(a,r,c,!1),(c&r.childLanes)===0)return null}else return null;if(a!==null&&r.child!==a.child)throw Error(s(153));if(r.child!==null){for(a=r.child,c=Zl(a,a.pendingProps),r.child=c,c.return=r;a.sibling!==null;)a=a.sibling,c=c.sibling=Zl(a,a.pendingProps),c.return=r;c.sibling=null}return r.child}function Mm(a,r){return a.lanes&r?!0:(a=a.dependencies,!!(a!==null&&$o(a)))}function Im(a,r,c){switch(r.tag){case 3:At(r,r.stateNode.containerInfo),Ki(r,In,a.memoizedState.cache),Pr();break;case 27:case 5:vi(r);break;case 4:At(r,r.stateNode.containerInfo);break;case 10:Ki(r,r.type,r.memoizedProps.value);break;case 31:if(r.memoizedState!==null)return r.flags|=128,fc(r),null;break;case 13:var m=r.memoizedState;if(m!==null)return m.dehydrated!==null?(dl(r),r.flags|=128,null):c&r.child.childLanes?Tp(a,r,c):(dl(r),a=Ma(a,r,c),a!==null?a.sibling:null);dl(r);break;case 19:var T=(a.flags&128)!==0;if(m=(c&r.childLanes)!==0,m||(ai(a,r,c,!1),m=(c&r.childLanes)!==0),T){if(m)return bp(a,r,c);r.flags|=128}if(T=r.memoizedState,T!==null&&(T.rendering=null,T.tail=null,T.lastEffect=null),Le(hn,hn.current),m)break;return null;case 22:return r.lanes=0,xS(a,r,c,r.pendingProps);case 24:Ki(r,In,a.memoizedState.cache)}return Ma(a,r,c)}function xp(a,r,c){if(a!==null)if(a.memoizedProps!==r.pendingProps)Nn=!0;else{if(!Mm(a,c)&&!(r.flags&128))return Nn=!1,Im(a,r,c);Nn=!!(a.flags&131072)}else Nn=!1,Tt&&r.flags&1048576&&P0(r,Mn,r.index);switch(r.lanes=0,r.tag){case 16:e:{var m=r.pendingProps;if(a=Hr(r.elementType),r.type=a,typeof a=="function")Po(a)?(m=Jr(a,m),r.tag=1,r=Ep(null,r,a,m,c)):(r.tag=0,r=Cm(null,r,a,m,c));else{if(a!=null){var T=a.$$typeof;if(T===G){r.tag=11,r=yp(null,r,a,m,c);break e}else if(T===q){r.tag=14,r=vp(null,r,a,m,c);break e}}throw r=Ie(a)||a,Error(s(306,r,""))}}return r;case 0:return Cm(a,r,r.type,r.pendingProps,c);case 1:return m=r.type,T=Jr(m,r.pendingProps),Ep(a,r,m,T,c);case 3:e:{if(At(r,r.stateNode.containerInfo),a===null)throw Error(s(387));m=r.pendingProps;var x=r.memoizedState;T=x.element,sm(a,r),fl(r,m,null,c);var C=r.memoizedState;if(m=C.cache,Ki(r,In,m),m!==x.cache&&cl(r,[In],c,!0),Kr(),m=C.element,x.isDehydrated)if(x={element:m,isDehydrated:!1,cache:C.cache},r.updateQueue.baseState=x,r.memoizedState=x,r.flags&256){r=Ns(a,r,m,c);break e}else if(m!==T){T=xa(Error(s(424)),r),lc(T),r=Ns(a,r,m,c);break e}else{switch(a=r.stateNode.containerInfo,a.nodeType){case 9:a=a.body;break;default:a=a.nodeName==="HTML"?a.ownerDocument.body:a}for(Wt=ia(a.firstChild),ii=r,Tt=!0,rl=null,qn=!0,c=q0(r,null,m,c),r.child=c;c;)c.flags=c.flags&-3|4096,c=c.sibling}else{if(Pr(),m===T){r=Ma(a,r,c);break e}on(a,r,m,c)}r=r.child}return r;case 26:return Ca(a,r),a===null?(c=Gc(r.type,null,r.pendingProps,null))?r.memoizedState=c:Tt||(c=r.type,a=r.pendingProps,m=lo(Ve.current).createElement(c),m[jt]=r,m[Hi]=a,Ti(m,c,a),Bt(m),r.stateNode=m):r.memoizedState=Gc(r.type,a.memoizedProps,r.pendingProps,a.memoizedState),null;case 27:return vi(r),a===null&&Tt&&(m=r.stateNode=Fc(r.type,r.pendingProps,Ve.current),ii=r,qn=!0,T=Wt,Ps(r.type)?(zd=T,Wt=ia(m.firstChild)):Wt=T),on(a,r,r.pendingProps.children,c),Ca(a,r),a===null&&(r.flags|=4194304),r.child;case 5:return a===null&&Tt&&((T=m=Wt)&&(m=Hb(m,r.type,r.pendingProps,qn),m!==null?(r.stateNode=m,ii=r,Wt=ia(m.firstChild),qn=!1,T=!0):T=!1),T||is(r)),vi(r),T=r.type,x=r.pendingProps,C=a!==null?a.memoizedProps:null,m=x.children,Bc(T,x)?m=null:C!==null&&Bc(T,C)&&(r.flags|=32),r.memoizedState!==null&&(T=sd(a,r,Fb,null,null,c),Gd._currentValue=T),Ca(a,r),on(a,r,m,c),r.child;case 6:return a===null&&Tt&&((a=c=Wt)&&(c=ht(c,r.pendingProps,qn),c!==null?(r.stateNode=c,ii=r,Wt=null,a=!0):a=!1),a||is(r)),null;case 13:return Tp(a,r,c);case 4:return At(r,r.stateNode.containerInfo),m=r.pendingProps,a===null?r.child=Yr(r,null,m,c):on(a,r,m,c),r.child;case 11:return yp(a,r,r.type,r.pendingProps,c);case 7:return on(a,r,r.pendingProps,c),r.child;case 8:return on(a,r,r.pendingProps.children,c),r.child;case 12:return on(a,r,r.pendingProps.children,c),r.child;case 10:return m=r.pendingProps,Ki(r,r.type,m.value),on(a,r,m.children,c),r.child;case 9:return T=r.type._context,m=r.pendingProps.children,et(r),T=Re(T),m=m(T),r.flags|=1,on(a,r,m,c),r.child;case 14:return vp(a,r,r.type,r.pendingProps,c);case 15:return Sp(a,r,r.type,r.pendingProps,c);case 19:return bp(a,r,c);case 31:return AS(a,r,c);case 22:return xS(a,r,c,r.pendingProps);case 24:return et(r),m=Re(In),a===null?(T=Da(),T===null&&(T=Yt,x=Xf(),T.pooledCache=x,x.refCount++,x!==null&&(T.pooledCacheLanes|=c),T=x),r.memoizedState={parent:m,cache:T},nd(r),Ki(r,In,T)):(a.lanes&c&&(sm(a,r),fl(r,null,null,c),Kr()),T=a.memoizedState,x=r.memoizedState,T.parent!==m?(T={parent:m,cache:m},r.memoizedState=T,r.lanes===0&&(r.memoizedState=r.updateQueue.baseState=T),Ki(r,In,m)):(m=x.cache,Ki(r,In,m),m!==T.cache&&cl(r,[In],c,!0))),on(a,r,r.pendingProps.children,c),r.child;case 29:throw r.pendingProps}throw Error(s(156,r.tag))}function vl(a){a.flags|=4}function Ap(a,r,c,m,T){if((r=(a.mode&32)!==0)&&(r=!1),r){if(a.flags|=16777216,(T&335544128)===T)if(a.stateNode.complete)a.flags|=8192;else if(NS())a.flags|=8192;else throw jr=Yo,Vo}else a.flags&=-16777217}function Rp(a,r){if(r.type!=="stylesheet"||r.state.loading&4)a.flags&=-16777217;else if(a.flags|=16777216,!ma(r))if(NS())a.flags|=8192;else throw jr=Yo,Vo}function Mi(a,r){r!==null&&(a.flags|=4),a.flags&16384&&(r=a.tag!==22?xo():536870912,a.lanes|=r,En|=r)}function Ec(a,r){if(!Tt)switch(a.tailMode){case"hidden":r=a.tail;for(var c=null;r!==null;)r.alternate!==null&&(c=r),r=r.sibling;c===null?a.tail=null:c.sibling=null;break;case"collapsed":c=a.tail;for(var m=null;c!==null;)c.alternate!==null&&(m=c),c=c.sibling;m===null?r||a.tail===null?a.tail=null:a.tail.sibling=null:m.sibling=null}}function We(a){var r=a.alternate!==null&&a.alternate.child===a.child,c=0,m=0;if(r)for(var T=a.child;T!==null;)c|=T.lanes|T.childLanes,m|=T.subtreeFlags&65011712,m|=T.flags&65011712,T.return=a,T=T.sibling;else for(T=a.child;T!==null;)c|=T.lanes|T.childLanes,m|=T.subtreeFlags,m|=T.flags,T.return=a,T=T.sibling;return a.subtreeFlags|=m,a.childLanes=c,r}function RS(a,r,c){var m=r.pendingProps;switch(tm(r),r.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return We(r),null;case 1:return We(r),null;case 3:return c=r.stateNode,m=null,a!==null&&(m=a.memoizedState.cache),r.memoizedState.cache!==m&&(r.flags|=2048),Ms(In),kt(),c.pendingContext&&(c.context=c.pendingContext,c.pendingContext=null),(a===null||a.child===null)&&(ul(r)?vl(r):a===null||a.memoizedState.isDehydrated&&!(r.flags&256)||(r.flags|=1024,G0())),We(r),null;case 26:var T=r.type,x=r.memoizedState;return a===null?(vl(r),x!==null?(We(r),Rp(r,x)):(We(r),Ap(r,T,null,m,c))):x?x!==a.memoizedState?(vl(r),We(r),Rp(r,x)):(We(r),r.flags&=-16777217):(a=a.memoizedProps,a!==m&&vl(r),We(r),Ap(r,T,a,m,c)),null;case 27:if(we(r),c=Ve.current,T=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&vl(r);else{if(!m){if(r.stateNode===null)throw Error(s(166));return We(r),null}a=Ce.current,ul(r)?qf(r):(a=Fc(T,m,c),r.stateNode=a,vl(r))}return We(r),null;case 5:if(we(r),T=r.type,a!==null&&r.stateNode!=null)a.memoizedProps!==m&&vl(r);else{if(!m){if(r.stateNode===null)throw Error(s(166));return We(r),null}if(x=Ce.current,ul(r))qf(r);else{var C=lo(Ve.current);switch(x){case 1:x=C.createElementNS("http://www.w3.org/2000/svg",T);break;case 2:x=C.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;default:switch(T){case"svg":x=C.createElementNS("http://www.w3.org/2000/svg",T);break;case"math":x=C.createElementNS("http://www.w3.org/1998/Math/MathML",T);break;case"script":x=C.createElement("div"),x.innerHTML="<script><\/script>",x=x.removeChild(x.firstChild);break;case"select":x=typeof m.is=="string"?C.createElement("select",{is:m.is}):C.createElement("select"),m.multiple?x.multiple=!0:m.size&&(x.size=m.size);break;default:x=typeof m.is=="string"?C.createElement(T,{is:m.is}):C.createElement(T)}}x[jt]=r,x[Hi]=m;e:for(C=r.child;C!==null;){if(C.tag===5||C.tag===6)x.appendChild(C.stateNode);else if(C.tag!==4&&C.tag!==27&&C.child!==null){C.child.return=C,C=C.child;continue}if(C===r)break e;for(;C.sibling===null;){if(C.return===null||C.return===r)break e;C=C.return}C.sibling.return=C.return,C=C.sibling}r.stateNode=x;e:switch(Ti(x,T,m),T){case"button":case"input":case"select":case"textarea":m=!!m.autoFocus;break e;case"img":m=!0;break e;default:m=!1}m&&vl(r)}}return We(r),Ap(r,r.type,a===null?null:a.memoizedProps,r.pendingProps,c),null;case 6:if(a&&r.stateNode!=null)a.memoizedProps!==m&&vl(r);else{if(typeof m!="string"&&r.stateNode===null)throw Error(s(166));if(a=Ve.current,ul(r)){if(a=r.stateNode,c=r.memoizedProps,m=null,T=ii,T!==null)switch(T.tag){case 27:case 5:m=T.memoizedProps}a[jt]=r,a=!!(a.nodeValue===c||m!==null&&m.suppressHydrationWarning===!0||Xp(a.nodeValue,c)),a||is(r,!0)}else a=lo(a).createTextNode(m),a[jt]=r,r.stateNode=a}return We(r),null;case 31:if(c=r.memoizedState,a===null||a.memoizedState!==null){if(m=ul(r),c!==null){if(a===null){if(!m)throw Error(s(318));if(a=r.memoizedState,a=a!==null?a.dehydrated:null,!a)throw Error(s(557));a[jt]=r}else Pr(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;We(r),a=!1}else c=G0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=c),a=!0;if(!a)return r.flags&256?(Qi(r),r):(Qi(r),null);if(r.flags&128)throw Error(s(558))}return We(r),null;case 13:if(m=r.memoizedState,a===null||a.memoizedState!==null&&a.memoizedState.dehydrated!==null){if(T=ul(r),m!==null&&m.dehydrated!==null){if(a===null){if(!T)throw Error(s(318));if(T=r.memoizedState,T=T!==null?T.dehydrated:null,!T)throw Error(s(317));T[jt]=r}else Pr(),!(r.flags&128)&&(r.memoizedState=null),r.flags|=4;We(r),T=!1}else T=G0(),a!==null&&a.memoizedState!==null&&(a.memoizedState.hydrationErrors=T),T=!0;if(!T)return r.flags&256?(Qi(r),r):(Qi(r),null)}return Qi(r),r.flags&128?(r.lanes=c,r):(c=m!==null,a=a!==null&&a.memoizedState!==null,c&&(m=r.child,T=null,m.alternate!==null&&m.alternate.memoizedState!==null&&m.alternate.memoizedState.cachePool!==null&&(T=m.alternate.memoizedState.cachePool.pool),x=null,m.memoizedState!==null&&m.memoizedState.cachePool!==null&&(x=m.memoizedState.cachePool.pool),x!==T&&(m.flags|=2048)),c!==a&&c&&(r.child.flags|=8192),Mi(r,r.updateQueue),We(r),null);case 4:return kt(),a===null&&kc(r.stateNode.containerInfo),We(r),null;case 10:return Ms(r.type),We(r),null;case 19:if(de(hn),m=r.memoizedState,m===null)return We(r),null;if(T=(r.flags&128)!==0,x=m.rendering,x===null)if(T)Ec(m,!1);else{if(tn!==0||a!==null&&a.flags&128)for(a=r.child;a!==null;){if(x=dc(a),x!==null){for(r.flags|=128,Ec(m,!1),a=x.updateQueue,r.updateQueue=a,Mi(r,a),r.subtreeFlags=0,a=c,c=r.child;c!==null;)B0(c,a),c=c.sibling;return Le(hn,hn.current&1|2),Tt&&ns(r,m.treeForkCount),r.child}a=a.sibling}m.tail!==null&&fn()>Nt&&(r.flags|=128,T=!0,Ec(m,!1),r.lanes=4194304)}else{if(!T)if(a=dc(x),a!==null){if(r.flags|=128,T=!0,a=a.updateQueue,r.updateQueue=a,Mi(r,a),Ec(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!Tt)return We(r),null}else 2*fn()-m.renderingStartTime>Nt&&c!==536870912&&(r.flags|=128,T=!0,Ec(m,!1),r.lanes=4194304);m.isBackwards?(x.sibling=r.child,r.child=x):(a=m.last,a!==null?a.sibling=x:r.child=x,m.last=x)}return m.tail!==null?(a=m.tail,m.rendering=a,m.tail=a.sibling,m.renderingStartTime=fn(),a.sibling=null,c=hn.current,Le(hn,T?c&1|2:c&1),Tt&&ns(r,m.treeForkCount),a):(We(r),null);case 22:case 23:return Qi(r),cc(),m=r.memoizedState!==null,a!==null?a.memoizedState!==null!==m&&(r.flags|=8192):m&&(r.flags|=8192),m?c&536870912&&!(r.flags&128)&&(We(r),r.subtreeFlags&6&&(r.flags|=8192)):We(r),c=r.updateQueue,c!==null&&Mi(r,c.retryQueue),c=null,a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),m=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(m=r.memoizedState.cachePool.pool),m!==c&&(r.flags|=2048),a!==null&&de(Ra),null;case 24:return c=null,a!==null&&(c=a.memoizedState.cache),r.memoizedState.cache!==c&&(r.flags|=2048),Ms(In),We(r),null;case 25:return null;case 30:return null}throw Error(s(156,r.tag))}function DS(a,r){switch(tm(r),r.tag){case 1:return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 3:return Ms(In),kt(),a=r.flags,a&65536&&!(a&128)?(r.flags=a&-65537|128,r):null;case 26:case 27:case 5:return we(r),null;case 31:if(r.memoizedState!==null){if(Qi(r),r.alternate===null)throw Error(s(340));Pr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 13:if(Qi(r),a=r.memoizedState,a!==null&&a.dehydrated!==null){if(r.alternate===null)throw Error(s(340));Pr()}return a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 19:return de(hn),null;case 4:return kt(),null;case 10:return Ms(r.type),null;case 22:case 23:return Qi(r),cc(),a!==null&&de(Ra),a=r.flags,a&65536?(r.flags=a&-65537|128,r):null;case 24:return Ms(In),null;case 25:return null;default:return null}}function LS(a,r){switch(tm(r),r.tag){case 3:Ms(In),kt();break;case 26:case 27:case 5:we(r);break;case 4:kt();break;case 31:r.memoizedState!==null&&Qi(r);break;case 13:Qi(r);break;case 19:de(hn);break;case 10:Ms(r.type);break;case 22:case 23:Qi(r),cc(),a!==null&&de(Ra);break;case 24:Ms(In)}}function ss(a,r){try{var c=r.updateQueue,m=c!==null?c.lastEffect:null;if(m!==null){var T=m.next;c=T;do{if((c.tag&a)===a){m=void 0;var x=c.create,C=c.inst;m=x(),C.destroy=m}c=c.next}while(c!==T)}}catch(k){Gt(r,r.return,k)}}function Ia(a,r,c){try{var m=r.updateQueue,T=m!==null?m.lastEffect:null;if(T!==null){var x=T.next;m=x;do{if((m.tag&a)===a){var C=m.inst,k=C.destroy;if(k!==void 0){C.destroy=void 0,T=r;var Y=c,ue=k;try{ue()}catch(ve){Gt(T,Y,ve)}}}m=m.next}while(m!==x)}}catch(ve){Gt(r,r.return,ve)}}function wm(a){var r=a.updateQueue;if(r!==null){var c=a.stateNode;try{Xr(r,c)}catch(m){Gt(a,a.return,m)}}}function no(a,r,c){c.props=Jr(a.type,a.memoizedProps),c.state=a.memoizedState;try{c.componentWillUnmount()}catch(m){Gt(a,r,m)}}function Sl(a,r){try{var c=a.ref;if(c!==null){switch(a.tag){case 26:case 27:case 5:var m=a.stateNode;break;case 30:m=a.stateNode;break;default:m=a.stateNode}typeof c=="function"?a.refCleanup=c(m):c.current=m}}catch(T){Gt(a,r,T)}}function Us(a,r){var c=a.ref,m=a.refCleanup;if(c!==null)if(typeof m=="function")try{m()}catch(T){Gt(a,r,T)}finally{a.refCleanup=null,a=a.alternate,a!=null&&(a.refCleanup=null)}else if(typeof c=="function")try{c(null)}catch(T){Gt(a,r,T)}else c.current=null}function Dp(a){var r=a.type,c=a.memoizedProps,m=a.stateNode;try{e:switch(r){case"button":case"input":case"select":case"textarea":c.autoFocus&&m.focus();break e;case"img":c.src?m.src=c.src:c.srcSet&&(m.srcset=c.srcSet)}}catch(T){Gt(a,a.return,T)}}function Nm(a,r,c){try{var m=a.stateNode;Zp(m,a.type,c,r),m[Hi]=r}catch(T){Gt(a,a.return,T)}}function Lp(a){return a.tag===5||a.tag===3||a.tag===26||a.tag===27&&Ps(a.type)||a.tag===4}function Tc(a){e:for(;;){for(;a.sibling===null;){if(a.return===null||Lp(a.return))return null;a=a.return}for(a.sibling.return=a.return,a=a.sibling;a.tag!==5&&a.tag!==6&&a.tag!==18;){if(a.tag===27&&Ps(a.type)||a.flags&2||a.child===null||a.tag===4)continue e;a.child.return=a,a=a.child}if(!(a.flags&2))return a.stateNode}}function bc(a,r,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?(c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c).insertBefore(a,r):(r=c.nodeType===9?c.body:c.nodeName==="HTML"?c.ownerDocument.body:c,r.appendChild(a),c=c._reactRootContainer,c!=null||r.onclick!==null||(r.onclick=Ts));else if(m!==4&&(m===27&&Ps(a.type)&&(c=a.stateNode,r=null),a=a.child,a!==null))for(bc(a,r,c),a=a.sibling;a!==null;)bc(a,r,c),a=a.sibling}function xc(a,r,c){var m=a.tag;if(m===5||m===6)a=a.stateNode,r?c.insertBefore(a,r):c.appendChild(a);else if(m!==4&&(m===27&&Ps(a.type)&&(c=a.stateNode),a=a.child,a!==null))for(xc(a,r,c),a=a.sibling;a!==null;)xc(a,r,c),a=a.sibling}function _p(a){var r=a.stateNode,c=a.memoizedProps;try{for(var m=a.type,T=r.attributes;T.length;)r.removeAttributeNode(T[0]);Ti(r,m,c),r[jt]=a,r[Hi]=c}catch(x){Gt(a,a.return,x)}}var rr=!1,$n=!1,Um=!1,Cp=typeof WeakSet=="function"?WeakSet:Set,ri=null;function Ac(a,r){if(a=a.containerInfo,tg=Qn,a=Br(a),Pf(a)){if("selectionStart"in a)var c={start:a.selectionStart,end:a.selectionEnd};else e:{c=(c=a.ownerDocument)&&c.defaultView||window;var m=c.getSelection&&c.getSelection();if(m&&m.rangeCount!==0){c=m.anchorNode;var T=m.anchorOffset,x=m.focusNode;m=m.focusOffset;try{c.nodeType,x.nodeType}catch{c=null;break e}var C=0,k=-1,Y=-1,ue=0,ve=0,Ae=a,ce=null;t:for(;;){for(var pe;Ae!==c||T!==0&&Ae.nodeType!==3||(k=C+T),Ae!==x||m!==0&&Ae.nodeType!==3||(Y=C+m),Ae.nodeType===3&&(C+=Ae.nodeValue.length),(pe=Ae.firstChild)!==null;)ce=Ae,Ae=pe;for(;;){if(Ae===a)break t;if(ce===c&&++ue===T&&(k=C),ce===x&&++ve===m&&(Y=C),(pe=Ae.nextSibling)!==null)break;Ae=ce,ce=Ae.parentNode}Ae=pe}c=k===-1||Y===-1?null:{start:k,end:Y}}else c=null}c=c||{start:0,end:0}}else c=null;for(ng={focusedElem:a,selectionRange:c},Qn=!1,ri=r;ri!==null;)if(r=ri,a=r.child,(r.subtreeFlags&1028)!==0&&a!==null)a.return=r,ri=a;else for(;ri!==null;){switch(r=ri,x=r.alternate,a=r.flags,r.tag){case 0:if(a&4&&(a=r.updateQueue,a=a!==null?a.events:null,a!==null))for(c=0;c<a.length;c++)T=a[c],T.ref.impl=T.nextImpl;break;case 11:case 15:break;case 1:if(a&1024&&x!==null){a=void 0,c=r,T=x.memoizedProps,x=x.memoizedState,m=c.stateNode;try{var ze=Jr(c.type,T);a=m.getSnapshotBeforeUpdate(ze,x),m.__reactInternalSnapshotBeforeUpdate=a}catch(Xe){Gt(c,c.return,Xe)}}break;case 3:if(a&1024){if(a=r.stateNode.containerInfo,c=a.nodeType,c===9)Bd(a);else if(c===1)switch(a.nodeName){case"HEAD":case"HTML":case"BODY":Bd(a);break;default:a.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(a&1024)throw Error(s(163))}if(a=r.sibling,a!==null){a.return=r.return,ri=a;break}ri=r.return}}function Ed(a,r,c){var m=c.flags;switch(c.tag){case 0:case 11:case 15:or(a,c),m&4&&ss(5,c);break;case 1:if(or(a,c),m&4)if(a=c.stateNode,r===null)try{a.componentDidMount()}catch(C){Gt(c,c.return,C)}else{var T=Jr(c.type,r.memoizedProps);r=r.memoizedState;try{a.componentDidUpdate(T,r,a.__reactInternalSnapshotBeforeUpdate)}catch(C){Gt(c,c.return,C)}}m&64&&wm(c),m&512&&Sl(c,c.return);break;case 3:if(or(a,c),m&64&&(a=c.updateQueue,a!==null)){if(r=null,c.child!==null)switch(c.child.tag){case 27:case 5:r=c.child.stateNode;break;case 1:r=c.child.stateNode}try{Xr(a,r)}catch(C){Gt(c,c.return,C)}}break;case 27:r===null&&m&4&&_p(c);case 26:case 5:or(a,c),r===null&&m&4&&Dp(c),m&512&&Sl(c,c.return);break;case 12:or(a,c);break;case 31:or(a,c),m&4&&_S(a,c);break;case 13:or(a,c),m&4&&Ip(a,c),m&64&&(a=c.memoizedState,a!==null&&(a=a.dehydrated,a!==null&&(c=wa.bind(null,c),zc(a,c))));break;case 22:if(m=c.memoizedState!==null||rr,!m){r=r!==null&&r.memoizedState!==null||$n,T=rr;var x=$n;rr=m,($n=r)&&!x?ks(a,c,(c.subtreeFlags&8772)!==0):or(a,c),rr=T,$n=x}break;case 30:break;default:or(a,c)}}function Op(a){var r=a.alternate;r!==null&&(a.alternate=null,Op(r)),a.child=null,a.deletions=null,a.sibling=null,a.tag===5&&(r=a.stateNode,r!==null&&Mh(r)),a.stateNode=null,a.return=null,a.dependencies=null,a.memoizedProps=null,a.memoizedState=null,a.pendingProps=null,a.stateNode=null,a.updateQueue=null}var en=null,Wi=!1;function El(a,r,c){for(c=c.child;c!==null;)Mp(a,r,c),c=c.sibling}function Mp(a,r,c){if(Si&&typeof Si.onCommitFiberUnmount=="function")try{Si.onCommitFiberUnmount(Zs,c)}catch{}switch(c.tag){case 26:$n||Us(c,r),El(a,r,c),c.memoizedState?c.memoizedState.count--:c.stateNode&&(c=c.stateNode,c.parentNode.removeChild(c));break;case 27:$n||Us(c,r);var m=en,T=Wi;Ps(c.type)&&(en=c.stateNode,Wi=!1),El(a,r,c),fu(c.stateNode),en=m,Wi=T;break;case 5:$n||Us(c,r);case 6:if(m=en,T=Wi,en=null,El(a,r,c),en=m,Wi=T,en!==null)if(Wi)try{(en.nodeType===9?en.body:en.nodeName==="HTML"?en.ownerDocument.body:en).removeChild(c.stateNode)}catch(x){Gt(c,r,x)}else try{en.removeChild(c.stateNode)}catch(x){Gt(c,r,x)}break;case 18:en!==null&&(Wi?(a=en,ty(a.nodeType===9?a.body:a.nodeName==="HTML"?a.ownerDocument.body:a,c.stateNode),Xc(a)):ty(en,c.stateNode));break;case 4:m=en,T=Wi,en=c.stateNode.containerInfo,Wi=!0,El(a,r,c),en=m,Wi=T;break;case 0:case 11:case 14:case 15:Ia(2,c,r),$n||Ia(4,c,r),El(a,r,c);break;case 1:$n||(Us(c,r),m=c.stateNode,typeof m.componentWillUnmount=="function"&&no(c,r,m)),El(a,r,c);break;case 21:El(a,r,c);break;case 22:$n=(m=$n)||c.memoizedState!==null,El(a,r,c),$n=m;break;default:El(a,r,c)}}function _S(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null))){a=a.dehydrated;try{Xc(a)}catch(c){Gt(r,r.return,c)}}}function Ip(a,r){if(r.memoizedState===null&&(a=r.alternate,a!==null&&(a=a.memoizedState,a!==null&&(a=a.dehydrated,a!==null))))try{Xc(a)}catch(c){Gt(r,r.return,c)}}function Td(a){switch(a.tag){case 31:case 13:case 19:var r=a.stateNode;return r===null&&(r=a.stateNode=new Cp),r;case 22:return a=a.stateNode,r=a._retryCache,r===null&&(r=a._retryCache=new Cp),r;default:throw Error(s(435,a.tag))}}function bd(a,r){var c=Td(a);r.forEach(function(m){if(!c.has(m)){c.add(m);var T=XS.bind(null,a,m);m.then(T,T)}})}function ea(a,r){var c=r.deletions;if(c!==null)for(var m=0;m<c.length;m++){var T=c[m],x=a,C=r,k=C;e:for(;k!==null;){switch(k.tag){case 27:if(Ps(k.type)){en=k.stateNode,Wi=!1;break e}break;case 5:en=k.stateNode,Wi=!1;break e;case 3:case 4:en=k.stateNode.containerInfo,Wi=!0;break e}k=k.return}if(en===null)throw Error(s(160));Mp(x,C,T),en=null,Wi=!1,x=T.alternate,x!==null&&(x.return=null),T.return=null}if(r.subtreeFlags&13886)for(r=r.child;r!==null;)km(r,a),r=r.sibling}var ct=null;function km(a,r){var c=a.alternate,m=a.flags;switch(a.tag){case 0:case 11:case 14:case 15:ea(r,a),ua(a),m&4&&(Ia(3,a,a.return),ss(3,a),Ia(5,a,a.return));break;case 1:ea(r,a),ua(a),m&512&&($n||c===null||Us(c,c.return)),m&64&&rr&&(a=a.updateQueue,a!==null&&(m=a.callbacks,m!==null&&(c=a.shared.hiddenCallbacks,a.shared.hiddenCallbacks=c===null?m:c.concat(m))));break;case 26:var T=ct;if(ea(r,a),ua(a),m&512&&($n||c===null||Us(c,c.return)),m&4){var x=c!==null?c.memoizedState:null;if(m=a.memoizedState,c===null)if(m===null)if(a.stateNode===null){e:{m=a.type,c=a.memoizedProps,T=T.ownerDocument||T;t:switch(m){case"title":x=T.getElementsByTagName("title")[0],(!x||x[Ws]||x[jt]||x.namespaceURI==="http://www.w3.org/2000/svg"||x.hasAttribute("itemprop"))&&(x=T.createElement(m),T.head.insertBefore(x,T.querySelector("head > title"))),Ti(x,m,c),x[jt]=a,Bt(x),m=x;break e;case"link":var C=sy("link","href",T).get(m+(c.href||""));if(C){for(var k=0;k<C.length;k++)if(x=C[k],x.getAttribute("href")===(c.href==null||c.href===""?null:c.href)&&x.getAttribute("rel")===(c.rel==null?null:c.rel)&&x.getAttribute("title")===(c.title==null?null:c.title)&&x.getAttribute("crossorigin")===(c.crossOrigin==null?null:c.crossOrigin)){C.splice(k,1);break t}}x=T.createElement(m),Ti(x,m,c),T.head.appendChild(x);break;case"meta":if(C=sy("meta","content",T).get(m+(c.content||""))){for(k=0;k<C.length;k++)if(x=C[k],x.getAttribute("content")===(c.content==null?null:""+c.content)&&x.getAttribute("name")===(c.name==null?null:c.name)&&x.getAttribute("property")===(c.property==null?null:c.property)&&x.getAttribute("http-equiv")===(c.httpEquiv==null?null:c.httpEquiv)&&x.getAttribute("charset")===(c.charSet==null?null:c.charSet)){C.splice(k,1);break t}}x=T.createElement(m),Ti(x,m,c),T.head.appendChild(x);break;default:throw Error(s(468,m))}x[jt]=a,Bt(x),m=x}a.stateNode=m}else rg(T,a.type,a.stateNode);else a.stateNode=ay(T,m,a.memoizedProps);else x!==m?(x===null?c.stateNode!==null&&(c=c.stateNode,c.parentNode.removeChild(c)):x.count--,m===null?rg(T,a.type,a.stateNode):ay(T,m,a.memoizedProps)):m===null&&a.stateNode!==null&&Nm(a,a.memoizedProps,c.memoizedProps)}break;case 27:ea(r,a),ua(a),m&512&&($n||c===null||Us(c,c.return)),c!==null&&m&4&&Nm(a,a.memoizedProps,c.memoizedProps);break;case 5:if(ea(r,a),ua(a),m&512&&($n||c===null||Us(c,c.return)),a.flags&32){T=a.stateNode;try{tl(T,"")}catch(ze){Gt(a,a.return,ze)}}m&4&&a.stateNode!=null&&(T=a.memoizedProps,Nm(a,T,c!==null?c.memoizedProps:T)),m&1024&&(Um=!0);break;case 6:if(ea(r,a),ua(a),m&4){if(a.stateNode===null)throw Error(s(162));m=a.memoizedProps,c=a.stateNode;try{c.nodeValue=m}catch(ze){Gt(a,a.return,ze)}}break;case 3:if(jc=null,T=ct,ct=Ii(r.containerInfo),ea(r,a),ct=T,ua(a),m&4&&c!==null&&c.memoizedState.isDehydrated)try{Xc(r.containerInfo)}catch(ze){Gt(a,a.return,ze)}Um&&(Um=!1,wp(a));break;case 4:m=ct,ct=Ii(a.stateNode.containerInfo),ea(r,a),ua(a),ct=m;break;case 12:ea(r,a),ua(a);break;case 31:ea(r,a),ua(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,bd(a,m)));break;case 13:ea(r,a),ua(a),a.child.flags&8192&&a.memoizedState!==null!=(c!==null&&c.memoizedState!==null)&&(Fs=fn()),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,bd(a,m)));break;case 22:T=a.memoizedState!==null;var Y=c!==null&&c.memoizedState!==null,ue=rr,ve=$n;if(rr=ue||T,$n=ve||Y,ea(r,a),$n=ve,rr=ue,ua(a),m&8192)e:for(r=a.stateNode,r._visibility=T?r._visibility&-2:r._visibility|1,T&&(c===null||Y||rr||$n||au(a)),c=null,r=a;;){if(r.tag===5||r.tag===26){if(c===null){Y=c=r;try{if(x=Y.stateNode,T)C=x.style,typeof C.setProperty=="function"?C.setProperty("display","none","important"):C.display="none";else{k=Y.stateNode;var Ae=Y.memoizedProps.style,ce=Ae!=null&&Ae.hasOwnProperty("display")?Ae.display:null;k.style.display=ce==null||typeof ce=="boolean"?"":(""+ce).trim()}}catch(ze){Gt(Y,Y.return,ze)}}}else if(r.tag===6){if(c===null){Y=r;try{Y.stateNode.nodeValue=T?"":Y.memoizedProps}catch(ze){Gt(Y,Y.return,ze)}}}else if(r.tag===18){if(c===null){Y=r;try{var pe=Y.stateNode;T?Un(pe,!0):Un(Y.stateNode,!1)}catch(ze){Gt(Y,Y.return,ze)}}}else if((r.tag!==22&&r.tag!==23||r.memoizedState===null||r===a)&&r.child!==null){r.child.return=r,r=r.child;continue}if(r===a)break e;for(;r.sibling===null;){if(r.return===null||r.return===a)break e;c===r&&(c=null),r=r.return}c===r&&(c=null),r.sibling.return=r.return,r=r.sibling}m&4&&(m=a.updateQueue,m!==null&&(c=m.retryQueue,c!==null&&(m.retryQueue=null,bd(a,c))));break;case 19:ea(r,a),ua(a),m&4&&(m=a.updateQueue,m!==null&&(a.updateQueue=null,bd(a,m)));break;case 30:break;case 21:break;default:ea(r,a),ua(a)}}function ua(a){var r=a.flags;if(r&2){try{for(var c,m=a.return;m!==null;){if(Lp(m)){c=m;break}m=m.return}if(c==null)throw Error(s(160));switch(c.tag){case 27:var T=c.stateNode,x=Tc(a);xc(a,x,T);break;case 5:var C=c.stateNode;c.flags&32&&(tl(C,""),c.flags&=-33);var k=Tc(a);xc(a,k,C);break;case 3:case 4:var Y=c.stateNode.containerInfo,ue=Tc(a);bc(a,ue,Y);break;default:throw Error(s(161))}}catch(ve){Gt(a,a.return,ve)}a.flags&=-3}r&4096&&(a.flags&=-4097)}function wp(a){if(a.subtreeFlags&1024)for(a=a.child;a!==null;){var r=a;wp(r),r.tag===5&&r.flags&1024&&r.stateNode.reset(),a=a.sibling}}function or(a,r){if(r.subtreeFlags&8772)for(r=r.child;r!==null;)Ed(a,r.alternate,r),r=r.sibling}function au(a){for(a=a.child;a!==null;){var r=a;switch(r.tag){case 0:case 11:case 14:case 15:Ia(4,r,r.return),au(r);break;case 1:Us(r,r.return);var c=r.stateNode;typeof c.componentWillUnmount=="function"&&no(r,r.return,c),au(r);break;case 27:fu(r.stateNode);case 26:case 5:Us(r,r.return),au(r);break;case 22:r.memoizedState===null&&au(r);break;case 30:au(r);break;default:au(r)}a=a.sibling}}function ks(a,r,c){for(c=c&&(r.subtreeFlags&8772)!==0,r=r.child;r!==null;){var m=r.alternate,T=a,x=r,C=x.flags;switch(x.tag){case 0:case 11:case 15:ks(T,x,c),ss(4,x);break;case 1:if(ks(T,x,c),m=x,T=m.stateNode,typeof T.componentDidMount=="function")try{T.componentDidMount()}catch(ue){Gt(m,m.return,ue)}if(m=x,T=m.updateQueue,T!==null){var k=m.stateNode;try{var Y=T.shared.hiddenCallbacks;if(Y!==null)for(T.shared.hiddenCallbacks=null,T=0;T<Y.length;T++)rm(Y[T],k)}catch(ue){Gt(m,m.return,ue)}}c&&C&64&&wm(x),Sl(x,x.return);break;case 27:_p(x);case 26:case 5:ks(T,x,c),c&&m===null&&C&4&&Dp(x),Sl(x,x.return);break;case 12:ks(T,x,c);break;case 31:ks(T,x,c),c&&C&4&&_S(T,x);break;case 13:ks(T,x,c),c&&C&4&&Ip(T,x);break;case 22:x.memoizedState===null&&ks(T,x,c),Sl(x,x.return);break;case 30:break;default:ks(T,x,c)}r=r.sibling}}function Bm(a,r){var c=null;a!==null&&a.memoizedState!==null&&a.memoizedState.cachePool!==null&&(c=a.memoizedState.cachePool.pool),a=null,r.memoizedState!==null&&r.memoizedState.cachePool!==null&&(a=r.memoizedState.cachePool.pool),a!==c&&(a!=null&&a.refCount++,c!=null&&Qf(c))}function zm(a,r){a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Qf(a))}function ls(a,r,c,m){if(r.subtreeFlags&10256)for(r=r.child;r!==null;)Rc(a,r,c,m),r=r.sibling}function Rc(a,r,c,m){var T=r.flags;switch(r.tag){case 0:case 11:case 15:ls(a,r,c,m),T&2048&&ss(9,r);break;case 1:ls(a,r,c,m);break;case 3:ls(a,r,c,m),T&2048&&(a=null,r.alternate!==null&&(a=r.alternate.memoizedState.cache),r=r.memoizedState.cache,r!==a&&(r.refCount++,a!=null&&Qf(a)));break;case 12:if(T&2048){ls(a,r,c,m),a=r.stateNode;try{var x=r.memoizedProps,C=x.id,k=x.onPostCommit;typeof k=="function"&&k(C,r.alternate===null?"mount":"update",a.passiveEffectDuration,-0)}catch(Y){Gt(r,r.return,Y)}}else ls(a,r,c,m);break;case 31:ls(a,r,c,m);break;case 13:ls(a,r,c,m);break;case 23:break;case 22:x=r.stateNode,C=r.alternate,r.memoizedState!==null?x._visibility&2?ls(a,r,c,m):xd(a,r):x._visibility&2?ls(a,r,c,m):(x._visibility|=2,Dc(a,r,c,m,(r.subtreeFlags&10256)!==0||!1)),T&2048&&Bm(C,r);break;case 24:ls(a,r,c,m),T&2048&&zm(r.alternate,r);break;default:ls(a,r,c,m)}}function Dc(a,r,c,m,T){for(T=T&&((r.subtreeFlags&10256)!==0||!1),r=r.child;r!==null;){var x=a,C=r,k=c,Y=m,ue=C.flags;switch(C.tag){case 0:case 11:case 15:Dc(x,C,k,Y,T),ss(8,C);break;case 23:break;case 22:var ve=C.stateNode;C.memoizedState!==null?ve._visibility&2?Dc(x,C,k,Y,T):xd(x,C):(ve._visibility|=2,Dc(x,C,k,Y,T)),T&&ue&2048&&Bm(C.alternate,C);break;case 24:Dc(x,C,k,Y,T),T&&ue&2048&&zm(C.alternate,C);break;default:Dc(x,C,k,Y,T)}r=r.sibling}}function xd(a,r){if(r.subtreeFlags&10256)for(r=r.child;r!==null;){var c=a,m=r,T=m.flags;switch(m.tag){case 22:xd(c,m),T&2048&&Bm(m.alternate,m);break;case 24:xd(c,m),T&2048&&zm(m.alternate,m);break;default:xd(c,m)}r=r.sibling}}var ca=8192;function Tl(a,r,c){if(a.subtreeFlags&ca)for(a=a.child;a!==null;)CS(a,r,c),a=a.sibling}function CS(a,r,c){switch(a.tag){case 26:Tl(a,r,c),a.flags&ca&&a.memoizedState!==null&&Dl(c,ct,a.memoizedState,a.memoizedProps);break;case 5:Tl(a,r,c);break;case 3:case 4:var m=ct;ct=Ii(a.stateNode.containerInfo),Tl(a,r,c),ct=m;break;case 22:a.memoizedState===null&&(m=a.alternate,m!==null&&m.memoizedState!==null?(m=ca,ca=16777216,Tl(a,r,c),ca=m):Tl(a,r,c));break;default:Tl(a,r,c)}}function Fm(a){var r=a.alternate;if(r!==null&&(a=r.child,a!==null)){r.child=null;do r=a.sibling,a.sibling=null,a=r;while(a!==null)}}function Lc(a){var r=a.deletions;if(a.flags&16){if(r!==null)for(var c=0;c<r.length;c++){var m=r[c];ri=m,Pm(m,a)}Fm(a)}if(a.subtreeFlags&10256)for(a=a.child;a!==null;)Np(a),a=a.sibling}function Np(a){switch(a.tag){case 0:case 11:case 15:Lc(a),a.flags&2048&&Ia(9,a,a.return);break;case 3:Lc(a);break;case 12:Lc(a);break;case 22:var r=a.stateNode;a.memoizedState!==null&&r._visibility&2&&(a.return===null||a.return.tag!==13)?(r._visibility&=-3,Ad(a)):Lc(a);break;default:Lc(a)}}function Ad(a){var r=a.deletions;if(a.flags&16){if(r!==null)for(var c=0;c<r.length;c++){var m=r[c];ri=m,Pm(m,a)}Fm(a)}for(a=a.child;a!==null;){switch(r=a,r.tag){case 0:case 11:case 15:Ia(8,r,r.return),Ad(r);break;case 22:c=r.stateNode,c._visibility&2&&(c._visibility&=-3,Ad(r));break;default:Ad(r)}a=a.sibling}}function Pm(a,r){for(;ri!==null;){var c=ri;switch(c.tag){case 0:case 11:case 15:Ia(8,c,r);break;case 23:case 22:if(c.memoizedState!==null&&c.memoizedState.cachePool!==null){var m=c.memoizedState.cachePool.pool;m!=null&&m.refCount++}break;case 24:Qf(c.memoizedState.cache)}if(m=c.child,m!==null)m.return=c,ri=m;else e:for(c=a;ri!==null;){m=ri;var T=m.sibling,x=m.return;if(Op(m),m===c){ri=null;break e}if(T!==null){T.return=x,ri=T;break e}ri=x}}}var OS={getCacheForType:function(a){var r=Re(In),c=r.data.get(a);return c===void 0&&(c=a(),r.data.set(a,c)),c},cacheSignal:function(){return Re(In).controller.signal}},Up=typeof WeakMap=="function"?WeakMap:Map,Mt=0,Yt=null,bt=null,yt=0,Pt=0,Ze=null,bl=!1,io=!1,Gm=!1,Bs=0,tn=0,zs=0,su=0,$m=0,ta=0,En=0,Rd=null,Tn=null,Hm=!1,Fs=0,kp=0,Nt=1/0,_c=null,mn=null,Xn=0,ur=null,ao=null,xl=0,fa=0,jm=null,Vm=null,Cc=0,Dd=null;function da(){return Mt&2&&yt!==0?yt&-yt:F.T!==null?Qm():Ch()}function MS(){if(ta===0)if(!(yt&536870912)||Tt){var a=vs;vs<<=1,!(vs&3932160)&&(vs=262144),ta=a}else ta=536870912;return a=Xi.current,a!==null&&(a.flags|=32),ta}function na(a,r,c){(a===Yt&&(Pt===2||Pt===9)||a.cancelPendingCommit!==null)&&(Al(a,0),cr(a,yt,ta,!1)),$u(a,c),(!(Mt&2)||a!==Yt)&&(a===Yt&&(!(Mt&2)&&(su|=c),tn===4&&cr(a,yt,ta,!1)),Rl(a))}function IS(a,r,c){if(Mt&6)throw Error(s(327));var m=!c&&(r&127)===0&&(r&a.expiredLanes)===0||Ss(a,r),T=m?BS(a,r):qm(a,r,!0),x=m;do{if(T===0){io&&!m&&cr(a,r,0,!1);break}else{if(c=a.current.alternate,x&&!wS(c)){T=qm(a,r,!1),x=!1;continue}if(T===2){if(x=r,a.errorRecoveryDisabledLanes&x)var C=0;else C=a.pendingLanes&-536870913,C=C!==0?C:C&536870912?536870912:0;if(C!==0){r=C;e:{var k=a;T=Rd;var Y=k.current.memoizedState.isDehydrated;if(Y&&(Al(k,C).flags|=256),C=qm(k,C,!1),C!==2){if(Gm&&!Y){k.errorRecoveryDisabledLanes|=x,su|=x,T=4;break e}x=Tn,Tn=T,x!==null&&(Tn===null?Tn=x:Tn.push.apply(Tn,x))}T=C}if(x=!1,T!==2)continue}}if(T===1){Al(a,0),cr(a,r,0,!0);break}e:{switch(m=a,x=T,x){case 0:case 1:throw Error(s(345));case 4:if((r&4194048)!==r)break;case 6:cr(m,r,ta,!bl);break e;case 2:Tn=null;break;case 3:case 5:break;default:throw Error(s(329))}if((r&62914560)===r&&(T=Fs+300-fn(),10<T)){if(cr(m,r,ta,!bl),On(m,0,!0)!==0)break e;xl=r,m.timeoutHandle=kd(Ld.bind(null,m,c,Tn,_c,Hm,r,ta,su,En,bl,x,"Throttled",-0,0),T);break e}Ld(m,c,Tn,_c,Hm,r,ta,su,En,bl,x,null,-0,0)}}break}while(!0);Rl(a)}function Ld(a,r,c,m,T,x,C,k,Y,ue,ve,Ae,ce,pe){if(a.timeoutHandle=-1,Ae=r.subtreeFlags,Ae&8192||(Ae&16785408)===16785408){Ae={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ts},CS(r,x,Ae);var ze=(x&62914560)===x?Fs-fn():(x&4194048)===x?kp-fn():0;if(ze=ry(Ae,ze),ze!==null){xl=x,a.cancelPendingCommit=ze(GS.bind(null,a,r,x,c,m,T,C,k,Y,ve,Ae,null,ce,pe)),cr(a,x,C,!ue);return}}GS(a,r,x,c,m,T,C,k,Y)}function wS(a){for(var r=a;;){var c=r.tag;if((c===0||c===11||c===15)&&r.flags&16384&&(c=r.updateQueue,c!==null&&(c=c.stores,c!==null)))for(var m=0;m<c.length;m++){var T=c[m],x=T.getSnapshot;T=T.value;try{if(!Oi(x(),T))return!1}catch{return!1}}if(c=r.child,r.subtreeFlags&16384&&c!==null)c.return=r,r=c;else{if(r===a)break;for(;r.sibling===null;){if(r.return===null||r.return===a)return!0;r=r.return}r.sibling.return=r.return,r=r.sibling}}return!0}function cr(a,r,c,m){r&=~$m,r&=~su,a.suspendedLanes|=r,a.pingedLanes&=~r,m&&(a.warmLanes|=r),m=a.expirationTimes;for(var T=r;0<T;){var x=31-ye(T),C=1<<x;m[x]=-1,T&=~C}c!==0&&Cf(a,c,r)}function Oc(){return Mt&6?!0:(dr(0),!1)}function Bp(){if(bt!==null){if(Pt===0)var a=bt.return;else a=bt,Os=Wl=null,ld(a),Vr=null,qo=0,a=bt;for(;a!==null;)LS(a.alternate,a),a=a.return;bt=null}}function Al(a,r){var c=a.timeoutHandle;c!==-1&&(a.timeoutHandle=-1,iE(c)),c=a.cancelPendingCommit,c!==null&&(a.cancelPendingCommit=null,c()),xl=0,Bp(),Yt=a,bt=c=Zl(a.current,null),yt=r,Pt=0,Ze=null,bl=!1,io=Ss(a,r),Gm=!1,En=ta=$m=su=zs=tn=0,Tn=Rd=null,Hm=!1,r&8&&(r|=r&32);var m=a.entangledLanes;if(m!==0)for(a=a.entanglements,m&=r;0<m;){var T=31-ye(m),x=1<<T;r|=a[T],m&=~x}return Bs=r,Ta(),c}function Mc(a,r){ot=null,F.H=md,r===$r||r===oc?(r=Y0(),Pt=3):r===Vo?(r=Y0(),Pt=4):Pt=r===_m?8:r!==null&&typeof r=="object"&&typeof r.then=="function"?6:1,Ze=r,bt===null&&(tn=1,Sc(a,xa(r,a.current)))}function NS(){var a=Xi.current;return a===null?!0:(yt&4194048)===yt?_a===null:(yt&62914560)===yt||yt&536870912?a===_a:!1}function US(){var a=F.H;return F.H=md,a===null?md:a}function kS(){var a=F.A;return F.A=OS,a}function Ym(){tn=4,bl||(yt&4194048)!==yt&&Xi.current!==null||(io=!0),!(zs&134217727)&&!(su&134217727)||Yt===null||cr(Yt,yt,ta,!1)}function qm(a,r,c){var m=Mt;Mt|=2;var T=US(),x=kS();(Yt!==a||yt!==r)&&(_c=null,Al(a,r)),r=!1;var C=tn;e:do try{if(Pt!==0&&bt!==null){var k=bt,Y=Ze;switch(Pt){case 8:Bp(),C=6;break e;case 3:case 2:case 9:case 6:Xi.current===null&&(r=!0);var ue=Pt;if(Pt=0,Ze=null,lu(a,k,Y,ue),c&&io){C=0;break e}break;default:ue=Pt,Pt=0,Ze=null,lu(a,k,Y,ue)}}Gb(),C=tn;break}catch(ve){Mc(a,ve)}while(!0);return r&&a.shellSuspendCounter++,Os=Wl=null,Mt=m,F.H=T,F.A=x,bt===null&&(Yt=null,yt=0,Ta()),C}function Gb(){for(;bt!==null;)zS(bt)}function BS(a,r){var c=Mt;Mt|=2;var m=US(),T=kS();Yt!==a||yt!==r?(_c=null,Nt=fn()+500,Al(a,r)):io=Ss(a,r);e:do try{if(Pt!==0&&bt!==null){r=bt;var x=Ze;t:switch(Pt){case 1:Pt=0,Ze=null,lu(a,r,x,1);break;case 2:case 9:if(j0(x)){Pt=0,Ze=null,FS(r);break}r=function(){Pt!==2&&Pt!==9||Yt!==a||(Pt=7),Rl(a)},x.then(r,r);break e;case 3:Pt=7;break e;case 4:Pt=5;break e;case 7:j0(x)?(Pt=0,Ze=null,FS(r)):(Pt=0,Ze=null,lu(a,r,x,7));break;case 5:var C=null;switch(bt.tag){case 26:C=bt.memoizedState;case 5:case 27:var k=bt;if(C?ma(C):k.stateNode.complete){Pt=0,Ze=null;var Y=k.sibling;if(Y!==null)bt=Y;else{var ue=k.return;ue!==null?(bt=ue,_d(ue)):bt=null}break t}}Pt=0,Ze=null,lu(a,r,x,5);break;case 6:Pt=0,Ze=null,lu(a,r,x,6);break;case 8:Bp(),tn=6;break e;default:throw Error(s(462))}}so();break}catch(ve){Mc(a,ve)}while(!0);return Os=Wl=null,F.H=m,F.A=T,Mt=c,bt!==null?0:(Yt=null,yt=0,Ta(),tn)}function so(){for(;bt!==null&&!Fn();)zS(bt)}function zS(a){var r=xp(a.alternate,a,Bs);a.memoizedProps=a.pendingProps,r===null?_d(a):bt=r}function FS(a){var r=a,c=r.alternate;switch(r.tag){case 15:case 0:r=eo(c,r,r.pendingProps,r.type,void 0,yt);break;case 11:r=eo(c,r,r.pendingProps,r.type.render,r.ref,yt);break;case 5:ld(r);default:LS(c,r),r=bt=B0(r,Bs),r=xp(c,r,Bs)}a.memoizedProps=a.pendingProps,r===null?_d(a):bt=r}function lu(a,r,c,m){Os=Wl=null,ld(r),Vr=null,qo=0;var T=r.return;try{if(Pb(a,T,r,c,yt)){tn=1,Sc(a,xa(c,a.current)),bt=null;return}}catch(x){if(T!==null)throw bt=T,x;tn=1,Sc(a,xa(c,a.current)),bt=null;return}r.flags&32768?(Tt||m===1?a=!0:io||yt&536870912?a=!1:(bl=a=!0,(m===2||m===9||m===3||m===6)&&(m=Xi.current,m!==null&&m.tag===13&&(m.flags|=16384))),PS(r,a)):_d(r)}function _d(a){var r=a;do{if(r.flags&32768){PS(r,bl);return}a=r.return;var c=RS(r.alternate,r,Bs);if(c!==null){bt=c;return}if(r=r.sibling,r!==null){bt=r;return}bt=r=a}while(r!==null);tn===0&&(tn=5)}function PS(a,r){do{var c=DS(a.alternate,a);if(c!==null){c.flags&=32767,bt=c;return}if(c=a.return,c!==null&&(c.flags|=32768,c.subtreeFlags=0,c.deletions=null),!r&&(a=a.sibling,a!==null)){bt=a;return}bt=a=c}while(a!==null);tn=6,bt=null}function GS(a,r,c,m,T,x,C,k,Y){a.cancelPendingCommit=null;do Ic();while(Xn!==0);if(Mt&6)throw Error(s(327));if(r!==null){if(r===a.current)throw Error(s(177));if(x=r.lanes|r.childLanes,x|=es,Lh(a,c,x,C,k,Y),a===Yt&&(bt=Yt=null,yt=0),ao=r,ur=a,xl=c,fa=x,jm=T,Vm=m,r.subtreeFlags&10256||r.flags&10256?(a.callbackNode=null,a.callbackPriority=0,QS(Pn,function(){return YS(),null})):(a.callbackNode=null,a.callbackPriority=0),m=(r.flags&13878)!==0,r.subtreeFlags&13878||m){m=F.T,F.T=null,T=ne.p,ne.p=2,C=Mt,Mt|=4;try{Ac(a,r,c)}finally{Mt=C,ne.p=T,F.T=m}}Xn=1,$S(),HS(),jS()}}function $S(){if(Xn===1){Xn=0;var a=ur,r=ao,c=(r.flags&13878)!==0;if(r.subtreeFlags&13878||c){c=F.T,F.T=null;var m=ne.p;ne.p=2;var T=Mt;Mt|=4;try{km(r,a);var x=ng,C=Br(a.containerInfo),k=x.focusedElem,Y=x.selectionRange;if(C!==k&&k&&k.ownerDocument&&Bo(k.ownerDocument.documentElement,k)){if(Y!==null&&Pf(k)){var ue=Y.start,ve=Y.end;if(ve===void 0&&(ve=ue),"selectionStart"in k)k.selectionStart=ue,k.selectionEnd=Math.min(ve,k.value.length);else{var Ae=k.ownerDocument||document,ce=Ae&&Ae.defaultView||window;if(ce.getSelection){var pe=ce.getSelection(),ze=k.textContent.length,Xe=Math.min(Y.start,ze),Kt=Y.end===void 0?Xe:Math.min(Y.end,ze);!pe.extend&&Xe>Kt&&(C=Kt,Kt=Xe,Xe=C);var ie=U0(k,Xe),W=U0(k,Kt);if(ie&&W&&(pe.rangeCount!==1||pe.anchorNode!==ie.node||pe.anchorOffset!==ie.offset||pe.focusNode!==W.node||pe.focusOffset!==W.offset)){var oe=Ae.createRange();oe.setStart(ie.node,ie.offset),pe.removeAllRanges(),Xe>Kt?(pe.addRange(oe),pe.extend(W.node,W.offset)):(oe.setEnd(W.node,W.offset),pe.addRange(oe))}}}}for(Ae=[],pe=k;pe=pe.parentNode;)pe.nodeType===1&&Ae.push({element:pe,left:pe.scrollLeft,top:pe.scrollTop});for(typeof k.focus=="function"&&k.focus(),k=0;k<Ae.length;k++){var Te=Ae[k];Te.element.scrollLeft=Te.left,Te.element.scrollTop=Te.top}}Qn=!!tg,ng=tg=null}finally{Mt=T,ne.p=m,F.T=c}}a.current=r,Xn=2}}function HS(){if(Xn===2){Xn=0;var a=ur,r=ao,c=(r.flags&8772)!==0;if(r.subtreeFlags&8772||c){c=F.T,F.T=null;var m=ne.p;ne.p=2;var T=Mt;Mt|=4;try{Ed(a,r.alternate,r)}finally{Mt=T,ne.p=m,F.T=c}}Xn=3}}function jS(){if(Xn===4||Xn===3){Xn=0,jl();var a=ur,r=ao,c=xl,m=Vm;r.subtreeFlags&10256||r.flags&10256?Xn=5:(Xn=0,ao=ur=null,VS(a,a.pendingLanes));var T=a.pendingLanes;if(T===0&&(mn=null),u0(c),r=r.stateNode,Si&&typeof Si.onCommitFiberRoot=="function")try{Si.onCommitFiberRoot(Zs,r,void 0,(r.current.flags&128)===128)}catch{}if(m!==null){r=F.T,T=ne.p,ne.p=2,F.T=null;try{for(var x=a.onRecoverableError,C=0;C<m.length;C++){var k=m[C];x(k.value,{componentStack:k.stack})}}finally{F.T=r,ne.p=T}}xl&3&&Ic(),Rl(a),T=a.pendingLanes,c&261930&&T&42?a===Dd?Cc++:(Cc=0,Dd=a):Cc=0,dr(0)}}function VS(a,r){(a.pooledCacheLanes&=r)===0&&(r=a.pooledCache,r!=null&&(a.pooledCache=null,Qf(r)))}function Ic(){return $S(),HS(),jS(),YS()}function YS(){if(Xn!==5)return!1;var a=ur,r=fa;fa=0;var c=u0(xl),m=F.T,T=ne.p;try{ne.p=32>c?32:c,F.T=null,c=jm,jm=null;var x=ur,C=xl;if(Xn=0,ao=ur=null,xl=0,Mt&6)throw Error(s(331));var k=Mt;if(Mt|=4,Np(x.current),Rc(x,x.current,C,c),Mt=k,dr(0,!1),Si&&typeof Si.onPostCommitFiberRoot=="function")try{Si.onPostCommitFiberRoot(Zs,x)}catch{}return!0}finally{ne.p=T,F.T=m,VS(a,r)}}function qS(a,r,c){r=xa(c,r),r=mp(a.stateNode,r,2),a=La(a,r,2),a!==null&&($u(a,2),Rl(a))}function Gt(a,r,c){if(a.tag===3)qS(a,a,c);else for(;r!==null;){if(r.tag===3){qS(r,a,c);break}else if(r.tag===1){var m=r.stateNode;if(typeof r.type.getDerivedStateFromError=="function"||typeof m.componentDidCatch=="function"&&(mn===null||!mn.has(m))){a=xa(c,a),c=gp(2),m=La(r,c,2),m!==null&&(pp(c,m,r,a),$u(m,2),Rl(m));break}}r=r.return}}function Cd(a,r,c){var m=a.pingCache;if(m===null){m=a.pingCache=new Up;var T=new Set;m.set(r,T)}else T=m.get(r),T===void 0&&(T=new Set,m.set(r,T));T.has(c)||(Gm=!0,T.add(c),a=zp.bind(null,a,r,c),r.then(a,a))}function zp(a,r,c){var m=a.pingCache;m!==null&&m.delete(r),a.pingedLanes|=a.suspendedLanes&c,a.warmLanes&=~c,Yt===a&&(yt&c)===c&&(tn===4||tn===3&&(yt&62914560)===yt&&300>fn()-Fs?!(Mt&2)&&Al(a,0):$m|=c,En===yt&&(En=0)),Rl(a)}function KS(a,r){r===0&&(r=xo()),a=Ql(a,r),a!==null&&($u(a,r),Rl(a))}function wa(a){var r=a.memoizedState,c=0;r!==null&&(c=r.retryLane),KS(a,c)}function XS(a,r){var c=0;switch(a.tag){case 31:case 13:var m=a.stateNode,T=a.memoizedState;T!==null&&(c=T.retryLane);break;case 19:m=a.stateNode;break;case 22:m=a.stateNode._retryCache;break;default:throw Error(s(314))}m!==null&&m.delete(r),KS(a,c)}function QS(a,r){return ut(a,r)}var wc=null,ru=null,Fp=!1,Km=!1,Pp=!1,fr=0;function Rl(a){a!==ru&&a.next===null&&(ru===null?wc=ru=a:ru=ru.next=a),Km=!0,Fp||(Fp=!0,Md())}function dr(a,r){if(!Pp&&Km){Pp=!0;do for(var c=!1,m=wc;m!==null;){if(a!==0){var T=m.pendingLanes;if(T===0)var x=0;else{var C=m.suspendedLanes,k=m.pingedLanes;x=(1<<31-ye(42|a)+1)-1,x&=T&~(C&~k),x=x&201326741?x&201326741|1:x?x|2:0}x!==0&&(c=!0,ou(m,x))}else x=yt,x=On(m,m===Yt?x:0,m.cancelPendingCommit!==null||m.timeoutHandle!==-1),!(x&3)||Ss(m,x)||(c=!0,ou(m,x));m=m.next}while(c);Pp=!1}}function Xm(){Gp()}function Gp(){Km=Fp=!1;var a=0;fr!==0&&$b()&&(a=fr);for(var r=fn(),c=null,m=wc;m!==null;){var T=m.next,x=$p(m,r);x===0?(m.next=null,c===null?wc=T:c.next=T,T===null&&(ru=c)):(c=m,(a!==0||x&3)&&(Km=!0)),m=T}Xn!==0&&Xn!==5||dr(a),fr!==0&&(fr=0)}function $p(a,r){for(var c=a.suspendedLanes,m=a.pingedLanes,T=a.expirationTimes,x=a.pendingLanes&-62914561;0<x;){var C=31-ye(x),k=1<<C,Y=T[C];Y===-1?(!(k&c)||k&m)&&(T[C]=Gu(k,r)):Y<=r&&(a.expiredLanes|=k),x&=~k}if(r=Yt,c=yt,c=On(a,a===r?c:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m=a.callbackNode,c===0||a===r&&(Pt===2||Pt===9)||a.cancelPendingCommit!==null)return m!==null&&m!==null&&Va(m),a.callbackNode=null,a.callbackPriority=0;if(!(c&3)||Ss(a,c)){if(r=c&-c,r===a.callbackPriority)return r;switch(m!==null&&Va(m),u0(c)){case 2:case 8:c=Vl;break;case 32:c=Pn;break;case 268435456:c=bo;break;default:c=Pn}return m=Od.bind(null,a),c=ut(c,m),a.callbackPriority=r,a.callbackNode=c,r}return m!==null&&m!==null&&Va(m),a.callbackPriority=2,a.callbackNode=null,2}function Od(a,r){if(Xn!==0&&Xn!==5)return a.callbackNode=null,a.callbackPriority=0,null;var c=a.callbackNode;if(Ic()&&a.callbackNode!==c)return null;var m=yt;return m=On(a,a===Yt?m:0,a.cancelPendingCommit!==null||a.timeoutHandle!==-1),m===0?null:(IS(a,m,r),$p(a,fn()),a.callbackNode!=null&&a.callbackNode===c?Od.bind(null,a):null)}function ou(a,r){if(Ic())return null;IS(a,r,!0)}function Md(){aE(function(){Mt&6?ut(Ya,Xm):Gp()})}function Qm(){if(fr===0){var a=Gr;a===0&&(a=$i,$i<<=1,!($i&261888)&&($i=256)),fr=a}return fr}function ZS(a){return a==null||typeof a=="symbol"||typeof a=="boolean"?null:typeof a=="function"?a:Qa(""+a)}function uu(a,r){var c=r.ownerDocument.createElement("input");return c.name=r.name,c.value=r.value,a.id&&c.setAttribute("form",a.id),r.parentNode.insertBefore(c,r),a=new FormData(a),c.parentNode.removeChild(c),a}function Id(a,r,c,m,T){if(r==="submit"&&c&&c.stateNode===T){var x=ZS((T[Hi]||null).action),C=m.submitter;C&&(r=(r=C[Hi]||null)?ZS(r.formAction):C.getAttribute("formAction"),r!==null&&(x=r,C=null));var k=new Bf("action","action",null,m,T);a.push({event:k,listeners:[{instance:null,listener:function(){if(m.defaultPrevented){if(fr!==0){var Y=C?uu(T,C):new FormData(T);yc(c,{pending:!0,data:Y,method:T.method,action:x},null,Y)}}else typeof x=="function"&&(k.preventDefault(),Y=C?uu(T,C):new FormData(T),yc(c,{pending:!0,data:Y,method:T.method,action:x},x,Y))},currentTarget:T}]})}}for(var Zm=0;Zm<nc.length;Zm++){var Nc=nc[Zm],Hp=Nc.toLowerCase(),jp=Nc[0].toUpperCase()+Nc.slice(1);Vi(Hp,"on"+jp)}Vi($f,"onAnimationEnd"),Vi(k0,"onAnimationIteration"),Vi(Zh,"onAnimationStart"),Vi("dblclick","onDoubleClick"),Vi("focusin","onFocus"),Vi("focusout","onBlur"),Vi(zo,"onTransitionRun"),Vi(Hf,"onTransitionStart"),Vi(sl,"onTransitionCancel"),Vi(oS,"onTransitionEnd"),el("onMouseEnter",["mouseout","mouseover"]),el("onMouseLeave",["mouseout","mouseover"]),el("onPointerEnter",["pointerout","pointerover"]),el("onPointerLeave",["pointerout","pointerover"]),Ir("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ir("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ir("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ir("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ir("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Uc="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),JS=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Uc));function WS(a,r){r=(r&4)!==0;for(var c=0;c<a.length;c++){var m=a[c],T=m.event;m=m.listeners;e:{var x=void 0;if(r)for(var C=m.length-1;0<=C;C--){var k=m[C],Y=k.instance,ue=k.currentTarget;if(k=k.listener,Y!==x&&T.isPropagationStopped())break e;x=k,T.currentTarget=ue;try{x(T)}catch(ve){Fo(ve)}T.currentTarget=null,x=Y}else for(C=0;C<m.length;C++){if(k=m[C],Y=k.instance,ue=k.currentTarget,k=k.listener,Y!==x&&T.isPropagationStopped())break e;x=k,T.currentTarget=ue;try{x(T)}catch(ve){Fo(ve)}T.currentTarget=null,x=Y}}}}function St(a,r){var c=r[Oh];c===void 0&&(c=r[Oh]=new Set);var m=a+"__bubble";c.has(m)||(wd(r,a,2,!1),c.add(m))}function Vp(a,r,c){var m=0;r&&(m|=4),wd(c,a,m,r)}var Jm="_reactListening"+Math.random().toString(36).slice(2);function kc(a){if(!a[Jm]){a[Jm]=!0,Lo.forEach(function(c){c!=="selectionchange"&&(JS.has(c)||Vp(c,!1,a),Vp(c,!0,a))});var r=a.nodeType===9?a:a.ownerDocument;r===null||r[Jm]||(r[Jm]=!0,Vp("selectionchange",!1,r))}}function wd(a,r,c,m){switch($d(r)){case 2:var T=Ll;break;case 8:T=_l;break;default:T=bi}c=T.bind(null,r,c,a),T=void 0,!Uf||r!=="touchstart"&&r!=="touchmove"&&r!=="wheel"||(T=!0),m?T!==void 0?a.addEventListener(r,c,{capture:!0,passive:T}):a.addEventListener(r,c,!0):T!==void 0?a.addEventListener(r,c,{passive:T}):a.addEventListener(r,c,!1)}function Yp(a,r,c,m,T){var x=m;if(!(r&1)&&!(r&2)&&m!==null)e:for(;;){if(m===null)return;var C=m.tag;if(C===3||C===4){var k=m.stateNode.containerInfo;if(k===T)break;if(C===4)for(C=m.return;C!==null;){var Y=C.tag;if((Y===3||Y===4)&&C.stateNode.containerInfo===T)return;C=C.return}for(;k!==null;){if(C=Ao(k),C===null)return;if(Y=C.tag,Y===5||Y===6||Y===26||Y===27){m=x=C;continue e}k=k.parentNode}}m=m.return}v0(function(){var ue=x,ve=zh(c),Ae=[];e:{var ce=ll.get(a);if(ce!==void 0){var pe=Bf,ze=a;switch(a){case"keypress":if(Ph(c)===0)break e;case"keydown":case"keyup":pe=jh;break;case"focusin":ze="focus",pe=$h;break;case"focusout":ze="blur",pe=$h;break;case"beforeblur":case"afterblur":pe=$h;break;case"click":if(c.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":pe=Zu;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":pe=Qv;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":pe=tS;break;case $f:case k0:case Zh:pe=Jv;break;case oS:pe=kb;break;case"scroll":case"scrollend":pe=Nb;break;case"wheel":pe=Bb;break;case"copy":case"cut":case"paste":pe=Mo;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":pe=As;break;case"toggle":case"beforetoggle":pe=L0}var Xe=(r&4)!==0,Kt=!Xe&&(a==="scroll"||a==="scrollend"),ie=Xe?ce!==null?ce+"Capture":null:ce;Xe=[];for(var W=ue,oe;W!==null;){var Te=W;if(oe=Te.stateNode,Te=Te.tag,Te!==5&&Te!==26&&Te!==27||oe===null||ie===null||(Te=ti(W,ie),Te!=null&&Xe.push(Nd(W,Te,oe))),Kt)break;W=W.return}0<Xe.length&&(ce=new pe(ce,ze,null,c,ve),Ae.push({event:ce,listeners:Xe}))}}if(!(r&7)){e:{if(ce=a==="mouseover"||a==="pointerover",pe=a==="mouseout"||a==="pointerout",ce&&c!==Bh&&(ze=c.relatedTarget||c.fromElement)&&(Ao(ze)||ze[Or]))break e;if((pe||ce)&&(ce=ve.window===ve?ve:(ce=ve.ownerDocument)?ce.defaultView||ce.parentWindow:window,pe?(ze=c.relatedTarget||c.toElement,pe=ue,ze=ze?Ao(ze):null,ze!==null&&(Kt=u(ze),Xe=ze.tag,ze!==Kt||Xe!==5&&Xe!==27&&Xe!==6)&&(ze=null)):(pe=null,ze=ue),pe!==ze)){if(Xe=Zu,Te="onMouseLeave",ie="onMouseEnter",W="mouse",(a==="pointerout"||a==="pointerover")&&(Xe=As,Te="onPointerLeave",ie="onPointerEnter",W="pointer"),Kt=pe==null?ce:Hu(pe),oe=ze==null?ce:Hu(ze),ce=new Xe(Te,W+"leave",pe,c,ve),ce.target=Kt,ce.relatedTarget=oe,Te=null,Ao(ve)===ue&&(Xe=new Xe(ie,W+"enter",ze,c,ve),Xe.target=oe,Xe.relatedTarget=Kt,Te=Xe),Kt=Te,pe&&ze)t:{for(Xe=eE,ie=pe,W=ze,oe=0,Te=ie;Te;Te=Xe(Te))oe++;Te=0;for(var Ye=W;Ye;Ye=Xe(Ye))Te++;for(;0<oe-Te;)ie=Xe(ie),oe--;for(;0<Te-oe;)W=Xe(W),Te--;for(;oe--;){if(ie===W||W!==null&&ie===W.alternate){Xe=ie;break t}ie=Xe(ie),W=Xe(W)}Xe=null}else Xe=null;pe!==null&&Wm(Ae,ce,pe,Xe,!1),ze!==null&&Kt!==null&&Wm(Ae,Kt,ze,Xe,!0)}}e:{if(ce=ue?Hu(ue):window,pe=ce.nodeName&&ce.nodeName.toLowerCase(),pe==="select"||pe==="input"&&ce.type==="file")var Ct=I0;else if(al(ce))if(qh)Ct=ko;else{Ct=lS;var Ge=sS}else pe=ce.nodeName,!pe||pe.toLowerCase()!=="input"||ce.type!=="checkbox"&&ce.type!=="radio"?ue&&y0(ue.elementType)&&(Ct=I0):Ct=kr;if(Ct&&(Ct=Ct(a,ue))){M0(Ae,Ct,c,ve);break e}Ge&&Ge(a,ce,ue),a==="focusout"&&ue&&ce.type==="number"&&ue.memoizedProps.value!=null&&_o(ce,"number",ce.value)}switch(Ge=ue?Hu(ue):window,a){case"focusin":(al(Ge)||Ge.contentEditable==="true")&&(zr=Ge,ec=ue,Wa=null);break;case"focusout":Wa=ec=zr=null;break;case"mousedown":Ds=!0;break;case"contextmenu":case"mouseup":case"dragend":Ds=!1,Qh(Ae,c,ve);break;case"selectionchange":if(Gf)break;case"keydown":case"keyup":Qh(Ae,c,ve)}var st;if(Ju)e:{switch(a){case"compositionstart":var ft="onCompositionStart";break e;case"compositionend":ft="onCompositionEnd";break e;case"compositionupdate":ft="onCompositionUpdate";break e}ft=void 0}else wo?Yh(a,c)&&(ft="onCompositionEnd"):a==="keydown"&&c.keyCode===229&&(ft="onCompositionStart");ft&&(_0&&c.locale!=="ko"&&(wo||ft!=="onCompositionStart"?ft==="onCompositionEnd"&&wo&&(st=E0()):(Kl=ve,S0="value"in Kl?Kl.value:Kl.textContent,wo=!0)),Ge=Ud(ue,ft),0<Ge.length&&(ft=new Wv(ft,a,null,c,ve),Ae.push({event:ft,listeners:Ge}),st?ft.data=st:(st=C0(c),st!==null&&(ft.data=st)))),(st=Ci?aS(a,c):zb(a,c))&&(ft=Ud(ue,"onBeforeInput"),0<ft.length&&(Ge=new Wv("onBeforeInput","beforeinput",null,c,ve),Ae.push({event:Ge,listeners:ft}),Ge.data=st)),Id(Ae,a,ue,c,ve)}WS(Ae,r)})}function Nd(a,r,c){return{instance:a,listener:r,currentTarget:c}}function Ud(a,r){for(var c=r+"Capture",m=[];a!==null;){var T=a,x=T.stateNode;if(T=T.tag,T!==5&&T!==26&&T!==27||x===null||(T=ti(a,c),T!=null&&m.unshift(Nd(a,T,x)),T=ti(a,r),T!=null&&m.push(Nd(a,T,x))),a.tag===3)return m;a=a.return}return[]}function eE(a){if(a===null)return null;do a=a.return;while(a&&a.tag!==5&&a.tag!==27);return a||null}function Wm(a,r,c,m,T){for(var x=r._reactName,C=[];c!==null&&c!==m;){var k=c,Y=k.alternate,ue=k.stateNode;if(k=k.tag,Y!==null&&Y===m)break;k!==5&&k!==26&&k!==27||ue===null||(Y=ue,T?(ue=ti(c,x),ue!=null&&C.unshift(Nd(c,ue,Y))):T||(ue=ti(c,x),ue!=null&&C.push(Nd(c,ue,Y)))),c=c.return}C.length!==0&&a.push({event:r,listeners:C})}var tE=/\r\n?/g,qp=/\u0000|\uFFFD/g;function Kp(a){return(typeof a=="string"?a:""+a).replace(tE,`
33
+ `).replace(qp,"")}function Xp(a,r){return r=Kp(r),Kp(a)===r}function qt(a,r,c,m,T,x){switch(c){case"children":typeof m=="string"?r==="body"||r==="textarea"&&m===""||tl(a,m):(typeof m=="number"||typeof m=="bigint")&&r!=="body"&&tl(a,""+m);break;case"className":Nh(a,"class",m);break;case"tabIndex":Nh(a,"tabindex",m);break;case"dir":case"role":case"viewBox":case"width":case"height":Nh(a,c,m);break;case"style":qv(a,m,x);break;case"data":if(r!=="object"){Nh(a,"data",m);break}case"src":case"href":if(m===""&&(r!=="a"||c!=="href")){a.removeAttribute(c);break}if(m==null||typeof m=="function"||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=Qa(""+m),a.setAttribute(c,m);break;case"action":case"formAction":if(typeof m=="function"){a.setAttribute(c,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof x=="function"&&(c==="formAction"?(r!=="input"&&qt(a,r,"name",T.name,T,null),qt(a,r,"formEncType",T.formEncType,T,null),qt(a,r,"formMethod",T.formMethod,T,null),qt(a,r,"formTarget",T.formTarget,T,null)):(qt(a,r,"encType",T.encType,T,null),qt(a,r,"method",T.method,T,null),qt(a,r,"target",T.target,T,null)));if(m==null||typeof m=="symbol"||typeof m=="boolean"){a.removeAttribute(c);break}m=Qa(""+m),a.setAttribute(c,m);break;case"onClick":m!=null&&(a.onclick=Ts);break;case"onScroll":m!=null&&St("scroll",a);break;case"onScrollEnd":m!=null&&St("scrollend",a);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(T.children!=null)throw Error(s(60));a.innerHTML=c}}break;case"multiple":a.multiple=m&&typeof m!="function"&&typeof m!="symbol";break;case"muted":a.muted=m&&typeof m!="function"&&typeof m!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(m==null||typeof m=="function"||typeof m=="boolean"||typeof m=="symbol"){a.removeAttribute("xlink:href");break}c=Qa(""+m),a.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",c);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""+m):a.removeAttribute(c);break;case"inert":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":m&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,""):a.removeAttribute(c);break;case"capture":case"download":m===!0?a.setAttribute(c,""):m!==!1&&m!=null&&typeof m!="function"&&typeof m!="symbol"?a.setAttribute(c,m):a.removeAttribute(c);break;case"cols":case"rows":case"size":case"span":m!=null&&typeof m!="function"&&typeof m!="symbol"&&!isNaN(m)&&1<=m?a.setAttribute(c,m):a.removeAttribute(c);break;case"rowSpan":case"start":m==null||typeof m=="function"||typeof m=="symbol"||isNaN(m)?a.removeAttribute(c):a.setAttribute(c,m);break;case"popover":St("beforetoggle",a),St("toggle",a),Yu(a,"popover",m);break;case"xlinkActuate":Yl(a,"http://www.w3.org/1999/xlink","xlink:actuate",m);break;case"xlinkArcrole":Yl(a,"http://www.w3.org/1999/xlink","xlink:arcrole",m);break;case"xlinkRole":Yl(a,"http://www.w3.org/1999/xlink","xlink:role",m);break;case"xlinkShow":Yl(a,"http://www.w3.org/1999/xlink","xlink:show",m);break;case"xlinkTitle":Yl(a,"http://www.w3.org/1999/xlink","xlink:title",m);break;case"xlinkType":Yl(a,"http://www.w3.org/1999/xlink","xlink:type",m);break;case"xmlBase":Yl(a,"http://www.w3.org/XML/1998/namespace","xml:base",m);break;case"xmlLang":Yl(a,"http://www.w3.org/XML/1998/namespace","xml:lang",m);break;case"xmlSpace":Yl(a,"http://www.w3.org/XML/1998/namespace","xml:space",m);break;case"is":Yu(a,"is",m);break;case"innerText":case"textContent":break;default:(!(2<c.length)||c[0]!=="o"&&c[0]!=="O"||c[1]!=="n"&&c[1]!=="N")&&(c=wb.get(c)||c,Yu(a,c,m))}}function Qp(a,r,c,m,T,x){switch(c){case"style":qv(a,m,x);break;case"dangerouslySetInnerHTML":if(m!=null){if(typeof m!="object"||!("__html"in m))throw Error(s(61));if(c=m.__html,c!=null){if(T.children!=null)throw Error(s(60));a.innerHTML=c}}break;case"children":typeof m=="string"?tl(a,m):(typeof m=="number"||typeof m=="bigint")&&tl(a,""+m);break;case"onScroll":m!=null&&St("scroll",a);break;case"onScrollEnd":m!=null&&St("scrollend",a);break;case"onClick":m!=null&&(a.onclick=Ts);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Mr.hasOwnProperty(c))e:{if(c[0]==="o"&&c[1]==="n"&&(T=c.endsWith("Capture"),r=c.slice(2,T?c.length-7:void 0),x=a[Hi]||null,x=x!=null?x[c]:null,typeof x=="function"&&a.removeEventListener(r,x,T),typeof m=="function")){typeof x!="function"&&x!==null&&(c in a?a[c]=null:a.hasAttribute(c)&&a.removeAttribute(c)),a.addEventListener(r,m,T);break e}c in a?a[c]=m:m===!0?a.setAttribute(c,""):Yu(a,c,m)}}}function Ti(a,r,c){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":St("error",a),St("load",a);var m=!1,T=!1,x;for(x in c)if(c.hasOwnProperty(x)){var C=c[x];if(C!=null)switch(x){case"src":m=!0;break;case"srcSet":T=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:qt(a,r,x,C,c,null)}}T&&qt(a,r,"srcSet",c.srcSet,c,null),m&&qt(a,r,"src",c.src,c,null);return;case"input":St("invalid",a);var k=x=C=T=null,Y=null,ue=null;for(m in c)if(c.hasOwnProperty(m)){var ve=c[m];if(ve!=null)switch(m){case"name":T=ve;break;case"type":C=ve;break;case"checked":Y=ve;break;case"defaultChecked":ue=ve;break;case"value":x=ve;break;case"defaultValue":k=ve;break;case"children":case"dangerouslySetInnerHTML":if(ve!=null)throw Error(s(137,r));break;default:qt(a,r,m,ve,c,null)}}If(a,x,k,Y,ue,C,T,!1);return;case"select":St("invalid",a),m=C=x=null;for(T in c)if(c.hasOwnProperty(T)&&(k=c[T],k!=null))switch(T){case"value":x=k;break;case"defaultValue":C=k;break;case"multiple":m=k;default:qt(a,r,T,k,c,null)}r=x,c=C,a.multiple=!!m,r!=null?qu(a,!!m,r,!1):c!=null&&qu(a,!!m,c,!0);return;case"textarea":St("invalid",a),x=T=m=null;for(C in c)if(c.hasOwnProperty(C)&&(k=c[C],k!=null))switch(C){case"value":m=k;break;case"defaultValue":T=k;break;case"children":x=k;break;case"dangerouslySetInnerHTML":if(k!=null)throw Error(s(91));break;default:qt(a,r,C,k,c,null)}p0(a,m,T,x);return;case"option":for(Y in c)if(c.hasOwnProperty(Y)&&(m=c[Y],m!=null))switch(Y){case"selected":a.selected=m&&typeof m!="function"&&typeof m!="symbol";break;default:qt(a,r,Y,m,c,null)}return;case"dialog":St("beforetoggle",a),St("toggle",a),St("cancel",a),St("close",a);break;case"iframe":case"object":St("load",a);break;case"video":case"audio":for(m=0;m<Uc.length;m++)St(Uc[m],a);break;case"image":St("error",a),St("load",a);break;case"details":St("toggle",a);break;case"embed":case"source":case"link":St("error",a),St("load",a);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(ue in c)if(c.hasOwnProperty(ue)&&(m=c[ue],m!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":throw Error(s(137,r));default:qt(a,r,ue,m,c,null)}return;default:if(y0(r)){for(ve in c)c.hasOwnProperty(ve)&&(m=c[ve],m!==void 0&&Qp(a,r,ve,m,c,void 0));return}}for(k in c)c.hasOwnProperty(k)&&(m=c[k],m!=null&&qt(a,r,k,m,c,null))}function Zp(a,r,c,m){switch(r){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var T=null,x=null,C=null,k=null,Y=null,ue=null,ve=null;for(pe in c){var Ae=c[pe];if(c.hasOwnProperty(pe)&&Ae!=null)switch(pe){case"checked":break;case"value":break;case"defaultValue":Y=Ae;default:m.hasOwnProperty(pe)||qt(a,r,pe,null,m,Ae)}}for(var ce in m){var pe=m[ce];if(Ae=c[ce],m.hasOwnProperty(ce)&&(pe!=null||Ae!=null))switch(ce){case"type":x=pe;break;case"name":T=pe;break;case"checked":ue=pe;break;case"defaultChecked":ve=pe;break;case"value":C=pe;break;case"defaultValue":k=pe;break;case"children":case"dangerouslySetInnerHTML":if(pe!=null)throw Error(s(137,r));break;default:pe!==Ae&&qt(a,r,ce,pe,m,Ae)}}Mf(a,C,k,Y,ue,ve,x,T);return;case"select":pe=C=k=ce=null;for(x in c)if(Y=c[x],c.hasOwnProperty(x)&&Y!=null)switch(x){case"value":break;case"multiple":pe=Y;default:m.hasOwnProperty(x)||qt(a,r,x,null,m,Y)}for(T in m)if(x=m[T],Y=c[T],m.hasOwnProperty(T)&&(x!=null||Y!=null))switch(T){case"value":ce=x;break;case"defaultValue":k=x;break;case"multiple":C=x;default:x!==Y&&qt(a,r,T,x,m,Y)}r=k,c=C,m=pe,ce!=null?qu(a,!!c,ce,!1):!!m!=!!c&&(r!=null?qu(a,!!c,r,!0):qu(a,!!c,c?[]:"",!1));return;case"textarea":pe=ce=null;for(k in c)if(T=c[k],c.hasOwnProperty(k)&&T!=null&&!m.hasOwnProperty(k))switch(k){case"value":break;case"children":break;default:qt(a,r,k,null,m,T)}for(C in m)if(T=m[C],x=c[C],m.hasOwnProperty(C)&&(T!=null||x!=null))switch(C){case"value":ce=T;break;case"defaultValue":pe=T;break;case"children":break;case"dangerouslySetInnerHTML":if(T!=null)throw Error(s(91));break;default:T!==x&&qt(a,r,C,T,m,x)}g0(a,ce,pe);return;case"option":for(var ze in c)if(ce=c[ze],c.hasOwnProperty(ze)&&ce!=null&&!m.hasOwnProperty(ze))switch(ze){case"selected":a.selected=!1;break;default:qt(a,r,ze,null,m,ce)}for(Y in m)if(ce=m[Y],pe=c[Y],m.hasOwnProperty(Y)&&ce!==pe&&(ce!=null||pe!=null))switch(Y){case"selected":a.selected=ce&&typeof ce!="function"&&typeof ce!="symbol";break;default:qt(a,r,Y,ce,m,pe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var Xe in c)ce=c[Xe],c.hasOwnProperty(Xe)&&ce!=null&&!m.hasOwnProperty(Xe)&&qt(a,r,Xe,null,m,ce);for(ue in m)if(ce=m[ue],pe=c[ue],m.hasOwnProperty(ue)&&ce!==pe&&(ce!=null||pe!=null))switch(ue){case"children":case"dangerouslySetInnerHTML":if(ce!=null)throw Error(s(137,r));break;default:qt(a,r,ue,ce,m,pe)}return;default:if(y0(r)){for(var Kt in c)ce=c[Kt],c.hasOwnProperty(Kt)&&ce!==void 0&&!m.hasOwnProperty(Kt)&&Qp(a,r,Kt,void 0,m,ce);for(ve in m)ce=m[ve],pe=c[ve],!m.hasOwnProperty(ve)||ce===pe||ce===void 0&&pe===void 0||Qp(a,r,ve,ce,m,pe);return}}for(var ie in c)ce=c[ie],c.hasOwnProperty(ie)&&ce!=null&&!m.hasOwnProperty(ie)&&qt(a,r,ie,null,m,ce);for(Ae in m)ce=m[Ae],pe=c[Ae],!m.hasOwnProperty(Ae)||ce===pe||ce==null&&pe==null||qt(a,r,Ae,ce,m,pe)}function eg(a){switch(a){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function Jp(){if(typeof performance.getEntriesByType=="function"){for(var a=0,r=0,c=performance.getEntriesByType("resource"),m=0;m<c.length;m++){var T=c[m],x=T.transferSize,C=T.initiatorType,k=T.duration;if(x&&k&&eg(C)){for(C=0,k=T.responseEnd,m+=1;m<c.length;m++){var Y=c[m],ue=Y.startTime;if(ue>k)break;var ve=Y.transferSize,Ae=Y.initiatorType;ve&&eg(Ae)&&(Y=Y.responseEnd,C+=ve*(Y<k?1:(k-ue)/(Y-ue)))}if(--m,r+=8*(x+C)/(T.duration/1e3),a++,10<a)break}}if(0<a)return r/a/1e6}return navigator.connection&&(a=navigator.connection.downlink,typeof a=="number")?a:5}var tg=null,ng=null;function lo(a){return a.nodeType===9?a:a.ownerDocument}function nE(a){switch(a){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function Wp(a,r){if(a===0)switch(r){case"svg":return 1;case"math":return 2;default:return 0}return a===1&&r==="foreignObject"?0:a}function Bc(a,r){return a==="textarea"||a==="noscript"||typeof r.children=="string"||typeof r.children=="number"||typeof r.children=="bigint"||typeof r.dangerouslySetInnerHTML=="object"&&r.dangerouslySetInnerHTML!==null&&r.dangerouslySetInnerHTML.__html!=null}var ig=null;function $b(){var a=window.event;return a&&a.type==="popstate"?a===ig?!1:(ig=a,!0):(ig=null,!1)}var kd=typeof setTimeout=="function"?setTimeout:void 0,iE=typeof clearTimeout=="function"?clearTimeout:void 0,cu=typeof Promise=="function"?Promise:void 0,aE=typeof queueMicrotask=="function"?queueMicrotask:typeof cu<"u"?function(a){return cu.resolve(null).then(a).catch(ey)}:kd;function ey(a){setTimeout(function(){throw a})}function Ps(a){return a==="head"}function ty(a,r){var c=r,m=0;do{var T=c.nextSibling;if(a.removeChild(c),T&&T.nodeType===8)if(c=T.data,c==="/$"||c==="/&"){if(m===0){a.removeChild(T),Xc(r);return}m--}else if(c==="$"||c==="$?"||c==="$~"||c==="$!"||c==="&")m++;else if(c==="html")fu(a.ownerDocument.documentElement);else if(c==="head"){c=a.ownerDocument.head,fu(c);for(var x=c.firstChild;x;){var C=x.nextSibling,k=x.nodeName;x[Ws]||k==="SCRIPT"||k==="STYLE"||k==="LINK"&&x.rel.toLowerCase()==="stylesheet"||c.removeChild(x),x=C}}else c==="body"&&fu(a.ownerDocument.body);c=T}while(c);Xc(r)}function Un(a,r){var c=a;a=0;do{var m=c.nextSibling;if(c.nodeType===1?r?(c._stashedDisplay=c.style.display,c.style.display="none"):(c.style.display=c._stashedDisplay||"",c.getAttribute("style")===""&&c.removeAttribute("style")):c.nodeType===3&&(r?(c._stashedText=c.nodeValue,c.nodeValue=""):c.nodeValue=c._stashedText||""),m&&m.nodeType===8)if(c=m.data,c==="/$"){if(a===0)break;a--}else c!=="$"&&c!=="$?"&&c!=="$~"&&c!=="$!"||a++;c=m}while(c)}function Bd(a){var r=a.firstChild;for(r&&r.nodeType===10&&(r=r.nextSibling);r;){var c=r;switch(r=r.nextSibling,c.nodeName){case"HTML":case"HEAD":case"BODY":Bd(c),Mh(c);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(c.rel.toLowerCase()==="stylesheet")continue}a.removeChild(c)}}function Hb(a,r,c,m){for(;a.nodeType===1;){var T=c;if(a.nodeName.toLowerCase()!==r.toLowerCase()){if(!m&&(a.nodeName!=="INPUT"||a.type!=="hidden"))break}else if(m){if(!a[Ws])switch(r){case"meta":if(!a.hasAttribute("itemprop"))break;return a;case"link":if(x=a.getAttribute("rel"),x==="stylesheet"&&a.hasAttribute("data-precedence"))break;if(x!==T.rel||a.getAttribute("href")!==(T.href==null||T.href===""?null:T.href)||a.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin)||a.getAttribute("title")!==(T.title==null?null:T.title))break;return a;case"style":if(a.hasAttribute("data-precedence"))break;return a;case"script":if(x=a.getAttribute("src"),(x!==(T.src==null?null:T.src)||a.getAttribute("type")!==(T.type==null?null:T.type)||a.getAttribute("crossorigin")!==(T.crossOrigin==null?null:T.crossOrigin))&&x&&a.hasAttribute("async")&&!a.hasAttribute("itemprop"))break;return a;default:return a}}else if(r==="input"&&a.type==="hidden"){var x=T.name==null?null:""+T.name;if(T.type==="hidden"&&a.getAttribute("name")===x)return a}else return a;if(a=ia(a.nextSibling),a===null)break}return null}function ht(a,r,c){if(r==="")return null;for(;a.nodeType!==3;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!c||(a=ia(a.nextSibling),a===null))return null;return a}function sE(a,r){for(;a.nodeType!==8;)if((a.nodeType!==1||a.nodeName!=="INPUT"||a.type!=="hidden")&&!r||(a=ia(a.nextSibling),a===null))return null;return a}function rs(a){return a.data==="$?"||a.data==="$~"}function ro(a){return a.data==="$!"||a.data==="$?"&&a.ownerDocument.readyState!=="loading"}function zc(a,r){var c=a.ownerDocument;if(a.data==="$~")a._reactRetry=r;else if(a.data!=="$?"||c.readyState!=="loading")r();else{var m=function(){r(),c.removeEventListener("DOMContentLoaded",m)};c.addEventListener("DOMContentLoaded",m),a._reactRetry=m}}function ia(a){for(;a!=null;a=a.nextSibling){var r=a.nodeType;if(r===1||r===3)break;if(r===8){if(r=a.data,r==="$"||r==="$!"||r==="$?"||r==="$~"||r==="&"||r==="F!"||r==="F")break;if(r==="/$"||r==="/&")return null}}return a}var zd=null;function ag(a){a=a.nextSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="/$"||c==="/&"){if(r===0)return ia(a.nextSibling);r--}else c!=="$"&&c!=="$!"&&c!=="$?"&&c!=="$~"&&c!=="&"||r++}a=a.nextSibling}return null}function Gs(a){a=a.previousSibling;for(var r=0;a;){if(a.nodeType===8){var c=a.data;if(c==="$"||c==="$!"||c==="$?"||c==="$~"||c==="&"){if(r===0)return a;r--}else c!=="/$"&&c!=="/&"||r++}a=a.previousSibling}return null}function Fc(a,r,c){switch(r=lo(c),a){case"html":if(a=r.documentElement,!a)throw Error(s(452));return a;case"head":if(a=r.head,!a)throw Error(s(453));return a;case"body":if(a=r.body,!a)throw Error(s(454));return a;default:throw Error(s(451))}}function fu(a){for(var r=a.attributes;r.length;)a.removeAttributeNode(r[0]);Mh(a)}var ha=new Map,Fd=new Set;function Ii(a){return typeof a.getRootNode=="function"?a.getRootNode():a.nodeType===9?a:a.ownerDocument}var $s=ne.d;ne.d={f:jb,r:lE,D:ge,C:Ut,L:Vb,m:ny,X:hr,S:iy,M:oo};function jb(){var a=$s.f(),r=Oc();return a||r}function lE(a){var r=Ro(a);r!==null&&r.tag===5&&r.type==="form"?Vt(r):$s.r(a)}var Pc=typeof document>"u"?null:document;function Hn(a,r,c){var m=Pc;if(m&&typeof r=="string"&&r){var T=Ea(r);T='link[rel="'+a+'"][href="'+T+'"]',typeof c=="string"&&(T+='[crossorigin="'+c+'"]'),Fd.has(T)||(Fd.add(T),a={rel:a,crossOrigin:c,href:r},m.querySelector(T)===null&&(r=m.createElement("link"),Ti(r,"link",a),Bt(r),m.head.appendChild(r)))}}function ge(a){$s.D(a),Hn("dns-prefetch",a,null)}function Ut(a,r){$s.C(a,r),Hn("preconnect",a,r)}function Vb(a,r,c){$s.L(a,r,c);var m=Pc;if(m&&a&&r){var T='link[rel="preload"][as="'+Ea(r)+'"]';r==="image"&&c&&c.imageSrcSet?(T+='[imagesrcset="'+Ea(c.imageSrcSet)+'"]',typeof c.imageSizes=="string"&&(T+='[imagesizes="'+Ea(c.imageSizes)+'"]')):T+='[href="'+Ea(a)+'"]';var x=T;switch(r){case"style":x=Na(a);break;case"script":x=du(a)}ha.has(x)||(a=b({rel:"preload",href:r==="image"&&c&&c.imageSrcSet?void 0:a,as:r},c),ha.set(x,a),m.querySelector(T)!==null||r==="style"&&m.querySelector(uo(x))||r==="script"&&m.querySelector(Hc(x))||(r=m.createElement("link"),Ti(r,"link",a),Bt(r),m.head.appendChild(r)))}}function ny(a,r){$s.m(a,r);var c=Pc;if(c&&a){var m=r&&typeof r.as=="string"?r.as:"script",T='link[rel="modulepreload"][as="'+Ea(m)+'"][href="'+Ea(a)+'"]',x=T;switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":x=du(a)}if(!ha.has(x)&&(a=b({rel:"modulepreload",href:a},r),ha.set(x,a),c.querySelector(T)===null)){switch(m){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(c.querySelector(Hc(x)))return}m=c.createElement("link"),Ti(m,"link",a),Bt(m),c.head.appendChild(m)}}}function iy(a,r,c){$s.S(a,r,c);var m=Pc;if(m&&a){var T=Do(m).hoistableStyles,x=Na(a);r=r||"default";var C=T.get(x);if(!C){var k={loading:0,preload:null};if(C=m.querySelector(uo(x)))k.loading=5;else{a=b({rel:"stylesheet",href:a,"data-precedence":r},c),(c=ha.get(x))&&sg(a,c);var Y=C=m.createElement("link");Bt(Y),Ti(Y,"link",a),Y._p=new Promise(function(ue,ve){Y.onload=ue,Y.onerror=ve}),Y.addEventListener("load",function(){k.loading|=1}),Y.addEventListener("error",function(){k.loading|=2}),k.loading|=4,Pd(C,r,m)}C={type:"stylesheet",instance:C,count:1,state:k},T.set(x,C)}}}function hr(a,r){$s.X(a,r);var c=Pc;if(c&&a){var m=Do(c).hoistableScripts,T=du(a),x=m.get(T);x||(x=c.querySelector(Hc(T)),x||(a=b({src:a,async:!0},r),(r=ha.get(T))&&lg(a,r),x=c.createElement("script"),Bt(x),Ti(x,"link",a),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(T,x))}}function oo(a,r){$s.M(a,r);var c=Pc;if(c&&a){var m=Do(c).hoistableScripts,T=du(a),x=m.get(T);x||(x=c.querySelector(Hc(T)),x||(a=b({src:a,async:!0,type:"module"},r),(r=ha.get(T))&&lg(a,r),x=c.createElement("script"),Bt(x),Ti(x,"link",a),c.head.appendChild(x)),x={type:"script",instance:x,count:1,state:null},m.set(T,x))}}function Gc(a,r,c,m){var T=(T=Ve.current)?Ii(T):null;if(!T)throw Error(s(446));switch(a){case"meta":case"title":return null;case"style":return typeof c.precedence=="string"&&typeof c.href=="string"?(r=Na(c.href),c=Do(T).hoistableStyles,m=c.get(r),m||(m={type:"style",instance:null,count:0,state:null},c.set(r,m)),m):{type:"void",instance:null,count:0,state:null};case"link":if(c.rel==="stylesheet"&&typeof c.href=="string"&&typeof c.precedence=="string"){a=Na(c.href);var x=Do(T).hoistableStyles,C=x.get(a);if(C||(T=T.ownerDocument||T,C={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},x.set(a,C),(x=T.querySelector(uo(a)))&&!x._p&&(C.instance=x,C.state.loading=5),ha.has(a)||(c={rel:"preload",as:"style",href:c.href,crossOrigin:c.crossOrigin,integrity:c.integrity,media:c.media,hrefLang:c.hrefLang,referrerPolicy:c.referrerPolicy},ha.set(a,c),x||rE(T,a,c,C.state))),r&&m===null)throw Error(s(528,""));return C}if(r&&m!==null)throw Error(s(529,""));return null;case"script":return r=c.async,c=c.src,typeof c=="string"&&r&&typeof r!="function"&&typeof r!="symbol"?(r=du(c),c=Do(T).hoistableScripts,m=c.get(r),m||(m={type:"script",instance:null,count:0,state:null},c.set(r,m)),m):{type:"void",instance:null,count:0,state:null};default:throw Error(s(444,a))}}function Na(a){return'href="'+Ea(a)+'"'}function uo(a){return'link[rel="stylesheet"]['+a+"]"}function $c(a){return b({},a,{"data-precedence":a.precedence,precedence:null})}function rE(a,r,c,m){a.querySelector('link[rel="preload"][as="style"]['+r+"]")?m.loading=1:(r=a.createElement("link"),m.preload=r,r.addEventListener("load",function(){return m.loading|=1}),r.addEventListener("error",function(){return m.loading|=2}),Ti(r,"link",c),Bt(r),a.head.appendChild(r))}function du(a){return'[src="'+Ea(a)+'"]'}function Hc(a){return"script[async]"+a}function ay(a,r,c){if(r.count++,r.instance===null)switch(r.type){case"style":var m=a.querySelector('style[data-href~="'+Ea(c.href)+'"]');if(m)return r.instance=m,Bt(m),m;var T=b({},c,{"data-href":c.href,"data-precedence":c.precedence,href:null,precedence:null});return m=(a.ownerDocument||a).createElement("style"),Bt(m),Ti(m,"style",T),Pd(m,c.precedence,a),r.instance=m;case"stylesheet":T=Na(c.href);var x=a.querySelector(uo(T));if(x)return r.state.loading|=4,r.instance=x,Bt(x),x;m=$c(c),(T=ha.get(T))&&sg(m,T),x=(a.ownerDocument||a).createElement("link"),Bt(x);var C=x;return C._p=new Promise(function(k,Y){C.onload=k,C.onerror=Y}),Ti(x,"link",m),r.state.loading|=4,Pd(x,c.precedence,a),r.instance=x;case"script":return x=du(c.src),(T=a.querySelector(Hc(x)))?(r.instance=T,Bt(T),T):(m=c,(T=ha.get(x))&&(m=b({},c),lg(m,T)),a=a.ownerDocument||a,T=a.createElement("script"),Bt(T),Ti(T,"link",m),a.head.appendChild(T),r.instance=T);case"void":return null;default:throw Error(s(443,r.type))}else r.type==="stylesheet"&&!(r.state.loading&4)&&(m=r.instance,r.state.loading|=4,Pd(m,c.precedence,a));return r.instance}function Pd(a,r,c){for(var m=c.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),T=m.length?m[m.length-1]:null,x=T,C=0;C<m.length;C++){var k=m[C];if(k.dataset.precedence===r)x=k;else if(x!==T)break}x?x.parentNode.insertBefore(a,x.nextSibling):(r=c.nodeType===9?c.head:c,r.insertBefore(a,r.firstChild))}function sg(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.title==null&&(a.title=r.title)}function lg(a,r){a.crossOrigin==null&&(a.crossOrigin=r.crossOrigin),a.referrerPolicy==null&&(a.referrerPolicy=r.referrerPolicy),a.integrity==null&&(a.integrity=r.integrity)}var jc=null;function sy(a,r,c){if(jc===null){var m=new Map,T=jc=new Map;T.set(c,m)}else T=jc,m=T.get(c),m||(m=new Map,T.set(c,m));if(m.has(a))return m;for(m.set(a,null),c=c.getElementsByTagName(a),T=0;T<c.length;T++){var x=c[T];if(!(x[Ws]||x[jt]||a==="link"&&x.getAttribute("rel")==="stylesheet")&&x.namespaceURI!=="http://www.w3.org/2000/svg"){var C=x.getAttribute(r)||"";C=a+C;var k=m.get(C);k?k.push(x):m.set(C,[x])}}return m}function rg(a,r,c){a=a.ownerDocument||a,a.head.insertBefore(c,r==="title"?a.querySelector("head > title"):null)}function ly(a,r,c){if(c===1||r.itemProp!=null)return!1;switch(a){case"meta":case"title":return!0;case"style":if(typeof r.precedence!="string"||typeof r.href!="string"||r.href==="")break;return!0;case"link":if(typeof r.rel!="string"||typeof r.href!="string"||r.href===""||r.onLoad||r.onError)break;switch(r.rel){case"stylesheet":return a=r.disabled,typeof r.precedence=="string"&&a==null;default:return!0}case"script":if(r.async&&typeof r.async!="function"&&typeof r.async!="symbol"&&!r.onLoad&&!r.onError&&r.src&&typeof r.src=="string")return!0}return!1}function ma(a){return!(a.type==="stylesheet"&&!(a.state.loading&3))}function Dl(a,r,c,m){if(c.type==="stylesheet"&&(typeof m.media!="string"||matchMedia(m.media).matches!==!1)&&!(c.state.loading&4)){if(c.instance===null){var T=Na(m.href),x=r.querySelector(uo(T));if(x){r=x._p,r!==null&&typeof r=="object"&&typeof r.then=="function"&&(a.count++,a=og.bind(a),r.then(a,a)),c.state.loading|=4,c.instance=x,Bt(x);return}x=r.ownerDocument||r,m=$c(m),(T=ha.get(T))&&sg(m,T),x=x.createElement("link"),Bt(x);var C=x;C._p=new Promise(function(k,Y){C.onload=k,C.onerror=Y}),Ti(x,"link",m),c.instance=x}a.stylesheets===null&&(a.stylesheets=new Map),a.stylesheets.set(c,r),(r=c.state.preload)&&!(c.state.loading&3)&&(a.count++,c=og.bind(a),r.addEventListener("load",c),r.addEventListener("error",c))}}var Ua=0;function ry(a,r){return a.stylesheets&&a.count===0&&cg(a,a.stylesheets),0<a.count||0<a.imgCount?function(c){var m=setTimeout(function(){if(a.stylesheets&&cg(a,a.stylesheets),a.unsuspend){var x=a.unsuspend;a.unsuspend=null,x()}},6e4+r);0<a.imgBytes&&Ua===0&&(Ua=62500*Jp());var T=setTimeout(function(){if(a.waitingForImages=!1,a.count===0&&(a.stylesheets&&cg(a,a.stylesheets),a.unsuspend)){var x=a.unsuspend;a.unsuspend=null,x()}},(a.imgBytes>Ua?50:800)+r);return a.unsuspend=c,function(){a.unsuspend=null,clearTimeout(m),clearTimeout(T)}}:null}function og(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)cg(this,this.stylesheets);else if(this.unsuspend){var a=this.unsuspend;this.unsuspend=null,a()}}}var ug=null;function cg(a,r){a.stylesheets=null,a.unsuspend!==null&&(a.count++,ug=new Map,r.forEach(oi,a),ug=null,og.call(a))}function oi(a,r){if(!(r.state.loading&4)){var c=ug.get(a);if(c)var m=c.get(null);else{c=new Map,ug.set(a,c);for(var T=a.querySelectorAll("link[data-precedence],style[data-precedence]"),x=0;x<T.length;x++){var C=T[x];(C.nodeName==="LINK"||C.getAttribute("media")!=="not all")&&(c.set(C.dataset.precedence,C),m=C)}m&&c.set(null,m)}T=r.instance,C=T.getAttribute("data-precedence"),x=c.get(C)||m,x===m&&c.set(null,T),c.set(C,T),this.count++,m=og.bind(this),T.addEventListener("load",m),T.addEventListener("error",m),x?x.parentNode.insertBefore(T,x.nextSibling):(a=a.nodeType===9?a.head:a,a.insertBefore(T,a.firstChild)),r.state.loading|=4}}var Gd={$$typeof:z,Provider:null,Consumer:null,_currentValue:le,_currentValue2:le,_threadCount:0};function oy(a,r,c,m,T,x,C,k,Y){this.tag=1,this.containerInfo=a,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=_f(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=_f(0),this.hiddenUpdates=_f(null),this.identifierPrefix=m,this.onUncaughtError=T,this.onCaughtError=x,this.onRecoverableError=C,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=Y,this.incompleteTransitions=new Map}function fg(a,r,c,m,T,x,C,k,Y,ue,ve,Ae){return a=new oy(a,r,c,C,Y,ue,ve,Ae,k),r=1,x===!0&&(r|=24),x=xn(3,null,null,r),a.current=x,x.stateNode=a,r=Xf(),r.refCount++,a.pooledCache=r,r.refCount++,x.memoizedState={element:m,isDehydrated:c,cache:r},nd(x),a}function hu(a){return a?(a=Yi,a):Yi}function oE(a,r,c,m,T,x){T=hu(T),m.context===null?m.context=T:m.pendingContext=T,m=ir(r),m.payload={element:c},x=x===void 0?null:x,x!==null&&(m.callback=x),c=La(a,m,r),c!==null&&(na(c,a,r),qr(c,a,r))}function dg(a,r){if(a=a.memoizedState,a!==null&&a.dehydrated!==null){var c=a.retryLane;a.retryLane=c!==0&&c<r?c:r}}function uy(a,r){dg(a,r),(a=a.alternate)&&dg(a,r)}function uE(a){if(a.tag===13||a.tag===31){var r=Ql(a,67108864);r!==null&&na(r,a,67108864),uy(a,67108864)}}function mu(a){if(a.tag===13||a.tag===31){var r=da();r=_h(r);var c=Ql(a,r);c!==null&&na(c,a,r),uy(a,r)}}var Qn=!0;function Ll(a,r,c,m){var T=F.T;F.T=null;var x=ne.p;try{ne.p=2,bi(a,r,c,m)}finally{ne.p=x,F.T=T}}function _l(a,r,c,m){var T=F.T;F.T=null;var x=ne.p;try{ne.p=8,bi(a,r,c,m)}finally{ne.p=x,F.T=T}}function bi(a,r,c,m){if(Qn){var T=cy(m);if(T===null)Yp(a,r,m,hg,c),mr(a,m);else if(Yb(T,a,r,c,m))m.stopPropagation();else if(mr(a,m),r&4&&-1<aa.indexOf(a)){for(;T!==null;){var x=Ro(T);if(x!==null)switch(x.tag){case 3:if(x=x.stateNode,x.current.memoizedState.isDehydrated){var C=Xa(x.pendingLanes);if(C!==0){var k=x;for(k.pendingLanes|=2,k.entangledLanes|=2;C;){var Y=1<<31-ye(C);k.entanglements[1]|=Y,C&=~Y}Rl(x),!(Mt&6)&&(Nt=fn()+500,dr(0))}}break;case 31:case 13:k=Ql(x,2),k!==null&&na(k,x,2),Oc(),uy(x,2)}if(x=cy(m),x===null&&Yp(a,r,m,hg,c),x===T)break;T=x}T!==null&&m.stopPropagation()}else Yp(a,r,m,null,c)}}function cy(a){return a=zh(a),Vc(a)}var hg=null;function Vc(a){if(hg=null,a=Ao(a),a!==null){var r=u(a);if(r===null)a=null;else{var c=r.tag;if(c===13){if(a=d(r),a!==null)return a;a=null}else if(c===31){if(a=g(r),a!==null)return a;a=null}else if(c===3){if(r.stateNode.current.memoizedState.isDehydrated)return r.tag===3?r.stateNode.containerInfo:null;a=null}else r!==a&&(a=null)}}return hg=a,null}function $d(a){switch(a){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return 2;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 8;case"message":switch(To()){case Ya:return 2;case Vl:return 8;case Pn:case qa:return 32;case bo:return 268435456;default:return 32}default:return 32}}var Yc=!1,Zn=null,xi=null,wi=null,co=new Map,os=new Map,gn=[],aa="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" ");function mr(a,r){switch(a){case"focusin":case"focusout":Zn=null;break;case"dragenter":case"dragleave":xi=null;break;case"mouseover":case"mouseout":wi=null;break;case"pointerover":case"pointerout":co.delete(r.pointerId);break;case"gotpointercapture":case"lostpointercapture":os.delete(r.pointerId)}}function gu(a,r,c,m,T,x){return a===null||a.nativeEvent!==x?(a={blockedOn:r,domEventName:c,eventSystemFlags:m,nativeEvent:x,targetContainers:[T]},r!==null&&(r=Ro(r),r!==null&&uE(r)),a):(a.eventSystemFlags|=m,r=a.targetContainers,T!==null&&r.indexOf(T)===-1&&r.push(T),a)}function Yb(a,r,c,m,T){switch(r){case"focusin":return Zn=gu(Zn,a,r,c,m,T),!0;case"dragenter":return xi=gu(xi,a,r,c,m,T),!0;case"mouseover":return wi=gu(wi,a,r,c,m,T),!0;case"pointerover":var x=T.pointerId;return co.set(x,gu(co.get(x)||null,a,r,c,m,T)),!0;case"gotpointercapture":return x=T.pointerId,os.set(x,gu(os.get(x)||null,a,r,c,m,T)),!0}return!1}function cE(a){var r=Ao(a.target);if(r!==null){var c=u(r);if(c!==null){if(r=c.tag,r===13){if(r=d(c),r!==null){a.blockedOn=r,c0(a.priority,function(){mu(c)});return}}else if(r===31){if(r=g(c),r!==null){a.blockedOn=r,c0(a.priority,function(){mu(c)});return}}else if(r===3&&c.stateNode.current.memoizedState.isDehydrated){a.blockedOn=c.tag===3?c.stateNode.containerInfo:null;return}}}a.blockedOn=null}function Hd(a){if(a.blockedOn!==null)return!1;for(var r=a.targetContainers;0<r.length;){var c=cy(a.nativeEvent);if(c===null){c=a.nativeEvent;var m=new c.constructor(c.type,c);Bh=m,c.target.dispatchEvent(m),Bh=null}else return r=Ro(c),r!==null&&uE(r),a.blockedOn=c,!1;r.shift()}return!0}function qc(a,r,c){Hd(a)&&c.delete(r)}function fE(){Yc=!1,Zn!==null&&Hd(Zn)&&(Zn=null),xi!==null&&Hd(xi)&&(xi=null),wi!==null&&Hd(wi)&&(wi=null),co.forEach(qc),os.forEach(qc)}function Cl(a,r){a.blockedOn===r&&(a.blockedOn=null,Yc||(Yc=!0,h.unstable_scheduleCallback(h.unstable_NormalPriority,fE)))}var Kc=null;function dE(a){Kc!==a&&(Kc=a,h.unstable_scheduleCallback(h.unstable_NormalPriority,function(){Kc===a&&(Kc=null);for(var r=0;r<a.length;r+=3){var c=a[r],m=a[r+1],T=a[r+2];if(typeof m!="function"){if(Vc(m||c)===null)continue;break}var x=Ro(c);x!==null&&(a.splice(r,3),r-=3,yc(x,{pending:!0,data:T,method:c.method,action:m},m,T))}}))}function Xc(a){function r(Y){return Cl(Y,a)}Zn!==null&&Cl(Zn,a),xi!==null&&Cl(xi,a),wi!==null&&Cl(wi,a),co.forEach(r),os.forEach(r);for(var c=0;c<gn.length;c++){var m=gn[c];m.blockedOn===a&&(m.blockedOn=null)}for(;0<gn.length&&(c=gn[0],c.blockedOn===null);)cE(c),c.blockedOn===null&&gn.shift();if(c=(a.ownerDocument||a).$$reactFormReplay,c!=null)for(m=0;m<c.length;m+=3){var T=c[m],x=c[m+1],C=T[Hi]||null;if(typeof x=="function")C||dE(c);else if(C){var k=null;if(x&&x.hasAttribute("formAction")){if(T=x,C=x[Hi]||null)k=C.formAction;else if(Vc(T)!==null)continue}else k=C.action;typeof k=="function"?c[m+1]=k:(c.splice(m,3),m-=3),dE(c)}}}function fy(){function a(x){x.canIntercept&&x.info==="react-transition"&&x.intercept({handler:function(){return new Promise(function(C){return T=C})},focusReset:"manual",scroll:"manual"})}function r(){T!==null&&(T(),T=null),m||setTimeout(c,20)}function c(){if(!m&&!navigation.transition){var x=navigation.currentEntry;x&&x.url!=null&&navigation.navigate(x.url,{state:x.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var m=!1,T=null;return navigation.addEventListener("navigate",a),navigation.addEventListener("navigatesuccess",r),navigation.addEventListener("navigateerror",r),setTimeout(c,100),function(){m=!0,navigation.removeEventListener("navigate",a),navigation.removeEventListener("navigatesuccess",r),navigation.removeEventListener("navigateerror",r),T!==null&&(T(),T=null)}}}function mg(a){this._internalRoot=a}gg.prototype.render=mg.prototype.render=function(a){var r=this._internalRoot;if(r===null)throw Error(s(409));var c=r.current,m=da();oE(c,m,a,r,null,null)},gg.prototype.unmount=mg.prototype.unmount=function(){var a=this._internalRoot;if(a!==null){this._internalRoot=null;var r=a.containerInfo;oE(a.current,2,null,a,null,null),Oc(),r[Or]=null}};function gg(a){this._internalRoot=a}gg.prototype.unstable_scheduleHydration=function(a){if(a){var r=Ch();a={blockedOn:null,target:a,priority:r};for(var c=0;c<gn.length&&r!==0&&r<gn[c].priority;c++);gn.splice(c,0,a),c===0&&cE(a)}};var dy=e.version;if(dy!=="19.2.3")throw Error(s(527,dy,"19.2.3"));ne.findDOMNode=function(a){var r=a._reactInternals;if(r===void 0)throw typeof a.render=="function"?Error(s(188)):(a=Object.keys(a).join(","),Error(s(268,a)));return a=v(r),a=a!==null?E(a):null,a=a===null?null:a.stateNode,a};var hE={bundleType:0,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:F,reconcilerVersion:"19.2.3"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var jd=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!jd.isDisabled&&jd.supportsFiber)try{Zs=jd.inject(hE),Si=jd}catch{}}return qg.createRoot=function(a,r){if(!o(a))throw Error(s(299));var c=!1,m="",T=Dm,x=hp,C=Lm;return r!=null&&(r.unstable_strictMode===!0&&(c=!0),r.identifierPrefix!==void 0&&(m=r.identifierPrefix),r.onUncaughtError!==void 0&&(T=r.onUncaughtError),r.onCaughtError!==void 0&&(x=r.onCaughtError),r.onRecoverableError!==void 0&&(C=r.onRecoverableError)),r=fg(a,1,!1,null,null,c,m,null,T,x,C,fy),a[Or]=r.current,kc(a),new mg(r)},qg.hydrateRoot=function(a,r,c){if(!o(a))throw Error(s(299));var m=!1,T="",x=Dm,C=hp,k=Lm,Y=null;return c!=null&&(c.unstable_strictMode===!0&&(m=!0),c.identifierPrefix!==void 0&&(T=c.identifierPrefix),c.onUncaughtError!==void 0&&(x=c.onUncaughtError),c.onCaughtError!==void 0&&(C=c.onCaughtError),c.onRecoverableError!==void 0&&(k=c.onRecoverableError),c.formState!==void 0&&(Y=c.formState)),r=fg(a,1,!0,r,c??null,m,T,Y,x,C,k,fy),r.context=hu(null),c=r.current,m=da(),m=_h(m),T=ir(m),T.callback=null,La(c,T,m),c=m,r.current.lanes=c,$u(r,c),Rl(r),a[Or]=r.current,kc(a),new gg(r)},qg.version="19.2.3",qg}var Kg={};/**
34
+ * @license React
35
+ * react-dom-client.development.js
36
+ *
37
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
38
+ *
39
+ * This source code is licensed under the MIT license found in the
40
+ * LICENSE file in the root directory of this source tree.
41
+ */var ox;function w_(){return ox||(ox=1,process.env.NODE_ENV!=="production"&&function(){function h(t,n){for(t=t.memoizedState;t!==null&&0<n;)t=t.next,n--;return t}function e(t,n,l,f){if(l>=n.length)return f;var p=n[l],y=Hn(t)?t.slice():ht({},t);return y[p]=e(t[p],n,l+1,f),y}function i(t,n,l){if(n.length!==l.length)console.warn("copyWithRename() expects paths of the same length");else{for(var f=0;f<l.length-1;f++)if(n[f]!==l[f]){console.warn("copyWithRename() expects paths to be the same except for the deepest key");return}return s(t,n,l,0)}}function s(t,n,l,f){var p=n[f],y=Hn(t)?t.slice():ht({},t);return f+1===n.length?(y[l[f]]=y[p],Hn(y)?y.splice(p,1):delete y[p]):y[p]=s(t[p],n,l,f+1),y}function o(t,n,l){var f=n[l],p=Hn(t)?t.slice():ht({},t);return l+1===n.length?(Hn(p)?p.splice(f,1):delete p[f],p):(p[f]=o(t[f],n,l+1),p)}function u(){return!1}function d(){return null}function g(){console.error("Do not call Hooks inside useEffect(...), useMemo(...), or other built-in Hooks. You can only call Hooks at the top level of your React function. For more information, see https://react.dev/link/rules-of-hooks")}function S(){console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().")}function v(){}function E(){}function b(t){var n=[];return t.forEach(function(l){n.push(l)}),n.sort().join(", ")}function R(t,n,l,f){return new zb(t,n,l,f)}function _(t,n){t.context===Wc&&(Wm(t.current,2,n,t,null,null),Ia())}function D(t,n){if(Il!==null){var l=n.staleFamilies;n=n.updatedFamilies,Td(),aS(t.current,n,l),Ia()}}function I(t){Il=t}function M(t){return!(!t||t.nodeType!==1&&t.nodeType!==9&&t.nodeType!==11)}function w(t){var n=t,l=t;if(t.alternate)for(;n.return;)n=n.return;else{t=n;do n=t,n.flags&4098&&(l=n.return),t=n.return;while(t)}return n.tag===3?l:null}function B(t){if(t.tag===13){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function z(t){if(t.tag===31){var n=t.memoizedState;if(n===null&&(t=t.alternate,t!==null&&(n=t.memoizedState)),n!==null)return n.dehydrated}return null}function G(t){if(w(t)!==t)throw Error("Unable to find node on an unmounted component.")}function K(t){var n=t.alternate;if(!n){if(n=w(t),n===null)throw Error("Unable to find node on an unmounted component.");return n!==t?null:t}for(var l=t,f=n;;){var p=l.return;if(p===null)break;var y=p.alternate;if(y===null){if(f=p.return,f!==null){l=f;continue}break}if(p.child===y.child){for(y=p.child;y;){if(y===l)return G(p),t;if(y===f)return G(p),n;y=y.sibling}throw Error("Unable to find node on an unmounted component.")}if(l.return!==f.return)l=p,f=y;else{for(var A=!1,L=p.child;L;){if(L===l){A=!0,l=p,f=y;break}if(L===f){A=!0,f=p,l=y;break}L=L.sibling}if(!A){for(L=y.child;L;){if(L===l){A=!0,l=y,f=p;break}if(L===f){A=!0,f=y,l=p;break}L=L.sibling}if(!A)throw Error("Child was not found in either parent set. This indicates a bug in React related to the return pointer. Please file an issue.")}}if(l.alternate!==f)throw Error("Return fibers should always be each others' alternates. This error is likely caused by a bug in React. Please file an issue.")}if(l.tag!==3)throw Error("Unable to find node on an unmounted component.");return l.stateNode.current===l?t:n}function ae(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t;for(t=t.child;t!==null;){if(n=ae(t),n!==null)return n;t=t.sibling}return null}function q(t){return t===null||typeof t!="object"?null:(t=lE&&t[lE]||t["@@iterator"],typeof t=="function"?t:null)}function Z(t){if(t==null)return null;if(typeof t=="function")return t.$$typeof===Pc?null:t.displayName||t.name||null;if(typeof t=="string")return t;switch(t){case zc:return"Fragment";case zd:return"Profiler";case ia:return"StrictMode";case fu:return"Suspense";case ha:return"SuspenseList";case $s:return"Activity"}if(typeof t=="object")switch(typeof t.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),t.$$typeof){case ro:return"Portal";case Gs:return t.displayName||"Context";case ag:return(t._context.displayName||"Context")+".Consumer";case Fc:var n=t.render;return t=t.displayName,t||(t=n.displayName||n.name||"",t=t!==""?"ForwardRef("+t+")":"ForwardRef"),t;case Fd:return n=t.displayName||null,n!==null?n:Z(t.type)||"Memo";case Ii:n=t._payload,t=t._init;try{return Z(t(n))}catch{}}return null}function te(t){return typeof t.tag=="number"?$(t):typeof t.name=="string"?t.name:null}function $(t){var n=t.type;switch(t.tag){case 31:return"Activity";case 24:return"Cache";case 9:return(n._context.displayName||"Context")+".Consumer";case 10:return n.displayName||"Context";case 18:return"DehydratedFragment";case 11:return t=n.render,t=t.displayName||t.name||"",n.displayName||(t!==""?"ForwardRef("+t+")":"ForwardRef");case 7:return"Fragment";case 26:case 27:case 5:return n;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Z(n);case 8:return n===ia?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 14:case 15:if(typeof n=="function")return n.displayName||n.name||null;if(typeof n=="string")return n;break;case 29:if(n=t._debugInfo,n!=null){for(var l=n.length-1;0<=l;l--)if(typeof n[l].name=="string")return n[l].name}if(t.return!==null)return $(t.return)}return null}function me(t){return{current:t}}function Ee(t,n){0>hr?console.error("Unexpected pop."):(n!==iy[hr]&&console.error("Unexpected Fiber popped."),t.current=ny[hr],ny[hr]=null,iy[hr]=null,hr--)}function De(t,n,l){hr++,ny[hr]=t.current,iy[hr]=l,t.current=n}function Ie(t){return t===null&&console.error("Expected host context to exist. This error is likely caused by a bug in React. Please file an issue."),t}function Oe(t,n){De(Na,n,t),De(Gc,t,t),De(oo,null,t);var l=n.nodeType;switch(l){case 9:case 11:l=l===9?"#document":"#fragment",n=(n=n.documentElement)&&(n=n.namespaceURI)?wS(n):Cu;break;default:if(l=n.tagName,n=n.namespaceURI)n=wS(n),n=cr(n,l);else switch(l){case"svg":n=Vg;break;case"math":n=aT;break;default:n=Cu}}l=l.toLowerCase(),l=m0(null,l),l={context:n,ancestorInfo:l},Ee(oo,t),De(oo,l,t)}function F(t){Ee(oo,t),Ee(Gc,t),Ee(Na,t)}function ne(){return Ie(oo.current)}function le(t){t.memoizedState!==null&&De(uo,t,t);var n=Ie(oo.current),l=t.type,f=cr(n.context,l);l=m0(n.ancestorInfo,l),f={context:f,ancestorInfo:l},n!==f&&(De(Gc,t,t),De(oo,f,t))}function xe(t){Gc.current===t&&(Ee(oo,t),Ee(Gc,t)),uo.current===t&&(Ee(uo,t),tv._currentValue=hh)}function _e(){}function Q(){if($c===0){rE=console.log,du=console.info,Hc=console.warn,ay=console.error,Pd=console.group,sg=console.groupCollapsed,lg=console.groupEnd;var t={configurable:!0,enumerable:!0,value:_e,writable:!0};Object.defineProperties(console,{info:t,log:t,warn:t,error:t,group:t,groupCollapsed:t,groupEnd:t})}$c++}function de(){if($c--,$c===0){var t={configurable:!0,enumerable:!0,writable:!0};Object.defineProperties(console,{log:ht({},t,{value:rE}),info:ht({},t,{value:du}),warn:ht({},t,{value:Hc}),error:ht({},t,{value:ay}),group:ht({},t,{value:Pd}),groupCollapsed:ht({},t,{value:sg}),groupEnd:ht({},t,{value:lg})})}0>$c&&console.error("disabledDepth fell below zero. This is a bug in React. Please file an issue.")}function Le(t){var n=Error.prepareStackTrace;if(Error.prepareStackTrace=void 0,t=t.stack,Error.prepareStackTrace=n,t.startsWith(`Error: react-stack-top-frame
42
+ `)&&(t=t.slice(29)),n=t.indexOf(`
43
+ `),n!==-1&&(t=t.slice(n+1)),n=t.indexOf("react_stack_bottom_frame"),n!==-1&&(n=t.lastIndexOf(`
44
+ `,n)),n!==-1)t=t.slice(0,n);else return"";return t}function Ce(t){if(jc===void 0)try{throw Error()}catch(l){var n=l.stack.trim().match(/\n( *(at )?)/);jc=n&&n[1]||"",sy=-1<l.stack.indexOf(`
45
+ at`)?" (<anonymous>)":-1<l.stack.indexOf("@")?"@unknown:0:0":""}return`
46
+ `+jc+t+sy}function Fe(t,n){if(!t||rg)return"";var l=ly.get(t);if(l!==void 0)return l;rg=!0,l=Error.prepareStackTrace,Error.prepareStackTrace=void 0;var f=null;f=ge.H,ge.H=null,Q();try{var p={DetermineComponentFrameRoot:function(){try{if(n){var j=function(){throw Error()};if(Object.defineProperty(j.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(j,[])}catch(Me){var fe=Me}Reflect.construct(t,[],j)}else{try{j.call()}catch(Me){fe=Me}t.call(j.prototype)}}else{try{throw Error()}catch(Me){fe=Me}(j=t())&&typeof j.catch=="function"&&j.catch(function(){})}}catch(Me){if(Me&&fe&&typeof Me.stack=="string")return[Me.stack,fe.stack]}return[null,null]}};p.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var y=Object.getOwnPropertyDescriptor(p.DetermineComponentFrameRoot,"name");y&&y.configurable&&Object.defineProperty(p.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=p.DetermineComponentFrameRoot(),L=A[0],N=A[1];if(L&&N){var U=L.split(`
47
+ `),J=N.split(`
48
+ `);for(A=y=0;y<U.length&&!U[y].includes("DetermineComponentFrameRoot");)y++;for(;A<J.length&&!J[A].includes("DetermineComponentFrameRoot");)A++;if(y===U.length||A===J.length)for(y=U.length-1,A=J.length-1;1<=y&&0<=A&&U[y]!==J[A];)A--;for(;1<=y&&0<=A;y--,A--)if(U[y]!==J[A]){if(y!==1||A!==1)do if(y--,A--,0>A||U[y]!==J[A]){var ee=`
49
+ `+U[y].replace(" at new "," at ");return t.displayName&&ee.includes("<anonymous>")&&(ee=ee.replace("<anonymous>",t.displayName)),typeof t=="function"&&ly.set(t,ee),ee}while(1<=y&&0<=A);break}}}finally{rg=!1,ge.H=f,de(),Error.prepareStackTrace=l}return U=(U=t?t.displayName||t.name:"")?Ce(U):"",typeof t=="function"&&ly.set(t,U),U}function Ve(t,n){switch(t.tag){case 26:case 27:case 5:return Ce(t.type);case 16:return Ce("Lazy");case 13:return t.child!==n&&n!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return Fe(t.type,!1);case 11:return Fe(t.type.render,!1);case 1:return Fe(t.type,!0);case 31:return Ce("Activity");default:return""}}function at(t){try{var n="",l=null;do{n+=Ve(t,l);var f=t._debugInfo;if(f)for(var p=f.length-1;0<=p;p--){var y=f[p];if(typeof y.name=="string"){var A=n;e:{var L=y.name,N=y.env,U=y.debugLocation;if(U!=null){var J=Le(U),ee=J.lastIndexOf(`
50
+ `),j=ee===-1?J:J.slice(ee+1);if(j.indexOf(L)!==-1){var fe=`
51
+ `+j;break e}}fe=Ce(L+(N?" ["+N+"]":""))}n=A+fe}}l=t,t=t.return}while(t);return n}catch(Me){return`
52
+ Error generating stack: `+Me.message+`
53
+ `+Me.stack}}function At(t){return(t=t?t.displayName||t.name:"")?Ce(t):""}function kt(){if(ma===null)return null;var t=ma._debugOwner;return t!=null?te(t):null}function vi(){if(ma===null)return"";var t=ma;try{var n="";switch(t.tag===6&&(t=t.return),t.tag){case 26:case 27:case 5:n+=Ce(t.type);break;case 13:n+=Ce("Suspense");break;case 19:n+=Ce("SuspenseList");break;case 31:n+=Ce("Activity");break;case 30:case 0:case 15:case 1:t._debugOwner||n!==""||(n+=At(t.type));break;case 11:t._debugOwner||n!==""||(n+=At(t.type.render))}for(;t;)if(typeof t.tag=="number"){var l=t;t=l._debugOwner;var f=l._debugStack;if(t&&f){var p=Le(f);p!==""&&(n+=`
54
+ `+p)}}else if(t.debugStack!=null){var y=t.debugStack;(t=t.owner)&&y&&(n+=`
55
+ `+Le(y))}else break;var A=n}catch(L){A=`
56
+ Error generating stack: `+L.message+`
57
+ `+L.stack}return A}function we(t,n,l,f,p,y,A){var L=ma;ya(t);try{return t!==null&&t._debugTask?t._debugTask.run(n.bind(null,l,f,p,y,A)):n(l,f,p,y,A)}finally{ya(L)}throw Error("runWithFiberInDEV should never be called in production. This is a bug in React.")}function ya(t){ge.getCurrentStack=t===null?null:vi,Dl=!1,ma=t}function Gi(t){return typeof Symbol=="function"&&Symbol.toStringTag&&t[Symbol.toStringTag]||t.constructor.name||"Object"}function ei(t){try{return ja(t),!1}catch{return!0}}function ja(t){return""+t}function Pe(t,n){if(ei(t))return console.error("The provided `%s` attribute is an unsupported type %s. This value must be coerced to a string before using it here.",n,Gi(t)),ja(t)}function cn(t,n){if(ei(t))return console.error("The provided `%s` CSS property is an unsupported type %s. This value must be coerced to a string before using it here.",n,Gi(t)),ja(t)}function zn(t){if(ei(t))return console.error("Form field values (value, checked, defaultValue, or defaultChecked props) must be strings, not %s. This value must be coerced to a string before using it here.",Gi(t)),ja(t)}function la(t){if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u")return!1;var n=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(n.isDisabled)return!0;if(!n.supportsFiber)return console.error("The installed version of React DevTools is too old and will not work with the current version of React. Please update React DevTools. https://react.dev/link/react-devtools"),!0;try{mu=n.inject(t),Qn=n}catch(l){console.error("React instrumentation encountered an error: %o.",l)}return!!n.checkDCE}function ut(t){if(typeof uy=="function"&&uE(t),Qn&&typeof Qn.setStrictMode=="function")try{Qn.setStrictMode(mu,t)}catch(n){Ll||(Ll=!0,console.error("React instrumentation encountered an error: %o",n))}}function Va(t){return t>>>=0,t===0?32:31-(cy(t)/hg|0)|0}function Fn(t){var n=t&42;if(n!==0)return n;switch(t&-t){case 1:return 1;case 2:return 2;case 4:return 4;case 8:return 8;case 16:return 16;case 32:return 32;case 64:return 64;case 128:return 128;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:return t&261888;case 262144:case 524288:case 1048576:case 2097152:return t&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return t&62914560;case 67108864:return 67108864;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return console.error("Should have found matching lanes. This is a bug in React."),t}}function jl(t,n,l){var f=t.pendingLanes;if(f===0)return 0;var p=0,y=t.suspendedLanes,A=t.pingedLanes;t=t.warmLanes;var L=f&134217727;return L!==0?(f=L&~y,f!==0?p=Fn(f):(A&=L,A!==0?p=Fn(A):l||(l=L&~t,l!==0&&(p=Fn(l))))):(L=f&~y,L!==0?p=Fn(L):A!==0?p=Fn(A):l||(l=f&~t,l!==0&&(p=Fn(l)))),p===0?0:n!==0&&n!==p&&!(n&y)&&(y=p&-p,l=n&-n,y>=l||y===32&&(l&4194048)!==0)?n:p}function fn(t,n){return(t.pendingLanes&~(t.suspendedLanes&~t.pingedLanes)&n)===0}function To(t,n){switch(t){case 1:case 2:case 4:case 8:case 64:return n+250;case 16:case 32:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return n+5e3;case 4194304:case 8388608:case 16777216:case 33554432:return-1;case 67108864:case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return console.error("Should have found matching lanes. This is a bug in React."),-1}}function Ya(){var t=Yc;return Yc<<=1,!(Yc&62914560)&&(Yc=4194304),t}function Vl(t){for(var n=[],l=0;31>l;l++)n.push(t);return n}function Pn(t,n){t.pendingLanes|=n,n!==268435456&&(t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0)}function qa(t,n,l,f,p,y){var A=t.pendingLanes;t.pendingLanes=l,t.suspendedLanes=0,t.pingedLanes=0,t.warmLanes=0,t.expiredLanes&=l,t.entangledLanes&=l,t.errorRecoveryDisabledLanes&=l,t.shellSuspendCounter=0;var L=t.entanglements,N=t.expirationTimes,U=t.hiddenUpdates;for(l=A&~l;0<l;){var J=31-bi(l),ee=1<<J;L[J]=0,N[J]=-1;var j=U[J];if(j!==null)for(U[J]=null,J=0;J<j.length;J++){var fe=j[J];fe!==null&&(fe.lane&=-536870913)}l&=~ee}f!==0&&bo(t,f,0),y!==0&&p===0&&t.tag!==0&&(t.suspendedLanes|=y&~(A&~n))}function bo(t,n,l){t.pendingLanes|=n,t.suspendedLanes&=~n;var f=31-bi(n);t.entangledLanes|=n,t.entanglements[f]=t.entanglements[f]|1073741824|l&261930}function _i(t,n){var l=t.entangledLanes|=n;for(t=t.entanglements;l;){var f=31-bi(l),p=1<<f;p&n|t[f]&n&&(t[f]|=n),l&=~p}}function Lf(t,n){var l=n&-n;return l=l&42?1:Zs(l),l&(t.suspendedLanes|n)?0:l}function Zs(t){switch(t){case 2:t=1;break;case 8:t=4;break;case 32:t=16;break;case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:case 4194304:case 8388608:case 16777216:case 33554432:t=128;break;case 268435456:t=134217728;break;default:t=0}return t}function Si(t,n,l){if(_l)for(t=t.pendingUpdatersLaneMap;0<l;){var f=31-bi(l),p=1<<f;t[f].add(n),l&=~p}}function Ka(t,n){if(_l)for(var l=t.pendingUpdatersLaneMap,f=t.memoizedUpdaters;0<n;){var p=31-bi(n);t=1<<p,p=l[p],0<p.size&&(p.forEach(function(y){var A=y.alternate;A!==null&&f.has(A)||f.add(y)}),p.clear()),n&=~t}}function ye(t){return t&=-t,Zn<t?xi<t?t&134217727?wi:co:xi:Zn}function rt(){var t=Ut.p;return t!==0?t:(t=window.event,t===void 0?wi:tg(t.type))}function Ht(t,n){var l=Ut.p;try{return Ut.p=t,n()}finally{Ut.p=l}}function Yn(t){delete t[gn],delete t[aa],delete t[gu],delete t[Yb],delete t[cE]}function $i(t){var n=t[gn];if(n)return n;for(var l=t.parentNode;l;){if(n=l[mr]||l[gn]){if(l=n.alternate,n.child!==null||l!==null&&l.child!==null)for(t=ru(t);t!==null;){if(l=t[gn])return l;t=ru(t)}return n}t=l,l=t.parentNode}return null}function vs(t){if(t=t[gn]||t[mr]){var n=t.tag;if(n===5||n===6||n===13||n===31||n===26||n===27||n===3)return t}return null}function Cr(t){var n=t.tag;if(n===5||n===26||n===27||n===6)return t.stateNode;throw Error("getNodeFromInstance: Invalid argument.")}function Xa(t){var n=t[Hd];return n||(n=t[Hd]={hoistableStyles:new Map,hoistableScripts:new Map}),n}function On(t){t[qc]=!0}function Ss(t,n){Gu(t,n),Gu(t+"Capture",n)}function Gu(t,n){Cl[t]&&console.error("EventRegistry: More than one plugin attempted to publish the same registration name, `%s`.",t),Cl[t]=n;var l=t.toLowerCase();for(Kc[l]=t,t==="onDoubleClick"&&(Kc.ondblclick=t),t=0;t<n.length;t++)fE.add(n[t])}function xo(t,n){dE[n.type]||n.onChange||n.onInput||n.readOnly||n.disabled||n.value==null||console.error(t==="select"?"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set `onChange`.":"You provided a `value` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultValue`. Otherwise, set either `onChange` or `readOnly`."),n.onChange||n.readOnly||n.disabled||n.checked==null||console.error("You provided a `checked` prop to a form field without an `onChange` handler. This will render a read-only field. If the field should be mutable use `defaultChecked`. Otherwise, set either `onChange` or `readOnly`.")}function _f(t){return Ua.call(mg,t)?!0:Ua.call(fy,t)?!1:Xc.test(t)?mg[t]=!0:(fy[t]=!0,console.error("Invalid attribute name: `%s`",t),!1)}function $u(t,n,l){if(_f(n)){if(!t.hasAttribute(n)){switch(typeof l){case"symbol":case"object":return l;case"function":return l;case"boolean":if(l===!1)return l}return l===void 0?void 0:null}return t=t.getAttribute(n),t===""&&l===!0?!0:(Pe(l,n),t===""+l?l:t)}}function Lh(t,n,l){if(_f(n))if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":t.removeAttribute(n);return;case"boolean":var f=n.toLowerCase().slice(0,5);if(f!=="data-"&&f!=="aria-"){t.removeAttribute(n);return}}Pe(l,n),t.setAttribute(n,""+l)}}function Cf(t,n,l){if(l===null)t.removeAttribute(n);else{switch(typeof l){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(n);return}Pe(l,n),t.setAttribute(n,""+l)}}function Js(t,n,l,f){if(f===null)t.removeAttribute(l);else{switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":t.removeAttribute(l);return}Pe(f,l),t.setAttributeNS(n,l,""+f)}}function va(t){switch(typeof t){case"bigint":case"boolean":case"number":case"string":case"undefined":return t;case"object":return zn(t),t;default:return""}}function _h(t){var n=t.type;return(t=t.nodeName)&&t.toLowerCase()==="input"&&(n==="checkbox"||n==="radio")}function u0(t,n,l){var f=Object.getOwnPropertyDescriptor(t.constructor.prototype,n);if(!t.hasOwnProperty(n)&&typeof f<"u"&&typeof f.get=="function"&&typeof f.set=="function"){var p=f.get,y=f.set;return Object.defineProperty(t,n,{configurable:!0,get:function(){return p.call(this)},set:function(A){zn(A),l=""+A,y.call(this,A)}}),Object.defineProperty(t,n,{enumerable:f.enumerable}),{getValue:function(){return l},setValue:function(A){zn(A),l=""+A},stopTracking:function(){t._valueTracker=null,delete t[n]}}}}function Ch(t){if(!t._valueTracker){var n=_h(t)?"checked":"value";t._valueTracker=u0(t,n,""+t[n])}}function c0(t){if(!t)return!1;var n=t._valueTracker;if(!n)return!0;var l=n.getValue(),f="";return t&&(f=_h(t)?t.checked?"true":"false":t.value),t=f,t!==l?(n.setValue(t),!0):!1}function Es(t){if(t=t||(typeof document<"u"?document:void 0),typeof t>"u")return null;try{return t.activeElement||t.body}catch{return t.body}}function jt(t){return t.replace(gg,function(n){return"\\"+n.charCodeAt(0).toString(16)+" "})}function Hi(t,n){n.checked===void 0||n.defaultChecked===void 0||hE||(console.error("%s contains an input of type %s with both checked and defaultChecked props. Input elements must be either controlled or uncontrolled (specify either the checked prop, or the defaultChecked prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",kt()||"A component",n.type),hE=!0),n.value===void 0||n.defaultValue===void 0||dy||(console.error("%s contains an input of type %s with both value and defaultValue props. Input elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled input element and remove one of these props. More info: https://react.dev/link/controlled-components",kt()||"A component",n.type),dy=!0)}function Or(t,n,l,f,p,y,A,L){t.name="",A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"?(Pe(A,"type"),t.type=A):t.removeAttribute("type"),n!=null?A==="number"?(n===0&&t.value===""||t.value!=n)&&(t.value=""+va(n)):t.value!==""+va(n)&&(t.value=""+va(n)):A!=="submit"&&A!=="reset"||t.removeAttribute("value"),n!=null?f0(t,A,va(n)):l!=null?f0(t,A,va(l)):f!=null&&t.removeAttribute("value"),p==null&&y!=null&&(t.defaultChecked=!!y),p!=null&&(t.checked=p&&typeof p!="function"&&typeof p!="symbol"),L!=null&&typeof L!="function"&&typeof L!="symbol"&&typeof L!="boolean"?(Pe(L,"name"),t.name=""+va(L)):t.removeAttribute("name")}function Oh(t,n,l,f,p,y,A,L){if(y!=null&&typeof y!="function"&&typeof y!="symbol"&&typeof y!="boolean"&&(Pe(y,"type"),t.type=y),n!=null||l!=null){if(!(y!=="submit"&&y!=="reset"||n!=null)){Ch(t);return}l=l!=null?""+va(l):"",n=n!=null?""+va(n):l,L||n===t.value||(t.value=n),t.defaultValue=n}f=f??p,f=typeof f!="function"&&typeof f!="symbol"&&!!f,t.checked=L?t.checked:!!f,t.defaultChecked=!!f,A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(Pe(A,"name"),t.name=A),Ch(t)}function f0(t,n,l){n==="number"&&Es(t.ownerDocument)===t||t.defaultValue===""+l||(t.defaultValue=""+l)}function jv(t,n){n.value==null&&(typeof n.children=="object"&&n.children!==null?Bd.Children.forEach(n.children,function(l){l==null||typeof l=="string"||typeof l=="number"||typeof l=="bigint"||a||(a=!0,console.error("Cannot infer the option value of complex children. Pass a `value` prop or use a plain string as children to <option>."))}):n.dangerouslySetInnerHTML==null||r||(r=!0,console.error("Pass a `value` prop if you set dangerouslyInnerHTML so React knows which value should be selected."))),n.selected==null||jd||(console.error("Use the `defaultValue` or `value` props on <select> instead of setting `selected` on <option>."),jd=!0)}function d0(){var t=kt();return t?`
58
+
59
+ Check the render method of \``+t+"`.":""}function Ws(t,n,l,f){if(t=t.options,n){n={};for(var p=0;p<l.length;p++)n["$"+l[p]]=!0;for(l=0;l<t.length;l++)p=n.hasOwnProperty("$"+t[l].value),t[l].selected!==p&&(t[l].selected=p),p&&f&&(t[l].defaultSelected=!0)}else{for(l=""+va(l),n=null,p=0;p<t.length;p++){if(t[p].value===l){t[p].selected=!0,f&&(t[p].defaultSelected=!0);return}n!==null||t[p].disabled||(n=t[p])}n!==null&&(n.selected=!0)}}function Mh(t,n){for(t=0;t<m.length;t++){var l=m[t];if(n[l]!=null){var f=Hn(n[l]);n.multiple&&!f?console.error("The `%s` prop supplied to <select> must be an array if `multiple` is true.%s",l,d0()):!n.multiple&&f&&console.error("The `%s` prop supplied to <select> must be a scalar value if `multiple` is false.%s",l,d0())}}n.value===void 0||n.defaultValue===void 0||c||(console.error("Select elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled select element and remove one of these props. More info: https://react.dev/link/controlled-components"),c=!0)}function Ao(t,n){n.value===void 0||n.defaultValue===void 0||T||(console.error("%s contains a textarea with both value and defaultValue props. Textarea elements must be either controlled or uncontrolled (specify either the value prop, or the defaultValue prop, but not both). Decide between using a controlled or uncontrolled textarea and remove one of these props. More info: https://react.dev/link/controlled-components",kt()||"A component"),T=!0),n.children!=null&&n.value==null&&console.error("Use the `defaultValue` or `value` props instead of setting children on <textarea>.")}function Ro(t,n,l){if(n!=null&&(n=""+va(n),n!==t.value&&(t.value=n),l==null)){t.defaultValue!==n&&(t.defaultValue=n);return}t.defaultValue=l!=null?""+va(l):""}function Hu(t,n,l,f){if(n==null){if(f!=null){if(l!=null)throw Error("If you supply `defaultValue` on a <textarea>, do not pass children.");if(Hn(f)){if(1<f.length)throw Error("<textarea> can only have at most one child.");f=f[0]}l=f}l==null&&(l=""),n=l}l=va(n),t.defaultValue=l,f=t.textContent,f===l&&f!==""&&f!==null&&(t.value=f),Ch(t)}function Do(t,n){return t.serverProps===void 0&&t.serverTail.length===0&&t.children.length===1&&3<t.distanceFromLeaf&&t.distanceFromLeaf>15-n?Do(t.children[0],n):t}function Bt(t){return" "+" ".repeat(t)}function Lo(t){return"+ "+" ".repeat(t)}function Mr(t){return"- "+" ".repeat(t)}function Ir(t){switch(t.tag){case 26:case 27:case 5:return t.type;case 16:return"Lazy";case 31:return"Activity";case 13:return"Suspense";case 19:return"SuspenseList";case 0:case 15:return t=t.type,t.displayName||t.name||null;case 11:return t=t.type.render,t.displayName||t.name||null;case 1:return t=t.type,t.displayName||t.name||null;default:return null}}function el(t,n){return x.test(t)?(t=JSON.stringify(t),t.length>n-2?8>n?'{"..."}':"{"+t.slice(0,n-7)+'..."}':"{"+t+"}"):t.length>n?5>n?'{"..."}':t.slice(0,n-3)+"...":t}function Ih(t,n,l){var f=120-2*l;if(n===null)return Lo(l)+el(t,f)+`
60
+ `;if(typeof n=="string"){for(var p=0;p<n.length&&p<t.length&&n.charCodeAt(p)===t.charCodeAt(p);p++);return p>f-8&&10<p&&(t="..."+t.slice(p-8),n="..."+n.slice(p-8)),Lo(l)+el(t,f)+`
61
+ `+Mr(l)+el(n,f)+`
62
+ `}return Bt(l)+el(t,f)+`
63
+ `}function wh(t){return Object.prototype.toString.call(t).replace(/^\[object (.*)\]$/,function(n,l){return l})}function ju(t,n){switch(typeof t){case"string":return t=JSON.stringify(t),t.length>n?5>n?'"..."':t.slice(0,n-4)+'..."':t;case"object":if(t===null)return"null";if(Hn(t))return"[...]";if(t.$$typeof===rs)return(n=Z(t.type))?"<"+n+">":"<...>";var l=wh(t);if(l==="Object"){l="",n-=2;for(var f in t)if(t.hasOwnProperty(f)){var p=JSON.stringify(f);if(p!=='"'+f+'"'&&(f=p),n-=f.length-2,p=ju(t[f],15>n?n:15),n-=p.length,0>n){l+=l===""?"...":", ...";break}l+=(l===""?"":",")+f+":"+p}return"{"+l+"}"}return l;case"function":return(n=t.displayName||t.name)?"function "+n:"function";default:return String(t)}}function Vu(t,n){return typeof t!="string"||x.test(t)?"{"+ju(t,n-2)+"}":t.length>n-2?5>n?'"..."':'"'+t.slice(0,n-5)+'..."':'"'+t+'"'}function Yu(t,n,l){var f=120-l.length-t.length,p=[],y;for(y in n)if(n.hasOwnProperty(y)&&y!=="children"){var A=Vu(n[y],120-l.length-y.length-1);f-=y.length+A.length+2,p.push(y+"="+A)}return p.length===0?l+"<"+t+`>
64
+ `:0<f?l+"<"+t+" "+p.join(" ")+`>
65
+ `:l+"<"+t+`
66
+ `+l+" "+p.join(`
67
+ `+l+" ")+`
68
+ `+l+`>
69
+ `}function Nh(t,n,l){var f="",p=ht({},n),y;for(y in t)if(t.hasOwnProperty(y)){delete p[y];var A=120-2*l-y.length-2,L=ju(t[y],A);n.hasOwnProperty(y)?(A=ju(n[y],A),f+=Lo(l)+y+": "+L+`
70
+ `,f+=Mr(l)+y+": "+A+`
71
+ `):f+=Lo(l)+y+": "+L+`
72
+ `}for(var N in p)p.hasOwnProperty(N)&&(t=ju(p[N],120-2*l-N.length-2),f+=Mr(l)+N+": "+t+`
73
+ `);return f}function Yl(t,n,l,f){var p="",y=new Map;for(U in l)l.hasOwnProperty(U)&&y.set(U.toLowerCase(),U);if(y.size===1&&y.has("children"))p+=Yu(t,n,Bt(f));else{for(var A in n)if(n.hasOwnProperty(A)&&A!=="children"){var L=120-2*(f+1)-A.length-1,N=y.get(A.toLowerCase());if(N!==void 0){y.delete(A.toLowerCase());var U=n[A];N=l[N];var J=Vu(U,L);L=Vu(N,L),typeof U=="object"&&U!==null&&typeof N=="object"&&N!==null&&wh(U)==="Object"&&wh(N)==="Object"&&(2<Object.keys(U).length||2<Object.keys(N).length||-1<J.indexOf("...")||-1<L.indexOf("..."))?p+=Bt(f+1)+A+`={{
74
+ `+Nh(U,N,f+2)+Bt(f+1)+`}}
75
+ `:(p+=Lo(f+1)+A+"="+J+`
76
+ `,p+=Mr(f+1)+A+"="+L+`
77
+ `)}else p+=Bt(f+1)+A+"="+Vu(n[A],L)+`
78
+ `}y.forEach(function(ee){if(ee!=="children"){var j=120-2*(f+1)-ee.length-1;p+=Mr(f+1)+ee+"="+Vu(l[ee],j)+`
79
+ `}}),p=p===""?Bt(f)+"<"+t+`>
80
+ `:Bt(f)+"<"+t+`
81
+ `+p+Bt(f)+`>
82
+ `}return t=l.children,n=n.children,typeof t=="string"||typeof t=="number"||typeof t=="bigint"?(y="",(typeof n=="string"||typeof n=="number"||typeof n=="bigint")&&(y=""+n),p+=Ih(y,""+t,f+1)):(typeof n=="string"||typeof n=="number"||typeof n=="bigint")&&(p=t==null?p+Ih(""+n,null,f+1):p+Ih(""+n,void 0,f+1)),p}function Sa(t,n){var l=Ir(t);if(l===null){for(l="",t=t.child;t;)l+=Sa(t,n),t=t.sibling;return l}return Bt(n)+"<"+l+`>
83
+ `}function Uh(t,n){var l=Do(t,n);if(l!==t&&(t.children.length!==1||t.children[0]!==l))return Bt(n)+`...
84
+ `+Uh(l,n+1);l="";var f=t.fiber._debugInfo;if(f)for(var p=0;p<f.length;p++){var y=f[p].name;typeof y=="string"&&(l+=Bt(n)+"<"+y+`>
85
+ `,n++)}if(f="",p=t.fiber.pendingProps,t.fiber.tag===6)f=Ih(p,t.serverProps,n),n++;else if(y=Ir(t.fiber),y!==null)if(t.serverProps===void 0){f=n;var A=120-2*f-y.length-2,L="";for(U in p)if(p.hasOwnProperty(U)&&U!=="children"){var N=Vu(p[U],15);if(A-=U.length+N.length+2,0>A){L+=" ...";break}L+=" "+U+"="+N}f=Bt(f)+"<"+y+L+`>
86
+ `,n++}else t.serverProps===null?(f=Yu(y,p,Lo(n)),n++):typeof t.serverProps=="string"?console.error("Should not have matched a non HostText fiber to a Text node. This is a bug in React."):(f=Yl(y,p,t.serverProps,n),n++);var U="";for(p=t.fiber.child,y=0;p&&y<t.children.length;)A=t.children[y],A.fiber===p?(U+=Uh(A,n),y++):U+=Sa(p,n),p=p.sibling;for(p&&0<t.children.length&&(U+=Bt(n)+`...
87
+ `),p=t.serverTail,t.serverProps===null&&n--,t=0;t<p.length;t++)y=p[t],U=typeof y=="string"?U+(Mr(n)+el(y,120-2*n)+`
88
+ `):U+Yu(y.type,y.props,Mr(n));return l+f+U}function h0(t){try{return`
89
+
90
+ `+Uh(t,0)}catch{return""}}function kh(t,n,l){for(var f=n,p=null,y=0;f;)f===t&&(y=0),p={fiber:f,children:p!==null?[p]:[],serverProps:f===n?l:f===t?null:void 0,serverTail:[],distanceFromLeaf:y},y++,f=f.return;return p!==null?h0(p).replaceAll(/^[+-]/gm,">"):""}function m0(t,n){var l=ht({},t||ve),f={tag:n};return k.indexOf(n)!==-1&&(l.aTagInScope=null,l.buttonTagInScope=null,l.nobrTagInScope=null),Y.indexOf(n)!==-1&&(l.pTagInButtonScope=null),C.indexOf(n)!==-1&&n!=="address"&&n!=="div"&&n!=="p"&&(l.listItemTagAutoclosing=null,l.dlItemTagAutoclosing=null),l.current=f,n==="form"&&(l.formTag=f),n==="a"&&(l.aTagInScope=f),n==="button"&&(l.buttonTagInScope=f),n==="nobr"&&(l.nobrTagInScope=f),n==="p"&&(l.pTagInButtonScope=f),n==="li"&&(l.listItemTagAutoclosing=f),(n==="dd"||n==="dt")&&(l.dlItemTagAutoclosing=f),n==="#document"||n==="html"?l.containerTagInScope=null:l.containerTagInScope||(l.containerTagInScope=f),t!==null||n!=="#document"&&n!=="html"&&n!=="body"?l.implicitRootScope===!0&&(l.implicitRootScope=!1):l.implicitRootScope=!0,l}function Of(t,n,l){switch(n){case"select":return t==="hr"||t==="option"||t==="optgroup"||t==="script"||t==="template"||t==="#text";case"optgroup":return t==="option"||t==="#text";case"option":return t==="#text";case"tr":return t==="th"||t==="td"||t==="style"||t==="script"||t==="template";case"tbody":case"thead":case"tfoot":return t==="tr"||t==="style"||t==="script"||t==="template";case"colgroup":return t==="col"||t==="template";case"table":return t==="caption"||t==="colgroup"||t==="tbody"||t==="tfoot"||t==="thead"||t==="style"||t==="script"||t==="template";case"head":return t==="base"||t==="basefont"||t==="bgsound"||t==="link"||t==="meta"||t==="title"||t==="noscript"||t==="noframes"||t==="style"||t==="script"||t==="template";case"html":if(l)break;return t==="head"||t==="body"||t==="frameset";case"frameset":return t==="frame";case"#document":if(!l)return t==="html"}switch(t){case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return n!=="h1"&&n!=="h2"&&n!=="h3"&&n!=="h4"&&n!=="h5"&&n!=="h6";case"rp":case"rt":return ue.indexOf(n)===-1;case"caption":case"col":case"colgroup":case"frameset":case"frame":case"tbody":case"td":case"tfoot":case"th":case"thead":case"tr":return n==null;case"head":return l||n===null;case"html":return l&&n==="#document"||n===null;case"body":return l&&(n==="#document"||n==="html")||n===null}return!0}function Ib(t,n){switch(t){case"address":case"article":case"aside":case"blockquote":case"center":case"details":case"dialog":case"dir":case"div":case"dl":case"fieldset":case"figcaption":case"figure":case"footer":case"header":case"hgroup":case"main":case"menu":case"nav":case"ol":case"p":case"section":case"summary":case"ul":case"pre":case"listing":case"table":case"hr":case"xmp":case"h1":case"h2":case"h3":case"h4":case"h5":case"h6":return n.pTagInButtonScope;case"form":return n.formTag||n.pTagInButtonScope;case"li":return n.listItemTagAutoclosing;case"dd":case"dt":return n.dlItemTagAutoclosing;case"button":return n.buttonTagInScope;case"a":return n.aTagInScope;case"nobr":return n.nobrTagInScope}return null}function Ea(t,n){for(;t;){switch(t.tag){case 5:case 26:case 27:if(t.type===n)return t}t=t.return}return null}function Mf(t,n){n=n||ve;var l=n.current;if(n=(l=Of(t,l&&l.tag,n.implicitRootScope)?null:l)?null:Ib(t,n),n=l||n,!n)return!0;var f=n.tag;if(n=String(!!l)+"|"+t+"|"+f,Ae[n])return!1;Ae[n]=!0;var p=(n=ma)?Ea(n.return,f):null,y=n!==null&&p!==null?kh(p,n,null):"",A="<"+t+">";return l?(l="",f==="table"&&t==="tr"&&(l+=" Add a <tbody>, <thead> or <tfoot> to your code to match the DOM tree generated by the browser."),console.error(`In HTML, %s cannot be a child of <%s>.%s
91
+ This will cause a hydration error.%s`,A,f,l,y)):console.error(`In HTML, %s cannot be a descendant of <%s>.
92
+ This will cause a hydration error.%s`,A,f,y),n&&(t=n.return,p===null||t===null||p===t&&t._debugOwner===n._debugOwner||we(p,function(){console.error(`<%s> cannot contain a nested %s.
93
+ See this log for the ancestor stack trace.`,f,A)})),!1}function If(t,n,l){if(l||Of("#text",n,!1))return!0;if(l="#text|"+n,Ae[l])return!1;Ae[l]=!0;var f=(l=ma)?Ea(l,n):null;return l=l!==null&&f!==null?kh(f,l,l.tag!==6?{children:null}:null):"",/\S/.test(t)?console.error(`In HTML, text nodes cannot be a child of <%s>.
94
+ This will cause a hydration error.%s`,n,l):console.error(`In HTML, whitespace text nodes cannot be a child of <%s>. Make sure you don't have any extra whitespace between tags on each line of your source code.
95
+ This will cause a hydration error.%s`,n,l),!1}function _o(t,n){if(n){var l=t.firstChild;if(l&&l===t.lastChild&&l.nodeType===3){l.nodeValue=n;return}}t.textContent=n}function qu(t){return t.replace(ie,function(n,l){return l.toUpperCase()})}function g0(t,n,l){var f=n.indexOf("--")===0;f||(-1<n.indexOf("-")?oe.hasOwnProperty(n)&&oe[n]||(oe[n]=!0,console.error("Unsupported style property %s. Did you mean %s?",n,qu(n.replace(Kt,"ms-")))):Xe.test(n)?oe.hasOwnProperty(n)&&oe[n]||(oe[n]=!0,console.error("Unsupported vendor-prefixed style property %s. Did you mean %s?",n,n.charAt(0).toUpperCase()+n.slice(1))):!W.test(l)||Te.hasOwnProperty(l)&&Te[l]||(Te[l]=!0,console.error(`Style property values shouldn't contain a semicolon. Try "%s: %s" instead.`,n,l.replace(W,""))),typeof l=="number"&&(isNaN(l)?Ye||(Ye=!0,console.error("`NaN` is an invalid value for the `%s` css style property.",n)):isFinite(l)||Ct||(Ct=!0,console.error("`Infinity` is an invalid value for the `%s` css style property.",n)))),l==null||typeof l=="boolean"||l===""?f?t.setProperty(n,""):n==="float"?t.cssFloat="":t[n]="":f?t.setProperty(n,l):typeof l!="number"||l===0||Ge.has(n)?n==="float"?t.cssFloat=l:(cn(l,n),t[n]=(""+l).trim()):t[n]=l+"px"}function p0(t,n,l){if(n!=null&&typeof n!="object")throw Error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");if(n&&Object.freeze(n),t=t.style,l!=null){if(n){var f={};if(l){for(var p in l)if(l.hasOwnProperty(p)&&!n.hasOwnProperty(p))for(var y=ce[p]||[p],A=0;A<y.length;A++)f[y[A]]=p}for(var L in n)if(n.hasOwnProperty(L)&&(!l||l[L]!==n[L]))for(p=ce[L]||[L],y=0;y<p.length;y++)f[p[y]]=L;L={};for(var N in n)for(p=ce[N]||[N],y=0;y<p.length;y++)L[p[y]]=N;N={};for(var U in f)if(p=f[U],(y=L[U])&&p!==y&&(A=p+","+y,!N[A])){N[A]=!0,A=console;var J=n[p];A.error.call(A,"%s a style property during rerender (%s) when a conflicting property is set (%s) can lead to styling bugs. To avoid this, don't mix shorthand and non-shorthand properties for the same value; instead, replace the shorthand with separate values.",J==null||typeof J=="boolean"||J===""?"Removing":"Updating",p,y)}}for(var ee in l)!l.hasOwnProperty(ee)||n!=null&&n.hasOwnProperty(ee)||(ee.indexOf("--")===0?t.setProperty(ee,""):ee==="float"?t.cssFloat="":t[ee]="");for(var j in n)U=n[j],n.hasOwnProperty(j)&&l[j]!==U&&g0(t,j,U)}else for(f in n)n.hasOwnProperty(f)&&g0(t,f,n[f])}function tl(t){if(t.indexOf("-")===-1)return!1;switch(t){case"annotation-xml":case"color-profile":case"font-face":case"font-face-src":case"font-face-uri":case"font-face-format":case"font-face-name":case"missing-glyph":return!1;default:return!0}}function Vv(t){return It.get(t)||t}function Yv(t,n){if(Ua.call(pg,n)&&pg[n])return!0;if(eN.test(n)){if(t="aria-"+n.slice(4).toLowerCase(),t=mE.hasOwnProperty(t)?t:null,t==null)return console.error("Invalid ARIA attribute `%s`. ARIA attributes follow the pattern aria-* and must be lowercase.",n),pg[n]=!0;if(n!==t)return console.error("Invalid ARIA attribute `%s`. Did you mean `%s`?",n,t),pg[n]=!0}if(Ww.test(n)){if(t=n.toLowerCase(),t=mE.hasOwnProperty(t)?t:null,t==null)return pg[n]=!0,!1;n!==t&&(console.error("Unknown ARIA attribute `%s`. Did you mean `%s`?",n,t),pg[n]=!0)}return!0}function qv(t,n){var l=[],f;for(f in n)Yv(t,f)||l.push(f);n=l.map(function(p){return"`"+p+"`"}).join(", "),l.length===1?console.error("Invalid aria prop %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",n,t):1<l.length&&console.error("Invalid aria props %s on <%s> tag. For details, see https://react.dev/link/invalid-aria-props",n,t)}function y0(t,n,l,f){if(Ua.call(ka,n)&&ka[n])return!0;var p=n.toLowerCase();if(p==="onfocusin"||p==="onfocusout")return console.error("React uses onFocus and onBlur instead of onFocusIn and onFocusOut. All React events are normalized to bubble, so onFocusIn and onFocusOut are not needed/supported by React."),ka[n]=!0;if(typeof l=="function"&&(t==="form"&&n==="action"||t==="input"&&n==="formAction"||t==="button"&&n==="formAction"))return!0;if(f!=null){if(t=f.possibleRegistrationNames,f.registrationNameDependencies.hasOwnProperty(n))return!0;if(f=t.hasOwnProperty(p)?t[p]:null,f!=null)return console.error("Invalid event handler property `%s`. Did you mean `%s`?",n,f),ka[n]=!0;if(TD.test(n))return console.error("Unknown event handler property `%s`. It will be ignored.",n),ka[n]=!0}else if(TD.test(n))return tN.test(n)&&console.error("Invalid event handler property `%s`. React events use the camelCase naming convention, for example `onClick`.",n),ka[n]=!0;if(nN.test(n)||iN.test(n))return!0;if(p==="innerhtml")return console.error("Directly setting property `innerHTML` is not permitted. For more information, lookup documentation on `dangerouslySetInnerHTML`."),ka[n]=!0;if(p==="aria")return console.error("The `aria` attribute is reserved for future use in React. Pass individual `aria-` attributes instead."),ka[n]=!0;if(p==="is"&&l!==null&&l!==void 0&&typeof l!="string")return console.error("Received a `%s` for a string attribute `is`. If this is expected, cast the value to a string.",typeof l),ka[n]=!0;if(typeof l=="number"&&isNaN(l))return console.error("Received NaN for the `%s` attribute. If this is expected, cast the value to a string.",n),ka[n]=!0;if(Hs.hasOwnProperty(p)){if(p=Hs[p],p!==n)return console.error("Invalid DOM property `%s`. Did you mean `%s`?",n,p),ka[n]=!0}else if(n!==p)return console.error("React does not recognize the `%s` prop on a DOM element. If you intentionally want it to appear in the DOM as a custom attribute, spell it as lowercase `%s` instead. If you accidentally passed it from a parent component, remove it from the DOM element.",n,p),ka[n]=!0;switch(n){case"dangerouslySetInnerHTML":case"children":case"style":case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":return!0;case"innerText":case"textContent":return!0}switch(typeof l){case"boolean":switch(n){case"autoFocus":case"checked":case"multiple":case"muted":case"selected":case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"capture":case"download":case"inert":return!0;default:return p=n.toLowerCase().slice(0,5),p==="data-"||p==="aria-"?!0:(l?console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.',l,n,n,l,n):console.error('Received `%s` for a non-boolean attribute `%s`.\n\nIf you want to write it to the DOM, pass a string instead: %s="%s" or %s={value.toString()}.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.',l,n,n,l,n,n,n),ka[n]=!0)}case"function":case"symbol":return ka[n]=!0,!1;case"string":if(l==="false"||l==="true"){switch(n){case"checked":case"selected":case"multiple":case"muted":case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":case"inert":break;default:return!0}console.error("Received the string `%s` for the boolean attribute `%s`. %s Did you mean %s={%s}?",l,n,l==="false"?"The browser will interpret it as a truthy value.":'Although this works, it will not work as expected if you pass the string "false".',n,l),ka[n]=!0}}return!0}function wb(t,n,l){var f=[],p;for(p in n)y0(t,p,n[p],l)||f.push(p);n=f.map(function(y){return"`"+y+"`"}).join(", "),f.length===1?console.error("Invalid value for prop %s on <%s> tag. Either remove it from the element, or pass a string or number value to keep it in the DOM. For details, see https://react.dev/link/attribute-behavior ",n,t):1<f.length&&console.error("Invalid values for props %s on <%s> tag. Either remove them from the element, or pass a string or number value to keep them in the DOM. For details, see https://react.dev/link/attribute-behavior ",n,t)}function wf(t){return aN.test(""+t)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":t}function Qa(){}function Ts(t){return t=t.target||t.srcElement||window,t.correspondingUseElement&&(t=t.correspondingUseElement),t.nodeType===3?t.parentNode:t}function Bh(t){var n=vs(t);if(n&&(t=n.stateNode)){var l=t[aa]||null;e:switch(t=n.stateNode,n.type){case"input":if(Or(t,l.value,l.defaultValue,l.defaultValue,l.checked,l.defaultChecked,l.type,l.name),n=l.name,l.type==="radio"&&n!=null){for(l=t;l.parentNode;)l=l.parentNode;for(Pe(n,"name"),l=l.querySelectorAll('input[name="'+jt(""+n)+'"][type="radio"]'),n=0;n<l.length;n++){var f=l[n];if(f!==t&&f.form===t.form){var p=f[aa]||null;if(!p)throw Error("ReactDOMInput: Mixing React and non-React radio inputs with the same `name` is not supported.");Or(f,p.value,p.defaultValue,p.defaultValue,p.checked,p.defaultChecked,p.type,p.name)}}for(n=0;n<l.length;n++)f=l[n],f.form===t.form&&c0(f)}break e;case"textarea":Ro(t,l.value,l.defaultValue);break e;case"select":n=l.value,n!=null&&Ws(t,!!l.multiple,n,!1)}}}function zh(t,n,l){if(qb)return t(n,l);qb=!0;try{var f=t(n);return f}finally{if(qb=!1,(yg!==null||vg!==null)&&(Ia(),yg&&(n=yg,t=vg,vg=yg=null,Bh(n),t)))for(n=0;n<t.length;n++)Bh(t[n])}}function nl(t,n){var l=t.stateNode;if(l===null)return null;var f=l[aa]||null;if(f===null)return null;l=f[n];e:switch(n){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(f=!f.disabled)||(t=t.type,f=!(t==="button"||t==="input"||t==="select"||t==="textarea")),t=!f;break e;default:t=!1}if(t)return null;if(l&&typeof l!="function")throw Error("Expected `"+n+"` listener to be a function, instead got a value of `"+typeof l+"` type.");return l}function Co(){if(gE)return gE;var t,n=Xb,l=n.length,f,p="value"in Qc?Qc.value:Qc.textContent,y=p.length;for(t=0;t<l&&n[t]===p[t];t++);var A=l-t;for(f=1;f<=A&&n[l-f]===p[y-f];f++);return gE=p.slice(t,1<f?1-f:void 0)}function Nf(t){var n=t.keyCode;return"charCode"in t?(t=t.charCode,t===0&&n===13&&(t=13)):t=n,t===10&&(t=13),32<=t||t===13?t:0}function Ku(){return!0}function v0(){return!1}function ti(t){function n(l,f,p,y,A){this._reactName=l,this._targetInst=p,this.type=f,this.nativeEvent=y,this.target=A,this.currentTarget=null;for(var L in t)t.hasOwnProperty(L)&&(l=t[L],this[L]=l?l(y):y[L]);return this.isDefaultPrevented=(y.defaultPrevented!=null?y.defaultPrevented:y.returnValue===!1)?Ku:v0,this.isPropagationStopped=v0,this}return ht(n.prototype,{preventDefault:function(){this.defaultPrevented=!0;var l=this.nativeEvent;l&&(l.preventDefault?l.preventDefault():typeof l.returnValue!="unknown"&&(l.returnValue=!1),this.isDefaultPrevented=Ku)},stopPropagation:function(){var l=this.nativeEvent;l&&(l.stopPropagation?l.stopPropagation():typeof l.cancelBubble!="unknown"&&(l.cancelBubble=!0),this.isPropagationStopped=Ku)},persist:function(){},isPersistent:Ku}),n}function ql(t){var n=this.nativeEvent;return n.getModifierState?n.getModifierState(t):(t=yN[t])?!!n[t]:!1}function Uf(){return ql}function Xu(t,n){switch(t){case"keyup":return CN.indexOf(n.keyCode)!==-1;case"keydown":return n.keyCode!==RD;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function Kl(t){return t=t.detail,typeof t=="object"&&"data"in t?t.data:null}function S0(t,n){switch(t){case"compositionend":return Kl(n);case"keypress":return n.which!==LD?null:(CD=!0,_D);case"textInput":return t=n.data,t===_D&&CD?null:t;default:return null}}function Fh(t,n){if(Sg)return t==="compositionend"||!Wb&&Xu(t,n)?(t=Co(),gE=Xb=Qc=null,Sg=!1,t):null;switch(t){case"paste":return null;case"keypress":if(!(n.ctrlKey||n.altKey||n.metaKey)||n.ctrlKey&&n.altKey){if(n.char&&1<n.char.length)return n.char;if(n.which)return String.fromCharCode(n.which)}return null;case"compositionend":return DD&&n.locale!=="ko"?null:n.data;default:return null}}function E0(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n==="input"?!!MN[t.type]:n==="textarea"}function Ph(t){if(!fo)return!1;t="on"+t;var n=t in document;return n||(n=document.createElement("div"),n.setAttribute(t,"return;"),n=typeof n[t]=="function"),n}function kf(t,n,l,f){yg?vg?vg.push(f):vg=[f]:yg=f,n=zs(n,"onChange"),0<n.length&&(l=new pE("onChange","change",null,l,f),t.push({event:l,listeners:n}))}function Kv(t){Pt(t,0)}function Ei(t){var n=Cr(t);if(c0(n))return t}function wr(t,n){if(t==="change")return n}function Bf(){vy&&(vy.detachEvent("onpropertychange",Qu),Sy=vy=null)}function Qu(t){if(t.propertyName==="value"&&Ei(Sy)){var n=[];kf(n,Sy,t,Ts(t)),zh(Kv,n)}}function Nb(t,n,l){t==="focusin"?(Bf(),vy=n,Sy=l,vy.attachEvent("onpropertychange",Qu)):t==="focusout"&&Bf()}function T0(t){if(t==="selectionchange"||t==="keyup"||t==="keydown")return Ei(Sy)}function b0(t,n){if(t==="click")return Ei(n)}function zf(t,n){if(t==="input"||t==="change")return Ei(n)}function Gh(t,n){return t===n&&(t!==0||1/t===1/n)||t!==t&&n!==n}function Zu(t,n){if(Ba(t,n))return!0;if(typeof t!="object"||t===null||typeof n!="object"||n===null)return!1;var l=Object.keys(t),f=Object.keys(n);if(l.length!==f.length)return!1;for(f=0;f<l.length;f++){var p=l[f];if(!Ua.call(n,p)||!Ba(t[p],n[p]))return!1}return!0}function Xv(t){for(;t&&t.firstChild;)t=t.firstChild;return t}function Qv(t,n){var l=Xv(t);t=0;for(var f;l;){if(l.nodeType===3){if(f=t+l.textContent.length,t<=n&&f>=n)return{node:l,offset:n-t};t=f}e:{for(;l;){if(l.nextSibling){l=l.nextSibling;break e}l=l.parentNode}l=void 0}l=Xv(l)}}function Zv(t,n){return t&&n?t===n?!0:t&&t.nodeType===3?!1:n&&n.nodeType===3?Zv(t,n.parentNode):"contains"in t?t.contains(n):t.compareDocumentPosition?!!(t.compareDocumentPosition(n)&16):!1:!1}function $h(t){t=t!=null&&t.ownerDocument!=null&&t.ownerDocument.defaultView!=null?t.ownerDocument.defaultView:window;for(var n=Es(t.document);n instanceof t.HTMLIFrameElement;){try{var l=typeof n.contentWindow.location.href=="string"}catch{l=!1}if(l)t=n.contentWindow;else break;n=Es(t.document)}return n}function x0(t){var n=t&&t.nodeName&&t.nodeName.toLowerCase();return n&&(n==="input"&&(t.type==="text"||t.type==="search"||t.type==="tel"||t.type==="url"||t.type==="password")||n==="textarea"||t.contentEditable==="true")}function Jv(t,n,l){var f=l.window===l?l.document:l.nodeType===9?l:l.ownerDocument;t1||Eg==null||Eg!==Es(f)||(f=Eg,"selectionStart"in f&&x0(f)?f={start:f.selectionStart,end:f.selectionEnd}:(f=(f.ownerDocument&&f.ownerDocument.defaultView||window).getSelection(),f={anchorNode:f.anchorNode,anchorOffset:f.anchorOffset,focusNode:f.focusNode,focusOffset:f.focusOffset}),Ey&&Zu(Ey,f)||(Ey=f,f=zs(e1,"onSelect"),0<f.length&&(n=new pE("onSelect","select",null,n,l),t.push({event:n,listeners:f}),n.target=Eg)))}function Oo(t,n){var l={};return l[t.toLowerCase()]=n.toLowerCase(),l["Webkit"+t]="webkit"+n,l["Moz"+t]="moz"+n,l}function Mo(t){if(n1[t])return n1[t];if(!Tg[t])return t;var n=Tg[t],l;for(l in n)if(n.hasOwnProperty(l)&&l in MD)return n1[t]=n[l];return t}function bs(t,n){kD.set(t,n),Ss(n,[t])}function Wv(t){for(var n=vE,l=0;l<t.length;l++){var f=t[l];if(typeof f=="object"&&f!==null)if(Hn(f)&&f.length===2&&typeof f[0]=="string"){if(n!==vE&&n!==r1)return s1;n=r1}else return s1;else{if(typeof f=="function"||typeof f=="string"&&50<f.length||n!==vE&&n!==l1)return s1;n=l1}}return n}function A0(t,n,l,f){for(var p in t)Ua.call(t,p)&&p[0]!=="_"&&il(p,t[p],n,l,f)}function il(t,n,l,f,p){switch(typeof n){case"object":if(n===null){n="null";break}else{if(n.$$typeof===rs){var y=Z(n.type)||"…",A=n.key;n=n.props;var L=Object.keys(n),N=L.length;if(A==null&&N===0){n="<"+y+" />";break}if(3>f||N===1&&L[0]==="children"&&A==null){n="<"+y+" … />";break}l.push([p+"  ".repeat(f)+t,"<"+y]),A!==null&&il("key",A,l,f+1,p),t=!1;for(var U in n)U==="children"?n.children!=null&&(!Hn(n.children)||0<n.children.length)&&(t=!0):Ua.call(n,U)&&U[0]!=="_"&&il(U,n[U],l,f+1,p);l.push(["",t?">…</"+y+">":"/>"]);return}if(y=Object.prototype.toString.call(n),y=y.slice(8,y.length-1),y==="Array"){if(U=Wv(n),U===l1||U===vE){n=JSON.stringify(n);break}else if(U===r1){for(l.push([p+"  ".repeat(f)+t,""]),t=0;t<n.length;t++)y=n[t],il(y[0],y[1],l,f+1,p);return}}if(y==="Promise"){if(n.status==="fulfilled"){if(y=l.length,il(t,n.value,l,f,p),l.length>y){l=l[y],l[1]="Promise<"+(l[1]||"Object")+">";return}}else if(n.status==="rejected"&&(y=l.length,il(t,n.reason,l,f,p),l.length>y)){l=l[y],l[1]="Rejected Promise<"+l[1]+">";return}l.push(["  ".repeat(f)+t,"Promise"]);return}y==="Object"&&(U=Object.getPrototypeOf(n))&&typeof U.constructor=="function"&&(y=U.constructor.name),l.push([p+"  ".repeat(f)+t,y==="Object"?3>f?"":"…":y]),3>f&&A0(n,l,f+1,p);return}case"function":n=n.name===""?"() => {}":n.name+"() {}";break;case"string":n=n===zN?"…":JSON.stringify(n);break;case"undefined":n="undefined";break;case"boolean":n=n?"true":"false";break;default:n=String(n)}l.push([p+"  ".repeat(f)+t,n])}function eS(t,n,l,f){var p=!0;for(A in t)A in n||(l.push([SE+"  ".repeat(f)+A,"…"]),p=!1);for(var y in n)if(y in t){var A=t[y],L=n[y];if(A!==L){if(f===0&&y==="children")p="  ".repeat(f)+y,l.push([SE+p,"…"],[EE+p,"…"]);else{if(!(3<=f)){if(typeof A=="object"&&typeof L=="object"&&A!==null&&L!==null&&A.$$typeof===L.$$typeof)if(L.$$typeof===rs){if(A.type===L.type&&A.key===L.key){A=Z(L.type)||"…",p="  ".repeat(f)+y,A="<"+A+" … />",l.push([SE+p,A],[EE+p,A]),p=!1;continue}}else{var N=Object.prototype.toString.call(A),U=Object.prototype.toString.call(L);if(N===U&&(U==="[object Object]"||U==="[object Array]")){N=[FD+"  ".repeat(f)+y,U==="[object Array]"?"Array":""],l.push(N),U=l.length,eS(A,L,l,f+1)?U===l.length&&(N[1]="Referentially unequal but deeply equal objects. Consider memoization."):p=!1;continue}}else if(typeof A=="function"&&typeof L=="function"&&A.name===L.name&&A.length===L.length&&(N=Function.prototype.toString.call(A),U=Function.prototype.toString.call(L),N===U)){A=L.name===""?"() => {}":L.name+"() {}",l.push([FD+"  ".repeat(f)+y,A+" Referentially unequal function closure. Consider memoization."]);continue}}il(y,A,l,f,SE),il(y,L,l,f,EE)}p=!1}}else l.push([EE+"  ".repeat(f)+y,"…"]),p=!1;return p}function xs(t){_t=t&63?"Blocking":t&64?"Gesture":t&4194176?"Transition":t&62914560?"Suspense":t&2080374784?"Idle":"Other"}function Za(t,n,l,f){pn&&(Jc.start=n,Jc.end=l,pu.color="warning",pu.tooltipText=f,pu.properties=null,(t=t._debugTask)?t.run(performance.measure.bind(performance,f,Jc)):performance.measure(f,Jc))}function Hh(t,n,l){Za(t,n,l,"Reconnect")}function jh(t,n,l,f,p){var y=$(t);if(y!==null&&pn){var A=t.alternate,L=t.actualDuration;if(A===null||A.child!==t.child)for(var N=t.child;N!==null;N=N.sibling)L-=N.actualDuration;f=.5>L?f?"tertiary-light":"primary-light":10>L?f?"tertiary":"primary":100>L?f?"tertiary-dark":"primary-dark":"error";var U=t.memoizedProps;L=t._debugTask,U!==null&&A!==null&&A.memoizedProps!==U?(N=[FN],U=eS(A.memoizedProps,U,N,0),1<N.length&&(U&&!Zc&&!(A.lanes&p)&&100<t.actualDuration?(Zc=!0,N[0]=PN,pu.color="warning",pu.tooltipText=PD):(pu.color=f,pu.tooltipText=y),pu.properties=N,Jc.start=n,Jc.end=l,L!=null?L.run(performance.measure.bind(performance,"​"+y,Jc)):performance.measure("​"+y,Jc))):L!=null?L.run(console.timeStamp.bind(console,y,n,l,Ol,void 0,f)):console.timeStamp(y,n,l,Ol,void 0,f)}}function R0(t,n,l,f){if(pn){var p=$(t);if(p!==null){for(var y=null,A=[],L=0;L<f.length;L++){var N=f[L];y==null&&N.source!==null&&(y=N.source._debugTask),N=N.value,A.push(["Error",typeof N=="object"&&N!==null&&typeof N.message=="string"?String(N.message):String(N)])}t.key!==null&&il("key",t.key,A,0,""),t.memoizedProps!==null&&A0(t.memoizedProps,A,0,""),y==null&&(y=t._debugTask),t={start:n,end:l,detail:{devtools:{color:"error",track:Ol,tooltipText:t.tag===13?"Hydration failed":"Error boundary caught an error",properties:A}}},y?y.run(performance.measure.bind(performance,"​"+p,t)):performance.measure("​"+p,t)}}}function As(t,n,l,f,p){if(p!==null){if(pn){var y=$(t);if(y!==null){f=[];for(var A=0;A<p.length;A++){var L=p[A].value;f.push(["Error",typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L)])}t.key!==null&&il("key",t.key,f,0,""),t.memoizedProps!==null&&A0(t.memoizedProps,f,0,""),n={start:n,end:l,detail:{devtools:{color:"error",track:Ol,tooltipText:"A lifecycle or effect errored",properties:f}}},(t=t._debugTask)?t.run(performance.measure.bind(performance,"​"+y,n)):performance.measure("​"+y,n)}}}else y=$(t),y!==null&&pn&&(p=1>f?"secondary-light":100>f?"secondary":500>f?"secondary-dark":"error",(t=t._debugTask)?t.run(console.timeStamp.bind(console,y,n,l,Ol,void 0,p)):console.timeStamp(y,n,l,Ol,void 0,p))}function Ub(t,n,l,f){if(pn&&!(n<=t)){var p=(l&738197653)===l?"tertiary-dark":"primary-dark";l=(l&536870912)===l?"Prepared":(l&201326741)===l?"Hydrated":"Render",f?f.run(console.timeStamp.bind(console,l,t,n,_t,Dt,p)):console.timeStamp(l,t,n,_t,Dt,p)}}function tS(t,n,l,f){!pn||n<=t||(l=(l&738197653)===l?"tertiary-dark":"primary-dark",f?f.run(console.timeStamp.bind(console,"Prewarm",t,n,_t,Dt,l)):console.timeStamp("Prewarm",t,n,_t,Dt,l))}function nS(t,n,l,f){!pn||n<=t||(l=(l&738197653)===l?"tertiary-dark":"primary-dark",f?f.run(console.timeStamp.bind(console,"Suspended",t,n,_t,Dt,l)):console.timeStamp("Suspended",t,n,_t,Dt,l))}function kb(t,n,l,f,p,y){if(pn&&!(n<=t)){l=[];for(var A=0;A<f.length;A++){var L=f[A].value;l.push(["Recoverable Error",typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L)])}t={start:t,end:n,detail:{devtools:{color:"primary-dark",track:_t,trackGroup:Dt,tooltipText:p?"Hydration Failed":"Recovered after Error",properties:l}}},y?y.run(performance.measure.bind(performance,"Recovered",t)):performance.measure("Recovered",t)}}function D0(t,n,l,f){!pn||n<=t||(f?f.run(console.timeStamp.bind(console,"Errored",t,n,_t,Dt,"error")):console.timeStamp("Errored",t,n,_t,Dt,"error"))}function Bb(t,n,l,f){!pn||n<=t||(f?f.run(console.timeStamp.bind(console,l,t,n,_t,Dt,"secondary-light")):console.timeStamp(l,t,n,_t,Dt,"secondary-light"))}function iS(t,n,l,f,p){if(pn&&!(n<=t)){for(var y=[],A=0;A<l.length;A++){var L=l[A].value;y.push(["Error",typeof L=="object"&&L!==null&&typeof L.message=="string"?String(L.message):String(L)])}t={start:t,end:n,detail:{devtools:{color:"error",track:_t,trackGroup:Dt,tooltipText:f?"Remaining Effects Errored":"Commit Errored",properties:y}}},p?p.run(performance.measure.bind(performance,"Errored",t)):performance.measure("Errored",t)}}function L0(t,n,l){!pn||n<=t||console.timeStamp("Animating",t,n,_t,Dt,"secondary-dark")}function Vh(){for(var t=bg,n=o1=bg=0;n<t;){var l=Ml[n];Ml[n++]=null;var f=Ml[n];Ml[n++]=null;var p=Ml[n];Ml[n++]=null;var y=Ml[n];if(Ml[n++]=null,f!==null&&p!==null){var A=f.pending;A===null?p.next=p:(p.next=A.next,A.next=p),f.pending=p}y!==0&&_0(l,p,y)}}function Ju(t,n,l,f){Ml[bg++]=t,Ml[bg++]=n,Ml[bg++]=l,Ml[bg++]=f,o1|=f,t.lanes|=f,t=t.alternate,t!==null&&(t.lanes|=f)}function Io(t,n,l,f){return Ju(t,n,l,f),Ff(t)}function Ci(t,n){return Ju(t,null,null,n),Ff(t)}function _0(t,n,l){t.lanes|=l;var f=t.alternate;f!==null&&(f.lanes|=l);for(var p=!1,y=t.return;y!==null;)y.childLanes|=l,f=y.alternate,f!==null&&(f.childLanes|=l),y.tag===22&&(t=y.stateNode,t===null||t._visibility&Ty||(p=!0)),t=y,y=y.return;return t.tag===3?(y=t.stateNode,p&&n!==null&&(p=31-bi(l),t=y.hiddenUpdates,f=t[p],f===null?t[p]=[n]:f.push(n),n.lane=l|536870912),y):null}function Ff(t){if(Ky>nU)throw rh=Ky=0,Xy=G1=null,Error("Maximum update depth exceeded. This can happen when a component repeatedly calls setState inside componentWillUpdate or componentDidUpdate. React limits the number of nested updates to prevent infinite loops.");rh>iU&&(rh=0,Xy=null,console.error("Maximum update depth exceeded. This can happen when a component calls setState inside useEffect, but useEffect either doesn't have a dependency array, or one of the dependencies changes on every render.")),t.alternate===null&&t.flags&4098&&ls(t);for(var n=t,l=n.return;l!==null;)n.alternate===null&&n.flags&4098&&ls(t),n=l,l=n.return;return n.tag===3?n.stateNode:null}function Nr(t){if(Il===null)return t;var n=Il(t);return n===void 0?t:n.current}function Yh(t){if(Il===null)return t;var n=Il(t);return n===void 0?t!=null&&typeof t.render=="function"&&(n=Nr(t.render),t.render!==n)?(n={$$typeof:Fc,render:n},t.displayName!==void 0&&(n.displayName=t.displayName),n):t:n.current}function C0(t,n){if(Il===null)return!1;var l=t.elementType;n=n.type;var f=!1,p=typeof n=="object"&&n!==null?n.$$typeof:null;switch(t.tag){case 1:typeof n=="function"&&(f=!0);break;case 0:(typeof n=="function"||p===Ii)&&(f=!0);break;case 11:(p===Fc||p===Ii)&&(f=!0);break;case 14:case 15:(p===Fd||p===Ii)&&(f=!0);break;default:return!1}return!!(f&&(t=Il(l),t!==void 0&&t===Il(n)))}function wo(t){Il!==null&&typeof WeakSet=="function"&&(xg===null&&(xg=new WeakSet),xg.add(t))}function aS(t,n,l){do{var f=t,p=f.alternate,y=f.child,A=f.sibling,L=f.tag;f=f.type;var N=null;switch(L){case 0:case 15:case 1:N=f;break;case 11:N=f.render}if(Il===null)throw Error("Expected resolveFamily to be set during hot reload.");var U=!1;if(f=!1,N!==null&&(N=Il(N),N!==void 0&&(l.has(N)?f=!0:n.has(N)&&(L===1?f=!0:U=!0))),xg!==null&&(xg.has(t)||p!==null&&xg.has(p))&&(f=!0),f&&(t._debugNeedsRemount=!0),(f||U)&&(p=Ci(t,2),p!==null&&We(p,t,2)),y===null||f||aS(y,n,l),A===null)break;t=A}while(!0)}function zb(t,n,l,f){this.tag=t,this.key=l,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=n,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=f,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null,this.actualDuration=-0,this.actualStartTime=-1.1,this.treeBaseDuration=this.selfBaseDuration=-0,this._debugTask=this._debugStack=this._debugOwner=this._debugInfo=null,this._debugNeedsRemount=!1,this._debugHookTypes=null,GD||typeof Object.preventExtensions!="function"||Object.preventExtensions(this)}function O0(t){return t=t.prototype,!(!t||!t.isReactComponent)}function al(t,n){var l=t.alternate;switch(l===null?(l=R(t.tag,n,t.key,t.mode),l.elementType=t.elementType,l.type=t.type,l.stateNode=t.stateNode,l._debugOwner=t._debugOwner,l._debugStack=t._debugStack,l._debugTask=t._debugTask,l._debugHookTypes=t._debugHookTypes,l.alternate=t,t.alternate=l):(l.pendingProps=n,l.type=t.type,l.flags=0,l.subtreeFlags=0,l.deletions=null,l.actualDuration=-0,l.actualStartTime=-1.1),l.flags=t.flags&65011712,l.childLanes=t.childLanes,l.lanes=t.lanes,l.child=t.child,l.memoizedProps=t.memoizedProps,l.memoizedState=t.memoizedState,l.updateQueue=t.updateQueue,n=t.dependencies,l.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext,_debugThenableState:n._debugThenableState},l.sibling=t.sibling,l.index=t.index,l.ref=t.ref,l.refCleanup=t.refCleanup,l.selfBaseDuration=t.selfBaseDuration,l.treeBaseDuration=t.treeBaseDuration,l._debugInfo=t._debugInfo,l._debugNeedsRemount=t._debugNeedsRemount,l.tag){case 0:case 15:l.type=Nr(t.type);break;case 1:l.type=Nr(t.type);break;case 11:l.type=Yh(t.type)}return l}function M0(t,n){t.flags&=65011714;var l=t.alternate;return l===null?(t.childLanes=0,t.lanes=n,t.child=null,t.subtreeFlags=0,t.memoizedProps=null,t.memoizedState=null,t.updateQueue=null,t.dependencies=null,t.stateNode=null,t.selfBaseDuration=0,t.treeBaseDuration=0):(t.childLanes=l.childLanes,t.lanes=l.lanes,t.child=l.child,t.subtreeFlags=0,t.deletions=null,t.memoizedProps=l.memoizedProps,t.memoizedState=l.memoizedState,t.updateQueue=l.updateQueue,t.type=l.type,n=l.dependencies,t.dependencies=n===null?null:{lanes:n.lanes,firstContext:n.firstContext,_debugThenableState:n._debugThenableState},t.selfBaseDuration=l.selfBaseDuration,t.treeBaseDuration=l.treeBaseDuration),t}function No(t,n,l,f,p,y){var A=0,L=t;if(typeof t=="function")O0(t)&&(A=1),L=Nr(L);else if(typeof t=="string")A=ne(),A=WS(t,l,A)?26:t==="html"||t==="head"||t==="body"?27:5;else e:switch(t){case $s:return n=R(31,l,n,p),n.elementType=$s,n.lanes=y,n;case zc:return Uo(l.children,p,y,n);case ia:A=8,p|=ga,p|=gr;break;case zd:return t=l,f=p,typeof t.id!="string"&&console.error('Profiler must specify an "id" of type `string` as a prop. Received the type `%s` instead.',typeof t.id),n=R(12,t,n,f|mt),n.elementType=zd,n.lanes=y,n.stateNode={effectDuration:0,passiveEffectDuration:0},n;case fu:return n=R(13,l,n,p),n.elementType=fu,n.lanes=y,n;case ha:return n=R(19,l,n,p),n.elementType=ha,n.lanes=y,n;default:if(typeof t=="object"&&t!==null)switch(t.$$typeof){case Gs:A=10;break e;case ag:A=9;break e;case Fc:A=11,L=Yh(L);break e;case Fd:A=14;break e;case Ii:A=16,L=null;break e}L="",(t===void 0||typeof t=="object"&&t!==null&&Object.keys(t).length===0)&&(L+=" You likely forgot to export your component from the file it's defined in, or you might have mixed up default and named imports."),t===null?l="null":Hn(t)?l="array":t!==void 0&&t.$$typeof===rs?(l="<"+(Z(t.type)||"Unknown")+" />",L=" Did you accidentally export a JSX literal instead of a component?"):l=typeof t,(A=f?te(f):null)&&(L+=`
96
+
97
+ Check the render method of \``+A+"`."),A=29,l=Error("Element type is invalid: expected a string (for built-in components) or a class/function (for composite components) but got: "+(l+"."+L)),L=null}return n=R(A,l,n,p),n.elementType=t,n.type=L,n.lanes=y,n._debugOwner=f,n}function Ur(t,n,l){return n=No(t.type,t.key,t.props,t._owner,n,l),n._debugOwner=t._owner,n._debugStack=t._debugStack,n._debugTask=t._debugTask,n}function Uo(t,n,l,f){return t=R(7,t,f,n),t.lanes=l,t}function Wu(t,n,l){return t=R(6,t,null,n),t.lanes=l,t}function I0(t){var n=R(18,null,null,Je);return n.stateNode=t,n}function qh(t,n,l){return n=R(4,t.children!==null?t.children:[],t.key,n),n.lanes=l,n.stateNode={containerInfo:t.containerInfo,pendingChildren:null,implementation:t.implementation},n}function ji(t,n){if(typeof t=="object"&&t!==null){var l=u1.get(t);return l!==void 0?l:(n={value:t,source:n,stack:at(n)},u1.set(t,n),n)}return{value:t,source:n,stack:at(n)}}function Rs(t,n){kr(),Ag[Rg++]=by,Ag[Rg++]=TE,TE=t,by=n}function w0(t,n,l){kr(),wl[Nl++]=vu,wl[Nl++]=Su,wl[Nl++]=Yd,Yd=t;var f=vu;t=Su;var p=32-bi(f)-1;f&=~(1<<p),l+=1;var y=32-bi(n)+p;if(30<y){var A=p-p%5;y=(f&(1<<A)-1).toString(32),f>>=A,p-=A,vu=1<<32-bi(n)+p|l<<p|f,Su=y+t}else vu=1<<y|l<<p|f,Su=t}function Kh(t){kr(),t.return!==null&&(Rs(t,1),w0(t,1,0))}function Xh(t){for(;t===TE;)TE=Ag[--Rg],Ag[Rg]=null,by=Ag[--Rg],Ag[Rg]=null;for(;t===Yd;)Yd=wl[--Nl],wl[Nl]=null,Su=wl[--Nl],wl[Nl]=null,vu=wl[--Nl],wl[Nl]=null}function sS(){return kr(),Yd!==null?{id:vu,overflow:Su}:null}function lS(t,n){kr(),wl[Nl++]=vu,wl[Nl++]=Su,wl[Nl++]=Yd,vu=n.id,Su=n.overflow,Yd=t}function kr(){Rt||console.error("Expected to be hydrating. This is a bug in React. Please file an issue.")}function ko(t,n){if(t.return===null){if(js===null)js={fiber:t,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:n};else{if(js.fiber!==t)throw Error("Saw multiple hydration diff roots in a pass. This is a bug in React.");js.distanceFromLeaf>n&&(js.distanceFromLeaf=n)}return js}var l=ko(t.return,n+1).children;return 0<l.length&&l[l.length-1].fiber===t?(l=l[l.length-1],l.distanceFromLeaf>n&&(l.distanceFromLeaf=n),l):(n={fiber:t,children:[],serverProps:void 0,serverTail:[],distanceFromLeaf:n},l.push(n),n)}function rS(){Rt&&console.error("We should not be hydrating here. This is a bug in React. Please file a bug.")}function Oi(t,n){ho||(t=ko(t,0),t.serverProps=null,n!==null&&(n=XS(n),t.serverTail.push(n)))}function Ja(t){var n=1<arguments.length&&arguments[1]!==void 0?arguments[1]:!1,l="",f=js;throw f!==null&&(js=null,l=h0(f)),Gf(ji(Error("Hydration failed because the server rendered "+(n?"text":"HTML")+` didn't match the client. As a result this tree will be regenerated on the client. This can happen if a SSR-ed Client Component used:
98
+
99
+ - A server/client branch \`if (typeof window !== 'undefined')\`.
100
+ - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
101
+ - Date formatting in a user's locale which doesn't match the server.
102
+ - External changing data without sending a snapshot of it along with the HTML.
103
+ - Invalid HTML tag nesting.
104
+
105
+ It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
106
+
107
+ https://react.dev/link/hydration-mismatch`+l),t)),c1}function N0(t){var n=t.stateNode,l=t.type,f=t.memoizedProps;switch(n[gn]=t,n[aa]=f,ta(l,f),l){case"dialog":Ze("cancel",n),Ze("close",n);break;case"iframe":case"object":case"embed":Ze("load",n);break;case"video":case"audio":for(l=0;l<Qy.length;l++)Ze(Qy[l],n);break;case"source":Ze("error",n);break;case"img":case"image":case"link":Ze("error",n),Ze("load",n);break;case"details":Ze("toggle",n);break;case"input":xo("input",f),Ze("invalid",n),Hi(n,f),Oh(n,f.value,f.defaultValue,f.checked,f.defaultChecked,f.type,f.name,!0);break;case"option":jv(n,f);break;case"select":xo("select",f),Ze("invalid",n),Mh(n,f);break;case"textarea":xo("textarea",f),Ze("invalid",n),Ao(n,f),Hu(n,f.value,f.defaultValue,f.children)}l=f.children,typeof l!="string"&&typeof l!="number"&&typeof l!="bigint"||n.textContent===""+l||f.suppressHydrationWarning===!0||kp(n.textContent,l)?(f.popover!=null&&(Ze("beforetoggle",n),Ze("toggle",n)),f.onScroll!=null&&Ze("scroll",n),f.onScrollEnd!=null&&Ze("scrollend",n),f.onClick!=null&&(n.onclick=Qa),n=!0):n=!1,n||Ja(t,!0)}function U0(t){for(sa=t.return;sa;)switch(sa.tag){case 5:case 31:case 13:Ul=!1;return;case 27:case 3:Ul=!0;return;default:sa=sa.return}}function Bo(t){if(t!==sa)return!1;if(!Rt)return U0(t),Rt=!0,!1;var n=t.tag,l;if((l=n!==3&&n!==27)&&((l=n===5)&&(l=t.type,l=!(l!=="form"&&l!=="button")||Oc(t.type,t.memoizedProps)),l=!l),l&&yn){for(l=yn;l;){var f=ko(t,0),p=XS(l);f.serverTail.push(p),l=p.type==="Suspense"?wc(l):wa(l.nextSibling)}Ja(t)}if(U0(t),n===13){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");yn=wc(t)}else if(n===31){if(t=t.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");yn=wc(t)}else n===27?(n=yn,so(t.type)?(t=W1,W1=null,yn=t):yn=n):yn=sa?wa(t.stateNode.nextSibling):null;return!0}function Br(){yn=sa=null,ho=Rt=!1}function Pf(){var t=ef;return t!==null&&(Ga===null?Ga=t:Ga.push.apply(Ga,t),ef=null),t}function Gf(t){ef===null?ef=[t]:ef.push(t)}function zr(){var t=js;if(t!==null){js=null;for(var n=h0(t);0<t.children.length;)t=t.children[0];we(t.fiber,function(){console.error(`A tree hydrated but some attributes of the server rendered HTML didn't match the client properties. This won't be patched up. This can happen if a SSR-ed Client Component used:
108
+
109
+ - A server/client branch \`if (typeof window !== 'undefined')\`.
110
+ - Variable input such as \`Date.now()\` or \`Math.random()\` which changes each time it's called.
111
+ - Date formatting in a user's locale which doesn't match the server.
112
+ - External changing data without sending a snapshot of it along with the HTML.
113
+ - Invalid HTML tag nesting.
114
+
115
+ It can also happen if the client has a browser extension installed which messes with the HTML before React loaded.
116
+
117
+ %s%s`,"https://react.dev/link/hydration-mismatch",n)})}}function ec(){Dg=bE=null,Lg=!1}function Wa(t,n,l){De(f1,n._currentValue,t),n._currentValue=l,De(d1,n._currentRenderer,t),n._currentRenderer!==void 0&&n._currentRenderer!==null&&n._currentRenderer!==HD&&console.error("Detected multiple renderers concurrently rendering the same context provider. This is currently unsupported."),n._currentRenderer=HD}function Ds(t,n){t._currentValue=f1.current;var l=d1.current;Ee(d1,n),t._currentRenderer=l,Ee(f1,n)}function Qh(t,n,l){for(;t!==null;){var f=t.alternate;if((t.childLanes&n)!==n?(t.childLanes|=n,f!==null&&(f.childLanes|=n)):f!==null&&(f.childLanes&n)!==n&&(f.childLanes|=n),t===l)break;t=t.return}t!==l&&console.error("Expected to find the propagation root when scheduling context work. This error is likely caused by a bug in React. Please file an issue.")}function Xl(t,n,l,f){var p=t.child;for(p!==null&&(p.return=t);p!==null;){var y=p.dependencies;if(y!==null){var A=p.child;y=y.firstContext;e:for(;y!==null;){var L=y;y=p;for(var N=0;N<n.length;N++)if(L.context===n[N]){y.lanes|=l,L=y.alternate,L!==null&&(L.lanes|=l),Qh(y.return,l,t),f||(A=null);break e}y=L.next}}else if(p.tag===18){if(A=p.return,A===null)throw Error("We just came from a parent so we must have had a parent. This is a bug in React.");A.lanes|=l,y=A.alternate,y!==null&&(y.lanes|=l),Qh(A,l,t),A=null}else A=p.child;if(A!==null)A.return=p;else for(A=p;A!==null;){if(A===t){A=null;break}if(p=A.sibling,p!==null){p.return=A.return,A=p;break}A=A.return}p=A}}function Ls(t,n,l,f){t=null;for(var p=n,y=!1;p!==null;){if(!y){if(p.flags&524288)y=!0;else if(p.flags&262144)break}if(p.tag===10){var A=p.alternate;if(A===null)throw Error("Should have a current fiber. This is a bug in React.");if(A=A.memoizedProps,A!==null){var L=p.type;Ba(p.pendingProps.value,A.value)||(t!==null?t.push(L):t=[L])}}else if(p===uo.current){if(A=p.alternate,A===null)throw Error("Should have a current fiber. This is a bug in React.");A.memoizedState.memoizedState!==p.memoizedState.memoizedState&&(t!==null?t.push(tv):t=[tv])}p=p.return}t!==null&&Xl(n,t,l,f),n.flags|=262144}function tc(t){for(t=t.firstContext;t!==null;){if(!Ba(t.context._currentValue,t.memoizedValue))return!0;t=t.next}return!1}function Fr(t){bE=t,Dg=null,t=t.dependencies,t!==null&&(t.firstContext=null)}function wt(t){return Lg&&console.error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo()."),k0(bE,t)}function $f(t,n){return bE===null&&Fr(t),k0(t,n)}function k0(t,n){var l=n._currentValue;if(n={context:n,memoizedValue:l,next:null},Dg===null){if(t===null)throw Error("Context can only be read while React is rendering. In classes, you can read it in the render method or getDerivedStateFromProps. In function components, you can read it directly in the function body, but not inside Hooks like useReducer() or useMemo().");Dg=n,t.dependencies={lanes:0,firstContext:n,_debugThenableState:null},t.flags|=524288}else Dg=Dg.next=n;return l}function Zh(){return{controller:new HN,data:new Map,refCount:0}}function zo(t){t.controller.signal.aborted&&console.warn("A cache instance was retained after it was already freed. This likely indicates a bug in React."),t.refCount++}function Hf(t){t.refCount--,0>t.refCount&&console.warn("A cache instance was released after it was already freed. This likely indicates a bug in React."),t.refCount===0&&jN(VN,function(){t.controller.abort()})}function sl(t,n,l){t&127?0>mo&&(mo=ci(),Ay=xE(n),h1=n,l!=null&&(m1=$(l)),(Ot&(Ri|qs))!==ki&&(kn=!0,nf=xy),t=Mc(),n=Al(),t!==_g||n!==Ry?_g=-1.1:n!==null&&(nf=xy),Xd=t,Ry=n):t&4194048&&0>kl&&(kl=ci(),Dy=xE(n),jD=n,l!=null&&(VD=$(l)),0>xu)&&(t=Mc(),n=Al(),(t!==sf||n!==Qd)&&(sf=-1.1),af=t,Qd=n)}function oS(t){if(0>mo){mo=ci(),Ay=t._debugTask!=null?t._debugTask:null,(Ot&(Ri|qs))!==ki&&(nf=xy);var n=Mc(),l=Al();n!==_g||l!==Ry?_g=-1.1:l!==null&&(nf=xy),Xd=n,Ry=l}0>kl&&(kl=ci(),Dy=t._debugTask!=null?t._debugTask:null,0>xu)&&(t=Mc(),n=Al(),(t!==sf||n!==Qd)&&(sf=-1.1),af=t,Qd=n)}function ll(){var t=qd;return qd=0,t}function nc(t){var n=qd;return qd=t,n}function Vi(t){var n=qd;return qd+=t,n}function Fo(){Qe=Ke=-1.1}function dn(){var t=Ke;return Ke=-1.1,t}function ni(t){0<=t&&(Ke=t)}function es(){var t=Dn;return Dn=-0,t}function Ta(t){0<=t&&(Dn=t)}function ba(){var t=bn;return bn=null,t}function ts(){var t=kn;return kn=!1,t}function Ql(t){za=ci(),0>t.actualStartTime&&(t.actualStartTime=za)}function Jh(t){if(0<=za){var n=ci()-za;t.actualDuration+=n,t.selfBaseDuration=n,za=-1}}function jf(t){if(0<=za){var n=ci()-za;t.actualDuration+=n,za=-1}}function Yi(){if(0<=za){var t=ci(),n=t-za;za=-1,qd+=n,Dn+=n,Qe=t}}function uS(t){bn===null&&(bn=[]),bn.push(t),Tu===null&&(Tu=[]),Tu.push(t)}function xn(){za=ci(),0>Ke&&(Ke=za)}function Po(t){for(var n=t.child;n;)t.actualDuration+=n.actualDuration,n=n.sibling}function Zl(t,n){if(_y===null){var l=_y=[];p1=0,Zd=Up(),Cg={status:"pending",value:void 0,then:function(f){l.push(f)}}}return p1++,n.then(B0,B0),n}function B0(){if(--p1===0&&(-1<kl||(xu=-1.1),_y!==null)){Cg!==null&&(Cg.status="fulfilled");var t=_y;_y=null,Zd=0,Cg=null;for(var n=0;n<t.length;n++)(0,t[n])()}}function Wh(t,n){var l=[],f={status:"pending",value:null,reason:null,then:function(p){l.push(p)}};return t.then(function(){f.status="fulfilled",f.value=n;for(var p=0;p<l.length;p++)(0,l[p])(n)},function(p){for(f.status="rejected",f.reason=p,p=0;p<l.length;p++)(0,l[p])(void 0)}),f}function Jl(){var t=Jd.current;return t!==null?t:an.pooledCache}function ic(t,n){n===null?De(Jd,Jd.current,t):De(Jd,n.pool,t)}function z0(){var t=Jl();return t===null?null:{parent:ui._currentValue,pool:t}}function em(){return{didWarnAboutUncachedPromise:!1,thenables:[]}}function F0(t){return t=t.status,t==="fulfilled"||t==="rejected"}function xa(t,n,l){ge.actQueue!==null&&(ge.didUsePromise=!0);var f=t.thenables;if(l=f[l],l===void 0?f.push(n):l!==n&&(t.didWarnAboutUncachedPromise||(t.didWarnAboutUncachedPromise=!0,console.error("A component was suspended by an uncached promise. Creating promises inside a Client Component or hook is not yet supported, except via a Suspense-compatible library or framework.")),n.then(Qa,Qa),n=l),n._debugInfo===void 0){t=performance.now(),f=n.displayName;var p={name:typeof f=="string"?f:"Promise",start:t,end:t,value:n};n._debugInfo=[{awaited:p}],n.status!=="fulfilled"&&n.status!=="rejected"&&(t=function(){p.end=performance.now()},n.then(t,t))}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Vf(t),t;default:if(typeof n.status=="string")n.then(Qa,Qa);else{if(t=an,t!==null&&100<t.shellSuspendCounter)throw Error("An unknown Component is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.");t=n,t.status="pending",t.then(function(y){if(n.status==="pending"){var A=n;A.status="fulfilled",A.value=y}},function(y){if(n.status==="pending"){var A=n;A.status="rejected",A.reason=y}})}switch(n.status){case"fulfilled":return n.value;case"rejected":throw t=n.reason,Vf(t),t}throw eh=n,Uy=!0,Og}}function Aa(t){try{return QN(t)}catch(n){throw n!==null&&typeof n=="object"&&typeof n.then=="function"?(eh=n,Uy=!0,Og):n}}function Go(){if(eh===null)throw Error("Expected a suspended thenable. This is a bug in React. Please file an issue.");var t=eh;return eh=null,Uy=!1,t}function Vf(t){if(t===Og||t===ME)throw Error("Hooks are not supported inside an async component. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.")}function Mn(t){var n=gt;return t!=null&&(gt=n===null?t:n.concat(t)),n}function ra(){var t=gt;if(t!=null){for(var n=t.length-1;0<=n;n--)if(t[n].name!=null){var l=t[n].debugTask;if(l!=null)return l}}return null}function qi(t,n,l){for(var f=Object.keys(t.props),p=0;p<f.length;p++){var y=f[p];if(y!=="children"&&y!=="key"){n===null&&(n=Ur(t,l.mode,0),n._debugInfo=gt,n.return=l),we(n,function(A){console.error("Invalid prop `%s` supplied to `React.Fragment`. React.Fragment can only have `key` and `children` props.",A)},y);break}}}function _s(t){var n=ky;return ky+=1,Mg===null&&(Mg=em()),xa(Mg,t,n)}function oa(t,n){n=n.props.ref,t.ref=n!==void 0?n:null}function Cs(t,n){throw n.$$typeof===sE?Error(`A React Element from an older version of React was rendered. This is not supported. It can happen if:
118
+ - Multiple copies of the "react" package is used.
119
+ - A library pre-bundled an old copy of "react" or "react/jsx-runtime".
120
+ - A compiler tries to "inline" JSX instead of using the runtime.`):(t=Object.prototype.toString.call(n),Error("Objects are not valid as a React child (found: "+(t==="[object Object]"?"object with keys {"+Object.keys(n).join(", ")+"}":t)+"). If you meant to render a collection of children, use an array instead."))}function ns(t,n){var l=ra();l!==null?l.run(Cs.bind(null,t,n)):Cs(t,n)}function P0(t,n){var l=$(t)||"Component";fL[l]||(fL[l]=!0,n=n.displayName||n.name||"Component",t.tag===3?console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
121
+ root.render(%s)`,n,n,n):console.error(`Functions are not valid as a React child. This may happen if you return %s instead of <%s /> from render. Or maybe you meant to call this function rather than return it.
122
+ <%s>{%s}</%s>`,n,n,l,n,l))}function ac(t,n){var l=ra();l!==null?l.run(P0.bind(null,t,n)):P0(t,n)}function tm(t,n){var l=$(t)||"Component";dL[l]||(dL[l]=!0,n=String(n),t.tag===3?console.error(`Symbols are not valid as a React child.
123
+ root.render(%s)`,n):console.error(`Symbols are not valid as a React child.
124
+ <%s>%s</%s>`,l,n,l))}function Yf(t,n){var l=ra();l!==null?l.run(tm.bind(null,t,n)):tm(t,n)}function ii(t){function n(H,V){if(t){var X=H.deletions;X===null?(H.deletions=[V],H.flags|=16):X.push(V)}}function l(H,V){if(!t)return null;for(;V!==null;)n(H,V),V=V.sibling;return null}function f(H){for(var V=new Map;H!==null;)H.key!==null?V.set(H.key,H):V.set(H.index,H),H=H.sibling;return V}function p(H,V){return H=al(H,V),H.index=0,H.sibling=null,H}function y(H,V,X){return H.index=X,t?(X=H.alternate,X!==null?(X=X.index,X<V?(H.flags|=67108866,V):X):(H.flags|=67108866,V)):(H.flags|=1048576,V)}function A(H){return t&&H.alternate===null&&(H.flags|=67108866),H}function L(H,V,X,Se){return V===null||V.tag!==6?(V=Wu(X,H.mode,Se),V.return=H,V._debugOwner=H,V._debugTask=H._debugTask,V._debugInfo=gt,V):(V=p(V,X),V.return=H,V._debugInfo=gt,V)}function N(H,V,X,Se){var Ne=X.type;return Ne===zc?(V=J(H,V,X.props.children,Se,X.key),qi(X,V,H),V):V!==null&&(V.elementType===Ne||C0(V,X)||typeof Ne=="object"&&Ne!==null&&Ne.$$typeof===Ii&&Aa(Ne)===V.type)?(V=p(V,X.props),oa(V,X),V.return=H,V._debugOwner=X._owner,V._debugInfo=gt,V):(V=Ur(X,H.mode,Se),oa(V,X),V.return=H,V._debugInfo=gt,V)}function U(H,V,X,Se){return V===null||V.tag!==4||V.stateNode.containerInfo!==X.containerInfo||V.stateNode.implementation!==X.implementation?(V=qh(X,H.mode,Se),V.return=H,V._debugInfo=gt,V):(V=p(V,X.children||[]),V.return=H,V._debugInfo=gt,V)}function J(H,V,X,Se,Ne){return V===null||V.tag!==7?(V=Uo(X,H.mode,Se,Ne),V.return=H,V._debugOwner=H,V._debugTask=H._debugTask,V._debugInfo=gt,V):(V=p(V,X),V.return=H,V._debugInfo=gt,V)}function ee(H,V,X){if(typeof V=="string"&&V!==""||typeof V=="number"||typeof V=="bigint")return V=Wu(""+V,H.mode,X),V.return=H,V._debugOwner=H,V._debugTask=H._debugTask,V._debugInfo=gt,V;if(typeof V=="object"&&V!==null){switch(V.$$typeof){case rs:return X=Ur(V,H.mode,X),oa(X,V),X.return=H,H=Mn(V._debugInfo),X._debugInfo=gt,gt=H,X;case ro:return V=qh(V,H.mode,X),V.return=H,V._debugInfo=gt,V;case Ii:var Se=Mn(V._debugInfo);return V=Aa(V),H=ee(H,V,X),gt=Se,H}if(Hn(V)||q(V))return X=Uo(V,H.mode,X,null),X.return=H,X._debugOwner=H,X._debugTask=H._debugTask,H=Mn(V._debugInfo),X._debugInfo=gt,gt=H,X;if(typeof V.then=="function")return Se=Mn(V._debugInfo),H=ee(H,_s(V),X),gt=Se,H;if(V.$$typeof===Gs)return ee(H,$f(H,V),X);ns(H,V)}return typeof V=="function"&&ac(H,V),typeof V=="symbol"&&Yf(H,V),null}function j(H,V,X,Se){var Ne=V!==null?V.key:null;if(typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint")return Ne!==null?null:L(H,V,""+X,Se);if(typeof X=="object"&&X!==null){switch(X.$$typeof){case rs:return X.key===Ne?(Ne=Mn(X._debugInfo),H=N(H,V,X,Se),gt=Ne,H):null;case ro:return X.key===Ne?U(H,V,X,Se):null;case Ii:return Ne=Mn(X._debugInfo),X=Aa(X),H=j(H,V,X,Se),gt=Ne,H}if(Hn(X)||q(X))return Ne!==null?null:(Ne=Mn(X._debugInfo),H=J(H,V,X,Se,null),gt=Ne,H);if(typeof X.then=="function")return Ne=Mn(X._debugInfo),H=j(H,V,_s(X),Se),gt=Ne,H;if(X.$$typeof===Gs)return j(H,V,$f(H,X),Se);ns(H,X)}return typeof X=="function"&&ac(H,X),typeof X=="symbol"&&Yf(H,X),null}function fe(H,V,X,Se,Ne){if(typeof Se=="string"&&Se!==""||typeof Se=="number"||typeof Se=="bigint")return H=H.get(X)||null,L(V,H,""+Se,Ne);if(typeof Se=="object"&&Se!==null){switch(Se.$$typeof){case rs:return X=H.get(Se.key===null?X:Se.key)||null,H=Mn(Se._debugInfo),V=N(V,X,Se,Ne),gt=H,V;case ro:return H=H.get(Se.key===null?X:Se.key)||null,U(V,H,Se,Ne);case Ii:var nt=Mn(Se._debugInfo);return Se=Aa(Se),V=fe(H,V,X,Se,Ne),gt=nt,V}if(Hn(Se)||q(Se))return X=H.get(X)||null,H=Mn(Se._debugInfo),V=J(V,X,Se,Ne,null),gt=H,V;if(typeof Se.then=="function")return nt=Mn(Se._debugInfo),V=fe(H,V,X,_s(Se),Ne),gt=nt,V;if(Se.$$typeof===Gs)return fe(H,V,X,$f(V,Se),Ne);ns(V,Se)}return typeof Se=="function"&&ac(V,Se),typeof Se=="symbol"&&Yf(V,Se),null}function Me(H,V,X,Se){if(typeof X!="object"||X===null)return Se;switch(X.$$typeof){case rs:case ro:E(H,V,X);var Ne=X.key;if(typeof Ne!="string")break;if(Se===null){Se=new Set,Se.add(Ne);break}if(!Se.has(Ne)){Se.add(Ne);break}we(V,function(){console.error("Encountered two children with the same key, `%s`. Keys should be unique so that components maintain their identity across updates. Non-unique keys may cause children to be duplicated and/or omitted — the behavior is unsupported and could change in a future version.",Ne)});break;case Ii:X=Aa(X),Me(H,V,X,Se)}return Se}function ke(H,V,X,Se){for(var Ne=null,nt=null,qe=null,He=V,dt=V=0,vn=null;He!==null&&dt<X.length;dt++){He.index>dt?(vn=He,He=null):vn=He.sibling;var Wn=j(H,He,X[dt],Se);if(Wn===null){He===null&&(He=vn);break}Ne=Me(H,Wn,X[dt],Ne),t&&He&&Wn.alternate===null&&n(H,He),V=y(Wn,V,dt),qe===null?nt=Wn:qe.sibling=Wn,qe=Wn,He=vn}if(dt===X.length)return l(H,He),Rt&&Rs(H,dt),nt;if(He===null){for(;dt<X.length;dt++)He=ee(H,X[dt],Se),He!==null&&(Ne=Me(H,He,X[dt],Ne),V=y(He,V,dt),qe===null?nt=He:qe.sibling=He,qe=He);return Rt&&Rs(H,dt),nt}for(He=f(He);dt<X.length;dt++)vn=fe(He,H,dt,X[dt],Se),vn!==null&&(Ne=Me(H,vn,X[dt],Ne),t&&vn.alternate!==null&&He.delete(vn.key===null?dt:vn.key),V=y(vn,V,dt),qe===null?nt=vn:qe.sibling=vn,qe=vn);return t&&He.forEach(function(Mu){return n(H,Mu)}),Rt&&Rs(H,dt),nt}function un(H,V,X,Se){if(X==null)throw Error("An iterable object provided no iterator.");for(var Ne=null,nt=null,qe=V,He=V=0,dt=null,vn=null,Wn=X.next();qe!==null&&!Wn.done;He++,Wn=X.next()){qe.index>He?(dt=qe,qe=null):dt=qe.sibling;var Mu=j(H,qe,Wn.value,Se);if(Mu===null){qe===null&&(qe=dt);break}vn=Me(H,Mu,Wn.value,vn),t&&qe&&Mu.alternate===null&&n(H,qe),V=y(Mu,V,He),nt===null?Ne=Mu:nt.sibling=Mu,nt=Mu,qe=dt}if(Wn.done)return l(H,qe),Rt&&Rs(H,He),Ne;if(qe===null){for(;!Wn.done;He++,Wn=X.next())qe=ee(H,Wn.value,Se),qe!==null&&(vn=Me(H,qe,Wn.value,vn),V=y(qe,V,He),nt===null?Ne=qe:nt.sibling=qe,nt=qe);return Rt&&Rs(H,He),Ne}for(qe=f(qe);!Wn.done;He++,Wn=X.next())dt=fe(qe,H,He,Wn.value,Se),dt!==null&&(vn=Me(H,dt,Wn.value,vn),t&&dt.alternate!==null&&qe.delete(dt.key===null?He:dt.key),V=y(dt,V,He),nt===null?Ne=dt:nt.sibling=dt,nt=dt);return t&&qe.forEach(function(EU){return n(H,EU)}),Rt&&Rs(H,He),Ne}function Lt(H,V,X,Se){if(typeof X=="object"&&X!==null&&X.type===zc&&X.key===null&&(qi(X,null,H),X=X.props.children),typeof X=="object"&&X!==null){switch(X.$$typeof){case rs:var Ne=Mn(X._debugInfo);e:{for(var nt=X.key;V!==null;){if(V.key===nt){if(nt=X.type,nt===zc){if(V.tag===7){l(H,V.sibling),Se=p(V,X.props.children),Se.return=H,Se._debugOwner=X._owner,Se._debugInfo=gt,qi(X,Se,H),H=Se;break e}}else if(V.elementType===nt||C0(V,X)||typeof nt=="object"&&nt!==null&&nt.$$typeof===Ii&&Aa(nt)===V.type){l(H,V.sibling),Se=p(V,X.props),oa(Se,X),Se.return=H,Se._debugOwner=X._owner,Se._debugInfo=gt,H=Se;break e}l(H,V);break}else n(H,V);V=V.sibling}X.type===zc?(Se=Uo(X.props.children,H.mode,Se,X.key),Se.return=H,Se._debugOwner=H,Se._debugTask=H._debugTask,Se._debugInfo=gt,qi(X,Se,H),H=Se):(Se=Ur(X,H.mode,Se),oa(Se,X),Se.return=H,Se._debugInfo=gt,H=Se)}return H=A(H),gt=Ne,H;case ro:e:{for(Ne=X,X=Ne.key;V!==null;){if(V.key===X)if(V.tag===4&&V.stateNode.containerInfo===Ne.containerInfo&&V.stateNode.implementation===Ne.implementation){l(H,V.sibling),Se=p(V,Ne.children||[]),Se.return=H,H=Se;break e}else{l(H,V);break}else n(H,V);V=V.sibling}Se=qh(Ne,H.mode,Se),Se.return=H,H=Se}return A(H);case Ii:return Ne=Mn(X._debugInfo),X=Aa(X),H=Lt(H,V,X,Se),gt=Ne,H}if(Hn(X))return Ne=Mn(X._debugInfo),H=ke(H,V,X,Se),gt=Ne,H;if(q(X)){if(Ne=Mn(X._debugInfo),nt=q(X),typeof nt!="function")throw Error("An object is not an iterable. This error is likely caused by a bug in React. Please file an issue.");var qe=nt.call(X);return qe===X?(H.tag!==0||Object.prototype.toString.call(H.type)!=="[object GeneratorFunction]"||Object.prototype.toString.call(qe)!=="[object Generator]")&&(uL||console.error("Using Iterators as children is unsupported and will likely yield unexpected results because enumerating a generator mutates it. You may convert it to an array with `Array.from()` or the `[...spread]` operator before rendering. You can also use an Iterable that can iterate multiple times over the same items."),uL=!0):X.entries!==nt||E1||(console.error("Using Maps as children is not supported. Use an array of keyed ReactElements instead."),E1=!0),H=un(H,V,qe,Se),gt=Ne,H}if(typeof X.then=="function")return Ne=Mn(X._debugInfo),H=Lt(H,V,_s(X),Se),gt=Ne,H;if(X.$$typeof===Gs)return Lt(H,V,$f(H,X),Se);ns(H,X)}return typeof X=="string"&&X!==""||typeof X=="number"||typeof X=="bigint"?(Ne=""+X,V!==null&&V.tag===6?(l(H,V.sibling),Se=p(V,Ne),Se.return=H,H=Se):(l(H,V),Se=Wu(Ne,H.mode,Se),Se.return=H,Se._debugOwner=H,Se._debugTask=H._debugTask,Se._debugInfo=gt,H=Se),A(H)):(typeof X=="function"&&ac(H,X),typeof X=="symbol"&&Yf(H,X),l(H,V))}return function(H,V,X,Se){var Ne=gt;gt=null;try{ky=0;var nt=Lt(H,V,X,Se);return Mg=null,nt}catch(vn){if(vn===Og||vn===ME)throw vn;var qe=R(29,vn,null,H.mode);qe.lanes=Se,qe.return=H;var He=qe._debugInfo=gt;if(qe._debugOwner=H._debugOwner,qe._debugTask=H._debugTask,He!=null){for(var dt=He.length-1;0<=dt;dt--)if(typeof He[dt].stack=="string"){qe._debugOwner=He[dt],qe._debugTask=He[dt].debugTask;break}}return qe}finally{gt=Ne}}}function Wt(t,n){var l=Hn(t);return t=!l&&typeof q(t)=="function",l||t?(l=l?"array":"iterable",console.error("A nested %s was passed to row #%s in <SuspenseList />. Wrap it in an additional SuspenseList to configure its revealOrder: <SuspenseList revealOrder=...> ... <SuspenseList revealOrder=...>{%s}</SuspenseList> ... </SuspenseList>",l,n,l),!1):!0}function Tt(t){t.updateQueue={baseState:t.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function rl(t,n){t=t.updateQueue,n.updateQueue===t&&(n.updateQueue={baseState:t.baseState,firstBaseUpdate:t.firstBaseUpdate,lastBaseUpdate:t.lastBaseUpdate,shared:t.shared,callbacks:null})}function qn(t){return{lane:t,tag:mL,payload:null,callback:null,next:null}}function ol(t,n,l){var f=t.updateQueue;if(f===null)return null;if(f=f.shared,b1===f&&!yL){var p=$(t);console.error(`An update (setState, replaceState, or forceUpdate) was scheduled from inside an update function. Update functions should be pure, with zero side-effects. Consider using componentDidUpdate or a callback.
125
+
126
+ Please update the following component: %s`,p),yL=!0}return(Ot&Ri)!==ki?(p=f.pending,p===null?n.next=n:(n.next=p.next,p.next=n),f.pending=n,n=Ff(t),_0(t,null,l),n):(Ju(t,f,n,l),Ff(t))}function is(t,n,l){if(n=n.updateQueue,n!==null&&(n=n.shared,(l&4194048)!==0)){var f=n.lanes;f&=t.pendingLanes,l|=f,n.lanes=l,_i(t,l)}}function qf(t,n){var l=t.updateQueue,f=t.alternate;if(f!==null&&(f=f.updateQueue,l===f)){var p=null,y=null;if(l=l.firstBaseUpdate,l!==null){do{var A={lane:l.lane,tag:l.tag,payload:l.payload,callback:null,next:null};y===null?p=y=A:y=y.next=A,l=l.next}while(l!==null);y===null?p=y=n:y=y.next=n}else p=y=n;l={baseState:f.baseState,firstBaseUpdate:p,lastBaseUpdate:y,shared:f.shared,callbacks:f.callbacks},t.updateQueue=l;return}t=l.lastBaseUpdate,t===null?l.firstBaseUpdate=n:t.next=n,l.lastBaseUpdate=n}function sc(){if(x1){var t=Cg;if(t!==null)throw t}}function ul(t,n,l,f){x1=!1;var p=t.updateQueue;lf=!1,b1=p.shared;var y=p.firstBaseUpdate,A=p.lastBaseUpdate,L=p.shared.pending;if(L!==null){p.shared.pending=null;var N=L,U=N.next;N.next=null,A===null?y=U:A.next=U,A=N;var J=t.alternate;J!==null&&(J=J.updateQueue,L=J.lastBaseUpdate,L!==A&&(L===null?J.firstBaseUpdate=U:L.next=U,J.lastBaseUpdate=N))}if(y!==null){var ee=p.baseState;A=0,J=U=N=null,L=y;do{var j=L.lane&-536870913,fe=j!==L.lane;if(fe?(pt&j)===j:(f&j)===j){j!==0&&j===Zd&&(x1=!0),J!==null&&(J=J.next={lane:0,tag:L.tag,payload:L.payload,callback:null,next:null});e:{j=t;var Me=L,ke=n,un=l;switch(Me.tag){case gL:if(Me=Me.payload,typeof Me=="function"){Lg=!0;var Lt=Me.call(un,ee,ke);if(j.mode&ga){ut(!0);try{Me.call(un,ee,ke)}finally{ut(!1)}}Lg=!1,ee=Lt;break e}ee=Me;break e;case T1:j.flags=j.flags&-65537|128;case mL:if(Lt=Me.payload,typeof Lt=="function"){if(Lg=!0,Me=Lt.call(un,ee,ke),j.mode&ga){ut(!0);try{Lt.call(un,ee,ke)}finally{ut(!1)}}Lg=!1}else Me=Lt;if(Me==null)break e;ee=ht({},ee,Me);break e;case pL:lf=!0}}j=L.callback,j!==null&&(t.flags|=64,fe&&(t.flags|=8192),fe=p.callbacks,fe===null?p.callbacks=[j]:fe.push(j))}else fe={lane:j,tag:L.tag,payload:L.payload,callback:L.callback,next:null},J===null?(U=J=fe,N=ee):J=J.next=fe,A|=j;if(L=L.next,L===null){if(L=p.shared.pending,L===null)break;fe=L,L=fe.next,fe.next=null,p.lastBaseUpdate=fe,p.shared.pending=null}}while(!0);J===null&&(N=ee),p.baseState=N,p.firstBaseUpdate=U,p.lastBaseUpdate=J,y===null&&(p.shared.lanes=0),uf|=A,t.lanes=A,t.memoizedState=ee}b1=null}function Pr(t,n){if(typeof t!="function")throw Error("Invalid argument passed as callback. Expected a function. Instead received: "+t);t.call(n)}function G0(t,n){var l=t.shared.hiddenCallbacks;if(l!==null)for(t.shared.hiddenCallbacks=null,t=0;t<l.length;t++)Pr(l[t],n)}function lc(t,n){var l=t.callbacks;if(l!==null)for(t.callbacks=null,t=0;t<l.length;t++)Pr(l[t],n)}function nm(t,n){var l=po;De(wE,l,t),De(Ig,n,t),po=l|n.baseLanes}function Wl(t){De(wE,po,t),De(Ig,Ig.current,t)}function Os(t){po=wE.current,Ee(Ig,t),Ee(wE,t)}function Ki(t){var n=t.alternate;De(Jn,Jn.current&wg,t),De(Vs,t,t),Bl===null&&(n===null||Ig.current!==null||n.memoizedState!==null)&&(Bl=t)}function Ms(t){De(Jn,Jn.current,t),De(Vs,t,t),Bl===null&&(Bl=t)}function im(t){t.tag===22?(De(Jn,Jn.current,t),De(Vs,t,t),Bl===null&&(Bl=t)):cl(t)}function cl(t){De(Jn,Jn.current,t),De(Vs,Vs.current,t)}function ai(t){Ee(Vs,t),Bl===t&&(Bl=null),Ee(Jn,t)}function $o(t){for(var n=t;n!==null;){if(n.tag===13){var l=n.memoizedState;if(l!==null&&(l=l.dehydrated,l===null||Cd(l)||zp(l)))return n}else if(n.tag===19&&(n.memoizedProps.revealOrder==="forwards"||n.memoizedProps.revealOrder==="backwards"||n.memoizedProps.revealOrder==="unstable_legacy-backwards"||n.memoizedProps.revealOrder==="together")){if(n.flags&128)return n}else if(n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return null;n=n.return}n.sibling.return=n.return,n=n.sibling}return null}function et(){var t=he;Fl===null?Fl=[t]:Fl.push(t)}function Re(){var t=he;if(Fl!==null&&(Du++,Fl[Du]!==t)){var n=$(tt);if(!vL.has(n)&&(vL.add(n),Fl!==null)){for(var l="",f=0;f<=Du;f++){var p=Fl[f],y=f===Du?t:p;for(p=f+1+". "+p;30>p.length;)p+=" ";p+=y+`
127
+ `,l+=p}console.error(`React has detected a change in the order of Hooks called by %s. This will lead to bugs and errors if not fixed. For more information, read the Rules of Hooks: https://react.dev/link/rules-of-hooks
128
+
129
+ Previous render Next render
130
+ ------------------------------------------------------
131
+ %s ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
132
+ `,n,l)}}}function er(t){t==null||Hn(t)||console.error("%s received a final argument that is not an array (instead, received `%s`). When specified, the final argument must be an array.",he,typeof t)}function Kf(){var t=$(tt);EL.has(t)||(EL.add(t),console.error("ReactDOM.useFormState has been renamed to React.useActionState. Please update %s to use React.useActionState.",t))}function An(){throw Error(`Invalid hook call. Hooks can only be called inside of the body of a function component. This could happen for one of the following reasons:
133
+ 1. You might have mismatching versions of React and the renderer (such as React DOM)
134
+ 2. You might be breaking the Rules of Hooks
135
+ 3. You might have more than one copy of React in the same app
136
+ See https://react.dev/link/invalid-hook-call for tips about how to debug and fix this problem.`)}function $0(t,n){if(Fy)return!1;if(n===null)return console.error("%s received a final argument during this render, but not during the previous render. Even though the final argument is optional, its type cannot change between renders.",he),!1;t.length!==n.length&&console.error(`The final argument passed to %s changed size between renders. The order and size of this array must remain constant.
137
+
138
+ Previous: %s
139
+ Incoming: %s`,he,"["+n.join(", ")+"]","["+t.join(", ")+"]");for(var l=0;l<n.length&&l<t.length;l++)if(!Ba(t[l],n[l]))return!1;return!0}function H0(t,n,l,f,p,y){Au=y,tt=n,Fl=t!==null?t._debugHookTypes:null,Du=-1,Fy=t!==null&&t.type!==n.type,(Object.prototype.toString.call(l)==="[object AsyncFunction]"||Object.prototype.toString.call(l)==="[object AsyncGeneratorFunction]")&&(y=$(tt),A1.has(y)||(A1.add(y),console.error("%s is an async Client Component. Only Server Components can be async at the moment. This error is often caused by accidentally adding `'use client'` to a module that was originally written for the server.",y===null?"An unknown Component":"<"+y+">"))),n.memoizedState=null,n.updateQueue=null,n.lanes=0,ge.H=t!==null&&t.memoizedState!==null?D1:Fl!==null?TL:R1,nh=y=(n.mode&ga)!==Je;var A=y1(l,f,p);if(nh=!1,Ug&&(A=Xf(n,l,f,p)),y){ut(!0);try{A=Xf(n,l,f,p)}finally{ut(!1)}}return In(t,n),A}function In(t,n){n._debugHookTypes=Fl,n.dependencies===null?Ru!==null&&(n.dependencies={lanes:0,firstContext:null,_debugThenableState:Ru}):n.dependencies._debugThenableState=Ru,ge.H=Py;var l=nn!==null&&nn.next!==null;if(Au=0,Fl=he=fi=nn=tt=null,Du=-1,t!==null&&(t.flags&65011712)!==(n.flags&65011712)&&console.error("Internal React error: Expected static flag was missing. Please notify the React team."),UE=!1,zy=0,Ru=null,l)throw Error("Rendered fewer hooks than expected. This may be caused by an accidental early return statement.");t===null||di||(t=t.dependencies,t!==null&&tc(t)&&(di=!0)),Uy?(Uy=!1,t=!0):t=!1,t&&(n=$(n)||"Unknown",SL.has(n)||A1.has(n)||(SL.add(n),console.error("`use` was called from inside a try/catch block. This is not allowed and can lead to unexpected behavior. To handle errors triggered by `use`, wrap your component in a error boundary.")))}function Xf(t,n,l,f){tt=t;var p=0;do{if(Ug&&(Ru=null),zy=0,Ug=!1,p>=JN)throw Error("Too many re-renders. React limits the number of renders to prevent an infinite loop.");if(p+=1,Fy=!1,fi=nn=null,t.updateQueue!=null){var y=t.updateQueue;y.lastEffect=null,y.events=null,y.stores=null,y.memoCache!=null&&(y.memoCache.index=0)}Du=-1,ge.H=bL,y=y1(n,l,f)}while(Ug);return y}function Qf(){var t=ge.H,n=t.useState()[0];return n=typeof n.then=="function"?Wf(n):n,t=t.useState()[0],(nn!==null?nn.memoizedState:null)!==t&&(tt.flags|=1024),n}function Ho(){var t=kE!==0;return kE=0,t}function Zf(t,n,l){n.updateQueue=t.updateQueue,n.flags=(n.mode&gr)!==Je?n.flags&-402655237:n.flags&-2053,t.lanes&=~l}function Gr(t){if(UE){for(t=t.memoizedState;t!==null;){var n=t.queue;n!==null&&(n.pending=null),t=t.next}UE=!1}Au=0,Fl=fi=nn=tt=null,Du=-1,he=null,Ug=!1,zy=kE=0,Ru=null}function Gn(){var t={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return fi===null?tt.memoizedState=fi=t:fi=fi.next=t,fi}function zt(){if(nn===null){var t=tt.alternate;t=t!==null?t.memoizedState:null}else t=nn.next;var n=fi===null?tt.memoizedState:fi.next;if(n!==null)fi=n,nn=t;else{if(t===null)throw tt.alternate===null?Error("Update hook called on initial render. This is likely a bug in React. Please file an issue."):Error("Rendered more hooks than during the previous render.");nn=t,t={memoizedState:nn.memoizedState,baseState:nn.baseState,baseQueue:nn.baseQueue,queue:nn.queue,next:null},fi===null?tt.memoizedState=fi=t:fi=fi.next=t}return fi}function Jf(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Wf(t){var n=zy;return zy+=1,Ru===null&&(Ru=em()),t=xa(Ru,t,n),n=tt,(fi===null?n.memoizedState:fi.next)===null&&(n=n.alternate,ge.H=n!==null&&n.memoizedState!==null?D1:R1),t}function tr(t){if(t!==null&&typeof t=="object"){if(typeof t.then=="function")return Wf(t);if(t.$$typeof===Gs)return wt(t)}throw Error("An unsupported type was passed to use(): "+String(t))}function Ra(t){var n=null,l=tt.updateQueue;if(l!==null&&(n=l.memoCache),n==null){var f=tt.alternate;f!==null&&(f=f.updateQueue,f!==null&&(f=f.memoCache,f!=null&&(n={data:f.data.map(function(p){return p.slice()}),index:0})))}if(n==null&&(n={data:[],index:0}),l===null&&(l=Jf(),tt.updateQueue=l),l.memoCache=n,l=n.data[n.index],l===void 0||Fy)for(l=n.data[n.index]=Array(t),f=0;f<t;f++)l[f]=jb;else l.length!==t&&console.error("Expected a constant size argument for each invocation of useMemoCache. The previous cache was allocated with size %s but size %s was requested.",l.length,t);return n.index++,l}function Da(t,n){return typeof n=="function"?n(t):n}function rc(t,n,l){var f=Gn();if(l!==void 0){var p=l(n);if(nh){ut(!0);try{l(n)}finally{ut(!1)}}}else p=n;return f.memoizedState=f.baseState=p,t={pending:null,lanes:0,dispatch:null,lastRenderedReducer:t,lastRenderedState:p},f.queue=t,t=t.dispatch=Fb.bind(null,tt,t),[f.memoizedState,t]}function jo(t){var n=zt();return $r(n,nn,t)}function $r(t,n,l){var f=t.queue;if(f===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");f.lastRenderedReducer=l;var p=t.baseQueue,y=f.pending;if(y!==null){if(p!==null){var A=p.next;p.next=y.next,y.next=A}n.baseQueue!==p&&console.error("Internal error: Expected work-in-progress queue to be a clone. This is a bug in React."),n.baseQueue=p=y,f.pending=null}if(y=t.baseState,p===null)t.memoizedState=y;else{n=p.next;var L=A=null,N=null,U=n,J=!1;do{var ee=U.lane&-536870913;if(ee!==U.lane?(pt&ee)===ee:(Au&ee)===ee){var j=U.revertLane;if(j===0)N!==null&&(N=N.next={lane:0,revertLane:0,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null}),ee===Zd&&(J=!0);else if((Au&j)===j){U=U.next,j===Zd&&(J=!0);continue}else ee={lane:0,revertLane:U.revertLane,gesture:null,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(L=N=ee,A=y):N=N.next=ee,tt.lanes|=j,uf|=j;ee=U.action,nh&&l(y,ee),y=U.hasEagerState?U.eagerState:l(y,ee)}else j={lane:ee,revertLane:U.revertLane,gesture:U.gesture,action:U.action,hasEagerState:U.hasEagerState,eagerState:U.eagerState,next:null},N===null?(L=N=j,A=y):N=N.next=j,tt.lanes|=ee,uf|=ee;U=U.next}while(U!==null&&U!==n);if(N===null?A=y:N.next=L,!Ba(y,t.memoizedState)&&(di=!0,J&&(l=Cg,l!==null)))throw l;t.memoizedState=y,t.baseState=A,t.baseQueue=N,f.lastRenderedState=y}return p===null&&(f.lanes=0),[t.memoizedState,f.dispatch]}function Vo(t){var n=zt(),l=n.queue;if(l===null)throw Error("Should have a queue. You are likely calling Hooks conditionally, which is not allowed. (https://react.dev/link/invalid-hook-call)");l.lastRenderedReducer=t;var f=l.dispatch,p=l.pending,y=n.memoizedState;if(p!==null){l.pending=null;var A=p=p.next;do y=t(y,A.action),A=A.next;while(A!==p);Ba(y,n.memoizedState)||(di=!0),n.memoizedState=y,n.baseQueue===null&&(n.baseState=y),l.lastRenderedState=y}return[y,f]}function oc(t,n,l){var f=tt,p=Gn();if(Rt){if(l===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");var y=l();Ng||y===l()||(console.error("The result of getServerSnapshot should be cached to avoid an infinite loop"),Ng=!0)}else{if(y=n(),Ng||(l=n(),Ba(y,l)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Ng=!0)),an===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");pt&127||j0(f,n,y)}return p.memoizedState=y,l={value:y,getSnapshot:n},p.queue=l,Ko(Hr.bind(null,f,l,t),[t]),f.flags|=2048,fl(zl|Pa,{destroy:void 0},V0.bind(null,f,l,y,n),null),y}function Yo(t,n,l){var f=tt,p=zt(),y=Rt;if(y){if(l===void 0)throw Error("Missing getServerSnapshot, which is required for server-rendered content. Will revert to client rendering.");l=l()}else if(l=n(),!Ng){var A=n();Ba(l,A)||(console.error("The result of getSnapshot should be cached to avoid an infinite loop"),Ng=!0)}(A=!Ba((nn||p).memoizedState,l))&&(p.memoizedState=l,di=!0),p=p.queue;var L=Hr.bind(null,f,p,t);if(Kn(2048,Pa,L,[t]),p.getSnapshot!==n||A||fi!==null&&fi.memoizedState.tag&zl){if(f.flags|=2048,fl(zl|Pa,{destroy:void 0},V0.bind(null,f,p,l,n),null),an===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");y||Au&127||j0(f,n,l)}return l}function j0(t,n,l){t.flags|=16384,t={getSnapshot:n,value:l},n=tt.updateQueue,n===null?(n=Jf(),tt.updateQueue=n,n.stores=[t]):(l=n.stores,l===null?n.stores=[t]:l.push(t))}function V0(t,n,l,f){n.value=l,n.getSnapshot=f,jr(n)&&Y0(t)}function Hr(t,n,l){return l(function(){jr(n)&&(sl(2,"updateSyncExternalStore()",t),Y0(t))})}function jr(t){var n=t.getSnapshot;t=t.value;try{var l=n();return!Ba(t,l)}catch{return!0}}function Y0(t){var n=Ci(t,2);n!==null&&We(n,t,2)}function am(t){var n=Gn();if(typeof t=="function"){var l=t;if(t=l(),nh){ut(!0);try{l()}finally{ut(!1)}}}return n.memoizedState=n.baseState=t,n.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:t},n}function Vr(t){t=am(t);var n=t.queue,l=cm.bind(null,tt,n);return n.dispatch=l,[t.memoizedState,l]}function qo(t){var n=Gn();n.memoizedState=n.baseState=t;var l={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return n.queue=l,n=ld.bind(null,tt,!0,l),l.dispatch=n,[t,n]}function ed(t,n){var l=zt();return uc(l,nn,t,n)}function uc(t,n,l,f){return t.baseState=l,$r(t,nn,typeof f=="function"?f:Da)}function td(t,n){var l=zt();return nn!==null?uc(l,nn,t,n):(l.baseState=t,[t,l.queue.dispatch])}function cS(t,n,l,f,p){if(si(t))throw Error("Cannot update form state while rendering.");if(t=n.action,t!==null){var y={payload:p,action:t,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(A){y.listeners.push(A)}};ge.T!==null?l(!0):y.isTransition=!1,f(y),l=n.pending,l===null?(y.next=n.pending=y,Yr(n,y)):(y.next=l.next,n.pending=l.next=y)}}function Yr(t,n){var l=n.action,f=n.payload,p=t.state;if(n.isTransition){var y=ge.T,A={};A._updatedFibers=new Set,ge.T=A;try{var L=l(p,f),N=ge.S;N!==null&&N(A,L),q0(t,n,L)}catch(U){nd(t,n,U)}finally{y!==null&&A.types!==null&&(y.types!==null&&y.types!==A.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),y.types=A.types),ge.T=y,y===null&&A._updatedFibers&&(t=A._updatedFibers.size,A._updatedFibers.clear(),10<t&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}else try{A=l(p,f),q0(t,n,A)}catch(U){nd(t,n,U)}}function q0(t,n,l){l!==null&&typeof l=="object"&&typeof l.then=="function"?(ge.asyncTransitions++,l.then(Xo,Xo),l.then(function(f){nr(t,n,f)},function(f){return nd(t,n,f)}),n.isTransition||console.error("An async function with useActionState was called outside of a transition. This is likely not what you intended (for example, isPending will not update correctly). Either call the returned function inside startTransition, or pass it to an `action` or `formAction` prop.")):nr(t,n,l)}function nr(t,n,l){n.status="fulfilled",n.value=l,sm(n),t.state=l,n=t.pending,n!==null&&(l=n.next,l===n?t.pending=null:(l=l.next,n.next=l,Yr(t,l)))}function nd(t,n,l){var f=t.pending;if(t.pending=null,f!==null){f=f.next;do n.status="rejected",n.reason=l,sm(n),n=n.next;while(n!==f)}t.action=null}function sm(t){t=t.listeners;for(var n=0;n<t.length;n++)(0,t[n])()}function ir(t,n){return n}function La(t,n){if(Rt){var l=an.formState;if(l!==null){e:{var f=tt;if(Rt){if(yn){t:{for(var p=yn,y=Ul;p.nodeType!==8;){if(!y){p=null;break t}if(p=wa(p.nextSibling),p===null){p=null;break t}}y=p.data,p=y===X1||y===r_?p:null}if(p){yn=wa(p.nextSibling),f=p.data===X1;break e}}Ja(f)}f=!1}f&&(n=l[0])}}return l=Gn(),l.memoizedState=l.baseState=n,f={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ir,lastRenderedState:n},l.queue=f,l=cm.bind(null,tt,f),f.dispatch=l,f=am(!1),y=ld.bind(null,tt,!1,f.queue),f=Gn(),p={state:n,dispatch:null,action:t,pending:null},f.queue=p,l=cS.bind(null,tt,p,y,l),p.dispatch=l,f.memoizedState=t,[n,l,!1]}function qr(t){var n=zt();return lm(n,nn,t)}function lm(t,n,l){if(n=$r(t,n,ir)[0],t=jo(Da)[0],typeof n=="object"&&n!==null&&typeof n.then=="function")try{var f=Wf(n)}catch(A){throw A===Og?ME:A}else f=n;n=zt();var p=n.queue,y=p.dispatch;return l!==n.memoizedState&&(tt.flags|=2048,fl(zl|Pa,{destroy:void 0},K0.bind(null,p,l),null)),[f,y,t]}function K0(t,n){t.action=n}function Kr(t){var n=zt(),l=nn;if(l!==null)return lm(n,l,t);zt(),n=n.memoizedState,l=zt();var f=l.queue.dispatch;return l.memoizedState=t,[n,f,!1]}function fl(t,n,l,f){return t={tag:t,create:l,deps:f,inst:n,next:null},n=tt.updateQueue,n===null&&(n=Jf(),tt.updateQueue=n),l=n.lastEffect,l===null?n.lastEffect=t.next=t:(f=l.next,l.next=t,t.next=f,n.lastEffect=t),t}function rm(t){var n=Gn();return t={current:t},n.memoizedState=t}function Xr(t,n,l,f){var p=Gn();tt.flags|=t,p.memoizedState=fl(zl|n,{destroy:void 0},l,f===void 0?null:f)}function Kn(t,n,l,f){var p=zt();f=f===void 0?null:f;var y=p.memoizedState.inst;nn!==null&&f!==null&&$0(f,nn.memoizedState.deps)?p.memoizedState=fl(n,y,l,f):(tt.flags|=t,p.memoizedState=fl(zl|n,y,l,f))}function Ko(t,n){(tt.mode&gr)!==Je?Xr(276826112,Pa,t,n):Xr(8390656,Pa,t,n)}function fS(t){tt.flags|=4;var n=tt.updateQueue;if(n===null)n=Jf(),tt.updateQueue=n,n.events=[t];else{var l=n.events;l===null?n.events=[t]:l.push(t)}}function id(t){var n=Gn(),l={impl:t};return n.memoizedState=l,function(){if((Ot&Ri)!==ki)throw Error("A function wrapped in useEffectEvent can't be called during rendering.");return l.impl.apply(void 0,arguments)}}function cc(t){var n=zt().memoizedState;return fS({ref:n,nextImpl:t}),function(){if((Ot&Ri)!==ki)throw Error("A function wrapped in useEffectEvent can't be called during rendering.");return n.impl.apply(void 0,arguments)}}function Xi(t,n){var l=4194308;return(tt.mode&gr)!==Je&&(l|=134217728),Xr(l,Ys,t,n)}function _a(t,n){if(typeof n=="function"){t=t();var l=n(t);return function(){typeof l=="function"?l():n(null)}}if(n!=null)return n.hasOwnProperty("current")||console.error("Expected useImperativeHandle() first argument to either be a ref callback or React.createRef() object. Instead received: %s.","an object with keys {"+Object.keys(n).join(", ")+"}"),t=t(),n.current=t,function(){n.current=null}}function dl(t,n,l){typeof n!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",n!==null?typeof n:"null"),l=l!=null?l.concat([t]):null;var f=4194308;(tt.mode&gr)!==Je&&(f|=134217728),Xr(f,Ys,_a.bind(null,n,t),l)}function fc(t,n,l){typeof n!="function"&&console.error("Expected useImperativeHandle() second argument to be a function that creates a handle. Instead received: %s.",n!==null?typeof n:"null"),l=l!=null?l.concat([t]):null,Kn(4,Ys,_a.bind(null,n,t),l)}function om(t,n){return Gn().memoizedState=[t,n===void 0?null:n],t}function Is(t,n){var l=zt();n=n===void 0?null:n;var f=l.memoizedState;return n!==null&&$0(n,f[1])?f[0]:(l.memoizedState=[t,n],t)}function Qi(t,n){var l=Gn();n=n===void 0?null:n;var f=t();if(nh){ut(!0);try{t()}finally{ut(!1)}}return l.memoizedState=[f,n],f}function hn(t,n){var l=zt();n=n===void 0?null:n;var f=l.memoizedState;if(n!==null&&$0(n,f[1]))return f[0];if(f=t(),nh){ut(!0);try{t()}finally{ut(!1)}}return l.memoizedState=[f,n],f}function dc(t,n){var l=Gn();return Ft(l,t,n)}function hl(t,n){var l=zt();return wn(l,nn.memoizedState,t,n)}function ot(t,n){var l=zt();return nn===null?Ft(l,t,n):wn(l,nn.memoizedState,t,n)}function Ft(t,n,l){return l===void 0||Au&1073741824&&!(pt&261930)?t.memoizedState=n:(t.memoizedState=l,t=Ec(),tt.lanes|=t,uf|=t,l)}function wn(t,n,l,f){return Ba(l,n)?l:Ig.current!==null?(t=Ft(t,l,f),Ba(t,n)||(di=!0),t):!(Au&42)||Au&1073741824&&!(pt&261930)?(di=!0,t.memoizedState=l):(t=Ec(),tt.lanes|=t,uf|=t,n)}function Xo(){ge.asyncTransitions--}function Qo(t,n,l,f,p){var y=Ut.p;Ut.p=y!==0&&y<xi?y:xi;var A=ge.T,L={};L._updatedFibers=new Set,ge.T=L,ld(t,!1,n,l);try{var N=p(),U=ge.S;if(U!==null&&U(L,N),N!==null&&typeof N=="object"&&typeof N.then=="function"){ge.asyncTransitions++,N.then(Xo,Xo);var J=Wh(N,f);Zo(t,n,J,Mi(t))}else Zo(t,n,f,Mi(t))}catch(ee){Zo(t,n,{then:function(){},status:"rejected",reason:ee},Mi(t))}finally{Ut.p=y,A!==null&&L.types!==null&&(A.types!==null&&A.types!==L.types&&console.error("We expected inner Transitions to have transferred the outer types set and that you cannot add to the outer Transition while inside the inner.This is a bug in React."),A.types=L.types),ge.T=A,A===null&&L._updatedFibers&&(t=L._updatedFibers.size,L._updatedFibers.clear(),10<t&&console.warn("Detected a large number of updates inside startTransition. If this is due to a subscription please re-write it to use React provided hooks. Otherwise concurrent mode guarantees are off the table."))}}function ar(t,n,l,f){if(t.tag!==5)throw Error("Expected the form instance to be a HostComponent. This is a bug in React.");var p=ad(t).queue;oS(t),Qo(t,p,n,hh,l===null?v:function(){return hc(t),l(f)})}function ad(t){var n=t.memoizedState;if(n!==null)return n;n={memoizedState:hh,baseState:hh,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:hh},next:null};var l={};return n.next={memoizedState:l,baseState:l,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:Da,lastRenderedState:l},next:null},t.memoizedState=n,t=t.alternate,t!==null&&(t.memoizedState=n),n}function hc(t){ge.T===null&&console.error("requestFormReset was called outside a transition or action. To fix, move to an action, or wrap with startTransition.");var n=ad(t);n.next===null&&(n=t.alternate.memoizedState),Zo(t,n.next.queue,{},Mi(t))}function Qr(){var t=am(!1);return t=Qo.bind(null,tt,t.queue,!0,!1),Gn().memoizedState=t,[!1,t]}function dS(){var t=jo(Da)[0],n=zt().memoizedState;return[typeof t=="boolean"?t:Wf(t),n]}function Sn(){var t=Vo(Da)[0],n=zt().memoizedState;return[typeof t=="boolean"?t:Wf(t),n]}function sr(){return wt(tv)}function sd(){var t=Gn(),n=an.identifierPrefix;if(Rt){var l=Su,f=vu;l=(f&~(1<<32-bi(f)-1)).toString(32)+l,n="_"+n+"R_"+l,l=kE++,0<l&&(n+="H"+l.toString(32)),n+="_"}else l=ZN++,n="_"+n+"r_"+l.toString(32)+"_";return t.memoizedState=n}function um(){return Gn().memoizedState=hS.bind(null,tt)}function hS(t,n){for(var l=t.return;l!==null;){switch(l.tag){case 24:case 3:var f=Mi(l),p=qn(f),y=ol(l,p,f);y!==null&&(sl(f,"refresh()",t),We(y,l,f),is(y,l,f)),t=Zh(),n!=null&&y!==null&&console.error("The seed argument is not enabled outside experimental channels."),p.payload={cache:t};return}l=l.return}}function Fb(t,n,l){var f=arguments;typeof f[3]=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),f=Mi(t);var p={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};si(t)?Rn(n,p):(p=Io(t,n,p,f),p!==null&&(sl(f,"dispatch()",t),We(p,t,f),rd(p,n,f)))}function cm(t,n,l){var f=arguments;typeof f[3]=="function"&&console.error("State updates from the useState() and useReducer() Hooks don't support the second callback argument. To execute a side effect after rendering, declare it in the component body with useEffect()."),f=Mi(t),Zo(t,n,l,f)&&sl(f,"setState()",t)}function Zo(t,n,l,f){var p={lane:f,revertLane:0,gesture:null,action:l,hasEagerState:!1,eagerState:null,next:null};if(si(t))Rn(n,p);else{var y=t.alternate;if(t.lanes===0&&(y===null||y.lanes===0)&&(y=n.lastRenderedReducer,y!==null)){var A=ge.H;ge.H=yr;try{var L=n.lastRenderedState,N=y(L,l);if(p.hasEagerState=!0,p.eagerState=N,Ba(N,L))return Ju(t,n,p,0),an===null&&Vh(),!1}catch{}finally{ge.H=A}}if(l=Io(t,n,p,f),l!==null)return We(l,t,f),rd(l,n,f),!0}return!1}function ld(t,n,l,f){if(ge.T===null&&Zd===0&&console.error("An optimistic state update occurred outside a transition or action. To fix, move the update to an action, or wrap with startTransition."),f={lane:2,revertLane:Up(),gesture:null,action:f,hasEagerState:!1,eagerState:null,next:null},si(t)){if(n)throw Error("Cannot update optimistic state while rendering.");console.error("Cannot call startTransition while rendering.")}else n=Io(t,l,f,2),n!==null&&(sl(2,"setOptimistic()",t),We(n,t,2))}function si(t){var n=t.alternate;return t===tt||n!==null&&n===tt}function Rn(t,n){Ug=UE=!0;var l=t.pending;l===null?n.next=n:(n.next=l.next,l.next=n),t.pending=n}function rd(t,n,l){if(l&4194048){var f=n.lanes;f&=t.pendingLanes,l|=f,n.lanes=l,_i(t,l)}}function Jo(t){if(t!==null&&typeof t!="function"){var n=String(t);wL.has(n)||(wL.add(n),console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",t))}}function mc(t,n,l,f){var p=t.memoizedState,y=l(f,p);if(t.mode&ga){ut(!0);try{y=l(f,p)}finally{ut(!1)}}y===void 0&&(n=Z(n)||"Component",CL.has(n)||(CL.add(n),console.error("%s.getDerivedStateFromProps(): A valid state object (or null) must be returned. You have returned undefined.",n))),p=y==null?p:ht({},p,y),t.memoizedState=p,t.lanes===0&&(t.updateQueue.baseState=p)}function fm(t,n,l,f,p,y,A){var L=t.stateNode;if(typeof L.shouldComponentUpdate=="function"){if(l=L.shouldComponentUpdate(f,y,A),t.mode&ga){ut(!0);try{l=L.shouldComponentUpdate(f,y,A)}finally{ut(!1)}}return l===void 0&&console.error("%s.shouldComponentUpdate(): Returned undefined instead of a boolean value. Make sure to return true or false.",Z(n)||"Component"),l}return n.prototype&&n.prototype.isPureReactComponent?!Zu(l,f)||!Zu(p,y):!0}function ml(t,n,l,f){var p=n.state;typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps(l,f),typeof n.UNSAFE_componentWillReceiveProps=="function"&&n.UNSAFE_componentWillReceiveProps(l,f),n.state!==p&&(t=$(t)||"Component",AL.has(t)||(AL.add(t),console.error("%s.componentWillReceiveProps(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",t)),L1.enqueueReplaceState(n,n.state,null))}function gl(t,n){var l=n;if("ref"in n){l={};for(var f in n)f!=="ref"&&(l[f]=n[f])}if(t=t.defaultProps){l===n&&(l=ht({},l));for(var p in t)l[p]===void 0&&(l[p]=t[p])}return l}function dm(t){a1(t),console.warn(`%s
140
+
141
+ %s
142
+ `,kg?"An error occurred in the <"+kg+"> component.":"An error occurred in one of your React components.",`Consider adding an error boundary to your tree to customize error handling behavior.
143
+ Visit https://react.dev/link/error-boundaries to learn more about error boundaries.`)}function hm(t){var n=kg?"The above error occurred in the <"+kg+"> component.":"The above error occurred in one of your React components.",l="React will try to recreate this component tree from scratch using the error boundary you provided, "+((_1||"Anonymous")+".");if(typeof t=="object"&&t!==null&&typeof t.environmentName=="string"){var f=t.environmentName;t=[`%o
144
+
145
+ %s
146
+
147
+ %s
148
+ `,t,n,l].slice(0),typeof t[0]=="string"?t.splice(0,1,g_+" "+t[0],p_,rT+f+rT,y_):t.splice(0,0,g_,p_,rT+f+rT,y_),t.unshift(console),f=vU.apply(console.error,t),f()}else console.error(`%o
149
+
150
+ %s
151
+
152
+ %s
153
+ `,t,n,l)}function X0(t){a1(t)}function od(t,n){try{kg=n.source?$(n.source):null,_1=null;var l=n.value;if(ge.actQueue!==null)ge.thrownErrors.push(l);else{var f=t.onUncaughtError;f(l,{componentStack:n.stack})}}catch(p){setTimeout(function(){throw p})}}function Q0(t,n,l){try{kg=l.source?$(l.source):null,_1=$(n);var f=t.onCaughtError;f(l.value,{componentStack:l.stack,errorBoundary:n.tag===1?n.stateNode:null})}catch(p){setTimeout(function(){throw p})}}function mm(t,n,l){return l=qn(l),l.tag=T1,l.payload={element:null},l.callback=function(){we(n.source,od,t,n)},l}function gm(t){return t=qn(t),t.tag=T1,t}function pm(t,n,l,f){var p=l.type.getDerivedStateFromError;if(typeof p=="function"){var y=f.value;t.payload=function(){return p(y)},t.callback=function(){wo(l),we(f.source,Q0,n,l,f)}}var A=l.stateNode;A!==null&&typeof A.componentDidCatch=="function"&&(t.callback=function(){wo(l),we(f.source,Q0,n,l,f),typeof p!="function"&&(ff===null?ff=new Set([this]):ff.add(this)),qN(this,f),typeof p=="function"||!(l.lanes&2)&&console.error("%s: Error boundaries should implement getDerivedStateFromError(). In that method, return a state update to display an error message or fallback UI.",$(l)||"Unknown")})}function Z0(t,n,l,f,p){if(l.flags|=32768,_l&&Rc(t,p),f!==null&&typeof f=="object"&&typeof f.then=="function"){if(n=l.alternate,n!==null&&Ls(n,l,p,!0),Rt&&(ho=!0),l=Vs.current,l!==null){switch(l.tag){case 31:case 13:return Bl===null?bc():l.alternate===null&&Ln===_u&&(Ln=FE),l.flags&=-257,l.flags|=65536,l.lanes=p,f===IE?l.flags|=16384:(n=l.updateQueue,n===null?l.updateQueue=new Set([f]):n.add(f),km(t,f,p)),!1;case 22:return l.flags|=65536,f===IE?l.flags|=16384:(n=l.updateQueue,n===null?(n={transitions:null,markerInstances:null,retryQueue:new Set([f])},l.updateQueue=n):(l=n.retryQueue,l===null?n.retryQueue=new Set([f]):l.add(f)),km(t,f,p)),!1}throw Error("Unexpected Suspense handler tag ("+l.tag+"). This is a bug in React.")}return km(t,f,p),bc(),!1}if(Rt)return ho=!0,n=Vs.current,n!==null?(!(n.flags&65536)&&(n.flags|=256),n.flags|=65536,n.lanes=p,f!==c1&&Gf(ji(Error("There was an error while hydrating but React was able to recover by instead client rendering from the nearest Suspense boundary.",{cause:f}),l))):(f!==c1&&Gf(ji(Error("There was an error while hydrating but React was able to recover by instead client rendering the entire root.",{cause:f}),l)),t=t.current.alternate,t.flags|=65536,p&=-p,t.lanes|=p,f=ji(f,l),p=mm(t.stateNode,f,p),qf(t,p),Ln!==rf&&(Ln=ih)),!1;var y=ji(Error("There was an error during concurrent rendering but React was able to recover by instead synchronously rendering the entire root.",{cause:f}),l);if(Yy===null?Yy=[y]:Yy.push(y),Ln!==rf&&(Ln=ih),n===null)return!0;f=ji(f,l),l=n;do{switch(l.tag){case 3:return l.flags|=65536,t=p&-p,l.lanes|=t,t=mm(l.stateNode,f,t),qf(l,t),!1;case 1:if(n=l.type,y=l.stateNode,(l.flags&128)===0&&(typeof n.getDerivedStateFromError=="function"||y!==null&&typeof y.componentDidCatch=="function"&&(ff===null||!ff.has(y))))return l.flags|=65536,p&=-p,l.lanes|=p,p=gm(p),pm(p,t,l,f),qf(l,p),!1}l=l.return}while(l!==null);return!1}function li(t,n,l,f){n.child=t===null?hL(n,null,l,f):th(n,t.child,l,f)}function mS(t,n,l,f,p){l=l.render;var y=n.ref;if("ref"in f){var A={};for(var L in f)L!=="ref"&&(A[L]=f[L])}else A=f;return Fr(n),f=H0(t,n,l,A,y,p),L=Ho(),t!==null&&!di?(Zf(t,n,p),ws(t,n,p)):(Rt&&L&&Kh(n),n.flags|=1,li(t,n,f,p),n.child)}function J0(t,n,l,f,p){if(t===null){var y=l.type;return typeof y=="function"&&!O0(y)&&y.defaultProps===void 0&&l.compare===null?(l=Nr(y),n.tag=15,n.type=l,gc(n,y),W0(t,n,l,f,p)):(t=No(l.type,null,f,n,n.mode,p),t.ref=n.ref,t.return=n,n.child=t)}if(y=t.child,!Tm(t,p)){var A=y.memoizedProps;if(l=l.compare,l=l!==null?l:Zu,l(A,f)&&t.ref===n.ref)return ws(t,n,p)}return n.flags|=1,t=al(y,f),t.ref=n.ref,t.return=n,n.child=t}function W0(t,n,l,f,p){if(t!==null){var y=t.memoizedProps;if(Zu(y,f)&&t.ref===n.ref&&n.type===t.type)if(di=!1,n.pendingProps=f=y,Tm(t,p))t.flags&131072&&(di=!0);else return n.lanes=t.lanes,ws(t,n,p)}return ip(t,n,l,f,p)}function ep(t,n,l,f){var p=f.children,y=t!==null?t.memoizedState:null;if(t===null&&n.stateNode===null&&(n.stateNode={_visibility:Ty,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.mode==="hidden"){if(n.flags&128){if(y=y!==null?y.baseLanes|l:l,t!==null){for(f=n.child=t.child,p=0;f!==null;)p=p|f.lanes|f.childLanes,f=f.sibling;f=p&~y}else f=0,n.child=null;return tp(t,n,y,l,f)}if(l&536870912)n.memoizedState={baseLanes:0,cachePool:null},t!==null&&ic(n,y!==null?y.cachePool:null),y!==null?nm(n,y):Wl(n),im(n);else return f=n.lanes=536870912,tp(t,n,y!==null?y.baseLanes|l:l,l,f)}else y!==null?(ic(n,y.cachePool),nm(n,y),cl(n),n.memoizedState=null):(t!==null&&ic(n,null),Wl(n),cl(n));return li(t,n,p,l),n.child}function Wo(t,n){return t!==null&&t.tag===22||n.stateNode!==null||(n.stateNode={_visibility:Ty,_pendingMarkers:null,_retryCache:null,_transitions:null}),n.sibling}function tp(t,n,l,f,p){var y=Jl();return y=y===null?null:{parent:ui._currentValue,pool:y},n.memoizedState={baseLanes:l,cachePool:y},t!==null&&ic(n,null),Wl(n),im(n),t!==null&&Ls(t,n,f,!0),n.childLanes=p,null}function ud(t,n){var l=n.hidden;return l!==void 0&&console.error(`<Activity> doesn't accept a hidden prop. Use mode="hidden" instead.
154
+ - <Activity %s>
155
+ + <Activity %s>`,l===!0?"hidden":l===!1?"hidden={false}":"hidden={...}",l?'mode="hidden"':'mode="visible"'),n=fd({mode:n.mode,children:n.children},t.mode),n.ref=t.ref,t.child=n,n.return=t,n}function np(t,n,l){return th(n,t.child,null,l),t=ud(n,n.pendingProps),t.flags|=2,ai(n),n.memoizedState=null,t}function gS(t,n,l){var f=n.pendingProps,p=(n.flags&128)!==0;if(n.flags&=-129,t===null){if(Rt){if(f.mode==="hidden")return t=ud(n,f),n.lanes=536870912,Wo(null,t);if(Ms(n),(t=yn)?(l=Gt(t,Ul),l=l!==null&&l.data===uh?l:null,l!==null&&(f={dehydrated:l,treeContext:sS(),retryLane:536870912,hydrationErrors:null},n.memoizedState=f,f=I0(l),f.return=n,n.child=f,sa=n,yn=null)):l=null,l===null)throw Oi(n,t),Ja(n);return n.lanes=536870912,null}return ud(n,f)}var y=t.memoizedState;if(y!==null){var A=y.dehydrated;if(Ms(n),p)if(n.flags&256)n.flags&=-257,n=np(t,n,l);else if(n.memoizedState!==null)n.child=t.child,n.flags|=128,n=null;else throw Error("Client rendering an Activity suspended it again. This is a bug in React.");else if(rS(),l&536870912&&Tc(n),di||Ls(t,n,l,!1),p=(l&t.childLanes)!==0,di||p){if(f=an,f!==null&&(A=Lf(f,l),A!==0&&A!==y.retryLane))throw y.retryLane=A,Ci(t,A),We(f,t,A),C1;bc(),n=np(t,n,l)}else t=y.treeContext,yn=wa(A.nextSibling),sa=n,Rt=!0,ef=null,ho=!1,js=null,Ul=!1,t!==null&&lS(n,t),n=ud(n,f),n.flags|=4096;return n}return y=t.child,f={mode:f.mode,children:f.children},l&536870912&&l&t.lanes&&Tc(n),t=al(y,f),t.ref=n.ref,n.child=t,t.return=n,t}function cd(t,n){var l=n.ref;if(l===null)t!==null&&t.ref!==null&&(n.flags|=4194816);else{if(typeof l!="function"&&typeof l!="object")throw Error("Expected ref to be a function, an object returned by React.createRef(), or undefined/null.");(t===null||t.ref!==l)&&(n.flags|=4194816)}}function ip(t,n,l,f,p){if(l.prototype&&typeof l.prototype.render=="function"){var y=Z(l)||"Unknown";NL[y]||(console.error("The <%s /> component appears to have a render method, but doesn't extend React.Component. This is likely to cause errors. Change %s to extend React.Component instead.",y,y),NL[y]=!0)}return n.mode&ga&&pr.recordLegacyContextWarning(n,null),t===null&&(gc(n,n.type),l.contextTypes&&(y=Z(l)||"Unknown",kL[y]||(kL[y]=!0,console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with React.useContext() instead. (https://react.dev/link/legacy-context)",y)))),Fr(n),l=H0(t,n,l,f,void 0,p),f=Ho(),t!==null&&!di?(Zf(t,n,p),ws(t,n,p)):(Rt&&f&&Kh(n),n.flags|=1,li(t,n,l,p),n.child)}function ap(t,n,l,f,p,y){return Fr(n),Du=-1,Fy=t!==null&&t.type!==n.type,n.updateQueue=null,l=Xf(n,f,l,p),In(t,n),f=Ho(),t!==null&&!di?(Zf(t,n,y),ws(t,n,y)):(Rt&&f&&Kh(n),n.flags|=1,li(t,n,l,y),n.child)}function eu(t,n,l,f,p){switch(d(n)){case!1:var y=n.stateNode,A=new n.type(n.memoizedProps,y.context).state;y.updater.enqueueSetState(y,A,null);break;case!0:n.flags|=128,n.flags|=65536,y=Error("Simulated error coming from DevTools");var L=p&-p;if(n.lanes|=L,A=an,A===null)throw Error("Expected a work-in-progress root. This is a bug in React. Please file an issue.");L=gm(L),pm(L,A,n,ji(y,n)),qf(n,L)}if(Fr(n),n.stateNode===null){if(A=Wc,y=l.contextType,"contextType"in l&&y!==null&&(y===void 0||y.$$typeof!==Gs)&&!IL.has(l)&&(IL.add(l),L=y===void 0?" However, it is set to undefined. This can be caused by a typo or by mixing up named and default imports. This can also happen due to a circular dependency, so try moving the createContext() call to a separate file.":typeof y!="object"?" However, it is set to a "+typeof y+".":y.$$typeof===ag?" Did you accidentally pass the Context.Consumer instead?":" However, it is set to an object with keys {"+Object.keys(y).join(", ")+"}.",console.error("%s defines an invalid contextType. contextType should point to the Context object returned by React.createContext().%s",Z(l)||"Component",L)),typeof y=="object"&&y!==null&&(A=wt(y)),y=new l(f,A),n.mode&ga){ut(!0);try{y=new l(f,A)}finally{ut(!1)}}if(A=n.memoizedState=y.state!==null&&y.state!==void 0?y.state:null,y.updater=L1,n.stateNode=y,y._reactInternals=n,y._reactInternalInstance=xL,typeof l.getDerivedStateFromProps=="function"&&A===null&&(A=Z(l)||"Component",RL.has(A)||(RL.add(A),console.error("`%s` uses `getDerivedStateFromProps` but its initial state is %s. This is not recommended. Instead, define the initial state by assigning an object to `this.state` in the constructor of `%s`. This ensures that `getDerivedStateFromProps` arguments have a consistent shape.",A,y.state===null?"null":"undefined",A))),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"){var N=L=A=null;if(typeof y.componentWillMount=="function"&&y.componentWillMount.__suppressDeprecationWarning!==!0?A="componentWillMount":typeof y.UNSAFE_componentWillMount=="function"&&(A="UNSAFE_componentWillMount"),typeof y.componentWillReceiveProps=="function"&&y.componentWillReceiveProps.__suppressDeprecationWarning!==!0?L="componentWillReceiveProps":typeof y.UNSAFE_componentWillReceiveProps=="function"&&(L="UNSAFE_componentWillReceiveProps"),typeof y.componentWillUpdate=="function"&&y.componentWillUpdate.__suppressDeprecationWarning!==!0?N="componentWillUpdate":typeof y.UNSAFE_componentWillUpdate=="function"&&(N="UNSAFE_componentWillUpdate"),A!==null||L!==null||N!==null){y=Z(l)||"Component";var U=typeof l.getDerivedStateFromProps=="function"?"getDerivedStateFromProps()":"getSnapshotBeforeUpdate()";LL.has(y)||(LL.add(y),console.error(`Unsafe legacy lifecycles will not be called for components using new component APIs.
156
+
157
+ %s uses %s but also contains the following legacy lifecycles:%s%s%s
158
+
159
+ The above lifecycles should be removed. Learn more about this warning here:
160
+ https://react.dev/link/unsafe-component-lifecycles`,y,U,A!==null?`
161
+ `+A:"",L!==null?`
162
+ `+L:"",N!==null?`
163
+ `+N:""))}}y=n.stateNode,A=Z(l)||"Component",y.render||(l.prototype&&typeof l.prototype.render=="function"?console.error("No `render` method found on the %s instance: did you accidentally return an object from the constructor?",A):console.error("No `render` method found on the %s instance: you may have forgotten to define `render`.",A)),!y.getInitialState||y.getInitialState.isReactClassApproved||y.state||console.error("getInitialState was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Did you mean to define a state property instead?",A),y.getDefaultProps&&!y.getDefaultProps.isReactClassApproved&&console.error("getDefaultProps was defined on %s, a plain JavaScript class. This is only supported for classes created using React.createClass. Use a static property to define defaultProps instead.",A),y.contextType&&console.error("contextType was defined as an instance property on %s. Use a static property to define contextType instead.",A),l.childContextTypes&&!ML.has(l)&&(ML.add(l),console.error("%s uses the legacy childContextTypes API which was removed in React 19. Use React.createContext() instead. (https://react.dev/link/legacy-context)",A)),l.contextTypes&&!OL.has(l)&&(OL.add(l),console.error("%s uses the legacy contextTypes API which was removed in React 19. Use React.createContext() with static contextType instead. (https://react.dev/link/legacy-context)",A)),typeof y.componentShouldUpdate=="function"&&console.error("%s has a method called componentShouldUpdate(). Did you mean shouldComponentUpdate()? The name is phrased as a question because the function is expected to return a value.",A),l.prototype&&l.prototype.isPureReactComponent&&typeof y.shouldComponentUpdate<"u"&&console.error("%s has a method called shouldComponentUpdate(). shouldComponentUpdate should not be used when extending React.PureComponent. Please extend React.Component if shouldComponentUpdate is used.",Z(l)||"A pure component"),typeof y.componentDidUnmount=="function"&&console.error("%s has a method called componentDidUnmount(). But there is no such lifecycle method. Did you mean componentWillUnmount()?",A),typeof y.componentDidReceiveProps=="function"&&console.error("%s has a method called componentDidReceiveProps(). But there is no such lifecycle method. If you meant to update the state in response to changing props, use componentWillReceiveProps(). If you meant to fetch data or run side-effects or mutations after React has updated the UI, use componentDidUpdate().",A),typeof y.componentWillRecieveProps=="function"&&console.error("%s has a method called componentWillRecieveProps(). Did you mean componentWillReceiveProps()?",A),typeof y.UNSAFE_componentWillRecieveProps=="function"&&console.error("%s has a method called UNSAFE_componentWillRecieveProps(). Did you mean UNSAFE_componentWillReceiveProps()?",A),L=y.props!==f,y.props!==void 0&&L&&console.error("When calling super() in `%s`, make sure to pass up the same props that your component's constructor was passed.",A),y.defaultProps&&console.error("Setting defaultProps as an instance property on %s is not supported and will be ignored. Instead, define defaultProps as a static property on %s.",A,A),typeof y.getSnapshotBeforeUpdate!="function"||typeof y.componentDidUpdate=="function"||DL.has(l)||(DL.add(l),console.error("%s: getSnapshotBeforeUpdate() should be used with componentDidUpdate(). This component defines getSnapshotBeforeUpdate() only.",Z(l))),typeof y.getDerivedStateFromProps=="function"&&console.error("%s: getDerivedStateFromProps() is defined as an instance method and will be ignored. Instead, declare it as a static method.",A),typeof y.getDerivedStateFromError=="function"&&console.error("%s: getDerivedStateFromError() is defined as an instance method and will be ignored. Instead, declare it as a static method.",A),typeof l.getSnapshotBeforeUpdate=="function"&&console.error("%s: getSnapshotBeforeUpdate() is defined as a static method and will be ignored. Instead, declare it as an instance method.",A),(L=y.state)&&(typeof L!="object"||Hn(L))&&console.error("%s.state: must be set to an object or null",A),typeof y.getChildContext=="function"&&typeof l.childContextTypes!="object"&&console.error("%s.getChildContext(): childContextTypes must be defined in order to use getChildContext().",A),y=n.stateNode,y.props=f,y.state=n.memoizedState,y.refs={},Tt(n),A=l.contextType,y.context=typeof A=="object"&&A!==null?wt(A):Wc,y.state===f&&(A=Z(l)||"Component",_L.has(A)||(_L.add(A),console.error("%s: It is not recommended to assign props directly to state because updates to props won't be reflected in state. In most cases, it is better to use props directly.",A))),n.mode&ga&&pr.recordLegacyContextWarning(n,y),pr.recordUnsafeLifecycleWarnings(n,y),y.state=n.memoizedState,A=l.getDerivedStateFromProps,typeof A=="function"&&(mc(n,l,A,f),y.state=n.memoizedState),typeof l.getDerivedStateFromProps=="function"||typeof y.getSnapshotBeforeUpdate=="function"||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(A=y.state,typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount(),A!==y.state&&(console.error("%s.componentWillMount(): Assigning directly to this.state is deprecated (except inside a component's constructor). Use setState instead.",$(n)||"Component"),L1.enqueueReplaceState(y,y.state,null)),ul(n,f,y,p),sc(),y.state=n.memoizedState),typeof y.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&gr)!==Je&&(n.flags|=134217728),y=!0}else if(t===null){y=n.stateNode;var J=n.memoizedProps;L=gl(l,J),y.props=L;var ee=y.context;N=l.contextType,A=Wc,typeof N=="object"&&N!==null&&(A=wt(N)),U=l.getDerivedStateFromProps,N=typeof U=="function"||typeof y.getSnapshotBeforeUpdate=="function",J=n.pendingProps!==J,N||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(J||ee!==A)&&ml(n,y,f,A),lf=!1;var j=n.memoizedState;y.state=j,ul(n,f,y,p),sc(),ee=n.memoizedState,J||j!==ee||lf?(typeof U=="function"&&(mc(n,l,U,f),ee=n.memoizedState),(L=lf||fm(n,l,L,f,j,ee,A))?(N||typeof y.UNSAFE_componentWillMount!="function"&&typeof y.componentWillMount!="function"||(typeof y.componentWillMount=="function"&&y.componentWillMount(),typeof y.UNSAFE_componentWillMount=="function"&&y.UNSAFE_componentWillMount()),typeof y.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&gr)!==Je&&(n.flags|=134217728)):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&gr)!==Je&&(n.flags|=134217728),n.memoizedProps=f,n.memoizedState=ee),y.props=f,y.state=ee,y.context=A,y=L):(typeof y.componentDidMount=="function"&&(n.flags|=4194308),(n.mode&gr)!==Je&&(n.flags|=134217728),y=!1)}else{y=n.stateNode,rl(t,n),A=n.memoizedProps,N=gl(l,A),y.props=N,U=n.pendingProps,j=y.context,ee=l.contextType,L=Wc,typeof ee=="object"&&ee!==null&&(L=wt(ee)),J=l.getDerivedStateFromProps,(ee=typeof J=="function"||typeof y.getSnapshotBeforeUpdate=="function")||typeof y.UNSAFE_componentWillReceiveProps!="function"&&typeof y.componentWillReceiveProps!="function"||(A!==U||j!==L)&&ml(n,y,f,L),lf=!1,j=n.memoizedState,y.state=j,ul(n,f,y,p),sc();var fe=n.memoizedState;A!==U||j!==fe||lf||t!==null&&t.dependencies!==null&&tc(t.dependencies)?(typeof J=="function"&&(mc(n,l,J,f),fe=n.memoizedState),(N=lf||fm(n,l,N,f,j,fe,L)||t!==null&&t.dependencies!==null&&tc(t.dependencies))?(ee||typeof y.UNSAFE_componentWillUpdate!="function"&&typeof y.componentWillUpdate!="function"||(typeof y.componentWillUpdate=="function"&&y.componentWillUpdate(f,fe,L),typeof y.UNSAFE_componentWillUpdate=="function"&&y.UNSAFE_componentWillUpdate(f,fe,L)),typeof y.componentDidUpdate=="function"&&(n.flags|=4),typeof y.getSnapshotBeforeUpdate=="function"&&(n.flags|=1024)):(typeof y.componentDidUpdate!="function"||A===t.memoizedProps&&j===t.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===t.memoizedProps&&j===t.memoizedState||(n.flags|=1024),n.memoizedProps=f,n.memoizedState=fe),y.props=f,y.state=fe,y.context=L,y=N):(typeof y.componentDidUpdate!="function"||A===t.memoizedProps&&j===t.memoizedState||(n.flags|=4),typeof y.getSnapshotBeforeUpdate!="function"||A===t.memoizedProps&&j===t.memoizedState||(n.flags|=1024),y=!1)}if(L=y,cd(t,n),A=(n.flags&128)!==0,L||A){if(L=n.stateNode,ya(n),A&&typeof l.getDerivedStateFromError!="function")l=null,za=-1;else if(l=WD(L),n.mode&ga){ut(!0);try{WD(L)}finally{ut(!1)}}n.flags|=1,t!==null&&A?(n.child=th(n,t.child,null,p),n.child=th(n,null,l,p)):li(t,n,l,p),n.memoizedState=L.state,t=n.child}else t=ws(t,n,p);return p=n.stateNode,y&&p.props!==f&&(Bg||console.error("It looks like %s is reassigning its own `this.props` while rendering. This is not supported and can lead to confusing bugs.",$(n)||"a component"),Bg=!0),t}function sp(t,n,l,f){return Br(),n.flags|=256,li(t,n,l,f),n.child}function gc(t,n){n&&n.childContextTypes&&console.error(`childContextTypes cannot be defined on a function component.
164
+ %s.childContextTypes = ...`,n.displayName||n.name||"Component"),typeof n.getDerivedStateFromProps=="function"&&(t=Z(n)||"Unknown",BL[t]||(console.error("%s: Function components do not support getDerivedStateFromProps.",t),BL[t]=!0)),typeof n.contextType=="object"&&n.contextType!==null&&(n=Z(n)||"Unknown",UL[n]||(console.error("%s: Function components do not support contextType.",n),UL[n]=!0))}function pc(t){return{baseLanes:t,cachePool:z0()}}function ym(t,n,l){return t=t!==null?t.childLanes&~l:0,n&&(t|=fs),t}function vm(t,n,l){var f,p=n.pendingProps;u(n)&&(n.flags|=128);var y=!1,A=(n.flags&128)!==0;if((f=A)||(f=t!==null&&t.memoizedState===null?!1:(Jn.current&By)!==0),f&&(y=!0,n.flags&=-129),f=(n.flags&32)!==0,n.flags&=-33,t===null){if(Rt){if(y?Ki(n):cl(n),(t=yn)?(l=Gt(t,Ul),l=l!==null&&l.data!==uh?l:null,l!==null&&(f={dehydrated:l,treeContext:sS(),retryLane:536870912,hydrationErrors:null},n.memoizedState=f,f=I0(l),f.return=n,n.child=f,sa=n,yn=null)):l=null,l===null)throw Oi(n,t),Ja(n);return zp(l)?n.lanes=32:n.lanes=536870912,null}var L=p.children;if(p=p.fallback,y){cl(n);var N=n.mode;return L=fd({mode:"hidden",children:L},N),p=Uo(p,N,l,null),L.return=n,p.return=n,L.sibling=p,n.child=L,p=n.child,p.memoizedState=pc(l),p.childLanes=ym(t,f,l),n.memoizedState=O1,Wo(null,p)}return Ki(n),lp(n,L)}var U=t.memoizedState;if(U!==null){var J=U.dehydrated;if(J!==null){if(A)n.flags&256?(Ki(n),n.flags&=-257,n=Sm(t,n,l)):n.memoizedState!==null?(cl(n),n.child=t.child,n.flags|=128,n=null):(cl(n),L=p.fallback,N=n.mode,p=fd({mode:"visible",children:p.children},N),L=Uo(L,N,l,null),L.flags|=2,p.return=n,L.return=n,p.sibling=L,n.child=p,th(n,t.child,null,l),p=n.child,p.memoizedState=pc(l),p.childLanes=ym(t,f,l),n.memoizedState=O1,n=Wo(null,p));else if(Ki(n),rS(),l&536870912&&Tc(n),zp(J)){if(f=J.nextSibling&&J.nextSibling.dataset,f){L=f.dgst;var ee=f.msg;N=f.stck;var j=f.cstck}y=ee,f=L,p=N,J=j,L=y,N=J,L=Error(L||"The server could not finish this Suspense boundary, likely due to an error during server rendering. Switched to client rendering."),L.stack=p||"",L.digest=f,f=N===void 0?null:N,p={value:L,source:null,stack:f},typeof f=="string"&&u1.set(L,p),Gf(p),n=Sm(t,n,l)}else if(di||Ls(t,n,l,!1),f=(l&t.childLanes)!==0,di||f){if(f=an,f!==null&&(p=Lf(f,l),p!==0&&p!==U.retryLane))throw U.retryLane=p,Ci(t,p),We(f,t,p),C1;Cd(J)||bc(),n=Sm(t,n,l)}else Cd(J)?(n.flags|=192,n.child=t.child,n=null):(t=U.treeContext,yn=wa(J.nextSibling),sa=n,Rt=!0,ef=null,ho=!1,js=null,Ul=!1,t!==null&&lS(n,t),n=lp(n,p.children),n.flags|=4096);return n}}return y?(cl(n),L=p.fallback,N=n.mode,j=t.child,J=j.sibling,p=al(j,{mode:"hidden",children:p.children}),p.subtreeFlags=j.subtreeFlags&65011712,J!==null?L=al(J,L):(L=Uo(L,N,l,null),L.flags|=2),L.return=n,p.return=n,p.sibling=L,n.child=p,Wo(null,p),p=n.child,L=t.child.memoizedState,L===null?L=pc(l):(N=L.cachePool,N!==null?(j=ui._currentValue,N=N.parent!==j?{parent:j,pool:j}:N):N=z0(),L={baseLanes:L.baseLanes|l,cachePool:N}),p.memoizedState=L,p.childLanes=ym(t,f,l),n.memoizedState=O1,Wo(t.child,p)):(U!==null&&(l&62914560)===l&&l&t.lanes&&Tc(n),Ki(n),l=t.child,t=l.sibling,l=al(l,{mode:"visible",children:p.children}),l.return=n,l.sibling=null,t!==null&&(f=n.deletions,f===null?(n.deletions=[t],n.flags|=16):f.push(t)),n.child=l,n.memoizedState=null,l)}function lp(t,n){return n=fd({mode:"visible",children:n},t.mode),n.return=t,t.child=n}function fd(t,n){return t=R(22,t,null,n),t.lanes=0,t}function Sm(t,n,l){return th(n,t.child,null,l),t=lp(n,n.pendingProps.children),t.flags|=2,n.memoizedState=null,t}function rp(t,n,l){t.lanes|=n;var f=t.alternate;f!==null&&(f.lanes|=n),Qh(t.return,n,l)}function Em(t,n,l,f,p,y){var A=t.memoizedState;A===null?t.memoizedState={isBackwards:n,rendering:null,renderingStartTime:0,last:f,tail:l,tailMode:p,treeForkCount:y}:(A.isBackwards=n,A.rendering=null,A.renderingStartTime=0,A.last=f,A.tail=l,A.tailMode=p,A.treeForkCount=y)}function op(t,n,l){var f=n.pendingProps,p=f.revealOrder,y=f.tail,A=f.children,L=Jn.current;if((f=(L&By)!==0)?(L=L&wg|By,n.flags|=128):L&=wg,De(Jn,L,n),L=p??"null",p!=="forwards"&&p!=="unstable_legacy-backwards"&&p!=="together"&&p!=="independent"&&!zL[L])if(zL[L]=!0,p==null)console.error('The default for the <SuspenseList revealOrder="..."> prop is changing. To be future compatible you must explictly specify either "independent" (the current default), "together", "forwards" or "legacy_unstable-backwards".');else if(p==="backwards")console.error('The rendering order of <SuspenseList revealOrder="backwards"> is changing. To be future compatible you must specify revealOrder="legacy_unstable-backwards" instead.');else if(typeof p=="string")switch(p.toLowerCase()){case"together":case"forwards":case"backwards":case"independent":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. Use lowercase "%s" instead.',p,p.toLowerCase());break;case"forward":case"backward":console.error('"%s" is not a valid value for revealOrder on <SuspenseList />. React uses the -s suffix in the spelling. Use "%ss" instead.',p,p.toLowerCase());break;default:console.error('"%s" is not a supported revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',p)}else console.error('%s is not a supported value for revealOrder on <SuspenseList />. Did you mean "independent", "together", "forwards" or "backwards"?',p);L=y??"null",zE[L]||(y==null?(p==="forwards"||p==="backwards"||p==="unstable_legacy-backwards")&&(zE[L]=!0,console.error('The default for the <SuspenseList tail="..."> prop is changing. To be future compatible you must explictly specify either "visible" (the current default), "collapsed" or "hidden".')):y!=="visible"&&y!=="collapsed"&&y!=="hidden"?(zE[L]=!0,console.error('"%s" is not a supported value for tail on <SuspenseList />. Did you mean "visible", "collapsed" or "hidden"?',y)):p!=="forwards"&&p!=="backwards"&&p!=="unstable_legacy-backwards"&&(zE[L]=!0,console.error('<SuspenseList tail="%s" /> is only valid if revealOrder is "forwards" or "backwards". Did you mean to specify revealOrder="forwards"?',y)));e:if((p==="forwards"||p==="backwards"||p==="unstable_legacy-backwards")&&A!==void 0&&A!==null&&A!==!1)if(Hn(A)){for(L=0;L<A.length;L++)if(!Wt(A[L],L))break e}else if(L=q(A),typeof L=="function"){if(L=L.call(A))for(var N=L.next(),U=0;!N.done;N=L.next()){if(!Wt(N.value,U))break e;U++}}else console.error('A single row was passed to a <SuspenseList revealOrder="%s" />. This is not useful since it needs multiple rows. Did you mean to pass multiple children or an array?',p);if(li(t,n,A,l),Rt?(kr(),A=by):A=0,!f&&t!==null&&t.flags&128)e:for(t=n.child;t!==null;){if(t.tag===13)t.memoizedState!==null&&rp(t,l,n);else if(t.tag===19)rp(t,l,n);else if(t.child!==null){t.child.return=t,t=t.child;continue}if(t===n)break e;for(;t.sibling===null;){if(t.return===null||t.return===n)break e;t=t.return}t.sibling.return=t.return,t=t.sibling}switch(p){case"forwards":for(l=n.child,p=null;l!==null;)t=l.alternate,t!==null&&$o(t)===null&&(p=l),l=l.sibling;l=p,l===null?(p=n.child,n.child=null):(p=l.sibling,l.sibling=null),Em(n,!1,p,l,y,A);break;case"backwards":case"unstable_legacy-backwards":for(l=null,p=n.child,n.child=null;p!==null;){if(t=p.alternate,t!==null&&$o(t)===null){n.child=p;break}t=p.sibling,p.sibling=l,l=p,p=t}Em(n,!0,l,null,y,A);break;case"together":Em(n,!1,null,null,void 0,A);break;default:n.memoizedState=null}return n.child}function ws(t,n,l){if(t!==null&&(n.dependencies=t.dependencies),za=-1,uf|=n.lanes,!(l&n.childLanes))if(t!==null){if(Ls(t,n,l,!1),(l&n.childLanes)===0)return null}else return null;if(t!==null&&n.child!==t.child)throw Error("Resuming work not yet implemented.");if(n.child!==null){for(t=n.child,l=al(t,t.pendingProps),n.child=l,l.return=n;t.sibling!==null;)t=t.sibling,l=l.sibling=al(t,t.pendingProps),l.return=n;l.sibling=null}return n.child}function Tm(t,n){return t.lanes&n?!0:(t=t.dependencies,!!(t!==null&&tc(t)))}function pS(t,n,l){switch(n.tag){case 3:Oe(n,n.stateNode.containerInfo),Wa(n,ui,t.memoizedState.cache),Br();break;case 27:case 5:le(n);break;case 4:Oe(n,n.stateNode.containerInfo);break;case 10:Wa(n,n.type,n.memoizedProps.value);break;case 12:l&n.childLanes&&(n.flags|=4),n.flags|=2048;var f=n.stateNode;f.effectDuration=-0,f.passiveEffectDuration=-0;break;case 31:if(n.memoizedState!==null)return n.flags|=128,Ms(n),null;break;case 13:if(f=n.memoizedState,f!==null)return f.dehydrated!==null?(Ki(n),n.flags|=128,null):l&n.child.childLanes?vm(t,n,l):(Ki(n),t=ws(t,n,l),t!==null?t.sibling:null);Ki(n);break;case 19:var p=(t.flags&128)!==0;if(f=(l&n.childLanes)!==0,f||(Ls(t,n,l,!1),f=(l&n.childLanes)!==0),p){if(f)return op(t,n,l);n.flags|=128}if(p=n.memoizedState,p!==null&&(p.rendering=null,p.tail=null,p.lastEffect=null),De(Jn,Jn.current,n),f)break;return null;case 22:return n.lanes=0,ep(t,n,l,n.pendingProps);case 24:Wa(n,ui,t.memoizedState.cache)}return ws(t,n,l)}function dd(t,n,l){if(n._debugNeedsRemount&&t!==null){l=No(n.type,n.key,n.pendingProps,n._debugOwner||null,n.mode,n.lanes),l._debugStack=n._debugStack,l._debugTask=n._debugTask;var f=n.return;if(f===null)throw Error("Cannot swap the root fiber.");if(t.alternate=null,n.alternate=null,l.index=n.index,l.sibling=n.sibling,l.return=n.return,l.ref=n.ref,l._debugInfo=n._debugInfo,n===f.child)f.child=l;else{var p=f.child;if(p===null)throw Error("Expected parent to have a child.");for(;p.sibling!==n;)if(p=p.sibling,p===null)throw Error("Expected to find the previous sibling.");p.sibling=l}return n=f.deletions,n===null?(f.deletions=[t],f.flags|=16):n.push(t),l.flags|=2,l}if(t!==null)if(t.memoizedProps!==n.pendingProps||n.type!==t.type)di=!0;else{if(!Tm(t,l)&&!(n.flags&128))return di=!1,pS(t,n,l);di=!!(t.flags&131072)}else di=!1,(f=Rt)&&(kr(),f=(n.flags&1048576)!==0),f&&(f=n.index,kr(),w0(n,by,f));switch(n.lanes=0,n.tag){case 16:e:if(f=n.pendingProps,t=Aa(n.elementType),n.type=t,typeof t=="function")O0(t)?(f=gl(t,f),n.tag=1,n.type=t=Nr(t),n=eu(null,n,t,f,l)):(n.tag=0,gc(n,t),n.type=t=Nr(t),n=ip(null,n,t,f,l));else{if(t!=null){if(p=t.$$typeof,p===Fc){n.tag=11,n.type=t=Yh(t),n=mS(null,n,t,f,l);break e}else if(p===Fd){n.tag=14,n=J0(null,n,t,f,l);break e}}throw n="",t!==null&&typeof t=="object"&&t.$$typeof===Ii&&(n=" Did you wrap a component in React.lazy() more than once?"),l=Z(t)||t,Error("Element type is invalid. Received a promise that resolves to: "+l+". Lazy element type must resolve to a class or function."+n)}return n;case 0:return ip(t,n,n.type,n.pendingProps,l);case 1:return f=n.type,p=gl(f,n.pendingProps),eu(t,n,f,p,l);case 3:e:{if(Oe(n,n.stateNode.containerInfo),t===null)throw Error("Should have a current fiber. This is a bug in React.");f=n.pendingProps;var y=n.memoizedState;p=y.element,rl(t,n),ul(n,f,null,l);var A=n.memoizedState;if(f=A.cache,Wa(n,ui,f),f!==y.cache&&Xl(n,[ui],l,!0),sc(),f=A.element,y.isDehydrated)if(y={element:f,isDehydrated:!1,cache:A.cache},n.updateQueue.baseState=y,n.memoizedState=y,n.flags&256){n=sp(t,n,f,l);break e}else if(f!==p){p=ji(Error("This root received an early update, before anything was able hydrate. Switched the entire root to client rendering."),n),Gf(p),n=sp(t,n,f,l);break e}else{switch(t=n.stateNode.containerInfo,t.nodeType){case 9:t=t.body;break;default:t=t.nodeName==="HTML"?t.ownerDocument.body:t}for(yn=wa(t.firstChild),sa=n,Rt=!0,ef=null,ho=!1,js=null,Ul=!0,l=hL(n,null,f,l),n.child=l;l;)l.flags=l.flags&-3|4096,l=l.sibling}else{if(Br(),f===p){n=ws(t,n,l);break e}li(t,n,f,l)}n=n.child}return n;case 26:return cd(t,n),t===null?(l=$p(n.type,null,n.pendingProps,null))?n.memoizedState=l:Rt||(l=n.type,t=n.pendingProps,f=Ie(Na.current),f=Ld(f).createElement(l),f[gn]=n,f[aa]=t,mn(f,l,t),On(f),n.stateNode=f):n.memoizedState=$p(n.type,t.memoizedProps,n.pendingProps,t.memoizedState),null;case 27:return le(n),t===null&&Rt&&(f=Ie(Na.current),p=ne(),f=n.stateNode=fr(n.type,n.pendingProps,f,p,!1),ho||(p=da(f,n.type,n.pendingProps,p),p!==null&&(ko(n,0).serverProps=p)),sa=n,Ul=!0,p=yn,so(n.type)?(W1=p,yn=wa(f.firstChild)):yn=p),li(t,n,n.pendingProps.children,l),cd(t,n),t===null&&(n.flags|=4194304),n.child;case 5:return t===null&&Rt&&(y=ne(),f=Mf(n.type,y.ancestorInfo),p=yn,(A=!p)||(A=YS(p,n.type,n.pendingProps,Ul),A!==null?(n.stateNode=A,ho||(y=da(A,n.type,n.pendingProps,y),y!==null&&(ko(n,0).serverProps=y)),sa=n,yn=wa(A.firstChild),Ul=!1,y=!0):y=!1,A=!y),A&&(f&&Oi(n,p),Ja(n))),le(n),p=n.type,y=n.pendingProps,A=t!==null?t.memoizedProps:null,f=y.children,Oc(p,y)?f=null:A!==null&&Oc(p,A)&&(n.flags|=32),n.memoizedState!==null&&(p=H0(t,n,Qf,null,null,l),tv._currentValue=p),cd(t,n),li(t,n,f,l),n.child;case 6:return t===null&&Rt&&(l=n.pendingProps,t=ne(),f=t.ancestorInfo.current,l=f!=null?If(l,f.tag,t.ancestorInfo.implicitRootScope):!0,t=yn,(f=!t)||(f=qS(t,n.pendingProps,Ul),f!==null?(n.stateNode=f,sa=n,yn=null,f=!0):f=!1,f=!f),f&&(l&&Oi(n,t),Ja(n))),null;case 13:return vm(t,n,l);case 4:return Oe(n,n.stateNode.containerInfo),f=n.pendingProps,t===null?n.child=th(n,null,f,l):li(t,n,f,l),n.child;case 11:return mS(t,n,n.type,n.pendingProps,l);case 7:return li(t,n,n.pendingProps,l),n.child;case 8:return li(t,n,n.pendingProps.children,l),n.child;case 12:return n.flags|=4,n.flags|=2048,f=n.stateNode,f.effectDuration=-0,f.passiveEffectDuration=-0,li(t,n,n.pendingProps.children,l),n.child;case 10:return f=n.type,p=n.pendingProps,y=p.value,"value"in p||FL||(FL=!0,console.error("The `value` prop is required for the `<Context.Provider>`. Did you misspell it or forget to pass it?")),Wa(n,f,y),li(t,n,p.children,l),n.child;case 9:return p=n.type._context,f=n.pendingProps.children,typeof f!="function"&&console.error("A context consumer was rendered with multiple children, or a child that isn't a function. A context consumer expects a single child that is a function. If you did pass a function, make sure there is no trailing or leading whitespace around it."),Fr(n),p=wt(p),f=y1(f,p,void 0),n.flags|=1,li(t,n,f,l),n.child;case 14:return J0(t,n,n.type,n.pendingProps,l);case 15:return W0(t,n,n.type,n.pendingProps,l);case 19:return op(t,n,l);case 31:return gS(t,n,l);case 22:return ep(t,n,l,n.pendingProps);case 24:return Fr(n),f=wt(ui),t===null?(p=Jl(),p===null&&(p=an,y=Zh(),p.pooledCache=y,zo(y),y!==null&&(p.pooledCacheLanes|=l),p=y),n.memoizedState={parent:f,cache:p},Tt(n),Wa(n,ui,p)):(t.lanes&l&&(rl(t,n),ul(n,null,null,l),sc()),p=t.memoizedState,y=n.memoizedState,p.parent!==f?(p={parent:f,cache:f},n.memoizedState=p,n.lanes===0&&(n.memoizedState=n.updateQueue.baseState=p),Wa(n,ui,f)):(f=y.cache,Wa(n,ui,f),f!==p.cache&&Xl(n,[ui],l,!0))),li(t,n,n.pendingProps.children,l),n.child;case 29:throw n.pendingProps}throw Error("Unknown unit of work tag ("+n.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function pl(t){t.flags|=4}function bm(t,n,l,f,p){if((n=(t.mode&$N)!==Je)&&(n=!1),n){if(t.flags|=16777216,(p&335544128)===p)if(t.stateNode.complete)t.flags|=8192;else if(Dp())t.flags|=8192;else throw eh=IE,S1}else t.flags&=-16777217}function yS(t,n){if(n.type!=="stylesheet"||(n.state.loading&Pl)!==dh)t.flags&=-16777217;else if(t.flags|=16777216,!St(n))if(Dp())t.flags|=8192;else throw eh=IE,S1}function yc(t,n){n!==null&&(t.flags|=4),t.flags&16384&&(n=t.tag!==22?Ya():536870912,t.lanes|=n,lh|=n)}function vc(t,n){if(!Rt)switch(t.tailMode){case"hidden":n=t.tail;for(var l=null;n!==null;)n.alternate!==null&&(l=n),n=n.sibling;l===null?t.tail=null:l.sibling=null;break;case"collapsed":l=t.tail;for(var f=null;l!==null;)l.alternate!==null&&(f=l),l=l.sibling;f===null?n||t.tail===null?t.tail=null:t.tail.sibling=null:f.sibling=null}}function Vt(t){var n=t.alternate!==null&&t.alternate.child===t.child,l=0,f=0;if(n)if((t.mode&mt)!==Je){for(var p=t.selfBaseDuration,y=t.child;y!==null;)l|=y.lanes|y.childLanes,f|=y.subtreeFlags&65011712,f|=y.flags&65011712,p+=y.treeBaseDuration,y=y.sibling;t.treeBaseDuration=p}else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,f|=p.subtreeFlags&65011712,f|=p.flags&65011712,p.return=t,p=p.sibling;else if((t.mode&mt)!==Je){p=t.actualDuration,y=t.selfBaseDuration;for(var A=t.child;A!==null;)l|=A.lanes|A.childLanes,f|=A.subtreeFlags,f|=A.flags,p+=A.actualDuration,y+=A.treeBaseDuration,A=A.sibling;t.actualDuration=p,t.treeBaseDuration=y}else for(p=t.child;p!==null;)l|=p.lanes|p.childLanes,f|=p.subtreeFlags,f|=p.flags,p.return=t,p=p.sibling;return t.subtreeFlags|=f,t.childLanes=l,n}function up(t,n,l){var f=n.pendingProps;switch(Xh(n),n.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(n),null;case 1:return Vt(n),null;case 3:return l=n.stateNode,f=null,t!==null&&(f=t.memoizedState.cache),n.memoizedState.cache!==f&&(n.flags|=2048),Ds(ui,n),F(n),l.pendingContext&&(l.context=l.pendingContext,l.pendingContext=null),(t===null||t.child===null)&&(Bo(n)?(zr(),pl(n)):t===null||t.memoizedState.isDehydrated&&!(n.flags&256)||(n.flags|=1024,Pf())),Vt(n),null;case 26:var p=n.type,y=n.memoizedState;return t===null?(pl(n),y!==null?(Vt(n),yS(n,y)):(Vt(n),bm(n,p,null,f,l))):y?y!==t.memoizedState?(pl(n),Vt(n),yS(n,y)):(Vt(n),n.flags&=-16777217):(t=t.memoizedProps,t!==f&&pl(n),Vt(n),bm(n,p,t,f,l)),null;case 27:if(xe(n),l=Ie(Na.current),p=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==f&&pl(n);else{if(!f){if(n.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Vt(n),null}t=ne(),Bo(n)?N0(n):(t=fr(p,f,l,t,!0),n.stateNode=t,pl(n))}return Vt(n),null;case 5:if(xe(n),p=n.type,t!==null&&n.stateNode!=null)t.memoizedProps!==f&&pl(n);else{if(!f){if(n.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");return Vt(n),null}var A=ne();if(Bo(n))N0(n);else{switch(y=Ie(Na.current),Mf(p,A.ancestorInfo),A=A.context,y=Ld(y),A){case Vg:y=y.createElementNS(ft,p);break;case aT:y=y.createElementNS(st,p);break;default:switch(p){case"svg":y=y.createElementNS(ft,p);break;case"math":y=y.createElementNS(st,p);break;case"script":y=y.createElement("div"),y.innerHTML="<script><\/script>",y=y.removeChild(y.firstChild);break;case"select":y=typeof f.is=="string"?y.createElement("select",{is:f.is}):y.createElement("select"),f.multiple?y.multiple=!0:f.size&&(y.size=f.size);break;default:y=typeof f.is=="string"?y.createElement(p,{is:f.is}):y.createElement(p),p.indexOf("-")===-1&&(p!==p.toLowerCase()&&console.error("<%s /> is using incorrect casing. Use PascalCase for React components, or lowercase for HTML elements.",p),Object.prototype.toString.call(y)!=="[object HTMLUnknownElement]"||Ua.call(u_,p)||(u_[p]=!0,console.error("The tag <%s> is unrecognized in this browser. If you meant to render a React component, start its name with an uppercase letter.",p)))}}y[gn]=n,y[aa]=f;e:for(A=n.child;A!==null;){if(A.tag===5||A.tag===6)y.appendChild(A.stateNode);else if(A.tag!==4&&A.tag!==27&&A.child!==null){A.child.return=A,A=A.child;continue}if(A===n)break e;for(;A.sibling===null;){if(A.return===null||A.return===n)break e;A=A.return}A.sibling.return=A.return,A=A.sibling}n.stateNode=y;e:switch(mn(y,p,f),p){case"button":case"input":case"select":case"textarea":f=!!f.autoFocus;break e;case"img":f=!0;break e;default:f=!1}f&&pl(n)}}return Vt(n),bm(n,n.type,t===null?null:t.memoizedProps,n.pendingProps,l),null;case 6:if(t&&n.stateNode!=null)t.memoizedProps!==f&&pl(n);else{if(typeof f!="string"&&n.stateNode===null)throw Error("We must have new props for new mounts. This error is likely caused by a bug in React. Please file an issue.");if(t=Ie(Na.current),l=ne(),Bo(n)){if(t=n.stateNode,l=n.memoizedProps,p=!ho,f=null,y=sa,y!==null)switch(y.tag){case 3:p&&(p=QS(t,l,f),p!==null&&(ko(n,0).serverProps=p));break;case 27:case 5:f=y.memoizedProps,p&&(p=QS(t,l,f),p!==null&&(ko(n,0).serverProps=p))}t[gn]=n,t=!!(t.nodeValue===l||f!==null&&f.suppressHydrationWarning===!0||kp(t.nodeValue,l)),t||Ja(n,!0)}else p=l.ancestorInfo.current,p!=null&&If(f,p.tag,l.ancestorInfo.implicitRootScope),t=Ld(t).createTextNode(f),t[gn]=n,n.stateNode=t}return Vt(n),null;case 31:if(l=n.memoizedState,t===null||t.memoizedState!==null){if(f=Bo(n),l!==null){if(t===null){if(!f)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(t=n.memoizedState,t=t!==null?t.dehydrated:null,!t)throw Error("Expected to have a hydrated activity instance. This error is likely caused by a bug in React. Please file an issue.");t[gn]=n,Vt(n),(n.mode&mt)!==Je&&l!==null&&(t=n.child,t!==null&&(n.treeBaseDuration-=t.treeBaseDuration))}else zr(),Br(),!(n.flags&128)&&(l=n.memoizedState=null),n.flags|=4,Vt(n),(n.mode&mt)!==Je&&l!==null&&(t=n.child,t!==null&&(n.treeBaseDuration-=t.treeBaseDuration));t=!1}else l=Pf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=l),t=!0;if(!t)return n.flags&256?(ai(n),n):(ai(n),null);if(n.flags&128)throw Error("Client rendering an Activity suspended it again. This is a bug in React.")}return Vt(n),null;case 13:if(f=n.memoizedState,t===null||t.memoizedState!==null&&t.memoizedState.dehydrated!==null){if(p=f,y=Bo(n),p!==null&&p.dehydrated!==null){if(t===null){if(!y)throw Error("A dehydrated suspense component was completed without a hydrated node. This is probably a bug in React.");if(y=n.memoizedState,y=y!==null?y.dehydrated:null,!y)throw Error("Expected to have a hydrated suspense instance. This error is likely caused by a bug in React. Please file an issue.");y[gn]=n,Vt(n),(n.mode&mt)!==Je&&p!==null&&(p=n.child,p!==null&&(n.treeBaseDuration-=p.treeBaseDuration))}else zr(),Br(),!(n.flags&128)&&(p=n.memoizedState=null),n.flags|=4,Vt(n),(n.mode&mt)!==Je&&p!==null&&(p=n.child,p!==null&&(n.treeBaseDuration-=p.treeBaseDuration));p=!1}else p=Pf(),t!==null&&t.memoizedState!==null&&(t.memoizedState.hydrationErrors=p),p=!0;if(!p)return n.flags&256?(ai(n),n):(ai(n),null)}return ai(n),n.flags&128?(n.lanes=l,(n.mode&mt)!==Je&&Po(n),n):(l=f!==null,t=t!==null&&t.memoizedState!==null,l&&(f=n.child,p=null,f.alternate!==null&&f.alternate.memoizedState!==null&&f.alternate.memoizedState.cachePool!==null&&(p=f.alternate.memoizedState.cachePool.pool),y=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(y=f.memoizedState.cachePool.pool),y!==p&&(f.flags|=2048)),l!==t&&l&&(n.child.flags|=8192),yc(n,n.updateQueue),Vt(n),(n.mode&mt)!==Je&&l&&(t=n.child,t!==null&&(n.treeBaseDuration-=t.treeBaseDuration)),null);case 4:return F(n),t===null&&io(n.stateNode.containerInfo),Vt(n),null;case 10:return Ds(n.type,n),Vt(n),null;case 19:if(Ee(Jn,n),f=n.memoizedState,f===null)return Vt(n),null;if(p=(n.flags&128)!==0,y=f.rendering,y===null)if(p)vc(f,!1);else{if(Ln!==_u||t!==null&&t.flags&128)for(t=n.child;t!==null;){if(y=$o(t),y!==null){for(n.flags|=128,vc(f,!1),t=y.updateQueue,n.updateQueue=t,yc(n,t),n.subtreeFlags=0,t=l,l=n.child;l!==null;)M0(l,t),l=l.sibling;return De(Jn,Jn.current&wg|By,n),Rt&&Rs(n,f.treeForkCount),n.child}t=t.sibling}f.tail!==null&&oi()>VE&&(n.flags|=128,p=!0,vc(f,!1),n.lanes=4194304)}else{if(!p)if(t=$o(y),t!==null){if(n.flags|=128,p=!0,t=t.updateQueue,n.updateQueue=t,yc(n,t),vc(f,!0),f.tail===null&&f.tailMode==="hidden"&&!y.alternate&&!Rt)return Vt(n),null}else 2*oi()-f.renderingStartTime>VE&&l!==536870912&&(n.flags|=128,p=!0,vc(f,!1),n.lanes=4194304);f.isBackwards?(y.sibling=n.child,n.child=y):(t=f.last,t!==null?t.sibling=y:n.child=y,f.last=y)}return f.tail!==null?(t=f.tail,f.rendering=t,f.tail=t.sibling,f.renderingStartTime=oi(),t.sibling=null,l=Jn.current,l=p?l&wg|By:l&wg,De(Jn,l,n),Rt&&Rs(n,f.treeForkCount),t):(Vt(n),null);case 22:case 23:return ai(n),Os(n),f=n.memoizedState!==null,t!==null?t.memoizedState!==null!==f&&(n.flags|=8192):f&&(n.flags|=8192),f?l&536870912&&!(n.flags&128)&&(Vt(n),n.subtreeFlags&6&&(n.flags|=8192)):Vt(n),l=n.updateQueue,l!==null&&yc(n,l.retryQueue),l=null,t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),f=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(f=n.memoizedState.cachePool.pool),f!==l&&(n.flags|=2048),t!==null&&Ee(Jd,n),null;case 24:return l=null,t!==null&&(l=t.memoizedState.cache),n.memoizedState.cache!==l&&(n.flags|=2048),Ds(ui,n),Vt(n),null;case 25:return null;case 30:return null}throw Error("Unknown unit of work tag ("+n.tag+"). This error is likely caused by a bug in React. Please file an issue.")}function vS(t,n){switch(Xh(n),n.tag){case 1:return t=n.flags,t&65536?(n.flags=t&-65537|128,(n.mode&mt)!==Je&&Po(n),n):null;case 3:return Ds(ui,n),F(n),t=n.flags,t&65536&&!(t&128)?(n.flags=t&-65537|128,n):null;case 26:case 27:case 5:return xe(n),null;case 31:if(n.memoizedState!==null){if(ai(n),n.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");Br()}return t=n.flags,t&65536?(n.flags=t&-65537|128,(n.mode&mt)!==Je&&Po(n),n):null;case 13:if(ai(n),t=n.memoizedState,t!==null&&t.dehydrated!==null){if(n.alternate===null)throw Error("Threw in newly mounted dehydrated component. This is likely a bug in React. Please file an issue.");Br()}return t=n.flags,t&65536?(n.flags=t&-65537|128,(n.mode&mt)!==Je&&Po(n),n):null;case 19:return Ee(Jn,n),null;case 4:return F(n),null;case 10:return Ds(n.type,n),null;case 22:case 23:return ai(n),Os(n),t!==null&&Ee(Jd,n),t=n.flags,t&65536?(n.flags=t&-65537|128,(n.mode&mt)!==Je&&Po(n),n):null;case 24:return Ds(ui,n),null;case 25:return null;default:return null}}function cp(t,n){switch(Xh(n),n.tag){case 3:Ds(ui,n),F(n);break;case 26:case 27:case 5:xe(n);break;case 4:F(n);break;case 31:n.memoizedState!==null&&ai(n);break;case 13:ai(n);break;case 19:Ee(Jn,n);break;case 10:Ds(n.type,n);break;case 22:case 23:ai(n),Os(n),t!==null&&Ee(Jd,n);break;case 24:Ds(ui,n)}}function yl(t){return(t.mode&mt)!==Je}function SS(t,n){yl(t)?(xn(),lr(n,t),Yi()):lr(n,t)}function xm(t,n,l){yl(t)?(xn(),Zr(l,t,n),Yi()):Zr(l,t,n)}function lr(t,n){try{var l=n.updateQueue,f=l!==null?l.lastEffect:null;if(f!==null){var p=f.next;l=p;do{if((l.tag&t)===t&&(f=void 0,(t&Fa)!==NE&&($g=!0),f=we(n,KN,l),(t&Fa)!==NE&&($g=!1),f!==void 0&&typeof f!="function")){var y=void 0;y=l.tag&Ys?"useLayoutEffect":l.tag&Fa?"useInsertionEffect":"useEffect";var A=void 0;A=f===null?" You returned null. If your effect does not require clean up, return undefined (or nothing).":typeof f.then=="function"?`
165
+
166
+ It looks like you wrote `+y+`(async () => ...) or returned a Promise. Instead, write the async function inside your effect and call it immediately:
167
+
168
+ `+y+`(() => {
169
+ async function fetchData() {
170
+ // You can await here
171
+ const response = await MyAPI.getData(someId);
172
+ // ...
173
+ }
174
+ fetchData();
175
+ }, [someId]); // Or [] if effect doesn't need props or state
176
+
177
+ Learn more about data fetching with Hooks: https://react.dev/link/hooks-data-fetching`:" You returned: "+f,we(n,function(L,N){console.error("%s must not return anything besides a function, which is used for clean-up.%s",L,N)},y,A)}l=l.next}while(l!==p)}}catch(L){ct(n,n.return,L)}}function Zr(t,n,l){try{var f=n.updateQueue,p=f!==null?f.lastEffect:null;if(p!==null){var y=p.next;f=y;do{if((f.tag&t)===t){var A=f.inst,L=A.destroy;L!==void 0&&(A.destroy=void 0,(t&Fa)!==NE&&($g=!0),p=n,we(p,XN,p,l,L),(t&Fa)!==NE&&($g=!1))}f=f.next}while(f!==y)}}catch(N){ct(n,n.return,N)}}function hd(t,n){yl(t)?(xn(),lr(n,t),Yi()):lr(n,t)}function Am(t,n,l){yl(t)?(xn(),Zr(l,t,n),Yi()):Zr(l,t,n)}function fp(t){var n=t.updateQueue;if(n!==null){var l=t.stateNode;t.type.defaultProps||"ref"in t.memoizedProps||Bg||(l.props!==t.memoizedProps&&console.error("Expected %s props to match memoized props before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",$(t)||"instance"),l.state!==t.memoizedState&&console.error("Expected %s state to match memoized state before processing the update queue. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",$(t)||"instance"));try{we(t,lc,n,l)}catch(f){ct(t,t.return,f)}}}function md(t,n,l){return t.getSnapshotBeforeUpdate(n,l)}function ES(t,n){var l=n.memoizedProps,f=n.memoizedState;n=t.stateNode,t.type.defaultProps||"ref"in t.memoizedProps||Bg||(n.props!==t.memoizedProps&&console.error("Expected %s props to match memoized props before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",$(t)||"instance"),n.state!==t.memoizedState&&console.error("Expected %s state to match memoized state before getSnapshotBeforeUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",$(t)||"instance"));try{var p=gl(t.type,l),y=we(t,md,n,p,f);l=PL,y!==void 0||l.has(t.type)||(l.add(t.type),we(t,function(){console.error("%s.getSnapshotBeforeUpdate(): A snapshot value (or null) must be returned. You have returned undefined.",$(t))})),n.__reactInternalSnapshotBeforeUpdate=y}catch(A){ct(t,t.return,A)}}function Rm(t,n,l){l.props=gl(t.type,t.memoizedProps),l.state=t.memoizedState,yl(t)?(xn(),we(t,sL,t,n,l),Yi()):we(t,sL,t,n,l)}function TS(t){var n=t.ref;if(n!==null){switch(t.tag){case 26:case 27:case 5:var l=t.stateNode;break;case 30:l=t.stateNode;break;default:l=t.stateNode}if(typeof n=="function")if(yl(t))try{xn(),t.refCleanup=n(l)}finally{Yi()}else t.refCleanup=n(l);else typeof n=="string"?console.error("String refs are no longer supported."):n.hasOwnProperty("current")||console.error("Unexpected ref object provided for %s. Use either a ref-setter function or React.createRef().",$(t)),n.current=l}}function tu(t,n){try{we(t,TS,t)}catch(l){ct(t,n,l)}}function as(t,n){var l=t.ref,f=t.refCleanup;if(l!==null)if(typeof f=="function")try{if(yl(t))try{xn(),we(t,f)}finally{Yi(t)}else we(t,f)}catch(p){ct(t,n,p)}finally{t.refCleanup=null,t=t.alternate,t!=null&&(t.refCleanup=null)}else if(typeof l=="function")try{if(yl(t))try{xn(),we(t,l,null)}finally{Yi(t)}else we(t,l,null)}catch(p){ct(t,n,p)}else l.current=null}function dp(t,n,l,f){var p=t.memoizedProps,y=p.id,A=p.onCommit;p=p.onRender,n=n===null?"mount":"update",_E&&(n="nested-update"),typeof p=="function"&&p(y,n,t.actualDuration,t.treeBaseDuration,t.actualStartTime,l),typeof A=="function"&&A(y,n,f,l)}function bS(t,n,l,f){var p=t.memoizedProps;t=p.id,p=p.onPostCommit,n=n===null?"mount":"update",_E&&(n="nested-update"),typeof p=="function"&&p(t,n,f,l)}function Jr(t){var n=t.type,l=t.memoizedProps,f=t.stateNode;try{we(t,US,f,n,l,t)}catch(p){ct(t,t.return,p)}}function Dm(t,n,l){try{we(t,Ym,t.stateNode,t.type,l,n,t)}catch(f){ct(t,t.return,f)}}function hp(t){return t.tag===5||t.tag===3||t.tag===26||t.tag===27&&so(t.type)||t.tag===4}function Lm(t){e:for(;;){for(;t.sibling===null;){if(t.return===null||hp(t.return))return null;t=t.return}for(t.sibling.return=t.return,t=t.sibling;t.tag!==5&&t.tag!==6&&t.tag!==18;){if(t.tag===27&&so(t.type)||t.flags&2||t.child===null||t.tag===4)continue e;t.child.return=t,t=t.child}if(!(t.flags&2))return t.stateNode}}function Sc(t,n,l){var f=t.tag;if(f===5||f===6)t=t.stateNode,n?(BS(l),(l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l).insertBefore(t,n)):(BS(l),n=l.nodeType===9?l.body:l.nodeName==="HTML"?l.ownerDocument.body:l,n.appendChild(t),l=l._reactRootContainer,l!=null||n.onclick!==null||(n.onclick=Qa));else if(f!==4&&(f===27&&so(t.type)&&(l=t.stateNode,n=null),t=t.child,t!==null))for(Sc(t,n,l),t=t.sibling;t!==null;)Sc(t,n,l),t=t.sibling}function gd(t,n,l){var f=t.tag;if(f===5||f===6)t=t.stateNode,n?l.insertBefore(t,n):l.appendChild(t);else if(f!==4&&(f===27&&so(t.type)&&(l=t.stateNode),t=t.child,t!==null))for(gd(t,n,l),t=t.sibling;t!==null;)gd(t,n,l),t=t.sibling}function mp(t){for(var n,l=t.return;l!==null;){if(hp(l)){n=l;break}l=l.return}if(n==null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");switch(n.tag){case 27:n=n.stateNode,l=Lm(t),gd(t,l,n);break;case 5:l=n.stateNode,n.flags&32&&(qm(l),n.flags&=-33),n=Lm(t),gd(t,n,l);break;case 3:case 4:n=n.stateNode.containerInfo,l=Lm(t),Sc(t,l,n);break;default:throw Error("Invalid host parent fiber. This error is likely caused by a bug in React. Please file an issue.")}}function gp(t){var n=t.stateNode,l=t.memoizedProps;try{we(t,Rl,t.type,l,n,t)}catch(f){ct(t,t.return,f)}}function pp(t,n){return n.tag===31?(n=n.memoizedState,t.memoizedState!==null&&n===null):n.tag===13?(t=t.memoizedState,n=n.memoizedState,t!==null&&t.dehydrated!==null&&(n===null||n.dehydrated===null)):n.tag===3?t.memoizedState.isDehydrated&&(n.flags&256)===0:!1}function Pb(t,n){if(t=t.containerInfo,Q1=oT,t=$h(t),x0(t)){if("selectionStart"in t)var l={start:t.selectionStart,end:t.selectionEnd};else e:{l=(l=t.ownerDocument)&&l.defaultView||window;var f=l.getSelection&&l.getSelection();if(f&&f.rangeCount!==0){l=f.anchorNode;var p=f.anchorOffset,y=f.focusNode;f=f.focusOffset;try{l.nodeType,y.nodeType}catch{l=null;break e}var A=0,L=-1,N=-1,U=0,J=0,ee=t,j=null;t:for(;;){for(var fe;ee!==l||p!==0&&ee.nodeType!==3||(L=A+p),ee!==y||f!==0&&ee.nodeType!==3||(N=A+f),ee.nodeType===3&&(A+=ee.nodeValue.length),(fe=ee.firstChild)!==null;)j=ee,ee=fe;for(;;){if(ee===t)break t;if(j===l&&++U===p&&(L=A),j===y&&++J===f&&(N=A),(fe=ee.nextSibling)!==null)break;ee=j,j=ee.parentNode}ee=fe}l=L===-1||N===-1?null:{start:L,end:N}}else l=null}l=l||{start:0,end:0}}else l=null;for(Z1={focusedElem:t,selectionRange:l},oT=!1,Ui=n;Ui!==null;)if(n=Ui,t=n.child,(n.subtreeFlags&1028)!==0&&t!==null)t.return=n,Ui=t;else for(;Ui!==null;){switch(t=n=Ui,l=t.alternate,p=t.flags,t.tag){case 0:if(p&4&&(t=t.updateQueue,t=t!==null?t.events:null,t!==null))for(l=0;l<t.length;l++)p=t[l],p.ref.impl=p.nextImpl;break;case 11:case 15:break;case 1:p&1024&&l!==null&&ES(t,l);break;case 3:if(p&1024){if(t=t.stateNode.containerInfo,l=t.nodeType,l===9)Ic(t);else if(l===1)switch(t.nodeName){case"HEAD":case"HTML":case"BODY":Ic(t);break;default:t.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if(p&1024)throw Error("This unit of work tag should not have side-effects. This error is likely caused by a bug in React. Please file an issue.")}if(t=n.sibling,t!==null){t.return=n.return,Ui=t;break}Ui=n.return}}function _m(t,n,l){var f=dn(),p=es(),y=ba(),A=ts(),L=l.flags;switch(l.tag){case 0:case 11:case 15:Ca(t,l),L&4&&SS(l,Ys|zl);break;case 1:if(Ca(t,l),L&4)if(t=l.stateNode,n===null)l.type.defaultProps||"ref"in l.memoizedProps||Bg||(t.props!==l.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",$(l)||"instance"),t.state!==l.memoizedState&&console.error("Expected %s state to match memoized state before componentDidMount. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",$(l)||"instance")),yl(l)?(xn(),we(l,v1,l,t),Yi()):we(l,v1,l,t);else{var N=gl(l.type,n.memoizedProps);n=n.memoizedState,l.type.defaultProps||"ref"in l.memoizedProps||Bg||(t.props!==l.memoizedProps&&console.error("Expected %s props to match memoized props before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.props`. Please file an issue.",$(l)||"instance"),t.state!==l.memoizedState&&console.error("Expected %s state to match memoized state before componentDidUpdate. This might either be because of a bug in React, or because a component reassigns its own `this.state`. Please file an issue.",$(l)||"instance")),yl(l)?(xn(),we(l,nL,l,t,N,n,t.__reactInternalSnapshotBeforeUpdate),Yi()):we(l,nL,l,t,N,n,t.__reactInternalSnapshotBeforeUpdate)}L&64&&fp(l),L&512&&tu(l,l.return);break;case 3:if(n=ll(),Ca(t,l),L&64&&(L=l.updateQueue,L!==null)){if(N=null,l.child!==null)switch(l.child.tag){case 27:case 5:N=l.child.stateNode;break;case 1:N=l.child.stateNode}try{we(l,lc,L,N)}catch(J){ct(l,l.return,J)}}t.effectDuration+=nc(n);break;case 27:n===null&&L&4&&gp(l);case 26:case 5:if(Ca(t,l),n===null){if(L&4)Jr(l);else if(L&64){t=l.type,n=l.memoizedProps,N=l.stateNode;try{we(l,kS,N,t,n,l)}catch(J){ct(l,l.return,J)}}}L&512&&tu(l,l.return);break;case 12:if(L&4){L=ll(),Ca(t,l),t=l.stateNode,t.effectDuration+=Vi(L);try{we(l,dp,l,n,tf,t.effectDuration)}catch(J){ct(l,l.return,J)}}else Ca(t,l);break;case 31:Ca(t,l),L&4&&vp(t,l);break;case 13:Ca(t,l),L&4&&Sp(t,l),L&64&&(t=l.memoizedState,t!==null&&(t=t.dehydrated,t!==null&&(L=or.bind(null,l),KS(t,L))));break;case 22:if(L=l.memoizedState!==null||Lu,!L){n=n!==null&&n.memoizedState!==null||hi,N=Lu;var U=hi;Lu=L,(hi=n)&&!U?(Ns(t,l,(l.subtreeFlags&8772)!==0),(l.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Hh(l,Ke,Qe)):Ca(t,l),Lu=N,hi=U}break;case 30:break;default:Ca(t,l)}(l.mode&mt)!==Je&&0<=Ke&&0<=Qe&&((kn||.05<Dn)&&As(l,Ke,Qe,Dn,bn),l.alternate===null&&l.return!==null&&l.return.alternate!==null&&.05<Qe-Ke&&(pp(l.return.alternate,l.return)||Za(l,Ke,Qe,"Mount"))),ni(f),Ta(p),bn=y,kn=A}function Nn(t){var n=t.alternate;n!==null&&(t.alternate=null,Nn(n)),t.child=null,t.deletions=null,t.sibling=null,t.tag===5&&(n=t.stateNode,n!==null&&Yn(n)),t.stateNode=null,t._debugOwner=null,t.return=null,t.dependencies=null,t.memoizedProps=null,t.memoizedState=null,t.pendingProps=null,t.stateNode=null,t.updateQueue=null}function on(t,n,l){for(l=l.child;l!==null;)yp(t,n,l),l=l.sibling}function yp(t,n,l){if(Qn&&typeof Qn.onCommitFiberUnmount=="function")try{Qn.onCommitFiberUnmount(mu,l)}catch(U){Ll||(Ll=!0,console.error("React instrumentation encountered an error: %o",U))}var f=dn(),p=es(),y=ba(),A=ts();switch(l.tag){case 26:hi||as(l,n),on(t,n,l),l.memoizedState?l.memoizedState.count--:l.stateNode&&(t=l.stateNode,t.parentNode.removeChild(t));break;case 27:hi||as(l,n);var L=mi,N=us;so(l.type)&&(mi=l.stateNode,us=!1),on(t,n,l),we(l,dr,l.stateNode),mi=L,us=N;break;case 5:hi||as(l,n);case 6:if(L=mi,N=us,mi=null,on(t,n,l),mi=L,us=N,mi!==null)if(us)try{we(l,FS,mi,l.stateNode)}catch(U){ct(l,n,U)}else try{we(l,zS,mi,l.stateNode)}catch(U){ct(l,n,U)}break;case 18:mi!==null&&(us?(t=mi,lu(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t,l.stateNode),cu(t)):lu(mi,l.stateNode));break;case 4:L=mi,N=us,mi=l.stateNode.containerInfo,us=!0,on(t,n,l),mi=L,us=N;break;case 0:case 11:case 14:case 15:Zr(Fa,l,n),hi||xm(l,n,Ys),on(t,n,l);break;case 1:hi||(as(l,n),L=l.stateNode,typeof L.componentWillUnmount=="function"&&Rm(l,n,L)),on(t,n,l);break;case 21:on(t,n,l);break;case 22:hi=(L=hi)||l.memoizedState!==null,on(t,n,l),hi=L;break;default:on(t,n,l)}(l.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(l,Ke,Qe,Dn,bn),ni(f),Ta(p),bn=y,kn=A}function vp(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null))){t=t.dehydrated;try{we(n,Km,t)}catch(l){ct(n,n.return,l)}}}function Sp(t,n){if(n.memoizedState===null&&(t=n.alternate,t!==null&&(t=t.memoizedState,t!==null&&(t=t.dehydrated,t!==null))))try{we(n,Pp,t)}catch(l){ct(n,n.return,l)}}function xS(t){switch(t.tag){case 31:case 13:case 19:var n=t.stateNode;return n===null&&(n=t.stateNode=new GL),n;case 22:return t=t.stateNode,n=t._retryCache,n===null&&(n=t._retryCache=new GL),n;default:throw Error("Unexpected Suspense handler tag ("+t.tag+"). This is a bug in React.")}}function Wr(t,n){var l=xS(t);n.forEach(function(f){if(!l.has(f)){if(l.add(f),_l)if(zg!==null&&Fg!==null)Rc(Fg,zg);else throw Error("Expected finished root and lanes to be set. This is a bug in React.");var p=au.bind(null,t,f);f.then(p,p)}})}function Zi(t,n){var l=n.deletions;if(l!==null)for(var f=0;f<l.length;f++){var p=t,y=n,A=l[f],L=dn(),N=y;e:for(;N!==null;){switch(N.tag){case 27:if(so(N.type)){mi=N.stateNode,us=!1;break e}break;case 5:mi=N.stateNode,us=!1;break e;case 3:case 4:mi=N.stateNode.containerInfo,us=!0;break e}N=N.return}if(mi===null)throw Error("Expected to find a host parent. This error is likely caused by a bug in React. Please file an issue.");yp(p,y,A),mi=null,us=!1,(A.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Za(A,Ke,Qe,"Unmount"),ni(L),p=A,y=p.alternate,y!==null&&(y.return=null),p.return=null}if(n.subtreeFlags&13886)for(n=n.child;n!==null;)pd(n,t),n=n.sibling}function pd(t,n){var l=dn(),f=es(),p=ba(),y=ts(),A=t.alternate,L=t.flags;switch(t.tag){case 0:case 11:case 14:case 15:Zi(n,t),Ji(t),L&4&&(Zr(Fa|zl,t,t.return),lr(Fa|zl,t),xm(t,t.return,Ys|zl));break;case 1:if(Zi(n,t),Ji(t),L&512&&(hi||A===null||as(A,A.return)),L&64&&Lu&&(L=t.updateQueue,L!==null&&(A=L.callbacks,A!==null))){var N=L.shared.hiddenCallbacks;L.shared.hiddenCallbacks=N===null?A:N.concat(A)}break;case 26:if(N=vr,Zi(n,t),Ji(t),L&512&&(hi||A===null||as(A,A.return)),L&4){var U=A!==null?A.memoizedState:null;if(L=t.memoizedState,A===null)if(L===null)if(t.stateNode===null){e:{L=t.type,A=t.memoizedProps,N=N.ownerDocument||N;t:switch(L){case"title":U=N.getElementsByTagName("title")[0],(!U||U[qc]||U[gn]||U.namespaceURI===ft||U.hasAttribute("itemprop"))&&(U=N.createElement(L),N.head.insertBefore(U,N.querySelector("head > title"))),mn(U,L,A),U[gn]=t,On(U),L=U;break e;case"link":var J=Uc("link","href",N).get(L+(A.href||""));if(J){for(var ee=0;ee<J.length;ee++)if(U=J[ee],U.getAttribute("href")===(A.href==null||A.href===""?null:A.href)&&U.getAttribute("rel")===(A.rel==null?null:A.rel)&&U.getAttribute("title")===(A.title==null?null:A.title)&&U.getAttribute("crossorigin")===(A.crossOrigin==null?null:A.crossOrigin)){J.splice(ee,1);break t}}U=N.createElement(L),mn(U,L,A),N.head.appendChild(U);break;case"meta":if(J=Uc("meta","content",N).get(L+(A.content||""))){for(ee=0;ee<J.length;ee++)if(U=J[ee],Pe(A.content,"content"),U.getAttribute("content")===(A.content==null?null:""+A.content)&&U.getAttribute("name")===(A.name==null?null:A.name)&&U.getAttribute("property")===(A.property==null?null:A.property)&&U.getAttribute("http-equiv")===(A.httpEquiv==null?null:A.httpEquiv)&&U.getAttribute("charset")===(A.charSet==null?null:A.charSet)){J.splice(ee,1);break t}}U=N.createElement(L),mn(U,L,A),N.head.appendChild(U);break;default:throw Error('getNodesForType encountered a type it did not expect: "'+L+'". This is a bug in React.')}U[gn]=t,On(U),L=U}t.stateNode=L}else JS(N,t.type,t.stateNode);else t.stateNode=Zm(N,L,t.memoizedProps);else U!==L?(U===null?A.stateNode!==null&&(A=A.stateNode,A.parentNode.removeChild(A)):U.count--,L===null?JS(N,t.type,t.stateNode):Zm(N,L,t.memoizedProps)):L===null&&t.stateNode!==null&&Dm(t,t.memoizedProps,A.memoizedProps)}break;case 27:Zi(n,t),Ji(t),L&512&&(hi||A===null||as(A,A.return)),A!==null&&L&4&&Dm(t,t.memoizedProps,A.memoizedProps);break;case 5:if(Zi(n,t),Ji(t),L&512&&(hi||A===null||as(A,A.return)),t.flags&32){N=t.stateNode;try{we(t,qm,N)}catch(ke){ct(t,t.return,ke)}}L&4&&t.stateNode!=null&&(N=t.memoizedProps,Dm(t,N,A!==null?A.memoizedProps:N)),L&1024&&(M1=!0,t.type!=="form"&&console.error("Unexpected host component type. Expected a form. This is a bug in React."));break;case 6:if(Zi(n,t),Ji(t),L&4){if(t.stateNode===null)throw Error("This should have a text node initialized. This error is likely caused by a bug in React. Please file an issue.");L=t.memoizedProps,A=A!==null?A.memoizedProps:L,N=t.stateNode;try{we(t,Gb,N,A,L)}catch(ke){ct(t,t.return,ke)}}break;case 3:if(N=ll(),sT=null,U=vr,vr=Xm(n.containerInfo),Zi(n,t),vr=U,Ji(t),L&4&&A!==null&&A.memoizedState.isDehydrated)try{we(t,Fp,n.containerInfo)}catch(ke){ct(t,t.return,ke)}M1&&(M1=!1,AS(t)),n.effectDuration+=nc(N);break;case 4:L=vr,vr=Xm(t.stateNode.containerInfo),Zi(n,t),Ji(t),vr=L;break;case 12:L=ll(),Zi(n,t),Ji(t),t.stateNode.effectDuration+=Vi(L);break;case 31:Zi(n,t),Ji(t),L&4&&(L=t.updateQueue,L!==null&&(t.updateQueue=null,Wr(t,L)));break;case 13:Zi(n,t),Ji(t),t.child.flags&8192&&t.memoizedState!==null!=(A!==null&&A.memoizedState!==null)&&(jE=oi()),L&4&&(L=t.updateQueue,L!==null&&(t.updateQueue=null,Wr(t,L)));break;case 22:N=t.memoizedState!==null;var j=A!==null&&A.memoizedState!==null,fe=Lu,Me=hi;if(Lu=fe||N,hi=Me||j,Zi(n,t),hi=Me,Lu=fe,j&&!N&&!fe&&!Me&&(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Hh(t,Ke,Qe),Ji(t),L&8192)e:for(n=t.stateNode,n._visibility=N?n._visibility&~Ty:n._visibility|Ty,!N||A===null||j||Lu||hi||(eo(t),(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Za(t,Ke,Qe,"Disconnect")),A=null,n=t;;){if(n.tag===5||n.tag===26){if(A===null){j=A=n;try{U=j.stateNode,N?we(j,GS,U):we(j,jS,j.stateNode,j.memoizedProps)}catch(ke){ct(j,j.return,ke)}}}else if(n.tag===6){if(A===null){j=n;try{J=j.stateNode,N?we(j,$S,J):we(j,VS,J,j.memoizedProps)}catch(ke){ct(j,j.return,ke)}}}else if(n.tag===18){if(A===null){j=n;try{ee=j.stateNode,N?we(j,PS,ee):we(j,HS,j.stateNode)}catch(ke){ct(j,j.return,ke)}}}else if((n.tag!==22&&n.tag!==23||n.memoizedState===null||n===t)&&n.child!==null){n.child.return=n,n=n.child;continue}if(n===t)break e;for(;n.sibling===null;){if(n.return===null||n.return===t)break e;A===n&&(A=null),n=n.return}A===n&&(A=null),n.sibling.return=n.return,n=n.sibling}L&4&&(L=t.updateQueue,L!==null&&(A=L.retryQueue,A!==null&&(L.retryQueue=null,Wr(t,A))));break;case 19:Zi(n,t),Ji(t),L&4&&(L=t.updateQueue,L!==null&&(t.updateQueue=null,Wr(t,L)));break;case 30:break;case 21:break;default:Zi(n,t),Ji(t)}(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&((kn||.05<Dn)&&As(t,Ke,Qe,Dn,bn),t.alternate===null&&t.return!==null&&t.return.alternate!==null&&.05<Qe-Ke&&(pp(t.return.alternate,t.return)||Za(t,Ke,Qe,"Mount"))),ni(l),Ta(f),bn=p,kn=y}function Ji(t){var n=t.flags;if(n&2){try{we(t,mp,t)}catch(l){ct(t,t.return,l)}t.flags&=-3}n&4096&&(t.flags&=-4097)}function AS(t){if(t.subtreeFlags&1024)for(t=t.child;t!==null;){var n=t;AS(n),n.tag===5&&n.flags&1024&&n.stateNode.reset(),t=t.sibling}}function Ca(t,n){if(n.subtreeFlags&8772)for(n=n.child;n!==null;)_m(t,n.alternate,n),n=n.sibling}function Cm(t){var n=dn(),l=es(),f=ba(),p=ts();switch(t.tag){case 0:case 11:case 14:case 15:xm(t,t.return,Ys),eo(t);break;case 1:as(t,t.return);var y=t.stateNode;typeof y.componentWillUnmount=="function"&&Rm(t,t.return,y),eo(t);break;case 27:we(t,dr,t.stateNode);case 26:case 5:as(t,t.return),eo(t);break;case 22:t.memoizedState===null&&eo(t);break;case 30:eo(t);break;default:eo(t)}(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(t,Ke,Qe,Dn,bn),ni(n),Ta(l),bn=f,kn=p}function eo(t){for(t=t.child;t!==null;)Cm(t),t=t.sibling}function Ep(t,n,l,f){var p=dn(),y=es(),A=ba(),L=ts(),N=l.flags;switch(l.tag){case 0:case 11:case 15:Ns(t,l,f),SS(l,Ys);break;case 1:if(Ns(t,l,f),n=l.stateNode,typeof n.componentDidMount=="function"&&we(l,v1,l,n),n=l.updateQueue,n!==null){t=l.stateNode;try{we(l,G0,n,t)}catch(U){ct(l,l.return,U)}}f&&N&64&&fp(l),tu(l,l.return);break;case 27:gp(l);case 26:case 5:Ns(t,l,f),f&&n===null&&N&4&&Jr(l),tu(l,l.return);break;case 12:if(f&&N&4){N=ll(),Ns(t,l,f),f=l.stateNode,f.effectDuration+=Vi(N);try{we(l,dp,l,n,tf,f.effectDuration)}catch(U){ct(l,l.return,U)}}else Ns(t,l,f);break;case 31:Ns(t,l,f),f&&N&4&&vp(t,l);break;case 13:Ns(t,l,f),f&&N&4&&Sp(t,l);break;case 22:l.memoizedState===null&&Ns(t,l,f),tu(l,l.return);break;case 30:break;default:Ns(t,l,f)}(l.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(l,Ke,Qe,Dn,bn),ni(p),Ta(y),bn=A,kn=L}function Ns(t,n,l){for(l=l&&(n.subtreeFlags&8772)!==0,n=n.child;n!==null;)Ep(t,n.alternate,n,l),n=n.sibling}function yd(t,n){var l=null;t!==null&&t.memoizedState!==null&&t.memoizedState.cachePool!==null&&(l=t.memoizedState.cachePool.pool),t=null,n.memoizedState!==null&&n.memoizedState.cachePool!==null&&(t=n.memoizedState.cachePool.pool),t!==l&&(t!=null&&zo(t),l!=null&&Hf(l))}function vd(t,n){t=null,n.alternate!==null&&(t=n.alternate.memoizedState.cache),n=n.memoizedState.cache,n!==t&&(zo(n),t!=null&&Hf(t))}function Oa(t,n,l,f,p){if(n.subtreeFlags&10256||n.actualDuration!==0&&(n.alternate===null||n.alternate.child!==n.child))for(n=n.child;n!==null;){var y=n.sibling;Tp(t,n,l,f,y!==null?y.actualStartTime:p),n=y}}function Tp(t,n,l,f,p){var y=dn(),A=es(),L=ba(),N=ts(),U=Zc,J=n.flags;switch(n.tag){case 0:case 11:case 15:(n.mode&mt)!==Je&&0<n.actualStartTime&&n.flags&1&&jh(n,n.actualStartTime,p,Ai,l),Oa(t,n,l,f,p),J&2048&&hd(n,Pa|zl);break;case 1:(n.mode&mt)!==Je&&0<n.actualStartTime&&(n.flags&128?R0(n,n.actualStartTime,p,[]):n.flags&1&&jh(n,n.actualStartTime,p,Ai,l)),Oa(t,n,l,f,p);break;case 3:var ee=ll(),j=Ai;Ai=n.alternate!==null&&n.alternate.memoizedState.isDehydrated&&(n.flags&256)===0,Oa(t,n,l,f,p),Ai=j,J&2048&&(l=null,n.alternate!==null&&(l=n.alternate.memoizedState.cache),f=n.memoizedState.cache,f!==l&&(zo(f),l!=null&&Hf(l))),t.passiveEffectDuration+=nc(ee);break;case 12:if(J&2048){J=ll(),Oa(t,n,l,f,p),t=n.stateNode,t.passiveEffectDuration+=Vi(J);try{we(n,bS,n,n.alternate,tf,t.passiveEffectDuration)}catch(fe){ct(n,n.return,fe)}}else Oa(t,n,l,f,p);break;case 31:J=Ai,ee=n.alternate!==null?n.alternate.memoizedState:null,j=n.memoizedState,ee!==null&&j===null?(j=n.deletions,j!==null&&0<j.length&&j[0].tag===18?(Ai=!1,ee=ee.hydrationErrors,ee!==null&&R0(n,n.actualStartTime,p,ee)):Ai=!0):Ai=!1,Oa(t,n,l,f,p),Ai=J;break;case 13:J=Ai,ee=n.alternate!==null?n.alternate.memoizedState:null,j=n.memoizedState,ee===null||ee.dehydrated===null||j!==null&&j.dehydrated!==null?Ai=!1:(j=n.deletions,j!==null&&0<j.length&&j[0].tag===18?(Ai=!1,ee=ee.hydrationErrors,ee!==null&&R0(n,n.actualStartTime,p,ee)):Ai=!0),Oa(t,n,l,f,p),Ai=J;break;case 23:break;case 22:j=n.stateNode,ee=n.alternate,n.memoizedState!==null?j._visibility&yu?Oa(t,n,l,f,p):nu(t,n,l,f,p):j._visibility&yu?Oa(t,n,l,f,p):(j._visibility|=yu,to(t,n,l,f,(n.subtreeFlags&10256)!==0||n.actualDuration!==0&&(n.alternate===null||n.alternate.child!==n.child),p),(n.mode&mt)===Je||Ai||(t=n.actualStartTime,0<=t&&.05<p-t&&Hh(n,t,p),0<=Ke&&0<=Qe&&.05<Qe-Ke&&Hh(n,Ke,Qe))),J&2048&&yd(ee,n);break;case 24:Oa(t,n,l,f,p),J&2048&&vd(n.alternate,n);break;default:Oa(t,n,l,f,p)}(n.mode&mt)!==Je&&((t=!Ai&&n.alternate===null&&n.return!==null&&n.return.alternate!==null)&&(l=n.actualStartTime,0<=l&&.05<p-l&&Za(n,l,p,"Mount")),0<=Ke&&0<=Qe&&((kn||.05<Dn)&&As(n,Ke,Qe,Dn,bn),t&&.05<Qe-Ke&&Za(n,Ke,Qe,"Mount"))),ni(y),Ta(A),bn=L,kn=N,Zc=U}function to(t,n,l,f,p,y){for(p=p&&((n.subtreeFlags&10256)!==0||n.actualDuration!==0&&(n.alternate===null||n.alternate.child!==n.child)),n=n.child;n!==null;){var A=n.sibling;Sd(t,n,l,f,p,A!==null?A.actualStartTime:y),n=A}}function Sd(t,n,l,f,p,y){var A=dn(),L=es(),N=ba(),U=ts(),J=Zc;p&&(n.mode&mt)!==Je&&0<n.actualStartTime&&n.flags&1&&jh(n,n.actualStartTime,y,Ai,l);var ee=n.flags;switch(n.tag){case 0:case 11:case 15:to(t,n,l,f,p,y),hd(n,Pa);break;case 23:break;case 22:var j=n.stateNode;n.memoizedState!==null?j._visibility&yu?to(t,n,l,f,p,y):nu(t,n,l,f,y):(j._visibility|=yu,to(t,n,l,f,p,y)),p&&ee&2048&&yd(n.alternate,n);break;case 24:to(t,n,l,f,p,y),p&&ee&2048&&vd(n.alternate,n);break;default:to(t,n,l,f,p,y)}(n.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(n,Ke,Qe,Dn,bn),ni(A),Ta(L),bn=N,kn=U,Zc=J}function nu(t,n,l,f,p){if(n.subtreeFlags&10256||n.actualDuration!==0&&(n.alternate===null||n.alternate.child!==n.child))for(var y=n.child;y!==null;){n=y.sibling;var A=t,L=l,N=f,U=n!==null?n.actualStartTime:p,J=Zc;(y.mode&mt)!==Je&&0<y.actualStartTime&&y.flags&1&&jh(y,y.actualStartTime,U,Ai,L);var ee=y.flags;switch(y.tag){case 22:nu(A,y,L,N,U),ee&2048&&yd(y.alternate,y);break;case 24:nu(A,y,L,N,U),ee&2048&&vd(y.alternate,y);break;default:nu(A,y,L,N,U)}Zc=J,y=n}}function iu(t,n,l){if(t.subtreeFlags&Gy)for(t=t.child;t!==null;)Om(t,n,l),t=t.sibling}function Om(t,n,l){switch(t.tag){case 26:iu(t,n,l),t.flags&Gy&&t.memoizedState!==null&&Vp(l,vr,t.memoizedState,t.memoizedProps);break;case 5:iu(t,n,l);break;case 3:case 4:var f=vr;vr=Xm(t.stateNode.containerInfo),iu(t,n,l),vr=f;break;case 22:t.memoizedState===null&&(f=t.alternate,f!==null&&f.memoizedState!==null?(f=Gy,Gy=16777216,iu(t,n,l),Gy=f):iu(t,n,l));break;default:iu(t,n,l)}}function bp(t){var n=t.alternate;if(n!==null&&(t=n.child,t!==null)){n.child=null;do n=t.sibling,t.sibling=null,t=n;while(t!==null)}}function Ma(t){var n=t.deletions;if(t.flags&16){if(n!==null)for(var l=0;l<n.length;l++){var f=n[l],p=dn();Ui=f,vl(f,t),(f.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Za(f,Ke,Qe,"Unmount"),ni(p)}bp(t)}if(t.subtreeFlags&10256)for(t=t.child;t!==null;)Mm(t),t=t.sibling}function Mm(t){var n=dn(),l=es(),f=ba(),p=ts();switch(t.tag){case 0:case 11:case 15:Ma(t),t.flags&2048&&Am(t,t.return,Pa|zl);break;case 3:var y=ll();Ma(t),t.stateNode.passiveEffectDuration+=nc(y);break;case 12:y=ll(),Ma(t),t.stateNode.passiveEffectDuration+=Vi(y);break;case 22:y=t.stateNode,t.memoizedState!==null&&y._visibility&yu&&(t.return===null||t.return.tag!==13)?(y._visibility&=~yu,Im(t),(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Za(t,Ke,Qe,"Disconnect")):Ma(t);break;default:Ma(t)}(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(t,Ke,Qe,Dn,bn),ni(n),Ta(l),kn=p,bn=f}function Im(t){var n=t.deletions;if(t.flags&16){if(n!==null)for(var l=0;l<n.length;l++){var f=n[l],p=dn();Ui=f,vl(f,t),(f.mode&mt)!==Je&&0<=Ke&&0<=Qe&&.05<Qe-Ke&&Za(f,Ke,Qe,"Unmount"),ni(p)}bp(t)}for(t=t.child;t!==null;)xp(t),t=t.sibling}function xp(t){var n=dn(),l=es(),f=ba(),p=ts();switch(t.tag){case 0:case 11:case 15:Am(t,t.return,Pa),Im(t);break;case 22:var y=t.stateNode;y._visibility&yu&&(y._visibility&=~yu,Im(t));break;default:Im(t)}(t.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(t,Ke,Qe,Dn,bn),ni(n),Ta(l),kn=p,bn=f}function vl(t,n){for(;Ui!==null;){var l=Ui,f=l,p=n,y=dn(),A=es(),L=ba(),N=ts();switch(f.tag){case 0:case 11:case 15:Am(f,p,Pa);break;case 23:case 22:f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(p=f.memoizedState.cachePool.pool,p!=null&&zo(p));break;case 24:Hf(f.memoizedState.cache)}if((f.mode&mt)!==Je&&0<=Ke&&0<=Qe&&(kn||.05<Dn)&&As(f,Ke,Qe,Dn,bn),ni(y),Ta(A),kn=N,bn=L,f=l.child,f!==null)f.return=l,Ui=f;else e:for(l=t;Ui!==null;){if(f=Ui,y=f.sibling,A=f.return,Nn(f),f===l){Ui=null;break e}if(y!==null){y.return=A,Ui=y;break e}Ui=A}}}function Ap(){eU.forEach(function(t){return t()})}function Rp(){var t=typeof IS_REACT_ACT_ENVIRONMENT<"u"?IS_REACT_ACT_ENVIRONMENT:void 0;return t||ge.actQueue===null||console.error("The current testing environment is not configured to support act(...)"),t}function Mi(t){if((Ot&Ri)!==ki&&pt!==0)return pt&-pt;var n=ge.T;return n!==null?(n._updatedFibers||(n._updatedFibers=new Set),n._updatedFibers.add(t),Up()):rt()}function Ec(){if(fs===0)if(!(pt&536870912)||Rt){var t=$d;$d<<=1,!($d&3932160)&&($d=262144),fs=t}else fs=536870912;return t=Vs.current,t!==null&&(t.flags|=32),fs}function We(t,n,l){if($g&&console.error("useInsertionEffect must not schedule updates."),$1&&(KE=!0),(t===an&&(Xt===ah||Xt===sh)||t.cancelPendingCommit!==null)&&(Sl(t,0),ss(t,pt,fs,!1)),Pn(t,l),(Ot&Ri)!==ki&&t===an){if(Dl)switch(n.tag){case 0:case 11:case 15:t=vt&&$(vt)||"Unknown",n_.has(t)||(n_.add(t),n=$(n)||"Unknown",console.error("Cannot update a component (`%s`) while rendering a different component (`%s`). To locate the bad setState() call inside `%s`, follow the stack trace as described in https://react.dev/link/setstate-in-render",n,t,t));break;case 1:t_||(console.error("Cannot update during an existing state transition (such as within `render`). Render methods should be a pure function of props and state."),t_=!0)}}else _l&&Si(t,n,l),xd(n),t===an&&((Ot&Ri)===ki&&(cf|=l),Ln===rf&&ss(t,pt,fs,!1)),ca(t)}function RS(t,n,l){if((Ot&(Ri|qs))!==ki)throw Error("Should not already be working.");if(pt!==0&&vt!==null){var f=vt,p=oi();switch(KD){case jy:case ah:var y=Ly;pn&&((f=f._debugTask)?f.run(console.timeStamp.bind(console,"Suspended",y,p,Ol,void 0,"primary-light")):console.timeStamp("Suspended",y,p,Ol,void 0,"primary-light"));break;case sh:y=Ly,pn&&((f=f._debugTask)?f.run(console.timeStamp.bind(console,"Action",y,p,Ol,void 0,"primary-light")):console.timeStamp("Action",y,p,Ol,void 0,"primary-light"));break;default:pn&&(f=p-Ly,3>f||console.timeStamp("Blocked",Ly,p,Ol,void 0,5>f?"primary-light":10>f?"primary":100>f?"primary-dark":"error"))}}y=(l=!l&&(n&127)===0&&(n&t.expiredLanes)===0||fn(t,n))?rr(t,n):xc(t,n,!0);var A=l;do{if(y===_u){Pg&&!l&&ss(t,n,0,!1),n=Xt,Ly=ci(),KD=n;break}else{if(f=oi(),p=t.current.alternate,A&&!LS(p)){xs(n),p=Ni,y=f,!pn||y<=p||(jn?jn.run(console.timeStamp.bind(console,"Teared Render",p,y,_t,Dt,"error")):console.timeStamp("Teared Render",p,y,_t,Dt,"error")),no(n,f),y=xc(t,n,!1),A=!1;continue}if(y===ih){if(A=n,t.errorRecoveryDisabledLanes&A)var L=0;else L=t.pendingLanes&-536870913,L=L!==0?L:L&536870912?536870912:0;if(L!==0){xs(n),D0(Ni,f,n,jn),no(n,f),n=L;e:{f=t,y=A,A=Yy;var N=f.current.memoizedState.isDehydrated;if(N&&(Sl(f,L).flags|=256),L=xc(f,L,!1),L!==ih){if(N1&&!N){f.errorRecoveryDisabledLanes|=y,cf|=y,y=rf;break e}f=Ga,Ga=A,f!==null&&(Ga===null?Ga=f:Ga.push.apply(Ga,f))}y=L}if(A=!1,y!==ih)continue;f=oi()}}if(y===Hy){xs(n),D0(Ni,f,n,jn),no(n,f),Sl(t,0),ss(t,n,0,!0);break}e:{switch(l=t,y){case _u:case Hy:throw Error("Root did not complete. This is a bug in React.");case rf:if((n&4194048)!==n)break;case PE:xs(n),tS(Ni,f,n,jn),no(n,f),p=n,p&127?RE=f:p&4194048&&(DE=f),ss(l,n,fs,!of);break e;case ih:Ga=null;break;case FE:case $L:break;default:throw Error("Unknown root exit status.")}if(ge.actQueue!==null)en(l,p,n,Ga,qy,HE,fs,cf,lh,y,null,null,Ni,f);else{if((n&62914560)===n&&(A=jE+VL-oi(),10<A)){if(ss(l,n,fs,!of),jl(l,0,!0)!==0)break e;Sr=n,l.timeoutHandle=c_(DS.bind(null,l,p,Ga,qy,HE,n,fs,cf,lh,of,y,"Throttled",Ni,f),A);break e}DS(l,p,Ga,qy,HE,n,fs,cf,lh,of,y,null,Ni,f)}}}break}while(!0);ca(t)}function DS(t,n,l,f,p,y,A,L,N,U,J,ee,j,fe){t.timeoutHandle=fh;var Me=n.subtreeFlags,ke=null;if((Me&8192||(Me&16785408)===16785408)&&(ke={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Qa},Om(n,y,ke),Me=(y&62914560)===y?jE-oi():(y&4194048)===y?jL-oi():0,Me=Jm(ke,Me),Me!==null)){Sr=y,t.cancelPendingCommit=Me(en.bind(null,t,n,y,l,f,p,A,L,N,J,ke,ke.waitingForViewTransition?"Waiting for the previous Animation":0<ke.count?0<ke.imgCount?"Suspended on CSS and Images":"Suspended on CSS":ke.imgCount===1?"Suspended on an Image":0<ke.imgCount?"Suspended on Images":null,j,fe)),ss(t,y,A,!U);return}en(t,n,y,l,f,p,A,L,N,J,ke,ee,j,fe)}function LS(t){for(var n=t;;){var l=n.tag;if((l===0||l===11||l===15)&&n.flags&16384&&(l=n.updateQueue,l!==null&&(l=l.stores,l!==null)))for(var f=0;f<l.length;f++){var p=l[f],y=p.getSnapshot;p=p.value;try{if(!Ba(y(),p))return!1}catch{return!1}}if(l=n.child,n.subtreeFlags&16384&&l!==null)l.return=n,n=l;else{if(n===t)break;for(;n.sibling===null;){if(n.return===null||n.return===t)return!0;n=n.return}n.sibling.return=n.return,n=n.sibling}}return!0}function ss(t,n,l,f){n&=~U1,n&=~cf,t.suspendedLanes|=n,t.pingedLanes&=~n,f&&(t.warmLanes|=n),f=t.expirationTimes;for(var p=n;0<p;){var y=31-bi(p),A=1<<y;f[y]=-1,p&=~A}l!==0&&bo(t,l,n)}function Ia(){return(Ot&(Ri|qs))===ki?(Tl(0),!1):!0}function wm(){if(vt!==null){if(Xt===cs)var t=vt.return;else t=vt,ec(),Gr(t),Mg=null,ky=0,t=vt;for(;t!==null;)cp(t.alternate,t),t=t.return;vt=null}}function no(t,n){t&127&&(Kd=n),t&4194048&&(bu=n),t&62914560&&(YD=n),t&2080374784&&(qD=n)}function Sl(t,n){pn&&(console.timeStamp("Blocking Track",.003,.003,"Blocking",Dt,"primary-light"),console.timeStamp("Transition Track",.003,.003,"Transition",Dt,"primary-light"),console.timeStamp("Suspense Track",.003,.003,"Suspense",Dt,"primary-light"),console.timeStamp("Idle Track",.003,.003,"Idle",Dt,"primary-light"));var l=Ni;if(Ni=ci(),pt!==0&&0<l){if(xs(pt),Ln===FE||Ln===rf)tS(l,Ni,n,jn);else{var f=Ni,p=jn;if(pn&&!(f<=l)){var y=(n&738197653)===n?"tertiary-dark":"primary-dark",A=(n&536870912)===n?"Prewarm":(n&201326741)===n?"Interrupted Hydration":"Interrupted Render";p?p.run(console.timeStamp.bind(console,A,l,f,_t,Dt,y)):console.timeStamp(A,l,f,_t,Dt,y)}}no(pt,Ni)}if(l=jn,jn=null,n&127){jn=Ay,p=0<=mo&&mo<Kd?Kd:mo,f=0<=Xd&&Xd<Kd?Kd:Xd,y=0<=f?f:0<=p?p:Ni,0<=RE?(xs(2),nS(RE,y,n,l)):LE&127,l=p;var L=f,N=Ry,U=0<_g,J=nf===xy,ee=nf===AE;if(p=Ni,f=Ay,y=h1,A=m1,pn){if(_t="Blocking",0<l?l>p&&(l=p):l=p,0<L?L>l&&(L=l):L=l,N!==null&&l>L){var j=U?"secondary-light":"warning";f?f.run(console.timeStamp.bind(console,U?"Consecutive":"Event: "+N,L,l,_t,Dt,j)):console.timeStamp(U?"Consecutive":"Event: "+N,L,l,_t,Dt,j)}p>l&&(L=J?"error":(n&738197653)===n?"tertiary-light":"primary-light",J=ee?"Promise Resolved":J?"Cascading Update":5<p-l?"Update Blocked":"Update",ee=[],A!=null&&ee.push(["Component name",A]),y!=null&&ee.push(["Method name",y]),l={start:l,end:p,detail:{devtools:{properties:ee,track:_t,trackGroup:Dt,color:L}}},f?f.run(performance.measure.bind(performance,J,l)):performance.measure(J,l))}mo=-1.1,nf=0,m1=h1=null,RE=-1.1,_g=Xd,Xd=-1.1,Kd=ci()}if(n&4194048&&(jn=Dy,p=0<=xu&&xu<bu?bu:xu,l=0<=kl&&kl<bu?bu:kl,f=0<=af&&af<bu?bu:af,y=0<=f?f:0<=l?l:Ni,0<=DE?(xs(256),nS(DE,y,n,jn)):LE&4194048,ee=f,L=Qd,N=0<sf,U=g1===AE,y=Ni,f=Dy,A=jD,J=VD,pn&&(_t="Transition",0<l?l>y&&(l=y):l=y,0<p?p>l&&(p=l):p=l,0<ee?ee>p&&(ee=p):ee=p,p>ee&&L!==null&&(j=N?"secondary-light":"warning",f?f.run(console.timeStamp.bind(console,N?"Consecutive":"Event: "+L,ee,p,_t,Dt,j)):console.timeStamp(N?"Consecutive":"Event: "+L,ee,p,_t,Dt,j)),l>p&&(f?f.run(console.timeStamp.bind(console,"Action",p,l,_t,Dt,"primary-dark")):console.timeStamp("Action",p,l,_t,Dt,"primary-dark")),y>l&&(p=U?"Promise Resolved":5<y-l?"Update Blocked":"Update",ee=[],J!=null&&ee.push(["Component name",J]),A!=null&&ee.push(["Method name",A]),l={start:l,end:y,detail:{devtools:{properties:ee,track:_t,trackGroup:Dt,color:"primary-light"}}},f?f.run(performance.measure.bind(performance,p,l)):performance.measure(p,l))),kl=xu=-1.1,g1=0,DE=-1.1,sf=af,af=-1.1,bu=ci()),n&62914560&&LE&62914560&&(xs(4194304),L0(YD,Ni)),n&2080374784&&LE&2080374784&&(xs(268435456),L0(qD,Ni)),l=t.timeoutHandle,l!==fh&&(t.timeoutHandle=fh,hU(l)),l=t.cancelPendingCommit,l!==null&&(t.cancelPendingCommit=null,l()),Sr=0,wm(),an=t,vt=l=al(t.current,null),pt=n,Xt=cs,Ks=null,of=!1,Pg=fn(t,n),N1=!1,Ln=_u,lh=fs=U1=cf=uf=0,Ga=Yy=null,HE=!1,n&8&&(n|=n&32),f=t.entangledLanes,f!==0)for(t=t.entanglements,f&=n;0<f;)p=31-bi(f),y=1<<p,n|=t[p],f&=~y;return po=n,Vh(),t=zD(),1e3<t-BD&&(ge.recentlyCreatedOwnerStacks=0,BD=t),pr.discardPendingWarnings(),l}function Us(t,n){tt=null,ge.H=Py,ge.getCurrentStack=null,Dl=!1,ma=null,n===Og||n===ME?(n=Go(),Xt=jy):n===S1?(n=Go(),Xt=HL):Xt=n===C1?w1:n!==null&&typeof n=="object"&&typeof n.then=="function"?Vy:GE,Ks=n;var l=vt;l===null?(Ln=Hy,od(t,ji(n,t.current))):l.mode&mt&&Jh(l)}function Dp(){var t=Vs.current;return t===null?!0:(pt&4194048)===pt?Bl===null:(pt&62914560)===pt||pt&536870912?t===Bl:!1}function Nm(){var t=ge.H;return ge.H=Py,t===null?Py:t}function Lp(){var t=ge.A;return ge.A=WN,t}function Tc(t){jn===null&&(jn=t._debugTask==null?null:t._debugTask)}function bc(){Ln=rf,of||(pt&4194048)!==pt&&Vs.current!==null||(Pg=!0),!(uf&134217727)&&!(cf&134217727)||an===null||ss(an,pt,fs,!1)}function xc(t,n,l){var f=Ot;Ot|=Ri;var p=Nm(),y=Lp();if(an!==t||pt!==n){if(_l){var A=t.memoizedUpdaters;0<A.size&&(Rc(t,pt),A.clear()),Ka(t,n)}qy=null,Sl(t,n)}n=!1,A=Ln;e:do try{if(Xt!==cs&&vt!==null){var L=vt,N=Ks;switch(Xt){case w1:wm(),A=PE;break e;case jy:case ah:case sh:case Vy:Vs.current===null&&(n=!0);var U=Xt;if(Xt=cs,Ks=null,Ac(t,L,N,U),l&&Pg){A=_u;break e}break;default:U=Xt,Xt=cs,Ks=null,Ac(t,L,N,U)}}_p(),A=Ln;break}catch(J){Us(t,J)}while(!0);return n&&t.shellSuspendCounter++,ec(),Ot=f,ge.H=p,ge.A=y,vt===null&&(an=null,pt=0,Vh()),A}function _p(){for(;vt!==null;)Um(vt)}function rr(t,n){var l=Ot;Ot|=Ri;var f=Nm(),p=Lp();if(an!==t||pt!==n){if(_l){var y=t.memoizedUpdaters;0<y.size&&(Rc(t,pt),y.clear()),Ka(t,n)}qy=null,VE=oi()+YL,Sl(t,n)}else Pg=fn(t,n);e:do try{if(Xt!==cs&&vt!==null)t:switch(n=vt,y=Ks,Xt){case GE:Xt=cs,Ks=null,Ac(t,n,y,GE);break;case ah:case sh:if(F0(y)){Xt=cs,Ks=null,Cp(n);break}n=function(){Xt!==ah&&Xt!==sh||an!==t||(Xt=$E),ca(t)},y.then(n,n);break e;case jy:Xt=$E;break e;case HL:Xt=I1;break e;case $E:F0(y)?(Xt=cs,Ks=null,Cp(n)):(Xt=cs,Ks=null,Ac(t,n,y,$E));break;case I1:var A=null;switch(vt.tag){case 26:A=vt.memoizedState;case 5:case 27:var L=vt;if(A?St(A):L.stateNode.complete){Xt=cs,Ks=null;var N=L.sibling;if(N!==null)vt=N;else{var U=L.return;U!==null?(vt=U,Ed(U)):vt=null}break t}break;default:console.error("Unexpected type of fiber triggered a suspensey commit. This is a bug in React.")}Xt=cs,Ks=null,Ac(t,n,y,I1);break;case Vy:Xt=cs,Ks=null,Ac(t,n,y,Vy);break;case w1:wm(),Ln=PE;break e;default:throw Error("Unexpected SuspendedReason. This is a bug in React.")}ge.actQueue!==null?_p():$n();break}catch(J){Us(t,J)}while(!0);return ec(),ge.H=f,ge.A=p,Ot=l,vt!==null?_u:(an=null,pt=0,Vh(),Ln)}function $n(){for(;vt!==null&&!ug();)Um(vt)}function Um(t){var n=t.alternate;(t.mode&mt)!==Je?(Ql(t),n=we(t,dd,n,t,po),Jh(t)):n=we(t,dd,n,t,po),t.memoizedProps=t.pendingProps,n===null?Ed(t):vt=n}function Cp(t){var n=we(t,ri,t);t.memoizedProps=t.pendingProps,n===null?Ed(t):vt=n}function ri(t){var n=t.alternate,l=(t.mode&mt)!==Je;switch(l&&Ql(t),t.tag){case 15:case 0:n=ap(n,t,t.pendingProps,t.type,void 0,pt);break;case 11:n=ap(n,t,t.pendingProps,t.type.render,t.ref,pt);break;case 5:Gr(t);default:cp(n,t),t=vt=M0(t,po),n=dd(n,t,po)}return l&&Jh(t),n}function Ac(t,n,l,f){ec(),Gr(n),Mg=null,ky=0;var p=n.return;try{if(Z0(t,p,n,l,pt)){Ln=Hy,od(t,ji(l,t.current)),vt=null;return}}catch(y){if(p!==null)throw vt=p,y;Ln=Hy,od(t,ji(l,t.current)),vt=null;return}n.flags&32768?(Rt||f===GE?t=!0:Pg||pt&536870912?t=!1:(of=t=!0,(f===ah||f===sh||f===jy||f===Vy)&&(f=Vs.current,f!==null&&f.tag===13&&(f.flags|=16384))),Op(n,t)):Ed(n)}function Ed(t){var n=t;do{if(n.flags&32768){Op(n,of);return}var l=n.alternate;if(t=n.return,Ql(n),l=we(n,up,l,n,po),(n.mode&mt)!==Je&&jf(n),l!==null){vt=l;return}if(n=n.sibling,n!==null){vt=n;return}vt=n=t}while(n!==null);Ln===_u&&(Ln=$L)}function Op(t,n){do{var l=vS(t.alternate,t);if(l!==null){l.flags&=32767,vt=l;return}if((t.mode&mt)!==Je){jf(t),l=t.actualDuration;for(var f=t.child;f!==null;)l+=f.actualDuration,f=f.sibling;t.actualDuration=l}if(l=t.return,l!==null&&(l.flags|=32768,l.subtreeFlags=0,l.deletions=null),!n&&(t=t.sibling,t!==null)){vt=t;return}vt=t=l}while(t!==null);Ln=PE,vt=null}function en(t,n,l,f,p,y,A,L,N,U,J,ee,j,fe){t.cancelPendingCommit=null;do Td();while(gi!==df);if(pr.flushLegacyContextWarning(),pr.flushPendingUnsafeLifecycleWarnings(),(Ot&(Ri|qs))!==ki)throw Error("Should not already be working.");if(xs(l),U===ih?D0(j,fe,l,jn):f!==null?kb(j,fe,l,f,n!==null&&n.alternate!==null&&n.alternate.memoizedState.isDehydrated&&(n.flags&256)!==0,jn):Ub(j,fe,l,jn),n!==null){if(l===0&&console.error("finishedLanes should not be empty during a commit. This is a bug in React."),n===t.current)throw Error("Cannot commit the same tree as before. This error is likely caused by a bug in React. Please file an issue.");if(y=n.lanes|n.childLanes,y|=o1,qa(t,l,y,A,L,N),t===an&&(vt=an=null,pt=0),Gg=n,hf=t,Sr=l,z1=y,P1=p,JL=f,F1=fe,WL=ee,Er=YE,e_=null,n.actualDuration!==0||n.subtreeFlags&10256||n.flags&10256?(t.callbackNode=null,t.callbackPriority=0,Dc(hu,function(){return Wy=window.event,Er===YE&&(Er=B1),bd(),null})):(t.callbackNode=null,t.callbackPriority=0),Tu=null,tf=ci(),ee!==null&&Bb(fe,tf,ee,jn),f=(n.flags&13878)!==0,n.subtreeFlags&13878||f){f=ge.T,ge.T=null,p=Ut.p,Ut.p=Zn,A=Ot,Ot|=qs;try{Pb(t,n,l)}finally{Ot=A,Ut.p=p,ge.T=f}}gi=KL,Wi(),El(),Mp()}}function Wi(){if(gi===KL){gi=df;var t=hf,n=Gg,l=Sr,f=(n.flags&13878)!==0;if(n.subtreeFlags&13878||f){f=ge.T,ge.T=null;var p=Ut.p;Ut.p=Zn;var y=Ot;Ot|=qs;try{zg=l,Fg=t,Fo(),pd(n,t),Fg=zg=null,l=Z1;var A=$h(t.containerInfo),L=l.focusedElem,N=l.selectionRange;if(A!==L&&L&&L.ownerDocument&&Zv(L.ownerDocument.documentElement,L)){if(N!==null&&x0(L)){var U=N.start,J=N.end;if(J===void 0&&(J=U),"selectionStart"in L)L.selectionStart=U,L.selectionEnd=Math.min(J,L.value.length);else{var ee=L.ownerDocument||document,j=ee&&ee.defaultView||window;if(j.getSelection){var fe=j.getSelection(),Me=L.textContent.length,ke=Math.min(N.start,Me),un=N.end===void 0?ke:Math.min(N.end,Me);!fe.extend&&ke>un&&(A=un,un=ke,ke=A);var Lt=Qv(L,ke),H=Qv(L,un);if(Lt&&H&&(fe.rangeCount!==1||fe.anchorNode!==Lt.node||fe.anchorOffset!==Lt.offset||fe.focusNode!==H.node||fe.focusOffset!==H.offset)){var V=ee.createRange();V.setStart(Lt.node,Lt.offset),fe.removeAllRanges(),ke>un?(fe.addRange(V),fe.extend(H.node,H.offset)):(V.setEnd(H.node,H.offset),fe.addRange(V))}}}}for(ee=[],fe=L;fe=fe.parentNode;)fe.nodeType===1&&ee.push({element:fe,left:fe.scrollLeft,top:fe.scrollTop});for(typeof L.focus=="function"&&L.focus(),L=0;L<ee.length;L++){var X=ee[L];X.element.scrollLeft=X.left,X.element.scrollTop=X.top}}oT=!!Q1,Z1=Q1=null}finally{Ot=y,Ut.p=p,ge.T=f}}t.current=n,gi=XL}}function El(){if(gi===XL){gi=df;var t=e_;if(t!==null){tf=ci();var n=Eu,l=tf;!pn||l<=n||console.timeStamp(t,n,l,_t,Dt,"secondary-light")}t=hf,n=Gg,l=Sr;var f=(n.flags&8772)!==0;if(n.subtreeFlags&8772||f){f=ge.T,ge.T=null;var p=Ut.p;Ut.p=Zn;var y=Ot;Ot|=qs;try{zg=l,Fg=t,Fo(),_m(t,n.alternate,n),Fg=zg=null}finally{Ot=y,Ut.p=p,ge.T=f}}t=F1,n=WL,Eu=ci(),t=n===null?t:tf,n=Eu,l=Er===k1,f=jn,Tu!==null?iS(t,n,Tu,!1,f):!pn||n<=t||(f?f.run(console.timeStamp.bind(console,l?"Commit Interrupted View Transition":"Commit",t,n,_t,Dt,l?"error":"secondary-dark")):console.timeStamp(l?"Commit Interrupted View Transition":"Commit",t,n,_t,Dt,l?"error":"secondary-dark")),gi=QL}}function Mp(){if(gi===ZL||gi===QL){if(gi===ZL){var t=Eu;Eu=ci();var n=Eu,l=Er===k1;!pn||n<=t||console.timeStamp(l?"Interrupted View Transition":"Starting Animation",t,n,_t,Dt,l?" error":"secondary-light"),Er!==k1&&(Er=qL)}gi=df,cg(),t=hf;var f=Gg;n=Sr,l=JL;var p=f.actualDuration!==0||(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0;p?gi=qE:(gi=df,Gg=hf=null,Ip(t,t.pendingLanes),rh=0,Xy=null);var y=t.pendingLanes;if(y===0&&(ff=null),p||zm(t),y=ye(n),f=f.stateNode,Qn&&typeof Qn.onCommitFiberRoot=="function")try{var A=(f.current.flags&128)===128;switch(y){case Zn:var L=oy;break;case xi:L=fg;break;case wi:L=hu;break;case co:L=dg;break;default:L=hu}Qn.onCommitFiberRoot(mu,f,L,A)}catch(ee){Ll||(Ll=!0,console.error("React instrumentation encountered an error: %o",ee))}if(_l&&t.memoizedUpdaters.clear(),Ap(),l!==null){A=ge.T,L=Ut.p,Ut.p=Zn,ge.T=null;try{var N=t.onRecoverableError;for(f=0;f<l.length;f++){var U=l[f],J=_S(U.stack);we(U.source,N,U.value,J)}}finally{ge.T=A,Ut.p=L}}Sr&3&&Td(),ca(t),y=t.pendingLanes,n&261930&&y&42?(CE=!0,t===G1?Ky++:(Ky=0,G1=t)):Ky=0,p||no(n,Eu),Tl(0)}}function _S(t){return t={componentStack:t},Object.defineProperty(t,"digest",{get:function(){console.error('You are accessing "digest" from the errorInfo object passed to onRecoverableError. This property is no longer provided as part of errorInfo but can be accessed as a property of the Error instance itself.')}}),t}function Ip(t,n){(t.pooledCacheLanes&=n)===0&&(n=t.pooledCache,n!=null&&(t.pooledCache=null,Hf(n)))}function Td(){return Wi(),El(),Mp(),bd()}function bd(){if(gi!==qE)return!1;var t=hf,n=z1;z1=0;var l=ye(Sr),f=wi>l?wi:l;l=ge.T;var p=Ut.p;try{Ut.p=f,ge.T=null;var y=P1;P1=null,f=hf;var A=Sr;if(gi=df,Gg=hf=null,Sr=0,(Ot&(Ri|qs))!==ki)throw Error("Cannot flush passive effects while already rendering.");xs(A),$1=!0,KE=!1;var L=0;if(Tu=null,L=oi(),Er===qL)L0(Eu,L,YN);else{var N=Eu,U=L,J=Er===B1;!pn||U<=N||(jn?jn.run(console.timeStamp.bind(console,J?"Waiting for Paint":"Waiting",N,U,_t,Dt,"secondary-light")):console.timeStamp(J?"Waiting for Paint":"Waiting",N,U,_t,Dt,"secondary-light"))}N=Ot,Ot|=qs;var ee=f.current;Fo(),Mm(ee);var j=f.current;ee=F1,Fo(),Tp(f,j,A,y,ee),zm(f),Ot=N;var fe=oi();if(j=L,ee=jn,Tu!==null?iS(j,fe,Tu,!0,ee):!pn||fe<=j||(ee?ee.run(console.timeStamp.bind(console,"Remaining Effects",j,fe,_t,Dt,"secondary-dark")):console.timeStamp("Remaining Effects",j,fe,_t,Dt,"secondary-dark")),no(A,fe),Tl(0,!1),KE?f===Xy?rh++:(rh=0,Xy=f):rh=0,KE=$1=!1,Qn&&typeof Qn.onPostCommitFiberRoot=="function")try{Qn.onPostCommitFiberRoot(mu,f)}catch(ke){Ll||(Ll=!0,console.error("React instrumentation encountered an error: %o",ke))}var Me=f.current.stateNode;return Me.effectDuration=0,Me.passiveEffectDuration=0,!0}finally{Ut.p=p,ge.T=l,Ip(t,n)}}function ea(t,n,l){n=ji(l,n),uS(n),n=mm(t.stateNode,n,2),t=ol(t,n,2),t!==null&&(Pn(t,2),ca(t))}function ct(t,n,l){if($g=!1,t.tag===3)ea(t,t,l);else{for(;n!==null;){if(n.tag===3){ea(n,t,l);return}if(n.tag===1){var f=n.stateNode;if(typeof n.type.getDerivedStateFromError=="function"||typeof f.componentDidCatch=="function"&&(ff===null||!ff.has(f))){t=ji(l,t),uS(t),l=gm(2),f=ol(n,l,2),f!==null&&(pm(l,f,n,t),Pn(f,2),ca(f));return}}n=n.return}console.error(`Internal React error: Attempted to capture a commit phase error inside a detached tree. This indicates a bug in React. Potential causes include deleting the same fiber more than once, committing an already-finished tree, or an inconsistent return pointer.
178
+
179
+ Error message:
180
+
181
+ %s`,l)}}function km(t,n,l){var f=t.pingCache;if(f===null){f=t.pingCache=new tU;var p=new Set;f.set(n,p)}else p=f.get(n),p===void 0&&(p=new Set,f.set(n,p));p.has(l)||(N1=!0,p.add(l),f=ua.bind(null,t,n,l),_l&&Rc(t,l),n.then(f,f))}function ua(t,n,l){var f=t.pingCache;f!==null&&f.delete(n),t.pingedLanes|=t.suspendedLanes&l,t.warmLanes&=~l,l&127?0>mo&&(Kd=mo=ci(),Ay=xE("Promise Resolved"),nf=AE):l&4194048&&0>kl&&(bu=kl=ci(),Dy=xE("Promise Resolved"),g1=AE),Rp()&&ge.actQueue===null&&console.error(`A suspended resource finished loading inside a test, but the event was not wrapped in act(...).
182
+
183
+ When testing, code that resolves suspended data should be wrapped into act(...):
184
+
185
+ act(() => {
186
+ /* finish loading suspended data */
187
+ });
188
+ /* assert on the output */
189
+
190
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`),an===t&&(pt&l)===l&&(Ln===rf||Ln===FE&&(pt&62914560)===pt&&oi()-jE<VL?(Ot&Ri)===ki&&Sl(t,0):U1|=l,lh===pt&&(lh=0)),ca(t)}function wp(t,n){n===0&&(n=Ya()),t=Ci(t,n),t!==null&&(Pn(t,n),ca(t))}function or(t){var n=t.memoizedState,l=0;n!==null&&(l=n.retryLane),wp(t,l)}function au(t,n){var l=0;switch(t.tag){case 31:case 13:var f=t.stateNode,p=t.memoizedState;p!==null&&(l=p.retryLane);break;case 19:f=t.stateNode;break;case 22:f=t.stateNode._retryCache;break;default:throw Error("Pinged unknown suspense boundary type. This is probably a bug in React.")}f!==null&&f.delete(n),wp(t,l)}function ks(t,n,l){if(n.subtreeFlags&67117056)for(n=n.child;n!==null;){var f=t,p=n,y=p.type===ia;y=l||y,p.tag!==22?p.flags&67108864?y&&we(p,Bm,f,p):ks(f,p,y):p.memoizedState===null&&(y&&p.flags&8192?we(p,Bm,f,p):p.subtreeFlags&67108864&&we(p,ks,f,p,y)),n=n.sibling}}function Bm(t,n){ut(!0);try{Cm(n),xp(n),Ep(t,n.alternate,n,!1),Sd(t,n,0,null,!1,0)}finally{ut(!1)}}function zm(t){var n=!0;t.current.mode&(ga|gr)||(n=!1),ks(t,t.current,n)}function ls(t){if((Ot&Ri)===ki){var n=t.tag;if(n===3||n===1||n===0||n===11||n===14||n===15){if(n=$(t)||"ReactComponent",XE!==null){if(XE.has(n))return;XE.add(n)}else XE=new Set([n]);we(t,function(){console.error("Can't perform a React state update on a component that hasn't mounted yet. This indicates that you have a side-effect in your render function that asynchronously tries to update the component. Move this work to useEffect instead.")})}}}function Rc(t,n){_l&&t.memoizedUpdaters.forEach(function(l){Si(t,l,n)})}function Dc(t,n){var l=ge.actQueue;return l!==null?(l.push(n),aU):ry(t,n)}function xd(t){Rp()&&ge.actQueue===null&&we(t,function(){console.error(`An update to %s inside a test was not wrapped in act(...).
191
+
192
+ When testing, code that causes React state updates should be wrapped into act(...):
193
+
194
+ act(() => {
195
+ /* fire events that update state */
196
+ });
197
+ /* assert on the output */
198
+
199
+ This ensures that you're testing the behavior the user would see in the browser. Learn more at https://react.dev/link/wrap-tests-with-act`,$(t))})}function ca(t){t!==Hg&&t.next===null&&(Hg===null?QE=Hg=t:Hg=Hg.next=t),ZE=!0,ge.actQueue!==null?j1||(j1=!0,OS()):H1||(H1=!0,OS())}function Tl(t,n){if(!V1&&ZE){V1=!0;do for(var l=!1,f=QE;f!==null;){if(t!==0){var p=f.pendingLanes;if(p===0)var y=0;else{var A=f.suspendedLanes,L=f.pingedLanes;y=(1<<31-bi(42|t)+1)-1,y&=p&~(A&~L),y=y&201326741?y&201326741|1:y?y|2:0}y!==0&&(l=!0,Ad(f,y))}else y=pt,y=jl(f,f===an?y:0,f.cancelPendingCommit!==null||f.timeoutHandle!==fh),!(y&3)||fn(f,y)||(l=!0,Ad(f,y));f=f.next}while(l);V1=!1}}function CS(){Wy=window.event,Fm()}function Fm(){ZE=j1=H1=!1;var t=0;mf!==0&&Bp()&&(t=mf);for(var n=oi(),l=null,f=QE;f!==null;){var p=f.next,y=Lc(f,n);y===0?(f.next=null,l===null?QE=p:l.next=p,p===null&&(Hg=l)):(l=f,(t!==0||y&3)&&(ZE=!0)),f=p}gi!==df&&gi!==qE||Tl(t),mf!==0&&(mf=0)}function Lc(t,n){for(var l=t.suspendedLanes,f=t.pingedLanes,p=t.expirationTimes,y=t.pendingLanes&-62914561;0<y;){var A=31-bi(y),L=1<<A,N=p[A];N===-1?(!(L&l)||L&f)&&(p[A]=To(L,n)):N<=n&&(t.expiredLanes|=L),y&=~L}if(n=an,l=pt,l=jl(t,t===n?l:0,t.cancelPendingCommit!==null||t.timeoutHandle!==fh),f=t.callbackNode,l===0||t===n&&(Xt===ah||Xt===sh)||t.cancelPendingCommit!==null)return f!==null&&Pm(f),t.callbackNode=null,t.callbackPriority=0;if(!(l&3)||fn(t,l)){if(n=l&-l,n!==t.callbackPriority||ge.actQueue!==null&&f!==Y1)Pm(f);else return n;switch(ye(l)){case Zn:case xi:l=fg;break;case wi:l=hu;break;case co:l=dg;break;default:l=hu}return f=Np.bind(null,t),ge.actQueue!==null?(ge.actQueue.push(f),l=Y1):l=ry(l,f),t.callbackPriority=n,t.callbackNode=l,n}return f!==null&&Pm(f),t.callbackPriority=2,t.callbackNode=null,2}function Np(t,n){if(CE=_E=!1,Wy=window.event,gi!==df&&gi!==qE)return t.callbackNode=null,t.callbackPriority=0,null;var l=t.callbackNode;if(Er===YE&&(Er=B1),Td()&&t.callbackNode!==l)return null;var f=pt;return f=jl(t,t===an?f:0,t.cancelPendingCommit!==null||t.timeoutHandle!==fh),f===0?null:(RS(t,f,n),Lc(t,oi()),t.callbackNode!=null&&t.callbackNode===l?Np.bind(null,t):null)}function Ad(t,n){if(Td())return null;_E=CE,CE=!1,RS(t,n,!0)}function Pm(t){t!==Y1&&t!==null&&og(t)}function OS(){ge.actQueue!==null&&ge.actQueue.push(function(){return Fm(),null}),mU(function(){(Ot&(Ri|qs))!==ki?ry(oy,CS):Fm()})}function Up(){if(mf===0){var t=Zd;t===0&&(t=Vc,Vc<<=1,!(Vc&261888)&&(Vc=256)),mf=t}return mf}function Mt(t){return t==null||typeof t=="symbol"||typeof t=="boolean"?null:typeof t=="function"?t:(Pe(t,"action"),wf(""+t))}function Yt(t,n){var l=n.ownerDocument.createElement("input");return l.name=n.name,l.value=n.value,t.id&&l.setAttribute("form",t.id),n.parentNode.insertBefore(l,n),t=new FormData(t),l.parentNode.removeChild(l),t}function bt(t,n,l,f,p){if(n==="submit"&&l&&l.stateNode===p){var y=Mt((p[aa]||null).action),A=f.submitter;A&&(n=(n=A[aa]||null)?Mt(n.formAction):A.getAttribute("formAction"),n!==null&&(y=n,A=null));var L=new pE("action","action",null,f,p);t.push({event:L,listeners:[{instance:null,listener:function(){if(f.defaultPrevented){if(mf!==0){var N=A?Yt(p,A):new FormData(p),U={pending:!0,data:N,method:p.method,action:y};Object.freeze(U),ar(l,U,null,N)}}else typeof y=="function"&&(L.preventDefault(),N=A?Yt(p,A):new FormData(p),U={pending:!0,data:N,method:p.method,action:y},Object.freeze(U),ar(l,U,y,N))},currentTarget:p}]})}}function yt(t,n,l){t.currentTarget=l;try{n(t)}catch(f){a1(f)}t.currentTarget=null}function Pt(t,n){n=(n&4)!==0;for(var l=0;l<t.length;l++){var f=t[l];e:{var p=void 0,y=f.event;if(f=f.listeners,n)for(var A=f.length-1;0<=A;A--){var L=f[A],N=L.instance,U=L.currentTarget;if(L=L.listener,N!==p&&y.isPropagationStopped())break e;N!==null?we(N,yt,y,L,U):yt(y,L,U),p=N}else for(A=0;A<f.length;A++){if(L=f[A],N=L.instance,U=L.currentTarget,L=L.listener,N!==p&&y.isPropagationStopped())break e;N!==null?we(N,yt,y,L,U):yt(y,L,U),p=N}}}}function Ze(t,n){q1.has(t)||console.error('Did not expect a listenToNonDelegatedEvent() call for "%s". This is a bug in React. Please file an issue.',t);var l=n[gu];l===void 0&&(l=n[gu]=new Set);var f=t+"__bubble";l.has(f)||(Gm(n,t,2,!1),l.add(f))}function bl(t,n,l){q1.has(t)&&!n&&console.error('Did not expect a listenToNativeEvent() call for "%s" in the bubble phase. This is a bug in React. Please file an issue.',t);var f=0;n&&(f|=4),Gm(l,t,f,n)}function io(t){if(!t[JE]){t[JE]=!0,fE.forEach(function(l){l!=="selectionchange"&&(q1.has(l)||bl(l,!1,t),bl(l,!0,t))});var n=t.nodeType===9?t:t.ownerDocument;n===null||n[JE]||(n[JE]=!0,bl("selectionchange",!1,n))}}function Gm(t,n,l,f){switch(tg(n)){case Zn:var p=Qp;break;case xi:p=Ti;break;default:p=Zp}l=p.bind(null,n,l,t),p=void 0,!Kb||n!=="touchstart"&&n!=="touchmove"&&n!=="wheel"||(p=!0),f?p!==void 0?t.addEventListener(n,l,{capture:!0,passive:p}):t.addEventListener(n,l,!0):p!==void 0?t.addEventListener(n,l,{passive:p}):t.addEventListener(n,l,!1)}function Bs(t,n,l,f,p){var y=f;if(!(n&1)&&!(n&2)&&f!==null)e:for(;;){if(f===null)return;var A=f.tag;if(A===3||A===4){var L=f.stateNode.containerInfo;if(L===p)break;if(A===4)for(A=f.return;A!==null;){var N=A.tag;if((N===3||N===4)&&A.stateNode.containerInfo===p)return;A=A.return}for(;L!==null;){if(A=$i(L),A===null)return;if(N=A.tag,N===5||N===6||N===26||N===27){f=y=A;continue e}L=L.parentNode}}f=f.return}zh(function(){var U=y,J=Ts(l),ee=[];e:{var j=kD.get(t);if(j!==void 0){var fe=pE,Me=t;switch(t){case"keypress":if(Nf(l)===0)break e;case"keydown":case"keyup":fe=SN;break;case"focusin":Me="focus",fe=Jb;break;case"focusout":Me="blur",fe=Jb;break;case"beforeblur":case"afterblur":fe=Jb;break;case"click":if(l.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":fe=bD;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":fe=rN;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":fe=bN;break;case ID:case wD:case ND:fe=cN;break;case UD:fe=AN;break;case"scroll":case"scrollend":fe=sN;break;case"wheel":fe=DN;break;case"copy":case"cut":case"paste":fe=dN;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":fe=AD;break;case"toggle":case"beforetoggle":fe=_N}var ke=(n&4)!==0,un=!ke&&(t==="scroll"||t==="scrollend"),Lt=ke?j!==null?j+"Capture":null:j;ke=[];for(var H=U,V;H!==null;){var X=H;if(V=X.stateNode,X=X.tag,X!==5&&X!==26&&X!==27||V===null||Lt===null||(X=nl(H,Lt),X!=null&&ke.push(tn(H,X,V))),un)break;H=H.return}0<ke.length&&(j=new fe(j,Me,null,l,J),ee.push({event:j,listeners:ke}))}}if(!(n&7)){e:{if(j=t==="mouseover"||t==="pointerover",fe=t==="mouseout"||t==="pointerout",j&&l!==hy&&(Me=l.relatedTarget||l.fromElement)&&($i(Me)||Me[mr]))break e;if((fe||j)&&(j=J.window===J?J:(j=J.ownerDocument)?j.defaultView||j.parentWindow:window,fe?(Me=l.relatedTarget||l.toElement,fe=U,Me=Me?$i(Me):null,Me!==null&&(un=w(Me),ke=Me.tag,Me!==un||ke!==5&&ke!==27&&ke!==6)&&(Me=null)):(fe=null,Me=U),fe!==Me)){if(ke=bD,X="onMouseLeave",Lt="onMouseEnter",H="mouse",(t==="pointerout"||t==="pointerover")&&(ke=AD,X="onPointerLeave",Lt="onPointerEnter",H="pointer"),un=fe==null?j:Cr(fe),V=Me==null?j:Cr(Me),j=new ke(X,H+"leave",fe,l,J),j.target=un,j.relatedTarget=V,X=null,$i(J)===U&&(ke=new ke(Lt,H+"enter",Me,l,J),ke.target=V,ke.relatedTarget=un,X=ke),un=X,fe&&Me)t:{for(ke=su,Lt=fe,H=Me,V=0,X=Lt;X;X=ke(X))V++;X=0;for(var Se=H;Se;Se=ke(Se))X++;for(;0<V-X;)Lt=ke(Lt),V--;for(;0<X-V;)H=ke(H),X--;for(;V--;){if(Lt===H||H!==null&&Lt===H.alternate){ke=Lt;break t}Lt=ke(Lt),H=ke(H)}ke=null}else ke=null;fe!==null&&$m(ee,j,fe,ke,!1),Me!==null&&un!==null&&$m(ee,un,Me,ke,!0)}}e:{if(j=U?Cr(U):window,fe=j.nodeName&&j.nodeName.toLowerCase(),fe==="select"||fe==="input"&&j.type==="file")var Ne=wr;else if(E0(j))if(OD)Ne=zf;else{Ne=T0;var nt=Nb}else fe=j.nodeName,!fe||fe.toLowerCase()!=="input"||j.type!=="checkbox"&&j.type!=="radio"?U&&tl(U.elementType)&&(Ne=wr):Ne=b0;if(Ne&&(Ne=Ne(t,U))){kf(ee,Ne,l,J);break e}nt&&nt(t,j,U),t==="focusout"&&U&&j.type==="number"&&U.memoizedProps.value!=null&&f0(j,"number",j.value)}switch(nt=U?Cr(U):window,t){case"focusin":(E0(nt)||nt.contentEditable==="true")&&(Eg=nt,e1=U,Ey=null);break;case"focusout":Ey=e1=Eg=null;break;case"mousedown":t1=!0;break;case"contextmenu":case"mouseup":case"dragend":t1=!1,Jv(ee,l,J);break;case"selectionchange":if(IN)break;case"keydown":case"keyup":Jv(ee,l,J)}var qe;if(Wb)e:{switch(t){case"compositionstart":var He="onCompositionStart";break e;case"compositionend":He="onCompositionEnd";break e;case"compositionupdate":He="onCompositionUpdate";break e}He=void 0}else Sg?Xu(t,l)&&(He="onCompositionEnd"):t==="keydown"&&l.keyCode===RD&&(He="onCompositionStart");He&&(DD&&l.locale!=="ko"&&(Sg||He!=="onCompositionStart"?He==="onCompositionEnd"&&Sg&&(qe=Co()):(Qc=J,Xb="value"in Qc?Qc.value:Qc.textContent,Sg=!0)),nt=zs(U,He),0<nt.length&&(He=new xD(He,t,null,l,J),ee.push({event:He,listeners:nt}),qe?He.data=qe:(qe=Kl(l),qe!==null&&(He.data=qe)))),(qe=ON?S0(t,l):Fh(t,l))&&(He=zs(U,"onBeforeInput"),0<He.length&&(nt=new mN("onBeforeInput","beforeinput",null,l,J),ee.push({event:nt,listeners:He}),nt.data=qe)),bt(ee,t,U,l,J)}Pt(ee,n)})}function tn(t,n,l){return{instance:t,listener:n,currentTarget:l}}function zs(t,n){for(var l=n+"Capture",f=[];t!==null;){var p=t,y=p.stateNode;if(p=p.tag,p!==5&&p!==26&&p!==27||y===null||(p=nl(t,l),p!=null&&f.unshift(tn(t,p,y)),p=nl(t,n),p!=null&&f.push(tn(t,p,y))),t.tag===3)return f;t=t.return}return[]}function su(t){if(t===null)return null;do t=t.return;while(t&&t.tag!==5&&t.tag!==27);return t||null}function $m(t,n,l,f,p){for(var y=n._reactName,A=[];l!==null&&l!==f;){var L=l,N=L.alternate,U=L.stateNode;if(L=L.tag,N!==null&&N===f)break;L!==5&&L!==26&&L!==27||U===null||(N=U,p?(U=nl(l,y),U!=null&&A.unshift(tn(l,U,N))):p||(U=nl(l,y),U!=null&&A.push(tn(l,U,N)))),l=l.return}A.length!==0&&t.push({event:n,listeners:A})}function ta(t,n){qv(t,n),t!=="input"&&t!=="textarea"&&t!=="select"||n==null||n.value!==null||ED||(ED=!0,t==="select"&&n.multiple?console.error("`value` prop on `%s` should not be null. Consider using an empty array when `multiple` is set to `true` to clear the component or `undefined` for uncontrolled components.",t):console.error("`value` prop on `%s` should not be null. Consider using an empty string to clear the component or `undefined` for uncontrolled components.",t));var l={registrationNameDependencies:Cl,possibleRegistrationNames:Kc};tl(t)||typeof n.is=="string"||wb(t,n,l),n.contentEditable&&!n.suppressContentEditableWarning&&n.children!=null&&console.error("A component is `contentEditable` and contains `children` managed by React. It is now your responsibility to guarantee that none of those nodes are unexpectedly modified or duplicated. This is probably not intentional.")}function En(t,n,l,f){n!==l&&(l=Fs(l),Fs(n)!==l&&(f[t]=n))}function Rd(t,n,l){n.forEach(function(f){l[ur(f)]=f==="style"?ao(t):t.getAttribute(f)})}function Tn(t,n){n===!1?console.error("Expected `%s` listener to be a function, instead got `false`.\n\nIf you used to conditionally omit it with %s={condition && value}, pass %s={condition ? value : undefined} instead.",t,t,t):console.error("Expected `%s` listener to be a function, instead got a value of `%s` type.",t,typeof n)}function Hm(t,n){return t=t.namespaceURI===st||t.namespaceURI===ft?t.ownerDocument.createElementNS(t.namespaceURI,t.tagName):t.ownerDocument.createElement(t.tagName),t.innerHTML=n,t.innerHTML}function Fs(t){return ei(t)&&(console.error("The provided HTML markup uses a value of unsupported type %s. This value must be coerced to a string before using it here.",Gi(t)),ja(t)),(typeof t=="string"?t:""+t).replace(sU,`
200
+ `).replace(lU,"")}function kp(t,n){return n=Fs(n),Fs(t)===n}function Nt(t,n,l,f,p,y){switch(l){case"children":typeof f=="string"?(If(f,n,!1),n==="body"||n==="textarea"&&f===""||_o(t,f)):(typeof f=="number"||typeof f=="bigint")&&(If(""+f,n,!1),n!=="body"&&_o(t,""+f));break;case"className":Cf(t,"class",f);break;case"tabIndex":Cf(t,"tabindex",f);break;case"dir":case"role":case"viewBox":case"width":case"height":Cf(t,l,f);break;case"style":p0(t,f,y);break;case"data":if(n!=="object"){Cf(t,"data",f);break}case"src":case"href":if(f===""&&(n!=="a"||l!=="href")){console.error(l==="src"?'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.':'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',l,l),t.removeAttribute(l);break}if(f==null||typeof f=="function"||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(l);break}Pe(f,l),f=wf(""+f),t.setAttribute(l,f);break;case"action":case"formAction":if(f!=null&&(n==="form"?l==="formAction"?console.error("You can only pass the formAction prop to <input> or <button>. Use the action prop on <form>."):typeof f=="function"&&(p.encType==null&&p.method==null||tT||(tT=!0,console.error("Cannot specify a encType or method for a form that specifies a function as the action. React provides those automatically. They will get overridden.")),p.target==null||eT||(eT=!0,console.error("Cannot specify a target for a form that specifies a function as the action. The function will always be executed in the same window."))):n==="input"||n==="button"?l==="action"?console.error("You can only pass the action prop to <form>. Use the formAction prop on <input> or <button>."):n!=="input"||p.type==="submit"||p.type==="image"||WE?n!=="button"||p.type==null||p.type==="submit"||WE?typeof f=="function"&&(p.name==null||s_||(s_=!0,console.error('Cannot specify a "name" prop for a button that specifies a function as a formAction. React needs it to encode which action should be invoked. It will get overridden.')),p.formEncType==null&&p.formMethod==null||tT||(tT=!0,console.error("Cannot specify a formEncType or formMethod for a button that specifies a function as a formAction. React provides those automatically. They will get overridden.")),p.formTarget==null||eT||(eT=!0,console.error("Cannot specify a formTarget for a button that specifies a function as a formAction. The function will always be executed in the same window."))):(WE=!0,console.error('A button can only specify a formAction along with type="submit" or no type.')):(WE=!0,console.error('An input can only specify a formAction along with type="submit" or type="image".')):console.error(l==="action"?"You can only pass the action prop to <form>.":"You can only pass the formAction prop to <input> or <button>.")),typeof f=="function"){t.setAttribute(l,"javascript:throw new Error('A React form was unexpectedly submitted. If you called form.submit() manually, consider using form.requestSubmit() instead. If you\\'re trying to use event.stopPropagation() in a submit event handler, consider also calling event.preventDefault().')");break}else typeof y=="function"&&(l==="formAction"?(n!=="input"&&Nt(t,n,"name",p.name,p,null),Nt(t,n,"formEncType",p.formEncType,p,null),Nt(t,n,"formMethod",p.formMethod,p,null),Nt(t,n,"formTarget",p.formTarget,p,null)):(Nt(t,n,"encType",p.encType,p,null),Nt(t,n,"method",p.method,p,null),Nt(t,n,"target",p.target,p,null)));if(f==null||typeof f=="symbol"||typeof f=="boolean"){t.removeAttribute(l);break}Pe(f,l),f=wf(""+f),t.setAttribute(l,f);break;case"onClick":f!=null&&(typeof f!="function"&&Tn(l,f),t.onclick=Qa);break;case"onScroll":f!=null&&(typeof f!="function"&&Tn(l,f),Ze("scroll",t));break;case"onScrollEnd":f!=null&&(typeof f!="function"&&Tn(l,f),Ze("scrollend",t));break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(l=f.__html,l!=null){if(p.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");t.innerHTML=l}}break;case"multiple":t.multiple=f&&typeof f!="function"&&typeof f!="symbol";break;case"muted":t.muted=f&&typeof f!="function"&&typeof f!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(f==null||typeof f=="function"||typeof f=="boolean"||typeof f=="symbol"){t.removeAttribute("xlink:href");break}Pe(f,l),l=wf(""+f),t.setAttributeNS(oh,"xlink:href",l);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":f!=null&&typeof f!="function"&&typeof f!="symbol"?(Pe(f,l),t.setAttribute(l,""+f)):t.removeAttribute(l);break;case"inert":f!==""||nT[l]||(nT[l]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",l));case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":f&&typeof f!="function"&&typeof f!="symbol"?t.setAttribute(l,""):t.removeAttribute(l);break;case"capture":case"download":f===!0?t.setAttribute(l,""):f!==!1&&f!=null&&typeof f!="function"&&typeof f!="symbol"?(Pe(f,l),t.setAttribute(l,f)):t.removeAttribute(l);break;case"cols":case"rows":case"size":case"span":f!=null&&typeof f!="function"&&typeof f!="symbol"&&!isNaN(f)&&1<=f?(Pe(f,l),t.setAttribute(l,f)):t.removeAttribute(l);break;case"rowSpan":case"start":f==null||typeof f=="function"||typeof f=="symbol"||isNaN(f)?t.removeAttribute(l):(Pe(f,l),t.setAttribute(l,f));break;case"popover":Ze("beforetoggle",t),Ze("toggle",t),Lh(t,"popover",f);break;case"xlinkActuate":Js(t,oh,"xlink:actuate",f);break;case"xlinkArcrole":Js(t,oh,"xlink:arcrole",f);break;case"xlinkRole":Js(t,oh,"xlink:role",f);break;case"xlinkShow":Js(t,oh,"xlink:show",f);break;case"xlinkTitle":Js(t,oh,"xlink:title",f);break;case"xlinkType":Js(t,oh,"xlink:type",f);break;case"xmlBase":Js(t,K1,"xml:base",f);break;case"xmlLang":Js(t,K1,"xml:lang",f);break;case"xmlSpace":Js(t,K1,"xml:space",f);break;case"is":y!=null&&console.error('Cannot update the "is" prop after it has been initialized.'),Lh(t,"is",f);break;case"innerText":case"textContent":break;case"popoverTarget":l_||f==null||typeof f!="object"||(l_=!0,console.error("The `popoverTarget` prop expects the ID of an Element as a string. Received %s instead.",f));default:!(2<l.length)||l[0]!=="o"&&l[0]!=="O"||l[1]!=="n"&&l[1]!=="N"?(l=Vv(l),Lh(t,l,f)):Cl.hasOwnProperty(l)&&f!=null&&typeof f!="function"&&Tn(l,f)}}function _c(t,n,l,f,p,y){switch(l){case"style":p0(t,f,y);break;case"dangerouslySetInnerHTML":if(f!=null){if(typeof f!="object"||!("__html"in f))throw Error("`props.dangerouslySetInnerHTML` must be in the form `{__html: ...}`. Please visit https://react.dev/link/dangerously-set-inner-html for more information.");if(l=f.__html,l!=null){if(p.children!=null)throw Error("Can only set one of `children` or `props.dangerouslySetInnerHTML`.");t.innerHTML=l}}break;case"children":typeof f=="string"?_o(t,f):(typeof f=="number"||typeof f=="bigint")&&_o(t,""+f);break;case"onScroll":f!=null&&(typeof f!="function"&&Tn(l,f),Ze("scroll",t));break;case"onScrollEnd":f!=null&&(typeof f!="function"&&Tn(l,f),Ze("scrollend",t));break;case"onClick":f!=null&&(typeof f!="function"&&Tn(l,f),t.onclick=Qa);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(Cl.hasOwnProperty(l))f!=null&&typeof f!="function"&&Tn(l,f);else e:{if(l[0]==="o"&&l[1]==="n"&&(p=l.endsWith("Capture"),n=l.slice(2,p?l.length-7:void 0),y=t[aa]||null,y=y!=null?y[l]:null,typeof y=="function"&&t.removeEventListener(n,y,p),typeof f=="function")){typeof y!="function"&&y!==null&&(l in t?t[l]=null:t.hasAttribute(l)&&t.removeAttribute(l)),t.addEventListener(n,f,p);break e}l in t?t[l]=f:f===!0?t.setAttribute(l,""):Lh(t,l,f)}}}function mn(t,n,l){switch(ta(n,l),n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":Ze("error",t),Ze("load",t);var f=!1,p=!1,y;for(y in l)if(l.hasOwnProperty(y)){var A=l[y];if(A!=null)switch(y){case"src":f=!0;break;case"srcSet":p=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:Nt(t,n,y,A,l,null)}}p&&Nt(t,n,"srcSet",l.srcSet,l,null),f&&Nt(t,n,"src",l.src,l,null);return;case"input":xo("input",l),Ze("invalid",t);var L=y=A=p=null,N=null,U=null;for(f in l)if(l.hasOwnProperty(f)){var J=l[f];if(J!=null)switch(f){case"name":p=J;break;case"type":A=J;break;case"checked":N=J;break;case"defaultChecked":U=J;break;case"value":y=J;break;case"defaultValue":L=J;break;case"children":case"dangerouslySetInnerHTML":if(J!=null)throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:Nt(t,n,f,J,l,null)}}Hi(t,l),Oh(t,y,L,N,U,A,p,!1);return;case"select":xo("select",l),Ze("invalid",t),f=A=y=null;for(p in l)if(l.hasOwnProperty(p)&&(L=l[p],L!=null))switch(p){case"value":y=L;break;case"defaultValue":A=L;break;case"multiple":f=L;default:Nt(t,n,p,L,l,null)}Mh(t,l),n=y,l=A,t.multiple=!!f,n!=null?Ws(t,!!f,n,!1):l!=null&&Ws(t,!!f,l,!0);return;case"textarea":xo("textarea",l),Ze("invalid",t),y=p=f=null;for(A in l)if(l.hasOwnProperty(A)&&(L=l[A],L!=null))switch(A){case"value":f=L;break;case"defaultValue":p=L;break;case"children":y=L;break;case"dangerouslySetInnerHTML":if(L!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:Nt(t,n,A,L,l,null)}Ao(t,l),Hu(t,f,p,y);return;case"option":jv(t,l);for(N in l)if(l.hasOwnProperty(N)&&(f=l[N],f!=null))switch(N){case"selected":t.selected=f&&typeof f!="function"&&typeof f!="symbol";break;default:Nt(t,n,N,f,l,null)}return;case"dialog":Ze("beforetoggle",t),Ze("toggle",t),Ze("cancel",t),Ze("close",t);break;case"iframe":case"object":Ze("load",t);break;case"video":case"audio":for(f=0;f<Qy.length;f++)Ze(Qy[f],t);break;case"image":Ze("error",t),Ze("load",t);break;case"details":Ze("toggle",t);break;case"embed":case"source":case"link":Ze("error",t),Ze("load",t);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(U in l)if(l.hasOwnProperty(U)&&(f=l[U],f!=null))switch(U){case"children":case"dangerouslySetInnerHTML":throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");default:Nt(t,n,U,f,l,null)}return;default:if(tl(n)){for(J in l)l.hasOwnProperty(J)&&(f=l[J],f!==void 0&&_c(t,n,J,f,l,void 0));return}}for(L in l)l.hasOwnProperty(L)&&(f=l[L],f!=null&&Nt(t,n,L,f,l,null))}function Xn(t,n,l,f){switch(ta(n,f),n){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var p=null,y=null,A=null,L=null,N=null,U=null,J=null;for(fe in l){var ee=l[fe];if(l.hasOwnProperty(fe)&&ee!=null)switch(fe){case"checked":break;case"value":break;case"defaultValue":N=ee;default:f.hasOwnProperty(fe)||Nt(t,n,fe,null,f,ee)}}for(var j in f){var fe=f[j];if(ee=l[j],f.hasOwnProperty(j)&&(fe!=null||ee!=null))switch(j){case"type":y=fe;break;case"name":p=fe;break;case"checked":U=fe;break;case"defaultChecked":J=fe;break;case"value":A=fe;break;case"defaultValue":L=fe;break;case"children":case"dangerouslySetInnerHTML":if(fe!=null)throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:fe!==ee&&Nt(t,n,j,fe,f,ee)}}n=l.type==="checkbox"||l.type==="radio"?l.checked!=null:l.value!=null,f=f.type==="checkbox"||f.type==="radio"?f.checked!=null:f.value!=null,n||!f||a_||(console.error("A component is changing an uncontrolled input to be controlled. This is likely caused by the value changing from undefined to a defined value, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),a_=!0),!n||f||i_||(console.error("A component is changing a controlled input to be uncontrolled. This is likely caused by the value changing from a defined to undefined, which should not happen. Decide between using a controlled or uncontrolled input element for the lifetime of the component. More info: https://react.dev/link/controlled-components"),i_=!0),Or(t,A,L,N,U,J,y,p);return;case"select":fe=A=L=j=null;for(y in l)if(N=l[y],l.hasOwnProperty(y)&&N!=null)switch(y){case"value":break;case"multiple":fe=N;default:f.hasOwnProperty(y)||Nt(t,n,y,null,f,N)}for(p in f)if(y=f[p],N=l[p],f.hasOwnProperty(p)&&(y!=null||N!=null))switch(p){case"value":j=y;break;case"defaultValue":L=y;break;case"multiple":A=y;default:y!==N&&Nt(t,n,p,y,f,N)}f=L,n=A,l=fe,j!=null?Ws(t,!!n,j,!1):!!l!=!!n&&(f!=null?Ws(t,!!n,f,!0):Ws(t,!!n,n?[]:"",!1));return;case"textarea":fe=j=null;for(L in l)if(p=l[L],l.hasOwnProperty(L)&&p!=null&&!f.hasOwnProperty(L))switch(L){case"value":break;case"children":break;default:Nt(t,n,L,null,f,p)}for(A in f)if(p=f[A],y=l[A],f.hasOwnProperty(A)&&(p!=null||y!=null))switch(A){case"value":j=p;break;case"defaultValue":fe=p;break;case"children":break;case"dangerouslySetInnerHTML":if(p!=null)throw Error("`dangerouslySetInnerHTML` does not make sense on <textarea>.");break;default:p!==y&&Nt(t,n,A,p,f,y)}Ro(t,j,fe);return;case"option":for(var Me in l)if(j=l[Me],l.hasOwnProperty(Me)&&j!=null&&!f.hasOwnProperty(Me))switch(Me){case"selected":t.selected=!1;break;default:Nt(t,n,Me,null,f,j)}for(N in f)if(j=f[N],fe=l[N],f.hasOwnProperty(N)&&j!==fe&&(j!=null||fe!=null))switch(N){case"selected":t.selected=j&&typeof j!="function"&&typeof j!="symbol";break;default:Nt(t,n,N,j,f,fe)}return;case"img":case"link":case"area":case"base":case"br":case"col":case"embed":case"hr":case"keygen":case"meta":case"param":case"source":case"track":case"wbr":case"menuitem":for(var ke in l)j=l[ke],l.hasOwnProperty(ke)&&j!=null&&!f.hasOwnProperty(ke)&&Nt(t,n,ke,null,f,j);for(U in f)if(j=f[U],fe=l[U],f.hasOwnProperty(U)&&j!==fe&&(j!=null||fe!=null))switch(U){case"children":case"dangerouslySetInnerHTML":if(j!=null)throw Error(n+" is a void element tag and must neither have `children` nor use `dangerouslySetInnerHTML`.");break;default:Nt(t,n,U,j,f,fe)}return;default:if(tl(n)){for(var un in l)j=l[un],l.hasOwnProperty(un)&&j!==void 0&&!f.hasOwnProperty(un)&&_c(t,n,un,void 0,f,j);for(J in f)j=f[J],fe=l[J],!f.hasOwnProperty(J)||j===fe||j===void 0&&fe===void 0||_c(t,n,J,j,f,fe);return}}for(var Lt in l)j=l[Lt],l.hasOwnProperty(Lt)&&j!=null&&!f.hasOwnProperty(Lt)&&Nt(t,n,Lt,null,f,j);for(ee in f)j=f[ee],fe=l[ee],!f.hasOwnProperty(ee)||j===fe||j==null&&fe==null||Nt(t,n,ee,j,f,fe)}function ur(t){switch(t){case"class":return"className";case"for":return"htmlFor";default:return t}}function ao(t){var n={};t=t.style;for(var l=0;l<t.length;l++){var f=t[l];n[f]=t.getPropertyValue(f)}return n}function xl(t,n,l){if(n!=null&&typeof n!="object")console.error("The `style` prop expects a mapping from style properties to values, not a string. For example, style={{marginRight: spacing + 'em'}} when using JSX.");else{var f,p=f="",y;for(y in n)if(n.hasOwnProperty(y)){var A=n[y];A!=null&&typeof A!="boolean"&&A!==""&&(y.indexOf("--")===0?(cn(A,y),f+=p+y+":"+(""+A).trim()):typeof A!="number"||A===0||Ge.has(y)?(cn(A,y),f+=p+y.replace(pe,"-$1").toLowerCase().replace(ze,"-ms-")+":"+(""+A).trim()):f+=p+y.replace(pe,"-$1").toLowerCase().replace(ze,"-ms-")+":"+A+"px",p=";")}f=f||null,n=t.getAttribute("style"),n!==f&&(f=Fs(f),Fs(n)!==f&&(l.style=ao(t)))}}function fa(t,n,l,f,p,y){if(p.delete(l),t=t.getAttribute(l),t===null)switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":return}else if(f!=null)switch(typeof f){case"function":case"symbol":case"boolean":break;default:if(Pe(f,n),t===""+f)return}En(n,t,f,y)}function jm(t,n,l,f,p,y){if(p.delete(l),t=t.getAttribute(l),t===null){switch(typeof f){case"function":case"symbol":return}if(!f)return}else switch(typeof f){case"function":case"symbol":break;default:if(f)return}En(n,t,f,y)}function Vm(t,n,l,f,p,y){if(p.delete(l),t=t.getAttribute(l),t===null)switch(typeof f){case"undefined":case"function":case"symbol":return}else if(f!=null)switch(typeof f){case"function":case"symbol":break;default:if(Pe(f,l),t===""+f)return}En(n,t,f,y)}function Cc(t,n,l,f,p,y){if(p.delete(l),t=t.getAttribute(l),t===null)switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":return;default:if(isNaN(f))return}else if(f!=null)switch(typeof f){case"function":case"symbol":case"boolean":break;default:if(!isNaN(f)&&(Pe(f,n),t===""+f))return}En(n,t,f,y)}function Dd(t,n,l,f,p,y){if(p.delete(l),t=t.getAttribute(l),t===null)switch(typeof f){case"undefined":case"function":case"symbol":case"boolean":return}else if(f!=null)switch(typeof f){case"function":case"symbol":case"boolean":break;default:if(Pe(f,n),l=wf(""+f),t===l)return}En(n,t,f,y)}function da(t,n,l,f){for(var p={},y=new Set,A=t.attributes,L=0;L<A.length;L++)switch(A[L].name.toLowerCase()){case"value":break;case"checked":break;case"selected":break;default:y.add(A[L].name)}if(tl(n)){for(var N in l)if(l.hasOwnProperty(N)){var U=l[N];if(U!=null){if(Cl.hasOwnProperty(N))typeof U!="function"&&Tn(N,U);else if(l.suppressHydrationWarning!==!0)switch(N){case"children":typeof U!="string"&&typeof U!="number"||En("children",t.textContent,U,p);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":A=t.innerHTML,U=U?U.__html:void 0,U!=null&&(U=Hm(t,U),En(N,A,U,p));continue;case"style":y.delete(N),xl(t,U,p);continue;case"offsetParent":case"offsetTop":case"offsetLeft":case"offsetWidth":case"offsetHeight":case"isContentEditable":case"outerText":case"outerHTML":y.delete(N.toLowerCase()),console.error("Assignment to read-only property will result in a no-op: `%s`",N);continue;case"className":y.delete("class"),A=$u(t,"class",U),En("className",A,U,p);continue;default:f.context===Cu&&n!=="svg"&&n!=="math"?y.delete(N.toLowerCase()):y.delete(N),A=$u(t,N,U),En(N,A,U,p)}}}}else for(U in l)if(l.hasOwnProperty(U)&&(N=l[U],N!=null)){if(Cl.hasOwnProperty(U))typeof N!="function"&&Tn(U,N);else if(l.suppressHydrationWarning!==!0)switch(U){case"children":typeof N!="string"&&typeof N!="number"||En("children",t.textContent,N,p);continue;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"value":case"checked":case"selected":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":continue;case"dangerouslySetInnerHTML":A=t.innerHTML,N=N?N.__html:void 0,N!=null&&(N=Hm(t,N),A!==N&&(p[U]={__html:A}));continue;case"className":fa(t,U,"class",N,y,p);continue;case"tabIndex":fa(t,U,"tabindex",N,y,p);continue;case"style":y.delete(U),xl(t,N,p);continue;case"multiple":y.delete(U),En(U,t.multiple,N,p);continue;case"muted":y.delete(U),En(U,t.muted,N,p);continue;case"autoFocus":y.delete("autofocus"),En(U,t.autofocus,N,p);continue;case"data":if(n!=="object"){y.delete(U),A=t.getAttribute("data"),En(U,A,N,p);continue}case"src":case"href":if(!(N!==""||n==="a"&&U==="href"||n==="object"&&U==="data")){console.error(U==="src"?'An empty string ("") was passed to the %s attribute. This may cause the browser to download the whole page again over the network. To fix this, either do not render the element at all or pass null to %s instead of an empty string.':'An empty string ("") was passed to the %s attribute. To fix this, either do not render the element at all or pass null to %s instead of an empty string.',U,U);continue}Dd(t,U,U,N,y,p);continue;case"action":case"formAction":if(A=t.getAttribute(U),typeof N=="function"){y.delete(U.toLowerCase()),U==="formAction"?(y.delete("name"),y.delete("formenctype"),y.delete("formmethod"),y.delete("formtarget")):(y.delete("enctype"),y.delete("method"),y.delete("target"));continue}else if(A===rU){y.delete(U.toLowerCase()),En(U,"function",N,p);continue}Dd(t,U,U.toLowerCase(),N,y,p);continue;case"xlinkHref":Dd(t,U,"xlink:href",N,y,p);continue;case"contentEditable":Vm(t,U,"contenteditable",N,y,p);continue;case"spellCheck":Vm(t,U,"spellcheck",N,y,p);continue;case"draggable":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":Vm(t,U,U,N,y,p);continue;case"allowFullScreen":case"async":case"autoPlay":case"controls":case"default":case"defer":case"disabled":case"disablePictureInPicture":case"disableRemotePlayback":case"formNoValidate":case"hidden":case"loop":case"noModule":case"noValidate":case"open":case"playsInline":case"readOnly":case"required":case"reversed":case"scoped":case"seamless":case"itemScope":jm(t,U,U.toLowerCase(),N,y,p);continue;case"capture":case"download":e:{L=t;var J=A=U,ee=p;if(y.delete(J),L=L.getAttribute(J),L===null)switch(typeof N){case"undefined":case"function":case"symbol":break e;default:if(N===!1)break e}else if(N!=null)switch(typeof N){case"function":case"symbol":break;case"boolean":if(N===!0&&L==="")break e;break;default:if(Pe(N,A),L===""+N)break e}En(A,L,N,ee)}continue;case"cols":case"rows":case"size":case"span":e:{if(L=t,J=A=U,ee=p,y.delete(J),L=L.getAttribute(J),L===null)switch(typeof N){case"undefined":case"function":case"symbol":case"boolean":break e;default:if(isNaN(N)||1>N)break e}else if(N!=null)switch(typeof N){case"function":case"symbol":case"boolean":break;default:if(!(isNaN(N)||1>N)&&(Pe(N,A),L===""+N))break e}En(A,L,N,ee)}continue;case"rowSpan":Cc(t,U,"rowspan",N,y,p);continue;case"start":Cc(t,U,U,N,y,p);continue;case"xHeight":fa(t,U,"x-height",N,y,p);continue;case"xlinkActuate":fa(t,U,"xlink:actuate",N,y,p);continue;case"xlinkArcrole":fa(t,U,"xlink:arcrole",N,y,p);continue;case"xlinkRole":fa(t,U,"xlink:role",N,y,p);continue;case"xlinkShow":fa(t,U,"xlink:show",N,y,p);continue;case"xlinkTitle":fa(t,U,"xlink:title",N,y,p);continue;case"xlinkType":fa(t,U,"xlink:type",N,y,p);continue;case"xmlBase":fa(t,U,"xml:base",N,y,p);continue;case"xmlLang":fa(t,U,"xml:lang",N,y,p);continue;case"xmlSpace":fa(t,U,"xml:space",N,y,p);continue;case"inert":N!==""||nT[U]||(nT[U]=!0,console.error("Received an empty string for a boolean attribute `%s`. This will treat the attribute as if it were false. Either pass `false` to silence this warning, or pass `true` if you used an empty string in earlier versions of React to indicate this attribute is true.",U)),jm(t,U,U,N,y,p);continue;default:if(!(2<U.length)||U[0]!=="o"&&U[0]!=="O"||U[1]!=="n"&&U[1]!=="N"){L=Vv(U),A=!1,f.context===Cu&&n!=="svg"&&n!=="math"?y.delete(L.toLowerCase()):(J=U.toLowerCase(),J=Hs.hasOwnProperty(J)&&Hs[J]||null,J!==null&&J!==U&&(A=!0,y.delete(J)),y.delete(L));e:if(J=t,ee=L,L=N,_f(ee))if(J.hasAttribute(ee))J=J.getAttribute(ee),Pe(L,ee),L=J===""+L?L:J;else{switch(typeof L){case"function":case"symbol":break e;case"boolean":if(J=ee.toLowerCase().slice(0,5),J!=="data-"&&J!=="aria-")break e}L=L===void 0?void 0:null}else L=void 0;A||En(U,L,N,p)}}}return 0<y.size&&l.suppressHydrationWarning!==!0&&Rd(t,y,p),Object.keys(p).length===0?null:p}function MS(t,n){switch(t.length){case 0:return"";case 1:return t[0];case 2:return t[0]+" "+n+" "+t[1];default:return t.slice(0,-1).join(", ")+", "+n+" "+t[t.length-1]}}function na(t){switch(t){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}function IS(){if(typeof performance.getEntriesByType=="function"){for(var t=0,n=0,l=performance.getEntriesByType("resource"),f=0;f<l.length;f++){var p=l[f],y=p.transferSize,A=p.initiatorType,L=p.duration;if(y&&L&&na(A)){for(A=0,L=p.responseEnd,f+=1;f<l.length;f++){var N=l[f],U=N.startTime;if(U>L)break;var J=N.transferSize,ee=N.initiatorType;J&&na(ee)&&(N=N.responseEnd,A+=J*(N<L?1:(L-U)/(N-U)))}if(--f,n+=8*(y+A)/(p.duration/1e3),t++,10<t)break}}if(0<t)return n/t/1e6}return navigator.connection&&(t=navigator.connection.downlink,typeof t=="number")?t:5}function Ld(t){return t.nodeType===9?t:t.ownerDocument}function wS(t){switch(t){case ft:return Vg;case st:return aT;default:return Cu}}function cr(t,n){if(t===Cu)switch(n){case"svg":return Vg;case"math":return aT;default:return Cu}return t===Vg&&n==="foreignObject"?Cu:t}function Oc(t,n){return t==="textarea"||t==="noscript"||typeof n.children=="string"||typeof n.children=="number"||typeof n.children=="bigint"||typeof n.dangerouslySetInnerHTML=="object"&&n.dangerouslySetInnerHTML!==null&&n.dangerouslySetInnerHTML.__html!=null}function Bp(){var t=window.event;return t&&t.type==="popstate"?t===J1?!1:(J1=t,!0):(J1=null,!1)}function Al(){var t=window.event;return t&&t!==Wy?t.type:null}function Mc(){var t=window.event;return t&&t!==Wy?t.timeStamp:-1.1}function NS(t){setTimeout(function(){throw t})}function US(t,n,l){switch(n){case"button":case"input":case"select":case"textarea":l.autoFocus&&t.focus();break;case"img":l.src?t.src=l.src:l.srcSet&&(t.srcset=l.srcSet)}}function kS(){}function Ym(t,n,l,f){Xn(t,n,l,f),t[aa]=f}function qm(t){_o(t,"")}function Gb(t,n,l){t.nodeValue=l}function BS(t){if(!t.__reactWarnedAboutChildrenConflict){var n=t[aa]||null;if(n!==null){var l=vs(t);l!==null&&(typeof n.children=="string"||typeof n.children=="number"?(t.__reactWarnedAboutChildrenConflict=!0,we(l,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "children" text content using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})):n.dangerouslySetInnerHTML!=null&&(t.__reactWarnedAboutChildrenConflict=!0,we(l,function(){console.error('Cannot use a ref on a React element as a container to `createRoot` or `createPortal` if that element also sets "dangerouslySetInnerHTML" using React. It should be a leaf with no children. Otherwise it\'s ambiguous which children should be used.')})))}}}function so(t){return t==="head"}function zS(t,n){t.removeChild(n)}function FS(t,n){(t.nodeType===9?t.body:t.nodeName==="HTML"?t.ownerDocument.body:t).removeChild(n)}function lu(t,n){var l=n,f=0;do{var p=l.nextSibling;if(t.removeChild(l),p&&p.nodeType===8)if(l=p.data,l===Jy||l===iT){if(f===0){t.removeChild(p),cu(n);return}f--}else if(l===Zy||l===gf||l===ch||l===jg||l===uh)f++;else if(l===uU)dr(t.ownerDocument.documentElement);else if(l===fU){l=t.ownerDocument.head,dr(l);for(var y=l.firstChild;y;){var A=y.nextSibling,L=y.nodeName;y[qc]||L==="SCRIPT"||L==="STYLE"||L==="LINK"&&y.rel.toLowerCase()==="stylesheet"||l.removeChild(y),y=A}}else l===cU&&dr(t.ownerDocument.body);l=p}while(l);cu(n)}function _d(t,n){var l=t;t=0;do{var f=l.nextSibling;if(l.nodeType===1?n?(l._stashedDisplay=l.style.display,l.style.display="none"):(l.style.display=l._stashedDisplay||"",l.getAttribute("style")===""&&l.removeAttribute("style")):l.nodeType===3&&(n?(l._stashedText=l.nodeValue,l.nodeValue=""):l.nodeValue=l._stashedText||""),f&&f.nodeType===8)if(l=f.data,l===Jy){if(t===0)break;t--}else l!==Zy&&l!==gf&&l!==ch&&l!==jg||t++;l=f}while(l)}function PS(t){_d(t,!0)}function GS(t){t=t.style,typeof t.setProperty=="function"?t.setProperty("display","none","important"):t.display="none"}function $S(t){t.nodeValue=""}function HS(t){_d(t,!1)}function jS(t,n){n=n[dU],n=n!=null&&n.hasOwnProperty("display")?n.display:null,t.style.display=n==null||typeof n=="boolean"?"":(""+n).trim()}function VS(t,n){t.nodeValue=n}function Ic(t){var n=t.firstChild;for(n&&n.nodeType===10&&(n=n.nextSibling);n;){var l=n;switch(n=n.nextSibling,l.nodeName){case"HTML":case"HEAD":case"BODY":Ic(l),Yn(l);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(l.rel.toLowerCase()==="stylesheet")continue}t.removeChild(l)}}function YS(t,n,l,f){for(;t.nodeType===1;){var p=l;if(t.nodeName.toLowerCase()!==n.toLowerCase()){if(!f&&(t.nodeName!=="INPUT"||t.type!=="hidden"))break}else if(f){if(!t[qc])switch(n){case"meta":if(!t.hasAttribute("itemprop"))break;return t;case"link":if(y=t.getAttribute("rel"),y==="stylesheet"&&t.hasAttribute("data-precedence"))break;if(y!==p.rel||t.getAttribute("href")!==(p.href==null||p.href===""?null:p.href)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin)||t.getAttribute("title")!==(p.title==null?null:p.title))break;return t;case"style":if(t.hasAttribute("data-precedence"))break;return t;case"script":if(y=t.getAttribute("src"),(y!==(p.src==null?null:p.src)||t.getAttribute("type")!==(p.type==null?null:p.type)||t.getAttribute("crossorigin")!==(p.crossOrigin==null?null:p.crossOrigin))&&y&&t.hasAttribute("async")&&!t.hasAttribute("itemprop"))break;return t;default:return t}}else if(n==="input"&&t.type==="hidden"){Pe(p.name,"name");var y=p.name==null?null:""+p.name;if(p.type==="hidden"&&t.getAttribute("name")===y)return t}else return t;if(t=wa(t.nextSibling),t===null)break}return null}function qS(t,n,l){if(n==="")return null;for(;t.nodeType!==3;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!l||(t=wa(t.nextSibling),t===null))return null;return t}function Gt(t,n){for(;t.nodeType!==8;)if((t.nodeType!==1||t.nodeName!=="INPUT"||t.type!=="hidden")&&!n||(t=wa(t.nextSibling),t===null))return null;return t}function Cd(t){return t.data===gf||t.data===ch}function zp(t){return t.data===jg||t.data===gf&&t.ownerDocument.readyState!==o_}function KS(t,n){var l=t.ownerDocument;if(t.data===ch)t._reactRetry=n;else if(t.data!==gf||l.readyState!==o_)n();else{var f=function(){n(),l.removeEventListener("DOMContentLoaded",f)};l.addEventListener("DOMContentLoaded",f),t._reactRetry=f}}function wa(t){for(;t!=null;t=t.nextSibling){var n=t.nodeType;if(n===1||n===3)break;if(n===8){if(n=t.data,n===Zy||n===jg||n===gf||n===ch||n===uh||n===X1||n===r_)break;if(n===Jy||n===iT)return null}}return t}function XS(t){if(t.nodeType===1){for(var n=t.nodeName.toLowerCase(),l={},f=t.attributes,p=0;p<f.length;p++){var y=f[p];l[ur(y.name)]=y.name.toLowerCase()==="style"?ao(t):y.value}return{type:n,props:l}}return t.nodeType===8?t.data===uh?{type:"Activity",props:{}}:{type:"Suspense",props:{}}:t.nodeValue}function QS(t,n,l){return l===null||l[oU]!==!0?(t.nodeValue===n?t=null:(n=Fs(n),t=Fs(t.nodeValue)===n?null:t.nodeValue),t):null}function wc(t){t=t.nextSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l===Jy||l===iT){if(n===0)return wa(t.nextSibling);n--}else l!==Zy&&l!==jg&&l!==gf&&l!==ch&&l!==uh||n++}t=t.nextSibling}return null}function ru(t){t=t.previousSibling;for(var n=0;t;){if(t.nodeType===8){var l=t.data;if(l===Zy||l===jg||l===gf||l===ch||l===uh){if(n===0)return t;n--}else l!==Jy&&l!==iT||n++}t=t.previousSibling}return null}function Fp(t){cu(t)}function Km(t){cu(t)}function Pp(t){cu(t)}function fr(t,n,l,f,p){switch(p&&Mf(t,f.ancestorInfo),n=Ld(l),t){case"html":if(t=n.documentElement,!t)throw Error("React expected an <html> element (document.documentElement) to exist in the Document but one was not found. React never removes the documentElement for any Document it renders into so the cause is likely in some other script running on this page.");return t;case"head":if(t=n.head,!t)throw Error("React expected a <head> element (document.head) to exist in the Document but one was not found. React never removes the head for any Document it renders into so the cause is likely in some other script running on this page.");return t;case"body":if(t=n.body,!t)throw Error("React expected a <body> element (document.body) to exist in the Document but one was not found. React never removes the body for any Document it renders into so the cause is likely in some other script running on this page.");return t;default:throw Error("resolveSingletonInstance was called with an element type that is not supported. This is a bug in React.")}}function Rl(t,n,l,f){if(!l[mr]&&vs(l)){var p=l.tagName.toLowerCase();console.error("You are mounting a new %s component when a previous one has not first unmounted. It is an error to render more than one %s component at a time and attributes and children of these components will likely fail in unpredictable ways. Please only render a single instance of <%s> and if you need to mount a new one, ensure any previous ones have unmounted first.",p,p,p)}switch(t){case"html":case"head":case"body":break;default:console.error("acquireSingletonInstance was called with an element type that is not supported. This is a bug in React.")}for(p=l.attributes;p.length;)l.removeAttributeNode(p[0]);mn(l,t,n),l[gn]=f,l[aa]=n}function dr(t){for(var n=t.attributes;n.length;)t.removeAttributeNode(n[0]);Yn(t)}function Xm(t){return typeof t.getRootNode=="function"?t.getRootNode():t.nodeType===9?t:t.ownerDocument}function Gp(t,n,l){var f=Yg;if(f&&typeof n=="string"&&n){var p=jt(n);p='link[rel="'+t+'"][href="'+p+'"]',typeof l=="string"&&(p+='[crossorigin="'+l+'"]'),m_.has(p)||(m_.add(p),t={rel:t,crossOrigin:l,href:n},f.querySelector(p)===null&&(n=f.createElement("link"),mn(n,"link",t),On(n),f.head.appendChild(n)))}}function $p(t,n,l,f){var p=(p=Na.current)?Xm(p):null;if(!p)throw Error('"resourceRoot" was expected to exist. This is a bug in React.');switch(t){case"meta":case"title":return null;case"style":return typeof l.precedence=="string"&&typeof l.href=="string"?(l=ou(l.href),n=Xa(p).hoistableStyles,f=n.get(l),f||(f={type:"style",instance:null,count:0,state:null},n.set(l,f)),f):{type:"void",instance:null,count:0,state:null};case"link":if(l.rel==="stylesheet"&&typeof l.href=="string"&&typeof l.precedence=="string"){t=ou(l.href);var y=Xa(p).hoistableStyles,A=y.get(t);if(!A&&(p=p.ownerDocument||p,A={type:"stylesheet",instance:null,count:0,state:{loading:dh,preload:null}},y.set(t,A),(y=p.querySelector(Md(t)))&&!y._p&&(A.instance=y,A.state.loading=ev|Pl),!Gl.has(t))){var L={rel:"preload",as:"style",href:l.href,crossOrigin:l.crossOrigin,integrity:l.integrity,media:l.media,hrefLang:l.hrefLang,referrerPolicy:l.referrerPolicy};Gl.set(t,L),y||ZS(p,t,L,A.state)}if(n&&f===null)throw l=`
201
+
202
+ - `+Od(n)+`
203
+ + `+Od(l),Error("Expected <link> not to update to be updated to a stylesheet with precedence. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+l);return A}if(n&&f!==null)throw l=`
204
+
205
+ - `+Od(n)+`
206
+ + `+Od(l),Error("Expected stylesheet with precedence to not be updated to a different kind of <link>. Check the `rel`, `href`, and `precedence` props of this component. Alternatively, check whether two different <link> components render in the same slot or share the same key."+l);return null;case"script":return n=l.async,l=l.src,typeof l=="string"&&n&&typeof n!="function"&&typeof n!="symbol"?(l=uu(l),n=Xa(p).hoistableScripts,f=n.get(l),f||(f={type:"script",instance:null,count:0,state:null},n.set(l,f)),f):{type:"void",instance:null,count:0,state:null};default:throw Error('getResource encountered a type it did not expect: "'+t+'". this is a bug in React.')}}function Od(t){var n=0,l="<link";return typeof t.rel=="string"?(n++,l+=' rel="'+t.rel+'"'):Ua.call(t,"rel")&&(n++,l+=' rel="'+(t.rel===null?"null":"invalid type "+typeof t.rel)+'"'),typeof t.href=="string"?(n++,l+=' href="'+t.href+'"'):Ua.call(t,"href")&&(n++,l+=' href="'+(t.href===null?"null":"invalid type "+typeof t.href)+'"'),typeof t.precedence=="string"?(n++,l+=' precedence="'+t.precedence+'"'):Ua.call(t,"precedence")&&(n++,l+=" precedence={"+(t.precedence===null?"null":"invalid type "+typeof t.precedence)+"}"),Object.getOwnPropertyNames(t).length>n&&(l+=" ..."),l+" />"}function ou(t){return'href="'+jt(t)+'"'}function Md(t){return'link[rel="stylesheet"]['+t+"]"}function Qm(t){return ht({},t,{"data-precedence":t.precedence,precedence:null})}function ZS(t,n,l,f){t.querySelector('link[rel="preload"][as="style"]['+n+"]")?f.loading=ev:(n=t.createElement("link"),f.preload=n,n.addEventListener("load",function(){return f.loading|=ev}),n.addEventListener("error",function(){return f.loading|=d_}),mn(n,"link",l),On(n),t.head.appendChild(n))}function uu(t){return'[src="'+jt(t)+'"]'}function Id(t){return"script[async]"+t}function Zm(t,n,l){if(n.count++,n.instance===null)switch(n.type){case"style":var f=t.querySelector('style[data-href~="'+jt(l.href)+'"]');if(f)return n.instance=f,On(f),f;var p=ht({},l,{"data-href":l.href,"data-precedence":l.precedence,href:null,precedence:null});return f=(t.ownerDocument||t).createElement("style"),On(f),mn(f,"style",p),Nc(f,l.precedence,t),n.instance=f;case"stylesheet":p=ou(l.href);var y=t.querySelector(Md(p));if(y)return n.state.loading|=Pl,n.instance=y,On(y),y;f=Qm(l),(p=Gl.get(p))&&Hp(f,p),y=(t.ownerDocument||t).createElement("link"),On(y);var A=y;return A._p=new Promise(function(L,N){A.onload=L,A.onerror=N}),mn(y,"link",f),n.state.loading|=Pl,Nc(y,l.precedence,t),n.instance=y;case"script":return y=uu(l.src),(p=t.querySelector(Id(y)))?(n.instance=p,On(p),p):(f=l,(p=Gl.get(y))&&(f=ht({},l),jp(f,p)),t=t.ownerDocument||t,p=t.createElement("script"),On(p),mn(p,"link",f),t.head.appendChild(p),n.instance=p);case"void":return null;default:throw Error('acquireResource encountered a resource type it did not expect: "'+n.type+'". this is a bug in React.')}else n.type==="stylesheet"&&(n.state.loading&Pl)===dh&&(f=n.instance,n.state.loading|=Pl,Nc(f,l.precedence,t));return n.instance}function Nc(t,n,l){for(var f=l.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),p=f.length?f[f.length-1]:null,y=p,A=0;A<f.length;A++){var L=f[A];if(L.dataset.precedence===n)y=L;else if(y!==p)break}y?y.parentNode.insertBefore(t,y.nextSibling):(n=l.nodeType===9?l.head:l,n.insertBefore(t,n.firstChild))}function Hp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.title==null&&(t.title=n.title)}function jp(t,n){t.crossOrigin==null&&(t.crossOrigin=n.crossOrigin),t.referrerPolicy==null&&(t.referrerPolicy=n.referrerPolicy),t.integrity==null&&(t.integrity=n.integrity)}function Uc(t,n,l){if(sT===null){var f=new Map,p=sT=new Map;p.set(l,f)}else p=sT,f=p.get(l),f||(f=new Map,p.set(l,f));if(f.has(t))return f;for(f.set(t,null),l=l.getElementsByTagName(t),p=0;p<l.length;p++){var y=l[p];if(!(y[qc]||y[gn]||t==="link"&&y.getAttribute("rel")==="stylesheet")&&y.namespaceURI!==ft){var A=y.getAttribute(n)||"";A=t+A;var L=f.get(A);L?L.push(y):f.set(A,[y])}}return f}function JS(t,n,l){t=t.ownerDocument||t,t.head.insertBefore(l,n==="title"?t.querySelector("head > title"):null)}function WS(t,n,l){var f=!l.ancestorInfo.containerTagInScope;if(l.context===Vg||n.itemProp!=null)return!f||n.itemProp==null||t!=="meta"&&t!=="title"&&t!=="style"&&t!=="link"&&t!=="script"||console.error("Cannot render a <%s> outside the main document if it has an `itemProp` prop. `itemProp` suggests the tag belongs to an `itemScope` which can appear anywhere in the DOM. If you were intending for React to hoist this <%s> remove the `itemProp` prop. Otherwise, try moving this tag into the <head> or <body> of the Document.",t,t),!1;switch(t){case"meta":case"title":return!0;case"style":if(typeof n.precedence!="string"||typeof n.href!="string"||n.href===""){f&&console.error('Cannot render a <style> outside the main document without knowing its precedence and a unique href key. React can hoist and deduplicate <style> tags if you provide a `precedence` prop along with an `href` prop that does not conflict with the `href` values used in any other hoisted <style> or <link rel="stylesheet" ...> tags. Note that hoisting <style> tags is considered an advanced feature that most will not use directly. Consider moving the <style> tag to the <head> or consider adding a `precedence="default"` and `href="some unique resource identifier"`.');break}return!0;case"link":if(typeof n.rel!="string"||typeof n.href!="string"||n.href===""||n.onLoad||n.onError){if(n.rel==="stylesheet"&&typeof n.precedence=="string"){t=n.href;var p=n.onError,y=n.disabled;l=[],n.onLoad&&l.push("`onLoad`"),p&&l.push("`onError`"),y!=null&&l.push("`disabled`"),p=MS(l,"and"),p+=l.length===1?" prop":" props",y=l.length===1?"an "+p:"the "+p,l.length&&console.error('React encountered a <link rel="stylesheet" href="%s" ... /> with a `precedence` prop that also included %s. The presence of loading and error handlers indicates an intent to manage the stylesheet loading state from your from your Component code and React will not hoist or deduplicate this stylesheet. If your intent was to have React hoist and deduplciate this stylesheet using the `precedence` prop remove the %s, otherwise remove the `precedence` prop.',t,y,p)}f&&(typeof n.rel!="string"||typeof n.href!="string"||n.href===""?console.error("Cannot render a <link> outside the main document without a `rel` and `href` prop. Try adding a `rel` and/or `href` prop to this <link> or moving the link into the <head> tag"):(n.onError||n.onLoad)&&console.error("Cannot render a <link> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."));break}switch(n.rel){case"stylesheet":return t=n.precedence,n=n.disabled,typeof t!="string"&&f&&console.error('Cannot render a <link rel="stylesheet" /> outside the main document without knowing its precedence. Consider adding precedence="default" or moving it into the root <head> tag.'),typeof t=="string"&&n==null;default:return!0}case"script":if(t=n.async&&typeof n.async!="function"&&typeof n.async!="symbol",!t||n.onLoad||n.onError||!n.src||typeof n.src!="string"){f&&(t?n.onLoad||n.onError?console.error("Cannot render a <script> with onLoad or onError listeners outside the main document. Try removing onLoad={...} and onError={...} or moving it into the root <head> tag or somewhere in the <body>."):console.error("Cannot render a <script> outside the main document without `async={true}` and a non-empty `src` prop. Ensure there is a valid `src` and either make the script async or move it into the root <head> tag or somewhere in the <body>."):console.error('Cannot render a sync or defer <script> outside the main document without knowing its order. Try adding async="" or moving it into the root <head> tag.'));break}return!0;case"noscript":case"template":f&&console.error("Cannot render <%s> outside the main document. Try moving it into the root <head> tag.",t)}return!1}function St(t){return!(t.type==="stylesheet"&&(t.state.loading&h_)===dh)}function Vp(t,n,l,f){if(l.type==="stylesheet"&&(typeof f.media!="string"||matchMedia(f.media).matches!==!1)&&(l.state.loading&Pl)===dh){if(l.instance===null){var p=ou(f.href),y=n.querySelector(Md(p));if(y){n=y._p,n!==null&&typeof n=="object"&&typeof n.then=="function"&&(t.count++,t=kc.bind(t),n.then(t,t)),l.state.loading|=Pl,l.instance=y,On(y);return}y=n.ownerDocument||n,f=Qm(f),(p=Gl.get(p))&&Hp(f,p),y=y.createElement("link"),On(y);var A=y;A._p=new Promise(function(L,N){A.onload=L,A.onerror=N}),mn(y,"link",f),l.instance=y}t.stylesheets===null&&(t.stylesheets=new Map),t.stylesheets.set(l,n),(n=l.state.preload)&&(l.state.loading&h_)===dh&&(t.count++,l=kc.bind(t),n.addEventListener("load",l),n.addEventListener("error",l))}}function Jm(t,n){return t.stylesheets&&t.count===0&&wd(t,t.stylesheets),0<t.count||0<t.imgCount?function(l){var f=setTimeout(function(){if(t.stylesheets&&wd(t,t.stylesheets),t.unsuspend){var y=t.unsuspend;t.unsuspend=null,y()}},gU+n);0<t.imgBytes&&ex===0&&(ex=125*IS()*yU);var p=setTimeout(function(){if(t.waitingForImages=!1,t.count===0&&(t.stylesheets&&wd(t,t.stylesheets),t.unsuspend)){var y=t.unsuspend;t.unsuspend=null,y()}},(t.imgBytes>ex?50:pU)+n);return t.unsuspend=l,function(){t.unsuspend=null,clearTimeout(f),clearTimeout(p)}}:null}function kc(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)wd(this,this.stylesheets);else if(this.unsuspend){var t=this.unsuspend;this.unsuspend=null,t()}}}function wd(t,n){t.stylesheets=null,t.unsuspend!==null&&(t.count++,lT=new Map,n.forEach(Yp,t),lT=null,kc.call(t))}function Yp(t,n){if(!(n.state.loading&Pl)){var l=lT.get(t);if(l)var f=l.get(tx);else{l=new Map,lT.set(t,l);for(var p=t.querySelectorAll("link[data-precedence],style[data-precedence]"),y=0;y<p.length;y++){var A=p[y];(A.nodeName==="LINK"||A.getAttribute("media")!=="not all")&&(l.set(A.dataset.precedence,A),f=A)}f&&l.set(tx,f)}p=n.instance,A=p.getAttribute("data-precedence"),y=l.get(A)||f,y===f&&l.set(tx,p),l.set(A,p),this.count++,f=kc.bind(this),p.addEventListener("load",f),p.addEventListener("error",f),y?y.parentNode.insertBefore(p,y.nextSibling):(t=t.nodeType===9?t.head:t,t.insertBefore(p,t.firstChild)),n.state.loading|=Pl}}function Nd(t,n,l,f,p,y,A,L,N){for(this.tag=1,this.containerInfo=t,this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=fh,this.callbackNode=this.next=this.pendingContext=this.context=this.cancelPendingCommit=null,this.callbackPriority=0,this.expirationTimes=Vl(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Vl(0),this.hiddenUpdates=Vl(null),this.identifierPrefix=f,this.onUncaughtError=p,this.onCaughtError=y,this.onRecoverableError=A,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=N,this.incompleteTransitions=new Map,this.passiveEffectDuration=this.effectDuration=-0,this.memoizedUpdaters=new Set,t=this.pendingUpdatersLaneMap=[],n=0;31>n;n++)t.push(new Set);this._debugRootType=l?"hydrateRoot()":"createRoot()"}function Ud(t,n,l,f,p,y,A,L,N,U,J,ee){return t=new Nd(t,n,l,A,N,U,J,ee,L),n=GN,y===!0&&(n|=ga|gr),n|=mt,y=R(3,null,null,n),t.current=y,y.stateNode=t,n=Zh(),zo(n),t.pooledCache=n,zo(n),y.memoizedState={element:f,isDehydrated:l,cache:n},Tt(y),t}function eE(t){return t?(t=Wc,t):Wc}function Wm(t,n,l,f,p,y){if(Qn&&typeof Qn.onScheduleFiberRoot=="function")try{Qn.onScheduleFiberRoot(mu,f,l)}catch(A){Ll||(Ll=!0,console.error("React instrumentation encountered an error: %o",A))}p=eE(p),f.context===null?f.context=p:f.pendingContext=p,Dl&&ma!==null&&!v_&&(v_=!0,console.error(`Render methods should be a pure function of props and state; triggering nested component updates from render is not allowed. If necessary, trigger nested updates in componentDidUpdate.
207
+
208
+ Check the render method of %s.`,$(ma)||"Unknown")),f=qn(n),f.payload={element:l},y=y===void 0?null:y,y!==null&&(typeof y!="function"&&console.error("Expected the last optional `callback` argument to be a function. Instead received: %s.",y),f.callback=y),l=ol(t,f,n),l!==null&&(sl(n,"root.render()",null),We(l,t,n),is(l,t,n))}function tE(t,n){if(t=t.memoizedState,t!==null&&t.dehydrated!==null){var l=t.retryLane;t.retryLane=l!==0&&l<n?l:n}}function qp(t,n){tE(t,n),(t=t.alternate)&&tE(t,n)}function Kp(t){if(t.tag===13||t.tag===31){var n=Ci(t,67108864);n!==null&&We(n,t,67108864),qp(t,67108864)}}function Xp(t){if(t.tag===13||t.tag===31){var n=Mi(t);n=Zs(n);var l=Ci(t,n);l!==null&&We(l,t,n),qp(t,n)}}function qt(){return ma}function Qp(t,n,l,f){var p=ge.T;ge.T=null;var y=Ut.p;try{Ut.p=Zn,Zp(t,n,l,f)}finally{Ut.p=y,ge.T=p}}function Ti(t,n,l,f){var p=ge.T;ge.T=null;var y=Ut.p;try{Ut.p=xi,Zp(t,n,l,f)}finally{Ut.p=y,ge.T=p}}function Zp(t,n,l,f){if(oT){var p=eg(f);if(p===null)Bs(t,n,f,uT,l),ng(t,f);else if(nE(p,t,n,l,f))f.stopPropagation();else if(ng(t,f),n&4&&-1<SU.indexOf(t)){for(;p!==null;){var y=vs(p);if(y!==null)switch(y.tag){case 3:if(y=y.stateNode,y.current.memoizedState.isDehydrated){var A=Fn(y.pendingLanes);if(A!==0){var L=y;for(L.pendingLanes|=2,L.entangledLanes|=2;A;){var N=1<<31-bi(A);L.entanglements[1]|=N,A&=~N}ca(y),(Ot&(Ri|qs))===ki&&(VE=oi()+YL,Tl(0))}}break;case 31:case 13:L=Ci(y,2),L!==null&&We(L,y,2),Ia(),qp(y,2)}if(y=eg(f),y===null&&Bs(t,n,f,uT,l),y===p)break;p=y}p!==null&&f.stopPropagation()}else Bs(t,n,f,null,l)}}function eg(t){return t=Ts(t),Jp(t)}function Jp(t){if(uT=null,t=$i(t),t!==null){var n=w(t);if(n===null)t=null;else{var l=n.tag;if(l===13){if(t=B(n),t!==null)return t;t=null}else if(l===31){if(t=z(n),t!==null)return t;t=null}else if(l===3){if(n.stateNode.current.memoizedState.isDehydrated)return n.tag===3?n.stateNode.containerInfo:null;t=null}else n!==t&&(t=null)}}return uT=t,null}function tg(t){switch(t){case"beforetoggle":case"cancel":case"click":case"close":case"contextmenu":case"copy":case"cut":case"auxclick":case"dblclick":case"dragend":case"dragstart":case"drop":case"focusin":case"focusout":case"input":case"invalid":case"keydown":case"keypress":case"keyup":case"mousedown":case"mouseup":case"paste":case"pause":case"play":case"pointercancel":case"pointerdown":case"pointerup":case"ratechange":case"reset":case"resize":case"seeked":case"submit":case"toggle":case"touchcancel":case"touchend":case"touchstart":case"volumechange":case"change":case"selectionchange":case"textInput":case"compositionstart":case"compositionend":case"compositionupdate":case"beforeblur":case"afterblur":case"beforeinput":case"blur":case"fullscreenchange":case"focus":case"hashchange":case"popstate":case"select":case"selectstart":return Zn;case"drag":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"mousemove":case"mouseout":case"mouseover":case"pointermove":case"pointerout":case"pointerover":case"scroll":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return xi;case"message":switch(Gd()){case oy:return Zn;case fg:return xi;case hu:case oE:return wi;case dg:return co;default:return wi}default:return wi}}function ng(t,n){switch(t){case"focusin":case"focusout":pf=null;break;case"dragenter":case"dragleave":yf=null;break;case"mouseover":case"mouseout":vf=null;break;case"pointerover":case"pointerout":nv.delete(n.pointerId);break;case"gotpointercapture":case"lostpointercapture":iv.delete(n.pointerId)}}function lo(t,n,l,f,p,y){return t===null||t.nativeEvent!==y?(t={blockedOn:n,domEventName:l,eventSystemFlags:f,nativeEvent:y,targetContainers:[p]},n!==null&&(n=vs(n),n!==null&&Kp(n)),t):(t.eventSystemFlags|=f,n=t.targetContainers,p!==null&&n.indexOf(p)===-1&&n.push(p),t)}function nE(t,n,l,f,p){switch(n){case"focusin":return pf=lo(pf,t,n,l,f,p),!0;case"dragenter":return yf=lo(yf,t,n,l,f,p),!0;case"mouseover":return vf=lo(vf,t,n,l,f,p),!0;case"pointerover":var y=p.pointerId;return nv.set(y,lo(nv.get(y)||null,t,n,l,f,p)),!0;case"gotpointercapture":return y=p.pointerId,iv.set(y,lo(iv.get(y)||null,t,n,l,f,p)),!0}return!1}function Wp(t){var n=$i(t.target);if(n!==null){var l=w(n);if(l!==null){if(n=l.tag,n===13){if(n=B(l),n!==null){t.blockedOn=n,Ht(t.priority,function(){Xp(l)});return}}else if(n===31){if(n=z(l),n!==null){t.blockedOn=n,Ht(t.priority,function(){Xp(l)});return}}else if(n===3&&l.stateNode.current.memoizedState.isDehydrated){t.blockedOn=l.tag===3?l.stateNode.containerInfo:null;return}}}t.blockedOn=null}function Bc(t){if(t.blockedOn!==null)return!1;for(var n=t.targetContainers;0<n.length;){var l=eg(t.nativeEvent);if(l===null){l=t.nativeEvent;var f=new l.constructor(l.type,l),p=f;hy!==null&&console.error("Expected currently replaying event to be null. This error is likely caused by a bug in React. Please file an issue."),hy=p,l.target.dispatchEvent(f),hy===null&&console.error("Expected currently replaying event to not be null. This error is likely caused by a bug in React. Please file an issue."),hy=null}else return n=vs(l),n!==null&&Kp(n),t.blockedOn=l,!1;n.shift()}return!0}function ig(t,n,l){Bc(t)&&l.delete(n)}function $b(){nx=!1,pf!==null&&Bc(pf)&&(pf=null),yf!==null&&Bc(yf)&&(yf=null),vf!==null&&Bc(vf)&&(vf=null),nv.forEach(ig),iv.forEach(ig)}function kd(t,n){t.blockedOn===n&&(t.blockedOn=null,nx||(nx=!0,Un.unstable_scheduleCallback(Un.unstable_NormalPriority,$b)))}function iE(t){cT!==t&&(cT=t,Un.unstable_scheduleCallback(Un.unstable_NormalPriority,function(){cT===t&&(cT=null);for(var n=0;n<t.length;n+=3){var l=t[n],f=t[n+1],p=t[n+2];if(typeof f!="function"){if(Jp(f||l)===null)continue;break}var y=vs(l);y!==null&&(t.splice(n,3),n-=3,l={pending:!0,data:p,method:l.method,action:f},Object.freeze(l),ar(y,l,f,p))}}))}function cu(t){function n(N){return kd(N,t)}pf!==null&&kd(pf,t),yf!==null&&kd(yf,t),vf!==null&&kd(vf,t),nv.forEach(n),iv.forEach(n);for(var l=0;l<Sf.length;l++){var f=Sf[l];f.blockedOn===t&&(f.blockedOn=null)}for(;0<Sf.length&&(l=Sf[0],l.blockedOn===null);)Wp(l),l.blockedOn===null&&Sf.shift();if(l=(t.ownerDocument||t).$$reactFormReplay,l!=null)for(f=0;f<l.length;f+=3){var p=l[f],y=l[f+1],A=p[aa]||null;if(typeof y=="function")A||iE(l);else if(A){var L=null;if(y&&y.hasAttribute("formAction")){if(p=y,A=y[aa]||null)L=A.formAction;else if(Jp(p)!==null)continue}else L=A.action;typeof L=="function"?l[f+1]=L:(l.splice(f,3),f-=3),iE(l)}}}function aE(){function t(y){y.canIntercept&&y.info==="react-transition"&&y.intercept({handler:function(){return new Promise(function(A){return p=A})},focusReset:"manual",scroll:"manual"})}function n(){p!==null&&(p(),p=null),f||setTimeout(l,20)}function l(){if(!f&&!navigation.transition){var y=navigation.currentEntry;y&&y.url!=null&&navigation.navigate(y.url,{state:y.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var f=!1,p=null;return navigation.addEventListener("navigate",t),navigation.addEventListener("navigatesuccess",n),navigation.addEventListener("navigateerror",n),setTimeout(l,100),function(){f=!0,navigation.removeEventListener("navigate",t),navigation.removeEventListener("navigatesuccess",n),navigation.removeEventListener("navigateerror",n),p!==null&&(p(),p=null)}}}function ey(t){this._internalRoot=t}function Ps(t){this._internalRoot=t}function ty(t){t[mr]&&(t._reactRootContainer?console.error("You are calling ReactDOMClient.createRoot() on a container that was previously passed to ReactDOM.render(). This is not supported."):console.error("You are calling ReactDOMClient.createRoot() on a container that has already been passed to createRoot() before. Instead, call root.render() on the existing root instead if you want to update it."))}typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStart(Error());var Un=lx(),Bd=$e,Hb=Ef,ht=Object.assign,sE=Symbol.for("react.element"),rs=Symbol.for("react.transitional.element"),ro=Symbol.for("react.portal"),zc=Symbol.for("react.fragment"),ia=Symbol.for("react.strict_mode"),zd=Symbol.for("react.profiler"),ag=Symbol.for("react.consumer"),Gs=Symbol.for("react.context"),Fc=Symbol.for("react.forward_ref"),fu=Symbol.for("react.suspense"),ha=Symbol.for("react.suspense_list"),Fd=Symbol.for("react.memo"),Ii=Symbol.for("react.lazy"),$s=Symbol.for("react.activity"),jb=Symbol.for("react.memo_cache_sentinel"),lE=Symbol.iterator,Pc=Symbol.for("react.client.reference"),Hn=Array.isArray,ge=Bd.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Ut=Hb.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Vb=Object.freeze({pending:!1,data:null,method:null,action:null}),ny=[],iy=[],hr=-1,oo=me(null),Gc=me(null),Na=me(null),uo=me(null),$c=0,rE,du,Hc,ay,Pd,sg,lg;_e.__reactDisabledLog=!0;var jc,sy,rg=!1,ly=new(typeof WeakMap=="function"?WeakMap:Map),ma=null,Dl=!1,Ua=Object.prototype.hasOwnProperty,ry=Un.unstable_scheduleCallback,og=Un.unstable_cancelCallback,ug=Un.unstable_shouldYield,cg=Un.unstable_requestPaint,oi=Un.unstable_now,Gd=Un.unstable_getCurrentPriorityLevel,oy=Un.unstable_ImmediatePriority,fg=Un.unstable_UserBlockingPriority,hu=Un.unstable_NormalPriority,oE=Un.unstable_LowPriority,dg=Un.unstable_IdlePriority,uy=Un.log,uE=Un.unstable_setDisableYieldValue,mu=null,Qn=null,Ll=!1,_l=typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u",bi=Math.clz32?Math.clz32:Va,cy=Math.log,hg=Math.LN2,Vc=256,$d=262144,Yc=4194304,Zn=2,xi=8,wi=32,co=268435456,os=Math.random().toString(36).slice(2),gn="__reactFiber$"+os,aa="__reactProps$"+os,mr="__reactContainer$"+os,gu="__reactEvents$"+os,Yb="__reactListeners$"+os,cE="__reactHandles$"+os,Hd="__reactResources$"+os,qc="__reactMarker$"+os,fE=new Set,Cl={},Kc={},dE={button:!0,checkbox:!0,image:!0,hidden:!0,radio:!0,reset:!0,submit:!0},Xc=RegExp("^[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),fy={},mg={},gg=/[\n"\\]/g,dy=!1,hE=!1,jd=!1,a=!1,r=!1,c=!1,m=["value","defaultValue"],T=!1,x=/["'&<>\n\t]|^\s|\s$/,C="address applet area article aside base basefont bgsound blockquote body br button caption center col colgroup dd details dir div dl dt embed fieldset figcaption figure footer form frame frameset h1 h2 h3 h4 h5 h6 head header hgroup hr html iframe img input isindex li link listing main marquee menu menuitem meta nav noembed noframes noscript object ol p param plaintext pre script section select source style summary table tbody td template textarea tfoot th thead title tr track ul wbr xmp".split(" "),k="applet caption html table td th marquee object template foreignObject desc title".split(" "),Y=k.concat(["button"]),ue="dd dt li option optgroup p rp rt".split(" "),ve={current:null,formTag:null,aTagInScope:null,buttonTagInScope:null,nobrTagInScope:null,pTagInButtonScope:null,listItemTagAutoclosing:null,dlItemTagAutoclosing:null,containerTagInScope:null,implicitRootScope:!1},Ae={},ce={animation:"animationDelay animationDirection animationDuration animationFillMode animationIterationCount animationName animationPlayState animationTimingFunction".split(" "),background:"backgroundAttachment backgroundClip backgroundColor backgroundImage backgroundOrigin backgroundPositionX backgroundPositionY backgroundRepeat backgroundSize".split(" "),backgroundPosition:["backgroundPositionX","backgroundPositionY"],border:"borderBottomColor borderBottomStyle borderBottomWidth borderImageOutset borderImageRepeat borderImageSlice borderImageSource borderImageWidth borderLeftColor borderLeftStyle borderLeftWidth borderRightColor borderRightStyle borderRightWidth borderTopColor borderTopStyle borderTopWidth".split(" "),borderBlockEnd:["borderBlockEndColor","borderBlockEndStyle","borderBlockEndWidth"],borderBlockStart:["borderBlockStartColor","borderBlockStartStyle","borderBlockStartWidth"],borderBottom:["borderBottomColor","borderBottomStyle","borderBottomWidth"],borderColor:["borderBottomColor","borderLeftColor","borderRightColor","borderTopColor"],borderImage:["borderImageOutset","borderImageRepeat","borderImageSlice","borderImageSource","borderImageWidth"],borderInlineEnd:["borderInlineEndColor","borderInlineEndStyle","borderInlineEndWidth"],borderInlineStart:["borderInlineStartColor","borderInlineStartStyle","borderInlineStartWidth"],borderLeft:["borderLeftColor","borderLeftStyle","borderLeftWidth"],borderRadius:["borderBottomLeftRadius","borderBottomRightRadius","borderTopLeftRadius","borderTopRightRadius"],borderRight:["borderRightColor","borderRightStyle","borderRightWidth"],borderStyle:["borderBottomStyle","borderLeftStyle","borderRightStyle","borderTopStyle"],borderTop:["borderTopColor","borderTopStyle","borderTopWidth"],borderWidth:["borderBottomWidth","borderLeftWidth","borderRightWidth","borderTopWidth"],columnRule:["columnRuleColor","columnRuleStyle","columnRuleWidth"],columns:["columnCount","columnWidth"],flex:["flexBasis","flexGrow","flexShrink"],flexFlow:["flexDirection","flexWrap"],font:"fontFamily fontFeatureSettings fontKerning fontLanguageOverride fontSize fontSizeAdjust fontStretch fontStyle fontVariant fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition fontWeight lineHeight".split(" "),fontVariant:"fontVariantAlternates fontVariantCaps fontVariantEastAsian fontVariantLigatures fontVariantNumeric fontVariantPosition".split(" "),gap:["columnGap","rowGap"],grid:"gridAutoColumns gridAutoFlow gridAutoRows gridTemplateAreas gridTemplateColumns gridTemplateRows".split(" "),gridArea:["gridColumnEnd","gridColumnStart","gridRowEnd","gridRowStart"],gridColumn:["gridColumnEnd","gridColumnStart"],gridColumnGap:["columnGap"],gridGap:["columnGap","rowGap"],gridRow:["gridRowEnd","gridRowStart"],gridRowGap:["rowGap"],gridTemplate:["gridTemplateAreas","gridTemplateColumns","gridTemplateRows"],listStyle:["listStyleImage","listStylePosition","listStyleType"],margin:["marginBottom","marginLeft","marginRight","marginTop"],marker:["markerEnd","markerMid","markerStart"],mask:"maskClip maskComposite maskImage maskMode maskOrigin maskPositionX maskPositionY maskRepeat maskSize".split(" "),maskPosition:["maskPositionX","maskPositionY"],outline:["outlineColor","outlineStyle","outlineWidth"],overflow:["overflowX","overflowY"],padding:["paddingBottom","paddingLeft","paddingRight","paddingTop"],placeContent:["alignContent","justifyContent"],placeItems:["alignItems","justifyItems"],placeSelf:["alignSelf","justifySelf"],textDecoration:["textDecorationColor","textDecorationLine","textDecorationStyle"],textEmphasis:["textEmphasisColor","textEmphasisStyle"],transition:["transitionDelay","transitionDuration","transitionProperty","transitionTimingFunction"],wordWrap:["overflowWrap"]},pe=/([A-Z])/g,ze=/^ms-/,Xe=/^(?:webkit|moz|o)[A-Z]/,Kt=/^-ms-/,ie=/-(.)/g,W=/;\s*$/,oe={},Te={},Ye=!1,Ct=!1,Ge=new Set("animationIterationCount aspectRatio borderImageOutset borderImageSlice borderImageWidth boxFlex boxFlexGroup boxOrdinalGroup columnCount columns flex flexGrow flexPositive flexShrink flexNegative flexOrder gridArea gridRow gridRowEnd gridRowSpan gridRowStart gridColumn gridColumnEnd gridColumnSpan gridColumnStart fontWeight lineClamp lineHeight opacity order orphans scale tabSize widows zIndex zoom fillOpacity floodOpacity stopOpacity strokeDasharray strokeDashoffset strokeMiterlimit strokeOpacity strokeWidth MozAnimationIterationCount MozBoxFlex MozBoxFlexGroup MozLineClamp msAnimationIterationCount msFlex msZoom msFlexGrow msFlexNegative msFlexOrder msFlexPositive msFlexShrink msGridColumn msGridColumnSpan msGridRow msGridRowSpan WebkitAnimationIterationCount WebkitBoxFlex WebKitBoxFlexGroup WebkitBoxOrdinalGroup WebkitColumnCount WebkitColumns WebkitFlex WebkitFlexGrow WebkitFlexPositive WebkitFlexShrink WebkitLineClamp".split(" ")),st="http://www.w3.org/1998/Math/MathML",ft="http://www.w3.org/2000/svg",It=new Map([["acceptCharset","accept-charset"],["htmlFor","for"],["httpEquiv","http-equiv"],["crossOrigin","crossorigin"],["accentHeight","accent-height"],["alignmentBaseline","alignment-baseline"],["arabicForm","arabic-form"],["baselineShift","baseline-shift"],["capHeight","cap-height"],["clipPath","clip-path"],["clipRule","clip-rule"],["colorInterpolation","color-interpolation"],["colorInterpolationFilters","color-interpolation-filters"],["colorProfile","color-profile"],["colorRendering","color-rendering"],["dominantBaseline","dominant-baseline"],["enableBackground","enable-background"],["fillOpacity","fill-opacity"],["fillRule","fill-rule"],["floodColor","flood-color"],["floodOpacity","flood-opacity"],["fontFamily","font-family"],["fontSize","font-size"],["fontSizeAdjust","font-size-adjust"],["fontStretch","font-stretch"],["fontStyle","font-style"],["fontVariant","font-variant"],["fontWeight","font-weight"],["glyphName","glyph-name"],["glyphOrientationHorizontal","glyph-orientation-horizontal"],["glyphOrientationVertical","glyph-orientation-vertical"],["horizAdvX","horiz-adv-x"],["horizOriginX","horiz-origin-x"],["imageRendering","image-rendering"],["letterSpacing","letter-spacing"],["lightingColor","lighting-color"],["markerEnd","marker-end"],["markerMid","marker-mid"],["markerStart","marker-start"],["overlinePosition","overline-position"],["overlineThickness","overline-thickness"],["paintOrder","paint-order"],["panose-1","panose-1"],["pointerEvents","pointer-events"],["renderingIntent","rendering-intent"],["shapeRendering","shape-rendering"],["stopColor","stop-color"],["stopOpacity","stop-opacity"],["strikethroughPosition","strikethrough-position"],["strikethroughThickness","strikethrough-thickness"],["strokeDasharray","stroke-dasharray"],["strokeDashoffset","stroke-dashoffset"],["strokeLinecap","stroke-linecap"],["strokeLinejoin","stroke-linejoin"],["strokeMiterlimit","stroke-miterlimit"],["strokeOpacity","stroke-opacity"],["strokeWidth","stroke-width"],["textAnchor","text-anchor"],["textDecoration","text-decoration"],["textRendering","text-rendering"],["transformOrigin","transform-origin"],["underlinePosition","underline-position"],["underlineThickness","underline-thickness"],["unicodeBidi","unicode-bidi"],["unicodeRange","unicode-range"],["unitsPerEm","units-per-em"],["vAlphabetic","v-alphabetic"],["vHanging","v-hanging"],["vIdeographic","v-ideographic"],["vMathematical","v-mathematical"],["vectorEffect","vector-effect"],["vertAdvY","vert-adv-y"],["vertOriginX","vert-origin-x"],["vertOriginY","vert-origin-y"],["wordSpacing","word-spacing"],["writingMode","writing-mode"],["xmlnsXlink","xmlns:xlink"],["xHeight","x-height"]]),Hs={accept:"accept",acceptcharset:"acceptCharset","accept-charset":"acceptCharset",accesskey:"accessKey",action:"action",allowfullscreen:"allowFullScreen",alt:"alt",as:"as",async:"async",autocapitalize:"autoCapitalize",autocomplete:"autoComplete",autocorrect:"autoCorrect",autofocus:"autoFocus",autoplay:"autoPlay",autosave:"autoSave",capture:"capture",cellpadding:"cellPadding",cellspacing:"cellSpacing",challenge:"challenge",charset:"charSet",checked:"checked",children:"children",cite:"cite",class:"className",classid:"classID",classname:"className",cols:"cols",colspan:"colSpan",content:"content",contenteditable:"contentEditable",contextmenu:"contextMenu",controls:"controls",controlslist:"controlsList",coords:"coords",crossorigin:"crossOrigin",dangerouslysetinnerhtml:"dangerouslySetInnerHTML",data:"data",datetime:"dateTime",default:"default",defaultchecked:"defaultChecked",defaultvalue:"defaultValue",defer:"defer",dir:"dir",disabled:"disabled",disablepictureinpicture:"disablePictureInPicture",disableremoteplayback:"disableRemotePlayback",download:"download",draggable:"draggable",enctype:"encType",enterkeyhint:"enterKeyHint",fetchpriority:"fetchPriority",for:"htmlFor",form:"form",formmethod:"formMethod",formaction:"formAction",formenctype:"formEncType",formnovalidate:"formNoValidate",formtarget:"formTarget",frameborder:"frameBorder",headers:"headers",height:"height",hidden:"hidden",high:"high",href:"href",hreflang:"hrefLang",htmlfor:"htmlFor",httpequiv:"httpEquiv","http-equiv":"httpEquiv",icon:"icon",id:"id",imagesizes:"imageSizes",imagesrcset:"imageSrcSet",inert:"inert",innerhtml:"innerHTML",inputmode:"inputMode",integrity:"integrity",is:"is",itemid:"itemID",itemprop:"itemProp",itemref:"itemRef",itemscope:"itemScope",itemtype:"itemType",keyparams:"keyParams",keytype:"keyType",kind:"kind",label:"label",lang:"lang",list:"list",loop:"loop",low:"low",manifest:"manifest",marginwidth:"marginWidth",marginheight:"marginHeight",max:"max",maxlength:"maxLength",media:"media",mediagroup:"mediaGroup",method:"method",min:"min",minlength:"minLength",multiple:"multiple",muted:"muted",name:"name",nomodule:"noModule",nonce:"nonce",novalidate:"noValidate",open:"open",optimum:"optimum",pattern:"pattern",placeholder:"placeholder",playsinline:"playsInline",poster:"poster",preload:"preload",profile:"profile",radiogroup:"radioGroup",readonly:"readOnly",referrerpolicy:"referrerPolicy",rel:"rel",required:"required",reversed:"reversed",role:"role",rows:"rows",rowspan:"rowSpan",sandbox:"sandbox",scope:"scope",scoped:"scoped",scrolling:"scrolling",seamless:"seamless",selected:"selected",shape:"shape",size:"size",sizes:"sizes",span:"span",spellcheck:"spellCheck",src:"src",srcdoc:"srcDoc",srclang:"srcLang",srcset:"srcSet",start:"start",step:"step",style:"style",summary:"summary",tabindex:"tabIndex",target:"target",title:"title",type:"type",usemap:"useMap",value:"value",width:"width",wmode:"wmode",wrap:"wrap",about:"about",accentheight:"accentHeight","accent-height":"accentHeight",accumulate:"accumulate",additive:"additive",alignmentbaseline:"alignmentBaseline","alignment-baseline":"alignmentBaseline",allowreorder:"allowReorder",alphabetic:"alphabetic",amplitude:"amplitude",arabicform:"arabicForm","arabic-form":"arabicForm",ascent:"ascent",attributename:"attributeName",attributetype:"attributeType",autoreverse:"autoReverse",azimuth:"azimuth",basefrequency:"baseFrequency",baselineshift:"baselineShift","baseline-shift":"baselineShift",baseprofile:"baseProfile",bbox:"bbox",begin:"begin",bias:"bias",by:"by",calcmode:"calcMode",capheight:"capHeight","cap-height":"capHeight",clip:"clip",clippath:"clipPath","clip-path":"clipPath",clippathunits:"clipPathUnits",cliprule:"clipRule","clip-rule":"clipRule",color:"color",colorinterpolation:"colorInterpolation","color-interpolation":"colorInterpolation",colorinterpolationfilters:"colorInterpolationFilters","color-interpolation-filters":"colorInterpolationFilters",colorprofile:"colorProfile","color-profile":"colorProfile",colorrendering:"colorRendering","color-rendering":"colorRendering",contentscripttype:"contentScriptType",contentstyletype:"contentStyleType",cursor:"cursor",cx:"cx",cy:"cy",d:"d",datatype:"datatype",decelerate:"decelerate",descent:"descent",diffuseconstant:"diffuseConstant",direction:"direction",display:"display",divisor:"divisor",dominantbaseline:"dominantBaseline","dominant-baseline":"dominantBaseline",dur:"dur",dx:"dx",dy:"dy",edgemode:"edgeMode",elevation:"elevation",enablebackground:"enableBackground","enable-background":"enableBackground",end:"end",exponent:"exponent",externalresourcesrequired:"externalResourcesRequired",fill:"fill",fillopacity:"fillOpacity","fill-opacity":"fillOpacity",fillrule:"fillRule","fill-rule":"fillRule",filter:"filter",filterres:"filterRes",filterunits:"filterUnits",floodopacity:"floodOpacity","flood-opacity":"floodOpacity",floodcolor:"floodColor","flood-color":"floodColor",focusable:"focusable",fontfamily:"fontFamily","font-family":"fontFamily",fontsize:"fontSize","font-size":"fontSize",fontsizeadjust:"fontSizeAdjust","font-size-adjust":"fontSizeAdjust",fontstretch:"fontStretch","font-stretch":"fontStretch",fontstyle:"fontStyle","font-style":"fontStyle",fontvariant:"fontVariant","font-variant":"fontVariant",fontweight:"fontWeight","font-weight":"fontWeight",format:"format",from:"from",fx:"fx",fy:"fy",g1:"g1",g2:"g2",glyphname:"glyphName","glyph-name":"glyphName",glyphorientationhorizontal:"glyphOrientationHorizontal","glyph-orientation-horizontal":"glyphOrientationHorizontal",glyphorientationvertical:"glyphOrientationVertical","glyph-orientation-vertical":"glyphOrientationVertical",glyphref:"glyphRef",gradienttransform:"gradientTransform",gradientunits:"gradientUnits",hanging:"hanging",horizadvx:"horizAdvX","horiz-adv-x":"horizAdvX",horizoriginx:"horizOriginX","horiz-origin-x":"horizOriginX",ideographic:"ideographic",imagerendering:"imageRendering","image-rendering":"imageRendering",in2:"in2",in:"in",inlist:"inlist",intercept:"intercept",k1:"k1",k2:"k2",k3:"k3",k4:"k4",k:"k",kernelmatrix:"kernelMatrix",kernelunitlength:"kernelUnitLength",kerning:"kerning",keypoints:"keyPoints",keysplines:"keySplines",keytimes:"keyTimes",lengthadjust:"lengthAdjust",letterspacing:"letterSpacing","letter-spacing":"letterSpacing",lightingcolor:"lightingColor","lighting-color":"lightingColor",limitingconeangle:"limitingConeAngle",local:"local",markerend:"markerEnd","marker-end":"markerEnd",markerheight:"markerHeight",markermid:"markerMid","marker-mid":"markerMid",markerstart:"markerStart","marker-start":"markerStart",markerunits:"markerUnits",markerwidth:"markerWidth",mask:"mask",maskcontentunits:"maskContentUnits",maskunits:"maskUnits",mathematical:"mathematical",mode:"mode",numoctaves:"numOctaves",offset:"offset",opacity:"opacity",operator:"operator",order:"order",orient:"orient",orientation:"orientation",origin:"origin",overflow:"overflow",overlineposition:"overlinePosition","overline-position":"overlinePosition",overlinethickness:"overlineThickness","overline-thickness":"overlineThickness",paintorder:"paintOrder","paint-order":"paintOrder",panose1:"panose1","panose-1":"panose1",pathlength:"pathLength",patterncontentunits:"patternContentUnits",patterntransform:"patternTransform",patternunits:"patternUnits",pointerevents:"pointerEvents","pointer-events":"pointerEvents",points:"points",pointsatx:"pointsAtX",pointsaty:"pointsAtY",pointsatz:"pointsAtZ",popover:"popover",popovertarget:"popoverTarget",popovertargetaction:"popoverTargetAction",prefix:"prefix",preservealpha:"preserveAlpha",preserveaspectratio:"preserveAspectRatio",primitiveunits:"primitiveUnits",property:"property",r:"r",radius:"radius",refx:"refX",refy:"refY",renderingintent:"renderingIntent","rendering-intent":"renderingIntent",repeatcount:"repeatCount",repeatdur:"repeatDur",requiredextensions:"requiredExtensions",requiredfeatures:"requiredFeatures",resource:"resource",restart:"restart",result:"result",results:"results",rotate:"rotate",rx:"rx",ry:"ry",scale:"scale",security:"security",seed:"seed",shaperendering:"shapeRendering","shape-rendering":"shapeRendering",slope:"slope",spacing:"spacing",specularconstant:"specularConstant",specularexponent:"specularExponent",speed:"speed",spreadmethod:"spreadMethod",startoffset:"startOffset",stddeviation:"stdDeviation",stemh:"stemh",stemv:"stemv",stitchtiles:"stitchTiles",stopcolor:"stopColor","stop-color":"stopColor",stopopacity:"stopOpacity","stop-opacity":"stopOpacity",strikethroughposition:"strikethroughPosition","strikethrough-position":"strikethroughPosition",strikethroughthickness:"strikethroughThickness","strikethrough-thickness":"strikethroughThickness",string:"string",stroke:"stroke",strokedasharray:"strokeDasharray","stroke-dasharray":"strokeDasharray",strokedashoffset:"strokeDashoffset","stroke-dashoffset":"strokeDashoffset",strokelinecap:"strokeLinecap","stroke-linecap":"strokeLinecap",strokelinejoin:"strokeLinejoin","stroke-linejoin":"strokeLinejoin",strokemiterlimit:"strokeMiterlimit","stroke-miterlimit":"strokeMiterlimit",strokewidth:"strokeWidth","stroke-width":"strokeWidth",strokeopacity:"strokeOpacity","stroke-opacity":"strokeOpacity",suppresscontenteditablewarning:"suppressContentEditableWarning",suppresshydrationwarning:"suppressHydrationWarning",surfacescale:"surfaceScale",systemlanguage:"systemLanguage",tablevalues:"tableValues",targetx:"targetX",targety:"targetY",textanchor:"textAnchor","text-anchor":"textAnchor",textdecoration:"textDecoration","text-decoration":"textDecoration",textlength:"textLength",textrendering:"textRendering","text-rendering":"textRendering",to:"to",transform:"transform",transformorigin:"transformOrigin","transform-origin":"transformOrigin",typeof:"typeof",u1:"u1",u2:"u2",underlineposition:"underlinePosition","underline-position":"underlinePosition",underlinethickness:"underlineThickness","underline-thickness":"underlineThickness",unicode:"unicode",unicodebidi:"unicodeBidi","unicode-bidi":"unicodeBidi",unicoderange:"unicodeRange","unicode-range":"unicodeRange",unitsperem:"unitsPerEm","units-per-em":"unitsPerEm",unselectable:"unselectable",valphabetic:"vAlphabetic","v-alphabetic":"vAlphabetic",values:"values",vectoreffect:"vectorEffect","vector-effect":"vectorEffect",version:"version",vertadvy:"vertAdvY","vert-adv-y":"vertAdvY",vertoriginx:"vertOriginX","vert-origin-x":"vertOriginX",vertoriginy:"vertOriginY","vert-origin-y":"vertOriginY",vhanging:"vHanging","v-hanging":"vHanging",videographic:"vIdeographic","v-ideographic":"vIdeographic",viewbox:"viewBox",viewtarget:"viewTarget",visibility:"visibility",vmathematical:"vMathematical","v-mathematical":"vMathematical",vocab:"vocab",widths:"widths",wordspacing:"wordSpacing","word-spacing":"wordSpacing",writingmode:"writingMode","writing-mode":"writingMode",x1:"x1",x2:"x2",x:"x",xchannelselector:"xChannelSelector",xheight:"xHeight","x-height":"xHeight",xlinkactuate:"xlinkActuate","xlink:actuate":"xlinkActuate",xlinkarcrole:"xlinkArcrole","xlink:arcrole":"xlinkArcrole",xlinkhref:"xlinkHref","xlink:href":"xlinkHref",xlinkrole:"xlinkRole","xlink:role":"xlinkRole",xlinkshow:"xlinkShow","xlink:show":"xlinkShow",xlinktitle:"xlinkTitle","xlink:title":"xlinkTitle",xlinktype:"xlinkType","xlink:type":"xlinkType",xmlbase:"xmlBase","xml:base":"xmlBase",xmllang:"xmlLang","xml:lang":"xmlLang",xmlns:"xmlns","xml:space":"xmlSpace",xmlnsxlink:"xmlnsXlink","xmlns:xlink":"xmlnsXlink",xmlspace:"xmlSpace",y1:"y1",y2:"y2",y:"y",ychannelselector:"yChannelSelector",z:"z",zoomandpan:"zoomAndPan"},mE={"aria-current":0,"aria-description":0,"aria-details":0,"aria-disabled":0,"aria-hidden":0,"aria-invalid":0,"aria-keyshortcuts":0,"aria-label":0,"aria-roledescription":0,"aria-autocomplete":0,"aria-checked":0,"aria-expanded":0,"aria-haspopup":0,"aria-level":0,"aria-modal":0,"aria-multiline":0,"aria-multiselectable":0,"aria-orientation":0,"aria-placeholder":0,"aria-pressed":0,"aria-readonly":0,"aria-required":0,"aria-selected":0,"aria-sort":0,"aria-valuemax":0,"aria-valuemin":0,"aria-valuenow":0,"aria-valuetext":0,"aria-atomic":0,"aria-busy":0,"aria-live":0,"aria-relevant":0,"aria-dropeffect":0,"aria-grabbed":0,"aria-activedescendant":0,"aria-colcount":0,"aria-colindex":0,"aria-colspan":0,"aria-controls":0,"aria-describedby":0,"aria-errormessage":0,"aria-flowto":0,"aria-labelledby":0,"aria-owns":0,"aria-posinset":0,"aria-rowcount":0,"aria-rowindex":0,"aria-rowspan":0,"aria-setsize":0,"aria-braillelabel":0,"aria-brailleroledescription":0,"aria-colindextext":0,"aria-rowindextext":0},pg={},Ww=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),eN=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),ED=!1,ka={},TD=/^on./,tN=/^on[^A-Z]/,nN=RegExp("^(aria)-[:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),iN=RegExp("^(aria)[A-Z][:A-Z_a-z\\u00C0-\\u00D6\\u00D8-\\u00F6\\u00F8-\\u02FF\\u0370-\\u037D\\u037F-\\u1FFF\\u200C-\\u200D\\u2070-\\u218F\\u2C00-\\u2FEF\\u3001-\\uD7FF\\uF900-\\uFDCF\\uFDF0-\\uFFFD\\-.0-9\\u00B7\\u0300-\\u036F\\u203F-\\u2040]*$"),aN=/^[\u0000-\u001F ]*j[\r\n\t]*a[\r\n\t]*v[\r\n\t]*a[\r\n\t]*s[\r\n\t]*c[\r\n\t]*r[\r\n\t]*i[\r\n\t]*p[\r\n\t]*t[\r\n\t]*:/i,hy=null,yg=null,vg=null,qb=!1,fo=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Kb=!1;if(fo)try{var my={};Object.defineProperty(my,"passive",{get:function(){Kb=!0}}),window.addEventListener("test",my,my),window.removeEventListener("test",my,my)}catch{Kb=!1}var Qc=null,Xb=null,gE=null,Vd={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(t){return t.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},pE=ti(Vd),gy=ht({},Vd,{view:0,detail:0}),sN=ti(gy),Qb,Zb,py,yE=ht({},gy,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:Uf,button:0,buttons:0,relatedTarget:function(t){return t.relatedTarget===void 0?t.fromElement===t.srcElement?t.toElement:t.fromElement:t.relatedTarget},movementX:function(t){return"movementX"in t?t.movementX:(t!==py&&(py&&t.type==="mousemove"?(Qb=t.screenX-py.screenX,Zb=t.screenY-py.screenY):Zb=Qb=0,py=t),Qb)},movementY:function(t){return"movementY"in t?t.movementY:Zb}}),bD=ti(yE),lN=ht({},yE,{dataTransfer:0}),rN=ti(lN),oN=ht({},gy,{relatedTarget:0}),Jb=ti(oN),uN=ht({},Vd,{animationName:0,elapsedTime:0,pseudoElement:0}),cN=ti(uN),fN=ht({},Vd,{clipboardData:function(t){return"clipboardData"in t?t.clipboardData:window.clipboardData}}),dN=ti(fN),hN=ht({},Vd,{data:0}),xD=ti(hN),mN=xD,gN={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},pN={8:"Backspace",9:"Tab",12:"Clear",13:"Enter",16:"Shift",17:"Control",18:"Alt",19:"Pause",20:"CapsLock",27:"Escape",32:" ",33:"PageUp",34:"PageDown",35:"End",36:"Home",37:"ArrowLeft",38:"ArrowUp",39:"ArrowRight",40:"ArrowDown",45:"Insert",46:"Delete",112:"F1",113:"F2",114:"F3",115:"F4",116:"F5",117:"F6",118:"F7",119:"F8",120:"F9",121:"F10",122:"F11",123:"F12",144:"NumLock",145:"ScrollLock",224:"Meta"},yN={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"},vN=ht({},gy,{key:function(t){if(t.key){var n=gN[t.key]||t.key;if(n!=="Unidentified")return n}return t.type==="keypress"?(t=Nf(t),t===13?"Enter":String.fromCharCode(t)):t.type==="keydown"||t.type==="keyup"?pN[t.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:Uf,charCode:function(t){return t.type==="keypress"?Nf(t):0},keyCode:function(t){return t.type==="keydown"||t.type==="keyup"?t.keyCode:0},which:function(t){return t.type==="keypress"?Nf(t):t.type==="keydown"||t.type==="keyup"?t.keyCode:0}}),SN=ti(vN),EN=ht({},yE,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),AD=ti(EN),TN=ht({},gy,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:Uf}),bN=ti(TN),xN=ht({},Vd,{propertyName:0,elapsedTime:0,pseudoElement:0}),AN=ti(xN),RN=ht({},yE,{deltaX:function(t){return"deltaX"in t?t.deltaX:"wheelDeltaX"in t?-t.wheelDeltaX:0},deltaY:function(t){return"deltaY"in t?t.deltaY:"wheelDeltaY"in t?-t.wheelDeltaY:"wheelDelta"in t?-t.wheelDelta:0},deltaZ:0,deltaMode:0}),DN=ti(RN),LN=ht({},Vd,{newState:0,oldState:0}),_N=ti(LN),CN=[9,13,27,32],RD=229,Wb=fo&&"CompositionEvent"in window,yy=null;fo&&"documentMode"in document&&(yy=document.documentMode);var ON=fo&&"TextEvent"in window&&!yy,DD=fo&&(!Wb||yy&&8<yy&&11>=yy),LD=32,_D=String.fromCharCode(LD),CD=!1,Sg=!1,MN={color:!0,date:!0,datetime:!0,"datetime-local":!0,email:!0,month:!0,number:!0,password:!0,range:!0,search:!0,tel:!0,text:!0,time:!0,url:!0,week:!0},vy=null,Sy=null,OD=!1;fo&&(OD=Ph("input")&&(!document.documentMode||9<document.documentMode));var Ba=typeof Object.is=="function"?Object.is:Gh,IN=fo&&"documentMode"in document&&11>=document.documentMode,Eg=null,e1=null,Ey=null,t1=!1,Tg={animationend:Oo("Animation","AnimationEnd"),animationiteration:Oo("Animation","AnimationIteration"),animationstart:Oo("Animation","AnimationStart"),transitionrun:Oo("Transition","TransitionRun"),transitionstart:Oo("Transition","TransitionStart"),transitioncancel:Oo("Transition","TransitionCancel"),transitionend:Oo("Transition","TransitionEnd")},n1={},MD={};fo&&(MD=document.createElement("div").style,"AnimationEvent"in window||(delete Tg.animationend.animation,delete Tg.animationiteration.animation,delete Tg.animationstart.animation),"TransitionEvent"in window||delete Tg.transitionend.transition);var ID=Mo("animationend"),wD=Mo("animationiteration"),ND=Mo("animationstart"),wN=Mo("transitionrun"),NN=Mo("transitionstart"),UN=Mo("transitioncancel"),UD=Mo("transitionend"),kD=new Map,i1="abort auxClick beforeToggle cancel canPlay canPlayThrough click close contextMenu copy cut drag dragEnd dragEnter dragExit dragLeave dragOver dragStart drop durationChange emptied encrypted ended error gotPointerCapture input invalid keyDown keyPress keyUp load loadedData loadedMetadata loadStart lostPointerCapture mouseDown mouseMove mouseOut mouseOver mouseUp paste pause play playing pointerCancel pointerDown pointerMove pointerOut pointerOver pointerUp progress rateChange reset resize seeked seeking stalled submit suspend timeUpdate touchCancel touchEnd touchStart volumeChange scroll toggle touchMove waiting wheel".split(" ");i1.push("scrollEnd");var BD=0;if(typeof performance=="object"&&typeof performance.now=="function")var kN=performance,zD=function(){return kN.now()};else{var BN=Date;zD=function(){return BN.now()}}var a1=typeof reportError=="function"?reportError:function(t){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var n=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof t=="object"&&t!==null&&typeof t.message=="string"?String(t.message):String(t),error:t});if(!window.dispatchEvent(n))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",t);return}console.error(t)},zN="This object has been omitted by React in the console log to avoid sending too much data from the server. Try logging smaller or more specific objects.",vE=0,s1=1,l1=2,r1=3,SE="– ",EE="+ ",FD="  ",pn=typeof console<"u"&&typeof console.timeStamp=="function"&&typeof performance<"u"&&typeof performance.measure=="function",Ol="Components ⚛",Dt="Scheduler ⚛",_t="Blocking",Zc=!1,pu={color:"primary",properties:null,tooltipText:"",track:Ol},Jc={start:-0,end:-0,detail:{devtools:pu}},FN=["Changed Props",""],PD="This component received deeply equal props. It might benefit from useMemo or the React Compiler in its owner.",PN=["Changed Props",PD],Ty=1,yu=2,Ml=[],bg=0,o1=0,Wc={};Object.freeze(Wc);var Il=null,xg=null,Je=0,GN=1,mt=2,ga=8,gr=16,$N=32,GD=!1;try{var $D=Object.preventExtensions({})}catch{GD=!0}var u1=new WeakMap,Ag=[],Rg=0,TE=null,by=0,wl=[],Nl=0,Yd=null,vu=1,Su="",sa=null,yn=null,Rt=!1,ho=!1,js=null,ef=null,Ul=!1,c1=Error("Hydration Mismatch Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),f1=me(null),d1=me(null),HD={},bE=null,Dg=null,Lg=!1,HN=typeof AbortController<"u"?AbortController:function(){var t=[],n=this.signal={aborted:!1,addEventListener:function(l,f){t.push(f)}};this.abort=function(){n.aborted=!0,t.forEach(function(l){return l()})}},jN=Un.unstable_scheduleCallback,VN=Un.unstable_NormalPriority,ui={$$typeof:Gs,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0,_currentRenderer:null,_currentRenderer2:null},ci=Un.unstable_now,xE=console.createTask?console.createTask:function(){return null},xy=1,AE=2,Ni=-0,tf=-0,Eu=-0,Tu=null,za=-1.1,qd=-0,Dn=-0,Ke=-1.1,Qe=-1.1,bn=null,kn=!1,Kd=-0,mo=-1.1,Ay=null,nf=0,h1=null,m1=null,Xd=-1.1,Ry=null,_g=-1.1,RE=-1.1,bu=-0,xu=-1.1,kl=-1.1,g1=0,Dy=null,jD=null,VD=null,af=-1.1,Qd=null,sf=-1.1,DE=-1.1,YD=-0,qD=-0,LE=0,YN=null,KD=0,Ly=-1.1,_E=!1,CE=!1,_y=null,p1=0,Zd=0,Cg=null,XD=ge.S;ge.S=function(t,n){if(jL=oi(),typeof n=="object"&&n!==null&&typeof n.then=="function"){if(0>xu&&0>kl){xu=ci();var l=Mc(),f=Al();(l!==sf||f!==Qd)&&(sf=-1.1),af=l,Qd=f}Zl(t,n)}XD!==null&&XD(t,n)};var Jd=me(null),pr={recordUnsafeLifecycleWarnings:function(){},flushPendingUnsafeLifecycleWarnings:function(){},recordLegacyContextWarning:function(){},flushLegacyContextWarning:function(){},discardPendingWarnings:function(){}},Cy=[],Oy=[],My=[],Iy=[],wy=[],Ny=[],Wd=new Set;pr.recordUnsafeLifecycleWarnings=function(t,n){Wd.has(t.type)||(typeof n.componentWillMount=="function"&&n.componentWillMount.__suppressDeprecationWarning!==!0&&Cy.push(t),t.mode&ga&&typeof n.UNSAFE_componentWillMount=="function"&&Oy.push(t),typeof n.componentWillReceiveProps=="function"&&n.componentWillReceiveProps.__suppressDeprecationWarning!==!0&&My.push(t),t.mode&ga&&typeof n.UNSAFE_componentWillReceiveProps=="function"&&Iy.push(t),typeof n.componentWillUpdate=="function"&&n.componentWillUpdate.__suppressDeprecationWarning!==!0&&wy.push(t),t.mode&ga&&typeof n.UNSAFE_componentWillUpdate=="function"&&Ny.push(t))},pr.flushPendingUnsafeLifecycleWarnings=function(){var t=new Set;0<Cy.length&&(Cy.forEach(function(L){t.add($(L)||"Component"),Wd.add(L.type)}),Cy=[]);var n=new Set;0<Oy.length&&(Oy.forEach(function(L){n.add($(L)||"Component"),Wd.add(L.type)}),Oy=[]);var l=new Set;0<My.length&&(My.forEach(function(L){l.add($(L)||"Component"),Wd.add(L.type)}),My=[]);var f=new Set;0<Iy.length&&(Iy.forEach(function(L){f.add($(L)||"Component"),Wd.add(L.type)}),Iy=[]);var p=new Set;0<wy.length&&(wy.forEach(function(L){p.add($(L)||"Component"),Wd.add(L.type)}),wy=[]);var y=new Set;if(0<Ny.length&&(Ny.forEach(function(L){y.add($(L)||"Component"),Wd.add(L.type)}),Ny=[]),0<n.size){var A=b(n);console.error(`Using UNSAFE_componentWillMount in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
209
+
210
+ * Move code with side effects to componentDidMount, and set initial state in the constructor.
211
+
212
+ Please update the following components: %s`,A)}0<f.size&&(A=b(f),console.error(`Using UNSAFE_componentWillReceiveProps in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
213
+
214
+ * Move data fetching code or side effects to componentDidUpdate.
215
+ * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
216
+
217
+ Please update the following components: %s`,A)),0<y.size&&(A=b(y),console.error(`Using UNSAFE_componentWillUpdate in strict mode is not recommended and may indicate bugs in your code. See https://react.dev/link/unsafe-component-lifecycles for details.
218
+
219
+ * Move data fetching code or side effects to componentDidUpdate.
220
+
221
+ Please update the following components: %s`,A)),0<t.size&&(A=b(t),console.warn(`componentWillMount has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
222
+
223
+ * Move code with side effects to componentDidMount, and set initial state in the constructor.
224
+ * Rename componentWillMount to UNSAFE_componentWillMount to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
225
+
226
+ Please update the following components: %s`,A)),0<l.size&&(A=b(l),console.warn(`componentWillReceiveProps has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
227
+
228
+ * Move data fetching code or side effects to componentDidUpdate.
229
+ * If you're updating state whenever props change, refactor your code to use memoization techniques or move it to static getDerivedStateFromProps. Learn more at: https://react.dev/link/derived-state
230
+ * Rename componentWillReceiveProps to UNSAFE_componentWillReceiveProps to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
231
+
232
+ Please update the following components: %s`,A)),0<p.size&&(A=b(p),console.warn(`componentWillUpdate has been renamed, and is not recommended for use. See https://react.dev/link/unsafe-component-lifecycles for details.
233
+
234
+ * Move data fetching code or side effects to componentDidUpdate.
235
+ * Rename componentWillUpdate to UNSAFE_componentWillUpdate to suppress this warning in non-strict mode. In React 18.x, only the UNSAFE_ name will work. To rename all deprecated lifecycles to their new names, you can run \`npx react-codemod rename-unsafe-lifecycles\` in your project source folder.
236
+
237
+ Please update the following components: %s`,A))};var OE=new Map,QD=new Set;pr.recordLegacyContextWarning=function(t,n){for(var l=null,f=t;f!==null;)f.mode&ga&&(l=f),f=f.return;l===null?console.error("Expected to find a StrictMode component in a strict mode tree. This error is likely caused by a bug in React. Please file an issue."):!QD.has(t.type)&&(f=OE.get(l),t.type.contextTypes!=null||t.type.childContextTypes!=null||n!==null&&typeof n.getChildContext=="function")&&(f===void 0&&(f=[],OE.set(l,f)),f.push(t))},pr.flushLegacyContextWarning=function(){OE.forEach(function(t){if(t.length!==0){var n=t[0],l=new Set;t.forEach(function(p){l.add($(p)||"Component"),QD.add(p.type)});var f=b(l);we(n,function(){console.error(`Legacy context API has been detected within a strict-mode tree.
238
+
239
+ The old API will be supported in all 16.x releases, but applications using it should migrate to the new version.
240
+
241
+ Please update the following components: %s
242
+
243
+ Learn more about this warning here: https://react.dev/link/legacy-context`,f)})}})},pr.discardPendingWarnings=function(){Cy=[],Oy=[],My=[],Iy=[],wy=[],Ny=[],OE=new Map};var ZD={react_stack_bottom_frame:function(t,n,l){var f=Dl;Dl=!0;try{return t(n,l)}finally{Dl=f}}},y1=ZD.react_stack_bottom_frame.bind(ZD),JD={react_stack_bottom_frame:function(t){var n=Dl;Dl=!0;try{return t.render()}finally{Dl=n}}},WD=JD.react_stack_bottom_frame.bind(JD),eL={react_stack_bottom_frame:function(t,n){try{n.componentDidMount()}catch(l){ct(t,t.return,l)}}},v1=eL.react_stack_bottom_frame.bind(eL),tL={react_stack_bottom_frame:function(t,n,l,f,p){try{n.componentDidUpdate(l,f,p)}catch(y){ct(t,t.return,y)}}},nL=tL.react_stack_bottom_frame.bind(tL),iL={react_stack_bottom_frame:function(t,n){var l=n.stack;t.componentDidCatch(n.value,{componentStack:l!==null?l:""})}},qN=iL.react_stack_bottom_frame.bind(iL),aL={react_stack_bottom_frame:function(t,n,l){try{l.componentWillUnmount()}catch(f){ct(t,n,f)}}},sL=aL.react_stack_bottom_frame.bind(aL),lL={react_stack_bottom_frame:function(t){var n=t.create;return t=t.inst,n=n(),t.destroy=n}},KN=lL.react_stack_bottom_frame.bind(lL),rL={react_stack_bottom_frame:function(t,n,l){try{l()}catch(f){ct(t,n,f)}}},XN=rL.react_stack_bottom_frame.bind(rL),oL={react_stack_bottom_frame:function(t){var n=t._init;return n(t._payload)}},QN=oL.react_stack_bottom_frame.bind(oL),Og=Error("Suspense Exception: This is not a real error! It's an implementation detail of `use` to interrupt the current render. You must either rethrow it immediately, or move the `use` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary, or call the promise's `.catch` method and pass the result to `use`."),S1=Error("Suspense Exception: This is not a real error, and should not leak into userspace. If you're seeing this, it's likely a bug in React."),ME=Error("Suspense Exception: This is not a real error! It's an implementation detail of `useActionState` to interrupt the current render. You must either rethrow it immediately, or move the `useActionState` call outside of the `try/catch` block. Capturing without rethrowing will lead to unexpected behavior.\n\nTo handle async errors, wrap your component in an error boundary."),IE={then:function(){console.error('Internal React error: A listener was unexpectedly attached to a "noop" thenable. This is a bug in React. Please file an issue.')}},eh=null,Uy=!1,Mg=null,ky=0,gt=null,E1,uL=E1=!1,cL={},fL={},dL={};E=function(t,n,l){if(l!==null&&typeof l=="object"&&l._store&&(!l._store.validated&&l.key==null||l._store.validated===2)){if(typeof l._store!="object")throw Error("React Component in warnForMissingKey should have a _store. This error is likely caused by a bug in React. Please file an issue.");l._store.validated=1;var f=$(t),p=f||"null";if(!cL[p]){cL[p]=!0,l=l._owner,t=t._debugOwner;var y="";t&&typeof t.tag=="number"&&(p=$(t))&&(y=`
244
+
245
+ Check the render method of \``+p+"`."),y||f&&(y=`
246
+
247
+ Check the top-level render call using <`+f+">.");var A="";l!=null&&t!==l&&(f=null,typeof l.tag=="number"?f=$(l):typeof l.name=="string"&&(f=l.name),f&&(A=" It was passed a child from "+f+".")),we(n,function(){console.error('Each child in a list should have a unique "key" prop.%s%s See https://react.dev/link/warning-keys for more information.',y,A)})}}};var th=ii(!0),hL=ii(!1),mL=0,gL=1,pL=2,T1=3,lf=!1,yL=!1,b1=null,x1=!1,Ig=me(null),wE=me(0),Vs=me(null),Bl=null,wg=1,By=2,Jn=me(0),NE=0,zl=1,Fa=2,Ys=4,Pa=8,Ng,vL=new Set,SL=new Set,A1=new Set,EL=new Set,Au=0,tt=null,nn=null,fi=null,UE=!1,Ug=!1,nh=!1,kE=0,zy=0,Ru=null,ZN=0,JN=25,he=null,Fl=null,Du=-1,Fy=!1,Py={readContext:wt,use:tr,useCallback:An,useContext:An,useEffect:An,useImperativeHandle:An,useLayoutEffect:An,useInsertionEffect:An,useMemo:An,useReducer:An,useRef:An,useState:An,useDebugValue:An,useDeferredValue:An,useTransition:An,useSyncExternalStore:An,useId:An,useHostTransitionStatus:An,useFormState:An,useActionState:An,useOptimistic:An,useMemoCache:An,useCacheRefresh:An};Py.useEffectEvent=An;var R1=null,TL=null,D1=null,bL=null,go=null,yr=null,BE=null;R1={readContext:function(t){return wt(t)},use:tr,useCallback:function(t,n){return he="useCallback",et(),er(n),om(t,n)},useContext:function(t){return he="useContext",et(),wt(t)},useEffect:function(t,n){return he="useEffect",et(),er(n),Ko(t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",et(),er(l),dl(t,n,l)},useInsertionEffect:function(t,n){he="useInsertionEffect",et(),er(n),Xr(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",et(),er(n),Xi(t,n)},useMemo:function(t,n){he="useMemo",et(),er(n);var l=ge.H;ge.H=go;try{return Qi(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",et();var f=ge.H;ge.H=go;try{return rc(t,n,l)}finally{ge.H=f}},useRef:function(t){return he="useRef",et(),rm(t)},useState:function(t){he="useState",et();var n=ge.H;ge.H=go;try{return Vr(t)}finally{ge.H=n}},useDebugValue:function(){he="useDebugValue",et()},useDeferredValue:function(t,n){return he="useDeferredValue",et(),dc(t,n)},useTransition:function(){return he="useTransition",et(),Qr()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",et(),oc(t,n,l)},useId:function(){return he="useId",et(),sd()},useFormState:function(t,n){return he="useFormState",et(),Kf(),La(t,n)},useActionState:function(t,n){return he="useActionState",et(),La(t,n)},useOptimistic:function(t){return he="useOptimistic",et(),qo(t)},useHostTransitionStatus:sr,useMemoCache:Ra,useCacheRefresh:function(){return he="useCacheRefresh",et(),um()},useEffectEvent:function(t){return he="useEffectEvent",et(),id(t)}},TL={readContext:function(t){return wt(t)},use:tr,useCallback:function(t,n){return he="useCallback",Re(),om(t,n)},useContext:function(t){return he="useContext",Re(),wt(t)},useEffect:function(t,n){return he="useEffect",Re(),Ko(t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",Re(),dl(t,n,l)},useInsertionEffect:function(t,n){he="useInsertionEffect",Re(),Xr(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",Re(),Xi(t,n)},useMemo:function(t,n){he="useMemo",Re();var l=ge.H;ge.H=go;try{return Qi(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",Re();var f=ge.H;ge.H=go;try{return rc(t,n,l)}finally{ge.H=f}},useRef:function(t){return he="useRef",Re(),rm(t)},useState:function(t){he="useState",Re();var n=ge.H;ge.H=go;try{return Vr(t)}finally{ge.H=n}},useDebugValue:function(){he="useDebugValue",Re()},useDeferredValue:function(t,n){return he="useDeferredValue",Re(),dc(t,n)},useTransition:function(){return he="useTransition",Re(),Qr()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",Re(),oc(t,n,l)},useId:function(){return he="useId",Re(),sd()},useActionState:function(t,n){return he="useActionState",Re(),La(t,n)},useFormState:function(t,n){return he="useFormState",Re(),Kf(),La(t,n)},useOptimistic:function(t){return he="useOptimistic",Re(),qo(t)},useHostTransitionStatus:sr,useMemoCache:Ra,useCacheRefresh:function(){return he="useCacheRefresh",Re(),um()},useEffectEvent:function(t){return he="useEffectEvent",Re(),id(t)}},D1={readContext:function(t){return wt(t)},use:tr,useCallback:function(t,n){return he="useCallback",Re(),Is(t,n)},useContext:function(t){return he="useContext",Re(),wt(t)},useEffect:function(t,n){he="useEffect",Re(),Kn(2048,Pa,t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",Re(),fc(t,n,l)},useInsertionEffect:function(t,n){return he="useInsertionEffect",Re(),Kn(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",Re(),Kn(4,Ys,t,n)},useMemo:function(t,n){he="useMemo",Re();var l=ge.H;ge.H=yr;try{return hn(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",Re();var f=ge.H;ge.H=yr;try{return jo(t,n,l)}finally{ge.H=f}},useRef:function(){return he="useRef",Re(),zt().memoizedState},useState:function(){he="useState",Re();var t=ge.H;ge.H=yr;try{return jo(Da)}finally{ge.H=t}},useDebugValue:function(){he="useDebugValue",Re()},useDeferredValue:function(t,n){return he="useDeferredValue",Re(),hl(t,n)},useTransition:function(){return he="useTransition",Re(),dS()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",Re(),Yo(t,n,l)},useId:function(){return he="useId",Re(),zt().memoizedState},useFormState:function(t){return he="useFormState",Re(),Kf(),qr(t)},useActionState:function(t){return he="useActionState",Re(),qr(t)},useOptimistic:function(t,n){return he="useOptimistic",Re(),ed(t,n)},useHostTransitionStatus:sr,useMemoCache:Ra,useCacheRefresh:function(){return he="useCacheRefresh",Re(),zt().memoizedState},useEffectEvent:function(t){return he="useEffectEvent",Re(),cc(t)}},bL={readContext:function(t){return wt(t)},use:tr,useCallback:function(t,n){return he="useCallback",Re(),Is(t,n)},useContext:function(t){return he="useContext",Re(),wt(t)},useEffect:function(t,n){he="useEffect",Re(),Kn(2048,Pa,t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",Re(),fc(t,n,l)},useInsertionEffect:function(t,n){return he="useInsertionEffect",Re(),Kn(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",Re(),Kn(4,Ys,t,n)},useMemo:function(t,n){he="useMemo",Re();var l=ge.H;ge.H=BE;try{return hn(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",Re();var f=ge.H;ge.H=BE;try{return Vo(t,n,l)}finally{ge.H=f}},useRef:function(){return he="useRef",Re(),zt().memoizedState},useState:function(){he="useState",Re();var t=ge.H;ge.H=BE;try{return Vo(Da)}finally{ge.H=t}},useDebugValue:function(){he="useDebugValue",Re()},useDeferredValue:function(t,n){return he="useDeferredValue",Re(),ot(t,n)},useTransition:function(){return he="useTransition",Re(),Sn()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",Re(),Yo(t,n,l)},useId:function(){return he="useId",Re(),zt().memoizedState},useFormState:function(t){return he="useFormState",Re(),Kf(),Kr(t)},useActionState:function(t){return he="useActionState",Re(),Kr(t)},useOptimistic:function(t,n){return he="useOptimistic",Re(),td(t,n)},useHostTransitionStatus:sr,useMemoCache:Ra,useCacheRefresh:function(){return he="useCacheRefresh",Re(),zt().memoizedState},useEffectEvent:function(t){return he="useEffectEvent",Re(),cc(t)}},go={readContext:function(t){return S(),wt(t)},use:function(t){return g(),tr(t)},useCallback:function(t,n){return he="useCallback",g(),et(),om(t,n)},useContext:function(t){return he="useContext",g(),et(),wt(t)},useEffect:function(t,n){return he="useEffect",g(),et(),Ko(t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",g(),et(),dl(t,n,l)},useInsertionEffect:function(t,n){he="useInsertionEffect",g(),et(),Xr(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",g(),et(),Xi(t,n)},useMemo:function(t,n){he="useMemo",g(),et();var l=ge.H;ge.H=go;try{return Qi(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",g(),et();var f=ge.H;ge.H=go;try{return rc(t,n,l)}finally{ge.H=f}},useRef:function(t){return he="useRef",g(),et(),rm(t)},useState:function(t){he="useState",g(),et();var n=ge.H;ge.H=go;try{return Vr(t)}finally{ge.H=n}},useDebugValue:function(){he="useDebugValue",g(),et()},useDeferredValue:function(t,n){return he="useDeferredValue",g(),et(),dc(t,n)},useTransition:function(){return he="useTransition",g(),et(),Qr()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",g(),et(),oc(t,n,l)},useId:function(){return he="useId",g(),et(),sd()},useFormState:function(t,n){return he="useFormState",g(),et(),La(t,n)},useActionState:function(t,n){return he="useActionState",g(),et(),La(t,n)},useOptimistic:function(t){return he="useOptimistic",g(),et(),qo(t)},useMemoCache:function(t){return g(),Ra(t)},useHostTransitionStatus:sr,useCacheRefresh:function(){return he="useCacheRefresh",et(),um()},useEffectEvent:function(t){return he="useEffectEvent",g(),et(),id(t)}},yr={readContext:function(t){return S(),wt(t)},use:function(t){return g(),tr(t)},useCallback:function(t,n){return he="useCallback",g(),Re(),Is(t,n)},useContext:function(t){return he="useContext",g(),Re(),wt(t)},useEffect:function(t,n){he="useEffect",g(),Re(),Kn(2048,Pa,t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",g(),Re(),fc(t,n,l)},useInsertionEffect:function(t,n){return he="useInsertionEffect",g(),Re(),Kn(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",g(),Re(),Kn(4,Ys,t,n)},useMemo:function(t,n){he="useMemo",g(),Re();var l=ge.H;ge.H=yr;try{return hn(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",g(),Re();var f=ge.H;ge.H=yr;try{return jo(t,n,l)}finally{ge.H=f}},useRef:function(){return he="useRef",g(),Re(),zt().memoizedState},useState:function(){he="useState",g(),Re();var t=ge.H;ge.H=yr;try{return jo(Da)}finally{ge.H=t}},useDebugValue:function(){he="useDebugValue",g(),Re()},useDeferredValue:function(t,n){return he="useDeferredValue",g(),Re(),hl(t,n)},useTransition:function(){return he="useTransition",g(),Re(),dS()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",g(),Re(),Yo(t,n,l)},useId:function(){return he="useId",g(),Re(),zt().memoizedState},useFormState:function(t){return he="useFormState",g(),Re(),qr(t)},useActionState:function(t){return he="useActionState",g(),Re(),qr(t)},useOptimistic:function(t,n){return he="useOptimistic",g(),Re(),ed(t,n)},useMemoCache:function(t){return g(),Ra(t)},useHostTransitionStatus:sr,useCacheRefresh:function(){return he="useCacheRefresh",Re(),zt().memoizedState},useEffectEvent:function(t){return he="useEffectEvent",g(),Re(),cc(t)}},BE={readContext:function(t){return S(),wt(t)},use:function(t){return g(),tr(t)},useCallback:function(t,n){return he="useCallback",g(),Re(),Is(t,n)},useContext:function(t){return he="useContext",g(),Re(),wt(t)},useEffect:function(t,n){he="useEffect",g(),Re(),Kn(2048,Pa,t,n)},useImperativeHandle:function(t,n,l){return he="useImperativeHandle",g(),Re(),fc(t,n,l)},useInsertionEffect:function(t,n){return he="useInsertionEffect",g(),Re(),Kn(4,Fa,t,n)},useLayoutEffect:function(t,n){return he="useLayoutEffect",g(),Re(),Kn(4,Ys,t,n)},useMemo:function(t,n){he="useMemo",g(),Re();var l=ge.H;ge.H=yr;try{return hn(t,n)}finally{ge.H=l}},useReducer:function(t,n,l){he="useReducer",g(),Re();var f=ge.H;ge.H=yr;try{return Vo(t,n,l)}finally{ge.H=f}},useRef:function(){return he="useRef",g(),Re(),zt().memoizedState},useState:function(){he="useState",g(),Re();var t=ge.H;ge.H=yr;try{return Vo(Da)}finally{ge.H=t}},useDebugValue:function(){he="useDebugValue",g(),Re()},useDeferredValue:function(t,n){return he="useDeferredValue",g(),Re(),ot(t,n)},useTransition:function(){return he="useTransition",g(),Re(),Sn()},useSyncExternalStore:function(t,n,l){return he="useSyncExternalStore",g(),Re(),Yo(t,n,l)},useId:function(){return he="useId",g(),Re(),zt().memoizedState},useFormState:function(t){return he="useFormState",g(),Re(),Kr(t)},useActionState:function(t){return he="useActionState",g(),Re(),Kr(t)},useOptimistic:function(t,n){return he="useOptimistic",g(),Re(),td(t,n)},useMemoCache:function(t){return g(),Ra(t)},useHostTransitionStatus:sr,useCacheRefresh:function(){return he="useCacheRefresh",Re(),zt().memoizedState},useEffectEvent:function(t){return he="useEffectEvent",g(),Re(),cc(t)}};var xL={},AL=new Set,RL=new Set,DL=new Set,LL=new Set,_L=new Set,CL=new Set,OL=new Set,ML=new Set,IL=new Set,wL=new Set;Object.freeze(xL);var L1={enqueueSetState:function(t,n,l){t=t._reactInternals;var f=Mi(t),p=qn(f);p.payload=n,l!=null&&(Jo(l),p.callback=l),n=ol(t,p,f),n!==null&&(sl(f,"this.setState()",t),We(n,t,f),is(n,t,f))},enqueueReplaceState:function(t,n,l){t=t._reactInternals;var f=Mi(t),p=qn(f);p.tag=gL,p.payload=n,l!=null&&(Jo(l),p.callback=l),n=ol(t,p,f),n!==null&&(sl(f,"this.replaceState()",t),We(n,t,f),is(n,t,f))},enqueueForceUpdate:function(t,n){t=t._reactInternals;var l=Mi(t),f=qn(l);f.tag=pL,n!=null&&(Jo(n),f.callback=n),n=ol(t,f,l),n!==null&&(sl(l,"this.forceUpdate()",t),We(n,t,l),is(n,t,l))}},kg=null,_1=null,C1=Error("This is not a real error. It's an implementation detail of React's selective hydration feature. If this leaks into userspace, it's a bug in React. Please file an issue."),di=!1,NL={},UL={},kL={},BL={},Bg=!1,zL={},zE={},O1={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null},FL=!1,PL=null;PL=new Set;var Lu=!1,hi=!1,M1=!1,GL=typeof WeakSet=="function"?WeakSet:Set,Ui=null,zg=null,Fg=null,mi=null,us=!1,vr=null,Ai=!1,Gy=8192,WN={getCacheForType:function(t){var n=wt(ui),l=n.data.get(t);return l===void 0&&(l=t(),n.data.set(t,l)),l},cacheSignal:function(){return wt(ui).controller.signal},getOwner:function(){return ma}};if(typeof Symbol=="function"&&Symbol.for){var $y=Symbol.for;$y("selector.component"),$y("selector.has_pseudo_class"),$y("selector.role"),$y("selector.test_id"),$y("selector.text")}var eU=[],tU=typeof WeakMap=="function"?WeakMap:Map,ki=0,Ri=2,qs=4,_u=0,Hy=1,ih=2,FE=3,rf=4,PE=6,$L=5,Ot=ki,an=null,vt=null,pt=0,cs=0,GE=1,ah=2,jy=3,HL=4,I1=5,Vy=6,$E=7,w1=8,sh=9,Xt=cs,Ks=null,of=!1,Pg=!1,N1=!1,po=0,Ln=_u,uf=0,cf=0,U1=0,fs=0,lh=0,Yy=null,Ga=null,HE=!1,jE=0,jL=0,VL=300,VE=1/0,YL=500,qy=null,jn=null,ff=null,YE=0,k1=1,B1=2,qL=3,df=0,KL=1,XL=2,QL=3,ZL=4,qE=5,gi=0,hf=null,Gg=null,Sr=0,z1=0,F1=-0,P1=null,JL=null,WL=null,Er=YE,e_=null,nU=50,Ky=0,G1=null,$1=!1,KE=!1,iU=50,rh=0,Xy=null,$g=!1,XE=null,t_=!1,n_=new Set,aU={},QE=null,Hg=null,H1=!1,j1=!1,ZE=!1,V1=!1,mf=0,Y1={};(function(){for(var t=0;t<i1.length;t++){var n=i1[t],l=n.toLowerCase();n=n[0].toUpperCase()+n.slice(1),bs(l,"on"+n)}bs(ID,"onAnimationEnd"),bs(wD,"onAnimationIteration"),bs(ND,"onAnimationStart"),bs("dblclick","onDoubleClick"),bs("focusin","onFocus"),bs("focusout","onBlur"),bs(wN,"onTransitionRun"),bs(NN,"onTransitionStart"),bs(UN,"onTransitionCancel"),bs(UD,"onTransitionEnd")})(),Gu("onMouseEnter",["mouseout","mouseover"]),Gu("onMouseLeave",["mouseout","mouseover"]),Gu("onPointerEnter",["pointerout","pointerover"]),Gu("onPointerLeave",["pointerout","pointerover"]),Ss("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),Ss("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),Ss("onBeforeInput",["compositionend","keypress","textInput","paste"]),Ss("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),Ss("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),Ss("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Qy="abort canplay canplaythrough durationchange emptied encrypted ended error loadeddata loadedmetadata loadstart pause play playing progress ratechange resize seeked seeking stalled suspend timeupdate volumechange waiting".split(" "),q1=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Qy)),JE="_reactListening"+Math.random().toString(36).slice(2),i_=!1,a_=!1,WE=!1,s_=!1,eT=!1,tT=!1,l_=!1,nT={},sU=/\r\n?/g,lU=/\u0000|\uFFFD/g,oh="http://www.w3.org/1999/xlink",K1="http://www.w3.org/XML/1998/namespace",rU="javascript:throw new Error('React form unexpectedly submitted.')",oU="suppressHydrationWarning",uh="&",iT="/&",Zy="$",Jy="/$",gf="$?",ch="$~",jg="$!",uU="html",cU="body",fU="head",X1="F!",r_="F",o_="loading",dU="style",Cu=0,Vg=1,aT=2,Q1=null,Z1=null,u_={dialog:!0,webview:!0},J1=null,Wy=void 0,c_=typeof setTimeout=="function"?setTimeout:void 0,hU=typeof clearTimeout=="function"?clearTimeout:void 0,fh=-1,f_=typeof Promise=="function"?Promise:void 0,mU=typeof queueMicrotask=="function"?queueMicrotask:typeof f_<"u"?function(t){return f_.resolve(null).then(t).catch(NS)}:c_,W1=null,dh=0,ev=1,d_=2,h_=3,Pl=4,Gl=new Map,m_=new Set,Ou=Ut.d;Ut.d={f:function(){var t=Ou.f(),n=Ia();return t||n},r:function(t){var n=vs(t);n!==null&&n.tag===5&&n.type==="form"?hc(n):Ou.r(t)},D:function(t){Ou.D(t),Gp("dns-prefetch",t,null)},C:function(t,n){Ou.C(t,n),Gp("preconnect",t,n)},L:function(t,n,l){Ou.L(t,n,l);var f=Yg;if(f&&t&&n){var p='link[rel="preload"][as="'+jt(n)+'"]';n==="image"&&l&&l.imageSrcSet?(p+='[imagesrcset="'+jt(l.imageSrcSet)+'"]',typeof l.imageSizes=="string"&&(p+='[imagesizes="'+jt(l.imageSizes)+'"]')):p+='[href="'+jt(t)+'"]';var y=p;switch(n){case"style":y=ou(t);break;case"script":y=uu(t)}Gl.has(y)||(t=ht({rel:"preload",href:n==="image"&&l&&l.imageSrcSet?void 0:t,as:n},l),Gl.set(y,t),f.querySelector(p)!==null||n==="style"&&f.querySelector(Md(y))||n==="script"&&f.querySelector(Id(y))||(n=f.createElement("link"),mn(n,"link",t),On(n),f.head.appendChild(n)))}},m:function(t,n){Ou.m(t,n);var l=Yg;if(l&&t){var f=n&&typeof n.as=="string"?n.as:"script",p='link[rel="modulepreload"][as="'+jt(f)+'"][href="'+jt(t)+'"]',y=p;switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":y=uu(t)}if(!Gl.has(y)&&(t=ht({rel:"modulepreload",href:t},n),Gl.set(y,t),l.querySelector(p)===null)){switch(f){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(l.querySelector(Id(y)))return}f=l.createElement("link"),mn(f,"link",t),On(f),l.head.appendChild(f)}}},X:function(t,n){Ou.X(t,n);var l=Yg;if(l&&t){var f=Xa(l).hoistableScripts,p=uu(t),y=f.get(p);y||(y=l.querySelector(Id(p)),y||(t=ht({src:t,async:!0},n),(n=Gl.get(p))&&jp(t,n),y=l.createElement("script"),On(y),mn(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(p,y))}},S:function(t,n,l){Ou.S(t,n,l);var f=Yg;if(f&&t){var p=Xa(f).hoistableStyles,y=ou(t);n=n||"default";var A=p.get(y);if(!A){var L={loading:dh,preload:null};if(A=f.querySelector(Md(y)))L.loading=ev|Pl;else{t=ht({rel:"stylesheet",href:t,"data-precedence":n},l),(l=Gl.get(y))&&Hp(t,l);var N=A=f.createElement("link");On(N),mn(N,"link",t),N._p=new Promise(function(U,J){N.onload=U,N.onerror=J}),N.addEventListener("load",function(){L.loading|=ev}),N.addEventListener("error",function(){L.loading|=d_}),L.loading|=Pl,Nc(A,n,f)}A={type:"stylesheet",instance:A,count:1,state:L},p.set(y,A)}}},M:function(t,n){Ou.M(t,n);var l=Yg;if(l&&t){var f=Xa(l).hoistableScripts,p=uu(t),y=f.get(p);y||(y=l.querySelector(Id(p)),y||(t=ht({src:t,async:!0,type:"module"},n),(n=Gl.get(p))&&jp(t,n),y=l.createElement("script"),On(y),mn(y,"link",t),l.head.appendChild(y)),y={type:"script",instance:y,count:1,state:null},f.set(p,y))}}};var Yg=typeof document>"u"?null:document,sT=null,gU=6e4,pU=800,yU=500,ex=0,tx=null,lT=null,hh=Vb,tv={$$typeof:Gs,Provider:null,Consumer:null,_currentValue:hh,_currentValue2:hh,_threadCount:0},g_="%c%s%c",p_="background: #e6e6e6;background: light-dark(rgba(0,0,0,0.1), rgba(255,255,255,0.25));color: #000000;color: light-dark(#000000, #ffffff);border-radius: 2px",y_="",rT=" ",vU=Function.prototype.bind,v_=!1,S_=null,E_=null,T_=null,b_=null,x_=null,A_=null,R_=null,D_=null,L_=null,__=null;S_=function(t,n,l,f){n=h(t,n),n!==null&&(l=e(n.memoizedState,l,0,f),n.memoizedState=l,n.baseState=l,t.memoizedProps=ht({},t.memoizedProps),l=Ci(t,2),l!==null&&We(l,t,2))},E_=function(t,n,l){n=h(t,n),n!==null&&(l=o(n.memoizedState,l,0),n.memoizedState=l,n.baseState=l,t.memoizedProps=ht({},t.memoizedProps),l=Ci(t,2),l!==null&&We(l,t,2))},T_=function(t,n,l,f){n=h(t,n),n!==null&&(l=i(n.memoizedState,l,f),n.memoizedState=l,n.baseState=l,t.memoizedProps=ht({},t.memoizedProps),l=Ci(t,2),l!==null&&We(l,t,2))},b_=function(t,n,l){t.pendingProps=e(t.memoizedProps,n,0,l),t.alternate&&(t.alternate.pendingProps=t.pendingProps),n=Ci(t,2),n!==null&&We(n,t,2)},x_=function(t,n){t.pendingProps=o(t.memoizedProps,n,0),t.alternate&&(t.alternate.pendingProps=t.pendingProps),n=Ci(t,2),n!==null&&We(n,t,2)},A_=function(t,n,l){t.pendingProps=i(t.memoizedProps,n,l),t.alternate&&(t.alternate.pendingProps=t.pendingProps),n=Ci(t,2),n!==null&&We(n,t,2)},R_=function(t){var n=Ci(t,2);n!==null&&We(n,t,2)},D_=function(t){var n=Ya(),l=Ci(t,n);l!==null&&We(l,t,n)},L_=function(t){d=t},__=function(t){u=t};var oT=!0,uT=null,nx=!1,pf=null,yf=null,vf=null,nv=new Map,iv=new Map,Sf=[],SU="mousedown mouseup touchcancel touchend touchstart auxclick dblclick pointercancel pointerdown pointerup dragend dragstart drop compositionend compositionstart keydown keypress keyup input textInput copy cut paste click change contextmenu reset".split(" "),cT=null;if(Ps.prototype.render=ey.prototype.render=function(t){var n=this._internalRoot;if(n===null)throw Error("Cannot update an unmounted root.");var l=arguments;typeof l[1]=="function"?console.error("does not support the second callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."):M(l[1])?console.error("You passed a container to the second argument of root.render(...). You don't need to pass it again since you already passed it to create the root."):typeof l[1]<"u"&&console.error("You passed a second argument to root.render(...) but it only accepts one argument."),l=t;var f=n.current,p=Mi(f);Wm(f,p,l,n,null,null)},Ps.prototype.unmount=ey.prototype.unmount=function(){var t=arguments;if(typeof t[0]=="function"&&console.error("does not support a callback argument. To execute a side effect after rendering, declare it in a component body with useEffect()."),t=this._internalRoot,t!==null){this._internalRoot=null;var n=t.containerInfo;(Ot&(Ri|qs))!==ki&&console.error("Attempted to synchronously unmount a root while React was already rendering. React cannot finish unmounting the root until the current render has completed, which may lead to a race condition."),Wm(t.current,2,null,t,null,null),Ia(),n[mr]=null}},Ps.prototype.unstable_scheduleHydration=function(t){if(t){var n=rt();t={blockedOn:null,target:t,priority:n};for(var l=0;l<Sf.length&&n!==0&&n<Sf[l].priority;l++);Sf.splice(l,0,t),l===0&&Wp(t)}},function(){var t=Bd.version;if(t!=="19.2.3")throw Error(`Incompatible React versions: The "react" and "react-dom" packages must have the exact same version. Instead got:
248
+ - react: `+(t+`
249
+ - react-dom: 19.2.3
250
+ Learn more: https://react.dev/warnings/version-mismatch`))}(),typeof Map=="function"&&Map.prototype!=null&&typeof Map.prototype.forEach=="function"&&typeof Set=="function"&&Set.prototype!=null&&typeof Set.prototype.clear=="function"&&typeof Set.prototype.forEach=="function"||console.error("React depends on Map and Set built-in types. Make sure that you load a polyfill in older browsers. https://react.dev/link/react-polyfills"),Ut.findDOMNode=function(t){var n=t._reactInternals;if(n===void 0)throw typeof t.render=="function"?Error("Unable to find node on an unmounted component."):(t=Object.keys(t).join(","),Error("Argument appears to not be a ReactComponent. Keys: "+t));return t=K(n),t=t!==null?ae(t):null,t=t===null?null:t.stateNode,t},!function(){var t={bundleType:1,version:"19.2.3",rendererPackageName:"react-dom",currentDispatcherRef:ge,reconcilerVersion:"19.2.3"};return t.overrideHookState=S_,t.overrideHookStateDeletePath=E_,t.overrideHookStateRenamePath=T_,t.overrideProps=b_,t.overridePropsDeletePath=x_,t.overridePropsRenamePath=A_,t.scheduleUpdate=R_,t.scheduleRetry=D_,t.setErrorHandler=L_,t.setSuspenseHandler=__,t.scheduleRefresh=D,t.scheduleRoot=_,t.setRefreshHandler=I,t.getCurrentFiber=qt,la(t)}()&&fo&&window.top===window.self&&(-1<navigator.userAgent.indexOf("Chrome")&&navigator.userAgent.indexOf("Edge")===-1||-1<navigator.userAgent.indexOf("Firefox"))){var C_=window.location.protocol;/^(https?|file):$/.test(C_)&&console.info("%cDownload the React DevTools for a better development experience: https://react.dev/link/react-devtools"+(C_==="file:"?`
251
+ You might need to use a local HTTP server (instead of file://): https://react.dev/link/react-devtools-faq`:""),"font-weight:bold")}Kg.createRoot=function(t,n){if(!M(t))throw Error("Target container is not a DOM element.");ty(t);var l=!1,f="",p=dm,y=hm,A=X0;return n!=null&&(n.hydrate?console.warn("hydrate through createRoot is deprecated. Use ReactDOMClient.hydrateRoot(container, <App />) instead."):typeof n=="object"&&n!==null&&n.$$typeof===rs&&console.error(`You passed a JSX element to createRoot. You probably meant to call root.render instead. Example usage:
252
+
253
+ let root = createRoot(domContainer);
254
+ root.render(<App />);`),n.unstable_strictMode===!0&&(l=!0),n.identifierPrefix!==void 0&&(f=n.identifierPrefix),n.onUncaughtError!==void 0&&(p=n.onUncaughtError),n.onCaughtError!==void 0&&(y=n.onCaughtError),n.onRecoverableError!==void 0&&(A=n.onRecoverableError)),n=Ud(t,1,!1,null,null,l,f,null,p,y,A,aE),t[mr]=n.current,io(t),new ey(n)},Kg.hydrateRoot=function(t,n,l){if(!M(t))throw Error("Target container is not a DOM element.");ty(t),n===void 0&&console.error("Must provide initial children as second argument to hydrateRoot. Example usage: hydrateRoot(domContainer, <App />)");var f=!1,p="",y=dm,A=hm,L=X0,N=null;return l!=null&&(l.unstable_strictMode===!0&&(f=!0),l.identifierPrefix!==void 0&&(p=l.identifierPrefix),l.onUncaughtError!==void 0&&(y=l.onUncaughtError),l.onCaughtError!==void 0&&(A=l.onCaughtError),l.onRecoverableError!==void 0&&(L=l.onRecoverableError),l.formState!==void 0&&(N=l.formState)),n=Ud(t,1,!0,n,l??null,f,p,N,y,A,L,aE),n.context=eE(null),l=n.current,f=Mi(l),f=Zs(f),p=qn(f),p.callback=null,ol(l,p,f),sl(f,"hydrateRoot()",null),l=f,n.current.lanes=l,Pn(n,l),ca(n),t[mr]=n.current,io(t),new Ps(n)},Kg.version="19.2.3",typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"&&typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop=="function"&&__REACT_DEVTOOLS_GLOBAL_HOOK__.registerInternalModuleStop(Error())}()),Kg}function ux(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function")){if(process.env.NODE_ENV!=="production")throw new Error("^_^");try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(ux)}catch(h){console.error(h)}}}process.env.NODE_ENV==="production"?(ux(),fT.exports=I_()):fT.exports=w_();var N_=fT.exports,mT={exports:{}},Xg={};/**
255
+ * @license React
256
+ * react-jsx-runtime.production.js
257
+ *
258
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
259
+ *
260
+ * This source code is licensed under the MIT license found in the
261
+ * LICENSE file in the root directory of this source tree.
262
+ */var cx;function U_(){if(cx)return Xg;cx=1;var h=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function i(s,o,u){var d=null;if(u!==void 0&&(d=""+u),o.key!==void 0&&(d=""+o.key),"key"in o){u={};for(var g in o)g!=="key"&&(u[g]=o[g])}else u=o;return o=u.ref,{$$typeof:h,type:s,key:d,ref:o!==void 0?o:null,props:u}}return Xg.Fragment=e,Xg.jsx=i,Xg.jsxs=i,Xg}var Qg={};/**
263
+ * @license React
264
+ * react-jsx-runtime.development.js
265
+ *
266
+ * Copyright (c) Meta Platforms, Inc. and affiliates.
267
+ *
268
+ * This source code is licensed under the MIT license found in the
269
+ * LICENSE file in the root directory of this source tree.
270
+ */var fx;function k_(){return fx||(fx=1,process.env.NODE_ENV!=="production"&&function(){function h(Q){if(Q==null)return null;if(typeof Q=="function")return Q.$$typeof===me?null:Q.displayName||Q.name||null;if(typeof Q=="string")return Q;switch(Q){case M:return"Fragment";case B:return"Profiler";case w:return"StrictMode";case ae:return"Suspense";case q:return"SuspenseList";case $:return"Activity"}if(typeof Q=="object")switch(typeof Q.tag=="number"&&console.error("Received an unexpected object in getComponentNameFromType(). This is likely a bug in React. Please file an issue."),Q.$$typeof){case I:return"Portal";case G:return Q.displayName||"Context";case z:return(Q._context.displayName||"Context")+".Consumer";case K:var de=Q.render;return Q=Q.displayName,Q||(Q=de.displayName||de.name||"",Q=Q!==""?"ForwardRef("+Q+")":"ForwardRef"),Q;case Z:return de=Q.displayName||null,de!==null?de:h(Q.type)||"Memo";case te:de=Q._payload,Q=Q._init;try{return h(Q(de))}catch{}}return null}function e(Q){return""+Q}function i(Q){try{e(Q);var de=!1}catch{de=!0}if(de){de=console;var Le=de.error,Ce=typeof Symbol=="function"&&Symbol.toStringTag&&Q[Symbol.toStringTag]||Q.constructor.name||"Object";return Le.call(de,"The provided key is an unsupported type %s. This value must be coerced to a string before using it here.",Ce),e(Q)}}function s(Q){if(Q===M)return"<>";if(typeof Q=="object"&&Q!==null&&Q.$$typeof===te)return"<...>";try{var de=h(Q);return de?"<"+de+">":"<...>"}catch{return"<...>"}}function o(){var Q=Ee.A;return Q===null?null:Q.getOwner()}function u(){return Error("react-stack-top-frame")}function d(Q){if(De.call(Q,"key")){var de=Object.getOwnPropertyDescriptor(Q,"key").get;if(de&&de.isReactWarning)return!1}return Q.key!==void 0}function g(Q,de){function Le(){F||(F=!0,console.error("%s: `key` is not a prop. Trying to access it will result in `undefined` being returned. If you need to access the same value within the child component, you should pass it as a different prop. (https://react.dev/link/special-props)",de))}Le.isReactWarning=!0,Object.defineProperty(Q,"key",{get:Le,configurable:!0})}function S(){var Q=h(this.type);return ne[Q]||(ne[Q]=!0,console.error("Accessing element.ref was removed in React 19. ref is now a regular prop. It will be removed from the JSX Element type in a future release.")),Q=this.props.ref,Q!==void 0?Q:null}function v(Q,de,Le,Ce,Fe,Ve){var at=Le.ref;return Q={$$typeof:D,type:Q,key:de,props:Le,_owner:Ce},(at!==void 0?at:null)!==null?Object.defineProperty(Q,"ref",{enumerable:!1,get:S}):Object.defineProperty(Q,"ref",{enumerable:!1,value:null}),Q._store={},Object.defineProperty(Q._store,"validated",{configurable:!1,enumerable:!1,writable:!0,value:0}),Object.defineProperty(Q,"_debugInfo",{configurable:!1,enumerable:!1,writable:!0,value:null}),Object.defineProperty(Q,"_debugStack",{configurable:!1,enumerable:!1,writable:!0,value:Fe}),Object.defineProperty(Q,"_debugTask",{configurable:!1,enumerable:!1,writable:!0,value:Ve}),Object.freeze&&(Object.freeze(Q.props),Object.freeze(Q)),Q}function E(Q,de,Le,Ce,Fe,Ve){var at=de.children;if(at!==void 0)if(Ce)if(Ie(at)){for(Ce=0;Ce<at.length;Ce++)b(at[Ce]);Object.freeze&&Object.freeze(at)}else console.error("React.jsx: Static children should always be an array. You are likely explicitly calling React.jsxs or React.jsxDEV. Use the Babel transform instead.");else b(at);if(De.call(de,"key")){at=h(Q);var At=Object.keys(de).filter(function(vi){return vi!=="key"});Ce=0<At.length?"{key: someKey, "+At.join(": ..., ")+": ...}":"{key: someKey}",_e[at+Ce]||(At=0<At.length?"{"+At.join(": ..., ")+": ...}":"{}",console.error(`A props object containing a "key" prop is being spread into JSX:
271
+ let props = %s;
272
+ <%s {...props} />
273
+ React keys must be passed directly to JSX without using spread:
274
+ let props = %s;
275
+ <%s key={someKey} {...props} />`,Ce,at,At,at),_e[at+Ce]=!0)}if(at=null,Le!==void 0&&(i(Le),at=""+Le),d(de)&&(i(de.key),at=""+de.key),"key"in de){Le={};for(var kt in de)kt!=="key"&&(Le[kt]=de[kt])}else Le=de;return at&&g(Le,typeof Q=="function"?Q.displayName||Q.name||"Unknown":Q),v(Q,at,Le,o(),Fe,Ve)}function b(Q){R(Q)?Q._store&&(Q._store.validated=1):typeof Q=="object"&&Q!==null&&Q.$$typeof===te&&(Q._payload.status==="fulfilled"?R(Q._payload.value)&&Q._payload.value._store&&(Q._payload.value._store.validated=1):Q._store&&(Q._store.validated=1))}function R(Q){return typeof Q=="object"&&Q!==null&&Q.$$typeof===D}var _=$e,D=Symbol.for("react.transitional.element"),I=Symbol.for("react.portal"),M=Symbol.for("react.fragment"),w=Symbol.for("react.strict_mode"),B=Symbol.for("react.profiler"),z=Symbol.for("react.consumer"),G=Symbol.for("react.context"),K=Symbol.for("react.forward_ref"),ae=Symbol.for("react.suspense"),q=Symbol.for("react.suspense_list"),Z=Symbol.for("react.memo"),te=Symbol.for("react.lazy"),$=Symbol.for("react.activity"),me=Symbol.for("react.client.reference"),Ee=_.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,De=Object.prototype.hasOwnProperty,Ie=Array.isArray,Oe=console.createTask?console.createTask:function(){return null};_={react_stack_bottom_frame:function(Q){return Q()}};var F,ne={},le=_.react_stack_bottom_frame.bind(_,u)(),xe=Oe(s(u)),_e={};Qg.Fragment=M,Qg.jsx=function(Q,de,Le){var Ce=1e4>Ee.recentlyCreatedOwnerStacks++;return E(Q,de,Le,!1,Ce?Error("react-stack-top-frame"):le,Ce?Oe(s(Q)):xe)},Qg.jsxs=function(Q,de,Le){var Ce=1e4>Ee.recentlyCreatedOwnerStacks++;return E(Q,de,Le,!0,Ce?Error("react-stack-top-frame"):le,Ce?Oe(s(Q)):xe)}}()),Qg}process.env.NODE_ENV==="production"?mT.exports=U_():mT.exports=k_();var P=mT.exports;class B_{constructor(){sn(this,"events");this.events=new Map}on(e,i){var s;return this.events.has(e)||this.events.set(e,[]),(s=this.events.get(e))==null||s.push(i),()=>this.off(e,i)}off(e,i){const s=this.events.get(e);s&&this.events.set(e,s.filter(o=>o!==i))}emit(e,i){const s=this.events.get(e);s&&s.forEach(o=>o(i))}destroy(){this.events.clear()}}class z_{constructor(e){sn(this,"state");sn(this,"listeners");this.state=e,this.listeners=new Set}get(){return this.state}setState(e){const i=this.state,s=typeof e=="function"?e(i):e;this.state={...i,...s},this.listeners.forEach(o=>o(this.state,i))}subscribe(e){return this.listeners.add(e),()=>this.listeners.delete(e)}destroy(){this.listeners.clear()}}class F_{constructor(e){sn(this,"context",null);sn(this,"source",null);sn(this,"gainNode",null);sn(this,"video");sn(this,"isInitialized",!1);this.video=e}init(){if(!(this.isInitialized||!(window.AudioContext||window.webkitAudioContext))){this.context=new AudioContext,this.gainNode=this.context.createGain();try{this.source=this.context.createMediaElementSource(this.video),this.source.connect(this.gainNode),this.gainNode.connect(this.context.destination),this.isInitialized=!0}catch(i){console.warn("StrataPlayer: Failed to initialize AudioEngine",i)}}}setGain(e){this.isInitialized||this.init(),this.gainNode&&this.context&&(this.gainNode.gain.value=e,this.context.state==="suspended"&&this.context.resume())}destroy(){this.context&&this.context.close(),this.isInitialized=!1}}const gT={useNative:!1,fixCapitalization:!1,backgroundOpacity:50,backgroundBlur:!1,backgroundBlurAmount:4,textSize:100,textStyle:"shadow",isBold:!1,textColor:"#ffffff",verticalOffset:40},dx="strata-settings-v3",Iu={isPlaying:!1,isBuffering:!1,currentTime:0,duration:0,buffered:[],volume:1,isMuted:!1,audioGain:1,playbackRate:1,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,error:null,isFullscreen:!1,isPip:!1,subtitleTracks:[],currentSubtitle:-1,subtitleOffset:0,subtitleSettings:gT,activeCues:[],viewMode:"normal",notifications:[],iconSize:"medium",themeColor:"#6366f1",theme:"default",sources:[],currentSourceIndex:-1},hx=(h={})=>{let e={};if(!h.disablePersistence&&typeof window<"u")try{const s=localStorage.getItem(dx);s&&(e=JSON.parse(s))}catch{}const i={...gT,...e.subtitleSettings||{},...h.subtitleSettings||{}};return{...Iu,...e,volume:h.volume??e.volume??Iu.volume,isMuted:h.muted??e.isMuted??Iu.isMuted,playbackRate:h.playbackRate??e.playbackRate??Iu.playbackRate,audioGain:h.audioGain??e.audioGain??Iu.audioGain,theme:h.theme??e.theme??Iu.theme,themeColor:h.themeColor??e.themeColor??Iu.themeColor,iconSize:h.iconSize??e.iconSize??Iu.iconSize,subtitleSettings:i}};class mx{constructor(e={},i){sn(this,"video");sn(this,"container",null);sn(this,"events");sn(this,"store");sn(this,"plugins",new Map);sn(this,"audioEngine");sn(this,"config");sn(this,"retryCount",0);sn(this,"maxRetries",5);sn(this,"retryTimer",null);sn(this,"currentSource",null);sn(this,"currentSrc","");sn(this,"currentTracks",[]);sn(this,"castInitialized",!1);sn(this,"boundCueChange");sn(this,"boundFullscreenChange");this.config=e,this.video=i||document.createElement("video"),this.video.crossOrigin="anonymous",this.events=new B_;const s=hx(e);this.store=new z_(s),this.audioEngine=new F_(this.video),this.boundCueChange=this.handleCueChange.bind(this),this.boundFullscreenChange=()=>{this.store.setState({isFullscreen:!!document.fullscreenElement})},this.video.volume=s.volume,this.video.muted=s.isMuted,this.video.playbackRate=s.playbackRate,s.audioGain>1&&this.audioEngine.setGain(s.audioGain),this.initVideoListeners(),this.initCast(),e.disablePersistence||this.store.subscribe(o=>{const u={volume:o.volume,isMuted:o.isMuted,playbackRate:o.playbackRate,subtitleSettings:o.subtitleSettings,iconSize:o.iconSize,themeColor:o.themeColor,theme:o.theme};localStorage.setItem(dx,JSON.stringify(u))})}initVideoListeners(){const e=i=>this.store.setState(i);this.video.addEventListener("play",()=>e({isPlaying:!0})),this.video.addEventListener("pause",()=>e({isPlaying:!1})),this.video.addEventListener("ended",()=>e({isPlaying:!1})),this.video.addEventListener("waiting",()=>e({isBuffering:!0})),this.video.addEventListener("playing",()=>e({isBuffering:!1})),this.video.addEventListener("loadeddata",()=>{e({isBuffering:!1}),this.retryCount=0,this.removeNotification("retry"),this.store.get().error&&e({error:null})}),this.video.addEventListener("canplay",()=>e({isBuffering:!1})),this.video.addEventListener("timeupdate",()=>{this.video.seeking||e({currentTime:this.video.currentTime})}),this.video.addEventListener("seeked",()=>e({currentTime:this.video.currentTime})),this.video.addEventListener("durationchange",()=>e({duration:this.video.duration})),this.video.addEventListener("volumechange",()=>e({volume:this.video.volume,isMuted:this.video.muted})),this.video.addEventListener("ratechange",()=>e({playbackRate:this.video.playbackRate})),this.video.addEventListener("error",()=>this.handleError()),this.video.addEventListener("progress",this.updateBuffer.bind(this)),this.video.addEventListener("enterpictureinpicture",()=>e({isPip:!0})),this.video.addEventListener("leavepictureinpicture",()=>e({isPip:!1})),document.addEventListener("fullscreenchange",this.boundFullscreenChange),this.video.textTracks.addEventListener("addtrack",this.updateSubtitles.bind(this)),this.video.textTracks.addEventListener("removetrack",this.updateSubtitles.bind(this))}triggerError(e,i=!1){i?this.handleError(e):this.notify({type:"warning",message:`Warning: ${e}`,duration:5e3})}handleError(e){const i=this.video.error,s=e||(i==null?void 0:i.message)||(i?`Code ${i.code}`:"Unknown Error");if(this.removeNotification("retry"),this.retryCount<this.maxRetries){this.retryCount++;const o=Math.pow(2,this.retryCount-1)*1500;this.notify({id:"retry",type:"loading",message:`Error: ${s}. Retrying (${this.retryCount}/${this.maxRetries})...`}),console.warn(`[StrataPlayer] Error: ${s}. Retrying in ${o}ms...`),this.retryTimer&&clearTimeout(this.retryTimer),this.retryTimer=setTimeout(()=>{if(this.currentSource){this.load(this.currentSource,this.currentTracks,!0);const u=this.store.get().currentTime;if(u>0){const d=()=>{this.video.currentTime=u,this.video.removeEventListener("canplay",d)};this.video.addEventListener("canplay",d)}}},o)}else{this.removeNotification("retry");const o=`Failed to play after ${this.maxRetries} attempts: ${s}`;this.store.setState({error:o})}}updateBuffer(){const e=[];for(let i=0;i<this.video.buffered.length;i++)e.push({start:this.video.buffered.start(i),end:this.video.buffered.end(i)});this.store.setState({buffered:e})}updateSubtitles(){setTimeout(()=>{const e=Array.from(this.video.textTracks).filter(s=>s.kind==="subtitles"||s.kind==="captions").map((s,o)=>({label:s.label||s.language||`Track ${o+1}`,language:s.language,index:o}));this.store.setState({subtitleTracks:e});const i=this.store.get();i.currentSubtitle!==-1&&e.length>0&&i.currentSubtitle<e.length&&this.setSubtitle(i.currentSubtitle)},50)}async fetchWithRetry(e,i=3){for(let s=0;s<i;s++)try{const o=await fetch(e);if(!o.ok)throw new Error(`HTTP ${o.status}`);return o}catch(o){if(s===i-1)throw o;await new Promise(u=>setTimeout(u,1e3*Math.pow(2,s)))}throw new Error("Fetch failed")}attach(e){this.container=e,this.container.contains(this.video)||(this.video.style.width="100%",this.video.style.height="100%",this.video.style.objectFit="contain",this.video.style.backgroundColor="black",this.container.appendChild(this.video))}use(e){this.plugins.has(e.name)||(e.init(this),this.plugins.set(e.name,e))}setSources(e,i=[]){this.store.setState({sources:e}),this.currentTracks=i,e.length>0&&this.load(e[0],i)}switchSource(e){const i=this.store.get().sources;if(e>=0&&e<i.length){const s=this.video.currentTime,o=!this.video.paused;this.load(i[e],this.currentTracks);const u=()=>{this.video.currentTime=s,o&&this.video.play(),this.video.removeEventListener("canplay",u)};this.video.addEventListener("canplay",u)}}load(e,i=[],s=!1){this.retryTimer&&clearTimeout(this.retryTimer);const o=typeof e=="string"?{url:e,type:"auto"}:e;s||(this.retryCount=0,this.store.setState({error:null}),this.removeNotification("retry")),this.currentSrc=o.url,this.currentSource=o,this.currentTracks=i;const d=this.store.get().sources.findIndex(v=>v.url===o.url);this.store.setState({isBuffering:!0,qualityLevels:[],currentQuality:-1,audioTracks:[],currentAudioTrack:-1,currentSourceIndex:d});let g=o.type||"auto";g==="auto"&&(o.url.includes(".m3u8")?g="hls":o.url.includes(".mpd")?g="dash":g="mp4"),this.events.emit("load",{url:o.url,type:g});const S=this.video.getElementsByTagName("track");for(;S.length>0;)S[0].remove();i.length>0&&i.forEach(v=>{this.fetchWithRetry(v.src).then(()=>{this.addTextTrackInternal(v.src,v.label,v.srcLang,v.default)}).catch(E=>{this.notify({type:"warning",message:`Failed to load subtitle: ${v.label}`,duration:4e3})})}),(g==="mp4"||g==="webm"||g==="ogg")&&(this.video.src=o.url)}addTextTrack(e,i){const s=new FileReader;s.onload=o=>{var S;if(!((S=o.target)!=null&&S.result))return;let u=o.target.result;(e.name.toLowerCase().endsWith(".srt")||!u.trim().startsWith("WEBVTT"))&&(u=u.replace(/(\d{2}:\d{2}:\d{2}),(\d{3})/g,"$1.$2"),u.trim().startsWith("WEBVTT")||(u=`WEBVTT
276
+
277
+ `+u));const d=new Blob([u],{type:"text/vtt"}),g=URL.createObjectURL(d);this.addTextTrackInternal(g,i,"user",!0),setTimeout(()=>{const E=this.store.get().subtitleTracks.findIndex(b=>b.label===i);E!==-1&&(this.setSubtitle(E),this.notify({type:"success",message:"Subtitle uploaded",duration:3e3}))},200)},s.onerror=()=>{this.notify({type:"error",message:"Failed to read file",duration:3e3})},s.readAsText(e)}addTextTrackInternal(e,i,s="",o=!1){const u=document.createElement("track");u.kind="subtitles",u.label=i,u.src=e,u.srclang=s,o&&(u.default=!0),this.video.appendChild(u),this.updateSubtitles()}play(){return this.video.play()}pause(){return this.video.pause()}togglePlay(){this.video.paused?this.play():this.pause()}seek(e){if(isNaN(e))return;const i=Math.max(0,Math.min(e,this.video.duration));this.store.setState({currentTime:i}),this.video.currentTime=i}skip(e){this.seek(this.video.currentTime+e)}setVolume(e){const i=Math.max(0,Math.min(e,1));this.video.volume=i,i>0&&this.video.muted&&(this.video.muted=!1),i===0&&(this.video.muted=!0)}toggleMute(){this.video.muted=!this.video.muted}setAudioGain(e){this.store.setState({audioGain:e}),this.audioEngine.setGain(e)}setQuality(e){this.store.setState({currentQuality:e}),this.events.emit("quality-request",e)}setAudioTrack(e){this.store.setState({currentAudioTrack:e}),this.events.emit("audio-track-request",e)}toggleFullscreen(){this.container&&(document.fullscreenElement?document.exitFullscreen():this.container.requestFullscreen().catch(e=>console.error(e)))}togglePip(){document.pictureInPictureElement?document.exitPictureInPicture():this.video!==document.pictureInPictureElement&&this.video.requestPictureInPicture&&this.video.requestPictureInPicture()}initCast(){const e=window,i=()=>{if(!this.castInitialized)try{e.cast&&e.cast.framework&&e.chrome&&e.chrome.cast&&(e.cast.framework.CastContext.getInstance().setOptions({receiverApplicationId:e.chrome.cast.media.DEFAULT_MEDIA_RECEIVER_APP_ID,autoJoinPolicy:e.chrome.cast.AutoJoinPolicy.ORIGIN_SCOPED}),this.castInitialized=!0)}catch(s){console.warn("Cast Init Error or already initialized",s)}};e.cast&&e.cast.framework?i():e.__onGCastApiAvailable=s=>{s&&i()}}requestCast(){const e=window;if(e.cast&&e.cast.framework)try{this.castInitialized||this.initCast(),e.cast.framework.CastContext.getInstance().requestSession().then(()=>{this.loadMediaToCast()}).catch(i=>{i!=="cancel"&&this.notify({type:"error",message:"Cast failed: "+i,duration:3e3})})}catch{this.notify({type:"warning",message:"Cast not available yet",duration:3e3})}else this.notify({type:"warning",message:"Cast API not loaded",duration:3e3})}loadMediaToCast(){const e=window;try{const i=e.cast.framework.CastContext.getInstance().getCurrentSession();if(!i)return;const s=new e.chrome.cast.media.MediaInfo(this.currentSrc,this.currentSrc.includes(".m3u8")?"application/x-mpegurl":"video/mp4"),o=new e.chrome.cast.media.LoadRequest(s);i.loadMedia(o).then(()=>{this.notify({type:"success",message:"Casting...",duration:3e3})}).catch(u=>console.error("Cast load error",u))}catch(i){console.error("Failed to load media into Cast session",i)}}handleCueChange(){const e=this.store.get();if(e.currentSubtitle===-1){this.store.setState({activeCues:[]});return}const s=Array.from(this.video.textTracks).filter(o=>o.kind==="subtitles"||o.kind==="captions")[e.currentSubtitle];if(s&&s.activeCues){const o=Array.from(s.activeCues).map(u=>u.text);this.store.setState({activeCues:o})}else this.store.setState({activeCues:[]})}setSubtitle(e){if(Array.from(this.video.textTracks).forEach(i=>{i.removeEventListener("cuechange",this.boundCueChange),i.mode="hidden"}),this.store.setState({currentSubtitle:e,subtitleOffset:0,activeCues:[]}),e!==-1){const s=Array.from(this.video.textTracks).filter(o=>o.kind==="subtitles"||o.kind==="captions")[e];if(s){const o=this.store.get().subtitleSettings;s.mode=o.useNative?"showing":"hidden",s.addEventListener("cuechange",this.boundCueChange),this.handleCueChange()}}}updateSubtitleSettings(e){const s={...this.store.get().subtitleSettings,...e};this.store.setState({subtitleSettings:s}),e.useNative!==void 0&&this.setSubtitle(this.store.get().currentSubtitle)}resetSubtitleSettings(){this.store.setState({subtitleSettings:gT}),this.setSubtitle(this.store.get().currentSubtitle)}setSubtitleOffset(e){const i=this.store.get().subtitleOffset,s=e-i;Math.abs(s)<.001||(Array.from(this.video.textTracks).forEach(o=>{(o.mode==="showing"||o.mode==="hidden")&&o.cues&&Array.from(o.cues).forEach(u=>{u.startTime+=s,u.endTime+=s})}),this.store.setState({subtitleOffset:e}),this.notify({type:"info",message:`Subtitle Offset: ${e>0?"+":""}${e.toFixed(1)}s`,duration:1500}))}async download(){var s;if(!this.video.src)return;const e=this.video.src;if(e.includes("blob:")||e.includes(".m3u8")){this.notify({type:"warning",message:"Stream download not supported in browser.",duration:4e3});return}const i=this.notify({type:"loading",message:"Preparing download...",progress:0});try{const o=await this.fetchWithRetry(e);if(!o.body)throw new Error("No body");const u=o.body.getReader(),d=o.headers.get("Content-Length"),g=d?parseInt(d,10):0;let S=0;const v=[];for(;;){const{done:_,value:D}=await u.read();if(_)break;if(v.push(D),S+=D.length,g){const I=Math.round(S/g*100);this.notify({id:i,type:"loading",message:`Downloading... ${I}%`,progress:I})}}const E=new Blob(v),b=window.URL.createObjectURL(E),R=document.createElement("a");R.style.display="none",R.href=b,R.download=((s=e.split("/").pop())==null?void 0:s.split("?")[0])||"video.mp4",document.body.appendChild(R),R.click(),window.URL.revokeObjectURL(b),document.body.removeChild(R),this.notify({id:i,type:"success",message:"Saved!",duration:3e3})}catch{this.notify({id:i,type:"error",message:"Download failed.",duration:4e3}),window.open(e,"_blank")}}notify(e){const i=e.id||Math.random().toString(36).substr(2,9),s={...e,id:i};return this.store.setState({notifications:[s]}),e.duration&&setTimeout(()=>this.removeNotification(i),e.duration),i}removeNotification(e){const i=this.store.get().notifications;this.store.setState({notifications:i.filter(s=>s.id!==e)})}setAppearance(e){this.store.setState(i=>({...i,...e}))}destroy(){this.retryTimer&&clearTimeout(this.retryTimer),document.removeEventListener("fullscreenchange",this.boundFullscreenChange),this.video.pause(),this.video.src="";const e=this.video.getElementsByTagName("track");for(;e.length>0;)e[0].remove();this.events.destroy(),this.store.destroy(),this.plugins.forEach(i=>i.destroy&&i.destroy()),this.plugins.clear(),this.video.remove(),this.audioEngine.destroy()}}const Ue=Number.isFinite||function(h){return typeof h=="number"&&isFinite(h)},P_=Number.isSafeInteger||function(h){return typeof h=="number"&&Math.abs(h)<=G_},G_=Number.MAX_SAFE_INTEGER||9007199254740991;let je=function(h){return h.NETWORK_ERROR="networkError",h.MEDIA_ERROR="mediaError",h.KEY_SYSTEM_ERROR="keySystemError",h.MUX_ERROR="muxError",h.OTHER_ERROR="otherError",h}({}),re=function(h){return h.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",h.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",h.KEY_SYSTEM_NO_SESSION="keySystemNoSession",h.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",h.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",h.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",h.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",h.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",h.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",h.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",h.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",h.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",h.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",h.MANIFEST_LOAD_ERROR="manifestLoadError",h.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",h.MANIFEST_PARSING_ERROR="manifestParsingError",h.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",h.LEVEL_EMPTY_ERROR="levelEmptyError",h.LEVEL_LOAD_ERROR="levelLoadError",h.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",h.LEVEL_PARSING_ERROR="levelParsingError",h.LEVEL_SWITCH_ERROR="levelSwitchError",h.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",h.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",h.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",h.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",h.FRAG_LOAD_ERROR="fragLoadError",h.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",h.FRAG_DECRYPT_ERROR="fragDecryptError",h.FRAG_PARSING_ERROR="fragParsingError",h.FRAG_GAP="fragGap",h.REMUX_ALLOC_ERROR="remuxAllocError",h.KEY_LOAD_ERROR="keyLoadError",h.KEY_LOAD_TIMEOUT="keyLoadTimeOut",h.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",h.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",h.BUFFER_APPEND_ERROR="bufferAppendError",h.BUFFER_APPENDING_ERROR="bufferAppendingError",h.BUFFER_STALLED_ERROR="bufferStalledError",h.BUFFER_FULL_ERROR="bufferFullError",h.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",h.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",h.ASSET_LIST_LOAD_ERROR="assetListLoadError",h.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",h.ASSET_LIST_PARSING_ERROR="assetListParsingError",h.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",h.INTERNAL_EXCEPTION="internalException",h.INTERNAL_ABORTED="aborted",h.ATTACH_MEDIA_ERROR="attachMediaError",h.UNKNOWN="unknown",h}({}),O=function(h){return h.MEDIA_ATTACHING="hlsMediaAttaching",h.MEDIA_ATTACHED="hlsMediaAttached",h.MEDIA_DETACHING="hlsMediaDetaching",h.MEDIA_DETACHED="hlsMediaDetached",h.MEDIA_ENDED="hlsMediaEnded",h.STALL_RESOLVED="hlsStallResolved",h.BUFFER_RESET="hlsBufferReset",h.BUFFER_CODECS="hlsBufferCodecs",h.BUFFER_CREATED="hlsBufferCreated",h.BUFFER_APPENDING="hlsBufferAppending",h.BUFFER_APPENDED="hlsBufferAppended",h.BUFFER_EOS="hlsBufferEos",h.BUFFERED_TO_END="hlsBufferedToEnd",h.BUFFER_FLUSHING="hlsBufferFlushing",h.BUFFER_FLUSHED="hlsBufferFlushed",h.MANIFEST_LOADING="hlsManifestLoading",h.MANIFEST_LOADED="hlsManifestLoaded",h.MANIFEST_PARSED="hlsManifestParsed",h.LEVEL_SWITCHING="hlsLevelSwitching",h.LEVEL_SWITCHED="hlsLevelSwitched",h.LEVEL_LOADING="hlsLevelLoading",h.LEVEL_LOADED="hlsLevelLoaded",h.LEVEL_UPDATED="hlsLevelUpdated",h.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",h.LEVELS_UPDATED="hlsLevelsUpdated",h.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",h.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",h.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",h.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",h.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",h.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",h.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",h.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",h.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",h.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",h.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",h.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",h.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",h.CUES_PARSED="hlsCuesParsed",h.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",h.INIT_PTS_FOUND="hlsInitPtsFound",h.FRAG_LOADING="hlsFragLoading",h.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",h.FRAG_LOADED="hlsFragLoaded",h.FRAG_DECRYPTED="hlsFragDecrypted",h.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",h.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",h.FRAG_PARSING_METADATA="hlsFragParsingMetadata",h.FRAG_PARSED="hlsFragParsed",h.FRAG_BUFFERED="hlsFragBuffered",h.FRAG_CHANGED="hlsFragChanged",h.FPS_DROP="hlsFpsDrop",h.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",h.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",h.ERROR="hlsError",h.DESTROYING="hlsDestroying",h.KEY_LOADING="hlsKeyLoading",h.KEY_LOADED="hlsKeyLoaded",h.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",h.BACK_BUFFER_REACHED="hlsBackBufferReached",h.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",h.ASSET_LIST_LOADING="hlsAssetListLoading",h.ASSET_LIST_LOADED="hlsAssetListLoaded",h.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",h.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",h.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",h.INTERSTITIAL_STARTED="hlsInterstitialStarted",h.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",h.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",h.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",h.INTERSTITIAL_ENDED="hlsInterstitialEnded",h.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",h.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",h.EVENT_CUE_ENTER="hlsEventCueEnter",h}({});var xt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},Be={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class mh{constructor(e,i=0,s=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_=i,this.totalWeight_=s}sample(e,i){const s=Math.pow(this.alpha_,e);this.estimate_=i*(1-s)+s*this.estimate_,this.totalWeight_+=e}getTotalWeight(){return this.totalWeight_}getEstimate(){if(this.alpha_){const e=1-Math.pow(this.alpha_,this.totalWeight_);if(e)return this.estimate_/e}return this.estimate_}}class $_{constructor(e,i,s,o=100){this.defaultEstimate_=void 0,this.minWeight_=void 0,this.minDelayMs_=void 0,this.slow_=void 0,this.fast_=void 0,this.defaultTTFB_=void 0,this.ttfb_=void 0,this.defaultEstimate_=s,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new mh(e),this.fast_=new mh(i),this.defaultTTFB_=o,this.ttfb_=new mh(e)}update(e,i){const{slow_:s,fast_:o,ttfb_:u}=this;s.halfLife!==e&&(this.slow_=new mh(e,s.getEstimate(),s.getTotalWeight())),o.halfLife!==i&&(this.fast_=new mh(i,o.getEstimate(),o.getTotalWeight())),u.halfLife!==e&&(this.ttfb_=new mh(e,u.getEstimate(),u.getTotalWeight()))}sample(e,i){e=Math.max(e,this.minDelayMs_);const s=8*i,o=e/1e3,u=s/o;this.fast_.sample(o,u),this.slow_.sample(o,u)}sampleTTFB(e){const i=e/1e3,s=Math.sqrt(2)*Math.exp(-Math.pow(i,2)/2);this.ttfb_.sample(s,Math.max(e,5))}canEstimate(){return this.fast_.getTotalWeight()>=this.minWeight_}getEstimate(){return this.canEstimate()?Math.min(this.fast_.getEstimate(),this.slow_.getEstimate()):this.defaultEstimate_}getEstimateTTFB(){return this.ttfb_.getTotalWeight()>=this.minWeight_?this.ttfb_.getEstimate():this.defaultTTFB_}get defaultEstimate(){return this.defaultEstimate_}destroy(){}}function H_(h,e,i){return(e=V_(e))in h?Object.defineProperty(h,e,{value:i,enumerable:!0,configurable:!0,writable:!0}):h[e]=i,h}function Jt(){return Jt=Object.assign?Object.assign.bind():function(h){for(var e=1;e<arguments.length;e++){var i=arguments[e];for(var s in i)({}).hasOwnProperty.call(i,s)&&(h[s]=i[s])}return h},Jt.apply(null,arguments)}function gx(h,e){var i=Object.keys(h);if(Object.getOwnPropertySymbols){var s=Object.getOwnPropertySymbols(h);e&&(s=s.filter(function(o){return Object.getOwnPropertyDescriptor(h,o).enumerable})),i.push.apply(i,s)}return i}function Qt(h){for(var e=1;e<arguments.length;e++){var i=arguments[e]!=null?arguments[e]:{};e%2?gx(Object(i),!0).forEach(function(s){H_(h,s,i[s])}):Object.getOwnPropertyDescriptors?Object.defineProperties(h,Object.getOwnPropertyDescriptors(i)):gx(Object(i)).forEach(function(s){Object.defineProperty(h,s,Object.getOwnPropertyDescriptor(i,s))})}return h}function j_(h,e){if(typeof h!="object"||!h)return h;var i=h[Symbol.toPrimitive];if(i!==void 0){var s=i.call(h,e);if(typeof s!="object")return s;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(h)}function V_(h){var e=j_(h,"string");return typeof e=="symbol"?e:e+""}class Xs{constructor(e,i){this.trace=void 0,this.debug=void 0,this.log=void 0,this.warn=void 0,this.info=void 0,this.error=void 0;const s=`[${e}]:`;this.trace=wu,this.debug=i.debug.bind(null,s),this.log=i.log.bind(null,s),this.warn=i.warn.bind(null,s),this.info=i.info.bind(null,s),this.error=i.error.bind(null,s)}}const wu=function(){},Y_={trace:wu,debug:wu,log:wu,warn:wu,info:wu,error:wu};function pT(){return Jt({},Y_)}function q_(h,e){const i=self.console[h];return i?i.bind(self.console,`${e?"["+e+"] ":""}[${h}] >`):wu}function px(h,e,i){return e[h]?e[h].bind(e):q_(h,i)}const yT=pT();function K_(h,e,i){const s=pT();if(typeof console=="object"&&h===!0||typeof h=="object"){const o=["debug","log","info","warn","error"];o.forEach(u=>{s[u]=px(u,h,i)});try{s.log(`Debug logs enabled for "${e}" in hls.js version 1.6.15`)}catch{return pT()}o.forEach(u=>{yT[u]=px(u,h)})}else Jt(yT,s);return s}const Zt=yT;function Nu(h=!0){return typeof self>"u"?void 0:(h||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function X_(h){return typeof self<"u"&&h===self.ManagedMediaSource}function yx(h,e){const i=Object.keys(h),s=Object.keys(e),o=i.length,u=s.length;return!o||!u||o===u&&!i.some(d=>s.indexOf(d)===-1)}function ds(h,e=!1){if(typeof TextDecoder<"u"){const v=new TextDecoder("utf-8").decode(h);if(e){const E=v.indexOf("\0");return E!==-1?v.substring(0,E):v}return v.replace(/\0/g,"")}const i=h.length;let s,o,u,d="",g=0;for(;g<i;){if(s=h[g++],s===0&&e)return d;if(s===0||s===3)continue;switch(s>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:d+=String.fromCharCode(s);break;case 12:case 13:o=h[g++],d+=String.fromCharCode((s&31)<<6|o&63);break;case 14:o=h[g++],u=h[g++],d+=String.fromCharCode((s&15)<<12|(o&63)<<6|(u&63)<<0);break}}return d}function zi(h){let e="";for(let i=0;i<h.length;i++){let s=h[i].toString(16);s.length<2&&(s="0"+s),e+=s}return e}function vx(h){return Uint8Array.from(h.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function Q_(h){return h&&h.__esModule&&Object.prototype.hasOwnProperty.call(h,"default")?h.default:h}var vT={exports:{}},Sx;function Z_(){return Sx||(Sx=1,function(h,e){(function(i){var s=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,o=/^(?=([^\/?#]*))\1([^]*)$/,u=/(?:\/|^)\.(?=\/)/g,d=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,g={buildAbsoluteURL:function(S,v,E){if(E=E||{},S=S.trim(),v=v.trim(),!v){if(!E.alwaysNormalize)return S;var b=g.parseURL(S);if(!b)throw new Error("Error trying to parse base URL.");return b.path=g.normalizePath(b.path),g.buildURLFromParts(b)}var R=g.parseURL(v);if(!R)throw new Error("Error trying to parse relative URL.");if(R.scheme)return E.alwaysNormalize?(R.path=g.normalizePath(R.path),g.buildURLFromParts(R)):v;var _=g.parseURL(S);if(!_)throw new Error("Error trying to parse base URL.");if(!_.netLoc&&_.path&&_.path[0]!=="/"){var D=o.exec(_.path);_.netLoc=D[1],_.path=D[2]}_.netLoc&&!_.path&&(_.path="/");var I={scheme:_.scheme,netLoc:R.netLoc,path:null,params:R.params,query:R.query,fragment:R.fragment};if(!R.netLoc&&(I.netLoc=_.netLoc,R.path[0]!=="/"))if(!R.path)I.path=_.path,R.params||(I.params=_.params,R.query||(I.query=_.query));else{var M=_.path,w=M.substring(0,M.lastIndexOf("/")+1)+R.path;I.path=g.normalizePath(w)}return I.path===null&&(I.path=E.alwaysNormalize?g.normalizePath(R.path):R.path),g.buildURLFromParts(I)},parseURL:function(S){var v=s.exec(S);return v?{scheme:v[1]||"",netLoc:v[2]||"",path:v[3]||"",params:v[4]||"",query:v[5]||"",fragment:v[6]||""}:null},normalizePath:function(S){for(S=S.split("").reverse().join("").replace(u,"");S.length!==(S=S.replace(d,"")).length;);return S.split("").reverse().join("")},buildURLFromParts:function(S){return S.scheme+S.netLoc+S.path+S.params+S.query+S.fragment}};h.exports=g})()}(vT)),vT.exports}var ST=Z_();class ET{constructor(){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}}}var ln={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class Ex{constructor(e){this._byteRange=null,this._url=null,this._stats=null,this._streams=null,this.base=void 0,this.relurl=void 0,typeof e=="string"&&(e={url:e}),this.base=e,W_(this,"stats")}setByteRange(e,i){const s=e.split("@",2);let o;s.length===1?o=(i==null?void 0:i.byteRangeEndOffset)||0:o=parseInt(s[1]),this._byteRange=[o,parseInt(s[0])+o]}get baseurl(){return this.base.url}get byteRange(){return this._byteRange===null?[]:this._byteRange}get byteRangeStartOffset(){return this.byteRange[0]}get byteRangeEndOffset(){return this.byteRange[1]}get elementaryStreams(){return this._streams===null&&(this._streams={[ln.AUDIO]:null,[ln.VIDEO]:null,[ln.AUDIOVIDEO]:null}),this._streams}set elementaryStreams(e){this._streams=e}get hasStats(){return this._stats!==null}get hasStreams(){return this._streams!==null}get stats(){return this._stats===null&&(this._stats=new ET),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=ST.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[ln.AUDIO]=null,e[ln.VIDEO]=null,e[ln.AUDIOVIDEO]=null}}function Vn(h){return h.sn!=="initSegment"}class TT extends Ex{constructor(e,i){super(i),this._decryptdata=null,this._programDateTime=null,this._ref=null,this._bitrate=void 0,this.rawProgramDateTime=null,this.tagList=[],this.duration=0,this.sn=0,this.levelkeys=void 0,this.type=void 0,this.loader=null,this.keyLoader=null,this.level=-1,this.cc=0,this.startPTS=void 0,this.endPTS=void 0,this.startDTS=void 0,this.endDTS=void 0,this.start=0,this.playlistOffset=0,this.deltaPTS=void 0,this.maxStartPTS=void 0,this.minEndPTS=void 0,this.data=void 0,this.bitrateTest=!1,this.title=null,this.initSegment=null,this.endList=void 0,this.gap=void 0,this.urlId=0,this.type=e}get byteLength(){if(this.hasStats){const e=this.stats.total;if(e)return e}if(this.byteRange.length){const e=this.byteRange[0],i=this.byteRange[1];if(Ue(e)&&Ue(i))return i-e}return null}get bitrate(){return this.byteLength?this.byteLength*8/this.duration:this._bitrate?this._bitrate:null}set bitrate(e){this._bitrate=e}get decryptdata(){var e;const{levelkeys:i}=this;if(!i||i.NONE)return null;if(i.identity)this._decryptdata||(this._decryptdata=i.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const s=Object.keys(i);if(s.length===1){const o=this._decryptdata=i[s[0]]||null;o&&(this._decryptdata=o.getDecryptData(this.sn,i))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=Ue(this.duration)?this.duration:0;return this.programDateTime+e*1e3}get encrypted(){var e;if((e=this._decryptdata)!=null&&e.encrypted)return!0;if(this.levelkeys){var i;const s=Object.keys(this.levelkeys),o=s.length;if(o>1||o===1&&(i=this.levelkeys[s[0]])!=null&&i.encrypted)return!0}return!1}get programDateTime(){return this._programDateTime===null&&this.rawProgramDateTime&&(this.programDateTime=Date.parse(this.rawProgramDateTime)),this._programDateTime}set programDateTime(e){if(!Ue(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return Vn(this)?(this._ref||(this._ref={base:this.base,start:this.start,duration:this.duration,sn:this.sn,programDateTime:this.programDateTime}),this._ref):null}addStart(e){this.setStart(this.start+e)}setStart(e){this.start=e,this._ref&&(this._ref.start=e)}setDuration(e){this.duration=e,this._ref&&(this._ref.duration=e)}setKeyFormat(e){const i=this.levelkeys;if(i){var s;const o=i[e];o&&!((s=this._decryptdata)!=null&&s.keyId)&&(this._decryptdata=o.getDecryptData(this.sn,i))}}abortRequests(){var e,i;(e=this.loader)==null||e.abort(),(i=this.keyLoader)==null||i.abort()}setElementaryStreamInfo(e,i,s,o,u,d=!1){const{elementaryStreams:g}=this,S=g[e];if(!S){g[e]={startPTS:i,endPTS:s,startDTS:o,endDTS:u,partial:d};return}S.startPTS=Math.min(S.startPTS,i),S.endPTS=Math.max(S.endPTS,s),S.startDTS=Math.min(S.startDTS,o),S.endDTS=Math.max(S.endDTS,u)}}class J_ extends Ex{constructor(e,i,s,o,u){super(s),this.fragOffset=0,this.duration=0,this.gap=!1,this.independent=!1,this.relurl=void 0,this.fragment=void 0,this.index=void 0,this.duration=e.decimalFloatingPoint("DURATION"),this.gap=e.bool("GAP"),this.independent=e.bool("INDEPENDENT"),this.relurl=e.enumeratedString("URI"),this.fragment=i,this.index=o;const d=e.enumeratedString("BYTERANGE");d&&this.setByteRange(d,u),u&&(this.fragOffset=u.fragOffset+u.duration)}get start(){return this.fragment.start+this.fragOffset}get end(){return this.start+this.duration}get loaded(){const{elementaryStreams:e}=this;return!!(e.audio||e.video||e.audiovideo)}}function Tx(h,e){const i=Object.getPrototypeOf(h);if(i){const s=Object.getOwnPropertyDescriptor(i,e);return s||Tx(i,e)}}function W_(h,e){const i=Tx(h,e);i&&(i.enumerable=!0,Object.defineProperty(h,e,i))}const bx=Math.pow(2,32)-1,eC=[].push,xx={video:1,audio:2,id3:3,text:4};function pi(h){return String.fromCharCode.apply(null,h)}function Ax(h,e){const i=h[e]<<8|h[e+1];return i<0?65536+i:i}function it(h,e){const i=Dx(h,e);return i<0?4294967296+i:i}function Rx(h,e){let i=it(h,e);return i*=Math.pow(2,32),i+=it(h,e+4),i}function Dx(h,e){return h[e]<<24|h[e+1]<<16|h[e+2]<<8|h[e+3]}function tC(h){const e=h.byteLength;for(let i=0;i<e;){const s=it(h,i);if(s>8&&h[i+4]===109&&h[i+5]===111&&h[i+6]===111&&h[i+7]===102)return!0;i=s>1?i+s:e}return!1}function Et(h,e){const i=[];if(!e.length)return i;const s=h.byteLength;for(let o=0;o<s;){const u=it(h,o),d=pi(h.subarray(o+4,o+8)),g=u>1?o+u:s;if(d===e[0])if(e.length===1)i.push(h.subarray(o+8,g));else{const S=Et(h.subarray(o+8,g),e.slice(1));S.length&&eC.apply(i,S)}o=g}return i}function nC(h){const e=[],i=h[0];let s=8;const o=it(h,s);s+=4;let u=0,d=0;i===0?(u=it(h,s),d=it(h,s+4),s+=8):(u=Rx(h,s),d=Rx(h,s+8),s+=16),s+=2;let g=h.length+d;const S=Ax(h,s);s+=2;for(let v=0;v<S;v++){let E=s;const b=it(h,E);E+=4;const R=b&2147483647;if((b&2147483648)>>>31===1)return Zt.warn("SIDX has hierarchical references (not supported)"),null;const D=it(h,E);E+=4,e.push({referenceSize:R,subsegmentDuration:D,info:{duration:D/o,start:g,end:g+R-1}}),g+=R,E+=4,s=E}return{earliestPresentationTime:u,timescale:o,version:i,referencesCount:S,references:e}}function Lx(h){const e=[],i=Et(h,["moov","trak"]);for(let o=0;o<i.length;o++){const u=i[o],d=Et(u,["tkhd"])[0];if(d){let g=d[0];const S=it(d,g===0?12:20),v=Et(u,["mdia","mdhd"])[0];if(v){g=v[0];const E=it(v,g===0?12:20),b=Et(u,["mdia","hdlr"])[0];if(b){const R=pi(b.subarray(8,12)),_={soun:ln.AUDIO,vide:ln.VIDEO}[R],D=Et(u,["mdia","minf","stbl","stsd"])[0],I=iC(D);_?(e[S]={timescale:E,type:_,stsd:I},e[_]=Qt({timescale:E,id:S},I)):e[S]={timescale:E,type:R,stsd:I}}}}}return Et(h,["moov","mvex","trex"]).forEach(o=>{const u=it(o,4),d=e[u];d&&(d.default={duration:it(o,12),flags:it(o,20)})}),e}function iC(h){const e=h.subarray(8),i=e.subarray(86),s=pi(e.subarray(4,8));let o=s,u;const d=s==="enca"||s==="encv";if(d){const v=Et(e,[s])[0].subarray(s==="enca"?28:78);Et(v,["sinf"]).forEach(b=>{const R=Et(b,["schm"])[0];if(R){const _=pi(R.subarray(4,8));if(_==="cbcs"||_==="cenc"){const D=Et(b,["frma"])[0];D&&(o=pi(D))}}})}const g=o;switch(o){case"avc1":case"avc2":case"avc3":case"avc4":{const S=Et(i,["avcC"])[0];S&&S.length>3&&(o+="."+lv(S[1])+lv(S[2])+lv(S[3]),u=sv(g==="avc1"?"dva1":"dvav",i));break}case"mp4a":{const S=Et(e,[s])[0],v=Et(S.subarray(28),["esds"])[0];if(v&&v.length>7){let E=4;if(v[E++]!==3)break;E=bT(v,E),E+=2;const b=v[E++];if(b&128&&(E+=2),b&64&&(E+=v[E++]),v[E++]!==4)break;E=bT(v,E);const R=v[E++];if(R===64)o+="."+lv(R);else break;if(E+=12,v[E++]!==5)break;E=bT(v,E);const _=v[E++];let D=(_&248)>>3;D===31&&(D+=1+((_&7)<<3)+((v[E]&224)>>5)),o+="."+D}break}case"hvc1":case"hev1":{const S=Et(i,["hvcC"])[0];if(S&&S.length>12){const v=S[1],E=["","A","B","C"][v>>6],b=v&31,R=it(S,2),_=(v&32)>>5?"H":"L",D=S[12],I=S.subarray(6,12);o+="."+E+b,o+="."+aC(R).toString(16).toUpperCase(),o+="."+_+D;let M="";for(let w=I.length;w--;){const B=I[w];(B||M)&&(M="."+B.toString(16).toUpperCase()+M)}o+=M}u=sv(g=="hev1"?"dvhe":"dvh1",i);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{o=sv(o,i)||o;break}case"vp09":{const S=Et(i,["vpcC"])[0];if(S&&S.length>6){const v=S[4],E=S[5],b=S[6]>>4&15;o+="."+Tr(v)+"."+Tr(E)+"."+Tr(b)}break}case"av01":{const S=Et(i,["av1C"])[0];if(S&&S.length>2){const v=S[1]>>>5,E=S[1]&31,b=S[2]>>>7?"H":"M",R=(S[2]&64)>>6,_=(S[2]&32)>>5,D=v===2&&R?_?12:10:R?10:8,I=(S[2]&16)>>4,M=(S[2]&8)>>3,w=(S[2]&4)>>2,B=S[2]&3;o+="."+v+"."+Tr(E)+b+"."+Tr(D)+"."+I+"."+M+w+B+"."+Tr(1)+"."+Tr(1)+"."+Tr(1)+"."+0,u=sv("dav1",i)}break}}return{codec:o,encrypted:d,supplemental:u}}function sv(h,e){const i=Et(e,["dvvC"]),s=i.length?i[0]:Et(e,["dvcC"])[0];if(s){const o=s[2]>>1&127,u=s[2]<<5&32|s[3]>>3&31;return h+"."+Tr(o)+"."+Tr(u)}}function aC(h){let e=0;for(let i=0;i<32;i++)e|=(h>>i&1)<<31-i;return e>>>0}function bT(h,e){const i=e+5;for(;h[e++]&128&&e<i;);return e}function lv(h){return("0"+h.toString(16).toUpperCase()).slice(-2)}function Tr(h){return(h<10?"0":"")+h}function sC(h,e){if(!h||!e)return;const i=e.keyId;i&&e.isCommonEncryption&&_x(h,(s,o)=>{const u=s.subarray(8,24);u.some(d=>d!==0)||(Zt.log(`[eme] Patching keyId in 'enc${o?"a":"v"}>sinf>>tenc' box: ${zi(u)} -> ${zi(i)}`),s.set(i,8))})}function lC(h){const e=[];return _x(h,i=>e.push(i.subarray(8,24))),e}function _x(h,e){Et(h,["moov","trak"]).forEach(s=>{const o=Et(s,["mdia","minf","stbl","stsd"])[0];if(!o)return;const u=o.subarray(8);let d=Et(u,["enca"]);const g=d.length>0;g||(d=Et(u,["encv"])),d.forEach(S=>{const v=g?S.subarray(28):S.subarray(78);Et(v,["sinf"]).forEach(b=>{const R=Cx(b);R&&e(R,g)})})})}function Cx(h){const e=Et(h,["schm"])[0];if(e){const i=pi(e.subarray(4,8));if(i==="cbcs"||i==="cenc"){const s=Et(h,["schi","tenc"])[0];if(s)return s}}}function rC(h,e,i){const s={},o=Et(h,["moof","traf"]);for(let u=0;u<o.length;u++){const d=o[u],g=Et(d,["tfhd"])[0],S=it(g,4),v=e[S];if(!v)continue;s[S]||(s[S]={start:NaN,duration:0,sampleCount:0,timescale:v.timescale,type:v.type});const E=s[S],b=Et(d,["tfdt"])[0];if(b){const z=b[0];let G=it(b,4);z===1&&(G===bx?i.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(G*=bx+1,G+=it(b,8))),Ue(G)&&(!Ue(E.start)||G<E.start)&&(E.start=G)}const R=v.default,_=it(g,0)|(R==null?void 0:R.flags);let D=(R==null?void 0:R.duration)||0;_&8&&(_&2?D=it(g,12):D=it(g,8));const I=Et(d,["trun"]);let M=E.start||0,w=0,B=D;for(let z=0;z<I.length;z++){const G=I[z],K=it(G,4),ae=E.sampleCount;E.sampleCount+=K;const q=G[3]&1,Z=G[3]&4,te=G[2]&1,$=G[2]&2,me=G[2]&4,Ee=G[2]&8;let De=8,Ie=K;for(q&&(De+=4),Z&&K&&(!(G[De+1]&1)&&E.keyFrameIndex===void 0&&(E.keyFrameIndex=ae),De+=4,te?(B=it(G,De),De+=4):B=D,$&&(De+=4),Ee&&(De+=4),M+=B,w+=B,Ie--);Ie--;)te?(B=it(G,De),De+=4):B=D,$&&(De+=4),me&&(G[De+1]&1||E.keyFrameIndex===void 0&&(E.keyFrameIndex=E.sampleCount-(Ie+1),E.keyFrameStart=M),De+=4),Ee&&(De+=4),M+=B,w+=B;!w&&D&&(w+=D*K)}E.duration+=w}if(!Object.keys(s).some(u=>s[u].duration)){let u=1/0,d=0;const g=Et(h,["sidx"]);for(let S=0;S<g.length;S++){const v=nC(g[S]);if(v!=null&&v.references){u=Math.min(u,v.earliestPresentationTime/v.timescale);const E=v.references.reduce((b,R)=>b+R.info.duration||0,0);d=Math.max(d,E+v.earliestPresentationTime/v.timescale)}}d&&Ue(d)&&Object.keys(s).forEach(S=>{s[S].duration||(s[S].duration=d*s[S].timescale-s[S].start)})}return s}function oC(h){const e={valid:null,remainder:null},i=Et(h,["moof"]);if(i.length<2)return e.remainder=h,e;const s=i[i.length-1];return e.valid=h.slice(0,s.byteOffset-8),e.remainder=h.slice(s.byteOffset-8),e}function Qs(h,e){const i=new Uint8Array(h.length+e.length);return i.set(h),i.set(e,h.length),i}function Ox(h,e){const i=[],s=e.samples,o=e.timescale,u=e.id;let d=!1;return Et(s,["moof"]).map(S=>{const v=S.byteOffset-8;Et(S,["traf"]).map(b=>{const R=Et(b,["tfdt"]).map(_=>{const D=_[0];let I=it(_,4);return D===1&&(I*=Math.pow(2,32),I+=it(_,8)),I/o})[0];return R!==void 0&&(h=R),Et(b,["tfhd"]).map(_=>{const D=it(_,4),I=it(_,0)&16777215,M=(I&1)!==0,w=(I&2)!==0,B=(I&8)!==0;let z=0;const G=(I&16)!==0;let K=0;const ae=(I&32)!==0;let q=8;D===u&&(M&&(q+=8),w&&(q+=4),B&&(z=it(_,q),q+=4),G&&(K=it(_,q),q+=4),ae&&(q+=4),e.type==="video"&&(d=rv(e.codec)),Et(b,["trun"]).map(Z=>{const te=Z[0],$=it(Z,0)&16777215,me=($&1)!==0;let Ee=0;const De=($&4)!==0,Ie=($&256)!==0;let Oe=0;const F=($&512)!==0;let ne=0;const le=($&1024)!==0,xe=($&2048)!==0;let _e=0;const Q=it(Z,4);let de=8;me&&(Ee=it(Z,de),de+=4),De&&(de+=4);let Le=Ee+v;for(let Ce=0;Ce<Q;Ce++){if(Ie?(Oe=it(Z,de),de+=4):Oe=z,F?(ne=it(Z,de),de+=4):ne=K,le&&(de+=4),xe&&(te===0?_e=it(Z,de):_e=Dx(Z,de),de+=4),e.type===ln.VIDEO){let Fe=0;for(;Fe<ne;){const Ve=it(s,Le);if(Le+=4,uC(d,s[Le])){const at=s.subarray(Le,Le+Ve);xT(at,d?2:1,h+_e/o,i)}Le+=Ve,Fe+=Ve+4}}h+=Oe/o}}))})})}),i}function rv(h){if(!h)return!1;const e=h.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function uC(h,e){if(h){const i=e>>1&63;return i===39||i===40}else return(e&31)===6}function xT(h,e,i,s){const o=Mx(h);let u=0;u+=e;let d=0,g=0,S=0;for(;u<o.length;){d=0;do{if(u>=o.length)break;S=o[u++],d+=S}while(S===255);g=0;do{if(u>=o.length)break;S=o[u++],g+=S}while(S===255);const v=o.length-u;let E=u;if(g<v)u+=g;else if(g>v){Zt.error(`Malformed SEI payload. ${g} is too small, only ${v} bytes left to parse.`);break}if(d===4){if(o[E++]===181){const R=Ax(o,E);if(E+=2,R===49){const _=it(o,E);if(E+=4,_===1195456820){const D=o[E++];if(D===3){const I=o[E++],M=31&I,w=64&I,B=w?2+M*3:0,z=new Uint8Array(B);if(w){z[0]=I;for(let G=1;G<B;G++)z[G]=o[E++]}s.push({type:D,payloadType:d,pts:i,bytes:z})}}}}}else if(d===5&&g>16){const b=[];for(let D=0;D<16;D++){const I=o[E++].toString(16);b.push(I.length==1?"0"+I:I),(D===3||D===5||D===7||D===9)&&b.push("-")}const R=g-16,_=new Uint8Array(R);for(let D=0;D<R;D++)_[D]=o[E++];s.push({payloadType:d,pts:i,uuid:b.join(""),userData:ds(_),userDataBytes:_})}}}function Mx(h){const e=h.byteLength,i=[];let s=1;for(;s<e-2;)h[s]===0&&h[s+1]===0&&h[s+2]===3?(i.push(s+2),s+=2):s++;if(i.length===0)return h;const o=e-i.length,u=new Uint8Array(o);let d=0;for(s=0;s<o;d++,s++)d===i[0]&&(d++,i.shift()),u[s]=h[d];return u}function cC(h){const e=h[0];let i="",s="",o=0,u=0,d=0,g=0,S=0,v=0;if(e===0){for(;pi(h.subarray(v,v+1))!=="\0";)i+=pi(h.subarray(v,v+1)),v+=1;for(i+=pi(h.subarray(v,v+1)),v+=1;pi(h.subarray(v,v+1))!=="\0";)s+=pi(h.subarray(v,v+1)),v+=1;s+=pi(h.subarray(v,v+1)),v+=1,o=it(h,12),u=it(h,16),g=it(h,20),S=it(h,24),v=28}else if(e===1){v+=4,o=it(h,v),v+=4;const b=it(h,v);v+=4;const R=it(h,v);for(v+=4,d=2**32*b+R,P_(d)||(d=Number.MAX_SAFE_INTEGER,Zt.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),g=it(h,v),v+=4,S=it(h,v),v+=4;pi(h.subarray(v,v+1))!=="\0";)i+=pi(h.subarray(v,v+1)),v+=1;for(i+=pi(h.subarray(v,v+1)),v+=1;pi(h.subarray(v,v+1))!=="\0";)s+=pi(h.subarray(v,v+1)),v+=1;s+=pi(h.subarray(v,v+1)),v+=1}const E=h.subarray(v,h.byteLength);return{schemeIdUri:i,value:s,timeScale:o,presentationTime:d,presentationTimeDelta:u,eventDuration:g,id:S,payload:E}}function fC(h,...e){const i=e.length;let s=8,o=i;for(;o--;)s+=e[o].byteLength;const u=new Uint8Array(s);for(u[0]=s>>24&255,u[1]=s>>16&255,u[2]=s>>8&255,u[3]=s&255,u.set(h,4),o=0,s=8;o<i;o++)u.set(e[o],s),s+=e[o].byteLength;return u}function dC(h,e,i){if(h.byteLength!==16)throw new RangeError("Invalid system id");let s,o;s=0,o=new Uint8Array;let u;s>0?(u=new Uint8Array(4),e.length>0&&new DataView(u.buffer).setUint32(0,e.length,!1)):u=new Uint8Array;const d=new Uint8Array(4);return i.byteLength>0&&new DataView(d.buffer).setUint32(0,i.byteLength,!1),fC([112,115,115,104],new Uint8Array([s,0,0,0]),h,u,o,d,i)}function hC(h){const e=[];if(h instanceof ArrayBuffer){const i=h.byteLength;let s=0;for(;s+32<i;){const o=new DataView(h,s),u=mC(o);e.push(u),s+=u.size}}return e}function mC(h){const e=h.getUint32(0),i=h.byteOffset,s=h.byteLength;if(s<e)return{offset:i,size:s};if(h.getUint32(4)!==1886614376)return{offset:i,size:e};const u=h.getUint32(8)>>>24;if(u!==0&&u!==1)return{offset:i,size:e};const d=h.buffer,g=zi(new Uint8Array(d,i+12,16));let S=null,v=null,E=0;if(u===0)E=28;else{const R=h.getUint32(28);if(!R||s<32+R*16)return{offset:i,size:e};S=[];for(let _=0;_<R;_++)S.push(new Uint8Array(d,i+32+_*16,16));E=32+R*16}if(!E)return{offset:i,size:e};const b=h.getUint32(E);return e-32<b?{offset:i,size:e}:(v=new Uint8Array(d,i+E+4,b),{version:u,systemId:g,kids:S,data:v,offset:i,size:e})}const Ix=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),gh={audio:{a3ds:1,"ac-3":.95,"ac-4":1,alac:.9,alaw:1,dra1:1,"dts+":1,"dts-":1,dtsc:1,dtse:1,dtsh:1,"ec-3":.9,enca:1,fLaC:.9,flac:.9,FLAC:.9,g719:1,g726:1,m4ae:1,mha1:1,mha2:1,mhm1:1,mhm2:1,mlpa:1,mp4a:1,"raw ":1,Opus:1,opus:1,samr:1,sawb:1,sawp:1,sevc:1,sqcp:1,ssmv:1,twos:1,ulaw:1},video:{avc1:1,avc2:1,avc3:1,avc4:1,avcp:1,av01:.8,dav1:.8,drac:1,dva1:1,dvav:1,dvh1:.7,dvhe:.7,encv:1,hev1:.75,hvc1:.75,mjp2:1,mp4v:1,mvc1:1,mvc2:1,mvc3:1,mvc4:1,resv:1,rv60:1,s263:1,svc1:1,svc2:1,"vc-1":1,vp08:1,vp09:.9},text:{stpp:1,wvtt:1}};function AT(h,e){const i=gh[e];return!!i&&!!i[h.slice(0,4)]}function Zg(h,e,i=!0){return!h.split(",").some(s=>!RT(s,e,i))}function RT(h,e,i=!0){var s;const o=Nu(i);return(s=o==null?void 0:o.isTypeSupported(Jg(h,e)))!=null?s:!1}function Jg(h,e){return`${e}/mp4;codecs=${h}`}function wx(h){if(h){const e=h.substring(0,4);return gh.video[e]}return 2}function ov(h){const e=Ix();return h.split(",").reduce((i,s)=>{const u=e&&rv(s)?9:gh.video[s];return u?(u*2+i)/(i?3:2):(gh.audio[s]+i)/(i?2:1)},0)}const DT={};function gC(h,e=!0){if(DT[h])return DT[h];const i={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[h];for(let o=0;o<i.length;o++){var s;if(RT(i[o],"audio",e))return DT[h]=i[o],i[o];if(i[o]==="mp3"&&(s=Nu(e))!=null&&s.isTypeSupported("audio/mpeg"))return""}return h}const pC=/flac|opus|mp4a\.40\.34/i;function uv(h,e=!0){return h.replace(pC,i=>gC(i.toLowerCase(),e))}function yC(h,e){const i=[];if(h){const s=h.split(",");for(let o=0;o<s.length;o++)AT(s[o],"video")||i.push(s[o])}return e&&i.push(e),i.join(",")}function cv(h,e){if(h&&(h.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(h)!==-1)&&(Nx(h,"audio")||Nx(h,"video")))return h;if(e){const i=e.split(",");if(i.length>1){if(h){for(let s=i.length;s--;)if(i[s].substring(0,4)===h.substring(0,4))return i[s]}return i[0]}}return e||h}function Nx(h,e){return AT(h,e)&&RT(h,e)}function vC(h){const e=h.split(",");for(let i=0;i<e.length;i++){const s=e[i].split(".");s.length>2&&s[0]==="avc1"&&(e[i]=`avc1.${parseInt(s[1]).toString(16)}${("000"+parseInt(s[2]).toString(16)).slice(-4)}`)}return e.join(",")}function SC(h){if(h.startsWith("av01.")){const e=h.split("."),i=["0","111","01","01","01","0"];for(let s=e.length;s>4&&s<10;s++)e[s]=i[s-4];return e.join(".")}return h}function Ux(h){const e=Nu(h)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function LT(h){return h.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const EC={supported:!0,powerEfficient:!0,smooth:!0},TC={supported:!1,smooth:!1,powerEfficient:!1},kx={supported:!0,configurations:[],decodingInfoResults:[EC]};function Bx(h,e){return{supported:!1,configurations:e,decodingInfoResults:[TC],error:h}}function bC(h,e,i,s,o,u){const d=h.videoCodec,g=h.audioCodec?h.audioGroups:null,S=u==null?void 0:u.audioCodec,v=u==null?void 0:u.channels,E=v?parseInt(v):S?1/0:2;let b=null;if(g!=null&&g.length)try{g.length===1&&g[0]?b=e.groups[g[0]].channels:b=g.reduce((R,_)=>{if(_){const D=e.groups[_];if(!D)throw new Error(`Audio track group ${_} not found`);Object.keys(D.channels).forEach(I=>{R[I]=(R[I]||0)+D.channels[I]})}return R},{2:0})}catch{return!0}return d!==void 0&&(d.split(",").some(R=>rv(R))||h.width>1920&&h.height>1088||h.height>1920&&h.width>1088||h.frameRate>Math.max(s,30)||h.videoRange!=="SDR"&&h.videoRange!==i||h.bitrate>Math.max(o,8e6))||!!b&&Ue(E)&&Object.keys(b).some(R=>parseInt(R)>E)}function zx(h,e,i,s={}){const o=h.videoCodec;if(!o&&!h.audioCodec||!i)return Promise.resolve(kx);const u=[],d=xC(h),g=d.length,S=AC(h,e,g>0),v=S.length;for(let E=g||1*v||1;E--;){const b={type:"media-source"};if(g&&(b.video=d[E%g]),v){b.audio=S[E%v];const R=b.audio.bitrate;b.video&&R&&(b.video.bitrate-=R)}u.push(b)}if(o){const E=navigator.userAgent;if(o.split(",").some(b=>rv(b))&&Ix())return Promise.resolve(Bx(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${E})`),u))}return Promise.all(u.map(E=>{const b=DC(E);return s[b]||(s[b]=i.decodingInfo(E))})).then(E=>({supported:!E.some(b=>!b.supported),configurations:u,decodingInfoResults:E})).catch(E=>({supported:!1,configurations:u,decodingInfoResults:[],error:E}))}function xC(h){var e;const i=(e=h.videoCodec)==null?void 0:e.split(","),s=Fx(h),o=h.width||640,u=h.height||480,d=h.frameRate||30,g=h.videoRange.toLowerCase();return i?i.map(S=>{const v={contentType:Jg(SC(S),"video"),width:o,height:u,bitrate:s,framerate:d};return g!=="sdr"&&(v.transferFunction=g),v}):[]}function AC(h,e,i){var s;const o=(s=h.audioCodec)==null?void 0:s.split(","),u=Fx(h);return o&&h.audioGroups?h.audioGroups.reduce((d,g)=>{var S;const v=g?(S=e.groups[g])==null?void 0:S.tracks:null;return v?v.reduce((E,b)=>{if(b.groupId===g){const R=parseFloat(b.channels||"");o.forEach(_=>{const D={contentType:Jg(_,"audio"),bitrate:i?RC(_,u):u};R&&(D.channels=""+R),E.push(D)})}return E},d):d},[]):[]}function RC(h,e){if(e<=1)return 1;let i=128e3;return h==="ec-3"?i=768e3:h==="ac-3"&&(i=64e4),Math.min(e/2,i)}function Fx(h){return Math.ceil(Math.max(h.bitrate*.9,h.averageBitrate)/1e3)*1e3||1}function DC(h){let e="";const{audio:i,video:s}=h;if(s){const o=LT(s.contentType);e+=`${o}_r${s.height}x${s.width}f${Math.ceil(s.framerate)}${s.transferFunction||"sd"}_${Math.ceil(s.bitrate/1e5)}`}if(i){const o=LT(i.contentType);e+=`${s?"_":""}${o}_c${i.channels}`}return e}const _T=["NONE","TYPE-0","TYPE-1",null];function LC(h){return _T.indexOf(h)>-1}const fv=["SDR","PQ","HLG"];function _C(h){return!!h&&fv.indexOf(h)>-1}var dv={No:"",Yes:"YES",v2:"v2"};function Px(h){const{canSkipUntil:e,canSkipDateRanges:i,age:s}=h,o=s<e/2;return e&&o?i?dv.v2:dv.Yes:dv.No}class Gx{constructor(e,i,s){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=i,this.skip=s}addDirectives(e){const i=new self.URL(e);return this.msn!==void 0&&i.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&i.searchParams.set("_HLS_part",this.part.toString()),this.skip&&i.searchParams.set("_HLS_skip",this.skip),i.href}}class Wg{constructor(e){if(this._attrs=void 0,this.audioCodec=void 0,this.bitrate=void 0,this.codecSet=void 0,this.url=void 0,this.frameRate=void 0,this.height=void 0,this.id=void 0,this.name=void 0,this.supplemental=void 0,this.videoCodec=void 0,this.width=void 0,this.details=void 0,this.fragmentError=0,this.loadError=0,this.loaded=void 0,this.realBitrate=0,this.supportedPromise=void 0,this.supportedResult=void 0,this._avgBitrate=0,this._audioGroups=void 0,this._subtitleGroups=void 0,this._urlId=0,this.url=[e.url],this._attrs=[e.attrs],this.bitrate=e.bitrate,e.details&&(this.details=e.details),this.id=e.id||0,this.name=e.name,this.width=e.width||0,this.height=e.height||0,this.frameRate=e.attrs.optionalFloat("FRAME-RATE",0),this._avgBitrate=e.attrs.decimalInteger("AVERAGE-BANDWIDTH"),this.audioCodec=e.audioCodec,this.videoCodec=e.videoCodec,this.codecSet=[e.videoCodec,e.audioCodec].filter(s=>!!s).map(s=>s.substring(0,4)).join(","),"supplemental"in e){var i;this.supplemental=e.supplemental;const s=(i=e.supplemental)==null?void 0:i.videoCodec;s&&s!==e.videoCodec&&(this.codecSet+=`,${s.substring(0,4)}`)}this.addGroupId("audio",e.attrs.AUDIO),this.addGroupId("text",e.attrs.SUBTITLES)}get maxBitrate(){return Math.max(this.realBitrate,this.bitrate)}get averageBitrate(){return this._avgBitrate||this.realBitrate||this.bitrate}get attrs(){return this._attrs[0]}get codecs(){return this.attrs.CODECS||""}get pathwayId(){return this.attrs["PATHWAY-ID"]||"."}get videoRange(){return this.attrs["VIDEO-RANGE"]||"SDR"}get score(){return this.attrs.optionalFloat("SCORE",0)}get uri(){return this.url[0]||""}hasAudioGroup(e){return $x(this._audioGroups,e)}hasSubtitleGroup(e){return $x(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,i){if(i){if(e==="audio"){let s=this._audioGroups;s||(s=this._audioGroups=[]),s.indexOf(i)===-1&&s.push(i)}else if(e==="text"){let s=this._subtitleGroups;s||(s=this._subtitleGroups=[]),s.indexOf(i)===-1&&s.push(i)}}}get urlId(){return 0}set urlId(e){}get audioGroupIds(){return this.audioGroups?[this.audioGroupId]:void 0}get textGroupIds(){return this.subtitleGroups?[this.textGroupId]:void 0}get audioGroupId(){var e;return(e=this.audioGroups)==null?void 0:e[0]}get textGroupId(){var e;return(e=this.subtitleGroups)==null?void 0:e[0]}addFallback(){}}function $x(h,e){return!e||!h?!1:h.indexOf(e)!==-1}function CC(){if(typeof matchMedia=="function"){const h=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(h.media!==e.media)return h.matches===!0}return!1}function OC(h,e){let i=!1,s=[];if(h&&(i=h!=="SDR",s=[h]),e){s=e.allowedVideoRanges||fv.slice(0);const o=s.join("")!=="SDR"&&!e.videoCodec;i=e.preferHDR!==void 0?e.preferHDR:o&&CC(),i||(s=["SDR"])}return{preferHDR:i,allowedVideoRanges:s}}const MC=h=>{const e=new WeakSet;return(i,s)=>{if(h&&(s=h(i,s)),typeof s=="object"&&s!==null){if(e.has(s))return;e.add(s)}return s}},rn=(h,e)=>JSON.stringify(h,MC(e));function IC(h,e,i,s,o){const u=Object.keys(h),d=s==null?void 0:s.channels,g=s==null?void 0:s.audioCodec,S=o==null?void 0:o.videoCodec,v=d&&parseInt(d)===2;let E=!1,b=!1,R=1/0,_=1/0,D=1/0,I=1/0,M=0,w=[];const{preferHDR:B,allowedVideoRanges:z}=OC(e,o);for(let Z=u.length;Z--;){const te=h[u[Z]];E||(E=te.channels[2]>0),R=Math.min(R,te.minHeight),_=Math.min(_,te.minFramerate),D=Math.min(D,te.minBitrate),z.filter(me=>te.videoRanges[me]>0).length>0&&(b=!0)}R=Ue(R)?R:0,_=Ue(_)?_:0;const G=Math.max(1080,R),K=Math.max(30,_);D=Ue(D)?D:i,i=Math.max(D,i),b||(e=void 0);const ae=u.length>1;return{codecSet:u.reduce((Z,te)=>{const $=h[te];if(te===Z)return Z;if(w=b?z.filter(me=>$.videoRanges[me]>0):[],ae){if($.minBitrate>i)return br(te,`min bitrate of ${$.minBitrate} > current estimate of ${i}`),Z;if(!$.hasDefaultAudio)return br(te,"no renditions with default or auto-select sound found"),Z;if(g&&te.indexOf(g.substring(0,4))%5!==0)return br(te,`audio codec preference "${g}" not found`),Z;if(d&&!v){if(!$.channels[d])return br(te,`no renditions with ${d} channel sound found (channels options: ${Object.keys($.channels)})`),Z}else if((!g||v)&&E&&$.channels[2]===0)return br(te,"no renditions with stereo sound found"),Z;if($.minHeight>G)return br(te,`min resolution of ${$.minHeight} > maximum of ${G}`),Z;if($.minFramerate>K)return br(te,`min framerate of ${$.minFramerate} > maximum of ${K}`),Z;if(!w.some(me=>$.videoRanges[me]>0))return br(te,`no variants with VIDEO-RANGE of ${rn(w)} found`),Z;if(S&&te.indexOf(S.substring(0,4))%5!==0)return br(te,`video codec preference "${S}" not found`),Z;if($.maxScore<M)return br(te,`max score of ${$.maxScore} < selected max of ${M}`),Z}return Z&&(ov(te)>=ov(Z)||$.fragmentError>h[Z].fragmentError)?Z:(I=$.minIndex,M=$.maxScore,te)},void 0),videoRanges:w,preferHDR:B,minFramerate:_,minBitrate:D,minIndex:I}}function br(h,e){Zt.log(`[abr] start candidates with "${h}" ignored because ${e}`)}function Hx(h){return h.reduce((e,i)=>{let s=e.groups[i.groupId];s||(s=e.groups[i.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),s.tracks.push(i);const o=i.channels||"2";return s.channels[o]=(s.channels[o]||0)+1,s.hasDefault=s.hasDefault||i.default,s.hasAutoSelect=s.hasAutoSelect||i.autoselect,s.hasDefault&&(e.hasDefaultAudio=!0),s.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function wC(h,e,i,s){return h.slice(i,s+1).reduce((o,u,d)=>{if(!u.codecSet)return o;const g=u.audioGroups;let S=o[u.codecSet];S||(o[u.codecSet]=S={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:d,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!g,fragmentError:0}),S.minBitrate=Math.min(S.minBitrate,u.bitrate);const v=Math.min(u.height,u.width);return S.minHeight=Math.min(S.minHeight,v),S.minFramerate=Math.min(S.minFramerate,u.frameRate),S.minIndex=Math.min(S.minIndex,d),S.maxScore=Math.max(S.maxScore,u.score),S.fragmentError+=u.fragmentError,S.videoRanges[u.videoRange]=(S.videoRanges[u.videoRange]||0)+1,g&&g.forEach(E=>{if(!E)return;const b=e.groups[E];b&&(S.hasDefaultAudio=S.hasDefaultAudio||e.hasDefaultAudio?b.hasDefault:b.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(b.channels).forEach(R=>{S.channels[R]=(S.channels[R]||0)+b.channels[R]}))}),o},{})}function jx(h){if(!h)return h;const{lang:e,assocLang:i,characteristics:s,channels:o,audioCodec:u}=h;return{lang:e,assocLang:i,characteristics:s,channels:o,audioCodec:u}}function xr(h,e,i){if("attrs"in h){const s=e.indexOf(h);if(s!==-1)return s}for(let s=0;s<e.length;s++){const o=e[s];if(Tf(h,o,i))return s}return-1}function Tf(h,e,i){const{groupId:s,name:o,lang:u,assocLang:d,default:g}=h,S=h.forced;return(s===void 0||e.groupId===s)&&(o===void 0||e.name===o)&&(u===void 0||NC(u,e.lang))&&(u===void 0||e.assocLang===d)&&(g===void 0||e.default===g)&&(S===void 0||e.forced===S)&&(!("characteristics"in h)||UC(h.characteristics||"",e.characteristics))&&(i===void 0||i(h,e))}function NC(h,e="--"){return h.length===e.length?h===e:h.startsWith(e)||e.startsWith(h)}function UC(h,e=""){const i=h.split(","),s=e.split(",");return i.length===s.length&&!i.some(o=>s.indexOf(o)===-1)}function bf(h,e){const{audioCodec:i,channels:s}=h;return(i===void 0||(e.audioCodec||"").substring(0,4)===i.substring(0,4))&&(s===void 0||s===(e.channels||"2"))}function kC(h,e,i,s,o){const u=e[s],g=e.reduce((R,_,D)=>{const I=_.uri;return(R[I]||(R[I]=[])).push(D),R},{})[u.uri];g.length>1&&(s=Math.max.apply(Math,g));const S=u.videoRange,v=u.frameRate,E=u.codecSet.substring(0,4),b=Vx(e,s,R=>{if(R.videoRange!==S||R.frameRate!==v||R.codecSet.substring(0,4)!==E)return!1;const _=R.audioGroups,D=i.filter(I=>!_||_.indexOf(I.groupId)!==-1);return xr(h,D,o)>-1});return b>-1?b:Vx(e,s,R=>{const _=R.audioGroups,D=i.filter(I=>!_||_.indexOf(I.groupId)!==-1);return xr(h,D,o)>-1})}function Vx(h,e,i){for(let s=e;s>-1;s--)if(i(h[s]))return s;for(let s=e+1;s<h.length;s++)if(i(h[s]))return s;return-1}function hv(h,e){var i;return!!h&&h!==((i=e.loadLevelObj)==null?void 0:i.uri)}class BC extends Xs{constructor(e){super("abr",e.logger),this.hls=void 0,this.lastLevelLoadSec=0,this.lastLoadedFragLevel=-1,this.firstSelection=-1,this._nextAutoLevel=-1,this.nextAutoLevelKey="",this.audioTracksByGroup=null,this.codecTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=i=>{var s;const{fragCurrent:o,partCurrent:u,hls:d}=this,{autoLevelEnabled:g,media:S}=d;if(!o||!S)return;const v=performance.now(),E=u?u.stats:o.stats,b=u?u.duration:o.duration,R=v-E.loading.start,_=d.minAutoLevel,D=o.level,I=this._nextAutoLevel;if(E.aborted||E.loaded&&E.loaded===E.total||D<=_){this.clearTimer(),this._nextAutoLevel=-1;return}if(!g)return;const M=I>-1&&I!==D,w=!!i||M;if(!w&&(S.paused||!S.playbackRate||!S.readyState))return;const B=d.mainForwardBufferInfo;if(!w&&B===null)return;const z=this.bwEstimator.getEstimateTTFB(),G=Math.abs(S.playbackRate);if(R<=Math.max(z,1e3*(b/(G*2))))return;const K=B?B.len/G:0,ae=E.loading.first?E.loading.first-E.loading.start:-1,q=E.loaded&&ae>-1,Z=this.getBwEstimate(),te=d.levels,$=te[D],me=Math.max(E.loaded,Math.round(b*(o.bitrate||$.averageBitrate)/8));let Ee=q?R-ae:R;Ee<1&&q&&(Ee=Math.min(R,E.loaded*8/Z));const De=q?E.loaded*1e3/Ee:0,Ie=z/1e3,Oe=De?(me-E.loaded)/De:me*8/Z+Ie;if(Oe<=K)return;const F=De?De*8:Z,ne=((s=(i==null?void 0:i.details)||this.hls.latestLevelDetails)==null?void 0:s.live)===!0,le=this.hls.config.abrBandWidthUpFactor;let xe=Number.POSITIVE_INFINITY,_e;for(_e=D-1;_e>_;_e--){const Ce=te[_e].maxBitrate,Fe=!te[_e].details||ne;if(xe=this.getTimeToLoadFrag(Ie,F,b*Ce,Fe),xe<Math.min(K,b+Ie))break}if(xe>=Oe||xe>b*10)return;q?this.bwEstimator.sample(R-Math.min(z,ae),E.loaded):this.bwEstimator.sampleTTFB(R);const Q=te[_e].maxBitrate;this.getBwEstimate()*le>Q&&this.resetEstimator(Q);const de=this.findBestLevel(Q,_,_e,0,K,1,1);de>-1&&(_e=de),this.warn(`Fragment ${o.sn}${u?" part "+u.index:""} of level ${D} is loading too slowly;
278
+ Fragment duration: ${o.duration.toFixed(3)}
279
+ Time to underbuffer: ${K.toFixed(3)} s
280
+ Estimated load time for current fragment: ${Oe.toFixed(3)} s
281
+ Estimated load time for down switch fragment: ${xe.toFixed(3)} s
282
+ TTFB estimate: ${ae|0} ms
283
+ Current BW estimate: ${Ue(Z)?Z|0:"Unknown"} bps
284
+ New BW estimate: ${this.getBwEstimate()|0} bps
285
+ Switching to level ${_e} @ ${Q|0} bps`),d.nextLoadLevel=d.nextAutoLevel=_e,this.clearTimer();const Le=()=>{if(this.clearTimer(),this.fragCurrent===o&&this.hls.loadLevel===_e&&_e>0){const Ce=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${_e>0?"and switching down":""}
286
+ Fragment duration: ${o.duration.toFixed(3)} s
287
+ Time to underbuffer: ${Ce.toFixed(3)} s`),o.abortRequests(),this.fragCurrent=this.partCurrent=null,_e>_){let Fe=this.findBestLevel(this.hls.levels[_].bitrate,_,_e,0,Ce,1,1);Fe===-1&&(Fe=_),this.hls.nextLoadLevel=this.hls.nextAutoLevel=Fe,this.resetEstimator(this.hls.levels[Fe].bitrate)}}};M||Oe>xe*2?Le():this.timer=self.setInterval(Le,xe*1e3),d.trigger(O.FRAG_LOAD_EMERGENCY_ABORTED,{frag:o,part:u,stats:E})},this.hls=e,this.bwEstimator=this.initEstimator(),this.registerListeners()}resetEstimator(e){e&&(this.log(`setting initial bwe to ${e}`),this.hls.config.abrEwmaDefaultEstimate=e),this.firstSelection=-1,this.bwEstimator=this.initEstimator()}initEstimator(){const e=this.hls.config;return new $_(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.FRAG_LOADING,this.onFragLoading,this),e.on(O.FRAG_LOADED,this.onFragLoaded,this),e.on(O.FRAG_BUFFERED,this.onFragBuffered,this),e.on(O.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(O.LEVEL_LOADED,this.onLevelLoaded,this),e.on(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(O.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(O.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.FRAG_LOADING,this.onFragLoading,this),e.off(O.FRAG_LOADED,this.onFragLoaded,this),e.off(O.FRAG_BUFFERED,this.onFragBuffered,this),e.off(O.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(O.LEVEL_LOADED,this.onLevelLoaded,this),e.off(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(O.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(O.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,i){this.lastLoadedFragLevel=-1,this.firstSelection=-1,this.lastLevelLoadSec=0,this.supportedCache={},this.fragCurrent=this.partCurrent=null,this.onLevelsUpdated(),this.clearTimer()}onLevelsUpdated(){this.lastLoadedFragLevel>-1&&this.fragCurrent&&(this.lastLoadedFragLevel=this.fragCurrent.level),this._nextAutoLevel=-1,this.onMaxAutoLevelUpdated(),this.codecTiers=null,this.audioTracksByGroup=null}onMaxAutoLevelUpdated(){this.firstSelection=-1,this.nextAutoLevelKey=""}onFragLoading(e,i){const s=i.frag;if(!this.ignoreFragment(s)){if(!s.bitrateTest){var o;this.fragCurrent=s,this.partCurrent=(o=i.part)!=null?o:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,i){this.clearTimer()}onError(e,i){if(!i.fatal)switch(i.details){case re.BUFFER_ADD_CODEC_ERROR:case re.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case re.FRAG_LOAD_TIMEOUT:{const s=i.frag,{fragCurrent:o,partCurrent:u}=this;if(s&&o&&s.sn===o.sn&&s.level===o.level){const d=performance.now(),g=u?u.stats:s.stats,S=d-g.loading.start,v=g.loading.first?g.loading.first-g.loading.start:-1;if(g.loaded&&v>-1){const b=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(S-Math.min(b,v),g.loaded)}else this.bwEstimator.sampleTTFB(S)}break}}}getTimeToLoadFrag(e,i,s,o){const u=e+s/i,d=o?e+this.lastLevelLoadSec:0;return u+d}onLevelLoaded(e,i){const s=this.hls.config,{loading:o}=i.stats,u=o.end-o.first;Ue(u)&&(this.lastLevelLoadSec=u/1e3),i.details.live?this.bwEstimator.update(s.abrEwmaSlowLive,s.abrEwmaFastLive):this.bwEstimator.update(s.abrEwmaSlowVoD,s.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(i.levelInfo)}onFragLoaded(e,{frag:i,part:s}){const o=s?s.stats:i.stats;if(i.type===Be.MAIN&&this.bwEstimator.sampleTTFB(o.loading.first-o.loading.start),!this.ignoreFragment(i)){if(this.clearTimer(),i.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const u=s?s.duration:i.duration,d=this.hls.levels[i.level],g=(d.loaded?d.loaded.bytes:0)+o.loaded,S=(d.loaded?d.loaded.duration:0)+u;d.loaded={bytes:g,duration:S},d.realBitrate=Math.round(8*g/S)}if(i.bitrateTest){const u={stats:o,frag:i,part:s,id:i.type};this.onFragBuffered(O.FRAG_BUFFERED,u),i.bitrateTest=!1}else this.lastLoadedFragLevel=i.level}}onFragBuffered(e,i){const{frag:s,part:o}=i,u=o!=null&&o.stats.loaded?o.stats:s.stats;if(u.aborted||this.ignoreFragment(s))return;const d=u.parsing.end-u.loading.start-Math.min(u.loading.first-u.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(d,u.loaded),u.bwEstimate=this.getBwEstimate(),s.bitrateTest?this.bitrateTestDelay=d/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==Be.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:i}=this.hls,s=this.getBwEstimate(),o=this.hls.config.maxStarvationDelay,u=this.findBestLevel(s,i,e,0,o,1,1);if(u>-1)return u;const d=this.hls.firstLevel,g=Math.min(Math.max(d,i),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${d} clamped to ${g}`),g}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,s=this.bwEstimator.canEstimate(),o=this.lastLoadedFragLevel>-1;if(e!==-1&&(!s||!o||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const u=s&&o?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const d=this.hls.levels;if(d.length>Math.max(e,u)&&d[e].loadError<=d[u].loadError)return e}return this._nextAutoLevel=u,this.nextAutoLevelKey=this.getAutoLevelKey(),u}getAutoLevelKey(){return`${this.getBwEstimate()}_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:i,hls:s}=this;if(s.levels.length<=1)return s.loadLevel;const{maxAutoLevel:o,config:u,minAutoLevel:d}=s,g=i?i.duration:e?e.duration:0,S=this.getBwEstimate(),v=this.getStarvationDelay();let E=u.abrBandWidthFactor,b=u.abrBandWidthUpFactor;if(v){const M=this.findBestLevel(S,d,o,v,0,E,b);if(M>=0)return this.rebufferNotice=-1,M}let R=g?Math.min(g,u.maxStarvationDelay):u.maxStarvationDelay;if(!v){const M=this.bitrateTestDelay;M&&(R=(g?Math.min(g,u.maxLoadingDelay):u.maxLoadingDelay)-M,this.info(`bitrate test took ${Math.round(1e3*M)}ms, set first fragment max fetchDuration to ${Math.round(1e3*R)} ms`),E=b=1)}const _=this.findBestLevel(S,d,o,v,R,E,b);if(this.rebufferNotice!==_&&(this.rebufferNotice=_,this.info(`${v?"rebuffering expected":"buffer is empty"}, optimal quality level ${_}`)),_>-1)return _;const D=s.levels[d],I=s.loadLevelObj;return I&&(D==null?void 0:D.bitrate)<I.bitrate?d:s.loadLevel}getStarvationDelay(){const e=this.hls,i=e.media;if(!i)return 1/0;const s=i&&i.playbackRate!==0?Math.abs(i.playbackRate):1,o=e.mainForwardBufferInfo;return(o?o.len:0)/s}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,i,s,o,u,d,g){var S;const v=o+u,E=this.lastLoadedFragLevel,b=E===-1?this.hls.firstLevel:E,{fragCurrent:R,partCurrent:_}=this,{levels:D,allAudioTracks:I,loadLevel:M,config:w}=this.hls;if(D.length===1)return 0;const B=D[b],z=!!((S=this.hls.latestLevelDetails)!=null&&S.live),G=M===-1||E===-1;let K,ae="SDR",q=(B==null?void 0:B.frameRate)||0;const{audioPreference:Z,videoPreference:te}=w,$=this.audioTracksByGroup||(this.audioTracksByGroup=Hx(I));let me=-1;if(G){if(this.firstSelection!==-1)return this.firstSelection;const F=this.codecTiers||(this.codecTiers=wC(D,$,i,s)),ne=IC(F,ae,e,Z,te),{codecSet:le,videoRanges:xe,minFramerate:_e,minBitrate:Q,minIndex:de,preferHDR:Le}=ne;me=de,K=le,ae=Le?xe[xe.length-1]:xe[0],q=_e,e=Math.max(e,Q),this.log(`picked start tier ${rn(ne)}`)}else K=B==null?void 0:B.codecSet,ae=B==null?void 0:B.videoRange;const Ee=_?_.duration:R?R.duration:0,De=this.bwEstimator.getEstimateTTFB()/1e3,Ie=[];for(let F=s;F>=i;F--){var Oe;const ne=D[F],le=F>b;if(!ne)continue;if(w.useMediaCapabilities&&!ne.supportedResult&&!ne.supportedPromise){const Fe=navigator.mediaCapabilities;typeof(Fe==null?void 0:Fe.decodingInfo)=="function"&&bC(ne,$,ae,q,e,Z)?(ne.supportedPromise=zx(ne,$,Fe,this.supportedCache),ne.supportedPromise.then(Ve=>{if(!this.hls)return;ne.supportedResult=Ve;const at=this.hls.levels,At=at.indexOf(ne);Ve.error?this.warn(`MediaCapabilities decodingInfo error: "${Ve.error}" for level ${At} ${rn(Ve)}`):Ve.supported?Ve.decodingInfoResults.some(kt=>kt.smooth===!1||kt.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${At} not smooth or powerEfficient: ${rn(Ve)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${At} ${rn(Ve)}`),At>-1&&at.length>1&&(this.log(`Removing unsupported level ${At}`),this.hls.removeLevel(At),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(Ve=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${Ve}`)})):ne.supportedResult=kx}if((K&&ne.codecSet!==K||ae&&ne.videoRange!==ae||le&&q>ne.frameRate||!le&&q>0&&q<ne.frameRate||(Oe=ne.supportedResult)!=null&&(Oe=Oe.decodingInfoResults)!=null&&Oe.some(Fe=>Fe.smooth===!1))&&(!G||F!==me)){Ie.push(F);continue}const xe=ne.details,_e=(_?xe==null?void 0:xe.partTarget:xe==null?void 0:xe.averagetargetduration)||Ee;let Q;le?Q=g*e:Q=d*e;const de=Ee&&o>=Ee*2&&u===0?ne.averageBitrate:ne.maxBitrate,Le=this.getTimeToLoadFrag(De,Q,de*_e,xe===void 0);if(Q>=de&&(F===E||ne.loadError===0&&ne.fragmentError===0)&&(Le<=De||!Ue(Le)||z&&!this.bitrateTestDelay||Le<v)){const Fe=this.forcedAutoLevel;return F!==M&&(Fe===-1||Fe!==M)&&(Ie.length&&this.trace(`Skipped level(s) ${Ie.join(",")} of ${s} max with CODECS and VIDEO-RANGE:"${D[Ie[0]].codecs}" ${D[Ie[0]].videoRange}; not compatible with "${K}" ${ae}`),this.info(`switch candidate:${b}->${F} adjustedbw(${Math.round(Q)})-bitrate=${Math.round(Q-de)} ttfb:${De.toFixed(1)} avgDuration:${_e.toFixed(1)} maxFetchDuration:${v.toFixed(1)} fetchDuration:${Le.toFixed(1)} firstSelection:${G} codecSet:${ne.codecSet} videoRange:${ne.videoRange} hls.loadLevel:${M}`)),G&&(this.firstSelection=F),F}}return-1}set nextAutoLevel(e){const i=this.deriveNextAutoLevel(e);this._nextAutoLevel!==i&&(this.nextAutoLevelKey="",this._nextAutoLevel=i)}deriveNextAutoLevel(e){const{maxAutoLevel:i,minAutoLevel:s}=this.hls;return Math.min(Math.max(e,s),i)}}const Yx={search:function(h,e){let i=0,s=h.length-1,o=null,u=null;for(;i<=s;){o=(i+s)/2|0,u=h[o];const d=e(u);if(d>0)i=o+1;else if(d<0)s=o-1;else return u}return null}};function zC(h,e,i){if(e===null||!Array.isArray(h)||!h.length||!Ue(e))return null;const s=h[0].programDateTime;if(e<(s||0))return null;const o=h[h.length-1].endProgramDateTime;if(e>=(o||0))return null;for(let u=0;u<h.length;++u){const d=h[u];if(PC(e,i,d))return d}return null}function xf(h,e,i=0,s=0,o=.005){let u=null;if(h){u=e[1+h.sn-e[0].sn]||null;const g=h.endDTS-i;g>0&&g<15e-7&&(i+=15e-7),u&&h.level!==u.level&&u.end<=h.end&&(u=e[2+h.sn-e[0].sn]||null)}else i===0&&e[0].start===0&&(u=e[0]);if(u&&((!h||h.level===u.level)&&qx(i,s,u)===0||FC(u,h,Math.min(o,s))))return u;const d=Yx.search(e,qx.bind(null,i,s));return d&&(d!==h||!u)?d:u}function FC(h,e,i){if(e&&e.start===0&&e.level<h.level&&(e.endPTS||0)>0){const s=e.tagList.reduce((o,u)=>(u[0]==="INF"&&(o+=parseFloat(u[1])),o),i);return h.start<=s}return!1}function qx(h=0,e=0,i){if(i.start<=h&&i.start+i.duration>h)return 0;const s=Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0));return i.start+i.duration-s<=h?1:i.start-s>h&&i.start?-1:0}function PC(h,e,i){const s=Math.min(e,i.duration+(i.deltaPTS?i.deltaPTS:0))*1e3;return(i.endProgramDateTime||0)-s>h}function Kx(h,e,i){if(h&&h.startCC<=e&&h.endCC>=e){let s=h.fragments;const{fragmentHint:o}=h;o&&(s=s.concat(o));let u;return Yx.search(s,d=>d.cc<e?1:d.cc>e?-1:(u=d,d.end<=i?1:d.start>i?-1:0)),u||null}return null}function mv(h){switch(h.details){case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_TIMEOUT:case re.LEVEL_LOAD_TIMEOUT:case re.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function Xx(h){return h.details.startsWith("key")}function Qx(h){return Xx(h)&&!!h.frag&&!h.frag.decryptdata}function Zx(h,e){const i=mv(e);return h.default[`${i?"timeout":"error"}Retry`]}function CT(h,e){const i=h.backoff==="linear"?1:Math.pow(2,e);return Math.min(i*h.retryDelayMs,h.maxRetryDelayMs)}function Jx(h){return Qt(Qt({},h),{errorRetry:null,timeoutRetry:null})}function gv(h,e,i,s){if(!h)return!1;const o=s==null?void 0:s.code,u=e<h.maxNumRetry&&(GC(o)||!!i);return h.shouldRetry?h.shouldRetry(h,e,i,s,u):u}function GC(h){return OT(h)||!!h&&(h<400||h>499)}function OT(h){return h===0&&navigator.onLine===!1}var Fi={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},hs={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4};class $C extends Xs{constructor(e){super("error-controller",e.logger),this.hls=void 0,this.playlistError=0,this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(O.ERROR,this.onError,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(O.ERROR,this.onError,this),e.off(O.ERROR,this.onErrorOut,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.LEVEL_UPDATED,this.onLevelUpdated,this))}destroy(){this.unregisterListeners(),this.hls=null}startLoad(e){}stopLoad(){this.playlistError=0}getVariantLevelIndex(e){return(e==null?void 0:e.type)===Be.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const i=this.hls,s=i.currentLevel;return(e=i.loadLevelObj)!=null&&e.details||s===-1?i.loadLevel:s}variantHasKey(e,i){if(e){var s;if((s=e.details)!=null&&s.hasKey(i))return!0;const o=e.audioGroups;if(o)return this.hls.allAudioTracks.filter(d=>o.indexOf(d.groupId)>=0).some(d=>{var g;return(g=d.details)==null?void 0:g.hasKey(i)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,i){var s;if(i.fatal)return;const o=this.hls,u=i.context;switch(i.details){case re.FRAG_LOAD_ERROR:case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_ERROR:case re.KEY_LOAD_TIMEOUT:i.errorAction=this.getFragRetryOrSwitchAction(i);return;case re.FRAG_PARSING_ERROR:if((s=i.frag)!=null&&s.gap){i.errorAction=ph();return}case re.FRAG_GAP:case re.FRAG_DECRYPT_ERROR:{i.errorAction=this.getFragRetryOrSwitchAction(i),i.errorAction.action=Fi.SendAlternateToPenaltyBox;return}case re.LEVEL_EMPTY_ERROR:case re.LEVEL_PARSING_ERROR:{var d;const S=i.parent===Be.MAIN?i.level:o.loadLevel;i.details===re.LEVEL_EMPTY_ERROR&&((d=i.context)!=null&&(d=d.levelDetails)!=null&&d.live)?i.errorAction=this.getPlaylistRetryOrSwitchAction(i,S):(i.levelRetry=!1,i.errorAction=this.getLevelSwitchAction(i,S))}return;case re.LEVEL_LOAD_ERROR:case re.LEVEL_LOAD_TIMEOUT:typeof(u==null?void 0:u.level)=="number"&&(i.errorAction=this.getPlaylistRetryOrSwitchAction(i,u.level));return;case re.AUDIO_TRACK_LOAD_ERROR:case re.AUDIO_TRACK_LOAD_TIMEOUT:case re.SUBTITLE_LOAD_ERROR:case re.SUBTITLE_TRACK_LOAD_TIMEOUT:if(u){const S=o.loadLevelObj;if(S&&(u.type===xt.AUDIO_TRACK&&S.hasAudioGroup(u.groupId)||u.type===xt.SUBTITLE_TRACK&&S.hasSubtitleGroup(u.groupId))){i.errorAction=this.getPlaylistRetryOrSwitchAction(i,o.loadLevel),i.errorAction.action=Fi.SendAlternateToPenaltyBox,i.errorAction.flags=hs.MoveAllAlternatesMatchingHost;return}}return;case re.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:i.errorAction={action:Fi.SendAlternateToPenaltyBox,flags:hs.MoveAllAlternatesMatchingHDCP};return;case re.KEY_SYSTEM_SESSION_UPDATE_FAILED:case re.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case re.KEY_SYSTEM_NO_SESSION:i.errorAction={action:Fi.SendAlternateToPenaltyBox,flags:hs.MoveAllAlternatesMatchingKey};return;case re.BUFFER_ADD_CODEC_ERROR:case re.REMUX_ALLOC_ERROR:case re.BUFFER_APPEND_ERROR:if(!i.errorAction){var g;i.errorAction=this.getLevelSwitchAction(i,(g=i.level)!=null?g:o.loadLevel)}return;case re.INTERNAL_EXCEPTION:case re.BUFFER_APPENDING_ERROR:case re.BUFFER_FULL_ERROR:case re.LEVEL_SWITCH_ERROR:case re.BUFFER_STALLED_ERROR:case re.BUFFER_SEEK_OVER_HOLE:case re.BUFFER_NUDGE_ON_STALL:i.errorAction=ph();return}i.type===je.KEY_SYSTEM_ERROR&&(i.levelRetry=!1,i.errorAction=ph())}getPlaylistRetryOrSwitchAction(e,i){const s=this.hls,o=Zx(s.config.playlistLoadPolicy,e),u=this.playlistError++;if(gv(o,u,mv(e),e.response))return{action:Fi.RetryRequest,flags:hs.None,retryConfig:o,retryCount:u};const g=this.getLevelSwitchAction(e,i);return o&&(g.retryConfig=o,g.retryCount=u),g}getFragRetryOrSwitchAction(e){const i=this.hls,s=this.getVariantLevelIndex(e.frag),o=i.levels[s],{fragLoadPolicy:u,keyLoadPolicy:d}=i.config,g=Zx(Xx(e)?d:u,e),S=i.levels.reduce((E,b)=>E+b.fragmentError,0);if(o&&(e.details!==re.FRAG_GAP&&o.fragmentError++,!Qx(e)&&gv(g,S,mv(e),e.response)))return{action:Fi.RetryRequest,flags:hs.None,retryConfig:g,retryCount:S};const v=this.getLevelSwitchAction(e,s);return g&&(v.retryConfig=g,v.retryCount=S),v}getLevelSwitchAction(e,i){const s=this.hls;i==null&&(i=s.loadLevel);const o=this.hls.levels[i];if(o){var u,d;const v=e.details;o.loadError++,v===re.BUFFER_APPEND_ERROR&&o.fragmentError++;let E=-1;const{levels:b,loadLevel:R,minAutoLevel:_,maxAutoLevel:D}=s;!s.autoLevelEnabled&&!s.config.preserveManualLevelOnError&&(s.loadLevel=-1);const I=(u=e.frag)==null?void 0:u.type,w=(I===Be.AUDIO&&v===re.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(v===re.BUFFER_ADD_CODEC_ERROR||v===re.BUFFER_APPEND_ERROR))&&b.some(({audioCodec:ae})=>o.audioCodec!==ae),z=e.sourceBufferName==="video"&&(v===re.BUFFER_ADD_CODEC_ERROR||v===re.BUFFER_APPEND_ERROR)&&b.some(({codecSet:ae,audioCodec:q})=>o.codecSet!==ae&&o.audioCodec===q),{type:G,groupId:K}=(d=e.context)!=null?d:{};for(let ae=b.length;ae--;){const q=(ae+R)%b.length;if(q!==R&&q>=_&&q<=D&&b[q].loadError===0){var g,S;const Z=b[q];if(v===re.FRAG_GAP&&I===Be.MAIN&&e.frag){const te=b[q].details;if(te){const $=xf(e.frag,te.fragments,e.frag.start);if($!=null&&$.gap)continue}}else{if(G===xt.AUDIO_TRACK&&Z.hasAudioGroup(K)||G===xt.SUBTITLE_TRACK&&Z.hasSubtitleGroup(K))continue;if(I===Be.AUDIO&&(g=o.audioGroups)!=null&&g.some(te=>Z.hasAudioGroup(te))||I===Be.SUBTITLE&&(S=o.subtitleGroups)!=null&&S.some(te=>Z.hasSubtitleGroup(te))||w&&o.audioCodec===Z.audioCodec||z&&o.codecSet===Z.codecSet||!w&&o.codecSet!==Z.codecSet)continue}E=q;break}}if(E>-1&&s.loadLevel!==E)return e.levelRetry=!0,this.playlistError=0,{action:Fi.SendAlternateToPenaltyBox,flags:hs.None,nextAutoLevel:E}}return{action:Fi.SendAlternateToPenaltyBox,flags:hs.MoveAllAlternatesMatchingHost}}onErrorOut(e,i){var s;switch((s=i.errorAction)==null?void 0:s.action){case Fi.DoNothing:break;case Fi.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(i),!i.errorAction.resolved&&i.details!==re.FRAG_GAP?i.fatal=!0:/MediaSource readyState: ended/.test(i.error.message)&&(this.warn(`MediaSource ended after "${i.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(i.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const i=this.hls,s=e.errorAction;if(!s)return;const{flags:o}=s,u=s.nextAutoLevel;switch(o){case hs.None:this.switchLevel(e,u);break;case hs.MoveAllAlternatesMatchingHDCP:{const S=this.getVariantLevelIndex(e.frag),v=i.levels[S],E=v==null?void 0:v.attrs["HDCP-LEVEL"];if(s.hdcpLevel=E,E==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(E){i.maxHdcpLevel=_T[_T.indexOf(E)-1],s.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${i.maxHdcpLevel}" or lower`);break}}case hs.MoveAllAlternatesMatchingKey:{const S=e.decryptdata;if(S){const v=this.hls.levels,E=v.length;for(let R=E;R--;)if(this.variantHasKey(v[R],S)){var d,g;this.log(`Banned key found in level ${R} (${v[R].bitrate}bps) or audio group "${(d=v[R].audioGroups)==null?void 0:d.join(",")}" (${(g=e.frag)==null?void 0:g.type} fragment) ${zi(S.keyId||[])}`),v[R].fragmentError++,v[R].loadError++,this.log(`Removing level ${R} with key error (${e.error})`),this.hls.removeLevel(R)}const b=e.frag;if(this.hls.levels.length<E)s.resolved=!0;else if(b&&b.type!==Be.MAIN){const R=b.decryptdata;R&&!S.matches(R)&&(s.resolved=!0)}}break}}s.resolved||this.switchLevel(e,u)}switchLevel(e,i){if(i!==void 0&&e.errorAction&&(this.warn(`switching to level ${i} after ${e.details}`),this.hls.nextAutoLevel=i,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===re.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const s=LT(e.mimeType),o=this.hls.levels;for(let u=o.length;u--;)o[u][`${e.sourceBufferName}Codec`]===s&&(this.log(`Removing level ${u} for ${e.details} ("${s}" not supported)`),this.hls.removeLevel(u))}}}function ph(h){const e={action:Fi.DoNothing,flags:hs.None};return h&&(e.resolved=!0),e}var yi={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class HC{constructor(e){this.activePartLists=Object.create(null),this.endListFragments=Object.create(null),this.fragments=Object.create(null),this.timeRanges=Object.create(null),this.bufferPadding=.2,this.hls=void 0,this.hasGaps=!1,this.hls=e,this._registerListeners()}_registerListeners(){const{hls:e}=this;e&&(e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.BUFFER_APPENDED,this.onBufferAppended,this),e.on(O.FRAG_BUFFERED,this.onFragBuffered,this),e.on(O.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.BUFFER_APPENDED,this.onBufferAppended,this),e.off(O.FRAG_BUFFERED,this.onFragBuffered,this),e.off(O.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,i){const s=this.activePartLists[i];if(s)for(let o=s.length;o--;){const u=s[o];if(!u)break;if(u.start<=e&&e<=u.end&&u.loaded)return u}return this.getBufferedFrag(e,i)}getBufferedFrag(e,i){return this.getFragAtPos(e,i,!0)}getFragAtPos(e,i,s){const{fragments:o}=this,u=Object.keys(o);for(let d=u.length;d--;){const g=o[u[d]];if((g==null?void 0:g.body.type)===i&&(!s||g.buffered)){const S=g.body;if(S.start<=e&&e<=S.end)return S}}return null}detectEvictedFragments(e,i,s,o,u){this.timeRanges&&(this.timeRanges[e]=i);const d=(o==null?void 0:o.fragment.sn)||-1;Object.keys(this.fragments).forEach(g=>{const S=this.fragments[g];if(!S||d>=S.body.sn)return;if(!S.buffered&&(!S.loaded||u)){S.body.type===s&&this.removeFragment(S.body);return}const v=S.range[e];if(v){if(v.time.length===0){this.removeFragment(S.body);return}v.time.some(E=>{const b=!this.isTimeBuffered(E.startPTS,E.endPTS,i);return b&&this.removeFragment(S.body),b})}})}detectPartialFragments(e){const i=this.timeRanges;if(!i||e.frag.sn==="initSegment")return;const s=e.frag,o=yh(s),u=this.fragments[o];if(!u||u.buffered&&s.gap)return;const d=!s.relurl;Object.keys(i).forEach(g=>{const S=s.elementaryStreams[g];if(!S)return;const v=i[g],E=d||S.partial===!0;u.range[g]=this.getBufferedTimes(s,e.part,E,v)}),u.loaded=null,Object.keys(u.range).length?(this.bufferedEnd(u,s),pv(u)||this.removeParts(s.sn-1,s.type)):this.removeFragment(u.body)}bufferedEnd(e,i){e.buffered=!0,(e.body.endList=i.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,i){const s=this.activePartLists[i];s&&(this.activePartLists[i]=Wx(s,o=>o.fragment.sn>=e))}fragBuffered(e,i){const s=yh(e);let o=this.fragments[s];!o&&i&&(o=this.fragments[s]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),o&&(o.loaded=null,this.bufferedEnd(o,e))}getBufferedTimes(e,i,s,o){const u={time:[],partial:s},d=e.start,g=e.end,S=e.minEndPTS||g,v=e.maxStartPTS||d;for(let E=0;E<o.length;E++){const b=o.start(E)-this.bufferPadding,R=o.end(E)+this.bufferPadding;if(v>=b&&S<=R){u.time.push({startPTS:Math.max(d,o.start(E)),endPTS:Math.min(g,o.end(E))});break}else if(d<R&&g>b){const _=Math.max(d,o.start(E)),D=Math.min(g,o.end(E));D>_&&(u.partial=!0,u.time.push({startPTS:_,endPTS:D}))}else if(g<=b)break}return u}getPartialFragment(e){let i=null,s,o,u,d=0;const{bufferPadding:g,fragments:S}=this;return Object.keys(S).forEach(v=>{const E=S[v];E&&pv(E)&&(o=E.body.start-g,u=E.body.end+g,e>=o&&e<=u&&(s=Math.min(e-o,u-e),d<=s&&(i=E.body,d=s)))}),i}isEndListAppended(e){const i=this.endListFragments[e];return i!==void 0&&(i.buffered||pv(i))}getState(e){const i=yh(e),s=this.fragments[i];return s?s.buffered?pv(s)?yi.PARTIAL:yi.OK:yi.APPENDING:yi.NOT_LOADED}isTimeBuffered(e,i,s){let o,u;for(let d=0;d<s.length;d++){if(o=s.start(d)-this.bufferPadding,u=s.end(d)+this.bufferPadding,e>=o&&i<=u)return!0;if(i<=o)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,i){if(i.frag.sn==="initSegment"||i.frag.bitrateTest)return;const s=i.frag,o=i.part?null:i,u=yh(s);this.fragments[u]={body:s,appendedPTS:null,loaded:o,buffered:!1,range:Object.create(null)}}onBufferAppended(e,i){const{frag:s,part:o,timeRanges:u,type:d}=i;if(s.sn==="initSegment")return;const g=s.type;if(o){let v=this.activePartLists[g];v||(this.activePartLists[g]=v=[]),v.push(o)}this.timeRanges=u;const S=u[d];this.detectEvictedFragments(d,S,g,o)}onFragBuffered(e,i){this.detectPartialFragments(i)}hasFragment(e){const i=yh(e);return!!this.fragments[i]}hasFragments(e){const{fragments:i}=this,s=Object.keys(i);if(!e)return s.length>0;for(let o=s.length;o--;){const u=i[s[o]];if((u==null?void 0:u.body.type)===e)return!0}return!1}hasParts(e){var i;return!!((i=this.activePartLists[e])!=null&&i.length)}removeFragmentsInRange(e,i,s,o,u){o&&!this.hasGaps||Object.keys(this.fragments).forEach(d=>{const g=this.fragments[d];if(!g)return;const S=g.body;S.type!==s||o&&!S.gap||S.start<i&&S.end>e&&(g.buffered||u)&&this.removeFragment(S)})}removeFragment(e){const i=yh(e);e.clearElementaryStreamInfo();const s=this.activePartLists[e.type];if(s){const o=e.sn;this.activePartLists[e.type]=Wx(s,u=>u.fragment.sn!==o)}delete this.fragments[i],e.endList&&delete this.endListFragments[e.type]}removeAllFragments(){var e;this.fragments=Object.create(null),this.endListFragments=Object.create(null),this.activePartLists=Object.create(null),this.hasGaps=!1;const i=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;i&&i.forEach(s=>s.clearElementaryStreamInfo())}}function pv(h){var e,i,s;return h.buffered&&!!(h.body.gap||(e=h.range.video)!=null&&e.partial||(i=h.range.audio)!=null&&i.partial||(s=h.range.audiovideo)!=null&&s.partial)}function yh(h){return`${h.type}_${h.level}_${h.sn}`}function Wx(h,e){return h.filter(i=>{const s=e(i);return s||i.clearElementaryStreamInfo(),s})}var Uu={cbc:0,ctr:1};class jC{constructor(e,i,s){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=i,this.aesMode=s}decrypt(e,i){switch(this.aesMode){case Uu.cbc:return this.subtle.decrypt({name:"AES-CBC",iv:this.aesIV},i,e);case Uu.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},i,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function VC(h){const e=h.byteLength,i=e&&new DataView(h.buffer).getUint8(e-1);return i?h.slice(0,e-i):h}class YC{constructor(){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()}uint8ArrayToUint32Array_(e){const i=new DataView(e),s=new Uint32Array(4);for(let o=0;o<4;o++)s[o]=i.getUint32(o*4);return s}initTable(){const e=this.sBox,i=this.invSBox,s=this.subMix,o=s[0],u=s[1],d=s[2],g=s[3],S=this.invSubMix,v=S[0],E=S[1],b=S[2],R=S[3],_=new Uint32Array(256);let D=0,I=0,M=0;for(M=0;M<256;M++)M<128?_[M]=M<<1:_[M]=M<<1^283;for(M=0;M<256;M++){let w=I^I<<1^I<<2^I<<3^I<<4;w=w>>>8^w&255^99,e[D]=w,i[w]=D;const B=_[D],z=_[B],G=_[z];let K=_[w]*257^w*16843008;o[D]=K<<24|K>>>8,u[D]=K<<16|K>>>16,d[D]=K<<8|K>>>24,g[D]=K,K=G*16843009^z*65537^B*257^D*16843008,v[w]=K<<24|K>>>8,E[w]=K<<16|K>>>16,b[w]=K<<8|K>>>24,R[w]=K,D?(D=B^_[_[_[G^B]]],I^=_[_[I]]):D=I=1}}expandKey(e){const i=this.uint8ArrayToUint32Array_(e);let s=!0,o=0;for(;o<i.length&&s;)s=i[o]===this.key[o],o++;if(s)return;this.key=i;const u=this.keySize=i.length;if(u!==4&&u!==6&&u!==8)throw new Error("Invalid aes key size="+u);const d=this.ksRows=(u+6+1)*4;let g,S;const v=this.keySchedule=new Uint32Array(d),E=this.invKeySchedule=new Uint32Array(d),b=this.sBox,R=this.rcon,_=this.invSubMix,D=_[0],I=_[1],M=_[2],w=_[3];let B,z;for(g=0;g<d;g++){if(g<u){B=v[g]=i[g];continue}z=B,g%u===0?(z=z<<8|z>>>24,z=b[z>>>24]<<24|b[z>>>16&255]<<16|b[z>>>8&255]<<8|b[z&255],z^=R[g/u|0]<<24):u>6&&g%u===4&&(z=b[z>>>24]<<24|b[z>>>16&255]<<16|b[z>>>8&255]<<8|b[z&255]),v[g]=B=(v[g-u]^z)>>>0}for(S=0;S<d;S++)g=d-S,S&3?z=v[g]:z=v[g-4],S<4||g<=4?E[S]=z:E[S]=D[b[z>>>24]]^I[b[z>>>16&255]]^M[b[z>>>8&255]]^w[b[z&255]],E[S]=E[S]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,i,s){const o=this.keySize+6,u=this.invKeySchedule,d=this.invSBox,g=this.invSubMix,S=g[0],v=g[1],E=g[2],b=g[3],R=this.uint8ArrayToUint32Array_(s);let _=R[0],D=R[1],I=R[2],M=R[3];const w=new Int32Array(e),B=new Int32Array(w.length);let z,G,K,ae,q,Z,te,$,me,Ee,De,Ie,Oe,F;const ne=this.networkToHostOrderSwap;for(;i<w.length;){for(me=ne(w[i]),Ee=ne(w[i+1]),De=ne(w[i+2]),Ie=ne(w[i+3]),q=me^u[0],Z=Ie^u[1],te=De^u[2],$=Ee^u[3],Oe=4,F=1;F<o;F++)z=S[q>>>24]^v[Z>>16&255]^E[te>>8&255]^b[$&255]^u[Oe],G=S[Z>>>24]^v[te>>16&255]^E[$>>8&255]^b[q&255]^u[Oe+1],K=S[te>>>24]^v[$>>16&255]^E[q>>8&255]^b[Z&255]^u[Oe+2],ae=S[$>>>24]^v[q>>16&255]^E[Z>>8&255]^b[te&255]^u[Oe+3],q=z,Z=G,te=K,$=ae,Oe=Oe+4;z=d[q>>>24]<<24^d[Z>>16&255]<<16^d[te>>8&255]<<8^d[$&255]^u[Oe],G=d[Z>>>24]<<24^d[te>>16&255]<<16^d[$>>8&255]<<8^d[q&255]^u[Oe+1],K=d[te>>>24]<<24^d[$>>16&255]<<16^d[q>>8&255]<<8^d[Z&255]^u[Oe+2],ae=d[$>>>24]<<24^d[q>>16&255]<<16^d[Z>>8&255]<<8^d[te&255]^u[Oe+3],B[i]=ne(z^_),B[i+1]=ne(ae^D),B[i+2]=ne(K^I),B[i+3]=ne(G^M),_=me,D=Ee,I=De,M=Ie,i=i+4}return B.buffer}}class qC{constructor(e,i,s){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=i,this.aesMode=s}expandKey(){const e=KC(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function KC(h){switch(h){case Uu.cbc:return"AES-CBC";case Uu.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${h}`)}}const XC=16;class MT{constructor(e,{removePKCS7Padding:i=!0}={}){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.enableSoftwareAES=void 0,this.enableSoftwareAES=e.enableSoftwareAES,this.removePKCS7Padding=i,i)try{const s=self.crypto;s&&(this.subtle=s.subtle||s.webkitSubtle)}catch{}this.useSoftware=!this.subtle}destroy(){this.subtle=null,this.softwareDecrypter=null,this.key=null,this.fastAesKey=null,this.remainderData=null,this.currentIV=null,this.currentResult=null}isSync(){return this.useSoftware}flush(){const{currentResult:e,remainderData:i}=this;if(!e||i)return this.reset(),null;const s=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?VC(s):s}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,i,s,o){return this.useSoftware?new Promise((u,d)=>{const g=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(g,i,s,o);const S=this.flush();S?u(S.buffer):d(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),i,s,o)}softwareDecrypt(e,i,s,o){const{currentIV:u,currentResult:d,remainderData:g}=this;if(o!==Uu.cbc||i.byteLength!==16)return Zt.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),g&&(e=Qs(g,e),this.remainderData=null);const S=this.getValidChunk(e);if(!S.length)return null;u&&(s=u);let v=this.softwareDecrypter;v||(v=this.softwareDecrypter=new YC),v.expandKey(i);const E=d;return this.currentResult=v.decrypt(S.buffer,0,s),this.currentIV=S.slice(-16).buffer,E||null}webCryptoDecrypt(e,i,s,o){if(this.key!==i||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,i,s,o));this.key=i,this.fastAesKey=new qC(this.subtle,i,o)}return this.fastAesKey.expandKey().then(u=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new jC(this.subtle,new Uint8Array(s),o).decrypt(e.buffer,u)):Promise.reject(new Error("web crypto not initialized"))).catch(u=>(Zt.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${u.name}: ${u.message}`),this.onWebCryptoError(e,i,s,o)))}onWebCryptoError(e,i,s,o){const u=this.enableSoftwareAES;if(u){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,i,s,o);const d=this.flush();if(d)return d.buffer}throw new Error("WebCrypto"+(u?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let i=e;const s=e.length-e.length%XC;return s!==e.length&&(i=e.slice(0,s),this.remainderData=e.slice(s)),i}logOnce(e){this.logEnabled&&(Zt.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const eA=Math.pow(2,17);class QC{constructor(e){this.config=void 0,this.loader=null,this.partLoadTimeout=-1,this.config=e}destroy(){this.loader&&(this.loader.destroy(),this.loader=null)}abort(){this.loader&&this.loader.abort()}load(e,i){const s=e.url;if(!s)return Promise.reject(new yo({type:je.NETWORK_ERROR,details:re.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${s?"part list":"url"}`),networkDetails:null}));this.abort();const o=this.config,u=o.fLoader,d=o.loader;return new Promise((g,S)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(D=>D[0]==="GAP")){S(nA(e));return}else e.gap=!1;const v=this.loader=u?new u(o):new d(o),E=tA(e);e.loader=v;const b=Jx(o.fragLoadPolicy.default),R={loadPolicy:b,timeout:b.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:eA};e.stats=v.stats;const _={onSuccess:(D,I,M,w)=>{this.resetLoader(e,v);let B=D.data;M.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(B.slice(0,16)),B=B.slice(16)),g({frag:e,part:null,payload:B,networkDetails:w})},onError:(D,I,M,w)=>{this.resetLoader(e,v),S(new yo({type:je.NETWORK_ERROR,details:re.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:Qt({url:s,data:void 0},D),error:new Error(`HTTP Error ${D.code} ${D.text}`),networkDetails:M,stats:w}))},onAbort:(D,I,M)=>{this.resetLoader(e,v),S(new yo({type:je.NETWORK_ERROR,details:re.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:M,stats:D}))},onTimeout:(D,I,M)=>{this.resetLoader(e,v),S(new yo({type:je.NETWORK_ERROR,details:re.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${R.timeout}ms`),networkDetails:M,stats:D}))}};i&&(_.onProgress=(D,I,M,w)=>i({frag:e,part:null,payload:M,networkDetails:w})),v.load(E,R,_)})}loadPart(e,i,s){this.abort();const o=this.config,u=o.fLoader,d=o.loader;return new Promise((g,S)=>{if(this.loader&&this.loader.destroy(),e.gap||i.gap){S(nA(e,i));return}const v=this.loader=u?new u(o):new d(o),E=tA(e,i);e.loader=v;const b=Jx(o.fragLoadPolicy.default),R={loadPolicy:b,timeout:b.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:eA};i.stats=v.stats,v.load(E,R,{onSuccess:(_,D,I,M)=>{this.resetLoader(e,v),this.updateStatsFromPart(e,i);const w={frag:e,part:i,payload:_.data,networkDetails:M};s(w),g(w)},onError:(_,D,I,M)=>{this.resetLoader(e,v),S(new yo({type:je.NETWORK_ERROR,details:re.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:i,response:Qt({url:E.url,data:void 0},_),error:new Error(`HTTP Error ${_.code} ${_.text}`),networkDetails:I,stats:M}))},onAbort:(_,D,I)=>{e.stats.aborted=i.stats.aborted,this.resetLoader(e,v),S(new yo({type:je.NETWORK_ERROR,details:re.INTERNAL_ABORTED,fatal:!1,frag:e,part:i,error:new Error("Aborted"),networkDetails:I,stats:_}))},onTimeout:(_,D,I)=>{this.resetLoader(e,v),S(new yo({type:je.NETWORK_ERROR,details:re.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:i,error:new Error(`Timeout after ${R.timeout}ms`),networkDetails:I,stats:_}))}})})}updateStatsFromPart(e,i){const s=e.stats,o=i.stats,u=o.total;if(s.loaded+=o.loaded,u){const S=Math.round(e.duration/i.duration),v=Math.min(Math.round(s.loaded/u),S),b=(S-v)*Math.round(s.loaded/v);s.total=s.loaded+b}else s.total=Math.max(s.loaded,s.total);const d=s.loading,g=o.loading;d.start?d.first+=g.first-g.start:(d.start=g.start,d.first=g.first),d.end=g.end}resetLoader(e,i){e.loader=null,this.loader===i&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),i.destroy()}}function tA(h,e=null){const i=e||h,s={frag:h,part:e,responseType:"arraybuffer",url:i.url,headers:{},rangeStart:0,rangeEnd:0},o=i.byteRangeStartOffset,u=i.byteRangeEndOffset;if(Ue(o)&&Ue(u)){var d;let g=o,S=u;if(h.sn==="initSegment"&&ZC((d=h.decryptdata)==null?void 0:d.method)){const v=u-o;v%16&&(S=u+(16-v%16)),o!==0&&(s.resetIV=!0,g=o-16)}s.rangeStart=g,s.rangeEnd=S}return s}function nA(h,e){const i=new Error(`GAP ${h.gap?"tag":"attribute"} found`),s={type:je.MEDIA_ERROR,details:re.FRAG_GAP,fatal:!1,frag:h,error:i,networkDetails:null};return e&&(s.part=e),(e||h).stats.aborted=!0,new yo(s)}function ZC(h){return h==="AES-128"||h==="AES-256"}class yo extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class iA extends Xs{constructor(e,i){super(e,i),this._boundTick=void 0,this._tickTimer=null,this._tickInterval=null,this._tickCallCount=0,this._boundTick=this.tick.bind(this)}destroy(){this.onHandlerDestroying(),this.onHandlerDestroyed()}onHandlerDestroying(){this.clearNextTick(),this.clearInterval()}onHandlerDestroyed(){}hasInterval(){return!!this._tickInterval}hasNextTick(){return!!this._tickTimer}setInterval(e){return this._tickInterval?!1:(this._tickCallCount=0,this._tickInterval=self.setInterval(this._boundTick,e),!0)}clearInterval(){return this._tickInterval?(self.clearInterval(this._tickInterval),this._tickInterval=null,!0):!1}clearNextTick(){return this._tickTimer?(self.clearTimeout(this._tickTimer),this._tickTimer=null,!0):!1}tick(){this._tickCallCount++,this._tickCallCount===1&&(this.doTick(),this._tickCallCount>1&&this.tickImmediate(),this._tickCallCount=0)}tickImmediate(){this.clearNextTick(),this._tickTimer=self.setTimeout(this._boundTick,0)}doTick(){}}class IT{constructor(e,i,s,o=0,u=-1,d=!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=yv(),this.buffering={audio:yv(),video:yv(),audiovideo:yv()},this.level=e,this.sn=i,this.id=s,this.size=o,this.part=u,this.partial=d}}function yv(){return{start:0,executeStart:0,executeEnd:0,end:0}}const aA={length:0,start:()=>0,end:()=>0};class lt{static isBuffered(e,i){if(e){const s=lt.getBuffered(e);for(let o=s.length;o--;)if(i>=s.start(o)&&i<=s.end(o))return!0}return!1}static bufferedRanges(e){if(e){const i=lt.getBuffered(e);return lt.timeRangesToArray(i)}return[]}static timeRangesToArray(e){const i=[];for(let s=0;s<e.length;s++)i.push({start:e.start(s),end:e.end(s)});return i}static bufferInfo(e,i,s){if(e){const o=lt.bufferedRanges(e);if(o.length)return lt.bufferedInfo(o,i,s)}return{len:0,start:i,end:i,bufferedIndex:-1}}static bufferedInfo(e,i,s){i=Math.max(0,i),e.length>1&&e.sort((E,b)=>E.start-b.start||b.end-E.end);let o=-1,u=[];if(s)for(let E=0;E<e.length;E++){i>=e[E].start&&i<=e[E].end&&(o=E);const b=u.length;if(b){const R=u[b-1].end;e[E].start-R<s?e[E].end>R&&(u[b-1].end=e[E].end):u.push(e[E])}else u.push(e[E])}else u=e;let d=0,g,S=i,v=i;for(let E=0;E<u.length;E++){const b=u[E].start,R=u[E].end;if(o===-1&&i>=b&&i<=R&&(o=E),i+s>=b&&i<R)S=b,v=R,d=v-i;else if(i+s<b){g=b;break}}return{len:d,start:S||0,end:v||0,nextStart:g,buffered:e,bufferedIndex:o}}static getBuffered(e){try{return e.buffered||aA}catch(i){return Zt.log("failed to get media.buffered",i),aA}}}const sA=/\{\$([a-zA-Z0-9-_]+)\}/g;function lA(h){return sA.test(h)}function wT(h,e){if(h.variableList!==null||h.hasVariableRefs){const i=h.variableList;return e.replace(sA,s=>{const o=s.substring(2,s.length-1),u=i==null?void 0:i[o];return u===void 0?(h.playlistParsingError||(h.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${o}"`)),s):u})}return e}function rA(h,e,i){let s=h.variableList;s||(h.variableList=s={});let o,u;if("QUERYPARAM"in e){o=e.QUERYPARAM;try{const d=new self.URL(i).searchParams;if(d.has(o))u=d.get(o);else throw new Error(`"${o}" does not match any query parameter in URI: "${i}"`)}catch(d){h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${d.message}`))}}else o=e.NAME,u=e.VALUE;o in s?h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${o}"`)):s[o]=u||""}function JC(h,e,i){const s=e.IMPORT;if(i&&s in i){let o=h.variableList;o||(h.variableList=o={}),o[s]=i[s]}else h.playlistParsingError||(h.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${s}"`))}const WC=/^(\d+)x(\d+)$/,oA=/(.+?)=(".*?"|.*?)(?:,|$)/g;class _n{constructor(e,i){typeof e=="string"&&(e=_n.parseAttrList(e,i)),Jt(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const i=parseInt(this[e],10);return i>Number.MAX_SAFE_INTEGER?1/0:i}hexadecimalInteger(e){if(this[e]){let i=(this[e]||"0x").slice(2);i=(i.length&1?"0":"")+i;const s=new Uint8Array(i.length/2);for(let o=0;o<i.length/2;o++)s[o]=parseInt(i.slice(o*2,o*2+2),16);return s}return null}hexadecimalIntegerAsNumber(e){const i=parseInt(this[e],16);return i>Number.MAX_SAFE_INTEGER?1/0:i}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,i){const s=this[e];return s?parseFloat(s):i}enumeratedString(e){return this[e]}enumeratedStringList(e,i){const s=this[e];return(s?s.split(/[ ,]+/):[]).reduce((o,u)=>(o[u.toLowerCase()]=!0,o),i)}bool(e){return this[e]==="YES"}decimalResolution(e){const i=WC.exec(this[e]);if(i!==null)return{width:parseInt(i[1],10),height:parseInt(i[2],10)}}static parseAttrList(e,i){let s;const o={},u='"';for(oA.lastIndex=0;(s=oA.exec(e))!==null;){const d=s[1].trim();let g=s[2];const S=g.indexOf(u)===0&&g.lastIndexOf(u)===g.length-1;let v=!1;if(S)g=g.slice(1,-1);else switch(d){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":v=!0}if(i&&(S||v))g=wT(i,g);else if(!v&&!S)switch(d){case"CLOSED-CAPTIONS":if(g==="NONE")break;case"ALLOWED-CPC":case"CLASS":case"ASSOC-LANGUAGE":case"AUDIO":case"BYTERANGE":case"CHANNELS":case"CHARACTERISTICS":case"CODECS":case"DATA-ID":case"END-DATE":case"GROUP-ID":case"ID":case"IMPORT":case"INSTREAM-ID":case"KEYFORMAT":case"KEYFORMATVERSIONS":case"LANGUAGE":case"NAME":case"PATHWAY-ID":case"QUERYPARAM":case"RECENTLY-REMOVED-DATERANGES":case"SERVER-URI":case"STABLE-RENDITION-ID":case"STABLE-VARIANT-ID":case"START-DATE":case"SUBTITLES":case"SUPPLEMENTAL-CODECS":case"URI":case"VALUE":case"VIDEO":case"X-ASSET-LIST":case"X-ASSET-URI":Zt.warn(`${e}: attribute ${d} is missing quotes`)}o[d]=g}return o}}const e2="com.apple.hls.interstitial";function t2(h){return h!=="ID"&&h!=="CLASS"&&h!=="CUE"&&h!=="START-DATE"&&h!=="DURATION"&&h!=="END-DATE"&&h!=="END-ON-NEXT"}function n2(h){return h==="SCTE35-OUT"||h==="SCTE35-IN"||h==="SCTE35-CMD"}class uA{constructor(e,i,s=0){var o;if(this.attr=void 0,this.tagAnchor=void 0,this.tagOrder=void 0,this._startDate=void 0,this._endDate=void 0,this._dateAtEnd=void 0,this._cue=void 0,this._badValueForSameId=void 0,this.tagAnchor=(i==null?void 0:i.tagAnchor)||null,this.tagOrder=(o=i==null?void 0:i.tagOrder)!=null?o:s,i){const u=i.attr;for(const d in u)if(Object.prototype.hasOwnProperty.call(e,d)&&e[d]!==u[d]){Zt.warn(`DATERANGE tag attribute: "${d}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=d;break}e=Jt(new _n({}),u,e)}if(this.attr=e,i?(this._startDate=i._startDate,this._cue=i._cue,this._endDate=i._endDate,this._dateAtEnd=i._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const u=(i==null?void 0:i.endDate)||new Date(this.attr["END-DATE"]);Ue(u.getTime())&&(this._endDate=u)}}get id(){return this.attr.ID}get class(){return this.attr.CLASS}get cue(){const e=this._cue;return e===void 0?this._cue=this.attr.enumeratedStringList(this.attr.CUE?"CUE":"X-CUE",{pre:!1,post:!1,once:!1}):e}get startTime(){const{tagAnchor:e}=this;return e===null||e.programDateTime===null?(Zt.warn(`Expected tagAnchor Fragment with PDT set for DateRange "${this.id}": ${e}`),NaN):e.start+(this.startDate.getTime()-e.programDateTime)/1e3}get startDate(){return this._startDate}get endDate(){const e=this._endDate||this._dateAtEnd;if(e)return e;const i=this.duration;return i!==null?this._dateAtEnd=new Date(this._startDate.getTime()+i*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(Ue(e))return e}else if(this._endDate)return(this._endDate.getTime()-this._startDate.getTime())/1e3;return null}get plannedDuration(){return"PLANNED-DURATION"in this.attr?this.attr.decimalFloatingPoint("PLANNED-DURATION"):null}get endOnNext(){return this.attr.bool("END-ON-NEXT")}get isInterstitial(){return this.class===e2}get isValid(){return!!this.id&&!this._badValueForSameId&&Ue(this.startDate.getTime())&&(this.duration===null||this.duration>=0)&&(!this.endOnNext||!!this.class)&&(!this.attr.CUE||!this.cue.pre&&!this.cue.post||this.cue.pre!==this.cue.post)&&(!this.isInterstitial||"X-ASSET-URI"in this.attr||"X-ASSET-LIST"in this.attr)}}const i2=10;class a2{constructor(e){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.dateRangeTagCount=0,this.live=!0,this.requestScheduled=-1,this.ageHeader=0,this.advancedDateTime=void 0,this.updated=!0,this.advanced=!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.playlistParsingError=null,this.variableList=null,this.hasVariableRefs=!1,this.appliedTimelineOffset=void 0,this.fragments=[],this.encryptedFragments=[],this.dateRanges={},this.url=e}reloaded(e){if(!e){this.advanced=!0,this.updated=!0;return}const i=this.lastPartSn-e.lastPartSn,s=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!s||!!i||!this.live,this.advanced=this.endSN>e.endSN||i>0||i===0&&s>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(i=>{let s=i.decryptdata;return s||(i.setKeyFormat(e.keyFormat),s=i.decryptdata),!!s&&e.matches(s)})}get hasProgramDateTime(){return this.fragments.length?Ue(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||i2}get drift(){const e=this.driftEndTime-this.driftStartTime;return e>0?(this.driftEnd-this.driftStart)*1e3/e:1}get edge(){return this.partEnd||this.fragmentEnd}get partEnd(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].end:this.fragmentEnd}get fragmentEnd(){return this.fragments.length?this.fragments[this.fragments.length-1].end:0}get fragmentStart(){return this.fragments.length?this.fragments[0].start:0}get age(){return this.advancedDateTime?Math.max(Date.now()-this.advancedDateTime,0)/1e3:0}get lastPartIndex(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].index:-1}get maxPartIndex(){const e=this.partList;if(e){const i=this.lastPartIndex;if(i!==-1){for(let s=e.length;s--;)if(e[s].index>i)return e[s].index;return i}}return 0}get lastPartSn(){var e;return(e=this.partList)!=null&&e.length?this.partList[this.partList.length-1].fragment.sn:this.endSN}get expired(){if(this.live&&this.age&&this.misses<3){const e=this.partEnd-this.fragmentStart;return this.age>Math.max(e,this.totalduration)+this.levelTargetDuration}return!1}}function vv(h,e){return h.length===e.length?!h.some((i,s)=>i!==e[s]):!1}function cA(h,e){return!h&&!e?!0:!h||!e?!1:vv(h,e)}function vh(h){return h==="AES-128"||h==="AES-256"||h==="AES-256-CTR"}function NT(h){switch(h){case"AES-128":case"AES-256":return Uu.cbc;case"AES-256-CTR":return Uu.ctr;default:throw new Error(`invalid full segment method ${h}`)}}function UT(h){return Uint8Array.from(atob(h),e=>e.charCodeAt(0))}function kT(h){return Uint8Array.from(unescape(encodeURIComponent(h)),e=>e.charCodeAt(0))}function s2(h){const e=kT(h).subarray(0,16),i=new Uint8Array(16);return i.set(e,16-e.length),i}function fA(h){const e=function(s,o,u){const d=s[o];s[o]=s[u],s[u]=d};e(h,0,3),e(h,1,2),e(h,4,5),e(h,6,7)}function dA(h){const e=h.split(":");let i=null;if(e[0]==="data"&&e.length===2){const s=e[1].split(";"),o=s[s.length-1].split(",");if(o.length===2){const u=o[0]==="base64",d=o[1];u?(s.splice(-1,1),i=UT(d)):i=s2(d)}}return i}const Sv=typeof self<"u"?self:void 0;var Cn={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Pi={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function Ev(h){switch(h){case Pi.FAIRPLAY:return Cn.FAIRPLAY;case Pi.PLAYREADY:return Cn.PLAYREADY;case Pi.WIDEVINE:return Cn.WIDEVINE;case Pi.CLEARKEY:return Cn.CLEARKEY}}function BT(h){switch(h){case Cn.FAIRPLAY:return Pi.FAIRPLAY;case Cn.PLAYREADY:return Pi.PLAYREADY;case Cn.WIDEVINE:return Pi.WIDEVINE;case Cn.CLEARKEY:return Pi.CLEARKEY}}function e0(h){const{drmSystems:e,widevineLicenseUrl:i}=h,s=e?[Cn.FAIRPLAY,Cn.WIDEVINE,Cn.PLAYREADY,Cn.CLEARKEY].filter(o=>!!e[o]):[];return!s[Cn.WIDEVINE]&&i&&s.push(Cn.WIDEVINE),s}const hA=function(h){return Sv!=null&&(h=Sv.navigator)!=null&&h.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null}();function l2(h,e,i,s){let o;switch(h){case Cn.FAIRPLAY:o=["cenc","sinf"];break;case Cn.WIDEVINE:case Cn.PLAYREADY:o=["cenc"];break;case Cn.CLEARKEY:o=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${h}`)}return r2(o,e,i,s)}function r2(h,e,i,s){return[{initDataTypes:h,persistentState:s.persistentState||"optional",distinctiveIdentifier:s.distinctiveIdentifier||"optional",sessionTypes:s.sessionTypes||[s.sessionType||"temporary"],audioCapabilities:e.map(u=>({contentType:`audio/mp4; codecs=${u}`,robustness:s.audioRobustness||"",encryptionScheme:s.audioEncryptionScheme||null})),videoCapabilities:i.map(u=>({contentType:`video/mp4; codecs=${u}`,robustness:s.videoRobustness||"",encryptionScheme:s.videoEncryptionScheme||null}))}]}function o2(h){var e;return!!h&&(h.sessionType==="persistent-license"||!!((e=h.sessionTypes)!=null&&e.some(i=>i==="persistent-license")))}function mA(h){const e=new Uint16Array(h.buffer,h.byteOffset,h.byteLength/2),i=String.fromCharCode.apply(null,Array.from(e)),s=i.substring(i.indexOf("<"),i.length),d=new DOMParser().parseFromString(s,"text/xml").getElementsByTagName("KID")[0];if(d){const g=d.childNodes[0]?d.childNodes[0].nodeValue:d.getAttribute("VALUE");if(g){const S=UT(g).subarray(0,16);return fA(S),S}}return null}let Sh={};class ku{static clearKeyUriToKeyIdMap(){Sh={}}static setKeyIdForUri(e,i){Sh[e]=i}static addKeyIdForUri(e){const i=Object.keys(Sh).length%Number.MAX_SAFE_INTEGER,s=new Uint8Array(16);return new DataView(s.buffer,12,4).setUint32(0,i),Sh[e]=s,s}constructor(e,i,s,o=[1],u=null,d){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=e,this.uri=i,this.keyFormat=s,this.keyFormatVersions=o,this.iv=u,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!vh(e),d!=null&&d.startsWith("0x")&&(this.keyId=new Uint8Array(vx(d)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&vv(e.keyFormatVersions,this.keyFormatVersions)&&cA(e.iv,this.iv)&&cA(e.keyId,this.keyId)}isSupported(){if(this.method){if(vh(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Pi.FAIRPLAY:case Pi.WIDEVINE:case Pi.PLAYREADY:case Pi.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,i){if(!this.encrypted||!this.uri)return null;if(vh(this.method)){let u=this.iv;return u||(typeof e!="number"&&(Zt.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),u=c2(e)),new ku(this.method,this.uri,"identity",this.keyFormatVersions,u)}if(this.keyId){const u=Sh[this.uri];if(u&&!vv(this.keyId,u)&&ku.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const s=dA(this.uri);if(s)switch(this.keyFormat){case Pi.WIDEVINE:if(this.pssh=s,!this.keyId){const u=hC(s.buffer);if(u.length){var o;const d=u[0];this.keyId=(o=d.kids)!=null&&o.length?d.kids[0]:null}}this.keyId||(this.keyId=gA(i));break;case Pi.PLAYREADY:{const u=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=dC(u,null,s),this.keyId=mA(s);break}default:{let u=s.subarray(0,16);if(u.length!==16){const d=new Uint8Array(16);d.set(u,16-u.length),u=d}this.keyId=u;break}}if(!this.keyId||this.keyId.byteLength!==16){let u;u=u2(i),u||(u=gA(i),u||(u=Sh[this.uri])),u&&(this.keyId=u,ku.setKeyIdForUri(this.uri,u))}return this}}function u2(h){const e=h==null?void 0:h[Pi.WIDEVINE];return e?e.keyId:null}function gA(h){const e=h==null?void 0:h[Pi.PLAYREADY];if(e){const i=dA(e.uri);if(i)return mA(i)}return null}function c2(h){const e=new Uint8Array(16);for(let i=12;i<16;i++)e[i]=h>>8*(15-i)&255;return e}const pA=/#EXT-X-STREAM-INF:([^\r\n]*)(?:[\r\n](?:#[^\r\n]*)?)*([^\r\n]+)|#EXT-X-(SESSION-DATA|SESSION-KEY|DEFINE|CONTENT-STEERING|START):([^\r\n]*)[\r\n]+/g,yA=/#EXT-X-MEDIA:(.*)/g,f2=/^#EXT(?:INF|-X-TARGETDURATION):/m,zT=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),d2=new RegExp([/#EXT-X-(PROGRAM-DATE-TIME|BYTERANGE|DATERANGE|DEFINE|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|INDEPENDENT-SEGMENTS)/.source,/(#)([^:]*):(.*)/.source,/(#)(.*)(?:.*)\r?\n?/.source].join("|"));class Ar{static findGroup(e,i){for(let s=0;s<e.length;s++){const o=e[s];if(o.id===i)return o}}static resolve(e,i){return ST.buildAbsoluteURL(i,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return f2.test(e)}static parseMasterPlaylist(e,i){const s=lA(e),o={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:s},u=[];if(pA.lastIndex=0,!e.startsWith("#EXTM3U"))return o.playlistParsingError=new Error("no EXTM3U delimiter"),o;let d;for(;(d=pA.exec(e))!=null;)if(d[1]){var g;const v=new _n(d[1],o),E=wT(o,d[2]),b={attrs:v,bitrate:v.decimalInteger("BANDWIDTH")||v.decimalInteger("AVERAGE-BANDWIDTH"),name:v.NAME,url:Ar.resolve(E,i)},R=v.decimalResolution("RESOLUTION");R&&(b.width=R.width,b.height=R.height),TA(v.CODECS,b);const _=v["SUPPLEMENTAL-CODECS"];_&&(b.supplemental={},TA(_,b.supplemental)),(g=b.unknownCodecs)!=null&&g.length||u.push(b),o.levels.push(b)}else if(d[3]){const v=d[3],E=d[4];switch(v){case"SESSION-DATA":{const b=new _n(E,o),R=b["DATA-ID"];R&&(o.sessionData===null&&(o.sessionData={}),o.sessionData[R]=b);break}case"SESSION-KEY":{const b=SA(E,i,o);b.encrypted&&b.isSupported()?(o.sessionKeys===null&&(o.sessionKeys=[]),o.sessionKeys.push(b)):Zt.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${E}"`);break}case"DEFINE":{{const b=new _n(E,o);rA(o,b,i)}break}case"CONTENT-STEERING":{const b=new _n(E,o);o.contentSteering={uri:Ar.resolve(b["SERVER-URI"],i),pathwayId:b["PATHWAY-ID"]||"."};break}case"START":{o.startTimeOffset=EA(E);break}}}const S=u.length>0&&u.length<o.levels.length;return o.levels=S?u:o.levels,o.levels.length===0&&(o.playlistParsingError=new Error("no levels found in manifest")),o}static parseMasterPlaylistMedia(e,i,s){let o;const u={},d=s.levels,g={AUDIO:d.map(v=>({id:v.attrs.AUDIO,audioCodec:v.audioCodec})),SUBTITLES:d.map(v=>({id:v.attrs.SUBTITLES,textCodec:v.textCodec})),"CLOSED-CAPTIONS":[]};let S=0;for(yA.lastIndex=0;(o=yA.exec(e))!==null;){const v=new _n(o[1],s),E=v.TYPE;if(E){const b=g[E],R=u[E]||[];u[E]=R;const _=v.LANGUAGE,D=v["ASSOC-LANGUAGE"],I=v.CHANNELS,M=v.CHARACTERISTICS,w=v["INSTREAM-ID"],B={attrs:v,bitrate:0,id:S++,groupId:v["GROUP-ID"]||"",name:v.NAME||_||"",type:E,default:v.bool("DEFAULT"),autoselect:v.bool("AUTOSELECT"),forced:v.bool("FORCED"),lang:_,url:v.URI?Ar.resolve(v.URI,i):""};if(D&&(B.assocLang=D),I&&(B.channels=I),M&&(B.characteristics=M),w&&(B.instreamId=w),b!=null&&b.length){const z=Ar.findGroup(b,B.groupId)||b[0];bA(B,z,"audioCodec"),bA(B,z,"textCodec")}R.push(B)}}return u}static parseLevelPlaylist(e,i,s,o,u,d){var g;const S={url:i},v=new a2(i),E=v.fragments,b=[];let R=null,_=0,D=0,I=0,M=0,w=0,B=null,z=new TT(o,S),G,K,ae,q=-1,Z=!1,te=null,$;if(zT.lastIndex=0,v.m3u8=e,v.hasVariableRefs=lA(e),((g=zT.exec(e))==null?void 0:g[0])!=="#EXTM3U")return v.playlistParsingError=new Error("Missing format identifier #EXTM3U"),v;for(;(G=zT.exec(e))!==null;){Z&&(Z=!1,z=new TT(o,S),z.playlistOffset=I,z.setStart(I),z.sn=_,z.cc=M,w&&(z.bitrate=w),z.level=s,R&&(z.initSegment=R,R.rawProgramDateTime&&(z.rawProgramDateTime=R.rawProgramDateTime,R.rawProgramDateTime=null),te&&(z.setByteRange(te),te=null)));const Ie=G[1];if(Ie){z.duration=parseFloat(Ie);const Oe=(" "+G[2]).slice(1);z.title=Oe||null,z.tagList.push(Oe?["INF",Ie,Oe]:["INF",Ie])}else if(G[3]){if(Ue(z.duration)){z.playlistOffset=I,z.setStart(I),ae&&AA(z,ae,v),z.sn=_,z.level=s,z.cc=M,E.push(z);const Oe=(" "+G[3]).slice(1);z.relurl=wT(v,Oe),FT(z,B,b),B=z,I+=z.duration,_++,D=0,Z=!0}}else{if(G=G[0].match(d2),!G){Zt.warn("No matches on slow regex match for level playlist!");continue}for(K=1;K<G.length&&G[K]===void 0;K++);const Oe=(" "+G[K]).slice(1),F=(" "+G[K+1]).slice(1),ne=G[K+2]?(" "+G[K+2]).slice(1):null;switch(Oe){case"BYTERANGE":B?z.setByteRange(F,B):z.setByteRange(F);break;case"PROGRAM-DATE-TIME":z.rawProgramDateTime=F,z.tagList.push(["PROGRAM-DATE-TIME",F]),q===-1&&(q=E.length);break;case"PLAYLIST-TYPE":v.type&&vo(v,Oe,G),v.type=F.toUpperCase();break;case"MEDIA-SEQUENCE":v.startSN!==0?vo(v,Oe,G):E.length>0&&RA(v,Oe,G),_=v.startSN=parseInt(F);break;case"SKIP":{v.skippedSegments&&vo(v,Oe,G);const le=new _n(F,v),xe=le.decimalInteger("SKIPPED-SEGMENTS");if(Ue(xe)){v.skippedSegments+=xe;for(let Q=xe;Q--;)E.push(null);_+=xe}const _e=le.enumeratedString("RECENTLY-REMOVED-DATERANGES");_e&&(v.recentlyRemovedDateranges=(v.recentlyRemovedDateranges||[]).concat(_e.split(" ")));break}case"TARGETDURATION":v.targetduration!==0&&vo(v,Oe,G),v.targetduration=Math.max(parseInt(F),1);break;case"VERSION":v.version!==null&&vo(v,Oe,G),v.version=parseInt(F);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":v.live||vo(v,Oe,G),v.live=!1;break;case"#":(F||ne)&&z.tagList.push(ne?[F,ne]:[F]);break;case"DISCONTINUITY":M++,z.tagList.push(["DIS"]);break;case"GAP":z.gap=!0,z.tagList.push([Oe]);break;case"BITRATE":z.tagList.push([Oe,F]),w=parseInt(F)*1e3,Ue(w)?z.bitrate=w:w=0;break;case"DATERANGE":{const le=new _n(F,v),xe=new uA(le,v.dateRanges[le.ID],v.dateRangeTagCount);v.dateRangeTagCount++,xe.isValid||v.skippedSegments?v.dateRanges[xe.id]=xe:Zt.warn(`Ignoring invalid DATERANGE tag: "${F}"`),z.tagList.push(["EXT-X-DATERANGE",F]);break}case"DEFINE":{{const le=new _n(F,v);"IMPORT"in le?JC(v,le,d):rA(v,le,i)}break}case"DISCONTINUITY-SEQUENCE":v.startCC!==0?vo(v,Oe,G):E.length>0&&RA(v,Oe,G),v.startCC=M=parseInt(F);break;case"KEY":{const le=SA(F,i,v);if(le.isSupported()){if(le.method==="NONE"){ae=void 0;break}ae||(ae={});const xe=ae[le.keyFormat];xe!=null&&xe.matches(le)||(xe&&(ae=Jt({},ae)),ae[le.keyFormat]=le)}else Zt.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${F}"`);break}case"START":v.startTimeOffset=EA(F);break;case"MAP":{const le=new _n(F,v);if(z.duration){const xe=new TT(o,S);xA(xe,le,s,ae),R=xe,z.initSegment=R,R.rawProgramDateTime&&!z.rawProgramDateTime&&(z.rawProgramDateTime=R.rawProgramDateTime)}else{const xe=z.byteRangeEndOffset;if(xe){const _e=z.byteRangeStartOffset;te=`${xe-_e}@${_e}`}else te=null;xA(z,le,s,ae),R=z,Z=!0}R.cc=M;break}case"SERVER-CONTROL":{$&&vo(v,Oe,G),$=new _n(F),v.canBlockReload=$.bool("CAN-BLOCK-RELOAD"),v.canSkipUntil=$.optionalFloat("CAN-SKIP-UNTIL",0),v.canSkipDateRanges=v.canSkipUntil>0&&$.bool("CAN-SKIP-DATERANGES"),v.partHoldBack=$.optionalFloat("PART-HOLD-BACK",0),v.holdBack=$.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{v.partTarget&&vo(v,Oe,G);const le=new _n(F);v.partTarget=le.decimalFloatingPoint("PART-TARGET");break}case"PART":{let le=v.partList;le||(le=v.partList=[]);const xe=D>0?le[le.length-1]:void 0,_e=D++,Q=new _n(F,v),de=new J_(Q,z,S,_e,xe);le.push(de),z.duration+=de.duration;break}case"PRELOAD-HINT":{const le=new _n(F,v);v.preloadHint=le;break}case"RENDITION-REPORT":{const le=new _n(F,v);v.renditionReports=v.renditionReports||[],v.renditionReports.push(le);break}default:Zt.warn(`line parsed but not handled: ${G}`);break}}}B&&!B.relurl?(E.pop(),I-=B.duration,v.partList&&(v.fragmentHint=B)):v.partList&&(FT(z,B,b),z.cc=M,v.fragmentHint=z,ae&&AA(z,ae,v)),v.targetduration||(v.playlistParsingError=new Error("Missing Target Duration"));const me=E.length,Ee=E[0],De=E[me-1];if(I+=v.skippedSegments*v.targetduration,I>0&&me&&De){v.averagetargetduration=I/me;const Ie=De.sn;v.endSN=Ie!=="initSegment"?Ie:0,v.live||(De.endList=!0),q>0&&(m2(E,q),Ee&&b.unshift(Ee))}return v.fragmentHint&&(I+=v.fragmentHint.duration),v.totalduration=I,b.length&&v.dateRangeTagCount&&Ee&&vA(b,v),v.endCC=M,v}}function vA(h,e){let i=h.length;if(!i)if(e.hasProgramDateTime){const g=e.fragments[e.fragments.length-1];h.push(g),i++}else return;const s=h[i-1],o=e.live?1/0:e.totalduration,u=Object.keys(e.dateRanges);for(let g=u.length;g--;){const S=e.dateRanges[u[g]],v=S.startDate.getTime();S.tagAnchor=s.ref;for(let E=i;E--;){var d;if(((d=h[E])==null?void 0:d.sn)<e.startSN)break;const b=h2(e,v,h,E,o);if(b!==-1){S.tagAnchor=e.fragments[b].ref;break}}}}function h2(h,e,i,s,o){const u=i[s];if(u){const g=u.programDateTime;if(e>=g||s===0){var d;const S=(((d=i[s+1])==null?void 0:d.start)||o)-u.start;if(e<=g+S*1e3){const v=i[s].sn-h.startSN;if(v<0)return-1;const E=h.fragments;if(E.length>i.length){const R=(i[s+1]||E[E.length-1]).sn-h.startSN;for(let _=R;_>v;_--){const D=E[_].programDateTime;if(e>=D&&e<D+E[_].duration*1e3)return _}}return v}}}return-1}function SA(h,e,i){var s,o;const u=new _n(h,i),d=(s=u.METHOD)!=null?s:"",g=u.URI,S=u.hexadecimalInteger("IV"),v=u.KEYFORMATVERSIONS,E=(o=u.KEYFORMAT)!=null?o:"identity";g&&u.IV&&!S&&Zt.error(`Invalid IV: ${u.IV}`);const b=g?Ar.resolve(g,e):"",R=(v||"1").split("/").map(Number).filter(Number.isFinite);return new ku(d,b,E,R,S,u.KEYID)}function EA(h){const i=new _n(h).decimalFloatingPoint("TIME-OFFSET");return Ue(i)?i:null}function TA(h,e){let i=(h||"").split(/[ ,]+/).filter(s=>s);["video","audio","text"].forEach(s=>{const o=i.filter(u=>AT(u,s));o.length&&(e[`${s}Codec`]=o.map(u=>u.split("/")[0]).join(","),i=i.filter(u=>o.indexOf(u)===-1))}),e.unknownCodecs=i}function bA(h,e,i){const s=e[i];s&&(h[i]=s)}function m2(h,e){let i=h[e];for(let s=e;s--;){const o=h[s];if(!o)return;o.programDateTime=i.programDateTime-o.duration*1e3,i=o}}function FT(h,e,i){h.rawProgramDateTime?i.push(h):e!=null&&e.programDateTime&&(h.programDateTime=e.endProgramDateTime)}function xA(h,e,i,s){h.relurl=e.URI,e.BYTERANGE&&h.setByteRange(e.BYTERANGE),h.level=i,h.sn="initSegment",s&&(h.levelkeys=s),h.initSegment=null}function AA(h,e,i){h.levelkeys=e;const{encryptedFragments:s}=i;(!s.length||s[s.length-1].levelkeys!==e)&&Object.keys(e).some(o=>e[o].isCommonEncryption)&&s.push(h)}function vo(h,e,i){h.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${i[0]})`)}function RA(h,e,i){h.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${i[0]})`)}function PT(h,e){const i=e.startPTS;if(Ue(i)){let s=0,o;e.sn>h.sn?(s=i-h.start,o=h):(s=h.start-i,o=e),o.duration!==s&&o.setDuration(s)}else e.sn>h.sn?h.cc===e.cc&&h.minEndPTS?e.setStart(h.start+(h.minEndPTS-h.start)):e.setStart(h.start+h.duration):e.setStart(Math.max(h.start-e.duration,0))}function DA(h,e,i,s,o,u,d){s-i<=0&&(d.warn("Fragment should have a positive duration",e),s=i+e.duration,u=o+e.duration);let S=i,v=s;const E=e.startPTS,b=e.endPTS;if(Ue(E)){const w=Math.abs(E-i);h&&w>h.totalduration?d.warn(`media timestamps and playlist times differ by ${w}s for level ${e.level} ${h.url}`):Ue(e.deltaPTS)?e.deltaPTS=Math.max(w,e.deltaPTS):e.deltaPTS=w,S=Math.max(i,E),i=Math.min(i,E),o=e.startDTS!==void 0?Math.min(o,e.startDTS):o,v=Math.min(s,b),s=Math.max(s,b),u=e.endDTS!==void 0?Math.max(u,e.endDTS):u}const R=i-e.start;e.start!==0&&e.setStart(i),e.setDuration(s-e.start),e.startPTS=i,e.maxStartPTS=S,e.startDTS=o,e.endPTS=s,e.minEndPTS=v,e.endDTS=u;const _=e.sn;if(!h||_<h.startSN||_>h.endSN)return 0;let D;const I=_-h.startSN,M=h.fragments;for(M[I]=e,D=I;D>0;D--)PT(M[D],M[D-1]);for(D=I;D<M.length-1;D++)PT(M[D],M[D+1]);return h.fragmentHint&&PT(M[M.length-1],h.fragmentHint),h.PTSKnown=h.alignedSliding=!0,R}function g2(h,e,i){if(h===e)return;let s=null;const o=h.fragments;for(let E=o.length-1;E>=0;E--){const b=o[E].initSegment;if(b){s=b;break}}h.fragmentHint&&delete h.fragmentHint.endPTS;let u;v2(h,e,(E,b,R,_)=>{if((!e.startCC||e.skippedSegments)&&b.cc!==E.cc){const D=E.cc-b.cc;for(let I=R;I<_.length;I++)_[I].cc+=D;e.endCC=_[_.length-1].cc}Ue(E.startPTS)&&Ue(E.endPTS)&&(b.setStart(b.startPTS=E.startPTS),b.startDTS=E.startDTS,b.maxStartPTS=E.maxStartPTS,b.endPTS=E.endPTS,b.endDTS=E.endDTS,b.minEndPTS=E.minEndPTS,b.setDuration(E.endPTS-E.startPTS),b.duration&&(u=b),e.PTSKnown=e.alignedSliding=!0),E.hasStreams&&(b.elementaryStreams=E.elementaryStreams),b.loader=E.loader,E.hasStats&&(b.stats=E.stats),E.initSegment&&(b.initSegment=E.initSegment,s=E.initSegment)});const d=e.fragments,g=e.fragmentHint?d.concat(e.fragmentHint):d;if(s&&g.forEach(E=>{var b;E&&(!E.initSegment||E.initSegment.relurl===((b=s)==null?void 0:b.relurl))&&(E.initSegment=s)}),e.skippedSegments){if(e.deltaUpdateFailed=d.some(E=>!E),e.deltaUpdateFailed){i.warn("[level-helper] Previous playlist missing segments skipped in delta playlist");for(let E=e.skippedSegments;E--;)d.shift();e.startSN=d[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=p2(h.dateRanges,e,i));const E=h.fragments.filter(b=>b.rawProgramDateTime);if(h.hasProgramDateTime&&!e.hasProgramDateTime)for(let b=1;b<g.length;b++)g[b].programDateTime===null&&FT(g[b],g[b-1],E);vA(E,e)}e.endCC=d[d.length-1].cc}if(!e.startCC){var S;const E=OA(h,e.startSN-1);e.startCC=(S=E==null?void 0:E.cc)!=null?S:d[0].cc}y2(h.partList,e.partList,(E,b)=>{b.elementaryStreams=E.elementaryStreams,b.stats=E.stats}),u?DA(e,u,u.startPTS,u.endPTS,u.startDTS,u.endDTS,i):_A(h,e),d.length&&(e.totalduration=e.edge-d[0].start),e.driftStartTime=h.driftStartTime,e.driftStart=h.driftStart;const v=e.advancedDateTime;if(e.advanced&&v){const E=e.edge;e.driftStart||(e.driftStartTime=v,e.driftStart=E),e.driftEndTime=v,e.driftEnd=E}else e.driftEndTime=h.driftEndTime,e.driftEnd=h.driftEnd,e.advancedDateTime=h.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=h.requestScheduled)}function p2(h,e,i){const{dateRanges:s,recentlyRemovedDateranges:o}=e,u=Jt({},h);o&&o.forEach(S=>{delete u[S]});const g=Object.keys(u).length;return g?(Object.keys(s).forEach(S=>{const v=u[S],E=new uA(s[S].attr,v);E.isValid?(u[S]=E,v||(E.tagOrder+=g)):i.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${rn(s[S].attr)}"`)}),u):s}function y2(h,e,i){if(h&&e){let s=0;for(let o=0,u=h.length;o<=u;o++){const d=h[o],g=e[o+s];d&&g&&d.index===g.index&&d.fragment.sn===g.fragment.sn?i(d,g):s--}}}function v2(h,e,i){const s=e.skippedSegments,o=Math.max(h.startSN,e.startSN)-e.startSN,u=(h.fragmentHint?1:0)+(s?e.endSN:Math.min(h.endSN,e.endSN))-e.startSN,d=e.startSN-h.startSN,g=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,S=h.fragmentHint?h.fragments.concat(h.fragmentHint):h.fragments;for(let v=o;v<=u;v++){const E=S[d+v];let b=g[v];if(s&&!b&&E&&(b=e.fragments[v]=E),E&&b){i(E,b,v,g);const R=E.relurl,_=b.relurl;if(R&&S2(R,_)){e.playlistParsingError=LA(`media sequence mismatch ${b.sn}:`,h,e,E,b);return}else if(E.cc!==b.cc){e.playlistParsingError=LA(`discontinuity sequence mismatch (${E.cc}!=${b.cc})`,h,e,E,b);return}}}}function LA(h,e,i,s,o){return new Error(`${h} ${o.url}
288
+ Playlist starting @${e.startSN}
289
+ ${e.m3u8}
290
+
291
+ Playlist starting @${i.startSN}
292
+ ${i.m3u8}`)}function _A(h,e,i=!0){const s=e.startSN+e.skippedSegments-h.startSN,o=h.fragments,u=s>=0;let d=0;if(u&&s<o.length)d=o[s].start;else if(u&&e.startSN===h.endSN+1)d=h.fragmentEnd;else if(u&&i)d=h.fragmentStart+s*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)d=h.fragmentStart;else return;GT(e,d)}function GT(h,e){if(e){const i=h.fragments;for(let s=h.skippedSegments;s<i.length;s++)i[s].addStart(e);h.fragmentHint&&h.fragmentHint.addStart(e)}}function CA(h,e=1/0){let i=1e3*h.targetduration;if(h.updated){const s=h.fragments;if(s.length&&i*4>e){const u=s[s.length-1].duration*1e3;u<i&&(i=u)}}else i/=2;return Math.round(i)}function OA(h,e,i){if(!h)return null;let s=h.fragments[e-h.startSN];return s||(s=h.fragmentHint,s&&s.sn===e)?s:e<h.startSN&&i&&i.sn===e?i:null}function MA(h,e,i){return h?IA(h.partList,e,i):null}function IA(h,e,i){if(h)for(let s=h.length;s--;){const o=h[s];if(o.index===i&&o.fragment.sn===e)return o}return null}function wA(h){h.forEach((e,i)=>{var s;(s=e.details)==null||s.fragments.forEach(o=>{o.level=i,o.initSegment&&(o.initSegment.level=i)})})}function S2(h,e){return h!==e&&e?NA(h)!==NA(e):!1}function NA(h){return h.replace(/\?[^?]*$/,"")}function t0(h,e){for(let s=0,o=h.length;s<o;s++){var i;if(((i=h[s])==null?void 0:i.cc)===e)return h[s]}return null}function E2(h,e){return!!(h&&e.startCC<h.endCC&&e.endCC>h.startCC)}function UA(h,e){const i=h.start+e;h.startPTS=i,h.setStart(i),h.endPTS=i+h.duration}function kA(h,e){const i=e.fragments;for(let s=0,o=i.length;s<o;s++)UA(i[s],h);e.fragmentHint&&UA(e.fragmentHint,h),e.alignedSliding=!0}function T2(h,e){h&&(BA(e,h),e.alignedSliding||Tv(e,h),!e.alignedSliding&&!e.skippedSegments&&_A(h,e,!1))}function BA(h,e){if(!E2(e,h))return;const i=Math.min(e.endCC,h.endCC),s=t0(e.fragments,i),o=t0(h.fragments,i);if(!s||!o)return;Zt.log(`Aligning playlist at start of dicontinuity sequence ${i}`);const u=s.start-o.start;kA(u,h)}function Tv(h,e){if(!h.hasProgramDateTime||!e.hasProgramDateTime)return;const i=h.fragments,s=e.fragments;if(!i.length||!s.length)return;let o,u;const d=Math.min(e.endCC,h.endCC);e.startCC<d&&h.startCC<d&&(o=t0(s,d),u=t0(i,d)),(!o||!u)&&(o=s[Math.floor(s.length/2)],u=t0(i,o.cc)||i[Math.floor(i.length/2)]);const g=o.programDateTime,S=u.programDateTime;if(!g||!S)return;const v=(S-g)/1e3-(u.start-o.start);kA(v,h)}function pa(h,e,i){$a(h,e,i),h.addEventListener(e,i)}function $a(h,e,i){h.removeEventListener(e,i)}const b2={toString:function(h){let e="";const i=h.length;for(let s=0;s<i;s++)e+=`[${h.start(s).toFixed(3)}-${h.end(s).toFixed(3)}]`;return e}},be={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"};class $T extends iA{constructor(e,i,s,o,u){super(o,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=be.STOPPED,this.playlistType=void 0,this.media=null,this.mediaBuffer=null,this.config=void 0,this.bitrateTest=!1,this.lastCurrentTime=0,this.nextLoadPosition=0,this.startPosition=0,this.startTimeOffset=null,this.retryDate=0,this.levels=null,this.fragmentLoader=void 0,this.keyLoader=void 0,this.levelLastLoaded=null,this.startFragRequested=!1,this.decrypter=void 0,this.initPTS=[],this.buffering=!0,this.loadingParts=!1,this.loopSn=void 0,this.onMediaSeeking=()=>{const{config:d,fragCurrent:g,media:S,mediaBuffer:v,state:E}=this,b=S?S.currentTime:0,R=lt.bufferInfo(v||S,b,d.maxBufferHole),_=!R.len;if(this.log(`Media seeking to ${Ue(b)?b.toFixed(3):b}, state: ${E}, ${_?"out of":"in"} buffer`),this.state===be.ENDED)this.resetLoadingState();else if(g){const D=d.maxFragLookUpTolerance,I=g.start-D,M=g.start+g.duration+D;if(_||M<R.start||I>R.end){const w=b>M;(b<I||w)&&(w&&g.loader&&(this.log(`Cancelling fragment load for seek (sn: ${g.sn})`),g.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(S){this.fragmentTracker.removeFragmentsInRange(b,1/0,this.playlistType,!0);const D=this.lastCurrentTime;if(b>D&&(this.lastCurrentTime=b),!this.loadingParts){const I=Math.max(R.end,b),M=this.shouldLoadParts(this.getLevelDetails(),I);M&&(this.log(`LL-Part loading ON after seeking to ${b.toFixed(2)} with buffer @${I.toFixed(2)}`),this.loadingParts=M)}}this.hls.hasEnoughToStart||(this.log(`Setting ${_?"startPosition":"nextLoadPosition"} to ${b} for seek without enough to start`),this.nextLoadPosition=b,_&&(this.startPosition=b)),_&&this.state===be.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=u,this.hls=e,this.fragmentLoader=new QC(e.config),this.keyLoader=s,this.fragmentTracker=i,this.config=e.config,this.decrypter=new MT(e.config)}registerListeners(){const{hls:e}=this;e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(O.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(O.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===be.STOPPED)return;this.fragmentLoader.abort(),this.keyLoader.abort(this.playlistType);const e=this.fragCurrent;e!=null&&e.loader&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.resetTransmuxer(),this.fragCurrent=null,this.fragPrevious=null,this.clearInterval(),this.clearNextTick(),this.state=be.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:i}=this;return i===-1&&e?e:i}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,i){if(i.live||!this.media)return!1;const s=e.end||0,o=this.config.timelineOffset||0;if(s<=o)return!1;const u=e.buffered;this.config.maxBufferHole&&u&&u.length>1&&(e=lt.bufferedInfo(u,e.start,0));const d=e.nextStart;if(d&&d>o&&d<i.edge||this.media.currentTime<e.start)return!1;const S=i.partList;if(S!=null&&S.length){const E=S[S.length-1];return lt.isBuffered(this.media,E.start+E.duration/2)}const v=i.fragments[i.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(v)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var i;return((i=this.getLevelDetails())==null?void 0:i.appliedTimelineOffset)||e}return 0}onMediaAttached(e,i){const s=this.media=this.mediaBuffer=i.media;pa(s,"seeking",this.onMediaSeeking),pa(s,"ended",this.onMediaEnded);const o=this.config;this.levels&&o.autoStartLoad&&this.state===be.STOPPED&&this.startLoad(o.startPosition)}onMediaDetaching(e,i){const s=!!i.transferMedia,o=this.media;if(o!==null){if(o.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),$a(o,"seeking",this.onMediaSeeking),$a(o,"ended",this.onMediaEnded),this.keyLoader&&!s&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,s){this.resetLoadingState(),this.resetTransmuxer();return}this.loadingParts=!1,this.fragmentTracker.removeAllFragments(),this.stopLoad()}}onManifestLoading(){this.initPTS=[],this.levels=this.levelLastLoaded=this.fragCurrent=null,this.lastCurrentTime=this.startPosition=0,this.startFragRequested=!1}onError(e,i){}onManifestLoaded(e,i){this.startTimeOffset=i.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=be.STOPPED,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,super.onHandlerDestroyed()}loadFragment(e,i,s){this.startFragRequested=!0,this._loadFragForPlayback(e,i,s)}_loadFragForPlayback(e,i,s){const o=u=>{const d=u.frag;if(this.fragContextChanged(d)){this.warn(`${d.type} sn: ${d.sn}${u.part?" part: "+u.part.index:""} of ${this.fragInfo(d,!1,u.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(d);return}d.stats.chunkCount++,this._handleFragmentLoadProgress(u)};this._doFragLoad(e,i,s,o).then(u=>{if(!u)return;const d=this.state,g=u.frag;if(this.fragContextChanged(g)){(d===be.FRAG_LOADING||!this.fragCurrent&&d===be.PARSING)&&(this.fragmentTracker.removeFragment(g),this.state=be.IDLE);return}"payload"in u&&(this.log(`Loaded ${g.type} sn: ${g.sn} of ${this.playlistLabel()} ${g.level}`),this.hls.trigger(O.FRAG_LOADED,u)),this._handleFragmentLoadComplete(u)}).catch(u=>{this.state===be.STOPPED||this.state===be.ERROR||(this.warn(`Frag error: ${(u==null?void 0:u.message)||u}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var i;const{fragmentTracker:s}=this;if(s.getState(e)===yi.APPENDING){const u=e.type,d=this.getFwdBufferInfo(this.mediaBuffer,u),g=Math.max(e.duration,d?d.len:this.config.maxBufferLength),S=this.backtrackFragment;((S?e.sn-S.sn:0)===1||this.reduceMaxBufferLength(g,e.duration))&&s.removeFragment(e)}else((i=this.mediaBuffer)==null?void 0:i.buffered.length)===0?s.removeAllFragments():s.hasParts(e.type)&&(s.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),s.getState(e)===yi.PARTIAL&&s.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const i=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:i,part:null,stats:i.stats,id:i.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const i=e.details;return(i==null?void 0:i.live)&&i.type!=="EVENT"&&(this.levelLastLoaded!==e||i.expired)}flushMainBuffer(e,i,s=null){if(!(e-i))return;const o={startOffset:e,endOffset:i,type:s};this.hls.trigger(O.BUFFER_FLUSHING,o)}_loadInitSegment(e,i){this._doFragLoad(e,i).then(s=>{const o=s==null?void 0:s.frag;if(!o||this.fragContextChanged(o)||!this.levels)throw new Error("init load aborted");return s}).then(s=>{const{hls:o}=this,{frag:u,payload:d}=s,g=u.decryptdata;if(d&&d.byteLength>0&&g!=null&&g.key&&g.iv&&vh(g.method)){const S=self.performance.now();return this.decrypter.decrypt(new Uint8Array(d),g.key.buffer,g.iv.buffer,NT(g.method)).catch(v=>{throw o.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_DECRYPT_ERROR,fatal:!1,error:v,reason:v.message,frag:u}),v}).then(v=>{const E=self.performance.now();return o.trigger(O.FRAG_DECRYPTED,{frag:u,payload:v,stats:{tstart:S,tdecrypt:E}}),s.payload=v,this.completeInitSegmentLoad(s)})}return this.completeInitSegmentLoad(s)}).catch(s=>{this.state===be.STOPPED||this.state===be.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:i}=this;if(!i)throw new Error("init load aborted, missing levels");const s=e.frag.stats;this.state!==be.STOPPED&&(this.state=be.IDLE),e.frag.data=new Uint8Array(e.payload),s.parsing.start=s.buffering.start=self.performance.now(),s.parsing.end=s.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,i){var s,o;const u=e.tracks;if(u&&!i.encrypted&&((s=u.audio)!=null&&s.encrypted||(o=u.video)!=null&&o.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const d=this.media,g=new Error(`Encrypted track with no key in ${this.fragInfo(i)} (media ${d?"attached mediaKeys: "+d.mediaKeys:"detached"})`);return this.warn(g.message),!d||d.mediaKeys?!1:(this.hls.trigger(O.ERROR,{type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_KEYS,fatal:!1,error:g,frag:i}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:i}=this;return!e||!i||e.sn!==i.sn||e.level!==i.level}fragBufferedComplete(e,i){const s=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${i?" part: "+i.index:""} of ${this.fragInfo(e,!1,i)} > buffer:${s?b2.toString(lt.getBuffered(s)):"(detached)"})`),Vn(e)){var o;if(e.type!==Be.SUBTITLE){const d=e.elementaryStreams;if(!Object.keys(d).some(g=>!!d[g])){this.state=be.IDLE;return}}const u=(o=this.levels)==null?void 0:o[e.level];u!=null&&u.fragmentError&&(this.log(`Resetting level fragment error count of ${u.fragmentError} on frag buffered`),u.fragmentError=0)}this.state=be.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:i}=this;if(!i)return;const{frag:s,part:o,partsLoaded:u}=e,d=!u||u.length===0||u.some(S=>!S),g=new IT(s.level,s.sn,s.stats.chunkCount+1,0,o?o.index:-1,!d);i.flush(g)}_handleFragmentLoadProgress(e){}_doFragLoad(e,i,s=null,o){var u;this.fragCurrent=e;const d=i.details;if(!this.levels||!d)throw new Error(`frag load aborted, missing level${d?"":" detail"}s`);let g=null;if(e.encrypted&&!((u=e.decryptdata)!=null&&u.key)){if(this.log(`Loading key for ${e.sn} of [${d.startSN}-${d.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=be.KEY_LOADING,this.fragCurrent=e,g=this.keyLoader.load(e).then(R=>{if(!this.fragContextChanged(R.frag))return this.hls.trigger(O.KEY_LOADED,R),this.state===be.KEY_LOADING&&(this.state=be.IDLE),R}),this.hls.trigger(O.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(g=this.keyLoader.loadClear(e,d.encryptedFragments,this.startFragRequested),g&&this.log("[eme] blocking frag load until media-keys acquired"));const S=this.fragPrevious;if(Vn(e)&&(!S||e.sn!==S.sn)){const R=this.shouldLoadParts(i.details,e.end);R!==this.loadingParts&&(this.log(`LL-Part loading ${R?"ON":"OFF"} loading sn ${S==null?void 0:S.sn}->${e.sn}`),this.loadingParts=R)}if(s=Math.max(e.start,s||0),this.loadingParts&&Vn(e)){const R=d.partList;if(R&&o){s>d.fragmentEnd&&d.fragmentHint&&(e=d.fragmentHint);const _=this.getNextPart(R,e,s);if(_>-1){const D=R[_];e=this.fragCurrent=D.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${D.index} (${_}/${R.length-1}) of ${this.fragInfo(e,!1,D)}) cc: ${e.cc} [${d.startSN}-${d.endSN}], target: ${parseFloat(s.toFixed(3))}`),this.nextLoadPosition=D.start+D.duration,this.state=be.FRAG_LOADING;let I;return g?I=g.then(M=>!M||this.fragContextChanged(M.frag)?null:this.doFragPartsLoad(e,D,i,o)).catch(M=>this.handleFragLoadError(M)):I=this.doFragPartsLoad(e,D,i,o).catch(M=>this.handleFragLoadError(M)),this.hls.trigger(O.FRAG_LOADING,{frag:e,part:D,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):I}else if(!e.url||this.loadedEndOfParts(R,s))return Promise.resolve(null)}}if(Vn(e)&&this.loadingParts){var v;this.log(`LL-Part loading OFF after next part miss @${s.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(v=d.partList)==null?void 0:v.filter(R=>R.loaded).map(R=>`[${R.start}-${R.end}]`)}`),this.loadingParts=!1}else if(!e.url)return Promise.resolve(null);this.log(`Loading ${e.type} sn: ${e.sn} of ${this.fragInfo(e,!1)}) cc: ${e.cc} ${"["+d.startSN+"-"+d.endSN+"]"}, target: ${parseFloat(s.toFixed(3))}`),Ue(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=be.FRAG_LOADING;const E=this.config.progressive&&e.type!==Be.SUBTITLE;let b;return E&&g?b=g.then(R=>!R||this.fragContextChanged(R.frag)?null:this.fragmentLoader.load(e,o)).catch(R=>this.handleFragLoadError(R)):b=Promise.all([this.fragmentLoader.load(e,E?o:void 0),g]).then(([R])=>(!E&&o&&o(R),R)).catch(R=>this.handleFragLoadError(R)),this.hls.trigger(O.FRAG_LOADING,{frag:e,targetBufferTime:s}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):b}doFragPartsLoad(e,i,s,o){return new Promise((u,d)=>{var g;const S=[],v=(g=s.details)==null?void 0:g.partList,E=b=>{this.fragmentLoader.loadPart(e,b,o).then(R=>{S[b.index]=R;const _=R.part;this.hls.trigger(O.FRAG_LOADED,R);const D=MA(s.details,e.sn,b.index+1)||IA(v,e.sn,b.index+1);if(D)E(D);else return u({frag:e,part:_,partsLoaded:S})}).catch(d)};E(i)})}handleFragLoadError(e){if("data"in e){const i=e.data;i.frag&&i.details===re.INTERNAL_ABORTED?this.handleFragLoadAborted(i.frag,i.part):i.frag&&i.type===je.KEY_SYSTEM_ERROR?(i.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(i.frag)):this.hls.trigger(O.ERROR,i)}else this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const i=this.getCurrentContext(e);if(!i||this.state!==be.PARSING){!this.fragCurrent&&this.state!==be.STOPPED&&this.state!==be.ERROR&&(this.state=be.IDLE);return}const{frag:s,part:o,level:u}=i,d=self.performance.now();s.stats.parsing.end=d,o&&(o.stats.parsing.end=d);const g=this.getLevelDetails(),v=g&&s.sn>g.endSN||this.shouldLoadParts(g,s.end);v!==this.loadingParts&&(this.log(`LL-Part loading ${v?"ON":"OFF"} after parsing segment ending @${s.end.toFixed(2)}`),this.loadingParts=v),this.updateLevelTiming(s,o,u,e.partial)}shouldLoadParts(e,i){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var s;const u=e.partList[0];if(u.fragment.type===Be.SUBTITLE)return!1;const d=u.end+(((s=e.fragmentHint)==null?void 0:s.duration)||0);if(i>=d){var o;if((this.hls.hasEnoughToStart?((o=this.media)==null?void 0:o.currentTime)||this.lastCurrentTime:this.getLoadPosition())>u.start-u.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:i,fragCurrent:s}=this,{level:o,sn:u,part:d}=e;if(!(i!=null&&i[o]))return this.warn(`Levels object was unset while buffering fragment ${u} of ${this.playlistLabel()} ${o}. The current chunk will not be buffered.`),null;const g=i[o],S=g.details,v=d>-1?MA(S,u,d):null,E=v?v.fragment:OA(S,u,s);return E?(s&&s!==E&&(E.stats=s.stats),{frag:E,part:v,level:g}):null}bufferFragmentData(e,i,s,o,u){if(this.state!==be.PARSING)return;const{data1:d,data2:g}=e;let S=d;if(g&&(S=Qs(d,g)),!S.length)return;const v=this.initPTS[i.cc],E=v?-v.baseTime/v.timescale:void 0,b={type:e.type,frag:i,part:s,chunkMeta:o,offset:E,parent:i.type,data:S};if(this.hls.trigger(O.BUFFER_APPENDING,b),e.dropped&&e.independent&&!s){if(u)return;this.flushBufferGap(i)}}flushBufferGap(e){const i=this.media;if(!i)return;if(!lt.isBuffered(i,i.currentTime)){this.flushMainBuffer(0,e.start);return}const s=i.currentTime,o=lt.bufferInfo(i,s,0),u=e.duration,d=Math.min(this.config.maxFragLookUpTolerance*2,u*.25),g=Math.max(Math.min(e.start-d,o.end-d),s+d);e.start-g>d&&this.flushMainBuffer(g,e.start)}getFwdBufferInfo(e,i){var s;const o=this.getLoadPosition();if(!Ue(o))return null;const d=this.lastCurrentTime>o||(s=this.media)!=null&&s.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,o,i,d)}getFwdBufferInfoAtPos(e,i,s,o){const u=lt.bufferInfo(e,i,o);if(u.len===0&&u.nextStart!==void 0){const d=this.fragmentTracker.getBufferedFrag(i,s);if(d&&(u.nextStart<=d.end||d.gap)){const g=Math.max(Math.min(u.nextStart,d.end)-i,o);return lt.bufferInfo(e,i,g)}}return u}getMaxBufferLength(e){const{config:i}=this;let s;return e?s=Math.max(8*i.maxBufferSize/e,i.maxBufferLength):s=i.maxBufferLength,Math.min(s,i.maxMaxBufferLength)}reduceMaxBufferLength(e,i){const s=this.config,o=Math.max(Math.min(e-i,s.maxBufferLength),i),u=Math.max(e-i*3,s.maxMaxBufferLength/2,o);return u>=o?(s.maxMaxBufferLength=u,this.warn(`Reduce max buffer length to ${u}s`),!0):!1}getAppendedFrag(e,i=Be.MAIN){const s=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,i):null;return s&&"fragment"in s?s.fragment:s}getNextFragment(e,i){const s=i.fragments,o=s.length;if(!o)return null;const{config:u}=this,d=s[0].start,g=u.lowLatencyMode&&!!i.partList;let S=null;if(i.live){const b=u.initialLiveManifestSize;if(o<b)return this.warn(`Not enough fragments to start playback (have: ${o}, need: ${b})`),null;if(!i.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<d){var v;g&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),S=this.getInitialLiveFragment(i);const R=this.hls.startPosition,_=this.hls.liveSyncPosition,D=S?(R!==-1&&R>=d?R:_)||S.start:e;this.log(`Setting startPosition to ${D} to match start frag at live edge. mainStart: ${R} liveSyncPosition: ${_} frag.start: ${(v=S)==null?void 0:v.start}`),this.startPosition=this.nextLoadPosition=D}}else e<=d&&(S=s[0]);if(!S){const b=this.loadingParts?i.partEnd:i.fragmentEnd;S=this.getFragmentAtPosition(e,b,i)}let E=this.filterReplacedPrimary(S,i);if(!E&&S){const b=S.sn-i.startSN;E=this.filterReplacedPrimary(s[b+1]||null,i)}return this.mapToInitFragWhenRequired(E)}isLoopLoading(e,i){const s=this.fragmentTracker.getState(e);return(s===yi.OK||s===yi.PARTIAL&&!!e.gap)&&this.nextLoadPosition>i}getNextFragmentLoopLoading(e,i,s,o,u){let d=null;if(e.gap&&(d=this.getNextFragment(this.nextLoadPosition,i),d&&!d.gap&&s.nextStart)){const g=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,s.nextStart,o,0);if(g!==null&&s.len+g.len>=u){const S=d.sn;return this.loopSn!==S&&(this.log(`buffer full after gaps in "${o}" playlist starting at sn: ${S}`),this.loopSn=S),null}}return this.loopSn=void 0,d}get primaryPrefetch(){if(zA(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,i){if(!e)return e;if(zA(this.config)&&e.type!==Be.SUBTITLE){const s=this.hls.interstitialsManager,o=s==null?void 0:s.bufferingItem;if(o){const d=o.event;if(d){if(d.appendInPlace||Math.abs(e.start-o.start)>1||o.start===0)return null}else if(e.end<=o.start&&(i==null?void 0:i.live)===!1||e.start>o.end&&o.nextEvent&&(o.nextEvent.appendInPlace||e.start-o.end>1))return null}const u=s==null?void 0:s.playerQueue;if(u)for(let d=u.length;d--;){const g=u[d].interstitial;if(g.appendInPlace&&e.start>=g.startTime&&e.end<=g.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.initSegment:e}getNextPart(e,i,s){let o=-1,u=!1,d=!0;for(let g=0,S=e.length;g<S;g++){const v=e[g];if(d=d&&!v.independent,o>-1&&s<v.start)break;const E=v.loaded;E?o=-1:(u||(v.independent||d)&&v.fragment===i)&&(v.fragment!==i&&this.warn(`Need buffer at ${s} but next unloaded part starts at ${v.start}`),o=g),u=E}return o}loadedEndOfParts(e,i){let s;for(let o=e.length;o--;){if(s=e[o],!s.loaded)return!1;if(i>s.start)return!0}return!1}getInitialLiveFragment(e){const i=e.fragments,s=this.fragPrevious;let o=null;if(s){if(e.hasProgramDateTime&&(this.log(`Live playlist, switching playlist, load frag with same PDT: ${s.programDateTime}`),o=zC(i,s.endProgramDateTime,this.config.maxFragLookUpTolerance)),!o){const u=s.sn+1;if(u>=e.startSN&&u<=e.endSN){const d=i[u-e.startSN];s.cc===d.cc&&(o=d,this.log(`Live playlist, switching playlist, load frag with next SN: ${o.sn}`))}o||(o=Kx(e,s.cc,s.end),o&&this.log(`Live playlist, switching playlist, load frag with same CC: ${o.sn}`))}}else{const u=this.hls.liveSyncPosition;u!==null&&(o=this.getFragmentAtPosition(u,this.bitrateTest?e.fragmentEnd:e.edge,e))}return o}getFragmentAtPosition(e,i,s){const{config:o}=this;let{fragPrevious:u}=this,{fragments:d,endSN:g}=s;const{fragmentHint:S}=s,{maxFragLookUpTolerance:v}=o,E=s.partList,b=!!(this.loadingParts&&E!=null&&E.length&&S);b&&!this.bitrateTest&&E[E.length-1].fragment.sn===S.sn&&(d=d.concat(S),g=S.sn);let R;if(e<i){var _;const I=e<this.lastCurrentTime||e>i-v||(_=this.media)!=null&&_.paused||!this.startFragRequested?0:v;R=xf(u,d,e,I)}else R=d[d.length-1];if(R){const D=R.sn-s.startSN,I=this.fragmentTracker.getState(R);if((I===yi.OK||I===yi.PARTIAL&&R.gap)&&(u=R),u&&R.sn===u.sn&&(!b||E[0].fragment.sn>R.sn||!s.live)&&R.level===u.level){const w=d[D+1];R.sn<g&&this.fragmentTracker.getState(w)!==yi.OK?R=w:R=null}}return R}alignPlaylists(e,i,s){const o=e.fragments.length;if(!o)return this.warn("No fragments in live playlist"),0;const u=e.fragmentStart,d=!i,g=e.alignedSliding&&Ue(u);if(d||!g&&!u){T2(s,e);const S=e.fragmentStart;return this.log(`Live playlist sliding: ${S.toFixed(2)} start-sn: ${i?i.startSN:"na"}->${e.startSN} fragments: ${o}`),S}return u}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,i){let s=this.startPosition;s<i&&(s=-1);const o=this.timelineOffset;if(s===-1){const u=this.startTimeOffset!==null,d=u?this.startTimeOffset:e.startTimeOffset;d!==null&&Ue(d)?(s=i+d,d<0&&(s+=e.edge),s=Math.min(Math.max(i,s),i+e.totalduration),this.log(`Setting startPosition to ${s} for start time offset ${d} found in ${u?"multivariant":"media"} playlist`),this.startPosition=s):e.live?(s=this.hls.liveSyncPosition||i,this.log(`Setting startPosition to -1 to start at live edge ${s}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=s=0),this.lastCurrentTime=s+o}this.nextLoadPosition=s+o}getLoadPosition(){var e;const{media:i}=this;let s=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&i?s=i.currentTime:this.nextLoadPosition>=0&&(s=this.nextLoadPosition),s}handleFragLoadAborted(e,i){this.transmuxer&&e.type===this.playlistType&&Vn(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${i?" part "+i.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==be.FRAG_LOADING_WAITING_RETRY)&&(this.state=be.IDLE)}onFragmentOrKeyLoadError(e,i){var s;if(i.chunkMeta&&!i.frag){const w=this.getCurrentContext(i.chunkMeta);w&&(i.frag=w.frag)}const o=i.frag;if(!o||o.type!==e||!this.levels)return;if(this.fragContextChanged(o)){var u;this.warn(`Frag load error must match current frag to retry ${o.url} > ${(u=this.fragCurrent)==null?void 0:u.url}`);return}const d=i.details===re.FRAG_GAP;d&&this.fragmentTracker.fragBuffered(o,!0);const g=i.errorAction;if(!g){this.state=be.ERROR;return}const{action:S,flags:v,retryCount:E=0,retryConfig:b}=g,R=!!b,_=R&&S===Fi.RetryRequest,D=R&&!g.resolved&&v===hs.MoveAllAlternatesMatchingHost,I=(s=this.hls.latestLevelDetails)==null?void 0:s.live;if(!_&&D&&Vn(o)&&!o.endList&&I&&!Qx(i))this.resetFragmentErrors(e),this.treatAsGap(o),g.resolved=!0;else if((_||D)&&E<b.maxNumRetry){var M;const w=OT((M=i.response)==null?void 0:M.code),B=CT(b,E);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+B,this.state=be.FRAG_LOADING_WAITING_RETRY,g.resolved=!0,w){this.log("Waiting for connection (offline)"),this.retryDate=1/0,i.reason="offline";return}this.warn(`Fragment ${o.sn} of ${e} ${o.level} errored with ${i.details}, retrying loading ${E+1}/${b.maxNumRetry} in ${B}ms`)}else if(b)if(this.resetFragmentErrors(e),E<b.maxNumRetry)!d&&S!==Fi.RemoveAlternatePermanently&&(g.resolved=!0);else{this.warn(`${i.details} reached or exceeded max retry (${E})`);return}else S===Fi.SendAlternateToPenaltyBox?this.state=be.WAITING_LEVEL:this.state=be.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),i=this.retryDate,s=i===1/0;(!i||e>=i||s&&!OT(0))&&(s&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=be.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===be.PARSING||this.state===be.PARSED){const i=e.frag,s=e.parent,o=this.getFwdBufferInfo(this.mediaBuffer,s),u=o&&o.len>.5;u&&this.reduceMaxBufferLength(o.len,(i==null?void 0:i.duration)||10);const d=!u;return d&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${s} buffer`),i&&(this.fragmentTracker.removeFragment(i),this.nextLoadPosition=i.start),this.resetLoadingState(),d}return!1}resetFragmentErrors(e){e===Be.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==be.STOPPED&&(this.state=be.IDLE)}afterBufferFlushed(e,i,s){if(!e)return;const o=lt.getBuffered(e);this.fragmentTracker.detectEvictedFragments(i,o,s),this.state===be.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==be.STOPPED&&(this.state=be.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,i=e?e.details:null;i!=null&&i.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(i,i.fragmentStart),this.resetLoadingState()):this.nextLoadPosition=this.startPosition}}resetWhenMissingContext(e){this.log(`Loading context changed while buffering sn ${e.sn} of ${this.playlistLabel()} ${e.level===-1?"<removed>":e.level}. This chunk will not be buffered.`),this.removeUnbufferedFrags(),this.resetStartWhenNotLoaded(),this.resetLoadingState()}removeUnbufferedFrags(e=0){this.fragmentTracker.removeFragmentsInRange(e,1/0,this.playlistType,!1,!0)}updateLevelTiming(e,i,s,o){const u=s.details;if(!u){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((S,v)=>{const E=e.elementaryStreams[v];if(E){const b=E.endPTS-E.startPTS;if(b<=0)return this.warn(`Could not parse fragment ${e.sn} ${v} duration reliably (${b})`),S||!1;const R=o?0:DA(u,e,E.startPTS,E.endPTS,E.startDTS,E.endDTS,this);return this.hls.trigger(O.LEVEL_PTS_UPDATED,{details:u,level:s,drift:R,type:v,frag:e,start:E.startPTS,end:E.endPTS}),!0}return S},!1)){var g;const S=((g=this.transmuxer)==null?void 0:g.error)===null;if((s.fragmentError===0||S&&(s.fragmentError<2||e.endList))&&this.treatAsGap(e,s),S){const v=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(v.message),this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!1,error:v,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${s.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=be.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${i?" part: "+i.index:""} of ${this.fragInfo(e,!1,i)})`),this.hls.trigger(O.FRAG_PARSED,{frag:e,part:i})}playlistLabel(){return this.playlistType===Be.MAIN?"level":"track"}fragInfo(e,i=!0,s){var o,u;return`${this.playlistLabel()} ${e.level} (${s?"part":"frag"}:[${((o=i&&!s?e.startPTS:(s||e).start)!=null?o:NaN).toFixed(3)}-${((u=i&&!s?e.endPTS:(s||e).end)!=null?u:NaN).toFixed(3)}]${s&&e.type==="main"?"INDEPENDENT="+(s.independent?"YES":"NO"):""}`}treatAsGap(e,i){i&&i.fragmentError++,e.gap=!0,this.fragmentTracker.removeFragment(e),this.fragmentTracker.fragBuffered(e,!0)}resetTransmuxer(){var e;(e=this.transmuxer)==null||e.reset()}recoverWorkerError(e){e.event==="demuxerWorker"&&(this.fragmentTracker.removeAllFragments(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),this.resetStartWhenNotLoaded(),this.resetLoadingState())}set state(e){const i=this._state;i!==e&&(this._state=e,this.log(`${i}->${e}`))}get state(){return this._state}}function zA(h){return!!h.interstitialsController&&h.enableInterstitialPlayback!==!1}class FA{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:i}=this;let s;if(e.length)e.length===1?s=e[0]:s=x2(e,i);else return new Uint8Array(0);return this.reset(),s}reset(){this.chunks.length=0,this.dataLength=0}}function x2(h,e){const i=new Uint8Array(e);let s=0;for(let o=0;o<h.length;o++){const u=h[o];i.set(u,s),s+=u.length}return i}var HT={exports:{}},PA;function A2(){return PA||(PA=1,function(h){var e=Object.prototype.hasOwnProperty,i="~";function s(){}Object.create&&(s.prototype=Object.create(null),new s().__proto__||(i=!1));function o(S,v,E){this.fn=S,this.context=v,this.once=E||!1}function u(S,v,E,b,R){if(typeof E!="function")throw new TypeError("The listener must be a function");var _=new o(E,b||S,R),D=i?i+v:v;return S._events[D]?S._events[D].fn?S._events[D]=[S._events[D],_]:S._events[D].push(_):(S._events[D]=_,S._eventsCount++),S}function d(S,v){--S._eventsCount===0?S._events=new s:delete S._events[v]}function g(){this._events=new s,this._eventsCount=0}g.prototype.eventNames=function(){var v=[],E,b;if(this._eventsCount===0)return v;for(b in E=this._events)e.call(E,b)&&v.push(i?b.slice(1):b);return Object.getOwnPropertySymbols?v.concat(Object.getOwnPropertySymbols(E)):v},g.prototype.listeners=function(v){var E=i?i+v:v,b=this._events[E];if(!b)return[];if(b.fn)return[b.fn];for(var R=0,_=b.length,D=new Array(_);R<_;R++)D[R]=b[R].fn;return D},g.prototype.listenerCount=function(v){var E=i?i+v:v,b=this._events[E];return b?b.fn?1:b.length:0},g.prototype.emit=function(v,E,b,R,_,D){var I=i?i+v:v;if(!this._events[I])return!1;var M=this._events[I],w=arguments.length,B,z;if(M.fn){switch(M.once&&this.removeListener(v,M.fn,void 0,!0),w){case 1:return M.fn.call(M.context),!0;case 2:return M.fn.call(M.context,E),!0;case 3:return M.fn.call(M.context,E,b),!0;case 4:return M.fn.call(M.context,E,b,R),!0;case 5:return M.fn.call(M.context,E,b,R,_),!0;case 6:return M.fn.call(M.context,E,b,R,_,D),!0}for(z=1,B=new Array(w-1);z<w;z++)B[z-1]=arguments[z];M.fn.apply(M.context,B)}else{var G=M.length,K;for(z=0;z<G;z++)switch(M[z].once&&this.removeListener(v,M[z].fn,void 0,!0),w){case 1:M[z].fn.call(M[z].context);break;case 2:M[z].fn.call(M[z].context,E);break;case 3:M[z].fn.call(M[z].context,E,b);break;case 4:M[z].fn.call(M[z].context,E,b,R);break;default:if(!B)for(K=1,B=new Array(w-1);K<w;K++)B[K-1]=arguments[K];M[z].fn.apply(M[z].context,B)}}return!0},g.prototype.on=function(v,E,b){return u(this,v,E,b,!1)},g.prototype.once=function(v,E,b){return u(this,v,E,b,!0)},g.prototype.removeListener=function(v,E,b,R){var _=i?i+v:v;if(!this._events[_])return this;if(!E)return d(this,_),this;var D=this._events[_];if(D.fn)D.fn===E&&(!R||D.once)&&(!b||D.context===b)&&d(this,_);else{for(var I=0,M=[],w=D.length;I<w;I++)(D[I].fn!==E||R&&!D[I].once||b&&D[I].context!==b)&&M.push(D[I]);M.length?this._events[_]=M.length===1?M[0]:M:d(this,_)}return this},g.prototype.removeAllListeners=function(v){var E;return v?(E=i?i+v:v,this._events[E]&&d(this,E)):(this._events=new s,this._eventsCount=0),this},g.prototype.off=g.prototype.removeListener,g.prototype.addListener=g.prototype.on,g.prefixed=i,g.EventEmitter=g,h.exports=g}(HT)),HT.exports}var R2=A2(),jT=Q_(R2);const n0="1.6.15",Eh={};function D2(){return typeof __HLS_WORKER_BUNDLE__=="function"}function L2(){const h=Eh[n0];if(h)return h.clientCount++,h;const e=new self.Blob([`var exports={};var module={exports:exports};function define(f){f()};define.amd=true;(${__HLS_WORKER_BUNDLE__.toString()})(true);`],{type:"text/javascript"}),i=self.URL.createObjectURL(e),o={worker:new self.Worker(i),objectURL:i,clientCount:1};return Eh[n0]=o,o}function _2(h){const e=Eh[h];if(e)return e.clientCount++,e;const i=new self.URL(h,self.location.href).href,o={worker:new self.Worker(i),scriptURL:i,clientCount:1};return Eh[h]=o,o}function C2(h){const e=Eh[h||n0];if(e&&e.clientCount--===1){const{worker:s,objectURL:o}=e;delete Eh[h||n0],o&&self.URL.revokeObjectURL(o),s.terminate()}}function GA(h,e){return e+10<=h.length&&h[e]===51&&h[e+1]===68&&h[e+2]===73&&h[e+3]<255&&h[e+4]<255&&h[e+6]<128&&h[e+7]<128&&h[e+8]<128&&h[e+9]<128}function VT(h,e){return e+10<=h.length&&h[e]===73&&h[e+1]===68&&h[e+2]===51&&h[e+3]<255&&h[e+4]<255&&h[e+6]<128&&h[e+7]<128&&h[e+8]<128&&h[e+9]<128}function bv(h,e){let i=0;return i=(h[e]&127)<<21,i|=(h[e+1]&127)<<14,i|=(h[e+2]&127)<<7,i|=h[e+3]&127,i}function i0(h,e){const i=e;let s=0;for(;VT(h,e);){s+=10;const o=bv(h,e+6);s+=o,GA(h,e+10)&&(s+=10),e+=s}if(s>0)return h.subarray(i,i+s)}function O2(h,e,i,s){const o=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],u=e[i+2],d=u>>2&15;if(d>12){const _=new Error(`invalid ADTS sampling index:${d}`);h.emit(O.ERROR,O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!0,error:_,reason:_.message});return}const g=(u>>6&3)+1,S=e[i+3]>>6&3|(u&1)<<2,v="mp4a.40."+g,E=o[d];let b=d;(g===5||g===29)&&(b-=3);const R=[g<<3|(b&14)>>1,(b&1)<<7|S<<3];return Zt.log(`manifest codec:${s}, parsed codec:${v}, channels:${S}, rate:${E} (ADTS object type:${g} sampling index:${d})`),{config:R,samplerate:E,channelCount:S,codec:v,parsedCodec:v,manifestCodec:s}}function $A(h,e){return h[e]===255&&(h[e+1]&246)===240}function HA(h,e){return h[e+1]&1?7:9}function YT(h,e){return(h[e+3]&3)<<11|h[e+4]<<3|(h[e+5]&224)>>>5}function M2(h,e){return e+5<h.length}function xv(h,e){return e+1<h.length&&$A(h,e)}function I2(h,e){return M2(h,e)&&$A(h,e)&&YT(h,e)<=h.length-e}function w2(h,e){if(xv(h,e)){const i=HA(h,e);if(e+i>=h.length)return!1;const s=YT(h,e);if(s<=i)return!1;const o=e+s;return o===h.length||xv(h,o)}return!1}function jA(h,e,i,s,o){if(!h.samplerate){const u=O2(e,i,s,o);if(!u)return;Jt(h,u)}}function VA(h){return 1024*9e4/h}function N2(h,e){const i=HA(h,e);if(e+i<=h.length){const s=YT(h,e)-i;if(s>0)return{headerLength:i,frameLength:s}}}function YA(h,e,i,s,o){const u=VA(h.samplerate),d=s+o*u,g=N2(e,i);let S;if(g){const{frameLength:b,headerLength:R}=g,_=R+b,D=Math.max(0,i+_-e.length);D?(S=new Uint8Array(_-R),S.set(e.subarray(i+R,e.length),0)):S=e.subarray(i+R,i+_);const I={unit:S,pts:d};return D||h.samples.push(I),{sample:I,length:_,missing:D}}const v=e.length-i;return S=new Uint8Array(v),S.set(e.subarray(i,e.length),0),{sample:{unit:S,pts:d},length:v,missing:-1}}function U2(h,e){return VT(h,e)&&bv(h,e+6)+10<=h.length-e}function k2(h){return h instanceof ArrayBuffer?h:h.byteOffset==0&&h.byteLength==h.buffer.byteLength?h.buffer:new Uint8Array(h).buffer}function qT(h,e=0,i=1/0){return B2(h,e,i,Uint8Array)}function B2(h,e,i,s){const o=z2(h);let u=1;"BYTES_PER_ELEMENT"in s&&(u=s.BYTES_PER_ELEMENT);const d=F2(h)?h.byteOffset:0,g=(d+h.byteLength)/u,S=(d+e)/u,v=Math.floor(Math.max(0,Math.min(S,g))),E=Math.floor(Math.min(v+Math.max(i,0),g));return new s(o,v,E-v)}function z2(h){return h instanceof ArrayBuffer?h:h.buffer}function F2(h){return h&&h.buffer instanceof ArrayBuffer&&h.byteLength!==void 0&&h.byteOffset!==void 0}function P2(h){const e={key:h.type,description:"",data:"",mimeType:null,pictureType:null},i=3;if(h.size<2)return;if(h.data[0]!==i){console.log("Ignore frame with unrecognized character encoding");return}const s=h.data.subarray(1).indexOf(0);if(s===-1)return;const o=ds(qT(h.data,1,s)),u=h.data[2+s],d=h.data.subarray(3+s).indexOf(0);if(d===-1)return;const g=ds(qT(h.data,3+s,d));let S;return o==="-->"?S=ds(qT(h.data,4+s+d)):S=k2(h.data.subarray(4+s+d)),e.mimeType=o,e.pictureType=u,e.description=g,e.data=S,e}function G2(h){if(h.size<2)return;const e=ds(h.data,!0),i=new Uint8Array(h.data.subarray(e.length+1));return{key:h.type,info:e,data:i.buffer}}function $2(h){if(h.size<2)return;if(h.type==="TXXX"){let i=1;const s=ds(h.data.subarray(i),!0);i+=s.length+1;const o=ds(h.data.subarray(i));return{key:h.type,info:s,data:o}}const e=ds(h.data.subarray(1));return{key:h.type,info:"",data:e}}function H2(h){if(h.type==="WXXX"){if(h.size<2)return;let i=1;const s=ds(h.data.subarray(i),!0);i+=s.length+1;const o=ds(h.data.subarray(i));return{key:h.type,info:s,data:o}}const e=ds(h.data);return{key:h.type,info:"",data:e}}function j2(h){return h.type==="PRIV"?G2(h):h.type[0]==="W"?H2(h):h.type==="APIC"?P2(h):$2(h)}function V2(h){const e=String.fromCharCode(h[0],h[1],h[2],h[3]),i=bv(h,4),s=10;return{type:e,size:i,data:h.subarray(s,s+i)}}const Av=10,Y2=10;function qA(h){let e=0;const i=[];for(;VT(h,e);){const s=bv(h,e+6);h[e+5]>>6&1&&(e+=Av),e+=Av;const o=e+s;for(;e+Y2<o;){const u=V2(h.subarray(e)),d=j2(u);d&&i.push(d),e+=u.size+Av}GA(h,e)&&(e+=Av)}return i}function KA(h){return h&&h.key==="PRIV"&&h.info==="com.apple.streaming.transportStreamTimestamp"}function q2(h){if(h.data.byteLength===8){const e=new Uint8Array(h.data),i=e[3]&1;let s=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return s/=45,i&&(s+=4772185884e-2),Math.round(s)}}function KT(h){const e=qA(h);for(let i=0;i<e.length;i++){const s=e[i];if(KA(s))return q2(s)}}let ms=function(h){return h.audioId3="org.id3",h.dateRange="com.apple.quicktime.HLS",h.emsg="https://aomedia.org/emsg/ID3",h.misbklv="urn:misb:KLV:bin:1910.1",h}({});function Rr(h="",e=9e4){return{type:h,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class XT{constructor(){this._audioTrack=void 0,this._id3Track=void 0,this.frameIndex=0,this.cachedData=null,this.basePTS=null,this.initPTS=null,this.lastPTS=null}resetInitSegment(e,i,s,o){this._id3Track={type:"id3",id:3,pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0}}resetTimeStamp(e){this.initPTS=e,this.resetContiguity()}resetContiguity(){this.basePTS=null,this.lastPTS=null,this.frameIndex=0}canParse(e,i){return!1}appendFrame(e,i,s){}demux(e,i){this.cachedData&&(e=Qs(this.cachedData,e),this.cachedData=null);let s=i0(e,0),o=s?s.length:0,u;const d=this._audioTrack,g=this._id3Track,S=s?KT(s):void 0,v=e.length;for((this.basePTS===null||this.frameIndex===0&&Ue(S))&&(this.basePTS=K2(S,i,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),s&&s.length>0&&g.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ms.audioId3,duration:Number.POSITIVE_INFINITY});o<v;){if(this.canParse(e,o)){const E=this.appendFrame(d,e,o);E?(this.frameIndex++,this.lastPTS=E.sample.pts,o+=E.length,u=o):o=v}else U2(e,o)?(s=i0(e,o),g.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:s,type:ms.audioId3,duration:Number.POSITIVE_INFINITY}),o+=s.length,u=o):o++;if(o===v&&u!==v){const E=e.slice(u);this.cachedData?this.cachedData=Qs(this.cachedData,E):this.cachedData=E}}return{audioTrack:d,videoTrack:Rr(),id3Track:g,textTrack:Rr()}}demuxSampleAes(e,i,s){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const i=this.cachedData;return i&&(this.cachedData=null,this.demux(i,0)),{audioTrack:this._audioTrack,videoTrack:Rr(),id3Track:this._id3Track,textTrack:Rr()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const K2=(h,e,i)=>{if(Ue(h))return h*90;const s=i?i.baseTime*9e4/i.timescale:0;return e*9e4+s};let Rv=null;const X2=[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],Q2=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],Z2=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],J2=[0,1,1,4];function XA(h,e,i,s,o){if(i+24>e.length)return;const u=QA(e,i);if(u&&i+u.frameLength<=e.length){const d=u.samplesPerFrame*9e4/u.sampleRate,g=s+o*d,S={unit:e.subarray(i,i+u.frameLength),pts:g,dts:g};return h.config=[],h.channelCount=u.channelCount,h.samplerate=u.sampleRate,h.samples.push(S),{sample:S,length:u.frameLength,missing:0}}}function QA(h,e){const i=h[e+1]>>3&3,s=h[e+1]>>1&3,o=h[e+2]>>4&15,u=h[e+2]>>2&3;if(i!==1&&o!==0&&o!==15&&u!==3){const d=h[e+2]>>1&1,g=h[e+3]>>6,S=i===3?3-s:s===3?3:4,v=X2[S*14+o-1]*1e3,b=Q2[(i===3?0:i===2?1:2)*3+u],R=g===3?1:2,_=Z2[i][s],D=J2[s],I=_*8*D,M=Math.floor(_*v/b+d)*D;if(Rv===null){const z=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Rv=z?parseInt(z[1]):0}return!!Rv&&Rv<=87&&s===2&&v>=224e3&&g===0&&(h[e+3]=h[e+3]|128),{sampleRate:b,channelCount:R,frameLength:M,samplesPerFrame:I}}}function QT(h,e){return h[e]===255&&(h[e+1]&224)===224&&(h[e+1]&6)!==0}function ZA(h,e){return e+1<h.length&&QT(h,e)}function W2(h,e){return QT(h,e)&&4<=h.length-e}function JA(h,e){if(e+1<h.length&&QT(h,e)){const s=QA(h,e);let o=4;s!=null&&s.frameLength&&(o=s.frameLength);const u=e+o;return u===h.length||ZA(h,u)}return!1}class eO extends XT{constructor(e,i){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=i}resetInitSegment(e,i,s,o){super.resetInitSegment(e,i,s,o),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}static probe(e,i){if(!e)return!1;const s=i0(e,0);let o=(s==null?void 0:s.length)||0;if(JA(e,o))return!1;for(let u=e.length;o<u;o++)if(w2(e,o))return i.log("ADTS sync word found !"),!0;return!1}canParse(e,i){return I2(e,i)}appendFrame(e,i,s){jA(e,this.observer,i,s,e.manifestCodec);const o=YA(e,i,s,this.basePTS,this.frameIndex);if(o&&o.missing===0)return o}}const WA=(h,e)=>{let i=0,s=5;e+=s;const o=new Uint32Array(1),u=new Uint32Array(1),d=new Uint8Array(1);for(;s>0;){d[0]=h[e];const g=Math.min(s,8),S=8-g;u[0]=4278190080>>>24+S<<S,o[0]=(d[0]&u[0])>>S,i=i?i<<g|o[0]:o[0],e+=1,s-=g}return i};class tO extends XT{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,i,s,o){super.resetInitSegment(e,i,s,o),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}canParse(e,i){return i+64<e.length}appendFrame(e,i,s){const o=eR(e,i,s,this.basePTS,this.frameIndex);if(o!==-1)return{sample:e.samples[e.samples.length-1],length:o,missing:0}}static probe(e){if(!e)return!1;const i=i0(e,0);if(!i)return!1;const s=i.length;return e[s]===11&&e[s+1]===119&&KT(i)!==void 0&&WA(e,s)<16}}function eR(h,e,i,s,o){if(i+8>e.length||e[i]!==11||e[i+1]!==119)return-1;const u=e[i+4]>>6;if(u>=3)return-1;const g=[48e3,44100,32e3][u],S=e[i+4]&63,E=[64,69,96,64,70,96,80,87,120,80,88,120,96,104,144,96,105,144,112,121,168,112,122,168,128,139,192,128,140,192,160,174,240,160,175,240,192,208,288,192,209,288,224,243,336,224,244,336,256,278,384,256,279,384,320,348,480,320,349,480,384,417,576,384,418,576,448,487,672,448,488,672,512,557,768,512,558,768,640,696,960,640,697,960,768,835,1152,768,836,1152,896,975,1344,896,976,1344,1024,1114,1536,1024,1115,1536,1152,1253,1728,1152,1254,1728,1280,1393,1920,1280,1394,1920][S*3+u]*2;if(i+E>e.length)return-1;const b=e[i+6]>>5;let R=0;b===2?R+=2:(b&1&&b!==1&&(R+=2),b&4&&(R+=2));const _=(e[i+6]<<8|e[i+7])>>12-R&1,I=[2,1,2,3,3,4,4,5][b]+_,M=e[i+5]>>3,w=e[i+5]&7,B=new Uint8Array([u<<6|M<<1|w>>2,(w&3)<<6|b<<3|_<<2|S>>4,S<<4&224]),z=1536/g*9e4,G=s+o*z,K=e.subarray(i,i+E);return h.config=B,h.channelCount=I,h.samplerate=g,h.samples.push({unit:K,pts:G}),E}class nO extends XT{resetInitSegment(e,i,s,o){super.resetInitSegment(e,i,s,o),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:i,duration:o,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const i=i0(e,0);let s=(i==null?void 0:i.length)||0;if(i&&e[s]===11&&e[s+1]===119&&KT(i)!==void 0&&WA(e,s)<=16)return!1;for(let o=e.length;s<o;s++)if(JA(e,s))return Zt.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,i){return W2(e,i)}appendFrame(e,i,s){if(this.basePTS!==null)return XA(e,i,s,this.basePTS,this.frameIndex)}}const iO=/\/emsg[-/]ID3/i;class aO{constructor(e,i){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=i}resetTimeStamp(){}resetInitSegment(e,i,s,o){const u=this.videoTrack=Rr("video",1),d=this.audioTrack=Rr("audio",1),g=this.txtTrack=Rr("text",1);if(this.id3Track=Rr("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const S=Lx(e);if(S.video){const{id:v,timescale:E,codec:b,supplemental:R}=S.video;u.id=v,u.timescale=g.timescale=E,u.codec=b,u.supplemental=R}if(S.audio){const{id:v,timescale:E,codec:b}=S.audio;d.id=v,d.timescale=E,d.codec=b}g.id=xx.text,u.sampleDuration=0,u.duration=d.duration=o}resetContiguity(){this.remainderData=null}static probe(e){return tC(e)}demux(e,i){this.timeOffset=i;let s=e;const o=this.videoTrack,u=this.txtTrack;if(this.config.progressive){this.remainderData&&(s=Qs(this.remainderData,e));const g=oC(s);this.remainderData=g.remainder,o.samples=g.valid||new Uint8Array}else o.samples=s;const d=this.extractID3Track(o,i);return u.samples=Ox(i,o),{videoTrack:o,audioTrack:this.audioTrack,id3Track:d,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,i=this.videoTrack,s=this.txtTrack;i.samples=this.remainderData||new Uint8Array,this.remainderData=null;const o=this.extractID3Track(i,this.timeOffset);return s.samples=Ox(e,i),{videoTrack:i,audioTrack:Rr(),id3Track:o,textTrack:Rr()}}extractID3Track(e,i){const s=this.id3Track;if(e.samples.length){const o=Et(e.samples,["emsg"]);o&&o.forEach(u=>{const d=cC(u);if(iO.test(d.schemeIdUri)){const g=tR(d,i);let S=d.eventDuration===4294967295?Number.POSITIVE_INFINITY:d.eventDuration/d.timeScale;S<=.001&&(S=Number.POSITIVE_INFINITY);const v=d.payload;s.samples.push({data:v,len:v.byteLength,dts:g,pts:g,type:ms.emsg,duration:S})}else if(this.config.enableEmsgKLVMetadata&&d.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const g=tR(d,i);s.samples.push({data:d.payload,len:d.payload.byteLength,dts:g,pts:g,type:ms.misbklv,duration:Number.POSITIVE_INFINITY})}})}return s}demuxSampleAes(e,i,s){return Promise.reject(new Error("The MP4 demuxer does not support SAMPLE-AES decryption"))}destroy(){this.config=null,this.remainderData=null,this.videoTrack=this.audioTrack=this.id3Track=this.txtTrack=void 0}}function tR(h,e){return Ue(h.presentationTime)?h.presentationTime/h.timeScale:e+h.presentationTimeDelta/h.timeScale}class sO{constructor(e,i,s){this.keyData=void 0,this.decrypter=void 0,this.keyData=s,this.decrypter=new MT(i,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,Uu.cbc)}decryptAacSample(e,i,s){const o=e[i].unit;if(o.length<=16)return;const u=o.subarray(16,o.length-o.length%16),d=u.buffer.slice(u.byteOffset,u.byteOffset+u.length);this.decryptBuffer(d).then(g=>{const S=new Uint8Array(g);o.set(S,16),this.decrypter.isSync()||this.decryptAacSamples(e,i+1,s)}).catch(s)}decryptAacSamples(e,i,s){for(;;i++){if(i>=e.length){s();return}if(!(e[i].unit.length<32)&&(this.decryptAacSample(e,i,s),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const i=Math.floor((e.length-48)/160)*16+16,s=new Int8Array(i);let o=0;for(let u=32;u<e.length-16;u+=160,o+=16)s.set(e.subarray(u,u+16),o);return s}getAvcDecryptedUnit(e,i){const s=new Uint8Array(i);let o=0;for(let u=32;u<e.length-16;u+=160,o+=16)e.set(s.subarray(o,o+16),u);return e}decryptAvcSample(e,i,s,o,u){const d=Mx(u.data),g=this.getAvcEncryptedData(d);this.decryptBuffer(g.buffer).then(S=>{u.data=this.getAvcDecryptedUnit(d,S),this.decrypter.isSync()||this.decryptAvcSamples(e,i,s+1,o)}).catch(o)}decryptAvcSamples(e,i,s,o){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;i++,s=0){if(i>=e.length){o();return}const u=e[i].units;for(;!(s>=u.length);s++){const d=u[s];if(!(d.data.length<=48||d.type!==1&&d.type!==5)&&(this.decryptAvcSample(e,i,s,o,d),!this.decrypter.isSync()))return}}}}class nR{constructor(){this.VideoSample=null}createVideoSample(e,i,s){return{key:e,frame:!1,pts:i,dts:s,units:[],length:0}}getLastNalUnit(e){var i;let s=this.VideoSample,o;if((!s||s.units.length===0)&&(s=e[e.length-1]),(i=s)!=null&&i.units){const u=s.units;o=u[u.length-1]}return o}pushAccessUnit(e,i){if(e.units.length&&e.frame){if(e.pts===void 0){const s=i.samples,o=s.length;if(o){const u=s[o-1];e.pts=u.pts,e.dts=u.dts}else{i.dropped++;return}}i.samples.push(e)}}parseNALu(e,i,s){const o=i.byteLength;let u=e.naluState||0;const d=u,g=[];let S=0,v,E,b,R=-1,_=0;for(u===-1&&(R=0,_=this.getNALuType(i,0),u=0,S=1);S<o;){if(v=i[S++],!u){u=v?0:1;continue}if(u===1){u=v?0:2;continue}if(!v)u=3;else if(v===1){if(E=S-u-1,R>=0){const D={data:i.subarray(R,E),type:_};g.push(D)}else{const D=this.getLastNalUnit(e.samples);D&&(d&&S<=4-d&&D.state&&(D.data=D.data.subarray(0,D.data.byteLength-d)),E>0&&(D.data=Qs(D.data,i.subarray(0,E)),D.state=0))}S<o?(b=this.getNALuType(i,S),R=S,_=b,u=0):u=-1}else u=0}if(R>=0&&u>=0){const D={data:i.subarray(R,o),type:_,state:u};g.push(D)}if(g.length===0){const D=this.getLastNalUnit(e.samples);D&&(D.data=Qs(D.data,i))}return e.naluState=u,g}}class a0{constructor(e){this.data=void 0,this.bytesAvailable=void 0,this.word=void 0,this.bitsAvailable=void 0,this.data=e,this.bytesAvailable=e.byteLength,this.word=0,this.bitsAvailable=0}loadWord(){const e=this.data,i=this.bytesAvailable,s=e.byteLength-i,o=new Uint8Array(4),u=Math.min(4,i);if(u===0)throw new Error("no bytes available");o.set(e.subarray(s,s+u)),this.word=new DataView(o.buffer).getUint32(0),this.bitsAvailable=u*8,this.bytesAvailable-=u}skipBits(e){let i;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,i=e>>3,e-=i<<3,this.bytesAvailable-=i,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let i=Math.min(this.bitsAvailable,e);const s=this.word>>>32-i;if(e>32&&Zt.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=i,this.bitsAvailable>0)this.word<<=i;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return i=e-i,i>0&&this.bitsAvailable?s<<i|this.readBits(i):s}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if(this.word&2147483648>>>e)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}skipUEG(){this.skipBits(1+this.skipLZ())}skipEG(){this.skipBits(1+this.skipLZ())}readUEG(){const e=this.skipLZ();return this.readBits(e+1)-1}readEG(){const e=this.readUEG();return 1&e?1+e>>>1:-1*(e>>>1)}readBoolean(){return this.readBits(1)===1}readUByte(){return this.readBits(8)}readUShort(){return this.readBits(16)}readUInt(){return this.readBits(32)}}class lO extends nR{parsePES(e,i,s,o){const u=this.parseNALu(e,s.data,o);let d=this.VideoSample,g,S=!1;s.data=null,d&&u.length&&!e.audFound&&(this.pushAccessUnit(d,e),d=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),u.forEach(v=>{var E,b;switch(v.type){case 1:{let I=!1;g=!0;const M=v.data;if(S&&M.length>4){const w=this.readSliceType(M);(w===2||w===4||w===7||w===9)&&(I=!0)}if(I){var R;(R=d)!=null&&R.frame&&!d.key&&(this.pushAccessUnit(d,e),d=this.VideoSample=null)}d||(d=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),d.frame=!0,d.key=I;break}case 5:g=!0,(E=d)!=null&&E.frame&&!d.key&&(this.pushAccessUnit(d,e),d=this.VideoSample=null),d||(d=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),d.key=!0,d.frame=!0;break;case 6:{g=!0,xT(v.data,1,s.pts,i.samples);break}case 7:{var _,D;g=!0,S=!0;const I=v.data,M=this.readSPS(I);if(!e.sps||e.width!==M.width||e.height!==M.height||((_=e.pixelRatio)==null?void 0:_[0])!==M.pixelRatio[0]||((D=e.pixelRatio)==null?void 0:D[1])!==M.pixelRatio[1]){e.width=M.width,e.height=M.height,e.pixelRatio=M.pixelRatio,e.sps=[I];const w=I.subarray(1,4);let B="avc1.";for(let z=0;z<3;z++){let G=w[z].toString(16);G.length<2&&(G="0"+G),B+=G}e.codec=B}break}case 8:g=!0,e.pps=[v.data];break;case 9:g=!0,e.audFound=!0,(b=d)!=null&&b.frame&&(this.pushAccessUnit(d,e),d=null),d||(d=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;case 12:g=!0;break;default:g=!1;break}d&&g&&d.units.push(v)}),o&&d&&(this.pushAccessUnit(d,e),this.VideoSample=null)}getNALuType(e,i){return e[i]&31}readSliceType(e){const i=new a0(e);return i.readUByte(),i.readUEG(),i.readUEG()}skipScalingList(e,i){let s=8,o=8,u;for(let d=0;d<e;d++)o!==0&&(u=i.readEG(),o=(s+u+256)%256),s=o===0?s:o}readSPS(e){const i=new a0(e);let s=0,o=0,u=0,d=0,g,S,v;const E=i.readUByte.bind(i),b=i.readBits.bind(i),R=i.readUEG.bind(i),_=i.readBoolean.bind(i),D=i.skipBits.bind(i),I=i.skipEG.bind(i),M=i.skipUEG.bind(i),w=this.skipScalingList.bind(this);E();const B=E();if(b(5),D(3),E(),M(),B===100||B===110||B===122||B===244||B===44||B===83||B===86||B===118||B===128){const Z=R();if(Z===3&&D(1),M(),M(),D(1),_())for(S=Z!==3?8:12,v=0;v<S;v++)_()&&(v<6?w(16,i):w(64,i))}M();const z=R();if(z===0)R();else if(z===1)for(D(1),I(),I(),g=R(),v=0;v<g;v++)I();M(),D(1);const G=R(),K=R(),ae=b(1);ae===0&&D(1),D(1),_()&&(s=R(),o=R(),u=R(),d=R());let q=[1,1];if(_()&&_())switch(E()){case 1:q=[1,1];break;case 2:q=[12,11];break;case 3:q=[10,11];break;case 4:q=[16,11];break;case 5:q=[40,33];break;case 6:q=[24,11];break;case 7:q=[20,11];break;case 8:q=[32,11];break;case 9:q=[80,33];break;case 10:q=[18,11];break;case 11:q=[15,11];break;case 12:q=[64,33];break;case 13:q=[160,99];break;case 14:q=[4,3];break;case 15:q=[3,2];break;case 16:q=[2,1];break;case 255:{q=[E()<<8|E(),E()<<8|E()];break}}return{width:Math.ceil((G+1)*16-s*2-o*2),height:(2-ae)*(K+1)*16-(ae?2:4)*(u+d),pixelRatio:q}}}class rO extends nR{constructor(...e){super(...e),this.initVPS=null}parsePES(e,i,s,o){const u=this.parseNALu(e,s.data,o);let d=this.VideoSample,g,S=!1;s.data=null,d&&u.length&&!e.audFound&&(this.pushAccessUnit(d,e),d=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),u.forEach(v=>{var E,b;switch(v.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:d||(d=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts)),d.frame=!0,g=!0;break;case 16:case 17:case 18:case 21:if(g=!0,S){var R;(R=d)!=null&&R.frame&&!d.key&&(this.pushAccessUnit(d,e),d=this.VideoSample=null)}d||(d=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),d.key=!0,d.frame=!0;break;case 19:case 20:g=!0,(E=d)!=null&&E.frame&&!d.key&&(this.pushAccessUnit(d,e),d=this.VideoSample=null),d||(d=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),d.key=!0,d.frame=!0;break;case 39:g=!0,xT(v.data,2,s.pts,i.samples);break;case 32:g=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=Jt(e.params,this.readVPS(v.data)),this.initVPS=v.data),e.vps=[v.data];break;case 33:if(g=!0,S=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],v.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const _=this.readSPS(v.data);e.width=_.width,e.height=_.height,e.pixelRatio=_.pixelRatio,e.codec=_.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const D in _.params)e.params[D]=_.params[D]}this.pushParameterSet(e.sps,v.data,e.vps),d||(d=this.VideoSample=this.createVideoSample(!0,s.pts,s.dts)),d.key=!0;break;case 34:if(g=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const _=this.readPPS(v.data);for(const D in _)e.params[D]=_[D]}this.pushParameterSet(e.pps,v.data,e.vps)}break;case 35:g=!0,e.audFound=!0,(b=d)!=null&&b.frame&&(this.pushAccessUnit(d,e),d=null),d||(d=this.VideoSample=this.createVideoSample(!1,s.pts,s.dts));break;default:g=!1;break}d&&g&&d.units.push(v)}),o&&d&&(this.pushAccessUnit(d,e),this.VideoSample=null)}pushParameterSet(e,i,s){(s&&s[0]===this.initVPS||!s&&!e.length)&&e.push(i)}getNALuType(e,i){return(e[i]&126)>>>1}ebsp2rbsp(e){const i=new Uint8Array(e.byteLength);let s=0;for(let o=0;o<e.byteLength;o++)o>=2&&e[o]===3&&e[o-1]===0&&e[o-2]===0||(i[s]=e[o],s++);return new Uint8Array(i.buffer,0,s)}pushAccessUnit(e,i){super.pushAccessUnit(e,i),this.initVPS&&(this.initVPS=null)}readVPS(e){const i=new a0(e);i.readUByte(),i.readUByte(),i.readBits(4),i.skipBits(2),i.readBits(6);const s=i.readBits(3),o=i.readBoolean();return{numTemporalLayers:s+1,temporalIdNested:o}}readSPS(e){const i=new a0(this.ebsp2rbsp(e));i.readUByte(),i.readUByte(),i.readBits(4);const s=i.readBits(3);i.readBoolean();const o=i.readBits(2),u=i.readBoolean(),d=i.readBits(5),g=i.readUByte(),S=i.readUByte(),v=i.readUByte(),E=i.readUByte(),b=i.readUByte(),R=i.readUByte(),_=i.readUByte(),D=i.readUByte(),I=i.readUByte(),M=i.readUByte(),w=i.readUByte(),B=[],z=[];for(let Pe=0;Pe<s;Pe++)B.push(i.readBoolean()),z.push(i.readBoolean());if(s>0)for(let Pe=s;Pe<8;Pe++)i.readBits(2);for(let Pe=0;Pe<s;Pe++)B[Pe]&&(i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte(),i.readUByte()),z[Pe]&&i.readUByte();i.readUEG();const G=i.readUEG();G==3&&i.skipBits(1);const K=i.readUEG(),ae=i.readUEG(),q=i.readBoolean();let Z=0,te=0,$=0,me=0;q&&(Z+=i.readUEG(),te+=i.readUEG(),$+=i.readUEG(),me+=i.readUEG());const Ee=i.readUEG(),De=i.readUEG(),Ie=i.readUEG(),Oe=i.readBoolean();for(let Pe=Oe?0:s;Pe<=s;Pe++)i.skipUEG(),i.skipUEG(),i.skipUEG();if(i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG(),i.readBoolean()&&i.readBoolean())for(let cn=0;cn<4;cn++)for(let zn=0;zn<(cn===3?2:6);zn++)if(!i.readBoolean())i.readUEG();else{const ut=Math.min(64,1<<4+(cn<<1));cn>1&&i.readEG();for(let Va=0;Va<ut;Va++)i.readEG()}i.readBoolean(),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.skipUEG(),i.skipUEG(),i.readBoolean());const le=i.readUEG();let xe=0;for(let Pe=0;Pe<le;Pe++){let cn=!1;if(Pe!==0&&(cn=i.readBoolean()),cn){Pe===le&&i.readUEG(),i.readBoolean(),i.readUEG();let zn=0;for(let la=0;la<=xe;la++){const ut=i.readBoolean();let Va=!1;ut||(Va=i.readBoolean()),(ut||Va)&&zn++}xe=zn}else{const zn=i.readUEG(),la=i.readUEG();xe=zn+la;for(let ut=0;ut<zn;ut++)i.readUEG(),i.readBoolean();for(let ut=0;ut<la;ut++)i.readUEG(),i.readBoolean()}}if(i.readBoolean()){const Pe=i.readUEG();for(let cn=0;cn<Pe;cn++){for(let zn=0;zn<Ie+4;zn++)i.readBits(1);i.readBits(1)}}let Q=0,de=1,Le=1,Ce=!0,Fe=1,Ve=0;i.readBoolean(),i.readBoolean();let at=!1;if(i.readBoolean()){if(i.readBoolean()){const Fn=i.readUByte(),jl=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],fn=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Fn>0&&Fn<16?(de=jl[Fn-1],Le=fn[Fn-1]):Fn===255&&(de=i.readBits(16),Le=i.readBits(16))}if(i.readBoolean()&&i.readBoolean(),i.readBoolean()&&(i.readBits(3),i.readBoolean(),i.readBoolean()&&(i.readUByte(),i.readUByte(),i.readUByte())),i.readBoolean()&&(i.readUEG(),i.readUEG()),i.readBoolean(),i.readBoolean(),i.readBoolean(),at=i.readBoolean(),at&&(i.skipUEG(),i.skipUEG(),i.skipUEG(),i.skipUEG()),i.readBoolean()&&(Fe=i.readBits(32),Ve=i.readBits(32),i.readBoolean()&&i.readUEG(),i.readBoolean())){const fn=i.readBoolean(),To=i.readBoolean();let Ya=!1;(fn||To)&&(Ya=i.readBoolean(),Ya&&(i.readUByte(),i.readBits(5),i.readBoolean(),i.readBits(5)),i.readBits(4),i.readBits(4),Ya&&i.readBits(4),i.readBits(5),i.readBits(5),i.readBits(5));for(let Vl=0;Vl<=s;Vl++){Ce=i.readBoolean();const Pn=Ce||i.readBoolean();let qa=!1;Pn?i.readEG():qa=i.readBoolean();const bo=qa?1:i.readUEG()+1;if(fn)for(let _i=0;_i<bo;_i++)i.readUEG(),i.readUEG(),Ya&&(i.readUEG(),i.readUEG()),i.skipBits(1);if(To)for(let _i=0;_i<bo;_i++)i.readUEG(),i.readUEG(),Ya&&(i.readUEG(),i.readUEG()),i.skipBits(1)}}i.readBoolean()&&(i.readBoolean(),i.readBoolean(),i.readBoolean(),Q=i.readUEG())}let kt=K,vi=ae;if(q){let Pe=1,cn=1;G===1?Pe=cn=2:G==2&&(Pe=2),kt=K-Pe*te-Pe*Z,vi=ae-cn*me-cn*$}const we=o?["A","B","C"][o]:"",ya=g<<24|S<<16|v<<8|E;let Gi=0;for(let Pe=0;Pe<32;Pe++)Gi=(Gi|(ya>>Pe&1)<<31-Pe)>>>0;let ei=Gi.toString(16);return d===1&&ei==="2"&&(ei="6"),{codecString:`hvc1.${we}${d}.${ei}.${u?"H":"L"}${w}.B0`,params:{general_tier_flag:u,general_profile_idc:d,general_profile_space:o,general_profile_compatibility_flags:[g,S,v,E],general_constraint_indicator_flags:[b,R,_,D,I,M],general_level_idc:w,bit_depth:Ee+8,bit_depth_luma_minus8:Ee,bit_depth_chroma_minus8:De,min_spatial_segmentation_idc:Q,chroma_format_idc:G,frame_rate:{fixed:Ce,fps:Ve/Fe}},width:kt,height:vi,pixelRatio:[de,Le]}}readPPS(e){const i=new a0(this.ebsp2rbsp(e));i.readUByte(),i.readUByte(),i.skipUEG(),i.skipUEG(),i.skipBits(2),i.skipBits(3),i.skipBits(2),i.skipUEG(),i.skipUEG(),i.skipEG(),i.skipBits(2),i.readBoolean()&&i.skipUEG(),i.skipEG(),i.skipEG(),i.skipBits(4);const o=i.readBoolean(),u=i.readBoolean();let d=1;return u&&o?d=0:u?d=3:o&&(d=2),{parallelismType:d}}matchSPS(e,i){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,i).substr(3)}}const Di=188;class Bu{constructor(e,i,s,o){this.logger=void 0,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._pmtId=-1,this._videoTrack=void 0,this._audioTrack=void 0,this._id3Track=void 0,this._txtTrack=void 0,this.aacOverFlow=null,this.remainderData=null,this.videoParser=void 0,this.observer=e,this.config=i,this.typeSupported=s,this.logger=o,this.videoParser=null}static probe(e,i){const s=Bu.syncOffset(e);return s>0&&i.warn(`MPEG2-TS detected but first sync word found @ offset ${s}`),s!==-1}static syncOffset(e){const i=e.length;let s=Math.min(Di*5,i-Di)+1,o=0;for(;o<s;){let u=!1,d=-1,g=0;for(let S=o;S<i;S+=Di)if(e[S]===71&&(i-S===Di||e[S+Di]===71)){if(g++,d===-1&&(d=S,d!==0&&(s=Math.min(d+Di*99,e.length-Di)+1)),u||(u=ZT(e,S)===0),u&&g>1&&(d===0&&g>2||S+Di>s))return d}else{if(g)return-1;break}o++}return-1}static createTrack(e,i){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:xx[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?i:void 0}}resetInitSegment(e,i,s,o){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=Bu.createTrack("video"),this._videoTrack.duration=o,this._audioTrack=Bu.createTrack("audio",o),this._id3Track=Bu.createTrack("id3"),this._txtTrack=Bu.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=i,this.videoCodec=s}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:i,_id3Track:s}=this;e&&(e.pesData=null),i&&(i.pesData=null),s&&(s.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,i,s=!1,o=!1){s||(this.sampleAes=null);let u;const d=this._videoTrack,g=this._audioTrack,S=this._id3Track,v=this._txtTrack;let E=d.pid,b=d.pesData,R=g.pid,_=S.pid,D=g.pesData,I=S.pesData,M=null,w=this.pmtParsed,B=this._pmtId,z=e.length;if(this.remainderData&&(e=Qs(this.remainderData,e),z=e.length,this.remainderData=null),z<Di&&!o)return this.remainderData=e,{audioTrack:g,videoTrack:d,id3Track:S,textTrack:v};const G=Math.max(0,Bu.syncOffset(e));z-=(z-G)%Di,z<e.byteLength&&!o&&(this.remainderData=new Uint8Array(e.buffer,z,e.buffer.byteLength-z));let K=0;for(let q=G;q<z;q+=Di)if(e[q]===71){const Z=!!(e[q+1]&64),te=ZT(e,q),$=(e[q+3]&48)>>4;let me;if($>1){if(me=q+5+e[q+4],me===q+Di)continue}else me=q+4;switch(te){case E:Z&&(b&&(u=Th(b,this.logger))&&(this.readyVideoParser(d.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(d,v,u,!1)),b={data:[],size:0}),b&&(b.data.push(e.subarray(me,q+Di)),b.size+=q+Di-me);break;case R:if(Z){if(D&&(u=Th(D,this.logger)))switch(g.segmentCodec){case"aac":this.parseAACPES(g,u);break;case"mp3":this.parseMPEGPES(g,u);break;case"ac3":this.parseAC3PES(g,u);break}D={data:[],size:0}}D&&(D.data.push(e.subarray(me,q+Di)),D.size+=q+Di-me);break;case _:Z&&(I&&(u=Th(I,this.logger))&&this.parseID3PES(S,u),I={data:[],size:0}),I&&(I.data.push(e.subarray(me,q+Di)),I.size+=q+Di-me);break;case 0:Z&&(me+=e[me]+1),B=this._pmtId=oO(e,me);break;case B:{Z&&(me+=e[me]+1);const Ee=uO(e,me,this.typeSupported,s,this.observer,this.logger);E=Ee.videoPid,E>0&&(d.pid=E,d.segmentCodec=Ee.segmentVideoCodec),R=Ee.audioPid,R>0&&(g.pid=R,g.segmentCodec=Ee.segmentAudioCodec),_=Ee.id3Pid,_>0&&(S.pid=_),M!==null&&!w&&(this.logger.warn(`MPEG-TS PMT found at ${q} after unknown PID '${M}'. Backtracking to sync byte @${G} to parse all TS packets.`),M=null,q=G-188),w=this.pmtParsed=!0;break}case 17:case 8191:break;default:M=te;break}}else K++;K>0&&JT(this.observer,new Error(`Found ${K} TS packet/s that do not start with 0x47`),void 0,this.logger),d.pesData=b,g.pesData=D,S.pesData=I;const ae={audioTrack:g,videoTrack:d,id3Track:S,textTrack:v};return o&&this.extractRemainingSamples(ae),ae}flush(){const{remainderData:e}=this;this.remainderData=null;let i;return e?i=this.demux(e,-1,!1,!0):i={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(i),this.sampleAes?this.decrypt(i,this.sampleAes):i}extractRemainingSamples(e){const{audioTrack:i,videoTrack:s,id3Track:o,textTrack:u}=e,d=s.pesData,g=i.pesData,S=o.pesData;let v;if(d&&(v=Th(d,this.logger))?(this.readyVideoParser(s.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(s,u,v,!0),s.pesData=null)):s.pesData=d,g&&(v=Th(g,this.logger))){switch(i.segmentCodec){case"aac":this.parseAACPES(i,v);break;case"mp3":this.parseMPEGPES(i,v);break;case"ac3":this.parseAC3PES(i,v);break}i.pesData=null}else g!=null&&g.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),i.pesData=g;S&&(v=Th(S,this.logger))?(this.parseID3PES(o,v),o.pesData=null):o.pesData=S}demuxSampleAes(e,i,s){const o=this.demux(e,s,!0,!this.config.progressive),u=this.sampleAes=new sO(this.observer,this.config,i);return this.decrypt(o,u)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new lO:e==="hevc"&&(this.videoParser=new rO))}decrypt(e,i){return new Promise(s=>{const{audioTrack:o,videoTrack:u}=e;o.samples&&o.segmentCodec==="aac"?i.decryptAacSamples(o.samples,0,()=>{u.samples?i.decryptAvcSamples(u.samples,0,0,()=>{s(e)}):s(e)}):u.samples&&i.decryptAvcSamples(u.samples,0,0,()=>{s(e)})})}destroy(){this.observer&&this.observer.removeAllListeners(),this.config=this.logger=this.observer=null,this.aacOverFlow=this.videoParser=this.remainderData=this.sampleAes=null,this._videoTrack=this._audioTrack=this._id3Track=this._txtTrack=void 0}parseAACPES(e,i){let s=0;const o=this.aacOverFlow;let u=i.data;if(o){this.aacOverFlow=null;const b=o.missing,R=o.sample.unit.byteLength;if(b===-1)u=Qs(o.sample.unit,u);else{const _=R-b;o.sample.unit.set(u.subarray(0,b),_),e.samples.push(o.sample),s=o.missing}}let d,g;for(d=s,g=u.length;d<g-1&&!xv(u,d);d++);if(d!==s){let b;const R=d<g-1;if(R?b=`AAC PES did not start with ADTS header,offset:${d}`:b="No ADTS header found in AAC PES",JT(this.observer,new Error(b),R,this.logger),!R)return}jA(e,this.observer,u,d,this.audioCodec);let S;if(i.pts!==void 0)S=i.pts;else if(o){const b=VA(e.samplerate);S=o.sample.pts+b}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let v=0,E;for(;d<g;)if(E=YA(e,u,d,S,v),d+=E.length,E.missing){this.aacOverFlow=E;break}else for(v++;d<g-1&&!xv(u,d);d++);}parseMPEGPES(e,i){const s=i.data,o=s.length;let u=0,d=0;const g=i.pts;if(g===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;d<o;)if(ZA(s,d)){const S=XA(e,s,d,g,u);if(S)d+=S.length,u++;else break}else d++}parseAC3PES(e,i){{const s=i.data,o=i.pts;if(o===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const u=s.length;let d=0,g=0,S;for(;g<u&&(S=eR(e,s,g,o,d++))>0;)g+=S}}parseID3PES(e,i){if(i.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const s=Jt({},i,{type:this._videoTrack?ms.emsg:ms.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(s)}}function ZT(h,e){return((h[e+1]&31)<<8)+h[e+2]}function oO(h,e){return(h[e+10]&31)<<8|h[e+11]}function uO(h,e,i,s,o,u){const d={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},g=(h[e+1]&15)<<8|h[e+2],S=e+3+g-4,v=(h[e+10]&15)<<8|h[e+11];for(e+=12+v;e<S;){const E=ZT(h,e),b=(h[e+3]&15)<<8|h[e+4];switch(h[e]){case 207:if(!s){WT("ADTS AAC",u);break}case 15:d.audioPid===-1&&(d.audioPid=E);break;case 21:d.id3Pid===-1&&(d.id3Pid=E);break;case 219:if(!s){WT("H.264",u);break}case 27:d.videoPid===-1&&(d.videoPid=E);break;case 3:case 4:!i.mpeg&&!i.mp3?u.log("MPEG audio found, not supported in this browser"):d.audioPid===-1&&(d.audioPid=E,d.segmentAudioCodec="mp3");break;case 193:if(!s){WT("AC-3",u);break}case 129:i.ac3?d.audioPid===-1&&(d.audioPid=E,d.segmentAudioCodec="ac3"):u.log("AC-3 audio found, not supported in this browser");break;case 6:if(d.audioPid===-1&&b>0){let R=e+5,_=b;for(;_>2;){switch(h[R]){case 106:i.ac3!==!0?u.log("AC-3 audio found, not supported in this browser for now"):(d.audioPid=E,d.segmentAudioCodec="ac3");break}const I=h[R+1]+2;R+=I,_-=I}}break;case 194:case 135:return JT(o,new Error("Unsupported EC-3 in M2TS found"),void 0,u),d;case 36:d.videoPid===-1&&(d.videoPid=E,d.segmentVideoCodec="hevc",u.log("HEVC in M2TS found"));break}e+=b+5}return d}function JT(h,e,i,s){s.warn(`parsing error: ${e.message}`),h.emit(O.ERROR,O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!1,levelRetry:i,error:e,reason:e.message})}function WT(h,e){e.log(`${h} with AES-128-CBC encryption found in unencrypted stream`)}function Th(h,e){let i=0,s,o,u,d,g;const S=h.data;if(!h||h.size===0)return null;for(;S[0].length<19&&S.length>1;)S[0]=Qs(S[0],S[1]),S.splice(1,1);if(s=S[0],(s[0]<<16)+(s[1]<<8)+s[2]===1){if(o=(s[4]<<8)+s[5],o&&o>h.size-6)return null;const E=s[7];E&192&&(d=(s[9]&14)*536870912+(s[10]&255)*4194304+(s[11]&254)*16384+(s[12]&255)*128+(s[13]&254)/2,E&64?(g=(s[14]&14)*536870912+(s[15]&255)*4194304+(s[16]&254)*16384+(s[17]&255)*128+(s[18]&254)/2,d-g>60*9e4&&(e.warn(`${Math.round((d-g)/9e4)}s delta between PTS and DTS, align them`),d=g)):g=d),u=s[8];let b=u+9;if(h.size<=b)return null;h.size-=b;const R=new Uint8Array(h.size);for(let _=0,D=S.length;_<D;_++){s=S[_];let I=s.byteLength;if(b)if(b>I){b-=I;continue}else s=s.subarray(b),I-=b,b=0;R.set(s,i),i+=I}return o&&(o-=u+3),{data:R,pts:d,dts:g,len:o}}return null}class cO{static getSilentFrame(e,i){switch(e){case"mp4a.40.2":if(i===1)return new Uint8Array([0,200,0,128,35,128]);if(i===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(i===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(i===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(i===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(i===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(i===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(i===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(i===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}}}const zu=Math.pow(2,32)-1;class se{static init(){se.types={avc1:[],avcC:[],hvc1:[],hvcC:[],btrt:[],dinf:[],dref:[],esds:[],ftyp:[],hdlr:[],mdat:[],mdhd:[],mdia:[],mfhd:[],minf:[],moof:[],moov:[],mp4a:[],".mp3":[],dac3:[],"ac-3":[],mvex:[],mvhd:[],pasp:[],sdtp:[],stbl:[],stco:[],stsc:[],stsd:[],stsz:[],stts:[],tfdt:[],tfhd:[],traf:[],trak:[],trun:[],trex:[],tkhd:[],vmhd:[],smhd:[]};let e;for(e in se.types)se.types.hasOwnProperty(e)&&(se.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const i=new Uint8Array([0,0,0,0,0,0,0,0,118,105,100,101,0,0,0,0,0,0,0,0,0,0,0,0,86,105,100,101,111,72,97,110,100,108,101,114,0]),s=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]);se.HDLR_TYPES={video:i,audio:s};const o=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),u=new Uint8Array([0,0,0,0,0,0,0,0]);se.STTS=se.STSC=se.STCO=u,se.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),se.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),se.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),se.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const d=new Uint8Array([105,115,111,109]),g=new Uint8Array([97,118,99,49]),S=new Uint8Array([0,0,0,1]);se.FTYP=se.box(se.types.ftyp,d,S,d,g),se.DINF=se.box(se.types.dinf,se.box(se.types.dref,o))}static box(e,...i){let s=8,o=i.length;const u=o;for(;o--;)s+=i[o].byteLength;const d=new Uint8Array(s);for(d[0]=s>>24&255,d[1]=s>>16&255,d[2]=s>>8&255,d[3]=s&255,d.set(e,4),o=0,s=8;o<u;o++)d.set(i[o],s),s+=i[o].byteLength;return d}static hdlr(e){return se.box(se.types.hdlr,se.HDLR_TYPES[e])}static mdat(e){return se.box(se.types.mdat,e)}static mdhd(e,i){i*=e;const s=Math.floor(i/(zu+1)),o=Math.floor(i%(zu+1));return se.box(se.types.mdhd,new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&255,85,196,0,0]))}static mdia(e){return se.box(se.types.mdia,se.mdhd(e.timescale||0,e.duration||0),se.hdlr(e.type),se.minf(e))}static mfhd(e){return se.box(se.types.mfhd,new Uint8Array([0,0,0,0,e>>24,e>>16&255,e>>8&255,e&255]))}static minf(e){return e.type==="audio"?se.box(se.types.minf,se.box(se.types.smhd,se.SMHD),se.DINF,se.stbl(e)):se.box(se.types.minf,se.box(se.types.vmhd,se.VMHD),se.DINF,se.stbl(e))}static moof(e,i,s){return se.box(se.types.moof,se.mfhd(e),se.traf(s,i))}static moov(e){let i=e.length;const s=[];for(;i--;)s[i]=se.trak(e[i]);return se.box.apply(null,[se.types.moov,se.mvhd(e[0].timescale||0,e[0].duration||0)].concat(s).concat(se.mvex(e)))}static mvex(e){let i=e.length;const s=[];for(;i--;)s[i]=se.trex(e[i]);return se.box.apply(null,[se.types.mvex,...s])}static mvhd(e,i){i*=e;const s=Math.floor(i/(zu+1)),o=Math.floor(i%(zu+1)),u=new Uint8Array([1,0,0,0,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,e>>24&255,e>>16&255,e>>8&255,e&255,s>>24,s>>16&255,s>>8&255,s&255,o>>24,o>>16&255,o>>8&255,o&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 se.box(se.types.mvhd,u)}static sdtp(e){const i=e.samples||[],s=new Uint8Array(4+i.length);let o,u;for(o=0;o<i.length;o++)u=i[o].flags,s[o+4]=u.dependsOn<<4|u.isDependedOn<<2|u.hasRedundancy;return se.box(se.types.sdtp,s)}static stbl(e){return se.box(se.types.stbl,se.stsd(e),se.box(se.types.stts,se.STTS),se.box(se.types.stsc,se.STSC),se.box(se.types.stsz,se.STSZ),se.box(se.types.stco,se.STCO))}static avc1(e){let i=[],s=[],o,u,d;for(o=0;o<e.sps.length;o++)u=e.sps[o],d=u.byteLength,i.push(d>>>8&255),i.push(d&255),i=i.concat(Array.prototype.slice.call(u));for(o=0;o<e.pps.length;o++)u=e.pps[o],d=u.byteLength,s.push(d>>>8&255),s.push(d&255),s=s.concat(Array.prototype.slice.call(u));const g=se.box(se.types.avcC,new Uint8Array([1,i[3],i[4],i[5],255,224|e.sps.length].concat(i).concat([e.pps.length]).concat(s))),S=e.width,v=e.height,E=e.pixelRatio[0],b=e.pixelRatio[1];return se.box(se.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,S>>8&255,S&255,v>>8&255,v&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]),g,se.box(se.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),se.box(se.types.pasp,new Uint8Array([E>>24,E>>16&255,E>>8&255,E&255,b>>24,b>>16&255,b>>8&255,b&255])))}static esds(e){const i=e.config;return new Uint8Array([0,0,0,0,3,25,0,1,0,4,17,64,21,0,0,0,0,0,0,0,0,0,0,0,5,2,...i,6,1,2])}static audioStsd(e){const i=e.samplerate||0;return new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,0,0,e.channelCount||0,0,16,0,0,0,0,i>>8&255,i&255,0,0])}static mp4a(e){return se.box(se.types.mp4a,se.audioStsd(e),se.box(se.types.esds,se.esds(e)))}static mp3(e){return se.box(se.types[".mp3"],se.audioStsd(e))}static ac3(e){return se.box(se.types["ac-3"],se.audioStsd(e),se.box(se.types.dac3,e.config))}static stsd(e){const{segmentCodec:i}=e;if(e.type==="audio"){if(i==="aac")return se.box(se.types.stsd,se.STSD,se.mp4a(e));if(i==="ac3"&&e.config)return se.box(se.types.stsd,se.STSD,se.ac3(e));if(i==="mp3"&&e.codec==="mp3")return se.box(se.types.stsd,se.STSD,se.mp3(e))}else if(e.pps&&e.sps){if(i==="avc")return se.box(se.types.stsd,se.STSD,se.avc1(e));if(i==="hevc"&&e.vps)return se.box(se.types.stsd,se.STSD,se.hvc1(e))}else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${i}/${e.codec})`)}static tkhd(e){const i=e.id,s=(e.duration||0)*(e.timescale||0),o=e.width||0,u=e.height||0,d=Math.floor(s/(zu+1)),g=Math.floor(s%(zu+1));return se.box(se.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,i>>24&255,i>>16&255,i>>8&255,i&255,0,0,0,0,d>>24,d>>16&255,d>>8&255,d&255,g>>24,g>>16&255,g>>8&255,g&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,o>>8&255,o&255,0,0,u>>8&255,u&255,0,0]))}static traf(e,i){const s=se.sdtp(e),o=e.id,u=Math.floor(i/(zu+1)),d=Math.floor(i%(zu+1));return se.box(se.types.traf,se.box(se.types.tfhd,new Uint8Array([0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255])),se.box(se.types.tfdt,new Uint8Array([1,0,0,0,u>>24,u>>16&255,u>>8&255,u&255,d>>24,d>>16&255,d>>8&255,d&255])),se.trun(e,s.length+16+20+8+16+8+8),s)}static trak(e){return e.duration=e.duration||4294967295,se.box(se.types.trak,se.tkhd(e),se.mdia(e))}static trex(e){const i=e.id;return se.box(se.types.trex,new Uint8Array([0,0,0,0,i>>24,i>>16&255,i>>8&255,i&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,i){const s=e.samples||[],o=s.length,u=12+16*o,d=new Uint8Array(u);let g,S,v,E,b,R;for(i+=8+u,d.set([e.type==="video"?1:0,0,15,1,o>>>24&255,o>>>16&255,o>>>8&255,o&255,i>>>24&255,i>>>16&255,i>>>8&255,i&255],0),g=0;g<o;g++)S=s[g],v=S.duration,E=S.size,b=S.flags,R=S.cts,d.set([v>>>24&255,v>>>16&255,v>>>8&255,v&255,E>>>24&255,E>>>16&255,E>>>8&255,E&255,b.isLeading<<2|b.dependsOn,b.isDependedOn<<6|b.hasRedundancy<<4|b.paddingValue<<1|b.isNonSync,b.degradPrio&61440,b.degradPrio&15,R>>>24&255,R>>>16&255,R>>>8&255,R&255],12+16*g);return se.box(se.types.trun,d)}static initSegment(e){se.types||se.init();const i=se.moov(e);return Qs(se.FTYP,i)}static hvc1(e){const i=e.params,s=[e.vps,e.sps,e.pps],o=4,u=new Uint8Array([1,i.general_profile_space<<6|(i.general_tier_flag?32:0)|i.general_profile_idc,i.general_profile_compatibility_flags[0],i.general_profile_compatibility_flags[1],i.general_profile_compatibility_flags[2],i.general_profile_compatibility_flags[3],i.general_constraint_indicator_flags[0],i.general_constraint_indicator_flags[1],i.general_constraint_indicator_flags[2],i.general_constraint_indicator_flags[3],i.general_constraint_indicator_flags[4],i.general_constraint_indicator_flags[5],i.general_level_idc,240|i.min_spatial_segmentation_idc>>8,255&i.min_spatial_segmentation_idc,252|i.parallelismType,252|i.chroma_format_idc,248|i.bit_depth_luma_minus8,248|i.bit_depth_chroma_minus8,0,parseInt(i.frame_rate.fps),o-1|i.temporal_id_nested<<2|i.num_temporal_layers<<3|(i.frame_rate.fixed?64:0),s.length]);let d=u.length;for(let D=0;D<s.length;D+=1){d+=3;for(let I=0;I<s[D].length;I+=1)d+=2+s[D][I].length}const g=new Uint8Array(d);g.set(u,0),d=u.length;const S=s.length-1;for(let D=0;D<s.length;D+=1){g.set(new Uint8Array([32+D|(D===S?128:0),0,s[D].length]),d),d+=3;for(let I=0;I<s[D].length;I+=1)g.set(new Uint8Array([s[D][I].length>>8,s[D][I].length&255]),d),d+=2,g.set(s[D][I],d),d+=s[D][I].length}const v=se.box(se.types.hvcC,g),E=e.width,b=e.height,R=e.pixelRatio[0],_=e.pixelRatio[1];return se.box(se.types.hvc1,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,E>>8&255,E&255,b>>8&255,b&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,se.box(se.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),se.box(se.types.pasp,new Uint8Array([R>>24,R>>16&255,R>>8&255,R&255,_>>24,_>>16&255,_>>8&255,_&255])))}}se.types=void 0,se.HDLR_TYPES=void 0,se.STTS=void 0,se.STSC=void 0,se.STCO=void 0,se.STSZ=void 0,se.VMHD=void 0,se.SMHD=void 0,se.STSD=void 0,se.FTYP=void 0,se.DINF=void 0;const iR=9e4;function eb(h,e,i=1,s=!1){const o=h*e*i;return s?Math.round(o):o}function fO(h,e,i=1,s=!1){return eb(h,e,1/i,s)}function s0(h,e=!1){return eb(h,1e3,1/iR,e)}function dO(h,e=1){return eb(h,iR,1/e)}function aR(h){const{baseTime:e,timescale:i,trackId:s}=h;return`${e/i} (${e}/${i}) trackId: ${s}`}const hO=10*1e3,mO=1024,gO=1152,pO=1536;let bh=null,tb=null;function sR(h,e,i,s){return{duration:e,size:i,cts:s,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:h?2:1,isNonSync:h?0:1}}}class Dv extends Xs{constructor(e,i,s,o){if(super("mp4-remuxer",o),this.observer=void 0,this.config=void 0,this.typeSupported=void 0,this.ISGenerated=!1,this._initPTS=null,this._initDTS=null,this.nextVideoTs=null,this.nextAudioTs=null,this.videoSampleDuration=null,this.isAudioContiguous=!1,this.isVideoContiguous=!1,this.videoTrackConfig=void 0,this.observer=e,this.config=i,this.typeSupported=s,this.ISGenerated=!1,bh===null){const d=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);bh=d?parseInt(d[1]):0}if(tb===null){const u=navigator.userAgent.match(/Safari\/(\d+)/i);tb=u?parseInt(u[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const i=this._initPTS;(!i||!e||e.trackId!==i.trackId||e.baseTime!==i.baseTime||e.timescale!==i.timescale)&&this.log(`Reset initPTS: ${i&&aR(i)} > ${e&&aR(e)}`),this._initPTS=this._initDTS=e}resetNextTimestamp(){this.log("reset next timestamp"),this.isVideoContiguous=!1,this.isAudioContiguous=!1}resetInitSegment(){this.log("ISGenerated flag reset"),this.ISGenerated=!1,this.videoTrackConfig=void 0}getVideoStartPts(e){let i=!1;const s=e[0].pts,o=e.reduce((u,d)=>{let g=d.pts,S=g-u;return S<-4294967296&&(i=!0,g=gs(g,s),S=g-u),S>0?u:g},s);return i&&this.debug("PTS rollover detected"),o}remux(e,i,s,o,u,d,g,S){let v,E,b,R,_,D,I=u,M=u;const w=e.pid>-1,B=i.pid>-1,z=i.samples.length,G=e.samples.length>0,K=g&&z>0||z>1;if((!w||G)&&(!B||K)||this.ISGenerated||g){if(this.ISGenerated){var q,Z,te,$;const Ie=this.videoTrackConfig;(Ie&&(i.width!==Ie.width||i.height!==Ie.height||((q=i.pixelRatio)==null?void 0:q[0])!==((Z=Ie.pixelRatio)==null?void 0:Z[0])||((te=i.pixelRatio)==null?void 0:te[1])!==(($=Ie.pixelRatio)==null?void 0:$[1]))||!Ie&&K||this.nextAudioTs===null&&G)&&this.resetInitSegment()}this.ISGenerated||(b=this.generateIS(e,i,u,d));const me=this.isVideoContiguous;let Ee=-1,De;if(K&&(Ee=yO(i.samples),!me&&this.config.forceKeyFrameOnDiscontinuity))if(D=!0,Ee>0){this.warn(`Dropped ${Ee} out of ${z} video samples due to a missing keyframe`);const Ie=this.getVideoStartPts(i.samples);i.samples=i.samples.slice(Ee),i.dropped+=Ee,M+=(i.samples[0].pts-Ie)/i.inputTimeScale,De=M}else Ee===-1&&(this.warn(`No keyframe found out of ${z} video samples`),D=!1);if(this.ISGenerated){if(G&&K){const Ie=this.getVideoStartPts(i.samples),F=(gs(e.samples[0].pts,Ie)-Ie)/i.inputTimeScale;I+=Math.max(0,F),M+=Math.max(0,-F)}if(G){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),b=this.generateIS(e,i,u,d)),E=this.remuxAudio(e,I,this.isAudioContiguous,d,B||K||S===Be.AUDIO?M:void 0),K){const Ie=E?E.endPTS-E.startPTS:0;i.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),b=this.generateIS(e,i,u,d)),v=this.remuxVideo(i,M,me,Ie)}}else K&&(v=this.remuxVideo(i,M,me,0));v&&(v.firstKeyFrame=Ee,v.independent=Ee!==-1,v.firstKeyFramePTS=De)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(s.samples.length&&(_=lR(s,u,this._initPTS,this._initDTS)),o.samples.length&&(R=rR(o,u,this._initPTS))),{audio:E,video:v,initSegment:b,independent:D,text:R,id3:_}}computeInitPts(e,i,s,o){const u=Math.round(s*i);let d=gs(e,u);if(d<u+i)for(this.log(`Adjusting PTS for rollover in timeline near ${(u-d)/i} ${o}`);d<u+i;)d+=8589934592;return d-u}generateIS(e,i,s,o){const u=e.samples,d=i.samples,g=this.typeSupported,S={},v=this._initPTS;let E=!v||o,b="audio/mp4",R,_,D,I=-1;if(E&&(R=_=1/0),e.config&&u.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":g.mpeg?(b="audio/mpeg",e.codec=""):g.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}S.audio={id:"audio",container:b,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&g.mpeg?new Uint8Array(0):se.initSegment([e]),metadata:{channelCount:e.channelCount}},E&&(I=e.id,D=e.inputTimeScale,!v||D!==v.timescale?R=_=this.computeInitPts(u[0].pts,D,s,"audio"):E=!1)}if(i.sps&&i.pps&&d.length){if(i.timescale=i.inputTimeScale,S.video={id:"main",container:"video/mp4",codec:i.codec,initSegment:se.initSegment([i]),metadata:{width:i.width,height:i.height}},E)if(I=i.id,D=i.inputTimeScale,!v||D!==v.timescale){const M=this.getVideoStartPts(d),w=gs(d[0].dts,M),B=this.computeInitPts(w,D,s,"video"),z=this.computeInitPts(M,D,s,"video");_=Math.min(_,B),R=Math.min(R,z)}else E=!1;this.videoTrackConfig={width:i.width,height:i.height,pixelRatio:i.pixelRatio}}if(Object.keys(S).length)return this.ISGenerated=!0,E?(v&&this.warn(`Timestamps at playlist time: ${o?"":"~"}${s} ${R/D} != initPTS: ${v.baseTime/v.timescale} (${v.baseTime}/${v.timescale}) trackId: ${v.trackId}`),this.log(`Found initPTS at playlist time: ${s} offset: ${R/D} (${R}/${D}) trackId: ${I}`),this._initPTS={baseTime:R,timescale:D,trackId:I},this._initDTS={baseTime:_,timescale:D,trackId:I}):R=D=void 0,{tracks:S,initPTS:R,timescale:D,trackId:I}}remuxVideo(e,i,s,o){const u=e.inputTimeScale,d=e.samples,g=[],S=d.length,v=this._initPTS,E=v.baseTime*u/v.timescale;let b=this.nextVideoTs,R=8,_=this.videoSampleDuration,D,I,M=Number.POSITIVE_INFINITY,w=Number.NEGATIVE_INFINITY,B=!1;if(!s||b===null){const Q=E+i*u,de=d[0].pts-gs(d[0].dts,d[0].pts);bh&&b!==null&&Math.abs(Q-de-(b+E))<15e3?s=!0:b=Q-de-E}const z=b+E;for(let Q=0;Q<S;Q++){const de=d[Q];de.pts=gs(de.pts,z),de.dts=gs(de.dts,z),de.dts<d[Q>0?Q-1:Q].dts&&(B=!0)}B&&d.sort(function(Q,de){const Le=Q.dts-de.dts,Ce=Q.pts-de.pts;return Le||Ce}),D=d[0].dts,I=d[d.length-1].dts;const G=I-D,K=G?Math.round(G/(S-1)):_||e.inputTimeScale/30;if(s){const Q=D-z,de=Q>K,Le=Q<-1;if((de||Le)&&(de?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${s0(Q,!0)} ms (${Q}dts) hole between fragments detected at ${i.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${s0(-Q,!0)} ms (${Q}dts) overlapping between fragments detected at ${i.toFixed(3)}`),!Le||z>=d[0].pts||bh)){D=z;const Ce=d[0].pts-Q;if(de)d[0].dts=D,d[0].pts=Ce;else{let Fe=!0;for(let Ve=0;Ve<d.length&&!(d[Ve].dts>Ce&&Fe);Ve++){const at=d[Ve].pts;if(d[Ve].dts-=Q,d[Ve].pts-=Q,Ve<d.length-1){const At=d[Ve+1].pts,kt=d[Ve].pts,vi=At<=kt,we=At<=at;Fe=vi==we}}}this.log(`Video: Initial PTS/DTS adjusted: ${s0(Ce,!0)}/${s0(D,!0)}, delta: ${s0(Q,!0)} ms`)}}D=Math.max(0,D);let ae=0,q=0,Z=D;for(let Q=0;Q<S;Q++){const de=d[Q],Le=de.units,Ce=Le.length;let Fe=0;for(let Ve=0;Ve<Ce;Ve++)Fe+=Le[Ve].data.length;q+=Fe,ae+=Ce,de.length=Fe,de.dts<Z?(de.dts=Z,Z+=K/4|0||1):Z=de.dts,M=Math.min(de.pts,M),w=Math.max(de.pts,w)}I=d[S-1].dts;const te=q+4*ae+8;let $;try{$=new Uint8Array(te)}catch(Q){this.observer.emit(O.ERROR,O.ERROR,{type:je.MUX_ERROR,details:re.REMUX_ALLOC_ERROR,fatal:!1,error:Q,bytes:te,reason:`fail allocating video mdat ${te}`});return}const me=new DataView($.buffer);me.setUint32(0,te),$.set(se.types.mdat,4);let Ee=!1,De=Number.POSITIVE_INFINITY,Ie=Number.POSITIVE_INFINITY,Oe=Number.NEGATIVE_INFINITY,F=Number.NEGATIVE_INFINITY;for(let Q=0;Q<S;Q++){const de=d[Q],Le=de.units;let Ce=0;for(let at=0,At=Le.length;at<At;at++){const kt=Le[at],vi=kt.data,we=kt.data.byteLength;me.setUint32(R,we),R+=4,$.set(vi,R),R+=we,Ce+=4+we}let Fe;if(Q<S-1)_=d[Q+1].dts-de.dts,Fe=d[Q+1].pts-de.pts;else{const at=this.config,At=Q>0?de.dts-d[Q-1].dts:K;if(Fe=Q>0?de.pts-d[Q-1].pts:K,at.stretchShortVideoTrack&&this.nextAudioTs!==null){const kt=Math.floor(at.maxBufferHole*u),vi=(o?M+o*u:this.nextAudioTs+E)-de.pts;vi>kt?(_=vi-At,_<0?_=At:Ee=!0,this.log(`It is approximately ${vi/90} ms to the next segment; using duration ${_/90} ms for the last video frame.`)):_=At}else _=At}const Ve=Math.round(de.pts-de.dts);De=Math.min(De,_),Oe=Math.max(Oe,_),Ie=Math.min(Ie,Fe),F=Math.max(F,Fe),g.push(sR(de.key,_,Ce,Ve))}if(g.length){if(bh){if(bh<70){const Q=g[0].flags;Q.dependsOn=2,Q.isNonSync=0}}else if(tb&&F-Ie<Oe-De&&K/Oe<.025&&g[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let Q=D;for(let de=0,Le=g.length;de<Le;de++){const Ce=Q+g[de].duration,Fe=Q+g[de].cts;if(de<Le-1){const Ve=Ce+g[de+1].cts;g[de].duration=Ve-Fe}else g[de].duration=de?g[de-1].duration:K;g[de].cts=0,Q=Ce}}}_=Ee||!_?K:_;const ne=I+_;this.nextVideoTs=b=ne-E,this.videoSampleDuration=_,this.isVideoContiguous=!0;const _e={data1:se.moof(e.sequenceNumber++,D,Jt(e,{samples:g})),data2:$,startPTS:(M-E)/u,endPTS:(w+_-E)/u,startDTS:(D-E)/u,endDTS:b/u,type:"video",hasAudio:!1,hasVideo:!0,nb:g.length,dropped:e.dropped};return e.samples=[],e.dropped=0,_e}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return gO;case"ac3":return pO;default:return mO}}remuxAudio(e,i,s,o,u){const d=e.inputTimeScale,g=e.samplerate?e.samplerate:d,S=d/g,v=this.getSamplesPerFrame(e),E=v*S,b=this._initPTS,R=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,_=[],D=u!==void 0;let I=e.samples,M=R?0:8,w=this.nextAudioTs||-1;const B=b.baseTime*d/b.timescale,z=B+i*d;if(this.isAudioContiguous=s=s||I.length&&w>0&&(o&&Math.abs(z-(w+B))<9e3||Math.abs(gs(I[0].pts,z)-(w+B))<20*E),I.forEach(function(F){F.pts=gs(F.pts,z)}),!s||w<0){const F=I.length;if(I=I.filter(ne=>ne.pts>=0),F!==I.length&&this.warn(`Removed ${I.length-F} of ${F} samples (initPTS ${B} / ${d})`),!I.length)return;u===0?w=0:o&&!D?w=Math.max(0,z-B):w=I[0].pts-B}if(e.segmentCodec==="aac"){const F=this.config.maxAudioFramesDrift;for(let ne=0,le=w+B;ne<I.length;ne++){const xe=I[ne],_e=xe.pts,Q=_e-le,de=Math.abs(1e3*Q/d);if(Q<=-F*E&&D)ne===0&&(this.warn(`Audio frame @ ${(_e/d).toFixed(3)}s overlaps marker by ${Math.round(1e3*Q/d)} ms.`),this.nextAudioTs=w=_e-B,le=_e);else if(Q>=F*E&&de<hO&&D){let Le=Math.round(Q/E);for(le=_e-Le*E;le<0&&Le&&E;)Le--,le+=E;ne===0&&(this.nextAudioTs=w=le-B),this.warn(`Injecting ${Le} audio frames @ ${((le-B)/d).toFixed(3)}s due to ${Math.round(1e3*Q/d)} ms gap.`);for(let Ce=0;Ce<Le;Ce++){let Fe=cO.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);Fe||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),Fe=xe.unit.subarray()),I.splice(ne,0,{unit:Fe,pts:le}),le+=E,ne++}}xe.pts=le,le+=E}}let G=null,K=null,ae,q=0,Z=I.length;for(;Z--;)q+=I[Z].unit.byteLength;for(let F=0,ne=I.length;F<ne;F++){const le=I[F],xe=le.unit;let _e=le.pts;if(K!==null){const de=_[F-1];de.duration=Math.round((_e-K)/S)}else if(s&&e.segmentCodec==="aac"&&(_e=w+B),G=_e,q>0){q+=M;try{ae=new Uint8Array(q)}catch(de){this.observer.emit(O.ERROR,O.ERROR,{type:je.MUX_ERROR,details:re.REMUX_ALLOC_ERROR,fatal:!1,error:de,bytes:q,reason:`fail allocating audio mdat ${q}`});return}R||(new DataView(ae.buffer).setUint32(0,q),ae.set(se.types.mdat,4))}else return;ae.set(xe,M);const Q=xe.byteLength;M+=Q,_.push(sR(!0,v,Q,0)),K=_e}const te=_.length;if(!te)return;const $=_[_.length-1];w=K-B,this.nextAudioTs=w+S*$.duration;const me=R?new Uint8Array(0):se.moof(e.sequenceNumber++,G/S,Jt({},e,{samples:_}));e.samples=[];const Ee=(G-B)/d,De=this.nextAudioTs/d,Oe={data1:me,data2:ae,startPTS:Ee,endPTS:De,startDTS:Ee,endDTS:De,type:"audio",hasAudio:!0,hasVideo:!1,nb:te};return this.isAudioContiguous=!0,Oe}}function gs(h,e){let i;if(e===null)return h;for(e<h?i=-8589934592:i=8589934592;Math.abs(h-e)>4294967296;)h+=i;return h}function yO(h){for(let e=0;e<h.length;e++)if(h[e].key)return e;return-1}function lR(h,e,i,s){const o=h.samples.length;if(!o)return;const u=h.inputTimeScale;for(let g=0;g<o;g++){const S=h.samples[g];S.pts=gs(S.pts-i.baseTime*u/i.timescale,e*u)/u,S.dts=gs(S.dts-s.baseTime*u/s.timescale,e*u)/u}const d=h.samples;return h.samples=[],{samples:d}}function rR(h,e,i){const s=h.samples.length;if(!s)return;const o=h.inputTimeScale;for(let d=0;d<s;d++){const g=h.samples[d];g.pts=gs(g.pts-i.baseTime*o/i.timescale,e*o)/o}h.samples.sort((d,g)=>d.pts-g.pts);const u=h.samples;return h.samples=[],{samples:u}}class vO extends Xs{constructor(e,i,s,o){super("passthrough-remuxer",o),this.emitInitSegment=!1,this.audioCodec=void 0,this.videoCodec=void 0,this.initData=void 0,this.initPTS=null,this.initTracks=void 0,this.lastEndTime=null,this.isVideoContiguous=!1}destroy(){}resetTimeStamp(e){this.lastEndTime=null;const i=this.initPTS;i&&e&&i.baseTime===e.baseTime&&i.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,i,s,o){this.audioCodec=i,this.videoCodec=s,this.generateInitSegment(e,o),this.emitInitSegment=!0}generateInitSegment(e,i){let{audioCodec:s,videoCodec:o}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:u,video:d}=this.initData=Lx(e);if(i)sC(e,i);else{const S=u||d;S!=null&&S.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${S.codec}")!`)}u&&(s=oR(u,ln.AUDIO,this)),d&&(o=oR(d,ln.VIDEO,this));const g={};u&&d?g.audiovideo={container:"video/mp4",codec:s+","+o,supplemental:d.supplemental,encrypted:d.encrypted,initSegment:e,id:"main"}:u?g.audio={container:"audio/mp4",codec:s,encrypted:u.encrypted,initSegment:e,id:"audio"}:d?g.video={container:"video/mp4",codec:o,supplemental:d.supplemental,encrypted:d.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=g}remux(e,i,s,o,u,d){var g,S;let{initPTS:v,lastEndTime:E}=this;const b={audio:void 0,video:void 0,text:o,id3:s,initSegment:void 0};Ue(E)||(E=this.lastEndTime=u||0);const R=i.samples;if(!R.length)return b;const _={initPTS:void 0,timescale:void 0,trackId:void 0};let D=this.initData;if((g=D)!=null&&g.length||(this.generateInitSegment(R),D=this.initData),!((S=D)!=null&&S.length))return this.warn("Failed to generate initSegment."),b;this.emitInitSegment&&(_.tracks=this.initTracks,this.emitInitSegment=!1);const I=rC(R,D,this),M=D.audio?I[D.audio.id]:null,w=D.video?I[D.video.id]:null,B=Lv(w,1/0),z=Lv(M,1/0),G=Lv(w,0,!0),K=Lv(M,0,!0);let ae=u,q=0;const Z=M&&(!w||!v&&z<B||v&&v.trackId===D.audio.id),te=Z?M:w;if(te){const le=te.timescale,xe=te.start-u*le,_e=Z?D.audio.id:D.video.id;ae=te.start/le,q=Z?K-z:G-B,(d||!v)&&(SO(v,ae,u,q)||le!==v.timescale)&&(v&&this.warn(`Timestamps at playlist time: ${d?"":"~"}${u} ${xe/le} != initPTS: ${v.baseTime/v.timescale} (${v.baseTime}/${v.timescale}) trackId: ${v.trackId}`),this.log(`Found initPTS at playlist time: ${u} offset: ${ae-u} (${xe}/${le}) trackId: ${_e}`),v=null,_.initPTS=xe,_.timescale=le,_.trackId=_e)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${u}`);v?(_.initPTS=v.baseTime,_.timescale=v.timescale,_.trackId=v.trackId):((!_.timescale||_.trackId===void 0||_.initPTS===void 0)&&(this.warn("Could not set initPTS"),_.initPTS=ae,_.timescale=1,_.trackId=-1),this.initPTS=v={baseTime:_.initPTS,timescale:_.timescale,trackId:_.trackId});const $=ae-v.baseTime/v.timescale,me=$+q;q>0?this.lastEndTime=me:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const Ee=!!D.audio,De=!!D.video;let Ie="";Ee&&(Ie+="audio"),De&&(Ie+="video");const Oe=(D.audio?D.audio.encrypted:!1)||(D.video?D.video.encrypted:!1),F={data1:R,startPTS:$,startDTS:$,endPTS:me,endDTS:me,type:Ie,hasAudio:Ee,hasVideo:De,nb:1,dropped:0,encrypted:Oe};b.audio=Ee&&!De?F:void 0,b.video=De?F:void 0;const ne=w==null?void 0:w.sampleCount;if(ne){const le=w.keyFrameIndex,xe=le!==-1;F.nb=ne,F.dropped=le===0||this.isVideoContiguous?0:xe?le:ne,F.independent=xe,F.firstKeyFrame=le,xe&&w.keyFrameStart&&(F.firstKeyFramePTS=(w.keyFrameStart-v.baseTime)/v.timescale),this.isVideoContiguous||(b.independent=xe),this.isVideoContiguous||(this.isVideoContiguous=xe),F.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${le}/${ne} dropped: ${F.dropped} start: ${F.firstKeyFramePTS||"NA"}`)}return b.initSegment=_,b.id3=lR(s,u,v,v),o.samples.length&&(b.text=rR(o,u,v)),b}}function Lv(h,e,i=!1){return(h==null?void 0:h.start)!==void 0?(h.start+(i?h.duration:0))/h.timescale:e}function SO(h,e,i,s){if(h===null)return!0;const o=Math.max(s,1),u=e-h.baseTime/h.timescale;return Math.abs(u-i)>o}function oR(h,e,i){const s=h.codec;return s&&s.length>4?s:e===ln.AUDIO?s==="ec-3"||s==="ac-3"||s==="alac"?s:s==="fLaC"||s==="Opus"?uv(s,!1):(i.warn(`Unhandled audio codec "${s}" in mp4 MAP`),s||"mp4a"):(i.warn(`Unhandled video codec "${s}" in mp4 MAP`),s||"avc1")}let So;try{So=self.performance.now.bind(self.performance)}catch{So=Date.now}const _v=[{demux:aO,remux:vO},{demux:Bu,remux:Dv},{demux:eO,remux:Dv},{demux:nO,remux:Dv}];_v.splice(2,0,{demux:tO,remux:Dv});class uR{constructor(e,i,s,o,u,d){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupported=void 0,this.config=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=e,this.typeSupported=i,this.config=s,this.id=u,this.logger=d}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,i,s,o){const u=s.transmuxing;u.executeStart=So();let d=new Uint8Array(e);const{currentTransmuxState:g,transmuxConfig:S}=this;o&&(this.currentTransmuxState=o);const{contiguous:v,discontinuity:E,trackSwitch:b,accurateTimeOffset:R,timeOffset:_,initSegmentChange:D}=o||g,{audioCodec:I,videoCodec:M,defaultInitPts:w,duration:B,initSegmentData:z}=S,G=EO(d,i);if(G&&vh(G.method)){const Z=this.getDecrypter(),te=NT(G.method);if(Z.isSync()){let $=Z.softwareDecrypt(d,G.key.buffer,G.iv.buffer,te);if(s.part>-1){const Ee=Z.flush();$=Ee&&Ee.buffer}if(!$)return u.executeEnd=So(),nb(s);d=new Uint8Array($)}else return this.asyncResult=!0,this.decryptionPromise=Z.webCryptoDecrypt(d,G.key.buffer,G.iv.buffer,te).then($=>{const me=this.push($,null,s);return this.decryptionPromise=null,me}),this.decryptionPromise}const K=this.needsProbing(E,b);if(K){const Z=this.configureTransmuxer(d);if(Z)return this.logger.warn(`[transmuxer] ${Z.message}`),this.observer.emit(O.ERROR,O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,fatal:!1,error:Z,reason:Z.message}),u.executeEnd=So(),nb(s)}(E||b||D||K)&&this.resetInitSegment(z,I,M,B,i),(E||D||K)&&this.resetInitialTimestamp(w),v||this.resetContiguity();const ae=this.transmux(d,G,_,R,s);this.asyncResult=l0(ae);const q=this.currentTransmuxState;return q.contiguous=!0,q.discontinuity=!1,q.trackSwitch=!1,u.executeEnd=So(),ae}flush(e){const i=e.transmuxing;i.executeStart=So();const{decrypter:s,currentTransmuxState:o,decryptionPromise:u}=this;if(u)return this.asyncResult=!0,u.then(()=>this.flush(e));const d=[],{timeOffset:g}=o;if(s){const b=s.flush();b&&d.push(this.push(b.buffer,null,e))}const{demuxer:S,remuxer:v}=this;if(!S||!v){i.executeEnd=So();const b=[nb(e)];return this.asyncResult?Promise.resolve(b):b}const E=S.flush(g);return l0(E)?(this.asyncResult=!0,E.then(b=>(this.flushRemux(d,b,e),d))):(this.flushRemux(d,E,e),this.asyncResult?Promise.resolve(d):d)}flushRemux(e,i,s){const{audioTrack:o,videoTrack:u,id3Track:d,textTrack:g}=i,{accurateTimeOffset:S,timeOffset:v}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${s.sn}${s.part>-1?" part: "+s.part:""} of ${this.id===Be.MAIN?"level":"track"} ${s.level}`);const E=this.remuxer.remux(o,u,d,g,v,S,!0,this.id);e.push({remuxResult:E,chunkMeta:s}),s.transmuxing.executeEnd=So()}resetInitialTimestamp(e){const{demuxer:i,remuxer:s}=this;!i||!s||(i.resetTimeStamp(e),s.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:i}=this;!e||!i||(e.resetContiguity(),i.resetNextTimestamp())}resetInitSegment(e,i,s,o,u){const{demuxer:d,remuxer:g}=this;!d||!g||(d.resetInitSegment(e,i,s,o),g.resetInitSegment(e,i,s,u))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,i,s,o,u){let d;return i&&i.method==="SAMPLE-AES"?d=this.transmuxSampleAes(e,i,s,o,u):d=this.transmuxUnencrypted(e,s,o,u),d}transmuxUnencrypted(e,i,s,o){const{audioTrack:u,videoTrack:d,id3Track:g,textTrack:S}=this.demuxer.demux(e,i,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(u,d,g,S,i,s,!1,this.id),chunkMeta:o}}transmuxSampleAes(e,i,s,o,u){return this.demuxer.demuxSampleAes(e,i,s).then(d=>({remuxResult:this.remuxer.remux(d.audioTrack,d.videoTrack,d.id3Track,d.textTrack,s,o,!1,this.id),chunkMeta:u}))}configureTransmuxer(e){const{config:i,observer:s,typeSupported:o}=this;let u;for(let b=0,R=_v.length;b<R;b++){var d;if((d=_v[b].demux)!=null&&d.probe(e,this.logger)){u=_v[b];break}}if(!u)return new Error("Failed to find demuxer by probing fragment data");const g=this.demuxer,S=this.remuxer,v=u.remux,E=u.demux;(!S||!(S instanceof v))&&(this.remuxer=new v(s,i,o,this.logger)),(!g||!(g instanceof E))&&(this.demuxer=new E(s,i,o,this.logger),this.probe=E.probe)}needsProbing(e,i){return!this.demuxer||!this.remuxer||e||i}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new MT(this.config)),e}}function EO(h,e){let i=null;return h.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(i=e),i}const nb=h=>({remuxResult:{},chunkMeta:h});function l0(h){return"then"in h&&h.then instanceof Function}class TO{constructor(e,i,s,o,u){this.audioCodec=void 0,this.videoCodec=void 0,this.initSegmentData=void 0,this.duration=void 0,this.defaultInitPts=void 0,this.audioCodec=e,this.videoCodec=i,this.initSegmentData=s,this.duration=o,this.defaultInitPts=u||null}}class bO{constructor(e,i,s,o,u,d){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=e,this.contiguous=i,this.accurateTimeOffset=s,this.trackSwitch=o,this.timeOffset=u,this.initSegmentChange=d}}let cR=0;class fR{constructor(e,i,s,o){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=cR++,this.observer=void 0,this.frag=null,this.part=null,this.useWorker=void 0,this.workerContext=null,this.transmuxer=null,this.onTransmuxComplete=void 0,this.onFlush=void 0,this.onWorkerMessage=S=>{const v=S.data,E=this.hls;if(!(!E||!(v!=null&&v.event)||v.instanceNo!==this.instanceNo))switch(v.event){case"init":{var b;const R=(b=this.workerContext)==null?void 0:b.objectURL;R&&self.URL.revokeObjectURL(R);break}case"transmuxComplete":{this.handleTransmuxComplete(v.data);break}case"flush":{this.onFlush(v.data);break}case"workerLog":{E.logger[v.data.logType]&&E.logger[v.data.logType](v.data.message);break}default:{v.data=v.data||{},v.data.frag=this.frag,v.data.part=this.part,v.data.id=this.id,E.trigger(v.event,v.data);break}}},this.onWorkerError=S=>{if(!this.hls)return;const v=new Error(`${S.message} (${S.filename}:${S.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:v})};const u=e.config;this.hls=e,this.id=i,this.useWorker=!!u.enableWorker,this.onTransmuxComplete=s,this.onFlush=o;const d=(S,v)=>{v=v||{},v.frag=this.frag||void 0,S===O.ERROR&&(v=v,v.parent=this.id,v.part=this.part,this.error=v.error),this.hls.trigger(S,v)};this.observer=new jT,this.observer.on(O.FRAG_DECRYPTED,d),this.observer.on(O.ERROR,d);const g=Ux(u.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const S=this.hls.logger;if(u.workerPath||D2()){try{u.workerPath?(S.log(`loading Web Worker ${u.workerPath} for "${i}"`),this.workerContext=_2(u.workerPath)):(S.log(`injecting Web Worker for "${i}"`),this.workerContext=L2());const{worker:E}=this.workerContext;E.addEventListener("message",this.onWorkerMessage),E.addEventListener("error",this.onWorkerError),E.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:g,id:i,config:rn(u)})}catch(E){S.warn(`Error setting up "${i}" Web Worker, fallback to inline`,E),this.terminateWorker(),this.error=null,this.transmuxer=new uR(this.observer,g,u,"",i,e.logger)}return}}this.transmuxer=new uR(this.observer,g,u,"",i,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=cR++;const i=this.hls.config,s=Ux(i.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:s,id:this.id,config:rn(i)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),C2(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const i=this.transmuxer;i&&(i.destroy(),this.transmuxer=null)}const e=this.observer;e&&e.removeAllListeners(),this.frag=null,this.part=null,this.observer=null,this.hls=null}push(e,i,s,o,u,d,g,S,v,E){var b,R;v.transmuxing.start=self.performance.now();const{instanceNo:_,transmuxer:D}=this,I=d?d.start:u.start,M=u.decryptdata,w=this.frag,B=!(w&&u.cc===w.cc),z=!(w&&v.level===w.level),G=w?v.sn-w.sn:-1,K=this.part?v.part-this.part.index:-1,ae=G===0&&v.id>1&&v.id===(w==null?void 0:w.stats.chunkCount),q=!z&&(G===1||G===0&&(K===1||ae&&K<=0)),Z=self.performance.now();(z||G||u.stats.parsing.start===0)&&(u.stats.parsing.start=Z),d&&(K||!q)&&(d.stats.parsing.start=Z);const te=!(w&&((b=u.initSegment)==null?void 0:b.url)===((R=w.initSegment)==null?void 0:R.url)),$=new bO(B,q,S,z,I,te);if(!q||B||te){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${u.type} sn: ${v.sn}${v.part>-1?" part: "+v.part:""} ${this.id===Be.MAIN?"level":"track"}: ${v.level} id: ${v.id}
293
+ discontinuity: ${B}
294
+ trackSwitch: ${z}
295
+ contiguous: ${q}
296
+ accurateTimeOffset: ${S}
297
+ timeOffset: ${I}
298
+ initSegmentChange: ${te}`);const me=new TO(s,o,i,g,E);this.configureTransmuxer(me)}if(this.frag=u,this.part=d,this.workerContext)this.workerContext.worker.postMessage({instanceNo:_,cmd:"demux",data:e,decryptdata:M,chunkMeta:v,state:$},e instanceof ArrayBuffer?[e]:[]);else if(D){const me=D.push(e,M,v,$);l0(me)?me.then(Ee=>{this.handleTransmuxComplete(Ee)}).catch(Ee=>{this.transmuxerError(Ee,v,"transmuxer-interface push error")}):this.handleTransmuxComplete(me)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:i,transmuxer:s}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:i,cmd:"flush",chunkMeta:e});else if(s){const o=s.flush(e);l0(o)?o.then(u=>{this.handleFlushResult(u,e)}).catch(u=>{this.transmuxerError(u,e,"transmuxer-interface flush error")}):this.handleFlushResult(o,e)}}transmuxerError(e,i,s){this.hls&&(this.error=e,this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_PARSING_ERROR,chunkMeta:i,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:s}))}handleFlushResult(e,i){e.forEach(s=>{this.handleTransmuxComplete(s)}),this.onFlush(i)}configureTransmuxer(e){const{instanceNo:i,transmuxer:s}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:i,cmd:"configure",config:e}):s&&s.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const dR=100;class xO extends $T{constructor(e,i,s){super(e,i,s,"audio-stream-controller",Be.AUDIO),this.mainAnchor=null,this.mainFragLoading=null,this.audioOnly=!1,this.bufferedTrack=null,this.switchingTrack=null,this.trackId=-1,this.waitingData=null,this.mainDetails=null,this.flushing=!1,this.bufferFlushed=!1,this.cachedTrackLoadedData=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.resetItem()}resetItem(){this.mainDetails=this.mainAnchor=this.mainFragLoading=this.bufferedTrack=this.switchingTrack=this.waitingData=this.cachedTrackLoadedData=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(O.LEVEL_LOADED,this.onLevelLoaded,this),e.on(O.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(O.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(O.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(O.BUFFER_RESET,this.onBufferReset,this),e.on(O.BUFFER_CREATED,this.onBufferCreated,this),e.on(O.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(O.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(O.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(O.FRAG_LOADING,this.onFragLoading,this),e.on(O.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(O.LEVEL_LOADED,this.onLevelLoaded,this),e.off(O.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(O.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(O.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(O.BUFFER_RESET,this.onBufferReset,this),e.off(O.BUFFER_CREATED,this.onBufferCreated,this),e.off(O.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(O.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(O.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(O.FRAG_LOADING,this.onFragLoading,this),e.off(O.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:i,id:s,initPTS:o,timescale:u,trackId:d}){if(s===Be.MAIN){const g=i.cc,S=this.fragCurrent;if(this.initPTS[g]={baseTime:o,timescale:u,trackId:d},this.log(`InitPTS for cc: ${g} found from main: ${o/u} (${o}/${u}) trackId: ${d}`),this.mainAnchor=i,this.state===be.WAITING_INIT_PTS){const v=this.waitingData;(!v&&!this.loadingParts||v&&v.frag.cc!==g)&&this.syncWithAnchor(i,v==null?void 0:v.frag)}else!this.hls.hasEnoughToStart&&S&&S.cc!==g?(S.abortRequests(),this.syncWithAnchor(i,S)):this.state===be.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,i){var s;const o=((s=this.mainFragLoading)==null?void 0:s.frag)||null;if(i&&(o==null?void 0:o.cc)===i.cc)return;const u=(o||e).cc,d=this.getLevelDetails(),g=this.getLoadPosition(),S=Kx(d,u,g);S&&(this.log(`Syncing with main frag at ${S.start} cc ${S.cc}`),this.startFragRequested=!1,this.nextLoadPosition=S.start,this.resetLoadingState(),this.state===be.IDLE&&this.doTickIdle())}startLoad(e,i){if(!this.levels){this.startPosition=e,this.state=be.STOPPED;return}const s=this.lastCurrentTime;this.stopLoad(),this.setInterval(dR),s>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s,this.state=be.IDLE):this.state=be.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=i?-1:e,this.tick()}doTick(){switch(this.state){case be.IDLE:this.doTickIdle();break;case be.WAITING_TRACK:{const{levels:e,trackId:i}=this,s=e==null?void 0:e[i],o=s==null?void 0:s.details;if(o&&!this.waitForLive(s)){if(this.waitForCdnTuneIn(o))break;this.state=be.WAITING_INIT_PTS}break}case be.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case be.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:i,part:s,cache:o,complete:u}=e,d=this.mainAnchor;if(this.initPTS[i.cc]!==void 0){this.waitingData=null,this.state=be.FRAG_LOADING;const g=o.flush().buffer,S={frag:i,part:s,payload:g,networkDetails:null};this._handleFragmentLoadProgress(S),u&&super._handleFragmentLoadComplete(S)}else d&&d.cc!==e.frag.cc&&this.syncWithAnchor(d,e.frag)}else this.state=be.IDLE}}this.onTickEnd()}resetLoadingState(){const e=this.waitingData;e&&(this.fragmentTracker.removeFragment(e.frag),this.waitingData=null),super.resetLoadingState()}onTickEnd(){const{media:e}=this;e!=null&&e.readyState&&(this.lastCurrentTime=e.currentTime)}doTickIdle(){var e;const{hls:i,levels:s,media:o,trackId:u}=this,d=i.config;if(!this.buffering||!o&&!this.primaryPrefetch&&(this.startFragRequested||!d.startFragPrefetch)||!(s!=null&&s[u]))return;const g=s[u],S=g.details;if(!S||this.waitForLive(g)||this.waitForCdnTuneIn(S)){this.state=be.WAITING_TRACK,this.startFragRequested=!1;return}const v=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&v&&(this.bufferFlushed=!1,this.afterBufferFlushed(v,ln.AUDIO,Be.AUDIO));const E=this.getFwdBufferInfo(v,Be.AUDIO);if(E===null)return;if(!this.switchingTrack&&this._streamEnded(E,S)){i.trigger(O.BUFFER_EOS,{type:"audio"}),this.state=be.ENDED;return}const b=E.len,R=i.maxBufferLength,_=S.fragments,D=_[0].start,I=this.getLoadPosition(),M=this.flushing?I:E.end;if(this.switchingTrack&&o){const z=I;S.PTSKnown&&z<D&&(E.end>D||E.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),o.currentTime=D+.05)}if(b>=R&&!this.switchingTrack&&M<_[_.length-1].start)return;let w=this.getNextFragment(M,S);if(w&&this.isLoopLoading(w,M)&&(w=this.getNextFragmentLoopLoading(w,S,E,Be.MAIN,R)),!w){this.bufferFlushed=!0;return}let B=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&B&&Vn(w)&&!w.endList&&(!S.live||!this.loadingParts&&M<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(B)===yi.OK&&(this.mainFragLoading=B=null),B&&Vn(B))){if(w.start>B.end){const G=this.fragmentTracker.getFragAtPos(M,Be.MAIN);G&&G.end>B.end&&(B=G,this.mainFragLoading={frag:G,targetBufferTime:null})}if(w.start>B.end)return}this.loadFragment(w,g,M)}onMediaDetaching(e,i){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,i)}onAudioTracksUpdated(e,{audioTracks:i}){this.resetTransmuxer(),this.levels=i.map(s=>new Wg(s))}onAudioTrackSwitching(e,i){const s=!!i.url;this.trackId=i.id;const{fragCurrent:o}=this;o&&(o.abortRequests(),this.removeUnbufferedFrags(o.start)),this.resetLoadingState(),s?(this.switchingTrack=i,this.flushAudioIfNeeded(i),this.state!==be.STOPPED&&(this.setInterval(dR),this.state=be.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=i,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,i){this.mainDetails=i.details;const s=this.cachedTrackLoadedData;s&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(O.AUDIO_TRACK_LOADED,s))}onAudioTrackLoaded(e,i){var s;const{levels:o}=this,{details:u,id:d,groupId:g,track:S}=i;if(!o){this.warn(`Audio tracks reset while loading track ${d} "${S.name}" of "${g}"`);return}const v=this.mainDetails;if(!v||u.endCC>v.endCC||v.expired){this.cachedTrackLoadedData=i,this.state!==be.STOPPED&&(this.state=be.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${d} "${S.name}" of "${g}" loaded [${u.startSN},${u.endSN}]${u.lastPartSn?`[part-${u.lastPartSn}-${u.lastPartIndex}]`:""},duration:${u.totalduration}`);const E=o[d];let b=0;if(u.live||(s=E.details)!=null&&s.live){if(this.checkLiveUpdate(u),u.deltaUpdateFailed)return;if(E.details){var R;b=this.alignPlaylists(u,E.details,(R=this.levelLastLoaded)==null?void 0:R.details)}u.alignedSliding||(BA(u,v),u.alignedSliding||Tv(u,v),b=u.fragmentStart)}E.details=u,this.levelLastLoaded=E,this.startFragRequested||this.setStartPosition(v,b),this.hls.trigger(O.AUDIO_TRACK_UPDATED,{details:u,id:d,groupId:i.groupId}),this.state===be.WAITING_TRACK&&!this.waitForCdnTuneIn(u)&&(this.state=be.IDLE),this.tick()}_handleFragmentLoadProgress(e){var i;const s=e.frag,{part:o,payload:u}=e,{config:d,trackId:g,levels:S}=this;if(!S){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const v=S[g];if(!v){this.warn("Audio track is undefined on fragment load progress");return}const E=v.details;if(!E){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(s.start);return}const b=d.defaultAudioCodec||v.audioCodec||"mp4a.40.2";let R=this.transmuxer;R||(R=this.transmuxer=new fR(this.hls,Be.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const _=this.initPTS[s.cc],D=(i=s.initSegment)==null?void 0:i.data;if(_!==void 0){const M=o?o.index:-1,w=M!==-1,B=new IT(s.level,s.sn,s.stats.chunkCount,u.byteLength,M,w);R.push(u,D,b,"",s,o,E.totalduration,!1,B,_)}else{this.log(`Unknown video PTS for cc ${s.cc}, waiting for video PTS before demuxing audio frag ${s.sn} of [${E.startSN} ,${E.endSN}],track ${g}`);const{cache:I}=this.waitingData=this.waitingData||{frag:s,part:o,cache:new FA,complete:!1};I.push(new Uint8Array(u)),this.state!==be.STOPPED&&(this.state=be.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,i){this.bufferFlushed=this.flushing=!1;const s=i.tracks.audio;s&&(this.mediaBuffer=s.buffer||null)}onFragLoading(e,i){!this.audioOnly&&i.frag.type===Be.MAIN&&Vn(i.frag)&&(this.mainFragLoading=i,this.state===be.IDLE&&this.tick())}onFragBuffered(e,i){const{frag:s,part:o}=i;if(s.type!==Be.AUDIO){!this.audioOnly&&s.type===Be.MAIN&&!s.elementaryStreams.video&&!s.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${o?" p: "+o.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(Vn(s)){this.fragPrevious=s;const u=this.switchingTrack;u&&(this.bufferedTrack=u,this.switchingTrack=null,this.hls.trigger(O.AUDIO_TRACK_SWITCHED,Qt({},u)))}this.fragBufferedComplete(s,o),this.media&&this.tick()}onError(e,i){var s;if(i.fatal){this.state=be.ERROR;return}switch(i.details){case re.FRAG_GAP:case re.FRAG_PARSING_ERROR:case re.FRAG_DECRYPT_ERROR:case re.FRAG_LOAD_ERROR:case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_ERROR:case re.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Be.AUDIO,i);break;case re.AUDIO_TRACK_LOAD_ERROR:case re.AUDIO_TRACK_LOAD_TIMEOUT:case re.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===be.WAITING_TRACK&&((s=i.context)==null?void 0:s.type)===xt.AUDIO_TRACK&&(this.state=be.IDLE);break;case re.BUFFER_ADD_CODEC_ERROR:case re.BUFFER_APPEND_ERROR:if(i.parent!=="audio")return;this.reduceLengthAndFlushBuffer(i)||this.resetLoadingState();break;case re.BUFFER_FULL_ERROR:if(i.parent!=="audio")return;this.reduceLengthAndFlushBuffer(i)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case re.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onBufferFlushing(e,{type:i}){i!==ln.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:i}){if(i!==ln.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===be.ENDED&&(this.state=be.IDLE);const s=this.mediaBuffer||this.media;s&&(this.afterBufferFlushed(s,i,Be.AUDIO),this.tick())}}_handleTransmuxComplete(e){var i;const s="audio",{hls:o}=this,{remuxResult:u,chunkMeta:d}=e,g=this.getCurrentContext(d);if(!g){this.resetWhenMissingContext(d);return}const{frag:S,part:v,level:E}=g,{details:b}=E,{audio:R,text:_,id3:D,initSegment:I}=u;if(this.fragContextChanged(S)||!b){this.fragmentTracker.removeFragment(S);return}if(this.state=be.PARSING,this.switchingTrack&&R&&this.completeAudioSwitch(this.switchingTrack),I!=null&&I.tracks){const M=S.initSegment||S;if(this.unhandledEncryptionError(I,S))return;this._bufferInitSegment(E,I.tracks,M,d),o.trigger(O.FRAG_PARSING_INIT_SEGMENT,{frag:M,id:s,tracks:I.tracks})}if(R){const{startPTS:M,endPTS:w,startDTS:B,endDTS:z}=R;v&&(v.elementaryStreams[ln.AUDIO]={startPTS:M,endPTS:w,startDTS:B,endDTS:z}),S.setElementaryStreamInfo(ln.AUDIO,M,w,B,z),this.bufferFragmentData(R,S,v,d)}if(D!=null&&(i=D.samples)!=null&&i.length){const M=Jt({id:s,frag:S,details:b},D);o.trigger(O.FRAG_PARSING_METADATA,M)}if(_){const M=Jt({id:s,frag:S,details:b},_);o.trigger(O.FRAG_PARSING_USERDATA,M)}}_bufferInitSegment(e,i,s,o){if(this.state!==be.PARSING||(i.video&&delete i.video,i.audiovideo&&delete i.audiovideo,!i.audio))return;const u=i.audio;u.id=Be.AUDIO;const d=e.audioCodec;this.log(`Init audio buffer, container:${u.container}, codecs[level/parsed]=[${d}/${u.codec}]`),d&&d.split(",").length===1&&(u.levelCodec=d),this.hls.trigger(O.BUFFER_CODECS,i);const g=u.initSegment;if(g!=null&&g.byteLength){const S={type:"audio",frag:s,part:null,chunkMeta:o,parent:s.type,data:g};this.hls.trigger(O.BUFFER_APPENDING,S)}this.tickImmediate()}loadFragment(e,i,s){const o=this.fragmentTracker.getState(e);if(this.switchingTrack||o===yi.NOT_LOADED||o===yi.PARTIAL){var u;if(!Vn(e))this._loadInitSegment(e,i);else if((u=i.details)!=null&&u.live&&!this.initPTS[e.cc]){this.log(`Waiting for video PTS in continuity counter ${e.cc} of live stream before loading audio fragment ${e.sn} of level ${this.trackId}`),this.state=be.WAITING_INIT_PTS;const d=this.mainDetails;d&&d.fragmentStart!==i.details.fragmentStart&&Tv(i.details,d)}else super.loadFragment(e,i,s)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:i,lang:s,assocLang:o,characteristics:u,audioCodec:d,channels:g}=this.bufferedTrack;Tf({name:i,lang:s,assocLang:o,characteristics:u,audioCodec:d,channels:g},e,bf)||(hv(e.url,this.hls)?(this.log("Switching audio track : flushing all audio"),super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"),this.bufferedTrack=null):this.bufferedTrack=e)}}completeAudioSwitch(e){const{hls:i}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,i.trigger(O.AUDIO_TRACK_SWITCHED,Qt({},e))}}class ib extends Xs{constructor(e,i){super(i,e.logger),this.hls=void 0,this.canLoad=!1,this.timer=-1,this.hls=e}destroy(){this.clearTimer(),this.hls=this.log=this.warn=null}clearTimer(){this.timer!==-1&&(self.clearTimeout(this.timer),this.timer=-1)}startLoad(){this.canLoad=!0,this.loadPlaylist()}stopLoad(){this.canLoad=!1,this.clearTimer()}switchParams(e,i,s){const o=i==null?void 0:i.renditionReports;if(o){let u=-1;for(let d=0;d<o.length;d++){const g=o[d];let S;try{S=new self.URL(g.URI,i.url).href}catch(v){this.warn(`Could not construct new URL for Rendition Report: ${v}`),S=g.URI||""}if(S===e){u=d;break}else S===e.substring(0,S.length)&&(u=d)}if(u!==-1){const d=o[u],g=parseInt(d["LAST-MSN"])||i.lastPartSn;let S=parseInt(d["LAST-PART"])||i.lastPartIndex;if(this.hls.config.lowLatencyMode){const E=Math.min(i.age-i.partTarget,i.targetduration);S>=0&&E>i.partTarget&&(S+=1)}const v=s&&Px(s);return new Gx(g,S>=0?S:void 0,v)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,i){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,i){if(i)try{return i.addDirectives(e)}catch(s){this.warn(`Could not construct new URL with HLS Delivery Directives: ${s}`)}return e}playlistLoaded(e,i,s){const{details:o,stats:u}=i,d=self.performance.now(),g=u.loading.first?Math.max(0,d-u.loading.first):0;o.advancedDateTime=Date.now()-g;const S=this.hls.config.timelineOffset;if(S!==o.appliedTimelineOffset){const E=Math.max(S||0,0);o.appliedTimelineOffset=E,o.fragments.forEach(b=>{b.setStart(b.playlistOffset+E)})}if(o.live||s!=null&&s.live){const E="levelInfo"in i?i.levelInfo:i.track;if(o.reloaded(s),s&&o.fragments.length>0){g2(s,o,this);const B=o.playlistParsingError;if(B){this.warn(B);const z=this.hls;if(!z.config.ignorePlaylistParsingErrors){var v;const{networkDetails:G}=i;z.trigger(O.ERROR,{type:je.NETWORK_ERROR,details:re.LEVEL_PARSING_ERROR,fatal:!1,url:o.url,error:B,reason:B.message,level:i.level||void 0,parent:(v=o.fragments[0])==null?void 0:v.type,networkDetails:G,stats:u});return}o.playlistParsingError=null}}o.requestScheduled===-1&&(o.requestScheduled=u.loading.start);const b=this.hls.mainForwardBufferInfo,R=b?b.end-b.len:0,_=(o.edge-R)*1e3,D=CA(o,_);if(o.requestScheduled+D<d?o.requestScheduled=d:o.requestScheduled+=D,this.log(`live playlist ${e} ${o.advanced?"REFRESHED "+o.lastPartSn+"-"+o.lastPartIndex:o.updated?"UPDATED":"MISSED"}`),!this.canLoad||!o.live)return;let I,M,w;if(o.canBlockReload&&o.endSN&&o.advanced){const B=this.hls.config.lowLatencyMode,z=o.lastPartSn,G=o.endSN,K=o.lastPartIndex,ae=K!==-1,q=z===G;ae?q?(M=G+1,w=B?0:K):(M=z,w=B?K+1:o.maxPartIndex):M=G+1;const Z=o.age,te=Z+o.ageHeader;let $=Math.min(te-o.partTarget,o.targetduration*1.5);if($>0){if(te>o.targetduration*3)this.log(`Playlist last advanced ${Z.toFixed(2)}s ago. Omitting segment and part directives.`),M=void 0,w=void 0;else if(s!=null&&s.tuneInGoal&&te-o.partTarget>s.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${s.tuneInGoal} to: ${$} with playlist age: ${o.age}`),$=0;else{const me=Math.floor($/o.targetduration);if(M+=me,w!==void 0){const Ee=Math.round($%o.targetduration/o.partTarget);w+=Ee}this.log(`CDN Tune-in age: ${o.ageHeader}s last advanced ${Z.toFixed(2)}s goal: ${$} skip sn ${me} to part ${w}`)}o.tuneInGoal=$}if(I=this.getDeliveryDirectives(o,i.deliveryDirectives,M,w),B||!q){o.requestScheduled=d,this.loadingPlaylist(E,I);return}}else(o.canBlockReload||o.canSkipUntil)&&(I=this.getDeliveryDirectives(o,i.deliveryDirectives,M,w));I&&M!==void 0&&o.canBlockReload&&(o.requestScheduled=u.loading.first+Math.max(D-g*2,D/2)),this.scheduleLoading(E,I,o)}else this.clearTimer()}scheduleLoading(e,i,s){const o=s||e.details;if(!o){this.loadingPlaylist(e,i);return}const u=self.performance.now(),d=o.requestScheduled;if(u>=d){this.loadingPlaylist(e,i);return}const g=d-u;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(g)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,i),g)}getDeliveryDirectives(e,i,s,o){let u=Px(e);return i!=null&&i.skip&&e.deltaUpdateFailed&&(s=i.msn,o=i.part,u=dv.No),new Gx(s,o,u)}checkRetry(e){const i=e.details,s=mv(e),o=e.errorAction,{action:u,retryCount:d=0,retryConfig:g}=o||{},S=!!o&&!!g&&(u===Fi.RetryRequest||!o.resolved&&u===Fi.SendAlternateToPenaltyBox);if(S){var v;if(d>=g.maxNumRetry)return!1;if(s&&(v=e.context)!=null&&v.deliveryDirectives)this.warn(`Retrying playlist loading ${d+1}/${g.maxNumRetry} after "${i}" without delivery-directives`),this.loadPlaylist();else{const E=CT(g,d);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),E),this.warn(`Retrying playlist loading ${d+1}/${g.maxNumRetry} after "${i}" in ${E}ms`)}e.levelRetry=!0,o.resolved=!0}return S}}function hR(h,e){if(h.length!==e.length)return!1;for(let i=0;i<h.length;i++)if(!r0(h[i].attrs,e[i].attrs))return!1;return!0}function r0(h,e,i){const s=h["STABLE-RENDITION-ID"];return s&&!i?s===e["STABLE-RENDITION-ID"]:!(i||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(o=>h[o]!==e[o])}function ab(h,e){return e.label.toLowerCase()===h.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(h.lang||"").toLowerCase())}class AO extends ib{constructor(e){super(e,"audio-track-controller"),this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.registerListeners()}registerListeners(){const{hls:e}=this;e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_PARSED,this.onManifestParsed,this),e.on(O.LEVEL_LOADING,this.onLevelLoading,this),e.on(O.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(O.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(O.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_PARSED,this.onManifestParsed,this),e.off(O.LEVEL_LOADING,this.onLevelLoading,this),e.off(O.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(O.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(O.ERROR,this.onError,this)}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,super.destroy()}onManifestLoading(){this.tracks=[],this.tracksInGroup=[],this.groupIds=null,this.currentTrack=null,this.trackId=-1,this.selectDefaultTrack=!0}onManifestParsed(e,i){this.tracks=i.audioTracks||[]}onAudioTrackLoaded(e,i){const{id:s,groupId:o,details:u}=i,d=this.tracksInGroup[s];if(!d||d.groupId!==o){this.warn(`Audio track with id:${s} and group:${o} not found in active group ${d==null?void 0:d.groupId}`);return}const g=d.details;d.details=i.details,this.log(`Audio track ${s} "${d.name}" lang:${d.lang} group:${o} loaded [${u.startSN}-${u.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,g)}onLevelLoading(e,i){this.switchLevel(i.level)}onLevelSwitching(e,i){this.switchLevel(i.level)}switchLevel(e){const i=this.hls.levels[e];if(!i)return;const s=i.audioGroups||null,o=this.groupIds;let u=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(g=>(o==null?void 0:o.indexOf(g))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const g=this.tracks.filter(R=>!s||s.indexOf(R.groupId)!==-1);if(g.length)this.selectDefaultTrack&&!g.some(R=>R.default)&&(this.selectDefaultTrack=!1),g.forEach((R,_)=>{R.id=_});else if(!u&&!this.tracksInGroup.length)return;this.tracksInGroup=g;const S=this.hls.config.audioPreference;if(!u&&S){const R=xr(S,g,bf);if(R>-1)u=g[R];else{const _=xr(S,this.tracks);u=this.tracks[_]}}let v=this.findTrackId(u);v===-1&&u&&(v=this.findTrackId(null));const E={audioTracks:g};this.log(`Updating audio tracks, ${g.length} track(s) found in group(s): ${s==null?void 0:s.join(",")}`),this.hls.trigger(O.AUDIO_TRACKS_UPDATED,E);const b=this.trackId;if(v!==-1&&b===-1)this.setAudioTrack(v);else if(g.length&&b===-1){var d;const R=new Error(`No audio track selected for current audio group-ID(s): ${(d=this.groupIds)==null?void 0:d.join(",")} track count: ${g.length}`);this.warn(R.message),this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:R})}}}onError(e,i){i.fatal||!i.context||i.context.type===xt.AUDIO_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&this.checkRetry(i)}get allAudioTracks(){return this.tracks}get audioTracks(){return this.tracksInGroup}get audioTrack(){return this.trackId}set audioTrack(e){this.selectDefaultTrack=!1,this.setAudioTrack(e)}setAudioOption(e){const i=this.hls;if(i.config.audioPreference=e,e){const s=this.allAudioTracks;if(this.selectDefaultTrack=!1,s.length){const o=this.currentTrack;if(o&&Tf(e,o,bf))return o;const u=xr(e,this.tracksInGroup,bf);if(u>-1){const d=this.tracksInGroup[u];return this.setAudioTrack(u),d}else if(o){let d=i.loadLevel;d===-1&&(d=i.firstAutoLevel);const g=kC(e,i.levels,s,d,bf);if(g===-1)return null;i.nextLoadLevel=g}if(e.channels||e.audioCodec){const d=xr(e,s);if(d>-1)return s[d]}}}return null}setAudioTrack(e){const i=this.tracksInGroup;if(e<0||e>=i.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[e],u=o.details&&!o.details.live;if(e===this.trackId&&o===s&&u||(this.log(`Switching to audio-track ${e} "${o.name}" lang:${o.lang} group:${o.groupId} channels:${o.channels}`),this.trackId=e,this.currentTrack=o,this.hls.trigger(O.AUDIO_TRACK_SWITCHING,Qt({},o)),u))return;const d=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(d)}findTrackId(e){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(!(this.selectDefaultTrack&&!o.default)&&(!e||Tf(e,o,bf)))return s}if(e){const{name:s,lang:o,assocLang:u,characteristics:d,audioCodec:g,channels:S}=e;for(let v=0;v<i.length;v++){const E=i[v];if(Tf({name:s,lang:o,assocLang:u,characteristics:d,audioCodec:g,channels:S},E,bf))return v}for(let v=0;v<i.length;v++){const E=i[v];if(r0(e.attrs,E.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return v}for(let v=0;v<i.length;v++){const E=i[v];if(r0(e.attrs,E.attrs,["LANGUAGE"]))return v}}return-1}loadPlaylist(e){super.loadPlaylist();const i=this.currentTrack;this.shouldLoadPlaylist(i)&&hv(i.url,this.hls)&&this.scheduleLoading(i,e)}loadingPlaylist(e,i){super.loadingPlaylist(e,i);const s=e.id,o=e.groupId,u=this.getUrlWithDirectives(e.url,i),d=e.details,g=d==null?void 0:d.age;this.log(`Loading audio-track ${s} "${e.name}" lang:${e.lang} group:${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${g&&d.live?" age "+g.toFixed(1)+(d.type&&" "+d.type||""):""} ${u}`),this.hls.trigger(O.AUDIO_TRACK_LOADING,{url:u,id:s,groupId:o,deliveryDirectives:i||null,track:e})}}class RO{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,i,s){if(this.queues===null||this.tracks===null)return;const o=this.queues[i];o.push(e),o.length===1&&!s&&this.executeNext(i)}appendBlocker(e){return new Promise(i=>{const s={label:"async-blocker",execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(s,e)})}prependBlocker(e){return new Promise(i=>{if(this.queues){const s={label:"async-blocker-prepend",execute:i,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(s)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var i;const s=(i=e[0])==null?void 0:i.label;(s==="async-blocker"||s==="async-blocker-prepend")&&(e[0].execute(),e.splice(0,1))})}unblockAudio(e){if(this.queues===null)return;this.queues.audio[0]===e&&this.shiftAndExecuteNext("audio")}executeNext(e){if(this.queues===null||this.tracks===null)return;const i=this.queues[e];if(i.length){const o=i[0];try{o.execute()}catch(u){var s;if(o.onError(u),this.queues===null||this.tracks===null)return;const d=(s=this.tracks[e])==null?void 0:s.buffer;d!=null&&d.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var i;return((i=this.queues)==null?void 0:i[e][0])||null}toString(){const{queues:e,tracks:i}=this;return e===null||i===null?"<destroyed>":`
299
+ ${this.list("video")}
300
+ ${this.list("audio")}
301
+ ${this.list("audiovideo")}}`}list(e){var i,s;return(i=this.queues)!=null&&i[e]||(s=this.tracks)!=null&&s[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var i;const s=(i=this.tracks)==null?void 0:i[e],o=s==null?void 0:s.buffer;return o?`SourceBuffer${o.updating?" updating":""}${s.ended?" ended":""}${s.ending?" ending":""}`:"none"}listOps(e){var i;return((i=this.queues)==null?void 0:i[e].map(s=>s.label).join(", "))||""}}const mR=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,gR="HlsJsTrackRemovedError";class DO extends Error{constructor(e){super(e),this.name=gR}}class LO extends Xs{constructor(e,i){super("buffer-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.details=null,this._objectUrl=null,this.operationQueue=null,this.bufferCodecEventsTotal=0,this.media=null,this.mediaSource=null,this.lastMpegAudioChunk=null,this.blockedAudioAppend=null,this.lastVideoAppendEnd=0,this.appendSource=void 0,this.transferData=void 0,this.overrides=void 0,this.appendErrors={audio:0,video:0,audiovideo:0},this.tracks={},this.sourceBuffers=[[null,null],[null,null]],this._onEndStreaming=s=>{var o;this.hls&&((o=this.mediaSource)==null?void 0:o.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=s=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=s=>{const{media:o,mediaSource:u}=this;s&&this.log("Media source opened"),!(!o||!u)&&(u.removeEventListener("sourceopen",this._onMediaSourceOpen),o.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(O.MEDIA_ATTACHED,{media:o,mediaSource:u}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:s,_objectUrl:o}=this;s!==o&&this.error(`Media element src was set while attaching MediaSource (${o} > ${s})`)},this.hls=e,this.fragmentTracker=i,this.appendSource=X_(Nu(e.config.preferManagedMediaSource)),this.initTracks(),this.registerListeners()}hasSourceTypes(){return Object.keys(this.tracks).length>0}destroy(){this.unregisterListeners(),this.details=null,this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.transferData=this.overrides=void 0,this.operationQueue&&(this.operationQueue.destroy(),this.operationQueue=null),this.hls=this.fragmentTracker=null,this._onMediaSourceOpen=this._onMediaSourceClose=null,this._onMediaSourceEnded=null,this._onStartStreaming=this._onEndStreaming=null}registerListeners(){const{hls:e}=this;e.on(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_PARSED,this.onManifestParsed,this),e.on(O.BUFFER_RESET,this.onBufferReset,this),e.on(O.BUFFER_APPENDING,this.onBufferAppending,this),e.on(O.BUFFER_CODECS,this.onBufferCodecs,this),e.on(O.BUFFER_EOS,this.onBufferEos,this),e.on(O.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(O.FRAG_PARSED,this.onFragParsed,this),e.on(O.FRAG_CHANGED,this.onFragChanged,this),e.on(O.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_PARSED,this.onManifestParsed,this),e.off(O.BUFFER_RESET,this.onBufferReset,this),e.off(O.BUFFER_APPENDING,this.onBufferAppending,this),e.off(O.BUFFER_CODECS,this.onBufferCodecs,this),e.off(O.BUFFER_EOS,this.onBufferEos,this),e.off(O.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(O.FRAG_PARSED,this.onFragParsed,this),e.off(O.FRAG_CHANGED,this.onFragChanged,this),e.off(O.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:i}=this;if(!e)return null;const s={};if(this.operationQueue){const u=this.isUpdating();u||this.operationQueue.removeBlockers();const d=this.isQueued();(u||d)&&this.warn(`Transfering MediaSource with${d?" operations in queue":""}${u?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const o=this.transferData;return!this.sourceBufferCount&&o&&o.mediaSource===i?Jt(s,o.tracks):this.sourceBuffers.forEach(u=>{const[d]=u;d&&(s[d]=Jt({},this.tracks[d]),this.removeBuffer(d)),u[0]=u[1]=null}),{media:e,mediaSource:i,tracks:s}}initTracks(){const e={};this.sourceBuffers=[[null,null],[null,null]],this.tracks=e,this.resetQueue(),this.resetAppendErrors(),this.lastMpegAudioChunk=this.blockedAudioAppend=null,this.lastVideoAppendEnd=0}onManifestLoading(){this.bufferCodecEventsTotal=0,this.details=null}onManifestParsed(e,i){var s;let o=2;(i.audio&&!i.video||!i.altAudio)&&(o=1),this.bufferCodecEventsTotal=o,this.log(`${o} bufferCodec event(s) expected.`),(s=this.transferData)!=null&&s.mediaSource&&this.sourceBufferCount&&o&&this.bufferCreated()}onMediaAttaching(e,i){const s=this.media=i.media;this.transferData=this.overrides=void 0;const o=Nu(this.appendSource);if(o){const u=!!i.mediaSource;(u||i.overrides)&&(this.transferData=i,this.overrides=i.overrides);const d=this.mediaSource=i.mediaSource||new o;if(this.assignMediaSource(d),u)this._objectUrl=s.src,this.attachTransferred();else{const g=this._objectUrl=self.URL.createObjectURL(d);if(this.appendSource)try{s.removeAttribute("src");const S=self.ManagedMediaSource;s.disableRemotePlayback=s.disableRemotePlayback||S&&d instanceof S,pR(s),_O(s,g),s.load()}catch{s.src=g}else s.src=g}s.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var i,s;this.log(`${((i=this.transferData)==null?void 0:i.mediaSource)===e?"transferred":"created"} media source: ${(s=e.constructor)==null?void 0:s.name}`),e.addEventListener("sourceopen",this._onMediaSourceOpen),e.addEventListener("sourceended",this._onMediaSourceEnded),e.addEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(e.addEventListener("startstreaming",this._onStartStreaming),e.addEventListener("endstreaming",this._onEndStreaming))}attachTransferred(){const e=this.media,i=this.transferData;if(!i||!e)return;const s=this.tracks,o=i.tracks,u=o?Object.keys(o):null,d=u?u.length:0,g=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(o&&u&&d){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
302
+ required tracks: ${rn(s,(S,v)=>S==="initSegment"?void 0:v)};
303
+ transfer tracks: ${rn(o,(S,v)=>S==="initSegment"?void 0:v)}}`),!yx(o,s)){i.mediaSource=null,i.tracks=void 0;const S=e.currentTime,v=this.details,E=Math.max(S,(v==null?void 0:v.fragments[0].start)||0);if(E-S>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${S} -> ${E}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(o)}"->"${Object.keys(s)}") start time: ${E} currentTime: ${S}`),this.onMediaDetaching(O.MEDIA_DETACHING,{}),this.onMediaAttaching(O.MEDIA_ATTACHING,i),e.currentTime=E;return}this.transferData=void 0,u.forEach(S=>{const v=S,E=o[v];if(E){const b=E.buffer;if(b){const R=this.fragmentTracker,_=E.id;if(R.hasFragments(_)||R.hasParts(_)){const M=lt.getBuffered(b);R.detectEvictedFragments(v,M,_,null,!0)}const D=sb(v),I=[v,b];this.sourceBuffers[D]=I,b.updating&&this.operationQueue&&this.operationQueue.prependBlocker(v),this.trackSourceBuffer(v,E)}}}),g(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),g()}get mediaSourceOpenOrEnded(){var e;const i=(e=this.mediaSource)==null?void 0:e.readyState;return i==="open"||i==="ended"}onMediaDetaching(e,i){const s=!!i.transferMedia;this.transferData=this.overrides=void 0;const{media:o,mediaSource:u,_objectUrl:d}=this;if(u){if(this.log(`media source ${s?"transferring":"detaching"}`),s)this.sourceBuffers.forEach(([g])=>{g&&this.removeBuffer(g)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const g=u.readyState==="open";try{const S=u.sourceBuffers;for(let v=S.length;v--;)g&&S[v].abort(),u.removeSourceBuffer(S[v]);g&&u.endOfStream()}catch(S){this.warn(`onMediaDetaching: ${S.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}u.removeEventListener("sourceopen",this._onMediaSourceOpen),u.removeEventListener("sourceended",this._onMediaSourceEnded),u.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(u.removeEventListener("startstreaming",this._onStartStreaming),u.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}o&&(o.removeEventListener("emptied",this._onMediaEmptied),s||(d&&self.URL.revokeObjectURL(d),this.mediaSrc===d?(o.removeAttribute("src"),this.appendSource&&pR(o),o.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(O.MEDIA_DETACHED,i)}onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var i;const s=(i=this.tracks[e])==null?void 0:i.buffer;if(this.removeBuffer(e),s)try{var o;(o=this.mediaSource)!=null&&o.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(s)}catch(u){this.warn(`onBufferReset ${e}`,u)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[sb(e)]=[null,null];const i=this.tracks[e];i&&(i.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new RO(this.tracks)}onBufferCodecs(e,i){var s;const o=this.tracks,u=Object.keys(i);this.log(`BUFFER_CODECS: "${u}" (current SB count ${this.sourceBufferCount})`);const d="audiovideo"in i&&(o.audio||o.video)||o.audiovideo&&("audio"in i||"video"in i),g=!d&&this.sourceBufferCount&&this.media&&u.some(S=>!o[S]);if(d||g){this.warn(`Unsupported transition between "${Object.keys(o)}" and "${u}" SourceBuffers`);return}u.forEach(S=>{var v,E;const b=i[S],{id:R,codec:_,levelCodec:D,container:I,metadata:M,supplemental:w}=b;let B=o[S];const z=(v=this.transferData)==null||(v=v.tracks)==null?void 0:v[S],G=z!=null&&z.buffer?z:B,K=(G==null?void 0:G.pendingCodec)||(G==null?void 0:G.codec),ae=G==null?void 0:G.levelCodec;B||(B=o[S]={buffer:void 0,listeners:[],codec:_,supplemental:w,container:I,levelCodec:D,metadata:M,id:R});const q=cv(K,ae),Z=q==null?void 0:q.replace(mR,"$1");let te=cv(_,D);const $=(E=te)==null?void 0:E.replace(mR,"$1");te&&q&&Z!==$&&(S.slice(0,5)==="audio"&&(te=uv(te,this.appendSource)),this.log(`switching codec ${K} to ${te}`),te!==(B.pendingCodec||B.codec)&&(B.pendingCodec=te),B.container=I,this.appendChangeType(S,I,te))}),(this.tracksReady||this.sourceBufferCount)&&(i.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!i.video&&((s=i.audio)==null?void 0:s.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,i)=>{const s=this.tracks[i];return e[i]={id:s.id,container:s.container,codec:s.codec,levelCodec:s.levelCodec},e},{})}appendChangeType(e,i,s){const o=`${i};codecs=${s}`,u={label:`change-type=${o}`,execute:()=>{const d=this.tracks[e];if(d){const g=d.buffer;g!=null&&g.changeType&&(this.log(`changing ${e} sourceBuffer type to ${o}`),g.changeType(o),d.codec=s,d.container=i)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:d=>{this.warn(`Failed to change ${e} SourceBuffer type`,d)}};this.append(u,e,this.isPending(this.tracks[e]))}blockAudio(e){var i;const s=e.start,o=s+e.duration*.05;if(((i=this.fragmentTracker.getAppendedFrag(s,Be.MAIN))==null?void 0:i.gap)===!0)return;const d={label:"block-audio",execute:()=>{var g;const S=this.tracks.video;(this.lastVideoAppendEnd>o||S!=null&&S.buffer&&lt.isBuffered(S.buffer,o)||((g=this.fragmentTracker.getAppendedFrag(o,Be.MAIN))==null?void 0:g.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:g=>{this.warn("Error executing block-audio operation",g)}};this.blockedAudioAppend={op:d,frag:e},this.append(d,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:i}=this;e&&i&&(this.blockedAudioAppend=null,i.unblockAudio(e.op))}onBufferAppending(e,i){const{tracks:s}=this,{data:o,type:u,parent:d,frag:g,part:S,chunkMeta:v,offset:E}=i,b=v.buffering[u],{sn:R,cc:_}=g,D=self.performance.now();b.start=D;const I=g.stats.buffering,M=S?S.stats.buffering:null;I.start===0&&(I.start=D),M&&M.start===0&&(M.start=D);const w=s.audio;let B=!1;u==="audio"&&(w==null?void 0:w.container)==="audio/mpeg"&&(B=!this.lastMpegAudioChunk||v.id===1||this.lastMpegAudioChunk.sn!==v.sn,this.lastMpegAudioChunk=v);const z=s.video,G=z==null?void 0:z.buffer;if(G&&R!=="initSegment"){const q=S||g,Z=this.blockedAudioAppend;if(u==="audio"&&d!=="main"&&!this.blockedAudioAppend&&!(z.ending||z.ended)){const $=q.start+q.duration*.05,me=G.buffered,Ee=this.currentOp("video");!me.length&&!Ee?this.blockAudio(q):!Ee&&!lt.isBuffered(G,$)&&this.lastVideoAppendEnd<$&&this.blockAudio(q)}else if(u==="video"){const te=q.end;if(Z){const $=Z.frag.start;(te>$||te<this.lastVideoAppendEnd||lt.isBuffered(G,$))&&this.unblockAudio()}this.lastVideoAppendEnd=te}}const K=(S||g).start,ae={label:`append-${u}`,execute:()=>{var q;b.executeStart=self.performance.now();const Z=(q=this.tracks[u])==null?void 0:q.buffer;Z&&(B?this.updateTimestampOffset(Z,K,.1,u,R,_):E!==void 0&&Ue(E)&&this.updateTimestampOffset(Z,E,1e-6,u,R,_)),this.appendExecutor(o,u)},onStart:()=>{},onComplete:()=>{const q=self.performance.now();b.executeEnd=b.end=q,I.first===0&&(I.first=q),M&&M.first===0&&(M.first=q);const Z={};this.sourceBuffers.forEach(([te,$])=>{te&&(Z[te]=lt.getBuffered($))}),this.appendErrors[u]=0,u==="audio"||u==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(O.BUFFER_APPENDED,{type:u,frag:g,part:S,chunkMeta:v,parent:g.type,timeRanges:Z})},onError:q=>{var Z;const te={type:je.MEDIA_ERROR,parent:g.type,details:re.BUFFER_APPEND_ERROR,sourceBufferName:u,frag:g,part:S,chunkMeta:v,error:q,err:q,fatal:!1},$=(Z=this.media)==null?void 0:Z.error;if(q.code===DOMException.QUOTA_EXCEEDED_ERR||q.name=="QuotaExceededError"||"quota"in q)te.details=re.BUFFER_FULL_ERROR;else if(q.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!$)te.errorAction=ph(!0);else if(q.name===gR&&this.sourceBufferCount===0)te.errorAction=ph(!0);else{const me=++this.appendErrors[u];this.warn(`Failed ${me}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${u}" sourceBuffer (${$||"no media error"})`),(me>=this.hls.config.appendErrorMaxRetry||$)&&(te.fatal=!0)}this.hls.trigger(O.ERROR,te)}};this.log(`queuing "${u}" append sn: ${R}${S?" p: "+S.index:""} of ${g.type===Be.MAIN?"level":"track"} ${g.level} cc: ${_}`),this.append(ae,u,this.isPending(this.tracks[u]))}getFlushOp(e,i,s){return this.log(`queuing "${e}" remove ${i}-${s}`),{label:"remove",execute:()=>{this.removeExecutor(e,i,s)},onStart:()=>{},onComplete:()=>{this.hls.trigger(O.BUFFER_FLUSHED,{type:e})},onError:o=>{this.warn(`Failed to remove ${i}-${s} from "${e}" SourceBuffer`,o)}}}onBufferFlushing(e,i){const{type:s,startOffset:o,endOffset:u}=i;s?this.append(this.getFlushOp(s,o,u),s):this.sourceBuffers.forEach(([d])=>{d&&this.append(this.getFlushOp(d,o,u),d)})}onFragParsed(e,i){const{frag:s,part:o}=i,u=[],d=o?o.elementaryStreams:s.elementaryStreams;d[ln.AUDIOVIDEO]?u.push("audiovideo"):(d[ln.AUDIO]&&u.push("audio"),d[ln.VIDEO]&&u.push("video"));const g=()=>{const S=self.performance.now();s.stats.buffering.end=S,o&&(o.stats.buffering.end=S);const v=o?o.stats:s.stats;this.hls.trigger(O.FRAG_BUFFERED,{frag:s,part:o,stats:v,id:s.type})};u.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${s.type} level: ${s.level} sn: ${s.sn}`),this.blockBuffers(g,u).catch(S=>{this.warn(`Fragment buffered callback ${S}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,i){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const i=this.tracks[e];if(i)return!i.ended||i.ending}return!1})}onBufferEos(e,i){var s;this.sourceBuffers.forEach(([d])=>{if(d){const g=this.tracks[d];(!i.type||i.type===d)&&(g.ending=!0,g.ended||(g.ended=!0,this.log(`${d} buffer reached EOS`)))}});const o=((s=this.overrides)==null?void 0:s.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([d])=>{var g;return d&&!((g=this.tracks[d])!=null&&g.ended)})?o?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:d}=this;if(!d||d.readyState!=="open"){d&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${d.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),d.endOfStream(),this.hls.trigger(O.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(O.BUFFERED_TO_END,void 0)):i.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const i=this.tracks[e];i&&(i.ending=!1)}})}onLevelUpdated(e,{details:i}){i.fragments.length&&(this.details=i,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,i){if(i.details===re.BUFFER_APPEND_ERROR&&i.frag){var s;const o=(s=i.errorAction)==null?void 0:s.nextAutoLevel;Ue(o)&&o!==i.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:i,media:s}=this;if(!s||i===null||!this.sourceBufferCount)return;const o=e.config,u=s.currentTime,d=i.levelTargetDuration,g=i.live&&o.liveBackBufferLength!==null?o.liveBackBufferLength:o.backBufferLength;if(Ue(g)&&g>=0){const v=Math.max(g,d),E=Math.floor(u/d)*d-v;this.flushBackBuffer(u,d,E)}const S=o.frontBufferFlushThreshold;if(Ue(S)&&S>0){const v=Math.max(o.maxBufferLength,S),E=Math.max(v,d),b=Math.floor(u/d)*d+E;this.flushFrontBuffer(u,d,b)}}flushBackBuffer(e,i,s){this.sourceBuffers.forEach(([o,u])=>{if(u){const g=lt.getBuffered(u);if(g.length>0&&s>g.start(0)){var d;this.hls.trigger(O.BACK_BUFFER_REACHED,{bufferEnd:s});const S=this.tracks[o];if((d=this.details)!=null&&d.live)this.hls.trigger(O.LIVE_BACK_BUFFER_REACHED,{bufferEnd:s});else if(S!=null&&S.ended){this.log(`Cannot flush ${o} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(O.BUFFER_FLUSHING,{startOffset:0,endOffset:s,type:o})}}})}flushFrontBuffer(e,i,s){this.sourceBuffers.forEach(([o,u])=>{if(u){const d=lt.getBuffered(u),g=d.length;if(g<2)return;const S=d.start(g-1),v=d.end(g-1);if(s>S||e>=S&&e<=v)return;this.hls.trigger(O.BUFFER_FLUSHING,{startOffset:S,endOffset:1/0,type:o})}})}getDurationAndRange(){var e;const{details:i,mediaSource:s}=this;if(!i||!this.media||(s==null?void 0:s.readyState)!=="open")return null;const o=i.edge;if(i.live&&this.hls.config.liveDurationInfinity){if(i.fragments.length&&s.setLiveSeekableRange){const v=Math.max(0,i.fragmentStart),E=Math.max(v,o);return{duration:1/0,start:v,end:E}}return{duration:1/0}}const u=(e=this.overrides)==null?void 0:e.duration;if(u)return Ue(u)?{duration:u}:null;const d=this.media.duration,g=Ue(s.duration)?s.duration:0;return o>g&&o>d||!Ue(d)?{duration:o}:null}updateMediaSource({duration:e,start:i,end:s}){const o=this.mediaSource;!this.media||!o||o.readyState!=="open"||(o.duration!==e&&(Ue(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),o.duration=e),i!==void 0&&s!==void 0&&(this.log(`MediaSource duration is set to ${o.duration}. Setting seekable range to ${i}-${s}.`),o.setLiveSeekableRange(i,s)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:i,tracks:s}=this;if(this.log(`checkPendingTracks (pending: ${i} codec events expected: ${e}) ${rn(s)}`),this.tracksReady){var o;const u=(o=this.transferData)==null?void 0:o.tracks;u&&Object.keys(u).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([i,s])=>{if(i){const o=this.tracks[i];e[i]={buffer:s,container:o.container,codec:o.codec,supplemental:o.supplemental,levelCodec:o.levelCodec,id:o.id,metadata:o.metadata}}}),this.hls.trigger(O.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([i])=>{this.executeNext(i)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:i,mediaSource:s}=this;if(!s)throw new Error("createSourceBuffers called when mediaSource was null");for(const u in e){const d=u,g=e[d];if(this.isPending(g)){const S=this.getTrackCodec(g,d),v=`${g.container};codecs=${S}`;g.codec=S,this.log(`creating sourceBuffer(${v})${this.currentOp(d)?" Queued":""} ${rn(g)}`);try{const E=s.addSourceBuffer(v),b=sb(d),R=[d,E];i[b]=R,g.buffer=E}catch(E){var o;this.error(`error while trying to add sourceBuffer: ${E.message}`),this.shiftAndExecuteNext(d),(o=this.operationQueue)==null||o.removeBlockers(),delete this.tracks[d],this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:E,sourceBufferName:d,mimeType:v,parent:g.id});return}this.trackSourceBuffer(d,g)}}this.bufferCreated()}getTrackCodec(e,i){const s=e.supplemental;let o=e.codec;s&&(i==="video"||i==="audiovideo")&&Zg(s,"video")&&(o=yC(o,s));const u=cv(o,e.levelCodec);return u?i.slice(0,5)==="audio"?uv(u,this.appendSource):u:""}trackSourceBuffer(e,i){const s=i.buffer;if(!s)return;const o=this.getTrackCodec(i,e);this.tracks[e]={buffer:s,codec:o,container:i.container,levelCodec:i.levelCodec,supplemental:i.supplemental,metadata:i.metadata,id:i.id,listeners:[]},this.removeBufferListeners(e),this.addBufferListener(e,"updatestart",this.onSBUpdateStart),this.addBufferListener(e,"updateend",this.onSBUpdateEnd),this.addBufferListener(e,"error",this.onSBUpdateError),this.appendSource&&this.addBufferListener(e,"bufferedchange",(u,d)=>{const g=d.removedRanges;g!=null&&g.length&&this.hls.trigger(O.BUFFER_FLUSHED,{type:u})})}get mediaSrc(){var e,i;const s=((e=this.media)==null||(i=e.querySelector)==null?void 0:i.call(e,"source"))||this.media;return s==null?void 0:s.src}onSBUpdateStart(e){const i=this.currentOp(e);i&&i.onStart()}onSBUpdateEnd(e){var i;if(((i=this.mediaSource)==null?void 0:i.readyState)==="closed"){this.resetBuffer(e);return}const s=this.currentOp(e);s&&(s.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,i){var s;const o=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(s=this.mediaSource)==null?void 0:s.readyState}`);this.error(`${o}`,i),this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:o,fatal:!1});const u=this.currentOp(e);u&&u.onError(o)}updateTimestampOffset(e,i,s,o,u,d){const g=i-e.timestampOffset;Math.abs(g)>=s&&(this.log(`Updating ${o} SourceBuffer timestampOffset to ${i} (sn: ${u} cc: ${d})`),e.timestampOffset=i)}removeExecutor(e,i,s){const{media:o,mediaSource:u}=this,d=this.tracks[e],g=d==null?void 0:d.buffer;if(!o||!u||!g){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const S=Ue(o.duration)?o.duration:1/0,v=Ue(u.duration)?u.duration:1/0,E=Math.max(0,i),b=Math.min(s,S,v);b>E&&(!d.ending||d.ended)?(d.ended=!1,this.log(`Removing [${E},${b}] from the ${e} SourceBuffer`),g.remove(E,b)):this.shiftAndExecuteNext(e)}appendExecutor(e,i){const s=this.tracks[i],o=s==null?void 0:s.buffer;if(!o)throw new DO(`Attempting to append to the ${i} SourceBuffer, but it does not exist`);s.ending=!1,s.ended=!1,o.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(i=>{this.warn(`SourceBuffer blocked callback ${i}`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(i){this.warn(`Callback run without blocking ${this.operationQueue} ${i}`)}}isUpdating(){return this.sourceBuffers.some(([e,i])=>e&&i.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,i=this.sourceBufferTypes){if(!i.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:s}=this,o=i.map(d=>this.appendBlocker(d));return i.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(o).then(d=>{s===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(i=>{var s;const o=(s=this.tracks[i])==null?void 0:s.buffer;!o||o.updating||this.shiftAndExecuteNext(i)})}append(e,i,s){this.operationQueue&&this.operationQueue.append(e,i,s)}appendBlocker(e){if(this.operationQueue)return this.operationQueue.appendBlocker(e)}currentOp(e){return this.operationQueue?this.operationQueue.current(e):null}executeNext(e){e&&this.operationQueue&&this.operationQueue.executeNext(e)}shiftAndExecuteNext(e){this.operationQueue&&this.operationQueue.shiftAndExecuteNext(e)}get pendingTrackCount(){return Object.keys(this.tracks).reduce((e,i)=>e+(this.isPending(this.tracks[i])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[i])=>e+(i?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,i,s){const o=this.tracks[e];if(!o)return;const u=o.buffer;if(!u)return;const d=s.bind(this,e);o.listeners.push({event:i,listener:d}),u.addEventListener(i,d)}removeBufferListeners(e){const i=this.tracks[e];if(!i)return;const s=i.buffer;s&&(i.listeners.forEach(o=>{s.removeEventListener(o.event,o.listener)}),i.listeners.length=0)}}function pR(h){const e=h.querySelectorAll("source");[].slice.call(e).forEach(i=>{h.removeChild(i)})}function _O(h,e){const i=self.document.createElement("source");i.type="video/mp4",i.src=e,h.appendChild(i)}function sb(h){return h==="audio"?1:0}class lb{constructor(e){this.hls=void 0,this.autoLevelCapping=void 0,this.firstLevel=void 0,this.media=void 0,this.restrictedLevels=void 0,this.timer=void 0,this.clientRect=void 0,this.streamController=void 0,this.hls=e,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.firstLevel=-1,this.media=null,this.restrictedLevels=[],this.timer=void 0,this.clientRect=null,this.registerListeners()}setStreamController(e){this.streamController=e}destroy(){this.hls&&this.unregisterListener(),this.timer&&this.stopCapping(),this.media=null,this.clientRect=null,this.hls=this.streamController=null}registerListeners(){const{hls:e}=this;e.on(O.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(O.MANIFEST_PARSED,this.onManifestParsed,this),e.on(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(O.BUFFER_CODECS,this.onBufferCodecs,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(O.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(O.MANIFEST_PARSED,this.onManifestParsed,this),e.off(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(O.BUFFER_CODECS,this.onBufferCodecs,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,i){const s=this.hls.levels[i.droppedLevel];this.isLevelAllowed(s)&&this.restrictedLevels.push({bitrate:s.bitrate,height:s.height,width:s.width})}onMediaAttaching(e,i){this.media=i.media instanceof HTMLVideoElement?i.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,i){const s=this.hls;this.restrictedLevels=[],this.firstLevel=i.firstLevel,s.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onLevelsUpdated(e,i){this.timer&&Ue(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,i){this.hls.config.capLevelToPlayerSize&&i.video&&this.startCapping()}onMediaDetaching(){this.stopCapping(),this.media=null}detectPlayerSize(){if(this.media){if(this.mediaHeight<=0||this.mediaWidth<=0){this.clientRect=null;return}const e=this.hls.levels;if(e.length){const i=this.hls,s=this.getMaxLevel(e.length-1);s!==this.autoLevelCapping&&i.logger.log(`Setting autoLevelCapping to ${s}: ${e[s].height}p@${e[s].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),i.autoLevelCapping=s,i.autoLevelEnabled&&i.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=i.autoLevelCapping}}}getMaxLevel(e){const i=this.hls.levels;if(!i.length)return-1;const s=i.filter((o,u)=>this.isLevelAllowed(o)&&u<=e);return this.clientRect=null,lb.getMaxLevelByMediaSize(s,this.mediaWidth,this.mediaHeight)}startCapping(){this.timer||(this.autoLevelCapping=Number.POSITIVE_INFINITY,self.clearInterval(this.timer),this.timer=self.setInterval(this.detectPlayerSize.bind(this),1e3),this.detectPlayerSize())}stopCapping(){this.restrictedLevels=[],this.firstLevel=-1,this.autoLevelCapping=Number.POSITIVE_INFINITY,this.timer&&(self.clearInterval(this.timer),this.timer=void 0)}getDimensions(){if(this.clientRect)return this.clientRect;const e=this.media,i={width:0,height:0};if(e){const s=e.getBoundingClientRect();i.width=s.width,i.height=s.height,!i.width&&!i.height&&(i.width=s.right-s.left||e.width||0,i.height=s.bottom-s.top||e.height||0)}return this.clientRect=i,i}get mediaWidth(){return this.getDimensions().width*this.contentScaleFactor}get mediaHeight(){return this.getDimensions().height*this.contentScaleFactor}get contentScaleFactor(){let e=1;if(!this.hls.config.ignoreDevicePixelRatio)try{e=self.devicePixelRatio}catch{}return Math.min(e,this.hls.config.maxDevicePixelRatio)}isLevelAllowed(e){return!this.restrictedLevels.some(s=>e.bitrate===s.bitrate&&e.width===s.width&&e.height===s.height)}static getMaxLevelByMediaSize(e,i,s){if(!(e!=null&&e.length))return-1;const o=(g,S)=>S?g.width!==S.width||g.height!==S.height:!0;let u=e.length-1;const d=Math.max(i,s);for(let g=0;g<e.length;g+=1){const S=e[g];if((S.width>=d||S.height>=d)&&o(S,e[g+1])){u=g;break}}return u}}const Ha={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},CO={HLS:"h"};class Dr{constructor(e,i){Array.isArray(e)&&(e=e.map(s=>s instanceof Dr?s:new Dr(s))),this.value=e,this.params=i}}const OO="Dict";function MO(h){return Array.isArray(h)?JSON.stringify(h):h instanceof Map?"Map{}":h instanceof Set?"Set{}":typeof h=="object"?JSON.stringify(h):String(h)}function IO(h,e,i,s){return new Error(`failed to ${h} "${MO(e)}" as ${i}`,{cause:s})}function Lr(h,e,i){return IO("serialize",h,e,i)}class yR{constructor(e){this.description=e}}const vR="Bare Item",wO="Boolean";function NO(h){if(typeof h!="boolean")throw Lr(h,wO);return h?"?1":"?0"}function UO(h){return btoa(String.fromCharCode(...h))}const kO="Byte Sequence";function BO(h){if(ArrayBuffer.isView(h)===!1)throw Lr(h,kO);return`:${UO(h)}:`}const zO="Integer";function FO(h){return h<-999999999999999||999999999999999<h}function SR(h){if(FO(h))throw Lr(h,zO);return h.toString()}function PO(h){return`@${SR(h.getTime()/1e3)}`}function ER(h,e){if(h<0)return-ER(-h,e);const i=Math.pow(10,e);if(Math.abs(h*i%1-.5)<Number.EPSILON){const o=Math.floor(h*i);return(o%2===0?o:o+1)/i}else return Math.round(h*i)/i}const GO="Decimal";function $O(h){const e=ER(h,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Lr(h,GO);const i=e.toString();return i.includes(".")?i:`${i}.0`}const HO="String",jO=/[\x00-\x1f\x7f]+/;function VO(h){if(jO.test(h))throw Lr(h,HO);return`"${h.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function YO(h){return h.description||h.toString().slice(7,-1)}const qO="Token";function TR(h){const e=YO(h);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Lr(e,qO);return e}function rb(h){switch(typeof h){case"number":if(!Ue(h))throw Lr(h,vR);return Number.isInteger(h)?SR(h):$O(h);case"string":return VO(h);case"symbol":return TR(h);case"boolean":return NO(h);case"object":if(h instanceof Date)return PO(h);if(h instanceof Uint8Array)return BO(h);if(h instanceof yR)return TR(h);default:throw Lr(h,vR)}}const KO="Key";function ob(h){if(/^[a-z*][a-z0-9\-_.*]*$/.test(h)===!1)throw Lr(h,KO);return h}function ub(h){return h==null?"":Object.entries(h).map(([e,i])=>i===!0?`;${ob(e)}`:`;${ob(e)}=${rb(i)}`).join("")}function bR(h){return h instanceof Dr?`${rb(h.value)}${ub(h.params)}`:rb(h)}function XO(h){return`(${h.value.map(bR).join(" ")})${ub(h.params)}`}function QO(h,e={whitespace:!0}){if(typeof h!="object"||h==null)throw Lr(h,OO);const i=h instanceof Map?h.entries():Object.entries(h),s=e!=null&&e.whitespace?" ":"";return Array.from(i).map(([o,u])=>{u instanceof Dr||(u=new Dr(u));let d=ob(o);return u.value===!0?d+=ub(u.params):(d+="=",Array.isArray(u.value)?d+=XO(u):d+=bR(u)),d}).join(`,${s}`)}function xR(h,e){return QO(h,e)}const _r="CMCD-Object",Bn="CMCD-Request",Af="CMCD-Session",Fu="CMCD-Status",ZO={br:_r,ab:_r,d:_r,ot:_r,tb:_r,tpb:_r,lb:_r,tab:_r,lab:_r,url:_r,pb:Bn,bl:Bn,tbl:Bn,dl:Bn,ltc:Bn,mtp:Bn,nor:Bn,nrr:Bn,rc:Bn,sn:Bn,sta:Bn,su:Bn,ttfb:Bn,ttfbb:Bn,ttlb:Bn,cmsdd:Bn,cmsds:Bn,smrt:Bn,df:Bn,cs:Bn,ts:Bn,cid:Af,pr:Af,sf:Af,sid:Af,st:Af,v:Af,msd:Af,bs:Fu,bsd:Fu,cdn:Fu,rtp:Fu,bg:Fu,pt:Fu,ec:Fu,e:Fu},JO={REQUEST:Bn};function WO(h){return Object.keys(h).reduce((e,i)=>{var s;return(s=h[i])===null||s===void 0||s.forEach(o=>e[o]=i),e},{})}function eM(h,e){const i={};if(!h)return i;const s=Object.keys(h),o=e?WO(e):{};return s.reduce((u,d)=>{var g;const S=ZO[d]||o[d]||JO.REQUEST,v=(g=u[S])!==null&&g!==void 0?g:u[S]={};return v[d]=h[d],u},i)}function tM(h){return["ot","sf","st","e","sta"].includes(h)}function nM(h){return typeof h=="number"?Ue(h):h!=null&&h!==""&&h!==!1}const AR="event";function iM(h,e){const i=new URL(h),s=new URL(e);if(i.origin!==s.origin)return h;const o=i.pathname.split("/").slice(1),u=s.pathname.split("/").slice(1,-1);for(;o[0]===u[0];)o.shift(),u.shift();for(;u.length;)u.shift(),o.unshift("..");return o.join("/")+i.search+i.hash}const Cv=h=>Math.round(h),cb=(h,e)=>Array.isArray(h)?h.map(i=>cb(i,e)):h instanceof Dr&&typeof h.value=="string"?new Dr(cb(h.value,e),h.params):(e.baseUrl&&(h=iM(h,e.baseUrl)),e.version===1?encodeURIComponent(h):h),Ov=h=>Cv(h/100)*100,aM={br:Cv,d:Cv,bl:Ov,dl:Ov,mtp:Ov,nor:(h,e)=>{let i=h;return e.version>=2&&(h instanceof Dr&&typeof h.value=="string"?i=new Dr([h]):typeof h=="string"&&(i=[h])),cb(i,e)},rtp:Ov,tb:Cv},RR="request",DR="response",fb=["ab","bg","bl","br","bs","bsd","cdn","cid","cs","df","ec","lab","lb","ltc","msd","mtp","pb","pr","pt","sf","sid","sn","st","sta","tab","tb","tbl","tpb","ts","v"],sM=["e"],lM=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function Mv(h){return lM.test(h)}function rM(h){return fb.includes(h)||sM.includes(h)||Mv(h)}const LR=["d","dl","nor","ot","rtp","su"];function oM(h){return fb.includes(h)||LR.includes(h)||Mv(h)}const uM=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function cM(h){return fb.includes(h)||LR.includes(h)||uM.includes(h)||Mv(h)}const fM=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function dM(h){return fM.includes(h)||Mv(h)}const hM={[DR]:cM,[AR]:rM,[RR]:oM};function _R(h,e={}){const i={};if(h==null||typeof h!="object")return i;const s=e.version||h.v||1,o=e.reportingMode||RR,u=s===1?dM:hM[o];let d=Object.keys(h).filter(u);const g=e.filter;typeof g=="function"&&(d=d.filter(g));const S=o===DR||o===AR;S&&!d.includes("ts")&&d.push("ts"),s>1&&!d.includes("v")&&d.push("v");const v=Jt({},aM,e.formatters),E={version:s,reportingMode:o,baseUrl:e.baseUrl};return d.sort().forEach(b=>{let R=h[b];const _=v[b];if(typeof _=="function"&&(R=_(R,E)),b==="v"){if(s===1)return;R=s}b=="pr"&&R===1||(S&&b==="ts"&&!Ue(R)&&(R=Date.now()),nM(R)&&(tM(b)&&typeof R=="string"&&(R=new yR(R)),i[b]=R))}),i}function mM(h,e={}){const i={};if(!h)return i;const s=_R(h,e),o=eM(s,e==null?void 0:e.customHeaderMap);return Object.entries(o).reduce((u,[d,g])=>{const S=xR(g,{whitespace:!1});return S&&(u[d]=S),u},i)}function gM(h,e,i){return Jt(h,mM(e,i))}const pM="CMCD";function yM(h,e={}){return h?xR(_R(h,e),{whitespace:!1}):""}function vM(h,e={}){if(!h)return"";const i=yM(h,e);return encodeURIComponent(i)}function SM(h,e={}){if(!h)return"";const i=vM(h,e);return`${pM}=${i}`}const CR=/CMCD=[^&#]+/;function EM(h,e,i){const s=SM(e,i);if(!s)return h;if(CR.test(h))return h.replace(CR,s);const o=h.includes("?")?"&":"?";return`${h}${o}${s}`}class TM{constructor(e){this.hls=void 0,this.config=void 0,this.media=void 0,this.sid=void 0,this.cid=void 0,this.useHeaders=!1,this.includeKeys=void 0,this.initialized=!1,this.starved=!1,this.buffering=!0,this.audioBuffer=void 0,this.videoBuffer=void 0,this.onWaiting=()=>{this.initialized&&(this.starved=!0),this.buffering=!0},this.onPlaying=()=>{this.initialized||(this.initialized=!0),this.buffering=!1},this.applyPlaylistData=o=>{try{this.apply(o,{ot:Ha.MANIFEST,su:!this.initialized})}catch(u){this.hls.logger.warn("Could not generate manifest CMCD data.",u)}},this.applyFragmentData=o=>{try{const{frag:u,part:d}=o,g=this.hls.levels[u.level],S=this.getObjectType(u),v={d:(d||u).duration*1e3,ot:S};(S===Ha.VIDEO||S===Ha.AUDIO||S==Ha.MUXED)&&(v.br=g.bitrate/1e3,v.tb=this.getTopBandwidth(S)/1e3,v.bl=this.getBufferLength(S));const E=d?this.getNextPart(d):this.getNextFrag(u);E!=null&&E.url&&E.url!==u.url&&(v.nor=E.url),this.apply(o,v)}catch(u){this.hls.logger.warn("Could not generate segment CMCD data.",u)}},this.hls=e;const i=this.config=e.config,{cmcd:s}=i;s!=null&&(i.pLoader=this.createPlaylistLoader(),i.fLoader=this.createFragmentLoader(),this.sid=s.sessionId||e.sessionId,this.cid=s.contentId,this.useHeaders=s.useHeaders===!0,this.includeKeys=s.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHED,this.onMediaDetached,this),e.on(O.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHED,this.onMediaDetached,this),e.off(O.BUFFER_CREATED,this.onBufferCreated,this)}destroy(){this.unregisterListeners(),this.onMediaDetached(),this.hls=this.config=this.audioBuffer=this.videoBuffer=null,this.onWaiting=this.onPlaying=this.media=null}onMediaAttached(e,i){this.media=i.media,this.media.addEventListener("waiting",this.onWaiting),this.media.addEventListener("playing",this.onPlaying)}onMediaDetached(){this.media&&(this.media.removeEventListener("waiting",this.onWaiting),this.media.removeEventListener("playing",this.onPlaying),this.media=null)}onBufferCreated(e,i){var s,o;this.audioBuffer=(s=i.tracks.audio)==null?void 0:s.buffer,this.videoBuffer=(o=i.tracks.video)==null?void 0:o.buffer}createData(){var e;return{v:1,sf:CO.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,i={}){Jt(i,this.createData());const s=i.ot===Ha.INIT||i.ot===Ha.VIDEO||i.ot===Ha.MUXED;this.starved&&s&&(i.bs=!0,i.su=!0,this.starved=!1),i.su==null&&(i.su=this.buffering);const{includeKeys:o}=this;o&&(i=Object.keys(i).reduce((d,g)=>(o.includes(g)&&(d[g]=i[g]),d),{}));const u={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),gM(e.headers,i,u)):e.url=EM(e.url,i,u)}getNextFrag(e){var i;const s=(i=this.hls.levels[e.level])==null?void 0:i.details;if(s){const o=e.sn-s.startSN;return s.fragments[o+1]}}getNextPart(e){var i;const{index:s,fragment:o}=e,u=(i=this.hls.levels[o.level])==null||(i=i.details)==null?void 0:i.partList;if(u){const{sn:d}=o;for(let g=u.length-1;g>=0;g--){const S=u[g];if(S.index===s&&S.fragment.sn===d)return u[g+1]}}}getObjectType(e){const{type:i}=e;if(i==="subtitle")return Ha.TIMED_TEXT;if(e.sn==="initSegment")return Ha.INIT;if(i==="audio")return Ha.AUDIO;if(i==="main")return this.hls.audioTracks.length?Ha.VIDEO:Ha.MUXED}getTopBandwidth(e){let i=0,s;const o=this.hls;if(e===Ha.AUDIO)s=o.audioTracks;else{const u=o.maxAutoLevel,d=u>-1?u+1:o.levels.length;s=o.levels.slice(0,d)}return s.forEach(u=>{u.bitrate>i&&(i=u.bitrate)}),i>0?i:NaN}getBufferLength(e){const i=this.media,s=e===Ha.AUDIO?this.audioBuffer:this.videoBuffer;return!s||!i?NaN:lt.bufferInfo(s,i.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,i=this.applyPlaylistData,s=e||this.config.loader;return class{constructor(u){this.loader=void 0,this.loader=new s(u)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(u,d,g){i(u),this.loader.load(u,d,g)}}}createFragmentLoader(){const{fLoader:e}=this.config,i=this.applyFragmentData,s=e||this.config.loader;return class{constructor(u){this.loader=void 0,this.loader=new s(u)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(u,d,g){i(u),this.loader.load(u,d,g)}}}}const bM=3e5;class xM extends Xs{constructor(e){super("content-steering",e.logger),this.hls=void 0,this.loader=null,this.uri=null,this.pathwayId=".",this._pathwayPriority=null,this.timeToLoad=300,this.reloadTimer=-1,this.updated=0,this.started=!1,this.enabled=!0,this.levels=null,this.audioTracks=null,this.subtitleTracks=null,this.penalizedPathways={},this.hls=e,this.registerListeners()}registerListeners(){const e=this.hls;e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(O.MANIFEST_PARSED,this.onManifestParsed,this),e.on(O.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(O.MANIFEST_PARSED,this.onManifestParsed,this),e.off(O.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,i)=>(e.indexOf(i.pathwayId)===-1&&e.push(i.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}startLoad(){if(this.started=!0,this.clearTimeout(),this.enabled&&this.uri){if(this.updated){const e=this.timeToLoad*1e3-(performance.now()-this.updated);if(e>0){this.scheduleRefresh(this.uri,e);return}}this.loadSteeringManifest(this.uri)}}stopLoad(){this.started=!1,this.loader&&(this.loader.destroy(),this.loader=null),this.clearTimeout()}clearTimeout(){this.reloadTimer!==-1&&(self.clearTimeout(this.reloadTimer),this.reloadTimer=-1)}destroy(){this.unregisterListeners(),this.stopLoad(),this.hls=null,this.levels=this.audioTracks=this.subtitleTracks=null}removeLevel(e){const i=this.levels;i&&(this.levels=i.filter(s=>s!==e))}onManifestLoading(){this.stopLoad(),this.enabled=!0,this.timeToLoad=300,this.updated=0,this.uri=null,this.pathwayId=".",this.levels=this.audioTracks=this.subtitleTracks=null}onManifestLoaded(e,i){const{contentSteering:s}=i;s!==null&&(this.pathwayId=s.pathwayId,this.uri=s.uri,this.started&&this.startLoad())}onManifestParsed(e,i){this.audioTracks=i.audioTracks,this.subtitleTracks=i.subtitleTracks}onError(e,i){const{errorAction:s}=i;if((s==null?void 0:s.action)===Fi.SendAlternateToPenaltyBox&&s.flags===hs.MoveAllAlternatesMatchingHost){const o=this.levels;let u=this._pathwayPriority,d=this.pathwayId;if(i.context){const{groupId:g,pathwayId:S,type:v}=i.context;g&&o?d=this.getPathwayForGroupId(g,v,d):S&&(d=S)}d in this.penalizedPathways||(this.penalizedPathways[d]=performance.now()),!u&&o&&(u=this.pathways()),u&&u.length>1&&(this.updatePathwayPriority(u),s.resolved=this.pathwayId!==d),i.details===re.BUFFER_APPEND_ERROR&&!i.fatal?s.resolved=!0:s.resolved||this.warn(`Could not resolve ${i.details} ("${i.error.message}") with content-steering for Pathway: ${d} levels: ${o&&o.length} priorities: ${rn(u)} penalized: ${rn(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let i=this.getLevelsForPathway(this.pathwayId);if(i.length===0){const s=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${s}"`),i=this.getLevelsForPathway(s),this.pathwayId=s}return i.length!==e.length&&this.log(`Found ${i.length}/${e.length} levels in Pathway "${this.pathwayId}"`),i}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(i=>e===i.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let i;const s=this.penalizedPathways,o=performance.now();Object.keys(s).forEach(u=>{o-s[u]>bM&&delete s[u]});for(let u=0;u<e.length;u++){const d=e[u];if(d in s)continue;if(d===this.pathwayId)return;const g=this.hls.nextLoadLevel,S=this.hls.levels[g];if(i=this.getLevelsForPathway(d),i.length>0){this.log(`Setting Pathway to "${d}"`),this.pathwayId=d,wA(i),this.hls.trigger(O.LEVELS_UPDATED,{levels:i});const v=this.hls.levels[g];S&&v&&this.levels&&(v.attrs["STABLE-VARIANT-ID"]!==S.attrs["STABLE-VARIANT-ID"]&&v.bitrate!==S.bitrate&&this.log(`Unstable Pathways change from bitrate ${S.bitrate} to ${v.bitrate}`),this.hls.nextLoadLevel=g);break}}}getPathwayForGroupId(e,i,s){const o=this.getLevelsForPathway(s).concat(this.levels||[]);for(let u=0;u<o.length;u++)if(i===xt.AUDIO_TRACK&&o[u].hasAudioGroup(e)||i===xt.SUBTITLE_TRACK&&o[u].hasSubtitleGroup(e))return o[u].pathwayId;return s}clonePathways(e){const i=this.levels;if(!i)return;const s={},o={};e.forEach(u=>{const{ID:d,"BASE-ID":g,"URI-REPLACEMENT":S}=u;if(i.some(E=>E.pathwayId===d))return;const v=this.getLevelsForPathway(g).map(E=>{const b=new _n(E.attrs);b["PATHWAY-ID"]=d;const R=b.AUDIO&&`${b.AUDIO}_clone_${d}`,_=b.SUBTITLES&&`${b.SUBTITLES}_clone_${d}`;R&&(s[b.AUDIO]=R,b.AUDIO=R),_&&(o[b.SUBTITLES]=_,b.SUBTITLES=_);const D=MR(E.uri,b["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",S),I=new Wg({attrs:b,audioCodec:E.audioCodec,bitrate:E.bitrate,height:E.height,name:E.name,url:D,videoCodec:E.videoCodec,width:E.width});if(E.audioGroups)for(let M=1;M<E.audioGroups.length;M++)I.addGroupId("audio",`${E.audioGroups[M]}_clone_${d}`);if(E.subtitleGroups)for(let M=1;M<E.subtitleGroups.length;M++)I.addGroupId("text",`${E.subtitleGroups[M]}_clone_${d}`);return I});i.push(...v),OR(this.audioTracks,s,S,d),OR(this.subtitleTracks,o,S,d)})}loadSteeringManifest(e){const i=this.hls.config,s=i.loader;this.loader&&this.loader.destroy(),this.loader=new s(i);let o;try{o=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(o.protocol!=="data:"){const E=(this.hls.bandwidthEstimate||i.abrEwmaDefaultEstimate)|0;o.searchParams.set("_HLS_pathway",this.pathwayId),o.searchParams.set("_HLS_throughput",""+E)}const u={responseType:"json",url:o.href},d=i.steeringManifestLoadPolicy.default,g=d.errorRetry||d.timeoutRetry||{},S={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:g.maxNumRetry||0,retryDelay:g.retryDelayMs||0,maxRetryDelay:g.maxRetryDelayMs||0},v={onSuccess:(E,b,R,_)=>{this.log(`Loaded steering manifest: "${o}"`);const D=E.data;if((D==null?void 0:D.VERSION)!==1){this.log(`Steering VERSION ${D.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=D.TTL;const{"RELOAD-URI":I,"PATHWAY-CLONES":M,"PATHWAY-PRIORITY":w}=D;if(I)try{this.uri=new self.URL(I,o).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${I}`);return}this.scheduleRefresh(this.uri||R.url),M&&this.clonePathways(M);const B={steeringManifest:D,url:o.toString()};this.hls.trigger(O.STEERING_MANIFEST_LOADED,B),w&&this.updatePathwayPriority(w)},onError:(E,b,R,_)=>{if(this.log(`Error loading steering manifest: ${E.code} ${E.text} (${b.url})`),this.stopLoad(),E.code===410){this.enabled=!1,this.log(`Steering manifest ${b.url} no longer available`);return}let D=this.timeToLoad*1e3;if(E.code===429){const I=this.loader;if(typeof(I==null?void 0:I.getResponseHeader)=="function"){const M=I.getResponseHeader("Retry-After");M&&(D=parseFloat(M)*1e3)}this.log(`Steering manifest ${b.url} rate limited`);return}this.scheduleRefresh(this.uri||b.url,D)},onTimeout:(E,b,R)=>{this.log(`Timeout loading steering manifest (${b.url})`),this.scheduleRefresh(this.uri||b.url)}};this.log(`Requesting steering manifest: ${o}`),this.loader.load(u,S,v)}scheduleRefresh(e,i=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var s;const o=(s=this.hls)==null?void 0:s.media;if(o&&!o.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},i)}}function OR(h,e,i,s){h&&Object.keys(e).forEach(o=>{const u=h.filter(d=>d.groupId===o).map(d=>{const g=Jt({},d);return g.details=void 0,g.attrs=new _n(g.attrs),g.url=g.attrs.URI=MR(d.url,d.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",i),g.groupId=g.attrs["GROUP-ID"]=e[o],g.attrs["PATHWAY-ID"]=s,g});h.push(...u)})}function MR(h,e,i,s){const{HOST:o,PARAMS:u,[i]:d}=s;let g;e&&(g=d==null?void 0:d[e],g&&(h=g));const S=new self.URL(h);return o&&!g&&(S.host=o),u&&Object.keys(u).sort().forEach(v=>{v&&S.searchParams.set(v,u[v])}),S.href}class xh extends Xs{constructor(e){super("eme",e.logger),this.hls=void 0,this.config=void 0,this.media=null,this.mediaResolved=void 0,this.keyFormatPromise=null,this.keySystemAccessPromises={},this._requestLicenseFailureCount=0,this.mediaKeySessions=[],this.keyIdToKeySessionPromise={},this.mediaKeys=null,this.setMediaKeysQueue=xh.CDMCleanupPromise?[xh.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=i=>{const{initDataType:s,initData:o}=i,u=`"${i.type}" event: init data type: "${s}"`;if(this.debug(u),o!==null){if(!this.keyFormatPromise){let d=Object.keys(this.keySystemAccessPromises);d.length||(d=e0(this.config));const g=d.map(BT).filter(S=>!!S);this.keyFormatPromise=this.getKeyFormatPromise(g)}this.keyFormatPromise.then(d=>{const g=Ev(d);if(s!=="sinf"||g!==Cn.FAIRPLAY){this.log(`Ignoring "${i.type}" event with init data type: "${s}" for selected key-system ${g}`);return}let S;try{const _=pi(new Uint8Array(o)),D=UT(JSON.parse(_).sinf),I=Cx(D);if(!I)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");S=new Uint8Array(I.subarray(8,24))}catch(_){this.warn(`${u} Failed to parse sinf: ${_}`);return}const v=zi(S),{keyIdToKeySessionPromise:E,mediaKeySessions:b}=this;let R=E[v];for(let _=0;_<b.length;_++){const D=b[_],I=D.decryptdata;if(!I.keyId)continue;const M=zi(I.keyId);if(vv(S,I.keyId)||I.uri.replace(/-/g,"").indexOf(v)!==-1){if(R=E[M],!R)continue;if(I.pssh)break;delete E[M],I.pssh=new Uint8Array(o),I.keyId=S,R=E[v]=R.then(()=>this.generateRequestWithPreferredKeySession(D,s,o,"encrypted-event-key-match")),R.catch(w=>this.handleError(w));break}}R||this.handleError(new Error(`Key ID ${v} not encountered in playlist. Key-system sessions ${b.length}.`))}).catch(d=>this.handleError(d))}},this.onWaitingForKey=i=>{this.log(`"${i.type}" event`)},this.hls=e,this.config=e.config,this.registerListeners()}destroy(){this.onDestroying(),this.onMediaDetached();const e=this.config;e.requestMediaKeySystemAccessFunc=null,e.licenseXhrSetup=e.licenseResponseCallback=void 0,e.drmSystems=e.drmSystemOptions={},this.hls=this.config=this.keyIdToKeySessionPromise=null,this.onMediaEncrypted=this.onWaitingForKey=null}registerListeners(){this.hls.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(O.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(O.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(O.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(O.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(O.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(O.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(O.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(O.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:i,widevineLicenseUrl:s}=this.config,o=i==null?void 0:i[e];if(o)return o.licenseUrl;if(e===Cn.WIDEVINE&&s)return s}getLicenseServerUrlOrThrow(e){const i=this.getLicenseServerUrl(e);if(i===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return i}getServerCertificateUrl(e){const{drmSystems:i}=this.config,s=i==null?void 0:i[e];if(s)return s.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const i=this.hls.levels,s=(d,g,S)=>!!d&&S.indexOf(d)===g,o=i.map(d=>d.audioCodec).filter(s),u=i.map(d=>d.videoCodec).filter(s);return o.length+u.length===0&&u.push("avc1.42e01e"),new Promise((d,g)=>{const S=v=>{const E=v.shift();this.getMediaKeysPromise(E,o,u).then(b=>d({keySystem:E,mediaKeys:b})).catch(b=>{v.length?S(v):b instanceof ps?g(b):g(new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_ACCESS,error:b,fatal:!0},b.message))})};S(e)})}requestMediaKeySystemAccess(e,i){const{requestMediaKeySystemAccessFunc:s}=this.config;if(typeof s!="function"){let o=`Configured requestMediaKeySystemAccess is not a function ${s}`;return hA===null&&self.location.protocol==="http:"&&(o=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(o))}return s(e,i)}getMediaKeysPromise(e,i,s){var o;const u=l2(e,i,s,this.config.drmSystemOptions||{});let d=this.keySystemAccessPromises[e],g=(o=d)==null?void 0:o.keySystemAccess;if(!g){this.log(`Requesting encrypted media "${e}" key-system access with config: ${rn(u)}`),g=this.requestMediaKeySystemAccess(e,u);const S=d=this.keySystemAccessPromises[e]={keySystemAccess:g};return g.catch(v=>{this.log(`Failed to obtain access to key-system "${e}": ${v}`)}),g.then(v=>{this.log(`Access for key-system "${v.keySystem}" obtained`);const E=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const b=S.mediaKeys=v.createMediaKeys().then(R=>(this.log(`Media-keys created for "${e}"`),S.hasMediaKeys=!0,E.then(_=>_?this.setMediaKeysServerCertificate(R,e,_):R)));return b.catch(R=>{this.error(`Failed to create media-keys for "${e}"}: ${R}`)}),b})}return g.then(()=>d.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:i,mediaKeys:s}){this.log(`Creating key-system session "${i}" keyId: ${zi(e.keyId||[])} keyUri: ${e.uri}`);const o=s.createSession(),u={decryptdata:e,keySystem:i,mediaKeys:s,mediaKeysSession:o,keyStatus:"status-pending"};return this.mediaKeySessions.push(u),u}renewKeySession(e){const i=e.decryptdata;if(i.pssh){const s=this.createMediaKeySessionContext(e),o=Iv(i),u="cenc";this.keyIdToKeySessionPromise[o]=this.generateRequestWithPreferredKeySession(s,u,i.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,i){const s=e.mediaKeysSession;return this.log(`Updating key-session "${s.sessionId}" for keyId ${zi(e.decryptdata.keyId||[])}
304
+ } (data length: ${i.byteLength})`),s.update(i)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>BT(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:i,mediaKeys:s})=>this.attemptSetMediaKeys(i,s))}selectKeySystem(e){return new Promise((i,s)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:o})=>{const u=BT(o);u?i(u):s(new Error(`Unable to find format for key-system "${o}"`))}).catch(s)})}selectKeySystemFormat(e){const i=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${i.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(i)),this.keyFormatPromise}getKeyFormatPromise(e){const i=e0(this.config),s=e.map(Ev).filter(o=>!!o&&i.indexOf(o)!==-1);return this.selectKeySystem(s)}getKeyStatus(e){const{mediaKeySessions:i}=this;for(let s=0;s<i.length;s++){const o=AM(e,i[s]);if(o)return o}}loadKey(e){const i=e.keyInfo.decryptdata,s=Iv(i),o=this.bannedKeyIds[s];if(o||this.getKeyStatus(i)==="internal-error"){const g=IR(o||"internal-error",i);return this.handleError(g,e.frag),Promise.reject(g)}const u=`(keyId: ${s} format: "${i.keyFormat}" method: ${i.method} uri: ${i.uri})`;this.log(`Starting session for key ${u}`);const d=this.keyIdToKeySessionPromise[s];if(!d){const g=this.getKeySystemForKeyPromise(i).then(({keySystem:S,mediaKeys:v})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${u}`),this.attemptSetMediaKeys(S,v).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:S,mediaKeys:v,decryptdata:i}))))).then(S=>{const v="cenc",E=i.pssh?i.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(S,v,E,"playlist-key")});return g.catch(S=>this.handleError(S,e.frag)),this.keyIdToKeySessionPromise[s]=g,g}return d.catch(g=>{if(g instanceof ps){const S=Qt({},g.data);this.getKeyStatus(i)==="internal-error"&&(S.decryptdata=i);const v=new ps(S,g.message);this.handleError(v,e.frag)}}),d}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,i){if(this.hls)if(e instanceof ps){i&&(e.data.frag=i);const s=e.data.decryptdata;this.error(`${e.message}${s?` (${zi(s.keyId||[])})`:""}`),this.hls.trigger(O.ERROR,e.data)}else this.error(e.message),this.hls.trigger(O.ERROR,{type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}getKeySystemForKeyPromise(e){const i=Iv(e),s=this.keyIdToKeySessionPromise[i];if(!s){const o=Ev(e.keyFormat),u=o?[o]:e0(this.config);return this.attemptKeySystemAccess(u)}return s}getKeySystemSelectionPromise(e){if(e.length||(e=e0(this.config)),e.length===0)throw new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${rn({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,i){if(this.mediaResolved=void 0,this.mediaKeys===i)return Promise.resolve();const s=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const o=Promise.all(s).then(()=>this.media?this.media.setMediaKeys(i):new Promise((u,d)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return d(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=i,this.media.setMediaKeys(i).then(u).catch(d)}}));return this.mediaKeys=i,this.setMediaKeysQueue.push(o),o.then(()=>{this.log(`Media-keys set for "${e}"`),s.push(o),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(u=>s.indexOf(u)===-1)})}generateRequestWithPreferredKeySession(e,i,s,o){var u;const d=(u=this.config.drmSystems)==null||(u=u[e.keySystem])==null?void 0:u.generateRequest;if(d)try{const D=d.call(this.hls,i,s,e);if(!D)throw new Error("Invalid response from configured generateRequest filter");i=D.initDataType,s=D.initData?D.initData:null,e.decryptdata.pssh=s?new Uint8Array(s):null}catch(D){if(this.warn(D.message),this.hls&&this.hls.config.debug)throw D}if(s===null)return this.log(`Skipping key-session request for "${o}" (no initData)`),Promise.resolve(e);const g=Iv(e.decryptdata),S=e.decryptdata.uri;this.log(`Generating key-session request for "${o}" keyId: ${g} URI: ${S} (init data type: ${i} length: ${s.byteLength})`);const v=new jT,E=e._onmessage=D=>{const I=e.mediaKeysSession;if(!I){v.emit("error",new Error("invalid state"));return}const{messageType:M,message:w}=D;this.log(`"${M}" message event for session "${I.sessionId}" message size: ${w.byteLength}`),M==="license-request"||M==="license-renewal"?this.renewLicense(e,w).catch(B=>{v.eventNames().length?v.emit("error",B):this.handleError(B)}):M==="license-release"?e.keySystem===Cn.FAIRPLAY&&this.updateKeySession(e,kT("acknowledged")).then(()=>this.removeSession(e)).catch(B=>this.handleError(B)):this.warn(`unhandled media key message type "${M}"`)},b=(D,I)=>{I.keyStatus=D;let M;D.startsWith("usable")?v.emit("resolved"):D==="internal-error"||D==="output-restricted"||D==="output-downscaled"?M=IR(D,I.decryptdata):D==="expired"?M=new Error(`key expired (keyId: ${g})`):D==="released"?M=new Error("key released"):D==="status-pending"||this.warn(`unhandled key status change "${D}" (keyId: ${g})`),M&&(v.eventNames().length?v.emit("error",M):this.handleError(M))},R=e._onkeystatuseschange=D=>{if(!e.mediaKeysSession){v.emit("error",new Error("invalid state"));return}const M=this.getKeyStatuses(e);if(!Object.keys(M).some(G=>M[G]!=="status-pending"))return;if(M[g]==="expired"){this.log(`Expired key ${rn(M)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let B=M[g];if(B)b(B,e);else{var z;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(z=e.keyStatusTimeouts)[g]||(z[g]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const K=this.getKeyStatus(e.decryptdata);if(K&&K!=="status-pending")return this.log(`No status for keyId ${g} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${K} from other session.`),b(K,e);this.log(`key status for ${g} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),B="internal-error",b(B,e)},1e3)),this.log(`No status for keyId ${g} (${rn(M)}).`)}};pa(e.mediaKeysSession,"message",E),pa(e.mediaKeysSession,"keystatuseschange",R);const _=new Promise((D,I)=>{v.on("error",I),v.on("resolved",D)});return e.mediaKeysSession.generateRequest(i,s).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${g} URI: ${S}`)}).catch(D=>{throw new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_NO_SESSION,error:D,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${D}`)}).then(()=>_).catch(D=>(v.removeAllListeners(),this.removeSession(e).then(()=>{throw D}))).then(()=>(v.removeAllListeners(),e))}getKeyStatuses(e){const i={};return e.mediaKeysSession.keyStatuses.forEach((s,o)=>{if(typeof o=="string"&&typeof s=="object"){const g=o;o=s,s=g}const u="buffer"in o?new Uint8Array(o.buffer,o.byteOffset,o.byteLength):new Uint8Array(o);if(e.keySystem===Cn.PLAYREADY&&u.length===16){const g=zi(u);i[g]=s,fA(u)}const d=zi(u);s==="internal-error"&&(this.bannedKeyIds[d]=s),this.log(`key status change "${s}" for keyStatuses keyId: ${d} key-session "${e.mediaKeysSession.sessionId}"`),i[d]=s}),i}fetchServerCertificate(e){const i=this.config,s=i.loader,o=new s(i),u=this.getServerCertificateUrl(e);return u?(this.log(`Fetching server certificate for "${e}"`),new Promise((d,g)=>{const S={responseType:"arraybuffer",url:u},v=i.certLoadPolicy.default,E={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},b={onSuccess:(R,_,D,I)=>{d(R.data)},onError:(R,_,D,I)=>{g(new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:D,response:Qt({url:S.url,data:void 0},R)},`"${e}" certificate request failed (${u}). Status: ${R.code} (${R.text})`))},onTimeout:(R,_,D)=>{g(new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:D,response:{url:S.url,data:void 0}},`"${e}" certificate request timed out (${u})`))},onAbort:(R,_,D)=>{g(new Error("aborted"))}};o.load(S,E,b)})):Promise.resolve()}setMediaKeysServerCertificate(e,i,s){return new Promise((o,u)=>{e.setServerCertificate(s).then(d=>{this.log(`setServerCertificate ${d?"success":"not supported by CDM"} (${s.byteLength}) on "${i}"`),o(e)}).catch(d=>{u(new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:d,fatal:!0},d.message))})})}renewLicense(e,i){return this.requestLicense(e,new Uint8Array(i)).then(s=>this.updateKeySession(e,new Uint8Array(s)).catch(o=>{throw new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:o,fatal:!1},o.message)}))}unpackPlayReadyKeyMessage(e,i){const s=String.fromCharCode.apply(null,new Uint16Array(i.buffer));if(!s.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),i;const o=new DOMParser().parseFromString(s,"application/xml"),u=o.querySelectorAll("HttpHeader");if(u.length>0){let E;for(let b=0,R=u.length;b<R;b++){var d,g;E=u[b];const _=(d=E.querySelector("name"))==null?void 0:d.textContent,D=(g=E.querySelector("value"))==null?void 0:g.textContent;_&&D&&e.setRequestHeader(_,D)}}const S=o.querySelector("Challenge"),v=S==null?void 0:S.textContent;if(!v)throw new Error("Cannot find <Challenge> in key message");return kT(atob(v))}setupLicenseXHR(e,i,s,o){const u=this.config.licenseXhrSetup;return u?Promise.resolve().then(()=>{if(!s.decryptdata)throw new Error("Key removed");return u.call(this.hls,e,i,s,o)}).catch(d=>{if(!s.decryptdata)throw d;return e.open("POST",i,!0),u.call(this.hls,e,i,s,o)}).then(d=>(e.readyState||e.open("POST",i,!0),{xhr:e,licenseChallenge:d||o})):(e.open("POST",i,!0),Promise.resolve({xhr:e,licenseChallenge:o}))}requestLicense(e,i){const s=this.config.keyLoadPolicy.default;return new Promise((o,u)=>{const d=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${d}`);const g=new XMLHttpRequest;g.responseType="arraybuffer",g.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return u(new Error("invalid state"));if(g.readyState===4)if(g.status===200){this._requestLicenseFailureCount=0;let S=g.response;this.log(`License received ${S instanceof ArrayBuffer?S.byteLength:S}`);const v=this.config.licenseResponseCallback;if(v)try{S=v.call(this.hls,g,d,e)}catch(E){this.error(E)}o(S)}else{const S=s.errorRetry,v=S?S.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>v||g.status>=400&&g.status<500)u(new ps({type:je.KEY_SYSTEM_ERROR,details:re.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:g,response:{url:d,data:void 0,code:g.status,text:g.statusText}},`License Request XHR failed (${d}). Status: ${g.status} (${g.statusText})`));else{const E=v-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${E} attempts left`),this.requestLicense(e,i).then(o,u)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=g,this.setupLicenseXHR(g,d,e,i).then(({xhr:S,licenseChallenge:v})=>{e.keySystem==Cn.PLAYREADY&&(v=this.unpackPlayReadyKeyMessage(S,v)),S.send(v)}).catch(u)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,i){if(!this.config.emeEnabled)return;const s=i.media;this.media=s,pa(s,"encrypted",this.onMediaEncrypted),pa(s,"waitingforkey",this.onWaitingForKey);const o=this.mediaResolved;o?o():this.mediaKeys=s.mediaKeys}onMediaDetached(){const e=this.media;e&&($a(e,"encrypted",this.onMediaEncrypted),$a(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const i=this.mediaResolved;if(i&&i(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const s=this.media,o=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,ku.clearKeyUriToKeyIdMap();const u=o.length;xh.CDMCleanupPromise=Promise.all(o.map(d=>this.removeSession(d)).concat((s==null||(e=s.setMediaKeys(null))==null?void 0:e.catch(d=>{this.log(`Could not clear media keys: ${d}`),this.hls&&this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${d}`)})}))||Promise.resolve())).catch(d=>{this.log(`Could not close sessions and clear media keys: ${d}`),this.hls&&this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${d}`)})}).then(()=>{u&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:i}){if(!(!i||!this.config.emeEnabled)&&!this.keyFormatPromise){const s=i.reduce((o,u)=>(o.indexOf(u.keyFormat)===-1&&o.push(u.keyFormat),o),[]);this.log(`Selecting key-system from session-keys ${s.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(s)}}removeSession(e){const{mediaKeysSession:i,licenseXhr:s,decryptdata:o}=e;if(i){this.log(`Remove licenses and keys and close session "${i.sessionId}" keyId: ${zi((o==null?void 0:o.keyId)||[])}`),e._onmessage&&(i.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(i.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),s&&s.readyState!==XMLHttpRequest.DONE&&s.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const u=this.mediaKeySessions.indexOf(e);u>-1&&this.mediaKeySessions.splice(u,1);const{keyStatusTimeouts:d}=e;d&&Object.keys(d).forEach(v=>self.clearTimeout(d[v]));const{drmSystemOptions:g}=this.config;return(o2(g)?new Promise((v,E)=>{self.setTimeout(()=>E(new Error("MediaKeySession.remove() timeout")),8e3),i.remove().then(v).catch(E)}):Promise.resolve()).catch(v=>{this.log(`Could not remove session: ${v}`),this.hls&&this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${v}`)})}).then(()=>i.close()).catch(v=>{this.log(`Could not close session: ${v}`),this.hls&&this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${v}`)})})}return Promise.resolve()}}xh.CDMCleanupPromise=void 0;function Iv(h){if(!h)throw new Error("Could not read keyId of undefined decryptdata");if(h.keyId===null)throw new Error("keyId is null");return zi(h.keyId)}function AM(h,e){if(h.keyId&&e.mediaKeysSession.keyStatuses.has(h.keyId))return e.mediaKeysSession.keyStatuses.get(h.keyId);if(h.matches(e.decryptdata))return e.keyStatus}class ps extends Error{constructor(e,i){super(i),this.data=void 0,e.error||(e.error=new Error(i)),this.data=e,e.err=e.error}}function IR(h,e){const i=h==="output-restricted",s=i?re.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:re.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new ps({type:je.KEY_SYSTEM_ERROR,details:s,fatal:!1,decryptdata:e},i?"HDCP level output restricted":`key status changed to "${h}"`)}class RM{constructor(e){this.hls=void 0,this.isVideoPlaybackQualityAvailable=!1,this.timer=void 0,this.media=null,this.lastTime=void 0,this.lastDroppedFrames=0,this.lastDecodedFrames=0,this.streamController=void 0,this.hls=e,this.registerListeners()}setStreamController(e){this.streamController=e}registerListeners(){this.hls.on(O.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(O.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(O.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(O.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,i){const s=this.hls.config;if(s.capLevelOnFPSDrop){const o=i.media instanceof self.HTMLVideoElement?i.media:null;this.media=o,o&&typeof o.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),s.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,i,s){const o=performance.now();if(i){if(this.lastTime){const u=o-this.lastTime,d=s-this.lastDroppedFrames,g=i-this.lastDecodedFrames,S=1e3*d/u,v=this.hls;if(v.trigger(O.FPS_DROP,{currentDropped:d,currentDecoded:g,totalDroppedFrames:s}),S>0&&d>v.config.fpsDroppedMonitoringThreshold*g){let E=v.currentLevel;v.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+E),E>0&&(v.autoLevelCapping===-1||v.autoLevelCapping>=E)&&(E=E-1,v.trigger(O.FPS_DROP_LEVEL_CAPPING,{level:E,droppedLevel:v.currentLevel}),v.autoLevelCapping=E,this.streamController.nextLevelSwitch())}}this.lastTime=o,this.lastDroppedFrames=s,this.lastDecodedFrames=i}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const i=e.getVideoPlaybackQuality();this.checkFPS(e,i.totalVideoFrames,i.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function wR(h,e){let i;try{i=new Event("addtrack")}catch{i=document.createEvent("Event"),i.initEvent("addtrack",!1,!1)}i.track=h,e.dispatchEvent(i)}function NR(h,e){const i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues&&!h.cues.getCueById(e.id))try{if(h.addCue(e),!h.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(s){Zt.debug(`[texttrack-utils]: ${s}`);try{const o=new self.TextTrackCue(e.startTime,e.endTime,e.text);o.id=e.id,h.addCue(o)}catch(o){Zt.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${o}`)}}i==="disabled"&&(h.mode=i)}function Ah(h,e){const i=h.mode;if(i==="disabled"&&(h.mode="hidden"),h.cues)for(let s=h.cues.length;s--;)e&&h.cues[s].removeEventListener("enter",e),h.removeCue(h.cues[s]);i==="disabled"&&(h.mode=i)}function db(h,e,i,s){const o=h.mode;if(o==="disabled"&&(h.mode="hidden"),h.cues&&h.cues.length>0){const u=LM(h.cues,e,i);for(let d=0;d<u.length;d++)(!s||s(u[d]))&&h.removeCue(u[d])}o==="disabled"&&(h.mode=o)}function DM(h,e){if(e<=h[0].startTime)return 0;const i=h.length-1;if(e>h[i].endTime)return-1;let s=0,o=i,u;for(;s<=o;)if(u=Math.floor((o+s)/2),e<h[u].startTime)o=u-1;else if(e>h[u].startTime&&s<i)s=u+1;else return u;return h[s].startTime-e<e-h[o].startTime?s:o}function LM(h,e,i){const s=[],o=DM(h,e);if(o>-1)for(let u=o,d=h.length;u<d;u++){const g=h[u];if(g.startTime>=e&&g.endTime<=i)s.push(g);else if(g.startTime>i)return s}return s}function wv(h){const e=[];for(let i=0;i<h.length;i++){const s=h[i];(s.kind==="subtitles"||s.kind==="captions")&&s.label&&e.push(h[i])}return e}class _M extends ib{constructor(e){super(e,"subtitle-track-controller"),this.media=null,this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0,this.queuedDefaultTrack=-1,this.useTextTrackPolling=!1,this.subtitlePollingInterval=-1,this._subtitleDisplay=!0,this.asyncPollTrackChange=()=>this.pollTrackChange(0),this.onTextTracksChanged=()=>{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let i=null;const s=wv(this.media.textTracks);for(let u=0;u<s.length;u++)if(s[u].mode==="hidden")i=s[u];else if(s[u].mode==="showing"){i=s[u];break}const o=this.findTrackForTextTrack(i);this.subtitleTrack!==o&&this.setSubtitleTrack(o)},this.registerListeners()}destroy(){this.unregisterListeners(),this.tracks.length=0,this.tracksInGroup.length=0,this.currentTrack=null,this.onTextTracksChanged=this.asyncPollTrackChange=null,super.destroy()}get subtitleDisplay(){return this._subtitleDisplay}set subtitleDisplay(e){this._subtitleDisplay=e,this.trackId>-1&&this.toggleTrackModes()}registerListeners(){const{hls:e}=this;e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_PARSED,this.onManifestParsed,this),e.on(O.LEVEL_LOADING,this.onLevelLoading,this),e.on(O.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(O.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(O.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_PARSED,this.onManifestParsed,this),e.off(O.LEVEL_LOADING,this.onLevelLoading,this),e.off(O.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(O.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(O.ERROR,this.onError,this)}onMediaAttached(e,i){this.media=i.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))}pollTrackChange(e){self.clearInterval(this.subtitlePollingInterval),this.subtitlePollingInterval=self.setInterval(this.onTextTracksChanged,e)}onMediaDetaching(e,i){const s=this.media;if(!s)return;const o=!!i.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||s.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,o)return;wv(s.textTracks).forEach(d=>{Ah(d)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,i){this.tracks=i.subtitleTracks}onSubtitleTrackLoaded(e,i){const{id:s,groupId:o,details:u}=i,d=this.tracksInGroup[s];if(!d||d.groupId!==o){this.warn(`Subtitle track with id:${s} and group:${o} not found in active group ${d==null?void 0:d.groupId}`);return}const g=d.details;d.details=i.details,this.log(`Subtitle track ${s} "${d.name}" lang:${d.lang} group:${o} loaded [${u.startSN}-${u.endSN}]`),s===this.trackId&&this.playlistLoaded(s,i,g)}onLevelLoading(e,i){this.switchLevel(i.level)}onLevelSwitching(e,i){this.switchLevel(i.level)}switchLevel(e){const i=this.hls.levels[e];if(!i)return;const s=i.subtitleGroups||null,o=this.groupIds;let u=this.currentTrack;if(!s||(o==null?void 0:o.length)!==(s==null?void 0:s.length)||s!=null&&s.some(d=>(o==null?void 0:o.indexOf(d))===-1)){this.groupIds=s,this.trackId=-1,this.currentTrack=null;const d=this.tracks.filter(E=>!s||s.indexOf(E.groupId)!==-1);if(d.length)this.selectDefaultTrack&&!d.some(E=>E.default)&&(this.selectDefaultTrack=!1),d.forEach((E,b)=>{E.id=b});else if(!u&&!this.tracksInGroup.length)return;this.tracksInGroup=d;const g=this.hls.config.subtitlePreference;if(!u&&g){this.selectDefaultTrack=!1;const E=xr(g,d);if(E>-1)u=d[E];else{const b=xr(g,this.tracks);u=this.tracks[b]}}let S=this.findTrackId(u);S===-1&&u&&(S=this.findTrackId(null));const v={subtitleTracks:d};this.log(`Updating subtitle tracks, ${d.length} track(s) found in "${s==null?void 0:s.join(",")}" group-id`),this.hls.trigger(O.SUBTITLE_TRACKS_UPDATED,v),S!==-1&&this.trackId===-1&&this.setSubtitleTrack(S)}}findTrackId(e){const i=this.tracksInGroup,s=this.selectDefaultTrack;for(let o=0;o<i.length;o++){const u=i[o];if(!(s&&!u.default||!s&&!e)&&(!e||Tf(u,e)))return o}if(e){for(let o=0;o<i.length;o++){const u=i[o];if(r0(e.attrs,u.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return o}for(let o=0;o<i.length;o++){const u=i[o];if(r0(e.attrs,u.attrs,["LANGUAGE"]))return o}}return-1}findTrackForTextTrack(e){if(e){const i=this.tracksInGroup;for(let s=0;s<i.length;s++){const o=i[s];if(ab(o,e))return s}}return-1}onError(e,i){i.fatal||!i.context||i.context.type===xt.SUBTITLE_TRACK&&i.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(i.context.groupId)!==-1)&&this.checkRetry(i)}get allSubtitleTracks(){return this.tracks}get subtitleTracks(){return this.tracksInGroup}get subtitleTrack(){return this.trackId}set subtitleTrack(e){this.selectDefaultTrack=!1,this.setSubtitleTrack(e)}setSubtitleOption(e){if(this.hls.config.subtitlePreference=e,e){if(e.id===-1)return this.setSubtitleTrack(-1),null;const i=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,i.length){const s=this.currentTrack;if(s&&Tf(e,s))return s;const o=xr(e,this.tracksInGroup);if(o>-1){const u=this.tracksInGroup[o];return this.setSubtitleTrack(o),u}else{if(s)return null;{const u=xr(e,i);if(u>-1)return i[u]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,i){super.loadingPlaylist(e,i);const s=e.id,o=e.groupId,u=this.getUrlWithDirectives(e.url,i),d=e.details,g=d==null?void 0:d.age;this.log(`Loading subtitle ${s} "${e.name}" lang:${e.lang} group:${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${g&&d.live?" age "+g.toFixed(1)+(d.type&&" "+d.type||""):""} ${u}`),this.hls.trigger(O.SUBTITLE_TRACK_LOADING,{url:u,id:s,groupId:o,deliveryDirectives:i||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const i=wv(e.textTracks),s=this.currentTrack;let o;if(s&&(o=i.filter(u=>ab(s,u))[0],o||this.warn(`Unable to find subtitle TextTrack with name "${s.name}" and language "${s.lang}"`)),[].slice.call(i).forEach(u=>{u.mode!=="disabled"&&u!==o&&(u.mode="disabled")}),o){const u=this.subtitleDisplay?"showing":"hidden";o.mode!==u&&(o.mode=u)}}setSubtitleTrack(e){const i=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=i.length||!Ue(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const s=this.currentTrack,o=i[e]||null;if(this.trackId=e,this.currentTrack=o,this.toggleTrackModes(),!o){this.hls.trigger(O.SUBTITLE_TRACK_SWITCH,{id:e});return}const u=!!o.details&&!o.details.live;if(e===this.trackId&&o===s&&u)return;this.log(`Switching to subtitle-track ${e}`+(o?` "${o.name}" lang:${o.lang} group:${o.groupId}`:""));const{id:d,groupId:g="",name:S,type:v,url:E}=o;this.hls.trigger(O.SUBTITLE_TRACK_SWITCH,{id:d,groupId:g,name:S,type:v,url:E});const b=this.switchParams(o.url,s==null?void 0:s.details,o.details);this.loadPlaylist(b)}}function CM(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),i=e.toString();return URL.revokeObjectURL(e),i.slice(i.lastIndexOf("/")+1)}catch{let i=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,o=>{const u=(i+Math.random()*16)%16|0;return i=Math.floor(i/16),(o=="x"?u:u&3|8).toString(16)})}}}function o0(h){let e=5381,i=h.length;for(;i;)e=e*33^h.charCodeAt(--i);return(e>>>0).toString()}const Rh=.025;let Nv=function(h){return h[h.Point=0]="Point",h[h.Range=1]="Range",h}({});function OM(h,e,i){return`${h.identifier}-${i+1}-${o0(e)}`}class MM{constructor(e,i){this.base=void 0,this._duration=null,this._timelineStart=null,this.appendInPlaceDisabled=void 0,this.appendInPlaceStarted=void 0,this.dateRange=void 0,this.hasPlayed=!1,this.cumulativeDuration=0,this.resumeOffset=NaN,this.playoutLimit=NaN,this.restrictions={skip:!1,jump:!1},this.snapOptions={out:!1,in:!1},this.assetList=[],this.assetListLoader=void 0,this.assetListResponse=null,this.resumeAnchor=void 0,this.error=void 0,this.resetOnResume=void 0,this.base=i,this.dateRange=e,this.setDateRange(e)}setDateRange(e){this.dateRange=e,this.resumeOffset=e.attr.optionalFloat("X-RESUME-OFFSET",this.resumeOffset),this.playoutLimit=e.attr.optionalFloat("X-PLAYOUT-LIMIT",this.playoutLimit),this.restrictions=e.attr.enumeratedStringList("X-RESTRICT",this.restrictions),this.snapOptions=e.attr.enumeratedStringList("X-SNAP",this.snapOptions)}reset(){var e;this.appendInPlaceStarted=!1,(e=this.assetListLoader)==null||e.destroy(),this.assetListLoader=void 0,this.supplementsPrimary||(this.assetListResponse=null,this.assetList=[],this._duration=null)}isAssetPastPlayoutLimit(e){var i;if(e>0&&e>=this.assetList.length)return!0;const s=this.playoutLimit;return e<=0||isNaN(s)?!1:s===0?!0:(((i=this.assetList[e])==null?void 0:i.startOffset)||0)>s}findAssetIndex(e){return this.assetList.indexOf(e)}get identifier(){return this.dateRange.id}get startDate(){return this.dateRange.startDate}get startTime(){const e=this.dateRange.startTime;if(this.snapOptions.out){const i=this.dateRange.tagAnchor;if(i)return hb(e,i)}return e}get startOffset(){return this.cue.pre?0:this.startTime}get startIsAligned(){if(this.startTime===0||this.snapOptions.out)return!0;const e=this.dateRange.tagAnchor;if(e){const i=this.dateRange.startTime,s=hb(i,e);return i-s<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,i=Ue(e)?e:this.duration;return this.cumulativeDuration+i}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const i=this.resumeAnchor;if(i)return hb(e,i)}return e}get appendInPlace(){return this.appendInPlaceStarted?!0:this.appendInPlaceDisabled?!1:!!(!this.cue.once&&!this.cue.pre&&this.startIsAligned&&(isNaN(this.playoutLimit)&&isNaN(this.resumeOffset)||this.resumeOffset&&this.duration&&Math.abs(this.resumeOffset-this.duration)<Rh))}set appendInPlace(e){if(this.appendInPlaceStarted){this.resetOnResume=!e;return}this.appendInPlaceDisabled=!e}get timelineStart(){return this._timelineStart!==null?this._timelineStart:this.startTime}set timelineStart(e){this._timelineStart=e}get duration(){const e=this.playoutLimit;let i;return this._duration!==null?i=this._duration:this.dateRange.duration?i=this.dateRange.duration:i=this.dateRange.plannedDuration||0,!isNaN(e)&&e<i&&(i=e),i}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?Nv.Range:Nv.Point}get supplementsPrimary(){return this.dateRange.attr["X-TIMELINE-STYLE"]==="PRIMARY"}get contentMayVary(){return this.dateRange.attr["X-CONTENT-MAY-VARY"]!=="NO"}get assetUrl(){return this.dateRange.attr["X-ASSET-URI"]}get assetListUrl(){return this.dateRange.attr["X-ASSET-LIST"]}get baseUrl(){return this.base.url}get assetListLoaded(){return this.assetList.length>0||this.assetListResponse!==null}toString(){return IM(this)}}function hb(h,e){return h-e.start<e.duration/2&&!(Math.abs(h-(e.start+e.duration))<Rh)?e.start:e.start+e.duration}function UR(h,e,i){const s=new self.URL(h,i);return s.protocol!=="data:"&&s.searchParams.set("_HLS_primary_id",e),s}function mb(h,e){for(;(i=h.assetList[++e])!=null&&i.error;)var i;return e}function IM(h){return`["${h.identifier}" ${h.cue.pre?"<pre>":h.cue.post?"<post>":""}${h.timelineStart.toFixed(2)}-${h.resumeTime.toFixed(2)}]`}function Dh(h){const e=h.timelineStart,i=h.duration||0;return`["${h.identifier}" ${e.toFixed(2)}-${(e+i).toFixed(2)}]`}class wM{constructor(e,i,s,o){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetails=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(O.PLAYOUT_LIMIT_REACHED,{})};const u=this.hls=new e(i);this.interstitial=s,this.assetItem=o;const d=()=>{this.hasDetails=!0};u.once(O.LEVEL_LOADED,d),u.once(O.AUDIO_TRACK_LOADED,d),u.once(O.SUBTITLE_TRACK_LOADED,d),u.on(O.MEDIA_ATTACHING,(g,{media:S})=>{this.removeMediaListeners(),this.mediaAttached=S,this.interstitial.playoutLimit&&(S.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&u.on(O.BUFFER_APPENDED,()=>{const E=this.bufferedEnd;this.reachedPlayout(E)&&(this._bufferedEosTime=E,u.trigger(O.BUFFERED_TO_END,void 0))}))})}get appendInPlace(){return this.interstitial.appendInPlace}loadSource(){const e=this.hls;if(e)if(e.url)e.levels.length&&!e.started&&e.startLoad(-1,!0);else{let i=this.assetItem.uri;try{i=UR(i,e.config.primarySessionId||"").href}catch{}e.loadSource(i)}}bufferedInPlaceToEnd(e){var i;if(!this.appendInPlace)return!1;if((i=this.hls)!=null&&i.bufferedToEnd)return!0;if(!e)return!1;const s=Math.min(this._bufferedEosTime||1/0,this.duration),o=this.timelineOffset,u=lt.bufferInfo(e,o,0);return this.getAssetTime(u.end)>=s-.02}reachedPlayout(e){const s=this.interstitial.playoutLimit;return this.startOffset+e>=s}get destroyed(){var e;return!((e=this.hls)!=null&&e.userConfig)}get assetId(){return this.assetItem.identifier}get interstitialId(){return this.assetItem.parentIdentifier}get media(){var e;return((e=this.hls)==null?void 0:e.media)||null}get bufferedEnd(){const e=this.media||this.mediaAttached;if(!e)return this._bufferedEosTime?this._bufferedEosTime:this.currentTime;const i=lt.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(i.end)}get currentTime(){const e=this.media||this.mediaAttached;return e?this.getAssetTime(e.currentTime):this._currentTime||0}get duration(){const e=this.assetItem.duration;if(!e)return 0;const i=this.interstitial.playoutLimit;if(i){const s=i-this.startOffset;if(s>0&&s<e)return s}return e}get remaining(){const e=this.duration;return e?Math.max(0,e-this.currentTime):0}get startOffset(){return this.assetItem.startOffset}get timelineOffset(){var e;return((e=this.hls)==null?void 0:e.config.timelineOffset)||0}set timelineOffset(e){const i=this.timelineOffset;if(e!==i){const s=e-i;if(Math.abs(s)>1/9e4&&this.hls){if(this.hasDetails)throw new Error("Cannot set timelineOffset after playlists are loaded");this.hls.config.timelineOffset=e}}}getAssetTime(e){const i=this.timelineOffset,s=this.duration;return Math.min(Math.max(0,e-i),s)}removeMediaListeners(){const e=this.mediaAttached;e&&(this._currentTime=e.currentTime,this.bufferSnapShot(),e.removeEventListener("timeupdate",this.checkPlayout))}bufferSnapShot(){if(this.mediaAttached){var e;(e=this.hls)!=null&&e.bufferedToEnd&&(this._bufferedEosTime=this.bufferedEnd)}}destroy(){this.removeMediaListeners(),this.hls&&this.hls.destroy(),this.hls=null,this.tracks=this.mediaAttached=this.checkPlayout=null}attachMedia(e){var i;this.loadSource(),(i=this.hls)==null||i.attachMedia(e)}detachMedia(){var e;this.removeMediaListeners(),this.mediaAttached=null,(e=this.hls)==null||e.detachMedia()}resumeBuffering(){var e;(e=this.hls)==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.hls)==null||e.pauseBuffering()}transferMedia(){var e;return this.bufferSnapShot(),((e=this.hls)==null?void 0:e.transferMedia())||null}resetDetails(){const e=this.hls;if(e&&this.hasDetails){e.stopLoad();const i=s=>delete s.details;e.levels.forEach(i),e.allAudioTracks.forEach(i),e.allSubtitleTracks.forEach(i),this.hasDetails=!1}}on(e,i,s){var o;(o=this.hls)==null||o.on(e,i)}once(e,i,s){var o;(o=this.hls)==null||o.once(e,i)}off(e,i,s){var o;(o=this.hls)==null||o.off(e,i)}toString(){var e;return`HlsAssetPlayer: ${Dh(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const kR=.033;class NM extends Xs{constructor(e,i){super("interstitials-sched",i),this.onScheduleUpdate=void 0,this.eventMap={},this.events=null,this.items=null,this.durations={primary:0,playout:0,integrated:0},this.onScheduleUpdate=e}destroy(){this.reset(),this.onScheduleUpdate=null}reset(){this.eventMap={},this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,i){return this.events?this.events.reduce((s,o)=>e<=o.startOffset&&i>o.startOffset?(delete o.error,s+1):s,0):0}get duration(){const e=this.items;return e?e[e.length-1].end:0}get length(){return this.items?this.items.length:0}getEvent(e){return e&&this.eventMap[e]||null}hasEvent(e){return e in this.eventMap}findItemIndex(e,i){if(e.event)return this.findEventIndex(e.event.identifier);let s=-1;e.nextEvent?s=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(s=this.findEventIndex(e.previousEvent.identifier)+1);const o=this.items;if(o)for(o[s]||(i===void 0&&(i=e.start),s=this.findItemIndexAtTime(i));s>=0&&(u=o[s])!=null&&u.event;){var u;s--}return s}findItemIndexAtTime(e,i){const s=this.items;if(s)for(let o=0;o<s.length;o++){let u=s[o];if(i&&i!=="primary"&&(u=u[i]),e===u.start||e>u.start&&e<u.end)return o}return-1}findJumpRestrictedIndex(e,i){const s=this.items;if(s)for(let o=e;o<=i&&s[o];o++){const u=s[o].event;if(u!=null&&u.restrictions.jump&&!u.appendInPlace)return o}return-1}findEventIndex(e){const i=this.items;if(i)for(let o=i.length;o--;){var s;if(((s=i[o].event)==null?void 0:s.identifier)===e)return o}return-1}findAssetIndex(e,i){const s=e.assetList,o=s.length;if(o>1)for(let u=0;u<o;u++){const d=s[u];if(!d.error){const g=d.timelineStart;if(i===g||i>g&&(i<g+(d.duration||0)||u===o-1))return u}}return 0}get assetIdAtEnd(){var e;const i=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(i){const s=i.assetList,o=s[s.length-1];if(o)return o.identifier}return null}parseInterstitialDateRanges(e,i){const s=e.main.details,{dateRanges:o}=s,u=this.events,d=this.parseDateRanges(o,{url:s.url},i),g=Object.keys(o),S=u?u.filter(v=>!g.includes(v.identifier)):[];d.length&&d.sort((v,E)=>{const b=v.cue.pre,R=v.cue.post,_=E.cue.pre,D=E.cue.post;if(b&&!_)return-1;if(_&&!b||R&&!D)return 1;if(D&&!R)return-1;if(!b&&!_&&!R&&!D){const I=v.startTime,M=E.startTime;if(I!==M)return I-M}return v.dateRange.tagOrder-E.dateRange.tagOrder}),this.events=d,S.forEach(v=>{this.removeEvent(v)}),this.updateSchedule(e,S)}updateSchedule(e,i=[],s=!1){const o=this.events||[];if(o.length||i.length||this.length<2){const u=this.items,d=this.parseSchedule(o,e);(s||i.length||(u==null?void 0:u.length)!==d.length||d.some((S,v)=>Math.abs(S.playout.start-u[v].playout.start)>.005||Math.abs(S.playout.end-u[v].playout.end)>.005))&&(this.items=d,this.onScheduleUpdate(i,u))}}parseDateRanges(e,i,s){const o=[],u=Object.keys(e);for(let d=0;d<u.length;d++){const g=u[d],S=e[g];if(S.isInterstitial){let v=this.eventMap[g];v?v.setDateRange(S):(v=new MM(S,i),this.eventMap[g]=v,s===!1&&(v.appendInPlace=s)),o.push(v)}}return o}parseSchedule(e,i){const s=[],o=i.main.details,u=o.live?1/0:o.edge;let d=0;if(e=e.filter(S=>!S.error&&!(S.cue.once&&S.hasPlayed)),e.length){this.resolveOffsets(e,i);let S=0,v=0;if(e.forEach((E,b)=>{const R=E.cue.pre,_=E.cue.post,D=e[b-1]||null,I=E.appendInPlace,M=_?u:E.startOffset,w=E.duration,B=E.timelineOccupancy===Nv.Range?w:0,z=E.resumptionOffset,G=(D==null?void 0:D.startTime)===M,K=M+E.cumulativeDuration;let ae=I?K+w:M+z;if(R||!_&&M<=0){const Z=v;v+=B,E.timelineStart=K;const te=d;d+=w,s.push({event:E,start:K,end:ae,playout:{start:te,end:d},integrated:{start:Z,end:v}})}else if(M<=u){if(!G){const $=M-S;if($>kR){const me=S,Ee=v;v+=$;const De=d;d+=$;const Ie={previousEvent:e[b-1]||null,nextEvent:E,start:me,end:me+$,playout:{start:De,end:d},integrated:{start:Ee,end:v}};s.push(Ie)}else $>0&&D&&(D.cumulativeDuration+=$,s[s.length-1].end=M)}_&&(ae=K),E.timelineStart=K;const Z=v;v+=B;const te=d;d+=w,s.push({event:E,start:K,end:ae,playout:{start:te,end:d},integrated:{start:Z,end:v}})}else return;const q=E.resumeTime;_||q>u?S=u:S=q}),S<u){var g;const E=S,b=v,R=u-S;v+=R;const _=d;d+=R,s.push({previousEvent:((g=s[s.length-1])==null?void 0:g.event)||null,nextEvent:null,start:S,end:E+R,playout:{start:_,end:d},integrated:{start:b,end:v}})}this.setDurations(u,d,v)}else s.push({previousEvent:null,nextEvent:null,start:0,end:u,playout:{start:0,end:u},integrated:{start:0,end:u}}),this.setDurations(u,u,u);return s}setDurations(e,i,s){this.durations={primary:e,playout:i,integrated:s}}resolveOffsets(e,i){const s=i.main.details,o=s.live?1/0:s.edge;let u=0,d=-1;e.forEach((g,S)=>{const v=g.cue.pre,E=g.cue.post,b=v?0:E?o:g.startTime;this.updateAssetDurations(g),d===b?g.cumulativeDuration=u:(u=0,d=b),!E&&g.snapOptions.in&&(g.resumeAnchor=xf(null,s.fragments,g.startOffset+g.resumptionOffset,0,0)||void 0),g.appendInPlace&&!g.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(g,i)||(g.appendInPlace=!1)),!g.appendInPlace&&S+1<e.length&&e[S+1].startTime-e[S].resumeTime<kR&&(e[S+1].appendInPlace=!1,e[S+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${g}`));const _=Ue(g.resumeOffset)?g.resumeOffset:g.duration;u+=_})}primaryCanResumeInPlaceAt(e,i){const s=e.resumeTime,o=e.startTime+e.resumptionOffset;return Math.abs(s-o)>Rh?(this.log(`"${e.identifier}" resumption ${s} not aligned with estimated timeline end ${o}`),!1):!Object.keys(i).some(d=>{const g=i[d].details,S=g.edge;if(s>=S)return this.log(`"${e.identifier}" resumption ${s} past ${d} playlist end ${S}`),!1;const v=xf(null,g.fragments,s);if(!v)return this.log(`"${e.identifier}" resumption ${s} does not align with any fragments in ${d} playlist (${g.fragStart}-${g.fragmentEnd})`),!0;const E=d==="audio"?.175:0;return Math.abs(v.start-s)<Rh+E||Math.abs(v.end-s)<Rh+E?!1:(this.log(`"${e.identifier}" resumption ${s} not aligned with ${d} fragment bounds (${v.start}-${v.end} sn: ${v.sn} cc: ${v.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const i=e.timelineStart;let s=0,o=!1,u=!1;for(let d=0;d<e.assetList.length;d++){const g=e.assetList[d],S=i+s;g.startOffset=s,g.timelineStart=S,o||(o=g.duration===null),u||(u=!!g.error);const v=g.error?0:g.duration||0;s+=v}o&&!u?e.duration=Math.max(s,e.duration):e.duration=s}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function $l(h){return`[${h.event?'"'+h.event.identifier+'"':"primary"}: ${h.start.toFixed(2)}-${h.end.toFixed(2)}]`}class UM{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,i){const s=e.assetListUrl;let o;try{o=UR(s,this.hls.sessionId,e.baseUrl)}catch(R){const _=this.assignAssetListError(e,re.ASSET_LIST_LOAD_ERROR,R,s);this.hls.trigger(O.ERROR,_);return}i&&o.protocol!=="data:"&&o.searchParams.set("_HLS_start_offset",""+i);const u=this.hls.config,d=u.loader,g=new d(u),S={responseType:"json",url:o.href},v=u.interstitialAssetListLoadPolicy.default,E={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},b={onSuccess:(R,_,D,I)=>{const M=R.data,w=M==null?void 0:M.ASSETS;if(!Array.isArray(w)){const B=this.assignAssetListError(e,re.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),D.url,_,I);this.hls.trigger(O.ERROR,B);return}e.assetListResponse=M,this.hls.trigger(O.ASSET_LIST_LOADED,{event:e,assetListResponse:M,networkDetails:I})},onError:(R,_,D,I)=>{const M=this.assignAssetListError(e,re.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${R.code} ${R.text} (${_.url})`),_.url,I,D);this.hls.trigger(O.ERROR,M)},onTimeout:(R,_,D)=>{const I=this.assignAssetListError(e,re.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${_.url})`),_.url,R,D);this.hls.trigger(O.ERROR,I)}};return g.load(S,E,b),this.hls.trigger(O.ASSET_LIST_LOADING,{event:e}),g}assignAssetListError(e,i,s,o,u,d){return e.error=s,{type:je.NETWORK_ERROR,details:i,fatal:!1,interstitial:e,url:o,error:s,networkDetails:d,stats:u}}}function BR(h){var e;h==null||(e=h.play())==null||e.catch(()=>{})}function Uv(h,e){return`[${h}] Advancing timeline position to ${e}`}class kM extends Xs{constructor(e,i){super("interstitials",e.logger),this.HlsPlayerClass=void 0,this.hls=void 0,this.assetListLoader=void 0,this.mediaSelection=null,this.altSelection=null,this.media=null,this.detachedData=null,this.requiredTracks=null,this.manager=null,this.playerQueue=[],this.bufferedPos=-1,this.timelinePos=-1,this.schedule=void 0,this.playingItem=null,this.bufferingItem=null,this.waitingItem=null,this.endedItem=null,this.playingAsset=null,this.endedAsset=null,this.bufferingAsset=null,this.shouldPlay=!1,this.onPlay=()=>{this.shouldPlay=!0},this.onPause=()=>{this.shouldPlay=!1},this.onSeeking=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled||!this.schedule)return;const o=s-this.timelinePos;if(Math.abs(o)<1/7056e5)return;const d=o<=-.01;this.timelinePos=s,this.bufferedPos=s;const g=this.playingItem;if(!g){this.checkBuffer();return}if(d&&this.schedule.resetErrorsInRange(s,s-o)&&this.updateSchedule(!0),this.checkBuffer(),d&&s<g.start||s>=g.end){var S;const _=this.findItemIndex(g);let D=this.schedule.findItemIndexAtTime(s);if(D===-1&&(D=_+(d?-1:1),this.log(`seeked ${d?"back ":""}to position not covered by schedule ${s} (resolving from ${_} to ${D})`)),!this.isInterstitial(g)&&(S=this.media)!=null&&S.paused&&(this.shouldPlay=!1),!d&&D>_){const I=this.schedule.findJumpRestrictedIndex(_+1,D);if(I>_){this.setSchedulePosition(I);return}}this.setSchedulePosition(D);return}const v=this.playingAsset;if(!v){if(this.playingLastItem&&this.isInterstitial(g)){const _=g.event.assetList[0];_&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(s,_))}return}const E=v.timelineStart,b=v.duration||0;if(d&&s<E||s>=E+b){var R;(R=g.event)!=null&&R.appendInPlace&&(this.clearAssetPlayers(g.event,g),this.flushFrontBuffer(s)),this.setScheduleToAssetAtTime(s,v)}},this.onTimeupdate=()=>{const s=this.currentTime;if(s===void 0||this.playbackDisabled)return;if(s>this.timelinePos)this.timelinePos=s,s>this.bufferedPos&&this.checkBuffer();else return;const o=this.playingItem;if(!o||this.playingLastItem)return;if(s>=o.end){this.timelinePos=o.end;const g=this.findItemIndex(o);this.setSchedulePosition(g+1)}const u=this.playingAsset;if(!u)return;const d=u.timelineStart+(u.duration||0);s>=d&&this.setScheduleToAssetAtTime(s,u)},this.onScheduleUpdate=(s,o)=>{const u=this.schedule;if(!u)return;const d=this.playingItem,g=u.events||[],S=u.items||[],v=u.durations,E=s.map(I=>I.identifier),b=!!(g.length||E.length);(b||o)&&this.log(`INTERSTITIALS_UPDATED (${g.length}): ${g}
305
+ Schedule: ${S.map(I=>$l(I))} pos: ${this.timelinePos}`),E.length&&this.log(`Removed events ${E}`);let R=null,_=null;d&&(R=this.updateItem(d,this.timelinePos),this.itemsMatch(d,R)?this.playingItem=R:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const D=this.bufferingItem;if(D&&(_=this.updateItem(D,this.bufferedPos),this.itemsMatch(D,_)?this.bufferingItem=_:D.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(D.event,null))),s.forEach(I=>{I.assetList.forEach(M=>{this.clearAssetPlayer(M.identifier,null)})}),this.playerQueue.forEach(I=>{if(I.interstitial.appendInPlace){const M=I.assetItem.timelineStart,w=I.timelineOffset-M;if(w)try{I.timelineOffset=M}catch(B){Math.abs(w)>Rh&&this.warn(`${B} ("${I.assetId}" ${I.timelineOffset}->${M})`)}}}),b||o){if(this.hls.trigger(O.INTERSTITIALS_UPDATED,{events:g.slice(0),schedule:S.slice(0),durations:v,removedIds:E}),this.isInterstitial(d)&&E.includes(d.event.identifier)){this.warn(`Interstitial "${d.event.identifier}" removed while playing`),this.primaryFallback(d.event);return}d&&this.trimInPlace(R,d),D&&_!==R&&this.trimInPlace(_,D),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=i,this.assetListLoader=new UM(e),this.schedule=new NM(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(O.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(O.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(O.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(O.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(O.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(O.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(O.BUFFER_APPENDED,this.onBufferAppended,this),e.on(O.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(O.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(O.MEDIA_ENDED,this.onMediaEnded,this),e.on(O.ERROR,this.onError,this),e.on(O.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(O.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(O.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(O.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(O.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(O.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(O.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(O.BUFFER_CODECS,this.onBufferCodecs,this),e.off(O.BUFFER_APPENDED,this.onBufferAppended,this),e.off(O.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(O.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(O.MEDIA_ENDED,this.onMediaEnded,this),e.off(O.ERROR,this.onError,this),e.off(O.DESTROYING,this.onDestroying,this))}startLoad(){this.resumeBuffering()}stopLoad(){this.pauseBuffering()}resumeBuffering(){var e;(e=this.getBufferingPlayer())==null||e.resumeBuffering()}pauseBuffering(){var e;(e=this.getBufferingPlayer())==null||e.pauseBuffering()}destroy(){this.unregisterListeners(),this.stopLoad(),this.assetListLoader&&this.assetListLoader.destroy(),this.emptyPlayerQueue(),this.clearScheduleState(),this.schedule&&this.schedule.destroy(),this.media=this.detachedData=this.mediaSelection=this.requiredTracks=this.altSelection=this.schedule=this.manager=null,this.hls=this.HlsPlayerClass=this.log=null,this.assetListLoader=null,this.onPlay=this.onPause=this.onSeeking=this.onTimeupdate=null,this.onScheduleUpdate=null}onDestroying(){const e=this.primaryMedia||this.media;e&&this.removeMediaListeners(e)}removeMediaListeners(e){$a(e,"play",this.onPlay),$a(e,"pause",this.onPause),$a(e,"seeking",this.onSeeking),$a(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,i){const s=this.media=i.media;pa(s,"seeking",this.onSeeking),pa(s,"timeupdate",this.onTimeupdate),pa(s,"play",this.onPlay),pa(s,"pause",this.onPause)}onMediaAttached(e,i){const s=this.effectivePlayingItem,o=this.detachedData;if(this.detachedData=null,s===null)this.checkStart();else if(!o){this.clearScheduleState();const u=this.findItemIndex(s);this.setSchedulePosition(u)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,i){const s=!!i.transferMedia,o=this.media;if(this.media=null,!s&&(o&&this.removeMediaListeners(o),this.detachedData)){const u=this.getBufferingPlayer();u&&(this.log(`Removing schedule state for detachedData and ${u}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,u.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,i=()=>e.bufferingItem||e.waitingItem,s=b=>b&&e.getAssetPlayer(b.identifier),o=(b,R,_,D,I)=>{if(b){let M=b[R].start;const w=b.event;if(w){if(R==="playout"||w.timelineOccupancy!==Nv.Point){const B=s(_);(B==null?void 0:B.interstitial)===w&&(M+=B.assetItem.startOffset+B[I])}}else{const B=D==="bufferedPos"?d():e[D];M+=B-b.start}return M}return 0},u=(b,R)=>{var _;if(b!==0&&R!=="primary"&&(_=e.schedule)!=null&&_.length){var D;const I=e.schedule.findItemIndexAtTime(b),M=(D=e.schedule.items)==null?void 0:D[I];if(M){const w=M[R].start-M.start;return b+w}}return b},d=()=>{const b=e.bufferedPos;return b===Number.MAX_VALUE?g("primary"):Math.max(b,0)},g=b=>{var R,_;return(R=e.primaryDetails)!=null&&R.live?e.primaryDetails.edge:((_=e.schedule)==null?void 0:_.durations[b])||0},S=(b,R)=>{var _,D;const I=e.effectivePlayingItem;if(I!=null&&(_=I.event)!=null&&_.restrictions.skip||!e.schedule)return;e.log(`seek to ${b} "${R}"`);const M=e.effectivePlayingItem,w=e.schedule.findItemIndexAtTime(b,R),B=(D=e.schedule.items)==null?void 0:D[w],z=e.getBufferingPlayer(),G=z==null?void 0:z.interstitial,K=G==null?void 0:G.appendInPlace,ae=M&&e.itemsMatch(M,B);if(M&&(K||ae)){const q=s(e.playingAsset),Z=(q==null?void 0:q.media)||e.primaryMedia;if(Z){const te=R==="primary"?Z.currentTime:o(M,R,e.playingAsset,"timelinePos","currentTime"),$=b-te,me=(K?te:Z.currentTime)+$;if(me>=0&&(!q||K||me<=q.duration)){Z.currentTime=me;return}}}if(B){let q=b;if(R!=="primary"){const te=B[R].start,$=b-te;q=B.start+$}const Z=!e.isInterstitial(B);if((!e.isInterstitial(M)||M.event.appendInPlace)&&(Z||B.event.appendInPlace)){const te=e.media||(K?z==null?void 0:z.media:null);te&&(te.currentTime=q)}else if(M){const te=e.findItemIndex(M);if(w>te){const me=e.schedule.findJumpRestrictedIndex(te+1,w);if(me>te){e.setSchedulePosition(me);return}}let $=0;if(Z)e.timelinePos=q,e.checkBuffer();else{const me=B.event.assetList,Ee=b-(B[R]||B).start;for(let De=me.length;De--;){const Ie=me[De];if(Ie.duration&&Ee>=Ie.startOffset&&Ee<Ie.startOffset+Ie.duration){$=De;break}}}e.setSchedulePosition(w,$)}}},v=()=>{const b=e.effectivePlayingItem;if(e.isInterstitial(b))return b;const R=i();return e.isInterstitial(R)?R:null},E={get bufferedEnd(){const b=i(),R=e.bufferingItem;if(R&&R===b){var _;return o(R,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-R.playout.start||((_=e.bufferingAsset)==null?void 0:_.startOffset)||0}return 0},get currentTime(){const b=v(),R=e.effectivePlayingItem;return R&&R===b?o(R,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-R.playout.start:0},set currentTime(b){const R=v(),_=e.effectivePlayingItem;_&&_===R&&S(b+_.playout.start,"playout")},get duration(){const b=v();return b?b.playout.end-b.playout.start:0},get assetPlayers(){var b;const R=(b=v())==null?void 0:b.event.assetList;return R?R.map(_=>e.getAssetPlayer(_.identifier)):[]},get playingIndex(){var b;const R=(b=v())==null?void 0:b.event;return R&&e.effectivePlayingAsset?R.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return v()}};return this.manager={get events(){var b;return((b=e.schedule)==null||(b=b.events)==null?void 0:b.slice(0))||[]},get schedule(){var b;return((b=e.schedule)==null||(b=b.items)==null?void 0:b.slice(0))||[]},get interstitialPlayer(){return v()?E:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return i()},get bufferingIndex(){const b=i();return e.findItemIndex(b)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const b=e.effectivePlayingItem;return e.findItemIndex(b)},primary:{get bufferedEnd(){return d()},get currentTime(){const b=e.timelinePos;return b>0?b:0},set currentTime(b){S(b,"primary")},get duration(){return g("primary")},get seekableStart(){var b;return((b=e.primaryDetails)==null?void 0:b.fragmentStart)||0}},integrated:{get bufferedEnd(){return o(i(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return o(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(b){S(b,"integrated")},get duration(){return g("integrated")},get seekableStart(){var b;return u(((b=e.primaryDetails)==null?void 0:b.fragmentStart)||0,"integrated")}},skip:()=>{const b=e.effectivePlayingItem,R=b==null?void 0:b.event;if(R&&!R.restrictions.skip){const _=e.findItemIndex(b);if(R.appendInPlace){const D=b.playout.start+b.event.duration;S(D+.001,"playout")}else e.advanceAfterAssetEnded(R,_,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const i=this.playingItem,s=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!i||!s?!1:this.findItemIndex(i)===s.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,i;if(this.mediaSelection===null)return;const s=this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&!s.event.appendInPlace)return;let o=this.media;!o&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(o=this.primaryMedia);const u=(i=o)==null?void 0:i.currentTime;if(!(u===void 0||!Ue(u)))return u}get primaryMedia(){var e;return this.media||((e=this.detachedData)==null?void 0:e.media)||null}isInterstitial(e){return!!(e!=null&&e.event)}retreiveMediaSource(e,i){const s=this.getAssetPlayer(e);s&&this.transferMediaFromPlayer(s,i)}transferMediaFromPlayer(e,i){const s=e.interstitial.appendInPlace,o=e.media;if(s&&o===this.primaryMedia){if(this.bufferingAsset=null,(!i||this.isInterstitial(i)&&!i.event.appendInPlace)&&i&&o){this.detachedData={media:o};return}const u=e.transferMedia();this.log(`transfer MediaSource from ${e} ${rn(u)}`),this.detachedData=u}else i&&o&&(this.shouldPlay||(this.shouldPlay=!o.paused))}transferMediaTo(e,i){var s,o;if(e.media===i)return;let u=null;const d=this.hls,g=e!==d,S=g&&e.interstitial.appendInPlace,v=(s=this.detachedData)==null?void 0:s.mediaSource;let E;if(d.media)S&&(u=d.transferMedia(),this.detachedData=u),E="Primary";else if(v){const D=this.getBufferingPlayer();D?(u=D.transferMedia(),E=`${D}`):E="detached MediaSource"}else E="detached media";if(!u){if(v)u=this.detachedData,this.log(`using detachedData: MediaSource ${rn(u)}`);else if(!this.detachedData||d.media===i){const D=this.playerQueue;D.length>1&&D.forEach(I=>{if(g&&I.interstitial.appendInPlace!==S){const M=I.interstitial;this.clearInterstitial(I.interstitial,null),M.appendInPlace=!1,M.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${M}`)}}),this.hls.detachMedia(),this.detachedData={media:i}}}const b=u&&"mediaSource"in u&&((o=u.mediaSource)==null?void 0:o.readyState)!=="closed",R=b&&u?u:i;this.log(`${b?"transfering MediaSource":"attaching media"} to ${g?e:"Primary"} from ${E} (media.currentTime: ${i.currentTime})`);const _=this.schedule;if(R===u&&_){const D=g&&e.assetId===_.assetIdAtEnd;R.overrides={duration:_.duration,endOfStream:!g||D,cueRemoval:!g}}e.attachMedia(R)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,i=e==null?void 0:e.events;if(!i||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const s=this.timelinePos,o=this.effectivePlayingItem;if(s===-1){const u=this.hls.startPosition;if(this.log(Uv("checkStart",u)),this.timelinePos=u,i.length&&i[0].cue.pre){const d=e.findEventIndex(i[0].identifier);this.setSchedulePosition(d)}else if(u>=0||!this.primaryLive){const d=this.timelinePos=u>0?u:0,g=e.findItemIndexAtTime(d);this.setSchedulePosition(g)}}else if(o&&!this.playingItem){const u=e.findItemIndex(o);this.setSchedulePosition(u)}}advanceAssetBuffering(e,i){const s=e.event,o=s.findAssetIndex(i),u=mb(s,o);if(!s.isAssetPastPlayoutLimit(u))this.bufferedToEvent(e,u);else if(this.schedule){var d;const g=(d=this.schedule.items)==null?void 0:d[this.findItemIndex(e)+1];g&&this.bufferedToItem(g)}}advanceAfterAssetEnded(e,i,s){const o=mb(e,s);if(e.isAssetPastPlayoutLimit(o)){if(this.schedule){const u=this.schedule.items;if(u){const d=i+1,g=u.length;if(d>=g){this.setSchedulePosition(-1);return}const S=e.resumeTime;this.timelinePos<S&&(this.log(Uv("advanceAfterAssetEnded",S)),this.timelinePos=S,e.appendInPlace&&this.advanceInPlace(S),this.checkBuffer(this.bufferedPos<S)),this.setSchedulePosition(d)}}}else{if(e.appendInPlace){const u=e.assetList[o];u&&this.advanceInPlace(u.timelineStart)}this.setSchedulePosition(i,o)}}setScheduleToAssetAtTime(e,i){const s=this.schedule;if(!s)return;const o=i.parentIdentifier,u=s.getEvent(o);if(u){const d=s.findEventIndex(o),g=s.findAssetIndex(u,e);this.advanceAfterAssetEnded(u,d,g-1)}}setSchedulePosition(e,i){var s;const o=(s=this.schedule)==null?void 0:s.items;if(!o||this.playbackDisabled)return;const u=e>=0?o[e]:null;this.log(`setSchedulePosition ${e}, ${i} (${u&&$l(u)}) pos: ${this.timelinePos}`);const d=this.waitingItem||this.playingItem,g=this.playingLastItem;if(this.isInterstitial(d)){const E=d.event,b=this.playingAsset,R=b==null?void 0:b.identifier,_=R?this.getAssetPlayer(R):null;if(_&&R&&(!this.eventItemsMatch(d,u)||i!==void 0&&R!==E.assetList[i].identifier)){var S;const D=E.findAssetIndex(b);if(this.log(`INTERSTITIAL_ASSET_ENDED ${D+1}/${E.assetList.length} ${Dh(b)}`),this.endedAsset=b,this.playingAsset=null,this.hls.trigger(O.INTERSTITIAL_ASSET_ENDED,{asset:b,assetListIndex:D,event:E,schedule:o.slice(0),scheduleIndex:e,player:_}),d!==this.playingItem){this.itemsMatch(d,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(E,this.findItemIndex(this.playingItem),D);return}this.retreiveMediaSource(R,u),_.media&&!((S=this.detachedData)!=null&&S.mediaSource)&&_.detachMedia()}if(!this.eventItemsMatch(d,u)&&(this.endedItem=d,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${E} ${$l(d)}`),E.hasPlayed=!0,this.hls.trigger(O.INTERSTITIAL_ENDED,{event:E,schedule:o.slice(0),scheduleIndex:e}),E.cue.once)){var v;this.updateSchedule();const D=(v=this.schedule)==null?void 0:v.items;if(u&&D){const I=this.findItemIndex(u);this.advanceSchedule(I,D,i,d,g)}return}}this.advanceSchedule(e,o,i,d,g)}advanceSchedule(e,i,s,o,u){const d=this.schedule;if(!d)return;const g=i[e]||null,S=this.primaryMedia,v=this.playerQueue;if(v.length&&v.forEach(E=>{const b=E.interstitial,R=d.findEventIndex(b.identifier);(R<e||R>e+1)&&this.clearInterstitial(b,g)}),this.isInterstitial(g)){this.timelinePos=Math.min(Math.max(this.timelinePos,g.start),g.end);const E=g.event;if(s===void 0){s=d.findAssetIndex(E,this.timelinePos);const D=mb(E,s-1);if(E.isAssetPastPlayoutLimit(D)||E.appendInPlace&&this.timelinePos===g.end){this.advanceAfterAssetEnded(E,e,s);return}s=D}const b=this.waitingItem;this.assetsBuffered(g,S)||this.setBufferingItem(g);let R=this.preloadAssets(E,s);if(this.eventItemsMatch(g,b||o)||(this.waitingItem=g,this.log(`INTERSTITIAL_STARTED ${$l(g)} ${E.appendInPlace?"append in place":""}`),this.hls.trigger(O.INTERSTITIAL_STARTED,{event:E,schedule:i.slice(0),scheduleIndex:e})),!E.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${E}`);return}if(E.assetListLoader&&(E.assetListLoader.destroy(),E.assetListLoader=void 0),!S){this.log(`Waiting for attachMedia to start Interstitial ${E}`);return}this.waitingItem=this.endedItem=null,this.playingItem=g;const _=E.assetList[s];if(!_){this.advanceAfterAssetEnded(E,e,s||0);return}if(R||(R=this.getAssetPlayer(_.identifier)),R===null||R.destroyed){const D=E.assetList.length;this.warn(`asset ${s+1}/${D} player destroyed ${E}`),R=this.createAssetPlayer(E,_,s),R.loadSource()}if(!this.eventItemsMatch(g,this.bufferingItem)&&E.appendInPlace&&this.isAssetBuffered(_))return;this.startAssetPlayer(R,s,i,e,S),this.shouldPlay&&BR(R.media)}else g?(this.resumePrimary(g,e,o),this.shouldPlay&&BR(this.hls.media)):u&&this.isInterstitial(o)&&(this.endedItem=null,this.playingItem=o,o.event.appendInPlace||this.attachPrimary(d.durations.primary,null))}get playbackDisabled(){return this.hls.config.enableInterstitialPlayback===!1}get primaryDetails(){var e;return(e=this.mediaSelection)==null?void 0:e.main.details}get primaryLive(){var e;return!!((e=this.primaryDetails)!=null&&e.live)}resumePrimary(e,i,s){var o,u;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${$l(e)}`),!((o=this.detachedData)!=null&&o.mediaSource)){let g=this.timelinePos;(g<e.start||g>=e.end)&&(g=this.getPrimaryResumption(e,i),this.log(Uv("resumePrimary",g)),this.timelinePos=g),this.attachPrimary(g,e)}if(!s)return;const d=(u=this.schedule)==null?void 0:u.items;d&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${$l(e)}`),this.hls.trigger(O.INTERSTITIALS_PRIMARY_RESUMED,{schedule:d.slice(0),scheduleIndex:i}),this.checkBuffer())}getPrimaryResumption(e,i){const s=e.start;if(this.primaryLive){const o=this.primaryDetails;if(i===0)return this.hls.startPosition;if(o&&(s<o.fragmentStart||s>o.edge))return this.hls.liveSyncPosition||-1}return s}isAssetBuffered(e){const i=this.getAssetPlayer(e.identifier);return i!=null&&i.hls?i.hls.bufferedToEnd:lt.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,i,s){i?this.setBufferingItem(i):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const o=this.primaryMedia;if(!o)return;const u=this.hls;u.media?this.checkBuffer():(this.transferMediaTo(u,o),s&&this.startLoadingPrimaryAt(e,s)),s||(this.log(Uv("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,s))}startLoadingPrimaryAt(e,i){var s;const o=this.hls;!o.loadingEnabled||!o.media||Math.abs((((s=o.mainForwardBufferInfo)==null?void 0:s.start)||o.media.currentTime)-e)>.5?o.startLoad(e,i):o.bufferingEnabled||o.resumeBuffering()}onManifestLoading(){var e;this.stopLoad(),(e=this.schedule)==null||e.reset(),this.emptyPlayerQueue(),this.clearScheduleState(),this.shouldPlay=!1,this.bufferedPos=this.timelinePos=-1,this.mediaSelection=this.altSelection=this.manager=this.requiredTracks=null,this.hls.off(O.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(O.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,i){if(i.level===-1||!this.schedule)return;const s=this.hls.levels[i.level];if(!s.details)return;const o=Qt(Qt({},this.mediaSelection||this.altSelection),{},{main:s});this.mediaSelection=o,this.schedule.parseInterstitialDateRanges(o,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,i){const s=this.hls.audioTracks[i.id],o=this.mediaSelection;if(!o){this.altSelection=Qt(Qt({},this.altSelection),{},{audio:s});return}const u=Qt(Qt({},o),{},{audio:s});this.mediaSelection=u}onSubtitleTrackUpdated(e,i){const s=this.hls.subtitleTracks[i.id],o=this.mediaSelection;if(!o){this.altSelection=Qt(Qt({},this.altSelection),{},{subtitles:s});return}const u=Qt(Qt({},o),{},{subtitles:s});this.mediaSelection=u}onAudioTrackSwitching(e,i){const s=jx(i);this.playerQueue.forEach(({hls:o})=>o&&(o.setAudioOption(i)||o.setAudioOption(s)))}onSubtitleTrackSwitch(e,i){const s=jx(i);this.playerQueue.forEach(({hls:o})=>o&&(o.setSubtitleOption(i)||i.id!==-1&&o.setSubtitleOption(s)))}onBufferCodecs(e,i){const s=i.tracks;s&&(this.requiredTracks=s)}onBufferAppended(e,i){this.checkBuffer()}onBufferFlushed(e,i){const s=this.playingItem;if(s&&!this.itemsMatch(s,this.bufferingItem)&&!this.isInterstitial(s)){const o=this.timelinePos;this.bufferedPos=o,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const i=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&i){for(let o=0;o<i.length;o++){const u=i[o];if(u.cue.post){var s;const d=this.schedule.findEventIndex(u.identifier),g=(s=this.schedule.items)==null?void 0:s[d];this.isInterstitial(g)&&this.eventItemsMatch(g,this.bufferingItem)&&this.bufferedToItem(g,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const i=this.playingItem;if(!this.playingLastItem&&i){const s=this.findItemIndex(i);this.setSchedulePosition(s+1)}else this.shouldPlay=!1}updateItem(e,i){var s;const o=(s=this.schedule)==null?void 0:s.items;if(e&&o){const u=this.findItemIndex(e,i);return o[u]||null}return null}trimInPlace(e,i){if(this.isInterstitial(e)&&e.event.appendInPlace&&i.end-e.end>.25){e.event.assetList.forEach((u,d)=>{e.event.isAssetPastPlayoutLimit(d)&&this.clearAssetPlayer(u.identifier,null)});const s=e.end+.25,o=lt.bufferInfo(this.primaryMedia,s,0);(o.end>s||(o.nextStart||0)>s)&&(this.log(`trim buffered interstitial ${$l(e)} (was ${$l(i)})`),this.attachPrimary(s,null,!0),this.flushFrontBuffer(s))}}itemsMatch(e,i){return!!i&&(e===i||e.event&&i.event&&this.eventItemsMatch(e,i)||!e.event&&!i.event&&this.findItemIndex(e)===this.findItemIndex(i))}eventItemsMatch(e,i){var s;return!!i&&(e===i||e.event.identifier===((s=i.event)==null?void 0:s.identifier))}findItemIndex(e,i){return e&&this.schedule?this.schedule.findItemIndex(e,i):-1}updateSchedule(e=!1){var i;const s=this.mediaSelection;s&&((i=this.schedule)==null||i.updateSchedule(s,[],e))}checkBuffer(e){var i;const s=(i=this.schedule)==null?void 0:i.items;if(!s)return;const o=lt.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=o.len<1),this.updateBufferedPos(o.end,s,e)}updateBufferedPos(e,i,s){const o=this.schedule,u=this.bufferingItem;if(this.bufferedPos>e||!o)return;if(i.length===1&&this.itemsMatch(i[0],u)){this.bufferedPos=e;return}const d=this.playingItem,g=this.findItemIndex(d);let S=o.findItemIndexAtTime(e);if(this.bufferedPos<e){var v;const E=this.findItemIndex(u),b=Math.min(E+1,i.length-1),R=i[b];if((S===-1&&u&&e>=u.end||(v=R.event)!=null&&v.appendInPlace&&e+.01>=R.start)&&(S=b),this.isInterstitial(u)){const _=u.event;if(b-g>1&&_.appendInPlace===!1||_.assetList.length===0&&_.assetListLoader)return}if(this.bufferedPos=e,S>E&&S>g)this.bufferedToItem(R);else{const _=this.primaryDetails;this.primaryLive&&_&&e>_.edge-_.targetduration&&R.start<_.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(R)&&this.preloadAssets(R.event,0)}}else s&&d&&!this.itemsMatch(d,u)&&(S===g?this.bufferedToItem(d):S===g+1&&this.bufferedToItem(i[S]))}assetsBuffered(e,i){return e.event.assetList.length===0?!1:!e.event.assetList.some(o=>{const u=this.getAssetPlayer(o.identifier);return!(u!=null&&u.bufferedInPlaceToEnd(i))})}setBufferingItem(e){const i=this.bufferingItem,s=this.schedule;if(!this.itemsMatch(e,i)&&s){const{items:o,events:u}=s;if(!o||!u)return i;const d=this.isInterstitial(e),g=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const S=g?g.remaining:i?i.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${$l(e)}`+(i?` (${S.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(d){const v=s.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((E,b)=>{const R=this.getAssetPlayer(E.identifier);R&&(b===v&&R.loadSource(),R.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(v=>v.pauseBuffering());this.hls.trigger(O.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:u.slice(0),schedule:o.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return i}bufferedToItem(e,i=0){const s=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,i);else if(s!==null){this.bufferingAsset=null;const o=this.detachedData;o?o.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const i=this.findItemIndex(e),s=this.getPrimaryResumption(e,i);this.startLoadingPrimaryAt(s)}bufferedToEvent(e,i){const s=e.event,o=s.assetList.length===0&&!s.assetListLoader,u=s.cue.once;if(o||!u){const d=this.preloadAssets(s,i);if(d!=null&&d.interstitial.appendInPlace){const g=this.primaryMedia;g&&this.bufferAssetPlayer(d,g)}}}preloadAssets(e,i){const s=e.assetUrl,o=e.assetList.length,u=o===0&&!e.assetListLoader,d=e.cue.once;if(u){const S=e.timelineStart;if(e.appendInPlace){var g;const R=this.playingItem;!this.isInterstitial(R)&&(R==null||(g=R.nextEvent)==null?void 0:g.identifier)===e.identifier&&this.flushFrontBuffer(S+.25)}let v,E=0;if(!this.playingItem&&this.primaryLive&&(E=this.hls.startPosition,E===-1&&(E=this.hls.liveSyncPosition||0)),E&&!(e.cue.pre||e.cue.post)){const R=E-S;R>0&&(v=Math.round(R*1e3)/1e3)}if(this.log(`Load interstitial asset ${i+1}/${s?1:o} ${e}${v?` live-start: ${E} start-offset: ${v}`:""}`),s)return this.createAsset(e,0,0,S,e.duration,s);const b=this.assetListLoader.loadAssetList(e,v);b&&(e.assetListLoader=b)}else if(!d&&o){for(let v=i;v<o;v++){const E=e.assetList[v],b=this.getAssetPlayerQueueIndex(E.identifier);(b===-1||this.playerQueue[b].destroyed)&&!E.error&&this.createAssetPlayer(e,E,v)}const S=e.assetList[i];if(S){const v=this.getAssetPlayer(S.identifier);return v&&v.loadSource(),v}}return null}flushFrontBuffer(e){const i=this.requiredTracks;if(!i)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(i).forEach(o=>{this.hls.trigger(O.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:o})})}getAssetPlayerQueueIndex(e){const i=this.playerQueue;for(let s=0;s<i.length;s++)if(e===i[s].assetId)return s;return-1}getAssetPlayer(e){const i=this.getAssetPlayerQueueIndex(e);return this.playerQueue[i]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:i}=this;if(i){for(let s=0;s<e.length;s++)if(e[s].media===i)return e[s]}return null}createAsset(e,i,s,o,u,d){const g={parentIdentifier:e.identifier,identifier:OM(e,d,i),duration:u,startOffset:s,timelineStart:o,uri:d};return this.createAssetPlayer(e,g,i)}createAssetPlayer(e,i,s){const o=this.hls,u=o.userConfig;let d=u.videoPreference;const g=o.loadLevelObj||o.levels[o.currentLevel];(d||g)&&(d=Jt({},d),g.videoCodec&&(d.videoCodec=g.videoCodec),g.videoRange&&(d.allowedVideoRanges=[g.videoRange]));const S=o.audioTracks[o.audioTrack],v=o.subtitleTracks[o.subtitleTrack];let E=0;if(this.primaryLive||e.appendInPlace){const G=this.timelinePos-i.timelineStart;if(G>1){const K=i.duration;K&&G<K&&(E=G)}}const b=i.identifier,R=Qt(Qt({},u),{},{maxMaxBufferLength:Math.min(180,o.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:o.sessionId,assetPlayerId:b,abrEwmaDefaultEstimate:o.bandwidthEstimate,interstitialsController:void 0,startPosition:E,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:d,audioPreference:S||u.audioPreference,subtitlePreference:v||u.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,i.timelineStart&&(R.timelineOffset=i.timelineStart));const _=R.cmcd;_!=null&&_.sessionId&&_.contentId&&(R.cmcd=Jt({},_,{contentId:o0(i.uri)})),this.getAssetPlayer(b)&&this.warn(`Duplicate date range identifier ${e} and asset ${b}`);const D=new wM(this.HlsPlayerClass,R,e,i);this.playerQueue.push(D),e.assetList[s]=i;let I=!0;const M=G=>{if(G.live){var K;const Z=new Error(`Interstitials MUST be VOD assets ${e}`),te={fatal:!0,type:je.OTHER_ERROR,details:re.INTERSTITIAL_ASSET_ITEM_ERROR,error:Z},$=((K=this.schedule)==null?void 0:K.findEventIndex(e.identifier))||-1;this.handleAssetItemError(te,e,$,s,Z.message);return}const ae=G.edge-G.fragmentStart,q=i.duration;(I||q===null||ae>q)&&(I=!1,this.log(`Interstitial asset "${b}" duration change ${q} > ${ae}`),i.duration=ae,this.updateSchedule())};D.on(O.LEVEL_UPDATED,(G,{details:K})=>M(K)),D.on(O.LEVEL_PTS_UPDATED,(G,{details:K})=>M(K)),D.on(O.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const w=(G,K)=>{const ae=this.getAssetPlayer(b);if(ae&&K.tracks){ae.off(O.BUFFER_CODECS,w),ae.tracks=K.tracks;const q=this.primaryMedia;this.bufferingAsset===ae.assetItem&&q&&!ae.media&&this.bufferAssetPlayer(ae,q)}};D.on(O.BUFFER_CODECS,w);const B=()=>{var G;const K=this.getAssetPlayer(b);if(this.log(`buffered to end of asset ${K}`),!K||!this.schedule)return;const ae=this.schedule.findEventIndex(e.identifier),q=(G=this.schedule.items)==null?void 0:G[ae];this.isInterstitial(q)&&this.advanceAssetBuffering(q,i)};D.on(O.BUFFERED_TO_END,B);const z=G=>()=>{if(!this.getAssetPlayer(b)||!this.schedule)return;this.shouldPlay=!0;const ae=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,ae,G)};return D.once(O.MEDIA_ENDED,z(s)),D.once(O.PLAYOUT_LIMIT_REACHED,z(1/0)),D.on(O.ERROR,(G,K)=>{if(!this.schedule)return;const ae=this.getAssetPlayer(b);if(K.details===re.BUFFER_STALLED_ERROR){if(ae!=null&&ae.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(K,e,this.schedule.findEventIndex(e.identifier),s,`Asset player error ${K.error} ${e}`)}),D.on(O.DESTROYING,()=>{if(!this.getAssetPlayer(b)||!this.schedule)return;const K=new Error(`Asset player destroyed unexpectedly ${b}`),ae={fatal:!0,type:je.OTHER_ERROR,details:re.INTERSTITIAL_ASSET_ITEM_ERROR,error:K};this.handleAssetItemError(ae,e,this.schedule.findEventIndex(e.identifier),s,K.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${Dh(i)}`),this.hls.trigger(O.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:i,assetListIndex:s,event:e,player:D}),D}clearInterstitial(e,i){this.clearAssetPlayers(e,i),e.reset()}clearAssetPlayers(e,i){e.assetList.forEach(s=>{this.clearAssetPlayer(s.identifier,i)})}resetAssetPlayer(e){const i=this.getAssetPlayerQueueIndex(e);if(i!==-1){this.log(`reset asset player "${e}" after error`);const s=this.playerQueue[i];this.transferMediaFromPlayer(s,null),s.resetDetails()}}clearAssetPlayer(e,i){const s=this.getAssetPlayerQueueIndex(e);if(s!==-1){const o=this.playerQueue[s];this.log(`clear ${o} toSegment: ${i&&$l(i)}`),this.transferMediaFromPlayer(o,i),this.playerQueue.splice(s,1),o.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,i,s,o,u){const{interstitial:d,assetItem:g,assetId:S}=e,v=d.assetList.length,E=this.playingAsset;this.endedAsset=null,this.playingAsset=g,(!E||E.identifier!==S)&&(E&&(this.clearAssetPlayer(E.identifier,s[o]),delete E.error),this.log(`INTERSTITIAL_ASSET_STARTED ${i+1}/${v} ${Dh(g)}`),this.hls.trigger(O.INTERSTITIAL_ASSET_STARTED,{asset:g,assetListIndex:i,event:d,schedule:s.slice(0),scheduleIndex:o,player:e})),this.bufferAssetPlayer(e,u)}bufferAssetPlayer(e,i){var s,o;if(!this.schedule)return;const{interstitial:u,assetItem:d}=e,g=this.schedule.findEventIndex(u.identifier),S=(s=this.schedule.items)==null?void 0:s[g];if(!S)return;e.loadSource(),this.setBufferingItem(S),this.bufferingAsset=d;const v=this.getBufferingPlayer();if(v===e)return;const E=u.appendInPlace;if(E&&(v==null?void 0:v.interstitial.appendInPlace)===!1)return;const b=(v==null?void 0:v.tracks)||((o=this.detachedData)==null?void 0:o.tracks)||this.requiredTracks;if(E&&d!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(b&&!yx(b,e.tracks)){const R=new Error(`Asset ${Dh(d)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(b)}')`),_={fatal:!0,type:je.OTHER_ERROR,details:re.INTERSTITIAL_ASSET_ITEM_ERROR,error:R},D=u.findAssetIndex(d);this.handleAssetItemError(_,u,g,D,R.message);return}}this.transferMediaTo(e,i)}handleInPlaceStall(e){const i=this.schedule,s=this.primaryMedia;if(!i||!s)return;const o=s.currentTime,u=i.findAssetIndex(e,o),d=e.assetList[u];if(d){const g=this.getAssetPlayer(d.identifier);if(g){const S=g.currentTime||o-d.timelineStart,v=g.duration-S;if(this.warn(`Stalled at ${S} of ${S+v} in ${g} ${e} (media.currentTime: ${o})`),S&&(v/s.playbackRate<.5||g.bufferedInPlaceToEnd(s))&&g.hls){const E=i.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,E,u)}}}}advanceInPlace(e){const i=this.primaryMedia;i&&i.currentTime<e&&(i.currentTime=e)}handleAssetItemError(e,i,s,o,u){if(e.details===re.BUFFER_STALLED_ERROR)return;const d=i.assetList[o]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${d&&Dh(d)} ${e.error}`),!this.schedule)return;const g=(d==null?void 0:d.identifier)||"",S=this.getAssetPlayerQueueIndex(g),v=this.playerQueue[S]||null,E=this.schedule.items,b=Jt({},e,{fatal:!1,errorAction:ph(!0),asset:d,assetListIndex:o,event:i,schedule:E,scheduleIndex:s,player:v});if(this.hls.trigger(O.INTERSTITIAL_ASSET_ERROR,b),!e.fatal)return;const R=this.playingAsset,_=this.bufferingAsset,D=new Error(u);if(d&&(this.clearAssetPlayer(g,null),d.error=D),!i.assetList.some(I=>!I.error))i.error=D;else for(let I=o;I<i.assetList.length;I++)this.resetAssetPlayer(i.assetList[I].identifier);this.updateSchedule(!0),i.error?this.primaryFallback(i):R&&R.identifier===g?this.advanceAfterAssetEnded(i,s,o):_&&_.identifier===g&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,_)}primaryFallback(e){const i=e.timelineStart,s=this.effectivePlayingItem;let o=this.timelinePos;if(s){this.log(`Fallback to primary from event "${e.identifier}" start: ${i} pos: ${o} playing: ${$l(s)} error: ${e.error}`),o===-1&&(o=this.hls.startPosition);const d=this.updateItem(s,o);this.itemsMatch(s,d)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(i,null),this.flushFrontBuffer(i))}else if(o===-1){this.checkStart();return}if(!this.schedule)return;const u=this.schedule.findItemIndexAtTime(o);this.setSchedulePosition(u)}onAssetListLoaded(e,i){var s,o;const u=i.event,d=u.identifier,g=i.assetListResponse.ASSETS;if(!((s=this.schedule)!=null&&s.hasEvent(d)))return;const S=u.timelineStart,v=u.duration;let E=0;g.forEach((I,M)=>{const w=parseFloat(I.DURATION);this.createAsset(u,M,E,S+E,w,I.URI),E+=w}),u.duration=E,this.log(`Loaded asset-list with duration: ${E} (was: ${v}) ${u}`);const b=this.waitingItem,R=(b==null?void 0:b.event.identifier)===d;this.updateSchedule();const _=(o=this.bufferingItem)==null?void 0:o.event;if(R){var D;const I=this.schedule.findEventIndex(d),M=(D=this.schedule.items)==null?void 0:D[I];if(M){if(!this.playingItem&&this.timelinePos>M.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==I){u.error=new Error(`Interstitial ${g.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${u}`),this.log(u.error.message),this.updateSchedule(!0),this.primaryFallback(u);return}this.setBufferingItem(M)}this.setSchedulePosition(I)}else if((_==null?void 0:_.identifier)===d){const I=u.assetList[0];if(I){const M=this.getAssetPlayer(I.identifier);if(_.appendInPlace){const w=this.primaryMedia;M&&w&&this.bufferAssetPlayer(M,w)}else M&&M.loadSource()}}}onError(e,i){if(this.schedule)switch(i.details){case re.ASSET_LIST_PARSING_ERROR:case re.ASSET_LIST_LOAD_ERROR:case re.ASSET_LIST_LOAD_TIMEOUT:{const s=i.interstitial;s&&(this.updateSchedule(!0),this.primaryFallback(s));break}case re.BUFFER_STALLED_ERROR:{const s=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(s)&&s.event.appendInPlace){this.handleInPlaceStall(s.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const zR=500;class BM extends $T{constructor(e,i,s){super(e,i,s,"subtitle-stream-controller",Be.SUBTITLE),this.currentTrackId=-1,this.tracksBuffered=[],this.mainDetails=null,this.registerListeners()}onHandlerDestroying(){this.unregisterListeners(),super.onHandlerDestroying(),this.mainDetails=null}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(O.LEVEL_LOADED,this.onLevelLoaded,this),e.on(O.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(O.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(O.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(O.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(O.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(O.LEVEL_LOADED,this.onLevelLoaded,this),e.off(O.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(O.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(O.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(O.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(O.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,i){this.stopLoad(),this.state=be.IDLE,this.setInterval(zR),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=i?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,i){this.tracksBuffered=[],super.onMediaDetaching(e,i)}onLevelLoaded(e,i){this.mainDetails=i.details}onSubtitleFragProcessed(e,i){const{frag:s,success:o}=i;if(this.fragContextChanged(s)||(Vn(s)&&(this.fragPrevious=s),this.state=be.IDLE),!o)return;const u=this.tracksBuffered[this.currentTrackId];if(!u)return;let d;const g=s.start;for(let v=0;v<u.length;v++)if(g>=u[v].start&&g<=u[v].end){d=u[v];break}const S=s.start+s.duration;d?d.end=S:(d={start:g,end:S},u.push(d)),this.fragmentTracker.fragBuffered(s),this.fragBufferedComplete(s,null),this.media&&this.tick()}onBufferFlushing(e,i){const{startOffset:s,endOffset:o}=i;if(s===0&&o!==Number.POSITIVE_INFINITY){const u=o-1;if(u<=0)return;i.endOffsetSubtitles=Math.max(0,u),this.tracksBuffered.forEach(d=>{for(let g=0;g<d.length;){if(d[g].end<=u){d.shift();continue}else if(d[g].start<u)d[g].start=u;else break;g++}}),this.fragmentTracker.removeFragmentsInRange(s,u,Be.SUBTITLE)}}onError(e,i){const s=i.frag;(s==null?void 0:s.type)===Be.SUBTITLE&&(i.details===re.FRAG_GAP&&this.fragmentTracker.fragBuffered(s,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==be.STOPPED&&(this.state=be.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:i}){if(this.levels&&hR(this.levels,i)){this.levels=i.map(s=>new Wg(s));return}this.tracksBuffered=[],this.levels=i.map(s=>{const o=new Wg(s);return this.tracksBuffered[o.id]=[],o}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,Be.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,i){var s;if(this.currentTrackId=i.id,!((s=this.levels)!=null&&s.length)||this.currentTrackId===-1){this.clearInterval();return}const o=this.levels[this.currentTrackId];o!=null&&o.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,o&&this.state!==be.STOPPED&&this.setInterval(zR)}onSubtitleTrackLoaded(e,i){var s;const{currentTrackId:o,levels:u}=this,{details:d,id:g}=i;if(!u){this.warn(`Subtitle tracks were reset while loading level ${g}`);return}const S=u[g];if(g>=u.length||!S)return;this.log(`Subtitle track ${g} loaded [${d.startSN},${d.endSN}]${d.lastPartSn?`[part-${d.lastPartSn}-${d.lastPartIndex}]`:""},duration:${d.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let v=0;if(d.live||(s=S.details)!=null&&s.live){if(d.deltaUpdateFailed)return;const b=this.mainDetails;if(!b){this.startFragRequested=!1;return}const R=b.fragments[0];if(!S.details)d.hasProgramDateTime&&b.hasProgramDateTime?(Tv(d,b),v=d.fragmentStart):R&&(v=R.start,GT(d,v));else{var E;v=this.alignPlaylists(d,S.details,(E=this.levelLastLoaded)==null?void 0:E.details),v===0&&R&&(v=R.start,GT(d,v))}b&&!this.startFragRequested&&this.setStartPosition(b,v)}S.details=d,this.levelLastLoaded=S,g===o&&(this.hls.trigger(O.SUBTITLE_TRACK_UPDATED,{details:d,id:g,groupId:i.groupId}),this.tick(),d.live&&!this.fragCurrent&&this.media&&this.state===be.IDLE&&(xf(null,d.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),S.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:i,payload:s}=e,o=i.decryptdata,u=this.hls;if(!this.fragContextChanged(i)&&s&&s.byteLength>0&&o!=null&&o.key&&o.iv&&vh(o.method)){const d=performance.now();this.decrypter.decrypt(new Uint8Array(s),o.key.buffer,o.iv.buffer,NT(o.method)).catch(g=>{throw u.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.FRAG_DECRYPT_ERROR,fatal:!1,error:g,reason:g.message,frag:i}),g}).then(g=>{const S=performance.now();u.trigger(O.FRAG_DECRYPTED,{frag:i,payload:g,stats:{tstart:d,tdecrypt:S}})}).catch(g=>{this.warn(`${g.name}: ${g.message}`),this.state=be.IDLE})}}doTick(){if(!this.media){this.state=be.IDLE;return}if(this.state===be.IDLE){const{currentTrackId:e,levels:i}=this,s=i==null?void 0:i[e];if(!s||!i.length||!s.details||this.waitForLive(s))return;const{config:o}=this,u=this.getLoadPosition(),d=lt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],u,o.maxBufferHole),{end:g,len:S}=d,v=s.details,E=this.hls.maxBufferLength+v.levelTargetDuration;if(S>E)return;const b=v.fragments,R=b.length,_=v.edge;let D=null;const I=this.fragPrevious;if(g<_){const B=o.maxFragLookUpTolerance,z=g>_-B?0:B;D=xf(I,b,Math.max(b[0].start,g),z),!D&&I&&I.start<b[0].start&&(D=b[0])}else D=b[R-1];if(D=this.filterReplacedPrimary(D,s.details),!D)return;const M=D.sn-v.startSN,w=b[M-1];if(w&&w.cc===D.cc&&this.fragmentTracker.getState(w)===yi.NOT_LOADED&&(D=w),this.fragmentTracker.getState(D)===yi.NOT_LOADED){const B=this.mapToInitFragWhenRequired(D);B&&this.loadFragment(B,s,g)}}}loadFragment(e,i,s){Vn(e)?super.loadFragment(e,i,s):this._loadInitSegment(e,i)}get mediaBufferTimeRanges(){return new zM(this.tracksBuffered[this.currentTrackId]||[])}}class zM{constructor(e){this.buffered=void 0;const i=(s,o,u)=>{if(o=o>>>0,o>u-1)throw new DOMException(`Failed to execute '${s}' on 'TimeRanges': The index provided (${o}) is greater than the maximum bound (${u})`);return e[o][s]};this.buffered={get length(){return e.length},end(s){return i("end",s,e.length)},start(s){return i("start",s,e.length)}}}}const FM={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},FR=h=>String.fromCharCode(FM[h]||h),Hl=15,Eo=100,PM={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},GM={17:2,18:4,21:6,22:8,23:10,19:13,20:15},$M={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},HM={25:2,26:4,29:6,30:8,31:10,27:13,28:15},jM=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class VM{constructor(){this.time=null,this.verboseLevel=0}log(e,i){if(this.verboseLevel>=e){const s=typeof i=="function"?i():i;Zt.log(`${this.time} [${e}] ${s}`)}}}const Rf=function(e){const i=[];for(let s=0;s<e.length;s++)i.push(e[s].toString(16));return i};class PR{constructor(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}reset(){this.foreground="white",this.underline=!1,this.italics=!1,this.background="black",this.flash=!1}setStyles(e){const i=["foreground","underline","italics","background","flash"];for(let s=0;s<i.length;s++){const o=i[s];e.hasOwnProperty(o)&&(this[o]=e[o])}}isDefault(){return this.foreground==="white"&&!this.underline&&!this.italics&&this.background==="black"&&!this.flash}equals(e){return this.foreground===e.foreground&&this.underline===e.underline&&this.italics===e.italics&&this.background===e.background&&this.flash===e.flash}copy(e){this.foreground=e.foreground,this.underline=e.underline,this.italics=e.italics,this.background=e.background,this.flash=e.flash}toString(){return"color="+this.foreground+", underline="+this.underline+", italics="+this.italics+", background="+this.background+", flash="+this.flash}}class YM{constructor(){this.uchar=" ",this.penState=new PR}reset(){this.uchar=" ",this.penState.reset()}setChar(e,i){this.uchar=e,this.penState.copy(i)}setPenState(e){this.penState.copy(e)}equals(e){return this.uchar===e.uchar&&this.penState.equals(e.penState)}copy(e){this.uchar=e.uchar,this.penState.copy(e.penState)}isEmpty(){return this.uchar===" "&&this.penState.isDefault()}}class qM{constructor(e){this.chars=[],this.pos=0,this.currPenState=new PR,this.cueStartTime=null,this.logger=void 0;for(let i=0;i<Eo;i++)this.chars.push(new YM);this.logger=e}equals(e){for(let i=0;i<Eo;i++)if(!this.chars[i].equals(e.chars[i]))return!1;return!0}copy(e){for(let i=0;i<Eo;i++)this.chars[i].copy(e.chars[i])}isEmpty(){let e=!0;for(let i=0;i<Eo;i++)if(!this.chars[i].isEmpty()){e=!1;break}return e}setCursor(e){this.pos!==e&&(this.pos=e),this.pos<0?(this.logger.log(3,"Negative cursor position "+this.pos),this.pos=0):this.pos>Eo&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=Eo)}moveCursor(e){const i=this.pos+e;if(e>1)for(let s=this.pos+1;s<i+1;s++)this.chars[s].setPenState(this.currPenState);this.setCursor(i)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const i=FR(e);if(this.pos>=Eo){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+i+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(i,this.currPenState),this.moveCursor(1)}clearFromPos(e){let i;for(i=e;i<Eo;i++)this.chars[i].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let i=!0;for(let s=0;s<Eo;s++){const o=this.chars[s].uchar;o!==" "&&(i=!1),e.push(o)}return i?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class gb{constructor(e){this.rows=[],this.currRow=Hl-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let i=0;i<Hl;i++)this.rows.push(new qM(e));this.logger=e}reset(){for(let e=0;e<Hl;e++)this.rows[e].clear();this.currRow=Hl-1}equals(e){let i=!0;for(let s=0;s<Hl;s++)if(!this.rows[s].equals(e.rows[s])){i=!1;break}return i}copy(e){for(let i=0;i<Hl;i++)this.rows[i].copy(e.rows[i])}isEmpty(){let e=!0;for(let i=0;i<Hl;i++)if(!this.rows[i].isEmpty()){e=!1;break}return e}backSpace(){this.rows[this.currRow].backSpace()}clearToEndOfRow(){this.rows[this.currRow].clearToEndOfRow()}insertChar(e){this.rows[this.currRow].insertChar(e)}setPen(e){this.rows[this.currRow].setPenStyles(e)}moveCursor(e){this.rows[this.currRow].moveCursor(e)}setCursor(e){this.logger.log(2,"setCursor: "+e),this.rows[this.currRow].setCursor(e)}setPAC(e){this.logger.log(2,()=>"pacData = "+rn(e));let i=e.row-1;if(this.nrRollUpRows&&i<this.nrRollUpRows-1&&(i=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==i){for(let g=0;g<Hl;g++)this.rows[g].clear();const u=this.currRow+1-this.nrRollUpRows,d=this.lastOutputScreen;if(d){const g=d.rows[u].cueStartTime,S=this.logger.time;if(g!==null&&S!==null&&g<S)for(let v=0;v<this.nrRollUpRows;v++)this.rows[i-this.nrRollUpRows+v+1].copy(d.rows[u+v])}}this.currRow=i;const s=this.rows[this.currRow];if(e.indent!==null){const u=e.indent,d=Math.max(u-1,0);s.setCursor(e.indent),e.color=s.chars[d].penState.foreground}const o={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(o)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+rn(e)),this.backSpace(),this.setPen(e),this.insertChar(32)}setRollUpRows(e){this.nrRollUpRows=e}rollUp(){if(this.nrRollUpRows===null){this.logger.log(3,"roll_up but nrRollUpRows not set yet");return}this.logger.log(1,()=>this.getDisplayText());const e=this.currRow+1-this.nrRollUpRows,i=this.rows.splice(e,1)[0];i.clear(),this.rows.splice(this.currRow,0,i),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const i=[];let s="",o=-1;for(let u=0;u<Hl;u++){const d=this.rows[u].getTextString();d&&(o=u+1,e?i.push("Row "+o+": '"+d+"'"):i.push(d.trim()))}return i.length>0&&(e?s="["+i.join(" | ")+"]":s=i.join(`
306
+ `)),s}getTextAndFormat(){return this.rows}}class GR{constructor(e,i,s){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=e,this.outputFilter=i,this.mode=null,this.verbose=0,this.displayedMemory=new gb(s),this.nonDisplayedMemory=new gb(s),this.lastOutputScreen=new gb(s),this.currRollUpRow=this.displayedMemory.rows[Hl-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=s}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Hl-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null}getHandler(){return this.outputFilter}setHandler(e){this.outputFilter=e}setPAC(e){this.writeScreen.setPAC(e)}setBkgData(e){this.writeScreen.setBkgData(e)}setMode(e){e!==this.mode&&(this.mode=e,this.logger.log(2,()=>"MODE="+e),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=e)}insertChars(e){for(let s=0;s<e.length;s++)this.writeScreen.insertChar(e[s]);const i=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>i+": "+this.writeScreen.getDisplayText(!0)),(this.mode==="MODE_PAINT-ON"||this.mode==="MODE_ROLL-UP")&&(this.logger.log(1,()=>"DISPLAYED: "+this.displayedMemory.getDisplayText(!0)),this.outputDataUpdate())}ccRCL(){this.logger.log(2,"RCL - Resume Caption Loading"),this.setMode("MODE_POP-ON")}ccBS(){this.logger.log(2,"BS - BackSpace"),this.mode!=="MODE_TEXT"&&(this.writeScreen.backSpace(),this.writeScreen===this.displayedMemory&&this.outputDataUpdate())}ccAOF(){}ccAON(){}ccDER(){this.logger.log(2,"DER- Delete to End of Row"),this.writeScreen.clearToEndOfRow(),this.outputDataUpdate()}ccRU(e){this.logger.log(2,"RU("+e+") - Roll Up"),this.writeScreen=this.displayedMemory,this.setMode("MODE_ROLL-UP"),this.writeScreen.setRollUpRows(e)}ccFON(){this.logger.log(2,"FON - Flash On"),this.writeScreen.setPen({flash:!0})}ccRDC(){this.logger.log(2,"RDC - Resume Direct Captioning"),this.setMode("MODE_PAINT-ON")}ccTR(){this.logger.log(2,"TR"),this.setMode("MODE_TEXT")}ccRTD(){this.logger.log(2,"RTD"),this.setMode("MODE_TEXT")}ccEDM(){this.logger.log(2,"EDM - Erase Displayed Memory"),this.displayedMemory.reset(),this.outputDataUpdate(!0)}ccCR(){this.logger.log(2,"CR - Carriage Return"),this.writeScreen.rollUp(),this.outputDataUpdate(!0)}ccENM(){this.logger.log(2,"ENM - Erase Non-displayed Memory"),this.nonDisplayedMemory.reset()}ccEOC(){if(this.logger.log(2,"EOC - End Of Caption"),this.mode==="MODE_POP-ON"){const e=this.displayedMemory;this.displayedMemory=this.nonDisplayedMemory,this.nonDisplayedMemory=e,this.writeScreen=this.nonDisplayedMemory,this.logger.log(1,()=>"DISP: "+this.displayedMemory.getDisplayText())}this.outputDataUpdate(!0)}ccTO(e){this.logger.log(2,"TO("+e+") - Tab Offset"),this.writeScreen.moveCursor(e)}ccMIDROW(e){const i={flash:!1};if(i.underline=e%2===1,i.italics=e>=46,i.italics)i.foreground="white";else{const s=Math.floor(e/2)-16,o=["white","green","blue","cyan","red","yellow","magenta"];i.foreground=o[s]}this.logger.log(2,"MIDROW: "+rn(i)),this.writeScreen.setPen(i)}outputDataUpdate(e=!1){const i=this.logger.time;i!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=i:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,i,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:i),this.lastOutputScreen.copy(this.displayedMemory))}cueSplitAtTime(e){this.outputFilter&&(this.displayedMemory.isEmpty()||(this.outputFilter.newCue&&this.outputFilter.newCue(this.cueStartTime,e,this.displayedMemory),this.cueStartTime=e))}}class $R{constructor(e,i,s){this.channels=void 0,this.currentChannel=0,this.cmdHistory=XM(),this.logger=void 0;const o=this.logger=new VM;this.channels=[null,new GR(e,i,o),new GR(e+1,s,o)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,i){this.channels[e].setHandler(i)}addData(e,i){this.logger.time=e;for(let s=0;s<i.length;s+=2){const o=i[s]&127,u=i[s+1]&127;let d=!1,g=null;if(o===0&&u===0)continue;this.logger.log(3,()=>"["+Rf([i[s],i[s+1]])+"] -> ("+Rf([o,u])+")");const S=this.cmdHistory;if(o>=16&&o<=31){if(KM(o,u,S)){kv(null,null,S),this.logger.log(3,()=>"Repeated command ("+Rf([o,u])+") is dropped");continue}kv(o,u,this.cmdHistory),d=this.parseCmd(o,u),d||(d=this.parseMidrow(o,u)),d||(d=this.parsePAC(o,u)),d||(d=this.parseBackgroundAttributes(o,u))}else kv(null,null,S);if(!d&&(g=this.parseChars(o,u),g)){const E=this.currentChannel;E&&E>0?this.channels[E].insertChars(g):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!d&&!g&&this.logger.log(2,()=>"Couldn't parse cleaned data "+Rf([o,u])+" orig: "+Rf([i[s],i[s+1]]))}}parseCmd(e,i){const s=(e===20||e===28||e===21||e===29)&&i>=32&&i<=47,o=(e===23||e===31)&&i>=33&&i<=35;if(!(s||o))return!1;const u=e===20||e===21||e===23?1:2,d=this.channels[u];return e===20||e===21||e===28||e===29?i===32?d.ccRCL():i===33?d.ccBS():i===34?d.ccAOF():i===35?d.ccAON():i===36?d.ccDER():i===37?d.ccRU(2):i===38?d.ccRU(3):i===39?d.ccRU(4):i===40?d.ccFON():i===41?d.ccRDC():i===42?d.ccTR():i===43?d.ccRTD():i===44?d.ccEDM():i===45?d.ccCR():i===46?d.ccENM():i===47&&d.ccEOC():d.ccTO(i-32),this.currentChannel=u,!0}parseMidrow(e,i){let s=0;if((e===17||e===25)&&i>=32&&i<=47){if(e===17?s=1:s=2,s!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const o=this.channels[s];return o?(o.ccMIDROW(i),this.logger.log(3,()=>"MIDROW ("+Rf([e,i])+")"),!0):!1}return!1}parsePAC(e,i){let s;const o=(e>=17&&e<=23||e>=25&&e<=31)&&i>=64&&i<=127,u=(e===16||e===24)&&i>=64&&i<=95;if(!(o||u))return!1;const d=e<=23?1:2;i>=64&&i<=95?s=d===1?PM[e]:$M[e]:s=d===1?GM[e]:HM[e];const g=this.channels[d];return g?(g.setPAC(this.interpretPAC(s,i)),this.currentChannel=d,!0):!1}interpretPAC(e,i){let s;const o={color:null,italics:!1,indent:null,underline:!1,row:e};return i>95?s=i-96:s=i-64,o.underline=(s&1)===1,s<=13?o.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(s/2)]:s<=15?(o.italics=!0,o.color="white"):o.indent=Math.floor((s-16)/2)*4,o}parseChars(e,i){let s,o=null,u=null;if(e>=25?(s=2,u=e-8):(s=1,u=e),u>=17&&u<=19){let d;u===17?d=i+80:u===18?d=i+112:d=i+144,this.logger.log(2,()=>"Special char '"+FR(d)+"' in channel "+s),o=[d]}else e>=32&&e<=127&&(o=i===0?[e]:[e,i]);return o&&this.logger.log(3,()=>"Char codes = "+Rf(o).join(",")),o}parseBackgroundAttributes(e,i){const s=(e===16||e===24)&&i>=32&&i<=47,o=(e===23||e===31)&&i>=45&&i<=47;if(!(s||o))return!1;let u;const d={};e===16||e===24?(u=Math.floor((i-32)/2),d.background=jM[u],i%2===1&&(d.background=d.background+"_semi")):i===45?d.background="transparent":(d.foreground="black",i===47&&(d.underline=!0));const g=e<=23?1:2;return this.channels[g].setBkgData(d),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const i=this.channels[e];i&&i.reset()}kv(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let i=0;i<this.channels.length;i++){const s=this.channels[i];s&&s.cueSplitAtTime(e)}}}function kv(h,e,i){i.a=h,i.b=e}function KM(h,e,i){return i.a===h&&i.b===e}function XM(){return{a:null,b:null}}var pb=function(){if(Sv!=null&&Sv.VTTCue)return self.VTTCue;const h=["","lr","rl"],e=["start","middle","end","left","right"];function i(g,S){if(typeof S!="string"||!Array.isArray(g))return!1;const v=S.toLowerCase();return~g.indexOf(v)?v:!1}function s(g){return i(h,g)}function o(g){return i(e,g)}function u(g,...S){let v=1;for(;v<arguments.length;v++){const E=arguments[v];for(const b in E)g[b]=E[b]}return g}function d(g,S,v){const E=this,b={enumerable:!0};E.hasBeenReset=!1;let R="",_=!1,D=g,I=S,M=v,w=null,B="",z=!0,G="auto",K="start",ae=50,q="middle",Z=50,te="middle";Object.defineProperty(E,"id",u({},b,{get:function(){return R},set:function($){R=""+$}})),Object.defineProperty(E,"pauseOnExit",u({},b,{get:function(){return _},set:function($){_=!!$}})),Object.defineProperty(E,"startTime",u({},b,{get:function(){return D},set:function($){if(typeof $!="number")throw new TypeError("Start time must be set to a number.");D=$,this.hasBeenReset=!0}})),Object.defineProperty(E,"endTime",u({},b,{get:function(){return I},set:function($){if(typeof $!="number")throw new TypeError("End time must be set to a number.");I=$,this.hasBeenReset=!0}})),Object.defineProperty(E,"text",u({},b,{get:function(){return M},set:function($){M=""+$,this.hasBeenReset=!0}})),Object.defineProperty(E,"region",u({},b,{get:function(){return w},set:function($){w=$,this.hasBeenReset=!0}})),Object.defineProperty(E,"vertical",u({},b,{get:function(){return B},set:function($){const me=s($);if(me===!1)throw new SyntaxError("An invalid or illegal string was specified.");B=me,this.hasBeenReset=!0}})),Object.defineProperty(E,"snapToLines",u({},b,{get:function(){return z},set:function($){z=!!$,this.hasBeenReset=!0}})),Object.defineProperty(E,"line",u({},b,{get:function(){return G},set:function($){if(typeof $!="number"&&$!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");G=$,this.hasBeenReset=!0}})),Object.defineProperty(E,"lineAlign",u({},b,{get:function(){return K},set:function($){const me=o($);if(!me)throw new SyntaxError("An invalid or illegal string was specified.");K=me,this.hasBeenReset=!0}})),Object.defineProperty(E,"position",u({},b,{get:function(){return ae},set:function($){if($<0||$>100)throw new Error("Position must be between 0 and 100.");ae=$,this.hasBeenReset=!0}})),Object.defineProperty(E,"positionAlign",u({},b,{get:function(){return q},set:function($){const me=o($);if(!me)throw new SyntaxError("An invalid or illegal string was specified.");q=me,this.hasBeenReset=!0}})),Object.defineProperty(E,"size",u({},b,{get:function(){return Z},set:function($){if($<0||$>100)throw new Error("Size must be between 0 and 100.");Z=$,this.hasBeenReset=!0}})),Object.defineProperty(E,"align",u({},b,{get:function(){return te},set:function($){const me=o($);if(!me)throw new SyntaxError("An invalid or illegal string was specified.");te=me,this.hasBeenReset=!0}})),E.displayState=void 0}return d.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},d}();class QM{decode(e,i){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function HR(h){function e(s,o,u,d){return(s|0)*3600+(o|0)*60+(u|0)+parseFloat(d||0)}const i=h.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return i?parseFloat(i[2])>59?e(i[2],i[3],0,i[4]):e(i[1],i[2],i[3],i[4]):null}let ZM=class{constructor(){this.values=Object.create(null)}set(e,i){!this.get(e)&&i!==""&&(this.values[e]=i)}get(e,i,s){return s?this.has(e)?this.values[e]:i[s]:this.has(e)?this.values[e]:i}has(e){return e in this.values}alt(e,i,s){for(let o=0;o<s.length;++o)if(i===s[o]){this.set(e,i);break}}integer(e,i){/^-?\d+$/.test(i)&&this.set(e,parseInt(i,10))}percent(e,i){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(i)){const s=parseFloat(i);if(s>=0&&s<=100)return this.set(e,s),!0}return!1}};function jR(h,e,i,s){const o=s?h.split(s):[h];for(const u in o){if(typeof o[u]!="string")continue;const d=o[u].split(i);if(d.length!==2)continue;const g=d[0],S=d[1];e(g,S)}}const yb=new pb(0,0,""),Bv=yb.align==="middle"?"middle":"center";function JM(h,e,i){const s=h;function o(){const g=HR(h);if(g===null)throw new Error("Malformed timestamp: "+s);return h=h.replace(/^[^\sa-zA-Z-]+/,""),g}function u(g,S){const v=new ZM;jR(g,function(R,_){let D;switch(R){case"region":for(let I=i.length-1;I>=0;I--)if(i[I].id===_){v.set(R,i[I].region);break}break;case"vertical":v.alt(R,_,["rl","lr"]);break;case"line":D=_.split(","),v.integer(R,D[0]),v.percent(R,D[0])&&v.set("snapToLines",!1),v.alt(R,D[0],["auto"]),D.length===2&&v.alt("lineAlign",D[1],["start",Bv,"end"]);break;case"position":D=_.split(","),v.percent(R,D[0]),D.length===2&&v.alt("positionAlign",D[1],["start",Bv,"end","line-left","line-right","auto"]);break;case"size":v.percent(R,_);break;case"align":v.alt(R,_,["start",Bv,"end","left","right"]);break}},/:/,/\s/),S.region=v.get("region",null),S.vertical=v.get("vertical","");let E=v.get("line","auto");E==="auto"&&yb.line===-1&&(E=-1),S.line=E,S.lineAlign=v.get("lineAlign","start"),S.snapToLines=v.get("snapToLines",!0),S.size=v.get("size",100),S.align=v.get("align",Bv);let b=v.get("position","auto");b==="auto"&&yb.position===50&&(b=S.align==="start"||S.align==="left"?0:S.align==="end"||S.align==="right"?100:50),S.position=b}function d(){h=h.replace(/^\s+/,"")}if(d(),e.startTime=o(),d(),h.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+s);h=h.slice(3),d(),e.endTime=o(),d(),u(h,e)}function VR(h){return h.replace(/<br(?: \/)?>/gi,`
307
+ `)}class WM{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new QM,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const i=this;e&&(i.buffer+=i.decoder.decode(e,{stream:!0}));function s(){let u=i.buffer,d=0;for(u=VR(u);d<u.length&&u[d]!=="\r"&&u[d]!==`
308
+ `;)++d;const g=u.slice(0,d);return u[d]==="\r"&&++d,u[d]===`
309
+ `&&++d,i.buffer=u.slice(d),g}function o(u){jR(u,function(d,g){},/:/)}try{let u="";if(i.state==="INITIAL"){if(!/\r\n|\n/.test(i.buffer))return this;u=s();const g=u.match(/^()?WEBVTT([ \t].*)?$/);if(!(g!=null&&g[0]))throw new Error("Malformed WebVTT signature.");i.state="HEADER"}let d=!1;for(;i.buffer;){if(!/\r\n|\n/.test(i.buffer))return this;switch(d?d=!1:u=s(),i.state){case"HEADER":/:/.test(u)?o(u):u||(i.state="ID");continue;case"NOTE":u||(i.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(u)){i.state="NOTE";break}if(!u)continue;if(i.cue=new pb(0,0,""),i.state="CUE",u.indexOf("-->")===-1){i.cue.id=u;continue}case"CUE":if(!i.cue){i.state="BADCUE";continue}try{JM(u,i.cue,i.regionList)}catch{i.cue=null,i.state="BADCUE";continue}i.state="CUETEXT";continue;case"CUETEXT":{const g=u.indexOf("-->")!==-1;if(!u||g&&(d=!0)){i.oncue&&i.cue&&i.oncue(i.cue),i.cue=null,i.state="ID";continue}if(i.cue===null)continue;i.cue.text&&(i.cue.text+=`
310
+ `),i.cue.text+=u}continue;case"BADCUE":u||(i.state="ID")}}}catch{i.state==="CUETEXT"&&i.cue&&i.oncue&&i.oncue(i.cue),i.cue=null,i.state=i.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
311
+
312
+ `,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(i){e.onparsingerror&&e.onparsingerror(i)}return e.onflush&&e.onflush(),this}}const eI=/\r\n|\n\r|\n|\r/g,vb=function(e,i,s=0){return e.slice(s,s+i.length)===i},tI=function(e){let i=parseInt(e.slice(-3));const s=parseInt(e.slice(-6,-4)),o=parseInt(e.slice(-9,-7)),u=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!Ue(i)||!Ue(s)||!Ue(o)||!Ue(u))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return i+=1e3*s,i+=60*1e3*o,i+=60*60*1e3*u,i};function Sb(h,e,i){return o0(h.toString())+o0(e.toString())+o0(i)}const nI=function(e,i,s){let o=e[i],u=e[o.prevCC];if(!u||!u.new&&o.new){e.ccOffset=e.presentationOffset=o.start,o.new=!1;return}for(;(d=u)!=null&&d.new;){var d;e.ccOffset+=o.start-u.start,o.new=!1,o=u,u=e[o.prevCC]}e.presentationOffset=s};function iI(h,e,i,s,o,u,d){const g=new WM,S=ds(new Uint8Array(h)).trim().replace(eI,`
313
+ `).split(`
314
+ `),v=[],E=e?dO(e.baseTime,e.timescale):0;let b="00:00.000",R=0,_=0,D,I=!0;g.oncue=function(M){const w=i[s];let B=i.ccOffset;const z=(R-E)/9e4;if(w!=null&&w.new&&(_!==void 0?B=i.ccOffset=w.start:nI(i,s,z)),z){if(!e){D=new Error("Missing initPTS for VTT MPEGTS");return}B=z-i.presentationOffset}const G=M.endTime-M.startTime,K=gs((M.startTime+B-_)*9e4,o*9e4)/9e4;M.startTime=Math.max(K,0),M.endTime=Math.max(K+G,0);const ae=M.text.trim();M.text=decodeURIComponent(encodeURIComponent(ae)),M.id||(M.id=Sb(M.startTime,M.endTime,ae)),M.endTime>0&&v.push(M)},g.onparsingerror=function(M){D=M},g.onflush=function(){if(D){d(D);return}u(v)},S.forEach(M=>{if(I)if(vb(M,"X-TIMESTAMP-MAP=")){I=!1,M.slice(16).split(",").forEach(w=>{vb(w,"LOCAL:")?b=w.slice(6):vb(w,"MPEGTS:")&&(R=parseInt(w.slice(7)))});try{_=tI(b)/1e3}catch(w){D=w}return}else M===""&&(I=!1);g.parse(M+`
315
+ `)}),g.flush()}const Eb="stpp.ttml.im1t",YR=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,qR=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,aI={left:"start",center:"center",right:"end",start:"start",end:"end"};function KR(h,e,i,s){const o=Et(new Uint8Array(h),["mdat"]);if(o.length===0){s(new Error("Could not parse IMSC1 mdat"));return}const u=o.map(g=>ds(g)),d=fO(e.baseTime,1,e.timescale);try{u.forEach(g=>i(sI(g,d)))}catch(g){s(g)}}function sI(h,e){const o=new DOMParser().parseFromString(h,"text/xml").getElementsByTagName("tt")[0];if(!o)throw new Error("Invalid ttml");const u={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},d=Object.keys(u).reduce((b,R)=>(b[R]=o.getAttribute(`ttp:${R}`)||u[R],b),{}),g=o.getAttribute("xml:space")!=="preserve",S=XR(Tb(o,"styling","style")),v=XR(Tb(o,"layout","region")),E=Tb(o,"body","[begin]");return[].map.call(E,b=>{const R=QR(b,g);if(!R||!b.hasAttribute("begin"))return null;const _=xb(b.getAttribute("begin"),d),D=xb(b.getAttribute("dur"),d);let I=xb(b.getAttribute("end"),d);if(_===null)throw ZR(b);if(I===null){if(D===null)throw ZR(b);I=_+D}const M=new pb(_-e,I-e,R);M.id=Sb(M.startTime,M.endTime,M.text);const w=v[b.getAttribute("region")],B=S[b.getAttribute("style")],z=lI(w,B,S),{textAlign:G}=z;if(G){const K=aI[G];K&&(M.lineAlign=K),M.align=G}return Jt(M,z),M}).filter(b=>b!==null)}function Tb(h,e,i){const s=h.getElementsByTagName(e)[0];return s?[].slice.call(s.querySelectorAll(i)):[]}function XR(h){return h.reduce((e,i)=>{const s=i.getAttribute("xml:id");return s&&(e[s]=i),e},{})}function QR(h,e){return[].slice.call(h.childNodes).reduce((i,s,o)=>{var u;return s.nodeName==="br"&&o?i+`
316
+ `:(u=s.childNodes)!=null&&u.length?QR(s,e):e?i+s.textContent.trim().replace(/\s+/g," "):i+s.textContent},"")}function lI(h,e,i){const s="http://www.w3.org/ns/ttml#styling";let o=null;const u=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],d=h!=null&&h.hasAttribute("style")?h.getAttribute("style"):null;return d&&i.hasOwnProperty(d)&&(o=i[d]),u.reduce((g,S)=>{const v=bb(e,s,S)||bb(h,s,S)||bb(o,s,S);return v&&(g[S]=v),g},{})}function bb(h,e,i){return h&&h.hasAttributeNS(e,i)?h.getAttributeNS(e,i):null}function ZR(h){return new Error(`Could not parse ttml timestamp ${h}`)}function xb(h,e){if(!h)return null;let i=HR(h);return i===null&&(YR.test(h)?i=rI(h,e):qR.test(h)&&(i=oI(h,e))),i}function rI(h,e){const i=YR.exec(h),s=(i[4]|0)+(i[5]|0)/e.subFrameRate;return(i[1]|0)*3600+(i[2]|0)*60+(i[3]|0)+s/e.frameRate}function oI(h,e){const i=qR.exec(h),s=Number(i[1]);switch(i[2]){case"h":return s*3600;case"m":return s*60;case"ms":return s*1e3;case"f":return s/e.frameRate;case"t":return s/e.tickRate}return s}class zv{constructor(e,i){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=i}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,i,s){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=i,this.screen=s,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class uI{constructor(e){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.unparsedVttFrags=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.cea608Parser1=void 0,this.cea608Parser2=void 0,this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=eD(),this.captionsProperties=void 0,this.hls=e,this.config=e.config,this.Cues=e.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}},e.on(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(O.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(O.FRAG_LOADING,this.onFragLoading,this),e.on(O.FRAG_LOADED,this.onFragLoaded,this),e.on(O.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(O.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(O.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(O.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(O.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(O.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(O.FRAG_LOADING,this.onFragLoading,this),e.off(O.FRAG_LOADED,this.onFragLoaded,this),e.off(O.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(O.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(O.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(O.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(O.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new zv(this,"textTrack1"),i=new zv(this,"textTrack2"),s=new zv(this,"textTrack3"),o=new zv(this,"textTrack4");this.cea608Parser1=new $R(1,e,i),this.cea608Parser2=new $R(3,s,o)}addCues(e,i,s,o,u){let d=!1;for(let g=u.length;g--;){const S=u[g],v=cI(S[0],S[1],i,s);if(v>=0&&(S[0]=Math.min(S[0],i),S[1]=Math.max(S[1],s),d=!0,v/(s-i)>.5))return}if(d||u.push([i,s]),this.config.renderTextTracksNatively){const g=this.captionsTracks[e];this.Cues.newCue(g,i,s,o)}else{const g=this.Cues.newCue(null,i,s,o);this.hls.trigger(O.CUES_PARSED,{type:"captions",cues:g,track:e})}}onInitPtsFound(e,{frag:i,id:s,initPTS:o,timescale:u,trackId:d}){const{unparsedVttFrags:g}=this;s===Be.MAIN&&(this.initPTS[i.cc]={baseTime:o,timescale:u,trackId:d}),g.length&&(this.unparsedVttFrags=[],g.forEach(S=>{this.initPTS[S.frag.cc]?this.onFragLoaded(O.FRAG_LOADED,S):this.hls.trigger(O.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:S.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,i){const{media:s}=this;if(s)for(let o=0;o<s.textTracks.length;o++){const u=s.textTracks[o];if(WR(u,{name:e,lang:i,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return u}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:i,captionsTracks:s,media:o}=this,{label:u,languageCode:d}=i[e],g=this.getExistingTrack(u,d);if(g)s[e]=g,Ah(s[e]),wR(s[e],o);else{const S=this.createTextTrack("captions",u,d);S&&(S[e]=!0,s[e]=S)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const i=this.captionsProperties[e];if(!i)return;const s=i.label,o={_id:e,label:s,kind:"captions",default:i.media?!!i.media.default:!1,closedCaptions:i.media};this.nonNativeCaptionsTracks[e]=o,this.hls.trigger(O.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[o]})}createTextTrack(e,i,s){const o=this.media;if(o)return o.addTextTrack(e,i,s)}onMediaAttaching(e,i){this.media=i.media,i.mediaSource||this._cleanTracks()}onMediaDetaching(e,i){const s=!!i.transferMedia;if(this.media=null,s)return;const{captionsTracks:o}=this;Object.keys(o).forEach(u=>{Ah(o[u]),delete o[u]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=eD(),this._cleanTracks(),this.tracks=[],this.captionsTracks={},this.nonNativeCaptionsTracks={},this.textTracks=[],this.unparsedVttFrags=[],this.initPTS=[],this.cea608Parser1&&this.cea608Parser2&&(this.cea608Parser1.reset(),this.cea608Parser2.reset())}_cleanTracks(){const{media:e}=this;if(!e)return;const i=e.textTracks;if(i)for(let s=0;s<i.length;s++)Ah(i[s])}onSubtitleTracksUpdated(e,i){const s=i.subtitleTracks||[],o=s.some(u=>u.textCodec===Eb);if(this.config.enableWebVTT||o&&this.config.enableIMSC1){if(hR(this.tracks,s)){this.tracks=s;return}if(this.textTracks=[],this.tracks=s,this.config.renderTextTracksNatively){const d=this.media,g=d?wv(d.textTracks):null;if(this.tracks.forEach((S,v)=>{let E;if(g){let b=null;for(let R=0;R<g.length;R++)if(g[R]&&WR(g[R],S)){b=g[R],g[R]=null;break}b&&(E=b)}if(E)Ah(E);else{const b=JR(S);E=this.createTextTrack(b,S.name,S.lang),E&&(E.mode="disabled")}E&&this.textTracks.push(E)}),g!=null&&g.length){const S=g.filter(v=>v!==null).map(v=>v.label);S.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${S.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const d=this.tracks.map(g=>({label:g.name,kind:g.type.toLowerCase(),default:g.default,subtitleTrack:g}));this.hls.trigger(O.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:d})}}}onManifestLoaded(e,i){this.config.enableCEA708Captions&&i.captions&&i.captions.forEach(s=>{const o=/(?:CC|SERVICE)([1-4])/.exec(s.instreamId);if(!o)return;const u=`textTrack${o[1]}`,d=this.captionsProperties[u];d&&(d.label=s.name,s.lang&&(d.languageCode=s.lang),d.media=s)})}closedCaptionsForLevel(e){const i=this.hls.levels[e.level];return i==null?void 0:i.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,i){if(this.enabled&&i.frag.type===Be.MAIN){var s,o;const{cea608Parser1:u,cea608Parser2:d,lastSn:g}=this,{cc:S,sn:v}=i.frag,E=(s=(o=i.part)==null?void 0:o.index)!=null?s:-1;u&&d&&(v!==g+1||v===g&&E!==this.lastPartIndex+1||S!==this.lastCc)&&(u.reset(),d.reset()),this.lastCc=S,this.lastSn=v,this.lastPartIndex=E}}onFragLoaded(e,i){const{frag:s,payload:o}=i;if(s.type===Be.SUBTITLE)if(o.byteLength){const u=s.decryptdata,d="stats"in i;if(u==null||!u.encrypted||d){const g=this.tracks[s.level],S=this.vttCCs;S[s.cc]||(S[s.cc]={start:s.start,prevCC:this.prevCC,new:!0},this.prevCC=s.cc),g&&g.textCodec===Eb?this._parseIMSC1(s,o):this._parseVTTs(i)}}else this.hls.trigger(O.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,i){const s=this.hls;KR(i,this.initPTS[e.cc],o=>{this._appendCues(o,e.level),s.trigger(O.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},o=>{s.logger.log(`Failed to parse IMSC1: ${o}`),s.trigger(O.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:o})})}_parseVTTs(e){var i;const{frag:s,payload:o}=e,{initPTS:u,unparsedVttFrags:d}=this,g=u.length-1;if(!u[s.cc]&&g===-1){d.push(e);return}const S=this.hls,v=(i=s.initSegment)!=null&&i.data?Qs(s.initSegment.data,new Uint8Array(o)).buffer:o;iI(v,this.initPTS[s.cc],this.vttCCs,s.cc,s.start,E=>{this._appendCues(E,s.level),S.trigger(O.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:s})},E=>{const b=E.message==="Missing initPTS for VTT MPEGTS";b?d.push(e):this._fallbackToIMSC1(s,o),S.logger.log(`Failed to parse VTT cue: ${E}`),!(b&&g>s.cc)&&S.trigger(O.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:s,error:E})})}_fallbackToIMSC1(e,i){const s=this.tracks[e.level];s.textCodec||KR(i,this.initPTS[e.cc],()=>{s.textCodec=Eb,this._parseIMSC1(e,i)},()=>{s.textCodec="wvtt"})}_appendCues(e,i){const s=this.hls;if(this.config.renderTextTracksNatively){const o=this.textTracks[i];if(!o||o.mode==="disabled")return;e.forEach(u=>NR(o,u))}else{const o=this.tracks[i];if(!o)return;const u=o.default?"default":"subtitles"+i;s.trigger(O.CUES_PARSED,{type:"subtitles",cues:e,track:u})}}onFragDecrypted(e,i){const{frag:s}=i;s.type===Be.SUBTITLE&&this.onFragLoaded(O.FRAG_LOADED,i)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,i){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:s,samples:o}=i;if(!(s.type===Be.MAIN&&this.closedCaptionsForLevel(s)==="NONE"))for(let u=0;u<o.length;u++){const d=o[u].bytes;if(d){this.cea608Parser1||this.initCea608Parsers();const g=this.extractCea608Data(d);this.cea608Parser1.addData(o[u].pts,g[0]),this.cea608Parser2.addData(o[u].pts,g[1])}}}onBufferFlushing(e,{startOffset:i,endOffset:s,endOffsetSubtitles:o,type:u}){const{media:d}=this;if(!(!d||d.currentTime<s)){if(!u||u==="video"){const{captionsTracks:g}=this;Object.keys(g).forEach(S=>db(g[S],i,s))}if(this.config.renderTextTracksNatively&&i===0&&o!==void 0){const{textTracks:g}=this;Object.keys(g).forEach(S=>db(g[S],i,o))}}}extractCea608Data(e){const i=[[],[]],s=e[0]&31;let o=2;for(let u=0;u<s;u++){const d=e[o++],g=127&e[o++],S=127&e[o++];if(g===0&&S===0)continue;if((4&d)!==0){const E=3&d;(E===0||E===1)&&(i[E].push(g),i[E].push(S))}}return i}}function JR(h){return h.characteristics&&/transcribes-spoken-dialog/gi.test(h.characteristics)&&/describes-music-and-sound/gi.test(h.characteristics)?"captions":"subtitles"}function WR(h,e){return!!h&&h.kind===JR(e)&&ab(e,h)}function cI(h,e,i,s){return Math.min(e,s)-Math.max(h,i)}function eD(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const fI=/\s/,dI={newCue(h,e,i,s){const o=[];let u,d,g,S,v;const E=self.VTTCue||self.TextTrackCue;for(let R=0;R<s.rows.length;R++)if(u=s.rows[R],g=!0,S=0,v="",!u.isEmpty()){var b;for(let I=0;I<u.chars.length;I++)fI.test(u.chars[I].uchar)&&g?S++:(v+=u.chars[I].uchar,g=!1);u.cueStartTime=e,e===i&&(i+=1e-4),S>=16?S--:S++;const _=VR(v.trim()),D=Sb(e,i,_);h!=null&&(b=h.cues)!=null&&b.getCueById(D)||(d=new E(e,i,_),d.id=D,d.line=R+1,d.align="left",d.position=10+Math.min(80,Math.floor(S*8/32)*10),o.push(d))}return h&&o.length&&(o.sort((R,_)=>R.line==="auto"||_.line==="auto"?0:R.line>8&&_.line>8?_.line-R.line:R.line-_.line),o.forEach(R=>NR(h,R))),o}};function hI(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const mI=/(\d+)-(\d+)\/(\d+)/;class tD{constructor(e){this.fetchSetup=void 0,this.requestTimeout=void 0,this.request=null,this.response=null,this.controller=void 0,this.context=null,this.config=null,this.callbacks=null,this.stats=void 0,this.loader=null,this.fetchSetup=e.fetchSetup||vI,this.controller=new self.AbortController,this.stats=new ET}destroy(){this.loader=this.callbacks=this.context=this.config=this.request=null,this.abortInternal(),this.response=null,this.fetchSetup=this.controller=this.stats=null}abortInternal(){this.controller&&!this.stats.loading.end&&(this.stats.aborted=!0,this.controller.abort())}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.response)}load(e,i,s){const o=this.stats;if(o.loading.start)throw new Error("Loader can only be used once.");o.loading.start=self.performance.now();const u=gI(e,this.controller.signal),d=e.responseType==="arraybuffer",g=d?"byteLength":"length",{maxTimeToFirstByteMs:S,maxLoadTimeMs:v}=i.loadPolicy;this.context=e,this.config=i,this.callbacks=s,this.request=this.fetchSetup(e,u),self.clearTimeout(this.requestTimeout),i.timeout=S&&Ue(S)?S:v,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,e,this.response))},i.timeout),(l0(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(b=>{var R;this.response=this.loader=b;const _=Math.max(self.performance.now(),o.loading.start);if(self.clearTimeout(this.requestTimeout),i.timeout=v,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(o,e,this.response))},v-(_-o.loading.start)),!b.ok){const{status:I,statusText:M}=b;throw new SI(M||"fetch, bad network response",I,b)}o.loading.first=_,o.total=yI(b.headers)||o.total;const D=(R=this.callbacks)==null?void 0:R.onProgress;return D&&Ue(i.highWaterMark)?this.loadProgressively(b,o,e,i.highWaterMark,D):d?b.arrayBuffer():e.responseType==="json"?b.json():b.text()}).then(b=>{var R,_;const D=this.response;if(!D)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),o.loading.end=Math.max(self.performance.now(),o.loading.first);const I=b[g];I&&(o.loaded=o.total=I);const M={url:D.url,data:b,code:D.status},w=(R=this.callbacks)==null?void 0:R.onProgress;w&&!Ue(i.highWaterMark)&&w(o,e,b,D),(_=this.callbacks)==null||_.onSuccess(M,o,e,D)}).catch(b=>{var R;if(self.clearTimeout(this.requestTimeout),o.aborted)return;const _=b&&b.code||0,D=b?b.message:null;(R=this.callbacks)==null||R.onError({code:_,text:D},e,b?b.details:null,o)})}getCacheAge(){let e=null;if(this.response){const i=this.response.headers.get("age");e=i?parseFloat(i):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,i,s,o=0,u){const d=new FA,g=e.body.getReader(),S=()=>g.read().then(v=>{if(v.done)return d.dataLength&&u(i,s,d.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const E=v.value,b=E.length;return i.loaded+=b,b<o||d.dataLength?(d.push(E),d.dataLength>=o&&u(i,s,d.flush().buffer,e)):u(i,s,E.buffer,e),S()}).catch(()=>Promise.reject());return S()}}function gI(h,e){const i={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(Jt({},h.headers))};return h.rangeEnd&&i.headers.set("Range","bytes="+h.rangeStart+"-"+String(h.rangeEnd-1)),i}function pI(h){const e=mI.exec(h);if(e)return parseInt(e[2])-parseInt(e[1])+1}function yI(h){const e=h.get("Content-Range");if(e){const s=pI(e);if(Ue(s))return s}const i=h.get("Content-Length");if(i)return parseInt(i)}function vI(h,e){return new self.Request(h.url,e)}class SI extends Error{constructor(e,i,s){super(e),this.code=void 0,this.details=void 0,this.code=i,this.details=s}}const EI=/^age:\s*[\d.]+\s*$/im;class nD{constructor(e){this.xhrSetup=void 0,this.requestTimeout=void 0,this.retryTimeout=void 0,this.retryDelay=void 0,this.config=null,this.callbacks=null,this.context=null,this.loader=null,this.stats=void 0,this.xhrSetup=e&&e.xhrSetup||null,this.stats=new ET,this.retryDelay=0}destroy(){this.callbacks=null,this.abortInternal(),this.loader=null,this.config=null,this.context=null,this.xhrSetup=null}abortInternal(){const e=this.loader;self.clearTimeout(this.requestTimeout),self.clearTimeout(this.retryTimeout),e&&(e.onreadystatechange=null,e.onprogress=null,e.readyState!==4&&(this.stats.aborted=!0,e.abort()))}abort(){var e;this.abortInternal(),(e=this.callbacks)!=null&&e.onAbort&&this.callbacks.onAbort(this.stats,this.context,this.loader)}load(e,i,s){if(this.stats.loading.start)throw new Error("Loader can only be used once.");this.stats.loading.start=self.performance.now(),this.context=e,this.config=i,this.callbacks=s,this.loadInternal()}loadInternal(){const{config:e,context:i}=this;if(!e||!i)return;const s=this.loader=new self.XMLHttpRequest,o=this.stats;o.loading.first=0,o.loaded=0,o.aborted=!1;const u=this.xhrSetup;u?Promise.resolve().then(()=>{if(!(this.loader!==s||this.stats.aborted))return u(s,i.url)}).catch(d=>{if(!(this.loader!==s||this.stats.aborted))return s.open("GET",i.url,!0),u(s,i.url)}).then(()=>{this.loader!==s||this.stats.aborted||this.openAndSendXhr(s,i,e)}).catch(d=>{var g;(g=this.callbacks)==null||g.onError({code:s.status,text:d.message},i,s,o)}):this.openAndSendXhr(s,i,e)}openAndSendXhr(e,i,s){e.readyState||e.open("GET",i.url,!0);const o=i.headers,{maxTimeToFirstByteMs:u,maxLoadTimeMs:d}=s.loadPolicy;if(o)for(const g in o)e.setRequestHeader(g,o[g]);i.rangeEnd&&e.setRequestHeader("Range","bytes="+i.rangeStart+"-"+(i.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=i.responseType,self.clearTimeout(this.requestTimeout),s.timeout=u&&Ue(u)?u:d,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),s.timeout),e.send()}readystatechange(){const{context:e,loader:i,stats:s}=this;if(!e||!i)return;const o=i.readyState,u=this.config;if(!s.aborted&&o>=2&&(s.loading.first===0&&(s.loading.first=Math.max(self.performance.now(),s.loading.start),u.timeout!==u.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),u.timeout=u.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),u.loadPolicy.maxLoadTimeMs-(s.loading.first-s.loading.start)))),o===4)){self.clearTimeout(this.requestTimeout),i.onreadystatechange=null,i.onprogress=null;const v=i.status,E=i.responseType==="text"?i.responseText:null;if(v>=200&&v<300){const D=E??i.response;if(D!=null){var d,g;s.loading.end=Math.max(self.performance.now(),s.loading.first);const I=i.responseType==="arraybuffer"?D.byteLength:D.length;s.loaded=s.total=I,s.bwEstimate=s.total*8e3/(s.loading.end-s.loading.first);const M=(d=this.callbacks)==null?void 0:d.onProgress;M&&M(s,e,D,i);const w={url:i.responseURL,data:D,code:v};(g=this.callbacks)==null||g.onSuccess(w,s,e,i);return}}const b=u.loadPolicy.errorRetry,R=s.retry,_={url:e.url,data:void 0,code:v};if(gv(b,R,!1,_))this.retry(b);else{var S;Zt.error(`${v} while loading ${e.url}`),(S=this.callbacks)==null||S.onError({code:v,text:i.statusText},e,i,s)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,i=this.stats.retry;if(gv(e,i,!0))this.retry(e);else{var s;Zt.warn(`timeout while loading ${(s=this.context)==null?void 0:s.url}`);const o=this.callbacks;o&&(this.abortInternal(),o.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:i,stats:s}=this;this.retryDelay=CT(e,s.retry),s.retry++,Zt.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${i==null?void 0:i.url}, retrying ${s.retry}/${e.maxNumRetry} in ${this.retryDelay}ms`),this.abortInternal(),this.loader=null,self.clearTimeout(this.retryTimeout),this.retryTimeout=self.setTimeout(this.loadInternal.bind(this),this.retryDelay)}loadprogress(e){const i=this.stats;i.loaded=e.loaded,e.lengthComputable&&(i.total=e.total)}getCacheAge(){let e=null;if(this.loader&&EI.test(this.loader.getAllResponseHeaders())){const i=this.loader.getResponseHeader("age");e=i?parseFloat(i):null}return e}getResponseHeader(e){return this.loader&&new RegExp(`^${e}:\\s*[\\d.]+\\s*$`,"im").test(this.loader.getAllResponseHeaders())?this.loader.getResponseHeader(e):null}}const TI={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},bI=Qt(Qt({autoStartLoad:!0,startPosition:-1,defaultAudioCodec:void 0,debug:!1,capLevelOnFPSDrop:!1,capLevelToPlayerSize:!1,ignoreDevicePixelRatio:!1,maxDevicePixelRatio:Number.POSITIVE_INFINITY,preferManagedMediaSource:!0,initialLiveManifestSize:1,maxBufferLength:30,backBufferLength:1/0,frontBufferFlushThreshold:1/0,startOnSegmentBoundary:!1,maxBufferSize:60*1e3*1e3,maxFragLookUpTolerance:.25,maxBufferHole:.1,detectStallWithCurrentTimeMs:1250,highBufferWatchdogPeriod:2,nudgeOffset:.1,nudgeMaxRetry:3,nudgeOnVideoHole:!0,liveSyncMode:"edge",liveSyncDurationCount:3,liveSyncOnStallIncrease:1,liveMaxLatencyDurationCount:1/0,liveSyncDuration:void 0,liveMaxLatencyDuration:void 0,maxLiveSyncPlaybackRate:1,liveDurationInfinity:!1,liveBackBufferLength:null,maxMaxBufferLength:600,enableWorker:!0,workerPath:null,enableSoftwareAES:!0,startLevel:void 0,startFragPrefetch:!1,fpsDroppedMonitoringPeriod:5e3,fpsDroppedMonitoringThreshold:.2,appendErrorMaxRetry:3,ignorePlaylistParsingErrors:!1,loader:nD,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:BC,bufferController:LO,capLevelController:lb,errorController:$C,fpsController:RM,stretchShortVideoTrack:!1,maxAudioFramesDrift:1,forceKeyFrameOnDiscontinuity:!0,abrEwmaFastLive:3,abrEwmaSlowLive:9,abrEwmaFastVoD:3,abrEwmaSlowVoD:9,abrEwmaDefaultEstimate:5e5,abrEwmaDefaultEstimateMax:5e6,abrBandWidthFactor:.95,abrBandWidthUpFactor:.7,abrMaxWithRealBitrate:!1,maxStarvationDelay:4,maxLoadingDelay:4,minAutoBitrate:0,emeEnabled:!1,widevineLicenseUrl:void 0,drmSystems:{},drmSystemOptions:{},requestMediaKeySystemAccessFunc:hA,requireKeySystemAccessOnStart:!1,testBandwidth:!0,progressive:!1,lowLatencyMode:!0,cmcd:void 0,enableDateRangeMetadataCues:!0,enableEmsgMetadataCues:!0,enableEmsgKLVMetadata:!1,enableID3MetadataCues:!0,enableInterstitialPlayback:!0,interstitialAppendInPlace:!0,interstitialLiveLookAhead:10,useMediaCapabilities:!0,preserveManualLevelOnError:!1,certLoadPolicy:{default:TI},keyLoadPolicy:{default:{maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"},errorRetry:{maxNumRetry:8,retryDelayMs:1e3,maxRetryDelayMs:2e4,backoff:"linear"}}},manifestLoadPolicy:{default:{maxTimeToFirstByteMs:1/0,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},playlistLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:2,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},fragLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:12e4,timeoutRetry:{maxNumRetry:4,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:6,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},steeringManifestLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:2e4,timeoutRetry:{maxNumRetry:2,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:1,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},interstitialAssetListLoadPolicy:{default:{maxTimeToFirstByteMs:1e4,maxLoadTimeMs:3e4,timeoutRetry:{maxNumRetry:0,retryDelayMs:0,maxRetryDelayMs:0},errorRetry:{maxNumRetry:0,retryDelayMs:1e3,maxRetryDelayMs:8e3}}},manifestLoadingTimeOut:1e4,manifestLoadingMaxRetry:1,manifestLoadingRetryDelay:1e3,manifestLoadingMaxRetryTimeout:64e3,levelLoadingTimeOut:1e4,levelLoadingMaxRetry:4,levelLoadingRetryDelay:1e3,levelLoadingMaxRetryTimeout:64e3,fragLoadingTimeOut:2e4,fragLoadingMaxRetry:6,fragLoadingRetryDelay:1e3,fragLoadingMaxRetryTimeout:64e3},xI()),{},{subtitleStreamController:BM,subtitleTrackController:_M,timelineController:uI,audioStreamController:xO,audioTrackController:AO,emeController:xh,cmcdController:TM,contentSteeringController:xM,interstitialsController:kM});function xI(){return{cueHandler:dI,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 AI(h,e,i){if((e.liveSyncDurationCount||e.liveMaxLatencyDurationCount)&&(e.liveSyncDuration||e.liveMaxLatencyDuration))throw new Error("Illegal hls.js config: don't mix up liveSyncDurationCount/liveMaxLatencyDurationCount and liveSyncDuration/liveMaxLatencyDuration");if(e.liveMaxLatencyDurationCount!==void 0&&(e.liveSyncDurationCount===void 0||e.liveMaxLatencyDurationCount<=e.liveSyncDurationCount))throw new Error('Illegal hls.js config: "liveMaxLatencyDurationCount" must be greater than "liveSyncDurationCount"');if(e.liveMaxLatencyDuration!==void 0&&(e.liveSyncDuration===void 0||e.liveMaxLatencyDuration<=e.liveSyncDuration))throw new Error('Illegal hls.js config: "liveMaxLatencyDuration" must be greater than "liveSyncDuration"');const s=Ab(h),o=["manifest","level","frag"],u=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];return o.forEach(d=>{const g=`${d==="level"?"playlist":d}LoadPolicy`,S=e[g]===void 0,v=[];u.forEach(E=>{const b=`${d}Loading${E}`,R=e[b];if(R!==void 0&&S){v.push(b);const _=s[g].default;switch(e[g]={default:_},E){case"TimeOut":_.maxLoadTimeMs=R,_.maxTimeToFirstByteMs=R;break;case"MaxRetry":_.errorRetry.maxNumRetry=R,_.timeoutRetry.maxNumRetry=R;break;case"RetryDelay":_.errorRetry.retryDelayMs=R,_.timeoutRetry.retryDelayMs=R;break;case"MaxRetryTimeout":_.errorRetry.maxRetryDelayMs=R,_.timeoutRetry.maxRetryDelayMs=R;break}}}),v.length&&i.warn(`hls.js config: "${v.join('", "')}" setting(s) are deprecated, use "${g}": ${rn(e[g])}`)}),Qt(Qt({},s),e)}function Ab(h){return h&&typeof h=="object"?Array.isArray(h)?h.map(Ab):Object.keys(h).reduce((e,i)=>(e[i]=Ab(h[i]),e),{}):h}function RI(h,e){const i=h.loader;i!==tD&&i!==nD?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),h.progressive=!1):hI()&&(h.loader=tD,h.progressive=!0,h.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const Fv=2,DI=.1,LI=.05,_I=100;class CI extends iA{constructor(e,i){super("gap-controller",e.logger),this.hls=void 0,this.fragmentTracker=void 0,this.media=null,this.mediaSource=void 0,this.nudgeRetry=0,this.stallReported=!1,this.stalled=null,this.moved=!1,this.seeking=!1,this.buffered={},this.lastCurrentTime=0,this.ended=0,this.waiting=0,this.onMediaPlaying=()=>{this.ended=0,this.waiting=0},this.onMediaWaiting=()=>{var s;(s=this.media)!=null&&s.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var s;this.ended=((s=this.media)==null?void 0:s.currentTime)||1,this.hls.trigger(O.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=i,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,i){this.setInterval(_I),this.mediaSource=i.mediaSource;const s=this.media=i.media;pa(s,"playing",this.onMediaPlaying),pa(s,"waiting",this.onMediaWaiting),pa(s,"ended",this.onMediaEnded)}onMediaDetaching(e,i){this.clearInterval();const{media:s}=this;s&&($a(s,"playing",this.onMediaPlaying),$a(s,"waiting",this.onMediaWaiting),$a(s,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,i){this.buffered=i.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const i=this.media.currentTime;this.poll(i,this.lastCurrentTime),this.lastCurrentTime=i}poll(e,i){var s,o;const u=(s=this.hls)==null?void 0:s.config;if(!u)return;const d=this.media;if(!d)return;const{seeking:g}=d,S=this.seeking&&!g,v=!this.seeking&&g,E=d.paused&&!g||d.ended||d.playbackRate===0;if(this.seeking=g,e!==i){i&&(this.ended=0),this.moved=!0,g||(this.nudgeRetry=0,u.nudgeOnVideoHole&&!E&&e>i&&this.nudgeOnVideoHole(e,i)),this.waiting===0&&this.stallResolved(e);return}if(v||S){S&&this.stallResolved(e);return}if(E){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&d.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(O.MEDIA_ENDED,{stalled:!1}));return}if(!lt.getBuffered(d).length){this.nudgeRetry=0;return}const b=lt.bufferInfo(d,e,0),R=b.nextStart||0,_=this.fragmentTracker;if(g&&_&&this.hls){const ae=iD(this.hls.inFlightFragments,e),q=b.len>Fv,Z=!R||ae||R-e>Fv&&!_.getPartialFragment(e);if(q||Z)return;this.moved=!1}const D=(o=this.hls)==null?void 0:o.latestLevelDetails;if(!this.moved&&this.stalled!==null&&_){if(!(b.len>0)&&!R)return;const q=Math.max(R,b.start||0)-e,te=!!(D!=null&&D.live)?D.targetduration*2:Fv,$=Pv(e,_);if(q>0&&(q<=te||$)){d.paused||this._trySkipBufferHole($);return}}const I=u.detectStallWithCurrentTimeMs,M=self.performance.now(),w=this.waiting;let B=this.stalled;if(B===null)if(w>0&&M-w<I)B=this.stalled=w;else{this.stalled=M;return}const z=M-B;if(!g&&(z>=I||w)&&this.hls){var G;if(((G=this.mediaSource)==null?void 0:G.readyState)==="ended"&&!(D!=null&&D.live)&&Math.abs(e-((D==null?void 0:D.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(O.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(b),!this.media||!this.hls)return}const K=lt.bufferInfo(d,e,u.maxBufferHole);this._tryFixBufferStall(K,z,e)}stallResolved(e){const i=this.stalled;if(i&&this.hls&&(this.stalled=null,this.stallReported)){const s=self.performance.now()-i;this.log(`playback not stuck anymore @${e}, after ${Math.round(s)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(O.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,i){var s;const o=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(s=this.buffered.audio)!=null&&s.length&&o&&o.length>1&&e>o.end(0)){const u=lt.bufferedInfo(lt.timeRangesToArray(this.buffered.audio),e,0);if(u.len>1&&i>=u.start){const d=lt.timeRangesToArray(o),g=lt.bufferedInfo(d,i,0).bufferedIndex;if(g>-1&&g<d.length-1){const S=lt.bufferedInfo(d,e,0).bufferedIndex,v=d[g].end,E=d[g+1].start;if((S===-1||S>g)&&E-v<1&&e-v<2){const b=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${v} -> ${E} buffered index: ${S}`);this.warn(b.message),this.media.currentTime+=1e-6;let R=Pv(e,this.fragmentTracker);R&&"fragment"in R?R=R.fragment:R||(R=void 0);const _=lt.bufferInfo(this.media,e,0);this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:b,reason:b.message,frag:R,buffer:_.len,bufferInfo:_})}}}}}_tryFixBufferStall(e,i,s){var o,u;const{fragmentTracker:d,media:g}=this,S=(o=this.hls)==null?void 0:o.config;if(!g||!d||!S)return;const v=(u=this.hls)==null?void 0:u.latestLevelDetails,E=Pv(s,d);if((E||v!=null&&v.live&&s<v.fragmentStart)&&(this._trySkipBufferHole(E)||!this.media))return;const b=e.buffered,R=this.adjacentTraversal(e,s);(b&&b.length>1&&e.len>S.maxBufferHole||e.nextStart&&(e.nextStart-s<S.maxBufferHole||R))&&(i>S.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,i){const s=this.fragmentTracker,o=e.nextStart;if(s&&o){const u=s.getFragAtPos(i,Be.MAIN),d=s.getFragAtPos(o,Be.MAIN);if(u&&d)return d.sn-u.sn<2}return!1}_reportStall(e){const{hls:i,media:s,stallReported:o,stalled:u}=this;if(!o&&u!==null&&s&&i){this.stallReported=!0;const d=new Error(`Playback stalling at @${s.currentTime} due to low buffer (${rn(e)})`);this.warn(d.message),i.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_STALLED_ERROR,fatal:!1,error:d,buffer:e.len,bufferInfo:e,stalled:{start:u}})}}_trySkipBufferHole(e){var i;const{fragmentTracker:s,media:o}=this,u=(i=this.hls)==null?void 0:i.config;if(!o||!s||!u)return 0;const d=o.currentTime,g=lt.bufferInfo(o,d,0),S=d<g.start?g.start:g.nextStart;if(S&&this.hls){const E=g.len<=u.maxBufferHole,b=g.len>0&&g.len<1&&o.readyState<3,R=S-d;if(R>0&&(E||b)){if(R>u.maxBufferHole){let D=!1;if(d===0){const I=s.getAppendedFrag(0,Be.MAIN);I&&S<I.end&&(D=!0)}if(!D&&e){var v;if(!((v=this.hls.loadLevelObj)!=null&&v.details)||iD(this.hls.inFlightFragments,S))return 0;let M=!1,w=e.end;for(;w<S;){const B=Pv(w,s);if(B)w+=B.duration;else{M=!0;break}}if(M)return 0}}const _=Math.max(S+LI,d+DI);if(this.warn(`skipping hole, adjusting currentTime from ${d} to ${_}`),this.moved=!0,o.currentTime=_,!(e!=null&&e.gap)){const D=new Error(`fragment loaded with buffer holes, seeking from ${d} to ${_}`),I={type:je.MEDIA_ERROR,details:re.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:D,reason:D.message,buffer:g.len,bufferInfo:g};e&&("fragment"in e?I.part=e:I.frag=e),this.hls.trigger(O.ERROR,I)}return _}}return 0}_tryNudgeBuffer(e){const{hls:i,media:s,nudgeRetry:o}=this,u=i==null?void 0:i.config;if(!s||!u)return 0;const d=s.currentTime;if(this.nudgeRetry++,o<u.nudgeMaxRetry){const g=d+(o+1)*u.nudgeOffset,S=new Error(`Nudging 'currentTime' from ${d} to ${g}`);this.warn(S.message),s.currentTime=g,i.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_NUDGE_ON_STALL,error:S,fatal:!1,buffer:e.len,bufferInfo:e})}else{const g=new Error(`Playhead still not moving while enough data buffered @${d} after ${u.nudgeMaxRetry} nudges`);this.error(g.message),i.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.BUFFER_STALLED_ERROR,error:g,fatal:!0,buffer:e.len,bufferInfo:e})}}}function iD(h,e){const i=aD(h.main);if(i&&i.start<=e)return i;const s=aD(h.audio);return s&&s.start<=e?s:null}function aD(h){if(!h)return null;switch(h.state){case be.IDLE:case be.STOPPED:case be.ENDED:case be.ERROR:return null}return h.frag}function Pv(h,e){return e.getAppendedFrag(h,Be.MAIN)||e.getPartialFragment(h)}const OI=.25;function Rb(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function Db(h,e,i,s,o){let u=new h(e,i,"");try{u.value=s,o&&(u.type=o)}catch{u=new h(e,i,rn(o?Qt({type:o},s):s))}return u}const Gv=(()=>{const h=Rb();try{h&&new h(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class MI{constructor(e){this.hls=void 0,this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.removeCues=!0,this.assetCue=void 0,this.onEventCueEnter=()=>{this.hls&&this.hls.trigger(O.EVENT_CUE_ENTER,{})},this.hls=e,this._registerListeners()}destroy(){this._unregisterListeners(),this.id3Track=null,this.media=null,this.dateRangeCuesAppended={},this.hls=this.onEventCueEnter=null}_registerListeners(){const{hls:e}=this;e&&(e.on(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(O.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(O.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(O.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(O.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(O.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,i){var s;this.media=i.media,((s=i.overrides)==null?void 0:s.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const i=(e=this.hls)==null?void 0:e.latestLevelDetails;i&&this.updateDateRangeCues(i)}onMediaDetaching(e,i){this.media=null,!i.transferMedia&&(this.id3Track&&(this.removeCues&&Ah(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const i=this.getID3Track(e.textTracks);return i.mode="hidden",i}getID3Track(e){if(this.media){for(let i=0;i<e.length;i++){const s=e[i];if(s.kind==="metadata"&&s.label==="id3")return wR(s,this.media),s}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,i){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:s,enableID3MetadataCues:o}=this.hls.config;if(!s&&!o)return;const{samples:u}=i;this.id3Track||(this.id3Track=this.createTrack(this.media));const d=Rb();if(d)for(let g=0;g<u.length;g++){const S=u[g].type;if(S===ms.emsg&&!s||!o)continue;const v=qA(u[g].data),E=u[g].pts;let b=E+u[g].duration;b>Gv&&(b=Gv),b-E<=0&&(b=E+OI);for(let _=0;_<v.length;_++){const D=v[_];if(!KA(D)){this.updateId3CueEnds(E,S);const I=Db(d,E,b,D,S);I&&this.id3Track.addCue(I)}}}}updateId3CueEnds(e,i){var s;const o=(s=this.id3Track)==null?void 0:s.cues;if(o)for(let u=o.length;u--;){const d=o[u];d.type===i&&d.startTime<e&&d.endTime===Gv&&(d.endTime=e)}}onBufferFlushing(e,{startOffset:i,endOffset:s,type:o}){const{id3Track:u,hls:d}=this;if(!d)return;const{config:{enableEmsgMetadataCues:g,enableID3MetadataCues:S}}=d;if(u&&(g||S)){let v;o==="audio"?v=E=>E.type===ms.audioId3&&S:o==="video"?v=E=>E.type===ms.emsg&&g:v=E=>E.type===ms.audioId3&&S||E.type===ms.emsg&&g,db(u,i,s,v)}}onLevelUpdated(e,{details:i}){this.updateDateRangeCues(i,!0)}onLevelPtsUpdated(e,i){Math.abs(i.drift)>.01&&this.updateDateRangeCues(i.details)}updateDateRangeCues(e,i){if(!this.hls||!this.media)return;const{assetPlayerId:s,timelineOffset:o,enableDateRangeMetadataCues:u,interstitialsController:d}=this.hls.config;if(!u)return;const g=Rb();if(s&&o&&!d){const{fragmentStart:I,fragmentEnd:M}=e;let w=this.assetCue;w?(w.startTime=I,w.endTime=M):g&&(w=this.assetCue=Db(g,I,M,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),w&&(w.id=s,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(w),w.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:S}=this,{dateRanges:v}=e,E=Object.keys(v);let b=this.dateRangeCuesAppended;if(S&&i){var R;if((R=S.cues)!=null&&R.length){const I=Object.keys(b).filter(M=>!E.includes(M));for(let M=I.length;M--;){var _;const w=I[M],B=(_=b[w])==null?void 0:_.cues;delete b[w],B&&Object.keys(B).forEach(z=>{const G=B[z];if(G){G.removeEventListener("enter",this.onEventCueEnter);try{S.removeCue(G)}catch{}}})}}else b=this.dateRangeCuesAppended={}}const D=e.fragments[e.fragments.length-1];if(!(E.length===0||!Ue(D==null?void 0:D.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let I=0;I<E.length;I++){const M=E[I],w=v[M],B=w.startTime,z=b[M],G=(z==null?void 0:z.cues)||{};let K=(z==null?void 0:z.durationKnown)||!1,ae=Gv;const{duration:q,endDate:Z}=w;if(Z&&q!==null)ae=B+q,K=!0;else if(w.endOnNext&&!K){const $=E.reduce((me,Ee)=>{if(Ee!==w.id){const De=v[Ee];if(De.class===w.class&&De.startDate>w.startDate&&(!me||w.startDate<me.startDate))return De}return me},null);$&&(ae=$.startTime,K=!0)}const te=Object.keys(w.attr);for(let $=0;$<te.length;$++){const me=te[$];if(!t2(me))continue;const Ee=G[me];if(Ee)K&&!(z!=null&&z.durationKnown)?Ee.endTime=ae:Math.abs(Ee.startTime-B)>.01&&(Ee.startTime=B,Ee.endTime=ae);else if(g){let De=w.attr[me];n2(me)&&(De=vx(De));const Oe=Db(g,B,ae,{key:me,data:De},ms.dateRange);Oe&&(Oe.id=M,this.id3Track.addCue(Oe),G[me]=Oe,d&&(me==="X-ASSET-LIST"||me==="X-ASSET-URL")&&Oe.addEventListener("enter",this.onEventCueEnter))}}b[M]={cues:G,dateRange:w,durationKnown:K}}}}}class II{constructor(e){this.hls=void 0,this.config=void 0,this.media=null,this.currentTime=0,this.stallCount=0,this._latency=null,this._targetLatencyUpdated=!1,this.onTimeupdate=()=>{const{media:i}=this,s=this.levelDetails;if(!i||!s)return;this.currentTime=i.currentTime;const o=this.computeLatency();if(o===null)return;this._latency=o;const{lowLatencyMode:u,maxLiveSyncPlaybackRate:d}=this.config;if(!u||d===1||!s.live)return;const g=this.targetLatency;if(g===null)return;const S=o-g,v=Math.min(this.maxLatency,g+s.targetduration);if(S<v&&S>.05&&this.forwardBufferLength>1){const b=Math.min(2,Math.max(1,d)),R=Math.round(2/(1+Math.exp(-.75*S-this.edgeStalled))*20)/20,_=Math.min(b,Math.max(1,R));this.changeMediaPlaybackRate(i,_)}else i.playbackRate!==1&&i.playbackRate!==0&&this.changeMediaPlaybackRate(i,1)},this.hls=e,this.config=e.config,this.registerListeners()}get levelDetails(){var e;return((e=this.hls)==null?void 0:e.latestLevelDetails)||null}get latency(){return this._latency||0}get maxLatency(){const{config:e}=this;if(e.liveMaxLatencyDuration!==void 0)return e.liveMaxLatencyDuration;const i=this.levelDetails;return i?e.liveMaxLatencyDurationCount*i.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:i,partHoldBack:s,targetduration:o}=e,{liveSyncDuration:u,liveSyncDurationCount:d,lowLatencyMode:g}=this.config,S=this.hls.userConfig;let v=g&&s||i;(this._targetLatencyUpdated||S.liveSyncDuration||S.liveSyncDurationCount||v===0)&&(v=u!==void 0?u:d*o);const E=o;return v+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,E)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),i=this.targetLatency;if(e===null||i===null)return null;const s=this.levelDetails;if(s===null)return null;const o=s.edge,u=e-i-this.edgeStalled,d=o-s.totalduration,g=o-(this.config.lowLatencyMode&&s.partTarget||s.targetduration);return Math.min(Math.max(d,u),g)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const i=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-i,0)}get forwardBufferLength(){const{media:e}=this,i=this.levelDetails;if(!e||!i)return 0;const s=e.buffered.length;return(s?e.buffered.end(s-1):i.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(O.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(O.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(O.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(O.ERROR,this.onError,this))}onMediaAttached(e,i){this.media=i.media,this.media.addEventListener("timeupdate",this.onTimeupdate)}onMediaDetaching(){this.media&&(this.media.removeEventListener("timeupdate",this.onTimeupdate),this.media=null)}onManifestLoading(){this._latency=null,this.stallCount=0}onLevelUpdated(e,{details:i}){i.advanced&&this.onTimeupdate(),!i.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,i){var s;i.details===re.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(s=this.levelDetails)!=null&&s.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,i){var s,o;e.playbackRate!==i&&((s=this.hls)==null||s.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(o=this.targetLatency)==null?void 0:o.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${i}`),e.playbackRate=i)}estimateLiveEdge(){const e=this.levelDetails;return e===null?null:e.edge+e.age}computeLatency(){const e=this.estimateLiveEdge();return e===null?null:e-this.currentTime}}class wI extends ib{constructor(e,i){super(e,"level-controller"),this._levels=[],this._firstLevel=-1,this._maxAutoLevel=-1,this._startLevel=void 0,this.currentLevel=null,this.currentLevelIndex=-1,this.manualLevelIndex=-1,this.steering=void 0,this.onParsedComplete=void 0,this.steering=i,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(O.LEVEL_LOADED,this.onLevelLoaded,this),e.on(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(O.FRAG_BUFFERED,this.onFragBuffered,this),e.on(O.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(O.LEVEL_LOADED,this.onLevelLoaded,this),e.off(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(O.FRAG_BUFFERED,this.onFragBuffered,this),e.off(O.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(i=>{i.loadError=0,i.fragmentError=0}),super.stopLoad()}resetLevels(){this._startLevel=void 0,this.manualLevelIndex=-1,this.currentLevelIndex=-1,this.currentLevel=null,this._levels=[],this._maxAutoLevel=-1}onManifestLoading(e,i){this.resetLevels()}onManifestLoaded(e,i){const s=this.hls.config.preferManagedMediaSource,o=[],u={},d={};let g=!1,S=!1,v=!1;i.levels.forEach(E=>{const b=E.attrs;let{audioCodec:R,videoCodec:_}=E;R&&(E.audioCodec=R=uv(R,s)||void 0),_&&(_=E.videoCodec=vC(_));const{width:D,height:I,unknownCodecs:M}=E,w=(M==null?void 0:M.length)||0;if(g||(g=!!(D&&I)),S||(S=!!_),v||(v=!!R),w||R&&!this.isAudioSupported(R)||_&&!this.isVideoSupported(_)){this.log(`Some or all CODECS not supported "${b.CODECS}"`);return}const{CODECS:B,"FRAME-RATE":z,"HDCP-LEVEL":G,"PATHWAY-ID":K,RESOLUTION:ae,"VIDEO-RANGE":q}=b,te=`${`${K||"."}-`}${E.bitrate}-${ae}-${z}-${B}-${q}-${G}`;if(u[te])if(u[te].uri!==E.url&&!E.attrs["PATHWAY-ID"]){const $=d[te]+=1;E.attrs["PATHWAY-ID"]=new Array($+1).join(".");const me=this.createLevel(E);u[te]=me,o.push(me)}else u[te].addGroupId("audio",b.AUDIO),u[te].addGroupId("text",b.SUBTITLES);else{const $=this.createLevel(E);u[te]=$,d[te]=1,o.push($)}}),this.filterAndSortMediaOptions(o,i,g,S,v)}createLevel(e){const i=new Wg(e),s=e.supplemental;if(s!=null&&s.videoCodec&&!this.isVideoSupported(s.videoCodec)){const o=new Error(`SUPPLEMENTAL-CODECS not supported "${s.videoCodec}"`);this.log(o.message),i.supportedResult=Bx(o,[])}return i}isAudioSupported(e){return Zg(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Zg(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,i,s,o,u){var d;let g=[],S=[],v=e;const E=((d=i.stats)==null?void 0:d.parsing)||{};if((s||o)&&u&&(v=v.filter(({videoCodec:B,videoRange:z,width:G,height:K})=>(!!B||!!(G&&K))&&_C(z))),v.length===0){Promise.resolve().then(()=>{if(this.hls){let B="no level with compatible codecs found in manifest",z=B;i.levels.length&&(z=`one or more CODECS in variant not supported: ${rn(i.levels.map(K=>K.attrs.CODECS).filter((K,ae,q)=>q.indexOf(K)===ae))}`,this.warn(z),B+=` (${z})`);const G=new Error(B);this.hls.trigger(O.ERROR,{type:je.MEDIA_ERROR,details:re.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:i.url,error:G,reason:z})}}),E.end=performance.now();return}i.audioTracks&&(g=i.audioTracks.filter(B=>!B.audioCodec||this.isAudioSupported(B.audioCodec)),sD(g)),i.subtitles&&(S=i.subtitles,sD(S));const b=v.slice(0);v.sort((B,z)=>{if(B.attrs["HDCP-LEVEL"]!==z.attrs["HDCP-LEVEL"])return(B.attrs["HDCP-LEVEL"]||"")>(z.attrs["HDCP-LEVEL"]||"")?1:-1;if(s&&B.height!==z.height)return B.height-z.height;if(B.frameRate!==z.frameRate)return B.frameRate-z.frameRate;if(B.videoRange!==z.videoRange)return fv.indexOf(B.videoRange)-fv.indexOf(z.videoRange);if(B.videoCodec!==z.videoCodec){const G=wx(B.videoCodec),K=wx(z.videoCodec);if(G!==K)return K-G}if(B.uri===z.uri&&B.codecSet!==z.codecSet){const G=ov(B.codecSet),K=ov(z.codecSet);if(G!==K)return K-G}return B.averageBitrate!==z.averageBitrate?B.averageBitrate-z.averageBitrate:0});let R=b[0];if(this.steering&&(v=this.steering.filterParsedLevels(v),v.length!==b.length)){for(let B=0;B<b.length;B++)if(b[B].pathwayId===v[0].pathwayId){R=b[B];break}}this._levels=v;for(let B=0;B<v.length;B++)if(v[B]===R){var _;this._firstLevel=B;const z=R.bitrate,G=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${v.length} level(s) found, first bitrate: ${z}`),((_=this.hls.userConfig)==null?void 0:_.abrEwmaDefaultEstimate)===void 0){const K=Math.min(z,this.hls.config.abrEwmaDefaultEstimateMax);K>G&&G===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=K)}break}const D=u&&!o,I=this.hls.config,M=!!(I.audioStreamController&&I.audioTrackController),w={levels:v,audioTracks:g,subtitleTracks:S,sessionData:i.sessionData,sessionKeys:i.sessionKeys,firstLevel:this._firstLevel,stats:i.stats,audio:u,video:o,altAudio:M&&!D&&g.some(B=>!!B.url)};E.end=performance.now(),this.hls.trigger(O.MANIFEST_PARSED,w)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const i=this._levels;if(i.length===0)return;if(e<0||e>=i.length){const E=new Error("invalid level idx"),b=e<0;if(this.hls.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.LEVEL_SWITCH_ERROR,level:e,fatal:b,error:E,reason:E.message}),b)return;e=Math.min(e,i.length-1)}const s=this.currentLevelIndex,o=this.currentLevel,u=o?o.attrs["PATHWAY-ID"]:void 0,d=i[e],g=d.attrs["PATHWAY-ID"];if(this.currentLevelIndex=e,this.currentLevel=d,s===e&&o&&u===g)return;this.log(`Switching to level ${e} (${d.height?d.height+"p ":""}${d.videoRange?d.videoRange+" ":""}${d.codecSet?d.codecSet+" ":""}@${d.bitrate})${g?" with Pathway "+g:""} from level ${s}${u?" with Pathway "+u:""}`);const S={level:e,attrs:d.attrs,details:d.details,bitrate:d.bitrate,averageBitrate:d.averageBitrate,maxBitrate:d.maxBitrate,realBitrate:d.realBitrate,width:d.width,height:d.height,codecSet:d.codecSet,audioCodec:d.audioCodec,videoCodec:d.videoCodec,audioGroups:d.audioGroups,subtitleGroups:d.subtitleGroups,loaded:d.loaded,loadError:d.loadError,fragmentError:d.fragmentError,name:d.name,id:d.id,uri:d.uri,url:d.url,urlId:0,audioGroupIds:d.audioGroupIds,textGroupIds:d.textGroupIds};this.hls.trigger(O.LEVEL_SWITCHING,S);const v=d.details;if(!v||v.live){const E=this.switchParams(d.uri,o==null?void 0:o.details,v);this.loadPlaylist(E)}}get manualLevel(){return this.manualLevelIndex}set manualLevel(e){this.manualLevelIndex=e,this._startLevel===void 0&&(this._startLevel=e),e!==-1&&(this.level=e)}get firstLevel(){return this._firstLevel}set firstLevel(e){this._firstLevel=e}get startLevel(){if(this._startLevel===void 0){const e=this.hls.config.startLevel;return e!==void 0?e:this.hls.firstAutoLevel}return this._startLevel}set startLevel(e){this._startLevel=e}get pathways(){return this.steering?this.steering.pathways():[]}get pathwayPriority(){return this.steering?this.steering.pathwayPriority:null}set pathwayPriority(e){if(this.steering){const i=this.steering.pathways(),s=e.filter(o=>i.indexOf(o)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${i}`);return}this.steering.pathwayPriority=s}}onError(e,i){i.fatal||!i.context||i.context.type===xt.LEVEL&&i.context.level===this.level&&this.checkRetry(i)}onFragBuffered(e,{frag:i}){if(i!==void 0&&i.type===Be.MAIN){const s=i.elementaryStreams;if(!Object.keys(s).some(u=>!!s[u]))return;const o=this._levels[i.level];o!=null&&o.loadError&&(this.log(`Resetting level error count of ${o.loadError} on frag buffered`),o.loadError=0)}}onLevelLoaded(e,i){var s;const{level:o,details:u}=i,d=i.levelInfo;if(!d){var g;this.warn(`Invalid level index ${o}`),(g=i.deliveryDirectives)!=null&&g.skip&&(u.deltaUpdateFailed=!0);return}if(d===this.currentLevel||i.withoutMultiVariant){d.fragmentError===0&&(d.loadError=0);let S=d.details;S===i.details&&S.advanced&&(S=void 0),this.playlistLoaded(o,i,S)}else(s=i.deliveryDirectives)!=null&&s.skip&&(u.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,i){super.loadingPlaylist(e,i);const s=this.getUrlWithDirectives(e.uri,i),o=this.currentLevelIndex,u=e.attrs["PATHWAY-ID"],d=e.details,g=d==null?void 0:d.age;this.log(`Loading level index ${o}${(i==null?void 0:i.msn)!==void 0?" at sn "+i.msn+" part "+i.part:""}${u?" Pathway "+u:""}${g&&d.live?" age "+g.toFixed(1)+(d.type&&" "+d.type||""):""} ${s}`),this.hls.trigger(O.LEVEL_LOADING,{url:s,level:o,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:i||null})}get nextLoadLevel(){return this.manualLevelIndex!==-1?this.manualLevelIndex:this.hls.nextAutoLevel}set nextLoadLevel(e){this.level=e,this.manualLevelIndex===-1&&(this.hls.nextAutoLevel=e)}removeLevel(e){var i;if(this._levels.length===1)return;const s=this._levels.filter((u,d)=>d!==e?!0:(this.steering&&this.steering.removeLevel(u),u===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,u.details&&u.details.fragments.forEach(g=>g.level=-1)),!1));wA(s),this._levels=s,this.currentLevelIndex>-1&&(i=this.currentLevel)!=null&&i.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const o=s.length-1;this._firstLevel=Math.min(this._firstLevel,o),this._startLevel&&(this._startLevel=Math.min(this._startLevel,o)),this.hls.trigger(O.LEVELS_UPDATED,{levels:s})}onLevelsUpdated(e,{levels:i}){this._levels=i}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:i,maxHdcpLevel:s}=this.hls;this._maxAutoLevel!==i&&(this._maxAutoLevel=i,this.hls.trigger(O.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:i,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:s}))}}function sD(h){const e={};h.forEach(i=>{const s=i.groupId||"";i.id=e[s]=e[s]||0,e[s]++})}function lD(){return self.SourceBuffer||self.WebKitSourceBuffer}function rD(){if(!Nu())return!1;const e=lD();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function NI(){if(!rD())return!1;const h=Nu();return typeof(h==null?void 0:h.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>h.isTypeSupported(Jg(e,"video")))||["mp4a.40.2","fLaC"].some(e=>h.isTypeSupported(Jg(e,"audio"))))}function UI(){var h;const e=lD();return typeof(e==null||(h=e.prototype)==null?void 0:h.changeType)=="function"}const kI=100;class BI extends $T{constructor(e,i,s){super(e,i,s,"stream-controller",Be.MAIN),this.audioCodecSwap=!1,this.level=-1,this._forceStartLoad=!1,this._hasEnoughToStart=!1,this.altAudio=0,this.audioOnly=!1,this.fragPlaying=null,this.fragLastKbps=0,this.couldBacktrack=!1,this.backtrackFragment=null,this.audioCodecSwitch=!1,this.videoBuffer=null,this.onMediaPlaying=()=>{this.tick()},this.onMediaSeeked=()=>{const o=this.media,u=o?o.currentTime:null;if(u===null||!Ue(u)||(this.log(`Media seeked to ${u.toFixed(3)}`),!this.getBufferedFrag(u)))return;const d=this.getFwdBufferInfoAtPos(o,u,Be.MAIN,0);if(d===null||d.len===0){this.warn(`Main forward buffer length at ${u} on "seeked" event ${d?d.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(O.MANIFEST_PARSED,this.onManifestParsed,this),e.on(O.LEVEL_LOADING,this.onLevelLoading,this),e.on(O.LEVEL_LOADED,this.onLevelLoaded,this),e.on(O.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(O.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(O.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(O.BUFFER_CREATED,this.onBufferCreated,this),e.on(O.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(O.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(O.MANIFEST_PARSED,this.onManifestParsed,this),e.off(O.LEVEL_LOADED,this.onLevelLoaded,this),e.off(O.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(O.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(O.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(O.BUFFER_CREATED,this.onBufferCreated,this),e.off(O.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(O.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(O.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,i){if(this.levels){const{lastCurrentTime:s,hls:o}=this;if(this.stopLoad(),this.setInterval(kI),this.level=-1,!this.startFragRequested){let u=o.startLevel;u===-1&&(o.config.testBandwidth&&this.levels.length>1?(u=0,this.bitrateTest=!0):u=o.firstAutoLevel),o.nextLoadLevel=u,this.level=o.loadLevel,this._hasEnoughToStart=!!i}s>0&&e===-1&&!i&&(this.log(`Override startPosition with lastCurrentTime @${s.toFixed(3)}`),e=s),this.state=be.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=i?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=be.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case be.WAITING_LEVEL:{const{levels:e,level:i}=this,s=e==null?void 0:e[i],o=s==null?void 0:s.details;if(o&&(!o.live||this.levelLastLoaded===s&&!this.waitForLive(s))){if(this.waitForCdnTuneIn(o))break;this.state=be.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=be.IDLE;break}break}case be.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===be.IDLE&&this.doTickIdle(),this.onTickEnd()}onTickEnd(){var e;super.onTickEnd(),(e=this.media)!=null&&e.readyState&&this.media.seeking===!1&&(this.lastCurrentTime=this.media.currentTime),this.checkFragmentChanged()}doTickIdle(){const{hls:e,levelLastLoaded:i,levels:s,media:o}=this;if(i===null||!o&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const u=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(s!=null&&s[u]))return;const d=s[u],g=this.getMainFwdBufferInfo();if(g===null)return;const S=this.getLevelDetails();if(S&&this._streamEnded(g,S)){const I={};this.altAudio===2&&(I.type="video"),this.hls.trigger(O.BUFFER_EOS,I),this.state=be.ENDED;return}if(!this.buffering)return;e.loadLevel!==u&&e.manualLevel===-1&&this.log(`Adapting to level ${u} from level ${this.level}`),this.level=e.nextLoadLevel=u;const v=d.details;if(!v||this.state===be.WAITING_LEVEL||this.waitForLive(d)){this.level=u,this.state=be.WAITING_LEVEL,this.startFragRequested=!1;return}const E=g.len,b=this.getMaxBufferLength(d.maxBitrate);if(E>=b)return;this.backtrackFragment&&this.backtrackFragment.start>g.end&&(this.backtrackFragment=null);const R=this.backtrackFragment?this.backtrackFragment.start:g.end;let _=this.getNextFragment(R,v);if(this.couldBacktrack&&!this.fragPrevious&&_&&Vn(_)&&this.fragmentTracker.getState(_)!==yi.OK){var D;const M=((D=this.backtrackFragment)!=null?D:_).sn-v.startSN,w=v.fragments[M-1];w&&_.cc===w.cc&&(_=w,this.fragmentTracker.removeFragment(w))}else this.backtrackFragment&&g.len&&(this.backtrackFragment=null);if(_&&this.isLoopLoading(_,R)){if(!_.gap){const M=this.audioOnly&&!this.altAudio?ln.AUDIO:ln.VIDEO,w=(M===ln.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;w&&this.afterBufferFlushed(w,M,Be.MAIN)}_=this.getNextFragmentLoopLoading(_,v,g,Be.MAIN,b)}_&&(_.initSegment&&!_.initSegment.data&&!this.bitrateTest&&(_=_.initSegment),this.loadFragment(_,d,R))}loadFragment(e,i,s){const o=this.fragmentTracker.getState(e);o===yi.NOT_LOADED||o===yi.PARTIAL?Vn(e)?this.bitrateTest?(this.log(`Fragment ${e.sn} of level ${e.level} is being downloaded to test bitrate and will not be buffered`),this._loadBitrateTestFrag(e,i)):super.loadFragment(e,i,s):this._loadInitSegment(e,i):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,Be.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY)}nextLevelSwitch(){const{levels:e,media:i}=this;if(i!=null&&i.readyState){let s;const o=this.getAppendedFrag(i.currentTime);o&&o.start>1&&this.flushMainBuffer(0,o.start-1);const u=this.getLevelDetails();if(u!=null&&u.live){const g=this.getMainFwdBufferInfo();if(!g||g.len<u.targetduration*2)return}if(!i.paused&&e){const g=this.hls.nextLoadLevel,S=e[g],v=this.fragLastKbps;v&&this.fragCurrent?s=this.fragCurrent.duration*S.maxBitrate/(1e3*v)+1:s=0}else s=0;const d=this.getBufferedFrag(i.currentTime+s);if(d){const g=this.followingBufferedFrag(d);if(g){this.abortCurrentFrag();const S=g.maxStartPTS?g.maxStartPTS:g.start,v=g.duration,E=Math.max(d.end,S+Math.min(Math.max(v-this.config.maxFragLookUpTolerance,v*(this.couldBacktrack?.5:.125)),v*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(E,Number.POSITIVE_INFINITY)}}}}abortCurrentFrag(){const e=this.fragCurrent;switch(this.fragCurrent=null,this.backtrackFragment=null,e&&(e.abortRequests(),this.fragmentTracker.removeFragment(e)),this.state){case be.KEY_LOADING:case be.FRAG_LOADING:case be.FRAG_LOADING_WAITING_RETRY:case be.PARSING:case be.PARSED:this.state=be.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,i){super.flushMainBuffer(e,i,this.altAudio===2?"video":null)}onMediaAttached(e,i){super.onMediaAttached(e,i);const s=i.media;pa(s,"playing",this.onMediaPlaying),pa(s,"seeked",this.onMediaSeeked)}onMediaDetaching(e,i){const{media:s}=this;s&&($a(s,"playing",this.onMediaPlaying),$a(s,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,i),!i.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(O.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,i){let s=!1,o=!1;for(let u=0;u<i.levels.length;u++){const d=i.levels[u].audioCodec;d&&(s=s||d.indexOf("mp4a.40.2")!==-1,o=o||d.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=s&&o&&!UI(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=i.levels,this.startFragRequested=!1}onLevelLoading(e,i){const{levels:s}=this;if(!s||this.state!==be.IDLE)return;const o=i.levelInfo;(!o.details||o.details.live&&(this.levelLastLoaded!==o||o.details.expired)||this.waitForCdnTuneIn(o.details))&&(this.state=be.WAITING_LEVEL)}onLevelLoaded(e,i){var s;const{levels:o,startFragRequested:u}=this,d=i.level,g=i.details,S=g.totalduration;if(!o){this.warn(`Levels were reset while loading level ${d}`);return}this.log(`Level ${d} loaded [${g.startSN},${g.endSN}]${g.lastPartSn?`[part-${g.lastPartSn}-${g.lastPartIndex}]`:""}, cc [${g.startCC}, ${g.endCC}] duration:${S}`);const v=i.levelInfo,E=this.fragCurrent;E&&(this.state===be.FRAG_LOADING||this.state===be.FRAG_LOADING_WAITING_RETRY)&&E.level!==i.level&&E.loader&&this.abortCurrentFrag();let b=0;if(g.live||(s=v.details)!=null&&s.live){var R;if(this.checkLiveUpdate(g),g.deltaUpdateFailed)return;b=this.alignPlaylists(g,v.details,(R=this.levelLastLoaded)==null?void 0:R.details)}if(v.details=g,this.levelLastLoaded=v,u||this.setStartPosition(g,b),this.hls.trigger(O.LEVEL_UPDATED,{details:g,level:d}),this.state===be.WAITING_LEVEL){if(this.waitForCdnTuneIn(g))return;this.state=be.IDLE}u&&g.live&&this.synchronizeToLiveEdge(g),this.tick()}synchronizeToLiveEdge(e){const{config:i,media:s}=this;if(!s)return;const o=this.hls.liveSyncPosition,u=this.getLoadPosition(),d=e.fragmentStart,g=e.edge,S=u>=d-i.maxFragLookUpTolerance&&u<=g;if(o!==null&&s.duration>o&&(u<o||!S)){const E=i.liveMaxLatencyDuration!==void 0?i.liveMaxLatencyDuration:i.liveMaxLatencyDurationCount*e.targetduration;if((!S&&s.readyState<4||u<g-E)&&(this._hasEnoughToStart||(this.nextLoadPosition=o),s.readyState))if(this.warn(`Playback: ${u.toFixed(3)} is located too far from the end of live sliding playlist: ${g}, reset currentTime to : ${o.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var v;const b=lt.bufferInfo(s,o,0);if(!((v=b.buffered)!=null&&v.length)){s.currentTime=o;return}if(b.start<=u){s.currentTime=o;return}const{nextStart:_}=lt.bufferedInfo(b.buffered,u,0);_&&(s.currentTime=_)}else s.currentTime=o}}_handleFragmentLoadProgress(e){var i;const s=e.frag,{part:o,payload:u}=e,{levels:d}=this;if(!d){this.warn(`Levels were reset while fragment load was in progress. Fragment ${s.sn} of level ${s.level} will not be buffered`);return}const g=d[s.level];if(!g){this.warn(`Level ${s.level} not found on progress`);return}const S=g.details;if(!S){this.warn(`Dropping fragment ${s.sn} of level ${s.level} after level details were reset`),this.fragmentTracker.removeFragment(s);return}const v=g.videoCodec,E=S.PTSKnown||!S.live,b=(i=s.initSegment)==null?void 0:i.data,R=this._getAudioCodec(g),_=this.transmuxer=this.transmuxer||new fR(this.hls,Be.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),D=o?o.index:-1,I=D!==-1,M=new IT(s.level,s.sn,s.stats.chunkCount,u.byteLength,D,I),w=this.initPTS[s.cc];_.push(u,b,R,v,s,o,S.totalduration,E,M,w)}onAudioTrackSwitching(e,i){const s=this.hls,o=this.altAudio!==0;if(hv(i.url,s))this.altAudio=1;else{if(this.mediaBuffer!==this.media){this.log("Switching on main audio, use media.buffered to schedule main fragment loading"),this.mediaBuffer=this.media;const d=this.fragCurrent;d&&(this.log("Switching to main audio track, cancel main fragment load"),d.abortRequests(),this.fragmentTracker.removeFragment(d)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(o){this.altAudio=0,this.fragmentTracker.removeAllFragments(),s.once(O.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(O.AUDIO_TRACK_SWITCHED,i)}),s.trigger(O.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}s.trigger(O.AUDIO_TRACK_SWITCHED,i)}}onAudioTrackSwitched(e,i){const s=hv(i.url,this.hls);if(s){const o=this.videoBuffer;o&&this.mediaBuffer!==o&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=o)}this.altAudio=s?2:0,this.tick()}onBufferCreated(e,i){const s=i.tracks;let o,u,d=!1;for(const g in s){const S=s[g];if(S.id==="main"){if(u=g,o=S,g==="video"){const v=s[g];v&&(this.videoBuffer=v.buffer)}}else d=!0}d&&o?(this.log(`Alternate track found, use ${u}.buffered to schedule main fragment loading`),this.mediaBuffer=o.buffer):this.mediaBuffer=this.media}onFragBuffered(e,i){const{frag:s,part:o}=i,u=s.type===Be.MAIN;if(u){if(this.fragContextChanged(s)){this.warn(`Fragment ${s.sn}${o?" p: "+o.index:""} of level ${s.level} finished buffering, but was aborted. state: ${this.state}`),this.state===be.PARSED&&(this.state=be.IDLE);return}const g=o?o.stats:s.stats;this.fragLastKbps=Math.round(8*g.total/(g.buffering.end-g.loading.first)),Vn(s)&&(this.fragPrevious=s),this.fragBufferedComplete(s,o)}const d=this.media;d&&(!this._hasEnoughToStart&&lt.getBuffered(d).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),u&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,i){var s;if(i.fatal){this.state=be.ERROR;return}switch(i.details){case re.FRAG_GAP:case re.FRAG_PARSING_ERROR:case re.FRAG_DECRYPT_ERROR:case re.FRAG_LOAD_ERROR:case re.FRAG_LOAD_TIMEOUT:case re.KEY_LOAD_ERROR:case re.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(Be.MAIN,i);break;case re.LEVEL_LOAD_ERROR:case re.LEVEL_LOAD_TIMEOUT:case re.LEVEL_PARSING_ERROR:!i.levelRetry&&this.state===be.WAITING_LEVEL&&((s=i.context)==null?void 0:s.type)===xt.LEVEL&&(this.state=be.IDLE);break;case re.BUFFER_ADD_CODEC_ERROR:case re.BUFFER_APPEND_ERROR:if(i.parent!=="main")return;this.reduceLengthAndFlushBuffer(i)&&this.resetLoadingState();break;case re.BUFFER_FULL_ERROR:if(i.parent!=="main")return;this.reduceLengthAndFlushBuffer(i)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case re.INTERNAL_EXCEPTION:this.recoverWorkerError(i);break}}onFragLoadEmergencyAborted(){this.state=be.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:i}){if(i!==ln.AUDIO||!this.altAudio){const s=(i===ln.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;s&&(this.afterBufferFlushed(s,i,Be.MAIN),this.tick())}}onLevelsUpdated(e,i){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=i.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const i=e.currentTime;let s=this.startPosition;if(s>=0&&i<s){if(e.seeking){this.log(`could not seek to ${s}, already seeking at ${i}`);return}const o=this.timelineOffset;o&&s&&(s+=o);const u=this.getLevelDetails(),d=lt.getBuffered(e),g=d.length?d.start(0):0,S=g-s,v=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||S>0&&(S<v||this.loadingParts&&S<2*((u==null?void 0:u.partTarget)||0)))&&(this.log(`adjusting start position by ${S} to match buffer start`),s+=S,this.startPosition=s),i<s&&(this.log(`seek to target start position ${s} from current time ${i} buffer start ${g}`),e.currentTime=s)}}_getAudioCodec(e){let i=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&i&&(this.log("Swapping audio codec"),i.indexOf("mp4a.40.5")!==-1?i="mp4a.40.2":i="mp4a.40.5"),i}_loadBitrateTestFrag(e,i){e.bitrateTest=!0,this._doFragLoad(e,i).then(s=>{const{hls:o}=this,u=s==null?void 0:s.frag;if(!u||this.fragContextChanged(u))return;i.fragmentError=0,this.state=be.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const d=u.stats;d.parsing.start=d.parsing.end=d.buffering.start=d.buffering.end=self.performance.now(),o.trigger(O.FRAG_LOADED,s),u.bitrateTest=!1}).catch(s=>{this.state===be.STOPPED||this.state===be.ERROR||(this.warn(s),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const i=this.playlistType,{hls:s}=this,{remuxResult:o,chunkMeta:u}=e,d=this.getCurrentContext(u);if(!d){this.resetWhenMissingContext(u);return}const{frag:g,part:S,level:v}=d,{video:E,text:b,id3:R,initSegment:_}=o,{details:D}=v,I=this.altAudio?void 0:o.audio;if(this.fragContextChanged(g)){this.fragmentTracker.removeFragment(g);return}if(this.state=be.PARSING,_){const M=_.tracks;if(M){const G=g.initSegment||g;if(this.unhandledEncryptionError(_,g))return;this._bufferInitSegment(v,M,G,u),s.trigger(O.FRAG_PARSING_INIT_SEGMENT,{frag:G,id:i,tracks:M})}const w=_.initPTS,B=_.timescale,z=this.initPTS[g.cc];if(Ue(w)&&(!z||z.baseTime!==w||z.timescale!==B)){const G=_.trackId;this.initPTS[g.cc]={baseTime:w,timescale:B,trackId:G},s.trigger(O.INIT_PTS_FOUND,{frag:g,id:i,initPTS:w,timescale:B,trackId:G})}}if(E&&D){I&&E.type==="audiovideo"&&this.logMuxedErr(g);const M=D.fragments[g.sn-1-D.startSN],w=g.sn===D.startSN,B=!M||g.cc>M.cc;if(o.independent!==!1){const{startPTS:z,endPTS:G,startDTS:K,endDTS:ae}=E;if(S)S.elementaryStreams[E.type]={startPTS:z,endPTS:G,startDTS:K,endDTS:ae};else if(E.firstKeyFrame&&E.independent&&u.id===1&&!B&&(this.couldBacktrack=!0),E.dropped&&E.independent){const q=this.getMainFwdBufferInfo(),Z=(q?q.end:this.getLoadPosition())+this.config.maxBufferHole,te=E.firstKeyFramePTS?E.firstKeyFramePTS:z;if(!w&&Z<te-this.config.maxBufferHole&&!B){this.backtrack(g);return}else B&&(g.gap=!0);g.setElementaryStreamInfo(E.type,g.start,G,g.start,ae,!0)}else w&&z-(D.appliedTimelineOffset||0)>Fv&&(g.gap=!0);g.setElementaryStreamInfo(E.type,z,G,K,ae),this.backtrackFragment&&(this.backtrackFragment=g),this.bufferFragmentData(E,g,S,u,w||B)}else if(w||B)g.gap=!0;else{this.backtrack(g);return}}if(I){const{startPTS:M,endPTS:w,startDTS:B,endDTS:z}=I;S&&(S.elementaryStreams[ln.AUDIO]={startPTS:M,endPTS:w,startDTS:B,endDTS:z}),g.setElementaryStreamInfo(ln.AUDIO,M,w,B,z),this.bufferFragmentData(I,g,S,u)}if(D&&R!=null&&R.samples.length){const M={id:i,frag:g,details:D,samples:R.samples};s.trigger(O.FRAG_PARSING_METADATA,M)}if(D&&b){const M={id:i,frag:g,details:D,samples:b.samples};s.trigger(O.FRAG_PARSING_USERDATA,M)}}logMuxedErr(e){this.warn(`${Vn(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,i,s,o){if(this.state!==be.PARSING)return;this.audioOnly=!!i.audio&&!i.video,this.altAudio&&!this.audioOnly&&(delete i.audio,i.audiovideo&&this.logMuxedErr(s));const{audio:u,video:d,audiovideo:g}=i;if(u){const v=e.audioCodec;let E=cv(u.codec,v);E==="mp4a"&&(E="mp4a.40.5");const b=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){E&&(E.indexOf("mp4a.40.5")!==-1?E="mp4a.40.2":E="mp4a.40.5");const R=u.metadata;R&&"channelCount"in R&&(R.channelCount||1)!==1&&b.indexOf("firefox")===-1&&(E="mp4a.40.5")}E&&E.indexOf("mp4a.40.5")!==-1&&b.indexOf("android")!==-1&&u.container!=="audio/mpeg"&&(E="mp4a.40.2",this.log(`Android: force audio codec to ${E}`)),v&&v!==E&&this.log(`Swapping manifest audio codec "${v}" for "${E}"`),u.levelCodec=E,u.id=Be.MAIN,this.log(`Init audio buffer, container:${u.container}, codecs[selected/level/parsed]=[${E||""}/${v||""}/${u.codec}]`),delete i.audiovideo}if(d){d.levelCodec=e.videoCodec,d.id=Be.MAIN;const v=d.codec;if((v==null?void 0:v.length)===4)switch(v){case"hvc1":case"hev1":d.codec="hvc1.1.6.L120.90";break;case"av01":d.codec="av01.0.04M.08";break;case"avc1":d.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${d.container}, codecs[level/parsed]=[${e.videoCodec||""}/${v}]${d.codec!==v?" parsed-corrected="+d.codec:""}${d.supplemental?" supplemental="+d.supplemental:""}`),delete i.audiovideo}g&&(this.log(`Init audiovideo buffer, container:${g.container}, codecs[level/parsed]=[${e.codecs}/${g.codec}]`),delete i.video,delete i.audio);const S=Object.keys(i);if(S.length){if(this.hls.trigger(O.BUFFER_CODECS,i),!this.hls)return;S.forEach(v=>{const b=i[v].initSegment;b!=null&&b.byteLength&&this.hls.trigger(O.BUFFER_APPENDING,{type:v,data:b,frag:s,part:null,chunkMeta:o,parent:s.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,Be.MAIN)}get maxBufferLength(){const{levels:e,level:i}=this,s=e==null?void 0:e[i];return s?this.getMaxBufferLength(s.maxBitrate):this.config.maxBufferLength}backtrack(e){this.couldBacktrack=!0,this.backtrackFragment=e,this.resetTransmuxer(),this.flushBufferGap(e),this.fragmentTracker.removeFragment(e),this.fragPrevious=null,this.nextLoadPosition=e.start,this.state=be.IDLE}checkFragmentChanged(){const e=this.media;let i=null;if(e&&e.readyState>1&&e.seeking===!1){const s=e.currentTime;if(lt.isBuffered(e,s)?i=this.getAppendedFrag(s):lt.isBuffered(e,s+.1)&&(i=this.getAppendedFrag(s+.1)),i){this.backtrackFragment=null;const o=this.fragPlaying,u=i.level;(!o||i.sn!==o.sn||o.level!==u)&&(this.fragPlaying=i,this.hls.trigger(O.FRAG_CHANGED,{frag:i}),(!o||o.level!==u)&&this.hls.trigger(O.LEVEL_SWITCHED,{level:u}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const i=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return Ue(i)?this.getAppendedFrag(i):null}get currentProgramDateTime(){var e;const i=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(Ue(i)){const s=this.getLevelDetails(),o=this.currentFrag||(s?xf(null,s.fragments,i):null);if(o){const u=o.programDateTime;if(u!==null){const d=u+(i-o.start)*1e3;return new Date(d)}}}return null}get currentLevel(){const e=this.currentFrag;return e?e.level:-1}get nextBufferedFrag(){const e=this.currentFrag;return e?this.followingBufferedFrag(e):null}get forceStartLoad(){return this._forceStartLoad}}class zI extends Xs{constructor(e,i){super("key-loader",i),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const s in this.keyIdToKeyInfo){const o=this.keyIdToKeyInfo[s].loader;if(o){var i;if(e&&e!==((i=o.context)==null?void 0:i.frag.type))return;o.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[e];(i.mediaKeySessionContext||i.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const i=this.keyIdToKeyInfo[e].loader;i&&i.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,i=re.KEY_LOAD_ERROR,s,o,u){return new yo({type:je.NETWORK_ERROR,details:i,fatal:!1,frag:e,response:u,error:s,networkDetails:o})}loadClear(e,i,s){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(i.length)for(let o=0,u=i.length;o<u;o++){const d=i[o];if(e.cc<=d.cc&&(!Vn(e)||!Vn(d)||e.sn<d.sn)||!s&&o==u-1)return this.emeController.selectKeySystemFormat(d).then(g=>{if(!this.emeController)return;d.setKeyFormat(g);const S=Ev(g);if(S)return this.emeController.getKeySystemAccess([S])})}if(this.config.requireKeySystemAccessOnStart){const o=e0(this.config);if(o.length)return this.emeController.getKeySystemAccess(o)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(i=>this.loadInternal(e,i)):this.loadInternal(e)}loadInternal(e,i){var s,o;i&&e.setKeyFormat(i);const u=e.decryptdata;if(!u){const v=new Error(i?`Expected frag.decryptdata to be defined after setting format ${i}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,re.KEY_LOAD_ERROR,v))}const d=u.uri;if(!d)return Promise.reject(this.createKeyLoadError(e,re.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${d}"`)));const g=Lb(u);let S=this.keyIdToKeyInfo[g];if((s=S)!=null&&s.decryptdata.key)return u.key=S.decryptdata.key,Promise.resolve({frag:e,keyInfo:S});if(this.emeController&&(o=S)!=null&&o.keyLoadPromise)switch(this.emeController.getKeyStatus(S.decryptdata)){case"usable":case"usable-in-future":return S.keyLoadPromise.then(E=>{const{keyInfo:b}=E;return u.key=b.decryptdata.key,{frag:e,keyInfo:b}})}switch(this.log(`${this.keyIdToKeyInfo[g]?"Rel":"L"}oading${u.keyId?" keyId: "+zi(u.keyId):""} URI: ${u.uri} from ${e.type} ${e.level}`),S=this.keyIdToKeyInfo[g]={decryptdata:u,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},u.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return u.keyFormat==="identity"?this.loadKeyHTTP(S,e):this.loadKeyEME(S,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(S,e);default:return Promise.reject(this.createKeyLoadError(e,re.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${u.method}"`)))}}loadKeyEME(e,i){const s={frag:i,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var o;if(!e.decryptdata.keyId&&(o=i.initSegment)!=null&&o.data){const d=lC(i.initSegment.data);if(d.length){let g=d[0];g.some(S=>S!==0)?(this.log(`Using keyId found in init segment ${zi(g)}`),ku.setKeyIdForUri(e.decryptdata.uri,g)):(g=ku.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${zi(g)}`)),e.decryptdata.keyId=g}}if(!e.decryptdata.keyId&&!Vn(i))return Promise.resolve(s);const u=this.emeController.loadKey(s);return(e.keyLoadPromise=u.then(d=>(e.mediaKeySessionContext=d,s))).catch(d=>{throw e.keyLoadPromise=null,"data"in d&&(d.data.frag=i),d})}return Promise.resolve(s)}loadKeyHTTP(e,i){const s=this.config,o=s.loader,u=new o(s);return i.keyLoader=e.loader=u,e.keyLoadPromise=new Promise((d,g)=>{const S={keyInfo:e,frag:i,responseType:"arraybuffer",url:e.decryptdata.uri},v=s.keyLoadPolicy.default,E={loadPolicy:v,timeout:v.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},b={onSuccess:(R,_,D,I)=>{const{frag:M,keyInfo:w}=D,B=Lb(w.decryptdata);if(!M.decryptdata||w!==this.keyIdToKeyInfo[B])return g(this.createKeyLoadError(M,re.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),I));w.decryptdata.key=M.decryptdata.key=new Uint8Array(R.data),M.keyLoader=null,w.loader=null,d({frag:M,keyInfo:w})},onError:(R,_,D,I)=>{this.resetLoader(_),g(this.createKeyLoadError(i,re.KEY_LOAD_ERROR,new Error(`HTTP Error ${R.code} loading key ${R.text}`),D,Qt({url:S.url,data:void 0},R)))},onTimeout:(R,_,D)=>{this.resetLoader(_),g(this.createKeyLoadError(i,re.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),D))},onAbort:(R,_,D)=>{this.resetLoader(_),g(this.createKeyLoadError(i,re.INTERNAL_ABORTED,new Error("key loading aborted"),D))}};u.load(S,E,b)})}resetLoader(e){const{frag:i,keyInfo:s,url:o}=e,u=s.loader;i.keyLoader===u&&(i.keyLoader=null,s.loader=null);const d=Lb(s.decryptdata)||o;delete this.keyIdToKeyInfo[d],u&&u.destroy()}}function Lb(h){if(h.keyFormat!==Pi.FAIRPLAY){const e=h.keyId;if(e)return zi(e)}return h.uri}function oD(h){const{type:e}=h;switch(e){case xt.AUDIO_TRACK:return Be.AUDIO;case xt.SUBTITLE_TRACK:return Be.SUBTITLE;default:return Be.MAIN}}function _b(h,e){let i=h.url;return(i===void 0||i.indexOf("data:")===0)&&(i=e.url),i}class FI{constructor(e){this.hls=void 0,this.loaders=Object.create(null),this.variableList=null,this.onManifestLoaded=this.checkAutostartLoad,this.hls=e,this.registerListeners()}startLoad(e){}stopLoad(){this.destroyInternalLoaders()}registerListeners(){const{hls:e}=this;e.on(O.MANIFEST_LOADING,this.onManifestLoading,this),e.on(O.LEVEL_LOADING,this.onLevelLoading,this),e.on(O.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(O.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(O.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(O.MANIFEST_LOADING,this.onManifestLoading,this),e.off(O.LEVEL_LOADING,this.onLevelLoading,this),e.off(O.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(O.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(O.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const i=this.hls.config,s=i.pLoader,o=i.loader,u=s||o,d=new u(i);return this.loaders[e.type]=d,d}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const i=this.loaders[e];i&&i.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,i){const{url:s}=i;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:xt.MANIFEST,url:s,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,i){const{id:s,level:o,pathwayId:u,url:d,deliveryDirectives:g,levelInfo:S}=i;this.load({id:s,level:o,pathwayId:u,responseType:"text",type:xt.LEVEL,url:d,deliveryDirectives:g,levelOrTrack:S})}onAudioTrackLoading(e,i){const{id:s,groupId:o,url:u,deliveryDirectives:d,track:g}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:xt.AUDIO_TRACK,url:u,deliveryDirectives:d,levelOrTrack:g})}onSubtitleTrackLoading(e,i){const{id:s,groupId:o,url:u,deliveryDirectives:d,track:g}=i;this.load({id:s,groupId:o,level:null,responseType:"text",type:xt.SUBTITLE_TRACK,url:u,deliveryDirectives:d,levelOrTrack:g})}onLevelsUpdated(e,i){const s=this.loaders[xt.LEVEL];if(s){const o=s.context;o&&!i.levels.some(u=>u===o.levelOrTrack)&&(s.abort(),delete this.loaders[xt.LEVEL])}}load(e){var i;const s=this.hls.config;let o=this.getInternalLoader(e);if(o){const v=this.hls.logger,E=o.context;if(E&&E.levelOrTrack===e.levelOrTrack&&(E.url===e.url||E.deliveryDirectives&&!e.deliveryDirectives)){E.url===e.url?v.log(`[playlist-loader]: ignore ${e.url} ongoing request`):v.log(`[playlist-loader]: ignore ${e.url} in favor of ${E.url}`);return}v.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),o.abort()}let u;if(e.type===xt.MANIFEST?u=s.manifestLoadPolicy.default:u=Jt({},s.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),o=this.createInternalLoader(e),Ue((i=e.deliveryDirectives)==null?void 0:i.part)){let v;if(e.type===xt.LEVEL&&e.level!==null?v=this.hls.levels[e.level].details:e.type===xt.AUDIO_TRACK&&e.id!==null?v=this.hls.audioTracks[e.id].details:e.type===xt.SUBTITLE_TRACK&&e.id!==null&&(v=this.hls.subtitleTracks[e.id].details),v){const E=v.partTarget,b=v.targetduration;if(E&&b){const R=Math.max(E*3,b*.8)*1e3;u=Jt({},u,{maxTimeToFirstByteMs:Math.min(R,u.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(R,u.maxTimeToFirstByteMs)})}}}const d=u.errorRetry||u.timeoutRetry||{},g={loadPolicy:u,timeout:u.maxLoadTimeMs,maxRetry:d.maxNumRetry||0,retryDelay:d.retryDelayMs||0,maxRetryDelay:d.maxRetryDelayMs||0},S={onSuccess:(v,E,b,R)=>{const _=this.getInternalLoader(b);this.resetInternalLoader(b.type);const D=v.data;E.parsing.start=performance.now(),Ar.isMediaPlaylist(D)||b.type!==xt.MANIFEST?this.handleTrackOrLevelPlaylist(v,E,b,R||null,_):this.handleMasterPlaylist(v,E,b,R)},onError:(v,E,b,R)=>{this.handleNetworkError(E,b,!1,v,R)},onTimeout:(v,E,b)=>{this.handleNetworkError(E,b,!0,void 0,v)}};o.load(e,g,S)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:i},forceStartLoad:s}=this.hls;(e||s)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${i}`),this.hls.startLoad(i))}handleMasterPlaylist(e,i,s,o){const u=this.hls,d=e.data,g=_b(e,s),S=Ar.parseMasterPlaylist(d,g);if(S.playlistParsingError){i.parsing.end=performance.now(),this.handleManifestParsingError(e,s,S.playlistParsingError,o,i);return}const{contentSteering:v,levels:E,sessionData:b,sessionKeys:R,startTimeOffset:_,variableList:D}=S;this.variableList=D,E.forEach(B=>{const{unknownCodecs:z}=B;if(z){const{preferManagedMediaSource:G}=this.hls.config;let{audioCodec:K,videoCodec:ae}=B;for(let q=z.length;q--;){const Z=z[q];Zg(Z,"audio",G)?(B.audioCodec=K=K?`${K},${Z}`:Z,gh.audio[K.substring(0,4)]=2,z.splice(q,1)):Zg(Z,"video",G)&&(B.videoCodec=ae=ae?`${ae},${Z}`:Z,gh.video[ae.substring(0,4)]=2,z.splice(q,1))}}});const{AUDIO:I=[],SUBTITLES:M,"CLOSED-CAPTIONS":w}=Ar.parseMasterPlaylistMedia(d,g,S);I.length&&!I.some(z=>!z.url)&&E[0].audioCodec&&!E[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),I.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new _n({}),bitrate:0,url:""})),u.trigger(O.MANIFEST_LOADED,{levels:E,audioTracks:I,subtitles:M,captions:w,contentSteering:v,url:g,stats:i,networkDetails:o,sessionData:b,sessionKeys:R,startTimeOffset:_,variableList:D})}handleTrackOrLevelPlaylist(e,i,s,o,u){const d=this.hls,{id:g,level:S,type:v}=s,E=_b(e,s),b=Ue(S)?S:Ue(g)?g:0,R=oD(s),_=Ar.parseLevelPlaylist(e.data,E,b,R,0,this.variableList);if(v===xt.MANIFEST){const D={attrs:new _n({}),bitrate:0,details:_,name:"",url:E};_.requestScheduled=i.loading.start+CA(_,0),d.trigger(O.MANIFEST_LOADED,{levels:[D],audioTracks:[],url:E,stats:i,networkDetails:o,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}i.parsing.end=performance.now(),s.levelDetails=_,this.handlePlaylistLoaded(_,e,i,s,o,u)}handleManifestParsingError(e,i,s,o,u){this.hls.trigger(O.ERROR,{type:je.NETWORK_ERROR,details:re.MANIFEST_PARSING_ERROR,fatal:i.type===xt.MANIFEST,url:e.url,err:s,error:s,reason:s.message,response:e,context:i,networkDetails:o,stats:u})}handleNetworkError(e,i,s=!1,o,u){let d=`A network ${s?"timeout":"error"+(o?" (status "+o.code+")":"")} occurred while loading ${e.type}`;e.type===xt.LEVEL?d+=`: ${e.level} id: ${e.id}`:(e.type===xt.AUDIO_TRACK||e.type===xt.SUBTITLE_TRACK)&&(d+=` id: ${e.id} group-id: "${e.groupId}"`);const g=new Error(d);this.hls.logger.warn(`[playlist-loader]: ${d}`);let S=re.UNKNOWN,v=!1;const E=this.getInternalLoader(e);switch(e.type){case xt.MANIFEST:S=s?re.MANIFEST_LOAD_TIMEOUT:re.MANIFEST_LOAD_ERROR,v=!0;break;case xt.LEVEL:S=s?re.LEVEL_LOAD_TIMEOUT:re.LEVEL_LOAD_ERROR,v=!1;break;case xt.AUDIO_TRACK:S=s?re.AUDIO_TRACK_LOAD_TIMEOUT:re.AUDIO_TRACK_LOAD_ERROR,v=!1;break;case xt.SUBTITLE_TRACK:S=s?re.SUBTITLE_TRACK_LOAD_TIMEOUT:re.SUBTITLE_LOAD_ERROR,v=!1;break}E&&this.resetInternalLoader(e.type);const b={type:je.NETWORK_ERROR,details:S,fatal:v,url:e.url,loader:E,context:e,error:g,networkDetails:i,stats:u};if(o){const R=(i==null?void 0:i.url)||e.url;b.response=Qt({url:R,data:void 0},o)}this.hls.trigger(O.ERROR,b)}handlePlaylistLoaded(e,i,s,o,u,d){const g=this.hls,{type:S,level:v,levelOrTrack:E,id:b,groupId:R,deliveryDirectives:_}=o,D=_b(i,o),I=oD(o);let M=typeof o.level=="number"&&I===Be.MAIN?v:void 0;const w=e.playlistParsingError;if(w){if(this.hls.logger.warn(`${w} ${e.url}`),!g.config.ignorePlaylistParsingErrors){g.trigger(O.ERROR,{type:je.NETWORK_ERROR,details:re.LEVEL_PARSING_ERROR,fatal:!1,url:D,error:w,reason:w.message,response:i,context:o,level:M,parent:I,networkDetails:u,stats:s});return}e.playlistParsingError=null}if(!e.fragments.length){const B=e.playlistParsingError=new Error("No Segments found in Playlist");g.trigger(O.ERROR,{type:je.NETWORK_ERROR,details:re.LEVEL_EMPTY_ERROR,fatal:!1,url:D,error:B,reason:B.message,response:i,context:o,level:M,parent:I,networkDetails:u,stats:s});return}switch(e.live&&d&&(d.getCacheAge&&(e.ageHeader=d.getCacheAge()||0),(!d.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),S){case xt.MANIFEST:case xt.LEVEL:if(M){if(!E)M=0;else if(E!==g.levels[M]){const B=g.levels.indexOf(E);B>-1&&(M=B)}}g.trigger(O.LEVEL_LOADED,{details:e,levelInfo:E||g.levels[0],level:M||0,id:b||0,stats:s,networkDetails:u,deliveryDirectives:_,withoutMultiVariant:S===xt.MANIFEST});break;case xt.AUDIO_TRACK:g.trigger(O.AUDIO_TRACK_LOADED,{details:e,track:E,id:b||0,groupId:R||"",stats:s,networkDetails:u,deliveryDirectives:_});break;case xt.SUBTITLE_TRACK:g.trigger(O.SUBTITLE_TRACK_LOADED,{details:e,track:E,id:b||0,groupId:R||"",stats:s,networkDetails:u,deliveryDirectives:_});break}}}class ys{static get version(){return n0}static isMSESupported(){return rD()}static isSupported(){return NI()}static getMediaSource(){return Nu()}static get Events(){return O}static get MetadataSchema(){return ms}static get ErrorTypes(){return je}static get ErrorDetails(){return re}static get DefaultConfig(){return ys.defaultConfig?ys.defaultConfig:bI}static set DefaultConfig(e){ys.defaultConfig=e}constructor(e={}){this.config=void 0,this.userConfig=void 0,this.logger=void 0,this.coreComponents=void 0,this.networkControllers=void 0,this._emitter=new jT,this._autoLevelCapping=-1,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.audioStreamController=void 0,this.subtititleStreamController=void 0,this.audioTrackController=void 0,this.subtitleTrackController=void 0,this.interstitialsController=void 0,this.gapController=void 0,this.emeController=void 0,this.cmcdController=void 0,this._media=null,this._url=null,this._sessionId=void 0,this.triggeringException=void 0,this.started=!1;const i=this.logger=K_(e.debug||!1,"Hls instance",e.assetPlayerId),s=this.config=AI(ys.DefaultConfig,e,i);this.userConfig=e,s.progressive&&RI(s,i);const{abrController:o,bufferController:u,capLevelController:d,errorController:g,fpsController:S}=s,v=new g(this),E=this.abrController=new o(this),b=new HC(this),R=s.interstitialsController,_=R?this.interstitialsController=new R(this,ys):null,D=this.bufferController=new u(this,b),I=this.capLevelController=new d(this),M=new S(this),w=new FI(this),B=s.contentSteeringController,z=B?new B(this):null,G=this.levelController=new wI(this,z),K=new MI(this),ae=new zI(this.config,this.logger),q=this.streamController=new BI(this,b,ae),Z=this.gapController=new CI(this,b);I.setStreamController(q),M.setStreamController(q);const te=[w,G,q];_&&te.splice(1,0,_),z&&te.splice(1,0,z),this.networkControllers=te;const $=[E,D,Z,I,M,K,b];this.audioTrackController=this.createController(s.audioTrackController,te);const me=s.audioStreamController;me&&te.push(this.audioStreamController=new me(this,b,ae)),this.subtitleTrackController=this.createController(s.subtitleTrackController,te);const Ee=s.subtitleStreamController;Ee&&te.push(this.subtititleStreamController=new Ee(this,b,ae)),this.createController(s.timelineController,$),ae.emeController=this.emeController=this.createController(s.emeController,$),this.cmcdController=this.createController(s.cmcdController,$),this.latencyController=this.createController(II,$),this.coreComponents=$,te.push(v);const De=v.onErrorOut;typeof De=="function"&&this.on(O.ERROR,De,v),this.on(O.MANIFEST_LOADED,w.onManifestLoaded,w)}createController(e,i){if(e){const s=new e(this);return i&&i.push(s),s}return null}on(e,i,s=this){this._emitter.on(e,i,s)}once(e,i,s=this){this._emitter.once(e,i,s)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,i,s=this,o){this._emitter.off(e,i,s,o)}listeners(e){return this._emitter.listeners(e)}emit(e,i,s){return this._emitter.emit(e,i,s)}trigger(e,i){if(this.config.debug)return this.emit(e,e,i);try{return this.emit(e,e,i)}catch(s){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+s.message+'". Here is a stacktrace:',s),!this.triggeringException){this.triggeringException=!0;const o=e===O.ERROR;this.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.INTERNAL_EXCEPTION,fatal:o,event:e,error:s}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(O.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(i=>i.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(i=>i.destroy()),this.coreComponents.length=0;const e=this.config;e.xhrSetup=e.fetchSetup=void 0,this.userConfig=null}attachMedia(e){if(!e||"media"in e&&!e.media){const u=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(O.ERROR,{type:je.OTHER_ERROR,details:re.ATTACH_MEDIA_ERROR,fatal:!0,error:u});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const i="media"in e,s=i?e.media:e,o=i?e:{media:s};this._media=s,this.trigger(O.MEDIA_ATTACHING,o)}detachMedia(){this.logger.log("detachMedia"),this.trigger(O.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(O.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const i=this.media,s=this._url,o=this._url=ST.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${o}`),i&&s&&(s!==o||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(i)),this.trigger(O.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,i){this.logger.log(`startLoad(${e+(i?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let s=0;s<this.networkControllers.length&&(this.networkControllers[s].startLoad(e,i),!(!this.started||!this.networkControllers));s++);}stopLoad(){this.logger.log("stopLoad"),this.started=!1;for(let e=0;e<this.networkControllers.length&&(this.networkControllers[e].stopLoad(),!(this.started||!this.networkControllers));e++);}get loadingEnabled(){return this.started}get bufferingEnabled(){return this.streamController.bufferingEnabled}resumeBuffering(){this.bufferingEnabled||(this.logger.log("resume buffering"),this.networkControllers.forEach(e=>{e.resumeBuffering&&e.resumeBuffering()}))}pauseBuffering(){this.bufferingEnabled&&(this.logger.log("pause buffering"),this.networkControllers.forEach(e=>{e.pauseBuffering&&e.pauseBuffering()}))}get inFlightFragments(){const e={[Be.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[Be.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[Be.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,i=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),i&&this.startLoad(i))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=CM()),e}get levels(){const e=this.levelController.levels;return e||[]}get latestLevelDetails(){return this.streamController.getLevelDetails()||null}get loadLevelObj(){return this.levelController.loadLevelObj}get currentLevel(){return this.streamController.currentLevel}set currentLevel(e){this.logger.log(`set currentLevel:${e}`),this.levelController.manualLevel=e,this.streamController.immediateLevelSwitch()}get nextLevel(){return this.streamController.nextLevel}set nextLevel(e){this.logger.log(`set nextLevel:${e}`),this.levelController.manualLevel=e,this.streamController.nextLevelSwitch()}get loadLevel(){return this.levelController.level}set loadLevel(e){this.logger.log(`set loadLevel:${e}`),this.levelController.manualLevel=e}get nextLoadLevel(){return this.levelController.nextLoadLevel}set nextLoadLevel(e){this.levelController.nextLoadLevel=e}get firstLevel(){return Math.max(this.levelController.firstLevel,this.minAutoLevel)}set firstLevel(e){this.logger.log(`set firstLevel:${e}`),this.levelController.firstLevel=e}get startLevel(){const e=this.levelController.startLevel;return e===-1&&this.abrController.forcedAutoLevel>-1?this.abrController.forcedAutoLevel:e}set startLevel(e){this.logger.log(`set startLevel:${e}`),e!==-1&&(e=Math.max(e,this.minAutoLevel)),this.levelController.startLevel=e}get capLevelToPlayerSize(){return this.config.capLevelToPlayerSize}set capLevelToPlayerSize(e){const i=!!e;i!==this.config.capLevelToPlayerSize&&(i?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=i)}get autoLevelCapping(){return this._autoLevelCapping}get bandwidthEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimate():NaN}set bandwidthEstimate(e){this.abrController.resetEstimator(e)}get abrEwmaDefaultEstimate(){const{bwEstimator:e}=this.abrController;return e?e.defaultEstimate:NaN}get ttfbEstimate(){const{bwEstimator:e}=this.abrController;return e?e.getEstimateTTFB():NaN}set autoLevelCapping(e){this._autoLevelCapping!==e&&(this.logger.log(`set autoLevelCapping:${e}`),this._autoLevelCapping=e,this.levelController.checkMaxAutoUpdated())}get maxHdcpLevel(){return this._maxHdcpLevel}set maxHdcpLevel(e){LC(e)&&this._maxHdcpLevel!==e&&(this._maxHdcpLevel=e,this.levelController.checkMaxAutoUpdated())}get autoLevelEnabled(){return this.levelController.manualLevel===-1}get manualLevel(){return this.levelController.manualLevel}get minAutoLevel(){const{levels:e,config:{minAutoBitrate:i}}=this;if(!e)return 0;const s=e.length;for(let o=0;o<s;o++)if(e[o].maxBitrate>=i)return o;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:i,maxHdcpLevel:s}=this;let o;if(i===-1&&e!=null&&e.length?o=e.length-1:o=i,s)for(let u=o;u--;){const d=e[u].attrs["HDCP-LEVEL"];if(d&&d<=s)return u}return o}get firstAutoLevel(){return this.abrController.firstAutoLevel}get nextAutoLevel(){return this.abrController.nextAutoLevel}set nextAutoLevel(e){this.abrController.nextAutoLevel=e}get playingDate(){return this.streamController.currentProgramDateTime}get mainForwardBufferInfo(){return this.streamController.getMainFwdBufferInfo()}get maxBufferLength(){return this.streamController.maxBufferLength}setAudioOption(e){var i;return((i=this.audioTrackController)==null?void 0:i.setAudioOption(e))||null}setSubtitleOption(e){var i;return((i=this.subtitleTrackController)==null?void 0:i.setSubtitleOption(e))||null}get allAudioTracks(){const e=this.audioTrackController;return e?e.allAudioTracks:[]}get audioTracks(){const e=this.audioTrackController;return e?e.audioTracks:[]}get audioTrack(){const e=this.audioTrackController;return e?e.audioTrack:-1}set audioTrack(e){const i=this.audioTrackController;i&&(i.audioTrack=e)}get allSubtitleTracks(){const e=this.subtitleTrackController;return e?e.allSubtitleTracks:[]}get subtitleTracks(){const e=this.subtitleTrackController;return e?e.subtitleTracks:[]}get subtitleTrack(){const e=this.subtitleTrackController;return e?e.subtitleTrack:-1}get media(){return this._media}set subtitleTrack(e){const i=this.subtitleTrackController;i&&(i.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const i=this.subtitleTrackController;i&&(i.subtitleDisplay=e)}get lowLatencyMode(){return this.config.lowLatencyMode}set lowLatencyMode(e){this.config.lowLatencyMode=e}get liveSyncPosition(){return this.latencyController.liveSyncPosition}get latency(){return this.latencyController.latency}get maxLatency(){return this.latencyController.maxLatency}get targetLatency(){return this.latencyController.targetLatency}set targetLatency(e){this.latencyController.targetLatency=e}get drift(){return this.latencyController.drift}get forceStartLoad(){return this.streamController.forceStartLoad}get pathways(){return this.levelController.pathways}get pathwayPriority(){return this.levelController.pathwayPriority}set pathwayPriority(e){this.levelController.pathwayPriority=e}get bufferedToEnd(){var e;return!!((e=this.bufferController)!=null&&e.bufferedToEnd)}get interstitialsManager(){var e;return((e=this.interstitialsController)==null?void 0:e.interstitialsManager)||null}getMediaDecodingInfo(e,i=this.allAudioTracks){const s=Hx(i);return zx(e,s,navigator.mediaCapabilities)}}ys.defaultConfig=void 0;class uD{constructor(){sn(this,"name","HlsPlugin");sn(this,"hls",null);sn(this,"core",null)}init(e){this.core=e,this.core.events.on("load",i=>{i.type==="hls"||i.url.includes(".m3u8")?ys.isSupported()?this.loadHls(i.url):this.core.video.canPlayType("application/vnd.apple.mpegurl")&&(this.core.video.src=i.url):this.hls&&(this.hls.destroy(),this.hls=null)}),this.core.events.on("quality-request",i=>{this.hls&&(this.hls.currentLevel=i)}),this.core.events.on("audio-track-request",i=>{this.hls&&(this.hls.audioTrack=i)})}loadHls(e){this.hls&&this.hls.destroy(),this.hls=new ys({autoStartLoad:!0,startLevel:-1,capLevelToPlayerSize:!0}),this.hls.loadSource(e),this.hls.attachMedia(this.core.video),this.hls.on(ys.Events.MANIFEST_PARSED,(i,s)=>{const o=s.levels.map((u,d)=>({height:u.height,bitrate:u.bitrate,index:d}));this.core.store.setState({qualityLevels:o})}),this.hls.on(ys.Events.AUDIO_TRACKS_UPDATED,(i,s)=>{const o=s.audioTracks.map((u,d)=>({label:u.name||u.lang||`Audio ${d+1}`,language:u.lang||"",index:d}));this.core.store.setState({audioTracks:o,currentAudioTrack:this.hls.audioTrack})}),this.hls.on(ys.Events.LEVEL_SWITCHED,(i,s)=>{}),this.hls.on(ys.Events.ERROR,(i,s)=>{if(s.fatal){const o=s.details||"Unknown HLS Error";this.core.triggerError(o,!0)}})}destroy(){this.hls&&(this.hls.destroy(),this.hls=null)}}const Cb=h=>{if(isNaN(h))return"00:00";const e=Math.floor(h/3600),i=Math.floor(h%3600/60),s=Math.floor(h%60);return e>0?`${e}:${i.toString().padStart(2,"0")}:${s.toString().padStart(2,"0")}`:`${i}:${s.toString().padStart(2,"0")}`},PI=async(h,e=3)=>{for(let i=0;i<e;i++)try{const s=await fetch(h);if(!s.ok)throw new Error(`HTTP ${s.status}`);return await s.text()}catch(s){if(i===e-1)throw s;await new Promise(o=>setTimeout(o,1e3))}throw new Error("Failed")},GI=async(h,e)=>{try{const s=(await PI(h)).split(`
317
+ `),o=[];let u=null,d=null;const g=h.substring(0,h.lastIndexOf("/")+1),S=v=>{const E=v.split(":");let b=0;return E.length===3?(b+=parseFloat(E[0])*3600,b+=parseFloat(E[1])*60,b+=parseFloat(E[2])):(b+=parseFloat(E[0])*60,b+=parseFloat(E[1])),b};for(let v of s)if(v=v.trim(),v.includes("-->")){const E=v.split("-->");u=S(E[0].trim()),d=S(E[1].trim())}else if(u!==null&&d!==null&&v.length>0){let[E,b]=v.split("#");!E.match(/^https?:\/\//)&&!E.startsWith("data:")&&(E=g+E);let R=0,_=0,D=0,I=0;if(b&&b.startsWith("xywh=")){const M=b.replace("xywh=","").split(",");M.length===4&&(R=parseInt(M[0]),_=parseInt(M[1]),D=parseInt(M[2]),I=parseInt(M[3]))}D>0&&I>0&&o.push({start:u,end:d,url:E,x:R,y:_,w:D,h:I}),u=null,d=null}return o}catch{return e({type:"warning",message:"Failed to load thumbnails",duration:4e3}),[]}},cD=(h,e=200)=>{const[i,s]=$e.useState(h),[o,u]=$e.useState(!1);return $e.useEffect(()=>{if(h)s(!0),requestAnimationFrame(()=>{requestAnimationFrame(()=>{u(!0)})});else{u(!1);const d=setTimeout(()=>{s(!1)},e);return()=>clearTimeout(d)}},[h,e]),{isMounted:i,isVisible:o}};/**
318
+ * @license lucide-react v0.474.0 - ISC
319
+ *
320
+ * This source code is licensed under the ISC license.
321
+ * See the LICENSE file in the root directory of this source tree.
322
+ */const $I=h=>h.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),fD=(...h)=>h.filter((e,i,s)=>!!e&&e.trim()!==""&&s.indexOf(e)===i).join(" ").trim();/**
323
+ * @license lucide-react v0.474.0 - ISC
324
+ *
325
+ * This source code is licensed under the ISC license.
326
+ * See the LICENSE file in the root directory of this source tree.
327
+ */var HI={xmlns:"http://www.w3.org/2000/svg",width:24,height:24,viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:2,strokeLinecap:"round",strokeLinejoin:"round"};/**
328
+ * @license lucide-react v0.474.0 - ISC
329
+ *
330
+ * This source code is licensed under the ISC license.
331
+ * See the LICENSE file in the root directory of this source tree.
332
+ */const jI=$e.forwardRef(({color:h="currentColor",size:e=24,strokeWidth:i=2,absoluteStrokeWidth:s,className:o="",children:u,iconNode:d,...g},S)=>$e.createElement("svg",{ref:S,...HI,width:e,height:e,stroke:h,strokeWidth:s?Number(i)*24/Number(e):i,className:fD("lucide",o),...g},[...d.map(([v,E])=>$e.createElement(v,E)),...Array.isArray(u)?u:[u]]));/**
333
+ * @license lucide-react v0.474.0 - ISC
334
+ *
335
+ * This source code is licensed under the ISC license.
336
+ * See the LICENSE file in the root directory of this source tree.
337
+ */const $t=(h,e)=>{const i=$e.forwardRef(({className:s,...o},u)=>$e.createElement(jI,{ref:u,iconNode:e,className:fD(`lucide-${$I(h)}`,s),...o}));return i.displayName=`${h}`,i};/**
338
+ * @license lucide-react v0.474.0 - ISC
339
+ *
340
+ * This source code is licensed under the ISC license.
341
+ * See the LICENSE file in the root directory of this source tree.
342
+ */const VI=$t("ArrowLeft",[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]]);/**
343
+ * @license lucide-react v0.474.0 - ISC
344
+ *
345
+ * This source code is licensed under the ISC license.
346
+ * See the LICENSE file in the root directory of this source tree.
347
+ */const YI=$t("Bold",[["path",{d:"M6 12h9a4 4 0 0 1 0 8H7a1 1 0 0 1-1-1V5a1 1 0 0 1 1-1h7a4 4 0 0 1 0 8",key:"mg9rjx"}]]);/**
348
+ * @license lucide-react v0.474.0 - ISC
349
+ *
350
+ * This source code is licensed under the ISC license.
351
+ * See the LICENSE file in the root directory of this source tree.
352
+ */const qI=$t("Captions",[["rect",{width:"18",height:"14",x:"3",y:"5",rx:"2",ry:"2",key:"12ruh7"}],["path",{d:"M7 15h4M15 15h2M7 11h2M13 11h4",key:"1ueiar"}]]);/**
353
+ * @license lucide-react v0.474.0 - ISC
354
+ *
355
+ * This source code is licensed under the ISC license.
356
+ * See the LICENSE file in the root directory of this source tree.
357
+ */const KI=$t("CaseUpper",[["path",{d:"m3 15 4-8 4 8",key:"1vwr6u"}],["path",{d:"M4 13h6",key:"1r9ots"}],["path",{d:"M15 11h4.5a2 2 0 0 1 0 4H15V7h4a2 2 0 0 1 0 4",key:"1sqfas"}]]);/**
358
+ * @license lucide-react v0.474.0 - ISC
359
+ *
360
+ * This source code is licensed under the ISC license.
361
+ * See the LICENSE file in the root directory of this source tree.
362
+ */const XI=$t("Cast",[["path",{d:"M2 8V6a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2v12a2 2 0 0 1-2 2h-6",key:"3zrzxg"}],["path",{d:"M2 12a9 9 0 0 1 8 8",key:"g6cvee"}],["path",{d:"M2 16a5 5 0 0 1 4 4",key:"1y1dii"}],["line",{x1:"2",x2:"2.01",y1:"20",y2:"20",key:"xu2jvo"}]]);/**
363
+ * @license lucide-react v0.474.0 - ISC
364
+ *
365
+ * This source code is licensed under the ISC license.
366
+ * See the LICENSE file in the root directory of this source tree.
367
+ */const QI=$t("Check",[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]]);/**
368
+ * @license lucide-react v0.474.0 - ISC
369
+ *
370
+ * This source code is licensed under the ISC license.
371
+ * See the LICENSE file in the root directory of this source tree.
372
+ */const ZI=$t("Clock",[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["polyline",{points:"12 6 12 12 16 14",key:"68esgv"}]]);/**
373
+ * @license lucide-react v0.474.0 - ISC
374
+ *
375
+ * This source code is licensed under the ISC license.
376
+ * See the LICENSE file in the root directory of this source tree.
377
+ */const JI=$t("Download",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"7 10 12 15 17 10",key:"2ggqvy"}],["line",{x1:"12",x2:"12",y1:"15",y2:"3",key:"1vk2je"}]]);/**
378
+ * @license lucide-react v0.474.0 - ISC
379
+ *
380
+ * This source code is licensed under the ISC license.
381
+ * See the LICENSE file in the root directory of this source tree.
382
+ */const WI=$t("Droplet",[["path",{d:"M12 22a7 7 0 0 0 7-7c0-2-1-3.9-3-5.5s-3.5-4-4-6.5c-.5 2.5-2 4.9-4 6.5C6 11.1 5 13 5 15a7 7 0 0 0 7 7z",key:"c7niix"}]]);/**
383
+ * @license lucide-react v0.474.0 - ISC
384
+ *
385
+ * This source code is licensed under the ISC license.
386
+ * See the LICENSE file in the root directory of this source tree.
387
+ */const ew=$t("Eye",[["path",{d:"M2.062 12.348a1 1 0 0 1 0-.696 10.75 10.75 0 0 1 19.876 0 1 1 0 0 1 0 .696 10.75 10.75 0 0 1-19.876 0",key:"1nclc0"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
388
+ * @license lucide-react v0.474.0 - ISC
389
+ *
390
+ * This source code is licensed under the ISC license.
391
+ * See the LICENSE file in the root directory of this source tree.
392
+ */const tw=$t("LoaderCircle",[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]]);/**
393
+ * @license lucide-react v0.474.0 - ISC
394
+ *
395
+ * This source code is licensed under the ISC license.
396
+ * See the LICENSE file in the root directory of this source tree.
397
+ */const nw=$t("Maximize",[["path",{d:"M8 3H5a2 2 0 0 0-2 2v3",key:"1dcmit"}],["path",{d:"M21 8V5a2 2 0 0 0-2-2h-3",key:"1e4gt3"}],["path",{d:"M3 16v3a2 2 0 0 0 2 2h3",key:"wsl5sc"}],["path",{d:"M16 21h3a2 2 0 0 0 2-2v-3",key:"18trek"}]]);/**
398
+ * @license lucide-react v0.474.0 - ISC
399
+ *
400
+ * This source code is licensed under the ISC license.
401
+ * See the LICENSE file in the root directory of this source tree.
402
+ */const iw=$t("Minimize",[["path",{d:"M8 3v3a2 2 0 0 1-2 2H3",key:"hohbtr"}],["path",{d:"M21 8h-3a2 2 0 0 1-2-2V3",key:"5jw1f3"}],["path",{d:"M3 16h3a2 2 0 0 1 2 2v3",key:"198tvr"}],["path",{d:"M16 21v-3a2 2 0 0 1 2-2h3",key:"ph8mxp"}]]);/**
403
+ * @license lucide-react v0.474.0 - ISC
404
+ *
405
+ * This source code is licensed under the ISC license.
406
+ * See the LICENSE file in the root directory of this source tree.
407
+ */const aw=$t("Minus",[["path",{d:"M5 12h14",key:"1ays0h"}]]);/**
408
+ * @license lucide-react v0.474.0 - ISC
409
+ *
410
+ * This source code is licensed under the ISC license.
411
+ * See the LICENSE file in the root directory of this source tree.
412
+ */const sw=$t("MoveVertical",[["path",{d:"M12 2v20",key:"t6zp3m"}],["path",{d:"m8 18 4 4 4-4",key:"bh5tu3"}],["path",{d:"m8 6 4-4 4 4",key:"ybng9g"}]]);/**
413
+ * @license lucide-react v0.474.0 - ISC
414
+ *
415
+ * This source code is licensed under the ISC license.
416
+ * See the LICENSE file in the root directory of this source tree.
417
+ */const lw=$t("Palette",[["circle",{cx:"13.5",cy:"6.5",r:".5",fill:"currentColor",key:"1okk4w"}],["circle",{cx:"17.5",cy:"10.5",r:".5",fill:"currentColor",key:"f64h9f"}],["circle",{cx:"8.5",cy:"7.5",r:".5",fill:"currentColor",key:"fotxhn"}],["circle",{cx:"6.5",cy:"12.5",r:".5",fill:"currentColor",key:"qy21gx"}],["path",{d:"M12 2C6.5 2 2 6.5 2 12s4.5 10 10 10c.926 0 1.648-.746 1.648-1.688 0-.437-.18-.835-.437-1.125-.29-.289-.438-.652-.438-1.125a1.64 1.64 0 0 1 1.668-1.668h1.996c3.051 0 5.555-2.503 5.555-5.554C21.965 6.012 17.461 2 12 2z",key:"12rzf8"}]]);/**
418
+ * @license lucide-react v0.474.0 - ISC
419
+ *
420
+ * This source code is licensed under the ISC license.
421
+ * See the LICENSE file in the root directory of this source tree.
422
+ */const rw=$t("Pause",[["rect",{x:"14",y:"4",width:"4",height:"16",rx:"1",key:"zuxfzm"}],["rect",{x:"6",y:"4",width:"4",height:"16",rx:"1",key:"1okwgv"}]]);/**
423
+ * @license lucide-react v0.474.0 - ISC
424
+ *
425
+ * This source code is licensed under the ISC license.
426
+ * See the LICENSE file in the root directory of this source tree.
427
+ */const ow=$t("PictureInPicture",[["path",{d:"M2 10h6V4",key:"zwrco"}],["path",{d:"m2 4 6 6",key:"ug085t"}],["path",{d:"M21 10V7a2 2 0 0 0-2-2h-7",key:"git5jr"}],["path",{d:"M3 14v2a2 2 0 0 0 2 2h3",key:"1f7fh3"}],["rect",{x:"12",y:"14",width:"10",height:"7",rx:"1",key:"1wjs3o"}]]);/**
428
+ * @license lucide-react v0.474.0 - ISC
429
+ *
430
+ * This source code is licensed under the ISC license.
431
+ * See the LICENSE file in the root directory of this source tree.
432
+ */const uw=$t("Play",[["polygon",{points:"6 3 20 12 6 21 6 3",key:"1oa8hb"}]]);/**
433
+ * @license lucide-react v0.474.0 - ISC
434
+ *
435
+ * This source code is licensed under the ISC license.
436
+ * See the LICENSE file in the root directory of this source tree.
437
+ */const cw=$t("Plus",[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]]);/**
438
+ * @license lucide-react v0.474.0 - ISC
439
+ *
440
+ * This source code is licensed under the ISC license.
441
+ * See the LICENSE file in the root directory of this source tree.
442
+ */const fw=$t("RefreshCcw",[["path",{d:"M21 12a9 9 0 0 0-9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"14sxne"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}],["path",{d:"M3 12a9 9 0 0 0 9 9 9.75 9.75 0 0 0 6.74-2.74L21 16",key:"1hlbsb"}],["path",{d:"M16 16h5v5",key:"ccwih5"}]]);/**
443
+ * @license lucide-react v0.474.0 - ISC
444
+ *
445
+ * This source code is licensed under the ISC license.
446
+ * See the LICENSE file in the root directory of this source tree.
447
+ */const dw=$t("RotateCcw",[["path",{d:"M3 12a9 9 0 1 0 9-9 9.75 9.75 0 0 0-6.74 2.74L3 8",key:"1357e3"}],["path",{d:"M3 3v5h5",key:"1xhq8a"}]]);/**
448
+ * @license lucide-react v0.474.0 - ISC
449
+ *
450
+ * This source code is licensed under the ISC license.
451
+ * See the LICENSE file in the root directory of this source tree.
452
+ */const hw=$t("RotateCw",[["path",{d:"M21 12a9 9 0 1 1-9-9c2.52 0 4.93 1 6.74 2.74L21 8",key:"1p45f6"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}]]);/**
453
+ * @license lucide-react v0.474.0 - ISC
454
+ *
455
+ * This source code is licensed under the ISC license.
456
+ * See the LICENSE file in the root directory of this source tree.
457
+ */const mw=$t("Settings",[["path",{d:"M12.22 2h-.44a2 2 0 0 0-2 2v.18a2 2 0 0 1-1 1.73l-.43.25a2 2 0 0 1-2 0l-.15-.08a2 2 0 0 0-2.73.73l-.22.38a2 2 0 0 0 .73 2.73l.15.1a2 2 0 0 1 1 1.72v.51a2 2 0 0 1-1 1.74l-.15.09a2 2 0 0 0-.73 2.73l.22.38a2 2 0 0 0 2.73.73l.15-.08a2 2 0 0 1 2 0l.43.25a2 2 0 0 1 1 1.73V20a2 2 0 0 0 2 2h.44a2 2 0 0 0 2-2v-.18a2 2 0 0 1 1-1.73l.43-.25a2 2 0 0 1 2 0l.15.08a2 2 0 0 0 2.73-.73l.22-.39a2 2 0 0 0-.73-2.73l-.15-.08a2 2 0 0 1-1-1.74v-.5a2 2 0 0 1 1-1.74l.15-.09a2 2 0 0 0 .73-2.73l-.22-.38a2 2 0 0 0-2.73-.73l-.15.08a2 2 0 0 1-2 0l-.43-.25a2 2 0 0 1-1-1.73V4a2 2 0 0 0-2-2z",key:"1qme2f"}],["circle",{cx:"12",cy:"12",r:"3",key:"1v7zrd"}]]);/**
458
+ * @license lucide-react v0.474.0 - ISC
459
+ *
460
+ * This source code is licensed under the ISC license.
461
+ * See the LICENSE file in the root directory of this source tree.
462
+ */const gw=$t("SlidersHorizontal",[["line",{x1:"21",x2:"14",y1:"4",y2:"4",key:"obuewd"}],["line",{x1:"10",x2:"3",y1:"4",y2:"4",key:"1q6298"}],["line",{x1:"21",x2:"12",y1:"12",y2:"12",key:"1iu8h1"}],["line",{x1:"8",x2:"3",y1:"12",y2:"12",key:"ntss68"}],["line",{x1:"21",x2:"16",y1:"20",y2:"20",key:"14d8ph"}],["line",{x1:"12",x2:"3",y1:"20",y2:"20",key:"m0wm8r"}],["line",{x1:"14",x2:"14",y1:"2",y2:"6",key:"14e1ph"}],["line",{x1:"8",x2:"8",y1:"10",y2:"14",key:"1i6ji0"}],["line",{x1:"16",x2:"16",y1:"18",y2:"22",key:"1lctlv"}]]);/**
463
+ * @license lucide-react v0.474.0 - ISC
464
+ *
465
+ * This source code is licensed under the ISC license.
466
+ * See the LICENSE file in the root directory of this source tree.
467
+ */const pw=$t("Type",[["polyline",{points:"4 7 4 4 20 4 20 7",key:"1nosan"}],["line",{x1:"9",x2:"15",y1:"20",y2:"20",key:"swin9y"}],["line",{x1:"12",x2:"12",y1:"4",y2:"20",key:"1tx1rr"}]]);/**
468
+ * @license lucide-react v0.474.0 - ISC
469
+ *
470
+ * This source code is licensed under the ISC license.
471
+ * See the LICENSE file in the root directory of this source tree.
472
+ */const yw=$t("Upload",[["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["polyline",{points:"17 8 12 3 7 8",key:"t8dd8p"}],["line",{x1:"12",x2:"12",y1:"3",y2:"15",key:"widbto"}]]);/**
473
+ * @license lucide-react v0.474.0 - ISC
474
+ *
475
+ * This source code is licensed under the ISC license.
476
+ * See the LICENSE file in the root directory of this source tree.
477
+ */const vw=$t("Users",[["path",{d:"M16 21v-2a4 4 0 0 0-4-4H6a4 4 0 0 0-4 4v2",key:"1yyitq"}],["circle",{cx:"9",cy:"7",r:"4",key:"nufk8"}],["path",{d:"M22 21v-2a4 4 0 0 0-3-3.87",key:"kshegd"}],["path",{d:"M16 3.13a4 4 0 0 1 0 7.75",key:"1da9ce"}]]);/**
478
+ * @license lucide-react v0.474.0 - ISC
479
+ *
480
+ * This source code is licensed under the ISC license.
481
+ * See the LICENSE file in the root directory of this source tree.
482
+ */const Sw=$t("Volume1",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}]]);/**
483
+ * @license lucide-react v0.474.0 - ISC
484
+ *
485
+ * This source code is licensed under the ISC license.
486
+ * See the LICENSE file in the root directory of this source tree.
487
+ */const Ew=$t("Volume2",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["path",{d:"M16 9a5 5 0 0 1 0 6",key:"1q6k2b"}],["path",{d:"M19.364 18.364a9 9 0 0 0 0-12.728",key:"ijwkga"}]]);/**
488
+ * @license lucide-react v0.474.0 - ISC
489
+ *
490
+ * This source code is licensed under the ISC license.
491
+ * See the LICENSE file in the root directory of this source tree.
492
+ */const Tw=$t("VolumeX",[["path",{d:"M11 4.702a.705.705 0 0 0-1.203-.498L6.413 7.587A1.4 1.4 0 0 1 5.416 8H3a1 1 0 0 0-1 1v6a1 1 0 0 0 1 1h2.416a1.4 1.4 0 0 1 .997.413l3.383 3.384A.705.705 0 0 0 11 19.298z",key:"uqj9uw"}],["line",{x1:"22",x2:"16",y1:"9",y2:"15",key:"1ewh16"}],["line",{x1:"16",x2:"22",y1:"9",y2:"15",key:"5ykzw1"}]]),dD=uw,hD=rw,bw=Ew,xw=Sw,Aw=Tw,Rw=nw,Dw=iw,Lw=mw,mD=QI,_w=ow,Cw=qI,Ow=JI,Mw=yw,Iw=VI,Ob=tw,ww=XI,Nw=vw,Uw=ZI,kw=aw,Bw=cw,zw=gw,Fw=pw,gD=lw,Pw=ew,Gw=sw,$w=fw,Hw=YI,jw=KI,Vw=WI,pD=({className:h})=>P.jsxs("div",{className:`relative flex items-center justify-center ${h}`,children:[P.jsx(dw,{className:"w-full h-full",strokeWidth:2}),P.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]",children:"10"})]}),yD=({className:h})=>P.jsxs("div",{className:`relative flex items-center justify-center ${h}`,children:[P.jsx(hw,{className:"w-full h-full",strokeWidth:2}),P.jsx("span",{className:"absolute inset-0 flex items-center justify-center text-[32%] font-bold select-none mt-[1px]",children:"10"})]}),Yw=({notifications:h})=>P.jsx("div",{className:"absolute top-4 left-4 z-50 flex flex-col gap-2 pointer-events-none font-sans",children:h.map(e=>P.jsxs("div",{className:`
493
+ bg-zinc-950/80 backdrop-blur-md border border-white/10 text-white px-4 py-3 rounded-lg shadow-xl text-sm font-medium flex items-center gap-3 animate-in slide-in-from-left-2 fade-in duration-300 max-w-sm
494
+ ${e.type==="error"?"border-red-500/50 text-red-100":""}
495
+ ${e.type==="warning"?"border-amber-500/50 text-amber-100":""}
496
+ `,children:[e.type==="loading"&&P.jsx(Ob,{className:"w-4 h-4 animate-spin text-[var(--accent)]"}),P.jsxs("div",{className:"flex flex-col gap-1 w-full",children:[P.jsx("span",{children:e.message}),typeof e.progress=="number"&&P.jsx("div",{className:"h-1 w-full bg-white/10 rounded-full overflow-hidden",children:P.jsx("div",{className:"h-full bg-[var(--accent)] transition-all duration-300",style:{width:`${e.progress}%`}})})]})]},e.id))}),qw=({cues:h,settings:e})=>{if(e.useNative||h.length===0)return null;const i=()=>{switch(e.textStyle){case"outline":return"0px 0px 4px black, 0px 0px 4px black";case"raised":return"0 -1px 1px black, 0 -2px 2px black";case"depressed":return"0 1px 1px white, 0 2px 2px black";case"shadow":return"2px 2px 2px rgba(0,0,0,0.8)";default:return"none"}};return P.jsx("div",{className:"absolute inset-x-0 flex flex-col items-center justify-end text-center z-10 pointer-events-none transition-all duration-200",style:{bottom:`${e.verticalOffset}px`},children:h.map((s,o)=>P.jsx("div",{className:"mb-1 inline-block max-w-[80%]",style:{fontSize:`${e.textSize}%`,color:e.textColor,fontWeight:e.isBold?"bold":"normal",textTransform:e.fixCapitalization?"capitalize":"none",textShadow:i(),lineHeight:1.4},children:P.jsx("span",{className:"px-2 py-0.5 rounded",style:{backgroundColor:`rgba(0, 0, 0, ${e.backgroundOpacity/100})`,backdropFilter:e.backgroundBlur?`blur(${e.backgroundBlurAmount}px)`:"none"},dangerouslySetInnerHTML:{__html:s}})},o))})},vD=({children:h,onClose:e,align:i="right",maxHeight:s,className:o})=>{const u=$e.useRef(null),d=i==="center"?"left-1/2 -translate-x-1/2 origin-bottom":"right-0 origin-bottom-right",g=s?{maxHeight:`${s}px`}:{};return P.jsx("div",{className:`absolute bottom-full mb-4 ${d} bg-[var(--bg-panel)] backdrop-blur-xl border-[length:var(--border-width)] border-white/10 shadow-2xl overflow-hidden w-[300px] max-w-[calc(100vw-32px)] text-sm z-50 ring-1 ring-white/5 font-[family-name:var(--font-main)] flex flex-col p-1.5 transition-all duration-300 ease-out ${o}`,style:{...g,borderRadius:"var(--radius-lg)"},onClick:S=>S.stopPropagation(),children:P.jsx("div",{className:"overflow-y-auto hide-scrollbar flex-1",style:{borderRadius:"var(--radius)"},children:P.jsx("div",{ref:u,children:h})})})},Li=({label:h,value:e,active:i,onClick:s,hasSubmenu:o,icon:u})=>P.jsxs("button",{onClick:s,className:"w-full flex items-center justify-between px-3 py-2.5 hover:bg-white/10 transition-colors text-left text-zinc-200 active:bg-white/5 focus:outline-none focus:bg-white/10 group overflow-hidden my-0.5",style:{borderRadius:"var(--radius)"},children:[P.jsxs("div",{className:"flex items-center gap-3 overflow-hidden",children:[u&&P.jsx("span",{className:"text-zinc-400 shrink-0 group-hover:text-zinc-300 transition-colors",children:u}),P.jsx("span",{className:`font-medium truncate text-sm ${i?"text-[var(--accent)]":""}`,title:h,children:h})]}),P.jsxs("div",{className:"flex items-center gap-2 text-zinc-400 shrink-0",children:[e&&P.jsx("span",{className:"text-xs font-medium truncate max-w-[60px]",title:e,children:e}),i&&P.jsx(mD,{className:"w-4 h-4 text-[var(--accent)] shrink-0"}),o&&P.jsx("span",{className:"text-xs group-hover:translate-x-0.5 transition-transform text-zinc-500 shrink-0",children:"›"})]})]}),Pu=({label:h,onBack:e,rightAction:i})=>P.jsxs("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:[P.jsxs("button",{className:"flex items-center gap-2 hover:text-white transition-colors focus:outline-none",onClick:e,children:[P.jsx(Iw,{className:"w-3 h-3"}),P.jsx("span",{children:h})]}),i]}),SD=()=>P.jsx("div",{className:"h-px bg-white/5 mx-2 my-1"}),$v=({label:h,checked:e,onChange:i,icon:s})=>P.jsxs("div",{className:"flex items-center justify-between py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[P.jsxs("div",{className:"flex items-center gap-3",children:[s&&P.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors",children:s}),P.jsx("span",{className:"text-sm text-zinc-300 font-medium group-hover:text-white transition-colors",children:h})]}),P.jsx("button",{onClick:()=>i(!e),className:`w-11 h-6 shrink-0 transition-colors relative focus:outline-none focus:ring-2 focus:ring-offset-2 focus:ring-offset-zinc-900 ${e?"bg-[var(--accent)]":"bg-zinc-700"}`,style:{"--tw-ring-color":"var(--accent)",borderRadius:"var(--radius-full)",borderWidth:"var(--border-width)",borderColor:"rgba(255,255,255,0.1)"},children:P.jsx("div",{className:`absolute top-1/2 -translate-y-1/2 left-0.5 bg-white w-4 h-4 transition-transform shadow-sm ${e?"translate-x-5":"translate-x-0"}`,style:{borderRadius:"var(--radius-full)"}})})]}),Hv=({label:h,value:e,min:i,max:s,step:o,onChange:u,formatValue:d,icon:g})=>P.jsxs("div",{className:"py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[P.jsxs("div",{className:"flex justify-between items-center mb-2",children:[P.jsxs("div",{className:"flex items-center gap-3",children:[g&&P.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors",children:g}),P.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:h})]}),P.jsx("span",{className:"text-[10px] font-mono font-medium text-zinc-300 bg-white/10 px-1.5 py-0.5 tabular-nums",style:{borderRadius:"var(--radius-sm)"},children:d?d(e):e})]}),P.jsxs("div",{className:"relative h-4 flex items-center px-1",children:[P.jsx("input",{type:"range",min:i,max:s,step:o,value:e,onChange:S=>u(parseFloat(S.target.value)),className:"w-full h-1.5 appearance-none cursor-pointer focus:outline-none focus:ring-2 strata-range-input",style:{borderRadius:"var(--radius-full)",background:`linear-gradient(to right, var(--accent) 0%, var(--accent) ${(e-i)/(s-i)*100}%, #3f3f46 ${(e-i)/(s-i)*100}%, #3f3f46 100%)`,"--tw-ring-color":"var(--accent)"}}),P.jsx("style",{children:`
497
+ .strata-range-input::-webkit-slider-thumb {
498
+ -webkit-appearance: none;
499
+ height: 14px;
500
+ width: 14px;
501
+ background: #ffffff;
502
+ cursor: pointer;
503
+ box-shadow: 0 1px 3px rgba(0,0,0,0.5);
504
+ transition: transform 0.1s;
505
+ border-radius: var(--radius-full);
506
+ border: var(--border-width) solid rgba(0,0,0,0.1);
507
+ }
508
+ .strata-range-input::-webkit-slider-thumb:hover {
509
+ transform: scale(1.1);
510
+ }
511
+ /* Pixel theme specific overrides are handled by global css */
512
+ `})]})]}),Kw=({label:h,value:e,options:i,onChange:s,icon:o})=>P.jsxs("div",{className:"py-2.5 px-3 hover:bg-white/5 group transition-colors",style:{borderRadius:"var(--radius)"},children:[P.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[o&&P.jsx("span",{className:"text-zinc-500 group-hover:text-zinc-400 transition-colors",children:o}),P.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:h})]}),P.jsxs("div",{className:"relative",children:[P.jsx("select",{value:e,onChange:u=>s(u.target.value),className:"w-full bg-zinc-800 border-[length:var(--border-width)] border-white/10 px-3 py-2 text-sm text-zinc-200 focus:outline-none focus:ring-2 appearance-none hover:bg-zinc-700 transition-colors cursor-pointer",style:{"--tw-ring-color":"var(--accent)",borderRadius:"var(--radius)"},children:i.map(u=>P.jsx("option",{value:u.value,children:u.label},u.value))}),P.jsx("div",{className:"absolute right-3 top-1/2 -translate-y-1/2 pointer-events-none text-zinc-400",children:P.jsx("svg",{width:"10",height:"6",viewBox:"0 0 10 6",fill:"none",xmlns:"http://www.w3.org/2000/svg",children:P.jsx("path",{d:"M1 1L5 5L9 1",stroke:"currentColor",strokeWidth:"1.5",strokeLinecap:"round",strokeLinejoin:"round"})})})]})]}),Df=({title:h,children:e})=>P.jsxs("div",{className:"py-2",children:[h&&P.jsx("h4",{className:"px-3 text-[10px] font-bold text-[var(--accent)] uppercase tracking-wider mb-1 mt-2",children:h}),P.jsx("div",{className:"space-y-0.5",children:e})]}),Xw=({tracks:h,current:e,onSelect:i,onUpload:s,onClose:o,settings:u,onSettingsChange:d,onReset:g,offset:S,maxHeight:v,animationClass:E})=>{const[b,R]=$e.useState("main"),_=$e.useRef(null);return P.jsxs(vD,{onClose:o,align:"right",maxHeight:v,className:E,children:[b==="main"&&P.jsxs("div",{className:"animate-in slide-in-from-left-4 fade-in duration-200",children:[P.jsx("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 rounded-lg",children:P.jsx("span",{children:"Subtitles"})}),P.jsxs("div",{children:[P.jsx(Li,{label:"Upload Subtitle",icon:P.jsx(Mw,{className:"w-4 h-4"}),onClick:()=>{var D;return(D=_.current)==null?void 0:D.click()}}),P.jsx("input",{type:"file",accept:".vtt,.srt",ref:_,className:"hidden",onChange:D=>{var I;(I=D.target.files)!=null&&I[0]&&s(D.target.files[0])}}),P.jsx(Li,{label:"Customize",icon:P.jsx(zw,{className:"w-4 h-4"}),onClick:()=>R("customize"),hasSubmenu:!0}),P.jsx("div",{className:"h-px bg-white/5 mx-2 my-1"}),P.jsx(Li,{label:"Off",active:e===-1,onClick:()=>{i(-1),o()}}),h.map(D=>P.jsx(Li,{label:D.label,value:D.language,active:e===D.index,onClick:()=>{i(D.index),o()}},D.index))]})]}),b==="customize"&&P.jsxs("div",{className:"animate-in slide-in-from-right-4 fade-in duration-200",children:[P.jsx(Pu,{label:"Customize",onBack:()=>R("main"),rightAction:P.jsx("button",{onClick:g,className:"p-1.5 text-zinc-400 hover:text-white transition-colors rounded-md hover:bg-white/10",title:"Reset All",children:P.jsx($w,{className:"w-4 h-4"})})}),P.jsxs("div",{className:"pb-1",children:[P.jsx(Df,{children:P.jsx($v,{label:"Native Video Subtitle",checked:u.useNative,onChange:D=>d({useNative:D})})}),!u.useNative&&P.jsxs(P.Fragment,{children:[P.jsxs(Df,{title:"Sync & Position",children:[P.jsxs("div",{className:"py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors",children:[P.jsx("div",{className:"flex justify-between items-center mb-2",children:P.jsxs("div",{className:"flex items-center gap-3",children:[P.jsx(Uw,{className:"w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors"}),P.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:"Sync Offset"})]})}),P.jsxs("div",{className:"flex items-center gap-2",children:[P.jsx("button",{onClick:()=>{const D=window._strataPlayer;D&&D.setSubtitleOffset(Math.round((S-.1)*10)/10)},className:"w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",children:P.jsx(kw,{className:"w-4 h-4"})}),P.jsxs("div",{className:"flex-1 bg-zinc-900 border border-white/5 rounded-lg h-8 flex items-center justify-center text-xs font-mono font-medium text-[var(--accent)]",children:[S>0?"+":"",(S==null?void 0:S.toFixed(1))||"0.0","s"]}),P.jsx("button",{onClick:()=>{const D=window._strataPlayer;D&&D.setSubtitleOffset(Math.round((S+.1)*10)/10)},className:"w-8 h-8 flex items-center justify-center bg-zinc-800 rounded-lg hover:bg-zinc-700 text-zinc-300 transition-colors active:scale-95",children:P.jsx(Bw,{className:"w-4 h-4"})})]})]}),P.jsx(Hv,{label:"Vertical Position",icon:P.jsx(Gw,{className:"w-4 h-4"}),value:u.verticalOffset,min:0,max:200,step:5,onChange:D=>d({verticalOffset:D}),formatValue:D=>`${D}px`})]}),P.jsxs(Df,{title:"Appearance",children:[P.jsx(Hv,{label:"Text Size",icon:P.jsx(Fw,{className:"w-4 h-4"}),value:u.textSize,min:50,max:200,step:10,onChange:D=>d({textSize:D}),formatValue:D=>`${D}%`}),P.jsxs("div",{className:"py-2.5 px-3 rounded-lg hover:bg-white/5 group transition-colors",children:[P.jsxs("div",{className:"flex items-center gap-3 mb-2",children:[P.jsx(gD,{className:"w-4 h-4 text-zinc-500 group-hover:text-zinc-400 transition-colors"}),P.jsx("span",{className:"text-xs font-bold text-zinc-400 uppercase tracking-wider group-hover:text-zinc-300 transition-colors",children:"Text Color"})]}),P.jsxs("div",{className:"flex items-center justify-between gap-2 p-1 bg-zinc-800/50 rounded-lg",children:[["#ffffff","#ffff00","#00ffff","#ff00ff","#ff0000","#00ff00"].map(D=>P.jsx("button",{onClick:()=>d({textColor:D}),className:`w-6 h-6 rounded-full border border-white/10 transition-transform hover:scale-110 ${u.textColor===D?"ring-2 scale-110":""}`,style:{backgroundColor:D,"--tw-ring-color":"var(--accent)"}},D)),P.jsx("div",{className:"w-px h-6 bg-white/10 mx-1"}),P.jsx("div",{className:"relative w-6 h-6 rounded-full overflow-hidden ring-1 ring-white/20 cursor-pointer",children:P.jsx("input",{type:"color",value:u.textColor,onChange:D=>d({textColor:D.target.value}),className:"absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"})})]})]}),P.jsx(Kw,{label:"Text Style",value:u.textStyle,options:[{label:"None",value:"none"},{label:"Outline",value:"outline"},{label:"Raised",value:"raised"},{label:"Depressed",value:"depressed"},{label:"Drop Shadow",value:"shadow"}],onChange:D=>d({textStyle:D})}),P.jsxs("div",{className:"grid grid-cols-2 gap-2 mt-1 px-1",children:[P.jsx($v,{label:"Bold",icon:P.jsx(Hw,{className:"w-4 h-4"}),checked:u.isBold,onChange:D=>d({isBold:D})}),P.jsx($v,{label:"Fix Caps",icon:P.jsx(jw,{className:"w-4 h-4"}),checked:u.fixCapitalization,onChange:D=>d({fixCapitalization:D})})]})]}),P.jsxs(Df,{title:"Background",children:[P.jsx(Hv,{label:"Opacity",icon:P.jsx(Pw,{className:"w-4 h-4"}),value:u.backgroundOpacity,min:0,max:100,step:5,onChange:D=>d({backgroundOpacity:D}),formatValue:D=>`${D}%`}),P.jsx($v,{label:"Blur Background",icon:P.jsx(Vw,{className:"w-4 h-4"}),checked:u.backgroundBlur,onChange:D=>d({backgroundBlur:D})}),u.backgroundBlur&&P.jsx(Hv,{label:"Blur Intensity",value:u.backgroundBlurAmount,min:0,max:20,step:1,onChange:D=>d({backgroundBlurAmount:D}),formatValue:D=>`${D}px`})]})]})]})]})]})},Qw=[{label:"Strata",value:"#6366f1"},{label:"Emerald",value:"#10b981"},{label:"Rose",value:"#f43f5e"},{label:"Amber",value:"#f59e0b"},{label:"Sky",value:"#0ea5e9"},{label:"Violet",value:"#8b5cf6"}],Zw=[{label:"Default",value:"default",color:"#6366f1"},{label:"Pixel",value:"pixel",color:"#ef4444"},{label:"Game",value:"game",color:"#eab308"},{label:"Hacker",value:"hacker",color:"#22c55e"}],Mb=h=>{var Lf,Zs,Si,Ka;const{src:e,sources:i,poster:s,autoPlay:o,thumbnails:u,textTracks:d,plugins:g,...S}=h,v=$e.useRef(null),[E,b]=$e.useState(null),[R,_]=$e.useState(!1),[D,I]=$e.useState(0),M=$e.useMemo(()=>hx(S),[]),w=$e.useSyncExternalStore($e.useCallback(ye=>E?E.store.subscribe(ye):()=>{},[E]),()=>E?E.store.get():M,()=>M),[B,z]=$e.useState(!0),[G,K]=$e.useState(!1),[ae,q]=$e.useState(!1),[Z,te]=$e.useState("main"),$=cD(G,200),me=cD(ae,200),[Ee,De]=$e.useState(!1),[Ie,Oe]=$e.useState(0),[F,ne]=$e.useState(!1),[le,xe]=$e.useState(!1),[_e,Q]=$e.useState([]),[de,Le]=$e.useState(null),[Ce,Fe]=$e.useState(0),[Ve,at]=$e.useState(null),[At,kt]=$e.useState(null),[vi,we]=$e.useState(null),ya=$e.useRef(null),Gi=$e.useRef(null),ei=$e.useRef(null),ja=$e.useRef(null);$e.useEffect(()=>{if(!v.current)return;const ye=new mx(S);window._strataPlayer=ye,g&&g.length>0?g.forEach(Ht=>ye.use(Ht)):ye.use(new uD),ye.attach(v.current),b(ye);const rt=new ResizeObserver(Ht=>{for(const Yn of Ht)I(Yn.contentRect.height)});return rt.observe(v.current),()=>{rt.disconnect(),ye.destroy(),b(null),window._strataPlayer=null}},[]),$e.useEffect(()=>{if(!E)return;const ye={};S.theme!==void 0&&S.theme!==w.theme&&(ye.theme=S.theme),S.themeColor!==void 0&&S.themeColor!==w.themeColor&&(ye.themeColor=S.themeColor),S.iconSize!==void 0&&S.iconSize!==w.iconSize&&(ye.iconSize=S.iconSize),Object.keys(ye).length>0&&E.setAppearance(ye),S.volume!==void 0&&Math.abs(S.volume-w.volume)>.01&&E.setVolume(S.volume),S.muted!==void 0&&S.muted!==w.isMuted&&(S.muted?E.video.muted=!0:E.video.muted=!1)},[E,S.theme,S.themeColor,S.iconSize,S.volume,S.muted]),$e.useEffect(()=>{if(!E)return;const ye=d||[];i&&i.length>0?(_(!1),E.setSources(i,ye)):e&&(_(!1),E.setSources([{url:e,type:"auto"}],ye))},[e,i,d,E]),$e.useEffect(()=>{},[E,s]),$e.useEffect(()=>{E&&o&&(E.video.muted=!0,E.store.setState({isMuted:!0}),E.play().catch(()=>{}))},[E,o]),$e.useEffect(()=>{w.isPlaying&&!R&&_(!0)},[w.isPlaying,R]),$e.useEffect(()=>{u&&E?GI(u,E.notify.bind(E)).then(ye=>Q(ye)):Q([])},[u,E]),$e.useEffect(()=>{const ye=rt=>{var Ht;if(E&&((Ht=document.activeElement)==null?void 0:Ht.tagName)!=="INPUT")switch(rt.key.toLowerCase()){case" ":case"k":rt.preventDefault(),E.togglePlay();break;case"arrowright":rt.preventDefault(),E.skip(5);break;case"arrowleft":rt.preventDefault(),E.skip(-5);break;case"arrowup":rt.preventDefault(),E.setVolume(E.video.volume+.1);break;case"arrowdown":rt.preventDefault(),E.setVolume(E.video.volume-.1);break;case"f":rt.preventDefault(),E.toggleFullscreen();break;case"m":rt.preventDefault(),E.toggleMute();break}};return window.addEventListener("keydown",ye),()=>window.removeEventListener("keydown",ye)},[E]);const Pe=()=>{z(!0),Gi.current&&clearTimeout(Gi.current),!(G||ae)&&(Gi.current=setTimeout(()=>{!w.isPlaying||G||ae||z(!1)},2500))};$e.useEffect(()=>{!G&&!ae&&w.isPlaying?Pe():(G||ae)&&(z(!0),Gi.current&&clearTimeout(Gi.current))},[G,ae,w.isPlaying]);const cn=ye=>{if(!ei.current||!w.duration)return 0;const rt=ei.current.getBoundingClientRect(),Ht="touches"in ye?ye.touches[0].clientX:ye.clientX;return Math.max(0,Math.min(1,(Ht-rt.left)/rt.width))*w.duration},zn=ye=>{De(!0),Oe(cn(ye));const rt=Yn=>Oe(cn(Yn)),Ht=Yn=>{E==null||E.seek(cn(Yn)),De(!1),document.removeEventListener("mousemove",rt),document.removeEventListener("touchmove",rt),document.removeEventListener("mouseup",Ht),document.removeEventListener("touchend",Ht)};document.addEventListener("mousemove",rt),document.addEventListener("touchmove",rt),document.addEventListener("mouseup",Ht),document.addEventListener("touchend",Ht)},la=ye=>{if(!ja.current)return 0;const rt=ja.current.getBoundingClientRect(),Ht="touches"in ye?ye.touches[0].clientX:ye.clientX;return Math.max(0,Math.min(1,(Ht-rt.left)/rt.width))},ut=ye=>{if(!E)return;ne(!0),E.setVolume(la(ye));const rt=Yn=>E.setVolume(la(Yn)),Ht=()=>{ne(!1),document.removeEventListener("mousemove",rt),document.removeEventListener("touchmove",rt),document.removeEventListener("mouseup",Ht),document.removeEventListener("touchend",Ht)};document.addEventListener("mousemove",rt),document.addEventListener("touchmove",rt),document.addEventListener("mouseup",Ht),document.addEventListener("touchend",Ht)},Va=ye=>{if(!w.duration)return;const rt=ye.currentTarget.getBoundingClientRect(),Ht=(ye.clientX-rt.left)/rt.width,Yn=Ht*w.duration;Fe(Ht*100),Le(Yn),_e.length>0&&at(_e.find($i=>Yn>=$i.start&&Yn<$i.end)||null)},Fn=ye=>{E&&(E.skip(ye==="forward"?10:-10),we(ye),setTimeout(()=>we(null),300))},jl=ye=>{if(G&&K(!1),ae&&q(!1),!E)return;const rt=ye.currentTarget.getBoundingClientRect(),Ht=ye.clientX-rt.left,Yn=rt.width,$i=Date.now();ya.current?(clearTimeout(ya.current),ya.current=null,Ht<Yn*.35?(Fn("rewind"),kt({type:"rewind",id:$i})):Ht>Yn*.65?(Fn("forward"),kt({type:"forward",id:$i})):E.toggleFullscreen()):ya.current=setTimeout(()=>{E.togglePlay(),ya.current=null},250)},fn=w.isMuted||w.volume===0?Aw:w.volume<.5?xw:bw,To=Math.max(100,D-120),Ya=()=>{switch(w.iconSize){case"small":return"w-4 h-4";case"large":return"w-6 h-6";default:return"w-5 h-5"}},Vl=()=>{switch(w.iconSize){case"small":return"p-1.5";case"large":return"p-2.5";default:return"p-2"}},Pn=Ya(),qa=Vl(),_i=(()=>{switch(w.iconSize){case"small":return{playBtn:"w-14 h-14",playIcon:"w-6 h-6",skipBtn:"w-10 h-10",skipIcon:"w-5 h-5"};case"large":return{playBtn:"w-24 h-24",playIcon:"w-12 h-12",skipBtn:"w-16 h-16",skipIcon:"w-8 h-8"};default:return{playBtn:"w-20 h-20",playIcon:"w-9 h-9",skipBtn:"w-12 h-12",skipIcon:"w-6 h-6"}}})();return P.jsxs("div",{ref:v,className:"group relative w-full h-full bg-black overflow-hidden select-none font-[family-name:var(--font-main)] outline-none touch-none rounded-[var(--radius)] text-zinc-100",onMouseMove:Pe,onMouseLeave:()=>{w.isPlaying&&!G&&!ae&&z(!1)},tabIndex:0,role:"region","aria-label":"Video Player","data-theme":w.theme,style:{"--accent":w.themeColor},children:[P.jsx("style",{children:`
513
+ [data-theme="default"] {
514
+ --radius: 0.75rem;
515
+ --radius-lg: 0.75rem;
516
+ --radius-sm: 0.375rem;
517
+ --radius-full: 9999px;
518
+ --font-main: "Inter", sans-serif;
519
+ --border-width: 0px;
520
+ --bg-panel: rgba(9, 9, 11, 0.95);
521
+ --tooltip-bg: #ffffff;
522
+ --tooltip-text: #000000;
523
+ --tooltip-border: 0px solid transparent;
524
+ }
525
+ [data-theme="pixel"] {
526
+ --radius: 0px;
527
+ --radius-lg: 0px;
528
+ --radius-sm: 0px;
529
+ --radius-full: 0px;
530
+ --font-main: "Press Start 2P", cursive;
531
+ --border-width: 2px;
532
+ --bg-panel: #000000;
533
+ --tooltip-bg: #000000;
534
+ --tooltip-text: #ffffff;
535
+ --tooltip-border: 2px solid #ffffff;
536
+ image-rendering: pixelated;
537
+ }
538
+ [data-theme="game"] {
539
+ --radius: 4px;
540
+ --radius-lg: 6px;
541
+ --radius-sm: 2px;
542
+ --radius-full: 4px;
543
+ --font-main: "Cinzel", serif;
544
+ --border-width: 1px;
545
+ --bg-panel: #0a0a0a;
546
+ --tooltip-bg: #1a1a1a;
547
+ --tooltip-text: #ffffff;
548
+ --tooltip-border: 1px solid var(--accent);
549
+ }
550
+ [data-theme="hacker"] {
551
+ --radius: 0px;
552
+ --radius-lg: 0px;
553
+ --radius-sm: 0px;
554
+ --radius-full: 0px;
555
+ --font-main: "JetBrains Mono", monospace;
556
+ --border-width: 1px;
557
+ --bg-panel: #000000;
558
+ --tooltip-bg: #000000;
559
+ --tooltip-text: var(--accent);
560
+ --tooltip-border: 1px solid var(--accent);
561
+ text-shadow: 0 0 5px var(--accent);
562
+ }
563
+
564
+ /* Specific Theme Overrides */
565
+ [data-theme="pixel"] .strata-control-btn {
566
+ border: 2px solid white;
567
+ background: black;
568
+ }
569
+ [data-theme="pixel"] .strata-control-btn:hover {
570
+ background: white;
571
+ color: black;
572
+ }
573
+ [data-theme="pixel"] .strata-range-input::-webkit-slider-thumb {
574
+ border-radius: 0 !important;
575
+ height: 16px !important;
576
+ width: 16px !important;
577
+ box-shadow: none !important;
578
+ }
579
+
580
+ [data-theme="hacker"] .strata-scanlines {
581
+ background: linear-gradient(
582
+ to bottom,
583
+ rgba(255,255,255,0),
584
+ rgba(255,255,255,0) 50%,
585
+ rgba(0,0,0,0.2) 50%,
586
+ rgba(0,0,0,0.2)
587
+ );
588
+ background-size: 100% 4px;
589
+ position: absolute;
590
+ inset: 0;
591
+ pointer-events: none;
592
+ z-index: 40;
593
+ }
594
+
595
+ .strata-tooltip {
596
+ background-color: var(--tooltip-bg);
597
+ color: var(--tooltip-text);
598
+ border: var(--tooltip-border);
599
+ border-radius: var(--radius-sm);
600
+ font-family: var(--font-main);
601
+ }
602
+ `}),w.theme==="hacker"&&P.jsx("div",{className:"strata-scanlines"}),!E&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center bg-zinc-950 z-50",children:P.jsx(Ob,{className:"w-10 h-10 text-[var(--accent)] animate-spin"})}),E&&P.jsxs(P.Fragment,{children:[P.jsx(Yw,{notifications:w.notifications}),P.jsx(qw,{cues:w.activeCues,settings:w.subtitleSettings}),P.jsx("div",{className:"absolute inset-0 z-0",onClick:jl,"aria-hidden":"true"}),s&&!R&&P.jsx("div",{className:"absolute inset-0 bg-cover bg-center z-[5] pointer-events-none",style:{backgroundImage:`url(${s})`}}),At&&P.jsx("div",{className:`absolute top-0 bottom-0 flex items-center justify-center w-[35%] z-20 bg-white/5 backdrop-blur-[1px] animate-out fade-out duration-500 ${At.type==="rewind"?"left-0 rounded-r-[4rem]":"right-0 rounded-l-[4rem]"}`,onAnimationEnd:()=>kt(null),children:P.jsxs("div",{className:"flex flex-col items-center text-white drop-shadow-lg",children:[At.type==="rewind"?P.jsx(pD,{className:"w-12 h-12 animate-pulse"}):P.jsx(yD,{className:"w-12 h-12 animate-pulse"}),P.jsx("span",{className:"font-bold text-sm mt-2 font-mono",children:At.type==="rewind"?"-10s":"+10s"})]})},At.id),w.isBuffering&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-20 pointer-events-none",children:P.jsx(Ob,{className:"w-12 h-12 text-[var(--accent)] animate-spin drop-shadow-lg"})}),w.error&&P.jsx("div",{className:"absolute inset-0 flex items-center justify-center z-30 bg-black/90 backdrop-blur-md animate-in fade-in",children:P.jsxs("div",{className:"flex flex-col items-center gap-4 text-red-500 p-8 max-w-md text-center",children:[P.jsx("span",{className:"text-5xl mb-2",children:"⚠️"}),P.jsx("h3",{className:"text-xl font-bold text-white",children:"Playback Error"}),P.jsx("p",{className:"text-zinc-400 text-sm",children:w.error}),P.jsx("button",{onClick:()=>E.load(E.store.get().sources[E.store.get().currentSourceIndex]||{url:e||""},d),className:"px-6 py-2 bg-[var(--accent)] text-white font-medium rounded-full hover:opacity-90 transition-opacity mt-4 shadow-lg",children:"Try Again"})]})}),(!w.isPlaying&&!w.isBuffering&&!w.error||B)&&!w.isBuffering?P.jsx("div",{className:`absolute inset-0 flex items-center justify-center z-10 transition-opacity duration-300 pointer-events-none ${B||!w.isPlaying?"opacity-100":"opacity-0"}`,children:P.jsxs("div",{className:"flex items-center gap-8 md:gap-16 pointer-events-auto",children:[P.jsx("button",{onClick:ye=>{ye.stopPropagation(),K(!1),q(!1),Fn("rewind")},className:`group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${_i.skipBtn}`,children:P.jsx(pD,{className:_i.skipIcon})}),P.jsx("button",{onClick:ye=>{ye.stopPropagation(),K(!1),q(!1),E.togglePlay()},className:`group relative flex items-center justify-center rounded-full bg-white/10 hover:bg-[var(--accent)] border border-white/10 shadow-2xl transition-all hover:scale-105 active:scale-110 duration-75 focus:outline-none backdrop-blur-md ${_i.playBtn}`,children:w.isPlaying?P.jsx(hD,{className:`${_i.playIcon} text-white fill-current`}):P.jsx(dD,{className:`${_i.playIcon} text-white ml-1 fill-current`})}),P.jsx("button",{onClick:ye=>{ye.stopPropagation(),K(!1),q(!1),Fn("forward")},className:`group flex items-center justify-center rounded-full bg-black/40 hover:bg-black/60 border border-white/10 transition-all active:scale-110 text-white/90 focus:outline-none backdrop-blur-sm ${_i.skipBtn}`,children:P.jsx(yD,{className:_i.skipIcon})})]})}):null,P.jsxs("div",{className:`absolute inset-x-0 bottom-0 z-30 transition-all duration-300 px-4 md:px-6 pb-4 md:pb-6 pt-24 bg-gradient-to-t from-black/95 via-black/70 to-transparent ${B?"opacity-100 translate-y-0":"opacity-0 translate-y-4"}`,onClick:ye=>{ye.target===ye.currentTarget&&(K(!1),q(!1)),ye.stopPropagation()},children:[P.jsxs("div",{ref:ei,className:"relative w-full h-3 group/slider mb-3 cursor-pointer touch-none flex items-center",onMouseMove:Va,onMouseLeave:()=>{Le(null),at(null)},onMouseDown:zn,onTouchStart:zn,children:[de!==null&&P.jsxs("div",{className:"absolute bottom-full mb-1.5 flex flex-col items-center transform -translate-x-1/2 z-40 pointer-events-none transition-opacity duration-150",style:{left:`clamp(70px, ${Ce}%, calc(100% - 70px))`},children:[Ve&&P.jsx("div",{className:"bg-black/90 border border-white/10 shadow-2xl overflow-hidden backdrop-blur-sm",style:{width:`${Ve.w*.5}px`,height:`${Ve.h*.5}px`,borderRadius:"var(--radius)"},children:P.jsx("div",{style:{backgroundImage:`url("${Ve.url}")`,width:`${Ve.w}px`,height:`${Ve.h}px`,backgroundPosition:`-${Ve.x}px -${Ve.y}px`,backgroundRepeat:"no-repeat",transform:"scale(0.5)",transformOrigin:"top left"}})}),P.jsx("div",{className:"strata-tooltip px-2 py-0.5 text-[11px] font-bold font-mono shadow-lg tabular-nums mt-1",children:Cb(de)})]}),P.jsxs("div",{className:"w-full h-1 bg-white/20 overflow-hidden relative backdrop-blur-sm border-[length:var(--border-width)] border-white/10",style:{borderRadius:"var(--radius-full)"},children:[w.duration>0&&w.buffered.map((ye,rt)=>P.jsx("div",{className:"absolute top-0 bottom-0 bg-white/20",style:{left:`${ye.start/w.duration*100}%`,width:`${(ye.end-ye.start)/w.duration*100}%`}},rt)),P.jsx("div",{className:"absolute left-0 top-0 bottom-0 bg-[var(--accent)]",style:{width:`${(Ee?Ie:w.currentTime)/w.duration*100}%`}})]}),P.jsx("div",{className:"absolute top-1/2 -translate-y-1/2 -translate-x-1/2 w-3.5 h-3.5 bg-white shadow-md scale-0 group-hover/slider:scale-100 transition-transform duration-100 z-10",style:{left:`${(Ee?Ie:w.currentTime)/w.duration*100}%`,borderRadius:"var(--radius-full)"}})]}),P.jsxs("div",{className:"flex items-center justify-between",children:[P.jsxs("div",{className:"flex items-center gap-3",children:[P.jsx("button",{onClick:()=>E.togglePlay(),className:`strata-control-btn text-zinc-300 hover:text-white transition-colors hover:bg-white/10 focus:outline-none ${qa}`,style:{borderRadius:"var(--radius)"},children:w.isPlaying?P.jsx(hD,{className:`${Pn} fill-current`}):P.jsx(dD,{className:`${Pn} fill-current`})}),P.jsxs("div",{className:"flex items-center gap-2 group/vol relative",onMouseEnter:()=>xe(!0),onMouseLeave:()=>xe(!1),children:[P.jsx("button",{onClick:()=>E.toggleMute(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 focus:outline-none ${qa}`,style:{borderRadius:"var(--radius)"},children:P.jsx(fn,{className:Pn})}),P.jsx("div",{className:`relative h-8 flex items-center transition-all duration-300 ease-out overflow-hidden ${le||F?"w-28 opacity-100 ml-1":"w-0 opacity-0"}`,children:P.jsxs("div",{ref:ja,className:"relative w-full h-full flex items-center cursor-pointer px-2",onMouseDown:ut,onTouchStart:ut,children:[P.jsx("div",{className:"w-full h-1 bg-white/20 overflow-hidden",style:{borderRadius:"var(--radius-full)"},children:P.jsx("div",{className:"h-full bg-white",style:{width:`${(w.isMuted?0:w.volume)*100}%`,borderRadius:"var(--radius-full)"}})}),P.jsx("div",{className:"absolute h-3 w-3 bg-white shadow-md top-1/2 -translate-y-1/2 pointer-events-none",style:{left:`calc(${(w.isMuted?0:w.volume)*100}% * 0.85 + 4px)`,borderRadius:"var(--radius-full)"}})]})}),(le||F)&&P.jsx("div",{className:"strata-tooltip absolute bottom-full mb-2 px-1.5 py-0.5 rounded text-[10px] font-bold font-mono shadow-lg pointer-events-none whitespace-nowrap z-50 transform -translate-x-1/2",style:{left:`calc(52px + ${(w.isMuted?0:w.volume)*80}px)`},children:w.isMuted?"0%":`${Math.round(w.volume*100)}%`})]}),P.jsxs("div",{className:"text-xs font-medium text-zinc-400 font-mono select-none hidden sm:block tabular-nums",children:[Cb(Ee?Ie:w.currentTime)," ",P.jsx("span",{className:"text-zinc-600",children:"/"})," ",Cb(w.duration)]})]}),P.jsxs("div",{className:"flex items-center gap-1",children:[P.jsxs("div",{className:"relative",children:[P.jsx("button",{onClick:ye=>{ye.stopPropagation(),q(!ae),K(!1)},className:`strata-control-btn transition-colors focus:outline-none ${qa} ${ae?"text-[var(--accent)] bg-white/10":"text-zinc-300 hover:text-white hover:bg-white/10"}`,style:{borderRadius:"var(--radius)"},children:P.jsx(Cw,{className:Pn})}),me.isMounted&&P.jsx(Xw,{tracks:w.subtitleTracks,current:w.currentSubtitle,onSelect:ye=>E.setSubtitle(ye),onUpload:ye=>E.addTextTrack(ye,ye.name),onClose:()=>q(!1),settings:w.subtitleSettings,onSettingsChange:ye=>E.updateSubtitleSettings(ye),onReset:()=>E.resetSubtitleSettings(),offset:w.subtitleOffset,maxHeight:To,animationClass:me.isVisible?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95"})]}),P.jsx("button",{onClick:()=>E.togglePip(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${qa}`,style:{borderRadius:"var(--radius)"},children:P.jsx(_w,{className:Pn})}),P.jsx("button",{onClick:()=>E.download(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 transition-colors hidden sm:block focus:outline-none ${qa}`,style:{borderRadius:"var(--radius)"},children:P.jsx(Ow,{className:Pn})}),P.jsxs("div",{className:"relative",children:[P.jsx("button",{onClick:ye=>{ye.stopPropagation(),K(!G),q(!1),te("main")},className:`strata-control-btn transition-all duration-300 focus:outline-none ${qa} ${G?"rotate-90 text-[var(--accent)] bg-white/10":"text-zinc-300 hover:text-white hover:bg-white/10"}`,style:{borderRadius:"var(--radius)"},children:P.jsx(Lw,{className:Pn})}),$.isMounted&&P.jsx(vD,{onClose:()=>K(!1),align:"right",maxHeight:To,className:$.isVisible?"opacity-100 translate-y-0 scale-100":"opacity-0 translate-y-2 scale-95",children:P.jsxs("div",{className:"w-full",children:[Z==="main"&&P.jsxs("div",{className:"animate-in slide-in-from-left-4 fade-in duration-200",children:[P.jsx("div",{className:"px-3 py-2 mb-1 border-b border-white/5 font-bold text-zinc-400 uppercase text-[11px] tracking-wider flex justify-between items-center bg-white/5 sticky top-0 z-10 backdrop-blur-md",style:{borderRadius:"var(--radius)"},children:P.jsx("span",{children:"Settings"})}),w.sources.length>1&&P.jsx(Li,{label:"Source",value:((Lf=w.sources[w.currentSourceIndex])==null?void 0:Lf.name)||`Source ${w.currentSourceIndex+1}`,onClick:()=>te("sources"),hasSubmenu:!0}),P.jsx(Li,{label:"Speed",value:`${w.playbackRate}x`,onClick:()=>te("speed"),hasSubmenu:!0}),P.jsx(Li,{label:"Quality",value:w.currentQuality===-1?"Auto":`${(Zs=w.qualityLevels[w.currentQuality])==null?void 0:Zs.height}p`,onClick:()=>te("quality"),hasSubmenu:!0}),P.jsx(Li,{label:"Audio",value:((Si=w.audioTracks[w.currentAudioTrack])==null?void 0:Si.label)||"Default",onClick:()=>te("audio"),hasSubmenu:!0}),P.jsx(Li,{label:"Audio Boost",value:w.audioGain>1?`${w.audioGain}x`:"Off",onClick:()=>te("boost"),hasSubmenu:!0}),P.jsx(SD,{}),P.jsx(Li,{label:"Watch Party",icon:P.jsx(Nw,{className:"w-4 h-4"}),onClick:()=>te("party"),hasSubmenu:!0}),P.jsx(Li,{label:"Cast to Device",icon:P.jsx(ww,{className:"w-4 h-4"}),onClick:()=>{E.requestCast(),K(!1)}}),P.jsx(SD,{}),P.jsx(Li,{label:"Appearance",icon:P.jsx(gD,{className:"w-4 h-4"}),onClick:()=>te("appearance"),hasSubmenu:!0})]}),["speed","quality","audio","boost","party","appearance","sources"].includes(Z)&&P.jsxs("div",{className:"animate-in slide-in-from-right-4 fade-in duration-200",children:[Z==="sources"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Select Source",onBack:()=>te("main")}),w.sources.map((ye,rt)=>P.jsx(Li,{label:ye.name||`Source ${rt+1}`,value:ye.type,active:w.currentSourceIndex===rt,onClick:()=>E.switchSource(rt)},rt))]}),Z==="speed"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Speed",onBack:()=>te("main")}),[.5,1,1.5,2].map(ye=>P.jsx(Li,{label:`${ye}x`,active:w.playbackRate===ye,onClick:()=>E.video.playbackRate=ye},ye))]}),Z==="quality"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Quality",onBack:()=>te("main")}),P.jsx(Li,{label:"Auto",active:w.currentQuality===-1,onClick:()=>E.setQuality(-1)}),w.qualityLevels.map(ye=>P.jsx(Li,{label:`${ye.height}p`,value:`${Math.round(ye.bitrate/1e3)}k`,active:w.currentQuality===ye.index,onClick:()=>E.setQuality(ye.index)},ye.index))]}),Z==="audio"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Audio Track",onBack:()=>te("main")}),w.audioTracks.length===0&&P.jsx("div",{className:"px-4 py-3 text-zinc-500 text-xs text-center",children:"No tracks available"}),w.audioTracks.map(ye=>P.jsx(Li,{label:ye.label,value:ye.language,active:w.currentAudioTrack===ye.index,onClick:()=>E.setAudioTrack(ye.index)},ye.index))]}),Z==="boost"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Audio Boost",onBack:()=>te("main")}),[1,1.5,2,3].map(ye=>P.jsx(Li,{label:ye===1?"Off":`${ye}x`,active:w.audioGain===ye,onClick:()=>E.setAudioGain(ye)},ye))]}),Z==="party"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Watch Party",onBack:()=>te("main")}),P.jsxs("div",{className:"p-4 space-y-3",children:[P.jsx("p",{className:"text-xs text-zinc-400 leading-relaxed",children:"Create a synchronized room on WatchParty.me to watch together."}),P.jsx("a",{href:`https://www.watchparty.me/create?video=${encodeURIComponent(((Ka=w.sources[w.currentSourceIndex])==null?void 0:Ka.url)||e||"")}`,target:"_blank",rel:"noopener noreferrer",className:"flex items-center justify-center w-full py-2.5 bg-[var(--accent)] hover:opacity-90 text-white font-medium transition-opacity text-xs",style:{borderRadius:"var(--radius)"},children:"Create Room"})]})]}),Z==="appearance"&&P.jsxs(P.Fragment,{children:[P.jsx(Pu,{label:"Appearance",onBack:()=>te("main")}),P.jsxs("div",{className:"pb-1",children:[P.jsx(Df,{title:"Theme",children:P.jsx("div",{className:"grid grid-cols-2 gap-2 px-3",children:Zw.map(ye=>P.jsx("button",{onClick:()=>E.setAppearance({theme:ye.value,themeColor:ye.color}),className:`py-2 text-xs font-bold uppercase tracking-wide transition-colors border-[length:var(--border-width)] border-white/10 ${w.theme===ye.value?"bg-[var(--accent)] text-white":"bg-white/5 text-zinc-400 hover:text-white"}`,style:{borderRadius:"var(--radius)"},children:ye.label},ye.value))})}),P.jsx(Df,{title:"Icon Size",children:P.jsx("div",{className:"grid grid-cols-3 gap-1 px-3",children:["small","medium","large"].map(ye=>P.jsx("button",{onClick:()=>E.setAppearance({iconSize:ye}),className:`py-1.5 text-xs font-medium transition-colors ${w.iconSize===ye?"bg-white text-black":"bg-white/5 text-zinc-400 hover:text-zinc-200"}`,style:{borderRadius:"var(--radius)"},children:ye.charAt(0).toUpperCase()+ye.slice(1)},ye))})}),P.jsxs(Df,{title:"Theme Color",children:[P.jsx("div",{className:"grid grid-cols-6 gap-2 px-3",children:Qw.map(ye=>P.jsx("button",{title:ye.label,onClick:()=>E.setAppearance({themeColor:ye.value}),className:`w-6 h-6 transition-transform hover:scale-110 ${w.themeColor===ye.value?"ring-2 ring-white scale-110":"ring-1 ring-white/10"}`,style:{backgroundColor:ye.value,borderRadius:"var(--radius-full)"},children:w.themeColor===ye.value&&P.jsx(mD,{className:"w-3 h-3 text-white mx-auto stroke-[3]"})},ye.value))}),P.jsx("div",{className:"px-3 pt-4",children:P.jsxs("div",{className:"flex items-center gap-3 bg-white/5 p-2 hover:bg-white/10 transition-colors group",style:{borderRadius:"var(--radius)"},children:[P.jsx("div",{className:"relative w-6 h-6 overflow-hidden ring-1 ring-white/20",style:{borderRadius:"var(--radius-full)"},children:P.jsx("input",{type:"color",value:w.themeColor,onChange:ye=>E.setAppearance({themeColor:ye.target.value}),className:"absolute inset-[-4px] w-[150%] h-[150%] cursor-pointer p-0 border-0"})}),P.jsx("span",{className:"text-xs text-zinc-400 font-medium group-hover:text-zinc-200",children:"Custom Color"}),P.jsx("span",{className:"text-[10px] font-mono text-zinc-500 ml-auto uppercase",children:w.themeColor})]})})]})]})]})]})]})})]}),P.jsx("button",{onClick:()=>E.toggleFullscreen(),className:`strata-control-btn text-zinc-300 hover:text-white hover:bg-white/10 rounded-lg transition-transform hover:scale-110 focus:outline-none ${qa}`,style:{borderRadius:"var(--radius)"},children:w.isFullscreen?P.jsx(Dw,{className:Pn}):P.jsx(Rw,{className:Pn})})]})]})]})]})]})},Jw=(h,e)=>{const i=N_.createRoot(h);return i.render($e.createElement(Mb,e)),{unmount:()=>{i.unmount()},update:s=>{i.render($e.createElement(Mb,{...e,...s}))}}};Bi.HlsPlugin=uD,Bi.StrataCore=mx,Bi.StrataPlayer=Mb,Bi.mountStrataPlayer=Jw,Object.defineProperty(Bi,Symbol.toStringTag,{value:"Module"})});
603
+ //# sourceMappingURL=strataplayer.umd.js.map