PageSourceSearch

https://radioshadow.space/assets/index-C1MiXcbt.js

js radioshadow.space collected 2026-10-09 22:04:25 UTC 3,341,191 bytes, 4,843 lines download raw bytes

vendor: 5,221 bytes, lines 1-17
1var Mne=Object.defineProperty;var Fne=(n,e,t)=>e in n?Mne(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t;var Ye=(n,e,t)=>Fne(n,typeof e!="symbol"?e+"":e,t);function Une(n,e){for(var t=0;t<e.length;t++){const r=e[t];if(typeof r!="string"&&!Array.isArray(r)){for(const s in r)if(s!=="default"&&!(s in n)){const a=Object.getOwnPropertyDescriptor(r,s);a&&Object.defineProperty(n,s,a.get?a:{enumerable:!0,get:()=>r[s]})}}}return Object.freeze(Object.defineProperty(n,Symbol.toStringTag,{value:"Module"}))}(function(){const e=document.createElement("link").relList;if(e&&e.supports&&e.supports("modulepreload"))return;for(const s of document.querySelectorAll('link[rel="modulepreload"]'))r(s);new MutationObserver(s=>{for(const a of s)if(a.type==="childList")for(const o of a.addedNodes)o.tagName==="LINK"&&o.rel==="modulepreload"&&r(o)}).observe(document,{childList:!0,subtree:!0});function t(s){const a={};return s.integrity&&(a.integrity=s.integrity),s.referrerPolicy&&(a.referrerPolicy=s.referrerPolicy),s.crossOrigin==="use-credentials"?a.credentials="include":s.crossOrigin==="anonymous"?a.credentials="omit":a.credentials="same-origin",a}function r(s){if(s.ep)return;s.ep=!0;const a=t(s);fetch(s.href,a)}})();function h$(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var lk={exports:{}},Yx={};/**
2 * @license React
3 * react-jsx-runtime.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 _M;function Vne(){if(_M)return Yx;_M=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.fragment");function t(r,s,a){var o=null;if(a!==void 0&&(o=""+a),s.key!==void 0&&(o=""+s.key),"key"in s){a={};for(var l in s)l!=="key"&&(a[l]=s[l])}else a=s;return s=a.ref,{$$typeof:n,type:r,key:o,ref:s!==void 0?s:null,props:a}}return Yx.Fragment=e,Yx.jsx=t,Yx.jsxs=t,Yx}var IM;function Gne(){return IM||(IM=1,lk.exports=Vne()),lk.exports}var i=Gne(),ck={exports:{}},Ht={};/**
10 * @license React
11 * react.production.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 DM;function $ne(){if(DM)return Ht;DM=1;var n=Symbol.for("react.transitional.element"),e=Symbol.for("react.portal"),t=Symbol.for("react.fragment"),r=Symbol.for("react.strict_mode"),s=Symbol.for("react.profiler"),a=Symbol.for("react.consumer"),o=Symbol.for("react.context"),l=Symbol.for("react.forward_ref"),c=Symbol.for("react.suspense"),d=Symbol.for("react.memo"),h=Symbol.for("react.lazy"),m=Symbol.for("react.activity"),p=Symbol.iterator;function x(H){return H===null||typeof H!="object"?null:(H=p&&H[p]||H["@@iterator"],typeof H=="function"?H:null)}var y={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},v=Object.assign,B={};function E(H,Y,de){this.props=H,this.context=Y,this.refs=B,this.updater=de||y}E.prototype.isReactComponent={},E.prototype.setState=function(H,Y){if(typeof H!="object"&&typeof H!="function"&&H!=null)throw Error("takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,H,Y,"setState")},E.prototype.forceUpdate=function(H){this.updater.enqueueForceUpdate(this,H,"forceUpdate")};function N(){}N.prototype=E.prototype;function T(H,Y,de){this.props=H,this.context=Y,this.refs=B,this.updater=de||y}var k=T.prototype=new N;k.constructor=T,v(k,E.prototype),k.isPureReactComponent=!0;var P=Array.isArray;function R(){}var _={H:null,A:null,T:null,S:null},I=Object.prototype.hasOwnProperty;function D(H,Y,de){var W=de.ref;return{$$typeof:n,type:H,key:Y,ref:W!==void 0?W:null,props:de}}function j(H,Y){return D(H.type,Y,H.props)}function O(H){return typeof H=="object"&&H!==null&&H.$$typeof===n}function M(H){var Y={"=":"=0",":":"=2"};return"$"+H.replace(/[=:]/g,function(de){return Y[de]})}var U=/\/+/g;function ee(H,Y){return typeof H=="object"&&H!==null&&H.key!=null?M(""+H.key):Y.toString(36)}function ie(H){switch(H.status){case"fulfilled":return H.value;case"rejected":throw H.reason;default:switch(typeof H.status=="string"?H.then(R,R):(H.status="pending",H.then(function(Y){H.status==="pending"&&(H.status="fulfilled",H.value=Y)},function(Y){H.status==="pending"&&(H.status="rejected",H.reason=Y)})),H.status){case"fulfilled":return H.value;case"rejected":throw H.reason}}throw H}function G(H,Y,de,W,K){var J=typeof H;(J==="undefined"||J==="boolean")&&(H=null);var oe=!1;if(H===null)oe=!0;else switch(J){case"bigint":case"string":case"number":oe=!0;break;case"object":switch(H.$$typeof){case n:case e:oe=!0;break;case h:return oe=H._init,G(oe(H._payload),Y,de,W,K)}}if(oe)return K=K(H),oe=W===""?"."+ee(H,0):W,P(K)?(de="",oe!=null&&(de=oe.replace(U,"$&/")+"/"),G(K,Y,de,"",function(ye){return ye})):K!=null&&(O(K)&&(K=j(K,de+(K.key==null||H&&H.key===K.key?"":(""+K.key).replace(U,"$&/")+"/")+oe)),Y.push(K)),1;oe=0;var Ie=W===""?".":W+":";if(P(H))for(var pe=0;pe<H.length;pe++)W=H[pe],J=Ie+ee(W,pe),oe+=G(W,Y,de,J,K);
vendor: 4,817 bytes, line 17
17else if(pe=x(H),typeof pe=="function")for(H=pe.call(H),pe=0;!(W=H.next()).done;)W=W.value,J=Ie+ee(W,pe++),oe+=G(W,Y,de,J,K);else if(J==="object"){if(typeof H.then=="function")return G(ie(H),Y,de,W,K);throw Y=String(H),Error("Objects are not valid as a React child (found: "+(Y==="[object Object]"?"object with keys {"+Object.keys(H).join(", ")+"}":Y)+"). If you meant to render a collection of children, use an array instead.")}return oe}function Z(H,Y,de){if(H==null)return H;var W=[],K=0;return G(H,W,"","",function(J){return Y.call(de,J,K++)}),W}function z(H){if(H._status===-1){var Y=H._result;Y=Y(),Y.then(function(de){(H._status===0||H._status===-1)&&(H._status=1,H._result=de)},function(de){(H._status===0||H._status===-1)&&(H._status=2,H._result=de)}),H._status===-1&&(H._status=0,H._result=Y)}if(H._status===1)return H._result.default;throw H._result}var se=typeof reportError=="function"?reportError:function(H){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var Y=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof H=="object"&&H!==null&&typeof H.message=="string"?String(H.message):String(H),error:H});if(!window.dispatchEvent(Y))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",H);return}console.error(H)},re={map:Z,forEach:function(H,Y,de){Z(H,function(){Y.apply(this,arguments)},de)},count:function(H){var Y=0;return Z(H,function(){Y++}),Y},toArray:function(H){return Z(H,function(Y){return Y})||[]},only:function(H){if(!O(H))throw Error("React.Children.only expected to receive a single React element child.");return H}};return Ht.Activity=m,Ht.Children=re,Ht.Component=E,Ht.Fragment=t,Ht.Profiler=s,Ht.PureComponent=T,Ht.StrictMode=r,Ht.Suspense=c,Ht.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=_,Ht.__COMPILER_RUNTIME={__proto__:null,c:function(H){return _.H.useMemoCache(H)}},Ht.cache=function(H){return function(){return H.apply(null,arguments)}},Ht.cacheSignal=function(){return null},Ht.cloneElement=function(H,Y,de){if(H==null)throw Error("The argument must be a React element, but you passed "+H+".");var W=v({},H.props),K=H.key;if(Y!=null)for(J in Y.key!==void 0&&(K=""+Y.key),Y)!I.call(Y,J)||J==="key"||J==="__self"||J==="__source"||J==="ref"&&Y.ref===void 0||(W[J]=Y[J]);var J=arguments.length-2;if(J===1)W.children=de;else if(1<J){for(var oe=Array(J),Ie=0;Ie<J;Ie++)oe[Ie]=arguments[Ie+2];W.children=oe}return D(H.type,K,W)},Ht.createContext=function(H){return H={$$typeof:o,_currentValue:H,_currentValue2:H,_threadCount:0,Provider:null,Consumer:null},H.Provider=H,H.Consumer={$$typeof:a,_context:H},H},Ht.createElement=function(H,Y,de){var W,K={},J=null;if(Y!=null)for(W in Y.key!==void 0&&(J=""+Y.key),Y)I.call(Y,W)&&W!=="key"&&W!=="__self"&&W!=="__source"&&(K[W]=Y[W]);var oe=arguments.length-2;if(oe===1)K.children=de;else if(1<oe){for(var Ie=Array(oe),pe=0;pe<oe;pe++)Ie[pe]=arguments[pe+2];K.children=Ie}if(H&&H.defaultProps)for(W in oe=H.defaultProps,oe)K[W]===void 0&&(K[W]=oe[W]);return D(H,J,K)},Ht.createRef=function(){return{current:null}},Ht.forwardRef=function(H){return{$$typeof:l,render:H}},Ht.isValidElement=O,Ht.lazy=function(H){return{$$typeof:h,_payload:{_status:-1,_result:H},_init:z}},Ht.memo=function(H,Y){return{$$typeof:d,type:H,compare:Y===void 0?null:Y}},Ht.startTransition=function(H){var Y=_.T,de={};_.T=de;try{var W=H(),K=_.S;K!==null&&K(de,W),typeof W=="object"&&W!==null&&typeof W.then=="function"&&W.then(R,se)}catch(J){se(J)}finally{Y!==null&&de.types!==null&&(Y.types=de.types),_.T=Y}},Ht.unstable_useCacheRefresh=function(){return _.H.useCacheRefresh()},Ht.use=function(H){return _.H.use(H)},Ht.useActionState=function(H,Y,de){return _.H.useActionState(H,Y,de)},Ht.useCallback=function(H,Y){return _.H.useCallback(H,Y)},Ht.useContext=function(H){return _.H.useContext(H)},Ht.useDebugValue=function(){},Ht.useDeferredValue=function(H,Y){return _.H.useDeferredValue(H,Y)},Ht.useEffect=function(H,Y){return _.H.useEffect(H,Y)},Ht.useEffectEvent=function(H){return _.H.useEffectEvent(H)},Ht.useId=function(){return _.H.useId()},Ht.useImperativeHandle=function(H,Y,de){return _.H.useImperativeHandle(H,Y,de)},Ht.useInsertionEffect=function(H,Y){return _.H.useInsertionEffect(H,Y)},Ht.useLayoutEffect=function(H,Y){return _.H.useLayoutEffect(H,Y)},Ht.useMemo=function(H,Y){return _.H.useMemo(H,Y)},Ht.useOptimistic=function(H,Y){return _.H.useOptimistic(H,Y)},Ht.useReducer=function(H,Y,de){return _.H.useReducer(H,Y,de)},Ht.useRef=function(H){return _.H.useRef(H)},Ht.useState=function(H){return _.H.useState(H)},Ht.useSyncExternalStore=function(H,Y,de){return _.H.useSyncExternalStore(H,Y,de)},Ht.useTransition=function(){return _.H.useTransition()},Ht.version="19.2.6",Ht}var jM;function kg(){return jM||(jM=1,ck.exports=$ne()),ck.exports}
vendor: 5,094 bytes, lines 17-33
17var S=kg();const Mn=h$(S),Hne=Une({__proto__:null,default:Mn},[S]);var dk={exports:{}},Qx={},uk={exports:{}},hk={};/**
18 * @license React
19 * scheduler.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 RM;function zne(){return RM||(RM=1,(function(n){function e(G,Z){var z=G.length;G.push(Z);e:for(;0<z;){var se=z-1>>>1,re=G[se];if(0<s(re,Z))G[se]=Z,G[z]=re,z=se;else break e}}function t(G){return G.length===0?null:G[0]}function r(G){if(G.length===0)return null;var Z=G[0],z=G.pop();if(z!==Z){G[0]=z;e:for(var se=0,re=G.length,H=re>>>1;se<H;){var Y=2*(se+1)-1,de=G[Y],W=Y+1,K=G[W];if(0>s(de,z))W<re&&0>s(K,de)?(G[se]=K,G[W]=z,se=W):(G[se]=de,G[Y]=z,se=Y);else if(W<re&&0>s(K,z))G[se]=K,G[W]=z,se=W;else break e}}return Z}function s(G,Z){var z=G.sortIndex-Z.sortIndex;return z!==0?z:G.id-Z.id}if(n.unstable_now=void 0,typeof performance=="object"&&typeof performance.now=="function"){var a=performance;n.unstable_now=function(){return a.now()}}else{var o=Date,l=o.now();n.unstable_now=function(){return o.now()-l}}var c=[],d=[],h=1,m=null,p=3,x=!1,y=!1,v=!1,B=!1,E=typeof setTimeout=="function"?setTimeout:null,N=typeof clearTimeout=="function"?clearTimeout:null,T=typeof setImmediate<"u"?setImmediate:null;function k(G){for(var Z=t(d);Z!==null;){if(Z.callback===null)r(d);else if(Z.startTime<=G)r(d),Z.sortIndex=Z.expirationTime,e(c,Z);else break;Z=t(d)}}function P(G){if(v=!1,k(G),!y)if(t(c)!==null)y=!0,R||(R=!0,M());else{var Z=t(d);Z!==null&&ie(P,Z.startTime-G)}}var R=!1,_=-1,I=5,D=-1;function j(){return B?!0:!(n.unstable_now()-D<I)}function O(){if(B=!1,R){var G=n.unstable_now();D=G;var Z=!0;try{e:{y=!1,v&&(v=!1,N(_),_=-1),x=!0;var z=p;try{t:{for(k(G),m=t(c);m!==null&&!(m.expirationTime>G&&j());){var se=m.callback;if(typeof se=="function"){m.callback=null,p=m.priorityLevel;var re=se(m.expirationTime<=G);if(G=n.unstable_now(),typeof re=="function"){m.callback=re,k(G),Z=!0;break t}m===t(c)&&r(c),k(G)}else r(c);m=t(c)}if(m!==null)Z=!0;else{var H=t(d);H!==null&&ie(P,H.startTime-G),Z=!1}}break e}finally{m=null,p=z,x=!1}Z=void 0}}finally{Z?M():R=!1}}}var M;if(typeof T=="function")M=function(){T(O)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,ee=U.port2;U.port1.onmessage=O,M=function(){ee.postMessage(null)}}else M=function(){E(O,0)};function ie(G,Z){_=E(function(){G(n.unstable_now())},Z)}n.unstable_IdlePriority=5,n.unstable_ImmediatePriority=1,n.unstable_LowPriority=4,n.unstable_NormalPriority=3,n.unstable_Profiling=null,n.unstable_UserBlockingPriority=2,n.unstable_cancelCallback=function(G){G.callback=null},n.unstable_forceFrameRate=function(G){0>G||125<G?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):I=0<G?Math.floor(1e3/G):5},n.unstable_getCurrentPriorityLevel=function(){return p},n.unstable_next=function(G){switch(p){case 1:case 2:case 3:var Z=3;break;default:Z=p}var z=p;p=Z;try{return G()}finally{p=z}},n.unstable_requestPaint=function(){B=!0},n.unstable_runWithPriority=function(G,Z){switch(G){case 1:case 2:case 3:case 4:case 5:break;default:G=3}var z=p;p=G;try{return Z()}finally{p=z}},n.unstable_scheduleCallback=function(G,Z,z){var se=n.unstable_now();switch(typeof z=="object"&&z!==null?(z=z.delay,z=typeof z=="number"&&0<z?se+z:se):z=se,G){case 1:var re=-1;break;case 2:re=250;break;case 5:re=1073741823;break;case 4:re=1e4;break;default:re=5e3}return re=z+re,G={id:h++,callback:Z,priorityLevel:G,startTime:z,expirationTime:re,sortIndex:-1},z>se?(G.sortIndex=z,e(d,G),t(c)===null&&G===t(d)&&(v?(N(_),_=-1):v=!0,ie(P,z-se))):(G.sortIndex=re,e(c,G),y||x||(y=!0,R||(R=!0,M()))),G},n.unstable_shouldYield=j,n.unstable_wrapCallback=function(G){var Z=p;return function(){var z=p;p=Z;try{return G.apply(this,arguments)}finally{p=z}}}})(hk)),hk}var PM;function qne(){return PM||(PM=1,uk.exports=zne()),uk.exports}var fk={exports:{}},Ga={};/**
26 * @license React
27 * react-dom.production.js
28 *
29 * Copyright (c) Meta Platforms, Inc. and affiliates.
30 *
31 * This source code is licensed under the MIT license found in the
32 * LICENSE file in the root directory of this source tree.
33 */var LM;function Kne(){if(LM)return Ga;LM=1;var n=kg();function e(c){var d="https://react.dev/errors/"+c;if(1<arguments.length){d+="?args[]="+encodeURIComponent(arguments[1]);for(var h=2;h<arguments.length;h++)d+="&args[]="+encodeURIComponent(arguments[h])}return"Minified React error #"+c+"; visit "+d+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function t(){}var r={d:{f:t,r:function(){throw Error(e(522))},D:t,C:t,L:t,m:t,X:t,S:t,M:t},p:0,findDOMNode:null},s=Symbol.for("react.portal");function a(c,d,h){var m=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:s,key:m==null?null:""+m,children:c,containerInfo:d,implementation:h}}var o=n.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE;function l(c,d){if(c==="font")return"";
vendor: 6,047 bytes, lines 33-41
33if(typeof d=="string")return d==="use-credentials"?d:""}return Ga.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE=r,Ga.createPortal=function(c,d){var h=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!d||d.nodeType!==1&&d.nodeType!==9&&d.nodeType!==11)throw Error(e(299));return a(c,d,null,h)},Ga.flushSync=function(c){var d=o.T,h=r.p;try{if(o.T=null,r.p=2,c)return c()}finally{o.T=d,r.p=h,r.d.f()}},Ga.preconnect=function(c,d){typeof c=="string"&&(d?(d=d.crossOrigin,d=typeof d=="string"?d==="use-credentials"?d:"":void 0):d=null,r.d.C(c,d))},Ga.prefetchDNS=function(c){typeof c=="string"&&r.d.D(c)},Ga.preinit=function(c,d){if(typeof c=="string"&&d&&typeof d.as=="string"){var h=d.as,m=l(h,d.crossOrigin),p=typeof d.integrity=="string"?d.integrity:void 0,x=typeof d.fetchPriority=="string"?d.fetchPriority:void 0;h==="style"?r.d.S(c,typeof d.precedence=="string"?d.precedence:void 0,{crossOrigin:m,integrity:p,fetchPriority:x}):h==="script"&&r.d.X(c,{crossOrigin:m,integrity:p,fetchPriority:x,nonce:typeof d.nonce=="string"?d.nonce:void 0})}},Ga.preinitModule=function(c,d){if(typeof c=="string")if(typeof d=="object"&&d!==null){if(d.as==null||d.as==="script"){var h=l(d.as,d.crossOrigin);r.d.M(c,{crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0})}}else d==null&&r.d.M(c)},Ga.preload=function(c,d){if(typeof c=="string"&&typeof d=="object"&&d!==null&&typeof d.as=="string"){var h=d.as,m=l(h,d.crossOrigin);r.d.L(c,h,{crossOrigin:m,integrity:typeof d.integrity=="string"?d.integrity:void 0,nonce:typeof d.nonce=="string"?d.nonce:void 0,type:typeof d.type=="string"?d.type:void 0,fetchPriority:typeof d.fetchPriority=="string"?d.fetchPriority:void 0,referrerPolicy:typeof d.referrerPolicy=="string"?d.referrerPolicy:void 0,imageSrcSet:typeof d.imageSrcSet=="string"?d.imageSrcSet:void 0,imageSizes:typeof d.imageSizes=="string"?d.imageSizes:void 0,media:typeof d.media=="string"?d.media:void 0})}},Ga.preloadModule=function(c,d){if(typeof c=="string")if(d){var h=l(d.as,d.crossOrigin);r.d.m(c,{as:typeof d.as=="string"&&d.as!=="script"?d.as:void 0,crossOrigin:h,integrity:typeof d.integrity=="string"?d.integrity:void 0})}else r.d.m(c)},Ga.requestFormReset=function(c){r.d.r(c)},Ga.unstable_batchedUpdates=function(c,d){return c(d)},Ga.useFormState=function(c,d,h){return o.H.useFormState(c,d,h)},Ga.useFormStatus=function(){return o.H.useHostTransitionStatus()},Ga.version="19.2.6",Ga}var OM;function f$(){if(OM)return fk.exports;OM=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),fk.exports=Kne(),fk.exports}/**
34 * @license React
35 * react-dom-client.production.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 MM;function Wne(){if(MM)return Qx;MM=1;var n=qne(),e=kg(),t=f$();function r(u){var f="https://react.dev/errors/"+u;if(1<arguments.length){f+="?args[]="+encodeURIComponent(arguments[1]);for(var g=2;g<arguments.length;g++)f+="&args[]="+encodeURIComponent(arguments[g])}return"Minified React error #"+u+"; visit "+f+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}function s(u){return!(!u||u.nodeType!==1&&u.nodeType!==9&&u.nodeType!==11)}function a(u){var f=u,g=u;if(u.alternate)for(;f.return;)f=f.return;else{u=f;do f=u,(f.flags&4098)!==0&&(g=f.return),u=f.return;while(u)}return f.tag===3?g:null}function o(u){if(u.tag===13){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function l(u){if(u.tag===31){var f=u.memoizedState;if(f===null&&(u=u.alternate,u!==null&&(f=u.memoizedState)),f!==null)return f.dehydrated}return null}function c(u){if(a(u)!==u)throw Error(r(188))}function d(u){var f=u.alternate;if(!f){if(f=a(u),f===null)throw Error(r(188));return f!==u?null:u}for(var g=u,b=f;;){var C=g.return;if(C===null)break;var A=C.alternate;if(A===null){if(b=C.return,b!==null){g=b;continue}break}if(C.child===A.child){for(A=C.child;A;){if(A===g)return c(C),u;if(A===b)return c(C),f;A=A.sibling}throw Error(r(188))}if(g.return!==b.return)g=C,b=A;else{for(var F=!1,q=C.child;q;){if(q===g){F=!0,g=C,b=A;break}if(q===b){F=!0,b=C,g=A;break}q=q.sibling}if(!F){for(q=A.child;q;){if(q===g){F=!0,g=A,b=C;break}if(q===b){F=!0,b=A,g=C;break}q=q.sibling}if(!F)throw Error(r(189))}}if(g.alternate!==b)throw Error(r(190))}if(g.tag!==3)throw Error(r(188));return g.stateNode.current===g?u:f}function h(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u;for(u=u.child;u!==null;){if(f=h(u),f!==null)return f;u=u.sibling}return null}var m=Object.assign,p=Symbol.for("react.element"),x=Symbol.for("react.transitional.element"),y=Symbol.for("react.portal"),v=Symbol.for("react.fragment"),B=Symbol.for("react.strict_mode"),E=Symbol.for("react.profiler"),N=Symbol.for("react.consumer"),T=Symbol.for("react.context"),k=Symbol.for("react.forward_ref"),P=Symbol.for("react.suspense"),R=Symbol.for("react.suspense_list"),_=Symbol.for("react.memo"),I=Symbol.for("react.lazy"),D=Symbol.for("react.activity"),j=Symbol.for("react.memo_cache_sentinel"),O=Symbol.iterator;function M(u){return u===null||typeof u!="object"?null:(u=O&&u[O]||u["@@iterator"],typeof u=="function"?u:null)}var U=Symbol.for("react.client.reference");function ee(u){if(u==null)return null;if(typeof u=="function")return u.$$typeof===U?null:u.displayName||u.name||null;if(typeof u=="string")return u;switch(u){case v:return"Fragment";case E:return"Profiler";case B:return"StrictMode";case P:return"Suspense";case R:return"SuspenseList";case D:return"Activity"}if(typeof u=="object")switch(u.$$typeof){case y:return"Portal";case T:return u.displayName||"Context";case N:return(u._context.displayName||"Context")+".Consumer";case k:var f=u.render;
vendor: 4,640 bytes, lines 41-48
41return u=u.displayName,u||(u=f.displayName||f.name||"",u=u!==""?"ForwardRef("+u+")":"ForwardRef"),u;case _:return f=u.displayName||null,f!==null?f:ee(u.type)||"Memo";case I:f=u._payload,u=u._init;try{return ee(u(f))}catch{}}return null}var ie=Array.isArray,G=e.__CLIENT_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,Z=t.__DOM_INTERNALS_DO_NOT_USE_OR_WARN_USERS_THEY_CANNOT_UPGRADE,z={pending:!1,data:null,method:null,action:null},se=[],re=-1;function H(u){return{current:u}}function Y(u){0>re||(u.current=se[re],se[re]=null,re--)}function de(u,f){re++,se[re]=u.current,u.current=f}var W=H(null),K=H(null),J=H(null),oe=H(null);function Ie(u,f){switch(de(J,f),de(K,u),de(W,null),f.nodeType){case 9:case 11:u=(u=f.documentElement)&&(u=u.namespaceURI)?ZO(u):0;break;default:if(u=f.tagName,f=f.namespaceURI)f=ZO(f),u=eM(f,u);else switch(u){case"svg":u=1;break;case"math":u=2;break;default:u=0}}Y(W),de(W,u)}function pe(){Y(W),Y(K),Y(J)}function ye(u){u.memoizedState!==null&&de(oe,u);var f=W.current,g=eM(f,u.type);f!==g&&(de(K,u),de(W,g))}function he(u){K.current===u&&(Y(W),Y(K)),oe.current===u&&(Y(oe),zx._currentValue=z)}var le,ce;function Ce(u){if(le===void 0)try{throw Error()}catch(g){var f=g.stack.trim().match(/\n( *(at )?)/);le=f&&f[1]||"",ce=-1<g.stack.indexOf(`
42    at`)?" (<anonymous>)":-1<g.stack.indexOf("@")?"@unknown:0:0":""}return`
43`+le+u+ce}var Ae=!1;function je(u,f){if(!u||Ae)return"";Ae=!0;var g=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{var b={DetermineComponentFrameRoot:function(){try{if(f){var $e=function(){throw Error()};if(Object.defineProperty($e.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct($e,[])}catch(Pe){var _e=Pe}Reflect.construct(u,[],$e)}else{try{$e.call()}catch(Pe){_e=Pe}u.call($e.prototype)}}else{try{throw Error()}catch(Pe){_e=Pe}($e=u())&&typeof $e.catch=="function"&&$e.catch(function(){})}}catch(Pe){if(Pe&&_e&&typeof Pe.stack=="string")return[Pe.stack,_e.stack]}return[null,null]}};b.DetermineComponentFrameRoot.displayName="DetermineComponentFrameRoot";var C=Object.getOwnPropertyDescriptor(b.DetermineComponentFrameRoot,"name");C&&C.configurable&&Object.defineProperty(b.DetermineComponentFrameRoot,"name",{value:"DetermineComponentFrameRoot"});var A=b.DetermineComponentFrameRoot(),F=A[0],q=A[1];if(F&&q){var ae=F.split(`
44`),Ne=q.split(`
45`);for(C=b=0;b<ae.length&&!ae[b].includes("DetermineComponentFrameRoot");)b++;for(;C<Ne.length&&!Ne[C].includes("DetermineComponentFrameRoot");)C++;if(b===ae.length||C===Ne.length)for(b=ae.length-1,C=Ne.length-1;1<=b&&0<=C&&ae[b]!==Ne[C];)C--;for(;1<=b&&0<=C;b--,C--)if(ae[b]!==Ne[C]){if(b!==1||C!==1)do if(b--,C--,0>C||ae[b]!==Ne[C]){var Ue=`
46`+ae[b].replace(" at new "," at ");return u.displayName&&Ue.includes("<anonymous>")&&(Ue=Ue.replace("<anonymous>",u.displayName)),Ue}while(1<=b&&0<=C);break}}}finally{Ae=!1,Error.prepareStackTrace=g}return(g=u?u.displayName||u.name:"")?Ce(g):""}function nt(u,f){switch(u.tag){case 26:case 27:case 5:return Ce(u.type);case 16:return Ce("Lazy");case 13:return u.child!==f&&f!==null?Ce("Suspense Fallback"):Ce("Suspense");case 19:return Ce("SuspenseList");case 0:case 15:return je(u.type,!1);case 11:return je(u.type.render,!1);case 1:return je(u.type,!0);case 31:return Ce("Activity");default:return""}}function We(u){try{var f="",g=null;do f+=nt(u,g),g=u,u=u.return;while(u);return f}catch(b){return`
47Error generating stack: `+b.message+`
48`+b.stack}}var dt=Object.prototype.hasOwnProperty,bt=n.unstable_scheduleCallback,Yt=n.unstable_cancelCallback,Gt=n.unstable_shouldYield,En=n.unstable_requestPaint,$t=n.unstable_now,ds=n.unstable_getCurrentPriorityLevel,sa=n.unstable_ImmediatePriority,Fa=n.unstable_UserBlockingPriority,Mr=n.unstable_NormalPriority,es=n.unstable_LowPriority,us=n.unstable_IdlePriority,Vs=n.log,Xi=n.unstable_setDisableYieldValue,ts=null,Fr=null;function As(u){if(typeof Vs=="function"&&Xi(u),Fr&&typeof Fr.setStrictMode=="function")try{Fr.setStrictMode(ts,u)}catch{}}var Qn=Math.clz32?Math.clz32:Zi,hl=Math.log,xa=Math.LN2;function Zi(u){return u>>>=0,u===0?32:31-(hl(u)/xa|0)|0}var Ur=256,ks=262144,Bn=4194304;function Ar(u){var f=u&42;if(f!==0)return f;switch(u&-u){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 u&261888;case 262144:case 524288:case 1048576:case 2097152:return u&3932160;case 4194304:case 8388608:case 16777216:case 33554432:return u&62914560;case 67108864:return 67108864;
vendor: 10,564 bytes, line 48
48case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 0;default:return u}}function Pn(u,f,g){var b=u.pendingLanes;if(b===0)return 0;var C=0,A=u.suspendedLanes,F=u.pingedLanes;u=u.warmLanes;var q=b&134217727;return q!==0?(b=q&~A,b!==0?C=Ar(b):(F&=q,F!==0?C=Ar(F):g||(g=q&~u,g!==0&&(C=Ar(g))))):(q=b&~A,q!==0?C=Ar(q):F!==0?C=Ar(F):g||(g=b&~u,g!==0&&(C=Ar(g)))),C===0?0:f!==0&&f!==C&&(f&A)===0&&(A=C&-C,g=f&-f,A>=g||A===32&&(g&4194048)!==0)?f:C}function aa(u,f){return(u.pendingLanes&~(u.suspendedLanes&~u.pingedLanes)&f)===0}function si(u,f){switch(u){case 1:case 2:case 4:case 8:case 64:return f+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 f+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 bi(){var u=Bn;return Bn<<=1,(Bn&62914560)===0&&(Bn=4194304),u}function hs(u){for(var f=[],g=0;31>g;g++)f.push(u);return f}function ba(u,f){u.pendingLanes|=f,f!==268435456&&(u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0)}function fl(u,f,g,b,C,A){var F=u.pendingLanes;u.pendingLanes=g,u.suspendedLanes=0,u.pingedLanes=0,u.warmLanes=0,u.expiredLanes&=g,u.entangledLanes&=g,u.errorRecoveryDisabledLanes&=g,u.shellSuspendCounter=0;var q=u.entanglements,ae=u.expirationTimes,Ne=u.hiddenUpdates;for(g=F&~g;0<g;){var Ue=31-Qn(g),$e=1<<Ue;q[Ue]=0,ae[Ue]=-1;var _e=Ne[Ue];if(_e!==null)for(Ne[Ue]=null,Ue=0;Ue<_e.length;Ue++){var Pe=_e[Ue];Pe!==null&&(Pe.lane&=-536870913)}g&=~$e}b!==0&&Jn(u,b,0),A!==0&&C===0&&u.tag!==0&&(u.suspendedLanes|=A&~(F&~f))}function Jn(u,f,g){u.pendingLanes|=f,u.suspendedLanes&=~f;var b=31-Qn(f);u.entangledLanes|=f,u.entanglements[b]=u.entanglements[b]|1073741824|g&261930}function ge(u,f){var g=u.entangledLanes|=f;for(u=u.entanglements;g;){var b=31-Qn(g),C=1<<b;C&f|u[b]&f&&(u[b]|=f),g&=~C}}function et(u,f){var g=f&-f;return g=(g&42)!==0?1:xe(g),(g&(u.suspendedLanes|f))!==0?0:g}function xe(u){switch(u){case 2:u=1;break;case 8:u=4;break;case 32:u=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:u=128;break;case 268435456:u=134217728;break;default:u=0}return u}function wn(u){return u&=-u,2<u?8<u?(u&134217727)!==0?32:268435456:8:2}function ht(){var u=Z.p;return u!==0?u:(u=window.event,u===void 0?32:CM(u.type))}function mn(u,f){var g=Z.p;try{return Z.p=u,f()}finally{Z.p=g}}var ya=Math.random().toString(36).slice(2),Xn="__reactFiber$"+ya,Sn="__reactProps$"+ya,va="__reactContainer$"+ya,In="__reactEvents$"+ya,yr="__reactListeners$"+ya,kr="__reactHandles$"+ya,fs="__reactResources$"+ya,ns="__reactMarker$"+ya;function Io(u){delete u[Xn],delete u[Sn],delete u[In],delete u[yr],delete u[kr]}function Ba(u){var f=u[Xn];if(f)return f;for(var g=u.parentNode;g;){if(f=g[va]||g[Xn]){if(g=f.alternate,f.child!==null||g!==null&&g.child!==null)for(u=oM(u);u!==null;){if(g=u[Xn])return g;u=oM(u)}return f}u=g,g=u.parentNode}return null}function Ns(u){if(u=u[Xn]||u[va]){var f=u.tag;if(f===5||f===6||f===13||f===31||f===26||f===27||f===3)return u}return null}function or(u){var f=u.tag;if(f===5||f===26||f===27||f===6)return u.stateNode;throw Error(r(33))}function yi(u){var f=u[fs];return f||(f=u[fs]={hoistableStyles:new Map,hoistableScripts:new Map}),f}function vr(u){u[ns]=!0}var ml=new Set,Kl={};function ai(u,f){qt(u,f),qt(u+"Capture",f)}function qt(u,f){for(Kl[u]=f,u=0;u<f.length;u++)ml.add(f[u])}var uu=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]*$"),ms={},wa={};function Ua(u){return dt.call(wa,u)?!0:dt.call(ms,u)?!1:uu.test(u)?wa[u]=!0:(ms[u]=!0,!1)}function Wl(u,f,g){if(Ua(f))if(g===null)u.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":u.removeAttribute(f);return;case"boolean":var b=f.toLowerCase().slice(0,5);if(b!=="data-"&&b!=="aria-"){u.removeAttribute(f);return}}u.setAttribute(f,""+g)}}function ps(u,f,g){if(g===null)u.removeAttribute(f);else{switch(typeof g){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(f);return}u.setAttribute(f,""+g)}}function lr(u,f,g,b){if(b===null)u.removeAttribute(g);else{switch(typeof b){case"undefined":case"function":case"symbol":case"boolean":u.removeAttribute(g);return}u.setAttributeNS(f,g,""+b)}}function Vr(u){switch(typeof u){case"bigint":case"boolean":case"number":case"string":case"undefined":return u;case"object":return u;default:return""}}function vi(u){var f=u.type;return(u=u.nodeName)&&u.toLowerCase()==="input"&&(f==="checkbox"||f==="radio")}function Va(u,f,g){var b=Object.getOwnPropertyDescriptor(u.constructor.prototype,f);if(!u.hasOwnProperty(f)&&typeof b<"u"&&typeof b.get=="function"&&typeof b.set=="function"){var C=b.get,A=b.set;return Object.defineProperty(u,f,{configurable:!0,get:function(){return C.call(this)},set:function(F){g=""+F,A.call(this,F)}}),Object.defineProperty(u,f,{enumerable:b.enumerable}),{getValue:function(){return g},setValue:function(F){g=""+F},stopTracking:function(){u._valueTracker=null,delete u[f]}}}}function pn(u){if(!u._valueTracker){var f=vi(u)?"checked":"value";u._valueTracker=Va(u,f,""+u[f])}}function Bi(u){if(!u)return!1;var f=u._valueTracker;if(!f)return!0;var g=f.getValue(),b="";return u&&(b=vi(u)?u.checked?"true":"false":u.value),u=b,u!==g?(f.setValue(u),!0):!1}function Ca(u){if(u=u||(typeof document<"u"?document:void 0),typeof u>"u")return null;try{return u.activeElement||u.body}catch{return u.body}}var wi=/[\n"\\]/g;function Br(u){return u.replace(wi,function(f){return"\\"+f.charCodeAt(0).toString(16)+" "})}function eo(u,f,g,b,C,A,F,q){u.name="",F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"?u.type=F:u.removeAttribute("type"),f!=null?F==="number"?(f===0&&u.value===""||u.value!=f)&&(u.value=""+Vr(f)):u.value!==""+Vr(f)&&(u.value=""+Vr(f)):F!=="submit"&&F!=="reset"||u.removeAttribute("value"),f!=null?tt(u,F,Vr(f)):g!=null?tt(u,F,Vr(g)):b!=null&&u.removeAttribute("value"),C==null&&A!=null&&(u.defaultChecked=!!A),C!=null&&(u.checked=C&&typeof C!="function"&&typeof C!="symbol"),q!=null&&typeof q!="function"&&typeof q!="symbol"&&typeof q!="boolean"?u.name=""+Vr(q):u.removeAttribute("name")}function Yl(u,f,g,b,C,A,F,q){if(A!=null&&typeof A!="function"&&typeof A!="symbol"&&typeof A!="boolean"&&(u.type=A),f!=null||g!=null){if(!(A!=="submit"&&A!=="reset"||f!=null)){pn(u);return}g=g!=null?""+Vr(g):"",f=f!=null?""+Vr(f):g,q||f===u.value||(u.value=f),u.defaultValue=f}b=b??C,b=typeof b!="function"&&typeof b!="symbol"&&!!b,u.checked=q?u.checked:!!b,u.defaultChecked=!!b,F!=null&&typeof F!="function"&&typeof F!="symbol"&&typeof F!="boolean"&&(u.name=F),pn(u)}function tt(u,f,g){f==="number"&&Ca(u.ownerDocument)===u||u.defaultValue===""+g||(u.defaultValue=""+g)}function ft(u,f,g,b){if(u=u.options,f){f={};for(var C=0;C<g.length;C++)f["$"+g[C]]=!0;for(g=0;g<u.length;g++)C=f.hasOwnProperty("$"+u[g].value),u[g].selected!==C&&(u[g].selected=C),C&&b&&(u[g].defaultSelected=!0)}else{for(g=""+Vr(g),f=null,C=0;C<u.length;C++){if(u[C].value===g){u[C].selected=!0,b&&(u[C].defaultSelected=!0);return}f!==null||u[C].disabled||(f=u[C])}f!==null&&(f.selected=!0)}}function yt(u,f,g){if(f!=null&&(f=""+Vr(f),f!==u.value&&(u.value=f),g==null)){u.defaultValue!==f&&(u.defaultValue=f);return}u.defaultValue=g!=null?""+Vr(g):""}function lt(u,f,g,b){if(f==null){if(b!=null){if(g!=null)throw Error(r(92));if(ie(b)){if(1<b.length)throw Error(r(93));b=b[0]}g=b}g==null&&(g=""),f=g}g=Vr(f),u.defaultValue=g,b=u.textContent,b===g&&b!==""&&b!==null&&(u.value=b),pn(u)}function Ln(u,f){if(f){var g=u.firstChild;if(g&&g===u.lastChild&&g.nodeType===3){g.nodeValue=f;return}}u.textContent=f}var Dn=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 Rt(u,f,g){var b=f.indexOf("--")===0;g==null||typeof g=="boolean"||g===""?b?u.setProperty(f,""):f==="float"?u.cssFloat="":u[f]="":b?u.setProperty(f,g):typeof g!="number"||g===0||Dn.has(f)?f==="float"?u.cssFloat=g:u[f]=(""+g).trim():u[f]=g+"px"}function Et(u,f,g){if(f!=null&&typeof f!="object")throw Error(r(62));if(u=u.style,g!=null){for(var b in g)!g.hasOwnProperty(b)||f!=null&&f.hasOwnProperty(b)||(b.indexOf("--")===0?u.setProperty(b,""):b==="float"?u.cssFloat="":u[b]="");for(var C in f)b=f[C],f.hasOwnProperty(C)&&g[C]!==b&&Rt(u,C,b)}else for(var A in f)f.hasOwnProperty(A)&&Rt(u,A,f[A])}function Gr(u){if(u.indexOf("-")===-1)return!1;switch(u){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 Yr=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"],["colorRen
48dering","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"]]),pl=/^[\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 Qc(u){return pl.test(""+u)?"javascript:throw new Error('React has blocked a javascript: URL as a security precaution.')":u}function Ci(){}var Jc=null;function Ut(u){return u=u.target||u.srcElement||window,u.correspondingUseElement&&(u=u.correspondingUseElement),u.nodeType===3?u.parentNode:u}var Ei=null,Si=null;function Ql(u){var f=Ns(u);if(f&&(u=f.stateNode)){var g=u[Sn]||null;e:switch(u=f.stateNode,f.type){case"input":if(eo(u,g.value,g.defaultValue,g.defaultValue,g.checked,g.defaultChecked,g.type,g.name),f=g.name,g.type==="radio"&&f!=null){for(g=u;g.parentNode;)g=g.parentNode;for(g=g.querySelectorAll('input[name="'+Br(""+f)+'"][type="radio"]'),f=0;f<g.length;f++){var b=g[f];if(b!==u&&b.form===u.form){var C=b[Sn]||null;if(!C)throw Error(r(90));eo(b,C.value,C.defaultValue,C.defaultValue,C.checked,C.defaultChecked,C.type,C.name)}}for(f=0;f<g.length;f++)b=g[f],b.form===u.form&&Bi(b)}break e;case"textarea":yt(u,g.value,g.defaultValue);break e;case"select":f=g.value,f!=null&&ft(u,!!g.multiple,f,!1)}}}var hu=!1;function gl(u,f,g){if(hu)return u(f,g);hu=!0;try{var b=u(f);return b}finally{if(hu=!1,(Ei!==null||Si!==null)&&(AB(),Ei&&(f=Ei,u=Si,Si=Ei=null,Ql(f),u)))for(f=0;f<u.length;f++)Ql(u[f])}}function Ti(u,f){var g=u.stateNode;if(g===null)return null;var b=g[Sn]||null;if(b===null)return null;g=b[f];e:switch(f){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(b=!b.disabled)||(u=u.type,b=!(u==="button"||u==="input"||u==="select"||u==="textarea")),u=!b;break e;default:u=!1}if(u)return null;if(g&&typeof g!="function")throw Error(r(231,f,typeof g));return g}var Ai=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),Jl=!1;if(Ai)try{var On={};Object.defineProperty(On,"passive",{get:function(){Jl=!0}}),window.addEventListener("test",On,On),window.removeEventListener("test",On,On)}catch{Jl=!1}var ii=null,rf=null,xl=null;function sf(){if(xl)return xl;var u,f=rf,g=f.length,b,C="value"in ii?ii.value:ii.textContent,A=C.length;for(u=0;
vendor: 6,502 bytes, line 48
48u<g&&f[u]===C[u];u++);var F=g-u;for(b=1;b<=F&&f[g-b]===C[A-b];b++);return xl=C.slice(u,1<b?1-b:void 0)}function Xc(u){var f=u.keyCode;return"charCode"in u?(u=u.charCode,u===0&&f===13&&(u=13)):u=f,u===10&&(u=13),32<=u||u===13?u:0}function bl(){return!0}function ki(){return!1}function Gs(u){function f(g,b,C,A,F){this._reactName=g,this._targetInst=C,this.type=b,this.nativeEvent=A,this.target=F,this.currentTarget=null;for(var q in u)u.hasOwnProperty(q)&&(g=u[q],this[q]=g?g(A):A[q]);return this.isDefaultPrevented=(A.defaultPrevented!=null?A.defaultPrevented:A.returnValue===!1)?bl:ki,this.isPropagationStopped=ki,this}return m(f.prototype,{preventDefault:function(){this.defaultPrevented=!0;var g=this.nativeEvent;g&&(g.preventDefault?g.preventDefault():typeof g.returnValue!="unknown"&&(g.returnValue=!1),this.isDefaultPrevented=bl)},stopPropagation:function(){var g=this.nativeEvent;g&&(g.stopPropagation?g.stopPropagation():typeof g.cancelBubble!="unknown"&&(g.cancelBubble=!0),this.isPropagationStopped=bl)},persist:function(){},isPersistent:bl}),f}var Do={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(u){return u.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Ni=Gs(Do),jo=m({},Do,{view:0,detail:0}),fu=Gs(jo),Xl,mu,oi,pu=m({},jo,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:gs,button:0,buttons:0,relatedTarget:function(u){return u.relatedTarget===void 0?u.fromElement===u.srcElement?u.toElement:u.fromElement:u.relatedTarget},movementX:function(u){return"movementX"in u?u.movementX:(u!==oi&&(oi&&u.type==="mousemove"?(Xl=u.screenX-oi.screenX,mu=u.screenY-oi.screenY):mu=Xl=0,oi=u),Xl)},movementY:function(u){return"movementY"in u?u.movementY:mu}}),af=Gs(pu),Zl=m({},pu,{dataTransfer:0}),of=Gs(Zl),Q=m({},jo,{relatedTarget:0}),De=Gs(Q),at=m({},Do,{animationName:0,elapsedTime:0,pseudoElement:0}),qe=Gs(at),kt=m({},Do,{clipboardData:function(u){return"clipboardData"in u?u.clipboardData:window.clipboardData}}),Nt=Gs(kt),it=m({},Do,{data:0}),_t=Gs(it),ia={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},Zc={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"},to={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function lf(u){var f=this.nativeEvent;return f.getModifierState?f.getModifierState(u):(u=to[u])?!!f[u]:!1}function gs(){return lf}var Vn=m({},jo,{key:function(u){if(u.key){var f=ia[u.key]||u.key;if(f!=="Unidentified")return f}return u.type==="keypress"?(u=Xc(u),u===13?"Enter":String.fromCharCode(u)):u.type==="keydown"||u.type==="keyup"?Zc[u.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:gs,charCode:function(u){return u.type==="keypress"?Xc(u):0},keyCode:function(u){return u.type==="keydown"||u.type==="keyup"?u.keyCode:0},which:function(u){return u.type==="keypress"?Xc(u):u.type==="keydown"||u.type==="keyup"?u.keyCode:0}}),yl=Gs(Vn),Gn=m({},pu,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),Ea=Gs(Gn),w=m({},jo,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:gs}),L=Gs(w),$=m({},Do,{propertyName:0,elapsedTime:0,pseudoElement:0}),X=Gs($),Se=m({},pu,{deltaX:function(u){return"deltaX"in u?u.deltaX:"wheelDeltaX"in u?-u.wheelDeltaX:0},deltaY:function(u){return"deltaY"in u?u.deltaY:"wheelDeltaY"in u?-u.wheelDeltaY:"wheelDelta"in u?-u.wheelDelta:0},deltaZ:0,deltaMode:0}),Re=Gs(Se),rt=m({},Do,{newState:0,oldState:0}),Kt=Gs(rt),xs=[9,13,27,32],jn=Ai&&"CompositionEvent"in window,$r=null;Ai&&"documentMode"in document&&($r=document.documentMode);var Ro=Ai&&"TextEvent"in window&&!$r,ec=Ai&&(!jn||$r&&8<$r&&11>=$r),vl=" ",Bl=!1;function cf(u,f){switch(u){case"keyup":return xs.indexOf(f.keyCode)!==-1;case"keydown":return f.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function ap(u){return u=u.detail,typeof u=="object"&&"data"in u?u.data:null}var ip=!1;function lte(u,f){switch(u){case"compositionend":return ap(f);case"keypress":return f.which!==32?null:(Bl=!0,vl);case"textInput":return u=f.data,u===vl&&Bl?null:u;default:return null}}function cte(u,f){if(ip)return u==="compositionend"||!jn&&cf(u,f)?(u=sf(),xl=rf=ii=null,ip=!1,u):null;switch(u){case"paste":return null;case"keypress":if(!(f.ctrlKey||f.altKey||f.metaKey)||f.ctrlKey&&f.altKey){if(f.char&&1<f.char.length)return f.char;if(f.which)return String.fromCharCode(f.which)}return null;case"compositionend":return ec&&f.locale!=="ko"?null:f.data;default:return null}}var dte={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 d5(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f==="input"?!!dte[u.type]:f==="textarea"}function u5(u,f,g,b){Ei?Si?Si.push(b):Si=[b]:Ei=b,f=RB(f,"onChange"),0<f.length&&(g=new Ni("onChange","change",null,g,b),u.push({event:g,listeners:f}))}var fx=null,mx=null;function ute(u){KO(u,0)}function qv(u){var f=or(u);if(Bi(f))return u}function h5(u,f){if(u==="change")return f}var f5=!1;if(Ai){var pT;if(Ai){var gT="oninput"in document;if(!gT){var m5=document.createElement("div");m5.setAttribute("oninput","return;"),gT=typeof m5.oninput=="function"}pT=gT}else pT=!1;f5=pT&&(!document.documentMode||9<document.documentMode)}function p5(){fx&&(fx.detachEvent("onpropertychange",g5),mx=fx=null)}function g5(u){if(u.propertyName==="value"&&qv(mx)){var f=[];u5(f,mx,u,Ut(u)),gl(ute,f)}}function hte(u,f,g){u==="focusin"?(p5(),fx=f,mx=g,fx.attachEvent("onpropertychange",g5)):u==="focusout"&&p5()}function fte(u){if(u==="selectionchange"||u==="keyup"||u==="keydown")return qv(mx)}function mte(u,f){if(u==="click")return qv(f)}function pte(u,f){if(u==="input"||u==="change")return qv(f)}function gte(u,f){return u===f&&(u!==0||1/u===1/f)||u!==u&&f!==f}var no=typeof Object.is=="function"?Object.is:gte;function px(u,f){if(no(u,f))return!0;
vendor: 22,685 bytes, line 48
48if(typeof u!="object"||u===null||typeof f!="object"||f===null)return!1;var g=Object.keys(u),b=Object.keys(f);if(g.length!==b.length)return!1;for(b=0;b<g.length;b++){var C=g[b];if(!dt.call(f,C)||!no(u[C],f[C]))return!1}return!0}function x5(u){for(;u&&u.firstChild;)u=u.firstChild;return u}function b5(u,f){var g=x5(u);u=0;for(var b;g;){if(g.nodeType===3){if(b=u+g.textContent.length,u<=f&&b>=f)return{node:g,offset:f-u};u=b}e:{for(;g;){if(g.nextSibling){g=g.nextSibling;break e}g=g.parentNode}g=void 0}g=x5(g)}}function y5(u,f){return u&&f?u===f?!0:u&&u.nodeType===3?!1:f&&f.nodeType===3?y5(u,f.parentNode):"contains"in u?u.contains(f):u.compareDocumentPosition?!!(u.compareDocumentPosition(f)&16):!1:!1}function v5(u){u=u!=null&&u.ownerDocument!=null&&u.ownerDocument.defaultView!=null?u.ownerDocument.defaultView:window;for(var f=Ca(u.document);f instanceof u.HTMLIFrameElement;){try{var g=typeof f.contentWindow.location.href=="string"}catch{g=!1}if(g)u=f.contentWindow;else break;f=Ca(u.document)}return f}function xT(u){var f=u&&u.nodeName&&u.nodeName.toLowerCase();return f&&(f==="input"&&(u.type==="text"||u.type==="search"||u.type==="tel"||u.type==="url"||u.type==="password")||f==="textarea"||u.contentEditable==="true")}var xte=Ai&&"documentMode"in document&&11>=document.documentMode,op=null,bT=null,gx=null,yT=!1;function B5(u,f,g){var b=g.window===g?g.document:g.nodeType===9?g:g.ownerDocument;yT||op==null||op!==Ca(b)||(b=op,"selectionStart"in b&&xT(b)?b={start:b.selectionStart,end:b.selectionEnd}:(b=(b.ownerDocument&&b.ownerDocument.defaultView||window).getSelection(),b={anchorNode:b.anchorNode,anchorOffset:b.anchorOffset,focusNode:b.focusNode,focusOffset:b.focusOffset}),gx&&px(gx,b)||(gx=b,b=RB(bT,"onSelect"),0<b.length&&(f=new Ni("onSelect","select",null,f,g),u.push({event:f,listeners:b}),f.target=op)))}function df(u,f){var g={};return g[u.toLowerCase()]=f.toLowerCase(),g["Webkit"+u]="webkit"+f,g["Moz"+u]="moz"+f,g}var lp={animationend:df("Animation","AnimationEnd"),animationiteration:df("Animation","AnimationIteration"),animationstart:df("Animation","AnimationStart"),transitionrun:df("Transition","TransitionRun"),transitionstart:df("Transition","TransitionStart"),transitioncancel:df("Transition","TransitionCancel"),transitionend:df("Transition","TransitionEnd")},vT={},w5={};Ai&&(w5=document.createElement("div").style,"AnimationEvent"in window||(delete lp.animationend.animation,delete lp.animationiteration.animation,delete lp.animationstart.animation),"TransitionEvent"in window||delete lp.transitionend.transition);function uf(u){if(vT[u])return vT[u];if(!lp[u])return u;var f=lp[u],g;for(g in f)if(f.hasOwnProperty(g)&&g in w5)return vT[u]=f[g];return u}var C5=uf("animationend"),E5=uf("animationiteration"),S5=uf("animationstart"),bte=uf("transitionrun"),yte=uf("transitionstart"),vte=uf("transitioncancel"),T5=uf("transitionend"),A5=new Map,BT="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(" ");BT.push("scrollEnd");function wl(u,f){A5.set(u,f),ai(f,[u])}var Kv=typeof reportError=="function"?reportError:function(u){if(typeof window=="object"&&typeof window.ErrorEvent=="function"){var f=new window.ErrorEvent("error",{bubbles:!0,cancelable:!0,message:typeof u=="object"&&u!==null&&typeof u.message=="string"?String(u.message):String(u),error:u});if(!window.dispatchEvent(f))return}else if(typeof process=="object"&&typeof process.emit=="function"){process.emit("uncaughtException",u);return}console.error(u)},Po=[],cp=0,wT=0;function Wv(){for(var u=cp,f=wT=cp=0;f<u;){var g=Po[f];Po[f++]=null;var b=Po[f];Po[f++]=null;var C=Po[f];Po[f++]=null;var A=Po[f];if(Po[f++]=null,b!==null&&C!==null){var F=b.pending;F===null?C.next=C:(C.next=F.next,F.next=C),b.pending=C}A!==0&&k5(g,C,A)}}function Yv(u,f,g,b){Po[cp++]=u,Po[cp++]=f,Po[cp++]=g,Po[cp++]=b,wT|=b,u.lanes|=b,u=u.alternate,u!==null&&(u.lanes|=b)}function CT(u,f,g,b){return Yv(u,f,g,b),Qv(u)}function hf(u,f){return Yv(u,null,null,f),Qv(u)}function k5(u,f,g){u.lanes|=g;var b=u.alternate;b!==null&&(b.lanes|=g);for(var C=!1,A=u.return;A!==null;)A.childLanes|=g,b=A.alternate,b!==null&&(b.childLanes|=g),A.tag===22&&(u=A.stateNode,u===null||u._visibility&1||(C=!0)),u=A,A=A.return;return u.tag===3?(A=u.stateNode,C&&f!==null&&(C=31-Qn(g),u=A.hiddenUpdates,b=u[C],b===null?u[C]=[f]:b.push(f),f.lane=g|536870912),A):null}function Qv(u){if(50<Mx)throw Mx=0,DA=null,Error(r(185));for(var f=u.return;f!==null;)u=f,f=u.return;return u.tag===3?u.stateNode:null}var dp={};function Bte(u,f,g,b){this.tag=u,this.key=g,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.refCleanup=this.ref=null,this.pendingProps=f,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=b,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function ro(u,f,g,b){return new Bte(u,f,g,b)}function ET(u){return u=u.prototype,!(!u||!u.isReactComponent)}function ed(u,f){var g=u.alternate;return g===null?(g=ro(u.tag,f,u.key,u.mode),g.elementType=u.elementType,g.type=u.type,g.stateNode=u.stateNode,g.alternate=u,u.alternate=g):(g.pendingProps=f,g.type=u.type,g.flags=0,g.subtreeFlags=0,g.deletions=null),g.flags=u.flags&65011712,g.childLanes=u.childLanes,g.lanes=u.lanes,g.child=u.child,g.memoizedProps=u.memoizedProps,g.memoizedState=u.memoizedState,g.updateQueue=u.updateQueue,f=u.dependencies,g.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext},g.sibling=u.sibling,g.index=u.index,g.ref=u.ref,g.refCleanup=u.refCleanup,g}function N5(u,f){u.flags&=65011714;var g=u.alternate;return g===null?(u.childLanes=0,u.lanes=f,u.child=null,u.subtreeFlags=0,u.memoizedProps=null,u.memoizedState=null,u.updateQueue=null,u.dependencies=null,u.stateNode=null):(u.childLanes=g.childLanes,u.lanes=g.lanes,u.child=g.child,u.subtreeFlags=0,u.deletions=null,u.memoizedProps=g.memoizedProps,u.memoizedState=g.memoizedState,u.updateQueue=g.updateQueue,u.type=g.type,f=g.dependencies,u.dependencies=f===null?null:{lanes:f.lanes,firstContext:f.firstContext}),u}function Jv(u,f,g,b,C,A){var F=0;if(b=u,typeof u=="function")ET(u)&&(F=1);else if(typeof u=="string")F=Tne(u,g,W.current)?26:u==="html"||u==="head"||u==="body"?27:5;else e:switch(u){case D:return u=ro(31,g,f,C),u.elementType=D,u.lanes=A,u;case v:return ff(g.children,C,A,f);case B:F=8,C|=24;break;case E:return u=ro(12,g,f,C|2),u.elementType=E,u.lanes=A,u;case P:return u=ro(13,g,f,C),u.elementType=P,u.lanes=A,u;case R:return u=ro(19,g,f,C),u.elementType=R,u.lanes=A,u;default:if(typeof u=="object"&&u!==null)switch(u.$$typeof){case T:F=10;break e;case N:F=9;break e;case k:F=11;break e;case _:F=14;break e;case I:F=16,b=null;break e}F=29,g=Error(r(130,u===null?"null":typeof u,"")),b=null}return f=ro(F,g,f,C),f.elementType=u,f.type=b,f.lanes=A,f}function ff(u,f,g,b){return u=ro(7,u,b,f),u.lanes=g,u}function ST(u,f,g){return u=ro(6,u,null,f),u.lanes=g,u}function _5(u){var f=ro(18,null,null,0);return f.stateNode=u,f}function TT(u,f,g){return f=ro(4,u.children!==null?u.children:[],u.key,f),f.lanes=g,f.stateNode={containerInfo:u.containerInfo,pendingChildren:null,implementation:u.implementation},f}var I5=new WeakMap;function Lo(u,f){if(typeof u=="object"&&u!==null){var g=I5.get(u);return g!==void 0?g:(f={value:u,source:f,stack:We(f)},I5.set(u,f),f)}return{value:u,source:f,stack:We(f)}}var up=[],hp=0,Xv=null,xx=0,Oo=[],Mo=0,gu=null,tc=1,nc="";function td(u,f){up[hp++]=xx,up[hp++]=Xv,Xv=u,xx=f}function D5(u,f,g){Oo[Mo++]=tc,Oo[Mo++]=nc,Oo[Mo++]=gu,gu=u;var b=tc;u=nc;var C=32-Qn(b)-1;b&=~(1<<C),g+=1;var A=32-Qn(f)+C;if(30<A){var F=C-C%5;A=(b&(1<<F)-1).toString(32),b>>=F,C-=F,tc=1<<32-Qn(f)+C|g<<C|b,nc=A+u}else tc=1<<A|g<<C|b,nc=u}function AT(u){u.return!==null&&(td(u,1),D5(u,1,0))}function kT(u){for(;u===Xv;)Xv=up[--hp],up[hp]=null,xx=up[--hp],up[hp]=null;for(;u===gu;)gu=Oo[--Mo],Oo[Mo]=null,nc=Oo[--Mo],Oo[Mo]=null,tc=Oo[--Mo],Oo[Mo]=null}function j5(u,f){Oo[Mo++]=tc,Oo[Mo++]=nc,Oo[Mo++]=gu,tc=f.id,nc=f.overflow,gu=u}var Sa=null,Nr=null,dn=!1,xu=null,Fo=!1,NT=Error(r(519));function bu(u){var f=Error(r(418,1<arguments.length&&arguments[1]!==void 0&&arguments[1]?"text":"HTML",""));throw bx(Lo(f,u)),NT}function R5(u){var f=u.stateNode,g=u.type,b=u.memoizedProps;switch(f[Xn]=u,f[Sn]=b,g){case"dialog":tn("cancel",f),tn("close",f);break;case"iframe":case"object":case"embed":tn("load",f);break;case"video":case"audio":for(g=0;g<Ux.length;g++)tn(Ux[g],f);break;case"source":tn("error",f);break;case"img":case"image":case"link":tn("error",f),tn("load",f);break;case"details":tn("toggle",f);break;case"input":tn("invalid",f),Yl(f,b.value,b.defaultValue,b.checked,b.defaultChecked,b.type,b.name,!0);break;case"select":tn("invalid",f);break;case"textarea":tn("invalid",f),lt(f,b.value,b.defaultValue,b.children)}g=b.children,typeof g!="string"&&typeof g!="number"&&typeof g!="bigint"||f.textContent===""+g||b.suppressHydrationWarning===!0||JO(f.textContent,g)?(b.popover!=null&&(tn("beforetoggle",f),tn("toggle",f)),b.onScroll!=null&&tn("scroll",f),b.onScrollEnd!=null&&tn("scrollend",f),b.onClick!=null&&(f.onclick=Ci),f=!0):f=!1,f||bu(u,!0)}function P5(u){for(Sa=u.return;Sa;)switch(Sa.tag){case 5:case 31:case 13:Fo=!1;return;case 27:case 3:Fo=!0;return;default:Sa=Sa.return}}function fp(u){if(u!==Sa)return!1;if(!dn)return P5(u),dn=!0,!1;var f=u.tag,g;if((g=f!==3&&f!==27)&&((g=f===5)&&(g=u.type,g=!(g!=="form"&&g!=="button")||KA(u.type,u.memoizedProps)),g=!g),g&&Nr&&bu(u),P5(u),f===13){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));Nr=iM(u)}else if(f===31){if(u=u.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(317));Nr=iM(u)}else f===27?(f=Nr,Du(u.type)?(u=XA,XA=null,Nr=u):Nr=f):Nr=Sa?Vo(u.stateNode.nextSibling):null;return!0}function mf(){Nr=Sa=null,dn=!1}function _T(){var u=xu;return u!==null&&(ji===null?ji=u:ji.push.apply(ji,u),xu=null),u}function bx(u){xu===null?xu=[u]:xu.push(u)}var IT=H(null),pf=null,nd=null;function yu(u,f,g){de(IT,f._currentValue),f._currentValue=g}function rd(u){u._currentValue=IT.current,Y(IT)}function DT(u,f,g){for(;u!==null;){var b=u.alternate;if((u.childLanes&f)!==f?(u.childLanes|=f,b!==null&&(b.childLanes|=f)):b!==null&&(b.childLanes&f)!==f&&(b.childLanes|=f),u===g)break;u=u.return}}function jT(u,f,g,b){var C=u.child;for(C!==null&&(C.return=u);C!==null;){var A=C.dependencies;if(A!==null){var F=C.child;A=A.firstContext;e:for(;A!==null;){var q=A;A=C;for(var ae=0;ae<f.length;ae++)if(q.context===f[ae]){A.lanes|=g,q=A.alternate,q!==null&&(q.lanes|=g),DT(A.return,g,u),b||(F=null);break e}A=q.next}}else if(C.tag===18){if(F=C.return,F===null)throw Error(r(341));F.lanes|=g,A=F.alternate,A!==null&&(A.lanes|=g),DT(F,g,u),F=null}else F=C.child;if(F!==null)F.return=C;else for(F=C;F!==null;){if(F===u){F=null;break}if(C=F.sibling,C!==null){C.return=F.return,F=C;break}F=F.return}C=F}}function mp(u,f,g,b){u=null;for(var C=f,A=!1;C!==null;){if(!A){if((C.flags&524288)!==0)A=!0;else if((C.flags&262144)!==0)break}if(C.tag===10){var F=C.alternate;if(F===null)throw Error(r(387));if(F=F.memoizedProps,F!==null){var q=C.type;no(C.pendingProps.value,F.value)||(u!==null?u.push(q):u=[q])}}else if(C===oe.current){if(F=C.alternate,F===null)throw Error(r(387));F.memoizedState.memoizedState!==C.memoizedState.memoizedState&&(u!==null?u.push(zx):u=[zx])}C=C.return}u!==null&&jT(f,u,g,b),f.flags|=262144}function Zv(u){for(u=u.firstContext;u!==null;){if(!no(u.context._currentValue,u.memoizedValue))return!0;u=u.next}return!1}function gf(u){pf=u,nd=null,u=u.dependencies,u!==null&&(u.firstContext=null)}function Ta(u){return L5(pf,u)}function eB(u,f){return pf===null&&gf(u),L5(u,f)}function L5(u,f){var g=f._currentValue;if(f={context:f,memoizedValue:g,next:null},nd===null){if(u===null)throw Error(r(308));nd=f,u.dependencies={lanes:0,firstContext:f},u.flags|=524288}else nd=nd.next=f;return g}var wte=typeof AbortController<"u"?AbortController:function(){var u=[],f=this.signal={aborted:!1,addEventListener:function(g,b){u.push(b)}};this.abort=function(){f.aborted=!0,u.forEach(function(g){return g()})}},Cte=n.unstable_scheduleCallback,Ete=n.unstable_NormalPriority,_s={$$typeof:T,Consumer:null,Provider:null,_currentValue:null,_currentValue2:null,_threadCount:0};function RT(){return{controller:new wte,data:new Map,refCount:0}}function yx(u){u.refCount--,u.refCount===0&&Cte(Ete,function(){u.controller.abort()})}var vx=null,PT=0,pp=0,gp=null;function Ste(u,f){if(vx===null){var g=vx=[];PT=0,pp=MA(),gp={status:"pending",value:void 0,then:function(b){g.push(b)}}}return PT++,f.then(O5,O5),f}function O5(){if(--PT===0&&vx!==null){gp!==null&&(gp.status="fulfilled");var u=vx;vx=null,pp=0,gp=null;for(var f=0;f<u.length;f++)(0,u[f])()}}function Tte(u,f){var g=[],b={status:"pending",value:null,reason:null,then:function(C){g.push(C)}};return u.then(function(){b.status="fulfilled",b.value=f;for(var C=0;C<g.length;C++)(0,g[C])(f)},function(C){for(b.status="rejected",b.reason=C,C=0;C<g.length;C++)(0,g[C])(void 0)}),b}var M5=G.S;G.S=function(u,f){BO=$t(),typeof f=="object"&&f!==null&&typeof f.then=="function"&&Ste(u,f),M5!==null&&M5(u,f)};var xf=H(null);function LT(){var u=xf.current;return u!==null?u:cr.pooledCache}function tB(u,f){f===null?de(xf,xf.current):de(xf,f.pool)}function F5(){var u=LT();return u===null?null:{parent:_s._currentValue,pool:u}}var xp=Error(r(460)),OT=Error(r(474)),nB=Error(r(542)),rB={then:function(){}};function U5(u){return u=u.status,u==="fulfilled"||u==="rejected"}function V5(u,f,g){switch(g=u[g],g===void 0?u.push(f):g!==f&&(f.then(Ci,Ci),f=g),f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,$5(u),u;default:if(typeof f.status=="string")f.then(Ci,Ci);else{if(u=cr,u!==null&&100<u.shellSuspendCounter)throw Error(r(482));u=f,u.status="pending",u.then(function(b){if(f.status==="pending"){var C=f;C.status="fulfilled",C.value=b}},function(b){if(f.status==="pending"){var C=f;C.status="rejected",C.reason=b}})}switch(f.status){case"fulfilled":return f.value;case"rejected":throw u=f.reason,$5(u),u}throw yf=f,xp}}function bf(u){try{var f=u._init;return f(u._payload)}catch(g){throw g!==null&&typeof g=="object"&&typeof g.then=="function"?(yf=g,xp):g}}var yf=null;function G5(){if(yf===null)throw Error(r(459));var u=yf;return yf=null,u}function $5(u){if(u===xp||u===nB)throw Error(r(483))}var bp=null,Bx=0;function sB(u){var f=Bx;return Bx+=1,bp===null&&(bp=[]),V5(bp,u,f)}function wx(u,f){f=f.props.ref,u.ref=f!==void 0?f:null}function aB(u,f){throw f.$$typeof===p?Error(r(525)):(u=Object.prototype.toString.call(f),Error(r(31,u==="[object Object]"?"object with keys {"+Object.keys(f).join(", ")+"}":u)))}function H5(u){function f(be,ue){if(u){var ke=be.deletions;ke===null?(be.deletions=[ue],be.flags|=16):ke.push(ue)}}function g(be,ue){if(!u)return null;for(;ue!==null;)f(be,ue),ue=ue.sibling;return null}function b(be){for(var ue=new Map;be!==null;)be.key!==null?ue.set(be.key,be):ue.set(be.index,be),be=be.sibling;return ue}function C(be,ue){return be=ed(be,ue),be.index=0,be.sibling=null,be}function A(be,ue,ke){return be.index=ke,u?(ke=be.alternate,ke!==null?(ke=ke.index,ke<ue?(be.flags|=67108866,ue):ke):(be.flags|=67108866,ue)):(be.flags|=1048576,ue)}function F(be){return u&&be.alternate===null&&(be.flags|=67108866),be}function q(be,ue,ke,Ge){return ue===null||ue.tag!==6?(ue=ST(ke,be.mode,Ge),ue.return=be,ue):(ue=C(ue,ke),ue.return=be,ue)}function ae(be,ue,ke,Ge){var Tt=ke.type;return Tt===v?Ue(be,ue,ke.props.children,Ge,ke.key):ue!==null&&(ue.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===I&&bf(Tt)===ue.type)?(ue=C(ue,ke.props),wx(ue,ke),ue.return=be,ue):(ue=Jv(ke.type,ke.key,ke.props,null,be.mode,Ge),wx(ue,ke),ue.return=be,ue)}function Ne(be,ue,ke,Ge){return ue===null||ue.tag!==4||ue.stateNode.containerInfo!==ke.containerInfo||ue.stateNode.implementation!==ke.implementation?(ue=TT(ke,be.mode,Ge),ue.return=be,ue):(ue=C(ue,ke.children||[]),ue.return=be,ue)}function Ue(be,ue,ke,Ge,Tt){return ue===null||ue.tag!==7?(ue=ff(ke,be.mode,Ge,Tt),ue.return=be,ue):(ue=C(ue,ke),ue.return=be,ue)}function $e(be,ue,ke){if(typeof ue=="string"&&ue!==""||typeof ue=="number"||typeof ue=="bigint")return ue=ST(""+ue,be.mode,ke),ue.return=be,ue;if(typeof ue=="object"&&ue!==null){switch(ue.$$typeof){case x:return ke=Jv(ue.type,ue.key,ue.props,null,be.mode,ke),wx(ke,ue),ke.return=be,ke;case y:return ue=TT(ue,be.mode,ke),ue.return=be,ue;case I:return ue=bf(ue),$e(be,ue,ke)}if(ie(ue)||M(ue))return ue=ff(ue,be.mode,ke,null),ue.return=be,ue;if(typeof ue.then=="function")return $e(be,sB(ue),ke);if(ue.$$typeof===T)return $e(be,eB(be,ue),ke);aB(be,ue)}return null}function _e(be,ue,ke,Ge){var Tt=ue!==null?ue.key:null;if(typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint")return Tt!==null?null:q(be,ue,""+ke,Ge);if(typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case x:return ke.key===Tt?ae(be,ue,ke,Ge):null;case y:return ke.key===Tt?Ne(be,ue,ke,Ge):null;case I:return ke=bf(ke),_e(be,ue,ke,Ge)}if(ie(ke)||M(ke))return Tt!==null?null:Ue(be,ue,ke,Ge,null);if(typeof ke.then=="function")return _e(be,ue,sB(ke),Ge);if(ke.$$typeof===T)return _e(be,ue,eB(be,ke),Ge);aB(be,ke)}return null}function Pe(be,ue,ke,Ge,Tt){if(typeof Ge=="string"&&Ge!==""||typeof Ge=="number"||typeof Ge=="bigint")return be=be.get(ke)||null,q(ue,be,""+Ge,Tt);if(typeof Ge=="object"&&Ge!==null){switch(Ge.$$typeof){case x:return be=be.get(Ge.key===null?ke:Ge.key)||null,ae(ue,be,Ge,Tt);case y:return be=be.get(Ge.key===null?ke:Ge.key)||null,Ne(ue,be,Ge,Tt);case I:return Ge=bf(Ge),Pe(be,ue,ke,Ge,Tt)}if(ie(Ge)||M(Ge))return be=be.get(ke)||null,Ue(ue,be,Ge,Tt,null);if(typeof Ge.then=="function")return Pe(be,ue,ke,sB(Ge),Tt);if(Ge.$$typeof===T)return Pe(be,ue,ke,eB(ue,Ge),Tt);aB(ue,Ge)}return null}function gt(be,ue,ke,Ge){for(var Tt=null,Tn=null,vt=ue,Qt=ue=0,sn=null;vt!==null&&Qt<ke.length;Qt++){vt.index>Qt?(sn=vt,vt=null):sn=vt.sibling;var An=_e(be,vt,ke[Qt],Ge);if(An===null){vt===null&&(vt=sn);break}u&&vt&&An.alternate===null&&f(be,vt),ue=A(An,ue,Qt),Tn===null?Tt=An:Tn.sibling=An,Tn=An,vt=sn}if(Qt===ke.length)return g(be,vt),dn&&td(be,Qt),Tt;if(vt===null){for(;Qt<ke.length;Qt++)vt=$e(be,ke[Qt],Ge),vt!==null&&(ue=A(vt,ue,Qt),Tn===null?Tt=vt:Tn.sibling=vt,Tn=vt);return dn&&td(be,Qt),Tt}for(vt=b(vt);Qt<ke.length;Qt++)sn=Pe(vt,be,Qt,ke[Qt],Ge),sn!==null&&(u&&sn.alternate!==null&&vt.delete(sn.key===null?Qt:sn.key),ue=A(sn,ue,Qt),Tn===null?Tt=sn:Tn.sibling=sn,Tn=sn);return u&&vt.forEach(function(Ou){return f(be,Ou)}),dn&&td(be,Qt),Tt}function It(be,ue,ke,Ge){if(ke==null)throw Error(r(151));for(var Tt=null,Tn=null,vt=ue,Qt=ue=0,sn=null,An=ke.next();vt!==null&&!An.done;Qt++,An=ke.next()){vt.index>Qt?(sn=vt,vt=null):sn=vt.sibling;var Ou=_e(be,vt,An.value,Ge);if(Ou===null){vt===null&&(vt=sn);break}u&&vt&&Ou.alternate===null&&f(be,vt),ue=A(Ou,ue,Qt),Tn===null?Tt=Ou:Tn.sibling=Ou,Tn=Ou,vt=sn}if(An.done)return g(be,vt),dn&&td(be,Qt),Tt;if(vt===null){for(;!An.done;Qt++,An=ke.next())An=$e(be,An.value,Ge),An!==null&&(ue=A(An,ue,Qt),Tn===null?Tt=An:Tn.sibling=An,Tn=An);return dn&&td(be,Qt),Tt}for(vt=b(vt);!An.done;Qt++,An=ke.next())An=Pe(vt,be,Qt,An.value,Ge),An!==null&&(u&&An.alternate!==null&&vt.delete(An.key===null?Qt:An.key),ue=A(An,ue,Qt),Tn===null?Tt=An:Tn.sibling=An,Tn=An);return u&&vt.forEach(function(One){return f(be,One)}),dn&&td(be,Qt),Tt}function tr(be,ue,ke,Ge){if(typeof ke=="object"&&ke!==null&&ke.type===v&&ke.key===null&&(ke=ke.props.children),typeof ke=="object"&&ke!==null){switch(ke.$$typeof){case x:e:{for(var Tt=ke.key;ue!==null;){if(ue.key===Tt){if(Tt=ke.type,Tt===v){if(ue.tag===7){g(be,ue.sibling),Ge=C(ue,ke.props.children),Ge.return=be,be=Ge;break e}}else if(ue.elementType===Tt||typeof Tt=="object"&&Tt!==null&&Tt.$$typeof===I&&bf(Tt)===ue.type){g(be,ue.sibling),Ge=C(ue,ke.props),wx(Ge,ke),Ge.return=be,be=Ge;break e}g(be,ue);break}else f(be,ue);ue=ue.sibling}ke.type===v?(Ge=ff(ke.props.children,be.mode,Ge,ke.key),Ge.return=be,be=Ge):(Ge=Jv(ke.type,ke.key,ke.props,null,be.mode,Ge),wx(Ge,ke),Ge.return=be,be=Ge)}return F(be);case y:e:{for(Tt=ke.key;ue!==null;){if(ue.key===Tt)if(ue.tag===4&&ue.stateNode.containerInfo===ke.containerInfo&&ue.stateNode.implementation===ke.implementation){g(be,ue.sibling),Ge=C(ue,ke.children||[]),Ge.return=be,be=Ge;break e}else{g(be,ue);break}else f(be,ue);ue=ue.sibling}Ge=TT(ke,be.mode,Ge),Ge.return=be,be=Ge}return F(be);case I:return ke=bf(ke),tr(be,ue,ke,Ge)}if(ie(ke))return gt(be,ue,ke,Ge);if(M(ke)){if(Tt=M(ke),typeof Tt!="function")throw Error(r(150));return ke=Tt.call(ke),It(be,ue,ke,Ge)}if(typeof ke.then=="function")return tr(be,ue,sB(ke),Ge);if(ke.$$typeof===T)return tr(be,ue,eB(be,ke),Ge);aB(be,ke)}return typeof ke=="string"&&ke!==""||typeof ke=="number"||typeof ke=="bigint"?(ke=""+ke,ue!==null&&ue.tag===6?(g(be,ue.sibling),Ge=C(ue,ke),Ge.return=be,be=Ge):(g(be,ue),Ge=ST(ke,be.mode,Ge),Ge.return=be,be=Ge),F(be)):g(be,ue)}return function(be,ue,ke,Ge){try{Bx=0;var Tt=tr(be,ue,ke,Ge);return bp=null,Tt}catch(vt){if(vt===xp||vt===nB)throw vt;var Tn=ro(29,vt,null,be.mode);return Tn.lanes=Ge,Tn.return=be,Tn}finally{}}}var vf=H5(!0),z5=H5(!1),vu=!1;function MT(u){u.updateQueue={baseState:u.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,lanes:0,hiddenCallbacks:null},callbacks:null}}function FT(u,f){u=u.updateQueue,f.updateQueue===u&&(f.updateQueue={baseState:u.baseState,firstBaseUpdate:u.firstBaseUpdate,lastBaseUpdate:u.lastBaseUpdate,shared:u.shared,callbacks:null})}function Bu(u){return{lane:u,tag:0,payload:null,callback:null,next:null}}function wu(u,f,g){var b=u.updateQueue;if(b===null)return null;if(b=b.shared,(Rn&2)!==0){var C=b.pending;return C===null?f.next=f:(f.next=C.next,C.next=f),b.pending=f,f=Qv(u),k5(u,null,g),f}return Yv(u,b,f,g),Qv(u)}function Cx(u,f,g){if(f=f.updateQueue,f!==null&&(f=f.shared,(g&4194048)!==0)){var b=f.lanes;b&=u.pendingLanes,g|=b,f.lanes=g,ge(u,g)}}function UT(u,f){var g=u.updateQueue,b=u.alternate;if(b!==null&&(b=b.updateQueue,g===b)){var C=null,A=null;if(g=g.firstBaseUpdate,g!==null){do{var F={lane:g.lane,tag:g.tag,payload:g.payload,callback:null,next:null};A===null?C=A=F:A=A.next=F,g=g.next}
vendor: 7,742 bytes, line 48
48while(g!==null);A===null?C=A=f:A=A.next=f}else C=A=f;g={baseState:b.baseState,firstBaseUpdate:C,lastBaseUpdate:A,shared:b.shared,callbacks:b.callbacks},u.updateQueue=g;return}u=g.lastBaseUpdate,u===null?g.firstBaseUpdate=f:u.next=f,g.lastBaseUpdate=f}var VT=!1;function Ex(){if(VT){var u=gp;if(u!==null)throw u}}function Sx(u,f,g,b){VT=!1;var C=u.updateQueue;vu=!1;var A=C.firstBaseUpdate,F=C.lastBaseUpdate,q=C.shared.pending;if(q!==null){C.shared.pending=null;var ae=q,Ne=ae.next;ae.next=null,F===null?A=Ne:F.next=Ne,F=ae;var Ue=u.alternate;Ue!==null&&(Ue=Ue.updateQueue,q=Ue.lastBaseUpdate,q!==F&&(q===null?Ue.firstBaseUpdate=Ne:q.next=Ne,Ue.lastBaseUpdate=ae))}if(A!==null){var $e=C.baseState;F=0,Ue=Ne=ae=null,q=A;do{var _e=q.lane&-536870913,Pe=_e!==q.lane;if(Pe?(rn&_e)===_e:(b&_e)===_e){_e!==0&&_e===pp&&(VT=!0),Ue!==null&&(Ue=Ue.next={lane:0,tag:q.tag,payload:q.payload,callback:null,next:null});e:{var gt=u,It=q;_e=f;var tr=g;switch(It.tag){case 1:if(gt=It.payload,typeof gt=="function"){$e=gt.call(tr,$e,_e);break e}$e=gt;break e;case 3:gt.flags=gt.flags&-65537|128;case 0:if(gt=It.payload,_e=typeof gt=="function"?gt.call(tr,$e,_e):gt,_e==null)break e;$e=m({},$e,_e);break e;case 2:vu=!0}}_e=q.callback,_e!==null&&(u.flags|=64,Pe&&(u.flags|=8192),Pe=C.callbacks,Pe===null?C.callbacks=[_e]:Pe.push(_e))}else Pe={lane:_e,tag:q.tag,payload:q.payload,callback:q.callback,next:null},Ue===null?(Ne=Ue=Pe,ae=$e):Ue=Ue.next=Pe,F|=_e;if(q=q.next,q===null){if(q=C.shared.pending,q===null)break;Pe=q,q=Pe.next,Pe.next=null,C.lastBaseUpdate=Pe,C.shared.pending=null}}while(!0);Ue===null&&(ae=$e),C.baseState=ae,C.firstBaseUpdate=Ne,C.lastBaseUpdate=Ue,A===null&&(C.shared.lanes=0),Au|=F,u.lanes=F,u.memoizedState=$e}}function q5(u,f){if(typeof u!="function")throw Error(r(191,u));u.call(f)}function K5(u,f){var g=u.callbacks;if(g!==null)for(u.callbacks=null,u=0;u<g.length;u++)q5(g[u],f)}var yp=H(null),iB=H(0);function W5(u,f){u=hd,de(iB,u),de(yp,f),hd=u|f.baseLanes}function GT(){de(iB,hd),de(yp,yp.current)}function $T(){hd=iB.current,Y(yp),Y(iB)}var so=H(null),Uo=null;function Cu(u){var f=u.alternate;de(bs,bs.current&1),de(so,u),Uo===null&&(f===null||yp.current!==null||f.memoizedState!==null)&&(Uo=u)}function HT(u){de(bs,bs.current),de(so,u),Uo===null&&(Uo=u)}function Y5(u){u.tag===22?(de(bs,bs.current),de(so,u),Uo===null&&(Uo=u)):Eu()}function Eu(){de(bs,bs.current),de(so,so.current)}function ao(u){Y(so),Uo===u&&(Uo=null),Y(bs)}var bs=H(0);function oB(u){for(var f=u;f!==null;){if(f.tag===13){var g=f.memoizedState;if(g!==null&&(g=g.dehydrated,g===null||QA(g)||JA(g)))return f}else if(f.tag===19&&(f.memoizedProps.revealOrder==="forwards"||f.memoizedProps.revealOrder==="backwards"||f.memoizedProps.revealOrder==="unstable_legacy-backwards"||f.memoizedProps.revealOrder==="together")){if((f.flags&128)!==0)return f}else if(f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return null;f=f.return}f.sibling.return=f.return,f=f.sibling}return null}var sd=0,Wt=null,Zn=null,Is=null,lB=!1,vp=!1,Bf=!1,cB=0,Tx=0,Bp=null,Ate=0;function rs(){throw Error(r(321))}function zT(u,f){if(f===null)return!1;for(var g=0;g<f.length&&g<u.length;g++)if(!no(u[g],f[g]))return!1;return!0}function qT(u,f,g,b,C,A){return sd=A,Wt=f,f.memoizedState=null,f.updateQueue=null,f.lanes=0,G.H=u===null||u.memoizedState===null?DL:oA,Bf=!1,A=g(b,C),Bf=!1,vp&&(A=J5(f,g,b,C)),Q5(u),A}function Q5(u){G.H=Nx;var f=Zn!==null&&Zn.next!==null;if(sd=0,Is=Zn=Wt=null,lB=!1,Tx=0,Bp=null,f)throw Error(r(300));u===null||Ds||(u=u.dependencies,u!==null&&Zv(u)&&(Ds=!0))}function J5(u,f,g,b){Wt=u;var C=0;do{if(vp&&(Bp=null),Tx=0,vp=!1,25<=C)throw Error(r(301));if(C+=1,Is=Zn=null,u.updateQueue!=null){var A=u.updateQueue;A.lastEffect=null,A.events=null,A.stores=null,A.memoCache!=null&&(A.memoCache.index=0)}G.H=jL,A=f(g,b)}while(vp);return A}function kte(){var u=G.H,f=u.useState()[0];return f=typeof f.then=="function"?Ax(f):f,u=u.useState()[0],(Zn!==null?Zn.memoizedState:null)!==u&&(Wt.flags|=1024),f}function KT(){var u=cB!==0;return cB=0,u}function WT(u,f,g){f.updateQueue=u.updateQueue,f.flags&=-2053,u.lanes&=~g}function YT(u){if(lB){for(u=u.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}lB=!1}sd=0,Is=Zn=Wt=null,vp=!1,Tx=cB=0,Bp=null}function li(){var u={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return Is===null?Wt.memoizedState=Is=u:Is=Is.next=u,Is}function ys(){if(Zn===null){var u=Wt.alternate;u=u!==null?u.memoizedState:null}else u=Zn.next;var f=Is===null?Wt.memoizedState:Is.next;if(f!==null)Is=f,Zn=u;else{if(u===null)throw Wt.alternate===null?Error(r(467)):Error(r(310));Zn=u,u={memoizedState:Zn.memoizedState,baseState:Zn.baseState,baseQueue:Zn.baseQueue,queue:Zn.queue,next:null},Is===null?Wt.memoizedState=Is=u:Is=Is.next=u}return Is}function dB(){return{lastEffect:null,events:null,stores:null,memoCache:null}}function Ax(u){var f=Tx;return Tx+=1,Bp===null&&(Bp=[]),u=V5(Bp,u,f),f=Wt,(Is===null?f.memoizedState:Is.next)===null&&(f=f.alternate,G.H=f===null||f.memoizedState===null?DL:oA),u}function uB(u){if(u!==null&&typeof u=="object"){if(typeof u.then=="function")return Ax(u);if(u.$$typeof===T)return Ta(u)}throw Error(r(438,String(u)))}function QT(u){var f=null,g=Wt.updateQueue;if(g!==null&&(f=g.memoCache),f==null){var b=Wt.alternate;b!==null&&(b=b.updateQueue,b!==null&&(b=b.memoCache,b!=null&&(f={data:b.data.map(function(C){return C.slice()}),index:0})))}if(f==null&&(f={data:[],index:0}),g===null&&(g=dB(),Wt.updateQueue=g),g.memoCache=f,g=f.data[f.index],g===void 0)for(g=f.data[f.index]=Array(u),b=0;b<u;b++)g[b]=j;return f.index++,g}function ad(u,f){return typeof f=="function"?f(u):f}function hB(u){var f=ys();return JT(f,Zn,u)}function JT(u,f,g){var b=u.queue;if(b===null)throw Error(r(311));b.lastRenderedReducer=g;var C=u.baseQueue,A=b.pending;if(A!==null){if(C!==null){var F=C.next;C.next=A.next,A.next=F}f.baseQueue=C=A,b.pending=null}if(A=u.baseState,C===null)u.memoizedState=A;else{f=C.next;var q=F=null,ae=null,Ne=f,Ue=!1;do{var $e=Ne.lane&-536870913;if($e!==Ne.lane?(rn&$e)===$e:(sd&$e)===$e){var _e=Ne.revertLane;if(_e===0)ae!==null&&(ae=ae.next={lane:0,revertLane:0,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null}),$e===pp&&(Ue=!0);else if((sd&_e)===_e){Ne=Ne.next,_e===pp&&(Ue=!0);continue}else $e={lane:0,revertLane:Ne.revertLane,gesture:null,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ae===null?(q=ae=$e,F=A):ae=ae.next=$e,Wt.lanes|=_e,Au|=_e;$e=Ne.action,Bf&&g(A,$e),A=Ne.hasEagerState?Ne.eagerState:g(A,$e)}else _e={lane:$e,revertLane:Ne.revertLane,gesture:Ne.gesture,action:Ne.action,hasEagerState:Ne.hasEagerState,eagerState:Ne.eagerState,next:null},ae===null?(q=ae=_e,F=A):ae=ae.next=_e,Wt.lanes|=$e,Au|=$e;Ne=Ne.next}while(Ne!==null&&Ne!==f);if(ae===null?F=A:ae.next=q,!no(A,u.memoizedState)&&(Ds=!0,Ue&&(g=gp,g!==null)))throw g;u.memoizedState=A,u.baseState=F,u.baseQueue=ae,b.lastRenderedState=A}return C===null&&(b.lanes=0),[u.memoizedState,b.dispatch]}function XT(u){var f=ys(),g=f.queue;if(g===null)throw Error(r(311));g.lastRenderedReducer=u;var b=g.dispatch,C=g.pending,A=f.memoizedState;if(C!==null){g.pending=null;var F=C=C.next;do A=u(A,F.action),F=F.next;while(F!==C);no(A,f.memoizedState)||(Ds=!0),f.memoizedState=A,f.baseQueue===null&&(f.baseState=A),g.lastRenderedState=A}return[A,b]}function X5(u,f,g){var b=Wt,C=ys(),A=dn;if(A){if(g===void 0)throw Error(r(407));g=g()}else g=f();var F=!no((Zn||C).memoizedState,g);if(F&&(C.memoizedState=g,Ds=!0),C=C.queue,tA(tL.bind(null,b,C,u),[u]),C.getSnapshot!==f||F||Is!==null&&Is.memoizedState.tag&1){if(b.flags|=2048,wp(9,{destroy:void 0}
vendor: 15,976 bytes, line 48
48,eL.bind(null,b,C,g,f),null),cr===null)throw Error(r(349));A||(sd&127)!==0||Z5(b,f,g)}return g}function Z5(u,f,g){u.flags|=16384,u={getSnapshot:f,value:g},f=Wt.updateQueue,f===null?(f=dB(),Wt.updateQueue=f,f.stores=[u]):(g=f.stores,g===null?f.stores=[u]:g.push(u))}function eL(u,f,g,b){f.value=g,f.getSnapshot=b,nL(f)&&rL(u)}function tL(u,f,g){return g(function(){nL(f)&&rL(u)})}function nL(u){var f=u.getSnapshot;u=u.value;try{var g=f();return!no(u,g)}catch{return!0}}function rL(u){var f=hf(u,2);f!==null&&Ri(f,u,2)}function ZT(u){var f=li();if(typeof u=="function"){var g=u;if(u=g(),Bf){As(!0);try{g()}finally{As(!1)}}}return f.memoizedState=f.baseState=u,f.queue={pending:null,lanes:0,dispatch:null,lastRenderedReducer:ad,lastRenderedState:u},f}function sL(u,f,g,b){return u.baseState=g,JT(u,Zn,typeof b=="function"?b:ad)}function Nte(u,f,g,b,C){if(pB(u))throw Error(r(485));if(u=f.action,u!==null){var A={payload:C,action:u,next:null,isTransition:!0,status:"pending",value:null,reason:null,listeners:[],then:function(F){A.listeners.push(F)}};G.T!==null?g(!0):A.isTransition=!1,b(A),g=f.pending,g===null?(A.next=f.pending=A,aL(f,A)):(A.next=g.next,f.pending=g.next=A)}}function aL(u,f){var g=f.action,b=f.payload,C=u.state;if(f.isTransition){var A=G.T,F={};G.T=F;try{var q=g(C,b),ae=G.S;ae!==null&&ae(F,q),iL(u,f,q)}catch(Ne){eA(u,f,Ne)}finally{A!==null&&F.types!==null&&(A.types=F.types),G.T=A}}else try{A=g(C,b),iL(u,f,A)}catch(Ne){eA(u,f,Ne)}}function iL(u,f,g){g!==null&&typeof g=="object"&&typeof g.then=="function"?g.then(function(b){oL(u,f,b)},function(b){return eA(u,f,b)}):oL(u,f,g)}function oL(u,f,g){f.status="fulfilled",f.value=g,lL(f),u.state=g,f=u.pending,f!==null&&(g=f.next,g===f?u.pending=null:(g=g.next,f.next=g,aL(u,g)))}function eA(u,f,g){var b=u.pending;if(u.pending=null,b!==null){b=b.next;do f.status="rejected",f.reason=g,lL(f),f=f.next;while(f!==b)}u.action=null}function lL(u){u=u.listeners;for(var f=0;f<u.length;f++)(0,u[f])()}function cL(u,f){return f}function dL(u,f){if(dn){var g=cr.formState;if(g!==null){e:{var b=Wt;if(dn){if(Nr){t:{for(var C=Nr,A=Fo;C.nodeType!==8;){if(!A){C=null;break t}if(C=Vo(C.nextSibling),C===null){C=null;break t}}A=C.data,C=A==="F!"||A==="F"?C:null}if(C){Nr=Vo(C.nextSibling),b=C.data==="F!";break e}}bu(b)}b=!1}b&&(f=g[0])}}return g=li(),g.memoizedState=g.baseState=f,b={pending:null,lanes:0,dispatch:null,lastRenderedReducer:cL,lastRenderedState:f},g.queue=b,g=NL.bind(null,Wt,b),b.dispatch=g,b=ZT(!1),A=iA.bind(null,Wt,!1,b.queue),b=li(),C={state:f,dispatch:null,action:u,pending:null},b.queue=C,g=Nte.bind(null,Wt,C,A,g),C.dispatch=g,b.memoizedState=u,[f,g,!1]}function uL(u){var f=ys();return hL(f,Zn,u)}function hL(u,f,g){if(f=JT(u,f,cL)[0],u=hB(ad)[0],typeof f=="object"&&f!==null&&typeof f.then=="function")try{var b=Ax(f)}catch(F){throw F===xp?nB:F}else b=f;f=ys();var C=f.queue,A=C.dispatch;return g!==f.memoizedState&&(Wt.flags|=2048,wp(9,{destroy:void 0},_te.bind(null,C,g),null)),[b,A,u]}function _te(u,f){u.action=f}function fL(u){var f=ys(),g=Zn;if(g!==null)return hL(f,g,u);ys(),f=f.memoizedState,g=ys();var b=g.queue.dispatch;return g.memoizedState=u,[f,b,!1]}function wp(u,f,g,b){return u={tag:u,create:g,deps:b,inst:f,next:null},f=Wt.updateQueue,f===null&&(f=dB(),Wt.updateQueue=f),g=f.lastEffect,g===null?f.lastEffect=u.next=u:(b=g.next,g.next=u,u.next=b,f.lastEffect=u),u}function mL(){return ys().memoizedState}function fB(u,f,g,b){var C=li();Wt.flags|=u,C.memoizedState=wp(1|f,{destroy:void 0},g,b===void 0?null:b)}function mB(u,f,g,b){var C=ys();b=b===void 0?null:b;var A=C.memoizedState.inst;Zn!==null&&b!==null&&zT(b,Zn.memoizedState.deps)?C.memoizedState=wp(f,A,g,b):(Wt.flags|=u,C.memoizedState=wp(1|f,A,g,b))}function pL(u,f){fB(8390656,8,u,f)}function tA(u,f){mB(2048,8,u,f)}function Ite(u){Wt.flags|=4;var f=Wt.updateQueue;if(f===null)f=dB(),Wt.updateQueue=f,f.events=[u];else{var g=f.events;g===null?f.events=[u]:g.push(u)}}function gL(u){var f=ys().memoizedState;return Ite({ref:f,nextImpl:u}),function(){if((Rn&2)!==0)throw Error(r(440));return f.impl.apply(void 0,arguments)}}function xL(u,f){return mB(4,2,u,f)}function bL(u,f){return mB(4,4,u,f)}function yL(u,f){if(typeof f=="function"){u=u();var g=f(u);return function(){typeof g=="function"?g():f(null)}}if(f!=null)return u=u(),f.current=u,function(){f.current=null}}function vL(u,f,g){g=g!=null?g.concat([u]):null,mB(4,4,yL.bind(null,f,u),g)}function nA(){}function BL(u,f){var g=ys();f=f===void 0?null:f;var b=g.memoizedState;return f!==null&&zT(f,b[1])?b[0]:(g.memoizedState=[u,f],u)}function wL(u,f){var g=ys();f=f===void 0?null:f;var b=g.memoizedState;if(f!==null&&zT(f,b[1]))return b[0];if(b=u(),Bf){As(!0);try{u()}finally{As(!1)}}return g.memoizedState=[b,f],b}function rA(u,f,g){return g===void 0||(sd&1073741824)!==0&&(rn&261930)===0?u.memoizedState=f:(u.memoizedState=g,u=CO(),Wt.lanes|=u,Au|=u,g)}function CL(u,f,g,b){return no(g,f)?g:yp.current!==null?(u=rA(u,g,b),no(u,f)||(Ds=!0),u):(sd&42)===0||(sd&1073741824)!==0&&(rn&261930)===0?(Ds=!0,u.memoizedState=g):(u=CO(),Wt.lanes|=u,Au|=u,f)}function EL(u,f,g,b,C){var A=Z.p;Z.p=A!==0&&8>A?A:8;var F=G.T,q={};G.T=q,iA(u,!1,f,g);try{var ae=C(),Ne=G.S;if(Ne!==null&&Ne(q,ae),ae!==null&&typeof ae=="object"&&typeof ae.then=="function"){var Ue=Tte(ae,b);kx(u,f,Ue,lo(u))}else kx(u,f,b,lo(u))}catch($e){kx(u,f,{then:function(){},status:"rejected",reason:$e},lo())}finally{Z.p=A,F!==null&&q.types!==null&&(F.types=q.types),G.T=F}}function Dte(){}function sA(u,f,g,b){if(u.tag!==5)throw Error(r(476));var C=SL(u).queue;EL(u,C,f,z,g===null?Dte:function(){return TL(u),g(b)})}function SL(u){var f=u.memoizedState;if(f!==null)return f;f={memoizedState:z,baseState:z,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ad,lastRenderedState:z},next:null};var g={};return f.next={memoizedState:g,baseState:g,baseQueue:null,queue:{pending:null,lanes:0,dispatch:null,lastRenderedReducer:ad,lastRenderedState:g},next:null},u.memoizedState=f,u=u.alternate,u!==null&&(u.memoizedState=f),f}function TL(u){var f=SL(u);f.next===null&&(f=u.alternate.memoizedState),kx(u,f.next.queue,{},lo())}function aA(){return Ta(zx)}function AL(){return ys().memoizedState}function kL(){return ys().memoizedState}function jte(u){for(var f=u.return;f!==null;){switch(f.tag){case 24:case 3:var g=lo();u=Bu(g);var b=wu(f,u,g);b!==null&&(Ri(b,f,g),Cx(b,f,g)),f={cache:RT()},u.payload=f;return}f=f.return}}function Rte(u,f,g){var b=lo();g={lane:b,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null},pB(u)?_L(f,g):(g=CT(u,f,g,b),g!==null&&(Ri(g,u,b),IL(g,f,b)))}function NL(u,f,g){var b=lo();kx(u,f,g,b)}function kx(u,f,g,b){var C={lane:b,revertLane:0,gesture:null,action:g,hasEagerState:!1,eagerState:null,next:null};if(pB(u))_L(f,C);else{var A=u.alternate;if(u.lanes===0&&(A===null||A.lanes===0)&&(A=f.lastRenderedReducer,A!==null))try{var F=f.lastRenderedState,q=A(F,g);if(C.hasEagerState=!0,C.eagerState=q,no(q,F))return Yv(u,f,C,0),cr===null&&Wv(),!1}catch{}finally{}if(g=CT(u,f,C,b),g!==null)return Ri(g,u,b),IL(g,f,b),!0}return!1}function iA(u,f,g,b){if(b={lane:2,revertLane:MA(),gesture:null,action:b,hasEagerState:!1,eagerState:null,next:null},pB(u)){if(f)throw Error(r(479))}else f=CT(u,g,b,2),f!==null&&Ri(f,u,2)}function pB(u){var f=u.alternate;return u===Wt||f!==null&&f===Wt}function _L(u,f){vp=lB=!0;var g=u.pending;g===null?f.next=f:(f.next=g.next,g.next=f),u.pending=f}function IL(u,f,g){if((g&4194048)!==0){var b=f.lanes;b&=u.pendingLanes,g|=b,f.lanes=g,ge(u,g)}}var Nx={readContext:Ta,use:uB,useCallback:rs,useContext:rs,useEffect:rs,useImperativeHandle:rs,useLayoutEffect:rs,useInsertionEffect:rs,useMemo:rs,useReducer:rs,useRef:rs,useState:rs,useDebugValue:rs,useDeferredValue:rs,useTransition:rs,useSyncExternalStore:rs,useId:rs,useHostTransitionStatus:rs,useFormState:rs,useActionState:rs,useOptimistic:rs,useMemoCache:rs,useCacheRefresh:rs};Nx.useEffectEvent=rs;var DL={readContext:Ta,use:uB,useCallback:function(u,f){return li().memoizedState=[u,f===void 0?null:f],u},useContext:Ta,useEffect:pL,useImperativeHandle:function(u,f,g){g=g!=null?g.concat([u]):null,fB(4194308,4,yL.bind(null,f,u),g)},useLayoutEffect:function(u,f){return fB(4194308,4,u,f)},useInsertionEffect:function(u,f){fB(4,2,u,f)},useMemo:function(u,f){var g=li();f=f===void 0?null:f;var b=u();if(Bf){As(!0);try{u()}finally{As(!1)}}return g.memoizedState=[b,f],b},useReducer:function(u,f,g){var b=li();if(g!==void 0){var C=g(f);if(Bf){As(!0);try{g(f)}finally{As(!1)}}}else C=f;return b.memoizedState=b.baseState=C,u={pending:null,lanes:0,dispatch:null,lastRenderedReducer:u,lastRenderedState:C},b.queue=u,u=u.dispatch=Rte.bind(null,Wt,u),[b.memoizedState,u]},useRef:function(u){var f=li();return u={current:u},f.memoizedState=u},useState:function(u){u=ZT(u);var f=u.queue,g=NL.bind(null,Wt,f);return f.dispatch=g,[u.memoizedState,g]},useDebugValue:nA,useDeferredValue:function(u,f){var g=li();return rA(g,u,f)},useTransition:function(){var u=ZT(!1);return u=EL.bind(null,Wt,u.queue,!0,!1),li().memoizedState=u,[!1,u]},useSyncExternalStore:function(u,f,g){var b=Wt,C=li();if(dn){if(g===void 0)throw Error(r(407));g=g()}else{if(g=f(),cr===null)throw Error(r(349));(rn&127)!==0||Z5(b,f,g)}C.memoizedState=g;var A={value:g,getSnapshot:f};return C.queue=A,pL(tL.bind(null,b,A,u),[u]),b.flags|=2048,wp(9,{destroy:void 0},eL.bind(null,b,A,g,f),null),g},useId:function(){var u=li(),f=cr.identifierPrefix;if(dn){var g=nc,b=tc;g=(b&~(1<<32-Qn(b)-1)).toString(32)+g,f="_"+f+"R_"+g,g=cB++,0<g&&(f+="H"+g.toString(32)),f+="_"}else g=Ate++,f="_"+f+"r_"+g.toString(32)+"_";return u.memoizedState=f},useHostTransitionStatus:aA,useFormState:dL,useActionState:dL,useOptimistic:function(u){var f=li();f.memoizedState=f.baseState=u;var g={pending:null,lanes:0,dispatch:null,lastRenderedReducer:null,lastRenderedState:null};return f.queue=g,f=iA.bind(null,Wt,!0,g),g.dispatch=f,[u,f]},useMemoCache:QT,useCacheRefresh:function(){return li().memoizedState=jte.bind(null,Wt)},useEffectEvent:function(u){var f=li(),g={impl:u};return f.memoizedState=g,function(){if((Rn&2)!==0)throw Error(r(440));return g.impl.apply(void 0,arguments)}}},oA={readContext:Ta,use:uB,useCallback:BL,useContext:Ta,useEffect:tA,useImperativeHandle:vL,useInsertionEffect:xL,useLayoutEffect:bL,useMemo:wL,useReducer:hB,useRef:mL,useState:function(){return hB(ad)},useDebugValue:nA,useDeferredValue:function(u,f){var g=ys();return CL(g,Zn.memoizedState,u,f)},useTransition:function(){var u=hB(ad)[0],f=ys().memoizedState;return[typeof u=="boolean"?u:Ax(u),f]},useSyncExternalStore:X5,useId:AL,useHostTransitionStatus:aA,useFormState:uL,useActionState:uL,useOptimistic:function(u,f){var g=ys();return sL(g,Zn,u,f)},useMemoCache:QT,useCacheRefresh:kL};oA.useEffectEvent=gL;var jL={readContext:Ta,use:uB,useCallback:BL,useContext:Ta,useEffect:tA,useImperativeHandle:vL,useInsertionEffect:xL,useLayoutEffect:bL,useMemo:wL,useReducer:XT,useRef:mL,useState:function(){return XT(ad)},useDebugValue:nA,useDeferredValue:function(u,f){var g=ys();return Zn===null?rA(g,u,f):CL(g,Zn.memoizedState,u,f)},useTransition:function(){var u=XT(ad)[0],f=ys().memoizedState;return[typeof u=="boolean"?u:Ax(u),f]},useSyncExternalStore:X5,useId:AL,useHostTransitionStatus:aA,useFormState:fL,useActionState:fL,useOptimistic:function(u,f){var g=ys();return Zn!==null?sL(g,Zn,u,f):(g.baseState=u,[u,g.queue.dispatch])},useMemoCache:QT,useCacheRefresh:kL};jL.useEffectEvent=gL;function lA(u,f,g,b){f=u.memoizedState,g=g(b,f),g=g==null?f:m({},f,g),u.memoizedState=g,u.lanes===0&&(u.updateQueue.baseState=g)}var cA={enqueueSetState:function(u,f,g){u=u._reactInternals;var b=lo(),C=Bu(b);C.payload=f,g!=null&&(C.callback=g),f=wu(u,C,b),f!==null&&(Ri(f,u,b),Cx(f,u,b))},enqueueReplaceState:function(u,f,g){u=u._reactInternals;var b=lo(),C=Bu(b);C.tag=1,C.payload=f,g!=null&&(C.callback=g),f=wu(u,C,b),f!==null&&(Ri(f,u,b),Cx(f,u,b))},enqueueForceUpdate:function(u,f){u=u._reactInternals;var g=lo(),b=Bu(g);b.tag=2,f!=null&&(b.callback=f),f=wu(u,b,g),f!==null&&(Ri(f,u,g),Cx(f,u,g))}};function RL(u,f,g,b,C,A,F){return u=u.stateNode,typeof u.shouldComponentUpdate=="function"?u.shouldComponentUpdate(b,A,F):f.prototype&&f.prototype.isPureReactComponent?!px(g,b)||!px(C,A):!0}function PL(u,f,g,b){u=f.state,typeof f.componentWillReceiveProps=="function"&&f.componentWillReceiveProps(g,b),typeof f.UNSAFE_componentWillReceiveProps=="function"&&f.UNSAFE_componentWillReceiveProps(g,b),f.state!==u&&cA.enqueueReplaceState(f,f.state,null)}function wf(u,f){var g=f;if("ref"in f){g={};for(var b in f)b!=="ref"&&(g[b]=f[b])}if(u=u.defaultProps){g===f&&(g=m({},g));for(var C in u)g[C]===void 0&&(g[C]=u[C])}return g}function LL(u){Kv(u)}function OL(u){console.error(u)}function ML(u){Kv(u)}function gB(u,f){try{var g=u.onUncaughtError;g(f.value,{componentStack:f.stack})}catch(b){setTimeout(function(){throw b})}}function FL(u,f,g){try{var b=u.onCaughtError;b(g.value,{componentStack:g.stack,errorBoundary:f.tag===1?f.stateNode:null})}catch(C){setTimeout(function(){throw C})}}function dA(u,f,g){return g=Bu(g),g.tag=3,g.payload={element:null},g.callback=function(){gB(u,f)},g}function UL(u){return u=Bu(u),u.tag=3,u}function VL(u,f,g,b){var C=g.type.getDerivedStateFromError;if(typeof C=="function"){var A=b.value;u.payload=function(){return C(A)},u.callback=function(){FL(f,g,b)}}var F=g.stateNode;F!==null&&typeof F.componentDidCatch=="function"&&(u.callback=function(){FL(f,g,b),typeof C!="function"&&(ku===null?ku=new Set([this]):ku.add(this));var q=b.stack;this.componentDidCatch(b.value,{componentStack:q!==null?q:""})})}function Pte(u,f,g,b,C){if(g.flags|=32768,b!==null&&typeof b=="object"&&typeof b.then=="function"){if(f=g.alternate,f!==null&&mp(f,g,C,!0),g=so.current,g!==null){switch(g.tag){case 31:case 13:return Uo===null?kB():g.alternate===null&&ss===0&&(ss=3),g.flags&=-257,g.flags|=65536,g.lanes=C,b===rB?g.flags|=16384:(f=g.updateQueue,f===null?g.updateQueue=new Set([b]):f.add(b),PA(u,b,C)),!1;case 22:return g.flags|=65536,b===rB?g.flags|=16384:(f=g.updateQueue,f===null?(f={transitions:null,markerInstances:null,retryQueue:new Set([b])},g.updateQueue=f):(g=f.retryQueue,g===null?f.retryQueue=new Set([b]):g.add(b)),PA(u,b,C)),!1}throw Error(r(435,g.tag))}return PA(u,b,C),kB(),!1}if(dn)return f=so.current,f!==null?((f.flags&65536)===0&&(f.flags|=256),f.flags|=65536,f.lanes=C,b!==NT&&(u=Error(r(422),{cause:b}),bx(Lo(u,g)))):(b!==NT&&(f=Error(r(423),{cause:b}),bx(Lo(f,g))),u=u.current.alternate,u.flags|=65536,C&=-C,u.lanes|=C,b=Lo(b,g),C=dA(u.stateNode,b,C),UT(u,C),ss!==4&&(ss=2)),!1;var A=Error(r(520),{cause:b});if(A=Lo(A,g),Ox===null?Ox=[A]:Ox.push(A),ss!==4&&(ss=2),f===null)return!0;b=Lo(b,g),g=f;do{switch(g.tag){case 3:return g.flags|=65536,u=C&-C,g.lanes|=u,u=dA(g.stateNode,b,u),UT(g,u),!1;case 1:if(f=g.type,A=g.stateNode,(g.flags&128)===0&&(typeof f.getDerivedStateFromError=="function"||A!==null&&typeof A.componentDidCatch=="function"&&(ku===null||!ku.has(A))))return g.flags|=65536,C&=-C,g.lanes|=C,C=UL(C),VL(C,u,g,b),UT(g,C),!1}g=g.return}while(g!==null);return!1}var uA=Error(r(461)),Ds=!1;function Aa(u,f,g,b){f.child=u===null?z5(f,null,g,b):vf(f,u.child,g,b)}function GL(u,f,g,b,C){g=g.render;var A=f.ref;if("ref"in b){var F={};for(var q in b)q!=="ref"&&(F[q]=b[q])}else F=b;return gf(f),b=qT(u,f,g,F,A,C),q=KT(),u!==null&&!Ds?(WT(u,f,C),id(u,f,C)):(dn&&q&&AT(f),f.flags|=1,Aa(u,f,b,C),f.child)}function $L(u,f,g,b,C){if(u===null){var A=g.type;return typeof A=="function"&&!ET(A)&&A.defaultProps===void 0&&g.compare===null?(f.tag=15,f.type=A,HL(u,f,A,b,C)):(u=Jv(g.type,null,b,f,f.mode,C),u.ref=f.ref,u.return=f,f.child=u)}if(A=u.child,!yA(u,C)){var F=A.memoizedProps;if(g=g.compare,g=g!==null?g:px,g(F,b)&&u.ref===f.ref)return id(u,f,C)}return f.flags|=1,u=ed(A,b),u.ref=f.ref,u.return=f,f.child=u}function HL(u,f,g,b,C){if(u!==null){var A=u.memoizedProps;if(px(A,b)&&u.ref===f.ref)if(Ds=!1,f.pendingProps=b=A,yA(u,C))(u.flags&131072)!==0&&(Ds=!0);else return f.lanes=u.lanes,id(u,f,C)}return hA(u,f,g,b,C)}
vendor: 12,949 bytes, line 48
48function zL(u,f,g,b){var C=b.children,A=u!==null?u.memoizedState:null;if(u===null&&f.stateNode===null&&(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),b.mode==="hidden"){if((f.flags&128)!==0){if(A=A!==null?A.baseLanes|g:g,u!==null){for(b=f.child=u.child,C=0;b!==null;)C=C|b.lanes|b.childLanes,b=b.sibling;b=C&~A}else b=0,f.child=null;return qL(u,f,A,g,b)}if((g&536870912)!==0)f.memoizedState={baseLanes:0,cachePool:null},u!==null&&tB(f,A!==null?A.cachePool:null),A!==null?W5(f,A):GT(),Y5(f);else return b=f.lanes=536870912,qL(u,f,A!==null?A.baseLanes|g:g,g,b)}else A!==null?(tB(f,A.cachePool),W5(f,A),Eu(),f.memoizedState=null):(u!==null&&tB(f,null),GT(),Eu());return Aa(u,f,C,g),f.child}function _x(u,f){return u!==null&&u.tag===22||f.stateNode!==null||(f.stateNode={_visibility:1,_pendingMarkers:null,_retryCache:null,_transitions:null}),f.sibling}function qL(u,f,g,b,C){var A=LT();return A=A===null?null:{parent:_s._currentValue,pool:A},f.memoizedState={baseLanes:g,cachePool:A},u!==null&&tB(f,null),GT(),Y5(f),u!==null&&mp(u,f,b,!0),f.childLanes=C,null}function xB(u,f){return f=yB({mode:f.mode,children:f.children},u.mode),f.ref=u.ref,u.child=f,f.return=u,f}function KL(u,f,g){return vf(f,u.child,null,g),u=xB(f,f.pendingProps),u.flags|=2,ao(f),f.memoizedState=null,u}function Lte(u,f,g){var b=f.pendingProps,C=(f.flags&128)!==0;if(f.flags&=-129,u===null){if(dn){if(b.mode==="hidden")return u=xB(f,b),f.lanes=536870912,_x(null,u);if(HT(f),(u=Nr)?(u=aM(u,Fo),u=u!==null&&u.data==="&"?u:null,u!==null&&(f.memoizedState={dehydrated:u,treeContext:gu!==null?{id:tc,overflow:nc}:null,retryLane:536870912,hydrationErrors:null},g=_5(u),g.return=f,f.child=g,Sa=f,Nr=null)):u=null,u===null)throw bu(f);return f.lanes=536870912,null}return xB(f,b)}var A=u.memoizedState;if(A!==null){var F=A.dehydrated;if(HT(f),C)if(f.flags&256)f.flags&=-257,f=KL(u,f,g);else if(f.memoizedState!==null)f.child=u.child,f.flags|=128,f=null;else throw Error(r(558));else if(Ds||mp(u,f,g,!1),C=(g&u.childLanes)!==0,Ds||C){if(b=cr,b!==null&&(F=et(b,g),F!==0&&F!==A.retryLane))throw A.retryLane=F,hf(u,F),Ri(b,u,F),uA;kB(),f=KL(u,f,g)}else u=A.treeContext,Nr=Vo(F.nextSibling),Sa=f,dn=!0,xu=null,Fo=!1,u!==null&&j5(f,u),f=xB(f,b),f.flags|=4096;return f}return u=ed(u.child,{mode:b.mode,children:b.children}),u.ref=f.ref,f.child=u,u.return=f,u}function bB(u,f){var g=f.ref;if(g===null)u!==null&&u.ref!==null&&(f.flags|=4194816);else{if(typeof g!="function"&&typeof g!="object")throw Error(r(284));(u===null||u.ref!==g)&&(f.flags|=4194816)}}function hA(u,f,g,b,C){return gf(f),g=qT(u,f,g,b,void 0,C),b=KT(),u!==null&&!Ds?(WT(u,f,C),id(u,f,C)):(dn&&b&&AT(f),f.flags|=1,Aa(u,f,g,C),f.child)}function WL(u,f,g,b,C,A){return gf(f),f.updateQueue=null,g=J5(f,b,g,C),Q5(u),b=KT(),u!==null&&!Ds?(WT(u,f,A),id(u,f,A)):(dn&&b&&AT(f),f.flags|=1,Aa(u,f,g,A),f.child)}function YL(u,f,g,b,C){if(gf(f),f.stateNode===null){var A=dp,F=g.contextType;typeof F=="object"&&F!==null&&(A=Ta(F)),A=new g(b,A),f.memoizedState=A.state!==null&&A.state!==void 0?A.state:null,A.updater=cA,f.stateNode=A,A._reactInternals=f,A=f.stateNode,A.props=b,A.state=f.memoizedState,A.refs={},MT(f),F=g.contextType,A.context=typeof F=="object"&&F!==null?Ta(F):dp,A.state=f.memoizedState,F=g.getDerivedStateFromProps,typeof F=="function"&&(lA(f,g,F,b),A.state=f.memoizedState),typeof g.getDerivedStateFromProps=="function"||typeof A.getSnapshotBeforeUpdate=="function"||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(F=A.state,typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount(),F!==A.state&&cA.enqueueReplaceState(A,A.state,null),Sx(f,b,A,C),Ex(),A.state=f.memoizedState),typeof A.componentDidMount=="function"&&(f.flags|=4194308),b=!0}else if(u===null){A=f.stateNode;var q=f.memoizedProps,ae=wf(g,q);A.props=ae;var Ne=A.context,Ue=g.contextType;F=dp,typeof Ue=="object"&&Ue!==null&&(F=Ta(Ue));var $e=g.getDerivedStateFromProps;Ue=typeof $e=="function"||typeof A.getSnapshotBeforeUpdate=="function",q=f.pendingProps!==q,Ue||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(q||Ne!==F)&&PL(f,A,b,F),vu=!1;var _e=f.memoizedState;A.state=_e,Sx(f,b,A,C),Ex(),Ne=f.memoizedState,q||_e!==Ne||vu?(typeof $e=="function"&&(lA(f,g,$e,b),Ne=f.memoizedState),(ae=vu||RL(f,g,ae,b,_e,Ne,F))?(Ue||typeof A.UNSAFE_componentWillMount!="function"&&typeof A.componentWillMount!="function"||(typeof A.componentWillMount=="function"&&A.componentWillMount(),typeof A.UNSAFE_componentWillMount=="function"&&A.UNSAFE_componentWillMount()),typeof A.componentDidMount=="function"&&(f.flags|=4194308)):(typeof A.componentDidMount=="function"&&(f.flags|=4194308),f.memoizedProps=b,f.memoizedState=Ne),A.props=b,A.state=Ne,A.context=F,b=ae):(typeof A.componentDidMount=="function"&&(f.flags|=4194308),b=!1)}else{A=f.stateNode,FT(u,f),F=f.memoizedProps,Ue=wf(g,F),A.props=Ue,$e=f.pendingProps,_e=A.context,Ne=g.contextType,ae=dp,typeof Ne=="object"&&Ne!==null&&(ae=Ta(Ne)),q=g.getDerivedStateFromProps,(Ne=typeof q=="function"||typeof A.getSnapshotBeforeUpdate=="function")||typeof A.UNSAFE_componentWillReceiveProps!="function"&&typeof A.componentWillReceiveProps!="function"||(F!==$e||_e!==ae)&&PL(f,A,b,ae),vu=!1,_e=f.memoizedState,A.state=_e,Sx(f,b,A,C),Ex();var Pe=f.memoizedState;F!==$e||_e!==Pe||vu||u!==null&&u.dependencies!==null&&Zv(u.dependencies)?(typeof q=="function"&&(lA(f,g,q,b),Pe=f.memoizedState),(Ue=vu||RL(f,g,Ue,b,_e,Pe,ae)||u!==null&&u.dependencies!==null&&Zv(u.dependencies))?(Ne||typeof A.UNSAFE_componentWillUpdate!="function"&&typeof A.componentWillUpdate!="function"||(typeof A.componentWillUpdate=="function"&&A.componentWillUpdate(b,Pe,ae),typeof A.UNSAFE_componentWillUpdate=="function"&&A.UNSAFE_componentWillUpdate(b,Pe,ae)),typeof A.componentDidUpdate=="function"&&(f.flags|=4),typeof A.getSnapshotBeforeUpdate=="function"&&(f.flags|=1024)):(typeof A.componentDidUpdate!="function"||F===u.memoizedProps&&_e===u.memoizedState||(f.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===u.memoizedProps&&_e===u.memoizedState||(f.flags|=1024),f.memoizedProps=b,f.memoizedState=Pe),A.props=b,A.state=Pe,A.context=ae,b=Ue):(typeof A.componentDidUpdate!="function"||F===u.memoizedProps&&_e===u.memoizedState||(f.flags|=4),typeof A.getSnapshotBeforeUpdate!="function"||F===u.memoizedProps&&_e===u.memoizedState||(f.flags|=1024),b=!1)}return A=b,bB(u,f),b=(f.flags&128)!==0,A||b?(A=f.stateNode,g=b&&typeof g.getDerivedStateFromError!="function"?null:A.render(),f.flags|=1,u!==null&&b?(f.child=vf(f,u.child,null,C),f.child=vf(f,null,g,C)):Aa(u,f,g,C),f.memoizedState=A.state,u=f.child):u=id(u,f,C),u}function QL(u,f,g,b){return mf(),f.flags|=256,Aa(u,f,g,b),f.child}var fA={dehydrated:null,treeContext:null,retryLane:0,hydrationErrors:null};function mA(u){return{baseLanes:u,cachePool:F5()}}function pA(u,f,g){return u=u!==null?u.childLanes&~g:0,f&&(u|=oo),u}function JL(u,f,g){var b=f.pendingProps,C=!1,A=(f.flags&128)!==0,F;if((F=A)||(F=u!==null&&u.memoizedState===null?!1:(bs.current&2)!==0),F&&(C=!0,f.flags&=-129),F=(f.flags&32)!==0,f.flags&=-33,u===null){if(dn){if(C?Cu(f):Eu(),(u=Nr)?(u=aM(u,Fo),u=u!==null&&u.data!=="&"?u:null,u!==null&&(f.memoizedState={dehydrated:u,treeContext:gu!==null?{id:tc,overflow:nc}:null,retryLane:536870912,hydrationErrors:null},g=_5(u),g.return=f,f.child=g,Sa=f,Nr=null)):u=null,u===null)throw bu(f);return JA(u)?f.lanes=32:f.lanes=536870912,null}var q=b.children;return b=b.fallback,C?(Eu(),C=f.mode,q=yB({mode:"hidden",children:q},C),b=ff(b,C,g,null),q.return=f,b.return=f,q.sibling=b,f.child=q,b=f.child,b.memoizedState=mA(g),b.childLanes=pA(u,F,g),f.memoizedState=fA,_x(null,b)):(Cu(f),gA(f,q))}var ae=u.memoizedState;if(ae!==null&&(q=ae.dehydrated,q!==null)){if(A)f.flags&256?(Cu(f),f.flags&=-257,f=xA(u,f,g)):f.memoizedState!==null?(Eu(),f.child=u.child,f.flags|=128,f=null):(Eu(),q=b.fallback,C=f.mode,b=yB({mode:"visible",children:b.children},C),q=ff(q,C,g,null),q.flags|=2,b.return=f,q.return=f,b.sibling=q,f.child=b,vf(f,u.child,null,g),b=f.child,b.memoizedState=mA(g),b.childLanes=pA(u,F,g),f.memoizedState=fA,f=_x(null,b));else if(Cu(f),JA(q)){if(F=q.nextSibling&&q.nextSibling.dataset,F)var Ne=F.dgst;F=Ne,b=Error(r(419)),b.stack="",b.digest=F,bx({value:b,source:null,stack:null}),f=xA(u,f,g)}else if(Ds||mp(u,f,g,!1),F=(g&u.childLanes)!==0,Ds||F){if(F=cr,F!==null&&(b=et(F,g),b!==0&&b!==ae.retryLane))throw ae.retryLane=b,hf(u,b),Ri(F,u,b),uA;QA(q)||kB(),f=xA(u,f,g)}else QA(q)?(f.flags|=192,f.child=u.child,f=null):(u=ae.treeContext,Nr=Vo(q.nextSibling),Sa=f,dn=!0,xu=null,Fo=!1,u!==null&&j5(f,u),f=gA(f,b.children),f.flags|=4096);return f}return C?(Eu(),q=b.fallback,C=f.mode,ae=u.child,Ne=ae.sibling,b=ed(ae,{mode:"hidden",children:b.children}),b.subtreeFlags=ae.subtreeFlags&65011712,Ne!==null?q=ed(Ne,q):(q=ff(q,C,g,null),q.flags|=2),q.return=f,b.return=f,b.sibling=q,f.child=b,_x(null,b),b=f.child,q=u.child.memoizedState,q===null?q=mA(g):(C=q.cachePool,C!==null?(ae=_s._currentValue,C=C.parent!==ae?{parent:ae,pool:ae}:C):C=F5(),q={baseLanes:q.baseLanes|g,cachePool:C}),b.memoizedState=q,b.childLanes=pA(u,F,g),f.memoizedState=fA,_x(u.child,b)):(Cu(f),g=u.child,u=g.sibling,g=ed(g,{mode:"visible",children:b.children}),g.return=f,g.sibling=null,u!==null&&(F=f.deletions,F===null?(f.deletions=[u],f.flags|=16):F.push(u)),f.child=g,f.memoizedState=null,g)}function gA(u,f){return f=yB({mode:"visible",children:f},u.mode),f.return=u,u.child=f}function yB(u,f){return u=ro(22,u,null,f),u.lanes=0,u}function xA(u,f,g){return vf(f,u.child,null,g),u=gA(f,f.pendingProps.children),u.flags|=2,f.memoizedState=null,u}function XL(u,f,g){u.lanes|=f;var b=u.alternate;b!==null&&(b.lanes|=f),DT(u.return,f,g)}function bA(u,f,g,b,C,A){var F=u.memoizedState;F===null?u.memoizedState={isBackwards:f,rendering:null,renderingStartTime:0,last:b,tail:g,tailMode:C,treeForkCount:A}:(F.isBackwards=f,F.rendering=null,F.renderingStartTime=0,F.last=b,F.tail=g,F.tailMode=C,F.treeForkCount=A)}function ZL(u,f,g){var b=f.pendingProps,C=b.revealOrder,A=b.tail;b=b.children;var F=bs.current,q=(F&2)!==0;if(q?(F=F&1|2,f.flags|=128):F&=1,de(bs,F),Aa(u,f,b,g),b=dn?xx:0,!q&&u!==null&&(u.flags&128)!==0)e:for(u=f.child;u!==null;){if(u.tag===13)u.memoizedState!==null&&XL(u,g,f);else if(u.tag===19)XL(u,g,f);else if(u.child!==null){u.child.return=u,u=u.child;continue}if(u===f)break e;for(;u.sibling===null;){if(u.return===null||u.return===f)break e;u=u.return}u.sibling.return=u.return,u=u.sibling}switch(C){case"forwards":for(g=f.child,C=null;g!==null;)u=g.alternate,u!==null&&oB(u)===null&&(C=g),g=g.sibling;g=C,g===null?(C=f.child,f.child=null):(C=g.sibling,g.sibling=null),bA(f,!1,C,g,A,b);break;case"backwards":case"unstable_legacy-backwards":for(g=null,C=f.child,f.child=null;C!==null;){if(u=C.alternate,u!==null&&oB(u)===null){f.child=C;break}u=C.sibling,C.sibling=g,g=C,C=u}bA(f,!0,g,null,A,b);break;case"together":bA(f,!1,null,null,void 0,b);break;default:f.memoizedState=null}return f.child}function id(u,f,g){if(u!==null&&(f.dependencies=u.dependencies),Au|=f.lanes,(g&f.childLanes)===0)if(u!==null){if(mp(u,f,g,!1),(g&f.childLanes)===0)return null}else return null;if(u!==null&&f.child!==u.child)throw Error(r(153));if(f.child!==null){for(u=f.child,g=ed(u,u.pendingProps),f.child=g,g.return=f;u.sibling!==null;)u=u.sibling,g=g.sibling=ed(u,u.pendingProps),g.return=f;g.sibling=null}return f.child}function yA(u,f){return(u.lanes&f)!==0?!0:(u=u.dependencies,!!(u!==null&&Zv(u)))}function Ote(u,f,g){switch(f.tag){case 3:Ie(f,f.stateNode.containerInfo),yu(f,_s,u.memoizedState.cache),mf();break;case 27:case 5:ye(f);break;case 4:Ie(f,f.stateNode.containerInfo);break;case 10:yu(f,f.type,f.memoizedProps.value);break;case 31:if(f.memoizedState!==null)return f.flags|=128,HT(f),null;break;case 13:var b=f.memoizedState;if(b!==null)return b.dehydrated!==null?(Cu(f),f.flags|=128,null):(g&f.child.childLanes)!==0?JL(u,f,g):(Cu(f),u=id(u,f,g),u!==null?u.sibling:null);Cu(f);break;case 19:var C=(u.flags&128)!==0;if(b=(g&f.childLanes)!==0,b||(mp(u,f,g,!1),b=(g&f.childLanes)!==0),C){if(b)return ZL(u,f,g);f.flags|=128}if(C=f.memoizedState,C!==null&&(C.rendering=null,C.tail=null,C.lastEffect=null),de(bs,bs.current),b)break;return null;case 22:return f.lanes=0,zL(u,f,g,f.pendingProps);case 24:yu(f,_s,u.memoizedState.cache)}return id(u,f,g)}function eO(u,f,g){if(u!==null)if(u.memoizedProps!==f.pendingProps)Ds=!0;else{if(!yA(u,g)&&(f.flags&128)===0)return Ds=!1,Ote(u,f,g);Ds=(u.flags&131072)!==0}else Ds=!1,dn&&(f.flags&1048576)!==0&&D5(f,xx,f.index);switch(f.lanes=0,f.tag){case 16:e:{var b=f.pendingProps;if(u=bf(f.elementType),f.type=u,typeof u=="function")ET(u)?(b=wf(u,b),f.tag=1,f=YL(null,f,u,b,g)):(f.tag=0,f=hA(null,f,u,b,g));else{if(u!=null){var C=u.$$typeof;if(C===k){f.tag=11,f=GL(null,f,u,b,g);break e}else if(C===_){f.tag=14,f=$L(null,f,u,b,g);break e}}
vendor: 4,705 bytes, line 48
48throw f=ee(u)||u,Error(r(306,f,""))}}return f;case 0:return hA(u,f,f.type,f.pendingProps,g);case 1:return b=f.type,C=wf(b,f.pendingProps),YL(u,f,b,C,g);case 3:e:{if(Ie(f,f.stateNode.containerInfo),u===null)throw Error(r(387));b=f.pendingProps;var A=f.memoizedState;C=A.element,FT(u,f),Sx(f,b,null,g);var F=f.memoizedState;if(b=F.cache,yu(f,_s,b),b!==A.cache&&jT(f,[_s],g,!0),Ex(),b=F.element,A.isDehydrated)if(A={element:b,isDehydrated:!1,cache:F.cache},f.updateQueue.baseState=A,f.memoizedState=A,f.flags&256){f=QL(u,f,b,g);break e}else if(b!==C){C=Lo(Error(r(424)),f),bx(C),f=QL(u,f,b,g);break e}else{switch(u=f.stateNode.containerInfo,u.nodeType){case 9:u=u.body;break;default:u=u.nodeName==="HTML"?u.ownerDocument.body:u}for(Nr=Vo(u.firstChild),Sa=f,dn=!0,xu=null,Fo=!0,g=z5(f,null,b,g),f.child=g;g;)g.flags=g.flags&-3|4096,g=g.sibling}else{if(mf(),b===C){f=id(u,f,g);break e}Aa(u,f,b,g)}f=f.child}return f;case 26:return bB(u,f),u===null?(g=uM(f.type,null,f.pendingProps,null))?f.memoizedState=g:dn||(g=f.type,u=f.pendingProps,b=PB(J.current).createElement(g),b[Xn]=f,b[Sn]=u,ka(b,g,u),vr(b),f.stateNode=b):f.memoizedState=uM(f.type,u.memoizedProps,f.pendingProps,u.memoizedState),null;case 27:return ye(f),u===null&&dn&&(b=f.stateNode=lM(f.type,f.pendingProps,J.current),Sa=f,Fo=!0,C=Nr,Du(f.type)?(XA=C,Nr=Vo(b.firstChild)):Nr=C),Aa(u,f,f.pendingProps.children,g),bB(u,f),u===null&&(f.flags|=4194304),f.child;case 5:return u===null&&dn&&((C=b=Nr)&&(b=fne(b,f.type,f.pendingProps,Fo),b!==null?(f.stateNode=b,Sa=f,Nr=Vo(b.firstChild),Fo=!1,C=!0):C=!1),C||bu(f)),ye(f),C=f.type,A=f.pendingProps,F=u!==null?u.memoizedProps:null,b=A.children,KA(C,A)?b=null:F!==null&&KA(C,F)&&(f.flags|=32),f.memoizedState!==null&&(C=qT(u,f,kte,null,null,g),zx._currentValue=C),bB(u,f),Aa(u,f,b,g),f.child;case 6:return u===null&&dn&&((u=g=Nr)&&(g=mne(g,f.pendingProps,Fo),g!==null?(f.stateNode=g,Sa=f,Nr=null,u=!0):u=!1),u||bu(f)),null;case 13:return JL(u,f,g);case 4:return Ie(f,f.stateNode.containerInfo),b=f.pendingProps,u===null?f.child=vf(f,null,b,g):Aa(u,f,b,g),f.child;case 11:return GL(u,f,f.type,f.pendingProps,g);case 7:return Aa(u,f,f.pendingProps,g),f.child;case 8:return Aa(u,f,f.pendingProps.children,g),f.child;case 12:return Aa(u,f,f.pendingProps.children,g),f.child;case 10:return b=f.pendingProps,yu(f,f.type,b.value),Aa(u,f,b.children,g),f.child;case 9:return C=f.type._context,b=f.pendingProps.children,gf(f),C=Ta(C),b=b(C),f.flags|=1,Aa(u,f,b,g),f.child;case 14:return $L(u,f,f.type,f.pendingProps,g);case 15:return HL(u,f,f.type,f.pendingProps,g);case 19:return ZL(u,f,g);case 31:return Lte(u,f,g);case 22:return zL(u,f,g,f.pendingProps);case 24:return gf(f),b=Ta(_s),u===null?(C=LT(),C===null&&(C=cr,A=RT(),C.pooledCache=A,A.refCount++,A!==null&&(C.pooledCacheLanes|=g),C=A),f.memoizedState={parent:b,cache:C},MT(f),yu(f,_s,C)):((u.lanes&g)!==0&&(FT(u,f),Sx(f,null,null,g),Ex()),C=u.memoizedState,A=f.memoizedState,C.parent!==b?(C={parent:b,cache:b},f.memoizedState=C,f.lanes===0&&(f.memoizedState=f.updateQueue.baseState=C),yu(f,_s,b)):(b=A.cache,yu(f,_s,b),b!==C.cache&&jT(f,[_s],g,!0))),Aa(u,f,f.pendingProps.children,g),f.child;case 29:throw f.pendingProps}throw Error(r(156,f.tag))}function od(u){u.flags|=4}function vA(u,f,g,b,C){if((f=(u.mode&32)!==0)&&(f=!1),f){if(u.flags|=16777216,(C&335544128)===C)if(u.stateNode.complete)u.flags|=8192;else if(AO())u.flags|=8192;else throw yf=rB,OT}else u.flags&=-16777217}function tO(u,f){if(f.type!=="stylesheet"||(f.state.loading&4)!==0)u.flags&=-16777217;else if(u.flags|=16777216,!gM(f))if(AO())u.flags|=8192;else throw yf=rB,OT}function vB(u,f){f!==null&&(u.flags|=4),u.flags&16384&&(f=u.tag!==22?bi():536870912,u.lanes|=f,Tp|=f)}function Ix(u,f){if(!dn)switch(u.tailMode){case"hidden":f=u.tail;for(var g=null;f!==null;)f.alternate!==null&&(g=f),f=f.sibling;g===null?u.tail=null:g.sibling=null;break;case"collapsed":g=u.tail;for(var b=null;g!==null;)g.alternate!==null&&(b=g),g=g.sibling;b===null?f||u.tail===null?u.tail=null:u.tail.sibling=null:b.sibling=null}}function _r(u){var f=u.alternate!==null&&u.alternate.child===u.child,g=0,b=0;if(f)for(var C=u.child;C!==null;)g|=C.lanes|C.childLanes,b|=C.subtreeFlags&65011712,b|=C.flags&65011712,C.return=u,C=C.sibling;else for(C=u.child;C!==null;)g|=C.lanes|C.childLanes,b|=C.subtreeFlags,b|=C.flags,C.return=u,C=C.sibling;return u.subtreeFlags|=b,u.childLanes=g,f}function Mte(u,f,g){var b=f.pendingProps;switch(kT(f),f.tag){case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return _r(f),null;case 1:return _r(f),null;case 3:return g=f.stateNode,b=null,u!==null&&(b=u.memoizedState.cache),f.memoizedState.cache!==b&&(f.flags|=2048),rd(_s),pe(),g.pendingContext&&(g.context=g.pen
vendor: 3,970 bytes, line 48
48dingContext,g.pendingContext=null),(u===null||u.child===null)&&(fp(f)?od(f):u===null||u.memoizedState.isDehydrated&&(f.flags&256)===0||(f.flags|=1024,_T())),_r(f),null;case 26:var C=f.type,A=f.memoizedState;return u===null?(od(f),A!==null?(_r(f),tO(f,A)):(_r(f),vA(f,C,null,b,g))):A?A!==u.memoizedState?(od(f),_r(f),tO(f,A)):(_r(f),f.flags&=-16777217):(u=u.memoizedProps,u!==b&&od(f),_r(f),vA(f,C,u,b,g)),null;case 27:if(he(f),g=J.current,C=f.type,u!==null&&f.stateNode!=null)u.memoizedProps!==b&&od(f);else{if(!b){if(f.stateNode===null)throw Error(r(166));return _r(f),null}u=W.current,fp(f)?R5(f):(u=lM(C,b,g),f.stateNode=u,od(f))}return _r(f),null;case 5:if(he(f),C=f.type,u!==null&&f.stateNode!=null)u.memoizedProps!==b&&od(f);else{if(!b){if(f.stateNode===null)throw Error(r(166));return _r(f),null}if(A=W.current,fp(f))R5(f);else{var F=PB(J.current);switch(A){case 1:A=F.createElementNS("http://www.w3.org/2000/svg",C);break;case 2:A=F.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;default:switch(C){case"svg":A=F.createElementNS("http://www.w3.org/2000/svg",C);break;case"math":A=F.createElementNS("http://www.w3.org/1998/Math/MathML",C);break;case"script":A=F.createElement("div"),A.innerHTML="<script><\/script>",A=A.removeChild(A.firstChild);break;case"select":A=typeof b.is=="string"?F.createElement("select",{is:b.is}):F.createElement("select"),b.multiple?A.multiple=!0:b.size&&(A.size=b.size);break;default:A=typeof b.is=="string"?F.createElement(C,{is:b.is}):F.createElement(C)}}A[Xn]=f,A[Sn]=b;e:for(F=f.child;F!==null;){if(F.tag===5||F.tag===6)A.appendChild(F.stateNode);else if(F.tag!==4&&F.tag!==27&&F.child!==null){F.child.return=F,F=F.child;continue}if(F===f)break e;for(;F.sibling===null;){if(F.return===null||F.return===f)break e;F=F.return}F.sibling.return=F.return,F=F.sibling}f.stateNode=A;e:switch(ka(A,C,b),C){case"button":case"input":case"select":case"textarea":b=!!b.autoFocus;break e;case"img":b=!0;break e;default:b=!1}b&&od(f)}}return _r(f),vA(f,f.type,u===null?null:u.memoizedProps,f.pendingProps,g),null;case 6:if(u&&f.stateNode!=null)u.memoizedProps!==b&&od(f);else{if(typeof b!="string"&&f.stateNode===null)throw Error(r(166));if(u=J.current,fp(f)){if(u=f.stateNode,g=f.memoizedProps,b=null,C=Sa,C!==null)switch(C.tag){case 27:case 5:b=C.memoizedProps}u[Xn]=f,u=!!(u.nodeValue===g||b!==null&&b.suppressHydrationWarning===!0||JO(u.nodeValue,g)),u||bu(f,!0)}else u=PB(u).createTextNode(b),u[Xn]=f,f.stateNode=u}return _r(f),null;case 31:if(g=f.memoizedState,u===null||u.memoizedState!==null){if(b=fp(f),g!==null){if(u===null){if(!b)throw Error(r(318));if(u=f.memoizedState,u=u!==null?u.dehydrated:null,!u)throw Error(r(557));u[Xn]=f}else mf(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;_r(f),u=!1}else g=_T(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=g),u=!0;if(!u)return f.flags&256?(ao(f),f):(ao(f),null);if((f.flags&128)!==0)throw Error(r(558))}return _r(f),null;case 13:if(b=f.memoizedState,u===null||u.memoizedState!==null&&u.memoizedState.dehydrated!==null){if(C=fp(f),b!==null&&b.dehydrated!==null){if(u===null){if(!C)throw Error(r(318));if(C=f.memoizedState,C=C!==null?C.dehydrated:null,!C)throw Error(r(317));C[Xn]=f}else mf(),(f.flags&128)===0&&(f.memoizedState=null),f.flags|=4;_r(f),C=!1}else C=_T(),u!==null&&u.memoizedState!==null&&(u.memoizedState.hydrationErrors=C),C=!0;if(!C)return f.flags&256?(ao(f),f):(ao(f),null)}return ao(f),(f.flags&128)!==0?(f.lanes=g,f):(g=b!==null,u=u!==null&&u.memoizedState!==null,g&&(b=f.child,C=null,b.alternate!==null&&b.alternate.memoizedState!==null&&b.alternate.memoizedState.cachePool!==null&&(C=b.alternate.memoizedState.cachePool.pool),A=null,b.memoizedState!==null&&b.memoizedState.cachePool!==null&&(A=b.memoizedState.cachePool.pool),A!==C&&(b.flags|=2048)),g!==u&&g&&(f.child.flags|=8192),vB(f,f.updateQueue),_r(f),null);case 4:return pe(),u===null&&GA(f.stateNode.containerInfo),_r(f),null;case 10:return rd(f.type),_r(f),null;
vendor: 24,218 bytes, line 48
48case 19:if(Y(bs),b=f.memoizedState,b===null)return _r(f),null;if(C=(f.flags&128)!==0,A=b.rendering,A===null)if(C)Ix(b,!1);else{if(ss!==0||u!==null&&(u.flags&128)!==0)for(u=f.child;u!==null;){if(A=oB(u),A!==null){for(f.flags|=128,Ix(b,!1),u=A.updateQueue,f.updateQueue=u,vB(f,u),f.subtreeFlags=0,u=g,g=f.child;g!==null;)N5(g,u),g=g.sibling;return de(bs,bs.current&1|2),dn&&td(f,b.treeForkCount),f.child}u=u.sibling}b.tail!==null&&$t()>SB&&(f.flags|=128,C=!0,Ix(b,!1),f.lanes=4194304)}else{if(!C)if(u=oB(A),u!==null){if(f.flags|=128,C=!0,u=u.updateQueue,f.updateQueue=u,vB(f,u),Ix(b,!0),b.tail===null&&b.tailMode==="hidden"&&!A.alternate&&!dn)return _r(f),null}else 2*$t()-b.renderingStartTime>SB&&g!==536870912&&(f.flags|=128,C=!0,Ix(b,!1),f.lanes=4194304);b.isBackwards?(A.sibling=f.child,f.child=A):(u=b.last,u!==null?u.sibling=A:f.child=A,b.last=A)}return b.tail!==null?(u=b.tail,b.rendering=u,b.tail=u.sibling,b.renderingStartTime=$t(),u.sibling=null,g=bs.current,de(bs,C?g&1|2:g&1),dn&&td(f,b.treeForkCount),u):(_r(f),null);case 22:case 23:return ao(f),$T(),b=f.memoizedState!==null,u!==null?u.memoizedState!==null!==b&&(f.flags|=8192):b&&(f.flags|=8192),b?(g&536870912)!==0&&(f.flags&128)===0&&(_r(f),f.subtreeFlags&6&&(f.flags|=8192)):_r(f),g=f.updateQueue,g!==null&&vB(f,g.retryQueue),g=null,u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),b=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(b=f.memoizedState.cachePool.pool),b!==g&&(f.flags|=2048),u!==null&&Y(xf),null;case 24:return g=null,u!==null&&(g=u.memoizedState.cache),f.memoizedState.cache!==g&&(f.flags|=2048),rd(_s),_r(f),null;case 25:return null;case 30:return null}throw Error(r(156,f.tag))}function Fte(u,f){switch(kT(f),f.tag){case 1:return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 3:return rd(_s),pe(),u=f.flags,(u&65536)!==0&&(u&128)===0?(f.flags=u&-65537|128,f):null;case 26:case 27:case 5:return he(f),null;case 31:if(f.memoizedState!==null){if(ao(f),f.alternate===null)throw Error(r(340));mf()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 13:if(ao(f),u=f.memoizedState,u!==null&&u.dehydrated!==null){if(f.alternate===null)throw Error(r(340));mf()}return u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 19:return Y(bs),null;case 4:return pe(),null;case 10:return rd(f.type),null;case 22:case 23:return ao(f),$T(),u!==null&&Y(xf),u=f.flags,u&65536?(f.flags=u&-65537|128,f):null;case 24:return rd(_s),null;case 25:return null;default:return null}}function nO(u,f){switch(kT(f),f.tag){case 3:rd(_s),pe();break;case 26:case 27:case 5:he(f);break;case 4:pe();break;case 31:f.memoizedState!==null&&ao(f);break;case 13:ao(f);break;case 19:Y(bs);break;case 10:rd(f.type);break;case 22:case 23:ao(f),$T(),u!==null&&Y(xf);break;case 24:rd(_s)}}function Dx(u,f){try{var g=f.updateQueue,b=g!==null?g.lastEffect:null;if(b!==null){var C=b.next;g=C;do{if((g.tag&u)===u){b=void 0;var A=g.create,F=g.inst;b=A(),F.destroy=b}g=g.next}while(g!==C)}}catch(q){Hn(f,f.return,q)}}function Su(u,f,g){try{var b=f.updateQueue,C=b!==null?b.lastEffect:null;if(C!==null){var A=C.next;b=A;do{if((b.tag&u)===u){var F=b.inst,q=F.destroy;if(q!==void 0){F.destroy=void 0,C=f;var ae=g,Ne=q;try{Ne()}catch(Ue){Hn(C,ae,Ue)}}}b=b.next}while(b!==A)}}catch(Ue){Hn(f,f.return,Ue)}}function rO(u){var f=u.updateQueue;if(f!==null){var g=u.stateNode;try{K5(f,g)}catch(b){Hn(u,u.return,b)}}}function sO(u,f,g){g.props=wf(u.type,u.memoizedProps),g.state=u.memoizedState;try{g.componentWillUnmount()}catch(b){Hn(u,f,b)}}function jx(u,f){try{var g=u.ref;if(g!==null){switch(u.tag){case 26:case 27:case 5:var b=u.stateNode;break;case 30:b=u.stateNode;break;default:b=u.stateNode}typeof g=="function"?u.refCleanup=g(b):g.current=b}}catch(C){Hn(u,f,C)}}function rc(u,f){var g=u.ref,b=u.refCleanup;if(g!==null)if(typeof b=="function")try{b()}catch(C){Hn(u,f,C)}finally{u.refCleanup=null,u=u.alternate,u!=null&&(u.refCleanup=null)}else if(typeof g=="function")try{g(null)}catch(C){Hn(u,f,C)}else g.current=null}function aO(u){var f=u.type,g=u.memoizedProps,b=u.stateNode;try{e:switch(f){case"button":case"input":case"select":case"textarea":g.autoFocus&&b.focus();break e;case"img":g.src?b.src=g.src:g.srcSet&&(b.srcset=g.srcSet)}}catch(C){Hn(u,u.return,C)}}function BA(u,f,g){try{var b=u.stateNode;one(b,u.type,g,f),b[Sn]=f}catch(C){Hn(u,u.return,C)}}function iO(u){return u.tag===5||u.tag===3||u.tag===26||u.tag===27&&Du(u.type)||u.tag===4}function wA(u){e:for(;;){for(;u.sibling===null;){if(u.return===null||iO(u.return))return null;u=u.return}for(u.sibling.return=u.return,u=u.sibling;u.tag!==5&&u.tag!==6&&u.tag!==18;){if(u.tag===27&&Du(u.type)||u.flags&2||u.child===null||u.tag===4)continue e;u.child.return=u,u=u.child}if(!(u.flags&2))return u.stateNode}}function CA(u,f,g){var b=u.tag;if(b===5||b===6)u=u.stateNode,f?(g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g).insertBefore(u,f):(f=g.nodeType===9?g.body:g.nodeName==="HTML"?g.ownerDocument.body:g,f.appendChild(u),g=g._reactRootContainer,g!=null||f.onclick!==null||(f.onclick=Ci));else if(b!==4&&(b===27&&Du(u.type)&&(g=u.stateNode,f=null),u=u.child,u!==null))for(CA(u,f,g),u=u.sibling;u!==null;)CA(u,f,g),u=u.sibling}function BB(u,f,g){var b=u.tag;if(b===5||b===6)u=u.stateNode,f?g.insertBefore(u,f):g.appendChild(u);else if(b!==4&&(b===27&&Du(u.type)&&(g=u.stateNode),u=u.child,u!==null))for(BB(u,f,g),u=u.sibling;u!==null;)BB(u,f,g),u=u.sibling}function oO(u){var f=u.stateNode,g=u.memoizedProps;try{for(var b=u.type,C=f.attributes;C.length;)f.removeAttributeNode(C[0]);ka(f,b,g),f[Xn]=u,f[Sn]=g}catch(A){Hn(u,u.return,A)}}var ld=!1,js=!1,EA=!1,lO=typeof WeakSet=="function"?WeakSet:Set,oa=null;function Ute(u,f){if(u=u.containerInfo,zA=GB,u=v5(u),xT(u)){if("selectionStart"in u)var g={start:u.selectionStart,end:u.selectionEnd};else e:{g=(g=u.ownerDocument)&&g.defaultView||window;var b=g.getSelection&&g.getSelection();if(b&&b.rangeCount!==0){g=b.anchorNode;var C=b.anchorOffset,A=b.focusNode;b=b.focusOffset;try{g.nodeType,A.nodeType}catch{g=null;break e}var F=0,q=-1,ae=-1,Ne=0,Ue=0,$e=u,_e=null;t:for(;;){for(var Pe;$e!==g||C!==0&&$e.nodeType!==3||(q=F+C),$e!==A||b!==0&&$e.nodeType!==3||(ae=F+b),$e.nodeType===3&&(F+=$e.nodeValue.length),(Pe=$e.firstChild)!==null;)_e=$e,$e=Pe;for(;;){if($e===u)break t;if(_e===g&&++Ne===C&&(q=F),_e===A&&++Ue===b&&(ae=F),(Pe=$e.nextSibling)!==null)break;$e=_e,_e=$e.parentNode}$e=Pe}g=q===-1||ae===-1?null:{start:q,end:ae}}else g=null}g=g||{start:0,end:0}}else g=null;for(qA={focusedElem:u,selectionRange:g},GB=!1,oa=f;oa!==null;)if(f=oa,u=f.child,(f.subtreeFlags&1028)!==0&&u!==null)u.return=f,oa=u;else for(;oa!==null;){switch(f=oa,A=f.alternate,u=f.flags,f.tag){case 0:if((u&4)!==0&&(u=f.updateQueue,u=u!==null?u.events:null,u!==null))for(g=0;g<u.length;g++)C=u[g],C.ref.impl=C.nextImpl;break;case 11:case 15:break;case 1:if((u&1024)!==0&&A!==null){u=void 0,g=f,C=A.memoizedProps,A=A.memoizedState,b=g.stateNode;try{var gt=wf(g.type,C);u=b.getSnapshotBeforeUpdate(gt,A),b.__reactInternalSnapshotBeforeUpdate=u}catch(It){Hn(g,g.return,It)}}break;case 3:if((u&1024)!==0){if(u=f.stateNode.containerInfo,g=u.nodeType,g===9)YA(u);else if(g===1)switch(u.nodeName){case"HEAD":case"HTML":case"BODY":YA(u);break;default:u.textContent=""}}break;case 5:case 26:case 27:case 6:case 4:case 17:break;default:if((u&1024)!==0)throw Error(r(163))}if(u=f.sibling,u!==null){u.return=f.return,oa=u;break}oa=f.return}}function cO(u,f,g){var b=g.flags;switch(g.tag){case 0:case 11:case 15:dd(u,g),b&4&&Dx(5,g);break;case 1:if(dd(u,g),b&4)if(u=g.stateNode,f===null)try{u.componentDidMount()}catch(F){Hn(g,g.return,F)}else{var C=wf(g.type,f.memoizedProps);f=f.memoizedState;try{u.componentDidUpdate(C,f,u.__reactInternalSnapshotBeforeUpdate)}catch(F){Hn(g,g.return,F)}}b&64&&rO(g),b&512&&jx(g,g.return);break;case 3:if(dd(u,g),b&64&&(u=g.updateQueue,u!==null)){if(f=null,g.child!==null)switch(g.child.tag){case 27:case 5:f=g.child.stateNode;break;case 1:f=g.child.stateNode}try{K5(u,f)}catch(F){Hn(g,g.return,F)}}break;case 27:f===null&&b&4&&oO(g);case 26:case 5:dd(u,g),f===null&&b&4&&aO(g),b&512&&jx(g,g.return);break;case 12:dd(u,g);break;case 31:dd(u,g),b&4&&hO(u,g);break;case 13:dd(u,g),b&4&&fO(u,g),b&64&&(u=g.memoizedState,u!==null&&(u=u.dehydrated,u!==null&&(g=Yte.bind(null,g),pne(u,g))));break;case 22:if(b=g.memoizedState!==null||ld,!b){f=f!==null&&f.memoizedState!==null||js,C=ld;var A=js;ld=b,(js=f)&&!A?ud(u,g,(g.subtreeFlags&8772)!==0):dd(u,g),ld=C,js=A}break;case 30:break;default:dd(u,g)}}function dO(u){var f=u.alternate;f!==null&&(u.alternate=null,dO(f)),u.child=null,u.deletions=null,u.sibling=null,u.tag===5&&(f=u.stateNode,f!==null&&Io(f)),u.stateNode=null,u.return=null,u.dependencies=null,u.memoizedProps=null,u.memoizedState=null,u.pendingProps=null,u.stateNode=null,u.updateQueue=null}var Hr=null,_i=!1;function cd(u,f,g){for(g=g.child;g!==null;)uO(u,f,g),g=g.sibling}function uO(u,f,g){if(Fr&&typeof Fr.onCommitFiberUnmount=="function")try{Fr.onCommitFiberUnmount(ts,g)}catch{}switch(g.tag){case 26:js||rc(g,f),cd(u,f,g),g.memoizedState?g.memoizedState.count--:g.stateNode&&(g=g.stateNode,g.parentNode.removeChild(g));break;case 27:js||rc(g,f);var b=Hr,C=_i;Du(g.type)&&(Hr=g.stateNode,_i=!1),cd(u,f,g),Gx(g.stateNode),Hr=b,_i=C;break;case 5:js||rc(g,f);case 6:if(b=Hr,C=_i,Hr=null,cd(u,f,g),Hr=b,_i=C,Hr!==null)if(_i)try{(Hr.nodeType===9?Hr.body:Hr.nodeName==="HTML"?Hr.ownerDocument.body:Hr).removeChild(g.stateNode)}catch(A){Hn(g,f,A)}else try{Hr.removeChild(g.stateNode)}catch(A){Hn(g,f,A)}break;case 18:Hr!==null&&(_i?(u=Hr,rM(u.nodeType===9?u.body:u.nodeName==="HTML"?u.ownerDocument.body:u,g.stateNode),Rp(u)):rM(Hr,g.stateNode));break;case 4:b=Hr,C=_i,Hr=g.stateNode.containerInfo,_i=!0,cd(u,f,g),Hr=b,_i=C;break;case 0:case 11:case 14:case 15:Su(2,g,f),js||Su(4,g,f),cd(u,f,g);break;case 1:js||(rc(g,f),b=g.stateNode,typeof b.componentWillUnmount=="function"&&sO(g,f,b)),cd(u,f,g);break;case 21:cd(u,f,g);break;case 22:js=(b=js)||g.memoizedState!==null,cd(u,f,g),js=b;break;default:cd(u,f,g)}}function hO(u,f){if(f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null))){u=u.dehydrated;try{Rp(u)}catch(g){Hn(f,f.return,g)}}}function fO(u,f){if(f.memoizedState===null&&(u=f.alternate,u!==null&&(u=u.memoizedState,u!==null&&(u=u.dehydrated,u!==null))))try{Rp(u)}catch(g){Hn(f,f.return,g)}}function Vte(u){switch(u.tag){case 31:case 13:case 19:var f=u.stateNode;return f===null&&(f=u.stateNode=new lO),f;case 22:return u=u.stateNode,f=u._retryCache,f===null&&(f=u._retryCache=new lO),f;default:throw Error(r(435,u.tag))}}function wB(u,f){var g=Vte(u);f.forEach(function(b){if(!g.has(b)){g.add(b);var C=Qte.bind(null,u,b);b.then(C,C)}})}function Ii(u,f){var g=f.deletions;if(g!==null)for(var b=0;b<g.length;b++){var C=g[b],A=u,F=f,q=F;e:for(;q!==null;){switch(q.tag){case 27:if(Du(q.type)){Hr=q.stateNode,_i=!1;break e}break;case 5:Hr=q.stateNode,_i=!1;break e;case 3:case 4:Hr=q.stateNode.containerInfo,_i=!0;break e}q=q.return}if(Hr===null)throw Error(r(160));uO(A,F,C),Hr=null,_i=!1,A=C.alternate,A!==null&&(A.return=null),C.return=null}if(f.subtreeFlags&13886)for(f=f.child;f!==null;)mO(f,u),f=f.sibling}var Cl=null;function mO(u,f){var g=u.alternate,b=u.flags;switch(u.tag){case 0:case 11:case 14:case 15:Ii(f,u),Di(u),b&4&&(Su(3,u,u.return),Dx(3,u),Su(5,u,u.return));break;case 1:Ii(f,u),Di(u),b&512&&(js||g===null||rc(g,g.return)),b&64&&ld&&(u=u.updateQueue,u!==null&&(b=u.callbacks,b!==null&&(g=u.shared.hiddenCallbacks,u.shared.hiddenCallbacks=g===null?b:g.concat(b))));break;case 26:var C=Cl;if(Ii(f,u),Di(u),b&512&&(js||g===null||rc(g,g.return)),b&4){var A=g!==null?g.memoizedState:null;if(b=u.memoizedState,g===null)if(b===null)if(u.stateNode===null){e:{b=u.type,g=u.memoizedProps,C=C.ownerDocument||C;t:switch(b){case"title":A=C.getElementsByTagName("title")[0],(!A||A[ns]||A[Xn]||A.namespaceURI==="http://www.w3.org/2000/svg"||A.hasAttribute("itemprop"))&&(A=C.createElement(b),C.head.insertBefore(A,C.querySelector("head > title"))),ka(A,b,g),A[Xn]=u,vr(A),b=A;break e;case"link":var F=mM("link","href",C).get(b+(g.href||""));if(F){for(var q=0;q<F.length;q++)if(A=F[q],A.getAttribute("href")===(g.href==null||g.href===""?null:g.href)&&A.getAttribute("rel")===(g.rel==null?null:g.rel)&&A.getAttribute("title")===(g.title==null?null:g.title)&&A.getAttribute("crossorigin")===(g.crossOrigin==null?null:g.crossOrigin)){F.splice(q,1);break t}}A=C.createElement(b),ka(A,b,g),C.head.appendChild(A);break;case"meta":if(F=mM("meta","content",C).get(b+(g.content||""))){for(q=0;q<F.length;q++)if(A=F[q],A.getAttribute("content")===(g.content==null?null:""+g.content)&&A.getAttribute("name")===(g.name==null?null:g.name)&&A.getAttribute("property")===(g.property==null?null:g.property)&&A.getAttribute("http-equiv")===(g.httpEquiv==null?null:g.httpEquiv)&&A.getAttribute("charset")===(g.charSet==null?null:g.charSet)){F.splice(q,1);break t}}A=C.createElement(b),ka(A,b,g),C.head.appendChild(A);break;default:throw Error(r(468,b))}A[Xn]=u,vr(A),b=A}u.stateNode=b}else pM(C,u.type,u.stateNode);else u.stateNode=fM(C,b,u.memoizedProps);else A!==b?(A===null?g.stateNode!==null&&(g=g.stateNode,g.parentNode.removeChild(g)):A.count--,b===null?pM(C,u.type,u.stateNode):fM(C,b,u.memoizedProps)):b===null&&u.stateNode!==null&&BA(u,u.memoizedProps,g.memoizedProps)}break;case 27:Ii(f,u),Di(u),b&512&&(js||g===null||rc(g,g.return)),g!==null&&b&4&&BA(u,u.memoizedProps,g.memoizedProps);break;case 5:if(Ii(f,u),Di(u),b&512&&(js||g===null||rc(g,g.return)),u.flags&32){C=u.stateNode;try{Ln(C,"")}catch(gt){Hn(u,u.return,gt)}}b&4&&u.stateNode!=null&&(C=u.memoizedProps,BA(u,C,g!==null?g.memoizedProps:C)),b&1024&&(EA=!0);break;case 6:if(Ii(f,u),Di(u),b&4){if(u.stateNode===null)throw Error(r(162));b=u.memoizedProps,g=u.stateNode;try{g.nodeValue=b}catch(gt){Hn(u,u.return,gt)}}break;case 3:if(MB=null,C=Cl,Cl=LB(f.containerInfo),Ii(f,u),Cl=C,Di(u),b&4&&g!==null&&g.memoizedState.isDehydrated)try{Rp(f.containerInfo)}catch(gt){Hn(u,u.return,gt)}EA&&(EA=!1,pO(u));break;case 4:b=Cl,Cl=LB(u.stateNode.containerInfo),Ii(f,u),Di(u),Cl=b;break;case 12:Ii(f,u),Di(u);break;case 31:Ii(f,u),Di(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,wB(u,b)));break;case 13:Ii(f,u),Di(u),u.child.flags&8192&&u.memoizedState!==null!=(g!==null&&g.memoizedState!==null)&&(EB=$t()),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,wB(u,b)));break;case 22:C=u.memoizedState!==null;var ae=g!==null&&g.memoizedState!==null,Ne=ld,Ue=js;if(ld=Ne||C,js=Ue||ae,Ii(f,u),js=Ue,ld=Ne,Di(u),b&8192)e:for(f=u.stateNode,f._visibility=C?f._visibility&-2:f._visibility|1,C&&(g===null||ae||ld||js||Cf(u)),g=null,f=u;;){if(f.tag===5||f.tag===26){if(g===null){ae=g=f;try{if(A=ae.stateNode,C)F=A.style,typeof F.setProperty=="function"?F.setProperty("display","none","important"):F.display="none";else{q=ae.stateNode;var $e=ae.memoizedProps.style,_e=$e!=null&&$e.hasOwnProperty("display")?$e.display:null;q.style.display=_e==null||typeof _e=="boolean"?"":(""+_e).trim()}}catch(gt){Hn(ae,ae.return,gt)}}}else if(f.tag===6){if(g===null){ae=f;try{ae.stateNode.nodeValue=C?"":ae.memoizedProps}catch(gt){Hn(ae,ae.return,gt)}}}else if(f.tag===18){if(g===null){ae=f;try{var Pe=ae.stateNode;C?sM(Pe,!0):sM(ae.stateNode,!1)}catch(gt){Hn(ae,ae.return,gt)}}}else if((f.tag!==22&&f.tag!==23||f.memoizedState===null||f===u)&&f.child!==null){f.child.return=f,f=f.child;continue}if(f===u)break e;for(;f.sibling===null;){if(f.return===null||f.return===u)break e;g===f&&(g=null),f=f.return}g===f&&(g=null),f.sibling.return=f.return,f=f.sibling}b&4&&(b=u.updateQueue,b!==null&&(g=b.retryQueue,g!==null&&(b.retryQueue=null,wB(u,g))));break;case 19:Ii(f,u),Di(u),b&4&&(b=u.updateQueue,b!==null&&(u.updateQueue=null,wB(u,b)));break;case 30:break;case 21:break;default:Ii(f,u),Di(u)}}function Di(u){var f=u.flags;if(f&2){try{for(var g,b=u.return;b!==null;){if(iO(b)){g=b;break}b=b.return}if(g==null)throw Error(r(160));switch(g.tag){case 27:var C=g.stateNode,A=wA(u);BB(u,A,C);break;case 5:var F=g.stateNode;g.flags&32&&(Ln(F,""),g.flags&=-33);var q=wA(u);BB(u,q,F);break;case 3:case 4:var ae=g.stateNode.containerInfo,Ne=wA(u);CA(u,Ne,ae);break;default:throw Error(r(161))}}catch(Ue){Hn(u,u.return,Ue)}u.flags&=-3}f&4096&&(u.flags&=-4097)}function pO(u){if(u.subtreeFlags&1024)for(u=u.child;u!==null;){var f=u;pO(f),f.tag===5&&f.flags&1024&&f.stateNode.reset(),u=u.sibling}}function dd(u,f){if(f.subtreeFlags&8772)for(f=f.child;f!==null;)cO(u,f.alternate,f),f=f.sibling}function Cf(u){for(u=u.child;u!==null;){var f=u;switch(f.tag){case 0:case 11:case 14:case 15:Su(4,f,f.return),Cf(f);break;case 1:rc(f,f.return);var g=f.stateNode;typeof g.componentWillUnmount=="function"&&sO(f,f.return,g),Cf(f);break;case 27:Gx(f.stateNode);case 26:case 5:rc(f,f.return),Cf(f);break;case 22:f.memoizedState===null&&Cf(f);break;case 30:Cf(f);break;default:Cf(f)}u=u.sibling}}function ud(u,f,g){for(g=g&&(f.subtreeFlags&8772)!==0,f=f.child;f!==null;){var b=f.alternate,C=u,A=f,F=A.flags;switch(A.tag){case 0:case 11:case 15:ud(C,A,g),Dx(4,A);break;case 1:if(ud(C,A,g),b=A,C=b.stateNode,typeof C.componentDidMount=="function")try{C.componentDidMount()}catch(Ne){Hn(b,b.return,Ne)}if(b=A,C=b.updateQueue,C!==null){var q=b.stateNode;try{var ae=C.shared.hiddenCallbacks;if(ae!==null)for(C.shared.hiddenCallbacks=null,C=0;C<ae.length;C++)q5(ae[C],q)}catch(Ne){Hn(b,b.return,Ne)}}g&&F&64&&rO(A),jx(A,A.return);break;case 27:oO(A);case 26:case 5:ud(C,A,g),g&&b===null&&F&4&&aO(A),jx(A,A.return);break;case 12:ud(C,A,g);break;case 31:ud(C,A,g),g&&F&4&&hO(C,A);break;case 13:ud(C,A,g),g&&F&4&&fO(C,A);break;case 22:A.memoizedState===null&&ud(C,A,g),jx(A,A.return);break;case 30:break;default:ud(C,A,g)}f=f.sibling}}function SA(u,f){var g=null;u!==null&&u.memoizedState!==null&&u.memoizedState.cachePool!==null&&(g=u.memoizedState.cachePool.pool),u=null,f.memoizedState!==null&&f.memoizedState.cachePool!==null&&(u=f.memoizedState.cachePool.pool),u!==g&&(u!=null&&u.refCount++,g!=null&&yx(g))}function TA(u,f){u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&yx(u))}function El(u,f,g,b){if(f.subtreeFlags&10256)for(f=f.child;f!==null;)gO(u,f,g,b),f=f.sibling}function gO(u,f,g,b){var C=f.flags;switch(f.tag){case 0:case 11:case 15:El(u,f,g,b),C&2048&&Dx(9,f);break;case 1:El(u,f,g,b);break;case 3:El(u,f,g,b),C&2048&&(u=null,f.alternate!==null&&(u=f.alternate.memoizedState.cache),f=f.memoizedState.cache,f!==u&&(f.refCount++,u!=null&&yx(u)));break;case 12:if(C&2048){El(u,f,g,b),u=f.stateNode;try{var A=f.memoizedProps,F=A.id,q=A.onPostCommit;typeof q=="function"&&q(F,f.alternate===null?"mount":"update",u.passiveEffectDuration,-0)}catch(ae){Hn(f,f.return,ae)}}else El(u,f,g,b);break;case 31:El(u,f,g,b);break;case 13:El(u,f,g,b);break;case 23:break;case 22:A=f.stateNode,F=f.alternate,f.memoizedState!==null?A._visibility&2?El(u,f,g,b):Rx(u,f):A._visibility&2?El(u,f,g,b):(A._visibility|=2,Cp(u,f,g,b,(f.subtreeFlags&10256)!==0||!1)),C&2048&&SA(F,f);break;case 24:El(u,f,g,b),C&2048&&TA(f.alternate,f);break;default:El(u,f,g,b)}}function Cp(u,f,g,b,C){for(C=C&&((f.subtreeFlags&10256)!==0||!1),f=f.child;f!==null;){var A=u,F=f,q=g,ae=b,Ne=F.flags;switch(F.tag){case 0:case 11:case 15:Cp(A,F,q,ae,C),Dx(8,F);break;case 23:break;case 22:var Ue=F.stateNode;F.memoizedState!==null?Ue._visibility&2?Cp(A,F,q,ae,C):Rx(A,F):(Ue._visibility|=2,Cp(A,F,q,ae,C)),C&&Ne&2048&&SA(F.alternate,F);break;case 24:Cp(A,F,q,ae,C),C&&Ne&2048&&TA(F.alternate,F);break;default:Cp(A,F,q,ae,C)}f=f.sibling}}function Rx(u,f){if(f.subtreeFlags&10256)for(f=f.child;f!==null;){var g=u,b=f,C=b.flags;switch(b.tag){case 22:Rx(g,b),C&2048&&SA(b.alternate,b);break;case 24:Rx(g,b),C&2048&&TA(b.alternate,b);break;default:Rx(g,b)}f=f.sibling}}var Px=8192;function Ep(u,f,g){if(u.subtreeFlags&Px)for(u=u.child;u!==null;)xO(u,f,g),u=u.sibling}function xO(u,f,g){switch(u.tag){case 26:Ep(u,f,g),u.flags&Px&&u.memoizedState!==null&&Ane(g,Cl,u.memoizedState,u.memoizedProps);break;case 5:Ep(u,f,g);break;case 3:case 4:var b=Cl;Cl=LB(u.stateNode.containerInfo),Ep(u,f,g),Cl=b;break;case 22:u.memoizedState===null&&(b=u.alternate,b!==null&&b.memoizedState!==null?(b=Px,Px=16777216,Ep(u,f,g),Px=b):Ep(u,f,g));break;default:Ep(u,f,g)}}function bO(u){var f=u.alternate;if(f!==null&&(u=f.child,u!==null)){f.child=null;do f=u.sibling,u.sibling=null,u=f;while(u!==null)}}function Lx(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var g=0;g<f.length;g++){var b=f[g];oa=b,vO(b,u)}bO(u)}if(u.subtreeFlags&10256)for(u=u.child;u!==null;)yO(u),u=u.sibling}function yO(u){switch(u.tag){case 0:case 11:case 15:Lx(u),u.flags&2048&&Su(9,u,u.return);break;case 3:Lx(u);break;case 12:Lx(u);break;case 22:var f=u.stateNode;u.memoizedState!==null&&f._visibility&2&&(u.return===null||u.return.tag!==13)?(f._visibility&=-3,CB(u)):Lx(u);break;default:Lx(u)}}function CB(u){var f=u.deletions;if((u.flags&16)!==0){if(f!==null)for(var g=0;g<f.length;g++){var b=f[g];oa=b,vO(b,u)}bO(u)}for(u=u.child;u!==null;){switch(f=u,f.tag){case 0:case 11:case 15:Su(8,f,f.return),CB(f);break;case 22:g=f.stateNode,g._visibility&2&&(g._visibility&=-3,CB(f));break;default:CB(f)}u=u.sibling}}function vO(u,f){for(;oa!==null;){var g=oa;switch(g.tag){case 0:case 11:case 15:Su(8,g,f);break;case 23:case 22:if(g.memoizedState!==null&&g.memoizedState.cachePool!==null){var b=g.memoizedState.cachePool.pool;b!=null&&b.refCount++}break;case 24:yx(g.memoizedState.cache)}if(b=g.child,b!==null)b.return=g,oa=b;else e:for(g=u;oa!==null;){b=oa;var C=b.sibling,A=b.return;if(dO(b),b===g){oa=null;break e}if(C!==null){C.return=A,oa=C;break e}oa=A}}}var Gte={getCacheForType:function(u){var f=Ta(_s),g=f.data.get(u);return g===void 0&&(g=u(),f.data.set(u,g)),g},cacheSignal:function(){return Ta(_s).controller.signal}},$te=typeof WeakMap=="function"?WeakMap:Map,Rn=0,cr=null,en=null,rn=0,$n=0,io=null,Tu=!1,Sp=!1,AA=!1,hd=0,ss=0,Au=0,Ef=0,kA=0,oo=0,Tp=0,Ox=null,ji=null,NA=!1,EB=0,BO=0,SB=1/0,TB=null,ku=null,$s=0,Nu=null,Ap=null,fd=0,_A=0,IA=null,wO=null,Mx=0,DA=null;function lo(){return(Rn&2)!==0&&rn!==0?rn&-rn:G.T!==null?MA():ht()}function CO(){if(oo===0)if((rn&536870912)===0||dn){var u=ks;ks<<=1,(ks&3932160)===0&&(ks=262144),oo=u}else oo=536870912;return u=so.current,u!==null&&(u.flags|=32),oo}function Ri(u,f,g){(u===cr&&($n===2||$n===9)||u.cancelPendingCommit!==null)&&(kp(u,0),_u(u,rn,oo,!1)),ba(u,g),((Rn&2)===0||u!==cr)&&(u===cr&&((Rn&2)===0&&(Ef|=g),ss===4&&_u(u,rn,oo,!1)),sc(u))}function EO(u,f,g){if((Rn&6)!==0)throw Error(r(327));var b=!g&&(f&127)===0&&(f&u.expiredLanes)===0||aa(u,f),C=b?qte(u,f):RA(u,f,!0),A=b;do{if(C===0){Sp&&!b&&_u(u,f,0,!1);break}else{if(g=u.current.alternate,A&&!Hte(g)){C=RA(u,f,!1),A=!1;continue}if(C===2){if(A=f,u.errorRecoveryDisabledLanes&A)var F=0;else F=u.pendingLanes&-536870913,F=F!==0?F:F&536870912?536870912:0;if(F!==0){f=F;e:{var q=u;C=Ox;var ae=q.current.memoizedState.isDehydrated;if(ae&&(kp(q,F).flags|=256),F=RA(q,F,!1),F!==2){if(AA&&!ae){q.errorRecoveryDisabledLanes|=A,Ef|=A,C=4;break e}A=ji,ji=C,A!==null&&(ji===null?ji=A:ji.push.apply(ji,A))}C=F}if(A=!1,C!==2)continue}}if(C===1){kp(u,0),_u(u,f,0,!0);break}e:{switch(b=u,A=C,A){case 0:case 1:throw Error(r(345));case 4:if((f&4194048)!==f)break;case 6:_u(b,f,oo,!Tu);break e;case 2:ji=null;break;case 3:case 5:break;default:throw Error(r(329))}if((f&62914560)===f&&(C=EB+300-$t(),10<C)){if(_u(b,f,oo,!Tu),Pn(b,0,!0)!==0)break e;fd=f,b.timeoutHandle=tM(SO.bind(null,b,g,ji,TB,NA,f,oo,Ef,Tp,Tu,A,"Throttled",-0,0),C);break e}SO(b,g,ji,TB,NA,f,oo,Ef,Tp,Tu,A,null,-0,0)}}break}while(!0);sc(u)}function SO(u,f,g,b,C,A,F,q,ae,Ne,Ue,$e,_e,Pe){if(u.timeoutHandle=-1,$e=f.subtreeFlags,$e&8192||($e&16785408)===16785408){$e={stylesheets:null,count:0,imgCount:0,imgBytes:0,suspenseyImages:[],waitingForImages:!0,waitingForViewTransition:!1,unsuspend:Ci},xO(f,A,$e);var gt=(A&62914560)===A?EB-$t():(A&4194048)===A?BO-$t():0;if(gt=kne($e,gt),gt!==null){fd=A,u.cancelPendingCommit=gt(jO.bind(null,u,f,A,g,b,C,F,q,ae,Ue,$e,null,_e,Pe)),_u(u,A,F,!Ne);return}}jO(u,f,A,g,b,C,F,q,ae)}function Hte(u){for(var f=u;;){var g=f.tag;if((g===0||g===11||g===15)&&f.flags&16384&&(g=f.updateQueue,g!==null&&(g=g.stores,g!==null)))for(var b=0;b<g.length;
vendor: 19,403 bytes, line 48
48b++){var C=g[b],A=C.getSnapshot;C=C.value;try{if(!no(A(),C))return!1}catch{return!1}}if(g=f.child,f.subtreeFlags&16384&&g!==null)g.return=f,f=g;else{if(f===u)break;for(;f.sibling===null;){if(f.return===null||f.return===u)return!0;f=f.return}f.sibling.return=f.return,f=f.sibling}}return!0}function _u(u,f,g,b){f&=~kA,f&=~Ef,u.suspendedLanes|=f,u.pingedLanes&=~f,b&&(u.warmLanes|=f),b=u.expirationTimes;for(var C=f;0<C;){var A=31-Qn(C),F=1<<A;b[A]=-1,C&=~F}g!==0&&Jn(u,g,f)}function AB(){return(Rn&6)===0?(Fx(0),!1):!0}function jA(){if(en!==null){if($n===0)var u=en.return;else u=en,nd=pf=null,YT(u),bp=null,Bx=0,u=en;for(;u!==null;)nO(u.alternate,u),u=u.return;en=null}}function kp(u,f){var g=u.timeoutHandle;g!==-1&&(u.timeoutHandle=-1,dne(g)),g=u.cancelPendingCommit,g!==null&&(u.cancelPendingCommit=null,g()),fd=0,jA(),cr=u,en=g=ed(u.current,null),rn=f,$n=0,io=null,Tu=!1,Sp=aa(u,f),AA=!1,Tp=oo=kA=Ef=Au=ss=0,ji=Ox=null,NA=!1,(f&8)!==0&&(f|=f&32);var b=u.entangledLanes;if(b!==0)for(u=u.entanglements,b&=f;0<b;){var C=31-Qn(b),A=1<<C;f|=u[C],b&=~A}return hd=f,Wv(),g}function TO(u,f){Wt=null,G.H=Nx,f===xp||f===nB?(f=G5(),$n=3):f===OT?(f=G5(),$n=4):$n=f===uA?8:f!==null&&typeof f=="object"&&typeof f.then=="function"?6:1,io=f,en===null&&(ss=1,gB(u,Lo(f,u.current)))}function AO(){var u=so.current;return u===null?!0:(rn&4194048)===rn?Uo===null:(rn&62914560)===rn||(rn&536870912)!==0?u===Uo:!1}function kO(){var u=G.H;return G.H=Nx,u===null?Nx:u}function NO(){var u=G.A;return G.A=Gte,u}function kB(){ss=4,Tu||(rn&4194048)!==rn&&so.current!==null||(Sp=!0),(Au&134217727)===0&&(Ef&134217727)===0||cr===null||_u(cr,rn,oo,!1)}function RA(u,f,g){var b=Rn;Rn|=2;var C=kO(),A=NO();(cr!==u||rn!==f)&&(TB=null,kp(u,f)),f=!1;var F=ss;e:do try{if($n!==0&&en!==null){var q=en,ae=io;switch($n){case 8:jA(),F=6;break e;case 3:case 2:case 9:case 6:so.current===null&&(f=!0);var Ne=$n;if($n=0,io=null,Np(u,q,ae,Ne),g&&Sp){F=0;break e}break;default:Ne=$n,$n=0,io=null,Np(u,q,ae,Ne)}}zte(),F=ss;break}catch(Ue){TO(u,Ue)}while(!0);return f&&u.shellSuspendCounter++,nd=pf=null,Rn=b,G.H=C,G.A=A,en===null&&(cr=null,rn=0,Wv()),F}function zte(){for(;en!==null;)_O(en)}function qte(u,f){var g=Rn;Rn|=2;var b=kO(),C=NO();cr!==u||rn!==f?(TB=null,SB=$t()+500,kp(u,f)):Sp=aa(u,f);e:do try{if($n!==0&&en!==null){f=en;var A=io;t:switch($n){case 1:$n=0,io=null,Np(u,f,A,1);break;case 2:case 9:if(U5(A)){$n=0,io=null,IO(f);break}f=function(){$n!==2&&$n!==9||cr!==u||($n=7),sc(u)},A.then(f,f);break e;case 3:$n=7;break e;case 4:$n=5;break e;case 7:U5(A)?($n=0,io=null,IO(f)):($n=0,io=null,Np(u,f,A,7));break;case 5:var F=null;switch(en.tag){case 26:F=en.memoizedState;case 5:case 27:var q=en;if(F?gM(F):q.stateNode.complete){$n=0,io=null;var ae=q.sibling;if(ae!==null)en=ae;else{var Ne=q.return;Ne!==null?(en=Ne,NB(Ne)):en=null}break t}}$n=0,io=null,Np(u,f,A,5);break;case 6:$n=0,io=null,Np(u,f,A,6);break;case 8:jA(),ss=6;break e;default:throw Error(r(462))}}Kte();break}catch(Ue){TO(u,Ue)}while(!0);return nd=pf=null,G.H=b,G.A=C,Rn=g,en!==null?0:(cr=null,rn=0,Wv(),ss)}function Kte(){for(;en!==null&&!Gt();)_O(en)}function _O(u){var f=eO(u.alternate,u,hd);u.memoizedProps=u.pendingProps,f===null?NB(u):en=f}function IO(u){var f=u,g=f.alternate;switch(f.tag){case 15:case 0:f=WL(g,f,f.pendingProps,f.type,void 0,rn);break;case 11:f=WL(g,f,f.pendingProps,f.type.render,f.ref,rn);break;case 5:YT(f);default:nO(g,f),f=en=N5(f,hd),f=eO(g,f,hd)}u.memoizedProps=u.pendingProps,f===null?NB(u):en=f}function Np(u,f,g,b){nd=pf=null,YT(f),bp=null,Bx=0;var C=f.return;try{if(Pte(u,C,f,g,rn)){ss=1,gB(u,Lo(g,u.current)),en=null;return}}catch(A){if(C!==null)throw en=C,A;ss=1,gB(u,Lo(g,u.current)),en=null;return}f.flags&32768?(dn||b===1?u=!0:Sp||(rn&536870912)!==0?u=!1:(Tu=u=!0,(b===2||b===9||b===3||b===6)&&(b=so.current,b!==null&&b.tag===13&&(b.flags|=16384))),DO(f,u)):NB(f)}function NB(u){var f=u;do{if((f.flags&32768)!==0){DO(f,Tu);return}u=f.return;var g=Mte(f.alternate,f,hd);if(g!==null){en=g;return}if(f=f.sibling,f!==null){en=f;return}en=f=u}while(f!==null);ss===0&&(ss=5)}function DO(u,f){do{var g=Fte(u.alternate,u);if(g!==null){g.flags&=32767,en=g;return}if(g=u.return,g!==null&&(g.flags|=32768,g.subtreeFlags=0,g.deletions=null),!f&&(u=u.sibling,u!==null)){en=u;return}en=u=g}while(u!==null);ss=6,en=null}function jO(u,f,g,b,C,A,F,q,ae){u.cancelPendingCommit=null;do _B();while($s!==0);if((Rn&6)!==0)throw Error(r(327));if(f!==null){if(f===u.current)throw Error(r(177));if(A=f.lanes|f.childLanes,A|=wT,fl(u,g,A,F,q,ae),u===cr&&(en=cr=null,rn=0),Ap=f,Nu=u,fd=g,_A=A,IA=C,wO=b,(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?(u.callbackNode=null,u.callbackPriority=0,Jte(Mr,function(){return MO(),null})):(u.callbackNode=null,u.callbackPriority=0),b=(f.flags&13878)!==0,(f.subtreeFlags&13878)!==0||b){b=G.T,G.T=null,C=Z.p,Z.p=2,F=Rn,Rn|=4;try{Ute(u,f,g)}finally{Rn=F,Z.p=C,G.T=b}}$s=1,RO(),PO(),LO()}}function RO(){if($s===1){$s=0;var u=Nu,f=Ap,g=(f.flags&13878)!==0;if((f.subtreeFlags&13878)!==0||g){g=G.T,G.T=null;var b=Z.p;Z.p=2;var C=Rn;Rn|=4;try{mO(f,u);var A=qA,F=v5(u.containerInfo),q=A.focusedElem,ae=A.selectionRange;if(F!==q&&q&&q.ownerDocument&&y5(q.ownerDocument.documentElement,q)){if(ae!==null&&xT(q)){var Ne=ae.start,Ue=ae.end;if(Ue===void 0&&(Ue=Ne),"selectionStart"in q)q.selectionStart=Ne,q.selectionEnd=Math.min(Ue,q.value.length);else{var $e=q.ownerDocument||document,_e=$e&&$e.defaultView||window;if(_e.getSelection){var Pe=_e.getSelection(),gt=q.textContent.length,It=Math.min(ae.start,gt),tr=ae.end===void 0?It:Math.min(ae.end,gt);!Pe.extend&&It>tr&&(F=tr,tr=It,It=F);var be=b5(q,It),ue=b5(q,tr);if(be&&ue&&(Pe.rangeCount!==1||Pe.anchorNode!==be.node||Pe.anchorOffset!==be.offset||Pe.focusNode!==ue.node||Pe.focusOffset!==ue.offset)){var ke=$e.createRange();ke.setStart(be.node,be.offset),Pe.removeAllRanges(),It>tr?(Pe.addRange(ke),Pe.extend(ue.node,ue.offset)):(ke.setEnd(ue.node,ue.offset),Pe.addRange(ke))}}}}for($e=[],Pe=q;Pe=Pe.parentNode;)Pe.nodeType===1&&$e.push({element:Pe,left:Pe.scrollLeft,top:Pe.scrollTop});for(typeof q.focus=="function"&&q.focus(),q=0;q<$e.length;q++){var Ge=$e[q];Ge.element.scrollLeft=Ge.left,Ge.element.scrollTop=Ge.top}}GB=!!zA,qA=zA=null}finally{Rn=C,Z.p=b,G.T=g}}u.current=f,$s=2}}function PO(){if($s===2){$s=0;var u=Nu,f=Ap,g=(f.flags&8772)!==0;if((f.subtreeFlags&8772)!==0||g){g=G.T,G.T=null;var b=Z.p;Z.p=2;var C=Rn;Rn|=4;try{cO(u,f.alternate,f)}finally{Rn=C,Z.p=b,G.T=g}}$s=3}}function LO(){if($s===4||$s===3){$s=0,En();var u=Nu,f=Ap,g=fd,b=wO;(f.subtreeFlags&10256)!==0||(f.flags&10256)!==0?$s=5:($s=0,Ap=Nu=null,OO(u,u.pendingLanes));var C=u.pendingLanes;if(C===0&&(ku=null),wn(g),f=f.stateNode,Fr&&typeof Fr.onCommitFiberRoot=="function")try{Fr.onCommitFiberRoot(ts,f,void 0,(f.current.flags&128)===128)}catch{}if(b!==null){f=G.T,C=Z.p,Z.p=2,G.T=null;try{for(var A=u.onRecoverableError,F=0;F<b.length;F++){var q=b[F];A(q.value,{componentStack:q.stack})}}finally{G.T=f,Z.p=C}}(fd&3)!==0&&_B(),sc(u),C=u.pendingLanes,(g&261930)!==0&&(C&42)!==0?u===DA?Mx++:(Mx=0,DA=u):Mx=0,Fx(0)}}function OO(u,f){(u.pooledCacheLanes&=f)===0&&(f=u.pooledCache,f!=null&&(u.pooledCache=null,yx(f)))}function _B(){return RO(),PO(),LO(),MO()}function MO(){if($s!==5)return!1;var u=Nu,f=_A;_A=0;var g=wn(fd),b=G.T,C=Z.p;try{Z.p=32>g?32:g,G.T=null,g=IA,IA=null;var A=Nu,F=fd;if($s=0,Ap=Nu=null,fd=0,(Rn&6)!==0)throw Error(r(331));var q=Rn;if(Rn|=4,yO(A.current),gO(A,A.current,F,g),Rn=q,Fx(0,!1),Fr&&typeof Fr.onPostCommitFiberRoot=="function")try{Fr.onPostCommitFiberRoot(ts,A)}catch{}return!0}finally{Z.p=C,G.T=b,OO(u,f)}}function FO(u,f,g){f=Lo(g,f),f=dA(u.stateNode,f,2),u=wu(u,f,2),u!==null&&(ba(u,2),sc(u))}function Hn(u,f,g){if(u.tag===3)FO(u,u,g);else for(;f!==null;){if(f.tag===3){FO(f,u,g);break}else if(f.tag===1){var b=f.stateNode;if(typeof f.type.getDerivedStateFromError=="function"||typeof b.componentDidCatch=="function"&&(ku===null||!ku.has(b))){u=Lo(g,u),g=UL(2),b=wu(f,g,2),b!==null&&(VL(g,b,f,u),ba(b,2),sc(b));break}}f=f.return}}function PA(u,f,g){var b=u.pingCache;if(b===null){b=u.pingCache=new $te;var C=new Set;b.set(f,C)}else C=b.get(f),C===void 0&&(C=new Set,b.set(f,C));C.has(g)||(AA=!0,C.add(g),u=Wte.bind(null,u,f,g),f.then(u,u))}function Wte(u,f,g){var b=u.pingCache;b!==null&&b.delete(f),u.pingedLanes|=u.suspendedLanes&g,u.warmLanes&=~g,cr===u&&(rn&g)===g&&(ss===4||ss===3&&(rn&62914560)===rn&&300>$t()-EB?(Rn&2)===0&&kp(u,0):kA|=g,Tp===rn&&(Tp=0)),sc(u)}function UO(u,f){f===0&&(f=bi()),u=hf(u,f),u!==null&&(ba(u,f),sc(u))}function Yte(u){var f=u.memoizedState,g=0;f!==null&&(g=f.retryLane),UO(u,g)}function Qte(u,f){var g=0;switch(u.tag){case 31:case 13:var b=u.stateNode,C=u.memoizedState;C!==null&&(g=C.retryLane);break;case 19:b=u.stateNode;break;case 22:b=u.stateNode._retryCache;break;default:throw Error(r(314))}b!==null&&b.delete(f),UO(u,g)}function Jte(u,f){return bt(u,f)}var IB=null,_p=null,LA=!1,DB=!1,OA=!1,Iu=0;function sc(u){u!==_p&&u.next===null&&(_p===null?IB=_p=u:_p=_p.next=u),DB=!0,LA||(LA=!0,Zte())}function Fx(u,f){if(!OA&&DB){OA=!0;do for(var g=!1,b=IB;b!==null;){if(u!==0){var C=b.pendingLanes;if(C===0)var A=0;else{var F=b.suspendedLanes,q=b.pingedLanes;A=(1<<31-Qn(42|u)+1)-1,A&=C&~(F&~q),A=A&201326741?A&201326741|1:A?A|2:0}A!==0&&(g=!0,HO(b,A))}else A=rn,A=Pn(b,b===cr?A:0,b.cancelPendingCommit!==null||b.timeoutHandle!==-1),(A&3)===0||aa(b,A)||(g=!0,HO(b,A));b=b.next}while(g);OA=!1}}function Xte(){VO()}function VO(){DB=LA=!1;var u=0;Iu!==0&&cne()&&(u=Iu);for(var f=$t(),g=null,b=IB;b!==null;){var C=b.next,A=GO(b,f);A===0?(b.next=null,g===null?IB=C:g.next=C,C===null&&(_p=g)):(g=b,(u!==0||(A&3)!==0)&&(DB=!0)),b=C}$s!==0&&$s!==5||Fx(u),Iu!==0&&(Iu=0)}function GO(u,f){for(var g=u.suspendedLanes,b=u.pingedLanes,C=u.expirationTimes,A=u.pendingLanes&-62914561;0<A;){var F=31-Qn(A),q=1<<F,ae=C[F];ae===-1?((q&g)===0||(q&b)!==0)&&(C[F]=si(q,f)):ae<=f&&(u.expiredLanes|=q),A&=~q}if(f=cr,g=rn,g=Pn(u,u===f?g:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b=u.callbackNode,g===0||u===f&&($n===2||$n===9)||u.cancelPendingCommit!==null)return b!==null&&b!==null&&Yt(b),u.callbackNode=null,u.callbackPriority=0;if((g&3)===0||aa(u,g)){if(f=g&-g,f===u.callbackPriority)return f;switch(b!==null&&Yt(b),wn(g)){case 2:case 8:g=Fa;break;case 32:g=Mr;break;case 268435456:g=us;break;default:g=Mr}return b=$O.bind(null,u),g=bt(g,b),u.callbackPriority=f,u.callbackNode=g,f}return b!==null&&b!==null&&Yt(b),u.callbackPriority=2,u.callbackNode=null,2}function $O(u,f){if($s!==0&&$s!==5)return u.callbackNode=null,u.callbackPriority=0,null;var g=u.callbackNode;if(_B()&&u.callbackNode!==g)return null;var b=rn;return b=Pn(u,u===cr?b:0,u.cancelPendingCommit!==null||u.timeoutHandle!==-1),b===0?null:(EO(u,b,f),GO(u,$t()),u.callbackNode!=null&&u.callbackNode===g?$O.bind(null,u):null)}function HO(u,f){if(_B())return null;EO(u,f,!0)}function Zte(){une(function(){(Rn&6)!==0?bt(sa,Xte):VO()})}function MA(){if(Iu===0){var u=pp;u===0&&(u=Ur,Ur<<=1,(Ur&261888)===0&&(Ur=256)),Iu=u}return Iu}function zO(u){return u==null||typeof u=="symbol"||typeof u=="boolean"?null:typeof u=="function"?u:Qc(""+u)}function qO(u,f){var g=f.ownerDocument.createElement("input");return g.name=f.name,g.value=f.value,u.id&&g.setAttribute("form",u.id),f.parentNode.insertBefore(g,f),u=new FormData(u),g.parentNode.removeChild(g),u}function ene(u,f,g,b,C){if(f==="submit"&&g&&g.stateNode===C){var A=zO((C[Sn]||null).action),F=b.submitter;F&&(f=(f=F[Sn]||null)?zO(f.formAction):F.getAttribute("formAction"),f!==null&&(A=f,F=null));var q=new Ni("action","action",null,b,C);u.push({event:q,listeners:[{instance:null,listener:function(){if(b.defaultPrevented){if(Iu!==0){var ae=F?qO(C,F):new FormData(C);sA(g,{pending:!0,data:ae,method:C.method,action:A},null,ae)}}else typeof A=="function"&&(q.preventDefault(),ae=F?qO(C,F):new FormData(C),sA(g,{pending:!0,data:ae,method:C.method,action:A},A,ae))},currentTarget:C}]})}}for(var FA=0;FA<BT.length;FA++){var UA=BT[FA],tne=UA.toLowerCase(),nne=UA[0].toUpperCase()+UA.slice(1);wl(tne,"on"+nne)}wl(C5,"onAnimationEnd"),wl(E5,"onAnimationIteration"),wl(S5,"onAnimationStart"),wl("dblclick","onDoubleClick"),wl("focusin","onFocus"),wl("focusout","onBlur"),wl(bte,"onTransitionRun"),wl(yte,"onTransitionStart"),wl(vte,"onTransitionCancel"),wl(T5,"onTransitionEnd"),qt("onMouseEnter",["mouseout","mouseover"]),qt("onMouseLeave",["mouseout","mouseover"]),qt("onPointerEnter",["pointerout","pointerover"]),qt("onPointerLeave",["pointerout","pointerover"]),ai("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),ai("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),ai("onBeforeInput",["compositionend","keypress","textInput","paste"]),ai("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),ai("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Ux="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(" "),rne=new Set("beforetoggle cancel close invalid load scroll scrollend toggle".split(" ").concat(Ux));function KO(u,f){f=(f&4)!==0;for(var g=0;g<u.length;g++){var b=u[g],C=b.event;b=b.listeners;e:{var A=void 0;if(f)for(var F=b.length-1;0<=F;F--){var q=b[F],ae=q.instance,Ne=q.currentTarget;if(q=q.listener,ae!==A&&C.isPropagationStopped())break e;A=q,C.currentTarget=Ne;try{A(C)}catch(Ue){Kv(Ue)}C.currentTarget=null,A=ae}else for(F=0;F<b.length;F++){if(q=b[F],ae=q.instance,Ne=q.currentTarget,q=q.listener,ae!==A&&C.isPropagationStopped())break e;A=q,C.currentTarget=Ne;try{A(C)}catch(Ue){Kv(Ue)}C.currentTarget=null,A=ae}}}}function tn(u,f){var g=f[In];g===void 0&&(g=f[In]=new Set);var b=u+"__bubble";g.has(b)||(WO(f,u,2,!1),g.add(b))}function VA(u,f,g){var b=0;f&&(b|=4),WO(g,u,b,f)}var jB="_reactListening"+Math.random().toString(36).slice(2);function GA(u){if(!u[jB]){u[jB]=!0,ml.forEach(function(g){g!=="selectionchange"&&(rne.has(g)||VA(g,!1,u),VA(g,!0,u))});var f=u.nodeType===9?u:u.ownerDocument;f===null||f[jB]||(f[jB]=!0,VA("selectionchange",!1,f))}}function WO(u,f,g,b){switch(CM(f)){case 2:var C=Ine;break;case 8:C=Dne;break;default:C=rk}g=C.bind(null,f,g,u),C=void 0,!Jl||f!=="touchstart"&&f!=="touchmove"&&f!=="wheel"||(C=!0),b?C!==void 0?u.addEventListener(f,g,{capture:!0,passive:C}):u.addEventListener(f,g,!0):C!==void 0?u.addEventListener(f,g,{passive:C}):u.addEventListener(f,g,!1)}function $A(u,f,g,b,C){var A=b;if((f&1)===0&&(f&2)===0&&b!==null)e:for(;;){if(b===null)return;var F=b.tag;if(F===3||F===4){var q=b.stateNode.containerInfo;if(q===C)break;if(F===4)for(F=b.return;F!==null;){var ae=F.tag;if((ae===3||ae===4)&&F.stateNode.containerInfo===C)return;F=F.return}for(;q!==null;){if(F=Ba(q),F===null)return;if(ae=F.tag,ae===5||ae===6||ae===26||ae===27){b=A=F;continue e}q=q.parentNode}}b=b.return}gl(function(){var Ne=A,Ue=Ut(g),$e=[];e:{var _e=A5.get(u);if(_e!==void 0){var Pe=Ni,gt=u;switch(u){case"keypress":if(Xc(g)===0)break e;case"keydown":case"keyup":Pe=yl;break;case"focusin":gt="focus",Pe=De;break;case"focusout":gt="blur",Pe=De;break;case"beforeblur":case"afterblur":Pe=De;break;case"click":if(g.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":Pe=af;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":Pe=of;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":Pe=L;break;case C5:case E5:case S5:Pe=qe;break;case T5:Pe=X;break;case"scroll":case"scrollend":Pe=fu;break;case"wheel":Pe=Re;break;case"copy":case"cut":case"paste":Pe=Nt;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":Pe=Ea;break;case"toggle":case"beforetoggle":Pe=Kt}var It=(f&4)!==0,tr=!It&&(u==="scroll"||u==="scrollend"),be=It?_e!==null?_e+"Capture":null:_e;It=[];for(var ue=Ne,ke;ue!==null;){var Ge=ue;if(ke=Ge.stateNode,Ge=Ge.tag,Ge!==5&&Ge!==26&&Ge!==27||ke===null||be===null||(Ge=Ti(ue,be),Ge!=null&&It.push(Vx(ue,Ge,ke))),tr)break;ue=ue.return}0<It.length&&(_e=new Pe(_e,gt,null,g,Ue),$e.push({event:_e,listeners:It}))}}if((f&7)===0){e:{if(_e=u==="mouseover"||u==="pointerover",Pe=u==="mouseout"||u==="pointerout",_e&&g!==Jc&&(gt=g.relatedTarget||g.fromElement)&&(Ba(gt)||gt[va]))break e;if((Pe||_e)&&(_e=Ue.window===Ue?Ue:(_e=Ue.ownerDocument)?_e.defaultView||_e.parentWindow:window,Pe?(gt=g.relatedTarget||g.toElement,Pe=Ne,gt=gt?Ba(gt):null,gt!==null&&(tr=a(gt),It=gt.tag,gt!==tr||It!==5&&It!==27&&It!==6)&&(gt=null)):(Pe=null,gt=Ne),Pe!==gt)){if(It=af,Ge="onMouseLeave",be="onMouseEnter",ue="mouse",(u==="pointerout"||u==="pointerover")&&(It=Ea,Ge="onPointerLeave",be="onPointerEnter",ue="pointer"),tr=Pe==null?_e:or(Pe),ke=gt==null?_e:or(gt),_e=new It(Ge,ue+"leave",Pe,g,Ue),_e.target=tr,_e.relatedTarget=ke,Ge=null,Ba(Ue)===Ne&&(It=new It(be,ue+"enter",gt,g,Ue),It.target=ke,It.relatedTarget=tr,Ge=It),tr=Ge,Pe&&gt)t:{for(It=sne,be=Pe,ue=gt,ke=0,Ge=be;Ge;Ge=It(Ge))ke++;Ge=0;for(var Tt=ue;Tt;Tt=It(Tt))Ge++;for(;0<ke-Ge;)be=It(be),ke--;for(;0<Ge-ke;)ue=It(ue),Ge--;for(;ke--;){if(be===ue||ue!==null&&be===ue.alternate){It=be;break t}be=It(be),ue=It(ue)}It=null}else It=null;Pe!==null&&YO($e,_e,Pe,It,!1),gt!==null&&tr!==null&&YO($e,tr,gt,It,!0)}}e:{if(_e=Ne?or(Ne):window,Pe=_e.nodeName&&_e.nodeName.toLowerCase(),Pe==="select"||Pe==="input"&&_e.type==="file")var Tn=h5;else if(d5(_e))if(f5)Tn=pte;else{Tn=fte;var vt=hte}else Pe=_e.nodeName,!Pe||Pe.toLowerCase()!=="input"||_e.type!=="checkbox"&&_e.type!=="radio"?Ne&&Gr(Ne.elementType)&&(Tn=h5):Tn=mte;if(Tn&&(Tn=Tn(u,Ne))){u5($e,Tn,g,Ue);break e}vt&&vt(u,_e,Ne),u==="focusout"&&Ne&&_e.type==="number"&&Ne.memoizedProps.value!=null&&tt(_e,"number",_e.value)}switch(vt=Ne?or(Ne):window,u){case"focusin":(d5(vt)||vt.contentEditable==="true")&&(op=vt,bT=Ne,gx=null);break;case"focusout":gx=bT=op=null;break;case"mousedown":yT=!0;break;case"contextmenu":case"mouseup":case"dragend":yT=!1,B5($e,g,Ue);break;case"selectionchange":if(xte)break;case"keydown":case"keyup":B5($e,g,Ue)}var Qt;if(jn)e:{switch(u){case"compositionstart":var sn="onCompositionStart";break e;case"compositionend":sn="onCompositionEnd";break e;case"compositionupdate":sn="onCompositionUpdate";break e}sn=void 0}else ip?cf(u,g)&&(sn="onCompositionEnd"):u==="keydown"&&g.keyCode===229&&(sn="onCompositionStart");sn&&(ec&&g.locale!=="ko"&&(ip||sn!=="onCompositionStart"?sn==="onCompositionEnd"&&ip&&(Qt=sf()):(ii=Ue,rf="value"in ii?ii.value:ii.textContent,ip=!0)),vt=RB(Ne,sn),0<vt.length&&(sn=new _t(sn,u,null,g,Ue),$e.push({event:sn,listeners:vt}),Qt?sn.data=Qt:(Qt=ap(g),Qt!==null&&(sn.data=Qt)))),(Qt=Ro?lte(u,g):cte(u,g))&&(sn=RB(Ne,"onBeforeInput"),0<sn.length&&(vt=new _t("onBeforeInput","beforeinput",null,g,Ue),$e.push({event:vt,listeners:sn}),vt.data=Qt)),ene($e,u,Ne,g,Ue)}KO($e,f)})}function Vx(u,f,g){return{instance:u,listener:f,currentTarget:g}}function RB(u,f){for(var g=f+"Capture",b=[];u!==null;){var C=u,A=C.stateNode;if(C=C.tag,C!==5&&C!==26&&C!==27||A===null||(C=Ti(u,g),C!=null&&b.unshift(Vx(u,C,A)),C=Ti(u,f),C!=null&&b.pu
vendor: 7,251 bytes, lines 48-49
48sh(Vx(u,C,A))),u.tag===3)return b;u=u.return}return[]}function sne(u){if(u===null)return null;do u=u.return;while(u&&u.tag!==5&&u.tag!==27);return u||null}function YO(u,f,g,b,C){for(var A=f._reactName,F=[];g!==null&&g!==b;){var q=g,ae=q.alternate,Ne=q.stateNode;if(q=q.tag,ae!==null&&ae===b)break;q!==5&&q!==26&&q!==27||Ne===null||(ae=Ne,C?(Ne=Ti(g,A),Ne!=null&&F.unshift(Vx(g,Ne,ae))):C||(Ne=Ti(g,A),Ne!=null&&F.push(Vx(g,Ne,ae)))),g=g.return}F.length!==0&&u.push({event:f,listeners:F})}var ane=/\r\n?/g,ine=/\u0000|\uFFFD/g;function QO(u){return(typeof u=="string"?u:""+u).replace(ane,`
49`).replace(ine,"")}function JO(u,f){return f=QO(f),QO(u)===f}function er(u,f,g,b,C,A){switch(g){case"children":typeof b=="string"?f==="body"||f==="textarea"&&b===""||Ln(u,b):(typeof b=="number"||typeof b=="bigint")&&f!=="body"&&Ln(u,""+b);break;case"className":ps(u,"class",b);break;case"tabIndex":ps(u,"tabindex",b);break;case"dir":case"role":case"viewBox":case"width":case"height":ps(u,g,b);break;case"style":Et(u,b,A);break;case"data":if(f!=="object"){ps(u,"data",b);break}case"src":case"href":if(b===""&&(f!=="a"||g!=="href")){u.removeAttribute(g);break}if(b==null||typeof b=="function"||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(g);break}b=Qc(""+b),u.setAttribute(g,b);break;case"action":case"formAction":if(typeof b=="function"){u.setAttribute(g,"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 A=="function"&&(g==="formAction"?(f!=="input"&&er(u,f,"name",C.name,C,null),er(u,f,"formEncType",C.formEncType,C,null),er(u,f,"formMethod",C.formMethod,C,null),er(u,f,"formTarget",C.formTarget,C,null)):(er(u,f,"encType",C.encType,C,null),er(u,f,"method",C.method,C,null),er(u,f,"target",C.target,C,null)));if(b==null||typeof b=="symbol"||typeof b=="boolean"){u.removeAttribute(g);break}b=Qc(""+b),u.setAttribute(g,b);break;case"onClick":b!=null&&(u.onclick=Ci);break;case"onScroll":b!=null&&tn("scroll",u);break;case"onScrollEnd":b!=null&&tn("scrollend",u);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(r(61));if(g=b.__html,g!=null){if(C.children!=null)throw Error(r(60));u.innerHTML=g}}break;case"multiple":u.multiple=b&&typeof b!="function"&&typeof b!="symbol";break;case"muted":u.muted=b&&typeof b!="function"&&typeof b!="symbol";break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"defaultValue":case"defaultChecked":case"innerHTML":case"ref":break;case"autoFocus":break;case"xlinkHref":if(b==null||typeof b=="function"||typeof b=="boolean"||typeof b=="symbol"){u.removeAttribute("xlink:href");break}g=Qc(""+b),u.setAttributeNS("http://www.w3.org/1999/xlink","xlink:href",g);break;case"contentEditable":case"spellCheck":case"draggable":case"value":case"autoReverse":case"externalResourcesRequired":case"focusable":case"preserveAlpha":b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(g,""+b):u.removeAttribute(g);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":b&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(g,""):u.removeAttribute(g);break;case"capture":case"download":b===!0?u.setAttribute(g,""):b!==!1&&b!=null&&typeof b!="function"&&typeof b!="symbol"?u.setAttribute(g,b):u.removeAttribute(g);break;case"cols":case"rows":case"size":case"span":b!=null&&typeof b!="function"&&typeof b!="symbol"&&!isNaN(b)&&1<=b?u.setAttribute(g,b):u.removeAttribute(g);break;case"rowSpan":case"start":b==null||typeof b=="function"||typeof b=="symbol"||isNaN(b)?u.removeAttribute(g):u.setAttribute(g,b);break;case"popover":tn("beforetoggle",u),tn("toggle",u),Wl(u,"popover",b);break;case"xlinkActuate":lr(u,"http://www.w3.org/1999/xlink","xlink:actuate",b);break;case"xlinkArcrole":lr(u,"http://www.w3.org/1999/xlink","xlink:arcrole",b);break;case"xlinkRole":lr(u,"http://www.w3.org/1999/xlink","xlink:role",b);break;case"xlinkShow":lr(u,"http://www.w3.org/1999/xlink","xlink:show",b);break;case"xlinkTitle":lr(u,"http://www.w3.org/1999/xlink","xlink:title",b);break;case"xlinkType":lr(u,"http://www.w3.org/1999/xlink","xlink:type",b);break;case"xmlBase":lr(u,"http://www.w3.org/XML/1998/namespace","xml:base",b);break;case"xmlLang":lr(u,"http://www.w3.org/XML/1998/namespace","xml:lang",b);break;case"xmlSpace":lr(u,"http://www.w3.org/XML/1998/namespace","xml:space",b);break;case"is":Wl(u,"is",b);break;case"innerText":case"textContent":break;default:(!(2<g.length)||g[0]!=="o"&&g[0]!=="O"||g[1]!=="n"&&g[1]!=="N")&&(g=Yr.get(g)||g,Wl(u,g,b))}}function HA(u,f,g,b,C,A){switch(g){case"style":Et(u,b,A);break;case"dangerouslySetInnerHTML":if(b!=null){if(typeof b!="object"||!("__html"in b))throw Error(r(61));if(g=b.__html,g!=null){if(C.children!=null)throw Error(r(60));u.innerHTML=g}}break;case"children":typeof b=="string"?Ln(u,b):(typeof b=="number"||typeof b=="bigint")&&Ln(u,""+b);break;case"onScroll":b!=null&&tn("scroll",u);break;case"onScrollEnd":b!=null&&tn("scrollend",u);break;case"onClick":b!=null&&(u.onclick=Ci);break;case"suppressContentEditableWarning":case"suppressHydrationWarning":case"innerHTML":case"ref":break;case"innerText":case"textContent":break;default:if(!Kl.hasOwnProperty(g))e:{if(g[0]==="o"&&g[1]==="n"&&(C=g.endsWith("Capture"),f=g.slice(2,C?g.length-7:void 0),A=u[Sn]||null,A=A!=null?A[g]:null,typeof A=="function"&&u.removeEventListener(f,A,C),typeof b=="function")){typeof A!="function"&&A!==null&&(g in u?u[g]=null:u.hasAttribute(g)&&u.removeAttribute(g)),u.addEventListener(f,b,C);break e}g in u?u[g]=b:b===!0?u.setAttribute(g,""):Wl(u,g,b)}}}function ka(u,f,g){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"img":tn("error",u),tn("load",u);var b=!1,C=!1,A;for(A in g)if(g.hasOwnProperty(A)){var F=g[A];if(F!=null)switch(A){case"src":b=!0;break;case"srcSet":C=!0;break;case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:er(u,f,A,F,g,null)}}C&&er(u,f,"srcSet",g.srcSet,g,null),b&&er(u,f,"src",g.src,g,null);return;case"input":tn("invalid",u);var q=A=F=C=null,ae=null,Ne=null;for(b in g)if(g.hasOwnProperty(b)){var Ue=g[b];if(Ue!=null)switch(b){case"name":C=Ue;break;case"type":F=Ue;break;case"checked":ae=Ue;break;case"defaultChecked":Ne=Ue;break;case"value":A=Ue;break;case"defaultValue":q=Ue;break;case"children":case"dangerouslySetInnerHTML":if(Ue!=null)throw Error(r(137,f));break;default:er(u,f,b,Ue,g,null)}}Yl(u,A,q,ae,Ne,F,C,!1);return;case"select":tn("invalid",u),b=F=A=null;for(C in g)if(g.hasOwnProperty(C)&&(q=g[C],q!=null))switch(C){case"value":A=q;break;case"defaultValue":F=q;break;case"multiple":b=q;default:er(u,f,C,q,g,null)}f=A,g=F,u.multiple=!!b,f!=null?ft(u,!!b,f,!1):g!=null&&ft(u,!!b,g,!0);return;case"textarea":tn("invalid",u),A=C=b=null;
vendor: 4,354 bytes, line 49
49for(F in g)if(g.hasOwnProperty(F)&&(q=g[F],q!=null))switch(F){case"value":b=q;break;case"defaultValue":C=q;break;case"children":A=q;break;case"dangerouslySetInnerHTML":if(q!=null)throw Error(r(91));break;default:er(u,f,F,q,g,null)}lt(u,b,C,A);return;case"option":for(ae in g)if(g.hasOwnProperty(ae)&&(b=g[ae],b!=null))switch(ae){case"selected":u.selected=b&&typeof b!="function"&&typeof b!="symbol";break;default:er(u,f,ae,b,g,null)}return;case"dialog":tn("beforetoggle",u),tn("toggle",u),tn("cancel",u),tn("close",u);break;case"iframe":case"object":tn("load",u);break;case"video":case"audio":for(b=0;b<Ux.length;b++)tn(Ux[b],u);break;case"image":tn("error",u),tn("load",u);break;case"details":tn("toggle",u);break;case"embed":case"source":case"link":tn("error",u),tn("load",u);case"area":case"base":case"br":case"col":case"hr":case"keygen":case"meta":case"param":case"track":case"wbr":case"menuitem":for(Ne in g)if(g.hasOwnProperty(Ne)&&(b=g[Ne],b!=null))switch(Ne){case"children":case"dangerouslySetInnerHTML":throw Error(r(137,f));default:er(u,f,Ne,b,g,null)}return;default:if(Gr(f)){for(Ue in g)g.hasOwnProperty(Ue)&&(b=g[Ue],b!==void 0&&HA(u,f,Ue,b,g,void 0));return}}for(q in g)g.hasOwnProperty(q)&&(b=g[q],b!=null&&er(u,f,q,b,g,null))}function one(u,f,g,b){switch(f){case"div":case"span":case"svg":case"path":case"a":case"g":case"p":case"li":break;case"input":var C=null,A=null,F=null,q=null,ae=null,Ne=null,Ue=null;for(Pe in g){var $e=g[Pe];if(g.hasOwnProperty(Pe)&&$e!=null)switch(Pe){case"checked":break;case"value":break;case"defaultValue":ae=$e;default:b.hasOwnProperty(Pe)||er(u,f,Pe,null,b,$e)}}for(var _e in b){var Pe=b[_e];if($e=g[_e],b.hasOwnProperty(_e)&&(Pe!=null||$e!=null))switch(_e){case"type":A=Pe;break;case"name":C=Pe;break;case"checked":Ne=Pe;break;case"defaultChecked":Ue=Pe;break;case"value":F=Pe;break;case"defaultValue":q=Pe;break;case"children":case"dangerouslySetInnerHTML":if(Pe!=null)throw Error(r(137,f));break;default:Pe!==$e&&er(u,f,_e,Pe,b,$e)}}eo(u,F,q,ae,Ne,Ue,A,C);return;case"select":Pe=F=q=_e=null;for(A in g)if(ae=g[A],g.hasOwnProperty(A)&&ae!=null)switch(A){case"value":break;case"multiple":Pe=ae;default:b.hasOwnProperty(A)||er(u,f,A,null,b,ae)}for(C in b)if(A=b[C],ae=g[C],b.hasOwnProperty(C)&&(A!=null||ae!=null))switch(C){case"value":_e=A;break;case"defaultValue":q=A;break;case"multiple":F=A;default:A!==ae&&er(u,f,C,A,b,ae)}f=q,g=F,b=Pe,_e!=null?ft(u,!!g,_e,!1):!!b!=!!g&&(f!=null?ft(u,!!g,f,!0):ft(u,!!g,g?[]:"",!1));return;case"textarea":Pe=_e=null;for(q in g)if(C=g[q],g.hasOwnProperty(q)&&C!=null&&!b.hasOwnProperty(q))switch(q){case"value":break;case"children":break;default:er(u,f,q,null,b,C)}for(F in b)if(C=b[F],A=g[F],b.hasOwnProperty(F)&&(C!=null||A!=null))switch(F){case"value":_e=C;break;case"defaultValue":Pe=C;break;case"children":break;case"dangerouslySetInnerHTML":if(C!=null)throw Error(r(91));break;default:C!==A&&er(u,f,F,C,b,A)}yt(u,_e,Pe);return;case"option":for(var gt in g)if(_e=g[gt],g.hasOwnProperty(gt)&&_e!=null&&!b.hasOwnProperty(gt))switch(gt){case"selected":u.selected=!1;break;default:er(u,f,gt,null,b,_e)}for(ae in b)if(_e=b[ae],Pe=g[ae],b.hasOwnProperty(ae)&&_e!==Pe&&(_e!=null||Pe!=null))switch(ae){case"selected":u.selected=_e&&typeof _e!="function"&&typeof _e!="symbol";break;default:er(u,f,ae,_e,b,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 It in g)_e=g[It],g.hasOwnProperty(It)&&_e!=null&&!b.hasOwnProperty(It)&&er(u,f,It,null,b,_e);for(Ne in b)if(_e=b[Ne],Pe=g[Ne],b.hasOwnProperty(Ne)&&_e!==Pe&&(_e!=null||Pe!=null))switch(Ne){case"children":case"dangerouslySetInnerHTML":if(_e!=null)throw Error(r(137,f));break;default:er(u,f,Ne,_e,b,Pe)}return;default:if(Gr(f)){for(var tr in g)_e=g[tr],g.hasOwnProperty(tr)&&_e!==void 0&&!b.hasOwnProperty(tr)&&HA(u,f,tr,void 0,b,_e);for(Ue in b)_e=b[Ue],Pe=g[Ue],!b.hasOwnProperty(Ue)||_e===Pe||_e===void 0&&Pe===void 0||HA(u,f,Ue,_e,b,Pe);return}}for(var be in g)_e=g[be],g.hasOwnProperty(be)&&_e!=null&&!b.hasOwnProperty(be)&&er(u,f,be,null,b,_e);for($e in b)_e=b[$e],Pe=g[$e],!b.hasOwnProperty($e)||_e===Pe||_e==null&&Pe==null||er(u,f,$e,_e,b,Pe)}function XO(u){switch(u){case"css":case"script":case"font":case"img":case"image":case"input":case"link":return!0;default:return!1}}
vendor: 16,782 bytes, line 49
49function lne(){if(typeof performance.getEntriesByType=="function"){for(var u=0,f=0,g=performance.getEntriesByType("resource"),b=0;b<g.length;b++){var C=g[b],A=C.transferSize,F=C.initiatorType,q=C.duration;if(A&&q&&XO(F)){for(F=0,q=C.responseEnd,b+=1;b<g.length;b++){var ae=g[b],Ne=ae.startTime;if(Ne>q)break;var Ue=ae.transferSize,$e=ae.initiatorType;Ue&&XO($e)&&(ae=ae.responseEnd,F+=Ue*(ae<q?1:(q-Ne)/(ae-Ne)))}if(--b,f+=8*(A+F)/(C.duration/1e3),u++,10<u)break}}if(0<u)return f/u/1e6}return navigator.connection&&(u=navigator.connection.downlink,typeof u=="number")?u:5}var zA=null,qA=null;function PB(u){return u.nodeType===9?u:u.ownerDocument}function ZO(u){switch(u){case"http://www.w3.org/2000/svg":return 1;case"http://www.w3.org/1998/Math/MathML":return 2;default:return 0}}function eM(u,f){if(u===0)switch(f){case"svg":return 1;case"math":return 2;default:return 0}return u===1&&f==="foreignObject"?0:u}function KA(u,f){return u==="textarea"||u==="noscript"||typeof f.children=="string"||typeof f.children=="number"||typeof f.children=="bigint"||typeof f.dangerouslySetInnerHTML=="object"&&f.dangerouslySetInnerHTML!==null&&f.dangerouslySetInnerHTML.__html!=null}var WA=null;function cne(){var u=window.event;return u&&u.type==="popstate"?u===WA?!1:(WA=u,!0):(WA=null,!1)}var tM=typeof setTimeout=="function"?setTimeout:void 0,dne=typeof clearTimeout=="function"?clearTimeout:void 0,nM=typeof Promise=="function"?Promise:void 0,une=typeof queueMicrotask=="function"?queueMicrotask:typeof nM<"u"?function(u){return nM.resolve(null).then(u).catch(hne)}:tM;function hne(u){setTimeout(function(){throw u})}function Du(u){return u==="head"}function rM(u,f){var g=f,b=0;do{var C=g.nextSibling;if(u.removeChild(g),C&&C.nodeType===8)if(g=C.data,g==="/$"||g==="/&"){if(b===0){u.removeChild(C),Rp(f);return}b--}else if(g==="$"||g==="$?"||g==="$~"||g==="$!"||g==="&")b++;else if(g==="html")Gx(u.ownerDocument.documentElement);else if(g==="head"){g=u.ownerDocument.head,Gx(g);for(var A=g.firstChild;A;){var F=A.nextSibling,q=A.nodeName;A[ns]||q==="SCRIPT"||q==="STYLE"||q==="LINK"&&A.rel.toLowerCase()==="stylesheet"||g.removeChild(A),A=F}}else g==="body"&&Gx(u.ownerDocument.body);g=C}while(g);Rp(f)}function sM(u,f){var g=u;u=0;do{var b=g.nextSibling;if(g.nodeType===1?f?(g._stashedDisplay=g.style.display,g.style.display="none"):(g.style.display=g._stashedDisplay||"",g.getAttribute("style")===""&&g.removeAttribute("style")):g.nodeType===3&&(f?(g._stashedText=g.nodeValue,g.nodeValue=""):g.nodeValue=g._stashedText||""),b&&b.nodeType===8)if(g=b.data,g==="/$"){if(u===0)break;u--}else g!=="$"&&g!=="$?"&&g!=="$~"&&g!=="$!"||u++;g=b}while(g)}function YA(u){var f=u.firstChild;for(f&&f.nodeType===10&&(f=f.nextSibling);f;){var g=f;switch(f=f.nextSibling,g.nodeName){case"HTML":case"HEAD":case"BODY":YA(g),Io(g);continue;case"SCRIPT":case"STYLE":continue;case"LINK":if(g.rel.toLowerCase()==="stylesheet")continue}u.removeChild(g)}}function fne(u,f,g,b){for(;u.nodeType===1;){var C=g;if(u.nodeName.toLowerCase()!==f.toLowerCase()){if(!b&&(u.nodeName!=="INPUT"||u.type!=="hidden"))break}else if(b){if(!u[ns])switch(f){case"meta":if(!u.hasAttribute("itemprop"))break;return u;case"link":if(A=u.getAttribute("rel"),A==="stylesheet"&&u.hasAttribute("data-precedence"))break;if(A!==C.rel||u.getAttribute("href")!==(C.href==null||C.href===""?null:C.href)||u.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin)||u.getAttribute("title")!==(C.title==null?null:C.title))break;return u;case"style":if(u.hasAttribute("data-precedence"))break;return u;case"script":if(A=u.getAttribute("src"),(A!==(C.src==null?null:C.src)||u.getAttribute("type")!==(C.type==null?null:C.type)||u.getAttribute("crossorigin")!==(C.crossOrigin==null?null:C.crossOrigin))&&A&&u.hasAttribute("async")&&!u.hasAttribute("itemprop"))break;return u;default:return u}}else if(f==="input"&&u.type==="hidden"){var A=C.name==null?null:""+C.name;if(C.type==="hidden"&&u.getAttribute("name")===A)return u}else return u;if(u=Vo(u.nextSibling),u===null)break}return null}function mne(u,f,g){if(f==="")return null;for(;u.nodeType!==3;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!g||(u=Vo(u.nextSibling),u===null))return null;return u}function aM(u,f){for(;u.nodeType!==8;)if((u.nodeType!==1||u.nodeName!=="INPUT"||u.type!=="hidden")&&!f||(u=Vo(u.nextSibling),u===null))return null;return u}function QA(u){return u.data==="$?"||u.data==="$~"}function JA(u){return u.data==="$!"||u.data==="$?"&&u.ownerDocument.readyState!=="loading"}function pne(u,f){var g=u.ownerDocument;if(u.data==="$~")u._reactRetry=f;else if(u.data!=="$?"||g.readyState!=="loading")f();else{var b=function(){f(),g.removeEventListener("DOMContentLoaded",b)};g.addEventListener("DOMContentLoaded",b),u._reactRetry=b}}function Vo(u){for(;u!=null;u=u.nextSibling){var f=u.nodeType;if(f===1||f===3)break;if(f===8){if(f=u.data,f==="$"||f==="$!"||f==="$?"||f==="$~"||f==="&"||f==="F!"||f==="F")break;if(f==="/$"||f==="/&")return null}}return u}var XA=null;function iM(u){u=u.nextSibling;for(var f=0;u;){if(u.nodeType===8){var g=u.data;if(g==="/$"||g==="/&"){if(f===0)return Vo(u.nextSibling);f--}else g!=="$"&&g!=="$!"&&g!=="$?"&&g!=="$~"&&g!=="&"||f++}u=u.nextSibling}return null}function oM(u){u=u.previousSibling;for(var f=0;u;){if(u.nodeType===8){var g=u.data;if(g==="$"||g==="$!"||g==="$?"||g==="$~"||g==="&"){if(f===0)return u;f--}else g!=="/$"&&g!=="/&"||f++}u=u.previousSibling}return null}function lM(u,f,g){switch(f=PB(g),u){case"html":if(u=f.documentElement,!u)throw Error(r(452));return u;case"head":if(u=f.head,!u)throw Error(r(453));return u;case"body":if(u=f.body,!u)throw Error(r(454));return u;default:throw Error(r(451))}}function Gx(u){for(var f=u.attributes;f.length;)u.removeAttributeNode(f[0]);Io(u)}var Go=new Map,cM=new Set;function LB(u){return typeof u.getRootNode=="function"?u.getRootNode():u.nodeType===9?u:u.ownerDocument}var md=Z.d;Z.d={f:gne,r:xne,D:bne,C:yne,L:vne,m:Bne,X:Cne,S:wne,M:Ene};function gne(){var u=md.f(),f=AB();return u||f}function xne(u){var f=Ns(u);f!==null&&f.tag===5&&f.type==="form"?TL(f):md.r(u)}var Ip=typeof document>"u"?null:document;function dM(u,f,g){var b=Ip;if(b&&typeof f=="string"&&f){var C=Br(f);C='link[rel="'+u+'"][href="'+C+'"]',typeof g=="string"&&(C+='[crossorigin="'+g+'"]'),cM.has(C)||(cM.add(C),u={rel:u,crossOrigin:g,href:f},b.querySelector(C)===null&&(f=b.createElement("link"),ka(f,"link",u),vr(f),b.head.appendChild(f)))}}function bne(u){md.D(u),dM("dns-prefetch",u,null)}function yne(u,f){md.C(u,f),dM("preconnect",u,f)}function vne(u,f,g){md.L(u,f,g);var b=Ip;if(b&&u&&f){var C='link[rel="preload"][as="'+Br(f)+'"]';f==="image"&&g&&g.imageSrcSet?(C+='[imagesrcset="'+Br(g.imageSrcSet)+'"]',typeof g.imageSizes=="string"&&(C+='[imagesizes="'+Br(g.imageSizes)+'"]')):C+='[href="'+Br(u)+'"]';var A=C;switch(f){case"style":A=Dp(u);break;case"script":A=jp(u)}Go.has(A)||(u=m({rel:"preload",href:f==="image"&&g&&g.imageSrcSet?void 0:u,as:f},g),Go.set(A,u),b.querySelector(C)!==null||f==="style"&&b.querySelector($x(A))||f==="script"&&b.querySelector(Hx(A))||(f=b.createElement("link"),ka(f,"link",u),vr(f),b.head.appendChild(f)))}}function Bne(u,f){md.m(u,f);var g=Ip;if(g&&u){var b=f&&typeof f.as=="string"?f.as:"script",C='link[rel="modulepreload"][as="'+Br(b)+'"][href="'+Br(u)+'"]',A=C;switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":A=jp(u)}if(!Go.has(A)&&(u=m({rel:"modulepreload",href:u},f),Go.set(A,u),g.querySelector(C)===null)){switch(b){case"audioworklet":case"paintworklet":case"serviceworker":case"sharedworker":case"worker":case"script":if(g.querySelector(Hx(A)))return}b=g.createElement("link"),ka(b,"link",u),vr(b),g.head.appendChild(b)}}}function wne(u,f,g){md.S(u,f,g);var b=Ip;if(b&&u){var C=yi(b).hoistableStyles,A=Dp(u);f=f||"default";var F=C.get(A);if(!F){var q={loading:0,preload:null};if(F=b.querySelector($x(A)))q.loading=5;else{u=m({rel:"stylesheet",href:u,"data-precedence":f},g),(g=Go.get(A))&&ZA(u,g);var ae=F=b.createElement("link");vr(ae),ka(ae,"link",u),ae._p=new Promise(function(Ne,Ue){ae.onload=Ne,ae.onerror=Ue}),ae.addEventListener("load",function(){q.loading|=1}),ae.addEventListener("error",function(){q.loading|=2}),q.loading|=4,OB(F,f,b)}F={type:"stylesheet",instance:F,count:1,state:q},C.set(A,F)}}}function Cne(u,f){md.X(u,f);var g=Ip;if(g&&u){var b=yi(g).hoistableScripts,C=jp(u),A=b.get(C);A||(A=g.querySelector(Hx(C)),A||(u=m({src:u,async:!0},f),(f=Go.get(C))&&ek(u,f),A=g.createElement("script"),vr(A),ka(A,"link",u),g.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},b.set(C,A))}}function Ene(u,f){md.M(u,f);var g=Ip;if(g&&u){var b=yi(g).hoistableScripts,C=jp(u),A=b.get(C);A||(A=g.querySelector(Hx(C)),A||(u=m({src:u,async:!0,type:"module"},f),(f=Go.get(C))&&ek(u,f),A=g.createElement("script"),vr(A),ka(A,"link",u),g.head.appendChild(A)),A={type:"script",instance:A,count:1,state:null},b.set(C,A))}}function uM(u,f,g,b){var C=(C=J.current)?LB(C):null;if(!C)throw Error(r(446));switch(u){case"meta":case"title":return null;case"style":return typeof g.precedence=="string"&&typeof g.href=="string"?(f=Dp(g.href),g=yi(C).hoistableStyles,b=g.get(f),b||(b={type:"style",instance:null,count:0,state:null},g.set(f,b)),b):{type:"void",instance:null,count:0,state:null};case"link":if(g.rel==="stylesheet"&&typeof g.href=="string"&&typeof g.precedence=="string"){u=Dp(g.href);var A=yi(C).hoistableStyles,F=A.get(u);if(F||(C=C.ownerDocument||C,F={type:"stylesheet",instance:null,count:0,state:{loading:0,preload:null}},A.set(u,F),(A=C.querySelector($x(u)))&&!A._p&&(F.instance=A,F.state.loading=5),Go.has(u)||(g={rel:"preload",as:"style",href:g.href,crossOrigin:g.crossOrigin,integrity:g.integrity,media:g.media,hrefLang:g.hrefLang,referrerPolicy:g.referrerPolicy},Go.set(u,g),A||Sne(C,u,g,F.state))),f&&b===null)throw Error(r(528,""));return F}if(f&&b!==null)throw Error(r(529,""));return null;case"script":return f=g.async,g=g.src,typeof g=="string"&&f&&typeof f!="function"&&typeof f!="symbol"?(f=jp(g),g=yi(C).hoistableScripts,b=g.get(f),b||(b={type:"script",instance:null,count:0,state:null},g.set(f,b)),b):{type:"void",instance:null,count:0,state:null};default:throw Error(r(444,u))}}function Dp(u){return'href="'+Br(u)+'"'}function $x(u){return'link[rel="stylesheet"]['+u+"]"}function hM(u){return m({},u,{"data-precedence":u.precedence,precedence:null})}function Sne(u,f,g,b){u.querySelector('link[rel="preload"][as="style"]['+f+"]")?b.loading=1:(f=u.createElement("link"),b.preload=f,f.addEventListener("load",function(){return b.loading|=1}),f.addEventListener("error",function(){return b.loading|=2}),ka(f,"link",g),vr(f),u.head.appendChild(f))}function jp(u){return'[src="'+Br(u)+'"]'}function Hx(u){return"script[async]"+u}function fM(u,f,g){if(f.count++,f.instance===null)switch(f.type){case"style":var b=u.querySelector('style[data-href~="'+Br(g.href)+'"]');if(b)return f.instance=b,vr(b),b;var C=m({},g,{"data-href":g.href,"data-precedence":g.precedence,href:null,precedence:null});return b=(u.ownerDocument||u).createElement("style"),vr(b),ka(b,"style",C),OB(b,g.precedence,u),f.instance=b;case"stylesheet":C=Dp(g.href);var A=u.querySelector($x(C));if(A)return f.state.loading|=4,f.instance=A,vr(A),A;b=hM(g),(C=Go.get(C))&&ZA(b,C),A=(u.ownerDocument||u).createElement("link"),vr(A);var F=A;return F._p=new Promise(function(q,ae){F.onload=q,F.onerror=ae}),ka(A,"link",b),f.state.loading|=4,OB(A,g.precedence,u),f.instance=A;case"script":return A=jp(g.src),(C=u.querySelector(Hx(A)))?(f.instance=C,vr(C),C):(b=g,(C=Go.get(A))&&(b=m({},g),ek(b,C)),u=u.ownerDocument||u,C=u.createElement("script"),vr(C),ka(C,"link",b),u.head.appendChild(C),f.instance=C);case"void":return null;default:throw Error(r(443,f.type))}else f.type==="stylesheet"&&(f.state.loading&4)===0&&(b=f.instance,f.state.loading|=4,OB(b,g.precedence,u));return f.instance}function OB(u,f,g){for(var b=g.querySelectorAll('link[rel="stylesheet"][data-precedence],style[data-precedence]'),C=b.length?b[b.length-1]:null,A=C,F=0;F<b.length;F++){var q=b[F];if(q.dataset.precedence===f)A=q;else if(A!==C)break}A?A.parentNode.insertBefore(u,A.nextSibling):(f=g.nodeType===9?g.head:g,f.insertBefore(u,f.firstChild))}function ZA(u,f){u.crossOrigin==null&&(u.crossOrigin=f.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=f.referrerPolicy),u.title==null&&(u.title=f.title)}function ek(u,f){u.crossOrigin==null&&(u.crossOrigin=f.crossOrigin),u.referrerPolicy==null&&(u.referrerPolicy=f.referrerPolicy),u.integrity==null&&(u.integrity=f.integrity)}var MB=null;function mM(u,f,g){if(MB===null){var b=new Map,C=MB=new Map;C.set(g,b)}else C=MB,b=C.get(g),b||(b=new Map,C.set(g,b));if(b.has(u))return b;for(b.set(u,null),g=g.getElementsByTagName(u),C=0;C<g.length;C++){var A=g[C];if(!(A[ns]||A[Xn]||u==="link"&&A.getAttribute("rel")==="stylesheet")&&A.namespaceURI!=="http://www.w3.org/2000/svg"){var F=A.getAttribute(f)||"";F=u+F;var q=b.get(F);q?q.push(A):b.set(F,[A])}}return b}function pM(u,f,g){u=u.ownerDocument||u,u.head.insertBefore(g,f==="title"?u.querySelector("head > title"):null)}function Tne(u,f,g){if(g===1||f.itemProp!=null)return!1;switch(u){case"meta":case"title":return!0;case"style":if(typeof f.precedence!="string"||typeof f.href!="string"||f.href==="")break;return!0;case"link":if(typeof f.rel!="string"||typeof f.href!="string"||f.href===""||f.onLoad||f.onError)break;switch(f.rel){case"stylesheet":return u=f.disabled,typeof f.precedence=="string"&&u==null;default:return!0}case"script":if(f.async&&typeof f.async!="function"&&typeof f.async!="symbol"&&!f.onLoad&&!f.onError&&f.src&&typeof f.src=="string")return!0}return!1}function gM(u){return!(u.type==="stylesheet"&&(u.state.loading&3)===0)}function Ane(u,f,g,b){if(g.type==="stylesheet"&&(typeof b.media!="string"||matchMedia(b.media).matches!==!1)&&(g.state.loading&4)===0){if(g.instance===null){var C=Dp(b.href),A=f.querySelector($x(C));if(A){f=A._p,f!==null&&typeof f=="object"&&typeof f.then=="function"&&(u.count++,u=FB.bind(u),f.then(u,u)),g.state.loading|=4,g.instance=A,vr(A);return}A=f.ownerDocument||f,b=hM(b),(C=Go.get(C))&&ZA(b,C),A=A.createElement("link"),vr(A);var F=A;F._p=new Promise(function(q,ae){F.onload=q,F.onerror=ae}),ka(A,"link",b),g.instance=A}u.stylesheets===null&&(u.stylesheets=new Map),u.stylesheets.set(g,f),(f=g.state.preload)&&(g.state.loading&3)===0&&(u.count++,g=FB.bind(u),f.addEventListener("load",g),f.addEventListener("error",g))}}var tk=0;function kne(u,f){return u.stylesheets&&u.count===0&&VB(u,u.stylesheets),0<u.count||0<u.imgCount?function(g){var b=setTimeout(function(){if(u.stylesheets&&VB(u,u.stylesheets),u.unsuspend){var A=u.unsuspend;u.unsuspend=null,A()}},6e4+f);0<u.imgBytes&&tk===0&&(tk=62500*lne());var C=setTimeout(function(){if(u.waitingForImages=!1,u.count===0&&(u.stylesheets&&VB(u,u.stylesheets),u.unsuspend)){var A=u.unsuspend;u.unsuspend=null,A()}},(u.imgBytes>tk?50:800)+f);return u.unsuspend=g,function(){u.unsuspend=null,clearTimeout(b),clearTimeout(C)}}:null}function FB(){if(this.count--,this.count===0&&(this.imgCount===0||!this.waitingForImages)){if(this.stylesheets)VB(this,this.stylesheets);else if(this.unsuspend){var u=this.unsuspend;this.unsuspend=null,u()}}}var UB=null;function VB(u,f){u.stylesheets=null,u.unsuspend!==null&&(u.count++,UB=new Map,f.forEach(Nne,u),UB=null,FB.call(u))}function Nne(u,f){if(!(f.state.loading&4)){var g=UB.get(u);if(g)var b=g.get(null);else{g=new Map,UB.set(u,g);for(var C=u.querySelectorAll("link[data-precedence],style[data-precedence]"),A=0;A<C.length;A++){var F=C[A];(F.nodeName==="LINK"||F.getAttribute("media")!=="not all")&&(g.set(F.dataset.precedence,F),b=F)}b&&g.set(null,b)}C=f.instance,F=C.getAttribute("data-precedence"),A=g.get(F)||b,A===b&&g.set(null,C),g.set(F,C),this.count++,b=FB.bind(this),C.addEventListener("load",b),C.addEventListener("error",b),A?A.parentNode.insertBefore(C,A.nextSibling):(u=u.nodeType===9?u.head:u,u.insertBefore(C,u.firstChild)),f.state.loading|=4}}var zx={$$typeof:T,Provider:null,Consumer:null,_currentValue:z,_currentValue2:z,_threadCount:0};function _ne(u,f,g,b,C,A,F,q,ae){this.tag=1,this.containerInfo=u,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=hs(-1),this.entangledLanes=this.shellSuspendCounter=this.errorRecoveryDisabledLanes=this.expiredLanes=this.warmLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=hs(0),this.hiddenUpdates=hs(null),this.identifierPrefix=b,this.onUncaughtError=C,this.onCaughtError=A,this.onRecoverableError=F,this.pooledCache=null,this.pooledCacheLanes=0,this.formState=ae,this.incompleteTransitions=new Map}
vendor: 9,614 bytes, line 49
49function xM(u,f,g,b,C,A,F,q,ae,Ne,Ue,$e){return u=new _ne(u,f,g,F,ae,Ne,Ue,$e,q),f=1,A===!0&&(f|=24),A=ro(3,null,null,f),u.current=A,A.stateNode=u,f=RT(),f.refCount++,u.pooledCache=f,f.refCount++,A.memoizedState={element:b,isDehydrated:g,cache:f},MT(A),u}function bM(u){return u?(u=dp,u):dp}function yM(u,f,g,b,C,A){C=bM(C),b.context===null?b.context=C:b.pendingContext=C,b=Bu(f),b.payload={element:g},A=A===void 0?null:A,A!==null&&(b.callback=A),g=wu(u,b,f),g!==null&&(Ri(g,u,f),Cx(g,u,f))}function vM(u,f){if(u=u.memoizedState,u!==null&&u.dehydrated!==null){var g=u.retryLane;u.retryLane=g!==0&&g<f?g:f}}function nk(u,f){vM(u,f),(u=u.alternate)&&vM(u,f)}function BM(u){if(u.tag===13||u.tag===31){var f=hf(u,67108864);f!==null&&Ri(f,u,67108864),nk(u,67108864)}}function wM(u){if(u.tag===13||u.tag===31){var f=lo();f=xe(f);var g=hf(u,f);g!==null&&Ri(g,u,f),nk(u,f)}}var GB=!0;function Ine(u,f,g,b){var C=G.T;G.T=null;var A=Z.p;try{Z.p=2,rk(u,f,g,b)}finally{Z.p=A,G.T=C}}function Dne(u,f,g,b){var C=G.T;G.T=null;var A=Z.p;try{Z.p=8,rk(u,f,g,b)}finally{Z.p=A,G.T=C}}function rk(u,f,g,b){if(GB){var C=sk(b);if(C===null)$A(u,f,b,$B,g),EM(u,b);else if(Rne(C,u,f,g,b))b.stopPropagation();else if(EM(u,b),f&4&&-1<jne.indexOf(u)){for(;C!==null;){var A=Ns(C);if(A!==null)switch(A.tag){case 3:if(A=A.stateNode,A.current.memoizedState.isDehydrated){var F=Ar(A.pendingLanes);if(F!==0){var q=A;for(q.pendingLanes|=2,q.entangledLanes|=2;F;){var ae=1<<31-Qn(F);q.entanglements[1]|=ae,F&=~ae}sc(A),(Rn&6)===0&&(SB=$t()+500,Fx(0))}}break;case 31:case 13:q=hf(A,2),q!==null&&Ri(q,A,2),AB(),nk(A,2)}if(A=sk(b),A===null&&$A(u,f,b,$B,g),A===C)break;C=A}C!==null&&b.stopPropagation()}else $A(u,f,b,null,g)}}function sk(u){return u=Ut(u),ak(u)}var $B=null;function ak(u){if($B=null,u=Ba(u),u!==null){var f=a(u);if(f===null)u=null;else{var g=f.tag;if(g===13){if(u=o(f),u!==null)return u;u=null}else if(g===31){if(u=l(f),u!==null)return u;u=null}else if(g===3){if(f.stateNode.current.memoizedState.isDehydrated)return f.tag===3?f.stateNode.containerInfo:null;u=null}else f!==u&&(u=null)}}return $B=u,null}function CM(u){switch(u){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(ds()){case sa:return 2;case Fa:return 8;case Mr:case es:return 32;case us:return 268435456;default:return 32}default:return 32}}var ik=!1,ju=null,Ru=null,Pu=null,qx=new Map,Kx=new Map,Lu=[],jne="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 EM(u,f){switch(u){case"focusin":case"focusout":ju=null;break;case"dragenter":case"dragleave":Ru=null;break;case"mouseover":case"mouseout":Pu=null;break;case"pointerover":case"pointerout":qx.delete(f.pointerId);break;case"gotpointercapture":case"lostpointercapture":Kx.delete(f.pointerId)}}function Wx(u,f,g,b,C,A){return u===null||u.nativeEvent!==A?(u={blockedOn:f,domEventName:g,eventSystemFlags:b,nativeEvent:A,targetContainers:[C]},f!==null&&(f=Ns(f),f!==null&&BM(f)),u):(u.eventSystemFlags|=b,f=u.targetContainers,C!==null&&f.indexOf(C)===-1&&f.push(C),u)}function Rne(u,f,g,b,C){switch(f){case"focusin":return ju=Wx(ju,u,f,g,b,C),!0;case"dragenter":return Ru=Wx(Ru,u,f,g,b,C),!0;case"mouseover":return Pu=Wx(Pu,u,f,g,b,C),!0;case"pointerover":var A=C.pointerId;return qx.set(A,Wx(qx.get(A)||null,u,f,g,b,C)),!0;case"gotpointercapture":return A=C.pointerId,Kx.set(A,Wx(Kx.get(A)||null,u,f,g,b,C)),!0}return!1}function SM(u){var f=Ba(u.target);if(f!==null){var g=a(f);if(g!==null){if(f=g.tag,f===13){if(f=o(g),f!==null){u.blockedOn=f,mn(u.priority,function(){wM(g)});return}}else if(f===31){if(f=l(g),f!==null){u.blockedOn=f,mn(u.priority,function(){wM(g)});return}}else if(f===3&&g.stateNode.current.memoizedState.isDehydrated){u.blockedOn=g.tag===3?g.stateNode.containerInfo:null;return}}}u.blockedOn=null}function HB(u){if(u.blockedOn!==null)return!1;for(var f=u.targetContainers;0<f.length;){var g=sk(u.nativeEvent);if(g===null){g=u.nativeEvent;var b=new g.constructor(g.type,g);Jc=b,g.target.dispatchEvent(b),Jc=null}else return f=Ns(g),f!==null&&BM(f),u.blockedOn=g,!1;f.shift()}return!0}function TM(u,f,g){HB(u)&&g.delete(f)}function Pne(){ik=!1,ju!==null&&HB(ju)&&(ju=null),Ru!==null&&HB(Ru)&&(Ru=null),Pu!==null&&HB(Pu)&&(Pu=null),qx.forEach(TM),Kx.forEach(TM)}function zB(u,f){u.blockedOn===f&&(u.blockedOn=null,ik||(ik=!0,n.unstable_scheduleCallback(n.unstable_NormalPriority,Pne)))}var qB=null;function AM(u){qB!==u&&(qB=u,n.unstable_scheduleCallback(n.unstable_NormalPriority,function(){qB===u&&(qB=null);for(var f=0;f<u.length;f+=3){var g=u[f],b=u[f+1],C=u[f+2];if(typeof b!="function"){if(ak(b||g)===null)continue;break}var A=Ns(g);A!==null&&(u.splice(f,3),f-=3,sA(A,{pending:!0,data:C,method:g.method,action:b},b,C))}}))}function Rp(u){function f(ae){return zB(ae,u)}ju!==null&&zB(ju,u),Ru!==null&&zB(Ru,u),Pu!==null&&zB(Pu,u),qx.forEach(f),Kx.forEach(f);for(var g=0;g<Lu.length;g++){var b=Lu[g];b.blockedOn===u&&(b.blockedOn=null)}for(;0<Lu.length&&(g=Lu[0],g.blockedOn===null);)SM(g),g.blockedOn===null&&Lu.shift();if(g=(u.ownerDocument||u).$$reactFormReplay,g!=null)for(b=0;b<g.length;b+=3){var C=g[b],A=g[b+1],F=C[Sn]||null;if(typeof A=="function")F||AM(g);else if(F){var q=null;if(A&&A.hasAttribute("formAction")){if(C=A,F=A[Sn]||null)q=F.formAction;else if(ak(C)!==null)continue}else q=F.action;typeof q=="function"?g[b+1]=q:(g.splice(b,3),b-=3),AM(g)}}}function kM(){function u(A){A.canIntercept&&A.info==="react-transition"&&A.intercept({handler:function(){return new Promise(function(F){return C=F})},focusReset:"manual",scroll:"manual"})}function f(){C!==null&&(C(),C=null),b||setTimeout(g,20)}function g(){if(!b&&!navigation.transition){var A=navigation.currentEntry;A&&A.url!=null&&navigation.navigate(A.url,{state:A.getState(),info:"react-transition",history:"replace"})}}if(typeof navigation=="object"){var b=!1,C=null;return navigation.addEventListener("navigate",u),navigation.addEventListener("navigatesuccess",f),navigation.addEventListener("navigateerror",f),setTimeout(g,100),function(){b=!0,navigation.removeEventListener("navigate",u),navigation.removeEventListener("navigatesuccess",f),navigation.removeEventListener("navigateerror",f),C!==null&&(C(),C=null)}}}function ok(u){this._internalRoot=u}KB.prototype.render=ok.prototype.render=function(u){var f=this._internalRoot;if(f===null)throw Error(r(409));var g=f.current,b=lo();yM(g,b,u,f,null,null)},KB.prototype.unmount=ok.prototype.unmount=function(){var u=this._internalRoot;if(u!==null){this._internalRoot=null;var f=u.containerInfo;yM(u.current,2,null,u,null,null),AB(),f[va]=null}};function KB(u){this._internalRoot=u}KB.prototype.unstable_scheduleHydration=function(u){if(u){var f=ht();u={blockedOn:null,target:u,priority:f};for(var g=0;g<Lu.length&&f!==0&&f<Lu[g].priority;g++);Lu.splice(g,0,u),g===0&&SM(u)}};var NM=e.version;if(NM!=="19.2.6")throw Error(r(527,NM,"19.2.6"));Z.findDOMNode=function(u){var f=u._reactInternals;if(f===void 0)throw typeof u.render=="function"?Error(r(188)):(u=Object.keys(u).join(","),Error(r(268,u)));return u=d(f),u=u!==null?h(u):null,u=u===null?null:u.stateNode,u};var Lne={bundleType:0,version:"19.2.6",rendererPackageName:"react-dom",currentDispatcherRef:G,reconcilerVersion:"19.2.6"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var WB=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!WB.isDisabled&&WB.supportsFiber)try{ts=WB.inject(Lne),Fr=WB}catch{}}return Qx.createRoot=function(u,f){if(!s(u))throw Error(r(299));var g=!1,b="",C=LL,A=OL,F=ML;return f!=null&&(f.unstable_strictMode===!0&&(g=!0),f.identifierPrefix!==void 0&&(b=f.identifierPrefix),f.onUncaughtError!==void 0&&(C=f.onUncaughtError),f.onCaughtError!==void 0&&(A=f.onCaughtError),f.onRecoverableError!==void 0&&(F=f.onRecoverableError)),f=xM(u,1,!1,null,null,g,b,null,C,A,F,kM),u[va]=f.current,GA(u),new ok(f)},Qx.hydrateRoot=function(u,f,g){if(!s(u))throw Error(r(299));var b=!1,C="",A=LL,F=OL,q=ML,ae=null;return g!=null&&(g.unstable_strictMode===!0&&(b=!0),g.identifierPrefix!==void 0&&(C=g.identifierPrefix),g.onUncaughtError!==void 0&&(A=g.onUncaughtError),g.onCaughtError!==void 0&&(F=g.onCaughtError),g.onRecoverableError!==void 0&&(q=g.onRecoverableError),g.formState!==void 0&&(ae=g.formState)),f=xM(u,1,!0,f,g??null,b,C,ae,A,F,q,kM),f.context=bM(null),g=f.current,b=lo(),b=xe(b),C=Bu(b),C.callback=null,wu(g,C,b),g=b,f.current.lanes=g,ba(f,g),sc(f),u[va]=f.current,GA(u),new KB(f)},Qx.version="19.2.6",Qx}var FM;
49function Yne(){if(FM)return dk.exports;FM=1;function n(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(n)}catch(e){console.error(e)}}return n(),dk.exports=Wne(),dk.exports}var Qne=Yne();const Jne={common:{appName:"RadioShadow AI",tagline:"AI-Powered Real-time Podcasts Listening Practice & Pronunciation Coach",version:"PRO v2.5",loading:"Loading...",save:"Save",cancel:"Cancel",close:"Close",confirm:"Confirm",delete:"Delete",clear:"Clear",copied:"Copied!",copy:"Copy",pro:"PRO",free:"Free",upgradeToPro:"Upgrade to PRO",signIn:"Sign in",signOut:"Sign Out",userDashboard:"User Dashboard",membership:"Membership",proUnlimited:"PRO Unlimited",freePreview:"Free Preview",customerSupport:"Customer Support",termsAndPrivacy:"Terms & Privacy",search:"Search",reset:"Reset",all:"All",back:"Back",next:"Next",done:"Done",open:"Open",download:"Download",copiedToast:"Copied to clipboard",switchTheme:"Toggle Dark / Light Mode"},header:{articles:"Articles",articlesTitle:"Read language shadowing articles & guides",aiExaminer:"AI Examiner",aiExaminerTitle:"Open AI Oral Examiner 1v1 Debate",embedWidget:"Embed",embedTitle:"Embed live podcast player into your website or Notion",tour:"Tour",tourTitle:"Interactive walkthrough for new users",liveStream:"Podcasts & Audio",proCurated:"Curated Audio",language:"Language",switchLanguage:"Switch Language",english:"English",chinese:"中文",userProfile:"User Profile",loginRequired:"Sign In Required",signIn:"Sign in",signOut:"Sign out"},app:{theaterMode:"Theater Mode",exploreMode:"Explore Map",switchView:"Switch View",helpMeChoose:"✨ Help Me Choose",helpMeChooseSub:"Unsure what to listen to? Let our 2-step AI Wizard match the perfect podcast for your mood",continuousShadowing:"Continuous Shadowing",singleSentenceMode:"Single-Sentence Mode",single:"Single",continuous:"Continuous",liveStation:"Live Podcasts & Audio",offlineFallback:"Station stream offline. Switched to fallback channel.",listeningLive:"Listening to live podcasts & audio...",waitingAnnouncer:"Waiting for announcer voice. Music and commercial breaks are automatically filtered out.",subtitleInitializing:"Subtitle stream initializing...",clickToPractice:"Click any subtitle sentence above to practice shadowing",holdToSpeak:"Hold to speak",releaseToEvaluate:"Release to evaluate",evaluating:"AI is evaluating...",recording:"Recording...",pressAndHoldMic:"Press and hold the microphone to record your shadowing practice.",selectSentenceFirst:"Select a sentence to practice.",saveToNotebook:"Bookmark",savedToNotebook:"Bookmarked",bookmarkPhrase:"Bookmark phrase",removeBookmark:"Remove bookmark",practicePronunciation:"Practice pronunciation",clearTranscripts:"Clear",copyTranscript:"Copy",downloadTranscript:"Download",copiedTranscript:"Copied!",autoScroll:"Auto-scroll",scrollLocked:"Scroll Locked",speechEvaluationResult:"Speech Evaluation Result",overallBand:"Estimated Fluency Band",pronunciationScore:"Pronunciation & Intonation",fluencyScore:"Fluency & Rhythm",vocabularyScore:"Vocabulary Alignment",accuracyScore:"Accuracy Score",aiFeedback:"💡 Coach's Advice:",coachAdvice:"💡 Coach's Advice:",targetSentence:"Podcast Target Sentence",yourSpeech:"Your Recorded Speech",noSentenceSelected:"Waiting for Target Sentence",noSentenceDesc:"Click on any sentence in the live podcast transcript on the left to freeze and practice single-sentence pronunciation.",continuousModeTitle:"Continuous Shadowing Mode",continuousRecordingActive:"Continuous speech is actively being recorded ({seconds}s elapsed). Keep shadowing along with the podcast stream!",continuousModeDesc:"Shadow global podcasts non-stop without pausing. AI aligns your entire audio recording with podcast text, diagnoses problem words, and generates a study notebook.",startContinuousSession:"Start Continuous Session",elapsed:"Elapsed",target:"Target",mins:"mins",finishAndAnalyze:"Finish & Analyze",dictionaryFilter:"Vocabulary Focus",dictBasic:"Basic English",dictIelts:"C1 Advanced (Native Vocab)",dictBiz:"Business",dictDele:"Spanish DELE B2",viewM
49odeStream:"Podcasts & Subtitles",viewModeMap:"Global Interactive Map",viewModeCurated:"Curated High-Value Podcasts",liveAiInterpreter:"AI Real-Time Podcast Interpreter",liveInterpreterDesc:"Instant AI transcription and real-time translation for live global podcasts and listening practice streams",liveDubbing:"Live AI Voice Dubbing",liveDubbingShort:"AI Voice",liveDubbingDesc:"Toggle simultaneous AI Voice Dubbing (PRO Feature). Hear real-time spoken translation alongside original podcast audio.",startLiveTranslation:"Start Live Translation",stopTranslation:"Stop Translation",connectingTranslation:"Connecting...",selectStationFirst:"Select a podcast first",liveAssistantActive:"Live Assistant active to {lang}",dualAudioDesc:"Gemini is restating translated speech in real time alongside the podcast audio.",textOnlyDesc:"Gemini is providing real-time text transcription & translations without audio playback, keeping podcast audio clear for shadowing.",transcriptionFeedTitle:"Live Podcast Transcription Feed",transcriptionFeedDesc:"Continuous log of captured and translated podcast audio",capturedOriginal:"CAPTURED ORIGINAL AUDIO",geminiInterpretation:"GEMINI SIMULTANEOUS INTERPRETATION",nativeStream:"NATIVE STREAM",interpretedLabel:"Interpreted ({lang})",listeningFrequencies:"Listening to active podcast streams...",feedEmptyDesc:"Captured audio captions & simultaneous translations will flow into this dual-channel side-by-side display panel in real-time.",curatedPractice:"Curated Practice",linesCount:"{count} lines",lines:"lines",liveBroadcastTranscript:"Live Podcast & Audio Transcript",cabin:"Cabin",cabinBtn:"Cabin",map:"Map",mapBtn:"Map",stations:"Podcasts:",stationsBarLabel:"Podcasts:",newSentencesResume:"🟢 {count} new sentences · [Resume Live ⬇]",resumeLive:"new sentences · [Resume Live ⬇]",continuousMode:"Continuous Shadowing Mode",startContinuous:"Start Continuous Session",waitingTargetSentence:"Waiting for Target Sentence",clickSentenceToShadow:"Click on any sentence in the live podcast transcript on the left to freeze and practice single-sentence pronunciation.",selectSentencePrompt:"Select a sentence on the left to start shadowing practice",bookmarked:"Saved",bookmark:"Bookmark",aiEvaluating:"AI Evaluating...",pressAndHoldPrompt:"Hold down the microphone button while speaking, release when finished.",listenOriginalAudio:"Listen to original sentence audio",resetEvaluation:"Reset evaluation",estimatedBand:"Estimated Fluency Band",rightsReserved:"© 2026 Global Podcasts & Listening Practice SaaS. All rights reserved.",termsOfService:"Terms of Service",privacyPolicy:"Privacy Policy"},hud:{title:"Continuous Shadowing Session",recordingActive:"AI Audio Recording Active",targetDuration:"Target Duration",remainingTime:"Remaining Time",sentencesCaptured:"Sentences Captured",micSignal:"Mic Signal",pause:"Pause",resume:"Resume",finish:"Finish & Generate AI Report",cancel:"Cancel Session",speakingGuide:"Keep speaking aloud along with the podcast stream...",min3:"3 min",min5:"5 min",min10:"10 min",min30:"30 min",statusListening:"Streaming & Recording",statusPaused:"Recording Paused",statusAnalyzing:"Analyzing audio alignment...",setupTitle:"Continuous Shadowing Setup",setupSubtitle:"Set your target duration for non-stop shadowing practice",selectDuration:"Select Practice Duration",startPractice:"Start Continuous Shadowing",proFeatureNotice:"PRO Feature • Non-stop real-time audio alignment"},report:{modalTitle:"AI Shadowing Session Diagnostic Report",sessionDuration:"Session Duration",sentencesShadowed:"Sentences Shadowed",estimatedBand:"Estimated Fluency Band",acousticRadar:"Acoustic Radar Analysis",coachSummary:"Overall Coach Summary",weakPhonemes:"Key Problematic Phonemes & Words",breakdown:"Sentence-by-Sentence Alignment Breakdown",nativeBroadcast:"Native Podcast Source",yourTranscript:"Your Recorded Audio Transcript",saveWord:"Save Word",exportPdf:"Export Report (PDF / Image)",backToRadio:"Back to Podcasts & Listening",noData:"No acoustic session data available.",viewNotebook:"Open in Dashboard Notebook",accuracy:"Accuracy",fluency:"Fluency",pronunciation:"Pronunciation",speed:"Speed Match",intonation:"Intonation",excellent:"Excellent",good:"Good",needsWork:"Needs Practice",playRecording:"Play Recorded Audio",pauseRecording:"Pause Audio"},player:{connecting:"Live Stream Connecting...",playing:"Live Podcasts Playing",paused:"Paused",streamError:"Stream connection error. Retrying alternative server...",mute:"Mute",unmute:"Unmute",directUrl:"Direct Stream URL",bitrate:"Bitrate",codec:"Codec",volume:"Volume",practiceFrozenTip:"Subtitle scroll frozen for practice. Click Resume or Play to sync.",resumeLiveStream:"Resume Live",selectAStation:"Select a podcast or station to begin streaming"},stations:{searchPlaceholder:"Search 40,000+ global podcasts & stations (name, city, genre)...",allLanguages:"All Languages",allAccents:"All Accents",allGenres:"All Genres",sortBy:"Sort by",topVoted:"Top Voted",mostPopular:"Most Popular",highestBitrate:"Highest Bitrate",noStationsFound:"No podcasts or stations foun
49d matching filter",noStationsHelp:"Try correcting your search spelling, clearing active tags, or click on a different region on the world map.",resetFilters:"Reset Filters",activeStations:"streams active",listenNow:"Listen Now",changeStation:"Change Stream",scanningAirwaves:"Scanning Regional Podcast Streams...",regionalStreams:"Regional Podcasts & Audio Streams",featuredGlobal:"Featured Global Podcasts & Audio",connectingFrequencies:"Connecting to local podcast feeds...",filteredByTag:"filtered by #{tag} (clear)",nowPlaying:"Now playing: {name}",tuneInto:"Tune into {name}",regionalBroadcast:"Regional Podcast Stream"},worldMap:{loading:"Loading dynamic geographic projection...",activeStationsCount:"{count} active streams",guide:"Click on any country or region to discover local podcasts and listening practice audio"},proCabin:{title:"Curated Study Cabin",subtitle:"Select a curated passage for offline shadowing practice",proUnlocked:"PRO Unlocked",freeTierNotice:"1st Free · PRO Unlocks All",filterPassages:"Filter Passages",resetFilters:"Reset Filters",language:"Language",difficulty:"Difficulty",vocabCoverage:"Vocab Coverage",sophistication:"Band / Sophistication",allLanguages:"All Languages",allLevels:"All Levels",allVocabDensity:"All Vocab Density",allSophistication:"All Sophistication",beginner:"Beginner",intermediate:"Intermediate",advanced:"Advanced",highVocab:"High (80%+)",mediumVocab:"Medium (50%+)",standardVocab:"Standard",noPassagesMatch:"No passages match your current filter criteria.",proMemberPassage:"PRO Member Passage",unlockPassages:"Unlock Passages",shadowThisPassage:"Shadow This Passage",vocabDensityLabel:"Vocab Density:"},cabin:{title:"Curated Study Cabin",streamBadge:"AI Curated Podcasts",subtitle:"Select a curated podcast passage to practice offline and drill pronunciation.",filterPassages:"Filtered {count} Passages",resetFilters:"Reset Filters",language:"Language",allLanguages:"All Languages",difficultyLevel:"Difficulty",allLevels:"All Levels",vocabDensity:"Vocab Density",allDensity:"All Density",bandSophistication:"Band / Sophistication",allSophistication:"All Sophistication",practiceShadowing:"Shadow This Passage",curatorNote:"Curator Note:",unlockSnippets:"Unlock All Curated Passages",unlockDesc:"Upgrade to PRO Unlimited to practice all daily curated podcast passages and vocabulary notebooks."},helpDrawer:{title:"Find Your Perfect Podcast Shadowing Stream",step1Title:"Step 1: Choose Your Target Language",step2Title:"Step 2: Select Preferred Dialect & Vibe",step3Title:"Step 3: Recommended Podcasts for You",genreNews:"Hardcore News (Formal diction, international politics)",genreTalk:"Relaxed Talk Show (Conversations, interviews & humor)",genreSports:"Fast-paced Sports (High-adrenaline commentary)",genreMusic:"Upbeat Music & Pop (Chart hits & energetic hosts)",genreChill:"Ambient & Chill (Smooth acoustic grooves, low stress)",matchScore:"AI Match Score",recommendationReason:"Shadowing Recommendation Reason",startShadowing:"Start Shadowing This Podcast",selectDialect:"Select Dialect & Accent",selectVibe:"Select Podcast Vibe & Pace",backToStep1:"Change Language",backToStep2:"Change Vibe",matchingStations:"Matching Podcasts for You",allDialects:"All Dialects"},drawer:{title:"Find Your Perfect Podcast Shadowing Stream",liveWizard:"Live Wizard",step1Desc:"Select your target language to drill authentic native pronunciation.",step2Desc:"Pick target regional dialect, pacing & vibe.",step3Desc:"AI curated flagship podcasts matched to your criteria.",languageQuestion:"Which language do you want to master?",languageSubtitle:"Choose from 100+ native spoken frequencies across the globe.",languageLabel:"Target Language",change:"Change",targetAccent:"Target Accent & Dialect",vibeQuestion:"What podcast style or vibe fits your mood?",vibeSubtitle:"Select content pacing, formal diction or casual talk.",changeVibe:"Change Vibe",aiMatchInsight:"AI Match Insight",analyzingAcoustic:"Analyzing live acoustic frequencies for {lang}...",filterAccent:"Filter by accent",curatedFlagship:"Flagship Podcasts",highClarityStream:"Ultra-Low Latency Podcast Stream",enteringTheater:"Entering Theater...",shadowThisRadio:"Shadow This Podcast",globalRadioPool:"Global Podcast Pool",refresh:"Refresh",searchPrompt:"Search",connectingGlobal:"Connecting to global podcast streams",shadowAction:"Shadow",noAdditionalStations:"No additional podcasts found for this dialect.",theaterTip:"💡 Tip: Click any subtitle line in Theater Mode to freeze & evaluate your pronunciation.",syncTip:"💡 Tip: RadioShadow automatically keeps live podcast and synchronized transcript buffer in memory."},dashboard:{title:"User Dashboard",profileAndPlan:"Profile & Plan",shadowingNotebook:"Shadowing Notebook (PRO)",savedSentences:"Saved Sentences",speechHistory:"Speech Evaluation History",proMember:"PRO Member",freePlan:"Free Plan",notebookDesc:"Continuous speech alignment & diagnosis notes",savedDesc:"Bookmarked podcast phrases & vocabulary",historyDesc:"Individual pronunciation score records",noNotebooks:"No Shadowing Notebooks Yet",noSaved:"No Saved Sentences Yet",noHistory:"No Evaluation Records Yet",viewDiagnosis:"View Full Diagnosis",practiceSentence:"Practice Sentence",deleteRecord:"Delete Record",deleteBookmark:"Delete Bookmark",backToLive:"Back to Live Podcasts",accountEmail:"Account Email",membershipStatus:"Membership Status",activePlan:"Active Plan",expiresOn:"Expires On",upgradeCta:"Upgrade to PRO Unlimited",notebookEntries:"Notebook Entries",totalPracticeTime:"Total Practice Time",averageBand:"Average Fluency Band",examinerHistory:"Spoken Coaching History",examinerDesc:"1v1 Coach Sessions, Growth Analytics & Certificates",noExaminerHistory:"No Spoken Coaching Records Yet",noExaminerDesc:"Complete a 1v1 session with our AI Spoken Coach to track y
49our CEFR fluency progression, acoustic phonetics, and official certificates here.",startExaminerCta:"Start 1v1 Spoken Coaching",oralExamScore:"Spoken Score",totalOralSessions:"Total Sessions",peakBand:"Peak Band",latestBand:"Latest Band",exportCertificate:"Download Certificate",viewExamReport:"View Diagnostic Report",fluency:"Fluency & Coherence",lexical:"Lexical Resource",grammar:"Grammatical Range",pronunciation:"Pronunciation & Acoustics"},onboarding:{welcome:"Welcome to RadioShadow AI",quickTour:"Quick Tour",step1Badge:"Step 1 of 4 • Global Podcasts & Audio",step1Title:"Master Real Spoken Languages with Global Podcasts",step1Desc:"RadioShadow connects you directly to 10,000+ live audio podcasts across 100+ countries. Train your ear with authentic accents, news, and native conversations.",step1Card1Title:"100+ Countries",step1Card1Desc:"Listen to BBC, France Info, Cadena SER, NHK, and hundreds of authentic local podcasts.",step1Card2Title:"Zero-Delay Stream",step1Card2Desc:"Real-time podcast streaming with historical transcript buffer that never clears when paused.",step2Badge:"Step 2 of 4 • Dual AI & Voice Dubbing",step2Title:"Live Synchronized Subtitles & Real-time AI Interpretation",step2Desc:"Our real-time speech recognition engine transcribes podcast speech in real time with side-by-side bilingual translations.",step2LiveBadge:"LIVE DUAL SUBTITLES",step2TagBadge:"High-Frequency Native Focus",step2VoiceDub:"Real-time Dual Voice Dubbing Available (PRO)",step3Badge:"Step 3 of 4 • Precision Shadowing",step3Title:"Shadow Along with Native Podcasts",step3Desc:"Choose Single-Sentence mode for granular practice, or switch to Continuous Shadowing for non-stop immersion.",step3EstBand:"Estimated Fluency Band",step3Fluency:"Fluency Match",step3Phonetic:"Acoustic Radar",step3AiCoaching:"AI Coach:",step3AiAdvice:"Master linking sounds and intonation peaks on target keywords.",step4Badge:"Step 4 of 4 • AI Acoustic Coach",step4Title:"Get Instant AI Acoustic Diagnostics & Fluency Band",step4Desc:"Receive 5-dimension radar scoring, problem phoneme detection, and personalized native coaching feedback.",step4ExploreMap:"Explore Interactive World Map",step4BrowsePro:"Browse Daily Curated Lessons",step4BbcService:"Launch BBC World Service",nextStep:"Next Step",getStarted:"Got it, let's practice!",skip:"Skip Tutorial",skipGuide:"Skip Tour",back:"Back",next:"Next",finishAndStart:"Get Started",launchBbc:"Launch BBC World Service",exploreMap:"Explore Global Map"},paywall:{title:"Unlock Full PRO Membership",bannerBadge:"VIP PASS • UNLIMITED ACCESS",vipPass:"VIP PASS • UNLIMITED ACCESS",subtitle:"Accelerate your spoken fluency with real-time AI bilingual subtitles, continuous acoustic shadowing reports, and curated immersion cabins.",wordsCaught:"Advanced Words Mastered",shadowingsDone:"Shadowings Done",globalStationsCount:"Global Podcasts",globalStations:"Global Podcasts",price:"From $6.66/mo",signInToUpgrade:"Sign in to Upgrade to PRO",verifying:"Verifying subscription with server...",guarantee:"30-Day Money Back Guarantee • Encrypted Checkout",instantActivation:"⚡ Instant VIP Activation • Cancel Anytime via PayPal Dashboard",needHelp:"Need help with payment? Contact [email protected]",termsConsent:"By completing your purchase, you agree to our Terms of Service & Privacy Policy.",notNow:"Not now, back to app",perk1Title:"Unlimited Live AI Interpretation (50+ Languages)",perk1Desc:"Zero daily session limits, instant bilingual transcripts & uninterrupted buffer.",perk2Title:"Global Multilingual Real-Time Subtitles",perk2Desc:"Ultra-accurate native transcription aligned side-by-side with target language translations.",perk3Title:"Continuous Live Shadowing & Acoustic Radar",perk3Desc:"Up to 10-min long-form practice, native fluency estimation & 5D metrics.",perk4Title:"C1 Advanced Vocabulary & Daily Pro Curated Packs",perk4Desc:"High-frequency academic word matchers + daily curated lessons & transcripts."},footer:{copyright:"© 2026 Global Podcasts & Listening Practice SaaS. All rights reserved.",terms:"Terms of Service",privacy:"Privacy Policy",rightsReserved:"© 2026 Global Podcasts & Listening Practice SaaS. All rights reserved.",termsOfService:"Terms of Service",privacyPolicy:"Privacy Policy"},support:{title:"Customer Support",guarantee:"Guaranteed reply within 24 hours",bubbleText:"Support & Help",needHelpPayment:"Need help with payment?",copyEmail
49:"Copy",copied:"Copied!",selectTopic:"Select Topic to Email",topicPayment:"Payment & Subscription",topicAudio:"Audio & Live Stream Issue",topicGeneral:"General Support & Feedback",openEmail:"Open Email to {email}",supportBtn:"Support"},embed:{title:"Embed Podcast Widget",desc:"Embed this live podcast player into your blog, documentation, or Notion workspace.",selectStation:"Select Podcast Stream",themeStyle:"Theme Style",light:"Light",dark:"Dark",preview:"Live Preview",copyHtml:"Copy HTML Code",copyUrl:"Copy Embed URL",practiceShadowing:"Practice Shadowing"},legal:{termsTitle:"Terms of Service",privacyTitle:"Privacy Policy",acceptance:"Acceptance of Terms",description:"Description of Service",accounts:"User Accounts & PRO Subscriptions",aiProcessing:"AI Processing & Audio Data Usage",ip:"Intellectual Property",liability:"Limitation of Liability",compliance:"Encrypted & Compliant with GDPR / CCPA",agree:"I Understand & Agree"},examiner:{badge:"1v1 Debate Mode",title:"AI Speaking Coach",tagline:"1v1 Voice Debate grounded in authentic native podcast audio",description:"Test your spontaneous speech against our senior coach in 3 progressive tiers with CEFR diagnostic reporting.",groundedInSegment:"Grounded in Live On-Air Segment",launchExam:"Launch Spoken Coaching",ieltsCefrBadge:"Podcast Speaking / CEFR C1",speakingGuidance:"AI Speaking Coach",proBadge:"PRO",closeTitle:"Close Coaching Room",examinerDoctorName:"Dr. Arthur Sterling",examinerRole:"Senior Language & CEFR Fluency Coach",examinerStatusOnline:"Online • Ready for Coaching",hoverToExpand:"Hover to expand • Click to enter",sidebarBadge:"Speaking Coach",startDebateCta:"Start 1v1 Coaching",peekTitle:"AI Speaking Coach",liveStation:"Live: {station}",modeLabel:"Mode:",holdSpacebar:"Hold Spacebar",clickToRecord:"Click to Record",rounds:{round1Title:"Factual Recall & Synthesis",round1Short:"1. Factual Recall",round1Objective:"Synthesize facts and core dilemmas from the podcast report.",round2Title:"Critical Rebuttal & Counterpoint",round2Short:"2. Counterpoint",round2Objective:"Respond to challenging counter-arguments and evaluate trade-offs.",round3Title:"Abstract Extension & Transfer",round3Short:"3. Personal Transfer",round3Objective:"Extrapolate to personal experience or broader societal impact."},ready:{heading:"Ready for Your 1v1 Spoken Oral Debate?",subheading:"Unlike unstructured chitchat, this exam tests your ability to synthesize authentic podcast topics across 3 progressive intellectual tiers: Factual Recall, Counterpoint Rebuttal, and Abstract Extrapolation.",selectSource:"Select Grounding Source:",liveBroadcastFrom:"Current Podcast from {station}",liveOnAir:"Live On-Air",officialCuratedTitle:"Official C1 Podcast Slice (Economics, Climate & AI Ethics)",officialCuratedDesc:"Standardized global news excerpts curated from BBC World Service, NPR, France Info, and Deutschlandfunk.",beginExam:"Begin 3-Round Oral Examination"},arena:{showExcerpt:"Show excerpt",hideExcerpt:"Hide",keyVocabulary:"Key Vocabulary:",seniorExaminer:"Senior Examiner",speakingAloud:"Speaking aloud...",turnQuestion:"Turn Question",pauseVoice:"Pause Voice",replay:"Replay",synthesizingInquiry:"Examiner framing strategic follow-up inquiry...",thoughtPhase1:"Examiner analyzing podcast excerpt & tension points...",thoughtPhase2:"Examiner evaluating argument premise & counter-perspectives...",thoughtPhase3:"Examiner synthesizing C1 debate inquiry...",prepTimeTitle:"Strategic Thought Formulation Time",prepCountdown:"Prep time remaining: {seconds}s",skipPrep:"Ready to Speak (Skip)",audioReady:"Native Audio Ready",audioBuffering:"Syncing examiner voice audio in background...",scoringTip:"Scoring Tip:",holdSpaceToSpeak:"Hold Spacebar to speak",clickMicToStart:"Click microphone to start",recordingAnswer:"Recording answer...",transcribingResponse:"Transcribing your response...",analyzingCefr:"Analyzing CEFR metrics...",pressHoldSpace:"Press & Hold [SPACE] to Speak",clickToSpeak:"Click to Speak",captured:"Captured:",completedRounds:"Completed Rounds:"},report:{certBadge:"Oral Assessment Certificate",certTitle:"CEFR Proficiency Certification",certId:"ID",topic:"Topic",overallBand:"Overall Band",radarTitle:"Acoustic & Linguistic Balance (5 Dimensions)",candidateScore:"Candidate Score",metrics:{fluencyAndCoherence:"Fluency & Coherence",fluencyAndCoherenceSub:"Logical connectors and continuous flow",lexicalResource:"Lexical Resource",lexicalResourceSub:"C1 Academic terminology & idiomatic precision",grammaticalAccuracy:"Grammatical Accuracy",grammaticalAccuracySub:"Complex syntactic range and modal verbs",pronunciationAcoustic:"Pronunciation & Delivery",pronunciationAcousticSub:"Rhythm, intonation and acoustic cadence"},examinerSummary:"Examiner Official Assessment:",grammarTitle:"Grammar Micro-Surgery:",rule:"Rule:",correction:"Correction:",vocabTitle:"High-Yield C1 Vocabulary Upgrades:",debateAnother:"Debate Another Topic",unlockPro:"Unlock Unlimited Mock 
49Exams (PRO)",downloadCert:"Export Official Certificate (PNG)",downloadingCert:"Rendering Archival Certificate...",downloadSuccess:"Certificate Downloaded!",quotaNotice:"Device-Bound Trial: {remaining} free session remaining",quotaReachedTitle:"Device Free Trial Limit Reached",quotaReachedDesc:"This device has used its 1 free 1v1 Spoken Coaching trial. The quota is bound to this device (switching guest accounts will not reset it). Upgrade to PRO for unlimited 1v1 coaching rounds, personalized acoustic diagnostics, and official CEFR certificate downloads.",deviceBindingNotice:"Free trial quota is permanently tied to this physical device to prevent account-hopping abuse.",upgradeToUnlockCert:"Official Archival Certificate is a PRO Feature. Upgrade to Download.",proExclusiveExport:"PRO Verified Export",savedToDashboard:"Saved to Personal Learning Dashboard",viewInDashboard:"View Full History in Dashboard"},authRequired:{badge:"Score Archival & Certification",title:"Sign in to Unlock 1v1 Spoken Coaching",subtitle:"The 1v1 AI Speaking Coach calculates official CEFR fluency bands, generates verified certificates, and archives your acoustic reports to your personal learning center.",guestNotice:"Currently in Guest Mode. Sign in to save your coaching scores and diagnostic reports.",loginRequiredBadge:"Login Required",loginToUnlock:"Sign in to Start",benefit1Title:"Personal Growth & Score Archive",benefit1Desc:"Permanently record all 1v1 mock exam overall bands, sub-scores, and 5D acoustic radar metrics.",benefit2Title:"Turn-by-Turn Replay & Native Polish",benefit2Desc:"3-round full transcript replay with examiner native restructuring and high-band suggestions.",benefit3Title:"Official CEFR Certified Credentials",benefit3Desc:"Generate certified academic report cards with official verification IDs and examiner signature.",signInWithGoogle:"Continue with Google",signInWithEmail:"Quick Email Sign-In",emailPlaceholder:"Enter your academic email address...",sendEmailBtn:"Sign In & Enter Exam",orDivider:"or sign in with email",loggingIn:"Signing in...",instantUnlock:"Instantly unlock the 1v1 examination arena after login",alreadyHaveAccount:"Have an account? Sign in"}}},Xne={common:{appName:"RadioShadow AI",tagline:"AI 实时全球播客与听力跟读私教",version:"PRO v2.5",loading:"加载中...",save:"保存",cancel:"取消",close:"关闭",confirm:"确认",delete:"删除",clear:"清空",copied:"已复制!",copy:"复制",pro:"PRO",free:"免费版",upgradeToPro:"升级到 PRO",signIn:"登录",signOut:"退出登录",userDashboard:"个人学习中心",membership:"会员状态",proUnlimited:"PRO 无限会员",freePreview:"免费试用版",customerSupport:"客户支持与帮助",termsAndPrivacy:"条款与隐私政策",search:"搜索",reset:"重置",all:"全部",back:"返回",next:"下一步",done:"完成",open:"打开",download:"下载",copiedToast:"已复制到剪贴板",switchTheme:"切换深色 / 浅色模式"},header:{articles:"博客文章",articlesTitle:"阅读语言跟读技巧与学习指南",aiExaminer:"AI 考官",aiExaminerTitle:"开启 AI 口语考官 1v1 对决",embedWidget:"嵌入小组件",embedTitle:"将实时播客播放器嵌入到您的网站或 Notion",tour:"新手向导",tourTitle:"新用户功能互动指引",liveStream:"播客与听力",proCurated:"精选播客",language:"语言",switchLanguage:"切换语言",english:"English",chinese:"中文",userProfile:"个人主页",loginRequired:"请先登录账号",signIn:"登录",signOut:"退出登录"},app:{theaterMode:"影院模式",exploreMode:"探索地图",switchView:"切换视图",helpMeChoose:"✨ 智能选台",helpMeChooseSub:"不知道听什么?让 AI 两步快速为您匹配专属播客与听力频道",continuousShadowing:"连续长流跟读",singleSentenceMode:"单句精读跟读",single:"单句",continuous:"连续",liveStation:"实时播客",offlineFallback:"当前播客流离线,已自动切换至备用频道。",listeningLive:"正在收听实时播客与听力音频...",waitingAnnouncer:"正在等待主播发声。音乐与广告间歇已被自动过滤。",subtitleInitializing:"字幕流正在初始化...",clickToPractice:"点击上方任意字幕句子即可开始跟读练习",holdToSpeak:"按住录音",releaseToEvaluate:"松开智能评测",evaluating:"AI 正在评测发音...",recording:"正在录音...",pressAndHoldMic:"按住麦克风按钮开始录制您的跟读发音。",selectSentenceFirst:"选择一个句子开始练习。",saveToNotebook:"收藏句子",savedToNotebook:"已收藏",bookmarkPhrase:"收藏当前句子",removeBookmark:"取消收藏",practicePronunciation:"练习此句发音",clearTranscripts:"清空",copyTranscript:"复制",downloadTranscript:"下载",copiedTranscript:"已复制!",autoScroll:"自动滚动",scrollLocked:"已锁定滚动",speechEvaluationResult:"发音评测诊断报告",overallBand:"口语流利度评级",pronunciationScore:"发音与语调",fluencyScore:"流利度与节奏",vocabularyScore:"词汇对齐度",accuracyScore:"发音准确度",aiFeedback:"💡 教练建议:",coachAdvice:"💡 教练建议:",targetSentence:"播客音频原句",yourSpeech:"您的实际录音转写",noSentenceSelected:"等待选择跟读原句",noSentenceDesc:"从左侧实时字幕流中点击任意句子,即可定格并开始单句发音练习。",continuousModeTitle:"连续跟读练习模式",continuousRecordingActive:"æ­£å
49œ¨å½•制您的连续语音(已进行 {seconds} 秒)。请跟随播客原声同步跟读!",continuousModeDesc:"无需暂停,长流同步跟读全球播客。AI 将智能对齐整段录音与原声文本,诊断薄弱发音并生成跟读笔记。",startContinuousSession:"开启连续跟读会话",elapsed:"已用时",target:"目标",mins:"分钟",finishAndAnalyze:"结束并分析",dictionaryFilter:"重点词库",dictBasic:"基础英语",dictIelts:"高阶母语表达 (C1)",dictBiz:"商务英语",dictDele:"西班牙语 DELE B2",viewModeStream:"实时播客与字幕",viewModeMap:"全球互动地图",viewModeCurated:"官方精选高分播客",liveAiInterpreter:"AI 实时播客同传翻译",liveInterpreterDesc:"全球实时播客瞬时 AI 转写与双语同传",liveDubbing:"AI 同传语音配音",liveDubbingShort:"AI 配音",liveDubbingDesc:"开启实时 AI 语音配音(PRO 专属功能)。在收听播客原声的同时收听同步翻译语音。",startLiveTranslation:"开启实时同传",stopTranslation:"停止同传",connectingTranslation:"正在连接...",selectStationFirst:"请先选择播客",liveAssistantActive:"AI 助手已激活至 {lang}",dualAudioDesc:"Gemini 正在伴随播客原声实时朗读同传译文。",textOnlyDesc:"Gemini 提供实时字幕转写与双语翻译,静音模式保持播客原声清晰以供跟读。",transcriptionFeedTitle:"实时播客字幕转写看板",transcriptionFeedDesc:"实时捕获并翻译的播客音频连续记录",capturedOriginal:"捕获的播客母语原声",geminiInterpretation:"GEMINI 实时双语同传",nativeStream:"播客原声",interpretedLabel:"同传译文 ({lang})",listeningFrequencies:"正在监听当前播客频段...",feedEmptyDesc:"捕获的语音字幕与实时同传将以双通道并排形式实时流入此面板。",curatedPractice:"精选练习",linesCount:"{count} 行",lines:"行",liveBroadcastTranscript:"实时播客字幕转写看板",cabin:"精选仓",cabinBtn:"精选仓",map:"地图",mapBtn:"地图",stations:"推荐播客:",stationsBarLabel:"推荐播客:",newSentencesResume:"🟢 {count} 条新句子 · [恢复实时 ⬇]",resumeLive:"条新句子 · [恢复实时 ⬇]",continuousMode:"连续跟读模式",startContinuous:"开启连续跟读",waitingTargetSentence:"等待选择跟读原句",clickSentenceToShadow:"从左侧实时字幕流中点击任意句子,即可定格并开始单句发音练习。",selectSentencePrompt:"点击左侧字幕句子开启跟读评测",bookmarked:"已保存",bookmark:"收藏句子",aiEvaluating:"AI 正在评测发音...",pressAndHoldPrompt:"说话时按住麦克风按钮,说完松开即可。",listenOriginalAudio:"收听原句标准原声",resetEvaluation:"重置当前评测",estimatedBand:"预估流利度等级",rightsReserved:"© 2026 Global Podcasts & Listening Practice SaaS. All rights reserved.",termsOfService:"服务条款",privacyPolicy:"隐私政策"},hud:{title:"连续跟读练习会话",recordingActive:"AI 语音录制已启动",targetDuration:"目标时长",remainingTime:"剩余时间",sentencesCaptured:"已捕获句子",micSignal:"麦克风信号",pause:"暂停",resume:"ç»§ç»­",finish:"完成并生成 AI 诊断报告",cancel:"取消会话",speakingGuide:"请跟随播客音频大声开口跟读...",min3:"3 分钟",min5:"5 分钟",min10:"10 分钟",min30:"30 分钟",statusListening:"实时接收并录音中",statusPaused:"录音已暂停",statusAnalyzing:"正在分析音频对齐...",setupTitle:"连续跟读会话设置",setupSubtitle:"设置长流不间断跟读的目标练习时长",selectDuration:"选择练习时长",startPractice:"开启连续跟读练习",proFeatureNotice:"PRO 专属特权 • 实时长音频对齐与诊断"},report:{modalTitle:"AI 连续跟读会话诊断报告",sessionDuration:"练习总时长",sentencesShadowed:"跟读句子数",estimatedBand:"预估口语流利度等级",acousticRadar:"五维声学雷达分析",coachSummary:"AI 教ç
49»ƒç»¼åˆè¯„ä»·",weakPhonemes:"薄弱音素与易错词汇",breakdown:"逐句发音对齐详情",nativeBroadcast:"播客母语原声",yourTranscript:"您的录音实际转写",saveWord:"收藏生词",exportPdf:"导出诊断报告 (PDF / 图片)",backToRadio:"返回播客与听力",noData:"暂无可用的声学评测数据。",viewNotebook:"在个人中心打开跟读笔记",accuracy:"准确度",fluency:"流利度",pronunciation:"发音与语调",speed:"语速匹配",intonation:"声调起伏",excellent:"优秀",good:"良好",needsWork:"待加强",playRecording:"播放录音",pauseRecording:"暂停播放"},player:{connecting:"正在连接播客直播流...",playing:"正在播放实时播客",paused:"已暂停",streamError:"流连接异常,正在尝试备用服务器...",mute:"静音",unmute:"取消静音",directUrl:"直接播放源地址",bitrate:"比特率",codec:"编码格式",volume:"音量",practiceFrozenTip:"字幕已定格以供跟读练习。点击“恢复实时”或播放按钮以同步最新流。",resumeLiveStream:"恢复实时",selectAStation:"请选择播客或电台开始播放"},stations:{searchPlaceholder:"搜索 40,000+ 全球播客与电台 (名称, 城市, 流派)...",allLanguages:"所有语言",allAccents:"所有口音",allGenres:"所有流派",sortBy:"排序方式",topVoted:"最高好评",mostPopular:"最受欢迎",highestBitrate:"最高音质",noStationsFound:"未找到符合筛选条件的播客或电台",noStationsHelp:"建议检查拼写、清除标签筛选,或点击世界地图上的其他国家与地区。",resetFilters:"重置筛选",activeStations:"个频道在线",listenNow:"立即收听",changeStation:"切换频道",scanningAirwaves:"正在扫描区域播客频段...",regionalStreams:"区域播客与听力音频",featuredGlobal:"精选全球播客与音频",connectingFrequencies:"正在连接本地播客频段...",filteredByTag:"按 #{tag} 筛选中 (清除)",nowPlaying:"当前播放:{name}",tuneInto:"切换到 {name}",regionalBroadcast:"区域播客流"},worldMap:{loading:"正在加载动态地理投影...",activeStationsCount:"{count} 个在线频道",guide:"点击地图上的国家或地区,探索当地母语播客与听力音频"},proCabin:{title:"官方精选学习仓",subtitle:"精选官方推荐语料,离线跟读强化纯正发音",proUnlocked:"PRO 已解锁",freeTierNotice:"首条免费体验 · PRO 解锁全部语料",filterPassages:"筛选语料",resetFilters:"重置筛选",language:"语种",difficulty:"难度等级",vocabCoverage:"词汇覆盖",sophistication:"表达深度 / 词汇阶",allLanguages:"所有语言",allLevels:"所有级别",allVocabDensity:"所有词汇密度",allSophistication:"所有表达阶",beginner:"初级入门",intermediate:"中级进阶",advanced:"高级母语",highVocab:"高密度 (80%+)",mediumVocab:"中密度 (50%+)",standardVocab:"标准通用",noPassagesMatch:"未找到符合当前筛选条件的语料切片。",proMemberPassage:"PRO 会员专属语料",unlockPassages:"解锁全部语料",shadowThisPassage:"跟读此条语料",vocabDensityLabel:"词汇密度:"},cabin:{title:"官方精选学习仓",streamBadge:"AI 精选播客流",subtitle:"选择精选播客切片,离线跟读并强化发音。",filterPassages:"已筛选 {count} 条语料",resetFilters:"重置筛选",language:"语种",allLanguages:"所有语言",difficultyLevel:"难度等级",allLevels:"所有级别",vocabDensity:"词汇密度",allDensity:"所有密度",bandSophistication:"表达深度 / 词汇阶",allSophistication:"所有表达阶",practiceShadowing:"跟读此条语料",curatorNote:"教研团队导读:",unlockSnippets:"解锁全部精选语料",unlockDesc:"升级为 PRO 无限会员,解锁每日精选播客切片与专属生词本。"},helpDrawer:{title:"找到最适合您的跟读播客",step1Title:"第 1 步:选择您的目标语言",step2Title:"第 2 步:选择偏好口音与播音风格",step3Title:"第 3 步:为您量身匹配的精选播客",genreNews:"时事新闻 (用词规范,国际政治与深度报道)",genreTalk:"轻松脱口秀 (自然访谈,生活幽默与口语连读)",genreSports:"激情体育解说 (高语速高能量,激情实况)",genreMusic:"流行音乐电台 (金曲榜单与活力 DJ 互动)",genreChill:"治愈慢节奏 (轻柔原声,舒缓低压力)",matchScore:"AI 匹配指数",recommendationReason:"跟读推荐理由",startShadowing:"开始跟读此频道",selectDialect:"选择口音与方言",selectVibe:"选择播客风格与语速",backToStep1:"重选语言",backToStep2:"重选风格",matchingStations:"为您精准匹配的播客频道",allDialects:"所有口音"},drawer:{title:"找到最适合您的跟读播客",liveWizard:"智能匹配向导",step1Desc:"选择目标语言,训练纯正母语发音与听力反射。",step2Desc:"挑选目标地域口音、播音节奏与风格偏好。",step3Desc:"AI 为您匹配最适合跟读的高清旗舰播客。",languageQuestion:"您想突破哪门语言的口语与听力?",languageSubtitle:"覆盖全球 100+ 种母语广播与播客频道。",languageLabel:"目标语言",change:"修改",targetAccent:"目标口音与方言",vibeQuestion:"您喜欢哪种播音语速与氛围?",vibeSubtitle:"选择节奏紧凑的新闻、深度访谈或轻松日常对话。",changeVibe:"修改风格",aiMatchInsight:"AI 匹配洞察",analyzingAcoustic:"正在分析 {lang}
49 的实时音频声学特征...",filterAccent:"按口音筛选",curatedFlagship:"旗舰权威播客",highClarityStream:"超低延迟高清音频流",enteringTheater:"正在进入影院跟读模式...",shadowThisRadio:"跟读此播客",globalRadioPool:"全球播客资源库",refresh:"刷新",searchPrompt:"搜索",connectingGlobal:"正在连接全球播客流",shadowAction:"跟读",noAdditionalStations:"该口音下暂无更多备用播客频道。",theaterTip:"💡 提示:在影院模式下点击任意字幕即可定格句子并评测发音。",syncTip:"💡 提示:RadioShadow 会自动将实时播客与字幕缓冲保存在内存中。"},dashboard:{title:"个人学习中心",profileAndPlan:"个人资料与会员计划",shadowingNotebook:"跟读生词本 (PRO)",savedSentences:"已收藏例句",speechHistory:"发音评测历史",proMember:"PRO 无限会员",freePlan:"免费体验版",notebookDesc:"连续跟读语音对齐与声学诊断笔记",savedDesc:"收藏的播客原声例句与词汇",historyDesc:"单句发音打分与教练建议记录",noNotebooks:"暂无连续跟读笔记",noSaved:"暂无收藏例句",noHistory:"暂无单句评测记录",viewDiagnosis:"查看完整诊断报告",practiceSentence:"重新练习此句",deleteRecord:"删除记录",deleteBookmark:"取消收藏",backToLive:"返回实时播客",accountEmail:"绑定邮箱",membershipStatus:"会员状态",activePlan:"当前计划",expiresOn:"到期时间",upgradeCta:"升级到 PRO 无限会员",notebookEntries:"篇跟读笔记",totalPracticeTime:"累计跟读时长",averageBand:"平均流利度等级",examinerHistory:"纯正口语对练记录",examinerDesc:"1v1 考官对战、能力成长曲线与官方认证证书",noExaminerHistory:"暂无 1v1 口语对练记录",noExaminerDesc:"与资深 AI 口语教练完成一次 1v1 对战,即可在此解锁 CEFR 等级追踪、声学发音分析与官方认证证书下载。",startExaminerCta:"开启 1v1 口语实战",oralExamScore:"口语对决得分",totalOralSessions:"已完成场次",peakBand:"最高评级",latestBand:"最新评级",exportCertificate:"下载认证证书",viewExamReport:"查看模考报告",fluency:"流利度与连贯性",lexical:"词汇多样性",grammar:"语法广度与准确度",pronunciation:"发音与声学语调"},onboarding:{welcome:"欢迎使用 RadioShadow AI",quickTour:"新手向导",step1Badge:"第 1 步 (共 4 步) • 全球播客与听力",step1Title:"收听全球原生播客,掌握地道口语",step1Desc:"RadioShadow 直连 100+ 国家与地区的 10,000+ 真实播客与听力音频。用原汁原味的口音与对话锻炼您的听力感知。",step1Card1Title:"覆盖 100+ 国家",step1Card1Desc:"收听 BBC、France Info、Cadena SER、NHK 等权威媒体与地道本地播客。",step1Card2Title:"零延迟播客流",step1Card2Desc:"实时播客流播放,暂停时历
49史字幕缓冲永不丢失。",step2Badge:"第 2 æ­¥ (共 4 æ­¥) • AI 双语字幕与同传配音",step2Title:"实时同步双语字幕与 AI 同声传译",step2Desc:"毫秒级 AI 语音转写引擎实时捕捉主播原声,并排呈现双语对照字幕与重点词汇高亮。",step2LiveBadge:"实时双语字幕",step2TagBadge:"高频母语表达高亮",step2VoiceDub:"支持实时 AI 语音配音朗读 (PRO)",step3Badge:"第 3 æ­¥ (共 4 æ­¥) • 沉浸式跟读练习",step3Title:"跟随母语原声同步发声跟读",step3Desc:"可选择单句精读定格练习,或开启长流连续跟读模式(Continuous Shadowing)进行深度沉浸。",step3EstBand:"预估口语流利度等级",step3Fluency:"流利度匹配",step3Phonetic:"五维声学雷达",step3AiCoaching:"AI 私教:",step3AiAdvice:"注意核心关键词的连读弱读与音调起伏。",step4Badge:"第 4 æ­¥ (共 4 æ­¥) • AI 声学诊断报告",step4Title:"获取即时发音诊断与 CEFR 流利度评级",step4Desc:"获得五维声学雷达图、易错音素诊断以及针对性的母语发音纠偏建议。",step4ExploreMap:"探索全球互动地图",step4BrowsePro:"浏览每日精选语料",step4BbcService:"立即播放 BBC World Service",nextStep:"下一步",getStarted:"明白,立即开始练习!",skip:"跳过新手教程",skipGuide:"跳过向导",back:"上一步",next:"下一步",finishAndStart:"立即开始使用",launchBbc:"立即播放 BBC World Service",exploreMap:"探索全球地图"},paywall:{title:"解锁 PRO 无限会员",bannerBadge:"VIP 通行证 • 无限畅享",vipPass:"VIP 通行证 • 无限畅享",subtitle:"畅享实时 AI 双语字幕、连续长流跟读声学诊断报告与官方每日精选语料库,全面加速口语听力进阶。",wordsCaught:"已掌握高阶表达",shadowingsDone:"累计跟读句子",globalStationsCount:"全球播客频道",globalStations:"全球播客频道",price:"低至 $6.66/月",signInToUpgrade:"登录以升级 PRO 会员",verifying:"正在向服务器校验订阅状态...",guarantee:"30 天无理由退款保障 • 安全加密支付",instantActivation:"⚡ 购买后立即自动激活 • 支持在 PayPal 随时管理取消",needHelp:"支付遇到问题?请联系 [email protected]",termsConsent:"完成支付即代表您同意我们的服务条款与隐私政策。",notNow:"暂不升级,返回应用",perk1Title:"无限次 AI 实时同传 (50+ 语言)",perk1Desc:"无每日时长限制,瞬时双语字幕转写与永久字幕缓冲。",perk2Title:"全球多语种实时字幕",perk2Desc:"超高精度母语转写,与目标语言逐句双语对照对齐。",perk3Title:"连续长流跟读与五维声学雷达",perk3Desc:"支持长达 10 分钟的长音频跟读对齐与 CEFR 口语能力诊断。",perk4Title:"C1 高阶表达词库与每日精选语料包",perk4Desc:"学术及母语高频词匹配,结合每日精选高分语料库沉浸强化。"},footer:{copyright:"© 2026 Global Podcasts & Listening Practice SaaS. All rights reserved.",terms:"服务条款",privacy:"隐私政策",rightsReserved:"© 2026 Global Podcasts & Listening Practice SaaS. All rights reserved.",termsOfService:"服务条款",privacyPolicy:"隐私政策"},support:{title:"客户支持与帮助",guarantee:"承诺 24 小时内快速响应",bubbleText:"客服与帮助",needHelpPayment:"支付或功能遇到问题?",copyEmail:"复制邮箱",copied:"已复制!",selectTopic:"选择咨询主题",topicPayment:"支付与订阅相关",topicAudio:"播客流播放或音频问题",topicGeneral:"综合建议与功能反馈",openEmail:"发送邮件至 {email}",supportBtn:"客服支持"},embed:{title:"嵌入播客播放组件",desc:"将实时播客播放器嵌入到您的博客、文档或 Notion 知识库中。",selectStation:"选择播客频道",themeStyle:"主题风格",light:"明亮",dark:"暗黑",preview:"实时预览",copyHtml:"复制 HTML 嵌入代码",copyUrl:"复制嵌入 URL",practiceShadowing:"开始跟读练习"},legal:{termsTitle:"服务条款",privacyTitle:"隐私政策",acceptance:"条款的确认与接纳",description:"服务内容说明",accounts:"用户账户与 PRO 订阅说明",aiProcessing:"AI 语音处理与数据隐私",ip:"知识产权保护",liability:"免责声明与责任限制",compliance:"全站采用加密传输,严格遵守 GDPR 与 CCPA",agree:"我已阅读并同意上述条款"},examiner:{badge:"1v1 纯正对战模式",title:"AI 口语教练",tagline:"基于真实播客原声的 1v1 语音对练",description:"针对播客时事新闻,与资深母语考官进行 3 阶进阶辩论,生成 CEFR 深度诊断报告。",groundedInSegment:"基于实时播客切片",launchExam:"开启口语对练",ieltsCefrBadge:"播客口语对练 / CEFR C1",speakingGuidance:"AI 口语对练",proBadge:"PRO",closeTitle:"关闭对练考场",examinerDoctorName:"Dr. Arthur Sterling",examinerRole:"资深语言学专家 & CEFR 评测教练",examinerStatusOnline:"在线 • 随时可以开始对练",hoverToExpand:"悬停展开 • 点击开启",sidebarBadge:"口语教练",startDebateCta:"开启 1v1 对练",peekTitle:"AI 口语对练",liveStation:"当前频道:{station}",modeLabel:"模式:",holdSpacebar:"按住空格说话",clickToRecord:"点击麦克风录音",rounds:{round1Title:"事实复述与信息综合",round1Short:"1. ä
49º‹å®žå¤è¿°",round1Objective:"概括并综合播客报道中的核心事实与矛盾焦点。",round2Title:"批判性反驳与论点交锋",round2Short:"2. 反驳交锋",round2Objective:"针对考官的尖锐反驳进行回应,权衡各方利益与代价。",round3Title:"抽象迁移与深度延伸",round3Short:"3. 抽象迁移",round3Objective:"将话题延伸至个人经历或宏观社会发展与伦理层面。"},ready:{heading:"准备好开启 1v1 纯正口语实战对练了吗?",subheading:"区别于无意义的闲聊,本考场针对真实播客新闻,从事实复述、反驳辩论到抽象延伸 3 阶维度全面考察您的口语深度。",selectSource:"选择对练语料来源:",liveBroadcastFrom:"当前播放中的播客:{station}",liveOnAir:"正在播放",officialCuratedTitle:"官方标准 C1 播客语料切片 (经济、气候与 AI 伦理)",officialCuratedDesc:"精选来自 BBC World Service、NPR、France Info、Deutschlandfunk 等权威媒体的标准新闻切片。",beginExam:"开始 3 阶口语对决"},arena:{showExcerpt:"展开原文切片",hideExcerpt:"收起",keyVocabulary:"核心高阶词汇:",seniorExaminer:"资深考官",speakingAloud:"正在发声提问...",turnQuestion:"本轮考察问题",pauseVoice:"暂停语音",replay:"重播考官提问",synthesizingInquiry:"考官正在构思后续进阶提问...",thoughtPhase1:"考官正在解析播客原声切片与矛盾焦点...",thoughtPhase2:"考官正在评估论点前提与反方视角...",thoughtPhase3:"考官正在生成 C1 级深度辩论问题...",prepTimeTitle:"战略性思考准备时间",prepCountdown:"思考倒计时:{seconds} 秒",skipPrep:"已准备好,立即作答",audioReady:"考官原声音频已就绪",audioBuffering:"正在后台同步考官语音音频...",scoringTip:"评分要点提示:",holdSpaceToSpeak:"按住空格键开始作答",clickMicToStart:"点击麦克风开始作答",recordingAnswer:"正在录制作答语音...",transcribingResponse:"正在转写您的语音内容...",analyzingCefr:"正在分析 CEFR 声学与语法指标...",pressHoldSpace:"按住 [空格键] 说话",clickToSpeak:"点击麦克风说话",captured:"已捕获回答:",completedRounds:"已完成轮次:"},report:{certBadge:"口语水平认证证书",certTitle:"CEFR 语言能力认证报告",certId:"证书编号",topic:"考核主题",overallBand:"综合评级",radarTitle:"声学与语言平衡度 (五维雷达)",candidateScore:"考生得分",metrics:{fluencyAndCoherence:"流利度与连贯性",fluencyAndCoherenceSub:"逻辑连接词与语音停顿连贯度",lexicalResource:"词汇多样性与精准度",lexicalResourceSub:"C1 学术词汇使用与习语搭配",grammaticalAccuracy:"语法多样性与准确性",grammaticalAccuracySub:"复杂句型结构与情态动词应用",pronunciationAcoustic:"发音与声学语调",pronunciationAcousticSub:"语调起伏、重音与自然连读"},examinerSummary:"考官官方综合评定:",grammarTitle:"语法微创手术式纠偏:",rule:"语法规则:",correction:"母语级优化建议:",vocabTitle:"高分 C1 进阶词汇替换建议:",debateAnother:"开启新主题对战",unlockPro:"解锁无限次模考对战 (PRO)",downloadCert:"导出官方认证证书 (PNG)",downloadingCert:"正在生成高清存档证书...",downloadSuccess:"证书已成功保存!",quotaNotice:"设备体验额度:剩余 {remaining} 次免费对练",quotaReachedTitle:"本设备免费体验额度已用尽",quotaReachedDesc:"本台设备已完成 1 次 1v1 口语对练体验。免费额度与当前物理设备绑定(切换账号无法重置)。升级为 PRO 无限会员,即可畅享无限次 1v1 考官实战、深度声学诊断与官方认证证书导出。",deviceBindingNotice:"免费体验次数与物理设备硬件绑定,以防止刷号滥用。",upgradeToUnlockCert:"官方高清认证证书为 PRO 会员专属特权,升级即可下载。",proExclusiveExport:"PRO 会员专属导出",savedToDashboard:"已自动保存至个人学习中心",viewInDashboard:"在个人中心查看完整历史"},authRequired:{badge:"成绩存档与认证",title:"登录以开启 1v1 纯正口语对练",subtitle:"1v1 AI 口语教练将评定官方 CEFR 流利度等级、生成权威认证证书,并将您的声学诊断报告永久存档至个人学习中心。",guestNotice:"当前处于访客模式。登录后即可保存您的对练成绩与诊断报告。",loginRequiredBadge:"需登录开启",loginToUnlock:"登录并开启对练",benefit1Title:"个人成长与成绩永久存档",benefit1Desc:"永久记录所有 1v1 模考的综合等级、各项分值与五维声学雷达图。",benefit2Title:"逐轮复盘与母语级优化",benefit2Desc:"支持 3 轮对答完整文字回放,考官逐句提供地道母语重构与提分方案。",benefit3Title:"官方 CEFR 权威认证凭证",benefit3Desc:"生成具备唯一防伪编号与考官签名的官方学术能力报告卡。",signInWithGoogle:"使用 Google 账号继续",signInWithEmail:"快捷邮箱登录",emailPlaceholder:"输入您的常用邮箱地址...",sendEmailBtn:"登录并进入考场",orDivider:"或使用邮箱快速登录",loggingIn:"正在登录...",instantUnlock:"登录后立即解锁 1v1 专属对练考场",alreadyHaveAccount:"已有账号?直接登录"}}},m$=S.createContext(void 0),UM="radioshadow_lang";function Zne({children:n}){const[e,t]=S.useState(()=>{if(typeof window<"u"){const o=localStorage.getItem(UM);if(o==="en"||o==="zh-CN")return o;if((navigator.language||navigator.userLanguage||"").toLowerCase().startsWith("zh"))return"zh-CN"}return"en"});S.useEffect(()=>{try{localStorage.setItem(UM,e),document.documentElement.lang=e}catch(o){console.warn("Could not save language preference:",o)}},[e]);const r=o=>{t(o)},s=()=>{t(o=>o==="en"?"zh-CN":"en")},a=e==="zh-CN"?Xne:Jne;return i.jsx(m$.Provider,{value:{language:e,setLanguage:r,toggleLanguage:s,t:a,isZh:e==="zh-CN"},children:n})}function Or(){const n=S.useContext(m$);if(!n)throw new Error("useLanguage must be used within a LanguageProvider");return n}/**
50 * @license
51 * Copyright 2025 Google LLC
52 *
53 * Licensed under the Apache License, Version 2.0 (the "License");
54 * you may not use this file except in compliance with the License.
55 * You may obtain a copy of the License at
56 *
57 *   http://www.apache.org/licenses/LICENSE-2.0
58 *
59 * Unless required by applicable law or agreed to in writing, software
60 * distributed under the License is distributed on an "AS IS" BASIS,
61 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
62 * See the License for the specific language governing permissions and
63 * limitations under the License.
64 */const ere=()=>{};var VM={};/**
65 * @license
66 * Copyright 2017 Google LLC
67 *
68 * Licensed under the Apache License, Version 2.0 (the "License");
69 * you may not use this file except in compliance with the License.
70 * You may obtain a copy of the License at
71 *
72 *   http://www.apache.org/licenses/LICENSE-2.0
73 *
74 * Unless required by applicable law or agreed to in writing, software
75 * distributed under the License is distributed on an "AS IS" BASIS,
76 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
77 * See the License for the specific language governing permissions and
78 * limitations under the License.
79 */const p$=function(n){const e=[];let t=0;for(let r=0;r<n.length;r++){let s=n.charCodeAt(r);s<128?e[t++]=s:s<2048?(e[t++]=s>>6|192,e[t++]=s&63|128):(s&64512)===55296&&r+1<n.length&&(n.charCodeAt(r+1)&64512)===56320?(s=65536+((s&1023)<<10)+(n.charCodeAt(++r)&1023),e[t++]=s>>18|240,e[t++]=s>>12&63|128,e[t++]=s>>6&63|128,e[t++]=s&63|128):(e[t++]=s>>12|224,e[t++]=s>>6&63|128,e[t++]=s&63|128)}return e},tre=function(n){const e=[];let t=0,r=0;for(;t<n.length;){const s=n[t++];if(s<128)e[r++]=String.fromCharCode(s);else if(s>191&&s<224){const a=n[t++];e[r++]=String.fromCharCode((s&31)<<6|a&63)}else if(s>239&&s<365){const a=n[t++],o=n[t++],l=n[t++],c=((s&7)<<18|(a&63)<<12|(o&63)<<6|l&63)-65536;e[r++]=String.fromCharCode(55296+(c>>10)),e[r++]=String.fromCharCode(56320+(c&1023))}else{const a=n[t++],o=n[t++];e[r++]=String.fromCharCode((s&15)<<12|(a&63)<<6|o&63)}}return e.join("")},g$={byteToCharMap_:null,charToByteMap_:null,byteToCharMapWebSafe_:null,charToByteMapWebSafe_:null,ENCODED_VALS_BASE:"ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",get ENCODED_VALS(){return this.ENCODED_VALS_BASE+"+/="},get ENCODED_VALS_WEBSAFE(){return this.ENCODED_VALS_BASE+"-_."},HAS_NATIVE_SUPPORT:typeof atob=="function",encodeByteArray(n,e){if(!Array.isArray(n))throw Error("encodeByteArray takes an array as a parameter");this.init_();const t=e?this.byteToCharMapWebSafe_:this.byteToCharMap_,r=[];for(let s=0;s<n.length;s+=3){const a=n[s],o=s+1<n.length,l=o?n[s+1]:0,c=s+2<n.length,d=c?n[s+2]:0,h=a>>2,m=(a&3)<<4|l>>4;let p=(l&15)<<2|d>>6,x=d&63;c||(x=64,o||(p=64)),r.push(t[h],t[m],t[p],t[x])}return r.join("")},encodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?btoa(n):this.encodeByteArray(p$(n),e)},decodeString(n,e){return this.HAS_NATIVE_SUPPORT&&!e?atob(n):tre(this.decodeStringToByteArray(n,e))},decodeStringToByteArray(n,e){this.init_();const t=e?this.charToByteMapWebSafe_:this.charToByteMap_,r=[];for(let s=0;s<n.length;){const a=t[n.charAt(s++)],l=s<n.length?t[n.charAt(s)]:0;++s;const d=s<n.length?t[n.charAt(s)]:64;++s;const m=s<n.length?t[n.charAt(s)]:64;if(++s,a==null||l==null||d==null||m==null)throw new nre;const p=a<<2|l>>4;if(r.push(p),d!==64){const x=l<<4&240|d>>2;if(r.push(x),m!==64){const y=d<<6&192|m;r.push(y)}}}return r},init_(){if(!this.byteToCharMap_){this.byteToCharMap_={},this.charToByteMap_={},this.byteToCharMapWebSafe_={},this.charToByteMapWebSafe_={};for(let n=0;n<this.ENCODED_VALS.length;n++)this.byteToCharMap_[n]=this.ENCODED_VALS.charAt(n),this.charToByteMap_[this.byteToCharMap_[n]]=n,this.byteToCharMapWebSafe_[n]=this.ENCODED_VALS_WEBSAFE.charAt(n),this.charToByteMapWebSafe_[this.byteToCharMapWebSafe_[n]]=n,n>=this.ENCODED_VALS_BASE.length&&(this.charToByteMap_[this.ENCODED_VALS_WEBSAFE.charAt(n)]=n,this.charToByteMapWebSafe_[this.ENCODED_VALS.charAt(n)]=n)}}};class nre extends Error{constructor(){super(...arguments),this.name="DecodeBase64StringError"}}const rre=function(n){const e=p$(n);return g$.encodeByteArray(e,!0)},LC=function(n){return rre(n).replace(/\./g,"")},x$=function(n){try{return g$.decodeString(n,!0)}catch(e){console.error("base64Decode failed: ",e)}return null};/**
80 * @license
81 * Copyright 2022 Google LLC
82 *
83 * Licensed under the Apache License, Version 2.0 (the "License");
84 * you may not use this file except in compliance with the License.
85 * You may obtain a copy of the License at
86 *
87 *   http://www.apache.org/licenses/LICENSE-2.0
88 *
89 * Unless required by applicable law or agreed to in writing, software
90 * distributed under the License is distributed on an "AS IS" BASIS,
91 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
92 * See the License for the specific language governing permissions and
93 * limitations under the License.
94 */function b$(){if(typeof self<"u")return self;if(typeof window<"u")return window;if(typeof global<"u")return global;throw new Error("Unable to locate global object.")}/**
95 * @license
96 * Copyright 2022 Google LLC
97 *
98 * Licensed under the Apache License, Version 2.0 (the "License");
99 * you may not use this file except in compliance with the License.
100 * You may obtain a copy of the License at
101 *
102 *   http://www.apache.org/licenses/LICENSE-2.0
103 *
104 * Unless required by applicable law or agreed to in writing, software
105 * distributed under the License is distributed on an "AS IS" BASIS,
106 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
107 * See the License for the specific language governing permissions and
108 * limitations under the License.
109 */const sre=()=>b$().__FIREBASE_DEFAULTS__,are=()=>{if(typeof process>"u"||typeof VM>"u")return;const n=VM.__FIREBASE_DEFAULTS__;if(n)return JSON.parse(n)},ire=()=>{if(typeof document>"u")return;let n;try{n=document.cookie.match(/__FIREBASE_DEFAULTS__=([^;]+)/)}catch{return}const e=n&&x$(n[1]);return e&&JSON.parse(e)},C1=()=>{try{return ere()||sre()||are()||ire()}catch(n){console.info(`Unable to get __FIREBASE_DEFAULTS__ due to: ${n}`);return}},y$=n=>{var e,t;return(t=(e=C1())==null?void 0:e.emulatorHosts)==null?void 0:t[n]},ore=n=>{const e=y$(n);if(!e)return;const t=e.lastIndexOf(":");if(t<=0||t+1===e.length)throw new Error(`Invalid host ${e} with no separate hostname and port!`);const r=parseInt(e.substring(t+1),10);return e[0]==="["?[e.substring(1,t-1),r]:[e.substring(0,t),r]},v$=()=>{var n;return(n=C1())==null?void 0:n.config},B$=n=>{var e;return(e=C1())==null?void 0:e[`_${n}`]};/**
110 * @license
111 * Copyright 2017 Google LLC
112 *
113 * Licensed under the Apache License, Version 2.0 (the "License");
114 * you may not use this file except in compliance with the License.
115 * You may obtain a copy of the License at
116 *
117 *   http://www.apache.org/licenses/LICENSE-2.0
118 *
119 * Unless required by applicable law or agreed to in writing, software
120 * distributed under the License is distributed on an "AS IS" BASIS,
121 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
122 * See the License for the specific language governing permissions and
123 * limitations under the License.
124 */class w${constructor(){this.reject=()=>{},this.resolve=()=>{},this.promise=new Promise((e,t)=>{this.resolve=e,this.reject=t})}wrapCallback(e){return(t,r)=>{t?this.reject(t):this.resolve(r),typeof e=="function"&&(this.promise.catch(()=>{}),e.length===1?e(t):e(t,r))}}}/**
125 * @license
126 * Copyright 2021 Google LLC
127 *
128 * Licensed under the Apache License, Version 2.0 (the "License");
129 * you may not use this file except in compliance with the License.
130 * You may obtain a copy of the License at
131 *
132 *   http://www.apache.org/licenses/LICENSE-2.0
133 *
134 * Unless required by applicable law or agreed to in writing, software
135 * distributed under the License is distributed on an "AS IS" BASIS,
136 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
137 * See the License for the specific language governing permissions and
138 * limitations under the License.
139 */function lre(n,e){if(n.uid)throw new Error('The "uid" field is no longer supported by mockUserToken. Please use "sub" instead for Firebase Auth User ID.');const t={alg:"none",type:"JWT"},r=e||"demo-project",s=n.iat||0,a=n.sub||n.user_id;if(!a)throw new Error("mockUserToken must contain 'sub' or 'user_id' field!");const o={iss:`https://securetoken.google.com/${r}`,aud:r,iat:s,exp:s+3600,auth_time:s,sub:a,user_id:a,firebase:{sign_in_provider:"custom",identities:{}},...n};return[LC(JSON.stringify(t)),LC(JSON.stringify(o)),""].join(".")}/**
140 * @license
141 * Copyright 2017 Google LLC
142 *
143 * Licensed under the Apache License, Version 2.0 (the "License");
144 * you may not use this file except in compliance with the License.
145 * You may obtain a copy of the License at
146 *
147 *   http://www.apache.org/licenses/LICENSE-2.0
148 *
149 * Unless required by applicable law or agreed to in writing, software
150 * distributed under the License is distributed on an "AS IS" BASIS,
151 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
152 * See the License for the specific language governing permissions and
153 * limitations under the License.
154 */function Js(){return typeof navigator<"u"&&typeof navigator.userAgent=="string"?navigator.userAgent:""}function cre(){return typeof window<"u"&&!!(window.cordova||window.phonegap||window.PhoneGap)&&/ios|iphone|ipod|ipad|android|blackberry|iemobile/i.test(Js())}function C$(){var e;const n=(e=C1())==null?void 0:e.forceEnvironment;if(n==="node")return!0;if(n==="browser")return!1;try{return Object.prototype.toString.call(global.process)==="[object process]"}catch{return!1}}function dre(){return typeof navigator<"u"&&navigator.userAgent==="Cloudflare-Workers"}function ure(){const n=typeof chrome=="object"?chrome.runtime:typeof browser=="object"?browser.runtime:void 0;return typeof n=="object"&&n.id!==void 0}function hre(){return typeof navigator=="object"&&navigator.product==="ReactNative"}function fre(){const n=Js();return n.indexOf("MSIE ")>=0||n.indexOf("Trident/")>=0}function E$(){return!C$()&&!!navigator.userAgent&&navigator.userAgent.includes("Safari")&&!navigator.userAgent.includes("Chrome")}function S$(){return!C$()&&!!navigator.userAgent&&(navigator.userAgent.includes("Safari")||navigator.userAgent.includes("WebKit"))&&!navigator.userAgent.includes("Chrome")}function T$(){try{return typeof indexedDB=="object"}catch{return!1}}function mre(){return new Promise((n,e)=>{try{let t=!0;const r="validate-browser-context-for-indexeddb-analytics-module",s=self.indexedDB.open(r);s.onsuccess=()=>{s.result.close(),t||self.indexedDB.deleteDatabase(r),n(!0)},s.onupgradeneeded=()=>{t=!1},s.onerror=()=>{var a;e(((a=s.error)==null?void 0:a.message)||"")}}catch(t){e(t)}})}/**
155 * @license
156 * Copyright 2017 Google LLC
157 *
158 * Licensed under the Apache License, Version 2.0 (the "License");
159 * you may not use this file except in compliance with the License.
160 * You may obtain a copy of the License at
161 *
162 *   http://www.apache.org/licenses/LICENSE-2.0
163 *
164 * Unless required by applicable law or agreed to in writing, software
165 * distributed under the License is distributed on an "AS IS" BASIS,
166 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
167 * See the License for the specific language governing permissions and
168 * limitations under the License.
169 */const pre="FirebaseError";class Zd extends Error{constructor(e,t,r){super(t),this.code=e,this.customData=r,this.name=pre,Object.setPrototypeOf(this,Zd.prototype),Error.captureStackTrace&&Error.captureStackTrace(this,Ky.prototype.create)}}class Ky{constructor(e,t,r){this.service=e,this.serviceName=t,this.errors=r}create(e,...t){const r=t[0]||{},s=`${this.service}/${e}`,a=this.errors[e],o=a?gre(a,r):"Error",l=`${this.serviceName}: ${o} (${s}).`;return new Zd(s,l,r)}}function gre(n,e){try{let t=0,r="";for(;t<n.length;){const s=n.indexOf("{$",t);if(s===-1){r+=n.substring(t);break}const a=n.indexOf("}",s+2);if(a===-1){r+=n.substring(t);break}const o=n.substring(s+2,a),l=e[o];r+=n.substring(t,s)+(l!=null?String(l):`<${o}?>`),t=a+1}return r}catch{return n}}function xre(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}function Gl(n,e){if(n===e)return!0;const t=Object.keys(n),r=Object.keys(e);for(const s of t){if(!r.includes(s))return!1;const a=n[s],o=e[s];if(GM(a)&&GM(o)){if(!Gl(a,o))return!1}else if(a!==o)return!1}for(const s of r)if(!t.includes(s))return!1;return!0}function GM(n){return n!==null&&typeof n=="object"}/**
170 * @license
171 * Copyright 2017 Google LLC
172 *
173 * Licensed under the Apache License, Version 2.0 (the "License");
174 * you may not use this file except in compliance with the License.
175 * You may obtain a copy of the License at
176 *
177 *   http://www.apache.org/licenses/LICENSE-2.0
178 *
179 * Unless required by applicable law or agreed to in writing, softw
179are
180 * distributed under the License is distributed on an "AS IS" BASIS,
181 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
182 * See the License for the specific language governing permissions and
183 * limitations under the License.
184 */function Wy(n){const e=[];for(const[t,r]of Object.entries(n))Array.isArray(r)?r.forEach(s=>{e.push(encodeURIComponent(t)+"="+encodeURIComponent(s))}):e.push(encodeURIComponent(t)+"="+encodeURIComponent(r));return e.length?"&"+e.join("&"):""}function yb(n){const e={};return n.replace(/^\?/,"").split("&").forEach(r=>{if(r){const[s,a]=r.split("=");e[decodeURIComponent(s)]=decodeURIComponent(a)}}),e}function vb(n){const e=n.indexOf("?");if(!e)return"";const t=n.indexOf("#",e);return n.substring(e,t>0?t:void 0)}function bre(n,e){const t=new yre(n,e);return t.subscribe.bind(t)}class yre{constructor(e,t){this.observers=[],this.unsubscribes=[],this.observerCount=0,this.task=Promise.resolve(),this.finalized=!1,this.onNoObservers=t,this.task.then(()=>{e(this)}).catch(r=>{this.error(r)})}next(e){this.forEachObserver(t=>{t.next(e)})}error(e){this.forEachObserver(t=>{t.error(e)}),this.close(e)}complete(){this.forEachObserver(e=>{e.complete()}),this.close()}subscribe(e,t,r){let s;if(e===void 0&&t===void 0&&r===void 0)throw new Error("Missing Observer.");vre(e,["next","error","complete"])?s=e:s={next:e,error:t,complete:r},s.next===void 0&&(s.next=mk),s.error===void 0&&(s.error=mk),s.complete===void 0&&(s.complete=mk);const a=this.unsubscribeOne.bind(this,this.observers.length);return this.finalized&&this.task.then(()=>{try{this.finalError?s.error(this.finalError):s.complete()}catch{}}),this.observers.push(s),a}unsubscribeOne(e){this.observers===void 0||this.observers[e]===void 0||(delete this.observers[e],this.observerCount-=1,this.observerCount===0&&this.onNoObservers!==void 0&&this.onNoObservers(this))}forEachObserver(e){if(!this.finalized)for(let t=0;t<this.observers.length;t++)this.sendOne(t,e)}sendOne(e,t){this.task.then(()=>{if(this.observers!==void 0&&this.observers[e]!==void 0)try{t(this.observers[e])}catch(r){typeof console<"u"&&console.error&&console.error(r)}})}close(e){this.finalized||(this.finalized=!0,e!==void 0&&(this.finalError=e),this.task.then(()=>{this.observers=void 0,this.onNoObservers=void 0}))}}function vre(n,e){if(typeof n!="object"||n===null)return!1;for(const t of e)if(t in n&&typeof n[t]=="function")return!0;return!1}function mk(){}/**
185 * @license
186 * Copyright 2021 Google LLC
187 *
188 * Licensed under the Apache License, Version 2.0 (the "License");
189 * you may not use this file except in compliance with the License.
190 * You may obtain a copy of the License at
191 *
192 *   http://www.apache.org/licenses/LICENSE-2.0
193 *
194 * Unless required by applicable law or agreed to in writing, software
195 * distributed under the License is distributed on an "AS IS" BASIS,
196 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
197 * See the License for the specific language governing permissions and
198 * limitations under the License.
199 */function Yn(n){return n&&n._delegate?n._delegate:n}/**
200 * @license
201 * Copyright 2025 Google LLC
202 *
203 * Licensed under the Apache License, Version 2.0 (the "License");
204 * you may not use this file except in compliance with the License.
205 * You may obtain a copy of the License at
206 *
207 *   http://www.apache.org/licenses/LICENSE-2.0
208 *
209 * Unless required by applicable law or agreed to in writing, software
210 * distributed under the License is distributed on an "AS IS" BASIS,
211 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
212 * See the License for the specific language governing permissions and
213 * limitations under the License.
214 */function Ng(n){try{return(n.startsWith("http://")||n.startsWith("https://")?new URL(n).hostname:n).endsWith(".cloudworkstations.dev")}catch{return!1}}async function AD(n){return(await fetch(n,{credentials:"include"})).ok}class ym{constructor(e,t,r){this.name=e,this.instanceFactory=t,this.type=r,this.multipleInstances=!1,this.serviceProps={},this.instantiationMode="LAZY",this.onInstanceCreated=null}setInstantiationMode(e){return this.instantiationMode=e,this}setMultipleInstances(e){return this.multipleInstances=e,this}setServiceProps(e){return this.serviceProps=e,this}setInstanceCreatedCallback(e){return this.onInstanceCreated=e,this}}/**
215 * @license
216 * Copyright 2019 Google LLC
217 *
218 * Licensed under the Apache License, Version 2.0 (the "License");
219 * you may not use this file except in compliance with the License.
220 * You may obtain a copy of the License at
221 *
222 *   http://www.apache.org/licenses/LICENSE-2.0
223 *
224 * Unless required by applicable law or agreed to in writing, software
225 * distributed under the License is distributed on an "AS IS" BASIS,
226 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
227 * See the License for the specific language governing permissions and
228 * limitations under the License.
229 */const Df="[DEFAULT]";/**
230 * @license
231 * Copyright 2019 Google LLC
232 *
233 * Licensed under the Apache License, Version 2.0 (the "License");
234 * you may not use this file except in compliance with the License.
235 * You may obtain a copy of the License at
236 *
237 *   http://www.apache.org/licenses/LICENSE-2.0
238 *
239 * Unless required by applicable law or agreed to in writing, software
240 * distributed under the License is distributed on an "AS IS" BASIS,
241 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
242 * See the License for the specific language governing permissions and
243 * limitations under the License.
244 */let Bre=class{constructor(e,t){this.name=e,this.container=t,this.component=null,this.instances=new Map,this.instancesDeferred=new Map,this.instancesOptions=new Map,this.onInitCallbacks=new Map}get(e){const t=this.normalizeInstanceIdentifier(e);if(!this.instancesDeferred.has(t)){const r=new w$;if(this.instancesDeferred.set(t,r),this.isInitialized(t)||this.shouldAutoInitialize())try{const s=this.getOrInitializeService({instanceIdentifier:t});s&&r.resolve(s)}catch{}}return this.instancesDeferred.get(t).promise}getImmediate(e){const t=this.normalizeInstanceIdentifier(e==null?void 0:e.identifier),r=(e==null?void 0:e.optional)??!1;if(this.isInitialized(t)||this.shouldAutoInitialize())try{return this.getOrInitializeService({instanceIdentifier:t})}catch(s){if(r)return null;throw s}else{if(r)return null;throw Error(`Service ${this.name} is not available`)}}getComponent(){return this.component}setComponent(e){if(e.name!==this.name)throw Error(`Mismatching Component ${e.name} for Provider ${this.name}.`);if(this.component)throw Error(`Component for ${this.name} has already been provided`);if(this.component=e,!!this.shouldAutoInitialize()){if(Cre(e))try{this.getOrInitializeService({instanceIdentifier:Df})}catch{}for(const[t,r]of this.instancesDeferred.entries()){const s=this.normalizeInstanceIdentifier(t);try{const a=this.getOrInitializeService({instanceIdentifier:s});r.resolve(a)}catch{}}}}clearInstance(e=Df){this.instancesDeferred.delete(e),this.instancesOptions.delete(e),this.instances.delete(e)}async delete(){const e=Array.from(this.instances.values());await Promise.all([...e.filter(t=>"INTERNAL"in t).map(t=>t.INTERNAL.delete()),...e.filter(t=>"_delete"in t).map(t=>t._delete())])}isComponentSet(){return this.component!=null}isInitialized(e=Df){return this.instances.has(e)}getOptions(e=Df){return this.instancesOptions.get(e)||{}}initialize(e={}){const{options:t={}}=e,r=this.normalizeInstanceIdentifier(e.instanceIdentifier);if(this.isInitialized(r))throw Error(`${this.name}(${r}) has already been initialized`);if(!this.isComponentSet())throw Error(`Component ${this.name} has not been registered yet`);const s=this.getOrInitializeService({instanceIdentifier:r,options:t});for(const[a,o]of this.instancesDeferred.entries()){const l=this.normalizeInstanceIdentifier(a);r===l&&o.resolve(s)}return s}onInit(e,t){const r=this.normalizeInstanceIdentifier(t),s=this.onInitCallbacks.get(r)??new Set;s.add(e),this.onInitCallbacks.set(r,s);const a=this.instances.get(r);return a&&e(a,r),()=>{s.delete(e)}}invokeOnInitCallbacks(e,t){const r=this.onInitCallbacks.get(t);if(r)for(const s of r)try{s(e,t)}catch{}}getOrInitializeService({instanceIdentifier:e,options:t={}}){let r=this.instances.get(e);if(!r&&this.component&&(r=this.component.instanceFactory(this.container,{instanceIdentifier:wre(e),options:t}),this.instances.set(e,r),this.instancesOptions.set(e,t),this.invokeOnInitCallbacks(r,e),this.component.onInstanceCreated))try{this.component.onInstanceCreated(this.container,e,r)}catch{}return r||null}normalizeInstanceIdentifier(e=Df){return this.component?this.component.multipleInstances?e:Df:e}shouldAutoInitialize(){return!!this.component&&this.component.instantiationMode!=="EXPLICIT"}};function wre(n){return n===Df?void 0:n}function Cre(n){return n.instantiationMode==="EAGER"}/**
245 * @license
246 * Copyright 2019 Google LLC
247 *
248 * Licensed under the Apache License, Version 2.0 (the "License");
249 * you may not use this file except in compliance with the License.
250 * You may obtain a copy of the License at
251 *
252 *   http://www.apache.org/licenses/LICENSE-2.0
253 *
254 * Unless required by applicable law or agreed to in writing, software
255 * distributed under the License is distributed on an "AS IS" BASIS,
256 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
257 * See the License for the specific language governing permissions and
258 * limitations under the License.
259 */class Ere{constructor(e){this.name=e,this.providers=new Map}addComponent(e){const t=this.getProvider(e.name);if(t.isComponentSet())throw new Error(`Component ${e.name} has already been registered with ${this.name}`);t.setComponent(e)}addOrOverwriteComponent(e){this.getProvider(e.name).isComponentSet()&&this.providers.delete(e.name),this.addComponent(e)}getProvider(e){if(this.providers.has(e))return this.providers.get(e);const t=new Bre(e,this);return this.providers.set(e,t),t}getProviders(){return Array.from(this.providers.values())}}/**
260 * @license
261 * Copyright 2017 Google LLC
262 *
263 * Licensed under the Apache License, Version 2.0 (the "License");
264 * you may not use this file except in compliance with the License.
265 * You may obtain a copy of the License at
266 *
267 *   http://www.apache.org/licenses/LICENSE-2.0
268 *
269 * Unless required by applicable law or agreed to in writing, software
270 * distributed under the License is distributed on an "AS IS" BASIS,
271 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
272 * See the License for the specific language governing permissions and
273 * limitations under the License.
274 */var an;(function(n){n[n.DEBUG=0]="DEBUG",n[n.VERBOSE=1]="VERBOSE",n[n.INFO=2]="INFO",n[n.WARN=3]="WARN",n[n.ERROR=4]="ERROR",n[n.SILENT=5]="SILENT"})(an||(an={}));const Sre={debug:an.DEBUG,verbose:an.VERBOSE,info:an.INFO,warn:an.WARN,error:an.ERROR,silent:an.SILENT},Tre=an.INFO,Are={[an.DEBUG]:"log",[an.VERBOSE]:"log",[an.INFO]:"info",[an.WARN]:"warn",[an.ERROR]:"error"},kre=(n,e,...t)=>{if(e<n.logLevel)return;const r=new Date().toISOString(),s=Are[e];if(s)console[s](`[${r}]  ${n.name}:`,...t);else throw new Error(`Attempted to log a message with an invalid logType (value: ${e})`)};let kD=class{constructor(e){this.name=e,this._logLevel=Tre,this._logHandler=kre,this._userLogHandler=null}get logLevel(){return this._logLevel}set logLevel(e){if(!(e in an))throw new TypeError(`Invalid value "${e}" assigned to \`logLevel\``);this._logLevel=e}setLogLevel(e){this._logLevel=typeof e=="string"?Sre[e]:e}get logHandler(){return this._logHandler}set logHandler(e){if(typeof e!="function")throw new TypeError("Value assigned to `logHandler` must be a function");this._logHandler=e}get userLogHandler(){return this._userLogHandler}set userLogHandler(e){this._userLogHandler=e}debug(...e){this._userLogHandler&&this._userLogHandler(this,an.DEBUG,...e),this._logHandler(this,an.DEBUG,...e)}log(...e){this._userLogHandler&&this._userLogHandler(this,an.VERBOSE,...e),this._logHandler(this,an.VERBOSE,...e)}info(...e){this._userLogHandler&&this._userLogHandler(this,an.INFO,...e),this._logHandler(this,an.INFO,...e)}warn(...e){this._userLogHandler&&this._userLogHandler(this,an.WARN,...e),this._logHandler(this,an.WARN,...e)}error(...e){this._userLogHandler&&this._userLogHandler(this,an.ERROR,...e),this._logHandler(this,an.ERROR,...e)}};const Nre=(n,e)=>e.some(t=>n instanceof t);let $M,HM;function _re(){return $M||($M=[IDBDatabase,IDBObjectStore,IDBIndex,IDBCursor,IDBTransaction])}function Ire(){return HM||(HM=[IDBCursor.prototype.advance,IDBCursor.prototype.continue,IDBCursor.prototype.continuePrimaryKey])}const A$=new WeakMap,c_=new WeakMap,k$=new WeakMap,pk=new WeakMap,ND=new WeakMap;function Dre(n){const e=new Promise((t,r)=>{const s=()=>{n.removeEventListener("success",a),n.removeEventListener("error",o)},a=()=>{t(mh(n.result)),s()},o=()=>{r(n.error),s()};n.addEventListener("success",a),n.addEventListener("error",o)});return e.then(t=>{t instanceof IDBCursor&&A$.set(t,n)}).catch(()=>{}),ND.set(e,n),e}function jre(n){if(c_.has(n))return;const e=new Promise((t,r)=>{const s=()=>{n.removeEventListener("complete",a),n.removeEventListener("error",o),n.removeEventListener("abort",o)},a=()=>{t(),s()},o=()=>{r(n.error||new DOMException("AbortError","AbortError")),s()};n.addEventListener("complete",a),n.addEventListener("error",o),n.addEventListener("abort",o)});c_.set(n,e)}let d_={get(n,e,t){if(n instanceof IDBTransaction){if(e==="done")return c_.get(n);if(e==="objectStoreNames")return n.objectStoreNames||k$.get(n);if(e==="store")return t.objectStoreNames[1]?void 0:t.objectStore(t.objectStoreNames[0])}return mh(n[e])},set(n,e,t){return n[e]=t,!0},has(n,e){return n instanceof IDBTransaction&&(e==="done"||e==="store")?!0:e in n}};function Rre(n){d_=n(d_)}
vendor: 4,138 bytes, lines 274-308
274function Pre(n){return n===IDBDatabase.prototype.transaction&&!("objectStoreNames"in IDBTransaction.prototype)?function(e,...t){const r=n.call(gk(this),e,...t);return k$.set(r,e.sort?e.sort():[e]),mh(r)}:Ire().includes(n)?function(...e){return n.apply(gk(this),e),mh(A$.get(this))}:function(...e){return mh(n.apply(gk(this),e))}}function Lre(n){return typeof n=="function"?Pre(n):(n instanceof IDBTransaction&&jre(n),Nre(n,_re())?new Proxy(n,d_):n)}function mh(n){if(n instanceof IDBRequest)return Dre(n);if(pk.has(n))return pk.get(n);const e=Lre(n);return e!==n&&(pk.set(n,e),ND.set(e,n)),e}const gk=n=>ND.get(n);function Ore(n,e,{blocked:t,upgrade:r,blocking:s,terminated:a}={}){const o=indexedDB.open(n,e),l=mh(o);return r&&o.addEventListener("upgradeneeded",c=>{r(mh(o.result),c.oldVersion,c.newVersion,mh(o.transaction),c)}),t&&o.addEventListener("blocked",c=>t(c.oldVersion,c.newVersion,c)),l.then(c=>{a&&c.addEventListener("close",()=>a()),s&&c.addEventListener("versionchange",d=>s(d.oldVersion,d.newVersion,d))}).catch(()=>{}),l}const Mre=["get","getKey","getAll","getAllKeys","count"],Fre=["put","add","delete","clear"],xk=new Map;function zM(n,e){if(!(n instanceof IDBDatabase&&!(e in n)&&typeof e=="string"))return;if(xk.get(e))return xk.get(e);const t=e.replace(/FromIndex$/,""),r=e!==t,s=Fre.includes(t);if(!(t in(r?IDBIndex:IDBObjectStore).prototype)||!(s||Mre.includes(t)))return;const a=async function(o,...l){const c=this.transaction(o,s?"readwrite":"readonly");let d=c.store;return r&&(d=d.index(l.shift())),(await Promise.all([d[t](...l),s&&c.done]))[0]};return xk.set(e,a),a}Rre(n=>({...n,get:(e,t,r)=>zM(e,t)||n.get(e,t,r),has:(e,t)=>!!zM(e,t)||n.has(e,t)}));/**
275 * @license
276 * Copyright 2019 Google LLC
277 *
278 * Licensed under the Apache License, Version 2.0 (the "License");
279 * you may not use this file except in compliance with the License.
280 * You may obtain a copy of the License at
281 *
282 *   http://www.apache.org/licenses/LICENSE-2.0
283 *
284 * Unless required by applicable law or agreed to in writing, software
285 * distributed under the License is distributed on an "AS IS" BASIS,
286 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
287 * See the License for the specific language governing permissions and
288 * limitations under the License.
289 */class Ure{constructor(e){this.container=e}getPlatformInfoString(){return this.container.getProviders().map(t=>{if(Vre(t)){const r=t.getImmediate();return`${r.library}/${r.version}`}else return null}).filter(t=>t).join(" ")}}function Vre(n){const e=n.getComponent();return(e==null?void 0:e.type)==="VERSION"}const u_="@firebase/app",qM="0.16.2";/**
290 * @license
291 * Copyright 2019 Google LLC
292 *
293 * Licensed under the Apache License, Version 2.0 (the "License");
294 * you may not use this file except in compliance with the License.
295 * You may obtain a copy of the License at
296 *
297 *   http://www.apache.org/licenses/LICENSE-2.0
298 *
299 * Unless required by applicable law or agreed to in writing, software
300 * distributed under the License is distributed on an "AS IS" BASIS,
301 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
302 * See the License for the specific language governing permissions and
303 * limitations under the License.
304 */const Vd=new kD("@firebase/app"),Gre="@firebase/app-compat",$re="@firebase/analytics-compat",Hre="@firebase/analytics",zre="@firebase/app-check-compat",qre="@firebase/app-check",Kre="@firebase/auth",Wre="@firebase/auth-compat",Yre="@firebase/database",Qre="@firebase/data-connect",Jre="@firebase/database-compat",Xre="@firebase/functions",Zre="@firebase/functions-compat",ese="@firebase/installations",tse="@firebase/installations-compat",nse="@firebase/messaging",rse="@firebase/messaging-compat",sse="@firebase/performance",ase="@firebase/performance-compat",ise="@firebase/remote-config",ose="@firebase/remote-config-compat",lse="@firebase/storage",cse="@firebase/storage-compat",dse="@firebase/firestore",use="@firebase/ai",hse="@firebase/firestore-compat",fse="firebase",mse="12.19.0";/**
305 * @license
306 * Copyright 2019 Google LLC
307 *
308 * Licensed under the Apache License, Version 2.0 (the "License");
309 * you may not use this file except in compliance with the License.
310 * You may obtain a copy of the License at
311 *
312 *   http://www.apache.org/licenses/LICENSE-2.0
313 *
314 * Unless required by applicable law or agreed to in writing, software
315 * distributed under the License is distributed on an "AS IS" BASIS,
316 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
317 * See the License for the specific language governing permissions and
318 * limitations under the License.
319 */const OC="[DEFAULT]",pse={[u_]:"fire-core",[Gre]:"fire-core-compat",[Hre]:"fire-analytics",[$re]:"fire-analytics-compat",[qre]:"fire-app-check",[zre]:"fire-app-check-compat",[Kre]:"fire-auth",[Wre]:"fire-auth-compat",[Yre]:"fire-rtdb",[Qre]:"fire-data-connect",[Jre]:"fire-rtdb-compat",[Xre]:"fire-fn",[Zre]:"fire-fn-compat",[ese]:"fire-iid",[tse]:"fire-iid-compat",[nse]:"fire-fcm",[rse]:"fire-fcm-compat",[sse]:"fire-perf",[ase]:"fire-perf-compat",[ise]:"fire-rc",[ose]:"fire-rc-compat",[lse]:"fire-gcs",[cse]:"fire-gcs-compat",[dse]:"fire-fst",[hse]:"fire-fst-compat",[use]:"fire-vertex","fire-js":"fire-js",[fse]:"fire-js-all"};/**
320 * @license
321 * Copyright 2019 Google LLC
322 *
323 * Licensed under the Apache License, Version 2.0 (the "License");
324 * you may not use this file except in compliance with the License.
325 * You may obtain a copy of the License at
326 *
327 *   http://www.apache.org/licenses/LICENSE-2.0
328 *
329 * Unless required by applicable law or agreed to in writing, software
330 * distributed under the License is distributed on an "AS IS" BASIS,
331 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
332 * See the License for the specific language governing permissions and
333 * limitations under the License.
334 */const Zb=new Map,gse=new Map,h_=new Map;function KM(n,e){try{n.container.addComponent(e)}catch(t){Vd.debug(`Component ${e.name} failed to register with FirebaseApp ${n.name}`,t)}}function H0(n){const e=n.name;if(h_.has(e))return Vd.debug(`There were multiple attempts to register component ${e}.`),!1;h_.set(e,n);for(const t of Zb.values())KM(t,n);for(const t of gse.values())KM(t,n);return!0}function Yy(n,e){const t=n.container.getProvider("heartbeat").getImmediate({optional:!0});return t&&t.triggerHeartbeat(),n.container.getProvider(e)}function xse(n,e,t=OC){Yy(n,e).clearInstance(t)}function xo(n){return n==null?!1:n.settings!==void 0}/**
335 * @license
336 * Copyright 2019 Google LLC
337 *
338 * Licensed under the Apache License, Version 2.0 (the "License");
339 * you may not use this file except in compliance with the License.
340 * You may obtain a copy of the License at
341 *
342 *   http://www.apache.org/licenses/LICENSE-2.0
343 *
344 * Unless required by applicable law or agreed to in writing, software
345 * distributed under the License is distributed on an "AS IS" BASIS,
346 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
347 * See the License for the specific language governing permissions and
348 * limitations under the License.
349 */const bse={"no-app":"No Firebase App '{$appName}' has been created - call initializeApp() first","bad-app-name":"Illegal App name: '{$appName}'","duplicate-app":"Firebase App named '{$appName}' already exists with different {$mismatchedParam}. Existing: '{$oldValue}'. New: '{$newValue}'.","app-deleted":"Firebase App named '{$appName}' already deleted","server-app-deleted":"Firebase Server App has been deleted","no-options":"Need to provide options, when not being deployed to hosting via source.","invalid-app-argument":"firebase.{$appName}() takes either no argument or a Firebase App instance.","invali
349d-log-argument":"First argument to `onLog` must be null or a function.","idb-open":"Error thrown when opening IndexedDB. Original error: {$originalErrorMessage}.","idb-get":"Error thrown when reading from IndexedDB. Original error: {$originalErrorMessage}.","idb-set":"Error thrown when writing to IndexedDB. Original error: {$originalErrorMessage}.","idb-delete":"Error thrown when deleting from IndexedDB. Original error: {$originalErrorMessage}.","finalization-registry-not-supported":"FirebaseServerApp deleteOnDeref field defined but the JS runtime does not support FinalizationRegistry.","invalid-server-app-environment":"FirebaseServerApp is not for use in browser environments."},kd=new Ky("app","Firebase",bse);/**
350 * @license
351 * Copyright 2019 Google LLC
352 *
353 * Licensed under the Apache License, Version 2.0 (the "License");
354 * you may not use this file except in compliance with the License.
355 * You may obtain a copy of the License at
356 *
357 *   http://www.apache.org/licenses/LICENSE-2.0
358 *
359 * Unless required by applicable law or agreed to in writing, software
360 * distributed under the License is distributed on an "AS IS" BASIS,
361 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
362 * See the License for the specific language governing permissions and
363 * limitations under the License.
364 */class yse{constructor(e,t,r){this._isDeleted=!1,this._options={...e},this._config={...t},this._name=t.name,this._automaticDataCollectionEnabled=t.automaticDataCollectionEnabled,this._container=r,this.container.addComponent(new ym("app",()=>this,"PUBLIC"))}get automaticDataCollectionEnabled(){return this.checkDestroyed(),this._automaticDataCollectionEnabled}set automaticDataCollectionEnabled(e){this.checkDestroyed(),this._automaticDataCollectionEnabled=e}get name(){return this.checkDestroyed(),this._name}get options(){return this.checkDestroyed(),this._options}get config(){return this.checkDestroyed(),this._config}get container(){return this._container}get isDeleted(){return this._isDeleted}set isDeleted(e){this._isDeleted=e}checkDestroyed(){if(this.isDeleted)throw kd.create("app-deleted",{appName:this._name})}}/**
365 * @license
366 * Copyright 2019 Google LLC
367 *
368 * Licensed under the Apache License, Version 2.0 (the "License");
369 * you may not use this file except in compliance with the License.
370 * You may obtain a copy of the License at
371 *
372 *   http://www.apache.org/licenses/LICENSE-2.0
373 *
374 * Unless required by applicable law or agreed to in writing, software
375 * distributed under the License is distributed on an "AS IS" BASIS,
376 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
377 * See the License for the specific language governing permissions and
378 * limitations under the License.
379 */const _g=mse;function N$(n,e={}){let t=n;typeof e!="object"&&(e={name:e});const r={name:OC,automaticDataCollectionEnabled:!0,...e},s=r.name;if(typeof s!="string"||!s)throw kd.create("bad-app-name",{appName:String(s)});if(t||(t=v$()),!t)throw kd.create("no-options");const a=Zb.get(s);if(a)if(Gl(t,a.options)){if(Gl(r,a.config))return a;throw kd.create("duplicate-app",{appName:s,mismatchedParam:"config",oldValue:JSON.stringify(a.config),newValue:JSON.stringify(r)})}else throw kd.create("duplicate-app",{appName:s,mismatchedParam:"options",oldValue:JSON.stringify(a.options),newValue:JSON.stringify(t)});const o=new Ere(s);for(const c of h_.values())o.addComponent(c);const l=new yse(t,r,o);return Zb.set(s,l),l}function _D(n=OC){const e=Zb.get(n);if(!e&&n===OC&&v$())return N$();if(!e)throw kd.create("no-app",{appName:n});return e}function vse(){return Array.from(Zb.values())}function ph(n,e,t){let r=pse[n]??n;t&&(r+=`-${t}`);const s=r.match(/\s|\//),a=e.match(/\s|\//);if(s||a){const o=[`Unable to register library "${r}" with version "${e}":`];s&&o.push(`library name "${r}" contains illegal characters (whitespace or "/")`),s&&a&&o.push("and"),a&&o.push(`version name "${e}" contains illegal characters (whitespace or "/")`),Vd.warn(o.join(" "));return}H0(new ym(`${r}-version`,()=>({library:r,version:e}),"VERSION"))}/**
380 * @license
381 * Copyright 2021 Google LLC
382 *
383 * Licensed under the Apache License, Version 2.0 (the "License");
384 * you may not use this file except in compliance with the License.
385 * You may obtain a copy of the License at
386 *
387 *   http://www.apache.org/licenses/LICENSE-2.0
388 *
389 * Unless required by applicable law or agreed to in writing, software
390 * distributed under the License is distributed on an "AS IS" BASIS,
391 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
392 * See the License for the specific language governing permissions and
393 * limitations under the License.
394 */const Bse="firebase-heartbeat-database",wse=1,ey="firebase-heartbeat-store";let bk=null;function _$(){return bk||(bk=Ore(Bse,wse,{upgrade:(n,e)=>{switch(e){case 0:try{n.createObjectStore(ey)}catch(t){console.warn(t)}}}}).catch(n=>{throw kd.create("idb-open",{originalErrorMessage:n.message})})),bk}async function Cse(n){try{const t=(await _$()).transaction(ey),r=await t.objectStore(ey).get(I$(n));return await t.done,r}catch(e){if(e instanceof Zd)Vd.warn(e.message);else{const t=kd.create("idb-get",{originalErrorMessage:e==null?void 0:e.message});Vd.warn(t.message)}}}async function WM(n,e){try{const r=(await _$()).transaction(ey,"readwrite");await r.objectStore(ey).put(e,I$(n)),await r.done}catch(t){if(t instanceof Zd)Vd.warn(t.message);else{const r=kd.create("idb-set",{originalErrorMessage:t==null?void 0:t.message});Vd.warn(r.message)}}}function I$(n){return`${n.name}!${n.options.appId}`}/**
395 * @license
396 * Copyright 2021 Google LLC
397 *
398 * Licensed under the Apache License, Version 2.0 (the "License");
399 * you may not use this file except in compliance with the License.
400 * You may obtain a copy of the License at
401 *
402 *   http://www.apache.org/licenses/LICENSE-2.0
403 *
404 * Unless required by applicable law or agreed to in writing, software
405 * distributed under the License is distributed on an "AS IS" BASIS,
406 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
407 * See the License for the specific language governing permissions and
408 * limitations under the License.
409 */const Ese=1024,Sse=30;class Tse{constructor(e){this.container=e,this._heartbeatsCache=null;const t=this.container.getProvider("app").getImmediate();this._storage=new kse(t),this._heartbeatsCachePromise=this._storage.read().then(r=>(this._heartbeatsCache=r,r))}async triggerHeartbeat(){var e,t;try{const s=this.container.getProvider("platform-logger").getImmediate().getPlatformInfoString(),a=YM();if(((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null&&(this._heartbeatsCache=await this._heartbeatsCachePromise,((t=this._heartbeatsCache)==null?void 0:t.heartbeats)==null)||this._heartbeatsCache.lastSentHeartbeatDate===a||this._heartbeatsCache.heartbeats.some(o=>o.date===a))return;if(this._heartbeatsCache.heartbeats.push({date:a,agent:s}),this._heartbeatsCache.heartbeats.length>Sse){const o=Nse(this._heartbeatsCache.heartbeats);this._heartbeatsCache.heartbeats.splice(o,1)}return this._storage.overwrite(this._heartbeatsCache)}catch(r){Vd.warn(r)}}async getHeartbeatsHeader(){var e;try{if(this._heartbeatsCache===null&&await this._heartbeatsCachePromise,((e=this._heartbeatsCache)==null?void 0:e.heartbeats)==null||this._heartbeatsCache.heartbeats.length===0)return"";const t=YM(),{heartbeatsToSend:r,unsentEntries:s}=Ase(this._heartbeatsCache.heartbeats),a=LC(JSON.stringify({version:2,heartbeats:r}));return this._heartbeatsCache.lastSentHeartbeatDate=t,s.length>0?(this._heartbeatsCache.heartbeats=s,await this._storage.overwrite(this._heartbeatsCache)):(this._heartbeatsCache.heartbeats=[],this._storage.overwrite(this._heartbeatsCache)),a}catch(t){return Vd.warn(t),""}}}function YM(){return new Date().toISOString().substring(0,10)}function Ase(n,e=Ese){const t=[];let r=n.slice();for(const s of n){const a=t.find(o=>o.agent===s.agent);if(a){if(a.dates.push(s.date),QM(t)>e){a.dates.pop();break}}else if(t.push({agent:s.agent,dates:[s.date]}),QM(t)>e){t.pop();break}r=r.slice(1)}return{heartbeatsToSend:t,unsentEntries:r}}class kse{constructor(e){this.app=e,this._canUseIndexedDBPromise=this.runIndexedDBEnvironmentCheck()}async runIndexedDBEnvironmentCheck(){return T$()?mre().then(()=>!0).catch(()=>!1):!1}async read(){if(await this._canUseIndexedDBPromise){const t=await Cse(this.app);return t!=null&&t.heartbeats?t:{heartbeats:[]}}else return{heartbeats:[]}}async overwrite(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return WM(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:e.heartbeats})}else return}async add(e){if(await this._canUseIndexedDBPromise){const r=await this.read();return WM(this.app,{lastSentHeartbeatDate:e.lastSentHeartbeatDate??r.lastSentHeartbeatDate,heartbeats:[...r.heartbeats,...e.heartbeats]})}else return}}function QM(n){return LC(JSON.stringify({version:2,heartbeats:n})).length}function Nse(n){if(n.length===0)return-1;let e=0,t=n[0].date;for(let r=1;r<n.length;r++)n[r].date<t&&(t=n[r].date,e=r);return e}/**
410 * @license
411 * Copyright 2019 Google LLC
412 *
413 * Licensed under the Apache License, Version 2.0 (the "License");
414 * you may not use this file except in compliance with the License.
415 * You may obtain a copy of the License at
416 *
417 *   http://www.apache.org/licenses/LICENSE-2.0
418 *
419 * Unless required by applicable law or agreed to in writing, software
420 * distributed under the License is distributed on an "AS IS" BASIS,
421 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
422 * See the License for the specific language governing permissions and
423 * limitations under the License.
424 */function _se(n){H0(new ym("platform-logger",e=>new Ure(e),"PRIVATE")),H0(new ym("heartbeat",e=>new Tse(e),"PRIVATE")),ph(u_,qM,n),ph(u_,qM,"esm2020"),ph("fire-js","")}/**
425 * @license
426 * Copyright 2019 Google LLC
427 *
428 * Licensed under the Apache License, Version 2.0 (the "License");
429 * you may not use this file except in compliance with the License.
430 * You may obtain a copy of the License at
431 *
432 *   http://www.apache.org/licenses/LICENSE-2.0
433 *
434 * Unless required by applicable law or agreed to in writing, software
435 * distributed under the License is distributed on an "AS IS" BASIS,
436 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
437 * See the License for the specific language governing permissions and
438 * limitations under the License.
439 */_se("");function D$(){return{"dependent-sdk-initialized-before-auth":"Another Firebase SDK was initialized and is trying to use Auth before Auth is initialized. Please be sure to call `initializeAuth` or `getAuth` before starting any other Firebase SDK."}}const Ise=D$,j$=new Ky("auth","Firebase",D$());/**
440 * @license
441 * Copyright 2020 Google LLC
442 *
443 * Licensed under the Apache License, Version 2.0 (the "License");
444 * you may not use this file except in compliance with the License.
445 * You may obtain a copy of the License at
446 *
447 *   http://www.apache.org/licenses/LICENSE-2.0
448 *
449 * Unless required by applicable law or agreed to in writing, software
450 * distributed under the License is distributed on an "AS IS" BASIS,
451 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
452 * See the License for the specific language governing permissions and
453 * limitations under the License.
454 */const MC=new kD("@firebase/auth");function Xw(n,...e){MC.logLevel<=an.WARN&&MC.warn(`Auth (${_g}): ${n}`,...e)}function Zw(n,...e){MC.logLevel<=an.ERROR&&MC.error(`Auth (${_g}): ${n}`,...e)}/**
455 * @license
456 * Copyright 2020 Google LLC
457 *
458 * Licensed under the Apache License, Version 2.0 (the "License");
459 * you may not use this file except in compliance with the License.
460 * You may obtain a copy of the License at
461 *
462 *   http://www.apache.org/licenses/LICENSE-2.0
463 *
464 * Unless required by applicable law or agreed to in writing, software
465 * distributed under the License is distributed on an "AS IS" BASIS,
466 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
467 * See the License for the specific language governing permissions and
468 * limitations under the License.
469 */function tl(n,...e){throw ID(n,...e)}function Ml(n,...e){return ID(n,...e)}function E1(n,e,t){const r={...Ise(),[e]:t};return new Ky("auth","Firebase",r).create(e,{appName:n.name})}function Pd(n){return E1(n,"operation-not-supported-in-this-environment","Operations that alter the current user are not supported in conjunction with FirebaseServerApp")}function Dse(n,e,t){const r=t;if(!(e instanceof r))throw r.name!==e.constructor.name&&tl(n,"argument-error"),E1(n,"argument-error",`Type of ${e.constructor.name} does not match expected instance.Did you pass a reference from a different Auth SDK?`)}function ID(n,...e){if(typeof n!="string"){const t=e[0],r=[...e.slice(1)];return r[0]&&(r[0].appName=n.name),n._errorFactory.create(t,...r)}return j$.create(n,...e)}function Lt(n,e,...t){if(!n)throw ID(e,...t)}function Nd(n){const e="INTERNAL ASSERTION FAILED: "+n;throw Zw(e),new Error(e)}function Gd(n,e){n||Nd(e)}/**
470 * @license
471 * Copyright 2020 Google LLC
472 *
473 * Licensed under the Apache License, Version 2.0 (the "License");
474 * you may not use this file except in compliance with the License.
475 * You may obtain a copy of the License at
476 *
477 *   http://www.apache.org/licenses/LICENSE-2.0
478 *
479 * Unless required by applicable law or agreed to in writing, softw
479are
480 * distributed under the License is distributed on an "AS IS" BASIS,
481 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
482 * See the License for the specific language governing permissions and
483 * limitations under the License.
484 */function f_(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.href)||""}function jse(){return JM()==="http:"||JM()==="https:"}function JM(){var n;return typeof self<"u"&&((n=self.location)==null?void 0:n.protocol)||null}/**
485 * @license
486 * Copyright 2020 Google LLC
487 *
488 * Licensed under the Apache License, Version 2.0 (the "License");
489 * you may not use this file except in compliance with the License.
490 * You may obtain a copy of the License at
491 *
492 *   http://www.apache.org/licenses/LICENSE-2.0
493 *
494 * Unless required by applicable law or agreed to in writing, software
495 * distributed under the License is distributed on an "AS IS" BASIS,
496 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
497 * See the License for the specific language governing permissions and
498 * limitations under the License.
499 */function Rse(){return typeof navigator<"u"&&navigator&&"onLine"in navigator&&typeof navigator.onLine=="boolean"&&(jse()||ure()||"connection"in navigator)?navigator.onLine:!0}function Pse(){if(typeof navigator>"u")return null;const n=navigator;return n.languages&&n.languages[0]||n.language||null}/**
500 * @license
501 * Copyright 2020 Google LLC
502 *
503 * Licensed under the Apache License, Version 2.0 (the "License");
504 * you may not use this file except in compliance with the License.
505 * You may obtain a copy of the License at
506 *
507 *   http://www.apache.org/licenses/LICENSE-2.0
508 *
509 * Unless required by applicable law or agreed to in writing, software
510 * distributed under the License is distributed on an "AS IS" BASIS,
511 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
512 * See the License for the specific language governing permissions and
513 * limitations under the License.
514 */class Qy{constructor(e,t){this.shortDelay=e,this.longDelay=t,Gd(t>e,"Short delay should be less than long delay!"),this.isMobile=cre()||hre()}get(){return Rse()?this.isMobile?this.longDelay:this.shortDelay:Math.min(5e3,this.shortDelay)}}/**
515 * @license
516 * Copyright 2020 Google LLC
517 *
518 * Licensed under the Apache License, Version 2.0 (the "License");
519 * you may not use this file except in compliance with the License.
520 * You may obtain a copy of the License at
521 *
522 *   http://www.apache.org/licenses/LICENSE-2.0
523 *
524 * Unless required by applicable law or agreed to in writing, software
525 * distributed under the License is distributed on an "AS IS" BASIS,
526 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
527 * See the License for the specific language governing permissions and
528 * limitations under the License.
529 */function DD(n,e){Gd(n.emulator,"Emulator should always be set here");const{url:t}=n.emulator;return e?`${t}${e.startsWith("/")?e.slice(1):e}`:t}/**
530 * @license
531 * Copyright 2020 Google LLC
532 *
533 * Licensed under the Apache License, Version 2.0 (the "License");
534 * you may not use this file except in compliance with the License.
535 * You may obtain a copy of the License at
536 *
537 *   http://www.apache.org/licenses/LICENSE-2.0
538 *
539 * Unless required by applicable law or agreed to in writing, software
540 * distributed under the License is distributed on an "AS IS" BASIS,
541 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
542 * See the License for the specific language governing permissions and
543 * limitations under the License.
544 */class R${static initialize(e,t,r){this.fetchImpl=e,t&&(this.headersImpl=t),r&&(this.responseImpl=r)}static fetch(){if(this.fetchImpl)return this.fetchImpl;if(typeof self<"u"&&"fetch"in self)return self.fetch;if(typeof globalThis<"u"&&globalThis.fetch)return globalThis.fetch;if(typeof fetch<"u")return fetch;Nd("Could not find fetch implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}static headers(){if(this.headersImpl)return this.headersImpl;if(typeof self<"u"&&"Headers"in self)return self.Headers;if(typeof globalThis<"u"&&globalThis.Headers)return globalThis.Headers;if(typeof Headers<"u")return Headers;Nd("Could not find Headers implementation, make sure you call FetchProvi
544der.initialize() with an appropriate polyfill")}static response(){if(this.responseImpl)return this.responseImpl;if(typeof self<"u"&&"Response"in self)return self.Response;if(typeof globalThis<"u"&&globalThis.Response)return globalThis.Response;if(typeof Response<"u")return Response;Nd("Could not find Response implementation, make sure you call FetchProvider.initialize() with an appropriate polyfill")}}/**
545 * @license
546 * Copyright 2020 Google LLC
547 *
548 * Licensed under the Apache License, Version 2.0 (the "License");
549 * you may not use this file except in compliance with the License.
550 * You may obtain a copy of the License at
551 *
552 *   http://www.apache.org/licenses/LICENSE-2.0
553 *
554 * Unless required by applicable law or agreed to in writing, software
555 * distributed under the License is distributed on an "AS IS" BASIS,
556 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
557 * See the License for the specific language governing permissions and
558 * limitations under the License.
559 */const Lse={CREDENTIAL_MISMATCH:"custom-token-mismatch",MISSING_CUSTOM_TOKEN:"internal-error",INVALID_IDENTIFIER:"invalid-email",MISSING_CONTINUE_URI:"internal-error",INVALID_PASSWORD:"wrong-password",MISSING_PASSWORD:"missing-password",INVALID_LOGIN_CREDENTIALS:"invalid-credential",EMAIL_EXISTS:"email-already-in-use",PASSWORD_LOGIN_DISABLED:"operation-not-allowed",INVALID_IDP_RESPONSE:"invalid-credential",INVALID_PENDING_TOKEN:"invalid-credential",FEDERATED_USER_ID_ALREADY_LINKED:"credential-already-in-use",MISSING_REQ_TYPE:"internal-error",EMAIL_NOT_FOUND:"user-not-found",RESET_PASSWORD_EXCEED_LIMIT:"too-many-requests",EXPIRED_OOB_CODE:"expired-action-code",INVALID_OOB_CODE:"invalid-action-code",MISSING_OOB_CODE:"internal-error",CREDENTIAL_TOO_OLD_LOGIN_AGAIN:"requires-recent-login",INVALID_ID_TOKEN:"invalid-user-token",TOKEN_EXPIRED:"user-token-expired",USER_NOT_FOUND:"user-token-expired",TOO_MANY_ATTEMPTS_TRY_LATER:"too-many-requests",PASSWORD_DOES_NOT_MEET_REQUIREMENTS:"password-does-not-meet-requirements",INVALID_CODE:"invalid-verification-code",INVALID_SESSION_INFO:"invalid-verification-id",INVALID_TEMPORARY_PROOF:"invalid-credential",MISSING_SESSION_INFO:"missing-verification-id",SESSION_EXPIRED:"code-expired",MISSING_ANDROID_PACKAGE_NAME:"missing-android-pkg-name",UNAUTHORIZED_DOMAIN:"unauthorized-continue-uri",INVALID_OAUTH_CLIENT_ID:"invalid-oauth-client-id",ADMIN_ONLY_OPERATION:"admin-restricted-operation",INVALID_MFA_PENDING_CREDENTIAL:"invalid-multi-factor-session",MFA_ENROLLMENT_NOT_FOUND:"multi-factor-info-not-found",MISSING_MFA_ENROLLMENT_ID:"missing-multi-factor-info",MISSING_MFA_PENDING_CREDENTIAL:"missing-multi-factor-session",SECOND_FACTOR_EXISTS:"second-factor-already-in-use",SECOND_FACTOR_LIMIT_EXCEEDED:"maximum-second-factor-count-exceeded",BLOCKING_FUNCTION_ERROR_RESPONSE:"internal-error",RECAPTCHA_NOT_ENABLED:"recaptcha-not-enabled",MISSING_RECAPTCHA_TOKEN:"missing-recaptcha-token",INVALID_RECAPTCHA_TOKEN:"invalid-recaptcha-token",INVALID_RECAPTCHA_ACTION:"invalid-recaptcha-action",MISSING_CLIENT_TYPE:"missing-client-type",MISSING_RECAPTCHA_VERSION:"missing-recaptcha-version",INVALID_RECAPTCHA_VERSION:"invalid-recaptcha-version",INVALID_REQ_TYPE:"invalid-req-type"};/**
560 * @license
561 * Copyright 2020 Google LLC
562 *
563 * Licensed under the Apache License, Version 2.0 (the "License");
564 * you may not use this file except in compliance with the License.
565 * You may obtain a copy of the License at
566 *
567 *   http://www.apache.org/licenses/LICENSE-2.0
568 *
569 * Unless required by applicable law or agreed to in writing, software
570 * distributed under the License is distributed on an "AS IS" BASIS,
571 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
572 * See the License for the specific language governing permissions and
573 * limitations under the License.
574 */const Ose=["/v1/accounts:signInWithCustomToken","/v1/accounts:signInWithEmailLink","/v1/accounts:signInWithIdp","/v1/accounts:signInWithPassword","/v1/accounts:signInWithPhoneNumber","/v1/token"],Mse=new Qy(3e4,6e4);function Hh(n,e){return n.tenantId&&!e.tenantId?{...e,tenantId:n.tenantId}:e}async function eu(n,e,t,r,s={}){return P$(n,s,async()=>{let a={},o={};r&&(e==="GET"?o=r:a={body:JSON.stringify(r)});
574const l=Wy({...o,key:n.config.apiKey}).slice(1),c=await n._getAdditionalHeaders();c["Content-Type"]="application/json",n.languageCode&&(c["X-Firebase-Locale"]=n.languageCode);const d={method:e,headers:c,...a};return dre()||(d.referrerPolicy="strict-origin-when-cross-origin"),n.emulatorConfig&&Ng(n.emulatorConfig.host)&&(d.credentials="include"),R$.fetch()(await L$(n,n.config.apiHost,t,l),d)})}async function P$(n,e,t){n._canInitEmulator=!1;const r={...Lse,...e};try{const s=new Use(n),a=await Promise.race([t(),s.promise]);s.clearNetworkTimeout();const o=await a.json();if("needConfirmation"in o)throw YB(n,"account-exists-with-different-credential",o);if(a.ok&&!("errorMessage"in o))return o;{const l=a.ok?o.errorMessage:o.error.message,[c,d]=l.split(" : ");if(c==="FEDERATED_USER_ID_ALREADY_LINKED")throw YB(n,"credential-already-in-use",o);if(c==="EMAIL_EXISTS")throw YB(n,"email-already-in-use",o);if(c==="USER_DISABLED")throw YB(n,"user-disabled",o);const h=r[c]||c.toLowerCase().replace(/[_\s]+/g,"-");if(d)throw E1(n,h,d);tl(n,h)}}catch(s){if(s instanceof Zd)throw s;tl(n,"network-request-failed",{message:String(s)})}}async function Jy(n,e,t,r,s={}){const a=await eu(n,e,t,r,s);return"mfaPendingCredential"in a&&tl(n,"multi-factor-auth-required",{_serverResponse:a}),a}async function L$(n,e,t,r){const s=`${e}${t}?${r}`,a=n,o=a.config.emulator?DD(n.config,s):`${n.config.apiScheme}://${s}`;return Ose.includes(t)&&(await a._persistenceManagerAvailable,a._getPersistenceType()==="COOKIE")?a._getPersistence()._getFinalTarget(o).toString():o}function Fse(n){switch(n){case"ENFORCE":return"ENFORCE";case"AUDIT":return"AUDIT";case"OFF":return"OFF";default:return"ENFORCEMENT_STATE_UNSPECIFIED"}}class Use{clearNetworkTimeout(){clearTimeout(this.timer)}constructor(e){this.auth=e,this.timer=null,this.promise=new Promise((t,r)=>{this.timer=setTimeout(()=>r(Ml(this.auth,"network-request-failed")),Mse.get())})}}function YB(n,e,t){const r={appName:n.name};t.email&&(r.email=t.email),t.phoneNumber&&(r.phoneNumber=t.phoneNumber);const s=Ml(n,e,r);return s.customData._tokenResponse=t,s}function XM(n){return n!==void 0&&n.enterprise!==void 0}class Vse{constructor(e){if(this.siteKey="",this.recaptchaEnforcementState=[],e.recaptchaKey===void 0)throw new Error("recaptchaKey undefined");this.siteKey=e.recaptchaKey.split("/")[3],this.recaptchaEnforcementState=e.recaptchaEnforcementState}getProviderEnforcementState(e){if(!this.recaptchaEnforcementState||this.recaptchaEnforcementState.length===0)return null;for(const t of this.recaptchaEnforcementState)if(t.provider&&t.provider===e)return Fse(t.enforcementState);return null}isProviderEnabled(e){return this.getProviderEnforcementState(e)==="ENFORCE"||this.getProviderEnforcementState(e)==="AUDIT"}isAnyProviderEnabled(){return this.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")||this.isProviderEnabled("PHONE_PROVIDER")}}async function Gse(n,e){return eu(n,"GET","/v2/recaptchaConfig",Hh(n,e))}/**
575 * @license
576 * Copyright 2020 Google LLC
577 *
578 * Licensed under the Apache License, Version 2.0 (the "License");
579 * you may not use this file except in compliance with the License.
580 * You may obtain a copy of the License at
581 *
582 *   http://www.apache.org/licenses/LICENSE-2.0
583 *
584 * Unless required by applicable law or agreed to in writing, software
585 * distributed under the License is distributed on an "AS IS" BASIS,
586 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
587 * See the License for the specific language governing permissions and
588 * limitations under the License.
589 */async function $se(n,e){return eu(n,"POST","/v1/accounts:delete",e)}async function FC(n,e){return eu(n,"POST","/v1/accounts:lookup",e)}/**
590 * @license
591 * Copyright 2020 Google LLC
592 *
593 * Licensed under the Apache License, Version 2.0 (the "License");
594 * you may not use this file except in compliance with the License.
595 * You may obtain a copy of the License at
596 *
597 *   http://www.apache.org/licenses/LICENSE-2.0
598 *
599 * Unless required by applicable law or agreed to in writing, software
600 * distributed under the License is distributed on an "AS IS" BASIS,
601 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
602 * See the License for the specific language governing permissions and
603 * limitations under the License.
604 */function Nb(n){if(n)try{const e=new Date(Number(n));if(!isNaN(e.getTime()))return e.toUTCString()}catch{}}async function Hse(n,e=!1){const t=Yn(n),r=await t.getIdToken(e),s=jD(r);Lt(s&&s.exp&&s.auth_time&&s.iat,t.auth,"internal-error");const a=typeof s.firebase=="object"?s.firebase:void 0,o=a==null?void 0:a.sign_in_provider;return{claims:s,token:r,authTime:Nb(yk(s.auth_time)),issuedAtTime:Nb(yk(s.iat)),expirationTime:Nb(yk(s.exp
604)),signInProvider:o||null,signInSecondFactor:(a==null?void 0:a.sign_in_second_factor)||null}}function yk(n){return Number(n)*1e3}function jD(n){const[e,t,r]=n.split(".");if(e===void 0||t===void 0||r===void 0)return Zw("JWT malformed, contained fewer than 3 sections"),null;try{const s=x$(t);return s?JSON.parse(s):(Zw("Failed to decode base64 JWT payload"),null)}catch(s){return Zw("Caught error parsing JWT payload as JSON",s==null?void 0:s.toString()),null}}function ZM(n){const e=jD(n);return Lt(e,"internal-error"),Lt(typeof e.exp<"u","internal-error"),Lt(typeof e.iat<"u","internal-error"),Number(e.exp)-Number(e.iat)}/**
605 * @license
606 * Copyright 2020 Google LLC
607 *
608 * Licensed under the Apache License, Version 2.0 (the "License");
609 * you may not use this file except in compliance with the License.
610 * You may obtain a copy of the License at
611 *
612 *   http://www.apache.org/licenses/LICENSE-2.0
613 *
614 * Unless required by applicable law or agreed to in writing, software
615 * distributed under the License is distributed on an "AS IS" BASIS,
616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
617 * See the License for the specific language governing permissions and
618 * limitations under the License.
619 */async function z0(n,e,t=!1){if(t)return e;try{return await e}catch(r){throw r instanceof Zd&&zse(r)&&n.auth.currentUser===n&&await n.auth.signOut(),r}}function zse({code:n}){return n==="auth/user-disabled"||n==="auth/user-token-expired"}/**
620 * @license
621 * Copyright 2020 Google LLC
622 *
623 * Licensed under the Apache License, Version 2.0 (the "License");
624 * you may not use this file except in compliance with the License.
625 * You may obtain a copy of the License at
626 *
627 *   http://www.apache.org/licenses/LICENSE-2.0
628 *
629 * Unless required by applicable law or agreed to in writing, software
630 * distributed under the License is distributed on an "AS IS" BASIS,
631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
632 * See the License for the specific language governing permissions and
633 * limitations under the License.
634 */class qse{constructor(e){this.user=e,this.isRunning=!1,this.timerId=null,this.errorBackoff=3e4}_start(){this.isRunning||(this.isRunning=!0,this.schedule())}_stop(){this.isRunning&&(this.isRunning=!1,this.timerId!==null&&clearTimeout(this.timerId))}getInterval(e){if(e){const t=this.errorBackoff;return this.errorBackoff=Math.min(this.errorBackoff*2,96e4),t}else{this.errorBackoff=3e4;const r=(this.user.stsTokenManager.expirationTime??0)-Date.now()-3e5;return Math.max(0,r)}}schedule(e=!1){if(!this.isRunning)return;const t=this.getInterval(e);this.timerId=setTimeout(async()=>{await this.iteration()},t)}async iteration(){try{await this.user.getIdToken(!0)}catch(e){(e==null?void 0:e.code)==="auth/network-request-failed"&&this.schedule(!0);return}this.schedule()}}/**
635 * @license
636 * Copyright 2020 Google LLC
637 *
638 * Licensed under the Apache License, Version 2.0 (the "License");
639 * you may not use this file except in compliance with the License.
640 * You may obtain a copy of the License at
641 *
642 *   http://www.apache.org/licenses/LICENSE-2.0
643 *
644 * Unless required by applicable law or agreed to in writing, software
645 * distributed under the License is distributed on an "AS IS" BASIS,
646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
647 * See the License for the specific language governing permissions and
648 * limitations under the License.
649 */class m_{constructor(e,t){this.createdAt=e,this.lastLoginAt=t,this._initializeTime()}_initializeTime(){this.lastSignInTime=Nb(this.lastLoginAt),this.creationTime=Nb(this.createdAt)}_copy(e){this.createdAt=e.createdAt,this.lastLoginAt=e.lastLoginAt,this._initializeTime()}toJSON(){return{createdAt:this.createdAt,lastLoginAt:this.lastLoginAt}}}/**
650 * @license
651 * Copyright 2019 Google LLC
652 *
653 * Licensed under the Apache License, Version 2.0 (the "License");
654 * you may not use this file except in compliance with the License.
655 * You may obtain a copy of the License at
656 *
657 *   http://www.apache.org/licenses/LICENSE-2.0
658 *
659 * Unless required by applicable law or agreed to in writing, softw
659are
660 * distributed under the License is distributed on an "AS IS" BASIS,
661 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
662 * See the License for the specific language governing permissions and
663 * limitations under the License.
664 */async function UC(n){var m;const e=n.auth,t=await n.getIdToken(),r=await z0(n,FC(e,{idToken:t}));Lt(r==null?void 0:r.users.length,e,"internal-error");const s=r.users[0];n._notifyReloadListener(s);const a=(m=s.providerUserInfo)!=null&&m.length?O$(s.providerUserInfo):[],o=Wse(n.providerData,a),l=n.isAnonymous,c=!(n.email&&s.passwordHash)&&!(o!=null&&o.length),d=l?c:!1,h={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:o,metadata:new m_(s.createdAt,s.lastLoginAt),isAnonymous:d};Object.assign(n,h)}async function Kse(n){const e=Yn(n);await UC(e),await e.auth._persistUserIfCurrent(e),e.auth._notifyListenersIfCurrent(e)}function Wse(n,e){return[...n.filter(r=>!e.some(s=>s.providerId===r.providerId)),...e]}function O$(n){return n.map(({providerId:e,...t})=>({providerId:e,uid:t.rawId||"",displayName:t.displayName||null,email:t.email||null,phoneNumber:t.phoneNumber||null,photoURL:t.photoUrl||null}))}/**
665 * @license
666 * Copyright 2020 Google LLC
667 *
668 * Licensed under the Apache License, Version 2.0 (the "License");
669 * you may not use this file except in compliance with the License.
670 * You may obtain a copy of the License at
671 *
672 *   http://www.apache.org/licenses/LICENSE-2.0
673 *
674 * Unless required by applicable law or agreed to in writing, software
675 * distributed under the License is distributed on an "AS IS" BASIS,
676 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
677 * See the License for the specific language governing permissions and
678 * limitations under the License.
679 */async function Yse(n,e){const t=await P$(n,{},async()=>{const r=Wy({grant_type:"refresh_token",refresh_token:e}).slice(1),{tokenApiHost:s,apiKey:a}=n.config,o=await L$(n,s,"/v1/token",`key=${a}`),l=await n._getAdditionalHeaders();l["Content-Type"]="application/x-www-form-urlencoded";const c={method:"POST",headers:l,body:r};return n.emulatorConfig&&Ng(n.emulatorConfig.host)&&(c.credentials="include"),R$.fetch()(o,c)});return{accessToken:t.access_token,expiresIn:t.expires_in,refreshToken:t.refresh_token}}async function Qse(n,e){return eu(n,"POST","/v2/accounts:revokeToken",Hh(n,e))}/**
680 * @license
681 * Copyright 2020 Google LLC
682 *
683 * Licensed under the Apache License, Version 2.0 (the "License");
684 * you may not use this file except in compliance with the License.
685 * You may obtain a copy of the License at
686 *
687 *   http://www.apache.org/licenses/LICENSE-2.0
688 *
689 * Unless required by applicable law or agreed to in writing, software
690 * distributed under the License is distributed on an "AS IS" BASIS,
691 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
692 * See the License for the specific language governing permissions and
693 * limitations under the License.
694 */class _0{constructor(){this.refreshToken=null,this.accessToken=null,this.expirationTime=null}get isExpired(){return!this.expirationTime||Date.now()>this.expirationTime-3e4}updateFromServerResponse(e){Lt(e.idToken,"internal-error"),Lt(typeof e.idToken<"u","internal-error"),Lt(typeof e.refreshToken<"u","internal-error");const t="expiresIn"in e&&typeof e.expiresIn<"u"?Number(e.expiresIn):ZM(e.idToken);this.updateTokensAndExpiration(e.idToken,e.refreshToken,t)}updateFromIdToken(e){Lt(e.length!==0,"internal-error");const t=ZM(e);this.updateTokensAndExpiration(e,null,t)}async getToken(e,t=!1){return!t&&this.accessToken&&!this.isExpired?this.accessToken:(Lt(this.refreshToken,e,"user-token-expired"),this.refreshToken?(await this.refresh(e,this.refreshToken),this.accessToken):null)}clearRefreshToken(){this.refreshToken=null}async refresh(e,t){const{accessToken:r,refreshToken:s,expiresIn:a}=await Yse(e,t);this.updateTokensAndExpiration(r,s,Number(a))}updateTokensAndExpiration(e,t,r){this.refreshToken=t||null,this.accessToken=e||null,this.expirationTime=Date.now()+r*1e3}static fromJSON(e,t){const{refreshToken:r,accessToken:s,expirationTime:a}=t,o=new _0;return r&&(Lt(typeof r=="string","internal-error",{appName:e}),o.refreshToken=r),s&&(Lt(typeof s=="string","internal-error",{appName:e}),o.accessToken=s),a&&(Lt(typeof a=="number","internal-error",{appName:e}),o.expirationTime=a),o}toJSON(){return{refreshToken:this.refreshToken,accessToken:this.accessToken,expirationTime:this.expirationTime}}_assign(e){this.accessToken=e.accessToken,this.refreshToken=e.refreshToken,this.expirationTime=e.expirationTime}_clone(){return Object.assign(new _0,this.toJSON())}_performRefresh(){return Nd("not implemented")}}/**
695 * @license
696 * Copyright 2020 Google LLC
697 *
698 * Licensed under the Apache License, Version 2.0 (the "License");
699 * you may not use this file except in compliance with the License.
700 * You may obtain a copy of the License at
701 *
702 *   http://www.apache.org/licenses/LICENSE-2.0
703 *
704 * Unless required by applicable law or agreed to in writing, software
705 * distributed under the License is distributed on an "AS IS" BASIS,
706 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
707 * See the License for the specific language governing permissions and
708 * limitations under the License.
709 */function Mu(n,e){Lt(typeof n=="string"||typeof n>"u","internal-error",{appName:e})}class Pl{constructor({uid:e,auth:t,stsTokenManager:r,...s}){this.providerId="firebase",this.proactiveRefresh=new qse(this),this.reloadUserInfo=null,this.reloadListener=null,this.uid=e,this.auth=t,this.stsTokenManager=r,this.accessToken=r.accessToken,this.displayName=s.displayName||null,this.email=s.email||null,this.emailVerified=s.emailVerified||!1,this.phoneNumber=s.phoneNumber||null,this.photoURL=s.photoURL||null,this.isAnonymous=s.isAnonymous||!1,this.tenantId=s.tenantId||null,this.providerData=s.providerData?[...s.providerData]:[],this.metadata=new m_(s.createdAt||void 0,s.lastLoginAt||void 0)}async getIdToken(e){const t=await z0(this,this.stsTokenManager.getToken(this.auth,e));return Lt(t,this.auth,"internal-error"),this.accessToken!==t&&(this.accessToken=t,await this.auth._persistUserIfCurrent(this),this.auth._notifyListenersIfCurrent(this)),t}getIdTokenResult(e){return Hse(this,e)}reload(){return Kse(this)}_assign(e){this!==e&&(Lt(this.uid===e.uid,this.auth,"internal-error"),this.displayName=e.displayName,this.photoURL=e.photoURL,this.email=e.email,this.emailVerified=e.emailVerified,this.phoneNumber=e.phoneNumber,this.isAnonymous=e.isAnonymous,this.tenantId=e.tenantId,this.providerData=e.providerData.map(t=>({...t})),this.metadata._copy(e.metadata),this.stsTokenManager._assign(e.stsTokenManager))}_clone(e){const t=new Pl({...this,auth:e,stsTokenManager:this.stsTokenManager._clone()});return t.metadata._copy(this.metadata),t}_onReload(e){Lt(!this.reloadListener,this.auth,"internal-error"),this.reloadListener=e,this.reloadUserInfo&&(this._notifyReloadListener(this.reloadUserInfo),this.reloadUserInfo=null)}_notifyReloadListener(e){this.reloadListener?this.reloadListener(e):this.reloadUserInfo=e}_startProactiveRefresh(){this.proactiveRefresh._start()}_stopProactiveRefresh(){this.proactiveRefresh._stop()}async _updateTokensIfNecessary(e,t=!1){let r=!1;e.idToken&&e.idToken!==this.stsTokenManager.accessToken&&(this.stsTokenManager.updateFromServerResponse(e),r=!0),t&&await UC(this),await this.auth._persistUserIfCurrent(this),r&&this.auth._notifyListenersIfCurrent(this)}async delete(){if(xo(this.auth.app))return Promise.reject(Pd(this.auth));const e=await this.getIdToken();return await z0(this,$se(this.auth,{idToken:e})),this.stsTokenManager.clearRefreshToken(),this.auth.signOut()}toJSON(){return{uid:this.uid,email:this.email||void 0,emailVerified:this.emailVerified,displayName:this.displayName||void 0,isAnonymous:this.isAnonymous,photoURL:this.photoURL||void 0,phoneNumber:this.phoneNumber||void 0,tenantId:this.tenantId||void 0,providerData:this.providerData.map(e=>({...e})),stsTokenManager:this.stsTokenManager.toJSON(),_redirectEventId:this._redirectEventId,...this.metadata.toJSON(),apiKey:this.auth.config.apiKey,appName:this.auth.name}}get refreshToken(){return this.stsTokenManager.refreshToken||""}static _fromJSON(e,t){const r=t.displayName??void 0,s=t.email??void 0,a=t.phoneNumber??void 0,o=t.photoURL??void 0,l=t.tenantId??void 0,c=t._redirectEventId??void 0,d=t.createdAt??void 0,h=t.lastLoginAt??void 0,{uid:m,emailVerified:p,isAnonymous:x,providerData:y,stsTokenManager:v}=t;Lt(m&&v,e,"internal-error");const B=_0.fromJSON(this.name,v);Lt(typeof m=="string",e,"internal-error"),Mu(r,e.name),Mu(s,e.name),Lt(typeof p=="boolean",e,"internal-error"),Lt(typeof x=="boolean",e,"internal-error"),Mu(a,e.name),Mu(o,e.name),Mu(l,e.name),Mu(c,e.name),Mu(d,e.name),Mu(h,e.name);const E=new Pl({uid:m,auth:e,email:s,emailVerified:p,displayName:r,isAnonymous:x,photoURL:o,phoneNumber:a,tenantId:l,stsTokenManager:B,createdAt:d,lastLoginAt:h});return y&&Array.isArray(y)&&(E.providerData=y.map(N=>({...N}))),c&&(E._redirectEventId=c),E}static async _fromIdTokenResponse(e,t,r=!1){const s=new _0;s.updateFromServerResponse(t);const a=new Pl({uid:t.localId,auth:e,stsTokenManager:s,isAnonymous:r});return await UC(a),a}static async _fromGetAccountInfoResponse(e,t,r){const s=t.users[0];Lt(s.localId!==void 0,"internal-error");const a=s.providerUserInfo!==void 0?O$(s.providerUserInfo):[],o=!(s.email&&s.passwordHash)&&!(a!=null&&a.length),l=new _0;l.updateFromIdToken(r);const c=new Pl({uid:s.localId,auth:e,stsTokenManager:l,isAnonymous:o}),d={uid:s.localId,displayName:s.displayName||null,photoURL:s.photoUrl||null,email:s.email||null,emailVerified:s.emailVerified||!1,phoneNumber:s.phoneNumber||null,tenantId:s.tenantId||null,providerData:a,metadata:new m_(s.createdAt,s.lastLoginAt),isAnonymous:!(s.email&&s.passwordHash)&&!(a!=null&&a.length)};return Object.assign(c,d),c}}/**
710 * @license
711 * Copyright 2020 Google LLC
712 *
713 * Licensed under the Apache License, Version 2.0 (the "License");
714 * you may not use this file except in compliance with the License.
715 * You may obtain a copy of the License at
716 *
717 *   http://www.apache.org/licenses/LICENSE-2.0
718 *
719 * Unless required by applicable law or agreed to in writing, software
720 * distributed under the License is distributed on an "AS IS" BASIS,
721 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
722 * See the License for the specific language governing permissions and
723 * limitations under the License.
724 */const e3=new Map;function _d(n){Gd(n instanceof Function,"Expected a class definition");let e=e3.get(n);return e?(Gd(e instanceof n,"Instance stored in cache mismatched with class"),e):(e=new n,e3.set(n,e),e)}/**
725 * @license
726 * Copyright 2019 Google LLC
727 *
728 * Licensed under the Apache License, Version 2.0 (the "License");
729 * you may not use this file except in compliance with the License.
730 * You may obtain a copy of the License at
731 *
732 *   http://www.apache.org/licenses/LICENSE-2.0
733 *
734 * Unless required by applicable law or agreed to in writing, software
735 * distributed under the License is distributed on an "AS IS" BASIS,
736 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
737 * See the License for the specific language governing permissions and
738 * limitations under the License.
739 */class M${constructor(){this.type="NONE",this.storage={}}async _isAvailable(){return!0}async _set(e,t){this.storage[e]=t}async _get(e){const t=this.storage[e];return t===void 0?null:t}async _remove(e){delete this.storage[e]}_addListener(e,t){}_removeListener(e,t){}}M$.type="NONE";const t3=M$;/**
740 * @license
741 * Copyright 2019 Google LLC
742 *
743 * Licensed under the Apache License, Version 2.0 (the "License");
744 * you may not use this file except in compliance with the License.
745 * You may obtain a copy of the License at
746 *
747 *   http://www.apache.org/licenses/LICENSE-2.0
748 *
749 * Unless required by applicable law or agreed to in writing, software
750 * distributed under the License is distributed on an "AS IS" BASIS,
751 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
752 * See the License for the specific language governing permissions and
753 * limitations under the License.
754 */function eC(n,e,t){return`firebase:${n}:${e}:${t}`}class om{constructor(e,t,r){this.persistence=e,this.auth=t,this.userKey=r;const{config:s,name:a}=this.auth;this.fullUserKey=eC(this.userKey,s.apiKey,a),this.fullPersistenceKey=eC("persistence",s.apiKey,a),this.boundEventHandler=t._onStorageEvent.bind(t);try{this.persistence._addListener(this.fullUserKey,this.boundEventHandler)}catch{}}setCurrentUser(e){return this.persistence._set(this.fullUserKey,e.toJSON())}async getCurrentUser(){const e=await this.persistence._get(this.fullUserKey);if(!e)return null;if(typeof e=="string"){const t=await FC(this.auth,{idToken:e}).catch(()=>{});return t?Pl._fromGetAccountInfoResponse(this.auth,t,e):null}return Pl._fromJSON(this.auth,e)}removeCurrentUser(){return this.persistence._remove(this.fullUserKey)}savePersistenceForRedirect(){return this.persistence._set(this.fullPersistenceKey,this.persistence.type)}async setPersistence(e){if(this.persistence===e)return;const t=await this.getCurrentUser();if(await this.removeCurrentUser(),this.persistence=e,t)return this.setCurrentUser(t)}delete(){try{this.persistence._removeListener(this.fullUserKey,this.boundEventHandler)}catch{}}static async create(e,t,r="authUser"){if(!t.length)return new om(_d(t3),e,r);const s=(await Promise.all(t.map(async d=>{try{if(await d._isAvailable())return d}catch{return}}))).filter(d=>d);let a=s[0]||_d(t3);const o=eC(r,e.config.apiKey,e.name);let l=null;for(const d of t)try{const h=await d._get(o);if(h){let m;if(typeof h=="string"){const p=await FC(e,{idToken:h}).catch(()=>{});if(!p)break;m=await Pl._fromGetAccountInfoResponse(e,p,h)}else m=Pl._fromJSON(e,h);d!==a&&(l=m),a=d;break}}catch{}const c=s.filter(d=>d._shouldAllowMigration);return!a._shouldAllowMigration||!c.length?new om(a,e,r):(a=c[0],l&&await a._set(o,l.toJSON()),await Promise.all(t.map(async d=>{if(d!==a)try{await d._remove(o)}catch{}})),new om(a,e,r))}}/**
755 * @license
756 * Copyright 2020 Google LLC
757 *
758 * Licensed under the Apache License, Version 2.0 (the "License");
759 * you may not use this file except in compliance with the License.
760 * You may obtain a copy of the License at
761 *
762 *   http://www.apache.org/licenses/LICENSE-2.0
763 *
764 * Unless required by applicable law or agreed to in writing, software
765 * distributed under the License is distributed on an "AS IS" BASIS,
766 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
767 * See the License for the specific language governing permissions and
768 * limitations under the License.
769 */function n3(n){const e=n.toLowerCase();if(e.includes("opera/")||e.includes("opr/")||e.includes("opios/"))return"Opera";if(G$(e))return"IEMobile";if(e.includes("msie")||e.includes("trident/"))return"IE";if(e.includes("edge/"))return"Edge";if(F$(e))return"Firefox";if(e.includes("silk/"))return"Silk";if(H$(e))return"Blackberry";if(z$(e))return"Webos";if(U$(e))return"Safari";if((e.includes("chrome/")||V$(e))&&!e.includes("edge/"))return"Chrome";if($$(e))return"Android";{const t=/([a-zA-Z\d\.]+)\/[a-zA-Z\d\.]*$/,r=n.match(t);if((r==null?void 0:r.length)===2)return r[1]}return"Other"}function F$(n=Js()){return/firefox\//i.test(n)}function U$(n=Js()){const e=n.toLowerCase();return e.includes("safari/")&&!e.includes("chrome/")&&!e.includes("crios/")&&!e.includes("android")}function V$(n=Js()){return/crios\//i.test(n)}function G$(n=Js()){return/iemobile/i.test(n)}function $$(n=Js()){return/android/i.test(n)}function H$(n=Js()){return/blackberry/i.test(n)}function z$(n=Js()){return/webos/i.test(n)}function RD(n=Js()){return/iphone|ipad|ipod/i.test(n)||/macintosh/i.test(n)&&/mobile/i.test(n)}function Jse(n=Js()){var e;return RD(n)&&!!((e=window.navigator)!=null&&e.standalone)}function Xse(){return fre()&&document.documentMode===10}function q$(n=Js()){return RD(n)||$$(n)||z$(n)||H$(n)||/windows phone/i.test(n)||G$(n)}/**
770 * @license
771 * Copyright 2020 Google LLC
772 *
773 * Licensed under the Apache License, Version 2.0 (the "License");
774 * you may not use this file except in compliance with the License.
775 * You may obtain a copy of the License at
776 *
777 *   http://www.apache.org/licenses/LICENSE-2.0
778 *
779 * Unless required by applicable law or agreed to in writing, software
780 * distributed under the License is distributed on an "AS IS" BASIS,
781 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
782 * See the License for the specific language governing permissions and
783 * limitations under the License.
784 */function K$(n,e=[]){let t;switch(n){case"Browser":t=n3(Js());break;case"Worker":t=`${n3(Js())}-${n}`;break;default:t=n}const r=e.length?e.join(","):"FirebaseCore-web";return`${t}/JsCore/${_g}/${r}`}/**
785 * @license
786 * Copyright 2022 Google LLC
787 *
788 * Licensed under the Apache License, Version 2.0 (the "License");
789 * you may not use this file except in compliance with the License.
790 * You may obtain a copy of the License at
791 *
792 *   http://www.apache.org/licenses/LICENSE-2.0
793 *
794 * Unless required by applicable law or agreed to in writing, software
795 * distributed under the License is distributed on an "AS IS" BASIS,
796 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
797 * See the License for the specific language governing permissions and
798 * limitations under the License.
799 */class Zse{constructor(e){this.auth=e,this.queue=[]}pushCallback(e,t){const r=a=>new Promise((o,l)=>{try{const c=e(a);o(c)}catch(c){l(c)}});r.onAbort=t,this.queue.push(r);const s=this.queue.length-1;return()=>{this.queue[s]=()=>Promise.resolve()}}async runMiddleware(e){if(this.auth.currentUser===e)return;const t=[];try{for(const r of this.queue)await r(e),r.onAbort&&t.push(r.onAbort)}catch(r){t.reverse();for(const s of t)try{s()}catch{}throw this.auth._errorFactory.create("login-blocked",{originalMessage:r==null?void 0:r.message})}}}/**
800 * @license
801 * Copyright 2023 Google LLC
802 *
803 * Licensed under the Apache License, Version 2.0 (the "License");
804 * you may not use this file except in compliance with the License.
805 * You may obtain a copy of the License at
806 *
807 *   http://www.apache.org/licenses/LICENSE-2.0
808 *
809 * Unless required by applicable law or agreed to in writing, softw
809are
810 * distributed under the License is distributed on an "AS IS" BASIS,
811 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
812 * See the License for the specific language governing permissions and
813 * limitations under the License.
814 */async function eae(n,e={}){return eu(n,"GET","/v2/passwordPolicy",Hh(n,e))}/**
815 * @license
816 * Copyright 2023 Google LLC
817 *
818 * Licensed under the Apache License, Version 2.0 (the "License");
819 * you may not use this file except in compliance with the License.
820 * You may obtain a copy of the License at
821 *
822 *   http://www.apache.org/licenses/LICENSE-2.0
823 *
824 * Unless required by applicable law or agreed to in writing, software
825 * distributed under the License is distributed on an "AS IS" BASIS,
826 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
827 * See the License for the specific language governing permissions and
828 * limitations under the License.
829 */const tae=6;class nae{constructor(e){var r;const t=e.customStrengthOptions;this.customStrengthOptions={},this.customStrengthOptions.minPasswordLength=t.minPasswordLength??tae,t.maxPasswordLength&&(this.customStrengthOptions.maxPasswordLength=t.maxPasswordLength),t.containsLowercaseCharacter!==void 0&&(this.customStrengthOptions.containsLowercaseLetter=t.containsLowercaseCharacter),t.containsUppercaseCharacter!==void 0&&(this.customStrengthOptions.containsUppercaseLetter=t.containsUppercaseCharacter),t.containsNumericCharacter!==void 0&&(this.customStrengthOptions.containsNumericCharacter=t.containsNumericCharacter),t.containsNonAlphanumericCharacter!==void 0&&(this.customStrengthOptions.containsNonAlphanumericCharacter=t.containsNonAlphanumericCharacter),this.enforcementState=e.enforcementState,this.enforcementState==="ENFORCEMENT_STATE_UNSPECIFIED"&&(this.enforcementState="OFF"),this.allowedNonAlphanumericCharacters=((r=e.allowedNonAlphanumericCharacters)==null?void 0:r.join(""))??"",this.forceUpgradeOnSignin=e.forceUpgradeOnSignin??!1,this.schemaVersion=e.schemaVersion}validatePassword(e){const t={isValid:!0,passwordPolicy:this};return this.validatePasswordLengthOptions(e,t),this.validatePasswordCharacterOptions(e,t),t.isValid&&(t.isValid=t.meetsMinPasswordLength??!0),t.isValid&&(t.isValid=t.meetsMaxPasswordLength??!0),t.isValid&&(t.isValid=t.containsLowercaseLetter??!0),t.isValid&&(t.isValid=t.containsUppercaseLetter??!0),t.isValid&&(t.isValid=t.containsNumericCharacter??!0),t.isValid&&(t.isValid=t.containsNonAlphanumericCharacter??!0),t}validatePasswordLengthOptions(e,t){const r=this.customStrengthOptions.minPasswordLength,s=this.customStrengthOptions.maxPasswordLength;r&&(t.meetsMinPasswordLength=e.length>=r),s&&(t.meetsMaxPasswordLength=e.length<=s)}validatePasswordCharacterOptions(e,t){this.updatePasswordCharacterOptionsStatuses(t,!1,!1,!1,!1);let r;for(let s=0;s<e.length;s++)r=e.charAt(s),this.updatePasswordCharacterOptionsStatuses(t,r>="a"&&r<="z",r>="A"&&r<="Z",r>="0"&&r<="9",this.allowedNonAlphanumericCharacters.includes(r))}updatePasswordCharacterOptionsStatuses(e,t,r,s,a){this.customStrengthOptions.containsLowercaseLetter&&(e.containsLowercaseLetter||(e.containsLowercaseLetter=t)),this.customStrengthOptions.containsUppercaseLetter&&(e.containsUppercaseLetter||(e.containsUppercaseLetter=r)),this.customStrengthOptions.containsNumericCharacter&&(e.containsNumericCharacter||(e.containsNumericCharacter=s)),this.customStrengthOptions.containsNonAlphanumericCharacter&&(e.containsNonAlphanumericCharacter||(e.containsNonAlphanumericCharacter=a))}}/**
830 * @license
831 * Copyright 2020 Google LLC
832 *
833 * Licensed under the Apache License, Version 2.0 (the "License");
834 * you may not use this file except in compliance with the License.
835 * You may obtain a copy of the License at
836 *
837 *   http://www.apache.org/licenses/LICENSE-2.0
838 *
839 * Unless required by applicable law or agreed to in writing, software
840 * distributed under the License is distributed on an "AS IS" BASIS,
841 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
842 * See the License for the specific language governing permissions and
843 * limitations under the License.
844 */class rae{constructor(e,t,r,s){this.app=e,this.heartbeatServiceProvider=t,this.appCheckServiceProvider=r,this.config=s,this.currentUser=null,this.emulatorConfig=null,this.operations=Promise.resolve(),this.authStateSubscription=new r3(this),this.idTokenSubscription=new r3(this),this.beforeStateQueue=new Zse(this),this.redirectUser=null,this.isProactiveRefreshEnabled=!1,this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION=1,this._canInitEmulator=!0,this._isInitialized=!1,this._deleted=!1,this._initializationPromise=null,this._popupRedirectResolver=null,this._errorFactory=j$,this._agentRecaptchaConfig=null,this._tenantRecaptchaConfigs={},this._projectPasswordPolicy=null,this._tenantPasswordPolicies={},this._resolvePersistenceManagerAvailable=void 0,this.lastNotifiedUid=void 0,this.languageCode=null,this.tenantId=null,this.settings={appVerificationDisabledForTesting:!1},this.frameworks=[],this.name=e.name,this.clientVersion=s.sdkClientVersion,this._persistenceManagerAvailable=new Promise(a=>this._resolvePersistenceManagerAvailable=a)}_initializeWithPersistence(e,t){return t&&(this._popupRedirectResolver=_d(t)),this._initializationPromise=this.queue(async()=>{var r,s,a;if(!this._deleted){try{this.persistenceManager=await om.create(this,e)}catch(o){Xw(`Failed to initialize persistence: ${o}`),this.persistenceManager=await om.create(this,[])}finally{(r=this._resolvePersistenceManagerAvailable)==null||r.call(this)}if(!this._deleted){if((s=this._popupRedirectResolver)!=null&&s._shouldInitProactively)try{await this._popupRedirectResolver._initialize(this)}catch{}try{await this.initializeCurrentUser(t)}catch(o){Xw(`Failed to initialize current user: ${o}
844`),await this.directlySetCurrentUser(null).catch(()=>{})}this.lastNotifiedUid=((a=this.currentUser)==null?void 0:a.uid)||null,!this._deleted&&(this._isInitialized=!0)}}}),this._initializationPromise}async _onStorageEvent(){if(this._deleted)return;const e=await this.assertedPersistence.getCurrentUser();if(!(!this.currentUser&&!e)){if(this.currentUser&&e&&this.currentUser.uid===e.uid){this._currentUser._assign(e),await this.currentUser.getIdToken();return}await this._updateCurrentUser(e,!0)}}async initializeCurrentUserFromIdToken(e){try{const t=await FC(this,{idToken:e}),r=await Pl._fromGetAccountInfoResponse(this,t,e);await this.directlySetCurrentUser(r)}catch(t){console.warn("FirebaseServerApp could not login user with provided authIdToken: ",t),await this.directlySetCurrentUser(null)}}async initializeCurrentUser(e){var a;if(xo(this.app)){const o=this.app.settings.authIdToken;return o?new Promise(l=>{setTimeout(()=>this.initializeCurrentUserFromIdToken(o).then(l,l))}):this.directlySetCurrentUser(null)}const t=await this.assertedPersistence.getCurrentUser();let r=t,s=!1;if(e&&this.config.authDomain){await this.getOrInitRedirectPersistenceManager();const o=(a=this.redirectUser)==null?void 0:a._redirectEventId,l=r==null?void 0:r._redirectEventId,c=await this.tryRedirectSignIn(e);(!o||o===l)&&(c!=null&&c.user)&&(r=c.user,s=!0)}if(!r)return this.directlySetCurrentUser(null);if(!r._redirectEventId){if(s)try{await this.beforeStateQueue.runMiddleware(r)}catch(o){r=t,this._popupRedirectResolver._overrideRedirectResult(this,()=>Promise.reject(o))}return r?this.reloadAndSetCurrentUserOrClear(r):this.directlySetCurrentUser(null)}return Lt(this._popupRedirectResolver,this,"argument-error"),await this.getOrInitRedirectPersistenceManager(),this.redirectUser&&this.redirectUser._redirectEventId===r._redirectEventId?this.directlySetCurrentUser(r):this.reloadAndSetCurrentUserOrClear(r)}async tryRedirectSignIn(e){let t=null;try{t=await this._popupRedirectResolver._completeRedirectFn(this,e,!0)}catch{await this._setRedirectUser(null)}return t}async reloadAndSetCurrentUserOrClear(e){try{await UC(e)}catch(t){if((t==null?void 0:t.code)!=="auth/network-request-failed")return this.directlySetCurrentUser(null)}return this.directlySetCurrentUser(e)}useDeviceLanguage(){this.languageCode=Pse()}async _delete(){this._deleted=!0}async updateCurrentUser(e){if(xo(this.app))return Promise.reject(Pd(this));const t=e?Yn(e):null;return t&&Lt(t.auth.config.apiKey===this.config.apiKey,this,"invalid-user-token"),this._updateCurrentUser(t&&t._clone(this))}async _updateCurrentUser(e,t=!1){if(!this._deleted)return e&&Lt(this.tenantId===e.tenantId,this,"tenant-id-mismatch"),t||await this.beforeStateQueue.runMiddleware(e),this.queue(async()=>{await this.directlySetCurrentUser(e),this.notifyAuthListeners()})}async signOut(){return xo(this.app)?Promise.reject(Pd(this)):(await this.beforeStateQueue.runMiddleware(null),(this.redirectPersistenceManager||this._popupRedirectResolver)&&await this._setRedirectUser(null),this._updateCurrentUser(null,!0))}setPersistence(e){return xo(this.app)?Promise.reject(Pd(this)):this.queue(async()=>{await this.assertedPersistence.setPersistence(_d(e))})}_getRecaptchaConfig(){return this.tenantId==null?this._agentRecaptchaConfig:this._tenantRecaptchaConfigs[this.tenantId]}async validatePassword(e){this._getPasswordPolicyInternal()||await this._updatePasswordPolicy();const t=this._getPasswordPolicyInternal();return t.schemaVersion!==this.EXPECTED_PASSWORD_POLICY_SCHEMA_VERSION?Promise.reject(this._errorFactory.create("unsupported-password-policy-schema-version",{})):t.validatePassword(e)}_getPasswordPolicyInternal(){return this.tenantId===null?this._projectPasswordPolicy:this._tenantPasswordPolicies[this.tenantId]}async _updatePasswordPolicy(){const e=await eae(this),t=new nae(e);this.tenantId===null?this._projectPasswordPolicy=t:this._tenantPasswordPolicies[this.tenantId]=t}_getPersistenceType(){return this.assertedPersistence.persistence.type}_getPersistence(){return this.assertedPersistence.persistence}_updateErrorMap(e){this._errorFactory=new Ky("auth","Firebase",e())}onAuthStateChanged(e,t,r){return this.registerStateListener(this.authStateSubscription,e,t,r)}beforeAuthStateChanged(e,t){return this.beforeStateQueue.pushCallback(e,t)}onIdTokenChanged(e,t,r){return this.registerStateListener(this.idTokenSubscription,e,t,r)}authStateReady(){return new Promise((e,t)=>
844{if(this.currentUser)e();else{const r=this.onAuthStateChanged(()=>{r(),e()},t)}})}async revokeAccessToken(e){if(this.currentUser){const t=await this.currentUser.getIdToken(),r={providerId:"apple.com",tokenType:"ACCESS_TOKEN",token:e,idToken:t};this.tenantId!=null&&(r.tenantId=this.tenantId),await Qse(this,r)}}toJSON(){var e;return{apiKey:this.config.apiKey,authDomain:this.config.authDomain,appName:this.name,currentUser:(e=this._currentUser)==null?void 0:e.toJSON()}}async _setRedirectUser(e,t){const r=await this.getOrInitRedirectPersistenceManager(t);return e===null?r.removeCurrentUser():r.setCurrentUser(e)}async getOrInitRedirectPersistenceManager(e){if(!this.redirectPersistenceManager){const t=e&&_d(e)||this._popupRedirectResolver;Lt(t,this,"argument-error"),this.redirectPersistenceManager=await om.create(this,[_d(t._redirectPersistence)],"redirectUser"),this.redirectUser=await this.redirectPersistenceManager.getCurrentUser()}return this.redirectPersistenceManager}async _redirectUserForId(e){var t,r;return this._isInitialized&&await this.queue(async()=>{}),((t=this._currentUser)==null?void 0:t._redirectEventId)===e?this._currentUser:((r=this.redirectUser)==null?void 0:r._redirectEventId)===e?this.redirectUser:null}async _persistUserIfCurrent(e){if(e===this.currentUser)return this.queue(async()=>this.directlySetCurrentUser(e))}_notifyListenersIfCurrent(e){e===this.currentUser&&this.notifyAuthListeners()}_key(){return`${this.config.authDomain}:${this.config.apiKey}:${this.name}`}_startProactiveRefresh(){this.isProactiveRefreshEnabled=!0,this.currentUser&&this._currentUser._startProactiveRefresh()}_stopProactiveRefresh(){this.isProactiveRefreshEnabled=!1,this.currentUser&&this._currentUser._stopProactiveRefresh()}get _currentUser(){return this.currentUser}notifyAuthListeners(){var t;if(!this._isInitialized)return;this.idTokenSubscription.next(this.currentUser);const e=((t=this.currentUser)==null?void 0:t.uid)??null;this.lastNotifiedUid!==e&&(this.lastNotifiedUid=e,this.authStateSubscription.next(this.currentUser))}registerStateListener(e,t,r,s){if(this._deleted)return()=>{};const a=typeof t=="function"?t:t.next.bind(t);let o=!1;const l=this._isInitialized?Promise.resolve():this._initializationPromise;if(Lt(l,this,"internal-error"),l.then(()=>{o||a(this.currentUser)}).catch(c=>{if(!o)if(typeof t!="function"&&t.error)t.error(c);else if(r)r(c);else throw c}),typeof t=="function"){const c=e.addObserver(t,r,s);return()=>{o=!0,c()}}else{const c=e.addObserver(t);return()=>{o=!0,c()}}}async directlySetCurrentUser(e){if(this.currentUser&&this.currentUser!==e&&this._currentUser._stopProactiveRefresh(),e&&this.isProactiveRefreshEnabled&&e._startProactiveRefresh(),this.currentUser=e,this.persistenceManager)try{e?await this.persistenceManager.setCurrentUser(e):await this.persistenceManager.removeCurrentUser()}catch(t){const r=(t==null?void 0:t.message)||String(t),s=E1(this,"internal-error",`An internal AuthError has occurred: ${r}`);throw s.customData={originalError:t},s}}queue(e){return this.operations=this.operations.then(e,e),this.operations}get assertedPersistence(){return Lt(this.persistenceManager,this,"internal-error"),this.persistenceManager}_logFramework(e){!e||this.frameworks.includes(e)||(this.frameworks.push(e),this.frameworks.sort(),this.clientVersion=K$(this.config.clientPlatform,this._getFrameworks()))}_getFrameworks(){return this.frameworks}async _getAdditionalHeaders(){var s;const e={"X-Client-Version":this.clientVersion};this.app.options.appId&&(e["X-Firebase-gmpid"]=this.app.options.appId);const t=await((s=this.heartbeatServiceProvider.getImmediate({optional:!0}))==null?void 0:s.getHeartbeatsHeader());t&&(e["X-Firebase-Client"]=t);const r=await this._getAppCheckToken();return r&&(e["X-Firebase-AppCheck"]=r),e}async _getAppCheckToken(){var t;if(xo(this.app)&&this.app.settings.appCheckToken)return this.app.settings.appCheckToken;const e=await((t=this.appCheckServiceProvider.getImmediate({optional:!0}))==null?void 0:t.getToken());return e!=null&&e.error&&Xw(`Error while retrieving App Check token: ${e.error}`),e==null?void 0:e.token}}function zh(n){return Yn(n)}class r3{constructor(e){this.auth=e,this.observer=null,this.addObserver=bre(t=>this.observer=t)}get next(){return Lt(this.observer,this.auth,"internal-error"),this.observer.next.bind(this.observer)}}/**
845 * @license
846 * Copyright 2020 Google LLC
847 *
848 * Licensed under the Apache License, Version 2.0 (the "License");
849 * you may not use this file except in compliance with the License.
850 * You may obtain a copy of the License at
851 *
852 *   http://www.apache.org/licenses/LICENSE-2.0
853 *
854 * Unless required by applicable law or agreed to in writing, software
855 * distributed under the License is distributed on an "AS IS" BASIS,
856 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
857 * See the License for the specific language governing permissions and
858 * limitations under the License.
859 */let S1={async loadJS(){throw new Error("Unable to load external scripts")},recaptchaV2Script:"",recaptchaEnterpriseScript:"",gapiScript:""};function sae(n){S1=n}function W$(n){return S1.loadJS(n)}function aae(){return S1.recaptchaEnterpriseScript}function iae(){return S1.gapiScript}function oae(n){return`__${n}${Math.floor(Math.random()*1e6)}`}class lae{constructor(){this.enterprise=new cae}ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}class cae{ready(e){e()}execute(e,t){return Promise.resolve("token")}render(e,t){return""}}/**
860 * @license
861 * Copyright 2022 Google LLC
862 *
863 * Licensed under the Apache License, Version 2.0 (the "License");
864 * you may not use this file except in compliance with the License.
865 * You may obtain a copy of the License at
866 *
867 *   http://www.apache.org/licenses/LICENSE-2.0
868 *
869 * Unless required by applicable law or agreed to in writing, software
870 * distributed under the License is distributed on an "AS IS" BASIS,
871 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
872 * See the License for the specific language governing permissions and
873 * limitations under the License.
874 */const dae="recaptcha-enterprise",Y$="NO_RECAPTCHA",s3="onFirebaseAuthREInstanceReady";class th{constructor(e){this.type=dae,this.auth=zh(e)}async verify(e="verify",t=!1){async function r(a){if(!t){if(a.tenantId==null&&a._agentRecaptchaConfig!=null)return a._agentRecaptchaConfig.siteKey;if(a.tenantId!=null&&a._tenantRecaptchaConfigs[a.tenantId]!==void 0)return a._tenantRecaptchaConfigs[a.tenantId].siteKey}return new Promise(async(o,l)=>{Gse(a,{clientType:"CLIENT_TYPE_WEB",version:"RECAPTCHA_ENTERPRISE"}).then(c=>{if(c.recaptchaKey===void 0)l(new Error("recaptcha Enterprise site key undefined"));else{const d=new Vse(c);return a.tenantId==null?a._agentRecaptchaConfig=d:a._tenantRecaptchaConfigs[a.tenantId]=d,o(d.siteKey)}}).catch(c=>{l(c)})})}function s(a,o,l){const c=window.grecaptcha;XM(c)?c.enterprise.ready(()=>{c.enterprise.execute(a,{action:e}).then(d=>{o(d)}).catch(()=>{o(Y$)})}):l(Error("No reCAPTCHA enterprise script loaded."))}return this.auth.settings.appVerificationDisabledForTesting?new lae().execute("siteKey",{action:"verify"}):new Promise((a,o)=>{r(this.auth).then(async l=>{if(!t&&XM(window.grecaptcha)&&th.scriptInjectionDeferred)await th.scriptInjectionDeferred.promise,s(l,a,o);else{if(typeof window>"u"){o(new Error("RecaptchaVerifier is only supported in browser"));return}let c=aae();c.length!==0&&(c+=l+`&onload=${s3}`),th.scriptInjectionDeferred=new w$,window[s3]=()=>{var d;(d=th.scriptInjectionDeferred)==null||d.resolve()},W$(c).then(()=>{var d;return(d=th.scriptInjectionDeferred)==null?void 0:d.promise}).then(()=>{s(l,a,o)}).catch(d=>{o(d)})}}).catch(l=>{o(l)})})}}th.scriptInjectionDeferred=null;async function a3(n,e,t,r=!1,s=!1){const a=new th(n);let o;if(s)o=Y$;else try{o=await a.verify(t)}catch{o=await a.verify(t,!0)}const l={...e};if(t==="mfaSmsEnrollment"||t==="mfaSmsSignIn"){if("phoneEnrollmentInfo"in l){const c=l.phoneEnrollmentInfo.phoneNumber,d=l.phoneEnrollmentInfo.recaptchaToken;Object.assign(l,{phoneEnrollmentInfo:{phoneNumber:c,recaptchaToken:d,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}else if("phoneSignInInfo"in l){const c=l.phoneSignInInfo.recaptchaToken;Object.assign(l,{phoneSignInInfo:{recaptchaToken:c,captchaResponse:o,clientType:"CLIENT_TYPE_WEB",recaptchaVersion:"RECAPTCHA_ENTERPRISE"}})}return l}return r?Object.assign(l,{captchaResp:o}):Object.assign(l,{captchaResponse:o}),Object.assign(l,{clientType:"CLIENT_TYPE_WEB"}
874),Object.assign(l,{recaptchaVersion:"RECAPTCHA_ENTERPRISE"}),l}async function p_(n,e,t,r,s){var a;if((a=n._getRecaptchaConfig())!=null&&a.isProviderEnabled("EMAIL_PASSWORD_PROVIDER")){const o=await a3(n,e,t,t==="getOobCode");return r(n,o)}else return r(n,e).catch(async o=>{if(o.code==="auth/missing-recaptcha-token"){console.log(`${t} is protected by reCAPTCHA Enterprise for this project. Automatically triggering the reCAPTCHA flow and restarting the flow.`);const l=await a3(n,e,t,t==="getOobCode");return r(n,l)}else return Promise.reject(o)})}/**
875 * @license
876 * Copyright 2020 Google LLC
877 *
878 * Licensed under the Apache License, Version 2.0 (the "License");
879 * you may not use this file except in compliance with the License.
880 * You may obtain a copy of the License at
881 *
882 *   http://www.apache.org/licenses/LICENSE-2.0
883 *
884 * Unless required by applicable law or agreed to in writing, software
885 * distributed under the License is distributed on an "AS IS" BASIS,
886 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
887 * See the License for the specific language governing permissions and
888 * limitations under the License.
889 */function uae(n,e){const t=Yy(n,"auth");if(t.isInitialized()){const s=t.getImmediate(),a=t.getOptions();if(Gl(a,e??{}))return s;tl(s,"already-initialized")}return t.initialize({options:e})}function hae(n,e){const t=(e==null?void 0:e.persistence)||[],r=(Array.isArray(t)?t:[t]).map(_d);e!=null&&e.errorMap&&n._updateErrorMap(e.errorMap),n._initializeWithPersistence(r,e==null?void 0:e.popupRedirectResolver)}function fae(n,e,t){const r=zh(n);
889Lt(/^https?:\/\//.test(e),r,"invalid-emulator-scheme");const s=!1,a=Q$(e),{host:o,port:l}=mae(e),c=l===null?"":`:${l}`,d={url:`${a}//${o}${c}/`},h=Object.freeze({host:o,port:l,protocol:a.replace(":",""),options:Object.freeze({disableWarnings:s})});if(!r._canInitEmulator){Lt(r.config.emulator&&r.emulatorConfig,r,"emulator-config-failed"),Lt(Gl(d,r.config.emulator)&&Gl(h,r.emulatorConfig),r,"emulator-config-failed");return}r.config.emulator=d,r.emulatorConfig=h,r.settings.appVerificationDisabledForTesting=!0,Ng(o)?AD(`${a}//${o}${c}`):pae()}function Q$(n){const e=n.indexOf(":");return e<0?"":n.substr(0,e+1)}function mae(n){const e=Q$(n),t=/(\/\/)?([^?#/]+)/.exec(n.substr(e.length));if(!t)return{host:"",port:null};const r=t[2].split("@").pop()||"",s=/^(\[[^\]]+\])(:|$)/.exec(r);if(s){const a=s[1];return{host:a,port:i3(r.substr(a.length+1))}}else{const[a,o]=r.split(":");return{host:a,port:i3(o)}}}function i3(n){if(!n)return null;const e=Number(n);return isNaN(e)?null:e}function pae(){function n(){const e=document.createElement("p"),t=e.style;e.innerText="Running in emulator mode. Do not use with production credentials.",t.position="fixed",t.width="100%",t.backgroundColor="#ffffff",t.border=".1em solid #000000",t.color="#b50000",t.bottom="0px",t.left="0px",t.margin="0px",t.zIndex="10000",t.textAlign="center",e.classList.add("firebase-emulator-warning"),document.body.appendChild(e)}typeof console<"u"&&typeof console.info=="function"&&console.info("WARNING: You are using the Auth Emulator, which is intended for local testing only.  Do not use with production credentials."),typeof window<"u"&&typeof document<"u"&&(document.readyState==="loading"?window.addEventListener("DOMContentLoaded",n):n())}/**
890 * @license
891 * Copyright 2020 Google LLC
892 *
893 * Licensed under the Apache License, Version 2.0 (the "License");
894 * you may not use this file except in compliance with the License.
895 * You may obtain a copy of the License at
896 *
897 *   http://www.apache.org/licenses/LICENSE-2.0
898 *
899 * Unless required by applicable law or agreed to in writing, software
900 * distributed under the License is distributed on an "AS IS" BASIS,
901 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
902 * See the License for the specific language governing permissions and
903 * limitations under the License.
904 */class PD{constructor(e,t){this.providerId=e,this.signInMethod=t}toJSON(){return Nd("not implemented")}_getIdTokenResponse(e){return Nd("not implemented")}_linkToIdToken(e,t){return Nd("not implemented")}_getReauthenticationResolver(e){return Nd("not implemented")}}async function gae(n,e){return eu(n,"POST","/v1/accounts:signUp",e)}/**
905 * @license
906 * Copyright 2020 Google LLC
907 *
908 * Licensed under the Apache License, Version 2.0 (the "License");
909 * you may not use this file except in compliance with the License.
910 * You may obtain a copy of the License at
911 *
912 *   http://www.apache.org/licenses/LICENSE-2.0
913 *
914 * Unless required by applicable law or agreed to in writing, software
915 * distributed under the License is distributed on an "AS IS" BASIS,
916 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
917 * See the License for the specific language governing permissions and
918 * limitations under the License.
919 */async function xae(n,e){return Jy(n,"POST","/v1/accounts:signInWithPassword",Hh(n,e))}/**
920 * @license
921 * Copyright 2020 Google LLC
922 *
923 * Licensed under the Apache License, Version 2.0 (the "License");
924 * you may not use this file except in compliance with the License.
925 * You may obtain a copy of the License at
926 *
927 *   http://www.apache.org/licenses/LICENSE-2.0
928 *
929 * Unless required by applicable law or agreed to in writing, software
930 * distributed under the License is distributed on an "AS IS" BASIS,
931 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
932 * See the License for the specific language governing permissions and
933 * limitations under the License.
934 */async function bae(n,e){return Jy(n,"POST","/v1/accounts:signInWithEmailLink",Hh(n,e))}async function yae(n,e){return Jy(n,"POST","/v1/accounts:signInWithEmailLink",Hh(n,e))}/**
935 * @license
936 * Copyright 2020 Google LLC
937 *
938 * Licensed under the Apache License, Version 2.0 (the "License");
939 * you may not use this file except in compliance with the License.
940 * You may obtain a copy of the License at
941 *
942 *   http://www.apache.org/licenses/LICENSE-2.0
943 *
944 * Unless required by applicable law or agreed to in writing, software
945 * distributed under the License is distributed on an "AS IS" BASIS,
946 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
947 * See the License for the specific language governing permissions and
948 * limitations under the License.
949 */class ty extends PD{constructor(e,t,r,s=null){super("password",r),this._email=e,this._password=t,this._tenantId=s}static _fromEmailAndPassword(e,t){return new ty(e,t,"password")}static _fromEmailAndCode(e,t,r=null){return new ty(e,t,"emailLink",r)}toJSON(){return{email:this._email,password:this._password,signInMethod:this.signInMethod,tenantId:this._tenantId}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e;if(t!=null&&t.email&&(t!=null&&t.password)){if(t.signInMethod==="password")return this._fromEmailAndPassword(t.email,t.password);if(t.signInMethod==="emailLink")return this._fromEmailAndCode(t.email,t.password,t.tenantId)}return null}async _getIdTokenResponse(e){switch(this.signInMethod){case"password":const t={returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return p_(e,t,"signInWithPassword",xae);case"emailLink":return bae(e,{email:this._email,oobCode:this._password});default:tl(e,"internal-error")}}async _linkToIdToken(e,t){switch(this.signInMethod){case"password":const r={idToken:t,returnSecureToken:!0,email:this._email,password:this._password,clientType:"CLIENT_TYPE_WEB"};return p_(e,r,"signUpPassword",gae);case"emailLink":return yae(e,{idToken:t,email:this._email,oobCode:this._password});default:tl(e,"internal-error")}}_getReauthenticationResolver(e){return this._getIdTokenResponse(e)}}/**
950 * @license
951 * Copyright 2020 Google LLC
952 *
953 * Licensed under the Apache License, Version 2.0 (the "License");
954 * you may not use this file except in compliance with the License.
955 * You may obtain a copy of the License at
956 *
957 *   http://www.apache.org/licenses/LICENSE-2.0
958 *
959 * Unless required by applicable law or agreed to in writing, software
960 * distributed under the License is distributed on an "AS IS" BASIS,
961 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
962 * See the License for the specific language governing permissions and
963 * limitations under the License.
964 */async function I0(n,e){return Jy(n,"POST","/v1/accounts:signInWithIdp",Hh(n,e))}/**
965 * @license
966 * Copyright 2020 Google LLC
967 *
968 * Licensed under the Apache License, Version 2.0 (the "License");
969 * you may not use this file except in compliance with the License.
970 * You may obtain a copy of the License at
971 *
972 *   http://www.apache.org/licenses/LICENSE-2.0
973 *
974 * Unless required by applicable law or agreed to in writing, software
975 * distributed under the License is distributed on an "AS IS" BASIS,
976 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
977 * See the License for the specific language governing permissions and
978 * limitations under the License.
979 */const vae="http://localhost";class vm extends PD{constructor(){super(...arguments),this.pendingToken=null}static _fromParams(e){const t=new vm(e.providerId,e.signInMethod);return e.idToken||e.accessToken?(e.idToken&&(t.idToken=e.idToken),e.accessToken&&(t.accessToken=e.accessToken),e.nonce&&!e.pendingToken&&(t.nonce=e.nonce),e.pendingToken&&(t.pendingToken=e.pendingToken)):e.oauthToken&&e.oauthTokenSecret?(t.accessToken=e.oauthToken,t.secret=e.oauthTokenSecret):tl("argument-error"),t}toJSON(){return{idToken:this.idToken,accessToken:this.accessToken,secret:this.secret,n
979once:this.nonce,pendingToken:this.pendingToken,providerId:this.providerId,signInMethod:this.signInMethod}}static fromJSON(e){const t=typeof e=="string"?JSON.parse(e):e,{providerId:r,signInMethod:s,...a}=t;if(!r||!s)return null;const o=new vm(r,s);return o.idToken=a.idToken||void 0,o.accessToken=a.accessToken||void 0,o.secret=a.secret,o.nonce=a.nonce,o.pendingToken=a.pendingToken||null,o}_getIdTokenResponse(e){const t=this.buildRequest();return I0(e,t)}_linkToIdToken(e,t){const r=this.buildRequest();return r.idToken=t,I0(e,r)}_getReauthenticationResolver(e){const t=this.buildRequest();return t.autoCreate=!1,I0(e,t)}buildRequest(){const e={requestUri:vae,returnSecureToken:!0};if(this.pendingToken)e.pendingToken=this.pendingToken;else{const t={};this.idToken&&(t.id_token=this.idToken),this.accessToken&&(t.access_token=this.accessToken),this.secret&&(t.oauth_token_secret=this.secret),t.providerId=this.providerId,this.nonce&&!this.pendingToken&&(t.nonce=this.nonce),e.postBody=Wy(t)}return e}}/**
980 * @license
981 * Copyright 2020 Google LLC
982 *
983 * Licensed under the Apache License, Version 2.0 (the "License");
984 * you may not use this file except in compliance with the License.
985 * You may obtain a copy of the License at
986 *
987 *   http://www.apache.org/licenses/LICENSE-2.0
988 *
989 * Unless required by applicable law or agreed to in writing, software
990 * distributed under the License is distributed on an "AS IS" BASIS,
991 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
992 * See the License for the specific language governing permissions and
993 * limitations under the License.
994 */function Bae(n){switch(n){case"recoverEmail":return"RECOVER_EMAIL";case"resetPassword":return"PASSWORD_RESET";case"signIn":return"EMAIL_SIGNIN";case"verifyEmail":return"VERIFY_EMAIL";case"verifyAndChangeEmail":return"VERIFY_AND_CHANGE_EMAIL";case"revertSecondFactorAddition":return"REVERT_SECOND_FACTOR_ADDITION";default:return null}}function wae(n){const e=yb(vb(n)).link,t=e?yb(vb(e)).deep_link_id:null,r=yb(vb(n)).deep_link_id;return(r?yb(vb(r)).link:null)||r||t||e||n}class LD{constructor(e){const t=yb(vb(e)),r=t.apiKey??null,s=t.oobCode??null,a=Bae(t.mode??null);Lt(r&&s&&a,"argument-error"),this.apiKey=r,this.operation=a,this.code=s,this.continueUrl=t.continueUrl??null,this.languageCode=t.lang??null,this.tenantId=t.tenantId??null}static parseLink(e){const t=wae(e);try{return new LD(t)}catch{return null}}}/**
995 * @license
996 * Copyright 2020 Google LLC
997 *
998 * Licensed under the Apache License, Version 2.0 (the "License");
999 * you may not use this file except in compliance with the License.
1000 * You may obtain a copy of the License at
1001 *
1002 *   http://www.apache.org/licenses/LICENSE-2.0
1003 *
1004 * Unless required by applicable law or agreed to in writing, software
1005 * distributed under the License is distributed on an "AS IS" BASIS,
1006 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1007 * See the License for the specific language governing permissions and
1008 * limitations under the License.
1009 */class Ig{constructor(){this.providerId=Ig.PROVIDER_ID}static credential(e,t){return ty._fromEmailAndPassword(e,t)}static credentialWithLink(e,t){const r=LD.parseLink(t);return Lt(r,"argument-error"),ty._fromEmailAndCode(e,r.code,r.tenantId)}}Ig.PROVIDER_ID="password";Ig.EMAIL_PASSWORD_SIGN_IN_METHOD="password";Ig.EMAIL_LINK_SIGN_IN_METHOD="emailLink";/**
1010 * @license
1011 * Copyright 2020 Google LLC
1012 *
1013 * Licensed under the Apache License, Version 2.0 (the "License");
1014 * you may not use this file except in compliance with the License.
1015 * You may obtain a copy of the License at
1016 *
1017 *   http://www.apache.org/licenses/LICENSE-2.0
1018 *
1019 * Unless required by applicable law or agreed to in writing, software
1020 * distributed under the License is distributed on an "AS IS" BASIS,
1021 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1022 * See the License for the specific language governing permissions and
1023 * limitations under the License.
1024 */class OD{constructor(e){this.providerId=e,this.defaultLanguageCode=null,this.customParameters={}}setDefaultLanguage(e){this.defaultLanguageCode=e}setCustomParameters(e){return this.customParameters=e,this}getCustomParameters(){return this.customParameters}}/**
1025 * @license
1026 * Copyright 2019 Google LLC
1027 *
1028 * Licensed under the Apache License, Version 2.0 (the "License");
1029 * you may not use this file except in compliance with the License.
1030 * You may obtain a copy of the License at
1031 *
1032 *   http://www.apache.org/licenses/LICENSE-2.0
1033 *
1034 * Unless required by applicable law or agreed to in writing, software
1035 * distributed under the License is distributed on an "AS IS" BASIS,
1036 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1037 * See the License for the specific language governing permissions and
1038 * limitations under the License.
1039 */class Xy extends OD{constructor(){super(...arguments),this.scopes=[]}addScope(e){return this.scopes.includes(e)||this.scopes.push(e),this}getScopes(){return[...this.scopes]}}/**
1040 * @license
1041 * Copyright 2020 Google LLC
1042 *
1043 * Licensed under the Apache License, Version 2.0 (the "License");
1044 * you may not use this file except in compliance with the License.
1045 * You may obtain a copy of the License at
1046 *
1047 *   http://www.apache.org/licenses/LICENSE-2.0
1048 *
1049 * Unless required by applicable law or agreed to in writing, software
1050 * distributed under the License is distributed on an "AS IS" BASIS,
1051 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1052 * See the License for the specific language governing permissions and
1053 * limitations under the License.
1054 */class nh extends Xy{constructor(){super("facebook.com")}static credential(e){return vm._fromParams({providerId:nh.PROVIDER_ID,signInMethod:nh.FACEBOOK_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return nh.credentialFromTaggedObject(e)}static credentialFromError(e){return nh.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return nh.credential(e.oauthAccessToken)}catch{return null}}}nh.FACEBOOK_SIGN_IN_METHOD="facebook.com";nh.PROVIDER_ID="facebook.com";/**
1055 * @license
1056 * Copyright 2020 Google LLC
1057 *
1058 * Licensed under the Apache License, Version 2.0 (the "License");
1059 * you may not use this file except in compliance with the License.
1060 * You may obtain a copy of the License at
1061 *
1062 *   http://www.apache.org/licenses/LICENSE-2.0
1063 *
1064 * Unless required by applicable law or agreed to in writing, software
1065 * distributed under the License is distributed on an "AS IS" BASIS,
1066 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1067 * See the License for the specific language governing permissions and
1068 * limitations under the License.
1069 */class Cd extends Xy{constructor(){super("google.com"),this.addScope("profile")}static credential(e,t){return vm._fromParams({providerId:Cd.PROVIDER_ID,signInMethod:Cd.GOOGLE_SIGN_IN_METHOD,idToken:e,accessToken:t})}static credentialFromResult(e){return Cd.credentialFromTaggedObject(e)}static credentialFromError(e){return Cd.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthIdToken:t,oauthAccessToken:r}=e;if(!t&&!r)return null;try{return Cd.credential(t,r)}catch{return null}}}Cd.GOOGLE_SIGN_IN_METHOD="google.com";Cd.PROVIDER_ID="google.com";/**
1070 * @license
1071 * Copyright 2020 Google LLC
1072 *
1073 * Licensed under the Apache License, Version 2.0 (the "License");
1074 * you may not use this file except in compliance with the License.
1075 * You may obtain a copy of the License at
1076 *
1077 *   http://www.apache.org/licenses/LICENSE-2.0
1078 *
1079 * Unless required by applicable law or agreed to in writing, software
1080 * distributed under the License is distributed on an "AS IS" BASIS,
1081 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1082 * See the License for the specific language governing permissions and
1083 * limitations under the License.
1084 */class rh extends Xy{constructor(){super("github.com")}static credential(e){return vm._fromParams({providerId:rh.PROVIDER_ID,signInMethod:rh.GITHUB_SIGN_IN_METHOD,accessToken:e})}static credentialFromResult(e){return rh.credentialFromTaggedObject(e)}static credentialFromError(e){return rh.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e||!("oauthAccessToken"in e)||!e.oauthAccessToken)return null;try{return rh.credential(e.oauthAccessToken)}catch{return null}}}rh.GITHUB_SIGN_IN_METHOD="github.com";rh.PROVIDER_ID="github.com";/**
1085 * @license
1086 * Copyright 2020 Google LLC
1087 *
1088 * Licensed under the Apache License, Version 2.0 (the "License");
1089 * you may not use this file except in compliance with the License.
1090 * You may obtain a copy of the License at
1091 *
1092 *   http://www.apache.org/licenses/LICENSE-2.0
1093 *
1094 * Unless required by applicable law or agreed to in writing, software
1095 * distributed under the License is distributed on an "AS IS" BASIS,
1096 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1097 * See the License for the specific language governing permissions and
1098 * limitations under the License.
1099 */class sh extends Xy{constructor(){super("twitter.com")}static credential(e,t){return vm._fromParams({providerId:sh.PROVIDER_ID,signInMethod:sh.TWITTER_SIGN_IN_METHOD,oauthToken:e,oauthTokenSecret:t})}static credentialFromResult(e){return sh.credentialFromTaggedObject(e)}static credentialFromError(e){return sh.credentialFromTaggedObject(e.customData||{})}static credentialFromTaggedObject({_tokenResponse:e}){if(!e)return null;const{oauthAccessToken:t,oauthTokenSecret:r}=e;if(!t||!r)return null;try{return sh.credential(t,r)}catch{return null}}}sh.TWITTER_SIGN_IN_METHOD="twitter.com";sh.PROVIDER_ID="twitter.com";/**
1100 * @license
1101 * Copyright 2020 Google LLC
1102 *
1103 * Licensed under the Apache License, Version 2.0 (the "License");
1104 * you may not use this file except in compliance with the License.
1105 * You may obtain a copy of the License at
1106 *
1107 *   http://www.apache.org/licenses/LICENSE-2.0
1108 *
1109 * Unless required by applicable law or agreed to in writing, software
1110 * distributed under the License is distributed on an "AS IS" BASIS,
1111 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1112 * See the License for the specific language governing permissions and
1113 * limitations under the License.
1114 */async function Cae(n,e){return Jy(n,"POST","/v1/accounts:signUp",Hh(n,e))}/**
1115 * @license
1116 * Copyright 2020 Google LLC
1117 *
1118 * Licensed under the Apache License, Version 2.0 (the "License");
1119 * you may not use this file except in compliance with the License.
1120 * You may obtain a copy of the License at
1121 *
1122 *   http://www.apache.org/licenses/LICENSE-2.0
1123 *
1124 * Unless required by applicable law or agreed to in writing, software
1125 * distributed under the License is distributed on an "AS IS" BASIS,
1126 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1127 * See the License for the specific language governing permissions and
1128 * limitations under the License.
1129 */class Bm{constructor(e){this.user=e.user,this.providerId=e.providerId,this._tokenResponse=e._tokenResponse,this.operationType=e.operationType}static async _fromIdTokenResponse(e,t,r,s=!1){const a=await Pl._fromIdTokenResponse(e,r,s),o=o3(r);return new Bm({user:a,providerId:o,_tokenResponse:r,operationType:t})}static async _forOperation(e,t,r){await e._updateTokensIfNecessary(r,!0);const s=o3(r);return new Bm({user:e,providerId:s,_tokenResponse:r,operationType:t})}}function o3(n){return n.providerId?n.providerId:"phoneNumber"in n?"phone":null}/**
1130 * @license
1131 * Copyright 2020 Google LLC
1132 *
1133 * Licensed under the Apache License, Version 2.0 (the "License");
1134 * you may not use this file except in compliance with the License.
1135 * You may obtain a copy of the License at
1136 *
1137 *   http://www.apache.org/licenses/LICENSE-2.0
1138 *
1139 * Unless required by applicable law or agreed to in writing, software
1140 * distributed under the License is distributed on an "AS IS" BASIS,
1141 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1142 * See the License for the specific language governing permissions and
1143 * limitations under the License.
1144 */class VC extends Zd{constructor(e,t,r,s){super(t.code,t.message),this.operationType=r,this.user=s,Object.setPrototypeOf(this,VC.prototype),this.customData={appName:e.name,tenantId:e.tenantId??void 0,_serverResponse:t.customData._serverResponse,operationType:r}}static _fromErrorAndOperation(e,t,r,s){return new VC(e,t,r,s)}}function J$(n,e,t,r){return(e==="reauthenticate"?t._getReauthenticationResolver(n):t._getIdTokenResponse(n)).catch(a=>{throw a.code==="auth/multi-factor-auth-required"?VC._fromErrorAndOperation(n,a,e,r):a})}async function Eae(n,e,t=!1){const r=await z0(n,e._linkToIdToken(n.auth,await n.getIdToken()),t);return Bm._forOperation(n,"link",r)}/**
1145 * @license
1146 * Copyright 2019 Google LLC
1147 *
1148 * Licensed under the Apache License, Version 2.0 (the "License");
1149 * you may not use this file except in compliance with the License.
1150 * You may obtain a copy of the License at
1151 *
1152 *   http://www.apache.org/licenses/LICENSE-2.0
1153 *
1154 * Unless required by applicable law or agreed to in writing, software
1155 * distributed under the License is distributed on an "AS IS" BASIS,
1156 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1157 * See the License for the specific language governing permissions and
1158 * limitations under the License.
1159 */async function Sae(n,e,t=!1){const{auth:r}=n;if(xo(r.app))return Promise.reject(Pd(r));const s="reauthenticate";try{const a=await z0(n,J$(r,s,e,n),t);Lt(a.idToken,r,"internal-error");const o=jD(a.idToken);Lt(o,r,"internal-error");const{sub:l}=o;return Lt(n.uid===l,r,"user-mismatch"),Bm._forOperation(n,s,a)}catch(a){throw(a==null?void 0:a.code)==="auth/user-not-found"&&tl(r,"user-mismatch"),a}}/**
1160 * @license
1161 * Copyright 2020 Google LLC
1162 *
1163 * Licensed under the Apache License, Version 2.0 (the "License");
1164 * you may not use this file except in compliance with the License.
1165 * You may obtain a copy of the License at
1166 *
1167 *   http://www.apache.org/licenses/LICENSE-2.0
1168 *
1169 * Unless required by applicable law or agreed to in writing, software
1170 * distributed under the License is distributed on an "AS IS" BASIS,
1171 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1172 * See the License for the specific language governing permissions and
1173 * limitations under the License.
1174 */async function X$(n,e,t=!1){if(xo(n.app))return Promise.reject(Pd(n));const r="signIn",s=await J$(n,r,e),a=await Bm._fromIdTokenResponse(n,r,s);return t||await n._updateCurrentUser(a.user),a}async function Tae(n,e){return X$(zh(n),e)}/**
1175 * @license
1176 * Copyright 2020 Google LLC
1177 *
1178 * Licensed under the Apache License, Version 2.0 (the "License");
1179 * you may not use this file except in compliance with the License.
1180 * You may obtain a copy of the License at
1181 *
1182 *   http://www.apache.org/licenses/LICENSE-2.0
1183 *
1184 * Unless required by applicable law or agreed to in writing, software
1185 * distributed under the License is distributed on an "AS IS" BASIS,
1186 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1187 * See the License for the specific language governing permissions and
1188 * limitations under the License.
1189 */async function Z$(n){const e=zh(n);e._getPasswordPolicyInternal()&&await e._updatePasswordPolicy()}async function Aae(n,e,t){if(xo(n.app))return Promise.reject(Pd(n));const r=zh(n),o=await p_(r,{returnSecureToken:!0,email:e,password:t,clientType:"CLIENT_TYPE_WEB"},"signUpPassword",Cae).catch(c=>{throw c.code==="auth/password-does-not-meet-requirements"&&Z$(n),c}),l=await Bm._fromIdTokenResponse(r,"signIn",o);return await r._updateCurrentUser(l.user),l}function kae(n,e,t){return xo(n.app)?Promise.reject(Pd(n)):Tae(Yn(n),Ig.credential(e,t)).catch(async r=>{throw r.code==="auth/password-does-not-meet-requirements"&&Z$(n),r})}/**
1190 * @license
1191 * Copyright 2020 Google LLC
1192 *
1193 * Licensed under the Apache License, Version 2.0 (the "License");
1194 * you may not use this file except in compliance with the License.
1195 * You may obtain a copy of the License at
1196 *
1197 *   http://www.apache.org/licenses/LICENSE-2.0
1198 *
1199 * Unless required by applicable law or agreed to in writing, software
1200 * distributed under the License is distributed on an "AS IS" BASIS,
1201 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1202 * See the License for the specific language governing permissions and
1203 * limitations under the License.
1204 */async function Nae(n,e){return eu(n,"POST","/v1/accounts:update",e)}/**
1205 * @license
1206 * Copyright 2020 Google LLC
1207 *
1208 * Licensed under the Apache License, Version 2.0 (the "License");
1209 * you may not use this file except in compliance with the License.
1210 * You may obtain a copy of the License at
1211 *
1212 *   http://www.apache.org/licenses/LICENSE-2.0
1213 *
1214 * Unless required by applicable law or agreed to in writing, software
1215 * distributed under the License is distributed on an "AS IS" BASIS,
1216 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1217 * See the License for the specific language governing permissions and
1218 * limitations under the License.
1219 */async function _ae(n,e){const{displayName:t,photoURL:r}=e;if(t===void 0&&r===void 0)return;const s=Yn(n),o={idToken:await s.getIdToken(),displayName:t,photoUrl:r,returnSecureToken:!0},l=await z0(s,Nae(s.auth,o));s.displayName=l.displayName||null,s.photoURL=l.photoUrl||null;const c=s.providerData.find(({providerId:d})=>d==="password");c&&(c.displayName=s.displayName,c.photoURL=s.photoURL),await s._updateTokensIfNecessary(l)}function Iae(n,e,t,r){return Yn(n).onIdTokenChanged(e,t,r)}function Dae(n,e,t){return Yn(n).beforeAuthStateChanged(e,t)}function jae(n,e,t,r){return Yn(n).onAuthStateChanged(e,t,r)}function Rae(n){return Yn(n).signOut()}const GC="__sak";/**
1220 * @license
1221 * Copyright 2019 Google LLC
1222 *
1223 * Licensed under the Apache License, Version 2.0 (the "License");
1224 * you may not use this file except in compliance with the License.
1225 * You may obtain a copy of the License at
1226 *
1227 *   http://www.apache.org/licenses/LICENSE-2.0
1228 *
1229 * Unless required by applicable law or agreed to in writing, software
1230 * distributed under the License is distributed on an "AS IS" BASIS,
1231 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1232 * See the License for the specific language governing permissions and
1233 * limitations under the License.
1234 */class eH{constructor(e,t){this.storageRetriever=e,this.type=t}_isAvailable(){try{return this.storage?(this.storage.setItem(GC,"1"),this.storage.removeItem(GC),Promise.resolve(!0)):Promise.resolve(!1)}catch{return Promise.resolve(!1)}}_set(e,t){return this.storage.setItem(e,JSON.stringify(t)),Promise.resolve()}_get(e){const t=this.storage.getItem(e);return Promise.resolve(t?JSON.parse(t):null)}_remove(e){return this.storage.removeItem(e),Promise.resolve()}get storage(){return this.storageRetriever()}}/**
1235 * @license
1236 * Copyright 2020 Google LLC
1237 *
1238 * Licensed under the Apache License, Version 2.0 (the "License");
1239 * you may not use this file except in compliance with the License.
1240 * You may obtain a copy of the License at
1241 *
1242 *   http://www.apache.org/licenses/LICENSE-2.0
1243 *
1244 * Unless required by applicable law or agreed to in writing, software
1245 * distributed under the License is distributed on an "AS IS" BASIS,
1246 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1247 * See the License for the specific language governing permissions and
1248 * limitations under the License.
1249 */const Pae=1e3,Lae=10;class tH extends eH{constructor(){super(()=>window.localStorage,"LOCAL"),this.boundEventHandler=(e,t)=>this.onStorageEvent(e,t),this.listeners={},this.localCache={},this.pollTimer=null,this.fallbackToPolling=q$(),this._shouldAllowMigration=!0}forAllChangedKeys(e){for(const t of Object.keys(this.listeners)){const r=this.storage.getItem(t),s=this.localCache[t];r!==s&&e(t,s,r)}}onStorageEvent(e,t=!1){if(!e.key){this.forAllChangedKeys((o,l,c)=>{this.notifyListeners(o,c)});return}const r=e.key;t?this.detachListener():this.stopPolling();const s=()=>{const o=this.storage.getItem(r);!t&&this.localCache[r]===o||this.notifyListeners(r,o)},a=this.storage.getItem(r);Xse()&&a!==e.newValue&&e.newValue!==e.oldValue?setTimeout(s,Lae):s()}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(t&&JSON.parse(t))}startPolling(){this.stopPolling(),this.pollTimer=setInterval(()=>{this.forAllChangedKeys((e,t,r)=>{this.onStorageEvent(new StorageEvent("storage",{key:e,oldValue:t,newValue:r}),!0)})},Pae)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}attachListener(){window.addEventListener("storage",this.boundEventHandler)}detachListener(){window.removeEventListener("storage",this.boundEventHandler)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.fallbackToPolling?this.startPolling():this.attachListener()),this.listeners[e]||(this.listeners[e]=new Set,this.localCache[e]=this.storage.getItem(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
1249ject.keys(this.listeners).length===0&&(this.detachListener(),this.stopPolling())}async _set(e,t){await super._set(e,t),this.localCache[e]=JSON.stringify(t)}async _get(e){const t=await super._get(e);return this.localCache[e]=JSON.stringify(t),t}async _remove(e){await super._remove(e),delete this.localCache[e]}}tH.type="LOCAL";const Oae=tH;/**
1250 * @license
1251 * Copyright 2020 Google LLC
1252 *
1253 * Licensed under the Apache License, Version 2.0 (the "License");
1254 * you may not use this file except in compliance with the License.
1255 * You may obtain a copy of the License at
1256 *
1257 *   http://www.apache.org/licenses/LICENSE-2.0
1258 *
1259 * Unless required by applicable law or agreed to in writing, software
1260 * distributed under the License is distributed on an "AS IS" BASIS,
1261 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1262 * See the License for the specific language governing permissions and
1263 * limitations under the License.
1264 */class nH extends eH{constructor(){super(()=>window.sessionStorage,"SESSION")}_addListener(e,t){}_removeListener(e,t){}}nH.type="SESSION";const rH=nH;/**
1265 * @license
1266 * Copyright 2019 Google LLC
1267 *
1268 * Licensed under the Apache License, Version 2.0 (the "License");
1269 * you may not use this file except in compliance with the License.
1270 * You may obtain a copy of the License at
1271 *
1272 *   http://www.apache.org/licenses/LICENSE-2.0
1273 *
1274 * Unless required by applicable law or agreed to in writing, software
1275 * distributed under the License is distributed on an "AS IS" BASIS,
1276 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1277 * See the License for the specific language governing permissions and
1278 * limitations under the License.
1279 */function Mae(n){return Promise.all(n.map(async e=>{try{return{fulfilled:!0,value:await e}}catch(t){return{fulfilled:!1,reason:t}}}))}/**
1280 * @license
1281 * Copyright 2019 Google LLC
1282 *
1283 * Licensed under the Apache License, Version 2.0 (the "License");
1284 * you may not use this file except in compliance with the License.
1285 * You may obtain a copy of the License at
1286 *
1287 *   http://www.apache.org/licenses/LICENSE-2.0
1288 *
1289 * Unless required by applicable law or agreed to in writing, software
1290 * distributed under the License is distributed on an "AS IS" BASIS,
1291 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1292 * See the License for the specific language governing permissions and
1293 * limitations under the License.
1294 */class T1{constructor(e){this.eventTarget=e,this.handlersMap={},this.boundEventHandler=this.handleEvent.bind(this)}static _getInstance(e){const t=this.receivers.find(s=>s.isListeningto(e));if(t)return t;const r=new T1(e);return this.receivers.push(r),r}isListeningto(e){return this.eventTarget===e}async handleEvent(e){const t=e,{eventId:r,eventType:s,data:a}=t.data,o=this.handlersMap[s];if(!(o!=null&&o.size))return;t.ports[0].postMessage({status:"ack",eventId:r,eventType:s});const l=Array.from(o).map(async d=>d(t.origin,a)),c=await Mae(l);t.ports[0].postMessage({status:"done",eventId:r,eventType:s,response:c})}_subscribe(e,t){Object.keys(this.handlersMap).length===0&&this.eventTarget.addEventListener("message",this.boundEventHandler),this.handlersMap[e]||(this.handlersMap[e]=new Set),this.handlersMap[e].add(t)}_unsubscribe(e,t){this.handlersMap[e]&&t&&this.handlersMap[e].delete(t),(!t||this.handlersMap[e].size===0)&&delete this.handlersMap[e],Object.keys(this.handlersMap).length===0&&this.eventTarget.removeEventListener("message",this.boundEventHandler)}}T1.receivers=[];/**
1295 * @license
1296 * Copyright 2020 Google LLC
1297 *
1298 * Licensed under the Apache License, Version 2.0 (the "License");
1299 * you may not use this file except in compliance with the License.
1300 * You may obtain a copy of the License at
1301 *
1302 *   http://www.apache.org/licenses/LICENSE-2.0
1303 *
1304 * Unless required by applicable law or agreed to in writing, software
1305 * distributed under the License is distributed on an "AS IS" BASIS,
1306 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1307 * See the License for the specific language governing permissions and
1308 * limitations under the License.
1309 */function MD(n="",e=10){let t="";for(let r=0;r<e;r++)t+=Math.floor(Math.random()*10);return n+t}/**
1310 * @license
1311 * Copyright 2019 Google LLC
1312 *
1313 * Licensed under the Apache License, Version 2.0 (the "License");
1314 * you may not use this file except in compliance with the License.
1315 * You may obtain a copy of the License at
1316 *
1317 *   http://www.apache.org/licenses/LICENSE-2.0
1318 *
1319 * Unless required by applicable law or agreed to in writing, software
1320 * distributed under the License is distributed on an "AS IS" BASIS,
1321 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1322 * See the License for the specific language governing permissions and
1323 * limitations under the License.
1324 */class Fae{constructor(e){this.target=e,this.handlers=new Set}removeMessageHandler(e){e.messageChannel&&(e.messageChannel.port1.removeEventListener("message",e.onMessage),e.messageChannel.port1.close()),this.handlers.delete(e)}async _send(e,t,r=50){const s=typeof MessageChannel<"u"?new MessageChannel:null;if(!s)throw new Error("connection_unavailable");let a,o;return new Promise((l,c)=>{const d=MD("",20);s.port1.start();const h=setTimeout(()=>{c(new Error("unsupported_event"))},r);o={messageChannel:s,onMessage(m){const p=m;if(p.data.eventId===d)switch(p.data.status){case"ack":clearTimeout(h),a=setTimeout(()=>{c(new Error("timeout"))},3e3);break;case"done":clearTimeout(a),l(p.data.response);break;default:clearTimeout(h),clearTimeout(a),c(new Error("invalid_response"));break}}},this.handlers.add(o),s.port1.addEventListener("message",o.onMessage),this.target.postMessage({eventType:e,eventId:d,data:t},[s.port2])}).finally(()=>{o&&this.removeMessageHandler(o)})}}/**
1325 * @license
1326 * Copyright 2020 Google LLC
1327 *
1328 * Licensed under the Apache License, Version 2.0 (the "License");
1329 * you may not use this file except in compliance with the License.
1330 * You may obtain a copy of the License at
1331 *
1332 *   http://www.apache.org/licenses/LICENSE-2.0
1333 *
1334 * Unless required by applicable law or agreed to in writing, software
1335 * distributed under the License is distributed on an "AS IS" BASIS,
1336 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1337 * See the License for the specific language governing permissions and
1338 * limitations under the License.
1339 */function _c(){return window}function Uae(n){_c().location.href=n}/**
1340 * @license
1341 * Copyright 2020 Google LLC.
1342 *
1343 * Licensed under the Apache License, Version 2.0 (the "License");
1344 * you may not use this file except in compliance with the License.
1345 * You may obtain a copy of the License at
1346 *
1347 *   http://www.apache.org/licenses/LICENSE-2.0
1348 *
1349 * Unless required by applicable law or agreed to in writing, software
1350 * distributed under the License is distributed on an "AS IS" BASIS,
1351 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1352 * See the License for the specific language governing permissions and
1353 * limitations under the License.
1354 */function sH(){return typeof _c().WorkerGlobalScope<"u"&&typeof _c().importScripts=="function"}async function Vae(){if(!(navigator!=null&&navigator.serviceWorker))return null;try{return(await navigator.serviceWorker.ready).active}catch{return null}}function Gae(){var n;return((n=navigator==null?void 0:navigator.serviceWorker)==null?void 0:n.controller)||null}function $ae(){return sH()?self:null}/**
1355 * @license
1356 * Copyright 2019 Google LLC
1357 *
1358 * Licensed under the Apache License, Version 2.0 (the "License");
1359 * you may not use this file except in compliance with the License.
1360 * You may obtain a copy of the License at
1361 *
1362 *   http://www.apache.org/licenses/LICENSE-2.0
1363 *
1364 * Unless required by applicable law or agreed to in writing, software
1365 * distributed under the License is distributed on an "AS IS" BASIS,
1366 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1367 * See the License for the specific language governing permissions and
1368 * limitations under the License.
1369 */const aH="firebaseLocalStorageDb",Hae=1,$C="firebaseLocalStorage",iH="fbase_key";class Zy{constructor(e){this.request=e}toPromise(){return new Promise((e,t)=>{this.request.addEventListener("success",()=>{e(this.request.result)}),this.request.addEventListener("error",()=>{t(this.request.error)})})}}function A1(n,e){return n.transaction([$C],e?"readwrite":"readonly").objectStore($C)}function zae(){const n=indexedDB.deleteDatabase(aH);return new Zy(n).toPromise()}function oH(){const n=indexedDB.open(aH,Hae);return new Promise((e,t)=>
1369{n.addEventListener("error",()=>{t(n.error)}),n.addEventListener("upgradeneeded",()=>{const r=n.result;try{r.createObjectStore($C,{keyPath:iH})}catch(s){t(s)}}),n.addEventListener("success",async()=>{const r=n.result;r.objectStoreNames.contains($C)?e(r):(r.close(),await zae(),e(await oH()))})})}async function l3(n,e,t){const r=A1(n,!0).put({[iH]:e,value:t});return new Zy(r).toPromise()}async function qae(n,e){const t=A1(n,!1).get(e),r=await new Zy(t).toPromise();return r===void 0?null:r.value}function c3(n,e){const t=A1(n,!0).delete(e);return new Zy(t).toPromise()}const Kae=800,Wae=3;class lH{registerLifecycleListeners(){typeof window<"u"&&typeof window.addEventListener=="function"&&(window.addEventListener("pagehide",this.onPageHide),window.addEventListener("pageshow",this.onPageShow))}unregisterLifecycleListeners(){typeof window<"u"&&typeof window.removeEventListener=="function"&&(window.removeEventListener("pagehide",this.onPageHide),window.removeEventListener("pageshow",this.onPageShow))}constructor(){this.type="LOCAL",this.dbPromise=null,this._shouldAllowMigration=!0,this.listeners={},this.localCache={},this.pollTimer=null,this.isClosing=!1,this.pendingWrites=0,this.receiver=null,this.sender=null,this.serviceWorkerReceiverAvailable=!1,this.activeServiceWorker=null,this.onPageHide=()=>{this.isClosing=!0,this.stopPolling(),this.dbPromise&&(this.dbPromise.then(e=>e.close()).catch(()=>{}),this.dbPromise=null)},this.onPageShow=()=>{this.isClosing&&(this.isClosing=!1,Object.keys(this.listeners).length>0&&this.startPolling())},this._workerInitializationPromise=this.initializeServiceWorkerMessaging().then(()=>{},()=>{})}async _openDb(){return this.dbPromise?this.dbPromise:(this.dbPromise=oH(),this.dbPromise.catch(()=>{this.dbPromise=null}),this.dbPromise)}async _withRetries(e){let t=0;for(;;)try{const r=await this._openDb();return await e(r)}catch(r){if(t++>Wae)throw r;if(this.dbPromise){const s=this.dbPromise;this.dbPromise=null;try{(await s).close()}catch{}}}}async initializeServiceWorkerMessaging(){return sH()?this.initializeReceiver():this.initializeSender()}async initializeReceiver(){this.receiver=T1._getInstance($ae()),this.receiver._subscribe("keyChanged",async(e,t)=>({keyProcessed:(await this._poll()).includes(t.key)})),this.receiver._subscribe("ping",async(e,t)=>["keyChanged"])}async initializeSender(){var t,r;if(this.activeServiceWorker=await Vae(),!this.activeServiceWorker)return;this.sender=new Fae(this.activeServiceWorker);const e=await this.sender._send("ping",{},800);e&&(t=e[0])!=null&&t.fulfilled&&(r=e[0])!=null&&r.value.includes("keyChanged")&&(this.serviceWorkerReceiverAvailable=!0)}async notifyServiceWorker(e){if(!(!this.sender||!this.activeServiceWorker||Gae()!==this.activeServiceWorker))try{await this.sender._send("keyChanged",{key:e},this.serviceWorkerReceiverAvailable?800:50)}catch{}}async _isAvailable(){try{return indexedDB?(await this._withRetries(async e=>{await l3(e,GC,"1"),await c3(e,GC)}),!0):!1}catch{}return!1}async _withPendingWrite(e){this.pendingWrites++;try{await e()}finally{this.pendingWrites--}}async _set(e,t){return this._withPendingWrite(async()=>(await this._withRetries(r=>l3(r,e,t)),this.localCache[e]=t,this.notifyServiceWorker(e)))}async _get(e){const t=await this._withRetries(r=>qae(r,e));return this.localCache[e]=t,t}async _remove(e){return this._withPendingWrite(async()=>(await this._withRetries(t=>c3(t,e)),delete this.localCache[e],this.notifyServiceWorker(e)))}async _poll(){if(this.isClosing)return[];try{const e=await this._withRetries(s=>{const a=A1(s,!1).getAll();return new Zy(a).toPromise()});if(this.isClosing)return[];if(!e)return[];if(this.pendingWrites!==0)return[];const t=[],r=new Set;if(e.length!==0)for(const{fbase_key:s,value:a}of e)r.add(s),JSON.stringify(this.localCache[s])!==JSON.stringify(a)&&(this.notifyListeners(s,a),t.push(s));for(const s of Object.keys(this.localCache))this.localCache[s]&&!r.has(s)&&(this.notifyListeners(s,null),t.push(s));return t}catch(e){return this.isClosing||Xw(`Firebase Auth cross-tab polling failed with error: ${e}`),[]}}notifyListeners(e,t){this.localCache[e]=t;const r=this.listeners[e];if(r)for(const s of Array.from(r))s(t)}startPolling(){this.stopPolling(),this.pollTimer=setInterval(async()=>this._poll(),Kae)}stopPolling(){this.pollTimer&&(clearInterval(this.pollTimer),this.pollTimer=null)}_addListener(e,t){Object.keys(this.listeners).length===0&&(this.startPolling(),this.registerLifecycleListeners()),this.listeners[e]||(this.listeners[e]=new Set,this._get(e)),this.listeners[e].add(t)}_removeListener(e,t){this.listeners[e]&&(this.listeners[e].delete(t),this.listeners[e].size===0&&delete this.listeners[e]),Ob
vendor: 4,365 bytes, lines 1369-1418
1369ject.keys(this.listeners).length===0&&(this.stopPolling(),this.unregisterLifecycleListeners())}}lH.type="LOCAL";const Yae=lH;new Qy(3e4,6e4);/**
1370 * @license
1371 * Copyright 2021 Google LLC
1372 *
1373 * Licensed under the Apache License, Version 2.0 (the "License");
1374 * you may not use this file except in compliance with the License.
1375 * You may obtain a copy of the License at
1376 *
1377 *   http://www.apache.org/licenses/LICENSE-2.0
1378 *
1379 * Unless required by applicable law or agreed to in writing, software
1380 * distributed under the License is distributed on an "AS IS" BASIS,
1381 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1382 * See the License for the specific language governing permissions and
1383 * limitations under the License.
1384 */function cH(n,e){return e?_d(e):(Lt(n._popupRedirectResolver,n,"argument-error"),n._popupRedirectResolver)}/**
1385 * @license
1386 * Copyright 2019 Google LLC
1387 *
1388 * Licensed under the Apache License, Version 2.0 (the "License");
1389 * you may not use this file except in compliance with the License.
1390 * You may obtain a copy of the License at
1391 *
1392 *   http://www.apache.org/licenses/LICENSE-2.0
1393 *
1394 * Unless required by applicable law or agreed to in writing, software
1395 * distributed under the License is distributed on an "AS IS" BASIS,
1396 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1397 * See the License for the specific language governing permissions and
1398 * limitations under the License.
1399 */class FD extends PD{constructor(e){super("custom","custom"),this.params=e}_getIdTokenResponse(e){return I0(e,this._buildIdpRequest())}_linkToIdToken(e,t){return I0(e,this._buildIdpRequest(t))}_getReauthenticationResolver(e){return I0(e,this._buildIdpRequest())}_buildIdpRequest(e){const t={requestUri:this.params.requestUri,sessionId:this.params.sessionId,postBody:this.params.postBody,tenantId:this.params.tenantId,pendingToken:this.params.pendingToken,returnSecureToken:!0,returnIdpCredential:!0};return e&&(t.idToken=e),t}}function Qae(n){return X$(n.auth,new FD(n),n.bypassAuthState)}function Jae(n){const{auth:e,user:t}=n;return Lt(t,e,"internal-error"),Sae(t,new FD(n),n.bypassAuthState)}async function Xae(n){const{auth:e,user:t}=n;return Lt(t,e,"internal-error"),Eae(t,new FD(n),n.bypassAuthState)}/**
1400 * @license
1401 * Copyright 2020 Google LLC
1402 *
1403 * Licensed under the Apache License, Version 2.0 (the "License");
1404 * you may not use this file except in compliance with the License.
1405 * You may obtain a copy of the License at
1406 *
1407 *   http://www.apache.org/licenses/LICENSE-2.0
1408 *
1409 * Unless required by applicable law or agreed to in writing, software
1410 * distributed under the License is distributed on an "AS IS" BASIS,
1411 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1412 * See the License for the specific language governing permissions and
1413 * limitations under the License.
1414 */class dH{constructor(e,t,r,s,a=!1){this.auth=e,this.resolver=r,this.user=s,this.bypassAuthState=a,this.pendingPromise=null,this.eventManager=null,this.filter=Array.isArray(t)?t:[t]}execute(){return new Promise(async(e,t)=>{this.pendingPromise={resolve:e,reject:t};try{this.eventManager=await this.resolver._initialize(this.auth),await this.onExecution(),this.eventManager.registerConsumer(this)}catch(r){this.reject(r)}})}async onAuthEvent(e){const{urlResponse:t,sessionId:r,postBody:s,tenantId:a,error:o,type:l}=e;if(o){this.reject(o);return}const c={auth:this.auth,requestUri:t,sessionId:r,tenantId:a||void 0,postBody:s||void 0,user:this.user,bypassAuthState:this.bypassAuthState};try{this.resolve(await this.getIdpTask(l)(c))}catch(d){this.reject(d)}}onError(e){this.reject(e)}getIdpTask(e){switch(e){case"signInViaPopup":case"signInViaRedirect":return Qae;case"linkViaPopup":case"linkViaRedirect":return Xae;case"reauthViaPopup":case"reauthViaRedirect":return Jae;default:tl(this.auth,"internal-error")}}resolve(e){Gd(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.resolve(e),this.unregisterAndCleanUp()}reject(e){Gd(this.pendingPromise,"Pending promise was never set"),this.pendingPromise.reject(e),this.unregisterAndCleanUp()}unregisterAndCleanUp(){this.eventManager&&this.eventManager.unregisterConsumer(this),this.pendingPromise=null,this.cleanUp()}}/**
1415 * @license
1416 * Copyright 2020 Google LLC
1417 *
1418 * Licensed under the Apache License, Version 2.0 (the "License");
1419 * you may not use this file except in compliance with the License.
1420 * You may obtain a copy of the License at
1421 *
1422 *   http://www.apache.org/licenses/LICENSE-2.0
1423 *
1424 * Unless required by applicable law or agreed to in writing, software
1425 * distributed under the License is distributed on an "AS IS" BASIS,
1426 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1427 * See the License for the specific language governing permissions and
1428 * limitations under the License.
1429 */const Zae=new Qy(2e3,1e4);async function eie(n,e,t){if(xo(n.app))return Promise.reject(Ml(n,"operation-not-supported-in-this-environment"));const r=zh(n);Dse(n,e,OD);const s=cH(r,t);return new Yf(r,"signInViaPopup",e,s).executeNotNull()}class Yf extends dH{constructor(e,t,r,s,a){super(e,t,s,a),this.provider=r,this.authWindow=null,this.pollId=null,Yf.currentPopupAction&&Yf.currentPopupAction.cancel(),Yf.currentPopupAction=this}async executeNotNull(){const e=await this.execute();return Lt(e,this.auth,"internal-error"),e}async onExecution(){Gd(this.filter.length===1,"Popup operations only handle one event");const e=MD();this.authWindow=await this.resolver._openPopup(this.auth,this.provider,this.filter[0],e),this.authWindow.associatedEvent=e,this.resolver._originValidation(this.auth).catch(t=>{this.reject(t)}),this.resolver._isIframeWebStorageSupported(this.auth,t=>{t||this.reject(Ml(this.auth,"web-storage-unsupported"))}),this.pollUserCancellation()}get eventId(){var e;return((e=this.authWindow)==null?void 0:e.associatedEvent)||null}cancel(){this.reject(Ml(this.auth,"cancelled-popup-request"))}cleanUp(){this.authWindow&&this.authWindow.close(),this.pollId&&window.clearTimeout(this.pollId),this.authWindow=null,this.pollId=null,Yf.currentPopupAction=null}pollUserCancellation(){const e=()=>{var t,r;if((r=(t=this.authWindow)==null?void 0:t.window)!=null&&r.closed){this.pollId=window.setTimeout(()=>{this.pollId=null,this.reject(Ml(this.auth,"popup-closed-by-user"))},8e3);return}this.pollId=window.setTimeout(e,Zae.get())};e()}}Yf.currentPopupAction=null;/**
1430 * @license
1431 * Copyright 2020 Google LLC
1432 *
1433 * Licensed under the Apache License, Version 2.0 (the "License");
1434 * you may not use this file except in compliance with the License.
1435 * You may obtain a copy of the License at
1436 *
1437 *   http://www.apache.org/licenses/LICENSE-2.0
1438 *
1439 * Unless required by applicable law or agreed to in writing, software
1440 * distributed under the License is distributed on an "AS IS" BASIS,
1441 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1442 * See the License for the specific language governing permissions and
1443 * limitations under the License.
1444 */const tie="pendingRedirect",tC=new Map;class nie extends dH{constructor(e,t,r=!1){super(e,["signInViaRedirect","linkViaRedirect","reauthViaRedirect","unknown"],t,void 0,r),this.eventId=null}async execute(){let e=tC.get(this.auth._key());if(!e){try{const r=await rie(this.resolver,this.auth)?await super.execute():null;e=()=>Promise.resolve(r)}catch(t){e=()=>Promise.reject(t)}tC.set(this.auth._key(),e)}return this.bypassAuthState||tC.set(this.auth._key(),()=>Promise.resolve(null)),e()}async onAuthEvent(e){if(e.type==="signInViaRedirect")return super.onAuthEvent(e);if(e.type==="unknown"){this.resolve(null);return}if(e.eventId){const t=await this.auth._redirectUserForId(e.eventId);if(t)return this.user=t,super.onAuthEvent(e);this.resolve(null)}}async onExecution(){}cleanUp(){}}async function rie(n,e){const t=iie(e),r=aie(n);if(!await r._isAvailable())return!1;const s=await r._get(t)==="true";return await r._remove(t),s}function sie(n,e){tC.set(n._key(),e)}function aie(n){return _d(n._redirectPersistence)}function iie(n){return eC(tie,n.config.apiKey,n.name)}async function oie(n,e,t=!1){if(xo(n.app))return Promise.reject(Pd(n));const r=zh(n),s=cH(r,e),o=await new nie(r,s,t).execute();return o&&!t&&(delete o.user._redirectEventId,await r._persistUserIfCurrent(o.user),await r._setRedirectUser(null,e)),o}/**
1445 * @license
1446 * Copyright 2020 Google LLC
1447 *
1448 * Licensed under the Apache License, Version 2.0 (the "License");
1449 * you may not use this file except in compliance with the License.
1450 * You may obtain a copy of the License at
1451 *
1452 *   http://www.apache.org/licenses/LICENSE-2.0
1453 *
1454 * Unless required by applicable law or agreed to in writing, software
1455 * distributed under the License is distributed on an "AS IS" BASIS,
1456 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1457 * See the License for the specific language governing permissions and
1458 * limitations under the License.
1459 */const lie=600*1e3;class cie{constructor(e){this.auth=e,this.cachedEventUids=new Set,this.consumers=new Set,this.queuedRedirectEvent=null,this.hasHandledPotentialRedirect=!1,this.lastProcessedEventTime=Date.now()}registerConsumer(e){this.consumers.add(e),this.queuedRedirectEvent&&this.isEventForConsumer(this.queuedRedirectEvent,e)&&(this.sendToConsumer(this.queuedRedirectEvent,e),this.saveEventToCache(this.queuedRedirectEvent),this.queuedRedirectEvent=null)}unregisterConsumer(e){this.consumers.delete(e)}onEvent(e){if(this.hasEventBeenHandled(e))return!1;let t=!1;return this.consumers.forEach(r=>{this.isEventForConsumer(e,r)&&(t=!0,this.sendToConsumer(e,r),this.saveEventToCache(e))}),this.hasHandledPotentialRedirect||!die(e)||(this.hasHandledPotentialRedirect=!0,t||(this.queuedRedirectEvent=e,t=!0)),t}sendToConsumer(e,t){var r;if(e.error&&!uH(e)){const s=((r=e.error.code)==null?void 0:r.split("auth/")[1])||"internal-error";t.onError(Ml(this.auth,s))}else t.onAuthEvent(e)}isEventForConsumer(e,t){const r=t.eventId===null||!!e.eventId&&e.eventId===t.eventId;return t.filter.includes(e.type)&&r}hasEventBeenHandled(e){return Date.now()-this.lastProcessedEventTime>=lie&&this.cachedEventUids.clear(),this.cachedEventUids.has(d3(e))}saveEventToCache(e){this.cachedEventUids.add(d3(e)),this.lastProcessedEventTime=Date.now()}}function d3(n){return[n.type,n.eventId,n.sessionId,n.tenantId].filter(e=>e).join("-")}function uH({type:n,error:e}){return n==="unknown"&&(e==null?void 0:e.code)==="auth/no-auth-event"}function die(n){switch(n.type){case"signInViaRedirect":case"linkViaRedirect":case"reauthViaRedirect":return!0;case"unknown":return uH(n);default:return!1}}/**
1460 * @license
1461 * Copyright 2020 Google LLC
1462 *
1463 * Licensed under the Apache License, Version 2.0 (the "License");
1464 * you may not use this file except in compliance with the License.
1465 * You may obtain a copy of the License at
1466 *
1467 *   http://www.apache.org/licenses/LICENSE-2.0
1468 *
1469 * Unless required by applicable law or agreed to in writing, software
1470 * distributed under the License is distributed on an "AS IS" BASIS,
1471 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1472 * See the License for the specific language governing permissions and
1473 * limitations under the License.
1474 */async function uie(n,e={}){return eu(n,"GET","/v1/projects",e)}/**
1475 * @license
1476 * Copyright 2020 Google LLC
1477 *
1478 * Licensed under the Apache License, Version 2.0 (the "License");
1479 * you may not use this file except in compliance with the License.
1480 * You may obtain a copy of the License at
1481 *
1482 *   http://www.apache.org/licenses/LICENSE-2.0
1483 *
1484 * Unless required by applicable law or agreed to in writing, software
1485 * distributed under the License is distributed on an "AS IS" BASIS,
1486 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1487 * See the License for the specific language governing permissions and
1488 * limitations under the License.
1489 */const hie=/^\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}$/,fie=/^https?/;async function mie(n){if(n.config.emulator)return;const{authorizedDomains:e}=await uie(n);for(const t of e)try{if(pie(t))return}catch{}tl(n,"unauthorized-domain")}function pie(n){const e=f_(),{protocol:t,hostname:r}=new URL(e);if(n.startsWith("chrome-extension://")){const o=new URL(n);return o.hostname===""&&r===""?t==="chrome-extension:"&&n.replace("chrome-extension://","")===e.replace("chrome-extension://",""):t==="chrome-extension:"&&o.hostname===r}if(!fie.test(t))return!1;if(hie.test(n))return r===n;const s=n.replace(/\./g,"\\.");return new RegExp("^(.+\\."+s+"|"+s+")$","i").test(r)}/**
1490 * @license
1491 * Copyright 2020 Google LLC.
1492 *
1493 * Licensed under the Apache License, Version 2.0 (the "License");
1494 * you may not use this file except in compliance with the License.
1495 * You may obtain a copy of the License at
1496 *
1497 *   http://www.apache.org/licenses/LICENSE-2.0
1498 *
1499 * Unless required by applicable law or agreed to in writing, software
1500 * distributed under the License is distributed on an "AS IS" BASIS,
1501 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1502 * See the License for the specific language governing permissions and
1503 * limitations under the License.
1504 */const gie=new Qy(3e4,6e4);function u3(){const n=_c().___jsl;if(n!=null&&n.H){for(const e of Object.keys(n.H))if(n.H[e].r=n.H[e].r||[],n.H[e].L=n.H[e].L||[],n.H[e].r=[...n.H[e].L],n.CP)for(let t=0;t<n.CP.length;t++)n.CP[t]=null}}function xie(n){return new Promise((e,t)=>{var s,a,o;function r(){u3(),gapi.load("gapi.iframes",{callback:()=>{e(gapi.iframes.getContext())},ontimeout:()=>{u3(),t(Ml(n,"network-request-failed"))},timeout:gie.get()})}if((a=(s=_c().gapi)==null?void 0:s.iframes)!=null&&a.Iframe)e(gapi.iframes.getContext());else if((o=_c().gapi)!=null&&o.load)r();else{const l=oae("iframefcb");return _c()[l]=()=>{gapi.load?r():t(Ml(n,"network-request-failed"))},W$(`${iae()}?onload=${l}`).catch(c=>t(c))}}).catch(e=>{throw nC=null,e})}let nC=null;function bie(n){return nC=nC||xie(n),nC}/**
1505 * @license
1506 * Copyright 2020 Google LLC.
1507 *
1508 * Licensed under the Apache License, Version 2.0 (the "License");
1509 * you may not use this file except in compliance with the License.
1510 * You may obtain a copy of the License at
1511 *
1512 *   http://www.apache.org/licenses/LICENSE-2.0
1513 *
1514 * Unless required by applicable law or agreed to in writing, software
1515 * distributed under the License is distributed on an "AS IS" BASIS,
1516 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1517 * See the License for the specific language governing permissions and
1518 * limitations under the License.
1519 */const yie=new Qy(5e3,15e3),vie="__/auth/iframe",Bie="emulator/auth/iframe",wie={style:{position:"absolute",top:"-100px",width:"1px",height:"1px"},"aria-hidden":"true",tabindex:"-1"},Cie=new Map([["identitytoolkit.googleapis.com","p"],["staging-identitytoolkit.sandbox.googleapis.com","s"],["test-identitytoolkit.sandbox.googleapis.com","t"]]);function Eie(n){const e=n.config;Lt(e.authDomain,n,"auth-domain-config-required");const t=e.emulator?DD(e,Bie):`https://${n.config.authDomain}/${vie}`,r={apiKey:e.apiKey,appName:n.name,v:_g},s=Cie.get(n.config.apiHost);s&&(r.eid=s);const a=n._getFrameworks();return a.length&&(r.fw=a.join(",")),`${t}?${Wy(r).slice(1)}`}async function Sie(n){const e=await bie(n),t=_c().gapi;return Lt(t,n,"internal-error"),e.open({where:document.body,url:Eie(n),messageHandlersFilter:t.iframes.CROSS_ORIGIN_IFRAMES_FILTER,attributes:wie,dontclear:!0},r=>new Promise(async(s,a)=>{await r.restyle({setHideOnLeave:!1});const o=Ml(n,"network-request-failed"),l=_c().setTimeout(()=>{a(o)},yie.get());function c(){_c().clearTimeout(l),s(r)}r.ping(c).then(c,()=>{a(o)})}))}/**
1520 * @license
1521 * Copyright 2020 Google LLC.
1522 *
1523 * Licensed under the Apache License, Version 2.0 (the "License");
1524 * you may not use this file except in compliance with the License.
1525 * You may obtain a copy of the License at
1526 *
1527 *   http://www.apache.org/licenses/LICENSE-2.0
1528 *
1529 * Unless required by applicable law or agreed to in writing, software
1530 * distributed under the License is distributed on an "AS IS" BASIS,
1531 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1532 * See the License for the specific language governing permissions and
1533 * limitations under the License.
1534 */const Tie={location:"yes",resizable:"yes",statusbar:"yes",toolbar:"no"},Aie=500,kie=600,Nie="_blank",_ie="http://localhost";class h3{constructor(e){this.window=e,this.associatedEvent=null}close(){if(this.window)try{this.window.close()}catch{}}}function Iie(n,e,t,r=Aie,s=kie){const a=Math.max((window.screen.availHeight-s)/2,0).toString(),o=Math.max((window.screen.availWidth-r)/2,0).toString();let l="";const c={...Tie,width:r.toString(),height:s.toString(),top:a,left:o},d=Js().toLowerCase();t&&(l=V$(d)?Nie:t),F$(d)&&(e=e||_ie,c.scrollbars="yes");const h=Object.entries(c).reduce((p,[x,y])=>`${p}${x}=${y},`,"");if(Jse(d)&&l!=="_self")return Die(e||"",l),new h3(null);const m=window.open(e||"",l,h);Lt(m,n,"popup-blocked");try{m.focus()}catch{}return new h3(m)}function Die(n,e){const t=document.createElement("a");t.href=n,t.target=e;const r=document.createEvent("MouseEvent");
1534r.initMouseEvent("click",!0,!0,window,1,0,0,0,0,!1,!1,!1,!1,1,null),t.dispatchEvent(r)}/**
1535 * @license
1536 * Copyright 2021 Google LLC
1537 *
1538 * Licensed under the Apache License, Version 2.0 (the "License");
1539 * you may not use this file except in compliance with the License.
1540 * You may obtain a copy of the License at
1541 *
1542 *   http://www.apache.org/licenses/LICENSE-2.0
1543 *
1544 * Unless required by applicable law or agreed to in writing, software
1545 * distributed under the License is distributed on an "AS IS" BASIS,
1546 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1547 * See the License for the specific language governing permissions and
1548 * limitations under the License.
1549 */const jie="__/auth/handler",Rie="emulator/auth/handler",Pie=encodeURIComponent("fac");async function f3(n,e,t,r,s,a){Lt(n.config.authDomain,n,"auth-domain-config-required"),Lt(n.config.apiKey,n,"invalid-api-key");const o={apiKey:n.config.apiKey,appName:n.name,authType:t,redirectUrl:r,v:_g,eventId:s};if(e instanceof OD){e.setDefaultLanguage(n.languageCode),o.providerId=e.providerId||"",xre(e.getCustomParameters())||(o.customParameters=JSON.stringify(e.getCustomParameters()));for(const[h,m]of Object.entries({}))o[h]=m}if(e instanceof Xy){const h=e.getScopes().filter(m=>m!=="");h.length>0&&(o.scopes=h.join(","))}n.tenantId&&(o.tid=n.tenantId);const l=o;for(const h of Object.keys(l))l[h]===void 0&&delete l[h];const c=await n._getAppCheckToken(),d=c?`#${Pie}=${encodeURIComponent(c)}`:"";return`${Lie(n)}?${Wy(l).slice(1)}${d}`}function Lie({config:n}){return n.emulator?DD(n,Rie):`https://${n.authDomain}/${jie}`}/**
1550 * @license
1551 * Copyright 2020 Google LLC
1552 *
1553 * Licensed under the Apache License, Version 2.0 (the "License");
1554 * you may not use this file except in compliance with the License.
1555 * You may obtain a copy of the License at
1556 *
1557 *   http://www.apache.org/licenses/LICENSE-2.0
1558 *
1559 * Unless required by applicable law or agreed to in writing, software
1560 * distributed under the License is distributed on an "AS IS" BASIS,
1561 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1562 * See the License for the specific language governing permissions and
1563 * limitations under the License.
1564 */const vk="webStorageSupport";class Oie{constructor(){this.eventManagers={},this.iframes={},this.originValidationPromises={},this._redirectPersistence=rH,this._completeRedirectFn=oie,this._overrideRedirectResult=sie}async _openPopup(e,t,r,s){var o;Gd((o=this.eventManagers[e._key()])==null?void 0:o.manager,"_initialize() not called before _openPopup()");const a=await f3(e,t,r,f_(),s);return Iie(e,a,MD())}async _openRedirect(e,t,r,s){await this._originValidation(e);const a=await f3(e,t,r,f_(),s);return Uae(a),new Promise(()=>{})}_initialize(e){const t=e._key();if(this.eventManagers[t]){const{manager:s,promise:a}=this.eventManagers[t];return s?Promise.resolve(s):(Gd(a,"If manager is not set, promise should be"),a)}const r=this.initAndGetManager(e);return this.eventManagers[t]={promise:r},r.catch(()=>{delete this.eventManagers[t]}),r}async initAndGetManager(e){const t=await Sie(e),r=new cie(e);return t.register("authEvent",s=>(Lt(s==null?void 0:s.authEvent,e,"invalid-auth-event"),{status:r.onEvent(s.authEvent)?"ACK":"ERROR"}),gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER),this.eventManagers[e._key()]={manager:r},this.iframes[e._key()]=t,r}_isIframeWebStorageSupported(e,t){this.iframes[e._key()].send(vk,{type:vk},s=>{var o;const a=(o=s==null?void 0:s[0])==null?void 0:o[vk];a!==void 0&&t(!!a),tl(e,"internal-error")},gapi.iframes.CROSS_ORIGIN_IFRAMES_FILTER)}_originValidation(e){const t=e._key();return this.originValidationPromises[t]||(this.originValidationPromises[t]=mie(e)),this.originValidationPromises[t]}get _shouldInitProactively(){return q$()||U$()||RD()}}const Mie=Oie;var m3="@firebase/auth",p3="1.13.6";/**
1565 * @license
1566 * Copyright 2020 Google LLC
1567 *
1568 * Licensed under the Apache License, Version 2.0 (the "License");
1569 * you may not use this file except in compliance with the License.
1570 * You may obtain a copy of the License at
1571 *
1572 *   http://www.apache.org/licenses/LICENSE-2.0
1573 *
1574 * Unless required by applicable law or agreed to in writing, softw
1574are
1575 * distributed under the License is distributed on an "AS IS" BASIS,
1576 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1577 * See the License for the specific language governing permissions and
1578 * limitations under the License.
1579 */class Fie{constructor(e){this.auth=e,this.internalListeners=new Map}getUid(){var e;return this.assertAuthConfigured(),((e=this.auth.currentUser)==null?void 0:e.uid)||null}async getToken(e){return this.assertAuthConfigured(),await this.auth._initializationPromise,this.auth.currentUser?{accessToken:await this.auth.currentUser.getIdToken(e)}:null}addAuthTokenListener(e){if(this.assertAuthConfigured(),this.internalListeners.has(e))return;const t=this.auth.onIdTokenChanged(r=>{e((r==null?void 0:r.stsTokenManager.accessToken)||null)});this.internalListeners.set(e,t),this.updateProactiveRefresh()}removeAuthTokenListener(e){this.assertAuthConfigured();const t=this.internalListeners.get(e);t&&(this.internalListeners.delete(e),t(),this.updateProactiveRefresh())}assertAuthConfigured(){Lt(this.auth._initializationPromise,"dependent-sdk-initialized-before-auth")}updateProactiveRefresh(){this.internalListeners.size>0?this.auth._startProactiveRefresh():this.auth._stopProactiveRefresh()}}/**
1580 * @license
1581 * Copyright 2020 Google LLC
1582 *
1583 * Licensed under the Apache License, Version 2.0 (the "License");
1584 * you may not use this file except in compliance with the License.
1585 * You may obtain a copy of the License at
1586 *
1587 *   http://www.apache.org/licenses/LICENSE-2.0
1588 *
1589 * Unless required by applicable law or agreed to in writing, software
1590 * distributed under the License is distributed on an "AS IS" BASIS,
1591 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1592 * See the License for the specific language governing permissions and
1593 * limitations under the License.
1594 */function Uie(n){switch(n){case"Node":return"node";case"ReactNative":return"rn";case"Worker":return"webworker";case"Cordova":return"cordova";case"WebExtension":return"web-extension";default:return}}function Vie(n){H0(new ym("auth",(e,{options:t})=>{const r=e.getProvider("app").getImmediate(),s=e.getProvider("heartbeat"),a=e.getProvider("app-check-internal"),{apiKey:o,authDomain:l}=r.options;Lt(o&&!o.includes(":"),"invalid-api-key",{appName:r.name});const c={apiKey:o,authDomain:l,clientPlatform:n,apiHost:"identitytoolkit.googleapis.com",tokenApiHost:"securetoken.googleapis.com",apiScheme:"https",sdkClientVersion:K$(n)},d=new rae(r,s,a,c);return hae(d,t),d},"PUBLIC").setInstantiationMode("EXPLICIT").setInstanceCreatedCallback((e,t,r)=>{e.getProvider("auth-internal").initialize()})),H0(new ym("auth-internal",e=>{const t=zh(e.getProvider("auth").getImmediate());return(r=>new Fie(r))(t)},"PRIVATE").setInstantiationMode("EXPLICIT")),ph(m3,p3,Uie(n)),ph(m3,p3,"esm2020")}/**
1595 * @license
1596 * Copyright 2021 Google LLC
1597 *
1598 * Licensed under the Apache License, Version 2.0 (the "License");
1599 * you may not use this file except in compliance with the License.
1600 * You may obtain a copy of the License at
1601 *
1602 *   http://www.apache.org/licenses/LICENSE-2.0
1603 *
1604 * Unless required by applicable law or agreed to in writing, software
1605 * distributed under the License is distributed on an "AS IS" BASIS,
1606 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1607 * See the License for the specific language governing permissions and
1608 * limitations under the License.
1609 */const Gie=300,$ie=B$("authIdTokenMaxAge")||Gie;let g3=null;const Hie=n=>async e=>{const t=e&&await e.getIdTokenResult(),r=t&&(new Date().getTime()-Date.parse(t.issuedAtTime))/1e3;if(r&&r>$ie)return;const s=t==null?void 0:t.token;g3!==s&&(g3=s,await fetch(n,{method:s?"POST":"DELETE",headers:s?{Authorization:`Bearer ${s}`}:{}}))};function zie(n=_D()){const e=Yy(n,"auth");if(e.isInitialized())return e.getImmediate();const t=uae(n,{popupRedirectResolver:Mie,persistence:[Yae,Oae,rH]}),r=B$("authTokenSyncURL");if(r&&typeof isSecureContext=="boolean"&&isSecureContext){const a=new URL(r,location.origin);if(location.origin===a.origin){const o=Hie(a.toString());Dae(t,o,()=>o(t.currentUser)),Iae(t,l=>o(l))}}const s=y$("auth");return s&&fae(t,`http://${s}`),t}function qie(){var n;return((n=document.getElementsByTagName("head"))==null?void 0:n[0])??document}sae({loadJS(n){return new Promise((e,t)=>
1609{const r=document.createElement("script");r.setAttribute("src",n),r.onload=e,r.onerror=s=>{const a=Ml("internal-error");a.customData=s,t(a)},r.type="text/javascript",r.charset="UTF-8",qie().appendChild(r)})},gapiScript:"https://apis.google.com/js/api.js",recaptchaV2Script:"https://www.google.com/recaptcha/api.js",recaptchaEnterpriseScript:"https://www.google.com/recaptcha/enterprise.js?render="});Vie("Browser");var x3=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1610Copyright The Closure Library Authors.
1611SPDX-License-Identifier: Apache-2.0
1612*/var gh,hH;(function(){var n;/** @license
1613
1614 Copyright The Closure Library Authors.
1615 SPDX-License-Identifier: Apache-2.0
1616*/function e(_,I){function D(){}D.prototype=I.prototype,_.F=I.prototype,_.prototype=new D,_.prototype.constructor=_,_.D=function(j,O,M){for(var U=Array(arguments.length-2),ee=2;ee<arguments.length;ee++)U[ee-2]=arguments[ee];return I.prototype[O].apply(j,U)}}function t(){this.blockSize=-1}function r(){this.blockSize=-1,this.blockSize=64,this.g=Array(4),this.C=Array(this.blockSize),this.o=this.h=0,this.u()}e(r,t),r.prototype.u=function(){this.g[0]=1732584193,this.g[1]=4023233417,this.g[2]=2562383102,this.g[3]=271733878,this.o=this.h=0};function s(_,I,D){D||(D=0);const j=Array(16);if(typeof I=="string")for(var O=0;O<16;++O)j[O]=I.charCodeAt(D++)|I.charCodeAt(D++)<<8|I.charCodeAt(D++)<<16|I.charCodeAt(D++)<<24;else for(O=0;O<16;++O)j[O]=I[D++]|I[D++]<<8|I[D++]<<16|I[D++]<<24;I=_.g[0],D=_.g[1],O=_.g[2];let M=_.g[3],U;U=I+(M^D&(O^M))+j[0]+3614090360&4294967295,I=D+(U<<7&4294967295|U>>>25),U=M+(O^I&(D^O))+j[1]+3905402710&4294967295,M=I+(U<<12&4294967295|U>>>20),U=O+(D^M&(I^D))+j[2]+606105819&4294967295,O=M+(U<<17&4294967295|U>>>15),U=D+(I^O&(M^I))+j[3]+3250441966&4294967295,D=O+(U<<22&4294967295|U>>>10),U=I+(M^D&(O^M))+j[4]+4118548399&4294967295,I=D+(U<<7&4294967295|U>>>25),U=M+(O^I&(D^O))+j[5]+1200080426&4294967295,M=I+(U<<12&4294967295|U>>>20),U=O+(D^M&(I^D))+j[6]+2821735955&4294967295,O=M+(U<<17&4294967295|U>>>15),U=D+(I^O&(M^I))+j[7]+4249261313&4294967295,D=O+(U<<22&4294967295|U>>>10),U=I+(M^D&(O^M))+j[8]+1770035416&4294967295,I=D+(U<<7&4294967295|U>>>25),U=M+(O^I&(D^O))+j[9]+2336552879&4294967295,M=I+(U<<12&4294967295|U>>>20),U=O+(D^M&(I^D))+j[10]+4294925233&4294967295,O=M+(U<<17&4294967295|U>>>15),U=D+(I^O&(M^I))+j[11]+2304563134&4294967295,D=O+(U<<22&4294967295|U>>>10),U=I+(M^D&(O^M))+j[12]+1804603682&4294967295,I=D+(U<<7&4294967295|U>>>25),U=M+(O^I&(D^O))+j[13]+4254626195&4294967295,M=I+(U<<12&4294967295|U>>>20),U=O+(D^M&(I^D))+j[14]+2792965006&4294967295,O=M+(U<<17&4294967295|U>>>15),U=D+(I^O&(M^I))+j[15]+1236535329&4294967295,D=O+(U<<22&4294967295|U>>>10),U=I+(O^M&(D^O))+j[1]+4129170786&4294967295,I=D+(U<<5&4294967295|U>>>27),U=M+(D^O&(I^D))+j[6]+3225465664&4294967295,M=I+(U<<9&4294967295|U>>>23),U=O+(I^D&(M^I))+j[11]+643717713&4294967295,O=M+(U<<14&4294967295|U>>>18),U=D+(M^I&(O^M))+j[0]+3921069994&4294967295,D=O+(U<<20&4294967295|U>>>12),U=I+(O^M&(D^O))+j[5]+3593408605&4294967295,I=D+(U<<5&4294967295|U>>>27),U=M+(D^O&(I^D))+j[10]+38016083&4294967295,M=I+(U<<9&4294967295|U>>>23),U=O+(I^D&(M^I))+j[15]+3634488961&4294967295,O=M+(U<<14&4294967295|U>>>18),U=D+(M^I&(O^M))+j[4]+3889429448&4294967295,D=O+(U<<20&4294967295|U>>>12),U=I+(O^M&(D^O))+j[9]+568446438&4294967295,I=D+(U<<5&4294967295|U>>>27),U=M+(D^O&(I^D))+j[14]+3275163606&4294967295,M=I+(U<<9&4294967295|U>>>23),U=O+(I^D&(M^I))+j[3]+4107603335&4294967295,O=M+(U<<14&4294967295|U>>>18),U=D+(M^I&(O^M))+j[8]+1163531501&4294967295,D=O+(U<<20&4294967295|U>>>12),U=I+(O^M&(D^O))+j[13]+2850285829&4294967295,I=D+(U<<5&4294967295|U>>>27),U=M+(D^O&(I^D))+j[2]+4243563512&4294967295,M=I+(U<<9&4294967295|U>>>23),U=O+(I^D&(M^I))+j[7]+1735328473&4294967295,O=M+(U<<14&4294967295|U>>>18),U=D+(M^I&(O^M))+j[12]+2368359562&4294967295,D=O+(U<<20&4294967295|U>>>12),U=I+(D^O^M)+j[5]+4294588738&4294967295,I=D+(U<<4&4294967295|U>>>28),U=M+(I^D^O)+j[8]+2272392833&4294967295,M=I+(U<<11&4294967295|U>>>21),U=O+(M^I^D)+j[11]+1839030562&4294967295,O=M+(U<<16&4294967295|U>>>16),U=D+(O^M^I)+j[14]+4259657740&4294967295,D=O+(U<<23&4294967295|U>>>9),U=I+(D^O^M)+j[1]+2763975236&4294967295,I=D+(U<<4&4294967295|U>>>28),U=M+(I^D^O)+j[4]+1272893353&4294967295,M=I+(U<<11&4294967295|U>>>21),U=O+(M^I^D)+j[7]+4139469664&4294967295,O=M+(U<<16&4294967295|U>>>16),U=D+(O^M^I)+j[10]+3200236656&4294967295,D=O+(U<<23&4294967295|U>>>9),U=I+(D^O^M)+j[13]+681279174&4294967295,I=D+(U<<4&4294967295|U>>>28),U=M+(I^D^O)+j[0]+3936430074&4294967295,M=I+(U<<11&4294967295|U>>>21),U=O+(M^I^D)+j[3]+3572445317&4294967295,O=M+(U<<16&4294967295|U>>>16),U=D+(O^M^I)+j[6]+76029189&4294967295,D=O+(U<<23&4294967295|U>>>9),U=I+(D^O^M)+j[9]+3654602809&4294967295,I=D+(U<<4&4294967295|U>>>28),U=M+(I^D^O)+j[12]+3873151461&4294967295,M=I+(U<<11&4294967295|U>>>21),U=O+(M^I^D)+j[15]+530742520&4294967295,O=M+(U<<16&4294967295|U>>>16),U=D+(O^M^I)+j[2]+3299628645&4294967295,D=O+(U<<23&4294967295|U>>>9),U=I+(O^(D|~M))+j[0]+4096336452&4294967295,I=D+(U<<6&4294967295|U>>>26),U=M+(D^(I|~O))+j[7]+1126891415&4294967295,M=I+(U<<10&4294967295|U>>>
161622),U=O+(I^(M|~D))+j[14]+2878612391&4294967295,O=M+(U<<15&4294967295|U>>>17),U=D+(M^(O|~I))+j[5]+4237533241&4294967295,D=O+(U<<21&4294967295|U>>>11),U=I+(O^(D|~M))+j[12]+1700485571&4294967295,I=D+(U<<6&4294967295|U>>>26),U=M+(D^(I|~O))+j[3]+2399980690&4294967295,M=I+(U<<10&4294967295|U>>>22),U=O+(I^(M|~D))+j[10]+4293915773&4294967295,O=M+(U<<15&4294967295|U>>>17),U=D+(M^(O|~I))+j[1]+2240044497&4294967295,D=O+(U<<21&4294967295|U>>>11),U=I+(O^(D|~M))+j[8]+1873313359&4294967295,I=D+(U<<6&4294967295|U>>>26),U=M+(D^(I|~O))+j[15]+4264355552&4294967295,M=I+(U<<10&4294967295|U>>>22),U=O+(I^(M|~D))+j[6]+2734768916&4294967295,O=M+(U<<15&4294967295|U>>>17),U=D+(M^(O|~I))+j[13]+1309151649&4294967295,D=O+(U<<21&4294967295|U>>>11),U=I+(O^(D|~M))+j[4]+4149444226&4294967295,I=D+(U<<6&4294967295|U>>>26),U=M+(D^(I|~O))+j[11]+3174756917&4294967295,M=I+(U<<10&4294967295|U>>>22),U=O+(I^(M|~D))+j[2]+718787259&4294967295,O=M+(U<<15&4294967295|U>>>17),U=D+(M^(O|~I))+j[9]+3951481745&4294967295,_.g[0]=_.g[0]+I&4294967295,_.g[1]=_.g[1]+(O+(U<<21&4294967295|U>>>11))&4294967295,_.g[2]=_.g[2]+O&4294967295,_.g[3]=_.g[3]+M&4294967295}r.prototype.v=function(_,I){I===void 0&&(I=_.length);const D=I-this.blockSize,j=this.C;let O=this.h,M=0;for(;M<I;){if(O==0)for(;M<=D;)s(this,_,M),M+=this.blockSize;if(typeof _=="string"){for(;M<I;)if(j[O++]=_.charCodeAt(M++),O==this.blockSize){s(this,j),O=0;break}}else for(;M<I;)if(j[O++]=_[M++],O==this.blockSize){s(this,j),O=0;break}}this.h=O,this.o+=I},r.prototype.A=function(){var _=Array((this.h<56?this.blockSize:this.blockSize*2)-this.h);_[0]=128;for(var I=1;I<_.length-8;++I)_[I]=0;I=this.o*8;for(var D=_.length-8;D<_.length;++D)_[D]=I&255,I/=256;for(this.v(_),_=Array(16),I=0,D=0;D<4;++D)for(let j=0;j<32;j+=8)_[I++]=this.g[D]>>>j&255;return _};function a(_,I){var D=l;return Object.prototype.hasOwnProperty.call(D,_)?D[_]:D[_]=I(_)}function o(_,I){this.h=I;const D=[];let j=!0;for(let O=_.length-1;O>=0;O--){const M=_[O]|0;j&&M==I||(D[O]=M,j=!1)}this.g=D}var l={};function c(_){return-128<=_&&_<128?a(_,function(I){return new o([I|0],I<0?-1:0)}):new o([_|0],_<0?-1:0)}function d(_){if(isNaN(_)||!isFinite(_))return m;if(_<0)return B(d(-_));const I=[];let D=1;for(let j=0;_>=D;j++)I[j]=_/D|0,D*=4294967296;return new o(I,0)}function h(_,I){if(_.length==0)throw Error("number format error: empty string");if(I=I||10,I<2||36<I)throw Error("radix out of range: "+I);if(_.charAt(0)=="-")return B(h(_.substring(1),I));if(_.indexOf("-")>=0)throw Error('number format error: interior "-" character');const D=d(Math.pow(I,8));let j=m;for(let M=0;M<_.length;M+=8){var O=Math.min(8,_.length-M);const U=parseInt(_.substring(M,M+O),I);O<8?(O=d(Math.pow(I,O)),j=j.j(O).add(d(U))):(j=j.j(D),j=j.add(d(U)))}return j}var m=c(0),p=c(1),x=c(16777216);n=o.prototype,n.m=function(){if(v(this))return-B(this).m();let _=0,I=1;for(let D=0;D<this.g.length;D++){const j=this.i(D);_+=(j>=0?j:4294967296+j)*I,I*=4294967296}return _},n.toString=function(_){if(_=_||10,_<2||36<_)throw Error("radix out of range: "+_);if(y(this))return"0";if(v(this))return"-"+B(this).toString(_);const I=d(Math.pow(_,6));var D=this;let j="";for(;;){const O=k(D,I).g;D=E(D,O.j(I));let M=((D.g.length>0?D.g[0]:D.h)>>>0).toString(_);if(D=O,y(D))return M+j;for(;M.length<6;)M="0"+M;j=M+j}},n.i=function(_){return _<0?0:_<this.g.length?this.g[_]:this.h};function y(_){if(_.h!=0)return!1;for(let I=0;I<_.g.length;I++)if(_.g[I]!=0)return!1;return!0}function v(_){return _.h==-1}n.l=function(_){return _=E(this,_),v(_)?-1:y(_)?0:1};function B(_){const I=_.g.length,D=[];for(let j=0;j<I;j++)D[j]=~_.g[j];return new o(D,~_.h).add(p)}n.abs=function(){return v(this)?B(this):this},n.add=function(_){const I=Math.max(this.g.length,_.g.length),D=[];let j=0;for(let O=0;O<=I;O++){let M=j+(this.i(O)&65535)+(_.i(O)&65535),U=(M>>>16)+(this.i(O)>>>16)+(_.i(O)>>>16);j=U>>>16,M&=65535,U&=65535,D[O]=U<<16|M}return new o(D,D[D.length-1]&-2147483648?-1:0)};function E(_,I){return _.add(B(I))}n.j=function(_){if(y(this)||y(_))return m;if(v(this))return v(_)?B(this).j(B(_)):B(B(this).j(_));if(v(_))return B(this.j(B(_)));if(this.l(x)<0&&_.l(x)<0)return d(this.m()*_.m());const I=this.g.length+_.g.length,D=[];for(var j=0;j<2*I;j++)D[j]=0;for(j=0;j<this.g.length;j++)for(let O=0;O<_.g.length;O++){const M=this.i(j)>>>16,U=this.i(j)&65535,ee=_.i(O)>>>16,ie=_.i(O)&65535;D[2*j+2*O]+=U*ie,N(D,2*j+2*O),D[2*j+2*O+1]+=M*ie,N(D,2*j+2*O+1),D[2*j+2*O+1]+=U*ee,N(D,2*j+2*O+1),D[2*j+2*O+2]+=M*ee,N(D,2*j+2*O+2)}for(_=0;_<I;_++)D[_]=D[2*_+1]<<16|D[2*_];for(_=I;_<2*I;_++)D[_]=0;
1616return new o(D,0)};function N(_,I){for(;(_[I]&65535)!=_[I];)_[I+1]+=_[I]>>>16,_[I]&=65535,I++}function T(_,I){this.g=_,this.h=I}function k(_,I){if(y(I))throw Error("division by zero");if(y(_))return new T(m,m);if(v(_))return I=k(B(_),I),new T(B(I.g),B(I.h));if(v(I))return I=k(_,B(I)),new T(B(I.g),I.h);if(_.g.length>30){if(v(_)||v(I))throw Error("slowDivide_ only works with positive integers.");for(var D=p,j=I;j.l(_)<=0;)D=P(D),j=P(j);var O=R(D,1),M=R(j,1);for(j=R(j,2),D=R(D,2);!y(j);){var U=M.add(j);U.l(_)<=0&&(O=O.add(D),M=U),j=R(j,1),D=R(D,1)}return I=E(_,O.j(I)),new T(O,I)}for(O=m;_.l(I)>=0;){for(D=Math.max(1,Math.floor(_.m()/I.m())),j=Math.ceil(Math.log(D)/Math.LN2),j=j<=48?1:Math.pow(2,j-48),M=d(D),U=M.j(I);v(U)||U.l(_)>0;)D-=j,M=d(D),U=M.j(I);y(M)&&(M=p),O=O.add(M),_=E(_,U)}return new T(O,_)}n.B=function(_){return k(this,_).h},n.and=function(_){const I=Math.max(this.g.length,_.g.length),D=[];for(let j=0;j<I;j++)D[j]=this.i(j)&_.i(j);return new o(D,this.h&_.h)},n.or=function(_){const I=Math.max(this.g.length,_.g.length),D=[];for(let j=0;j<I;j++)D[j]=this.i(j)|_.i(j);return new o(D,this.h|_.h)},n.xor=function(_){const I=Math.max(this.g.length,_.g.length),D=[];for(let j=0;j<I;j++)D[j]=this.i(j)^_.i(j);return new o(D,this.h^_.h)};function P(_){const I=_.g.length+1,D=[];for(let j=0;j<I;j++)D[j]=_.i(j)<<1|_.i(j-1)>>>31;return new o(D,_.h)}function R(_,I){const D=I>>5;I%=32;const j=_.g.length-D,O=[];for(let M=0;M<j;M++)O[M]=I>0?_.i(M+D)>>>I|_.i(M+D+1)<<32-I:_.i(M+D);return new o(O,_.h)}r.prototype.digest=r.prototype.A,r.prototype.reset=r.prototype.u,r.prototype.update=r.prototype.v,hH=r,o.prototype.add=o.prototype.add,o.prototype.multiply=o.prototype.j,o.prototype.modulo=o.prototype.B,o.prototype.compare=o.prototype.l,o.prototype.toNumber=o.prototype.m,o.prototype.toString=o.prototype.toString,o.prototype.getBits=o.prototype.i,o.fromNumber=d,o.fromString=h,gh=o}).apply(typeof x3<"u"?x3:typeof self<"u"?self:typeof window<"u"?window:{});var QB=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};/** @license
1617Copyright The Closure Library Authors.
1618SPDX-License-Identifier: Apache-2.0
1619*/var fH,Bb,mH,rC,g_,pH,gH,xH;(function(){var n,e=Object.defineProperty;function t(w){w=[typeof globalThis=="object"&&globalThis,w,typeof window=="object"&&window,typeof self=="object"&&self,typeof QB=="object"&&QB];for(var L=0;L<w.length;++L){var $=w[L];if($&&$.Math==Math)return $}throw Error("Cannot find global object")}var r=t(this);function s(w,L){if(L)e:{var $=r;w=w.split(".");for(var X=0;X<w.length-1;X++){var Se=w[X];if(!(Se in $))break e;$=$[Se]}w=w[w.length-1],X=$[w],L=L(X),L!=X&&L!=null&&e($,w,{configurable:!0,writable:!0,value:L})}}s("Symbol.dispose",function(w){return w||Symbol("Symbol.dispose")}),s("Array.prototype.values",function(w){return w||function(){return this[Symbol.iterator]()}}),s("Object.entries",function(w){return w||function(L){var $=[],X;for(X in L)Object.prototype.hasOwnProperty.call(L,X)&&$.push([X,L[X]]);return $}});/** @license
1620
1621 Copyright The Closure Library Authors.
1622 SPDX-License-Identifier: Apache-2.0
1623*/var a=a||{},o=this||self;function l(w){var L=typeof w;return L=="object"&&w!=null||L=="function"}function c(w,L,$){return w.call.apply(w.bind,arguments)}function d(w,L,$){return d=c,d.apply(null,arguments)}function h(w,L){var $=Array.prototype.slice.call(arguments,1);return function(){var X=$.slice();return X.push.apply(X,arguments),w.apply(this,X)}}function m(w,L){function $(){}$.prototype=L.prototype,w.Z=L.prototype,w.prototype=new $,w.prototype.constructor=w,w.Ob=function(X,Se,Re){for(var rt=Array(arguments.length-2),Kt=2;Kt<arguments.length;Kt++)rt[Kt-2]=arguments[Kt];return L.prototype[Se].apply(X,rt)}}var p=typeof AsyncContext<"u"&&typeof AsyncContext.Snapshot=="function"?w=>w&&AsyncContext.Snapshot.wrap(w):w=>w;function x(w){const L=w.length;if(L>0){const $=Array(L);for(let X=0;X<L;X++)$[X]=w[X];return $}return[]}function y(w,L){for(let X=1;X<arguments.length;X++){const Se=arguments[X];var $=typeof Se;if($=$!="object"?$:Se?Array.isArray(Se)?"array":$:"null",$=="array"||$=="object"&&typeof Se.length=="number"){$=w.length||0;const Re=Se.length||0;w.length=$+Re;for(let rt=0;rt<Re;rt++)w[$+rt]=Se[rt]}else w.push(Se)}}class v{constructor(L,$){this.i=L,this.j=$,this.h=0,this.g=null}get(){let L;return this.h>0?(this.h--,L=this.g,this.g=L.next,L.next=null):L=this.i(),L}}function B(w){o.setTimeout(()=>{throw w},0)}function E(){var w=_;let L=null;return w.g&&(L=w.g,w.g=w.g.next,w.g||(w.h=null),L.next=null),L}class N{constructor(){this.h=this.g=null}add(L,$){const X=T.get();X.set(L,$),this.h?this.h.next=X:this.g=X,this.h=X}}var T=new v(()=>new k,w=>w.reset());class k{constructor(){this.next=this.g=this.h=null}set(L,$){this.h=L,this.g=$,this.next=null}reset(){this.next=this.g=this.h=null}}let P,R=!1,_=new N,I=()=>{const w=Promise.resolve(void 0);P=()=>{w.then(D)}};function D(){for(var w;w=E();){try{w.h.call(w.g)}catch($){B($)}var L=T;L.j(w),L.h<100&&(L.h++,w.next=L.g,L.g=w)}R=!1}function j(){this.u=this.u,this.C=this.C}j.prototype.u=!1,j.prototype.dispose=function(){this.u||(this.u=!0,this.N())},j.prototype[Symbol.dispose]=function(){this.dispose()},j.prototype.N=function(){if(this.C)for(;this.C.length;)this.C.shift()()};function O(w,L){this.type=w,this.g=this.target=L,this.defaultPrevented=!1}O.prototype.h=function(){this.defaultPrevented=!0};var M=(function(){if(!o.addEventListener||!Object.defineProperty)return!1;var w=!1,L=Object.defineProperty({},"passive",{get:function(){w=!0}});try{const $=()=>{};
1623o.addEventListener("test",$,L),o.removeEventListener("test",$,L)}catch{}return w})();function U(w){return/^[\s\xa0]*$/.test(w)}function ee(w,L){O.call(this,w?w.type:""),this.relatedTarget=this.g=this.target=null,this.button=this.screenY=this.screenX=this.clientY=this.clientX=0,this.key="",this.metaKey=this.shiftKey=this.altKey=this.ctrlKey=!1,this.state=null,this.pointerId=0,this.pointerType="",this.i=null,w&&this.init(w,L)}m(ee,O),ee.prototype.init=function(w,L){const $=this.type=w.type,X=w.changedTouches&&w.changedTouches.length?w.changedTouches[0]:null;this.target=w.target||w.srcElement,this.g=L,L=w.relatedTarget,L||($=="mouseover"?L=w.fromElement:$=="mouseout"&&(L=w.toElement)),this.relatedTarget=L,X?(this.clientX=X.clientX!==void 0?X.clientX:X.pageX,this.clientY=X.clientY!==void 0?X.clientY:X.pageY,this.screenX=X.screenX||0,this.screenY=X.screenY||0):(this.clientX=w.clientX!==void 0?w.clientX:w.pageX,this.clientY=w.clientY!==void 0?w.clientY:w.pageY,this.screenX=w.screenX||0,this.screenY=w.screenY||0),this.button=w.button,this.key=w.key||"",this.ctrlKey=w.ctrlKey,this.altKey=w.altKey,this.shiftKey=w.shiftKey,this.metaKey=w.metaKey,this.pointerId=w.pointerId||0,this.pointerType=w.pointerType,this.state=w.state,this.i=w,w.defaultPrevented&&ee.Z.h.call(this)},ee.prototype.h=function(){ee.Z.h.call(this);const w=this.i;w.preventDefault?w.preventDefault():w.returnValue=!1};var ie="closure_listenable_"+(Math.random()*1e6|0),G=0;function Z(w,L,$,X,Se){this.listener=w,this.proxy=null,this.src=L,this.type=$,this.capture=!!X,this.ha=Se,this.key=++G,this.da=this.fa=!1}function z(w){w.da=!0,w.listener=null,w.proxy=null,w.src=null,w.ha=null}function se(w,L,$){for(const X in w)L.call($,w[X],X,w)}function re(w,L){for(const $ in w)L.call(void 0,w[$],$,w)}function H(w){const L={};for(const $ in w)L[$]=w[$];return L}const Y="constructor hasOwnProperty isPrototypeOf propertyIsEnumerable toLocaleString toString valueOf".split(" ");function de(w,L){let $,X;for(let Se=1;Se<arguments.length;Se++){X=arguments[Se];for($ in X)w[$]=X[$];for(let Re=0;Re<Y.length;Re++)$=Y[Re],Object.prototype.hasOwnProperty.call(X,$)&&(w[$]=X[$])}}function W(w){this.src=w,this.g={},this.h=0}W.prototype.add=function(w,L,$,X,Se){const Re=w.toString();w=this.g[Re],w||(w=this.g[Re]=[],this.h++);const rt=J(w,L,X,Se);return rt>-1?(L=w[rt],$||(L.fa=!1)):(L=new Z(L,this.src,Re,!!X,Se),L.fa=$,w.push(L)),L};function K(w,L){const $=L.type;if($ in w.g){var X=w.g[$],Se=Array.prototype.indexOf.call(X,L,void 0),Re;(Re=Se>=0)&&Array.prototype.splice.call(X,Se,1),Re&&(z(L),w.g[$].length==0&&(delete w.g[$],w.h--))}}function J(w,L,$,X){for(let Se=0;Se<w.length;++Se){const Re=w[Se];if(!Re.da&&Re.listener==L&&Re.capture==!!$&&Re.ha==X)return Se}return-1}var oe="closure_lm_"+(Math.random()*1e6|0),Ie={};function pe(w,L,$,X,Se){if(Array.isArray(L)){for(let Re=0;Re<L.length;Re++)pe(w,L[Re],$,X,Se);return null}return $=We($),w&&w[ie]?w.J(L,$,l(X)?!!X.capture:!1,Se):ye(w,L,$,!1,X,Se)}function ye(w,L,$,X,Se,Re){if(!L)throw Error("Invalid event type");const rt=l(Se)?!!Se.capture:!!Se;let Kt=je(w);if(Kt||(w[oe]=Kt=new W(w)),$=Kt.add(L,$,X,rt,Re),$.proxy)return $;if(X=he(),$.proxy=X,X.src=w,X.listener=$,w.addEventListener)M||(Se=rt),Se===void 0&&(Se=!1),w.addEventListener(L.toString(),X,Se);else if(w.attachEvent)w.attachEvent(Ce(L.toString()),X);else if(w.addListener&&w.removeListener)w.addListener(X);else throw Error("addEventListener and attachEvent are unavailable.");return $}function he(){function w($){return L.call(w.src,w.listener,$)}const L=Ae;return w}function le(w,L,$,X,Se){if(Array.isArray(L))for(var Re=0;Re<L.length;Re++)le(w,L[Re],$,X,Se);else X=l(X)?!!X.capture:!!X,$=We($),w&&w[ie]?(w=w.i,Re=String(L).toString(),Re in w.g&&(L=w.g[Re],$=J(L,$,X,Se),$>-1&&(z(L[$]),Array.prototype.splice.call(L,$,1),L.length==0&&(delete w.g[Re],w.h--)))):w&&(w=je(w))&&(L=w.g[L.toString()],w=-1,L&&(w=J(L,$,X,Se)),($=w>-1?L[w]:null)&&ce($))}function ce(w){if(typeof w!="number"&&w&&!w.da){var L=w.src;if(L&&L[ie])K(L.i,w);else{var $=w.type,X=w.proxy;L.removeEventListener?L.removeEventListener($,X,w.capture):L.detachEvent?L.detachEvent(Ce($),X):L.addListener&&L.removeListener&&L.removeListener(X),($=je(L))?(K($,w),$.h==0&&($.src=null,L[oe]=null)):z(w)}}}function Ce(w){return w in Ie?Ie[w]:Ie[w]="on"+w}
1623function Ae(w,L){if(w.da)w=!0;else{L=new ee(L,this);const $=w.listener,X=w.ha||w.src;w.fa&&ce(w),w=$.call(X,L)}return w}function je(w){return w=w[oe],w instanceof W?w:null}var nt="__closure_events_fn_"+(Math.random()*1e9>>>0);function We(w){return typeof w=="function"?w:(w[nt]||(w[nt]=function(L){return w.handleEvent(L)}),w[nt])}function dt(){j.call(this),this.i=new W(this),this.M=this,this.G=null}m(dt,j),dt.prototype[ie]=!0,dt.prototype.removeEventListener=function(w,L,$,X){le(this,w,L,$,X)};function bt(w,L){var $,X=w.G;if(X)for($=[];X;X=X.G)$.push(X);if(w=w.M,X=L.type||L,typeof L=="string")L=new O(L,w);else if(L instanceof O)L.target=L.target||w;else{var Se=L;L=new O(X,w),de(L,Se)}Se=!0;let Re,rt;if($)for(rt=$.length-1;rt>=0;rt--)Re=L.g=$[rt],Se=Yt(Re,X,!0,L)&&Se;if(Re=L.g=w,Se=Yt(Re,X,!0,L)&&Se,Se=Yt(Re,X,!1,L)&&Se,$)for(rt=0;rt<$.length;rt++)Re=L.g=$[rt],Se=Yt(Re,X,!1,L)&&Se}dt.prototype.N=function(){if(dt.Z.N.call(this),this.i){var w=this.i;for(const L in w.g){const $=w.g[L];for(let X=0;X<$.length;X++)z($[X]);delete w.g[L],w.h--}}this.G=null},dt.prototype.J=function(w,L,$,X){return this.i.add(String(w),L,!1,$,X)},dt.prototype.K=function(w,L,$,X){return this.i.add(String(w),L,!0,$,X)};function Yt(w,L,$,X){if(L=w.i.g[String(L)],!L)return!0;L=L.concat();let Se=!0;for(let Re=0;Re<L.length;++Re){const rt=L[Re];if(rt&&!rt.da&&rt.capture==$){const Kt=rt.listener,xs=rt.ha||rt.src;rt.fa&&K(w.i,rt),Se=Kt.call(xs,X)!==!1&&Se}}return Se&&!X.defaultPrevented}function Gt(w,L){if(typeof w!="function")if(w&&typeof w.handleEvent=="function")w=d(w.handleEvent,w);else throw Error("Invalid listener argument");return Number(L)>2147483647?-1:o.setTimeout(w,L||0)}function En(w){w.g=Gt(()=>{w.g=null,w.i&&(w.i=!1,En(w))},w.l);const L=w.h;w.h=null,w.m.apply(null,L)}class $t extends j{constructor(L,$){super(),this.m=L,this.l=$,this.h=null,this.i=!1,this.g=null}j(L){this.h=arguments,this.g?this.i=!0:En(this)}N(){super.N(),this.g&&(o.clearTimeout(this.g),this.g=null,this.i=!1,this.h=null)}}function ds(w){j.call(this),this.h=w,this.g={}}m(ds,j);var sa=[];function Fa(w){se(w.g,function(L,$){this.g.hasOwnProperty($)&&ce(L)},w),w.g={}}ds.prototype.N=function(){ds.Z.N.call(this),Fa(this)},ds.prototype.handleEvent=function(){throw Error("EventHandler.handleEvent not implemented")};var Mr=o.JSON.stringify,es=o.JSON.parse,us=class{stringify(w){return o.JSON.stringify(w,void 0)}parse(w){return o.JSON.parse(w,void 0)}};function Vs(){}function Xi(){}var ts={OPEN:"a",hb:"b",ERROR:"c",tb:"d"};function Fr(){O.call(this,"d")}m(Fr,O);function As(){O.call(this,"c")}m(As,O);var Qn={},hl=null;function xa(){return hl=hl||new dt}Qn.Ia="serverreachability";function Zi(w){O.call(this,Qn.Ia,w)}m(Zi,O);function Ur(w){const L=xa();bt(L,new Zi(L))}Qn.STAT_EVENT="statevent";function ks(w,L){O.call(this,Qn.STAT_EVENT,w),this.stat=L}m(ks,O);function Bn(w){const L=xa();bt(L,new ks(L,w))}Qn.Ja="timingevent";function Ar(w,L){O.call(this,Qn.Ja,w),this.size=L}m(Ar,O);function Pn(w,L){if(typeof w!="function")throw Error("Fn must not be null and must be a function");return o.setTimeout(function(){w()},L)}function aa(){this.g=!0}aa.prototype.ua=function(){this.g=!1};function si(w,L,$,X,Se,Re){w.info(function(){if(w.g)if(Re){var rt="",Kt=Re.split("&");for(let jn=0;jn<Kt.length;jn++){var xs=Kt[jn].split("=");if(xs.length>1){const $r=xs[0];xs=xs[1];const Ro=$r.split("_");rt=Ro.length>=2&&Ro[1]=="type"?rt+($r+"="+xs+"&"):rt+($r+"=redacted&")}}}else rt=null;else rt=Re;return"XMLHTTP REQ ("+X+") [attempt "+Se+"]: "+L+`
1624`+$+`
1625`+rt})}function bi(w,L,$,X,Se,Re,rt){w.info(function(){return"XMLHTTP RESP ("+X+") [ attempt "+Se+"]: "+L+`
1626`+$+`
1627`+Re+" "+rt})}function hs(w,L,$,X){w.info(function(){return"XMLHTTP TEXT ("+L+"): "+fl(w,$)+(X?" "+X:"")})}function ba(w,L){w.info(function(){return"TIMEOUT: "+L})}aa.prototype.info=function(){};function fl(w,L){if(!w.g)return L;if(!L)return null;try{const Re=JSON.parse(L);if(Re){for(w=0;w<Re.length;w++)if(Array.isArray(Re[w])){var $=Re[w];if(!($.length<2)){var X=$[1];if(Array.isArray(X)&&!(X.length<1)){var Se=X[0];if(Se!="noop"&&Se!="stop"&&Se!="close")for(let rt=1;rt<X.length;rt++)X[rt]=""}}}}return Mr(Re)}catch{return L}}var Jn={NO_ERROR:0,cb:1,qb:2,pb:3,kb:4,ob:5,rb:6,Ga:7,TIMEOUT:8,ub:9},ge={ib:"complete",Fb:"success",ERROR:"error",Ga:"abort",xb:"ready",yb:"readystatechange",TIMEOUT:"timeout",sb:"incrementaldata",wb:"progress",lb:"downloadprogress",Nb:"uploadprogress"},et;function xe(){}m(xe,Vs),xe.prototype.g=function(){return new XMLHttpRequest},et=new xe;function wn(w){return encodeURIComponent(String(w))}function ht(w){var L=1;w=w.split(":");const $=[];for(;L>0&&w.length;)$.push(w.shift()),L--;return w.length&&$.push(w.join(":")),$}function mn(w,L,$,X){this.j=w,this.i=L,this.l=$,this.S=X||1,this.V=new ds(this),this.H=45e3,this.J=null,this.o=!1,this.u=this.B=this.A=this.M=this.F=this.T=this.D=null,this.G=[],this.g=null,this.C=0,this.m=this.v=null,this.X=-1,this.K=!1,this.P=0,this.O=null,this.W=this.L=this.U=this.R=!1,this.h=new ya}function ya(){this.i=null,this.g="",this.h=!1}var Xn={},Sn={};function va(w,L,$){w.M=1,w.A=Bi(lr(L)),w.u=$,w.R=!0,In(w,null)}function In(w,L){w.F=Date.now(),ns(w),w.B=lr(w.A);var $=w.B,X=w.S;Array.isArray(X)||(X=[String(X)]),Gr($.i,"t",X),w.C=0,$=w.j.L,w.h=new ya,w.g=to(w.j,$?L:null,!w.u),w.P>0&&(w.O=new $t(d(w.Y,w,w.g),w.P)),L=w.V,$=w.g,X=w.ba;var Se="readystatechange";Array.isArray(Se)||(Se&&(sa[0]=Se.toString()),Se=sa);for(let Re=0;Re<Se.length;Re++){const rt=pe($,Se[Re],X||L.handleEvent,!1,L.h||L);if(!rt)break;L.g[rt.key]=rt}L=w.J?H(w.J):{},w.u?(w.v||(w.v="POST"),L["Content-Type"]="application/x-www-form-urlencoded",w.g.ea(w.B,w.v,w.u,L)):(w.v="GET",w.g.ea(w.B,w.v,null,L)),Ur(),si(w.i,w.v,w.B,w.l,w.S,w.u)}
1627mn.prototype.ba=function(w){w=w.target;const L=this.O;L&&ki(w)==3?L.j():this.Y(w)},mn.prototype.Y=function(w){try{if(w==this.g)e:{const Kt=ki(this.g),xs=this.g.ya(),jn=this.g.ca();if(!(Kt<3)&&(Kt!=3||this.g&&(this.h.h||this.g.la()||Gs(this.g)))){this.K||Kt!=4||xs==7||(xs==8||jn<=0?Ur(3):Ur(2)),Ba(this);var L=this.g.ca();this.X=L;var $=yr(this);if(this.o=L==200,bi(this.i,this.v,this.B,this.l,this.S,Kt,L),this.o){if(this.U&&!this.L){t:{if(this.g){var X,Se=this.g;if((X=Se.g?Se.g.getResponseHeader("X-HTTP-Initial-Response"):null)&&!U(X)){var Re=X;break t}}Re=null}if(w=Re)hs(this.i,this.l,w,"Initial handshake response via X-HTTP-Initial-Response"),this.L=!0,yi(this,w);else{this.o=!1,this.m=3,Bn(12),or(this),Ns(this);break e}}if(this.R){w=!0;let $r;for(;!this.K&&this.C<$.length;)if($r=fs(this,$),$r==Sn){Kt==4&&(this.m=4,Bn(14),w=!1),hs(this.i,this.l,null,"[Incomplete Response]");break}else if($r==Xn){this.m=4,Bn(15),hs(this.i,this.l,$,"[Invalid Chunk]"),w=!1;break}else hs(this.i,this.l,$r,null),yi(this,$r);if(kr(this)&&this.C!=0&&(this.h.g=this.h.g.slice(this.C),this.C=0),Kt!=4||$.length!=0||this.h.h||(this.m=1,Bn(16),w=!1),this.o=this.o&&w,!w)hs(this.i,this.l,$,"[Invalid Chunked Response]"),or(this),Ns(this);else if($.length>0&&!this.W){this.W=!0;var rt=this.j;rt.g==this&&rt.aa&&!rt.P&&(rt.j.info("Great, no buffering proxy detected. Bytes received: "+$.length),at(rt),rt.P=!0,Bn(11))}}else hs(this.i,this.l,$,null),yi(this,$);Kt==4&&or(this),this.o&&!this.K&&(Kt==4?Nt(this.j,this):(this.o=!1,ns(this)))}else Do(this.g),L==400&&$.indexOf("Unknown SID")>0?(this.m=3,Bn(12)):(this.m=0,Bn(13)),or(this),Ns(this)}}}catch{}finally{}};function yr(w){if(!kr(w))return w.g.la();const L=Gs(w.g);if(L==="")return"";let $="";const X=L.length,Se=ki(w.g)==4;if(!w.h.i){if(typeof TextDecoder>"u")return or(w),Ns(w),"";w.h.i=new o.TextDecoder}for(let Re=0;Re<X;Re++)w.h.h=!0,$+=w.h.i.decode(L[Re],{stream:!(Se&&Re==X-1)});return L.length=0,w.h.g+=$,w.C=0,w.h.g}function kr(w){return w.g?w.v=="GET"&&w.M!=2&&w.j.Aa:!1}function fs(w,L){var $=w.C,X=L.indexOf(`
1628`,$);return X==-1?Sn:($=Number(L.substring($,X)),isNaN($)?Xn:(X+=1,X+$>L.length?Sn:(L=L.slice(X,X+$),w.C=X+$,L)))}mn.prototype.cancel=function(){this.K=!0,or(this)};function ns(w){w.T=Date.now()+w.H,Io(w,w.H)}function Io(w,L){if(w.D!=null)throw Error("WatchDog timer not null");w.D=Pn(d(w.aa,w),L)}function Ba(w){w.D&&(o.clearTimeout(w.D),w.D=null)}mn.prototype.aa=function(){this.D=null;const w=Date.now();w-this.T>=0?(ba(this.i,this.B),this.M!=2&&(Ur(),Bn(17)),or(this),this.m=2,Ns(this)):Io(this,this.T-w)};function Ns(w){w.j.I==0||w.K||Nt(w.j,w)}function or(w){Ba(w);var L=w.O;L&&typeof L.dispose=="function"&&L.dispose(),w.O=null,Fa(w.V),w.g&&(L=w.g,w.g=null,L.abort(),L.dispose())}function yi(w,L){try{var $=w.j;if($.I!=0&&($.g==w||qt($.h,w))){if(!w.L&&qt($.h,w)&&$.I==3){try{var X=$.Ba.g.parse(L)}catch{X=null}if(Array.isArray(X)&&X.length==3){var Se=X;if(Se[0]==0){e:if(!$.v){if($.g)if($.g.F+3e3<w.F)kt($),Xl($);else break e;De($),Bn(18)}}else $.xa=Se[1],0<$.xa-$.K&&Se[2]<37500&&$.F&&$.A==0&&!$.C&&($.C=Pn(d($.Va,$),6e3));ai($.h)<=1&&$.ta&&($.ta=void 0)}else _t($,11)}else if((w.L||$.g==w)&&kt($),!U(L))for(Se=$.Ba.g.parse(L),L=0;L<Se.length;L++){let jn=Se[L];const $r=jn[0];if(!($r<=$.K))if($.K=$r,jn=jn[1],$.I==2)if(jn[0]=="c"){$.M=jn[1],$.ba=jn[2];const Ro=jn[3];Ro!=null&&($.ka=Ro,$.j.info("VER="+$.ka));const ec=jn[4];ec!=null&&($.za=ec,$.j.info("SVER="+$.za));const vl=jn[5];vl!=null&&typeof vl=="number"&&vl>0&&(X=1.5*vl,$.O=X,$.j.info("backChannelRequestTimeoutMs_="+X)),X=$;const Bl=w.g;if(Bl){const cf=Bl.g?Bl.g.getResponseHeader("X-Client-Wire-Protocol"):null;if(cf){var Re=X.h;Re.g||cf.indexOf("spdy")==-1&&cf.indexOf("quic")==-1&&cf.indexOf("h2")==-1||(Re.j=Re.l,Re.g=new Set,Re.h&&(uu(Re,Re.h),Re.h=null))}if(X.G){const ap=Bl.g?Bl.g.getResponseHeader("X-HTTP-Session-Id"):null;ap&&(X.wa=ap,pn(X.J,X.G,ap))}}$.I=3,$.l&&$.l.ra(),$.aa&&($.T=Date.now()-w.F,$.j.info("Handshake RTT: "+$.T+"ms")),X=$;var rt=w;if(X.na=Zc(X,X.L?X.ba:null,X.W),rt.L){ms(X.h,rt);var Kt=rt,xs=X.O;xs&&(Kt.H=xs),Kt.D&&(Ba(Kt),ns(Kt)),X.g=rt}else Q(X);$.i.length>0&&oi($)}else jn[0]!="stop"&&jn[0]!="close"||_t($,7);else $.I==3&&(jn[0]=="stop"||jn[0]=="close"?jn[0]=="stop"?_t($,7):fu($):jn[0]!="noop"&&$.l&&$.l.qa(jn),$.A=0)}}Ur(4)}catch{}}var vr=class{constructor(w,L){this.g=w,this.map=L}};
1628function ml(w){this.l=w||10,o.PerformanceNavigationTiming?(w=o.performance.getEntriesByType("navigation"),w=w.length>0&&(w[0].nextHopProtocol=="hq"||w[0].nextHopProtocol=="h2")):w=!!(o.chrome&&o.chrome.loadTimes&&o.chrome.loadTimes()&&o.chrome.loadTimes().wasFetchedViaSpdy),this.j=w?this.l:1,this.g=null,this.j>1&&(this.g=new Set),this.h=null,this.i=[]}function Kl(w){return w.h?!0:w.g?w.g.size>=w.j:!1}function ai(w){return w.h?1:w.g?w.g.size:0}function qt(w,L){return w.h?w.h==L:w.g?w.g.has(L):!1}function uu(w,L){w.g?w.g.add(L):w.h=L}function ms(w,L){w.h&&w.h==L?w.h=null:w.g&&w.g.has(L)&&w.g.delete(L)}ml.prototype.cancel=function(){if(this.i=wa(this),this.h)this.h.cancel(),this.h=null;else if(this.g&&this.g.size!==0){for(const w of this.g.values())w.cancel();this.g.clear()}};function wa(w){if(w.h!=null)return w.i.concat(w.h.G);if(w.g!=null&&w.g.size!==0){let L=w.i;for(const $ of w.g.values())L=L.concat($.G);return L}return x(w.i)}var Ua=RegExp("^(?:([^:/?#.]+):)?(?://(?:([^\\\\/?#]*)@)?([^\\\\/?#]*?)(?::([0-9]+))?(?=[\\\\/?#]|$))?([^?#]+)?(?:\\?([^#]*))?(?:#([\\s\\S]*))?$");function Wl(w,L){if(w){w=w.split("&");for(let $=0;$<w.length;$++){const X=w[$].indexOf("=");let Se,Re=null;X>=0?(Se=w[$].substring(0,X),Re=w[$].substring(X+1)):Se=w[$],L(Se,Re?decodeURIComponent(Re.replace(/\+/g," ")):"")}}}function ps(w){this.g=this.o=this.j="",this.u=null,this.m=this.h="",this.l=!1;let L;w instanceof ps?(this.l=w.l,Vr(this,w.j),this.o=w.o,this.g=w.g,vi(this,w.u),this.h=w.h,Va(this,Yr(w.i)),this.m=w.m):w&&(L=String(w).match(Ua))?(this.l=!1,Vr(this,L[1]||"",!0),this.o=Ca(L[2]||""),this.g=Ca(L[3]||"",!0),vi(this,L[4]),this.h=Ca(L[5]||"",!0),Va(this,L[6]||"",!0),this.m=Ca(L[7]||"")):(this.l=!1,this.i=new lt(null,this.l))}ps.prototype.toString=function(){const w=[];var L=this.j;L&&w.push(wi(L,eo,!0),":");var $=this.g;return($||L=="file")&&(w.push("//"),(L=this.o)&&w.push(wi(L,eo,!0),"@"),w.push(wn($).replace(/%25([0-9a-fA-F]{2})/g,"%$1")),$=this.u,$!=null&&w.push(":",String($))),($=this.h)&&(this.g&&$.charAt(0)!="/"&&w.push("/"),w.push(wi($,$.charAt(0)=="/"?tt:Yl,!0))),($=this.i.toString())&&w.push("?",$),($=this.m)&&w.push("#",wi($,yt)),w.join("")},ps.prototype.resolve=function(w){const L=lr(this);let $=!!w.j;$?Vr(L,w.j):$=!!w.o,$?L.o=w.o:$=!!w.g,$?L.g=w.g:$=w.u!=null;var X=w.h;if($)vi(L,w.u);else if($=!!w.h){if(X.charAt(0)!="/")if(this.g&&!this.h)X="/"+X;else{var Se=L.h.lastIndexOf("/");Se!=-1&&(X=L.h.slice(0,Se+1)+X)}if(Se=X,Se==".."||Se==".")X="";else if(Se.indexOf("./")!=-1||Se.indexOf("/.")!=-1){X=Se.lastIndexOf("/",0)==0,Se=Se.split("/");const Re=[];for(let rt=0;rt<Se.length;){const Kt=Se[rt++];Kt=="."?X&&rt==Se.length&&Re.push(""):Kt==".."?((Re.length>1||Re.length==1&&Re[0]!="")&&Re.pop(),X&&rt==Se.length&&Re.push("")):(Re.push(Kt),X=!0)}X=Re.join("/")}else X=Se}return $?L.h=X:$=w.i.toString()!=="",$?Va(L,Yr(w.i)):$=!!w.m,$&&(L.m=w.m),L};function lr(w){return new ps(w)}function Vr(w,L,$){w.j=$?Ca(L,!0):L,w.j&&(w.j=w.j.replace(/:$/,""))}function vi(w,L){if(L){if(L=Number(L),isNaN(L)||L<0)throw Error("Bad port number "+L);w.u=L}else w.u=null}function Va(w,L,$){L instanceof lt?(w.i=L,Qc(w.i,w.l)):($||(L=wi(L,ft)),w.i=new lt(L,w.l))}function pn(w,L,$){w.i.set(L,$)}function Bi(w){return pn(w,"zx",Math.floor(Math.random()*2147483648).toString(36)+Math.abs(Math.floor(Math.random()*2147483648)^Date.now()).toString(36)),w}function Ca(w,L){return w?L?decodeURI(w.replace(/%25/g,"%2525")):decodeURIComponent(w):""}function wi(w,L,$){return typeof w=="string"?(w=encodeURI(w).replace(L,Br),$&&(w=w.replace(/%25([0-9a-fA-F]{2})/g,"%$1")),w):null}function Br(w){return w=w.charCodeAt(0),"%"+(w>>4&15).toString(16)+(w&15).toString(16)}var eo=/[#\/\?@]/g,Yl=/[#\?:]/g,tt=/[#\?]/g,ft=/[#\?@]/g,yt=/#/g;function lt(w,L){this.h=this.g=null,this.i=w||null,this.j=!!L}function Ln(w){w.g||(w.g=new Map,w.h=0,w.i&&Wl(w.i,function(L,$){w.add(decodeURIComponent(L.replace(/\+/g," ")),$)}))}n=lt.prototype,n.add=function(w,L){Ln(this),this.i=null,w=pl(this,w);let $=this.g.get(w);return $||this.g.set(w,$=[]),$.push(L),this.h+=1,this};function Dn(w,L){Ln(w),L=pl(w,L),w.g.has(L)&&(w.i=null,w.h-=w.g.get(L).length,w.g.delete(L))}function Rt(w,L){return Ln(w),L=pl(w,L),w.g.has(L)}n.forEach=function(w,L){Ln(this),this.g.forEach(function($,X){$.forEach(function(Se){w.call(L,Se,X,this)},this)},this)};function Et(w,L){Ln(w);let $=[];if(typeof L=="string")Rt(w,L)&&($=$.concat(w.g.get(pl(w,L))));else for(w=Array.from(w.g.values()),L=0;L<w.length;L++)$=$.concat(w[L]);return $}n.set=function(w,L){return Ln(this),this.i=null,w=pl(this,w),Rt(this,w)&&(this.h-=this.g.get(w).length),this.g.set(w,[L]),this.h+=1,this},n.get=function(w,L){return w?(w=Et(this,w),w.length>0?String(w[0]):L):L};function Gr(w,L,$){Dn(w,L),$.length>0&&(w.i=null,w.g.set(pl(w,L),x($)),w.h+=$.length)}n.toString=function(){if(this.i)return this.i;if(!this.g)return"";const w=[],L=Array.from(this.g.keys());for(let X=0;X<L.length;X++){var $=L[X];const Se=wn($);$=Et(this,$);for(let Re=0;Re<$.length;Re++){let rt=Se;$[Re]!==""&&(rt+="="+wn($[Re])),w.push(rt)}}return this.i=w.join("&")};function Yr(w){const L=new lt;return L.i=w.i,w.g&&(L.g=new Map(w.g),L.h=w.h),L}function pl(w,L){return L=String(L),w.j&&(L=L.toLowerCase()),L}function Qc(w,L){L&&!w.j&&(Ln(w),w.i=null,w.g.forEach(function($,X){const Se=X.toLowerCase();X!=Se&&(Dn(this,X),Gr(this,Se,$))},w)),w.j=L}function Ci(w,L){const $=new aa;if(o.Image){const X=new Image;X.onload=h(Ut,$,"TestLoadImage: loaded",!0,L,X),X.onerror=h(Ut,$,"TestLoadImage: error",!1,L,X),X.onabort=h(Ut,$,"TestLoadImage: abort",!1,L,X),X.ontimeout=h(Ut,$,"TestLoadImage: timeout",!1,L,X),o.setTimeout(function(){X.ontimeout&&X.ontimeout()},1e4),X.src=w}else L(!1)}
vendor: 10,544 bytes, lines 1628-1631
1628function Jc(w,L){const $=new aa,X=new AbortController,Se=setTimeout(()=>{X.abort(),Ut($,"TestPingServer: timeout",!1,L)},1e4);fetch(w,{signal:X.signal}).then(Re=>{clearTimeout(Se),Re.ok?Ut($,"TestPingServer: ok",!0,L):Ut($,"TestPingServer: server error",!1,L)}).catch(()=>{clearTimeout(Se),Ut($,"TestPingServer: error",!1,L)})}function Ut(w,L,$,X,Se){try{Se&&(Se.onload=null,Se.onerror=null,Se.onabort=null,Se.ontimeout=null),X($)}catch{}}function Ei(){this.g=new us}function Si(w){this.i=w.Sb||null,this.h=w.ab||!1}m(Si,Vs),Si.prototype.g=function(){return new Ql(this.i,this.h)};function Ql(w,L){dt.call(this),this.H=w,this.o=L,this.m=void 0,this.status=this.readyState=0,this.responseType=this.responseText=this.response=this.statusText="",this.onreadystatechange=null,this.A=new Headers,this.h=null,this.F="GET",this.D="",this.g=!1,this.B=this.j=this.l=null,this.v=new AbortController}m(Ql,dt),n=Ql.prototype,n.open=function(w,L){if(this.readyState!=0)throw this.abort(),Error("Error reopening a connection");this.F=w,this.D=L,this.readyState=1,Ti(this)},n.send=function(w){if(this.readyState!=1)throw this.abort(),Error("need to call open() first. ");if(this.v.signal.aborted)throw this.abort(),Error("Request was aborted.");this.g=!0;const L={headers:this.A,method:this.F,credentials:this.m,cache:void 0,signal:this.v.signal};w&&(L.body=w),(this.H||o).fetch(new Request(this.D,L)).then(this.Pa.bind(this),this.ga.bind(this))},n.abort=function(){this.response=this.responseText="",this.A=new Headers,this.status=0,this.v.abort(),this.j&&this.j.cancel("Request was aborted.").catch(()=>{}),this.readyState>=1&&this.g&&this.readyState!=4&&(this.g=!1,gl(this)),this.readyState=0},n.Pa=function(w){if(this.g&&(this.l=w,this.h||(this.status=this.l.status,this.statusText=this.l.statusText,this.h=w.headers,this.readyState=2,Ti(this)),this.g&&(this.readyState=3,Ti(this),this.g)))if(this.responseType==="arraybuffer")w.arrayBuffer().then(this.Na.bind(this),this.ga.bind(this));else if(typeof o.ReadableStream<"u"&&"body"in w){if(this.j=w.body.getReader(),this.o){if(this.responseType)throw Error('responseType must be empty for "streamBinaryChunks" mode responses.');this.response=[]}else this.response=this.responseText="",this.B=new TextDecoder;hu(this)}else w.text().then(this.Oa.bind(this),this.ga.bind(this))};function hu(w){w.j.read().then(w.Ma.bind(w)).catch(w.ga.bind(w))}n.Ma=function(w){if(this.g){if(this.o&&w.value)this.response.push(w.value);else if(!this.o){var L=w.value?w.value:new Uint8Array(0);(L=this.B.decode(L,{stream:!w.done}))&&(this.response=this.responseText+=L)}w.done?gl(this):Ti(this),this.readyState==3&&hu(this)}},n.Oa=function(w){this.g&&(this.response=this.responseText=w,gl(this))},n.Na=function(w){this.g&&(this.response=w,gl(this))},n.ga=function(){this.g&&gl(this)};function gl(w){w.readyState=4,w.l=null,w.j=null,w.B=null,Ti(w)}n.setRequestHeader=function(w,L){this.A.append(w,L)},n.getResponseHeader=function(w){return this.h&&this.h.get(w.toLowerCase())||""},n.getAllResponseHeaders=function(){if(!this.h)return"";const w=[],L=this.h.entries();for(var $=L.next();!$.done;)$=$.value,w.push($[0]+": "+$[1]),$=L.next();return w.join(`\r
1629`)};function Ti(w){w.onreadystatechange&&w.onreadystatechange.call(w)}Object.defineProperty(Ql.prototype,"withCredentials",{get:function(){return this.m==="include"},set:function(w){this.m=w?"include":"same-origin"}});function Ai(w){let L="";return se(w,function($,X){L+=X,L+=":",L+=$,L+=`\r
1630`}),L}function Jl(w,L,$){e:{for(X in $){var X=!1;break e}X=!0}X||($=Ai($),typeof w=="string"?$!=null&&wn($):pn(w,L,$))}function On(w){dt.call(this),this.headers=new Map,this.L=w||null,this.h=!1,this.g=null,this.D="",this.o=0,this.l="",this.j=this.B=this.v=this.A=!1,this.m=null,this.F="",this.H=!1}m(On,dt);var ii=/^https?$/i,rf=["POST","PUT"];n=On.prototype,n.Fa=function(w){this.H=w},n.ea=function(w,L,$,X){if(this.g)throw Error("[goog.net.XhrIo] Object is active with another request="+this.D+"; newUri="+w);L=L?L.toUpperCase():"GET",this.D=w,this.l="",this.o=0,this.A=!1,this.h=!0,this.g=this.L?this.L.g():et.g(),this.g.onreadystatechange=p(d(this.Ca,this));try{this.B=!0,this.g.open(L,String(w),!0),this.B=!1}catch(Re){xl(this,Re);return}if(w=$||"",$=new Map(this.headers),X)if(Object.getPrototypeOf(X)===Object.prototype)for(var Se in X)$.set(Se,X[Se]);else if(typeof X.keys=="function"&&typeof X.get=="function")for(const Re of X.keys())$.set(Re,X.get(Re));else throw Error("Unknown input type for opt_headers: "+String(X));X=Array.from($.keys()).find(Re=>Re.toLowerCase()=="content-type"),Se=o.FormData&&w instanceof o.FormData,!(Array.prototype.indexOf.call(rf,L,void 0)>=0)||X||Se||$.set("Content-Type","application/x-www-form-urlencoded;charset=utf-8");for(const[Re,rt]of $)this.g.setRequestHeader(Re,rt);this.F&&(this.g.responseType=this.F),"withCredentials"in this.g&&this.g.withCredentials!==this.H&&(this.g.withCredentials=this.H);try{this.m&&(clearTimeout(this.m),this.m=null),this.v=!0,this.g.send(w),this.v=!1}catch(Re){xl(this,Re)}};function xl(w,L){w.h=!1,w.g&&(w.j=!0,w.g.abort(),w.j=!1),w.l=L,w.o=5,sf(w),bl(w)}function sf(w){w.A||(w.A=!0,bt(w,"complete"),bt(w,"error"))}n.abort=function(w){this.g&&this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1,this.o=w||7,bt(this,"complete"),bt(this,"abort"),bl(this))},n.N=function(){this.g&&(this.h&&(this.h=!1,this.j=!0,this.g.abort(),this.j=!1),bl(this,!0)),On.Z.N.call(this)},n.Ca=function(){this.u||(this.B||this.v||this.j?Xc(this):this.Xa())},n.Xa=function(){Xc(this)};function Xc(w){if(w.h&&typeof a<"u"){if(w.v&&ki(w)==4)setTimeout(w.Ca.bind(w),0);else if(bt(w,"readystatechange"),ki(w)==4){w.h=!1;try{const Re=w.ca();e:switch(Re){case 200:case 201:case 202:case 204:case 206:case 304:case 1223:var L=!0;break e;default:L=!1}var $;if(!($=L)){var X;if(X=Re===0){let rt=String(w.D).match(Ua)[1]||null;!rt&&o.self&&o.self.location&&(rt=o.self.location.protocol.slice(0,-1)),X=!ii.test(rt?rt.toLowerCase():"")}$=X}if($)bt(w,"complete"),bt(w,"success");else{w.o=6;try{var Se=ki(w)>2?w.g.statusText:""}catch{Se=""}w.l=Se+" ["+w.ca()+"]",sf(w)}}finally{bl(w)}}}}function bl(w,L){if(w.g){w.m&&(clearTimeout(w.m),w.m=null);const $=w.g;w.g=null,L||bt(w,"ready");try{$.onreadystatechange=null}catch{}}}n.isActive=function(){return!!this.g};function ki(w){return w.g?w.g.readyState:0}n.ca=function(){try{return ki(this)>2?this.g.status:-1}catch{return-1}},n.la=function(){try{return this.g?this.g.responseText:""}catch{return""}},n.La=function(w){if(this.g){var L=this.g.responseText;return w&&L.indexOf(w)==0&&(L=L.substring(w.length)),es(L)}};function Gs(w){try{if(!w.g)return null;if("response"in w.g)return w.g.response;switch(w.F){case"":case"text":return w.g.responseText;case"arraybuffer":if("mozResponseArrayBuffer"in w.g)return w.g.mozResponseArrayBuffer}return null}catch{return null}}function Do(w){const L={};w=(w.g&&ki(w)>=2&&w.g.getAllResponseHeaders()||"").split(`\r
1631`);for(let X=0;X<w.length;X++){if(U(w[X]))continue;var $=ht(w[X]);const Se=$[0];if($=$[1],typeof $!="string")continue;$=$.trim();const Re=L[Se]||[];L[Se]=Re,Re.push($)}re(L,function(X){return X.join(", ")})}n.ya=function(){return this.o},n.Ha=function(){return typeof this.l=="string"?this.l:String(this.l)};function Ni(w,L,$){return $&&$.internalChannelParams&&$.internalChannelParams[w]||L}function jo(w){this.za=0,this.i=[],this.j=new aa,this.ba=this.na=this.J=this.W=this.g=this.wa=this.G=this.H=this.u=this.U=this.o=null,this.Ya=this.V=0,this.Sa=Ni("failFast",!1,w),this.F=this.C=this.v=this.m=this.l=null,this.X=!0,this.xa=this.K=-1,this.Y=this.A=this.D=0,this.Qa=Ni("baseRetryDelayMs",5e3,w),this.Za=Ni("retryDelaySeedMs",1e4,w),this.Ta=Ni("forwardChannelMaxRetries",2,w),this.va=Ni("forwardChannelRequestTimeoutMs",2e4,w),this.ma=w&&w.xmlHttpFactory||void 0,this.Ua=w&&w.Rb||void 0,this.Aa=w&&w.useFetchStreams||!1,this.O=void 0,this.L=w&&w.supportsCrossDomainXhr||!1,this.M="",this.h=new ml(w&&w.concurrentRequestLimit),this.Ba=new Ei,this.S=w&&w.fastHandshake||!1,this.R=w&&w.encodeInitMessageHeaders||!1,this.S&&this.R&&(this.R=!1),this.Ra=w&&w.Pb||!1,w&&w.ua&&this.j.ua(),w&&w.forceLongPolling&&(this.X=!1),this.aa=!this.S&&this.X&&w&&w.detectBufferingProxy||!1,this.ia=void 0,w&&w.longPollingTimeout&&w.longPollingTimeout>0&&(this.ia=w.longPollingTimeout),this.ta=void 0,this.T=0,this.P=!1,this.ja=this.B=null}n=jo.prototype,n.ka=8,n.I=1,n.connect=function(w,L,$,X){Bn(0),this.W=w,this.H=L||{},$&&X!==void 0&&(this.H.OSID=$,this.H.OAID=X),this.F=this.X,this.J=Zc(this,null,this.W),oi(this)};function fu(w){if(mu(w),w.I==3){var L=w.V++,$=lr(w.J);if(pn($,"SID",w.M),pn($,"RID",L),pn($,"TYPE","terminate"),Zl(w,$),L=new mn(w,w.j,L),L.M=2,L.A=Bi(lr($)),$=!1,o.navigator&&o.navigator.sendBeacon)try{$=o.navigator.sendBeacon(L.A.toString(),"")}catch{}!$&&o.Image&&(new Image().src=L.A,$=!0),$||(L.g=to(L.j,null),L.g.ea(L.A)),L.F=Date.now(),ns(L)}ia(w)}function Xl(w){w.g&&(at(w),w.g.cancel(),w.g=null)}function mu(w){Xl(w),w.v&&(o.clearTimeout(w.v),w.v=null),kt(w),w.h.cancel(),w.m&&(typeof w.m=="number"&&o.clearTimeout(w.m),w.m=null)}function oi(w){if(!Kl(w.h)&&!w.m){w.m=!0;var L=w.Ea;P||I(),R||(P(),R=!0),_.add(L,w),w.D=0}}function pu(w,L){return ai(w.h)>=w.h.j-(w.m?1:0)?!1:w.m?(w.i=L.G.concat(w.i),!0):w.I==1||w.I==2||w.D>=(w.Sa?0:w.Ta)?!1:(w.m=Pn(d(w.Ea,w,L),it(w,w.D)),w.D++,!0)}n.Ea=function(w){if(this.m)if(this.m=null,this.I==1){if(!w){this.V=Math.floor(Math.random()*1e5),w=this.V++;const Se=new mn(this,this.j,w);let Re=this.o;if(this.U&&(Re?(Re=H(Re),de(Re,this.U)):Re=this.U),this.u!==null||this.R||(Se.J=Re,Re=null),this.S)e:{for(var L=0,$=0;$<this.i.length;$++){t:{var X=this.i[$];if("__data__"in X.map&&(X=X.map.__data__,typeof X=="string")){X=X.length;break t}X=void 0}if(X===void 0)break;if(L+=X,L>4096){L=$;break e}if(L===4096||$===this.i.length-1){L=$+1;break e}}L=1e3}else L=1e3;L=of(this,Se,L),$=lr(this.J),pn($,"RID",w),pn($,"CVER",22),this.G&&pn($,"X-HTTP-Session-Id",this.G),Zl(this,$),Re&&(this.R?L="headers="+wn(Ai(Re))+"&"+L:this.u&&Jl($,this.u,Re)),uu(this.h,Se),this.Ra&&pn($,"TYPE","init"),this.S?(pn($,"$req",L),pn($,"SID","null"),Se.U=!0,va(Se,$,null)):va(Se,$,L),this.I=2}}else this.I==3&&(w?af(this,w):this.i.length==0||Kl(this.h)||af(this))};function af(w,L){var $;L?$=L.l:$=w.V++;const X=lr(w.J);pn(X,"SID",w.M),pn(X,"RID",$),pn(X,"AID",w.K),Zl(w,X),w.u&&w.o&&Jl(X,w.u,w.o),$=new mn(w,w.j,$,w.D+1),w.u===null&&($.J=w.o),L&&(w.i=L.G.concat(w.i)),L=of(w,$,1e3),$.H=Math.round(w.va*.5)+Math.round(w.va*.5*Math.random()),uu(w.h,$),va($,X,L)}function Zl(w,L){w.H&&se(w.H,function($,X){pn(L,X,$)}
vendor: 5,128 bytes, line 1631
1631),w.l&&se({},function($,X){pn(L,X,$)})}function of(w,L,$){$=Math.min(w.i.length,$);const X=w.l?d(w.l.Ka,w.l,w):null;e:{var Se=w.i;let Kt=-1;for(;;){const xs=["count="+$];Kt==-1?$>0?(Kt=Se[0].g,xs.push("ofs="+Kt)):Kt=0:xs.push("ofs="+Kt);let jn=!0;for(let $r=0;$r<$;$r++){var Re=Se[$r].g;const Ro=Se[$r].map;if(Re-=Kt,Re<0)Kt=Math.max(0,Se[$r].g-100),jn=!1;else try{Re="req"+Re+"_"||"";try{var rt=Ro instanceof Map?Ro:Object.entries(Ro);for(const[ec,vl]of rt){let Bl=vl;l(vl)&&(Bl=Mr(vl)),xs.push(Re+ec+"="+encodeURIComponent(Bl))}}catch(ec){throw xs.push(Re+"type="+encodeURIComponent("_badmap")),ec}}catch{X&&X(Ro)}}if(jn){rt=xs.join("&");break e}}rt=void 0}return w=w.i.splice(0,$),L.G=w,rt}function Q(w){if(!w.g&&!w.v){w.Y=1;var L=w.Da;P||I(),R||(P(),R=!0),_.add(L,w),w.A=0}}function De(w){return w.g||w.v||w.A>=3?!1:(w.Y++,w.v=Pn(d(w.Da,w),it(w,w.A)),w.A++,!0)}n.Da=function(){if(this.v=null,qe(this),this.aa&&!(this.P||this.g==null||this.T<=0)){var w=4*this.T;this.j.info("BP detection timer enabled: "+w),this.B=Pn(d(this.Wa,this),w)}},n.Wa=function(){this.B&&(this.B=null,this.j.info("BP detection timeout reached."),this.j.info("Buffering proxy detected and switch to long-polling!"),this.F=!1,this.P=!0,Bn(10),Xl(this),qe(this))};function at(w){w.B!=null&&(o.clearTimeout(w.B),w.B=null)}function qe(w){w.g=new mn(w,w.j,"rpc",w.Y),w.u===null&&(w.g.J=w.o),w.g.P=0;var L=lr(w.na);pn(L,"RID","rpc"),pn(L,"SID",w.M),pn(L,"AID",w.K),pn(L,"CI",w.F?"0":"1"),!w.F&&w.ia&&pn(L,"TO",w.ia),pn(L,"TYPE","xmlhttp"),Zl(w,L),w.u&&w.o&&Jl(L,w.u,w.o),w.O&&(w.g.H=w.O);var $=w.g;w=w.ba,$.M=1,$.A=Bi(lr(L)),$.u=null,$.R=!0,In($,w)}n.Va=function(){this.C!=null&&(this.C=null,Xl(this),De(this),Bn(19))};function kt(w){w.C!=null&&(o.clearTimeout(w.C),w.C=null)}function Nt(w,L){var $=null;if(w.g==L){kt(w),at(w),w.g=null;var X=2}else if(qt(w.h,L))$=L.G,ms(w.h,L),X=1;else return;if(w.I!=0){if(L.o)if(X==1){$=L.u?L.u.length:0,L=Date.now()-L.F;var Se=w.D;X=xa(),bt(X,new Ar(X,$)),oi(w)}else Q(w);else if(Se=L.m,Se==3||Se==0&&L.X>0||!(X==1&&pu(w,L)||X==2&&De(w)))switch($&&$.length>0&&(L=w.h,L.i=L.i.concat($)),Se){case 1:_t(w,5);break;case 4:_t(w,10);break;case 3:_t(w,6);break;default:_t(w,2)}}}function it(w,L){let $=w.Qa+Math.floor(Math.random()*w.Za);return w.isActive()||($*=2),$*L}function _t(w,L){if(w.j.info("Error code "+L),L==2){var $=d(w.bb,w),X=w.Ua;const Se=!X;X=new ps(X||"//www.google.com/images/cleardot.gif"),o.location&&o.location.protocol=="http"||Vr(X,"https"),Bi(X),Se?Ci(X.toString(),$):Jc(X.toString(),$)}else Bn(2);w.I=0,w.l&&w.l.pa(L),ia(w),mu(w)}n.bb=function(w){w?(this.j.info("Successfully pinged google.com"),Bn(2)):(this.j.info("Failed to ping google.com"),Bn(1))};function ia(w){if(w.I=0,w.ja=[],w.l){const L=wa(w.h);(L.length!=0||w.i.length!=0)&&(y(w.ja,L),y(w.ja,w.i),w.h.i.length=0,x(w.i),w.i.length=0),w.l.oa()}}function Zc(w,L,$){var X=$ instanceof ps?lr($):new ps($);if(X.g!="")L&&(X.g=L+"."+X.g),vi(X,X.u);else{var Se=o.location;X=Se.protocol,L=L?L+"."+Se.hostname:Se.hostname,Se=+Se.port;const Re=new ps(null);X&&Vr(Re,X),L&&(Re.g=L),Se&&vi(Re,Se),$&&(Re.h=$),X=Re}return $=w.G,L=w.wa,$&&L&&pn(X,$,L),pn(X,"VER",w.ka),Zl(w,X),X}function to(w,L,$){if(L&&!w.L)throw Error("Can't create secondary domain capable XhrIo object.");return L=w.Aa&&!w.ma?new On(new Si({ab:$})):new On(w.ma),L.Fa(w.L),L}n.isActive=function(){return!!this.l&&this.l.isActive(this)};function lf(){}n=lf.prototype,n.ra=function(){},n.qa=function(){},n.pa=function(){},n.oa=function(){},n.isActive=function(){return!0},n.Ka=function(){};function gs(){}gs.prototype.g=function(w,L){return new Vn(w,L)};function Vn(w,L){dt.call(this),this.g=new jo(L),this.l=w,this.h=L&&L.messageUrlParams||null,w=L&&L.messageHeaders||null,L&&L.clientProtocolHeaderRequired&&(w?w["X-Client-Protocol"]="webchannel":w={"X-Client-Protocol":"webchannel"}),this.g.o=w,w=L&&L.initMessageHeaders||null,L&&L.messageContentType&&(w?w["X-WebChannel-Content-Type"]=L.messageContentType:w={"X-WebChannel-Content-Type":L.messageContentType}),L&&L.sa&&(w?w["X-WebChannel-Client-Profile"]=L.sa:w={"X-WebChannel-Client-Profile":L.sa}),this.g.U=w,(w=L&&L.Qb)&&!U(w)&&(this.g.u=w),this.A=L&&L.supportsCrossDomainXhr||!1,this.v=L&&L.sendRawJson||!1,(L=L&&L.httpSessionIdParam)&&!U(L)&&(this.g.G=L,w=this.h,w!==null&&L in w&&(w=this.h,L in w&&delete w[L])),this.j=new Ea(this)}m(Vn,dt),Vn.prototype.m=function(){this.g.l=this.j,this.A&&(this.g.L=!0),this.g.connect(this.l,this.h||void 0)},Vn.prototype.close=function(){fu(this.g)},Vn.prototype.o=function(w){var L=this.g;if(typeof w=="string"){var $={};$.__data__=w,w=$}else this.v&&($={},$.__data__=Mr(w),w=$);L.i.push(new vr(L.Ya++,w)),L.I==3&&oi(L)},Vn.prototype.N=function(){this.g.l=null,delete this.j,fu(this.g),delete this.g,Vn.Z.N.call(this)};function yl(w){Fr.call(this),w.__headers__&&(this.headers=w.__headers__,this.statusCode=w.__status__,delete w.__headers__,delete w.__status__);var L=w.__sm__;if(L){e:{for(const $ in L){w=$;break e}w=void 0}(this.i=w)&&(w=this.i,L=L!==null&&w in L?L[w]:void 0),this.data=L}else this.data=w}m(yl,Fr);function Gn(){As.call(this),this.status=1}m(Gn,As);function Ea(w){this.g=w}
vendor: 1,402 bytes, lines 1631-1639
1631m(Ea,lf),Ea.prototype.ra=function(){bt(this.g,"a")},Ea.prototype.qa=function(w){bt(this.g,new yl(w))},Ea.prototype.pa=function(w){bt(this.g,new Gn)},Ea.prototype.oa=function(){bt(this.g,"b")},gs.prototype.createWebChannel=gs.prototype.g,Vn.prototype.send=Vn.prototype.o,Vn.prototype.open=Vn.prototype.m,Vn.prototype.close=Vn.prototype.close,xH=function(){return new gs},gH=function(){return xa()},pH=Qn,g_={jb:0,mb:1,nb:2,Hb:3,Mb:4,Jb:5,Kb:6,Ib:7,Gb:8,Lb:9,PROXY:10,NOPROXY:11,Eb:12,Ab:13,Bb:14,zb:15,Cb:16,Db:17,fb:18,eb:19,gb:20},Jn.NO_ERROR=0,Jn.TIMEOUT=8,Jn.HTTP_ERROR=6,rC=Jn,ge.COMPLETE="complete",mH=ge,Xi.EventType=ts,ts.OPEN="a",ts.CLOSE="b",ts.ERROR="c",ts.MESSAGE="d",dt.prototype.listen=dt.prototype.J,Bb=Xi,On.prototype.listenOnce=On.prototype.K,On.prototype.getLastError=On.prototype.Ha,On.prototype.getLastErrorCode=On.prototype.ya,On.prototype.getStatus=On.prototype.ca,On.prototype.getResponseJson=On.prototype.La,On.prototype.getResponseText=On.prototype.la,On.prototype.send=On.prototype.ea,On.prototype.setWithCredentials=On.prototype.Fa,fH=On}).apply(typeof QB<"u"?QB:typeof self<"u"?self:typeof window<"u"?window:{});/*!
1632* re2js
1633* RE2JS is the JavaScript port of RE2, a regular expression engine that provides linear time matching
1634*
1635* @version v2.8.6
1636* @author Oleksii Vasyliev
1637* @homepage https://github.com/le0pard/re2js#readme
1638* @repository github:le0pard/re2js
1639* @license MIT
1640*/var dr,He=(dr=class{},Ye(dr,"FOLD_CASE",1),Ye(dr,"LITERAL",2),Ye(dr,"CLASS_NL",4),Ye(dr,"DOT_NL",8),Ye(dr,"ONE_LINE",16),Ye(dr,"NON_GREEDY",32),Ye(dr,"PERL_X",64),Ye(dr,"UNICODE_GROUPS",128),Ye(dr,"WAS_DOLLAR",256),Ye(dr,"LOOKBEHIND",512),Ye(dr,"MATCH_NL",dr.CLASS_NL|dr.DOT_NL),Ye(dr,"PERL",dr.CLASS_NL|dr.ONE_LINE|dr.PERL_X|dr.UNICODE_GROUPS),Ye(dr,"POSIX",0),Ye(dr,"UNANCHORED",0),Ye(dr,"ANCHOR_START",1),Ye(dr,"ANCHOR_BOTH",2),dr);const Pp={CASE_INSENSITIVE:1,DOTALL:2,MULTILINE:4,DISABLE_UNICODE_GROUPS:8,LONGEST_MATCH:16,LOOKBEHINDS:512},ny=128,x_=new Int32Array(ny),b_=new Int32Array(ny),JB=65535;for(let n=0;n<ny;n++)n>=97&&n<=122?x_[n]=n-32:x_[n]=n,n>=65&&n<=90?b_[n]=n+32:b_[n]=n;var l_,Le=(l_=class{static toUpperCase(n){if(n<ny)return x_[n];const e=String.fromCodePoint(n).toUpperCase(),t=e.codePointAt(0)>JB?2:1;if(e.length>t)return n;const r=String.fromCodePoint(e.codePointAt(0)).toLowerCase(),s=r.codePointAt(0)>JB?2:1;return r.length>s||r.codePointAt(0)!==n?n:e.codePointAt(0)}static toLowerCase(n){if(n<ny)return b_[n];const e=String.fromCodePoint(n).toLowerCase(),t=e.codePointAt(0)>JB?2:1;if(e.length>t)return n;const r=String.fromCodePoint(e.codePointAt(0)).toUpperCase(),s=r.codePointAt(0)>JB?2:1;return r.length>s||r.codePointAt(0)!==n?n:e.codePointAt(0)}},Ye(l_,"CODES",new Map([["\x07",7],["\b",8],["	",9],[`
1641`,10],["\v",11],["\f",12],["\r",13],[" ",32],['"',34],["$",36],["&",38],["'",39],["(",40],[")",41],["*",42],["+",43],["-",45],[".",46],["0",48],["1",49],["2",50],["3",51],["4",52],["5",53],["6",54],["7",55],["8",56],["9",57],[":",58],["<",60],[">",62],["?",63],["A",65],["B",66],["C",67],["F",70],["P",80],["Q",81],["U",85],["Z",90],["[",91],["\\",92],["]",93],["^",94],["_",95],["`",96],["a",97],["b",98],["f",102],["i",105],["m",109],["n",110],["r",114],["s",115],["t",116],["v",118],["x",120],["z",122],["{",123],["|",124],["}",125]])),l_),te=class{constructor(n,e=!1){this.data=n,this.isStride1=e,this.SIZE=e?2:3}getLo(n){return this.data[n*this.SIZE]}getHi(n){return this.data[n*this.SIZE+1]}getStride(n){return this.isStride1?1:this.data[n*this.SIZE+2]}get length(){return this.data.length/this.SIZE}};const bH=new Uint8Array(256);for(let n=0,e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789+-";n<64;n++)bH[e.charCodeAt(n)]=n;const yH=n=>{const e=[];let t=0,r=0;for(let s=0;s<n.length;s++){let a=bH[n.charCodeAt(s)];t|=(a&31)<<r,(a&32)===0?(e.push(t),t=0,r=0):r+=5}return e},ne=(n,e)=>{const t=yH(n),r=e?t.length/2:t.length/3,s=new Uint32Array(r*3);let a=0,o=0;for(let l=0;l<r;l++)a+=t[o++],s[l*3]=a,a+=t[o++],s[l*3+1]=a,s[l*3+2]=e?1:t[o++];return s},Kie=n=>{const e=yH(n),t=new Map;let r=0;for(let s=0;s<e.length;s+=2){r+=e[s];const a=e[s+1],o=a>>>1^-(a&1);t.set(r,r+o)}return t};var XB=class{constructor(n){this.initializer=n,this.cache=new Map}has(n){return n in this.initializer}get(n){if(this.cache.has(n))return this.cache.get(n);const e=this.initializer[n],t=e?e():null;return this.cache.set(n,t),t}},Ku,Mi=(Ku=class{static get CASE_ORBIT(){return this._CASE_ORBIT||(this._CASE_ORBIT=Kie("rCgCIgCY+rQI4QiCuuBLgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCCgCBgCBgCBgCBgCBgCBgCB+7OB-BB-BB-BB-BB-BBskQB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BC-BB-BB-BB-BB-BB-BB-BByHBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBxHBCBBBCBBBCBBB3SBmMBkNBCBBBCBBB8MBCBBB6MB6MBCBBC+EB0MB2MBCBBB6MB+MBiGBmNBiNBCBBBmKBikzCBmNBqNBkIBsNBCBBBCBBBCBBB0NBCBBB0NDCBBB0NBCBBByNByNBCBBBCBBB2NBCBBDCBBCwDFCBCBDBCBCBDBCBCBDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB9EBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCCBCBDBCBBBhGBvDBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBjICCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBH2iVBCBBBlKBwiVB+jVB+jVBCBBBlMBqEBuEBCBBBCBBBCBBBCBBBCBBB+hVB4hVB8hVBjNB7MC5MB5MCzMC1MB+0yCE5MB20yCC9MBu2yCBwyyCBo0yCChNBlNBo0yCBu-UBi0yCDlNC6-UBpNDrNIu+UDzNCm0yCBzNE0yyCBzNBpEBxNBxNBtEG1NLqxyCBkxyCnFoFrBCBBBCBBDCBBEkIBkIBkICoHHsCCqCBqCBqCCgEC+DB+DBmkOBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCC+BBgCBgCBgCBgCBgCBgCBgCBgCBrCBpCBpCBpCBmjOB-BB8BB-B
1641B-BBgEB-BB-BByBBqgOBsDB-BBtwBB-BB-BB-BBsBBgDBCB-BB-BB-BBeB-BB-BB61OB-BB-BB-DB9DB9DBQB7DBmCE9CBrDBPBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBrFB-EBOBnHB3FB-FCCBBBNBCBBCjIBjIBjIBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgFBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB8kMB-BB6kMB-BB-BB-BB-BB-BB-BB-BB-BB-BBokMB-BB-BBkkMBkkMB-BB-BB-BB-BB-BB-BB-BB4jMB-BB-BB-BB-BB-BB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EB-EBCBBBCBoiMBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBJCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBeBCBBBCBBBCBBBCBBBCBBBCBBBCBBBdBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBCgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDL-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-C64CgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOBgmOCgmOGgmODg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FBg8FDg8FBg8FBg8FhVg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBg9rCBQBQBQBQBQBQDPBPBPBPBPBPjkC7mMB5mMBnmMBjmMBCBlmMB3lMBpiMBk8kCBCBBG-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FB-7FD-7FB-7FB-7F6FoglCEsuHRwjlCyDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCB0DBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBG1DD97OCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQDPBPBPBPBPBPEQCQCQCQCPCPCPCPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPB0EB0EBsFBsFBsFBsFBoGBoGBgIBgIBgHBgHB8HB8HDQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQBQBQBQBQBQBQBPBPBPBPBPBPBPBPBQBQCSFPBPBzEBzEBRCxnOFSFrFBrFBrFBrFBREQBQClkOFPBPBnGBnGFQBQCljOCODPBPB-GB-GBNHSF-HB-HB7HB7HBRqJ53OE9tQBrmQH4Bc3BSgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBgBBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfBfECBByZ0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BB0BBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzBBzB34BgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDBgDB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CB-CBCBBBt-UBruHBt+UB1iVBviVBCBBBCBBBCBBB3hVB5-UB9hVB7hVCCBBCCBBI9jVB9jVBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBICBBBCBBECBBN-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOB-lOC-lOG-lOzoeCBBBCBBBCBBBCBBBCBBBCBl8kCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBTC
1641BBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBnECBBBCBBBCBBBCBBBCBBBCBBBCBBDCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBKCBBBCBBBnglCBCBBBCBBBCBBBCBBBCBBECBBBvyyCDCBBBCBBBgDCCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBn0yCB90yCB10yCBh0yCBn0yCCjxyCBzyyCBpxyCBg6BBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBB-CBl0yCBvjlCBCBBBCBBBt2yCBCBBBCBBBCBBBCBBBCBBBCBBBCBBBCBBBhkzCZCBB9a-5Bd-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCB-8rCm6TCBB7gBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCH-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BmlBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvChDwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCBwCFvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvCBvC1DuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCBuCCuCBuCBuCBuCBuCBuCBuCCuCBuCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCBtCCtCBtCBtCBtCBtCBtCBtCCtCBtCk2BgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEBgEO-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-DB-D+CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCL-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-B74CgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhrVgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCBgCB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BB-BhB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BB2BD1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BB1BtxekCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBkCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjCBjC")),this._CASE_ORBIT}static get Print(){return this._Print||(this._Print=new te(ne("hB9CBjBLBCpWBDFBFGBCCCBSBCsMBClBBDxBBDCBC2BBJaBFFBSVBC-FBCvBBD6BBDkDBP6BBDwBBDOBCbBDCCBJBGfBIqCBCgFBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYBDCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPBLCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGBCCBCHBDBBDVBCGBCBBCEBDIBDBBDCBICBFBBCEBDRBLBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBGMBCCBCWBCPBDIBCCBCDBIBBCCBCBBDDBDJBIVBCCBCWBCJBCEBDIBCCBCDBIBBGCBCDBDJBCCBNMBCCBCyBBCCBCFBFPBDZBCCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBN5BBFcBmBBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDBhBnCBCjBBFmBBCjBBCOBCMBmBlGBCGGD4LBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBH1CBDFBD-TBCbBE4CBIVBKXBKTBNMBCCBCBBN9CBDJBHJBHNBCKBH4CBIqBBGlCBLeBCLBFLBFEEBoBBDEBMrBBFZBHKBE9BBDgCBCcBDKBHJBHNBDtBBDLBVsCBClFBJ7BBEOBE9BBGqBBDKBJqBBG1QBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBSXBJuBBSBBDaBCMBEhBBPgBBQrEBF5UBXKBWz4BBD9LBGsBBCGGD3BBIBBPXBKGBCGBCGBCGBCGBCGBCGBCGBC9DBjBZBC4CBN1GBbPBC+BBC1CBDmDBGqBBC9CBC1CBKvBBCszcBE2BBK7KBV3FBJ8GBV7BBEJBH3BBJlCBJLBHzDBMdBEtCBCKBFgBBC2BBKNBDJBDmDBZbBLFBDFBDFBKGBCGBC7BBF9DBDJBHj9KBNWBFwBBloItLBDpDBnBGBNEBGZBCEBCCCBCCBCCBoUBhBpBBHyBBCSBCDBFEBCmEBF9FBEFBDFBDFBDCBEGBCGBOBBDLBCZBCSBCBBCOBDNBjB6DBGCBFsBBE3CBCMBEwBwBBsBBjEcBEwBBQbBFjBBKdBGqBBGdBCkBBFNBrB9EBDJBHjB
1641BFjBBFnBBJzBBMLBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBCnCBJIBxBSBCBBGgBBEaBGaBnB3BBFTBDxBBCBBGHBCCBCcBDCBFJBIIBI-BBhBmBBFLBK1BBEcBDaBGZBIDBNGBxCoCB4ByBBOyBBItBBJJBHlBBEcBJBBxGeBCpBBCCBDBBRFBJIBiBtBBJpBBXZBnBbBVWBKtCBFjBBK9BBCEBOYBIJBH0BBCRBJmBBK-CBCTBMRBCuBB-BGBCCCBCBCOBCKBH6BBGJBHDBCHBDBBDVBCGBCBBCEBCJBDBBDCBDHHGGBDGBEEBMJBCDDClBBCJBCDDCDBCJBCBBJBBe7CBCEBfnCBJJBnF1BBDlBBjBkCBMJBHMBU5BBHJBHTBdaBDOBFWB6F7BBlDyCBNHBDDDBGBCBBCdBCBBDLBKJBnCHBDtBBDKBcnCBJyCBOoCBIJB3CHB5ChBBPJBHIBCsBBCNBLcBEfBDVBCNBqCGBCBBCrBBECCBCCBHBJJBHFBCBBCkBBCBBCFBIJBHrBBFJB3HYBIQBCoBBEcB2CQQBwBBO6cBnDuDBCEBMjGBtyCiDBOvhBBRVBL68DBGmSB61G5BBn2B4RBIeBCJBFwCBCJBHdBDFBLlCBLJBCGBCUBGSBxN5BBnG6CBGYBDYBtBqCBF4BBIQBhCEBMGBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBDDBh7D8HBEzNBHWBQQBQtBBDWBKzDB9B1HBLmBBDpCBJvDBWlCB7DTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBD9VBQEBCOBxiBeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBENBDJBFBBhKeBS5BBGxOxOBoBB3GqBBFhGhGBdBCVBJBBhHGBCDBCBBCOBCkGBDPBqBrCBFJBFBByYjCBtC8BBjGDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBBvIrBBFjDBNOBDOBCOBCkBBLtFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBmgB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIBnkzVvHB",!1))),this._Print}static get Upper(){return this.CATEGORIES.get("Lu")}},Ye(Ku,"_CASE_ORBIT",null),Ye(Ku,"_Print",null),Ye(Ku,"CATEGORIES",new XB({C:()=>new te(ne("AfBgDgBBOrWrWBHHBCBICCVuMuMnBBBzBBBE4B4BBGBcDBHQBXhGhGxBBB8BBBmDNB8BBByBBBQddBCCMEBhBGBsCiFiFJBBDBBXIICCBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBPMMBEB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKMMBDBbEByBPBDBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCB-FCBHBBHBBHBBECBIIIBLBDBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIB-BGGBLBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMBxhBPBXJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBF-6DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBrCHBxDUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBND
1641BLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIlkzVBxHvw-FB",!1)),Cc:()=>new te(ne("AfgDgB",!0)),Cf:()=>new te(ne("tFzqBzqBBEBXhGhGyBhMhMBxCxCs5D9-B9-BBDBbEByBEBCJBw03B6H6HBBBimEQQj7IPBhjiBDBwmFHBn0rYffB+CB",!1)),Cn:()=>new te(ne("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBDBvzIBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwBB8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBND
1641BLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-BB---BBB---BBB",!1)),Co:()=>new te(ne("gg4B-nGh4hc9--BD9--B",!0)),Cs:()=>new te(ne("gg2B--B",!0)),L:()=>new te(ne("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICCiEEBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoCaBFDBuBqBBkBBBCiDBCQQBIIBLLBBBDRRCdBe4CBMZZBfBKBBFGGBUBFKKEYYBXBIKBGXBCGBRpBB7B1BBETTIJBQPBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNGB7BBBCCCBDBCXBCCCBIBCBBKDDBDBCWWBCBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNSSBkBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBkBFFkC4CBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBzC+C+CBtBBSHB3BdBOBBLrBBbjBBqBCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBhC1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBF1B1BB8zC8zCBjHBHDBEBBNlBBCGGD3BBIRRBVBKGBCGBCGBCGBCGBCGBCGBCGBxC2O2OBrBrBBDBGBBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBReBDlCByBIBDmDBDxCBVQBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBdRRBDBCJBLEBCoBBYCBCHBVWBEEEBwBBCEEBDDBDBDCCZCBDKBICBNFBDFBDFBKGBCGBCqBBCNBHyDBej9KBNWBFwBBloItLBDpDBnBGBNEBGCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBxB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOjBBnBbBKWB7HpBBHBBRFB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB1D-BBgBHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBqBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBGjCjCBLBhCBBCPPBNNB0mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBn7F0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFBmI9BBzEsBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCCBCBBCGBDEBKBBhHGBCDBCBBCOBCkGB8BjCBI1lB1lBBCBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),LC:()=>new te(ne("hCZBHZB7BLLBVBCeBCiGBCDBFvGBDZBhGDBDBBECBCHHCCBCCCBSBCyCBCqEBJlFBClBBKoBB44ClBBCGGDqBBDCBhV1CBDFBjkCKBGqBBDCBhCrBBgCMBChBBmD1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGBmIFFDJBCEEBDBHGCBCBCFBFDDBCBGEBF1B1BB8zC8zCB6DBDmDBHDBEBBNlBBCGGzoetBBTbBnEtCBCWBEDBCsCBZBBE2Z2ZBpBBGIBIvCBh6TGBNEBqgBZBHZBmlBvCBhDjBBFjBB1DKBCOBCGBCBBCKBCOBCGBCBBk2ByBBOyBB+CVBLVB74C-BBhrV-BBhBYBDYBtpZ0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BJBCTBHFB2uCjCB",!1)),Ll:()=>new te(ne("hDZB7BqBqBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDZBiGCCEEEBBBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBDCB5XFBjkCIBC2D2DBqBBgCMBChBBnD0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBBzIEEBEEcKFDBBJDBF2B2Bs1CvBBCEEBGCFCCBCCBEBGiDCBIICFFNlBBCGG0oesBCUaCoEMCBBBC+BCBGBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCbEE2ZqBBGIBIvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFB4vChBB",!1)),Lm:()=>new te(ne("wVRBFLBPEBICCmEGG-OnHnHlFBBuIBBFgBgBKEEhFoFoF1mBgEgE2R72B72BsDkTkTxOFBvF+BBOjBjBBjBByVOORMBg-CBByHgGgG2OsBsBBDBGiDiDB+C+CBBB34bjnBjnBBEBvIzDzDdBB6DIBxCYYpDDBEBB2OXXqEtDtDWBBoDDBKngVngVuBBBh-BFBCpBBCIB0sBhBhB2K04D04DnrTDB9PCBpBBBnRMBhCBBCPPB9-P9-PBCBCGBCBByhM9BBqGGBud0Q0QsSAB",!1)),Lo:()=>new te(ne("qFQQhIFFBCBxGBB7ZaBFDBuBfBCJBkBBBCiDBCZZBLLBBBDRRCdBe4CBMZZBfBWVBrBYBIKBGXBCGBRoBB8B1BBETTIJBROBFHBDBBDVBCGBCEEBCBERROBBCCBPBBLJJBEBFBBDVBCGBCBBCBBCBBgBDBCUUBBBRIBCCBCVBCGBCBBCEBETTQBBYMMBGBDBBDVBCGBCBBCEBEffBCCBBBQSSCFBECBCDBEBBCCCBEEBEEBBBELBX1B1BBGBCCBCWBCPBEbbBBBCBBDBBfFFBGBCCBCWBCJBCEBEffBBBCBBQBBSIBCCBCoBBDRRGCBJCBZFBGRBEXBCIBCDDBFB7BvBBCBBNFB8BBBCCCBDBCXBCCCBIBCBBKDDBDBYDBhBgCgCBGBCjBBcEB0DqBBVRRBEBFDBEEEBIIBBBFMBNyDyDBnKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPByDrTBDQBCZBGqCBHHBIRBOSBPRBPMBCCBQzBBpBkCkCBhBBC0BBIEBDhBBCGGBkCBLeByBdBDEBMrBBFZB3BWBK0BBxFuBBSHB3BdBOBBLrBBbjBBqBCBLdByDDBCFBCBBE7hB7hBBCB4-C3BBZWBKGBCGBCGBCGBCGBCGBCGBCGBoR2B2BF1CBJCCB4CBFGGB
1641pBBC9CBSfBxBPBhQ-tGBhC0wUBC2jBBkCnBBJrIBFPBLBBjCyByBBkCBqFoDoDEGBCCBCDBCWBezBBPxBB-BFBECCBMMBaBLWBacBIuBBuBEBDIBLEBCoBBYCBCHBVPBCFBEEEBwBBCEEBDDBDBDCCZBBEKBIPPBEBDFBDFBKGBCGByEiBBej9KBNWBFwBBloItLBDpDBkCCCBIBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBqDJBCsBBDeBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmMcBEwBBwBfBOTBCHBHlBBLdBDjBBFHBhEtCBjDnBBJzBB9CzBBN2JBKVBLHB5EFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCQQBCBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4FjBBnBDBCxJxJBoBBHBBRCBCBB5BcBLJJBUBrBRBvBUBcWBN0BB6BBBDOOBrBBhBYBbjBBeDDJiBBENNBuBBPDBWCCkBRBCYBUBBgCGBCCCBCBCOBCJBIuBBnBHBDBBDVBCGBCBBCEBETTNEBfJBCDDClBBCaaCtBtBBzBBTDBVCBfvBBVBBC5F5FBtBBqBDBlBvBBV8B8BBpBBOoCoCBZBmBGB6FrBB0GHBDDDBGBCBBCXBQCC-CHBDmBBRCCdLLBmBBIWWMtBBUTTBnCBoGgBBgBIBCkBBSyByBBcBxDGBCBBClBBWaaBEBCBBCfBPYYBnBBCBBlISBQCCBLBChBB9DwCwCB4cBnHjGBtyCgDBQvhBBSFBa68DBGmSB61GdBj3B4RBIeBSuCBSdBTvBB0BUBGSB0NnBB2MqCBGwFwFB0mHBqBfBiDyDBuwIiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBxzI2P2PBrBBiBiKiKBcBTrBBlPaBmHdBDwGwGBdBCCBCBBCGBDEBKiHiHBFBCDBCBBCOBCkGB8pBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQBlqE-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Lt:()=>new te(ne("lOGDnB2sH2sHBGBJHBJHBNQQwBAB",!1)),Lu:()=>new te(ne("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBG+B+B9zCvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBB",!1)),M:()=>new te(ne("gYvDB0IGBoIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCgBB3BCBCRBCGBLBBeCB5BCCBFBDBBDCBKLLBbbDCB5BCCBDBFBBDCBEffBEEMCB5BCCBGBCCBCCBVBBXFBCCB5BCCBFBDBBDCBICBLBBf8B8BBDBECBCDBKpBpBBDB4BCCBFBCCBCDBIBBMBBeCB5BCCBFBCCBCDBIBBMBBQNNBCB4BBBCGBCCBCDBKLLBeeBBBnCFFBEBCCCBGBTBB+BDDBFBNHBjDDDBHBMGBqCBBcECFBByBTBCBBGKBCjBBKlDlDBSBYDBFCBCCBDGBEDBOLBCLLBCBgWCBzdDBdCBeBBfBBhCfBKuBuBBBBC2D2DBjBjB3DLBFLB8GEB6BJBCcBDxBxBBsBBDLBVEBwBQBnB
1641IBNCBfMB5BNBxBTB5ECBCUBFHHDCBnG-BBxWgBB--CCBuEhDhDBeBrRFBqDBB1udDBCJBhBBBxCBBxIEEFYYBDBF0C0CBzBzBBQBbRBOnBnBBGBaMBtBDBwBNBlBkCkCBMBNJJBuBuBBBBzBCCBBBDBBGBBCqBqBBDBGBBtHHBCBBx5TiXiXBOBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB7DCB2BOBqBDDBLLBCBuBKBI+B+BBBBlBNBRBBtBNNBBBxBNBJDBCBB9CLBHDD+ELBWDB4BBBCGBDBBDCBKLLBDDBFBEEBkCIBCDDCDBCEBCPPBzCzCBQBYyCyCBSBsHGBDIBcBBzCQBrDMBmDOBhIOB2HFBCBBDDBCCCBuEuEBFBDGBEddBIBpBGBCDBJKKBJBvBPBnGHBoGHBCHBzCVBCNB7DFBECCBCCBFBCjCjCBDBCBBCEB8KDBKBBCxBxBBFBEEBYmnFmnFHOBpmLRBhuCEB8BGB5gBCCB1BBIDByCMMBslTslTBizEizEBsBBDWB-QEBEFBJHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),Mc:()=>new te(ne("joC4B4BDCBJDBCBBzBBB7BCBHBBDBBLsBsB7BCBjC7B7BBBBJCCB2B2BB7B7BCHHBDDBLLnDBBCBBECBCCBLqBqBBBB+BDB+BBB7BCCBDBDBBCBBKBBdPPB7B7BBBBGCBCCBLrBrBBsCsCBBBHHBTBBrKBBgCsFsFBFFHDDBaaBLLBBBDGBWBBDFBDLLBBB5zBffiEIIBGBCBB7KDBDCBFBBCFBhHBB7BCCKCCBJJBEByExBxBGCCBDBCBB+BffFBBD9B9BDCBCEEBxBxBBGBJBBsFWW35EBB0-dBBD5C5CBzBzBBOBvEBBwBxBxBBFFBDDBBBvDBBDBBZuBuBCuDuDDBBGuHuHBCCBCCBCC0gZCCgEuBuBBBBFBB0DZZB8B8BxBCBKBBO+C+CBBBEBBCrFrFBBBgBBB7BBBCDBDBBDCBKLLB1C1CBBBIDDCDBCBBCmDmDBBBJBBErDrDBBBHCCBCBDuHuHBBBHDBDyDyDBBBJBBCuDuDCBBHoDoDCBBFmImIBBBK4H4HBEBCBBFDDCvEvEBBBJDBF1C1CeBB-BqGqGECCoGPPrDIID2G2GBDBFBBC-K-KBNNxBBBJBBCpvQpvQBBBlxD2BBpDBB0rYBBHFB",!1)),Me:()=>new te(ne("okBBB1xF-wB-wBBCBCCBsshBCB",!1)),Mn:()=>new te(ne("gYvDB0IEBqIsBBCCCBCCBCCpCKBxBUBRmDmDBFBDFBDBBCDBkBffBZB8CKB7BIBKZZBCBCIBCCBCEBsBCB8BIBrBXBCfB4BCCFHBFEEBFBLBBe7B7BFDBJVVBbbDBB6BFFBFFBDDBBBEffBEEMBB6BFFBDBCBBFVVBXXBEBC7B7BDCCBCBJIIBMMBff+BNNzBEE4BCCBBBGCBCDBIBBMBBe7B7BDHHGBBVBBdBB6BBBFDBJVVBeepCIIBBBC7C7CDGBNHBjDDDBHBMGBqCBBcEC4BNBCEBCBBGKBCjBBKnDnDBCBCFBCBBDBBaBBFCBRDBODDBHHQgWgWBBBzdCBeBBfBBfBBhCBBCGBJDDBJBKuBuBBBBC2D2DBjBjB3DCBFBBKHHBBB8GBBD7B7BCGBCCCDHBHJBDxBxBBMBCeBDLBVDBxBCCBDBCGGpBIBNBBhBDBDBBCCB5BCCBEECCB7BHBDBB5ECBCMBCGBFHHEBBnG-BBxWMBFEEBKB--CCBuEhDhDBeBrRDBsDBB1udFFBIBhBBBxCBBxIEEFaaBGG4EBBbRBOnBnBBGBaKBvBCBxBDDBCBDBBoBkCkCBEBDBBDBBNJJwB0B0BCCBDBBGBBCrBrBBJJvHDDFx5Tx5TiXPBRPBuejHjH2EEBn0BCBCBBGDBpBCBFmFmFB+R+RBCBiCEB+JBBuCFBnCKByBDB8D3B3BBNBqBDDBLLBBByBDBDBBI+B+BBBBlBEBCHB-BNNB1B1BBHBLDBDgDgDBBBDCCBHHD+E+EEHBWBB6BBBEmBmBBFBEEBnCFBOECPBB2CHBDCBCYY1CFBCFFBCCBvHvHBCBHBBCBBcBB2CHBDCCBrDrDCDDBEBCmDmDCDDBCBCEBkIIBCBBhIBBCFFxEDBDBBFhBhBBIBpBFBDDBJKKBEBDCBvBMBCBBnGCCBBBCqGqGBFBCFBCzCzCBUBDGBCBBCBB7DFBECCBCCBFBCpCpCBEEC8K8KBMMB1B1BBDBGCCYmnFmnFHOBpmLLBECBhuCEB8BGB5gBgCgCBCByC5lT5lTBizEizEBsBBDWBhRCBSHBDGBfDB1ECB89B2BBFxBBJPPXEBCOBxqBGBCQBDGBCBBCEBlDhFhFBFB4L+B+BBCB9PDB-HBB0HDDIBBG7O7OBFBuDGB29lYvHB",!1)),N:()=>new te(ne("wBJB5DBBGDDBBBitBJBnEJBnGJB9MJB3DJBFFBtDJB3DJB3DJBDFBvDMB0DJBJGBoDJBpDGBISBuDJBhDJB3DJBnCTBtIJBnCJBwWTBybCBwHJBHJBXJBtJJBhEKBmFJBHJB3FJB3CJBnEJBHJB3gBEEBEBHJBnGyBBDEB3W7BBvCVB3TdBqrBqYqYaIBPCB4KDBrEJBfHBCOBhBJBoBOBh7cJB9FJBhKFB7EJBnBJBnGJBXJB3CJB3MJB34UJBuPsBBN4BBSBB2KaBlBDBeJJnEEBrGJBvdHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBxBJBHJB3IeB-EJBrBDBxDGBnEdBhEJB9BJBxEJBITB8HJB3KJB3DJB3LJBnDJBHTBtCLBlNSB+CJB3UJB3CcBkHJBnCJB3BJBnLJBnDUBshBuDBimPJBnpCJB3CJBnEJBCGBvQJBnIWB+KCB6nXJBnuBTBNTBtDYB2iBxBBhqCJBnNJB3PJB4HJBtWIBhEJB4Y6BBCCBCDBtCsBBCOBjeMBk3CJB",!1)),Nd:()=>new te(ne("wBJnxBJnEJnGJ9MJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJ3DJhDJ3DJnCJ3IJnCJn6BJnBJtJJhEJnFJHJ3FJ3CJnEJHJnuiBJnVJnBJnGJXJ3CJ3MJ34UJnsBJnkCJHJ9YJhEJ9BJxEJ3IJ3KJ3DJ3LJnDJHTtCJnNJnDJ3UJ3CJ3HJnCJ3BJnLJ3uQJnpCJ3CJnEJ3QJ37XJ12CxBhqCJnNJ3PJ4HJ2aJ30EJ",!0)),Nl:()=>new te(ne("u3FCBwzCiBBDDB-zDaaBHBPCBs1dJBxyW0BBtOJJnEEBrhIuDBm8SCB",!1)),No:()=>new te(ne("yFBBGDDBBB2pCFB5LFB5DCBmEGB6GGBSIByNJB2hBTB0jBJBhP20B20BEFBHJBnGPBqB3W3WB6BBvCVB3TdBqrB1kB1kBBCBrEJBfHBCOBhBJBoBOBxrdFBymWsBBiCDBSBB2KaBlBDB1pBHBaGBoBIBsCEBXFBhFBBDPBDtBBhCIB1BBBfCBsCEBpDHBZHBqBGBrKFBhLeB-EJBrBDBxDGBnETB8LTBmqBBBvNIBobSB0aUBn8SGB-YWBqhZTBNTBtDYBvqFIBid6BBCCBCDBtCsBBCOBjeMB",!1)),P:()=>new te(ne("hBCBCFBCDBLBBEBBbCBCccCkBkBGEELBBEEE-VJJzOFBqBBB0BCCDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCmBmBBCBoCrCrCBDBFBBwDFBsFlTlTBHB4EuTuTtBBBvCCBoCBB+ECBCCBmBKB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBM9Z9ZBWBJTBCMBCLBfBBPBB6TDBeBB+hBNBwCBBgBJB0MVBgCDBhBBB8XDBCBBxDwEwEBtBBCfBDLBkNCBFJBDLBRNNjD7C7CjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HzqUzqUBxGxGBI
1641BXiBBCNBCFFCBB2ECBCFBCDBLBBEBBbCBCccCCCBFB7MCB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDByO-J-JjBlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Pc:()=>new te(ne("-Cg-Hg-HBUU-u3BBBZCBwHAB",!1)),Pd:()=>new te(ne("tB9qB9qB0BiyDiyDmgBqgCqgCBEBiwDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Pe:()=>new te(ne("pB0B0BgB+1D+1DC-6B-6BqtC4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECtBGCtNICEGCDBB-ozB6G6GeOCESSCCCrF0B0BgBGD",!1)),Pf:()=>new te(ne("7F+6H+6HEddpuDCCFDDQEE",!1)),Pi:()=>new te(ne("rFt7Ht7HDBBDaapuDCCFDDQEE",!1)),Po:()=>new te(ne("hBCBCCBDECBLLBEEBcclCGGPBBI-V-VJzOzOBEBqB3B3BDDDtBBBVBBCBBOCCBBBrCDBnDsBsBBMBqHCB3BOBgBmImIBLLtE5D5D6DnMnMNwLwL7CLLBpFpFBNBCxDxDrCEBFBBwDFBsFlTlTBHBmY9D9DBBBoCBB+ECBCCBmBFBCDB6JBB5GBBhEGBCFBhFBBLGBdCB9DDB8BEB-BBBhCHBMjajaBJJBGBJIBDDBDCBEKBCCCBIB7kDDBCBBxDwEwEBFFBBBDDDBHBCBBCDDBLLBDBCJBDDBCCCBLBDCBtNCB6B+F+FjgdBBuICBkDLL0DFB9LDB3CBBpBCBCyByBBwBwBiDMBRBB9DDB-DBBRBB6HlxUlxUBFBDXXVBBDDBECBCDBICBHCCB2E2EBBBCCBDECBLLBEEBcclBDDB7M7MBBB9UxBxB-MoXoXoGgBgBxIIBnBxDxDBFBjCGB6CDB0ZlElEBDBtBDB+FGBuDBBCDB-DDBxBBBwCDBFOOCCB5CFBsDrJrJBCCBzDzDBDBLBBCpDpD7HWBqDCBdMBtCjEjEBBB9HpIpIBBB8E9C9CBGB0CCBCEB+CJB4GgDgDBDBrBBBmUBBrCMBwFxjBxjBBDB97CBB8zOBBmEiCiCBDBJpRpRBBBoJDBoK9lT9lTovHEB07C-a-aBAB",!1)),Ps:()=>new te(ne("oBzBzBgB-1D-1DC-6B-6B-rCEEnB4B4BQ7T7TCff-hBMCxChBhBCGC1MUChCCCiBmhBmhBCECaTTCECtNICEGCDipzBipzB4GeeCMCESSCCCrFzBzBgBEEDAB",!1)),S:()=>new te(ne("kBHHRCBgBCCcCCkBEBCBBDCCBCBDEEfgBgBrODBNNBGGBCCCBPB2DPPBxDxDsErIrIBBB3DCBDDDBvGvGLUUB4H4HIBBpEqLqLBHHB2H2H-DjEjEBGBlEwGwGqBmGmGiGCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WuLuLlL+E+EBgBBiLJBKIBhiBCCBBBMCBOCBOCBOBBmCOOoBCBOCBUhBB-BBBCDBCBBLCCBBBGFBCECFMMBFFBDBGDBC7B7BBFFB2LBFcBD+HBXKByCtCBXnTBtBwBBDeBLyMBX+BBFfBD1LBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBB8CBB0HBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BB6RWBKBBoDBB+EDBLDB+RCBiHPPB+9T+9TpEgBBuLPBhCBB3BHBtBDBjDCCBBBD7E7EHRRBBBgBCCcCCiEGBCGBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSmWmWBiKiKBGBnjC2kC2kCBbBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQQBgDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBrbaagBaagBaagBaagBaa9B-PB4BDBzBHBCNBCBBp2BwNwNttCEE+DiOiOBvIvIBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Sc:()=>new te(ne("kB+D+DBCBqnB8D8DzPBBzPBBI2H2HoImSmS8sClmClmCBgBB37hBkuVkuVtD7E7E8GBBEBB3-HDB-4wBxtCxtC",!1)),Sk:()=>new te(ne("+CCCoCHHFEEqQDBNNBGGBCCCBPB2DPPBjoBjoB15FCCBBBMCBOCBOCBOBB9kEBBkzdWBKBBoDBBxePPBniUniUBPB8bCCjF4g9B4g9BBDB",!1)),Sm:()=>new te(ne("rBRRBBB+BCCuBFFmBgBgB-XwQwQBBB8xGOOoBCBOCBsEoBoBBDBHlClCBDBGBBFGDIgBgBBDDCgBgBBqIBhBBB7CffBXBpBFB2OKK3BHBwDxKxKBDBDeBLPBhIiEBX+BBFfBDhIBxBUBDFB9+zB5Z5ZCCBlFRRBBB+BCCkEHHBCBitDBBhrwBx+Bx+BagBgBagBgBagBgBagBgBat5Ft5FB-uC-uCBHB",!1)),So:()=>new te(ne("mFDDFCCyerIrIBgEgEBvGvGLUUB4H4HkQ2L2LjEFBClElEwGqBqBoMCBQCCBBBDFBVECmEHBCFBCBBGDBmGBBxXJB0WzWzW+EhBBiLJBKIBksBBBCDBCBBLCCBHHBEBCECFMMBPPCBBC7B7BBKKBDBDDBCBBCBBCGBCeBDBBCCCBdBtIHBFTBDGBDwCBCdBanBBHnCBXKByCtCBX2FBCIBC1BBJuDBC3HBtBrBBhC-HBhQvBBWBBHmBBDpEBmHFBmLBBvBZBC4CBN1GBbPBFOOBNNWBBHBBxKBBFJBhBlBBKRRBdBMdBJQQBeBLmBBQ-JBhuG-BBx0V2BBibDBLBBC+R+RBBBqqUPBuLPBhCBB3BHBuBCBlPEEFBBOBB6JIB6BQBDCBCMBEwBwBBrBB7zBBBwSpgBpgBBGBnjC2kC2kCBGBFQBr6SDBG3qU3qUk7DvHBLCBEzNBHWBQPBhDzDB9B1HBLmBBD7BBGCBXBBIdBF8BBWhCBE7F7FB1CBqlB-PB4BDBzBHBCNBCBBp2B96C96CiEyWyWBqBBFjDBNOBDOBCOBCkBBYgFB5BcBOrBBFIBIBBPFB7E6HBG4WBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBB-B3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBC7CBLAB",!1)),Z:()=>new te(ne("gBgEgEgvFgsCgsCBJBeBBGwBwBh9DAB",!1)),Zl:()=>new te(ne("ohIA",!0)),Zp:()=>new te(ne("phIA",!0)),Zs:()=>new te(ne("gBgEgEgvFgsCgsCBJBlBwBwBh9DAB",!1)),ASCII_Hex_Digit:()=>new te(ne("wBJIFbF",!0)),Alphabetic:()=>new te(ne("hCZBHZBwBLLFGGBVBCeBCpOBFLBPEBICC3CeeBQBCBBDDBCHHCCBCCCBSBCyCBCqEBJlFBClBBDHHBnBBoBNBCCCBCCBCCJaBFDBeKBG3BBCGBPlDBCHBFHBFCBLCBDRRBuBBOkDBZgBBKBBFGGBWBDSBUYBIKBGXBCGBIJJBoBBLLBEGBHrCBCPBCCBFOBOSBCHBDBBDVBCGBCEEBCBEHBDBBDBBCJJFBBCEBNBBLFFBBBCFBFBBDVBCGBCBBCBBCBBFEBFBBDBBFIIBCBCSSBEBMCBCIBCCBCVBCGBCBBCEBEIBCCBCBBEQQBCBWDBFCBCHBDBBDVBCGBCBBCEBEHBDBBDBBKBBFBBCEBORRBCCBEBECBCDBEBBCCCBEEBEEBBBELBFEBECBCCBEHHpBMBCCBCWBCPBEHBCCBCCBJBBCCBCBBDDBdDBCHBCCBCWBCJBCEBEHBCCBCCBJBBGCBCDBOCBNMBCCBCoBBDHBCCBCCBCGGBCBIEBXFBCCBCRBEXBCIBCDDBFBJFBCCCBGBTBBO5BBGGBH0B0BBECBDBCXBCCCBRBCCBDEBCHHPDBhBgCgCBGBCjBBFSBFPBCjBBkC2BBCDDBDBR-BBLDBDlBBCGGDqBBCsKBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBmBPBR1CBDFBErTBDQBCZBGqCBEKBITBMUBNTBNMBCCBCBBNzBBDSBPFFkC4CBIqBBGlCBLeBCLBFIBYdBDEBMrBBFZB3BbBF+BBDTBzBYYBMMBBByBzBBCOBCHB0BpBBDDBLrBBCKBP2BBXCBLjBBDKBGqBBDCBqBDBCFBCBBEGGB+FBUhBBM1IBDFBDlBBDFBDHBCGCBdBD0BBCGBCEEBBBCGBEDBDFBFMBGCBCGB1DOORMBmDFFDJBCEEBDBHGCBCBCKBDDBGEBFSSBnBBuZzBB34BkHBHDBEBBNlBBCGGD3BBI
1641RRBVBKGBCGBCGBCGBCGBCGBCGBCGBCfBwB2O2OBBBaIBIEBDEBF1CBHCBC5CBCDBGqBBC9CBSfBxBPBhQ-tGBhCs0VBkCtBBDsIBEPBLBBVuBBGHBEwDBoBIBDmDBDxCBVUBCgBBZzBBNjCBCtBtBBEBECCBBBLgBBGiBBOcBEyBBCLBQRRBOBLEBC2BBKNBTWBEkCBCCCZCBDPBDDBMFBDFBDFBKGBCGBCqBBCNBH6DBWj9KBNWBFwBBloItLBDpDBnBGBNEBGLBCMBCEBCCCBCCBCCBqDBiBqLBT-BBD1BBpBLB1DEBCmEBlBZBHZBM4CBEFBDFBDFBDCBkBLBCZBCSBCBBCOBDNBjB6DBmC0BBsIcBEwBBwBfBOdBGqBBGdBDjBBFHBCEBrB9EBTjBBFjBBFnBBJzBBNKBCOBCGBCBBCKBCOBCGBCBBEzBBN2JBKVBLHBZFBCpBBCIBmCFBDCCBqBBCBBEDDBVBLWBKeBiCSBCBBLVBLZBHZBnB3BBHBBhCDBCBBGHBCCBCcBrBcBEcBkBHBCbBc1BBLVBLSBORBvDoCB4ByBBOyBBOnBBjBbBEGGBVB7HpBBCBBEBBRFBzBCBEcBLJJBUBrBRBvBUBcWBKlCBsBEBL4BBKOOBXBYyBBSDBJiBBEKKB+BBCDBKBBLCCkBRBChBBDHHBCB-BGBCCCBCBCOBCJBI4BBYDBCHBDBBDVBCGBCBBCEBEHBDBBDBBEHHGGBdJBCDDClBBCJBCDDCDBCBBECCtBhCBCCBCDBVCBfhCBDBBC5F5FB0BBDGBaFBjB+BBCEE8B1BBDoCoCBZBDNBWGB6F4BBoD-BBgBHBDDDBGBCBBCdBCBBDBBDDB+CHBDtBBDFBCCCBccBxBBDJBSnCBGTTBnCBoDHB5CgBBgBIBCsBBCGBCyByBBcBDVBCNBqCGBCBBCrBBECCBCCBBBCDDBZZBEBCBBCkBBCBBCDBCYYBqBBlIWBKQBCoBBECBwDwCwCB4cBnDuDBSjGBtyCgDBQvhBBSFBa68DBGmSB61GuBBy2B4RBIeBSuCBSdBTvBBRDBgBUBGSBxNsBB0G-BBhBYBDYBtBqCBF4BBIQBhCBBCNNBFBK1mHBqBfBiDyDB+vIDBCGBCBBCiJBQeeBBBDPPBCBJrMBloCqDBGMBEIBIJBFi7Fi7FBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDYBCYBCeBCYBCeBCYBCeBCYBCeBCYBCHB15BeBHFB2GGBCQBDGBCBBCEBG9BBiBxDxDBrBBLGBRiKiKBcBTrBBlPbBlHdBDwGwGBdBCVBJBBhHGBCDBCBBCOBCkGB8BjCBEEE1lBDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1TZBHZBHZB3zD-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Dash:()=>new te(ne("tB9qB9qB0BiyDiyDmgBqgCqgCBEB+BoBoBQnMnMlgDDDgBBBFdd-NUUwDxszBxszBBmBmBLqFqFhzD-J-J",!1)),Emoji:()=>new te(ne("jBHHGJBwDFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDrGrGhFBBNBBPDDBIBsCZBCBBYVVDIBWBBvFhBBDvDBDBBCCBDyCBDCBCmIBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDDBEJBECCBEEDJBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Emoji_Component:()=>new te(ne("jBHHGJB0+H2G2Gsp3B3+8B3+8BBYB8PEBxtBDBtzhY-CB",!1)),Emoji_Modifier:()=>new te(ne("7-8DE",!0)),Emoji_Modifier_Base:()=>new te(ne("9wJ8G8GRDB4jzD9B9BBBBDDDBBB2DBBDKBWSBEFFBBBCCBICCZqGqGBFFWFFBvFvFBBBEEB0CRRBBBKMMgSDDJHBHKKBIBDCB5B+B+BBCCBCCSCBCMBmHCBrBIB",!1)),Emoji_Presentation:()=>new te(ne("64IBBuGDBEDDqQBBWBBzBLBsBUUOJJBSSBGGBJJGWWIBBCFFDIIFBBdkBkBCFFBBBC+B+BBBBZPP8aBB0BFFvlxDrGrG-FDDBIBsCZBCZZVDDBDBCCBWBBvFgBBNIBClCBCVBNqBBFEBNQBEEEBlCBCCCB5FBD+BBODBCXBTbbBOO3C0CBxBlCBHEEBBBDDBEDBMBBIIBkHLBF8I8IBtBBCJBC4FBxDMBEKBE4BBCFFBOBDLBFJB",!1)),Extended_Pictographic:()=>new te(ne("pFFFu8HNN5GXX7CFBQBBwLBBNnFnFaKBFCBoGoHoHBLLK7B7BBCBCEBKGDBDDFDDCBBDIEBJJBBBGCCGLBMBBDCCBCCTDDBTTBEBCCCBEEBGGDBBFBBMBBGBBDGGBECBVVBGGBEBCDBDFFDDDBEBCDDCCCHEEHLLBQQDFFCFFBBBCMMBxBxBBBBKeP1LBBwOCBUBB0BFF7mBNN6SCCrrvDoBoBBCBlDLBQBBQPPBmBmBBIBxDBBNBBPDDBIBU3BBcOBLVVDIBCDBKWBH7FBDvDBDBBCCBDyCBDCBCDBG9HBC+BBMFBCXBIBBDHBNDDBCBDFFBOOBDDJBBKGGBBBNCBJCBDCCFHHEHHB0CBxBlCBGHBDQBECCBEBDMB7GlBBNDB5BHBLFBpBHBfBBNDBDNBKmBBNuBBCJBC4FB5CHBPxEBhI9fB",!1)),Hex_Digit:()=>new te(ne("wBJIFbFq1-BJIFbF",!0)),Lowercase:()=>new te(ne("hDZBwBLLFlBlBBWBCHBC2BCBQCBuBCDECBBBDCCDEEBFFDEEBBBDDDCCCDCCBCCDEECDDBDDBBBHGDCOCBSCBDDCEEC4BCBFBDDDBCCFICBjCBDiBBIBBfEBhDsBsBCEEDDBTccBhBBCBBECBCWCBDBCGDB0B0BBuBBCgBCK0BCDMCBgDCxBoBBo6CqBBCDB5XFBjkCIBC2D2DB+FBiC0ECBHBCgDCBHBJFBLHBJHBJFBLHBJHBJNBDHBJHBJHBJEBCBBHEEBBBCBBJDBDBBJHBLCBCBB6DOORMBuDEEBEEcKFDBBJDBFiBiBBOBFsasaBYBn6BvBBCEEBGCFCCBCCBGBEiDCBIICFFNlBBCGG0oesBCUaCBBBmEMCBBBC8BCBIBCCCDICFCCDCCBBBCSCGGGCMCFCCDOCWDBCCCBBB2ZqBBCNBHvCBh6TGBNEBqhBZBumBnBBpEjBB8EKBCOBCGBCBBkODDBBBCpBBCIBmoByBB+DVB75CfBhsVfB8BYBnqZZBbGBCRBbZBbDBCCCBFBCKBbZBbZBbZBbZBbZBbZBbZBbZBbbBdYBCFBbYBCFBbYBCFBbYBCFBbYBCFBC15B15BBIBCTBHFBmI9BB1lChBB",!1)),Math:()=>new te(ne("rBRRBBBgBeeCuBuBFmBmBgB5W5WBBBDbbBDDBBBwQCBuwGccBBBMEEOPPBCBWEBMEBiCMBFEEBFFBDBTFFDJBCDDBEBHEEBDDBCCBBBCFBENBClClCBWBCFBCBBFBBFfBCHHBPPBqIBJDBVBB7CffBZBCZZMGB+NBBNJBFFBFBBDBBEEBPCCDFBMHBGBB6BCCeDBKCBxK-BBhI-PBxBUBDFB9+zB4Z4ZBEBCjFjFRCBeCCeCCkEHHBCBitDBBhrwBwoBwoBBzCBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBBhwFDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB-uCIB",!1)),Quotation_Mark:()=>new te(ne("iBFFkEQQ96HHBaBBowDqOqOBCBOCBixzBDB+FFF7CBB",!1)),Terminal_Punctuation:()=>new te(ne("hBLLCMMBEE-ZJJiQ6B6BpCPPCCB1FsBsBBJBCsHsHB3B3BBEBCHBgBmImIB1nB1nBBtFtFFFB4JBB2YHBmY9D9DBBBoCBB+ECBEoBoBBCBDBB7JBBjLDBjFBBLBBCCBeCB8FEB-BBBldYYBKKBBBwlDCBzJOOFLLCBBEBBtNBB8ndBBuICBkHEB-LBB3CBBgD4E4EBBB0ECBgERRB6H6HnxUDDB6B6BBBBCDBqFLLCMMBEEiCDD7hBxBxBnkBoGoG3JBB5EFBlCFB6CDB5dEBtBDB+FGBxDDBgECBiEBBHRRB5C5CBDBtDrJrJB2D2DBBBNBBnLDBEOBqDBB6HCBmQCC8HBB4CBBFBB-MCBuBmUmUBrCrCBspBspBBDB6vRBBmEiCiCBBBLqRqRBoJoJBnwTnwTovHDB",!1)),Uppercase:()=>new te(ne("hCZBmDWBCGBiB2BCDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIJDCMCDQCDDDCCBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBDDBBBEWCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBpCDBNDBNDBNEBMDBnIFFECBDCBDEEBDBHGCBCBDDBLBBGbbBOBUzZzZBYBx5BvBBxBCCB
1641BBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoqZZBbZBbZBbCCBGDBDDBCBCHBbZBbBBCDBDHBCGBcBBCDBCEBCEEBFBcZBbZBbZBbZBbZBbZBfYBiBYBiBYBiBYBiBYBiB2pE2pEBgBBvgCZBHZBHZB",!1)),White_Space:()=>new te(ne("JEBTlDlDbgvFgvFgsCKBeBBGwBwBh9DAB",!1))})),Ye(Ku,"SCRIPTS",new XB({Adlam:()=>new te(ne("go6DrCFJFB",!0)),Ahom:()=>new te(ne("g4lCaDOFW",!0)),Anatolian_Hieroglyphs:()=>new te(ne("ggxCmS",!0)),Arabic:()=>new te(ne("gwBEBCFBCNBCCBCfBCJBMZBCrDBChBBxCvBBxHhBBGqCBCcBxy8BtPBDvEBhBPBxDEBCmEBk7DeBkCFBJIBiBFBh43BDBCaBCBBCDDCJBCDBCCCHFFCECBBBCBBCDDCICBCCDDBCGBCDBCDBCCCBIBCQBGCBCEBCQB1BBB",!1)),Armenian:()=>new te(ne("xpBlBDxBDCks9BE",!0)),Avestan:()=>new te(ne("g4iC1BEG",!0)),Balinese:()=>new te(ne("g4GsCCxB",!0)),Bamum:()=>new te(ne("g1pB3CpowB4R",!0)),Bassa_Vah:()=>new te(ne("w26CdDF",!0)),Batak:()=>new te(ne("g+GzBJD",!0)),Bengali:()=>new te(ne("gsCDBCHBDBBDVBCGBCEEBCBDIBDBBDDBJFFBCCBDBDYB",!1)),Beria_Erfe:()=>new te(ne("g17CYDY",!0)),Bhaiksuki:()=>new te(ne("ggnCICsBCNLc",!0)),Bopomofo:()=>new te(ne("qXB6wLqBxDf",!0)),Brahmi:()=>new te(ne("ggkCtCFjBKA",!0)),Braille:()=>new te(ne("ggK-H",!0)),Buginese:()=>new te(ne("gwGbDB",!0)),Buhid:()=>new te(ne("g6FT",!0)),Canadian_Aboriginal:()=>new te(ne("ggF-TxRlC7tgCP",!0)),Carian:()=>new te(ne("g1gCwB",!0)),Caucasian_Albanian:()=>new te(ne("wphCzBMA",!0)),Chakma:()=>new te(ne("gokC0BCR",!0)),Cham:()=>new te(ne("gwqB2BKNDJDD",!0)),Cherokee:()=>new te(ne("g9E1CDFz7lBvC",!0)),Chorasmian:()=>new te(ne("w9jCb",!0)),Common:()=>new te(ne("AgCBbFBbuBBCOBCEBYgBgBiOmBBGEBDTB1DKKHCC+THHPEEhB9E9ElQiEiEB6mB6mB2MDBjJwvBwvBBBBoCBBsGBBCumBumBOIIBCBCFBCCBDmYmYBKBD2CBCKBEKBCOBShBB-BlBBCCBDFBCaBCQBqBCBF5UBXKBW-cBhIzTBDpEBhQ9CBzMUBCCCBXBQHBFDB8CBBE7C7CB0E0EBOBhBlBBKxBxBB+BBgBwCBwB5C5CBmFBhuG-BBhoWhBBnDCBmFJB1HhFhFsMPPBzuUzuUBxGxGBIBXiBBCSBCDB0ECCBeBbFBbKBLuBuBBhChCBFBCGBLEBjICBFsBBEIBxCMB0BsBBlHaBltuBDB96D8HBEzNBHWBQQBgDzDB9B1HBLmBBD9BBEQBJBBIdBF8BB2GTBNTBN2CBKYBoE0CBCmCBCBBDDDBDDBCBCLBCCCBFBCgCBCDBDHBCGBCbBCDBCEBCEEBFBCzKBDjJBDxBByjFjCBtC8BBjWrBBFjDBNOBDOBCOBCkBBLtFB5BZBCBBOrBBFIBIBBPFB7E4eBEQBEMBE5GBHLBFQQBKBF3BBJJBHnBBJdBDLBFBBPIBoB3KBJNBDMBEKBE4BBCFFBOBDLBFJBIyEBCmDBnghYffB+CB",!1)),Coptic:()=>new te(ne("ifNxkKzDGG",!0)),Cuneiform:()=>new te(ne("ggoC5cnDuDCEMjG",!0)),Cypriot:()=>new te(ne("ggiCFBDCCBqBBCBBEDD",!1)),Cypro_Minoan:()=>new te(ne("w8rCiD",!0)),Cyrillic:()=>new te(ne("ggBkEBDoFBx6FKBhFtCtCojEfBhie-CBv8VBBhw4B9BBiBAB",!1)),Deseret:()=>new te(ne("gghCvC",!0)),Devanagari:()=>new te(ne("goCwCFODZh7nBfhwcJ",!0)),Dives_Akuru:()=>new te(ne("gomCGBDDDBGBCBBCdBCBBDLBKJB",!1)),Dogra:()=>new te(ne("ggmC7B",!0)),Duployan:()=>new te(ne("ggvDqDGMEIIJDD",!0)),Egyptian_Hieroglyphs:()=>new te(ne("ggsC1iBL68D",!0)),Elbasan:()=>new te(ne("gohCnB",!0)),Elymaic:()=>new te(ne("g-jCW",!0)),Ethiopic:()=>new te(ne("gwEoCBCDBDGBCCCBCBDoBBCDBDgBBCDBDGBCCCBCBDOBC4BBCDBDiCBDfBEZBnvGWBKGBCGBCGBCGBCGBCGBCGBCGBjpfFBDFBDFBKGBCGBylvCGBCD
1641BCBBCOB",!1)),Garay:()=>new te(ne("gqjClBEcJB",!0)),Georgian:()=>new te(ne("glElBBCGGDqBBCDBx8CqBBDCBhiElBBCGG",!1)),Glagolitic:()=>new te(ne("ggL-Ch9sDGCQDGCBCE",!0)),Gothic:()=>new te(ne("w5gCa",!0)),Grantha:()=>new te(ne("g4kCDBCHBDBBDVBCGBCBBCEBDIBDBBDCBDHHGGBDGBEEB",!1)),Greek:()=>new te(ne("wbDBCCBDDBCFFCCCBBBCCCBSBC+BBPPBnpGEBzBEBFEB1ChKhKBUBDFBDlBBDFBDHBCGCBdBD0BBCOBCNBDFBCSBDCBCIBoJ-xiB-xiB7uVuCBSgj0Bgj0BBkCB",!1)),Gujarati:()=>new te(ne("h0CCBCIBCCBCVBCGBCBBCEBDJBCCBCCBDQQBCBDLBIGB",!1)),Gunjala_Gondi:()=>new te(ne("grnCFCBCkBCBCFIJ",!0)),Gurmukhi:()=>new te(ne("hwCCBCFBFBBDVBCGBCBBCBBCBBDCCBDBFBBDCBEIIBCBCIIBPB",!1)),Gurung_Khema:()=>new te(ne("go4C5B",!0)),Han:()=>new te(ne("g0LZBC4CBN1GBwBCCaIBPDBle-tGBhC-vUBhoWtLBDpDBpodBBNGBqgkB-2pBBhB9oEBDt0FBDwpHBQtTBjtC9QBjvBq6EBGppIB",!1)),Hangul:()=>new te(ne("goE-HvxHBiI9CyDeiCei3dckUj9KNWFwBl9JeEFDFDFDC",!0)),Hanifi_Rohingya:()=>new te(ne("gojCnBJJ",!0)),Hanunoo:()=>new te(ne("g5FU",!0)),Hatran:()=>new te(ne("gniCSCBGE",!0)),Hebrew:()=>new te(ne("xsB2BBJaBFFBpp9BZBCEBCCCBCCBCCBIB",!1)),Hiragana:()=>new te(ne("hiM1CBHCBi7-C+IBTeeBBBulQAB",!1)),Imperial_Aramaic:()=>new te(ne("giiCVCI",!0)),Inherited:()=>new te(ne("gYvDB2IBBlOKBbhXhXBCB8qEtBBDLBlPCBCMBCGBFHHEBBnG-BBtQBBjGgBB65DDBsDBBmrzBPBRNBwejHjH7iEl+uBl+uBBsBBDWBhRCBSHBDGBfDBz6rYvHB",!1)),Inscriptional_Pahlavi:()=>new te(ne("g7iCSGH",!0)),Inscriptional_Parthian:()=>new te(ne("g6iCVDH",!0)),Javanese:()=>new te(ne("gsqBtCDJFB",!0)),Kaithi:()=>new te(ne("gkkCiCLA",!0)),Kannada:()=>new te(ne("gkDMCCCWCJCEDICCCDIBGCCDDJCC",!0)),Katakana:()=>new te(ne("hlM5CBDCBxHPBxGuBBC3CBvgzBJBCsBBzisBDBCGBCBBCgJgJBBBzBPPBCB",!1)),Kawi:()=>new te(ne("g4nCQCoBEc",!0)),Kayah_Li:()=>new te(ne("goqBtBCA",!0)),Kharoshthi:()=>new te(ne("gwiCDCBGHCCCcDCFJII",!0)),Khitan_Small_Script:()=>new te(ne("k-7C84G84GB0OBqBAB",!1)),Khmer:()=>new te(ne("g8F9CDJHJnPf",!0)),Khojki:()=>new te(ne("gwkCRCuB",!0)),Khudawadi:()=>new te(ne("w1kC6BGJ",!0)),Kirat_Rai:()=>new te(ne("gq7C5B",!0)),Lao:()=>new te(ne("h0DBBCCCBDBCXBCCCBVBDEBCCCBFBCJBDDB",!1)),Latin:()=>new te(ne("hCZBHZBwBQQGWBCeBCgOBoBEB8wGlBBHwBBGDBGMBClCBiC-HByLOORMBuEBBHccSoBB42CfBj1elDBExCBVOBxZqBBCIBCDB38TGB7gBZBHZBmhCFBCpBBCIBm61BeBHFB",!1)),Lepcha:()=>new te(ne("ggH3BEOEC",!0)),Limbu:()=>new te(ne("goGeBCLBFLBFEEBKB",!1)),Linear_A:()=>new te(ne("gwhC2JKVLH",!0)),Linear_B:()=>new te(ne("gggCLCZCSCBCODNjB6D",!0)),Lisu:()=>new te(ne("wmpBvBx1eA",!0)),Lycian:()=>new te(ne("g0gCc",!0)),Lydian:()=>new te(ne("gpiCZGA",!0)),Mahajani:()=>new te(ne("wqkCmB",!0)),Makasar:()=>new te(ne("g3nCY",!0)),Malayalam:()=>new te(ne("goDMCCCyBCCCFFPDZ",!0)),Mandaic:()=>new te(ne("giCbDA",!0)),Manichaean:()=>new te(ne("g2iCmBFL",!0)),Marchen:()=>new te(ne("wjnCfDVCN",!0)),Masaram_Gondi:()=>new te(ne("gonCGBCBBCrBBECCBCCBHBJJB",!1)),Medefaidrin:()=>new te(ne("gy7C6C",!0)),Meetei_Mayek:()=>new te(ne("g3qBWqGtBDJ",!0)),Mende_Kikakui:()=>new te(ne("gg6DkGDP",!0)),Meroitic_Cursive:()=>new te(ne("gtiCXFTDtB",!0)),Meroitic_Hieroglyphs:()=>new te(ne("gsiCf",!0)),Miao:()=>new te(ne("g47CqCF4BIQ",!0)),Modi:()=>new te(ne("gwlCkCMJ",!0)),Mongolian:()=>new te(ne("ggGBBDCCBSBH4CBIqBB2t-BMB",!1)),Mro:()=>new te(ne("gy6CeCJFB",!0)),Multani:()=>new te(ne("g0kCGBCCCBCBCOBCKB",!1)),Myanmar:()=>
1641new te(ne("ggE-EhqmBeiDfxibT",!0)),Nabataean:()=>new te(ne("gkiCeJI",!0)),Nag_Mundari:()=>new te(ne("wm5DpB",!0)),Nandinagari:()=>new te(ne("gtmCHDtBDK",!0)),New_Tai_Lue:()=>new te(ne("gsGrBFZHKEB",!0)),Newa:()=>new te(ne("gglC7CCE",!0)),Nko:()=>new te(ne("g+B6BDC",!0)),Nushu:()=>new te(ne("h-7CvsQvsQBqMB",!1)),Nyiakeng_Puachue_Hmong:()=>new te(ne("go4DsBENDJFB",!0)),Ogham:()=>new te(ne("g0Fc",!0)),Ol_Chiki:()=>new te(ne("wiHvB",!0)),Ol_Onal:()=>new te(ne("wu5DqBFA",!0)),Old_Hungarian:()=>new te(ne("gkjCyBOyBIF",!0)),Old_Italic:()=>new te(ne("g4gCjBKC",!0)),Old_North_Arabian:()=>new te(ne("g0iCf",!0)),Old_Permic:()=>new te(ne("w6gCqB",!0)),Old_Persian:()=>new te(ne("g9gCjBFN",!0)),Old_Sogdian:()=>new te(ne("g4jCnB",!0)),Old_South_Arabian:()=>new te(ne("gziCf",!0)),Old_Turkic:()=>new te(ne("ggjCoC",!0)),Old_Uyghur:()=>new te(ne("w7jCZ",!0)),Oriya:()=>new te(ne("h4CCCHDBDVCGCBCEDIDBDCICFBCEDR",!0)),Osage:()=>new te(ne("wlhCjBFjB",!0)),Osmanya:()=>new te(ne("gkhCdDJ",!0)),Pahawh_Hmong:()=>new te(ne("g46ClCLJCGCUGS",!0)),Palmyrene:()=>new te(ne("gjiCf",!0)),Pau_Cin_Hau:()=>new te(ne("g2mC4B",!0)),Phags_Pa:()=>new te(ne("giqB3B",!0)),Phoenician:()=>new te(ne("goiCbEA",!0)),Psalter_Pahlavi:()=>new te(ne("g8iCRIDNG",!0)),Rejang:()=>new te(ne("wpqBjBMA",!0)),Runic:()=>new te(ne("g1FqCEK",!0)),Samaritan:()=>new te(ne("ggCtBDO",!0)),Saurashtra:()=>new te(ne("gkqBlCJL",!0)),Sharada:()=>new te(ne("gskC-ChsCH",!0)),Shavian:()=>new te(ne("wihCvB",!0)),Siddham:()=>new te(ne("gslC1BDlB",!0)),Sidetic:()=>new te(ne("gqiCZ",!0)),SignWriting:()=>new te(ne("gg2DrUQECO",!0)),Sinhala:()=>new te(ne("hsDCBCRBEXBCIBCDDBFBEFFBEBCCCBGBHJBDCBt-gCTB",!1)),Sogdian:()=>new te(ne("w5jCpB",!0)),Sora_Sompeng:()=>new te(ne("wmkCYIJ",!0)),Soyombo:()=>new te(ne("wymCyC",!0)),Sundanese:()=>new te(ne("g8G-BhIH",!0)),Sunuwar:()=>new te(ne("g+mChBPJ",!0)),Syloti_Nagri:()=>new te(ne("ggqBsB",!0)),Syriac:()=>new te(ne("g4BNC7BDCxIK",!0)),Tagalog:()=>new te(ne("g4FVKA",!0)),Tagbanwa:()=>new te(ne("g7FMCCCB",!0)),Tai_Le:()=>new te(ne("wqGdDE",!0)),Tai_Tham:()=>new te(ne("gxG+BCcDKHJHN",!0)),Tai_Viet:()=>new te(ne("g0qBiCZE",!0)),Tai_Yo:()=>new te(ne("g25DeCVJB",!0)),Takri:()=>new te(ne("g0lC5BHJ",!0)),Tamil:()=>new te(ne("i8CBBCFBECBCDBEBBCCCBEEBEEBBBELBFEBECBCDBDHHPUBm+kCxBBOAB",!1)),Tangsa:()=>new te(ne("wz6CuCCJ",!0)),Tangut:()=>new te(ne("g-7CgBgBB+3GBhQeBiDyDB",!1)),Telugu:()=>new te(ne("ggDMCCCWCPDICCCDIBCCCBDDDJII",!0)),Thaana:()=>new te(ne("g8BxB",!0)),Thai:()=>new te(ne("hwD5BGb",!0)),Tibetan:()=>new te(ne("g4DnCCjBFmBCjBCOCGFB",!0)),Tifinagh:()=>new te(ne("wpL3BIBPA",!0)),Tirhuta:()=>new te(ne("gklCnCJJ",!0)),Todhri:()=>new te(ne("guhCzB",!0)),Tolong_Siki:()=>new te(ne("wtnCrBFJ",!0)),Toto:()=>new te(ne("w04De",!0)),Tulu_Tigalari:()=>new te(ne("g8kCJBCDDClBBCJBCDDCDBCJBCBBJBB",!1)),Ugaritic:()=>new te(ne("g8gCdCA",!0)),Unknown:()=>new te(ne("4bBBHDBICCVuMuMnBBBzBBBE4B4BBGBcDBHKBvI9B9BBmDmDBMB8BBByBBBQddBCCMEBjBEBuHJJBDDBXXICCBBBFBBKBBDBBFHBCDBDGGBaaBEEHDBDBBXIIDGDBCCGDBDBBECBCGBFCCBFBSJBEKKEXXIDDGBBLIEBCCBNBFBBNGBIEEJBBDBBXIIDGGBKKBDDBEEBFBEDBDGGBTTBIBDHHBBBEFFBBBDCCDCBDCBECBNDBGCBEFFBCCBEBCNBWEBOEEYRRBKKEFFBFBDEEDBBFBBLGBXEEYLLGBBKEEFGBDEBEFFBLLELBOEE0BEEHDBRBBbEETCBZKKCBBICBCDBHCCJFBLBBELB7BDBekBBDCCGZZCYYBGGCIILBBFfBpClBlBBCBoBlBlBQOOBjBBnGCCBDBCBB6LFFBIICFFBqBqBFBBiBFFBIICFFBQQ6BFFBkCkCBhBhBBBBbFB3CBBHBB+UCB6CGBXIBZIBVLBOEEDLB-CBBLFBLFBbFB6CGBsBEBnCJBgBNNBCBNDBCCBrBBBGKBtBDBbFBMCB-BBBiCeeBMMBEBLFBPBBvBBBNTBuCnFnFBGB9BCBQCB-BEBsBBBMHBsBEB3QBBHBBnBBBHBBJGCgBBB2BQQPBBHUUBEEKmDmDNBBcOOBBBjBNBiBOBtEDB7UVBMUB14BBB-LEBuBCCBDBCBB5BGBDNBZIBI4BI-DhBBb6C6CBKB3GZBxC3C3CBoDoDBDBsB-C-C3CIBxBuzcuzcBBB4BIB9KTB5FHB+GTB9BCBLFB5BHBnCHBNFB1DKBfCBvCMMBCBiB4B4BBHBPBBLBBoDXBdJBHBBHBBHIBIII9BDB-DBBLFBl9KLBYDByBjoIBvLBBrDlBBILBGEBbGGCGDrUfBrBFB0BUUFDBGoEoEBCC-FCBHBBHBBHBBECBIIIBIBGBBNbbUDDQBBPhBB8DEBEDBuBCB5COOBBBCuBBvBhEBeCByBOBdDBlBIBfEBsBEBfmBmBBCBPpBB-EBBLFBlBDBlBDBpBHB1BKBNQQIDDMQQIDDBBB1BLB4JIBXJBJXBHrBrBKkCBHBBCtBtBDCBCBBYpCpCBGBKvBBUDDBDBiBCBcEBclBB5BDBVBBzBDDBDBJEEeBBEDBLGBKGBhCfBoBDBNIB3BCBeBBcEBbGBFLBIvCBqC2BB0BMB0BGBvBHBLFBnBCBeHBDvGBgBrBrBEBBDPBHHBKgBBvBHBrBVBblBBdTBYIBvCDBlBIBlCJBCBBaGBLFB2BTTBGBoBIBhDVVBJBTwBwB
1641B8BBICCFQQMFB8BEBLFBFJJBDDBXXIDDGLLBDDBEEBCCBEBCEBIBBICBGKBLCCBCCnBLLCBBCFFLDDBGBDcB9CGGBcBpCHBLlFB3BBBnBhBBmCKBLFBOSB7BFBLFBVbBcBBQDBY4FB9BjDB0CLBJBBCBBJDDfDDBNNBHBLlCBJBBvBBBMaBpCHB0CMBqCGBL1CBJ3CBjBNBLFBKuBuBPJBeCBhBBBXPPBnCBIDDtBCBCDDKHBLFBHDDmBDDHGBLFBtBDBL1HBaGBSqBqBBBBe0CBCOBzBMB8clDBwDGGBJBlGryCBkDMB3iBJB88DEBoS41GB7Bl2BB6RGBgBLLBCByCLLBEBfBBHJBnCJBLIIWEBUvNB7BlGB8CEBaBBarBBsCDB6BGBS-BBGKBIIB3mHoBBhBgDB0D8vIBFIIDkJkJBNBCcBEBBCNBFHBtMjoCBsDEBOCBKGBLBBJ76DB+HCB1NFBYOBSOBvBBBYIB1D7BB3HJBoBBBjGUBnC5DBVLBVLB4CIBamEB2CoCoCDBBCBBDBBFNNCIIiCFFBJJIddFGGCCBI1K1KBlJlJB-V-VBNBGQQBuiBBgBFBH0GBISSBIIDGGBDB-BgBBCvDBuBCBPBBLDBD-JBgBQB7BEBCvOBrB1GBsBDBC-FBgBXXBGBD-GBIFFDQQmGBBRoBBtCDBLDBDwYBlCrCB+BhGBFccDCCBCCLFFCCCBEBCDBCECEDDCBBCICDCCBFFIKFCLLSEBEGGSzBBDtIBtBDBlDLBQBBQQQmBJBvF3BBeMBtBDBKGBDNBH5EB6eCBSCBOCB7GFBNDBCOBNDB5BHBLFBpBHBfBBNDBDNBKmBB5KHBPBBOCBMCB6BCCBCBRBBNDBLGB0EoDoDBjgBBh3pBfB-oEBBv0FBBypHOBvThtCB-QhvBBs6EEBrpIm8yVBCdBhD-DBxHvw-FB",!1)),Vai:()=>new te(ne("gopBrJ",!0)),Vithkuqi:()=>new te(ne("wrhCKCOCGCBCKCOCGCB",!0)),Wancho:()=>new te(ne("g24D5BGA",!0)),Warang_Citi:()=>new te(ne("glmCyCNA",!0)),Yezidi:()=>new te(ne("g0jCpBCCDB",!0)),Yi:()=>new te(ne("ggoBskBE2B",!0)),Zanabazar_Square:()=>new te(ne("gwmCnC",!0))})),Ye(Ku,"FOLD_CATEGORIES",new XB({L:()=>new te(ne("laA",!0)),LC:()=>new te(ne("laA",!0)),Ll:()=>new te(ne("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGC3HrBrBCEEJHHCCBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHxC9zC9zCBuBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Lt:()=>new te(ne("kOCCBCCBCClBCCtsHHBJHBJHBMQQwBAB",!1)),Lu:()=>new te(ne("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpL2B2Bs1CvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1)),M:()=>new te(ne("5cgBgBlgHAB",!1)),Mn:()=>new te(ne("5cgBgBlgHAB",!1)),Emoji:()=>new te(ne("8mJA",!0)),Extended_Pictographic:()=>new te(ne("8mJA",!0)),Lowercase:()=>new te(ne("hCZBmDWBCGBiBuBCEECDOCDuBCBECEBBCCCBCCBBBDDBCBBCCBEBBCBBCECBCCDCCBCCBBBCCCBEEIBBCBBCBBCOCDQCDBBCCCBBBC4BCIBBCBBDCCBCBCGCiJCCEJJHCCBBBCCCBCCBPBCIBkBJJCUCGDDCBBDyBBxBgBCK2BCBMCD+CCDlBBq6ClBBCGGzW1CB0kCHHBpBBDCBhK0ECKgDCKHBJFBLHBJHBJFBMGCJHBZHBJHBJHBJEBMEBMDBNEBMEBqJEEBHHuBPBUzZzZBYBx5BvBBxBCCBBBDGCBCBCDDJCBCgDCJCCFuqeuqeCqBCUaCoEMCE8BCLECBICFCCDCCEUCBDBCEBCOCBCBCCCBQCZs5Vs5VBYBmmBnBBpEjBB9EKBCOBCGBCBBr3ByBB+EVB75CfBhsVfBhCYBoyehBB",!1)),Math:()=>new te(ne("ycGDCHHFMMDDDCHHFAB",!1)),Uppercase:()=>new te(ne("hDZB7BqBqBBWBCHBCuBCEECDOCDsBCDECBBBDCCDEEGDDECBDDDCCCDFFDEECDDECCGBBCBBCBBCOCBSCDBBCEECkBCEQCJDDBCCFICBEBCBBCCCBEEBCCBCBCEBDCCBDDIDDCBBEFBGLLBnFnFsBCCEEEBBBvBDBCdBCBBECBCWCBDBCGD1BvBBCgBCK0BCDMCBgDCyBlBBq6CqBBDCB5XFBjkCIBCvHvHERRzD0ECGGGC8CCBHBJFBLHBJHBJFBMGCJHBJNBzBBBNSSBPPBEEpLiBiBBOBFsasaBYBn6BvBBCEEBGCHDDLiDCJCCFNNBkBBCGG0oesBCUaCoEMCE8BCLCCDICFFFCBBDSCMOCFCCDOCb9a9advCBi8UZBumBnBBpEjBB8EKBCOBCGBCBBk4ByBB+DVB75CfBhsVfB8BYBvyehBB",!1))})),Ye(Ku,"FOLD_SCRIPT",new XB({Common:()=>new te(ne("8cgBgB",!1)),Greek:()=>new te(ne("1FwUwU",!1)),Inherited:()=>new te(ne("5cgBgBlgHAB",!1))})),Ku),ur,ut=(ur=class{static is32(e,t){let r=0,s=e.length;for(;r<s;){const a=r+Math.floor((s-r)/2),o=e.getLo(a),l=e.getHi(a);if(o<=t&&t<=l){const c=e.getStride(a);return(t-o)%c===0}t<o?s=a:r=a+1}return!1}static is(e,t){if(t<=ur.MAX_LATIN1){for(let r=0;r<e.length;r++){if(t>e.getHi(r))continue;const s=e.getLo(r);if(t<s)return!1;const a=e.getStride(r);return(t-s)%a===0}return!1}return e.length>0&&t>=e.getLo(0)&&ur.is32(e,t)}static isUpper(e){if(e<=ur.MAX_LATIN1){const t=String.fromCodePoint(e);return t.toUpperCase()===t&&t.toLowerCase()!==t}return ur.is(Mi.Upper,e)}static isPrint(e){return e<=ur.MAX_LATIN1?e>=32&&e<ur.MAX_ASCII||e>=161&&e!==173:ur.is(Mi.Print,e)}static simpleFold(e){if(Mi.CASE_ORBIT.has(e))return Mi.CASE_ORBIT.get(e);const t=Le.toLowerCase(e);return t!==e?t:Le.toUpperCase(e)}static equalsIgnoreCase(e,t){if(e===t)return!0;
1641if(e<0||t<0)return!1;if(e<=ur.MAX_ASCII&&t<=ur.MAX_ASCII)return 65<=e&&e<=90&&(e|=32),65<=t&&t<=90&&(t|=32),e===t;for(let r=ur.simpleFold(e);r!==e;r=ur.simpleFold(r))if(r===t)return!0;return!1}},Ye(ur,"MAX_RUNE",1114111),Ye(ur,"MAX_ASCII",127),Ye(ur,"MAX_LATIN1",255),Ye(ur,"MAX_BMP",65535),Ye(ur,"MIN_FOLD",65),Ye(ur,"MAX_FOLD",125251),Ye(ur,"MIN_HIGH_SURROGATE",55296),Ye(ur,"MAX_HIGH_SURROGATE",56319),Ye(ur,"MIN_LOW_SURROGATE",56320),Ye(ur,"MAX_LOW_SURROGATE",57343),Ye(ur,"MIN_SUPPLEMENTARY_CODE_POINT",65536),ur);const UD=256,vH=new Uint8Array(UD);for(let n=0;n<UD;n++)vH[n]=97<=n&&n<=122||65<=n&&n<=90||48<=n&&n<=57||n===95?1:0;let Bk=null,wk=null;var Dr,Ct=(Dr=class{static emptyInts(){return[]}static isByteArray(e){return Array.isArray(e)||e instanceof Uint8Array}static isalnum(e){return Le.CODES.get("0")<=e&&e<=Le.CODES.get("9")||Le.CODES.get("a")<=e&&e<=Le.CODES.get("z")||Le.CODES.get("A")<=e&&e<=Le.CODES.get("Z")}static unhex(e){return Le.CODES.get("0")<=e&&e<=Le.CODES.get("9")?e-Le.CODES.get("0"):Le.CODES.get("a")<=e&&e<=Le.CODES.get("f")?e-Le.CODES.get("a")+10:Le.CODES.get("A")<=e&&e<=Le.CODES.get("F")?e-Le.CODES.get("A")+10:-1}static escapeRune(e){let t="";if(ut.isPrint(e))Dr.METACHARACTERS.indexOf(String.fromCodePoint(e))>=0&&(t+="\\"),t+=String.fromCodePoint(e);else switch(e){case Le.CODES.get('"'):t+='\\"';break;case Le.CODES.get("\\"):t+="\\\\";break;case Le.CODES.get("	"):t+="\\t";break;case Le.CODES.get(`
1642`):t+="\\n";break;case Le.CODES.get("\r"):t+="\\r";break;case Le.CODES.get("\b"):t+="\\b";break;case Le.CODES.get("\f"):t+="\\f";break;default:{let r=e.toString(16);e<256?(t+="\\x",r.length===1&&(t+="0"),t+=r):t+=`\\x{${r}}`;break}}return t}static stringToRunes(e){const t=String(e),r=[];let s=0;for(;s<t.length;){const a=t.codePointAt(s);r.push(a),s+=a>ut.MAX_BMP?2:1}return r}static runeToString(e){return String.fromCodePoint(e)}static isWordRune(e){return e<UD?vH[e]===1:!1}static emptyOpContext(e,t){let r=0;return e<0&&(r|=Dr.EMPTY_BEGIN_TEXT|Dr.EMPTY_BEGIN_LINE),e===10&&(r|=Dr.EMPTY_BEGIN_LINE),t<0&&(r|=Dr.EMPTY_END_TEXT|Dr.EMPTY_END_LINE),t===10&&(r|=Dr.EMPTY_END_LINE),Dr.isWordRune(e)!==Dr.isWordRune(t)?r|=Dr.EMPTY_WORD_BOUNDARY:r|=Dr.EMPTY_NO_WORD_BOUNDARY,r}static quoteMeta(e){return e.split("").map(t=>Dr.METACHARACTERS.indexOf(t)>=0?`\\${t}`:t).join("")}static charCount(e){return e>ut.MAX_BMP?2:1}static toArray(e){const t=e.length,r=new Array(t);for(let s=0;s<t;s++)r[s]=e[s];return r}static stringToUtf8ByteArray(e){if(globalThis.TextEncoder)return Bk||(Bk=new TextEncoder),Bk.encode(e);{let t=[],r=0;for(let s=0;s<e.length;s++){let a=e.charCodeAt(s);a<128?t[r++]=a:a<2048?(t[r++]=a>>6|192,t[r++]=a&63|128):(a&64512)===ut.MIN_HIGH_SURROGATE&&s+1<e.length&&(e.charCodeAt(s+1)&64512)===ut.MIN_LOW_SURROGATE?(a=ut.MIN_SUPPLEMENTARY_CODE_POINT+((a&1023)<<10)+(e.charCodeAt(++s)&1023),t[r++]=a>>18|240,t[r++]=a>>12&63|128,t[r++]=a>>6&63|128,t[r++]=a&63|128):(t[r++]=a>>12|224,t[r++]=a>>6&63|128,t[r++]=a&63|128)}return t}}static utf8ByteArrayToString(e){if(globalThis.TextDecoder){wk||(wk=new TextDecoder("utf-8"));const t=e instanceof Uint8Array?e:new Uint8Array(e);return wk.decode(t)}else{let t=[],r=0,s=0;for(;r<e.length;){let a=e[r++];if(a<128)t[s++]=String.fromCharCode(a);else if(a>191&&a<224){let o=e[r++];t[s++]=String.fromCharCode((a&31)<<6|o&63)}else if(a>239&&a<365){let o=e[r++],l=e[r++],c=e[r++],d=((a&7)<<18|(o&63)<<12|(l&63)<<6|c&63)-ut.MIN_SUPPLEMENTARY_CODE_POINT;t[s++]=String.fromCharCode(ut.MIN_HIGH_SURROGATE+(d>>10)),t[s++]=String.fromCharCode(ut.MIN_LOW_SURROGATE+(d&1023))}else{let o=e[r++],l=e[r++];t[s++]=String.fromCharCode((a&15)<<12|(o&63)<<6|l&63)}}return t.join("")}}},Ye(Dr,"METACHARACTERS","\\.+*?()|[]{}^$"),Ye(Dr,"EMPTY_BEGIN_LINE",1),Ye(Dr,"EMPTY_END_LINE",2),Ye(Dr,"EMPTY_BEGIN_TEXT",4),Ye(Dr,"EMPTY_END_TEXT",8),Ye(Dr,"EMPTY_WORD_BOUNDARY",16),Ye(Dr,"EMPTY_NO_WORD_BOUNDARY",32),Ye(Dr,"EMPTY_ALL",-1),Dr);const BH=(n=[],e=0)=>{const t=Object.create(null);for(let r=0;r<n.length;r++){const s=n[r],a=e+r;t[s]=a,t[a]=s}return Object.freeze(t)};var fh,wm=(fh=class{getEncoding(){throw Error("not implemented")}asCharSequence(){throw Error("not implemented")}asBytes(){throw Error("not implemented")}length(){throw Error("not implemented")}isUTF8Encoding(){return this.getEncoding()===fh.Encoding.UTF_8}isUTF16Encoding(){return this.getEncoding()===fh.Encoding.UTF_16}},Ye(fh,"Encoding",BH(["UTF_16","UTF_8"])),fh),b3=class extends wm{constructor(n=null){super(),this.bytes=n}getEncoding(){return wm.Encoding.UTF_8}asCharSequence(){return Ct.utf8ByteArrayToString(this.bytes)}asBytes(){return this.bytes}length(){return this.bytes.length}},Wie=class extends wm{constructor(n=null){super(),this.charSequence=n}getEncoding(){return wm.Encoding.UTF_16}asCharSequence(){return this.charSequence}asBytes(){return Ct.stringToUtf8ByteArray(this.charSequence.toString())}length(){return this.charSequence.length}},Qf=class{static utf16(n){return new Wie(n)}static utf8(n){return Ct.isByteArray(n)?new b3(n):new b3(Ct.stringToUtf8ByteArray(n))}},di=class{static EOF(){return-8}constructor(){this.end=0}canCheckPrefix(){return!0}endPos(){return this.end}hasString(){return!1}hasAnyString(){return!1}prefixLength(){return 0}},Yie=class extends di{constructor(n,e=0,t=n.length){super(),this.bytes=n,this.start=e,this.end=t}hasString(n,e){const t=n.bytes;if(t.length===0)return!0;const r=this.indexOf(this.bytes,t,this.start+e);return r!==-1&&r<=this.end-t.length}hasAnyString(n,e){return n.ac8?n.ac8.searchUTF8(this.bytes,this.start+e,this.end):!1}step(n){if(n+=this.start,n>=this.end)return di.EOF();const e=this.bytes[n]&255;if(e<128)return e<<3|1;if(e>=194&&e<=223&&n+1<this.end){const t=this.bytes[n+1]&255;return(t&192)!==128?e<<3|1:((e&31)<<6|t&63)<<3|2}else if(e>=224&&e<=239&&n+2<this.end){const t=this.bytes[n+1]&255;if((t&192)!==128)return e<<3|1;const r=this.bytes[n+2]&255;return(r&192)!==128?e<<3|1:((e&15)<<12|(t&63)<<6|r&63)<<3|3}else if(e>=240&&e<=244&&n+3<this.end){const t=this.bytes[n+1]&255;if((t&192)!==128)return e<<3|1;const r=this.bytes[n+2]&255;if((r&192)!==128)return e<<3|1;const s=this.bytes[n+3]&255;return(s&192)!==128?e<<3|1:((e&7)<<18|(t&63)<<12|(r&63)<<6|s&63)<<3|4}else return e<<3|1}index(n,e){e+=this.start;const t=this.indexOf(this.bytes,n.prefixUTF8,e);return t<0?t:t-e}context(n){n+=this.start;let e=-1;if(n>this.start&&n<=this.end){let r=n-1;if(e=this.bytes[r--],e>=128){let s=n-4;for(s<this.start&&(s=this.start);r>=s&&(this.bytes[r]&192)===128;)r--;r<this.start&&(r=this.start),e=this.step(r-this.start)>>3}}const t=n<this.end?this.step(n-this.start)>>3:-1;return Ct.emptyOpContext(e,t)}indexOf(n,e,t=0){let r=e.length;if(r===0)return t<=this.end?t:-1;const s=e[0];let a=this.end-r;const o=typeof n.indexOf=="function";let l=t;for(;
1642l<=a;){if(o){if(l=n.indexOf(s,l),l===-1||l>a)return-1}else{for(;l<=a&&n[l]!==s;)l++;if(l>a)return-1}let c=!0;for(let d=1;d<r;d++)if(n[l+d]!==e[d]){c=!1;break}if(c)return l;l++}return-1}prefixLength(n){return n.prefixUTF8.length}},Qie=class extends di{constructor(n,e=0,t=n.length){super(),this.charSequence=n,this.start=e,this.end=t}hasString(n,e){const t=this.charSequence.indexOf(n.str,this.start+e);return t!==-1&&t<=this.end-n.str.length}hasAnyString(n,e){return n.ac16?n.ac16.searchUTF16(this.charSequence,this.start+e,this.end):!1}step(n){if(n+=this.start,n>=this.end)return di.EOF();const e=this.charSequence.charCodeAt(n);if(e<ut.MIN_HIGH_SURROGATE||e>ut.MAX_HIGH_SURROGATE||n+1>=this.end)return e<<3|1;const t=this.charSequence.charCodeAt(n+1);return t>=ut.MIN_LOW_SURROGATE&&t<=ut.MAX_LOW_SURROGATE?(e-ut.MIN_HIGH_SURROGATE)*1024+(t-ut.MIN_LOW_SURROGATE)+ut.MIN_SUPPLEMENTARY_CODE_POINT<<3|2:e<<3|1}index(n,e){e+=this.start;const t=this.charSequence.indexOf(n.prefix,e);return t<0||t>this.end-n.prefix.length?-1:t-e}context(n){n+=this.start;const e=n>this.start&&n<=this.end?this.charSequence.charCodeAt(n-1):-1,t=n<this.end?this.charSequence.charCodeAt(n):-1;return Ct.emptyOpContext(e,t)}prefixLength(n){return n.prefix.length}},Ir=class{static fromUTF8(n,e=0,t=n.length){return new Yie(n,e,t)}static fromUTF16(n,e=0,t=n.length){return new Qie(n,e,t)}},ev=class extends Error{constructor(n){super(n),this.name="RE2JSException"}},wr=class extends ev{constructor(n,e=null){let t=`error parsing regexp: ${n}`;e&&(t+=`: \`${e}\``),super(t),this.name="RE2JSSyntaxException",this.message=t,this.error=n,this.input=e}getDescription(){return this.error}getPattern(){return this.input}},Jie=class extends ev{constructor(n){super(n),this.name="RE2JSCompileException"}},Pi=class extends ev{constructor(n){super(n),this.name="RE2JSGroupException"}},Xie=class extends ev{constructor(n){super(n),this.name="RE2JSFlagsException"}},_b=class extends ev{constructor(n){super(n),this.name="RE2JSInternalException"}},im,y3=(im=class{static quoteReplacement(e,t=!1){return t?e.indexOf("\\")<0&&e.indexOf("$")<0?e:e.split("").map(r=>{const s=r.codePointAt(0);return s===Le.CODES.get("\\")||s===Le.CODES.get("$")?`\\${r}`:r}).join(""):e.indexOf("$")<0?e:e.split("").map(r=>r.codePointAt(0)===Le.CODES.get("$")?"$$":r).join("")}constructor(e,t){if(e===null)throw new Error("pattern is null");this.patternInput=e;const r=this.patternInput.re2();this.patternGroupCount=r.numberOfCapturingGroups(),this.groups=[],this.namedGroups=r.namedGroups,this.numberOfInstructions=r.numberOfInstructions(),t instanceof wm?this.resetMatcherInput(t):Ct.isByteArray(t)?this.resetMatcherInput(Qf.utf8(t)):this.resetMatcherInput(Qf.utf16(t))}pattern(){return this.patternInput}reset(){return this.matcherInputLength=this.matcherInput.length(),this.appendPos=0,this.hasMatch=!1,this.hasGroups=!1,this.anchorFlag=0,this}resetMatcherInput(e){if(e===null)throw new Error("input is null");return e instanceof wm||(Ct.isByteArray(e)?e=Qf.utf8(e):e=Qf.utf16(e)),this.matcherInput=e,this.reset(),this}start(e=0){if(typeof e=="string"){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new Pi(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e]}end(e=0){if(typeof e=="string"){const t=this.namedGroups[e];if(!Number.isFinite(t))throw new Pi(`group '${e}' not found`);e=t}return this.loadGroup(e),this.groups[2*e+1]}programSize(){return this.numberOfInstructions}group(e=0){if(typeof e=="string"){const s=this.namedGroups[e];if(!Number.isFinite(s))throw new Pi(`group '${e}' not found`);e=s}const t=this.start(e),r=this.end(e);return t<0&&r<0?null:this.substring(t,r)}getNamedGroups(){if(!this.hasMatch)throw new Pi("perhaps no match attempted");const e=Object.create(null);for(const t of Object.keys(this.namedGroups))e[t]=this.group(t);return e}groupCount(){return this.patternGroupCount}loadGroup(e){if(e<0||e>this.patternGroupCount)throw new Pi(`Group index out of bounds: ${e}`);if(!this.hasMatch)throw new Pi("perhaps no match attempted");if(e===0||this.hasGroups)return;const t=this.matcherInputLength,r=this.patternInput.re2().matchMachineInput(this.matcherIn
1642put,this.groups[0],t,this.anchorFlag,1+this.patternGroupCount);if(!r[0])throw new Pi("inconsistency in matching group data");this.groups=r[1],this.hasGroups=!0}matches(){return this.genMatch(0,He.ANCHOR_BOTH)}lookingAt(){return this.genMatch(0,He.ANCHOR_START)}find(e=null){if(e!==null){if(e<0||e>this.matcherInputLength)throw new Pi(`start index out of bounds: ${e}`);return this.reset(),this.genMatch(e,0)}if(e=0,this.hasMatch&&(e=this.groups[1],this.groups[0]===this.groups[1])){const t=(this.matcherInput.isUTF16Encoding()?Ir.fromUTF16(this.matcherInput.asCharSequence(),0,this.matcherInputLength):Ir.fromUTF8(this.matcherInput.asBytes(),0,this.matcherInputLength)).step(e);t<0?e++:e+=t&7}return this.genMatch(e,He.UNANCHORED)}genMatch(e,t){const r=this.patternInput.re2().matchMachineInput(this.matcherInput,e,this.matcherInputLength,t,1);return r[0]?(this.groups=r[1],this.hasMatch=!0,this.hasGroups=this.patternGroupCount===0,this.anchorFlag=t,!0):(this.hasMatch=!1,!1)}substring(e,t){return this.matcherInput.isUTF8Encoding()?Ct.utf8ByteArrayToString(this.matcherInput.asBytes().slice(e,t)):this.matcherInput.asCharSequence().substring(e,t).toString()}inputLength(){return this.matcherInputLength}appendReplacement(e,t=!1){let r="";const s=this.start(),a=this.end();return this.appendPos<s&&(r+=this.substring(this.appendPos,s)),this.appendPos=a,r+=t?this.appendReplacementInternalJava(e):this.appendReplacementInternalJs(e),r}appendReplacementInternalJava(e){let t="",r=0;const s=e.length;let a=0;for(;a<s;){const o=e.codePointAt(a);if(o===Le.CODES.get("\\")){if(r<a&&(t+=e.substring(r,a)),a++,a>=s)throw new Pi("character to be escaped is missing");r=a,a++;continue}if(o===Le.CODES.get("$")){if(r<a&&(t+=e.substring(r,a)),a+1>=s)throw new Pi("Illegal group reference: group index is missing");const l=e.codePointAt(a+1);if(Le.CODES.get("0")<=l&&l<=Le.CODES.get("9")){let c=l-Le.CODES.get("0"),d=a+2;for(;d<s;d++){const m=e.codePointAt(d);if(m<Le.CODES.get("0")||m>Le.CODES.get("9")||c*10+m-Le.CODES.get("0")>this.patternGroupCount)break;c=c*10+m-Le.CODES.get("0")}if(c>this.patternGroupCount)throw new Pi(`n > number of groups: ${c}`);const h=this.group(c);h!==null&&(t+=h),a=d,r=a}else if(l===Le.CODES.get("{")){let c=a+2;for(;c<s&&e.codePointAt(c)!==Le.CODES.get("}");)c++;if(c>=s)throw new Pi("named capture group is missing trailing '}'");const d=e.substring(a+2,c),h=this.group(d);h!==null&&(t+=h),a=c+1,r=a}else throw new Pi("Illegal group reference");continue}a++}return r<s&&(t+=e.substring(r,s)),t}appendReplacementInternalJs(e){let t="",r=0;const s=e.length;for(let a=0;a<s-1;a++)if(e.codePointAt(a)===Le.CODES.get("$")){let o=e.codePointAt(a+1);if(Le.CODES.get("$")===o){r<a&&(t+=e.substring(r,a)),t+="$",a++,r=a+1;continue}else if(Le.CODES.get("&")===o){r<a&&(t+=e.substring(r,a));const l=this.group(0);l!==null?t+=l:t+="$&",a++,r=a+1;continue}else if(Le.CODES.get("`")===o){r<a&&(t+=e.substring(r,a)),t+=this.substring(0,this.start(0)),a++,r=a+1;continue}else if(Le.CODES.get("'")===o){r<a&&(t+=e.substring(r,a)),t+=this.substring(this.end(0),this.matcherInputLength),a++,r=a+1;continue}else if(Le.CODES.get("1")<=o&&o<=Le.CODES.get("9")){let l=o-Le.CODES.get("0");for(r<a&&(t+=e.substring(r,a)),a+=2;a<s&&(o=e.codePointAt(a),!(o<Le.CODES.get("0")||o>Le.CODES.get("9")||l*10+o-Le.CODES.get("0")>this.patternGroupCount));a++)l=l*10+o-Le.CODES.get("0");if(l>this.patternGroupCount){t+=`$${l}`,r=a,a--;continue}const c=this.group(l);c!==null&&(t+=c),r=a,a--;continue}else if(o===Le.CODES.get("<")){r<a&&(t+=e.substring(r,a)),a++;let l=a+1;for(;l<e.length&&e.codePointAt(l)!==Le.CODES.get(">")&&e.codePointAt(l)!==Le.CODES.get(" ");)l++;if(l===e.length||e.codePointAt(l)!==Le.CODES.get(">")){t+=e.substring(a-1,l+1),r=l+1,a=l;continue}const c=e.substring(a+1,l);if(Object.prototype.hasOwnProperty.call(this.namedGroups,c)){const d=this.group(c);d!==null&&(t+=d)}else t+=`$<${c}>`;r=l+1,a=l;continue}}return r<s&&(t+=e.substring(r,s)),t}appendTail(){return this.substring(this.appendPos,this.matcherInputLength)}replaceAll(e,t=!1){return this.replace(e,!0,t)}replaceFirst(e,t=!1){return this.replace(e,!1,t)}replace(e,t=!0,r=!1){let s="";this.reset();const a=typeof e=="function",o=Object.keys(this.namedGroups).length>0;let l=null;if(a){if(this.groupCount()>=im.MAX_REPLACER_ARGS)throw new Pi("Too many capture groups to safely invoke replacer function");
1642l=this.matcherInput.isUTF8Encoding()?this.matcherInput.asBytes():this.matcherInput.asCharSequence()}for(;this.find()&&(s+=a?this.appendReplacementFunc(e,o,l):this.appendReplacement(e,r),!!t););return s+=this.appendTail(),s}appendReplacementFunc(e,t,r){let s="";const a=this.start(),o=this.end();this.appendPos<a&&(s+=this.substring(this.appendPos,a)),this.appendPos=o;const l=this.buildReplacerArgs(a,t,r);return s+=String(e(...l)),s}buildReplacerArgs(e,t,r){const s=[this.group(0)],a=this.groupCount();for(let o=1;o<=a;o++){const l=this.start(o);l<0?s.push(void 0):s.push(this.substring(l,this.end(o)))}if(s.push(e),s.push(r),t){const o=this.getNamedGroups();for(const l in o)o[l]===null&&(o[l]=void 0);s.push(o)}return s}},Ye(im,"MAX_REPLACER_ARGS",65535),im),un,Oe=(un=class{static isRuneOp(e){return un.RUNE<=e&&e<=un.RUNE_ANY_NOT_NL}static escapeRunes(e){let t='"';for(let r of e)t+=Ct.escapeRune(r);return t+='"',t}constructor(e){this.op=e,this.out=0,this.arg=0,this.runes=[],this.next=null}matchRune(e){if(this.runes.length===1){const o=this.runes[0];return(this.arg&He.FOLD_CASE)!==0?ut.equalsIgnoreCase(o,e):e===o}const t=this.runes.length;if(t===0)return!1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return!1;if(e<=this.runes[o+1])return!0}return!1}let r=0,s=t>>1;for(;s>1;){const o=s>>1;r+=this.runes[r+o<<1]<=e?o:0,s-=o}r+=this.runes[r<<1]<=e?1:0;const a=r-1;return a>=0&&e<=this.runes[a<<1|1]}matchRunePos(e){if(this.runes.length===1){const o=this.runes[0];return(this.arg&He.FOLD_CASE)!==0?ut.equalsIgnoreCase(o,e)?0:-1:e===o?0:-1}const t=this.runes.length;if(t===0)return-1;if(t===2||t===4||t===6||t===8){for(let o=0;o<t;o+=2){if(e<this.runes[o])return-1;if(e<=this.runes[o+1])return Math.floor(o/2)}return-1}let r=0,s=t>>1;for(;s>1;){const o=s>>1;r+=this.runes[r+o<<1]<=e?o:0,s-=o}r+=this.runes[r<<1]<=e?1:0;const a=r-1;return a>=0&&e<=this.runes[a<<1|1]?a:-1}toString(){switch(this.op){case un.ALT:return`alt -> ${this.out}, ${this.arg}`;case un.ALT_MATCH:return`altmatch -> ${this.out}, ${this.arg}`;case un.CAPTURE:return`cap ${this.arg} -> ${this.out}`;case un.EMPTY_WIDTH:return`empty ${this.arg} -> ${this.out}`;case un.MATCH:return`match${this.arg!==0?` ${this.arg}`:""}`;case un.FAIL:return"fail";case un.NOP:return`nop -> ${this.out}`;case un.LB_WRITE:return`lbwrite ${this.arg} -> ${this.out}`;case un.LB_CHECK:return`lbcheck ${this.arg} -> ${this.out}`;case un.RUNE:return this.runes===null?"rune <null>":["rune ",un.escapeRunes(this.runes),(this.arg&He.FOLD_CASE)!==0?"/i":""," -> ",this.out].join("");case un.RUNE1:return`rune1 ${un.escapeRunes(this.runes)} -> ${this.out}`;case un.RUNE_ANY:return`any -> ${this.out}`;case un.RUNE_ANY_NOT_NL:return`anynotnl -> ${this.out}`;default:throw new Error("unhandled case in Inst.toString")}}},Ye(un,"ALT",1),Ye(un,"ALT_MATCH",2),Ye(un,"CAPTURE",3),Ye(un,"EMPTY_WIDTH",4),Ye(un,"FAIL",5),Ye(un,"MATCH",6),Ye(un,"NOP",7),Ye(un,"RUNE",8),Ye(un,"RUNE1",9),Ye(un,"RUNE_ANY",10),Ye(un,"RUNE_ANY_NOT_NL",11),Ye(un,"LB_WRITE",12),Ye(un,"LB_CHECK",13),un),v3=class{constructor(n){this.sparse=new Int32Array(n),this.densePcs=new Int32Array(n),this.denseCaps=null,this.size=0,this.ncap=0}init(n){this.ncap=n;const e=this.densePcs.length*n;(!this.denseCaps||this.denseCaps.length<e)&&(this.denseCaps=new Int32Array(e))}contains(n){const e=this.sparse[n];return e<this.size&&this.densePcs[e]===n}isEmpty(){return this.size===0}add(n){const e=this.size++;return this.sparse[n]=e,this.densePcs[e]=n,e}clear(){this.size=0}toString(){let n="{";for(let e=0;e<this.size;e++)e!==0&&(n+=", "),n+=this.densePcs[e];return n+="}",n}},Zie=class y_{static fromRE2(e){const t=new y_;return t.prog=e.prog,t.re2=e,t.q0=new v3(t.prog.numInst()),t.q1=new v3(t.prog.numInst()),t.matched=!1,t.matchcap=new Int32Array(t.prog.numCap<2?2:t.prog.numCap),t.ncap=0,t}static fromMachine(e){return y_.fromRE2(e.re2)}constructor(){this.prog=null,this.re2=null,this.q0=null,this.q1=null,this.matched=!1,this.matchcap=null,this.ncap=0,this.lbTable=null}init(e){this.ncap=e,e>this.matchcap.length?this.matchcap=new Int32Array(e).fill(-1):this.matchcap.fill(-1),this.q0.init(e),this.q1.init(e),this.prog.numLb>0&&((!this.lbTable||this.lbTable.length<this.prog.numLb+1)&&(this.lbTable=new Int32Array(this.prog.numLb+1)),this.lbTable.fill(-1))}submatches(){return this.ncap===0?Ct.emptyInts():Ct.toArray(this.matchcap.subarray(0,this.ncap))}match(e,t,r){const s=this.re2.cond;if(s===Ct.EMPTY_ALL||(r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&t!==0)return!1;this.matched=!1,this.matchcap.fill(-1);let a=this.prog.numLb>0?0:t,o=t,l=this.q0,c=this.q1,d=e.step(a),h=d>>3,m=d&7,p=-1,x=0;d!==di.EOF()&&(d=e.step(a+m),p=d>>3,x=d&7);let y;for(a===0?y=Ct.emptyOpContext(-1,h):y=e.context(a);;){if(l.isEmpty()){if((s&Ct.EMPTY_BEGIN_TEXT)!==0&&a!==0||(r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&a!==0||this.matched)break;if(this.prog.numLb===0&&this.re2.prefix.length!==0&&p!==this.re2.prefixRune&&e.canCheckPrefix()){const E=e.index(this.re2,a);if(E<0)break;a+=E,d=e.step(a),h=d>>3,m=d&7,d=e.step(a+m),p=d>>3,x=d&7,y=e.context(a)}}if(a===0&&this.prog.numLb>0)for(let E=0;E<this.prog.lbStarts.length;E++)this.add(l,this.prog.lbStarts[E],a,this.matchcap,0,y);!this.matched&&(a===0||r===He.UNANCHORED)&&a>=o&&(this.ncap>0&&(this.matchcap[0]=a),this.add(l,this.prog.start,a,this.matchcap,0,y));const v=a+m;if(y=e.context(v),this.step(l,c,a,v,h,y,r,a===e.endPos()),m===0||this.ncap===0&&this.matched)break;a+=m,h=p,m=x,h!==-1&&(d=e.step(a+m),p=d>>3,x=d&7);const B=l;l=c,c=B}return c.clear(),this.matched}matchSet(e,t,r){const s=this.re2.cond;if(s===Ct.EMPTY_ALL)return[];if((r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&t!==0)return[];let a=this.prog.numLb>0?0:t,o=t,l=this.q0,c=this.q1,d=e.step(a),h=d>>3,m=d&7,p=-1,x=0;d!==di.EOF()&&(d=e.step(a+m),p=d>>3,x=d&7);let y=a===0?Ct.emptyOpContext(-1,h):e.context(a);const v=new Set;for(;!(l.isEmpty()&&((s&Ct.EMPTY_BEGIN_TEXT)!==0&&a!==0||(r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&a!==0));){if(a===0&&this.prog.numLb>0)for(let N=0;N<this.prog.lbStarts.length;N++)this.add(l,this.prog.lbStarts[N],a,this.matchcap,0,y);(a===0||r===He.UNANCHORED)&&a>=o&&this.add(l,this.prog.start,a,this.matchcap,0,y);const B=a+m;y=e.context(B);for(let N=0;N<l.size;N++){const T=l.densePcs[N],k=this.prog.inst[T],P=N*this.ncap;let R=!1;switch(k.op){case Oe.MATCH:if(r===He.ANCHOR_BOTH&&a!==e.endPos())break;v.add(k.arg);break;case Oe.RUNE:R=k.matchRune(h);break;case Oe.RUNE1:R=h===k.runes[0];break;case Oe.RUNE_ANY:R=!0;break;case Oe.RUNE_ANY_NOT_NL:R=h!==10;break;default:continue}R&&this.add(c,k.out,B,l.denseCaps,P,y)}if(l.clear(),m===0)break;a+=m,h=p,m=x,h!==-1&&(d=e.step(a+m),p=d>>3,x=d&7);const E=l;l=c,c=E}return c.clear(),Array.from(v).sort((B,E)=>B-E)}step(e,t,r,s,a,o,l,c){const d=this.re2.longest;for(let h=0;h<e.size;h++){const m=e.densePcs[h],p=h*this.ncap;if(d&&this.matched&&this.ncap>0&&this.matchcap[0]<e.denseCaps[p])continue;const x=this.prog.inst[m];let y=!1;switch(x.op){case Oe.MATCH:if(l===He.ANCHOR_BOTH&&!c)break;if(this.ncap>
16420&&(!d||!this.matched||this.matchcap[1]<r)){e.denseCaps[p+1]=r;for(let v=0;v<this.ncap;v++)this.matchcap[v]=e.denseCaps[p+v]}d||(e.size=0),this.matched=!0;break;case Oe.RUNE:y=x.matchRune(a);break;case Oe.RUNE1:y=a===x.runes[0];break;case Oe.RUNE_ANY:y=!0;break;case Oe.RUNE_ANY_NOT_NL:y=a!==10;break;default:continue}y&&this.add(t,x.out,s,e.denseCaps,p,o)}e.clear()}add(e,t,r,s,a,o){for(;;){if(t===0||e.contains(t))return;const l=e.add(t),c=this.prog.inst[t];switch(c.op){case Oe.FAIL:return;case Oe.ALT:case Oe.ALT_MATCH:this.add(e,c.out,r,s,a,o),t=c.arg;continue;case Oe.EMPTY_WIDTH:if((c.arg&~o)===0){t=c.out;continue}return;case Oe.NOP:t=c.out;continue;case Oe.CAPTURE:if(c.arg<this.ncap){const d=s[a+c.arg];s[a+c.arg]=r,this.add(e,c.out,r,s,a,o),s[a+c.arg]=d;return}else{t=c.out;continue}case Oe.LB_WRITE:this.lbTable[Math.abs(c.arg)]=r,t=c.out;continue;case Oe.LB_CHECK:if(c.arg>0){if(this.lbTable[c.arg]===r){t=c.out;continue}}else if(this.lbTable[-c.arg]!==r){t=c.out;continue}return;case Oe.MATCH:case Oe.RUNE:case Oe.RUNE1:case Oe.RUNE_ANY:case Oe.RUNE_ANY_NOT_NL:if(this.ncap>0){const d=l*this.ncap;for(let h=0;h<this.ncap;h++)e.denseCaps[d+h]=s[a+h]}return;default:throw new _b("unhandled")}}}};const B3=n=>{let e=-2128831035;for(let t=0;t<n.length;t++)e^=n[t],e=Math.imul(e,16777619);return e},eoe=(n,e)=>{if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0};var toe=class{constructor(n,e,t=[]){this.nfaStates=n,this.isMatch=e,this.matchIDs=t,this.nextLatin1=new Array(ut.MAX_LATIN1+1).fill(null),this.nextLatin1Anchored=new Array(ut.MAX_LATIN1+1).fill(null),this.transKeys=[],this.transVals=[],this.lastSeen=0}},Ad,noe=(Ad=class{constructor(e,t=8388608){this.prog=e,this.stateCache=new Map,this.stateCount=0,this.startState=null,this.stateLimit=Math.max(1,Math.floor(t/Ad.STATE_MEMORY_ESTIMATE)),this.cacheClears=0,this.failed=!1,this.clock=0}computeClosure(e){const t=new Set,r=[...e];let s=!1;const a=[];for(;r.length>0;){const l=r.pop();if(t.has(l))continue;t.add(l);const c=this.prog.getInst(l);switch(c.op){case Oe.MATCH:s=!0,a.includes(c.arg)||a.push(c.arg);break;case Oe.ALT:case Oe.ALT_MATCH:r.push(c.out),r.push(c.arg);break;case Oe.NOP:case Oe.CAPTURE:r.push(c.out);break;case Oe.EMPTY_WIDTH:case Oe.LB_WRITE:case Oe.LB_CHECK:return null}}const o=Int32Array.from(t).sort();return a.sort((l,c)=>l-c),{pcs:o,isMatch:s,matchIDs:a}}getState(e){const t=this.computeClosure(e);if(!t)return null;const r=t.pcs,s=B3(r);let a=this.stateCache.get(s);if(a)for(let l=0;l<a.length;l++){const c=a[l];if(eoe(c.nfaStates,r))return c.lastSeen=++this.clock,c}else a=[],this.stateCache.set(s,a);if(this.failed)return null;if(this.stateCount>=this.stateLimit){if(this.cacheClears++,this.cacheClears>=Ad.MAX_CACHE_CLEARS)return this.failed=!0,this.stateCache.clear(),this.stateCount=0,this.startState=null,null;this.evictCache(),a=this.stateCache.get(s),a||(a=[],this.stateCache.set(s,a))}const o=new toe(r,t.isMatch,t.matchIDs);return o.lastSeen=++this.clock,a.push(o),this.stateCount++,o}evictCache(){const e=[];for(const o of this.stateCache.values())for(let l=0;l<o.length;l++)e.push(o[l]);e.sort((o,l)=>o.lastSeen-l.lastSeen);const t=Math.max(1,Math.floor(this.stateLimit/2)),r=e.length-t,s=e.slice(r),a=new Set(s);this.stateCache.clear(),this.stateCount=0;for(let o=0;o<s.length;o++){const l=s[o];l.nextLatin1.fill(null),l.nextLatin1Anchored.fill(null),l.transKeys.length=0,l.transVals.length=0;const c=B3(l.nfaStates);let d=this.stateCache.get(c);d||(d=[],this.stateCache.set(c,d)),d.push(l),this.stateCount++}this.startState&&!a.has(this.startState)&&(this.startState=null)}step(e,t,r){if(t<=ut.MAX_LATIN1)if(r===He.UNANCHORED){const o=e.nextLatin1[t];if(o!==null)return o}else{const o=e.nextLatin1Anchored[t];if(o!==null)return o}else{const o=t+(r===He.UNANCHORED?0:ut.MAX_RUNE+1),l=e.transKeys,c=l.length;for(let d=0;d<c;d++)if(l[d]===o)return e.transVals[d]}const s=[];for(let o=0;o<e.nfaStates.length;o++){const l=e.nfaStates[o],c=this.prog.getInst(l);Oe.isRuneOp(c.op)&&c.matchRune(t)&&s.push(c.out)}r===He.UNANCHORED&&s.push(this.prog.start);const a=this.getState(s);if(t<=ut.MAX_LATIN1)r===He.UNANCHORED?e.nextLatin1[t]=a:e.nextLatin1Anchored[t]=a;else{const o=t+(r===He.UNANCHORED?0:ut.MAX_RUNE+1);e.transKeys.push(o),e.transVals.push(a)}return a}match(e,t,r){if((r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&t!==0)return!1;if(!this.startState&&(this.startState=this.getState([this.prog.start]),!this.startState))return null;let s=e.endPos(),a=this.startState;if(a.isMatch)if(r===He.ANCHOR_BOTH){if(t===s)return!0}else return!0;let o=t;for(;o<s;){const l=e.step(o),c=l>>3,d=l&7;if(d===0)break;if(a=r===He.UNANCHORED&&c<=ut.MAX_LATIN1&&a.nextLatin1[c]||this.step(a,c,r),a===null)return null;if(a.lastSeen=++this.clock,a.isMatch)if(r===He.ANCHOR_BOTH){if(o+d===s)return!0}else return!0;
1642if(a.nfaStates.length===0&&r!==He.UNANCHORED)return!1;o+=d}return!1}matchSet(e,t,r){if((r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&t!==0)return[];if(!this.startState&&(this.startState=this.getState([this.prog.start]),!this.startState))return null;let s=e.endPos(),a=this.startState;const o=new Set,l=(d,h)=>{d.isMatch&&(r===He.ANCHOR_BOTH?h===s&&d.matchIDs.forEach(m=>o.add(m)):d.matchIDs.forEach(m=>o.add(m)))};l(a,t);let c=t;for(;c<s;){const d=e.step(c),h=d>>3,m=d&7;if(m===0)break;if(a=r===He.UNANCHORED&&h<=ut.MAX_LATIN1&&a.nextLatin1[h]||this.step(a,h,r),a===null)return null;if(a.lastSeen=++this.clock,c+=m,l(a,c),a.nfaStates.length===0&&r!==He.UNANCHORED)break}return Array.from(o).sort((d,h)=>d-h)}},Ye(Ad,"MAX_CACHE_CLEARS",5),Ye(Ad,"STATE_MEMORY_ESTIMATE",838),Ad);const roe=32,soe=500,Ck=256,aoe=256*1024;var ioe=class{constructor(){this.end=0,this.cap=new Int32Array(0),this.matchcap=new Int32Array(0),this.ncap=0,this.jobPc=new Int32Array(Ck),this.jobArg=new Uint8Array(Ck),this.jobPos=new Int32Array(Ck),this.jobLen=0,this.visited=new Uint32Array(0)}reset(n,e,t){this.end=e,this.jobLen=0,this.ncap=t;const r=n.numInst()*(e+1)+roe-1>>>5;this.visited.length<r?this.visited=new Uint32Array(r):this.visited.fill(0,0,r),this.cap.length<t?this.cap=new Int32Array(t).fill(-1):this.cap.fill(-1,0,t),this.matchcap.length<t?this.matchcap=new Int32Array(t).fill(-1):this.matchcap.fill(-1,0,t)}shouldVisit(n,e){const t=n*(this.end+1)+e,r=t>>>5,s=1<<(t&31);return(this.visited[r]&s)!==0?!1:(this.visited[r]|=s,!0)}push(n,e,t,r){if(n.prog.getInst(e).op!==Oe.FAIL&&(r||this.shouldVisit(e,t))){if(this.jobLen>=this.jobPc.length){const s=this.jobPc.length*2,a=new Int32Array(s);a.set(this.jobPc),this.jobPc=a;const o=new Uint8Array(s);o.set(this.jobArg),this.jobArg=o;const l=new Int32Array(s);l.set(this.jobPos),this.jobPos=l}this.jobPc[this.jobLen]=e,this.jobArg[this.jobLen]=r?1:0,this.jobPos[this.jobLen]=t,this.jobLen++}}tryBacktrack(n,e,t,r,s){const a=n.longest;for(this.push(n,t,r,!1);this.jobLen>0;){this.jobLen--;let o=this.jobPc[this.jobLen],l=this.jobArg[this.jobLen]===1,c=this.jobPos[this.jobLen],d=!0;for(;!(!d&&!this.shouldVisit(o,c));){d=!1;const h=n.prog.getInst(o);switch(h.op){case Oe.FAIL:throw new _b("unexpected InstFail");case Oe.ALT:if(l){l=!1,o=h.arg;continue}else{this.push(n,o,c,!0),o=h.out;continue}case Oe.ALT_MATCH:{const m=n.prog.getInst(h.out);if(Oe.isRuneOp(m.op)){this.push(n,h.arg,c,!1),o=h.arg,c=this.end;continue}this.push(n,h.out,this.end,!1),o=h.out;continue}case Oe.RUNE:{const m=e.step(c);if(m===di.EOF()||!h.matchRune(m>>3))break;c+=m&7,o=h.out;continue}case Oe.RUNE1:{const m=e.step(c);if(m===di.EOF()||m>>3!==h.runes[0])break;c+=m&7,o=h.out;continue}case Oe.RUNE_ANY_NOT_NL:{const m=e.step(c);if(m===di.EOF()||m>>3===10)break;c+=m&7,o=h.out;continue}case Oe.RUNE_ANY:{const m=e.step(c);if(m===di.EOF())break;c+=m&7,o=h.out;continue}case Oe.CAPTURE:if(l){this.cap[h.arg]=c;break}else{h.arg<this.ncap&&(this.push(n,o,this.cap[h.arg],!0),this.cap[h.arg]=c),o=h.out;continue}case Oe.EMPTY_WIDTH:{const m=e.context(c);if((h.arg&~m)!==0)break;o=h.out;continue}case Oe.NOP:o=h.out;continue;case Oe.MATCH:{if(s===He.ANCHOR_BOTH&&c!==this.end)break;if(this.ncap===0)return!0;this.ncap>1&&(this.cap[1]=c);const m=this.matchcap[1];if((m===-1||a&&c>0&&c>m)&&this.matchcap.set(this.cap),!a||c===this.end)return!0;break}case Oe.LB_WRITE:case Oe.LB_CHECK:throw new _b("Backtracker cannot evaluate Lookbehind instructions");default:throw new _b("bad inst")}break}}return a&&this.matchcap.length>1&&this.matchcap[1]>=0}};const ZB=[];var ew=class wH{static shouldBacktrack(e){return e.numInst()<=soe}static maxBitStateLen(e){return wH.shouldBacktrack(e)?Math.floor(aoe/e.numInst()):0}static execute(e,t,r,s,a){const o=e.cond;if(o===Ct.EMPTY_ALL||(s===He.ANCHOR_START||s===He.ANCHOR_BOTH)&&r!==0||(o&Ct.EMPTY_BEGIN_TEXT)!==0&&r!==0)return null;const l=ZB.length>0?ZB.pop():new ioe,c=t.endPos();l.reset(e.prog,c,a);let d=!1;if((o&Ct.EMPTY_BEGIN_TEXT)!==0||s===He.ANCHOR_START||s===He.ANCHOR_BOTH)l.ncap>0&&(l.cap[0]=r),l.tryBacktrack(e,t,e.prog.start,r,s)&&(d=!0);else{let m=-1;for(;r<=c&&m!==0;r+=m){if(e.prefix.length>0){const x=t.index(e,r);if(x<0)break;r+=x}if(l.ncap>0&&(l.cap[0]=r),l.tryBacktrack(e,t,e.prog.start,r,s)){d=!0;break}const p=t.step(r);m=p===di.EOF()?0:p&7}}if(!d)return ZB.push(l),null;const h=a===0?[]:Ct.toArray(l.matchcap.subarray(0,a));return ZB.push(l),h}},w3=class{constructor(n){this.sparse=new Uint32Array(n),this.dense=new Uint32Array(n),this.size=0,this.nextIndex=0}empty(){return this.nextIndex>=this.size}next(){return this.dense[this.nextIndex++]}clear(){this.size=0,this.nextIndex=0}contains(n){return n<this.sparse.length&&this.sparse[n]<this.size&&this.dense[this.sparse[n]]===n}insert(n){this.contains(n)||this.insertNew(n)}insertNew(n){n>=this.sparse.length||(this.sparse[n]=this.size,this.dense[this.size]=n,this.size++)}};const ooe=(n,e,t,r)=>{const s=n.length,a=e.length;let o=0,l=0;const c=[],d=[];let h=!0,m=-1;const p=x=>{const y=x?n:e,v=x?o:l,B=x?t:r;return m>0&&y[v]<=c[m]?!1:(c.push(y[v],y[v+1]),x?o+=2:l+=2,m+=2,d.push(B),!0)};for(;o<s||l<a;)if(l>=a?h=p(!0):o>=s||e[l]<n[o]?h=p(!1):h=p(!0),!h)return null;return{merged:c,next:d}};var loe=class{constructor(n){this.start=n.start,this.numCap=n.numCap,this.inst=new Array(n.inst.length);for(let e=0;e<n.inst.length;e++){const t=n.inst[e],r=new Oe(t.op);r.out=t.out,r.arg=t.arg,r.runes=t.runes?t.runes.slice():[],r.next=null,this.inst[e]=r}}};const coe=n=>{const e=new loe(n);for(let t=0;t<e.inst.length;t++){const r=e.inst[t];if(r.op!==Oe.ALT&&r.op!==Oe.ALT_MATCH)continue;let s="out",a="arg",o=e.inst[r[a]];if(o.op!==Oe.ALT&&o.op!==Oe.ALT_MATCH&&(s="arg",a="out",o=e.inst[r[a]],o.op!==Oe.ALT&&o.op!==Oe.ALT_MATCH))continue;const l=e.inst[r[s]];
1642if(l.op===Oe.ALT||l.op===Oe.ALT_MATCH)continue;let c="out",d="arg",h=!1;o.out===t?h=!0:o.arg===t&&(h=!0,c="arg",d="out"),h&&(o[c]=r[s]),r[s]===o[c]&&(r[a]=o[d])}return e},doe=n=>{if(n.inst.length>=1e3)return null;const e=new w3(n.inst.length),t=new w3(n.inst.length),r=new Array(n.inst.length),s=new Array(n.inst.length).fill(!1),a=o=>{let l=!0;const c=n.inst[o];if(t.contains(o))return!0;switch(t.insert(o),c.op){case Oe.ALT:case Oe.ALT_MATCH:{l=a(c.out)&&a(c.arg);let d=s[c.out],h=s[c.arg];if(d&&h)return!1;if(h){const y=c.out;c.out=c.arg,c.arg=y;const v=d;d=h,h=v}d&&(s[o]=!0,c.op=Oe.ALT_MATCH);const m=r[c.out]||[],p=r[c.arg]||[],x=ooe(m,p,c.out,c.arg);if(!x)return!1;r[o]=x.merged,c.next=new Uint32Array(x.next);break}case Oe.CAPTURE:case Oe.EMPTY_WIDTH:case Oe.NOP:l=a(c.out),s[o]=s[c.out],r[o]=r[c.out]?r[c.out].slice():[],c.next=new Uint32Array(Math.floor(r[o].length/2)+1).fill(c.out);break;case Oe.MATCH:case Oe.FAIL:s[o]=c.op===Oe.MATCH;break;case Oe.RUNE:{if(s[o]=!1,c.next&&c.next.length>0)break;if(e.insert(c.out),!c.runes||c.runes.length===0){r[o]=[],c.next=new Uint32Array([c.out]);break}let d=[];if(c.runes.length===1&&(c.arg&He.FOLD_CASE)!==0){const h=c.runes[0];d.push(h,h);for(let m=ut.simpleFold(h);m!==h;m=ut.simpleFold(m))d.push(m,m);d.sort((m,p)=>m-p)}else for(let h=0;h<c.runes.length;h++)d.push(c.runes[h]);r[o]=d,c.next=new Uint32Array(Math.floor(d.length/2)+1).fill(c.out),c.op=Oe.RUNE;break}case Oe.RUNE1:{if(s[o]=!1,c.next&&c.next.length>0)break;e.insert(c.out);let d=[];if((c.arg&He.FOLD_CASE)!==0){const h=c.runes[0];d.push(h,h);for(let m=ut.simpleFold(h);m!==h;m=ut.simpleFold(m))d.push(m,m);d.sort((m,p)=>m-p)}else d.push(c.runes[0],c.runes[0]);r[o]=d,c.next=new Uint32Array(Math.floor(d.length/2)+1).fill(c.out),c.op=Oe.RUNE;break}case Oe.RUNE_ANY:if(s[o]=!1,c.next&&c.next.length>0)break;e.insert(c.out),r[o]=[0,ut.MAX_RUNE],c.next=new Uint32Array([c.out]);break;case Oe.RUNE_ANY_NOT_NL:if(s[o]=!1,c.next&&c.next.length>0)break;e.insert(c.out),r[o]=[0,9,11,ut.MAX_RUNE],c.next=new Uint32Array(Math.floor(r[o].length/2)+1).fill(c.out);break}return l};for(e.clear(),e.insert(n.start);!e.empty();)if(t.clear(),!a(e.next()))return null;for(let o=0;o<n.inst.length;o++)r[o]&&(n.inst[o].runes=r[o]);return n},uoe=(n,e)=>{for(let t=0;t<e.inst.length;t++){const r=e.inst[t];switch(r.op){case Oe.ALT:case Oe.ALT_MATCH:case Oe.RUNE:break;case Oe.CAPTURE:case Oe.EMPTY_WIDTH:case Oe.NOP:case Oe.MATCH:case Oe.FAIL:n.inst[t].next=null;break;case Oe.RUNE1:case Oe.RUNE_ANY:case Oe.RUNE_ANY_NOT_NL:n.inst[t].next=null,n.inst[t].op=r.op,n.inst[t].runes=r.runes?r.runes.slice():[];break}}};var C3=class CH{static compile(e){if(e.start===0||e.numLb>0)return null;const t=e.inst[e.start];if(t.op!==Oe.EMPTY_WIDTH||(t.arg&Ct.EMPTY_BEGIN_TEXT)===0)return null;let r=!1;for(let a=0;a<e.inst.length;a++)if(e.inst[a].op===Oe.ALT||e.inst[a].op===Oe.ALT_MATCH){r=!0;break}for(let a=0;a<e.inst.length;a++){const o=e.inst[a],l=e.inst[o.out].op;switch(o.op){case Oe.ALT:case Oe.ALT_MATCH:if(l===Oe.MATCH||e.inst[o.arg].op===Oe.MATCH)return null;break;case Oe.EMPTY_WIDTH:if(l===Oe.MATCH){if((o.arg&Ct.EMPTY_END_TEXT)===Ct.EMPTY_END_TEXT)continue;return null}break;default:if(l===Oe.MATCH&&r)return null;break}}let s=coe(e);return s=doe(s),s!==null&&uoe(s,e),s}static next(e,t){const r=e.matchRunePos(t);return r>=0?e.next[r]:e.op===Oe.ALT_MATCH?e.out:0}static execute(e,t,r,s,a){const o=e.onepass;if(!o)return null;const l=new Int32Array(a).fill(-1);let c=!1,d=t.step(r),h=d>>3,m=d&7,p=di.EOF(),x=-1,y=0;d!==di.EOF()&&(p=t.step(r+m),p!==di.EOF()&&(x=p>>3,y=p&7));let v=r===0?Ct.emptyOpContext(-1,h):t.context(r),B=o.start,E;for(;;){switch(E=o.inst[B],B=E.out,E.op){case Oe.MATCH:return s===He.ANCHOR_BOTH&&r!==t.endPos()?null:(c=!0,l.length>0&&(l[0]=0,l[1]=r),a===0?[]:Ct.toArray(l));case Oe.RUNE:if(!E.matchRune(h))return null;break;case Oe.RUNE1:if(h!==E.runes[0])return null;break;case Oe.RUNE_ANY:break;case Oe.RUNE_ANY_NOT_NL:if(h===10)return null;break;case Oe.ALT:case Oe.ALT_MATCH:B=CH.next(E,h);continue;case Oe.FAIL:return null;case Oe.NOP:continue;case Oe.EMPTY_WIDTH:if((E.arg&~v)!==0)return null;continue;case Oe.CAPTURE:E.arg<l.length&&(l[E.arg]=r);continue;default:throw new _b("bad inst")}if(m===0)break;v=Ct.emptyOpContext(h,x),r+=m,h=x,m=y,h!==-1&&(p=t.step(r+m),p!==di.EOF()?(x=p>>3,y=p&7):(x=-1,y=0))}return c?a===0?[]:Ct.toArray(l):null}},St,me=(St=class{static isPseudoOp(e){return e>=St.Op.LEFT_PAREN}static emptySubs(){return[]}static quoteIfHyphen(e){return e===Le.CODES.get("-")?"\\":""}static fromRegexp(e){const t=new St(e.op);return t.flags=e.flags,t.subs=e.subs,t.runes=e.runes,t.cap=e.cap,t.min=e.min,t.max=e.max,t.name=e.name,t.namedGroups=e.namedGroups,t.lb=e.lb,t}constructor(e){this.op=e,this.flags=0,this.subs=St.emptySubs(),this.runes=[],this.min=0,this.max=0,this.cap=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}reinit(){this.flags=0,this.subs=St.emptySubs(),this.runes=[],this.cap=0,this.min=0,this.max=0,this.name=null,this.namedGroups=Object.create(null),this.lb=0}toString(){return this.appendTo()}appendTo(){let e="";switch(this.op){case St.Op.NO_MATCH:e+="[^\\x00-\\x{10FFFF}]";break;case St.Op.EMPTY_MATCH:e+="(?:)";break;case St.Op.STAR:case St.Op.PLUS:case St.Op.QUEST:case St.Op.REPEAT:{const t=this.subs[
16420];switch(t.op>St.Op.CAPTURE||t.op===St.Op.LITERAL&&t.runes.length>1?e+=`(?:${t.appendTo()})`:e+=t.appendTo(),this.op){case St.Op.STAR:e+="*";break;case St.Op.PLUS:e+="+";break;case St.Op.QUEST:e+="?";break;case St.Op.REPEAT:e+=`{${this.min}`,this.min!==this.max&&(e+=",",this.max>=0&&(e+=this.max)),e+="}";break}(this.flags&He.NON_GREEDY)!==0&&(e+="?");break}case St.Op.CONCAT:for(let t of this.subs)t.op===St.Op.ALTERNATE?e+=`(?:${t.appendTo()})`:e+=t.appendTo();break;case St.Op.ALTERNATE:{let t="";for(let r of this.subs)e+=t,t="|",e+=r.appendTo();break}case St.Op.LITERAL:(this.flags&He.FOLD_CASE)!==0&&(e+="(?i:");for(let t of this.runes)e+=Ct.escapeRune(t);(this.flags&He.FOLD_CASE)!==0&&(e+=")");break;case St.Op.ANY_CHAR_NOT_NL:e+="(?-s:.)";break;case St.Op.ANY_CHAR:e+="(?s:.)";break;case St.Op.PLB:e+=`(?<=${this.subs[0].appendTo()})`;break;case St.Op.NLB:e+=`(?<!${this.subs[0].appendTo()})`;break;case St.Op.CAPTURE:this.name===null||this.name.length===0?e+="(":e+=`(?P<${this.name}>`,this.subs[0].op!==St.Op.EMPTY_MATCH&&(e+=this.subs[0].appendTo()),e+=")";break;case St.Op.BEGIN_TEXT:e+="\\A";break;case St.Op.END_TEXT:(this.flags&He.WAS_DOLLAR)!==0?e+="(?-m:$)":e+="\\z";break;case St.Op.BEGIN_LINE:e+="^";break;case St.Op.END_LINE:e+="$";break;case St.Op.WORD_BOUNDARY:e+="\\b";break;case St.Op.NO_WORD_BOUNDARY:e+="\\B";break;case St.Op.CHAR_CLASS:if(this.runes.length%2!==0){e+="[invalid char class]";break}if(e+="[",this.runes.length===0)e+="^\\x00-\\x{10FFFF}";else if(this.runes[0]===0&&this.runes[this.runes.length-1]===ut.MAX_RUNE){e+="^";for(let t=1;t<this.runes.length-1;t+=2){const r=this.runes[t]+1,s=this.runes[t+1]-1;e+=St.quoteIfHyphen(r),e+=Ct.escapeRune(r),r!==s&&(e+="-",e+=St.quoteIfHyphen(s),e+=Ct.escapeRune(s))}}else for(let t=0;t<this.runes.length;t+=2){const r=this.runes[t],s=this.runes[t+1];e+=St.quoteIfHyphen(r),e+=Ct.escapeRune(r),r!==s&&(e+="-",e+=St.quoteIfHyphen(s),e+=Ct.escapeRune(s))}e+="]";break;default:e+=this.op;break}return e}maxCap(){let e=0;if(this.op===St.Op.CAPTURE&&(e=this.cap),this.subs!==null)for(let t of this.subs){const r=t.maxCap();e<r&&(e=r)}return e}equals(e){if(!(e!==null&&e instanceof St)||this.op!==e.op)return!1;switch(this.op){case St.Op.END_TEXT:if((this.flags&He.WAS_DOLLAR)!==(e.flags&He.WAS_DOLLAR))return!1;break;case St.Op.LITERAL:case St.Op.CHAR_CLASS:if(this.runes===null&&e.runes===null)break;if(this.runes===null||e.runes===null||this.runes.length!==e.runes.length)return!1;for(let t=0;t<this.runes.length;t++)if(this.runes[t]!==e.runes[t])return!1;break;case St.Op.ALTERNATE:case St.Op.CONCAT:if(this.subs.length!==e.subs.length)return!1;for(let t=0;t<this.subs.length;++t)if(!this.subs[t].equals(e.subs[t]))return!1;break;case St.Op.STAR:case St.Op.PLUS:case St.Op.QUEST:if((this.flags&He.NON_GREEDY)!==(e.flags&He.NON_GREEDY)||!this.subs[0].equals(e.subs[0]))return!1;break;case St.Op.REPEAT:if((this.flags&He.NON_GREEDY)!==(e.flags&He.NON_GREEDY)||this.min!==e.min||this.max!==e.max||!this.subs[0].equals(e.subs[0]))return!1;break;case St.Op.CAPTURE:if(this.cap!==e.cap||(this.name===null?e.name!==null:this.name!==e.name)||!this.subs[0].equals(e.subs[0]))return!1;break;case St.Op.PLB:case St.Op.NLB:if(this.lb!==e.lb||!this.subs[0].equals(e.subs[0]))return!1;break}return!0}},Ye(St,"Op",BH(["NO_MATCH","EMPTY_MATCH","LITERAL","CHAR_CLASS","ANY_CHAR_NOT_NL","ANY_CHAR","BEGIN_LINE","END_LINE","BEGIN_TEXT","END_TEXT","WORD_BOUNDARY","NO_WORD_BOUNDARY","CAPTURE","STAR","PLUS","QUEST","REPEAT","CONCAT","ALTERNATE","PLB","NLB","LEFT_PAREN","VERTICAL_BAR"])),St),E3=class{constructor(n){this.next=[Object.create(null)],this.fail=[0],this.match=[!1];for(const t of n){let r=0;for(let s=0;s<t.length;s++){const a=t[s];a in this.next[r]||(this.next.push(Object.create(null)),this.fail.push(0),this.match.push(!1),this.next[r][a]=this.next.length-1),r=this.next[r][a]}this.match[r]=!0}const e=[];for(const t in this.next[0])if(Object.prototype.hasOwnProperty.call(this.next[0],t)){const r=this.next[0][t];this.fail[r]=0,e.push(r)}for(;e.length>0;){const t=e.shift();for(const r in this.next[t])if(Object.prototype.hasOwnProperty.call(this.next[t],r)){const s=this.next[t][r];let a=this.fail[t];for(;a!==0&&!(r in this.next[a]);)a=this.fail[a];r in this.next[a]?this.fail[s]=this.next[a][r]:this.fail[s]=0,this.match[s]=this.match[s]||this.match[this.fail[s]],e.push(s)}}}searchUTF16(n,e,t){let r=0;for(let s=e;s<t;s++){const a=n.charCodeAt(s);for(;r!==0&&!(a in this.next[r]);)r=this.fail[r];if(a in this.next[r]&&(r=this.next[r][a]),this.match[r])return!0}return!1}searchUTF8(n,e,t){let r=0;for(let s=e;s<t;s++){const a=n[s];for(;r!==0&&!(a in this.next[r]);)r=this.fail[r];if(a in this.next[r]&&(r=this.next[r][a]),this.match[r])return!0}return!1}},Nc,Cn=(Nc=class{constructor(e){this.type=e,this.subs=[],this.str="",this.bytes=null,this.ac16=null,this.ac8=null}eval(e,t){switch(this.type){case Nc.Type.NONE:return!0;case Nc.Type.EXACT:return e.hasString(this,t);case Nc.Type.AND:for(let r=0;r<this.subs.length;r++)if(!this.subs[r].eval(e,t))return!1;return!0;case Nc.Type.OR:if(this.ac16&&this.ac8)return e.hasAnyString(this,t);for(let r=0;r<this.subs.length;r++)if(this.subs[r].eval(e,t))return!0;return!1;default:return!0}}},Ye(Nc,"Type",{NONE:0,EXACT:1,AND:2,OR:3}),Nc),hoe=class xd{static build(e){const t=xd.fromRegexp(e);return xd.simplify(t)}static fromRegexp(e){if(!e)return new Cn(Cn.Type.NONE);switch(e.op){case me.Op.PLB:case me.Op.NLB:case me.Op.NO_MATCH:case me.Op.EMPTY_MATCH:case me.Op.BEGIN_LINE:case me.Op.END_LINE:case me.Op.BEGIN_TEXT:case me.Op.END_TEXT:case me.Op.WORD_BOUNDARY:case me.Op.NO_WORD_BOUNDARY:case me.Op.CHAR_CLASS:case me.Op.ANY_CHAR_NOT_NL:case me.Op.ANY_CHAR:return new Cn(Cn.Type.NONE);
vendor: 7,819 bytes, lines 1642-1647
1642case me.Op.LITERAL:{if(e.runes.length===0||(e.flags&He.FOLD_CASE)!==0)return new Cn(Cn.Type.NONE);const t=new Cn(Cn.Type.EXACT);let r="";for(let s=0;s<e.runes.length;s++)r+=String.fromCodePoint(e.runes[s]);return t.str=r,t.bytes=Ct.stringToUtf8ByteArray(t.str),t}case me.Op.CAPTURE:case me.Op.PLUS:return xd.fromRegexp(e.subs[0]);case me.Op.REPEAT:return e.min>=1?xd.fromRegexp(e.subs[0]):new Cn(Cn.Type.NONE);case me.Op.CONCAT:{const t=new Cn(Cn.Type.AND);for(const r of e.subs)t.subs.push(xd.fromRegexp(r));return t}case me.Op.ALTERNATE:{const t=new Cn(Cn.Type.OR);for(const r of e.subs)t.subs.push(xd.fromRegexp(r));return t}default:return new Cn(Cn.Type.NONE)}}static simplify(e){if(e.type===Cn.Type.EXACT||e.type===Cn.Type.NONE)return e;if(e.type===Cn.Type.AND){const t=[];for(const r of e.subs){const s=xd.simplify(r);if(s.type!==Cn.Type.NONE)if(s.type===Cn.Type.AND)for(let a=0;a<s.subs.length;a++)t.push(s.subs[a]);else t.push(s)}return t.length===0?new Cn(Cn.Type.NONE):t.length===1?t[0]:(e.subs=t,e)}if(e.type===Cn.Type.OR){const t=[];for(const o of e.subs){const l=xd.simplify(o);if(l.type===Cn.Type.NONE)return new Cn(Cn.Type.NONE);if(l.type===Cn.Type.OR)for(let c=0;c<l.subs.length;c++)t.push(l.subs[c]);else t.push(l)}if(t.length===0)return new Cn(Cn.Type.NONE);if(t.length===1)return t[0];const r=new Set,s=[];for(const o of t)o.type===Cn.Type.EXACT?r.has(o.str)||(r.add(o.str),s.push(o)):s.push(o);e.subs=s;let a=!0;for(const o of s)if(o.type!==Cn.Type.EXACT){a=!1;break}return a&&s.length>1&&(e.ac16=new E3(s.map(o=>{const l=[];for(let c=0;c<o.str.length;c++)l.push(o.str.charCodeAt(c));return l})),e.ac8=new E3(s.map(o=>o.bytes))),e}return e}},Ho=class{constructor(n=0,e=0){this.head=n,this.tail=e}},foe=class{constructor(){this.inst=[],this.start=0,this.numCap=2,this.lbStarts=[],this.numLb=0}getInst(n){return this.inst[n]}numInst(){return this.inst.length}addInst(n){this.inst.push(new Oe(n))}skipNop(n){let e=this.inst[n];for(;e.op===Oe.NOP||e.op===Oe.CAPTURE;)e=this.inst[n],n=e.out;return e}prefix(){let n="",e=this.skipNop(this.start);if(!Oe.isRuneOp(e.op)||e.runes.length!==1)return[e.op===Oe.MATCH,n];for(;Oe.isRuneOp(e.op)&&e.runes.length===1&&(e.arg&He.FOLD_CASE)===0;)n+=String.fromCodePoint(e.runes[0]),e=this.skipNop(e.out);return[e.op===Oe.MATCH,n]}startCond(){let n=0,e=this.start;e:for(;;){const t=this.inst[e];switch(t.op){case Oe.EMPTY_WIDTH:n|=t.arg;break;case Oe.FAIL:return-1;case Oe.CAPTURE:case Oe.NOP:break;default:break e}e=t.out}return n}patch(n,e){let t=n.head;for(;t!==0;){const r=this.inst[t>>1];(t&1)===0?(t=r.out,r.out=e):(t=r.arg,r.arg=e)}}append(n,e){if(n.head===0)return e;if(e.head===0)return n;const t=this.inst[n.tail>>1];return(n.tail&1)===0?t.out=e.head:t.arg=e.head,new Ho(n.head,e.tail)}toString(){let n="";for(let e=0;e<this.inst.length;e++){const t=n.length;n+=e,e===this.start&&(n+="*"),n+="        ".substring(n.length-t),n+=this.inst[e],n+=`
1643`}return n}},tw=class{constructor(n=0,e=new Ho,t=!1){this.i=n,this.out=e,this.nullable=t}},moe=class h0{static ANY_RUNE_NOT_NL(){return[0,Le.CODES.get(`
1644`)-1,Le.CODES.get(`
1645`)+1,ut.MAX_RUNE]}static ANY_RUNE(){return[0,ut.MAX_RUNE]}static compileRegexp(e){const t=new h0,r=t.compile(e);return t.prog.patch(r.out,t.newInst(Oe.MATCH).i),t.prog.start=r.i,t.prog}static compileSet(e){const t=new h0;if(e.length===0)return t.prog.start=t.newInst(Oe.FAIL).i,t.prog;let r=[];for(let a=0;a<e.length;a++){const o=t.compile(e[a]),l=t.newInst(Oe.MATCH);t.prog.getInst(l.i).arg=a,t.prog.patch(o.out,l.i),r.push(o.i)}let s=r[0];for(let a=1;a<r.length;a++){const o=t.newInst(Oe.ALT),l=t.prog.getInst(o.i);l.out=s,l.arg=r[a],s=o.i}return t.prog.start=s,t.prog}constructor(){this.prog=new foe,this.newInst(Oe.FAIL)}newInst(e){return this.prog.addInst(e),new tw(this.prog.numInst()-1,new Ho,!0)}nop(){const e=this.newInst(Oe.NOP);return e.out=new Ho(e.i<<1,e.i<<1),e}fail(){return new tw}cap(e){const t=this.newInst(Oe.CAPTURE);return t.out=new Ho(t.i<<1,t.i<<1),this.prog.getInst(t.i).arg=e,this.prog.numCap<e+1&&(this.prog.numCap=e+1),t}cat(e,t){return e.i===0||t.i===0?this.fail():(this.prog.patch(e.out,t.i),new tw(e.i,t.out,e.nullable&&t.nullable))}alt(e,t){if(e.i===0)return t;if(t.i===0)return e;const r=this.newInst(Oe.ALT),s=this.prog.getInst(r.i);return s.out=e.i,s.arg=t.i,r.out=this.prog.append(e.out,t.out),r.nullable=e.nullable||t.nullable,r}loop(e,t){const r=this.newInst(Oe.ALT),s=this.prog.getInst(r.i);return t?(s.arg=e.i,r.out=new Ho(r.i<<1,r.i<<1)):(s.out=e.i,r.out=new Ho(r.i<<1|1,r.i<<1|1)),this.prog.patch(e.out,r.i),r}quest(e,t){const r=this.newInst(Oe.ALT),s=this.prog.getInst(r.i);return t?(s.arg=e.i,r.out=new Ho(r.i<<1,r.i<<1)):(s.out=e.i,r.out=new Ho(r.i<<1|1,r.i<<1|1)),r.out=this.prog.append(r.out,e.out),r}star(e,t){return e.nullable?this.quest(this.plus(e,t),t):this.loop(e,t)}plus(e,t){return new tw(e.i,this.loop(e,t).out,e.nullable)}empty(e){const t=this.newInst(Oe.EMPTY_WIDTH);return this.prog.getInst(t.i).arg=e,t.out=new Ho(t.i<<1,t.i<<1),t}rune(e,t){const r=this.newInst(Oe.RUNE);r.nullable=!1;const s=this.prog.getInst(r.i);return s.runes=e,t&=He.FOLD_CASE,(e.length!==1||ut.simpleFold(e[0])===e[0])&&(t&=-2),s.arg=t,r.out=new Ho(r.i<<1,r.i<<1),(t&He.FOLD_CASE)===0&&e.length===1||e.length===2&&e[0]===e[1]?s.op=Oe.RUNE1:e.length===2&&e[0]===0&&e[1]===ut.MAX_RUNE?s.op=Oe.RUNE_ANY:e.length===4&&e[0]===0&&e[1]===Le.CODES.get(`
1646`)-1&&e[2]===Le.CODES.get(`
1647`)+1&&e[3]===ut.MAX_RUNE&&(s.op=Oe.RUNE_ANY_NOT_NL),r}lookBehind(e,t){const r=this.newInst(Oe.LB_WRITE);this.prog.getInst(r.i).arg=t;const s=this.rune(h0.ANY_RUNE(),0),a=this.star(s,!0),o=this.cat(a,e);this.prog.patch(o.out,r.i);const l=this.newInst(Oe.LB_CHECK);return this.prog.getInst(l.i).arg=t,this.prog.lbStarts.push(o.i),Math.abs(t)>this.prog.numLb&&(this.prog.numLb=Math.abs(t)),l.out=new Ho(l.i<<1,l.i<<1),l}compile(e){switch(e.op){case me.Op.NO_MATCH:return this.fail();case me.Op.EMPTY_MATCH:return this.nop();case me.Op.LITERAL:if(e.runes.length===0)return this.nop();{let t=null;for(let r of e.runes){const s=this.rune([r],e.flags);t=t===null?s:this.cat(t,s)}return t}case me.Op.CHAR_CLASS:return this.rune(e.runes,e.flags);case me.Op.ANY_CHAR_NOT_NL:return this.rune(h0.ANY_RUNE_NOT_NL(),0);case me.Op.ANY_CHAR:return this.rune(h0.ANY_RUNE(),0);case me.Op.BEGIN_LINE:return this.empty(Ct.EMPTY_BEGIN_LINE);case me.Op.END_LINE:return this.empty(Ct.EMPTY_END_LINE);case me.Op.BEGIN_TEXT:return this.empty(Ct.EMPTY_BEGIN_TEXT);case me.Op.END_TEXT:return this.empty(Ct.EMPTY_END_TEXT);case me.Op.WORD_BOUNDARY:return this.empty(Ct.EMPTY_WORD_BOUNDARY);case me.Op.NO_WORD_BOUNDARY:return this.empty(Ct.EMPTY_NO_WORD_BOUNDARY);case me.Op.PLB:case me.Op.NLB:return this.lookBehind(this.compile(e.subs[0]),e.lb);case me.Op.CAPTURE:{const t=this.cap(e.cap<<1),r=this.compile(e.subs[0]),s=this.cap(e.cap<<1|1);return this.cat(this.cat(t,r),s)}case me.Op.STAR:return this.star(this.compile(e.subs[0]),(e.flags&He.NON_GREEDY)!==0);case me.Op.PLUS:return this.plus(this.compile(e.subs[0]),(e.flags&He.NON_GREEDY)!==0);case me.Op.QUEST:return this.quest(this.compile(e.subs[0]),(e.flags&He.NON_GREEDY)!==0);case me.Op.CONCAT:if(e.subs.length===0)return this.nop();{let t=null;for(let r of e.subs){const s=this.compile(r);t=t===null?s:this.cat(t,s)}return t}case me.Op.ALTERNATE:if(e.subs.length===0)return this.nop();{let t=null;for(let r of e.subs){const s=this.compile(r);t=t===null?s:this.alt(t,s)}return t}default:throw new Jie("regexp: unhandled case in compile")}}},poe=class co{static simplify(e){if(e===null)return null;switch(e.op){case me.Op.PLB:case me.Op.NLB:case me.Op.CAPTURE:{const t=co.simplify(e.subs[0]);if(t!==e.subs[0]){const r=me.fromRegexp(e);return r.runes=[],r.subs=[t],r}return e}case me.Op.CONCAT:case me.Op.ALTERNATE:{const t=[];let r=!1;for(let s=0;s<e.subs.length;s++){const a=e.subs[s],o=co.simplify(a);
1647if(o!==a&&(r=!0),e.op===me.Op.CONCAT){if(o.op===me.Op.NO_MATCH)return new me(me.Op.NO_MATCH);if(o.op===me.Op.EMPTY_MATCH){r=!0;continue}if(o.op===me.Op.CONCAT){r=!0;for(let l=0;l<o.subs.length;l++)t.push(o.subs[l]);continue}}else if(e.op===me.Op.ALTERNATE){if(o.op===me.Op.NO_MATCH){r=!0;continue}if(o.op===me.Op.ALTERNATE){r=!0;for(let l=0;l<o.subs.length;l++)t.push(o.subs[l]);continue}}t.push(o)}if(r){if(t.length===0)return new me(e.op===me.Op.CONCAT?me.Op.EMPTY_MATCH:me.Op.NO_MATCH);if(t.length===1)return t[0];const s=me.fromRegexp(e);return s.runes=[],s.subs=t,s}return e}case me.Op.CHAR_CLASS:return e.runes===null?e:e.runes.length===0?new me(me.Op.NO_MATCH):e.runes.length===2&&e.runes[0]===0&&e.runes[1]===ut.MAX_RUNE?new me(me.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===Le.CODES.get(`
1648`)-1&&e.runes[2]===Le.CODES.get(`
1649`)+1&&e.runes[3]===ut.MAX_RUNE?new me(me.Op.ANY_CHAR_NOT_NL):e;case me.Op.STAR:case me.Op.PLUS:case me.Op.QUEST:{const t=co.simplify(e.subs[0]);return co.simplify1(e.op,e.flags,t,e)}case me.Op.REPEAT:{if(e.min===0&&e.max===0)return new me(me.Op.EMPTY_MATCH);const t=co.simplify(e.subs[0]);if(e.max===-1){if(e.min===0)return co.simplify1(me.Op.STAR,e.flags,t,null);if(e.min===1)return co.simplify1(me.Op.PLUS,e.flags,t,null);const s=new me(me.Op.CONCAT),a=[];for(let o=0;o<e.min-1;o++)a.push(t);return a.push(co.simplify1(me.Op.PLUS,e.flags,t,null)),s.subs=a.slice(0),co.simplify(s)}if(e.min===1&&e.max===1)return t;let r=null;if(e.min>0){r=[];for(let s=0;s<e.min;s++)r.push(t)}if(e.max>e.min){let s=co.simplify1(me.Op.QUEST,e.flags,t,null);for(let a=e.min+1;a<e.max;a++){const o=new me(me.Op.CONCAT);o.subs=[t,s],s=co.simplify1(me.Op.QUEST,e.flags,o,null)}if(r===null)return s;r.push(s)}if(r!==null){const s=new me(me.Op.CONCAT);return s.subs=r.slice(0),co.simplify(s)}return new me(me.Op.NO_MATCH)}}return e}static simplify1(e,t,r,s){if(r.op===me.Op.EMPTY_MATCH)return r;if(r.op===me.Op.NO_MATCH)return e===me.Op.PLUS?r:new me(me.Op.EMPTY_MATCH);if(e===r.op&&(t&He.NON_GREEDY)===(r.flags&He.NON_GREEDY))return r;if(s!==null&&s.op===e&&(s.flags&He.NON_GREEDY)===(t&He.NON_GREEDY)&&r===s.subs[0])return s;const a=new me(e);return a.flags=t,a.subs=[r],a}},xn=class{constructor(n,e){this.sign=n,this.cls=e}};const S3=[48,57],T3=[9,10,12,13,32,32],A3=[48,57,65,90,95,95,97,122],k3=new Map([["\\d",new xn(1,S3)],["\\D",new xn(-1,S3)],["\\s",new xn(1,T3)],["\\S",new xn(-1,T3)],["\\w",new xn(1,A3)],["\\W",new xn(-1,A3)]]),N3=[48,57,65,90,97,122],_3=[65,90,97,122],I3=[0,127],D3=[9,9,32,32],j3=[0,31,127,127],R3=[48,57],P3=[33,126],L3=[97,122],O3=[32,126],M3=[33,47,58,64,91,96,123,126],F3=[9,13,32,32],U3=[65,90],V3=[48,57,65,90,95,95,97,122],G3=[48,57,65,70,97,102],$3=new Map([["[:alnum:]",new xn(1,N3)],["[:^alnum:]",new xn(-1,N3)],["[:alpha:]",new xn(1,_3)],["[:^alpha:]",new xn(-1,_3)],["[:ascii:]",new xn(1,I3)],["[:^ascii:]",new xn(-1,I3)],["[:blank:]",new xn(1,D3)],["[:^blank:]",new xn(-1,D3)],["[:cntrl:]",new xn(1,j3)],["[:^cntrl:]",new xn(-1,j3)],["[:digit:]",new xn(1,R3)],["[:^digit:]",new xn(-1,R3)],["[:graph:]",new xn(1,P3)],["[:^graph:]",new xn(-1,P3)],["[:lower:]",new xn(1,L3)],["[:^lower:]",new xn(-1,L3)],["[:print:]",new xn(1,O3)],["[:^print:]",new xn(-1,O3)],["[:punct:]",new xn(1,M3)],["[:^punct:]",new xn(-1,M3)],["[:space:]",new xn(1,F3)],["[:^space:]",new xn(-1,F3)],["[:upper:]",new xn(1,U3)],["[:^upper:]",new xn(-1,U3)],["[:word:]",new xn(1,V3)],["[:^word:]",new xn(-1,V3)],["[:xdigit:]",new xn(1,G3)],["[:^xdigit:]",new xn(-1,G3)]]);var Fu=class Wu{static charClassToString(e,t){let r="[";for(let s=0;s<t;s+=2){s>0&&(r+=" ");const a=e[s],o=e[s+1];a===o?r+=`0x${a.toString(16)}`:r+=`0x${a.toString(16)}-0x${o.toString(16)}`}return r+="]",r}static cmp(e,t,r,s){const a=e[t]-r;return a!==0?a:s-e[t+1]}static qsortIntPair(e,t,r){const s=((t+r)/2|0)&-2,a=e[s],o=e[s+1];let l=t,c=r;for(;l<=c;){for(;l<r&&Wu.cmp(e,l,a,o)<0;)l+=2;for(;c>t&&Wu.cmp(e,c,a,o)>0;)c-=2;if(l<=c){if(l!==c){let d=e[l];e[l]=e[c],e[c]=d,d=e[l+1],e[l+1]=e[c+1],e[c+1]=d}l+=2,c-=2}}t<c&&Wu.qsortIntPair(e,t,c),l<r&&Wu.qsortIntPair(e,l,r)}constructor(e=Ct.emptyInts()){this.r=e,this.len=e.length}toArray(){return this.len===this.r.length?this.r:this.r.slice(0,this.len)}cleanClass(){if(this.len<4)return this;Wu.qsortIntPair(this.r,0,this.len-2);let e=2;for(let t=2;t<this.len;t+=2){const r=this.r[t],s=this.r[t+1];if(r<=this.r[e-1]+1){s>this.r[e-1]&&(this.r[e-1]=s);continue}this.r[e]=r,this.r[e+1]=s,e+=2}return this.len=e,this}appendLiteral(e,t){return(t&He.FOLD_CASE)!==0?this.appendFoldedRange(e,e):this.appendRange(e,e)}appendRange(e,t){if(this.len>0){for(let r=2;r<=4;r+=2)if(this.len>=r){const s=this.r[this.len-r],a=this.r[this.len-r+1];if(e<=a+1&&s<=t+1)return e<s&&(this.r[this.len-r]=e),t>a&&(this.r[this.len-r+1]=t),this}}return this.r[this.len++]=e,this.r[this.len++]=t,this}appendFoldedRange(e,t){if(e<=ut.MIN_FOLD&&t>=ut.MAX_FOLD)return this.appendRange(e,t);if(t<ut.MIN_FOLD||e>ut.MAX_FOLD)return this.appendRange(e,t);e<ut.MIN_FOLD&&(this.appendRange(e,ut.MIN_FOLD-1),e=ut.MIN_FOLD),t>ut.MAX_FOLD&&(this.appendRange(ut.MAX_FOLD+1,t),t=ut.MAX_FOLD);for(let r=e;r<=t;r++){this.appendRange(r,r);for(let s=ut.simpleFold(r);s!==r;s=ut.simpleFold(s))this.appendRange(s,s)}return this}appendClass(e){for(let t=0;t<e.length;t+=2)this.appendRange(e[t],e[t+1]);return this}appendFoldedClass(e){for(let t=0;t<e.length;t+=2)this.appendFoldedRange(e[t],e[t+1]);return this}appendNegatedClass(e){let t=0;for(let r=0;r<e.length;r+=2){const s=e[r],a=e[r+1];t<=s-1&&this.appendRange(t,s-1),t=a+1}return t<=ut.MAX_RUNE&&this.appendRange(t,ut.MAX_RUNE),this}appendTable(e){for(let t=0;t<e.length;++t){const r=e.getLo(t),s=e.getHi(t),a=e.getStride(t);if(a===1){this.appendRange(r,s);continue}for(let o=r;o<=s;o+=a)this.appendRange(o,o)}return this}appendNegatedTable(e){let t=0;for(let r=0;r<e.length;++r){const s=e.getLo(r),a=e.getHi(r),o=e.getStride(r);if(o===1){t<=s-1&&this.appendRange(t,s-1),t=a+1;continue}for(let l=s;l<=a;l+=o)t<=l-1&&this.appendRange(t,l-1),t=l+1}return t<=ut.MAX_RUNE&&this.appendRange(t,ut.MAX_RUNE),this}appendTableWithSign(e,t){return t<0?this.appendNegatedTable(e):this.appendTable(e)}negateClass(){let e=0,t=0;for(let r=0;r<this.len;r+=2){const s=this.r[r],a=this.r[r+1];e<=s-1&&(this.r[t]=e,this.r[t+1]=s-1,t+=2),e=a+1}return this.len=t,e<=ut.MAX_RUNE&&(this.r[this.len++]=e,this.r[this.len++]=ut.MAX_RUNE),this}appendClassWithSign(e,t){return t<0?this.appendNegatedClass(e):this.appendClass(e)}appendGroup(e,t){let r=e.cls;return t&&(r=new Wu().appendFoldedClass(r).cleanClass().toArray()),this.appendClassWithSign(r,e.sign)}toString(){return Wu.charClassToString(this.r,this.len)}},goe=class{constructor(n){this.str=n,this.position=0}pos(){return this.position}rewindTo(n){this.position=n}more(){return this.position<this.str.length}peek(){return this.str.codePointAt(this.position)}skip(n){this.position+=n}skipString(n){this.position+=n.length}pop(){const n=this.str.codePointAt(this.position);return this.position+=Ct.charCount(n),n}lookingAt(n){return this.str.startsWith(n,this.position)}rest(){return this.str.substring(this.position)}from(n){return this.str.substring(n,this.position)}toString(){return this.rest()}},Xe,xoe=(Xe=class{static unicodeTable(e){return e==="Any"?{tab:Xe.ANY_TABLE,fold:Xe.ANY_TABLE,sign:1}
1649:e==="Ascii"?{tab:Xe.ASCII_TABLE,fold:Xe.ASCII_FOLD_TABLE,sign:1}:e==="Assigned"?{tab:Mi.CATEGORIES.get("Cn"),fold:Mi.CATEGORIES.get("Cn"),sign:-1}:e==="Lc"?{tab:Mi.CATEGORIES.get("LC"),fold:Mi.FOLD_CATEGORIES.get("LC"),sign:1}:Mi.CATEGORIES.has(e)?{tab:Mi.CATEGORIES.get(e),fold:Mi.FOLD_CATEGORIES.get(e),sign:1}:Mi.SCRIPTS.has(e)?{tab:Mi.SCRIPTS.get(e),fold:Mi.FOLD_SCRIPT.get(e),sign:1}:null}static minFoldRune(e){if(e<ut.MIN_FOLD||e>ut.MAX_FOLD)return e;let t=e;const r=e;for(e=ut.simpleFold(e);e!==r;e=ut.simpleFold(e))t>e&&(t=e);return t}static leadingRegexp(e){if(e.op===me.Op.EMPTY_MATCH)return null;if(e.op===me.Op.CONCAT&&e.subs.length>0){const t=e.subs[0];return t.op===me.Op.EMPTY_MATCH?null:t}return e}static literalRegexp(e,t){const r=new me(me.Op.LITERAL);return r.flags=t,r.runes=Ct.stringToRunes(e),r}static parse(e,t){return new Xe(e,t).parseInternal()}static parseRepeat(e){const t=e.pos();if(!e.more()||!e.lookingAt("{"))return-1;e.skip(1);const r=Xe.parseInt(e);if(r===-1||!e.more())return-1;let s;if(!e.lookingAt(","))s=r;else{if(e.skip(1),!e.more())return-1;if(e.lookingAt("}"))s=-1;else if((s=Xe.parseInt(e))===-1)return-1}if(!e.more()||!e.lookingAt("}"))return-1;if(e.skip(1),r<0||r>1e3||s===-2||s>1e3||s>=0&&r>s)throw new wr(Xe.ERR_INVALID_REPEAT_SIZE,e.from(t));return r<<16|s&ut.MAX_BMP}static isValidCaptureName(e){if(e.length===0)return!1;for(let t=0;t<e.length;t++){const r=e.codePointAt(t);if(r!==Le.CODES.get("_")&&!Ct.isalnum(r))return!1}return!0}static parseInt(e){const t=e.pos();for(;e.more()&&e.peek()>=Le.CODES.get("0")&&e.peek()<=Le.CODES.get("9");)e.skip(1);const r=e.from(t);return r.length===0||r.length>1&&r.codePointAt(0)===Le.CODES.get("0")?-1:r.length>8?-2:parseInt(r,10)}static isCharClass(e){return e.op===me.Op.LITERAL&&e.runes.length===1||e.op===me.Op.CHAR_CLASS||e.op===me.Op.ANY_CHAR_NOT_NL||e.op===me.Op.ANY_CHAR}static matchRune(e,t){switch(e.op){case me.Op.LITERAL:return e.runes.length===1&&e.runes[0]===t;case me.Op.CHAR_CLASS:for(let r=0;r<e.runes.length;r+=2)if(e.runes[r]<=t&&t<=e.runes[r+1])return!0;return!1;case me.Op.ANY_CHAR_NOT_NL:return t!==Le.CODES.get(`
1650`);case me.Op.ANY_CHAR:return!0}return!1}static mergeCharClass(e,t){switch(e.op){case me.Op.ANY_CHAR:break;case me.Op.ANY_CHAR_NOT_NL:Xe.matchRune(t,Le.CODES.get(`
1651`))&&(e.op=me.Op.ANY_CHAR);break;case me.Op.CHAR_CLASS:t.op===me.Op.LITERAL?e.runes=new Fu(e.runes).appendLiteral(t.runes[0],t.flags).toArray():e.runes=new Fu(e.runes).appendClass(t.runes).toArray();break;case me.Op.LITERAL:if(t.runes[0]===e.runes[0]&&t.flags===e.flags)break;e.op=me.Op.CHAR_CLASS,e.runes=new Fu().appendLiteral(e.runes[0],e.flags).appendLiteral(t.runes[0],t.flags).toArray();break}}static parseEscape(e){const t=e.pos();if(e.skip(1),!e.more())throw new wr(Xe.ERR_TRAILING_BACKSLASH);let r=e.pop();e:switch(r){case Le.CODES.get("1"):case Le.CODES.get("2"):case Le.CODES.get("3"):case Le.CODES.get("4"):case Le.CODES.get("5"):case Le.CODES.get("6"):case Le.CODES.get("7"):if(!e.more(
1651)||e.peek()<Le.CODES.get("0")||e.peek()>Le.CODES.get("7"))break;case Le.CODES.get("0"):{let s=r-Le.CODES.get("0");for(let a=1;a<3&&!(!e.more()||e.peek()<Le.CODES.get("0")||e.peek()>Le.CODES.get("7"));a++)s=s*8+e.peek()-Le.CODES.get("0"),e.skip(1);return s}case Le.CODES.get("x"):{if(!e.more())break;if(r=e.pop(),r===Le.CODES.get("{")){let o=0,l=0;for(;;){if(!e.more())break e;if(r=e.pop(),r===Le.CODES.get("}"))break;const c=Ct.unhex(r);if(c<0||(l=l*16+c,l>ut.MAX_RUNE))break e;o++}if(o===0)break e;return l}const s=Ct.unhex(r);if(!e.more())break;r=e.pop();const a=Ct.unhex(r);if(s<0||a<0)break;return s*16+a}case Le.CODES.get("a"):return Le.CODES.get("\x07");case Le.CODES.get("f"):return Le.CODES.get("\f");case Le.CODES.get("n"):return Le.CODES.get(`
1652`);case Le.CODES.get("r"):return Le.CODES.get("\r");case Le.CODES.get("t"):return Le.CODES.get("	");case Le.CODES.get("v"):return Le.CODES.get("\v");default:if(r<=ut.MAX_ASCII&&!Ct.isalnum(r))return r;break}throw new wr(Xe.ERR_INVALID_ESCAPE,e.from(t))}static parseClassChar(e,t){if(!e.more())throw new wr(Xe.ERR_MISSING_BRACKET,e.from(t));return e.lookingAt("\\")?Xe.parseEscape(e):e.pop()}static concatRunes(e,t){for(let r=0;r<t.length;r++)e.push(t[r]);return e}static hasCapture(e){if(e===null)return!1;if(e.op===me.Op.CAPTURE)return!0;if(e.subs){for(let t of e.subs)if(Xe.hasCapture(t))return!0}return!1}constructor(e,t=0){this.wholeRegexp=e,this.flags=t,this.numCap=0,this.namedGroups=Object.create(null),this.stack=[],this.free=null,this.numRegexp=0,this.numRunes=0,this.repeats=0,this.height=null,this.size=null,this.nlb=0}newRegexp(e){let t=this.free;return t!==null&&t.subs!==null&&t.subs.length>0?(this.free=t.subs[0],t.reinit(),t.op=e):(t=new me(e),this.numRegexp+=1),t}reuse(e){this.height!==null&&this.height.has(e)&&this.height.delete(e),e.subs!==null&&e.subs.length>0&&(e.subs[0]=this.free),this.free=e}checkLimits(e){if(this.numRunes>Xe.MAX_RUNES)throw new wr(Xe.ERR_LARGE);this.checkSize(e),this.checkHeight(e)}checkSize(e){if(this.size===null){if(this.repeats===0&&(this.repeats=1),e.op===me.Op.REPEAT){let t=e.max;t===-1&&(t=e.min),t<=0&&(t=1),t>Math.floor(Xe.MAX_SIZE/this.repeats)?this.repeats=Xe.MAX_SIZE:this.repeats*=t}if(this.numRegexp<Math.floor(Xe.MAX_SIZE/this.repeats))return;this.size=new Map;for(let t of this.stack)this.checkSize(t)}if(this.calcSize(e,!0)>Xe.MAX_SIZE)throw new wr(Xe.ERR_LARGE)}calcSize(e,t=!1){if(!t&&this.size!==null&&this.size.has(e))return this.size.get(e);let r=0;switch(e.op){case me.Op.LITERAL:r=e.runes.length;break;case me.Op.PLB:case me.Op.NLB:case me.Op.CAPTURE:case me.Op.STAR:r=2+this.calcSize(e.subs[0]);break;case me.Op.PLUS:case me.Op.QUEST:r=1+this.calcSize(e.subs[0]);break;case me.Op.CONCAT:for(let s of e.subs)r=r+this.calcSize(s);break;case me.Op.ALTERNATE:for(let s of e.subs)r=r+this.calcSize(s);e.subs.length>1&&(r=r+e.subs.length-1);break;case me.Op.REPEAT:{let s=this.calcSize(e.subs[0]);if(e.max===-1){e.min===0?r=2+s:r=1+e.min*s;break}r=e.max*s+(e.max-e.min);break}}return r=Math.max(1,r),this.size===null&&(this.size=new Map),this.size.set(e,r),r}checkHeight(e){if(!(this.numRegexp<Xe.MAX_HEIGHT)){if(this.height===null){this.height=new Map;for(let t of this.stack)this.checkHeight(t)}if(this.calcHeight(e,!0)>Xe.MAX_HEIGHT)throw new wr(Xe.ERR_NESTING_DEPTH)}}calcHeight(e,t=!1){if(!t&&this.height!==null&&this.height.has(e))return this.height.get(e);let r=1;for(let s of e.subs){const a=this.calcHeight(s);r<1+a&&(r=1+a)}return this.height===null&&(this.height=new Map),this.height.set(e,r),r}pop(){return this.stack.pop()}popToPseudo(){const e=this.stack.length;let t=e;for(;t>0&&!me.isPseudoOp(this.stack[t-1].op);)t--;const r=this.stack.slice(t,e);return this.stack=this.stack.slice(0,t),r}push(e){if(this.numRunes+=e.runes.length,e.op===me.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]===e.runes[1]){if(this.maybeConcat(e.runes[0],this.flags&-2))return null;e.op=me.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags&-2}else if(e.op===me.Op.CHAR_CLASS&&e.runes.length===4&&e.runes[0]===e.runes[1]&&e.runes[2]===e.runes[3]&&ut.simpleFold(e.runes[0])===e.runes[2]&&ut.simpleFold(e.runes[2])===e.runes[0]||e.op===me.Op.CHAR_CLASS&&e.runes.length===2&&e.runes[0]+1===e.runes[1]&&ut.simpleFold(e.runes[0])===e.runes[1]&&ut.simpleFold(e.runes[1])===e.runes[0]){if
1652(this.maybeConcat(e.runes[0],this.flags|He.FOLD_CASE))return null;e.op=me.Op.LITERAL,e.runes=[e.runes[0]],e.flags=this.flags|He.FOLD_CASE}else this.maybeConcat(-1,0);return this.stack.push(e),this.checkLimits(e),e}maybeConcat(e,t){const r=this.stack.length;if(r<2)return!1;const s=this.stack[r-1],a=this.stack[r-2];return s.op!==me.Op.LITERAL||a.op!==me.Op.LITERAL||(s.flags&He.FOLD_CASE)!==(a.flags&He.FOLD_CASE)?!1:(a.runes=Xe.concatRunes(a.runes,s.runes),e>=0?(s.runes=[e],s.flags=t,!0):(this.pop(),this.reuse(s),!1))}newLiteral(e,t){const r=this.newRegexp(me.Op.LITERAL);return r.flags=t,(t&He.FOLD_CASE)!==0&&(e=Xe.minFoldRune(e)),r.runes=[e],r}literal(e){this.push(this.newLiteral(e,this.flags))}op(e){const t=this.newRegexp(e);return t.flags=this.flags,this.push(t)}repeat(e,t,r,s,a,o){let l=this.flags;if((l&He.PERL_X)!==0&&(a.more()&&a.lookingAt("?")&&(a.skip(1),l^=He.NON_GREEDY),o!==-1))throw new wr(Xe.ERR_INVALID_REPEAT_OP,a.from(o));const c=this.stack.length;if(c===0)throw new wr(Xe.ERR_MISSING_REPEAT_ARGUMENT,a.from(s));const d=this.stack[c-1];if(me.isPseudoOp(d.op))throw new wr(Xe.ERR_MISSING_REPEAT_ARGUMENT,a.from(s));const h=this.newRegexp(e);if(h.min=t,h.max=r,h.flags=l,h.subs=[d],this.stack[c-1]=h,this.checkLimits(h),e===me.Op.REPEAT&&(t>=2||r>=2)&&!this.repeatIsValid(h,1e3))throw new wr(Xe.ERR_INVALID_REPEAT_SIZE,a.from(s))}repeatIsValid(e,t){if(e.op===me.Op.REPEAT){let r=e.max;if(r===0)return!0;if(r<0&&(r=e.min),r>t)return!1;r>0&&(t=Math.trunc(t/r))}for(let r of e.subs)if(!this.repeatIsValid(r,t))return!1;return!0}concat(){this.maybeConcat(-1,0);const e=this.popToPseudo();return e.length===0?this.push(this.newRegexp(me.Op.EMPTY_MATCH)):this.push(this.collapse(e,me.Op.CONCAT))}alternate(){const e=this.popToPseudo();return e.length>0&&this.cleanAlt(e[e.length-1]),e.length===0?this.push(this.newRegexp(me.Op.NO_MATCH)):this.push(this.collapse(e,me.Op.ALTERNATE))}cleanAlt(e){e.op===me.Op.CHAR_CLASS&&(e.runes=new Fu(e.runes).cleanClass().toArray(),e.runes.length===2&&e.runes[0]===0&&e.runes[1]===ut.MAX_RUNE?(e.runes=[],e.op=me.Op.ANY_CHAR):e.runes.length===4&&e.runes[0]===0&&e.runes[1]===Le.CODES.get(`
1653`)-1&&e.runes[2]===Le.CODES.get(`
1654`)+1&&e.runes[3]===ut.MAX_RUNE&&(e.runes=[],e.op=me.Op.ANY_CHAR_NOT_NL))}collapse(e,t){if(e.length===1)return e[0];let r=0;for(let l of e)r+=l.op===t?l.subs.length:1;let s=new Array(r).fill(null),a=0;for(let l of e)if(l.op===t){for(let c=0;c<l.subs.length;c++)s[a++]=l.subs[c];this.reuse(l)}else s[a++]=l;let o=this.newRegexp(t);if(o.subs=s,t===me.Op.ALTERNATE&&(o.subs=this.factor(o.subs),o.subs.length===1)){const l=o;o=o.subs[0],this.reuse(l)}return o}factor(e){if(e.length<2)return e;let t=0,r=e.length,s=0,a=null,o=0,l=0,c=0;for(let h=0;h<=r;h++){let m=null,p=0,x=0;if(h<r){let y=e[t+h];if(y.op===me.Op.CONCAT&&y.subs.length>0&&(y=y.subs[0]),y.op===me.Op.LITERAL&&(m=y.runes,p=y.runes.length,x=y.flags&He.FOL
vendor: 5,226 bytes, line 1654
1654D_CASE),x===l){let v=0;for(;v<o&&v<p&&a[v]===m[v];)v++;if(v>0){o=v;continue}}}if(h!==c)if(h===c+1)e[s++]=e[t+c];else{const y=this.newRegexp(me.Op.LITERAL);y.flags=l,y.runes=a.slice(0,o);for(let E=c;E<h;E++)e[t+E]=this.removeLeadingString(e[t+E],o),this.checkLimits(e[t+E]);const v=this.collapse(e.slice(t+c,t+h),me.Op.ALTERNATE),B=this.newRegexp(me.Op.CONCAT);B.subs=[y,v],e[s++]=B}c=h,a=m,o=p,l=x}r=s,t=0,c=0,s=0;let d=null;for(let h=0;h<=r;h++){let m=null;if(!(h<r&&(m=Xe.leadingRegexp(e[t+h]),d!==null&&d.equals(m)&&(Xe.isCharClass(d)||d.op===me.Op.REPEAT&&d.min===d.max&&Xe.isCharClass(d.subs[0]))))){if(h!==c)if(h===c+1)e[s++]=e[t+c];else{const p=d;for(let v=c;v<h;v++){const B=v!==c;e[t+v]=this.removeLeadingRegexp(e[t+v],B),this.checkLimits(e[t+v])}const x=this.collapse(e.slice(t+c,t+h),me.Op.ALTERNATE),y=this.newRegexp(me.Op.CONCAT);y.subs=[p,x],e[s++]=y}c=h,d=m}}r=s,t=0,c=0,s=0;for(let h=0;h<=r;h++)if(!(h<r&&Xe.isCharClass(e[t+h]))){if(h!==c)if(h===c+1)e[s++]=e[t+c];else{let m=c;for(let x=c+1;x<h;x++){const y=e[t+m],v=e[t+x];(y.op<v.op||y.op===v.op&&(y.runes!==null?y.runes.length:0)<(v.runes!==null?v.runes.length:0))&&(m=x)}const p=e[t+c];e[t+c]=e[t+m],e[t+m]=p;for(let x=c+1;x<h;x++)Xe.mergeCharClass(e[t+c],e[t+x]),this.reuse(e[t+x]);this.cleanAlt(e[t+c]),e[s++]=e[t+c]}h<r&&(e[s++]=e[t+h]),c=h+1}r=s,t=0,c=0,s=0;for(let h=0;h<r;++h)h+1<r&&e[t+h].op===me.Op.EMPTY_MATCH&&e[t+h+1].op===me.Op.EMPTY_MATCH||(e[s++]=e[t+h]);return r=s,t=0,e.slice(t,r)}removeLeadingString(e,t){if(e.op===me.Op.CONCAT&&e.subs.length>0){const r=this.removeLeadingString(e.subs[0],t);if(e.subs[0]=r,r.op===me.Op.EMPTY_MATCH)switch(this.reuse(r),e.subs.length){case 0:case 1:e.op=me.Op.EMPTY_MATCH,e.subs=me.emptySubs();break;case 2:{const s=e;e=e.subs[1],this.reuse(s);break}default:e.subs=e.subs.slice(1,e.subs.length);break}return e}return e.op===me.Op.LITERAL&&(e.runes=e.runes.slice(t,e.runes.length),e.runes.length===0&&(e.op=me.Op.EMPTY_MATCH)),e}removeLeadingRegexp(e,t){if(e.op===me.Op.CONCAT&&e.subs.length>0){switch(t&&this.reuse(e.subs[0]),e.subs=e.subs.slice(1,e.subs.length),e.subs.length){case 0:e.op=me.Op.EMPTY_MATCH,e.subs=me.emptySubs();break;case 1:{const r=e;e=e.subs[0],this.reuse(r);break}}return e}return t&&this.reuse(e),this.newRegexp(me.Op.EMPTY_MATCH)}parseInternal(){if((this.flags&He.LITERAL)!==0)return Xe.literalRegexp(this.wholeRegexp,this.flags);let e=-1,t=-1,r=-1;const s=new goe(this.wholeRegexp);for(;s.more();){let a=-1;e:switch(s.peek()){case Le.CODES.get("("):if((this.flags&He.LOOKBEHIND)!==0){if(s.lookingAt("(?<=")){this.parsePosLookBehind(),s.skip(4);break}if(s.lookingAt("(?<!")){this.parseNegLookBehind(),s.skip(4);break}}if((this.flags&He.PERL_X)!==0&&s.lookingAt("(?")){this.parsePerlFlags(s);break}this.op(me.Op.LEFT_PAREN).cap=++this.numCap,s.skip(1);break;case Le.CODES.get("|"):this.parseVerticalBar(),s.skip(1);break;case Le.CODES.get(")"):this.parseRightParen(),s.skip(1);break;case Le.CODES.get("^"):(this.flags&He.ONE_LINE)!==0?this.op(me.Op.BEGIN_TEXT):this.op(me.Op.BEGIN_LINE),s.skip(1);break;case Le.CODES.get("$"):(this.flags&He.ONE_LINE)!==0?this.op(me.Op.END_TEXT).flags|=He.WAS_DOLLAR:this.op(me.Op.END_LINE),s.skip(1);break;case Le.CODES.get("."):(this.flags&He.DOT_NL)!==0?this.op(me.Op.ANY_CHAR):this.op(me.Op.ANY_CHAR_NOT_NL),s.skip(1);break;case Le.CODES.get("["):this.parseClass(s);break;case Le.CODES.get("*"):case Le.CODES.get("+"):case Le.CODES.get("?"):{a=s.pos();let o=null;switch(s.pop()){case Le.CODES.get("*"):o=me.Op.STAR;break;case Le.CODES.get("+"):o=me.Op.PLUS;break;case Le.CODES.get("?"):o=me.Op.QUEST;break}this.repeat(o,t,r,a,s,e);break}case Le.CODES.get("{"):{a=s.pos();const o=Xe.parseRepeat(s);if(o<0){s.rewindTo(a),this.literal(s.pop());break}t=o>>16,r=(o&ut.MAX_BMP)<<16>>16,this.repeat(me.Op.REPEAT,t,r,a,s,e);break}case Le.CODES.get("\\"):{const o=s.pos();if(s.skip(1),(this.flags&He.PERL_X)!==0&&s.more())switch(s.pop()){case Le.CODES.get("A"):this.op(me.Op.BEGIN_TEXT);break e;case Le.CODES.get("b"):this.op(me.Op.WORD_BOUNDARY);break e;case Le.CODES.get("B"):this.op(me.Op.NO_WORD_BOUNDARY);break e;case Le.CODES.get("C"):throw new wr(Xe.ERR_INVALID_ESCAPE,"\\C");case Le.CODES.get("Q"):{let d=s.rest();const h=d.indexOf("\\E");h>=0?(d=d.substring(0,h),s.skipString(d),s.skipString("\\E")):s.skipString(d);let m=0;for(;m<d.length;){const p=d.codePointAt(m);this.literal(p),m+=Ct.charCount(p)}break e}case Le.CODES.get("z"):this.op(me.Op.END_TEXT);break e;default:s.rewindTo(o);break}else s.rewindTo(o);const l=this.newRegexp(me.Op.CHAR_CLASS);if(l.flags=this.flags,s.lookingAt("\\p")||s.lookingAt("\\P")){const d=new Fu;if(this.parseUnicodeClass(s,d)){l.runes=d.toArray(),this.push(l);break e}}const c=new Fu;if(this.parsePerlClassEscape(s,c)){l.runes=c.toArray(),this.push(l);break e}s.rewindTo(o),this.reuse(l),this.literal(Xe.parseEscape(s));break}default:this.literal(s.pop());break}e=a}if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length!==1)throw new wr(Xe.ERR_MISSING_PAREN,this.wholeRegexp);return this.stack[0].namedGroups=this.namedGroups,this.stack[0]}parsePerlFlags(e){const t=e.pos(),r=e.rest();if(r.startsWith("(?P<")||r.startsWith("(?<")){const l=r.charAt(2)==="P"?4:3,c=r.indexOf(">");
1654if(c<0)throw new wr(Xe.ERR_INVALID_NAMED_CAPTURE,r);const d=r.substring(l,c);if(e.skipString(d),e.skip(l+1),!Xe.isValidCaptureName(d))throw new wr(Xe.ERR_INVALID_NAMED_CAPTURE,r.substring(0,c+1));const h=this.op(me.Op.LEFT_PAREN);if(h.cap=++this.numCap,this.namedGroups[d])throw new wr(Xe.ERR_DUPLICATE_NAMED_CAPTURE,d);this.namedGroups[d]=this.numCap,h.name=d;return}e.skip(2);let s=this.flags,a=1,o=!1;e:for(;e.more();){const l=e.pop();switch(l){case Le.CODES.get("i"):s|=He.FOLD_CASE,o=!0;break;case Le.CODES.get("m"):s&=-17,o=!0;break;case Le.CODES.get("s"):s|=He.DOT_NL,o=!0;break;case Le.CODES.get("U"):s|=He.NON_GREEDY,o=!0;break;case Le.CODES.get("-"):if(a<0)break e;a=-1,s=~s,o=!1;break;case Le.CODES.get(":"):case Le.CODES.get(")"):if(a<0){if(!o)break e;s=~s}l===Le.CODES.get(":")&&this.op(me.Op.LEFT_PAREN),this.flags=s;return;default:break e}}throw new wr(Xe.ERR_INVALID_PERL_OP,e.from(t))}parsePosLookBehind(){const e=this.newRegexp(me.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=++this.nlb,this.push(e)}parseNegLookBehind(){const e=this.newRegexp(me.Op.LEFT_PAREN);return e.flags=this.flags,e.lb=-++this.nlb,this.push(e)}parseVerticalBar(){this.concat(),this.swapVerticalBar()||this.op(me.Op.VERTICAL_BAR)}swapVerticalBar(){const e=this.stack.length;if(e>=3&&this.stack[e-2].op===me.Op.VERTICAL_BAR&&Xe.isCharClass(this.stack[e-1])&&Xe.isCharClass(this.stack[e-3])){let t=this.stack[e-1],r=this.stack[e-3];if(t.op>r.op){const s=r;r=t,t=s,this.stack[e-3]=r}return Xe.mergeCharClass(r,t),this.reuse(t),this.pop(),!0}if(e>=2){const t=this.stack[e-1],r=this.stack[e-2];if(r.op===me.Op.VERTICAL_BAR)return e>=3&&this.cleanAlt(this.stack[e-3]),this.stack[e-2]=t,this.stack[e-1]=r,!0}return!1}parseRightParen(){if(this.concat(),this.swapVerticalBar()&&this.pop(),this.alternate(),this.stack.length<2)throw new wr(Xe.ERR_UNEXPECTED_PAREN,this.wholeRegexp);const e=this.pop(),t=this.pop();if(t.op!==me.Op.LEFT_PAREN)throw new wr(Xe.ERR_UNEXPECTED_PAREN,this.wholeRegexp);if(this.flags=t.flags,t.lb!==0){if(Xe.hasCapture(e))throw new wr(Xe.ERR_INVALID_CAPTURE_IN_LOOKBEHIND,this.wholeRegexp);t.lb>0?t.op=me.Op.PLB:t.op=me.Op.NLB,t.subs=[e],this.push(t);return}t.cap===0?this.push(e):(t.op=me.Op.CAPTURE,t.subs=[e],this.push(t))}parsePerlClassEscape(e,t){const r=e.pos();if((this.flags&He.PERL_X)===0||!e.more()||e.pop()!==Le.CODES.get("\\")||!e.more())return!1;e.pop();const s=e.from(r),a=k3.has(s)?k3.get(s):null;
1654return a===null?!1:(t.appendGroup(a,(this.flags&He.FOLD_CASE)!==0),!0)}parseNamedClass(e,t){const r=e.rest(),s=r.indexOf(":]");if(s<0)return!1;const a=r.substring(0,s+2);e.skipString(a);const o=$3.has(a)?$3.get(a):null;if(o===null)throw new wr(Xe.ERR_INVALID_CHAR_RANGE,a);return t.appendGroup(o,(this.flags&He.FOLD_CASE)!==0),!0}parseUnicodeClass(e,t){const r=e.pos();if((this.flags&He.UNICODE_GROUPS)===0||!e.lookingAt("\\p")&&!e.lookingAt("\\P"))return!1;e.skip(1);let s=1,a=e.pop();if(a===Le.CODES.get("P")&&(s=-1),!e.more())throw e.rewindTo(r),new wr(Xe.ERR_INVALID_CHAR_RANGE,e.rest());a=e.pop();let o;if(a!==Le.CODES.get("{"))o=Ct.runeToString(a);else{const h=e.rest(),m=h.indexOf("}");if(m<0)throw e.rewindTo(r),new wr(Xe.ERR_INVALID_CHAR_RANGE,e.rest());o=h.substring(0,m),e.skipString(o),e.skip(1)}o.length!==0&&o.codePointAt(0)===Le.CODES.get("^")&&(s=0-s,o=o.substring(1));const l=Xe.unicodeTable(o);if(l===null)throw new wr(Xe.ERR_INVALID_CHAR_RANGE,e.from(r));l.sign<0&&(s=0-s);const c=l.tab,d=l.fold;if((this.flags&He.FOLD_CASE)===0||d===null)t.appendTableWithSign(c,s);else{const h=new Fu().appendTable(c).appendTable(d).cleanClass().toArray();t.appendClassWithSign(h,s)}return!0}parseClass(e){const t=e.pos();e.skip(1);const r=this.newRegexp(me.Op.CHAR_CLASS);r.flags=this.flags;const s=new Fu;let a=1;e.more()&&e.lookingAt("^")&&(a=-1,e.skip(1),(this.flags&He.CLASS_NL)===0&&s.appendRange(Le.CODES.get(`
1655`),Le.CODES.get(`
1656`)));let o=!0;for(;!e.more()||e.peek()!==Le.CODES.get("]")||o;){if(e.more()&&e.lookingAt("-")&&(this.flags&He.PERL_X)===0&&!o){const h=e.rest();if(h==="-"||!h.startsWith("-]"))throw e.rewindTo(t),new wr(Xe.ERR_INVALID_CHAR_RANGE,e.rest())}o=!1;const l=e.pos();if(e.lookingAt("[:")){if(this.parseNamedClass(e,s))continue;e.rewindTo(l)}if(this.parseUnicodeClass(e,s)||this.parsePerlClassEscape(e,s))continue;e.rewindTo(l);const c=Xe.parseClassChar(e,t);let d=c;if(e.more()&&e.lookingAt("-")){if(e.skip(1),e.more()&&e.lookingAt("]"))e.skip(-1);else if(d=Xe.parseClassChar(e,t),d<c)throw new wr(Xe.ERR_INVALID_CHAR_RANGE,e.from(l))}
1656(this.flags&He.FOLD_CASE)===0?s.appendRange(c,d):s.appendFoldedRange(c,d)}e.skip(1),s.cleanClass(),a<0&&s.negateClass(),r.runes=s.toArray(),this.push(r)}},Ye(Xe,"ERR_INTERNAL_ERROR","regexp/syntax: internal error"),Ye(Xe,"ERR_INVALID_CHAR_RANGE","invalid character class range"),Ye(Xe,"ERR_INVALID_ESCAPE","invalid escape sequence"),Ye(Xe,"ERR_INVALID_NAMED_CAPTURE","invalid named capture"),Ye(Xe,"ERR_INVALID_PERL_OP","invalid or unsupported Perl syntax"),Ye(Xe,"ERR_INVALID_REPEAT_OP","invalid nested repetition operator"),Ye(Xe,"ERR_INVALID_REPEAT_SIZE","invalid repeat count"),Ye(Xe,"ERR_MISSING_BRACKET","missing closing ]"),Ye(Xe,"ERR_MISSING_PAREN","missing closing )"),Ye(Xe,"ERR_MISSING_REPEAT_ARGUMENT","missing argument to repetition operator"),Ye(Xe,"ERR_TRAILING_BACKSLASH","trailing backslash at end of expression"),Ye(Xe,"ERR_DUPLICATE_NAMED_CAPTURE","duplicate capture group name"),Ye(Xe,"ERR_UNEXPECTED_PAREN","unexpected )"),Ye(Xe,"ERR_NESTING_DEPTH","expression nests too deeply"),Ye(Xe,"ERR_LARGE","expression too large"),Ye(Xe,"ERR_INVALID_CAPTURE_IN_LOOKBEHIND","invalid capture in lookbehind"),Ye(Xe,"MAX_HEIGHT",1e3),Ye(Xe,"MAX_SIZE",3355443),Ye(Xe,"MAX_RUNES",33554432),Ye(Xe,"ANY_TABLE",new te(new Uint32Array([0,ut.MAX_RUNE,1]))),Ye(Xe,"ASCII_TABLE",new te(new Uint32Array([0,127,1]))),Ye(Xe,"ASCII_FOLD_TABLE",new te(new Uint32Array([0,127,1,383,383,1,8490,8490,1]))),Xe),boe=class jf{static initTest(e){const t=jf.compile(e),r=new jf(t.expr,t.prog,t.numSubexp,t.longest);return r.cond=t.cond,r.prefix=t.prefix,r.prefixUTF8=t.prefixUTF8,r.prefixComplete=t.prefixComplete,r.prefixRune=t.prefixRune,r.prefilter=t.prefilter,r}static compile(e){return jf.compileImpl(e,He.PERL,!1)}static compilePOSIX(e){return jf.compileImpl(e,He.POSIX,!0)}static compileImpl(e,t,r){let s=xoe.parse(e,t);const a=s.maxCap();s=poe.simplify(s);const o=hoe.build(s),l=moe.compileRegexp(s),c=new jf(e,l,a,r);c.prefilter=o.type===Cn.Type.NONE?null:o;const[d,h]=l.prefix();return c.prefixComplete=d,c.prefix=h,c.prefixUTF8=Ct.stringToUtf8ByteArray(c.prefix),c.prefix.length>0&&(c.prefixRune=c.prefix.codePointAt(0)),c.namedGroups=s.namedGroups,c}static match(e,t){return jf.compile(e).match(t)}constructor(e,t,r=0,s=0){this.expr=e,this.prog=t,this.numSubexp=r,this.longest=s,this.cond=t.startCond(),this.prefix=null,this.prefixUTF8=null,this.prefixComplete=!1,this.prefixRune=0,this.machinePool=[],this.dfa=new noe(this.prog),this.onepass=C3.compile(this.prog),this.prefilter=null}matchPrefixComplete(e,t,r,s){if((r===He.ANCHOR_START||r===He.ANCHOR_BOTH)&&t!==0)return null;let a=-1,o=-1;const l=e.prefixLength(this);if(r===He.UNANCHORED){const c=e.index(this,t);if(c<0)return null;a=t+c,o=a+l}else if(r===He.ANCHOR_BOTH){if(e.endPos()!==l||e.index(this,0)!==0)return null;a=0,o=l}else if(r===He.ANCHOR_START){if(e.index(this,0)!==0)return null;a=0,o=l}if(a<0)return null;if(s>0){const c=new Int32Array(s).fill(-1);return c[0]=a,c[1]=o,Array.from(c)}return[]}executeEngine(e,t,r,s){if(this.prefixComplete&&(s===0||this.numSubexp===0))return this.matchPrefixComplete(e,t,r,s);if(this.prefilter!==null&&r===He.UNANCHORED&&!this.prefilter.eval(e,t))return null;if(this.onepass!==null)return C3.execute(this,e,t,r,s);if(s>0)return this.prog.numLb===0&&e.endPos()<=ew.maxBitStateLen(this.prog)?ew.execute(this,e,t,r,s):this.doExecuteNFA(e,t,r,s);if(this.prog.numLb===0){const a=this.dfa.match(e,t,r);if(a!==null)return a?[]:null;if(e.endPos()<=ew.maxBitStateLen(this.prog))return ew.execute(this,e,t,r,s)}return this.doExecuteNFA(e,t,r,s)}numberOfCapturingGroups(){return this.numSubexp}numberOfInstructions(){return this.prog.numInst()}get(){return this.machinePool.length>0?this.machinePool.pop():null}reset(){this.machinePool.length=0}put(e){this.machinePool.push(e)}toString(){return this.expr}doExecuteNFA(e,t,r,s){let a=this.get();a||(a=Zie.fromRE2(this)),a.init(s);const o=a.match(e,t,r)?a.submatches():null;return this.put(a),o}match(e){return this.executeEngine(Ir.fromUTF16(e),0,He.UNANCHORED,0)!==null}matchWithGroup(e,t,r,s,a){return e instanceof wm||(Ct.isByteArray(e)?e=Qf.utf8(e):e=Qf.utf16(e)),this.matchMachineInput(e,t,r,s,a)}matchMachineInput(e,t,r,s,a){if(t>r)return[!1,null];
1656const o=e.isUTF16Encoding()?Ir.fromUTF16(e.asCharSequence(),0,r):Ir.fromUTF8(e.asBytes(),0,r),l=this.executeEngine(o,t,s,2*a);return l===null?[!1,null]:[!0,l]}matchUTF8(e){return this.executeEngine(Ir.fromUTF8(e),0,He.UNANCHORED,0)!==null}replaceAll(e,t){return this.replaceAllFunc(e,()=>t,2*e.length+1)}replaceFirst(e,t){return this.replaceAllFunc(e,()=>t,1)}replaceAllFunc(e,t,r){let s=0,a=0,o="";const l=Ir.fromUTF16(e);let c=0;for(;a<=e.length;){const d=this.executeEngine(l,a,He.UNANCHORED,2);if(d===null||d.length===0)break;o+=e.substring(s,d[0]),(d[1]>s||d[0]===0)&&(o+=t(e.substring(d[0],d[1])),c++),s=d[1];const h=l.step(a)&7;if(a+h>d[1]?a+=h:a+1>d[1]?a++:a=d[1],c>=r)break}return o+=e.substring(s),o}pad(e){if(e===null)return null;let t=(1+this.numSubexp)*2;if(e.length<t){let r=new Array(t).fill(-1);for(let s=0;s<e.length;s++)r[s]=e[s];e=r}return e}allMatches(e,t,r=s=>s){let s=[];const a=e.endPos();t<0&&(t=a+1);let o=0,l=0,c=-1;for(;l<t&&o<=a;){const d=this.executeEngine(e,o,He.UNANCHORED,this.prog.numCap);if(d===null||d.length===0)break;let h=!0;if(d[1]===o){d[0]===c&&(h=!1);const m=e.step(o);m<0?o=a+1:o+=m&7}else o=d[1];c=d[1],h&&(s.push(r(this.pad(d))),l++)}return s}findUTF8(e){const t=this.executeEngine(Ir.fromUTF8(e),0,He.UNANCHORED,2);return t===null?null:e.slice(t[0],t[1])}findUTF8Index(e){const t=this.executeEngine(Ir.fromUTF8(e),0,He.UNANCHORED,2);return t===null?null:t.slice(0,2)}find(e){const t=this.executeEngine(Ir.fromUTF16(e),0,He.UNANCHORED,2);return t===null?"":e.substring(t[0],t[1])}findIndex(e){return this.executeEngine(Ir.fromUTF16(e),0,He.UNANCHORED,2)}findUTF8Submatch(e){const t=this.executeEngine(Ir.fromUTF8(e),0,He.UNANCHORED,this.prog.numCap);if(t===null)return null;const r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<t.length&&t[2*s]>=0&&(r[s]=e.slice(t[2*s],t[2*s+1]));return r}findUTF8SubmatchIndex(e){return this.pad(this.executeEngine(Ir.fromUTF8(e),0,He.UNANCHORED,this.prog.numCap))}findSubmatch(e){const t=this.executeEngine(Ir.fromUTF16(e),0,He.UNANCHORED,this.prog.numCap);if(t===null)return null;const r=new Array(1+this.numSubexp).fill(null);for(let s=0;s<r.length;s++)2*s<t.length&&t[2*s]>=0&&(r[s]=e.substring(t[2*s],t[2*s+1]));return r}findSubmatchIndex(e){return this.pad(this.executeEngine(Ir.fromUTF16(e),0,He.UNANCHORED,this.prog.numCap))}findAllUTF8(e,t){const r=this.allMatches(Ir.fromUTF8(e),t,s=>e.slice(s[0],s[1]));return r.length===0?null:r}findAllUTF8Index(e,t){const r=this.allMatches(Ir.fromUTF8(e),t,s=>s.slice(0,2));return r.length===0?null:r}findAll(e,t){const r=this.allMatches(Ir.fromUTF16(e),t,s=>e.substring(s[0],s[1]));return r.length===0?null:r}findAllIndex(e,t){const r=this.allMatches(Ir.fromUTF16(e),t,s=>s.slice(0,2));return r.length===0?null:r}findAllUTF8Submatch(e,t){const r=this.allMatches(Ir.fromUTF8(e),t,s=>{let a=new Array(s.length/2|0).fill(null);for(let o=0;o<a.length;o++)s[2*o]>=0&&(a[o]=e.slice(s[2*o],s[2*o+1]));return a});return r.length===0?null:r}findAllUTF8SubmatchIndex(e,t){const r=this.allMatches(Ir.fromUTF8(e),t);return r.length===0?null:r}findAllSubmatch(e,t){const r=this.allMatches(Ir.fromUTF16(e),t,s=>{let a=new Array(s.length/2|0).fill(null);for(let o=0;o<a.length;o++)s[2*o]>=0&&(a[o]=e.substring(s[2*o],s[2*o+1]));return a});return r.length===0?null:r}findAllSubmatchIndex(e,t){const r=this.allMatches(Ir.fromUTF16(e),t);return r.length===0?null:r}},yoe=class f0{static isHexadecimal(e){return"0"<=e&&e<="9"||"A"<=e&&e<="F"||"a"<=e&&e<="f"}static translate(e){let t="";if(e instanceof RegExp&&(e.ignoreCase&&(t+="i"),e.multiline&&(t+="m"),e.dotAll&&(t+="s"),e=e.source),typeof e!="string")return e;let r="",s=!1,a=e.length;a===0&&(r="(?:)",s=!0);let o=!1,l=0;for(;l<a;){let d=e[l];if(d==="\\"){if(l+1<a)switch(d=e[l+1],d){case"\\":r+="\\\\",l+=2;continue;case"c":if(l+2<a){let p=e[l+2].charCodeAt(0);if(p>=65&&p<=90||p>=97&&p<=122){let x=p%32;r+="\\x",r+=(x>>4).toString(16).toUpperCase(),r+=(x&15).toString(16).toUpperCase(),l+=3,s=!0;continue}}r+="c",l+=2,s=!0;continue;case"u":if(l+2<a){if(e[l+2]==="{"){let p=l+3,x=!1,y=!1;for(;p<a;){const v=e[p];if(v==="}"){y=!0;break}if(!f0.isHexadecimal(v))break;x=!0,p++}if(y&&x){r+="\\x",l+=2,s=!0;continue}}else if(l+5<a){let p=!0;for(let x=0;x<4;x++)if(!f0.isHexadecimal(e[l+2+x])){p=!1;break}if(p){r+="\\x{"+e.substring(l+2,l+6)+"}",l+=6,s=!0;continue}}}r+="u",l+=2,s=!0;continue;case"x":{let p=!1;if(l+2<a&&e[l+2]==="{"){let x=l+3,y=!1,v=!1;for(;x<a;){const B=e[x];if(B==="}"){v=!0;break}if(!f0.isHexadecimal(B))break;y=!0,x++}v&&y&&(p=!0)}else l+3<a&&f0.isHexadecimal(e[l+2])&&f0.isHexadecimal(e[l+3])&&(p=!0);p?(r+="\\x",l+=2):(r+="x",l+=2,s=!0);continue}case"n":case"r":case"t":case"a":case"f":case"v":case"d":case"D":case"s":case"S":case"w":case"W":case"b":case"B":case"p":case"P":case"A":case"z":case"Q":case"E":case"0":case"1":case"2":case"3":case"4":case"5":case"6":case"7":r+="\\"+d,l+=2;continue;default:{let p=e.codePointAt(l+1);if(p>=48&&p<=57||p>=65&&p<=90||p>=97&&p<=122){let x=Ct.charCount(p);r+=e.substring(l+1,l+1+x),l+=x+1,s=!0}else{r+="\\";let x=Ct.charCount(p);r+=e.substring(l+1,l+1+x),l+=x+1}continue}}}else if(d==="/"){r+="\\/",l+=1,s=!0;continue}else if(d==="[")o=!0;else if(d==="]")o=!1;else if(!o&&d==="("&&l+2<a&&e[l+1]==="?"&&e[l+2]==="<"&&l+3<a&&!"=!>)".includes(e[l+3])){r+="(?P<",l+=3,s=!0;continue}let h=e.codePointAt(l),m=Ct.charCount(h);r+=e.substring(l,l+m),l+=m}const c=s?r:e;return t.length>0?`(?${t})${c}`:c}},Ls,VD=(Ls=class{static quote(e){return Ct.quoteMeta(e)}
1656static quoteReplacement(e,t=!1){return y3.quoteReplacement(e,t)}static translateRegExp(e){return yoe.translate(e)}static compile(e,t=0){let r=e;if((t&Ls.CASE_INSENSITIVE)!==0&&(r=`(?i)${r}`),(t&Ls.DOTALL)!==0&&(r=`(?s)${r}`),(t&Ls.MULTILINE)!==0&&(r=`(?m)${r}`),(t&-544)!==0)throw new Xie("Flags should only be a combination of MULTILINE, DOTALL, CASE_INSENSITIVE, DISABLE_UNICODE_GROUPS, LONGEST_MATCH, LOOKBEHINDS");let s=He.PERL;(t&Ls.DISABLE_UNICODE_GROUPS)!==0&&(s&=-129),(t&Ls.LOOKBEHINDS)!==0&&(s|=He.LOOKBEHIND);const a=new Ls(e,t);return a.re2Input=boe.compileImpl(r,s,(t&Ls.LONGEST_MATCH)!==0),a}static matches(e,t){return Ls.compile(e).testExact(t)}static initTest(e,t,r){if(e==null)throw new Error("pattern is null");if(r==null)throw new Error("re2 is null");const s=new Ls(e,t);return s.re2Input=r,s}constructor(e,t){this.patternInput=e,this.flagsInput=t,this.re2Input=null}reset(){this.re2Input.reset()}flags(){return this.flagsInput}pattern(){return this.patternInput}re2(){return this.re2Input}matches(e){return this.testExact(e)}matcher(e){return Ct.isByteArray(e)&&(e=Qf.utf8(e)),new y3(this,e)}test(e){return Ct.isByteArray(e)?this.re2Input.matchUTF8(e):this.re2Input.match(e)}testExact(e){const t=Ct.isByteArray(e)?Ir.fromUTF8(e):Ir.fromUTF16(e);return this.re2Input.executeEngine(t,0,He.ANCHOR_BOTH,0)!==null}exec(e){const t=this.matcher(e);if(!t.find())return null;const r=[t.group(0)];for(let a=1;a<=t.groupCount();a++){const o=t.group(a);r.push(o===null?void 0:o)}r.index=t.start(0),r.input=e;const s=this.namedGroups();if(Object.keys(s).length>0){const a=t.getNamedGroups();for(const o in a)a[o]===null&&(a[o]=void 0);r.groups=a}else r.groups=void 0;return r}split(e,t=0){const r=this.matcher(e),s=[];let a=0,o=0;for(;r.find();){if(o===0&&r.end()===0){o=r.end();continue}if(t>0&&s.length===t-1)break;if(o===r.start()){if(t===0){a+=1,o=r.end();continue}}else for(;a>0;)s.push(""),a-=1;s.push(r.substring(o,r.start())),o=r.end()}if(t===0&&o!==r.inputLength()){for(;a>0;)s.push(""),a-=1;s.push(r.substring(o,r.inputLength()))}return(t!==0||s.length===0&&!(o===r.inputLength()&&o>0))&&s.push(r.substring(o,r.inputLength())),s}*matchAll(e){const t=this.matcher(e);for(;t.find();){const r=[t.group(0)];for(let a=1;a<=t.groupCount();a++){const o=t.group(a);r.push(o===null?void 0:o)}r.index=t.start(0),r.input=e;const s=this.namedGroups();if(Object.keys(s).length>0){const a=t.getNamedGroups();for(const o in a)a[o]===null&&(a[o]=void 0);r.groups=a}else r.groups=void 0;yield r}}toString(){return this.patternInput}programSize(){return this.re2Input.numberOfInstructions()}groupCount(){return this.re2Input.numberOfCapturingGroups()}namedGroups(){return this.re2Input.namedGroups}equals(e){return this===e?!0:e===null||this.constructor!==e.constructor?!1:this.flagsInput===e.flagsInput&&this.patternInput===e.patternInput}},Ye(Ls,"CASE_INSENSITIVE",Pp.CASE_INSENSITIVE),Ye(Ls,"DOTALL",Pp.DOTALL),Ye(Ls,"MULTILINE",Pp.MULTILINE),Ye(Ls,"DISABLE_UNICODE_GROUPS",Pp.DISABLE_UNICODE_GROUPS),Ye(Ls,"LONGEST_MATCH",Pp.LONGEST_MATCH),Ye(Ls,"LOOKBEHINDS",Pp.LOOKBEHINDS),Ls);/**
1657 * @license
1658 * Copyright 2023 Google LLC
1659 *
1660 * Licensed under the Apache License, Version 2.0 (the "License");
1661 * you may not use this file except in compliance with the License.
1662 * You may obtain a copy of the License at
1663 *
1664 *   http://www.apache.org/licenses/LICENSE-2.0
1665 *
1666 * Unless required by applicable law or agreed to in writing, software
1667 * distributed under the License is distributed on an "AS IS" BASIS,
1668 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1669 * See the License for the specific language governing permissions and
1670 * limitations under the License.
1671 */class EH{constructor(e,t,r){this.alias=e,this.aggregateType=t,this.fieldPath=r}}/**
1672 * @license
1673 * Copyright 2017 Google LLC
1674 *
1675 * Licensed under the Apache License, Version 2.0 (the "License");
1676 * you may not use this file except in compliance with the License.
1677 * You may obtain a copy of the License at
1678 *
1679 *   http://www.apache.org/licenses/LICENSE-2.0
1680 *
1681 * Unless required by applicable law or agreed to in writing, softw
1681are
1682 * distributed under the License is distributed on an "AS IS" BASIS,
1683 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1684 * See the License for the specific language governing permissions and
1685 * limitations under the License.
1686 */let Dg="12.19.0";function voe(n){Dg=n}/**
1687 * @license
1688 * Copyright 2020 Google LLC
1689 *
1690 * Licensed under the Apache License, Version 2.0 (the "License");
1691 * you may not use this file except in compliance with the License.
1692 * You may obtain a copy of the License at
1693 *
1694 *   http://www.apache.org/licenses/LICENSE-2.0
1695 *
1696 * Unless required by applicable law or agreed to in writing, software
1697 * distributed under the License is distributed on an "AS IS" BASIS,
1698 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1699 * See the License for the specific language governing permissions and
1700 * limitations under the License.
1701 *//**
1702 * @license
1703 * Copyright 2017 Google LLC
1704 *
1705 * Licensed under the Apache License, Version 2.0 (the "License");
1706 * you may not use this file except in compliance with the License.
1707 * You may obtain a copy of the License at
1708 *
1709 *   http://www.apache.org/licenses/LICENSE-2.0
1710 *
1711 * Unless required by applicable law or agreed to in writing, software
1712 * distributed under the License is distributed on an "AS IS" BASIS,
1713 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1714 * See the License for the specific language governing permissions and
1715 * limitations under the License.
1716 */const Th=new kD("@firebase/firestore");function m0(){return Th.logLevel}function Boe(n){Th.setLogLevel(n)}function ze(n,...e){if(Th.logLevel<=an.DEBUG){const t=e.map(GD);Th.debug(`Firestore (${Dg}): ${n}`,...t)}}function Cs(n,...e){if(Th.logLevel<=an.ERROR){const t=e.map(GD);Th.error(`Firestore (${Dg}): ${n}`,...t)}}function Xs(n,...e){if(Th.logLevel<=an.WARN){const t=e.map(GD);Th.warn(`Firestore (${Dg}): ${n}`,...t)}}function GD(n){if(typeof n=="string")return n;try{return(function(t){return JSON.stringify(t)})(n)}catch{return n}}/**
1717 * @license
1718 * Copyright 2017 Google LLC
1719 *
1720 * Licensed under the Apache License, Version 2.0 (the "License");
1721 * you may not use this file except in compliance with the License.
1722 * You may obtain a copy of the License at
1723 *
1724 *   http://www.apache.org/licenses/LICENSE-2.0
1725 *
1726 * Unless required by applicable law or agreed to in writing, software
1727 * distributed under the License is distributed on an "AS IS" BASIS,
1728 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1729 * See the License for the specific language governing permissions and
1730 * limitations under the License.
1731 */function ot(n,e,t){let r="Unexpected state";typeof e=="string"?r=e:t=e,SH(n,r,t)}function SH(n,e,t){let r=`FIRESTORE (${Dg}) INTERNAL ASSERTION FAILED: ${e} (ID: ${n.toString(16)})`;if(t!==void 0)try{r+=" CONTEXT: "+JSON.stringify(t)}catch{r+=" CONTEXT: "+t}throw Cs(r),new Error(r)}function Ke(n,e,t,r){let s="Unexpected state";typeof t=="string"?s=t:r=t,n||SH(e,s,r)}function woe(n,e){n||ot(57014,e)}function st(n,e){return n}/**
1732 * @license
1733 * Copyright 2020 Google LLC
1734 *
1735 * Licensed under the Apache License, Version 2.0 (the "License");
1736 * you may not use this file except in compliance with the License.
1737 * You may obtain a copy of the License at
1738 *
1739 *   http://www.apache.org/licenses/LICENSE-2.0
1740 *
1741 * Unless required by applicable law or agreed to in writing, software
1742 * distributed under the License is distributed on an "AS IS" BASIS,
1743 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1744 * See the License for the specific language governing permissions and
1745 * limitations under the License.
1746 */function Coe(n){const e=typeof self<"u"&&(self.crypto||self.msCrypto),t=new Uint8Array(n);if(e&&typeof e.getRandomValues=="function")e.getRandomValues(t);else for(let r=0;r<n;r++)t[r]=Math.floor(256*Math.random());return t}/**
1747 * @license
1748 * Copyright 2017 Google LLC
1749 *
1750 * Licensed under the Apache License, Version 2.0 (the "License");
1751 * you may not use this file except in compliance with the License.
1752 * You may obtain a copy of the License at
1753 *
1754 *   http://www.apache.org/licenses/LICENSE-2.0
1755 *
1756 * Unless required by applicable law or agreed to in writing, softw
1756are
1757 * distributed under the License is distributed on an "AS IS" BASIS,
1758 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1759 * See the License for the specific language governing permissions and
1760 * limitations under the License.
1761 */class k1{static newId(){const e="ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789",t=62*Math.floor(4.129032258064516);let r="";for(;r.length<20;){const s=Coe(40);for(let a=0;a<s.length;++a)r.length<20&&s[a]<t&&(r+=e.charAt(s[a]%62))}return r}}function Pt(n,e){return n<e?-1:n>e?1:0}function v_(n,e){const t=Math.min(n.length,e.length);for(let r=0;r<t;r++){const s=n.charAt(r),a=e.charAt(r);if(s!==a)return Ek(s)===Ek(a)?Pt(s,a):Ek(s)?1:-1}return Pt(n.length,e.length)}const Eoe=55296,Soe=57343;function Ek(n){const e=n.charCodeAt(0);return e>=Eoe&&e<=Soe}function q0(n,e,t){return n.length===e.length&&n.every(((r,s)=>t(r,e[s])))}function TH(n){return n+"\0"}/**
1762 * @license
1763 * Copyright 2017 Google LLC
1764 *
1765 * Licensed under the Apache License, Version 2.0 (the "License");
1766 * you may not use this file except in compliance with the License.
1767 * You may obtain a copy of the License at
1768 *
1769 *   http://www.apache.org/licenses/LICENSE-2.0
1770 *
1771 * Unless required by applicable law or agreed to in writing, software
1772 * distributed under the License is distributed on an "AS IS" BASIS,
1773 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1774 * See the License for the specific language governing permissions and
1775 * limitations under the License.
1776 */class br{constructor(e,t){this.comparator=e,this.root=t||ja.EMPTY}insert(e,t){return new br(this.comparator,this.root.insert(e,t,this.comparator).copy(null,null,ja.BLACK,null,null))}remove(e){return new br(this.comparator,this.root.remove(e,this.comparator).copy(null,null,ja.BLACK,null,null))}get(e){let t=this.root;for(;!t.isEmpty();){const r=this.comparator(e,t.key);if(r===0)return t.value;r<0?t=t.left:r>0&&(t=t.right)}return null}indexOf(e){let t=0,r=this.root;for(;!r.isEmpty();){const s=this.comparator(e,r.key);if(s===0)return t+r.left.size;s<0?r=r.left:(t+=r.left.size+1,r=r.right)}return-1}isEmpty(){return this.root.isEmpty()}get size(){return this.root.size}minKey(){return this.root.minKey()}maxKey(){return this.root.maxKey()}inorderTraversal(e){return this.root.inorderTraversal(e)}forEach(e){this.inorderTraversal(((t,r)=>(e(t,r),!1)))}toString(){const e=[];return this.inorderTraversal(((t,r)=>(e.push(`${t}:${r}`),!1))),`{${e.join(", ")}}`}reverseTraversal(e){return this.root.reverseTraversal(e)}getIterator(){return new nw(this.root,null,this.comparator,!1)}getIteratorFrom(e){return new nw(this.root,e,this.comparator,!1)}getReverseIterator(){return new nw(this.root,null,this.comparator,!0)}getReverseIteratorFrom(e){return new nw(this.root,e,this.comparator,!0)}}class nw{constructor(e,t,r,s){this.isReverse=s,this.nodeStack=[];let a=1;for(;!e.isEmpty();)if(a=t?r(e.key,t):1,t&&s&&(a*=-1),a<0)e=this.isReverse?e.left:e.right;else{if(a===0){this.nodeStack.push(e);break}this.nodeStack.push(e),e=this.isReverse?e.right:e.left}}getNext(){let e=this.nodeStack.pop();const t={key:e.key,value:e.value};if(this.isReverse)for(e=e.left;!e.isEmpty();)this.nodeStack.push(e),e=e.right;else for(e=e.right;!e.isEmpty();)this.nodeStack.push(e),e=e.left;return t}hasNext(){return this.nodeStack.length>0}peek(){if(this.nodeStack.length===0)return null;const e=this.nodeStack[this.nodeStack.length-1];return{key:e.key,value:e.value}}}class ja{constructor(e,t,r,s,a){this.key=e,this.value=t,this.color=r??ja.RED,this.left=s??ja.EMPTY,this.right=a??ja.EMPTY,this.size=this.left.size+1+this.right.size}copy(e,t,r,s,a){return new ja(e??this.key,t??this.value,r??this.color,s??this.left,a??this.right)}isEmpty(){return!1}inorderTraversal(e){return this.left.inorderTraversal(e)||e(this.key,this.value)||this.right.inorderTraversal(e)}reverseTraversal(e){return this.right.reverseTraversal(e)||e(this.key,this.value)||this.left.reverseTraversal(e)}min(){return this.left.isEmpty()?this:this.left.min()}minKey(){return this.min().key}maxKey(){return this.right.isEmpty()?this.key:this.right.maxKey()}insert(e,t,r){let s=this;const a=r(e,s.key);return s=a<0?s.copy(null,null,null,s.left.insert(e,t,r),null):a===0?s.copy(null,t,null,null,null):s.copy(null,null,null,null,s.right.insert(e,t,r)),s.fixUp()}removeMin(){if(this.left.isEmpty())return ja.EMPTY;let e=this;return e.left.isRed()||e.left.left.isRed()||(e=e.moveRedLeft()),e=e.copy(null,null,null,e.left.removeMin(),null),e.fixUp()}remove(e,t){let r,s=this;if(t(e,s.key)<0)s.left.isEmpty()||s.left.isRed()||s.left.left.isRed()||(s=s.moveRedLeft()),s=s.copy(null,null,null,s.left.remove(e,t),null);else{if(s.left.isRed()&&(s=s.rotateRight()),s.right.isEmpty()||s.right.isRed()||s.right.left.isRed()||(s=s.moveRedRight()),t(e,s.
vendor: 4,269 bytes, lines 1776-1795
1776key)===0){if(s.right.isEmpty())return ja.EMPTY;r=s.right.min(),s=s.copy(r.key,r.value,null,null,s.right.removeMin())}s=s.copy(null,null,null,null,s.right.remove(e,t))}return s.fixUp()}isRed(){return this.color}fixUp(){let e=this;return e.right.isRed()&&!e.left.isRed()&&(e=e.rotateLeft()),e.left.isRed()&&e.left.left.isRed()&&(e=e.rotateRight()),e.left.isRed()&&e.right.isRed()&&(e=e.colorFlip()),e}moveRedLeft(){let e=this.colorFlip();return e.right.left.isRed()&&(e=e.copy(null,null,null,null,e.right.rotateRight()),e=e.rotateLeft(),e=e.colorFlip()),e}moveRedRight(){let e=this.colorFlip();return e.left.left.isRed()&&(e=e.rotateRight(),e=e.colorFlip()),e}rotateLeft(){const e=this.copy(null,null,ja.RED,null,this.right.left);return this.right.copy(null,null,this.color,e,null)}rotateRight(){const e=this.copy(null,null,ja.RED,this.left.right,null);return this.left.copy(null,null,this.color,null,e)}colorFlip(){const e=this.left.copy(null,null,!this.left.color,null,null),t=this.right.copy(null,null,!this.right.color,null,null);return this.copy(null,null,!this.color,e,t)}checkMaxDepth(){const e=this.check();return Math.pow(2,e)<=this.size+1}check(){if(this.isRed()&&this.left.isRed())throw ot(43730,{key:this.key,value:this.value});if(this.right.isRed())throw ot(14113,{key:this.key,value:this.value});const e=this.left.check();if(e!==this.right.check())throw ot(27949);return e+(this.isRed()?0:1)}}ja.EMPTY=null,ja.RED=!0,ja.BLACK=!1;ja.EMPTY=new class{constructor(){this.size=0}get key(){throw ot(57766)}get value(){throw ot(16141)}get color(){throw ot(16727)}get left(){throw ot(29726)}get right(){throw ot(36894)}copy(e,t,r,s,a){return this}insert(e,t,r){return new ja(e,t)}remove(e,t){return this}isEmpty(){return!0}inorderTraversal(e){return!1}reverseTraversal(e){return!1}minKey(){return null}maxKey(){return null}isRed(){return!1}checkMaxDepth(){return!0}check(){return 0}};/**
1777 * @license
1778 * Copyright 2017 Google LLC
1779 *
1780 * Licensed under the Apache License, Version 2.0 (the "License");
1781 * you may not use this file except in compliance with the License.
1782 * You may obtain a copy of the License at
1783 *
1784 *   http://www.apache.org/licenses/LICENSE-2.0
1785 *
1786 * Unless required by applicable law or agreed to in writing, software
1787 * distributed under the License is distributed on an "AS IS" BASIS,
1788 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1789 * See the License for the specific language governing permissions and
1790 * limitations under the License.
1791 */class Un{constructor(e){this.comparator=e,this.data=new br(this.comparator)}has(e){return this.data.get(e)!==null}first(){return this.data.minKey()}last(){return this.data.maxKey()}get size(){return this.data.size}indexOf(e){return this.data.indexOf(e)}forEach(e){this.data.inorderTraversal(((t,r)=>(e(t),!1)))}forEachInRange(e,t){const r=this.data.getIteratorFrom(e[0]);for(;r.hasNext();){const s=r.getNext();if(this.comparator(s.key,e[1])>=0)return;t(s.key)}}forEachWhile(e,t){let r;for(r=t!==void 0?this.data.getIteratorFrom(t):this.data.getIterator();r.hasNext();)if(!e(r.getNext().key))return}firstAfterOrEqual(e){const t=this.data.getIteratorFrom(e);return t.hasNext()?t.getNext().key:null}getIterator(){return new H3(this.data.getIterator())}getIteratorFrom(e){return new H3(this.data.getIteratorFrom(e))}add(e){return this.copy(this.data.remove(e).insert(e,!0))}delete(e){return this.has(e)?this.copy(this.data.remove(e)):this}isEmpty(){return this.data.isEmpty()}unionWith(e){let t=this;return t.size<e.size&&(t=e,e=this),e.forEach((r=>{t=t.add(r)})),t}isEqual(e){if(!(e instanceof Un)||this.size!==e.size)return!1;const t=this.data.getIterator(),r=e.data.getIterator();for(;t.hasNext();){const s=t.getNext().key,a=r.getNext().key;if(this.comparator(s,a)!==0)return!1}return!0}toArray(){const e=[];return this.forEach((t=>{e.push(t)})),e}toString(){const e=[];return this.forEach((t=>e.push(t))),"SortedSet("+e.toString()+")"}copy(e){const t=new Un(this.comparator);return t.data=e,t}}class H3{constructor(e){this.iter=e}getNext(){return this.iter.getNext().key}hasNext(){return this.iter.hasNext()}}function Lp(n){return n.hasNext()?n.getNext():void 0}/**
1792 * @license
1793 * Copyright 2017 Google LLC
1794 *
1795 * Licensed under the Apache License, Version 2.0 (the "License");
1796 * you may not use this file except in compliance with the License.
1797 * You may obtain a copy of the License at
1798 *
1799 *   http://www.apache.org/licenses/LICENSE-2.0
1800 *
1801 * Unless required by applicable law or agreed to in writing, software
1802 * distributed under the License is distributed on an "AS IS" BASIS,
1803 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1804 * See the License for the specific language governing permissions and
1805 * limitations under the License.
1806 */const Te={OK:"ok",CANCELLED:"cancelled",UNKNOWN:"unknown",INVALID_ARGUMENT:"invalid-argument",DEADLINE_EXCEEDED:"deadline-exceeded",NOT_FOUND:"not-found",ALREADY_EXISTS:"already-exists",PERMISSION_DENIED:"permission-denied",UNAUTHENTICATED:"unauthenticated",RESOURCE_EXHAUSTED:"resource-exhausted",FAILED_PRECONDITION:"failed-precondition",ABORTED:"aborted",OUT_OF_RANGE:"out-of-range",UNIMPLEMENTED:"unimplemented",INTERNAL:"internal",UNAVAILABLE:"unavailable",DATA_LOSS:"data-loss"};class Fe extends Zd{constructor(e,t){super(e,t),this.code=e,this.message=t,this.toString=()=>`${this.name}: [code=${this.code}]: ${this.message}`}}/**
1807 * @license
1808 * Copyright 2017 Google LLC
1809 *
1810 * Licensed under the Apache License, Version 2.0 (the "License");
1811 * you may not use this file except in compliance with the License.
1812 * You may obtain a copy of the License at
1813 *
1814 *   http://www.apache.org/licenses/LICENSE-2.0
1815 *
1816 * Unless required by applicable law or agreed to in writing, software
1817 * distributed under the License is distributed on an "AS IS" BASIS,
1818 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1819 * See the License for the specific language governing permissions and
1820 * limitations under the License.
1821 */const gc="__name__";class hc{constructor(e,t,r){t===void 0?t=0:t>e.length&&ot(637,{offset:t,range:e.length}),r===void 0?r=e.length-t:r>e.length-t&&ot(1746,{length:r,range:e.length-t}),this.segments=e,this.offset=t,this.len=r}get length(){return this.len}isEqual(e){return hc.comparator(this,e)===0}child(e){const t=this.segments.slice(this.offset,this.limit());return e instanceof hc?e.forEach((r=>{t.push(r)})):t.push(e),this.construct(t)}limit(){return this.offset+this.length}popFirst(e){return e=e===void 0?1:e,this.construct(this.segments,this.offset+e,this.length-e)}popLast(){return this.construct(this.segments,this.offset,this.length-1)}firstSegment(){return this.segments[this.offset]}lastSegment(){return this.get(this.length-1)}get(e){return this.segments[this.offset+e]}isEmpty(){return this.length===0}isPrefixOf(e){if(e.length<this.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}isImmediateParentOf(e){if(this.length+1!==e.length)return!1;for(let t=0;t<this.length;t++)if(this.get(t)!==e.get(t))return!1;return!0}forEach(e){for(let t=this.offset,r=this.limit();t<r;t++)e(this.segments[t])}toArray(){return this.segments.slice(this.offset,this.limit())}static comparator(e,t){const r=Math.min(e.length,t.length);for(let s=0;s<r;s++){const a=hc.compareSegments(e.get(s),t.get(s));if(a!==0)return a}return Pt(e.length,t.length)}static compareSegments(e,t){const r=hc.isNumericId(e),s=hc.isNumericId(t);return r&&!s?-1:!r&&s?1:r&&s?hc.extractNumericId(e).compare(hc.extractNumericId(t)):v_(e,t)}static isNumericId(e){return e.startsWith("__id")&&e.endsWith("__")}static extractNumericId(e){return gh.fromString(e.substring(4,e.length-2))}}class zt extends hc{construct(e,t,r){return new zt(e,t,r)}canonicalString(){return this.toArray().join("/")}toString(){return this.canonicalString()}toStringWithLeadingSlash(){return`/${this.canonicalString()}`}toUriEncodedString(){return this.toArray().map(encodeURIComponent).join("/")}static fromString(...e){const t=[];for(const r of e){if(r.indexOf("//")>=0)throw new Fe(Te.INVALID_ARGUMENT,`Invalid segment (${r}). Paths must not contain // in them.`);t.push(...r.split("/").filter((s=>s.length>0)))}return new zt(t)}static emptyPath(){return new zt([])}}const Toe=/^[_a-zA-Z][_a-zA-Z0-9]*$/;let Es=class p0 extends hc{construct(e,t,r){return new p0(e,t,r)}static isValidIdentifier(e){return Toe.test(e)}canonicalString(){return this.toArray().map((e=>(e=e.replace(/\\/g,"\\\\").replace(/`/g,"\\`"),p0.isValidIdentifier(e)||(e="`"+e+"`"),e))).join(".")}toString(){return this.canonicalString()}isKeyField(){return this.length===1&&this.get(0)===gc}static keyField(){return new p0([gc])}static fromServerFormat(e){const t=[];let r="",s=0;const a=()=>
1821{if(r.length===0)throw new Fe(Te.INVALID_ARGUMENT,`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`);t.push(r),r=""};let o=!1;for(;s<e.length;){const l=e[s];if(l==="\\"){if(s+1===e.length)throw new Fe(Te.INVALID_ARGUMENT,"Path has trailing escape character: "+e);const c=e[s+1];if(c!=="\\"&&c!=="."&&c!=="`")throw new Fe(Te.INVALID_ARGUMENT,"Path has invalid escape sequence: "+e);r+=c,s+=2}else l==="`"?(o=!o,s++):l!=="."||o?(r+=l,s++):(a(),s++)}if(a(),o)throw new Fe(Te.INVALID_ARGUMENT,"Unterminated ` in path: "+e);return new p0(t)}static emptyPath(){return new p0([])}};/**
1822 * @license
1823 * Copyright 2020 Google LLC
1824 *
1825 * Licensed under the Apache License, Version 2.0 (the "License");
1826 * you may not use this file except in compliance with the License.
1827 * You may obtain a copy of the License at
1828 *
1829 *   http://www.apache.org/licenses/LICENSE-2.0
1830 *
1831 * Unless required by applicable law or agreed to in writing, software
1832 * distributed under the License is distributed on an "AS IS" BASIS,
1833 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1834 * See the License for the specific language governing permissions and
1835 * limitations under the License.
1836 */class Vi{constructor(e){this.fields=e,e.sort(Es.comparator)}static empty(){return new Vi([])}unionWith(e){let t=new Un(Es.comparator);for(const r of this.fields)t=t.add(r);for(const r of e)t=t.add(r);return new Vi(t.toArray())}covers(e){for(const t of this.fields)if(t.isPrefixOf(e))return!0;return!1}isEqual(e){return q0(this.fields,e.fields,((t,r)=>t.isEqual(r)))}}/**
1837 * @license
1838 * Copyright 2017 Google LLC
1839 *
1840 * Licensed under the Apache License, Version 2.0 (the "License");
1841 * you may not use this file except in compliance with the License.
1842 * You may obtain a copy of the License at
1843 *
1844 *   http://www.apache.org/licenses/LICENSE-2.0
1845 *
1846 * Unless required by applicable law or agreed to in writing, software
1847 * distributed under the License is distributed on an "AS IS" BASIS,
1848 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1849 * See the License for the specific language governing permissions and
1850 * limitations under the License.
1851 */function HC(n){let e=0;for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e++;return e}function qh(n,e){for(const t in n)Object.prototype.hasOwnProperty.call(n,t)&&e(t,n[t])}function $D(n,e){const t=[];for(const r in n)Object.prototype.hasOwnProperty.call(n,r)&&t.push(e(n[r],r,n));return t}function AH(n){for(const e in n)if(Object.prototype.hasOwnProperty.call(n,e))return!1;return!0}/**
1852 * @license
1853 * Copyright 2017 Google LLC
1854 *
1855 * Licensed under the Apache License, Version 2.0 (the "License");
1856 * you may not use this file except in compliance with the License.
1857 * You may obtain a copy of the License at
1858 *
1859 *   http://www.apache.org/licenses/LICENSE-2.0
1860 *
1861 * Unless required by applicable law or agreed to in writing, software
1862 * distributed under the License is distributed on an "AS IS" BASIS,
1863 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1864 * See the License for the specific language governing permissions and
1865 * limitations under the License.
1866 */class Je{constructor(e){this.path=e}static fromPath(e){return new Je(zt.fromString(e))}static fromName(e){return new Je(zt.fromString(e).popFirst(5))}static empty(){return new Je(zt.emptyPath())}get collectionGroup(){return this.path.popLast().lastSegment()}hasCollectionId(e){return this.path.length>=2&&this.path.get(this.path.length-2)===e}getCollectionGroup(){return this.path.get(this.path.length-2)}getCollectionPath(){return this.path.popLast()}isEqual(e){return e!==null&&zt.comparator(this.path,e.path)===0}toString(){return this.path.toString()}static comparator(e,t){return zt.comparator(e.path,t.path)}static isDocumentKey(e){return e.length%2==0}static fromSegments(e){return new Je(new zt(e.slice()))}}/**
1867 * @license
1868 * Copyright 2017 Google LLC
1869 *
1870 * Licensed under the Apache License, Version 2.0 (the "License");
1871 * you may not use this file except in compliance with the License.
1872 * You may obtain a copy of the License at
1873 *
1874 *   http://www.apache.org/licenses/LICENSE-2.0
1875 *
1876 * Unless required by applicable law or agreed to in writing, softw
1876are
1877 * distributed under the License is distributed on an "AS IS" BASIS,
1878 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1879 * See the License for the specific language governing permissions and
1880 * limitations under the License.
1881 */function HD(n,e,t){if(!t)throw new Fe(Te.INVALID_ARGUMENT,`Function ${n}() cannot be called with an empty ${e}.`)}function kH(n,e,t,r){if(e===!0&&r===!0)throw new Fe(Te.INVALID_ARGUMENT,`${n} and ${t} cannot be used together.`)}function z3(n){if(!Je.isDocumentKey(n))throw new Fe(Te.INVALID_ARGUMENT,`Invalid document reference. Document references must have an even number of segments, but ${n} has ${n.length}.`)}function q3(n){if(Je.isDocumentKey(n))throw new Fe(Te.INVALID_ARGUMENT,`Invalid collection reference. Collection references must have an odd number of segments, but ${n} has ${n.length}.`)}function tv(n){return typeof n=="object"&&n!==null&&(Object.getPrototypeOf(n)===Object.prototype||Object.getPrototypeOf(n)===null)}function N1(n){if(n===void 0)return"undefined";if(n===null)return"null";if(typeof n=="string")return n.length>20&&(n=`${n.substring(0,20)}...`),JSON.stringify(n);if(typeof n=="number"||typeof n=="boolean")return""+n;if(typeof n=="object"){if(n instanceof Array)return"an array";{const e=(function(r){return r.constructor?r.constructor.name:null})(n);return e?`a custom ${e} object`:"an object"}}return typeof n=="function"?"a function":ot(12329,{type:typeof n})}function Zt(n,e){if("_delegate"in n&&(n=n._delegate),!(n instanceof e)){if(e.name===n.constructor.name)throw new Fe(Te.INVALID_ARGUMENT,"Type does not match the expected instance. Did you pass a reference from a different Firestore SDK?");{const t=N1(n);throw new Fe(Te.INVALID_ARGUMENT,`Expected type '${e.name}', but it was: ${t}`)}}return n}function NH(n,e){if(e<=0)throw new Fe(Te.INVALID_ARGUMENT,`Function ${n}() requires a positive number, but it was: ${e}.`)}/**
1882 * @license
1883 * Copyright 2025 Google LLC
1884 *
1885 * Licensed under the Apache License, Version 2.0 (the "License");
1886 * you may not use this file except in compliance with the License.
1887 * You may obtain a copy of the License at
1888 *
1889 *   http://www.apache.org/licenses/LICENSE-2.0
1890 *
1891 * Unless required by applicable law or agreed to in writing, software
1892 * distributed under the License is distributed on an "AS IS" BASIS,
1893 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1894 * See the License for the specific language governing permissions and
1895 * limitations under the License.
1896 */function Ms(n,e){const t={typeString:n};return e&&(t.value=e),t}function Hm(n,e){if(!tv(n))throw new Fe(Te.INVALID_ARGUMENT,"JSON must be an object");let t;for(const r in e)if(e[r]){const s=e[r].typeString,a="value"in e[r]?{value:e[r].value}:void 0;if(!(r in n)){t=`JSON missing required field: '${r}'`;break}const o=n[r];if(s&&typeof o!==s){t=`JSON field '${r}' must be a ${s}.`;break}if(a!==void 0&&o!==a.value){t=`Expected '${r}' field to equal '${a.value}'`;break}}if(t)throw new Fe(Te.INVALID_ARGUMENT,t);return!0}/**
1897 * @license
1898 * Copyright 2017 Google LLC
1899 *
1900 * Licensed under the Apache License, Version 2.0 (the "License");
1901 * you may not use this file except in compliance with the License.
1902 * You may obtain a copy of the License at
1903 *
1904 *   http://www.apache.org/licenses/LICENSE-2.0
1905 *
1906 * Unless required by applicable law or agreed to in writing, software
1907 * distributed under the License is distributed on an "AS IS" BASIS,
1908 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1909 * See the License for the specific language governing permissions and
1910 * limitations under the License.
1911 */const K3=-62135596800,W3=1e6;class bn{static now(){return bn.fromMillis(Date.now())}static fromDate(e){return bn.fromMillis(e.getTime())}static fromMillis(e){const t=Math.floor(e/1e3),r=Math.floor((e-1e3*t)*W3);return new bn(t,r)}static fromInstant(e){if(!e||typeof e.t!="bigint")throw new Fe(Te.INVALID_ARGUMENT,"Invalid Temporal.Instant object provided.");return bn._fromEpochNanoseconds(e.t)}
1911static _fromEpochNanoseconds(e){let t,r;if(e>=0n)t=Number(e/1000000000n),r=Number(e%1000000000n);else{const s=e%1000000000n;s===0n?(t=Number(e/1000000000n),r=0):(t=Number(e/1000000000n-1n),r=Number(s+1000000000n))}return new bn(t,r)}constructor(e,t){if(this.seconds=e,this.nanoseconds=t,t<0)throw new Fe(Te.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(t>=1e9)throw new Fe(Te.INVALID_ARGUMENT,"Timestamp nanoseconds out of range: "+t);if(e<K3)throw new Fe(Te.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e);if(e>=253402300800)throw new Fe(Te.INVALID_ARGUMENT,"Timestamp seconds out of range: "+e)}toDate(){return new Date(this.toMillis())}toMillis(){return 1e3*this.seconds+this.nanoseconds/W3}toInstant(){if(typeof Temporal>"u"||!Temporal.Instant)throw new Fe(Te.FAILED_PRECONDITION,"The Temporal object is not available in the current environment.");const e=1000000000n*BigInt(this.seconds)+BigInt(this.nanoseconds);return Temporal.Instant.__PRIVATE_fromEpochNanoseconds(e)}_compareTo(e){return this.seconds===e.seconds?Pt(this.nanoseconds,e.nanoseconds):Pt(this.seconds,e.seconds)}isEqual(e){return e.seconds===this.seconds&&e.nanoseconds===this.nanoseconds}toString(){return"Timestamp(seconds="+this.seconds+", nanoseconds="+this.nanoseconds+")"}toJSON(){return{type:bn._jsonSchemaVersion,seconds:this.seconds,nanoseconds:this.nanoseconds}}static fromJSON(e){if(Hm(e,bn._jsonSchema))return new bn(e.seconds,e.nanoseconds)}valueOf(){const e=this.seconds-K3;return String(e).padStart(12,"0")+"."+String(this.nanoseconds).padStart(9,"0")}}bn._jsonSchemaVersion="firestore/timestamp/1.0",bn._jsonSchema={type:Ms("string",bn._jsonSchemaVersion),seconds:Ms("number"),nanoseconds:Ms("number")};/**
1912 * @license
1913 * Copyright 2023 Google LLC
1914 *
1915 * Licensed under the Apache License, Version 2.0 (the "License");
1916 * you may not use this file except in compliance with the License.
1917 * You may obtain a copy of the License at
1918 *
1919 *   http://www.apache.org/licenses/LICENSE-2.0
1920 *
1921 * Unless required by applicable law or agreed to in writing, software
1922 * distributed under the License is distributed on an "AS IS" BASIS,
1923 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1924 * See the License for the specific language governing permissions and
1925 * limitations under the License.
1926 */class _H extends Error{constructor(){super(...arguments),this.name="Base64DecodeError"}}/**
1927 * @license
1928 * Copyright 2020 Google LLC
1929 *
1930 * Licensed under the Apache License, Version 2.0 (the "License");
1931 * you may not use this file except in compliance with the License.
1932 * You may obtain a copy of the License at
1933 *
1934 *   http://www.apache.org/licenses/LICENSE-2.0
1935 *
1936 * Unless required by applicable law or agreed to in writing, software
1937 * distributed under the License is distributed on an "AS IS" BASIS,
1938 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1939 * See the License for the specific language governing permissions and
1940 * limitations under the License.
1941 */function Aoe(){return typeof atob<"u"}/**
1942 * @license
1943 * Copyright 2020 Google LLC
1944 *
1945 * Licensed under the Apache License, Version 2.0 (the "License");
1946 * you may not use this file except in compliance with the License.
1947 * You may obtain a copy of the License at
1948 *
1949 *   http://www.apache.org/licenses/LICENSE-2.0
1950 *
1951 * Unless required by applicable law or agreed to in writing, software
1952 * distributed under the License is distributed on an "AS IS" BASIS,
1953 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1954 * See the License for the specific language governing permissions and
1955 * limitations under the License.
1956 */class Sr{constructor(e){this.binaryString=e}static fromBase64String(e){const t=(function(s){try{return atob(s)}catch(a){throw typeof DOMException<"u"&&a instanceof DOMException?new _H("Invalid base64 string: "+a):a}})(e);return new Sr(t)}static fromUint8Array(e){const t=(function(s){let a="";for(let o=0;o<s.length;++o)a+=String.fromCharCode(s[o]);return a})(e);return new Sr(t)}[Symbol.iterator](){let e=0;return{next:()=>e<this.binaryString.length?{value:this.binaryString.charCodeAt(e++),done:!1}:{value:void 0,done:!0}}}toBase64(){return(function(t){return btoa(t)})(this.binaryString)}
1956toUint8Array(){return(function(t){const r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r})(this.binaryString)}approximateByteSize(){return 2*this.binaryString.length}compareTo(e){return Pt(this.binaryString,e.binaryString)}isEqual(e){return this.binaryString===e.binaryString}}Sr.EMPTY_BYTE_STRING=new Sr("");const koe=new RegExp(/^\d{4}-\d\d-\d\dT\d\d:\d\d:\d\d(?:\.(\d+))?Z$/);function $d(n){if(Ke(!!n,39018),typeof n=="string"){let e=0;const t=koe.exec(n);if(Ke(!!t,46558,{timestamp:n}),t[1]){let s=t[1];s=(s+"000000000").substr(0,9),e=Number(s)}const r=new Date(n);return{seconds:Math.floor(r.getTime()/1e3),nanos:e}}return{seconds:Cr(n.seconds),nanos:Cr(n.nanos)}}function Cr(n){return typeof n=="number"?n:typeof n=="string"?Number(n):0}function Hd(n){return typeof n=="string"?Sr.fromBase64String(n):Sr.fromUint8Array(n)}/**
1957 * @license
1958 * Copyright 2020 Google LLC
1959 *
1960 * Licensed under the Apache License, Version 2.0 (the "License");
1961 * you may not use this file except in compliance with the License.
1962 * You may obtain a copy of the License at
1963 *
1964 *   http://www.apache.org/licenses/LICENSE-2.0
1965 *
1966 * Unless required by applicable law or agreed to in writing, software
1967 * distributed under the License is distributed on an "AS IS" BASIS,
1968 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1969 * See the License for the specific language governing permissions and
1970 * limitations under the License.
1971 */const IH="server_timestamp",DH="__type__",jH="__previous_value__",RH="__local_write_time__";function nv(n){var t,r;return((r=(((t=n==null?void 0:n.mapValue)==null?void 0:t.fields)||{})[DH])==null?void 0:r.stringValue)===IH}function rv(n){const e=n.mapValue.fields[jH];return nv(e)?rv(e):e}function K0(n){const e=$d(n.mapValue.fields[RH].timestampValue);return new bn(e.seconds,e.nanos)}/**
1972 * @license
1973 * Copyright 2017 Google LLC
1974 *
1975 * Licensed under the Apache License, Version 2.0 (the "License");
1976 * you may not use this file except in compliance with the License.
1977 * You may obtain a copy of the License at
1978 *
1979 *   http://www.apache.org/licenses/LICENSE-2.0
1980 *
1981 * Unless required by applicable law or agreed to in writing, software
1982 * distributed under the License is distributed on an "AS IS" BASIS,
1983 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1984 * See the License for the specific language governing permissions and
1985 * limitations under the License.
1986 */class Noe{constructor(e,t,r,s,a,o,l,c,d,h,m,p,x){this.databaseId=e,this.appId=t,this.persistenceKey=r,this.host=s,this.ssl=a,this.forceLongPolling=o,this.autoDetectLongPolling=l,this.longPollingOptions=c,this.useFetchStreams=d,this.isUsingEmulator=h,this.apiKey=m,this._customHeaders=p,this.grpcFlowControlWindow=x}}const ry="(default)";class Ah{constructor(e,t){this.projectId=e,this.database=t||ry}static empty(){return new Ah("","")}get isDefaultDatabase(){return this.database===ry}isEqual(e){return e instanceof Ah&&e.projectId===this.projectId&&e.database===this.database}}function _oe(n,e){if(!Object.prototype.hasOwnProperty.apply(n.options,["projectId"]))throw new Fe(Te.INVALID_ARGUMENT,'"projectId" not provided in firebase.initializeApp.');return new Ah(n.options.projectId,e)}/**
1987 * @license
1988 * Copyright 2017 Google LLC
1989 *
1990 * Licensed under the Apache License, Version 2.0 (the "License");
1991 * you may not use this file except in compliance with the License.
1992 * You may obtain a copy of the License at
1993 *
1994 *   http://www.apache.org/licenses/LICENSE-2.0
1995 *
1996 * Unless required by applicable law or agreed to in writing, software
1997 * distributed under the License is distributed on an "AS IS" BASIS,
1998 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
1999 * See the License for the specific language governing permissions and
2000 * limitations under the License.
2001 */const xh=-1;function sv(n){return n==null}function W0(n){return n===0&&1/n==-1/0}function PH(n){return typeof n=="number"&&Number.isInteger(n)&&!W0(n)&&n<=Number.MAX_SAFE_INTEGER&&n>=Number.MIN_SAFE_INTEGER}function Ioe(n){return typeof n=="string"}/**
2002 * @license
2003 * Copyright 2020 Google LLC
2004 *
2005 * Licensed under the Apache License, Version 2.0 (the "License");
2006 * you may not use this file except in compliance with the License.
2007 * You may obtain a copy of the License at
2008 *
2009 *   http://www.apache.org/licenses/LICENSE-2.0
2010 *
2011 * Unless required by applicable law or agreed to in writing, software
2012 * distributed under the License is distributed on an "AS IS" BASIS,
2013 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2014 * See the License for the specific language governing permissions and
2015 * limitations under the License.
2016 */const zD="__type__",LH="__max__",ch={mapValue:{fields:{__type__:{stringValue:LH}}}},qD="__vector__",Cm="value",Ic={nullValue:"NULL_VALUE"},Yi={booleanValue:!0},fa={booleanValue:!1};function Us(n){return"nullValue"in n?0:"booleanValue"in n?1:"integerValue"in n||"doubleValue"in n?2:"timestampValue"in n?3:"stringValue"in n?5:"bytesValue"in n?6:"referenceValue"in n?7:"geoPointValue"in n?8:"arrayValue"in n?9:"mapValue"in n?nv(n)?4:OH(n)?9007199254740991:Sm(n)?10:11:ot(28295,{value:n})}function nl(n,e,t){if(n===e)return!0;const r=Us(n);if(r!==Us(e))return!1;switch(r){case 0:case 9007199254740991:return!0;case 1:return n.booleanValue===e.booleanValue;case 4:return K0(n).isEqual(K0(e));case 3:return(function(a,o){if(typeof a.timestampValue=="string"&&typeof o.timestampValue=="string"&&a.timestampValue.length===o.timestampValue.length)return a.timestampValue===o.timestampValue;const l=$d(a.timestampValue),c=$d(o.timestampValue);return l.seconds===c.seconds&&l.nanos===c.nanos})(n,e);case 5:return n.stringValue===e.stringValue;case 6:return(function(a,o){return Hd(a.bytesValue).isEqual(Hd(o.bytesValue))})(n,e);case 7:return n.referenceValue===e.referenceValue;case 8:return(function(a,o){return Cr(a.geoPointValue.latitude)===Cr(o.geoPointValue.latitude)&&Cr(a.geoPointValue.longitude)===Cr(o.geoPointValue.longitude)})(n,e);case 2:return(function(a,o,l){if("integerValue"in a&&"integerValue"in o)return Cr(a.integerValue)===Cr(o.integerValue);let c,d;if("doubleValue"in a&&"doubleValue"in o)c=Cr(a.doubleValue),d=Cr(o.doubleValue);else{if(!(l!=null&&l.i))return!1;c=Cr(a.integerValue??a.doubleValue),d=Cr(o.integerValue??o.doubleValue)}return c===d?!!(l!=null&&l.o)||W0(c)===W0(d):!!(l===void 0||l.u)&&isNaN(c)&&isNaN(d)})(n,e,t);case 9:return q0(n.arrayValue.values||[],e.arrayValue.values||[],((s,a)=>nl(s,a,t)));case 10:case 11:return(function(a,o,l){const c=a.mapValue.fields||{},d=o.mapValue.fields||{};if(HC(c)!==HC(d))return!1;for(const h in c)if(c.hasOwnProperty(h)&&(d[h]===void 0||!nl(c[h],d[h],l)))return!1;return!0})(n,e,t);default:return ot(52216,{left:n})}}function sy(n,e){return(n.values||[]).find((t=>nl(t,e)))!==void 0}function Ja(n,e){if(n===e)return 0;const t=Us(n),r=Us(e);if(t!==r)return Pt(t,r);switch(t){case 0:case 9007199254740991:return 0;case 1:return Pt(n.booleanValue,e.booleanValue);case 2:return(function(a,o){const l=Cr(a.integerValue||a.doubleValue),c=Cr(o.integerValue||o.doubleValue);return l<c?-1:l>c?1:l===c?0:isNaN(l)?isNaN(c)?0:-1:1})(n,e);case 3:return Y3(n.timestampValue,e.timestampValue);case 4:return Y3(K0(n),K0(e));case 5:return v_(n.stringValue,e.stringValue);case 6:return(function(a,o){const l=Hd(a),c=Hd(o);return l.compareTo(c)})(n.bytesValue,e.bytesValue);case 7:return(function(a,o){const l=a.split("/"),c=o.split("/");for(let d=0;d<l.length&&d<c.length;d++){const h=Pt(l[d],c[d]);if(h!==0)return h}return Pt(l.length,c.length)})(n.referenceValue,e.referenceValue);case 8:return(function(a,o){const l=Pt(Cr(a.latitude),Cr(o.latitude));return l!==0?l:Pt(Cr(a.longitude),Cr(o.longitude))})(n.geoPointValue,e.geoPointValue);case 9:return Q3(n.arrayValue,e.arrayValue);case 10:return(function(a,o){var p,x,y,v;const l=a.fields||{},c=o.fields||{},d=(p=l[Cm])==null?void 0:p.arrayValue,h=(x=c[Cm])==null?void 0:x.arrayValue,m=Pt(((y=d==null?void 0:d.values)==null?void 0:y.length)||0,((v=h==null?void 0:h.values)==null?void 0:v.length)||0);return m!==0?m:Q3(d,h)})(n.mapValue,e.mapValue);case 11:return(function(a,o){if(a===ch.mapValue&&o===ch.mapValue)return 0;if(a===ch.mapValue)return 1;if(o===ch.mapValue)return-1;const l=a.fields||{},c=Object.keys(l),d=o.fields||{},h=Object.keys(d);c.sort(),h.sort();for(let m=0;m<c.length&&m<h.length;++m){const p=v_(c[m],h[m]);if(p!==0)return p;const x=Ja(l[c[m]],d[h[m]]);if(x!==0)return x}return Pt(c.length,h.length)})(n.mapValue,e.mapValue);default:throw ot(23264,{l:t})}}function Y3(n,e){if(typeof n=="string"&&typeof e=="string"&&n.length===e.length)return Pt(n,e);const t=$d(n),r=$d(e),s=Pt(t.seconds,r.seconds);return s!==0?s:Pt(t.nanos,r.nanos)}function Q3(n,e){const t=n.values||[],r=e.values||[];for(let s=0;s<t.length&&s<r.length;++s){const a=Ja(t[s],r[s]);if(a!==void 0&&a!==0)return a}return Pt(t.length,r.length)}function Y0(n){return B_(n)}function B_(n){return"nullValue"in n?"null":"booleanValue"in n?""+n.booleanValue:"integerValue"in n?""+n.integerValue:"doubleValue"in n?""+n.doubleValue:"timestampValue"in n?(function(t){const r=$d(t);return`time(${r.seconds},${r.nanos})`})(n.timestampValue):"stringValue"in n?n.stringValue:"bytesValue"in n?(function(t){return Hd(t).toBase64()})(n.bytesValue):"referenceValue"in n?(function(t){return Je.fromName(t).toString()})(n.referenceValue):"geoPointValue"in n?(function(t){return`geo(${t.latitude},${t.longitude})`})(n.geoPointValue):"arrayValue"in n?(function(t){let r="[",s=!0;for(const a of t.values||[])s?s=!1:r+=",",r+=B_(a);return r+"]"})(n.arrayValue):"mapValue"in n?(function(t){const r=Object.keys(t.fields||{}).sort();let s="{",a=!0;for(const o of r)a?a=!1:s+=",",s+=`${o}:${B_(t.fields[o])}`;return s+"}"})(n.mapValue):ot(61005,{value:n})}function sC(n){switch(Us(n)){case 0:case 1:return 4;case 2:return 8;case 3:case 8:return 16;case 4:const e=rv(n);return e?16+sC(e):16;case 5:return 2*n.stringValue.length;case 6:return Hd(n.bytesValue).approximateByteSize();case 7:return n.referenceValue.length;case 9:return(function(r){return(r.values||[]).reduce(((s,a)=>s+sC(a)),0)})(n.arrayValue);case 10:case 11:return(function(r){let s=0;return qh(r.fields,((a,o)=>{s+=a.length+sC(o)})),s})(n.mapValue);default:throw ot(13486,{value:n})}}function Em(n,e){return{referenceValue:`projects/${n.projectId}/databases/${n.database}/documents/${e.path.canonicalString()}`}}function xc(n){return!!n&&"integerValue"in n}function Jf(n){return!!n&&"doubleValue"in n}function kh(n){return xc(n)||Jf(n)}function Nh(n){return!!n&&"arrayValue"in n}function yo(n){return!!n&&"nullValue"in n}function Qi(n){return!!n&&"doubleValue"in n&&isNaN(Number(n.doubleValue))}function lm(n){return!!n&&"mapValue"in n}function Sm(n){var t,r;return((r=(((t=n==null?void 0:n.mapValue)==null?void 0:t.fields)||{})[zD])==null?void 0:r.stringValue)===qD}function w_(n){var e,t;return(t=(((e=n==null?void 0:n.mapValue)==null?void 0:e.fields)||{})[Cm])==null?void 0:t.arrayValue}function Ib(n){if(n.geoPointValue)return{geoPointValue:{...n.geoPointValue}};if(n.timestampValue&&typeof n.timestampValue=="object")return{timestampValue:{...n.timestampValue}};if(n.mapValue){const e={mapValue:{fields:{}}};return qh(n.mapValue.fields,((t,r)=>e.mapValue.fields[t]=Ib(r))),e}if(n.arrayValue){const e={arrayValue:{values:[]}};for(let t=0;t<(n.arrayValue.values||[]).length;++t)e.arrayValue.values[t]=Ib(n.arrayValue.values[t]);return e}return{...n}}function OH(n){return(((n.mapValue||{}).fields||{}).__type__||{}).stringValue===LH}const MH={mapValue:{fields:{[zD]:{stringValue:qD},[Cm]:{arrayValue:{}}}}};function Doe(n){return"nullValue"in n?Ic:"booleanValue"in n?{booleanValue:!1}:"integerValue"in n||"doubleValue"in n?{doubleValue:NaN}:"timestampValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"stringValue"in n?{stringValue:""}
vendor: 6,928 bytes, lines 2016-2076
2016:"bytesValue"in n?{bytesValue:""}:"referenceValue"in n?Em(Ah.empty(),Je.empty()):"geoPointValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"arrayValue"in n?{arrayValue:{}}:"mapValue"in n?Sm(n)?MH:{mapValue:{}}:ot(35942,{value:n})}function joe(n){return"nullValue"in n?{booleanValue:!1}:"booleanValue"in n?{doubleValue:NaN}:"integerValue"in n||"doubleValue"in n?{timestampValue:{seconds:Number.MIN_SAFE_INTEGER}}:"timestampValue"in n?{stringValue:""}:"stringValue"in n?{bytesValue:""}:"bytesValue"in n?Em(Ah.empty(),Je.empty()):"referenceValue"in n?{geoPointValue:{latitude:-90,longitude:-180}}:"geoPointValue"in n?{arrayValue:{}}:"arrayValue"in n?MH:"mapValue"in n?Sm(n)?{mapValue:{}}:ch:ot(61959,{value:n})}function J3(n,e){const t=Ja(n.value,e.value);return t!==0?t:n.inclusive&&!e.inclusive?-1:!n.inclusive&&e.inclusive?1:0}function X3(n,e){const t=Ja(n.value,e.value);return t!==0?t:n.inclusive&&!e.inclusive?1:!n.inclusive&&e.inclusive?-1:0}/**
2017 * @license
2018 * Copyright 2017 Google LLC
2019 *
2020 * Licensed under the Apache License, Version 2.0 (the "License");
2021 * you may not use this file except in compliance with the License.
2022 * You may obtain a copy of the License at
2023 *
2024 *   http://www.apache.org/licenses/LICENSE-2.0
2025 *
2026 * Unless required by applicable law or agreed to in writing, software
2027 * distributed under the License is distributed on an "AS IS" BASIS,
2028 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2029 * See the License for the specific language governing permissions and
2030 * limitations under the License.
2031 */class Ws{constructor(e){this.value=e}static empty(){return new Ws({mapValue:{}})}field(e){if(e.isEmpty())return this.value;{let t=this.value;for(let r=0;r<e.length-1;++r)if(t=(t.mapValue.fields||{})[e.get(r)],!lm(t))return null;return t=(t.mapValue.fields||{})[e.lastSegment()],t||null}}set(e,t){this.getFieldsMap(e.popLast())[e.lastSegment()]=Ib(t)}setAll(e){let t=Es.emptyPath(),r={},s=[];e.forEach(((o,l)=>{if(!t.isImmediateParentOf(l)){const c=this.getFieldsMap(t);this.applyChanges(c,r,s),r={},s=[],t=l.popLast()}o?r[l.lastSegment()]=Ib(o):s.push(l.lastSegment())}));const a=this.getFieldsMap(t);this.applyChanges(a,r,s)}delete(e){const t=this.field(e.popLast());lm(t)&&t.mapValue.fields&&delete t.mapValue.fields[e.lastSegment()]}isEqual(e){return nl(this.value,e.value)}getFieldsMap(e){let t=this.value;t.mapValue.fields||(t.mapValue={fields:{}});for(let r=0;r<e.length;++r){let s=t.mapValue.fields[e.get(r)];lm(s)&&s.mapValue.fields||(s={mapValue:{fields:{}}},t.mapValue.fields[e.get(r)]=s),t=s}return t.mapValue.fields}applyChanges(e,t,r){qh(t,((s,a)=>e[s]=a));for(const s of r)delete e[s]}clone(){return new Ws(Ib(this.value))}}function FH(n){const e=[];return qh(n.fields,((t,r)=>{const s=new Es([t]);if(lm(r)){const a=FH(r.mapValue).fields;if(a.length===0)e.push(s);else for(const o of a)e.push(s.child(o))}else e.push(s)})),new Vi(e)}/**
2032 * @license
2033 * Copyright 2020 Google LLC
2034 *
2035 * Licensed under the Apache License, Version 2.0 (the "License");
2036 * you may not use this file except in compliance with the License.
2037 * You may obtain a copy of the License at
2038 *
2039 *   http://www.apache.org/licenses/LICENSE-2.0
2040 *
2041 * Unless required by applicable law or agreed to in writing, software
2042 * distributed under the License is distributed on an "AS IS" BASIS,
2043 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2044 * See the License for the specific language governing permissions and
2045 * limitations under the License.
2046 */function _1(n,e){if(n.useProto3Json){if(isNaN(e))return{doubleValue:"NaN"};if(e===1/0)return{doubleValue:"Infinity"};if(e===-1/0)return{doubleValue:"-Infinity"}}return{doubleValue:W0(e)?"-0":e}}function KD(n){return{integerValue:""+n}}function jg(n,e,t){return PH(e)?KD(e):_1(n,e)}/**
2047 * @license
2048 * Copyright 2018 Google LLC
2049 *
2050 * Licensed under the Apache License, Version 2.0 (the "License");
2051 * you may not use this file except in compliance with the License.
2052 * You may obtain a copy of the License at
2053 *
2054 *   http://www.apache.org/licenses/LICENSE-2.0
2055 *
2056 * Unless required by applicable law or agreed to in writing, software
2057 * distributed under the License is distributed on an "AS IS" BASIS,
2058 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2059 * See the License for the specific language governing permissions and
2060 * limitations under the License.
2061 */class I1{constructor(){this._=void 0}}function Roe(n,e,t){return n instanceof Q0?(function(s,a){const o={fields:{[DH]:{stringValue:IH},[RH]:{timestampValue:{seconds:s.seconds,nanos:s.nanoseconds}}}};return a&&nv(a)&&(a=rv(a)),a&&(o.fields[jH]=a),{mapValue:o}})(t,e):n instanceof Tm?VH(n,e):n instanceof Am?GH(n,e):n instanceof km?(function(s,a){const o=UH(s,a),l=zC(o)+zC(s.h);return xc(o)&&xc(s.h)?KD(l):_1(s.serializer,l)})(n,e):n instanceof J0?(function(s,a){return Z3(s,a,Math.min)})(n,e):n instanceof X0?(function(s,a){return Z3(s,a,Math.max)})(n,e):void 0}function Poe(n,e,t){return n instanceof Tm?VH(n,e):n instanceof Am?GH(n,e):t}function UH(n,e){return n instanceof km?kh(e)?e:{integerValue:0}:null}class Q0 extends I1{}class Tm extends I1{constructor(e){super(),this.elements=e}}function VH(n,e){const t=$H(e);for(const r of n.elements)t.some((s=>nl(s,r)))||t.push(r);return{arrayValue:{values:t}}}class Am extends I1{constructor(e){super(),this.elements=e}}function GH(n,e){let t=$H(e);for(const r of n.elements)t=t.filter((s=>!nl(s,r)));return{arrayValue:{values:t}}}class WD extends I1{constructor(e,t){super(),this.serializer=e,this.h=t}}class km extends WD{}class J0 extends WD{}class X0 extends WD{}function Z3(n,e,t){if(!kh(e))return n.h;const r=t(zC(e),zC(n.h));return xc(e)&&xc(n.h)?KD(r):_1(n.serializer,r)}function zC(n){return Cr(n.integerValue||n.doubleValue)}function $H(n){return Nh(n)&&n.arrayValue.values?n.arrayValue.values.slice():[]}/**
2062 * @license
2063 * Copyright 2017 Google LLC
2064 *
2065 * Licensed under the Apache License, Version 2.0 (the "License");
2066 * you may not use this file except in compliance with the License.
2067 * You may obtain a copy of the License at
2068 *
2069 *   http://www.apache.org/licenses/LICENSE-2.0
2070 *
2071 * Unless required by applicable law or agreed to in writing, software
2072 * distributed under the License is distributed on an "AS IS" BASIS,
2073 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2074 * See the License for the specific language governing permissions and
2075 * limitations under the License.
2076 */class zm{constructor(e,t){this.field=e,this.transform=t}}function Loe(n,e){return n.field.isEqual(e.field)&&(function(r,s){return r instanceof Tm&&s instanceof Tm||r instanceof Am&&s instanceof Am?q0(r.elements,s.elements,nl):r instanceof km&&s instanceof km||r instanceof J0&&s instanceof J0||r instanceof X0&&s instanceof X0?nl(r.h,s.h):r instanceof Q0&&s instanceof Q0})(n.transform,e.transform)}class Ooe{constructor(e,t){this.version=e,this.transformResults=t}}
2076class zr{constructor(e,t){this.updateTime=e,this.exists=t}static none(){return new zr}static exists(e){return new zr(void 0,e)}static updateTime(e){return new zr(e)}get isNone(){return this.updateTime===void 0&&this.exists===void 0}isEqual(e){return this.exists===e.exists&&(this.updateTime?!!e.updateTime&&this.updateTime.isEqual(e.updateTime):!e.updateTime)}}function aC(n,e){return n.updateTime!==void 0?e.isFoundDocument()&&e.version.isEqual(n.updateTime):n.exists===void 0||n.exists===e.isFoundDocument()}class D1{}function HH(n,e){if(!n.hasLocalMutations||e&&e.fields.length===0)return null;if(e===null)return n.isNoDocument()?new Pg(n.key,zr.none()):new Rg(n.key,n.data,zr.none());{const t=n.data,r=Ws.empty();let s=new Un(Es.comparator);for(let a of e.fields)if(!s.has(a)){let o=t.field(a);o===null&&a.length>1&&(a=a.popLast(),o=t.field(a)),o===null?r.delete(a):r.set(a,o),s=s.add(a)}return new tu(n.key,r,new Vi(s.toArray()),zr.none())}}function Moe(n,e,t){n instanceof Rg?(function(s,a,o){const l=s.value.clone(),c=t4(s.fieldTransforms,a,o.transformResults);l.setAll(c),a.convertToFoundDocument(o.version,l).setHasCommittedMutations()})(n,e,t):n instanceof tu?(function(s,a,o){if(!aC(s.precondition,a))return void a.convertToUnknownDocument(o.version);const l=t4(s.fieldTransforms,a,o.transformResults),c=a.data;c.setAll(zH(s)),c.setAll(l),a.convertToFoundDocument(o.version,c).setHasCommittedMutations()})(n,e,t):(function(s,a,o){a.convertToNoDocument(o.version).setHasCommittedMutations()})(0,e,t)}function Db(n,e,t,r){return n instanceof Rg?(function(a,o,l,c){if(!aC(a.precondition,o))return l;const d=a.value.clone(),h=n4(a.fieldTransforms,c,o);return d.setAll(h),o.convertToFoundDocument(o.version,d).setHasLocalMutations(),null})(n,e,t,r):n instanceof tu?(function(a,o,l,c){if(!aC(a.precondition,o))return l;const d=n4(a.fieldTransforms,c,o),h=o.data;return h.setAll(zH(a)),h.setAll(d),o.convertToFoundDocument(o.version,h).setHasLocalMutations(),l===null?null:l.unionWith(a.fieldMask.fields).unionWith(a.fieldTransforms.map((m=>m.field)))})(n,e,t,r):(function(a,o,l){return aC(a.precondition,o)?(o.convertToNoDocument(o.version).setHasLocalMutations(),null):l})(n,e,t)}function Foe(n,e){let t=null;for(const r of n.fieldTransforms){const s=e.data.field(r.field),a=UH(r.transform,s||null);a!=null&&(t===null&&(t=Ws.empty()),t.set(r.field,a))}return t||null}function e4(n,e){return n.type===e.type&&!!n.key.isEqual(e.key)&&!!n.precondition.isEqual(e.precondition)&&!!(function(r,s){return r===void 0&&s===void 0||!(!r||!s)&&q0(r,s,((a,o)=>Loe(a,o)))})(n.fieldTransforms,e.fieldTransforms)&&(n.type===0?n.value.isEqual(e.value):n.type!==1||n.data.isEqual(e.data)&&n.fieldMask.isEqual(e.fieldMask))}class Rg extends D1{constructor(e,t,r,s=[]){super(),this.key=e,this.value=t,this.precondition=r,this.fieldTransforms=s,this.type=0}getFieldMask(){return null}}class tu extends D1{constructor(e,t,r,s,a=[]){super(),this.key=e,this.data=t,this.fieldMask=r,this.precondition=s,this.fieldTransforms=a,this.type=1}getFieldMask(){return this.fieldMask}}function zH(n){const e=new Map;return n.fieldMask.fields.forEach((t=>{if(!t.isEmpty()){const r=n.data.field(t);e.set(t,r)}})),e}function t4(n,e,t){const r=new Map;Ke(n.length===t.length,32656,{T:t.length,P:n.length});for(let s=0;s<t.length;s++){const a=n[s],o=a.transform,l=e.data.field(a.field);r.set(a.field,Poe(o,l,t[s]))}return r}function n4(n,e,t){const r=new Map;for(const s of n){const a=s.transform,o=t.data.field(s.field);r.set(s.field,Roe(a,o,e))}return r}class Pg extends D1{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=2,this.fieldTransforms=[]}getFieldMask(){return null}}class YD extends D1{constructor(e,t){super(),this.key=e,this.precondition=t,this.type=3,this.fieldTransforms=[]}getFieldMask(){return null}}/**
2077 * @license
2078 * Copyright 2022 Google LLC
2079 *
2080 * Licensed under the Apache License, Version 2.0 (the "License");
2081 * you may not use this file except in compliance with the License.
2082 * You may obtain a copy of the License at
2083 *
2084 *   http://www.apache.org/licenses/LICENSE-2.0
2085 *
2086 * Unless required by applicable law or agreed to in writing, softw
2086are
2087 * distributed under the License is distributed on an "AS IS" BASIS,
2088 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2089 * See the License for the specific language governing permissions and
2090 * limitations under the License.
2091 */class _h{constructor(e,t){this.position=e,this.inclusive=t}}function r4(n,e,t){let r=0;for(let s=0;s<n.position.length;s++){const a=e[s],o=n.position[s];if(a.field.isKeyField()?r=Je.comparator(Je.fromName(o.referenceValue),t.key):r=Ja(o,t.data.field(a.field)),a.dir==="desc"&&(r*=-1),r!==0)break}return r}function s4(n,e){if(n===null)return e===null;if(e===null||n.inclusive!==e.inclusive||n.position.length!==e.position.length)return!1;for(let t=0;t<n.position.length;t++)if(!nl(n.position[t],e.position[t]))return!1;return!0}/**
2092 * @license
2093 * Copyright 2022 Google LLC
2094 *
2095 * Licensed under the Apache License, Version 2.0 (the "License");
2096 * you may not use this file except in compliance with the License.
2097 * You may obtain a copy of the License at
2098 *
2099 *   http://www.apache.org/licenses/LICENSE-2.0
2100 *
2101 * Unless required by applicable law or agreed to in writing, software
2102 * distributed under the License is distributed on an "AS IS" BASIS,
2103 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2104 * See the License for the specific language governing permissions and
2105 * limitations under the License.
2106 */class qH{}class ln extends qH{constructor(e,t,r){super(),this.field=e,this.op=t,this.value=r}static create(e,t,r){return e.isKeyField()?t==="in"||t==="not-in"?this.createKeyFieldInFilter(e,t,r):new Uoe(e,t,r):t==="array-contains"?new $oe(e,r):t==="in"?new XH(e,r):t==="not-in"?new Hoe(e,r):t==="array-contains-any"?new zoe(e,r):new ln(e,t,r)}static createKeyFieldInFilter(e,t,r){return t==="in"?new Voe(e,r):new Goe(e,r)}matches(e){const t=e.data.field(this.field);return this.op==="!="?t!==null&&t.nullValue===void 0&&this.matchesComparison(Ja(t,this.value)):t!==null&&Us(this.value)===Us(t)&&this.matchesComparison(Ja(t,this.value))}matchesComparison(e){switch(this.op){case"<":return e<0;case"<=":return e<=0;case"==":return e===0;case"!=":return e!==0;case">":return e>0;case">=":return e>=0;default:return ot(47266,{operator:this.op})}}isInequality(){return["<","<=",">",">=","!=","not-in"].indexOf(this.op)>=0}getFlattenedFilters(){return[this]}getFilters(){return[this]}}class Wn extends qH{constructor(e,t){super(),this.filters=e,this.op=t,this.I=null}static create(e,t){return new Wn(e,t)}matches(e){return Z0(this)?this.filters.find((t=>!t.matches(e)))===void 0:this.filters.find((t=>t.matches(e)))!==void 0}getFlattenedFilters(){return this.I!==null||(this.I=this.filters.reduce(((e,t)=>e.concat(t.getFlattenedFilters())),[])),this.I}getFilters(){return Object.assign([],this.filters)}}function Z0(n){return n.op==="and"}function C_(n){return n.op==="or"}function QD(n){return KH(n)&&Z0(n)}function KH(n){for(const e of n.filters)if(e instanceof Wn)return!1;return!0}function E_(n){if(n instanceof ln)return n.field.canonicalString()+n.op.toString()+Y0(n.value);if(QD(n))return n.filters.map((e=>E_(e))).join(",");{const e=n.filters.map((t=>E_(t))).join(",");return`${n.op}(${e})`}}function WH(n,e){return n instanceof ln?(function(r,s){return s instanceof ln&&r.op===s.op&&r.field.isEqual(s.field)&&nl(r.value,s.value)})(n,e):n instanceof Wn?(function(r,s){return s instanceof Wn&&r.op===s.op&&r.filters.length===s.filters.length?r.filters.reduce(((a,o,l)=>a&&WH(o,s.filters[l])),!0):!1})(n,e):void ot(19439)}function YH(n,e){const t=n.filters.concat(e);return Wn.create(t,n.op)}function QH(n){return n instanceof ln?(function(t){return`${t.field.canonicalString()} ${t.op} ${Y0(t.value)}`})(n):n instanceof Wn?(function(t){return t.op.toString()+" {"+t.getFilters().map(QH).join(" ,")+"}"})(n):"Filter"}class Uoe extends ln{constructor(e,t,r){super(e,t,r),this.key=Je.fromName(r.referenceValue)}matches(e){const t=Je.comparator(e.key,this.key);return this.matchesComparison(t)}}class Voe extends ln{constructor(e,t){super(e,"in",t),this.keys=JH("in",t)}matches(e){return this.keys.some((t=>t.isEqual(e.key)))}}class Goe extends ln{constructor(e,t){super(e,"not-in",t),this.keys=JH("not-in",t)}matches(e){return!this.keys.some((t=>t.isEqual(e.key)))}}function JH(n,e){var t;return(((t=e.arrayValue)==null?void 0:t.values)||[]).map((r=>Je.fromName(r.referenceValue)))}class $oe extends ln{constructor(e,t){super(e,"array-contains",t)}matches(e){const t=e.data.field(this.field);return Nh(t)&&sy(t.arrayValue,this.value)}}class XH extends ln{constructor(e,t){super(e,"in",t)}matches(e){const t=e.data.field(this.field);return t!==null&&sy(this.value.arrayValue,t)}}class Hoe extends ln{constructor(e,t){super(e,"not-in",t)}matches(e){if(sy(this.value.arrayValue,{nullValue:"NULL_VALUE"}))return!1;const t=e.data.field(this.field);return t!==null&&t.nullValue===void 0&&!sy(this.value.arrayValue,t)}}class zoe extends ln{constructor(e,t){super(e,"array-contains-any",t)}matches(e){const t=e.data.field(this.field);return!(!Nh(t)||!t.arrayValue.values)&&t.arrayValue.values.some((r=>sy(this.value.arrayValue,r)))}}/**
2107 * @license
2108 * Copyright 2022 Google LLC
2109 *
2110 * Licensed under the Apache License, Version 2.0 (the "License");
2111 * you may not use this file except in compliance with the License.
2112 * You may obtain a copy of the License at
2113 *
2114 *   http://www.apache.org/licenses/LICENSE-2.0
2115 *
2116 * Unless required by applicable law or agreed to in writing, software
2117 * distributed under the License is distributed on an "AS IS" BASIS,
2118 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2119 * See the License for the specific language governing permissions and
2120 * limitations under the License.
2121 */class ay{constructor(e,t="asc"){this.field=e,this.dir=t}}function qoe(n,e){return n.dir===e.dir&&n.field.isEqual(e.field)}/**
2122 * @license
2123 * Copyright 2017 Google LLC
2124 *
2125 * Licensed under the Apache License, Version 2.0 (the "License");
2126 * you may not use this file except in compliance with the License.
2127 * You may obtain a copy of the License at
2128 *
2129 *   http://www.apache.org/licenses/LICENSE-2.0
2130 *
2131 * Unless required by applicable law or agreed to in writing, software
2132 * distributed under the License is distributed on an "AS IS" BASIS,
2133 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2134 * See the License for the specific language governing permissions and
2135 * limitations under the License.
2136 */class wt{static fromTimestamp(e){return new wt(e)}static min(){return new wt(new bn(0,0))}static max(){return new wt(new bn(253402300799,999999999))}constructor(e){this.timestamp=e}compareTo(e){return this.timestamp._compareTo(e.timestamp)}isEqual(e){return this.timestamp.isEqual(e.timestamp)}toMicroseconds(){return 1e6*this.timestamp.seconds+this.timestamp.nanoseconds/1e3}toString(){return"SnapshotVersion("+this.timestamp.toString()+")"}toTimestamp(){return this.timestamp}}/**
2137 * @license
2138 * Copyright 2017 Google LLC
2139 *
2140 * Licensed under the Apache License, Version 2.0 (the "License");
2141 * you may not use this file except in compliance with the License.
2142 * You may obtain a copy of the License at
2143 *
2144 *   http://www.apache.org/licenses/LICENSE-2.0
2145 *
2146 * Unless required by applicable law or agreed to in writing, software
2147 * distributed under the License is distributed on an "AS IS" BASIS,
2148 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2149 * See the License for the specific language governing permissions and
2150 * limitations under the License.
2151 */class Pr{constructor(e,t,r,s,a,o,l){this.key=e,this.documentType=t,this.version=r,this.readTime=s,this.createTime=a,this.data=o,this.documentState=l}static newInvalidDocument(e){return new Pr(e,0,wt.min(),wt.min(),wt.min(),Ws.empty(),0)}static newFoundDocument(e,t,r,s){return new Pr(e,1,t,wt.min(),r,s,0)}static newNoDocument(e,t){return new Pr(e,2,t,wt.min(),wt.min(),Ws.empty(),0)}static newUnknownDocument(e,t){return new Pr(e,3,t,wt.min(),wt.min(),Ws.empty(),2)}convertToFoundDocument(e,t){return!this.createTime.isEqual(wt.min())||this.documentType!==2&&this.documentType!==0||(this.createTime=e),this.version=e,this.documentType=1,this.data=t,this.documentState=0,this}convertToNoDocument(e){return this.version=e,this.documentType=2,this.data=Ws.empty(),this.documentState=0,this}convertToUnknownDocument(e){return this.version=e,this.documentType=3,this.data=Ws.empty(),this.documentState=2,this}setHasCommittedMutations(){return this.documentState=2,this}setHasLocalMutations(){return this.documentState=1,this.version=wt.min(),this}setReadTime(e){return this.readTime=e,this}get hasLocalMutations(){return this.documentState===1}get hasCommittedMutations(){return this.documentState===2}get hasPendingWrites(){return this.hasLocalMutations||this.hasCommittedMutations}isValidDocument(){return this.documentType!==0}isFoundDocument(){return this.documentType===1}isNoDocument(){return this.documentType===2}isUnknownDocument(){return this.documentType===3}isEqual(e){return e instanceof Pr&&this.key.isEqual(e.key)&&this.version.isEqual(e.version)&&this.documentType===e.documentType&&this.documentState===e.documentState&&this.data.isEqual(e.data)}mutableCopy(){return new Pr(this.key,this.documentType,this.version,this.readTime,this.createTime,this.data.clone(),this.documentState)}toString(){return`Document(${this.key}, ${this.version}, ${JSON.stringify(this.data.value)}, {createTime: ${this.createTime}}), {documentType: ${this.documentType}}), {documentState: ${this.documentState}})`}}
2151/**
2152 * @license
2153 * Copyright 2021 Google LLC
2154 *
2155 * Licensed under the Apache License, Version 2.0 (the "License");
2156 * you may not use this file except in compliance with the License.
2157 * You may obtain a copy of the License at
2158 *
2159 *   http://www.apache.org/licenses/LICENSE-2.0
2160 *
2161 * Unless required by applicable law or agreed to in writing, software
2162 * distributed under the License is distributed on an "AS IS" BASIS,
2163 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2164 * See the License for the specific language governing permissions and
2165 * limitations under the License.
2166 */const eg=-1;class tg{constructor(e,t,r,s){this.indexId=e,this.collectionGroup=t,this.fields=r,this.indexState=s}}function S_(n){return n.fields.find((e=>e.kind===2))}function Rf(n){return n.fields.filter((e=>e.kind!==2))}function Koe(n,e){let t=Pt(n.collectionGroup,e.collectionGroup);if(t!==0)return t;for(let r=0;r<Math.min(n.fields.length,e.fields.length);++r)if(t=Woe(n.fields[r],e.fields[r]),t!==0)return t;return Pt(n.fields.length,e.fields.length)}tg.UNKNOWN_ID=-1;class cm{constructor(e,t){this.fieldPath=e,this.kind=t}}function Woe(n,e){const t=Es.comparator(n.fieldPath,e.fieldPath);return t!==0?t:Pt(n.kind,e.kind)}class ng{constructor(e,t){this.sequenceNumber=e,this.offset=t}static empty(){return new ng(0,Ao.min())}}function ZH(n,e){const t=n.toTimestamp().seconds,r=n.toTimestamp().nanoseconds+1,s=wt.fromTimestamp(r===1e9?new bn(t+1,0):new bn(t,r));return new Ao(s,Je.empty(),e)}function e7(n){return new Ao(n.readTime,n.key,eg)}class Ao{constructor(e,t,r){this.readTime=e,this.documentKey=t,this.largestBatchId=r}static min(){return new Ao(wt.min(),Je.empty(),eg)}static max(){return new Ao(wt.max(),Je.empty(),eg)}}function JD(n,e){let t=n.readTime.compareTo(e.readTime);return t!==0?t:(t=Je.comparator(n.documentKey,e.documentKey),t!==0?t:Pt(n.largestBatchId,e.largestBatchId))}/**
2167 * @license
2168 * Copyright 2019 Google LLC
2169 *
2170 * Licensed under the Apache License, Version 2.0 (the "License");
2171 * you may not use this file except in compliance with the License.
2172 * You may obtain a copy of the License at
2173 *
2174 *   http://www.apache.org/licenses/LICENSE-2.0
2175 *
2176 * Unless required by applicable law or agreed to in writing, software
2177 * distributed under the License is distributed on an "AS IS" BASIS,
2178 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2179 * See the License for the specific language governing permissions and
2180 * limitations under the License.
2181 */class Yoe{constructor(e,t=null,r=[],s=[],a=null,o=null,l=null){this.path=e,this.collectionGroup=t,this.orderBy=r,this.filters=s,this.limit=a,this.startAt=o,this.endAt=l,this.R=null}}function T_(n,e=null,t=[],r=[],s=null,a=null,o=null){return new Yoe(n,e,t,r,s,a,o)}function qC(n){const e=st(n);if(e.R===null){let t=e.path.canonicalString();e.collectionGroup!==null&&(t+="|cg:"+e.collectionGroup),t+="|f:",t+=e.filters.map((r=>E_(r))).join(","),t+="|ob:",t+=e.orderBy.map((r=>(function(a){return a.field.canonicalString()+a.dir})(r))).join(","),sv(e.limit)||(t+="|l:",t+=e.limit),e.startAt&&(t+="|lb:",t+=e.startAt.inclusive?"b:":"a:",t+=e.startAt.position.map((r=>Y0(r))).join(",")),e.endAt&&(t+="|ub:",t+=e.endAt.inclusive?"a:":"b:",t+=e.endAt.position.map((r=>Y0(r))).join(",")),e.R=t}return e.R}function XD(n,e){if(n.limit!==e.limit||n.orderBy.length!==e.orderBy.length)return!1;for(let t=0;t<n.orderBy.length;t++)if(!qoe(n.orderBy[t],e.orderBy[t]))return!1;if(n.filters.length!==e.filters.length)return!1;for(let t=0;t<n.filters.length;t++)if(!WH(n.filters[t],e.filters[t]))return!1;return n.collectionGroup===e.collectionGroup&&!!n.path.isEqual(e.path)&&!!s4(n.startAt,e.startAt)&&s4(n.endAt,e.endAt)}function Ed(n){return!!n.isCorePipeline}function ZD(n){return!!n.path&&Je.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}function KC(n,e){return n.filters.filter((t=>t instanceof ln&&t.field.isEqual(e)))}function a4(n,e,t){let r=Ic,s=!0;for(const a of KC(n,e)){let o=Ic,l=!0;switch(a.op){case"<":case"<=":o=Doe(a.value);break;case"==":case"in":case">=":o=a.value;break;case">":o=a.value,l=!1;break;case"!=":case"not-in":o=Ic}J3({value:r,inclusive:s},{value:o,inclusive:l})<0&&(r=o,s=l)}if(t!==null){for(let a=0;a<n.orderBy.length;++a)if(n.orderBy[a].field.isEqual(e)){const o=t.position[a];J3({value:r,inclusive:s},{value:o,inclusive:t.inclusive})<0&&(r=o,s=t.inclusive);break}}return{value:r,inclusive:s}}function i4(n,e,t){let r=ch,s=!0;for(const a of KC(n,e)){let o=ch,l=!0;switch(a.op){case">=":case">":o=joe(a.value),l=!1;break;case"==":case"in":case"<=":o=a.value;break;case"<":o=a.value,l=!1;break;case"!=":case"not-in":o=ch}X3({value:r,inclusive:s},{value:o,inclusive:l})>0&&(r=o,s=l)}if(t!==null){for(let a=0;a<n.orderBy.length;++a)if(n.orderBy[a].field.isEqual(e)){const o=t.position[a];X3({value:r,inclusive:s},{value:o,inclusive:t.inclusive})>0&&(r=o,s=t.inclusive);break}}return{value:r,inclusive:s}}/**
2182 * @license
2183 * Copyright 2017 Google LLC
2184 *
2185 * Licensed under the Apache License, Version 2.0 (the "License");
2186 * you may not use this file except in compliance with the License.
2187 * You may obtain a copy of the License at
2188 *
2189 *   http://www.apache.org/licenses/LICENSE-2.0
2190 *
2191 * Unless required by applicable law or agreed to in writing, software
2192 * distributed under the License is distributed on an "AS IS" BASIS,
2193 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2194 * See the License for the specific language governing permissions and
2195 * limitations under the License.
2196 */class nu{constructor(e,t=null,r=[],s=[],a=null,o="F",l=null,c=null){this.path=e,this.collectionGroup=t,this.explicitOrderBy=r,this.filters=s,this.limit=a,this.limitType=o,this.startAt=l,this.endAt=c,this.A=null,this.V=null,this.m=null,this.startAt,this.endAt}}function t7(n,e,t,r,s,a,o,l){return new nu(n,e,t,r,s,a,o,l)}function Lg(n){return new nu(n)}function o4(n){return n.filters.length===0&&n.limit===null&&n.startAt==null&&n.endAt==null&&(n.explicitOrderBy.length===0||n.explicitOrderBy.length===1&&n.explicitOrderBy[0].field.isKeyField())}function Qoe(n){return Je.isDocumentKey(n.path)&&n.collectionGroup===null&&n.filters.length===0}function ej(n){return n.collectionGroup!==null}function D0(n){const e=st(n);if(e.A===null){e.A=[];const t=new Set;for(const a of e.explicitOrderBy)e.A.push(a),t.add(a.field.canonicalString());const r=e.explicitOrderBy.length>0?e.explicitOrderBy[e.explicitOrderBy.length-1].dir:"asc";(function(o){let l=new Un(Es.comparator);return o.filters.forEach((c=>{c.getFlattenedFilters().forEach((d=>{d.isInequality()&&(l=l.add(d.field))}))})),l})(e).forEach((a=>{t.has(a.canonicalString())||a.isKeyField()||e.A.push(new ay(a,r))})),t.has(Es.keyField().canonicalString())||e.A.push(new ay(Es.keyField(),r))}return e.A}function Wa(n){const e=st(n);return e.V||(e.V=r7(e,D0(n))),e.V}function n7(n){const e=st(n);return e.m||(e.m=r7(e,n.explicitOrderBy)),e.m}function r7(n,e){if(n.limitType==="F")return T_(n.path,n.collectionGroup,e,n.filters,n.limit,n.startAt,n.endAt);{e=e.map((s=>{const a=s.dir==="desc"?"asc":"desc";return new ay(s.field,a)}));const t=n.endAt?new _h(n.endAt.position,n.endAt.inclusive):null,r=n.startAt?new _h(n.startAt.position,n.startAt.inclusive):null;return T_(n.path,n.collectionGroup,e,n.filters,n.limit,t,r)}}function A_(n,e){const t=n.filters.concat([e]);return new nu(n.path,n.collectionGroup,n.explicitOrderBy.slice(),t,n.limit,n.limitType,n.startAt,n.endAt)}function Joe(n,e){const t=n.explicitOrderBy.concat([e]);return new nu(n.path,n.collectionGroup,t,n.filters.slice(),n.limit,n.limitType,n.startAt,n.endAt)}function WC(n,e,t){return new nu(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),e,t,n.startAt,n.endAt)}function Xoe(n,e){return new nu(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),n.limit,n.limitType,e,n.endAt)}function Zoe(n,e){return new nu(n.path,n.collectionGroup,n.explicitOrderBy.slice(),n.filters.slice(),n.limit,n.limitType,n.startAt,e)}function s7(n,e){return XD(Wa(n),Wa(e))&&n.limitType===e.limitType}function jb(n){return`Query(target=${(function(t){let r=t.path.canonicalString();return t.collectionGroup!==null&&(r+=" collectionGroup="+t.collectionGroup),t.filters.length>0&&(r+=`, filters: [${t.filters.map((s=>QH(s))).join(", ")}]`),sv(t.limit)||(r+=", limit: "+t.limit),t.orderBy.length>0&&(r+=`, orderBy: [${t.orderBy.map((s=>(function(o){return`${o.field.canonicalString()} (${o.dir})`})(s))).join(", ")}]`),t.startAt&&(r+=", startAt: ",r+=t.startAt.inclusive?"b:":"a:",r+=t.startAt.position.map((s=>Y0(s))).join(",")),t.endAt&&(r+=", endAt: ",r+=t.endAt.inclusive?"a:":"b:",r+=t.endAt.position.map((s=>Y0(s))).join(",")),`Target(${r})`})(Wa(n))}; limitType=${n.limitType})`}function j1(n,e){return e.isFoundDocument()&&(function(r,s){const a=s.key.path;return r.collectionGroup!==null?s.key.hasCollectionId(r.collectionGroup)&&r.path.isPrefixOf(a):Je.isDocumentKey(r.path)?r.path.isEqual(a):r.path.isImmediateParentOf(a)})(n,e)&&(function(r,s){for(const a of D0(r))if(!a.field.isKeyField()&&s.data.field(a.field)===null)return!1;return!0})(n,e)&&(function(r,s){for(const a of r.filters)if(!a.matches(s))return!1;return!0})(n,e)&&(function(r,s){return!(r.startAt&&!(function(o,l,c){const d=r4(o,l,c);return o.inclusive?d<=0:d<0})(r.startAt,D0(r),s)||r.endAt&&!(function(o,l,c){const d=r4(o,l,c);return o.inclusive?d>=0:d>0})(r.endAt,D0(r),s))})(n,e)}function R1(n){return(e,t)=>{let r=!1;for(const s of D0(n)){const a=ele(s,e,t);if(a!==0)return a;r=r||s.field.isKeyField()}return 0}}function ele(n,e,t){const r=n.field.isKeyField()?Je.comparator(e.key,t.key):(function(a,o,l){const c=o.data.field(a),d=l.data.field(a);return c!==null&&d!==null?Ja(c,d):ot(42886)})(n.field,e,t);switch(n.dir){case"asc":return r;case"desc":return-1*r;default:return ot(19790,{direction:n.dir})}}/**
2197 * @license
2198 * Copyright 2017 Google LLC
2199 *
2200 * Licensed under the Apache License, Version 2.0 (the "License");
2201 * you may not use this file except in compliance with the License.
2202 * You may obtain a copy of the License at
2203 *
2204 *   http://www.apache.org/licenses/LICENSE-2.0
2205 *
2206 * Unless required by applicable law or agreed to in writing, software
2207 * distributed under the License is distributed on an "AS IS" BASIS,
2208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2209 * See the License for the specific language governing permissions and
2210 * limitations under the License.
2211 */class tle{constructor(e,t){this.count=e,this.unchangedNames=t}}/**
2212 * @license
2213 * Copyright 2017 Google LLC
2214 *
2215 * Licensed under the Apache License, Version 2.0 (the "License");
2216 * you may not use this file except in compliance with the License.
2217 * You may obtain a copy of the License at
2218 *
2219 *   http://www.apache.org/licenses/LICENSE-2.0
2220 *
2221 * Unless required by applicable law or agreed to in writing, software
2222 * distributed under the License is distributed on an "AS IS" BASIS,
2223 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2224 * See the License for the specific language governing permissions and
2225 * limitations under the License.
2226 */var Rs,gn;function a7(n){switch(n){case Te.OK:return ot(64938);case Te.CANCELLED:case Te.UNKNOWN:case Te.DEADLINE_EXCEEDED:case Te.RESOURCE_EXHAUSTED:case Te.INTERNAL:case Te.UNAVAILABLE:case Te.UNAUTHENTICATED:return!1;case Te.INVALID_ARGUMENT:case Te.NOT_FOUND:case Te.ALREADY_EXISTS:case Te.PERMISSION_DENIED:case Te.FAILED_PRECONDITION:case Te.ABORTED:case Te.OUT_OF_RANGE:case Te.UNIMPLEMENTED:case Te.DATA_LOSS:return!0;default:return ot(15467,{code:n})}}function i7(n){if(n===void 0)return Cs("GRPC error has no .code"),Te.UNKNOWN;switch(n){case Rs.OK:return Te.OK;case Rs.CANCELLED:return Te.CANCELLED;case Rs.UNKNOWN:return Te.UNKNOWN;case Rs.DEADLINE_EXCEEDED:return Te.DEADLINE_EXCEEDED;case Rs.RESOURCE_EXHAUSTED:return Te.RESOURCE_EXHAUSTED;case Rs.INTERNAL:return Te.INTERNAL;case Rs.UNAVAILABLE:return Te.UNAVAILABLE;case Rs.UNAUTHENTICATED:return Te.UNAUTHENTICATED;case Rs.INVALID_ARGUMENT:return Te.INVALID_ARGUMENT;case Rs.NOT_FOUND:return Te.NOT_FOUND;case Rs.ALREADY_EXISTS:return Te.ALREADY_EXISTS;case Rs.PERMISSION_DENIED:return Te.PERMISSION_DENIED;case Rs.FAILED_PRECONDITION:return Te.FAILED_PRECONDITION;case Rs.ABORTED:return Te.ABORTED;case Rs.OUT_OF_RANGE:return Te.OUT_OF_RANGE;case Rs.UNIMPLEMENTED:return Te.UNIMPLEMENTED;case Rs.DATA_LOSS:return Te.DATA_LOSS;default:return ot(39323,{code:n})}}(gn=Rs||(Rs={}))[gn.OK=0]="OK",gn[gn.CANCELLED=1]="CANCELLED",gn[gn.UNKNOWN=2]="UNKNOWN",gn[gn.INVALID_ARGUMENT=3]="INVALID_ARGUMENT",gn[gn.DEADLINE_EXCEEDED=4]="DEADLINE_EXCEEDED",gn[gn.NOT_FOUND=5]="NOT_FOUND",gn[gn.ALREADY_EXISTS=6]="ALREADY_EXISTS",gn[gn.PERMISSION_DENIED=7]="PERMISSION_DENIED",gn[gn.UNAUTHENTICATED=16]="UNAUTHENTICATED",gn[gn.RESOURCE_EXHAUSTED=8]="RESOURCE_EXHAUSTED",gn[gn.FAILED_PRECONDITION=9]="FAILED_PRECONDITION",gn[gn.ABORTED=10]="ABORTED",gn[gn.OUT_OF_RANGE=11]="OUT_OF_RANGE",gn[gn.UNIMPLEMENTED=12]="UNIMPLEMENTED",gn[gn.INTERNAL=13]="INTERNAL",gn[gn.UNAVAILABLE=14]="UNAVAILABLE",gn[gn.DATA_LOSS=15]="DATA_LOSS";/**
2227 * @license
2228 * Copyright 2017 Google LLC
2229 *
2230 * Licensed under the Apache License, Version 2.0 (the "License");
2231 * you may not use this file except in compliance with the License.
2232 * You may obtain a copy of the License at
2233 *
2234 *   http://www.apache.org/licenses/LICENSE-2.0
2235 *
2236 * Unless required by applicable law or agreed to in writing, software
2237 * distributed under the License is distributed on an "AS IS" BASIS,
2238 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2239 * See the License for the specific language governing permissions and
2240 * limitations under the License.
2241 */class ru{constructor(e,t){this.mapKeyFn=e,this.equalsFn=t,this.inner={},this.innerSize=0}get(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r!==void 0){for(const[s,a]of r)if(this.equalsFn(s,e))return a}}has(e){return this.get(e)!==void 0}set(e,t){const r=this.mapKeyFn(e),s=this.inner[r];if(s===void 0)return this.inner[r]=[[e,t]],void this.innerSize++;for(let a=0;a<s.length;a++)if(this.equalsFn(s[a][0],e))return void(s[a]=[e,t]);s.push([e,t]),this.innerSize++}delete(e){const t=this.mapKeyFn(e),r=this.inner[t];if(r===void 0)return!1;for(let s=0;s<r.length;s++)if(this.equalsFn(r[s][0],e))return r.length===1?delete this.inner[t]:r.splice(s,1),this.innerSize--,!0;return!1}forEach(e){qh(this.inner,((t,r)=>{for(const[s,a]of r)e(s,a)}))}isEmpty(){return AH(this.inner)}size(){return this.innerSize}}/**
2242 * @license
2243 * Copyright 2017 Google LLC
2244 *
2245 * Licensed under the Apache License, Version 2.0 (the "License");
2246 * you may not use this file except in compliance with the License.
2247 * You may obtain a copy of the License at
2248 *
2249 *   http://www.apache.org/licenses/LICENSE-2.0
2250 *
2251 * Unless required by applicable law or agreed to in writing, software
2252 * distributed under the License is distributed on an "AS IS" BASIS,
2253 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2254 * See the License for the specific language governing permissions and
2255 * limitations under the License.
2256 */const nle=new br(Je.comparator);function Os(){return nle}const o7=new br(Je.comparator);function Gf(...n){let e=o7;for(const t of n)e=e.insert(t.key,t);return e}function l7(n){let e=o7;return n.forEach(((t,r)=>e=e.insert(t,r.overlayedDocument))),e}function qo(){return Rb()}function c7(){return Rb()}function Rb(){return new ru((n=>n.toString()),((n,e)=>n.isEqual(e)))}const rle=new br(Je.comparator),sle=new Un(Je.comparator);function Ft(...n){let e=sle;for(const t of n)e=e.add(t);return e}const ale=new Un(Pt);function tj(){return ale}/**
2257 * @license
2258 * Copyright 2023 Google LLC
2259 *
2260 * Licensed under the Apache License, Version 2.0 (the "License");
2261 * you may not use this file except in compliance with the License.
2262 * You may obtain a copy of the License at
2263 *
2264 *   http://www.apache.org/licenses/LICENSE-2.0
2265 *
2266 * Unless required by applicable law or agreed to in writing, software
2267 * distributed under the License is distributed on an "AS IS" BASIS,
2268 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2269 * See the License for the specific language governing permissions and
2270 * limitations under the License.
2271 */let Pb=null;function ile(n){if(Pb)throw new Error("a TestingHooksSpi instance is already set");Pb=n}/**
2272 * @license
2273 * Copyright 2023 Google LLC
2274 *
2275 * Licensed under the Apache License, Version 2.0 (the "License");
2276 * you may not use this file except in compliance with the License.
2277 * You may obtain a copy of the License at
2278 *
2279 *   http://www.apache.org/licenses/LICENSE-2.0
2280 *
2281 * Unless required by applicable law or agreed to in writing, software
2282 * distributed under the License is distributed on an "AS IS" BASIS,
2283 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2284 * See the License for the specific language governing permissions and
2285 * limitations under the License.
2286 */function d7(){return new TextEncoder}/**
2287 * @license
2288 * Copyright 2022 Google LLC
2289 *
2290 * Licensed under the Apache License, Version 2.0 (the "License");
2291 * you may not use this file except in compliance with the License.
2292 * You may obtain a copy of the License at
2293 *
2294 *   http://www.apache.org/licenses/LICENSE-2.0
2295 *
2296 * Unless required by applicable law or agreed to in writing, software
2297 * distributed under the License is distributed on an "AS IS" BASIS,
2298 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2299 * See the License for the specific language governing permissions and
2300 * limitations under the License.
2301 */const ole=new gh([4294967295,4294967295],0);function l4(n){const e=d7().encode(n),t=new hH;return t.update(e),new Uint8Array(t.digest())}function c4(n){const e=new DataView(n.buffer),t=e.getUint32(0,!0),r=e.getUint32(4,!0),s=e.getUint32(8,!0),a=e.getUint32(12,!0);return[new gh([t,r],0),new gh([s,a],0)]}class nj{constructor(e,t,r){if(this.bitmap=e,this.padding=t,this.hashCount=r,t<0||t>=8)throw new wb(`Invalid padding: ${t}`);if(r<0)throw new wb(`Invalid hash count: ${r}`);if(e.length>0&&this.hashCount===0)throw new wb(`Invalid hash count: ${r}`);if(e.length===0&&t!==0)throw new wb(`Invalid padding when bitmap length is 0: ${t}`);this.p=8*e.length-t,this.S=gh.fromNumber(this.p)}v(e,t,r){let s=e.add(t.multiply(gh.fromNumber(r)));return s.compare(ole)===1&&(s=new gh([s.getBits(0),s.getBits(1)],0)),s.modulo(this.S).toNumber()}D(e){return!!(this.bitmap[Math.floor(e/8)]&1<<e%8)}mightContain(e){if(this.p===0)return!1;const t=l4(e),[r,s]=c4(t);for(let a=0;a<this.hashCount;a++){const o=this.v(r,s,a);if(!this.D(o))return!1}return!0}static create(e,t,r){const s=e%8==0?0:8-e%8,a=new Uint8Array(Math.ceil(e/8)),o=new nj(a,s,t);return r.forEach((l=>o.insert(l))),o}insert(e){if(this.p===0)return;const t=l4(e),[r,s]=c4(t);for(let a=0;a<this.hashCount;a++){const o=this.v(r,s,a);this.C(o)}}C(e){const t=Math.floor(e/8),r=e%8;this.bitmap[t]|=1<<r}}
vendor: 7,527 bytes, lines 2301-2331
2301class wb extends Error{constructor(){super(...arguments),this.name="BloomFilterError"}}/**
2302 * @license
2303 * Copyright 2017 Google LLC
2304 *
2305 * Licensed under the Apache License, Version 2.0 (the "License");
2306 * you may not use this file except in compliance with the License.
2307 * You may obtain a copy of the License at
2308 *
2309 *   http://www.apache.org/licenses/LICENSE-2.0
2310 *
2311 * Unless required by applicable law or agreed to in writing, software
2312 * distributed under the License is distributed on an "AS IS" BASIS,
2313 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2314 * See the License for the specific language governing permissions and
2315 * limitations under the License.
2316 */class Og{constructor(e,t,r,s,a,o){this.snapshotVersion=e,this.targetChanges=t,this.targetMismatches=r,this.documentUpdates=s,this.augmentedDocumentUpdates=a,this.resolvedLimboDocuments=o}static createSynthesizedRemoteEventForCurrentChange(e,t,r){const s=new Map;return s.set(e,av.createSynthesizedTargetChangeForCurrentChange(e,t,r)),new Og(wt.min(),s,new br(Pt),Os(),Os(),Ft())}}class av{constructor(e,t,r,s,a){this.resumeToken=e,this.current=t,this.addedDocuments=r,this.modifiedDocuments=s,this.removedDocuments=a}static createSynthesizedTargetChangeForCurrentChange(e,t,r){return new av(r,t,Ft(),Ft(),Ft())}}/**
2317 * @license
2318 * Copyright 2017 Google LLC
2319 *
2320 * Licensed under the Apache License, Version 2.0 (the "License");
2321 * you may not use this file except in compliance with the License.
2322 * You may obtain a copy of the License at
2323 *
2324 *   http://www.apache.org/licenses/LICENSE-2.0
2325 *
2326 * Unless required by applicable law or agreed to in writing, software
2327 * distributed under the License is distributed on an "AS IS" BASIS,
2328 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2329 * See the License for the specific language governing permissions and
2330 * limitations under the License.
2331 */class iC{constructor(e,t,r,s){this.F=e,this.removedTargetIds=t,this.key=r,this.O=s}}class u7{constructor(e,t){this.targetId=e,this.M=t}}class h7{constructor(e,t,r=Sr.EMPTY_BYTE_STRING,s=null){this.state=e,this.targetIds=t,this.resumeToken=r,this.cause=s}}class d4{constructor(e){this.targetId=e,this.N=0,this.L=u4(),this.B=Sr.EMPTY_BYTE_STRING,this.U=!1,this.k=!0}get current(){return this.U}get resumeToken(){return this.B}get q(){return this.N!==0}get $(){return this.k}K(e){e.approximateByteSize()>0&&(this.k=!0,this.B=e)}W(){let e=Ft(),t=Ft(),r=Ft();return this.L.forEach(((s,a)=>{switch(a){case 0:e=e.add(s);break;case 2:t=t.add(s);break;case 1:r=r.add(s);break;default:ot(38017,{changeType:a})}})),new av(this.B,this.U,e,t,r)}G(){this.k=!1,this.L=u4()}j(e,t){this.k=!0,this.L=this.L.insert(e,t)}H(e){this.k=!0,this.L=this.L.remove(e)}J(){this.N+=1}Y(){this.N-=1,Ke(this.N>=0,3241,{N:this.N,targetId:this.targetId})}Z(){this.k=!0,this.U=!0}}const Jx="WatchChangeAggregator";class lle{constructor(e){this.X=e,this.ee=new Map,this.te=Os(),this.ne=rw(),this.re=Os(),this.ie=rw(),this.se=new br(Pt)}_e(e){for(const t of e.F)e.O&&e.O.isFoundDocument()?this.oe(t,e.O):this.ae(t,e.key,e.O);for(const t of e.removedTargetIds)this.ae(t,e.key,e.O)}ue(e){this.forEachTarget(e,(t=>{const r=this.ee.get(t);if(r)switch(e.state){case 0:this.ce(t)&&r.K(e.resumeToken);break;case 1:r.Y(),r.q||r.G(),r.K(e.resumeToken);break;case 2:r.Y(),r.q||this.removeTarget(t);break;case 3:this.ce(t)&&(r.Z(),r.K(e.resumeToken));break;case 4:this.ce(t)&&(this.le(t),r.K(e.resumeToken));break;default:ot(56790,{state:e.state})}else ze(Jx,`handleTargetChange received targetChange for untracked target ID (${t}) with state (${e.state})`)}))}forEachTarget(e,t){e.targetIds.length>0?e.targetIds.forEach(t):this.ee.forEach(((r,s)=>{this.ce(s)&&t(s)}))}Ee(e){var t;return Ed(e)?e.getPipelineSourceType()==="documents"&&((t=e.getPipelineDocuments())==null?void 0:t.length)===1:ZD(e)}he(e){const t=e.targetId,r=e.M.count,s=this.Te(t);if(s){const a=s.target;if(this.Ee(a))if(r===0){const o=new Je(Ed(a)?zt.fromString(a.getPipelineDocuments()[0]):a.path);this.ae(t,o,Pr.newNoDocument(o,wt.min()))}else Ke(r===1,20013,"Single document existence filter with count: "+r);else{const o=this.Pe(t);if(o!==r){const l=this.Ie(e),c=l?this.Re(l,e,o):1;if(c!==0){this.le(t);const d=c===2?"TargetPurposeExistenceFilterMismatchBloom":"TargetPurposeExistenceFilterMismatch";this.se=this.se.insert(t,d)}Pb==null||Pb.Ae((function(h,m,p,x,y){var E,N,T;const v={localCacheCount:h,existenceFilterCount:m.count,databaseId:p.database,projectId:p.projectId},B=m.unchangedNames;return B&&(v.bloomFilter={applied:y===0,hashCount:(B==null?void 0:B.hashCount)??0,bitmapLength:((N=(E=B==null?void 0:B.bits)==null?void 0:E.bitmap)==null?void 0:N.length)??0,padding:((T=B==null?void 0:B.bits)==null?void 0:T.padding)??0,mightContain:k=>(x==null?void 0:x.mightContain(k))??!1}),v})(o,e.M,this.X.Ve(),l,c))}}}}Ie(e){const t=e.M.unchangedNames;if(!t||!t.bits)return null;const{bits:{bitmap:r="",padding:s=0},hashCount:a=0}=t;let o,l;try{o=Hd(r).toUint8Array()}catch(c){if(c instanceof _H)return Xs("Decoding the base64 bloom filter in existence filter failed ("+c.message+"); ignoring the bloom filter and falling back to full re-query."),null;throw c}try{l=new nj(o,s,a)}catch(c){return Xs(c instanceof wb?"BloomFilter error: ":"Applying bloom filter failed: ",c),null}return l.p===0?null:l}Re(e,t,r){return t.M.count===r-this.de(e,t.targetId)?0:2}de(e,t){const r=this.X.getRemoteKeysForTarget(t);let s=0;return r.forEach((a=>{const o=this.X.Ve(),l=`projects/${o.projectId}/databases/${o.database}/documents/${a.path.canonicalString()}`;e.mightContain(l)||(this.ae(t,a,null),s++)})),s}fe(e){const t=new Map;this.ee.forEach(((a,o)=>{const l=this.Te(o);if(l){if(a.current&&this.Ee(l.target)){const c=Ed(l.target)?zt.fromString(l.target.getPipelineDocuments()[0]):l.target.path,d=new Je(c);this.me(d).has(o)||this.pe(o,d)||this.ae(o,d,Pr.newNoDocument(d,e))}a.$&&(t.set(o,a.W()),a.G())}}));let r=Ft();this.ie.forEach(((a,o)=>{let l=!0;o.forEachWhile((c=>{const d=this.Te(c);return!d||d.purpose==="TargetPurposeLimboResolution"||(l=!1,!1)})),l&&(r=r.add(a))})),this.te.forEach(((a,o)=>o.setReadTime(e))),this.re.forEach(((a,o)=>o.setReadTime(e)));const s=new Og(e,t,this.se,this.te,this.re,r);return this.te=Os(),this.ne=rw(),this.re=Os(),this.ie=rw(),this.se=new br(Pt),s}oe(e,t){const r=this.ee.get(e);if(!r||!this.ce(e))return void ze(Jx,`addDocumentToTarget received document for unknown inactive target (${e})`);const s=this.pe(e,t.key)?2:0;r.j(t.key,s),Ed(this.Te(e).target)&&this.Te(e).target.getPipelineFlavor()!=="exact"?this.re=this.re.insert(t.key,t):this.te=this.te.insert(t.key,t),this.ne=this.ne.insert(t.key,this.me(t.key).add(e)),this.ie=this.ie.insert(t.key,this.ge(t.key).add(e))}ae(e,t,r){const s=this.ee.get(e);s&&this.ce(e)?(this.pe(e,t)?s.j(t,1):s.H(t),this.ie=this.ie.insert(t,this.ge(t).delete(e)),this.ie=this.ie.insert(t,this.ge(t).add(e)),r&&(Ed(this.Te(e).target)&&this.Te(e).target.getPipelineFlavor()!=="exact"?this.re=this.re.insert(t,r):this.te=this.te.insert(t,r))):ze(Jx,`removeDocumentFromTarget received document for unknown or inactive target (${e})`)}removeTarget(e){this.ee.delete(e)}Pe(e){const t=this.ee.get(e);if(!t)return 0;const r=t.W();return this.X.getRemoteKeysForTarget(e).size+r.addedDocuments.size-r.removedDocuments.size}J(e){let t=this.ee.get(e);t||(ze(Jx,`recordPendingTargetRequest set up tracking for target ID ${e}`),t=new d4(e),this.ee.set(e,t)),t.J()}ge(e){let t=this.ie.get(e);return t||(t=new Un(Pt),this.ie=this.ie.insert(e,t)),t}
vendor: 6,627 bytes, line 2331
2331me(e){let t=this.ne.get(e);return t||(t=new Un(Pt),this.ne=this.ne.insert(e,t)),t}ce(e){const t=this.Te(e)!==null;return t||ze(Jx,"Detected inactive target",e),t}Te(e){const t=this.ee.get(e);return t===void 0||t.q?null:this.X.ye(e)}le(e){this.ee.set(e,new d4(e)),this.X.getRemoteKeysForTarget(e).forEach((t=>{this.ae(e,t,null)}))}pe(e,t){return this.X.getRemoteKeysForTarget(e).has(t)}}function rw(){return new br(Je.comparator)}function u4(){return new br(Je.comparator)}const cle={asc:"ASCENDING",desc:"DESCENDING"},dle={"<":"LESS_THAN","<=":"LESS_THAN_OR_EQUAL",">":"GREATER_THAN",">=":"GREATER_THAN_OR_EQUAL","==":"EQUAL","!=":"NOT_EQUAL","array-contains":"ARRAY_CONTAINS",in:"IN","not-in":"NOT_IN","array-contains-any":"ARRAY_CONTAINS_ANY"},ule={and:"AND",or:"OR"};class hle{constructor(e,t){this.databaseId=e,this.useProto3Json=t}}function k_(n,e){return n.useProto3Json||sv(e)?e:{value:e}}function dm(n,e){return n.useProto3Json?`${new Date(1e3*e.seconds).toISOString().replace(/\.\d*/,"").replace("Z","")}.${("000000000"+e.nanoseconds).slice(-9)}Z`:{seconds:""+e.seconds,nanos:e.nanoseconds}}function rj(n){const e=$d(n);return new bn(e.seconds,e.nanos)}function f7(n,e){return n.useProto3Json?e.toBase64():e.toUint8Array()}function oC(n,e){return dm(n,e.toTimestamp())}function Ss(n){return Ke(!!n,49232),wt.fromTimestamp(rj(n))}function sj(n,e){return N_(n,e).canonicalString()}function N_(n,e){const t=(function(s){return new zt(["projects",s.projectId,"databases",s.database])})(n).child("documents");return e===void 0?t:t.child(e)}function m7(n){const e=zt.fromString(n);return Ke(E7(e),10190,{key:e.toString()}),e}function rg(n,e){return sj(n.databaseId,e.path)}function Dc(n,e){const t=m7(e);if(t.get(1)!==n.databaseId.projectId)throw new Fe(Te.INVALID_ARGUMENT,"Tried to deserialize key from different project: "+t.get(1)+" vs "+n.databaseId.projectId);if(t.get(3)!==n.databaseId.database)throw new Fe(Te.INVALID_ARGUMENT,"Tried to deserialize key from different database: "+t.get(3)+" vs "+n.databaseId.database);return new Je(x7(t))}function p7(n,e){return sj(n.databaseId,e)}function g7(n){const e=m7(n);return e.length===4?zt.emptyPath():x7(e)}function __(n){return new zt(["projects",n.databaseId.projectId,"databases",n.databaseId.database]).canonicalString()}function x7(n){return Ke(n.length>4&&n.get(4)==="documents",29091,{key:n.toString()}),n.popFirst(5)}function h4(n,e,t){return{name:rg(n,e),fields:t.value.mapValue.fields}}function P1(n,e,t){const r=Dc(n,e.name),s=Ss(e.updateTime),a=e.createTime?Ss(e.createTime):wt.min(),o=new Ws({mapValue:{fields:e.fields}}),l=Pr.newFoundDocument(r,s,a,o);return t&&l.setHasCommittedMutations(),t?l.setHasCommittedMutations():l}function fle(n,e){return"found"in e?(function(r,s){Ke(!!s.found,43571),s.found.name,s.found.updateTime;const a=Dc(r,s.found.name),o=Ss(s.found.updateTime),l=s.found.createTime?Ss(s.found.createTime):wt.min(),c=new Ws({mapValue:{fields:s.found.fields}});return Pr.newFoundDocument(a,o,l,c)})(n,e):"missing"in e?(function(r,s){Ke(!!s.missing,3894),Ke(!!s.readTime,22933);const a=Dc(r,s.missing),o=Ss(s.readTime);return Pr.newNoDocument(a,o)})(n,e):ot(7234,{result:e})}function mle(n,e){let t;if("targetChange"in e){e.targetChange;const r=(function(d){return d==="NO_CHANGE"?0:d==="ADD"?1:d==="REMOVE"?2:d==="CURRENT"?3:d==="RESET"?4:ot(39313,{state:d})})(e.targetChange.targetChangeType||"NO_CHANGE"),s=e.targetChange.targetIds||[],a=(function(d,h){return d.useProto3Json?(Ke(h===void 0||typeof h=="string",58123),Sr.fromBase64String(h||"")):(Ke(h===void 0||h instanceof Buffer||h instanceof Uint8Array,16193),Sr.fromUint8Array(h||new Uint8Array))})(n,e.targetChange.resumeToken),o=e.targetChange.cause,l=o&&(function(d){const h=d.code===void 0?Te.UNKNOWN:i7(d.code);return new Fe(h,d.message||"")})(o);t=new h7(r,s,a,l||null)}else if("documentChange"in e){e.documentChange;const r=e.documentChange;r.document,r.document.name,r.document.updateTime;const s=Dc(n,r.document.name),a=Ss(r.document.updateTime),o=r.document.createTime?Ss(r.document.createTime):wt.min(),l=new Ws({mapValue:{fields:r.document.fields}}),c=Pr.newFoundDocument(s,a,o,l),d=r.targetIds||[],h=r.removedTargetIds||[];t=new iC(d,h,c.key,c)}else if("documentDelete"in e){e.documentDelete;const r=e.documentDelete;r.document;const s=Dc(n,r.document),a=r.readTime?Ss(r.readTime):wt.min(),o=Pr.newNoDocument(s,a),l=r.removedTargetIds||[];t=new iC([],l,o.key,o)}else if("documentRemove"in e){e.documentRemove;const r=e.documentRemove;r.document;const s=Dc(n,r.document),a=r.removedTargetIds||[];t=new iC([],a,s,null)}else{if(!("filter"in e))return ot(11601,{we:e});{e.filter;const r=e.filter;r.targetId;const{count:s=0,unchangedNames:a}=r,o=new tle(s,a),l=r.targetId;t=new u7(l,o)}}return t}function iy(n,e){let t;if(e instanceof Rg)t={update:h4(n,e.key,e.value)};else if(e instanceof Pg)t={delete:rg(n,e.key)};else if(e instanceof tu)t={update:h4(n,e.key,e.data),updateMask:vle(e.fieldMask)};else{if(!(e instanceof YD))return ot(16599,{be:e.type});t={verify:rg(n,e.key)}}return e.fieldTransforms.length>0&&(t.updateTransforms=e.fieldTransforms.map((r=>(function(a,o){const l=o.transform;if(l instanceof Q0)return{fieldPath:o.field.canonicalString(),setToServerValue:"REQUEST_TIME"};if(l instanceof Tm)return{fieldPath:o.field.canonicalString(),appendMissingElements:{values:l.elements}};if(l instanceof Am)return{fieldPath:o.field.canonicalString(),removeAllFromArray:{values:l.elements}};if(l instanceof km)return{fieldPath:o.field.canonicalString(),increment:l.h};if(l instanceof J0)return{fieldPath:o.field.canonicalString(),minimum:l.h};if(l instanceof X0)return{fieldPath:o.field.canonicalString(),maximum:l.h};throw ot(20930,{transform:o.transform})})(0,r)))),e.precondition.isNone||(t.currentDocument=(function(s,a){return a.updateTime!==void 0?{updateTime:oC(s,a.updateTime)}:a.exists!==void 0?{exists:a.exists}:ot(27497)})(n,e.precondition)),t}function I_(n,e){const t=e.currentDocument?(function(a){return a.updateTime!==void 0?zr.updateTime(Ss(a.updateTime)):a.exists!==void 0?zr.exists(a.exists):zr.none()})(e.currentDocument):zr.none(),r=e.updateTransforms?e.updateTransforms.map((s=>(function(o,l){let c=null;if("setToServerValue"in l)Ke(l.setToServerValue==="REQUEST_TIME",16630,{proto:l}),c=new Q0;else if("appendMissingElements"in l){const h=l.appendMissingElements.values||[];c=new Tm(h)}else if("removeAllFromArray"in l){const h=l.removeAllFromArray.values||[];c=new Am(h)}else"increment"in l?c=new km(o,l.increment):"minimum"in l?c=new J0(o,l.minimum):"maximum"in l?c=new X0(o,l.maximum):ot(16584,{proto:l});const d=Es.fromServerFormat(l.fieldPath);
2331return new zm(d,c)})(n,s))):[];if(e.update){e.update.name;const s=Dc(n,e.update.name),a=new Ws({mapValue:{fields:e.update.fields}});if(e.updateMask){const o=(function(c){const d=c.fieldPaths||[];return new Vi(d.map((h=>Es.fromServerFormat(h))))})(e.updateMask);return new tu(s,a,o,t,r)}return new Rg(s,a,t,r)}if(e.delete){const s=Dc(n,e.delete);return new Pg(s,t)}if(e.verify){const s=Dc(n,e.verify);return new YD(s,t)}return ot(1463,{proto:e})}function ple(n,e){return n&&n.length>0?(Ke(e!==void 0,14353),n.map((t=>(function(s,a){let o=s.updateTime?Ss(s.updateTime):Ss(a);return o.isEqual(wt.min())&&(o=Ss(a)),new Ooe(o,s.transformResults||[])})(t,e)))):[]}function b7(n,e){return{documents:[p7(n,e.path)]}}function L1(n,e){const t={structuredQuery:{}},r=e.path;let s;e.collectionGroup!==null?(s=r,t.structuredQuery.from=[{collectionId:e.collectionGroup,allDescendants:!0}]):(s=r.popLast(),t.structuredQuery.from=[{collectionId:r.lastSegment()}]),t.parent=p7(n,s);const a=(function(d){if(d.length!==0)return C7(Wn.create(d,"and"))})(e.filters);a&&(t.structuredQuery.where=a);const o=(function(d){if(d.length!==0)return d.map((h=>(function(p){return{field:ah(p.field),direction:xle(p.dir)}})(h)))})(e.orderBy);o&&(t.structuredQuery.orderBy=o);const l=k_(n,e.limit);return l!==null&&(t.structuredQuery.limit=l),e.startAt&&(t.structuredQuery.startAt=(function(d){return{before:d.inclusive,values:d.position}})(e.startAt)),e.endAt&&(t.structuredQuery.endAt=(function(d){return{before:!d.inclusive,values:d.position}})(e.endAt)),{Se:t,parent:s}}function y7(n,e,t,r){const{Se:s,parent:a}=L1(n,e),o={},l=[];let c=0;return t.forEach((d=>{const h=r?d.alias:"aggregate_"+c++;o[h]=d.alias,d.aggregateType==="count"?l.push({alias:h,count:{}}):d.aggregateType==="avg"?l.push({alias:h,avg:{field:ah(d.fieldPath)}}):d.aggregateType==="sum"&&l.push({alias:h,sum:{field:ah(d.fieldPath)}})})),{request:{structuredAggregationQuery:{aggregations:l,structuredQuery:s.structuredQuery},parent:s.parent},ve:o,parent:a}}function v7(n){let e=g7(n.parent);const t=n.structuredQuery,r=t.from?t.from.length:0;let s=null;if(r>0){Ke(r===1,65062);const h=t.from[0];h.allDescendants?s=h.collectionId:e=e.child(h.collectionId)}let a=[];t.where&&(a=(function(m){const p=w7(m);return p instanceof Wn&&QD(p)?p.getFilters():[p]})(t.where));let o=[];t.orderBy&&(o=(function(m){return m.map((p=>(function(y){return new ay(g0(y.field),(function(B){switch(B){case"ASCENDING":return"asc";case"DESCENDING":return"desc";default:return}})(y.direction))})(p)))})(t.orderBy));let l=null;t.limit&&(l=(function(m){let p;return p=typeof m=="object"?m.value:m,sv(p)?null:p})(t.limit));let c=null;t.startAt&&(c=(function(m){const p=!!m.before,x=m.values||[];return new _h(x,p)})(t.startAt));let d=null;return t.endAt&&(d=(function(m){const p=!m.before,x=m.values||[];return new _h(x,p)})(t.endAt)),t7(e,s,o,a,l,"F",c,d)}function gle(n,e){const t=(function(s){switch(s){case"TargetPurposeListen":return null;case"TargetPurposeExistenceFilterMismatch":return"existence-filter-mismatch";case"TargetPurposeExistenceFilterMismatchBloom":return"existence-filter-mismatch-bloom";case"TargetPurposeLimboResolution":return"limbo-document";default:return ot(28987,{purpose:s})}})(e.purpose);return t==null?null:{"goog-listen-tags":t}}function B7(n,e){return{structuredPipeline:{pipeline:{stages:e.stages.map((t=>t._toProto(n)))}}}}function w7(n){return n.unaryFilter!==void 0?(function(t){switch(t.unaryFilter.op){case"IS_NAN":const r=g0(t.unaryFilter.field);return ln.create(r,"==",{doubleValue:NaN});case"IS_NULL":const s=g0(t.unaryFilter.field);return ln.create(s,"==",{nullValue:"NULL_VALUE"});case"IS_NOT_NAN":const a=g0(t.unaryFilter.field);return ln.create(a,"!=",{doubleValue:NaN});case"IS_NOT_NULL":const o=g0(t.unaryFilter.field);return ln.create(o,"!=",{nullValue:"NULL_VALUE"});case"OPERATOR_UNSPECIFIED":return ot(61313);default:return ot(60726)}})(n):n.fieldFilter!==void 0?(function(t){return ln.create(g0(t.fieldFilter.field),(function(s){switch(s){case"EQUAL":return"==";case"NOT_EQUAL":return"!=";case"GREATER_THAN":return">";case"GREATER_THAN_OR_EQUAL":return">=";case"LESS_THAN":return"<";case"LESS_THAN_OR_EQUAL":return"<=";case"ARRAY_CONTAINS":return"array-contains";case"IN":return"in";case"NOT_IN":return"not-in";case"ARRAY_CONTAINS_ANY":return"array-contains-any";case"OPERATOR_UNSPECIFIED":return ot(58110);default:return ot(50506)}})(t.fieldFilter.op),t.fieldFilter.value)})(n):n.compositeFilter!==void 0?(function(t){return Wn.create(t.compositeFilter.filters.map((r=>w7(r))),(function(s){switch(s){case"AND":return"and";case"OR":return"or";default:return ot(1026)}})(t.compositeFilter.op))})(n):ot(30097,{filter:n})}function xle(n){return cle[n]}function ble(n){return dle[n]}function yle(n){return ule[n]}function ah(n){return{fieldPath:n.canonicalString()}}function g0(n){return Es.fromServerFormat(n.fieldPath)}function C7(n){return n instanceof ln?(function(t){if(t.op==="=="){if(Qi(t.value))return{unaryFilter:{field:ah(t.field),op:"IS_NAN"}};if(yo(t.value))return{unaryFilter:{field:ah(t.field),op:"IS_NULL"}}}else if(t.op==="!="){if(Qi(t.value))return{unaryFilter:{field:ah(t.field),op:"IS_NOT_NA
2331N"}};if(yo(t.value))return{unaryFilter:{field:ah(t.field),op:"IS_NOT_NULL"}}}return{fieldFilter:{field:ah(t.field),op:ble(t.op),value:t.value}}})(n):n instanceof Wn?(function(t){const r=t.getFilters().map((s=>C7(s)));return r.length===1?r[0]:{compositeFilter:{op:yle(t.op),filters:r}}})(n):ot(54877,{filter:n})}function vle(n){const e=[];return n.fields.forEach((t=>e.push(t.canonicalString()))),{fieldPaths:e}}function E7(n){return n.length>=4&&n.get(0)==="projects"&&n.get(2)==="databases"}function S7(n){return!!n&&typeof n._toProto=="function"&&n._protoValueType==="ProtoValue"}function oy(n,e){const t={fields:{}};return e.forEach(((r,s)=>{if(typeof s!="string")throw new Error(`Cannot encode map with non-string key: ${s}`);t.fields[s]=r._toProto(n)})),{mapValue:t}}function T7(n){return{stringValue:n}}/**
2332 * @license
2333 * Copyright 2020 Google LLC
2334 *
2335 * Licensed under the Apache License, Version 2.0 (the "License");
2336 * you may not use this file except in compliance with the License.
2337 * You may obtain a copy of the License at
2338 *
2339 *   http://www.apache.org/licenses/LICENSE-2.0
2340 *
2341 * Unless required by applicable law or agreed to in writing, software
2342 * distributed under the License is distributed on an "AS IS" BASIS,
2343 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2344 * See the License for the specific language governing permissions and
2345 * limitations under the License.
2346 */function qm(n){return new hle(n,!0)}/**
2347 * @license
2348 * Copyright 2020 Google LLC
2349 *
2350 * Licensed under the Apache License, Version 2.0 (the "License");
2351 * you may not use this file except in compliance with the License.
2352 * You may obtain a copy of the License at
2353 *
2354 *   http://www.apache.org/licenses/LICENSE-2.0
2355 *
2356 * Unless required by applicable law or agreed to in writing, software
2357 * distributed under the License is distributed on an "AS IS" BASIS,
2358 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2359 * See the License for the specific language governing permissions and
2360 * limitations under the License.
2361 */class Ui{constructor(e){this._byteString=e}static fromBase64String(e){try{return new Ui(Sr.fromBase64String(e))}catch(t){throw new Fe(Te.INVALID_ARGUMENT,"Failed to construct data from Base64 string: "+t)}}static fromUint8Array(e){return new Ui(Sr.fromUint8Array(e))}toBase64(){return this._byteString.toBase64()}toUint8Array(){return this._byteString.toUint8Array()}toString(){return"Bytes(base64: "+this.toBase64()+")"}isEqual(e){return this._byteString.isEqual(e._byteString)}toJSON(){return{type:Ui._jsonSchemaVersion,bytes:this.toBase64()}}static fromJSON(e){if(Hm(e,Ui._jsonSchema))return Ui.fromBase64String(e.bytes)}}Ui._jsonSchemaVersion="firestore/bytes/1.0",Ui._jsonSchema={type:Ms("string",Ui._jsonSchemaVersion),bytes:Ms("string")};/**
2362 * @license
2363 * Copyright 2020 Google LLC
2364 *
2365 * Licensed under the Apache License, Version 2.0 (the "License");
2366 * you may not use this file except in compliance with the License.
2367 * You may obtain a copy of the License at
2368 *
2369 *   http://www.apache.org/licenses/LICENSE-2.0
2370 *
2371 * Unless required by applicable law or agreed to in writing, software
2372 * distributed under the License is distributed on an "AS IS" BASIS,
2373 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2374 * See the License for the specific language governing permissions and
2375 * limitations under the License.
2376 */class Km{constructor(...e){for(let t=0;t<e.length;++t)if(e[t].length===0)throw new Fe(Te.INVALID_ARGUMENT,"Invalid field name at argument $(i + 1). Field names must not be empty.");this._internalPath=new Es(e)}isEqual(e){return this._internalPath.isEqual(e._internalPath)}}function A7(){return new Km(gc)}/**
2377 * @license
2378 * Copyright 2020 Google LLC
2379 *
2380 * Licensed under the Apache License, Version 2.0 (the "License");
2381 * you may not use this file except in compliance with the License.
2382 * You may obtain a copy of the License at
2383 *
2384 *   http://www.apache.org/licenses/LICENSE-2.0
2385 *
2386 * Unless required by applicable law or agreed to in writing, software
2387 * distributed under the License is distributed on an "AS IS" BASIS,
2388 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2389 * See the License for the specific language governing permissions and
2390 * limitations under the License.
2391 */class zc{constructor(e){this._methodName=e}}/**
2392 * @license
2393 * Copyright 2017 Google LLC
2394 *
2395 * Licensed under the Apache License, Version 2.0 (the "License");
2396 * you may not use this file except in compliance with the License.
2397 * You may obtain a copy of the License at
2398 *
2399 *   http://www.apache.org/licenses/LICENSE-2.0
2400 *
2401 * Unless required by applicable law or agreed to in writing, software
2402 * distributed under the License is distributed on an "AS IS" BASIS,
2403 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2404 * See the License for the specific language governing permissions and
2405 * limitations under the License.
2406 */class Fl{constructor(e,t){if(!isFinite(e)||e<-90||e>90)throw new Fe(Te.INVALID_ARGUMENT,"Latitude must be a number between -90 and 90, but was: "+e);if(!isFinite(t)||t<-180||t>180)throw new Fe(Te.INVALID_ARGUMENT,"Longitude must be a number between -180 and 180, but was: "+t);this._lat=e,this._long=t}get latitude(){return this._lat}get longitude(){return this._long}isEqual(e){return this._lat===e._lat&&this._long===e._long}_compareTo(e){return Pt(this._lat,e._lat)||Pt(this._long,e._long)}toJSON(){return{latitude:this._lat,longitude:this._long,type:Fl._jsonSchemaVersion}}static fromJSON(e){if(Hm(e,Fl._jsonSchema))return new Fl(e.latitude,e.longitude)}}Fl._jsonSchemaVersion="firestore/geoPoint/1.0",Fl._jsonSchema={type:Ms("string",Fl._jsonSchemaVersion),latitude:Ms("number"),longitude:Ms("number")};/**
2407 * @license
2408 * Copyright 2017 Google LLC
2409 *
2410 * Licensed under the Apache License, Version 2.0 (the "License");
2411 * you may not use this file except in compliance with the License.
2412 * You may obtain a copy of the License at
2413 *
2414 *   http://www.apache.org/licenses/LICENSE-2.0
2415 *
2416 * Unless required by applicable law or agreed to in writing, software
2417 * distributed under the License is distributed on an "AS IS" BASIS,
2418 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2419 * See the License for the specific language governing permissions and
2420 * limitations under the License.
2421 */let ha=class{constructor(e){this.uid=e}isAuthenticated(){return this.uid!=null}toKey(){return this.isAuthenticated()?"uid:"+this.uid:"anonymous-user"}isEqual(e){return e.uid===this.uid}};ha.UNAUTHENTICATED=new ha(null),ha.GOOGLE_CREDENTIALS=new ha("google-credentials-uid"),ha.FIRST_PARTY=new ha("first-party-uid"),ha.MOCK_USER=new ha("mock-user");/**
2422 * @license
2423 * Copyright 2017 Google LLC
2424 *
2425 * Licensed under the Apache License, Version 2.0 (the "License");
2426 * you may not use this file except in compliance with the License.
2427 * You may obtain a copy of the License at
2428 *
2429 *   http://www.apache.org/licenses/LICENSE-2.0
2430 *
2431 * Unless required by applicable law or agreed to in writing, software
2432 * distributed under the License is distributed on an "AS IS" BASIS,
2433 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2434 * See the License for the specific language governing permissions and
2435 * limitations under the License.
2436 */class ma{constructor(){this.promise=new Promise(((e,t)=>{this.resolve=e,this.reject=t}))}}/**
2437 * @license
2438 * Copyright 2017 Google LLC
2439 *
2440 * Licensed under the Apache License, Version 2.0 (the "License");
2441 * you may not use this file except in compliance with the License.
2442 * You may obtain a copy of the License at
2443 *
2444 *   http://www.apache.org/licenses/LICENSE-2.0
2445 *
2446 * Unless required by applicable law or agreed to in writing, software
2447 * distributed under the License is distributed on an "AS IS" BASIS,
2448 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2449 * See the License for the specific language governing permissions and
2450 * limitations under the License.
2451 */class k7{constructor(e,t){this.user=t,this.type="OAuth",this.headers=new Map,this.headers.set("Authorization",`Bearer ${e}`)}}class N7{getToken(){return Promise.resolve(null)}invalidateToken(){}start(e,t){e.enqueueRetryable((()=>t(ha.UNAUTHENTICATED)))}shutdown(){}}class Ble{constructor(e){this.token=e,this.changeListener=null}getToken(){return Promise.resolve(this.token)}invalidateToken(){}start(e,t){this.changeListener=t,e.enqueueRetryable((()=>t(this.token.user)))}shutdown(){this.changeListener=null}}class wle{constructor(e){this.De=e,this.currentUser=ha.UNAUTHENTICATED,this.xe=0,this.forceRefresh=!1,this.auth=null}start(e,t){Ke(this.Ce===void 0,42304);let r=this.xe;const s=c=>this.xe!==r?(r=this.xe,t(c)):Promise.resolve();let a=new ma;this.Ce=()=>{this.xe++,this.currentUser=this.Fe(),a.resolve(),a=new ma,e.enqueueRetryable((()=>s(this.currentUser)))};const o=()=>{const c=a;e.enqueueRetryable((async()=>{await c.promise,await s(this.currentUser)}))},l=c=>{ze("FirebaseAuthCredentialsProvider","Auth detected"),this.auth=c,this.Ce&&(this.auth.addAuthTokenListener(this.Ce),o())};this.De.onInit((c=>l(c))),setTimeout((()=>
vendor: 4,506 bytes, lines 2451-2481
2451{if(!this.auth){const c=this.De.getImmediate({optional:!0});c?l(c):(ze("FirebaseAuthCredentialsProvider","Auth not yet detected"),a.resolve(),a=new ma)}}),0),o()}getToken(){const e=this.xe,t=this.forceRefresh;return this.forceRefresh=!1,this.auth?this.auth.getToken(t).then((r=>this.xe!==e?(ze("FirebaseAuthCredentialsProvider","getToken aborted due to token change."),this.getToken()):r?(Ke(typeof r.accessToken=="string",31837,{Oe:r}),new k7(r.accessToken,this.currentUser)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.auth&&this.Ce&&this.auth.removeAuthTokenListener(this.Ce),this.Ce=void 0}Fe(){const e=this.auth&&this.auth.getUid();return Ke(e===null||typeof e=="string",2055,{Me:e}),new ha(e)}}class Cle{constructor(e,t,r){this.Ne=e,this.Le=t,this.Be=r,this.type="FirstParty",this.user=ha.FIRST_PARTY,this.Ue=new Map}ke(){return this.Be?this.Be():null}get headers(){this.Ue.set("X-Goog-AuthUser",this.Ne);const e=this.ke();return e&&this.Ue.set("Authorization",e),this.Le&&this.Ue.set("X-Goog-Iam-Authorization-Token",this.Le),this.Ue}}class Ele{constructor(e,t,r){this.Ne=e,this.Le=t,this.Be=r}getToken(){return Promise.resolve(new Cle(this.Ne,this.Le,this.Be))}start(e,t){e.enqueueRetryable((()=>t(ha.FIRST_PARTY)))}shutdown(){}invalidateToken(){}}class D_{constructor(e){this.value=e,this.type="AppCheck",this.headers=new Map,e&&e.length>0&&this.headers.set("x-firebase-appcheck",this.value)}}class Sle{constructor(e,t){this.qe=t,this.forceRefresh=!1,this.appCheck=null,this.$e=null,this.Ke=null,xo(e)&&e.settings.appCheckToken&&(this.Ke=e.settings.appCheckToken)}start(e,t){Ke(this.Ce===void 0,3512);const r=a=>{a.error!=null&&ze("FirebaseAppCheckTokenProvider",`Error getting App Check token; using placeholder token instead. Error: ${a.error.message}`);const o=a.token!==this.$e;return this.$e=a.token,ze("FirebaseAppCheckTokenProvider",`Received ${o?"new":"existing"} token.`),o?t(a.token):Promise.resolve()};this.Ce=a=>{e.enqueueRetryable((()=>r(a)))};const s=a=>{ze("FirebaseAppCheckTokenProvider","AppCheck detected"),this.appCheck=a,this.Ce&&this.appCheck.addTokenListener(this.Ce)};this.qe.onInit((a=>s(a))),setTimeout((()=>{if(!this.appCheck){const a=this.qe.getImmediate({optional:!0});a?s(a):ze("FirebaseAppCheckTokenProvider","AppCheck not yet detected")}}),0)}getToken(){if(this.Ke)return Promise.resolve(new D_(this.Ke));const e=this.forceRefresh;return this.forceRefresh=!1,this.appCheck?this.appCheck.getToken(e).then((t=>t?(Ke(typeof t.token=="string",44558,{tokenResult:t}),this.$e=t.token,new D_(t.token)):null)):Promise.resolve(null)}invalidateToken(){this.forceRefresh=!0}shutdown(){this.appCheck&&this.Ce&&this.appCheck.removeTokenListener(this.Ce),this.Ce=void 0}}class Tle{getToken(){return Promise.resolve(new D_(""))}invalidateToken(){}start(e,t){}shutdown(){}}function _7(n){const e={};return n.timeoutSeconds!==void 0&&(e.timeoutSeconds=n.timeoutSeconds),e}/**
2452 * @license
2453 * Copyright 2019 Google LLC
2454 *
2455 * Licensed under the Apache License, Version 2.0 (the "License");
2456 * you may not use this file except in compliance with the License.
2457 * You may obtain a copy of the License at
2458 *
2459 *   http://www.apache.org/licenses/LICENSE-2.0
2460 *
2461 * Unless required by applicable law or agreed to in writing, software
2462 * distributed under the License is distributed on an "AS IS" BASIS,
2463 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2464 * See the License for the specific language governing permissions and
2465 * limitations under the License.
2466 */class Ale{Qe(e){}shutdown(){}}/**
2467 * @license
2468 * Copyright 2019 Google LLC
2469 *
2470 * Licensed under the Apache License, Version 2.0 (the "License");
2471 * you may not use this file except in compliance with the License.
2472 * You may obtain a copy of the License at
2473 *
2474 *   http://www.apache.org/licenses/LICENSE-2.0
2475 *
2476 * Unless required by applicable law or agreed to in writing, software
2477 * distributed under the License is distributed on an "AS IS" BASIS,
2478 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2479 * See the License for the specific language governing permissions and
2480 * limitations under the License.
2481 */const f4="ConnectivityMonitor";class m4{constructor(){this.We=()=>this.Ge(),this.ze=()=>this.je(),this.He=[],this.Je()}Qe(e){this.He.push(e)}shutdown(){window.removeEventListener("online",this.We),window.removeEventListener("offline",this.ze)}Je(){window.addEventListener("online",this.We),window.addEventListener("offline",this.ze)}
2481Ge(){ze(f4,"Network connectivity changed: AVAILABLE");for(const e of this.He)e(0)}je(){ze(f4,"Network connectivity changed: UNAVAILABLE");for(const e of this.He)e(1)}static Ye(){return typeof window<"u"&&window.addEventListener!==void 0&&window.removeEventListener!==void 0}}/**
2482 * @license
2483 * Copyright 2023 Google LLC
2484 *
2485 * Licensed under the Apache License, Version 2.0 (the "License");
2486 * you may not use this file except in compliance with the License.
2487 * You may obtain a copy of the License at
2488 *
2489 *   http://www.apache.org/licenses/LICENSE-2.0
2490 *
2491 * Unless required by applicable law or agreed to in writing, software
2492 * distributed under the License is distributed on an "AS IS" BASIS,
2493 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2494 * See the License for the specific language governing permissions and
2495 * limitations under the License.
2496 */let sw=null;function j_(){return sw===null?sw=(function(){return 268435456+Math.round(2147483648*Math.random())})():sw++,"0x"+sw.toString(16)}/**
2497 * @license
2498 * Copyright 2020 Google LLC
2499 *
2500 * Licensed under the Apache License, Version 2.0 (the "License");
2501 * you may not use this file except in compliance with the License.
2502 * You may obtain a copy of the License at
2503 *
2504 *   http://www.apache.org/licenses/LICENSE-2.0
2505 *
2506 * Unless required by applicable law or agreed to in writing, software
2507 * distributed under the License is distributed on an "AS IS" BASIS,
2508 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2509 * See the License for the specific language governing permissions and
2510 * limitations under the License.
2511 */const Sk="RestConnection",kle={BatchGetDocuments:"batchGet",Commit:"commit",RunQuery:"runQuery",RunAggregationQuery:"runAggregationQuery",ExecutePipeline:"executePipeline"};class Nle{get Ze(){return!1}constructor(e){this.databaseInfo=e,this.databaseId=e.databaseId;const t=e.ssl?"https":"http",r=encodeURIComponent(this.databaseId.projectId),s=encodeURIComponent(this.databaseId.database);this.Xe=t+"://"+e.host,this.et=`projects/${r}/databases/${s}`,this.tt=this.databaseId.database===ry?`project_id=${r}`:`project_id=${r}&database_id=${s}`}nt(e,t,r,s,a){const o=j_(),l=this.rt(e,t.toUriEncodedString());ze(Sk,`Sending RPC '${e}' ${o}:`,l,r);const c={"google-cloud-resource-prefix":this.et,"x-goog-request-params":this.tt};this.it(c,s,a);const{host:d}=new URL(l),h=Ng(d);return this.st(e,l,c,r,h).then((m=>(ze(Sk,`Received RPC '${e}' ${o}: `,m),m)),(m=>{throw Xs(Sk,`RPC '${e}' ${o} failed with error: `,m,"url: ",l,"request:",r),m}))}_t(e,t,r,s,a,o){return this.nt(e,t,r,s,a)}it(e,t,r){if(e["X-Goog-Api-Client"]=(function(){return"gl-js/ fire/"+Dg})(),e["Content-Type"]="text/plain",this.databaseInfo.appId&&(e["X-Firebase-GMPID"]=this.databaseInfo.appId),t&&t.headers.forEach(((s,a)=>e[a]=s)),r&&r.headers.forEach(((s,a)=>e[a]=s)),this.databaseInfo._customHeaders)for(const s of Object.keys(this.databaseInfo._customHeaders))e[s]=this.databaseInfo._customHeaders[s]}rt(e,t){const r=kle[e];let s=`${this.Xe}/v1/${t}:${r}`;return this.databaseInfo.apiKey&&(s=`${s}?key=${encodeURIComponent(this.databaseInfo.apiKey)}`),s}terminate(){}}/**
2512 * @license
2513 * Copyright 2017 Google LLC
2514 *
2515 * Licensed under the Apache License, Version 2.0 (the "License");
2516 * you may not use this file except in compliance with the License.
2517 * You may obtain a copy of the License at
2518 *
2519 *   http://www.apache.org/licenses/LICENSE-2.0
2520 *
2521 * Unless required by applicable law or agreed to in writing, software
2522 * distributed under the License is distributed on an "AS IS" BASIS,
2523 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2524 * See the License for the specific language governing permissions and
2525 * limitations under the License.
2526 */class _le{constructor(e){this.ot=e.ot,this.ut=e.ut}ct(e){this.lt=e}Et(e){this.ht=e}Tt(e){this.Pt=e}onMessage(e){this.It=e}close(){this.ut()}send(e){this.ot(e)}Rt(){this.lt()}At(){this.ht()}Vt(e){this.Pt(e)}dt(e){this.It(e)}}/**
2527 * @license
2528 * Copyright 2017 Google LLC
2529 *
2530 * Licensed under the Apache License, Version 2.0 (the "License");
2531 * you may not use this file except in compliance with the License.
2532 * You may obtain a copy of the License at
2533 *
2534 *   http://www.apache.org/licenses/LICENSE-2.0
2535 *
2536 * Unless required by applicable law or agreed to in writing, software
2537 * distributed under the License is distributed on an "AS IS" BASIS,
2538 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2539 * See the License for the specific language governing permissions and
2540 * limitations under the License.
2541 */const $a="WebChannelConnection",Xx=(n,e,t)=>{n.listen(e,(r=>{try{t(r)}catch(s){setTimeout((()=>{throw s}),0)}}))};class j0 extends Nle{constructor(e){super(e),this.ft=[],this.forceLongPolling=e.forceLongPolling,this.autoDetectLongPolling=e.autoDetectLongPolling,this.useFetchStreams=e.useFetchStreams,this.longPollingOptions=e.longPollingOptions}static gt(){if(!j0.yt){const e=gH();Xx(e,pH.STAT_EVENT,(t=>{t.stat===g_.PROXY?ze($a,"STAT_EVENT: detected buffering proxy"):t.stat===g_.NOPROXY&&ze($a,"STAT_EVENT: detected no buffering proxy")})),j0.yt=!0}}st(e,t,r,s,a){const o=j_();return new Promise(((l,c)=>{const d=new fH;d.setWithCredentials(!0),d.listenOnce(mH.COMPLETE,(()=>{try{switch(d.getLastErrorCode()){case rC.NO_ERROR:const m=d.getResponseJson();ze($a,`XHR for RPC '${e}' ${o} received:`,JSON.stringify(m)),l(m);break;case rC.TIMEOUT:ze($a,`RPC '${e}' ${o} timed out`),c(new Fe(Te.DEADLINE_EXCEEDED,"Request time out"));break;case rC.HTTP_ERROR:const p=d.getStatus();if(ze($a,`RPC '${e}' ${o} failed with status:`,p,"response text:",d.getResponseText()),p>0){let x=d.getResponseJson();Array.isArray(x)&&(x=x[0]);const y=x==null?void 0:x.error;if(y&&y.status&&y.message){const v=(function(E){const N=E.toLowerCase().replace(/_/g,"-");return Object.values(Te).indexOf(N)>=0?N:Te.UNKNOWN})(y.status);c(new Fe(v,y.message))}else c(new Fe(Te.UNKNOWN,"Server responded with status "+d.getStatus()))}else c(new Fe(Te.UNAVAILABLE,"Connection failed."));break;default:ot(9055,{wt:e,streamId:o,bt:d.getLastErrorCode(),St:d.getLastError()})}}finally{ze($a,`RPC '${e}' ${o} completed.`)}}));const h=JSON.stringify(s);ze($a,`RPC '${e}' ${o} sending request:`,s),d.send(t,"POST",h,r,15)}))}vt(e,t,r){const s=j_(),a=[this.Xe,"/","google.firestore.v1.Firestore","/",e,"/channel"],o=this.createWebChannelTransport(),l={httpSessionIdParam:"gsessionid",initMessageHeaders:{},messageUrlParams:{database:`projects/${this.databaseId.projectId}/databases/${this.databaseId.database}`},sendRawJson:!0,supportsCrossDomainXhr:!0,internalChannelParams:{forwardChannelRequestTimeoutMs:6e5},forceLongPolling:this.forceLongPolling,detectBufferingProxy:this.autoDetectLongPolling},c=this.longPollingOptions.timeoutSeconds;c!==void 0&&(l.longPollingTimeout=Math.round(1e3*c)),this.useFetchStreams&&(l.useFetchStreams=!0),this.it(l.initMessageHeaders,t,r),l.encodeInitMessageHeaders=!0;const d=a.join("");ze($a,`Creating RPC '${e}' stream ${s}: ${d}`,l);const h=o.createWebChannel(d,l);this.Dt(h);let m=!1,p=!1;const x=new _le({ot:y=>{p?ze($a,`Not sending because RPC '${e}' stream ${s} is closed:`,y):(m||(ze($a,`Opening RPC '${e}' stream ${s} transport.`),h.open(),m=!0),ze($a,`RPC '${e}' stream ${s} sending:`,y),h.send(y))},ut:()=>h.close()});return Xx(h,Bb.EventType.OPEN,(()=>{p||(ze($a,`RPC '${e}' stream ${s} transport opened.`),x.Rt())})),Xx(h,Bb.EventType.CLOSE,(()=>{p||(p=!0,ze($a,`RPC '${e}' stream ${s} transport closed`),x.Vt(),this.xt(h))})),Xx(h,Bb.EventType.ERROR,(y=>{p||(p=!0,Xs($a,`RPC '${e}' stream ${s} transport errored. Name:`,y.name,"Message:",y.message),x.Vt(new Fe(Te.UNAVAILABLE,"The operation could not be completed")))})),Xx(h,Bb.EventType.MESSAGE,(y=>{var v;if(!p){const B=y.data[0];Ke(!!B,16349);const E=B,N=(E==null?void 0:E.error)||((v=E[0])==null?void 0:v.error);if(N){ze($a,`RPC '${e}' stream ${s} received error:`,N);const T=N.status;let k=(function(_){const I=Rs[_];if(I!==void 0)return i7(I)})(T),P=N.message;T==="NOT_FOUND"&&P.includes("database")&&P.includes("does not exist")&&P.includes(this.databaseId.database)&&Xs(`Database '${this.databaseId.database}' not found. Please check your project configuration.`),k===void 0&&(k=Te.INTERNAL,P="Unknown error status: "+T+" with message "+N.message),p=!0,x.Vt(new Fe(k,P)),h.close()}else ze($a,`RPC '${e}' stream ${s} received:`,B),x.dt(B)}})),j0.gt(),setTimeout((()=>{x.At()}),0),x}terminate(){this.ft.forEach((e=>e.close())),this.ft=[]}Dt(e){this.ft.push(e)}xt(e){this.ft=this.ft.filter((t=>t===e))}it(e,t,r){super.it(e,t,r),this.databaseInfo.apiKey&&(e["x-goog-api-key"]=this.databaseInfo.apiKey)}createWebChannelTransport(){return xH()}}/**
2542 * @license
2543 * Copyright 2020 Google LLC
2544 *
2545 * Licensed under the Apache License, Version 2.0 (the "License");
2546 * you may not use this file except in compliance with the License.
2547 * You may obtain a copy of the License at
2548 *
2549 *   http://www.apache.org/licenses/LICENSE-2.0
2550 *
2551 * Unless required by applicable law or agreed to in writing, software
2552 * distributed under the License is distributed on an "AS IS" BASIS,
2553 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2554 * See the License for the specific language governing permissions and
2555 * limitations under the License.
2556 */function Ile(n){return new j0(n)}j0.yt=!1;class aj{constructor(e,t,r=1e3,s=1.5,a=6e4){this.Ct=e,this.timerId=t,this.Ft=r,this.Ot=s,this.Mt=a,this.Nt=0,this.Lt=null,this.Bt=Date.now(),this.reset()}reset(){this.Nt=0}Ut(){this.Nt=this.Mt}kt(e){this.cancel();const t=Math.floor(this.Nt+this.qt()),r=Math.max(0,Date.now()-this.Bt),s=Math.max(0,t-r);s>0&&ze("ExponentialBackoff",`Backing off for ${s} ms (base delay: ${this.Nt} ms, delay with jitter: ${t} ms, last attempt: ${r} ms ago)`),this.Lt=this.Ct.enqueueAfterDelay(this.timerId,s,(()=>(this.Bt=Date.now(),e()))),this.Nt*=this.Ot,this.Nt<this.Ft&&(this.Nt=this.Ft),this.Nt>this.Mt&&(this.Nt=this.Mt)}$t(){this.Lt!==null&&(this.Lt.skipDelay(),this.Lt=null)}cancel(){this.Lt!==null&&(this.Lt.cancel(),this.Lt=null)}qt(){return(Math.random()-.5)*this.Nt}}/**
2557 * @license
2558 * Copyright 2017 Google LLC
2559 *
2560 * Licensed under the Apache License, Version 2.0 (the "License");
2561 * you may not use this file except in compliance with the License.
2562 * You may obtain a copy of the License at
2563 *
2564 *   http://www.apache.org/licenses/LICENSE-2.0
2565 *
2566 * Unless required by applicable law or agreed to in writing, software
2567 * distributed under the License is distributed on an "AS IS" BASIS,
2568 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2569 * See the License for the specific language governing permissions and
2570 * limitations under the License.
2571 */const p4="PersistentStream";class I7{constructor(e,t,r,s,a,o,l,c){this.Ct=e,this.Kt=r,this.Qt=s,this.connection=a,this.authCredentialsProvider=o,this.appCheckCredentialsProvider=l,this.listener=c,this.state=0,this.Wt=0,this.Gt=null,this.zt=null,this.stream=null,this.jt=0,this.Ht=new aj(e,t)}Jt(){return this.state===1||this.state===5||this.Yt()}Yt(){return this.state===2||this.state===3}start(){this.jt=0,this.state!==4?this.auth():this.Zt()}async stop(){this.Jt()&&await this.close(0)}Xt(){this.state=0,this.Ht.reset()}en(){this.Yt()&&this.Gt===null&&(this.Gt=this.Ct.enqueueAfterDelay(this.Kt,6e4,(()=>this.tn())))}nn(e){this.rn(),this.stream.send(e)}async tn(){if(this.Yt())return this.close(0)}rn(){this.Gt&&(this.Gt.cancel(),this.Gt=null)}sn(){this.zt&&(this.zt.cancel(),this.zt=null)}async close(e,t){this.rn(),this.sn(),this.Ht.cancel(),this.Wt++,e!==4?this.Ht.reset():t&&t.code===Te.RESOURCE_EXHAUSTED?(Cs(t.toString()),Cs("Using maximum backoff delay to prevent overloading the backend."),this.Ht.Ut()):t&&t.code===Te.UNAUTHENTICATED&&this.state!==3&&(this.authCredentialsProvider.invalidateToken(),this.appCheckCredentialsProvider.invalidateToken()),this.stream!==null&&(this._n(),this.stream.close(),this.stream=null),this.state=e,await this.listener.Tt(t)}_n(){}auth(){this.state=1;const e=this.an(this.Wt),t=this.Wt;Promise.all([this.authCredentialsProvider.getToken(),this.appCheckCredentialsProvider.getToken()]).then((([r,s])=>{this.Wt===t&&this.un(r,s)}),(r=>{e((()=>{const s=new Fe(Te.UNKNOWN,"Fetching auth token failed: "+r.message);return this.cn(s)}))}))}un(e,t){const r=this.an(this.Wt);this.stream=this.En(e,t),this.stream.ct((()=>{r((()=>this.listener.ct()))})),this.stream.Et((()=>{r((()=>(this.state=2,this.zt=this.Ct.enqueueAfterDelay(this.Qt,1e4,(()=>(this.Yt()&&(this.state=3),Promise.resolve()))),this.listener.Et())))})),this.stream.Tt((s=>{r((()=>this.cn(s)))})),this.stream.onMessage((s=>{r((()=>++this.jt==1?this.hn(s):this.onNext(s)))}))}Zt(){this.state=5,this.Ht.kt((async()=>{this.state=0,this.start()}))}cn(e){return ze(p4,`close with error: ${e}`),this.stream=null,this.close(4,e)}an(e){return t=>{this.Ct.enqueueAndForget((()=>this.Wt===e?t():(ze(p4,"stream callback skipped by getCloseGuardedDispatcher."),Promise.resolve())))}}}class Dle extends I7{constructor(e,t,r,s,a,o){super(e,"listen_stream_connection_backoff","listen_stream_idle","health_check_timeout",t,r,s,o),this.serializer
vendor: 4,457 bytes, lines 2571-2605
2571=a}En(e,t){return this.connection.vt("Listen",e,t)}hn(e){return this.onNext(e)}onNext(e){this.Ht.reset();const t=mle(this.serializer,e),r=(function(a){if(!("targetChange"in a))return wt.min();const o=a.targetChange;return o.targetIds&&o.targetIds.length?wt.min():o.readTime?Ss(o.readTime):wt.min()})(e);return this.listener.Tn(t,r)}Pn(e){const t={};t.database=__(this.serializer),t.addTarget=(function(a,o){let l;const c=o.target;if(l=Ed(c)?{pipelineQuery:B7(a,c)}:ZD(c)?{documents:b7(a,c)}:{query:L1(a,c).Se},l.targetId=o.targetId,o.resumeToken.approximateByteSize()>0){l.resumeToken=f7(a,o.resumeToken);const d=k_(a,o.expectedCount);d!==null&&(l.expectedCount=d)}else if(o.snapshotVersion.compareTo(wt.min())>0){l.readTime=dm(a,o.snapshotVersion.toTimestamp());const d=k_(a,o.expectedCount);d!==null&&(l.expectedCount=d)}return l})(this.serializer,e);const r=gle(this.serializer,e);r&&(t.labels=r),this.nn(t)}In(e){const t={};t.database=__(this.serializer),t.removeTarget=e,this.nn(t)}}class jle extends I7{constructor(e,t,r,s,a,o){super(e,"write_stream_connection_backoff","write_stream_idle","health_check_timeout",t,r,s,o),this.serializer=a}get Rn(){return this.jt>0}start(){this.lastStreamToken=void 0,super.start()}_n(){this.Rn&&this.An([])}En(e,t){return this.connection.vt("Write",e,t)}hn(e){return Ke(!!e.streamToken,31322),this.lastStreamToken=e.streamToken,Ke(!e.writeResults||e.writeResults.length===0,55816),this.listener.Vn()}onNext(e){Ke(!!e.streamToken,12678),this.lastStreamToken=e.streamToken,this.Ht.reset();const t=ple(e.writeResults,e.commitTime),r=Ss(e.commitTime);return this.listener.dn(r,t)}fn(){const e={};e.database=__(this.serializer),this.nn(e)}An(e){const t={streamToken:this.lastStreamToken,writes:e.map((r=>iy(this.serializer,r)))};this.nn(t)}}/**
2572 * @license
2573 * Copyright 2017 Google LLC
2574 *
2575 * Licensed under the Apache License, Version 2.0 (the "License");
2576 * you may not use this file except in compliance with the License.
2577 * You may obtain a copy of the License at
2578 *
2579 *   http://www.apache.org/licenses/LICENSE-2.0
2580 *
2581 * Unless required by applicable law or agreed to in writing, software
2582 * distributed under the License is distributed on an "AS IS" BASIS,
2583 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2584 * See the License for the specific language governing permissions and
2585 * limitations under the License.
2586 */class Rle{}class Ple extends Rle{constructor(e,t,r,s){super(),this.authCredentials=e,this.appCheckCredentials=t,this.connection=r,this.serializer=s,this.mn=!1}pn(){if(this.mn)throw new Fe(Te.FAILED_PRECONDITION,"The client has already been terminated.")}nt(e,t,r,s){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([a,o])=>this.connection.nt(e,N_(t,r),s,a,o))).catch((a=>{throw a.name==="FirebaseError"?(a.code===Te.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),a):new Fe(Te.UNKNOWN,a.toString())}))}_t(e,t,r,s,a){return this.pn(),Promise.all([this.authCredentials.getToken(),this.appCheckCredentials.getToken()]).then((([o,l])=>this.connection._t(e,N_(t,r),s,o,l,a))).catch((o=>{throw o.name==="FirebaseError"?(o.code===Te.UNAUTHENTICATED&&(this.authCredentials.invalidateToken(),this.appCheckCredentials.invalidateToken()),o):new Fe(Te.UNKNOWN,o.toString())}))}terminate(){this.mn=!0,this.connection.terminate()}}function Lle(n,e,t,r){return new Ple(n,e,t,r)}/**
2587 * @license
2588 * Copyright 2020 Google LLC
2589 *
2590 * Licensed under the Apache License, Version 2.0 (the "License");
2591 * you may not use this file except in compliance with the License.
2592 * You may obtain a copy of the License at
2593 *
2594 *   http://www.apache.org/licenses/LICENSE-2.0
2595 *
2596 * Unless required by applicable law or agreed to in writing, software
2597 * distributed under the License is distributed on an "AS IS" BASIS,
2598 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2599 * See the License for the specific language governing permissions and
2600 * limitations under the License.
2601 */const Ole="ComponentProvider",g4=new Map;function Mle(n,e,t,r,s){return new Noe(n,e,t,s.host,s.ssl,s.experimentalForceLongPolling,s.experimentalAutoDetectLongPolling,_7(s.experimentalLongPollingOptions),s.useFetchStreams,s.isUsingEmulator,r,s._customHeaders,s.grpcFlowControlWindow)}/**
2602 * @license
2603 * Copyright 2018 Google LLC
2604 *
2605 * Licensed under the Apache License, Version 2.0 (the "License");
2606 * you may not use this file except in compliance with the License.
2607 * You may obtain a copy of the License at
2608 *
2609 *   http://www.apache.org/licenses/LICENSE-2.0
2610 *
2611 * Unless required by applicable law or agreed to in writing, software
2612 * distributed under the License is distributed on an "AS IS" BASIS,
2613 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2614 * See the License for the specific language governing permissions and
2615 * limitations under the License.
2616 */const x4={didRun:!1,sequenceNumbersCollected:0,targetsRemoved:0,documentsRemoved:0},D7=41943040;class Ha{static withCacheSize(e){return new Ha(e,Ha.DEFAULT_COLLECTION_PERCENTILE,Ha.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT)}constructor(e,t,r){this.cacheSizeCollectionThreshold=e,this.percentileToCollect=t,this.maximumSequenceNumbersToCollect=r}}Ha.DEFAULT_COLLECTION_PERCENTILE=10,Ha.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT=1e3,Ha.DEFAULT=new Ha(D7,Ha.DEFAULT_COLLECTION_PERCENTILE,Ha.DEFAULT_MAX_SEQUENCE_NUMBERS_TO_COLLECT),Ha.DISABLED=new Ha(-1,0,0);/**
2617 * @license
2618 * Copyright 2018 Google LLC
2619 *
2620 * Licensed under the Apache License, Version 2.0 (the "License");
2621 * you may not use this file except in compliance with the License.
2622 * You may obtain a copy of the License at
2623 *
2624 *   http://www.apache.org/licenses/LICENSE-2.0
2625 *
2626 * Unless required by applicable law or agreed to in writing, software
2627 * distributed under the License is distributed on an "AS IS" BASIS,
2628 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2629 * See the License for the specific language governing permissions and
2630 * limitations under the License.
2631 */class Gi{constructor(e,t){this.previousValue=e,t&&(t.sequenceNumberHandler=r=>this.gn(r),this.yn=r=>t.writeSequenceNumber(r))}gn(e){return this.previousValue=Math.max(e,this.previousValue),this.previousValue}next(){const e=++this.previousValue;return this.yn&&this.yn(e),e}}Gi.wn=-1;/**
2632 * @license
2633 * Copyright 2020 Google LLC
2634 *
2635 * Licensed under the Apache License, Version 2.0 (the "License");
2636 * you may not use this file except in compliance with the License.
2637 * You may obtain a copy of the License at
2638 *
2639 *   http://www.apache.org/licenses/LICENSE-2.0
2640 *
2641 * Unless required by applicable law or agreed to in writing, software
2642 * distributed under the License is distributed on an "AS IS" BASIS,
2643 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2644 * See the License for the specific language governing permissions and
2645 * limitations under the License.
2646 */const j7="The current tab is not in the required state to perform this operation. It might be necessary to refresh the browser tab.";class R7{constructor(){this.onCommittedListeners=[]}addOnCommittedListener(e){this.onCommittedListeners.push(e)}raiseOnCommittedEvent(){this.onCommittedListeners.forEach((e=>e()))}}/**
2647 * @license
2648 * Copyright 2017 Google LLC
2649 *
2650 * Licensed under the Apache License, Version 2.0 (the "License");
2651 * you may not use this file except in compliance with the License.
2652 * You may obtain a copy of the License at
2653 *
2654 *   http://www.apache.org/licenses/LICENSE-2.0
2655 *
2656 * Unless required by applicable law or agreed to in writing, software
2657 * distributed under the License is distributed on an "AS IS" BASIS,
2658 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2659 * See the License for the specific language governing permissions and
2660 * limitations under the License.
2661 */async function Kh(n){if(n.code!==Te.FAILED_PRECONDITION||n.message!==j7)throw n;ze("LocalStore","Unexpectedly lost primary lease")}/**
2662 * @license
2663 * Copyright 2017 Google LLC
2664 *
2665 * Licensed under the Apache License, Version 2.0 (the "License");
2666 * you may not use this file except in compliance with the License.
2667 * You may obtain a copy of the License at
2668 *
2669 *   http://www.apache.org/licenses/LICENSE-2.0
2670 *
2671 * Unless required by applicable law or agreed to in writing, software
2672 * distributed under the License is distributed on an "AS IS" BASIS,
2673 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2674 * See the License for the specific language governing permissions and
2675 * limitations under the License.
2676 */class ve{constructor(e){this.nextCallback=null,this.catchCallback=null,this.result=void 0,this.error=void 0,this.isDone=!1,this.callbackAttached=!1,e((t=>{this.isDone=!0,this.result=t,this.nextCallback&&this.nextCallback(t)}),(t=>{this.isDone=!0,this.error=t,this.catchCallback&&this.catchCallback(t)}))}catch(e){return this.next(void 0,e)}next(e,t){return this.callbackAttached&&ot(59440),this.callbackAttached=!0,this.isDone?this.error?this.wrapFailure(t,this.error):this.wrapSuccess(e,this.result):new ve(((r,s)=>{this.nextCallback=a=>{this.wrapSuccess(e,a).next(r,s)},this.catchCallback=a=>{this.wrapFailure(t,a).next(r,s)}}))}toPromise(){return new Promise(((e,t)=>{this.next(e,t)}))}wrapUserFunction(e){try{const t=e();return t instanceof ve?t:ve.resolve(t)}catch(t){return ve.reject(t)}}wrapSuccess(e,t){return e?this.wrapUserFunction((()=>e(t))):ve.resolve(t)}wrapFailure(e,t){return e?this.wrapUserFunction((()=>e(t))):ve.reject(t)}static resolve(e){return new ve(((t,r)=>{t(e)}))}static reject(e){return new ve(((t,r)=>{r(e)}))}static waitFor(e){return new ve(((t,r)=>{let s=0,a=0,o=!1;e.forEach((l=>{++s,l.next((()=>{++a,o&&a===s&&t()}),(c=>r(c)))})),o=!0,a===s&&t()}))}static or(e){let t=ve.resolve(!1);for(const r of e)t=t.next((s=>s?ve.resolve(s):r()));return t}static forEach(e,t){const r=[];return e.forEach(((s,a)=>{r.push(t.call(this,s,a))})),this.waitFor(r)}static mapArray(e,t){return new ve(((r,s)=>{const a=e.length,o=new Array(a);let l=0;for(let c=0;c<a;c++){const d=c;t(e[d]).next((h=>{o[d]=h,++l,l===a&&r(o)}),(h=>s(h)))}}))}static doWhile(e,t){return new ve(((r,s)=>{const a=()=>{e()===!0?t().next((()=>{a()}),s):r()};a()}))}}/**
2677 * @license
2678 * Copyright 2017 Google LLC
2679 *
2680 * Licensed under the Apache License, Version 2.0 (the "License");
2681 * you may not use this file except in compliance with the License.
2682 * You may obtain a copy of the License at
2683 *
2684 *   http://www.apache.org/licenses/LICENSE-2.0
2685 *
2686 * Unless required by applicable law or agreed to in writing, software
2687 * distributed under the License is distributed on an "AS IS" BASIS,
2688 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2689 * See the License for the specific language governing permissions and
2690 * limitations under the License.
2691 */const po="SimpleDb";class O1{static open(e,t,r,s){try{return new O1(t,e.transaction(s,r))}catch(a){throw new Lb(t,a)}}constructor(e,t){this.action=e,this.transaction=t,this.aborted=!1,this.bn=new ma,this.transaction.oncomplete=()=>{this.bn.resolve()},this.transaction.onabort=()=>{t.error?this.bn.reject(new Lb(e,t.error)):this.bn.resolve()},this.transaction.onerror=r=>{const s=ij(r.target.error);this.bn.reject(new Lb(e,s))}}get Sn(){return this.bn.promise}abort(e){e&&this.bn.reject(e),this.aborted||(ze(po,"Aborting transaction:",e?e.message:"Client-initiated abort"),this.aborted=!0,this.transaction.abort())}vn(){const e=this.transaction;this.aborted||typeof e.commit!="function"||e.commit()}store(e){const t=this.transaction.objectStore(e);return new Ule(t)}}class jc{static delete(e){return ze(po,"Removing database:",e),$f(b$().indexedDB.deleteDatabase(e)).toPromise()}static Ye(){if(!T$())return!1;if(jc.Dn())return!0;const e=Js(),t=jc.xn(e),r=0<t&&t<10,s=P7(e),a=0<s&&s<4.5;return!(e.indexOf("MSIE ")>0||e.indexOf("Trident/")>0||e.indexOf("Edge/")>0||r||a)}static Dn(){var e;return typeof process<"u"&&((e=process.__PRIVATE_env)==null?void 0:e.__PRIVATE_USE_MOCK_PERSISTENCE)==="YES"}static Cn(e,t){return e.store(t)}static xn(e){const t=e.match(/i(?:phone|pad|pod) os ([\d_]+)/i),r=t?t[1].split("_").slice(0,2).join("."):"-1";return Number(r)}constructor(e,t,r){this.name=e,this.version=t,this.Fn=r,this.On=null,jc.xn(Js())===12.2&&Cs("Firestore persistence suffers from a bug in iOS 12.2 Safari that may cause your app to stop working. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.")}async Mn(e){return this.db||(ze(po,"Opening database:",this.name),this.db=await new Promise(((t,r)=>{const s=indexedDB.open(this.name,this.version);s.onsuccess=a=>{const o=a.target.result;t(o)},s.onblocked=()=>{r(new Lb(e,"Cannot upgrade IndexedDB schema while another tab is open. Close all tabs that access Firestore and reload this page to proceed."))},s.onerror=a=>{const o=a.target.error;o.name==="VersionError"?r(new Fe(Te.FAILED_PRECONDITION,"A newer version of the Firestore SDK was previously used and so the persisted data is not compatible with the version of the SDK you are now using. The SDK will operate with persistence disabled. If you need persistence, please re-upgrade to a newer version of the SDK or else clear the persisted IndexedDB data for your app to start fresh.")):o.name==="InvalidStateError"?r(new Fe(Te.FAILED_PRECONDITION,"Unable to open an IndexedDB connection. This could be due to running in a private browsing session on a browser whose private browsing sessions do not support IndexedDB: "+o)):r(new Lb(e,o))},s.onupgradeneeded=a=>{ze(po,'Database "'+this.name+'" requires upgrade from version:',a.oldVersion);const o=a.target.result;this.Fn.Nn(o,s.transaction,a.oldVersion,this.version).next((()=>{ze(po,"Database upgrade to version "+this.version+" complete")}))}}))),this.Ln&&(this.db.onversionchange=t=>this.Ln(t)),this.db}Bn(e){this.Ln=e,this.db&&(this.db.onversionchange=t=>e(t))}async runTransaction(e,t,r,s){const a=t==="readonly";let o=0;for(;;){++o;try{this.db=await this.Mn(e);const l=O1.open(this.db,e,a?"readonly":"readwrite",r),c=s(l).next((d=>(l.vn(),d))).catch((d=>(l.abort(d),ve.reject(d)))).toPromise();return c.catch((()=>{})),await l.Sn,c}catch(l){const c=l,d=c.name!=="FirebaseError"&&o<3;if(ze(po,"Transaction failed with error:",c.message,"Retrying:",d),this.close(),!d)return Promise.reject(c)}}}close(){this.db&&this.db.close(),this.db=void 0}}function P7(n){const e=n.match(/Android ([\d.]+)/i),t=e?e[1].split(".").slice(0,2).join("."):"-1";return Number(t)}class Fle{constructor(e){this.Un=e,this.kn=!1,this.qn=null}get isDone(){return this.kn}get $n(){return this.qn}set cursor(e){this.Un=e}done(){this.kn=!0}
2691Kn(e){this.qn=e}delete(){return $f(this.Un.delete())}}class Lb extends Fe{constructor(e,t){super(Te.UNAVAILABLE,`IndexedDB transaction '${e}' failed: ${t}`),this.name="IndexedDbTransactionError"}}function Wh(n){return n.name==="IndexedDbTransactionError"}class Ule{constructor(e){this.store=e}put(e,t){let r;return t!==void 0?(ze(po,"PUT",this.store.name,e,t),r=this.store.put(t,e)):(ze(po,"PUT",this.store.name,"<auto-key>",e),r=this.store.put(e)),$f(r)}add(e){return ze(po,"ADD",this.store.name,e,e),$f(this.store.add(e))}get(e){return $f(this.store.get(e)).next((t=>(t===void 0&&(t=null),ze(po,"GET",this.store.name,e,t),t)))}delete(e){return ze(po,"DELETE",this.store.name,e),$f(this.store.delete(e))}count(){return ze(po,"COUNT",this.store.name),$f(this.store.count())}Qn(e,t){const r=this.options(e,t),s=r.index?this.store.index(r.index):this.store;if(typeof s.getAll=="function"){const a=s.getAll(r.range);return new ve(((o,l)=>{a.onerror=c=>{l(c.target.error)},a.onsuccess=c=>{o(c.target.result)}}))}{const a=this.cursor(r),o=[];return this.Wn(a,((l,c)=>{o.push(c)})).next((()=>o))}}Gn(e,t){const r=this.store.getAll(e,t===null?void 0:t);return new ve(((s,a)=>{r.onerror=o=>{a(o.target.error)},r.onsuccess=o=>{s(o.target.result)}}))}
vendor: 4,317 bytes, lines 2691-2706
2691zn(e,t){ze(po,"DELETE ALL",this.store.name);const r=this.options(e,t);r.jn=!1;const s=this.cursor(r);return this.Wn(s,((a,o,l)=>l.delete()))}Hn(e,t){let r;t?r=e:(r={},t=e);const s=this.cursor(r);return this.Wn(s,t)}Jn(e){const t=this.cursor({});return new ve(((r,s)=>{t.onerror=a=>{const o=ij(a.target.error);s(o)},t.onsuccess=a=>{const o=a.target.result;o?e(o.primaryKey,o.value).next((l=>{l?o.continue():r()})):r()}}))}Wn(e,t){const r=[];return new ve(((s,a)=>{e.onerror=o=>{a(o.target.error)},e.onsuccess=o=>{const l=o.target.result;if(!l)return void s();const c=new Fle(l),d=t(l.primaryKey,l.value,c);if(d instanceof ve){const h=d.catch((m=>(c.done(),ve.reject(m))));r.push(h)}c.isDone?s():c.$n===null?l.continue():l.continue(c.$n)}})).next((()=>ve.waitFor(r)))}options(e,t){let r;return e!==void 0&&(typeof e=="string"?r=e:t=e),{index:r,range:t}}cursor(e){let t="next";if(e.reverse&&(t="prev"),e.index){const r=this.store.index(e.index);return e.jn?r.openKeyCursor(e.range,t):r.openCursor(e.range,t)}return this.store.openCursor(e.range,t)}}function $f(n){return new ve(((e,t)=>{n.onsuccess=r=>{const s=r.target.result;e(s)},n.onerror=r=>{const s=ij(r.target.error);t(s)}}))}let b4=!1;function ij(n){const e=jc.xn(Js());if(e>=12.2&&e<13){const t="An internal error was encountered in the Indexed Database server";if(n.message.indexOf(t)>=0){const r=new Fe("internal",`IOS_INDEXEDDB_BUG1: IndexedDb has thrown '${t}'. This is likely due to an unavoidable bug in iOS. See https://stackoverflow.com/q/56496296/110915 for details and a potential workaround.`);return b4||(b4=!0,setTimeout((()=>{throw r}),0)),r}}return n}/**
2692 * @license
2693 * Copyright 2020 Google LLC
2694 *
2695 * Licensed under the Apache License, Version 2.0 (the "License");
2696 * you may not use this file except in compliance with the License.
2697 * You may obtain a copy of the License at
2698 *
2699 *   http://www.apache.org/licenses/LICENSE-2.0
2700 *
2701 * Unless required by applicable law or agreed to in writing, software
2702 * distributed under the License is distributed on an "AS IS" BASIS,
2703 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2704 * See the License for the specific language governing permissions and
2705 * limitations under the License.
2706 */const y4="LruGarbageCollector",L7=1048576;function v4([n,e],[t,r]){const s=Pt(n,t);return s===0?Pt(e,r):s}class Vle{constructor(e){this.Yn=e,this.buffer=new Un(v4),this.Zn=0}Xn(){return++this.Zn}er(e){const t=[e,this.Xn()];if(this.buffer.size<this.Yn)this.buffer=this.buffer.add(t);else{const r=this.buffer.last();v4(t,r)<0&&(this.buffer=this.buffer.delete(r).add(t))}}get maxValue(){return this.buffer.last()[0]}}class O7{constructor(e,t,r){this.garbageCollector=e,this.asyncQueue=t,this.localStore=r,this.tr=null}start(){this.garbageCollector.params.cacheSizeCollectionThreshold!==-1&&this.nr(6e4)}stop(){this.tr&&(this.tr.cancel(),this.tr=null)}get started(){return this.tr!==null}nr(e){ze(y4,`Garbage collection scheduled in ${e}ms`),this.tr=this.asyncQueue.enqueueAfterDelay("lru_garbage_collection",e,(async()=>{this.tr=null;try{await this.localStore.collectGarbage(this.garbageCollector)}catch(t){Wh(t)?ze(y4,"Ignoring IndexedDB error during garbage collection: ",t):await Kh(t)}await this.nr(3e5)}))}}class Gle{constructor(e,t){this.rr=e,this.params=t}calculateTargetCount(e,t){return this.rr.ir(e).next((r=>Math.floor(t/100*r)))}nthSequenceNumber(e,t){if(t===0)return ve.resolve(Gi.wn);const r=new Vle(t);return this.rr.forEachTarget(e,(s=>r.er(s.sequenceNumber))).next((()=>this.rr.sr(e,(s=>r.er(s))))).next((()=>r.maxValue))}removeTargets(e,t,r){return this.rr.removeTargets(e,t,r)}removeOrphanedDocuments(e,t){return this.rr.removeOrphanedDocuments(e,t)}collect(e,t){return this.params.cacheSizeCollectionThreshold===-1?(ze("LruGarbageCollector","Garbage collection skipped; disabled"),ve.resolve(x4)):this.getCacheSize(e).next((r=>r<this.params.cacheSizeCollectionThreshold?(ze("LruGarbageCollector",`Garbage collection skipped; Cache size ${r} is lower than threshold ${this.params.cacheSizeCollectionThreshold}`),x4):this._r(e,t)))}getCacheSize(e){return this.rr.getCacheSize(e)}_r(e,t){let r,s,a,o,l,c,d;const h=Date.now();return this.calculateTargetCount(e,this.params.percentileToCollect).next((m=>(m>this.params.maximumSequenceNumbersToCollect?(ze("LruGarbageCollector",`C
2706apping sequence numbers to collect down to the maximum of ${this.params.maximumSequenceNumbersToCollect} from ${m}`),s=this.params.maximumSequenceNumbersToCollect):s=m,o=Date.now(),this.nthSequenceNumber(e,s)))).next((m=>(r=m,l=Date.now(),this.removeTargets(e,r,t)))).next((m=>(a=m,c=Date.now(),this.removeOrphanedDocuments(e,r)))).next((m=>(d=Date.now(),m0()<=an.DEBUG&&ze("LruGarbageCollector",`LRU Garbage Collection
2707	Counted targets in ${o-h}ms
2708	Determined least recently used ${s} in `+(l-o)+`ms
2709	Removed ${a} targets in `+(c-l)+`ms
2710	Removed ${m} documents in `+(d-c)+`ms
2711Total Duration: ${d-h}ms`),ve.resolve({didRun:!0,sequenceNumbersCollected:s,targetsRemoved:a,documentsRemoved:m}))))}}function M7(n,e){return new Gle(n,e)}/**
2712 * @license
2713 * Copyright 2020 Google LLC
2714 *
2715 * Licensed under the Apache License, Version 2.0 (the "License");
2716 * you may not use this file except in compliance with the License.
2717 * You may obtain a copy of the License at
2718 *
2719 *   http://www.apache.org/licenses/LICENSE-2.0
2720 *
2721 * Unless required by applicable law or agreed to in writing, software
2722 * distributed under the License is distributed on an "AS IS" BASIS,
2723 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2724 * See the License for the specific language governing permissions and
2725 * limitations under the License.
2726 */const F7="firestore.googleapis.com",B4=!0;class w4{constructor(e){if(e.host===void 0){if(e.ssl!==void 0)throw new Fe(Te.INVALID_ARGUMENT,"Can't provide ssl option if host option is not set");this.host=F7,this.ssl=B4}else this.host=e.host,this.ssl=e.ssl??B4;if(this.isUsingEmulator=e.emulatorOptions!==void 0,this.credentials=e.credentials,this.ignoreUndefinedProperties=!!e.ignoreUndefinedProperties,this.localCache=e.localCache,e._customHeaders&&(this._customHeaders={...e._customHeaders}),e.cacheSizeBytes===void 0)this.cacheSizeBytes=D7;else{if(e.cacheSizeBytes!==-1&&e.cacheSizeBytes<L7)throw new Fe(Te.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");this.cacheSizeBytes=e.cacheSizeBytes}if(kH("experimentalForceLongPolling",e.experimentalForceLongPolling,"experimentalAutoDetectLongPolling",e.experimentalAutoDetectLongPolling),this.experimentalForceLongPolling=!!e.experimentalForceLongPolling,this.experimentalForceLongPolling?this.experimentalAutoDetectLongPolling=!1:e.experimentalAutoDetectLongPolling===void 0?this.experimentalAutoDetectLongPolling=!0:this.experimentalAutoDetectLongPolling=!!e.experimentalAutoDetectLongPolling,this.experimentalLongPollingOptions=_7(e.experimentalLongPollingOptions??{}),(function(r){if(r.timeoutSeconds!==void 0){if(isNaN(r.timeoutSeconds))throw new Fe(Te.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (must not be NaN)`);if(r.timeoutSeconds<5)throw new Fe(Te.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (minimum allowed value is 5)`);if(r.timeoutSeconds>30)throw new Fe(Te.INVALID_ARGUMENT,`invalid long polling timeout: ${r.timeoutSeconds} (maximum allowed value is 30)`)}})(this.experimentalLongPollingOptions),this.useFetchStreams=!!e.useFetchStreams,e.grpcFlowControlWindow!==void 0){if(typeof e.grpcFlowControlWindow!="number"||e.grpcFlowControlWindow<=0||e.grpcFlowControlWindow>2147483647||!Number.isInteger(e.grpcFlowControlWindow))throw new Fe(Te.INVALID_ARGUMENT,"grpcFlowControlWindow must be a positive integer and cannot exceed 2147483647");this.grpcFlowControlWindow=e.grpcFlowControlWindow}}isEqual(e){return this.host===e.host&&this.ssl===e.ssl&&this.credentials===e.credentials&&this.cacheSizeBytes===e.cacheSizeBytes&&this.experimentalForceLongPolling===e.experimentalForceLongPolling&&this.experimentalAutoDetectLongPolling===e.experimentalAutoDetectLongPolling&&(function(r,s){return r.timeoutSeconds===s.timeoutSeconds})(this.experimentalLongPollingOptions,e.experimentalLongPollingOptions)&&this.ignoreUndefinedProperties===e.ignoreUndefinedProperties&&this.useFetchStreams===e.useFetchStreams&&this.grpcFlowControlWindow===e.grpcFlowControlWindow&&(function(r,s){if(r===s)return!0;if(!r||!s)return!1;const a=Object.keys(r),o=Object.keys(s);if(a.length!==o.length)return!1;for(const l of a)if(r[l]!==s[l])return!1;return!0})(this._customHeaders,e._customHeaders)}}let iv=class{constructor(e,t,r,s){this._authCredentials=e,this._appCheckCredentials=t,this._databaseId=r,this._app=s,this.type="firestore-lite",this._persistenceKey="(lite)",this._settings=new w4({}),this._settingsFrozen=!1,this._emulatorOptions={},this._terminateTask="notTerminated"}get app(){if(!this._app)throw new Fe(Te.FAILED_PRECONDITION,"Firestore was not initialized using the Firebase SDK. 'app' is not available");return this._app}get _initialized(){return this._settingsFrozen}get _terminated(){return this._terminateTask!=="notTerminated"}_setSettings(e){if(this._settingsFrozen)throw new Fe(Te.FAILED_PRECONDITION,"Firestore has already been started and its settings can no longer be changed. You can only modify settings before calling any other methods on a Firestore object.");this._settings=new w4(e),this._emulatorOptions=e.emulatorOptions||{},e.credentials!==void 0&&(this._authCredentials=(function(r){if(!r)return new N7;switch(r.type){case"firstParty":return new Ele(r.sessionIndex||"0",r.iamToken||null,r.authTokenFactory||null);case"provider":return r.client;default:throw new Fe(Te.INVALID_ARGUMENT,"makeAuthCredentialsProvider failed due to invali
2726d credential type")}})(e.credentials))}_getSettings(){return this._settings}_getEmulatorOptions(){return this._emulatorOptions}_freezeSettings(){return this._settingsFrozen=!0,this._settings}_delete(){return this._terminateTask==="notTerminated"&&(this._terminateTask=this._terminate()),this._terminateTask}async _restart(){this._terminateTask==="notTerminated"?await this._terminate():this._terminateTask="notTerminated"}toJSON(){return{app:this._app,databaseId:this._databaseId,settings:this._settings}}_terminate(){return(function(t){const r=g4.get(t);r&&(ze(Ole,"Removing Datastore"),g4.delete(t),r.terminate())})(this),Promise.resolve()}};function U7(n,e,t,r={}){var d;n=Zt(n,iv);const s=Ng(e),a=n._getSettings(),o={...a,emulatorOptions:n._getEmulatorOptions()},l=`${e}:${t}`;s&&AD(`https://${l}`),a.host!==F7&&a.host!==l&&Xs("Host has been set in both settings() and connectFirestoreEmulator(), emulator host will be used.");const c={...a,host:l,ssl:s,emulatorOptions:r};if(!Gl(c,o)&&(n._setSettings(c),r.mockUserToken)){let h,m;if(typeof r.mockUserToken=="string")h=r.mockUserToken,m=ha.MOCK_USER;else{h=lre(r.mockUserToken,(d=n._app)==null?void 0:d.options.projectId);const p=r.mockUserToken.sub||r.mockUserToken.user_id;if(!p)throw new Fe(Te.INVALID_ARGUMENT,"mockUserToken must contain 'sub' or 'user_id' field!");m=new ha(p)}n._authCredentials=new Ble(new k7(h,m))}}/**
2727 * @license
2728 * Copyright 2020 Google LLC
2729 *
2730 * Licensed under the Apache License, Version 2.0 (the "License");
2731 * you may not use this file except in compliance with the License.
2732 * You may obtain a copy of the License at
2733 *
2734 *   http://www.apache.org/licenses/LICENSE-2.0
2735 *
2736 * Unless required by applicable law or agreed to in writing, software
2737 * distributed under the License is distributed on an "AS IS" BASIS,
2738 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2739 * See the License for the specific language governing permissions and
2740 * limitations under the License.
2741 */class Zs{constructor(e,t,r){this.converter=t,this._query=r,this.type="query",this.firestore=e}withConverter(e){return new Zs(this.firestore,e,this._query)}}class Fn{constructor(e,t,r){this.converter=t,this._key=r,this.type="document",this.firestore=e}get _path(){return this._key.path}get id(){return this._key.path.lastSegment()}get path(){return this._key.path.canonicalString()}get parent(){return new Ul(this.firestore,this.converter,this._key.path.popLast())}withConverter(e){return new Fn(this.firestore,e,this._key)}toJSON(){return{type:Fn._jsonSchemaVersion,referencePath:this._key.toString()}}static fromJSON(e,t,r){if(Hm(t,Fn._jsonSchema))return new Fn(e,r||null,new Je(zt.fromString(t.referencePath)))}}Fn._jsonSchemaVersion="firestore/documentReference/1.0",Fn._jsonSchema={type:Ms("string",Fn._jsonSchemaVersion),referencePath:Ms("string")};class Ul extends Zs{constructor(e,t,r){super(e,t,Lg(r)),this._path=r,this.type="collection"}get id(){return this._query.path.lastSegment()}get path(){return this._query.path.canonicalString()}get parent(){const e=this._path.popLast();return e.isEmpty()?null:new Fn(this.firestore,null,new Je(e))}withConverter(e){return new Ul(this.firestore,e,this._path)}}function qs(n,e,...t){if(n=Yn(n),HD("collection","path",e),n instanceof iv){const r=zt.fromString(e,...t);return q3(r),new Ul(n,null,r)}{if(!(n instanceof Fn||n instanceof Ul))throw new Fe(Te.INVALID_ARGUMENT,"Expected first argument to collection() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(zt.fromString(e,...t));return q3(r),new Ul(n.firestore,null,r)}}function $le(n,e){if(n=Zt(n,iv),HD("collectionGroup","collection id",e),e.indexOf("/")>=0)throw new Fe(Te.INVALID_ARGUMENT,`Invalid collection ID '${e}' passed to function collectionGroup(). Collection IDs must not contain '/'.`);return new Zs(n,null,(function(r){return new nu(zt.emptyPath(),r)})(e))}function qi(n,e,...t){if(n=Yn(n),arguments.length===1&&(e=k1.newId()),HD("doc","path",e),n instanceof iv){const r=zt.fromString(e,...t);return z3(r),new Fn(n,null,new Je(r))}{if(!(n instanceof Fn||n instanceof Ul))throw new Fe(Te.INVALID_ARGUMENT,"Expected first argument to doc() to be a CollectionReference, a DocumentReference or FirebaseFirestore");const r=n._path.child(zt.fromString(e,...t));
2741return z3(r),new Fn(n.firestore,n instanceof Ul?n.converter:null,new Je(r))}}function Hle(n,e){return n=Yn(n),e=Yn(e),(n instanceof Fn||n instanceof Ul)&&(e instanceof Fn||e instanceof Ul)&&n.firestore===e.firestore&&n.path===e.path&&n.converter===e.converter}function oj(n,e){return n=Yn(n),e=Yn(e),n instanceof Zs&&e instanceof Zs&&n.firestore===e.firestore&&s7(n._query,e._query)&&n.converter===e.converter}/**
2742 * @license
2743 * Copyright 2017 Google LLC
2744 *
2745 * Licensed under the Apache License, Version 2.0 (the "License");
2746 * you may not use this file except in compliance with the License.
2747 * You may obtain a copy of the License at
2748 *
2749 *   http://www.apache.org/licenses/LICENSE-2.0
2750 *
2751 * Unless required by applicable law or agreed to in writing, software
2752 * distributed under the License is distributed on an "AS IS" BASIS,
2753 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2754 * See the License for the specific language governing permissions and
2755 * limitations under the License.
2756 *//**
2757 * @license
2758 * Copyright 2024 Google LLC
2759 *
2760 * Licensed under the Apache License, Version 2.0 (the "License");
2761 * you may not use this file except in compliance with the License.
2762 * You may obtain a copy of the License at
2763 *
2764 *   http://www.apache.org/licenses/LICENSE-2.0
2765 *
2766 * Unless required by applicable law or agreed to in writing, software
2767 * distributed under the License is distributed on an "AS IS" BASIS,
2768 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2769 * See the License for the specific language governing permissions and
2770 * limitations under the License.
2771 */class gi{constructor(e){this._values=(e||[]).map((t=>t))}toArray(){return this._values.map((e=>e))}isEqual(e){return(function(r,s){if(r.length!==s.length)return!1;for(let a=0;a<r.length;++a)if(r[a]!==s[a])return!1;return!0})(this._values,e._values)}toJSON(){return{type:gi._jsonSchemaVersion,vectorValues:this._values}}static fromJSON(e){if(Hm(e,gi._jsonSchema)){if(Array.isArray(e.vectorValues)&&e.vectorValues.every((t=>typeof t=="number")))return new gi(e.vectorValues);throw new Fe(Te.INVALID_ARGUMENT,"Expected 'vectorValues' field to be a number array")}}}gi._jsonSchemaVersion="firestore/vectorValue/1.0",gi._jsonSchema={type:Ms("string",gi._jsonSchemaVersion),vectorValues:Ms("object")};/**
2772 * @license
2773 * Copyright 2017 Google LLC
2774 *
2775 * Licensed under the Apache License, Version 2.0 (the "License");
2776 * you may not use this file except in compliance with the License.
2777 * You may obtain a copy of the License at
2778 *
2779 *   http://www.apache.org/licenses/LICENSE-2.0
2780 *
2781 * Unless required by applicable law or agreed to in writing, software
2782 * distributed under the License is distributed on an "AS IS" BASIS,
2783 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2784 * See the License for the specific language governing permissions and
2785 * limitations under the License.
2786 */const zle=/^__.*__$/;class qle{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return this.fieldMask!==null?new tu(e,this.data,this.fieldMask,t,this.fieldTransforms):new Rg(e,this.data,t,this.fieldTransforms)}}class V7{constructor(e,t,r){this.data=e,this.fieldMask=t,this.fieldTransforms=r}toMutation(e,t){return new tu(e,this.data,this.fieldMask,t,this.fieldTransforms)}}function G7(n){switch(n){case 0:case 2:case 1:return!0;case 3:case 4:return!1;default:throw ot(40011,{dataSource:n})}}class M1{constructor(e,t,r,s,a,o){this.settings=e,this.databaseId=t,this.serializer=r,this.ignoreUndefinedProperties=s,a===void 0&&this.validatePath(),this.fieldTransforms=a||[],this.fieldMask=o||[]}get path(){return this.settings.path}get dataSource(){return this.settings.dataSource}contextWith(e){return new M1({...this.settings,...e},this.databaseId,this.serializer,this.ignoreUndefinedProperties,this.fieldTransforms,this.fieldMask)}childContextForField(e){var s;const t=(s=this.path)==null?void 0:s.child(e),r=this.contextWith({path:t,arrayElement:!1});return r.validatePathSegment(e),r}childContextForFieldPath(e){var s;const t=(s=this.path)==null?void 0:s.child(e),r=this.contextWith({path:t,arrayElement:!1});return r.validatePath(),r}childContextForArray(e){return this.contextWith({path:void 0,arrayElement:!0})}createError(e){return YC(e,this.settings.methodName,this.settings.hasConverter||!1,this.path,this.settings.targetDoc)}contains(e){return this.fieldMask.find((t=>e.isPrefixOf(t)))!==void 0||this.fieldTransforms.find((t=>e.isPrefixOf(t.field)))!==void 0}validatePath(){if(this.path)for(let e=0;e<this.path.length;e++)this.validatePathSegment(this.path.get(e))}validatePathSegment(e){if(e.length===0)throw this.createError("Document fields must not be empty");if(G7(this.dataSource)&&zle.test(e))throw this.createError('Document fields cannot begin and end with "__"')}}class Kle{constructor(e,t,r){this.databaseId=e,this.ignoreUndefinedProperties=t,this.serializer
2786=r||qm(e)}createContext(e,t,r,s=!1){return new M1({dataSource:e,methodName:t,targetDoc:r,path:Es.emptyPath(),arrayElement:!1,hasConverter:s},this.databaseId,this.serializer,this.ignoreUndefinedProperties)}}function Wm(n){const e=n._freezeSettings(),t=qm(n._databaseId);return new Kle(n._databaseId,!!e.ignoreUndefinedProperties,t)}function F1(n,e,t,r,s,a={}){const o=n.createContext(a.merge||a.mergeFields?2:0,e,t,s);gj("Data must be an object, but it was:",o,r);const l=z7(r,o);let c,d;if(a.merge)c=new Vi(o.fieldMask),d=o.fieldTransforms;else if(a.mergeFields){const h=[];for(const m of a.mergeFields){const p=$l(e,m,t);if(!o.contains(p))throw new Fe(Te.INVALID_ARGUMENT,`Field '${p}' is specified in your field mask but missing from your input data.`);W7(h,p)||h.push(p)}c=new Vi(h),d=o.fieldTransforms.filter((m=>c.covers(m.field)))}else c=null,d=o.fieldTransforms;return new qle(new Ws(l),c,d)}class ov extends zc{_toFieldTransform(e){if(e.dataSource!==2)throw e.dataSource===1?e.createError(`${this._methodName}() can only appear at the top level of your update data`):e.createError(`${this._methodName}() cannot be used with set() unless you pass {merge:true}`);return e.fieldMask.push(e.path),null}isEqual(e){return e instanceof ov}}function $7(n,e,t){return new M1({dataSource:3,targetDoc:e.settings.targetDoc,methodName:n._methodName,arrayElement:t},e.databaseId,e.serializer,e.ignoreUndefinedProperties)}class lj extends zc{_toFieldTransform(e){return new zm(e.path,new Q0)}isEqual(e){return e instanceof lj}}class cj extends zc{constructor(e,t){super(e),this.ar=t}_toFieldTransform(e){const t=$7(this,e,!0),r=this.ar.map((a=>Oc(a,t))),s=new Tm(r);return new zm(e.path,s)}isEqual(e){return e instanceof cj&&Gl(this.ar,e.ar)}}class dj extends zc{constructor(e,t){super(e),this.ar=t}_toFieldTransform(e){const t=$7(this,e,!0),r=this.ar.map((a=>Oc(a,t))),s=new Am(r);return new zm(e.path,s)}isEqual(e){return e instanceof dj&&Gl(this.ar,e.ar)}}class uj extends zc{constructor(e,t){super(e),this.ur=t}_toFieldTransform(e){const t=new km(e.serializer,jg(e.serializer,this.ur));return new zm(e.path,t)}isEqual(e){return e instanceof uj&&(this.ur===e.ur||Number.isNaN(this.ur)&&Number.isNaN(e.ur))}}class hj extends zc{constructor(e,t){super(e),this.ur=t}_toFieldTransform(e){const t=new J0(e.serializer,jg(e.serializer,this.ur));return new zm(e.path,t)}isEqual(e){return e instanceof hj&&(this.ur===e.ur||Number.isNaN(this.ur)&&Number.isNaN(e.ur))}}class fj extends zc{constructor(e,t){super(e),this.ur=t}_toFieldTransform(e){const t=new X0(e.serializer,jg(e.serializer,this.ur));return new zm(e.path,t)}isEqual(e){return e instanceof fj&&(this.ur===e.ur||Number.isNaN(this.ur)&&Number.isNaN(e.ur))}}function mj(n,e,t,r){const s=n.createContext(1,e,t);gj("Data must be an object, but it was:",s,r);const a=[],o=Ws.empty();qh(r,((c,d)=>{const h=xj(e,c,t);d=Yn(d);const m=s.childContextForFieldPath(h);if(d instanceof ov)a.push(h);else{const p=Oc(d,m);p!=null&&(a.push(h),o.set(h,p))}}));const l=new Vi(a);return new V7(o,l,s.fieldTransforms)}function pj(n,e,t,r,s,a){const o=n.createContext(1,e,t),l=[$l(e,r,t)],c=[s];if(a.length%2!=0)throw new Fe(Te.INVALID_ARGUMENT,`Function ${e}() needs to be called with an even number of arguments that alternate between field names and values.`);for(let p=0;p<a.length;p+=2)l.push($l(e,a[p])),c.push(a[p+1]);const d=[],h=Ws.empty();for(let p=l.length-1;p>=0;--p)if(!W7(d,l[p])){const x=l[p];let y=c[p];y=Yn(y);const v=o.childContextForFieldPath(x);if(y instanceof ov)d.push(x);else{const B=Oc(y,v);B!=null&&(d.push(x),h.set(x,B))}}const m=new Vi(d);return new V7(h,m,o.fieldTransforms)}function H7(n,e,t,r=!1){return Oc(t,n.createContext(r?4:3,e))}function Oc(n,e,t){if(K7(n=Yn(n)))return gj("Unsupported field value:",e,n),z7(n,e);if(n instanceof zc)return(function(s,a){if(!G7(a.dataSource))throw a.createError(`${s._methodName}() can only be used with update() and set()`);if(!a.path)throw a.createError(`${s._methodName}() is not currently supported inside arrays`);const o=s._toFieldTransform(a);o&&a.fieldTransforms.push(o)})(n,e),null;if(n===void 0&&e.ignoreUndefinedProperties)return null;if(e.path&&e.fieldMask.push(e.path),n instanceof Array){if(e.settings.arrayElement&&e.dataSource!==4)throw e.createError("Nested arrays are not supported");return(function(s,a){const o=[];let l=0;for(const c of s){let d=Oc(c,a.childContextForArray(l));d==null&&(d={nullValue:"NULL_VALUE"}),o.push(d),l++}return{arrayValue:{values:o}}})(n,e)}return(function(s,a,o){if((s=Yn(s))===null)return{nullValue:"NULL_VALUE"};if(typeof s=="number")return jg(a.serializer,s);if(typeof s=="boolean")return{booleanValue:s};if(typeof s=="string")return{stringValue:s};if(s instanceof Date){const l=bn.fromDate(s);return{timestampValue:dm(a.serializer,l)}}if(s instanceof bn){const l=new bn(s.seconds,1e3*Math.floor(s.nanoseconds/1e3));return{timestampValue:dm(a.serializer,l)}}if(q7(s)){const l=bn.fromInstant(s),c=new bn(l.seconds,1e3*Math.floor(l.nanoseconds/1e3));return{timestampValue:dm(a.serializer,c)}}if(s instanceof Fl)return{geoPointValue:{latitude:s.latitude,longitude:s.longitude}};if(s instanceof Ui)return{bytesValue:f7(a.serializer,s._byteString)};if(s instanceof Fn){const l=a.databaseId,c=s.firestore._databaseId;if(!c.isEqual(l))throw a.createError(`Document reference is for database ${c.projectId}/${c.database} but should be for database ${l.projectId}/${l.database}`);return{referenceValue:sj(s.firestore._databaseId||a.databaseId,s._key.path)}}if(s instanceof gi)return(function(c,d){const h=c instanceof gi?c.toArray():c;return{mapValue:{fields:{[zD]:{stringValue:qD},[Cm]:{arrayValue:{values:h.map((p=>{if(typeof p!="number")throw d.createError("VectorValues must only contain numeric values.");return _1(d.serializer,p)}))}}}}}})(s,a);if(S7(s))return s._toProto(a.serializer);throw a.createError(`Unsupported field value: ${N1(s)}`)})(n,e)}function z7(n,e){const t={};return AH(n)?e.path&&e.path.length>
27860&&e.fieldMask.push(e.path):qh(n,((r,s)=>{const a=Oc(s,e.childContextForField(r));a!=null&&(t[r]=a)})),{mapValue:{fields:t}}}function q7(n){if(typeof n!="object"||n===null)return!1;if(typeof Temporal<"u"&&typeof Temporal.Instant=="function"&&n instanceof Temporal.Instant)return!0;const e=n;return e[Symbol.toStringTag]==="Temporal.Instant"&&typeof e.t=="bigint"}function K7(n){return!(typeof n!="object"||n===null||n instanceof Array||n instanceof Date||n instanceof bn||n instanceof Fl||n instanceof Ui||n instanceof Fn||n instanceof zc||n instanceof gi||q7(n)||S7(n))}function gj(n,e,t){if(!K7(t)||!tv(t)){const r=N1(t);throw r==="an object"?e.createError(n+" a custom object"):e.createError(n+" "+r)}}function $l(n,e,t){if((e=Yn(e))instanceof Km)return e._internalPath;if(typeof e=="string")return xj(n,e);throw YC("Field path arguments must be of type string or ",n,!1,void 0,t)}const Wle=new RegExp("[~\\*/\\[\\]]");function xj(n,e,t){if(e.search(Wle)>=0)throw YC(`Invalid field path (${e}). Paths must not contain '~', '*', '/', '[', or ']'`,n,!1,void 0,t);try{return new Km(...e.split("."))._internalPath}catch{throw YC(`Invalid field path (${e}). Paths must not be empty, begin with '.', end with '.', or contain '..'`,n,!1,void 0,t)}}function YC(n,e,t,r,s){const a=r&&!r.isEmpty(),o=s!==void 0;let l=`Function ${e}() called with invalid data`;t&&(l+=" (via `toFirestore()`)"),l+=". ";let c="";return(a||o)&&(c+=" (found",a&&(c+=` in field ${r}`),o&&(c+=` in document ${s}`),c+=")"),new Fe(Te.INVALID_ARGUMENT,l+n+c)}function W7(n,e){return n.some((t=>t.isEqual(e)))}function Y7(n){return typeof n._readUserData=="function"}/**
2787 * @license
2788 * Copyright 2025 Google LLC
2789 *
2790 * Licensed under the Apache License, Version 2.0 (the "License");
2791 * you may not use this file except in compliance with the License.
2792 * You may obtain a copy of the License at
2793 *
2794 *   http://www.apache.org/licenses/LICENSE-2.0
2795 *
2796 * Unless required by applicable law or agreed to in writing, software
2797 * distributed under the License is distributed on an "AS IS" BASIS,
2798 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2799 * See the License for the specific language governing permissions and
2800 * limitations under the License.
2801 */class ni{constructor(e){this.optionDefinitions=e}_getKnownOptions(e,t){const r=Ws.empty();for(const s in this.optionDefinitions)if(this.optionDefinitions.hasOwnProperty(s)){const a=this.optionDefinitions[s];if(s in e){const o=e[s];let l;a.nestedOptions&&tv(o)?l={mapValue:{fields:new ni(a.nestedOptions).getOptionsProto(t,o)}}:o&&(l=Oc(o,t)??void 0),l&&r.set(Es.fromServerFormat(a.serverName),l)}}return r}getOptionsProto(e,t,r){const s=this._getKnownOptions(t,e);if(r){const a=new Map($D(r,((o,l)=>[Es.fromServerFormat(l),o!==void 0?Oc(o,e):null])));s.setAll(a)}return s.value.mapValue.fields??{}}}/**
2802 * @license
2803 * Copyright 2024 Google LLC
2804 *
2805 * Licensed under the Apache License, Version 2.0 (the "License");
2806 * you may not use this file except in compliance with the License.
2807 * You may obtain a copy of the License at
2808 *
2809 *   http://www.apache.org/licenses/LICENSE-2.0
2810 *
2811 * Unless required by applicable law or agreed to in writing, software
2812 * distributed under the License is distributed on an "AS IS" BASIS,
2813 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2814 * See the License for the specific language governing permissions and
2815 * limitations under the License.
2816 */function Yle(n){return typeof n=="object"&&n!==null&&!!("nullValue"in n&&(n.nullValue===null||n.nullValue==="NULL_VALUE")||"booleanValue"in n&&(n.booleanValue===null||typeof n.booleanValue=="boolean")||"integerValue"in n&&(n.integerValue===null||typeof n.integerValue=="number"||typeof n.integerValue=="string")||"doubleValue"in n&&(n.doubleValue===null||typeof n.doubleValue=="number")||"timestampValue"in n&&(n.timestampValue===null||(function(t){return typeof t=="object"&&t!==null&&"seconds"in t&&(t.seconds===null||typeof t.seconds=="number"||typeof t.seconds=="string")&&"nanos"in t&&(t.nanos===null||typeof t.nanos=="number")})(n.timestampValue))||"stringValue"in n&&(n.stringValue===null||typeof n.stringValue=="string")||"bytesValue"in n&&(n.bytesValue===null||n.bytesValue instanceof Uint8Array)||"referenceValue"in n&&(n.referenceValue===null||typeof n.referenceValue=="string")||"geoPointValue"in n&&(n.geoPointValue===null||(function(t){return typeof t=="object"&&t!==null&&"latitude"in t&&(t.latitude===null||typeof t.latitude=="number")&&"longitude"in t&&(t.longitude===null||typeof t.longitude=="number")})(n.geoPointValue))||"arrayValue"in n&&(n.arrayValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("values"in t)||t.values!==null&&!Array.isArray(t.values))})(n.arrayValue))||"mapValue"in n&&(n.mapValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("fields"in t)||t.fields!==null&&!tv(t.fields))})(n.mapValue))||"fieldReferenceValue"in n&&(n.fieldReferenceValue===null||typeof n.fieldReferenceValue=="string")||"functionValue"in n&&(n.functionValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("name"in t)||t.name!==null&&typeof t.name!="string"||!("args"in t)||t.args!==null&&!Array.isArray(t.args))})(n.functionValue))||"pipelineValue"in n&&(n.pipelineValue===null||(function(t){return typeof t=="object"&&t!==null&&!(!("stages"in t)||t.stages!==null&&!Array.isArray(t.stages))})(n.pipelineValue)))}/**
2817 * @license
2818 * Copyright 2020 Google LLC
2819 *
2820 * Licensed under the Apache License, Version 2.0 (the "License");
2821 * you may not use this file except in compliance with the License.
2822 * You may obtain a copy of the License at
2823 *
2824 *   http://www.apache.org/licenses/LICENSE-2.0
2825 *
2826 * Unless required by applicable law or agreed to in writing, software
2827 * distributed under the License is distributed on an "AS IS" BASIS,
2828 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2829 * See the License for the specific language governing permissions and
2830 * limitations under the License.
2831 */function Qle(){return new ov("deleteField")}function Sd(){return new lj("serverTimestamp")}function Jle(...n){return new cj("arrayUnion",n)}function Xle(...n){return new dj("arrayRemove",n)}function Zle(n){return new uj("increment",n)}function ece(n){return new hj("minimum",n)}function tce(n){return new fj("maximum",n)}function Q7(n){return new gi(n)}/**
2832 * @license
2833 * Copyright 2024 Google LLC
2834 *
2835 * Licensed under the Apache License, Version 2.0 (the "License");
2836 * you may not use this file except in compliance with the License.
2837 * You may obtain a copy of the License at
2838 *
2839 *   http://www.apache.org/licenses/LICENSE-2.0
2840 *
2841 * Unless required by applicable law or agreed to in writing, software
2842 * distributed under the License is distributed on an "AS IS" BASIS,
2843 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2844 * See the License for the specific language governing permissions and
2845 * limitations under the License.
2846 */function Ze(n){let e;return n instanceof Ym?n:(e=tv(n)?ice(n):n instanceof Array?oce(n):J7(n,void 0),e)}function Tk(n){if(n instanceof Ym)return n;if(n instanceof gi)return ly(n);if(Array.isArray(n))return ly(Q7(n));throw new Error("Unsupported value: "+typeof n)}function bj(n){return Ioe(n)?lC(n):Ze(n)}class Ym{constructor(){this._protoValueType="ProtoValue"}add(e){return new Me("add",[this,Ze(e)],"add")}asBoolean(){if(this instanceof Ih)return this;if(this instanceof Jm)return new Z7(this);if(this instanceof Qm)return new ace(this);if(this instanceof Me)return new X7(this);throw new Fe("invalid-argument",`Conversion of type ${typeof this} to BooleanExpression not supported.`)}subtract(e){return new Me("subtract",[this,Ze(e)],"subtract")}multiply(e){return new Me("multiply",[this,Ze(e)],"multiply")}divide(e){return new Me("divide",[this,Ze(e)],"divide")}mod(e){return new Me("mod",[this,Ze(e)],"mod")}equal(e){return new Me("equal",[this,Ze(e)],"equal").asBoolean()}notEqual(e){return new Me("not_equal",[this,Ze(e)],"notEqual").asBoolean()}lessThan(e){return new Me("less_than",[this,Ze(e)],"lessThan").asBoolean()}lessThanOrEqual(e){return new Me("less_than_or_equal",[this,Ze(e)],"lessThanOrEqual").asBoolean()}greaterThan(e){return new Me("greater_than",[this,Ze(e)],"greaterThan").asBoolean()}greaterThanOrEqual(e){return new Me("greater_than_or_equal",[this,Ze(e)],"greaterThanOrEqual").asBoolean()}arrayConcat(e,...t){const r=[e,...t].map((s=>Ze(s)));return new Me("array_concat",[this,...r],"arrayConcat")}arrayContains(e){return new Me("array_contains",[this,Ze(e)],"arrayContains").asBoolean()}arrayContainsAll(e){const t=Array.isArray(e)?new Cb(e.map(Ze),"arrayContainsAll"):e;return new Me("array_contains_all",[this,t],"arrayContainsAll").asBoolean()}arrayContainsAny(e){const t=Array.isArray(e)?new Cb(e.map(Ze),"arrayContainsAny"):e;return new Me("array_contains_any",[this,t],"arrayContainsAny").asBoolean()}arrayReverse(){return new Me("array_reverse",[this])}arrayLength(){return new Me("array_length",[this],"arrayLength")}equalAny(e){const t=Array.isArray(e)?new Cb(e.map(Ze),"equalAny"):e;return new Me("equal_any",[this,t],"equalAny").asBoolean()}notEqualAny(e){const t=Array.isArray(e)?new Cb(e.map(Ze),"notEqualAny"):e;return new Me("not_equal_any",[this,t],"notEqualAny").asBoolean()}exists(){return new Me("exists",[this],"exists").asBoolean()}charLength(){return new Me("char_length",[this],"charLength")}like(e){return new Me("like",[this,Ze(e)],"like").asBoolean()}regexContains(e){return new Me("regex_contains",[this,Ze(e)],"regexContains").asBoolean()}regexFind(e){return new Me("regex_find",[this,Ze(e)],"regexFind")}regexFindAll(e){return new Me("regex_find_all",[this,Ze(e)],"regexFindAll")}regexMatch(e){return new Me("regex_match",[this,Ze(e)],"regexMatch").asBoolean()}stringContains(e){return new Me("string_contains",[this,Ze(e)],"stringContains").asBoolean()}startsWith(e){return new Me("starts_with",[this,Ze(e)],"startsWith").asBoolean()}endsWith(e){return new Me("ends_with",[this,Ze(e)],"endsWith").asBoolean()}toLower(){return new Me("to_lower",[this],"toLower")}toUpper(){return new Me("to_upper",[this],"toUpper")}trim(e){const t=[this];return e&&t.push(Ze(e)),new Me("trim",t,"trim")}ltrim(e){const t=[this];return e&&t.push(Ze(e)),new Me("ltrim",t,"ltrim")}rtrim(e){const t=[this];return e&&t.push(Ze(e)),new Me("rtrim",t,"rtrim")}type(){return new Me("type",[this])}isType(e){return new Me("is_type",[this,ly(e)],"isType").asBoolean()}stringConcat(e,...t){const r=[e,...t].map(Ze);return new Me("string_concat",[this,...r],"stringConcat")}stringIndexOf(e){return new Me("string_index_of",[this,Ze(e)],"stringIndexOf")}stringRepeat(e){return new Me("string_repeat",[this,Ze(e)],"stringRepeat")}stringReplaceAll(e,t){return new Me("string_replace_all",[this,Ze(e),Ze(t)],"stringReplaceAll")}stringReplaceOne(e,t){return new Me("string_replace_one",[this,Ze(e),Ze(t)],"stringReplaceOne")}concat(e,...t){const r=[e,...t].map(Ze);return new Me("concat",[this,...r],"concat")}reverse(){return new Me("reverse",[this],"reverse")}arrayFilter(e,t){return new Me("array_filter",[this,Ze(e),t],"arrayFilter")}arrayTransform(e,t){return new Me("array_transform",[this,Ze(e),t],"arrayTransform")}arrayTransformWithIndex(e,t,r){return new Me("array_transform",[this,Ze(e),Ze(t),r],"arrayTransformWithIndex")}arraySlice(e,t){const r=[this,Ze(e)];return t!==void 0&&r.push(Ze(t)),new Me("array_slice",r,"arraySlice")}arrayFirst(){return new Me("array_first",[this],"arrayFirst")}arrayFirstN(e){return new Me("array_first_n",[this,Ze(e)],"arrayFirstN")}arrayLast(){return new Me("array_last",[this],"arrayLast")}arrayLastN(e){return new Me("array_last_n",[this,Ze(e)],"arrayLastN")}arrayMaximum(){return new Me("maximum",[this],"arrayMaximum")}arrayMaximumN(e){return new Me("maximum_n",[this,Ze(e)],"arrayMaximumN")}arrayMinimum(){return new Me("minimum",[this],"arrayMinimum")}arrayMinimumN(e){return new Me("minimum_n",[this,Ze(e)],"arrayMinimumN")}arrayIndexOf(e){return new Me("array_index_of",[this,Ze(e),Ze("first")],"arrayIndexOf")}arrayLastIndexOf(e){return new Me("array_index_of",[this,Ze(e),Ze("last")],"arrayLastIndexOf")}arrayIndexOfAll(e){return new Me("array_index_of_all",[this,Ze(e)],"arrayIndexOfAll")}byteLength(){return new Me("byte_length",[this],"byteLength")}ceil(){return new Me("ceil",[this])}floor(){return new Me("floor",[this])}abs(){return new Me("abs",[this])}exp(){return new Me("exp",[this])}mapGet(e){return new Me("map_get",[this,ly(e)],"mapGet")}
vendor: 4,442 bytes, line 2846
2846mapSet(e,t,...r){const s=[this,Ze(e),Ze(t),...r.map(Ze)];return new Me("map_set",s,"mapSet")}mapKeys(){return new Me("map_keys",[this],"mapKeys")}mapValues(){return new Me("map_values",[this],"mapValues")}mapEntries(){return new Me("map_entries",[this],"mapEntries")}getField(e){return new Me("get_field",[this,Ze(e)],"get_field")}count(){return ho._create("count",[this],"count")}sum(){return ho._create("sum",[this],"sum")}average(){return ho._create("average",[this],"average")}minimum(){return ho._create("minimum",[this],"minimum")}maximum(){return ho._create("maximum",[this],"maximum")}first(){return ho._create("first",[this],"first")}last(){return ho._create("last",[this],"last")}arrayAgg(){return ho._create("array_agg",[this],"arrayAgg")}arrayAggDistinct(){return ho._create("array_agg_distinct",[this],"arrayAggDistinct")}countDistinct(){return ho._create("count_distinct",[this],"countDistinct")}logicalMaximum(e,...t){const r=[e,...t];return new Me("maximum",[this,...r.map(Ze)],"logicalMaximum")}logicalMinimum(e,...t){const r=[e,...t];return new Me("minimum",[this,...r.map(Ze)],"minimum")}vectorLength(){return new Me("vector_length",[this],"vectorLength")}cosineDistance(e){return new Me("cosine_distance",[this,Tk(e)],"cosineDistance")}dotProduct(e){return new Me("dot_product",[this,Tk(e)],"dotProduct")}euclideanDistance(e){return new Me("euclidean_distance",[this,Tk(e)],"euclideanDistance")}unixMicrosToTimestamp(){return new Me("unix_micros_to_timestamp",[this],"unixMicrosToTimestamp")}timestampToUnixMicros(){return new Me("timestamp_to_unix_micros",[this],"timestampToUnixMicros")}unixMillisToTimestamp(){return new Me("unix_millis_to_timestamp",[this],"unixMillisToTimestamp")}timestampToUnixMillis(){return new Me("timestamp_to_unix_millis",[this],"timestampToUnixMillis")}unixSecondsToTimestamp(){return new Me("unix_seconds_to_timestamp",[this],"unixSecondsToTimestamp")}timestampToUnixSeconds(){return new Me("timestamp_to_unix_seconds",[this],"timestampToUnixSeconds")}timestampAdd(e,t){return new Me("timestamp_add",[this,Ze(e),Ze(t)],"timestampAdd")}timestampSubtract(e,t){return new Me("timestamp_subtract",[this,Ze(e),Ze(t)],"timestampSubtract")}timestampDiff(e,t){return new Me("timestamp_diff",[this,bj(e),Ze(t)],"timestampDiff")}timestampExtract(e,t){const r=[this,Ze(e)];return t&&r.push(Ze(t)),new Me("timestamp_extract",r,"timestampExtract")}documentId(){return new Me("document_id",[this],"documentId")}parent(){return new Me("parent",[this],"parent")}substring(e,t){const r=Ze(e);return new Me("substring",t===void 0?[this,r]:[this,r,Ze(t)],"substring")}arrayGet(e){return new Me("array_get",[this,Ze(e)],"arrayGet")}isError(){return new Me("is_error",[this],"isError").asBoolean()}ifError(e){const t=new Me("if_error",[this,Ze(e)],"ifError");return e instanceof Ih?t.asBoolean():t}isAbsent(){return new Me("is_absent",[this],"isAbsent").asBoolean()}mapRemove(e){return new Me("map_remove",[this,Ze(e)],"mapRemove")}mapMerge(e,...t){const r=Ze(e),s=t.map(Ze);return new Me("map_merge",[this,r,...s],"mapMerge")}pow(e){return new Me("pow",[this,Ze(e)])}trunc(e){return e===void 0?new Me("trunc",[this]):new Me("trunc",[this,Ze(e)],"trunc")}round(e){return e===void 0?new Me("round",[this]):new Me("round",[this,Ze(e)],"round")}collectionId(){return new Me("collection_id",[this])}length(){return new Me("length",[this])}ln(){return new Me("ln",[this])}sqrt(){return new Me("sqrt",[this])}stringReverse(){return new Me("string_reverse",[this])}ifAbsent(e){return new Me("if_absent",[this,Ze(e)],"ifAbsent")}ifNull(e){return new Me("if_null",[this,Ze(e)],"ifNull")}coalesce(e,...t){return new Me("coalesce",[this,Ze(e),...t.map(Ze)],"coalesce")}join(e){return new Me("join",[this,Ze(e)],"join")}log10(){return new Me("log10",[this])}arraySum(){return new Me("sum",[this])}split(e){return new Me("split",[this,Ze(e)])}timestampTruncate(e,t){const r=[this,Ze(e)];return t&&r.push(Ze(t)),new Me("timestamp_trunc",r)}ascending(){return lce(this)}descending(){return cce(this)}as(e){return new rce(this,e,"as")}}class ho{constructor(e,t){this.name=e,this.params=t,this.exprType="AggregateFunction",this._protoValueType="ProtoValue"}static _create(e,t,r){const s=new ho(e,t);return s._methodName=r,s}as(e){return new nce(this,e,"as")}_toProto(e){return{functionValue:{name:this.name,args:this.params.map((t=>t._toProto(e)))}}}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}
2846):e,this.params.forEach((t=>t._readUserData(e)))}}class nce{constructor(e,t,r){this.aggregate=e,this.alias=t,this._methodName=r}_readUserData(e){this.aggregate._readUserData(e)}}class rce{constructor(e,t,r){this.expr=e,this.alias=t,this._methodName=r,this.exprType="AliasedExpression",this.selectable=!0}_readUserData(e){this.expr._readUserData(e)}}class Cb extends Ym{constructor(e,t){super(),this.cr=e,this._methodName=t,this.expressionType="ListOfExpressions"}_toProto(e){return{arrayValue:{values:this.cr.map((t=>t._toProto(e)))}}}_readUserData(e){this.cr.forEach((t=>t._readUserData(e)))}}class Qm extends Ym{constructor(e,t){super(),this.fieldPath=e,this._methodName=t,this.expressionType="Field",this.selectable=!0}get _fieldPath(){return this.fieldPath}get fieldName(){return this.fieldPath.canonicalString()}get alias(){return this.fieldName}get expr(){return this}geoDistance(e){return new Me("geo_distance",[this,Ze(e)],"geoDistance")}_toProto(e){return{fieldReferenceValue:this.fieldPath.canonicalString()}}_readUserData(e){}}function lC(n){return sce(n,"field")}function sce(n,e){return new Qm(typeof n=="string"?gc===n?A7()._internalPath:$l("field",n):n._internalPath,e)}class Jm extends Ym{constructor(e,t){super(),this.value=e,this._methodName=t,this.expressionType="Constant"}static _fromProto(e){const t=new Jm(e,void 0);return t._protoValue=e,t}_toProto(e){return Ke(this._protoValue!==void 0,237),this._protoValue}_getValue(){return this._protoValue}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,Yle(this._protoValue)||(this._protoValue=Oc(this.value,e))}}function ly(n,e){return J7(n,"constant")}function J7(n,e){const t=new Jm(n,e);return typeof n=="boolean"?new Z7(t):t}let Me=class extends Ym{constructor(e,t,r,s){super(),this.name=e,this.params=t,this.expressionType="Function",this._optionsProto=void 0,r!==void 0&&(this._methodName=r),s!==void 0&&(this._options=s)}get _optionsUtil(){return new ni({})}_toProto(e){const t={functionValue:{name:this.name,args:this.params.map((r=>r._toProto(e)))}};return this._optionsProto&&(t.functionValue.options=this._optionsProto),t}_readUserData(e){e=this._methodName?e.contextWith({methodName:this._methodName}):e,this.params.forEach((t=>t._readUserData(e))),this._options&&(this._optionsProto=this._optionsUtil.getOptionsProto(e,this._options))}};class Ih extends Ym{get _methodName(){return this._expr._methodName}countIf(){return ho._create("count_if",[this],"countIf")}not(){return new Me("not",[this],"not").asBoolean()}conditional(e,t){return new Me("conditional",[this,e,t],"conditional")}ifError(e){const t=Ze(e),r=new Me("if_error",[this,t],"ifError");return t instanceof Ih?r.asBoolean():r}_toProto(e){return this._expr._toProto(e)}_readUserData(e){this._expr._readUserData(e)}}class X7 extends Ih{constructor(e){super(),this._expr=e,this.expressionType="Function"}}class Z7 extends Ih{constructor(e){super(),this._expr=e,this.expressionType="Constant"}_getValue(){return this._expr._getValue()}}class ace extends Ih{constructor(e){super(),this._expr=e,this.expressionType="Field"}}function ice(n,e){const t=[];for(const r in n)if(Object.prototype.hasOwnProperty.call(n,r)){const s=n[r];t.push(ly(r)),t.push(Ze(s))}return new Me("map",t,"map")}function oce(n){return(function(t,r){return new Me("array",t.map((s=>Ze(s))),r)})(n,"array")}function lce(n){return new yj(bj(n),"ascending","ascending")}function cce(n){return new yj(bj(n),"descending","descending")}class yj{constructor(e,t,r){this.expr=e,this.direction=t,this._methodName=r,this._protoValueType="ProtoValue"}_toProto(e){return{mapValue:{fields:{direction:T7(this.direction),expression:this.expr._toProto(e)}}}}_readUserData(e){this.expr._readUserData(e)}}/**
2847 * @license
2848 * Copyright 2024 Google LLC
2849 *
2850 * Licensed under the Apache License, Version 2.0 (the "License");
2851 * you may not use this file except in compliance with the License.
2852 * You may obtain a copy of the License at
2853 *
2854 *   http://www.apache.org/licenses/LICENSE-2.0
2855 *
2856 * Unless required by applicable law or agreed to in writing, software
2857 * distributed under the License is distributed on an "AS IS" BASIS,
2858 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2859 * See the License for the specific language governing permissions and
2860 * limitations under the License.
2861 */class _o{constructor(e){this.optionsProto=void 0,{rawOptions:this.rawOptions,...this.knownOptions}=e}_readUserData(e){this.optionsProto=this._optionsUtil.getOptionsProto(e,this.knownOptions,this.rawOptions)}_toProto(e){return{name:this._name,options:this.optionsProto}}}class ez extends _o{get _name(){return"add_fields"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.fields=e}_toProto(e){return{...super._toProto(e),args:[oy(e,this.fields)]}}_readUserData(e){super._readUserData(e),jh(this.fields,e)}}let tz=class extends _o{get _name(){return"aggregate"}get _optionsUtil(){return new ni({})}constructor(e,t,r){super(r),this.groups=e,this.accumulators=t}_toProto(e){return{...super._toProto(e),args:[oy(e,this.accumulators),oy(e,this.groups)]}}_readUserData(e){super._readUserData(e),jh(this.groups,e),jh(this.accumulators,e)}};
vendor: 4,365 bytes, lines 2861-2876
2861class nz extends _o{get _name(){return"distinct"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.groups=e}_toProto(e){return{...super._toProto(e),args:[oy(e,this.groups)]}}_readUserData(e){super._readUserData(e),jh(this.groups,e)}}let lv=class extends _o{get _name(){return"collection"}get _optionsUtil(){return new ni({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.hr=e.startsWith("/")?e:"/"+e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:this.hr}]}}_readUserData(e){super._readUserData(e)}};class cv extends _o{get _name(){return"collection_group"}get _optionsUtil(){return new ni({forceIndex:{serverName:"force_index"}})}constructor(e,t){super(t),this.collectionId=e}_toProto(e){return{...super._toProto(e),args:[{referenceValue:""},{stringValue:this.collectionId}]}}_readUserData(e){super._readUserData(e)}}class U1 extends _o{get _name(){return"database"}get _optionsUtil(){return new ni({})}_toProto(e){return{...super._toProto(e)}}_readUserData(e){super._readUserData(e)}}class V1 extends _o{get _name(){return"documents"}get _optionsUtil(){return new ni({})}constructor(e,t){if(super(t),!e||e.length===0)throw new Fe(Te.INVALID_ARGUMENT,"Empty document paths are not allowed in DocumentsSource");const r=e.map((a=>a.startsWith("/")?a:"/"+a)),s=new Set(r);if(s.size!==r.length)throw new Fe(Te.INVALID_ARGUMENT,"Duplicate document paths are not allowed in DocumentsSource");this.Tr=r,this.Pr=s}_toProto(e){return{...super._toProto(e),args:this.Tr.map((t=>({referenceValue:t})))}}_readUserData(e){super._readUserData(e)}}class dv extends _o{get _name(){return"where"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.condition=e}_toProto(e){return{...super._toProto(e),args:[this.condition._toProto(e)]}}_readUserData(e){super._readUserData(e),jh(this.condition,e)}}class Dh extends _o{get _name(){return"limit"}get _optionsUtil(){return new ni({})}constructor(e,t){Ke(!isNaN(e)&&e!==1/0&&e!==-1/0,34860),super(t),this.limit=e}_toProto(e){return{...super._toProto(e),args:[jg(e,this.limit)]}}}class C4 extends _o{get _name(){return"offset"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.offset=e}_toProto(e){return{...super._toProto(e),args:[jg(e,this.offset)]}}}let dce=class extends _o{get _name(){return"select"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.selections=e}_toProto(e){return{...super._toProto(e),args:[oy(e,this.selections)]}}_readUserData(e){super._readUserData(e),jh(this.selections,e)}};class bc extends _o{get _name(){return"sort"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.orderings=e}_toProto(e){return{...super._toProto(e),args:this.orderings.map((t=>t._toProto(e)))}}_readUserData(e){super._readUserData(e),jh(this.orderings,e)}}class vj extends _o{get _name(){return"replace_with"}get _optionsUtil(){return new ni({})}constructor(e,t){super(t),this.map=e}_toProto(e){return{...super._toProto(e),args:[this.map._toProto(e),T7(vj.Ir)]}}_readUserData(e){super._readUserData(e),jh(this.map,e)}}vj.Ir="full_replace";function jh(n,e){return Y7(n)?n._readUserData(e):Array.isArray(n)?n.forEach((t=>t._readUserData(e))):n instanceof Map?n.forEach((t=>t._readUserData(e))):Object.values(n).forEach((t=>t._readUserData(e))),n}/**
2862 * @license
2863 * Copyright 2026 Google LLC
2864 *
2865 * Licensed under the Apache License, Version 2.0 (the "License");
2866 * you may not use this file except in compliance with the License.
2867 * You may obtain a copy of the License at
2868 *
2869 *   http://www.apache.org/licenses/LICENSE-2.0
2870 *
2871 * Unless required by applicable law or agreed to in writing, software
2872 * distributed under the License is distributed on an "AS IS" BASIS,
2873 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2874 * See the License for the specific language governing permissions and
2875 * limitations under the License.
2876 */class Ob{constructor(e,t,r,s){this._db=e,this.userDataReader=t,this._userDataWriter=r,this.stages=s}Vr(e,t){const r=this.userDataReader.createContext(3,e);return Y7(t)?t._readUserData(r):Array.isArray(t)?t.forEach((s=>s._readUserData(r))):t.forEach((s=>s._readUserData(r))),t}where(e){const t=this.stages.map((r=>r));return this.Vr("where",e),t.push(new dv(e,{})),new Ob(this._db,this.userDataReader,this._userDataWriter,t)}limit(e){const t=this.stages.map((r=>r));
2876return t.push(new Dh(e,{})),new Ob(this._db,this.userDataReader,this._userDataWriter,t)}sort(e,...t){const r=this.stages.map((s=>s));return"orderings"in e?r.push(new bc(this.Vr("sort",e.orderings),{})):r.push(new bc(this.Vr("sort",[e,...t]),{})),new Ob(this._db,this.userDataReader,this._userDataWriter,r)}dr(e){return{pipeline:{stages:this.stages.map((t=>t._toProto(e)))}}}}// Copyright 2024 Google LLC* @license
2877class za{constructor(e,t,r){this.serializer=e,this.stages=t,this.listenOptions=r,this.isCorePipeline=!0}getPipelineCollection(){return uv(this)}getPipelineCollectionGroup(){return Bj(this)}getPipelineCollectionId(){return rz(this)}getPipelineDocuments(){return QC(this)}getPipelineFlavor(){return(function(t){let r="exact";return t.stages.forEach(((s,a)=>{s._name!==nz.name&&s._name!==tz.name||(r="keyless"),s._name===dce.name&&r==="exact"&&(r="augmented"),s._name===ez.name&&a<t.stages.length-1&&r==="exact"&&(r="augmented")})),r})(this)}getPipelineSourceType(){return Ld(this)}}function Ld(n){const e=n.stages[0];return e instanceof lv||e instanceof cv||e instanceof U1||e instanceof V1?e._name:"unknown"}function uv(n){if(Ld(n)==="collection")return n.stages[0].hr}function Bj(n){if(Ld(n)==="collection_group")return n.stages[0].collectionId}function rz(n){switch(Ld(n)){case"collection":return zt.fromString(uv(n)).lastSegment();case"collection_group":return Bj(n);default:return}}function QC(n){if(Ld(n)==="documents")return n.stages[0].Tr}class fe{constructor(e,t){this.type=e,this.value=t}static mr(){return new fe("ERROR",void 0)}static pr(){return new fe("UNSET",void 0)}static gr(){return new fe("NULL",Ic)}static newValue(e){return yo(e)?new fe("NULL",Ic):(function(r){return!!r&&"booleanValue"in r})(e)?new fe("BOOLEAN",e):xc(e)?new fe("INT",e):Jf(e)?new fe("DOUBLE",e):(function(r){return!!r&&"timestampValue"in r&&!!r.timestampValue})(e)?new fe("TIMESTAMP",e):(function(r){return!!r&&"stringValue"in r})(e)?new fe("STRING",e):(function(r){return!!r&&"bytesValue"in r})(e)?new fe("BYTES",e):e.referenceValue?new fe("REFERENCE",e):e.geoPointValue?new fe("GEO_POINT",e):Nh(e)?new fe("ARRAY",e):Sm(e)?new fe("VECTOR",e):lm(e)?new fe("MAP",e):new fe("ERROR",void 0)}yr(){return this.type==="ERROR"||this.type==="UNSET"}wr(){return this.type==="NULL"}}function Mb(n){if(!n.yr())return n.value}function sz(n){return n instanceof Ih?n._expr:n}function jt(n){if((n=sz(n))instanceof Qm)return new uce(n);if(n instanceof Jm)return new hce(n);if(n instanceof Cb)return new fce(n);if(n instanceof Me){if(n.name==="add")return new gce(n);if(n.name==="subtract")return new xce(n);if(n.name==="multiply")return new bce(n);if(n.name==="divide")return new yce(n);if(n.name==="mod")return new vce(n);if(n.name==="and")return new Bce(n);if(n.name==="equal")return new jce(n);if(n.name==="not_equal")return new Rce(n);if(n.name==="less_than")return new Pce(n);if(n.name==="less_than_or_equal")return new Lce(n);if(n.name==="greater_than")return new Oce(n);if(n.name==="greater_than_or_equal")return new Mce(n);if(n.name==="array_concat")return new Fce(n);if(n.name==="array_reverse")return new Uce(n);if(n.name==="array_contains")return new Vce(n);if(n.name==="array_contains_all")return new Gce(n);if(n.name==="array_contains_any")return new $ce(n);if(n.name==="array_length")return new Hce(n);if(n.name==="array_element")return new zce(n);if(n.name==="equal_any")return new az(n);if(n.name==="not_equal_any")return new Cce(n);if(n.name==="is_nan")return new Ece(n);if(n.name==="is_not_nan")return new Sce(n);if(n.name==="is_null")return new Tce(n);if(n.name==="is_not_null")return new Ace(n);if(n.name==="is_error")return new kce(n);if(n.name==="exists")return new Nce(n);if(n.name==="not")return new G1(n);if(n.name==="or")return new wce(n);if(n.name==="xor")return new wj(n);if(n.name==="conditional")return new _ce(n);if(n.name==="maximum")return new Ice(n);if(n.name==="minimum")return new Dce(n);if(n.name==="reverse")return new qce(n);if(n.name==="replace_first")return new Kce(n);if(n.name==="replace_all")return new Wce(n);if(n.name==="char_length")return new Yce(n);if(n.name==="byte_length")return new Qce(n);if(n.name==="like")return new Jce(n);if(n.name==="regex_contains")return new Xce(n);if(n.name==="regex_match")return new Zce(n);if(n.name==="string_contains")return new ede(n);if(n.name==="starts_with")return new tde(n);if(n.name==="ends_with")return new nde(n);if(n.name==="to_lower")return new rde(n);if(n.name==="to_upper")return new sde(n);if(n.name==="trim")return new ade(n);if(n.name==="string_concat")return new ide(n);if(n.name==="map_get")return new ode(n);if(n.name==="cosine_distance")return new lde(n);if(n.name==="dot_product")return new cde(n);if(n.name==="euclidean_distance")return new dde(n);if(n.name==="vector_length")return new ude(n);if(n.name==="unix_micros_to_timestamp")return new gde(n);if(n.name==="timestamp_to_unix_micros")return new yde(n);if(n.name==="unix_millis_to_timestamp")return new xde(n);if(n.name==="timestamp_to_unix_millis")return new vde(n);if(n.name==="unix_seconds_to_timestamp")return new bde(n);if(n.name==="timestamp_to_unix_seconds")return new Bde(n);if(n.name==="timestamp_add")return new wde(n);if(n.name==="timestamp_subtract")return new Cde(n)}throw new Error(`Unknown Expr : ${n}`)}class uce{constructor(e){this.expr=e}evaluate(e,t){if(this.expr.fieldName===gc)return fe.newValue({referenceValue:rg(e.serializer,t.key)});if(this.expr.fieldName==="__update_time__")return fe.newValue({timestampValue:oC(e.serializer,t.version)});if(this.expr.fieldName==="__create_time__")return fe.newValue({timestampValue:oC(e.serializer,t.createTime)});const r=t.data.field(this.expr._fieldPath);
2877return r?nv(r)?fe.newValue((function(a,o){if(a.serverTimestampBehavior==="estimate")return{timestampValue:oC(a.serializer,wt.fromTimestamp(K0(o)))};if(a.serverTimestampBehavior==="previous"){const l=rv(o);if(l)return l}return{nullValue:"NULL_VALUE"}})(e,r)):fe.newValue(r):fe.pr()}}class hce{constructor(e){this.expr=e}evaluate(e,t){return fe.newValue(this.expr._getValue())}}class fce{constructor(e){this.expr=e}evaluate(e,t){const r=this.expr.cr.map((s=>jt(s).evaluate(e,t)));return r.some((s=>s.yr()))?fe.mr():fe.newValue({arrayValue:{values:r.map((s=>s.value))}})}}function Oa(n){return Jf(n)?Number(n.doubleValue):Number(n.integerValue)}function Mc(n){return BigInt(n.integerValue)}const mce=BigInt("0x7fffffffffffffff"),pce=-BigInt("0x8000000000000000");class hv{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length>=2,24778);const r=jt(this.expr.params[0]).evaluate(e,t),s=jt(this.expr.params[1]).evaluate(e,t);let a=this.br(r,s);for(const o of this.expr.params.slice(2)){const l=jt(o).evaluate(e,t);a=this.br(a,l)}return a}br(e,t){if(e.yr()||t.yr())return fe.mr();if(e.wr()||t.wr())return fe.gr();const r=e.value,s=t.value;if(!Jf(r)&&!xc(r)||!Jf(s)&&!xc(s))return fe.mr();if(Jf(r)||Jf(s)){const a=this.Sr(r,s);return a?fe.newValue(a):fe.mr()}if(xc(r)&&xc(s)){const a=this.vr(r,s);return a===void 0?fe.mr():typeof a=="number"?fe.newValue({doubleValue:a}):a<pce||a>mce?fe.mr():fe.newValue({integerValue:`${a}`})}return fe.mr()}}function zd(n,e){return Us(n)!==Us(e)?"TYPE_MISMATCH":Qi(n)||Qi(e)?"NOT_EQ":yo(n)&&yo(e)?"EQ":yo(n)||yo(e)?"NULL":Nh(n)&&Nh(e)?(function(r,s){var o,l,c;if(((o=r.values)==null?void 0:o.length)!==((l=s.values)==null?void 0:l.length))return"NOT_EQ";let a=!1;for(let d=0;d<(((c=r.values)==null?void 0:c.length)??0);d++){const h=r.values[d],m=s.values[d];switch(zd(h,m)){case"EQ":break;case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":a=!0;break;default:ot(44609,{Dr:h,Cr:m})}}return a?"NULL":"EQ"})(n.arrayValue,e.arrayValue):Sm(n)&&Sm(e)||lm(n)&&lm(e)?(function(r,s){const a=r.fields||{},o=s.fields||{};if(HC(a)!==HC(o))return"NOT_EQ";let l=!1;for(const c in a)if(a.hasOwnProperty(c)){if(o[c]===void 0)return"NOT_EQ";switch(zd(a[c],o[c])){case"NOT_EQ":case"TYPE_MISMATCH":return"NOT_EQ";case"NULL":l=!0}}return l?"NULL":"EQ"})(n.mapValue,e.mapValue):(function(r,s){return nl(r,s,{u:!1,i:!0,o:!0})})(n,e)?"EQ":"NOT_EQ"}class gce extends hv{vr(e,t){return Mc(e)+Mc(t)}Sr(e,t){return{doubleValue:Oa(e)+Oa(t)}}}class xce extends hv{constructor(e){super(e),this.expr=e}vr(e,t){return Mc(e)-Mc(t)}Sr(e,t){return{doubleValue:Oa(e)-Oa(t)}}}class bce extends hv{constructor(e){super(e),this.expr=e}vr(e,t){return Mc(e)*Mc(t)}Sr(e,t){return{doubleValue:Oa(e)*Oa(t)}}}class yce extends hv{constructor(e){super(e),this.expr=e}vr(e,t){const r=Mc(t);if(r!==BigInt(0))return Mc(e)/r}Sr(e,t){const r=Oa(t);return r===0?{doubleValue:W0(r)?Number.NEGATIVE_INFINITY:Number.POSITIVE_INFINITY}:{doubleValue:Oa(e)/r}}}class vce extends hv{constructor(e){super(e),this.expr=e}vr(e,t){const r=Mc(t);if(r!==BigInt(0))return Mc(e)%r}Sr(e,t){const r=Oa(t);if(r!==0)return{doubleValue:Oa(e)%r}}}class Bce{constructor(e){this.expr=e}evaluate(e,t){var a;let r=!1,s=!1;for(const o of this.expr.params){const l=jt(o).evaluate(e,t);switch(l.type){case"BOOLEAN":if(!((a=l.value)!=null&&a.booleanValue))return fe.newValue(fa);break;case"NULL":s=!0;break;default:r=!0}}return r?fe.mr():s?fe.gr():fe.newValue(Yi)}}class G1{constructor(e){this.expr=e}evaluate(e,t){var s;Ke(this.expr.params.length===1,9634);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"BOOLEAN":return fe.newValue({booleanValue:!((s=r.value)!=null&&s.booleanValue)});case"NULL":return fe.gr();default:return fe.mr()}}}class wce{constructor(e){this.expr=e}evaluate(e,t){var a;let r=!1,s=!1;for(const o of this.expr.params){const l=jt(o).evaluate(e,t);switch(l.type){case"BOOLEAN":if((a=l.value)!=null&&a.booleanValue)return fe.newValue(Yi);break;case"NULL":s=!0;break;default:r=!0}}return r?fe.mr():s?fe.gr():fe.newValue(fa)}}class wj{constructor(e){this.expr=e}evaluate(e,t){var a;let r=!1,s=!1;for(const o of this.expr.params){const l=jt(o).evaluate(e,t);switch(l.type){case"BOOLEAN":r=wj.xor(r,!!((a=l.value)!=null&&a.booleanValue));break;case"NULL":s=!0;break;default:return fe.mr()}}return s?fe.gr():fe.newValue({booleanValue:r})}static xor(e,t){return(e||t)&&!(e&&t)}}class az{constructor(e){this.expr=e}evaluate(e,t){var o,l;Ke(this.expr.params.length===2,55094);let r=!1;const s=jt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"NULL":r=!0;break;case"ERROR":case"UNSET":return fe.mr()}const a=jt(this.expr.params[1]).evaluate(e,t);switch(a.type){case"ARRAY":break;case"NULL":r=!0;break;default:return fe.mr()}if(r)return fe.gr();for(const c of((l=(o=a.value)==null?void 0:o.arrayValue)==null?void 0:l.values)??[])switch(yo(s.value)&&yo(c)?"EQ":zd(s.value,c)){case"EQ":return fe.newValue(Yi);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":r=!0;break;default:ot(44608,{value:s.value,candidate:c})}return r?fe.gr():fe.newValue(fa)}}class Cce{constructor(e){this.expr=e}evaluate(e,t){return new G1(new Me("not",[new Me("equal_any",this.expr.params)])).evaluate(e,t)}}class Ece{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length===1,23322);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"INT":return fe.newValue(fa);case"DOUBLE":return fe.newValue({booleanValue:isNaN(Oa(r.value))});case"NULL":return fe.gr();default:return fe.mr()}}}class Sce{constructor(e){this.expr=e}evaluate(e,t){return Ke(this.expr.params.length===1,50406),new G1(new Me("not",[new Me("is_nan",this.expr.params)])).evaluate(e,t)}}class Tce{constructor(e){this.expr=e}evaluate(e,t){switch(Ke(this.expr.params.length===1,23123),jt(this.expr.params[0]).evaluate(e,t).type){case"NULL":return fe.newValue(Yi);case"UNSET":case"ERROR":return fe.mr();default:return fe.newValue(fa)}}}class Ace{constructor(e){this.expr=e}evaluate(e,t){return Ke(this.expr.params.length===1,23167),new G1(new Me("not",[new Me("is_null",this.expr.params)])).evaluate(e,t)}}class kce{constructor(e){this.expr=e}evaluate(e,t){return Ke(this.expr.params.length===1,5228),jt(this.expr.params[0]).evaluate(e,t).type==="ERROR"?fe.newValue(Yi):fe.newValue(fa)}}class Nce{constructor(e){this.expr=e}evaluate(e,t){switch(Ke(this.expr.params.length===1,6877),jt(this.expr.params[0]).evaluate(e,t).type){case"ERROR":return fe.mr();case"UNSET":return fe.newValue(fa);default:return fe.newValue(Yi)}}}class _ce{constructor(e){this.expr=e}evaluate(e,t){var s;Ke(this.expr.params.length===3,11706);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"BOOLEAN":return(s=r.value)!=null&&s.booleanValue?jt(this.expr.params[1]).evaluate(e,t):jt(this.expr.params[2]).evaluate(e,t);case"NULL":return jt(this.expr.params[2]).evaluate(e,t);default:return fe.mr()}}}class Ice{constructor(e){this.expr=e}evaluate(e,t){const r=this.expr.params.map((a=>jt(a).evaluate(e,t)));let s;for(const a of r)switch(a.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=s===void 0||Ja(a.value,s.value)>0?a:s}return s===void 0?fe.gr():s}}class Dce{constructor(e){this.expr=e}evaluate(e,t){const r=this.expr.params.map((a=>jt(a).evaluate(e,t)));let s;for(const a of r)switch(a.type){case"ERROR":case"UNSET":case"NULL":continue;default:s=s===void 0||Ja(a.value,s.value)<0?a:s}return s===void 0?fe.gr():s}}class Mg{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length===2,31033,`${this.expr.name}() function should have exactly 2 params`);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"ERROR":case"UNSET":return fe.mr()}const s=jt(this.expr.params[1]).evaluate(e,t);switch(s.type){case"ERROR":case"UNSET":return fe.mr()}return this.Fr(r,s)}}class jce extends Mg{constructor(e){super(e),this.expr=e}Fr(e,t){if(e.wr()&&t.wr())return fe.newValue(Yi);if(e.wr()||t.wr()||Qi(e.value)||Qi(t.value)||Us(e.value)!==Us(t.value))return fe.newValue(fa);switch(zd(e.value,t.value)){case"EQ":return fe.newValue(Yi);case"NOT_EQ":return fe.newValue(fa);case"NULL":return fe.gr();default:ot(44615,{left:e,right:t})}}}class Rce extends Mg{constructor(e){super(e),this.expr=e}Fr(e,t){switch(zd(e.value,t.value)){case"EQ":return fe.newValue(fa);case"NOT_EQ":case"TYPE_MISMATCH":return fe.newValue(Yi);case"NULL":return fe.gr();default:ot(44614,{left:e,right:t})}}}class Pce extends Mg{constructor(e){super(e),this.expr=e}Fr(e,t){return Us(e.value)!==Us(t.value)||Qi(e.value)||Qi(t.value)?fe.newValue(fa):fe.newValue({booleanValue:Ja(e.value,t.value)<0})}}class Lce extends Mg{constructor(e){super(e),this.expr=e}Fr(e,t){return Us(e.value)!==Us(t.value)||Qi(e.value)||Qi(t.value)?fe.newValue(fa):zd(e.value,t.value)==="EQ"?fe.newValue(Yi):fe.newValue({booleanValue:Ja(e.value,t.value)<0})}}class Oce extends Mg{constructor(e){super(e),this.expr=e}Fr(e,t){return Us(e.value)!==Us(t.value)||Qi(e.value)||Qi(t.value)?fe.newValue(fa):fe.newValue({booleanValue:Ja(e.value,t.value)>0})}}class Mce extends Mg{constructor(e){super(e),this.expr=e}Fr(e,t){return Us(e.value)!==Us(t.value)||Qi(e.value)||Qi(t.value)?fe.newValue(fa):zd(e.value,t.value)==="EQ"?fe.newValue(Yi):fe.newValue({booleanValue:Ja(e.value,t.value)>0})}}class Fce{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class Uce{constructor(e){this.expr=e}evaluate(e,t){var s;Ke(this.expr.params.length===1,216);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"NULL":return fe.gr();case"ARRAY":{const a=((s=r.value.arrayValue)==null?void 0:s.values)??[];return fe.newValue({arrayValue:{values:[...a].reverse()}})}default:return fe.mr()}}}class Vce{constructor(e){this.expr=e}evaluate(e,t){return Ke(this.expr.params.length===2,52884),new az(new Me("eq_any",[this.expr.params[1],this.expr.params[0]])).evaluate(e,t)}}class Gce{constructor(e){this.expr=e}evaluate(e,t){var c,d,h,m;Ke(this.expr.params.length===2,1392);let r=!1;const s=jt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ARRAY":break;case"NULL":r=!0;break;default:return fe.mr()}const a=jt(this.expr.params[1]).evaluate(e,t);switch(a.type){case"ARRAY":break;case"NULL":r=!0;break;default:return fe.mr()}if(r)return fe.gr();const o=((d=(c=a.value)==null?void 0:c.arrayValue)==null?void 0:d.values)??[],l=((m=(h=s.value)==null?void 0:h.arrayValue)==null?void 0:m.values)??[];for(const p of o){let x=!1;r=!1;for(const y of l){switch(yo(p)&&yo(y)?"EQ":zd(p,y)){case"EQ":x=!0;break;case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":r=!0;break;default:ot(44613,{value:y,search:p})}if(x)break}if(!x)return fe.newValue(fa)}return fe.newValue(Yi)}}class $ce{constructor(e){this.expr=e}evaluate(e,t){var c,d,h,m;Ke(this.expr.params.length===2,2680);let r=!1;const s=jt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"ARRAY":break;case"NULL":r=!0;break;default:return fe.mr()}const a=jt(this.expr.params[1]).evaluate(e,t);switch(a.type){case"ARRAY":break;case"NULL":r=!0;break;default:return fe.mr()}if(r)return fe.gr();const o=((d=(c=a.value)==null?void 0:c.arrayValue)==null?void 0:d.values)??[],l=((m=(h=s.value)==null?void 0:h.arrayValue)==null?void 0:m.values)??[];for(const p of l)for(const x of o)switch(yo(p)&&yo(x)?"EQ":zd(p,x)){case"EQ":return fe.newValue(Yi);case"NOT_EQ":case"TYPE_MISMATCH":break;case"NULL":r=!0;break;default:ot(60403,{value:p,search:x})}return r?fe.gr():fe.newValue(fa)}}class Hce{constructor(e){this.expr=e}evaluate(e,t){var s,a,o;Ke(this.expr.params.length===1,38605);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"NULL":return fe.gr();case"ARRAY":return fe.newValue({integerValue:`${((o=(a=(s=r.value)==null?void 0:s.arrayValue)==null?void 0:a.values)==null?void 0:o.length)??0}`});default:return fe.mr()}}}class zce{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class qce{constructor(e){this.expr=e}evaluate(e,t){var s,a;Ke(this.expr.params.length===1,1508);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"NULL":return fe.gr();case"BYTES":{const o=(s=r.value)==null?void 0:s.bytesValue;
2877if(typeof o=="string"){const l=Sr.fromBase64String(o).toUint8Array();return l.reverse(),fe.newValue({bytesValue:Sr.fromUint8Array(l).toBase64()})}return fe.newValue({bytesValue:new Uint8Array(o).reverse()})}case"STRING":{const o=(a=r.value)==null?void 0:a.stringValue,l=new Intl.__PRIVATE_Segmenter(void 0,{granularity:"grapheme"}).segment(o),c=Array.from(l,(d=>d.segment)).reverse();return fe.newValue({stringValue:c.join("")})}default:return fe.mr()}}}class Kce{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class Wce{constructor(e){this.expr=e}evaluate(e,t){throw new Error("Unimplemented")}}class Yce{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length===1,19400);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"NULL":return fe.gr();case"STRING":{const s=(function(o){let l=0;for(let c=0;c<o.length;c++){const d=o.codePointAt(c);if(d===void 0)return;if(d<=65535)if(d>=55296&&d<=57343)if(d<=56319){const h=o.codePointAt(c+1);h!==void 0&&h>=56320&&h<=57343?(l+=1,c++):l+=1}else l+=1;else l+=1;else{if(!(d<=1114111))return;l+=1,c++}}return l})(r.value.stringValue);return s===void 0?fe.mr():fe.newValue({integerValue:s})}default:return fe.mr()}}}class Qce{constructor(e){this.expr=e}evaluate(e,t){var s,a;Ke(this.expr.params.length===1,8486);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"BYTES":{const o=(s=r.value)==null?void 0:s.bytesValue;return typeof o=="string"?fe.newValue({integerValue:Sr.fromBase64String(o).toUint8Array().length}):fe.newValue({integerValue:new Uint8Array(o).length})}case"STRING":{const o=(function(c){let d=0;for(let h=0;h<c.length;h++){const m=c.codePointAt(h);if(m===void 0)return;if(m>=55296&&m<=57343){if(!(m<=56319))return;{const p=c.codePointAt(h+1);if(p===void 0||!(p>=56320&&p<=57343))return;d+=4,h++}}else if(m<=127)d+=1;else if(m<=2047)d+=2;else if(m<=65535)d+=3;else{if(!(m<=1114111))return;d+=4,h++}}return d})((a=r.value)==null?void 0:a.stringValue);return o===void 0?fe.mr():fe.newValue({integerValue:o})}case"NULL":return fe.gr();default:return fe.mr()}}}class Fg{constructor(e){this.expr=e}evaluate(e,t){var o,l;Ke(this.expr.params.length===2,39773,`${this.expr.name}() function should have exactly two parameters`);let r=!1;const s=jt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"STRING":break;case"NULL":r=!0;break;default:return fe.mr()}const a=jt(this.expr.params[1]).evaluate(e,t);switch(a.type){case"STRING":break;case"NULL":r=!0;break;default:return fe.mr()}return r?fe.gr():this.Or((o=s.value)==null?void 0:o.stringValue,(l=a.value)==null?void 0:l.stringValue)}}class Jce extends Fg{Or(e,t){try{const r=(function(o){let l="";for(let c=0;c<o.length;c++){const d=o.charAt(c);switch(d){case"_":l+=".";break;case"%":l+=".*";break;case"\\":case".":case"*":case"?":case"+":case"^":case"$":case"|":case"(":case")":case"[":case"]":case"{":case"}":l+="\\"+d;break;default:l+=d}}return"^"+l+"$"})(t),s=VD.compile(r);return fe.newValue({booleanValue:s.matches(e)})}catch(r){return Xs(`Invalid LIKE pattern converted to regex: ${t}, returning error. Error: ${r}`),fe.mr()}}}class Xce extends Fg{Or(e,t){try{const r=VD.compile(t);return fe.newValue({booleanValue:r.test(e)})}catch{return Xs(`Invalid regex pattern found in regex_contains: ${t}, returning error`),fe.mr()}}}class Zce extends Fg{Or(e,t){try{return fe.newValue({booleanValue:VD.compile(t).matches(e)})}catch{return Xs(`Invalid regex pattern found in regex_match: ${t}, returning error`),fe.mr()}}}class ede extends Fg{Or(e,t){return fe.newValue({booleanValue:e.includes(t)})}}class tde extends Fg{Or(e,t){return fe.newValue({booleanValue:e.startsWith(t)})}}class nde extends Fg{Or(e,t){return fe.newValue({booleanValue:e.endsWith(t)})}}class rde{constructor(e){this.expr=e}evaluate(e,t){var s,a;Ke(this.expr.params.length===1,29079);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"STRING":return fe.newValue({stringValue:(a=(s=r.value)==null?void 0:s.stringValue)==null?void 0:a.toLowerCase()});case"NULL":return fe.gr();default:return fe.mr()}}}class sde{constructor(e){this.expr=e}evaluate(e,t){var s,a;Ke(this.expr.params.length===1,60487);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"STRING":return fe.newValue({stringValue:(a=(s=r.value)==null?void 0:s.stringValue)==null?void 0:a.toUpperCase()});case"NULL":return fe.gr();default:return fe.mr()}}}class ade{constructor(e){this.expr=e}evaluate(e,t){var s,a;Ke(this.expr.params.length===1,28544);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"STRING":return fe.newValue({stringValue:(a=(s=r.value)==null?void 0:s.stringValue)==null?void 0:a.trim()});case"NULL":return fe.gr();default:return fe.mr()}}}
2877class ide{constructor(e){this.expr=e}evaluate(e,t){const r=this.expr.params.map((o=>jt(o).evaluate(e,t)));let s="",a=!1;for(const o of r)switch(o.type){case"STRING":s+=o.value.stringValue;break;case"NULL":a=!0;break;default:return fe.mr()}return a?fe.gr():fe.newValue({stringValue:s})}}class ode{constructor(e){this.expr=e}evaluate(e,t){var o,l,c,d;Ke(this.expr.params.length===2,4483);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"UNSET":return fe.pr();case"MAP":break;default:return fe.mr()}const s=jt(this.expr.params[1]).evaluate(e,t);if(s.type!=="STRING")return fe.mr();const a=(d=(l=(o=r.value)==null?void 0:o.mapValue)==null?void 0:l.fields)==null?void 0:d[(c=s.value)==null?void 0:c.stringValue];return a===void 0?fe.pr():fe.newValue(a)}}class Cj{constructor(e){this.expr=e}evaluate(e,t){var d,h;Ke(this.expr.params.length===2,25231,`${this.expr.name}() function should have exactly 2 params`);let r=!1;const s=jt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"VECTOR":break;case"NULL":r=!0;break;default:return fe.mr()}const a=jt(this.expr.params[1]).evaluate(e,t);switch(a.type){case"VECTOR":break;case"NULL":r=!0;break;default:return fe.mr()}if(r)return fe.gr();const o=w_(s.value),l=w_(a.value);if(o===void 0||l===void 0||((d=o.values)==null?void 0:d.length)!==((h=l.values)==null?void 0:h.length))return fe.mr();const c=this.Mr(o,l);return c===void 0||isNaN(c)?fe.mr():fe.newValue({doubleValue:c})}}class lde extends Cj{Mr(e,t){const r=(e==null?void 0:e.values)??[],s=(t==null?void 0:t.values)??[];if(r.length===0)return;let a=0,o=0,l=0;for(let d=0;d<r.length;d++){if(!kh(r[d])||!kh(s[d]))return;const h=Oa(r[d]),m=Oa(s[d]);a+=h*m,o+=h*h,l+=m*m}const c=Math.sqrt(o)*Math.sqrt(l);if(c!==0)return 1-Math.max(-1,Math.min(1,a/c))}}class cde extends Cj{Mr(e,t){const r=(e==null?void 0:e.values)??[],s=(t==null?void 0:t.values)??[];if(r.length===0)return 0;let a=0;for(let o=0;o<r.length;o++){if(!kh(r[o])||!kh(s[o]))return;a+=Oa(r[o])*Oa(s[o])}return a}}class dde extends Cj{Mr(e,t){const r=(e==null?void 0:e.values)??[],s=(t==null?void 0:t.values)??[];if(r.length===0)return 0;let a=0;for(let o=0;o<r.length;o++){if(!kh(r[o])||!kh(s[o]))return;const l=Oa(r[o]),c=Oa(s[o]);a+=Math.pow(l-c,2)}return Math.sqrt(a)}}class ude{constructor(e){this.expr=e}evaluate(e,t){var s;Ke(this.expr.params.length===1,39044);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"VECTOR":{const a=w_(r.value);return fe.newValue({integerValue:((s=a==null?void 0:a.values)==null?void 0:s.length)??0})}case"NULL":return fe.gr();default:return fe.mr()}}}const cy=BigInt(-62135596800),dy=BigInt(253402300799),JC=BigInt(1e3),bh=BigInt(1e6),hde=cy*JC,fde=dy*JC+BigInt(999),mde=cy*bh,pde=dy*bh+BigInt(999999);function Ej(n){return n>=mde&&n<=pde}function iz(n){return n>=cy&&n<=dy}function uy(n,e){const t=BigInt(n);return!(t<cy||t>dy)&&!(e<0||e>=1e9)&&(t!==cy||e===0)&&!(t===dy&&e>999999999)}function oz(n,e){return e<0?{seconds:n-1,nanos:e+1e9}:{seconds:n,nanos:e}}function Sj(n){return BigInt(n.seconds)*bh+BigInt(Math.trunc(n.nanoseconds/1e3))}class Tj{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length===1,49262,`${this.expr.name}() function should have exactly one parameter`);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"INT":return this.toTimestamp(BigInt(r.value.integerValue));case"NULL":return fe.gr();default:return fe.mr()}}}class gde extends Tj{toTimestamp(e){if(!Ej(e))return fe.mr();let t=Number(e/bh),r=Number(e%bh*BigInt(1e3));const s=oz(t,r);return t=s.seconds,r=s.nanos,uy(t,r)?fe.newValue({timestampValue:{seconds:t,nanos:r}}):fe.mr()}}class xde extends Tj{toTimestamp(e){if(!(function(o){return o>=hde&&o<=fde})(e))return fe.mr();let t=Number(e/JC),r=Number(e%JC*BigInt(1e6));const s=oz(t,r);return t=s.seconds,r=s.nanos,uy(t,r)?fe.newValue({timestampValue:{seconds:t,nanos:r}}):fe.mr()}}class bde extends Tj{toTimestamp(e){if(!iz(e))return fe.mr();const t=Number(e);return fe.newValue({timestampValue:{seconds:t,nanos:0}})}}class Aj{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length===1,1265,`${this.expr.name}() function should have exactly one parameter`);const r=jt(this.expr.params[0]).evaluate(e,t);switch(r.type){case"TIMESTAMP":break;case"NULL":return fe.gr();default:return fe.mr()}const s=rj(r.value.timestampValue);return uy(s.seconds,s.nanoseconds)?this.Nr(s):fe.mr()}}class yde extends Aj{Nr(e){const t=Sj(e);
vendor: 4,828 bytes, lines 2877-2881
2877return Ej(t)?fe.newValue({integerValue:`${t.toString()}`}):fe.mr()}}class vde extends Aj{Nr(e){const t=Sj(e),r=t/BigInt(1e3),s=t%BigInt(1e3);return r>BigInt(0)||s===BigInt(0)?fe.newValue({integerValue:r.toString()}):fe.newValue({integerValue:(r-BigInt(1)).toString()})}}class Bde extends Aj{Nr(e){const t=BigInt(e.seconds);return iz(t)?fe.newValue({integerValue:t.toString()}):fe.mr()}}class lz{constructor(e){this.expr=e}evaluate(e,t){Ke(this.expr.params.length===3,2775,`${this.expr.name}() function should have exactly 3 parameters`);let r=!1;const s=jt(this.expr.params[0]).evaluate(e,t);switch(s.type){case"TIMESTAMP":break;case"NULL":r=!0;break;default:return fe.mr()}const a=jt(this.expr.params[1]).evaluate(e,t);let o;switch(a.type){case"STRING":if(o=(function(N){switch(N){case"microsecond":return"microsecond";case"millisecond":return"millisecond";case"second":return"second";case"minute":return"minute";case"hour":return"hour";case"day":return"day";default:return}})(a.value.stringValue),o===void 0)return fe.mr();break;case"NULL":r=!0;break;default:return fe.mr()}const l=jt(this.expr.params[2]).evaluate(e,t);switch(l.type){case"INT":break;case"NULL":r=!0;break;default:return fe.mr()}if(r)return fe.gr();const c=BigInt(l.value.integerValue);let d;try{switch(o){case"microsecond":d=c;break;case"millisecond":d=c*BigInt(1e3);break;case"second":d=c*BigInt(1e6);break;case"minute":d=c*BigInt(6e7);break;case"hour":d=c*BigInt(36e8);break;case"day":d=c*BigInt(864e8);break;default:return fe.mr()}if(o!=="microsecond"&&c!==BigInt(0)&&d/c!==BigInt(this.Lr(o)))return fe.mr()}catch(E){return Xs(`Error during timestamp arithmetic: ${E}`),fe.mr()}const h=rj(s.value.timestampValue);if(!uy(h.seconds,h.nanoseconds))return fe.mr();const m=Sj(h),p=this.Br(m,d);if(!Ej(p))return fe.mr();const x=Number(p/bh),y=p%bh,v=Number((y<0?y+bh:y)*BigInt(1e3)),B=y<0?x-1:x;return uy(B,v)?fe.newValue({timestampValue:{seconds:B,nanos:v}}):fe.mr()}Lr(e){switch(e){case"millisecond":return 1e3;case"second":return 1e6;case"minute":return 6e7;case"hour":return 36e8;case"day":return 864e8;default:return 1}}}class wde extends lz{Br(e,t){return e+t}}class Cde extends lz{Br(e,t){return e-t}}function hy(n){if((n=sz(n))instanceof Qm)return`fld(${n.fieldName})`;if(n instanceof Jm)return`cst(${(function(t){return t===null?"null":typeof t=="number"?t.toString():typeof t=="string"?`"${t}"`:t instanceof Fn?`ref(${t.path})`:t instanceof gi?`vec(${JSON.stringify(t)})`:JSON.stringify(t)})(n.value)})`;if(n instanceof Me)return`fn(${n.name},[${n.params.map(hy).join(",")}])`;if(n.expressionType==="ListOfExpressions")return`list([${n.cr.map(hy).join(",")}])`;throw new Error(`Unrecognized expr ${JSON.stringify(n,null,2)}`)}function Ede(n){if(n instanceof ez)return`${n._name}(${aw(n.fields)})`;if(n instanceof tz){let e=`${n._name}(${aw(n.accumulators)})`;return n.groups.size>0&&(e+=`grouping(${aw(n.groups)})`),e}if(n instanceof nz)return`${n._name}(${aw(n.groups)})`;if(n instanceof lv)return`${n._name}(${n.hr})`;if(n instanceof cv)return`${n._name}(${n.collectionId})`;if(n instanceof U1)return`${n._name}()`;if(n instanceof V1)return`${n._name}(${n.Tr.sort()})`;if(n instanceof dv)return`${n._name}(${hy(n.condition)})`;if(n instanceof Dh)return`${n._name}(${n.limit})`;if(n instanceof bc)return`${n._name}(${(function(t){return t.map((r=>`${hy(r.expr)}${r.direction}`)).join(",")})(n.orderings)})`;throw new Error(`Unrecognized stage ${n._name}`)}function aw(n){return`${Array.from(n.entries()).sort().map((([e,t])=>`${e}=${hy(t)}`)).join(",")}`}function Od(n){return n.stages.map((e=>Ede(e))).join("|")}function cz(n,e){return Od(n)===Od(e)}function Xr(n){return n instanceof za}function E4(n){return Xr(n)?Od(n):jb(n)}function dz(n){return Xr(n)?Od(n):(function(t){return`${qC(Wa(t))}|lt:${t.limitType}`})(n)}function $1(n,e){return n instanceof za&&e instanceof za?cz(n,e):!(n instanceof za&&!(e instanceof za)||!(n instanceof za)&&e instanceof za)&&s7(n,e)}function H1(n){return Ed(n)?Od(n):qC(n)}function kj(n,e){return n instanceof za&&e instanceof za?cz(n,e):!(n instanceof za&&!(e instanceof za)||!(n instanceof za)&&e instanceof za)&&XD(n,e)}function Sde(n,e){const t=(function(s){let a=!1;const o=[];for(const l of s)if(l instanceof bc)if(a=!0,l.orderings.some((c=>c.expr instanceof Qm&&c.expr.fieldName===gc)))o.push(l);else{const c=l.orderings.map((d=>d));c.push(lC(gc).ascending()),o.push(new bc(c,{}))}else l instanceof Dh&&(a||(o.push(new bc([lC(gc).ascending()],{})),a=!0)),o.push(l);return a||o.push(new bc([lC(gc).ascending()],{})),o})(n.stages);if(n.userDataReader){const r=n.userDataReader.createContext(3,"toCorePipeline");t.forEach((s=>s._readUserData(r)))}return new za(n.userDataReader.serializer,t,e)}/**
2878 * @license
2879 * Copyright 2017 Google LLC
2880 *
2881 * Licensed under the Apache License, Version 2.0 (the "License");
2882 * you may not use this file except in compliance with the License.
2883 * You may obtain a copy of the License at
2884 *
2885 *   http://www.apache.org/licenses/LICENSE-2.0
2886 *
2887 * Unless required by applicable law or agreed to in writing, software
2888 * distributed under the License is distributed on an "AS IS" BASIS,
2889 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2890 * See the License for the specific language governing permissions and
2891 * limitations under the License.
2892 */class Nj{constructor(e,t,r,s){this.batchId=e,this.localWriteTime=t,this.baseMutations=r,this.mutations=s}applyToRemoteDocument(e,t){const r=t.mutationResults;for(let s=0;s<this.mutations.length;s++){const a=this.mutations[s];a.key.isEqual(e.key)&&Moe(a,e,r[s])}}applyToLocalView(e,t){for(const r of this.baseMutations)r.key.isEqual(e.key)&&(t=Db(r,e,t,this.localWriteTime));for(const r of this.mutations)r.key.isEqual(e.key)&&(t=Db(r,e,t,this.localWriteTime));return t}applyToLocalDocumentSet(e,t){const r=c7();return this.mutations.forEach((s=>{const a=e.get(s.key),o=a.overlayedDocument;let l=this.applyToLocalView(o,a.mutatedFields);l=t.has(s.key)?null:l;const c=HH(o,l);c!==null&&r.set(s.key,c),o.isValidDocument()||o.convertToNoDocument(wt.min())})),r}keys(){return this.mutations.reduce(((e,t)=>e.add(t.key)),Ft())}isEqual(e){return this.batchId===e.batchId&&q0(this.mutations,e.mutations,((t,r)=>e4(t,r)))&&q0(this.baseMutations,e.baseMutations,((t,r)=>e4(t,r)))}}class _j{constructor(e,t,r,s){this.batch=e,this.commitVersion=t,this.mutationResults=r,this.docVersions=s}static from(e,t,r){Ke(e.mutations.length===r.length,58842,{Ur:e.mutations.length,kr:r.length});let s=(function(){return rle})();const a=e.mutations;for(let o=0;o<a.length;o++)s=s.insert(a[o].key,r[o].version);return new _j(e,t,r,s)}}/**
2893 * @license
2894 * Copyright 2017 Google LLC
2895 *
2896 * Licensed under the Apache License, Version 2.0 (the "License");
2897 * you may not use this file except in compliance with the License.
2898 * You may obtain a copy of the License at
2899 *
2900 *   http://www.apache.org/licenses/LICENSE-2.0
2901 *
2902 * Unless required by applicable law or agreed to in writing, software
2903 * distributed under the License is distributed on an "AS IS" BASIS,
2904 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2905 * See the License for the specific language governing permissions and
2906 * limitations under the License.
2907 */const XC="�";function Ya(n){let e="";for(let t=0;t<n.length;t++)e.length>0&&(e=S4(e)),e=Tde(n.get(t),e);return S4(e)}function Tde(n,e){let t=e;const r=n.length;for(let s=0;s<r;s++){const a=n.charAt(s);switch(a){case"\0":t+="��";break;case XC:t+="��";break;default:t+=a}}return t}function S4(n){return n+XC+"�"}function yc(n){const e=n.length;if(Ke(e>=2,64408,{path:n}),e===2)return Ke(n.charAt(0)===XC&&n.charAt(1)==="�",56145,{path:n}),zt.emptyPath();const t=e-2,r=[];let s="";for(let a=0;a<e;){const o=n.indexOf(XC,a);switch((o<0||o>t)&&ot(50515,{path:n}),n.charAt(o+1)){case"�":const l=n.substring(a,o);let c;s.length===0?c=l:(s+=l,c=s,s=""),r.push(c);break;case"�":s+=n.substring(a,o),s+="\0";break;case"�":s+=n.substring(a,o+1);break;default:ot(61167,{path:n})}a=o+2}return new zt(r)}/**
2908 * @license
2909 * Copyright 2022 Google LLC
2910 *
2911 * Licensed under the Apache License, Version 2.0 (the "License");
2912 * you may not use this file except in compliance with the License.
2913 * You may obtain a copy of the License at
2914 *
2915 *   http://www.apache.org/licenses/LICENSE-2.0
2916 *
2917 * Unless required by applicable law or agreed to in writing, software
2918 * distributed under the License is distributed on an "AS IS" BASIS,
2919 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2920 * See the License for the specific language governing permissions and
2921 * limitations under the License.
2922 */const Pf="remoteDocuments",fv="owner",Op="owner",fy="mutationQueues",Ade="userId",Il="mutations",T4="batchId",Xf="userMutationsIndex",A4=["userId","batchId"];/**
2923 * @license
2924 * Copyright 2022 Google LLC
2925 *
2926 * Licensed under the Apache License, Version 2.0 (the "License");
2927 * you may not use this file except in compliance with the License.
2928 * You may obtain a copy of the License at
2929 *
2930 *   http://www.apache.org/licenses/LICENSE-2.0
2931 *
2932 * Unless required by applicable law or agreed to in writing, softw
2932are
2933 * distributed under the License is distributed on an "AS IS" BASIS,
2934 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2935 * See the License for the specific language governing permissions and
2936 * limitations under the License.
2937 */function cC(n,e){return[n,Ya(e)]}function uz(n,e,t){return[n,Ya(e),t]}const kde={},sg="documentMutations",ZC="remoteDocumentsV14",Nde=["prefixPath","collectionGroup","readTime","documentId"],dC="documentKeyIndex",_de=["prefixPath","collectionGroup","documentId"],hz="collectionGroupIndex",Ide=["collectionGroup","readTime","prefixPath","documentId"],my="remoteDocumentGlobal",R_="remoteDocumentGlobalKey",ag="targets",fz="queryTargetsIndex",Dde=["canonicalId","targetId"],ig="targetDocuments",jde=["targetId","path"],Ij="documentTargetsIndex",Rde=["path","targetId"],eE="targetGlobalKey",um="targetGlobal",py="collectionParents",Pde=["collectionId","parent"],og="clientMetadata",Lde="clientId",z1="bundles",Ode="bundleId",q1="namedQueries",Mde="name",Dj="indexConfiguration",Fde="indexId",P_="collectionGroupIndex",Ude="collectionGroup",Fb="indexState",Vde=["indexId","uid"],mz="sequenceNumberIndex",Gde=["uid","sequenceNumber"],Ub="indexEntries",$de=["indexId","uid","arrayValue","directionalValue","orderedDocumentKey","documentKey"],pz="documentKeyIndex",Hde=["indexId","uid","orderedDocumentKey"],K1="documentOverlays",zde=["userId","collectionPath","documentId"],L_="collectionPathOverlayIndex",qde=["userId","collectionPath","largestBatchId"],gz="collectionGroupOverlayIndex",Kde=["userId","collectionGroup","largestBatchId"],jj="globals",Wde
vendor: 4,553 bytes, lines 2937-3004
2937="name",xz=[fy,Il,sg,Pf,ag,fv,um,ig,og,my,py,z1,q1],Yde=[...xz,K1],bz=[fy,Il,sg,ZC,ag,fv,um,ig,og,my,py,z1,q1,K1],yz=bz,Rj=[...yz,Dj,Fb,Ub],Qde=Rj,vz=[...Rj,jj],Jde=vz;/**
2938 * @license
2939 * Copyright 2020 Google LLC
2940 *
2941 * Licensed under the Apache License, Version 2.0 (the "License");
2942 * you may not use this file except in compliance with the License.
2943 * You may obtain a copy of the License at
2944 *
2945 *   http://www.apache.org/licenses/LICENSE-2.0
2946 *
2947 * Unless required by applicable law or agreed to in writing, software
2948 * distributed under the License is distributed on an "AS IS" BASIS,
2949 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2950 * See the License for the specific language governing permissions and
2951 * limitations under the License.
2952 */function Bz(n,e,t){const r=n.store(Il),s=n.store(sg),a=[],o=IDBKeyRange.only(t.batchId);let l=0;const c=r.Hn({range:o},((h,m,p)=>(l++,p.delete())));a.push(c.next((()=>{Ke(l===1,47070,{batchId:t.batchId})})));const d=[];for(const h of t.mutations){const m=uz(e,h.key.path,t.batchId);a.push(s.delete(m)),d.push(h.key)}return ve.waitFor(a).next((()=>d))}function tE(n){if(!n)return 0;let e;if(n.document)e=n.document;else if(n.unknownDocument)e=n.unknownDocument;else{if(!n.noDocument)throw ot(14731);e=n.noDocument}return JSON.stringify(e).length}/**
2953 * @license
2954 * Copyright 2020 Google LLC
2955 *
2956 * Licensed under the Apache License, Version 2.0 (the "License");
2957 * you may not use this file except in compliance with the License.
2958 * You may obtain a copy of the License at
2959 *
2960 *   http://www.apache.org/licenses/LICENSE-2.0
2961 *
2962 * Unless required by applicable law or agreed to in writing, software
2963 * distributed under the License is distributed on an "AS IS" BASIS,
2964 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2965 * See the License for the specific language governing permissions and
2966 * limitations under the License.
2967 */class O_ extends R7{constructor(e,t){super(),this.qr=e,this.currentSequenceNumber=t}}function ea(n,e){const t=st(n);return jc.Cn(t.qr,e)}/**
2968 * @license
2969 * Copyright 2022 Google LLC
2970 *
2971 * Licensed under the Apache License, Version 2.0 (the "License");
2972 * you may not use this file except in compliance with the License.
2973 * You may obtain a copy of the License at
2974 *
2975 *   http://www.apache.org/licenses/LICENSE-2.0
2976 *
2977 * Unless required by applicable law or agreed to in writing, software
2978 * distributed under the License is distributed on an "AS IS" BASIS,
2979 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2980 * See the License for the specific language governing permissions and
2981 * limitations under the License.
2982 */class Pj{constructor(e,t){this.largestBatchId=e,this.mutation=t}getKey(){return this.mutation.key}isEqual(e){return e!==null&&this.mutation===e.mutation}toString(){return`Overlay{
2983      largestBatchId: ${this.largestBatchId},
2984      mutation: ${this.mutation.toString()}
2985    }`}}/**
2986 * @license
2987 * Copyright 2017 Google LLC
2988 *
2989 * Licensed under the Apache License, Version 2.0 (the "License");
2990 * you may not use this file except in compliance with the License.
2991 * You may obtain a copy of the License at
2992 *
2993 *   http://www.apache.org/licenses/LICENSE-2.0
2994 *
2995 * Unless required by applicable law or agreed to in writing, software
2996 * distributed under the License is distributed on an "AS IS" BASIS,
2997 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
2998 * See the License for the specific language governing permissions and
2999 * limitations under the License.
3000 */class vc{constructor(e,t,r,s,a=wt.min(),o=wt.min(),l=Sr.EMPTY_BYTE_STRING,c=null){this.target=e,this.targetId=t,this.purpose=r,this.sequenceNumber=s,this.snapshotVersion=a,this.lastLimboFreeSnapshotVersion=o,this.resumeToken=l,this.expectedCount=c}withSequenceNumber(e){return new vc(this.target,this.targetId,this.purpose,e,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,this.expectedCount)}withResumeToken(e,t){return new vc(this.target,this.targetId,this.purpose,this.sequenceNumber,t,this.lastLimboFreeSnapshotVersion,e,null)}withExpectedCount(e){return new vc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,this.lastLimboFreeSnapshotVersion,this.resumeToken,e)}withLastLimboFreeSnapshotVersion(e){return new vc(this.target,this.targetId,this.purpose,this.sequenceNumber,this.snapshotVersion,e,this.resumeToken,this.expectedCount)}}/**
3001 * @license
3002 * Copyright 2017 Google LLC
3003 *
3004 * Licensed under the Apache License, Version 2.0 (the "License");
3005 * you may not use this file except in compliance with the License.
3006 * You may obtain a copy of the License at
3007 *
3008 *   http://www.apache.org/licenses/LICENSE-2.0
3009 *
3010 * Unless required by applicable law or agreed to in writing, software
3011 * distributed under the License is distributed on an "AS IS" BASIS,
3012 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3013 * See the License for the specific language governing permissions and
3014 * limitations under the License.
3015 */class wz{constructor(e){this.$r=e}}function Xde(n,e){let t;if(e.document)t=P1(n.$r,e.document,!!e.hasCommittedMutations);else if(e.noDocument){const r=Je.fromSegments(e.noDocument.path),s=_m(e.noDocument.readTime);t=Pr.newNoDocument(r,s),e.hasCommittedMutations&&t.setHasCommittedMutations()}else{if(!e.unknownDocument)return ot(56709);{const r=Je.fromSegments(e.unknownDocument.path),s=_m(e.unknownDocument.version);t=Pr.newUnknownDocument(r,s)}}return e.readTime&&t.setReadTime((function(s){const a=new bn(s[0],s[1]);return wt.fromTimestamp(a)})(e.readTime)),t}function k4(n,e){const t=e.key,r={prefixPath:t.getCollectionPath().popLast().toArray(),collectionGroup:t.collectionGroup,documentId:t.path.lastSegment(),readTime:nE(e.readTime),hasCommittedMutations:e.hasCommittedMutations};if(e.isFoundDocument())r.document=(function(a,o){return{name:rg(a,o.key),fields:o.data.value.mapValue.fields,updateTime:dm(a,o.version.toTimestamp()),createTime:dm(a,o.createTime.toTimestamp())}})(n.$r,e);else if(e.isNoDocument())r.noDocument={path:t.path.toArray(),readTime:Nm(e.version)};else{if(!e.isUnknownDocument())return ot(57904,{document:e});r.unknownDocument={path:t.path.toArray(),version:Nm(e.version)}}return r}function nE(n){const e=n.toTimestamp();return[e.seconds,e.nanoseconds]}function Nm(n){const e=n.toTimestamp();return{seconds:e.seconds,nanoseconds:e.nanoseconds}}function _m(n){const e=new bn(n.seconds,n.nanoseconds);return wt.fromTimestamp(e)}function Hf(n,e){const t=(e.baseMutations||[]).map((a=>I_(n.$r,a)));for(let a=0;a<e.mutations.length-1;++a){const o=e.mutations[a];if(a+1<e.mutations.length&&e.mutations[a+1].transform!==void 0){const l=e.mutations[a+1];o.updateTransforms=l.transform.fieldTransforms,e.mutations.splice(a+1,1),++a}}const r=e.mutations.map((a=>I_(n.$r,a))),s=bn.fromMillis(e.localWriteTimeMs);return new Nj(e.batchId,s,t,r)}function Eb(n,e){const t=_m(e.readTime),r=e.lastLimboFreeSnapshotVersion!==void 0?_m(e.lastLimboFreeSnapshotVersion):wt.min();let s;return s=(function(o){return o.structuredPipeline!==void 0})(e.query)?(function(o,l){var h,m;const c=o.structuredPipeline;Ke((((h=c==null?void 0:c.pipeline)==null?void 0:h.stages)??[]).length>0,1845);const d=(m=c==null?void 0:c.pipeline)==null?void 0:m.stages.map(Zde);return new za(l,d)})(e.query,n.$r):(function(o){return o.documents!==void 0})(e.query)?(function(o){const l=o.documents.length;return Ke(l===1,1966,{count:l}),Wa(Lg(g7(o.documents[0])))})(e.query):(function(o){return Wa(v7(o))})(e.query),new vc(s,e.targetId,"TargetPurposeListen",e.lastListenSequenceNumber,t,r,Sr.fromBase64String(e.resumeToken))}function Cz(n,e){const t=Nm(e.snapshotVersion),r=Nm(e.lastLimboFreeSnapshotVersion);let s;s=Ed(e.target)?B7(n.$r,e.target):ZD(e.target)?b7(n.$r,e.target):L1(n.$r,e.target).Se;const a=e.resumeToken.toBase64();return{targetId:e.targetId,canonicalId:H1(e.target),readTime:t,resumeToken:a,lastListenSequenceNumber:e.sequenceNumber,lastLimboFreeSnapshotVersion:r,query:s}}function W1(n){const e=v7({parent:n.parent,structuredQuery:n.structuredQuery});return n.limitType==="LAST"?WC(e,e.limit,"L"):e}function iw(n,e){return new Pj(e.largestBatchId,I_(n.$r,e.overlayMutation))}function N4(n,e){const t=e.path.lastSegment();return[n,Ya(e.path.popLast()),t]}function _4(n,e,t,r){return{indexId:n,uid:e,sequenceNumber:t,readTime:Nm(r.readTime),documentKey:Ya(r.documentKey.path),largestBatchId:r.largestBatchId}}function Zde(n){switch(n.name){case"collection":return new lv(n.args[0].referenceValue,{});case"collection_group":return new cv(n.args[1].stringValue,{});case"database":return new U1({});case"documents":return new V1(n.args.map((e=>e.referenceValue)),{});case"where":return new dv(M_(n.args[0]),{});case"limit":{const e=n.args[0].integerValue??n.args[0].doubleValue;return new Dh(typeof e=="number"?e:Number(e),{})}case"sort":return new bc(n.args.map((e=>(function(r){var a,o;const s=(a=r.mapValue)==null?void 0:a.fields;return new yj(M_(s.expression),(o=s.direction)==null?void 0:o.stringValue,"orderingFromProto")})(e))),{});default:throw new Error(`Stage type: ${n.name} not supported.`)}}function M_(n){return n.fieldReferenceValue?new Qm($l("_exprFromProto",n.fieldReferenceValue),"_exprFromProto"):n.functionValue?(function(t){var r;return new Me(t.functionValue.name,((r=t.functionValue.args)==null?void 0:r.map(M_))||[])})(n):Jm._fromProto(n)}
vendor: 4,571 bytes, lines 3015-3019
3015class Y1{constructor(e,t,r,s){this.userId=e,this.serializer=t,this.indexManager=r,this.referenceDelegate=s,this.Kr={}}static Qr(e,t,r,s){Ke(e.uid!=="",64387);const a=e.isAuthenticated()?e.uid:"";return new Y1(a,t,r,s)}checkEmpty(e){let t=!0;const r=IDBKeyRange.bound([this.userId,Number.NEGATIVE_INFINITY],[this.userId,Number.POSITIVE_INFINITY]);return Uu(e).Hn({index:Xf,range:r},((s,a,o)=>{t=!1,o.done()})).next((()=>t))}addMutationBatch(e,t,r,s){const a=x0(e),o=Uu(e);return o.add({}).next((l=>{Ke(typeof l=="number",49019);const c=new Nj(l,t,r,s),d=(function(x,y,v){const B=v.baseMutations.map((N=>iy(x.$r,N))),E=v.mutations.map((N=>iy(x.$r,N)));return{userId:y,batchId:v.batchId,localWriteTimeMs:v.localWriteTime.toMillis(),baseMutations:B,mutations:E}})(this.serializer,this.userId,c),h=[];let m=new Un(((p,x)=>Pt(p.canonicalString(),x.canonicalString())));for(const p of s){const x=uz(this.userId,p.key.path,l);m=m.add(p.key.path.popLast()),h.push(o.put(d)),h.push(a.put(x,kde))}return m.forEach((p=>{h.push(this.indexManager.addToCollectionParentIndex(e,p))})),e.addOnCommittedListener((()=>{this.Kr[l]=c.keys()})),ve.waitFor(h).next((()=>c))}))}lookupMutationBatch(e,t){return Uu(e).get(t).next((r=>r?(Ke(r.userId===this.userId,48,"Unexpected user for mutation batch",{userId:r.userId,batchId:t}),Hf(this.serializer,r)):null))}Wr(e,t){return this.Kr[t]?ve.resolve(this.Kr[t]):this.lookupMutationBatch(e,t).next((r=>{if(r){const s=r.keys();return this.Kr[t]=s,s}return null}))}getNextMutationBatchAfterBatchId(e,t){const r=t+1,s=IDBKeyRange.lowerBound([this.userId,r]);let a=null;return Uu(e).Hn({index:Xf,range:s},((o,l,c)=>{l.userId===this.userId&&(Ke(l.batchId>=r,47524,{Gr:r}),a=Hf(this.serializer,l)),c.done()})).next((()=>a))}getHighestUnacknowledgedBatchId(e){const t=IDBKeyRange.upperBound([this.userId,Number.POSITIVE_INFINITY]);let r=xh;return Uu(e).Hn({index:Xf,range:t,reverse:!0},((s,a,o)=>{r=a.batchId,o.done()})).next((()=>r))}getAllMutationBatches(e){const t=IDBKeyRange.bound([this.userId,xh],[this.userId,Number.POSITIVE_INFINITY]);return Uu(e).Qn(Xf,t).next((r=>r.map((s=>Hf(this.serializer,s)))))}getAllMutationBatchesAffectingDocumentKey(e,t){const r=cC(this.userId,t.path),s=IDBKeyRange.lowerBound(r),a=[];return x0(e).Hn({range:s},((o,l,c)=>{const[d,h,m]=o,p=yc(h);if(d===this.userId&&t.path.isEqual(p))return Uu(e).get(m).next((x=>{if(!x)throw ot(61480,{zr:o,batchId:m});Ke(x.userId===this.userId,10503,"Unexpected user for mutation batch",{userId:x.userId,batchId:m}),a.push(Hf(this.serializer,x))}));c.done()})).next((()=>a))}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new Un(Pt);const s=[];return t.forEach((a=>{const o=cC(this.userId,a.path),l=IDBKeyRange.lowerBound(o),c=x0(e).Hn({range:l},((d,h,m)=>{const[p,x,y]=d,v=yc(x);p===this.userId&&a.path.isEqual(v)?r=r.add(y):m.done()}));s.push(c)})),ve.waitFor(s).next((()=>this.jr(e,r)))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,s=r.length+1,a=cC(this.userId,r),o=IDBKeyRange.lowerBound(a);let l=new Un(Pt);return x0(e).Hn({range:o},((c,d,h)=>{const[m,p,x]=c,y=yc(p);m===this.userId&&r.isPrefixOf(y)?y.length===s&&(l=l.add(x)):h.done()})).next((()=>this.jr(e,l)))}jr(e,t){const r=[],s=[];return t.forEach((a=>{s.push(Uu(e).get(a).next((o=>{if(o===null)throw ot(35274,{batchId:a});Ke(o.userId===this.userId,9748,"Unexpected user for mutation batch",{userId:o.userId,batchId:a}),r.push(Hf(this.serializer,o))})))})),ve.waitFor(s).next((()=>r))}removeMutationBatch(e,t){return Bz(e.qr,this.userId,t).next((r=>(e.addOnCommittedListener((()=>{this.Hr(t.batchId)})),ve.forEach(r,(s=>this.referenceDelegate.markPotentiallyOrphaned(e,s))))))}Hr(e){delete this.Kr[e]}performConsistencyCheck(e){return this.checkEmpty(e).next((t=>{if(!t)return ve.resolve();const r=IDBKeyRange.lowerBound((function(o){return[o]})(this.userId)),s=[];return x0(e).Hn({range:r},((a,o,l)=>{if(a[0]===this.userId){const c=yc(a[1]);s.push(c)}else l.done()})).next((()=>{Ke(s.length===0,56720,{Jr:s.map((a=>a.canonicalString()))})}))}))}containsKey(e,t){return Ez(e,this.userId,t)}Yr(e){return Sz(e).get(this.userId).next((t=>t||{userId:this.userId,lastAcknowledgedBatchId:xh,lastStreamToken:""}))}}function Ez(n,e,t){const r=cC(e,t.path),s=r[1],a=IDBKeyRange.lowerBound(r);let o=!1;return x0(n).Hn({range:a,jn:!0},((l,c,d)=>{const[h,m,p]=l;h===e&&m===s&&(o=!0),d.done()})).next((()=>o))}function Uu(n){return ea(n,Il)}function x0(n){return ea(n,sg)}function Sz(n){return ea(n,fy)}/**
3016 * @license
3017 * Copyright 2020 Google LLC
3018 *
3019 * Licensed under the Apache License, Version 2.0 (the "License");
3020 * you may not use this file except in compliance with the License.
3021 * You may obtain a copy of the License at
3022 *
3023 *   http://www.apache.org/licenses/LICENSE-2.0
3024 *
3025 * Unless required by applicable law or agreed to in writing, software
3026 * distributed under the License is distributed on an "AS IS" BASIS,
3027 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3028 * See the License for the specific language governing permissions and
3029 * limitations under the License.
3030 */class eue{getBundleMetadata(e,t){return I4(e).get(t).next((r=>{if(r)return(function(a){return{id:a.bundleId,createTime:_m(a.createTime),version:a.version}})(r)}))}saveBundleMetadata(e,t){return I4(e).put((function(s){return{bundleId:s.id,createTime:Nm(Ss(s.createTime)),version:s.version}})(t))}getNamedQuery(e,t){return D4(e).get(t).next((r=>{if(r)return(function(a){return{name:a.name,query:W1(a.bundledQuery),readTime:_m(a.readTime)}})(r)}))}saveNamedQuery(e,t){return D4(e).put((function(s){return{name:s.name,readTime:Nm(Ss(s.readTime)),bundledQuery:s.bundledQuery}})(t))}}function I4(n){return ea(n,z1)}function D4(n){return ea(n,q1)}/**
3031 * @license
3032 * Copyright 2022 Google LLC
3033 *
3034 * Licensed under the Apache License, Version 2.0 (the "License");
3035 * you may not use this file except in compliance with the License.
3036 * You may obtain a copy of the License at
3037 *
3038 *   http://www.apache.org/licenses/LICENSE-2.0
3039 *
3040 * Unless required by applicable law or agreed to in writing, software
3041 * distributed under the License is distributed on an "AS IS" BASIS,
3042 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3043 * See the License for the specific language governing permissions and
3044 * limitations under the License.
3045 */class Q1{constructor(e,t){this.serializer=e,this.userId=t}static Qr(e,t){const r=t.uid||"";return new Q1(e,r)}getOverlay(e,t){return Mp(e).get(N4(this.userId,t)).next((r=>r?iw(this.serializer,r):null))}getOverlays(e,t){const r=qo();return ve.forEach(t,(s=>this.getOverlay(e,s).next((a=>{a!==null&&r.set(s,a)})))).next((()=>r))}getAllOverlays(e,t){const r=qo();return Mp(e).Hn(((s,a)=>{const o=iw(this.serializer,a);o.largestBatchId>t&&r.set(o.getKey(),o)})).next((()=>r))}saveOverlays(e,t,r){const s=[];return r.forEach(((a,o)=>{const l=new Pj(t,o);s.push(this.Zr(e,l))})),ve.waitFor(s)}removeOverlaysForBatchId(e,t,r){const s=new Set;t.forEach((o=>s.add(Ya(o.getCollectionPath()))));const a=[];return s.forEach((o=>{const l=IDBKeyRange.bound([this.userId,o,r],[this.userId,o,r+1],!1,!0);a.push(Mp(e).zn(L_,l))})),ve.waitFor(a)}getOverlaysForCollection(e,t,r){const s=qo(),a=Ya(t),o=IDBKeyRange.bound([this.userId,a,r],[this.userId,a,Number.POSITIVE_INFINITY],!0);return Mp(e).Qn(L_,o).next((l=>{for(const c of l){const d=iw(this.serializer,c);s.set(d.getKey(),d)}return s}))}getOverlaysForCollectionGroup(e,t,r,s){const a=qo();let o;const l=IDBKeyRange.bound([this.userId,t,r],[this.userId,t,Number.POSITIVE_INFINITY],!0);return Mp(e).Hn({index:gz,range:l},((c,d,h)=>{const m=iw(this.serializer,d);a.size()<s||m.largestBatchId===o?(a.set(m.getKey(),m),o=m.largestBatchId):h.done()})).next((()=>a))}Zr(e,t){return Mp(e).put((function(s,a,o){const[l,c,d]=N4(a,o.mutation.key);return{userId:a,collectionPath:c,documentId:d,collectionGroup:o.mutation.key.getCollectionGroup(),largestBatchId:o.largestBatchId,overlayMutation:iy(s.$r,o.mutation)}})(this.serializer,this.userId,t))}}function Mp(n){return ea(n,K1)}/**
3046 * @license
3047 * Copyright 2024 Google LLC
3048 *
3049 * Licensed under the Apache License, Version 2.0 (the "License");
3050 * you may not use this file except in compliance with the License.
3051 * You may obtain a copy of the License at
3052 *
3053 *   http://www.apache.org/licenses/LICENSE-2.0
3054 *
3055 * Unless required by applicable law or agreed to in writing, software
3056 * distributed under the License is distributed on an "AS IS" BASIS,
3057 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3058 * See the License for the specific language governing permissions and
3059 * limitations under the License.
3060 */class tue{Xr(e){return ea(e,jj)}getSessionToken(e){return this.Xr(e).get("sessionToken").next((t=>{const r=t==null?void 0:t.value;return r?Sr.fromUint8Array(r):Sr.EMPTY_BYTE_STRING}))}setSessionToken(e,t){return this.Xr(e).put({name:"sessionToken",value:t.toUint8Array()})}}/**
3061 * @license
3062 * Copyright 2021 Google LLC
3063 *
3064 * Licensed under the Apache License, Version 2.0 (the "License");
3065 * you may not use this file except in compliance with the License.
3066 * You may obtain a copy of the License at
3067 *
3068 *   http://www.apache.org/licenses/LICENSE-2.0
3069 *
3070 * Unless required by applicable law or agreed to in writing, software
3071 * distributed under the License is distributed on an "AS IS" BASIS,
3072 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3073 * See the License for the specific language governing permissions and
3074 * limitations under the License.
3075 */class zf{constructor(){}ei(e,t){this.ti(e,t),t.ni()}ti(e,t){if("nullValue"in e)this.ri(t,5);else if("booleanValue"in e)this.ri(t,10),t.ii(e.booleanValue?1:0);else if("integerValue"in e)this.ri(t,15),t.ii(Cr(e.integerValue));else if("doubleValue"in e){const r=Cr(e.doubleValue);isNaN(r)?this.ri(t,13):(this.ri(t,15),W0(r)?t.ii(0):t.ii(r))}else if("timestampValue"in e){let r=e.timestampValue;this.ri(t,20),typeof r=="string"&&(r=$d(r)),t.si(`${r.seconds||""}`),t.ii(r.nanos||0)}else if("stringValue"in e)this._i(e.stringValue,t),this.oi(t);else if("bytesValue"in e)this.ri(t,30),t.ai(Hd(e.bytesValue)),this.oi(t);else if("referenceValue"in e)this.ui(e.referenceValue,t);else if("geoPointValue"in e){const r=e.geoPointValue;this.ri(t,45),t.ii(r.latitude||0),t.ii(r.longitude||0)}else"mapValue"in e?OH(e)?this.ri(t,Number.MAX_SAFE_INTEGER):Sm(e)?this.ci(e.mapValue,t):(this.li(e.mapValue,t),this.oi(t)):"arrayValue"in e?(this.Ei(e.arrayValue,t),this.oi(t)):ot(19022,{hi:e})}_i(e,t){this.ri(t,25),this.Ti(e,t)}Ti(e,t){t.si(e)}li(e,t){const r=e.fields||{};this.ri(t,55);for(const s of Object.keys(r))this._i(s,t),this.ti(r[s],t)}ci(e,t){var o,l;const r=e.fields||{};this.ri(t,53);const s=Cm,a=((l=(o=r[s].arrayValue)==null?void 0:o.values)==null?void 0:l.length)||0;this.ri(t,15),t.ii(Cr(a)),this._i(s,t),this.ti(r[s],t)}Ei(e,t){const r=e.values||[];this.ri(t,50);for(const s of r)this.ti(s,t)}ui(e,t){this.ri(t,37),Je.fromName(e).path.forEach((r=>{this.ri(t,60),this.Ti(r,t)}))}ri(e,t){e.ii(t)}oi(e){e.ii(2)}}zf.Pi=new zf;/**
3076 * @license
3077 * Copyright 2021 Google LLC
3078 *
3079 * Licensed under the Apache License, Version 2.0 (the "License");
3080 * you may not use this file except in compliance with the License.
3081 * You may obtain a copy of the License at
3082 *
3083 *   http://www.apache.org/licenses/LICENSE-2.0
3084 *
3085 * Unless required by applicable law | agreed to in writing, software
3086 * distributed under the License is distributed on an "AS IS" BASIS,
3087 * WITHOUT WARRANTIES | CONDITIONS OF ANY KIND, either express | implied.
3088 * See the License for the specific language governing permissions and
3089 * limitations under the License.
3090 */const Fp=255;function nue(n){if(n===0)return 8;let e=0;return n>>4||(e+=4,n<<=4),n>>6||(e+=2,n<<=2),n>>7||(e+=1),e}function j4(n){const e=64-(function(r){let s=0;for(let a=0;a<8;++a){const o=nue(255&r[a]);if(s+=o,o!==8)break}return s})(n);return Math.ceil(e/8)}class rue{constructor(){this.buffer=new Uint8Array(1024),this.position=0}Ii(e){const t=e[Symbol.iterator]();let r=t.next();for(;!r.done;)this.Ri(r.value),r=t.next();this.Ai()}Vi(e){const t=e[Symbol.iterator]();let r=t.next();for(;!r.done;)this.di(r.value),r=t.next();this.fi()}mi(e){for(const t of e){const r=t.charCodeAt(0);if(r<128)this.Ri(r);else if(r<2048)this.Ri(960|r>>>6),this.Ri(128|63&r);else if(t<"\uD800"||"\uDBFF"<t)this.Ri(480|r>>>12),this.Ri(128|63&r>>>6),this.Ri(128|63&r);else{const s=t.codePointAt(0);this.Ri(240|s>>>18),this.Ri(128|63&s>>>12),this.Ri(128|63&s>>>6),this.Ri(128|63&s)}}this.Ai()}pi(e){for(const t of e){const r=t.charCodeAt(0);if(r<128)this.di(r);else if(r<2048)this.di(960|r>>>6),this.di(128|63&r);else if(t<"\uD800"||"\uDBFF"<t)this.di(480|r>>>12),this.di(128|63&r>>>6),this.di(128|63&r);else{const s=t.codePointAt(0);this.di(240|s>>>18),this.di(128|63&s>>>12),this.di(128|63&s>>>6),this.di(128|63&s)}}this.fi()}gi(e){const t=this.yi(e),r=j4(t);this.wi(1+r),this.buffer[this.position++]=255&r;for(let s=t.length-r;s<t.length;++s)this.buffer[this.position++]=255&t[s]}bi(e){const t=this.yi(e),r=j4(t);this.wi(1+r),this.buffer[this.position++]=~(255&r);for(let s=t.length-r;s<t.length;++s)this.buffer[this.position++]=~(255&t[s])}Si(){this.Di(Fp),this.Di(255)}
3090xi(){this.Ci(Fp),this.Ci(255)}reset(){this.position=0}seed(e){this.wi(e.length),this.buffer.set(e,this.position),this.position+=e.length}Fi(){return this.buffer.slice(0,this.position)}yi(e){const t=(function(a){const o=new DataView(new ArrayBuffer(8));return o.setFloat64(0,a,!1),new Uint8Array(o.buffer)})(e),r=!!(128&t[0]);t[0]^=r?255:128;for(let s=1;s<t.length;++s)t[s]^=r?255:0;return t}Ri(e){const t=255&e;t===0?(this.Di(0),this.Di(255)):t===Fp?(this.Di(Fp),this.Di(0)):this.Di(t)}di(e){const t=255&e;t===0?(this.Ci(0),this.Ci(255)):t===Fp?(this.Ci(Fp),this.Ci(0)):this.Ci(e)}Ai(){this.Di(0),this.Di(1)}fi(){this.Ci(0),this.Ci(1)}Di(e){this.wi(1),this.buffer[this.position++]=e}Ci(e){this.wi(1),this.buffer[this.position++]=~e}wi(e){const t=e+this.position;if(t<=this.buffer.length)return;let r=2*this.buffer.length;r<t&&(r=t);const s=new Uint8Array(r);s.set(this.buffer),this.buffer=s}}class sue{constructor(e){this.Oi=e}ai(e){this.Oi.Ii(e)}si(e){this.Oi.mi(e)}ii(e){this.Oi.gi(e)}ni(){this.Oi.Si()}}class aue{constructor(e){this.Oi=e}ai(e){this.Oi.Vi(e)}si(e){this.Oi.pi(e)}ii(e){this.Oi.bi(e)}ni(){this.Oi.xi()}}class Zx{constructor(){this.Oi=new rue,this.ascending=new sue(this.Oi),this.descending=new aue(this.Oi)}seed(e){this.Oi.seed(e)}Mi(e){return e===0?this.ascending:this.descending}Fi(){return this.Oi.Fi()}reset(){this.Oi.reset()}}/**
3091 * @license
3092 * Copyright 2022 Google LLC
3093 *
3094 * Licensed under the Apache License, Version 2.0 (the "License");
3095 * you may not use this file except in compliance with the License.
3096 * You may obtain a copy of the License at
3097 *
3098 *   http://www.apache.org/licenses/LICENSE-2.0
3099 *
3100 * Unless required by applicable law or agreed to in writing, software
3101 * distributed under the License is distributed on an "AS IS" BASIS,
3102 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3103 * See the License for the specific language governing permissions and
3104 * limitations under the License.
3105 */class qf{constructor(e,t,r,s){this.Ni=e,this.Li=t,this.Bi=r,this.Ui=s}ki(){const e=this.Ui.length,t=e===0||this.Ui[e-1]===255?e+1:e,r=new Uint8Array(t);return r.set(this.Ui,0),t!==e?r.set([0],this.Ui.length):++r[r.length-1],new qf(this.Ni,this.Li,this.Bi,r)}qi(e,t,r){return{indexId:this.Ni,uid:e,arrayValue:uC(this.Bi),directionalValue:uC(this.Ui),orderedDocumentKey:uC(t),documentKey:r.path.toArray()}}$i(e,t,r){const s=this.qi(e,t,r);return[s.indexId,s.uid,s.arrayValue,s.directionalValue,s.orderedDocumentKey,s.documentKey]}}function Vu(n,e){let t=n.Ni-e.Ni;return t!==0?t:(t=R4(n.Bi,e.Bi),t!==0?t:(t=R4(n.Ui,e.Ui),t!==0?t:Je.comparator(n.Li,e.Li)))}function R4(n,e){for(let t=0;t<n.length&&t<e.length;++t){const r=n[t]-e[t];if(r!==0)return r}return n.length-e.length}function uC(n){return S$()?(function(t){let r="";for(let s=0;s<t.length;s++)r+=String.fromCharCode(t[s]);return r})(n):n}function P4(n){return typeof n!="string"?n:(function(t){const r=new Uint8Array(t.length);for(let s=0;s<t.length;s++)r[s]=t.charCodeAt(s);return r})(n)}class L4{constructor(e){this.Ki=new Un(((t,r)=>Es.comparator(t.field,r.field))),this.collectionId=e.collectionGroup!=null?e.collectionGroup:e.path.lastSegment(),this.Qi=e.orderBy,this.Wi=[];for(const t of e.filters){const r=t;r.isInequality()?this.Ki=this.Ki.add(r):this.Wi.push(r)}}get Gi(){return this.Ki.size>1}zi(e){if(Ke(e.collectionGroup===this.collectionId,49279),this.Gi)return!1;const t=S_(e);if(t!==void 0&&!this.ji(t))return!1;const r=Rf(e);let s=new Set,a=0,o=0;for(;a<r.length&&this.ji(r[a]);++a)s=s.add(r[a].fieldPath.canonicalString());if(a===r.length)return!0;if(this.Ki.size>0){const l=this.Ki.getIterator().getNext();if(!s.has(l.field.canonicalString())){const c=r[a];if(!this.Hi(l,c)||!this.Ji(this.Qi[o++],c))return!1}++a}for(;a<r.length;++a){const l=r[a];if(o>=this.Qi.length||!this.Ji(this.Qi[o++],l))return!1}return!0}Yi(){if(this.Gi)return null;let e=new Un(Es.comparator);const t=[];for(const r of this.Wi)if(!r.field.isKeyField())if(r.op==="array-contains"||r.op==="array-contains-any")t.push(new cm(r.field,2));else{if(e.has(r.field))continue;e=e.add(r.field),t.push(new cm(r.field,0))}for(const r of this.Qi)r.field.isKeyField()||e.has(r.field)||(e=e.add(r.field),t.push(new cm(r.field,r.dir==="asc"?0:1)));return new tg(tg.UNKNOWN_ID,this.collectionId,t,ng.empty())}ji(e){for(const t of this.Wi)if(this.Hi(t,e))return!0;return!1}Hi(e,t){if(e===void 0||!e.field.isEqual(t.fieldPath))return!1;const r=e.op==="array-contains"||e.op==="array-contains-any";return t.kind===2===r}Ji(e,t){return!!e.field.isEqual(t.fieldPath)&&(t.kind===0&&e.dir==="asc"||t.kind===1&&e.dir==="desc")}}/**
3106 * @license
3107 * Copyright 2022 Google LLC
3108 *
3109 * Licensed under the Apache License, Version 2.0 (the "License");
3110 * you may not use this file except in compliance with the License.
3111 * You may obtain a copy of the License at
3112 *
3113 *   http://www.apache.org/licenses/LICENSE-2.0
3114 *
3115 * Unless required by applicable law or agreed to in writing, software
3116 * distributed under the License is distributed on an "AS IS" BASIS,
3117 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3118 * See the License for the specific language governing permissions and
3119 * limitations under the License.
3120 */function Tz(n){var t,r;if(Ke(n instanceof ln||n instanceof Wn,20012),n instanceof ln){if(n instanceof XH){const s=((r=(t=n.value.arrayValue)==null?void 0:t.values)==null?void 0:r.map((a=>ln.create(n.field,"==",a))))||[];return Wn.create(s,"or")}return n}const e=n.filters.map((s=>Tz(s)));return Wn.create(e,n.op)}function iue(n){if(n.getFilters().length===0)return[];const e=V_(Tz(n));return Ke(Az(e),7391),F_(e)||U_(e)?[e]:e.getFilters()}function F_(n){return n instanceof ln}function U_(n){return n instanceof Wn&&QD(n)}function Az(n){return F_(n)||U_(n)||(function(t){if(t instanceof Wn&&C_(t)){for(const r of t.getFilters())if(!F_(r)&&!U_(r))return!1;return!0}return!1})(n)}function V_(n){if(Ke(n instanceof ln||n instanceof Wn,34018),n instanceof ln)return n;if(n.filters.length===1)return V_(n.filters[0]);const e=n.filters.map((r=>V_(r)));let t=Wn.create(e,n.op);return t=rE(t),Az(t)?t:(Ke(t instanceof Wn,64498),Ke(Z0(t),40251),Ke(t.filters.length>1,57927),t.filters.reduce(((r,s)=>Lj(r,s))))}function Lj(n,e){let t;return Ke(n instanceof ln||n instanceof Wn,38388),Ke(e instanceof ln||e instanceof Wn,25473),t=n instanceof ln?e instanceof ln?(function(s,a){return Wn.create([s,a],"and")})(n,e):O4(n,e):e instanceof ln?O4(e,n):(function(s,a){if(Ke(s.filters.length>0&&a.filters.length>0,48005),Z0(s)&&Z0(a))return YH(s,a.getFilters());const o=C_(s)?s:a,l=C_(s)?a:s,c=o.filters.map((d=>Lj(d,l)));return Wn.create(c,"or")})(n,e),rE(t)}function O4(n,e){if(Z0(e))return YH(e,n.getFilters());{const t=e.filters.map((r=>Lj(n,r)));return Wn.create(t,"or")}}function rE(n){if(Ke(n instanceof ln||n instanceof Wn,11850),n instanceof ln)return n;const e=n.getFilters();if(e.length===1)return rE(e[0]);if(KH(n))return n;const t=e.map((s=>rE(s))),r=[];return t.forEach((s=>{s instanceof ln?r.push(s):s instanceof Wn&&(s.op===n.op?r.push(...s.filters):r.push(s))})),r.length===1?r[0]:Wn.create(r,n.op)}/**
3121 * @license
3122 * Copyright 2019 Google LLC
3123 *
3124 * Licensed under the Apache License, Version 2.0 (the "License");
3125 * you may not use this file except in compliance with the License.
3126 * You may obtain a copy of the License at
3127 *
3128 *   http://www.apache.org/licenses/LICENSE-2.0
3129 *
3130 * Unless required by applicable law or agreed to in writing, software
3131 * distributed under the License is distributed on an "AS IS" BASIS,
3132 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3133 * See the License for the specific language governing permissions and
3134 * limitations under the License.
3135 */class oue{constructor(){this.Zi=new Oj}addToCollectionParentIndex(e,t){return this.Zi.add(t),ve.resolve()}getCollectionParents(e,t){return ve.resolve(this.Zi.getEntries(t))}addFieldIndex(e,t){return ve.resolve()}deleteFieldIndex(e,t){return ve.resolve()}deleteAllFieldIndexes(e){return ve.resolve()}createTargetIndexes(e,t){return ve.resolve()}getDocumentsMatchingTarget(e,t){return ve.resolve(null)}getIndexType(e,t){return ve.resolve(0)}getFieldIndexes(e,t){return ve.resolve([])}getNextCollectionGroupToUpdate(e){return ve.resolve(null)}getMinOffset(e,t){return ve.resolve(Ao.min())}getMinOffsetFromCollectionGroup(e,t){return ve.resolve(Ao.min())}updateCollectionGroup(e,t,r){return ve.resolve()}updateIndexEntries(e,t){return ve.resolve()}}class Oj{constructor(){this.index={}}add(e){const t=e.lastSegment(),r=e.popLast(),s=this.index[t]||new Un(zt.comparator),a=!s.has(r);return this.index[t]=s.add(r),a}has(e){const t=e.lastSegment(),r=e.popLast(),s=this.index[t];return s&&s.has(r)}getEntries(e){return(this.index[e]||new Un(zt.comparator)).toArray()}}/**
3136 * @license
3137 * Copyright 2019 Google LLC
3138 *
3139 * Licensed under the Apache License, Version 2.0 (the "License");
3140 * you may not use this file except in compliance with the License.
3141 * You may obtain a copy of the License at
3142 *
3143 *   http://www.apache.org/licenses/LICENSE-2.0
3144 *
3145 * Unless required by applicable law or agreed to in writing, software
3146 * distributed under the License is distributed on an "AS IS" BASIS,
3147 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3148 * See the License for the specific language governing permissions and
3149 * limitations under the License.
3150 */const M4="IndexedDbIndexManager",ow=new Uint8Array(0);class lue{constructor(e,t){this.databaseId=t,this.Xi=new Oj,this.es=new ru((r=>qC(r)),((r,s)=>XD(r,s))),this.uid=e.uid||""}addToCollectionParentIndex(e,t){if(!this.Xi.has(t)){const r=t.lastSegment(),s=t.popLast();e.addOnCommittedListener((()=>{this.Xi.add(t)}));const a={collectionId:r,parent:Ya(s)};return F4(e).put(a)}return ve.resolve()}getCollectionParents(e,t){const r=[],s=IDBKeyRange.bound([t,""],[TH(t),""],!1,!0);return F4(e).Qn(s).next((a=>{for(const o of a){if(o.collectionId!==t)break;r.push(yc(o.parent))}return r}))}addFieldIndex(e,t){const r=eb(e),s=(function(l){return{indexId:l.indexId,collectionGroup:l.collectionGroup,fields:l.fields.map((c=>[c.fieldPath.canonicalString(),c.kind]))}})(t);delete s.indexId;const a=r.add(s);if(t.indexState){const o=Vp(e);return a.next((l=>{o.put(_4(l,this.uid,t.indexState.sequenceNumber,t.indexState.offset))}))}return a.next()}deleteFieldIndex(e,t){const r=eb(e),s=Vp(e),a=Up(e);return r.delete(t.indexId).next((()=>s.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0)))).next((()=>a.delete(IDBKeyRange.bound([t.indexId],[t.indexId+1],!1,!0))))}deleteAllFieldIndexes(e){const t=eb(e),r=Up(e),s=Vp(e);return t.zn().next((()=>r.zn())).next((()=>s.zn()))}createTargetIndexes(e,t){return ve.forEach(this.ts(t),(r=>this.getIndexType(e,r).next((s=>{if(s===0||s===1){const a=new L4(r).Yi();if(a!=null)return this.addFieldIndex(e,a)}}))))}getDocumentsMatchingTarget(e,t){const r=Up(e);let s=!0;const a=new Map;return ve.forEach(this.ts(t),(o=>this.ns(e,o).next((l=>{s&&(s=!!l),a.set(o,l)})))).next((()=>{if(s){let o=Ft();const l=[];return ve.forEach(a,((c,d)=>{ze(M4,`Using index ${(function(T){return`id=${T.indexId}|cg=${T.collectionGroup}|f=${T.fields.map((k=>`${k.fieldPath}:${k.kind}`)).join(",")}`})(c)} to execute ${qC(t)}`);const h=(function(T,k){const P=S_(k);if(P===void 0)return null;for(const R of KC(T,P.fieldPath))switch(R.op){case"array-contains-any":return R.value.arrayValue.values||[];case"array-contains":return[R.value]}return null})(d,c),m=(function(T,k){const P=new Map;for(const R of Rf(k))for(const _ of KC(T,R.fieldPath))switch(_.op){case"==":case"in":P.set(R.fieldPath.canonicalString(),_.value);break;case"not-in":case"!=":return P.set(R.fieldPath.canonicalString(),_.value),Array.from(P.values())}return null})(d,c),p=(function(T,k){const P=[];let R=!0;for(const _ of Rf(k)){const I=_.kind===0?a4(T,_.fieldPath,T.startAt):i4(T,_.fieldPath,T.startAt);P.push(I.value),R&&(R=I.inclusive)}return new _h(P,R)})(d,c),x=(function(T,k){const P=[];let R=!0;for(const _ of Rf(k)){const I=_.kind===0?i4(T,_.fieldPath,T.endAt):a4(T,_.fieldPath,T.endAt);P.push(I.value),R&&(R=I.inclusive)}return new _h(P,R)})(d,c),y=this.rs(c,d,p),v=this.rs(c,d,x),B=this.ss(c,d,m),E=this._s(c.indexId,h,y,p.inclusive,v,x.inclusive,B);return ve.forEach(E,(N=>r.Gn(N,t.limit).next((T=>{T.forEach((k=>{const P=Je.fromSegments(k.documentKey);o.has(P)||(o=o.add(P),l.push(P))}))}))))})).next((()=>l))}return ve.resolve(null)}))}ts(e){let t=this.es.get(e);return t||(e.filters.length===0?t=[e]:t=iue(Wn.create(e.filters,"and")).map((r=>T_(e.path,e.collectionGroup,e.orderBy,r.getFilters(),e.limit,e.startAt,e.endAt))),this.es.set(e,t),t)}_s(e,t,r,s,a,o,l){const c=(t!=null?t.length:1)*Math.max(r.length,a.length),d=c/(t!=null?t.length:1),h=[];for(let m=0;m<c;++m){const p=t?this.us(t[m/d]):ow,x=this.cs(e,p,r[m%d],s),y=this.ls(e,p,a[m%d],o),v=l.map((B=>this.cs(e,p,B,!0)));h.push(...this.createRange(x,y,v))}return h}cs(e,t,r,s){const a=new qf(e,Je.empty(),t,r);return s?a:a.ki()}ls(e,t,r,s){const a=new qf(e,Je.empty(),t,r);return s?a.ki():a}ns(e,t){const r=new L4(t),s=t.collectionGroup!=null?t.collectionGroup:t.path.lastSegment();return this.getFieldIndexes(e,s).next((a=>{let o=null;for(const l of a)r.zi(l)&&(!o||l.fields.length>o.fields.length)&&(o=l);return o}
3150))}getIndexType(e,t){let r=2;const s=this.ts(t);return ve.forEach(s,(a=>this.ns(e,a).next((o=>{o?r!==0&&o.fields.length<(function(c){let d=new Un(Es.comparator),h=!1;for(const m of c.filters)for(const p of m.getFlattenedFilters())p.field.isKeyField()||(p.op==="array-contains"||p.op==="array-contains-any"?h=!0:d=d.add(p.field));for(const m of c.orderBy)m.field.isKeyField()||(d=d.add(m.field));return d.size+(h?1:0)})(a)&&(r=1):r=0})))).next((()=>(function(o){return o.limit!==null})(t)&&s.length>1&&r===2?1:r))}Es(e,t){const r=new Zx;for(const s of Rf(e)){const a=t.data.field(s.fieldPath);if(a==null)return null;const o=r.Mi(s.kind);zf.Pi.ei(a,o)}return r.Fi()}us(e){const t=new Zx;return zf.Pi.ei(e,t.Mi(0)),t.Fi()}hs(e,t){const r=new Zx;return zf.Pi.ei(Em(this.databaseId,t),r.Mi((function(a){const o=Rf(a);return o.length===0?0:o[o.length-1].kind})(e))),r.Fi()}ss(e,t,r){if(r===null)return[];let s=[];s.push(new Zx);let a=0;for(const o of Rf(e)){const l=r[a++];for(const c of s)if(this.Ts(t,o.fieldPath)&&Nh(l))s=this.Ps(s,o,l);else{const d=c.Mi(o.kind);zf.Pi.ei(l,d)}}return this.Is(s)}rs(e,t,r){return this.ss(e,t,r.position)}Is(e){const t=[];for(let r=0;r<e.length;++r)t[r]=e[r].Fi();return t}Ps(e,t,r){const s=[...e],a=[];for(const o of r.arrayValue.values||[])for(const l of s){const c=new Zx;c.seed(l.Fi()),zf.Pi.ei(o,c.Mi(t.kind)),a.push(c)}return a}Ts(e,t){return!!e.filters.find((r=>r instanceof ln&&r.field.isEqual(t)&&(r.op==="in"||r.op==="not-in")))}getFieldIndexes(e,t){const r=eb(e),s=Vp(e);return(t?r.Qn(P_,IDBKeyRange.bound(t,t)):r.Qn()).next((a=>{const o=[];return ve.forEach(a,(l=>s.get([l.indexId,this.uid]).next((c=>{o.push((function(h,m){const p=m?new ng(m.sequenceNumber,new Ao(_m(m.readTime),new Je(yc(m.documentKey)),m.largestBatchId)):ng.empty(),x=h.fields.map((([y,v])=>new cm(Es.fromServerFormat(y),v)));return new tg(h.indexId,h.collectionGroup,x,p)})(l,c))})))).next((()=>o))}))}getNextCollectionGroupToUpdate(e){return this.getFieldIndexes(e).next((t=>t.length===0?null:(t.sort(((r,s)=>{const a=r.indexState.sequenceNumber-s.indexState.sequenceNumber;return a!==0?a:Pt(r.collectionGroup,s.collectionGroup)})),t[0].collectionGroup)))}updateCollectionGroup(e,t,r){const s=eb(e),a=Vp(e);return this.Rs(e).next((o=>s.Qn(P_,IDBKeyRange.bound(t,t)).next((l=>ve.forEach(l,(c=>a.put(_4(c.indexId,this.uid,o,r))))))))}updateIndexEntries(e,t){const r=new Map;return ve.forEach(t,((s,a)=>{const o=r.get(s.collectionGroup);return(o?ve.resolve(o):this.getFieldIndexes(e,s.collectionGroup)).next((l=>(r.set(s.collectionGroup,l),ve.forEach(l,(c=>this.As(e,s,c).next((d=>{const h=this.Vs(a,c);return d.isEqual(h)?ve.resolve():this.ds(e,a,c,d,h)})))))))}))}fs(e,t,r,s){return Up(e).put(s.qi(this.uid,this.hs(r,t.key),t.key))}ps(e,t,r,s){return Up(e).delete(s.$i(this.uid,this.hs(r,t.key),t.key))}As(e,t,r){const s=Up(e);let a=new Un(Vu);return s.Hn({index:pz,range:IDBKeyRange.only([r.indexId,this.uid,uC(this.hs(r,t))])},((o,l)=>{a=a.add(new qf(r.indexId,t,P4(l.arrayValue),P4(l.directionalValue)))})).next((()=>a))}Vs(e,t){let r=new Un(Vu);const s=this.Es(t,e);if(s==null)return r;const a=S_(t);if(a!=null){const o=e.data.field(a.fieldPath);if(Nh(o))for(const l of o.arrayValue.values||[])r=r.add(new qf(t.indexId,e.key,this.us(l),s))}else r=r.add(new qf(t.indexId,e.key,ow,s));return r}ds(e,t,r,s,a){ze(M4,"Updating index entries for document '%s'",t.key);const o=[];return(function(c,d,h,m,p){const x=c.getIterator(),y=d.getIterator();let v=Lp(x),B=Lp(y);for(;v||B;){let E=!1,N=!1;if(v&&B){const T=h(v,B);T<0?N=!0:T>0&&(E=!0)}else v!=null?N=!0:E=!0;E?(m(B),B=Lp(y)):N?(p(v),v=Lp(x)):(v=Lp(x),B=Lp(y))}})(s,a,Vu,(l=>{o.push(this.fs(e,t,r,l))}),(l=>{o.push(this.ps(e,t,r,l))})),ve.waitFor(o)}Rs(e){let t=1;return Vp(e).Hn({index:mz,reverse:!0,range:IDBKeyRange.upperBound([this.uid,Number.MAX_SAFE_INTEGER])},((r,s,a)=>{a.done(),t=s.sequenceNumber+1})).next((()=>t))}createRange(e,t,r){r=r.sort(((o,l)=>Vu(o,l))).filter(((o,l,c)=>!l||Vu(o,c[l-1])!==0));const s=[];
vendor: 4,258 bytes, lines 3150-3180
3150s.push(e);for(const o of r){const l=Vu(o,e),c=Vu(o,t);if(l===0)s[0]=e.ki();else if(l>0&&c<0)s.push(o),s.push(o.ki());else if(c>0)break}s.push(t);const a=[];for(let o=0;o<s.length;o+=2){if(this.gs(s[o],s[o+1]))return[];const l=s[o].$i(this.uid,ow,Je.empty()),c=s[o+1].$i(this.uid,ow,Je.empty());a.push(IDBKeyRange.bound(l,c))}return a}gs(e,t){return Vu(e,t)>0}getMinOffsetFromCollectionGroup(e,t){return this.getFieldIndexes(e,t).next(U4)}getMinOffset(e,t){return ve.mapArray(this.ts(t),(r=>this.ns(e,r).next((s=>s||ot(44426))))).next(U4)}}function F4(n){return ea(n,py)}function Up(n){return ea(n,Ub)}function eb(n){return ea(n,Dj)}function Vp(n){return ea(n,Fb)}function U4(n){Ke(n.length!==0,28825);let e=n[0].indexState.offset,t=e.largestBatchId;for(let r=1;r<n.length;r++){const s=n[r].indexState.offset;JD(s,e)<0&&(e=s),t<s.largestBatchId&&(t=s.largestBatchId)}return new Ao(e.readTime,e.documentKey,t)}/**
3151 * @license
3152 * Copyright 2017 Google LLC
3153 *
3154 * Licensed under the Apache License, Version 2.0 (the "License");
3155 * you may not use this file except in compliance with the License.
3156 * You may obtain a copy of the License at
3157 *
3158 *   http://www.apache.org/licenses/LICENSE-2.0
3159 *
3160 * Unless required by applicable law or agreed to in writing, software
3161 * distributed under the License is distributed on an "AS IS" BASIS,
3162 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3163 * See the License for the specific language governing permissions and
3164 * limitations under the License.
3165 */class qd{constructor(e){this.ys=e}next(){return this.ys+=2,this.ys}static ws(){return new qd(0)}static bs(){return new qd(-1)}}/**
3166 * @license
3167 * Copyright 2017 Google LLC
3168 *
3169 * Licensed under the Apache License, Version 2.0 (the "License");
3170 * you may not use this file except in compliance with the License.
3171 * You may obtain a copy of the License at
3172 *
3173 *   http://www.apache.org/licenses/LICENSE-2.0
3174 *
3175 * Unless required by applicable law or agreed to in writing, software
3176 * distributed under the License is distributed on an "AS IS" BASIS,
3177 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3178 * See the License for the specific language governing permissions and
3179 * limitations under the License.
3180 */class cue{constructor(e,t){this.referenceDelegate=e,this.serializer=t}allocateTargetId(e){return this.Ss(e).next((t=>{const r=new qd(t.highestTargetId);return t.highestTargetId=r.next(),this.vs(e,t).next((()=>t.highestTargetId))}))}getLastRemoteSnapshotVersion(e){return this.Ss(e).next((t=>wt.fromTimestamp(new bn(t.lastRemoteSnapshotVersion.seconds,t.lastRemoteSnapshotVersion.nanoseconds))))}getHighestSequenceNumber(e){return this.Ss(e).next((t=>t.highestListenSequenceNumber))}setTargetsMetadata(e,t,r){return this.Ss(e).next((s=>(s.highestListenSequenceNumber=t,r&&(s.lastRemoteSnapshotVersion=r.toTimestamp()),t>s.highestListenSequenceNumber&&(s.highestListenSequenceNumber=t),this.vs(e,s))))}addTargetData(e,t){return this.Ds(e,t).next((()=>this.Ss(e).next((r=>(r.targetCount+=1,this.xs(t,r),this.vs(e,r))))))}updateTargetData(e,t){return this.Ds(e,t)}removeTargetData(e,t){return this.removeMatchingKeysForTargetId(e,t.targetId).next((()=>Gp(e).delete(t.targetId))).next((()=>this.Ss(e))).next((r=>(Ke(r.targetCount>0,8065),r.targetCount-=1,this.vs(e,r))))}removeTargets(e,t,r){let s=0;const a=[];return Gp(e).Hn(((o,l)=>{const c=Eb(this.serializer,l);c.sequenceNumber<=t&&r.get(c.targetId)===null&&(s++,a.push(this.removeTargetData(e,c)))})).next((()=>ve.waitFor(a))).next((()=>s))}forEachTarget(e,t){return Gp(e).Hn(((r,s)=>{const a=Eb(this.serializer,s);t(a)}))}Ss(e){return V4(e).get(eE).next((t=>(Ke(t!==null,2888),t)))}vs(e,t){return V4(e).put(eE,t)}Ds(e,t){return Gp(e).put(Cz(this.serializer,t))}xs(e,t){let r=!1;return e.targetId>t.highestTargetId&&(t.highestTargetId=e.targetId,r=!0),e.sequenceNumber>t.highestListenSequenceNumber&&(t.highestListenSequenceNumber=e.sequenceNumber,r=!0),r}getTargetCount(e){return this.Ss(e).next((t=>t.targetCount))}getTargetData(e,t){const r=H1(t),s=IDBKeyRange.bound([r,Number.NEGATIVE_INFINITY],[r,Number.POSITIVE_INFINITY]);let a=null;return Gp(e).Hn({range:s,index:fz},((o,l,c)=>{const d=Eb(this.serializer,l);kj(t,d.target)&&(a=d,c.done())})).next((()=>a))}
3180addMatchingKeys(e,t,r){const s=[],a=ih(e);return t.forEach((o=>{const l=Ya(o.path);s.push(a.put({targetId:r,path:l})),s.push(this.referenceDelegate.addReference(e,r,o))})),ve.waitFor(s)}removeMatchingKeys(e,t,r){const s=ih(e);return ve.forEach(t,(a=>{const o=Ya(a.path);return ve.waitFor([s.delete([r,o]),this.referenceDelegate.removeReference(e,r,a)])}))}removeMatchingKeysForTargetId(e,t){const r=ih(e),s=IDBKeyRange.bound([t],[t+1],!1,!0);return r.delete(s)}getMatchingKeysForTargetId(e,t){const r=IDBKeyRange.bound([t],[t+1],!1,!0),s=ih(e);let a=Ft();return s.Hn({range:r,jn:!0},((o,l,c)=>{const d=yc(o[1]),h=new Je(d);a=a.add(h)})).next((()=>a))}containsKey(e,t){const r=Ya(t.path),s=IDBKeyRange.bound([r],[TH(r)],!1,!0);let a=0;return ih(e).Hn({index:Ij,jn:!0,range:s},(([o,l],c,d)=>{o!==0&&(a++,d.done())})).next((()=>a>0))}ye(e,t){return Gp(e).get(t).next((r=>r?Eb(this.serializer,r):null))}}function Gp(n){return ea(n,ag)}function V4(n){return ea(n,um)}function ih(n){return ea(n,ig)}/**
3181 * @license
3182 * Copyright 2020 Google LLC
3183 *
3184 * Licensed under the Apache License, Version 2.0 (the "License");
3185 * you may not use this file except in compliance with the License.
3186 * You may obtain a copy of the License at
3187 *
3188 *   http://www.apache.org/licenses/LICENSE-2.0
3189 *
3190 * Unless required by applicable law or agreed to in writing, software
3191 * distributed under the License is distributed on an "AS IS" BASIS,
3192 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3193 * See the License for the specific language governing permissions and
3194 * limitations under the License.
3195 */class due{constructor(e,t){this.db=e,this.garbageCollector=M7(this,t)}ir(e){const t=this.Cs(e);return this.db.getTargetCache().getTargetCount(e).next((r=>t.next((s=>r+s))))}Cs(e){let t=0;return this.sr(e,(r=>{t++})).next((()=>t))}forEachTarget(e,t){return this.db.getTargetCache().forEachTarget(e,t)}sr(e,t){return this.Fs(e,((r,s)=>t(s)))}addReference(e,t,r){return lw(e,r)}removeReference(e,t,r){return lw(e,r)}removeTargets(e,t,r){return this.db.getTargetCache().removeTargets(e,t,r)}markPotentiallyOrphaned(e,t){return lw(e,t)}Os(e,t){return(function(s,a){let o=!1;return Sz(s).Jn((l=>Ez(s,l,a).next((c=>(c&&(o=!0),ve.resolve(!c)))))).next((()=>o))})(e,t)}removeOrphanedDocuments(e,t){const r=this.db.getRemoteDocumentCache().newChangeBuffer(),s=[];let a=0;return this.Fs(e,((o,l)=>{if(l<=t){const c=this.Os(e,o).next((d=>{if(!d)return a++,r.getEntry(e,o).next((()=>(r.removeEntry(o,wt.min()),ih(e).delete((function(m){return[0,Ya(m.path)]})(o)))))}));s.push(c)}})).next((()=>ve.waitFor(s))).next((()=>r.apply(e))).next((()=>a))}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.db.getTargetCache().updateTargetData(e,r)}updateLimboDocument(e,t){return lw(e,t)}Fs(e,t){const r=ih(e);let s,a=Gi.wn;return r.Hn({index:Ij},(([o,l],{path:c,sequenceNumber:d})=>{o===0?(a!==Gi.wn&&t(new Je(yc(s)),a),a=d,s=c):a=Gi.wn})).next((()=>{a!==Gi.wn&&t(new Je(yc(s)),a)}))}getCacheSize(e){return this.db.getRemoteDocumentCache().getSize(e)}}function lw(n,e){return ih(n).put((function(r,s){return{targetId:0,path:Ya(r.path),sequenceNumber:s}})(e,n.currentSequenceNumber))}// Copyright 2024 Google LLC* @license
3196function kz(n,e){var r;let t=e;for(const s of n.stages)t=uue({serializer:n.serializer,serverTimestampBehavior:(r=n.listenOptions)==null?void 0:r.serverTimestampBehavior},s,t);return t}function J1(n,e){return kz(n,[e]).length>0}function Nz(n,e){return Xr(n)?J1(n,e):j1(n,e)}function uue(n,e,t){if(e instanceof lv)return(function(s,a,o){return o.filter((l=>l.isFoundDocument()&&`/${l.key.getCollectionPath().canonicalString()}`===a.hr))})(0,e,t);if(e instanceof dv)return(function(s,a,o){return o.filter((l=>{const c=Mb(jt(a.condition).evaluate(s,l));return c!==void 0&&nl(c,Yi)}))})(n,e,t);if(e instanceof cv)return(function(s,a,o){return o.filter((l=>l.isFoundDocument()&&l.key.getCollectionPath().lastSegment()===a.collectionId))})(0,e,t);if(e instanceof U1)return(function(s,a,o){return o.filter((l=>l.isFoundDocument()))})(0,0,t);if(e instanceof V1)return(function(s,a,o){return o.filter((l=>l.isFoundDocument()&&a.Pr.has(l.key.path.toStringWithLeadingSlash())))})(0,e,t);if(e instanceof Dh)return(function(s,a,o){return o.slice(0,a.limit)})(0,e,t);if(e instanceof bc)return(function(s,a,o){const l=a.orderings.map((c=>({Ms:jt(c.expr),direction:c.direction})));
vendor: 14,603 bytes, lines 3196-3275
3196return[...o].sort(((c,d)=>{for(const{Ms:h,direction:m}of l){const p=Mb(h.evaluate(s,c)),x=Mb(h.evaluate(s,d)),y=Ja(p??Ic,x??Ic);if(y!==0)return m==="ascending"?y:-y}return 0}))})(n,e,t);throw new Error(`Unknown stage: ${e._name}`)}function sE(n){const e=(function(r){for(let s=r.stages.length-1;s>=0;s--){const a=r.stages[s];if(a instanceof bc)return a.orderings}throw new Error("Pipeline must contain at least one Sort stage")})(n);return(t,r)=>{for(const s of e){const a=Mb(jt(s.expr).evaluate({serializer:n.serializer},t)),o=Mb(jt(s.expr).evaluate({serializer:n.serializer},r)),l=Ja(a||Ic,o||Ic);if(l!==0)return s.direction==="ascending"?l:-l}return 0}}function Ak(n){for(let e=n.stages.length-1;e>=0;e--){const t=n.stages[e];if(t instanceof Dh)return{limit:t.limit}}}/**
3197 * @license
3198 * Copyright 2017 Google LLC
3199 *
3200 * Licensed under the Apache License, Version 2.0 (the "License");
3201 * you may not use this file except in compliance with the License.
3202 * You may obtain a copy of the License at
3203 *
3204 *   http://www.apache.org/licenses/LICENSE-2.0
3205 *
3206 * Unless required by applicable law or agreed to in writing, software
3207 * distributed under the License is distributed on an "AS IS" BASIS,
3208 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3209 * See the License for the specific language governing permissions and
3210 * limitations under the License.
3211 */class _z{constructor(){this.changes=new ru((e=>e.toString()),((e,t)=>e.isEqual(t))),this.changesApplied=!1}addEntry(e){this.assertNotApplied(),this.changes.set(e.key,e)}removeEntry(e,t){this.assertNotApplied(),this.changes.set(e,Pr.newInvalidDocument(e).setReadTime(t))}getEntry(e,t){this.assertNotApplied();const r=this.changes.get(t);return r!==void 0?ve.resolve(r):this.getFromCache(e,t)}getEntries(e,t){return this.getAllFromCache(e,t)}apply(e){return this.assertNotApplied(),this.changesApplied=!0,this.applyChanges(e)}assertNotApplied(){}}/**
3212 * @license
3213 * Copyright 2017 Google LLC
3214 *
3215 * Licensed under the Apache License, Version 2.0 (the "License");
3216 * you may not use this file except in compliance with the License.
3217 * You may obtain a copy of the License at
3218 *
3219 *   http://www.apache.org/licenses/LICENSE-2.0
3220 *
3221 * Unless required by applicable law or agreed to in writing, software
3222 * distributed under the License is distributed on an "AS IS" BASIS,
3223 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3224 * See the License for the specific language governing permissions and
3225 * limitations under the License.
3226 */class hue{constructor(e){this.serializer=e}setIndexManager(e){this.indexManager=e}addEntry(e,t,r){return Gu(e).put(r)}removeEntry(e,t,r){return Gu(e).delete((function(a,o){const l=a.path.toArray();return[l.slice(0,l.length-2),l[l.length-2],nE(o),l[l.length-1]]})(t,r))}updateMetadata(e,t){return this.getMetadata(e).next((r=>(r.byteSize+=t,this.Ns(e,r))))}getEntry(e,t){let r=Pr.newInvalidDocument(t);return Gu(e).Hn({index:dC,range:IDBKeyRange.only(tb(t))},((s,a)=>{r=this.Ls(t,a)})).next((()=>r))}Bs(e,t){let r={size:0,document:Pr.newInvalidDocument(t)};return Gu(e).Hn({index:dC,range:IDBKeyRange.only(tb(t))},((s,a)=>{r={document:this.Ls(t,a),size:tE(a)}})).next((()=>r))}getEntries(e,t){let r=Os();return this.Us(e,t,((s,a)=>{const o=this.Ls(s,a);r=r.insert(s,o)})).next((()=>r))}getAllEntries(e){let t=Os();return Gu(e).Hn(((r,s)=>{const a=this.Ls(Je.fromSegments(s.prefixPath.concat(s.collectionGroup,s.documentId)),s);t=t.insert(a.key,a)})).next((()=>t))}ks(e,t){let r=Os(),s=new br(Je.comparator);return this.Us(e,t,((a,o)=>{const l=this.Ls(a,o);r=r.insert(a,l),s=s.insert(a,tE(o))})).next((()=>({documents:r,qs:s})))}Us(e,t,r){if(t.isEmpty())return ve.resolve();let s=new Un(H4);t.forEach((c=>s=s.add(c)));const a=IDBKeyRange.bound(tb(s.first()),tb(s.last())),o=s.getIterator();let l=o.getNext();return Gu(e).Hn({index:dC,range:a},((c,d,h)=>{const m=Je.fromSegments([...d.prefixPath,d.collectionGroup,d.documentId]);for(;l&&H4(l,m)<0;)r(l,null),l=o.getNext();l&&l.isEqual(m)&&(r(l,d),l=o.hasNext()?o.getNext():null),l?h.Kn(tb(l)):h.done()})).next((()=>{for(;l;)r(l,null),l=o.hasNext()?o.getNext():null}))}getDocumentsMatchingQuery(e,t,r,s,a){const o=Xr(t)?zt.fromString(uv(t)):t.path,l=[o.popLast().toArray(),o.lastSegment(),nE(r.readTime),r.documentKey.path.isEmpty()?"":r.documentKey.path.lastSegment()],c=[o.popLast().toArray(),o.lastSegment(),[Number.MAX_SAFE_INTEGER,Number.MAX_SAFE_INTEGER],""];return Gu(e).Qn(IDBKeyRange.bound(l,c,!0)).next((d=>{a==null||a.incrementDocumentReadCount(d.length);let h=Os();for(const m of d){const p=this.Ls(Je.fromSegments(m.prefixPath.concat(m.collectionGroup,m.documentId)),m);p.isFoundDocument()&&(Nz(t,p)||s.has(p.key))&&(h=h.insert(p.key,p))}return h}))}getAllFromCollectionGroup(e,t,r,s){let a=Os();const o=$4(t,r),l=$4(t,Ao.max());return Gu(e).Hn({index:hz,range:IDBKeyRange.bound(o,l,!0)},((c,d,h)=>{const m=this.Ls(Je.fromSegments(d.prefixPath.concat(d.collectionGroup,d.documentId)),d);a=a.insert(m.key,m),a.size===s&&h.done()})).next((()=>a))}newChangeBuffer(e){return new fue(this,!!e&&e.trackRemovals)}getSize(e){return this.getMetadata(e).next((t=>t.byteSize))}getMetadata(e){return G4(e).get(R_).next((t=>(Ke(!!t,20021),t)))}Ns(e,t){return G4(e).put(R_,t)}Ls(e,t){if(t){const r=Xde(this.serializer,t);if(!(r.isNoDocument()&&r.version.isEqual(wt.min())))return r}return Pr.newInvalidDocument(e)}}function Iz(n){return new hue(n)}class fue extends _z{constructor(e,t){super(),this.$s=e,this.trackRemovals=t,this.Ks=new ru((r=>r.toString()),((r,s)=>r.isEqual(s)))}applyChanges(e){const t=[];let r=0,s=new Un(((a,o)=>Pt(a.canonicalString(),o.canonicalString())));return this.changes.forEach(((a,o)=>{const l=this.Ks.get(a);if(t.push(this.$s.removeEntry(e,a,l.readTime)),o.isValidDocument()){const c=k4(this.$s.serializer,o);s=s.add(a.path.popLast());const d=tE(c);r+=d-l.size,t.push(this.$s.addEntry(e,a,c))}else if(r-=l.size,this.trackRemovals){const c=k4(this.$s.serializer,o.convertToNoDocument(wt.min()));t.push(this.$s.addEntry(e,a,c))}})),s.forEach((a=>{t.push(this.$s.indexManager.addToCollectionParentIndex(e,a))})),t.push(this.$s.updateMetadata(e,r)),ve.waitFor(t)}getFromCache(e,t){return this.$s.Bs(e,t).next((r=>(this.Ks.set(t,{size:r.size,readTime:r.document.readTime}),r.document)))}getAllFromCache(e,t){return this.$s.ks(e,t).next((({documents:r,qs:s})=>(s.forEach(((a,o)=>{this.Ks.set(a,{size:o,readTime:r.get(a).readTime})})),r)))}}function G4(n){return ea(n,my)}function Gu(n){return ea(n,ZC)}function tb(n){const e=n.path.toArray();return[e.slice(0,e.length-2),e[e.length-2],e[e.length-1]]}function $4(n,e){const t=e.documentKey.path.toArray();return[n,nE(e.readTime),t.slice(0,t.length-2),t.length>0?t[t.length-1]:""]}function H4(n,e){const t=n.path.toArray(),r=e.path.toArray();let s=0;for(let a=0;a<t.length-2&&a<r.length-2;++a)if(s=Pt(t[a],r[a]),s)return s;return s=Pt(t.length,r.length),s||(s=Pt(t[t.length-2],r[r.length-2]),s||Pt(t[t.length-1],r[r.length-1]))}/**
3227 * @license
3228 * Copyright 2017 Google LLC
3229 *
3230 * Licensed under the Apache License, Version 2.0 (the "License");
3231 * you may not use this file except in compliance with the License.
3232 * You may obtain a copy of the License at
3233 *
3234 *   http://www.apache.org/licenses/LICENSE-2.0
3235 *
3236 * Unless required by applicable law or agreed to in writing, software
3237 * distributed under the License is distributed on an "AS IS" BASIS,
3238 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3239 * See the License for the specific language governing permissions and
3240 * limitations under the License.
3241 *//**
3242 * @license
3243 * Copyright 2022 Google LLC
3244 *
3245 * Licensed under the Apache License, Version 2.0 (the "License");
3246 * you may not use this file except in compliance with the License.
3247 * You may obtain a copy of the License at
3248 *
3249 *   http://www.apache.org/licenses/LICENSE-2.0
3250 *
3251 * Unless required by applicable law or agreed to in writing, software
3252 * distributed under the License is distributed on an "AS IS" BASIS,
3253 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3254 * See the License for the specific language governing permissions and
3255 * limitations under the License.
3256 */class mue{constructor(e,t){this.overlayedDocument=e,this.mutatedFields=t}}/**
3257 * @license
3258 * Copyright 2017 Google LLC
3259 *
3260 * Licensed under the Apache License, Version 2.0 (the "License");
3261 * you may not use this file except in compliance with the License.
3262 * You may obtain a copy of the License at
3263 *
3264 *   http://www.apache.org/licenses/LICENSE-2.0
3265 *
3266 * Unless required by applicable law or agreed to in writing, software
3267 * distributed under the License is distributed on an "AS IS" BASIS,
3268 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3269 * See the License for the specific language governing permissions and
3270 * limitations under the License.
3271 */class Dz{constructor(e,t,r,s){this.remoteDocumentCache=e,this.mutationQueue=t,this.documentOverlayCache=r,this.indexManager=s}getDocument(e,t){let r=null;return this.documentOverlayCache.getOverlay(e,t).next((s=>(r=s,this.remoteDocumentCache.getEntry(e,t)))).next((s=>(r!==null&&Db(r.mutation,s,Vi.empty(),bn.now()),s)))}getDocuments(e,t){return this.remoteDocumentCache.getEntries(e,t).next((r=>this.getLocalViewOfDocuments(e,r,Ft()).next((()=>r))))}getLocalViewOfDocuments(e,t,r=Ft()){const s=qo();return this.populateOverlays(e,s,t).next((()=>this.computeViews(e,t,s,r).next((a=>{let o=Gf();return a.forEach(((l,c)=>{o=o.insert(l,c.overlayedDocument)})),o}))))}getOverlayedDocuments(e,t){const r=qo();return this.populateOverlays(e,r,t).next((()=>this.computeViews(e,t,r,Ft())))}populateOverlays(e,t,r){const s=[];return r.forEach((a=>{t.has(a)||s.push(a)})),this.documentOverlayCache.getOverlays(e,s).next((a=>{a.forEach(((o,l)=>{t.set(o,l)}))}))}computeViews(e,t,r,s){let a=Os();const o=Rb(),l=(function(){return Rb()})();return t.forEach(((c,d)=>{const h=r.get(d.key);s.has(d.key)&&(h===void 0||h.mutation instanceof tu)?a=a.insert(d.key,d):h!==void 0?(o.set(d.key,h.mutation.getFieldMask()),Db(h.mutation,d,h.mutation.getFieldMask(),bn.now())):o.set(d.key,Vi.empty())})),this.recalculateAndSaveOverlays(e,a).next((c=>(c.forEach(((d,h)=>o.set(d,h))),t.forEach(((d,h)=>l.set(d,new mue(h,o.get(d)??null)))),l)))}recalculateAndSaveOverlays(e,t){const r=Rb();let s=new br(((o,l)=>o-l)),a=Ft();return this.mutationQueue.getAllMutationBatchesAffectingDocumentKeys(e,t).next((o=>{for(const l of o)l.keys().forEach((c=>{const d=t.get(c);if(d===null)return;let h=r.get(c)||Vi.empty();h=l.applyToLocalView(d,h),r.set(c,h);const m=(s.get(l.batchId)||Ft()).add(c);s=s.insert(l.batchId,m)}))})).next((()=>{const o=[],l=s.getReverseIterator();for(;l.hasNext();){const c=l.getNext(),d=c.key,h=c.value,m=c7();h.forEach((p=>{if(!a.has(p)){const x=HH(t.get(p),r.get(p));x!==null&&m.set(p,x),a=a.add(p)}})),o.push(this.documentOverlayCache.saveOverlays(e,d,m))}return ve.waitFor(o)})).next((()=>r))}recalculateAndSaveOverlaysForDocumentKeys(e,t){return this.remoteDocumentCache.getEntries(e,t).next((r=>this.recalculateAndSaveOverlays(e,r)))}getDocumentsMatchingQuery(e,t,r,s){return Xr(t)?this.getDocumentsMatchingPipeline(e,t,r,s):Qoe(t)?this.getDocumentsMatchingDocumentQuery(e,t.path):ej(t)?this.getDocumentsMatchingCollectionGroupQuery(e,t,r,s):this.getDocumentsMatchingCollectionQuery(e,t,r,s)}getNextDocuments(e,t,r,s){return this.remoteDocumentCache.getAllFromCollectionGroup(e,t,r,s).next((a=>{const o=s-a.size>0?this.documentOverlayCache.getOverlaysForCollectionGroup(e,t,r.largestBatchId,s-a.size):ve.resolve(qo());let l=eg,c=a;return o.next((d=>ve.forEach(d,((h,m)=>(l<m.largestBatchId&&(l=m.largestBatchId),a.get(h)?ve.resolve():this.remoteDocumentCache.getEntry(e,h).next((p=>{c=c.insert(h,p)}))))).next((()=>this.populateOverlays(e,d,a))).next((()=>this.computeViews(e,c,d,Ft()))).next((h=>({batchId:l,changes:l7(h)})))))}))}getDocumentsMatchingDocumentQuery(e,t){return this.getDocument(e,new Je(t)).next((r=>{let s=Gf();return r.isFoundDocument()&&(s=s.insert(r.key,r)),s}))}getDocumentsMatchingCollectionGroupQuery(e,t,r,s){const a=t.collectionGroup;let o=Gf();return this.indexManager.getCollectionParents(e,a).next((l=>ve.forEach(l,(c=>{const d=(function(m,p){return new nu(p,null,m.explicitOrderBy.slice(),m.filters.slice(),m.limit,m.limitType,m.startAt,m.endAt)})(t,c.child(a));return this.getDocumentsMatchingCollectionQuery(e,d,r,s).next((h=>{h.forEach(((m,p)=>{o=o.insert(m,p)}))}))})).next((()=>o))))}getDocumentsMatchingCollectionQuery(e,t,r,s){let a;return this.documentOverlayCache.getOverlaysForCollection(e,t.path,r.largestBatchId).next((o=>(a=o,this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,a,s)))).next((o=>this.retrieveMatchingLocalDocuments(a,o,(l=>j1(t,l)))))}getDocumentsMatchingPipeline(e,t,r,s){if(Ld(t)==="collection_group"){const a=Bj(t);let o=Gf();return this.indexManager.getCollectionParents(e,a).next((l=>ve.forEach(l,(c=>{const d=(function(m,p){const x=m.stages.map((y=>y instanceof cv?new lv(p.canonicalString(),{}):y));return new za(m.serializer,x)})(t,c.child(a));return this.getDocumentsMatchingPipeline(e,d,r,s).next((h=>{h.forEach(((m,p)=>{o=o.insert(m,p)}))}))})).next((()=>o))))}{let a;return this.getOverlaysForPipeline(e,t,r.largestBatchId).next((o=>{switch(a=o,Ld(t)){case"collection":return this.remoteDocumentCache.getDocumentsMatchingQuery(e,t,r,a,s);case"documents":let l=Ft();for(const c of QC(t))l=l.add(Je.fromPath(c));return this.remoteDocumentCache.getEntries(e,l);case"database":return this.remoteDocumentCache.getAllEntries(e);default:throw new Fe("invalid-argument",`Invalid pipeline source to execute offline: ${Od(t)}`)}})).next((o=>this.retrieveMatchingLocalDocuments(a,o,(l=>J1(t,l)))))}}retrieveMatchingLocalDocuments(e,t,r){e.forEach(((a,o)=>{const l=o.getKey();t.get(l)===null&&(t=t.insert(l,Pr.newInvalidDocument(l)))}));let s=Gf();return t.forEach(((a,o)=>{const l=e.get(a);l!==void 0&&Db(l.mutation,o,Vi.empty(),bn.now()),r(o)&&(s=s.insert(a,o))})),s}getOverlaysForPipeline(e,t,r){switch(Ld(t)){case"collection":return this.documentOverlayCache.getOverlaysForCollection(e,zt.fromString(uv(t)),r);case"collection_group":throw new Fe("invalid-argument",`Unexpected collection group pipeline: ${Od(t)}`);case"documents":return this.documentOverlayCache.getOverlays(e,QC(t).map((s=>Je.fromPath(s))));case"database":return this.documentOverlayCache.getAllOverlays(e,r);default:throw new Fe("invalid-argument",`Failed to get overlays for pipeline: ${Od(t)}`)}}}/**
3272 * @license
3273 * Copyright 2020 Google LLC
3274 *
3275 * Licensed under the Apache License, Version 2.0 (the "License");
3276 * you may not use this file except in compliance with the License.
3277 * You may obtain a copy of the License at
3278 *
3279 *   http://www.apache.org/licenses/LICENSE-2.0
3280 *
3281 * Unless required by applicable law or agreed to in writing, software
3282 * distributed under the License is distributed on an "AS IS" BASIS,
3283 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3284 * See the License for the specific language governing permissions and
3285 * limitations under the License.
3286 */class pue{constructor(e){this.serializer=e,this.Qs=new Map,this.Ws=new Map}getBundleMetadata(e,t){return ve.resolve(this.Qs.get(t))}saveBundleMetadata(e,t){return this.Qs.set(t.id,(function(s){return{id:s.id,version:s.version,createTime:Ss(s.createTime)}})(t)),ve.resolve()}getNamedQuery(e,t){return ve.resolve(this.Ws.get(t))}saveNamedQuery(e,t){return this.Ws.set(t.name,(function(s){return{name:s.name,query:W1(s.bundledQuery),readTime:Ss(s.readTime)}})(t)),ve.resolve()}}/**
3287 * @license
3288 * Copyright 2022 Google LLC
3289 *
3290 * Licensed under the Apache License, Version 2.0 (the "License");
3291 * you may not use this file except in compliance with the License.
3292 * You may obtain a copy of the License at
3293 *
3294 *   http://www.apache.org/licenses/LICENSE-2.0
3295 *
3296 * Unless required by applicable law or agreed to in writing, software
3297 * distributed under the License is distributed on an "AS IS" BASIS,
3298 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3299 * See the License for the specific language governing permissions and
3300 * limitations under the License.
3301 */class gue{constructor(){this.overlays=new br(Je.comparator),this.Gs=new Map}getOverlay(e,t){return ve.resolve(this.overlays.get(t))}getOverlays(e,t){const r=qo();return ve.forEach(t,(s=>this.getOverlay(e,s).next((a=>{a!==null&&r.set(s,a)})))).next((()=>r))}getAllOverlays(e,t){const r=qo();return this.overlays.forEach(((s,a)=>{a.largestBatchId>t&&r.set(s,a)})),ve.resolve(r)}saveOverlays(e,t,r){return r.forEach(((s,a)=>{this.Zr(e,t,a)})),ve.resolve()}removeOverlaysForBatchId(e,t,r){const s=this.Gs.get(r);return s!==void 0&&(s.forEach((a=>this.overlays=this.overlays.remove(a))),this.Gs.delete(r)),ve.resolve()}getOverlaysForCollection(e,t,r){const s=qo(),a=t.length+1,o=new Je(t.child("")),l=this.overlays.getIteratorFrom(o);for(;l.hasNext();){const c=l.getNext().value,d=c.getKey();if(!t.isPrefixOf(d.path))break;d.path.length===a&&c.largestBatchId>r&&s.set(c.getKey(),c)}return ve.resolve(s)}getOverlaysForCollectionGroup(e,t,r,s){let a=new br(((d,h)=>d-h));const o=this.overlays.getIterator();for(;o.hasNext();){const d=o.getNext().value;if(d.getKey().getCollectionGroup()===t&&d.largestBatchId>r){let h=a.get(d.largestBatchId);h===null&&(h=qo(),a=a.insert(d.largestBatchId,h)),h.set(d.getKey(),d)}}const l=qo(),c=a.getIterator();for(;c.hasNext()&&(c.getNext().value.forEach(((d,h)=>l.set(d,h))),!(l.size()>=s)););return ve.resolve(l)}Zr(e,t,r){const s=this.overlays.get(r.key);if(s!==null){const o=this.Gs.get(s.largestBatchId).delete(r.key);this.Gs.set(s.largestBatchId,o)}this.overlays=this.overlays.insert(r.key,new Pj(t,r));let a=this.Gs.get(t);a===void 0&&(a=Ft(),this.Gs.set(t,a)),this.Gs.set(t,a.add(r.key))}}/**
3302 * @license
3303 * Copyright 2024 Google LLC
3304 *
3305 * Licensed under the Apache License, Version 2.0 (the "License");
3306 * you may not use this file except in compliance with the License.
3307 * You may obtain a copy of the License at
3308 *
3309 *   http://www.apache.org/licenses/LICENSE-2.0
3310 *
3311 * Unless required by applicable law or agreed to in writing, software
3312 * distributed under the License is distributed on an "AS IS" BASIS,
3313 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3314 * See the License for the specific language governing permissions and
3315 * limitations under the License.
3316 */class xue{constructor(){this.sessionToken=Sr.EMPTY_BYTE_STRING}getSessionToken(e){return ve.resolve(this.sessionToken)}setSessionToken(e,t){return this.sessionToken=t,ve.resolve()}}/**
3317 * @license
3318 * Copyright 2017 Google LLC
3319 *
3320 * Licensed under the Apache License, Version 2.0 (the "License");
3321 * you may not use this file except in compliance with the License.
3322 * You may obtain a copy of the License at
3323 *
3324 *   http://www.apache.org/licenses/LICENSE-2.0
3325 *
3326 * Unless required by applicable law or agreed to in writing, software
3327 * distributed under the License is distributed on an "AS IS" BASIS,
3328 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3329 * See the License for the specific language governing permissions and
3330 * limitations under the License.
3331 */class Mj{constructor(){this.zs=new Un(da.js),this.Hs=new Un(da.Js)}isEmpty(){return this.zs.isEmpty()}addReference(e,t){const r=new da(e,t);this.zs=this.zs.add(r),this.Hs=this.Hs.add(r)}Ys(e,t){e.forEach((r=>this.addReference(r,t)))}removeReference(e,t){this.Zs(new da(e,t))}Xs(e,t){e.forEach((r=>this.removeReference(r,t)))}e_(e){const t=new Je(new zt([])),r=new da(t,e),s=new da(t,e+1),a=[];return this.Hs.forEachInRange([r,s],(o=>{this.Zs(o),a.push(o.key)})),a}t_(){this.zs.forEach((e=>this.Zs(e)))}Zs(e){this.zs=this.zs.delete(e),this.Hs=this.Hs.delete(e)}n_(e){const t=new Je(new zt([])),r=new da(t,e),s=new da(t,e+1);let a=Ft();return this.Hs.forEachInRange([r,s],(o=>{a=a.add(o.key)})),a}containsKey(e){const t=new da(e,0),r=this.zs.firstAfterOrEqual(t);return r!==null&&e.isEqual(r.key)}}class da{constructor(e,t){this.key=e,this.r_=t}static js(e,t){return Je.comparator(e.key,t.key)||Pt(e.r_,t.r_)}static Js(e,t){return Pt(e.r_,t.r_)||Je.comparator(e.key,t.key)}}/**
3332 * @license
3333 * Copyright 2017 Google LLC
3334 *
3335 * Licensed under the Apache License, Version 2.0 (the "License");
3336 * you may not use this file except in compliance with the License.
3337 * You may obtain a copy of the License at
3338 *
3339 *   http://www.apache.org/licenses/LICENSE-2.0
3340 *
3341 * Unless required by applicable law or agreed to in writing, software
3342 * distributed under the License is distributed on an "AS IS" BASIS,
3343 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3344 * See the License for the specific language governing permissions and
3345 * limitations under the License.
3346 */class bue{constructor(e,t){this.indexManager=e,this.referenceDelegate=t,this.mutationQueue=[],this.Gr=1,this.i_=new Un(da.js)}checkEmpty(e){return ve.resolve(this.mutationQueue.length===0)}addMutationBatch(e,t,r,s){const a=this.Gr;this.Gr++,this.mutationQueue.length>0&&this.mutationQueue[this.mutationQueue.length-1];const o=new Nj(a,t,r,s);this.mutationQueue.push(o);for(const l of s)this.i_=this.i_.add(new da(l.key,a)),this.indexManager.addToCollectionParentIndex(e,l.key.path.popLast());return ve.resolve(o)}lookupMutationBatch(e,t){return ve.resolve(this.s_(t))}getNextMutationBatchAfterBatchId(e,t){const r=t+1,s=this.__(r),a=s<0?0:s;return ve.resolve(this.mutationQueue.length>a?this.mutationQueue[a]:null)}getHighestUnacknowledgedBatchId(){return ve.resolve(this.mutationQueue.length===0?xh:this.Gr-1)}getAllMutationBatches(e){return ve.resolve(this.mutationQueue.slice())}getAllMutationBatchesAffectingDocumentKey(e,t){const r=new da(t,0),s=new da(t,Number.POSITIVE_INFINITY),a=[];return this.i_.forEachInRange([r,s],(o=>{const l=this.s_(o.r_);a.push(l)})),ve.resolve(a)}getAllMutationBatchesAffectingDocumentKeys(e,t){let r=new Un(Pt);return t.forEach((s=>{const a=new da(s,0),o=new da(s,Number.POSITIVE_INFINITY);this.i_.forEachInRange([a,o],(l=>{r=r.add(l.r_)}))})),ve.resolve(this.o_(r))}getAllMutationBatchesAffectingQuery(e,t){const r=t.path,s=r.length+1;let a=r;Je.isDocumentKey(a)||(a=a.child(""));const o=new da(new Je(a),0);let l=new Un(Pt);return this.i_.forEachWhile((c=>{const d=c.key.path;return!!r.isPrefixOf(d)&&(d.length===s&&(l=l.add(c.r_)),!0)}),o),ve.resolve(this.o_(l))}o_(e){const t=[];return e.forEach((r=>{const s=this.s_(r);s!==null&&t.push(s)})),t}removeMutationBatch(e,t){Ke(this.a_(t.batchId,"removed")===0,55003),this.mutationQueue.shift();let r=this.i_;return ve.forEach(t.mutations,(s=>{const a=new da(s.key,t.batchId);return r=r.delete(a),this.referenceDelegate.markPotentiallyOrphaned(e,s.key)})).next((()=>{this.i_=r}))}Hr(e){}containsKey(e,t){const r=new da(t,0),s=this.i_.firstAfterOrEqual(r);return ve.resolve(t.isEqual(s&&s.key))}
vendor: 23,492 bytes, lines 3346-3410
3346performConsistencyCheck(e){return this.mutationQueue.length,ve.resolve()}a_(e,t){return this.__(e)}__(e){return this.mutationQueue.length===0?0:e-this.mutationQueue[0].batchId}s_(e){const t=this.__(e);return t<0||t>=this.mutationQueue.length?null:this.mutationQueue[t]}}/**
3347 * @license
3348 * Copyright 2017 Google LLC
3349 *
3350 * Licensed under the Apache License, Version 2.0 (the "License");
3351 * you may not use this file except in compliance with the License.
3352 * You may obtain a copy of the License at
3353 *
3354 *   http://www.apache.org/licenses/LICENSE-2.0
3355 *
3356 * Unless required by applicable law or agreed to in writing, software
3357 * distributed under the License is distributed on an "AS IS" BASIS,
3358 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3359 * See the License for the specific language governing permissions and
3360 * limitations under the License.
3361 */class yue{constructor(e){this.u_=e,this.docs=(function(){return new br(Je.comparator)})(),this.size=0}setIndexManager(e){this.indexManager=e}addEntry(e,t){const r=t.key,s=this.docs.get(r),a=s?s.size:0,o=this.u_(t);return this.docs=this.docs.insert(r,{document:t.mutableCopy(),size:o}),this.size+=o-a,this.indexManager.addToCollectionParentIndex(e,r.path.popLast())}removeEntry(e){const t=this.docs.get(e);t&&(this.docs=this.docs.remove(e),this.size-=t.size)}getEntry(e,t){const r=this.docs.get(t);return ve.resolve(r?r.document.mutableCopy():Pr.newInvalidDocument(t))}getEntries(e,t){let r=Os();return t.forEach((s=>{const a=this.docs.get(s);r=r.insert(s,a?a.document.mutableCopy():Pr.newInvalidDocument(s))})),ve.resolve(r)}getAllEntries(e){let t=Os();return this.docs.forEach(((r,s)=>{t=t.insert(r,s.document)})),ve.resolve(t)}getDocumentsMatchingQuery(e,t,r,s){let a,o;Xr(t)?(a=zt.fromString(uv(t)),o=h=>J1(t,h)):(a=t.path,o=h=>j1(t,h));let l=Os();const c=new Je(a.child("__id-9223372036854775808__")),d=this.docs.getIteratorFrom(c);for(;d.hasNext();){const{key:h,value:{document:m}}=d.getNext();if(!a.isPrefixOf(h.path))break;h.path.length>a.length+1||JD(e7(m),r)<=0||(s.has(m.key)||o(m))&&(l=l.insert(m.key,m.mutableCopy()))}return ve.resolve(l)}getAllFromCollectionGroup(e,t,r,s){ot(9500)}c_(e,t){return ve.forEach(this.docs,(r=>t(r)))}newChangeBuffer(e){return new vue(this)}getSize(e){return ve.resolve(this.size)}}class vue extends _z{constructor(e){super(),this.$s=e}applyChanges(e){const t=[];return this.changes.forEach(((r,s)=>{s.isValidDocument()?t.push(this.$s.addEntry(e,s)):this.$s.removeEntry(r)})),ve.waitFor(t)}getFromCache(e,t){return this.$s.getEntry(e,t)}getAllFromCache(e,t){return this.$s.getEntries(e,t)}}/**
3362 * @license
3363 * Copyright 2017 Google LLC
3364 *
3365 * Licensed under the Apache License, Version 2.0 (the "License");
3366 * you may not use this file except in compliance with the License.
3367 * You may obtain a copy of the License at
3368 *
3369 *   http://www.apache.org/licenses/LICENSE-2.0
3370 *
3371 * Unless required by applicable law or agreed to in writing, software
3372 * distributed under the License is distributed on an "AS IS" BASIS,
3373 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3374 * See the License for the specific language governing permissions and
3375 * limitations under the License.
3376 */class Bue{constructor(e){this.persistence=e,this.l_=new ru((t=>H1(t)),kj),this.lastRemoteSnapshotVersion=wt.min(),this.highestTargetId=0,this.E_=0,this.h_=new Mj,this.targetCount=0,this.T_=qd.ws()}forEachTarget(e,t){return this.l_.forEach(((r,s)=>t(s))),ve.resolve()}getLastRemoteSnapshotVersion(e){return ve.resolve(this.lastRemoteSnapshotVersion)}getHighestSequenceNumber(e){return ve.resolve(this.E_)}allocateTargetId(e){return this.highestTargetId=this.T_.next(),ve.resolve(this.highestTargetId)}setTargetsMetadata(e,t,r){return r&&(this.lastRemoteSnapshotVersion=r),t>this.E_&&(this.E_=t),ve.resolve()}Ds(e){this.l_.set(e.target,e);const t=e.targetId;t>this.highestTargetId&&(this.T_=new qd(t),this.highestTargetId=t),e.sequenceNumber>this.E_&&(this.E_=e.sequenceNumber)}addTargetData(e,t){return this.Ds(t),this.targetCount+=1,ve.resolve()}updateTargetData(e,t){return this.Ds(t),ve.resolve()}removeTargetData(e,t){return this.l_.delete(t.target),this.h_.e_(t.targetId),this.targetCount-=1,ve.resolve()}removeTargets(e,t,r){let s=0;const a=[];return this.l_.forEach(((o,l)=>{l.sequenceNumber<=t&&r.get(l.targetId)===null&&(this.l_.delete(o),a.push(this.removeMatchingKeysForTargetId(e,l.targetId)),s++)})),ve.waitFor(a).next((()=>s))}getTargetCount(e){return ve.resolve(this.targetCount)}getTargetData(e,t){const r=this.l_.get(t)||null;return ve.resolve(r)}addMatchingKeys(e,t,r){return this.h_.Ys(t,r),ve.resolve()}removeMatchingKeys(e,t,r){this.h_.Xs(t,r);const s=this.persistence.referenceDelegate,a=[];return s&&t.forEach((o=>{a.push(s.markPotentiallyOrphaned(e,o))})),ve.waitFor(a)}removeMatchingKeysForTargetId(e,t){return this.h_.e_(t),ve.resolve()}getMatchingKeysForTargetId(e,t){const r=this.h_.n_(t);return ve.resolve(r)}containsKey(e,t){return ve.resolve(this.h_.containsKey(t))}}/**
3377 * @license
3378 * Copyright 2017 Google LLC
3379 *
3380 * Licensed under the Apache License, Version 2.0 (the "License");
3381 * you may not use this file except in compliance with the License.
3382 * You may obtain a copy of the License at
3383 *
3384 *   http://www.apache.org/licenses/LICENSE-2.0
3385 *
3386 * Unless required by applicable law or agreed to in writing, software
3387 * distributed under the License is distributed on an "AS IS" BASIS,
3388 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3389 * See the License for the specific language governing permissions and
3390 * limitations under the License.
3391 */class Fj{constructor(e,t){this.P_={},this.overlays={},this.I_=new Gi(0),this.R_=!1,this.R_=!0,this.A_=new xue,this.referenceDelegate=e(this),this.V_=new Bue(this),this.indexManager=new oue,this.remoteDocumentCache=(function(s){return new yue(s)})((r=>this.referenceDelegate.d_(r))),this.serializer=new wz(t),this.f_=new pue(this.serializer)}start(){return Promise.resolve()}shutdown(){return this.R_=!1,Promise.resolve()}get started(){return this.R_}setDatabaseDeletedListener(){}setNetworkEnabled(){}getIndexManager(e){return this.indexManager}getDocumentOverlayCache(e){let t=this.overlays[e.toKey()];return t||(t=new gue,this.overlays[e.toKey()]=t),t}getMutationQueue(e,t){let r=this.P_[e.toKey()];return r||(r=new bue(t,this.referenceDelegate),this.P_[e.toKey()]=r),r}getGlobalsCache(){return this.A_}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getBundleCache(){return this.f_}runTransaction(e,t,r){ze("MemoryPersistence","Starting transaction:",e);const s=new wue(this.I_.next());return this.referenceDelegate.m_(),r(s).next((a=>this.referenceDelegate.p_(s).next((()=>a)))).toPromise().then((a=>(s.raiseOnCommittedEvent(),a)))}g_(e,t){return ve.or(Object.values(this.P_).map((r=>()=>r.containsKey(e,t))))}}class wue extends R7{constructor(e){super(),this.currentSequenceNumber=e}}class X1{constructor(e){this.persistence=e,this.y_=new Mj,this.w_=null}static b_(e){return new X1(e)}get S_(){if(this.w_)return this.w_;throw ot(60996)}addReference(e,t,r){return this.y_.addReference(r,t),this.S_.delete(r.toString()),ve.resolve()}removeReference(e,t,r){return this.y_.removeReference(r,t),this.S_.add(r.toString()),ve.resolve()}markPotentiallyOrphaned(e,t){return this.S_.add(t.toString()),ve.resolve()}removeTarget(e,t){this.y_.e_(t.targetId).forEach((s=>this.S_.add(s.toString())));const r=this.persistence.getTargetCache();return r.getMatchingKeysForTargetId(e,t.targetId).next((s=>{s.forEach((a=>this.S_.add(a.toString())))})).next((()=>r.removeTargetData(e,t)))}m_(){this.w_=new Set}p_(e){const t=this.persistence.getRemoteDocumentCache().newChangeBuffer();return ve.forEach(this.S_,(r=>{const s=Je.fromPath(r);return this.v_(e,s).next((a=>{a||t.removeEntry(s,wt.min())}))})).next((()=>(this.w_=null,t.apply(e))))}updateLimboDocument(e,t){return this.v_(e,t).next((r=>{r?this.S_.delete(t.toString()):this.S_.add(t.toString())}))}d_(e){return 0}v_(e,t){return ve.or([()=>ve.resolve(this.y_.containsKey(t)),()=>this.persistence.getTargetCache().containsKey(e,t),()=>this.persistence.g_(e,t)])}}class aE{constructor(e,t){this.persistence=e,this.D_=new ru((r=>Ya(r.path)),((r,s)=>r.isEqual(s))),this.garbageCollector=M7(this,t)}static b_(e,t){return new aE(e,t)}m_(){}p_(e){return ve.resolve()}forEachTarget(e,t){return this.persistence.getTargetCache().forEachTarget(e,t)}ir(e){const t=this.Cs(e);return this.persistence.getTargetCache().getTargetCount(e).next((r=>t.next((s=>r+s))))}Cs(e){let t=0;return this.sr(e,(r=>{t++})).next((()=>t))}sr(e,t){return ve.forEach(this.D_,((r,s)=>this.Os(e,r,s).next((a=>a?ve.resolve():t(s)))))}removeTargets(e,t,r){return this.persistence.getTargetCache().removeTargets(e,t,r)}removeOrphanedDocuments(e,t){let r=0;const s=this.persistence.getRemoteDocumentCache(),a=s.newChangeBuffer();return s.c_(e,(o=>this.Os(e,o,t).next((l=>{l||(r++,a.removeEntry(o,wt.min()))})))).next((()=>a.apply(e))).next((()=>r))}markPotentiallyOrphaned(e,t){return this.D_.set(t,e.currentSequenceNumber),ve.resolve()}removeTarget(e,t){const r=t.withSequenceNumber(e.currentSequenceNumber);return this.persistence.getTargetCache().updateTargetData(e,r)}addReference(e,t,r){return this.D_.set(r,e.currentSequenceNumber),ve.resolve()}removeReference(e,t,r){return this.D_.set(r,e.currentSequenceNumber),ve.resolve()}updateLimboDocument(e,t){return this.D_.set(t,e.currentSequenceNumber),ve.resolve()}d_(e){let t=e.key.toString().length;return e.isFoundDocument()&&(t+=sC(e.data.value)),t}Os(e,t,r){return ve.or([()=>this.persistence.g_(e,t),()=>this.persistence.getTargetCache().containsKey(e,t),()=>{const s=this.D_.get(t);return ve.resolve(s!==void 0&&s>r)}])}getCacheSize(e){return this.persistence.getRemoteDocumentCache().getSize(e)}}/**
3392 * @license
3393 * Copyright 2020 Google LLC
3394 *
3395 * Licensed under the Apache License, Version 2.0 (the "License");
3396 * you may not use this file except in compliance with the License.
3397 * You may obtain a copy of the License at
3398 *
3399 *   http://www.apache.org/licenses/LICENSE-2.0
3400 *
3401 * Unless required by applicable law or agreed to in writing, software
3402 * distributed under the License is distributed on an "AS IS" BASIS,
3403 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3404 * See the License for the specific language governing permissions and
3405 * limitations under the License.
3406 */class Cue{constructor(e){this.serializer=e}Nn(e,t,r,s){const a=new O1("createOrUpgrade",t);r<1&&s>=1&&((function(c){c.createObjectStore(fv)})(e),(function(c){c.createObjectStore(fy,{keyPath:Ade}),c.createObjectStore(Il,{keyPath:T4,autoIncrement:!0}).createIndex(Xf,A4,{unique:!0}),c.createObjectStore(sg)})(e),z4(e),(function(c){c.createObjectStore(Pf)})(e));let o=ve.resolve();return r<3&&s>=3&&(r!==0&&((function(c){c.deleteObjectStore(ig),c.deleteObjectStore(ag),c.deleteObjectStore(um)})(e),z4(e)),o=o.next((()=>(function(c){const d=c.store(um),h={highestTargetId:0,highestListenSequenceNumber:0,lastRemoteSnapshotVersion:wt.min().toTimestamp(),targetCount:0};return d.put(eE,h)})(a)))),r<4&&s>=4&&(r!==0&&(o=o.next((()=>(function(c,d){return d.store(Il).Qn().next((m=>{c.deleteObjectStore(Il),c.createObjectStore(Il,{keyPath:T4,autoIncrement:!0}).createIndex(Xf,A4,{unique:!0});const p=d.store(Il),x=m.map((y=>p.put(y)));return ve.waitFor(x)}))})(e,a)))),o=o.next((()=>{(function(c){c.createObjectStore(og,{keyPath:Lde})})(e)}))),r<5&&s>=5&&(o=o.next((()=>this.x_(a)))),r<6&&s>=6&&(o=o.next((()=>((function(c){c.createObjectStore(my)})(e),this.C_(a))))),r<7&&s>=7&&(o=o.next((()=>this.F_(a)))),r<8&&s>=8&&(o=o.next((()=>this.O_(e,a)))),r<9&&s>=9&&(o=o.next((()=>{(function(c){c.objectStoreNames.contains("remoteDocumentChanges")&&c.deleteObjectStore("remoteDocumentChanges")})(e)}))),r<10&&s>=10&&(o=o.next((()=>this.M_(a)))),r<11&&s>=11&&(o=o.next((()=>{(function(c){c.createObjectStore(z1,{keyPath:Ode})})(e),(function(c){c.createObjectStore(q1,{keyPath:Mde})})(e)}))),r<12&&s>=12&&(o=o.next((()=>{(function(c){const d=c.createObjectStore(K1,{keyPath:zde});d.createIndex(L_,qde,{unique:!1}),d.createIndex(gz,Kde,{unique:!1})})(e)}))),r<13&&s>=13&&(o=o.next((()=>(function(c){const d=c.createObjectStore(ZC,{keyPath:Nde});d.createIndex(dC,_de),d.createIndex(hz,Ide)})(e))).next((()=>this.N_(e,a))).next((()=>e.deleteObjectStore(Pf)))),r<14&&s>=14&&(o=o.next((()=>this.L_(e,a)))),r<15&&s>=15&&(o=o.next((()=>(function(c){c.createObjectStore(Dj,{keyPath:Fde,autoIncrement:!0}).createIndex(P_,Ude,{unique:!1}),c.createObjectStore(Fb,{keyPath:Vde}).createIndex(mz,Gde,{unique:!1}),c.createObjectStore(Ub,{keyPath:$de}).createIndex(pz,Hde,{unique:!1})})(e)))),r<16&&s>=16&&(o=o.next((()=>{t.objectStore(Fb).clear()})).next((()=>{t.objectStore(Ub).clear()}))),r<17&&s>=17&&(o=o.next((()=>{(function(c){c.createObjectStore(jj,{keyPath:Wde})})(e)}))),r<18&&s>=18&&S$()&&(o=o.next((()=>{t.objectStore(Fb).clear()})).next((()=>{t.objectStore(Ub).clear()}))),o}C_(e){let t=0;return e.store(Pf).Hn(((r,s)=>{t+=tE(s)})).next((()=>{const r={byteSize:t};return e.store(my).put(R_,r)}))}x_(e){const t=e.store(fy),r=e.store(Il);return t.Qn().next((s=>ve.forEach(s,(a=>{const o=IDBKeyRange.bound([a.userId,xh],[a.userId,a.lastAcknowledgedBatchId]);return r.Qn(Xf,o).next((l=>ve.forEach(l,(c=>{Ke(c.userId===a.userId,18650,"Cannot process batch from unexpected user",{batchId:c.batchId});const d=Hf(this.serializer,c);return Bz(e,a.userId,d).next((()=>{}))}))))}))))}F_(e){const t=e.store(ig),r=e.store(Pf);return e.store(um).get(eE).next((s=>{const a=[];return r.Hn(((o,l)=>{const c=new zt(o),d=(function(m){return[0,Ya(m)]})(c);a.push(t.get(d).next((h=>h?ve.resolve():(m=>t.put({targetId:0,path:Ya(m),sequenceNumber:s.highestListenSequenceNumber}))(c))))})).next((()=>ve.waitFor(a)))}))}O_(e,t){e.createObjectStore(py,{keyPath:Pde});const r=t.store(py),s=new Oj,a=o=>{if(s.add(o)){const l=o.lastSegment(),c=o.popLast();return r.put({collectionId:l,parent:Ya(c)})}};return t.store(Pf).Hn({jn:!0},((o,l)=>{const c=new zt(o);return a(c.popLast())})).next((()=>t.store(sg).Hn({jn:!0},(([o,l,c],d)=>{const h=yc(l);return a(h.popLast())}))))}M_(e){const t=e.store(ag);return t.Hn(((r,s)=>{const a=Eb(this.serializer,s),o=Cz(this.serializer,a);return t.put(o)}))}N_(e,t){const r=t.store(Pf),s=[];return r.Hn(((a,o)=>{const l=t.store(ZC),c=(function(m){return m.document?new Je(zt.fromString(m.document.name).popFirst(5)):m.noDocument?Je.fromSegments(m.noDocument.path):m.unknownDocument?Je.fromSegments(m.unknownDocument.path):ot(36783)})(o).path.toArray(),d={prefixPath:c.slice(0,c.length-2),collectionGroup:c[c.length-2],documentId:c[c.length-1],readTime:o.readTime||[0,0],unknownDocument:o.unknownDocument,noDocument:o.noDocument,document:o.document,hasCommittedMutations:!!o.hasCommittedMutations};s.push(l.put(d))})).next((()=>ve.waitFor(s)))}L_(e,t){const r=t.store(Il),s=Iz(this.serializer),a=new Fj(X1.b_,this.serializer.$r);return r.Qn().next((o=>{const l=new Map;return o.forEach((c=>{let d=l.get(c.userId)??Ft();Hf(this.serializer,c).keys().forEach((h=>d=d.add(h))),l.set(c.userId,d)})),ve.forEach(l,((c,d)=>{const h=new ha(d),m=Q1.Qr(this.serializer,h),p=a.getIndexManager(h),x=Y1.Qr(h,this.serializer,p,a.referenceDelegate);return new Dz(s,x,m,p).recalculateAndSaveOverlaysForDocumentKeys(new O_(t,Gi.wn),c).next()}))}))}}function z4(n){n.createObjectStore(ig,{keyPath:jde}).createIndex(Ij,Rde,{unique:!0}),n.createObjectStore(ag,{keyPath:"targetId"}).createIndex(fz,Dde,{unique:!0}),n.createObjectStore(um)}const $u="IndexedDbPersistence",kk=18e5,Nk=5e3,_k="Failed to obtain exclusive access to the persistence layer. To allow shared access, multi-tab synchronization has to be enabled in all tabs. If you are using `experimentalForceOwningTab:true`, make sure that only one tab has persistence enabled at any given time.",jz="main";class Uj{constructor(e,t,r,s,a,o,l,c,d,h,m=18){if(this.allowTabSynchronization=e,this.persistenceKey=t,this.clientId=r,this.Ct=a,this.window=o,this.document=l,this.B_=d,this.U_=h,this.k_=m,this.I_=null,this.R_=!1,this.isPrimary=!1,this.networkEnabled=!0,this.q_=null,this.inForeground=!1,this.K_=null,this.Q_=null,this.W_=Number.NEGATIVE_INFINITY,this.G_=p=>Promise.resolve(),!Uj.Ye())throw new Fe(Te.UNIMPLEMENTED,"This platform is either missing IndexedDB or is known to have an incomplete implementation. Offline persistence has been disabled.");this.referenceDelegate=new due(this,s),this.z_=t+jz,this.serializer=new wz(c),this.j_=new jc(this.z_,this.k_,new Cue(this.serializer)),this.A_=new tue,this.V_=new cue(this.referenceDelegate,this.serializer),this.remoteDocumentCache=Iz(this.serializer),this.f_=new eue,this.window&&this.window.localStorage?this.H_=this.window.localStorage:(this.H_=null,h===!1&&Cs($u,"LocalStorage is unavailable. As a result, persistence may not work reliably. In particular enablePersistence() could fail immediately after refreshing the page."))}start(){return this.J_().then((()=>{if(!this.isPrimary&&!this.allowTabSynchronization)throw new Fe(Te.FAILED_PRECONDITION,_k);return this.Y_(),this.Z_(),this.X_(),this.runTransaction("getHighestListenSequenceNumber","readonly",(e=>this.V_.getHighestSequenceNumber(e)))})).then((e=>{this.I_=new Gi(e,this.B_)})).then((()=>{this.R_=!0})).catch((e=>(this.j_&&this.j_.close(),Promise.reject(e))))}eo(e){return this.G_=async t=>{if(this.started)return e(t)},e(this.isPrimary)}setDatabaseDeletedListener(e){this.j_.Bn((async t=>{t.newVersion===null&&await e()}))}setNetworkEnabled(e){this.networkEnabled!==e&&(this.networkEnabled=e,this.Ct.enqueueAndForget((async()=>{this.started&&await this.J_()})))}J_(){return this.runTransaction("updateClientMetadataAndTryBecomePrimary","readwrite",(e=>cw(e).put({clientId:this.clientId,updateTimeMs:Date.now(),networkEnabled:this.networkEnabled,inForeground:this.inForeground}).next((()=>{if(this.isPrimary)return this.no(e).next((t=>{t||(this.isPrimary=!1,this.Ct.enqueueRetryable((()=>this.G_(!1))))}))})).next((()=>this.ro(e))).next((t=>this.isPrimary&&!t?this.io(e).next((()=>!1)):!!t&&this.so(e).next((()=>!0)))))).catch((e=>{if(Wh(e))return ze($u,"Failed to extend owner lease: ",e),this.isPrimary;if(!this.allowTabSynchronization)throw e;return ze($u,"Releasing owner lease after error during lease refresh",e),!1})).then((e=>{this.isPrimary!==e&&this.Ct.enqueueRetryable((()=>this.G_(e))),this.isPrimary=e}))}no(e){return nb(e).get(Op).next((t=>ve.resolve(this._o(t))))}oo(e){return cw(e).delete(this.clientId)}async ao(){if(this.isPrimary&&!this.uo(this.W_,kk)){this.W_=Date.now();const e=await this.runTransaction("maybeGarbageCollectMultiClientState","readwrite-primary",(t=>{const r=ea(t,og);return r.Qn().next((s=>{const a=this.co(s,kk),o=s.filter((l=>a.indexOf(l)===-1));return ve.forEach(o,(l=>r.delete(l.clientId))).next((()=>o))}))})).catch((()=>[]));if(this.H_)for(const t of e)this.H_.removeItem(this.lo(t.clientId))}}X_(){this.Q_=this.Ct.enqueueAfterDelay("client_metadata_refresh",4e3,(()=>this.J_().then((()=>this.ao())).then((()=>this.X_()))))}_o(e){return!!e&&e.ownerId===this.clientId}ro(e){return this.U_?ve.resolve(!0):nb(e).get(Op).next((t=>{if(t!==null&&this.uo(t.leaseTimestampMs,Nk)&&!this.Eo(t.ownerId)){if(this._o(t)&&this.networkEnabled)return!0;if(!this._o(t)){if(!t.allowTabSynchronization)throw new Fe(Te.FAILED_PRECONDITION,_k);return!1}}return!(!this.networkEnabled||!this.inForeground)||cw(e).Qn().next((r=>this.co(r,Nk).find((s=>{if(this.clientId!==s.clientId){const a=!this.networkEnabled&&s.networkEnabled,o=!this.inForeground&&s.inForeground,l=this.networkEnabled===s.networkEnabled;if(a||o&&l)return!0}return!1}))===void 0))})).next((t=>(this.isPrimary!==t&&ze($u,`Client ${t?"is":"is not"} eligible for a primary lease.`),t)))}async shutdown(){this.R_=!1,this.ho(),this.Q_&&(this.Q_.cancel(),this.Q_=null),this.To(),this.Po(),await this.j_.runTransaction("shutdown","readwrite",[fv,og],(e=>{const t=new O_(e,Gi.wn);return this.io(t).next((()=>this.oo(t)))})),this.j_.close(),this.Io()}co(e,t){return e.filter((r=>this.uo(r.updateTimeMs,t)&&!this.Eo(r.clientId)))}Ro(){return this.runTransaction("getActiveClients","readonly",(e=>cw(e).Qn().next((t=>this.co(t,kk).map((r=>r.clientId))))))}get started(){return this.R_}getGlobalsCache(){return this.A_}getMutationQueue(e,t){return Y1.Qr(e,this.serializer,t,this.referenceDelegate)}getTargetCache(){return this.V_}getRemoteDocumentCache(){return this.remoteDocumentCache}getIndexManager(e){return new lue(e,this.serializer.$r.databaseId)}getDocumentOverlayCache(e){return Q1.Qr(this.serializer,e)}getBundleCache(){return this.f_}runTransaction(e,t,r){ze($u,"Starting transaction:",e);const s=t==="readonly"?"readonly":"readwrite",a=(function(c){return c===18?Jde:c===17?vz:c===16?Qde:c===15?Rj:c===14?yz:c===13?bz:c===12?Yde:c===11?xz:void ot(60245)})(this.k_);let o;return this.j_.runTransaction(e,s,a,(l=>(o=new O_(l,this.I_?this.I_.next():Gi.wn),t==="readwrite-primary"?this.no(o).next((c=>!!c||this.ro(o))).next((c=>{if(!c)throw Cs(`Failed to obtain primary lease for action '${e}'.`),this.isPrimary=!1,this.Ct.enqueueRetryable((()=>this.G_(!1))),new Fe(Te.FAILED_PRECONDITION,j7);return r(o)})).next((c=>this.so(o).next((()=>c)))):this.Ao(o).next((()=>r(o)))))).then((l=>(o.raiseOnCommittedEvent(),l)))}Ao(e){return nb(e).get(Op).next((t=>{if(t!==null&&this.uo(t.leaseTimestampMs,Nk)&&!this.Eo(t.ownerId)&&!this._o(t)&&!(this.U_||this.allowTabSynchronization&&t.allowTabSynchronization))throw new Fe(Te.FAILED_PRECONDITION,_k)}))}so(e){const t={ownerId:this.clientId,allowTabSynchronization:this.allowTabSynchronization,leaseTimestampMs:Date.now()};return nb(e).put(Op,t)}static Ye(){return jc.Ye()}io(e){const t=nb(e);return t.get(Op).next((r=>this._o(r)?(ze($u,"Releasing primary lease."),t.delete(Op)):ve.resolve()))}uo(e,t){const r=Date.now();return!(e<r-t)&&(!(e>r)||(Cs(`Detected an update time that is in the future: ${e} > ${r}`),!1))}Y_(){this.document!==null&&typeof this.document.addEventListener=="function"&&(this.K_=()=>{this.Ct.enqueueAndForget((()=>(this.inForeground=this.document.visibilityState==="visible",this.J_())))},this.document.addEventListener("visibilitychange",this.K_),this.inForeground=this.document.visibilityState==="visible")}To(){this.K_&&(this.document.removeEventListener("visibilitychange",this.K_),this.K_=null)}Z_(){var e;typeof((e=this.window)==null?void 0:e.addEventListener)=="function"&&(this.q_=()=>{this.ho();const t=/(?:Version|Mobile)\/1[456]/;E$()&&(navigator.appVersion.match(t)||navigator.userAgent.match(t))&&this.Ct.enterRestrictedMode(!0),this.Ct.enqueueAndForget((()=>this.shutdown()))},this.window.addEventListener("pagehide",this.q_))}Po(){this.q_&&(this.window.removeEventListener("pagehide",this.q_),this.q_=null)}Eo(e){var t;try{const r=((t=this.H_)==null?void 0:t.getItem(this.lo(e)))!==null;return ze($u,`Client '${e}' ${r?"is":"is not"} zombied in LocalStorage`),r}catch(r){return Cs($u,"Failed to get zombied client id.",r),!1}}ho(){if(this.H_)try{this.H_.setItem(this.lo(this.clientId),String(Date.now()))}catch(e){Cs("Failed to set zombie client id.",e)}}Io(){if(this.H_)try{this.H_.removeItem(this.lo(this.clientId))}catch{}}lo(e){return`firestore_zombie_${this.persistenceKey}_${e}`}}function nb(n){return ea(n,fv)}function cw(n){return ea(n,og)}function Vj(n,e){let t=n.projectId;return n.isDefaultDatabase||(t+="."+n.database),"firestore/"+e+"/"+t+"/"}/**
3407 * @license
3408 * Copyright 2017 Google LLC
3409 *
3410 * Licensed under the Apache License, Version 2.0 (the "License");
3411 * you may not use this file except in compliance with the License.
3412 * You may obtain a copy of the License at
3413 *
3414 *   http://www.apache.org/licenses/LICENSE-2.0
3415 *
3416 * Unless required by applicable law or agreed to in writing, software
3417 * distributed under the License is distributed on an "AS IS" BASIS,
3418 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3419 * See the License for the specific language governing permissions and
3420 * limitations under the License.
3421 */class Gj{constructor(e,t,r,s){this.targetId=e,this.fromCache=t,this.Vo=r,this.fo=s}static mo(e,t){let r=Ft(),s=Ft();for(const a of t.docChanges)switch(a.type){case 0:r=r.add(a.doc.key);break;case 1:s=s.add(a.doc.key)}return new Gj(e,t.fromCache,r,s)}}/**
3422 * @license
3423 * Copyright 2017 Google LLC
3424 *
3425 * Licensed under the Apache License, Version 2.0 (the "License");
3426 * you may not use this file except in compliance with the License.
3427 * You may obtain a copy of the License at
3428 *
3429 *   http://www.apache.org/licenses/LICENSE-2.0
3430 *
3431 * Unless required by applicable law or agreed to in writing, software
3432 * distributed under the License is distributed on an "AS IS" BASIS,
3433 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3434 * See the License for the specific language governing permissions and
3435 * limitations under the License.
3436 */function Eue(n,e){return Je.comparator(n.key,e.key)}/**
3437 * @license
3438 * Copyright 2023 Google LLC
3439 *
3440 * Licensed under the Apache License, Version 2.0 (the "License");
3441 * you may not use this file except in compliance with the License.
3442 * You may obtain a copy of the License at
3443 *
3444 *   http://www.apache.org/licenses/LICENSE-2.0
3445 *
3446 * Unless required by applicable law or agreed to in writing, software
3447 * distributed under the License is distributed on an "AS IS" BASIS,
3448 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3449 * See the License for the specific language governing permissions and
3450 * limitations under the License.
3451 */class Sue{constructor(){this._documentReadCount=0}get documentReadCount(){return this._documentReadCount}incrementDocumentReadCount(e){this._documentReadCount+=e}}/**
3452 * @license
3453 * Copyright 2019 Google LLC
3454 *
3455 * Licensed under the Apache License, Version 2.0 (the "License");
3456 * you may not use this file except in compliance with the License.
3457 * You may obtain a copy of the License at
3458 *
3459 *   http://www.apache.org/licenses/LICENSE-2.0
3460 *
3461 * Unless required by applicable law or agreed to in writing, software
3462 * distributed under the License is distributed on an "AS IS" BASIS,
3463 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3464 * See the License for the specific language governing permissions and
3465 * limitations under the License.
3466 */class Rz{constructor(){this.po=!1,this.yo=!1,this.wo=100,this.bo=(function(){return E$()?8:P7(Js())>0?6:4})()}initialize(e,t){this.So=e,this.indexManager=t,this.po=!0}getDocumentsMatchingQuery(e,t,r,s){const a={result:null};return this.vo(e,t).next((o=>{a.result=o})).next((()=>{if(!a.result)return this.Do(e,t,s,r).next((o=>{a.result=o}))})).next((()=>{if(a.result)return;const o=new Sue;return this.xo(e,t,o).next((l=>{if(a.result=l,this.yo)return this.Co(e,t,o,l.size)}))})).next((()=>a.result))}Co(e,t,r,s){return Xr(t)?ve.resolve():r.documentReadCount<this.wo?(m0()<=an.DEBUG&&ze("QueryEngine","SDK will not create cache indexes for query:",jb(t),"since it only creates cache indexes for collection contains","more than or equal to",this.wo,"documents"),ve.resolve()):(m0()<=an.DEBUG&&ze("QueryEngine","Query:",jb(t),"scans",r.documentReadCount,"local documents and returns",s,"documents as results."),r.documentReadCount>this.bo*s?(m0()<=an.DEBUG&&ze("QueryEngine","The SDK decides to create cache indexes for query:",jb(t),"as using cache indexes may help improve performance."),this.indexManager.createTargetIndexes(e,Wa(t))):ve.resolve())}vo(e,t){if(Xr(t))return ve.resolve(null);let r=t;if(o4(r))return ve.resolve(null);let s=Wa(r);return this.indexManager.getIndexType(e,s).next((a=>a===0?null:(r.limit!==null&&a===1&&(r=WC(r,null,"F"),s=Wa(r)),this.indexManager.getDocumentsMatchingTarget(e,s).next((o=>{const l=Ft(...o);return this.So.getDocuments(e,l).next((c=>this.indexManager.getMinOffset(e,s).next((d=>{const h=this.Fo(r,c);return this.Oo(r,h,l,d.readTime)?this.vo(e,WC(r,null,"F")):this.Mo(e,h,r,d)}))))}
3466)))))}Do(e,t,r,s){return(Xr(t)?(function(o){for(const l of o.stages){if(l instanceof Dh||l instanceof C4)return!1;if(l instanceof dv){if(l.condition instanceof X7&&l.condition._expr.name==="exists"&&l.condition._expr.params[0]instanceof Qm&&l.condition._expr.params[0].fieldName===gc)continue;return!1}}return!0})(t):o4(t))||s.isEqual(wt.min())?ve.resolve(null):this.So.getDocuments(e,r).next((a=>{const o=this.Fo(t,a);return this.Oo(t,o,r,s)?ve.resolve(null):(m0()<=an.DEBUG&&ze("QueryEngine","Re-using previous result from %s to execute query: %s",s.toString(),E4(t)),this.Mo(e,o,t,ZH(s,eg)).next((l=>l)))}))}Fo(e,t){let r,s;return Xr(e)?(r=new Un(Eue),s=a=>J1(e,a)):(r=new Un(R1(e)),s=a=>j1(e,a)),t.forEach(((a,o)=>{s(o)&&(r=r.add(o))})),r}Oo(e,t,r,s){if(Xr(e))return(function(l){return l.stages.some((c=>c instanceof Dh||c instanceof C4))})(e);if(e.limit===null)return!1;if(r.size!==t.size)return!0;const a=e.limitType==="F"?t.last():t.first();return!!a&&(a.hasPendingWrites||a.version.compareTo(s)>0)}xo(e,t,r){return m0()<=an.DEBUG&&ze("QueryEngine","Using full collection scan to execute query:",E4(t)),this.So.getDocumentsMatchingQuery(e,t,Ao.min(),r)}Mo(e,t,r,s){return this.So.getDocumentsMatchingQuery(e,r,s).next((a=>(t.forEach((o=>{a=a.insert(o.key,o)})),a)))}}/**
3467 * @license
3468 * Copyright 2020 Google LLC
3469 *
3470 * Licensed under the Apache License, Version 2.0 (the "License");
3471 * you may not use this file except in compliance with the License.
3472 * You may obtain a copy of the License at
3473 *
3474 *   http://www.apache.org/licenses/LICENSE-2.0
3475 *
3476 * Unless required by applicable law or agreed to in writing, software
3477 * distributed under the License is distributed on an "AS IS" BASIS,
3478 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3479 * See the License for the specific language governing permissions and
3480 * limitations under the License.
3481 */const $j="LocalStore",Tue=3e8;class Aue{constructor(e,t,r,s){this.persistence=e,this.No=t,this.serializer=s,this.Lo=new br(Pt),this.Bo=new ru((a=>H1(a)),kj),this.Uo=new Map,this.ko=e.getRemoteDocumentCache(),this.V_=e.getTargetCache(),this.f_=e.getBundleCache(),this.qo(r)}qo(e){this.documentOverlayCache=this.persistence.getDocumentOverlayCache(e),this.indexManager=this.persistence.getIndexManager(e),this.mutationQueue=this.persistence.getMutationQueue(e,this.indexManager),this.localDocuments=new Dz(this.ko,this.mutationQueue,this.documentOverlayCache,this.indexManager),this.ko.setIndexManager(this.indexManager),this.No.initialize(this.localDocuments,this.indexManager)}collectGarbage(e){return this.persistence.runTransaction("Collect garbage","readwrite-primary",(t=>e.collect(t,this.Lo)))}}function Pz(n,e,t,r){return new Aue(n,e,t,r)}async function Lz(n,e){const t=st(n);return await t.persistence.runTransaction("Handle user change","readonly",(r=>{let s;return t.mutationQueue.getAllMutationBatches(r).next((a=>(s=a,t.qo(e),t.mutationQueue.getAllMutationBatches(r)))).next((a=>{const o=[],l=[];let c=Ft();for(const d of s){o.push(d.batchId);for(const h of d.mutations)c=c.add(h.key)}for(const d of a){l.push(d.batchId);for(const h of d.mutations)c=c.add(h.key)}return t.localDocuments.getDocuments(r,c).next((d=>({$o:d,removedBatchIds:o,addedBatchIds:l})))}))}))}function kue(n,e){const t=st(n);return t.persistence.runTransaction("Acknowledge batch","readwrite-primary",(r=>{const s=e.batch.keys(),a=t.ko.newChangeBuffer({trackRemovals:!0});return(function(l,c,d,h){const m=d.batch,p=m.keys();let x=ve.resolve();return p.forEach((y=>{x=x.next((()=>h.getEntry(c,y))).next((v=>{const B=d.docVersions.get(y);Ke(B!==null,48541),v.version.compareTo(B)<0&&(m.applyToRemoteDocument(v,d),v.isValidDocument()&&(v.setReadTime(d.commitVersion),h.addEntry(v)))}))})),x.next((()=>l.mutationQueue.removeMutationBatch(c,m)))})(t,r,e,a).next((()=>a.apply(r))).next((()=>t.mutationQueue.performConsistencyCheck(r))).next((()=>t.documentOverlayCache.removeOverlaysForBatchId(r,s,e.batch.batchId))).next((()=>t.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(r,(function(l){let c=Ft();for(let d=0;d<l.mutationResults.length;++d)l.mutationResults[d].transformResults.length>0&&(c=c.add(l.batch.mutations[d].key));return c})(e)))).next((()=>t.localDocuments.getDocuments(r,s)))}))}function Oz(n){const e=st(n);return e.persistence.runTransaction("Get last remote snapshot version","readonly",(t=>e.V_.getLastRemoteSnapshotVersion(t)))}function Nue(n,e){const t=st(n),r=e.snapshotVersion;let s=t.Lo;return t.persistence.runTransaction("Apply remote event","readwrite-primary",(a=>{const o=t.ko.newChangeBuffer({trackRemovals:!0});s=t.Lo;const l=[];
3481e.targetChanges.forEach(((h,m)=>{const p=s.get(m);if(!p)return;l.push(t.V_.removeMatchingKeys(a,h.removedDocuments,m).next((()=>t.V_.addMatchingKeys(a,h.addedDocuments,m))));let x=p.withSequenceNumber(a.currentSequenceNumber);e.targetMismatches.get(m)!==null?x=x.withResumeToken(Sr.EMPTY_BYTE_STRING,wt.min()).withLastLimboFreeSnapshotVersion(wt.min()):h.resumeToken.approximateByteSize()>0&&(x=x.withResumeToken(h.resumeToken,r)),s=s.insert(m,x),(function(v,B,E){return v.resumeToken.approximateByteSize()===0||B.snapshotVersion.toMicroseconds()-v.snapshotVersion.toMicroseconds()>=Tue?!0:E.addedDocuments.size+E.modifiedDocuments.size+E.removedDocuments.size>0})(p,x,h)&&l.push(t.V_.updateTargetData(a,x))}));let c=Os(),d=Ft();if(e.documentUpdates.forEach((h=>{e.resolvedLimboDocuments.has(h)&&l.push(t.persistence.referenceDelegate.updateLimboDocument(a,h))})),l.push(Mz(a,o,e.documentUpdates).next((h=>{c=h.Ko,d=h.Qo}))),!r.isEqual(wt.min())){const h=t.V_.getLastRemoteSnapshotVersion(a).next((m=>t.V_.setTargetsMetadata(a,a.currentSequenceNumber,r)));l.push(h)}return ve.waitFor(l).next((()=>o.apply(a))).next((()=>t.localDocuments.getLocalViewOfDocuments(a,c,d))).next((()=>c))})).then((a=>(t.Lo=s,a)))}function Mz(n,e,t){let r=Ft(),s=Ft();return t.forEach((a=>r=r.add(a))),e.getEntries(n,r).next((a=>{let o=Os();return t.forEach(((l,c)=>{const d=a.get(l);c.isFoundDocument()!==d.isFoundDocument()&&(s=s.add(l)),c.isNoDocument()&&c.version.isEqual(wt.min())?(e.removeEntry(l,c.readTime),o=o.insert(l,c)):!d.isValidDocument()||c.version.compareTo(d.version)>0||c.version.compareTo(d.version)===0&&d.hasPendingWrites?(e.addEntry(c),o=o.insert(l,c)):ze($j,"Ignoring outdated watch update for ",l,". Current version:",d.version," Watch version:",c.version)})),{Ko:o,Qo:s}}))}function _ue(n,e){const t=st(n);return t.persistence.runTransaction("Get next mutation batch","readonly",(r=>(e===void 0&&(e=xh),t.mutationQueue.getNextMutationBatchAfterBatchId(r,e))))}function lg(n,e){const t=st(n);return t.persistence.runTransaction("Allocate target","readwrite",(r=>{let s;return t.V_.getTargetData(r,e).next((a=>a?(s=a,ve.resolve(s)):t.V_.allocateTargetId(r).next((o=>(s=new vc(e,o,"TargetPurposeListen",r.currentSequenceNumber),t.V_.addTargetData(r,s).next((()=>s)))))))})).then((r=>{const s=t.Lo.get(r.targetId);return(s===null||r.snapshotVersion.compareTo(s.snapshotVersion)>0)&&(t.Lo=t.Lo.insert(r.targetId,r),t.Bo.set(e,r.targetId)),r}))}async function cg(n,e,t){const r=st(n),s=r.Lo.get(e),a=t?"readwrite":"readwrite-primary";try{t||await r.persistence.runTransaction("Release target",a,(o=>r.persistence.referenceDelegate.removeTarget(o,s)))}catch(o){if(!Wh(o))throw o;ze($j,`Failed to update sequence numbers for target ${e}: ${o}`)}r.Lo=r.Lo.remove(e),r.Bo.delete(s.target)}function iE(n,e,t){const r=st(n);let s=wt.min(),a=Ft();return r.persistence.runTransaction("Execute query","readwrite",(o=>(function(c,d,h){const m=st(c),p=m.Bo.get(h);return p!==void 0?ve.resolve(m.Lo.get(p)):m.V_.getTargetData(d,h)})(r,o,Xr(e)?e:Wa(e)).next((l=>{if(l)return s=l.lastLimboFreeSnapshotVersion,r.V_.getMatchingKeysForTargetId(o,l.targetId).next((c=>{a=c}))})).next((()=>r.No.getDocumentsMatchingQuery(o,e,t?s:wt.min(),t?a:Ft()))).next((l=>(Uz(r,l),{documents:l,Wo:a})))))}function Fz(n,e){const t=st(n),r=st(t.V_),s=t.Lo.get(e);return s?Promise.resolve(s.target??null):t.persistence.runTransaction("Get target data","readonly",(a=>r.ye(a,e).next((o=>(o==null?void 0:o.target)??null))))}function G_(n,e){const t=st(n),r=t.Uo.get(e)||wt.min();return t.persistence.runTransaction("Get new document changes","readonly",(s=>t.ko.getAllFromCollectionGroup(s,e,ZH(r,eg),Number.MAX_SAFE_INTEGER))).then((s=>(Uz(t,s),s)))}function Uz(n,e){e.forEach(((t,r)=>{const s=r.key.getCollectionGroup(),a=n.Uo.get(s)||wt.min();r.readTime.compareTo(a)>0&&n.Uo.set(s,r.readTime)}))}async function Iue(n,e,t,r){const s=st(n);let a=Ft(),o=Os();for(const d of t){const h=e.Go(d.metadata.name);d.document&&(a=a.add(h));const m=e.zo(d);m.setReadTime(e.jo(d.metadata.readTime)),o=o.insert(h,m)}const l=s.ko.newChangeBuffer({trackRemovals:!0}),c=await lg(s,(function(h){return Wa(Lg(zt.fromString(`__bundle__/docs/${h}`)))})(r));return s.persistence.runTransaction("Apply bundle documents","readwrite",(d=>Mz(d,l,o).next((h=>(l.apply(d),h))).next((h=>s.V_.removeMatchingKeysForTargetId(d,c.targetId).next((()=>s.V_.addMatchingKeys(d,a,c.targetId))).next((()=>s.localDocuments.getLocalViewOfDocuments(d,h.Ko,h.Qo))).next((()=>h.Ko))))))}async function Due(n,e,t=Ft()){const r=await lg(n,Wa(W1(e.bundledQuery))),s=st(n);return s.persistence.runTransaction("Save named query","readwrite",(a=>{const o=Ss(e.readTime);if(r.snapshotVersion.compareTo(o)>=0)return s.f_.saveNamedQuery(a,e);const l=r.withResumeToken(Sr.EMPTY_BYTE_STRING,o);return s.Lo=s.Lo.insert(l.targetId,l),s.V_.updateTargetData(a,l).next((()=>s.V_.removeMatchingKeysForTargetId(a,r.targetId))).next((()=>s.V_.addMatchingKeys(a,t,r.targetId))).next((()=>s.f_.saveNamedQuery(a,e)))}))}/**
3482 * @license
3483 * Copyright 2020 Google LLC
3484 *
3485 * Licensed under the Apache License, Version 2.0 (the "License");
3486 * you may not use this file except in compliance with the License.
3487 * You may obtain a copy of the License at
3488 *
3489 *   http://www.apache.org/licenses/LICENSE-2.0
3490 *
3491 * Unless required by applicable law or agreed to in writing, software
3492 * distributed under the License is distributed on an "AS IS" BASIS,
3493 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3494 * See the License for the specific language governing permissions and
3495 * limitations under the License.
3496 */class Vz{constructor(e,t){this.Ho=e,this.byteLength=t}Jo(){return"metadata"in this.Ho}}/**
3497 * @license
3498 * Copyright 2020 Google LLC
3499 *
3500 * Licensed under the Apache License, Version 2.0 (the "License");
3501 * you may not use this file except in compliance with the License.
3502 * You may obtain a copy of the License at
3503 *
3504 *   http://www.apache.org/licenses/LICENSE-2.0
3505 *
3506 * Unless required by applicable law or agreed to in writing, software
3507 * distributed under the License is distributed on an "AS IS" BASIS,
3508 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3509 * See the License for the specific language governing permissions and
3510 * limitations under the License.
3511 */function q4(n,e=10240){let t=0;return{async read(){if(t<n.byteLength){const r={value:n.slice(t,t+e),done:!1};return t+=e,r}return{done:!0}},async cancel(){},releaseLock(){},closed:Promise.resolve()}}/**
3512 * @license
3513 * Copyright 2020 Google LLC
3514 *
3515 * Licensed under the Apache License, Version 2.0 (the "License");
3516 * you may not use this file except in compliance with the License.
3517 * You may obtain a copy of the License at
3518 *
3519 *   http://www.apache.org/licenses/LICENSE-2.0
3520 *
3521 * Unless required by applicable law or agreed to in writing, software
3522 * distributed under the License is distributed on an "AS IS" BASIS,
3523 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3524 * See the License for the specific language governing permissions and
3525 * limitations under the License.
3526 */class jue{constructor(e,t){this.asyncQueue=e,this.onlineStateHandler=t,this.state="Unknown",this.Yo=0,this.Zo=null,this.Xo=!0}ea(){this.Yo===0&&(this.ta("Unknown"),this.Zo=this.asyncQueue.enqueueAfterDelay("online_state_timeout",1e4,(()=>(this.Zo=null,this.na("Backend didn't respond within 10 seconds."),this.ta("Offline"),Promise.resolve()))))}ra(e){this.state==="Online"?this.ta("Unknown"):(this.Yo++,this.Yo>=1&&(this.ia(),this.na(`Connection failed 1 times. Most recent error: ${e.toString()}`),this.ta("Offline")))}set(e){this.ia(),this.Yo=0,e==="Online"&&(this.Xo=!1),this.ta(e)}ta(e){e!==this.state&&(this.state=e,this.onlineStateHandler(e))}na(e){const t=`Could not reach Cloud Firestore backend. ${e}
3527This typically indicates that your device does not have a healthy Internet connection at the moment. The client will operate in offline mode until it is able to successfully connect to the backend.`;this.Xo?(Cs(t),this.Xo=!1):ze("OnlineStateTracker",t)}ia(){this.Zo!==null&&(this.Zo.cancel(),this.Zo=null)}}/**
3528 * @license
3529 * Copyright 2017 Google LLC
3530 *
3531 * Licensed under the Apache License, Version 2.0 (the "License");
3532 * you may not use this file except in compliance with the License.
3533 * You may obtain a copy of the License at
3534 *
3535 *   http://www.apache.org/licenses/LICENSE-2.0
3536 *
3537 * Unless required by applicable law or agreed to in writing, software
3538 * distributed under the License is distributed on an "AS IS" BASIS,
3539 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3540 * See the License for the specific language governing permissions and
3541 * limitations under the License.
3542 */const Fc="RemoteStore";class Rue{constructor(e,t,r,s,a){this.localStore=e,this.datastore=t,this.asyncQueue=r,this.remoteSyncer={},this.sa=[],this._a=new Map,this.oa=new Map,this.aa=new Map,this.ua=new qd(1e3),this.ca=new qd(1001),this.la=new Set,this.Ea=[],this.ha=a,this.ha.Qe((o=>{r.enqueueAndForget((async()=>{Yh(this)&&(ze(Fc,"Restarting streams for network reachability change."),await(async function(c){const d=st(c);d.la.add(4),await Ug(d),d.Ta.set("Unknown"),d.la.delete(4),await mv(d)})(this))}))})),this.Ta=new jue(r,s)}}async function mv(n){if(Yh(n))for(const e of n.Ea)await e(!0)}async function Ug(n){for(const e of n.Ea)await e(!1)}function $_(n,e){return n.oa.get(e)||void 0}function Z1(n,e){const t=st(n),r=$_(t,e.targetId);if(r!==void 0&&t._a.has(r))return;const s=(function(l,c){const d=$_(l,c);
3542d!==void 0&&l.aa.delete(d);const h=(function(p,x){return x%2!=0?p.ca.next():p.ua.next()})(l,c);return l.oa.set(c,h),l.aa.set(h,c),h})(t,e.targetId);ze(Fc,"remoteStoreListen mapping SDK target ID to remote",e.targetId,s);const a=new vc(e.target,s,e.purpose,e.sequenceNumber,e.snapshotVersion,e.lastLimboFreeSnapshotVersion,e.resumeToken);t._a.set(s,a),qj(t)?zj(t):Gg(t).Yt()&&Hj(t,a)}function dg(n,e){const t=st(n),r=Gg(t),s=$_(t,e);ze(Fc,"remoteStoreUnlisten removing mapping of SDK target ID to remote",e,s),t._a.delete(s),t.oa.delete(e),t.aa.delete(s),r.Yt()&&Gz(t,s),t._a.size===0&&(r.Yt()?r.en():Yh(t)&&t.Ta.set("Unknown"))}function Hj(n,e){if(n.Pa.J(e.targetId),e.resumeToken.approximateByteSize()>0||e.snapshotVersion.compareTo(wt.min())>0){const t=n.aa.get(e.targetId);if(t===void 0)return void ze(Fc,"SDK target ID not found for remote ID: "+e.targetId);const r=n.remoteSyncer.getRemoteKeysForTarget(t).size;e=e.withExpectedCount(r)}Gg(n).Pn(e)}function Gz(n,e){n.Pa.J(e),Gg(n).In(e)}function zj(n){n.Pa=new lle({getRemoteKeysForTarget:e=>{const t=n.aa.get(e);return t!==void 0?n.remoteSyncer.getRemoteKeysForTarget(t):Ft()},ye:e=>n._a.get(e)||null,Ve:()=>n.datastore.serializer.databaseId}),Gg(n).start(),n.Ta.ea()}function qj(n){return Yh(n)&&!Gg(n).Jt()&&n._a.size>0}function Yh(n){return st(n).la.size===0}function $z(n){n.Pa=void 0}async function Pue(n){n.Ta.set("Online")}async function Lue(n){n._a.forEach(((e,t)=>{Hj(n,e)}))}async function Oue(n,e){$z(n),qj(n)?(n.Ta.ra(e),zj(n)):n.Ta.set("Unknown")}async function Mue(n,e,t){if(n.Ta.set("Online"),e instanceof h7&&e.state===2&&e.cause)try{await(async function(s,a){const o=a.cause;for(const l of a.targetIds){if(s._a.has(l)){const c=s.aa.get(l);c!==void 0&&(await s.remoteSyncer.rejectListen(c,o),s.oa.delete(c),s.aa.delete(l)),s._a.delete(l)}s.Pa.removeTarget(l)}})(n,e)}catch(r){ze(Fc,"Failed to remove targets %s: %s ",e.targetIds.join(","),r),await oE(n,r)}else if(e instanceof iC?n.Pa._e(e):e instanceof u7?n.Pa.he(e):n.Pa.ue(e),!t.isEqual(wt.min()))try{const r=await Oz(n.localStore);t.compareTo(r)>=0&&await(function(a,o){const l=a.Pa.fe(o);
vendor: 8,271 bytes, lines 3542-3598
3542l.targetChanges.forEach(((d,h)=>{if(d.resumeToken.approximateByteSize()>0){const m=a._a.get(h);m&&a._a.set(h,m.withResumeToken(d.resumeToken,o))}})),l.targetMismatches.forEach(((d,h)=>{const m=a._a.get(d);if(!m)return;a._a.set(d,m.withResumeToken(Sr.EMPTY_BYTE_STRING,m.snapshotVersion)),Gz(a,d);const p=new vc(m.target,d,h,m.sequenceNumber);Hj(a,p)}));const c=(function(h,m){const p=new Map;m.targetChanges.forEach(((y,v)=>{const B=h.aa.get(v);B!==void 0&&p.set(B,y)}));let x=new br(Pt);return m.targetMismatches.forEach(((y,v)=>{const B=h.aa.get(y);B!==void 0&&(x=x.insert(B,v))})),new Og(m.snapshotVersion,p,x,m.documentUpdates,m.augmentedDocumentUpdates,m.resolvedLimboDocuments)})(a,l);return a.remoteSyncer.applyRemoteEvent(c)})(n,t)}catch(r){ze(Fc,"Failed to raise snapshot:",r),await oE(n,r)}}async function oE(n,e,t){if(!Wh(e))throw e;n.la.add(1),await Ug(n),n.Ta.set("Offline"),t||(t=()=>Oz(n.localStore)),n.asyncQueue.enqueueRetryable((async()=>{ze(Fc,"Retrying IndexedDB access"),await t(),n.la.delete(1),await mv(n)}))}function Hz(n,e){return e().catch((t=>oE(n,t,e)))}async function Vg(n){const e=st(n),t=Rh(e);let r=e.sa.length>0?e.sa[e.sa.length-1].batchId:xh;for(;Fue(e);)try{const s=await _ue(e.localStore,r);if(s===null){e.sa.length===0&&t.en();break}r=s.batchId,Uue(e,s)}catch(s){await oE(e,s)}zz(e)&&qz(e)}function Fue(n){return Yh(n)&&n.sa.length<10}function Uue(n,e){n.sa.push(e);const t=Rh(n);t.Yt()&&t.Rn&&t.An(e.mutations)}function zz(n){return Yh(n)&&!Rh(n).Jt()&&n.sa.length>0}function qz(n){Rh(n).start()}async function Vue(n){Rh(n).fn()}async function Gue(n){const e=Rh(n);for(const t of n.sa)e.An(t.mutations)}async function $ue(n,e,t){const r=n.sa.shift(),s=_j.from(r,e,t);await Hz(n,(()=>n.remoteSyncer.applySuccessfulWrite(s))),await Vg(n)}async function Hue(n,e){e&&Rh(n).Rn&&await(async function(r,s){if((function(o){return a7(o)&&o!==Te.ABORTED})(s.code)){const a=r.sa.shift();Rh(r).Xt(),await Hz(r,(()=>r.remoteSyncer.rejectFailedWrite(a.batchId,s))),await Vg(r)}})(n,e),zz(n)&&qz(n)}async function K4(n,e){const t=st(n);t.asyncQueue.verifyOperationInProgress(),ze(Fc,"RemoteStore received new credentials");const r=Yh(t);t.la.add(3),await Ug(t),r&&t.Ta.set("Unknown"),await t.remoteSyncer.handleCredentialChange(e),t.la.delete(3),await mv(t)}async function H_(n,e){const t=st(n);e?(t.la.delete(2),await mv(t)):e||(t.la.add(2),await Ug(t),t.Ta.set("Unknown"))}function Gg(n){return n.Ia||(n.Ia=(function(t,r,s){const a=st(t);return a.pn(),new Dle(r,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,s)})(n.datastore,n.asyncQueue,{ct:Pue.bind(null,n),Et:Lue.bind(null,n),Tt:Oue.bind(null,n),Tn:Mue.bind(null,n)}),n.Ea.push((async e=>{e?(n.Ia.Xt(),qj(n)?zj(n):n.Ta.set("Unknown")):(await n.Ia.stop(),$z(n))}))),n.Ia}function Rh(n){return n.Ra||(n.Ra=(function(t,r,s){const a=st(t);return a.pn(),new jle(r,a.connection,a.authCredentials,a.appCheckCredentials,a.serializer,s)})(n.datastore,n.asyncQueue,{ct:()=>Promise.resolve(),Et:Vue.bind(null,n),Tt:Hue.bind(null,n),Vn:Gue.bind(null,n),dn:$ue.bind(null,n)}),n.Ea.push((async e=>{e?(n.Ra.Xt(),await Vg(n)):(await n.Ra.stop(),n.sa.length>0&&(ze(Fc,`Stopping write stream with ${n.sa.length} pending writes`),n.sa=[]))}))),n.Ra}/**
3543 * @license
3544 * Copyright 2017 Google LLC
3545 *
3546 * Licensed under the Apache License, Version 2.0 (the "License");
3547 * you may not use this file except in compliance with the License.
3548 * You may obtain a copy of the License at
3549 *
3550 *   http://www.apache.org/licenses/LICENSE-2.0
3551 *
3552 * Unless required by applicable law or agreed to in writing, software
3553 * distributed under the License is distributed on an "AS IS" BASIS,
3554 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3555 * See the License for the specific language governing permissions and
3556 * limitations under the License.
3557 */class eS{constructor(e){this.observer=e,this.muted=!1}next(e){this.muted||this.observer.next&&this.Aa(this.observer.next,e)}error(e){this.muted||(this.observer.error?this.Aa(this.observer.error,e):Cs("Uncaught Error in snapshot listener:",e.toString()))}Va(){this.muted=!0}Aa(e,t){setTimeout((()=>{this.muted||e(t)}),0)}}/**
3558 * @license
3559 * Copyright 2017 Google LLC
3560 *
3561 * Licensed under the Apache License, Version 2.0 (the "License");
3562 * you may not use this file except in compliance with the License.
3563 * You may obtain a copy of the License at
3564 *
3565 *   http://www.apache.org/licenses/LICENSE-2.0
3566 *
3567 * Unless required by applicable law or agreed to in writing, software
3568 * distributed under the License is distributed on an "AS IS" BASIS,
3569 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3570 * See the License for the specific language governing permissions and
3571 * limitations under the License.
3572 */class Kj{constructor(e,t,r,s,a){this.asyncQueue=e,this.timerId=t,this.targetTimeMs=r,this.op=s,this.removalCallback=a,this.deferred=new ma,this.then=this.deferred.promise.then.bind(this.deferred.promise),this.deferred.promise.catch((o=>{}))}get promise(){return this.deferred.promise}static createAndSchedule(e,t,r,s,a){const o=Date.now()+r,l=new Kj(e,t,o,s,a);return l.start(r),l}start(e){this.timerHandle=setTimeout((()=>this.handleDelayElapsed()),e)}skipDelay(){return this.handleDelayElapsed()}cancel(e){this.timerHandle!==null&&(this.clearTimeout(),this.deferred.reject(new Fe(Te.CANCELLED,"Operation cancelled"+(e?": "+e:""))))}handleDelayElapsed(){this.asyncQueue.enqueueAndForget((()=>this.timerHandle!==null?(this.clearTimeout(),this.op().then((e=>this.deferred.resolve(e)))):Promise.resolve()))}clearTimeout(){this.timerHandle!==null&&(this.removalCallback(this),clearTimeout(this.timerHandle),this.timerHandle=null)}}function $g(n,e){if(Cs("AsyncQueue",`${e}: ${n}`),Wh(n))return new Fe(Te.UNAVAILABLE,`${e}: ${n}`);throw n}/**
3573 * @license
3574 * Copyright 2020 Google LLC
3575 *
3576 * Licensed under the Apache License, Version 2.0 (the "License");
3577 * you may not use this file except in compliance with the License.
3578 * You may obtain a copy of the License at
3579 *
3580 *   http://www.apache.org/licenses/LICENSE-2.0
3581 *
3582 * Unless required by applicable law or agreed to in writing, software
3583 * distributed under the License is distributed on an "AS IS" BASIS,
3584 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3585 * See the License for the specific language governing permissions and
3586 * limitations under the License.
3587 */class zue{constructor(e,t){this.da=e,this.serializer=t,this.metadata=new ma,this.buffer=new Uint8Array,this.fa=(function(){return new TextDecoder("utf-8")})(),this.ma().then((r=>{r&&r.Jo()?this.metadata.resolve(r.Ho.metadata):this.metadata.reject(new Error(`The first element of the bundle is not a metadata, it is
3588             ${JSON.stringify(r==null?void 0:r.Ho)}`))}),(r=>this.metadata.reject(r)))}close(){return this.da.cancel()}async getMetadata(){return this.metadata.promise}async pa(){return await this.getMetadata(),this.ma()}async ma(){const e=await this.ga();if(e===null)return null;const t=this.fa.decode(e),r=Number(t);isNaN(r)&&this.ya(`length string (${t}) is not valid number`);const s=await this.wa(r);return new Vz(JSON.parse(s),e.length+r)}ba(){return this.buffer.findIndex((e=>e===123))}async ga(){for(;this.ba()<0&&!await this.Sa(););if(this.buffer.length===0)return null;const e=this.ba();e<0&&this.ya("Reached the end of bundle when a length string is expected.");const t=this.buffer.slice(0,e);return this.buffer=this.buffer.slice(e),t}async wa(e){for(;this.buffer.length<e;)await this.Sa()&&this.ya("Reached the end of bundle when more is expected.");const t=this.fa.decode(this.buffer.slice(0,e));return this.buffer=this.buffer.slice(e),t}ya(e){throw this.da.cancel(),new Error(`Invalid bundle format: ${e}`)}async Sa(){const e=await this.da.read();if(!e.done){const t=new Uint8Array(this.buffer.length+e.value.length);t.set(this.buffer),t.set(e.value,this.buffer.length),this.buffer=t}return e.done}}/**
3589 * @license
3590 * Copyright 2025 Google LLC
3591 *
3592 * Licensed under the Apache License, Version 2.0 (the "License");
3593 * you may not use this file except in compliance with the License.
3594 * You may obtain a copy of the License at
3595 *
3596 *   http://www.apache.org/licenses/LICENSE-2.0
3597 *
3598 * Unless required by applicable law or agreed to in writing, softw
3598are
3599 * distributed under the License is distributed on an "AS IS" BASIS,
3600 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3601 * See the License for the specific language governing permissions and
3602 * limitations under the License.
3603 */class que{constructor(e,t){this.bundleData=e,this.serializer=t,this.cursor=0,this.elements=[];let r=this.pa();if(!r||!r.Jo())throw new Error(`The first element of the bundle is not a metadata object, it is
3604         ${JSON.stringify(r==null?void 0:r.Ho)}`);this.metadata=r;do r=this.pa(),r!==null&&this.elements.push(r);while(r!==null)}getMetadata(){return this.metadata}va(){return this.elements}pa(){if(this.cursor===this.bundleData.length)return null;const e=this.ga(),t=this.wa(e);return new Vz(JSON.parse(t),e)}wa(e){if(this.cursor+e>this.bundleData.length)throw new Fe(Te.INTERNAL,"Reached the end of bundle when more is expected.");return this.bundleData.slice(this.cursor,this.cursor+=e)}ga(){const e=this.cursor;let t=this.cursor;for(;t<this.bundleData.length;){if(this.bundleData[t]==="{"){if(t===e)throw new Error("First character is a bracket and not a number");return this.cursor=t,Number(this.bundleData.slice(e,t))}t++}throw new Error("Reached the end of bundle when more is expected.")}}const Vb="IndexBackfiller";class Kue{constructor(e,t){this.asyncQueue=e,this.Da=t,this.task=null}start(){this.xa(15e3)}stop(){this.task&&(this.task.cancel(),this.task=null)}get started(){return this.task!==null}xa(e){ze(Vb,`Scheduled in ${e}ms`),this.task=this.asyncQueue.enqueueAfterDelay("index_backfill",e,(async()=>{this.task=null;try{const t=await this.Da.Ca();ze(Vb,`Documents written: ${t}`)}catch(t){Wh(t)?ze(Vb,"Ignoring IndexedDB error during index backfill: ",t):await Kh(t)}await this.xa(6e4)}))}}class Wue{constructor(e,t){this.localStore=e,this.persistence=t}async Ca(e=50){return this.persistence.runTransaction("Backfill Indexes","readwrite-primary",(t=>this.Fa(t,e)))}Fa(e,t){const r=new Set;let s=t,a=!0;return ve.doWhile((()=>a===!0&&s>0),(()=>this.localStore.indexManager.getNextCollectionGroupToUpdate(e).next((o=>{if(o!==null&&!r.has(o))return ze(Vb,`Processing collection: ${o}`),this.Oa(e,o,s).next((l=>{s-=l,r.add(o)}));a=!1})))).next((()=>t-s))}Oa(e,t,r){return this.localStore.indexManager.getMinOffsetFromCollectionGroup(e,t).next((s=>this.localStore.localDocuments.getNextDocuments(e,t,s,r).next((a=>{const o=a.changes;return this.localStore.indexManager.updateIndexEntries(e,o).next((()=>this.Ma(s,a))).next((l=>(ze(Vb,`Updating offset: ${l}`),this.localStore.indexManager.updateCollectionGroup(e,t,l)))).next((()=>o.size))}))))}Ma(e,t){let r=e;
3604return t.changes.forEach(((s,a)=>{const o=e7(a);JD(o,r)>0&&(r=o)})),new Ao(r.readTime,r.documentKey,Math.max(t.batchId,e.largestBatchId))}}/**
3605 * @license
3606 * Copyright 2019 Google LLC
3607 *
3608 * Licensed under the Apache License, Version 2.0 (the "License");
3609 * you may not use this file except in compliance with the License.
3610 * You may obtain a copy of the License at
3611 *
3612 *   http://www.apache.org/licenses/LICENSE-2.0
3613 *
3614 * Unless required by applicable law or agreed to in writing, software
3615 * distributed under the License is distributed on an "AS IS" BASIS,
3616 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3617 * See the License for the specific language governing permissions and
3618 * limitations under the License.
3619 */const Kz="firestore_clients";function W4(n,e){return`${Kz}_${n}_${e}`}const Wz="firestore_mutations";function Y4(n,e,t){let r=`${Wz}_${n}_${t}`;return e.isAuthenticated()&&(r+=`_${e.uid}`),r}const Yz="firestore_targets";function Ik(n,e){return`${Yz}_${n}_${e}`}/**
3620 * @license
3621 * Copyright 2018 Google LLC
3622 *
3623 * Licensed under the Apache License, Version 2.0 (the "License");
3624 * you may not use this file except in compliance with the License.
3625 * You may obtain a copy of the License at
3626 *
3627 *   http://www.apache.org/licenses/LICENSE-2.0
3628 *
3629 * Unless required by applicable law or agreed to in writing, software
3630 * distributed under the License is distributed on an "AS IS" BASIS,
3631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3632 * See the License for the specific language governing permissions and
3633 * limitations under the License.
3634 */const fc="SharedClientState";class lE{constructor(e,t,r,s){this.user=e,this.batchId=t,this.state=r,this.error=s}static Na(e,t,r){const s=JSON.parse(r);let a,o=typeof s=="object"&&["pending","acknowledged","rejected"].indexOf(s.state)!==-1&&(s.error===void 0||typeof s.error=="object");return o&&s.error&&(o=typeof s.error.message=="string"&&typeof s.error.code=="string",o&&(a=new Fe(s.error.code,s.error.message))),o?new lE(e,t,s.state,a):(Cs(fc,`Failed to parse mutation state for ID '${t}': ${r}`),null)}La(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class Gb{constructor(e,t,r){this.targetId=e,this.state=t,this.error=r}static Na(e,t){const r=JSON.parse(t);let s,a=typeof r=="object"&&["not-current","current","rejected"].indexOf(r.state)!==-1&&(r.error===void 0||typeof r.error=="object");return a&&r.error&&(a=typeof r.error.message=="string"&&typeof r.error.code=="string",a&&(s=new Fe(r.error.code,r.error.message))),a?new Gb(e,r.state,s):(Cs(fc,`Failed to parse target state for ID '${e}': ${t}`),null)}La(){const e={state:this.state,updateTimeMs:Date.now()};return this.error&&(e.error={code:this.error.code,message:this.error.message}),JSON.stringify(e)}}class cE{constructor(e,t){this.clientId=e,this.activeTargetIds=t}static Na(e,t){const r=JSON.parse(t);let s=typeof r=="object"&&r.activeTargetIds instanceof Array,a=tj();for(let o=0;s&&o<r.activeTargetIds.length;++o)s=PH(r.activeTargetIds[o]),a=a.add(r.activeTargetIds[o]);return s?new cE(e,a):(Cs(fc,`Failed to parse client data for instance '${e}': ${t}`),null)}}class Wj{constructor(e,t){this.clientId=e,this.onlineState=t}static Na(e){const t=JSON.parse(e);return typeof t=="object"&&["Unknown","Online","Offline"].indexOf(t.onlineState)!==-1&&typeof t.clientId=="string"?new Wj(t.clientId,t.onlineState):(Cs(fc,`Failed to parse online state: ${e}`),null)}}class z_{constructor(){this.activeTargetIds=tj()}Ba(e){this.activeTargetIds=this.activeTargetIds.add(e)}Ua(e){this.activeTargetIds=this.activeTargetIds.delete(e)}La(){const e={activeTargetIds:this.activeTargetIds.toArray(),updateTimeMs:Date.now()};return JSON.stringify(e)}}class Dk{constructor(e,t,r,s,a){this.window=e,this.Ct=t,this.persistenceKey=r,this.ka=s,this.syncEngine=null,this.onlineStateHandler=null,this.sequenceNumberHandler=null,this.qa=this.$a.bind(this),this.Ka=new br(Pt),this.started=!1,this.Qa=[];const o=r.replace(/[.*+?^${}()|[\]\\]/g,"\\$&");this.storage=this.window.localStorage,this.currentUser=a,this.Wa=W4(this.persistenceKey,this.ka),this.Ga=(function(c){return`firestore_sequence_number_${c}`})(this.persistenceKey),this.Ka=this.Ka.insert(this.ka,new z_),this.za=new RegExp(`^${Kz}_${o}_([^_]*)$`),this.ja=new RegExp(`^${Wz}_${o}_(\\d+)(?:_(.*))?$`),this.Ha=new RegExp(`^${Yz}_${o}_(\\d+)$`),this.Ja=(function(c){return`firestore_online_state_${c}`})(this.persistenceKey),this.Ya=(function(c){return`firestore_bundle_loaded_v2_${c}`})(this.persistenceKey),this.window.addEventListener("storage",this.qa)}static Ye(e){return!(!e||!e.localStorage)}async start(){const e=await this.syncEngine.Ro();for(const r of e){if(r===this.ka)continue;const s=this.getItem(W4(this.persistenceKey,r));if(s){const a=cE.Na(r,s);a&&(this.Ka=this.Ka.insert(a.clientId,a))}}this.Za();const t=this.storage.getItem(this.Ja);if(t){const r=this.Xa(t);r&&this.eu(r)}for(const r of this.Qa)this.$a(r);this.Qa=[],this.window.addEventListener("pagehide",(()=>this.shutdown())),this.started=!0}writeSequenceNumber(e){this.setItem(this.Ga,JSON.stringify(e))}getAllActiveQueryTargets(){return this.tu(this.Ka)}isActiveQueryTarget(e){let t=!1;
vendor: 4,471 bytes, lines 3634-3638
3634return this.Ka.forEach(((r,s)=>{s.activeTargetIds.has(e)&&(t=!0)})),t}addPendingMutation(e){this.nu(e,"pending")}updateMutationState(e,t,r){this.nu(e,t,r),this.ru(e)}addLocalQueryTarget(e,t=!0){let r="not-current";if(this.isActiveQueryTarget(e)){const s=this.storage.getItem(Ik(this.persistenceKey,e));if(s){const a=Gb.Na(e,s);a&&(r=a.state)}}return t&&this.iu.Ba(e),this.Za(),r}removeLocalQueryTarget(e){this.iu.Ua(e),this.Za()}isLocalQueryTarget(e){return this.iu.activeTargetIds.has(e)}clearQueryState(e){this.removeItem(Ik(this.persistenceKey,e))}updateQueryState(e,t,r){this.su(e,t,r)}handleUserChange(e,t,r){t.forEach((s=>{this.ru(s)})),this.currentUser=e,r.forEach((s=>{this.addPendingMutation(s)}))}setOnlineState(e){this._u(e)}notifyBundleLoaded(e){this.ou(e)}shutdown(){this.started&&(this.window.removeEventListener("storage",this.qa),this.removeItem(this.Wa),this.started=!1)}getItem(e){const t=this.storage.getItem(e);return ze(fc,"READ",e,t),t}setItem(e,t){ze(fc,"SET",e,t),this.storage.setItem(e,t)}removeItem(e){ze(fc,"REMOVE",e),this.storage.removeItem(e)}$a(e){const t=e;if(t.storageArea===this.storage){if(ze(fc,"EVENT",t.key,t.newValue),t.key===this.Wa)return void Cs("Received WebStorage notification for local change. Another client might have garbage-collected our state");this.Ct.enqueueRetryable((async()=>{if(this.started){if(t.key!==null){if(this.za.test(t.key)){if(t.newValue==null){const r=this.au(t.key);return this.uu(r,null)}{const r=this.cu(t.key,t.newValue);if(r)return this.uu(r.clientId,r)}}else if(this.ja.test(t.key)){if(t.newValue!==null){const r=this.lu(t.key,t.newValue);if(r)return this.Eu(r)}}else if(this.Ha.test(t.key)){if(t.newValue!==null){const r=this.hu(t.key,t.newValue);if(r)return this.Tu(r)}}else if(t.key===this.Ja){if(t.newValue!==null){const r=this.Xa(t.newValue);if(r)return this.eu(r)}}else if(t.key===this.Ga){const r=(function(a){let o=Gi.wn;if(a!=null)try{const l=JSON.parse(a);Ke(typeof l=="number",30636,{Pu:a}),o=l}catch(l){Cs(fc,"Failed to read sequence number from WebStorage",l)}return o})(t.newValue);r!==Gi.wn&&this.sequenceNumberHandler(r)}else if(t.key===this.Ya){const r=this.Iu(t.newValue);await Promise.all(r.map((s=>this.syncEngine.Ru(s))))}}}else this.Qa.push(t)}))}}get iu(){return this.Ka.get(this.ka)}Za(){this.setItem(this.Wa,this.iu.La())}nu(e,t,r){const s=new lE(this.currentUser,e,t,r),a=Y4(this.persistenceKey,this.currentUser,e);this.setItem(a,s.La())}ru(e){const t=Y4(this.persistenceKey,this.currentUser,e);this.removeItem(t)}_u(e){const t={clientId:this.ka,onlineState:e};this.storage.setItem(this.Ja,JSON.stringify(t))}su(e,t,r){const s=Ik(this.persistenceKey,e),a=new Gb(e,t,r);this.setItem(s,a.La())}ou(e){const t=JSON.stringify(Array.from(e));this.setItem(this.Ya,t)}au(e){const t=this.za.exec(e);return t?t[1]:null}cu(e,t){const r=this.au(e);return cE.Na(r,t)}lu(e,t){const r=this.ja.exec(e),s=Number(r[1]),a=r[2]!==void 0?r[2]:null;return lE.Na(new ha(a),s,t)}hu(e,t){const r=this.Ha.exec(e),s=Number(r[1]);return Gb.Na(s,t)}Xa(e){return Wj.Na(e)}Iu(e){return JSON.parse(e)}async Eu(e){if(e.user.uid===this.currentUser.uid)return this.syncEngine.Au(e.batchId,e.state,e.error);ze(fc,`Ignoring mutation for non-active user ${e.user.uid}`)}Tu(e){return this.syncEngine.Vu(e.targetId,e.state,e.error)}uu(e,t){const r=t?this.Ka.insert(e,t):this.Ka.remove(e),s=this.tu(this.Ka),a=this.tu(r),o=[],l=[];return a.forEach((c=>{s.has(c)||o.push(c)})),s.forEach((c=>{a.has(c)||l.push(c)})),this.syncEngine.du(o,l).then((()=>{this.Ka=r}))}eu(e){this.Ka.get(e.clientId)&&this.onlineStateHandler(e.onlineState)}tu(e){let t=tj();return e.forEach(((r,s)=>{t=t.unionWith(s.activeTargetIds)})),t}}class Qz{constructor(){this.fu=new z_,this.mu={},this.onlineStateHandler=null,this.sequenceNumberHandler=null}addPendingMutation(e){}updateMutationState(e,t,r){}addLocalQueryTarget(e,t=!0){return t&&this.fu.Ba(e),this.mu[e]||"not-current"}updateQueryState(e,t,r){this.mu[e]=t}removeLocalQueryTarget(e){this.fu.Ua(e)}isLocalQueryTarget(e){return this.fu.activeTargetIds.has(e)}clearQueryState(e){delete this.mu[e]}getAllActiveQueryTargets(){return this.fu.activeTargetIds}isActiveQueryTarget(e){return this.fu.activeTargetIds.has(e)}start(){return this.fu=new z_,Promise.resolve()}handleUserChange(e,t,r){}setOnlineState(e){}shutdown(){}writeSequenceNumber(e){}notifyBundleLoaded(e){}}/**
3635 * @license
3636 * Copyright 2020 Google LLC
3637 *
3638 * Licensed under the Apache License, Version 2.0 (the "License");
3639 * you may not use this file except in compliance with the License.
3640 * You may obtain a copy of the License at
3641 *
3642 *   http://www.apache.org/licenses/LICENSE-2.0
3643 *
3644 * Unless required by applicable law or agreed to in writing, software
3645 * distributed under the License is distributed on an "AS IS" BASIS,
3646 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3647 * See the License for the specific language governing permissions and
3648 * limitations under the License.
3649 */function Jz(){return typeof window<"u"?window:null}function hC(){return typeof document<"u"?document:null}/**
3650 * @license
3651 * Copyright 2017 Google LLC
3652 *
3653 * Licensed under the Apache License, Version 2.0 (the "License");
3654 * you may not use this file except in compliance with the License.
3655 * You may obtain a copy of the License at
3656 *
3657 *   http://www.apache.org/licenses/LICENSE-2.0
3658 *
3659 * Unless required by applicable law or agreed to in writing, software
3660 * distributed under the License is distributed on an "AS IS" BASIS,
3661 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3662 * See the License for the specific language governing permissions and
3663 * limitations under the License.
3664 */class yh{static emptySet(e){return new yh(e.comparator)}constructor(e){this.comparator=e?(t,r)=>e(t,r)||Je.comparator(t.key,r.key):(t,r)=>Je.comparator(t.key,r.key),this.keyedMap=Gf(),this.sortedSet=new br(this.comparator)}has(e){return this.keyedMap.get(e)!=null}get(e){return this.keyedMap.get(e)}first(){return this.sortedSet.minKey()}last(){return this.sortedSet.maxKey()}isEmpty(){return this.sortedSet.isEmpty()}indexOf(e){const t=this.keyedMap.get(e);return t?this.sortedSet.indexOf(t):-1}get size(){return this.sortedSet.size}forEach(e){this.sortedSet.inorderTraversal(((t,r)=>(e(t),!1)))}add(e){const t=this.delete(e.key);return t.copy(t.keyedMap.insert(e.key,e),t.sortedSet.insert(e,null))}delete(e){const t=this.get(e);return t?this.copy(this.keyedMap.remove(e),this.sortedSet.remove(t)):this}isEqual(e){if(!(e instanceof yh)||this.size!==e.size)return!1;const t=this.sortedSet.getIterator(),r=e.sortedSet.getIterator();for(;t.hasNext();){const s=t.getNext().key,a=r.getNext().key;if(!s.isEqual(a))return!1}return!0}toString(){const e=[];return this.forEach((t=>{e.push(t.toString())})),e.length===0?"DocumentSet ()":`DocumentSet (
3665  `+e.join(`  
3666`)+`
3667)`}copy(e,t){const r=new yh;return r.comparator=this.comparator,r.keyedMap=e,r.sortedSet=t,r}}/**
3668 * @license
3669 * Copyright 2017 Google LLC
3670 *
3671 * Licensed under the Apache License, Version 2.0 (the "License");
3672 * you may not use this file except in compliance with the License.
3673 * You may obtain a copy of the License at
3674 *
3675 *   http://www.apache.org/licenses/LICENSE-2.0
3676 *
3677 * Unless required by applicable law or agreed to in writing, software
3678 * distributed under the License is distributed on an "AS IS" BASIS,
3679 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3680 * See the License for the specific language governing permissions and
3681 * limitations under the License.
3682 */class Q4{constructor(){this.pu=new br(Je.comparator)}track(e){const t=e.doc.key,r=this.pu.get(t);r?e.type!==0&&r.type===3?this.pu=this.pu.insert(t,e):e.type===3&&r.type!==1?this.pu=this.pu.insert(t,{type:r.type,doc:e.doc}):e.type===2&&r.type===2?this.pu=this.pu.insert(t,{type:2,doc:e.doc}):e.type===2&&r.type===0?this.pu=this.pu.insert(t,{type:0,doc:e.doc}):e.type===1&&r.type===0?this.pu=this.pu.remove(t):e.type===1&&r.type===2?this.pu=this.pu.insert(t,{type:1,doc:r.doc}):e.type===0&&r.type===1?this.pu=this.pu.insert(t,{type:2,doc:e.doc}):ot(63341,{we:e,gu:r}):this.pu=this.pu.insert(t,e)}yu(){const e=[];return this.pu.inorderTraversal(((t,r)=>{e.push(r)})),e}}class Im{constructor(e,t,r,s,a,o,l,c,d){this.query=e,this.docs=t,this.oldDocs=r,this.docChanges=s,this.mutatedKeys=a,this.fromCache=o,this.syncStateChanged=l,this.excludesMetadataChanges=c,this.hasCachedResults=d}static fromInitialDocuments(e,t,r,s,a){const o=[];return t.forEach((l=>{o.push({type:0,doc:l})})),new Im(e,t,yh.emptySet(t),o,r,s,!0,!1,a)}get hasPendingWrites(){return!this.mutatedKeys.isEmpty()}isEqual(e){if(!(this.fromCache===e.fromCache&&this.hasCachedResults===e.hasCachedResults&&this.syncStateChanged===e.syncStateChanged&&this.mutatedKeys.isEqual(e.mutatedKeys)&&$1(this.query,e.query)&&this.docs.isEqual(e.docs)&&this.oldDocs.isEqual(e.oldDocs)))return!1;const t=this.docChanges,r=e.docChanges;if(t.length!==r.length)return!1;for(let s=0;s<t.length;s++)if(t[s].type!==r[s].type||!t[s].doc.isEqual(r[s].doc))return!1;return!0}}/**
3683 * @license
3684 * Copyright 2017 Google LLC
3685 *
3686 * Licensed under the Apache License, Version 2.0 (the "License");
3687 * you may not use this file except in compliance with the License.
3688 * You may obtain a copy of the License at
3689 *
3690 *   http://www.apache.org/licenses/LICENSE-2.0
3691 *
3692 * Unless required by applicable law or agreed to in writing, software
3693 * distributed under the License is distributed on an "AS IS" BASIS,
3694 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3695 * See the License for the specific language governing permissions and
3696 * limitations under the License.
3697 */class Yue{constructor(){this.wu=void 0,this.bu=[]}Su(){return this.bu.some((e=>e.vu()))}}class Que{constructor(){this.queries=J4(),this.onlineState="Unknown",this.Du=new Set}terminate(){(function(t,r){const s=st(t),a=s.queries;s.queries=J4(),a.forEach(((o,l)=>{for(const c of l.bu)c.onError(r)}))})(this,new Fe(Te.ABORTED,"Firestore shutting down"))}}function J4(){return new ru((n=>dz(n)),$1)}async function Yj(n,e){const t=st(n);let r=3;const s=e.query;let a=t.queries.get(s);a?!a.Su()&&e.vu()&&(r=2):(a=new Yue,r=e.vu()?0:1);try{switch(r){case 0:a.wu=await t.onListen(s,!0);break;case 1:a.wu=await t.onListen(s,!1);break;case 2:await t.onFirstRemoteStoreListen(s)}}catch(o){const l=$g(o,`Initialization of query '${Xr(e.query)?Od(e.query):jb(e.query)}' failed`);return void e.onError(l)}t.queries.set(s,a),a.bu.push(e),e.xu(t.onlineState),a.wu&&e.Cu(a.wu)&&Jj(t)}async function Qj(n,e){const t=st(n),r=e.query;let s=3;const a=t.queries.get(r);if(a){const o=a.bu.indexOf(e);o>=0&&(a.bu.splice(o,1),a.bu.length===0?s=e.vu()?0:1:!a.Su()&&e.vu()&&(s=2))}switch(s){case 0:return t.queries.delete(r),t.onUnlisten(r,!0);case 1:return t.queries.delete(r),t.onUnlisten(r,!1);case 2:return t.onLastRemoteStoreUnlisten(r);default:return}}function Jue(n,e){const t=st(n);let r=!1;for(const s of e){const a=s.query,o=t.queries.get(a);if(o){for(const l of o.bu)l.Cu(s)&&(r=!0);o.wu=s}}r&&Jj(t)}function Xue(n,e,t){const r=st(n),s=r.queries.get(e);if(s)for(const a of s.bu)a.onError(t);r.queries.delete(e)}function Jj(n){n.Du.forEach((e=>{e.next()}))}var q_;(function(n){n.Default="default",n.Cache="cache"})(q_||(q_={}));class Xj{constructor(e,t,r){this.query=e,this.Fu=t,this.Ou=!1,this.Mu=null,this.onlineState="Unknown",this.options=r||{}}Cu(e){if(!this.options.includeMetadataChanges){const r=[];for(const s of e.docChanges)s.type!==3&&r.push(s);e=new Im(e.query,e.docs,e.oldDocs,r,e.mutatedKeys,e.fromCache,e.syncStateChanged,!0,e.hasCachedResults)}let t=!1;return this.Ou?this.Nu(e)&&(this.Fu.next(e),t=!0):this.Lu(e,this.onlineState)&&(this.Bu(e),t=!0),this.Mu=e,t}onError(e){this.Fu.error(e)}xu(e){this.onlineState=e;let t=!1;return this.Mu&&!this.Ou&&this.Lu(this.Mu,e)&&(this.Bu(this.Mu),t=!0),t}Lu(e,t){if(!e.fromCache||!this.vu())return!0;const r=t!=="Offline";return(!this.options.waitForSyncWhenOnline||!r)&&(!e.docs.isEmpty()||e.hasCachedResults||t==="Offline")}Nu(e){if(e.docChanges.length>0)return!0;const t=this.Mu&&this.Mu.hasPendingWrites!==e.hasPendingWrites;return!(!e.syncStateChanged&&!t)&&this.options.includeMetadataChanges===!0}Bu(e){e=Im.fromInitialDocuments(e.query,e.docs,e.mutatedKeys,e.fromCache,e.hasCachedResults),this.Ou=!0,this.Fu.next(e)}vu(){return this.options.source!==q_.Cache}}/**
3698 * @license
3699 * Copyright 2020 Google LLC
3700 *
3701 * Licensed under the Apache License, Version 2.0 (the "License");
3702 * you may not use this file except in compliance with the License.
3703 * You may obtain a copy of the License at
3704 *
3705 *   http://www.apache.org/licenses/LICENSE-2.0
3706 *
3707 * Unless required by applicable law or agreed to in writing, software
3708 * distributed under the License is distributed on an "AS IS" BASIS,
3709 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3710 * See the License for the specific language governing permissions and
3711 * limitations under the License.
3712 */class X4{constructor(e){this.serializer=e}Go(e){return Dc(this.serializer,e)}zo(e){return e.metadata.exists?P1(this.serializer,e.document,!1):Pr.newNoDocument(this.Go(e.metadata.name),this.jo(e.metadata.readTime))}jo(e){return Ss(e)}}class Zj{constructor(e,t){this.Uu=e,this.serializer=t,this.ku=[],this.qu=[],this.collectionGroups=new Set,this.progress=Xz(e)}get queries(){return this.ku}get documents(){return this.qu}$u(e){this.progress.bytesLoaded+=e.byteLength;let t=this.progress.documentsLoaded;if(e.Ho.namedQuery)this.ku.push(e.Ho.namedQuery);else if(e.Ho.documentMetadata){this.qu.push({metadata:e.Ho.documentMetadata}),e.Ho.documentMetadata.exists||++t;const r=zt.fromString(e.Ho.documentMetadata.name);this.collectionGroups.add(r.get(r.length-2))}else e.Ho.document&&(this.qu[this.qu.length-1].document=e.Ho.document,++t);return t!==this.progress.documentsLoaded?(this.progress.documentsLoaded=t,{...this.progress}):null}Ku(e){const t=new Map,r=new X4(this.serializer);for(const s of e)if(s.metadata.queries){const a=r.Go(s.metadata.name);for(const o of s.metadata.queries){const l=(t.get(o)||Ft()).add(a);t.set(o,l)}}return t}async Qu(e){const t=await Iue(e,new X4(this.serializer),this.qu,this.Uu.id),r=this.Ku(this.documents);for(const s of this.ku)await Due(e,s,r.get(s.name));return this.progress.taskState="Success",{progress:this.progress,Wu:this.collectionGroups,Gu:t}}}function Xz(n){return{taskState:"Running",documentsLoaded:0,bytesLoaded:0,totalDocuments:n.totalDocuments,totalBytes:n.totalBytes}}/**
3713 * @license
3714 * Copyright 2017 Google LLC
3715 *
3716 * Licensed under the Apache License, Version 2.0 (the "License");
3717 * you may not use this file except in compliance with the License.
3718 * You may obtain a copy of the License at
3719 *
3720 *   http://www.apache.org/licenses/LICENSE-2.0
3721 *
3722 * Unless required by applicable law or agreed to in writing, software
3723 * distributed under the License is distributed on an "AS IS" BASIS,
3724 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3725 * See the License for the specific language governing permissions and
3726 * limitations under the License.
3727 */class Zz{constructor(e){this.key=e}}class eq{constructor(e){this.key=e}}class tq{constructor(e,t){this.query=e,this.zu=t,this.ju=null,this.hasCachedResults=!1,this.current=!1,this.Hu=Ft(),this.mutatedKeys=Ft(),this.Ju=Xr(e)?sE(e):R1(e),this.Yu=new yh(this.Ju)}get Zu(){return this.zu}Xu(e,t){const r=t?t.ec:new Q4,s=t?t.Yu:this.Yu;let a=t?t.mutatedKeys:this.mutatedKeys,o=s,l=!1;const[c,d]=this.tc(this.query,s);e.inorderTraversal(((m,p)=>{const x=s.get(m),y=Nz(this.query,p)?p:null,v=!!x&&this.mutatedKeys.has(x.key),B=!!y&&(y.hasLocalMutations||this.mutatedKeys.has(y.key)&&y.hasCommittedMutations);let E=!1;x&&y?x.data.isEqual(y.data)?v!==B&&(r.track({type:3,doc:y}),E=!0):this.nc(x,y)||(r.track({type:2,doc:y}),E=!0,(c&&this.Ju(y,c)>0||d&&this.Ju(y,d)<0)&&(l=!0)):!x&&y?(r.track({type:0,doc:y}),E=!0):x&&!y&&(r.track({type:1,doc:x}),E=!0,(c||d)&&(l=!0)),E&&(y?(o=o.add(y),a=B?a.add(m):a.delete(m)):(o=o.delete(m),a=a.delete(m)))}));const h=this.rc(this.query);if(h)if(Xr(this.query)){const m=[];o.forEach((y=>m.push(y)));const p=kz(this.query,m);let x=new yh(sE(this.query));for(const y of p)x=x.add(y);o.forEach((y=>{x.has(y.key)||(a=a.delete(y.key),r.track({type:1,doc:y}))})),o=x}else{const m=this.sc(this.query);for(;o.size>h;){const p=m==="F"?o.last():o.first();o=o.delete(p.key),a=a.delete(p.key),r.track({type:1,doc:p})}}return{Yu:o,ec:r,Oo:l,mutatedKeys:a}}rc(e){var t;return Xr(e)?(t=Ak(e))==null?void 0:t.limit:e.limit||void 0}sc(e){if(Xr(e)){const t=Ak(e);return t&&t.limit<0?"L":"F"}return e.limitType}tc(e,t){var r;if(Xr(e)){const s=(r=Ak(e))==null?void 0:r.limit;return[t.size===s?t.last():null,null]}return[e.limitType==="F"&&t.size===this.rc(this.query)?t.last():null,e.limitType==="L"&&t.size===this.rc(this.query)?t.first():null]}nc(e,t){return e.hasLocalMutations&&t.hasCommittedMutations&&!t.hasLocalMutations}applyChanges(e,t,r,s){const a=this.Yu;this.Yu=e.Yu,this.mutatedKeys=e.mutatedKeys;const o=e.ec.yu();o.sort(((h,m)=>(function(x,y){const v=B=>{switch(B){case 0:return 1;case 2:case 3:return 2;case 1:return 0;default:return ot(20277,{we:B})}};return v(x)-v(y)})(h.type,m.type)||this.Ju(h.doc,m.doc))),this._c(r),s=s??!1;const l=t&&!s?this.oc():[],c=this.Hu.size===0&&this.current&&!s?1:0,d=c!==this.ju;return this.ju=c,o.length!==0||d?{snapshot:new Im(this.query,e.Yu,a,o,e.mutatedKeys,c===0,d,!1,!!r&&r.resumeToken.approximateByteSize()>0),ac:l}:{ac:l}}xu(e){return this.current&&e==="Offline"?(this.current=!1,this.applyChanges({Yu:this.Yu,ec:new Q4,mutatedKeys:this.mutatedKeys,Oo:!1},!1)):{ac:[]}}uc(e){return!this.zu.has(e)&&!!this.Yu.has(e)&&!this.Yu.get(e).hasLocalMutations}_c(e){e&&(e.addedDocuments.forEach((t=>this.zu=this.zu.add(t))),e.modifiedDocuments.forEach((t=>{})),e.removedDocuments.forEach((t=>this.zu=this.zu.delete(t))),this.current=e.current)}oc(){if(!this.current)return[];const e=this.Hu;
3727this.Hu=Ft(),this.Yu.forEach((r=>{this.uc(r.key)&&(this.Hu=this.Hu.add(r.key))}));const t=[];return e.forEach((r=>{this.Hu.has(r)||t.push(new eq(r))})),this.Hu.forEach((r=>{e.has(r)||t.push(new Zz(r))})),t}cc(e){this.zu=e.Wo,this.Hu=Ft();const t=this.Xu(e.documents);return this.applyChanges(t,!0)}lc(){return Im.fromInitialDocuments(this.query,this.Yu,this.mutatedKeys,this.ju===0,this.hasCachedResults)}}const Qh="SyncEngine";class Zue{constructor(e,t,r){this.query=e,this.targetId=t,this.view=r}}class ehe{constructor(e){this.key=e,this.Ec=!1}}class the{constructor(e,t,r,s,a,o){this.localStore=e,this.remoteStore=t,this.eventManager=r,this.sharedClientState=s,this.currentUser=a,this.maxConcurrentLimboResolutions=o,this.hc={},this.Tc=new ru((l=>dz(l)),$1),this.Pc=new Map,this.Ic=new Set,this.Rc=new br(Je.comparator),this.Ac=new Map,this.Vc=new Mj,this.dc={},this.fc=new Map,this.mc=qd.bs(),this.onlineState="Unknown",this.gc=void 0}get isPrimaryClient(){return this.gc===!0}}async function nhe(n,e,t=!0){const r=tS(n);let s;const a=r.Tc.get(e);return a?(r.sharedClientState.addLocalQueryTarget(a.targetId),s=a.view.lc()):s=await nq(r,e,t,!0),s}async function rhe(n,e){const t=tS(n);await nq(t,e,!0,!1)}async function nq(n,e,t,r){const s=await lg(n.localStore,Xr(e)?e:Wa(e)),a=s.targetId,o=n.sharedClientState.addLocalQueryTarget(a,t);let l;return r&&(l=await e2(n,e,a,o==="current",s.resumeToken)),n.isPrimaryClient&&t&&Z1(n.remoteStore,s),l}async function e2(n,e,t,r,s){n.yc=(m,p,x)=>(async function(v,B,E,N){let T=B.view.Xu(E);T.Oo&&(T=await iE(v.localStore,B.query,!1).then((({documents:_})=>B.view.Xu(_,T))));const k=N&&N.targetChanges.get(B.targetId),P=N&&N.targetMismatches.get(B.targetId)!=null,R=B.view.applyChanges(T,v.isPrimaryClient,k,P);return K_(v,B.targetId,R.ac),R.snapshot})(n,m,p,x);const a=await iE(n.localStore,e,!0),o=new tq(e,a.Wo),l=o.Xu(a.documents),c=av.createSynthesizedTargetChangeForCurrentChange(t,r&&n.onlineState!=="Offline",s),d=o.applyChanges(l,n.isPrimaryClient,c);K_(n,t,d.ac);const h=new Zue(e,t,o);return n.Tc.set(e,h),n.Pc.has(t)?n.Pc.get(t).push(e):n.Pc.set(t,[e]),d.snapshot}async function she(n,e,t){const r=st(n),s=r.Tc.get(e),a=r.Pc.get(s.targetId);if(a.length>1)return r.Pc.set(s.targetId,a.filter((o=>!$1(o,e)))),void r.Tc.delete(e);r.isPrimaryClient?(r.sharedClientState.removeLocalQueryTarget(s.targetId),r.sharedCl
3727ientState.isActiveQueryTarget(s.targetId)||await cg(r.localStore,s.targetId,!1).then((()=>{r.sharedClientState.clearQueryState(s.targetId),t&&dg(r.remoteStore,s.targetId),ug(r,s.targetId)})).catch(Kh)):(ug(r,s.targetId),await cg(r.localStore,s.targetId,!0))}async function ahe(n,e){const t=st(n),r=t.Tc.get(e),s=t.Pc.get(r.targetId);t.isPrimaryClient&&s.length===1&&(t.sharedClientState.removeLocalQueryTarget(r.targetId),dg(t.remoteStore,r.targetId))}async function ihe(n,e,t){const r=s2(n);try{const s=await(function(o,l){const c=st(o),d=bn.now(),h=l.reduce(((x,y)=>x.add(y.key)),Ft());let m,p;return c.persistence.runTransaction("Locally write mutations","readwrite",(x=>{let y=Os(),v=Ft();return c.ko.getEntries(x,h).next((B=>{y=B,y.forEach(((E,N)=>{N.isValidDocument()||(v=v.add(E))}))})).next((()=>c.localDocuments.getOverlayedDocuments(x,y))).next((B=>{m=B;const E=[];for(const N of l){const T=Foe(N,m.get(N.key).overlayedDocument);T!=null&&E.push(new tu(N.key,T,FH(T.value.mapValue),zr.exists(!0)))}return c.mutationQueue.addMutationBatch(x,d,E,l)})).next((B=>{p=B;const E=B.applyToLocalDocumentSet(m,v);return c.documentOverlayCache.saveOverlays(x,B.batchId,E)}))})).then((()=>({batchId:p.batchId,changes:l7(m)})))})(r.localStore,e);r.sharedClientState.addPendingMutation(s.batchId),(function(o,l,c){let d=o.dc[o.currentUser.toKey()];d||(d=new br(Pt)),d=d.insert(l,c),o.dc[o.currentUser.toKey()]=d})(r,s.batchId,t),await su(r,s.changes),await Vg(r.remoteStore)}catch(s){const a=$g(s,"Failed to persist write");t.reject(a)}}async function rq(n,e){const t=st(n);try{const r=await Nue(t.localStore,e);
3727e.targetChanges.forEach(((s,a)=>{const o=t.Ac.get(a);o&&(Ke(s.addedDocuments.size+s.modifiedDocuments.size+s.removedDocuments.size<=1,22616),s.addedDocuments.size>0?o.Ec=!0:s.modifiedDocuments.size>0?Ke(o.Ec,14607):s.removedDocuments.size>0&&(Ke(o.Ec,42227),o.Ec=!1))})),await su(t,r,e)}catch(r){await Kh(r)}}function Z4(n,e,t){const r=st(n);if(r.isPrimaryClient&&t===0||!r.isPrimaryClient&&t===1){const s=[];r.Tc.forEach(((a,o)=>{const l=o.view.xu(e);l.snapshot&&s.push(l.snapshot)})),(function(o,l){const c=st(o);c.onlineState=l;let d=!1;c.queries.forEach(((h,m)=>{for(const p of m.bu)p.xu(l)&&(d=!0)})),d&&Jj(c)})(r.eventManager,e),s.length&&r.hc.Tn(s),r.onlineState=e,r.isPrimaryClient&&r.sharedClientState.setOnlineState(e)}}async function ohe(n,e,t){const r=st(n);r.sharedClientState.updateQueryState(e,"rejected",t);const s=r.Ac.get(e),a=s&&s.key;if(a){let o=new br(Je.comparator);o=o.insert(a,Pr.newNoDocument(a,wt.min()));const l=Ft().add(a),c=new Og(wt.min(),new Map,new br(Pt),o,Os(),l);await rq(r,c),r.Rc=r.Rc.remove(a),r.Ac.delete(e),r2(r)}else await cg(r.localStore,e,!1).then((()=>ug(r,e,t))).catch(Kh)}async function lhe(n,e){const t=st(n),r=e.batch.batchId;try{const s=await kue(t.localStore,e);n2(t,r,null),t2(t,r),t.sharedClientState.updateMutationState(r,"acknowledged"),await su(t,s)}catch(s){await Kh(s)}}async function che(n,e,t){const r=st(n);try{const s=await(function(o,l){const c=st(o);return c.persistence.runTransaction("Reject batch","readwrite-primary",(d=>{let h;return c.mutationQueue.lookupMutationBatch(d,l).next((m=>
vendor: 2,556 bytes, line 3727
3727(Ke(m!==null,37113),h=m.keys(),c.mutationQueue.removeMutationBatch(d,m)))).next((()=>c.mutationQueue.performConsistencyCheck(d))).next((()=>c.documentOverlayCache.removeOverlaysForBatchId(d,h,l))).next((()=>c.localDocuments.recalculateAndSaveOverlaysForDocumentKeys(d,h))).next((()=>c.localDocuments.getDocuments(d,h)))}))})(r.localStore,e);n2(r,e,t),t2(r,e),r.sharedClientState.updateMutationState(e,"rejected",t),await su(r,s)}catch(s){await Kh(s)}}async function dhe(n,e){const t=st(n);Yh(t.remoteStore)||ze(Qh,"The network is disabled. The task returned by 'awaitPendingWrites()' will not complete until the network is enabled.");try{const r=await(function(o){const l=st(o);return l.persistence.runTransaction("Get highest unacknowledged batch id","readonly",(c=>l.mutationQueue.getHighestUnacknowledgedBatchId(c)))})(t.localStore);if(r===xh)return void e.resolve();const s=t.fc.get(r)||[];s.push(e),t.fc.set(r,s)}catch(r){const s=$g(r,"Initialization of waitForPendingWrites() operation failed");e.reject(s)}}function t2(n,e){(n.fc.get(e)||[]).forEach((t=>{t.resolve()})),n.fc.delete(e)}function n2(n,e,t){const r=st(n);let s=r.dc[r.currentUser.toKey()];if(s){const a=s.get(e);a&&(t?a.reject(t):a.resolve(),s=s.remove(e)),r.dc[r.currentUser.toKey()]=s}}function ug(n,e,t=null){n.sharedClientState.removeLocalQueryTarget(e);for(const r of n.Pc.get(e))n.Tc.delete(r),t&&n.hc.wc(r,t);n.Pc.delete(e),n.isPrimaryClient&&n.Vc.e_(e).forEach((r=>{n.Vc.containsKey(r)||sq(n,r)}))}function sq(n,e){n.Ic.delete(e.path.canonicalString());const t=n.Rc.get(e);t!==null&&(dg(n.remoteStore,t),n.Rc=n.Rc.remove(e),n.Ac.delete(t),r2(n))}function K_(n,e,t){for(const r of t)r instanceof Zz?(n.Vc.addReference(r.key,e),uhe(n,r)):r instanceof eq?(ze(Qh,"Document no longer in limbo: "+r.key),n.Vc.removeReference(r.key,e),n.Vc.containsKey(r.key)||sq(n,r.key)):ot(19791,{bc:r})}function uhe(n,e){const t=e.key,r=t.path.canonicalString();n.Rc.get(t)||n.Ic.has(r)||(ze(Qh,"New document in limbo: "+t),n.Ic.add(r),r2(n))}function r2(n){for(;n.Ic.size>0&&n.Rc.size<n.maxConcurrentLimboResolutions;){const e=n.Ic.values().next().value;n.Ic.delete(e);const t=new Je(zt.fromString(e)),r=n.mc.next();n.Ac.set(r,new ehe(t)),n.Rc=n.Rc.insert(t,r),Z1(n.remoteStore,new vc(Wa(Lg(t.path)),r,"TargetPurposeLimboResolution",Gi.wn))}}async function su(n,e,t){const r=st(n),s=[],a=[],o=[];r.Tc.isEmpty()||(r.Tc.forEach(((l,c)=>{o.push(r.yc(c,e,t).then((d=>{var h;if((d||t)&&r.isPrimaryClient){const m=d?!d.fromCache:(h=t==null?void 0:t.targetChanges.get(c.targetId))==null?void 0:h.current;
3727r.sharedClientState.updateQueryState(c.targetId,m?"current":"not-current")}if(d){s.push(d);const m=Gj.mo(c.targetId,d);a.push(m)}})))})),await Promise.all(o),r.hc.Tn(s),await(async function(c,d){const h=st(c);try{await h.persistence.runTransaction("notifyLocalViewChanges","readwrite",(m=>ve.forEach(d,(p=>ve.forEach(p.Vo,(x=>h.persistence.referenceDelegate.addReference(m,p.targetId,x))).next((()=>ve.forEach(p.fo,(x=>h.persistence.referenceDelegate.removeReference(m,p.targetId,x)))))))))}catch(m){if(!Wh(m))throw m;ze($j,"Failed to update sequence numbers: "+m)}for(const m of d){const p=m.targetId;if(!m.fromCache){const x=h.Lo.get(p),y=x.snapshotVersion,v=x.withLastLimboFreeSnapshotVersion(y);h.Lo=h.Lo.insert(p,v)}}})(r.localStore,a))}async function hhe(n,e){const t=st(n);if(!t.currentUser.isEqual(e)){ze(Qh,"User change. New user:",e.toKey());const r=await Lz(t.localStore,e);t.currentUser=e,(function(a,o){a.fc.forEach((l=>{l.forEach((c=>{c.reject(new Fe(Te.CANCELLED,o))}))})),a.fc.clear()})(t,"'waitForPendingWrites' promise is rejected due to a user change."),t.sharedClientState.handleUserChange(e,r.removedBatchIds,r.addedBatchIds),await su(t,r.$o)}}function fhe(n,e){const t=st(n),r=t.Ac.get(e);if(r&&r.Ec)return Ft().add(r.key);{let s=Ft();const a=t.Pc.get(e);if(!a)return s;for(const o of a??[]){const l=t.Tc.get(o);s=s.unionWith(l.view.Zu)}return s}}async function mhe(n,e){const t=st(n),r=await iE(t.localStore,e.query,!0),s=e.view.cc(r);return t.isPrimaryClient&&K_(t,e.targetId,s.ac),s}async function phe(n,e){const t=st(n);return G_(t.localStore,e).then((r=>su(t,r)))}async function ghe(n,e,t,r){const s=st(n),a=await(function(l,c){const d=st(l),h=st(d.mutationQueue);return d.persistence.runTransaction("Lookup mutation documents","readonly",(m=>h.Wr(m,c).next((p=>p?d.localDocuments.getDocuments(m,p):ve.resolve(null)))))})(s.localStore,e);a!==null?(t==="pending"?await Vg(s.remoteStore):t==="acknowledged"||t==="rejected"?(n2(s,e,r||null),t2(s,e),(function(l,c){st(st(l).mutationQueue).Hr(c)})(s.localStore,e)):ot(6720,"Unknown batchState",{Sc:t}),await su(s,a)):ze(Qh,"Cannot apply mutation batch with id: "+e)}async function xhe(n,e){const t=st(n);if(tS(t),s2(t),e===!0&&t.gc!==!0){const r=t.sharedClientState.getAllActiveQueryTargets(),s=await eF(t,r.toArray());t.gc=!0,await H_(t.remoteStore,!0);for(const a of s)Z1(t.remoteStore,a)}else if(e===!1&&t.gc!==!1){const r=[];let s=Promise.resolve();t.Pc.forEach(((a,o)=>{t.sharedClientState.isLocalQueryTarget(o)?r.push(o):s=s.then((()=>(ug(t,o),cg(t.localStore,o,!0)))),dg(t.remoteStore,o)})),await s,await eF(t,r),(function(o){const l=st(o);l.Ac.forEach(((c,d)=>{dg(l.remoteStore,d)})),l.Vc.t_(),l.Ac=new Map,l.Rc=new br(Je.comparator)})(t),t.gc=!1,await H_(t.remoteStore,!1)}}async function eF(n,e,t){const r=st(n),s=[],a=[];for(const o of e){let l;const c=r.Pc.get(o);if(c&&c.length!==0){l=await lg(r.localStore,Xr(c[0])?c[0]:Wa(c[0]));for(const d of c){const h=r.Tc.get(d),m=await mhe(r,h);m.snapshot&&a.push(m.snapshot)}}else{const d=await Fz(r.localStore,o);l=await lg(r.localStore,d),await e2(r,aq(d),o,!1,l.resumeToken)}s.push(l)}return r.hc.Tn(a),s}function aq(n){return Ed(n)?n:t7(n.path,n.collectionGroup,n.orderBy,n.filters,n.limit,"F",n.startAt,n.endAt)}function bhe(n){return(function(t){return st(st(t).persistence).Ro()})(st(n).localStore)}async function yhe(n,e,t,r){const s=st(n);if(s.gc)return void ze(Qh,"Ignoring unexpected query state notification.");const a=s.Pc.get(e);if(a&&a.length>0)switch(t){case"current":case"not-current":{let o;if(Xr(a[0]))switch(Ld(a[0])){case"collection_group":case"collection":o=await G_(s.localStore,rz(a[0]));break;case"documents":o=await(function(d,h){const m=st(d),p=Ft(...QC(h).map((x=>Je.fromPath(x))));return m.persistence.runTransaction("Get documents for pipeline","readonly",(x=>m.ko.getEntries(x,p))).then((x=>x))})(s.localStore,a[0]);break;default:Xs(""),o=Gf()}else o=await G_(s.localStore,(function(d){return d.collectionGroup||(d.path.length%2==1?d.path.lastSegment():d.path.get(d.path.length-2))})(a[0]));const l=Og.createSynthesizedRemoteEventForCurrentChange(e,t==="current",Sr.EMPTY_BYTE_STRING);await su(s,o,l);break}case"rejected":await cg(s.localStore,e,!0),ug(s,e,r);break;default:ot(64155,t)}}async function vhe(n,e,t){const r=tS(n);
vendor: 4,304 bytes, line 3727
3727if(r.gc){for(const s of e){if(r.Pc.has(s)&&r.sharedClientState.isActiveQueryTarget(s)){ze(Qh,"Adding an already active target "+s);continue}const a=await Fz(r.localStore,s),o=await lg(r.localStore,a);await e2(r,aq(a),o.targetId,!1,o.resumeToken),Z1(r.remoteStore,o)}for(const s of t)r.Pc.has(s)&&await cg(r.localStore,s,!1).then((()=>{dg(r.remoteStore,s),ug(r,s)})).catch(Kh)}}function tS(n){const e=st(n);return e.remoteStore.remoteSyncer.applyRemoteEvent=rq.bind(null,e),e.remoteStore.remoteSyncer.getRemoteKeysForTarget=fhe.bind(null,e),e.remoteStore.remoteSyncer.rejectListen=ohe.bind(null,e),e.hc.Tn=Jue.bind(null,e.eventManager),e.hc.wc=Xue.bind(null,e.eventManager),e}function s2(n){const e=st(n);return e.remoteStore.remoteSyncer.applySuccessfulWrite=lhe.bind(null,e),e.remoteStore.remoteSyncer.rejectFailedWrite=che.bind(null,e),e}function Bhe(n,e,t){const r=st(n);(async function(a,o,l){try{const c=await o.getMetadata();if(await(function(x,y){const v=st(x),B=Ss(y.createTime);return v.persistence.runTransaction("hasNewerBundle","readonly",(E=>v.f_.getBundleMetadata(E,y.id))).then((E=>!!E&&E.createTime.compareTo(B)>=0))})(a.localStore,c))return await o.close(),l._completeWith((function(x){return{taskState:"Success",documentsLoaded:x.totalDocuments,bytesLoaded:x.totalBytes,totalDocuments:x.totalDocuments,totalBytes:x.totalBytes}})(c)),Promise.resolve(new Set);l._updateProgress(Xz(c));const d=new Zj(c,o.serializer);let h=await o.pa();for(;h;){const p=await d.$u(h);p&&l._updateProgress(p),h=await o.pa()}const m=await d.Qu(a.localStore);return await su(a,m.Gu,void 0),await(function(x,y){const v=st(x);return v.persistence.runTransaction("Save bundle","readwrite",(B=>v.f_.saveBundleMetadata(B,y)))})(a.localStore,c),l._completeWith(m.progress),Promise.resolve(m.Wu)}catch(c){return Xs(Qh,`Loading bundle failed with ${c}`),l._failWith(c),Promise.resolve(new Set)}})(r,e,t).then((s=>{r.sharedClientState.notifyBundleLoaded(s)}))}class hg{constructor(){this.kind="memory",this.synchronizeTabs=!1}async initialize(e){this.serializer=qm(e.databaseInfo.databaseId),this.sharedClientState=this.vc(e),this.persistence=this.Dc(e),await this.persistence.start(),this.localStore=this.xc(e),this.gcScheduler=this.Cc(e,this.localStore),this.indexBackfillerScheduler=this.Fc(e,this.localStore)}Cc(e,t){return null}Fc(e,t){return null}xc(e){return Pz(this.persistence,new Rz,e.initialUser,this.serializer)}Dc(e){return new Fj(X1.b_,this.serializer)}vc(e){return new Qz}async terminate(){var e,t;(e=this.gcScheduler)==null||e.stop(),(t=this.indexBackfillerScheduler)==null||t.stop(),this.sharedClientState.shutdown(),await this.persistence.shutdown()}}hg.provider={build:()=>new hg};class a2 extends hg{constructor(e){super(),this.cacheSizeBytes=e}Cc(e,t){Ke(this.persistence.referenceDelegate instanceof aE,46915);const r=this.persistence.referenceDelegate.garbageCollector;return new O7(r,e.asyncQueue,t)}Dc(e){const t=this.cacheSizeBytes!==void 0?Ha.withCacheSize(this.cacheSizeBytes):Ha.DEFAULT;return new Fj((r=>aE.b_(r,t)),this.serializer)}}class i2 extends hg{constructor(e,t,r){super(),this.Oc=e,this.cacheSizeBytes=t,this.forceOwnership=r,this.kind="persistent",this.synchronizeTabs=!1}async initialize(e){await super.initialize(e),await this.Oc.initialize(this,e),await s2(this.Oc.syncEngine),await Vg(this.Oc.remoteStore),await this.persistence.eo((()=>(this.gcScheduler&&!this.gcScheduler.started&&this.gcScheduler.start(),this.indexBackfillerScheduler&&!this.indexBackfillerScheduler.started&&this.indexBackfillerScheduler.start(),Promise.resolve())))}xc(e){return Pz(this.persistence,new Rz,e.initialUser,this.serializer)}Cc(e,t){const r=this.persistence.referenceDelegate.garbageCollector;return new O7(r,e.asyncQueue,t)}Fc(e,t){const r=new Wue(t,this.persistence);return new Kue(e.asyncQueue,r)}Dc(e){const t=Vj(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey),r=this.cacheSizeBytes!==void 0?Ha.withCacheSize(this.cacheSizeBytes):Ha.DEFAULT;return new Uj(this.synchronizeTabs,t,e.clientId,r,e.asyncQueue,Jz(),hC(),this.serializer,this.sharedClientState,!!this.forceOwnership)}vc(e){return new Qz}}class iq extends i2{constructor(e,t){super(e,t,!1),this.Oc=e,this.cacheSizeBytes=t,this.synchronizeTabs=!0}async initialize(e){await super.initialize(e);const t=this.Oc.syncEngine;
3727this.sharedClientState instanceof Dk&&(this.sharedClientState.syncEngine={Au:ghe.bind(null,t),Vu:yhe.bind(null,t),du:vhe.bind(null,t),Ro:bhe.bind(null,t),Ru:phe.bind(null,t)},await this.sharedClientState.start()),await this.persistence.eo((async r=>{await xhe(this.Oc.syncEngine,r),this.gcScheduler&&(r&&!this.gcScheduler.started?this.gcScheduler.start():r||this.gcScheduler.stop()),this.indexBackfillerScheduler&&(r&&!this.indexBackfillerScheduler.started?this.indexBackfillerScheduler.start():r||this.indexBackfillerScheduler.stop())}))}vc(e){const t=Jz();if(!Dk.Ye(t))throw new Fe(Te.UNIMPLEMENTED,"IndexedDB persistence is only available on platforms that support LocalStorage.");const r=Vj(e.databaseInfo.databaseId,e.databaseInfo.persistenceKey);return new Dk(t,e.asyncQueue,r,e.clientId,e.initialUser)}}class Ph{async initialize(e,t){this.localStore||(this.localStore=e.localStore,this.sharedClientState=e.sharedClientState,this.datastore=this.createDatastore(t),this.remoteStore=this.createRemoteStore(t),this.eventManager=this.createEventManager(t),this.syncEngine=this.createSyncEngine(t,!e.synchronizeTabs),this.sharedClientState.onlineStateHandler=r=>Z4(this.syncEngine,r,1),this.remoteStore.remoteSyncer.handleCredentialChange=hhe.bind(null,this.syncEngine),await H_(this.remoteStore,this.syncEngine.isPrimaryClient))}createEventManager(e){return(function(){return new Que})()}createDatastore(e){const t=qm(e.databaseInfo.databaseId),r=Ile(e.databaseInfo);return Lle(e.authCredentials,e.appCheckCredentials,r,t)}createRemoteStore(e){return(function(r,s,a,o,l){return new Rue(r,s,a,o,l)})(this.localStore,this.datastore,e.asyncQueue,(t=>Z4(this.syncEngine,t,0)),(function(){return m4.Ye()?new m4:new Ale})())}createSyncEngine(e,t){return(function(s,a,o,l,c,d,h){const m=new the(s,a,o,l,c,d);return h&&(m.gc=!0),m})(this.localStore,this.remoteStore,this.eventManager,this.sharedClientState,e.initialUser,e.maxConcurrentLimboResolutions,t)}async terminate(){var e,t;await(async function(s){const a=st(s);ze(Fc,"RemoteStore shutting down."),a.la.add(5),await Ug(a),a.ha.shutdown(),a.Ta.set("Unknown")})(this.remoteStore),(e=this.datastore)==null||e.terminate(),(t=this.eventManager)==null||t.terminate()}}Ph.provider={build:()=>new Ph};/**
3728 * @license
3729 * Copyright 2017 Google LLC
3730 *
3731 * Licensed under the Apache License, Version 2.0 (the "License");
3732 * you may not use this file except in compliance with the License.
3733 * You may obtain a copy of the License at
3734 *
3735 *   http://www.apache.org/licenses/LICENSE-2.0
3736 *
3737 * Unless required by applicable law or agreed to in writing, software
3738 * distributed under the License is distributed on an "AS IS" BASIS,
3739 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3740 * See the License for the specific language governing permissions and
3741 * limitations under the License.
3742 */let whe=class{constructor(e){this.datastore=e,this.readVersions=new Map,this.mutations=[],this.committed=!1,this.lastTransactionError=null,this.writtenDocs=new Set}async lookup(e){if(this.ensureCommitNotCalled(),this.mutations.length>0)throw this.lastTransactionError=new Fe(Te.INVALID_ARGUMENT,"Firestore transactions require all reads to be executed before all writes."),this.lastTransactionError;const t=await(async function(s,a){const o=st(s),l={documents:a.map((m=>rg(o.serializer,m)))},c=await o._t("BatchGetDocuments",o.serializer.databaseId,zt.emptyPath(),l,a.length),d=new Map;c.forEach((m=>{const p=fle(o.serializer,m);d.set(p.key.toString(),p)}));const h=[];return a.forEach((m=>{const p=d.get(m.toString());Ke(!!p,55234,{key:m}),h.push(p)})),h})(this.datastore,e);return t.forEach((r=>this.recordVersion(r))),t}set(e,t){this.write(t.toMutation(e,this.precondition(e))),this.writtenDocs.add(e.toString())}update(e,t){try{this.write(t.toMutation(e,this.preconditionForUpdate(e)))}catch(r){this.lastTransactionError=r}this.writtenDocs.add(e.toString())}delete(e){this.write(new Pg(e,this.precondition(e))),this.writtenDocs.add(e.toString())}async commit(){if(this.ensureCommitNotCalled(),this.lastTransactionError)throw this.lastTransactionError;const e=this.readVersions;this.mutations.forEach((t=>{e.delete(t.key.toString())})),e.forEach(((t,r)=>{const s=Je.fromPath(r);
vendor: 5,630 bytes, lines 3742-3772
3742this.mutations.push(new YD(s,this.precondition(s)))})),await(async function(r,s){const a=st(r),o={writes:s.map((l=>iy(a.serializer,l)))};await a.nt("Commit",a.serializer.databaseId,zt.emptyPath(),o)})(this.datastore,this.mutations),this.committed=!0}recordVersion(e){let t;if(e.isFoundDocument())t=e.version;else{if(!e.isNoDocument())throw ot(50498,{Mc:e.constructor.name});t=wt.min()}const r=this.readVersions.get(e.key.toString());if(r){if(!t.isEqual(r))throw new Fe(Te.ABORTED,"Document version changed between two reads.")}else this.readVersions.set(e.key.toString(),t)}precondition(e){const t=this.readVersions.get(e.toString());return!this.writtenDocs.has(e.toString())&&t?t.isEqual(wt.min())?zr.exists(!1):zr.updateTime(t):zr.none()}preconditionForUpdate(e){const t=this.readVersions.get(e.toString());if(!this.writtenDocs.has(e.toString())&&t){if(t.isEqual(wt.min()))throw new Fe(Te.INVALID_ARGUMENT,"Can't update a document that doesn't exist.");return zr.updateTime(t)}return zr.exists(!0)}write(e){this.ensureCommitNotCalled(),this.mutations.push(e)}ensureCommitNotCalled(){}};/**
3743 * @license
3744 * Copyright 2019 Google LLC
3745 *
3746 * Licensed under the Apache License, Version 2.0 (the "License");
3747 * you may not use this file except in compliance with the License.
3748 * You may obtain a copy of the License at
3749 *
3750 *   http://www.apache.org/licenses/LICENSE-2.0
3751 *
3752 * Unless required by applicable law or agreed to in writing, software
3753 * distributed under the License is distributed on an "AS IS" BASIS,
3754 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3755 * See the License for the specific language governing permissions and
3756 * limitations under the License.
3757 */class Che{constructor(e,t,r,s,a){this.asyncQueue=e,this.datastore=t,this.options=r,this.updateFunction=s,this.deferred=a,this.Nc=r.maxAttempts,this.Ht=new aj(this.asyncQueue,"transaction_retry")}Lc(){this.Nc-=1,this.Bc()}Bc(){this.Ht.kt((async()=>{const e=new whe(this.datastore),t=this.Uc(e);t&&t.then((r=>{this.asyncQueue.enqueueAndForget((()=>e.commit().then((()=>{this.deferred.resolve(r)})).catch((s=>{this.kc(s)}))))})).catch((r=>{this.kc(r)}))}))}Uc(e){try{const t=this.updateFunction(e);return!sv(t)&&t.catch&&t.then?t:(this.deferred.reject(Error("Transaction callback must return a Promise")),null)}catch(t){return this.deferred.reject(t),null}}kc(e){this.Nc>0&&this.qc(e)?(this.Nc-=1,this.asyncQueue.enqueueAndForget((()=>(this.Bc(),Promise.resolve())))):this.deferred.reject(e)}qc(e){if((e==null?void 0:e.name)==="FirebaseError"){const t=e.code;return t==="aborted"||t==="failed-precondition"||t==="already-exists"||!a7(t)}return!1}}/**
3758 * @license
3759 * Copyright 2017 Google LLC
3760 *
3761 * Licensed under the Apache License, Version 2.0 (the "License");
3762 * you may not use this file except in compliance with the License.
3763 * You may obtain a copy of the License at
3764 *
3765 *   http://www.apache.org/licenses/LICENSE-2.0
3766 *
3767 * Unless required by applicable law or agreed to in writing, software
3768 * distributed under the License is distributed on an "AS IS" BASIS,
3769 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3770 * See the License for the specific language governing permissions and
3771 * limitations under the License.
3772 */const Lh="FirestoreClient";class Ehe{constructor(e,t,r,s,a){this.authCredentials=e,this.appCheckCredentials=t,this.asyncQueue=r,this._databaseInfo=s,this.user=ha.UNAUTHENTICATED,this.clientId=k1.newId(),this.authCredentialListener=()=>Promise.resolve(),this.appCheckCredentialListener=()=>Promise.resolve(),this._uninitializedComponentsProvider=a,this.authCredentials.start(r,(async o=>{ze(Lh,"Received user=",o.uid),await this.authCredentialListener(o),this.user=o})),this.appCheckCredentials.start(r,(o=>(ze(Lh,"Received new app check token=",o),this.appCheckCredentialListener(o,this.user))))}get configuration(){return{asyncQueue:this.asyncQueue,databaseInfo:this._databaseInfo,clientId:this.clientId,authCredentials:this.authCredentials,appCheckCredentials:this.appCheckCredentials,initialUser:this.user,maxConcurrentLimboResolutions:100}}setCredentialChangeListener(e){this.authCredentialListener=e}setAppCheckTokenChangeListener(e){this.appCheckCredentialListener=e}terminate(){this.asyncQueue.enterRestrictedMode();const e=new ma;return this.asyncQueue.enqueueAndForgetEvenWhileRestricted((async()=>{try{this._onlineComponents&&await this._onlineComponents.terminate(),this._offlineComponents&&await this._offlineComponents.terminate(),this.authCredentials.shutdown(),this.appCheckCredentials.shutdown(),e.resolve()}catch(t){const r=$g(t,"Failed to shutdown persistence");e.reject(r)}})),e.promise}}async function jk(n,e){n.asyncQueue.verifyOperationInProgress(),ze(Lh,"Initializing OfflineComponentProvider");const t=n.configuration;await e.initialize(t);let r=t.initialUser;n.setCredentialChangeListener((async s=>{r.isEqual(s)||(await Lz(e.localStore,s),r=s)})),e.persistence.setDatabaseDeletedListener((()=>n.terminate())),n._offlineComponents=e}async function tF(n,e){n.asyncQueue.verifyOperationInProgress();const t=await o2(n);ze(Lh,"Initializing OnlineComponentProvider"),await e.initialize(t,n.configuration),n.setCredentialChangeListener((r=>K4(e.remoteStore,r))),n.setAppCheckTokenChangeListener(((r,s)=>K4(e.remoteStore,s))),n._onlineComponents=e}async function o2(n){if(!n._offlineComponents)if(n._uninitializedComponentsProvider){ze(Lh,"Using user provided OfflineComponentProvider");try{await jk(n,n._uninitializedComponentsProvider._offline)}catch(e){const t=e;if(!(function(s){return s.name==="FirebaseError"?s.code===Te.FAILED_PRECONDITION||s.code===Te.UNIMPLEMENT
3772ED:!(typeof DOMException<"u"&&s instanceof DOMException)||s.code===22||s.code===20||s.code===11})(t))throw t;Xs("Error using user provided cache. Falling back to memory cache: "+t),await jk(n,new hg)}}else ze(Lh,"Using default OfflineComponentProvider"),await jk(n,new a2(void 0));return n._offlineComponents}async function nS(n){return n._onlineComponents||(n._uninitializedComponentsProvider?(ze(Lh,"Using user provided OnlineComponentProvider"),await tF(n,n._uninitializedComponentsProvider._online)):(ze(Lh,"Using default OnlineComponentProvider"),await tF(n,new Ph))),n._onlineComponents}function oq(n){return o2(n).then((e=>e.persistence))}function Hg(n){return o2(n).then((e=>e.localStore))}function lq(n){return nS(n).then((e=>e.remoteStore))}function l2(n){return nS(n).then((e=>e.syncEngine))}function cq(n){return nS(n).then((e=>e.datastore))}async function fg(n){const e=await nS(n),t=e.eventManager;return t.onListen=nhe.bind(null,e.syncEngine),t.onUnlisten=she.bind(null,e.syncEngine),t.onFirstRemoteStoreListen=rhe.bind(null,e.syncEngine),t.onLastRemoteStoreUnlisten=ahe.bind(null,e.syncEngine),t}function She(n){return n.asyncQueue.enqueue((async()=>{const e=await oq(n),t=await lq(n);return e.setNetworkEnabled(!0),(function(s){const a=st(s);return a.la.delete(0),mv(a)})(t)}))}function The(n){return n.asyncQueue.enqueue((async()=>{const e=await oq(n),t=await lq(n);return e.setNetworkEnabled(!1),(async function(s){const a=st(s);a.la.add(0),await Ug(a),a.Ta.set("Offline")})(t)}))}function Ahe(n,e,t,r){const s=new eS(r),a=new Xj(e,s,t);return n.asyncQueue.enqueueAndForget((async()=>Yj(await fg(n),a))),()=>{s.Va(),n.asyncQueue.enqueueAndForget((async()=>Qj(await fg(n),a)))}}function khe(n,e){const t=new ma;return n.asyncQueue.enqueueAndForget((async()=>(async function(s,a,o){try{const l=await(function(d,h){const m=st(d);return m.persistence.runTransaction("read document","readonly",(p=>m.localDocuments.getDocument(p,h)))})(s,a);l.isFoundDocument()?o.resolve(l):l.isNoDocument()?o.resolve(null):o.reject(new Fe(Te.UNAVAILABLE,"Failed to get document from cache. (However, this document may exist on the server. Run again without setting 'source' in the GetOptions to attempt to retrieve the document from the server.)"))}catch(l){const c=$g(l,`Failed to get document '${a} from cache`);o.reject(c)}})(await Hg(n),e,t))),t.promise}function dq(n,e,t={}){const r=new ma;return n.asyncQueue.enqueueAndForget((async()=>(function(a,o,l,c,d){const h=new eS({next:p=>{h.Va(),o.enqueueAndForget((()=>Qj(a,m)));const x=p.docs.has(l);!x&&p.fromCache?d.reject(new Fe(Te.UNAVAILABLE,"Failed to get document because the client is offline.")):x&&p.fromCache&&c&&c.source==="server"?d.reject(new Fe(Te.UNAVAILABLE,'Failed to get document from server. (However, this document does exist in the local cache. Run again without setting source to "server" to retrieve the cached document.)')):d.resolve(p)},error:p=>d.reject(p)}),m=new Xj(Lg(l.path),h,{includeMetadataChanges:!0,waitForSyncWhenOnline:!0});return Yj(a,m)})(await fg(n),n.asyncQueue,e,t,r))),r.promise}function Nhe(n,e){const t=new ma;return n.asyncQueue.enqueueAndForget((async()=>(async function(s,a,o){try{const l=await iE(s,a,!0),c=new tq(a,l.Wo),d=c.Xu(l.documents),h=c.applyChanges(d,!1);o.resolve(h.snapshot)}catch(l){const c=$g(l,`Failed to execute query '${a} against cache`);o.reject(c)}})(await Hg(n),e,t))),t.promise}function uq(n,e,t={}){const r=new ma;return n.asyncQueue.enqueueAndForget((async()=>(function(a,o,l,c,d){const h=new eS({next:p=>{h.Va(),o.enqueueAndForget((()=>Qj(a,m))),p.fromCache&&c.source==="server"?d.reject(new Fe(Te.UNAVAILABLE,'Failed to get documents from server. (However, these documents may exist in the local cache. Run again without setting source to "server" to retrieve the cached documents.)')):d.resolve(p)},error:p=>d.reject(p)}),m=new Xj(l instanceof Ob?Sde(l):l,h,{includeMetadataChanges:!0,waitForSyncWhenOnline:!0});return Yj(a,m)})(await fg(n),n.asyncQueue,e,t,r))),r.promise}function _he(n,e,t){const r=new ma;return n.asyncQueue.enqueueAndForget((async()=>{try{const s=await cq(n);r.resolve((async function(o,l,c){var v;const d=st(o),{request:h,ve:m,parent:p}=y7(d.serializer,n7(l),c);d.connection.Ze||delete h.parent;
3772const x=(await d._t("RunAggregationQuery",d.serializer.databaseId,p,h,1)).filter((B=>!!B.result));Ke(x.length===1,64727);const y=(v=x[0].result)==null?void 0:v.aggregateFields;return Object.keys(y).reduce(((B,E)=>(B[m[E]]=y[E],B)),{})})(s,e,t))}catch(s){r.reject(s)}})),r.promise}function Ihe(n,e){const t=new ma;return n.asyncQueue.enqueueAndForget((async()=>ihe(await l2(n),e,t))),t.promise}function Dhe(n,e){const t=new eS(e);return n.asyncQueue.enqueueAndForget((async()=>(function(s,a){st(s).Du.add(a),a.next()})(await fg(n),t))),()=>{t.Va(),n.asyncQueue.enqueueAndForget((async()=>(function(s,a){st(s).Du.delete(a)})(await fg(n),t)))}}function jhe(n,e,t){const r=new ma;return n.asyncQueue.enqueueAndForget((async()=>{const s=await cq(n);new Che(n.asyncQueue,s,t,e,r).Lc()})),r.promise}function Rhe(n,e,t,r){const s=(function(o,l){let c;return c=typeof o=="string"?d7().encode(o):o,(function(h,m){return new zue(h,m)})((function(h,m){if(h instanceof Uint8Array)return q4(h,m);if(h instanceof ArrayBuffer)return q4(new Uint8Array(h),m);if(h instanceof ReadableStream)return h.getReader();throw new Error("Source of `toByteStreamReader` has to be a ArrayBuffer or ReadableStream")})(c),l)})(t,qm(e));n.asyncQueue.enqueueAndForget((async()=>{Bhe(await l2(n),s,r)}))}function Phe(n,e){return n.asyncQueue.enqueue((async()=>(function(r,s){const a=st(r);return a.persistence.runTransaction("Get named query","readonly",(o=>a.f_.getNamedQuery(o,s)))})(await Hg(n),e)))}function hq(n,e){return(function(r,s){return new que(r,s)})(n,e)}function Lhe(n,e){return n.asyncQueue.enqueue((async()=>(async function(r,s){const a=st(r),o=a.indexManager,l=[];return a.persistence.runTransaction("Configure indexes","readwrite",(c=>o.getFieldIndexes(c).next((d=>(function(m,p,x,y,v){m=[...m],p=[...p],m.sort(x),p.sort(x);const B=m.length,E=p.length;let N=0,T=0;for(;N<E&&T<B;){const k=x(m[T],p[N]);k<0?v(m[T++]):k>0?y(p[N++]):(N++,T++)}for(;N<E;)y(p[N++]);for(;T<B;)v(m[T++])})(d,s,Koe,(h=>{l.push(o.addFieldIndex(c,h))}),(h=>{l.push(o.deleteFieldIndex(c,h))})))).next((()=>ve.waitFor(l)))))})(await Hg(n),e)))}function Ohe(n,e){return n.asyncQueue.enqueue((async()=>(function(r,s){st(r).No.yo=s})(await Hg(n),e)))}function Mhe(n){return n.asyncQueue.enqueue((async()=>(function(t){const r=st(t),s=r.indexManager;return r.persistence.runTransaction("Delete All Indexes","readwrite",(a=>s.deleteAllFieldIndexes(a)))})(await Hg(n))))}/**
3773 * @license
3774 * Copyright 2020 Google LLC
3775 *
3776 * Licensed under the Apache License, Version 2.0 (the "License");
3777 * you may not use this file except in compliance with the License.
3778 * You may obtain a copy of the License at
3779 *
3780 *   http://www.apache.org/licenses/LICENSE-2.0
3781 *
3782 * Unless required by applicable law or agreed to in writing, software
3783 * distributed under the License is distributed on an "AS IS" BASIS,
3784 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3785 * See the License for the specific language governing permissions and
3786 * limitations under the License.
3787 */let gy=class{constructor(e,t,r,s,a){this._firestore=e,this._userDataWriter=t,this._key=r,this._document=s,this._converter=a}get id(){return this._key.path.lastSegment()}get ref(){return new Fn(this._firestore,this._converter,this._key)}exists(){return this._document!==null}data(){if(this._document){if(this._converter){const e=new Fhe(this._firestore,this._userDataWriter,this._key,this._document,null);return this._converter.fromFirestore(e)}return this._userDataWriter.convertValue(this._document.data.value)}}_fieldsProto(){var e;return((e=this._document)==null?void 0:e.data.clone().value.mapValue.fields)??void 0}get(e){if(this._document){const t=this._document.data.field($l("DocumentSnapshot.get",e));if(t!==null)return this._userDataWriter.convertValue(t)}}},Fhe=class extends gy{data(){return super.data()}};/**
3788 * @license
3789 * Copyright 2020 Google LLC
3790 *
3791 * Licensed under the Apache License, Version 2.0 (the "License");
3792 * you may not use this file except in compliance with the License.
3793 * You may obtain a copy of the License at
3794 *
3795 *   http://www.apache.org/licenses/LICENSE-2.0
3796 *
3797 * Unless required by applicable law or agreed to in writing, softw
3797are
3798 * distributed under the License is distributed on an "AS IS" BASIS,
3799 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3800 * See the License for the specific language governing permissions and
3801 * limitations under the License.
3802 */class c2{convertValue(e,t="none"){switch(Us(e)){case 0:return null;case 1:return e.booleanValue;case 2:return Cr(e.integerValue||e.doubleValue);case 3:return this.convertTimestamp(e.timestampValue);case 4:return this.convertServerTimestamp(e,t);case 5:return e.stringValue;case 6:return this.convertBytes(Hd(e.bytesValue));case 7:return this.convertReference(e.referenceValue);case 8:return this.convertGeoPoint(e.geoPointValue);case 9:return this.convertArray(e.arrayValue,t);case 11:return this.convertObject(e.mapValue,t);case 10:return this.convertVectorValue(e.mapValue);default:throw ot(62114,{value:e})}}convertObject(e,t){return this.convertObjectMap(e.fields,t)}convertObjectMap(e,t="none"){const r={};return qh(e,((s,a)=>{r[s]=this.convertValue(a,t)})),r}convertVectorValue(e){var r,s,a;const t=(a=(s=(r=e.fields)==null?void 0:r[Cm].arrayValue)==null?void 0:s.values)==null?void 0:a.map((o=>Cr(o.doubleValue)));return new gi(t)}convertGeoPoint(e){return new Fl(Cr(e.latitude),Cr(e.longitude))}convertArray(e,t){return(e.values||[]).map((r=>this.convertValue(r,t)))}convertServerTimestamp(e,t){switch(t){case"previous":const r=rv(e);return r==null?null:this.convertValue(r,t);case"estimate":return this.convertTimestamp(K0(e));default:return null}}convertTimestamp(e){const t=$d(e);return new bn(t.seconds,t.nanos)}convertDocumentKey(e,t){const r=zt.fromString(e);Ke(E7(r),9688,{name:e});const s=new Ah(r.get(1),r.get(3)),a=new Je(r.popFirst(5));return s.isEqual(t)||Cs(`A document reference to ${a} refers to a different database (${s.projectId}/${s.database}), which is not supported. It will be treated as a reference in the current database (${t.projectId}/${t.database}) instead.`),a}}/**
3803 * @license
3804 * Copyright 2020 Google LLC
3805 *
3806 * Licensed under the Apache License, Version 2.0 (the "License");
3807 * you may not use this file except in compliance with the License.
3808 * You may obtain a copy of the License at
3809 *
3810 *   http://www.apache.org/licenses/LICENSE-2.0
3811 *
3812 * Unless required by applicable law or agreed to in writing, software
3813 * distributed under the License is distributed on an "AS IS" BASIS,
3814 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3815 * See the License for the specific language governing permissions and
3816 * limitations under the License.
3817 */function rS(n,e,t){let r;return r=n?t&&(t.merge||t.mergeFields)?n.toFirestore(e,t):n.toFirestore(e):e,r}class d2 extends c2{constructor(e){super(),this.firestore=e}convertBytes(e){return new Ui(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Fn(this.firestore,null,t)}}/**
3818 * @license
3819 * Copyright 2020 Google LLC
3820 *
3821 * Licensed under the Apache License, Version 2.0 (the "License");
3822 * you may not use this file except in compliance with the License.
3823 * You may obtain a copy of the License at
3824 *
3825 *   http://www.apache.org/licenses/LICENSE-2.0
3826 *
3827 * Unless required by applicable law or agreed to in writing, software
3828 * distributed under the License is distributed on an "AS IS" BASIS,
3829 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3830 * See the License for the specific language governing permissions and
3831 * limitations under the License.
3832 */const nF="AsyncQueue";class rF{constructor(e=Promise.resolve()){this.$c=[],this.Kc=!1,this.Qc=[],this.Wc=null,this.Gc=!1,this.zc=!1,this.jc=[],this.Ht=new aj(this,"async_queue_retry"),this.Hc=()=>{const r=hC();r&&ze(nF,"Visibility state changed to "+r.visibilityState),this.Ht.$t()},this.Jc=e;const t=hC();t&&typeof t.addEventListener=="function"&&t.addEventListener("visibilitychange",this.Hc)}get isShuttingDown(){return this.Kc}enqueueAndForget(e){this.enqueue(e)}enqueueAndForgetEvenWhileRestricted(e){this.Yc(),this.Zc(e)}enterRestrictedMode(e){if(!this.Kc){this.Kc=!0,this.zc=e||!1;const t=hC();t&&typeof t.removeEventListener=="function"&&t.removeEventListener("visibilitychange",this.Hc)}}enqueue(e){if(this.Yc(),this.Kc)return new Promise((()=>{}));const t=new ma;return this.Zc((()=>this.Kc&&this.zc?Promise.resolve():(e().then(t.resolve,t.reject),t.promise))).then((()=>t.promise))}enqueueRetryable(e){this.enqueueAndForget((()=>(this.$c.push(e),this.Xc())))}async Xc(){if(this.$c.length!==0){try{await this.$c[0](),this.$c.shift(),this.Ht.reset()}catch(e){if(!Wh(e))throw e;ze(nF,"Operation failed with retryable error: "+e)}this.$c.length>0&&this.Ht.kt((()=>this.Xc()))}}Zc(e){const t=this.Jc.then((()=>(this.Gc=!0,e().catch((r=>{throw this.Wc=r,this.Gc=!1,Cs("INTERNAL UNHANDLED ERROR: ",sF(r)),r})).then((r=>(this.Gc=!1,r))))));return this.Jc=t,t}
3832enqueueAfterDelay(e,t,r){this.Yc(),this.jc.indexOf(e)>-1&&(t=0);const s=Kj.createAndSchedule(this,e,t,r,(a=>this.el(a)));return this.Qc.push(s),s}Yc(){this.Wc&&ot(47125,{tl:sF(this.Wc)})}verifyOperationInProgress(){}async nl(){let e;do e=this.Jc,await e;while(e!==this.Jc)}rl(e){for(const t of this.Qc)if(t.timerId===e)return!0;return!1}il(e){return this.nl().then((()=>{this.Qc.sort(((t,r)=>t.targetTimeMs-r.targetTimeMs));for(const t of this.Qc)if(t.skipDelay(),e!=="all"&&t.timerId===e)break;return this.nl()}))}sl(e){this.jc.push(e)}el(e){const t=this.Qc.indexOf(e);this.Qc.splice(t,1)}}function sF(n){let e=n.message||"";return n.stack&&(e=n.stack.includes(n.message)?n.stack:n.message+`
3833`+n.stack),e}/**
3834 * @license
3835 * Copyright 2020 Google LLC
3836 *
3837 * Licensed under the Apache License, Version 2.0 (the "License");
3838 * you may not use this file except in compliance with the License.
3839 * You may obtain a copy of the License at
3840 *
3841 *   http://www.apache.org/licenses/LICENSE-2.0
3842 *
3843 * Unless required by applicable law or agreed to in writing, software
3844 * distributed under the License is distributed on an "AS IS" BASIS,
3845 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3846 * See the License for the specific language governing permissions and
3847 * limitations under the License.
3848 */class fq{constructor(){this._progressObserver={},this._taskCompletionResolver=new ma,this._lastProgress={taskState:"Running",totalBytes:0,totalDocuments:0,bytesLoaded:0,documentsLoaded:0}}onProgress(e,t,r){this._progressObserver={next:e,error:t,complete:r}}catch(e){return this._taskCompletionResolver.promise.catch(e)}then(e,t){return this._taskCompletionResolver.promise.then(e,t)}_completeWith(e){this._updateProgress(e),this._progressObserver.complete&&this._progressObserver.complete(),this._taskCompletionResolver.resolve(e)}_failWith(e){this._lastProgress.taskState="Error",this._progressObserver.next&&this._progressObserver.next(this._lastProgress),this._progressObserver.error&&this._progressObserver.error(e),this._taskCompletionResolver.reject(e)}_updateProgress(e){this._lastProgress=e,this._progressObserver.next&&this._progressObserver.next(e)}}/**
3849 * @license
3850 * Copyright 2020 Google LLC
3851 *
3852 * Licensed under the Apache License, Version 2.0 (the "License");
3853 * you may not use this file except in compliance with the License.
3854 * You may obtain a copy of the License at
3855 *
3856 *   http://www.apache.org/licenses/LICENSE-2.0
3857 *
3858 * Unless required by applicable law or agreed to in writing, software
3859 * distributed under the License is distributed on an "AS IS" BASIS,
3860 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3861 * See the License for the specific language governing permissions and
3862 * limitations under the License.
3863 */const Uhe=-1;class ar extends iv{constructor(e,t,r,s){super(e,t,r,s),this.type="firestore",this._queue=new rF,this._persistenceKey=(s==null?void 0:s.name)||"[DEFAULT]"}async _terminate(){if(this._firestoreClient){const e=this._firestoreClient.terminate();this._queue=new rF(e),this._firestoreClient=void 0,await e}}}function mq(n,e,t){t||(t=ry);const r=Yy(n,"firestore");if(r.isInitialized(t)){const s=r.getImmediate({identifier:t}),a=r.getOptions(t);if(Gl(a,e))return s;throw new Fe(Te.FAILED_PRECONDITION,"initializeFirestore() has already been called with different options. To avoid this error, call initializeFirestore() with the same options as when it was originally called, or call getFirestore() to return the already initialized instance.")}if(e.cacheSizeBytes!==void 0&&e.localCache!==void 0)throw new Fe(Te.INVALID_ARGUMENT,"cache and cacheSizeBytes cannot be specified at the same time as cacheSizeBytes willbe deprecated. Instead, specify the cache size in the cache object");if(e.cacheSizeBytes!==void 0&&e.cacheSizeBytes!==-1&&e.cacheSizeBytes<L7)throw new Fe(Te.INVALID_ARGUMENT,"cacheSizeBytes must be at least 1048576");return e.host&&Ng(e.host)&&AD(e.host),r.initialize({options:e,instanceIdentifier:t})}function pq(n,e){const t=typeof n=="object"?n:_D(),r=typeof n=="string"?n:e||ry,s=Yy(t,"firestore").getImmediate({identifier:r});if(!s._initialized){const a=ore("firestore");a&&U7(s,...a)}return s}function Wr(n){if(n._terminated)throw new Fe(Te.FAILED_PRECONDITION,"The client has already been terminated.");return n._firestoreClient||gq(n),n._firestoreClient}function gq(n){var r,s,a,o;const e=n._freezeSettings(),t=Mle(n._databaseId,((r=n._app)==null?void 0:r.options.appId)||"",n._persistenceKey,(s=n._app)==null?void 0:s.options.apiKey,e);n._componentsProvider||(a=e.localCache)!=null&&a._offlineComponentProvider&&((o=e.localCache)!=null&&o._onlineComponentProvider)&&(n._componentsProvider={_offline:e.localCache._offlineComponentProvider,_online:e.localCache._onlineComponentProvider}),n._firestoreClient=new Ehe(n._authCredentials,n._appCheckCredentials,n._queue,t,n._componentsProvider&&(function(c){const d=c==null?void 0:c._online.build();return{_offline:c==null?void 0:c._offline.build(d),_online:d}})(n._componentsProvider))}function Vhe(n,e){Xs("enableIndexedDbPersistence() will be deprecated 
3863in the future, you can use `FirestoreSettings.cache` instead.");const t=n._freezeSettings();return xq(n,Ph.provider,{build:r=>new i2(r,t.cacheSizeBytes,e==null?void 0:e.forceOwnership)}),Promise.resolve()}async function Ghe(n){Xs("enableMultiTabIndexedDbPersistence() will be deprecated in the future, you can use `FirestoreSettings.cache` instead.");const e=n._freezeSettings();xq(n,Ph.provider,{build:t=>new iq(t,e.cacheSizeBytes)})}function xq(n,e,t){if((n=Zt(n,ar))._firestoreClient||n._terminated)throw new Fe(Te.FAILED_PRECONDITION,"Firestore has already been started and persistence can no longer be enabled. You can only enable persistence before calling any other methods on a Firestore object.");if(n._componentsProvider||n._getSettings().localCache)throw new Fe(Te.FAILED_PRECONDITION,"SDK cache is already specified.");n._componentsProvider={_online:e,_offline:t},gq(n)}function $he(n){if(n._initialized&&!n._terminated)throw new Fe(Te.FAILED_PRECONDITION,"Persistence can only be cleared before a Firestore instance is initialized or after it is terminated.");const e=new ma;return n._queue.enqueueAndForgetEvenWhileRestricted((async()=>{try{await(async function(r){if(!jc.Ye())return Promise.resolve();const s=r+jz;await jc.delete(s)})(Vj(n._databaseId,n._persistenceKey)),e.resolve()}catch(t){e.reject(t)}})),e.promise}function Hhe(n){return(function(t){const r=new ma;return t.asyncQueue.enqueueAndForget((async()=>dhe(await l2(t),r))),r.promise})(Wr(n=Zt(n,ar)))}function zhe(n){return She(Wr(n=Zt(n,ar)))}function qhe(n){return The(Wr(n=Zt(n,ar)))}function Khe(n){return xse(n.app,"firestore",n._databaseId.database),n._delete()}function W_(n,e){const t=Wr(n=Zt(n,ar)),r=new fq;return Rhe(t,n._databaseId,e,r),r}function bq(n,e){return Phe(Wr(n=Zt(n,ar)),e).then((t=>t?new Zs(n,null,t.query):null))}/**
3864 * @license
3865 * Copyright 2024 Google LLC
3866 *
3867 * Licensed under the Apache License, Version 2.0 (the "License");
3868 * you may not use this file except in compliance with the License.
3869 * You may obtain a copy of the License at
3870 *
3871 *   http://www.apache.org/licenses/LICENSE-2.0
3872 *
3873 * Unless required by applicable law or agreed to in writing, software
3874 * distributed under the License is distributed on an "AS IS" BASIS,
3875 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3876 * See the License for the specific language governing permissions and
3877 * limitations under the License.
3878 */class Jh extends c2{constructor(e){super(),this.firestore=e}convertBytes(e){return new Ui(e)}convertReference(e){const t=this.convertDocumentKey(e,this.firestore._databaseId);return new Fn(this.firestore,null,t)}}/**
3879 * @license
3880 * Copyright 2025 Google LLC
3881 *
3882 * Licensed under the Apache License, Version 2.0 (the "License");
3883 * you may not use this file except in compliance with the License.
3884 * You may obtain a copy of the License at
3885 *
3886 *   http://www.apache.org/licenses/LICENSE-2.0
3887 *
3888 * Unless required by applicable law or agreed to in writing, software
3889 * distributed under the License is distributed on an "AS IS" BASIS,
3890 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3891 * See the License for the specific language governing permissions and
3892 * limitations under the License.
3893 *//**
3894 * @license
3895 * Copyright 2020 Google LLC
3896 *
3897 * Licensed under the Apache License, Version 2.0 (the "License");
3898 * you may not use this file except in compliance with the License.
3899 * You may obtain a copy of the License at
3900 *
3901 *   http://www.apache.org/licenses/LICENSE-2.0
3902 *
3903 * Unless required by applicable law or agreed to in writing, software
3904 * distributed under the License is distributed on an "AS IS" BASIS,
3905 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3906 * See the License for the specific language governing permissions and
3907 * limitations under the License.
3908 */const yq="NOT SUPPORTED";class Id{constructor(e,t){this.hasPendingWrites=e,this.fromCache=t}isEqual(e){return this.hasPendingWrites===e.hasPendingWrites&&this.fromCache===e.fromCache}}class Ki extends gy{constructor(e,t,r,s,a,o){super(e,t,r,s,o),this._firestore=e,this._firestoreImpl=e,this.metadata=a}exists(){return super.exists()}data(e={}){if(this._document){if(this._converter){const t=new $b(this._firestore,this._userDataWriter,this._key,this._document,this.metadata,null);return this._converter.fromFirestore(t,e)}return this._userDataWriter.convertValue(this._document.data.value,e.serverTimestamps)}}get(e,t={}){if(this._document){const r=this._document.data.field($l("DocumentSnapshot.get",e));if(r!==null)return this._userDataWriter.convertValue(r,t.serverTimestamps)}}toJSON(){if(this.metadata.hasPendingWrites)throw new Fe(Te.FAILED_PRECONDITION,"DocumentSnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e=this._document,t={};return t.type=Ki._jsonSchemaVersion,t.bundle="",t.bundleSource="DocumentSnapshot",t.bundleName=this._key.toString(),!e||!e.isValidDocument()||!e.isFoundDocument()?t:(this._userDataWriter.convertObjectMap(e.data.value.mapValue.fields,"previous"),t.bundle=(this._firestore,this.ref.path,"NOT SUPPORTED"),t)}}
vendor: 4,483 bytes, lines 3908-3912
3908function Whe(n,e,t){if(Hm(e,Ki._jsonSchema)){if(e.bundle===yq)throw new Fe(Te.INVALID_ARGUMENT,"The provided JSON object was created in a client environment, which is not supported.");const r=qm(n._databaseId),s=hq(e.bundle,r),a=s.va(),o=new Zj(s.getMetadata(),r);for(const h of a)o.$u(h);const l=o.documents;if(l.length!==1)throw new Fe(Te.INVALID_ARGUMENT,`Expected bundle data to contain 1 document, but it contains ${l.length} documents.`);const c=P1(r,l[0].document),d=new Je(zt.fromString(e.bundleName));return new Ki(n,new d2(n),d,c,new Id(!1,!1),t||null)}}Ki._jsonSchemaVersion="firestore/documentSnapshot/1.0",Ki._jsonSchema={type:Ms("string",Ki._jsonSchemaVersion),bundleSource:Ms("string","DocumentSnapshot"),bundleName:Ms("string"),bundle:Ms("string")};class $b extends Ki{data(e={}){return super.data(e)}}class Wi{constructor(e,t,r,s){this._firestore=e,this._userDataWriter=t,this._snapshot=s,this.metadata=new Id(s.hasPendingWrites,s.fromCache),this.query=r}get docs(){const e=[];return this.forEach((t=>e.push(t))),e}get size(){return this._snapshot.docs.size}get empty(){return this.size===0}forEach(e,t){this._snapshot.docs.forEach((r=>{e.call(t,new $b(this._firestore,this._userDataWriter,r.key,r,new Id(this._snapshot.mutatedKeys.has(r.key),this._snapshot.fromCache),this.query.converter))}))}docChanges(e={}){const t=!!e.includeMetadataChanges;if(t&&this._snapshot.excludesMetadataChanges)throw new Fe(Te.INVALID_ARGUMENT,"To include metadata changes with your document changes, you must also pass { includeMetadataChanges:true } to onSnapshot().");return this._cachedChanges&&this._cachedChangesIncludeMetadataChanges===t||(this._cachedChanges=(function(s,a){if(s._snapshot.oldDocs.isEmpty()){let o=0;return s._snapshot.docChanges.map((l=>{Xr(s._snapshot.query)?sE(s._snapshot.query):R1(s.query._query);const c=new $b(s._firestore,s._userDataWriter,l.doc.key,l.doc,new Id(s._snapshot.mutatedKeys.has(l.doc.key),s._snapshot.fromCache),s.query.converter);return l.doc,{type:"added",doc:c,oldIndex:-1,newIndex:o++}}))}{let o=s._snapshot.oldDocs;return s._snapshot.docChanges.filter((l=>a||l.type!==3)).map((l=>{const c=new $b(s._firestore,s._userDataWriter,l.doc.key,l.doc,new Id(s._snapshot.mutatedKeys.has(l.doc.key),s._snapshot.fromCache),s.query.converter);let d=-1,h=-1;return l.type!==0&&(d=o.indexOf(l.doc.key),o=o.delete(l.doc.key)),l.type!==1&&(o=o.add(l.doc),h=o.indexOf(l.doc.key)),{type:Qhe(l.type),doc:c,oldIndex:d,newIndex:h}}))}})(this,t),this._cachedChangesIncludeMetadataChanges=t),this._cachedChanges}toJSON(){if(this.metadata.hasPendingWrites)throw new Fe(Te.FAILED_PRECONDITION,"QuerySnapshot.toJSON() attempted to serialize a document with pending writes. Await waitForPendingWrites() before invoking toJSON().");const e={};e.type=Wi._jsonSchemaVersion,e.bundleSource="QuerySnapshot",e.bundleName=k1.newId(),this._firestore._databaseId.database,this._firestore._databaseId.projectId;const t=[],r=[],s=[];return this.docs.forEach((a=>{a._document!==null&&(t.push(a._document),r.push(this._userDataWriter.convertObjectMap(a._document.data.value.mapValue.fields,"previous")),s.push(a.ref.path))})),e.bundle=(this._firestore,this.query._query,e.bundleName,"NOT SUPPORTED"),e}}function Yhe(n,e,t){if(Hm(e,Wi._jsonSchema)){if(e.bundle===yq)throw new Fe(Te.INVALID_ARGUMENT,"The provided JSON object was created in a client environment, which is not supported.");const r=qm(n._databaseId),s=hq(e.bundle,r),a=s.va(),o=new Zj(s.getMetadata(),r);for(const x of a)o.$u(x);if(o.queries.length!==1)throw new Fe(Te.INVALID_ARGUMENT,`Snapshot data expected 1 query but found ${o.queries.length} queries.`);const l=W1(o.queries[0].bundledQuery),c=Xr(l)?sE(l):R1(l),d=o.documents;let h=new yh(c);d.map((x=>{const y=P1(r,x.document);h=h.add(y)}));const m=Im.fromInitialDocuments(l,h,Ft(),!1,!1),p=new Zs(n,t||null,l);return new Wi(n,new d2(n),p,m)}}function Qhe(n){switch(n){case 0:return"added";case 2:case 3:return"modified";case 1:return"removed";default:return ot(61501,{type:n})}}function Jhe(n,e){return n instanceof Ki&&e instanceof Ki?n._firestore===e._firestore&&n._key.isEqual(e._key)&&(n._document===null?e._document===null:n._document.isEqual(e._document))&&n._converter===e._converter:n instanceof Wi&&e instanceof Wi&&n._firestore===e._firestore&&oj(n.query,e.query)&&n.metadata.isEqual(e.metadata)&&n._snapshot.isEqual(e._snapshot)}/**
3909 * @license
3910 * Copyright 2025 Google LLC
3911 *
3912 * Licensed under the Apache License, Version 2.0 (the "License");
3913 * you may not use this file except in compliance with the License.
3914 * You may obtain a copy of the License at
3915 *
3916 *   http://www.apache.org/licenses/LICENSE-2.0
3917 *
3918 * Unless required by applicable law or agreed to in writing, software
3919 * distributed under the License is distributed on an "AS IS" BASIS,
3920 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3921 * See the License for the specific language governing permissions and
3922 * limitations under the License.
3923 */Wi._jsonSchemaVersion="firestore/querySnapshot/1.0",Wi._jsonSchema={type:Ms("string",Wi._jsonSchemaVersion),bundleSource:Ms("string","QuerySnapshot"),bundleName:Ms("string"),bundle:Ms("string")};/**
3924 * @license
3925 * Copyright 2017 Google LLC
3926 *
3927 * Licensed under the Apache License, Version 2.0 (the "License");
3928 * you may not use this file except in compliance with the License.
3929 * You may obtain a copy of the License at
3930 *
3931 *   http://www.apache.org/licenses/LICENSE-2.0
3932 *
3933 * Unless required by applicable law or agreed to in writing, software
3934 * distributed under the License is distributed on an "AS IS" BASIS,
3935 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3936 * See the License for the specific language governing permissions and
3937 * limitations under the License.
3938 */function Xhe(n){var r;const e=Wr(Zt(n.firestore,ar)),t=(r=e._onlineComponents)==null?void 0:r.datastore.serializer;return t===void 0?null:L1(t,Wa(n._query)).Se}function Zhe(n,e){var a;const t=$D(e,((o,l)=>new EH(l,o.aggregateType,o._internalFieldPath))),r=Wr(Zt(n.firestore,ar)),s=(a=r._onlineComponents)==null?void 0:a.datastore.serializer;return s===void 0?null:y7(s,n7(n._query),t,!0).request}/**
3939 * @license
3940 * Copyright 2022 Google LLC
3941 *
3942 * Licensed under the Apache License, Version 2.0 (the "License");
3943 * you may not use this file except in compliance with the License.
3944 * You may obtain a copy of the License at
3945 *
3946 *   http://www.apache.org/licenses/LICENSE-2.0
3947 *
3948 * Unless required by applicable law or agreed to in writing, software
3949 * distributed under the License is distributed on an "AS IS" BASIS,
3950 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3951 * See the License for the specific language governing permissions and
3952 * limitations under the License.
3953 */class mg{constructor(e="count",t){this._internalFieldPath=t,this.type="AggregateField",this.aggregateType=e}}class vq{constructor(e,t,r){this._userDataWriter=t,this._data=r,this.type="AggregateQuerySnapshot",this.query=e}data(){return this._userDataWriter.convertObjectMap(this._data)}_fieldsProto(){return new Ws({mapValue:{fields:this._data}}).clone().value.mapValue.fields}}/**
3954 * @license
3955 * Copyright 2020 Google LLC
3956 *
3957 * Licensed under the Apache License, Version 2.0 (the "License");
3958 * you may not use this file except in compliance with the License.
3959 * You may obtain a copy of the License at
3960 *
3961 *   http://www.apache.org/licenses/LICENSE-2.0
3962 *
3963 * Unless required by applicable law or agreed to in writing, software
3964 * distributed under the License is distributed on an "AS IS" BASIS,
3965 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3966 * See the License for the specific language governing permissions and
3967 * limitations under the License.
3968 */function Bq(n){if(n.limitType==="L"&&n.explicitOrderBy.length===0)throw new Fe(Te.UNIMPLEMENTED,"limitToLast() queries require specifying at least one orderBy() clause")}class u2{}class zg extends u2{}function vo(n,e,...t){let r=[];e instanceof u2&&r.push(e),r=r.concat(t),(function(a){const o=a.filter((c=>c instanceof Xm)).length,l=a.filter((c=>c instanceof qg)).length;if(o>1||o>0&&l>0)throw new Fe(Te.INVALID_ARGUMENT,"InvalidQuery. When using composite filters, you cannot use more than one filter at the top level. Consider nesting the multiple filters within an `and(...)` statement. For example: change `query(query, where(...), or(...))` to `query(query, and(where(...), or(...)))`.")})(r);for(const s of r)n=s._apply(n);return n}class qg extends zg{constructor(e,t,r){super(),this._field=e,this._op=t,this._value=r,this.type="where"}static _create(e,t,r){return new qg(e,t,r)}_apply(e){const t=this._parse(e);return Cq(e._query,t),new Zs(e.firestore,e.converter,A_(e._query,t))}_parse(e){const t=Wm(e.firestore);return(function(a,o,l,c,d,h,m){let p;
3968if(d.isKeyField()){if(h==="array-contains"||h==="array-contains-any")throw new Fe(Te.INVALID_ARGUMENT,`Invalid Query. You can't perform '${h}' queries on documentId().`);if(h==="in"||h==="not-in"){iF(m,h);const y=[];for(const v of m)y.push(aF(c,a,v));p={arrayValue:{values:y}}}else p=aF(c,a,m)}else h!=="in"&&h!=="not-in"&&h!=="array-contains-any"||iF(m,h),p=H7(l,o,m,h==="in"||h==="not-in");return ln.create(d,h,p)})(e._query,"where",t,e.firestore._databaseId,this._field,this._op,this._value)}}function Dl(n,e,t){const r=e,s=$l("where",n);return qg._create(s,r,t)}class Xm extends u2{constructor(e,t){super(),this.type=e,this._queryConstraints=t}static _create(e,t){return new Xm(e,t)}_parse(e){const t=this._queryConstraints.map((r=>r._parse(e))).filter((r=>r.getFilters().length>0));return t.length===1?t[0]:Wn.create(t,this._getOperator())}_apply(e){const t=this._parse(e);return t.getFilters().length===0?e:((function(s,a){let o=s;const l=a.getFlattenedFilters();for(const c of l)Cq(o,c),o=A_(o,c)})(e._query,t),new Zs(e.firestore,e.converter,A_(e._query,t)))}_getQueryConstraints(){return this._queryConstraints}_getOperator(){return this.type==="and"?"and":"or"}}function efe(...n){return n.forEach((e=>Eq("or",e))),Xm._create("or",n)}function tfe(...n){return n.forEach((e=>Eq("and",e))),Xm._create("and",n)}class sS extends zg{constructor(e,t){super(),this._field=e,this._direction=t,this.type="orderBy"}static _create(e,t){return new sS(e,t)}_apply(e){const t=(function(s,a,o){if(s.startAt!==null)throw new Fe(Te.INVALID_ARGUMENT,"Invalid query. You must not call startAt() or startAfter() before calling orderBy().");if(s.endAt!==null)throw new Fe(Te.INVALID_ARGUMENT,"Invalid query. You must not call endAt() or endBefore() before calling orderBy().");return new ay(a,o)})(e._query,this._field,this._direction);return new Zs(e.firestore,e.converter,Joe(e._query,t))}}function aS(n,e="asc"){const t=e,r=$l("orderBy",n);return sS._create(r,t)}class pv extends zg{constructor(e,t,r){super(),this.type=e,this._limit=t,this._limitType=r}static _create(e,t,r){return new pv(e,t,r)}_apply(e){return new Zs(e.firestore,e.converter,WC(e._query,this._limit,this._limitType))}}function h2(n){return NH("limit",n),pv._create("limit",n,"F")}function nfe(n){return NH("limitToLast",n),pv._create("limitToLast",n,"L")}class gv extends zg{constructor(e,t,r){super(),this.type=e,this._docOrFields=t,this._inclusive=r}static _create(e,t,r){return new gv(e,t,r)}_apply(e){const t=wq(e,this.type,this._docOrFields,this._inclusive);return new Zs(e.firestore,e.converter,Xoe(e._query,t))}}function rfe(...n){return gv._create("startAt",n,!0)}function sfe(...n){return gv._create("startAfter",n,!1)}class xv extends zg{constructor(e,t,r){super(),this.type=e,this._docOrFields=t,this._inclusive=r}static _create(e,t,r){return new xv(e,t,r)}_apply(e){const t=wq(e,this.type,this._docOrFields,this._inclusive);return new Zs(e.firestore,e.converter,Zoe(e._query,t))}}function afe(...n){return xv._create("endBefore",n,!1)}function ife(...n){return xv._create("endAt",n,!0)}function wq(n,e,t,r){if(t[0]=Yn(t[0]),t[0]instanceof gy)return(function(a,o,l,c,d){if(!c)throw new Fe(Te.NOT_FOUND,`Can't use a DocumentSnapshot that doesn't exist for ${l}().`);const h=[];for(const m of D0(a))if(m.field.isKeyField())h.push(Em(o,c.key));else{const p=c.data.field(m.field);if(nv(p))throw new Fe(Te.INVALID_ARGUMENT,'Invalid query. You are trying to start or end a query using a document for which the field "'+m.field+'" is an uncommitted server timestamp. (Since the value of this field is unknown, you cannot start/end a query with it.)');if(p===null){const x=m.field.canonicalString();throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. You are trying to start or end a query using a document for which the field '${x}' (used as the orderBy) does not exist.`)}h.push(p)}return new _h(h,d)})(n._query,n.firestore._databaseId,e,t[0]._document,r);{const s=Wm(n.firestore);return(function(o,l,c,d,h,m){const p=o.explicitOrderBy;if(h.length>p.length)throw new Fe(Te.INVALID_ARGUMENT,`Too many arguments provided to ${d}(). The number of arguments must be less than or equal to the number of orderBy() clauses`);const x=[];for(let y=0;y<h.length;y++){const v=h[y];
3968if(p[y].field.isKeyField()){if(typeof v!="string")throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. Expected a string for document ID in ${d}(), but got a ${typeof v}`);if(!ej(o)&&v.indexOf("/")!==-1)throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. When querying a collection and ordering by documentId(), the value passed to ${d}() must be a plain document ID, but '${v}' contains a slash.`);const B=o.path.child(zt.fromString(v));if(!Je.isDocumentKey(B))throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. When querying a collection group and ordering by documentId(), the value passed to ${d}() must result in a valid document path, but '${B}' is not because it contains an odd number of segments.`);const E=new Je(B);x.push(Em(l,E))}else{const B=H7(c,d,v);x.push(B)}}return new _h(x,m)})(n._query,n.firestore._databaseId,s,e,t,r)}}function aF(n,e,t){if(typeof(t=Yn(t))=="string"){if(t==="")throw new Fe(Te.INVALID_ARGUMENT,"Invalid query. When querying with documentId(), you must provide a valid document ID, but it was an empty string.");if(!ej(e)&&t.indexOf("/")!==-1)throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. When querying a collection by documentId(), you must provide a plain document ID, but '${t}' contains a '/' character.`);const r=e.path.child(zt.fromString(t));if(!Je.isDocumentKey(r))throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. When querying a collection group by documentId(), the value provided must result in a valid document path, but '${r}' is not because it has an odd number of segments (${r.length}).`);return Em(n,new Je(r))}if(t instanceof Fn)return Em(n,t._key);throw new Fe(Te.INVALID_ARGUMENT,`Invalid query. When querying with documentId(), you must provide a valid string or a DocumentReference, but it was: ${N1(t)}.`)}function iF(n,e){if(!Array.isArray(n)||n.length===0)throw new Fe(Te.INVALID_ARGUMENT,`Invalid Query. A non-empty array is required for '${e.toString()}' filters.`)}function Cq(n,e){const t=(function(s,a){for(const o of s)for(const l of o.getFlattenedFilters())if(a.indexOf(l.op)>=0)return l.op;return null})(n.filters,(function(s){switch(s){case"!=":return["!=","not-in"];case"array-contains-any":case"in":return["not-in"];case"not-in":return["array-contains-any","in","not-in","!="];default:return[]}})(e.op));if(t!==null)throw t===e.op?new Fe(Te.INVALID_ARGUMENT,`Invalid query. You cannot use more than one '${e.op.toString()}' filter.`):new Fe(Te.INVALID_ARGUMENT,`Invalid query. You cannot use '${e.op.toString()}' filters with '${t.toString()}' filters.`)}function Eq(n,e){if(!(e instanceof qg||e instanceof Xm))throw new Fe(Te.INVALID_ARGUMENT,`Function ${n}() requires AppliableConstraints created with a call to 'where(...)', 'or(...)', or 'and(...)'.`)}function ofe(n){return new mg("sum",$l("sum",n))}function lfe(n){return new mg("avg",$l("average",n))}function Sq(){return new mg("count")}function cfe(n,e){var t,r;return n instanceof mg&&e instanceof mg&&n.aggregateType===e.aggregateType&&((t=n._internalFieldPath)==null?void 0:t.canonicalString())===((r=e._internalFieldPath)==null?void 0:r.canonicalString())}function dfe(n,e){return oj(n.query,e.query)&&Gl(n.data(),e.data())}/**
3969 * @license
3970 * Copyright 2017 Google LLC
3971 *
3972 * Licensed under the Apache License, Version 2.0 (the "License");
3973 * you may not use this file except in compliance with the License.
3974 * You may obtain a copy of the License at
3975 *
3976 *   http://www.apache.org/licenses/LICENSE-2.0
3977 *
3978 * Unless required by applicable law or agreed to in writing, software
3979 * distributed under the License is distributed on an "AS IS" BASIS,
3980 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3981 * See the License for the specific language governing permissions and
3982 * limitations under the License.
3983 */function R0(n){return(function(t,r){if(typeof t!="object"||t===null)return!1;const s=t;for(const a of r)if(a in s&&typeof s[a]=="function")return!0;return!1})(n,["next","error","complete"])}function ufe(n){return Tq(n,{count:Sq()})}function Tq(n,e){const t=Zt(n.firestore,ar),r=Wr(t),s=$D(e,((a,o)=>new EH(o,a.aggregateType,a._internalFieldPath)));return _he(r,n._query,s).then((a=>(function(l,c,d){const h=new Jh(l);return new vq(c,h,d)})(t,n,a)))}class hfe{constructor(e){this.kind="memory",this._onlineComponentProvider=Ph.provider,this._offlineComponentProvider=e!=null&&e.garbageCollector?e.garbageCollector._offlineComponentProvider:{build:()=>new a2(void 0)}}toJSON(){return{kind:this.kind}}}class ffe{constructor(e){let t;this.kind="persistent",e!=null&&e.tabManager?(e.tabManager._initialize(e),t=e.tabManager):(t=Aq(void 0),t._initialize(e)),this._onlineComponentProvider=t._onlineComponentProvider,this._offlineComponentProvider=t._offlineComponentProvider}toJSON(){return{kind:this.kind}}}class mfe{constructor(){this.kind="memoryEager",this._offlineComponentProvider=hg.provider}toJSON(){return{kind:this.kind}}}class pfe{constructor(e){this.kind="memoryLru",this._offlineComponentProvider={build:()=>new a2(e)}}toJSON(){return{kind:this.kind}}}function gfe(){return new mfe}function xfe(n){return new pfe(n==null?void 0:n.cacheSizeBytes)}function bfe(n){return new hfe(n)}function yfe(n){return new ffe(n)}class vfe{constructor(e){this.forceOwnership=e,this.kind="persistentSingleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=Ph.provider,this._offlineComponentProvider={build:t=>new i2(t,e==null?void 0:e.cacheSizeBytes,this.forceOwnership)}}}class Bfe{constructor(){this.kind="PersistentMultipleTab"}toJSON(){return{kind:this.kind}}_initialize(e){this._onlineComponentProvider=Ph.provider,this._offlineComponentProvider={build:t=>new iq(t,e==null?void 0:e.cacheSizeBytes)}}}function Aq(n){return new vfe(n==null?void 0:n.forceOwnership)}function wfe(){return new Bfe}/**
3984 * @license
3985 * Copyright 2022 Google LLC
3986 *
3987 * Licensed under the Apache License, Version 2.0 (the "License");
3988 * you may not use this file except in compliance with the License.
3989 * You may obtain a copy of the License at
3990 *
3991 *   http://www.apache.org/licenses/LICENSE-2.0
3992 *
3993 * Unless required by applicable law or agreed to in writing, software
3994 * distributed under the License is distributed on an "AS IS" BASIS,
3995 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
3996 * See the License for the specific language governing permissions and
3997 * limitations under the License.
3998 */const Cfe={maxAttempts:5};/**
3999 * @license
4000 * Copyright 2020 Google LLC
4001 *
4002 * Licensed under the Apache License, Version 2.0 (the "License");
4003 * you may not use this file except in compliance with the License.
4004 * You may obtain a copy of the License at
4005 *
4006 *   http://www.apache.org/licenses/LICENSE-2.0
4007 *
4008 * Unless required by applicable law or agreed to in writing, software
4009 * distributed under the License is distributed on an "AS IS" BASIS,
4010 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4011 * See the License for the specific language governing permissions and
4012 * limitations under the License.
4013 */class kq{constructor(e,t){this._firestore=e,this._commitHandler=t,this._mutations=[],this._committed=!1,this._dataReader=Wm(e)}set(e,t,r){this._verifyNotCommitted();const s=dh(e,this._firestore),a=rS(s.converter,t,r),o=F1(this._dataReader,"WriteBatch.set",s._key,a,s.converter!==null,r);return this._mutations.push(o.toMutation(s._key,zr.none())),this}update(e,t,r,...s){this._verifyNotCommitted();const a=dh(e,this._firestore);let o;return o=typeof(t=Yn(t))=="string"||t instanceof Km?pj(this._dataReader,"WriteBatch.update",a._key,t,r,s):mj(this._dataReader,"WriteBatch.update",a._key,t),this._mutations.push(o.toMutation(a._key,zr.exists(!0))),this}delete(e){this._verifyNotCommitted();const t=dh(e,this._firestore);return this._mutations=this._mutations.concat(new Pg(t._key,zr.none())),this}commit(){return this._verifyNotCommitted(),this._committed=!0,this._mutations.length>0?this._commitHandler(this._mutations):Promise.resolve()}_verifyNotCommitted(){if(this._committed)throw new Fe(Te.FAILED_PRECONDITION,"A write batch can no longer be used after commit() has been called.")}}function dh(n,e){if((n=Yn(n)).firestore!==e)throw new Fe(Te.INVALID_ARGUMENT,"Provided document reference is from a different Firestore instance.");return n}/**
4014 * @license
4015 * Copyright 2020 Google LLC
4016 *
4017 * Licensed under the Apache License, Version 2.0 (the "License");
4018 * you may not use this file except in compliance with the License.
4019 * You may obtain a copy of the License at
4020 *
4021 *   http://www.apache.org/licenses/LICENSE-2.0
4022 *
4023 * Unless required by applicable law or agreed to in writing, software
4024 * distributed under the License is distributed on an "AS IS" BASIS,
4025 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4026 * See the License for the specific language governing permissions and
4027 * limitations under the License.
4028 */let Efe=class{constructor(e,t){this._firestore=e,this._transaction=t,this._dataReader=Wm(e)}get(e){const t=dh(e,this._firestore),r=new d2(this._firestore);return this._transaction.lookup([t._key]).then((s=>{if(!s||s.length!==1)return ot(24041);const a=s[0];if(a.isFoundDocument())return new gy(this._firestore,r,a.key,a,t.converter);if(a.isNoDocument())return new gy(this._firestore,r,t._key,null,t.converter);throw ot(18433,{doc:a})}))}set(e,t,r){const s=dh(e,this._firestore),a=rS(s.converter,t,r),o=F1(this._dataReader,"Transaction.set",s._key,a,s.converter!==null,r);return this._transaction.set(s._key,o),this}update(e,t,r,...s){const a=dh(e,this._firestore);let o;return o=typeof(t=Yn(t))=="string"||t instanceof Km?pj(this._dataReader,"Transaction.update",a._key,t,r,s):mj(this._dataReader,"Transaction.update",a._key,t),this._transaction.update(a._key,o),this}delete(e){const t=dh(e,this._firestore);return this._transaction.delete(t._key),this}};/**
4029 * @license
4030 * Copyright 2020 Google LLC
4031 *
4032 * Licensed under the Apache License, Version 2.0 (the "License");
4033 * you may not use this file except in compliance with the License.
4034 * You may obtain a copy of the License at
4035 *
4036 *   http://www.apache.org/licenses/LICENSE-2.0
4037 *
4038 * Unless required by applicable law or agreed to in writing, softw
4038are
4039 * distributed under the License is distributed on an "AS IS" BASIS,
4040 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4041 * See the License for the specific language governing permissions and
4042 * limitations under the License.
4043 */class Nq extends Efe{constructor(e,t){super(e,t),this._firestore=e}get(e){const t=dh(e,this._firestore),r=new Jh(this._firestore);return super.get(e).then((s=>new Ki(this._firestore,r,t._key,s._document,new Id(!1,!1),t.converter)))}}function Sfe(n,e,t){n=Zt(n,ar);const r={...Cfe,...t};(function(o){if(o.maxAttempts<1)throw new Fe(Te.INVALID_ARGUMENT,"Max attempts must be at least 1")})(r);const s=Wr(n);return jhe(s,(a=>e(new Nq(n,a))),r)}/**
4044 * @license
4045 * Copyright 2020 Google LLC
4046 *
4047 * Licensed under the Apache License, Version 2.0 (the "License");
4048 * you may not use this file except in compliance with the License.
4049 * You may obtain a copy of the License at
4050 *
4051 *   http://www.apache.org/licenses/LICENSE-2.0
4052 *
4053 * Unless required by applicable law or agreed to in writing, software
4054 * distributed under the License is distributed on an "AS IS" BASIS,
4055 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4056 * See the License for the specific language governing permissions and
4057 * limitations under the License.
4058 */function Tfe(n){n=Zt(n,Fn);const e=Zt(n.firestore,ar),t=Wr(e);return dq(t,n._key).then((r=>f2(e,n,r)))}function Afe(n){n=Zt(n,Fn);const e=Zt(n.firestore,ar),t=Wr(e),r=new Jh(e);return khe(t,n._key).then((s=>new Ki(e,r,n._key,s,new Id(s!==null&&s.hasLocalMutations,!0),n.converter)))}function _q(n){n=Zt(n,Fn);const e=Zt(n.firestore,ar),t=Wr(e);return dq(t,n._key,{source:"server"}).then((r=>f2(e,n,r)))}function Bc(n){n=Zt(n,Zs);const e=Zt(n.firestore,ar),t=Wr(e),r=new Jh(e);return Bq(n._query),uq(t,n._query).then((s=>new Wi(e,r,n,s)))}function kfe(n){n=Zt(n,Zs);const e=Zt(n.firestore,ar),t=Wr(e),r=new Jh(e);return Nhe(t,n._query).then((s=>new Wi(e,r,n,s)))}function Nfe(n){n=Zt(n,Zs);const e=Zt(n.firestore,ar),t=Wr(e),r=new Jh(e);return uq(t,n._query,{source:"server"}).then((s=>new Wi(e,r,n,s)))}function Dm(n,e,t){n=Zt(n,Fn);const r=Zt(n.firestore,ar),s=rS(n.converter,e,t),a=Wm(r);return Kg(r,[F1(a,"setDoc",n._key,s,n.converter!==null,t).toMutation(n._key,zr.none())])}function _fe(n,e,t,...r){n=Zt(n,Fn);const s=Zt(n.firestore,ar),a=Wm(s);let o;return o=typeof(e=Yn(e))=="string"||e instanceof Km?pj(a,"updateDoc",n._key,e,t,r):mj(a,"updateDoc",n._key,e),Kg(s,[o.toMutation(n._key,zr.exists(!0))])}function hm(n){return Kg(Zt(n.firestore,ar),[new Pg(n._key,zr.none())])}function Kf(n,e){const t=Zt(n.firestore,ar),r=qi(n),s=rS(n.converter,e),a=Wm(n.firestore);return Kg(t,[F1(a,"addDoc",r._key,s,n.converter!==null,{}).toMutation(r._key,zr.exists(!1))]).then((()=>r))}function jm(n,...e){var d,h,m;n=Yn(n);let t={includeMetadataChanges:!1,source:"default"},r=0;typeof e[r]!="object"||R0(e[r])||(t=e[r++]);const s={includeMetadataChanges:t.includeMetadataChanges,source:t.source};if(R0(e[r])){const p=e[r];e[r]=(d=p.next)==null?void 0:d.bind(p),e[r+1]=(h=p.error)==null?void 0:h.bind(p),e[r+2]=(m=p.complete)==null?void 0:m.bind(p)}let a,o,l;if(n instanceof Fn)o=Zt(n.firestore,ar),l=Lg(n._key.path),a={next:p=>{e[r]&&e[r](f2(o,n,p))},error:e[r+1],complete:e[r+2]};else{const p=Zt(n,Zs);o=Zt(p.firestore,ar),l=p._query;const x=new Jh(o);a={next:y=>{e[r]&&e[r](new Wi(o,x,p,y))},error:e[r+1],complete:e[r+2]},Bq(n._query)}const c=Wr(o);return Ahe(c,l,s,a)}function Ife(n,e,...t){const r=Yn(n),s=(function(c){const d={bundle:"",bundleName:"",bundleSource:""},h=["bundle","bundleName","bundleSource"];for(const m of h){if(!(m in c)){d.error=`snapshotJson missing required field: ${m}`;break}const p=c[m];if(typeof p!="string"){d.error=`snapshotJson field '${m}' must be a string.`;break}if(p.length===0){d.error=`snapshotJson field '${m}' cannot be an empty string.`;break}m==="bundle"?d.bundle=p:m==="bundleName"?d.bundleName=p:m==="bundleSource"&&(d.bundleSource=p)}return d})(e);if(s.error)throw new Fe(Te.INVALID_ARGUMENT,s.error);let a,o=0;
4058if(typeof t[o]!="object"||R0(t[o])||(a=t[o++]),s.bundleSource==="QuerySnapshot"){let l=null;if(typeof t[o]=="object"&&R0(t[o])){const c=t[o++];l={next:c.next,error:c.error,complete:c.complete}}else l={next:t[o++],error:t[o++],complete:t[o++]};return(function(d,h,m,p,x){let y,v=!1;return W_(d,h.bundle).then((()=>bq(d,h.bundleName))).then((E=>{E&&!v&&(x&&E.withConverter(x),y=jm(E,m||{},p))})).catch((E=>(p.error&&p.error(E),()=>{}))),()=>{v||(v=!0,y&&y())}})(r,s,a,l,t[o])}if(s.bundleSource==="DocumentSnapshot"){let l=null;if(typeof t[o]=="object"&&R0(t[o])){const c=t[o++];l={next:c.next,error:c.error,complete:c.complete}}else l={next:t[o++],error:t[o++],complete:t[o++]};return(function(d,h,m,p,x){let y,v=!1;return W_(d,h.bundle).then((()=>{if(!v){const E=new Fn(d,x||null,Je.fromPath(h.bundleName));y=jm(E,m||{},p)}})).catch((E=>(p.error&&p.error(E),()=>{}))),()=>{v||(v=!0,y&&y())}})(r,s,a,l,t[o])}throw new Fe(Te.INVALID_ARGUMENT,`unsupported bundle source: ${s.bundleSource}`)}function Dfe(n,e){n=Zt(n,ar);const t=Wr(n),r=R0(e)?e:{next:e};return Dhe(t,r)}function Kg(n,e){const t=Wr(n);return Ihe(t,e)}function f2(n,e,t){const r=t.docs.get(e._key),s=new Jh(n);return new Ki(n,s,e._key,r,new Id(t.hasPendingWrites,t.fromCache),e.converter)}function jfe(n){return n=Zt(n,ar),Wr(n),new kq(n,(e=>Kg(n,e)))}/**
4059 * @license
4060 * Copyright 2021 Google LLC
4061 *
4062 * Licensed under the Apache License, Version 2.0 (the "License");
4063 * you may not use this file except in compliance with the License.
4064 * You may obtain a copy of the License at
4065 *
4066 *   http://www.apache.org/licenses/LICENSE-2.0
4067 *
4068 * Unless required by applicable law or agreed to in writing, software
4069 * distributed under the License is distributed on an "AS IS" BASIS,
4070 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4071 * See the License for the specific language governing permissions and
4072 * limitations under the License.
4073 */function Rfe(n,e){n=Zt(n,ar);const t=Wr(n);if(!t._uninitializedComponentsProvider||t._uninitializedComponentsProvider._offline.kind==="memory")return Xs("Cannot enable indexes when persistence is disabled"),Promise.resolve();const r=(function(a){const o=typeof a=="string"?(function(d){try{return JSON.parse(d)}catch(h){throw new Fe(Te.INVALID_ARGUMENT,"Failed to parse JSON: "+(h==null?void 0:h.message))}})(a):a,l=[];if(Array.isArray(o.indexes))for(const c of o.indexes){const d=oF(c,"collectionGroup"),h=[];if(Array.isArray(c.fields))for(const m of c.fields){const p=oF(m,"fieldPath"),x=xj("setIndexConfiguration",p);m.arrayConfig==="CONTAINS"?h.push(new cm(x,2)):m.order==="ASCENDING"?h.push(new cm(x,0)):m.order==="DESCENDING"&&h.push(new cm(x,1))}l.push(new tg(tg.UNKNOWN_ID,d,h,ng.empty()))}return l})(e);return Lhe(t,r)}function oF(n,e){if(typeof n[e]!="string")throw new Fe(Te.INVALID_ARGUMENT,"Missing string value for: "+e);return n[e]}/**
4074 * @license
4075 * Copyright 2023 Google LLC
4076 *
4077 * Licensed under the Apache License, Version 2.0 (the "License");
4078 * you may not use this file except in compliance with the License.
4079 * You may obtain a copy of the License at
4080 *
4081 *   http://www.apache.org/licenses/LICENSE-2.0
4082 *
4083 * Unless required by applicable law or agreed to in writing, software
4084 * distributed under the License is distributed on an "AS IS" BASIS,
4085 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4086 * See the License for the specific language governing permissions and
4087 * limitations under the License.
4088 */class Iq{constructor(e){this._firestore=e,this.type="PersistentCacheIndexManager"}}function Pfe(n){var s;n=Zt(n,ar);const e=lF.get(n);if(e)return e;if(((s=Wr(n)._uninitializedComponentsProvider)==null?void 0:s._offline.kind)!=="persistent")return null;const r=new Iq(n);return lF.set(n,r),r}function Lfe(n){Dq(n,!0)}function Ofe(n){Dq(n,!1)}function Mfe(n){const e=Wr(n._firestore);Mhe(e).then((t=>ze("deleting all persistent cache indexes succeeded"))).catch((t=>Xs("deleting all persistent cache indexes failed",t)))}function Dq(n,e){const t=Wr(n._firestore);Ohe(t,e).then((r=>ze(`setting persistent cache index auto creation isEnabled=${e} succeeded`))).catch((r=>Xs(`setting persistent cache index auto creation isEnabled=${e} failed`,r)))}const lF=new WeakMap;/**
4089 * @license
4090 * Copyright 2023 Google LLC
4091 *
4092 * Licensed under the Apache License, Version 2.0 (the "License");
4093 * you may not use this file except in compliance with the License.
4094 * You may obtain a copy of the License at
4095 *
4096 *   http://www.apache.org/licenses/LICENSE-2.0
4097 *
4098 * Unless required by applicable law or agreed to in writing, software
4099 * distributed under the License is distributed on an "AS IS" BASIS,
4100 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4101 * See the License for the specific language governing permissions and
4102 * limitations under the License.
4103 */class Ffe{constructor(){throw new Error("instances of this class should not be created")}static onExistenceFilterMismatch(e){return m2.instance.onExistenceFilterMismatch(e)}}class m2{constructor(){this.t=new Map}static get instance(){return dw||(dw=new m2,ile(dw)),dw}Ae(e){this.t.forEach((t=>t(e)))}onExistenceFilterMismatch(e){const t=Symbol(),r=this.t;return r.set(t,e),()=>r.delete(t)}}let dw=null;const cF="@firebase/firestore",dF="4.17.2";(function(e,t=!0){voe(_g),H0(new ym("firestore",((r,{instanceIdentifier:s,options:a})=>{const o=r.getProvider("app").getImmediate(),l=new ar(new wle(r.getProvider("auth-internal")),new Sle(o,r.getProvider("app-check-internal")),_oe(o,s),o);return a={useFetchStreams:t,...a},l._setSettings(a),l}),"PUBLIC").setMultipleInstances(!0)),ph(cF,dF,e),ph(cF,dF,"esm2020")})();const Rk=Object.freeze(Object.defineProperty({__proto__:null,AbstractUserDataWriter:c2,AggregateField:mg,AggregateQuerySnapshot:vq,Bytes:Ui,CACHE_SIZE_UNLIMITED:Uhe,CollectionReference:Ul,DocumentReference:Fn,DocumentSnapshot:Ki,FieldPath:Km,FieldValue:zc,Firestore:ar,FirestoreError:Fe,GeoPoint:Fl,LoadBundleTask:fq,PersistentCacheIndexManager:Iq,Query:Zs,QueryCompositeFilterConstraint:Xm,QueryConstraint:zg,QueryDocumentSnapshot:$b,QueryEndAtConstraint:xv,QueryFieldFilterConstraint:qg,QueryLimitConstraint:pv,QueryOrderByConstraint:sS,QuerySnapshot:Wi,QueryStartAtConstraint:gv,SnapshotMetadata:Id,Timestamp:bn,Transaction:Nq,VectorValue:gi,WriteBatch:kq,_AutoId:k1,_ByteString:Sr,_DatabaseId:Ah,_DocumentKey:Je,_EmptyAppCheckTokenProvider:Tle,_EmptyAuthCredentialsProvider:N7,_FieldPath:Es,_TestingHooks:Ffe,_cast:Zt,_debugAssert:woe,_internalAggregationQueryToProtoRunAggregationQueryRequest:Zhe,_internalQueryToProtoQueryTarget:Xhe,_isBase64Available:Aoe,_logWarn:Xs,_validateIsNotUsedTogether:kH,addDoc:Kf,aggregateFieldEqual:cfe,aggregateQuerySnapshotEqual:dfe,and:tfe,arrayRemove:Xle,arrayUnion:Jle,average:lfe,clearIndexedDbPersistence:$he,collection:qs,collectionGroup:$le,connectFirestoreEmulator:U7,count:Sq,deleteAllPersistentCacheIndexes:Mfe,deleteDoc:hm,deleteField:Qle,disableNetwork:qhe,disablePersistentCacheIndexAutoCreation:Ofe,doc:qi,documentId:A7,documentSnapshotFromJSON:Whe,enableIndexedDbPersistence:Vhe,enableMultiTabIndexedDbPersistence:Ghe,enableNetwork:zhe,enablePersistentCacheIndexAutoCreation:Lfe,endAt:ife,endBefore:afe,ensureFirestoreConfigured:Wr,executeWrite:Kg,getAggregateFromServer:Tq,getCountFromServer:ufe,getDoc:Tfe,getDocFromCache:Afe,getDocFromServer:_q,getDocs:Bc,getDocsFromCache:kfe,getDocsFromServer:Nfe,getFirestore:pq,getPersistentCacheIndexManager:Pfe,increment:Zle,initializeFirestore:mq,limit:h2,limitToLast:nfe,loadBundle:W_,maximum:tce,memoryEagerGarbageCollector:gfe,memoryLocalCache:bfe,memoryLruGarbageCollector:xfe,minimum:ece,namedQuery:bq,onSnapshot:jm,onSnapshotResume:Ife,onSnapshotsInSync:Dfe,or:efe,orderBy:aS,persistentLocalCache:yfe,persistentMultipleTabManager:wfe,persistentSingleTabManager:Aq,query:vo,queryEqual:oj,querySnapshotFromJSON:Yhe,refEqual:Hle,runTransaction:Sfe,serverTimestamp:Sd,setDoc:Dm,setIndexConfiguration:Rfe,setLogLevel:Boe,snapshotEqual:Jhe,startAfter:sfe,startAt:rfe,sum:ofe,terminate:Khe,updateDoc:_fe,vector:Q7,waitForPendingWrites:Hhe,where:Dl,writeBatch:jfe},Symbol.toStringTag,{value:"Module"}));var Ufe="firebase",Vfe="12.19.0";/**
4104 * @license
4105 * Copyright 2020 Google LLC
4106 *
4107 * Licensed under the Apache License, Version 2.0 (the "License");
4108 * you may not use this file except in compliance with the License.
4109 * You may obtain a copy of the License at
4110 *
4111 *   http://www.apache.org/licenses/LICENSE-2.0
4112 *
4113 * Unless required by applicable law or agreed to in writing, softw
4113are
4114 * distributed under the License is distributed on an "AS IS" BASIS,
4115 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4116 * See the License for the specific language governing permissions and
4117 * limitations under the License.
4118 */ph(Ufe,Vfe,"app");const Gfe="gen-lang-client-0837913272",$fe="1:679556938291:web:ed30c55eeff6f9ccee0146",Hfe="AIzaSyDIHqPz02RPGJWMjm7qQDqQBxSfKoNV61U",zfe="gen-lang-client-0837913272.firebaseapp.com",qfe="ai-studio-c0e60891-cde8-450d-9040-08ff2e12f486",Kfe="gen-lang-client-0837913272.firebasestorage.app",Wfe="679556938291",Lf={projectId:Gfe,appId:$fe,apiKey:Hfe,authDomain:zfe,firestoreDatabaseId:qfe,storageBucket:Kfe,messagingSenderId:Wfe};var jq=(n=>(n.CREATE="create",n.UPDATE="update",n.DELETE="delete",n.LIST="list",n.GET="get",n.WRITE="write",n))(jq||{});function Yfe(n,e,t){var s,a,o,l,c,d,h;const r={error:n instanceof Error?n.message:String(n),authInfo:{userId:(s=zo.currentUser)==null?void 0:s.uid,email:(a=zo.currentUser)==null?void 0:a.email,emailVerified:(o=zo.currentUser)==null?void 0:o.emailVerified,isAnonymous:(l=zo.currentUser)==null?void 0:l.isAnonymous,tenantId:(c=zo.currentUser)==null?void 0:c.tenantId,providerInfo:((h=(d=zo.currentUser)==null?void 0:d.providerData)==null?void 0:h.map(m=>({providerId:m.providerId,email:m.email})))||[]},operationType:e,path:t};throw console.error("Firestore Error: ",JSON.stringify(r)),new Error(JSON.stringify(r))}const Qfe={apiKey:Lf.apiKey,authDomain:Lf.authDomain,projectId:Lf.projectId,storageBucket:Lf.storageBucket,messagingSenderId:Lf.messagingSenderId,appId:Lf.appId},xy=vse().length===0?N$(Qfe):_D(),uF=Lf.firestoreDatabaseId,fn=(()=>{try{return mq(xy,{experimentalForceLongPolling:!0},uF)}catch{return pq(xy,uF)}})();async function Jfe(){try{await _q(qi(fn,"test","connection"))}catch(n){n instanceof Error&&n.message.includes("the client is offline")&&console.warn("Firestore operating in offline cache mode. Please check connection.")}}typeof window<"u"&&Jfe().catch(()=>{});const zo=zie(xy),Rq=new Cd,p2=async()=>{var n;try{return(await eie(zo,Rq)).user}catch(e){if(console.error("Google 登录失败:",e),(e==null?void 0:e.code)==="auth/unauthorized-domain"){const t=typeof window<"u"?window.location.hostname:"radioshadow.space",r=new Error(`当前域名 (${t}) 未在 Firebase 授权网域列表中。请在 Firebase 控制台 (Authentication -> Settings -> Authorized domains) 添加 "${t}",或先使用邮箱登录。`);throw r.code=e.code,r}if((e==null?void 0:e.code)==="auth/popup-blocked"){const t=new Error("登录弹窗已被浏览器拦截,请在地址栏允许弹出窗口,或使用下方邮箱直接登录。");throw t.code=e.code,t}if((e==null?void 0:e.code)==="auth/network-request-failed"||(n=e==null?void 0:e.message)!=null&&n.includes("network-request-failed")){const t=new Error("无法连接到 Google 认证服务,请检查网络或使用下方邮箱继续。");throw t.code=e.code,t}throw e}},g2=async(n,e="Pass123456!")=>{try{return(await kae(zo,n,e)).user}catch(t){if((t==null?void 0:t.code)==="auth/operation-not-allowed"){const r=new Error("Email/Password provider is disabled in Firebase Console. Please enable the 'Email/Password' toggle in Firebase Authentication settings.");throw r.code=t.code,r}if((t==null?void 0:t.code)==="auth/user-not-found"||(t==null?void 0:t.code)==="auth/invalid-credential"||(t==null?void 0:t.code)==="auth/invalid-email")try{const r=await Aae(zo,n,e);if(r.user){const s=n.split("@")[0];await _ae(r.user,{displayName:s})}return r.user}catch(r){if((r==null?void 0:r.code)==="auth/email-already-in-use"){const s=new Error("This email is already registered. Incorrect password, or the account was created using Google or Anonymous login.");throw s.code=r.code,s}if((r==null?void 0:r.code)==="auth/operation-not-allowed"){const s=new Error("Email/Password provider is disabled in Firebase Console. Please enable the 'Email/Password' toggle in Firebase Authentication settings.");throw s.code=r.code,s}throw r}throw t}},dE=async()=>{try{await Rae(zo)}catch(n){throw console.error("退出登录失败:",n),n}},Pk=Object.freeze(Object.defineProperty({__proto__:null,OperationType:jq,auth:zo,db:fn,default:xy,firebaseApp:xy,googleProvider:Rq,handleFirestoreError:Yfe,logout:dE,signInWithEmail:g2,signInWithGoogle:p2},Symbol.toStringTag,{value:"Module"})),Pq=S.createContext({user:null,userProfile:null,loading:!0,isPro:!1,signInWithGoogle:p2,signInWithEmail:g2,logout:dE}),Ji=()=>S.useContext(Pq);function Xfe({children:n}){const[e,t]=S.useState(null),[r,s]=S.useState(null),[a,o]=S.useState(!0);S.useEffect(()=>{let c=null;const d=jae(zo,async h=>{if(h!=null&&h.isAnonymous){try{await dE()}catch(m){console.error("Purge anonymous session error:",m)}t(null),s(null),o(!1);return}if(t(h),c&&(c(),c=null),h)try{const m=qi(fn,"users",h.uid);c=jm(m,async p=>{var x,y;if(p.exists()){const v=p.data();s(v);const B={};!v.email&&h.email&&(B.email=h.email),!v.displayName&&(h.displayName||h.email)&&(B.displayName=h.displayName||((x=h.email)==null?void 0:x.split("@")[0])||"User"),!v.photoURL&&h.photoURL&&(B.photoURL=h.photoURL),v.remainingQuota===void 0&&(B.remainingQuota=10),v.isPro===void 0&&(B.isPro=!1),Object.keys(B).length>0&&await Dm(m,B,{merge:!0})}else{const v={email:h.email||"",displayName:h.displayName||((y=h.email)==null?void 0:y.split("@")[0])||"User",photoURL:h.photoURL||"",isPro:!1,remainingQuota:10,createdAt:Sd(),updatedAt:Sd()};await Dm(m,v,{merge:!0})}o(!1)},p=>{console.error("Firestore user profile snapshot error:",p),o(!1)})}catch(m){console.error("加载用户 Profile 失败:",m),o(!1)}else s(null),o(!1)});return()=>{d(),c&&c()}},[]);const l=!!(r!=null&&r.isPro);return i.jsx(Pq.Provider,{value:{user:e,userProfile:r,loading:a,isPro:l,signInWithGoogle:p2,signInWithEmail:g2,logout:dE},children:n})}const x2=S.createContext({});function b2(n){const e=S.useRef(null);return e.current===null&&(e.current=n()),e.current}const Zfe=typeof window<"u",Lq=Zfe?S.useLayoutEffect:S.useEffect,iS=S.createContext(null);function y2(n,e){n.indexOf(e)===-1&&n.push(e)}function uE(n,e){const t=n.indexOf(e);t>-1&&n.splice(t,1)}const Uc=(n,e,t)=>t>e?e:t<n?n:t;let v2=()=>{};const Oh={},Oq=n=>/^-?(?:\d+(?:\.\d+)?|\.\d+)$/u.test(n),Mq=n=>typeof n=="object"&&n!==null,Fq=n=>/^0[^.\s]+$/u.test(n);function Uq(n){let e;return()=>(e===void 0&&(e=n()),e)}const el=n=>n,bv=(...n)=>n.reduce((e,t)=>
vendor: 29,423 bytes, line 4118
4118r=>t(e(r))),by=(n,e,t)=>{const r=e-n;return r?(t-n)/r:1};class B2{constructor(){this.subscriptions=[]}add(e){return y2(this.subscriptions,e),()=>uE(this.subscriptions,e)}notify(e,t,r){const s=this.subscriptions.length;if(s)if(s===1)this.subscriptions[0](e,t,r);else for(let a=0;a<s;a++){const o=this.subscriptions[a];o&&o(e,t,r)}}getSize(){return this.subscriptions.length}clear(){this.subscriptions.length=0}}const wo=n=>n*1e3,Yo=n=>n/1e3,Vq=(n,e)=>e?n*(1e3/e):0,Gq=(n,e,t)=>(((1-3*t+3*e)*n+(3*t-6*e))*n+3*e)*n,eme=1e-7,tme=12;function nme(n,e,t,r,s){let a,o,l=0;do o=e+(t-e)/2,a=Gq(o,r,s)-n,a>0?t=o:e=o;while(Math.abs(a)>eme&&++l<tme);return o}function yv(n,e,t,r){if(n===e&&t===r)return el;const s=a=>nme(a,0,1,n,t);return a=>a===0||a===1?a:Gq(s(a),e,r)}const $q=n=>e=>e<=.5?n(2*e)/2:(2-n(2*(1-e)))/2,Hq=n=>e=>1-n(1-e),zq=yv(.33,1.53,.69,.99),w2=Hq(zq),qq=$q(w2),Kq=n=>n>=1?1:(n*=2)<1?.5*w2(n):.5*(2-Math.pow(2,-10*(n-1))),C2=n=>1-Math.sin(Math.acos(n)),Wq=Hq(C2),Yq=$q(C2),rme=yv(.42,0,1,1),sme=yv(0,0,.58,1),Qq=yv(.42,0,.58,1),ame=n=>Array.isArray(n)&&typeof n[0]!="number",Jq=n=>Array.isArray(n)&&typeof n[0]=="number",ime={linear:el,easeIn:rme,easeInOut:Qq,easeOut:sme,circIn:C2,circInOut:Yq,circOut:Wq,backIn:w2,backInOut:qq,backOut:zq,anticipate:Kq},ome=n=>typeof n=="string",hF=n=>{if(Jq(n)){v2(n.length===4);const[e,t,r,s]=n;return yv(e,t,r,s)}else if(ome(n))return ime[n];return n},uw=["setup","read","resolveKeyframes","preUpdate","update","preRender","render","postRender"];function lme(n,e){let t=new Set,r=new Set,s=!1,a=!1;const o=new WeakSet;let l={delta:0,timestamp:0,isProcessing:!1};function c(h){o.has(h)&&(d.schedule(h),n()),h(l)}const d={schedule:(h,m=!1,p=!1)=>{const y=p&&s?t:r;return m&&o.add(h),y.add(h),h},cancel:h=>{r.delete(h),o.delete(h)},process:h=>{if(l=h,s){a=!0;return}s=!0;const m=t;t=r,r=m,t.forEach(c),t.clear(),s=!1,a&&(a=!1,d.process(h))}};return d}const cme=40;function Xq(n,e){let t=!1,r=!0;const s={delta:0,timestamp:0,isProcessing:!1},a=()=>t=!0,o=uw.reduce((T,k)=>(T[k]=lme(a),T),{}),{setup:l,read:c,resolveKeyframes:d,preUpdate:h,update:m,preRender:p,render:x,postRender:y}=o,v=()=>{const T=Oh.useManualTiming,k=T?s.timestamp:performance.now();t=!1,T||(s.delta=r?1e3/60:Math.max(Math.min(k-s.timestamp,cme),1)),s.timestamp=k,s.isProcessing=!0,l.process(s),c.process(s),d.process(s),h.process(s),m.process(s),p.process(s),x.process(s),y.process(s),s.isProcessing=!1,t&&e&&(r=!1,n(v))},B=()=>{t=!0,r=!0,s.isProcessing||n(v)};return{schedule:uw.reduce((T,k)=>{const P=o[k];return T[k]=(R,_=!1,I=!1)=>(t||B(),P.schedule(R,_,I)),T},{}),cancel:T=>{for(let k=0;k<uw.length;k++)o[uw[k]].cancel(T)},state:s,steps:o}}const{schedule:pr,cancel:Mh,state:_a,steps:Lk}=Xq(typeof requestAnimationFrame<"u"?requestAnimationFrame:el,!0);let fC;function dme(){fC=void 0}const ui={now:()=>(fC===void 0&&ui.set(_a.isProcessing||Oh.useManualTiming?_a.timestamp:performance.now()),fC),set:n=>{fC=n,queueMicrotask(dme)}},Zq=n=>e=>typeof e=="string"&&e.startsWith(n),eK=Zq("--"),ume=Zq("var(--"),E2=n=>ume(n)?hme.test(n.split("/*")[0].trim()):!1,hme=/var\(--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)$/iu;function fF(n){return typeof n!="string"?!1:n.split("/*")[0].includes("var(--")}const Wg={test:n=>typeof n=="number",parse:parseFloat,transform:n=>n},yy={...Wg,transform:n=>Uc(0,1,n)},hw={...Wg,default:1},Hb=n=>Math.round(n*1e5)/1e5,S2=/-?(?:\d+(?:\.\d+)?|\.\d+)/gu;function fme(n){return n==null}const mme=/^(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))$/iu,T2=(n,e)=>t=>!!(typeof t=="string"&&mme.test(t)&&t.startsWith(n)||e&&!fme(t)&&Object.prototype.hasOwnProperty.call(t,e)),tK=(n,e,t)=>r=>{if(typeof r!="string")return r;const[s,a,o,l]=r.match(S2);return{[n]:parseFloat(s),[e]:parseFloat(a),[t]:parseFloat(o),alpha:l!==void 0?parseFloat(l):1}},pme=n=>Uc(0,255,n),Ok={...Wg,transform:n=>Math.round(pme(n))},Zf={test:T2("rgb","red"),parse:tK("red","green","blue"),transform:({red:n,green:e,blue:t,alpha:r=1})=>"rgba("+Ok.transform(n)+", "+Ok.transform(e)+", "+Ok.transform(t)+", "+Hb(yy.transform(r))+")"};function gme(n){let e="",t="",r="",s="";return n.length>5?(e=n.substring(1,3),t=n.substring(3,5),r=n.substring(5,7),s=n.substring(7,9)):(e=n.substring(1,2),t=n.substring(2,3),r=n.substring(3,4),s=n.substring(4,5),e+=e,t+=t,r+=r,s+=s),{red:parseInt(e,16),green:parseInt(t,16),blue:parseInt(r,16),alpha:s?parseInt(s,16)/255:1}}const Y_={test:T2("#"),parse:gme,transform:Zf.transform},vv=n=>({test:e=>typeof e=="string"&&e.endsWith(n)&&e.split(" ").length===1,parse:parseFloat,transform:e=>`${e}${n}`}),bd=vv("deg"),Rc=vv("%"),xt=vv("px"),xme=vv("vh"),bme=vv("vw"),mF={...Rc,parse:n=>Rc.parse(n)/100,transform:n=>Rc.transform(n*100)},w0={test:T2("hsl","hue"),parse:tK("hue","saturation","lightness"),transform:({hue:n,saturation:e,lightness:t,alpha:r=1})=>"hsla("+Math.round(n)+", "+Rc.transform(Hb(e))+", "+Rc.transform(Hb(t))+", "+Hb(yy.transform(r))+")"},Ps={test:n=>Zf.test(n)||Y_.test(n)||w0.test(n),parse:n=>Zf.test(n)?Zf.parse(n):w0.test(n)?w0.parse(n):Y_.parse(n),transform:n=>typeof n=="string"?n:n.hasOwnProperty("red")?Zf.transform(n):w0.transform(n),getAnimatableNone:n=>{const e=Ps.parse(n);return e.alpha=0,Ps.transform(e)}},yme=/(?:#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\))/giu;function vme(n){var e,t;return isNaN(n)&&typeof n=="string"&&(((e=n.match(S2))==null?void 0:e.length)||0)+(((t=n.match(yme))==null?void 0:t.length)||0)>0}const nK="number",rK="color",Bme="var",wme="var(",pF="${}",Cme=/var\s*\(\s*--(?:[\w-]+\s*|[\w-]+\s*,(?:\s*[^)(\s]|\s*\((?:[^)(]|\([^)(]*\))*\))+\s*)\)|#[\da-f]{3,8}|(?:rgb|hsl)a?\((?:-?[\d.]+%?[,\s]+){2}-?[\d.]+%?\s*(?:[,/]\s*)?(?:\b\d+(?:\.\d+)?|\.\d+)?%?\)|-?(?:\d+(?:\.\d+)?|\.\d+)/giu;function pg(n){const e=n.toString(),t=[],r={color:[],number:[],var:[]},s=[];let a=0;const l=e.replace(Cme,c=>(Ps.test(c)?(r.color.push(a),s.push(rK),t.push(Ps.parse(c))):c.startsWith(wme)?(r.var.push(a),s.push(Bme),t.push(c)):(r.number.push(a),s.push(nK),t.push(parseFloat(c))),++a,pF)).split(pF);return{values:t,split:l,indexes:r,types:s}}function Eme(n){return pg(n).values}function sK({split:n,types:e}){const t=n.length;return r=>{let s="";for(let a=0;a<t;a++)if(s+=n[a],r[a]!==void 0){const o=e[a];o===nK?s+=Hb(r[a]):o===rK?s+=Ps.transform(r[a]):s+=r[a]}return s}}function Sme(n){return sK(pg(n))}const Tme=n=>typeof n=="number"?0:Ps.test(n)?Ps.getAnimatableNone(n):n,Ame=(n,e)=>typeof n=="number"?e!=null&&e.trim().endsWith("/")?n:0:Tme(n);function kme(n){const e=pg(n);return sK(e)(e.values.map((r,s)=>Ame(r,e.split[s])))}const Vl={test:vme,parse:Eme,createTransformer:Sme,getAnimatableNone:kme};function Mk(n,e,t){return t<0&&(t+=1),t>1&&(t-=1),t<1/6?n+(e-n)*6*t:t<1/2?e:t<2/3?n+(e-n)*(2/3-t)*6:n}function Nme({hue:n,saturation:e,lightness:t,alpha:r}){n/=360,e/=100,t/=100;let s=0,a=0,o=0;if(!e)s=a=o=t;else{const l=t<.5?t*(1+e):t+e-t*e,c=2*t-l;s=Mk(c,l,n+1/3),a=Mk(c,l,n),o=Mk(c,l,n-1/3)}return{red:Math.round(s*255),green:Math.round(a*255),blue:Math.round(o*255),alpha:r}}function hE(n,e){return t=>t>0?e:n}const mr=(n,e,t)=>n+(e-n)*t,Fk=(n,e,t)=>{const r=n*n,s=t*(e*e-r)+r;return s<0?0:Math.sqrt(s)},_me=[Y_,Zf,w0],Ime=n=>_me.find(e=>e.test(n));function gF(n){const e=Ime(n);if(!e)return!1;let t=e.parse(n);return e===w0&&(t=Nme(t)),t}const xF=(n,e)=>{const t=gF(n),r=gF(e);if(!t||!r)return hE(n,e);const s={...t};return a=>(s.red=Fk(t.red,r.red,a),s.green=Fk(t.green,r.green,a),s.blue=Fk(t.blue,r.blue,a),s.alpha=mr(t.alpha,r.alpha,a),Zf.transform(s))},Q_=new Set(["none","hidden"]);function Dme(n,e){return Q_.has(n)?t=>t<=0?n:e:t=>t>=1?e:n}function jme(n,e){return t=>mr(n,e,t)}function A2(n){return typeof n=="number"?jme:typeof n=="string"?E2(n)?hE:Ps.test(n)?xF:Lme:Array.isArray(n)?aK:typeof n=="object"?Ps.test(n)?xF:Rme:hE}function aK(n,e){const t=[...n],r=t.length,s=n.map((a,o)=>A2(a)(a,e[o]));return a=>{for(let o=0;o<r;o++)t[o]=s[o](a);return t}}function Rme(n,e){const t={...n,...e},r={};for(const s in t)n[s]!==void 0&&e[s]!==void 0&&(r[s]=A2(n[s])(n[s],e[s]));return s=>{for(const a in r)t[a]=r[a](s);return t}}function Pme(n,e){const t=[],r={color:0,var:0,number:0};for(let s=0;s<e.values.length;s++){const a=e.types[s],o=n.indexes[a][r[a]],l=n.values[o]??0;t[s]=l,r[a]++}return t}const Lme=(n,e)=>{const t=Vl.createTransformer(e),r=pg(n),s=pg(e);return r.indexes.var.length===s.indexes.var.length&&r.indexes.color.length===s.indexes.color.length&&r.indexes.number.length>=s.indexes.number.length?Q_.has(n)&&!s.values.length||Q_.has(e)&&!r.values.length?Dme(n,e):bv(aK(Pme(r,s),s.values),t):hE(n,e)};function iK(n,e,t){return typeof n=="number"&&typeof e=="number"&&typeof t=="number"?mr(n,e,t):A2(n)(n,e)}const Ome=n=>{const e=({timestamp:t})=>n(t);return{start:(t=!0)=>pr.update(e,t),stop:()=>Mh(e),now:()=>_a.isProcessing?_a.timestamp:ui.now()}},oK=(n,e,t=10)=>{let r="";const s=Math.max(Math.round(e/t),2);for(let a=0;a<s;a++)r+=Math.round(n(a/(s-1))*1e4)/1e4+", ";return`linear(${r.substring(0,r.length-2)})`},fE=2e4;function k2(n){let e=0;const t=50;let r=n.next(e);for(;!r.done&&e<fE;)e+=t,r=n.next(e);return e>=fE?1/0:e}function Mme(n,e=100,t){const r=t({...n,keyframes:[0,e]}),s=Math.min(k2(r),fE);return{type:"keyframes",ease:a=>r.next(s*a).value/e,duration:Yo(s)}}const ls={stiffness:100,damping:10,mass:1,velocity:0,duration:800,bounce:.3,visualDuration:.3,restSpeed:{granular:.01,default:2},restDelta:{granular:.005,default:.5},minDuration:.01,maxDuration:10,minDamping:.05,maxDamping:1};function J_(n,e){return n*Math.sqrt(1-e*e)}const Fme=12;function Ume(n,e,t){let r=t;for(let s=1;s<Fme;s++)r=r-n(r)/e(r);return r}const Uk=.001;function Vme({duration:n=ls.duration,bounce:e=ls.bounce,velocity:t=ls.velocity,mass:r=ls.mass}){let s,a,o=1-e;o=Uc(ls.minDamping,ls.maxDamping,o),n=Uc(ls.minDuration,ls.maxDuration,Yo(n)),o<1?(s=d=>{const h=d*o,m=h*n,p=h-t,x=J_(d,o),y=Math.exp(-m);return Uk-p/x*y},a=d=>{const m=d*o*n,p=m*t+t,x=Math.pow(o,2)*Math.pow(d,2)*n,y=Math.exp(-m),v=J_(Math.pow(d,2),o);return(-s(d)+Uk>0?-1:1)*((p-x)*y)/v}):(s=d=>{const h=Math.exp(-d*n),m=(d-t)*n+1;return-Uk+h*m},a=d=>{const h=Math.exp(-d*n),m=(t-d)*(n*n);return h*m});const l=5/n,c=Ume(s,a,l);if(n=wo(n),isNaN(c))return{stiffness:ls.stiffness,damping:ls.damping,duration:n};{const d=Math.pow(c,2)*r;return{stiffness:d,damping:o*2*Math.sqrt(r*d),duration:n}}}const Gme=["duration","bounce"],$me=["stiffness","damping","mass"];function bF(n,e){return e.some(t=>n[t]!==void 0)}function Hme(n){let e={velocity:ls.velocity,stiffness:ls.stiffness,damping:ls.damping,mass:ls.mass,isResolvedFromDuration:!1,...n};if(!bF(n,$me)&&bF(n,Gme))if(e.velocity=0,n.visualDuration){const t=n.visualDuration,r=2*Math.PI/(t*1.2),s=r*r,a=2*Uc(.05,1,1-(n.bounce||0))*Math.sqrt(s);e={...e,mass:ls.mass,stiffness:s,damping:a}}else{const t=Vme({...n,velocity:0});e={...e,...t,mass:ls.mass},e.isResolvedFromDuration=!0}return e}function mE(n=ls.visualDuration,e=ls.bounce){const t=typeof n!="object"?{visualDuration:n,keyframes:[0,1],bounce:e}:n;let{restSpeed:r,restDelta:s}=t;const a=t.keyframes[0],o=t.keyframes[t.keyframes.length-1],l={done:!1,value:a},{stiffness:c,damping:d,mass:h,duration:m,velocity:p,isResolvedFromDuration:x}=Hme({...t,velocity:-Yo(t.velocity||0)}),y=p||0,v=d/(2*Math.sqrt(c*h)),B=o-a,E=Yo(Math.sqrt(c/h)),N=Math.abs(B)<5;r||(r=N?ls.restSpeed.granular:ls.restSpeed.default),s||(s=N?ls.restDelta.granular:ls.restDelta.default);let T,k,P,R,_,I;if(v<1)P=J_(E,v),R=(y+v*E*B)/P,T=j=>{const O=Math.exp(-v*E*j);return o-O*(R*Math.sin(P*j)+B*Math.cos(P*j))},_=v*E*R+B*P,I=v*E*B-R*P,k=j=>Math.exp(-v*E*j)*(_*Math.sin(P*j)+I*Math.cos(P*j));else if(v===1){T=O=>o-Math.exp(-E*O)*(B+(y+E*B)*O);const j=y+E*B;k=O=>Math.exp(-E*O)*(E*j*O-y)}else{const j=E*Math.sqrt(v*v-1);T=ee=>{const ie=Math.exp(-v*E*ee),G=Math.min(j*ee,300);return o-ie*((y+v*E*B)*Math.sinh(G)+j*B*Math.cosh(G))/j};const O=(y+v*E*B)/j,M=v*E*O-B*j,U=v*E*B-O*j;k=ee=>{const ie=Math.exp(-v*E*ee),G=Math.min(j*ee,300);return ie*(M*Math.sinh(G)+U*Math.cosh(G))}}const D={calculatedDuration:x&&m||null,velocity:j=>wo(k(j)),next:j=>{if(!x&&v<1){const M=Math.exp(-v*E*j),U=Math.sin(P*j),ee=Math.cos(P*j),ie=o-M*(R*U+B*ee),G=wo(M*(_*U+I*ee));return l.done=Math.abs(G)<=r&&Math.abs(o-ie)<=s,l.value=l.done?o:ie,l}const O=T(j);if(x)l.done=j>=m;else{const M=wo(k(j));l.done=Math.abs(M)<=r&&Math.abs(o-O)<=s}return l.value=l.done?o:O,l},toString:()=>{const j=Math.min(k2(D),fE),O=oK(M=>D.next(j*M).value,j,30);return j+"ms "+O},toTransition:()=>{}};return D}mE.applyToOptions=n=>{const e=Mme(n,100,mE);return n.ease=e.ease,n.duration=wo(e.duration),n.type="keyframes",n};const zme=5;function lK(n,e,t){const r=Math.max(e-zme,0);return Vq(t-n(r),e-r)}function X_({keyframes:n,velocity:e=0,power:t=.8,timeConstant:r=325,bounceDamping:s=10,bounceStiffness:a=500,modifyTarget:o,min:l,max:c,restDelta:d=.5,restSpeed:h}){const m=n[0],p={done:!1,value:m},x=I=>l!==void 0&&I<l||c!==void 0&&I>c,y=I=>l===void 0?c:c===void 0||Math.abs(l-I)<Math.abs(c-I)?l:c;let v=t*e;const B=m+v,E=o===void 0?B:o(B);E!==B&&(v=E-m);const N=I=>-v*Math.exp(-I/r),T=I=>E+N(I),k=I=>{const D=N(I),j=T(I);p.done=Math.abs(D)<=d,p.value=p.done?E:j};let P,R;const _=I=>{x(p.value)&&(P=I,R=mE({keyframes:[p.value,y(p.value)],velocity:lK(T,I,p.value),damping:s,stiffness:a,restDelta:d,restSpeed:h}))};return _(0),{calculatedDuration:null,next:I=>{let D=!1;return!R&&P===void 0&&(D=!0,k(I),_(I)),P!==void 0&&I>=P?R.next(I-P):(!D&&k(I),p)}}}function qme(n,e,t){const r=[],s=t||Oh.mix||iK,a=n.length-1;for(let o=0;o<a;o++){let l=s(n[o],n[o+1]);if(e){const c=Array.isArray(e)?e[o]||el:e;l=bv(c,l)}r.push(l)}return r}function Kme(n,e,{clamp:t=!0,ease:r,mixer:s}={}){const a=n.length;if(v2(a===e.length),a===1)return()=>e[0];if(a===2&&e[0]===e[1])return()=>e[1];const o=n[0]===n[1];n[0]>n[a-1]&&(n=[...n].reverse(),e=[...e].reverse());const l=qme(e,r,s),c=l.length,d=h=>{if(o&&h<n[0])return e[0];let m=0;if(c>1)for(;m<n.length-2&&!(h<n[m+1]);m++);const p=by(n[m],n[m+1],h);return l[m](p)};return t?h=>d(Uc(n[0],n[a-1],h)):d}function Wme(n,e){const t=n[n.length-1];for(let r=1;r<=e;r++){const s=by(0,e,r);n.push(mr(t,1,s))}}function Yme(n){const e=[0];return Wme(e,n.length-1),e}function Qme(n,e){return n.map(t=>t*e)}function Jme(n,e){return n.map(()=>e||Qq).splice(0,n.length-1)}function zb({duration:n=300,keyframes:e,times:t,ease:r="easeInOut"}){const s=ame(r)?r.map(hF):hF(r),a={done:!1,value:e[0]},o=Qme(t&&t.length===e.length?t:Yme(e),n),l=Kme(o,e,{ease:Array.isArray(s)?s:Jme(e,s)});return{calculatedDuration:n,next:c=>(a.value=l(c),a.done=c>=n,a)}}const Xme=n=>n!==null;function oS(n,{repeat:e,repeatType:t="loop"},r,s=1){const a=n.filter(Xme),l=s<0||e&&t!=="loop"&&e%2===1?0:a.length-1;return!l||r===void 0?a[l]:r}const Zme={decay:X_,inertia:X_,tween:zb,keyframes:zb,spring:mE};function cK(n){typeof n.type=="string"&&(n.type=Zme[n.type])}class N2{constructor(){this.updateFinished()}get finished(){return this._finished}updateFinished(){this._finished=new Promise(e=>{this.resolve=e})}notifyFinished(){this.resolve()}then(e,t){return this.finished.then(e,t)}}const epe=n=>n/100;class pE extends N2{constructor(e){super(),this.state="idle",this.startTime=null,this.isStopped=!1,this.currentTime=0,this.holdTime=null,this.playbackSpeed=1,this.delayState={done:!1,value:void 0},this.stop=()=>{var r,s;const{motionValue:t}=this.options;t&&t.updatedAt!==ui.now()&&this.tick(ui.now()),this.isStopped=!0,this.state!=="idle"&&(this.teardown(),(s=(r=this.options).onStop)==null||s.call(r))},this.options=e,this.initAnimation(),this.play(),e.autoplay===!1&&this.pause()}initAnimation(){const{options:e}=this;cK(e);const{type:t=zb,repeat:r=0,repeatDelay:s=0,repeatType:a,velocity:o=0}=e;let{keyframes:l}=e;const c=t||zb;c!==zb&&typeof l[0]!="number"&&(this.mixKeyframes=bv(epe,iK(l[0],l[1])),l=[0,100]);const d=c({...e,keyframes:l});a==="mirror"&&(this.mirroredGenerator=c({...e,keyframes:[...l].reverse(),velocity:-o})),d.calculatedDuration===null&&(d.calculatedDuration=k2(d));const{calculatedDuration:h}=d;this.calculatedDuration=h,this.resolvedDuration=h+s,this.totalDuration=this.resolvedDuration*(r+1)-s,this.generator=d}updateTime(e){const t=Math.round(e-this.startTime)*this.playbackSpeed;this.holdTime!==null?this.currentTime=this.holdTime:this.currentTime=t}tick(e,t=!1){const{generator:r,totalDuration:s,mixKeyframes:a,mirroredGenerator:o,resolvedDuration:l,calculatedDuration:c}=this;if(this.startTime===null)return r.next(0);const{delay:d=0,keyframes:h,repeat:m,repeatType:p,repeatDelay:x,type:y,onUpdate:v,finalKeyframe:B}=this.options;this.speed>0?this.startTime=Math.min(this.startTime,e):this.speed<0&&(this.startTime=Math.min(e-s/this.speed,this.startTime)),t?this.currentTime=e:this.updateTime(e);const E=this.currentTime-d*(this.playbackSpeed>=0?1:-1),N=this.playbackSpeed>=0?E<0:E>s;this.currentTime=Math.max(E,0),this.state==="finished"&&this.holdTime===null&&(this.currentTime=s);let T=this.currentTime,k=r;if(m){const I=Math.min(this.currentTime,s)/l;let D=Math.floor(I),j=I%1;!j&&I>=1&&(j=1),j===1&&D--,D=Math.min(D,m+1),!!(D%2)&&(p==="reverse"?(j=1-j,x&&(j-=x/l)):p==="mirror"&&(k=o)),T=Uc(0,1,j)*l}let P;N?(this.delayState.value=h[0],P=this.delayState):P=k.next(T),a&&!N&&(P.value=a(P.value));let{done:R}=P;!N&&c!==null&&(R=this.playbackSpeed>=0?this.currentTime>=s:this.currentTime<=0);const _=this.holdTime===null&&(this.state==="finished"||this.state==="running"&&R);return _&&y!==X_&&(P.value=oS(h,this.options,B,this.speed)),v&&v(P.value),_&&this.finish(),P}then(e,t){return this.finished.then(e,t)}get duration(){return Yo(this.calculatedDuration)}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Yo(e)}get time(){return Yo(this.currentTime)}set time(e){e=wo(e),this.currentTime=e,this.startTime===null||this.holdTime!==null||this.playbackSpeed===0?this.holdTime=e:this.driver&&(this.startTime=this.driver.now()-e/this.playbackSpeed),this.driver?this.driver.start(!1):(this.startTime=0,this.state="paused",this.holdTime=e,this.tick(e))}getGeneratorVelocity(){const e=this.currentTime;if(e<=0)return this.options.velocity||0;if(this.generator.velocity)return this.generator.velocity(e);const t=this.generator.next(e).value;return lK(r=>this.generator.next(r).value,e,t)}get speed(){return this.playbackSpeed}set speed(e){const t=this.playbackSpeed!==e;t&&this.driver&&this.updateTime(ui.now()),this.playbackSpeed=e,t&&this.driver&&(this.time=Yo(this.currentTime))}play(){var s,a;if(this.isStopped)return;const{driver:e=Ome,startTime:t}=this.options;this.driver||(this.driver=e(o=>this.tick(o))),(a=(s=this.options).onPlay)==null||a.call(s);const r=this.driver.now();this.state==="finished"?(this.updateFinished(),this.startTime=r):this.holdTime!==null?this.startTime=r-this.holdTime:this.startTime||(this.startTime=t??r),this.state==="finished"&&this.speed<0&&(this.startTime+=this.calculatedDuration),this.holdTime=null,this.state="running",this.driver.start()}pause(){this.state="paused",this.updateTime(ui.now()),this.holdTime=this.currentTime}complete(){this.state!=="running"&&this.play(),this.state="finished",this.holdTime=null}finish(){var e,t;this.notifyFinished(),this.teardown(),this.state="finished",(t=(e=this.options).onComplete)==null||t.call(e)}cancel(){var e,t;this.holdTime=null,this.startTime=0,this.tick(0),this.teardown(),(t=(e=this.options).onCancel)==null||t.call(e)}teardown(){this.state="idle",this.stopDriver(),this.startTime=this.holdTime=null}stopDriver(){this.driver&&(this.driver.stop(),this.driver=void 0)}sample(e){return this.startTime=0,this.tick(e,!0)}attachTimeline(e){var t;return this.options.allowFlatten&&(this.options.type="keyframes",this.options.ease="linear",this.initAnimation()),(t=this.driver)==null||t.stop(),e.observe(this)}}function tpe(n){for(let e=1;e<n.length;e++)n[e]??(n[e]=n[e-1])}const em=n=>n*180/Math.PI,Z_=n=>{const e=em(Math.atan2(n[1],n[0]));return eI(e)},npe={x:4,y:5,translateX:4,translateY:5,scaleX:0,scaleY:3,scale:n=>(Math.abs(n[0])+Math.abs(n[3]))/2,rotate:Z_,rotateZ:Z_,skewX:n=>em(Math.atan(n[1])),skewY:n=>em(Math.atan(n[2])),skew:n=>(Math.abs(n[1])+Math.abs(n[2]))/2},eI=n=>(n=n%360,n<0&&(n+=360),n),yF=Z_,vF=n=>Math.sqrt(n[0]*n[0]+n[1]*n[1]),BF=n=>Math.sqrt(n[4]*n[4]+n[5]*n[5]),rpe={x:12,y:13,z:14,translateX:12,translateY:13,translateZ:14,scaleX:vF,scaleY:BF,scale:n=>(vF(n)+BF(n))/2,rotateX:n=>eI(em(Math.atan2(n[6],n[5]))),rotateY:n=>eI(em(Math.atan2(-n[2],n[0]))),rotateZ:yF,rotate:yF,skewX:n=>em(Math.atan(n[4])),skewY:n=>em(Math.atan(n[1])),skew:n=>(Math.abs(n[1])+Math.abs(n[4]))/2};function tI(n){return n.includes("scale")?1:0}function nI(n,e){if(!n||n==="none")return tI(e);const t=n.match(/^matrix3d\(([-\d.e\s,]+)\)$/u);let r,s;if(t)r=rpe,s=t;else{const l=n.match(/^matrix\(([-\d.e\s,]+)\)$/u);r=npe,s=l}if(!s)return tI(e);const a=r[e],o=s[1].split(",").map(ape);return typeof a=="function"?a(o):o[a]}const spe=(n,e)=>{const{transform:t="none"}=getComputedStyle(n);return nI(t,e)};function ape(n){return parseFloat(n.trim())}const Yg=["transformPerspective","x","y","z","translateX","translateY","translateZ","scale","scaleX","scaleY","rotate","rotateX","rotateY","rotateZ","skew","skewX","skewY"],Qg=new Set([...Yg,"pathRotation"]),wF=n=>n===Wg||n===xt,ipe=new Set(["x","y","z"]),ope=Yg.filter(n=>!ipe.has(n));function lpe(n){const e=[];return ope.forEach(t=>{const r=n.getValue(t);r!==void 0&&(e.push([t,r.get()]),r.set(t.startsWith("scale")?1:0))}),e}const uh={width:({x:n},{paddingLeft:e="0",paddingRight:t="0",boxSizing:r})=>{const s=n.max-n.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(t)},height:({y:n},{paddingTop:e="0",paddingBottom:t="0",boxSizing:r})=>{const s=n.max-n.min;return r==="border-box"?s:s-parseFloat(e)-parseFloat(t)},top:(n,{top:e})=>parseFloat(e),left:(n,{left:e})=>parseFloat(e),bottom:({y:n},{top:e})=>parseFloat(e)+(n.max-n.min),right:({x:n},{left:e})=>parseFloat(e)+(n.max-n.min),x:(n,{transform:e})=>nI(e,"x"),y:(n,{transform:e})=>nI(e,"y")};uh.translateX=uh.x;uh.translateY=uh.y;const fm=new Set;let rI=!1,sI=!1,aI=!1;function dK(){if(sI){const n=Array.from(fm).filter(r=>r.needsMeasurement),e=new Set(n.map(r=>r.element)),t=new Map;e.forEach(r=>{const s=lpe(r);s.length&&(t.set(r,s),r.render())}),n.forEach(r=>r.measureInitialState()),e.forEach(r=>{r.render();const s=t.get(r);s&&s.forEach(([a,o])=>{var l;(l=r.getValue(a))==null||l.set(o)})}),n.forEach(r=>r.measureEndState()),n.forEach(r=>{r.suspendedScrollY!==void 0&&window.scrollTo(0,r.suspendedScrollY)})}sI=!1,rI=!1,fm.forEach(n=>n.complete(aI)),fm.clear()}function uK(){fm.forEach(n=>{n.readKeyframes(),n.needsMeasurement&&(sI=!0)})}function cpe(){aI=!0,uK(),dK(),aI=!1}class _2{constructor(e,t,r,s,a,o=!1){this.state="pending",this.isAsync=!1,this.needsMeasurement=!1,this.unresolvedKeyframes=[...e],this.onComplete=t,this.name=r,this.motionValue=s,this.element=a,this.isAsync=o}scheduleResolve(){this.state="scheduled",this.isAsync?(fm.add(this),rI||(rI=!0,pr.read(uK),pr.resolveKeyframes(dK))):(this.readKeyframes(),this.complete())}readKeyframes(){const{unresolvedKeyframes:e,name:t,element:r,motionValue:s}=this;if(e[0]===null){const a=s==null?void 0:s.get(),o=e[e.length-1];if(a!==void 0)e[0]=a;else if(r&&t){const l=r.readValue(t,o);l!=null&&(e[0]=l)}e[0]===void 0&&(e[0]=o),s&&a===void 0&&s.set(e[0])}tpe(e)}setFinalKeyframe(){}measureInitialState(){}renderEndStyles(){}measureEndState(){}complete(e=!1){this.state="complete",this.onComplete(this.unresolvedKeyframes,this.finalKeyframe,e),fm.delete(this)}cancel(){this.state==="scheduled"&&(fm.delete(this),this.state="pending")}resume(){this.state==="pending"&&this.scheduleResolve()}}const dpe=n=>n.startsWith("--");function hK(n,e,t){dpe(e)?n.style.setProperty(e,t):n.style[e]=t}const upe={};function fK(n,e){const t=Uq(n);return()=>upe[e]??t()}const hpe=fK(()=>window.ScrollTimeline!==void 0,"scrollTimeline"),mK=fK(()=>{try{document.createElement("div").animate({opacity:0},{easing:"linear(0, 1)"})}catch{return!1}return!0},"linearEasing"),Sb=([n,e,t,r])=>`cubic-bezier(${n}, ${e}, ${t}, ${r})`,CF={linear:"linear",ease:"ease",easeIn:"ease-in",easeOut:"ease-out",easeInOut:"ease-in-out",circIn:Sb([0,.65,.55,1]),circOut:Sb([.55,0,1,.45]),backIn:Sb([.31,.01,.66,-.59]),backOut:Sb([.33,1.53,.69,.99])};function pK(n,e){if(n)return typeof n=="function"?mK()?oK(n,e):"ease-out":Jq(n)?Sb(n):Array.isArray(n)?n.map(t=>pK(t,e)||CF.easeOut):CF[n]}function fpe(n,e,t,{delay:r=0,duration:s=300,repeat:a=0,repeatType:o="loop",ease:l="easeOut",times:c}={},d=void 0){const h={[e]:t};c&&(h.offset=c);const m=pK(l,s);Array.isArray(m)&&(h.easing=m);const p={delay:r,duration:s,easing:Array.isArray(m)?"linear":m,fill:"both",iterations:a+1,direction:o==="reverse"?"alternate":"normal"};return d&&(p.pseudoElement=d),n.animate(h,p)}function gK(n){return typeof n=="function"&&"applyToOptions"in n}function mpe({type:n,...e}){return gK(n)&&mK()?n.applyToOptions(e):(e.duration??(e.duration=300),e.ease??(e.ease="easeOut"),e)}class xK extends N2{constructor(e){if(super(),this.finishedTime=null,this.isStopped=!1,this.manualStartTime=null,!e)return;const{element:t,name:r,keyframes:s,pseudoElement:a,allowFlatten:o=!1,finalKeyframe:l,onComplete:c}=e;this.isPseudoElement=!!a,this.allowFlatten=o,this.options=e,v2(typeof e.type!="string");const d=mpe(e);this.animation=fpe(t,r,s,d,a),d.autoplay===!1&&this.animation.pause(),this.animation.onfinish=()=>{if(this.finishedTime=this.time,!a){const h=oS(s,this.options,l,this.speed);this.updateMotionValue&&this.updateMotionValue(h),hK(t,r,h),this.animation.cancel()}c==null||c(),this.notifyFinished()}}play(){this.isStopped||(this.manualStartTime=null,this.animation.play(),this.state==="finished"&&this.updateFinished())}pause(){this.animation.pause()}complete(){var e,t;(t=(e=this.animation).finish)==null||t.call(e)}cancel(){try{this.animation.cancel()}catch{}}stop(){if(this.isStopped)return;this.isStopped=!0;const{state:e}=this;e==="idle"||e==="finished"||(this.updateMotionValue?this.updateMotionValue():this.commitStyles(),this.isPseudoElement||this.cancel())}commitStyles(){var t,r,s;const e=(t=this.options)==null?void 0:t.element;!this.isPseudoElement&&(e!=null&&e.isConnected)&&((s=(r=this.animation).commitStyles)==null||s.call(r))}get duration(){var t,r;const e=((r=(t=this.animation.effect)==null?void 0:t.getComputedTiming)==null?void 0:r.call(t).duration)||0;return Yo(Number(e))}get iterationDuration(){const{delay:e=0}=this.options||{};return this.duration+Yo(e)}get time(){return Yo(Number(this.animation.currentTime)||0)}set time(e){const t=this.finishedTime!==null;this.manualStartTime=null,this.finishedTime=null,this.animation.currentTime=wo(e),t&&this.animation.pause()}get speed(){return this.animation.playbackRate}set speed(e){e<0&&(this.finishedTime=null),this.animation.playbackRate=e}get state(){return this.finishedTime!==null?"finished":this.animation.playState}get startTime(){return this.manualStartTime??Number(this.animation.startTime)}set startTime(e){this.manualStartTime=this.animation.startTime=e}attachTimeline({timeline:e,rangeStart:t,rangeEnd:r,observe:s}){var a;return this.allowFlatten&&((a=this.animation.effect)==null||a.updateTiming({easing:"linear"})),this.animation.onfinish=null,e&&hpe()?(this.animation.timeline=e,t&&(this.animation.rangeStart=t),r&&(this.animation.rangeEnd=r),el):s(this)}}const bK={anticipate:Kq,backInOut:qq,circInOut:Yq};function ppe(n){return n in bK}function gpe(n){typeof n.ease=="string"&&ppe(n.ease)&&(n.ease=bK[n.ease])}const Vk=10;class xpe extends xK{constructor(e){gpe(e),cK(e),super(e),e.startTime!==void 0&&e.autoplay!==!1&&(this.startTime=e.startTime),this.options=e}updateMotionValue(e){const{motionValue:t,onUpdate:r,onComplete:s,element:a,...o}=this.options;if(!t)return;if(e!==void 0){t.set(e);return}const l=new pE({...o,autoplay:!1}),c=Math.max(Vk,ui.now()-this.startTime),d=Uc(0,Vk,c-Vk),h=l.sample(c).value,{name:m}=this.options;a&&m&&hK(a,m,h),t.setWithVelocity(l.sample(Math.max(0,c-d)).value,h,d),l.stop()}}const EF=(n,e)=>e==="zIndex"?!1:!!(typeof n=="number"||Array.isArray(n)||typeof n=="string"&&(Vl.test(n)||n==="0")&&!n.startsWith("url("));function bpe(n){const e=n[0];if(n.length===1)return!0;for(let t=0;t<n.length;t++)if(n[t]!==e)return!0}function ype(n,e,t,r){const s=n[0];if(s===null)return!1;if(e==="display"||e==="visibility")return!0;const a=n[n.length-1],o=EF(s,e),l=EF(a,e);return!o||!l?!1:bpe(n)||(t==="spring"||gK(t))&&r}function iI(n){n.duration=0,n.type="keyframes"}const yK=new Set(["opacity","clipPath","filter","transform"]),vpe=/^(?:oklch|oklab|lab|lch|color|color-mix|light-dark)\(/;function Bpe(n){for(let e=0;e<n.length;e++)if(typeof n[e]=="string"&&vpe.test(n[e]))return!0;return!1}const wpe=new Set(["color","backgroundColor","outlineColor","fill","stroke","borderColor","borderTopColor","borderRightColor","borderBottomColor","borderLeftColor"]),Cpe=Uq(()=>Object.hasOwnProperty.call(Element.prototype,"animate"));function Epe(n){var m;const{motionValue:e,name:t,repeatDelay:r,repeatType:s,damping:a,type:o,keyframes:l}=n;if(!(((m=e==null?void 0:e.owner)==null?void 0:m.current)instanceof HTMLElement))return!1;const{onUpdate:d,transformTemplate:h}=e.owner.getProps();return Cpe()&&t&&(yK.has(t)||wpe.has(t)&&Bpe(l))&&(t!=="transform"||!h)&&!d&&!r&&s!=="mirror"&&a!==0&&o!=="inertia"}const Spe=40;class Tpe extends N2{constructor({autoplay:e=!0,delay:t=0,type:r="keyframes",repeat:s=0,repeatDelay:a=0,repeatType:
4118o="loop",keyframes:l,name:c,motionValue:d,element:h,...m}){var y;super(),this.stop=()=>{var v,B;this._animation&&(this._animation.stop(),(v=this.stopTimeline)==null||v.call(this)),(B=this.keyframeResolver)==null||B.cancel()},this.createdAt=ui.now();const p={autoplay:e,delay:t,type:r,repeat:s,repeatDelay:a,repeatType:o,name:c,motionValue:d,element:h,...m},x=(h==null?void 0:h.KeyframeResolver)||_2;this.keyframeResolver=new x(l,(v,B,E)=>this.onKeyframesResolved(v,B,p,!E),c,d,h),(y=this.keyframeResolver)==null||y.scheduleResolve()}onKeyframesResolved(e,t,r,s){var E,N;this.keyframeResolver=void 0;const{name:a,type:o,velocity:l,delay:c,isHandoff:d,onUpdate:h}=r;this.resolvedAt=ui.now();let m=!0;ype(e,a,o,l)||(m=!1,(Oh.instantAnimations||!c)&&(h==null||h(oS(e,r,t))),e[0]=e[e.length-1],iI(r),r.repeat=0);const x={startTime:s?this.resolvedAt?this.resolvedAt-this.createdAt>Spe?this.resolvedAt:this.createdAt:this.createdAt:void 0,finalKeyframe:t,...r,keyframes:e},y=m&&!d&&Epe(x),v=(N=(E=x.motionValue)==null?void 0:E.owner)==null?void 0:N.current;let B;if(y)try{B=new xpe({...x,element:v})}catch{B=new pE(x)}else B=new pE(x);B.finished.then(()=>{this.notifyFinished()}).catch(el),this.pendingTimeline&&(this.stopTimeline=B.attachTimeline(this.pendingTimeline),this.pendingTimeline=void 0),this._animation=B}get finished(){return this._animation?this.animation.finished:this._finished}then(e,t){return this.finished.finally(e).then(()=>{})}get animation(){var e;return this._animation||((e=this.keyframeResolver)==null||e.resume(),cpe()),this._animation}get duration(){return this.animation.duration}get iterationDuration(){return this.animation.iterationDuration}get time(){return this.animation.time}set time(e){this.animation.time=e}get speed(){return this.animation.speed}get state(){return this.animation.state}set speed(e){this.animation.speed=e}get startTime(){return this.animation.startTime}attachTimeline(e){return this._animation?this.stopTimeline=this.animation.attachTimeline(e):this.pendingTimeline=e,()=>this.stop()}play(){this.animation.play()}pause(){this.animation.pause()}complete(){this.animation.complete()}cancel(){var e;this._animation&&this.animation.cancel(),(e=this.keyframeResolver)==null||e.cancel()}}function vK(n,e,t,r=0,s=1){const a=Array.from(n).sort((d,h)=>d.sortNodePosition(h)).indexOf(e),o=n.size,l=(o-1)*r;return typeof t=="function"?t(a,o):s===1?a*r:l-a*r}const SF=30,Ape=n=>!isNaN(parseFloat(n));class kpe{constructor(e,t={}){this.canTrackVelocity=null,this.events={},this.updateAndNotify=r=>{var a;const s=ui.now();if(this.updatedAt!==s&&this.setPrevFrameValue(),this.prev=this.current,this.setCurrent(r),this.current!==this.prev&&((a=this.events.change)==null||a.notify(this.current),this.dependents))for(const o of this.dependents)o.dirty()},this.hasAnimated=!1,this.setCurrent(e),this.owner=t.owner}setCurrent(e){this.current=e,this.updatedAt=ui.now(),this.canTrackVelocity===null&&e!==void 0&&(this.canTrackVelocity=Ape(this.current))}setPrevFrameValue(e=this.current){this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt}onChange(e){return this.on("change",e)}on(e,t){this.events[e]||(this.events[e]=new B2);const r=this.events[e].add(t);return e==="change"?()=>{r(),pr.read(()=>{this.events.change.getSize()||this.stop()})}:r}clearListeners(){for(const e in this.events)this.events[e].clear()}attach(e,t){this.passiveEffect=e,this.stopPassiveEffect=t}set(e){this.passiveEffect?this.passiveEffect(e,this.updateAndNotify):this.updateAndNotify(e)}setWithVelocity(e,t,r){this.set(t),this.prev=void 0,this.prevFrameValue=e,this.prevUpdatedAt=this.updatedAt-r}jump(e,t=!0){this.updateAndNotify(e),this.prev=e,this.prevUpdatedAt=this.prevFrameValue=void 0,t&&this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}dirty(){var e;(e=this.events.change)==null||e.notify(this.current)}addDependent(e){this.dependents||(this.dependents=new Set),this.dependents.add(e)}removeDependent(e){this.dependents&&this.dependents.delete(e)}get(){return this.current}getPrevious(){return this.prev}getVelocity(){const e=ui.now();if(!this.canTrackVelocity||this.prevFrameValue===void 0||e-this.updatedAt>SF)return 0;const t=Math.min(this.updatedAt-this.prevUpdatedAt,SF);return Vq(parseFloat(this.current)-parseFloat(this.prevFrameValue),t)}start(e){return this.stop(),new Promise(t=>{this.hasAnimated=!0,this.animation=e(t),this.events.animationStart&&this.events.animationStart.notify()}).then(()=>{this.events.animationComplete&&this.events.animationComplete.notify(),this.clearAnimation()})}stop(){this.animation&&(this.animation.stop(),this.events.animationCancel&&this.events.animationCancel.notify()),this.clearAnimation()}isAnimating(){return!!this.animation}clearAnimation(){delete this.animation}destroy(){var e,t;(e=this.dependents)==null||e.clear(),(t=this.events.destroy)==null||t.notify(),this.clearListeners(),this.stop(),this.stopPassiveEffect&&this.stopPassiveEffect()}}function gg(n,e){return new kpe(n,e)}function BK(n,e){if(n!=null&&n.inherit&&e){const{inherit:t,...r}=n;return{...e,...r}}return n}function I2(n,e){const t=(n==null?void 0:n[e])??(n==null?void 0:n.default)??n;return t!==n?BK(t,n):t}const Npe={type:"spring",stiffness:500,damping:25,restSpeed:10},_pe=n=>({type:"spring",stiffness:550,damping:n===0?2*Math.sqrt(550):30,restSpeed:10}),Ipe={type:"keyframes",duration:.8},Dpe={type:"keyframes",ease:[.25,.1,.35,1],duration:.3},jpe=(n,{keyframes:e})=>e.length>2?Ipe:Qg.has(n)?n.startsWith("scale")?_pe(e[1]):Npe:Dpe,Rpe=new Set(["when","delay","delayChildren","staggerChildren","staggerDirection","repeat","repeatType","repeatDelay","from","elapsed"]);function Ppe(n){for(const e in n)if(!Rpe.has(e))return!0;return!1}const D2=(n,e,t,r={},s,a)=>o=>{const l=I2(r,n)||{},c=l.delay||r.delay||0;let{elapsed:d=0}=r;d=d-wo(c);const h={keyframes:Array.isArray(t)?t:[null,t],ease:"easeOut",velocity:e.getVelocity(),...l,delay:-d,onUpdate:p=>{e.set(p),l.onUpdate&&l.onUpdate(p)},onComplete:()=>{o(),l.onComplete&&l.onComplete()},name:n,motionValue:e,element:a?void 0:s};Ppe(l)||Object.assign(h,jpe(n,h)),h.duration&&(h.duration=wo(h.duration)),h.repeatDelay&&(h.repeatDelay=wo(h.repeatDelay)),h.from!==void 0&&(h.keyframes[0]=h.from);let m=!1;if((h.type===!1||h.duration===0&&!h.repeatDelay)&&(iI(h),h.delay===0&&(m=!0)),(Oh.instantAnimations||Oh.skipAnimations||s!=null&&s.shouldSkipAnimations||l.skipAnimations)&&(m=!0,iI(h),h.delay=0),h.allowFlatten=!l.type&&!l.ease,m&&!a&&e.get()!==void 0){const p=oS(h.keyframes,l);if(p!==void 0){pr.update(()=>{h.onUpdate(p),h.onComplete()});return}}return l.isSync?new pE(h):new Tpe(h)},Lpe=/^var\(--(?:([\w-]+)|([\w-]+), ?([a-zA-Z\d ()%#.,-]+))\)/u;function Ope(n){const e=Lpe.exec(n);if(!e)return[,];const[,t,r,s]=e;return[`--${t??r}`,s]}function wK(n,e,t=1){const[r,s]=Ope(n);if(!r)return;const a=window.getComputedStyle(e).getPropertyValue(r);if(a){const o=a.trim();return Oq(o)?parseFloat(o):o}return E2(s)?wK(s,e,t+1):s}function TF(n){const e=[{},{}];
vendor: 58,117 bytes, line 4118
4118return n==null||n.values.forEach((t,r)=>{e[0][r]=t.get(),e[1][r]=t.getVelocity()}),e}function j2(n,e,t,r){if(typeof e=="function"){const[s,a]=TF(r);e=e(t!==void 0?t:n.custom,s,a)}if(typeof e=="string"&&(e=n.variants&&n.variants[e]),typeof e=="function"){const[s,a]=TF(r);e=e(t!==void 0?t:n.custom,s,a)}return e}function mm(n,e,t){const r=n.getProps();return j2(r,e,t!==void 0?t:r.custom,n)}const CK=new Set(["width","height","top","left","right","bottom",...Yg]),oI=n=>Array.isArray(n);function Mpe(n,e,t){n.hasValue(e)?n.getValue(e).set(t):n.addValue(e,gg(t))}function Fpe(n){return oI(n)?n[n.length-1]||0:n}function Upe(n,e){const t=mm(n,e);let{transitionEnd:r={},transition:s={},...a}=t||{};a={...a,...r};for(const o in a){const l=Fpe(a[o]);Mpe(n,o,l)}}const La=n=>!!(n&&n.getVelocity);function Vpe(n){return!!(La(n)&&n.add)}function lI(n,e){const t=n.getValue("willChange");if(Vpe(t))return t.add(e);if(!t&&Oh.WillChange){const r=new Oh.WillChange("auto");n.addValue("willChange",r),r.add(e)}}function R2(n){return n.replace(/([A-Z])/g,e=>`-${e.toLowerCase()}`)}const Gpe="framerAppearId",EK="data-"+R2(Gpe);function SK(n){return n.props[EK]}function $pe({protectedKeys:n,needsAnimating:e},t){const r=n.hasOwnProperty(t)&&e[t]!==!0;return e[t]=!1,r}function TK(n,e,{delay:t=0,transitionOverride:r,type:s}={}){let{transition:a,transitionEnd:o,...l}=e;const c=n.getDefaultTransition();a=a?BK(a,c):c;const d=a==null?void 0:a.reduceMotion,h=a==null?void 0:a.skipAnimations;r&&(a=r);const m=[],p=s&&n.animationState&&n.animationState.getState()[s],x=a==null?void 0:a.path;x&&x.animateVisualElement(n,l,a,t,m);for(const y in l){const v=n.getValue(y,n.latestValues[y]??null),B=l[y];if(B===void 0||p&&$pe(p,y))continue;const E={delay:t,...I2(a||{},y)};h&&(E.skipAnimations=!0);const N=v.get();if(N!==void 0&&!v.isAnimating()&&!Array.isArray(B)&&B===N&&!E.velocity){pr.update(()=>v.set(B));continue}let T=!1;if(window.MotionHandoffAnimation){const R=SK(n);if(R){const _=window.MotionHandoffAnimation(R,y,pr);_!==null&&(E.startTime=_,T=!0)}}lI(n,y);const k=d??n.shouldReduceMotion;v.start(D2(y,v,B,k&&CK.has(y)?{type:!1}:E,n,T));const P=v.animation;P&&m.push(P)}if(o){const y=()=>pr.update(()=>{o&&Upe(n,o)});m.length?Promise.all(m).then(y):y()}return m}function cI(n,e,t={}){var c;const r=mm(n,e,t.type==="exit"?(c=n.presenceContext)==null?void 0:c.custom:void 0);let{transition:s=n.getDefaultTransition()||{}}=r||{};t.transitionOverride&&(s=t.transitionOverride);const a=r?()=>Promise.all(TK(n,r,t)):()=>Promise.resolve(),o=n.variantChildren&&n.variantChildren.size?(d=0)=>{const{delayChildren:h=0,staggerChildren:m,staggerDirection:p}=s;return Hpe(n,e,d,h,m,p,t)}:()=>Promise.resolve(),{when:l}=s;if(l){const[d,h]=l==="beforeChildren"?[a,o]:[o,a];return d().then(()=>h())}else return Promise.all([a(),o(t.delay)])}function Hpe(n,e,t=0,r=0,s=0,a=1,o){const l=[];for(const c of n.variantChildren)c.notify("AnimationStart",e),l.push(cI(c,e,{...o,delay:t+(typeof r=="function"?0:r)+vK(n.variantChildren,c,r,s,a)}).then(()=>c.notify("AnimationComplete",e)));return Promise.all(l)}function zpe(n,e,t={}){n.notify("AnimationStart",e);let r;if(Array.isArray(e)){const s=e.map(a=>cI(n,a,t));r=Promise.all(s)}else if(typeof e=="string")r=cI(n,e,t);else{const s=typeof e=="function"?mm(n,e,t.custom):e;r=Promise.all(TK(n,s,t))}return r.then(()=>{n.notify("AnimationComplete",e)})}const qpe={test:n=>n==="auto",parse:n=>n},AK=n=>e=>e.test(n),kK=[Wg,xt,Rc,bd,bme,xme,qpe],AF=n=>kK.find(AK(n));function Kpe(n){return typeof n=="number"?n===0:n!==null?n==="none"||n==="0"||Fq(n):!0}const Wpe=new Set(["brightness","contrast","saturate","opacity"]);function Ype(n){const[e,t]=n.slice(0,-1).split("(");if(e==="drop-shadow")return n;const[r]=t.match(S2)||[];if(!r)return n;const s=t.replace(r,"");let a=Wpe.has(e)?1:0;return r!==t&&(a*=100),e+"("+a+s+")"}const Qpe=/\b([a-z-]*)\(.*?\)/gu,dI={...Vl,getAnimatableNone:n=>{const e=n.match(Qpe);return e?e.map(Ype).join(" "):n}},uI={...Vl,getAnimatableNone:n=>{const e=Vl.parse(n);return Vl.createTransformer(n)(e.map(r=>typeof r=="number"?0:typeof r=="object"?{...r,alpha:1}:r))}},kF={...Wg,transform:Math.round},Jpe={rotate:bd,pathRotation:bd,rotateX:bd,rotateY:bd,rotateZ:bd,scale:hw,scaleX:hw,scaleY:hw,scaleZ:hw,skew:bd,skewX:bd,skewY:bd,distance:xt,translateX:xt,translateY:xt,translateZ:xt,x:xt,y:xt,z:xt,perspective:xt,transformPerspective:xt,opacity:yy,originX:mF,originY:mF,originZ:xt},gE={borderWidth:xt,borderTopWidth:xt,borderRightWidth:xt,borderBottomWidth:xt,borderLeftWidth:xt,borderRadius:xt,borderTopLeftRadius:xt,borderTopRightRadius:xt,borderBottomRightRadius:xt,borderBottomLeftRadius:xt,width:xt,maxWidth:xt,height:xt,maxHeight:xt,top:xt,right:xt,bottom:xt,left:xt,inset:xt,insetBlock:xt,insetBlockStart:xt,insetBlockEnd:xt,insetInline:xt,insetInlineStart:xt,insetInlineEnd:xt,padding:xt,paddingTop:xt,paddingRight:xt,paddingBottom:xt,paddingLeft:xt,paddingBlock:xt,paddingBlockStart:xt,paddingBlockEnd:xt,paddingInline:xt,paddingInlineStart:xt,paddingInlineEnd:xt,margin:xt,marginTop:xt,marginRight:xt,marginBottom:xt,marginLeft:xt,marginBlock:xt,marginBlockStart:xt,marginBlockEnd:xt,marginInline:xt,marginInlineStart:xt,marginInlineEnd:xt,fontSize:xt,backgroundPositionX:xt,backgroundPositionY:xt,...Jpe,zIndex:kF,fillOpacity:yy,strokeOpacity:yy,numOctaves:kF},Xpe={...gE,color:Ps,backgroundColor:Ps,outlineColor:Ps,fill:Ps,stroke:Ps,borderColor:Ps,borderTopColor:Ps,borderRightColor:Ps,borderBottomColor:Ps,borderLeftColor:Ps,filter:dI,WebkitFilter:dI,mask:uI,WebkitMask:uI},NK=n=>Xpe[n],Zpe=new Set([dI,uI]);function _K(n,e){let t=NK(n);return Zpe.has(t)||(t=Vl),t.getAnimatableNone?t.getAnimatableNone(e):void 0}const e0e=new Set(["auto","none","0"]);function t0e(n,e,t){let r=0,s;for(;r<n.length&&!s;){const a=n[r];typeof a=="string"&&!e0e.has(a)&&pg(a).values.length&&(s=n[r]),r++}if(s&&t)for(const a of e)n[a]=_K(t,s)}class n0e extends _2{constructor(e,t,r,s,a){super(e,t,r,s,a,!0)}readKeyframes(){const{unresolvedKeyframes:e,element:t,name:r}=this;if(!t||!t.current)return;super.readKeyframes();for(let h=0;h<e.length;h++){let m=e[h];if(typeof m=="string"&&(m=m.trim(),E2(m))){const p=wK(m,t.current);p!==void 0&&(e[h]=p),h===e.length-1&&(this.finalKeyframe=m)}}if(this.resolveNoneKeyframes(),!CK.has(r)||e.length!==2)return;const[s,a]=e,o=AF(s),l=AF(a),c=fF(s),d=fF(a);if(c!==d&&uh[r]){this.needsMeasurement=!0;return}if(o!==l)if(wF(o)&&wF(l))for(let h=0;h<e.length;h++){const m=e[h];typeof m=="string"&&(e[h]=parseFloat(m))}else uh[r]&&(this.needsMeasurement=!0)}resolveNoneKeyframes(){const{unresolvedKeyframes:e,name:t}=this,r=[];for(let s=0;s<e.length;s++)(e[s]===null||Kpe(e[s]))&&r.push(s);r.length&&t0e(e,r,t)}measureInitialState(){const{element:e,unresolvedKeyframes:t,name:r}=this;if(!e||!e.current)return;r==="height"&&(this.suspendedScrollY=window.pageYOffset),this.measuredOrigin=uh[r](e.measureViewportBox(),window.getComputedStyle(e.current)),t[0]=this.measuredOrigin;const s=t[t.length-1];s!==void 0&&e.getValue(r,s).jump(s,!1)}measureEndState(){var l;const{element:e,name:t,unresolvedKeyframes:r}=this;if(!e||!e.current)return;const s=e.getValue(t);s&&s.jump(this.measuredOrigin,!1);const a=r.length-1,o=r[a];r[a]=uh[t](e.measureViewportBox(),window.getComputedStyle(e.current)),o!==null&&this.finalKeyframe===void 0&&(this.finalKeyframe=o),(l=this.removedTransforms)!=null&&l.length&&this.removedTransforms.forEach(([c,d])=>{e.getValue(c).set(d)}),this.resolveNoneKeyframes()}}function IK(n,e,t){if(n==null)return[];if(n instanceof EventTarget)return[n];if(typeof n=="string"){let r=document;const s=(t==null?void 0:t[n])??r.querySelectorAll(n);return s?Array.from(s):[]}return Array.from(n).filter(r=>r!=null)}const hI=(n,e)=>e&&typeof n=="number"?e.transform(n):n;function mC(n){return Mq(n)&&"offsetHeight"in n&&!("ownerSVGElement"in n)}const{schedule:P2}=Xq(queueMicrotask,!1),kl={x:!1,y:!1};function DK(){return kl.x||kl.y}function r0e(n){return n==="x"||n==="y"?kl[n]?null:(kl[n]=!0,()=>{kl[n]=!1}):kl.x||kl.y?null:(kl.x=kl.y=!0,()=>{kl.x=kl.y=!1})}function jK(n,e){const t=IK(n),r=new AbortController,s={passive:!0,...e,signal:r.signal};return[t,s,()=>r.abort()]}function s0e(n){return!(n.pointerType==="touch"||DK())}function a0e(n,e,t={}){const[r,s,a]=jK(n,t);return r.forEach(o=>{let l=!1,c=!1,d;const h=()=>{o.removeEventListener("pointerleave",y)},m=B=>{d&&(d(B),d=void 0),h()},p=B=>{l=!1,window.removeEventListener("pointerup",p),window.removeEventListener("pointercancel",p),c&&(c=!1,m(B))},x=()=>{l=!0,window.addEventListener("pointerup",p,s),window.addEventListener("pointercancel",p,s)},y=B=>{if(B.pointerType!=="touch"){if(l){c=!0;return}m(B)}},v=B=>{if(!s0e(B))return;c=!1;const E=e(o,B);typeof E=="function"&&(d=E,o.addEventListener("pointerleave",y,s))};o.addEventListener("pointerenter",v,s),o.addEventListener("pointerdown",x,s)}),a}const RK=(n,e)=>e?n===e?!0:RK(n,e.parentElement):!1,L2=n=>n.pointerType==="mouse"?typeof n.button!="number"||n.button<=0:n.isPrimary!==!1,i0e=new Set(["BUTTON","INPUT","SELECT","TEXTAREA","A"]);function o0e(n){return i0e.has(n.tagName)||n.isContentEditable===!0}const l0e=new Set(["INPUT","SELECT","TEXTAREA"]);function c0e(n){return l0e.has(n.tagName)||n.isContentEditable===!0}const pC=new WeakSet;function NF(n){return e=>{e.key==="Enter"&&n(e)}}function Gk(n,e){n.dispatchEvent(new PointerEvent("pointer"+e,{isPrimary:!0,bubbles:!0}))}const d0e=(n,e)=>{const t=n.currentTarget;if(!t)return;const r=NF(()=>{if(pC.has(t))return;Gk(t,"down");const s=NF(()=>{Gk(t,"up")}),a=()=>Gk(t,"cancel");t.addEventListener("keyup",s,e),t.addEventListener("blur",a,e)});t.addEventListener("keydown",r,e),t.addEventListener("blur",()=>t.removeEventListener("keydown",r),e)};function _F(n){return L2(n)&&!DK()}const IF=new WeakSet;function u0e(n,e,t={}){const[r,s,a]=jK(n,t),o=l=>{const c=l.currentTarget;if(!_F(l)||IF.has(l))return;pC.add(c),t.stopPropagation&&IF.add(l);const d=e(c,l),h=(x,y)=>{window.removeEventListener("pointerup",m),window.removeEventListener("pointercancel",p),pC.has(c)&&pC.delete(c),_F(x)&&typeof d=="function"&&d(x,{success:y})},m=x=>{h(x,c===window||c===document||t.useGlobalTarget||RK(c,x.target))},p=x=>{h(x,!1)};window.addEventListener("pointerup",m,s),window.addEventListener("pointercancel",p,s)};return r.forEach(l=>{(t.useGlobalTarget?window:l).addEventListener("pointerdown",o,s),mC(l)&&(l.addEventListener("focus",d=>d0e(d,s)),!o0e(l)&&!l.hasAttribute("tabindex")&&(l.tabIndex=0))}),a}function O2(n){return Mq(n)&&"ownerSVGElement"in n}const gC=new WeakMap;let Yu;const PK=(n,e,t)=>(r,s)=>s&&s[0]?s[0][n+"Size"]:O2(r)&&"getBBox"in r?r.getBBox()[e]:r[t],h0e=PK("inline","width","offsetWidth"),f0e=PK("block","height","offsetHeight");function m0e({target:n,borderBoxSize:e}){var t;(t=gC.get(n))==null||t.forEach(r=>{r(n,{get width(){return h0e(n,e)},get height(){return f0e(n,e)}})})}function p0e(n){n.forEach(m0e)}function g0e(){typeof ResizeObserver>"u"||(Yu=new ResizeObserver(p0e))}function x0e(n,e){Yu||g0e();const t=IK(n);return t.forEach(r=>{let s=gC.get(r);s||(s=new Set,gC.set(r,s)),s.add(e),Yu==null||Yu.observe(r)}),()=>{t.forEach(r=>{const s=gC.get(r);s==null||s.delete(e),s!=null&&s.size||Yu==null||Yu.unobserve(r)})}}const xC=new Set;let C0;function b0e(){C0=()=>{const n={get width(){return window.innerWidth},get height(){return window.innerHeight}};xC.forEach(e=>e(n))},window.addEventListener("resize",C0)}function y0e(n){return xC.add(n),C0||b0e(),()=>{xC.delete(n),!xC.size&&typeof C0=="function"&&(window.removeEventListener("resize",C0),C0=void 0)}}function DF(n,e){return typeof n=="function"?y0e(n):x0e(n,e)}function v0e(n){return O2(n)&&n.tagName==="svg"}const B0e=[...kK,Ps,Vl],w0e=n=>B0e.find(AK(n)),jF=()=>({translate:0,scale:1,origin:0,originPoint:0}),E0=()=>({x:jF(),y:jF()}),RF=()=>({min:0,max:0}),Hs=()=>({x:RF(),y:RF()}),C0e=new WeakMap;function lS(n){return n!==null&&typeof n=="object"&&typeof n.start=="function"}function vy(n){return typeof n=="string"||Array.isArray(n)}const M2=["animate","whileInView","whileFocus","whileHover","whileTap","whileDrag","exit"],F2=["initial",...M2];function cS(n){return lS(n.animate)||F2.some(e=>vy(n[e]))}function LK(n){return!!(cS(n)||n.variants)}function E0e(n,e,t){for(const r in e){const s=e[r],a=t[r];if(La(s))n.addValue(r,s);else if(La(a))n.addValue(r,gg(s,{owner:n}));else if(a!==s)if(n.hasValue(r)){const o=n.getValue(r);o.liveStyle===!0?o.jump(s):o.hasAnimated||o.set(s)}else{const o=n.getStaticValue(r);n.addValue(r,gg(o!==void 0?o:s,{owner:n}))}}for(const r in t)e[r]===void 0&&n.removeValue(r);return e}const fI={current:null},OK={current:!1},S0e=typeof window<"u";function T0e(){if(OK.current=!0,!!S0e)if(window.matchMedia){const n=window.matchMedia("(prefers-reduced-motion)"),e=()=>fI.current=n.matches;n.addEventListener("change",e),e()}else fI.current=!1}const PF=["AnimationStart","AnimationComplete","Update","BeforeLayoutMeasure","LayoutMeasure","LayoutAnimationStart","LayoutAnimationComplete"];let xE={};function MK(n){xE=n}function A0e(){return xE}class k0e{scrapeMotionValuesFromProps(e,t,r){return{}}constructor({parent:e,props:t,presenceContext:r,reducedMotionConfig:s,skipAnimations:a,blockInitialAnimation:o,visualState:l},c={}){this.current=null,this.children=new Set,this.isVariantNode=!1,this.isControllingVariants=!1,this.shouldReduceMotion=null,this.shouldSkipAnimations=!1,this.values=new Map,this.KeyframeResolver=_2,this.features={},this.valueSubscriptions=new Map,this.prevMotionValues={},this.hasBeenMounted=!1,this.events={},this.propEventSubscriptions={},this.notifyUpdate=()=>this.notify("Update",this.latestValues),this.render=()=>{this.current&&(this.triggerBuild(),this.renderInstance(this.current,this.renderState,this.props.style,this.projection))},this.renderScheduledAt=0,this.scheduleRender=()=>{const x=ui.now();this.renderScheduledAt<x&&(this.renderScheduledAt=x,pr.render(this.render,!1,!0))};const{latestValues:d,renderState:h}=l;this.latestValues=d,this.baseTarget={...d},this.initialValues=t.initial?{...d}:{},this.renderState=h,this.parent=e,this.props=t,this.presenceContext=r,this.depth=e?e.depth+1:0,this.reducedMotionConfig=s,this.skipAnimationsConfig=a,this.options=c,this.blockInitialAnimation=!!o,this.isControllingVariants=cS(t),this.isVariantNode=LK(t),this.isVariantNode&&(this.variantChildren=new Set),this.manuallyAnimateOnMount=!!(e&&e.current);const{willChange:m,...p}=this.scrapeMotionValuesFromProps(t,{},this);for(const x in p){const y=p[x];d[x]!==void 0&&La(y)&&y.set(d[x])}}mount(e){var t,r;if(this.hasBeenMounted)for(const s in this.initialValues)(t=this.values.get(s))==null||t.jump(this.initialValues[s]),this.latestValues[s]=this.initialValues[s];this.current=e,C0e.set(e,this),this.projection&&!this.projection.instance&&this.projection.mount(e),this.parent&&this.isVariantNode&&!this.isControllingVariants&&(this.removeFromVariantTree=this.parent.addVariantChild(this)),this.values.forEach((s,a)=>this.bindToMotionValue(a,s)),this.reducedMotionConfig==="never"?this.shouldReduceMotion=!1:this.reducedMotionConfig==="always"?this.shouldReduceMotion=!0:(OK.current||T0e(),this.shouldReduceMotion=fI.current),this.shouldSkipAnimations=this.skipAnimationsConfig??!1,(r=this.parent)==null||r.addChild(this),this.update(this.props,this.presenceContext),this.hasBeenMounted=!0}unmount(){var e;this.projection&&this.projection.unmount(),Mh(this.notifyUpdate),Mh(this.render),this.valueSubscriptions.forEach(t=>t()),this.valueSubscriptions.clear(),this.removeFromVariantTree&&this.removeFromVariantTree(),(e=this.parent)==null||e.removeChild(this);for(const t in this.events)this.events[t].clear();for(const t in this.features){const r=this.features[t];r&&(r.unmount(),r.isMounted=!1)}this.current=null}addChild(e){this.children.add(e),this.enteringChildren??(this.enteringChildren=new Set),this.enteringChildren.add(e)}removeChild(e){this.children.delete(e),this.enteringChildren&&this.enteringChildren.delete(e)}bindToMotionValue(e,t){if(this.valueSubscriptions.has(e)&&this.valueSubscriptions.get(e)(),t.accelerate&&yK.has(e)&&this.current instanceof HTMLElement){const{factory:o,keyframes:l,times:c,ease:d,duration:h}=t.accelerate,m=new xK({element:this.current,name:e,keyframes:l,times:c,ease:d,duration:wo(h)}),p=o(m);this.valueSubscriptions.set(e,()=>{p(),m.cancel()});return}const r=Qg.has(e);r&&this.onBindTransform&&this.onBindTransform();const s=t.on("change",o=>{this.latestValues[e]=o,this.props.onUpdate&&pr.preRender(this.notifyUpdate),r&&this.projection&&(this.projection.isTransformDirty=!0),this.scheduleRender()});let a;typeof window<"u"&&window.MotionCheckAppearSync&&(a=window.MotionCheckAppearSync(this,e,t)),this.valueSubscriptions.set(e,()=>{s(),a&&a()})}sortNodePosition(e){return!this.current||!this.sortInstanceNodePosition||this.type!==e.type?0:this.sortInstanceNodePosition(this.current,e.current)}updateFeatures(){let e="animation";for(e in xE){const t=xE[e];if(!t)continue;const{isEnabled:r,Feature:s}=t;if(!this.features[e]&&s&&r(this.props)&&(this.features[e]=new s(this)),this.features[e]){const a=this.features[e];a.isMounted?a.update():(a.mount(),a.isMounted=!0)}}}triggerBuild(){this.build(this.renderState,this.latestValues,this.props)}measureViewportBox(){return this.current?this.measureInstanceViewportBox(this.current,this.props):Hs()}getStaticValue(e){return this.latestValues[e]}setStaticValue(e,t){this.latestValues[e]=t}update(e,t){(e.transformTemplate||this.props.transformTemplate)&&this.scheduleRender(),this.prevProps=this.props,this.props=e,this.prevPresenceContext=this.presenceContext,this.presenceContext=t;for(let r=0;r<PF.length;r++){const s=PF[r];this.propEventSubscriptions[s]&&(this.propEventSubscriptions[s](),delete this.propEventSubscriptions[s]);const a="on"+s,o=e[a];o&&(this.propEventSubscriptions[s]=this.on(s,o))}this.prevMotionValues=E0e(this,this.scrapeMotionValuesFromProps(e,this.prevProps||{},this),this.prevMotionValues),this.handleChildMotionValue&&this.handleChildMotionValue()}getProps(){return this.props}getVariant(e){return this.props.variants?this.props.variants[e]:void 0}getDefaultTransition(){return this.props.transition}getTransformPagePoint(){return this.props.transformPagePoint}getClosestVariantNode(){return this.isVariantNode?this:this.parent?this.parent.getClosestVariantNode():void 0}addVariantChild(e){const t=this.getClosestVariantNode();if(t)return t.variantChildren&&t.variantChildren.add(e),()=>t.variantChildren.delete(e)}addValue(e,t){const r=this.values.get(e);t!==r&&(r&&this.removeValue(e),this.bindToMotionValue(e,t),this.values.set(e,t),this.latestValues[e]=t.get())}removeValue(e){this.values.delete(e);const t=this.valueSubscriptions.get(e);t&&(t(),this.valueSubscriptions.delete(e)),delete this.latestValues[e],this.removeValueFromRenderState(e,this.renderState)}hasValue(e){return this.values.has(e)}getValue(e,t){if(this.props.values&&this.props.values[e])return this.props.values[e];let r=this.values.get(e);return r===void 0&&t!==void 0&&(r=gg(t===null?void 0:t,{owner:this}),this.addValue(e,r)),r}readValue(e,t){let r=this.latestValues[e]!==void 0||!this.current?this.latestValues[e]:this.getBaseTargetFromProps(this.props,e)??this.readValueFromInstance(this.current,e,this.options);return r!=null&&(typeof r=="string"&&(Oq(r)||Fq(r))?r=parseFloat(r):!w0e(r)&&Vl.test(t)&&(r=_K(e,t)),this.setBaseTarget(e,La(r)?r.get():r)),La(r)?r.get():r}setBaseTarget(e,t){this.baseTarget[e]=t}getBaseTarget(e){var a;const{initial:t}=this.props;let r;if(typeof t=="string"||typeof t=="object"){const o=j2(this.props,t,(a=this.presenceContext)==null?void 0:a.custom);o&&(r=o[e])}if(t&&r!==void 0)return r;const s=this.getBaseTargetFromProps(this.props,e);return s!==void 0&&!La(s)?s:this.initialValues[e]!==void 0&&r===void 0?void 0:this.baseTarget[e]}on(e,t){return this.events[e]||(this.events[e]=new B2),this.events[e].add(t)}notify(e,...t){this.events[e]&&this.events[e].notify(...t)}scheduleRenderMicrotask(){P2.render(this.render)}}class FK extends k0e{constructor(){super(...arguments),this.KeyframeResolver=n0e}sortInstanceNodePosition(e,t){return e.compareDocumentPosition(t)&2?1:-1}getBaseTargetFromProps(e,t){const r=e.style;return r?r[t]:void 0}removeValueFromRenderState(e,{vars:t,style:r}){delete t[e],delete r[e]}handleChildMotionValue(){this.childSubscription&&(this.childSubscription(),delete this.childSubscription);const{children:e}=this.props;La(e)&&(this.childSubscription=e.on("change",t=>{this.current&&(this.current.textContent=`${t}`)}))}}class Xh{constructor(e){this.isMounted=!1,this.node=e}update(){}}function UK({top:n,left:e,right:t,bottom:r}){return{x:{min:e,max:t},y:{min:n,max:r}}}function N0e({x:n,y:e}){return{top:e.min,right:n.max,bottom:e.max,left:n.min}}function _0e(n,e){if(!e)return n;const t=e({x:n.left,y:n.top}),r=e({x:n.right,y:n.bottom});return{top:t.y,left:t.x,bottom:r.y,right:r.x}}function $k(n){return n===void 0||n===1}function mI({scale:n,scaleX:e,scaleY:t}){return!$k(n)||!$k(e)||!$k(t)}function Of(n){return mI(n)||VK(n)||n.z||n.rotate||n.rotateX||n.rotateY||n.skewX||n.skewY}function VK(n){return LF(n.x)||LF(n.y)}function LF(n){return n&&n!=="0%"}function bE(n,e,t){const r=n-t,s=e*r;return t+s}function OF(n,e,t,r,s){return s!==void 0&&(n=bE(n,s,r)),bE(n,t,r)+e}function pI(n,e=0,t=1,r,s){n.min=OF(n.min,e,t,r,s),n.max=OF(n.max,e,t,r,s)}function GK(n,{x:e,y:t}){pI(n.x,e.translate,e.scale,e.originPoint),pI(n.y,t.translate,t.scale,t.originPoint)}const MF=.999999999999,FF=1.0000000000001;function I0e(n,e,t,r=!1){var l;const s=t.length;if(!s)return;e.x=e.y=1;let a,o;for(let c=0;c<s;c++){a=t[c],o=a.projectionDelta;const{visualElement:d}=a.options;d&&d.props.style&&d.props.style.display==="contents"||(r&&a.options.layoutScroll&&a.scroll&&a!==a.root&&(mc(n.x,-a.scroll.offset.x),mc(n.y,-a.scroll.offset.y)),o&&(e.x*=o.x.scale,e.y*=o.y.scale,GK(n,o)),r&&Of(a.latestValues)&&bC(n,a.latestValues,(l=a.layout)==null?void 0:l.layoutBox))}e.x<FF&&e.x>MF&&(e.x=1),e.y<FF&&e.y>MF&&(e.y=1)}function mc(n,e){n.min+=e,n.max+=e}function UF(n,e,t,r,s=.5){const a=mr(n.min,n.max,s);pI(n,e,t,a,r)}function VF(n,e){return typeof n=="string"?parseFloat(n)/100*(e.max-e.min):n}function bC(n,e,t){const r=t??n;UF(n.x,VF(e.x,r.x),e.scaleX,e.scale,e.originX),UF(n.y,VF(e.y,r.y),e.scaleY,e.scale,e.originY)}function $K(n,e){return UK(_0e(n.getBoundingClientRect(),e))}function D0e(n,e,t){const r=$K(n,t),{scroll:s}=e;return s&&(mc(r.x,s.offset.x),mc(r.y,s.offset.y)),r}const j0e={x:"translateX",y:"translateY",z:"translateZ",transformPerspective:"perspective"},R0e=Yg.length;function P0e(n,e,t){let r="",s=!0;for(let o=0;o<R0e;o++){const l=Yg[o],c=n[l];if(c===void 0)continue;let d=!0;if(typeof c=="number")d=c===(l.startsWith("scale")?1:0);else{const h=parseFloat(c);d=l.startsWith("scale")?h===1:h===0}if(!d||t){const h=hI(c,gE[l]);if(!d){s=!1;const m=j0e[l]||l;r+=`${m}(${h}) `}t&&(e[l]=h)}}const a=n.pathRotation;return a&&(s=!1,r+=`rotate(${hI(a,gE.pathRotation)}) `),r=r.trim(),t?r=t(e,s?"":r):s&&(r="none"),r}function U2(n,e,t){const{style:r,vars:s,transformOrigin:a}=n;let o=!1,l=!1;for(const c in e){const d=e[c];if(Qg.has(c)){o=!0;continue}else if(eK(c)){s[c]=d;continue}else{const h=hI(d,gE[c]);c.startsWith("origin")?(l=!0,a[c]=h):r[c]=h}}if(e.transform||(o||t?r.transform=P0e(e,n.transform,t):r.transform&&(r.transform="none")),l){const{originX:c="50%",originY:d="50%",originZ:h=0}=a;r.transformOrigin=`${c} ${d} ${h}`}}function HK(n,{style:e,vars:t},r,s){const a=n.style;let o;for(o in e)a[o]=e[o];s==null||s.applyProjectionStyles(a,r);for(o in t)a.setProperty(o,t[o])}function GF(n,e){return e.max===e.min?0:n/(e.max-e.min)*100}const rb={correct:(n,e)=>{if(!e.target)return n;if(typeof n=="string")if(xt.test(n))n=parseFloat(n);else return n;const t=GF(n,e.target.x),r=GF(n,e.target.y);return`${t}% ${r}%`}},L0e={correct:(n,{treeScale:e,projectionDelta:t})=>{const r=n,s=Vl.parse(n);if(s.length>5)return r;const a=Vl.createTransformer(n),o=typeof s[0]!="number"?1:0,l=t.x.scale*e.x,c=t.y.scale*e.y;s[0+o]/=l,s[1+o]/=c;const d=mr(l,c,.5);return typeof s[2+o]=="number"&&(s[2+o]/=d),typeof s[3+o]=="number"&&(s[3+o]/=d),a(s)}},gI={borderRadius:{...rb,applyTo:["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"]},borderTopLeftRadius:rb,borderTopRightRadius:rb,borderBottomLeftRadius:rb,borderBottomRightRadius:rb,boxShadow:L0e};function zK(n,{layout:e,layoutId:t}){return Qg.has(n)||n.startsWith("origin")||(e||t!==void 0)&&(!!gI[n]||n==="opacity")}function V2(n,e,t){var o;const r=n.style,s=e==null?void 0:e.style,a={};if(!r)return a;for(const l in r)(La(r[l])||s&&La(s[l])||zK(l,n)||((o=t==null?void 0:t.getValue(l))==null?void 0:o.liveStyle)!==void 0)&&(a[l]=r[l]);return a}function O0e(n){return window.getComputedStyle(n)}class M0e extends FK{constructor(){super(...arguments),this.type="html",this.renderInstance=HK}readValueFromInstance(e,t){var r;if(Qg.has(t))return(r=this.projection)!=null&&r.isProjecting?tI(t):spe(e,t);{const s=O0e(e),a=(eK(t)?s.getPropertyValue(t):s[t])||0;return typeof a=="string"?a.trim():a}}measureInstanceViewportBox(e,{transformPagePoint:t}){return $K(e,t)}build(e,t,r){U2(e,t,r.transformTemplate)}scrapeMotionValuesFromProps(e,t,r){return V2(e,t,r)}}const F0e={offset:"stroke-dashoffset",array:"stroke-dasharray"},U0e={offset:"strokeDashoffset",array:"strokeDasharray"};function V0e(n,e,t=1,r=0,s=!0){n.pathLength=1;const a=s?F0e:U0e;n[a.offset]=`${-r}`,n[a.array]=`${e} ${t}`}const G0e=["offsetDistance","offsetPath","offsetRotate","offsetAnchor"];function qK(n,{attrX:e,attrY:t,attrScale:r,pathLength:s,pathSpacing:a=1,pathOffset:o=0,...l},c,d,h){if(U2(n,l,d),c){n.style.viewBox&&(n.attrs.viewBox=n.style.viewBox);return}n.attrs=n.style,n.style={};const{attrs:m,style:p}=n;m.transform&&(p.transform=m.transform,delete m.transform),(p.transform||m.transformOrigin)&&(p.transformOrigin=m.transformOrigin??"50% 50%",delete m.transformOrigin),p.transform&&(p.transformBox=(h==null?void 0:h.transformBox)??"fill-box",delete m.transformBox);for(const x of G0e)m[x]!==void 0&&(p[x]=m[x],delete m[x]);e!==void 0&&(m.x=e),t!==void 0&&(m.y=t),r!==void 0&&(m.scale=r),s!==void 0&&V0e(m,s,a,o,!1)}const KK=new Set(["baseFrequency","diffuseConstant","kernelMatrix","kernelUnitLength","keySplines","keyTimes","limitingConeAngle","markerHeight","markerWidth","numOctaves","targetX","targetY","surfaceScale","specularConstant","specularExponent","stdDeviation","tableValues","viewBox","gradientTransform","pathLength","startOffset","textLength","lengthAdjust"]),WK=n=>typeof n=="string"&&n.toLowerCase()==="svg";function $0e(n,e,t,r){HK(n,e,void 0,r);for(const s in e.attrs)n.setAttribute(KK.has(s)?s:R2(s),e.attrs[s])}function YK(n,e,t){const r=V2(n,e,t);for(const s in n)if(La(n[s])||La(e[s])){const a=Yg.indexOf(s)!==-1?"attr"+s.charAt(0).toUpperCase()+s.substring(1):s;r[a]=n[s]}return r}class H0e extends FK{constructor(){super(...arguments),this.type="svg",this.isSVGTag=!1,this.measureInstanceViewportBox=Hs}getBaseTargetFromProps(e,t){return e[t]}readValueFromInstance(e,t){if(Qg.has(t)){const r=NK(t);return r&&r.default||0}return t=KK.has(t)?t:R2(t),e.getAttribute(t)}scrapeMotionValuesFromProps(e,t,r){return YK(e,t,r)}build(e,t,r){qK(e,t,this.isSVGTag,r.transformTemplate,r.style)}renderInstance(e,t,r,s){$0e(e,t,r,s)}mount(e){this.isSVGTag=WK(e.tagName),super.mount(e)}}const z0e=F2.length;function QK(n){if(!n)return;if(!n.isControllingVariants){const t=n.parent?QK(n.parent)||{}:{};return n.props.initial!==void 0&&(t.initial=n.props.initial),t}const e={};for(let t=0;t<z0e;t++){const r=F2[t],s=n.props[r];(vy(s)||s===!1)&&(e[r]=s)}return e}function JK(n,e){if(!Array.isArray(e))return!1;const t=e.length;if(t!==n.length)return!1;for(let r=0;r<t;r++)if(e[r]!==n[r])return!1;return!0}const q0e=[...M2].reverse(),K0e=M2.length;function W0e(n){return e=>Promise.all(e.map(({animation:t,options:r})=>zpe(n,t,r)))}function Y0e(n){let e=W0e(n),t=$F(),r=!0,s=!1;const a=d=>(h,m)=>{var x;const p=mm(n,m,d==="exit"?(x=n.presenceContext)==null?void 0:x.custom:void 0);if(p){const{transition:y,transitionEnd:v,...B}=p;h={...h,...B,...v}}return h};function o(d){e=d(n)}function l(d){const{props:h}=n,m=QK(n.parent)||{},p=[],x=new Set;let y={},v=1/0;for(let E=0;E<K0e;E++){const N=q0e[E],T=t[N],k=h[N]!==void 0?h[N]:m[N],P=vy(k),R=N===d?T.isActive:null;R===!1&&(v=E);let _=k===m[N]&&k!==h[N]&&P;if(_&&(r||s)&&n.manuallyAnimateOnMount&&(_=!1),T.protectedKeys={...y},!T.isActive&&R===null||!k&&!T.prevProp||lS(k)||typeof k=="boolean")continue;if(N==="exit"&&T.isActive&&R!==!0){T.prevResolvedValues&&(y={...y,...T.prevResolvedValues});continue}const I=Q0e(T.prevProp,k);let D=I||N===d&&T.isActive&&!_&&P||E>v&&P,j=!1;const O=Array.isArray(k)?k:[k];let M=O.reduce(a(N),{});R===!1&&(M={});const{prevResolvedValues:U={}}=T,ee={...U,...M},ie=z=>{D=!0,x.has(z)&&(j=!0,x.delete(z)),T.needsAnimating[z]=!0;const se=n.getValue(z);se&&(se.liveStyle=!1)};for(const z in ee){const se=M[z],re=U[z];if(y.hasOwnProperty(z))continue;let H=!1;oI(se)&&oI(re)?H=!JK(se,re)||I:H=se!==re,H?se!=null?ie(z):x.add(z):se!==void 0&&x.has(z)?ie(z):T.protectedKeys[z]=!0}T.prevProp=k,T.prevResolvedValues=M,T.isActive&&(y={...y,...M}),(r||s)&&n.blockInitialAnimation&&(D=!1);const G=_&&I;D&&(!G||j)&&p.push(...O.map(z=>{const se={type:N};if(typeof z=="string"&&(r||s)&&!G&&n.manuallyAnimateOnMount&&n.parent){const{parent:re}=n,H=mm(re,z);if(re.enteringChildren&&H){const{delayChildren:Y}=H.transition||{};se.delay=vK(re.enteringChildren,n,Y)}}return{animation:z,options:se}}))}if(x.size){const E={};if(typeof h.initial!="boolean"){const N=mm(n,Array.isArray(h.initial)?h.initial[0]:h.initial);N&&N.transition&&(E.transition=N.transition)}x.forEach(N=>{const T=n.getBaseTarget(N),k=n.getValue(N);k&&(k.liveStyle=!0),E[N]=T??null}),p.push({animation:E})}let B=!!p.length;return r&&(h.initial===!1||h.initial===h.animate)&&!n.manuallyAnimateOnMount&&(B=!1),r=!1,s=!1,B?e(p):Promise.resolve()}function c(d,h){var p;if(t[d].isActive===h)return Promise.resolve();(p=n.variantChildren)==null||p.forEach(x=>{var y;return(y=x.animationState)==null?void 0:y.setActive(d,h)}),t[d].isActive=h;const m=l(d);for(const x in t)t[x].protectedKeys={};return m}return{animateChanges:l,setActive:c,setAnimateFunction:o,getState:()=>t,reset:()=>{t=$F(),s=!0}}}function Q0e(n,e){return typeof e=="string"?e!==n:Array.isArray(e)?!JK(e,n):!1}function Sf(n=!1){return{isActive:n,protectedKeys:{},needsAnimating:{},prevResolvedValues:{}}}function $F(){return{animate:Sf(!0),whileInView:Sf(),whileHover:Sf(),whileTap:Sf(),whileDrag:Sf(),whileFocus:Sf(),exit:Sf()}}function xI(n,e){n.min=e.min,n.max=e.max}function Sl(n,e){xI(n.x,e.x),xI(n.y,e.y)}function HF(n,e){n.translate=e.translate,n.scale=e.scale,n.originPoint=e.originPoint,n.origin=e.origin}const XK=1e-4,J0e=1-XK,X0e=1+XK,ZK=.01,Z0e=0-ZK,ege=0+ZK;function hi(n){return n.max-n.min}function tge(n,e,t){return Math.abs(n-e)<=t}function zF(n,e,t,r=.5){n.origin=r,n.originPoint=mr(e.min,e.max,n.origin),n.scale=hi(t)/hi(e),n.translate=mr(t.min,t.max,n.origin)-n.originPoint,(n.scale>=J0e&&n.scale<=X0e||isNaN(n.scale))&&(n.scale=1),(n.translate>=Z0e&&n.translate<=ege||isNaN(n.translate))&&(n.translate=0)}function qb(n,e,t,r){zF(n.x,e.x,t.x,r?r.originX:void 0),zF(n.y,e.y,t.y,r?r.originY:void 0)}function qF(n,e,t,r=0){const s=r?mr(t.min,t.max,r):t.min;n.min=s+e.min,n.max=n.min+hi(e)}function nge(n,e,t,r){qF(n.x,e.x,t.x,r==null?void 0:r.x),qF(n.y,e.y,t.y,r==null?void 0:r.y)}function KF(n,e,t,r=0){const s=r?mr(t.min,t.max,r):t.min;n.min=e.min-s,n.max=n.min+hi(e)}function yE(n,e,t,r){KF(n.x,e.x,t.x,r==null?void 0:r.x),KF(n.y,e.y,t.y,r==null?void 0:r.y)}function WF(n,e,t,r,s){return n-=e,n=bE(n,1/t,r),s!==void 0&&(n=bE(n,1/s,r)),n}function rge(n,e=0,t=1,r=.5,s,a=n,o=n){if(Rc.test(e)&&(e=parseFloat(e),e=mr(o.min,o.max,e/100)-o.min),typeof e!="number")return;let l=mr(a.min,a.max,r);n===a&&(l-=e),n.min=WF(n.min,e,t,l,s),n.max=WF(n.max,e,t,l,s)}function YF(n,e,[t,r,s],a,o){rge(n,e[t],e[r],e[s],e.scale,a,o)}const sge=["x","scaleX","originX"],age=["y","scaleY","originY"];function QF(n,e,t,r){YF(n.x,e,sge,t?t.x:void 0,r?r.x:void 0),YF(n.y,e,age,t?t.y:void 0,r?r.y:void 0)}function JF(n){return n.translate===0&&n.scale===1}function eW(n){return JF(n.x)&&JF(n.y)}function XF(n,e){return n.min===e.min&&n.max===e.max}function ige(n,e){return XF(n.x,e.x)&&XF(n.y,e.y)}function ZF(n,e){return Math.round(n.min)===Math.round(e.min)&&Math.round(n.max)===Math.round(e.max)}function tW(n,e){return ZF(n.x,e.x)&&ZF(n.y,e.y)}function e6(n){return hi(n.x)/hi(n.y)}function t6(n,e){return n.translate===e.translate&&n.scale===e.scale&&n.originPoint===e.originPoint}function dc(n){return[n("x"),n("y")]}function oge(n,e,t){let r="";const s=n.x.translate/e.x,a=n.y.translate/e.y,o=(t==null?void 0:t.z)||0;if((s||a||o)&&(r=`translate3d(${s}px, ${a}px, ${o}px) `),(e.x!==1||e.y!==1)&&(r+=`scale(${1/e.x}, ${1/e.y}) `),t){const{transformPerspective:d,rotate:h,pathRotation:m,rotateX:p,rotateY:x,skewX:y,skewY:v}=t;d&&(r=`perspective(${d}px) ${r}`),h&&(r+=`rotate(${h}deg) `),m&&(r+=`rotate(${m}deg) `),p&&(r+=`rotateX(${p}deg) `),x&&(r+=`rotateY(${x}deg) `),y&&(r+=`skewX(${y}deg) `),v&&(r+=`skewY(${v}deg) `)}const l=n.x.scale*e.x,c=n.y.scale*e.y;return(l!==1||c!==1)&&(r+=`scale(${l}, ${c})`),r||"none"}const nW=["borderTopLeftRadius","borderTopRightRadius","borderBottomLeftRadius","borderBottomRightRadius"],lge=nW.length,n6=n=>typeof n=="string"?parseFloat(n):n,r6=n=>typeof n=="number"||xt.test(n);function cge(n,e,t,r,s,a){s?(n.opacity=mr(0,t.opacity??1,dge(r)),n.opacityExit=mr(e.opacity??1,0,uge(r))):a&&(n.opacity=mr(e.opacity??1,t.opacity??1,r));for(let o=0;o<lge;o++){const l=nW[o];let c=s6(e,l),d=s6(t,l);if(c===void 0&&d===void 0)continue;c||(c=0),d||(d=0),c===0||d===0||r6(c)===r6(d)?(n[l]=Math.max(mr(n6(c),n6(d),r),0),(Rc.test(d)||Rc.test(c))&&(n[l]+="%")):n[l]=d}(e.rotate||t.rotate)&&(n.rotate=mr(e.rotate||0,t.rotate||0,r))}function s6(n,e){return n[e]!==void 0?n[e]:n.borderRadius}const dge=rW(0,.5,Wq),uge=rW(.5,.95,el);function rW(n,e,t){return r=>r<n?0:r>e?1:t(by(n,e,r))}function hge(n,e,t){const r=La(n)?n:gg(n);return r.start(D2("",r,e,t)),r.animation}function By(n,e,t,r={passive:!0}){return n.addEventListener(e,t,r),()=>n.removeEventListener(e,t)}const fge=(n,e)=>n.depth-e.depth;class mge{constructor(){this.children=[],this.isDirty=!1}add(e){y2(this.children,e),this.isDirty=!0}remove(e){uE(this.children,e),this.isDirty=!0}forEach(e){this.isDirty&&this.children.sort(fge),this.isDirty=!1,this.children.forEach(e)}}function pge(n,e){const t=ui.now(),r=({timestamp:s})=>{const a=s-t;a>=e&&(Mh(r),n(a-e))};return pr.setup(r,!0),()=>Mh(r)}function yC(n){return La(n)?n.get():n}class gge{constructor(){this.members=[]}add(e){y2(this.members,e);for(let t=this.members.length-1;t>=0;t--){const r=this.members[t];if(r===e||r===this.lead||r===this.prevLead)continue;const s=r.instance;(!s||s.isConnected===!1)&&!r.snapshot&&(uE(this.members,r),r.unmount())}e.scheduleRender()}remove(e){if(uE(this.members,e),e===this.prevLead&&(this.prevLead=void 0),e===this.lead){const t=this.members[this.members.length-1];t&&this.promote(t)}}relegate(e){var t;for(let r=this.members.indexOf(e)-1;r>=0;r--){const s=this.members[r];if(s.isPresent!==!1&&((t=s.instance)==null?void 0:t.isConnected)!==!1)return this.promote(s),!0}return!1}promote(e,t){var s;const r=this.lead;if(e!==r&&(this.prevLead=r,this.lead=e,e.show(),r)){r.updateSnapshot(),e.scheduleRender();const{layoutDependency:a}=r.options,{layoutDependency:o}=e.options;(a===void 0||a!==o)&&(e.resumeFrom=r,t&&(r.preserveOpacity=!0),r.snapshot&&(e.snapshot=r.snapshot,e.snapshot.latestValues=r.animationValues||r.latestValues),(s=e.root)!=null&&s.isUpdating&&(e.isLayoutDirty=!0)),e.options.crossfade===!1&&r.hide()}}exitAnimationComplete(){this.members.forEach(e=>{var t,r,s,a,o;(r=(t=e.options).onExitComplete)==null||r.call(t),(o=(s=e.resumingFrom)==null?void 0:(a=s.options).onExitComplete)==null||o.call(a)})}scheduleRender(){this.members.forEach(e=>e.instance&&e.scheduleRender(!1))}removeLeadSnapshot(){var e;(e=this.lead)!=null&&e.snapshot&&(this.lead.snapshot=void 0)}}const vC={hasAnimatedSinceResize:!0,hasEverUpdated:!1},Hk=["","X","Y","Z"],xge=1e3;let bge=0;function zk(n,e,t,r){const{latestValues:s}=e;s[n]&&(t[n]=s[n],e.setStaticValue(n,0),r&&(r[n]=0))}function sW(n){if(n.hasCheckedOptimisedAppear=!0,n.root===n)return;const{visualElement:e}=n.options;if(!e)return;const t=SK(e);if(window.MotionHasOptimisedAnimation(t,"transform")){const{layout:s,layoutId:a}=n.options;window.MotionCancelOptimisedAnimation(t,"transform",pr,!(s||a))}const{parent:r}=n;r&&!r.hasCheckedOptimisedAppear&&sW(r)}function aW({attachResizeListener:n,defaultParent:e,measureScroll:t,checkIsScrollRoot:r,resetTransform:s}){return class{constructor(o={},l=e==null?void 0:e()){this.id=bge++,this.animationId=0,this.animationCommitId=0,this.children=new Set,this.options={},this.isTreeAnimating=!1,this.isAnimationBlocked=!1,this.isLayoutDirty=!1,this.isProjectionDirty=!1,this.isSharedProjectionDirty=!1,this.isTransformDirty=!1,this.updateManuallyBlocked=!1,this.updateBlockedByResize=!1,this.isUpdating=!1,this.isSVG=!1,this.needsReset=!1,this.shouldResetTransform=!1,this.hasCheckedOptimisedAppear=!1,this.treeScale={x:1,y:1},this.eventHandlers=new Map,this.hasTreeAnimated=!1,this.layoutVersion=0,this.updateScheduled=!1,this.scheduleUpdate=()=>this.update(),this.projectionUpdateScheduled=!1,this.checkUpdateFailed=()=>{this.isUpdating&&(this.isUpdating=!1,this.clearAllSnapshots())},this.updateProjection=()=>{this.projectionUpdateScheduled=!1,this.nodes.forEach(Bge),this.nodes.forEach(Age),this.nodes.forEach(kge),this.nodes.forEach(wge)},this.resolvedRelativeTargetAt=0,this.linkedParentVersion=0,this.hasProjected=!1,this.isVisible=!0,this.animationProgress=0,this.sharedNodes=new Map,this.latestValues=o,this.root=l?l.root||l:this,this.path=l?[...l.path,l]:[],this.parent=l,this.depth=l?l.depth+1:0;for(let c=0;c<this.path.length;c++)this.path[c].shouldResetTransform=!0;this.root===this&&(this.nodes=new mge)}addEventListener(o,l){return this.eventHandlers.has(o)||this.eventHandlers.set(o,new B2),this.eventHandlers.get(o).add(l)}notifyListeners(o,...l){const c=this.eventHandlers.get(o);c&&c.notify(...l)}hasListeners(o){return this.eventHandlers.has(o)}mount(o){if(this.instance)return;this.isSVG=O2(o)&&!v0e(o),this.instance=o;const{layoutId:l,layout:c,visualElement:d}=this.options;if(d&&!d.current&&d.mount(o),this.root.nodes.add(this),this.parent&&this.parent.children.add(this),this.root.hasTreeAnimated&&(c||l)&&(this.isLayoutDirty=!0),n){let h,m=0;const p=()=>this.root.updateBlockedByResize=!1;pr.read(()=>{m=window.innerWidth}),n(o,()=>{const x=window.innerWidth;x!==m&&(m=x,this.root.updateBlockedByResize=!0,h&&h(),h=pge(p,250),vC.hasAnimatedSinceResize&&(vC.hasAnimatedSinceResize=!1,this.nodes.forEach(o6)))})}l&&this.root.registerSharedNode(l,this),this.options.animate!==!1&&d&&(l||c)&&this.addEventListener("didUpdate",({delta:h,hasLayoutChanged:m,hasRelativeLayoutChanged:p,layout:x})=>{if(this.isTreeAnimationBlocked()){this.target=void 0,this.relativeTarget=void 0;return}const y=this.options.transition||d.getDefaultTransition()||jge,{onLayoutAnimationStart:v,onLayoutAnimationComplete:B}=d.getProps(),E=!this.targetLayout||!tW(this.targetLayout,x),N=!m&&p;if(this.options.layoutRoot||this.resumeFrom||N||m&&(E||!this.currentAnimation)){this.resumeFrom&&(this.resumingFrom=this.resumeFrom,this.resumingFrom.resumingFrom=void 0);const T={...I2(y,"layout"),onPlay:v,onComplete:B};(d.shouldReduceMotion||this.options.layoutRoot)&&(T.delay=0,T.type=!1),this.startAnimation(T),this.setAnimationOrigin(h,N,T.path)}else m||o6(this),this.isLead()&&this.options.onExitComplete&&this.options.onExitComplete();this.targetLayout=x})}unmount(){this.options.layoutId&&this.willUpdate(),this.root.nodes.remove(this);const o=this.getStack();o&&o.remove(this),this.parent&&this.parent.children.delete(this),this.instance=void 0,this.eventHandlers.clear(),Mh(this.updateProjection)}blockUpdate(){this.updateManuallyBlocked=!0}unblockUpdate(){this.updateManuallyBlocked=!1}isUpdateBlocked(){return this.updateManuallyBlocked||this.updateBlockedByResize}isTreeAnimationBlocked(){return this.isAnimationBlocked||this.parent&&this.parent.isTreeAnimationBlocked()||!1}startUpdate(){this.isUpdateBlocked()||(this.isUpdating=!0,this.nodes&&this.nodes.forEach(Nge),this.animationId++)}getTransformTemplate(){const{visualElement:o}=this.options;return o&&o.getProps().transformTemplate}willUpdate(o=!0){if(this.root.hasTreeAnimated=!0,this.root.isUpdateBlocked()){this.options.onExitComplete&&this.options.onExitComplete();return}if(window.MotionCancelOptimisedAnimation&&!this.hasCheckedOptimisedAppear&&sW(this),!this.root.isUpdating&&this.root.startUpdate(),this.isLayoutDirty)return;this.isLayoutDirty=!0;for(let h=0;h<this.path.length;h++){const m=this.path[h];m.shouldResetTransform=!0,(typeof m.latestValues.x=="string"||typeof m.latestValues.y=="string")&&(m.isLayoutDirty=!0),m.updateScroll("snapshot"),m.options.layoutRoot&&m.willUpdate(!1)}const{layoutId:l,layout:c}=this.options;if(l===void 0&&!c)return;const d=this.getTransformTemplate();this.prevTransformTemplateValue=d?d(this.latestValues,""):void 0,this.updateSnapshot(),o&&this.notifyListeners("willUpdate")}update(){if(this.updateScheduled=!1,this.isUpdateBlocked()){const c=this.updateBlockedByResize;this.unblockUpdate(),this.updateBlockedByResize=!1,this.clearAllSnapshots(),c&&this.nodes.forEach(Ege),this.nodes.forEach(a6);return}if(this.animationId<=this.animationCommitId){this.nodes.forEach(i6);return}this.animationCommitId=this.animationId,this.isUpdating?(this.isUpdating=!1,this.nodes.forEach(Sge),this.nodes.forEach(Tge),this.nodes.forEach(yge),this.nodes.forEach(vge)):this.nodes.forEach(i6),this.clearAllSnapshots();const l=ui.now();_a.delta=Uc(0,1e3/60,l-_a.timestamp),_a.timestamp=l,_a.isProcessing=!0,Lk.update.process(_a),Lk.preRender.process(_a),Lk.render.process(_a),_a.isProcessing=!1}didUpdate(){this.updateScheduled||(this.updateScheduled=!0,P2.read(this.scheduleUpdate))}clearAllSnapshots(){this.nodes.forEach(Cge),this.sharedNodes.forEach(_ge)}scheduleUpdateProjection(){this.projectionUpdateScheduled||(this.projectionUpdateScheduled=!0,pr.preRender(this.updateProjection,!1,!0))}scheduleCheckAfterUnmount(){pr.postRender(()=>{this.isLayoutDirty?this.root.didUpdate():this.root.checkUpdateFailed()})}updateSnapshot(){this.snapshot||!this.instance||(this.snapshot=this.measure(),this.snapshot&&!hi(this.snapshot.measuredBox.x)&&!hi(this.snapshot.measuredBox.y)&&(this.snapshot=void 0))}updateLayout(){if(!this.instance||(this.updateScroll(),!(this.options.alwaysMeasureLayout&&this.isLead())&&!this.isLayoutDirty))return;if(this.resumeFrom&&!this.resumeFrom.instance)for(let c=0;c<this.path.length;c++)this.path[c].updateScroll();const o=this.layout;this.layout=this.measure(!1),this.layoutVersion++,this.layoutCorrected||(this.layoutCorrected=Hs()),this.isLayoutDirty=!1,this.projectionDelta=void 0,this.notifyListeners("measure",this.layout.layoutBox);const{visualElement:l}=this.options;l&&l.notify("LayoutMeasure",this.layout.layoutBox,o?o.layoutBox:void 0)}updateScroll(o="measure"){let l=!!(this.options.layoutScroll&&this.instance);if(this.scroll&&this.scroll.animationId===this.root.animationId&&this.scroll.phase===o&&(l=!1),l&&this.instance){const c=r(this.instance);this.scroll={animationId:this.root.animationId,phase:o,isRoot:c,offset:t(this.instance),wasRoot:this.scroll?this.scroll.isRoot:c}}}resetTransform(){if(!s)return;const o=this.isLayoutDirty||this.shouldResetTransform||this.options.alwaysMeasureLayout,l=this.projectionDelta&&!eW(this.projectionDelta),c=this.getTransformTemplate(),d=c?c(this.latestValues,""):void 0,h=d!==this.prevTransformTemplateValue;o&&this.instance&&(l||Of(this.latestValues)||h)&&(s(this.instance,d),this.shouldResetTransform=!1,this.scheduleRender())}measure(o=!0){const l=this.measurePageBox();let c=this.removeElementScroll(l);return o&&(c=this.removeTransform(c)),Rge(c),{animationId:this.root.animationId,measuredBox:l,layoutBox:c,latestValues:{},source:this.id}}measurePageBox(){var d;const{visualElement:o}=this.options;if(!o)return Hs();const l=o.measureViewportBox();if(!(((d=this.scroll)==null?void 0:d.wasRoot)||this.path.some(Pge))){const{scroll:h}=this.root;h&&(mc(l.x,h.offset.x),mc(l.y,h.offset.y))}return l}removeElementScroll(o){var c;const l=Hs();if(Sl(l,o),(c=this.scroll)!=null&&c.wasRoot)return l;for(let d=0;d<this.path.length;d++){const h=this.path[d],{scroll:m,options:p}=h;h!==this.root&&m&&p.layoutScroll&&(m.wasRoot&&Sl(l,o),mc(l.x,m.offset.x),mc(l.y,m.offset.y))}return l}applyTransform(o,l=!1,c){var h,m;const d=c||Hs();Sl(d,o);for(let p=0;p<this.path.length;p++){const x=this.path[p];!l&&x.options.layoutScroll&&x.scroll&&x!==x.root&&(mc(d.x,-x.scroll.offset.x),mc(d.y,-x.scroll.offset.y)),Of(x.latestValues)&&bC(d,x.latestValues,(h=x.layout)==null?void 0:h.layoutBox)}return Of(this.latestValues)&&bC(d,this.latestValues,(m=this.layout)==null?void 0:m.layoutBox),d}removeTransform(o){var c;const l=Hs();Sl(l,o);for(let d=0;d<this.path.length;d++){const h=this.path[d];if(!Of(h.latestValues))continue;let m;h.instance&&(mI(h.latestValues)&&h.updateSnapshot(),m=Hs(),Sl(m,h.measurePageBox())),QF(l,h.latestValues,(c=h.snapshot)==null?void 0:c.layoutBox,m)}return Of(this.latestValues)&&QF(l,this.latestValues),l}setTargetDelta(o){this.targetDelta=o,this.root.scheduleUpdateProjection(),this.isProjectionDirty=!0}setOptions(o){this.options={...this.options,...o,crossfade:o.crossfade!==void 0?o.crossfade:!0}}clearMeasurements(){this.scroll=void 0,this.layout=void 0,this.snapshot=void 0,this.prevTransformTemplateValue=void 0,this.targetDelta=void 0,this.target=void 0,this.isLayoutDirty=!1}forceRelativeParentToResolveTarget(){this.relativeParent&&this.relativeParent.resolvedRelativeTargetAt!==_a.timestamp&&this.relativeParent.resolveTargetDelta(!0)}resolveTargetDelta(o=!1){var x;const l=this.getLead();this.isProjectionDirty||(this.isProjectionDirty=l.isProjectionDirty),this.isTransformDirty||(this.isTransformDirty=l.isTransformDirty),this.isSharedProjectionDirty||(this.isSharedProjectionDirty=l.isSharedProjectionDirty);const c=!!this.resumingFrom||this!==l;if(!(o||c&&this.isSharedProjectionDirty||this.isProjectionDirty||(x=this.parent)!=null&&x.isProjectionDirty||this.attemptToResolveRelativeTarget||this.root.updateBlockedByResize))return;const{layout:h,layoutId:m}=this.options;if(!this.layout||!(h||m))return;this.resolvedRelativeTargetAt=_a.timestamp;const p=this.getClosestProjectingParent();p&&this.linkedParentVersion!==p.layoutVersion&&!p.options.layoutRoot&&this.removeRelativeTarget(),!this.targetDelta&&!this.relativeTarget&&(this.options.layoutAnchor!==!1&&p&&p.layout?this.createRelativeTarget(p,this.layout.layoutBox,p.layout.layoutBox):this.removeRelativeTarget()),!(!this.relativeTarget&&!this.targetDelta)&&(this.target||(this.target=Hs(),this.targetWithTransforms=Hs()),this.relativeTarget&&this.relativeTargetOrigin&&this.relativeParent&&this.relativeParent.target?(this.forceRelativeParentToResolveTarget(),nge(this.target,this.relativeTarget,this.relativeParent.target,this.options.layoutAnchor||void 0)):this.targetDelta?(this.resumingFrom?this.applyTransform(this.layout.layoutBox,!1,this.target):Sl(this.target,this.layout.layoutBox),GK(this.target,this.targetDelta)):Sl(this.target,this.layout.layoutBox),this.attemptToResolveRelativeTarget&&(this.attemptToResolveRelativeTarget=!1,this.options.layoutAnchor!==!1&&p&&!!p.resumingFrom==!!this.resumingFrom&&!p.options.layoutScroll&&p.target&&this.animationProgress!==1?this.createRelativeTarget(p,this.target,p.target):this.relativeParent=this.relativeTarget=void 0))}getClosestProjectingParent(){if(!(!this.parent||mI(this.parent.latestValues)||VK(this.parent.latestValues)))return this.parent.isProjecting()?this.parent:this.parent.getClosestProjectingParent()}isProjecting(){return!!((this.relativeTarget||this.targetDelta||this.options.layoutRoot)&&this.layout)}createRelativeTarget(o,l,c){this.relativeParent=o,this.linkedParentVersion=o.layoutVersion,this.forceRelativeParentToResolveTarget(),this.relativeTarget=Hs(),this.relativeTargetOrigin=Hs(),yE(this.relativeTargetOrigin,l,c,this.options.layoutAnchor||void 0),Sl(this.relativeTarget,this.relativeTargetOrigin)}removeRelativeTarget(){this.relativeParent=this.relativeTarget=void 0}calcProjection(){var y;const o=this.getLead(),l=!!this.resumingFrom||this!==o;let c=!0;if((this.isProjectionDirty||(y=this.parent)!=null&&y.isProjectionDirty)&&(c=!1),l&&(this.isSharedProjectionDirty||this.isTransformDirty)&&(c=!1),this.resolvedRelativeTargetAt===_a.timestamp&&(c=!1),c)return;const{layout:d,layoutId:h}=this.options;if(this.isTreeAnimating=!!(this.parent&&this.parent.isTreeAnimating||this.currentAnimation||this.pendingAnimation),this.isTreeAnimating||(this.targetDelta=this.relativeTarget=void 0),!this.layout||!(d||h))return;Sl(this.layoutCorrected,this.layout.layoutBox);const m=this.treeScale.x,p=this.treeScale.y;I0e(this.layoutCorrected,this.treeScale,this.path,l),o.layout&&!o.target&&(this.treeScale.x!==1||this.treeScale.y!==1)&&(o.target=o.layout.layoutBox,o.targetWithTransforms=Hs());const{target:x}=o;if(!x){this.prevProjectionDelta&&(this.createProjectionDeltas(),this.scheduleRender());return}!this.projectionDelta||!this.prevProjectionDelta?this.createProjectionDeltas():(HF(this.prevProjectionDelta.x,this.projectionDelta.x),HF(this.prevProjectionDelta.y,this.projectionDelta.y)),qb(this.projectionDelta,this.layoutCorrected,x,this.latestValues),(this.treeScale.x!==m||this.treeScale.y!==p||!t6(this.projectionDelta.x,this.prevProjectionDelta.x)||!t6(this.projectionDelta.y,this.prevProjectionDelta.y))&&(this.hasProjected=!0,this.scheduleRender(),this.notifyListeners("projectionUpdate",x))}hide(){this.isVisible=!1}show(){this.isVisible=!0}scheduleRender(o=!0){var l;if((l=this.options.visualElement)==null||l.scheduleRender(),o){const c=this.getStack();c&&c.scheduleRender()}this.resumingFrom&&!this.resumingFrom.instance&&(this.resumingFrom=void 0)}createProjectionDeltas(){this.prevProjectionDelta=E0(),this.projectionDelta=E0(),this.projectionDeltaWithTransform=E0()}setAnimationOrigin(o,l=!1,c){const d=this.snapshot,h=d?d.latestValues:{},m={...this.latestValues},p=E0();(!this.relativeParent||!this.relativeParent.options.layoutRoot)&&(this.relativeTarget=this.relativeTargetOrigin=void 0),this.attemptToResolveRelativeTarget=!l;const x=Hs(),y=d?d.source:void 0,v=this.layout?this.layout.source:void 0,B=y!==v,E=this.getStack(),N=!E||E.members.length<=1,T=!!(B&&!N&&this.options.crossfade===!0&&!this.path.some(Dge));this.animationProgress=0;let k;const P=c==null?void 0:c.interpolateProjection(o);this.mixTargetDelta=R=>{const _=R/1e3,I=P==null?void 0:P(_);I?(p.x.translate=I.x,p.x.scale=mr(o.x.scale,1,_),p.x.origin=o.x.origin,p.x.originPoint=o.x.originPoint,p.y.translate=I.y,p.y.scale=mr(o.y.scale,1,_),p.y.origin=o.y.origin,p.y.originPoint=o.y.originPoint):(l6(p.x,o.x,_),l6(p.y,o.y,_)),this.setTargetDelta(p),this.relativeTarget&&this.relativeTargetOrigin&&this.layout&&this.relativeParent&&this.relativeParent.layout&&(yE(x,this.layout.layoutBox,this.relativeParent.layout.layoutBox,this.options.layoutAnchor||void 0),Ige(this.relativeTarget,this.relativeTargetOrigin,x,_),k&&ige(this.relativeTarget,k)&&(this.isProjectionDirty=!1),k||(k=Hs()),Sl(k,this.relativeTarget)),B&&(this.animationValues=m,cge(m,h,this.latestValues,_,T,N)),I&&I.rotate!==void 0&&(this.animationValues||(this.animationValues=m),this.animationValues.pathRotation=I.rotate),this.root.scheduleUpdateProjection(),this.scheduleRender(),this.animationProgress=_},this.mixTargetDelta(this.options.layoutRoot?1e3:0)}startAnimation(o){var l,c,d;this.notifyListeners("animationStart"),(l=this.currentAnimation)==null||l.stop(),(d=(c=this.resumingFrom)==null?void 0:c.currentAnimation)==null||d.stop(),this.pendingAnimation&&(Mh(this.pendingAnimation),this.pendingAnimation=void 0),this.pendingAnimation=pr.update(()=>{vC.hasAnimatedSinceResize=!0,this.motionValue||(this.motionValue=gg(0)),this.motionValue.jump(0,!1),this.currentAnimation=hge(this.motionValue,[0,1e3],{...o,velocity:0,isSync:!0,onUpdate:h=>{this.mixTargetDelta(h),o.onUpdate&&o.onUpdate(h)},onStop:()=>{},onComplete:()=>{o.onComplete&&o.onComplete(),this.completeAnimation()}}),this.resumingFrom&&(this.resumingFrom.currentAnimation=this.currentAnimation),this.pendingAnimation=void 0})}completeAnimation(){this.resumingFrom&&(this.resumingFrom.currentAnimation=void 0,this.resumingFrom.preserveOpacity=void 0);const o=this.getStack();o&&o.exitAnimationComplete(),this.resumingFrom=this.currentAnimation=this.animationValues=void 0,this.notifyListeners("animationComplete")}finishAnimation(){this.currentAnimation&&(this.mixTargetDelta&&this.mixTargetDelta(xge),this.currentAnimation.stop()),this.completeAnimation()}applyTransformsToTarget(){const o=this.getLead();let{targetWithTransforms:l,target:c,layout:d,latestValues:h}=o;if(!(!l||!c||!d)){if(this!==o&&this.layout&&d&&iW(this.options.animationType,this.layout.layoutBox,d.layoutBox)){c=this.target||Hs();const m=hi(this.layout.layoutBox.x);c.x.min=o.target.x.min,c.x.max=c.x.min+m;const p=hi(this.layout.layoutBox.y);c.y.min=o.target.y.min,c.y.max=c.y.min+p}Sl(l,c),bC(l,h),qb(this.projectionDeltaWithTransform,this.layoutCorrected,l,h)}}registerSharedNode(o,l){this.sharedNodes.has(o)||this.sharedNodes.set(o,new gge),this.sharedNodes.get(o).add(l);const d=l.options.initialPromotionConfig;l.promote({transition:d?d.transition:void 0,preserveFollowOpacity:d&&d.shouldPreserveFollowOpacity?d.shouldPreserveFollowOpacity(l):void 0})}isLead(){const o=this.getStack();return o?o.lead===this:!0}getLead(){var l;const{layoutId:o}=this.options;return o?((l=this.getStack())==null?void 0:l.lead)||this:this}getPrevLead(){var l;const{layoutId:o}=this.options;return o?(l=this.getStack())==null?void 0:l.prevLead:void 0}getStack(){const{layoutId:o}=this.options;if(o)return this.root.sharedNodes.get(o)}promote({needsReset:o,transition:l,preserveFollowOpacity:c}={}){const d=this.getStack();d&&d.promote(this,c),o&&(this.projectionDelta=void 0,this.needsReset=!0),l&&this.setOptions({transition:l})}relegate(){const o=this.getStack();return o?o.relegate(this):!1}resetSkewAndRotation(){const{visualElement:o}=this.options;if(!o)return;let l=!1;const{latestValues:c}=o;if((c.z||c.rotate||c.rotateX||c.rotateY||c.rotateZ||c.skewX||c.skewY)&&(l=!0),!l)return;const d={};c.z&&zk("z",o,d,this.animationValues);for(let h=0;h<Hk.length;h++)zk(`rotate${Hk[h]}`,o,d,this.animationValues),zk(`skew${Hk[h]}`,o,d,this.animationValues);o.render();for(const h in d)o.setStaticValue(h,d[h]),this.animationValues&&(this.animationValues[h]=d[h]);o.scheduleRender()}applyProjectionStyles(o,l){if(!this.instance||this.isSVG)return;if(!this.isVisible){o.visibility="hidden";return}const c=this.getTransformTemplate();if(this.needsReset){this.needsReset=!1,o.visibility="",o.opacity="",o.pointerEvents=yC(l==null?void 0:l.pointerEvents)||"",o.transform=c?c(this.latestValues,""):"none";return}const d=this.getLead();if(!this.projectionDelta||!this.layout||!d.target){this.options.layoutId&&(o.opacity=this.latestValues.opacity!==void 0?this.latestValues.opacity:1,o.pointerEvents=yC(l==null?void 0:l.pointerEvents)||""),this.hasProjected&&!Of(this.latestValues)&&(o.transform=c?c({},""):"none",this.hasProjected=!1);return}o.visibility="";const h=d.animationValues||d.latestValues;this.applyTransformsToTarget();let m=oge(this.projectionDeltaWithTransform,this.treeScale,h);c&&(m=c(h,m)),o.transform=m;const{x:p,y:x}=this.projectionDelta;o.transformOrigin=`${p.origin*100}% ${x.origin*100}% 0`,d.animationValues?o.opacity=d===this?h.opacity??this.latestValues.opacity??1:this.preserveOpacity?this.latestValues.opacity:h.opacityExit:o.opacity=d===this?h.opacity!==void 0?h.opacity:"":h.opacityExit!==void 0?h.opacityExit:0;for(const y in gI){if(h[y]===void 0)continue;const{correct:v,applyTo:B,isCSSVariable:E}=gI[y],N=m==="none"?h[y]:v(h[y],d);if(B){const T=B.length;for(let k=0;k<T;k++)o[B[k]]=N}else E?this.options.visualElement.renderState.vars[y]=N:o[y]=N}this.options.layoutId&&(o.pointerEvents=d===this?yC(l==null?void 0:l.pointerEvents)||"":"none")}clearSnapshot(){this.resumeFrom=this.snapshot=void 0}resetTree(){this.root.nodes.forEach(o=>{var l;return(l=o.currentAnimation)==null?void 0:l.stop()}),this.root.nodes.forEach(a6),this.root.sharedNodes.clear()}}}function yge(n){n.updateLayout()}function vge(n){var t;const e=((t=n.resumeFrom)==null?void 0:t.snapshot)||n.snapshot;if(n.isLead()&&n.layout&&e&&n.hasListeners("didUpdate")){const{layoutBox:r,measuredBox:s}=n.layout,{animationType:a}=n.options,o=e.source!==n.layout.source;if(a==="size")dc(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],x=hi(p);p.min=r[m].min,p.max=p.min+x});else if(a==="x"||a==="y"){const m=a==="x"?"y":"x";xI(o?e.measuredBox[m]:e.layoutBox[m],r[m])}else iW(a,e.layoutBox,r)&&dc(m=>{const p=o?e.measuredBox[m]:e.layoutBox[m],x=hi(r[m]);p.max=p.min+x,n.relativeTarget&&!n.currentAnimation&&(n.isProjectionDirty=!0,n.relativeTarget[m].max=n.relativeTarget[m].min+x)});const l=E0();qb(l,r,e.layoutBox);const c=E0();o?qb(c,n.applyTransform(s,!0),e.measuredBox):qb(c,r,e.layoutBox);const d=!eW(l);let h=!1;if(!n.resumeFrom){const m=n.getClosestProjectingParent();if(m&&!m.resumeFrom){const{snapshot:p,layout:x}=m;if(p&&x){const y=n.options.layoutAnchor||void 0,v=Hs();yE(v,e.layoutBox,p.layoutBox,y);const B=Hs();yE(B,r,x.layoutBox,y),tW(v,B)||(h=!0),m.options.layoutRoot&&(n.relativeTarget=B,n.relativeTargetOrigin=v,n.relativeParent=m)}}}n.notifyListeners("didUpdate",{layout:r,snapshot:e,delta:c,layoutDelta:l,hasLayoutChanged:d,hasRelativeLayoutChanged:h})}else if(n.isLead()){const{onExitComplete:r}=n.options;r&&r()}n.options.transition=void 0}function Bge(n){n.parent&&(n.isProjecting()||(n.isProjectionDirty=n.parent.isProjectionDirty),n.isSharedProjectionDirty||(n.isSharedProjectionDirty=!!(n.isProjectionDirty||n.parent.isProjectionDirty||n.parent.isSharedProjectionDirty)),n.isTransformDirty||(n.isTransformDirty=n.parent.isTransformDirty))}
4118function wge(n){n.isProjectionDirty=n.isSharedProjectionDirty=n.isTransformDirty=!1}function Cge(n){n.clearSnapshot()}function a6(n){n.clearMeasurements()}function Ege(n){n.isLayoutDirty=!0,n.updateLayout()}function i6(n){n.isLayoutDirty=!1}function Sge(n){n.isAnimationBlocked&&n.layout&&!n.isLayoutDirty&&(n.snapshot=n.layout,n.isLayoutDirty=!0)}function Tge(n){const{visualElement:e}=n.options;e&&e.getProps().onBeforeLayoutMeasure&&e.notify("BeforeLayoutMeasure"),n.resetTransform()}function o6(n){n.finishAnimation(),n.targetDelta=n.relativeTarget=n.target=void 0,n.isProjectionDirty=!0}function Age(n){n.resolveTargetDelta()}function kge(n){n.calcProjection()}function Nge(n){n.resetSkewAndRotation()}function _ge(n){n.removeLeadSnapshot()}function l6(n,e,t){n.translate=mr(e.translate,0,t),n.scale=mr(e.scale,1,t),n.origin=e.origin,n.originPoint=e.originPoint}function c6(n,e,t,r){n.min=mr(e.min,t.min,r),n.max=mr(e.max,t.max,r)}function Ige(n,e,t,r){c6(n.x,e.x,t.x,r),c6(n.y,e.y,t.y,r)}function Dge(n){return n.animationValues&&n.animationValues.opacityExit!==void 0}const jge={duration:.45,ease:[.4,0,.1,1]},d6=n=>typeof navigator<"u"&&navigator.userAgent&&navigator.userAgent.toLowerCase().includes(n),u6=d6("applewebkit/")&&!d6("chrome/")?Math.round:el;function h6(n){n.min=u6(n.min),n.max=u6(n.max)}function Rge(n){h6(n.x),h6(n.y)}function iW(n,e,t){return n==="position"||n==="preserve-aspect"&&!tge(e6(e),e6(t),.2)}function Pge(n){var e;return n!==n.root&&((e=n.scroll)==null?void 0:e.wasRoot)}const Lge=aW({attachResizeListener:(n,e)=>By(n,"resize",e),measureScroll:()=>{var n,e;return{x:document.documentElement.scrollLeft||((n=document.body)==null?void 0:n.scrollLeft)||0,y:document.documentElement.scrollTop||((e=document.body)==null?void 0:e.scrollTop)||0}},checkIsScrollRoot:()=>!0}),qk={current:void 0},oW=aW({measureScroll:n=>({x:n.scrollLeft,y:n.scrollTop}),defaultParent:()=>{if(!qk.current){const n=new Lge({});n.mount(window),n.setOptions({layoutScroll:!0}),qk.current=n}return qk.current},resetTransform:(n,e)=>{n.style.transform=e!==void 0?e:"none"},checkIsScrollRoot:n=>window.getComputedStyle(n).position==="fixed"}),G2=S.createContext({transformPagePoint:n=>n,isStatic:!1,reducedMotion:"never"});function f6(n,e){if(typeof n=="function")return n(e);n!=null&&(n.current=e)}function Oge(...n){return e=>{let t=!1;const r=n.map(s=>{const a=f6(s,e);return!t&&typeof a=="function"&&(t=!0),a});if(t)return()=>{for(let s=0;s<r.length;s++){const a=r[s];typeof a=="function"?a():f6(n[s],null)}}}}function Mge(...n){return S.useCallback(Oge(...n),n)}class Fge extends S.Component{getSnapshotBeforeUpdate(e){const t=this.props.childRef.current;if(mC(t)&&e.isPresent&&!this.props.isPresent&&this.props.pop!==!1){const r=t.offsetParent,s=mC(r)&&r.offsetWidth||0,a=mC(r)&&r.offsetHeight||0,o=getComputedStyle(t),l=this.props.sizeRef.current;l.height=parseFloat(o.height),l.width=parseFloat(o.width),l.top=t.offsetTop,l.left=t.offsetLeft,l.right=s-l.width-l.left,l.bottom=a-l.height-l.top,l.direction=o.direction}return null}componentDidUpdate(){}render(){return this.props.children}}function Uge({children:n,isPresent:e,anchorX:t,anchorY:r,root:s,pop:a}){var p;const o=S.useId(),l=S.useRef(null),c=S.useRef({width:0,height:0,top:0,left:0,right:0,bottom:0,direction:"ltr"}),{nonce:d}=S.useContext(G2),h=((p=n.props)==null?void 0:p.ref)??(n==null?void 0:n.ref),m=Mge(l,h);return S.useInsertionEffect(()=>{const{width:x,height:y,top:v,left:B,right:E,bottom:N,direction:T}=c.current;if(e||a===!1||!l.current||!x||!y)return;const k=T==="rtl",P=t==="left"?k?`right: ${E}`:`left: ${B}`:k?`left: ${B}`:`right: ${E}`,R=r==="bottom"?`bottom: ${N}`:`top: ${v}`;l.current.dataset.motionPopId=o;const _=document.createElement("style");d&&(_.nonce=d);const I=s??document.head;return I.appendChild(_),_.sheet&&_.sheet.insertRule(`
4119          [data-motion-pop-id="${o}"] {
4120            position: absolute !important;
4121            width: ${x}px !important;
4122            height: ${y}px !important;
4123            ${P}px !important;
4124            ${R}px !important;
4125          }
4126        `),()=>{var D;(D=l.current)==null||D.removeAttribute("data-motion-pop-id"),I.contains(_)&&I.removeChild(_)}},[e]),i.jsx(Fge,{isPresent:e,childRef:l,sizeRef:c,pop:a,children:a===!1?n:S.cloneElement(n,{ref:m})})}const Vge=({children:n,initial:e,isPresent:t,onExitComplete:r,custom:s,presenceAffectsLayout:a,mode:o,anchorX:l,anchorY:c,root:d})=>{const h=b2(Gge),m=S.useId();let p=!0,x=S.useMemo(()=>(p=!1,{id:m,initial:e,isPresent:t,custom:s,onExitComplete:y=>{h.set(y,!0);for(const v of h.values())if(!v)return;r&&r()},register:y=>(h.set(y,!1),()=>h.delete(y))}),[t,h,r]);return a&&p&&(x={...x}),S.useMemo(()=>{h.forEach((y,v)=>h.set(v,!1))},[t]),S.useEffect(()=>{!t&&!h.size&&r&&r()},[t]),n=i.jsx(Uge,{pop:o==="popLayout",isPresent:t,anchorX:l,anchorY:c,root:d,children:n}),i.jsx(iS.Provider,{value:x,children:n})};function Gge(){return new Map}function lW(n=!0){const e=S.useContext(iS);if(e===null)return[!0,null];const{isPresent:t,onExitComplete:r,register:s}=e,a=S.useId();S.useEffect(()=>{if(n)return s(a)},[n]);const o=S.useCallback(()=>n&&r&&r(a),[a,r,n]);return!t&&r?[!1,o]:[!0]}const fw=n=>n.key||"";function m6(n){const e=[];
vendor: 4,389 bytes, line 4126
4126return S.Children.forEach(n,t=>{S.isValidElement(t)&&e.push(t)}),e}const Qo=({children:n,custom:e,initial:t=!0,onExitComplete:r,presenceAffectsLayout:s=!0,mode:a="sync",propagate:o=!1,anchorX:l="left",anchorY:c="top",root:d})=>{const[h,m]=lW(o),p=S.useMemo(()=>m6(n),[n]),x=o&&!h?[]:p.map(fw),y=S.useRef(!0),v=S.useRef(p),B=b2(()=>new Map),E=S.useRef(new Set),[N,T]=S.useState(p),[k,P]=S.useState(p);Lq(()=>{y.current=!1,v.current=p;for(let I=0;I<k.length;I++){const D=fw(k[I]);x.includes(D)?(B.delete(D),E.current.delete(D)):B.get(D)!==!0&&B.set(D,!1)}},[k,x.length,x.join("-")]);const R=[];if(p!==N){let I=[...p];for(let D=0;D<k.length;D++){const j=k[D],O=fw(j);x.includes(O)||(I.splice(D,0,j),R.push(j))}return a==="wait"&&R.length&&(I=R),P(m6(I)),T(p),null}const{forceRender:_}=S.useContext(x2);return i.jsx(i.Fragment,{children:k.map(I=>{const D=fw(I),j=o&&!h?!1:p===k||x.includes(D),O=()=>{if(E.current.has(D))return;if(B.has(D))E.current.add(D),B.set(D,!0);else return;let M=!0;B.forEach(U=>{U||(M=!1)}),M&&(_==null||_(),P(v.current),o&&(m==null||m()),r&&r())};return i.jsx(Vge,{isPresent:j,initial:!y.current||t?void 0:!1,custom:e,presenceAffectsLayout:s,mode:a,root:d,onExitComplete:j?void 0:O,anchorX:l,anchorY:c,children:I},D)})})},cW=S.createContext({strict:!1}),p6={animation:["animate","variants","whileHover","whileTap","exit","whileInView","whileFocus","whileDrag"],exit:["exit"],drag:["drag","dragControls"],focus:["whileFocus"],hover:["whileHover","onHoverStart","onHoverEnd"],tap:["whileTap","onTap","onTapStart","onTapCancel"],pan:["onPan","onPanStart","onPanSessionStart","onPanEnd"],inView:["whileInView","onViewportEnter","onViewportLeave"],layout:["layout","layoutId"]};let g6=!1;function $ge(){if(g6)return;const n={};for(const e in p6)n[e]={isEnabled:t=>p6[e].some(r=>!!t[r])};MK(n),g6=!0}function dW(){return $ge(),A0e()}function Hge(n){const e=dW();for(const t in n)e[t]={...e[t],...n[t]};MK(e)}const zge=new Set(["animate","exit","variants","initial","style","values","variants","transition","transformTemplate","custom","inherit","onBeforeLayoutMeasure","onAnimationStart","onAnimationComplete","onUpdate","onDragStart","onDrag","onDragEnd","onMeasureDragConstraints","onDirectionLock","onDragTransitionEnd","_dragX","_dragY","onHoverStart","onHoverEnd","onViewportEnter","onViewportLeave","globalTapTarget","propagate","ignoreStrict","viewport"]);function vE(n){return n.startsWith("while")||n.startsWith("drag")&&n!=="draggable"||n.startsWith("layout")||n.startsWith("onTap")||n.startsWith("onPan")||n.startsWith("onLayout")||zge.has(n)}let uW=n=>!vE(n);function qge(n){typeof n=="function"&&(uW=e=>e.startsWith("on")?!vE(e):n(e))}try{qge(require("@emotion/is-prop-valid").default)}catch{}function Kge(n,e,t){const r={};for(const s in n)s==="values"&&typeof n.values=="object"||La(n[s])||(uW(s)||t===!0&&vE(s)||!e&&!vE(s)||n.draggable&&s.startsWith("onDrag"))&&(r[s]=n[s]);return r}const dS=S.createContext({});function Wge(n,e){if(cS(n)){const{initial:t,animate:r}=n;return{initial:t===!1||vy(t)?t:void 0,animate:vy(r)?r:void 0}}return n.inherit!==!1?e:{}}function Yge(n){const{initial:e,animate:t}=Wge(n,S.useContext(dS));return S.useMemo(()=>({initial:e,animate:t}),[x6(e),x6(t)])}function x6(n){return Array.isArray(n)?n.join(" "):n}const $2=()=>({style:{},transform:{},transformOrigin:{},vars:{}});function hW(n,e,t){for(const r in e)!La(e[r])&&!zK(r,t)&&(n[r]=e[r])}function Qge({transformTemplate:n},e){return S.useMemo(()=>{const t=$2();return U2(t,e,n),Object.assign({},t.vars,t.style)},[e])}function Jge(n,e){const t=n.style||{},r={};return hW(r,t,n),Object.assign(r,Qge(n,e)),r}function Xge(n,e){const t={},r=Jge(n,e);return n.drag&&n.dragListener!==!1&&(t.draggable=!1,r.userSelect=r.WebkitUserSelect=r.WebkitTouchCallout="none",r.touchAction=n.drag===!0?"none":`pan-${n.drag==="x"?"y":"x"}`),n.tabIndex===void 0&&(n.onTap||n.onTapStart||n.whileTap)&&(t.tabIndex=0),t.style=r,t}const fW=()=>({...$2(),attrs:{}});function Zge(n,e,t,r){const s=S.useMemo(()=>{const a=fW();return qK(a,e,WK(r),n.transformTemplate,n.style),{...a.attrs,style:{...a.style}}},[e]);if(n.style){const a={};hW(a,n.style,n),s.style={...a,...s.style}}return s}const exe=["animate","circle","defs","desc","ellipse","g","image","line","filter","marker","mask","metadata","path","pattern","polygon","polyline","rect","stop","switch","symbol","svg","text","tspan","use","view"];
vendor: 23,328 bytes, line 4126
4126function H2(n){return typeof n!="string"||n.includes("-")?!1:!!(exe.indexOf(n)>-1||/[A-Z]/u.test(n))}function txe(n,e,t,{latestValues:r},s,a=!1,o){const c=(o??H2(n)?Zge:Xge)(e,r,s,n),d=Kge(e,typeof n=="string",a),h=n!==S.Fragment?{...d,...c,ref:t}:{},{children:m}=e,p=S.useMemo(()=>La(m)?m.get():m,[m]);return S.createElement(n,{...h,children:p})}function nxe({scrapeMotionValuesFromProps:n,createRenderState:e},t,r,s){return{latestValues:rxe(t,r,s,n),renderState:e()}}function rxe(n,e,t,r){const s={},a=r(n,{});for(const p in a)s[p]=yC(a[p]);let{initial:o,animate:l}=n;const c=cS(n),d=LK(n);e&&d&&!c&&n.inherit!==!1&&(o===void 0&&(o=e.initial),l===void 0&&(l=e.animate));let h=t?t.initial===!1:!1;h=h||o===!1;const m=h?l:o;if(m&&typeof m!="boolean"&&!lS(m)){const p=Array.isArray(m)?m:[m];for(let x=0;x<p.length;x++){const y=j2(n,p[x]);if(y){const{transitionEnd:v,transition:B,...E}=y;for(const N in E){let T=E[N];if(Array.isArray(T)){const k=h?T.length-1:0;T=T[k]}T!==null&&(s[N]=T)}for(const N in v)s[N]=v[N]}}}return s}const mW=n=>(e,t)=>{const r=S.useContext(dS),s=S.useContext(iS),a=()=>nxe(n,e,r,s);return t?a():b2(a)},sxe=mW({scrapeMotionValuesFromProps:V2,createRenderState:$2}),axe=mW({scrapeMotionValuesFromProps:YK,createRenderState:fW}),ixe=Symbol.for("motionComponentSymbol");function oxe(n,e,t){const r=S.useRef(t);S.useInsertionEffect(()=>{r.current=t});const s=S.useRef(null);return S.useCallback(a=>{var l;a&&((l=n.onMount)==null||l.call(n,a)),e&&(a?e.mount(a):e.unmount());const o=r.current;if(typeof o=="function")if(a){const c=o(a);typeof c=="function"&&(s.current=c)}else s.current?(s.current(),s.current=null):o(a);else o&&(o.current=a)},[e])}const pW=S.createContext({});function b0(n){return n&&typeof n=="object"&&Object.prototype.hasOwnProperty.call(n,"current")}function lxe(n,e,t,r,s,a){var T,k;const{visualElement:o}=S.useContext(dS),l=S.useContext(cW),c=S.useContext(iS),d=S.useContext(G2),h=d.reducedMotion,m=d.skipAnimations,p=S.useRef(null),x=S.useRef(!1);r=r||l.renderer,!p.current&&r&&(p.current=r(n,{visualState:e,parent:o,props:t,presenceContext:c,blockInitialAnimation:c?c.initial===!1:!1,reducedMotionConfig:h,skipAnimations:m,isSVG:a}),x.current&&p.current&&(p.current.manuallyAnimateOnMount=!0));const y=p.current,v=S.useContext(pW);y&&!y.projection&&s&&(y.type==="html"||y.type==="svg")&&cxe(p.current,t,s,v);const B=S.useRef(!1);S.useInsertionEffect(()=>{y&&B.current&&y.update(t,c)});const E=t[EK],N=S.useRef(!!E&&typeof window<"u"&&!((T=window.MotionHandoffIsComplete)!=null&&T.call(window,E))&&((k=window.MotionHasOptimisedAnimation)==null?void 0:k.call(window,E)));return Lq(()=>{x.current=!0,y&&(B.current=!0,window.MotionIsMounted=!0,y.updateFeatures(),y.scheduleRenderMicrotask(),N.current&&y.animationState&&y.animationState.animateChanges())}),S.useEffect(()=>{y&&(!N.current&&y.animationState&&y.animationState.animateChanges(),N.current&&(queueMicrotask(()=>{var P;(P=window.MotionHandoffMarkAsComplete)==null||P.call(window,E)}),N.current=!1),y.enteringChildren=void 0)}),y}function cxe(n,e,t,r){const{layoutId:s,layout:a,drag:o,dragConstraints:l,layoutScroll:c,layoutRoot:d,layoutAnchor:h,layoutCrossfade:m}=e;n.projection=new t(n.latestValues,e["data-framer-portal-id"]?void 0:gW(n.parent)),n.projection.setOptions({layoutId:s,layout:a,alwaysMeasureLayout:!!o||l&&b0(l),visualElement:n,animationType:typeof a=="string"?a:"both",initialPromotionConfig:r,crossfade:m,layoutScroll:c,layoutRoot:d,layoutAnchor:h})}function gW(n){if(n)return n.options.allowProjection!==!1?n.projection:gW(n.parent)}function Kk(n,{forwardMotionProps:e=!1,type:t}={},r,s){r&&Hge(r);const a=t?t==="svg":H2(n),o=a?axe:sxe;function l(d,h){let m;const p={...S.useContext(G2),...d,layoutId:dxe(d)},{isStatic:x}=p,y=Yge(d),v=o(d,x);if(!x&&typeof window<"u"){uxe();const B=hxe(p);m=B.MeasureLayout,y.visualElement=lxe(n,v,p,s,B.ProjectionNode,a)}return i.jsxs(dS.Provider,{value:y,children:[m&&y.visualElement?i.jsx(m,{visualElement:y.visualElement,...p}):null,txe(n,d,oxe(v,y.visualElement,h),v,x,e,a)]})}l.displayName=`motion.${typeof n=="string"?n:`create(${n.displayName??n.name??""})`}`;const c=S.forwardRef(l);return c[ixe]=n,c}function dxe({layoutId:n}){const e=S.useContext(x2).id;return e&&n!==void 0?e+"-"+n:n}function uxe(n,e){S.useContext(cW).strict}function hxe(n){const e=dW(),{drag:t,layout:r}=e;if(!t&&!r)return{};const s={...t,...r};return{MeasureLayout:t!=null&&t.isEnabled(n)||r!=null&&r.isEnabled(n)?s.MeasureLayout:void 0,ProjectionNode:s.ProjectionNode}}function fxe(n,e){if(typeof Proxy>"u")return Kk;const t=new Map,r=(a,o)=>Kk(a,o,n,e),s=(a,o)=>r(a,o);return new Proxy(s,{get:(a,o)=>o==="create"?r:(t.has(o)||t.set(o,Kk(o,void 0,n,e)),t.get(o))})}const mxe=(n,e)=>e.isSVG??H2(n)?new H0e(e):new M0e(e,{allowProjection:n!==S.Fragment});class pxe extends Xh{constructor(e){super(e),e.animationState||(e.animationState=Y0e(e))}updateAnimationControlsSubscription(){const{animate:e}=this.node.getProps();lS(e)&&(this.unmountControls=e.subscribe(this.node))}mount(){this.updateAnimationControlsSubscription()}update(){const{animate:e}=this.node.getProps(),{animate:t}=this.node.prevProps||{};e!==t&&this.updateAnimationControlsSubscription()}unmount(){var e;this.node.animationState.reset(),(e=this.unmountControls)==null||e.call(this)}}let gxe=0;class xxe extends Xh{constructor(){super(...arguments),this.id=gxe++,this.isExitComplete=!1}update(){var a;if(!this.node.presenceContext)return;const{isPresent:e,onExitComplete:t}=this.node.presenceContext,{isPresent:r}=this.node.prevPresenceContext||{};if(!this.node.animationState||e===r)return;if(e&&r===!1){if(this.isExitComplete){const{initial:o,custom:l}=this.node.getProps();if(typeof o=="string"||typeof o=="object"&&o!==null&&!Array.isArray(o)){const c=mm(this.node,o,l);if(c){const{transition:d,transitionEnd:h,...m}=c;for(const p in m)(a=this.node.getValue(p))==null||a.jump(m[p])}}this.node.animationState.reset(),this.node.animationState.animateChanges()}else this.node.animationState.setActive("exit",!1);this.isExitComplete=!1;return}const s=this.node.animationState.setActive("exit",!e);t&&!e&&s.then(()=>{this.isExitComplete=!0,t(this.id)})}mount(){const{register:e,onExitComplete:t}=this.node.presenceContext||{};t&&t(this.id),e&&(this.unmount=e(this.id))}unmount(){}}const bxe={animation:{Feature:pxe},exit:{Feature:xxe}};function Bv(n){return{point:{x:n.pageX,y:n.pageY}}}const yxe=n=>e=>L2(e)&&n(e,Bv(e));function Kb(n,e,t,r){return By(n,e,yxe(t),r)}const xW=({current:n})=>n?n.ownerDocument.defaultView:null,b6=(n,e)=>Math.abs(n-e);function vxe(n,e){const t=b6(n.x,e.x),r=b6(n.y,e.y);return Math.sqrt(t**2+r**2)}const y6=new Set(["auto","scroll"]);class bW{constructor(e,t,{transformPagePoint:r,contextWindow:s=window,dragSnapToOrigin:a=!1,distanceThreshold:o=3,element:l}={}){if(this.startEvent=null,this.lastMoveEvent=null,this.lastMoveEventInfo=null,this.lastRawMoveEventInfo=null,this.handlers={},this.contextWindow=window,this.scrollPositions=new Map,this.removeScrollListeners=null,this.onElementScroll=x=>{this.handleScroll(x.target)},this.onWindowScroll=()=>{this.handleScroll(window)},this.updatePoint=()=>{if(!(this.lastMoveEvent&&this.lastMoveEventInfo))return;this.lastRawMoveEventInfo&&(this.lastMoveEventInfo=mw(this.lastRawMoveEventInfo,this.transformPagePoint));const x=Wk(this.lastMoveEventInfo,this.history),y=this.startEvent!==null,v=vxe(x.offset,{x:0,y:0})>=this.distanceThreshold;if(!y&&!v)return;const{point:B}=x,{timestamp:E}=_a;this.history.push({...B,timestamp:E});const{onStart:N,onMove:T}=this.handlers;y||(N&&N(this.lastMoveEvent,x),this.startEvent=this.lastMoveEvent),T&&T(this.lastMoveEvent,x)},this.handlePointerMove=(x,y)=>{this.lastMoveEvent=x,this.lastRawMoveEventInfo=y,this.lastMoveEventInfo=mw(y,this.transformPagePoint),pr.update(this.updatePoint,!0)},this.handlePointerUp=(x,y)=>{this.end();const{onEnd:v,onSessionEnd:B,resumeAnimation:E}=this.handlers;if((this.dragSnapToOrigin||!this.startEvent)&&E&&E(),!(this.lastMoveEvent&&this.lastMoveEventInfo))return;const N=Wk(x.type==="pointercancel"?this.lastMoveEventInfo:mw(y,this.transformPagePoint),this.history);this.startEvent&&v&&v(x,N),B&&B(x,N)},!L2(e))return;this.dragSnapToOrigin=a,this.handlers=t,this.transformPagePoint=r,this.distanceThreshold=o,this.contextWindow=s||window;const c=Bv(e),d=mw(c,this.transformPagePoint),{point:h}=d,{timestamp:m}=_a;this.history=[{...h,timestamp:m}];const{onSessionStart:p}=t;p&&p(e,Wk(d,this.history)),this.removeListeners=bv(Kb(this.contextWindow,"pointermove",this.handlePointerMove),Kb(this.contextWindow,"pointerup",this.handlePointerUp),Kb(this.contextWindow,"pointercancel",this.handlePointerUp)),l&&this.startScrollTracking(l)}startScrollTracking(e){let t=e.parentElement;for(;t;){const r=getComputedStyle(t);(y6.has(r.overflowX)||y6.has(r.overflowY))&&this.scrollPositions.set(t,{x:t.scrollLeft,y:t.scrollTop}),t=t.parentElement}this.scrollPositions.set(window,{x:window.scrollX,y:window.scrollY}),window.addEventListener("scroll",this.onElementScroll,{capture:!0}),window.addEventListener("scroll",this.onWindowScroll),this.removeScrollListeners=()=>{window.removeEventListener("scroll",this.onElementScroll,{capture:!0}),window.removeEventListener("scroll",this.onWindowScroll)}}handleScroll(e){const t=this.scrollPositions.get(e);if(!t)return;const r=e===window,s=r?{x:window.scrollX,y:window.scrollY}:{x:e.scrollLeft,y:e.scrollTop},a={x:s.x-t.x,y:s.y-t.y};a.x===0&&a.y===0||(r?this.lastMoveEventInfo&&(this.lastMoveEventInfo.point.x+=a.x,this.lastMoveEventInfo.point.y+=a.y):this.history.length>0&&(this.history[0].x-=a.x,this.history[0].y-=a.y),this.scrollPositions.set(e,s),pr.update(this.updatePoint,!0))}updateHandlers(e){this.handlers=e}end(){this.removeListeners&&this.removeListeners(),this.removeScrollListeners&&this.removeScrollListeners(),this.scrollPositions.clear(),Mh(this.updatePoint)}}function mw(n,e){return e?{point:e(n.point)}:n}function v6(n,e){return{x:n.x-e.x,y:n.y-e.y}}function Wk({point:n},e){return{point:n,delta:v6(n,yW(e)),offset:v6(n,Bxe(e)),velocity:wxe(e,.1)}}function Bxe(n){return n[0]}function yW(n){return n[n.length-1]}function wxe(n,e){if(n.length<2)return{x:0,y:0};let t=n.length-1,r=null;const s=yW(n);for(;t>=0&&(r=n[t],!(s.timestamp-r.timestamp>wo(e)));)t--;if(!r)return{x:0,y:0};r===n[0]&&n.length>2&&s.timestamp-r.timestamp>wo(e)*2&&(r=n[1]);const a=Yo(s.timestamp-r.timestamp);if(a===0)return{x:0,y:0};const o={x:(s.x-r.x)/a,y:(s.y-r.y)/a};return o.x===1/0&&(o.x=0),o.y===1/0&&(o.y=0),o}function Cxe(n,{min:e,max:t},r){return e!==void 0&&n<e?n=r?mr(e,n,r.min):Math.max(n,e):t!==void 0&&n>t&&(n=r?mr(t,n,r.max):Math.min(n,t)),n}function B6(n,e,t){return{min:e!==void 0?n.min+e:void 0,max:t!==void 0?n.max+t-(n.max-n.min):void 0}}function Exe(n,{top:e,left:t,bottom:r,right:s}){return{x:B6(n.x,t,s),y:B6(n.y,e,r)}}function w6(n,e){let t=e.min-n.min,r=e.max-n.max;return e.max-e.min<n.max-n.min&&([t,r]=[r,t]),{min:t,max:r}}function Sxe(n,e){return{x:w6(n.x,e.x),y:w6(n.y,e.y)}}function Txe(n,e){let t=.5;const r=hi(n),s=hi(e);return s>r?t=by(e.min,e.max-r,n.min):r>s&&(t=by(n.min,n.max-s,e.min)),Uc(0,1,t)}function Axe(n,e){const t={};return e.min!==void 0&&(t.min=e.min-n.min),e.max!==void 0&&(t.max=e.max-n.min),t}const bI=.35;function kxe(n=bI){return n===!1?n=0:n===!0&&(n=bI),{x:C6(n,"left","right"),y:C6(n,"top","bottom")}}function C6(n,e,t){return{min:E6(n,e),max:E6(n,t)}}function E6(n,e){return typeof n=="number"?n:n[e]||0}const Nxe=new WeakMap;class _xe{constructor(e){this.openDragLock=null,this.isDragging=!1,this.currentDirection=null,this.originPoint={x:0,y:0},this.constraints=!1,this.hasMutatedConstraints=!1,this.elastic=Hs(),this.latestPointerEvent=null,this.latestPanInfo=null,this.visualElement=e}start(e,{snapToCursor:t=!1,distanceThreshold:r}={}){const{presenceContext:s}=this.visualElement;if(s&&s.isPresent===!1)return;const a=m=>{t&&this.snapToCursor(Bv(m).point),this.stopAnimation()},o=(m,p)=>{const{drag:x,dragPropagation:y,onDragStart:v}=this.getProps();if(x&&!y&&(this.openDragLock&&this.openDragLock(),this.openDragLock=r0e(x),!this.openDragLock))return;this.latestPointerEvent=m,this.latestPanInfo=p,this.isDragging=!0,this.currentDirection=null,this.resolveConstraints(),this.visualElement.projection&&(this.visualElement.projection.isAnimationBlocked=!0,this.visualElement.projection.target=void 0),dc(E=>{let N=this.getAxisMotionValue(E).get()||0;if(Rc.test(N)){const{projection:T}=this.visualElement;if(T&&T.layout){const k=T.layout.layoutBox[E];k&&(N=hi(k)*(parseFloat(N)/100))}}this.originPoint[E]=N}),v&&pr.update(()=>v(m,p),!1,!0),lI(this.visualElement,"transform");const{animationState:B}=this.visualElement;B&&B.setActive("whileDrag",!0)},l=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p;const{dragPropagation:x,dragDirectionLock:y,onDirectionLock:v,onDrag:B}=this.getProps();if(!x&&!this.openDragLock)return;const{offset:E}=p;if(y&&this.currentDirection===null){this.currentDirection=Dxe(E),this.currentDirection!==null&&v&&v(this.currentDirection);return}this.updateAxis("x",p.point,E),this.updateAxis("y",p.point,E),this.visualElement.render(),B&&pr.update(()=>B(m,p),!1,!0)},c=(m,p)=>{this.latestPointerEvent=m,this.latestPanInfo=p,this.stop(m,p),this.latestPointerEvent=null,this.latestPanInfo=null},d=()=>{const{dragSnapToOrigin:m}=this.getProps();(m||this.constraints)&&this.startAnimation({x:0,y:0})},{dragSnapToOrigin:h}=this.getProps();this.panSession=new bW(e,{onSessionStart:a,onStart:o,onMove:l,onSessionEnd:c,resumeAnimation:d},{transformPagePoint:this.visualElement.getTransformPagePoint(),dragSnapToOrigin:h,distanceThreshold:r,contextWindow:xW(this.visualElement),element:this.visualElement.current})}stop(e,t){const r=e||this.latestPointerEvent,s=t||this.latestPanInfo,a=this.isDragging;if(this.cancel(),!a||!s||!r)return;const{velocity:o}=s;this.startAnimation(o);const{onDragEnd:l}=this.getProps();l&&pr.postRender(()=>l(r,s))}cancel(){this.isDragging=!1;const{projection:e,animationState:t}=this.visualElement;e&&(e.isAnimationBlocked=!1),this.endPanSession();const{dragPropagation:r}=this.getProps();!r&&this.openDragLock&&(this.openDragLock(),this.openDragLock=null),t&&t.setActive("whileDrag",!1)}endPanSession(){this.panSession&&this.panSession.end(),this.panSession=void 0}updateAxis(e,t,r){const{drag:s}=this.getProps();if(!r||!pw(e,s,this.currentDirection))return;const a=this.getAxisMotionValue(e);let o=this.originPoint[e]+r[e];this.constraints&&this.constraints[e]&&(o=Cxe(o,this.constraints[e],this.elastic[e])),a.set(o)}resolveConstraints(){var a;const{dragConstraints:e,dragElastic:t}=this.getProps(),r=this.visualElement.projection&&!this.visualElement.projection.layout?this.visualElement.projection.measure(!1):(a=this.visualElement.projection)==null?void 0:a.layout,s=this.constraints;e&&b0(e)?this.constraints||(this.constraints=this.resolveRefConstraints()):e&&r?this.constraints=Exe(r.layoutBox,e):this.constraints=!1,this.elastic=kxe(t),s!==this.constraints&&!b0(e)&&r&&this.constraints&&!this.hasMutatedConstraints&&dc(o=>{this.constraints!==!1&&this.getAxisMotionValue(o)&&(this.constraints[o]=Axe(r.layoutBox[o],this.constraints[o]))})}resolveRefConstraints(){const{dragConstraints:e,onMeasureDragConstraints:t}=this.getProps();if(!e||!b0(e))return!1;const r=e.current,{projection:s}=this.visualElement;if(!s||!s.layout)return!1;s.root&&(s.root.scroll=void 0,s.root.updateScroll());const a=D0e(r,s.root,this.visualElement.getTransformPagePoint());let o=Sxe(s.layout.layoutBox,a);if(t){const l=t(N0e(o));this.hasMutatedConstraints=!!l,l&&(o=UK(l))}return o}startAnimation(e){const{drag:t,dragMomentum:r,dragElastic:s,dragTransition:a,dragSnapToOrigin:o,onDragTransitionEnd:l}=this.getProps(),c=this.constraints||{},d=dc(h=>{if(!pw(h,t,this.currentDirection))return;let m=c&&c[h]||{};(o===!0||o===h)&&(m={min:0,max:0});const p=s?200:1e6,x=s?40:1e7,y={type:"inertia",velocity:r?e[h]:0,bounceStiffness:p,bounceDamping:x,timeConstant:750,restDelta:1,restSpeed:10,...a,...m};return this.startAxisValueAnimation(h,y)});return Promise.all(d).then(l)}startAxisValueAnimation(e,t){const r=this.getAxisMotionValue(e);return lI(this.visualElement,e),r.start(D2(e,r,0,t,this.visualElement,!1))}stopAnimation(){dc(e=>this.getAxisMotionValue(e).stop())}getAxisMotionValue(e){const t=`_drag${e.toUpperCase()}`,s=this.visualElement.getProps()[t];return s||this.visualElement.getValue(e,this.visualElement.latestValues[e]??0)}snapToCursor(e){dc(t=>{const{drag:r}=this.getProps();if(!pw(t,r,this.currentDirection))return;const{projection:s}=this.visualElement,a=this.getAxisMotionValue(t);if(s&&s.layout){const{min:o,max:l}=s.layout.layoutBox[t],c=a.get()||0;a.set(e[t]-mr(o,l,.5)+c)}})}scalePositionWithinConstraints(){if(!this.visualElement.current)return;const{drag:e,dragConstraints:t}=this.getProps(),{projection:r}=this.visualElement;if(!b0(t)||!r||!this.constraints)return;this.stopAnimation();const s={x:0,y:0};dc(o=>{const l=this.getAxisMotionValue(o);if(l&&this.constraints!==!1){const c=l.get();s[o]=Txe({min:c,max:c},this.constraints[o])}});const{transformTemplate:a}=this.visualElement.getProps();this.visualElement.current.style.transform=a?a({},""):"none",r.root&&r.root.updateScroll(),r.updateLayout(),this.constraints=!1,this.resolveConstraints(),dc(o=>{if(!pw(o,e,null))return;const l=this.getAxisMotionValue(o),{min:c,max:d}=this.constraints[o];l.set(mr(c,d,s[o]))}),this.visualElement.render()}addListeners(){if(!this.visualElement.current)return;Nxe.set(this.visualElement,this);const e=this.visualElement.current,t=Kb(e,"pointerdown",d=>{const{drag:h,dragListener:m=!0}=this.getProps(),p=d.target,x=p!==e&&c0e(p);h&&m&&!x&&this.start(d)});let r;const s=()=>{const{dragConstraints:d}=this.getProps();b0(d)&&d.current&&(this.constraints=this.resolveRefConstraints(),r||(r=Ixe(e,d.current,()=>this.scalePositionWithinConstraints())))},{projection:a}=this.visualElement,o=a.addEventListener("measure",s);a&&!a.layout&&(a.root&&a.root.updateScroll(),a.updateLayout()),pr.read(s);const l=By(window,"resize",()=>this.scalePositionWithinConstraints()),c=a.addEventListener("didUpdate",(({delta:d,hasLayoutChanged:h})=>{this.isDragging&&h&&(dc(m=>{const p=this.getAxisMotionValue(m);p&&(this.originPoint[m]+=d[m].translate,p.set(p.get()+d[m].translate))}),this.visualElement.render())}));return()=>{l(),t(),o(),c&&c(),r&&r()}}getProps(){const e=this.visualElement.getProps(),{drag:t=!1,dragDirectionLock:r=!1,dragPropagation:s=!1,dragConstraints:a=!1,dragElastic:o=bI,dragMomentum:l=!0}=e;return{...e,drag:t,dragDirectionLock:r,dragPropagation:s,dragConstraints:a,dragElastic:o,dragMomentum:l}}}function S6(n){let e=!0;return()=>{if(e){e=!1;return}n()}}function Ixe(n,e,t){const r=DF(n,S6(t)),s=DF(e,S6(t));return()=>{r(),s()}}function pw(n,e,t){return(e===!0||e===n)&&(t===null||t===n)}function Dxe(n,e=10){let t=null;return Math.abs(n.y)>e?t="y":Math.abs(n.x)>e&&(t="x"),t}class jxe extends Xh{constructor(e){super(e),this.removeGroupControls=el,this.removeListeners=el,this.controls=new _xe(e)}mount(){const{dragControls:e}=this.node.getProps();e&&(this.removeGroupControls=e.subscribe(this.controls)),this.removeListeners=this.controls.addListeners()||el}update(){const{dragControls:e}=this.node.getProps(),{dragControls:t}=this.node.prevProps||{};e!==t&&(this.removeGroupControls(),e&&(this.removeGroupControls=e.subscribe(this.controls)))}unmount(){this.removeGroupControls(),this.removeListeners(),this.controls.isDragging||this.controls.endPanSession()}}const Yk=n=>(e,t)=>{n&&pr.update(()=>n(e,t),!1,!0)};class Rxe extends Xh{constructor(){super(...arguments),this.removePointerDownListener=el}onPointerDown(e){this.session=new bW(e,this.createPanHandlers(),{transformPagePoint:this.node.getTransformPagePoint(),contextWindow:xW(this.node)})}createPanHandlers(){const{onPanSessionStart:e,onPanStart:t,onPan:r,onPanEnd:s}=this.node.getProps();return{onSessionStart:Yk(e),onStart:Yk(t),onMove:Yk(r),onEnd:(a,o)=>{delete this.session,s&&pr.postRender(()=>s(a,o))}}}mount(){this.removePointerDownListener=Kb(this.node.current,"pointerdown",e=>this.onPointerDown(e))}update(){this.session&&this.session.updateHandlers(this.createPanHandlers())}unmount(){this.removePointerDownListener(),this.session&&this.session.end()}}let Qk=!1;class Pxe extends S.Component{componentDidMount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r,layoutId:s}=this.props,{projection:a}=e;a&&(t.group&&t.group.add(a),r&&r.register&&s&&r.register(a),Qk&&a.root.didUpdate(),a.addEventListener("animationComplete",()=>{this.safeToRemove()}),a.setOptions({...a.options,layoutDependency:this.props.layoutDependency,onExitComplete:()=>this.safeToRemove()})),vC.hasEverUpdated=!0}getSnapshotBeforeUpdate(e){const{layoutDependency:t,visualElement:r,drag:s,isPresent:a}=this.props,{projection:o}=r;return o&&(o.isPresent=a,e.layoutDependency!==t&&o.setOptions({...o.options,layoutDependency:t}),Qk=!0,s||e.layoutDependency!==t||t===void 0||e.isPresent!==a?o.willUpdate():this.safeToRemove(),e.isPresent!==a&&(a?o.promote():o.relegate()||pr.postRender(()=>{const l=o.getStack();(!l||!l.members.length)&&this.safeToRemove()}))),null}componentDidUpdate(){const{visualElement:e,layoutAnchor:t}=this.props,{projection:r}=e;r&&(r.options.layoutAnchor=t,r.root.didUpdate(),P2.postRender(()=>{!r.currentAnimation&&r.isLead()&&this.safeToRemove()}))}componentWillUnmount(){const{visualElement:e,layoutGroup:t,switchLayoutGroup:r}=this.props,{projection:s}=e;Qk=!0,s&&(s.scheduleCheckAfterUnmount(),t&&t.group&&t.group.remove(s),r&&r.deregister&&r.deregister(s))}safeToRemove(){const{safeToRemove:e}=this.props;e&&e()}render(){return null}}function vW(n){const[e,t]=lW(),r=S.useContext(x2);return i.jsx(Pxe,{...n,layoutGroup:r,switchLayoutGroup:S.useContext(pW),isPresent:e,safeToRemove:t})}const Lxe={pan:{Feature:Rxe},drag:{Feature:jxe,ProjectionNode:oW,MeasureLayout:vW}};function T6(n,e,t){const{props:r}=n;n.animationState&&r.whileHover&&n.animationState.setActive("whileHover",t==="Start");const s="onHover"+t,a=r[s];a&&pr.postRender(()=>a(e,Bv(e)))}class Oxe extends Xh{mount(){const{current:e}=this.node;e&&(this.unmount=a0e(e,(t,r)=>(T6(this.node,r,"Start"),s=>T6(this.node,s,"End"))))}unmount(){}}class Mxe extends Xh{constructor(){super(...arguments),this.isActive=!1}onFocus(){let e=!1;try{e=this.node.current.matches(":focus-visible")}catch{e=!0}!e||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!0),this.isActive=!0)}onBlur(){!this.isActive||!this.node.animationState||(this.node.animationState.setActive("whileFocus",!1),this.isActive=!1)}mount(){this.unmount=bv(By(this.node.current,"focus",()=>this.onFocus()),By(this.node.current,"blur",()=>this.onBlur()))}unmount(){}}function A6(n,e,t){const{props:r}=n;if(n.current instanceof HTMLButtonElement&&n.current.disabled)return;n.animationState&&r.whileTap&&n.animationState.setActive("whileTap",t==="Start");const s="onTap"+(t==="End"?"":t),a=r[s];a&&pr.postRender(()=>a(e,Bv(e)))}class Fxe extends Xh{mount(){const{current:e}=this.node;if(!e)return;const{globalTapTarget:t,propagate:r}=this.node.props;this.unmount=u0e(e,(s,a)=>(A6(this.node,a,"Start"),(o,{success:l})=>A6(this.node,o,l?"End":"Cancel")),{useGlobalTarget:t,stopPropagation:(r==null?void 0:r.tap)===!1})}unmount(){}}const yI=new WeakMap,Jk=new WeakMap,Uxe=n=>{const e=yI.get(n.target);e&&e(n)},Vxe=n=>
4126{n.forEach(Uxe)};function Gxe({root:n,...e}){const t=n||document;Jk.has(t)||Jk.set(t,{});const r=Jk.get(t),s=JSON.stringify(e);return r[s]||(r[s]=new IntersectionObserver(Vxe,{root:n,...e})),r[s]}function $xe(n,e,t){const r=Gxe(e);return yI.set(n,t),r.observe(n),()=>{yI.delete(n),r.unobserve(n)}}const Hxe={some:0,all:1};class zxe extends Xh{constructor(){super(...arguments),this.hasEnteredView=!1,this.isInView=!1}startObserver(){var c;(c=this.stopObserver)==null||c.call(this);const{viewport:e={}}=this.node.getProps(),{root:t,margin:r,amount:s="some",once:a}=e,o={root:t?t.current:void 0,rootMargin:r,threshold:typeof s=="number"?s:Hxe[s]},l=d=>{const{isIntersecting:h}=d;if(this.isInView===h||(this.isInView=h,a&&!h&&this.hasEnteredView))return;h&&(this.hasEnteredView=!0),this.node.animationState&&this.node.animationState.setActive("whileInView",h);const{onViewportEnter:m,onViewportLeave:p}=this.node.getProps(),x=h?m:p;x&&x(d)};this.stopObserver=$xe(this.node.current,o,l)}mount(){this.startObserver()}update(){if(typeof IntersectionObserver>"u")return;const{props:e,prevProps:t}=this.node;["amount","margin","root"].some(qxe(e,t))&&this.startObserver()}unmount(){var e;(e=this.stopObserver)==null||e.call(this),this.hasEnteredView=!1,this.isInView=!1}}function qxe({viewport:n={}},{viewport:e={}}={}){return t=>n[t]!==e[t]}const Kxe={inView:{Feature:zxe},tap:{Feature:Fxe},focus:{Feature:Mxe},hover:{Feature:Oxe}},Wxe={layout:{ProjectionNode:oW,MeasureLayout:vW}},Yxe={...bxe,...Kxe,...Lxe,...Wxe},cs=fxe(Yxe,mxe);/**
4127 * @license lucide-react v0.546.0 - ISC
4128 *
4129 * This source code is licensed under the ISC license.
4130 * See the LICENSE file in the root directory of this source tree.
4131 */const Qxe=n=>n.replace(/([a-z0-9])([A-Z])/g,"$1-$2").toLowerCase(),Jxe=n=>n.replace(/^([A-Z])|[\s-_]+(\w)/g,(e,t,r)=>r?r.toUpperCase():t.toLowerCase()),k6=n=>{const e=Jxe(n);return e.charAt(0).toUpperCase()+e.slice(1)},BW=(...n)=>n.filter((e,t,r)=>!!e&&e.trim()!==""&&r.indexOf(e)===t).join(" ").trim(),Xxe=n=>{for(const e in n)if(e.startsWith("aria-")||e==="role"||e==="title")return!0};/**
4132 * @license lucide-react v0.546.0 - ISC
4133 *
4134 * This source code is licensed under the ISC license.
4135 * See the LICENSE file in the root directory of this source tree.
4136 */var Zxe={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"};/**
4137 * @license lucide-react v0.546.0 - ISC
4138 *
4139 * This source code is licensed under the ISC license.
4140 * See the LICENSE file in the root directory of this source tree.
4141 */const ebe=S.forwardRef(({color:n="currentColor",size:e=24,strokeWidth:t=2,absoluteStrokeWidth:r,className:s="",children:a,iconNode:o,...l},c)=>S.createElement("svg",{ref:c,...Zxe,width:e,height:e,stroke:n,strokeWidth:r?Number(t)*24/Number(e):t,className:BW("lucide",s),...!a&&!Xxe(l)&&{"aria-hidden":"true"},...l},[...o.map(([d,h])=>S.createElement(d,h)),...Array.isArray(a)?a:[a]]));/**
4142 * @license lucide-react v0.546.0 - ISC
4143 *
4144 * This source code is licensed under the ISC license.
4145 * See the LICENSE file in the root directory of this source tree.
4146 */const Qe=(n,e)=>{const t=S.forwardRef(({className:r,...s},a)=>S.createElement(ebe,{ref:a,iconNode:e,className:BW(`lucide-${Qxe(k6(n))}`,`lucide-${n}`,r),...s}));return t.displayName=k6(n),t};/**
4147 * @license lucide-react v0.546.0 - ISC
4148 *
4149 * This source code is licensed under the ISC license.
4150 * See the LICENSE file in the root directory of this source tree.
4151 */const tbe=[["path",{d:"m12 19-7-7 7-7",key:"1l729n"}],["path",{d:"M19 12H5",key:"x3x0zl"}]],Rm=Qe("arrow-left",tbe);/**
4152 * @license lucide-react v0.546.0 - ISC
4153 *
4154 * This source code is licensed under the ISC license.
4155 * See the LICENSE file in the root directory of this source tree.
4156 */const nbe=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"m12 5 7 7-7 7",key:"xquz4c"}]],qr=Qe("arrow-right",nbe);/**
4157 * @license lucide-react v0.546.0 - ISC
4158 *
4159 * This source code is licensed under the ISC license.
4160 * See the LICENSE file in the root directory of this source tree.
4161 */const rbe=[["path",{d:"m15.477 12.89 1.515 8.526a.5.5 0 0 1-.81.47l-3.58-2.687a1 1 0 0 0-1.197 0l-3.586 2.686a.5.5 0 0 1-.81-.469l1.514-8.526",key:"1yiouv"}],["circle",{cx:"12",cy:"8",r:"6",key:"1vp47v"}]],yn=Qe("award",rbe);/**
4162 * @license lucide-react v0.546.0 - ISC
4163 *
4164 * This source code is licensed under the ISC license.
4165 * See the LICENSE file in the root directory of this source tree.
4166 */const sbe=[["path",{d:"M3.85 8.62a4 4 0 0 1 4.78-4.77 4 4 0 0 1 6.74 0 4 4 0 0 1 4.78 4.78 4 4 0 0 1 0 6.74 4 4 0 0 1-4.77 4.78 4 4 0 0 1-6.75 0 4 4 0 0 1-4.78-4.77 4 4 0 0 1 0-6.76Z",key:"3c2336"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],abe=Qe("badge-check",sbe);/**
4167 * @license lucide-react v0.546.0 - ISC
4168 *
4169 * This source code is licensed under the ISC license.
4170 * See the LICENSE file in the root directory of this source tree.
4171 */const ibe=[["path",{d:"M12 7v14",key:"1akyts"}],["path",{d:"M3 18a1 1 0 0 1-1-1V4a1 1 0 0 1 1-1h5a4 4 0 0 1 4 4 4 4 0 0 1 4-4h5a1 1 0 0 1 1 1v13a1 1 0 0 1-1 1h-6a3 3 0 0 0-3 3 3 3 0 0 0-3-3z",key:"ruj8y"}]],Ys=Qe("book-open",ibe);/**
4172 * @license lucide-react v0.546.0 - ISC
4173 *
4174 * This source code is licensed under the ISC license.
4175 * See the LICENSE file in the root directory of this source tree.
4176 */const obe=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}],["line",{x1:"12",x2:"12",y1:"7",y2:"13",key:"1cppfj"}],["line",{x1:"15",x2:"9",y1:"10",y2:"10",key:"1gty7f"}]],wW=Qe("bookmark-plus",obe);/**
4177 * @license lucide-react v0.546.0 - ISC
4178 *
4179 * This source code is licensed under the ISC license.
4180 * See the LICENSE file in the root directory of this source tree.
4181 */const lbe=[["path",{d:"m19 21-7-4-7 4V5a2 2 0 0 1 2-2h10a2 2 0 0 1 2 2v16z",key:"1fy3hk"}]],Jo=Qe("bookmark",lbe);/**
4182 * @license lucide-react v0.546.0 - ISC
4183 *
4184 * This source code is licensed under the ISC license.
4185 * See the LICENSE file in the root directory of this source tree.
4186 */const cbe=[["path",{d:"M12 18V5",key:"adv99a"}],["path",{d:"M15 13a4.17 4.17 0 0 1-3-4 4.17 4.17 0 0 1-3 4",key:"1e3is1"}],["path",{d:"M17.598 6.5A3 3 0 1 0 12 5a3 3 0 1 0-5.598 1.5",key:"1gqd8o"}],["path",{d:"M17.997 5.125a4 4 0 0 1 2.526 5.77",key:"iwvgf7"}],["path",{d:"M18 18a4 4 0 0 0 2-7.464",key:"efp6ie"}],["path",{d:"M19.967 17.483A4 4 0 1 1 12 18a4 4 0 1 1-7.967-.517",key:"1gq6am"}],["path",{d:"M6 18a4 4 0 0 1-2-7.464",key:"k1g0md"}],["path",{d:"M6.003 5.125a4 4 0 0 0-2.526 5.77",key:"q97ue3"}]],dbe=Qe("brain",cbe);/**
4187 * @license lucide-react v0.546.0 - ISC
4188 *
4189 * This source code is licensed under the ISC license.
4190 * See the LICENSE file in the root directory of this source tree.
4191 */const ube=[["path",{d:"M8 2v4",key:"1cmpym"}],["path",{d:"M16 2v4",key:"4m81vk"}],["rect",{width:"18",height:"18",x:"3",y:"4",rx:"2",key:"1hopcy"}],["path",{d:"M3 10h18",key:"8toen8"}]],uS=Qe("calendar",ube);/**
4192 * @license lucide-react v0.546.0 - ISC
4193 *
4194 * This source code is licensed under the ISC license.
4195 * See the LICENSE file in the root directory of this source tree.
4196 */const hbe=[["path",{d:"M3 3v16a2 2 0 0 0 2 2h16",key:"c24i48"}],["path",{d:"M18 17V9",key:"2bz60n"}],["path",{d:"M13 17V5",key:"1frdt8"}],["path",{d:"M8 17v-3",key:"17ska0"}]],fbe=Qe("chart-column",hbe);
4196/**
4197 * @license lucide-react v0.546.0 - ISC
4198 *
4199 * This source code is licensed under the ISC license.
4200 * See the LICENSE file in the root directory of this source tree.
4201 */const mbe=[["path",{d:"M18 6 7 17l-5-5",key:"116fxf"}],["path",{d:"m22 10-7.5 7.5L13 16",key:"ke71qq"}]],N6=Qe("check-check",mbe);/**
4202 * @license lucide-react v0.546.0 - ISC
4203 *
4204 * This source code is licensed under the ISC license.
4205 * See the LICENSE file in the root directory of this source tree.
4206 */const pbe=[["path",{d:"M20 6 9 17l-5-5",key:"1gmf2c"}]],Co=Qe("check",pbe);/**
4207 * @license lucide-react v0.546.0 - ISC
4208 *
4209 * This source code is licensed under the ISC license.
4210 * See the LICENSE file in the root directory of this source tree.
4211 */const gbe=[["path",{d:"m6 9 6 6 6-6",key:"qrunsl"}]],wy=Qe("chevron-down",gbe);/**
4212 * @license lucide-react v0.546.0 - ISC
4213 *
4214 * This source code is licensed under the ISC license.
4215 * See the LICENSE file in the root directory of this source tree.
4216 */const xbe=[["path",{d:"m15 18-6-6 6-6",key:"1wnfg3"}]],CW=Qe("chevron-left",xbe);/**
4217 * @license lucide-react v0.546.0 - ISC
4218 *
4219 * This source code is licensed under the ISC license.
4220 * See the LICENSE file in the root directory of this source tree.
4221 */const bbe=[["path",{d:"m9 18 6-6-6-6",key:"mthhwq"}]],qn=Qe("chevron-right",bbe);/**
4222 * @license lucide-react v0.546.0 - ISC
4223 *
4224 * This source code is licensed under the ISC license.
4225 * See the LICENSE file in the root directory of this source tree.
4226 */const ybe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["line",{x1:"12",x2:"12",y1:"8",y2:"12",key:"1pkeuh"}],["line",{x1:"12",x2:"12.01",y1:"16",y2:"16",key:"4dfq90"}]],Qa=Qe("circle-alert",ybe);/**
4227 * @license lucide-react v0.546.0 - ISC
4228 *
4229 * This source code is licensed under the ISC license.
4230 * See the LICENSE file in the root directory of this source tree.
4231 */const vbe=[["path",{d:"M21.801 10A10 10 0 1 1 17 3.335",key:"yps3ct"}],["path",{d:"m9 11 3 3L22 4",key:"1pflzl"}]],Bbe=Qe("circle-check-big",vbe);/**
4232 * @license lucide-react v0.546.0 - ISC
4233 *
4234 * This source code is licensed under the ISC license.
4235 * See the LICENSE file in the root directory of this source tree.
4236 */const wbe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],vn=Qe("circle-check",wbe);/**
4237 * @license lucide-react v0.546.0 - ISC
4238 *
4239 * This source code is licensed under the ISC license.
4240 * See the LICENSE file in the root directory of this source tree.
4241 */const Cbe=[["path",{d:"M9 9.003a1 1 0 0 1 1.517-.859l4.997 2.997a1 1 0 0 1 0 1.718l-4.997 2.997A1 1 0 0 1 9 14.996z",key:"kmsa83"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Ebe=Qe("circle-play",Cbe);/**
4242 * @license lucide-react v0.546.0 - ISC
4243 *
4244 * This source code is licensed under the ISC license.
4245 * See the LICENSE file in the root directory of this source tree.
4246 */const Sbe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M9.09 9a3 3 0 0 1 5.83 1c0 2-3 3-3 3",key:"1u773s"}],["path",{d:"M12 17h.01",key:"p32p05"}]],wv=Qe("circle-question-mark",Sbe);/**
4247 * @license lucide-react v0.546.0 - ISC
4248 *
4249 * This source code is licensed under the ISC license.
4250 * See the LICENSE file in the root directory of this source tree.
4251 */const Tbe=[["path",{d:"M12 6v6l4 2",key:"mmk7yg"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],Eo=Qe("clock",Tbe);/**
4252 * @license lucide-react v0.546.0 - ISC
4253 *
4254 * This source code is licensed under the ISC license.
4255 * See the LICENSE file in the root directory of this source tree.
4256 */const Abe=[["path",{d:"M17.5 19H9a7 7 0 1 1 6.71-9h1.79a4.5 4.5 0 1 1 0 9Z",key:"p7xjir"}]],kbe=Qe("cloud",Abe);/**
4257 * @license lucide-react v0.546.0 - ISC
4258 *
4259 * This source code is licensed under the ISC license.
4260 * See the LICENSE file in the root directory of this source tree.
4261 */const Nbe=[["path",{d:"m16 18 6-6-6-6",key:"eg8j8"}],["path",{d:"m8 6-6 6 6 6",key:"ppft3o"}]],xg=Qe("code",Nbe);/**
4262 * @license lucide-react v0.546.0 - ISC
4263 *
4264 * This source code is licensed under the ISC license.
4265 * See the LICENSE file in the root directory of this source tree.
4266 */const _be=[["path",{d:"M10 2v2",key:"7u0qdc"}],["path",{d:"M14 2v2",key:"6buw04"}],["path",{d:"M16 8a1 1 0 0 1 1 1v8a4 4 0 0 1-4 4H7a4 4 0 0 1-4-4V9a1 1 0 0 1 1-1h14a4 4 0 1 1 0 8h-1",key:"pwadti"}],["path",{d:"M6 2v2",key:"colzsn"}]],Ibe=Qe("coffee",_be);/**
4267 * @license lucide-react v0.546.0 - ISC
4268 *
4269 * This source code is licensed under the ISC license.
4270 * See the LICENSE file in the root directory of this source tree.
4271 */const Dbe=[["path",{d:"m16.24 7.76-1.804 5.411a2 2 0 0 1-1.265 1.265L7.76 16.24l1.804-5.411a2 2 0 0 1 1.265-1.265z",ke
4271y:"9ktpf1"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],z2=Qe("compass",Dbe);/**
4272 * @license lucide-react v0.546.0 - ISC
4273 *
4274 * This source code is licensed under the ISC license.
4275 * See the LICENSE file in the root directory of this source tree.
4276 */const jbe=[["rect",{width:"14",height:"14",x:"8",y:"8",rx:"2",ry:"2",key:"17jyea"}],["path",{d:"M4 16c-1.1 0-2-.9-2-2V4c0-1.1.9-2 2-2h10c1.1 0 2 .9 2 2",key:"zix9uf"}]],Pm=Qe("copy",jbe);/**
4277 * @license lucide-react v0.546.0 - ISC
4278 *
4279 * This source code is licensed under the ISC license.
4280 * See the LICENSE file in the root directory of this source tree.
4281 */const Rbe=[["rect",{width:"20",height:"14",x:"2",y:"5",rx:"2",key:"ynyp8z"}],["line",{x1:"2",x2:"22",y1:"10",y2:"10",key:"1b3vmo"}]],Pbe=Qe("credit-card",Rbe);/**
4282 * @license lucide-react v0.546.0 - ISC
4283 *
4284 * This source code is licensed under the ISC license.
4285 * See the LICENSE file in the root directory of this source tree.
4286 */const Lbe=[["path",{d:"M11.562 3.266a.5.5 0 0 1 .876 0L15.39 8.87a1 1 0 0 0 1.516.294L21.183 5.5a.5.5 0 0 1 .798.519l-2.834 10.246a1 1 0 0 1-.956.734H5.81a1 1 0 0 1-.957-.734L2.02 6.02a.5.5 0 0 1 .798-.519l4.276 3.664a1 1 0 0 0 1.516-.294z",key:"1vdc57"}],["path",{d:"M5 21h14",key:"11awu3"}]],fr=Qe("crown",Lbe);/**
4287 * @license lucide-react v0.546.0 - ISC
4288 *
4289 * This source code is licensed under the ISC license.
4290 * See the LICENSE file in the root directory of this source tree.
4291 */const Obe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M6 12c0-1.7.7-3.2 1.8-4.2",key:"oqkarx"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}],["path",{d:"M18 12c0 1.7-.7 3.2-1.8 4.2",key:"1eah9h"}]],Mbe=Qe("disc-3",Obe);/**
4292 * @license lucide-react v0.546.0 - ISC
4293 *
4294 * This source code is licensed under the ISC license.
4295 * See the LICENSE file in the root directory of this source tree.
4296 */const Fbe=[["path",{d:"M12 15V3",key:"m9g1x1"}],["path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4",key:"ih7n3h"}],["path",{d:"m7 10 5 5 5-5",key:"brsn70"}]],hS=Qe("download",Fbe);/**
4297 * @license lucide-react v0.546.0 - ISC
4298 *
4299 * This source code is licensed under the ISC license.
4300 * See the LICENSE file in the root directory of this source tree.
4301 */const Ube=[["path",{d:"M21.54 15H17a2 2 0 0 0-2 2v4.54",key:"1djwo0"}],["path",{d:"M7 3.34V5a3 3 0 0 0 3 3a2 2 0 0 1 2 2c0 1.1.9 2 2 2a2 2 0 0 0 2-2c0-1.1.9-2 2-2h3.17",key:"1tzkfa"}],["path",{d:"M11 21.95V18a2 2 0 0 0-2-2a2 2 0 0 1-2-2v-1a2 2 0 0 0-2-2H2.05",key:"14pb5j"}],["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}]],EW=Qe("earth",Ube);/**
4302 * @license lucide-react v0.546.0 - ISC
4303 *
4304 * This source code is licensed under the ISC license.
4305 * See the LICENSE file in the root directory of this source tree.
4306 */const Vbe=[["path",{d:"M15 3h6v6",key:"1q9fwt"}],["path",{d:"M10 14 21 3",key:"gplh6r"}],["path",{d:"M18 13v6a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h6",key:"a6xqqp"}]],Md=Qe("external-link",Vbe);/**
4307 * @license lucide-react v0.546.0 - ISC
4308 *
4309 * This source code is licensed under the ISC license.
4310 * See the LICENSE file in the root directory of this source tree.
4311 */const Gbe=[["path",{d:"M15 2H6a2 2 0 0 0-2 2v16a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2V7Z",key:"1rqfz7"}],["path",{d:"M14 2v4a2 2 0 0 0 2 2h4",key:"tnqrlb"}],["path",{d:"M10 9H8",key:"b1mrlr"}],["path",{d:"M16 13H8",key:"t4e002"}],["path",{d:"M16 17H8",key:"z1uh3a"}]],BE=Qe("file-text",Gbe);/**
4312 * @license lucide-react v0.546.0 - ISC
4313 *
4314 * This source code is licensed under the ISC license.
4315 * See the LICENSE file in the root directory of this source tree.
4316 */const $be=[["path",{d:"M12 3q1 4 4 6.5t3 5.5a1 1 0 0 1-14 0 5 5 0 0 1 1-3 1 1 0 0 0 5 0c0-2-1.5-3-1.5-5q0-2 2.5-4",key:"1slcih"}]],Cv=Qe("flame",$be);/**
4317 * @license lucide-react v0.546.0 - ISC
4318 *
4319 * This source code is licensed under the ISC license.
4320 * See the LICENSE file in the root directory of this source tree.
4321 */const Hbe=[["path",{d:"M10 20a1 1 0 0 0 .553.895l2 1A1 1 0 0 0 14 21v-7a2 2 0 0 1 .517-1.341L21.74 4.67A1 1 0 0 0 21 3H3a1 1 0 0 0-.742 1.67l7.225 7.989A2 2 0 0 1 10 14z",key:"sc7q7i"}]],SW=Qe("funnel",Hbe);/**
4322 * @license lucide-react v0.546.0 - ISC
4323 *
4324 * This source code is licensed under the ISC license.
4325 * See the LICENSE file in the root directory of this source tree.
4326 */const zbe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 2a14.5 14.5 0 0 0 0 20 14.5 14.5 0 0 0 0-20",key:"13o1zl"}],["path",{d:"M2 12h20",key:"9i4pu4"}]],bg=Qe("globe",zbe);/**
4327 * @license lucide-react v0.546.0 - ISC
4328 *
4329 * This source code is licensed under the ISC license.
4330 * See the LICENSE file in the root directory of this source tree.
4331 */const qbe=[["line",{x1:"22",x2:"2",y1:"12",y2:"12",key:"1y58io"}],["path",{d:"M5.45 5.11 2 12v6a2 2 0 0 0 2 2h16a2 2 0 0 0 2-2v-6l-3.45-6.89A2 2 0 0 0 16.76 4H7.24a2 2 0 0 0-1.79 1.11z",key:"oot6mr"}],["line",{x1:"6",x2:"6.01",y1:"16",y2:"16",key:"sgf278"}],["line",{x1:"10",x2:"10.01",y1:"16",y2:"16",key:"1l4acy"}
4331]],Kbe=Qe("hard-drive",qbe);/**
4332 * @license lucide-react v0.546.0 - ISC
4333 *
4334 * This source code is licensed under the ISC license.
4335 * See the LICENSE file in the root directory of this source tree.
4336 */const Wbe=[["path",{d:"M3 14h3a2 2 0 0 1 2 2v3a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-7a9 9 0 0 1 18 0v7a2 2 0 0 1-2 2h-1a2 2 0 0 1-2-2v-3a2 2 0 0 1 2-2h3",key:"1xhozi"}]],Er=Qe("headphones",Wbe);/**
4337 * @license lucide-react v0.546.0 - ISC
4338 *
4339 * This source code is licensed under the ISC license.
4340 * See the LICENSE file in the root directory of this source tree.
4341 */const Ybe=[["path",{d:"M15 21v-8a1 1 0 0 0-1-1h-4a1 1 0 0 0-1 1v8",key:"5wwlr5"}],["path",{d:"M3 10a2 2 0 0 1 .709-1.528l7-6a2 2 0 0 1 2.582 0l7 6A2 2 0 0 1 21 10v9a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2z",key:"r6nss1"}]],Qbe=Qe("house",Ybe);/**
4342 * @license lucide-react v0.546.0 - ISC
4343 *
4344 * This source code is licensed under the ISC license.
4345 * See the LICENSE file in the root directory of this source tree.
4346 */const Jbe=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"M12 16v-4",key:"1dtifu"}],["path",{d:"M12 8h.01",key:"e9boi3"}]],TW=Qe("info",Jbe);/**
4347 * @license lucide-react v0.546.0 - ISC
4348 *
4349 * This source code is licensed under the ISC license.
4350 * See the LICENSE file in the root directory of this source tree.
4351 */const Xbe=[["path",{d:"m5 8 6 6",key:"1wu5hv"}],["path",{d:"m4 14 6-6 2-3",key:"1k1g8d"}],["path",{d:"M2 5h12",key:"or177f"}],["path",{d:"M7 2h1",key:"1t2jsx"}],["path",{d:"m22 22-5-10-5 10",key:"don7ne"}],["path",{d:"M14 18h6",key:"1m8k6r"}]],vI=Qe("languages",Xbe);/**
4352 * @license lucide-react v0.546.0 - ISC
4353 *
4354 * This source code is licensed under the ISC license.
4355 * See the LICENSE file in the root directory of this source tree.
4356 */const Zbe=[["path",{d:"M12.83 2.18a2 2 0 0 0-1.66 0L2.6 6.08a1 1 0 0 0 0 1.83l8.58 3.91a2 2 0 0 0 1.66 0l8.58-3.9a1 1 0 0 0 0-1.83z",key:"zw3jo"}],["path",{d:"M2 12a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 12",key:"1wduqc"}],["path",{d:"M2 17a1 1 0 0 0 .58.91l8.6 3.91a2 2 0 0 0 1.65 0l8.58-3.9A1 1 0 0 0 22 17",key:"kqbvx6"}]],q2=Qe("layers",Zbe);/**
4357 * @license lucide-react v0.546.0 - ISC
4358 *
4359 * This source code is licensed under the ISC license.
4360 * See the LICENSE file in the root directory of this source tree.
4361 */const eye=[["circle",{cx:"12",cy:"12",r:"10",key:"1mglay"}],["path",{d:"m4.93 4.93 4.24 4.24",key:"1ymg45"}],["path",{d:"m14.83 9.17 4.24-4.24",key:"1cb5xl"}],["path",{d:"m14.83 14.83 4.24 4.24",key:"q42g0n"}],["path",{d:"m9.17 14.83-4.24 4.24",key:"bqpfvv"}],["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}]],K2=Qe("life-buoy",eye);/**
4362 * @license lucide-react v0.546.0 - ISC
4363 *
4364 * This source code is licensed under the ISC license.
4365 * See the LICENSE file in the root directory of this source tree.
4366 */const tye=[["path",{d:"M15 14c.2-1 .7-1.7 1.5-2.5 1-.9 1.5-2.2 1.5-3.5A6 6 0 0 0 6 8c0 1 .2 2.2 1.5 3.5.7.7 1.3 1.5 1.5 2.5",key:"1gvzjb"}],["path",{d:"M9 18h6",key:"x1upvd"}],["path",{d:"M10 22h4",key:"ceow96"}]],nye=Qe("lightbulb",tye);/**
4367 * @license lucide-react v0.546.0 - ISC
4368 *
4369 * This source code is licensed under the ISC license.
4370 * See the LICENSE file in the root directory of this source tree.
4371 */const rye=[["path",{d:"M21 12a9 9 0 1 1-6.219-8.56",key:"13zald"}]],Bs=Qe("loader-circle",rye);/**
4372 * @license lucide-react v0.546.0 - ISC
4373 *
4374 * This source code is licensed under the ISC license.
4375 * See the LICENSE file in the root directory of this source tree.
4376 */const sye=[["rect",{width:"18",height:"11",x:"3",y:"11",rx:"2",ry:"2",key:"1w4ew1"}],["path",{d:"M7 11V7a5 5 0 0 1 10 0v4",key:"fwvmzm"}]],rl=Qe("lock",sye);/**
4377 * @license lucide-react v0.546.0 - ISC
4378 *
4379 * This source code is licensed under the ISC license.
4380 * See the LICENSE file in the root directory of this source tree.
4381 */const aye=[["path",{d:"m16 17 5-5-5-5",key:"1bji2h"}],["path",{d:"M21 12H9",key:"dn1m92"}],["path",{d:"M9 21H5a2 2 0 0 1-2-2V5a2 2 0 0 1 2-2h4",key:"1uf3rs"}]],fS=Qe("log-out",aye);/**
4382 * @license lucide-react v0.546.0 - ISC
4383 *
4384 * This source code is licensed under the ISC license.
4385 * See the LICENSE file in the root directory of this source tree.
4386 */const iye=[["path",{d:"m22 7-8.991 5.727a2 2 0 0 1-2.009 0L2 7",key:"132q7q"}],["rect",{x:"2",y:"4",width:"20",height:"16",rx:"2",key:"izxlao"}]],Kd=Qe("mail",iye);/**
4387 * @license lucide-react v0.546.0 - ISC
4388 *
4389 * This source code is licensed under the ISC license.
4390 * See the LICENSE file in the root directory of this source tree.
4391 */const oye=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}],["path",{d:"M7.5 9.5c0 .687.265 1.383.697 1.844l3.009 3.264a1.14 1.14 0 0 0 .407.314 1 1 0 0 0 .783-.004 1.14 1.14 0 0 0 .398-.31l3.008-3.264A2.77 2.77 0 0 0 16.5 9.5 2.5 2.5 0 0 0 12 8a2.5 2.5 0 0 0-4.5 1.5",key:"1faxuh"}]],lye=Qe("message-square-heart",oye);/**
4392 * @license lucide-react v0.546.0 - ISC
4393 *
4394 * This source code is licensed under the ISC license.
4395 * See the LICENSE file in the root directory of this source tree.
4396 */const cye=[["path",{d:"M22 17a2 2 0 0 1-2 2H6.828a2 2 0 0 0-1.414.586l-2.202 2.202A.71.71 0 0 1 2 21.286V5a2 2 0 0 1 2-2h16a2 2 0 0 1 2 2z",key:"18887p"}]],W2=Qe("message-square",cye);/**
4397 * @license lucide-react v0.546.0 - ISC
4398 *
4399 * This source code is licensed under the ISC license.
4400 * See the LICENSE file in the root directory of this source tree.
4401 */const dye=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M15 9.34V5a3 3 0 0 0-5.68-1.33",key:"1gzdoj"}],["path",{d:"M16.95 16.95A7 7 0 0 1 5 12v-2",key:"cqa7eg"}],["path",{d:"M18.89 13.23A7 7 0 0 0 19 12v-2",key:"16hl24"}],["path",{d:"m2 2 20 20",key:"1ooewy"}],["path",{d:"M9 9v3a3 3 0 0 0 5.12 2.12",key:"r2i35w"}]],Cy=Qe("mic-off",dye);/**
4402 * @license lucide-react v0.546.0 - ISC
4403 *
4404 * This source code is licensed under the ISC license.
4405 * See the LICENSE file in the root directory of this source tree.
4406 */const uye=[["path",{d:"m11 7.601-5.994 8.19a1 1 0 0 0 .1 1.298l.817.818a1 1 0 0 0 1.314.087L15.09 12",key:"80a601"}],["path",{d:"M16.5 21.174C15.5 20.5 14.372 20 13 20c-2.058 0-3.928 2.356-6 2-2.072-.356-2.775-3.369-1.5-4.5",key:"j0ngtp"}],["circle",{cx:"16",cy:"7",r:"5",key:"d08jfb"}]],hye=Qe("mic-vocal",uye);/**
4407 * @license lucide-react v0.546.0 - ISC
4408 *
4409 * This source code is licensed under the ISC license.
4410 * See the LICENSE file in the root directory of this source tree.
4411 */const fye=[["path",{d:"M12 19v3",key:"npa21l"}],["path",{d:"M19 10v2a7 7 0 0 1-14 0v-2",key:"1vc78b"}],["rect",{x:"9",y:"2",width:"6",height:"13",rx:"3",key:"s6n7sd"}]],Nn=Qe("mic",fye);/**
4412 * @license lucide-react v0.546.0 - ISC
4413 *
4414 * This source code is licensed under the ISC license.
4415 * See the LICENSE file in the root directory of this source tree.
4416 */const mye=[["path",{d:"M20.985 12.486a9 9 0 1 1-9.473-9.472c.405-.022.617.46.402.803a6 6 0 0 0 8.268 8.268c.344-.215.825-.004.803.401",key:"kfwtm"}]],ko=Qe("moon",mye);/**
4417 * @license lucide-react v0.546.0 - ISC
4418 *
4419 * This source code is licensed under the ISC license.
4420 * See the LICENSE file in the root directory of this source tree.
4421 */const pye=[["path",{d:"M9 18V5l12-2v13",key:"1jmyc2"}],["circle",{cx:"6",cy:"18",r:"3",key:"fqmcym"}],["circle",{cx:"18",cy:"16",r:"3",key:"1hluhg"}]],gye=Qe("music",pye);/**
4422 * @license lucide-react v0.546.0 - ISC
4423 *
4424 * This source code is licensed under the ISC license.
4425 * See the LICENSE file in the root directory of this source tree.
4426 */const xye=[["rect",{x:"14",y:"3",width:"5",height:"18",rx:"1",key:"kaeet6"}],["rect",{x:"5",y:"3",width:"5",height:"18",rx:"1",key:"1wsw3u"}]],Fh=Qe("pause",xye);/**
4427 * @license lucide-react v0.546.0 - ISC
4428 *
4429 * This source code is licensed under the ISC license.
4430 * See the LICENSE file in the root directory of this source tree.
4431 */const bye=[["path",{d:"M15.707 21.293a1 1 0 0 1-1.414 0l-1.586-1.586a1 1 0 0 1 0-1.414l5.586-5.586a1 1 0 0 1 1.414 0l1.586 1.586a1 1 0 0 1 0 1.414z",key:"nt11vn"}],["path",{d:"m18 13-1.375-6.874a1 1 0 0 0-.746-.776L3.235 2.028a1 1 0 0 0-1.207 1.207L5.35 15.879a1 1 0 0 0 .776.746L13 18",key:"15qc1e"}],["path",{d:"m2.3 2.3 7.286 7.286",key:"1wuzzi"}],["circle",{cx:"11",cy:"11",r:"2",key:"xmgehs"}]],_6=Qe("pen-tool",bye);/**
4432 * @license lucide-react v0.546.0 - ISC
4433 *
4434 * This source code is licensed under the ISC license.
4435 * See the LICENSE file in the root directory of this source tree.
4436 */const yye=[["path",{d:"M5 5a2 2 0 0 1 3.008-1.728l11.997 6.998a2 2 0 0 1 .003 3.458l-12 7A2 2 0 0 1 5 19z",key:"10ikf1"}]],Xa=Qe("play",yye);/**
4437 * @license lucide-react v0.546.0 - ISC
4438 *
4439 * This source code is licensed under the ISC license.
4440 * See the LICENSE file in the root directory of this source tree.
4441 */const vye=[["path",{d:"M5 12h14",key:"1ays0h"}],["path",{d:"M12 5v14",key:"s699le"}]],Bye=Qe("plus",vye);/**
4442 * @license lucide-react v0.546.0 - ISC
4443 *
4444 * This source code is licensed under the ISC license.
4445 * See the LICENSE file in the root directory of this source tree.
4446 */const wye=[["rect",{width:"5",height:"5",x:"3",y:"3",rx:"1",key:"1tu5fj"}],["rect",{width:"5",height:"5",x:"16",y:"3",rx:"1",key:"1v8r4q"}],["rect",{width:"5",height:"5",x:"3",y:"16",rx:"1",key:"1x03jg"}],["path",{d:"M21 16h-3a2 2 0 0 0-2 2v3",key:"177gqh"}],["path",{d:"M21 21v.01",key:"ents32"}],["path",{d:"M12 7v3a2 2 0 0 1-2 2H7",key:"8crl2c"}],["path",{d:"M3 12h.01",key:"nlz23k"}],["path",{d:"M12 3h.01",key:"n36tog"}],["path",{d:"M12 16v.01",key:"133mhm"}],["path",{d:"M16 12h1",key:"1slzba"}],["path",{d:"M21 12v.01",key:"1lwtk9"}],["path",{d:"M12 21v-1",key:"1880an"}]],Cye=Qe("qr-code",wye);/**
4447 * @license lucide-react v0.546.0 - ISC
4448 *
4449 * This source code is licensed under the ISC license.
4450 * See the LICENSE file in the root directory of this source tree.
4451 */const Eye=[["path",{d:"M16.247 7.761a6 6 0 0 1 0 8.478",key:"1fwjs5"}],["path",{d:"M19.075 4.933a10 10 0 0 1 0 14.134",key:"ehdyv1"}],["path",{d:"M4.925 19.067a10 10 0 0 1 0-14.134",key:"1q22gi"}],["path",{d:"M7.753 16.239a6 6 0 0 1 0-8.478",key:"r2q7qm"}],["circle",{cx:"12",cy:"12",r:"2",key:"1c9p78"}
4451]],cn=Qe("radio",Eye);/**
4452 * @license lucide-react v0.546.0 - ISC
4453 *
4454 * This source code is licensed under the ISC license.
4455 * See the LICENSE file in the root directory of this source tree.
4456 */const Sye=[["path",{d:"M3 12a9 9 0 0 1 9-9 9.75 9.75 0 0 1 6.74 2.74L21 8",key:"v9h5vc"}],["path",{d:"M21 3v5h-5",key:"1q7to0"}],["path",{d:"M21 12a9 9 0 0 1-9 9 9.75 9.75 0 0 1-6.74-2.74L3 16",key:"3uifl3"}],["path",{d:"M8 16H3v5",key:"1cv678"}]],qa=Qe("refresh-cw",Sye);/**
4457 * @license lucide-react v0.546.0 - ISC
4458 *
4459 * This source code is licensed under the ISC license.
4460 * See the LICENSE file in the root directory of this source tree.
4461 */const Tye=[["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"}]],yg=Qe("rotate-ccw",Tye);/**
4462 * @license lucide-react v0.546.0 - ISC
4463 *
4464 * This source code is licensed under the ISC license.
4465 * See the LICENSE file in the root directory of this source tree.
4466 */const Aye=[["path",{d:"M15 12h-5",key:"r7krc0"}],["path",{d:"M15 8h-5",key:"1khuty"}],["path",{d:"M19 17V5a2 2 0 0 0-2-2H4",key:"zz82l3"}],["path",{d:"M8 21h12a2 2 0 0 0 2-2v-1a1 1 0 0 0-1-1H11a1 1 0 0 0-1 1v1a2 2 0 1 1-4 0V5a2 2 0 1 0-4 0v2a1 1 0 0 0 1 1h3",key:"1ph1d7"}]],BC=Qe("scroll-text",Aye);/**
4467 * @license lucide-react v0.546.0 - ISC
4468 *
4469 * This source code is licensed under the ISC license.
4470 * See the LICENSE file in the root directory of this source tree.
4471 */const kye=[["path",{d:"m21 21-4.34-4.34",key:"14j7rj"}],["circle",{cx:"11",cy:"11",r:"8",key:"4ej97u"}]],Nye=Qe("search",kye);/**
4472 * @license lucide-react v0.546.0 - ISC
4473 *
4474 * This source code is licensed under the ISC license.
4475 * See the LICENSE file in the root directory of this source tree.
4476 */const _ye=[["path",{d:"M14 17H5",key:"gfn3mx"}],["path",{d:"M19 7h-9",key:"6i9tg"}],["circle",{cx:"17",cy:"17",r:"3",key:"18b49y"}],["circle",{cx:"7",cy:"7",r:"3",key:"dfmy0x"}]],Iye=Qe("settings-2",_ye);/**
4477 * @license lucide-react v0.546.0 - ISC
4478 *
4479 * This source code is licensed under the ISC license.
4480 * See the LICENSE file in the root directory of this source tree.
4481 */const Dye=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"M12 8v4",key:"1got3b"}],["path",{d:"M12 16h.01",key:"1drbdi"}]],Y2=Qe("shield-alert",Dye);/**
4482 * @license lucide-react v0.546.0 - ISC
4483 *
4484 * This source code is licensed under the ISC license.
4485 * See the LICENSE file in the root directory of this source tree.
4486 */const jye=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}],["path",{d:"m9 12 2 2 4-4",key:"dzmm74"}]],sl=Qe("shield-check",jye);/**
4487 * @license lucide-react v0.546.0 - ISC
4488 *
4489 * This source code is licensed under the ISC license.
4490 * See the LICENSE file in the root directory of this source tree.
4491 */const Rye=[["path",{d:"M20 13c0 5-3.5 7.5-7.66 8.95a1 1 0 0 1-.67-.01C7.5 20.5 4 18 4 13V6a1 1 0 0 1 1-1c2 0 4.5-1.2 6.24-2.72a1.17 1.17 0 0 1 1.52 0C14.51 3.81 17 5 19 5a1 1 0 0 1 1 1z",key:"oel41y"}]],Pye=Qe("shield",Rye);/**
4492 * @license lucide-react v0.546.0 - ISC
4493 *
4494 * This source code is licensed under the ISC license.
4495 * See the LICENSE file in the root directory of this source tree.
4496 */const Lye=[["path",{d:"M2 20h.01",key:"4haj6o"}],["path",{d:"M7 20v-4",key:"j294jx"}],["path",{d:"M12 20v-8",key:"i3yub9"}],["path",{d:"M17 20V8",key:"1tkaf5"}],["path",{d:"M22 4v16",key:"sih9yq"}]],BI=Qe("signal",Lye);/**
4497 * @license lucide-react v0.546.0 - ISC
4498 *
4499 * This source code is licensed under the ISC license.
4500 * See the LICENSE file in the root directory of this source tree.
4501 */const Oye=[["path",{d:"M10 8h4",key:"1sr2af"}],["path",{d:"M12 21v-9",key:"17s77i"}],["path",{d:"M12 8V3",key:"13r4qs"}],["path",{d:"M17 16h4",key:"h1uq16"}],["path",{d:"M19 12V3",key:"o1uvq1"}],["path",{d:"M19 21v-5",key:"qua636"}],["path",{d:"M3 14h4",key:"bcjad9"}],["path",{d:"M5 10V3",key:"cb8scm"}],["path",{d:"M5 21v-7",key:"1w1uti"}]],AW=Qe("sliders-vertical",Oye);/**
4502 * @license lucide-react v0.546.0 - ISC
4503 *
4504 * This source code is licensed under the ISC license.
4505 * See the LICENSE file in the root directory of this source tree.
4506 */const Mye=[["path",{d:"M10 5H3",key:"1qgfaw"}],["path",{d:"M12 19H3",key:"yhmn1j"}
4506],["path",{d:"M14 3v4",key:"1sua03"}],["path",{d:"M16 17v4",key:"1q0r14"}],["path",{d:"M21 12h-9",key:"1o4lsq"}],["path",{d:"M21 19h-5",key:"1rlt1p"}],["path",{d:"M21 5h-7",key:"1oszz2"}],["path",{d:"M8 10v4",key:"tgpxqk"}],["path",{d:"M8 12H3",key:"a7s4jb"}]],Fye=Qe("sliders-horizontal",Mye);/**
4507 * @license lucide-react v0.546.0 - ISC
4508 *
4509 * This source code is licensed under the ISC license.
4510 * See the LICENSE file in the root directory of this source tree.
4511 */const Uye=[["rect",{width:"14",height:"20",x:"5",y:"2",rx:"2",ry:"2",key:"1yt0o3"}],["path",{d:"M12 18h.01",key:"mhygvu"}]],Vye=Qe("smartphone",Uye);/**
4512 * @license lucide-react v0.546.0 - ISC
4513 *
4514 * This source code is licensed under the ISC license.
4515 * See the LICENSE file in the root directory of this source tree.
4516 */const Gye=[["path",{d:"M11.017 2.814a1 1 0 0 1 1.966 0l1.051 5.558a2 2 0 0 0 1.594 1.594l5.558 1.051a1 1 0 0 1 0 1.966l-5.558 1.051a2 2 0 0 0-1.594 1.594l-1.051 5.558a1 1 0 0 1-1.966 0l-1.051-5.558a2 2 0 0 0-1.594-1.594l-5.558-1.051a1 1 0 0 1 0-1.966l5.558-1.051a2 2 0 0 0 1.594-1.594z",key:"1s2grr"}],["path",{d:"M20 2v4",key:"1rf3ol"}
4516],["path",{d:"M22 4h-4",key:"gwowj6"}],["circle",{cx:"4",cy:"20",r:"2",key:"6kqj1y"}]],At=Qe("sparkles",Gye);/**
4517 * @license lucide-react v0.546.0 - ISC
4518 *
4519 * This source code is licensed under the ISC license.
4520 * See the LICENSE file in the root directory of this source tree.
4521 */const $ye=[["rect",{width:"18",height:"18",x:"3",y:"3",rx:"2",key:"afitv7"}]],Ev=Qe("square",$ye);/**
4522 * @license lucide-react v0.546.0 - ISC
4523 *
4524 * This source code is licensed under the ISC license.
4525 * See the LICENSE file in the root directory of this source tree.
4526 */const Hye=[["path",{d:"M11.525 2.295a.53.53 0 0 1 .95 0l2.31 4.679a2.123 2.123 0 0 0 1.595 1.16l5.166.756a.53.53 0 0 1 .294.904l-3.736 3.638a2.123 2.123 0 0 0-.611 1.878l.882 5.14a.53.53 0 0 1-.771.56l-4.618-2.428a2.122 2.122 0 0 0-1.973 0L6.396 21.01a.53.53 0 0 1-.77-.56l.881-5.139a2.122 2.122 0 0 0-.611-1.879L2.16 9.795a.53.53 0 0 1 .294-.906l5.165-.755a2.122 2.122 0 0 0 1.597-1.16z",key:"r04s7s"}]],kW=Qe("star",Hye);/**
4527 * @license lucide-react v0.546.0 - ISC
4528 *
4529 * This source code is licensed under the ISC license.
4530 * See the LICENSE file in the root directory of this source tree.
4531 */const zye=[["circle",{cx:"12",cy:"12",r:"4",key:"4exip2"}],["path",{d:"M12 2v2",key:"tus03m"}],["path",{d:"M12 20v2",key:"1lh1kg"}],["path",{d:"m4.93 4.93 1.41 1.41",key:"149t6j"}],["path",{d:"m17.66 17.66 1.41 1.41",key:"ptbguv"}],["path",{d:"M2 12h2",key:"1t8f8n"}],["path",{d:"M20 12h2",key:"1q8mjw"}],["path",{d:"m6.34 17.66-1.41 1.41",key:"1m8zz5"}],["path",{d:"m19.07 4.93-1.41 1.41",key:"1shlcs"}]],qc=Qe("sun",zye);/**
4532 * @license lucide-react v0.546.0 - ISC
4533 *
4534 * This source code is licensed under the ISC license.
4535 * See the LICENSE file in the root directory of this source tree.
4536 */const qye=[["path",{d:"M12.586 2.586A2 2 0 0 0 11.172 2H4a2 2 0 0 0-2 2v7.172a2 2 0 0 0 .586 1.414l8.704 8.704a2.426 2.426 0 0 0 3.42 0l6.58-6.58a2.426 2.426 0 0 0 0-3.42z",key:"vktsd0"}],["circle",{cx:"7.5",cy:"7.5",r:".5",fill:"currentColor",key:"kqv944"}]],Xk=Qe("tag",qye);/**
4537 * @license lucide-react v0.546.0 - ISC
4538 *
4539 * This source code is licensed under the ISC license.
4540 * See the LICENSE file in the root directory of this source tree.
4541 */const Kye=[["path",{d:"M12 19h8",key:"baeox8"}],["path",{d:"m4 17 6-6-6-6",key:"1yngyt"}]],Q2=Qe("terminal",Kye);/**
4542 * @license lucide-react v0.546.0 - ISC
4543 *
4544 * This source code is licensed under the ISC license.
4545 * See the LICENSE file in the root directory of this source tree.
4546 */const Wye=[["circle",{cx:"9",cy:"12",r:"3",key:"u3jwor"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Yye=Qe("toggle-left",Wye);/**
4547 * @license lucide-react v0.546.0 - ISC
4548 *
4549 * This source code is licensed under the ISC license.
4550 * See the LICENSE file in the root directory of this source tree.
4551 */const Qye=[["circle",{cx:"15",cy:"12",r:"3",key:"1afu0r"}],["rect",{width:"20",height:"14",x:"2",y:"5",rx:"7",key:"g7kal2"}]],Jye=Qe("toggle-right",Qye);/**
4552 * @license lucide-react v0.546.0 - ISC
4553 *
4554 * This source code is licensed under the ISC license.
4555 * See the LICENSE file in the root directory of this source tree.
4556 */const Xye=[["path",{d:"M10 11v6",key:"nco0om"}],["path",{d:"M14 11v6",key:"outv1u"}],["path",{d:"M19 6v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6",key:"miytrc"}],["path",{d:"M3 6h18",key:"d0wm0j"}],["path",{d:"M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2",key:"e791ji"}]],Fd=Qe("trash-2",Xye);/**
4557 * @license lucide-react v0.546.0 - ISC
4558 *
4559 * This source code is licensed under the ISC license.
4560 * See the LICENSE file in the root directory of this source tree.
4561 */const Zye=[["path",{d:"m21.73 18-8-14a2 2 0 0 0-3.48 0l-8 14A2 2 0 0 0 4 21h16a2 2 0 0 0 1.73-3",key:"wmoenq"}],["path",{d:"M12 9v4",key:"juzpu7"}],["path",{d:"M12 17h.01",key:"p32p05"}]],wI=Qe("triangle-alert",Zye);/**
4562 * @license lucide-react v0.546.0 - ISC
4563 *
4564 * This source code is licensed under the ISC license.
4565 * See the LICENSE file in the root directory of this source tree.
4566 */const eve=[["path",{d:"M10 14.66v1.626a2 2 0 0 1-.976 1.696A5 5 0 0 0 7 21.978",key:"1n3hpd"}],["path",{d:"M14 14.66v1.626a2 2 0 0 0 .976 1.696A5 5 0 0 1 17 21.978",key:"rfe1zi"}],["path",{d:"M18 9h1.5a1 1 0 0 0 0-5H18",key:"7xy6bh"}],["path",{d:"M4 22h16",key:"57wxv0"}],["path",{d:"M6 9a6 6 0 0 0 12 0V3a1 1 0 0 0-1-1H7a1 1 0 0 0-1 1z",key:"1mhfuq"}],["path",{d:"M6 9H4.5a1 1 0 0 1 0-5H6",key:"tex48p"}]],tve=Qe("trophy",eve);
4566/**
4567 * @license lucide-react v0.546.0 - ISC
4568 *
4569 * This source code is licensed under the ISC license.
4570 * See the LICENSE file in the root directory of this source tree.
4571 */const nve=[["path",{d:"m16 11 2 2 4-4",key:"9rsbq5"}],["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"}]],wc=Qe("user-check",nve);/**
4572 * @license lucide-react v0.546.0 - ISC
4573 *
4574 * This source code is licensed under the ISC license.
4575 * See the LICENSE file in the root directory of this source tree.
4576 */const rve=[["path",{d:"M19 21v-2a4 4 0 0 0-4-4H9a4 4 0 0 0-4 4v2",key:"975kel"}],["circle",{cx:"12",cy:"7",r:"4",key:"17ys0d"}]],vh=Qe("user",rve);/**
4577 * @license lucide-react v0.546.0 - ISC
4578 *
4579 * This source code is licensed under the ISC license.
4580 * See the LICENSE file in the root directory of this source tree.
4581 */const sve=[["path",{d:"m16 2-2.3 2.3a3 3 0 0 0 0 4.2l1.8 1.8a3 3 0 0 0 4.2 0L22 8",key:"n7qcjb"}],["path",{d:"M15 15 3.3 3.3a4.2 4.2 0 0 0 0 6l7.3 7.3c.7.7 2 .7 2.8 0L15 15Zm0 0 7 7",key:"d0u48b"}],["path",{d:"m2.1 21.8 6.4-6.3",key:"yn04lh"}],["path",{d:"m19 5-7 7",key:"194lzd"}]],ave=Qe("utensils-crossed",sve);/**
4582 * @license lucide-react v0.546.0 - ISC
4583 *
4584 * This source code is licensed under the ISC license.
4585 * See the LICENSE file in the root directory of this source tree.
4586 */const ive=[["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"}]],ove=Qe("volume-1",ive);/**
4587 * @license lucide-react v0.546.0 - ISC
4588 *
4589 * This source code is licensed under the ISC license.
4590 * See the LICENSE file in the root directory of this source tree.
4591 */const lve=[["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"}]],on=Qe("volume-2",lve);/**
4592 * @license lucide-react v0.546.0 - ISC
4593 *
4594 * This source code is licensed under the ISC license.
4595 * See the LICENSE file in the root directory of this source tree.
4596 */const cve=[["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"}]],mS=Qe("volume-x",cve);/**
4597 * @license lucide-react v0.546.0 - ISC
4598 *
4599 * This source code is licensed under the ISC license.
4600 * See the LICENSE file in the root directory of this source tree.
4601 */const dve=[["path",{d:"M18 6 6 18",key:"1bl5f8"}],["path",{d:"m6 6 12 12",key:"d8bk6v"}]],Ts=Qe("x",dve);/**
4602 * @license lucide-react v0.546.0 - ISC
4603 *
4604 * This source code is licensed under the ISC license.
4605 * See the LICENSE file in the root directory of this source tree.
4606 */const uve=[["path",{d:"M4 14a1 1 0 0 1-.78-1.63l9.9-10.2a.5.5 0 0 1 .86.46l-1.92 6.02A1 1 0 0 0 13 10h7a1 1 0 0 1 .78 1.63l-9.9 10.2a.5.5 0 0 1-.86-.46l1.92-6.02A1 1 0 0 0 11 14z",key:"1xq2db"}]],xi=Qe("zap",uve);var hve=Object.defineProperty,wE=Object.getOwnPropertySymbols,NW=Object.prototype.hasOwnProperty,_W=Object.prototype.propertyIsEnumerable,I6=(n,e,t)=>e in n?hve(n,e,{enumerable:!0,configurable:!0,writable:!0,value:t}):n[e]=t,CI=(n,e)=>{for(var t in e||(e={}))NW.call(e,t)&&I6(n,t,e[t]);if(wE)for(var t of wE(e))_W.call(e,t)&&I6(n,t,e[t]);return n},EI=(n,e)=>{var t={};for(var r in n)NW.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&wE)for(var r of wE(n))e.indexOf(r)<0&&_W.call(n,r)&&(t[r]=n[r]);return t};/**
4607 * @license QR Code generator library (TypeScript)
4608 * Copyright (c) Project Nayuki.
4609 * SPDX-License-Identifier: MIT
4610 */var Lm;(n=>{const e=class nn{constructor(c,d,h,m){if(this.version=c,this.errorCorrectionLevel=d,this.modules=[],this.isFunction=[],c<nn.MIN_VERSION||c>nn.MAX_VERSION)throw new RangeError("Version value out of range");if(m<-1||m>7)throw new RangeError("Mask value out of range");this.size=c*4+17;let p=[];for(let y=0;y<this.size;y++)p.push(!1);for(let y=0;y<this.size;y++)this.modules.push(p.slice()),this.isFunction.push(p.slice());this.drawFunctionPatterns();const x=this.addEccAndInterleave(h);if(this.drawCodewords(x),m==-1){let y=1e9;for(let v=0;v<8;v++){this.applyMask(v),this.drawFormatBits(v);const B=this.getPenaltyScore();B<y&&(m=v,y=B),this.applyMask(v)}}
vendor: 4,471 bytes, line 4610
4610s(0<=m&&m<=7),this.mask=m,this.applyMask(m),this.drawFormatBits(m),this.isFunction=[]}static encodeText(c,d){const h=n.QrSegment.makeSegments(c);return nn.encodeSegments(h,d)}static encodeBinary(c,d){const h=n.QrSegment.makeBytes(c);return nn.encodeSegments([h],d)}static encodeSegments(c,d,h=1,m=40,p=-1,x=!0){if(!(nn.MIN_VERSION<=h&&h<=m&&m<=nn.MAX_VERSION)||p<-1||p>7)throw new RangeError("Invalid value");let y,v;for(y=h;;y++){const T=nn.getNumDataCodewords(y,d)*8,k=o.getTotalBits(c,y);if(k<=T){v=k;break}if(y>=m)throw new RangeError("Data too long")}for(const T of[nn.Ecc.MEDIUM,nn.Ecc.QUARTILE,nn.Ecc.HIGH])x&&v<=nn.getNumDataCodewords(y,T)*8&&(d=T);let B=[];for(const T of c){t(T.mode.modeBits,4,B),t(T.numChars,T.mode.numCharCountBits(y),B);for(const k of T.getData())B.push(k)}s(B.length==v);const E=nn.getNumDataCodewords(y,d)*8;s(B.length<=E),t(0,Math.min(4,E-B.length),B),t(0,(8-B.length%8)%8,B),s(B.length%8==0);for(let T=236;B.length<E;T^=253)t(T,8,B);let N=[];for(;N.length*8<B.length;)N.push(0);return B.forEach((T,k)=>N[k>>>3]|=T<<7-(k&7)),new nn(y,d,N,p)}getModule(c,d){return 0<=c&&c<this.size&&0<=d&&d<this.size&&this.modules[d][c]}getModules(){return this.modules}drawFunctionPatterns(){for(let h=0;h<this.size;h++)this.setFunctionModule(6,h,h%2==0),this.setFunctionModule(h,6,h%2==0);this.drawFinderPattern(3,3),this.drawFinderPattern(this.size-4,3),this.drawFinderPattern(3,this.size-4);const c=this.getAlignmentPatternPositions(),d=c.length;for(let h=0;h<d;h++)for(let m=0;m<d;m++)h==0&&m==0||h==0&&m==d-1||h==d-1&&m==0||this.drawAlignmentPattern(c[h],c[m]);this.drawFormatBits(0),this.drawVersion()}drawFormatBits(c){const d=this.errorCorrectionLevel.formatBits<<3|c;let h=d;for(let p=0;p<10;p++)h=h<<1^(h>>>9)*1335;const m=(d<<10|h)^21522;s(m>>>15==0);for(let p=0;p<=5;p++)this.setFunctionModule(8,p,r(m,p));this.setFunctionModule(8,7,r(m,6)),this.setFunctionModule(8,8,r(m,7)),this.setFunctionModule(7,8,r(m,8));for(let p=9;p<15;p++)this.setFunctionModule(14-p,8,r(m,p));for(let p=0;p<8;p++)this.setFunctionModule(this.size-1-p,8,r(m,p));for(let p=8;p<15;p++)this.setFunctionModule(8,this.size-15+p,r(m,p));this.setFunctionModule(8,this.size-8,!0)}drawVersion(){if(this.version<7)return;let c=this.version;for(let h=0;h<12;h++)c=c<<1^(c>>>11)*7973;const d=this.version<<12|c;s(d>>>18==0);for(let h=0;h<18;h++){const m=r(d,h),p=this.size-11+h%3,x=Math.floor(h/3);this.setFunctionModule(p,x,m),this.setFunctionModule(x,p,m)}}drawFinderPattern(c,d){for(let h=-4;h<=4;h++)for(let m=-4;m<=4;m++){const p=Math.max(Math.abs(m),Math.abs(h)),x=c+m,y=d+h;0<=x&&x<this.size&&0<=y&&y<this.size&&this.setFunctionModule(x,y,p!=2&&p!=4)}}drawAlignmentPattern(c,d){for(let h=-2;h<=2;h++)for(let m=-2;m<=2;m++)this.setFunctionModule(c+m,d+h,Math.max(Math.abs(m),Math.abs(h))!=1)}setFunctionModule(c,d,h){this.modules[d][c]=h,this.isFunction[d][c]=!0}addEccAndInterleave(c){const d=this.version,h=this.errorCorrectionLevel;if(c.length!=nn.getNumDataCodewords(d,h))throw new RangeError("Invalid argument");const m=nn.NUM_ERROR_CORRECTION_BLOCKS[h.ordinal][d],p=nn.ECC_CODEWORDS_PER_BLOCK[h.ordinal][d],x=Math.floor(nn.getNumRawDataModules(d)/8),y=m-x%m,v=Math.floor(x/m);let B=[];const E=nn.reedSolomonComputeDivisor(p);for(let T=0,k=0;T<m;T++){let P=c.slice(k,k+v-p+(T<y?0:1));k+=P.length;const R=nn.reedSolomonComputeRemainder(P,E);T<y&&P.push(0),B.push(P.concat(R))}let N=[];for(let T=0;T<B[0].length;T++)B.forEach((k,P)=>{(T!=v-p||P>=y)&&N.push(k[T])});return s(N.length==x),N}drawCodewords(c){if(c.length!=Math.floor(nn.getNumRawDataModules(this.version)/8))throw new RangeError("Invalid argument");let d=0;for(let h=this.size-1;h>=1;h-=2){h==6&&(h=5);for(let m=0;m<this.size;m++)for(let p=0;p<2;p++){const x=h-p,v=(h+1&2)==0?this.size-1-m:m;!this.isFunction[v][x]&&d<c.length*8&&(this.modules[v][x]=r(c[d>>>3],7-(d&7)),d++)}}s(d==c.length*8)}applyMask(c){if(c<0||c>7)throw new RangeError("Mask value out of range");for(let d=0;d<this.size;d++)for(let h=0;h<this.size;h++){let m;switch(c){case 0:m=(h+d)%2==0;break;case 1:m=d%2==0;break;case 2:m=h%3==0;break;case 3:m=(h+d)%3==0;break;case 4:m=(Math.floor(h/3)+Math.floor(d/2))%2==0;break;case 5:m=h*d%2+h*d%3==0;break;case 6:m=(h*d%2+h*d%3)%2==0;break;case 7:m=((h+d)%2+h*d%3)%2==0;break;default:throw new Error("Unreachable")}!this.isFunction[d][h]&&m&&(this.modules[d][h]=!this.modules[d][h])}}getPenaltyScore(){let c=0;for(let p=0;p<this.size;p++){let x=!1,y=0,v=[0,0,0,0,0,0,0];for(let B=0;B<this.size;
4610B++)this.modules[p][B]==x?(y++,y==5?c+=nn.PENALTY_N1:y>5&&c++):(this.finderPenaltyAddHistory(y,v),x||(c+=this.finderPenaltyCountPatterns(v)*nn.PENALTY_N3),x=this.modules[p][B],y=1);c+=this.finderPenaltyTerminateAndCount(x,y,v)*nn.PENALTY_N3}for(let p=0;p<this.size;p++){let x=!1,y=0,v=[0,0,0,0,0,0,0];for(let B=0;B<this.size;B++)this.modules[B][p]==x?(y++,y==5?c+=nn.PENALTY_N1:y>5&&c++):(this.finderPenaltyAddHistory(y,v),x||(c+=this.finderPenaltyCountPatterns(v)*nn.PENALTY_N3),x=this.modules[B][p],y=1);c+=this.finderPenaltyTerminateAndCount(x,y,v)*nn.PENALTY_N3}for(let p=0;p<this.size-1;p++)for(let x=0;x<this.size-1;x++){const y=this.modules[p][x];y==this.modules[p][x+1]&&y==this.modules[p+1][x]&&y==this.modules[p+1][x+1]&&(c+=nn.PENALTY_N2)}let d=0;for(const p of this.modules)d=p.reduce((x,y)=>x+(y?1:0),d);const h=this.size*this.size,m=Math.ceil(Math.abs(d*20-h*10)/h)-1;return s(0<=m&&m<=9),c+=m*nn.PENALTY_N4,s(0<=c&&c<=2568888),c}getAlignmentPatternPositions(){if(this.version==1)return[];{const c=Math.floor(this.version/7)+2,d=this.version==32?26:Math.ceil((this.version*4+4)/(c*2-2))*2;let h=[6];for(let m=this.size-7;h.length<c;m-=d)h.splice(1,0,m);return h}}static getNumRawDataModules(c){if(c<nn.MIN_VERSION||c>nn.MAX_VERSION)throw new RangeError("Version number out of range");let d=(16*c+128)*c+64;if(c>=2){const h=Math.floor(c/7)+2;d-=(25*h-10)*h-55,c>=7&&(d-=36)}return s(208<=d&&d<=29648),d}static getNumDataCodewords(c,d){return Math.floor(nn.getNumRawDataModules(c)/8)-nn.ECC_CODEWORDS_PER_BLOCK[d.ordinal][c]*nn.NUM_ERROR_CORRECTION_BLOCKS[d.ordinal][c]}static reedSolomonComputeDivisor(c){if(c<1||c>255)throw new RangeError("Degree out of range");let d=[];for(let m=0;m<c-1;m++)d.push(0);d.push(1);let h=1;for(let m=0;m<c;m++){for(let p=0;p<d.length;p++)d[p]=nn.reedSolomonMultiply(d[p],h),p+1<d.length&&(d[p]^=d[p+1]);h=nn.reedSolomonMultiply(h,2)}return d}static reedSolomonComputeRemainder(c,d){let h=d.map(m=>0);for(const m of c){const p=m^h.shift();h.push(0),d.forEach((x,y)=>h[y]^=nn.reedSolomonMultiply(x,p))}return h}static reedSolomonMultiply(c,d){if(c>>>8||d>>>8)throw new RangeError("Byte out of range");let h=0;for(let m=7;m>=0;m--)h=h<<1^(h>>>7)*285,h^=(d>>>m&1)*c;return s(h>>>8==0),h}finderPenaltyCountPatterns(c){const d=c[1];s(d<=this.size*3);const h=d>0&&c[2]==d&&c[3]==d*3&&c[4]==d&&c[5]==d;return(h&&c[0]>=d*4&&c[6]>=d?1:0)+(h&&c[6]>=d*4&&c[0]>=d?1:0)}finderPenaltyTerminateAndCount(c,d,h){return c&&(this.finderPenaltyAddHistory(d,h),d=0),d+=this.size,this.finderPenaltyAddHistory(d,h),this.finderPenaltyCountPatterns(h)}finderPenaltyAddHistory(c,d){d[0]==0&&(c+=this.size),d.pop(),d.unshift(c)}};e.MIN_VERSION=1,e.MAX_VERSION=40,e.PENALTY_N1=3,e.PENALTY_N2=3,e.PENALTY_N3=40,e.PENALTY_N4=10,e.ECC_CODEWORDS_PER_BLOCK=[[-1,7,10,15,20,26,18,20,24,30,18,20,24,26,30,22,24,28,30,28,28,28,28,30,30,26,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,10,16,26,18,24,16,18,22,22,26,30,22,22,24,24,28,28,26,26,26,26,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28,28],[-1,13,22,18,26,18,24,18,22,20,24,28,26,24,20,30,24,28,28,26,30,28,30,30,30,30,28,30,30,30,30,30,30,30,30,30,30,30,30,30,30],[-1,17,28,22,16,22,28,26,26,24,28,24,28,22,24,24,30,28,28,26,28,30,24,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30,30]],e.NUM_ERROR_CORRECTION_BLOCKS=[[-1,1,1,1,1,1,2,2,2,2,4,4,4,4,4,6,6,6,6,7,8,8,9,9,10,12,12,12,13,14,15,16,17,18,19,19,20,21,22,24,25],[-1,1,1,1,2,2,4,4,4,5,5,5,8,9,9,10,10,11,13,14,16,17,17,18,20,21,23,25,26,28,29,31,33,35,37,38,40,43,45,47,49],[-1,1,1,2,2,4,4,6,6,8,8,8,10,12,16,12,17,16,18,21,20,23,23,25,27,29,34,34,35,38,40,43,45,48,51,53,56,59,62,65,68],[-1,1,1,2,4,4,4,5,6,8,8,11,11,16,16,18,16,19,21,25,25,25,34,30,32,35,37,40,42,45,48,51,54,57,60,63,66,70,74,77,81]],n.QrCode=e;function t(l,c,d){if(c<0||c>31||l>>>c)throw new RangeError("Value out of range");for(let h=c-1;h>=0;h--)d.push(l>>>h&1)}function r(l,c){return(l>>>c&1)!=0}function s(l){if(!l)throw new Error("Assertion error")}const a=class as{constructor(c,d,h){if(this.mode=c,this.numChars=d,this.bitData=h,d<0)throw new RangeError("Invalid argument");this.bitData=h.slice()}static makeBytes(c){let d=[];
4610for(const h of c)t(h,8,d);return new as(as.Mode.BYTE,c.length,d)}static makeNumeric(c){if(!as.isNumeric(c))throw new RangeError("String contains non-numeric characters");let d=[];for(let h=0;h<c.length;){const m=Math.min(c.length-h,3);t(parseInt(c.substring(h,h+m),10),m*3+1,d),h+=m}return new as(as.Mode.NUMERIC,c.length,d)}static makeAlphanumeric(c){if(!as.isAlphanumeric(c))throw new RangeError("String contains unencodable characters in alphanumeric mode");let d=[],h;for(h=0;h+2<=c.length;h+=2){let m=as.ALPHANUMERIC_CHARSET.indexOf(c.charAt(h))*45;m+=as.ALPHANUMERIC_CHARSET.indexOf(c.charAt(h+1)),t(m,11,d)}return h<c.length&&t(as.ALPHANUMERIC_CHARSET.indexOf(c.charAt(h)),6,d),new as(as.Mode.ALPHANUMERIC,c.length,d)}static makeSegments(c){return c==""?[]:as.isNumeric(c)?[as.makeNumeric(c)]:as.isAlphanumeric(c)?[as.makeAlphanumeric(c)]:[as.makeBytes(as.toUtf8ByteArray(c))]}static makeEci(c){let d=[];if(c<0)throw new RangeError("ECI assignment value out of range");if(c<128)t(c,8,d);else if(c<16384)t(2,2,d),t(c,14,d);else if(c<1e6)t(6,3,d),t(c,21,d);else throw new RangeError("ECI assignment value out of range");return new as(as.Mode.ECI,0,d)}static isNumeric(c){return as.NUMERIC_REGEX.test(c)}static isAlphanumeric(c){return as.ALPHANUMERIC_REGEX.test(c)}getData(){return this.bitData.slice()}static getTotalBits(c,d){let h=0;for(const m of c){const p=m.mode.numCharCountBits(d);if(m.numChars>=1<<p)return 1/0;h+=4+p+m.bitData.length}return h}static toUtf8ByteArray(c){c=encodeURI(c);let d=[];for(let h=0;h<c.length;h++)c.charAt(h)!="%"?d.push(c.charCodeAt(h)):(d.push(parseInt(c.substring(h+1,h+3),16)),h+=2);return d}};a.NUMERIC_REGEX=/^[0-9]*$/,a.ALPHANUMERIC_REGEX=/^[A-Z0-9 $%*+.\/:-]*$/,a.ALPHANUMERIC_CHARSET="0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ $%*+-./:";let o=a;n.QrSegment=a})(Lm||(Lm={}));(n=>{(e=>{const t=class{constructor(s,a){this.ordinal=s,this.formatBits=a}};t.LOW=new t(0,1),t.MEDIUM=new t(1,0),t.QUARTILE=new t(2,3),t.HIGH=new t(3,2),e.Ecc=t})(n.QrCode||(n.QrCode={}))})(Lm||(Lm={}));(n=>{(e=>{const t=class{constructor(s,a){this.modeBits=s,this.numBitsCharCount=a}numCharCountBits(s){return this.numBitsCharCount[Math.floor((s+7)/17)]}};t.NUMERIC=new t(1,[10,12,14]),t.ALPHANUMERIC=new t(2,[9,11,13]),t.BYTE=new t(4,[8,16,16]),t.KANJI=new t(8,[8,10,12]),t.ECI=new t(7,[0,0,0]),e.Mode=t})(n.QrSegment||(n.QrSegment={}))})(Lm||(Lm={}));var S0=Lm;/**
4611 * @license qrcode.react
4612 * Copyright (c) Paul O'Shannessy
4613 * SPDX-License-Identifier: ISC
4614 */var fve={L:S0.QrCode.Ecc.LOW,M:S0.QrCode.Ecc.MEDIUM,Q:S0.QrCode.Ecc.QUARTILE,H:S0.QrCode.Ecc.HIGH},IW=128,DW="L",jW="#FFFFFF",RW="#000000",PW=!1,LW=1,mve=4,pve=0,gve=.1;function OW(n,e=0){const t=[];return n.forEach(function(r,s){let a=null;r.forEach(function(o,l){if(!o&&a!==null){t.push(`M${a+e} ${s+e}h${l-a}v1H${a+e}z`),a=null;return}if(l===r.length-1){if(!o)return;a===null?t.push(`M${l+e},${s+e} h1v1H${l+e}z`):t.push(`M${a+e},${s+e} h${l+1-a}v1H${a+e}z`);return}o&&a===null&&(a=l)})}),t.join("")}function MW(n,e){return n.slice().map((t,r)=>r<e.y||r>=e.y+e.h?t:t.map((s,a)=>a<e.x||a>=e.x+e.w?s:!1))}function xve(n,e,t,r){if(r==null)return null;const s=n.length+t*2,a=Math.floor(e*gve),o=s/e,l=(r.width||a)*o,c=(r.height||a)*o,d=r.x==null?n.length/2-l/2:r.x*o,h=r.y==null?n.length/2-c/2:r.y*o,m=r.opacity==null?1:r.opacity;let p=null;if(r.excavate){let y=Math.floor(d),v=Math.floor(h),B=Math.ceil(l+d-y),E=Math.ceil(c+h-v);p={x:y,y:v,w:B,h:E}}const x=r.crossOrigin;return{x:d,y:h,h:c,w:l,excavation:p,opacity:m,crossOrigin:x}}function bve(n,e){return e!=null?Math.max(Math.floor(e),0):n?mve:pve}function FW({value:n,level:e,minVersion:t,includeMargin:r,marginSize:s,imageSettings:a,size:o,boostLevel:l}){let c=Mn.useMemo(()=>{const y=(Array.isArray(n)?n:[n]).reduce((v,B)=>(v.push(...S0.QrSegment.makeSegments(B)),v),[]);return S0.QrCode.encodeSegments(y,fve[e],t,void 0,void 0,l)},[n,e,t,l]);const{cells:d,margin:h,numCells:m,calculatedImageSettings:p}=Mn.useMemo(()=>{let x=c.getModules();const y=bve(r,s),v=x.length+y*2,B=xve(x,o,y,a);return{cells:x,margin:y,numCells:v,calculatedImageSettings:B}},[c,o,a,r,s]);return{qrcode:c,margin:h,cells:d,numCells:m,calculatedImageSettings:p}}var yve=(function(){try{new Path2D().addPath(new Path2D)}catch{return!1}return!0})(),vve=Mn.forwardRef(function(e,t){const r=e,{value:s,size:a=IW,level:o=DW,bgColor:l=jW,fgColor:c=RW,includeMargin:d=PW,minVersion:h=LW,boostLevel:m,marginSize:p,imageSettings:x}=r,v=EI(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","marginSize","imageSettings"]),{style:B}=v,E=EI(v,["style"]),N=x==null?void 0:x.src,T=Mn.useRef(null),k=Mn.useRef(null),P=Mn.useCallback(ee=>{T.current=ee,typeof t=="function"?t(ee):t&&(t.current=ee)},[t]),[R,_]=Mn.useState(!1),{margin:I,cells:D,numCells:j,calculatedImageSettings:O}=FW({value:s,level:o,minVersion:h,boostLevel:m,includeMargin:d,marginSize:p,imageSettings:x,size:a});Mn.useEffect(()=>{if(T.current!=null){const ee=T.current,ie=ee.getContext("2d");if(!ie)return;let G=D;const Z=k.current,z=O!=null&&Z!==null&&Z.complete&&Z.naturalHeight!==0&&Z.naturalWi
4614dth!==0;z&&O.excavation!=null&&(G=MW(D,O.excavation));const se=window.devicePixelRatio||1;ee.height=ee.width=a*se;const re=a/j*se;ie.scale(re,re),ie.fillStyle=l,ie.fillRect(0,0,j,j),ie.fillStyle=c,yve?ie.fill(new Path2D(OW(G,I))):D.forEach(function(H,Y){H.forEach(function(de,W){de&&ie.fillRect(W+I,Y+I,1,1)})}),O&&(ie.globalAlpha=O.opacity),z&&ie.drawImage(Z,O.x+I,O.y+I,O.w,O.h)}}),Mn.useEffect(()=>{_(!1)},[N]);const M=CI({height:a,width:a},B);let U=null;return N!=null&&(U=Mn.createElement("img",{src:N,key:N,style:{display:"none"},onLoad:()=>{_(!0)},ref:k,crossOrigin:O==null?void 0:O.crossOrigin})),Mn.createElement(Mn.Fragment,null,Mn.createElement("canvas",CI({style:M,height:a,width:a,ref:P,role:"img"},E)),U)});vve.displayName="QRCodeCanvas";var UW=Mn.forwardRef(function(e,t){const r=e,{value:s,size:a=IW,level:o=DW,bgColor:l=jW,fgColor:c=RW,includeMargin:d=PW,minVersion:h=LW,boostLevel:m,title:p,marginSize:x,imageSettings:y}=r,v=EI(r,["value","size","level","bgColor","fgColor","includeMargin","minVersion","boostLevel","title","marginSize","imageSettings"]),{margin:B,cells:E,numCells:N,calculatedImageSettings:T}=FW({value:s,level:o,minVersion:h,boostLevel:m,includeMargin:d,marginSize:x,imageSettings:y,size:a});let k=E,P=null;y!=null&&T!=null&&(T.excavation!=null&&(k=MW(E,T.excavation)),P=Mn.createElement("image",{href:y.src,height:T.h,width:T.w,x:T.x+B,y:T.y+B,preserveAspectRatio:"none",opacity:T.opacity,crossOrigin:T.crossOrigin}));const R=OW(k,B);return Mn.createElement("svg",CI({height:a,width:a,viewBox:`0 0 ${N} ${N}`,ref:t,role:"img"},v),!!p&&Mn.createElement("title",null,p),Mn.createElement("path",{fill:l,d:`M0,0 h${N}v${N}H0z`,shapeRendering:"crispEdges"}),Mn.createElement("path",{fill:c,d:R,shapeRendering:"crispEdges"}),P)});UW.displayName="QRCodeSVG";function Bve({user:n,tierId:e="yearly",amountInCents:t=49900,tierName:r,priceDisplay:s,periodDisplay:a,equivalentMonthly:o,isVerifying:l,setIsVerifying:c,paymentError:d,setPaymentError:h,onSuccess:m,onOpenAuthModal:p,onSwitchToPayPal:x}){const{t:y,language:v}=Or(),B=v==="zh-CN",[E,N]=S.useState(!1),[T,k]=S.useState(null),[P,R]=S.useState(null),[_,I]=S.useState(!1),[D,j]=S.useState(300),O=S.useRef(null),M=S.useRef(null),U=async()=>{if(n)try{N(!0),h(null),k(null),j(300);const ee=t||(e==="monthly"?6900:e==="quarterly"?16900:49900),ie=r?`RadioShadow AI PRO - ${r}`:e==="monthly"?"RadioShadow AI PRO 会员 (月度)":e==="quarterly"?"RadioShadow AI PRO 会员 (季度)":"RadioShadow AI PRO 会员 (年度最畅销)",Z=await(await fetch("/api/wechat/create-order",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({uid:n.uid,email:n.email,amount:ee,description:ie})})).json();Z.success&&Z.code_url?(k(Z.code_url),R(Z.out_trade_no)):h(Z.error||"创建微信支付订单失败,请重试")}catch(ee){console.error("Create WeChat Pay Order Error:",ee),h("网络请求失败,请检查网络后重试")}finally{N(!1)}};return S.useEffect(()=>(n&&U(),()=>{O.current&&clearInterval(O.current),M.current&&clearInterval(M.current)}),[n==null?void 0:n.uid,t,e]),S.useEffect(()=>{if(!(!T||_))return M.current=setInterval(()=>{j(ee=>ee<=1?(clearInterval(M.current),0):ee-1)},1e3),()=>{M.current&&clearInterval(M.current)}},[T,_]),S.useEffect(()=>{if(!(!P||!T||_||D<=0))return O.current=setInterval(async()=>{try{const ee=`/api/wechat/query-order/${encodeURIComponent(P)}?uid=${encodeURIComponent((n==null?void 0:n.uid)||"")}&email=${encodeURIComponent((n==null?void 0:n.email)||"")}`,G=await(await fetch(ee)).json();if(G.success&&G.isPaid){if(clearInterval(O.current),I(!0),c(!0),n!=null&&n.uid)try{const Z=qi(fn,"users",n.uid);await Dm(Z,{isPro:!0,paymentMethod:"wechat_pay"},{merge:!0})}catch(Z){console.warn("Client firestore sync warning:",Z)}setTimeout(()=>{c(!1),m()},1500)}}catch(ee){console.warn("WeChat Pay polling status check:",ee)}},2500),()=>{O.current&&clearInterval(O.current)}},[P,T,_,D,n]),n?_||l?i.jsxs("div",{className:"py-8 flex flex-col items-center justify-center gap-3 text-emerald-700 dark:text-emerald-400 font-bold text-sm bg-emerald-50/80 dark:bg-emerald-950/40 rounded-3xl border border-emerald-300 dark:border-emerald-500/40 p-6 animate-in fade-in zoom-in duration-300",children:[i.jsx("div",{className:"w-12 h-12 rounded-full bg-emerald-500 text-white flex items-center justify-center shadow-lg shadow-emerald-500/30 animate-bounce",children:i.jsx(vn,{className:"w-7 h-7"})}),i.jsx("span",{className:"text-base font-extrabold text-emerald-800 dark:text-emerald-300",children:B?"🎉 微信支付成功!PRO 会员已开通":"Payment Successful! PRO Activated"}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-normal",children:B?"正在为您同步尊贵会员权限,请稍候...":"Syncing your account benef
4614its..."})]}):i.jsxs("div",{className:"flex flex-col gap-3.5 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-gradient-to-r from-emerald-500/10 via-teal-500/10 to-emerald-500/5 border border-emerald-500/30 rounded-2xl",children:[i.jsxs("div",{className:"flex flex-col text-left",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"inline-block w-2 h-2 rounded-full bg-[#07C160] animate-pulse"}),i.jsx("span",{className:"text-xs font-black uppercase tracking-wider text-emerald-800 dark:text-emerald-300",children:r||(B?"PRO 年度会员":"PRO Annual Membership")})]}),i.jsxs("span",{className:"text-[11px] text-slate-500 dark:text-slate-400 mt-0.5",children:[o?`${o} · `:"",B?"无限次 AI 广播同传 + 30分钟长流跟读":"Unlimited AI streaming & shadowing"]})]}),i.jsxs("div",{className:"flex flex-col items-end",children:[i.jsxs("div",{className:"flex items-baseline gap-1",children:[i.jsx("span",{className:"text-2xl font-black text-emerald-600 dark:text-emerald-400 font-mono",children:s||`¥${((t||49900)/100).toFixed(0)}`}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:a||(B?"/年":"/yr")})]}),e==="yearly"&&i.jsx("span",{className:"text-[10px] text-amber-600 dark:text-amber-400 font-semibold",children:B?"🔥 最畅销 · 立省40%":"🔥 Best Value · Save 40%"}),e==="quarterly"&&i.jsx("span",{className:"text-[10px] text-blue-600 dark:text-blue-400 font-semibold",children:B?"立省 18%":"Save 18%"})]})]}),d&&i.jsxs("div",{className:"w-full p-3 bg-red-50 dark:bg-red-950/30 text-red-600 dark:text-red-400 text-xs rounded-xl border border-red-200 dark:border-red-900/40 flex items-center gap-2",children:[i.jsx(Qa,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:d})]}),i.jsxs("div",{className:"w-full bg-white dark:bg-slate-900 border-2 border-emerald-500/30 rounded-2xl p-4 flex flex-col items-center justify-center relative shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3 bg-[#07C160]/10 text-[#07C160] px-3 py-1 rounded-full text-xs font-bold border border-[#07C160]/20",children:[i.jsx("svg",{className:"w-4 h-4 fill-current",viewBox:"0 0 24 24",children:i.jsx("path",{d:"M8.691 2.188C3.891 2.188 0 5.478 0 9.53c0 2.212 1.17 4.203 3.002 5.55a.59.59 0 0 1 .213.665l-.39 1.48c-.019.07-.048.141-.048.213 0 .163.13.295.294.295a.3.3 0 0 0 .168-.052l1.9-1.104a.72.72 0 0 1 .593-.075c.92.26 1.902.404 2.959.404.305 0 .603-.016.9-.044-.223-.623-.346-1.288-.346-1.98 0-3.614 3.447-6.543 7.7-6.543.27 0 .536.012.798.035C16.82 5.578 13.067 2.188 8.691 2.188zm-2.07 4.148c.616 0 1.115.5 1.115 1.115s-.5 1.116-1.115 1.116a1.115 1.115 0 0 1-1.116-1.116c0-.615.5-1.115 1.116-1.115zm5.02 0c.616 0 1.116.5 1.116 1.115s-.5 1.116-1.116 1.116a1.116 1.116 0 0 1-1.115-1.116c0-.615.5-1.115 1.115-1.115zm4.847 4.707c-3.69 0-6.682 2.508-6.682 5.602 0 3.094 2.992 5.602 6.682 5.602.83 0 1.62-.125 2.355-.347.164-.05.342-.03.49.057l1.492.868a.23.23 0 0 0 .132.04c.13 0 .232-.104.232-.232 0-.057-.023-.113-.038-.168l-.307-1.163a.47.47 0 0 1 .168-.524c1.47-1.077 2.406-2.67 2.406-4.434 0-3.094-2.992-5.602-6.682-5.602zm-2.128 3.524a.88.88 0 1 1 0 1.76.88.88 0 0 1 0-1.76zm4.256 0a.88.88 0 1 1 0 1.76.88.88 0 0 1 0-1.76z"})}),i.jsx("span",{children:B?"微信支付 · 扫码即开通":"WeChat Pay • Scan to Unlock"})]}),i.jsx("div",{className:"relative p-3 bg-white rounded-xl shadow-inner border border-slate-100 dark:border-slate-800 flex items-center justify-center min-w-[190px] min-h-[190px]",children:E?i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 text-slate-400",children:[i.jsx(qa,{className:"w-8 h-8 animate-spin text-emerald-500"}),i.jsx("span",{className:"text-xs",children:B?"正在生成微信支付二维码...":"Generating QR code..."})]}):T?D>0?i.jsxs("div",{className:"flex flex-col items-center",children:[i.jsx(UW,{value:T,size:170,level:"M",includeMargin:!1}),i.jsxs("div",{className:"mt-2 flex items-center gap-1 text-[11px] text-slate-500",children:[i.jsx(Vye,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:B?"请使用微信「扫一扫」":"Scan 
4614with WeChat App"})]})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 p-4 text-center",children:[i.jsx(Qa,{className:"w-8 h-8 text-amber-500"}),i.jsx("span",{className:"text-xs text-slate-600 dark:text-slate-400",children:"二维码已过期"}),i.jsx("button",{onClick:U,className:"px-3 py-1.5 bg-emerald-600 text-white rounded-lg text-xs font-bold hover:bg-emerald-500 cursor-pointer",children:"刷新二维码"})]}):i.jsxs("div",{className:"flex flex-col items-center justify-center gap-2 text-center p-4",children:[i.jsx(Cye,{className:"w-10 h-10 text-slate-300"}),i.jsx("button",{onClick:U,className:"px-3 py-1.5 bg-emerald-600 text-white rounded-lg text-xs font-bold hover:bg-emerald-500 cursor-pointer",children:"点击生成二维码"})]})}),T&&D>0&&i.jsxs("div",{className:"mt-3 flex flex-col gap-2 w-full px-2 text-[11px] text-slate-400",children:[i.jsxs("div",{className:"flex items-center justify-between w-full",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-ping"}),i.jsx("span",{className:"text-slate-600 dark:text-slate-300 font-medium",children:B?"等待扫码支付中...":"Waiting for payment..."})]}),i.jsxs("span",{children:[B?"有效期":"Valid",": ",Math.floor(D/60),":",(D%60).toString().padStart(2,"0")]})]}),i.jsxs("button",{type:"button",id:"wechat-manual-check-btn",onClick:async()=>{if(P)try{c(!0);const ee=`/api/wechat/query-order/${encodeURIComponent(P)}?uid=${encodeURIComponent((n==null?void 0:n.uid)||"")}&email=${encodeURIComponent((n==null?void 0:n.email)||"")}`,G=await(await fetch(ee)).json();if(G.success&&G.isPaid){if(I(!0),n!=null&&n.uid)try{const Z=qi(fn,"users",n.uid);await Dm(Z,{isPro:!0,paymentMethod:"wechat_pay"},{merge:!0})}catch{}setTimeout(()=>{c(!1),m()},1200)}else c(!1),h(B?"尚未检测到支付成功,请扫码完成后再试。":"Payment not detected yet. Please scan and complete payment first.")}catch{c(!1)}},className:"w-full py-1.5 px-3 bg-slate-100 dark:bg-slate-800 hover:bg-emerald-50 dark:hover:bg-emerald-950/30 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 rounded-lg text-[11px] font-semibold transition-colors flex items-center justify-center gap-1 cursor-pointer",children:[i.jsx(qa,{className:"w-3 h-3"}),i.jsx("span",{children:B?"已完成支付?点击手动检测开通":"Paid? Check Status Now"})]})]})]}),x&&i.jsx("div",{className:"flex items-center justify-between pt-1 text-xs",children:i.jsx("button",{type:"button",onClick:x,className:"text-slate-500 dark:text-slate-400 hover:text-emerald-600 dark:hover:text-emerald-400 underline cursor-pointer text-[11px] transition-colors",children:B?"使用 PayPal / 国际信用卡支付 →":"Pay with PayPal / International Card →"})}),i.jsxs("div",{className:"flex flex-col items-center gap-1.5 mt-1 text-[11px] text-slate-400 dark:text-slate-500",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:B?"微信官方商户号认证 · 支付后即刻自动激活":"Official WeChat Pay Merchant • Instant Activation"})]}),i.jsxs("div",{className:"w-full bg-slate-50 dark:bg-slate-800/50 border border-slate-200/80 dark:border-slate-700/60 rounded-xl px-3 py-2 text-center text-[11px] text-slate-600 dark:text-slate-400 flex items-center justify-center gap-1.5",children:[i.jsx(K2,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400 shrink-0"}),i.jsx("span",{children:B?"如支付遇到问题或需开具凭证:":"Need help with payment?"}),i.jsxs("a",{id:"wechat-support-mail-link",href:`mailto:[email protected]?subject=${encodeURIComponent("RadioShadow PRO - 微信支付咨询与支持")}&body=${encodeURIComponent(`您好!我在使用微信支付订阅 PRO 会员时需要协助:
4615账号邮箱: ${(n==null?void 0:n.email)||"未登录"}
4616订单号: ${P||"无"}
4617
4618问题描述:
4619`)}`,className:"font-semibold text-emerald-600 dark:text-emerald-400 hover:underline cursor-pointer flex items-center gap-1",children:[i.jsx(Kd,{className:"w-3 h-3"}),i.jsx("span",{children:"[email protected]"})]})]}),i.jsx("p",{className:"text-[10px] text-center leading-relaxed text-slate-400 dark:text-slate-500 mt-0.5",children:y.paywall.termsConsent})]})]}):i.jsx("div",{className:"flex flex-col gap-3 w-full",children:i.jsxs("button",{onClick:p,className:"w-full py-3.5 px-6 bg-emerald-600 hover:bg-emerald-500 text-white font-extrabold rounded-2xl text-xs shadow-xl shadow-emerald-600/20 transition-all flex items-center justify-center gap-2 cursor-pointer active:scale-[0.98]",children:[i.jsx(fr,{className:"w-4 h-4 text-amber-300 fill-current"}),i.jsx("span",{children:y.paywall.signInToUpgrade})]})})}/*!
4620 * react-paypal-js v10.5.0 (2026-09-15T16:04:47.537Z)
4621 * Copyright 2020-present, PayPal, Inc. All rights reserved.
4622 *
4623 * Licensed under the Apache License, Version 2.0 (the "License");
4624 * you may not use this file except in compliance with the License.
4625 * You may obtain a copy of the License at
4626 *
4627 * https://www.apache.org/licenses/LICENSE-2.0
4628 *
4629 * Unless required by applicable law or agreed to in writing, software
4630 * distributed under the License is distributed on an "AS IS" BASIS,
4631 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
4632 * See the License for the specific language governing permissions and
4633 * limitations under the License.
4634 */var Fi;(function(n){n.INITIAL="initial",n.PENDING="pending",n.REJECTED="rejected",n.RESOLVED="resolved"})(Fi||(Fi={}));var Bh;(function(n){n.LOADING_STATUS="setLoadingStatus",n.RESET_OPTIONS="resetOptions",n.SET_BRAINTREE_INSTANCE="braintreeInstance"})(Bh||(Bh={}));var D6;(function(n){n.NUMBER="number",n.CVV="cvv",n.EXPIRATION_DATE="expirationDate",n.EXPIRATION_MONTH="expirationMonth",n.EXPIRATION_YEAR="expirationYear",n.POSTAL_CODE="postalCode"})(D6||(D6={}));var SI=function(n,e){return SI=Object.setPrototypeOf||{__proto__:[]}instanceof Array&&function(t,r){t.__proto__=r}||function(t,r){for(var s in r)Object.prototype.hasOwnProperty.call(r,s)&&
4634(t[s]=r[s])},SI(n,e)};function wve(n,e){if(typeof e!="function"&&e!==null)throw new TypeError("Class extends value "+String(e)+" is not a constructor or null");SI(n,e);function t(){this.constructor=n}n.prototype=e===null?Object.create(e):(t.prototype=e.prototype,new t)}var vs=function(){return vs=Object.assign||function(e){for(var t,r=1,s=arguments.length;r<s;r++){t=arguments[r];for(var a in t)Object.prototype.hasOwnProperty.call(t,a)&&(e[a]=t[a])}return e},vs.apply(this,arguments)};function VW(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}function j6(n,e,t){if(t||arguments.length===2)for(var r=0,s=e.length,a;r<s;r++)(a||!(r in e))&&(a||(a=Array.prototype.slice.call(e,0,r)),a[r]=e[r]);return n.concat(a||Array.prototype.slice.call(e))}var Ey="data-react-paypal-script-id",tm={DATA_JS_SDK_LIBRARY:"dataJsSdkLibrary",DATA_LIBRARY_VALUE:"react-paypal-js",DATA_NAMESPACE:"dataNamespace",DATA_SDK_INTEGRATION_SOURCE:"dataSdkIntegrationSource"},Cve="Failed to load the PayPal JS SDK script.",GW="paypal",Eve="usePayPalScriptReducer must be used within a PayPalScriptProvider";function Sve(n){return n===void 0&&(n=GW),window[n]}function Tve(n){for(var e="",t=0;t<n.length;t++){var r=n[t].charCodeAt(0)*t;n[t+1]&&(r+=n[t+1].charCodeAt(0)*(t-1)),e+=String.fromCharCode(97+Math.abs(r)%26)}return e}function Ave(n){var e=n.reactComponentName,t=n.sdkComponentKey,r=n.sdkRequestedComponents,s=r===void 0?"":r,a=n.sdkDataNamespace,o=a===void 0?GW:a,l=t.charAt(0).toUpperCase().concat(t.substring(1)),c="Unable to render <".concat(e," /> because window.").concat(o,".").concat(l," is undefined."),d=typeof s=="string"?s:s.join(",");if(!d.includes(t)){var h=[d,t].filter(Boolean).join();c+=`
4635To fix the issue, add '`.concat(t,"' to the list of components passed to the parent PayPalScriptProvider:")+"\n`<PayPalScriptProvider options={{ components: '".concat(h,"'}}>`.")}return c}function $W(n){var e=n,t=Ey;e[t];var r=VW(e,[t+""]);return"react-paypal-js-".concat(Tve(JSON.stringify(r)))}function kve(n){var e=self.document.querySelector("script[".concat(Ey,'="').concat(n,'"]'));e!=null&&e.parentNode&&e.parentNode.removeChild(e)}function Nve(n,e){var t,r;switch(e.type){case Bh.LOADING_STATUS:return typeof e.value=="object"?vs(vs({},n),{loadingStatus:e.value.state,loadingStatusErrorMessage:e.value.message}):vs(vs({},n),{loadingStatus:e.value});case Bh.RESET_OPTIONS:return kve(n.options[Ey]),vs(vs({},n),{loadingStatus:Fi.PENDING,options:vs(vs((t={},t[tm.DATA_SDK_INTEGRATION_SOURCE]=tm.DATA_LIBRARY_VALUE,t),e.value),(r={},r[Ey]="".concat($W(e.value)),r))});case Bh.SET_BRAINTREE_INSTANCE:return vs(vs({},n),{braintreePayPalCheckoutInstance:e.value});default:return n}}var HW=S.createContext(null);function _ve(n){if(typeof(n==null?void 0:n.dispatch)=="function"&&n.dispatch.length!==0)return n;throw new Error(Eve)}function Ive(){var n=_ve(S.useContext(HW)),e=vs(vs({},n),{isInitial:n.loadingStatus===Fi.INITIAL,isPending:n.loadingStatus===Fi.PENDING,isResolved:n.loadingStatus===Fi.RESOLVED,isRejected:n.loadingStatus===Fi.REJECTED});return[e,n.dispatch]}S.createContext({});function Dve(n){var e=S.useRef(new Proxy({},{get:function(t,r,s){return typeof t[r]=="function"?function(){for(var a=[],o=0;o<arguments.length;o++)a[o]=arguments[o];return t[r].apply(t,a)}:Reflect.get(t,r,s)}}));return e.current=Object.assign(e.current,n),e.current}var jve=(function(n){wve(e,n);function e(t){var r=n.call(this,t)||this;return r.state={hasError:!1},r}return e.getDerivedStateFromError=function(){return{hasError:!0}},e.prototype.componentDidCatch=function(t,r){console.error("Error in PayPalButtons component:",t,r),typeof this.props.onError=="function"&&this.props.onError({message:t.message,name:t.name,stack:t.stack,componentStack:r.componentStack})},e.prototype.render=function(){return this.state.hasError?null:this.props.children},e})(S.Component),zW=function(n){var e,t=n.className,r=t===void 0?"":t,s=n.disabled,a=s===void 0?!1:s,o=n.children,l=n.forceReRender,c=l===void 0?[]:l,d=VW(n,["className","disabled","children","forceReRender"]),h=a?{opacity:.38}:{},m="".concat(r," ").concat(a?"paypal-buttons-disabled":"").trim(),p=S.useRef(null),x=S.useRef(null),y=Dve(d),v=Ive()[0],B=v.isResolved,E=v.options,N=S.useState(null),T=N[0],k=N[1],P=S.useState(!0),R=P[0],_=P[1],I=S.useState(null),D=I[1];function j(){x.current!==null&&x.current.close().catch(function(){})}return!((e=x.current)===null||e===void 0)&&e.updateProps&&x.current.updateProps({message:d.message}),S.useEffect(function(){if(B===!1)return j;var O=Sve(E.dataNamespace);if(O===void 0||O.Buttons===void 0)return D(function(){throw new Error(Ave({reactComponentName:J2.displayName,sdkComponentKey:"buttons",sdkRequestedComponents:E.components,sdkDataNamespace:E[tm.DATA_NAMESPACE]}))}),j;var M=function(U,ee){k(ee),typeof d.onInit=="function"&&d.onInit(U,ee)};try{x.current=O.Buttons(vs(vs({},y),{onInit:M}))}catch(U){return D(function(){throw new Error("Failed to render <PayPalButtons /> component. Failed to initialize:  ".concat(U))})}return x.current.isEligible()===!1?(_(!1),j):(p.current&&x.current.render(p.current).catch(function(U){p.current===null||p.current.children.length===0||D(function(){throw new Error("Failed to render <PayPalButtons /> component. ".concat(U))})}),j)},j6(j6([B],c,!0),[d.fundingSource],!1)),S.useEffect(function(){T!==null&&(a===!0?T.disable().catch(function(){}):T.enable().catch(function(){}))},[a,T]),Mn.createElement(Mn.Fragment,null,R?Mn.createElement("div",{ref:p,style:h,className:m}):o)};zW.displayName="PayPalButtons";var J2=function(n){return Mn.createElement(jve,{onError:n.onError},Mn.createElement(zW,vs({},n)))};J2.displayName="PayPalButtons";function Rve(n,e){var t={};for(var r in n)Object.prototype.hasOwnProperty.call(n,r)&&e.indexOf(r)<0&&(t[r]=n[r]);if(n!=null&&typeof Object.getOwnPropertySymbols=="function")for(var s=0,r=Object.getOwnPropertySymbols(n);s<r.length;s++)e.indexOf(r[s])<0&&Object.prototype.propertyIsEnumerable.call(n,r[s])&&(t[r[s]]=n[r[s]]);return t}function Pve(n,e){var t=document.querySelector('script[src="'.concat(n,'"]'));if(t===null)return null;var r=qW(n,e),s=t.cloneNode();if(delete s.dataset.uidAuto,Object.keys(s.dataset).length!==Object.keys(r.dataset).length)return null;var a=!0;return Object.keys(s.dataset).forEach(function(o){s.dataset[o]!==r.dataset[o]&&(a=!1)}),a?t:null}function Lve(n){var e=n.url,t=n.attributes,r=n.onSuccess,s=n.onError,a=qW(e,t);a.onerror=s,a.onload=r,document.head.insertBefore(a,document.head.firstElementChild)}function Ove(n){var e=Object.prototype.hasOwnProperty.call(n,"sdkBaseUrl")?n.sdkBaseUrl:void 0,t=Object.prototype.hasOwnProperty.call(n,"environment")?n.environment:void 0;n.environment,n.sdkBaseUrl;var r=Rve(n,["environment","sdkBaseUrl"]),s=e||Uve(t),a=r,o=Object.keys(a).filter(function(d){return typeof a[d]<"u"&&a[d]!==null&&a[d]!==""}).reduce(function(d,h){var m=a[h].toString();return h=Mve(h),h.substring(0,4)==="data"||h==="crossorigin"?d.attributes[h]=m:d.queryParams[h]=m,d},{queryParams:{},attributes:{}}),l=o.queryParams,c=o.attributes;return l["merchant-id"]&&l["merchant-id"].indexOf(",")!==-1&&(c["data-merchant-id"]=l["merchant-id"],l["merchant-id"]="*"),{url:"".concat(s,"?").concat(Fve(l)),attributes:c}}function Mve(n){var e=function(t,r){return(r?"-":"")+t.toLowerCase()};return n.replace(/[A-Z]+(?![a-z])|[A-Z]/g,e)}function Fve(n){var e="";
4635return Object.keys(n).forEach(function(t){e.length!==0&&(e+="&"),e+=t+"="+n[t]}),e}function Uve(n){return n==="sandbox"?"https://www.sandbox.paypal.com/sdk/js":"https://www.paypal.com/sdk/js"}function qW(n,e){e===void 0&&(e={});var t=document.createElement("script");return t.src=n,Object.keys(e).forEach(function(r){t.setAttribute(r,e[r]),r==="data-csp-nonce"&&t.setAttribute("nonce",e["data-csp-nonce"])}),t}function Vve(n,e){if(e===void 0&&(e=Promise),KW(n,e),typeof document>"u")return e.resolve(null);var t=Ove(n),r=t.url,s=t.attributes,a=s["data-namespace"]||"paypal",o=R6(a);return s["data-js-sdk-library"]||(s["data-js-sdk-library"]="paypal-js"),Pve(r,s)&&o?e.resolve(o):Gve({url:r,attributes:s},e).then(function(){var l=R6(a);if(l)return l;throw new Error("The window.".concat(a," global variable is not available."))})}function Gve(n,e){e===void 0&&(e=Promise),KW(n,e);var t=n.url,r=n.attributes;if(typeof t!="string"||t.length===0)throw new Error("Invalid url.");if(typeof r<"u"&&typeof r!="object")throw new Error("Expected attributes to be an object.");return new e(function(s,a){if(typeof document>"u")return s();Lve({url:t,attributes:r,onSuccess:function(){return s()},onError:function(){var o=new Error('The script "'.concat(t,'" failed to load. Check the HTTP status code and response body in DevTools to learn more.'));return a(o)}})})}function R6(n){return window[n]}function KW(n,e){if(typeof n!="object"||n===null)throw new Error("Expected an options object.");var t=Object.prototype.hasOwnProperty.call(n,"environment")?n.environment:void 0;if(t&&t!=="production"&&t!=="sandbox")throw new Error('The `environment` option must be either "production" or "sandbox".');if(typeof e<"u"&&typeof e!="function")throw new Error("Expected PromisePonyfill to be a function.")}var $ve=function(n){var e,t=n.options,r=t===void 0?{clientId:"test"}:t,s=n.children,a=n.deferLoading,o=a===void 0?!1:a,l=S.useReducer(Nve,{options:vs(vs({},r),(e={},e[tm.DATA_JS_SDK_LIBRARY]=tm.DATA_LIBRARY_VALUE,e[tm.DATA_SDK_INTEGRATION_SOURCE]=tm.DATA_LIBRARY_VALUE,e[Ey]="".concat($W(r)),e)),loadingStatus:o?Fi.INITIAL:Fi.PENDING}),c=l[0],d=l[1];return S.useEffect(function(){if(o===!1&&c.loadingStatus===Fi.INITIAL)return d({type:Bh.LOADING_STATUS,value:Fi.PENDING});if(c.loadingStatus===Fi.PENDING){var h=!0;return Vve(c.options).then(function(){h&&d({type:Bh.LOADING_STATUS,value:Fi.RESOLVED})}).catch(function(m){console.error("".concat(Cve," ").concat(m)),h&&d({type:Bh.LOADING_STATUS,value:{state:Fi.REJECTED,message:String(m)}})}),function(){h=!1}}},[c.options,o,c.loadingStatus]),Mn.createElement(HW.Provider,{value:vs(vs({},c),{dispatch:d})},s)};function P6(){}S.createContext({cardFieldsForm:null,fields:{},registerField:P6,unregisterField:P6});class Hve extends S.Component{constructor(e){super(e),this.state={hasError:!1},this.props=e}static getDerivedStateFromError(e){return{hasError:!0}}componentDidCatch(e,t){console.warn("PayPal JS SDK script load fallback triggered:",e,t)}render(){return this.state.hasError?this.props.fallback:this.props.children}}function X2({user:n,clientId:e,planId:t,tierId:r="yearly",amountUSD:s="79.99",tierName:a,priceDisplay:o,periodDisplay:l,equivalentMonthly:c,isVerifying:d,setIsVerifying:h,paymentError:m,setPaymentError:p,onSuccess:x,onOpenAuthModal:y,onOpenLegal:v,onSwitchToWeChat:B}){const{t:E,language:N}=Or(),T=N==="zh-CN",[k,P]=S.useState(!1),R=!!t&&!t.includes("MOCK")&&t.startsWith("P-")&&t.length>10,_=S.useMemo(()=>({"client-id":e||"sb",vault:R,intent:R?"subscription":"capture",components:"buttons"}),[e,R]);return S.useEffect(()=>{const I=j=>{var M;const O=String(((M=j.reason)==null?void 0:M.message)||j.reason||"");(O.includes("zoid destroyed")||O.includes("Script error")||O.includes("Component destroyed"))&&(j.preventDefault(),j.stopPropagation())},D=j=>{const O=String(j.message||"");(O.includes("zoid destroyed")||O.includes("Script error"))&&(j.preventDefault(),j.stopPropagation())};return window.addEventListener("unhandledrejection",I),window.addEventListener("error",D),()=>{window.removeEventListener("unhandledrejection",I),window.removeEventListener("error",D)}},[]),n?d?i.jsxs("div",{className:"py-6 flex flex-col items-center justify-center gap-2 text-emerald-700 dark:text-emerald-400 font-semibold text-xs bg-emerald-50/50 dark:bg-emerald-950/20 rounded-2xl border border-emerald-200/60 dark:border-emerald-500/20 p-4",children:[i.jsx(qa,{className:"w-5 h-5 animate-spin text-emerald-600 dark:text-emerald-400"}),i.jsx("span",{children:E.paywall.verifying})]}):i.jsxs("div",{className:"flex flex-col gap-3.5 w-full",children:[i.jsxs("div",{className:"flex items-center justify-between px-4 py-3 bg-gradient-to-r from-sky-500/10 via-indigo-500/10 to-sky-500/5 border border-sky-500/30 rounded-2xl",children:[i.jsxs("div",{className:"flex flex-col text-left",children:[i.jsx("span",{className:"text-[11px] font-extrabold uppercase tracking-wider text-sky-800 dark:text-sky-300",children:a||(T?"PRO 年度会员":"PRO Annual Membership")}),i.jsxs("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:[c?`${c} · `:"",E.common.proUnlimited]})]}),i.jsxs("div",{className:"flex flex-col items-end",children:[i.jsxs("div",{className:"flex items-baseline gap-1",children:[i.jsx("span",{className:"text-2xl font-black text-sky-600 dark:text-sky-400 font-mono",children:o||`$${s}`}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:l||"/yr"})]}),r==="yearly"&&i.jsx("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-semibold",children:"🔥 Best Value · S
4635ave 48%"}),r==="quarterly"&&i.jsx("span",{className:"text-[10px] text-blue-600 dark:text-blue-400 font-semibold",children:"Save 23%"})]})]}),m&&i.jsxs("div",{className:"w-full p-3 bg-red-50 dark:bg-red-950/30 text-red-600 dark:text-red-400 text-xs rounded-xl border border-red-200 dark:border-red-900/40 flex items-center gap-2",children:[i.jsx(Qa,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:m})]}),k?i.jsxs("div",{className:"w-full p-4 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl text-center",children:[i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mb-2",children:"PayPal script failed to load. Please refresh the page."}),i.jsx("button",{onClick:()=>window.location.reload(),className:"py-2 px-4 bg-slate-900 dark:bg-slate-100 text-white dark:text-slate-900 text-xs font-bold rounded-xl cursor-pointer hover:bg-slate-800",children:"Refresh Page"})]}):i.jsx(Hve,{fallback:i.jsxs("div",{className:"w-full p-4 bg-slate-50 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl text-center",children:[i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mb-2",children:"Unable to load PayPal payment buttons. Please try reloading."}),i.jsx("button",{onClick:()=>window.location.reload(),className:"py-2 px-4 bg-slate-900 dark:bg-slate-100 text-white dark:text-slate-900 text-xs font-bold rounded-xl cursor-pointer hover:bg-slate-800",children:"Reload Payment Gateway"})]}),children:i.jsx("div",{className:"w-full min-h-[45px] relative",children:i.jsx($ve,{options:_,children:i.jsx(J2,{style:{layout:"vertical",color:"gold",shape:"pill",label:R?"subscribe":"pay"},createSubscription:R?(I,D)=>(p(null),D.subscription.create({plan_id:t})):void 0,createOrder:R?void 0:(I,D)=>(p(null),D.order.create({intent:"CAPTURE",purchase_units:[{description:`RadioShadow AI PRO - ${a||"PRO Membership"}`,amount:{currency_code:"USD",value:String(s||"79.99")}}]})),onApprove:async I=>{try{h(!0);const D=I.subscriptionID||(I.orderID?`SUB-ORDER-${I.orderID}`:`SUB-REAL-${Date.now()}`),O=await(await fetch("/api/paypal/verify-subscription",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({subscriptionID:D,email:(n==null?void 0:n.email)||void 0,uid:(n==null?void 0:n.uid)||void 0})})).json();if(O.success){if(n){const M=qi(fn,"users",n.uid);await Dm(M,{isPro:!0},{merge:!0})}x()}else p(O.error||"Subscription verification failed.")}catch(D){console.error("Payment verification error:",D),p("Server verification error. Please try again.")}finally{h(!1)}},onCancel:I=>{console.log("PayPal Subscription cancelled:",I)},onError:I=>{console.warn("PayPal Smart Buttons error:",I),P(!0)}})})})}),B&&i.jsx("div",{className:"flex items-center justify-between pt-1 text-xs",children:i.jsx("button",{type:"button",onClick:B,className:"text-slate-500 dark:text-slate-400 hover:text-emerald-600 dark:hover:text-emerald-400 underline cursor-pointer text-[11px] transition-colors",children:T?"切换为微信支付 (支持中国大陆储蓄卡/信用卡/零钱) →":"Switch to WeChat Pay →"})}),i.jsxs("div",{className:"flex flex-col items-center gap-1.5 mt-1 text-[11px] text-slate-400 dark:text-slate-500",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-medium",children:[i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:E.paywall.guarantee})]}),i.jsxs("div",{className:"w-full bg-slate-50 dark:bg-slate-800/50 border border-slate-200/80 dark:border-slate-700/60 rounded-xl px-3 py-2 text-center text-[11px] text-slate-600 dark:text-slate-400 flex items-center justify-center gap-1.5",children:[i.jsx(K2,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400 shrink-0"}),i.jsx("span",{children:E.paywall.needHelp.split("[email protected]")[0]}),i.jsxs("a",{id:"paypal-support-mail-link",href:`mailto:[email protected]?subject=${encodeURIComponent("RadioShadow PRO - Payment / Checkout Assistance")}&body=${encodeURIComponent(`Hi Support Team,
4636
4637I need assistance with PRO payment / PayPal checkout.
4638User: ${(n==null?void 0:n.email)||"Guest"}
4639
4640Details:
4641`)}`,className:"font-semibold text-emerald-600 dark:text-emerald-400 hover:underline cursor-pointer flex items-center gap-1",children:[i.jsx(Kd,{className:"w-3 h-3"}),i.jsx("span",{children:"[email protected]"})]})]}),i.jsx("p",{className:"text-[10px] text-center leading-relaxed text-slate-400 dark:text-slate-500 mt-0.5",children:E.paywall.termsConsent})]})]}):i.jsx("div",{className:"flex flex-col gap-3 w-full",children:i.jsxs("button",{onClick:y,className:"w-full py-3.5 px-6 bg-slate-900 dark:bg-slate-100 hover:bg-slate-800 dark:hover:bg-white text-white dark:text-slate-900 font-extrabold rounded-2xl text-xs shadow-xl transition-all flex items-center justify-center gap-2 cursor-pointer active:scale-[0.98]",children:[i.jsx(fr,{className:"w-4 h-4 text-amber-400 fill-current"}),i.jsx("span",{children:E.paywall.signInToUpgrade})]})})}const $p={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_GA_MEASUREMENT_ID:"G-3L1D7R1Q03"};var Hp={};function Z2({isOpen:n,onClose:e,user:t,onOpenAuthModal:r,onOpenLegal:s,stats:a,initialTier:o="yearly"}){const{t:l,language:c}=Or(),d=c==="zh-CN",[h,m]=S.useState(o),[p,x]=S.useState(d?"wechat":"paypal"),[y,v]=S.useState(!1),[B,E]=S.useState(null);if(S.useEffect(()=>{x(d?"wechat":"paypal"),E(null)},[d]),!n)return null;const k=d&&p==="wechat"||!d&&p==="wechat"?[{id:"monthly",name:"月度会员",priceDisplay:"Â¥69",periodDisplay:"/月",equivalentMonthly:"Â¥69 / 月",badge:"基础尝鲜",desc:"随时取消 · 适合短期备考冲刺",amountInCents:6900,amountUSD:"12.99"},{id:"quarterly",name:"季度会员",priceDisplay:"Â¥169",periodDisplay:"/å­£",equivalentMonthly:"折合 Â¥56 / 月",badge:"立省 18%",desc:"90天语言重构期 · 进阶首选",amountInCents:16900,amountUSD:"29.99"},{id:"yearly",name:"年度会员",priceDisplay:"Â¥499",periodDisplay:"/å¹´",equivalentMonthly:"折合 Â¥41.5 / 月",badge:"🔥 最畅销 · 省40%",isPopular:!0,desc:"全面长流浸泡 · 无限次模考与同传",amountInCents:49900,amountUSD:"79.99"}]:[{id:"monthly",name:"Monthly",priceDisplay:"$12.99",periodDisplay:"/mo",equivalentMonthly:"$12.99 / mo",badge:"Flexible",desc:"Cancel anytime · Short-term exam prep",amountInCents:6900,amountUSD:"12.99"},{id:"quarterly",name:"Quarterly",priceDisplay:"$29.99",periodDisplay:"/quarter",equivalentMonthly:"Just $9.99 / mo",badge:"Save 23%",desc:"90-day intensive exam breakthrough",amountInCents:16900,amountUSD:"29.99"},{id:"yearly",name:"Annual Pass",priceDisplay:"$79.99",periodDisplay:"/yr",equivalentMonthly:"Just $6.66 / mo",badge:"🔥 Best Value · Save 48%",isPopular:!0,desc:"Full acoustic fluency · Unlimited live AI",amountInCents:49900,amountUSD:"79.99"}],P=k.find(D=>D.id===h)||k.find(D=>D.id==="yearly")||k[2],R=()=>{try{if(typeof window<"u"&&$p!=null&&$p.VITE_PAYPAL_CLIENT_ID)return}catch{}try{if(typeof process<"u"&&Hp){const D=Hp.NEXT_PUBLIC_PAYPAL_CLIENT_ID||Hp.VITE_PAYPAL_CLIENT_ID;if(D)return D}}catch{}return""},_=()=>{try{if(typeof window<"u"&&$p!=null&&$p.VITE_PAYPAL_PLAN_ID)return}catch{}try{if(typeof process<"u"&&Hp){const D=Hp.NEXT_PUBLIC_PAYPAL_PLAN_ID||Hp.VITE_PAYPAL_PLAN_ID;if(D)return D}}catch{}return""},I=()=>{e(),window.location.reload()};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/75 backdrop-blur-md p-3 sm:p-4 animate-in fade-in duration-200",children:i.jsxs("div",{id:"unified-paywall-modal",className:"bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-emerald-500/20 max-w-xl w-full text-center flex flex-col items-center relative max-h-[92vh] overflow-y-auto custom-scrollbar p-5 sm:p-7",children:[i.jsx("button",{onClick:e,className:"absolute top-4 right-4 p-2 rounded-full text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer z-10","aria-label":"Close modal",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex flex-col items-center gap-2 mt-1",children:[i.jsx("div",{className:"p-3 bg-gradient-to-br from-amber-500/20 to-emerald-500/20 text-amber-500 dark:text-amber-400 rounded-2xl border border-amber-500/30 flex items-center justify-center shadow-inner",children:i.jsx(fr,{className:"w-7 h-7 fill-amber-500 text-amber-500"})}),i.jsx("div",{className:"flex items-center gap-2 mt-1",children:i.jsx("span",{className:"px-3 py-1 rounded-full bg-amber-100 dar
4641k:bg-amber-950/60 text-amber-800 dark:text-amber-300 font-mono font-extrabold text-[10px] tracking-wider uppercase border border-amber-300/40",children:l.paywall.vipPass||"VIP PASS • UNLIMITED ACCESS"})}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-slate-100 tracking-tight",children:d?"升级至 PRO 高级会员":"Unlock Full PRO Membership"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 max-w-md leading-relaxed",children:d?"开启无限次全球广播实时同传、连续长流跟读、声学雷达图以及亚瑟博士全真模考":"Accelerate spoken fluency with unlimited live AI interpretation, continuous long shadowing & Dr. Arthur examiner diagnostics."})]}),a&&i.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/60 rounded-2xl p-3 w-full grid grid-cols-3 gap-2 border border-slate-200/80 dark:border-slate-700/80 my-3",children:[i.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i.jsx("span",{className:"text-lg font-black text-emerald-600 dark:text-emerald-400 font-mono",children:a.wordsCaught??0}),i.jsx("span",{className:"text-[9px] text-slate-500 dark:text-slate-400 uppercase tracking-wider font-bold",children:l.paywall.wordsCaught||"Words Caught"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-0.5 border-x border-slate-200 dark:border-slate-700 px-2",children:[i.jsx("span",{className:"text-lg font-black text-emerald-600 dark:text-emerald-400 font-mono",children:a.shadowingsDone??0}),i.jsx("span",{className:"text-[9px] text-slate-500 dark:text-slate-400 uppercase tracking-wider font-bold",children:l.paywall.shadowingsDone||"Shadowed"})]}),i.jsxs("div",{className:"flex flex-col items-center gap-0.5",children:[i.jsx("span",{className:"text-lg font-black text-emerald-600 dark:text-emerald-400 font-mono",children:a.globalStations??"10,000+"}),i.jsx("span",{className:"text-[9px] text-slate-500 dark:text-slate-400 uppercase tracking-wider font-bold",children:l.paywall.globalStations||"Stations"})]})]}),i.jsxs("div",{className:"w-full my-3",children:[i.jsxs("div",{className:"text-left text-xs font-bold text-slate-600 dark:text-slate-300 mb-2 flex items-center justify-between",children:[i.jsx("span",{children:d?"选择您的会员计划:":"Select Your Membership Plan:"}),i.jsx("span",{className:"text-[11px] font-normal text-emerald-600 dark:text-emerald-400",children:d?"支持即时开通与全端同步":"Instant Activation across devices"})]}),i.jsx("div",{className:"grid grid-cols-3 gap-2.5 sm:gap-3",children:k.map(D=>{const j=h===D.id;return i.jsxs("div",{id:`tier-card-${D.id}`,onClick:()=>{m(D.id),E(null)},className:`relative p-3 sm:p-3.5 rounded-2xl border-2 transition-all cursor-pointer flex flex-col items-center text-center justify-between min-h-[148px] sm:min-h-[160px] ${j?"border-emerald-500 bg-emerald-50/50 dark:bg-emerald-950/30 shadow-md shadow-emerald-500/10 ring-1 ring-emerald-500":"border-slate-200 dark:border-slate-700 bg-slate-50/70 dark:bg-slate-800/40 hover:border-slate-300 dark:hover:border-slate-600"}`,children:[D.badge&&i.jsx("div",{className:"absolute -top-2.5 px-2 py-0.5 rounded-full text-[9px] sm:text-[10px] font-black uppercase tracking-wider bg-emerald-600 text-white shadow-xs",children:D.badge}),i.jsx("div",{className:"mt-1 w-full",children:i.jsx("span",{className:`text-xs font-extrabold block ${j?"text-emerald-700 dark:text-emerald-300":"text-slate-700 dark:text-slate-300"}`,children:D.name})}),i.jsxs("div",{className:"my-1.5 flex flex-col items-center",children:[i.jsxs("div",{className:"flex items-baseline gap-0.5",children:[i.jsx("span",{className:`text-xl sm:text-2xl font-black font-mono tracking-tight ${j?"text-emerald-600 dark:text-emerald-400":"text-slate-900 dark:text-slate-100"}`,children:D.priceDisplay}),i.jsx("span",{className:"text-[11px] text-slate-500 dark:text-slate-400 font-medium",children:D.periodDisplay})]}),i.jsx("span",{className:"text-[10px] font-medium text-slate-500 dark:text-slate-400 mt-0.5",children:D.equivalentMonthly})]}),i.jsx("div",{className:"w-full flex items-center justify-center pt-1 border-t border-slate-200/60 dark:border-slate-700/60",children:i.jsx("div",{className:`w-4 h-4 rounded-full flex items-center justify-center border transition-all ${j?"border-emerald-500 bg-emerald-500 text-white":"border-slate-300 dark:border-slate-600 bg-transparent"}`,children:j&&i.jsx(vn,{className:"w-3.5 h-3.5"})})})]},D.id)})})]}),B&&i.jsx("div",{className:"w-full p-3 bg-red-50 dark:bg-red-950/30 text-red-600 dark:text-red-400 text-xs rounded-xl border border-red-200 dark:border-red-900/40 mb-2 text-left",children:B}),i.jsx("div",{className:"w-full my-2",children:p==="wechat"?i.jsx(Bve,{user:t,tierId:h,amountInCents:P.amountInCents,tierName:P.name,priceDisplay:P.priceDisplay,periodDisplay:P.periodDisplay,equivalentMonthly:P.equivalentMonthly,isVerifying:y,setIsVerifying:v,paymentError:B,setPaymentError:E,onSuccess:I,onOpenAuthModal:()=>{e(),r&&r()},onSwitchToPayPal:()=>x("paypal")}):i.jsx(X2,{user:t,clientId:R(),planId:_(),tierId:h,amountUSD:P.amountUSD,tierName:P.name,priceDisplay:P.priceDisplay,periodDisplay:P.periodDisplay,equivalentMonthly:P.equivalentMonthly,isVerifying:y,setIsVerifying:v,paymentError:B,setPaymentError:E,onSuccess:I,onOpenAuthModal:()=>{e(),r&&r()},onOpenLegal:s,onSwitchToWeChat:()=>x("wechat")}
4641)}),i.jsxs("div",{className:"w-full text-left space-y-2 mt-3 pt-3 border-t border-slate-100 dark:border-slate-800",children:[i.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400 dark:text-slate-500 block mb-1",children:d?"PRO 会员尊享权益清单":"INCLUDED PRO BENEFITS"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2 text-xs",children:[i.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-xl bg-slate-50/80 dark:bg-slate-800/40 border border-slate-100 dark:border-slate-800",children:[i.jsx(xi,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:l.paywall.perk1Title||"Unlimited Live Translation"}),i.jsx("p",{className:"text-[10px] text-slate-500 dark:text-slate-400 leading-tight",children:d?"50+ 语言实时同传,无每日时长限制":"50+ languages real-time live dual-transcripts"})]})]}),i.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-xl bg-slate-50/80 dark:bg-slate-800/40 border border-slate-100 dark:border-slate-800",children:[i.jsx(Nn,{className:"w-3.5 h-3.5 text-blue-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:l.paywall.perk3Title||"Continuous Long Shadowing"}),i.jsx("p",{className:"text-[10px] text-slate-500 dark:text-slate-400 leading-tight",children:d?"连续录音长达30分钟,5维声学雷达诊断":"Up to 30 mins continuous practice & 5D radar"})]})]}),i.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-xl bg-slate-50/80 dark:bg-slate-800/40 border border-slate-100 dark:border-slate-800",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:d?"亚瑟博士纯正口语实战指导":"Dr. Arthur Spoken English Coaching"}),i.jsx("p",{className:"text-[10px] text-slate-500 dark:text-slate-400 leading-tight",children:d?"无限次资深导师语音诊断与流利度评定":"Unlimited oral coaching & fluency diagnostics"})]})]}),i.jsxs("div",{className:"flex items-start gap-2 p-2 rounded-xl bg-slate-50/80 dark:bg-slate-800/40 border border-slate-100 dark:border-slate-800",children:[i.jsx(Ys,{className:"w-3.5 h-3.5 text-purple-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-slate-800 dark:text-slate-200",children:l.paywall.perk4Title||"C1 Advanced Vocabulary"}),i.jsx("p",{className:"text-[10px] text-slate-500 dark:text-slate-400 leading-tight",children:d?"高阶母语词汇标注与每日精选广播包":"High-frequency native vocabulary lessons"})]})]})]})]}),i.jsxs("div",{className:"w-full mt-4 pt-3 border-t border-slate-100 dark:border-slate-800 flex flex-col items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-4 text-[11px] text-slate-500 dark:text-slate-400",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),d?"7天无理由退款保障":"30-Day Money-Back Guarantee"]}),i.jsx("span",{children:"•"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(rl,{className:"w-3.5 h-3.5 text-slate-400"}),d?"银行级安全加密":"256-bit Secure Checkout"]})]}),i.jsx("div",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:p==="wechat"?i.jsxs("span",{children:[d?"海外用户或需使用信用卡?":"Need international card payment?"," ",i.jsx("button",{type:"button",onClick:()=>{x("paypal"),E(null)},className:"text-emerald-600 dark:text-emerald-400 hover:underline font-semibold cursor-pointer",children:d?"切换为 PayPal / 信用卡支付":"Switch to PayPal / Cards"})]}):i.jsxs("span",{children:[d?"在国内想要微信扫码?":"Prefer WeChat Pay?"," ",i.jsx("button",{type:"button",onClick:()=>{x("wechat"),E(null)},className:"text-emerald-600 dark:text-emerald-400 hover:underline font-semibold cursor-pointer",children:d?"切换为微信支付":"Switch to WeChat Pay"})]})})]})]})})}function WW(n){var e,t,r="";if(typeof n=="string"||typeof n=="number")r+=n;else if(typeof n=="object")if(Array.isArray(n)){var s=n.length;for(e=0;e<s;e++)n[e]&&(t=WW(n[e]))&&(r&&(r+=" "),r+=t)}else for(t in n)n[t]&&(r&&(r+=" "),r+=t);return r}function Lr(){for(var n,e,t=0,r="",s=arguments.length;t<s;t++)(n=arguments[t])&&(e=WW(n))&&(r&&(r+=" "),r+=e);return r}var zve=["dangerouslySetInnerHTML","onCopy","onCopyCapture","onCut","onCutCapture","onPaste","onPasteCapture","onCompositionEnd","onCompositionEndCapture","onCompositionStart","onCompositionStartCapture","onCompositionUpdate","onCompositionUpdateCapture","onF
4641ocus","onFocusCapture","onBlur","onBlurCapture","onChange","onChangeCapture","onBeforeInput","onBeforeInputCapture","onInput","onInputCapture","onReset","onResetCapture","onSubmit","onSubmitCapture","onInvalid","onInvalidCapture","onLoad","onLoadCapture","onError","onErrorCapture","onKeyDown","onKeyDownCapture","onKeyPress","onKeyPressCapture","onKeyUp","onKeyUpCapture","onAbort","onAbortCapture","onCanPlay","onCanPlayCapture","onCanPlayThrough","onCanPlayThroughCapture","onDurationChange","onDurationChangeCapture","onEmptied","onEmptiedCapture","onEncrypted","onEncryptedCapture","onEnded","onEndedCapture","onLoadedData","onLoadedDataCapture","onLoadedMetadata","onLoadedMetadataCapture","onLoadStart","onLoadStartCapture","onPause","onPauseCapture","onPlay","onPlayCapture","onPlaying","onPlayingCapture","onProgress","onProgressCapture","onRateChange","onRateChangeCapture","onSeeked","onSeekedCapture","onSeeking","onSeekingCapture","onStalled","onStalledCapture","onSuspend","onSuspendCapture","onTimeUpdate","onTimeUpdateCapture","onVolumeChange","onVolumeChangeCapture","onWaiting","onWaitingCapture","onAuxClick","onAuxClickCapture","onClick","onClickCapture","onContextMenu","onContextMenuCapture","onDoubleClick","onDoubleClickCapture","onDrag","onDragCapture","onDragEnd","onDragEndCapture","onDragEnter","onDragEnterCapture","onDragExit","onDragExitCapture","onDragLeave","onDragLeaveCapture","onDragOver","onDragOverCapture","onDragStart","onDragStartCapture","onDrop","onDropCapture","onMouseDown","onMouseDownCapture","onMouseEnter","onMouseLeave","onMouseMove","onMouseMoveCapture","onMouseOut","onMouseOutCapture","onMouseOver","onMouseOverCapture","onMouseUp","onMouseUpCapture","onSelect","onSelectCapture","onTouchCancel","onTouchCancelCapture","onTouchEnd","onTouchEndCapture","onTouchMove","onTouchMoveCapture","onTouchStart","onTouchStartCapture","onPointerDown","onPointerDownCapture","onPointerMove","onPointerMoveCapture","onPointerUp","onPointerUpCapture","onPointerCancel","onPointerCancelCapture","onPointerEnter","onPointerEnterCapture","onPointerLeave","onPointerLeaveCapture","onPointerOver","onPointerOverCapture","onPointerOut","onPointerOutCapture","onGotPointerCapture","onGotPointerCaptureCapture","onLostPointerCapture","onLostPointerCaptureCapture","onScroll","onScrollCapture","onWheel","onWheelCapture","onAnimationStart","onAnimationStartCapture","onAnimationEnd","onAnimationEndCapture","onAnimationIteration","onAnimationIterationCapture","onTransitionEnd","onTransitionEndCapture"];function eR(n){if(typeof n!="string")return!1;var e=zve;return e.includes(n)}var qve=["aria-activedescendant","aria-atomic","aria-autocomplete","aria-busy","aria-checked","aria-colcount","aria-colindex","aria-colspan","aria-controls","aria-current","aria-describedby","aria-details","aria-disabled","aria-errormessage","aria-expanded","aria-flowto","aria-haspopup","aria-hidden","aria-invalid","aria-keyshortcuts","aria-label","aria-labelledby","aria-level","aria-live","aria-modal","aria-multiline","aria-multiselectable","aria-orientation","aria-owns","aria-placeholder","aria-posinset","aria-pressed","aria-readonly","aria-relevant","aria-required","aria-roledescription","aria-rowcount","aria-rowindex","aria-rowspan","aria-selected","aria-setsize","aria-sort","aria-valuemax","aria-valuemin","aria-valuenow","aria-valuetext","className","color","height","id","lang","max","media","method","min","name","style","target","width","role","tabIndex","accentHeight","accumulate","additive","alignmentBaseline","allowReorder","alphabetic","amplitude","arabicForm","ascent","attributeName","attributeType","autoReverse","azimuth","baseFrequency","baselineShift","baseProfile","bbox","begin","bias","by","calcMode","capHeight","clip","clipPath","clipPathUnits","clipRule","colorInterpolation","colorInterpolationFilters","colorProfile","colorRendering","contentScriptType","contentStyleType","cursor","cx","cy","d","decelerate","descent","diffuseConstant","direction","display","divisor","dominantBaseline","dur","dx","dy","edgeMode","elevation","enableBackground","end","exponent","externalResourcesRequired","fill","fillOpacity","fillRule","filter","filterRes","filterUnits","floodColor","floodOpacity","focusable","fontFamily","fontSize","fontSizeAdjust","fontStretch","fontStyle","fontVariant","fontWeight","format","from","fx","fy","g1","g2","glyphName","glyphOrientationHorizontal","glyphOrientationVertical","glyphRef","gradientTransform","gradientUnits","hanging","horizAdvX","horizOriginX","href","ideographic","imageRendering","in2","in","intercept","k1","k2","k3","k4","k","kernelMatrix","kernelUnitLength","kerning","keyPoints","keySplines","keyTimes","lengthAdjust","letterSpacing","lightingColor","limitingConeAngle","local","markerEnd","markerHeight","markerMid","markerStart","markerUnits","markerWidth","mask","maskContentUnits","maskUnits","mathematical","mode","numOctaves","offset","opacity","operator","order","orient","orientation","origin","overflow","overlinePosition","overlineThickness","paintOrder","panose1","pathLength","patternContentUnits","patternTransform","patternUnits","pointerEvents","pointsAtX","pointsAtY","pointsAtZ","preserveAlpha","preserveAspectRatio","primitiveUnits","r","radius","refX","refY","renderingIntent","repeatCount","repeatDur","requiredExtensions","requiredFeatures","restart","result","rotate","rx","ry","seed","shapeRendering","slope","spacing","specularConstant","specularExponent","speed","spreadMethod","startOffset","stdDeviation","stemh","stemv","stitchTiles","stopColor","stopOpacity","strikethroughPosition","strikethroughThickness","string","stroke","strokeDasharray","strokeDashoffset","strokeLinecap","strokeLinejoin","strokeMiterlimit","strokeOpacity","strokeWidth","surfaceScale","systemLanguage","tableValues","targetX","targetY","textAnchor","textDecoration","textLength","textRendering","to","transform","u1","u2","underlinePosition","underlineThickness","unicode","unicodeBidi","unicodeRange","unitsPerEm","vAlphabetic","values","vectorEffect","version","vertAdvY","vertOriginX","vertOriginY","vHanging","vIdeographic","viewTarget","visibility","vMathematical","widths","wordSpacing","writingMode","x1","x2","x","xChannelSelector","xHeight","xlinkActuate","xlinkArcrole","xlinkHref","xlinkRole","xlinkShow","xlinkTitle","xlinkType","xmlBase","xmlLang","xmlns","xmlnsXlink","xmlSpace","y1","y2","y","yChannelSelector","z","zoomAndPan","ref","key","angle"],Kve=new Set(qve);
4641function YW(n){return typeof n!="string"?!1:Kve.has(n)}function QW(n){return typeof n=="string"&&n.startsWith("data-")}function Za(n){if(typeof n!="object"||n===null)return{};var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(YW(t)||QW(t))&&(e[t]=n[t]);return e}function pS(n){if(n==null)return null;if(S.isValidElement(n)&&typeof n.props=="object"&&n.props!==null){var e=n.props;return Za(e)}return typeof n=="object"&&!Array.isArray(n)?Za(n):null}function Ka(n){var e={};for(var t in n)Object.prototype.hasOwnProperty.call(n,t)&&(YW(t)||QW(t)||eR(t))&&(e[t]=n[t]);return e}function Wve(n){return n==null?null:S.isValidElement(n)?Ka(n.props):typeof n=="object"&&!Array.isArray(n)?Ka(n):null}var Yve=["children","width","height","viewBox","className","style","title","desc"];function TI(){return TI=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},TI.apply(null,arguments)}function Qve(n,e){if(n==null)return{};var t,r,s=Jve(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function Jve(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var JW=S.forwardRef((n,e)=>{var t=n.children,r=n.width,s=n.height,a=n.viewBox,o=n.className,l=n.style,c=n.title,d=n.desc,h=Qve(n,Yve),m=a||{width:r,height:s,x:0,y:0},p=Lr("recharts-surface",o);return S.createElement("svg",TI({},Ka(h),{className:p,width:r,height:s,style:l,viewBox:"".concat(m.x," ").concat(m.y," ").concat(m.width," ").concat(m.height),ref:e}),S.createElement("title",null,c),S.createElement("desc",null,d),t)}),Xve=["children","className"];function AI(){return AI=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},AI.apply(null,arguments)}function Zve(n,e){if(n==null)return{};var t,r,s=eBe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function eBe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var Hl=S.forwardRef((n,e)=>{var t=n.children,r=n.className,s=Zve(n,Xve),a=Lr("recharts-layer",r);return S.createElement("g",AI({className:a},Ka(s),{ref:e}),t)}),XW=f$();function kI(n){return n==="__proto__"}const tBe=/\.|(\[(?:[^[\]]*|(["'])(?:(?!\2)[^\\]|\\.)*?\2)\])/;function ZW(n){switch(typeof n){case"number":case"symbol":return!1;case"string":return n===""||n.startsWith(".")||n.endsWith(".")?!1:tBe.test(n);default:return!1}}function gS(n){var e;return typeof n=="string"||typeof n=="symbol"?n:Object.is((e=n==null?void 0:n.valueOf)==null?void 0:e.call(n),-0)?"-0":String(n)}function tR(n){return typeof n=="symbol"||n instanceof Symbol}function nBe(n){return n==null?"":eY(n)}function eY(n){if(typeof n=="string")return n;if(Array.isArray(n))return n.map(eY).join(",");if(tR(n))return n.toString();const e=n+"";return e==="0"&&Object.is(Number(n),-0)?"-0":e}function nR(n){if(Array.isArray(n))return n.map(gS);if(typeof n=="symbol")return[n];n=nBe(n);const e=[],t=n.length;if(t===0)return e;let r=0,s="",a="",o=!1,l=!1;const c=/^-?\d+(?:\.\d+)?$/;for(n.charCodeAt(0)===46&&e.push("");r<t;){const d=n[r];if(a)d==="\\"&&r+1<t?(r++,s+=n[r]):d===a?a="":s+=d;else if(o)if(d==='"'||d==="'")a=d,l=!0;else if(d==="]"){if(o=!1,!l&&s.includes(".")&&!c.test(s)){const h=s.split(".");for(let m=0;m<h.length;m++)h[m]!==""&&e.push(h[m])}else e.push(s);s=""}else s+=d;else if(d==="[")o=!0,l=!1,s&&(e.push(s),s="");else if(d==="."){s&&(e.push(s),s="");const h=n[r+1];(h===void 0||h===".")&&e.push("")}else s+=d;r++}return s&&e.push(s),e}function Sv(n,e,t){if(n==null)return t;switch(typeof e){case"string":{if(kI(e))return t;const r=n[e];return r===void 0?ZW(e)&&!Object.hasOwn(n,e)?Sv(n,nR(e),t):t:r}case"number":case"symbol":{typeof e=="number"&&(e=gS(e));const r=n[e];return r===void 0?t:r}
4641default:{if(Array.isArray(e))return rBe(n,e,t);if(Object.is(e==null?void 0:e.valueOf(),-0)?e="-0":e=String(e),kI(e))return t;const r=n[e];return r===void 0?t:r}}}function rBe(n,e,t){if(e.length===0)return t;let r=n;for(let s=0;s<e.length;s++){if(r==null||kI(e[s]))return t;r=r[e[s]]}return r===void 0?t:r}var sBe=4;function hh(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:sBe,t=10**e,r=Math.round(n*t)/t;return Object.is(r,-0)?0:r}function ca(n){for(var e=arguments.length,t=new Array(e>1?e-1:0),r=1;r<e;r++)t[r-1]=arguments[r];return n.reduce((s,a,o)=>{var l=t[o-1];return typeof l=="string"?s+l+a:l!==void 0?s+hh(l)+a:s+a},"")}var Cc=n=>n===0?0:n>0?1:-1,Wd=n=>typeof n=="number"&&n!=+n,Om=n=>typeof n=="string"&&n.length>1&&n.indexOf("%")===n.length-1,Ot=n=>(typeof n=="number"||n instanceof Number)&&!Wd(n),Vc=n=>Ot(n)||typeof n=="string",aBe=0,Sy=n=>{var e=++aBe;return"".concat(n||"").concat(e)},Uh=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:0,s=arguments.length>3&&arguments[3]!==void 0?arguments[3]:!1;if(!Ot(e)&&typeof e!="string")return r;var a;if(Om(e)){if(t==null)return r;var o=e.indexOf("%");a=t*parseFloat(e.slice(0,o))/100}else a=+e;return Wd(a)&&(a=r),s&&t!=null&&a>t&&(a=t),a},tY=n=>{if(!Array.isArray(n))return!1;for(var e=n.length,t={},r=0;r<e;r++)if(!t[String(n[r])])t[String(n[r])]=!0;else return!0;return!1};function Dd(n,e,t){return Ot(n)&&Ot(e)?hh(n+t*(e-n)):e}function iBe(n,e,t){if(!(!n||!n.length))return n.find(r=>r&&(typeof e=="function"?e(r):Sv(r,e))===t)}var ei=n=>n===null||typeof n>"u",rR=n=>ei(n)?n:"".concat(n.charAt(0).toUpperCase()).concat(n.slice(1));function Ec(n){return n!=null}function Zm(){}function sR(n){if(n)return{x:n.x,y:n.y,upperWidth:"upperWidth"in n?n.upperWidth:n.width,lowerWidth:"lowerWidth"in n?n.lowerWidth:n.width,width:n.width,height:n.height}}function L6(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ac(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?L6(Object(t),!0).forEach(function(r){oBe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):L6(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function oBe(n,e,t){return(e=lBe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function lBe(n){var e=cBe(n,"string");return typeof e=="symbol"?e:e+""}function cBe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var dBe=n=>{var e=n.viewBox,t=n.position,r=n.offset,s=r===void 0?0:r,a=n.parentViewBox,o=sR(e),l=o.x,c=o.y,d=o.height,h=o.upperWidth,m=o.lowerWidth,p=l,x=l+(h-m)/2,y=(p+x)/2,v=(h+m)/2,B=p+h/2,E=d>=0?1:-1,N=E*s,T=E>0?"end":"start",k=E>0?"start":"end",P=h>=0?1:-1,R=P*s,_=P>0?"end":"start",I=P>0?"start":"end",D=a;if(t==="top"){var j={x:p+h/2,y:c-N,horizontalAnchor:"middle",verticalAnchor:T};return D&&(j.height=Math.max(c-D.y,0),j.width=h),j}if(t==="bottom"){var O={x:x+m/2,y:c+d+N,horizontalAnchor:"middle",verticalAnchor:k};return D&&(O.height=Math.max(D.y+D.height-(c+d),0),O.width=m),O}if(t==="left"){var M={x:y-R,y:c+d/2,horizontalAnchor:_,verticalAnchor:"middle"};return D&&(M.width=Math.max(M.x-D.x,0),M.height=d),M}if(t==="right"){var U={x:y+v+R,y:c+d/2,horizontalAnchor:I,verticalAnchor:"middle"};return D&&(U.width=Math.max(D.x+D.width-U.x,0),U.height=d),U}var ee=D?{width:v,height:d}:{};return t==="insideLeft"?ac({x:y+R,y:c+d/2,horizontalAnchor:I,verticalAnchor:"middle"},ee):t==="insideRight"?ac({x:y+v-R,y:c+d/2,horizontalAnchor:_,verticalAnchor:"middle"},ee):t==="insideTop"?ac({x:p+h/2,y:c+N,horizontalAnchor:"middle",verticalAnchor:k},ee):t==="insideBottom"?ac({x:x+m/2,y:c+d-N,horizontalAnchor:"middle",verticalAnchor:T},ee):t==="insideTopLeft"?ac({x:p+R,y:c+N,horizontalAnchor:I,verticalAnchor:k},ee):t==="insideTopRight"?ac({x:p+h-R,y:c+N,horizontalAnchor:_,verticalAnchor:k},ee):t==="insideBottomLeft"?ac({x:x+R,y:c+d-N,horizontalAnchor:I,verticalAnchor:T},ee):t==="insideBottomRight"?ac({x:x+m-R,y:c+d-N,horizontalAnchor:_,verticalAnchor:T},ee):t&&typeof t=="object"&&(Ot(t.x)||Om(t.x))&&(Ot(t.y)||Om(t.y))?ac({x:l+Uh(t.x,v),y:c+Uh(t.y,d),horizontalAnchor:"end",verticalAnchor:"end"},ee):ac({x:B,y:c+d/2,horizontalAnchor:"middle",verticalAnchor:"middle"},ee)},uBe=["top","left","right","bottom"];function hBe(n){return n==null?!1:typeof n=="object"?!0:uBe.includes(n)}
vendor: 12,228 bytes, line 4641
4641var fBe=S.createContext(null);function os(n){return function(){return n}}const NI=Math.PI,_I=2*NI,Mf=1e-6,mBe=_I-Mf;function nY(n){this._+=n[0];for(let e=1,t=n.length;e<t;++e)this._+=arguments[e]+n[e]}function pBe(n){let e=Math.floor(n);if(!(e>=0))throw new Error(`invalid digits: ${n}`);if(e>15)return nY;const t=10**e;return function(r){this._+=r[0];for(let s=1,a=r.length;s<a;++s)this._+=Math.round(arguments[s]*t)/t+r[s]}}class gBe{constructor(e){this._x0=this._y0=this._x1=this._y1=null,this._="",this._append=e==null?nY:pBe(e)}moveTo(e,t){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}`}closePath(){this._x1!==null&&(this._x1=this._x0,this._y1=this._y0,this._append`Z`)}lineTo(e,t){this._append`L${this._x1=+e},${this._y1=+t}`}quadraticCurveTo(e,t,r,s){this._append`Q${+e},${+t},${this._x1=+r},${this._y1=+s}`}bezierCurveTo(e,t,r,s,a,o){this._append`C${+e},${+t},${+r},${+s},${this._x1=+a},${this._y1=+o}`}arcTo(e,t,r,s,a){if(e=+e,t=+t,r=+r,s=+s,a=+a,a<0)throw new Error(`negative radius: ${a}`);let o=this._x1,l=this._y1,c=r-e,d=s-t,h=o-e,m=l-t,p=h*h+m*m;if(this._x1===null)this._append`M${this._x1=e},${this._y1=t}`;else if(p>Mf)if(!(Math.abs(m*c-d*h)>Mf)||!a)this._append`L${this._x1=e},${this._y1=t}`;else{let x=r-o,y=s-l,v=c*c+d*d,B=x*x+y*y,E=Math.sqrt(v),N=Math.sqrt(p),T=a*Math.tan((NI-Math.acos((v+p-B)/(2*E*N)))/2),k=T/N,P=T/E;Math.abs(k-1)>Mf&&this._append`L${e+k*h},${t+k*m}`,this._append`A${a},${a},0,0,${+(m*x>h*y)},${this._x1=e+P*c},${this._y1=t+P*d}`}}arc(e,t,r,s,a,o){if(e=+e,t=+t,r=+r,o=!!o,r<0)throw new Error(`negative radius: ${r}`);let l=r*Math.cos(s),c=r*Math.sin(s),d=e+l,h=t+c,m=1^o,p=o?s-a:a-s;this._x1===null?this._append`M${d},${h}`:(Math.abs(this._x1-d)>Mf||Math.abs(this._y1-h)>Mf)&&this._append`L${d},${h}`,r&&(p<0&&(p=p%_I+_I),p>mBe?this._append`A${r},${r},0,1,${m},${e-l},${t-c}A${r},${r},0,1,${m},${this._x1=d},${this._y1=h}`:p>Mf&&this._append`A${r},${r},0,${+(p>=NI)},${m},${this._x1=e+r*Math.cos(a)},${this._y1=t+r*Math.sin(a)}`)}rect(e,t,r,s){this._append`M${this._x0=this._x1=+e},${this._y0=this._y1=+t}h${r=+r}v${+s}h${-r}Z`}toString(){return this._}}function rY(n){let e=3;return n.digits=function(t){if(!arguments.length)return e;if(t==null)e=null;else{const r=Math.floor(t);if(!(r>=0))throw new RangeError(`invalid digits: ${t}`);e=r}return n},()=>new gBe(e)}function aR(n){return typeof n=="object"&&"length"in n?n:Array.from(n)}function sY(n){this._context=n}sY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;default:this._context.lineTo(n,e);break}}};function xS(n){return new sY(n)}function aY(n){return n[0]}function iY(n){return n[1]}function oY(n,e){var t=os(!0),r=null,s=xS,a=null,o=rY(l);n=typeof n=="function"?n:n===void 0?aY:os(n),e=typeof e=="function"?e:e===void 0?iY:os(e);function l(c){var d,h=(c=aR(c)).length,m,p=!1,x;for(r==null&&(a=s(x=o())),d=0;d<=h;++d)!(d<h&&t(m=c[d],d,c))===p&&((p=!p)?a.lineStart():a.lineEnd()),p&&a.point(+n(m,d,c),+e(m,d,c));if(x)return a=null,x+""||null}return l.x=function(c){return arguments.length?(n=typeof c=="function"?c:os(+c),l):n},l.y=function(c){return arguments.length?(e=typeof c=="function"?c:os(+c),l):e},l.defined=function(c){return arguments.length?(t=typeof c=="function"?c:os(!!c),l):t},l.curve=function(c){return arguments.length?(s=c,r!=null&&(a=s(r)),l):s},l.context=function(c){return arguments.length?(c==null?r=a=null:a=s(r=c),l):r},l}function gw(n,e,t){var r=null,s=os(!0),a=null,o=xS,l=null,c=rY(d);n=typeof n=="function"?n:n===void 0?aY:os(+n),e=typeof e=="function"?e:os(e===void 0?0:+e),t=typeof t=="function"?t:t===void 0?iY:os(+t);function d(m){var p,x,y,v=(m=aR(m)).length,B,E=!1,N,T=new Array(v),k=new Array(v);for(a==null&&(l=o(N=c())),p=0;p<=v;++p){if(!(p<v&&s(B=m[p],p,m))===E)if(E=!E)x=p,l.areaStart(),l.lineStart();else{for(l.lineEnd(),l.lineStart(),y=p-1;y>=x;--y)l.point(T[y],k[y]);l.lineEnd(),l.areaEnd()}E&&(T[p]=+n(B,p,m),k[p]=+e(B,p,m),l.point(r?+r(B,p,m):T[p],t?+t(B,p,m):k[p]))}if(N)return l=null,N+""||null}function h(){return oY().defined(s).curve(o).context(a)}return d.x=function(m){return arguments.length?(n=typeof m=="function"?m:os(+m),r=null,d):n},d.x0=function(m){return arguments.length?(n=typeof m=="function"?m:os(+m),d):n},d.x1=function(m){return arguments.length?(r=m==null?null:typeof m=="function"?m:os(+m),d):r},d.y=function(m){return arguments.length?(e=typeof m=="function"?m:os(+m),t=null,d):e},d.y0=function(m){return arguments.length?(e=typeof m=="function"?m:os(+m),d):e},d.y1=function(m){return arguments.length?(t=m==null?null:typeof m=="function"?m:os(+m),d):t},d.lineX0=d.lineY0=function(){return h().x(n).y(e)},d.lineY1=function(){return h().x(n).y(t)},d.lineX1=function(){return h().x(r).y(e)},d.defined=function(m){return arguments.length?(s=typeof m=="function"?m:os(!!m),d):s},d.curve=function(m){return arguments.length?(o=m,a!=null&&(l=o(a)),d):o},d.context=function(m){return arguments.length?(m==null?a=l=null:l=o(a=m),d):a},d}class lY{constructor(e,t){this._context=e,this._x=t}areaStart(){this._line=0}areaEnd(){this._line=NaN}lineStart(){this._point=0}lineEnd(){(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line}point(e,t){switch(e=+e,t=+t,this._point){case 0:{this._point=1,this._line?this._context.lineTo(e,t):this._context.moveTo(e,t);break}case 1:this._point=2;default:{this._x?this._context.bezierCurveTo(this._x0=(this._x0+e)/2,this._y0,this._x0,t,e,t):this._context.bezierCurveTo(this._x0,this._y0=(this._y0+t)/2,e,this._y0,e,t);break}}this._x0=e,this._y0=t}}function xBe(n){return new lY(n,!0)}function bBe(n){return new lY(n,!1)}function CE(){}function EE(n,e,t){n._context.bezierCurveTo((2*n._x0+n._x1)/3,(2*n._y0+n._y1)/3,(n._x0+2*n._x1)/3,(n._y0+2*n._y1)/3,(n._x0+4*n._x1+e)/6,(n._y0+4*n._y1+t)/6)}function cY(n){this._context=n}cY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){switch(this._point){case 3:EE(this,this._x1,this._y1);case 2:this._context.lineTo(this._x1,this._y1);break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;break;case 2:this._point=3,this._context.lineTo((5*this._x0+this._x1)/6,(5*this._y0+this._y1)/6);default:EE(this,n,e);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=e}};function yBe(n){return new cY(n)}function dY(n){this._context=n}dY.prototype={areaStart:CE,areaEnd:CE,lineStart:function(){this._x0=this._x1=this._x2=this._x3=this._x4=this._y0=this._y1=this._y2=this._y3=this._y4=NaN,this._point=0},lineEnd:function(){switch(this._point){case 1:{this._context.moveTo(this._x2,this._y2),this._context.closePath();break}case 2:{this._context.moveTo((this._x2+2*this._x3)/3,(this._y2+2*this._y3)/3),this._context.lineTo((this._x3+2*this._x2)/3,(this._y3+2*this._y2)/3),this._context.closePath();break}case 3:{this.point(this._x2,this._y2),this.point(this._x3,this._y3),this.point(this._x4,this._y4);break}}},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._x2=n,this._y2=e;break;case 1:this._point=2,this._x3=n,this._y3=e;break;case 2:this._point=3,this._x4=n,this._y4=e,this._context.moveTo((this._x0+4*this._x1+n)/6,(this._y0+4*this._y1+e)/6);break;default:EE(this,n,e);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=e}};function vBe(n){return new dY(n)}function uY(n){this._context=n}uY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=NaN,this._point=0},lineEnd:function(){(this._line||this._line!==0&&this._point===3)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1;break;case 1:this._point=2;break;case 2:this._point=3;var t=(this._x0+4*this._x1+n)/6,r=(this._y0+4*this._y1+e)/6;this._line?this._context.lineTo(t,r):this._context.moveTo(t,r);break;case 3:this._point=4;default:EE(this,n,e);break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=e}};function BBe(n){return new uY(n)}function hY(n){this._context=n}hY.prototype={areaStart:CE,areaEnd:CE,lineStart:function(){this._point=0},lineEnd:function(){this._point&&this._context.closePath()},point:function(n,e){n=+n,e=+e,this._point?this._context.lineTo(n,e):(this._point=1,this._context.moveTo(n,e))}};function wBe(n){return new hY(n)}function O6(n){return n<0?-1:1}function M6(n,e,t){var r=n._x1-n._x0,s=e-n._x1,a=(n._y1-n._y0)/(r||s<0&&-0),o=(t-n._y1)/(s||r<0&&-0),l=(a*s+o*r)/(r+s);return(O6(a)+O6(o))*Math.min(Math.abs(a),Math.abs(o),.5*Math.abs(l))||0}function F6(n,e){var t=n._x1-n._x0;return t?(3*(n._y1-n._y0)/t-e)/2:e}function Zk(n,e,t){var r=n._x0,s=n._y0,a=n._x1,o=n._y1,l=(a-r)/3;n._context.bezierCurveTo(r+l,s+l*e,a-l,o-l*t,a,o)}function SE(n){this._context=n}SE.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x0=this._x1=this._y0=this._y1=this._t0=NaN,this._point=0},lineEnd:function(){switch(this._point){case 2:this._context.lineTo(this._x1,this._y1);break;case 3:Zk(this,this._t0,F6(this,this._t0));break}(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line=1-this._line},point:function(n,e){var t=NaN;if(n=+n,e=+e,!(n===this._x1&&e===this._y1)){switch(this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;break;case 2:this._point=3,Zk(this,F6(this,t=M6(this,n,e)),t);break;default:Zk(this,this._t0,t=M6(this,n,e));break}this._x0=this._x1,this._x1=n,this._y0=this._y1,this._y1=e,this._t0=t}}};function fY(n){this._context=new mY(n)}(fY.prototype=Object.create(SE.prototype)).point=function(n,e){SE.prototype.point.call(this,e,n)};function mY(n){this._context=n}mY.prototype={moveTo:function(n,e){this._context.moveTo(e,n)},closePath:function(){this._context.closePath()},lineTo:function(n,e){this._context.lineTo(e,n)},bezierCurveTo:function(n,e,t,r,s,a){this._context.bezierCurveTo(e,n,r,t,a,s)}};function CBe(n){return new SE(n)}function EBe(n){return new fY(n)}function pY(n){this._context=n}pY.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=[],this._y=[]},lineEnd:function(){var n=this._x,e=this._y,t=n.length;if(t)if(this._line?this._context.lineTo(n[0],e[0]):this._context.moveTo(n[0],e[0]),t===2)this._context.lineTo(n[1],e[1]);else for(var r=U6(n),s=U6(e),a=0,o=1;o<t;++a,++o)this._context.bezierCurveTo(r[0][a],s[0][a],r[1][a],s[1][a],n[o],e[o]);(this._line||this._line!==0&&t===1)&&this._context.closePath(),this._line=1-this._line,this._x=this._y=null},point:function(n,e){this._x.push(+n),this._y.push(+e)}};function U6(n){var e,t=n.length-1,r,s=new Array(t),a=new Array(t),o=new Array(t);for(s[0]=0,a[0]=2,o[0]=n[0]+2*n[1],e=1;e<t-1;++e)s[e]=1,a[e]=4,o[e]=4*n[e]+2*n[e+1];for(s[t-1]=2,a[t-1]=7,o[t-1]=8*n[t-1]+n[t],e=1;e<t;++e)r=s[e]/a[e-1],a[e]-=r,o[e]-=r*o[e-1];for(s[t-1]=o[t-1]/a[t-1],e=t-2;e>=0;--e)s[e]=(o[e]-s[e+1])/a[e];for(a[t-1]=(n[t]+s[t-1])/2,e=0;e<t-1;++e)a[e]=2*n[e+1]-s[e+1];return[s,a]}function SBe(n){return new pY(n)}function bS(n,e){this._context=n,this._t=e}bS.prototype={areaStart:function(){this._line=0},areaEnd:function(){this._line=NaN},lineStart:function(){this._x=this._y=NaN,this._point=0},lineEnd:function(){0<this._t&&this._t<1&&this._point===2&&this._context.lineTo(this._x,this._y),(this._line||this._line!==0&&this._point===1)&&this._context.closePath(),this._line>=0&&(this._t=1-this._t,this._line=1-this._line)},point:function(n,e){switch(n=+n,e=+e,this._point){case 0:this._point=1,this._line?this._context.lineTo(n,e):this._context.moveTo(n,e);break;case 1:this._point=2;
4641default:{if(this._t<=0)this._context.lineTo(this._x,e),this._context.lineTo(n,e);else{var t=this._x*(1-this._t)+n*this._t;this._context.lineTo(t,this._y),this._context.lineTo(t,e)}break}}this._x=n,this._y=e}};function TBe(n){return new bS(n,.5)}function ABe(n){return new bS(n,0)}function kBe(n){return new bS(n,1)}function Mm(n,e){if((o=n.length)>1)for(var t=1,r,s,a=n[e[0]],o,l=a.length;t<o;++t)for(s=a,a=n[e[t]],r=0;r<l;++r)a[r][1]+=a[r][0]=isNaN(s[r][1])?s[r][0]:s[r][1]}function II(n){for(var e=n.length,t=new Array(e);--e>=0;)t[e]=e;return t}function NBe(n,e){return n[e]}function _Be(n){const e=[];return e.key=n,e}function IBe(){var n=os([]),e=II,t=Mm,r=NBe;function s(a){var o=Array.from(n.apply(this,arguments),_Be),l,c=o.length,d=-1,h;for(const m of a)for(l=0,++d;l<c;++l)(o[l][d]=[0,+r(m,o[l].key,d,a)]).data=m;for(l=0,h=aR(e(o));l<c;++l)o[h[l]].index=l;return t(o,h),o}return s.keys=function(a){return arguments.length?(n=typeof a=="function"?a:os(Array.from(a)),s):n},s.value=function(a){return arguments.length?(r=typeof a=="function"?a:os(+a),s):r},s.order=function(a){return arguments.length?(e=a==null?II:typeof a=="function"?a:os(Array.from(a)),s):e},s.offset=function(a){return arguments.length?(t=a??Mm,s):t},s}function DBe(n,e){if((r=n.length)>0){for(var t,r,s=0,a=n[0].length,o;s<a;++s){for(o=t=0;t<r;++t)o+=n[t][s][1]||0;if(o)for(t=0;t<r;++t)n[t][s][1]/=o}Mm(n,e)}}function jBe(n,e){if((s=n.length)>0){for(var t=0,r=n[e[0]],s,a=r.length;t<a;++t){for(var o=0,l=0;o<s;++o)l+=n[o][t][1]||0;r[t][1]+=r[t][0]=-l/2}Mm(n,e)}}function RBe(n,e){if(!(!((o=n.length)>0)||!((a=(s=n[e[0]]).length)>0))){for(var t=0,r=1,s,a,o;r<a;++r){for(var l=0,c=0,d=0;l<o;++l){for(var h=n[e[l]],m=h[r][1]||0,p=h[r-1][1]||0,x=(m-p)/2,y=0;y<l;++y){var v=n[e[y]],B=v[r][1]||0,E=v[r-1][1]||0;x+=B-E}c+=m,d+=x*m}s[r-1][1]+=s[r-1][0]=t,c&&(t-=d/c)}s[r-1][1]+=s[r-1][0]=t,Mm(n,e)}}var gY=n=>"radius"in n&&"startAngle"in n&&"endAngle"in n,iR=(n,e)=>{if(!n||typeof n=="function"||typeof n=="boolean")return null;var t=n;if(S.isValidElement(n)&&(t=n.props),typeof t!="object"&&typeof t!="function")return null;var r={};return Object.keys(t).forEach(s=>{eR(s)&&typeof t[s]=="function"&&(r[s]=(a=>t[s](t,a)))}),r},PBe=(n,e,t)=>r=>(n(e,t,r),null),xY=(n,e,t)=>{if(n===null||typeof n!="object"&&typeof n!="function")return null;var r=null;return Object.keys(n).forEach(s=>{var a=n[s];eR(s)&&typeof a=="function"&&(r||(r={}),r[s]=PBe(a,e,t))}),r};function V6(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function LBe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?V6(Object(t),!0).forEach(function(r){OBe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):V6(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function OBe(n,e,t){return(e=MBe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function MBe(n){var e=FBe(n,"string");return typeof e=="symbol"?e:e+""}function FBe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ll(n,e){var t=LBe({},n),r=e,s=Object.keys(e),a=s.reduce((o,l)=>(o[l]===void 0&&r[l]!==void 0&&(o[l]=r[l]),o),t);return a}function UBe(n,e){const t=new Map;for(let r=0;r<n.length;r++){const s=n[r],a=e(s,r,n);t.has(a)||t.set(a,s)}return Array.from(t.values())}function VBe(n,e){return function(...t){return n.apply(this,t.slice(0,e))}}function yS(n){return n}function GBe(n){return Number.isSafeInteger(n)&&n>=0}function vS(n){return n!=null&&typeof n!="function"&&GBe(n.length)}function $Be(n){return function(e){return Sv(e,n)}}function bY(n){return n==null||typeof n!="object"&&typeof n!="function"}function HBe(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function zBe(n){return Object.getOwnPropertySymbols(n).filter(e=>Object.prototype.propertyIsEnumerable.call(n,e))}
4641function BS(n){return n==null?n===void 0?"[object Undefined]":"[object Null]":Object.prototype.toString.call(n)}const qBe="[object RegExp]",yY="[object String]",vY="[object Number]",BY="[object Boolean]",wY="[object Arguments]",KBe="[object Symbol]",WBe="[object Date]",YBe="[object Map]",QBe="[object Set]",JBe="[object Array]",XBe="[object ArrayBuffer]",ZBe="[object Object]",ewe="[object DataView]",twe="[object Uint8Array]",nwe="[object Uint8ClampedArray]",rwe="[object Uint16Array]",swe="[object Uint32Array]",awe="[object Int8Array]",iwe="[object Int16Array]",owe="[object Int32Array]",lwe="[object Float32Array]",cwe="[object Float64Array]",G6=typeof globalThis=="object"&&globalThis||typeof window=="object"&&window||typeof self=="object"&&self||typeof global=="object"&&global||(function(){return this})();function dwe(n){return typeof G6.Buffer<"u"&&G6.Buffer.isBuffer(n)}function uwe(n,e){return nm(n,void 0,n,new Map,e)}function nm(n,e,t,r=new Map,s=void 0){const a=s==null?void 0:s(n,e,t,r);if(a!==void 0)return a;if(bY(n))return n;if(r.has(n))return r.get(n);if(Array.isArray(n)){const o=new Array(n.length);r.set(n,o);for(let l=0;l<n.length;l++)o[l]=nm(n[l],l,t,r,s);return Object.hasOwn(n,"index")&&(o.index=n.index),Object.hasOwn(n,"input")&&(o.input=n.input),o}if(n instanceof Date)return new Date(n.getTime());if(n instanceof RegExp){const o=new RegExp(n.source,n.flags);return o.lastIndex=n.lastIndex,o}if(n instanceof Map){const o=new Map;r.set(n,o);for(const[l,c]of n)o.set(l,nm(c,l,t,r,s));return o}if(n instanceof Set){const o=new Set;r.set(n,o);for(const l of n)o.add(nm(l,void 0,t,r,s));return o}if(dwe(n))return n.subarray();if(HBe(n)){const o=new(Object.getPrototypeOf(n)).constructor(n.length);r.set(n,o);for(let l=0;l<n.length;l++)o[l]=nm(n[l],l,t,r,s);return o}if(n instanceof ArrayBuffer||typeof SharedArrayBuffer<"u"&&n instanceof SharedArrayBuffer)return n.slice(0);if(n instanceof DataView){const o=new DataView(n.buffer.slice(0),n.byteOffset,n.byteLength);return r.set(n,o),_l(o,n,t,r,s),o}if(typeof File<"u"&&n instanceof File){const o=new File([n],n.name,{type:n.type});return r.set(n,o),_l(o,n,t,r,s),o}if(typeof Blob<"u"&&n instanceof Blob){const o=new Blob([n],{type:n.type});return r.set(n,o),_l(o,n,t,r,s),o}if(n instanceof Error){const o=structuredClone(n);return r.set(n,o),o.message=n.message,o.name=n.name,o.stack=n.stack,o.cause=n.cause,o.constructor=n.constructor,_l(o,n,t,r,s),o}if(n instanceof Boolean){const o=new Boolean(n.valueOf());return r.set(n,o),_l(o,n,t,r,s),o}if(n instanceof Number){const o=new Number(n.valueOf());return r.set(n,o),_l(o,n,t,r,s),o}if(n instanceof String){const o=new String(n.valueOf());return r.set(n,o),_l(o,n,t,r,s),o}if(typeof n=="object"&&hwe(n)){const o=Object.create(Object.getPrototypeOf(n));return r.set(n,o),_l(o,n,t,r,s),o}return n}function _l(n,e,t=n,r,s){const a=[...Object.keys(e),...zBe(e)];for(let o=0;o<a.length;o++){const l=a[o],c=Object.getOwnPropertyDescriptor(n,l);(c==null||c.writable)&&(n[l]=nm(e[l],l,t,r,s))}}function hwe(n){switch(BS(n)){case wY:case JBe:case XBe:case ewe:case BY:case WBe:case lwe:case cwe:case awe:case iwe:case owe:case YBe:case vY:case ZBe:case qBe:case QBe:case yY:case KBe:case twe:case nwe:case rwe:case swe:return!0;default:return!1}}function fwe(n){return nm(n,void 0,n,new Map,void 0)}function wC(n,e){return n===e||Number.isNaN(n)&&Number.isNaN(e)}function CY(n){return n!==null&&(typeof n=="object"||typeof n=="function")}function EY(n,e,t){return typeof t!="function"?EY(n,e,()=>{}):DI(n,e,function r(s,a,o,l,c,d){const h=t(s,a,o,l,c,d);return h!==void 0?!!h:DI(s,a,r,d,!1)},new Map,!0)}function DI(n,e,t,r,s=!1){if(e===n)return!0;switch(typeof e){case"object":return mwe(n,e,t,r,s);case"function":return Object.keys(e).length>0?DI(n,{...e},t,r,s):wC(n,e);default:return CY(n)&&s?typeof e=="string"?e==="":!0:wC(n,e)}}function mwe(n,e,t,r,s=!1){if(e==null)return!0;if(Array.isArray(e))return SY(n,e,t,r);if(e instanceof Map)return pwe(n,e,t,r);if(e instanceof Set)return gwe(n,e,t,r);const a=Object.keys(e);if(n==null)return s&&a.length===0;if(s)bY(n)&&(n=Object(n));else{const o=BS(n);if(o!=="[object Object]"&&o!=="[object Arguments]")return!1}if(a.length===0)return!0;
4641if(r!=null&&r.has(e))return r.get(e)===n;r==null||r.set(e,n);try{for(let o=0;o<a.length;o++){const l=a[o];if(!(l in n)||e[l]===void 0&&n[l]!==void 0||e[l]===null&&n[l]!==null||!t(n[l],e[l],l,n,e,r))return!1}return!0}finally{r==null||r.delete(e)}}function pwe(n,e,t,r){if(e.size===0)return!0;if(!(n instanceof Map))return!1;for(const[s,a]of e.entries())if(t(n.get(s),a,s,n,e,r)===!1)return!1;return!0}function SY(n,e,t,r){if(e.length===0)return!0;if(!Array.isArray(n))return!1;const s=new Set;for(let a=0;a<e.length;a++){const o=e[a];let l=!1;for(let c=0;c<n.length;c++){if(s.has(c))continue;const d=n[c];let h=!1;if(t(d,o,a,n,e,r)&&(h=!0),h){s.add(c),l=!0;break}}if(!l)return!1}return!0}function gwe(n,e,t,r){return e.size===0?!0:n instanceof Set?SY([...n],[...e],t,r):!1}function TY(n,e){return EY(n,e,()=>{})}function xwe(n){return n=fwe(n),e=>TY(e,n)}function bwe(n,e){return uwe(n,(t,r,s,a)=>{if(typeof n=="object"){if(BS(n)==="[object Object]"&&typeof n.constructor!="function"){const o={};return a.set(n,o),_l(o,n,s,a),o}switch(Object.prototype.toString.call(n)){case vY:case yY:case BY:{const o=new n.constructor(n==null?void 0:n.valueOf());return _l(o,n),o}case wY:{const o={};return _l(o,n),o.length=n.length,o[Symbol.iterator]=n[Symbol.iterator],o}default:return}}})}function ywe(n){return bwe(n)}const vwe=/^(?:0|[1-9]\d*)$/;function AY(n,e=Number.MAX_SAFE_INTEGER){switch(typeof n){case"number":return Number.isInteger(n)&&n>=0&&n<e;case"symbol":return!1;case"string":return vwe.test(n)}}function Bwe(n){return n!==null&&typeof n=="object"&&BS(n)==="[object Arguments]"}function wwe(n,e){let t;if(Array.isArray(e)?t=e:typeof e=="string"&&ZW(e)&&!(e in Object(n))?t=nR(e):t=[e],t.length===0)return!1;let r=n;for(let s=0;s<t.length;s++){const a=gS(t[s]);if((r==null||!Object.hasOwn(r,a))&&!((Array.isArray(r)||Bwe(r))&&AY(a)&&Number(a)<r.length))return!1;r=r[a]}return!0}function Cwe(n,e){switch(typeof n){case"object":Object.is(n==null?void 0:n.valueOf(),-0)&&(n="-0");break;case"number":n=gS(n);break}return e=ywe(e),function(t){const r=Sv(t,n);return r===void 0?wwe(t,n):e===void 0?r===void 0:TY(r,e)}}function oR(n){if(n==null)return yS;switch(typeof n){case"function":return n;case"object":return Array.isArray(n)&&n.length===2?Cwe(n[0],n[1]):xwe(n);default:return $Be(n)}}function Ewe(n){return n===0?0:n}function $6(n,e=yS){return vS(n)?UBe(Array.from(n),VBe(oR(e),1)).map(Ewe):[]}function Swe(n,e,t){return e===!0?$6(n,t):typeof e=="function"?$6(n,e):n}var eN={exports:{}},tN={},nN={exports:{}},rN={};/**
4642 * @license React
4643 * use-sync-external-store-shim.production.js
4644 *
4645 * Copyright (c) Meta Platforms, Inc. and affiliates.
4646 *
4647 * This source code is licensed under the MIT license found in the
4648 * LICENSE file in the root directory of this source tree.
4649 */var H6;function Twe(){if(H6)return rN;H6=1;var n=kg();function e(m,p){return m===p&&(m!==0||1/m===1/p)||m!==m&&p!==p}var t=typeof Object.is=="function"?Object.is:e,r=n.useState,s=n.useEffect,a=n.useLayoutEffect,o=n.useDebugValue;function l(m,p){var x=p(),y=r({inst:{value:x,getSnapshot:p}}),v=y[0].inst,B=y[1];return a(function(){v.value=x,v.getSnapshot=p,c(v)&&B({inst:v})},[m,x,p]),s(function(){return c(v)&&B({inst:v}),m(function(){c(v)&&B({inst:v})})},[m]),o(x),x}function c(m){var p=m.getSnapshot;m=m.value;try{var x=p();return!t(m,x)}catch{return!0}}function d(m,p){return p()}var h=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?d:l;return rN.useSyncExternalStore=n.useSyncExternalStore!==void 0?n.useSyncExternalStore:h,rN}var z6;function Awe(){return z6||(z6=1,nN.exports=Twe()),nN.exports}/**
4650 * @license React
4651 * use-sync-external-store-shim/with-selector.production.js
4652 *
4653 * Copyright (c) Meta Platforms, Inc. and affiliates.
4654 *
4655 * This source code is licensed under the MIT license found in the
4656 * LICENSE file in the root directory of this source tree.
4657 */var q6;function kwe(){if(q6)return tN;q6=1;var n=kg(),e=Awe();function t(d,h){return d===h&&(d!==0||1/d===1/h)||d!==d&&h!==h}var r=typeof Object.is=="function"?Object.is:t,s=e.useSyncExternalStore,a=n.useRef,o=n.useEffect,l=n.useMemo,c=n.useDebugValue;return tN.useSyncExternalStoreWithSelector=function(d,h,m,p,x){var y=a(null);if(y.current===null){var v={hasValue:!1,value:null};y.current=v}else v=y.current;y=l(function(){function E(R){if(!N){if(N=!0,T=R,R=p(R),x!==void 0&&v.hasValue){var _=v.value;if(x(_,R))return k=_}return k=R}if(_=k,r(T,R))return _;var I=p(R);
4657return x!==void 0&&x(_,I)?(T=R,_):(T=R,k=I)}var N=!1,T,k,P=m===void 0?null:m;return[function(){return E(h())},P===null?void 0:function(){return E(P())}]},[h,m,p,x]);var B=s(d,y[0],y[1]);return o(function(){v.hasValue=!0,v.value=B},[B]),c(B),B},tN}var K6;function Nwe(){return K6||(K6=1,eN.exports=kwe()),eN.exports}var _we=Nwe(),lR=S.createContext(null),Iwe=n=>n,ta=()=>{var n=S.useContext(lR);return n?n.store.dispatch:Iwe},CC=()=>{},Dwe=()=>CC,jwe=(n,e)=>n===e;function Dt(n){var e=S.useContext(lR),t=S.useMemo(()=>e?r=>{if(r!=null)return n(r)}:CC,[e,n]);return _we.useSyncExternalStoreWithSelector(e?e.subscription.addNestedSub:Dwe,e?e.store.getState:CC,e?e.store.getState:CC,t,jwe)}function Rwe(n,e=`expected a function, instead received ${typeof n}`){if(typeof n!="function")throw new TypeError(e)}function Pwe(n,e="expected all items to be functions, instead received the following types: "){if(!n.every(t=>typeof t=="function")){const t=n.map(r=>typeof r=="function"?`function ${r.name||"unnamed"}()`:typeof r).join(", ");throw new TypeError(`${e}[${t}]`)}}var W6=n=>Array.isArray(n)?n:[n];function Lwe(n){const e=Array.isArray(n[0])?n[0]:n;return Pwe(e,"createSelector expects all input-selectors to be functions, but received the following types: "),e}function Owe(n,e){const t=[],{length:r}=n;for(let s=0;s<r;s++)t.push(n[s].apply(null,e));return t}var Mwe=class{constructor(n){this.value=n}deref(){return this.value}},Fwe=()=>typeof WeakRef>"u"?Mwe:WeakRef,kY=Fwe(),Uwe=0,Y6=1;function xw(){return{s:Uwe,v:void 0,o:null,p:null}}function Vwe(n){return n instanceof kY?n.deref():n}function NY(n,e={}){let t=xw();const{resultEqualityCheck:r}=e;let s,a=0;function o(){let l=t;const{length:c}=arguments;for(let m=0,p=c;m<p;m++){const x=arguments[m];if(typeof x=="function"||typeof x=="object"&&x!==null){let y=l.o;y===null&&(l.o=y=new WeakMap);const v=y.get(x);v===void 0?(l=xw(),y.set(x,l)):l=v}else{let y=l.p;y===null&&(l.p=y=new Map);const v=y.get(x);v===void 0?(l=xw(),y.set(x,l)):l=v}}const d=l;let h;if(l.s===Y6)h=l.v;else if(h=n.apply(null,arguments),a++,r){const m=Vwe(s);m!=null&&r(m,h)&&(h=m,a!==0&&a--),s=typeof h=="object"&&h!==null||typeof h=="function"?new kY(h):h}return d.s=Y6,d.v=h,h}return o.clearCache=()=>{t=xw(),o.resetResultsCount()},o.resultsCount=()=>a,o.resetResultsCount=()=>{a=0},o}function Gwe(n,...e){const t=typeof n=="function"?{memoize:n,memoizeOptions:e}:n,r=(...s)=>{let a=0,o=0,l,c={},d=s.pop();typeof d=="object"&&(c=d,d=s.pop()),Rwe(d,`createSelector expects an output function after the inputs, but received: [${typeof d}]`);const h={...t,...c},{memoize:m,memoizeOptions:p=[],argsMemoize:x=NY,argsMemoizeOptions:y=[]}=h,v=W6(p),B=W6(y),E=Lwe(s),N=m(function(){return a++,d.apply(null,arguments)},...v),T=x(function(){o++;const P=Owe(E,arguments);return l=N.apply(null,P),l},...B);return Object.assign(T,{resultFunc:d,memoizedResultFunc:N,dependencies:E,dependencyRecomputations:()=>o,resetDependencyRecomputations:()=>{o=0},lastResult:()=>l,recomputations:()=>a,resetRecomputations:()=>{a=0},memoize:m,argsMemoize:x})};return Object.assign(r,{withTypes:()=>r}),r}var Be=Gwe(NY);function $we(n,e=1){const t=[],r=Math.floor(e),s=(a,o)=>{for(let l=0;l<a.length;l++){const c=a[l];Array.isArray(c)&&o<r?s(c,o+1):t.push(c)}};return s(n,0),t}function jI(n,e,t){return CY(t)&&(typeof e=="number"&&vS(t)&&AY(e)&&e<t.length||typeof e=="string"&&e in t)?wC(t[e],n):!1}function Q6(n){return typeof n=="symbol"?1:n===null?2:n===void 0?3:n!==n?4:0}const Hwe=(n,e,t)=>{if(n!==e){const r=Q6(n),s=Q6(e);if(r===s&&r===0){if(n<e)return t==="desc"?1:-1;if(n>e)return t==="desc"?-1:1}return t==="desc"?s-r:r-s}return 0},zwe=/\.|\[(?:[^[\]]*|(["'])(?:(?!\1)[^\\]|\\.)*?\1)\]/,qwe=/^\w*$/;function Kwe(n,e){return Array.isArray(n)?!1:typeof n=="number"||typeof n=="boolean"||n==null||tR(n)?!0:typeof n=="string"&&(qwe.test(n)||!zwe.test(n))||e!=null}function Wwe(n,e,t,r){if(n==null)return[];t=t,Array.isArray(n)||(n=vS(n)?Array.from(n):Object.values(n)),Array.isArray(e)||(e=e==null?[null]:[e]),e.length===0&&(e=[null]),Array.isArray(t)||(t=t==null?[]:[t]),t=t.map(l=>String(l));const s=(l,c)=>{let d=l,h=0;for(;h<c.length&&d!=null;
4657++h)d=d[c[h]];return h>0&&h===c.length?d:void 0},a=(l,c)=>{if(l==null)return c;if(c!=null)return typeof l=="object"&&"key"in l?Object.hasOwn(c,l.key)?c[l.key]:s(c,l.path):typeof l=="function"?l(c):Array.isArray(l)?s(c,l):c[l]},o=e.map(l=>(Array.isArray(l)&&l.length===1&&(l=l[0]),l==null||typeof l=="function"||Array.isArray(l)||Kwe(l)?l:{key:l,path:nR(l)}));return n.map(l=>({original:l,criteria:o.map(c=>a(c,l))})).slice().sort((l,c)=>{for(let d=0;d<o.length;d++){const h=Hwe(l.criteria[d],c.criteria[d],t[d]);if(h!==0)return h}return 0}).map(l=>l.original)}function wS(n,...e){const t=e.length;return t>1&&jI(n,e[0],e[1])?e=[]:t>2&&jI(e[0],e[1],e[2])&&(e=[e[0]]),Wwe(n,$we(e),["asc"])}var _Y=n=>n.legend.settings,Ywe=n=>n.legend.size,Qwe=n=>n.legend.payload;Be([Qwe,_Y],(n,e)=>{var t=e.itemSorter,r=n.flat(1);return t?wS(r,t):r});function Jwe(n,e){return tCe(n)||eCe(n,e)||Zwe(n,e)||Xwe()}function Xwe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4658In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Zwe(n,e){if(n){if(typeof n=="string")return J6(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?J6(n,e):void 0}}function J6(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function eCe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function tCe(n){if(Array.isArray(n))return n}var bw=1;function X6(n,e){return Math.abs(n.height-e.height)>bw||Math.abs(n.left-e.left)>bw||Math.abs(n.top-e.top)>bw||Math.abs(n.width-e.width)>bw}function Z6(n){var e=n.getBoundingClientRect();return{height:e.height,left:e.left,top:e.top,width:e.width}}function nCe(){var n=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],e=S.useState({height:0,left:0,top:0,width:0}),t=Jwe(e,2),r=t[0],s=t[1],a=S.useRef(null),o=S.useRef(r);o.current=r;var l=S.useCallback(c=>{if(a.current!=null&&(a.current.disconnect(),a.current=null),c!=null){var d=Z6(c);if(X6(d,o.current)&&s(d),typeof ResizeObserver<"u"){var h=new ResizeObserver(()=>{var m=Z6(c);X6(m,o.current)&&s(m)});h.observe(c),a.current=h}}},[...n]);return S.useEffect(()=>()=>{var c;(c=a.current)===null||c===void 0||c.disconnect()},[]),[r,l]}function Na(n){return`Minified Redux error #${n}; visit https://redux.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `}var rCe=typeof Symbol=="function"&&Symbol.observable||"@@observable",e8=rCe,sN=()=>Math.random().toString(36).substring(7).split("").join("."),sCe={INIT:`@@redux/INIT${sN()}`,REPLACE:`@@redux/REPLACE${sN()}`,PROBE_UNKNOWN_ACTION:()=>`@@redux/PROBE_UNKNOWN_ACTION${sN()}`},TE=sCe;function cR(n){if(typeof n!="object"||n===null)return!1;let e=n;for(;Object.getPrototypeOf(e)!==null;)e=Object.getPrototypeOf(e);return Object.getPrototypeOf(n)===e||Object.getPrototypeOf(n)===null}function IY(n,e,t){if(typeof n!="function")throw new Error(Na(2));if(typeof e=="function"&&typeof t=="function"||typeof t=="function"&&typeof arguments[3]=="function")throw new Error(Na(0));if(typeof e=="function"&&typeof t>"u"&&(t=e,e=void 0),typeof t<"u"){if(typeof t!="function")throw new Error(Na(1));return t(IY)(n,e)}let r=n,s=e,a=new Map,o=a,l=0,c=!1;function d(){o===a&&(o=new Map,a.forEach((B,E)=>{o.set(E,B)}))}function h(){if(c)throw new Error(Na(3));return s}function m(B){if(typeof B!="function")throw new Error(Na(4));if(c)throw new Error(Na(5));let E=!0;d();const N=l++;return o.set(N,B),function(){if(E){if(c)throw new Error(Na(6));E=!1,d(),o.delete(N),a=null}}}function p(B){if(!cR(B))throw new Error(Na(7));if(typeof B.type>"u")throw new Error(Na(8));if(typeof B.type!="string")throw new Error(Na(17));if(c)throw new Error(Na(9));try{c=!0,s=r(s,B)}finally{c=!1}
vendor: 4,399 bytes, line 4658
4658return(a=o).forEach(N=>{N()}),B}function x(B){if(typeof B!="function")throw new Error(Na(10));r=B,p({type:TE.REPLACE})}function y(){const B=m;return{subscribe(E){if(typeof E!="object"||E===null)throw new Error(Na(11));function N(){const k=E;k.next&&k.next(h())}return N(),{unsubscribe:B(N)}},[e8](){return this}}}return p({type:TE.INIT}),{dispatch:p,subscribe:m,getState:h,replaceReducer:x,[e8]:y}}function aCe(n){Object.keys(n).forEach(e=>{const t=n[e];if(typeof t(void 0,{type:TE.INIT})>"u")throw new Error(Na(12));if(typeof t(void 0,{type:TE.PROBE_UNKNOWN_ACTION()})>"u")throw new Error(Na(13))})}function DY(n){const e=Object.keys(n),t={};for(let a=0;a<e.length;a++){const o=e[a];typeof n[o]=="function"&&(t[o]=n[o])}const r=Object.keys(t);let s;try{aCe(t)}catch(a){s=a}return function(o={},l){if(s)throw s;let c=!1;const d={};for(let h=0;h<r.length;h++){const m=r[h],p=t[m],x=o[m],y=p(x,l);if(typeof y>"u")throw l&&l.type,new Error(Na(14));d[m]=y,c=c||y!==x}return c=c||r.length!==Object.keys(o).length,c?d:o}}function AE(...n){return n.length===0?e=>e:n.length===1?n[0]:n.reduce((e,t)=>(...r)=>e(t(...r)))}function iCe(...n){return e=>(t,r)=>{const s=e(t,r);let a=()=>{throw new Error(Na(15))};const o={getState:s.getState,dispatch:(c,...d)=>a(c,...d)},l=n.map(c=>c(o));return a=AE(...l)(s.dispatch),{...s,dispatch:a}}}function jY(n){return cR(n)&&"type"in n&&typeof n.type=="string"}var RY=Symbol.for("immer-nothing"),t8=Symbol.for("immer-draftable"),ti=Symbol.for("immer-state");function jl(n,...e){throw new Error(`[Immer] minified error nr: ${n}. Full error at: https://bit.ly/3cXEKWf`)}var Bo=Object,vg=Bo.getPrototypeOf,kE="constructor",CS="prototype",RI="configurable",NE="enumerable",EC="writable",Ty="value",Yd=n=>!!n&&!!n[ti];function al(n){var e;return n?PY(n)||SS(n)||!!n[t8]||!!((e=n[kE])!=null&&e[t8])||TS(n)||AS(n):!1}var oCe=Bo[CS][kE].toString(),n8=new WeakMap;function PY(n){if(!n||!dR(n))return!1;const e=vg(n);if(e===null||e===Bo[CS])return!0;const t=Bo.hasOwnProperty.call(e,kE)&&e[kE];if(t===Object)return!0;if(!y0(t))return!1;let r=n8.get(t);return r===void 0&&(r=Function.toString.call(t),n8.set(t,r)),r===oCe}function ES(n,e,t=!0){Tv(n)===0?(t?Reflect.ownKeys(n):Bo.keys(n)).forEach(s=>{e(s,n[s],n)}):n.forEach((r,s)=>e(s,r,n))}function Tv(n){const e=n[ti];return e?e.type_:SS(n)?1:TS(n)?2:AS(n)?3:0}var aN=(n,e,t=Tv(n))=>t===2?n.has(e):Bo[CS].hasOwnProperty.call(n,e),PI=(n,e,t=Tv(n))=>t===2?n.get(e):n[e],_E=(n,e,t,r=Tv(n))=>{r===2?n.set(e,t):r===3?n.add(t):n[e]=t};function lCe(n,e){return n===e?n!==0||1/n===1/e:n!==n&&e!==e}var SS=Array.isArray,TS=n=>n instanceof Map,AS=n=>n instanceof Set,dR=n=>typeof n=="object",y0=n=>typeof n=="function",iN=n=>typeof n=="boolean";function cCe(n){const e=+n;return Number.isInteger(e)&&String(e)===n}var wd=n=>n.copy_||n.base_,uR=n=>n.modified_?n.copy_:n.base_;function LI(n,e){if(TS(n))return new Map(n);if(AS(n))return new Set(n);if(SS(n))return Array[CS].slice.call(n);const t=PY(n);if(e===!0||e==="class_only"&&!t){const r=Bo.getOwnPropertyDescriptors(n);delete r[ti];let s=Reflect.ownKeys(r);for(let a=0;a<s.length;a++){const o=s[a],l=r[o];l[EC]===!1&&(l[EC]=!0,l[RI]=!0),(l.get||l.set)&&(r[o]={[RI]:!0,[EC]:!0,[NE]:l[NE],[Ty]:n[o]})}return Bo.create(vg(n),r)}else{const r=vg(n);if(r!==null&&t)return{...n};const s=Bo.create(r);return Bo.assign(s,n)}}function hR(n,e=!1){return kS(n)||Yd(n)||!al(n)||(Tv(n)>1&&Bo.defineProperties(n,{set:yw,add:yw,clear:yw,delete:yw}),Bo.freeze(n),e&&ES(n,(t,r)=>{hR(r,!0)},!1)),n}function dCe(){jl(2)}var yw={[Ty]:dCe};function kS(n){return n===null||!dR(n)?!0:Bo.isFrozen(n)}var IE="MapSet",OI="Patches",r8="ArrayMethods",LY={};function Fm(n){const e=LY[n];return e||jl(0,n),e}var s8=n=>!!LY[n],Ay,OY=()=>Ay,uCe=(n,e)=>({drafts_:[],parent_:n,immer_:e,canAutoFreeze_:!0,unfinalizedDrafts_:0,handledSet_:new Set,processedForPatches_:new Set,mapSetPlugin_:s8(IE)?Fm(IE):void 0,arrayMethodsPlugin_:s8(r8)?Fm(r8):void 0});function a8(n,e){e&&(n.patchPlugin_=Fm(OI),n.patches_=[],n.inversePatches_=[],n.patchListener_=e)}function MI(n){FI(n),n.drafts_.forEach(hCe),n.drafts_=null}function FI(n){n===Ay&&(Ay=n.parent_)}var i8=n=>Ay=uCe(Ay,n);function hCe(n){const e=n[ti];e.type_===0||e.type_===1?e.revoke_():e.revoked_=!0}function o8(n,e){e.unfinalizedDrafts_=e.drafts_.length;const t=e.drafts_[0];if(n!==void 0&&n!==t){t[ti].modified_&&(MI(e),jl(4)),al(n)&&(n=l8(e,n));const{patchPlugin_:s}
4658=e;s&&s.generateReplacementPatches_(t[ti].base_,n,e)}else n=l8(e,t);return fCe(e,n,!0),MI(e),e.patches_&&e.patchListener_(e.patches_,e.inversePatches_),n!==RY?n:void 0}function l8(n,e){if(kS(e))return e;const t=e[ti];if(!t)return DE(e,n.handledSet_,n);if(!NS(t,n))return e;if(!t.modified_)return t.base_;if(!t.finalized_){const{callbacks_:r}=t;if(r)for(;r.length>0;)r.pop()(n);UY(t,n)}return t.copy_}function fCe(n,e,t=!1){!n.parent_&&n.immer_.autoFreeze_&&n.canAutoFreeze_&&hR(e,t)}function MY(n){n.finalized_=!0,n.scope_.unfinalizedDrafts_--}var NS=(n,e)=>n.scope_===e,mCe=[];function FY(n,e,t,r){const s=wd(n),a=n.type_;if(r!==void 0&&PI(s,r,a)===e){_E(s,r,t,a);return}if(!n.draftLocations_){const l=n.draftLocations_=new Map;ES(s,(c,d)=>{if(Yd(d)){const h=l.get(d)||[];h.push(c),l.set(d,h)}})}const o=n.draftLocations_.get(e)??mCe;for(const l of o)_E(s,l,t,a)}function pCe(n,e,t){n.callbacks_.push(function(s){var l;const a=e;if(!a||!NS(a,s))return;(l=s.mapSetPlugin_)==null||l.fixSetContents(a);const o=uR(a);FY(n,a.draft_??a,o,t),UY(a,s)})}function UY(n,e){var r;if(n.modified_&&!n.finalized_&&(n.type_===3||n.type_===1&&n.allIndicesReassigned_||(((r=n.assigned_)==null?void 0:r.size)??0)>0)){const{patchPlugin_:s}=e;if(s){const a=s.getPath(n);a&&s.generatePatches_(n,a,e)}MY(n)}}function gCe(n,e,t){const{scope_:r}=n;if(Yd(t)){const s=t[ti];NS(s,r)&&s.callbacks_.push(function(){SC(n);const o=uR(s);FY(n,t,o,e)})}else al(t)&&n.callbacks_.push(function(){const a=wd(n);n.type_===3?a.has(t)&&DE(t,r.handledSet_,r):PI(a,e,n.type_)===t&&r.drafts_.length>1&&(n.assigned_.get(e)??!1)===!0&&n.copy_&&DE(PI(n.copy_,e,n.type_),r.handledSet_,r)})}function DE(n,e,t){return!t.immer_.autoFreeze_&&t.unfinalizedDrafts_<1||Yd(n)||e.has(n)||!al(n)||kS(n)||(e.add(n),ES(n,(r,s)=>{if(Yd(s)){const a=s[ti];if(NS(a,t)){const o=uR(a);_E(n,r,o,n.type_),MY(a)}}else al(s)&&DE(s,e,t)})),n}function xCe(n,e){const t=SS(n),r={type_:t?1:0,scope_:e?e.scope_:OY(),modified_:!1,finalized_:!1,assigned_:void 0,parent_:e,base_:n,draft_:null,copy_:null,revoke_:null,isManual_:!1,callbacks_:void 0};let s=r,a=jE;t&&(s=[r],a=ky);const{revoke:o,proxy:l}=Proxy.revocable(s,a);return r.draft_=l,r.revoke_=o,[l,r]}var jE={get(n,e){if(e===ti)return n;let t=n.scope_.arrayMethodsPlugin_;const r=n.type_===1&&typeof e=="string";if(r&&t!=null&&t.isArrayOperationMethod(e))return t.createMethodInterceptor(n,e);const s=wd(n);if(!aN(s,e,n.type_))return yCe(n,s,e);const a=s[e];if(n.finalized_||!al(a)||r&&n.operationMethod&&(t!=null&&t.isMutatingArrayMethod(n.operationMethod))&&cCe(e))return a;if(a===oN(n.base_,e)||bCe(n,e,a)){SC(n);const o=n.type_===1?+e:e,l=VI(n.scope_,a,n,o);return n.copy_[o]=l}return a},has(n,e){return e in wd(n)},ownKeys(n){return Reflect.ownKeys(wd(n))},set(n,e,t){const r=VY(wd(n),e);if(r!=null&&r.set)return r.set.call(n.draft_,t),!0;if(!n.modified_){const s=oN(wd(n),e),a=s==null?void 0:s[ti];if(a&&a.base_===t)return n.copy_[e]=t,n.assigned_.set(e,!1),!0;if(lCe(t,s)&&(t!==void 0||aN(n.base_,e,n.type_)))return!0;SC(n),UI(n)}return n.copy_[e]===t&&(t!==void 0||aN(n.copy_,e,n.type_))||Number.isNaN(t)&&Number.isNaN(n.copy_[e])||(n.copy_[e]=t,n.assigned_.set(e,!0),gCe(n,e,t)),!0},deleteProperty(n,e){return SC(n),oN(n.base_,e)!==void 0||e in n.base_?(n.assigned_.set(e,!1),UI(n)):n.assigned_.delete(e),n.copy_&&delete n.copy_[e],!0},getOwnPropertyDescriptor(n,e){const t=wd(n),r=Reflect.getOwnPropertyDescriptor(t,e);return r&&{[EC]:!0,[RI]:n.type_!==1||e!=="length",[NE]:r[NE],[Ty]:t[e]}},defineProperty(){jl(11)},getPrototypeOf(n){return vg(n.base_)},setPrototypeOf(){jl(12)}},ky={};for(let n in jE){let e=jE[n];ky[n]=function(){const t=arguments;return t[0]=t[0][0],e.apply(this,t)}}ky.deleteProperty=function(n,e){return ky.set.call(this,n,e,void 0)};ky.set=function(n,e,t){return jE.set.call(this,n[0],e,t,n[0])};function oN(n,e){const t=n[ti];return(t?wd(t):n)[e]}function bCe(n,e,t){var r;return n.type_!==1||!n.allIndicesReassigned_||(r=n.assigned_)!=null&&r.get(e)||!al(t)||t[ti]?!1:n.baseRefs_.has(t)}function yCe(n,e,t){var s;const r=VY(e,t);return r?Ty in r?r[Ty]:(s=r.get)==null?void 0:s.call(n.draft_):void 0}function VY(n,e){if(!(e in n))return;let t=vg(n);for(;t;){const r=Object.getOwnPropertyDescriptor(t,e);if(r)return r;t=vg(t)}}function UI(n){n.modified_||(n.modified_=!0,n.parent_&&UI(n.parent_))}function SC(n){n.copy_||(n.assigned_=new Map,n.copy_=LI(n.base_,n.scope_.immer_.useStrictShallowCopy_))}var vCe=class{constructor(n){this.autoFreeze_=!0,this.useStrictShallowCopy_=!1,this.useStrictIteration_=!1,this.produce=(e,t,r)=>{if(y0(e)&&!y0(t)){const a=t;t=e;const o=this;return function(c=a,...d){return o.produce(c,h=>t.call(this,h,...d))}}y0(t)||jl(6),r!==void 0&&!y0(r)&&jl(7);let s;if(al(e)){const a=i8(this),o=VI(a,e,void 0);let l=!0;try{s=t(o),l=!1}finally{l?MI(a):FI(a)}return a8(a,r),o8(s,a)}else if(!e||!dR(e)){if(s=t(e),s===void 0&&(s=e),s===RY&&(s=void 0),this.autoFreeze_&&hR(s,!0),r){const a=[],o=[];Fm(OI).generateReplacementPatches_(e,s,{patches_:a,inversePatches_:o}),r(a,o)}return s}else jl(1,e)},this.produceWithPatches=(e,t)=>{if(y0(e))return(o,...l)=>this.produceWithPatches(o,c=>e(c,...l));let r,s;return[this.produce(e,t,(o,l)=>{r=o,s=l}),r,s]},iN(n==null?void 0:n.autoFreeze)&&this.setAutoFreeze(n.autoFreeze),iN(n==null?void 0:n.useStrictShallowCopy)&&this.setUseStrictShallowCopy(n.useStrictShallowCopy),iN(n==null?void 0:n.useStrictIteration)&&this.setUseStrictIteration(n.useStrictIteration)}createDraft(n){al(n)||jl(8),Yd(n)&&(n=Xo(n));const e=i8(this),t=VI(e,n,void 0);
4658return t[ti].isManual_=!0,FI(e),t}finishDraft(n,e){const t=n&&n[ti];(!t||!t.isManual_)&&jl(9);const{scope_:r}=t;return a8(r,e),o8(void 0,r)}setAutoFreeze(n){this.autoFreeze_=n}setUseStrictShallowCopy(n){this.useStrictShallowCopy_=n}setUseStrictIteration(n){this.useStrictIteration_=n}shouldUseStrictIteration(){return this.useStrictIteration_}applyPatches(n,e){let t;for(t=e.length-1;t>=0;t--){const s=e[t];if(s.path.length===0&&s.op==="replace"){n=s.value;break}}t>-1&&(e=e.slice(t+1));const r=Fm(OI).applyPatches_;return Yd(n)?r(n,e):this.produce(n,s=>r(s,e))}};function VI(n,e,t,r){const[s,a]=TS(e)?Fm(IE).proxyMap_(e,t):AS(e)?Fm(IE).proxySet_(e,t):xCe(e,t);return((t==null?void 0:t.scope_)??OY()).drafts_.push(s),a.callbacks_=(t==null?void 0:t.callbacks_)??[],a.key_=r,t&&r!==void 0?pCe(t,a,r):a.callbacks_.push(function(c){var h;(h=c.mapSetPlugin_)==null||h.fixSetContents(a);const{patchPlugin_:d}=c;a.modified_&&d&&d.generatePatches_(a,[],c)}),s}function Xo(n){return Yd(n)||jl(10,n),GY(n)}function GY(n){if(!al(n)||kS(n))return n;const e=n[ti];let t,r=!0;if(e){if(!e.modified_)return e.base_;e.finalized_=!0,t=LI(n,e.scope_.immer_.useStrictShallowCopy_),r=e.scope_.immer_.shouldUseStrictIteration()}else t=LI(n,!0);return ES(t,(s,a)=>{_E(t,s,GY(a))},r),e&&(e.finalized_=!1),t}var lN=globalThis.Iterator;lN==null||lN.from;var BCe=new vCe,$Y=BCe.produce,kn=n=>n;function HY(n){return({dispatch:t,getState:r})=>s=>a=>typeof a=="function"?a(t,r,n):s(a)}var wCe=HY(),CCe=HY,ECe=typeof window<"u"&&window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__?window.__REDUX_DEVTOOLS_EXTENSION_COMPOSE__:function(){if(arguments.length!==0)return typeof arguments[0]=="object"?AE:AE.apply(null,arguments)};function No(n,e){function t(...r){if(e){let s=e(...r);if(!s)throw new Error(So(0));return{type:n,payload:s.payload,..."meta"in s&&{meta:s.meta},..."error"in s&&{error:s.error}}}return{type:n,payload:r[0]}}return t.toString=()=>`${n}`,t.type=n,t.match=r=>jY(r)&&r.type===n,t}var zY=class Tb extends Array{constructor(...e){super(...e),Object.setPrototypeOf(this,Tb.prototype)}static get[Symbol.species](){return Tb}concat(...e){return super.concat.apply(this,e)}prepend(...e){return e.length===1&&Array.isArray(e[0])?new Tb(...e[0].concat(this)):new Tb(...e.concat(this))}};function c8(n){return al(n)?$Y(n,()=>{}):n}function vw(n,e,t){return n.has(e)?n.get(e):n.set(e,t(e)).get(e)}function SCe(n){return typeof n=="boolean"}var TCe=()=>function(e){const{thunk:t=!0,immutableCheck:r=!0,serializableCheck:s=!0,actionCreatorCheck:a=!0}=e??{};let o=new zY;return t&&(SCe(t)?o.push(wCe):o.push(CCe(t.extraArgument))),o},qY="RTK_autoBatch",jr=()=>n=>({payload:n,meta:{[qY]:!0}}),d8=n=>e=>{setTimeout(e,n)},ACe=(n,e)=>t=>{let r=!1;const s=()=>{r||(r=!0,cancelAnimationFrame(a),clearTimeout(o),t())},a=n(s),o=setTimeout(s,e)},KY=(n={type:"raf"})=>e=>(...t)=>{const r=e(...t);let s=!0,a=!1,o=!1;const l=new Set,c=n.type==="tick"?queueMicrotask:n.type==="raf"?typeof window<"u"&&window.requestAnimationFrame?ACe(window.requestAnimationFrame,100):d8(10):n.type==="callback"?n.queueNotification:d8(n.timeout),d=()=>{o=!1,a&&(a=!1,l.forEach(h=>h()))};return Object.assign({},r,{subscribe(h){const m=()=>s&&h(),p=r.subscribe(m);return l.add(h),()=>{p(),l.delete(h)}},dispatch(h){var m;try{return s=!((m=h==null?void 0:h.meta)!=null&&m[qY]),a=!s,a&&(o||(o=!0,c(d))),r.dispatch(h)}finally{s=!0}}})},kCe=n=>function(t){const{autoBatch:r=!0}=t??{};let s=new zY(n);return r&&s.push(KY(typeof r=="object"?r:void 0)),s};function NCe(n){const e=TCe(),{reducer:t=void 0,middleware:r,devTools:s=!0,preloadedState:a=void 0,enhancers:o=void 0}=n||{};let l;if(typeof t=="function")l=t;else if(cR(t))l=DY(t);else throw new Error(So(1));let c;typeof r=="function"?c=r(e):c=e();let d=AE;s&&(d=ECe({trace:!1,...typeof s=="object"&&s}));const h=iCe(...c),m=kCe(h);let p=typeof o=="function"?o(m):m();const x=d(...p);return IY(l,a,x)}function WY(n){const e={},t=[];let r;const s={addCase(a,o){const l=typeof a=="string"?a:a.type;if(!l)throw new Error(So(28));if(l in e)throw new Error(So(29));return e[l]=o,s},addAsyncThunk(a,o){return o.pending&&(e[a.pending.type]=o.pending),o.rejected&&(e[a.rejected.type]=o.rejected),o.fulfilled&&(e[a.fulfilled.type]=o.fulfilled),o.settled&&t.push({matcher:a.settled,reducer:o.settled}),s},addMatcher(a,o){return t.push({matcher:a,reducer:o}),s},addDefaultCase(a){return r=a,s}};return n(s),[e,t,r]}function _Ce(n){return typeof n=="function"}function ICe(n,e){let[t,r,s]=WY(e),a;if(_Ce(n))a=()=>c8(n());else{const l=c8(n);a=()=>l}function o(l=a(),c){let d=[t[c.type],...r.filter(({matcher:h})=>h(c)).map(({reducer:h})=>h)];return d.filter(h=>
4658!!h).length===0&&(d=[s]),d.reduce((h,m)=>{if(m)if(Yd(h)){const x=m(h,c);return x===void 0?h:x}else{if(al(h))return $Y(h,p=>m(p,c));{const p=m(h,c);if(p===void 0){if(h===null)return h;throw Error("A case reducer on a non-draftable value must not return undefined")}return p}}return h},l)}return o.getInitialState=a,o}var DCe="ModuleSymbhasOwnPr-0123456789ABCDEFGHNRVfgctiUvz_KqYTJkLxpZXIjQW",jCe=(n=21)=>{let e="",t=n;for(;t--;)e+=DCe[Math.random()*64|0];return e},RCe=Symbol.for("rtk-slice-createasyncthunk");function PCe(n,e){return`${n}/${e}`}function LCe({creators:n}={}){var t;const e=(t=n==null?void 0:n.asyncThunk)==null?void 0:t[RCe];return function(s){const{name:a,reducerPath:o=a}=s;if(!a)throw new Error(So(11));const l=(typeof s.reducers=="function"?s.reducers(MCe()):s.reducers)||{},c=Object.keys(l),d={sliceCaseReducersByName:{},sliceCaseReducersByType:{},actionCreators:{},sliceMatchers:[]},h={addCase(k,P){const R=typeof k=="string"?k:k.type;if(!R)throw new Error(So(12));if(R in d.sliceCaseReducersByType)throw new Error(So(13));return d.sliceCaseReducersByType[R]=P,h},addMatcher(k,P){return d.sliceMatchers.push({matcher:k,reducer:P}),h},exposeAction(k,P){return d.actionCreators[k]=P,h},exposeCaseReducer(k,P){return d.sliceCaseReducersByName[k]=P,h}};c.forEach(k=>{const P=l[k],R={reducerName:k,type:PCe(a,k),createNotation:typeof s.reducers=="function"};UCe(P)?GCe(R,P,h,e):FCe(R,P,h)});function m(){const[k={},P=[],R=void 0]=typeof s.extraReducers=="function"?WY(s.extraReducers):[s.extraReducers],_={...k,...d.sliceCaseReducersByType};return ICe(s.initialState,I=>{for(let D in _)I.addCase(D,_[D]);for(let D of d.sliceMatchers)I.addMatcher(D.matcher,D.reducer);for(let D of P)I.addMatcher(D.matcher,D.reducer);R&&I.addDefaultCase(R)})}const p=k=>k,x=new Map,y=new WeakMap;let v;function B(k,P){return v||(v=m()),v(k,P)}function E(){return v||(v=m()),v.getInitialState()}function N(k,P=!1){function R(I){let D=I[k];return typeof D>"u"&&P&&(D=vw(y,R,E)),D}function _(I=p){const D=vw(x,P,()=>new WeakMap);return vw(D,I,()=>{const j={};for(const[O,M]of Object.entries(s.selectors??{}))j[O]=OCe(M,I,()=>vw(y,I,E),P);return j})}return{reducerPath:k,getSelectors:_,get selectors(){return _(R)},selectSlice:R}}const T={name:a,reducer:B,actions:d.actionCreators,caseReducers:d.sliceCaseReducersByName,getInitialState:E,...N(o),injectInto(k,{reducerPath:P,...R}={}){const _=P??o;return k.inject({reducerPath:_,reducer:B},R),{...T,...N(_,!0)}}};return T}}function OCe(n,e,t,r){function s(a,...o){let l=e(a);return typeof l>"u"&&r&&(l=t()),n(l,...o)}return s.unwrapped=n,s}var ri=LCe();function MCe(){function n(e,t){return{_reducerDefinitionType:"asyncThunk",payloadCreator:e,...t}}return n.withTypes=()=>n,{reducer(e){return Object.assign({[e.name](...t){return e(...t)}}[e.name],{_reducerDefinitionType:"reducer"})},preparedReducer(e,t){return{_reducerDefinitionType:"reducerWithPrepare",prepare:e,reducer:t}},asyncThunk:n}}function FCe({type:n,reducerName:e,createNotation:t},r,s){let a,o;if("reducer"in r){if(t&&!VCe(r))throw new Error(So(17));a=r.reducer,o=r.prepare}else a=r;s.addCase(n,a).exposeCaseReducer(e,a).exposeAction(e,o?No(n,o):No(n))}function UCe(n){return n._reducerDefinitionType==="asyncThunk"}function VCe(n){return n._reducerDefinitionType==="reducerWithPrepare"}function GCe({type:n,reducerName:e},t,r,s){if(!s)throw new Error(So(18));const{payloadCreator:a,fulfilled:o,pending:l,rejected:c,settled:d,options:h}=t,m=s(n,a,h);r.exposeAction(e,m),o&&r.addCase(m.fulfilled,o),l&&r.addCase(m.pending,l),c&&r.addCase(m.rejected,c),d&&r.addMatcher(m.settled,d),r.exposeCaseReducer(e,{fulfilled:o||Bw,pending:l||Bw,rejected:c||Bw,settled:d||Bw})}function Bw(){}var $Ce="task",YY="listener",QY="completed",fR="cancelled",HCe=`task-${fR}`,zCe=`task-${QY}`,GI=`${YY}-${fR}`,qCe=`${YY}-${QY}`,_S=class{constructor(n){Ye(this,"code");Ye(this,"name","TaskAbortError");Ye(this,"message");this.code=n,this.message=`${$Ce} ${fR} (reason: ${n})`}},mR=(n,e)=>{if(typeof n!="function")throw new TypeError(So(32))},RE=()=>{},JY=(n,e=RE)=>(n.catch(e),n),XY=(n,e)=>(n.addEventListener("abort",e,{once:!0}),()=>n.removeEventListener("abort",e)),pm=n=>{if(n.aborted)throw new _S(n.reason)};function ZY(n,e){let t=RE;return new Promise((r,s)=>{const a=()=>s(new _S(n.reason));if(n.aborted){a();return}t=XY(n,a),e.finally(()=>t()).then(r,s)}).finally(()=>{t=RE})}var KCe=async(n,e)=>{try{return await Promise.resolve(),{status:"ok",value:await n()}}catch(t){return{status:t instanceof _S?"cancelled":"rejected",error:t}}finally{e==null||e()}},PE=n=>e=>JY(ZY(n,e).then(t=>(pm(n),t))),eQ=n=>{const e=PE(n);return t=>e(new Promise(r=>setTimeout(r,t)))},{assign:P0}=Object,u8={},IS="listenerMiddleware",WCe=(n,e)=>{const t=r=>XY(n,()=>r.abort(n.reason));return(r,s)=>{mR(r);const a=new AbortController;t(a);const o=KCe(async()=>{pm(n),pm(a.signal);const l=await r({pause:PE(a.signal),delay:eQ(a.signal),signal:a.signal});return pm(a.signal),l},()=>a.abort(zCe));return s!=null&&s.autoJoin&&e.push(o.catch(RE)),{result:PE(n)(o),cancel(){a.abort(HCe)}}}},YCe=(n,e)=>{const t=async(r,s)=>{pm(e);let a=()=>{};const l=[new Promise((c,d)=>{let h=n({predicate:r,effect:(m,p)=>{p.unsubscribe(),c([m,p.getState(),p.getOriginalState()])}});a=()=>{h(),d()}})];s!=null&&l.push(new Promise(c=>setTimeout(c,s,null)));try{const c=await ZY(e,Promise.race(l));return pm(e),c}finally{a()}};return((r,s)=>JY(t(r,s)))},tQ=n=>{let{type:e,actionCreator:t,matcher:r,predicate:s,effect:a}=n;
4658if(e)s=No(e).match;else if(t)e=t.type,s=t.match;else if(r)s=r;else if(!s)throw new Error(So(21));return mR(a),{predicate:s,type:e,effect:a}},nQ=P0(n=>{const{type:e,predicate:t,effect:r}=tQ(n);return{id:jCe(),effect:r,type:e,predicate:t,pending:new Set,unsubscribe:()=>{throw new Error(So(22))}}},{withTypes:()=>nQ}),h8=(n,e)=>{const{type:t,effect:r,predicate:s}=tQ(e);return Array.from(n.values()).find(a=>(typeof t=="string"?a.type===t:a.predicate===s)&&a.effect===r)},$I=n=>{n.pending.forEach(e=>{e.abort(GI)})},QCe=(n,e)=>()=>{for(const t of e.keys())$I(t);n.clear()},f8=(n,e,t)=>{try{n(e,t)}catch(r){setTimeout(()=>{throw r},0)}},rQ=P0(No(`${IS}/add`),{withTypes:()=>rQ}),JCe=No(`${IS}/removeAll`),sQ=P0(No(`${IS}/remove`),{withTypes:()=>sQ}),XCe=(...n)=>{console.error(`${IS}/error`,...n)},Av=(n={})=>{const e=new Map,t=new Map,r=x=>{const y=t.get(x)??0;t.set(x,y+1)},s=x=>{const y=t.get(x)??1;y===1?t.delete(x):t.set(x,y-1)},{extra:a,onError:o=XCe}=n;mR(o);const l=x=>(x.unsubscribe=()=>e.delete(x.id),e.set(x.id,x),y=>{x.unsubscribe(),y!=null&&y.cancelActive&&$I(x)}),c=(x=>{const y=h8(e,x)??nQ(x);return l(y)});P0(c,{withTypes:()=>c});const d=x=>{const y=h8(e,x);return y&&(y.unsubscribe(),x.cancelActive&&$I(y)),!!y};P0(d,{withTypes:()=>d});const h=async(x,y,v,B)=>{const E=new AbortController,N=YCe(c,E.signal),T=[];try{x.pending.add(E),r(x),await Promise.resolve(x.effect(y,P0({},v,{getOriginalState:B,condition:(k,P)=>N(k,P).then(Boolean),take:N,delay:eQ(E.signal),pause:PE(E.signal),extra:a,signal:E.signal,fork:WCe(E.signal,T),unsubscribe:x.unsubscribe,subscribe:()=>{e.set(x.id,x)},cancelActiveListeners:()=>{x.pending.forEach((k,P,R)=>{k!==E&&(k.abort(GI),R.delete(k))})},cancel:()=>{E.abort(GI),x.pending.delete(E)},throwIfCancelled:()=>{pm(E.signal)}})))}catch(k){k instanceof _S||f8(o,k,{raisedBy:"effect"})}finally{await Promise.all(T),E.abort(qCe),s(x),x.pending.delete(E)}},m=QCe(e,t);return{middleware:x=>y=>v=>{if(!jY(v))return y(v);if(rQ.match(v))return c(v.payload);if(JCe.match(v)){m();return}if(sQ.match(v))return d(v.payload);let B=x.getState();const E=()=>{if(B===u8)throw new Error(So(23));return B};let N;try{if(N=y(v),e.size>0){const T=x.getState(),k=Array.from(e.values());for(const P of k){let R=!1;try{R=P.predicate(v,T,B)}catch(_){R=!1,f8(o,_,{raisedBy:"predicate"})}R&&h(P,v,x,E)}}}finally{B=u8}return N},startListening:c,stopListening:d,clearListeners:m}};function So(n){return`Minified Redux Toolkit error #${n}; visit https://redux-toolkit.js.org/Errors?code=${n} for the full message or use the non-minified dev environment for full errors. `}var ZCe={layoutType:"horizontal",width:0,height:0,margin:{top:5,right:5,bottom:5,left:5},scale:1},aQ=ri({name:"chartLayout",initialState:ZCe,reducers:{setLayout(n,e){n.layoutType=e.payload},setChartSize(n,e){n.width=e.payload.width,n.height=e.payload.height},setMargin(n,e){var t,r,s,a;n.margin.top=(t=e.payload.top)!==null&&t!==void 0?t:0,n.margin.right=(r=e.payload.right)!==null&&r!==void 0?r:0,n.margin.bottom=(s=e.payload.bottom)!==null&&s!==void 0?s:0,n.margin.left=(a=e.payload.left)!==null&&a!==void 0?a:0},setScale(n,e){n.scale=e.payload}}}),DS=aQ.actions,eEe=DS.setMargin,tEe=DS.setLayout,nEe=DS.setChartSize,rEe=DS.setScale,sEe=aQ.reducer;function iQ(n,e,t){return Array.isArray(n)&&n&&e+t!==0?n.slice(e,t+1):n}function nr(n){return Number.isFinite(n)}function Vh(n){return typeof n=="number"&&n>0&&Number.isFinite(n)}function m8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Oi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?m8(Object(t),!0).forEach(function(r){aEe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):m8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function aEe(n,e,t){return(e=iEe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iEe(n){var e=oEe(n,"string");return typeof e=="symbol"?e:e+""}function oEe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Qs(n,e,t){return ei(n)||ei(e)?t:Vc(e)?Sv(n,e,t):typeof e=="function"?e(n):t}var lEe=(n,e,t)=>{if(e&&t){var r=t.width,s=t.height,a=e.align,o=e.verticalAlign,l=e.layout,c=e.position,d=e.offset,h=d===void 0?0:d;if(c!=null){if(hBe(c)){if(c==="top"&&Ot(n.top))return Oi(Oi({},n),{},{top:n.top+(s||0)+h});if(c==="bottom"&&Ot(n.bottom))return Oi(Oi({},n),{},{bottom:n.bottom+(s||0)+h});if(c==="left"&&Ot(n.left))return Oi(Oi({},n),{},{left:n.left+(r||0)+h});if(c==="right"&&Ot(n.right))return Oi(Oi({},n),{}
4658,{right:n.right+(r||0)+h})}return n}if((l==="vertical"||l==="horizontal"&&o==="middle")&&a!=="center"&&Ot(n[a]))return Oi(Oi({},n),{},{[a]:n[a]+(r||0)});if((l==="horizontal"||l==="vertical"&&a==="center")&&o!=="middle"&&Ot(n[o]))return Oi(Oi({},n),{},{[o]:n[o]+(s||0)})}return n},au=(n,e)=>n==="horizontal"&&e==="xAxis"||n==="vertical"&&e==="yAxis"||n==="centric"&&e==="angleAxis"||n==="radial"&&e==="radiusAxis",cEe=n=>{var e,t=n.length;if(!(t<=0)){var r=(e=n[0])===null||e===void 0?void 0:e.length;if(!(r==null||r<=0))for(var s=0;s<r;++s)for(var a=0,o=0,l=0;l<t;++l){var c=n[l],d=c==null?void 0:c[s];if(d!=null){var h=d[1],m=d[0],p=Wd(h)?m:h;p>=0?(d[0]=a,a+=p,d[1]=a):(d[0]=o,o+=p,d[1]=o)}}}},dEe=n=>{var e,t=n.length;if(!(t<=0)){var r=(e=n[0])===null||e===void 0?void 0:e.length;if(!(r==null||r<=0))for(var s=0;s<r;++s)for(var a=0,o=0;o<t;++o){var l=n[o],c=l==null?void 0:l[s];if(c!=null){var d=Wd(c[1])?c[0]:c[1];d>=0?(c[0]=a,a+=d,c[1]=a):(c[0]=0,c[1]=0)}}}},uEe={sign:cEe,expand:DBe,none:Mm,silhouette:jBe,wiggle:RBe,positive:dEe},hEe=(n,e,t)=>{var r,s=(r=uEe[t])!==null&&r!==void 0?r:Mm,a=IBe().keys(e).value((l,c)=>Number(Qs(l,c,0))).order(II).offset(s),o=a(n);return o.forEach((l,c)=>{l.forEach((d,h)=>{var m=Qs(n[h],e[c],0);Array.isArray(m)&&m.length===2&&Ot(m[0])&&Ot(m[1])&&(d[0]=m[0],d[1]=m[1])})}),o},fEe=n=>{var e=n.flat(2).filter(Ot);return[Math.min(...e),Math.max(...e)]},mEe=n=>[n[0]===1/0?0:n[0],n[1]===-1/0?0:n[1]],pEe=(n,e,t)=>{if(!(n==null||Object.keys(n).length===0))return mEe(Object.keys(n).reduce((r,s)=>{var a=n[s];if(!a)return r;var o=a.stackedData,l=o.reduce((c,d)=>{var h=iQ(d,e,t),m=fEe(h);return!nr(m[0])||!nr(m[1])?c:[Math.min(c[0],m[0]),Math.max(c[1],m[1])]},[1/0,-1/0]);return[Math.min(l[0],r[0]),Math.max(l[1],r[1])]},[1/0,-1/0]))},p8=/^dataMin[\s]*-[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,g8=/^dataMax[\s]*\+[\s]*([0-9]+([.]{1}[0-9]+){0,1})$/,LE=(n,e,t)=>{if(n&&n.scale&&n.scale.bandwidth){var r=n.scale.bandwidth();if(!t||r>0)return r}if(n&&e&&e.length>=2){for(var s=wS(e,v=>v.coordinate),a=[],o=0,l=1,c=s.length;l<c;l++){var d,h,m=(((d=s[l])===null||d===void 0?void 0:d.coordinate)||0)-(((h=s[l-1])===null||h===void 0?void 0:h.coordinate)||0);a.push(m),o=Math.max(m,o)}var p=o*1e-4,x=1/0;for(var y of a)y>p&&(x=Math.min(y,x));return x===1/0?0:x}return t?void 0:0};function x8(n){var e=n.tooltipEntrySettings,t=n.dataKey,r=n.payload,s=n.value,a=n.name;return Oi(Oi({},e),{},{dataKey:t,payload:r,value:s,name:a})}function oQ(n,e){if(n!=null)return String(n);if(typeof e=="string")return e}var gEe=(n,e)=>{if(e==="horizontal")return n.relativeX;if(e==="vertical")return n.relativeY},xEe=(n,e)=>e==="centric"?n.angle:n.radius,iu=n=>n.layout.width,ou=n=>n.layout.height,bEe=n=>n.layout.scale,lQ=n=>n.layout.margin,jS=Be(n=>n.cartesianAxis.xAxis,n=>Object.values(n)),RS=Be(n=>n.cartesianAxis.yAxis,n=>Object.values(n)),yEe="data-recharts-item-index",vEe="data-recharts-item-id",kv=60,pR=30;function b8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function ww(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?b8(Object(t),!0).forEach(function(r){BEe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):b8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function BEe(n,e,t){return(e=wEe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function wEe(n){var e=CEe(n,"string");return typeof e=="symbol"?e:e+""}function CEe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var EEe=n=>n.brush.height;function SEe(n){var e=RS(n);return e.reduce((t,r)=>{if(r.orientation==="left"&&!r.mirror&&!r.hide){var s=typeof r.width=="number"?r.width:kv;return t+s}return t},0)}function TEe(n){var e=RS(n);return e.reduce((t,r)=>{if(r.orientation==="right"&&!r.mirror&&!r.hide){var s=typeof r.width=="number"?r.width:kv;return t+s}return t},0)}function AEe(n){var e=jS(n);return e.reduce((t,r)=>{if(r.orientation==="top"&&!r.mirror&&!r.hide){var s=typeof r.height=="number"?r.height:pR;return t+s}return t},0)}function kEe(n){var e=jS(n);return e.reduce((t,r)=>{if(r.orientation==="bottom"&&!r.mirror&&!r.hide){var s=typeof r.height=="number"?r.height:pR;return t+s}return t},0)}var Ma=Be([iu,ou,lQ,EEe,SEe,TEe,AEe,kEe,_Y,Ywe],(n,e,t,r,s,a,o,l,c,d)=>{var h={left:(t.left||0)+s,right:(t.right||0)+a},m={top:(t.top||0)+o,bottom:(t.bottom||0)+l},p=ww(ww({},m),h),x=p.bottom;p.bottom+=r,p=lEe(p,c,d);var y=n-p.left-p.right,v=e-p.top-p.bottom;return ww(ww({brushBottom:x},p),{},{width:Math.max(y,0),height:Math.max(v,0)})}),NEe=Be(Ma,n=>({x:n.left,y:n.top,width:n.width,height:n.height}));Be(iu,ou,(n,e)=>({x:0,y:0,width:n,height:e}));var _Ee=S.createContext(null),Kc=()=>S.useContext(_Ee)!=null,PS=n=>
4658n.brush,LS=Be([PS,Ma,lQ],(n,e,t)=>({height:n.height,x:Ot(n.x)?n.x:e.left,y:Ot(n.y)?n.y:e.top+e.height+e.brushBottom-((t==null?void 0:t.bottom)||0),width:Ot(n.width)?n.width:e.width}));function IEe(n,e,{signal:t,edges:r}={}){let s,a=null;const o=r!=null&&r.includes("leading"),l=r==null||r.includes("trailing"),c=()=>{a!==null&&(n.apply(s,a),s=void 0,a=null)},d=()=>{l&&c(),x()};let h=null;const m=()=>{h!=null&&clearTimeout(h),h=setTimeout(()=>{h=null,d()},e)},p=()=>{h!==null&&(clearTimeout(h),h=null)},x=()=>{p(),s=void 0,a=null},y=()=>{c()},v=function(...B){if(t!=null&&t.aborted)return;s=this,a=B;const E=h==null;m(),o&&E&&c()};return v.schedule=m,v.cancel=x,v.flush=y,t==null||t.addEventListener("abort",x,{once:!0}),v}function DEe(n,e=0,t={}){typeof t!="object"&&(t={});const{leading:r=!1,trailing:s=!0,maxWait:a}=t,o=Array(2);r&&(o[0]="leading"),s&&(o[1]="trailing");let l,c=null;const d=IEe(function(...p){l=n.apply(this,p),c=null},e,{edges:o}),h=function(...p){return a!=null&&(c===null&&(c=Date.now()),Date.now()-c>=a)?((r||s)&&(l=n.apply(this,p)),c=Date.now(),d.cancel(),d.schedule(),l):(d.apply(this,p),l)},m=()=>(d.flush(),l);return h.cancel=d.cancel,h.flush=m,h}function jEe(n,e=0,t={}){const{leading:r=!0,trailing:s=!0}=t;return DEe(n,e,{leading:r,maxWait:e,trailing:s})}var y8=function(e,t){for(var r=arguments.length,s=new Array(r>2?r-2:0),a=2;a<r;a++)s[a-2]=arguments[a];if(typeof console<"u"&&console.warn&&(t===void 0&&console.warn("LogUtils requires an error message argument"),!e))if(t===void 0)console.warn("Minified exception occurred; use the non-minified dev environment for the full error message and additional helpful warnings.");else{var o=0;console.warn(t.replace(/%s/g,()=>s[o++]))}},Sc={width:"100%",height:"100%",debounce:0,minWidth:0,initialDimension:{width:-1,height:-1}},cQ=(n,e,t)=>{var r=t.width,s=r===void 0?Sc.width:r,a=t.height,o=a===void 0?Sc.height:a,l=t.aspect,c=t.maxHeight,d=Om(s)?n:Number(s),h=Om(o)?e:Number(o);return l&&l>0&&(d?h=d/l:h&&(d=h*l),c&&h!=null&&h>c&&(h=c)),{calculatedWidth:d,calculatedHeight:h}},REe={width:0,height:0,overflow:"visible"},PEe={width:0,overflowX:"visible"},LEe={height:0,overflowY:"visible"},OEe={},MEe=n=>{var e=n.width,t=n.height,r=Om(e),s=Om(t);return r&&s?REe:r?PEe:s?LEe:OEe};function FEe(n){var e=n.width,t=n.height,r=n.aspect,s=e,a=t;return s===void 0&&a===void 0?(s=Sc.width,a=Sc.height):s===void 0?s=r&&r>0?void 0:Sc.width:a===void 0&&(a=r&&r>0?void 0:Sc.height),{width:s,height:a}}var UEe=["aspect","initialDimension","width","height","minWidth","minHeight","maxHeight","children","debounce","id","className","onResize","style"];function OE(){return OE=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},OE.apply(null,arguments)}function v8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function B8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?v8(Object(t),!0).forEach(function(r){VEe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):v8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function VEe(n,e,t){return(e=GEe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function GEe(n){var e=$Ee(n,"string");return typeof e=="symbol"?e:e+""}function $Ee(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function HEe(n,e){return WEe(n)||KEe(n,e)||qEe(n,e)||zEe()}function zEe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4659In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function qEe(n,e){if(n){if(typeof n=="string")return w8(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?w8(n,e):void 0}}function w8(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function KEe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}
4659finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function WEe(n){if(Array.isArray(n))return n}function YEe(n,e){if(n==null)return{};var t,r,s=QEe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function QEe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var dQ=S.createContext(Sc.initialDimension);function JEe(n){return Vh(n.width)&&Vh(n.height)}function uQ(n){var e=n.children,t=n.width,r=n.height,s=S.useMemo(()=>({width:t,height:r}),[t,r]);return JEe(s)?S.createElement(dQ.Provider,{value:s},e):null}var gR=()=>S.useContext(dQ),XEe=S.forwardRef((n,e)=>{var t=n.aspect,r=n.initialDimension,s=r===void 0?Sc.initialDimension:r,a=n.width,o=n.height,l=n.minWidth,c=l===void 0?Sc.minWidth:l,d=n.minHeight,h=n.maxHeight,m=n.children,p=n.debounce,x=p===void 0?Sc.debounce:p,y=n.id,v=n.className,B=n.onResize,E=n.style,N=E===void 0?{}:E,T=YEe(n,UEe),k=S.useRef(null),P=S.useRef();P.current=B,S.useImperativeHandle(e,()=>k.current);var R=S.useState({containerWidth:s.width,containerHeight:s.height}),_=HEe(R,2),I=_[0],D=_[1],j=S.useCallback((G,Z)=>{D(z=>{var se=Math.round(G),re=Math.round(Z);return z.containerWidth===se&&z.containerHeight===re?z:{containerWidth:se,containerHeight:re}})},[]);S.useEffect(()=>{if(k.current==null||typeof ResizeObserver>"u")return Zm;var G=H=>{var Y,de=H[0];if(de!=null){var W=de.contentRect,K=W.width,J=W.height;j(K,J),(Y=P.current)===null||Y===void 0||Y.call(P,K,J)}};x>0&&(G=jEe(G,x,{trailing:!0,leading:!1}));var Z=new ResizeObserver(G),z=k.current.getBoundingClientRect(),se=z.width,re=z.height;return j(se,re),Z.observe(k.current),()=>{Z.disconnect()}},[j,x]);var O=I.containerWidth,M=I.containerHeight;y8(!t||t>0,"The aspect(%s) must be greater than zero.",t);var U=cQ(O,M,{width:a,height:o,aspect:t,maxHeight:h}),ee=U.calculatedWidth,ie=U.calculatedHeight;return y8(O<0||M<0||ee!=null&&ee>0||ie!=null&&ie>0,`The width(%s) and height(%s) of chart should be greater than 0,
4660       please check the style of container, or the props width(%s) and height(%s),
4661       or add a minWidth(%s) or minHeight(%s) or use aspect(%s) to control the
4662       height and width.`,ee,ie,a,o,c,d,t),S.createElement("div",OE({id:y?"".concat(y):void 0,className:Lr("recharts-responsive-container",v),style:B8(B8({},N),{},{width:a,height:o,minWidth:c,minHeight:d,maxHeight:h}),ref:k},T),S.createElement("div",{style:MEe({width:a,height:o})},S.createElement(uQ,{width:ee,height:ie},m)))}),Nv=S.forwardRef((n,e)=>{var t=gR();if(Vh(t.width)&&Vh(t.height))return n.children;var r=FEe({width:n.width,height:n.height,aspect:n.aspect}),s=r.width,a=r.height,o=cQ(void 0,void 0,{width:s,height:a,aspect:n.aspect,maxHeight:n.maxHeight}),l=o.calculatedWidth,c=o.calculatedHeight;return Ot(l)&&Ot(c)?S.createElement(uQ,{width:l,height:c},n.children):S.createElement(XEe,OE({},n,{width:s,height:a,ref:e}))}),OS=()=>{var n,e=Kc(),t=Dt(NEe),r=Dt(LS),s=(n=Dt(PS))===null||n===void 0?void 0:n.padding;return!e||!r||!s?t:{width:r.width-s.left-s.right,height:r.height-s.top-s.bottom,x:s.left,y:s.top}},ZEe={top:0,bottom:0,left:0,right:0,width:0,height:0,brushBottom:0},e1e=()=>{var n;return(n=Dt(Ma))!==null&&n!==void 0?n:ZEe},t1e=()=>Dt(iu),n1e=()=>Dt(ou),ir=n=>n.layout.layoutType,MS=()=>Dt(ir),xR=n=>{var e=n.layout.layoutType;if(e==="centric"||e==="radial")return e},bR=()=>Dt(xR),r1e=()=>{var n=MS();return n!==void 0},_v=n=>{var e=ta(),t=Kc(),r=n.width,s=n.height,a=gR(),o=r,l=s;return a&&(o=a.width>0?a.width:r,l=a.height>0?a.height:s),S.useEffect(()=>{!t&&Vh(o)&&Vh(l)&&e(nEe({width:o,height:l}))},[e,t,o,l]),null},s1e={settings:{layout:"horizontal",align:"center",verticalAlign:"bottom",itemSorter:"value",position:void 0,offset:0},size:{width:0,height:0},payload:[]},hQ=ri({name:"legend",initialState:s1e,reducers:{setLegendSize(n,e){n.size.width=e.payload.width,n.size.height=e.payload.height}
4662,setLegendSettings(n,e){n.settings.align=e.payload.align,n.settings.layout=e.payload.layout,n.settings.verticalAlign=e.payload.verticalAlign,n.settings.itemSorter=e.payload.itemSorter,n.settings.position=e.payload.position,n.settings.offset=e.payload.offset},addLegendPayload:{reducer(n,e){n.payload.push(kn(e.payload))},prepare:jr()},replaceLegendPayload:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next,a=Xo(n).payload.indexOf(kn(r));a>-1&&(n.payload[a]=kn(s))},prepare:jr()},removeLegendPayload:{reducer(n,e){var t=Xo(n).payload.indexOf(kn(e.payload));t>-1&&n.payload.splice(t,1)},prepare:jr()}}}),Iv=hQ.actions;Iv.setLegendSize;Iv.setLegendSettings;var a1e=Iv.addLegendPayload,i1e=Iv.replaceLegendPayload,o1e=Iv.removeLegendPayload,l1e=hQ.reducer,cN={exports:{}},dN={};/**
4663 * @license React
4664 * use-sync-external-store-with-selector.production.js
4665 *
4666 * Copyright (c) Meta Platforms, Inc. and affiliates.
4667 *
4668 * This source code is licensed under the MIT license found in the
4669 * LICENSE file in the root directory of this source tree.
4670 */var C8;function c1e(){if(C8)return dN;C8=1;var n=kg();function e(c,d){return c===d&&(c!==0||1/c===1/d)||c!==c&&d!==d}var t=typeof Object.is=="function"?Object.is:e,r=n.useSyncExternalStore,s=n.useRef,a=n.useEffect,o=n.useMemo,l=n.useDebugValue;return dN.useSyncExternalStoreWithSelector=function(c,d,h,m,p){var x=s(null);if(x.current===null){var y={hasValue:!1,value:null};x.current=y}else y=x.current;x=o(function(){function B(P){if(!E){if(E=!0,N=P,P=m(P),p!==void 0&&y.hasValue){var R=y.value;if(p(R,P))return T=R}return T=P}if(R=T,t(N,P))return R;var _=m(P);return p!==void 0&&p(R,_)?(N=P,R):(N=P,T=_)}var E=!1,N,T,k=h===void 0?null:h;return[function(){return B(d())},k===null?void 0:function(){return B(k())}]},[d,h,m,p]);var v=r(c,x[0],x[1]);return a(function(){y.hasValue=!0,y.value=v},[v]),l(v),v},dN}var E8;function d1e(){return E8||(E8=1,cN.exports=c1e()),cN.exports}d1e();function u1e(n){n()}function h1e(){let n=null,e=null;return{clear(){n=null,e=null},notify(){u1e(()=>{let t=n;for(;t;)t.callback(),t=t.next})},get(){const t=[];let r=n;for(;r;)t.push(r),r=r.next;return t},subscribe(t){let r=!0;const s=e={callback:t,next:null,prev:e};return s.prev?s.prev.next=s:n=s,function(){!r||n===null||(r=!1,s.next?s.next.prev=s.prev:e=s.prev,s.prev?s.prev.next=s.next:n=s.next)}}}}var S8={notify(){},get:()=>[]};function f1e(n,e){let t,r=S8,s=0,a=!1;function o(v){h();const B=r.subscribe(v);let E=!1;return()=>{E||(E=!0,B(),m())}}function l(){r.notify()}function c(){y.onStateChange&&y.onStateChange()}function d(){return a}function h(){s++,t||(t=n.subscribe(c),r=h1e())}function m(){s--,t&&s===0&&(t(),t=void 0,r.clear(),r=S8)}function p(){a||(a=!0,h())}function x(){a&&(a=!1,m())}const y={addNestedSub:o,notifyNestedSubs:l,handleChangeWrapper:c,isSubscribed:d,trySubscribe:p,tryUnsubscribe:x,getListeners:()=>r};return y}var m1e=()=>typeof window<"u"&&typeof window.document<"u"&&typeof window.document.createElement<"u",p1e=m1e(),g1e=()=>typeof navigator<"u"&&navigator.product==="ReactNative",x1e=g1e(),b1e=()=>p1e||x1e?S.useLayoutEffect:S.useEffect,y1e=b1e();function T8(n,e){return n===e?n!==0||e!==0||1/n===1/e:n!==n&&e!==e}function v1e(n,e){if(T8(n,e))return!0;if(typeof n!="object"||n===null||typeof e!="object"||e===null)return!1;const t=Object.keys(n),r=Object.keys(e);if(t.length!==r.length)return!1;for(let s=0;s<t.length;s++)if(!Object.prototype.hasOwnProperty.call(e,t[s])||!T8(n[t[s]],e[t[s]]))return!1;return!0}var uN=Symbol.for("react-redux-context"),hN=typeof globalThis<"u"?globalThis:{};
4670function B1e(){if(!S.createContext)return{};const n=hN[uN]??(hN[uN]=new Map);let e=n.get(S.createContext);return e||(e=S.createContext(null),n.set(S.createContext,e)),e}var w1e=B1e();function C1e(n){const{children:e,context:t,serverState:r,store:s}=n,a=S.useMemo(()=>{const c=f1e(s);return{store:s,subscription:c,getServerState:r?()=>r:void 0}},[s,r]),o=S.useMemo(()=>s.getState(),[s]);y1e(()=>{const{subscription:c}=a;return c.onStateChange=c.notifyNestedSubs,c.trySubscribe(),o!==s.getState()&&c.notifyNestedSubs(),()=>{c.tryUnsubscribe(),c.onStateChange=void 0}},[a,o]);const l=t||w1e;return S.createElement(l.Provider,{value:a},e)}var E1e=C1e,S1e=new Set(["axisLine","tickLine","activeBar","activeDot","activeLabel","activeShape","allowEscapeViewBox","background","cursor","dot","label","line","margin","padding","position","shape","style","tick","wrapperStyle","radius","throttledEvents"]);function T1e(n,e){return n==null&&e==null?!0:typeof n=="number"&&typeof e=="number"?n===e||n!==n&&e!==e:n===e}function fQ(n,e){var t=new Set([...Object.keys(n),...Object.keys(e)]);for(var r of t)if(S1e.has(r)){if(n[r]==null&&e[r]==null)continue;if(!v1e(n[r],e[r]))return!1}else if(!T1e(n[r],e[r]))return!1;return!0}function HI(){return HI=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},HI.apply(null,arguments)}function A8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function sb(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?A8(Object(t),!0).forEach(function(r){A1e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):A8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function A1e(n,e,t){return(e=k1e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function k1e(n){var e=N1e(n,"string");return typeof e=="symbol"?e:e+""}function N1e(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function _1e(n,e){return R1e(n)||j1e(n,e)||D1e(n,e)||I1e()}function I1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4671In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function D1e(n,e){if(n){if(typeof n=="string")return k8(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?k8(n,e):void 0}}function k8(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function j1e(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function R1e(n){if(Array.isArray(n))return n}function P1e(n){return Array.isArray(n)&&Vc(n[0])&&Vc(n[1])?n.join(" ~ "):n}var zp={separator:" : ",contentStyle:{margin:0,padding:10,backgroundColor:"#fff",border:"1px solid #ccc",whiteSpace:"nowrap"},itemStyle:{display:"block",paddingTop:4,paddingBottom:4,color:"#000"},labelStyle:{},accessibilityLayer:!1};function L1e(n,e){return e==null?n:wS(n,e)}var O1e=n=>{var e=n.separator,t=e===void 0?zp.separator:e,r=n.contentStyle,s=n.itemStyle,a=n.labelStyle,o=a===void 0?zp.labelStyle:a,l=n.payload,c=n.formatter,d=n.itemSorter,h=n.wrapperClassName,m=n.labelClassName,p=n.label,x=n.labelFormatter,y=n.accessibilityLayer,v=y===void 0?zp.accessibilityLayer:y,B=()=>
4671{if(l&&l.length){var I={padding:0,margin:0},D=L1e(l,d),j=D.map((O,M)=>{if(!O||O.type==="none")return null;var U=O.formatter||c||P1e,ee=O.value,ie=O.name,G=ee,Z=ie;if(U){var z=U(ee,ie,O,M,l);if(Array.isArray(z)){var se=_1e(z,2);G=se[0],Z=se[1]}else if(z!=null)G=z;else return null}var re=sb(sb({},zp.itemStyle),{},{color:O.color||zp.itemStyle.color},s);return S.createElement("li",{className:"recharts-tooltip-item",key:"tooltip-item-".concat(M),style:re},Vc(Z)?S.createElement("span",{className:"recharts-tooltip-item-name"},Z):null,Vc(Z)?S.createElement("span",{className:"recharts-tooltip-item-separator"},t):null,S.createElement("span",{className:"recharts-tooltip-item-value"},G),S.createElement("span",{className:"recharts-tooltip-item-unit"},O.unit||""))});return S.createElement("ul",{className:"recharts-tooltip-item-list",style:I},j)}return null},E=sb(sb({},zp.contentStyle),r),N=sb({margin:0},o),T=!ei(p),k=T?p:"",P=Lr("recharts-default-tooltip",h),R=Lr("recharts-tooltip-label",m);T&&x&&l!==void 0&&l!==null&&(k=x(p,l));var _=v?{role:"status","aria-live":"assertive"}:{};return S.createElement("div",HI({className:P,style:E},_),S.createElement("p",{className:R,style:N},S.isValidElement(k)?k:"".concat(k)),B())},ab="recharts-tooltip-wrapper",M1e={visibility:"hidden"};function F1e(n){var e=n.coordinate,t=n.translateX,r=n.translateY;return Lr(ab,{["".concat(ab,"-right")]:Ot(t)&&e&&Ot(e.x)&&t>=e.x,["".concat(ab,"-left")]:Ot(t)&&e&&Ot(e.x)&&t<e.x,["".concat(ab,"-bottom")]:Ot(r)&&e&&Ot(e.y)&&r>=e.y,["".concat(ab,"-top")]:Ot(r)&&e&&Ot(e.y)&&r<e.y})}function N8(n){var e=n.allowEscapeViewBox,t=n.coordinate,r=n.key,s=n.offset,a=n.position,o=n.reverseDirection,l=n.tooltipDimension,c=n.viewBox,d=n.viewBoxDimension;if(a&&Ot(a[r]))return a[r];var h=t[r]-l-(s>0?s:0),m=t[r]+s;if(e[r])return o[r]?h:m;var p=c[r];if(p==null)return 0;if(o[r]){var x=h,y=p;return x<y?Math.max(m,p):Math.max(h,p)}if(d==null)return 0;var v=m+l,B=p+d;return v>B?Math.max(h,p):Math.max(m,p)}function U1e(n){var e=n.translateX,t=n.translateY,r=n.useTranslate3d;return{transform:r?"translate3d(".concat(e,"px, ").concat(t,"px, 0)"):"translate(".concat(e,"px, ").concat(t,"px)")}}function V1e(n){var e=n.allowEscapeViewBox,t=n.coordinate,r=n.offsetTop,s=n.offsetLeft,a=n.position,o=n.reverseDirection,l=n.tooltipBox,c=n.useTranslate3d,d=n.viewBox,h,m,p;return l&&l.height>0&&l.width>0&&t?(m=N8({allowEscapeViewBox:e,coordinate:t,key:"x",offset:s,position:a,reverseDirection:o,tooltipDimension:l.width,viewBox:d,viewBoxDimension:d.width}),p=N8({allowEscapeViewBox:e,coordinate:t,key:"y",offset:r,position:a,reverseDirection:o,tooltipDimension:l.height,viewBox:d,viewBoxDimension:d.height}),h=U1e({translateX:m,translateY:p,useTranslate3d:c}
4671)):h=M1e,{cssProperties:h,cssClasses:F1e({translateX:m,translateY:p,coordinate:t})}}var G1e=()=>!(typeof window<"u"&&window.document&&window.document.createElement&&window.setTimeout),FS={isSsr:G1e()};function $1e(n,e){return K1e(n)||q1e(n,e)||z1e(n,e)||H1e()}function H1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4672In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function z1e(n,e){if(n){if(typeof n=="string")return _8(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_8(n,e):void 0}}function _8(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function q1e(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function K1e(n){if(Array.isArray(n))return n}function mQ(){var n=S.useState(()=>FS.isSsr||!window.matchMedia?!1:window.matchMedia("(prefers-reduced-motion: reduce)").matches),e=$1e(n,2),t=e[0],r=e[1];return S.useEffect(()=>{if(window.matchMedia){var s=window.matchMedia("(prefers-reduced-motion: reduce)"),a=()=>{r(s.matches)};return s.addEventListener("change",a),()=>{s.removeEventListener("change",a)}}},[]),t}function I8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function qp(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?I8(Object(t),!0).forEach(function(r){W1e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):I8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function W1e(n,e,t){return(e=Y1e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function Y1e(n){var e=Q1e(n,"string");return typeof e=="symbol"?e:e+""}function Q1e(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function J1e(n,e){return tSe(n)||eSe(n,e)||Z1e(n,e)||X1e()}function X1e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4673In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Z1e(n,e){if(n){if(typeof n=="string")return D8(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?D8(n,e):void 0}}function D8(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function eSe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function tSe(n){if(Array.isArray(n))return n}function nSe(n){if(!(n.prefersReducedMotion&&n.isAnimationActive==="auto")&&n.isAnimationActive&&n.active){var e=typeof n.animationEasing=="string"?n.animationEasing:"ease";return"transform ".concat(n.animationDuration,"ms ").concat(e)}}function rSe(n){var e,t,r,s,a,o,l=mQ(),c=S.useState(()=>({dismissed:!1,dismissedAtCoordinate:{x:0,y:0}})),d=J1e(c,2),h=d[0],m=d[1];S.useEffect(()=>{var E=N=>{if(N.key==="Escape"){var T,k,P,R;m({dismissed:!0,dismissedAtCoordinate:{x:(T=(k=n.coordinate)===null||k===void 0?void 0:k.x)!==null&&T!==void 0?T:0,y:(P=(R=n.coordinate)===null||R===void 0?void 0:R.y)!==null&&P!==void 0?P:0}})}};return document.addEventListener("keydown",E),()=>{document.removeEventListener("keydown",E)}},[(e=n.coordinate)===null||e===void 0?void 0:e.x,(t=n.coordinate)===null||t===void 0?void 0:t.y]),h.dismissed&&(((r=(s=n.coordinate)===null||s===void 0?void 0:s.x)!==null&&r!==void 0?r:0)!==h.dism
4673issedAtCoordinate.x||((a=(o=n.coordinate)===null||o===void 0?void 0:o.y)!==null&&a!==void 0?a:0)!==h.dismissedAtCoordinate.y)&&m(qp(qp({},h),{},{dismissed:!1}));var p=V1e({allowEscapeViewBox:n.allowEscapeViewBox,coordinate:n.coordinate,offsetLeft:typeof n.offset=="number"?n.offset:n.offset.x,offsetTop:typeof n.offset=="number"?n.offset:n.offset.y,position:n.position,reverseDirection:n.reverseDirection,tooltipBox:n.lastBoundingBox,useTranslate3d:n.useTranslate3d,viewBox:n.viewBox}),x=p.cssClasses,y=p.cssProperties,v=n.hasPortalFromProps?{}:qp(qp({transition:nSe({prefersReducedMotion:l,isAnimationActive:n.isAnimationActive,active:n.active,animationDuration:n.animationDuration,animationEasing:n.animationEasing})},y),{},{pointerEvents:"none",position:"absolute",top:0,left:0}),B=qp(qp({},v),{},{visibility:!h.dismissed&&n.active&&n.hasPayload?"visible":"hidden"},n.wrapperStyle);return S.createElement("div",{xmlns:"http://www.w3.org/1999/xhtml",tabIndex:-1,className:x,style:B,ref:n.innerRef},n.children)}var sSe=S.memo(rSe),pQ=()=>{var n;return(n=Dt(e=>e.rootProps.accessibilityLayer))!==null&&n!==void 0?n:!0};function zI(){return zI=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},zI.apply(null,arguments)}function j8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function R8(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?j8(Object(t),!0).forEach(function(r){aSe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):j8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function aSe(n,e,t){return(e=iSe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function iSe(n){var e=oSe(n,"string");return typeof e=="symbol"?e:e+""}function oSe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var P8={curveBasisClosed:vBe,curveBasisOpen:BBe,curveBasis:yBe,curveBumpX:xBe,curveBumpY:bBe,curveLinearClosed:wBe,curveLinear:xS,curveMonotoneX:CBe,curveMonotoneY:EBe,curveNatural:SBe,curveStep:TBe,curveStepAfter:kBe,curveStepBefore:ABe},ME=n=>nr(n.x)&&nr(n.y),L8=n=>n.base!=null&&ME(n.base)&&ME(n),ib=n=>n.x,ob=n=>n.y,lSe=(n,e)=>{if(typeof n=="function")return n;var t="curve".concat(rR(n));if((t==="curveMonotone"||t==="curveBump")&&e){var r=P8["".concat(t).concat(e==="vertical"?"Y":"X")];if(r)return r}return P8[t]||xS},O8={connectNulls:!1,type:"linear"},cSe=n=>{var e=n.type,t=e===void 0?O8.type:e,r=n.points,s=r===void 0?[]:r,a=n.baseLine,o=n.layout,l=n.connectNulls,c=l===void 0?O8.connectNulls:l,d=lSe(t,o),h=c?s.filter(ME):s;if(Array.isArray(a)){var m,p=s.map((E,N)=>R8(R8({},E),{},{base:a[N]}));o==="vertical"?m=gw().y(ob).x1(ib).x0(E=>E.base.x):m=gw().x(ib).y1(ob).y0(E=>E.base.y);var x=m.defined(L8).curve(d),y=c?p.filter(L8):p;return x(y)}var v;o==="vertical"&&Ot(a)?v=gw().y(ob).x1(ib).x0(a):Ot(a)?v=gw().x(ib).y1(ob).y0(a):v=oY().x(ib).y(ob);var B=v.defined(ME).curve(d);return B(h)},dSe=n=>{var e=n.className,t=n.points,r=n.path,s=n.pathRef,a=MS();if((!t||!t.length)&&!r)return null;var o={type:n.type,points:n.points,baseLine:n.baseLine,layout:n.layout||a,connectNulls:n.connectNulls},l=t&&t.length?cSe(o):r;return S.createElement("path",zI({},Za(n),iR(n),{className:Lr("recharts-curve",e),d:l===null?void 0:l,ref:s}))},uSe=["x","y","top","left","width","height","className"];function qI(){return qI=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},qI.apply(null,arguments)}function M8(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function hSe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4673e%2?M8(Object(t),!0).forEach(function(r){fSe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):M8(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function fSe(n,e,t){return(e=mSe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function mSe(n){var e=pSe(n,"string");return typeof e=="symbol"?e:e+""}function pSe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function gSe(n,e){if(n==null)return{};var t,r,s=xSe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function xSe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var bSe=(n,e,t,r,s,a)=>"M".concat(n,",").concat(s,"v").concat(r,"M").concat(a,",").concat(e,"h").concat(t),ySe=n=>{var e=n.x,t=e===void 0?0:e,r=n.y,s=r===void 0?0:r,a=n.top,o=a===void 0?0:a,l=n.left,c=l===void 0?0:l,d=n.width,h=d===void 0?0:d,m=n.height,p=m===void 0?0:m,x=n.className,y=gSe(n,uSe),v=hSe({x:t,y:s,top:o,left:c,width:h,height:p},y);return!Ot(t)||!Ot(s)||!Ot(h)||!Ot(p)||!Ot(o)||!Ot(c)?null:S.createElement("path",qI({},Ka(v),{className:Lr("recharts-cross",x),d:bSe(t,s,h,p,o,c)}))};function vSe(n,e,t,r){var s=r/2;return{stroke:"none",fill:"#ccc",x:n==="horizontal"?e.x-s:t.left+.5,y:n==="horizontal"?t.top+.5:e.y-s,width:n==="horizontal"?r:t.width-1,height:n==="horizontal"?t.height-1:r}}var FE=1e-4,gQ=(n,e)=>[0,3*n,3*e-6*n,3*n-3*e+1],xQ=(n,e)=>n.map((t,r)=>t*e**r).reduce((t,r)=>t+r),F8=(n,e)=>t=>{var r=gQ(n,e);return xQ(r,t)},BSe=(n,e)=>t=>{var r=gQ(n,e),s=[...r.map((a,o)=>a*o).slice(1),0];return xQ(s,t)},wSe=n=>{var e,t=n.split("(");if(t.length!==2||t[0]!=="cubic-bezier")return null;var r=(e=t[1])===null||e===void 0||(e=e.split(")")[0])===null||e===void 0?void 0:e.split(",");if(r==null||r.length!==4)return null;var s=r.map(a=>parseFloat(a));return[s[0],s[1],s[2],s[3]]},CSe=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];if(t.length===1)switch(t[0]){case"linear":return[0,0,1,1];case"ease":return[.25,.1,.25,1];case"ease-in":return[.42,0,1,1];case"ease-out":return[.42,0,.58,1];case"ease-in-out":return[0,0,.58,1];default:{var s=wSe(t[0]);if(s)return s}}return t.length===4?t:[0,0,1,1]},ESe=(n,e,t,r)=>{var s=F8(n,t),a=F8(e,r),o=BSe(n,t),l=d=>d>1?1:d<0?0:d,c=d=>{for(var h=d>1?1:d,m=h,p=0;p<8;++p){var x=s(m)-h,y=o(m);if(Math.abs(x-h)<FE||y<FE)return a(m);m=l(m-x/y)}return a(m)};return c.isStepper=!1,c},U8=function(){return ESe(...CSe(...arguments))},SSe=function(){for(var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:{},t=e.stiff,r=t===void 0?100:t,s=e.damping,a=s===void 0?8:s,o=e.dt,l=o===void 0?16.67:o,c=1,d=[0],h=0,m=0,p=1e4,x=0;x<p;){var y=-(h-c)*r,v=m*a;if(m+=(y-v)*l/1e3,h+=m*l/1e3,d.push(h),Math.abs(h-c)<FE&&Math.abs(m)<FE)break;x++}d[d.length-1]=c;var B=d.length-1;return E=>{var N,T,k;if(E<=0)return 0;if(E>=1)return c;var P=E*B,R=Math.floor(P),_=P-R;return((N=d[R])!==null&&N!==void 0?N:0)+(((T=d[R+1])!==null&&T!==void 0?T:0)-((k=d[R])!==null&&k!==void 0?k:0))*_}},TSe=n=>{if(typeof n=="string")switch(n){case"ease":case"ease-in-out":case"ease-out":case"ease-in":case"linear":return U8(n);case"spring":return SSe();default:if(n.split("(")[0]==="cubic-bezier")return U8(n)}return typeof n=="function"?n:null},ASe=(n,e,t)=>{var r,s=a=>{var o=e.tick(a);if(e.getState()==="active"){if(t(e.getInterpolated()),e.getProgress()===1){e.complete(),r=void 0;return}r=n.setTimeout(s,o);return}r=n.setTimeout(s,o)};return r=n.setTimeout(s,0),()=>{var a;return(a=r)===null||a===void 0?void 0:a()}},bQ=S.createContext(ASe);bQ.Provider;function kSe(n){var e=S.useContext(bQ);return S.useMemo(()=>n??e,[n,e])}function NSe(n,e,t){return(e=_Se(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _Se(n){var e=ISe(n,"string");return typeof e=="symbol"?e:e+""}function ISe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var V8="init",G8="pending",$8="active",DSe="completed";function fN(n){return Math.max(0,n)}class jSe{getAnimationStartedTime(){return this.animationStartedTime}getBeginStartedTime(){return this.beginStartedTime}constructor(e){var t;NSe(this,"state",V8),this.animationId=e.animationId,this.onAnimationEnd=e.onAnimationEnd,this.animationDuration=fN(e.animationDuration),this.animationBegin=fN(e.animationBegin),this.progress=0,this.from=e.from,this.to=e.to,this.easing=e.easing,(t=e.onAnimationStart)===null||t===void 0||t.call(e)}getState(){return this.state}getEasing(){return this.easing}getAnimationDuration(){return this.animationDuration}tick(e){if(this.getState()===V8)return this.state=G8,this.beginStartedTime=e,this.animationBegin;if(this.getState()===G8){if(this.beginStartedTime==null)throw new Error;var t=e-this.beginStartedTime;return t>=this.animationBegin?(this.state=$8,this.animationStartedTime=e,this.nextAnimationUpdate(0)):fN(this.animationBegin-t)}if(this.getState()===$8){if(this.animationStartedTime==null)throw new Error;var r=e-this.animationStartedTime;return this.setProgress(r/this.animationDuration),this.nextAnimationUpdate(r)}return 0}setProgress(e){this.progress=Math.min(1,Math.max(0,e))}getProgress(){return this.progress}complete(){if(this.progress=1,this.state==="active"){var e;(e=this.onAnimationEnd)===null||e===void 0||e.call(this)}this.state=DSe}getFrom(){return this.from}getTo(){return this.to}getAnimationId(){return this.animationId}getAnimationBegin(){return this.animationBegin}}class RSe extends jSe{nextAnimationUpdate(){return 0}getInterpolated(){return this.easing(Dd(this.getFrom(),this.getTo(),this.getProgress()))}}class PSe{setTimeout(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:0,r=performance.now(),s=null,a=o=>{o-r>=t?e(o):s=requestAnimationFrame(a)};return s=requestAnimationFrame(a),()=>{s!=null&&cancelAnimationFrame(s)}}}function LSe(n,e){return USe(n)||FSe(n,e)||MSe(n,e)||OSe()}
4673function OSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4674In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function MSe(n,e){if(n){if(typeof n=="string")return H8(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?H8(n,e):void 0}}function H8(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function FSe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function USe(n){if(Array.isArray(n))return n}var VSe={begin:0,duration:1e3,easing:"ease",isActive:!0,canBegin:!0,onAnimationEnd:()=>{},onAnimationStart:()=>{}},z8=0,mN=1;function yQ(n){var e=ll(n,VSe),t=e.animationId,r=e.isActive,s=e.canBegin,a=e.duration,o=e.easing,l=e.begin,c=e.onAnimationEnd,d=e.onAnimationStart,h=e.children,m=mQ(),p=r==="auto"?!FS.isSsr&&!m:r,x=kSe(e.animationController),y=S.useState(p?z8:mN),v=LSe(y,2),B=v[0],E=v[1];return S.useEffect(()=>{p||E(mN)},[p]),S.useEffect(()=>{var N=TSe(o);if(!p||!s||N==null)return Zm;var T=new PSe,k=new RSe({animationId:t,easing:N,animationDuration:a,animationBegin:l,onAnimationStart:d,onAnimationEnd:c,from:z8,to:mN});return x(T,k,E)},[x,t,p,s,a,o,l,d,c]),h(Number(B))}function vQ(n){var e=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"animation-",t=S.useRef(Sy(e)),r=S.useRef(n);return r.current!==n&&(t.current=Sy(e),r.current=n),t.current}var GSe=n=>n.replace(/([A-Z])/g,e=>"-".concat(e.toLowerCase())),$Se=(n,e,t)=>n.map(r=>"".concat(GSe(r)," ").concat(e,"ms ").concat(t)).join(","),HSe=["radius"],zSe=["radius"],q8,K8,W8,Y8,Q8,J8,X8,Z8,eU,tU;function nU(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function rU(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?nU(Object(t),!0).forEach(function(r){qSe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):nU(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function qSe(n,e,t){return(e=KSe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function KSe(n){var e=WSe(n,"string");return typeof e=="symbol"?e:e+""}function WSe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function UE(){return UE=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},UE.apply(null,arguments)}function sU(n,e){if(n==null)return{};var t,r,s=YSe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function YSe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function QSe(n,e){return eTe(n)||ZSe(n,e)||XSe(n,e)||JSe()}function JSe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4675In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function XSe(n,e){if(n){if(typeof n=="string")return aU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?aU(n,e):void 0}}function aU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ZSe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}
4675finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function eTe(n){if(Array.isArray(n))return n}function ic(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var iU=(n,e,t,r,s)=>{var a=hh(t),o=hh(r),l=Math.min(Math.abs(a)/2,Math.abs(o)/2),c=o>=0?1:-1,d=a>=0?1:-1,h=o>=0&&a>=0||o<0&&a<0?1:0,m;if(l>0&&Array.isArray(s)){for(var p=[0,0,0,0],x=0,y=4;x<y;x++){var v,B=(v=s[x])!==null&&v!==void 0?v:0;p[x]=B>l?l:B}m=ca(q8||(q8=ic(["M",",",""])),n,e+c*p[0]),p[0]>0&&(m+=ca(K8||(K8=ic(["A ",",",",0,0,",",",",",""])),p[0],p[0],h,n+d*p[0],e)),m+=ca(W8||(W8=ic(["L ",",",""])),n+t-d*p[1],e),p[1]>0&&(m+=ca(Y8||(Y8=ic(["A ",",",",0,0,",`,
4676        `,",",""])),p[1],p[1],h,n+t,e+c*p[1])),m+=ca(Q8||(Q8=ic(["L ",",",""])),n+t,e+r-c*p[2]),p[2]>0&&(m+=ca(J8||(J8=ic(["A ",",",",0,0,",`,
4677        `,",",""])),p[2],p[2],h,n+t-d*p[2],e+r)),m+=ca(X8||(X8=ic(["L ",",",""])),n+d*p[3],e+r),p[3]>0&&(m+=ca(Z8||(Z8=ic(["A ",",",",0,0,",`,
4678        `,",",""])),p[3],p[3],h,n,e+r-c*p[3])),m+="Z"}else if(l>0&&s===+s&&s>0){var E=Math.min(l,s);m=ca(eU||(eU=ic(["M ",",",`
4679            A `,",",",0,0,",",",",",`
4680            L `,",",`
4681            A `,",",",0,0,",",",",",`
4682            L `,",",`
4683            A `,",",",0,0,",",",",",`
4684            L `,",",`
4685            A `,",",",0,0,",",",","," Z"])),n,e+c*E,E,E,h,n+d*E,e,n+t-d*E,e,E,E,h,n+t,e+c*E,n+t,e+r-c*E,E,E,h,n+t-d*E,e+r,n+d*E,e+r,E,E,h,n,e+r-c*E)}else m=ca(tU||(tU=ic(["M ",","," h "," v "," h "," Z"])),n,e,t,r,-t);return m},oU={x:0,y:0,width:0,height:0,radius:0,isAnimationActive:!1,isUpdateAnimationActive:!1,animationBegin:0,animationDuration:1500,animationEasing:"ease"},tTe=n=>{var e=ll(n,oU),t=S.useRef(null),r=S.useState(-1),s=QSe(r,2),a=s[0],o=s[1];S.useEffect(()=>{if(t.current&&t.current.getTotalLength)try{var z=t.current.getTotalLength();z&&o(z)}catch{}},[]);var l=e.x,c=e.y,d=e.width,h=e.height,m=e.radius,p=e.className,x=e.animationEasing,y=e.animationDuration,v=e.animationBegin,B=e.isAnimationActive,E=e.isUpdateAnimationActive,N=S.useRef(d),T=S.useRef(h),k=S.useRef(l),P=S.useRef(c),R=S.useMemo(()=>({x:l,y:c,width:d,height:h,radius:m}),[l,c,d,h,m]),_=vQ(R,"rectangle-");if(l!==+l||c!==+c||d!==+d||h!==+h||d===0||h===0)return null;var I=Lr("recharts-rectangle",p);if(!E){var D=Ka(e);D.radius;var j=sU(D,HSe);return S.createElement("path",UE({},j,{x:hh(l),y:hh(c),width:hh(d),height:hh(h),radius:typeof m=="number"?m:void 0,className:I,d:iU(l,c,d,h,m)}))}var O=N.current,M=T.current,U=k.current,ee=P.current,ie="0px ".concat(a===-1?1:a,"px"),G="".concat(a,"px ").concat(a,"px"),Z=$Se(["strokeDasharray"],y,typeof x=="string"?x:oU.animationEasing);return S.createElement(yQ,{animationId:_,key:_,canBegin:a>0,duration:y,easing:x,isActive:E,begin:v},z=>{var se=Dd(O,d,z),re=Dd(M,h,z),H=Dd(U,l,z),Y=Dd(ee,c,z);t.current&&(N.current=se,T.current=re,k.current=H,P.current=Y);var de;B?z>0?de={transition:Z,strokeDasharray:G}:de={strokeDasharray:ie}:de={strokeDasharray:G};var W=Ka(e);W.radius;var K=sU(W,zSe);return S.createElement("path",UE({},K,{radius:typeof m=="number"?m:void 0,className:I,d:iU(H,Y,se,re,m),ref:t,style:rU(rU({},de),e.style)}))})};function lU(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function cU(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?lU(Object(t),!0).forEach(function(r){nTe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):lU(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function nTe(n,e,t){return(e=rTe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function rTe(n){var e=sTe(n,"string");return typeof e=="symbol"?e:e+""}function sTe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var VE=Math.PI/180,GE=n=>n*Math.PI/180,aTe=n=>n*180/Math.PI,rr=(n,e,t,r)=>({x:n+Math.cos(-VE*r)*t,y:e+Math.sin(-VE*r)*t}),iTe=function(e,t){var r=arguments.length>2&&arguments[2]!==void 0?arguments[2]:{top:0,right:0,bottom:0,left:0};return Math.min(Math.abs(e-(r.left||0)-(r.right||0)),Math.abs(t-(r.top||0)-(r.bottom||0)))/2},oTe=(n,e)=>
4685{var t=n.x,r=n.y,s=e.x,a=e.y;return Math.sqrt((t-s)**2+(r-a)**2)},lTe=(n,e)=>{var t=n.x,r=n.y,s=e.cx,a=e.cy,o=oTe({x:t,y:r},{x:s,y:a});if(o<=0)return{radius:o,angle:0};var l=(t-s)/o,c=Math.acos(l);return r>a&&(c=2*Math.PI-c),{radius:o,angle:aTe(c),angleInRadian:c}},cTe=n=>{var e=n.startAngle,t=n.endAngle,r=Math.floor(e/360),s=Math.floor(t/360),a=Math.min(r,s);return{startAngle:e-a*360,endAngle:t-a*360}},dTe=(n,e)=>{var t=e.startAngle,r=e.endAngle,s=Math.floor(t/360),a=Math.floor(r/360),o=Math.min(s,a);return n+o*360},uTe=(n,e)=>{var t=n.relativeX,r=n.relativeY,s=lTe({x:t,y:r},e),a=s.radius,o=s.angle,l=e.innerRadius,c=e.outerRadius;if(a<l||a>c||a===0)return null;var d=cTe(e),h=d.startAngle,m=d.endAngle,p=o,x;if(h<=m){for(;p>m;)p-=360;for(;p<h;)p+=360;x=p>=h&&p<=m}else{for(;p>h;)p-=360;for(;p<m;)p+=360;x=p>=m&&p<=h}return x?cU(cU({},e),{},{radius:a,angle:dTe(p,e)}):null};function BQ(n){var e=n.cx,t=n.cy,r=n.radius,s=n.startAngle,a=n.endAngle,o=rr(e,t,r,s),l=rr(e,t,r,a);return{points:[o,l],cx:e,cy:t,radius:r,startAngle:s,endAngle:a}}var dU,uU,hU,fU,mU,pU,gU;function KI(){return KI=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},KI.apply(null,arguments)}function rm(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var hTe=(n,e)=>{var t=Cc(e-n),r=Math.min(Math.abs(e-n),359.999);return t*r},Cw=n=>{var e=n.cx,t=n.cy,r=n.radius,s=n.angle,a=n.sign,o=n.isExternal,l=n.cornerRadius,c=n.cornerIsExternal,d=l*(o?1:-1)+r,h=Math.asin(l/d)/VE,m=c?s:s+a*h,p=rr(e,t,d,m),x=rr(e,t,r,m),y=c?s-a*h:s,v=rr(e,t,d*Math.cos(h*VE),y);return{center:p,circleTangency:x,lineTangency:v,theta:h}},wQ=n=>{var e=n.cx,t=n.cy,r=n.innerRadius,s=n.outerRadius,a=n.startAngle,o=n.endAngle,l=hTe(a,o),c=a+l,d=rr(e,t,s,a),h=rr(e,t,s,c),m=ca(dU||(dU=rm(["M ",",",`
4686    A `,",",`,0,
4687    `,",",`,
4688    `,",",`
4689  `])),d.x,d.y,s,s,+(Math.abs(l)>180),+(a>c),h.x,h.y);if(r>0){var p=rr(e,t,r,a),x=rr(e,t,r,c);m+=ca(uU||(uU=rm(["L ",",",`
4690            A `,",",`,0,
4691            `,",",`,
4692            `,","," Z"])),x.x,x.y,r,r,+(Math.abs(l)>180),+(a<=c),p.x,p.y)}else m+=ca(hU||(hU=rm(["L ",","," Z"])),e,t);return m},fTe=n=>{var e=n.cx,t=n.cy,r=n.innerRadius,s=n.outerRadius,a=n.cornerRadius,o=n.forceCornerRadius,l=n.cornerIsExternal,c=n.startAngle,d=n.endAngle,h=Cc(d-c),m=Cw({cx:e,cy:t,radius:s,angle:c,sign:h,cornerRadius:a,cornerIsExternal:l}),p=m.circleTangency,x=m.lineTangency,y=m.theta,v=Cw({cx:e,cy:t,radius:s,angle:d,sign:-h,cornerRadius:a,cornerIsExternal:l}),B=v.circleTangency,E=v.lineTangency,N=v.theta,T=l?Math.abs(c-d):Math.abs(c-d)-y-N;if(T<0)return o?ca(fU||(fU=rm(["M ",",",`
4693        a`,",",",0,0,1,",`,0
4694        a`,",",",0,0,1,",`,0
4695      `])),x.x,x.y,a,a,a*2,a,a,-a*2):wQ({cx:e,cy:t,innerRadius:r,outerRadius:s,startAngle:c,endAngle:d});var k=ca(mU||(mU=rm(["M ",",",`
4696    A`,",",",0,0,",",",",",`
4697    A`,",",",0,",",",",",",",`
4698    A`,",",",0,0,",",",",",`
4699  `])),x.x,x.y,a,a,+(h<0),p.x,p.y,s,s,+(T>180),+(h<0),B.x,B.y,a,a,+(h<0),E.x,E.y);if(r>0){var P=Cw({cx:e,cy:t,radius:r,angle:c,sign:h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),R=P.circleTangency,_=P.lineTangency,I=P.theta,D=Cw({cx:e,cy:t,radius:r,angle:d,sign:-h,isExternal:!0,cornerRadius:a,cornerIsExternal:l}),j=D.circleTangency,O=D.lineTangency,M=D.theta,U=l?Math.abs(c-d):Math.abs(c-d)-I-M;if(U<0&&a===0)return"".concat(k,"L").concat(e,",").concat(t,"Z");k+=ca(pU||(pU=rm(["L",",",`
4700      A`,",",",0,0,",",",",",`
4701      A`,",",",0,",",",",",",",`
4702      A`,",",",0,0,",",",",","Z"])),O.x,O.y,a,a,+(h<0),j.x,j.y,r,r,+(U>180),+(h>0),R.x,R.y,a,a,+(h<0),_.x,_.y)}else k+=ca(gU||(gU=rm(["L",",","Z"])),e,t);return k},mTe={cx:0,cy:0,innerRadius:0,outerRadius:0,startAngle:0,endAngle:0,cornerRadius:0,forceCornerRadius:!1,cornerIsExternal:!1},pTe=n=>{var e=ll(n,mTe),t=e.cx,r=e.cy,s=e.innerRadius,a=e.outerRadius,o=e.cornerRadius,l=e.forceCornerRadius,c=e.cornerIsExternal,d=e.startAngle,h=e.endAngle,m=e.className;if(a<s||d===h)return null;var p=Lr("recharts-sector",m),x=a-s,y=Uh(o,x,0,!0),v;return y>0&&Math.abs(d-h)<360?v=fTe({cx:t,cy:r,innerRadius:s,outerRadius:a,cornerRadius:Math.min(y,x/2),forceCornerRadius:l,cornerIsExternal:c,startAngle:d,endAngle:h}):v=wQ({cx:t,cy:r,innerRadius:s,outerRadius:a,startAngle:d,endAngle:h}),S.createElement("path",KI({},Ka(e),{className:p,d:v}))};function gTe(n,e,t){if(n==="horizontal")return[{x:e.x,y:t.top},{x:e.x,y:t.top+t.height}];if(n==="vertical")return[{x:t.left,y:e.y},{x:t.left+t.width,y:e.y}];if(gY(e)){if(n==="centric"){var r=e.cx,s=e.cy,a=e.innerRadius,o=e.outerRadius,l=e.angle,c=rr(r,s,a,l),d=rr(r,s,o,l);return[{x:c.x,y:c.y},{x:d.x,y:d.y}]}return BQ(e)}}function xTe(n){return tR(n)?NaN:Number(n)}function pN(n){return n?(n=xTe(n),n===1/0||n===-1/0?(n<0?-1:1)*Number.MAX_VALUE:n===n?n:0):n===0?n:0}function CQ(n,e,t){t&&typeof t!="number"&&jI(n,e,t)&&(e=t=void 0),n=pN(n),e===void 0?(e=n,n=0):e=pN(e),t=t===void 0?n<e?1:-1:pN(t);const r=Math.max(Math.ceil((e-n)/(t||1)),0),s=new Array(r);for(let a=0;a<r;a++)s[a]=n,n+=t;return s}var Wc=n=>n.chartData,US=Be([Wc],n=>{var e=n.chartData!=null?n.chartData.length-1:0;return{chartData:n.chartData,computedData:n.computedData,dataEndIndex:e,dataStartIndex:0}}),VS=(n,e,t,r)=>r?US(n):Wc(n),bTe=Be([VS],n=>{var e=n.chartData,t=n.dataStartIndex,r=n.dataEndIndex;return e!=null?e.slice(t,r+1):[]}),yTe=Be([US],n=>{var e=n.chartData,t=n.dataStartIndex,r=n.dataEndIndex;return e!=null?e.slice(t,r+1):[]}),vTe=Be([Wc],n=>{var e=n.chartData,t=n.dataStartIndex,r=n.dataEndIndex;return e!=null?e.slice(t,r+1):[]});function yR(n,e){return ETe(n)||CTe(n,e)||wTe(n,e)||BTe()}
4702function BTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4703In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function wTe(n,e){if(n){if(typeof n=="string")return xU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?xU(n,e):void 0}}function xU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function CTe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function ETe(n){if(Array.isArray(n))return n}function Pc(n){if(Array.isArray(n)&&n.length===2){var e=yR(n,2),t=e[0],r=e[1];if(nr(t)&&nr(r))return!0}return!1}function bU(n,e,t){return t?n:[Math.min(n[0],e[0]),Math.max(n[1],e[1])]}function EQ(n,e){if(e&&typeof n!="function"&&Array.isArray(n)&&n.length===2){var t=yR(n,2),r=t[0],s=t[1],a,o;if(nr(r))a=r;else if(typeof r=="function")return;if(nr(s))o=s;else if(typeof s=="function")return;var l=[a,o];if(Pc(l))return l}}function STe(n,e,t){if(!(!t&&e==null)){if(typeof n=="function"&&e!=null)try{var r=n(e,t);if(Pc(r))return bU(r,e,t)}catch{}if(Array.isArray(n)&&n.length===2){var s=yR(n,2),a=s[0],o=s[1],l,c;if(a==="auto")e!=null&&(l=Math.min(...e));else if(Ot(a))l=a;
vendor: 12,771 bytes, line 4703
4703else if(typeof a=="function")try{e!=null&&(l=a(e==null?void 0:e[0]))}catch{}else if(typeof a=="string"&&p8.test(a)){var d=p8.exec(a);if(d==null||d[1]==null||e==null)l=void 0;else{var h=+d[1];l=e[0]-h}}else l=e==null?void 0:e[0];if(o==="auto")e!=null&&(c=Math.max(...e));else if(Ot(o))c=o;else if(typeof o=="function")try{e!=null&&(c=o(e==null?void 0:e[1]))}catch{}else if(typeof o=="string"&&g8.test(o)){var m=g8.exec(o);if(m==null||m[1]==null||e==null)c=void 0;else{var p=+m[1];c=e[1]+p}}else c=e==null?void 0:e[1];var x=[l,c];if(Pc(x))return e==null?x:bU(x,e,t)}}}var Jg=1e9,TTe={precision:20,rounding:4,toExpNeg:-7,toExpPos:21,LN10:"2.302585092994045684017991454684364207601101488628772976033327900967572609677352480235997205089598298341967784042286"},BR,Kr=!0,il="[DecimalError] ",gm=il+"Invalid argument: ",vR=il+"Exponent out of range: ",Xg=Math.floor,Ff=Math.pow,ATe=/^(\d+(\.\d*)?|\.\d+)(e[+-]?\d+)?$/i,bo,ua=1e7,Rr=7,SQ=9007199254740991,$E=Xg(SQ/Rr),pt={};pt.absoluteValue=pt.abs=function(){var n=new this.constructor(this);return n.s&&(n.s=1),n};pt.comparedTo=pt.cmp=function(n){var e,t,r,s,a=this;if(n=new a.constructor(n),a.s!==n.s)return a.s||-n.s;if(a.e!==n.e)return a.e>n.e^a.s<0?1:-1;for(r=a.d.length,s=n.d.length,e=0,t=r<s?r:s;e<t;++e)if(a.d[e]!==n.d[e])return a.d[e]>n.d[e]^a.s<0?1:-1;return r===s?0:r>s^a.s<0?1:-1};pt.decimalPlaces=pt.dp=function(){var n=this,e=n.d.length-1,t=(e-n.e)*Rr;if(e=n.d[e],e)for(;e%10==0;e/=10)t--;return t<0?0:t};pt.dividedBy=pt.div=function(n){return Ud(this,new this.constructor(n))};pt.dividedToIntegerBy=pt.idiv=function(n){var e=this,t=e.constructor;return gr(Ud(e,new t(n),0,1),t.precision)};pt.equals=pt.eq=function(n){return!this.cmp(n)};pt.exponent=function(){return Fs(this)};pt.greaterThan=pt.gt=function(n){return this.cmp(n)>0};pt.greaterThanOrEqualTo=pt.gte=function(n){return this.cmp(n)>=0};pt.isInteger=pt.isint=function(){return this.e>this.d.length-2};pt.isNegative=pt.isneg=function(){return this.s<0};pt.isPositive=pt.ispos=function(){return this.s>0};pt.isZero=function(){return this.s===0};pt.lessThan=pt.lt=function(n){return this.cmp(n)<0};pt.lessThanOrEqualTo=pt.lte=function(n){return this.cmp(n)<1};pt.logarithm=pt.log=function(n){var e,t=this,r=t.constructor,s=r.precision,a=s+5;if(n===void 0)n=new r(10);else if(n=new r(n),n.s<1||n.eq(bo))throw Error(il+"NaN");if(t.s<1)throw Error(il+(t.s?"NaN":"-Infinity"));return t.eq(bo)?new r(0):(Kr=!1,e=Ud(Ny(t,a),Ny(n,a),a),Kr=!0,gr(e,s))};pt.minus=pt.sub=function(n){var e=this;return n=new e.constructor(n),e.s==n.s?kQ(e,n):TQ(e,(n.s=-n.s,n))};pt.modulo=pt.mod=function(n){var e,t=this,r=t.constructor,s=r.precision;if(n=new r(n),!n.s)throw Error(il+"NaN");return t.s?(Kr=!1,e=Ud(t,n,0,1).times(n),Kr=!0,t.minus(e)):gr(new r(t),s)};pt.naturalExponential=pt.exp=function(){return AQ(this)};pt.naturalLogarithm=pt.ln=function(){return Ny(this)};pt.negated=pt.neg=function(){var n=new this.constructor(this);return n.s=-n.s||0,n};pt.plus=pt.add=function(n){var e=this;return n=new e.constructor(n),e.s==n.s?TQ(e,n):kQ(e,(n.s=-n.s,n))};pt.precision=pt.sd=function(n){var e,t,r,s=this;if(n!==void 0&&n!==!!n&&n!==1&&n!==0)throw Error(gm+n);if(e=Fs(s)+1,r=s.d.length-1,t=r*Rr+1,r=s.d[r],r){for(;r%10==0;r/=10)t--;for(r=s.d[0];r>=10;r/=10)t++}return n&&e>t?e:t};pt.squareRoot=pt.sqrt=function(){var n,e,t,r,s,a,o,l=this,c=l.constructor;if(l.s<1){if(!l.s)return new c(0);throw Error(il+"NaN")}for(n=Fs(l),Kr=!1,s=Math.sqrt(+l),s==0||s==1/0?(e=Tc(l.d),(e.length+n)%2==0&&(e+="0"),s=Math.sqrt(e),n=Xg((n+1)/2)-(n<0||n%2),s==1/0?e="5e"+n:(e=s.toExponential(),e=e.slice(0,e.indexOf("e")+1)+n),r=new c(e)):r=new c(s.toString()),t=c.precision,s=o=t+3;;)if(a=r,r=a.plus(Ud(l,a,o+2)).times(.5),Tc(a.d).slice(0,o)===(e=Tc(r.d)).slice(0,o)){if(e=e.slice(o-3,o+1),s==o&&e=="4999"){if(gr(a,t+1,0),a.times(a).eq(l)){r=a;break}}else if(e!="9999")break;o+=4}return Kr=!0,gr(r,t)};pt.times=pt.mul=function(n){var e,t,r,s,a,o,l,c,d,h=this,m=h.constructor,p=h.d,x=(n=new m(n)).d;if(!h.s||!n.s)return new m(0);for(n.s*=h.s,t=h.e+n.e,c=p.length,d=x.length,c<d&&(a=p,p=x,x=a,o=c,c=d,d=o),a=[],o=c+d,r=o;r--;)a.push(0);for(r=d;--r>=0;){for(e=0,s=c+r;s>r;)l=a[s]+x[r]*p[s-r-1]+e,a[s--]=l%ua|0,e=l/ua|0;a[s]=(a[s]+e)%ua|0}for(;!a[--o];)a.pop();return e?++t:a.shift(),n.d=a,n.e=t,Kr?gr(n,m.precision):n};pt.toDecimalPlaces=pt.todp=function(n,e){var t=this,r=t.constructor;return t=new r(t),n===void 0?t:(Gc(n,0,Jg),e===void 0?e=r.rounding:Gc(e,0,8),gr(t,n+Fs(t)+1,e))};pt.toExponential=function(n,e){var t,r=this,s=r.constructor;return n===void 0?t=Um(r,!0):(Gc(n,0,Jg),e===void 0?e=s.rounding:Gc(e,0,8),r=gr(new s(r),n+1,e),t=Um(r,!0,n+1)),t};pt.toFixed=function(n,e){var t,r,s=this,a=s.constructor;return n===void 0?Um(s):(Gc(n,0,Jg),e===void 0?e=a.rounding:Gc(e,0,8),r=gr(new a(s),n+Fs(s)+1,e),t=Um(r.abs(),!1,n+Fs(r)+1),s.isneg()&&!s.isZero()?"-"+t:t)};pt.toInteger=pt.toint=function(){var n=this,e=n.constructor;return gr(new e(n),Fs(n)+1,e.rounding)};pt.toNumber=function(){return+this};pt.toPower=pt.pow=function(n){var e,t,r,s,a,o,l=this,c=l.constructor,d=12,h=+(n=new c(n));if(!n.s)return new c(bo);if(l=new c(l),!l.s){if(n.s<1)throw Error(il+"Infinity");return l}if(l.eq(bo))return l;if(r=c.precision,n.eq(bo))return gr(l,r);if(e=n.e,t=n.d.length-1,o=e>=t,a=l.s,o){if((t=h<0?-h:h)<=SQ){for(s=new c(bo),e=Math.ceil(r/Rr+4),Kr=!1;t%2&&(s=s.times(l),vU(s.d,e)),t=Xg(t/2),t!==0;)l=l.times(l),vU(l.d,e);return Kr=!0,n.s<0?new c(bo).div(s):gr(s,r)}}else if(a<0)throw Error(il+"NaN");return a=a<0&&n.d[Math.max(e,t)]&1?-1:1,l.s=1,Kr=!1,s=n.times(Ny(l,r+d)),Kr=!0,s=AQ(s),s.s=a,s};pt.toPrecision=function(n,e){var t,r,s=this,a=s.constructor;return n===void 0?(t=Fs(s),r=Um(s,t<=a.toExpNeg||t>=a.toExpPos)):(Gc(n,1,Jg),e===void 0?e=a.rounding:Gc(e,0,8),s=gr(new a(s),n,e),t=Fs(s),r=Um(s,n<=t||t<=a.toExpNeg,n)),r};pt.toSignificantDigits=pt.tosd=function(n,e){var t=this,r=t.constructor;return n===void 0?(n=r.precision,e=r.rounding):(Gc(n,1,Jg),e===void 0?e=r.rounding:Gc(e,0,8)),gr(new r(t),n,e)};pt.toString=pt.valueOf=pt.val=pt.toJSON=pt[Symbol.for("nodejs.util.inspect.custom")]=function(){var n=this,e=Fs(n),t=n.constructor;return Um(n,e<=t.toExpNeg||e>=t.toExpPos)};function TQ(n,e){var t,r,s,a,o,l,c,d,h=n.constructor,m=h.precision;if(!n.s||!e.s)return e.s||(e=new h(n)),Kr?gr(e,m):e;if(c=n.d,d=e.d,o=n.e,s=e.e,c=c.slice(),a=o-s,a){for(a<0?(r=c,a=-a,l=d.length):(r=d,s=o,l=c.length),o=Math.ceil(m/Rr),l=o>l?o+1:l+1,a>l&&(a=l,r.length=1),r.reverse();a--;)r.push(0);r.reverse()}for(l=c.length,a=d.length,l-a<0&&(a=l,r=d,d=c,c=r),t=0;a;)t=(c[--a]=c[a]+d[a]+t)/ua|0,c[a]%=ua;for(t&&(c.unshift(t),++s),l=c.length;c[--l]==0;)c.pop();return e.d=c,e.e=s,Kr?gr(e,m):e}function Gc(n,e,t){if(n!==~~n||n<e||n>t)throw Error(gm+n)}function Tc(n){var e,t,r,s=n.length-1,a="",o=n[0];if(s>0){for(a+=o,e=1;e<s;e++)r=n[e]+"",t=Rr-r.length,t&&(a+=Ju(t)),a+=r;o=n[e],r=o+"",t=Rr-r.length,t&&(a+=Ju(t))}else if(o===0)return"0";for(;o%10===0;)o/=10;return a+o}var Ud=(function(){function n(r,s){var a,o=0,l=r.length;for(r=r.slice();l--;)a=r[l]*s+o,r[l]=a%ua|0,o=a/ua|0;return o&&r.unshift(o),r}function e(r,s,a,o){var l,c;if(a!=o)c=a>o?1:-1;else for(l=c=0;l<a;l++)if(r[l]!=s[l]){c=r[l]>s[l]?1:-1;break}return c}function t(r,s,a){for(var o=0;a--;)r[a]-=o,o=r[a]<s[a]?1:0,r[a]=o*ua+r[a]-s[a];for(;!r[0]&&r.length>1;)r.shift()}return function(r,s,a,o){var l,c,d,h,m,p,x,y,v,B,E,N,T,k,P,R,_,I,D=r.constructor,j=r.s==s.s?1:-1,O=r.d,M=s.d;if(!r.s)return new D(r);if(!s.s)throw Error(il+"Division by zero");for(c=r.e-s.e,_=M.length,P=O.length,x=new D(j),y=x.d=[],d=0;M[d]==(O[d]||0);)++d;if(M[d]>(O[d]||0)&&--c,a==null?N=a=D.precision:o?N=a+(Fs(r)-Fs(s))+1:N=a,N<0)return new D(0);if(N=N/Rr+2|0,d=0,_==1)for(h=0,M=M[0],N++;(d<P||h)&&N--;d++)T=h*ua+(O[d]||0),y[d]=T/M|0,h=T%M|0;else{for(h=ua/(M[0]+1)|0,h>1&&(M=n(M,h),O=n(O,h),_=M.length,P=O.length),k=_,v=O.slice(0,_),B=v.length;B<_;)v[B++]=0;I=M.slice(),I.unshift(0),R=M[0],M[1]>=ua/2&&++R;do h=0,l=e(M,v,_,B),l<0?(E=v[0],_!=B&&(E=E*ua+(v[1]||0)),h=E/R|0,h>1?(h>=ua&&(h=ua-1),m=n(M,h),p=m.length,B=v.length,l=e(m,v,p,B),l==1&&(h--,t(m,_<p?I:M,p))):(h==0&&(l=h=1),m=M.slice()),p=m.length,p<B&&m.unshift(0),t(v,m,B),l==-1&&(B=v.length,l=e(M,v,_,B),l<1&&(h++,t(v,_<B?I:M,B))),B=v.length):l===0&&(h++,v=[0]),y[d++]=h,l&&v[0]?v[B++]=O[k]||0:(v=[O[k]],B=1);while((k++<P||v[0]!==void 0)&&N--)}return y[0]||y.shift(),x.e=c,gr(x,o?a+Fs(x)+1:a)}})();function AQ(n,e){var t,r,s,a,o,l,c=0,d=0,h=n.constructor,m=h.precision;if(Fs(n)>16)throw Error(vR+Fs(n));if(!n.s)return new h(bo);for(Kr=!1,l=m,o=new h(.03125);n.abs().gte(.1);)n=n.times(o),d+=5;for(r=Math.log(Ff(2,d))/Math.LN10*2+5|0,l+=r,t=s=a=new h(bo),h.precision=l;;){if(s=gr(s.times(n),l),t=t.times(++c),o=a.plus(Ud(s,t,l)),Tc(o.d).slice(0,l)===Tc(a.d).slice(0,l)){for(;d--;)a=gr(a.times(a),l);return h.precision=m,e==null?(Kr=!0,gr(a,m)):a}a=o}}function Fs(n){for(var e=n.e*Rr,t=n.d[0];t>=10;t/=10)e++;return e}function gN(n,e,t){if(e>n.LN10.sd())throw Kr=!0,t&&(n.precision=t),Error(il+"LN10 precision limit exceeded");return gr(new n(n.LN10),e)}function Ju(n){for(var e="";n--;)e+="0";return e}function Ny(n,e){var t,r,s,a,o,l,c,d,h,m=1,p=10,x=n,y=x.d,v=x.constructor,B=v.precision;if(x.s<1)throw Error(il+(x.s?"NaN":"-Infinity"));if(x.eq(bo))return new v(0);if(e==null?(Kr=!1,d=B):d=e,x.eq(10))return e==null&&(Kr=!0),gN(v,d);if(d+=p,v.precision=d,t=Tc(y),r=t.charAt(0),a=Fs(x),Math.abs(a)<15e14){for(;r<7&&r!=1||r==1&&t.charAt(1)>3;)x=x.times(n),t=Tc(x.d),r=t.charAt(0),m++;a=Fs(x),r>1?(x=new v("0."+t),a++):x=new v(r+"."+t.slice(1))}else return c=gN(v,d+2,B).times(a+""),x=Ny(new v(r+"."+t.slice(1)),d-p).plus(c),v.precision=B,e==null?(Kr=!0,gr(x,B)):x;for(l=o=x=Ud(x.minus(bo),x.plus(bo),d),h=gr(x.times(x),d),s=3;;){if(o=gr(o.times(h),d),c=l.plus(Ud(o,new v(s),d)),Tc(c.d).slice(0,d)===Tc(l.d).slice(0,d))return l=l.times(2),a!==0&&(l=l.plus(gN(v,d+2,B).times(a+""))),l=Ud(l,new v(m),d),v.precision=B,e==null?(Kr=!0,gr(l,B)):l;l=c,s+=2}}function yU(n,e){var t,r,s;for((t=e.indexOf("."))>-1&&(e=e.replace(".","")),(r=e.search(/e/i))>0?(t<0&&(t=r),t+=+e.slice(r+1),e=e.substring(0,r)):t<0&&(t=e.length),r=0;e.charCodeAt(r)===48;)++r;for(s=e.length;e.charCodeAt(s-1)===48;)--s;if(e=e.slice(r,s),e){if(s-=r,t=t-r-1,n.e=Xg(t/Rr),n.d=[],r=(t+1)%Rr,t<0&&(r+=Rr),r<s){for(r&&n.d.push(+e.slice(0,r)),s-=Rr;r<s;)n.d.push(+e.slice(r,r+=Rr));e=e.slice(r),r=Rr-e.length}else r-=s;for(;r--;)e+="0";if(n.d.push(+e),Kr&&(n.e>$E||n.e<-$E))throw Error(vR+t)}else n.s=0,n.e=0,n.d=[0];return n}function gr(n,e,t){var r,s,a,o,l,c,d,h,m=n.d;for(o=1,a=m[0];a>=10;a/=10)o++;if(r=e-o,r<0)r+=Rr,s=e,d=m[h=0];else{if(h=Math.ceil((r+1)/Rr),a=m.length,h>=a)return n;for(d=a=m[h],o=1;a>=10;a/=10)o++;r%=Rr,s=r-Rr+o}if(t!==void 0&&(a=Ff(10,o-s-1),l=d/a%10|0,c=e<0||m[h+1]!==void 0||d%a,c=t<4?(l||c)&&(t==0||t==(n.s<0?3:2)):l>5||l==5&&(t==4||c||t==6&&(r>0?s>0?d/Ff(10,o-s):0:m[h-1])%10&1||t==(n.s<0?8:7))),e<1||!m[0])return c?(a=Fs(n),m.length=1,e=e-a-1,m[0]=Ff(10,(Rr-e%Rr)%Rr),n.e=Xg(-e/Rr)||0):(m.length=1,m[0]=n.e=n.s=0),n;if(r==0?(m.length=h,a=1,h--):(m.length=h+1,a=Ff(10,Rr-r),m[h]=s>0?(d/Ff(10,o-s)%Ff(10,s)|0)*a:0),c)for(;;)if(h==0){(m[0]+=a)==ua&&(m[0]=1,++n.e);break}else{if(m[h]+=a,m[h]!=ua)break;m[h--]=0,a=1}for(r=m.length;m[--r]===0;)m.pop();if(Kr&&(n.e>$E||n.e<-$E))throw Error(vR+Fs(n));return n}function kQ(n,e){var t,r,s,a,o,l,c,d,h,m,p=n.constructor,x=p.precision;if(!n.s||!e.s)return e.s?e.s=-e.s:e=new p(n),Kr?gr(e,x):e;if(c=n.d,m=e.d,r=e.e,d=n.e,c=c.slice(),o=d-r,o){for(h=o<0,h?(t=c,o=-o,l=m.length):(t=m,r=d,l=c.length),s=Math.max(Math.ceil(x/Rr),l)+2,o>s&&(o=s,t.length=1),t.reverse(),s=o;s--;)t.push(0);t.reverse()}else{for(s=c.length,l=m.length,h=s<l,h&&(l=s),s=0;s<l;s++)if(c[s]!=m[s]){h=c[s]<m[s];break}o=0}for(h&&(t=c,c=m,m=t,e.s=-e.s),l=c.length,s=m.length-l;s>0;--s)c[l++]=0;for(s=m.length;s>o;){if(c[--s]<m[s]){for(a=s;a&&c[--a]===0;)c[a]=ua-1;--c[a],c[s]+=ua}c[s]-=m[s]}for(;c[--l]===0;)c.pop();for(;c[0]===0;c.shift())--r;return c[0]?(e.d=c,e.e=r,Kr?gr(e,x):e):new p(0)}function Um(n,e,t){var r,s=Fs(n),a=Tc(n.d),o=a.length;return e?(t&&(r=t-o)>0?a=a.charAt(0)+"."+a.slice(1)+Ju(r):o>1&&(a=a.charAt(0)+"."+a.slice(1)),a=a+(s<0?"e":"e+")+s):s<0?(a="0."+Ju(-s-1)+a,t&&(r=t-o)>0&&(a+=Ju(r))):s>=o?(a+=Ju(s+1-o),t&&(r=t-s-1)>0&&(a=a+"."+Ju(r))):((r=s+1)<o&&(a=a.slice(0,r)+"."+a.slice(r)),t&&(r=t-o)>0&&(s+1===o&&(a+="."),a+=Ju(r))),n.s<0?"-"+a:a}function vU(n,e){if(n.length>e)return n.length=e,!0}function NQ(n){var e,t,r;function s(a){var o=this;if(!(o instanceof s))return new s(a);if(o.constructor=s,a instanceof s){o.s=a.s,o.e=a.e,o.d=(a=a.d)?a.slice():a;return}if(typeof a=="number"){if(a*0!==0)throw Error(gm+a);if(a>0)o.s=1;else if(a<0)a=-a,o.s=-1;else{o.s=0,o.e=0,o.d=[0];return}if(a===~~a&&a<1e7){o.e=0,o.d=[a];return}return yU(o,a.toString())}else if(typeof a!="string")throw Error(gm+a);
4703if(a.charCodeAt(0)===45?(a=a.slice(1),o.s=-1):o.s=1,ATe.test(a))yU(o,a);else throw Error(gm+a)}if(s.prototype=pt,s.ROUND_UP=0,s.ROUND_DOWN=1,s.ROUND_CEIL=2,s.ROUND_FLOOR=3,s.ROUND_HALF_UP=4,s.ROUND_HALF_DOWN=5,s.ROUND_HALF_EVEN=6,s.ROUND_HALF_CEIL=7,s.ROUND_HALF_FLOOR=8,s.clone=NQ,s.config=s.set=kTe,n===void 0&&(n={}),n)for(r=["precision","rounding","toExpNeg","toExpPos","LN10"],e=0;e<r.length;)n.hasOwnProperty(t=r[e++])||(n[t]=this[t]);return s.config(n),s}function kTe(n){if(!n||typeof n!="object")throw Error(il+"Object expected");var e,t,r,s=["precision",1,Jg,"rounding",0,8,"toExpNeg",-1/0,0,"toExpPos",0,1/0];for(e=0;e<s.length;e+=3)if((r=n[t=s[e]])!==void 0)if(Xg(r)===r&&r>=s[e+1]&&r<=s[e+2])this[t]=r;else throw Error(gm+t+": "+r);if((r=n[t="LN10"])!==void 0)if(r==Math.LN10)this[t]=new this(r);else throw Error(gm+t+": "+r);return this}var BR=NQ(TTe);bo=new BR(1);const hn=BR;function _Q(n){var e;return n===0?e=1:e=Math.floor(new hn(n).abs().log(10).toNumber())+1,e}function IQ(n,e,t){for(var r=new hn(n),s=0,a=[];r.lt(e)&&s<1e5;)a.push(r.toNumber()),r=r.add(t),s++;return a}function _y(n,e){return DTe(n)||ITe(n,e)||_Te(n,e)||NTe()}function NTe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4704In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function _Te(n,e){if(n){if(typeof n=="string")return BU(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?BU(n,e):void 0}}function BU(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function ITe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function DTe(n){if(Array.isArray(n))return n}var DQ=n=>{var e=_y(n,2),t=e[0],r=e[1],s=t,a=r;return t>r&&(s=r,a=t),[s,a]},wR=(n,e,t)=>{if(n.lte(0))return new hn(0);var r=_Q(n.toNumber()),s=new hn(10).pow(r),a=n.div(s),o=r!==1?.05:.1,l=new hn(Math.ceil(a.div(o).toNumber())).add(t).mul(o),c=l.mul(s);return e?new hn(c.toNumber()):new hn(Math.ceil(c.toNumber()))},jQ=(n,e,t)=>{var r;if(n.lte(0))return new hn(0);var s=[1,2,2.5,5],a=n.toNumber(),o=Math.floor(new hn(a).abs().log(10).toNumber()),l=new hn(10).pow(o),c=n.div(l).toNumber(),d=s.findIndex(x=>x>=c-1e-10);if(d===-1&&(l=l.mul(10),d=0),d+=t,d>=s.length){var h=Math.floor(d/s.length);d%=s.length,l=l.mul(new hn(10).pow(h))}var m=(r=s[d])!==null&&r!==void 0?r:1,p=new hn(m).mul(l);return e?p:new hn(Math.ceil(p.toNumber()))},jTe=(n,e,t)=>{var r=new hn(1),s=new hn(n);if(!s.isint()&&t){var a=Math.abs(n);a<1?(r=new hn(10).pow(_Q(n)-1),s=new hn(Math.floor(s.div(r).toNumber())).mul(r)):a>1&&(s=new hn(Math.floor(n)))}else n===0?s=new hn(Math.floor((e-1)/2)):t||(s=new hn(Math.floor(n)));for(var o=Math.floor((e-1)/2),l=[],c=0;c<e;c++)l.push(s.add(new hn(c-o).mul(r)).toNumber());return l},RQ=function(e,t,r,s){var a=arguments.length>4&&arguments[4]!==void 0?arguments[4]:0,o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:wR;if(!Number.isFinite((t-e)/(r-1)))return{step:new hn(0),tickMin:new hn(0),tickMax:new hn(0)};var l=o(new hn(t).sub(e).div(r-1),s,a),c;e<=0&&t>=0?c=new hn(0):(c=new hn(e).add(t).div(2),c=c.sub(new hn(c).mod(l)));var d=Math.ceil(c.sub(e).div(l).toNumber()),h=Math.ceil(new hn(t).sub(c).div(l).toNumber()),m=d+h+1;return m>r?RQ(e,t,r,s,a+1,o):(m<r&&(h=t>0?h+(r-m):h,d=t>0?d:d+(r-m)),{step:l,tickMin:c.sub(new hn(d).mul(l)),tickMax:c.add(new hn(h).mul(l))})},wU=function(e){var t=_y(e,2),r=t[0],s=t[1],a=arguments.length>1&&arguments[1]!==void 0?arguments[1]:6,o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=Math.max(a,2),d=DQ([r,s]),h=_y(d,2),m=h[0],p=h[1];if(m===-1/0||p===1/0){var x=p===1/0?[m,...Array(a-1).fill(1/0)]:[...Array(a-1).fill(-1/0),p];return r>s?x.reverse():x}if(m===p)return jTe(m,a,o);var y=l==="snap125"?jQ:wR,v=RQ(m,p,c,o,0,y),B=v.step,E=v.tickMin,N=v.tickMax,T=IQ(E,N.add(new hn(.1).mul(B)),B);return r>s?T.reverse():T},CU=function(e,t){var r=_y(e,2),s=r[0],a=r[1],o=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0,l=arguments.length>3&&arguments[3]!==void 0?arguments[3]:"auto",c=DQ([s,a]),d=_y(c,2),h=d[0],m=d[1];if(h===-1/0||m===1/0)return[s,a];if(h===m)return[h];var p=l==="snap125"?jQ:wR,x=Math.max(t,2),y=p(new hn(m).sub(h).div(x-1),o,0),v=[...IQ(new hn(h),new hn(m),y),m];if(o===!1){v=v.map(E=>
4704Math.round(E));var B=v.length-1;B>0&&v[B]===v[B-1]&&(v=v.slice(0,B))}return s>a?v.reverse():v},RTe=n=>n.rootProps.barCategoryGap,Dv=n=>n.rootProps.stackOffset,PQ=n=>n.rootProps.reverseStackOrder,CR=n=>n.options.chartName,ER=n=>n.rootProps.syncId,LQ=n=>n.rootProps.syncMethod,SR=n=>n.options.eventEmitter,fi={grid:-100,barBackground:-50,area:100,cursorRectangle:200,bar:300,line:400,axis:500,scatter:600,activeBar:1e3,cursorLine:1100,activeDot:1200,label:2e3},Qu={allowDecimals:!1,allowDuplicatedCategory:!0,allowDataOverflow:!1,angle:0,angleAxisId:0,axisLine:!0,axisLineType:"polygon",cx:0,cy:0,hide:!1,includeHidden:!1,label:!1,niceTicks:"auto",orientation:"outer",reversed:!1,scale:"auto",tick:!0,tickLine:!0,tickSize:8,type:"auto",zIndex:fi.axis},Al={allowDataOverflow:!1,allowDecimals:!1,allowDuplicatedCategory:!0,angle:0,axisLine:!0,includeHidden:!1,hide:!1,niceTicks:"auto",label:!1,orientation:"right",radiusAxisId:0,reversed:!1,scale:"auto",stroke:"#ccc",tick:!0,tickCount:5,tickLine:!0,type:"auto",zIndex:fi.axis},GS=(n,e)=>{if(!(!n||!e))return n!=null&&n.reversed?[e[1],e[0]]:e};function $S(n,e,t){if(t!=="auto")return t;if(n!=null)return au(n,e)?"category":"number"}function EU(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function HE(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?EU(Object(t),!0).forEach(function(r){PTe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):EU(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function PTe(n,e,t){return(e=LTe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function LTe(n){var e=OTe(n,"string");return typeof e=="symbol"?e:e+""}function OTe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var SU={allowDataOverflow:Qu.allowDataOverflow,allowDecimals:Qu.allowDecimals,allowDuplicatedCategory:!1,dataKey:void 0,domain:void 0,id:Qu.angleAxisId,includeHidden:!1,name:void 0,reversed:Qu.reversed,scale:Qu.scale,tick:Qu.tick,tickCount:void 0,ticks:void 0,type:Qu.type,unit:void 0,niceTicks:"auto"},TU={allowDataOverflow:Al.allowDataOverflow,allowDecimals:Al.allowDecimals,allowDuplicatedCategory:Al.allowDuplicatedCategory,dataKey:void 0,domain:void 0,id:Al.radiusAxisId,includeHidden:Al.includeHidden,name:void 0,reversed:Al.reversed,scale:Al.scale,tick:Al.tick,tickCount:Al.tickCount,ticks:void 0,type:Al.type,unit:void 0,niceTicks:"auto"},MTe=(n,e)=>{if(e!=null)return n.polarAxis.angleAxis[e]},Zg=Be([MTe,xR],(n,e)=>{var t;if(n!=null)return n;var r=(t=$S(e,"angleAxis",SU.type))!==null&&t!==void 0?t:"category";return HE(HE({},SU),{},{type:r})}),FTe=(n,e)=>n.polarAxis.radiusAxis[e],jv=Be([FTe,xR],(n,e)=>{var t;if(n!=null)return n;var r=(t=$S(e,"radiusAxis",TU.type))!==null&&t!==void 0?t:"category";return HE(HE({},TU),{},{type:r})}),HS=n=>n.polarOptions,TR=Be([iu,ou,Ma],iTe),OQ=Be([HS,TR],(n,e)=>{if(n!=null)return Uh(n.innerRadius,e,0)}),MQ=Be([HS,TR],(n,e)=>{if(n!=null)return Uh(n.outerRadius,e,e*.8)}),UTe=n=>{if(n==null)return[0,0];var e=n.startAngle,t=n.endAngle;return[e,t]},FQ=Be([HS],UTe),VTe=Be([Zg,FQ],GS),UQ=Be([TR,OQ,MQ],(n,e,t)=>{if(!(n==null||e==null||t==null))return[e,t]}),GTe=Be([jv,UQ],GS),ex=Be([ir,HS,OQ,MQ,iu,ou],(n,e,t,r,s,a)=>{if(!(n!=="centric"&&n!=="radial"||e==null||t==null||r==null)){var o=e.cx,l=e.cy,c=e.startAngle,d=e.endAngle;return{cx:Uh(o,s,s/2),cy:Uh(l,a,a/2),innerRadius:t,outerRadius:r,startAngle:c,endAngle:d,clockWise:!1}}}),Tr=(n,e)=>e,Rv=(n,e,t)=>t;function VQ(n){return n==null?void 0:n.id}function GQ(n,e,t){var r=e.chartData,s=r===void 0?[]:r,a=t.allowDuplicatedCategory,o=t.dataKey,l=new Map;return n.forEach(c=>{var d,h=(d=c.data)!==null&&d!==void 0?d:s;if(!(h==null||h.length===0)){var m=VQ(c);h.forEach((p,x)=>{var y=o==null||a?x:String(Qs(p,o,null)),v=Qs(p,c.dataKey,0),B;l.has(y)?B=l.get(y):B={},Object.assign(B,{[m]:v}),l.set(y,B)})}}),Array.from(l.values())}function AR(n){return"stackId"in n&&n.stackId!=null&&n.dataKey!=null}var Pv=(n,e)=>n===e?!0:n==null||e==null?!1:n[0]===e[0]&&n[1]===e[1];function zS(n,e){return Array.isArray(n)&&Array.isArray(e)&&n.length===0&&e.length===0?!0:n===e}function $Te(n,e){if(n.length===e.length){for(var t=0;t<n.length;t++)if(n[t]!==e[t])return!1;return!0}return!1}var pa=n=>{var e=ir(n);return e==="horizontal"?"xAxis":e==="vertical"?"yAxis":e==="centric"?"angleAxis":"radiusAxis"},tx=n=>n.tooltip.settings.axisId;function qS(n){if(n!=null){var e=n.ticks,t=n.bandwidth,r=n.range(),s=[Math.min(...r),Math.max(...r)];return{domain:()=>n.domain(),range:(function(a){function o(){return a.apply(this,arguments)}return o.toString=function(){return a.toString()},o})(()=>s),rangeMin:()=>s[0],rangeMax:()=>s[1],isInRange(a){var o=s[0],l=s[1];return o<=l?a>=o&&a<=l:a>=l&&a<=o},bandwidth:t?()=>t.call(n):void 0,ticks:e?a=>e.call(n,a):void 0,map:(a,o)=>{var l=n(a);if(l!=null){if(n.bandwidth&&o!==null&&o!==void 0&&o.position){var c=n.bandwidth();switch(o.position){case"middle":l+=c/2;break;case"end":l+=c;break}}return l}}}}}var $Q=(n,e)=>{if(e!=null)switch(n){case"linear":{if(!Pc(e)){for(var t,r,s=0;s<e.length;s++){var a=e[s];
4704nr(a)&&((t===void 0||a<t)&&(t=a),(r===void 0||a>r)&&(r=a))}return t!==void 0&&r!==void 0?[t,r]:void 0}return e}default:return e}};function wh(n,e){return n==null||e==null?NaN:n<e?-1:n>e?1:n>=e?0:NaN}function HTe(n,e){return n==null||e==null?NaN:e<n?-1:e>n?1:e>=n?0:NaN}function kR(n){let e,t,r;n.length!==2?(e=wh,t=(l,c)=>wh(n(l),c),r=(l,c)=>n(l)-c):(e=n===wh||n===HTe?n:zTe,t=n,r=n);function s(l,c,d=0,h=l.length){if(d<h){if(e(c,c)!==0)return h;do{const m=d+h>>>1;t(l[m],c)<0?d=m+1:h=m}while(d<h)}return d}function a(l,c,d=0,h=l.length){if(d<h){if(e(c,c)!==0)return h;do{const m=d+h>>>1;t(l[m],c)<=0?d=m+1:h=m}while(d<h)}return d}function o(l,c,d=0,h=l.length){const m=s(l,c,d,h-1);return m>d&&r(l[m-1],c)>-r(l[m],c)?m-1:m}return{left:s,center:o,right:a}}function zTe(){return 0}function HQ(n){return n===null?NaN:+n}function*qTe(n,e){for(let t of n)t!=null&&(t=+t)>=t&&(yield t)}const KTe=kR(wh),Lv=KTe.right;kR(HQ).center;class AU extends Map{constructor(e,t=QTe){if(super(),Object.defineProperties(this,{_intern:{value:new Map},_key:{value:t}}),e!=null)for(const[r,s]of e)this.set(r,s)}get(e){return super.get(kU(this,e))}has(e){return super.has(kU(this,e))}set(e,t){return super.set(WTe(this,e),t)}delete(e){return super.delete(YTe(this,e))}}function kU({_intern:n,_key:e},t){const r=e(t);return n.has(r)?n.get(r):t}function WTe({_intern:n,_key:e},t){const r=e(t);return n.has(r)?n.get(r):(n.set(r,t),t)}function YTe({_intern:n,_key:e},t){const r=e(t);return n.has(r)&&(t=n.get(r),n.delete(r)),t}function QTe(n){return n!==null&&typeof n=="object"?n.valueOf():n}function JTe(n=wh){if(n===wh)return zQ;if(typeof n!="function")throw new TypeError("compare is not a function");return(e,t)=>{const r=n(e,t);return r||r===0?r:(n(t,t)===0)-(n(e,e)===0)}}function zQ(n,e){return(n==null||!(n>=n))-(e==null||!(e>=e))||(n<e?-1:n>e?1:0)}const XTe=Math.sqrt(50),ZTe=Math.sqrt(10),eAe=Math.sqrt(2);function zE(n,e,t){const r=(e-n)/Math.max(0,t),s=Math.floor(Math.log10(r)),a=r/Math.pow(10,s),o=a>=XTe?10:a>=ZTe?5:a>=eAe?2:1;let l,c,d;return s<0?(d=Math.pow(10,-s)/o,l=Math.round(n*d),c=Math.round(e*d),l/d<n&&++l,c/d>e&&--c,d=-d):(d=Math.pow(10,s)*o,l=Math.round(n/d),c=Math.round(e/d),l*d<n&&++l,c*d>e&&--c),c<l&&.5<=t&&t<2?zE(n,e,t*2):[l,c,d]}function WI(n,e,t){if(e=+e,n=+n,t=+t,!(t>0))return[];if(n===e)return[n];const r=e<n,[s,a,o]=r?zE(e,n,t):zE(n,e,t);if(!(a>=s))return[];const l=a-s+1,c=new Array(l);if(r)if(o<0)for(let d=0;d<l;++d)c[d]=(a-d)/-o;else for(let d=0;d<l;++d)c[d]=(a-d)*o;else if(o<0)for(let d=0;d<l;++d)c[d]=(s+d)/-o;else for(let d=0;d<l;++d)c[d]=(s+d)*o;return c}function YI(n,e,t){return e=+e,n=+n,t=+t,zE(n,e,t)[2]}function QI(n,e,t){e=+e,n=+n,t=+t;const r=e<n,s=r?YI(e,n,t):YI(n,e,t);return(r?-1:1)*(s<0?1/-s:s)}function NU(n,e){let t;for(const r of n)r!=null&&(t<r||t===void 0&&r>=r)&&(t=r);return t}function _U(n,e){let t;for(const r of n)r!=null&&(t>r||t===void 0&&r>=r)&&(t=r);return t}function qQ(n,e,t=0,r=1/0,s){if(e=Math.floor(e),t=Math.floor(Math.max(0,t)),r=Math.floor(Math.min(n.length-1,r)),!(t<=e&&e<=r))return n;for(s=s===void 0?zQ:JTe(s);r>t;){if(r-t>600){const c=r-t+1,d=e-t+1,h=Math.log(c),m=.5*Math.exp(2*h/3),p=.5*Math.sqrt(h*m*(c-m)/c)*(d-c/2<0?-1:1),x=Math.max(t,Math.floor(e-d*m/c+p)),y=Math.min(r,Math.floor(e+(c-d)*m/c+p));qQ(n,e,x,y,s)}const a=n[e];let o=t,l=r;for(lb(n,t,e),s(n[r],a)>0&&lb(n,t,r);o<l;){for(lb(n,o,l),++o,--l;s(n[o],a)<0;)++o;for(;s(n[l],a)>0;)--l}s(n[t],a)===0?lb(n,t,l):(++l,lb(n,l,r)),l<=e&&(t=l+1),e<=l&&(r=l-1)}return n}function lb(n,e,t){const r=n[e];n[e]=n[t],n[t]=r}function tAe(n,e,t){if(n=Float64Array.from(qTe(n)),!(!(r=n.length)||isNaN(e=+e))){if(e<=0||r<2)return _U(n);if(e>=1)return NU(n);var r,s=(r-1)*e,a=Math.floor(s),o=NU(qQ(n,a).subarray(0,a+1)),l=_U(n.subarray(a+1));return o+(l-o)*(s-a)}}function nAe(n,e,t=HQ){if(!(!(r=n.length)||isNaN(e=+e))){if(e<=0||r<2)return+t(n[0],0,n);if(e>=1)return+t(n[r-1],r-1,n);var r,s=(r-1)*e,a=Math.floor(s),o=+t(n[a],a,n),l=+t(n[a+1],a+1,n);return o+(l-o)*(s-a)}}function rAe(n,e,t){n=+n,e=+e,t=(s=arguments.length)<2?(e=n,n=0,1):s<3?1:+t;for(var r=-1,s=Math.max(0,Math.ceil((e-n)/t))|0,a=new Array(s);++r<s;)a[r]=n+r*t;return a}function cl(n,e){switch(arguments.length){case 0:break;case 1:this.range(n);break;default:this.range(e).domain(n);break}return this}function lu(n,e){switch(arguments.length){case 0:break;case 1:{typeof n=="function"?this.interpolator(n):this.range(n);break}default:{this.domain(n),typeof e=="function"?this.interpolator(e):this.range(e);break}}return this}
vendor: 5,535 bytes, line 4704
4704const JI=Symbol("implicit");function NR(){var n=new AU,e=[],t=[],r=JI;function s(a){let o=n.get(a);if(o===void 0){if(r!==JI)return r;n.set(a,o=e.push(a)-1)}return t[o%t.length]}return s.domain=function(a){if(!arguments.length)return e.slice();e=[],n=new AU;for(const o of a)n.has(o)||n.set(o,e.push(o)-1);return s},s.range=function(a){return arguments.length?(t=Array.from(a),s):t.slice()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return NR(e,t).unknown(r)},cl.apply(s,arguments),s}function _R(){var n=NR().unknown(void 0),e=n.domain,t=n.range,r=0,s=1,a,o,l=!1,c=0,d=0,h=.5;delete n.unknown;function m(){var p=e().length,x=s<r,y=x?s:r,v=x?r:s;a=(v-y)/Math.max(1,p-c+d*2),l&&(a=Math.floor(a)),y+=(v-y-a*(p-c))*h,o=a*(1-c),l&&(y=Math.round(y),o=Math.round(o));var B=rAe(p).map(function(E){return y+a*E});return t(x?B.reverse():B)}return n.domain=function(p){return arguments.length?(e(p),m()):e()},n.range=function(p){return arguments.length?([r,s]=p,r=+r,s=+s,m()):[r,s]},n.rangeRound=function(p){return[r,s]=p,r=+r,s=+s,l=!0,m()},n.bandwidth=function(){return o},n.step=function(){return a},n.round=function(p){return arguments.length?(l=!!p,m()):l},n.padding=function(p){return arguments.length?(c=Math.min(1,d=+p),m()):c},n.paddingInner=function(p){return arguments.length?(c=Math.min(1,p),m()):c},n.paddingOuter=function(p){return arguments.length?(d=+p,m()):d},n.align=function(p){return arguments.length?(h=Math.max(0,Math.min(1,p)),m()):h},n.copy=function(){return _R(e(),[r,s]).round(l).paddingInner(c).paddingOuter(d).align(h)},cl.apply(m(),arguments)}function KQ(n){var e=n.copy;return n.padding=n.paddingOuter,delete n.paddingInner,delete n.paddingOuter,n.copy=function(){return KQ(e())},n}function sAe(){return KQ(_R.apply(null,arguments).paddingInner(1))}function IR(n,e,t){n.prototype=e.prototype=t,t.constructor=n}function WQ(n,e){var t=Object.create(n.prototype);for(var r in e)t[r]=e[r];return t}function Ov(){}var Iy=.7,qE=1/Iy,L0="\\s*([+-]?\\d+)\\s*",Dy="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)\\s*",Lc="\\s*([+-]?(?:\\d*\\.)?\\d+(?:[eE][+-]?\\d+)?)%\\s*",aAe=/^#([0-9a-f]{3,8})$/,iAe=new RegExp(`^rgb\\(${L0},${L0},${L0}\\)$`),oAe=new RegExp(`^rgb\\(${Lc},${Lc},${Lc}\\)$`),lAe=new RegExp(`^rgba\\(${L0},${L0},${L0},${Dy}\\)$`),cAe=new RegExp(`^rgba\\(${Lc},${Lc},${Lc},${Dy}\\)$`),dAe=new RegExp(`^hsl\\(${Dy},${Lc},${Lc}\\)$`),uAe=new RegExp(`^hsla\\(${Dy},${Lc},${Lc},${Dy}\\)$`),IU={aliceblue:15792383,antiquewhite:16444375,aqua:65535,aquamarine:8388564,azure:15794175,beige:16119260,bisque:16770244,black:0,blanchedalmond:16772045,blue:255,blueviolet:9055202,brown:10824234,burlywood:14596231,cadetblue:6266528,chartreuse:8388352,chocolate:13789470,coral:16744272,cornflowerblue:6591981,cornsilk:16775388,crimson:14423100,cyan:65535,darkblue:139,darkcyan:35723,darkgoldenrod:12092939,darkgray:11119017,darkgreen:25600,darkgrey:11119017,darkkhaki:12433259,darkmagenta:9109643,darkolivegreen:5597999,darkorange:16747520,darkorchid:10040012,darkred:9109504,darksalmon:15308410,darkseagreen:9419919,darkslateblue:4734347,darkslategray:3100495,darkslategrey:3100495,darkturquoise:52945,darkviolet:9699539,deeppink:16716947,deepskyblue:49151,dimgray:6908265,dimgrey:6908265,dodgerblue:2003199,firebrick:11674146,floralwhite:16775920,forestgreen:2263842,fuchsia:16711935,gainsboro:14474460,ghostwhite:16316671,gold:16766720,goldenrod:14329120,gray:8421504,green:32768,greenyellow:11403055,grey:8421504,honeydew:15794160,hotpink:16738740,indianred:13458524,indigo:4915330,ivory:16777200,khaki:15787660,lavender:15132410,lavenderblush:16773365,lawngreen:8190976,lemonchiffon:16775885,lightblue:11393254,lightcoral:15761536,lightcyan:14745599,lightgoldenrodyellow:16448210,lightgray:13882323,lightgreen:9498256,lightgrey:13882323,lightpink:16758465,lightsalmon:16752762,lightseagreen:2142890,lightskyblue:8900346,lightslategray:7833753,lightslategrey:7833753,lightsteelblue:11584734,lightyellow:16777184,lime:65280,limegreen:3329330,linen:16445670,magenta:16711935,maroon:8388608,mediumaquamarine:6737322,mediumblue:205,mediumorchid:12211667,mediumpurple:9662683,mediumseagreen:3978097,mediumslateblue:8087790,mediumspringgreen:64154,mediumturquoise:4772300,mediumvioletred:13047173,midnightblue:1644912,mintcream:16121850,mistyrose:16770273,moccasin:16770229,navajowhite:16768685,navy:128,oldlace:16643558,olive:8421376,olivedrab:7048739,orange:16753920,orangered:16729344,orchid:14315734,palegoldenrod:15657130,palegreen:10025880,paleturquoise:11529966,palevioletred:14381203,papayawhip:16773077,peachpuff:16767673,peru:13468991,pink:16761035,plum:14524637,powderblue:11591910,purple:8388736,rebeccapurple:6697881,red:16711680,rosybrown:12357519,royalblue:4286945,saddlebrown:9127187,salmon:16416882,sandybrown:16032864,seagreen:3050327,seashell:16774638,sienna:10506797,silver:12632256,skyblue:8900331,slateblue:6970061,slategray:7372944,slategrey:7372944,snow:16775930,springgreen:65407,steelblue:4620980,tan:13808780,teal:32896,thistle:14204888,tomato:16737095,turquoise:4251856,violet:15631086,wheat:16113331,white:16777215,whitesmoke:16119285,yellow:16776960,yellowgreen:10145074};IR(Ov,jy,{copy(n){return Object.assign(new this.constructor,this,n)},displayable(){return this.rgb().displayable()},hex:DU,formatHex:DU,formatHex8:hAe,formatHsl:fAe,formatRgb:jU,toString:jU});function DU(){return this.rgb().formatHex()}function hAe(){return this.rgb().formatHex8()}function fAe(){return YQ(this).formatHsl()}function jU(){return this.rgb().formatRgb()}function jy(n){var e,t;
vendor: 17,786 bytes, line 4704
4704return n=(n+"").trim().toLowerCase(),(e=aAe.exec(n))?(t=e[1].length,e=parseInt(e[1],16),t===6?RU(e):t===3?new $i(e>>8&15|e>>4&240,e>>4&15|e&240,(e&15)<<4|e&15,1):t===8?Ew(e>>24&255,e>>16&255,e>>8&255,(e&255)/255):t===4?Ew(e>>12&15|e>>8&240,e>>8&15|e>>4&240,e>>4&15|e&240,((e&15)<<4|e&15)/255):null):(e=iAe.exec(n))?new $i(e[1],e[2],e[3],1):(e=oAe.exec(n))?new $i(e[1]*255/100,e[2]*255/100,e[3]*255/100,1):(e=lAe.exec(n))?Ew(e[1],e[2],e[3],e[4]):(e=cAe.exec(n))?Ew(e[1]*255/100,e[2]*255/100,e[3]*255/100,e[4]):(e=dAe.exec(n))?OU(e[1],e[2]/100,e[3]/100,1):(e=uAe.exec(n))?OU(e[1],e[2]/100,e[3]/100,e[4]):IU.hasOwnProperty(n)?RU(IU[n]):n==="transparent"?new $i(NaN,NaN,NaN,0):null}function RU(n){return new $i(n>>16&255,n>>8&255,n&255,1)}function Ew(n,e,t,r){return r<=0&&(n=e=t=NaN),new $i(n,e,t,r)}function mAe(n){return n instanceof Ov||(n=jy(n)),n?(n=n.rgb(),new $i(n.r,n.g,n.b,n.opacity)):new $i}function XI(n,e,t,r){return arguments.length===1?mAe(n):new $i(n,e,t,r??1)}function $i(n,e,t,r){this.r=+n,this.g=+e,this.b=+t,this.opacity=+r}IR($i,XI,WQ(Ov,{brighter(n){return n=n==null?qE:Math.pow(qE,n),new $i(this.r*n,this.g*n,this.b*n,this.opacity)},darker(n){return n=n==null?Iy:Math.pow(Iy,n),new $i(this.r*n,this.g*n,this.b*n,this.opacity)},rgb(){return this},clamp(){return new $i(xm(this.r),xm(this.g),xm(this.b),KE(this.opacity))},displayable(){return-.5<=this.r&&this.r<255.5&&-.5<=this.g&&this.g<255.5&&-.5<=this.b&&this.b<255.5&&0<=this.opacity&&this.opacity<=1},hex:PU,formatHex:PU,formatHex8:pAe,formatRgb:LU,toString:LU}));function PU(){return`#${sm(this.r)}${sm(this.g)}${sm(this.b)}`}function pAe(){return`#${sm(this.r)}${sm(this.g)}${sm(this.b)}${sm((isNaN(this.opacity)?1:this.opacity)*255)}`}function LU(){const n=KE(this.opacity);return`${n===1?"rgb(":"rgba("}${xm(this.r)}, ${xm(this.g)}, ${xm(this.b)}${n===1?")":`, ${n})`}`}function KE(n){return isNaN(n)?1:Math.max(0,Math.min(1,n))}function xm(n){return Math.max(0,Math.min(255,Math.round(n)||0))}function sm(n){return n=xm(n),(n<16?"0":"")+n.toString(16)}function OU(n,e,t,r){return r<=0?n=e=t=NaN:t<=0||t>=1?n=e=NaN:e<=0&&(n=NaN),new Rl(n,e,t,r)}function YQ(n){if(n instanceof Rl)return new Rl(n.h,n.s,n.l,n.opacity);if(n instanceof Ov||(n=jy(n)),!n)return new Rl;if(n instanceof Rl)return n;n=n.rgb();var e=n.r/255,t=n.g/255,r=n.b/255,s=Math.min(e,t,r),a=Math.max(e,t,r),o=NaN,l=a-s,c=(a+s)/2;return l?(e===a?o=(t-r)/l+(t<r)*6:t===a?o=(r-e)/l+2:o=(e-t)/l+4,l/=c<.5?a+s:2-a-s,o*=60):l=c>0&&c<1?0:o,new Rl(o,l,c,n.opacity)}function gAe(n,e,t,r){return arguments.length===1?YQ(n):new Rl(n,e,t,r??1)}function Rl(n,e,t,r){this.h=+n,this.s=+e,this.l=+t,this.opacity=+r}IR(Rl,gAe,WQ(Ov,{brighter(n){return n=n==null?qE:Math.pow(qE,n),new Rl(this.h,this.s,this.l*n,this.opacity)},darker(n){return n=n==null?Iy:Math.pow(Iy,n),new Rl(this.h,this.s,this.l*n,this.opacity)},rgb(){var n=this.h%360+(this.h<0)*360,e=isNaN(n)||isNaN(this.s)?0:this.s,t=this.l,r=t+(t<.5?t:1-t)*e,s=2*t-r;return new $i(xN(n>=240?n-240:n+120,s,r),xN(n,s,r),xN(n<120?n+240:n-120,s,r),this.opacity)},clamp(){return new Rl(MU(this.h),Sw(this.s),Sw(this.l),KE(this.opacity))},displayable(){return(0<=this.s&&this.s<=1||isNaN(this.s))&&0<=this.l&&this.l<=1&&0<=this.opacity&&this.opacity<=1},formatHsl(){const n=KE(this.opacity);return`${n===1?"hsl(":"hsla("}${MU(this.h)}, ${Sw(this.s)*100}%, ${Sw(this.l)*100}%${n===1?")":`, ${n})`}`}}));function MU(n){return n=(n||0)%360,n<0?n+360:n}function Sw(n){return Math.max(0,Math.min(1,n||0))}function xN(n,e,t){return(n<60?e+(t-e)*n/60:n<180?t:n<240?e+(t-e)*(240-n)/60:e)*255}const DR=n=>()=>n;function xAe(n,e){return function(t){return n+t*e}}function bAe(n,e,t){return n=Math.pow(n,t),e=Math.pow(e,t)-n,t=1/t,function(r){return Math.pow(n+r*e,t)}}function yAe(n){return(n=+n)==1?QQ:function(e,t){return t-e?bAe(e,t,n):DR(isNaN(e)?t:e)}}function QQ(n,e){var t=e-n;return t?xAe(n,t):DR(isNaN(n)?e:n)}const FU=(function n(e){var t=yAe(e);function r(s,a){var o=t((s=XI(s)).r,(a=XI(a)).r),l=t(s.g,a.g),c=t(s.b,a.b),d=QQ(s.opacity,a.opacity);return function(h){return s.r=o(h),s.g=l(h),s.b=c(h),s.opacity=d(h),s+""}}return r.gamma=n,r})(1);function vAe(n,e){e||(e=[]);var t=n?Math.min(e.length,n.length):0,r=e.slice(),s;return function(a){for(s=0;s<t;++s)r[s]=n[s]*(1-a)+e[s]*a;return r}}function BAe(n){return ArrayBuffer.isView(n)&&!(n instanceof DataView)}function wAe(n,e){var t=e?e.length:0,r=n?Math.min(t,n.length):0,s=new Array(r),a=new Array(t),o;for(o=0;o<r;++o)s[o]=nx(n[o],e[o]);for(;o<t;++o)a[o]=e[o];return function(l){for(o=0;o<r;++o)a[o]=s[o](l);return a}}function CAe(n,e){var t=new Date;return n=+n,e=+e,function(r){return t.setTime(n*(1-r)+e*r),t}}function WE(n,e){return n=+n,e=+e,function(t){return n*(1-t)+e*t}}function EAe(n,e){var t={},r={},s;(n===null||typeof n!="object")&&(n={}),(e===null||typeof e!="object")&&(e={});for(s in e)s in n?t[s]=nx(n[s],e[s]):r[s]=e[s];return function(a){for(s in t)r[s]=t[s](a);return r}}var ZI=/[-+]?(?:\d+\.?\d*|\.?\d+)(?:[eE][-+]?\d+)?/g,bN=new RegExp(ZI.source,"g");function SAe(n){return function(){return n}}function TAe(n){return function(e){return n(e)+""}}function AAe(n,e){var t=ZI.lastIndex=bN.lastIndex=0,r,s,a,o=-1,l=[],c=[];for(n=n+"",e=e+"";(r=ZI.exec(n))&&(s=bN.exec(e));)(a=s.index)>t&&(a=e.slice(t,a),l[o]?l[o]+=a:l[++o]=a),(r=r[0])===(s=s[0])?l[o]?l[o]+=s:l[++o]=s:(l[++o]=null,c.push({i:o,x:WE(r,s)})),t=bN.lastIndex;return t<e.length&&(a=e.slice(t),l[o]?l[o]+=a:l[++o]=a),l.length<2?c[0]?TAe(c[0].x):SAe(e):(e=c.length,function(d){for(var h=0,m;h<e;++h)l[(m=c[h]).i]=m.x(d);return l.join("")})}function nx(n,e){var t=typeof e,r;return e==null||t==="boolean"?DR(e):(t==="number"?WE:t==="string"?(r=jy(e))?(e=r,FU):AAe:e instanceof jy?FU:e instanceof Date?CAe:BAe(e)?vAe:Array.isArray(e)?wAe:typeof e.valueOf!="function"&&typeof e.toString!="function"||isNaN(e)?EAe:WE)(n,e)}function jR(n,e){return n=+n,e=+e,function(t){return Math.round(n*(1-t)+e*t)}}function kAe(n,e){e===void 0&&(e=n,n=nx);for(var t=0,r=e.length-1,s=e[0],a=new Array(r<0?0:r);t<r;)a[t]=n(s,s=e[++t]);return function(o){var l=Math.max(0,Math.min(r-1,Math.floor(o*=r)));return a[l](o-l)}}function NAe(n){return function(){return n}}function YE(n){return+n}var UU=[0,1];function mi(n){return n}function eD(n,e){return(e-=n=+n)?function(t){return(t-n)/e}:NAe(isNaN(e)?NaN:.5)}function _Ae(n,e){var t;return n>e&&(t=n,n=e,e=t),function(r){return Math.max(n,Math.min(e,r))}}function IAe(n,e,t){var r=n[0],s=n[1],a=e[0],o=e[1];return s<r?(r=eD(s,r),a=t(o,a)):(r=eD(r,s),a=t(a,o)),function(l){return a(r(l))}}function DAe(n,e,t){var r=Math.min(n.length,e.length)-1,s=new Array(r),a=new Array(r),o=-1;for(n[r]<n[0]&&(n=n.slice().reverse(),e=e.slice().reverse());++o<r;)s[o]=eD(n[o],n[o+1]),a[o]=t(e[o],e[o+1]);return function(l){var c=Lv(n,l,1,r)-1;return a[c](s[c](l))}}function Mv(n,e){return e.domain(n.domain()).range(n.range()).interpolate(n.interpolate()).clamp(n.clamp()).unknown(n.unknown())}function KS(){var n=UU,e=UU,t=nx,r,s,a,o=mi,l,c,d;function h(){var p=Math.min(n.length,e.length);return o!==mi&&(o=_Ae(n[0],n[p-1])),l=p>2?DAe:IAe,c=d=null,m}function m(p){return p==null||isNaN(p=+p)?a:(c||(c=l(n.map(r),e,t)))(r(o(p)))}return m.invert=function(p){return o(s((d||(d=l(e,n.map(r),WE)))(p)))},m.domain=function(p){return arguments.length?(n=Array.from(p,YE),h()):n.slice()},m.range=function(p){return arguments.length?(e=Array.from(p),h()):e.slice()},m.rangeRound=function(p){return e=Array.from(p),t=jR,h()},m.clamp=function(p){return arguments.length?(o=p?!0:mi,h()):o!==mi},m.interpolate=function(p){return arguments.length?(t=p,h()):t},m.unknown=function(p){return arguments.length?(a=p,m):a},function(p,x){return r=p,s=x,h()}}function RR(){return KS()(mi,mi)}function jAe(n){return Math.abs(n=Math.round(n))>=1e21?n.toLocaleString("en").replace(/,/g,""):n.toString(10)}function QE(n,e){if(!isFinite(n)||n===0)return null;var t=(n=e?n.toExponential(e-1):n.toExponential()).indexOf("e"),r=n.slice(0,t);return[r.length>1?r[0]+r.slice(2):r,+n.slice(t+1)]}function Bg(n){return n=QE(Math.abs(n)),n?n[1]:NaN}function RAe(n,e){return function(t,r){for(var s=t.length,a=[],o=0,l=n[0],c=0;s>0&&l>0&&(c+l+1>r&&(l=Math.max(1,r-c)),a.push(t.substring(s-=l,s+l)),!((c+=l+1)>r));)l=n[o=(o+1)%n.length];return a.reverse().join(e)}}function PAe(n){return function(e){return e.replace(/[0-9]/g,function(t){return n[+t]})}}var LAe=/^(?:(.)?([<>=^]))?([+\-( ])?([$#])?(0)?(\d+)?(,)?(\.\d+)?(~)?([a-z%])?$/i;function Ry(n){if(!(e=LAe.exec(n)))throw new Error("invalid format: "+n);var e;return new PR({fill:e[1],align:e[2],sign:e[3],symbol:e[4],zero:e[5],width:e[6],comma:e[7],precision:e[8]&&e[8].slice(1),trim:e[9],type:e[10]})}Ry.prototype=PR.prototype;function PR(n){this.fill=n.fill===void 0?" ":n.fill+"",this.align=n.align===void 0?">":n.align+"",this.sign=n.sign===void 0?"-":n.sign+"",this.symbol=n.symbol===void 0?"":n.symbol+"",this.zero=!!n.zero,this.width=n.width===void 0?void 0:+n.width,this.comma=!!n.comma,this.precision=n.precision===void 0?void 0:+n.precision,this.trim=!!n.trim,this.type=n.type===void 0?"":n.type+""}PR.prototype.toString=function(){return this.fill+this.align+this.sign+this.symbol+(this.zero?"0":"")+(this.width===void 0?"":Math.max(1,this.width|0))+(this.comma?",":"")+(this.precision===void 0?"":"."+Math.max(0,this.precision|0))+(this.trim?"~":"")+this.type};function OAe(n){e:for(var e=n.length,t=1,r=-1,s;t<e;++t)switch(n[t]){case".":r=s=t;break;case"0":r===0&&(r=t),s=t;break;default:if(!+n[t])break e;r>0&&(r=0);break}return r>0?n.slice(0,r)+n.slice(s+1):n}var JE;function MAe(n,e){var t=QE(n,e);if(!t)return JE=void 0,n.toPrecision(e);var r=t[0],s=t[1],a=s-(JE=Math.max(-8,Math.min(8,Math.floor(s/3)))*3)+1,o=r.length;return a===o?r:a>o?r+new Array(a-o+1).join("0"):a>0?r.slice(0,a)+"."+r.slice(a):"0."+new Array(1-a).join("0")+QE(n,Math.max(0,e+a-1))[0]}function VU(n,e){var t=QE(n,e);if(!t)return n+"";var r=t[0],s=t[1];return s<0?"0."+new Array(-s).join("0")+r:r.length>s+1?r.slice(0,s+1)+"."+r.slice(s+1):r+new Array(s-r.length+2).join("0")}const GU={"%":(n,e)=>(n*100).toFixed(e),b:n=>Math.round(n).toString(2),c:n=>n+"",d:jAe,e:(n,e)=>n.toExponential(e),f:(n,e)=>n.toFixed(e),g:(n,e)=>n.toPrecision(e),o:n=>Math.round(n).toString(8),p:(n,e)=>VU(n*100,e),r:VU,s:MAe,X:n=>Math.round(n).toString(16).toUpperCase(),x:n=>Math.round(n).toString(16)};function $U(n){return n}var HU=Array.prototype.map,zU=["y","z","a","f","p","n","µ","m","","k","M","G","T","P","E","Z","Y"];function FAe(n){var e=n.grouping===void 0||n.thousands===void 0?$U:RAe(HU.call(n.grouping,Number),n.thousands+""),t=n.currency===void 0?"":n.currency[0]+"",r=n.currency===void 0?"":n.currency[1]+"",s=n.decimal===void 0?".":n.decimal+"",a=n.numerals===void 0?$U:PAe(HU.call(n.numerals,String)),o=n.percent===void 0?"%":n.percent+"",l=n.minus===void 0?"−":n.minus+"",c=n.nan===void 0?"NaN":n.nan+"";function d(m,p){m=Ry(m);var x=m.fill,y=m.align,v=m.sign,B=m.symbol,E=m.zero,N=m.width,T=m.comma,k=m.precision,P=m.trim,R=m.type;R==="n"?(T=!0,R="g"):GU[R]||(k===void 0&&(k=12),P=!0,R="g"),(E||x==="0"&&y==="=")&&(E=!0,x="0",y="=");var _=(p&&p.prefix!==void 0?p.prefix:"")+(B==="$"?t:B==="#"&&/[boxX]/.test(R)?"0"+R.toLowerCase():""),I=(B==="$"?r:/[%p]/.test(R)?o:"")+(p&&p.suffix!==void 0?p.suffix:""),D=GU[R],j=/[defgprs%]/.test(R);k=k===void 0?6:/[gprs]/.test(R)?Math.max(1,Math.min(21,k)):Math.max(0,Math.min(20,k));function O(M){var U=_,ee=I,ie,G,Z;if(R==="c")ee=D(M)+ee,M="";else{M=+M;var z=M<0||1/M<0;if(M=isNaN(M)?c:D(Math.abs(M),k),P&&(M=OAe(M)),z&&+M==0&&v!=="+"&&(z=!1),U=(z?v==="("?v:l:v==="-"||v==="("?"":v)+U,ee=(R==="s"&&!isNaN(M)&&JE!==void 0?zU[8+JE/3]:"")+ee+(z&&v==="("?")":""),j){for(ie=-1,G=M.length;++ie<G;)if(Z=M.charCodeAt(ie),48>Z||Z>57){ee=(Z===46?s+M.slice(ie+1):M.slice(ie))+ee,M=M.slice(0,ie);break}}}T&&!E&&(M=e(M,1/0));var se=U.length+M.length+ee.length,re=se<N?new Array(N-se+1).join(x):"";switch(T&&E&&(M=e(re+M,re.length?N-ee.length:1/0),re=""),y){case"<":M=U+M+ee+re;break;case"=":M=U+re+M+ee;break;case"^":M=re.slice(0,se=re.length>>1)+U+M+ee+re.slice(se);break;default:M=re+U+M+ee;break}return a(M)}return O.toString=function(){return m+""},O}function h(m,p){var x=Math.max(-8,Math.min(8,Math.floor(Bg(p)/3)))*3,y=Math.pow(10,-x),v=d((m=Ry(m),m.type="f",m),{suffix:zU[8+x/3]});return function(B){return v(y*B)}}return{format:d,formatPrefix:h}}var Tw,LR,JQ;UAe({thousands:",",grouping:[3],currency:["$",""]});function UAe(n){return Tw=FAe(n),LR=Tw.format,JQ=Tw.formatPrefix,Tw}function VAe(n){return Math.max(0,-Bg(Math.abs(n)))}function GAe(n,e){return Math.max(0,Math.max(-8,Math.min(8,Math.floor(Bg(e)/3)))*3-Bg(Math.abs(n)))}function $Ae(n,e){return n=Math.abs(n),e=Math.abs(e)-n,Math.max(0,Bg(e)-Bg(n))+1}function XQ(n,e,t,r){var s=QI(n,e,t),a;switch(r=Ry(r??",f"),r.type){case"s":{var o=Math.max(Math.abs(n),Math.abs(e));return r.precision==null&&!isNaN(a=GAe(s,o))&&(r.precision=a),JQ(r,o)}case"":case"e":case"g":case"p":case"r":{r.precision==null&&!isNaN(a=$Ae(s,Math.max(Math.abs(n),Math.abs(e))))&&(r.precision=a-(r.type==="e"));break}case"f":case"%":{r.precision==null&&!isNaN(a=VAe(s))&&(r.precision=a-(r.type==="%")*2);break}}return LR(r)}function Zh(n){var e=n.domain;return n.ticks=function(t){var r=e();return WI(r[0],r[r.length-1],t??10)},n.tickFormat=function(t,r){var s=e();return XQ(s[0],s[s.length-1],t??10,r)},n.nice=function(t){t==null&&(t=10);var r=e(),s=0,a=r.length-1,o=r[s],l=r[a],c,d,h=10;for(l<o&&(d=o,o=l,l=d,d=s,s=a,a=d);h-- >0;){if(d=YI(o,l,t),d===c)return r[s]=o,r[a]=l,e(r);if(d>0)o=Math.floor(o/d)*d,l=Math.ceil(l/d)*d;else if(d<0)o=Math.ceil(o*d)/d,l=Math.floor(l*d)/d;else break;c=d}return n},n}function ZQ(){var n=RR();return n.copy=function(){return Mv(n,ZQ())},cl.apply(n,arguments),Zh(n)}function eJ(n){var e;function t(r){return r==null||isNaN(r=+r)?e:r}return t.invert=t,t.domain=t.range=function(r){return arguments.length?(n=Array.from(r,YE),t):n.slice()},t.unknown=function(r){return arguments.length?(e=r,t):e},t.copy=function(){return eJ(n).unknown(e)},n=arguments.length?Array.from(n,YE):[0,1],Zh(t)}function tJ(n,e){n=n.slice();var t=0,r=n.length-1,s=n[t],a=n[r],o;return a<s&&(o=t,t=r,r=o,o=s,s=a,a=o),n[t]=e.floor(s),n[r]=e.ceil(a),n}function qU(n){return Math.log(n)}function KU(n){return Math.exp(n)}function HAe(n){return-Math.log(-n)}function zAe(n){return-Math.exp(-n)}function qAe(n){return isFinite(n)?+("1e"+n):n<0?0:n}function KAe(n){return n===10?qAe:n===Math.E?Math.exp:e=>Math.pow(n,e)}function WAe(n){return n===Math.E?Math.log:n===10&&Math.log10||n===2&&Math.log2||(n=Math.log(n),e=>Math.log(e)/n)}function WU(n){return(e,t)=>-n(-e,t)}function OR(n){const e=n(qU,KU),t=e.domain;let r=10,s,a;function o(){return s=WAe(r),a=KAe(r),t()[0]<0?(s=WU(s),a=WU(a),n(HAe,zAe)):n(qU,KU),e}return e.base=function(l){return arguments.length?(r=+l,o()):r},e.domain=function(l){return arguments.length?(t(l),o()):t()},e.ticks=l=>{const c=t();let d=c[0],h=c[c.length-1];const m=h<d;m&&([d,h]=[h,d]);let p=s(d),x=s(h),y,v;const B=l==null?10:+l;let E=[];if(!(r%1)&&x-p<B){if(p=Math.floor(p),x=Math.ceil(x),d>0){for(;p<=x;++p)for(y=1;y<r;++y)if(v=p<0?y/a(-p):y*a(p),!(v<d)){if(v>h)break;E.push(v)}}else for(;p<=x;++p)for(y=r-1;y>=1;--y)if(v=p>0?y/a(-p):y*a(p),!(v<d)){if(v>h)break;E.push(v)}E.length*2<B&&(E=WI(d,h,B))}else E=WI(p,x,Math.min(x-p,B)).map(a);return m?E.reverse():E},e.tickFormat=(l,c)=>{if(l==null&&(l=10),c==null&&(c=r===10?"s":","),typeof c!="function"&&(!(r%1)&&(c=Ry(c)).precision==null&&(c.trim=!0),c=LR(c)),l===1/0)return c;const d=Math.max(1,r*l/e.ticks().length);return h=>{let m=h/a(Math.round(s(h)));return m*r<r-.5&&(m*=r),m<=d?c(h):""}},e.nice=()=>t(tJ(t(),{floor:l=>a(Math.floor(s(l))),ceil:l=>a(Math.ceil(s(l)))})),e}function nJ(){const n=OR(KS()).domain([1,10]);return n.copy=()=>Mv(n,nJ()).base(n.base()),cl.apply(n,arguments),n}function YU(n){return function(e){return Math.sign(e)*Math.log1p(Math.abs(e/n))}}function QU(n){return function(e){return Math.sign(e)*Math.expm1(Math.abs(e))*n}}function MR(n){var e=1,t=n(YU(e),QU(e));return t.constant=function(r){return arguments.length?n(YU(e=+r),QU(e)):e},Zh(t)}function rJ(){var n=MR(KS());return n.copy=function(){return Mv(n,rJ()).constant(n.constant())},cl.apply(n,arguments)}function JU(n){return function(e){return e<0?-Math.pow(-e,n):Math.pow(e,n)}}function YAe(n){return n<0?-Math.sqrt(-n):Math.sqrt(n)}function QAe(n){return n<0?-n*n:n*n}function FR(n){var e=n(mi,mi),t=1;function r(){return t===1?n(mi,mi):t===.5?n(YAe,QAe):n(JU(t),JU(1/t))}return e.exponent=function(s){return arguments.length?(t=+s,r()):t},Zh(e)}function UR(){var n=FR(KS());return n.copy=function(){return Mv(n,UR()).exponent(n.exponent())},cl.apply(n,arguments),n}function JAe(){return UR.apply(null,arguments).exponent(.5)}function XU(n){return Math.sign(n)*n*n}function XAe(n){return Math.sign(n)*Math.sqrt(Math.abs(n))}function sJ(){var n=RR(),e=[0,1],t=!1,r;function s(a){var o=XAe(n(a));return isNaN(o)?r:t?Math.round(o):o}return s.invert=function(a){return n.invert(XU(a))},s.domain=function(a){return arguments.length?(n.domain(a),s):n.domain()},s.range=function(a){return arguments.length?(n.range((e=Array.from(a,YE)).map(XU)),s):e.slice()},s.rangeRound=function(a){return s.range(a).round(!0)},s.round=function(a){return arguments.length?(t=!!a,s):t},s.clamp=function(a){return arguments.length?(n.clamp(a),s):n.clamp()},s.unknown=function(a){return arguments.length?(r=a,s):r},s.copy=function(){return sJ(n.domain(),e).round(t).clamp(n.clamp()).unknown(r)},cl.apply(s,arguments),Zh(s)}function aJ(){var n=[],e=[],t=[],r;function s(){var o=0,l=Math.max(1,e.length);for(t=new Array(l-1);++o<l;)t[o-1]=nAe(n,o/l);return a}function a(o){return o==null||isNaN(o=+o)?r:e[Lv(t,o)]}return a.invertExtent=function(o){var l=e.indexOf(o);return l<0?[NaN,NaN]:[l>0?t[l-1]:n[0],l<t.length?t[l]:n[n.length-1]]}
vendor: 13,127 bytes, line 4704
4704,a.domain=function(o){if(!arguments.length)return n.slice();n=[];for(let l of o)l!=null&&!isNaN(l=+l)&&n.push(l);return n.sort(wh),s()},a.range=function(o){return arguments.length?(e=Array.from(o),s()):e.slice()},a.unknown=function(o){return arguments.length?(r=o,a):r},a.quantiles=function(){return t.slice()},a.copy=function(){return aJ().domain(n).range(e).unknown(r)},cl.apply(a,arguments)}function iJ(){var n=0,e=1,t=1,r=[.5],s=[0,1],a;function o(c){return c!=null&&c<=c?s[Lv(r,c,0,t)]:a}function l(){var c=-1;for(r=new Array(t);++c<t;)r[c]=((c+1)*e-(c-t)*n)/(t+1);return o}return o.domain=function(c){return arguments.length?([n,e]=c,n=+n,e=+e,l()):[n,e]},o.range=function(c){return arguments.length?(t=(s=Array.from(c)).length-1,l()):s.slice()},o.invertExtent=function(c){var d=s.indexOf(c);return d<0?[NaN,NaN]:d<1?[n,r[0]]:d>=t?[r[t-1],e]:[r[d-1],r[d]]},o.unknown=function(c){return arguments.length&&(a=c),o},o.thresholds=function(){return r.slice()},o.copy=function(){return iJ().domain([n,e]).range(s).unknown(a)},cl.apply(Zh(o),arguments)}function oJ(){var n=[.5],e=[0,1],t,r=1;function s(a){return a!=null&&a<=a?e[Lv(n,a,0,r)]:t}return s.domain=function(a){return arguments.length?(n=Array.from(a),r=Math.min(n.length,e.length-1),s):n.slice()},s.range=function(a){return arguments.length?(e=Array.from(a),r=Math.min(n.length,e.length-1),s):e.slice()},s.invertExtent=function(a){var o=e.indexOf(a);return[n[o-1],n[o]]},s.unknown=function(a){return arguments.length?(t=a,s):t},s.copy=function(){return oJ().domain(n).range(e).unknown(t)},cl.apply(s,arguments)}const yN=new Date,vN=new Date;function na(n,e,t,r){function s(a){return n(a=arguments.length===0?new Date:new Date(+a)),a}return s.floor=a=>(n(a=new Date(+a)),a),s.ceil=a=>(n(a=new Date(a-1)),e(a,1),n(a),a),s.round=a=>{const o=s(a),l=s.ceil(a);return a-o<l-a?o:l},s.offset=(a,o)=>(e(a=new Date(+a),o==null?1:Math.floor(o)),a),s.range=(a,o,l)=>{const c=[];if(a=s.ceil(a),l=l==null?1:Math.floor(l),!(a<o)||!(l>0))return c;let d;do c.push(d=new Date(+a)),e(a,l),n(a);while(d<a&&a<o);return c},s.filter=a=>na(o=>{if(o>=o)for(;n(o),!a(o);)o.setTime(o-1)},(o,l)=>{if(o>=o)if(l<0)for(;++l<=0;)for(;e(o,-1),!a(o););else for(;--l>=0;)for(;e(o,1),!a(o););}),t&&(s.count=(a,o)=>(yN.setTime(+a),vN.setTime(+o),n(yN),n(vN),Math.floor(t(yN,vN))),s.every=a=>(a=Math.floor(a),!isFinite(a)||!(a>0)?null:a>1?s.filter(r?o=>r(o)%a===0:o=>s.count(0,o)%a===0):s)),s}const XE=na(()=>{},(n,e)=>{n.setTime(+n+e)},(n,e)=>e-n);XE.every=n=>(n=Math.floor(n),!isFinite(n)||!(n>0)?null:n>1?na(e=>{e.setTime(Math.floor(e/n)*n)},(e,t)=>{e.setTime(+e+t*n)},(e,t)=>(t-e)/n):XE);XE.range;const jd=1e3,Zo=jd*60,Rd=Zo*60,Qd=Rd*24,VR=Qd*7,ZU=Qd*30,BN=Qd*365,am=na(n=>{n.setTime(n-n.getMilliseconds())},(n,e)=>{n.setTime(+n+e*jd)},(n,e)=>(e-n)/jd,n=>n.getUTCSeconds());am.range;const GR=na(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*jd)},(n,e)=>{n.setTime(+n+e*Zo)},(n,e)=>(e-n)/Zo,n=>n.getMinutes());GR.range;const $R=na(n=>{n.setUTCSeconds(0,0)},(n,e)=>{n.setTime(+n+e*Zo)},(n,e)=>(e-n)/Zo,n=>n.getUTCMinutes());$R.range;const HR=na(n=>{n.setTime(n-n.getMilliseconds()-n.getSeconds()*jd-n.getMinutes()*Zo)},(n,e)=>{n.setTime(+n+e*Rd)},(n,e)=>(e-n)/Rd,n=>n.getHours());HR.range;const zR=na(n=>{n.setUTCMinutes(0,0,0)},(n,e)=>{n.setTime(+n+e*Rd)},(n,e)=>(e-n)/Rd,n=>n.getUTCHours());zR.range;const Fv=na(n=>n.setHours(0,0,0,0),(n,e)=>n.setDate(n.getDate()+e),(n,e)=>(e-n-(e.getTimezoneOffset()-n.getTimezoneOffset())*Zo)/Qd,n=>n.getDate()-1);Fv.range;const WS=na(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/Qd,n=>n.getUTCDate()-1);WS.range;const lJ=na(n=>{n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCDate(n.getUTCDate()+e)},(n,e)=>(e-n)/Qd,n=>Math.floor(n/Qd));lJ.range;function ep(n){return na(e=>{e.setDate(e.getDate()-(e.getDay()+7-n)%7),e.setHours(0,0,0,0)},(e,t)=>{e.setDate(e.getDate()+t*7)},(e,t)=>(t-e-(t.getTimezoneOffset()-e.getTimezoneOffset())*Zo)/VR)}const YS=ep(0),ZE=ep(1),ZAe=ep(2),eke=ep(3),wg=ep(4),tke=ep(5),nke=ep(6);YS.range;ZE.range;ZAe.range;eke.range;wg.range;tke.range;nke.range;function tp(n){return na(e=>{e.setUTCDate(e.getUTCDate()-(e.getUTCDay()+7-n)%7),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCDate(e.getUTCDate()+t*7)},(e,t)=>(t-e)/VR)}const QS=tp(0),e1=tp(1),rke=tp(2),ske=tp(3),Cg=tp(4),ake=tp(5),ike=tp(6);QS.range;e1.range;rke.range;ske.range;Cg.range;ake.range;ike.range;const qR=na(n=>{n.setDate(1),n.setHours(0,0,0,0)},(n,e)=>{n.setMonth(n.getMonth()+e)},(n,e)=>e.getMonth()-n.getMonth()+(e.getFullYear()-n.getFullYear())*12,n=>n.getMonth());qR.range;const KR=na(n=>{n.setUTCDate(1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCMonth(n.getUTCMonth()+e)},(n,e)=>e.getUTCMonth()-n.getUTCMonth()+(e.getUTCFullYear()-n.getUTCFullYear())*12,n=>n.getUTCMonth());KR.range;const Jd=na(n=>{n.setMonth(0,1),n.setHours(0,0,0,0)},(n,e)=>{n.setFullYear(n.getFullYear()+e)},(n,e)=>e.getFullYear()-n.getFullYear(),n=>n.getFullYear());Jd.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:na(e=>{e.setFullYear(Math.floor(e.getFullYear()/n)*n),e.setMonth(0,1),e.setHours(0,0,0,0)},(e,t)=>{e.setFullYear(e.getFullYear()+t*n)});Jd.range;const Xd=na(n=>{n.setUTCMonth(0,1),n.setUTCHours(0,0,0,0)},(n,e)=>{n.setUTCFullYear(n.getUTCFullYear()+e)},(n,e)=>e.getUTCFullYear()-n.getUTCFullYear(),n=>n.getUTCFullYear());Xd.every=n=>!isFinite(n=Math.floor(n))||!(n>0)?null:na(e=>{e.setUTCFullYear(Math.floor(e.getUTCFullYear()/n)*n),e.setUTCMonth(0,1),e.setUTCHours(0,0,0,0)},(e,t)=>{e.setUTCFullYear(e.getUTCFullYear()+t*n)});Xd.range;function cJ(n,e,t,r,s,a){const o=[[am,1,jd],[am,5,5*jd],[am,15,15*jd],[am,30,30*jd],[a,1,Zo],[a,5,5*Zo],[a,15,15*Zo],[a,30,30*Zo],[s,1,Rd],[s,3,3*Rd],[s,6,6*Rd],[s,12,12*Rd],[r,1,Qd],[r,2,2*Qd],[t,1,VR],[e,1,ZU],[e,3,3*ZU],[n,1,BN]];function l(d,h,m){const p=h<d;p&&([d,h]=[h,d]);const x=m&&typeof m.range=="function"?m:c(d,h,m),y=x?x.range(d,+h+1):[];return p?y.reverse():y}function c(d,h,m){const p=Math.abs(h-d)/m,x=kR(([,,B])=>B).right(o,p);if(x===o.length)return n.every(QI(d/BN,h/BN,m));if(x===0)return XE.every(Math.max(QI(d,h,m),1));const[y,v]=o[p/o[x-1][2]<o[x][2]/p?x-1:x];return y.every(v)}return[l,c]}const[oke,lke]=cJ(Xd,KR,QS,lJ,zR,$R),[cke,dke]=cJ(Jd,qR,YS,Fv,HR,GR);function wN(n){if(0<=n.y&&n.y<100){var e=new Date(-1,n.m,n.d,n.H,n.M,n.S,n.L);return e.setFullYear(n.y),e}return new Date(n.y,n.m,n.d,n.H,n.M,n.S,n.L)}function CN(n){if(0<=n.y&&n.y<100){var e=new Date(Date.UTC(-1,n.m,n.d,n.H,n.M,n.S,n.L));return e.setUTCFullYear(n.y),e}return new Date(Date.UTC(n.y,n.m,n.d,n.H,n.M,n.S,n.L))}function cb(n,e,t){return{y:n,m:e,d:t,H:0,M:0,S:0,L:0}}function uke(n){var e=n.dateTime,t=n.date,r=n.time,s=n.periods,a=n.days,o=n.shortDays,l=n.months,c=n.shortMonths,d=db(s),h=ub(s),m=db(a),p=ub(a),x=db(o),y=ub(o),v=db(l),B=ub(l),E=db(c),N=ub(c),T={a:Z,A:z,b:se,B:re,c:null,d:aV,e:aV,f:Rke,g:Hke,G:qke,H:Ike,I:Dke,j:jke,L:dJ,m:Pke,M:Lke,p:H,q:Y,Q:lV,s:cV,S:Oke,u:Mke,U:Fke,V:Uke,w:Vke,W:Gke,x:null,X:null,y:$ke,Y:zke,Z:Kke,"%":oV},k={a:de,A:W,b:K,B:J,c:null,d:iV,e:iV,f:Jke,g:oNe,G:cNe,H:Wke,I:Yke,j:Qke,L:hJ,m:Xke,M:Zke,p:oe,q:Ie,Q:lV,s:cV,S:eNe,u:tNe,U:nNe,V:rNe,w:sNe,W:aNe,x:null,X:null,y:iNe,Y:lNe,Z:dNe,"%":oV},P={a:j,A:O,b:M,B:U,c:ee,d:rV,e:rV,f:Ake,g:nV,G:tV,H:sV,I:sV,j:Cke,L:Tke,m:wke,M:Eke,p:D,q:Bke,Q:Nke,s:_ke,S:Ske,u:gke,U:xke,V:bke,w:pke,W:yke,x:ie,X:G,y:nV,Y:tV,Z:vke,"%":kke};T.x=R(t,T),T.X=R(r,T),T.c=R(e,T),k.x=R(t,k),k.X=R(r,k),k.c=R(e,k);function R(pe,ye){return function(he){var le=[],ce=-1,Ce=0,Ae=pe.length,je,nt,We;for(he instanceof Date||(he=new Date(+he));++ce<Ae;)pe.charCodeAt(ce)===37&&(le.push(pe.slice(Ce,ce)),(nt=eV[je=pe.charAt(++ce)])!=null?je=pe.charAt(++ce):nt=je==="e"?" ":"0",(We=ye[je])&&(je=We(he,nt)),le.push(je),Ce=ce+1);return le.push(pe.slice(Ce,ce)),le.join("")}}function _(pe,ye){return function(he){var le=cb(1900,void 0,1),ce=I(le,pe,he+="",0),Ce,Ae;if(ce!=he.length)return null;if("Q"in le)return new Date(le.Q);if("s"in le)return new Date(le.s*1e3+("L"in le?le.L:0));if(ye&&!("Z"in le)&&(le.Z=0),"p"in le&&(le.H=le.H%12+le.p*12),le.m===void 0&&(le.m="q"in le?le.q:0),"V"in le){if(le.V<1||le.V>53)return null;"w"in le||(le.w=1),"Z"in le?(Ce=CN(cb(le.y,0,1)),Ae=Ce.getUTCDay(),Ce=Ae>4||Ae===0?e1.ceil(Ce):e1(Ce),Ce=WS.offset(Ce,(le.V-1)*7),le.y=Ce.getUTCFullYear(),le.m=Ce.getUTCMonth(),le.d=Ce.getUTCDate()+(le.w+6)%7):(Ce=wN(cb(le.y,0,1)),Ae=Ce.getDay(),Ce=Ae>4||Ae===0?ZE.ceil(Ce):ZE(Ce),Ce=Fv.offset(Ce,(le.V-1)*7),le.y=Ce.getFullYear(),le.m=Ce.getMonth(),le.d=Ce.getDate()+(le.w+6)%7)}else("W"in le||"U"in le)&&("w"in le||(le.w="u"in le?le.u%7:"W"in le?1:0),Ae="Z"in le?CN(cb(le.y,0,1)).getUTCDay():wN(cb(le.y,0,1)).getDay(),le.m=0,le.d="W"in le?(le.w+6)%7+le.W*7-(Ae+5)%7:le.w+le.U*7-(Ae+6)%7);return"Z"in le?(le.H+=le.Z/100|0,le.M+=le.Z%100,CN(le)):wN(le)}}function I(pe,ye,he,le){for(var ce=0,Ce=ye.length,Ae=he.length,je,nt;ce<Ce;){if(le>=Ae)return-1;if(je=ye.charCodeAt(ce++),je===37){if(je=ye.charAt(ce++),nt=P[je in eV?ye.charAt(ce++):je],!nt||(le=nt(pe,he,le))<0)return-1}else if(je!=he.charCodeAt(le++))return-1}return le}function D(pe,ye,he){var le=d.exec(ye.slice(he));return le?(pe.p=h.get(le[0].toLowerCase()),he+le[0].length):-1}function j(pe,ye,he){var le=x.exec(ye.slice(he));return le?(pe.w=y.get(le[0].toLowerCase()),he+le[0].length):-1}function O(pe,ye,he){var le=m.exec(ye.slice(he));return le?(pe.w=p.get(le[0].toLowerCase()),he+le[0].length):-1}function M(pe,ye,he){var le=E.exec(ye.slice(he));return le?(pe.m=N.get(le[0].toLowerCase()),he+le[0].length):-1}function U(pe,ye,he){var le=v.exec(ye.slice(he));return le?(pe.m=B.get(le[0].toLowerCase()),he+le[0].length):-1}function ee(pe,ye,he){return I(pe,e,ye,he)}function ie(pe,ye,he){return I(pe,t,ye,he)}function G(pe,ye,he){return I(pe,r,ye,he)}function Z(pe){return o[pe.getDay()]}function z(pe){return a[pe.getDay()]}function se(pe){return c[pe.getMonth()]}function re(pe){return l[pe.getMonth()]}function H(pe){return s[+(pe.getHours()>=12)]}function Y(pe){return 1+~~(pe.getMonth()/3)}function de(pe){return o[pe.getUTCDay()]}function W(pe){return a[pe.getUTCDay()]}function K(pe){return c[pe.getUTCMonth()]}function J(pe){return l[pe.getUTCMonth()]}function oe(pe){return s[+(pe.getUTCHours()>=12)]}function Ie(pe){return 1+~~(pe.getUTCMonth()/3)}return{format:function(pe){var ye=R(pe+="",T);return ye.toString=function(){return pe},ye},parse:function(pe){var ye=_(pe+="",!1);return ye.toString=function(){return pe},ye},utcFormat:function(pe){var ye=R(pe+="",k);return ye.toString=function(){return pe},ye},utcParse:function(pe){var ye=_(pe+="",!0);return ye.toString=function(){return pe},ye}}}var eV={"-":"",_:" ",0:"0"},ga=/^\s*\d+/,hke=/^%/,fke=/[\\^$*+?|[\]().{}]/g;function _n(n,e,t){var r=n<0?"-":"",s=(r?-n:n)+"",a=s.length;return r+(a<t?new Array(t-a+1).join(e)+s:s)}function mke(n){return n.replace(fke,"\\$&")}function db(n){return new RegExp("^(?:"+n.map(mke).join("|")+")","i")}function ub(n){return new Map(n.map((e,t)=>[e.toLowerCase(),t]))}function pke(n,e,t){var r=ga.exec(e.slice(t,t+1));return r?(n.w=+r[0],t+r[0].length):-1}function gke(n,e,t){var r=ga.exec(e.slice(t,t+1));return r?(n.u=+r[0],t+r[0].length):-1}function xke(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.U=+r[0],t+r[0].length):-1}function bke(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.V=+r[0],t+r[0].length):-1}function yke(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.W=+r[0],t+r[0].length):-1}function tV(n,e,t){var r=ga.exec(e.slice(t,t+4));return r?(n.y=+r[0],t+r[0].length):-1}function nV(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.y=+r[0]+(+r[0]>68?1900:2e3),t+r[0].length):-1}function vke(n,e,t){var r=/^(Z)|([+-]\d\d)(?::?(\d\d))?/.exec(e.slice(t,t+6));return r?(n.Z=r[1]?0:-(r[2]+(r[3]||"00")),t+r[0].length):-1}function Bke(n,e,t){var r=ga.exec(e.slice(t,t+1));return r?(n.q=r[0]*3-3,t+r[0].length):-1}function wke(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.m=r[0]-1,t+r[0].length):-1}function rV(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.d=+r[0],t+r[0].length):-1}function Cke(n,e,t){var r=ga.exec(e.slice(t,t+3));return r?(n.m=0,n.d=+r[0],t+r[0].length):-1}function sV(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.H=+r[0],t+r[0].length):-1}function Eke(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.M=+r[0],t+r[0].length):-1}function Ske(n,e,t){var r=ga.exec(e.slice(t,t+2));return r?(n.S=+r[0],t+r[0].length):-1}function Tke(n,e,t){var r=ga.exec(e.slice(t,t+3));return r?(n.L=+r[0],t+r[0].length):-1}function Ake(n,e,t){var r=ga.exec(e.slice(t,t+6));return r?(n.L=Math.floor(r[0]/1e3),t+r[0].length):-1}function kke(n,e,t){var r=hke.exec(e.slice(t,t+1));return r?t+r[0].length:-1}function Nke(n,e,t){var r=ga.exec(e.slice(t));return r?(n.Q=+r[0],t+r[0].length):-1}function _ke(n,e,t){var r=ga.exec(e.slice(t));return r?(n.s=+r[0],t+r[0].length):-1}function aV(n,e){return _n(n.getDate(),e,2)}function Ike(n,e){return _n(n.getHours(),e,2)}function Dke(n,e){return _n(n.getHours()%12||12,e,2)}function jke(n,e){return _n(1+Fv.count(Jd(n),n),e,3)}function dJ(n,e){return _n(n.getMilliseconds(),e,3)}function Rke(n,e){return dJ(n,e)+"000"}function Pke(n,e){return _n(n.getMonth()+1,e,2)}function Lke(n,e){return _n(n.getMinutes(),e,2)}
4704function Oke(n,e){return _n(n.getSeconds(),e,2)}function Mke(n){var e=n.getDay();return e===0?7:e}function Fke(n,e){return _n(YS.count(Jd(n)-1,n),e,2)}function uJ(n){var e=n.getDay();return e>=4||e===0?wg(n):wg.ceil(n)}function Uke(n,e){return n=uJ(n),_n(wg.count(Jd(n),n)+(Jd(n).getDay()===4),e,2)}function Vke(n){return n.getDay()}function Gke(n,e){return _n(ZE.count(Jd(n)-1,n),e,2)}function $ke(n,e){return _n(n.getFullYear()%100,e,2)}function Hke(n,e){return n=uJ(n),_n(n.getFullYear()%100,e,2)}function zke(n,e){return _n(n.getFullYear()%1e4,e,4)}function qke(n,e){var t=n.getDay();return n=t>=4||t===0?wg(n):wg.ceil(n),_n(n.getFullYear()%1e4,e,4)}function Kke(n){var e=n.getTimezoneOffset();return(e>0?"-":(e*=-1,"+"))+_n(e/60|0,"0",2)+_n(e%60,"0",2)}function iV(n,e){return _n(n.getUTCDate(),e,2)}function Wke(n,e){return _n(n.getUTCHours(),e,2)}function Yke(n,e){return _n(n.getUTCHours()%12||12,e,2)}function Qke(n,e){return _n(1+WS.count(Xd(n),n),e,3)}function hJ(n,e){return _n(n.getUTCMilliseconds(),e,3)}function Jke(n,e){return hJ(n,e)+"000"}function Xke(n,e){return _n(n.getUTCMonth()+1,e,2)}function Zke(n,e){return _n(n.getUTCMinutes(),e,2)}function eNe(n,e){return _n(n.getUTCSeconds(),e,2)}function tNe(n){var e=n.getUTCDay();return e===0?7:e}function nNe(n,e){return _n(QS.count(Xd(n)-1,n),e,2)}function fJ(n){var e=n.getUTCDay();return e>=4||e===0?Cg(n):Cg.ceil(n)}function rNe(n,e){return n=fJ(n),_n(Cg.count(Xd(n),n)+(Xd(n).getUTCDay()===4),e,2)}function sNe(n){return n.getUTCDay()}function aNe(n,e){return _n(e1.count(Xd(n)-1,n),e,2)}function iNe(n,e){return _n(n.getUTCFullYear()%100,e,2)}function oNe(n,e){return n=fJ(n),_n(n.getUTCFullYear()%100,e,2)}function lNe(n,e){return _n(n.getUTCFullYear()%1e4,e,4)}function cNe(n,e){var t=n.getUTCDay();return n=t>=4||t===0?Cg(n):Cg.ceil(n),_n(n.getUTCFullYear()%1e4,e,4)}function dNe(){return"+0000"}function oV(){return"%"}function lV(n){return+n}function cV(n){return Math.floor(+n/1e3)}var Kp,mJ,pJ;uNe({dateTime:"%x, %X",date:"%-m/%-d/%Y",time:"%-I:%M:%S %p",periods:["AM","PM"],days:["Sunday","Monday","Tuesday","Wednesday","Thursday","Friday","Saturday"],shortDays:["Sun","Mon","Tue","Wed","Thu","Fri","Sat"],months:["January","February","March","April","May","June","July","August","September","October","November","December"],shortMonths:["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"]});function uNe(n){return Kp=uke(n),mJ=Kp.format,Kp.parse,pJ=Kp.utcFormat,Kp.utcParse,Kp}function hNe(n){return new Date(n)}function fNe(n){return n instanceof Date?+n:+new Date(+n)}function WR(n,e,t,r,s,a,o,l,c,d){var h=RR(),m=h.invert,p=h.domain,x=d(".%L"),y=d(":%S"),v=d("%I:%M"),B=d("%I %p"),E=d("%a %d"),N=d("%b %d"),T=d("%B"),k=d("%Y");function P(R){return(c(R)<R?x:l(R)<R?y:o(R)<R?v:a(R)<R?B:r(R)<R?s(R)<R?E:N:t(R)<R?T:k)(R)}return h.invert=function(R){return new Date(m(R))},h.domain=function(R){return arguments.length?p(Array.from(R,fNe)):p().map(hNe)},h.ticks=function(R){var _=p();return n(_[0],_[_.length-1],R??10)},h.tickFormat=function(R,_){return _==null?P:d(_)},h.nice=function(R){var _=p();return(!R||typeof R.range!="function")&&(R=e(_[0],_[_.length-1],R??10)),R?p(tJ(_,R)):h},h.copy=function(){return Mv(h,WR(n,e,t,r,s,a,o,l,c,d))},h}function mNe(){return cl.apply(WR(cke,dke,Jd,qR,YS,Fv,HR,GR,am,mJ).domain([new Date(2e3,0,1),new Date(2e3,0,2)]),arguments)}function pNe(){return cl.apply(WR(oke,lke,Xd,KR,QS,WS,zR,$R,am,pJ).domain([Date.UTC(2e3,0,1),Date.UTC(2e3,0,2)]),arguments)}function JS(){var n=0,e=1,t,r,s,a,o=mi,l=!1,c;function d(m){return m==null||isNaN(m=+m)?c:o(s===0?.5:(m=(a(m)-t)*s,l?Math.max(0,Math.min(1,m)):m))}d.domain=function(m){return arguments.length?([n,e]=m,t=a(n=+n),r=a(e=+e),s=t===r?0:1/(r-t),d):[n,e]},d.clamp=function(m){return arguments.length?(l=!!m,d):l},d.interpolator=function(m){return arguments.length?(o=m,d):o};function h(m){return function(p){var x,y;return arguments.length?([x,y]=p,o=m(x,y),d):[o(0),o(1)]}}return d.range=h(nx),d.rangeRound=h(jR),d.unknown=function(m){return arguments.length?(c=m,d):c},function(m){return a=m,t=m(n),r=m(e),s=t===r?0:1/(r-t),d}}function ef(n,e){return e.domain(n.domain()).interpolator(n.interpolator()).clamp(n.clamp()).unknown(n.unknown())}function gJ(){var n=Zh(JS()(mi));return n.copy=function(){return ef(n,gJ())},lu.apply(n,arguments)}function xJ(){var n=OR(JS()).domain([1,10]);return n.copy=function(){return ef(n,xJ()).base(n.base())},lu.apply(n,arguments)}function bJ(){var n=MR(JS());return n.copy=function(){return ef(n,bJ()).constant(n.constant())},lu.apply(n,arguments)}function YR(){var n=FR(JS());return n.copy=function(){return ef(n,YR()).exponent(n.exponent())},lu.apply(n,arguments)}function gNe(){return YR.apply(null,arguments).exponent(.5)}function yJ(){var n=[],e=mi;function t(r){if(r!=null&&!isNaN(r=+r))return e((Lv(n,r,1)-1)/(n.length-1))}return t.domain=function(r){if(!arguments.length)return n.slice();n=[];for(let s of r)s!=null&&!isNaN(s=+s)&&n.push(s);return n.sort(wh),t},t.interpolator=function(r){return arguments.length?(e=r,t):e},t.range=function(){return n.map((r,s)=>e(s/(n.length-1)))},t.quantiles=function(r){return Array.from({length:r+1},(s,a)=>tAe(n,a/r))},t.copy=function(){return yJ(e).domain(n)},lu.apply(t,arguments)}function XS(){var n=0,e=.5,t=1,r=1,s,a,o,l,c,d=mi,h,m=!1,p;function x(v){return isNaN(v=+v)?p:(v=.5+((v=+h(v))-a)*(r*v<r*a?l:c),d(m?Math.max(0,Math.min(1,v)):v))}x.domain=function(v){return arguments.length?([n,e,t]=v,s=h(n=+n),a=h(e=+e),o=h(t=+t),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r
4704=a<s?-1:1,x):[n,e,t]},x.clamp=function(v){return arguments.length?(m=!!v,x):m},x.interpolator=function(v){return arguments.length?(d=v,x):d};function y(v){return function(B){var E,N,T;return arguments.length?([E,N,T]=B,d=kAe(v,[E,N,T]),x):[d(0),d(.5),d(1)]}}return x.range=y(nx),x.rangeRound=y(jR),x.unknown=function(v){return arguments.length?(p=v,x):p},function(v){return h=v,s=v(n),a=v(e),o=v(t),l=s===a?0:.5/(a-s),c=a===o?0:.5/(o-a),r=a<s?-1:1,x}}function vJ(){var n=Zh(XS()(mi));return n.copy=function(){return ef(n,vJ())},lu.apply(n,arguments)}function BJ(){var n=OR(XS()).domain([.1,1,10]);return n.copy=function(){return ef(n,BJ()).base(n.base())},lu.apply(n,arguments)}function wJ(){var n=MR(XS());return n.copy=function(){return ef(n,wJ()).constant(n.constant())},lu.apply(n,arguments)}function QR(){var n=FR(XS());return n.copy=function(){return ef(n,QR()).exponent(n.exponent())},lu.apply(n,arguments)}function xNe(){return QR.apply(null,arguments).exponent(.5)}const CJ=Object.freeze(Object.defineProperty({__proto__:null,scaleBand:_R,scaleDiverging:vJ,scaleDivergingLog:BJ,scaleDivergingPow:QR,scaleDivergingSqrt:xNe,scaleDivergingSymlog:wJ,scaleIdentity:eJ,scaleImplicit:JI,scaleLinear:ZQ,scaleLog:nJ,scaleOrdinal:NR,scalePoint:sAe,scalePow:UR,scaleQuantile:aJ,scaleQuantize:iJ,scaleRadial:sJ,scaleSequential:gJ,scaleSequentialLog:xJ,scaleSequentialPow:YR,scaleSequentialQuantile:yJ,scaleSequentialSqrt:gNe,scaleSequentialSymlog:bJ,scaleSqrt:JAe,scaleSymlog:rJ,scaleThreshold:oJ,scaleTime:mNe,scaleUtc:pNe,tickFormat:XQ},Symbol.toStringTag,{value:"Module"}));function bNe(n){var e=CJ;if(n in e&&typeof e[n]=="function")return e[n]();var t="scale".concat(rR(n));if(t in e&&typeof e[t]=="function")return e[t]()}function dV(n,e,t){if(typeof n=="function")return n.copy().domain(e).range(t);if(n!=null){var r=bNe(n);if(r!=null)return r.domain(e).range(t),r}}function ZS(n,e,t,r){if(!(t==null||r==null))return typeof n.scale=="function"?dV(n.scale,t,r):dV(e,t,r)}function yNe(n){return"scale".concat(rR(n))}function vNe(n){return yNe(n)in CJ}var EJ=(n,e,t)=>{if(n!=null){var r=n.scale,s=n.type;if(r==="auto")return s==="category"&&t&&(t.indexOf("LineChart")>=0||t.indexOf("AreaChart")>
4704=0||t.indexOf("ComposedChart")>=0&&!e)?"point":s==="category"?"band":"linear";if(typeof r=="string")return vNe(r)?r:"point"}};function BNe(n,e){for(var t=0,r=n.length,s=n[0]<n[n.length-1];t<r;){var a=Math.floor((t+r)/2);(s?n[a]<e:n[a]>e)?t=a+1:r=a}return t}function SJ(n,e){if(n){var t=e??n.domain(),r=t.map(a=>{var o;return(o=n(a))!==null&&o!==void 0?o:0}),s=n.range();if(!(t.length===0||s.length<2))return a=>{var o,l,c=BNe(r,a);if(c<=0)return t[0];if(c>=t.length)return t[t.length-1];var d=(o=r[c-1])!==null&&o!==void 0?o:0,h=(l=r[c])!==null&&l!==void 0?l:0;return Math.abs(a-d)<=Math.abs(a-h)?t[c-1]:t[c]}}}function wNe(n){if(n!=null)return"invert"in n&&typeof n.invert=="function"?n.invert.bind(n):SJ(n,void 0)}function uV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function t1(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?uV(Object(t),!0).forEach(function(r){CNe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):uV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function CNe(n,e,t){return(e=ENe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function ENe(n){var e=SNe(n,"string");return typeof e=="symbol"?e:e+""}function SNe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function TJ(n,e){return NNe(n)||kNe(n,e)||ANe(n,e)||TNe()}function TNe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4705In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function ANe(n,e){if(n){if(typeof n=="string")return hV(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?hV(n,e):void 0}}function hV(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function kNe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function NNe(n){if(Array.isArray(n))return n}var tD=[0,"auto"],_Ne={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:void 0,height:30,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"bottom",padding:{left:0,right:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"category",unit:void 0,niceTicks:"auto"},INe=(n,e)=>n.cartesianAxis.xAxis[e],tf=(n,e)=>{var t=INe(n,e);return t??_Ne},DNe={allowDataOverflow:!1,allowDecimals:!0,allowDuplicatedCategory:!0,angle:0,dataKey:void 0,domain:tD,hide:!0,id:0,includeHidden:!1,interval:"preserveEnd",minTickGap:5,mirror:!1,name:void 0,orientation:"left",padding:{top:0,bottom:0},reversed:!1,scale:"auto",tick:!0,tickCount:5,tickFormatter:void 0,ticks:void 0,type:"number",unit:void 0,niceTicks:"auto",width:kv},jNe=(n,e)=>n.cartesianAxis.yAxis[e],nf=(n,e)=>{var t=jNe(n,e);return t??DNe},RNe={domain:[0,"auto"],includeHidden:!1,reversed:!1,allowDataOverflow:!1,allowDuplicatedCategory:!1,dataKey:void 0,id:0,name:"",range:[64,64],scale:"auto",type:"number",unit:""},JR=(n,e)=>{var t=n.cartesianAxis.zAxis[e];return t??RNe},Zr=(n,e,t)=>{switch(e){case"xAxis":return tf(n,t);case"yAxis":return nf(n,t);case"zAxis":return JR(n,t);case"angleAxis":return Zg(n,t);case"radiusAxis":return jv(n,t);default:throw new Error("Unexpected axis type: ".concat(e))}},PNe=(n,e,t)=>{switch(e){case"xAxis":return tf(n,t);case"yAxis":return nf(n,t);default:throw new Error("Unexpected axis type: ".concat(e))}},np=(n,e,t)=>{switch(e){case"xAxis":return tf(n,t);case"yAxis":return nf(n,t);case"angleAxis":return Zg(n,t);case"radiusAxis":return jv(n,t);default:throw new Error("Unexpected axis type: ".concat(e))}},AJ=n=>n.graphicalItems.cartesianItems.some(e=>e.type==="bar")||n.graphicalItems.polarItems.some(e=>e.type==="radialBar");function XR(n,e){return t=>{switch(n){case"xAxis":return"xAxisId"in t&&t.xAxisId===e;case"yAxis":return"yAxisId"in t&&t.yAxisId===e;case"zAxis":return"zAxisId"in t&&t.zAxisId===e;case"angleAxis":return"angleAxisId"in t&&t.angleAxisId===e;
4705case"radiusAxis":return"radiusAxisId"in t&&t.radiusAxisId===e;default:return!1}}}var LNe=n=>n.graphicalItems.cartesianItems,ONe=Be([Tr,Rv],XR),ZR=(n,e,t)=>n.filter(t).filter(r=>(e==null?void 0:e.includeHidden)===!0?!0:!r.hide),rx=Be([LNe,Zr,ONe],ZR,{memoizeOptions:{resultEqualityCheck:zS}}),kJ=Be([rx],n=>n.filter(e=>e.type==="area"||e.type==="bar").filter(AR)),NJ=n=>n.filter(e=>!("stackId"in e)||e.stackId===void 0),MNe=Be([rx],NJ),eP=n=>n.map(e=>e.data).filter(Boolean).flat(1),FNe=Be([rx],n=>n.some(e=>!e.data)),_J=Be([rx],eP,{memoizeOptions:{resultEqualityCheck:zS}}),tP=(n,e)=>{var t=e.chartData,r=t===void 0?[]:t,s=e.dataStartIndex,a=e.dataEndIndex;return n.length>0?n:r.slice(s,a+1)},nP=Be([_J,VS],tP),IJ=(n,e,t)=>(e==null?void 0:e.dataKey)!=null?n.map(r=>({value:Qs(r,e.dataKey)})):t.length>0?t.map(r=>r.dataKey).flatMap(r=>n.map(s=>({value:Qs(s,r)}))):n.map(r=>({value:r})),DJ=(n,e,t,r,s,a)=>{var o=r.chartData,l=o===void 0?[]:o,c=r.dataStartIndex,d=r.dataEndIndex,h=IJ(n,e,t);if(s&&(e==null?void 0:e.dataKey)!=null&&a.length>0){var m=l.slice(c,d+1),p=m.map(x=>({value:Qs(x,e.dataKey)})).filter(x=>x.value!=null);return[...p,...h]}return h},Uv=Be([nP,Zr,rx,VS,FNe,_J],DJ);function O0(n){if(Vc(n)||n instanceof Date){var e=Number(n);if(nr(e))return e}}function fV(n){if(Array.isArray(n)){var e=[O0(n[0]),O0(n[1])];return Pc(e)?e:void 0}var t=O0(n);if(t!=null)return[t,t]}function zl(n){return n.map(O0).filter(Ec)}function UNe(n,e){var t=O0(n),r=O0(e);return t==null&&r==null?0:t==null?-1:r==null?1:t-r}var VNe=Be([Uv],n=>n==null?void 0:n.map(e=>e.value).sort(UNe));function jJ(n,e){switch(n){case"xAxis":return e.direction==="x";case"yAxis":return e.direction==="y";default:return!1}}function GNe(n,e,t){if(!t)return[];if(!t.length)return[];var r;if(typeof e=="number"&&!Wd(e))r=e;else if(Array.isArray(e)){var s=zl(e);s.length>0&&(r=Math.max(...s))}return r==null?[]:zl(t.flatMap(a=>{var o=Qs(n,a.dataKey),l,c;if(Array.isArray(o)){var d=TJ(o,2);l=d[0],c=d[1]}else l=c=o;if(!(!nr(l)||!nr(c)))return[r-l,r+c]}))}var ra=n=>{var e=pa(n),t=tx(n);return np(n,e,t)},Eg=Be([ra],n=>n==null?void 0:n.dataKey),$Ne=Be([kJ,VS,ra],GQ),RJ=(n,e,t,r)=>{var s={},a=e.reduce((o,l)=>{if(l.stackId==null)return o;var c=o[l.stackId];return c==null&&(c=[]),c.push(l),o[l.stackId]=c,o},s);return Object.fromEntries(Object.entries(a).map(o=>{var l=TJ(o,2),c=l[0],d=l[1],h=r?[...d].reverse():d,m=h.map(VQ);return[c,{stackedData:hEe(n,m,t),graphicalItems:h}]}))},HNe=Be([$Ne,kJ,Dv,PQ],RJ),PJ=(n,e,t,r)=>{var s=e.dataStartIndex,a=e.dataEndIndex;if(r==null&&t!=="zAxis")return pEe(n,s,a)},zNe=Be([Zr],n=>n.allowDataOverflow),rP=n=>{var e;if(n==null||!("domain"in n))return tD;if(n.domain!=null)return n.domain;if("ticks"in n&&n.ticks!=null){if(n.type==="number"){var t=zl(n.ticks);return[Math.min(...t),Math.max(...t)]}if(n.type==="category")return n.ticks.map(String)}return(e=n==null?void 0:n.domain)!==null&&e!==void 0?e:tD},sP=Be([Zr],rP),aP=Be([sP,zNe],EQ),qNe=Be([HNe,Wc,Tr,aP],PJ,{memoizeOptions:{resultEqualityCheck:Pv}}),eT=n=>n.errorBars,KNe=(n,e,t)=>n.flatMap(r=>e[r.id]).filter(Boolean).filter(r=>jJ(t,r)),n1=function(){for(var e=arguments.length,t=new Array(e),r=0;r<e;r++)t[r]=arguments[r];var s=t.filter(Boolean);if(s.length!==0){var a=s.flat(),o=Math.min(...a),l=Math.max(...a);return[o,l]}},iP=function(e,t,r,s,a){var o=arguments.length>5&&arguments[5]!==void 0?arguments[5]:[],l,c;if(r.length>0&&r.forEach(d=>{var h,m=d.data!=null?[...d.data]:o,p=(h=s[d.id])===null||h===void 0?void 0:h.filter(x=>jJ(a,x));m.forEach(x=>{var y,v=Qs(x,(y=t.dataKey)!==null&&y!==void 0?y:d.dataKey),B=GNe(x,v,p);if(B.length>=2){var E=Math.min(...B),N=Math.max(...B);(l==null||E<l)&&(l=E),(c==null||N>c)&&(c=N)}var T=fV(v);T!=null&&(l=l==null?T[0]:Math.min(l,T[0]),c=c==null?T[1]:Math.max(c,T[1]))})}),(t==null?void 0:t.dataKey)!=null&&r.length===0&&e.forEach(d=>{var h=fV(Qs(d,t.dataKey));h!=null&&(l=l==null?h[0]:Math.min(l,h[0]),c=c==null?h[1]:Math.max(c,h[1]))}),nr(l)&&nr(c))return[l,c]},WNe=Be([nP,Zr,MNe,eT,Tr,bTe],iP,{memoizeOptions:{resultEqualityCheck:Pv}});function YNe(n){var e=n.value;if(Vc(e)||e instanceof Date)return e}var QNe=(n,e,t)=>{var r=n.map(YNe).filter(s=>s!=null);return t&&(e.dataKey==null||e.allowDuplicatedCategory&&tY(r))?CQ(0,n.length):e.allowDuplicatedCategory?r:Array.from(new Set(r))},LJ=n=>n.referenceElements.dots,sx=(n,e,t)=>n.filter(r=>r.ifOverflow==="extendDomain").filter(r=>e==="xAxis"?r.xAxisId===t:r.yAxisId===t),JNe=Be([LJ,Tr,Rv],sx),OJ=n=>n.referenceElements.areas,XNe=Be([OJ,Tr,Rv],sx),MJ=n=>n.referenceElements.lines,ZNe=Be([MJ,Tr,Rv],sx),FJ=(n,e)=>{if(n!=null){var t=zl(n.map(r=>e==="xAxis"?r.x:r.y));if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},e_e=Be(JNe,Tr,FJ),UJ=(n,e)=>{if(n!=null){var t=zl(n.flatMap(r=>[e==="xAxis"?r.x1:r.y1,e==="xAxis"?r.x2:r.y2]));if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},t_e=Be([XNe,Tr],UJ);function n_e(n){var e;if(n.x!=null)return zl([n.x]);var t=(e=n.segment)===null||e===void 0?void 0:e.map(r=>r.x);return t==null||t.length===0?[]:zl(t)}function r_e(n){var e;if(n.y!=null)return zl([n.y]);var t=(e=n.segment)===null||e===void 0?void 0:e.map(r=>r.y);return t==null||t.length===0?[]:zl(t)}var VJ=(n,e)=>{if(n!=null){var t=n.flatMap(r=>e==="xAxis"?n_e(r):r_e(r));if(t.length!==0)return[Math.min(...t),Math.max(...t)]}},s_e=Be([ZNe,Tr],VJ),a_e=Be(e_e,s_e,t_e,(n,e,t)=>n1(n,t,e)),oP=(n,e,t,r,s,a,o,l,c)=>{if(t!=null)return t;var d=o==="vertical"&&l==="xAxis"||o==="horizontal"&&l==="yAxis",h=d?n1(r,a,s):n1(a,s),m=STe(e,h,n.allowDataOverflow);return m??(n.allowDataOverflow&&h==null&&c!=null?c:m)},i_e=n=>{if(!(n==null||n.type!=="number"||!("ticks"in n)||n.ticks==null)){var e=zl(n.ticks);if(e.length!==0)return[Math.min(...e),Math.max(...e)]}},o_e=Be([Zr],i_e,{memoizeOptions:{resultEqualityCheck:Pv}}
4705),l_e=Be([Zr,sP,aP,qNe,WNe,a_e,ir,Tr,o_e],oP,{memoizeOptions:{resultEqualityCheck:Pv}}),c_e=[0,1],lP=(n,e,t,r,s,a,o)=>{if(!((n==null||t==null||t.length===0)&&o===void 0)){var l=n.dataKey,c=n.type,d=au(e,a);if(d&&l==null){var h;return CQ(0,(h=t==null?void 0:t.length)!==null&&h!==void 0?h:0)}return c==="category"?QNe(r,n,d):s==="expand"&&!d?c_e:o}},cP=Be([Zr,ir,nP,Uv,Dv,Tr,l_e],lP),Yc=Be([Zr,AJ,CR],EJ),dP=(n,e,t)=>{var r=e.niceTicks;if(r!=="none"){var s=rP(e),a=Array.isArray(s)&&(s[0]==="auto"||s[1]==="auto");if((r==="snap125"||r==="adaptive")&&e!=null&&e.tickCount&&Pc(n)){if(a)return wU(n,e.tickCount,e.allowDecimals,r);if(e.type==="number")return CU(n,e.tickCount,e.allowDecimals,r)}if(r==="auto"&&t==="linear"&&e!=null&&e.tickCount){if(a&&Pc(n))return wU(n,e.tickCount,e.allowDecimals,"adaptive");if(e.type==="number"&&Pc(n))return CU(n,e.tickCount,e.allowDecimals,"adaptive")}}},uP=Be([cP,np,Yc],dP),hP=(n,e,t,r)=>{if(r!=="angleAxis"&&(n==null?void 0:n.type)==="number"&&Pc(e)&&Array.isArray(t)&&t.length>0){var s,a,o=e[0],l=(s=t[0])!==null&&s!==void 0?s:0,c=e[1],d=(a=t[t.length-1])!==null&&a!==void 0?a:0;return[Math.min(o,l),Math.max(c,d)]}return e},d_e=Be([Zr,cP,uP,Tr],hP),u_e=Be(Uv,Zr,(n,e)=>{if(!(!e||e.type!=="number")){var t=1/0,r=Array.from(zl(n.map(m=>m.value))).sort((m,p)=>m-p),s=r[0],a=r[r.length-1];if(s==null||a==null)return 1/0;var o=a-s;if(o===0)return 1/0;for(var l=0;l<r.length-1;l++){var c=r[l],d=r[l+1];if(!(c==null||d==null)){var h=d-c;t=Math.min(t,h)}}return t/o}}),GJ=Be(u_e,ir,RTe,Ma,(n,e,t,r,s)=>s,(n,e,t,r,s)=>{if(!nr(n))return 0;var a=e==="vertical"?r.height:r.width;if(s==="gap")return n*a/2;if(s==="no-gap"){var o=Uh(t,n*a),l=n*a/2;return l-o-(l-o)/a*o}return 0}),h_e=(n,e,t)=>{var r=tf(n,e);return r==null||typeof r.padding!="string"?0:GJ(n,"xAxis",e,t,r.padding)},f_e=(n,e,t)=>{var r=nf(n,e);return r==null||typeof r.padding!="string"?0:GJ(n,"yAxis",e,t,r.padding)},m_e=Be(tf,h_e,(n,e)=>{var t,r;if(n==null)return{left:0,right:0};var s=n.padding;return typeof s=="string"?{left:e,right:e}:{left:((t=s.left)!==null&&t!==void 0?t:0)+e,right:((r=s.right)!==null&&r!==void 0?r:0)+e}}),p_e=Be(nf,f_e,(n,e)=>{var t,r;if(n==null)return{top:0,bottom:0};var s=n.padding;return typeof s=="string"?{top:e,bottom:e}:{top:((t=s.top)!==null&&t!==void 0?t:0)+e,bottom:((r=s.bottom)!==null&&r!==void 0?r:0)+e}}),g_e=Be([Ma,m_e,LS,PS,(n,e,t)=>t],(n,e,t,r,s)=>{var a=r.padding;return s?[a.left,t.width-a.right]:[n.left+e.left,n.left+n.width-e.right]}),x_e=Be([Ma,ir,p_e,LS,PS,(n,e,t)=>t],(n,e,t,r,s,a)=>{var o=s.padding;return a?[r.height-o.bottom,o.top]:e==="horizontal"?[n.top+n.height-t.bottom,n.top+t.to
4705p]:[n.top+t.top,n.top+n.height-t.bottom]}),Vv=(n,e,t,r)=>{var s;switch(e){case"xAxis":return g_e(n,t,r);case"yAxis":return x_e(n,t,r);case"zAxis":return(s=JR(n,t))===null||s===void 0?void 0:s.range;case"angleAxis":return FQ(n);case"radiusAxis":return UQ(n,t);default:return}},$J=Be([Zr,Vv],GS),b_e=Be([Yc,d_e],$Q),fP=Be([Zr,Yc,b_e,$J],ZS),mP=(n,e,t,r)=>{if(!(t==null||t.dataKey==null)){var s=t.type,a=t.scale,o=au(n,r);if(o&&(s==="number"||a!=="auto"))return e.map(l=>l.value)}},pP=Be([ir,Uv,np,Tr],mP),tT=Be([fP],qS);Be([fP],wNe);Be([fP,VNe],SJ);Be([rx,eT,Tr],KNe);function HJ(n,e){return n.id<e.id?-1:n.id>e.id?1:0}var nT=(n,e)=>e,rT=(n,e,t)=>t,y_e=Be(jS,nT,rT,(n,e,t)=>n.filter(r=>r.orientation===e).filter(r=>r.mirror===t).sort(HJ)),v_e=Be(RS,nT,rT,(n,e,t)=>n.filter(r=>r.orientation===e).filter(r=>r.mirror===t).sort(HJ)),zJ=(n,e)=>{var t=typeof e.height=="number"?e.height:pR;return{width:n.width,height:t}},B_e=(n,e)=>{var t=typeof e.width=="number"?e.width:kv;return{width:t,height:n.height}};Be(Ma,tf,zJ);var w_e=(n,e,t)=>{switch(e){case"top":return n.top;case"bottom":return t-n.bottom;default:return 0}},C_e=(n,e,t)=>{switch(e){case"left":return n.left;case"right":return t-n.right;default:return 0}},E_e=Be(ou,Ma,y_e,nT,rT,(n,e,t,r,s)=>{var a={},o;return t.forEach(l=>{var c=zJ(e,l);o==null&&(o=w_e(e,r,n));var d=r==="top"&&!s||r==="bottom"&&s;a[l.id]=o-Number(d)*c.height,o+=(d?-1:1)*c.height}),a}),S_e=Be(iu,Ma,v_e,nT,rT,(n,e,t,r,s)=>{var a={},o;return t.forEach(l=>{var c=B_e(e,l);o==null&&(o=C_e(e,r,n));var d=r==="left"&&!s||r==="right"&&s;a[l.id]=o-Number(d)*c.width,o+=(d?-1:1)*c.width}),a}),T_e=(n,e)=>{var t=tf(n,e);if(t!=null)return E_e(n,t.orientation,t.mirror)};Be([Ma,tf,T_e,(n,e)=>e],(n,e,t,r)=>{if(e!=null){var s=t==null?void 0:t[r];return s==null?{x:n.left,y:0}:{x:n.left,y:s}}});var A_e=(n,e)=>{var t=nf(n,e);if(t!=null)return S_e(n,t.orientation,t.mirror)};Be([Ma,nf,A_e,(n,e)=>e],(n,e,t,r)=>{if(e!=null){var s=t==null?void 0:t[r];return s==null?{x:0,y:n.top}:{x:s,y:n.top}}});Be(Ma,nf,(n,e)=>{var t=typeof e.width=="number"?e.width:kv;return{width:t,height:n.height}});var qJ=(n,e,t,r)=>{if(t!=null){var s=t.allowDuplicatedCategory,a=t.type,o=t.dataKey,l=au(n,r),c=e.map(h=>h.value),d=c.filter(h=>h!=null);if(o&&l&&a==="category"&&s&&tY(d))return c}},Gv=Be([ir,Uv,Zr,Tr],qJ);Be([ir,PNe,Yc,tT,Gv,pP,Vv,uP,Tr],(n,e,t,r,s,a,o,l,c)=>{if(e!=null){var d=au(n,c);return{angle:e.angle,interval:e.interval,minTickGap:e.minTickGap,orientation:e.orientation,tick:e.tick,tickCount:e.tickCount,tickFormatter:e.tickFormatter,ticks:e.ticks,type:e.type,unit:e.unit,axisType:c,categoricalDomain:a,duplicateDomain:s,isCategorical:d,niceTicks:l,range:o,realScaleType:t,scale:r}}});var KJ=(n,e,t,r,s,a,o,l,c)=>{if(!(e==null||r==null)){var d=au(n,c),h=e.type,m=e.ticks,p=e.tickCount,x=t==="scaleBand"&&typeof r.bandwidth=="function"?r.bandwidth()/2:2,y=h==="category"&&r.bandwidth?r.bandwidth()/x:0;y=c==="angleAxis"&&a!=null&&a.length>=2?Cc(a[0]-a[1])*2*y:y;var v=m||s;return v?v.map((B,E)=>{var N=o?o.indexOf(B):B,T=r.map(N);return nr(T)?{index:E,coordinate:T+y,value:B,offset:y}:null}).filter(Ec):d&&l?l.map((B,E)=>{var N=r.map(B);return nr(N)?{coordinate:N+y,value:B,index:E,offset:y}:null}).filter(Ec):r.ticks?r.ticks(p).map((B,E)=>{var N=r.map(B);return nr(N)?{coordinate:N+y,value:B,index:E,offset:y}:null}).filter(Ec):r.domain().map((B,E)=>{var N=r.map(B);return nr(N)?{coordinate:N+y,value:o?o[B]:B,index:E,offset:y}:null}).filter(Ec)}};Be([ir,np,Yc,tT,uP,Vv,Gv,pP,Tr],KJ);var WJ=(n,e,t,r,s,a,o)=>{if(!(e==null||t==null||r==null||r[0]===r[1])){var l=au(n,o),c=e.tickCount,d=0;return d=o==="angleAxis"&&(r==null?void 0:r.length)>=2?Cc(r[0]-r[1])*2*d:d,l&&a?a.map((h,m)=>{var p=t.map(h);
4705return nr(p)?{coordinate:p+d,value:h,index:m,offset:d}:null}).filter(Ec):t.ticks?t.ticks(c).map((h,m)=>{var p=t.map(h);return nr(p)?{coordinate:p+d,value:h,index:m,offset:d}:null}).filter(Ec):t.domain().map((h,m)=>{var p=t.map(h);return nr(p)?{coordinate:p+d,value:s?s[h]:h,index:m,offset:d}:null}).filter(Ec)}};Be([ir,np,tT,Vv,Gv,pP,Tr],WJ);Be(Zr,tT,(n,e)=>{if(!(n==null||e==null))return t1(t1({},n),{},{scale:e})});var k_e=Be([Zr,Yc,cP,$J],ZS),N_e=Be([k_e],qS);Be((n,e,t)=>JR(n,t),N_e,(n,e)=>{if(!(n==null||e==null))return t1(t1({},n),{},{scale:e})});var __e=Be([ir,jS,RS],(n,e,t)=>{switch(n){case"horizontal":return e.some(r=>r.reversed)?"right-to-left":"left-to-right";case"vertical":return t.some(r=>r.reversed)?"bottom-to-top":"top-to-bottom";case"centric":case"radial":return"left-to-right";default:return}}),I_e=(n,e,t)=>{var r;return(r=n.renderedTicks[e])===null||r===void 0?void 0:r[t]};Be([I_e],n=>{if(!(!n||n.length===0))return e=>{var t,r=1/0,s=n[0];for(var a of n){var o=Math.abs(a.coordinate-e);o<r&&(r=o,s=a)}return(t=s)===null||t===void 0?void 0:t.value}});var YJ=n=>n.options.defaultTooltipEventType,QJ=n=>n.options.validateTooltipEventTypes;function JJ(n,e,t){if(n==null)return e;var r=n?"axis":"item";return t==null?e:t.includes(r)?r:e}function $v(n,e){var t=YJ(n),r=QJ(n);return JJ(e,t,r)}function D_e(n){return Dt(e=>$v(e,n))}var XJ=(n,e)=>{var t,r=Number(e);if(!(Wd(r)||e==null))return r>=0?n==null||(t=n[r])===null||t===void 0?void 0:t.value:void 0},j_e=n=>n.tooltip.settings,oh={active:!1,index:null,dataKey:void 0,graphicalItemId:void 0,coordinate:void 0},R_e={itemInteraction:{click:oh,hover:oh},axisInteraction:{click:oh,hover:oh},keyboardInteraction:oh,syncInteraction:{active:!1,index:null,dataKey:void 0,label:void 0,coordinate:void 0,sourceViewBox:void 0,graphicalItemId:void 0},tooltipItemPayloads:[],settings:{shared:void 0,trigger:"hover",axisId:0,active:!1,defaultIndex:void 0}},ZJ=ri({name:"tooltip",initialState:R_e,reducers:{addTooltipEntrySettings:{reducer(n,e){n.tooltipItemPayloads.push(kn(e.payload))},prepare:jr()},replaceTooltipEntrySettings:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next,a=Xo(n).tooltipItemPayloads.indexOf(kn(r));a>-1&&(n.tooltipItemPayloads[a]=kn(s))},prepare:jr()},removeTooltipEntrySettings:{reducer(n,e){var t=Xo(n).tooltipItemPayloads.indexOf(kn(e.payload));t>-1&&n.tooltipItemPayloads.splice(t,1)},prepare:jr()},setTooltipSettingsState(n,e){n.settings=e.payload},setActiveMouseOverItemIndex(n,e){n.syncInteraction.active=!1,n.syncInteraction.sourceViewBox=void 0,n.keyboardInteraction.active=!1,n.itemInteraction.hover.active=!0,n.itemInteraction.hover.index=e.payload.activeIndex,n.itemInteraction.hover.dataKey=e.payload.activeDataKey,n.itemInteraction.hover.graphicalItemId=e.payload.activeGraphicalItemId,n.itemInteraction.hover.coordinate=e.payload.activeCoordinate},mouseLeaveChart(n){n.itemInteraction.hover.active=!1,n.axisInteraction.hover.active=!1},mouseLeaveItem(n){n.itemInteraction.hover.active=!1},setActiveClickItemIndex(n,e){n.syncInteraction.active=!1,n.syncInteraction.sourceViewBox=void 0,n.itemInteraction.click.active=!0,n.keyboardInteraction.active=!1,n.itemInteraction.click.index=e.payload.activeIndex,n.itemInteraction.click.dataKey=e.payload.activeDataKey,n.itemInteraction.click.graphicalItemId=e.payload.activeGraphicalItemId,n.itemInteraction.click.coordinate=e.payload.activeCoordinate},setMouseOverAxisIndex(n,e){n.syncInteraction.active=!1,n.syncInteraction.sourceViewBox=void 0,n.axisInteraction.hover.active=!0,n.keyboardInteraction.active=!1,n.axisInteraction.hover.index=e.payload.activeIndex,n.axisInteraction.hover.dataKey=e.payload.activeDataKey,n.axisInteraction.hover.coordinate=e.payload.activeCoordinate},setMouseClickAxisIndex(n,e){n.syncInteraction.active=!1,n.syncInteraction.sourceViewBox=void 0,n.keyboardInteraction.active=!1,n.axisInteraction.click.active=!0,n.axisInteraction.click.index=e.payload.activeIndex,n.axisInteraction.click.dataKey=e.payload.activeDataKey,n.axisInteraction.click.coordinate=e.payload.activeCoordinate},setSyncInteraction(n,e){n.syncInteraction=e.payload},setKeyboardInteraction(n,e){n.keyboardInteraction.active=e.payload.active,n.keyboardInteraction.index=e.payload.activeIndex,n.keyboardInteraction.coordinate=e.payload.activeCoordinate}}}),dl=ZJ.actions,P_e=dl.addTooltipEntrySettings,L_e=dl.replaceTooltipEntrySettings,O_e=dl.removeTooltipEntrySettings,M_e=dl.setTooltipSettingsState,F_e=dl.setActiveMouseOverItemIndex;dl.mouseLeaveItem;var eX=dl.mouseLeaveChart;dl.setActiveClickItemIndex;var tX=dl.setMouseOverAxisIndex,U_e=dl.setMouseClickAxisIndex,Ab=dl.setSyncInteraction,r1=dl.setKeyboardInteraction,V_e=ZJ.reducer;function mV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Aw(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4705e%2?mV(Object(t),!0).forEach(function(r){G_e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):mV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function G_e(n,e,t){return(e=$_e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function $_e(n){var e=H_e(n,"string");return typeof e=="symbol"?e:e+""}function H_e(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function z_e(n,e,t){return e==="axis"?t==="click"?n.axisInteraction.click:n.axisInteraction.hover:t==="click"?n.itemInteraction.click:n.itemInteraction.hover}function q_e(n){return n.index!=null}var nX=(n,e,t,r)=>{if(e==null)return oh;var s=z_e(n,e,t);if(s==null)return oh;if(s.active)return s;if(n.keyboardInteraction.active)return n.keyboardInteraction;if(n.syncInteraction.active&&n.syncInteraction.index!=null)return n.syncInteraction;var a=n.settings.active===!0;if(q_e(s)){if(a)return Aw(Aw({},s),{},{active:!0})}else if(r!=null)return{active:!0,coordinate:void 0,dataKey:void 0,index:r,graphicalItemId:void 0};return Aw(Aw({},oh),{},{coordinate:s.coordinate})};function K_e(n){if(typeof n=="number")return Number.isFinite(n)?n:void 0;if(n instanceof Date){var e=n.valueOf();return Number.isFinite(e)?e:void 0}var t=Number(n);return Number.isFinite(t)?t:void 0}function W_e(n,e){var t=K_e(n),r=e[0],s=e[1];if(t===void 0)return!1;var a=Math.min(r,s),o=Math.max(r,s);return t>=a&&t<=o}function Y_e(n,e,t){if(t==null||e==null)return!0;var r=Qs(n,e);return r==null||!Pc(t)?!0:W_e(r,t)}var Wb=(n,e,t,r)=>{var s=n==null?void 0:n.index;if(s==null)return null;var a=Number(s);if(!nr(a))return s;var o=0,l=1/0;e.length>0&&(l=e.length-1);var c=Math.max(o,Math.min(a,l)),d=e[c];return d==null||Y_e(d,t,r)?String(c):null},rX=(n,e,t,r,s,a,o)=>{if(a!=null){var l=o[0],c=l==null?void 0:l.getPosition(a);if(c!=null)return c;var d=s==null?void 0:s[Number(a)];if(d)switch(t){case"horizontal":return{x:d.coordinate,y:(r.top+e)/2};default:return{x:(r.left+n)/2,y:d.coordinate}}}},sX=(n,e,t,r)=>{if(e==="axis")return n.tooltipItemPayloads;if(n.tooltipItemPayloads.length===0)return[];var s;if(t==="hover"?s=n.itemInteraction.hover.graphicalItemId:s=n.itemInteraction.click.graphicalItemId,n.syncInteraction.active&&s==null)return n.tooltipItemPayloads;if(s==null&&(r!=null||n.keyboardInteraction.active)){var a=n.tooltipItemPayloads[0];return a!=null?[a]:[]}return n.tooltipItemPayloads.filter(o=>{var l;return((l=o.settings)===null||l===void 0?void 0:l.graphicalItemId)===s})},aX=n=>n.options.tooltipPayloadSearcher,ax=n=>n.tooltip;function pV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function gV(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?pV(Object(t),!0).forEach(function(r){Q_e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):pV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Q_e(n,e,t){return(e=J_e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function J_e(n){var e=X_e(n,"string");return typeof e=="symbol"?e:e+""}function X_e(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Z_e(n){if(typeof n=="string"||typeof n=="number")return n}function eIe(n){if(typeof n=="string"||typeof n=="number"||typeof n=="boolean")return n}function tIe(n){if(typeof n=="string"||typeof n=="number")return n;if(typeof n=="function")return e=>n(e)}function xV(n){if(typeof n=="string")return n}function nIe(n){if(!(n==null||typeof n!="object")){var e="name"in n?Z_e(n.name):void 0,t="unit"in n?eIe(n.unit):void 0,r="dataKey"in n?tIe(n.dataKey):void 0,s="payload"in n?n.payload:void 0,a="color"in n?xV(n.color):void 0,o="fill"in n?xV(n.fill):void 0;return{name:e,unit:t,dataKey:r,payload:s,color:a,fill:o}}}function rIe(n,e){return n??e}var iX=(n,e,t,r,s,a,o)=>
4705{if(!(e==null||a==null)){var l=t.chartData,c=t.computedData,d=t.dataStartIndex,h=t.dataEndIndex,m=[];return n.reduce((p,x)=>{var y,v=x.dataDefinedOnItem,B=x.settings,E=rIe(v,l),N=Array.isArray(E)?iQ(E,d,h):E,T=(y=B==null?void 0:B.dataKey)!==null&&y!==void 0?y:r,k=B==null?void 0:B.nameKey,P;if(r&&Array.isArray(N)&&!Array.isArray(N[0])&&o==="axis"?(P=iBe(N,r,s),P==null&&(P=a(N,e,c,k))):P=a(N,e,c,k),Array.isArray(P))P.forEach(_=>{var I,D,j=nIe(_),O=j==null?void 0:j.name,M=j==null?void 0:j.dataKey,U=j==null?void 0:j.payload,ee=gV(gV({},B),{},{name:O,unit:j==null?void 0:j.unit,color:(I=j==null?void 0:j.color)!==null&&I!==void 0?I:B==null?void 0:B.color,fill:(D=j==null?void 0:j.fill)!==null&&D!==void 0?D:B==null?void 0:B.fill});p.push(x8({tooltipEntrySettings:ee,dataKey:M,payload:U,value:Qs(U,M),name:O==null?void 0:String(O)}))});else{var R;p.push(x8({tooltipEntrySettings:B,dataKey:T,payload:P,value:Qs(P,T),name:(R=Qs(P,k))!==null&&R!==void 0?R:B==null?void 0:B.name}))}return p},m)}},gP=Be([ra,AJ,CR],EJ),sIe=Be([n=>n.graphicalItems.cartesianItems,n=>n.graphicalItems.polarItems],(n,e)=>[...n,...e]),aIe=Be([pa,tx],XR),rp=Be([sIe,ra,aIe],ZR,{memoizeOptions:{resultEqualityCheck:zS}}),iIe=Be([rp],n=>n.filter(AR)),oX=Be([rp],eP,{memoizeOptions:{resultEqualityCheck:zS}}),oIe=Be([rp],n=>n.some(e=>!e.data)),Vm=Be([oX,Wc],tP),lIe=Be([iIe,Wc,ra],GQ),xP=Be([Vm,ra,rp,Wc,oIe,oX],DJ),lX=Be([ra],rP),cIe=Be([ra],n=>n.allowDataOverflow),cX=Be([lX,cIe],EQ),dIe=Be([rp],n=>n.filter(AR)),uIe=Be([lIe,dIe,Dv,PQ],RJ),hIe=Be([uIe,Wc,pa,cX],PJ),fIe=Be([rp],NJ),mIe=Be([Vm,ra,fIe,eT,pa,vTe],iP,{memoizeOptions:{resultEqualityCheck:Pv}}),pIe=Be([LJ,pa,tx],sx),gIe=Be([pIe,pa],FJ),xIe=Be([OJ,pa,tx],sx),bIe=Be([xIe,pa],UJ),yIe=Be([MJ,pa,tx],sx),vIe=Be([yIe,pa],VJ),BIe=Be([gIe,vIe,bIe],n1),wIe=Be([ra,lX,cX,hIe,mIe,BIe,ir,pa],oP),Sg=Be([ra,ir,Vm,xP,Dv,pa,wIe],lP),CIe=Be([Sg,ra,gP],dP),EIe=Be([ra,Sg,CIe,pa],hP),dX=n=>{var e=pa(n),t=tx(n),r=!1;return Vv(n,e,t,r)},uX=Be([ra,dX],GS),SIe=Be([ra,gP,EIe,uX],ZS),hX=Be([SIe],qS),TIe=Be([ir,xP,ra,pa],qJ),AIe=Be([ir,xP,ra,pa],mP),kIe=(n,e,t,r,s,a,o,l)=>{if(e){var c=e.type,d=au(n,l);if(r){var h=t==="scaleBand"&&r.bandwidth?r.bandwidth()/2:2,m=c==="category"&&r.bandwidth?r.bandwidth()/h:0;return m=l==="angleAxis"&&s!=null&&(s==null?void 0:s.length)>=2?Cc(s[0]-s[1])*2*m:m,d&&o?o.map((p,x)=>{var y=r.map(p);return nr(y)?{coordinate:y+m,value:p,index:x,offset:m}:null}).filter(Ec):r.domain().map((p,x)=>{var y=r.map(p);return nr(y)?{coordinate:y+m,value:a?a[p]:p,index:x,offset:m}:null}).filter(Ec)}}},cu=Be([ir,ra,gP,hX,dX,TIe,AIe,pa],kIe),bP=Be([YJ,QJ,j_e],(n,e,t)=>JJ(t.shared,n,e)),fX=n=>n.tooltip.settings.trigger,yP=n=>n.tooltip.settings.defaultIndex,Hv=Be([ax,bP,fX,yP],nX),Py=Be([Hv,Vm,Eg,Sg],Wb),mX=Be([cu,Py],XJ),NIe=Be([Hv],n=>{if(n)return n.dataKey}),_Ie=Be([Hv],n=>{if(n)return n.graphicalItemId}),pX=Be([ax,bP,fX,yP],sX),IIe=Be([iu,ou,ir,Ma,cu,yP,pX],rX),DIe=Be([Hv,IIe],(n,e)=>n!=null&&n.coordinate?n.coordinate:e),jIe=Be([Hv],n=>{var e;return(e=n==null?void 0:n.active)!==null&&e!==void 0?e:!1}),RIe=Be([pX,Py,Wc,Eg,mX,aX,bP],iX),PIe=Be([RIe],n=>{if(n!=null){var e=n.map(t=>t.payload).filter(t=>t!=null);return Array.from(new Set(e))}});function bV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function yV(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?bV(Object(t),!0).forEach(function(r){LIe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):bV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function LIe(n,e,t){return(e=OIe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function OIe(n){var e=MIe(n,"string");return typeof e=="symbol"?e:e+""}function MIe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var FIe=()=>Dt(ra),UIe=()=>{var n=FIe(),e=Dt(cu),t=Dt(hX);return LE(!n||!t?void 0:yV(yV({},n),{},{scale:t}),e)};function vV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Wp(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4705e%2?vV(Object(t),!0).forEach(function(r){VIe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):vV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function VIe(n,e,t){return(e=GIe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function GIe(n){var e=$Ie(n,"string");return typeof e=="symbol"?e:e+""}function $Ie(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var HIe=(n,e,t,r)=>{var s=e.find(a=>a&&a.index===t);if(s){if(n==="horizontal")return{x:s.coordinate,y:r.relativeY};if(n==="vertical")return{x:r.relativeX,y:s.coordinate}}return{x:0,y:0}},zIe=(n,e,t,r)=>{var s=e.find(d=>d&&d.index===t);if(s){if(n==="centric"){var a=s.coordinate,o=r.radius;return Wp(Wp(Wp({},r),rr(r.cx,r.cy,o,a)),{},{angle:a,radius:o})}var l=s.coordinate,c=r.angle;return Wp(Wp(Wp({},r),rr(r.cx,r.cy,l,c)),{},{angle:c,radius:l})}return{angle:0,clockWise:!1,cx:0,cy:0,endAngle:0,innerRadius:0,outerRadius:0,radius:0,startAngle:0,x:0,y:0}};function qIe(n,e){var t=n.relativeX,r=n.relativeY;return t>=e.left&&t<=e.left+e.width&&r>=e.top&&r<=e.top+e.height}var gX=(n,e,t,r,s)=>{var a,o=(a=e==null?void 0:e.length)!==null&&a!==void 0?a:0;if(o<=1||n==null)return 0;if(r==="angleAxis"&&s!=null&&Math.abs(Math.abs(s[1]-s[0])-360)<=1e-6)for(var l=s[1]-s[0],c=(ie,G,Z)=>[n,n+l,n-l].some(z=>(Z?z>=ie:z>ie)&&z<=G),d=0;d<o;d++){var h,m,p,x,y,v=d>0?(h=t[d-1])===null||h===void 0?void 0:h.coordinate:(m=t[o-1])===null||m===void 0?void 0:m.coordinate,B=(p=t[d])===null||p===void 0?void 0:p.coordinate,E=d>=o-1?(x=t[0])===null||x===void 0?void 0:x.coordinate:(y=t[d+1])===null||y===void 0?void 0:y.coordinate,N=void 0;if(!(v==null||B==null||E==null))if(Cc(B-v)!==Cc(E-B)){var T=[];if(Cc(E-B)===Cc(s[1]-s[0])){N=E;var k=B+s[1]-s[0];T[0]=Math.min(k,(k+v)/2),T[1]=Math.max(k,(k+v)/2)}else{N=v;var P=E+s[1]-s[0];T[0]=Math.min(B,(P+B)/2),T[1]=Math.max(B,(P+B)/2)}var R=[Math.min(B,(N+B)/2),Math.max(B,(N+B)/2)];if(c(R[0],R[1],!1)||c(T[0],T[1],!0)){var _;return(_=t[d])===null||_===void 0?void 0:_.index}}else{var I=Math.min(v,E),D=Math.max(v,E);if(c((I+B)/2,(D+B)/2,!1)){var j;return(j=t[d])===null||j===void 0?void 0:j.index}}}else if(e)for(var O=0;O<o;O++){var M=e[O];if(M!=null){var U=e[O+1],ee=e[O-1];if(O===0&&U!=null&&n<=(M.coordinate+U.coordinate)/2||O===o-1&&ee!=null&&n>(M.coordinate+ee.coordinate)/2||O>0&&O<o-1&&ee!=null&&U!=null&&n>(M.coordinate+ee.coordinate)/2&&n<=(M.coordinate+U.coordinate)/2)return M.index}}return-1},KIe=()=>Dt(CR),vP=(n,e)=>e,xX=(n,e,t)=>t,BP=(n,e,t,r)=>r,WIe=Be(cu,n=>wS(n,e=>e.coordinate)),wP=Be([ax,vP,xX,BP],nX),CP=Be([wP,Vm,Eg,Sg],Wb),YIe=(n,e,t)=>{if(e!=null){var r=ax(n);return e==="axis"?t==="hover"?r.axisInteraction.hover.dataKey:r.axisInteraction.click.dataKey:t==="hover"?r.itemInteraction.hover.dataKey:r.itemInteraction.click.dataKey}},bX=Be([ax,vP,xX,BP],sX),s1=Be([iu,ou,ir,Ma,cu,BP,bX],rX),QIe=Be([wP,s1],(n,e)=>{var t;return(t=n.coordinate)!==null&&t!==void 0?t:e}),yX=Be([cu,CP],XJ),JIe=Be([bX,CP,Wc,Eg,yX,aX,vP],iX),XIe=Be([wP,CP],(n,e)=>({isActive:n.active&&e!=null,activeIndex:e})),ZIe=(n,e,t,r,s,a,o)=>{if(!(!n||!t||!r||!s)&&qIe(n,o)){var l=gEe(n,e),c=gX(l,a,s,t,r),d=HIe(e,s,c,n);return{activeIndex:String(c),activeCoordinate:d}}},eDe=(n,e,t,r,s,a,o)=>{if(!(!n||!r||!s||!a||!t)){var l=uTe(n,t);if(l){var c=xEe(l,e),d=gX(c,o,a,r,s),h=zIe(e,a,d,l);return{activeIndex:String(d),activeCoordinate:h}}}},tDe=(n,e,t,r,s,a,o,l)=>{if(!(!n||!e||!r||!s||!a))return e==="horizontal"||e==="vertical"?ZIe(n,e,r,s,a,o,l):eDe(n,e,t,r,s,a,o)},nDe=Be(n=>n.zIndex.zIndexMap,(n,e)=>e,(n,e,t)=>t,(n,e,t)=>{if(e!=null){var r=n[e];if(r!=null)return t?r.panoramaElement:r.element}}),rDe=Be(n=>n.zIndex.zIndexMap,n=>{var e=Object.keys(n).map(r=>parseInt(r,10)).concat(Object.values(fi)),t=Array.from(new Set(e));return t.sort((r,s)=>r-s)},{memoizeOptions:{resultEqualityCheck:$Te}}
4705);function BV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function wV(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?BV(Object(t),!0).forEach(function(r){sDe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):BV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function sDe(n,e,t){return(e=aDe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function aDe(n){var e=iDe(n,"string");return typeof e=="symbol"?e:e+""}function iDe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var oDe={},lDe={zIndexMap:Object.values(fi).reduce((n,e)=>wV(wV({},n),{},{[e]:{element:void 0,panoramaElement:void 0,consumers:0}}),oDe)},cDe=new Set(Object.values(fi));function dDe(n){return cDe.has(n)}var vX=ri({name:"zIndex",initialState:lDe,reducers:{registerZIndexPortal:{reducer:(n,e)=>{var t=e.payload.zIndex;n.zIndexMap[t]?n.zIndexMap[t].consumers+=1:n.zIndexMap[t]={consumers:1,element:void 0,panoramaElement:void 0}},prepare:jr()},unregisterZIndexPortal:{reducer:(n,e)=>{var t=e.payload.zIndex;n.zIndexMap[t]&&(n.zIndexMap[t].consumers-=1,n.zIndexMap[t].consumers<=0&&!dDe(t)&&delete n.zIndexMap[t])},prepare:jr()},registerZIndexPortalElement:{reducer:(n,e)=>{var t=e.payload,r=t.zIndex,s=t.element,a=t.isPanorama;n.zIndexMap[r]?a?n.zIndexMap[r].panoramaElement=kn(s):n.zIndexMap[r].element=kn(s):n.zIndexMap[r]={consumers:0,element:a?void 0:kn(s),panoramaElement:a?kn(s):void 0}},prepare:jr()},unregisterZIndexPortalElement:{reducer:(n,e)=>{var t=e.payload.zIndex;n.zIndexMap[t]&&(e.payload.isPanorama?n.zIndexMap[t].panoramaElement=void 0:n.zIndexMap[t].element=void 0)},prepare:jr()}}}),sT=vX.actions,uDe=sT.registerZIndexPortal,EN=sT.unregisterZIndexPortal,hDe=sT.registerZIndexPortalElement,fDe=sT.unregisterZIndexPortalElement,mDe=vX.reducer;function du(n){var e=n.zIndex,t=n.children,r=r1e(),s=r&&e!==void 0&&e!==0,a=Kc(),o=S.useRef(void 0),l=S.useRef(new Set),c=ta(),d=Dt(m=>nDe(m,e,a));if(S.useLayoutEffect(()=>{if(!s){var m=l.current;m.forEach(x=>{c(EN({zIndex:x}))}),m.clear(),o.current=void 0;return}if(l.current.has(e)||(c(uDe({zIndex:e})),l.current.add(e)),d){o.current=d;var p=l.current;p.forEach(x=>{x!==e&&(c(EN({zIndex:x})),p.delete(x))})}},[c,e,s,d]),S.useLayoutEffect(()=>{var m=l.current;return()=>{m.forEach(p=>{c(EN({zIndex:p}))}),m.clear()}},[c]),!s)return t;var h=d??o.current;return h?XW.createPortal(t,h):null}function nD(){return nD=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},nD.apply(null,arguments)}function CV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function kw(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?CV(Object(t),!0).forEach(function(r){pDe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):CV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function pDe(n,e,t){return(e=gDe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function gDe(n){var e=xDe(n,"string");return typeof e=="symbol"?e:e+""}function xDe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function bDe(n){var e=n.cursor,t=n.cursorComp,r=n.cursorProps;return S.isValidElement(e)?S.cloneElement(e,r):S.createElement(t,r)}function yDe(n){var e,t=n.coordinate,r=n.payload,s=n.index,a=n.offset,o=n.tooltipAxisBandSize,l=n.layout,c=n.cursor,d=n.tooltipEventType,h=n.chartName,m=t,p=r,x=s;if(!c||!m||h!=="ScatterChart"&&d!=="axis")return null;var y,v,B;if(h==="ScatterChart")y=m,v=ySe,B=fi.cursorLine;else if(h==="BarChart")y=vSe(l,m,a,o),v=tTe,B=fi.cursorRectangle;else if(l==="radial"&&gY(m)){var E=BQ(m),N=E.cx,T=E.cy,k=E.radius,P=E.startAngle,R=E.endAngle;y={cx:N,cy:T,startAngle:P,endAngle:R,innerRadius:k,outerRadius:k},v=pTe,B=fi.cursorLine}else y={points:gTe(l,m,a)},v=dSe,B=fi.cursorLine;var _=typeof c=="object"&&"className"in c?c.className:void 0,I=kw(kw(kw(kw({stroke:"#ccc",pointerEvents:"none"},a),y),pS(c)),{},{payload:p,payloadIndex:x,className:Lr("recharts-tooltip-cursor",_)});return S.createElement(du,{zIndex:(e=n.zIndex)!==null&&e!==void 0?e:B},S.createElement(bDe,{cursor:c,cursorComp:v,cursorProps:I}))}
4705function vDe(n){var e=UIe(),t=e1e(),r=MS(),s=KIe();return e==null||t==null||r==null||s==null?null:S.createElement(yDe,nD({},n,{offset:t,layout:r,tooltipAxisBandSize:e,chartName:s}))}var BX=S.createContext(null),BDe=()=>S.useContext(BX),SN={exports:{}},EV;function wDe(){return EV||(EV=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(c,d,h){this.fn=c,this.context=d,this.once=h||!1}function a(c,d,h,m,p){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new s(h,m||c,p),y=t?t+d:d;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],x]:c._events[y].push(x):(c._events[y]=x,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new r:delete c._events[d]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],h,m;if(this._eventsCount===0)return d;for(m in h=this._events)e.call(h,m)&&d.push(t?m.slice(1):m);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},l.prototype.listeners=function(d){var h=t?t+d:d,m=this._events[h];if(!m)return[];if(m.fn)return[m.fn];for(var p=0,x=m.length,y=new Array(x);p<x;p++)y[p]=m[p].fn;return y},l.prototype.listenerCount=function(d){var h=t?t+d:d,m=this._events[h];return m?m.fn?1:m.length:0},l.prototype.emit=function(d,h,m,p,x,y){var v=t?t+d:d;if(!this._events[v])return!1;var B=this._events[v],E=arguments.length,N,T;if(B.fn){switch(B.once&&this.removeListener(d,B.fn,void 0,!0),E){case 1:return B.fn.call(B.context),!0;case 2:return B.fn.call(B.context,h),!0;case 3:return B.fn.call(B.context,h,m),!0;case 4:return B.fn.call(B.context,h,m,p),!0;case 5:return B.fn.call(B.context,h,m,p,x),!0;case 6:return B.fn.call(B.context,h,m,p,x,y),!0}for(T=1,N=new Array(E-1);T<E;T++)N[T-1]=arguments[T];B.fn.apply(B.context,N)}else{var k=B.length,P;for(T=0;T<k;T++)switch(B[T].once&&this.removeListener(d,B[T].fn,void 0,!0),E){case 1:B[T].fn.call(B[T].context);break;case 2:B[T].fn.call(B[T].context,h);break;case 3:B[T].fn.call(B[T].context,h,m);break;case 4:B[T].fn.call(B[T].context,h,m,p);break;default:if(!N)for(P=1,N=new Array(E-1);P<E;P++)N[P-1]=arguments[P];B[T].fn.apply(B[T].context,N)}}return!0},l.prototype.on=function(d,h,m){return a(this,d,h,m,!1)},l.prototype.once=function(d,h,m){return a(this,d,h,m,!0)},l.prototype.removeListener=function(d,h,m,p){var x=t?t+d:d;if(!this._events[x])return this;if(!h)return o(this,x),this;var y=this._events[x];if(y.fn)y.fn===h&&(!p||y.once)&&(!m||y.context===m)&&o(this,x);else{for(var v=0,B=[],E=y.length;v<E;v++)(y[v].fn!==h||p&&!y[v].once||m&&y[v].context!==m)&&B.push(y[v]);B.length?this._events[x]=B.length===1?B[0]:B:o(this,x)}return this},l.prototype.removeAllListeners=function(d){var h;return d?(h=t?t+d:d,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l})(SN)),SN.exports}var CDe=wDe();const EDe=h$(CDe);var Ly=new EDe,rD="recharts.syncEvent.tooltip",SV="recharts.syncEvent.brush",SDe=(n,e)=>{if(e&&Array.isArray(n)){var t=Number.parseInt(e,10);if(!Wd(t))return n[t]}},TDe={chartName:"",tooltipPayloadSearcher:()=>{},eventEmitter:void 0,defaultTooltipEventType:"axis"},wX=ri({name:"options",initialState:TDe,reducers:{createEventEmitter:n=>{n.eventEmitter==null&&(n.eventEmitter=Symbol("rechartsEventEmitter"))}}}),ADe=wX.reducer,kDe=wX.actions.createEventEmitter;function NDe(n){return n.tooltip.syncInteraction}var _De={chartData:void 0,computedData:void 0,dataStartIndex:0,dataEndIndex:0},CX=ri({name:"chartData",initialState:_De,reducers:{setChartData(n,e){if(n.chartData=kn(e.payload),e.payload==null){n.dataStartIndex=0,n.dataEndIndex=0;return}e.payload.length>0&&n.dataEndIndex!==e.payload.length-1&&(n.dataEndIndex=e.payload.length-1)},setComputedData(n,e){n.computedData=e.payload},setDataStartEndIndexes(n,e){var t=e.payload,r=t.startIndex,s=t.endIndex;r!=null&&(n.dataStartIndex=r),s!=null&&(n.dataEndIndex=s)}}}),EP=CX.actions,TV=EP.setChartData,IDe=EP.setDataStartEndIndexes;EP.setComputedData;var DDe=CX.reducer,jDe=["x","y"];function AV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Yp(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4705e%2?AV(Object(t),!0).forEach(function(r){RDe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):AV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function RDe(n,e,t){return(e=PDe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PDe(n){var e=LDe(n,"string");return typeof e=="symbol"?e:e+""}function LDe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function ODe(n,e){if(n==null)return{};var t,r,s=MDe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function MDe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function FDe(){var n=Dt(ER),e=Dt(SR),t=ta(),r=Dt(LQ),s=Dt(cu),a=MS(),o=OS(),l=Dt(c=>c.rootProps.className);S.useEffect(()=>{if(n==null)return Zm;var c=(d,h,m)=>{if(e!==m&&n===d){if(h.payload.active===!1){t(Ab({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(r==="index"){var p;if(o&&h!==null&&h!==void 0&&(p=h.payload)!==null&&p!==void 0&&p.coordinate&&h.payload.sourceViewBox){var x=h.payload.coordinate,y=x.x,v=x.y,B=ODe(x,jDe),E=h.payload.sourceViewBox,N=E.x,T=E.y,k=E.width,P=E.height,R=Yp(Yp({},B),{},{x:o.x+(k?(y-N)/k:0)*o.width,y:o.y+(P?(v-T)/P:0)*o.height});t(Yp(Yp({},h),{},{payload:Yp(Yp({},h.payload),{},{coordinate:R})}))}else t(h);return}if(s!=null){var _;if(typeof r=="function"){var I={activeTooltipIndex:h.payload.index==null?void 0:Number(h.payload.index),isTooltipActive:h.payload.active,activeIndex:h.payload.index==null?void 0:Number(h.payload.index),activeLabel:h.payload.label,activeDataKey:h.payload.dataKey,activeCoordinate:h.payload.coordinate},D=r(s,I);_=s[D]}else r==="value"&&(_=s.find(Z=>String(Z.value)===h.payload.label));var j=h.payload.coordinate;if(j==null||o==null){t(Ab({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:void 0,graphicalItemId:void 0}));return}if(_==null){t(Ab({active:!1,coordinate:void 0,dataKey:void 0,index:null,label:void 0,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:void 0}));return}var O=j.x,M=j.y,U=Math.min(O,o.x+o.width),ee=Math.min(M,o.y+o.height),ie={x:a==="horizontal"?_.coordinate:U,y:a==="horizontal"?ee:_.coordinate},G=Ab({active:h.payload.active,coordinate:ie,dataKey:h.payload.dataKey,index:String(_.index),label:h.payload.label,sourceViewBox:h.payload.sourceViewBox,graphicalItemId:h.payload.graphicalItemId});t(G)}}};return Ly.on(rD,c),()=>{Ly.off(rD,c)}},[l,t,e,n,r,s,a,o])}function UDe(){var n=Dt(ER),e=Dt(SR),t=ta();S.useEffect(()=>{if(n==null)return Zm;var r=(s,a,o)=>{e!==o&&n===s&&t(IDe(a))};return Ly.on(SV,r),()=>{Ly.off(SV,r)}},[t,e,n])}function VDe(){var n=ta();S.useEffect(()=>{n(kDe())},[n]),FDe(),UDe()}function GDe(n,e,t,r,s,a){var o=Dt(y=>YIe(y,n,e)),l=Dt(_Ie),c=Dt(SR),d=Dt(ER),h=Dt(LQ),m=Dt(NDe),p=(m==null?void 0:m.sourceViewBox)!=null,x=OS();S.useEffect(()=>{if(!p&&d!=null&&c!=null){var y=Ab({active:a,coordinate:t,dataKey:o,index:s,label:typeof r=="number"?String(r):r,sourceViewBox:x,graphicalItemId:l});Ly.emit(rD,d,y,c)}},[p,t,o,l,s,r,c,d,h,a,x])}function kV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function NV(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?kV(Object(t),!0).forEach(function(r){$De(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):kV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function $De(n,e,t){return(e=HDe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function HDe(n){var e=zDe(n,"string");return typeof e=="symbol"?e:e+""}function zDe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function qDe(n,e){return QDe(n)||YDe(n,e)||WDe(n,e)||KDe()}
4705function KDe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4706In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WDe(n,e){if(n){if(typeof n=="string")return _V(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?_V(n,e):void 0}}function _V(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function YDe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function QDe(n){if(Array.isArray(n))return n}function JDe(n){return n.dataKey}function XDe(n,e){return S.isValidElement(n)?S.cloneElement(n,e):typeof n=="function"?S.createElement(n,e):S.createElement(O1e,e)}var IV=[],ZDe={allowEscapeViewBox:{x:!1,y:!1},animationDuration:400,animationEasing:"ease",axisId:0,contentStyle:{},cursor:!0,filterNull:!0,includeHidden:!1,isAnimationActive:"auto",itemSorter:"name",itemStyle:{},labelStyle:{},offset:10,reverseDirection:{x:!1,y:!1},separator:" : ",trigger:"hover",useTranslate3d:!1,wrapperStyle:{}};function eje(n){var e,t,r=ll(n,ZDe),s=r.active,a=r.allowEscapeViewBox,o=r.animationDuration,l=r.animationEasing,c=r.content,d=r.filterNull,h=r.isAnimationActive,m=r.offset,p=r.payloadUniqBy,x=r.position,y=r.reverseDirection,v=r.useTranslate3d,B=r.wrapperStyle,E=r.cursor,N=r.shared,T=r.trigger,k=r.defaultIndex,P=r.portal,R=r.axisId,_=ta(),I=typeof k=="number"?String(k):k;S.useEffect(()=>{_(M_e({shared:N,trigger:T,axisId:R,active:s,defaultIndex:I}))},[_,N,T,R,s,I]);var D=OS(),j=pQ(),O=D_e(N),M=(e=Dt(he=>XIe(he,O,T,I)))!==null&&e!==void 0?e:{},U=M.activeIndex,ee=M.isActive,ie=Dt(he=>JIe(he,O,T,I)),G=Dt(he=>yX(he,O,T,I)),Z=Dt(he=>QIe(he,O,T,I)),z=ie,se=BDe(),re=(t=s??ee)!==null&&t!==void 0?t:!1,H=nCe([z,re]),Y=qDe(H,2),de=Y[0],W=Y[1],K=O==="axis"?G:void 0;GDe(O,T,Z,K,U,re);var J=P??se;if(J==null||D==null||O==null)return null;var oe=z??IV;re||(oe=IV),d&&oe.length&&(oe=Swe(oe.filter(he=>he.value!=null&&(he.hide!==!0||r.includeHidden)),p,JDe));var Ie=oe.length>0,pe=NV(NV({},r),{},{payload:oe,label:K,active:re,activeIndex:U,coordinate:Z,accessibilityLayer:j}),ye=S.createElement(sSe,{allowEscapeViewBox:a,animationDuration:o,animationEasing:l,isAnimationActive:h,active:re,coordinate:Z,hasPayload:Ie,offset:m,position:x,reverseDirection:y,useTranslate3d:v,viewBox:D,wrapperStyle:B,lastBoundingBox:de,innerRef:W,hasPortalFromProps:!!P},XDe(c,pe));return S.createElement(S.Fragment,null,XW.createPortal(ye,J),re&&S.createElement(vDe,{cursor:E,tooltipEventType:O,coordinate:Z,payload:oe,index:U}))}function tje(n,e,t){return(e=nje(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function nje(n){var e=rje(n,"string");return typeof e=="symbol"?e:e+""}function rje(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}class sje{constructor(e){tje(this,"cache",new Map),this.maxSize=e}get(e){var t=this.cache.get(e);return t!==void 0&&(this.cache.delete(e),this.cache.set(e,t)),t}set(e,t){if(this.cache.has(e))this.cache.delete(e);else if(this.cache.size>=this.maxSize){var r=this.cache.keys().next().value;r!=null&&this.cache.delete(r)}this.cache.set(e,t)}clear(){this.cache.clear()}size(){return this.cache.size}}function DV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function aje(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4706e%2?DV(Object(t),!0).forEach(function(r){ije(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):DV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function ije(n,e,t){return(e=oje(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oje(n){var e=lje(n,"string");return typeof e=="symbol"?e:e+""}function lje(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var cje={cacheSize:2e3,enableCache:!0},EX=aje({},cje),jV=new sje(EX.cacheSize),dje={position:"absolute",top:"-20000px",left:0,padding:0,margin:0,border:"none",whiteSpace:"pre"},RV="recharts_measurement_span";function uje(n,e){var t=e.fontSize||"",r=e.fontFamily||"",s=e.fontWeight||"",a=e.fontStyle||"",o=e.letterSpacing||"",l=e.textTransform||"";return"".concat(n,"|").concat(t,"|").concat(r,"|").concat(s,"|").concat(a,"|").concat(o,"|").concat(l)}var PV=(n,e)=>{try{var t=document.getElementById(RV);t||(t=document.createElement("span"),t.setAttribute("id",RV),t.setAttribute("aria-hidden","true"),document.body.appendChild(t)),Object.assign(t.style,dje,e),t.textContent="".concat(n);var r=t.getBoundingClientRect();return{width:r.width,height:r.height}}catch{return{width:0,height:0}}},LV=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:{};if(e==null||FS.isSsr)return{width:0,height:0};if(!EX.enableCache)return PV(e,t);var r=uje(e,t),s=jV.get(r);if(s)return s;var a=PV(e,t);return jV.set(r,a),a},SX;function a1(n,e){return pje(n)||mje(n,e)||fje(n,e)||hje()}function hje(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4707In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function fje(n,e){if(n){if(typeof n=="string")return OV(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?OV(n,e):void 0}}function OV(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function mje(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function pje(n){if(Array.isArray(n))return n}function gje(n,e,t){return(e=xje(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function xje(n){var e=bje(n,"string");return typeof e=="symbol"?e:e+""}function bje(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var MV=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([*/])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,FV=/(-?\d+(?:\.\d+)?[a-zA-Z%]*)([+-])(-?\d+(?:\.\d+)?[a-zA-Z%]*)/,yje=/^(px|cm|vh|vw|em|rem|%|mm|in|pt|pc|ex|ch|vmin|vmax|Q)$/,vje=/(-?\d+(?:\.\d+)?)([a-zA-Z%]+)?/,Bje={cm:96/2.54,mm:96/25.4,pt:96/72,pc:96/6,in:96,Q:96/(2.54*40),px:1},wje=["cm","mm","pt","pc","in","Q","px"];function Cje(n){return wje.includes(n)}var T0="NaN";function Eje(n,e){return n*Bje[e]}class Ia{static parse(e){var t,r=(t=vje.exec(e))!==null&&t!==void 0?t:[],s=a1(r,3),a=s[1],o=s[2];return a==null?Ia.NaN:new Ia(parseFloat(a),o??"")}constructor(e,t){this.num=e,this.unit=t,this.num=e,this.unit=t,Wd(e)&&(this.unit=""),t!==""&&!yje.test(t)&&(this.num=NaN,this.unit=""),Cje(t)&&(this.num=Eje(e,t),this.unit="px")}add(e){return this.unit!==e.unit?new Ia(NaN,""):new Ia(this.num+e.num,this.unit)}subtract(e){return this.unit!==e.unit?new Ia(NaN,""):new Ia(this.num-e.num,this.unit)}multiply(e){return this.unit!==""&&e.unit!==""&&this.unit!==e.unit?new Ia(NaN,""):new Ia(this.num*e.num,this.unit||e.unit)}divide(e){return this.unit!==""&&e.unit!==""&&this.unit!==e.unit?new Ia(NaN,""):new Ia(this.num/e.num,this.unit||e.unit)}toString(){return"".concat(this.num).concat(this.unit)}isNaN(){return Wd(this.num)}}SX=Ia;gje(Ia,"NaN",new SX(NaN,""));function TX(n){if(n==null||n.includes(T0))return T0;for(var e=n;e.includes("*")||e.includes("/");){var t,r=(t=MV.exec(e))!==null&&t!==void 0?t:[],s=a1(r,4),a=s[1],o=s[2],l=s[3],c=Ia.parse(a??""),d=Ia.parse(l??""),h=o==="*"?c.multiply(d):c.divide(d);if(h.isNaN())return T0;e=e.replace(MV,h.toString())}for(;e.includes("+")||/.-\d+(?:\.\d+)?/.test(e);){var m,p=(m=FV.exec(e))!==null&&m!==void 0?m:[],x=a1(p,4),y=x[1],v=x[2],B=x[3],E=Ia.parse(y??""),N=Ia.parse(B??""),T=v==="+"?E.add(N):E.subtract(N);if(T.isNaN())return T0;e=e.replace(FV,T.toString())}return e}var UV=/\(([^()]*)\)/;function Sje(n){for(var e=n,t;(t=UV.exec(e))!=null;){var r=t,s=a1(r,2),a=s[1];e=e.replace(UV,TX(a))}return e}function Tje(n){var e=n.replace(/\s+/g,"");return e=Sje(e),e=TX(e),e}function Aje(n){try{return Tje(n)}catch{return T0}}function TN(n){var e=Aje(n.slice(5,-1));return e===T0?"":e}var kje=["x","y","lineHeight","capHeight","fill","scaleToFit","textAnchor","verticalAnchor"],Nje=["dx","dy","angle","className","breakAll"];function sD(){return sD=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},sD.apply(null,arguments)}function VV(n,e){if(n==null)return{};var t,r,s=_je(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function _je(n,e){if(n==null)return{};var t={};for(var r in n)if({}
4707.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function GV(n,e){return Rje(n)||jje(n,e)||Dje(n,e)||Ije()}function Ije(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4708In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function Dje(n,e){if(n){if(typeof n=="string")return $V(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?$V(n,e):void 0}}function $V(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function jje(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e===0){if(Object(t)!==t)return;c=!1}else for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function Rje(n){if(Array.isArray(n))return n}var AX=/[ \f\n\r\t\v\u2028\u2029]+/,kX=n=>{var e=n.children,t=n.breakAll,r=n.style;try{var s=[];ei(e)||(t?s=e.toString().split(""):s=e.toString().split(AX));var a=s.map(l=>({word:l,width:LV(l,r).width})),o=t?0:LV(" ",r).width;return{wordsWithComputedWidth:a,spaceWidth:o}}catch{return null}};function Pje(n){return n==="start"||n==="middle"||n==="end"||n==="inherit"}function Lje(n){return ei(n)||typeof n=="string"||typeof n=="number"||typeof n=="boolean"}var NX=(n,e,t,r)=>n.reduce((s,a)=>{var o=a.word,l=a.width,c=s[s.length-1];if(c&&l!=null&&(e==null||r||c.width+l+t<Number(e)))c.words.push(o),c.width+=l+t;else{var d={words:[o],width:l};s.push(d)}return s},[]),_X=n=>n.reduce((e,t)=>e.width>t.width?e:t),Oje="…",HV=(n,e,t,r,s,a,o,l)=>{var c=n.slice(0,e),d=kX({breakAll:t,style:r,children:c+Oje});if(!d)return[!1,[]];var h=NX(d.wordsWithComputedWidth,a,o,l),m=h.length>s||_X(h).width>Number(a);return[m,h]},Mje=(n,e,t,r,s)=>{var a=n.maxLines,o=n.children,l=n.style,c=n.breakAll,d=Ot(a),h=String(o),m=NX(e,r,t,s);if(!d||s)return m;var p=m.length>a||_X(m).width>Number(r);
4708if(!p)return m;for(var x=0,y=h.length-1,v=0,B;x<=y&&v<=h.length-1;){var E=Math.floor((x+y)/2),N=E-1,T=HV(h,N,c,l,a,r,t,s),k=GV(T,2),P=k[0],R=k[1],_=HV(h,E,c,l,a,r,t,s),I=GV(_,1),D=I[0];if(!P&&!D&&(x=E+1),P&&D&&(y=E-1),!P&&D){B=R;break}v++}return B||m},zV=n=>{var e=ei(n)?[]:n.toString().split(AX);return[{words:e,width:void 0}]},Fje=n=>{var e=n.width,t=n.scaleToFit,r=n.children,s=n.style,a=n.breakAll,o=n.maxLines;if((e||t)&&!FS.isSsr){var l,c,d=kX({breakAll:a,children:r,style:s});if(d){var h=d.wordsWithComputedWidth,m=d.spaceWidth;l=h,c=m}else return zV(r);return Mje({breakAll:a,children:r,maxLines:o,style:s},l,c,e,!!t)}return zV(r)},IX="#808080",Uje={angle:0,breakAll:!1,capHeight:"0.71em",fill:IX,lineHeight:"1em",scaleToFit:!1,textAnchor:"start",verticalAnchor:"end",x:0,y:0},aT=S.forwardRef((n,e)=>{var t=ll(n,Uje),r=t.x,s=t.y,a=t.lineHeight,o=t.capHeight,l=t.fill,c=t.scaleToFit,d=t.textAnchor,h=t.verticalAnchor,m=VV(t,kje),p=S.useMemo(()=>Fje({breakAll:m.breakAll,children:m.children,maxLines:m.maxLines,scaleToFit:c,style:m.style,width:m.width}),[m.breakAll,m.children,m.maxLines,c,m.style,m.width]),x=m.dx,y=m.dy,v=m.angle,B=m.className,E=m.breakAll,N=VV(m,Nje);if(!Vc(r)||!Vc(s)||p.length===0)return null;var T=Number(r)+(Ot(x)?x:0),k=Number(s)+(Ot(y)?y:0);if(!nr(T)||!nr(k))return null;var P;switch(h){case"start":P=TN("calc(".concat(o,")"));break;case"middle":P=TN("calc(".concat((p.length-1)/2," * -").concat(a," + (").concat(o," / 2))"));break;default:P=TN("calc(".concat(p.length-1," * -").concat(a,")"));break}var R=[],_=p[0];if(c&&_!=null){var I=_.width,D=m.width;R.push("scale(".concat(Ot(D)&&Ot(I)?D/I:1,")"))}return v&&R.push("rotate(".concat(v,", ").concat(T,", ").concat(k,")")),R.length&&(N.transform=R.join(" ")),S.createElement("text",sD({},Ka(N),{ref:e,x:T,y:k,className:Lr("recharts-text",B),textAnchor:d,fill:l.includes("url")?IX:l}),p.map((j,O)=>{var M=j.words.join(E?"":" ");return S.createElement("tspan",{x:T,dy:O===0?P:a,key:"".concat(M,"-").concat(O)},M)}))});aT.displayName="Text";var Vje=["labelRef"],Gje=["content"];function qV(n,e){if(n==null)return{};var t,r,s=$je(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function $je(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function KV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Uf(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?KV(Object(t),!0).forEach(function(r){Hje(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):KV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function Hje(n,e,t){return(e=zje(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function zje(n){var e=qje(n,"string");return typeof e=="symbol"?e:e+""}function qje(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Td(){return Td=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Td.apply(null,arguments)}var Kje=S.createContext(null),Wje=()=>{var n=S.useContext(Kje),e=OS();return n||(e?sR(e):void 0)},DX=S.createContext(null),Yje=n=>{var e=n.cx,t=n.cy,r=n.innerRadius,s=n.outerRadius,a=n.startAngle,o=n.endAngle,l=n.clockWise,c=n.children,d=S.useMemo(()=>({cx:e,cy:t,innerRadius:r,outerRadius:s,startAngle:a,endAngle:o,clockWise:l}),[e,t,r,s,a,o,l]);return S.createElement(DX.Provider,{value:d},c)},jX=()=>{var n=S.useContext(DX),e=Dt(ex);return n||e},Qje=n=>{var e=n.value,t=n.formatter,r=ei(n.children)?e:n.children;return typeof t=="function"?t(r):r},RX=n=>
4708n!=null&&typeof n=="function",Jje=(n,e)=>{var t=Cc(e-n),r=Math.min(Math.abs(e-n),360);return t*r},Xje=(n,e,t,r,s)=>{var a=n.offset,o=n.className,l=s.cx,c=s.cy,d=s.innerRadius,h=s.outerRadius,m=s.startAngle,p=s.endAngle,x=s.clockWise,y=(d+h)/2,v=Jje(m,p),B=v>=0?1:-1,E,N;switch(e){case"insideStart":E=m+B*a,N=x;break;case"insideEnd":E=p-B*a,N=!x;break;case"end":E=p+B*a,N=x;break;default:throw new Error("Unsupported position ".concat(e))}N=v<=0?N:!N;var T=rr(l,c,y,E),k=rr(l,c,y,E+(N?1:-1)*359),P="M".concat(T.x,",").concat(T.y,`
4709    A`).concat(y,",").concat(y,",0,1,").concat(N?0:1,`,
4710    `).concat(k.x,",").concat(k.y),R=ei(n.id)?Sy("recharts-radial-line-"):n.id;return S.createElement("text",Td({},r,{dominantBaseline:"central",className:Lr("recharts-radial-bar-label",o)}),S.createElement("defs",null,S.createElement("path",{id:R,d:P})),S.createElement("textPath",{xlinkHref:"#".concat(R)},t))},Zje=(n,e,t)=>{var r=n.cx,s=n.cy,a=n.innerRadius,o=n.outerRadius,l=n.startAngle,c=n.endAngle,d=(l+c)/2;if(t==="outside"){var h=rr(r,s,o+e,d),m=h.x,p=h.y;return{x:m,y:p,textAnchor:m>=r?"start":"end",verticalAnchor:"middle"}}if(t==="center")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"middle"};if(t==="centerTop")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"start"};if(t==="centerBottom")return{x:r,y:s,textAnchor:"middle",verticalAnchor:"end"};var x=(a+o)/2,y=rr(r,s,x,d),v=y.x,B=y.y;return{x:v,y:B,textAnchor:"middle",verticalAnchor:"middle"}},v0=n=>n!=null&&"cx"in n&&Ot(n.cx),e2e={angle:0,offset:5,zIndex:fi.label,position:"middle",textBreakAll:!1};function t2e(n){if(!v0(n))return n;var e=n.cx,t=n.cy,r=n.outerRadius,s=r*2;return{x:e-r,y:t-r,width:s,upperWidth:s,lowerWidth:s,height:s}}function Xu(n){var e,t,r=ll(n,e2e),s=r.viewBox,a=r.parentViewBox,o=r.position,l=r.value,c=r.children,d=r.content,h=r.className,m=h===void 0?"":h,p=r.textBreakAll,x=r.labelRef,y=jX(),v=Wje(),B=o==="center"?v:y??v,E,N,T;s==null?E=B:v0(s)?E=s:E=sR(s);var k=t2e(E);if(!E||ei(l)&&ei(c)&&!S.isValidElement(d)&&typeof d!="function")return null;var P=v0(E)&&(o==="insideStart"||o==="insideEnd"||o==="end");if(v0(E))P||(T=Zje(E,r.offset,r.position));else if(k){var R=dBe({viewBox:k,position:o,offset:r.offset,parentViewBox:v0(a)?void 0:a});T=Uf(Uf({x:R.x,y:R.y,textAnchor:R.horizontalAnchor,verticalAnchor:R.verticalAnchor},R.width!==void 0?{width:R.width}:{}),R.height!==void 0?{height:R.height}:{})}var _=Uf(Uf(Uf(Uf({},((e=T)===null||e===void 0?void 0:e.x)!==void 0?{x:T.x}:{}),((t=T)===null||t===void 0?void 0:t.y)!==void 0?{y:T.y}:{}),r),{},{viewBox:E});if(S.isValidElement(d)){_.labelRef;var I=qV(_,Vje);return S.cloneElement(d,I)}if(typeof d=="function"){_.content;var D=qV(_,Gje);if(N=S.createElement(d,D),S.isValidElement(N))return N}else N=Qje(r);var j=Ka(r);return P&&v0(E)?Xje(r,o,N,j,E):T==null?null:S.createElement(du,{zIndex:r.zIndex},S.createElement(aT,Td({ref:x,className:Lr("recharts-label",m)},j,T,{textAnchor:Pje(j.textAnchor)?j.textAnchor:T.textAnchor,breakAll:p}),N))}Xu.displayName="Label";var n2e=(n,e,t)=>{if(!n)return null;var r={viewBox:e,labelRef:t};return n===!0?S.createElement(Xu,Td({key:"label-implicit"},r)):Vc(n)?S.createElement(Xu,Td({key:"label-implicit",value:n},r)):S.isValidElement(n)?n.type===Xu?S.cloneElement(n,Uf({key:"label-implicit"},r)):S.createElement(Xu,Td({key:"label-implicit",content:n},r)):RX(n)?S.createElement(Xu,Td({key:"label-implicit",content:n},r)):n&&typeof n=="object"?S.createElement(Xu,Td({},n,{key:"label-implicit"},r)):null};function r2e(n){var e=n.label,t=jX();return n2e(e,t)||null}var s2e=["valueAccessor"],a2e=["dataKey","clockWise","id","textBreakAll","zIndex"];function i1(){return i1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},i1.apply(null,arguments)}function WV(n,e){if(n==null)return{};var t,r,s=i2e(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function i2e(n,e){if(n==null)return{};var t={};for(var r in n)if({}
4710.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var o2e=n=>{var e=Array.isArray(n.value)?n.value[n.value.length-1]:n.value;if(Lje(e))return e},PX=S.createContext(void 0),l2e=PX.Provider,LX=S.createContext(void 0);LX.Provider;function c2e(){return S.useContext(PX)}function d2e(){return S.useContext(LX)}function TC(n){var e=n.valueAccessor,t=e===void 0?o2e:e,r=WV(n,s2e),s=r.dataKey;r.clockWise;var a=r.id,o=r.textBreakAll,l=r.zIndex,c=WV(r,a2e),d=c2e(),h=d2e(),m=d||h;return!m||!m.length?null:S.createElement(du,{zIndex:l??fi.label},S.createElement(Hl,{className:"recharts-label-list"},m.map((p,x)=>{var y,v=ei(s)?t(p,x):Qs(p.payload,s),B=ei(a)?{}:{id:"".concat(a,"-").concat(x)};return S.createElement(Xu,i1({key:"label-".concat(x)},Ka(p),c,B,{fill:(y=r.fill)!==null&&y!==void 0?y:p.fill,parentViewBox:p.parentViewBox,value:v,textBreakAll:o,viewBox:p.viewBox,index:x,zIndex:0}))})))}TC.displayName="LabelList";function u2e(n){var e=n.label;return e?e===!0?S.createElement(TC,{key:"labelList-implicit"}):S.isValidElement(e)||RX(e)?S.createElement(TC,{key:"labelList-implicit",content:e}):typeof e=="object"?S.createElement(TC,i1({key:"labelList-implicit"},e,{type:String(e.type)})):null:null}var h2e=["points","className","baseLinePoints","connectNulls"],YV;function A0(){return A0=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},A0.apply(null,arguments)}function f2e(n,e){if(n==null)return{};var t,r,s=m2e(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function m2e(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function p2e(n,e){return e||(e=n.slice(0)),Object.freeze(Object.defineProperties(n,{raw:{value:Object.freeze(e)}}))}var QV=n=>n!=null&&n.x===+n.x&&n.y===+n.y,g2e=function(){var e=arguments.length>0&&arguments[0]!==void 0?arguments[0]:[],t=[[]];e.forEach(o=>{var l=t[t.length-1];QV(o)?l&&l.push(o):l&&l.length>0&&t.push([])});var r=e[0],s=t[t.length-1];QV(r)&&s&&s.push(r);var a=t[t.length-1];return a&&a.length<=0&&(t=t.slice(0,-1)),t},Yb=(n,e)=>{var t=g2e(n);e&&(t=[t.reduce((s,a)=>[...s,...a],[])]);var r=t.map(s=>s.reduce((a,o,l)=>ca(YV||(YV=p2e(["","","",",",""])),a,l===0?"M":"L",o.x,o.y),"")).join("");return t.length===1?"".concat(r,"Z"):r},x2e=(n,e,t)=>{var r=Yb(n,t);return"".concat(r.slice(-1)==="Z"?r.slice(0,-1):r,"L").concat(Yb(Array.from(e).reverse(),t).slice(1))},OX=n=>{var e=n.points,t=n.className,r=n.baseLinePoints,s=n.connectNulls,a=f2e(n,h2e);if(!e||!e.length)return null;var o=Lr("recharts-polygon",t);if(r&&r.length){var l=a.stroke&&a.stroke!=="none",c=x2e(e,r,s);return S.createElement("g",{className:o},S.createElement("path",A0({},Ka(a),{fill:c.slice(-1)==="Z"?a.fill:"none",stroke:"none",d:c})),l?S.createElement("path",A0({},Ka(a),{fill:"none",d:Yb(e,s)})):null,l?S.createElement("path",A0({},Ka(a),{fill:"none",d:Yb(r,s)})):null)}var d=Yb(e,s);return S.createElement("path",A0({},Ka(a),{fill:d.slice(-1)==="Z"?a.fill:"none",className:o,d}))};function aD(){return aD=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},aD.apply(null,arguments)}var SP=n=>{var e=n.cx,t=n.cy,r=n.r,s=n.className,a=Lr("recharts-dot",s);return Ot(e)&&Ot(t)&&Ot(r)?S.createElement("circle",aD({},Za(n),iR(n),{className:a,cx:e,cy:t,r})):null},MX=n=>n.graphicalItems.polarItems,b2e=Be([Tr,Rv],XR),iT=Be([MX,Zr,b2e],ZR),y2e=Be([iT],eP),oT=Be([y2e,US],tP),FX=Be([oT,Zr,iT],IJ);Be([oT,Zr,iT],(n,e,t)=>t.length>0?n.flatMap(r=>t.flatMap(s=>{var a,o=Qs(r,(a=e.dataKey)!==null&&a!==void 0?a:s.dataKey);return{value:o,errorDomain:[]}})).filter(Boolean):(e==null?void 0:e.dataKey)!=null?n.map(r=>({value:Qs(r,e.dataKey),errorDomain:[]})):n.map(r=>({value:r,errorDomain:[]})));var JV=()=>{},v2e=Be([oT,Zr,iT,eT,Tr,yTe],iP),B2e=Be([Zr,sP,aP,JV,v2e,JV,ir,Tr],oP),UX=Be([Zr,ir,oT,FX,Dv,Tr,B2e],lP),VX=Be([UX,np,Yc],dP),w2e=Be([Zr,UX,VX,Tr],hP),C2e=Be([Yc,w2e],$Q),TP=(n,e,t)=>{switch(e){case"angleAxis":return Zg(n,t);case"radiusAxis":return jv(n,t);default:throw new Error("Unexpected axis type: ".concat(e))}},AP=(n,e,t)=>{switch(e){case"angleAxis":return VTe(n,t);case"radiusAxis":return GTe(n,t);default:throw new Error("Unexpected axis type: ".concat(e))}},E2e=Be([TP,Yc,C2e,AP],ZS),ix=Be([E2e],qS),GX=Be([ir,FX,np,Tr],mP),ox=Be([ir,TP,Yc,ix,VX,AP,Gv,GX,Tr],KJ),S2e=Be([ox],n=>{if(n){var e=new Map;
4710return n.forEach(t=>{var r=(t.coordinate+360)%360;e.has(r)||e.set(r,t)}),Array.from(e.values())}});Be([ir,TP,ix,AP,Gv,GX,Tr],WJ);var T2e=(n,e)=>ox(n,"angleAxis",e,!1),A2e=Be([T2e],n=>{if(n)return n.map(e=>e.coordinate)}),k2e=(n,e)=>ox(n,"radiusAxis",e,!1),N2e=Be([k2e],n=>{if(n)return n.map(e=>e.coordinate)}),_2e=["gridType","radialLines","angleAxisId","radiusAxisId","cx","cy","innerRadius","outerRadius","polarAngles","polarRadius","zIndex"];function I2e(n,e){if(n==null)return{};var t,r,s=D2e(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function D2e(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function Ll(){return Ll=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ll.apply(null,arguments)}function XV(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function lT(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?XV(Object(t),!0).forEach(function(r){j2e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):XV(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function j2e(n,e,t){return(e=R2e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function R2e(n){var e=P2e(n,"string");return typeof e=="symbol"?e:e+""}function P2e(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var L2e=(n,e,t,r)=>{var s="";return r.forEach((a,o)=>{var l=rr(e,t,n,a);o?s+="L ".concat(l.x,",").concat(l.y):s+="M ".concat(l.x,",").concat(l.y)}),s+="Z",s},O2e=n=>{var e=n.cx,t=n.cy,r=n.innerRadius,s=n.outerRadius,a=n.polarAngles,o=n.radialLines;if(!a||!a.length||!o)return null;var l=lT({},Za(n));return S.createElement("g",{className:"recharts-polar-grid-angle"},a.map(c=>{var d=rr(e,t,r,c),h=rr(e,t,s,c);return S.createElement("line",Ll({key:"line-".concat(c)},l,{x1:d.x,y1:d.y,x2:h.x,y2:h.y}))}))},ZV=n=>{var e=n.cx,t=n.cy,r=n.radius,s=lT({},Za(n));return S.createElement("circle",Ll({},s,{className:Lr("recharts-polar-grid-concentric-circle",n.className),cx:e,cy:t,r}))},e9=n=>{var e=n.radius,t=lT({},Za(n));return S.createElement("path",Ll({},t,{className:Lr("recharts-polar-grid-concentric-polygon",n.className),d:L2e(e,n.cx,n.cy,n.polarAngles)}))},M2e=n=>{var e=n.polarRadius,t=n.gridType;if(!e||!e.length)return null;var r=Math.max(...e),s=n.fill&&n.fill!=="none";return S.createElement("g",{className:"recharts-polar-grid-concentric"},s&&t==="circle"&&S.createElement(ZV,Ll({},n,{radius:r})),s&&t!=="circle"&&S.createElement(e9,Ll({},n,{radius:r})),e.map((a,o)=>{var l=o;return t==="circle"?S.createElement(ZV,Ll({key:l},n,{fill:"none",radius:a})):S.createElement(e9,Ll({key:l},n,{fill:"none",radius:a}))}))},F2e={angleAxisId:0,radiusAxisId:0,gridType:"polygon",radialLines:!0,zIndex:fi.grid,stroke:"#ccc",strokeWidth:1,fill:"none"},lx=n=>{var e,t,r,s,a,o,l,c,d=ll(n,F2e),h=d.gridType,m=d.radialLines,p=d.angleAxisId,x=d.radiusAxisId,y=d.cx,v=d.cy,B=d.innerRadius,E=d.outerRadius,N=d.polarAngles,T=d.polarRadius,k=d.zIndex,P=I2e(d,_2e),R=Dt(ex),_=Dt(U=>A2e(U,p)),I=Dt(U=>N2e(U,x)),D=Array.isArray(N)?N:_,j=Array.isArray(T)?T:I;if(D==null||j==null)return null;var O=lT({cx:(e=(t=R==null?void 0:R.cx)!==null&&t!==void 0?t:y)!==null&&e!==void 0?e:0,cy:(r=(s=R==null?void 0:R.cy)!==null&&s!==void 0?s:v)!==null&&r!==void 0?r:0,innerRadius:(a=(o=R==null?void 0:R.innerRadius)!==null&&o!==void 0?o:B)!==null&&a!==void 0?a:0,outerRadius:(l=(c=R==null?void 0:R.outerRadius)!==null&&c!==void 0?c:E)!==null&&l!==void 0?l:0,polarAngles:D,polarRadius:j,zIndex:k},P),M=O.outerRadius;return M<=0?null:S.createElement(du,{zIndex:O.zIndex},S.createElement("g",{className:"recharts-polar-grid"},S.createElement(M2e,Ll({gridType:h,radialLines:m},O,{polarAngles:D,polarRadius:j})),S.createElement(O2e,Ll({gridType:h,radialLines:m},O,{polarAngles:D,polarRadius:j}))))};lx.displayName="PolarGrid";function kP(n){return Array.isArray(n)?n:Array.from(n)}function U2e(n,e=yS){if(n==null)return;const t=kP(n);if(t.length===0)return;const r=oR(e);let s,a;for(let o=0;o<t.length;o++){const l=t[o],c=r(l,o,t);c==null||Number.isNaN(c)||typeof c=="symbol"||(a===void 0||c>a)&&(a=c,s=l)}return s}function V2e(n,e=yS){if(n==null)return;const t=kP(n);if(t.length===0)return;const r=oR(e);let s,a;for(let o=0;o<t.length;o++){const l=t[o],c=r(l,o,t);c==null||Number.isNaN(c)||typeof c=="symbol"||(a===void 0||c<a)&&(a=c,s=l)}return s}var G2e={radiusAxis:{},angleAxis:{}},$X=ri({name:"polarAxis",initialState:G2e,reducers:{addRadiusAxis(n,e){n.radiusAxis[e.payload.id]=kn(e.payload)},removeRadiusAxis(n,e){delete n.radiusAxis[e.payload.id]},addAngleAxis(n,e){n.angleAxis[e.payload.id]=kn(e.payload)},removeAngleAxis(n,e){delete n.angleAxis[e.payload.id]}}}),cT=$X.actions,$2e=cT.addRadiusAxis,H2e=cT.removeRadiusAxis,z2e=cT.addAngleAxis,q2e=cT.removeAngleAxis,K2e=$X.reducer;function HX(n){return n&&typeof n=="object"&&"className"in n&&typeof n.className=="string"?n.className:""}var W2e=["type"],Y2e=["cx","cy","angle","axisLine"],Q2e=["angle","t
4710ickFormatter","stroke","tick"];function Oy(){return Oy=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Oy.apply(null,arguments)}function t9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Ol(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?t9(Object(t),!0).forEach(function(r){J2e(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):t9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function J2e(n,e,t){return(e=X2e(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function X2e(n){var e=Z2e(n,"string");return typeof e=="symbol"?e:e+""}function Z2e(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function NP(n,e){if(n==null)return{};var t,r,s=eRe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function eRe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var tRe="radiusAxis";function nRe(n){var e=ta(),t=bR(),r=S.useMemo(()=>{var s=n.type,a=NP(n,W2e),o=$S(t,"radiusAxis",s);if(o!=null)return Ol(Ol({},a),{},{type:o})},[n,t]);return S.useEffect(()=>r==null?Zm:(e($2e(r)),()=>{e(H2e(r))}),[e,r]),null}var rRe=(n,e,t,r)=>{var s=n.coordinate;return rr(t,r,s,e)},sRe=n=>{var e;switch(n){case"left":e="end";break;case"right":e="start";break;default:e="middle";break}return e},aRe=(n,e,t,r)=>{var s=U2e(r,o=>o.coordinate||0),a=V2e(r,o=>o.coordinate||0);return{cx:e,cy:t,startAngle:n,endAngle:n,innerRadius:(a==null?void 0:a.coordinate)||0,outerRadius:(s==null?void 0:s.coordinate)||0,clockWise:!1}},iRe=(n,e)=>{var t=n.cx,r=n.cy,s=n.angle,a=n.axisLine,o=NP(n,Y2e),l=e.reduce((m,p)=>[Math.min(m[0],p.coordinate),Math.max(m[1],p.coordinate)],[1/0,-1/0]),c=rr(t,r,l[0],s),d=rr(t,r,l[1],s),h=Ol(Ol(Ol({},Za(o)),{},{fill:"none"},Za(a)),{},{x1:c.x,y1:c.y,x2:d.x,y2:d.y});return S.createElement("line",Oy({className:"recharts-polar-radius-axis-line"},h))},oRe=(n,e,t)=>{var r;return S.isValidElement(n)?r=S.cloneElement(n,e):typeof n=="function"?r=n(e):r=S.createElement(aT,Oy({},e,{className:"recharts-polar-radius-axis-tick-value"}),t),r},lRe=(n,e)=>{var t=n.angle,r=n.tickFormatter,s=n.stroke,a=n.tick,o=NP(n,Q2e),l=sRe(n.orientation),c=Za(o),d=pS(a),h=e.map((m,p)=>{var x=rRe(m,n.angle,n.cx,n.cy),y=Ol(Ol(Ol(Ol({textAnchor:l,transform:"rotate(".concat(90-t,", ").concat(x.x,", ").concat(x.y,")")},c),{},{stroke:"none",fill:s},d),{},{index:p},x),{},{payload:m});return S.createElement(Hl,Oy({className:Lr("recharts-polar-radius-axis-tick",HX(a)),key:"tick-".concat(m.coordinate)},xY(n,m,p)),oRe(a,y,r?r(m.value,p):m.value))});return S.createElement(Hl,{className:"recharts-polar-radius-axis-ticks"},h)},cRe=n=>{var e=n.radiusAxisId,t=Dt(ex),r=Dt(c=>ix(c,"radiusAxis",e)),s=Dt(c=>ox(c,"radiusAxis",e,!1));if(t==null||!s||!s.length||r==null)return null;var a=Ol(Ol({},n),{},{scale:r},t),o=a.tick,l=a.axisLine;return S.createElement(du,{zIndex:a.zIndex},S.createElement(Hl,{className:Lr("recharts-polar-radius-axis",tRe,a.className)},l&&iRe(a,s),o&&lRe(a,s),S.createElement(Yje,aRe(a.angle,a.cx,a.cy,s),S.createElement(r2e,{label:a.label}),a.children)))};function _P(n){var e,t=ll(n,Al);return S.createElement(S.Fragment,null,S.createElement(nRe,{domain:t.domain,id:t.radiusAxisId,scale:t.scale,type:t.type,dataKey:t.dataKey,unit:void 0,name:t.name,allowDuplicatedCategory:t.allowDuplicatedCategory,allowDataOverflow:t.allowDataOverflow,reversed:t.reversed,includeHidden:t.includeHidden,allowDecimals:t.allowDecimals,niceTicks:(e=t.niceTicks)!==null&&e!==void 0?e:"auto",ticks:t.ticks,tickCount:t.tickCount,tick:t.tick}),S.createElement(cRe,t))}_P.displayName="PolarRadiusAxis";var dRe=["children","type"],uRe=["ref"];function Gm(){return Gm=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Gm.apply(null,arguments)}function n9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Ko(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4710e%2?n9(Object(t),!0).forEach(function(r){hRe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):n9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hRe(n,e,t){return(e=fRe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fRe(n){var e=mRe(n,"string");return typeof e=="symbol"?e:e+""}function mRe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function zX(n,e){if(n==null)return{};var t,r,s=pRe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function pRe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var r9=1e-5,gRe=Math.cos(GE(45)),xRe="angleAxis";function bRe(n){var e=ta(),t=bR(),r=S.useMemo(()=>{n.children;var o=n.type,l=zX(n,dRe),c=$S(t,"angleAxis",o);if(c!=null)return Ko(Ko({},l),{},{type:c})},[n,t]),s=Dt(o=>Zg(o,r==null?void 0:r.id)),a=r===s;return S.useEffect(()=>r==null?Zm:(e(z2e(r)),()=>{e(q2e(r))}),[e,r]),a?n.children:null}var yRe=(n,e)=>{var t=e.cx,r=e.cy,s=e.radius,a=e.orientation,o=e.tickSize,l=o||8,c=rr(t,r,s,n.coordinate),d=rr(t,r,s+(a==="inner"?-1:1)*l,n.coordinate);return{x1:c.x,y1:c.y,x2:d.x,y2:d.y}},vRe=(n,e)=>{var t=Math.cos(GE(-n.coordinate));return t>r9?e==="outer"?"start":"end":t<-r9?e==="outer"?"end":"start":"middle"},BRe=n=>{var e=Math.cos(GE(-n.coordinate)),t=Math.sin(GE(-n.coordinate));return Math.abs(e)<=gRe?t>0?"start":"end":"middle"},wRe=n=>{var e=n.cx,t=n.cy,r=n.radius,s=n.axisLineType,a=n.axisLine,o=n.ticks;if(!a)return null;var l=Ko(Ko({},Za(n)),{},{fill:"none"},Za(a));if(s==="circle")return S.createElement(SP,Gm({className:"recharts-polar-angle-axis-line"},l,{cx:e,cy:t,r}));var c=o.map(d=>rr(e,t,r,d.coordinate));return S.createElement(OX,Gm({className:"recharts-polar-angle-axis-line"},l,{points:c}))},CRe=n=>{var e=n.tick,t=n.tickProps,r=n.value;return e?S.isValidElement(e)?S.cloneElement(e,t):typeof e=="function"?e(t):S.createElement(aT,Gm({},t,{className:"recharts-polar-angle-axis-tick-value"}),r):null},ERe=n=>{var e=n.tick,t=n.tickLine,r=n.tickFormatter,s=n.stroke,a=n.ticks,o=Za(n);o.ref;var l=zX(o,uRe),c=pS(e),d=Ko(Ko({},l),{},{fill:"none"},Za(t)),h=a.map((m,p)=>{var x=yRe(m,n),y=vRe(m,n.orientation),v=BRe(m),B=Ko(Ko(Ko({},l),{},{textAnchor:y,verticalAnchor:v,stroke:"none",fill:s},c),{},{index:p,payload:m,x:x.x2,y:x.y2});return S.createElement(Hl,Gm({className:Lr("recharts-polar-angle-axis-tick",HX(e)),key:"tick-".concat(m.coordinate)},xY(n,m,p)),t&&S.createElement("line",Gm({className:"recharts-polar-angle-axis-tick-line"},d,x)),S.createElement(CRe,{tick:e,tickProps:B,value:r?r(m.value,p):m.value}))});return S.createElement(Hl,{className:"recharts-polar-angle-axis-ticks"},h)},SRe=n=>{var e=n.angleAxisId,t=Dt(ex),r=Dt(l=>ix(l,"angleAxis",e)),s=Kc(),a=Dt(l=>S2e(l,"angleAxis",e,s));if(t==null||!a||!a.length||r==null)return null;var o=Ko(Ko(Ko({},n),{},{scale:r},t),{},{radius:t.outerRadius,ticks:a});return S.createElement(du,{zIndex:o.zIndex},S.createElement(Hl,{className:Lr("recharts-polar-angle-axis",xRe,o.className)},S.createElement(wRe,o),S.createElement(ERe,o)))};function cx(n){var e,t=ll(n,Qu);return S.createElement(bRe,{id:t.angleAxisId,scale:t.scale,type:t.type,dataKey:t.dataKey,unit:void 0,name:t.name,allowDuplicatedCategory:!1,allowDataOverflow:!1,reversed:t.reversed,includeHidden:!1,allowDecimals:t.allowDecimals,tickCount:t.tickCount,niceTicks:(e=t.niceTicks)!==null&&e!==void 0?e:"auto",ticks:t.ticks,tick:t.tick,domain:t.domain},S.createElement(SRe,t))}cx.displayName="PolarAngleAxis";var TRe=n=>n&&typeof n=="object"&&"clipDot"in n?!!n.clipDot:!0;function ARe(n){var e=n.tooltipEntrySettings,t=ta(),r=Kc(),s=S.useRef(null);return S.useLayoutEffect(()=>{r||(s.current===null?t(P_e(e)):s.current!==e&&t(L_e({prev:s.current,next:e})),s.current=e)},[e,t,r]),S.useLayoutEffect(()=>()=>{s.current&&(t(O_e(s.current)),s.current=null)},[t]),null}function kRe(n){var e=n.legendPayload,t=ta(),r=Dt(ir),s=S.useRef(null);return S.useLayoutEffect(()=>{r!=="centric"&&r!=="radial"||(s.current===null?t(a1e(e)):s.current!==e&&t(i1e({prev:s.current,next:e})),s.current=e)},[t,r,e]),S.useLayoutEffect(()=>()=>{s.current&&(t(o1e(s.current)),s.current=null)},[t]),null}function NRe(n,e){return jRe(n)||DRe(n,e)||IRe(n,e)||_Re()}
4710function _Re(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4711In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function IRe(n,e){if(n){if(typeof n=="string")return s9(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?s9(n,e):void 0}}function s9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function DRe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function jRe(n){if(Array.isArray(n))return n}var IP="index",RRe="append";function DP(n,e){var t=arguments.length>2&&arguments[2]!==void 0?arguments[2]:[],r=[];for(var s of t)r.push({status:"removed",prev:s});for(var a=0;a<e.length;a++){var o=n[a],l=e[a];o!=null?r.push({status:"matched",prev:o,next:l}):r.push({status:"added",next:l})}return r}function PRe(n,e){var t=n.length/e.length,r=e.map((s,a)=>n[Math.floor(a*t)]);return DP(r,e)}function LRe(n,e){var t=e.map((r,s)=>n[s]);return DP(t,e)}function ORe(n,e){for(var t=new Map,r=0;r<n.length;r++){var s=n[r];if(s!=null){var a=e(s,r);a!=null&&!t.has(a)&&t.set(a,s)}}return t}function MRe(n,e,t){var r=ORe(n,t),s=new Set,a=e.map((m,p)=>{var x=t(m,p);if(x!=null){var y=r.get(x);if(y!==void 0)return s.add(x),y}}),o=[];for(var l of r){var c=NRe(l,2),d=c[0],h=c[1];s.has(d)||o.push(h)}return DP(a,e,o)}function qX(n,e,t){return e==null?null:n==null?e.map(r=>({status:"added",next:r})):t===IP?PRe(n,e):t===RRe?LRe(n,e):MRe(n,e,t)}function KX(n,e){var t=S.useRef(n),r=S.useRef(e.current),s=S.useRef(!0);t.current!==n&&(t.current=n,r.current=e.current,s.current=!1);var a=S.useCallback(function(o,l){var c=arguments.length>2&&arguments[2]!==void 0?arguments[2]:!0;if(l===0){s.current=!0;return}l===1&&(r.current=o),l>0&&s.current&&c&&(e.current=o)},[e]);return{startValue:r.current,syncStepValue:a}}function FRe(n,e){return $Re(n)||GRe(n,e)||VRe(n,e)||URe()}function URe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4712In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function VRe(n,e){if(n){if(typeof n=="string")return a9(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?a9(n,e):void 0}}function a9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function GRe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function $Re(n){if(Array.isArray(n))return n}function HRe(n,e){var t=S.useState(!1),r=FRe(t,2),s=r[0],a=r[1],o=S.useCallback(()=>{typeof n=="function"&&n(),a(!0)},[n]),l=S.useCallback(()=>{typeof e=="function"&&e(),a(!1)},[e]);return{isAnimating:s,handleAnimationStart:o,handleAnimationEnd:l}}function zRe(n){var e,t=n.animationInput,r=n.animationIdPrefix,s=n.items,a=n.previousItemsRef,o=n.isAnimationActive,l=n.animationBegin,c=n.animationDuration,d=n.animationEasing,h=n.onAnimationStart,m=n.onAnimationEnd,p=n.animationInterpolateFn,x=n.animationMatchBy,y=n.shouldUpdatePreviousRef,v=n.children,B=n.layout,E=vQ(t,r),N=KX(E,a),T=(e=N.startValue)!==null&&e!==void 0?e:null,k=qX(T,s,x??IP);return S.createElement(yQ,{animationId:E,begin:l,duration:c,isActive:o,easing:d,onAnimationEnd:m,onAnimationStart:h,key:E},P=>{var R=T==null,_=s==null?s:p(k,P,B),I=y?y(P):P>0;return N.syncStepValue(_,P,I),_==null?null:v(_,P,R)})}var AN;function qRe(n,e){return QRe(n)||YRe(n,e)||WRe(n,e)||KRe()}
4712function KRe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4713In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function WRe(n,e){if(n){if(typeof n=="string")return i9(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?i9(n,e):void 0}}function i9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function YRe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function QRe(n){if(Array.isArray(n))return n}var JRe=()=>{var n=S.useState(()=>Sy("uid-")),e=qRe(n,1),t=e[0];return t},XRe=(AN=Hne.useId)!==null&&AN!==void 0?AN:JRe;function ZRe(n,e){var t=XRe();return e||(n?"".concat(n,"-").concat(t):t)}var ePe=S.createContext(void 0),tPe=n=>{var e=n.id,t=n.type,r=n.children,s=ZRe("recharts-".concat(t),e);return S.createElement(ePe.Provider,{value:s},r(s))},nPe={cartesianItems:[],polarItems:[]},WX=ri({name:"graphicalItems",initialState:nPe,reducers:{addCartesianGraphicalItem:{reducer(n,e){n.cartesianItems.push(kn(e.payload))},prepare:jr()},replaceCartesianGraphicalItem:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next,a=Xo(n).cartesianItems.indexOf(kn(r));a>-1&&(n.cartesianItems[a]=kn(s))},prepare:jr()},removeCartesianGraphicalItem:{reducer(n,e){var t=Xo(n).cartesianItems.indexOf(kn(e.payload));t>-1&&n.cartesianItems.splice(t,1)},prepare:jr()},addPolarGraphicalItem:{reducer(n,e){n.polarItems.push(kn(e.payload))},prepare:jr()},removePolarGraphicalItem:{reducer(n,e){var t=Xo(n).polarItems.indexOf(kn(e.payload));t>-1&&n.polarItems.splice(t,1)},prepare:jr()},replacePolarGraphicalItem:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next,a=Xo(n).polarItems.indexOf(kn(r));a>-1&&(n.polarItems[a]=kn(s))},prepare:jr()}}}),dx=WX.actions;dx.addCartesianGraphicalItem;dx.replaceCartesianGraphicalItem;dx.removeCartesianGraphicalItem;var rPe=dx.addPolarGraphicalItem,sPe=dx.removePolarGraphicalItem,aPe=dx.replacePolarGraphicalItem,iPe=WX.reducer,oPe=n=>{var e=ta(),t=S.useRef(null);return S.useLayoutEffect(()=>{t.current===null?e(rPe(n)):t.current!==n&&e(aPe({prev:t.current,next:n})),t.current=n},[e,n]),S.useLayoutEffect(()=>()=>{t.current&&(e(sPe(t.current)),t.current=null)},[e]),null},lPe=S.memo(oPe);function cPe(n){return n[n.length-1]}function dPe(n){if(!(!vS(n)||n.length===0))return cPe(kP(n))}var uPe=["points"];function o9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function kN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?o9(Object(t),!0).forEach(function(r){hPe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):o9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function hPe(n,e,t){return(e=fPe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function fPe(n){var e=mPe(n,"string");return typeof e=="symbol"?e:e+""}function mPe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function o1(){return o1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},o1.apply(null,arguments)}function pPe(n,e){if(n==null)return{};var t,r,s=gPe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function gPe(n,e){if(n==null)return{};var t={};for(var r in n)if({}
4713.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function xPe(n){var e=n.option,t=n.dotProps,r=n.className;if(S.isValidElement(e))return S.cloneElement(e,t);if(typeof e=="function")return e(t);var s=Lr(r,typeof e!="boolean"?e.className:""),a=t??{};a.points;var o=pPe(a,uPe);return S.createElement(SP,o1({},o,{className:s}))}function bPe(n,e){return n==null?!1:e?!0:n.length===1}function yPe(n){var e=n.points,t=n.dot,r=n.className,s=n.dotClassName,a=n.dataKey,o=n.baseProps,l=n.needClip,c=n.clipPathId,d=n.zIndex,h=d===void 0?fi.scatter:d;if(!bPe(e,t))return null;var m=TRe(t),p=Wve(t),x=e.map((v,B)=>{var E,N,T=kN(kN(kN({r:3},o),p),{},{index:B,cx:(E=v.x)!==null&&E!==void 0?E:void 0,cy:(N=v.y)!==null&&N!==void 0?N:void 0,dataKey:a,value:v.value,payload:v.payload,points:e});return S.createElement(xPe,{key:"dot-".concat(B),option:t,dotProps:T,className:s})}),y={};return l&&c!=null&&(y.clipPath="url(#clipPath-".concat(m?"":"dots-").concat(c,")")),S.createElement(du,{zIndex:h},S.createElement(Hl,o1({className:r},y),x))}function l9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Nw(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?l9(Object(t),!0).forEach(function(r){vPe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):l9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function vPe(n,e,t){return(e=BPe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function BPe(n){var e=wPe(n,"string");return typeof e=="symbol"?e:e+""}function wPe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var CPe={xAxis:{},yAxis:{},zAxis:{}},YX=ri({name:"cartesianAxis",initialState:CPe,reducers:{addXAxis:{reducer(n,e){n.xAxis[e.payload.id]=kn(e.payload)},prepare:jr()},replaceXAxis:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next;n.xAxis[r.id]!==void 0&&(r.id!==s.id&&delete n.xAxis[r.id],n.xAxis[s.id]=kn(s))},prepare:jr()},removeXAxis:{reducer(n,e){delete n.xAxis[e.payload.id]},prepare:jr()},addYAxis:{reducer(n,e){n.yAxis[e.payload.id]=kn(e.payload)},prepare:jr()},replaceYAxis:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next;n.yAxis[r.id]!==void 0&&(r.id!==s.id&&delete n.yAxis[r.id],n.yAxis[s.id]=kn(s))},prepare:jr()},removeYAxis:{reducer(n,e){delete n.yAxis[e.payload.id]},prepare:jr()},addZAxis:{reducer(n,e){n.zAxis[e.payload.id]=kn(e.payload)},prepare:jr()},replaceZAxis:{reducer(n,e){var t=e.payload,r=t.prev,s=t.next;n.zAxis[r.id]!==void 0&&(r.id!==s.id&&delete n.zAxis[r.id],n.zAxis[s.id]=kn(s))},prepare:jr()},removeZAxis:{reducer(n,e){delete n.zAxis[e.payload.id]},prepare:jr()},updateYAxisWidth(n,e){var t=e.payload,r=t.id,s=t.width,a=n.yAxis[r];if(a){var o,l=a.widthHistory||[];if(l.length===3&&l[0]===l[2]&&s===l[1]&&s!==a.width&&Math.abs(s-((o=l[0])!==null&&o!==void 0?o:0))<=1)return;var c=[...l,s].slice(-3);n.yAxis[r]=Nw(Nw({},a),{},{width:s,widthHistory:c})}},updateXAxisHeight(n,e){var t=e.payload,r=t.id,s=t.height,a=n.xAxis[r];if(a){var o,l=a.heightHistory||[];if(l.length===3&&l[0]===l[2]&&s===l[1]&&s!==a.height&&Math.abs(s-((o=l[0])!==null&&o!==void 0?o:0))<=1)return;var c=[...l,s].slice(-3);n.xAxis[r]=Nw(Nw({},a),{},{height:s,heightHistory:c})}}}}),ql=YX.actions;ql.addXAxis;ql.replaceXAxis;ql.removeXAxis;ql.addYAxis;ql.replaceYAxis;ql.removeYAxis;ql.addZAxis;ql.replaceZAxis;ql.removeZAxis;ql.updateYAxisWidth;ql.updateXAxisHeight;var EPe=YX.reducer,SPe=Be([Ma],n=>({top:n.top,bottom:n.bottom,left:n.left,right:n.right})),TPe=Be([SPe,iu,ou],(n,e,t)=>{if(!(!n||e==null||t==null))return{x:n.left,y:n.top,width:Math.max(0,e-n.left-n.right),height:Math.max(0,t-n.top-n.bottom)}}),APe=()=>Dt(TPe),kPe=()=>Dt(PIe);function c9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function NN(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4713e%2?c9(Object(t),!0).forEach(function(r){NPe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):c9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function NPe(n,e,t){return(e=_Pe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _Pe(n){var e=IPe(n,"string");return typeof e=="symbol"?e:e+""}function IPe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var DPe=n=>{var e=n.point,t=n.childIndex,r=n.mainColor,s=n.activeDot,a=n.dataKey,o=n.clipPath;if(s===!1||e.x==null||e.y==null)return null;var l={index:t,dataKey:a,cx:e.x,cy:e.y,r:4,fill:r??"none",strokeWidth:2,stroke:"#fff",payload:e.payload,value:e.value},c=NN(NN(NN({},l),pS(s)),iR(s)),d;return S.isValidElement(s)?d=S.cloneElement(s,c):typeof s=="function"?d=s(c):d=S.createElement(SP,c),S.createElement(Hl,{className:"recharts-active-dot",clipPath:o},d)};function jPe(n){var e=n.points,t=n.mainColor,r=n.activeDot,s=n.itemDataKey,a=n.clipPath,o=n.zIndex,l=o===void 0?fi.activeDot:o,c=Dt(Py),d=kPe();if(e==null||d==null)return null;var h=e.find(m=>d.includes(m.payload));return ei(h)?null:S.createElement(du,{zIndex:l},S.createElement(DPe,{point:h,childIndex:Number(c),mainColor:t,dataKey:s,activeDot:r,clipPath:a}))}function d9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function l1(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?d9(Object(t),!0).forEach(function(r){RPe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):d9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function RPe(n,e,t){return(e=PPe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PPe(n){var e=LPe(n,"string");return typeof e=="symbol"?e:e+""}function LPe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var QX=(n,e)=>ix(n,"radiusAxis",e),OPe=Be([QX],n=>{if(n!=null)return{scale:n}}),MPe=Be([jv,QX],(n,e)=>{if(!(n==null||e==null))return l1(l1({},n),{},{scale:e})}),FPe=(n,e,t,r)=>ox(n,"radiusAxis",e,r),JX=(n,e,t)=>Zg(n,t),XX=(n,e,t)=>ix(n,"angleAxis",t),UPe=Be([JX,XX],(n,e)=>{if(!(n==null||e==null))return l1(l1({},n),{},{scale:e})}),VPe=(n,e,t,r)=>ox(n,"angleAxis",t,r),GPe=Be([JX,XX,ex],(n,e,t)=>{if(!(t==null||e==null))return{scale:e,type:n.type,dataKey:n.dataKey,cx:t.cx,cy:t.cy}}),$Pe=(n,e,t,r,s)=>s,HPe=Be([ir,MPe,FPe,UPe,VPe],(n,e,t,r,s)=>au(n,"radiusAxis")?LE(e,t,!1):LE(r,s,!1)),zPe=Be([MX,$Pe],(n,e)=>{if(n!=null){var t=n.find(r=>r.type==="radar"&&e===r.id);return t==null?void 0:t.dataKey}}),qPe=Be([OPe,GPe,US,zPe,HPe],(n,e,t,r,s)=>{var a=t.chartData,o=t.dataStartIndex,l=t.dataEndIndex;if(!(n==null||e==null||a==null||s==null||r==null)){var c=a.slice(o,l+1);return n5e({radiusAxis:n,angleAxis:e,displayedData:c,dataKey:r,bandSize:s})}}),KPe=["id"];function My(){return My=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},My.apply(null,arguments)}function u9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function Hi(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?u9(Object(t),!0).forEach(function(r){WPe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):u9(Object(t)).forEac
4713h(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function WPe(n,e,t){return(e=YPe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function YPe(n){var e=QPe(n,"string");return typeof e=="symbol"?e:e+""}function QPe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function JPe(n,e){if(n==null)return{};var t,r,s=XPe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function XPe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function jP(n,e){return n&&n!=="none"?n:e}var ZPe=n=>{var e=n.dataKey,t=n.name,r=n.stroke,s=n.fill,a=n.legendType,o=n.hide;return[{inactive:o,dataKey:e,type:a,color:jP(r,s),value:oQ(t,e),payload:n}]},e5e=S.memo(n=>{var e=n.dataKey,t=n.stroke,r=n.strokeWidth,s=n.fill,a=n.name,o=n.hide,l=n.tooltipType,c=n.id,d={dataDefinedOnItem:void 0,getPosition:Zm,settings:{stroke:t,strokeWidth:r,fill:s,nameKey:void 0,dataKey:e,name:oQ(a,e),hide:o,type:l,color:jP(t,s),unit:"",graphicalItemId:c}};return S.createElement(ARe,{tooltipEntrySettings:d})});function t5e(n){var e=n.points,t=n.props,r=t.dot,s=t.dataKey;t.id;var a=JPe(t,KPe),o=Za(a);return S.createElement(yPe,{points:e,dot:r,className:"recharts-radar-dots",dotClassName:"recharts-radar-dot",dataKey:s,baseProps:o})}function n5e(n){var e=n.radiusAxis,t=n.angleAxis,r=n.displayedData,s=n.dataKey,a=n.bandSize,o=t.cx,l=t.cy,c=!1,d=[],h=t.type!=="number"?a??0:0;r.forEach((p,x)=>{var y,v,B=Qs(p,t.dataKey,x),E=Qs(p,s),N=((y=t.scale.map(B))!==null&&y!==void 0?y:0)+h,T=Array.isArray(E)?dPe(E):E,k=ei(T)?0:(v=e.scale.map(T))!==null&&v!==void 0?v:0;Array.isArray(E)&&E.length>=2&&(c=!0),d.push(Hi(Hi({},rr(o,l,k,N)),{},{name:B,value:E,cx:o,cy:l,radius:k,angle:N,payload:p}))});var m=[];return c&&d.forEach(p=>{if(Array.isArray(p.value)){var x,y=p.value[0],v=ei(y)?0:(x=e.scale.map(y))!==null&&x!==void 0?x:0;m.push(Hi(Hi({},p),{},{radius:v},rr(o,l,v,p.angle)))}else m.push(p)}),{points:d,isRange:c,baseLinePoints:m}}function r5e(n){var e=n.showLabels,t=n.points,r=n.children,s=t.map(a=>{var o,l={x:a.x,y:a.y,width:0,lowerWidth:0,upperWidth:0,height:0};return Hi(Hi({},l),{},{value:(o=a.value)!==null&&o!==void 0?o:"",payload:a.payload,parentViewBox:void 0,viewBox:l,fill:void 0})});return S.createElement(l2e,{value:e?s:void 0},r)}function s5e(n){var e=n.points,t=n.baseLinePoints,r=n.props;if(e==null)return null;var s=r.shape,a=r.isRange,o=r.connectNulls,l=h=>{var m=r.onMouseEnter;m&&m(r,h)},c=h=>{var m=r.onMouseLeave;m&&m(r,h)},d;return S.isValidElement(s)?d=S.cloneElement(s,Hi(Hi({},r),{},{points:e})):typeof s=="function"?d=s(Hi(Hi({},r),{},{points:e})):d=S.createElement(OX,My({},Ka(r),{onMouseEnter:l,onMouseLeave:c,points:e,baseLinePoints:a?t:void 0,connectNulls:o})),S.createElement(Hl,{className:"recharts-radar-polygon"},d,S.createElement(t5e,{props:r,points:e}))}var a5e=(n,e)=>n==null?[]:e===1?n.flatMap(t=>t.status==="removed"?[]:[t.next]):n.flatMap(t=>t.status==="removed"?[]:t.status==="matched"?[Hi(Hi({},t.next),{},{x:Dd(t.prev.x,t.next.x,e),y:Dd(t.prev.y,t.next.y,e)})]:[Hi(Hi({},t.next),{},{x:Dd(t.next.cx,t.next.x,e),y:Dd(t.next.cy,t.next.y,e)})]);function i5e(n){var e=n.props,t=n.previousPointsRef,r=n.previousBaseLinePointsRef,s=e.points,a=e.baseLinePoints,o=e.isAnimationActive,l=e.animationBegin,c=e.animationDuration,d=e.animationEasing,h=e.animationMatchBy,m=e.animationInterpolateFn,p=e.onAnimationStart,x=e.onAnimationEnd,y=KX(e,r),v=y.startValue,B=qX(v??null,a,h),E=HRe(p,x),N=E.isAnimating,T=E.handleAnimationStart,k=E.handleAnimationEnd,P=bR();return P==null?null:S.createElement(r5e,{showLabels:!N,points:s},S.createElement(zRe,{animationInput:e,animationIdPrefix:"recharts-radar-",items:s,previousItemsRef:t,isAnimationActive:o,animationBegin:l,animationDuration:c,animationEasing:d,onAnimationStart:T,onAnimationEnd:k,animationInterpolateFn:m,animationMatchBy:h,layout:P},(R,_)=>{var I=_===1?a:m(B,_,P);return y.syncStepValue(I,_),S.createElement(s5e,{points:R,baseLinePoints:I,props:e})}),S.createElement(u2e,{label:e.label}),e.children)}function o5e(n){var e=S.useRef(void 0),t=S.useRef(void 0);return S.createElement(i5e,{props:n,previousPointsRef:e,previousBaseLinePointsRef:t})}var l5e={activeDot:!0,angleAxisId:0,animationBegin:0,animationDuration:1500,animationEasing:"ease",animationMatchBy:IP,animationInterpolateFn:a5e,dot:!1,hide:!1,isAnimationActive:"auto",label:!1,legendT
4713ype:"rect",radiusAxisId:0,zIndex:fi.area};function c5e(n){var e=n.hide,t=n.className,r=n.points;if(e)return null;var s=Lr("recharts-radar",t);return S.createElement(du,{zIndex:n.zIndex},S.createElement(Hl,{className:s},S.createElement(o5e,n)),S.createElement(jPe,{points:r,mainColor:jP(n.stroke,n.fill),itemDataKey:n.dataKey,activeDot:n.activeDot}))}function d5e(n){var e=Kc(),t=Dt(r=>qPe(r,n.radiusAxisId,n.angleAxisId,e,n.id));return(t==null?void 0:t.points)==null?null:S.createElement(c5e,My({},n,{points:t==null?void 0:t.points,baseLinePoints:t==null?void 0:t.baseLinePoints,isRange:t==null?void 0:t.isRange}))}function ux(n){var e=ll(n,l5e);return S.createElement(tPe,{id:e.id,type:"radar"},t=>S.createElement(S.Fragment,null,S.createElement(lPe,{type:"radar",id:t,data:void 0,dataKey:e.dataKey,hide:e.hide,angleAxisId:e.angleAxisId,radiusAxisId:e.radiusAxisId}),S.createElement(kRe,{legendPayload:ZPe(e)}),S.createElement(e5e,{dataKey:e.dataKey,stroke:e.stroke,strokeWidth:e.strokeWidth,fill:e.fill,name:e.name,hide:e.hide,tooltipType:e.tooltipType,id:t}),S.createElement(d5e,My({},e,{id:t}))))}ux.displayName="Radar";var u5e=n=>{var e=n.chartData,t=ta(),r=Kc();return S.useEffect(()=>r?()=>{}:(t(TV(e)),()=>{t(TV(void 0))}),[e,t,r]),null},h9={x:0,y:0,width:0,height:0,padding:{top:0,right:0,bottom:0,left:0}},ZX=ri({name:"brush",initialState:h9,reducers:{setBrushSettings(n,e){return e.payload==null?h9:e.payload}}});ZX.actions.setBrushSettings;var h5e=ZX.reducer,f5e={dots:[],areas:[],lines:[]},eZ=ri({name:"referenceElements",initialState:f5e,reducers:{addDot:(n,e)=>{n.dots.push(e.payload)},removeDot:(n,e)=>{var t=Xo(n).dots.findIndex(r=>r===e.payload);t!==-1&&n.dots.splice(t,1)},addArea:(n,e)=>{n.areas.push(e.payload)},removeArea:(n,e)=>{var t=Xo(n).areas.findIndex(r=>r===e.payload);t!==-1&&n.areas.splice(t,1)},addLine:(n,e)=>{n.lines.push(kn(e.payload))},removeLine:(n,e)=>{var t=Xo(n).lines.findIndex(r=>r===e.payload);t!==-1&&n.lines.splice(t,1)}}}),hx=eZ.actions;hx.addDot;hx.removeDot;hx.addArea;hx.removeArea;hx.addLine;hx.removeLine;var m5e=eZ.reducer;function p5e(n,e){return y5e(n)||b5e(n,e)||x5e(n,e)||g5e()}function g5e(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4714In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function x5e(n,e){if(n){if(typeof n=="string")return f9(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?f9(n,e):void 0}}function f9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function b5e(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function y5e(n){if(Array.isArray(n))return n}var v5e=S.createContext(void 0),B5e=n=>{var e=n.children,t=S.useState("".concat(Sy("recharts"),"-clip")),r=p5e(t,1),s=r[0],a=APe();if(a==null)return null;var o=a.x,l=a.y,c=a.width,d=a.height;return S.createElement(v5e.Provider,{value:s},S.createElement("defs",null,S.createElement("clipPath",{id:s},S.createElement("rect",{x:o,y:l,height:d,width:c}))),e)},w5e={xAxis:{},yAxis:{}},tZ=ri({name:"renderedTicks",initialState:w5e,reducers:{setRenderedTicks:(n,e)=>{var t=e.payload,r=t.axisType,s=t.axisId,a=t.ticks;n[r][s]=kn(a)},removeRenderedTicks:(n,e)=>{var t=e.payload,r=t.axisType,s=t.axisId;delete n[r][s]}}}),nZ=tZ.actions;nZ.setRenderedTicks;nZ.removeRenderedTicks;var C5e=tZ.reducer,E5e={},rZ=ri({name:"errorBars",initialState:E5e,reducers:{addErrorBar:(n,e)=>{var t=e.payload,r=t.itemId,s=t.errorBar;n[r]||(n[r]=[]),n[r].push(s)},replaceErrorBar:(n,e)=>{var t=e.payload,r=t.itemId,s=t.prev,a=t.next;n[r]&&(n[r]=n[r].map(o=>o.dataKey===s.dataKey&&o.direction===s.direction?a:o))},removeErrorBar:(n,e)=>{var t=e.payload,r=t.itemId,s=t.errorBar;n[r]&&(n[r]=n[r].filter(a=>a.dataKey!==s.dataKey||a.direction!==s.direction))}}}),RP=rZ.actions;RP.addErrorBar;RP.replaceErrorBar;RP.removeErrorBar;var S5e=rZ.reducer,T5e=(n,e)=>e,PP=Be([T5e,ir,ex,pa,uX,cu,WIe,Ma],tDe);function A5e(n){return"getBBox"in n.currentTarget&&typeof n.currentTarget.getBBox=="function"}function LP(n){var e=n.currentTarget.getBoundingClientRect(),t,r;if(A5e(n)){var s=n.currentTarget.getBBox();t=s.width>0?e.width/s.width:1,r=s.height>0?e.height/s.height:1}else{var a=n.currentTarget;t=a.offsetWidth>0?e.width/a.offsetWidth:1,r=a.offsetHeight>0?e.height/a.offsetHeight:1}var o=(l,c)=>({relativeX:Math.round((l-e.left)/t),relativeY:Math.round((c-e.top)/r)});return"touches"in n?Array.from(n.touches).map(l=>o(l.clientX,l.clientY)):o(n.clientX,n.clientY)}var sZ=No("mouseClick"),aZ=Av();aZ.startListening({actionCreator:sZ,effect:(n,e)=>{var t=n.payload,r=PP(e.getState(),LP(t));(r==null?void 0:r.activeIndex)!=null&&e.dispatch(U_e({activeIndex:r.activeIndex,activeDataKey:void 0,activeCoordinate:r.activeCoordinate}))}});var iD=No("mouseMove"),iZ=Av(),Qp=null,Tf=null,_N=null;iZ.startListening({actionCreator:iD,effect:(n,e)=>{var t=n.payload,r=e.getState(),s=r.eventSettings,a=s.throttleDelay,o=s.throttledEvents,l=o==="all"||(o==null?void 0:o.includes("mousemove"));Qp!==null&&(cancelAnimationFrame(Qp),Qp=null),Tf!==null&&(typeof a!="number"||!l)&&(clearTimeout(Tf),Tf=null),_N=LP(t);var c=()=>{var d=e.getState(),h=$v(d,d.tooltip.settings.shared);if(!_N){Qp=null,Tf=null;return}if(h==="axis"){var m=PP(d,_N);(m==null?void 0:m.activeIndex)!=null?e.dispatch(tX({activeIndex:m.activeIndex,activeDataKey:void 0,activeCoordinate:m.activeCoordinate})):e.dispatch(eX())}Qp=null,Tf=null};if(!l){c();return}a==="raf"?Qp=requestAnimationFrame(c):typeof a=="number"&&Tf===null&&(Tf=setTimeout(c,a))}});function k5e(n,e){return e instanceof HTMLElement?"HTMLElement <".concat(e.tagName,' class="').concat(e.className,'">'):e===window?"global.window":n==="children"&&typeof e=="object"&&e!==null?"<<CHILDREN>
4714>":e}var m9={accessibilityLayer:!0,barCategoryGap:"10%",barGap:4,barSize:void 0,className:void 0,maxBarSize:void 0,stackOffset:"none",syncId:void 0,syncMethod:"index",baseValue:void 0,reverseStackOrder:!1},oZ=ri({name:"rootProps",initialState:m9,reducers:{updateOptions:(n,e)=>{var t;n.accessibilityLayer=e.payload.accessibilityLayer,n.barCategoryGap=e.payload.barCategoryGap,n.barGap=(t=e.payload.barGap)!==null&&t!==void 0?t:m9.barGap,n.barSize=e.payload.barSize,n.maxBarSize=e.payload.maxBarSize,n.stackOffset=e.payload.stackOffset,n.syncId=e.payload.syncId,n.syncMethod=e.payload.syncMethod,n.className=e.payload.className,n.baseValue=e.payload.baseValue,n.reverseStackOrder=e.payload.reverseStackOrder}}}),N5e=oZ.reducer,_5e=oZ.actions.updateOptions,I5e=null,D5e={updatePolarOptions:(n,e)=>n===null?e.payload:(n.startAngle=e.payload.startAngle,n.endAngle=e.payload.endAngle,n.cx=e.payload.cx,n.cy=e.payload.cy,n.innerRadius=e.payload.innerRadius,n.outerRadius=e.payload.outerRadius,n)},lZ=ri({name:"polarOptions",initialState:I5e,reducers:D5e}),j5e=lZ.actions.updatePolarOptions,R5e=lZ.reducer,cZ=No("keyDown"),dZ=No("focus"),uZ=No("blur"),dT=Av(),Jp=null,Af=null,_w=null;dT.startListening({actionCreator:cZ,effect:(n,e)=>{_w=n.payload,Jp!==null&&(cancelAnimationFrame(Jp),Jp=null);var t=e.getState(),r=t.eventSettings,s=r.throttleDelay,a=r.throttledEvents,o=a==="all"||a.includes("keydown");Af!==null&&(typeof s!="number"||!o)&&(clearTimeout(Af),Af=null);var l=()=>{try{var c=e.getState(),d=c.rootProps.accessibilityLayer!==!1;if(!d)return;var h=c.tooltip.keyboardInteraction,m=_w;if(m!=="ArrowRight"&&m!=="ArrowLeft"&&m!=="Enter")return;var p=Wb(h,Vm(c),Eg(c),Sg(c)),x=p==null?-1:Number(p),y=!Number.isFinite(x)||x<0,v=cu(c),B=Vm(c),E=$v(c,c.tooltip.settings.shared);if(m==="Enter"){if(y)return;var N=s1(c,E,"hover",String(h.index));e.dispatch(r1({active:!h.active,activeIndex:h.index,activeCoordinate:N}));return}var T=__e(c),k=T==="left-to-right"?1:-1,P=m==="ArrowRight"?1:-1,R;if(y){var _=Eg(c),I=Sg(c),D=P*k,j=ie=>({active:!1,index:String(ie),dataKey:void 0,graphicalItemId:void 0,coordinate:void 0});if(R=-1,D>0){for(var O=0;O<B.length;O++)if(Wb(j(O),B,_,I)!=null){R=O;break}}else for(var M=B.length-1;M>=0;M--)if(Wb(j(M),B,_,I)!=null){R=M;break}if(R<0)return}else{R=x+P*k;var U=(v==null?void 0:v.length)||B.length;if(U===0||R>=U||R<0)return}var ee=s1(c,E,"hover",String(R));e.dispatch(r1({active:!0,activeIndex:R.toString(),activeCoordinate:ee}))}finally{Jp=null,Af=null}};if(!o){l();return}s==="raf"?Jp=requestAnimationFrame(l):typeof s=="number"&&Af===null&&(l(),_w=null,Af=setTimeout(()=>{_w?l():(Af=null,Jp=null)},s))}});dT.startListening({actionCreator:dZ,effect:(n,e)=>{var t=e.getState(),r=t.rootProps.accessibilityLayer!==!1;if(r){var s=t.tooltip.keyboardInteraction;if(!s.active&&s.index==null){var a="0",o=$v(t,t.tooltip.settings.shared),l=s1(t,o,"hover",String(a));e.dispatch(r1({active:!0,activeIndex:a,activeCoordinate:l}))}}}});dT.startListening({actionCreator:uZ,effect:(n,e)=>{var t=e.getState(),r=t.rootProps.accessibilityLayer!==!1;if(r){var s=t.tooltip.keyboardInteraction;s.active&&e.dispatch(r1({active:!1,activeIndex:s.index,activeCoordinate:s.coordinate}))}}});function hZ(n){n.persist();var e=n.currentTarget;return new Proxy(n,{get:(t,r)=>{if(r==="currentTarget")return e;var s=Reflect.get(t,r);return typeof s=="function"?s.bind(t):s}})}var $o=No("externalEvent"),fZ=Av(),Iw=new Map,hb=new Map,IN=new Map;fZ.startListening({actionCreator:$o,effect:(n,e)=>{var t=n.payload,r=t.handler,s=t.reactEvent;if(r!=null){var a=s.type,o=hZ(s);IN.set(a,{handler:r,reactEvent:o});var l=Iw.get(a);l!==void 0&&(cancelAnimationFrame(l),Iw.delete(a));var c=e.getState(),d=c.eventSettings,h=d.throttleDelay,m=d.throttledEvents,p=m,x=p==="all"||(p==null?void 0:p.includes(a)),y=hb.get(a);y!==void 0&&(typeof h!="number"||!x)&&(clearTimeout(y),hb.delete(a));var v=()=>{var N=IN.get(a);try{if(!N)return;var T=N.handler,k=N.reactEvent,P=e.getState(),R={activeCoordinate:DIe(P),activeDataKey:NIe(P),activeIndex:Py(P),activeLabel:mX(P),activeTooltipIndex:Py(P),isTooltipActive:jIe(P)};T&&T(R,k)}finally{Iw.delete(a),hb.delete(a),IN.delete(a)}};if(!x){v();return}if(h==="raf"){var B=requestAnimationFrame(v);Iw.set(a,B)}else if(typeof h=="number"){if(!hb.has(a)){v();var E=setTimeout(v,h);hb.set(a,E)}}else v()}}});var P5e=Be([ax],n=>n.tooltipItemPayloads),L5e=Be([P5e,(n,e)=>e,(n,e,t)=>t],(n,e,t)=>{if(e!=null){var r=n.find(a=>a.settings.graphicalItemId===t);if(r!=null){var s=r.getPosition;if(s!=null)return s(e)}}}),mZ=No("touchMove"),pZ=Av(),kf=null,Hu=null,p9=null,fb=null;pZ.startListening({actionCreator:mZ,effect:(n,e)=>{var t=n.payload;if(!(t.touches==null||t.touches.length===0)){fb=hZ(t);var r=e.getState(),s=r.eventSettings,a=s.throttleDelay,o=s.throttledEvents,l=o==="all"||o.includes("touchmove");kf!==null&&(cancelAnimationFrame(kf),kf=null),Hu!==null&&(typeof a!="number"||!l)&&(clearTimeout(Hu),Hu=null),p9=Array.from(t.touches).map(d=>LP({clientX:d.clientX,clientY:d.clientY,currentTarget:t.currentTarget}));var c=()=>
4714{if(fb!=null){var d=e.getState(),h=$v(d,d.tooltip.settings.shared);if(h==="axis"){var m,p=(m=p9)===null||m===void 0?void 0:m[0];if(p==null){kf=null,Hu=null;return}var x=PP(d,p);(x==null?void 0:x.activeIndex)!=null&&e.dispatch(tX({activeIndex:x.activeIndex,activeDataKey:void 0,activeCoordinate:x.activeCoordinate}))}else if(h==="item"){var y,v=fb.touches[0];if(document.elementFromPoint==null||v==null)return;var B=document.elementFromPoint(v.clientX,v.clientY);if(!B||!B.getAttribute)return;var E=B.getAttribute(yEe),N=(y=B.getAttribute(vEe))!==null&&y!==void 0?y:void 0,T=rp(d).find(R=>R.id===N);if(E==null||T==null||N==null)return;var k=T.dataKey,P=L5e(d,E,N);e.dispatch(F_e({activeDataKey:k,activeIndex:E,activeCoordinate:P,activeGraphicalItemId:N}))}kf=null,Hu=null}};if(!l){c();return}a==="raf"?kf=requestAnimationFrame(c):typeof a=="number"&&Hu===null&&(c(),fb=null,Hu=setTimeout(()=>{fb?c():(Hu=null,kf=null)},a))}}});var gZ={throttleDelay:"raf",throttledEvents:["mousemove","touchmove","pointermove","scroll","wheel"]},xZ=ri({name:"eventSettings",initialState:gZ,reducers:{setEventSettings:(n,e)=>{e.payload.throttleDelay!=null&&(n.throttleDelay=e.payload.throttleDelay),e.payload.throttledEvents!=null&&(n.throttledEvents=kn(e.payload.throttledEvents))}}}),O5e=xZ.actions.setEventSettings,M5e=xZ.reducer,F5e=DY({brush:h5e,cartesianAxis:EPe,chartData:DDe,errorBars:S5e,eventSettings:M5e,graphicalItems:iPe,layout:sEe,legend:l1e,options:ADe,polarAxis:K2e,polarOptions:R5e,referenceElements:m5e,renderedTicks:C5e,rootProps:N5e,tooltip:V_e,zIndex:mDe}),U5e=function(e){var t=arguments.length>1&&arguments[1]!==void 0?arguments[1]:"Chart";return NCe({reducer:F5e,preloadedState:e,middleware:r=>{var s;return r({serializableCheck:!1,immutableCheck:!["commonjs","es6","production"].includes((s="es6")!==null&&s!==void 0?s:"")}).concat([aZ.middleware,iZ.middleware,dT.middleware,fZ.middleware,pZ.middleware])},enhancers:r=>{var s=r;return typeof r=="function"&&(s=r()),s.concat(KY({type:"raf"}))},devTools:{serialize:{replacer:k5e},name:"recharts-".concat(t)}})};function V5e(n){var e=n.preloadedState,t=n.children,r=n.reduxStoreName,s=Kc(),a=S.useRef(null);if(s)return t;a.current==null&&(a.current=U5e(e,r));var o=lR;return S.createElement(E1e,{context:o,store:a.current},t)}function G5e(n){var e=n.layout,t=n.margin,r=ta(),s=Kc();return S.useEffect(()=>{s||(r(tEe(e)),r(eEe(t)))},[r,s,e,t]),null}var $5e=S.memo(G5e,fQ);function H5e(n){var e=ta();return S.useEffect(()=>{e(_5e(n))},[e,n]),null}var z5e=n=>{var e=ta();return S.useEffect(()=>{e(O5e(n))},[e,n]),null},q5e=S.memo(z5e,fQ);function g9(n){var e=n.zIndex,t=n.isPanorama,r=S.useRef(null),s=ta();return S.useLayoutEffect(()=>(r.current&&s(hDe({zIndex:e,element:r.current,isPanorama:t})),()=>{s(fDe({zIndex:e,isPanorama:t}))}),[s,e,t]),S.createElement("g",{tabIndex:-1,ref:r,className:"recharts-zIndex-layer_".concat(e)})}function x9(n){var e=n.children,t=n.isPanorama,r=Dt(rDe);if(!r||r.length===0)return e;var s=r.filter(o=>o<0),a=r.filter(o=>o>0);return S.createElement(S.Fragment,null,s.map(o=>S.createElement(g9,{key:o,zIndex:o,isPanorama:t})),e,a.map(o=>S.createElement(g9,{key:o,zIndex:o,isPanorama:t})))}var K5e=["children"];function W5e(n,e){if(n==null)return{};var t,r,s=Y5e(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function Y5e(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function c1(){return c1=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},c1.apply(null,arguments)}var Q5e={width:"100%",height:"100%",display:"block"},J5e=S.forwardRef((n,e)=>{var t=t1e(),r=n1e(),s=pQ();if(!Vh(t)||!Vh(r))return null;var a=n.children,o=n.otherAttributes,l=n.title,c=n.desc,d,h;return o!=null&&(typeof o.tabIndex=="number"?d=o.tabIndex:d=s?0:void 0,typeof o.role=="string"?h=o.role:h=s?"application":void 0),S.createElement(JW,c1({},o,{title:l,desc:c,role:h,tabIndex:d,width:t,height:r,style:Q5e,ref:e}),a)}),X5e=n=>{var e=n.children,t=Dt(LS);if(!t)return null;var r=t.width,s=t.height,a=t.y,o=t.x;return S.createElement(JW,{width:r,height:s,x:o,y:a},e)},b9=S.forwardRef((n,e)=>{var t=n.children,r=W5e(n,K5e),s=Kc();return s?S.createElement(X5e,null,S.createElement(x9,{isPanorama:!0},t)):S.createElement(J5e,c1({ref:e},r),S.createElement(x9,{isPanorama:!1},t))});function Z5e(n,e){return rLe(n)||nLe(n,e)||tLe(n,e)||eLe()}
4714function eLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4715In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function tLe(n,e){if(n){if(typeof n=="string")return y9(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?y9(n,e):void 0}}function y9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function nLe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function rLe(n){if(Array.isArray(n))return n}function sLe(){var n=ta(),e=S.useState(null),t=Z5e(e,2),r=t[0],s=t[1],a=Dt(bEe);return S.useEffect(()=>{if(r!=null){var o=r.getBoundingClientRect(),l=o.width/r.offsetWidth;nr(l)&&l!==a&&n(rEe(l))}},[r,n,a]),s}function v9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function aLe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?v9(Object(t),!0).forEach(function(r){iLe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):v9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function iLe(n,e,t){return(e=oLe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function oLe(n){var e=lLe(n,"string");return typeof e=="symbol"?e:e+""}function lLe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function Ch(){return Ch=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},Ch.apply(null,arguments)}function d1(n,e){return hLe(n)||uLe(n,e)||dLe(n,e)||cLe()}function cLe(){throw new TypeError(`Invalid attempt to destructure non-iterable instance.
4716In order to be iterable, non-array objects must have a [Symbol.iterator]() method.`)}function dLe(n,e){if(n){if(typeof n=="string")return B9(n,e);var t={}.toString.call(n).slice(8,-1);return t==="Object"&&n.constructor&&(t=n.constructor.name),t==="Map"||t==="Set"?Array.from(n):t==="Arguments"||/^(?:Ui|I)nt(?:8|16|32)(?:Clamped)?Array$/.test(t)?B9(n,e):void 0}}function B9(n,e){(e==null||e>n.length)&&(e=n.length);for(var t=0,r=Array(e);t<e;t++)r[t]=n[t];return r}function uLe(n,e){var t=n==null?null:typeof Symbol<"u"&&n[Symbol.iterator]||n["@@iterator"];if(t!=null){var r,s,a,o,l=[],c=!0,d=!1;try{if(a=(t=t.call(n)).next,e!==0)for(;!(c=(r=a.call(t)).done)&&(l.push(r.value),l.length!==e);c=!0);}catch(h){d=!0,s=h}finally{try{if(!c&&t.return!=null&&(o=t.return(),Object(o)!==o))return}finally{if(d)throw s}}return l}}function hLe(n){if(Array.isArray(n))return n}var fLe=()=>(VDe(),null);function u1(n){if(typeof n=="number")return n;if(typeof n=="string"){var e=parseFloat(n);if(!Number.isNaN(e))return e}return 0}var mLe=S.forwardRef((n,e)=>{var t,r,s=S.useRef(null),a=S.useState({containerWidth:u1((t=n.style)===null||t===void 0?void 0:t.width),containerHeight:u1((r=n.style)===null||r===void 0?void 0:r.height)}),o=d1(a,2),l=o[0],c=o[1],d=S.useCallback((m,p)=>{c(x=>{var y=Math.round(m),v=Math.round(p);return x.containerWidth===y&&x.containerHeight===v?x:{containerWidth:y,containerHeight:v}})},[]),h=S.useCallback(m=>{if(typeof e=="function"&&e(m),s.current!=null&&(s.current.disconnect(),s.current=null),m!=null&&typeof ResizeObserver<"u"){var p=m.getBoundingClientRect(),x=p.width,y=p.height;d(x,y);var v=E=>{var N=E[0];if(N!=null){var T=N.contentRect,k=T.width,P=T.height;d(k,P)}},B=new ResizeObserver(v);B.observe(m),s.current=B}},[e,d]);return S.useEffect(()=>()=>{var m=s.current;m!=null&&m.disconnect()},[d]),S.createElement(S.Fragment,null,S.createElement(_v,{width:l.containerWidth,height:l.containerHeight}),S.createElement("div",Ch({ref:h},n)))}),pLe=S.forwardRef((n,e)=>{var t=n.width,r=n.height,s=S.useState({containerWidth:u1(t),containerHeight:u1(r)}),a=d1(s,2),o=a[0],l=a[1],c=S.useCallback((h,m)=>{l(p=>{var x=Math.round(h),y=Math.round(m);return p.containerWidth===x&&p.containerHeight===y?p:{containerWidth:x,containerHeight:y}})},[]),d=S.useCallback(h=>{if(typeof e=="function"&&e(h),h!=null){var m=h.getBoundingClientRect(),p=m.width,x=m.height;c(p,x)}},[e,c]);return S.createElement(S.Fragment,null,S.createElement(_v,{width:o.containerWidth,height:o.containerHeight}),S.createElement("div",Ch({ref:d},n)))}),gLe=S.forwardRef((n,e)=>{var t=n.width,r=n.height;return S.createElement(S.Fragment,null,S.createElement(_v,{width:t,height:r}),S.createElement("div",Ch({ref:e},n)))}),xLe=S.forwardRef((n,e)=>{var t=n.width,r=n.height;return typeof t=="string"||typeof r=="string"?S.createElement(pLe,Ch({},n,{ref:e})):typeof t=="number"&&typeof r=="number"?S.createElement(gLe,Ch({},n,{width:t,height:r,ref:e})):S.createElement(S.Fragment,null,S.createElement(_v,{width:t,height:r}),S.createElement("div",Ch({ref:e},n)))});function bLe(n){return n?mLe:xLe}var yLe=S.forwardRef((n,e)=>{var t=n.children,r=n.className,s=n.height,a=n.onClick,o=n.onContextMenu,l=n.onDoubleClick,c=n.onMouseDown,d=n.onMouseEnter,h=n.onMouseLeave,m=n.onMouseMove,p=n.onMouseUp,x=n.onTouchEnd,y=n.onTouchMove,v=n.onTouchStart,B=n.style,E=n.width,N=n.responsive,T=n.dispatchTouchEvents,k=T===void 0?!0:T,P=S.useRef(null),R=ta(),_=S.useState(null),I=d1(_,2),D=I[0],j=I[1],O=S.useState(null),M=d1(O,2),U=M[0],ee=M[1],ie=sLe(),G=gR(),Z=(G==null?void 0:G.width)>0?G.width:E,z=(G==null?void 0:G.height)>0?G.height:s,se=S.useCallback(Ae=>{ie(Ae),typeof e=="function"&&e(Ae),j(Ae),ee(Ae),Ae!=null&&(P.current=Ae)},[ie,e,j,ee]),re=S.useCallback(Ae=>{R(sZ(Ae)),R($o({handler:a,reactEvent:Ae}))},[R,a]),H=S.useCallback(Ae=>{R(iD(Ae)),R($o({handler:d,reactEvent:Ae}))},[R,d]),Y=S.useCallback(Ae=>{R(eX()),R($o({handler:h,reactEvent:Ae}))},[R,h]),de=S.useCallback(Ae=>{R(iD(Ae)),R($o({handler:m,reactEvent:Ae}))},[R,m]),W=S.useCallback(()=>{R(dZ())},[R]),K=S.useCallback(()=>{R(uZ())},[R]),J=S.useCallback(Ae=>{R(cZ(Ae.key))},[R]),oe=S.useCallback(Ae=>{R($o({handler:o,reactEvent:Ae}))},[R,o]),Ie=S.useCallback(Ae=>{R($o({handler:l,reactEvent:Ae}))},[R,l]),pe=S.useCallback(Ae=>{R($o({handler:c,reactEvent:Ae}))},[R,c]),ye=S.useCallback(Ae=>{R($o({handler:p,reactEvent:Ae}))},[R,p]),he=S.useCallback(Ae=>{R($o({handler:v,reactEvent:Ae}))},[R,v]),le=S.useCallback(Ae=>{k&&R(mZ(Ae)),R($o({handler:y,reactEvent:Ae}))},[R,k,y]),ce=S.useCallback(Ae=>{R($o({handler:x,reactEvent:Ae}))},[R,x]),Ce=bLe(N);return S.createElement(BX.Provider,{value:D},S.createElement(fBe.Provider,{value:U},S.createElement(Ce,{width:Z??(B==null?void 0:B.width),height:z??(B==null?void 0:B.height),className:Lr("recharts-wrapper",r),style:aLe({position:"relative",curs
4716or:"default",width:Z,height:z},B),onClick:re,onContextMenu:oe,onDoubleClick:Ie,onFocus:W,onBlur:K,onKeyDown:J,onMouseDown:pe,onMouseEnter:H,onMouseLeave:Y,onMouseMove:de,onMouseUp:ye,onTouchEnd:ce,onTouchMove:le,onTouchStart:he,ref:se},S.createElement(fLe,null),t)))}),vLe=["width","height","responsive","children","className","style","compact","title","desc"];function BLe(n,e){if(n==null)return{};var t,r,s=wLe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function wLe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}var CLe=S.forwardRef((n,e)=>{var t=n.width,r=n.height,s=n.responsive,a=n.children,o=n.className,l=n.style,c=n.compact,d=n.title,h=n.desc,m=BLe(n,vLe),p=Za(m);return c?S.createElement(S.Fragment,null,S.createElement(_v,{width:t,height:r}),S.createElement(b9,{otherAttributes:p,title:d,desc:h},a)):S.createElement(yLe,{className:o,style:l,width:t,height:r,responsive:s??!1,onClick:n.onClick,onMouseLeave:n.onMouseLeave,onMouseEnter:n.onMouseEnter,onMouseMove:n.onMouseMove,onMouseDown:n.onMouseDown,onMouseUp:n.onMouseUp,onContextMenu:n.onContextMenu,onDoubleClick:n.onDoubleClick,onTouchStart:n.onTouchStart,onTouchMove:n.onTouchMove,onTouchEnd:n.onTouchEnd},S.createElement(b9,{otherAttributes:p,title:d,desc:h,ref:e},S.createElement(B5e,null,a)))});function ELe(n){var e=ta();return S.useEffect(()=>{e(j5e(n))},[e,n]),null}var SLe=["layout"];function oD(){return oD=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},oD.apply(null,arguments)}function TLe(n,e){if(n==null)return{};var t,r,s=ALe(n,e);if(Object.getOwnPropertySymbols){var a=Object.getOwnPropertySymbols(n);for(r=0;r<a.length;r++)t=a[r],e.indexOf(t)===-1&&{}.propertyIsEnumerable.call(n,t)&&(s[t]=n[t])}return s}function ALe(n,e){if(n==null)return{};var t={};for(var r in n)if({}.hasOwnProperty.call(n,r)){if(e.indexOf(r)!==-1)continue;t[r]=n[r]}return t}function w9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function kLe(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?w9(Object(t),!0).forEach(function(r){NLe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):w9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function NLe(n,e,t){return(e=_Le(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function _Le(n){var e=ILe(n,"string");return typeof e=="symbol"?e:e+""}function ILe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var DLe={top:5,right:5,bottom:5,left:5},bZ=kLe({accessibilityLayer:!0,stackOffset:"none",barCategoryGap:"10%",barGap:4,margin:DLe,reverseStackOrder:!1,syncMethod:"index",layout:"radial",responsive:!1,cx:"50%",cy:"50%",innerRadius:0,outerRadius:"80%"},gZ),jLe=S.forwardRef(function(e,t){var r,s=ll(e.categoricalChartProps,bZ),a=s.layout,o=TLe(s,SLe),l=e.chartName,c=e.defaultTooltipEventType,d=e.validateTooltipEventTypes,h=e.tooltipPayloadSearcher,m={chartName:l,defaultTooltipEventType:c,validateTooltipEventTypes:d,tooltipPayloadSearcher:h,eventEmitter:void 0};return S.createElement(V5e,{preloadedState:{options:m},reduxStoreName:(r=s.id)!==null&&r!==void 0?r:l},S.createElement(u5e,{chartData:s.data}),S.createElement($5e,{layout:a,margin:s.margin}),S.createElement(q5e,{throttleDelay:s.throttleDelay,throttledEvents:s.throttledEvents}),S.createElement(H5e,{baseValue:void 0,accessibilityLayer:s.accessibilityLayer,barCategoryGap:s.barCategoryGap,maxBarSize:s.maxBarSize,stackOffset:s.stackOffset,barGap:s.barGap,barSize:s.barSize,syncId:s.syncId,syncMethod:s.syncMethod,className:s.className,reverseStackOrder:s.reverseStackOrder}),S.createElement(ELe,{cx:s.cx,cy:s.cy,startAngle:s.startAngle,endAngle:s.endAngle,innerRadius:s.innerRadius,outerRadius:s.outerRadius}),S.createElement(CLe,oD({},o,{ref:t})))});function C9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function E9(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};
4716e%2?C9(Object(t),!0).forEach(function(r){RLe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):C9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function RLe(n,e,t){return(e=PLe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function PLe(n){var e=LLe(n,"string");return typeof e=="symbol"?e:e+""}function LLe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}var OLe=["axis"],MLe=E9(E9({},bZ),{},{layout:"centric",startAngle:90,endAngle:-270}),zv=S.forwardRef((n,e)=>{var t=ll(n,MLe);return S.createElement(jLe,{chartName:"RadarChart",defaultTooltipEventType:"axis",validateTooltipEventTypes:OLe,tooltipPayloadSearcher:SDe,categoricalChartProps:t,ref:e})});function S9(n,e){if(!n||!e)return null;const r=n.replace(/[.,!?;:()"''「」【】—]/g," ").toLowerCase().split(/\s+/).filter(Boolean);for(const s of r)if(e[s])return{word:s,tag:e[s].tag||"CORE",translation:e[s].translation||""};return null}function FLe(n,e){const t={};if(!n)return t;const r=n.split(`
4717`),s=/^\s*([a-zA-Z\-]+)\s*(?:\[.*?\]|\/.*?\/\s*)*\s*(.+)$/;for(const a of r){const o=a.trim();if(!o||o.startsWith("#")||o.startsWith("//"))continue;const l=o.match(s);if(l){const c=l[1].toLowerCase(),d=l[2].trim();c&&d&&(t[c]={tag:e,translation:d})}}return t}const yZ="radioshadow_diagnostic_assessment_v1",T9={Spanish:{language:"Spanish",nativeSentence:"Las cadenas de radiodifusión internacional ofrecen una auténtica inmersión lingüística, permitiendo asimilar el ritmo natural y la cadencia expresiva.",chineseTranslation:"国际广播电台提供了纯正的语言沉浸环境,使学习者能够吸收自然的语调节奏与地道表达。",englishTranslation:"Global broadcast networks offer authentic linguistic immersion, enabling learners to absorb natural rhythm and expressive cadence.",ttsLang:"es-ES",ttsVoiceKeywords:["es-ES","Spanish","Mónica","Jorge","Lucía","Diego"],sampleStation:"RTVE Radio Nacional (Madrid)",examinerDefault:"Prof. Mateo Valero"},English:{language:"English",nativeSentence:"Global broadcast networks provide authentic linguistic immersion, enabling learners to absorb natural rhythm and phrasing.",chineseTranslation:"全球广播网络提供纯正的语言沉浸环境,使学习者能够自然吸收地道的节奏与遣词造句。",englishTranslation:"Global broadcast networks provide authentic linguistic immersion, enabling learners to absorb natural rhythm and phrasing.",ttsLang:"en-GB",ttsVoiceKeywords:["en-GB","UK","British","Daniel","Arthur","George"],sampleStation:"BBC World Service (London)",examinerDefault:"Dr. Arthur Sterling"},Japanese:{language:"Japanese",nativeSentence:"国際放送の生中継は、自然な音声リズムと豊かな語彙表現を身体で習得するための最適な言語学習環境を提供します。",chineseTranslation:"国际广播的现场直播为学习者提供了自然语音节奏与丰富词汇表达的最佳语言习得环境。",englishTranslation:"Live international broadcasts provide the optimal linguistic environment to organically acquire natural speech rhythm and vocabulary.",ttsLang:"ja-JP",ttsVoiceKeywords:["ja-JP","Japanese","Kyoko","Otoya","Kenji"],sampleStation:"NHK Radio 1 (Tokyo)",examinerDefault:"佐藤健二 教授 (Prof. Kenji Sato)"},French:{language:"French",nativeSentence:"Les réseaux de radiodiffusion internationale offrent une immersion linguistique authentique, permettant d'assimiler le rythme naturel et l'élégance du phrasé.",chineseTranslation:"国际广播网络提供了纯正的语言沉浸,使学习者能够领会自然的语流节奏与优雅的句法表达。",englishTranslation:"International broadcast networks provide authentic immersion, allowing learners to assimilate natural speech rhythm and phrasing elegance.",ttsLang:"fr-FR",ttsVoiceKeywords:["fr-FR","French","Thomas","Amelie","Claire"],sampleStation:"France Inter (Paris)",examinerDefault:"Prof. Claire Delacroix"},German:{language:"German",nativeSentence:"Internationale Rundfunksender bieten eine authentische sprachliche Immersion, die es ermöglicht, den natürlichen Rhythmus und anspruchsvolle Phrasierungen zu verinnerlichen.",chineseTranslation:"国际广播电台提供了地道的语言沉浸,使学习者能够内化自然的语调节奏与高阶句式表达。",englishTranslation:"International radio broadcasters provide authentic immersion, making it possible to internalize natural speech cadence and phrasing.",ttsLang:"de-DE",ttsVoiceKeywords:["de-DE","German","Stefan","Katja","Wolfgang"],sampleStation:"Deutschlandfunk (Köln)",examinerDefault:"Dr. Wolfgang Becker"},Chinese:{language:"Chinese",nativeSentence:"国家级广播电台的高清现场播音,为语言研习者提供了精准的声调音准、规范的字正腔圆与流畅自如的气息韵律。",chineseTranslation:"国家级广播电台的高清现场播音,为语言研习者提供了精准的声调音准、规范的字正腔圆与流畅自如的气息韵律。",englishTranslation:"High-definition live broadcasts from national radio provide learners with precise tone accuracy, standard phonetics, and fluid breath rhythm.",ttsLang:"zh-CN",ttsVoiceKeywords:["zh-CN","Chinese","Tingting","Zhiwei","Yunxi"],sampleStation:"中国之声 
4717(北京)",examinerDefault:"张华 教授 (Prof. Zhang Hua)"}};function A9(n="English",e,t,r=!1){const s=n.toLowerCase();return s.includes("span")||s==="es"?t>=7.5||e>=85?{levelTitle:r?"流利广播级 · DELE C1/C2":"Locutor Fluido DELE C1/C2",levelTag:"DELE C1 - C2 • Dominio Operativo Eficaz",plainDescription:r?"您具备地道的西语音调节奏与高度流畅的意群断句。您可以轻松理解 RTVE / 塞万提斯高语速广播辩论,并能自如运用丰富的高级连接词。":"Usted habla con fluidez auténtica, excelente cadencia rítmica y entonación natural. Es capaz de seguir debates rápidos de radio y comprender sutiles matices comunicativos.",strengths:r?["自然的西班牙语音节节奏与重音分配","清晰的辅音弱化与流畅的元音连读","对广播级语速无障碍吸收与声学映射"]:["Excelente ritmo silábico y colocación del acento tónico","Articulación precisa y transiciones fluidas entre vocales","Alta fidelidad acústica con locutores nativos de radio"],recommendations:r?["挑战高语速辩论电台如 RTVE Radio Nacional 或 Cadena SER","与马特奥教授开展 DELE/SIELE C1 考场全真 1v1 模考"]:["Escuchar programas de análisis como RTVE Radio Nacional o Cadena SER","Practicar simulaciones orales completas DELE C1 con el Prof. Mateo Valero"],recommendedStation:"RTVE Radio Nacional (España)"}:t>=6.5||e>=70?{levelTitle:r?"独立交际级 · DELE B2":"Usuario Independiente DELE B2",levelTag:"DELE B2 • Competencia Sólida",plainDescription:r?"您的西语发音清晰,具备坚实的时态连贯感与词法节奏。能够顺畅跟听主流新闻广播,在快速元音连拼上做进一步打磨即可进阶高分。":"Se comunica con claridad y un ritmo sonoro sólido. Puede seguir emisiones informativas con naturalidad, puliendo pequeños detalles en encadenamientos fonéticos.",strengths:r?["核心高频词汇发音标准且重音分明","语流连贯,能够保持稳定的朗读停顿与呼吸配合","能够辨析并模仿经典西语新闻语调"]:["Ritmo consistente en el vocabulario central y conectores","Buena inteligibilidad y cadencia en habla continua","Percepción acústica precisa de la velocidad de locución"],recommendations:r?["重点巩固词间连音(Sinalefa 与辅音接元音过渡)","使用连续沉浸跟读流提升长段落跟读耐力"]:["Practicar el enlace fonético continuo (sinalefas y enlaces consonánticos)","Aprovechar el modo de sombreado continuo para ganar resistencia"],recommendedStation:"Radio Exterior de España & Cadena SER"}:t>=5||e>=55?{levelTitle:r?"进阶提升级 · DELE B1":"Comunicador en Desarrollo DELE B1",levelTag:"DELE B1 • Usuario Umbral",plainDescription:r?"您具备扎实的西语拼读基础,能够理解基本的句子语调起伏。通过每日跟随电台广播进行短句跟读,将迅速建立母语级语音反射。":"Cuenta con una base fonética sólida y comprende la melodía oracional. El sombreado diario de frases radiofónicas le permitirá avanzar con rapidez.",strengths:r?["常规基础词汇拼读准确","积极尝试复现自然的升降调","对广播原声的听觉敏感度逐步建立"]:["Buena pronunciación base de términos cotidianos","Intento claro de entonación natural","Creciente sensibilidad auditiva a la voz nativa"],recommendations:r?["采用单句精听跟读,先逐句模仿再连贯跟读","对照双语字幕收听 RTVE 慢速新闻"]:["Utilizar el modo de frase única para afianzar cada oración","Revisar el desglose fonético detallado del evaluador"],recommendedStation:"RTVE Radio 5 & Radio Clásica"}:{levelTitle:r?"启航探索级 · DELE A2":"Explorador Inicial DELE A2",levelTag:"DELE A2 • Nivel Plataforma",plainDescription:r?"您正在开启纯正西班牙语学习之旅!建议先开启中西双语字幕并使用 0-Token 泛听模式磨耳朵,循序渐进。":"Inicia su trayectoria en el idioma. Se recomienda escuchar emisiones con subtítulos bilingües y practicar frases cortas diariamente.",strengths:r?["对纯正西班牙语语音充满学习热情","初步建ç«
4717‹åŸºç¡€é«˜é¢‘词的听辨意识"]:["Interés genuino por adquirir la fonética auténtica","Reconocimiento auditivo de palabras clave"],recommendations:r?["开启双语字幕并在泛听沉浸模式下熟悉语感","每天跟读 1-2 条电台短句"]:["Activar subtítulos bilingües en modo inmersión","Sombra diaria de frases cortas"],recommendedStation:"RTVE Radio 5 Todo Noticias"}:s.includes("japan")||s==="ja"?t>=7.5||e>=85?{levelTitle:r?"高级新闻播报级 · JLPT N1":"上級実務報道レベル (JLPT N1+)",levelTag:"JLPT N1 • 高度運用力 & NHK 報道準拠",plainDescription:r?"您掌握了精准的东京音高重音(アクセント)与拍子节奏(モーラ)。能够轻松收听 NHK 深度时事评论并无障碍复现地道日语语调。":"標準語の拍感覚と高低アクセントが極めて正確です。NHKの深層解説や時事討論も自然に聴解・シャドーイングできます。",strengths:r?["准确的拍(Mora)等时性感知与节奏把控","自然的促音、长音与拨音时长分配","高阶学术与商务语境下的听力理解"]:["正確なモーラ感覚と音長制御","促音・長音・撥音の安定した発音","高度な時事報道への自然な適応力"],recommendations:r?["精听 NHK ラジオ第1 深度社论与讨论","与佐藤健二教授开展 JLPT N1 口语全真模拟"]:["NHKラジオ第1の解説番組での継続シャドーイング","佐藤教授によるN1模擬面接の実践"],recommendedStation:"NHK Radio 1 (東京第一放送)"}:{levelTitle:r?"中高级自立级 · JLPT N2":"中上級自立レベル (JLPT N2)",levelTag:"JLPT N2 • 業務自立 & ニュース理解",plainDescription:r?"具备扎实的日常与商务日语语音基础,语流清晰。在快速长句的连读与声调起伏上继续练习,即可迈入专业播音级水准。":"基礎的なアクセントと発話リズムが安定しています。速い文末表現や長文のイントネーションを磨くことでさらなる飛躍が期待できます。",strengths:r?["常用生活与工作词汇音准清晰","对标准语升降调具有良好敏感度","语速适应度持续提升"]:["常用語彙の明瞭な調音","文末イントネーションへの配慮","自然な発話意欲"],recommendations:r?["重点关注长句中助词的轻读与连带","使用连续跟读流模式培养连贯发音耐力"]:["助詞の弱化と音の繋がりの意識","連続シャドーイングによる発話持久力の養成"],recommendedStation:"NHK FM & ラジオ深夜便"}:s.includes("french")||s==="fr"?t>=7.5||e>=85?{levelTitle:r?"雄辩流利级 · DALF C1/C2":"Locuteur Éloquent (DALF C1/C2)",levelTag:"DALF C1 - C2 • Maîtrise Supérieure",plainDescription:r?"您的法语节奏组划分与连诵(Liaison)极为自然,富有法国广播电台名主持人的优雅语感,能够从容驾驭高难度深度报道。":"Vous vous exprimez avec une élégance et une fluidité remarquables. Les enchaînements et liaisons sont maîtrisés avec précision.",strengths:r?["自然的连音与连诵过渡","精确的重音音节节奏组分布","高阶广播语速的声学同频"]:["Excellente maîtrise des liaisons et enchaînements","Rythme de groupe accentuel naturel","Fidélité acoustique Radio France"],recommendations:r?["挑战 France Inter 哲学与政经深度辩论","与克莱尔教授进行 DALF C1 考场实战"]:["Écouter les débats d'idées sur France Inter","Pratiquer les simulations DALF C1 avec Prof. Claire Delacroix"],recommendedStation:"France Inter & Radio France"}:{levelTitle:r?"自主运用级 · DELF B2":"Utilisateur Autonome (DELF B2)",levelTag:"DELF B2 • Utilisateur Indépendant",plainDescription:r?"您的发音清晰规范,能够舒适跟听主流法语新闻。在弱化元音与快速连读的圆润度上持续打磨,将大幅提升听感高级感。":"Communication claire et structurée. Vous suivez aisément l'actualité générale, avec une marge de progression sur les liaisons subtiles.",strengths:r?["核心词汇发音标准","句子语调抑扬起伏自然","对新闻广播语感建立良好"]:["Prononciation claire du vocabulaire clé","Bonne gestion de l'intonation descendante","Sensibilité au rythme radiophonique"],recommendations:r?["重点练习鼻化元音与辅音群过渡","使用连续跟读 HUD 提升长时间说话稳定性"]:["Perfectionner les voyelles nasales","Pratiquer le shadowing continu pour gagner en fluidité"],recommendedStation:"RFI Monde & France Info"}:s.includes("chin")||s==="zh"?t>=7.5||e>=85?{levelTitle:r?"国家级播音员水准 · 一级甲等":"National Master Broadcaster (PSC Tier 1-A)",levelTag:"普通话一级甲等 • 97+分å›
4717½å®¶çº§æ’­éŸ³",plainDescription:r?"字正腔圆,声母韵母发音极其标准,声调调值饱满,气息运用自如。具备中央广播电视总台资深播音员的专业声音素养。":"Flawless phonetic precision, pristine tones, and resonant projection matching the highest tier of national broadcast standards.",strengths:r?["调值饱满纯正,阴阳上去准确分明","吐字归音圆润,声母无发音部位偏差","气息连贯,自然具备广播播音质感"]:["Pristine 4-tone pitch contour accuracy","Clear syllable onset and coda resolution","Deep breath control with broadcast resonance"],recommendations:r?["研习中国之声深度评论播音","与张华教授探讨高难度语音艺术与播音技巧"]:["Deepen broadcast news delivery with CNR Voice of China","Engage in masterclass sessions with Prof. Zhang Hua"],recommendedStation:"中国之声 (CNR Voice of China)"}:{levelTitle:r?"行业专业主持水准 · 一级乙等":"Professional Broadcaster (PSC Tier 1-B)",levelTag:"普通话一级乙等 • 行业流畅主持",plainDescription:r?"语音规范清晰,方言口音极轻,能够自如进行新闻转述与专业沟通。在轻声、儿化及语流音变上稍加精修即可迈入一级甲等。":"Highly articulate with standard Mandarin pronunciation, suitable for professional media and executive presentation.",strengths:r?["基本声调准确,音节清晰明亮","语流自然连贯,断句适度","能自如跟读专业广播长句"]:["Stable tone inflection on multi-syllabic phrases","Confident and natural speaking cadence","High clarity and intelligibility"],recommendations:r?["精研轻声与儿化词的语流音变规律","利用单句精细跟读打磨唇舌力度"]:["Refine subtle tone sandhi and neutral tone cadences","Shadow broadcast excerpts daily to build resonance"],recommendedStation:"经济之声 & 大湾区之声"}:t>=7.5||e>=85?{levelTitle:r?"流利广播级 · CEFR C1/C2":"Fluent Broadcaster",levelTag:"CEFR C1 - C2 • Advanced Mastery (IELTS 7.5 - 9.0)",plainDescription:r?"您的英语发音具备地道语流与自然律动,音步节奏精准。能够轻松收听 BBC Radio 4 等高语速时政辩论,自如捕捉细微语义差别。":"You speak with authentic fluidity, natural rhythm, and confident pace. You can easily follow live broadcast debates and capture subtle nuances in fast-paced speech.",strengths:r?["自然的句重音音步切分与呼吸意群配合","清晰的辅音簇发音与元音音质辨析度","高度还原母语广播播音员的声学质感"]:["Effortless natural cadence and breath grouping","Clear consonant clusters and vowel distinction","High acoustic fidelity with native broadcast speech"],recommendations:r?["收听 BBC Radio 4 或 LBC Talk 深度辩论电台","与亚瑟博士开展 IELTS 雅思全真 1v1 口语模考"]:["Challenge yourself with fast debate radio like BBC Radio 4 or LBC Talk","Engage with Dr. Arthur in Full IELTS Speaking Mock Tests"],recommendedStation:"BBC Radio 4 & World Service"}:t>=6.5||e>=70?{levelTitle:r?"独立交际级 · CEFR B2":"Independent Conversationalist",levelTag:"CEFR B2 • Strong Working Fluency (IELTS 6.5)",plainDescription:r?"您能够清晰表达,音调节奏稳定,重音模式分明。能够舒适收听主流新闻广播,在细微连读弱读上稍作打磨即可进阶高分。":"You communicate clearly with solid acoustic rhythm and recognizable stress patterns. You can comfortably follow mainstream news radio, with minor polish needed on linking sounds.",strengths:r?["实词与核心词汇发音节奏稳健","连续发音具备良好可懂度与自然语速","多音节词重音位置掌握准确"]:["Consistent rhythm on content words and core vocabulary","Good intelligibility and pacing in continuous speech","Effective syllable stress on key multisyllabic terms"],recommendations:r?["重点训练连读过渡(辅音接元音与击穿弱读)","使用连续沉浸跟读流提升长时发音耐力"]:["Focus on liaison links (connecting final consonants to initial vowels)","Practice with Continuous Shadowing mode for sustained endurance"],recommendedStation:"BBC World Service & NPR News"}:t>=5||e>=55?{levelTitle:r?"进阶提升级 · CEFR B1":"Developing Communicator",levelTag:"CEFR B1 • Intermediate Explorer (IELTS 5.0 - 6.0)",plainDescription:r?"您具备扎实的语音基础,能够较好理解句子起伏。通过每日跟随电台进行单句影子跟读,将迅速建立母语级语音反射。":"You have a solid phonetic foundation and understand sentence rhythm well. With structured daily shadowing on word stress and linking consonants, you will quickly level up.",strengths:r?["常用高频词汇发音规范","能够积极模仿自然的升降语调","对广播语速的听觉感知逐步增强"]:["Good baseline pronunciation of common everyday words","Clear attempt at reproducing natural sentence intonation","Growing acoustic awareness of broadcast speed"],recommendations:r?["采用单句精听跟读,逐句吃透句式与重音","参考考官诊断报告中的弱读与易错点逐项改进"]:["Use Single-Sentence Shadowing to master one sentence at a time","Review Dr. Arthur'
4717s problem words in the acoustic diagnostic breakdown"],recommendedStation:"VOA Learning English & BBC World Service"}:{levelTitle:r?"启航探索级 · CEFR A2":"Foundational Explorer",levelTag:"CEFR A2 • Beginner Foundation",plainDescription:r?"您正在开启纯正英语学习之旅!建议开启中英双语字幕并使用 0-Token 泛听模式磨耳朵,每日跟读 1-2 句短句循序渐进。":"You are embarking on your global spoken English journey! The ideal path is listening to clear broadcasts with synchronized dual subtitles and practicing 1-2 sentences daily.",strengths:r?["对母语广播跟读抱有浓厚学习兴趣","能够辨别播音员的关键锚点词汇","短小短语发音清晰"]:["Eagerness to train your acoustic ear with authentic radio","Initial recognition of key anchor keywords","Clear baseline pronunciation on short phrases"],recommendations:r?["开启双语字幕并在沉浸 0-Token 模式下熟悉语感","每天跟读 1-2 条慢速广播短句"]:["Enable bilingual subtitles and listen in Immersion 0-Token Mode first","Shadow short, slow-paced broadcast sentences daily"],recommendedStation:"VOA Special English & Pro Curated Lessons"}}function Eh(){if(typeof window>"u")return null;try{const n=localStorage.getItem(yZ);return n?JSON.parse(n):null}catch(n){return console.warn("Error parsing diagnostic assessment:",n),null}}async function k9(n,e){if(!(typeof window>"u")){try{localStorage.setItem(yZ,JSON.stringify(n)),window.dispatchEvent(new CustomEvent("diagnostic-assessment-updated",{detail:n}))}catch(t){console.warn("Failed to write diagnostic assessment to localStorage:",t)}if(e&&fn)try{await Dm(qi(fn,"users",e),{diagnosticAssessment:n,proficiencyLevel:n.levelTitle,targetLanguage:n.targetLanguage||"English",updatedAt:new Date},{merge:!0})}catch(t){console.warn("Failed to persist diagnostic assessment to Firestore:",t)}}}const N9={US:{name:"United States",count:12500},GB:{name:"United Kingdom",count:4800},CA:{name:"Canada",count:2100},FR:{name:"France",count:3500},DE:{name:"Germany",count:6200},IT:{name:"Italy",count:2800},ES:{name:"Spain",count:2400},BR:{name:"Brazil",count:3100},MX:{name:"Mexico",count:1800},JP:{name:"Japan",count:1500},KR:{name:"South Korea",count:900},IN:{name:"India",count:2200},AU:{name:"Australia",count:1900},RU:{name:"Russia",count:2700},CN:{name:"China",count:1100},ZA:{name:"South Africa",count:850},AR:{name:"Argentina",count:1400},NZ:{name:"New Zealand",count:650},SE:{name:"Sweden",count:1100},NL:{name:"Netherlands",count:2300},CH:{name:"Switzerland",count:1200},AT:{name:"Austria",count:950},PL:{name:"Poland",count:1700},NO:{name:"Norway",count:800},FI:{name:"Finland",count:750},DK:{name:"Denmark",count:680},BE:{name:"Belgium",count:1150},PT:{name:"Portugal",count:920},GR:{name:"Greece",count:1300},TR:{name:"Turkey",count:1850}};function ULe({darkMode:n,onMapClick:e,selectedProfile:t,loading:r,selectedCoords:s,radiusKm:a,setRadiusKm:o,onRadiusChangeEnd:l}){var R,_;const{t:c}=Or(),[d,h]=S.useState([]),[m,p]=S.useState(!0),[x,y]=S.useState(N9),[v,B]=S.useState(null),[E,N]=S.useState({x:0,y:0}),T=S.useRef(null);S.useEffect(()=>{(async()=>{const D=["/api/radio/countries","https://de1.api.radio-browser.info/json/countries","https://de2.api.radio-browser.info/json/countries","https://all.api.radio-browser.info/json/countries"];for(const j of D)try{const O=await fetch(j);if(O.ok){const M=await O.json();if(Array.isArray(M)&&M.length>0){const U={};M.forEach(ee=>{ee.iso_3166_1&&(U[ee.iso_3166_1.toUpperCase()]={name:ee.name,count:ee.stationcount})}),y(U);return}}}catch{}console.warn("Using default country stats fallback"),y(N9)})()},[]),S.useEffect(()=>{const I=["/world.svg","https://cdn.jsdelivr.net/npm/@highcharts/[email protected]/custom/world.svg","https://unpkg.com/@highcharts/[email protected]/custom/world.svg"];let D=!0;return(async()=>{for(const O of I)try{const M=await fetch(O);if(!M.ok)continue;const U=await M.text();if(!U||!U.includes("<path"))continue;const G=new DOMParser().parseFromString(U,"image/svg+xml").querySelectorAll("path"),Z=Array.from(G).map(z=>{const re=(z.getAttribute("class")||"").match(/highcharts-key-([a-z2-9]+)/i),H=(re?re[1]:z.getAttribute("id")||z.getAttribute("data-id")||z.getAttribute("iso-a2")||"").toUpperCase(),Y=z.querySelector("name"),de=z.getAttribute("name")||(Y?Y.textContent:null)||z.getAttribute("data-name")||H;return{id:H,name:de||H,d:z.getAttribute("d")||""}}).filter(z=>z.d&&z.id&&z.id.length<=3&&z.id!=="KEY");if(Z.length>0&&D){h(Z),p(!1);return}}catch{}D&&p(!1)})(),()=>{D=!1}},[]);const k=(I,D)=>{const j=1.9018*D+338.5973,O=-1.994*I+212.6994;return{x:j,y:O}},P=I=>{if(!T.current)return;const D=T.current.getBoundingClientRect(),j=I.clientX-D.left,O=I.clientY-D.top,M=700,U=340,ee=M/U,ie=D.width/D.height;let G=1,Z=0,z=0;if(ie>ee){G=D.height/U;const K=M*G;Z=(D.width-K)/2}else{G=D.width/M;const K=U*G;z=(D.height-K)/2}const se=(j-Z)/G,re=(O-z)/G,H=(se-338.5973)/1.9018,Y=(re-212.6994)/-1.994,de=Math.max(-180,Math.min(180,H)),W=Math.max(-90,Math.min(90,Y));e({lat:W,lng:de})};return i.jsxs("div",{className:"flex flex-col w-full h-full aspect-[700/340] min-h-[220px] sm:min-h-[280px] md:min-
4717h-[340px] max-w-5xl max-h-[360px] md:max-h-[400px] lg:max-h-[450px] xl:max-h-[490px] mx-auto bg-slate-50 dark:bg-slate-950 transition-colors duration-300 relative rounded-2xl overflow-hidden shadow-inner border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("div",{className:"flex-1 w-full h-full relative overflow-hidden flex items-center justify-center",children:m?i.jsxs("div",{className:"absolute inset-0 flex flex-col justify-center items-center bg-slate-50 dark:bg-slate-950 font-display text-slate-500",children:[i.jsx(bg,{className:"w-10 h-10 animate-spin text-emerald-500 mb-3"}),i.jsx("p",{className:"text-sm",children:c.worldMap.loading})]}):i.jsxs("svg",{ref:T,viewBox:"0 0 700 340",className:"w-full h-full select-none cursor-crosshair",onClick:P,id:"world_svg_container",children:[i.jsx("g",{id:"landmass_group",children:d.map(I=>{const D=(v==null?void 0:v.id)===I.id,j=n?D?"#334155":"#1e293b":D?"#cbd5e1":"#e2e8f0";return i.jsx("path",{d:I.d,className:"transition-all duration-150 cursor-pointer opacity-100",stroke:j,strokeWidth:"1.2",strokeLinejoin:"round",fill:j,id:I.id?`map_path_${I.id.toLowerCase()}`:void 0,onMouseEnter:()=>B(I),onMouseMove:O=>{N({x:O.clientX,y:O.clientY})},onMouseLeave:()=>B(null)},I.id||Math.random().toString())})}),s&&(()=>{const{x:I,y:D}=k(s.lat,s.lng);return i.jsx("g",{id:"vicinity_overlay_group",className:"pointer-events-none",children:i.jsxs("g",{transform:`translate(${I}, ${D})`,children:[i.jsx("circle",{cx:"0",cy:"0",r:"14",fill:"rgba(16, 185, 129, 0.25)",className:"animate-ping",style:{animationDuration:"1.8s"}}),i.jsx("circle",{cx:"0",cy:"0",r:"5",fill:"#10b981",stroke:"#ffffff",strokeWidth:"1.5",className:"shadow"})]})})})()]})}),v&&v.id&&i.jsxs("div",{className:"fixed pointer-events-none z-50 px-3 py-2 bg-slate-900/90 dark:bg-white/95 text-white dark:text-slate-900 rounded-xl shadow-xl backdrop-blur-sm transition-opacity duration-150 border border-slate-700 dark:border-slate-200",style:{left:Math.min(E.x+15,window.innerWidth-180),top:E.y+15},children:[i.jsx("p",{className:"text-[13px] font-bold font-display tracking-wide",children:((R=x[v.id])==null?void 0:R.name)||v.name}),i.jsx("p",{className:"text-[11px] font-medium opacity-80 mt-0.5",children:c.worldMap.activeStationsCount.replace("{count}",String(((_=x[v.id])==null?void 0:_.count)||0))})]})]})}const M0=[{id:"spanish",code:"es",name:"Spanish",nativeName:"Español",flag:"🇪🇸",exam:"DELE / SIELE",examBadgeClass:"bg-amber-500/10 text-amber-700 dark:text-amber-300 border-amber-500/30",tagline:"Rapid elisions, connected vowels & rolling R (rr)",description:"Tune into authentic Spain & Latin American broadcasts. Master rapid connected speech and rolling R biomechanics.",targetLang:"Spanish",coords:{lat:40.4168,lng:-3.7038},defaultProfile:{country:"Spain",countryCode:"ES",countryCodes:["ES","MX","AR","CO"],language:"Spanish",capital:"Madrid",description:"Authentic Iberian and Latin American radio broadcasts with rapid conversational cadence and expressive intonation.",nativeGreeting:"¡Hola!",genres:["News & Talk","Tertulia Debate","Culture"]},defaultStation:{changeid:"es-ser",stationuuid:"es-ser",id:"es-ser",name:"Cadena SER Live (España)",url:"https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",url_resolved:"https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",streamUrl:"https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",country:"Spain",countrycode:"ES",language:"spanish",tags:"noticias,cultura,radio nacional,cadena ser"},coach:{name:"Mateo Valero",role:"DELE Oral Debate Coach",badge:"1v1 DELE Practice",actionUrl:"/spanish-pronunciation"}},{id:"english",code:"en",name:"English",nativeName:"English",flag:"🇬🇧",exam:"IELTS / TOEFL",examBadgeClass:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 border-emerald-500/30",tagline:"BBC & NPR broadcasts for Band 8.0+ prosody and flow",description:"Shadow authentic BBC World Service and NPR news anchors to build native thought groups and exam fluency.",targetLang:"English",coords:{lat:51.5074,lng:-.1278},defaultProfile:{country:"United Kingdom",countryCode:"GB",countryCodes:["GB","US","CA","AU"],language:"English",capital:"London",description:"Global English broadcasting featuring Received Pronunciation (RP) and General American commentary.",nativeGreeting:"Hello",genres:["World News","Investigative Journalism","Documentary"]},defaultStation:{changeid:"en-bbc",stationuuid:"en-bbc",id:"en-bbc",name:"BBC World Service",url:"https://bbradio.gcdn.co/bbcworldservice",url_resolved:"https://bbradio.gcdn.co/bbcworldservice",streamUrl:"https://bbradio.gcdn.co/bbcworldservice",country:"United Kingdom",countrycode:"GB",language:"english",tags:"news,talk,world,english"},coach:{name:"Dr. Arthur",role:"Official IELTS Examiner (Band 5–9)",badge:"1v1 IELTS Mock Test",actionUrl:"/ielts-speaking-mock-test"}},{id:"japanese",code:"ja",name:"Japanese",nativeName:"日本語",flag:"🇯🇵",exam:"JLPT N1–N3",examBadgeClass:"bg-rose-500/10 text-rose-700 dark:text-rose-300 border-rose-500/30",tagline:"Standard Tokyo pitch accent & conversational flow",de
4717scription:"Practice standard NHK Tokyo pitch accent (Hyojungo) and high-frequency colloquial connectors from daily news.",targetLang:"Japanese",coords:{lat:35.6762,lng:139.6503},defaultProfile:{country:"Japan",countryCode:"JP",countryCodes:["JP"],language:"Japanese",capital:"Tokyo",description:"Standard Tokyo Japanese broadcasting featuring clear articulation, pitch contours, and cultural talk shows.",nativeGreeting:"こんにちは",genres:["NHK News","Cultural Talk","Modern J-Pop"]},defaultStation:{changeid:"jp-nhk",stationuuid:"jp-nhk",id:"jp-nhk",name:"NHK World Radio Japan",url:"https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8",url_resolved:"https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8",streamUrl:"https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8",country:"Japan",countrycode:"JP",language:"japanese",tags:"nhk,japan,news,culture"},coach:{name:"Kenji Sato",role:"Tokyo Pitch Accent Coach",badge:"1v1 JLPT Coach"}},{id:"french",code:"fr",name:"French",nativeName:"Français",flag:"🇫🇷",exam:"DELF / DALF C1",examBadgeClass:"bg-blue-500/10 text-blue-700 dark:text-blue-300 border-blue-500/30",tagline:"Rapid liaisons, nasal vowels & Parisian debate cadence",description:"Decode Parisian intellectual discussions, rapid liaisons, and subtle vowel distinction with France Info.",targetLang:"French",coords:{lat:48.8566,lng:2.3522},defaultProfile:{country:"France",countryCode:"FR",countryCodes:["FR","BE","CH","CA"],language:"French",capital:"Paris",description:"Contemporary spoken French, philosophical roundtables, international policy analysis, and culture.",nativeGreeting:"Bonjour",genres:["Chanson Française","News Analysis","Debates"]},defaultStation:{changeid:"fr-franceinfo",stationuuid:"fr-franceinfo",id:"fr-franceinfo",name:"France Info 24/7",url:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",url_resolved:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",streamUrl:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",country:"France",countrycode:"FR",language:"french",tags:"information,news,france"},coach:{name:"Claire Delacroix",role:"DALF C1 Debate Coach",badge:"1v1 DALF C1 Practice",actionUrl:"/french-listening-practice"}},{id:"german",code:"de",name:"German",nativeName:"Deutsch",flag:"🇩🇪",exam:"Goethe / TestDaF",examBadgeClass:"bg-purple-500/10 text-purple-700 dark:text-purple-300 border-purple-500/30",tagline:"Compound noun rhythm, Satzklammer & crisp Hochdeutsch",description:"Master German word-bracket syntax and crisp articulation with authentic Deutschlandfunk news and cultural debates.",targetLang:"German",coords:{lat:52.52,lng:13.405},defaultProfile:{country:"Germany",countryCode:"DE",countryCodes:["DE","AT","CH"],language:"German",capital:"Berlin",description:"Hochdeutsch standard German news, economic analysis, science reporting, and political debates.",nativeGreeting:"Guten Tag",genres:["Hochdeutsch News","Cultural Analysis","Classical & Electronic"]},defaultStation:{changeid:"de-dlf",stationuuid:"de-dlf",id:"de-dlf",name:"Deutschlandfunk Culture",url:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",url_resolved:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",streamUrl:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",country:"Germany",countrycode:"DE",language:"german",tags:"kultur,nachrichten,dlf"},coach:{name:"Hans Becker",role:"Goethe C1/C2 Speech Coach",badge:"1v1 Goethe Practice"}},{id:"chinese",code:"zh",name:"Chinese",nativeName:"普通话",flag:"🇨🇳",exam:"HSK 4–6",examBadgeClass:"bg-red-500/10 text-red-700 dark:text-red-300 border-red-500/30",tagline:"Tone contour stability & effortless listening automaticity",description:"Build tone stability and natural listening reflexes through China National Radio live talk, news, and storytelling.",targetLang:"Chinese (Simplified)",coords:{lat:39.9042,lng:116.4074},defaultProfile:{country:"China",countryCode:"CN",countryCodes:["CN","SG","MY"],language:"Chinese",capital:"Beijing",description:"Standard Mandarin Chinese broadcasts featuring articulate news anchors, storytelling, and cultural discussions.",nativeGreeting:"你好",genres:["National News","Storytelling","Cultural Talks"]},defaultStation:{changeid:"cn-cnr",stationuuid:"cn-cnr",id:"cn-cnr",name:"China National Radio (CNR)",url:"http://ngcdn001.cnr.cn/live/zgzs/index.m3u8",url_resolved:"http://ngcdn001.cnr.cn/live/zgzs/index.m3u8",streamUrl:"http://ngcdn001.cnr.cn/live/zgzs/index.m3u8",country:"China",countrycode:"CN",language:"chinese",tags:"news,talk,mandarin"},coach:{name:"Zhang Hua",role:"HSK Spoken Debate Coach",badge:"1v1 HSK Practice"}}];function VLe({selectedLanguageId:n,onSelectLanguage:e,onOpenCoach:t}){return S.useEffect(()=>
4717{document.title="RadioShadow AI - Global Podcasts Listening Practice & Real-Time Shadowing"},[]),i.jsxs("section",{"aria-label":"Product Overview & Language Learning Methodology",className:"w-full max-w-5xl mx-auto mb-4 bg-white/70 dark:bg-slate-900/60 backdrop-blur-md rounded-2xl border border-slate-200/80 dark:border-slate-800/80 p-5 sm:p-7 shadow-sm transition-all duration-300",children:[i.jsxs("header",{className:"text-center max-w-3xl mx-auto mb-7",children:[i.jsxs("div",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200/80 dark:border-emerald-800/60 text-emerald-700 dark:text-emerald-300 text-xs font-semibold mb-3",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:"The Real-World Language Acquisition Lab"})]}),i.jsx("h1",{className:"text-2xl sm:text-3xl lg:text-4xl font-extrabold tracking-tight text-slate-900 dark:text-white leading-tight font-display mb-3",children:"Learn Any Language with Real Radio & Podcast Shadowing"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 font-medium leading-relaxed max-w-2xl mx-auto",children:"Practice active listening and speech shadowing with authentic global radio broadcasts, while AI pinpoints and corrects your pronunciation in real time."})]}),i.jsxs("div",{id:"language-selection-step",className:"mb-8",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-2 mb-4 pb-2 border-b border-slate-200/60 dark:border-slate-800/60",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-6 h-6 rounded-full bg-emerald-500 text-white text-xs font-bold flex items-center justify-center shrink-0",children:"1"}),i.jsx("h2",{className:"text-base sm:text-lg font-bold text-slate-900 dark:text-white font-display",children:"Step 1: Choose Your Language & Exam Target"})]}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Click any language to load native live radio & world map"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3.5",children:M0.map(r=>{const s=n===r.id;return i.jsxs("div",{onClick:()=>e==null?void 0:e(r),className:`group relative p-4 rounded-xl border text-left transition-all duration-300 cursor-pointer flex flex-col justify-between ${s?"bg-emerald-50/90 dark:bg-emerald-950/30 border-emerald-500 ring-2 ring-emerald-500/30 shadow-md":"bg-white/80 dark:bg-slate-950/40 border-slate-200/80 dark:border-slate-800/80 hover:border-emerald-400/80 hover:shadow-sm"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-start justify-between gap-2 mb-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-2xl leading-none",role:"img","aria-label":r.name,children:r.flag}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-base font-bold text-slate-900 dark:text-white group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors leading-snug",children:r.name}),i.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-500 font-medium",children:r.nativeName})]})]}),i.jsx("span",{className:`px-2 py-0.5 rounded-md text-[11px] font-bold font-mono border ${r.examBadgeClass} shrink-0`,children:r.exam})]}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed mb-3",children:r.description})]}),i.jsxs("div",{className:"pt-2.5 border-t border-slate-100 dark:border-slate-800/80 flex flex-wrap items-center justify-between gap-2",children:[i.jsxs("button",{type:"button",onClick:a=>{a.stopPropagation(),r.coach.actionUrl?window.location.href=r.coach.actionUrl:t==null||t(r.coach)},className:"inline-flex items-center gap-1 text-[11px] font-medium text-slate-500 hover:text-emerald-600 dark:text-slate-400 dark:hover:text-emerald-300 transition-colors py-1 px-1.5 rounded-md hover:bg-emerald-50 dark:hover:bg-emerald-950/50",title:`Launch 1v1 AI debate session for ${r.name}`,children:[i.jsx(hye,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:r.coach.badge})]}),i.jsx("div",{className:"flex items-center gap-1 text-xs font-bold",children:s?i.jsxs("span",{className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 font-semibold text-[11px]",children:[i.jsx(Co,{className:"w-3.5 h-3.5"})," Selected"]}):i.jsxs("span",{className:"inline-flex items-center gap-1 text-slate-700 dark:text-slate-200 group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:["Select & Open Map ",i.jsx(qr,{className:"w-3 h-3 group-hover:translate-x-0.5 transition-transform"})]})})]})]},r.id)})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5 mb-6",children:[i.jsx("article",{className:"bg-slate-50/70 dark:bg-slate-950/40 border border-slate-200/60 dark:border-slate-800/60 rounded-xl p-5 flex flex-col justify-between",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx("div",{className:"w-7 h-7 rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-center justify-center",children:i.jsx(cn,{className:"w-4 h-4"})}),i.jsx("h2",{className:"text-base sm:text-lg font-bold text-slate-900 dark:text-white font-display",children:"How It Works"})]}
vendor: 4,251 bytes, line 4717
4717),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 mb-4 leading-relaxed",children:"Mastering a new language doesn't have to be a chore with repetitive drills. In three effortless steps, turn any live broadcast into an interactive language immersion coach:"}),i.jsxs("ol",{className:"space-y-3 text-xs sm:text-sm text-slate-700 dark:text-slate-200 font-medium",children:[i.jsxs("li",{className:"flex items-start gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-emerald-500 text-white text-[11px] font-bold flex items-center justify-center shrink-0 mt-0.5",children:"1"}),i.jsxs("div",{children:[i.jsx("strong",{className:"text-slate-900 dark:text-white",children:"Choose Your Language:"})," Select your target tongue and CEFR examination standard from the entrance cards above."]})]}),i.jsxs("li",{className:"flex items-start gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-emerald-500 text-white text-[11px] font-bold flex items-center justify-center shrink-0 mt-0.5",children:"2"}),i.jsxs("div",{children:[i.jsx("strong",{className:"text-slate-900 dark:text-white",children:"Select Regional Radio:"})," Click any country on the interactive globe to stream authentic, live local radio and podcasts."]})]}),i.jsxs("li",{className:"flex items-start gap-2.5",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-emerald-500 text-white text-[11px] font-bold flex items-center justify-center shrink-0 mt-0.5",children:"3"}),i.jsxs("div",{children:[i.jsx("strong",{className:"text-slate-900 dark:text-white",children:"Shadow & Correct:"})," Echo native speakers with a slight delay while intelligent AI radar analyzes and corrects your pronunciation."]})]})]})]})}),i.jsx("article",{className:"bg-slate-50/70 dark:bg-slate-950/40 border border-slate-200/60 dark:border-slate-800/60 rounded-xl p-5 flex flex-col justify-between",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx("div",{className:"w-7 h-7 rounded-lg bg-teal-500/10 text-teal-600 dark:text-teal-400 flex items-center justify-center",children:i.jsx(Er,{className:"w-4 h-4"})}),i.jsx("h2",{className:"text-base sm:text-lg font-bold text-slate-900 dark:text-white font-display",children:"Learn From Real Broadcasts, Not Synthetic Audio"})]}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed mb-3",children:"Textbooks and computerized language apps rely on sterilized, slowed-down robotic audio that leaves you unprepared for spontaneous real-life conversations."}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed mb-3",children:"Real-world broadcasts immerse your ears in natural connected speech, rapid elisions, authentic regional accents, and unscripted idioms used by native speakers today."}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"By shadowing professional anchors and podcasters in real time, your ears adapt to genuine speech cadence and your vocal muscles learn to produce natural sounds effortlessly."})]})})]}),i.jsxs("article",{className:"border-t border-slate-200/60 dark:border-slate-800/60 pt-5",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3.5",children:[i.jsx("div",{className:"w-7 h-7 rounded-lg bg-amber-500/10 text-amber-600 dark:text-amber-400 flex items-center justify-center",children:i.jsx(EW,{className:"w-4 h-4"})}),i.jsx("h2",{className:"text-base sm:text-lg font-bold text-slate-900 dark:text-white font-display",children:"Supported Languages"})]}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 mb-4",children:"Sharpen your listening comprehension and prepare for international certifications with real-world broadcasts tailored to your goals:"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 font-mono uppercase tracking-wider block mb-1",children:"Spanish (DELE / SIELE)"}
4717),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:"Tune into lively Iberian and Latin American radio to master rapid connected vowels, natural rhythm, and rolling R phonetics."})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 font-mono uppercase tracking-wider block mb-1",children:"English (IELTS / TOEFL)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:"Shadow BBC, NPR, and global news anchors to develop native prosody, natural thought grouping, and confident Band 8.0+ oral fluency."})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 font-mono uppercase tracking-wider block mb-1",children:"Japanese (JLPT N1–N3)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:"Practice standard NHK Tokyo pitch accent (Hyojungo) and high-frequency colloquial connectors from daily news and cultural talk shows."})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 font-mono uppercase tracking-wider block mb-1",children:"French (DELF / DALF C1)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:"Decode rapid liaisons, subtle nasal vowels, and authentic Parisian debate cadence with synchronized bilingual transcripts."})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 font-mono uppercase tracking-wider block mb-1",children:"German (Goethe / TestDaF)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:"Perfect compound noun rhythm, Satzklammer sentence structures, and crisp Hochdeutsch articulation with Deutschlandfunk broadcasts."})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 border border-slate-200/50 dark:border-slate-800/50",children:[i.jsx("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 font-mono uppercase tracking-wider block mb-1",children:"Chinese (HSK 4–6)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:"Build effortless listening automaticity and tone contour stability through live news, storytelling, and regional discussion broadcasts."})]})]})]})]})}const Dw=[{changeid:"glob-1",stationuuid:"global-bbc",name:"BBC World Service",url:"https://bbradio.gcdn.co/bbcworldservice",url_resolved:"https://bbradio.gcdn.co/bbcworldservice",homepage:"https://bbc.co.uk",favicon:"https://www.bbc.co.uk/favicon.ico",tags:"news,talk,world,english",country:"United Kingdom",countrycode:"GB",state:"London",language:"english",votes:12053,clickcount:24520,codec:"MP3",bitrate:128},{changeid:"glob-2",stationuuid:"global-fip",name:"FIP Paris",url:"https://stream.radiofrance.fr/fip/fip.m3u8",url_resolved:"https://stream.radiofrance.fr/fip/fip_hifi.mp3",homepage:"https://fip.fr",favicon:"https://www.radiofrance.fr/fav
4717icon.ico",tags:"eclectic,jazz,rock,chanson,france",country:"France",countrycode:"FR",state:"Paris, Île-de-France",language:"french",votes:9540,clickcount:18451,codec:"MP3",bitrate:192},{changeid:"glob-3",stationuuid:"global-somafm",name:"SomaFM - Groove Salad",url:"https://somafm.com/groovesalad130.pls",url_resolved:"https://ice1.somafm.com/groovesalad-128-mp3",homepage:"https://somafm.com",favicon:"https://somafm.com/img3/groovesalad120.png",tags:"ambient,chillout,downtempo,groove",country:"United States",countrycode:"US",state:"San Francisco, California",language:"english",votes:8450,clickcount:14500,codec:"MP3",bitrate:128},{changeid:"glob-4",stationuuid:"global-kexp",name:"KEXP Seattle",url:"https://kexp-mp3-128.stream.publicradio.org/kexp-mp3-128",url_resolved:"https://kexp-mp3-128.stream.publicradio.org/kexp-mp3-128",homepage:"https://kexp.org",favicon:"https://www.kexp.org/static/images/favicon.ico",tags:"indie,alternative,rock,eclectic",country:"United States",countrycode:"US",state:"Seattle, Washington",language:"english",votes:11200,clickcount:16290,codec:"MP3",bitrate:128},{changeid:"glob-5",stationuuid:"global-ibiza",name:"Ibiza Global Radio",url:"https://ibizaglobalradio-com.ibizaglobalradio.com:8024/stream",url_resolved:"https://live.ibizaglobalradio.com/static/hifi.mp3",homepage:"https://ibizaglobalradio.com",favicon:"https://ibizaglobalradio.com/favicon.ico",tags:"electronic,deep house,tech house,dance",country:"Spain",countrycode:"ES",state:"Ibiza, Balearic Islands",language:"spanish",votes:7520,clickcount:13200,codec:"MP3",bitrate:128}];function GLe({currentCountryProfile:n,onSelectStation:e,activeStation:t,isPlaying:r,isProfileLoading:s=!1}){const{t:a}=Or(),[o,l]=S.useState(Dw),[c,d]=S.useState(!1),[h,m]=S.useState(""),[p,x]=S.useState(""),[y,v]=S.useState(null),B=P=>Array.isArray(P)?P.map(R=>!R||typeof R!="object"?R:{...R,favicon:typeof R.favicon=="string"&&R.favicon.startsWith("http://")?R.favicon.replace("http://","https://"):R.favicon,homepage:typeof R.homepage=="string"&&R.homepage.startsWith("http://")?R.homepage.replace("http://","https://"):R.homepage,url:typeof R.url=="string"&&R.url.startsWith("http://")?R.url.replace("http://","https://"):R.url,url_resolved:typeof R.url_resolved=="string"&&R.url_resolved.startsWith("http://")?R.url_resolved.replace("http://","https://"):R.url_resolved}):[];async function E(P){const R=P.toLowerCase().trim(),_=[`/api/radio/stations/bycountrycodeexact/${R}?limit=30`,`https://de1.api.radio-browser.info/json/stations/bycountrycodeexact/${R}?limit=30&hidebroken=true&order=clickcount&reverse=true`,`https://de2.api.radio-browser.info/json/stations/bycountrycodeexact/${R}?limit=30&hidebroken=true&order=clickcount&reverse=true`,`https://all.api.radio-browser.info/json/stations/bycountrycodeexact/${R}?limit=30&hidebroken=true&order=clickcount&reverse=true`];for(const I of _)try{const D=await fetch(I);if(D.ok){const j=await D.json();if(Array.isArray(j)&&j.length>0)return B(j)}}catch{}return[]}async function N(P){const R=encodeURIComponent(P),_=[`/api/radio/stations/search?country=${R}&limit=30`,`https://de1.api.radio-browser.info/json/stations/search?country=${R}&limit=30&hidebroken=true&order=clickcount&reverse=true`,`https://de2.api.radio-browser.info/json/stations/search?country=${R}&limit=30&hidebroken=true&order=clickcount&reverse=true`,`https://all.api.radio-browser.info/json/stations/search?country=${R}&limit=30&hidebroken=true&order=clickcount&reverse=true`];for(const I of _)try{const D=await fetch(I);if(D.ok){const j=await D.json();if(Array.isArray(j)&&j.length>0)return B(j)}}catch{}return[]}S.useEffect(()=>{if(!n){l(Dw);return}d(!0),v(null),m("");const _=((n!=null&&n.countryCodes&&n.countryCodes.length>0?n.countryCodes:[n==null?void 0:n.countryCode])||[]).filter(I=>typeof I=="string"&&I.trim().length>0).map(I=>E(I));Promise.all(_).then(async I=>{let D=I.flat();const j=new Set;if(D=D.filter(O=>{const M=O.url_resolved||O.url;return!M||!M.startsWith("http")||j.has(O.stationuuid)?!1:(j.add(O.stationuuid),!0)}),D.sort((O,M)=>(M.clickcount||M.votes||0)-(O.clickcount||O.votes||0)),D.length===0){const M=(await N(n.country)).filter(U=>{const ee=U.url_resolved||U.url;return ee&&ee.startsWith("http")});M.length===0?l(Dw.map(U=>({...U,state:`${n.country} Stream`}))):l(M)}else l(D.slice(0,45))}).catch(I=>{console.warn("Radio browser region lookup error, loading stable fallback",I),l(Dw)}).finally(()=>{d(!1)})},[n]);const T=o.filter(P=>{const R=h.trim().toLowerCase(),_=p.trim().toLowerCase(),I=R?(P.name||"").toLowerCase().includes(R)||P.state&&String(P.state).toLowerCase().includes(R)||P.tags&&String(P.tags).toLowerCase().includes(R):!0,D=_?P.tags&&String(P.tags).toLowerCase().includes(_):!0;return I&&D}),k=c||s;return i.jsxs("div",{className:"flex flex-col h-full bg-transparent gap-4",children:[i.jsx("div",{className:"flex flex-col gap-2 justify-between items-start",children:i.jsxs("div",{children:[i.jsx("h3",{className:"font-display font-semibold text-slate-700 dark:text-slate-200 text-xs uppercase tracking-wider",children:k?a.stations.scanningAirwaves:n?a.stations.regionalStreams:a.stations.featuredGlobal}),i.jsxs("p",{className:"text-[10px] text-slate-400 dark:text-slate-300 font-mono flex items-center gap-2",children:[i.jsx("span",{children:k?a.stations.connectingFrequencies:`${T.length} ${a.stations.activeStations}`}),p&&i.jsx("button",{onClick:()=>x(""),className:"cursor-pointer text-[9px] text-emerald-500 hover:text-emerald-600 px-1.5 py-0.5 bg-emerald-50 dark:bg-emerald-950/40 rounded border border-emerald-200/20 font-mono",title:"Clear active tag filter",children:a.stations.filteredByTag.replace("{tag}",p)})]})]})}),k?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:[1,2,3,4,5,6].map(P=>i.jsxs("div",{className:"p-4 rounded-2xl bg-white dark:bg-slate-900 border border-slate-100 dar
4717k:border-slate-800 flex flex-col gap-3 animate-pulse h-[135px]",children:[i.jsxs("div",{className:"flex gap-3 items-center",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-200 dark:bg-slate-800"}),i.jsxs("div",{className:"flex-1 flex flex-col gap-1.5",children:[i.jsx("div",{className:"h-3 w-3/4 bg-slate-200 dark:bg-slate-800 rounded"}),i.jsx("div",{className:"h-2.5 w-1/2 bg-slate-200 dark:bg-slate-800 rounded"})]})]}),i.jsx("div",{className:"h-3 w-5/6 bg-slate-200 dark:bg-slate-800 rounded mt-auto"}),i.jsxs("div",{className:"flex justify-between items-center mt-2",children:[i.jsx("div",{className:"h-2.5 w-12 bg-slate-200 dark:bg-slate-800 rounded"}),i.jsx("div",{className:"h-6 w-16 bg-slate-200 dark:bg-slate-800 rounded-lg"})]})]},P))}):T.length>0?i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-3",children:T.map(P=>{const R=(t==null?void 0:t.stationuuid)===P.stationuuid,_=P.tags?P.tags.split(",").slice(0,3):["variety"];return i.jsxs("div",{onClick:()=>e(P),className:`p-4 rounded-2xl border transition-all duration-200 flex flex-col justify-between h-[150px] relative cursor-pointer group bg-white dark:bg-slate-900 shadow-sm ${R?"border-emerald-500 ring-1 ring-emerald-500/20":"border-slate-200/60 dark:border-slate-850 hover:border-slate-300 dark:hover:border-slate-700 hover:shadow"}`,id:`station_card_${P.stationuuid}`,title:R&&r?a.stations.nowPlaying.replace("{name}",P.name):a.stations.tuneInto.replace("{name}",P.name),children:[i.jsxs("div",{className:"flex gap-3 items-start",children:[i.jsxs("div",{className:"w-10 h-10 rounded-xl bg-slate-100 dark:bg-slate-950 flex-shrink-0 flex items-center justify-center overflow-hidden border border-slate-200/50 dark:border-slate-800/40",children:[P.favicon?i.jsx("img",{src:P.favicon.startsWith("/")||P.favicon.startsWith("data:")?P.favicon:`/api/proxy-image?url=${encodeURIComponent(P.favicon)}`,alt:"",width:40,height:40,loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",onError:I=>{const D=I.target;D.style.display="none";const j=D.nextSibling;j&&(j.style.display="flex")},className:"w-full h-full object-cover"}):null,i.jsx("div",{className:"w-full h-full flex items-center justify-center text-emerald-500 bg-emerald-50 dark:bg-emerald-950/20",style:{display:P.favicon?"none":"flex"},children:i.jsx(cn,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"flex-1 overflow-hidden",children:[i.jsxs("h4",{className:"font-display font-bold text-xs text-slate-800 dark:text-slate-100 truncate flex items-center gap-1 group-hover:text-emerald-500 dark:group-hover:text-emerald-400 transition-colors",children:[P.name,P.votes>8e3&&i.jsx(abe,{className:"w-3.5 h-3.5 text-emerald-500 flex-shrink-0"})]}),i.jsx("span",{className:"text-[10px] text-slate-400 dark:text-slate-300 truncate block mt-0.5",children:P.state||a.stations.regionalBroadcast})]})]}),i.jsx("div",{className:"flex flex-wrap gap-1 mt-2.5 h-6 overflow-hidden",children:_.map((I,D)=>i.jsxs("button",{type:"button",onClick:j=>{j.stopPropagation(),x(I)},className:"text-[9px] font-mono hover:bg-slate-200 dark:hover:bg-slate-850 px-1.5 py-0.5 bg-slate-100 dark:bg-slate-800/60 text-slate-500 dark:text-slate-400 rounded transition-colors",title:`Filter list by tag #${I.trim()}`,children:["#",I.trim()]},D))}),i.jsxs("div",{className:"flex justify-between items-center border-t border-slate-100 dark:border-slate-800/50 pt-2 mt-2",children:[i.jsxs("div",{className:"flex items-center gap-2.5 text-[9px] text-slate-400 dark:text-slate-300 font-mono uppercase tracking-wider",children:[i.jsx("span",{children:P.codec||"MP3"}),i.jsx("span",{className:"opacity-40",children:"•"}),i.jsx("span",{children:P.bitrate?`${P.bitrate}kbps`:"128k"})]}),i.jsx("div",{className:"p-1.5 rounded-full bg-slate-50 dark:bg-slate-950 text-emerald-500 border border-slate-200/50 dark:border-slate-800 group-hover:bg-emerald-500 group-hover:text-white transition-all",children:R&&r?i.jsx(on,{className:"w-3.5 h-3.5 animate-pulse"}):i.jsx(Xa,{className:"w-3.5 h-3.5 translate-x-[0.5px]"})})]})]},P.stationuuid)})}):i.jsxs("div",{className:"p-10 rounded-2xl bg-white dark:bg-slate-900 border border-slate-200/60 dark:border-slate-800/60 text-center flex flex-col justify-center items-center gap-2",children:[i.jsx(Y2,{className:"w-8 h-8 text-slate-300 dark:text-slate-700"}),i.jsx("p",{className:"text-xs font-semibold text-slate-700 dark:text-slate-200",children:a.stations.noStationsFound}),i.jsx("p",{className:"text-[11px] text-slate-500 dark:text-slate-400 max-w-sm",children:a.stations.noStationsHelp}),(h||p)&&i.jsx("button",{onClick:()=>{m(""),x("")},className:"mt-3 text-xs bg-emerald-500 text-white rounded-lg px-3 py-1.5 hover:bg-emerald-600 transition-colors",id:"btn_reset_filters",children:a.stations.resetFilters})]})]})}const ci=[{changeid:"en-bbc",stationuuid:"en-bbc",id:"en-bbc",name:"BBC World Service",url:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",url_resolved:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",streamUrl:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",backupStreamUrls:["http://bbcwssc.ic.llnwd.net/stream/bbcwssc_mp1_ws-einws","https://stream.zeno.fm/f3wvbbqmdg8uv"],category:"Global News",country:"United Kingdom",countrycode:"GB",language:"en-UK",tags:"news,talk,world,english"},{changeid:"en-npr",stationuuid:"en-npr",id:"en-npr",name:"NPR Live News",url:"https://npr-ice.streamguys1.com/live.mp3",url_resolved:"https://npr-ice.streamguys1.com/live.mp3",streamUrl:"https://npr-ice.streamguys1.com/live.mp3",backupStreamUrls:["https://23873.live.streamtheworld.com/NPR_NEWS_AAC.aac"],category:"US Public Affairs",country:"United States",countrycode:"US",language:"en-US",tags:"news,npr,talk,public radio"},{changeid:"fr-franceinfo",stationuuid:"fr-franceinfo",id:"fr-franceinfo",
4717name:"France Info 24/7",url:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",url_resolved:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",streamUrl:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",category:"French News",country:"France",countrycode:"FR",language:"fr-FR",tags:"information,news,france"},{changeid:"es-rne",stationuuid:"es-rne",id:"es-rne",name:"Cadena SER Live (España)",url:"https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",url_resolved:"https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",streamUrl:"https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",backupStreamUrls:["https://25703.live.streamtheworld.com/CADENASER.mp3","http://livestreaming.esradio.fm/stream64.mp3","http://cadena100-streamers-mp3.flumotion.com/cope/cadena100.mp3"],category:"Spanish News & Culture",country:"Spain",countrycode:"ES",language:"es-ES",tags:"noticias,cultura,musica,radio nacional,cadena ser"},{changeid:"de-dlf",stationuuid:"de-dlf",id:"de-dlf",name:"Deutschlandfunk Culture",url:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",url_resolved:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",streamUrl:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",category:"German Culture",country:"Germany",countrycode:"DE",language:"de-DE",tags:"kultur,nachrichten,dlf"}],ct=Number.isFinite||function(n){return typeof n=="number"&&isFinite(n)},$Le=Number.isSafeInteger||function(n){return typeof n=="number"&&Math.abs(n)<=HLe},HLe=Number.MAX_SAFE_INTEGER||9007199254740991;let Bt=(function(n){return n.NETWORK_ERROR="networkError",n.MEDIA_ERROR="mediaError",n.KEY_SYSTEM_ERROR="keySystemError",n.MUX_ERROR="muxError",n.OTHER_ERROR="otherError",n})({}),Ee=(function(n){return n.KEY_SYSTEM_NO_KEYS="keySystemNoKeys",n.KEY_SYSTEM_NO_ACCESS="keySystemNoAccess",n.KEY_SYSTEM_NO_SESSION="keySystemNoSession",n.KEY_SYSTEM_NO_CONFIGURED_LICENSE="keySystemNoConfiguredLicense",n.KEY_SYSTEM_LICENSE_REQUEST_FAILED="keySystemLicenseRequestFailed",n.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED="keySystemServerCertificateRequestFailed",n.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED="keySystemServerCertificateUpdateFailed",n.KEY_SYSTEM_SESSION_UPDATE_FAILED="keySystemSessionUpdateFailed",n.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED="keySystemStatusOutputRestricted",n.KEY_SYSTEM_STATUS_INTERNAL_ERROR="keySystemStatusInternalError",n.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR="keySystemDestroyMediaKeysError",n.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR="keySystemDestroyCloseSessionError",n.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR="keySystemDestroyRemoveSessionError",n.MANIFEST_LOAD_ERROR="manifestLoadError",n.MANIFEST_LOAD_TIMEOUT="manifestLoadTimeOut",n.MANIFEST_PARSING_ERROR="manifestParsingError",n.MANIFEST_INCOMPATIBLE_CODECS_ERROR="manifestIncompatibleCodecsError",n.LEVEL_EMPTY_ERROR="levelEmptyError",n.LEVEL_LOAD_ERROR="levelLoadError",n.LEVEL_LOAD_TIMEOUT="levelLoadTimeOut",n.LEVEL_PARSING_ERROR="levelParsingError",n.LEVEL_SWITCH_ERROR="levelSwitchError",n.AUDIO_TRACK_LOAD_ERROR="audioTrackLoadError",n.AUDIO_TRACK_LOAD_TIMEOUT="audioTrackLoadTimeOut",n.SUBTITLE_LOAD_ERROR="subtitleTrackLoadError",n.SUBTITLE_TRACK_LOAD_TIMEOUT="subtitleTrackLoadTimeOut",n.FRAG_LOAD_ERROR="fragLoadError",n.FRAG_LOAD_TIMEOUT="fragLoadTimeOut",n.FRAG_DECRYPT_ERROR="fragDecryptError",n.FRAG_PARSING_ERROR="fragParsingError",n.FRAG_GAP="fragGap",n.REMUX_ALLOC_ERROR="remuxAllocError",n.KEY_LOAD_ERROR="keyLoadError",n.KEY_LOAD_TIMEOUT="keyLoadTimeOut",n.BUFFER_ADD_CODEC_ERROR="bufferAddCodecError",n.BUFFER_INCOMPATIBLE_CODECS_ERROR="bufferIncompatibleCodecsError",n.BUFFER_APPEND_ERROR="bufferAppendError",n.BUFFER_APPENDING_ERROR="bufferAppendingError",n.BUFFER_STALLED_ERROR="bufferStalledError",n.BUFFER_FULL_ERROR="bufferFullError",n.BUFFER_SEEK_OVER_HOLE="bufferSeekOverHole",n.BUFFER_NUDGE_ON_STALL="bufferNudgeOnStall",n.ASSET_LIST_LOAD_ERROR="assetListLoadError",n.ASSET_LIST_LOAD_TIMEOUT="assetListLoadTimeout",n.ASSET_LIST_PARSING_ERROR="assetListParsingError",n.INTERSTITIAL_ASSET_ITEM_ERROR="interstitialAssetItemError",n.INTERNAL_EXCEPTION="internalException",n.INTERNAL_ABORTED="aborted",n.ATTACH_MEDIA_ERROR="attachMediaError",n.UNKNOWN="unknown",n})({}
vendor: 9,037 bytes, line 4717
4717),V=(function(n){return n.MEDIA_ATTACHING="hlsMediaAttaching",n.MEDIA_ATTACHED="hlsMediaAttached",n.MEDIA_DETACHING="hlsMediaDetaching",n.MEDIA_DETACHED="hlsMediaDetached",n.MEDIA_ENDED="hlsMediaEnded",n.STALL_RESOLVED="hlsStallResolved",n.BUFFER_RESET="hlsBufferReset",n.BUFFER_CODECS="hlsBufferCodecs",n.BUFFER_CREATED="hlsBufferCreated",n.BUFFER_APPENDING="hlsBufferAppending",n.BUFFER_APPENDED="hlsBufferAppended",n.BUFFER_EOS="hlsBufferEos",n.BUFFERED_TO_END="hlsBufferedToEnd",n.BUFFER_FLUSHING="hlsBufferFlushing",n.BUFFER_FLUSHED="hlsBufferFlushed",n.MANIFEST_LOADING="hlsManifestLoading",n.MANIFEST_LOADED="hlsManifestLoaded",n.MANIFEST_PARSED="hlsManifestParsed",n.LEVEL_SWITCHING="hlsLevelSwitching",n.LEVEL_SWITCHED="hlsLevelSwitched",n.LEVEL_LOADING="hlsLevelLoading",n.LEVEL_LOADED="hlsLevelLoaded",n.LEVEL_UPDATED="hlsLevelUpdated",n.LEVEL_PTS_UPDATED="hlsLevelPtsUpdated",n.LEVELS_UPDATED="hlsLevelsUpdated",n.AUDIO_TRACKS_UPDATED="hlsAudioTracksUpdated",n.AUDIO_TRACK_SWITCHING="hlsAudioTrackSwitching",n.AUDIO_TRACK_SWITCHED="hlsAudioTrackSwitched",n.AUDIO_TRACK_LOADING="hlsAudioTrackLoading",n.AUDIO_TRACK_LOADED="hlsAudioTrackLoaded",n.AUDIO_TRACK_UPDATED="hlsAudioTrackUpdated",n.SUBTITLE_TRACKS_UPDATED="hlsSubtitleTracksUpdated",n.SUBTITLE_TRACKS_CLEARED="hlsSubtitleTracksCleared",n.SUBTITLE_TRACK_SWITCH="hlsSubtitleTrackSwitch",n.SUBTITLE_TRACK_LOADING="hlsSubtitleTrackLoading",n.SUBTITLE_TRACK_LOADED="hlsSubtitleTrackLoaded",n.SUBTITLE_TRACK_UPDATED="hlsSubtitleTrackUpdated",n.SUBTITLE_FRAG_PROCESSED="hlsSubtitleFragProcessed",n.CUES_PARSED="hlsCuesParsed",n.NON_NATIVE_TEXT_TRACKS_FOUND="hlsNonNativeTextTracksFound",n.INIT_PTS_FOUND="hlsInitPtsFound",n.FRAG_LOADING="hlsFragLoading",n.FRAG_LOAD_EMERGENCY_ABORTED="hlsFragLoadEmergencyAborted",n.FRAG_LOADED="hlsFragLoaded",n.FRAG_DECRYPTED="hlsFragDecrypted",n.FRAG_PARSING_INIT_SEGMENT="hlsFragParsingInitSegment",n.FRAG_PARSING_USERDATA="hlsFragParsingUserdata",n.FRAG_PARSING_METADATA="hlsFragParsingMetadata",n.FRAG_PARSED="hlsFragParsed",n.FRAG_BUFFERED="hlsFragBuffered",n.FRAG_CHANGED="hlsFragChanged",n.FPS_DROP="hlsFpsDrop",n.FPS_DROP_LEVEL_CAPPING="hlsFpsDropLevelCapping",n.MAX_AUTO_LEVEL_UPDATED="hlsMaxAutoLevelUpdated",n.ERROR="hlsError",n.DESTROYING="hlsDestroying",n.KEY_LOADING="hlsKeyLoading",n.KEY_LOADED="hlsKeyLoaded",n.LIVE_BACK_BUFFER_REACHED="hlsLiveBackBufferReached",n.BACK_BUFFER_REACHED="hlsBackBufferReached",n.STEERING_MANIFEST_LOADED="hlsSteeringManifestLoaded",n.ASSET_LIST_LOADING="hlsAssetListLoading",n.ASSET_LIST_LOADED="hlsAssetListLoaded",n.INTERSTITIALS_UPDATED="hlsInterstitialsUpdated",n.INTERSTITIALS_BUFFERED_TO_BOUNDARY="hlsInterstitialsBufferedToBoundary",n.INTERSTITIAL_ASSET_PLAYER_CREATED="hlsInterstitialAssetPlayerCreated",n.INTERSTITIAL_STARTED="hlsInterstitialStarted",n.INTERSTITIAL_ASSET_STARTED="hlsInterstitialAssetStarted",n.INTERSTITIAL_ASSET_ENDED="hlsInterstitialAssetEnded",n.INTERSTITIAL_ASSET_ERROR="hlsInterstitialAssetError",n.INTERSTITIAL_ENDED="hlsInterstitialEnded",n.INTERSTITIALS_PRIMARY_RESUMED="hlsInterstitialsPrimaryResumed",n.PLAYOUT_LIMIT_REACHED="hlsPlayoutLimitReached",n.EVENT_CUE_ENTER="hlsEventCueEnter",n})({});var Xt={MANIFEST:"manifest",LEVEL:"level",AUDIO_TRACK:"audioTrack",SUBTITLE_TRACK:"subtitleTrack"},mt={MAIN:"main",AUDIO:"audio",SUBTITLE:"subtitle"};class Xp{constructor(e,t=0,r=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_=t,this.totalWeight_=r}sample(e,t){const r=Math.pow(this.alpha_,e);this.estimate_=t*(1-r)+r*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 zLe{constructor(e,t,r,s=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_=r,this.minWeight_=.001,this.minDelayMs_=50,this.slow_=new Xp(e),this.fast_=new Xp(t),this.defaultTTFB_=s,this.ttfb_=new Xp(e)}update(e,t){const{slow_:r,fast_:s,ttfb_:a}=this;r.halfLife!==e&&(this.slow_=new Xp(e,r.getEstimate(),r.getTotalWeight())),s.halfLife!==t&&(this.fast_=new Xp(t,s.getEstimate(),s.getTotalWeight())),a.halfLife!==e&&(this.ttfb_=new Xp(e,a.getEstimate(),a.getTotalWeight()))}sample(e,t){e=Math.max(e,this.minDelayMs_);const r=8*t,s=e/1e3,a=r/s;this.fast_.sample(s,a),this.slow_.sample(s,a)}sampleTTFB(e){const t=e/1e3,r=Math.sqrt(2)*Math.exp(-Math.pow(t,2)/2);this.ttfb_.sample(r,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 qLe(n,e,t){return(e=WLe(e))in n?Object.defineProperty(n,e,{value:t,enumerable:!0,configurable:!0,writable:!0}):n[e]=t,n}function sr(){return sr=Object.assign?Object.assign.bind():function(n){for(var e=1;e<arguments.length;e++){var t=arguments[e];for(var r in t)({}).hasOwnProperty.call(t,r)&&(n[r]=t[r])}return n},sr.apply(null,arguments)}function _9(n,e){var t=Object.keys(n);if(Object.getOwnPropertySymbols){var r=Object.getOwnPropertySymbols(n);e&&(r=r.filter(function(s){return Object.getOwnPropertyDescriptor(n,s).enumerable})),t.push.apply(t,r)}return t}function zn(n){for(var e=1;e<arguments.length;e++){var t=arguments[e]!=null?arguments[e]:{};e%2?_9(Object(t),!0).forEach(function(r){qLe(n,r,t[r])}):Object.getOwnPropertyDescriptors?Object.defineProperties(n,Object.getOwnPropertyDescriptors(t)):_9(Object(t)).forEach(function(r){Object.defineProperty(n,r,Object.getOwnPropertyDescriptor(t,r))})}return n}function KLe(n,e){if(typeof n!="object"||!n)return n;var t=n[Symbol.toPrimitive];if(t!==void 0){var r=t.call(n,e);if(typeof r!="object")return r;throw new TypeError("@@toPrimitive must return a primitive value.")}return(e==="string"?String:Number)(n)}function WLe(n){var e=KLe(n,"string");return typeof e=="symbol"?e:e+""}class ul{constructor(e,t){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 r=`[${e}]:`;this.trace=Zu,this.debug=t.debug.bind(null,r),this.log=t.log.bind(null,r),this.warn=t.warn.bind(null,r),this.info=t.info.bind(null,r),this.error=t.error.bind(null,r)}}const Zu=function(){},YLe={trace:Zu,debug:Zu,log:Zu,warn:Zu,info:Zu,error:Zu};function lD(){return sr({},YLe)}function QLe(n,e){const t=self.console[n];return t?t.bind(self.console,`${e?"["+e+"] ":""}[${n}] >`):Zu}function I9(n,e,t){return e[n]?e[n].bind(e):QLe(n,t)}const cD=lD();function JLe(n,e,t){const r=lD();if(typeof console=="object"&&n===!0||typeof n=="object"){const s=["debug","log","info","warn","error"];s.forEach(a=>{r[a]=I9(a,n,t)});try{r.log(`Debug logs enabled for "${e}" in hls.js version 1.6.16`)}catch{return lD()}s.forEach(a=>{cD[a]=I9(a,n)})}else sr(cD,r);return r}const Kn=cD;function Gh(n=!0){return typeof self>"u"?void 0:(n||!self.MediaSource)&&self.ManagedMediaSource||self.MediaSource||self.WebKitMediaSource}function XLe(n){return typeof self<"u"&&n===self.ManagedMediaSource}function vZ(n,e){const t=Object.keys(n),r=Object.keys(e),s=t.length,a=r.length;return!s||!a||s===a&&!t.some(o=>r.indexOf(o)===-1)}function To(n,e=!1){if(typeof TextDecoder<"u"){const d=new TextDecoder("utf-8").decode(n);if(e){const h=d.indexOf("\0");return h!==-1?d.substring(0,h):d}return d.replace(/\0/g,"")}const t=n.length;let r,s,a,o="",l=0;for(;l<t;){if(r=n[l++],r===0&&e)return o;if(r===0||r===3)continue;switch(r>>4){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:o+=String.fromCharCode(r);break;case 12:case 13:s=n[l++],o+=String.fromCharCode((r&31)<<6|s&63);break;case 14:s=n[l++],a=n[l++],o+=String.fromCharCode((r&15)<<12|(s&63)<<6|(a&63)<<0);break}}return o}function Ra(n){let e="";for(let t=0;t<n.length;t++){let r=n[t].toString(16);r.length<2&&(r="0"+r),e+=r}return e}function BZ(n){return Uint8Array.from(n.replace(/^0x/,"").replace(/([\da-fA-F]{2}) ?/g,"0x$1 ").replace(/ +$/,"").split(" ")).buffer}function ZLe(n){return n&&n.__esModule&&Object.prototype.hasOwnProperty.call(n,"default")?n.default:n}var DN={exports:{}},D9;function eOe(){return D9||(D9=1,(function(n,e){(function(t){var r=/^(?=((?:[a-zA-Z0-9+\-.]+:)?))\1(?=((?:\/\/[^\/?#]*)?))\2(?=((?:(?:[^?#\/]*\/)*[^;?#\/]*)?))\3((?:;[^?#]*)?)(\?[^#]*)?(#[^]*)?$/,s=/^(?=([^\/?#]*))\1([^]*)$/,a=/(?:\/|^)\.(?=\/)/g,o=/(?:\/|^)\.\.\/(?!\.\.\/)[^\/]*(?=\/)/g,l={buildAbsoluteURL:function(c,d,h){if(h=h||{},c=c.trim(),d=d.trim(),!d){if(!h.alwaysNormalize)return c;var m=l.parseURL(c);if(!m)throw new Error("Error trying to parse base URL.");return m.path=l.normalizePath(m.path),l.buildURLFromParts(m)}var p=l.parseURL(d);if(!p)throw new Error("Error trying to parse relative URL.");
vendor: 7,410 bytes, line 4717
4717if(p.scheme)return h.alwaysNormalize?(p.path=l.normalizePath(p.path),l.buildURLFromParts(p)):d;var x=l.parseURL(c);if(!x)throw new Error("Error trying to parse base URL.");if(!x.netLoc&&x.path&&x.path[0]!=="/"){var y=s.exec(x.path);x.netLoc=y[1],x.path=y[2]}x.netLoc&&!x.path&&(x.path="/");var v={scheme:x.scheme,netLoc:p.netLoc,path:null,params:p.params,query:p.query,fragment:p.fragment};if(!p.netLoc&&(v.netLoc=x.netLoc,p.path[0]!=="/"))if(!p.path)v.path=x.path,p.params||(v.params=x.params,p.query||(v.query=x.query));else{var B=x.path,E=B.substring(0,B.lastIndexOf("/")+1)+p.path;v.path=l.normalizePath(E)}return v.path===null&&(v.path=h.alwaysNormalize?l.normalizePath(p.path):p.path),l.buildURLFromParts(v)},parseURL:function(c){var d=r.exec(c);return d?{scheme:d[1]||"",netLoc:d[2]||"",path:d[3]||"",params:d[4]||"",query:d[5]||"",fragment:d[6]||""}:null},normalizePath:function(c){for(c=c.split("").reverse().join("").replace(a,"");c.length!==(c=c.replace(o,"")).length;);return c.split("").reverse().join("")},buildURLFromParts:function(c){return c.scheme+c.netLoc+c.path+c.params+c.query+c.fragment}};n.exports=l})()})(DN)),DN.exports}var OP=eOe();class MP{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 hr={AUDIO:"audio",VIDEO:"video",AUDIOVIDEO:"audiovideo"};class wZ{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,nOe(this,"stats")}setByteRange(e,t){const r=e.split("@",2);let s;r.length===1?s=(t==null?void 0:t.byteRangeEndOffset)||0:s=parseInt(r[1]),this._byteRange=[s,parseInt(r[0])+s]}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={[hr.AUDIO]:null,[hr.VIDEO]:null,[hr.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 MP),this._stats}set stats(e){this._stats=e}get url(){return!this._url&&this.baseurl&&this.relurl&&(this._url=OP.buildAbsoluteURL(this.baseurl,this.relurl,{alwaysNormalize:!0})),this._url||""}set url(e){this._url=e}clearElementaryStreamInfo(){const{elementaryStreams:e}=this;e[hr.AUDIO]=null,e[hr.VIDEO]=null,e[hr.AUDIOVIDEO]=null}}function ws(n){return n.sn!=="initSegment"}class jN extends wZ{constructor(e,t){super(t),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],t=this.byteRange[1];if(ct(e)&&ct(t))return t-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:t}=this;if(!t||t.NONE)return null;if(t.identity)this._decryptdata||(this._decryptdata=t.identity.getDecryptData(this.sn));else if(!((e=this._decryptdata)!=null&&e.keyId)){const r=Object.keys(t);if(r.length===1){const s=this._decryptdata=t[r[0]]||null;s&&(this._decryptdata=s.getDecryptData(this.sn,t))}}return this._decryptdata}get end(){return this.start+this.duration}get endProgramDateTime(){if(this.programDateTime===null)return null;const e=ct(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 t;const r=Object.keys(this.levelkeys),s=r.length;if(s>1||s===1&&(t=this.levelkeys[r[0]])!=null&&t.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(!ct(e)){this._programDateTime=this.rawProgramDateTime=null;return}this._programDateTime=e}get ref(){return ws(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 t=this.levelkeys;if(t){var r;const s=t[e];s&&!((r=this._decryptdata)!=null&&r.keyId)&&(this._decryptdata=s.getDecryptData(this.sn,t))}}abortRequests(){var e,t;(e=this.loader)==null||e.abort(),(t=this.keyLoader)==null||t.abort()}setElementaryStreamInfo(e,t,r,s,a,o=!1){const{elementaryStreams:l}=this,c=l[e];if(!c){l[e]={startPTS:t,endPTS:r,startDTS:s,endDTS:a,partial:o};return}c.startPTS=Math.min(c.startPTS,t),c.endPTS=Math.max(c.endPTS,r),c.startDTS=Math.min(c.startDTS,s),c.endDTS=Math.max(c.endDTS,a)}}class tOe extends wZ{constructor(e,t,r,s,a){super(r),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=t,this.index=s;const o=e.enumeratedString("BYTERANGE");o&&this.setByteRange(o,a),a&&(this.fragOffset=a.fragOffset+a.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 CZ(n,e){const t=Object.getPrototypeOf(n);if(t){const r=Object.getOwnPropertyDescriptor(t,e);return r||CZ(t,e)}}function nOe(n,e){const t=CZ(n,e);t&&(t.enumerable=!0,Object.defineProperty(n,e,t))}const j9=Math.pow(2,32)-1,rOe=[].push,EZ={video:1,audio:2,id3:3,text:4};function zs(n){return String.fromCharCode.apply(null,n)}function SZ(n,e){const t=n[e]<<8|n[e+1];return t<0?65536+t:t}function Mt(n,e){const t=TZ(n,e);return t<0?4294967296+t:t}function R9(n,e){let t=Mt(n,e);return t*=Math.pow(2,32),t+=Mt(n,e+4),t}function TZ(n,e){return n[e]<<24|n[e+1]<<16|n[e+2]<<8|n[e+3]}function sOe(n){const e=n.byteLength;for(let t=0;t<e;){const r=Mt(n,t);if(r>8&&n[t+4]===109&&n[t+5]===111&&n[t+6]===111&&n[t+7]===102)return!0;t=r>1?t+r:e}return!1}function Jt(n,e){const t=[];if(!e.length)return t;const r=n.byteLength;for(let s=0;s<r;){const a=Mt(n,s),o=zs(n.subarray(s+4,s+8)),l=a>1?s+a:r;if(o===e[0])if(e.length===1)t.push(n.subarray(s+8,l));else{const c=Jt(n.subarray(s+8,l),e.slice(1));c.length&&rOe.apply(t,c)}s=l}return t}function aOe(n){const e=[],t=n[0];let r=8;const s=Mt(n,r);r+=4;let a=0,o=0;t===0?(a=Mt(n,r),o=Mt(n,r+4),r+=8):(a=R9(n,r),o=R9(n,r+8),r+=16),r+=2;let l=n.length+o;const c=SZ(n,r);r+=2;
vendor: 4,247 bytes, line 4717
4717for(let d=0;d<c;d++){let h=r;const m=Mt(n,h);h+=4;const p=m&2147483647;if((m&2147483648)>>>31===1)return Kn.warn("SIDX has hierarchical references (not supported)"),null;const y=Mt(n,h);h+=4,e.push({referenceSize:p,subsegmentDuration:y,info:{duration:y/s,start:l,end:l+p-1}}),l+=p,h+=4,r=h}return{earliestPresentationTime:a,timescale:s,version:t,referencesCount:c,references:e}}function AZ(n){const e=[],t=Jt(n,["moov","trak"]);for(let s=0;s<t.length;s++){const a=t[s],o=Jt(a,["tkhd"])[0];if(o){let l=o[0];const c=Mt(o,l===0?12:20),d=Jt(a,["mdia","mdhd"])[0];if(d){l=d[0];const h=Mt(d,l===0?12:20),m=Jt(a,["mdia","hdlr"])[0];if(m){const p=zs(m.subarray(8,12)),x={soun:hr.AUDIO,vide:hr.VIDEO}[p],y=Jt(a,["mdia","minf","stbl","stsd"])[0],v=iOe(y);x?(e[c]={timescale:h,type:x,stsd:v},e[x]=zn({timescale:h,id:c},v)):e[c]={timescale:h,type:p,stsd:v}}}}}return Jt(n,["moov","mvex","trex"]).forEach(s=>{const a=Mt(s,4),o=e[a];o&&(o.default={duration:Mt(s,12),flags:Mt(s,20)})}),e}function iOe(n){const e=n.subarray(8),t=e.subarray(86),r=zs(e.subarray(4,8));let s=r,a;const o=r==="enca"||r==="encv";if(o){const d=Jt(e,[r])[0].subarray(r==="enca"?28:78);Jt(d,["sinf"]).forEach(m=>{const p=Jt(m,["schm"])[0];if(p){const x=zs(p.subarray(4,8));if(x==="cbcs"||x==="cenc"){const y=Jt(m,["frma"])[0];y&&(s=zs(y))}}})}const l=s;switch(s){case"avc1":case"avc2":case"avc3":case"avc4":{const c=Jt(t,["avcC"])[0];c&&c.length>3&&(s+="."+Rw(c[1])+Rw(c[2])+Rw(c[3]),a=jw(l==="avc1"?"dva1":"dvav",t));break}case"mp4a":{const c=Jt(e,[r])[0],d=Jt(c.subarray(28),["esds"])[0];if(d&&d.length>7){let h=4;if(d[h++]!==3)break;h=RN(d,h),h+=2;const m=d[h++];if(m&128&&(h+=2),m&64&&(h+=d[h++]),d[h++]!==4)break;h=RN(d,h);const p=d[h++];if(p===64)s+="."+Rw(p);else break;if(h+=12,d[h++]!==5)break;h=RN(d,h);const x=d[h++];let y=(x&248)>>3;y===31&&(y+=1+((x&7)<<3)+((d[h]&224)>>5)),s+="."+y}break}case"hvc1":case"hev1":{const c=Jt(t,["hvcC"])[0];if(c&&c.length>12){const d=c[1],h=["","A","B","C"][d>>6],m=d&31,p=Mt(c,2),x=(d&32)>>5?"H":"L",y=c[12],v=c.subarray(6,12);s+="."+h+m,s+="."+oOe(p).toString(16).toUpperCase(),s+="."+x+y;let B="";for(let E=v.length;E--;){const N=v[E];(N||B)&&(B="."+N.toString(16).toUpperCase()+B)}s+=B}a=jw(l=="hev1"?"dvhe":"dvh1",t);break}case"dvh1":case"dvhe":case"dvav":case"dva1":case"dav1":{s=jw(s,t)||s;break}case"vp09":{const c=Jt(t,["vpcC"])[0];if(c&&c.length>6){const d=c[4],h=c[5],m=c[6]>>4&15;s+="."+uc(d)+"."+uc(h)+"."+uc(m)}break}case"av01":{const c=Jt(t,["av1C"])[0];if(c&&c.length>2){const d=c[1]>>>5,h=c[1]&31,m=c[2]>>>7?"H":"M",p=(c[2]&64)>>6,x=(c[2]&32)>>5,y=d===2&&p?x?12:10:p?10:8,v=(c[2]&16)>>4,B=(c[2]&8)>>3,E=(c[2]&4)>>2,N=c[2]&3;s+="."+d+"."+uc(h)+m+"."+uc(y)+"."+v+"."+B+E+N+"."+uc(1)+"."+uc(1)+"."+uc(1)+"."+0,a=jw("dav1",t)}break}}return{codec:s,encrypted:o,supplemental:a}}function jw(n,e){const t=Jt(e,["dvvC"]),r=t.length?t[0]:Jt(e,["dvcC"])[0];if(r){const s=r[2]>>1&127,a=r[2]<<5&32|r[3]>>3&31;return n+"."+uc(s)+"."+uc(a)}}function oOe(n){let e=0;for(let t=0;t<32;t++)e|=(n>>t&1)<<31-t;return e>>>0}function RN(n,e){const t=e+5;for(;n[e++]&128&&e<t;);return e}function Rw(n){return("0"+n.toString(16).toUpperCase()).slice(-2)}function uc(n){return(n<10?"0":"")+n}function lOe(n,e){if(!n||!e)return;const t=e.keyId;t&&e.isCommonEncryption&&kZ(n,(r,s)=>{const a=r.subarray(8,24);a.some(o=>o!==0)||(Kn.log(`[eme] Patching keyId in 'enc${s?"a":"v"}>sinf>>tenc' box: ${Ra(a)} -> ${Ra(t)}`),r.set(t,8))})}function cOe(n){const e=[];return kZ(n,t=>e.push(t.subarray(8,24))),e}function kZ(n,e){Jt(n,["moov","trak"]).forEach(r=>{const s=Jt(r,["mdia","minf","stbl","stsd"])[0];if(!s)return;const a=s.subarray(8);let o=Jt(a,["enca"]);const l=o.length>0;l||(o=Jt(a,["encv"])),o.forEach(c=>{const d=l?c.subarray(28):c.subarray(78);Jt(d,["sinf"]).forEach(m=>{const p=NZ(m);p&&e(p,l)})})})}function NZ(n){const e=Jt(n,["schm"])[0];if(e){const t=zs(e.subarray(4,8));if(t==="cbcs"||t==="cenc"){const r=Jt(n,["schi","tenc"])[0];if(r)return r}}}function dOe(n,e,t){const r={},s=Jt(n,["moof","traf"]);for(let a=0;a<s.length;a++){const o=s[a],l=Jt(o,["tfhd"])[0],c=Mt(l,4),d=e[c];if(!d)continue;r[c]||(r[c]={start:NaN,duration:0,sampleCount:0,timescale:d.timescale,type:d.type});const h=r[c],m=Jt(o,["tfdt"])[0];if(m){const T=m[0];let k=Mt(m,4);
vendor: 17,449 bytes, line 4717
4717T===1&&(k===j9?t.warn("[mp4-demuxer]: Ignoring assumed invalid signed 64-bit track fragment decode time"):(k*=j9+1,k+=Mt(m,8))),ct(k)&&(!ct(h.start)||k<h.start)&&(h.start=k)}const p=d.default,x=Mt(l,0)|(p==null?void 0:p.flags);let y=(p==null?void 0:p.duration)||0;x&8&&(x&2?y=Mt(l,12):y=Mt(l,8));const v=Jt(o,["trun"]);let B=h.start||0,E=0,N=y;for(let T=0;T<v.length;T++){const k=v[T],P=Mt(k,4),R=h.sampleCount;h.sampleCount+=P;const _=k[3]&1,I=k[3]&4,D=k[2]&1,j=k[2]&2,O=k[2]&4,M=k[2]&8;let U=8,ee=P;for(_&&(U+=4),I&&P&&(!(k[U+1]&1)&&h.keyFrameIndex===void 0&&(h.keyFrameIndex=R),U+=4,D?(N=Mt(k,U),U+=4):N=y,j&&(U+=4),M&&(U+=4),B+=N,E+=N,ee--);ee--;)D?(N=Mt(k,U),U+=4):N=y,j&&(U+=4),O&&(k[U+1]&1||h.keyFrameIndex===void 0&&(h.keyFrameIndex=h.sampleCount-(ee+1),h.keyFrameStart=B),U+=4),M&&(U+=4),B+=N,E+=N;!E&&y&&(E+=y*P)}h.duration+=E}if(!Object.keys(r).some(a=>r[a].duration)){let a=1/0,o=0;const l=Jt(n,["sidx"]);for(let c=0;c<l.length;c++){const d=aOe(l[c]);if(d!=null&&d.references){a=Math.min(a,d.earliestPresentationTime/d.timescale);const h=d.references.reduce((m,p)=>m+p.info.duration||0,0);o=Math.max(o,h+d.earliestPresentationTime/d.timescale)}}o&&ct(o)&&Object.keys(r).forEach(c=>{r[c].duration||(r[c].duration=o*r[c].timescale-r[c].start)})}return r}function uOe(n){const e={valid:null,remainder:null},t=Jt(n,["moof"]);if(t.length<2)return e.remainder=n,e;const r=t[t.length-1];return e.valid=n.slice(0,r.byteOffset-8),e.remainder=n.slice(r.byteOffset-8),e}function ol(n,e){const t=new Uint8Array(n.length+e.length);return t.set(n),t.set(e,n.length),t}function P9(n,e){const t=[],r=e.samples,s=e.timescale,a=e.id;let o=!1;return Jt(r,["moof"]).map(c=>{const d=c.byteOffset-8;Jt(c,["traf"]).map(m=>{const p=Jt(m,["tfdt"]).map(x=>{const y=x[0];let v=Mt(x,4);return y===1&&(v*=Math.pow(2,32),v+=Mt(x,8)),v/s})[0];return p!==void 0&&(n=p),Jt(m,["tfhd"]).map(x=>{const y=Mt(x,4),v=Mt(x,0)&16777215,B=(v&1)!==0,E=(v&2)!==0,N=(v&8)!==0;let T=0;const k=(v&16)!==0;let P=0;const R=(v&32)!==0;let _=8;y===a&&(B&&(_+=8),E&&(_+=4),N&&(T=Mt(x,_),_+=4),k&&(P=Mt(x,_),_+=4),R&&(_+=4),e.type==="video"&&(o=uT(e.codec)),Jt(m,["trun"]).map(I=>{const D=I[0],j=Mt(I,0)&16777215,O=(j&1)!==0;let M=0;const U=(j&4)!==0,ee=(j&256)!==0;let ie=0;const G=(j&512)!==0;let Z=0;const z=(j&1024)!==0,se=(j&2048)!==0;let re=0;const H=Mt(I,4);let Y=8;O&&(M=Mt(I,Y),Y+=4),U&&(Y+=4);let de=M+d;for(let W=0;W<H;W++){if(ee?(ie=Mt(I,Y),Y+=4):ie=T,G?(Z=Mt(I,Y),Y+=4):Z=P,z&&(Y+=4),se&&(D===0?re=Mt(I,Y):re=TZ(I,Y),Y+=4),e.type===hr.VIDEO){let K=0;for(;K<Z;){const J=Mt(r,de);if(de+=4,hOe(o,r[de])){const oe=r.subarray(de,de+J);FP(oe,o?2:1,n+re/s,t)}de+=J,K+=J+4}}n+=ie/s}}))})})}),t}function uT(n){if(!n)return!1;const e=n.substring(0,4);return e==="hvc1"||e==="hev1"||e==="dvh1"||e==="dvhe"}function hOe(n,e){if(n){const t=e>>1&63;return t===39||t===40}else return(e&31)===6}function FP(n,e,t,r){const s=_Z(n);let a=0;a+=e;let o=0,l=0,c=0;for(;a<s.length;){o=0;do{if(a>=s.length)break;c=s[a++],o+=c}while(c===255);l=0;do{if(a>=s.length)break;c=s[a++],l+=c}while(c===255);const d=s.length-a;let h=a;if(l<d)a+=l;else if(l>d){Kn.error(`Malformed SEI payload. ${l} is too small, only ${d} bytes left to parse.`);break}if(o===4){if(s[h++]===181){const p=SZ(s,h);if(h+=2,p===49){const x=Mt(s,h);if(h+=4,x===1195456820){const y=s[h++];if(y===3){const v=s[h++],B=31&v,E=64&v,N=E?2+B*3:0,T=new Uint8Array(N);if(E){T[0]=v;for(let k=1;k<N;k++)T[k]=s[h++]}r.push({type:y,payloadType:o,pts:t,bytes:T})}}}}}else if(o===5&&l>16){const m=[];for(let y=0;y<16;y++){const v=s[h++].toString(16);m.push(v.length==1?"0"+v:v),(y===3||y===5||y===7||y===9)&&m.push("-")}const p=l-16,x=new Uint8Array(p);for(let y=0;y<p;y++)x[y]=s[h++];r.push({payloadType:o,pts:t,uuid:m.join(""),userData:To(x),userDataBytes:x})}}}function _Z(n){const e=n.byteLength,t=[];let r=1;for(;r<e-2;)n[r]===0&&n[r+1]===0&&n[r+2]===3?(t.push(r+2),r+=2):r++;if(t.length===0)return n;const s=e-t.length,a=new Uint8Array(s);let o=0;for(r=0;r<s;o++,r++)o===t[0]&&(o++,t.shift()),a[r]=n[o];return a}function fOe(n){const e=n[0];let t="",r="",s=0,a=0,o=0,l=0,c=0,d=0;if(e===0){for(;zs(n.subarray(d,d+1))!=="\0";)t+=zs(n.subarray(d,d+1)),d+=1;for(t+=zs(n.subarray(d,d+1)),d+=1;zs(n.subarray(d,d+1))!=="\0";)r+=zs(n.subarray(d,d+1)),d+=1;r+=zs(n.subarray(d,d+1)),d+=1,s=Mt(n,12),a=Mt(n,16),l=Mt(n,20),c=Mt(n,24),d=28}else if(e===1){d+=4,s=Mt(n,d),d+=4;const m=Mt(n,d);d+=4;const p=Mt(n,d);for(d+=4,o=2**32*m+p,$Le(o)||(o=Number.MAX_SAFE_INTEGER,Kn.warn("Presentation time exceeds safe integer limit and wrapped to max safe integer in parsing emsg box")),l=Mt(n,d),d+=4,c=Mt(n,d),d+=4;zs(n.subarray(d,d+1))!=="\0";)t+=zs(n.subarray(d,d+1)),d+=1;for(t+=zs(n.subarray(d,d+1)),d+=1;zs(n.subarray(d,d+1))!=="\0";)r+=zs(n.subarray(d,d+1)),d+=1;r+=zs(n.subarray(d,d+1)),d+=1}const h=n.subarray(d,n.byteLength);return{schemeIdUri:t,value:r,timeScale:s,presentationTime:o,presentationTimeDelta:a,eventDuration:l,id:c,payload:h}}function mOe(n,...e){const t=e.length;let r=8,s=t;for(;s--;)r+=e[s].byteLength;const a=new Uint8Array(r);for(a[0]=r>>24&255,a[1]=r>>16&255,a[2]=r>>8&255,a[3]=r&255,a.set(n,4),s=0,r=8;s<t;s++)a.set(e[s],r),r+=e[s].byteLength;return a}function pOe(n,e,t){if(n.byteLength!==16)throw new RangeError("Invalid system id");let r,s;r=0,s=new Uint8Array;let a;r>0?(a=new Uint8Array(4),e.length>0&&new DataView(a.buffer).setUint32(0,e.length,!1)):a=new Uint8Array;const o=new Uint8Array(4);return t.byteLength>0&&new DataView(o.buffer).setUint32(0,t.byteLength,!1),mOe([112,115,115,104],new Uint8Array([r,0,0,0]),n,a,s,o,t)}function gOe(n){const e=[];if(n instanceof ArrayBuffer){const t=n.byteLength;let r=0;for(;r+32<t;){const s=new DataView(n,r),a=xOe(s);e.push(a),r+=a.size}}return e}function xOe(n){const e=n.getUint32(0),t=n.byteOffset,r=n.byteLength;if(r<e)return{offset:t,size:r};if(n.getUint32(4)!==1886614376)return{offset:t,size:e};const a=n.getUint32(8)>>>24;if(a!==0&&a!==1)return{offset:t,size:e};const o=n.buffer,l=Ra(new Uint8Array(o,t+12,16));let c=null,d=null,h=0;if(a===0)h=28;else{const p=n.getUint32(28);if(!p||r<32+p*16)return{offset:t,size:e};c=[];for(let x=0;x<p;x++)c.push(new Uint8Array(o,t+32+x*16,16));h=32+p*16}if(!h)return{offset:t,size:e};const m=n.getUint32(h);return e-32<m?{offset:t,size:e}:(d=new Uint8Array(o,t+h+4,m),{version:a,systemId:l,kids:c,data:d,offset:t,size:e})}const IZ=()=>/\(Windows.+Firefox\//i.test(navigator.userAgent),Tg={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 UP(n,e){const t=Tg[e];return!!t&&!!t[n.slice(0,4)]}function Fy(n,e,t=!0){return!n.split(",").some(r=>!VP(r,e,t))}function VP(n,e,t=!0){var r;const s=Gh(t);return(r=s==null?void 0:s.isTypeSupported(Uy(n,e)))!=null?r:!1}function Uy(n,e){return`${e}/mp4;codecs=${n}`}function L9(n){if(n){const e=n.substring(0,4);return Tg.video[e]}return 2}function h1(n){const e=IZ();return n.split(",").reduce((t,r)=>{const a=e&&uT(r)?9:Tg.video[r];return a?(a*2+t)/(t?3:2):(Tg.audio[r]+t)/(t?2:1)},0)}const PN={};function bOe(n,e=!0){if(PN[n])return PN[n];const t={flac:["flac","fLaC","FLAC"],opus:["opus","Opus"],"mp4a.40.34":["mp3"]}[n];for(let s=0;s<t.length;s++){var r;if(VP(t[s],"audio",e))return PN[n]=t[s],t[s];if(t[s]==="mp3"&&(r=Gh(e))!=null&&r.isTypeSupported("audio/mpeg"))return""}return n}const yOe=/flac|opus|mp4a\.40\.34/i;function f1(n,e=!0){return n.replace(yOe,t=>bOe(t.toLowerCase(),e))}function vOe(n,e){const t=[];if(n){const r=n.split(",");for(let s=0;s<r.length;s++)UP(r[s],"video")||t.push(r[s])}return e&&t.push(e),t.join(",")}function AC(n,e){if(n&&(n.length>4||["ac-3","ec-3","alac","fLaC","Opus"].indexOf(n)!==-1)&&(O9(n,"audio")||O9(n,"video")))return n;if(e){const t=e.split(",");if(t.length>1){if(n){for(let r=t.length;r--;)if(t[r].substring(0,4)===n.substring(0,4))return t[r]}return t[0]}}return e||n}function O9(n,e){return UP(n,e)&&VP(n,e)}function BOe(n){const e=n.split(",");for(let t=0;t<e.length;t++){const r=e[t].split(".");r.length>2&&r[0]==="avc1"&&(e[t]=`avc1.${parseInt(r[1]).toString(16)}${("000"+parseInt(r[2]).toString(16)).slice(-4)}`)}return e.join(",")}function wOe(n){if(n.startsWith("av01.")){const e=n.split("."),t=["0","111","01","01","01","0"];for(let r=e.length;r>4&&r<10;r++)e[r]=t[r-4];return e.join(".")}return n}function M9(n){const e=Gh(n)||{isTypeSupported:()=>!1};return{mpeg:e.isTypeSupported("audio/mpeg"),mp3:e.isTypeSupported('audio/mp4; codecs="mp3"'),ac3:e.isTypeSupported('audio/mp4; codecs="ac-3"')}}function dD(n){return n.replace(/^.+codecs=["']?([^"']+).*$/,"$1")}const COe={supported:!0,powerEfficient:!0,smooth:!0},EOe={supported:!1,smooth:!1,powerEfficient:!1},DZ={supported:!0,configurations:[],decodingInfoResults:[COe]};function jZ(n,e){return{supported:!1,configurations:e,decodingInfoResults:[EOe],error:n}}function SOe(n,e,t,r,s,a){const o=n.videoCodec,l=n.audioCodec?n.audioGroups:null,c=a==null?void 0:a.audioCodec,d=a==null?void 0:a.channels,h=d?parseInt(d):c?1/0:2;let m=null;if(l!=null&&l.length)try{l.length===1&&l[0]?m=e.groups[l[0]].channels:m=l.reduce((p,x)=>{if(x){const y=e.groups[x];if(!y)throw new Error(`Audio track group ${x} not found`);Object.keys(y.channels).forEach(v=>{p[v]=(p[v]||0)+y.channels[v]})}return p},{2:0})}catch{return!0}return o!==void 0&&(o.split(",").some(p=>uT(p))||n.width>1920&&n.height>1088||n.height>1920&&n.width>1088||n.frameRate>Math.max(r,30)||n.videoRange!=="SDR"&&n.videoRange!==t||n.bitrate>Math.max(s,8e6))||!!m&&ct(h)&&Object.keys(m).some(p=>parseInt(p)>h)}function RZ(n,e,t,r={}){const s=n.videoCodec;if(!s&&!n.audioCodec||!t)return Promise.resolve(DZ);const a=[],o=TOe(n),l=o.length,c=AOe(n,e,l>0),d=c.length;for(let h=l||1*d||1;h--;){const m={type:"media-source"};if(l&&(m.video=o[h%l]),d){m.audio=c[h%d];const p=m.audio.bitrate;m.video&&p&&(m.video.bitrate-=p)}a.push(m)}if(s){const h=navigator.userAgent;if(s.split(",").some(m=>uT(m))&&IZ())return Promise.resolve(jZ(new Error(`Overriding Windows Firefox HEVC MediaCapabilities result based on user-agent string: (${h})`),a))}return Promise.all(a.map(h=>{const m=NOe(h);return r[m]||(r[m]=t.decodingInfo(h))})).then(h=>({supported:!h.some(m=>!m.supported),configurations:a,decodingInfoResults:h})).catch(h=>({supported:!1,configurations:a,decodingInfoResults:[],error:h}))}function TOe(n){var e;const t=(e=n.videoCodec)==null?void 0:e.split(","),r=PZ(n),s=n.width||640,a=n.height||480,o=n.frameRate||30,l=n.videoRange.toLowerCase();return t?t.map(c=>{const d={contentType:Uy(wOe(c),"video"),width:s,height:a,bitrate:r,framerate:o};return l!=="sdr"&&(d.transferFunction=l),d}):[]}function AOe(n,e,t){var r;const s=(r=n.audioCodec)==null?void 0:r.split(","),a=PZ(n);return s&&n.audioGroups?n.audioGroups.reduce((o,l)=>{var c;const d=l?(c=e.groups[l])==null?void 0:c.tracks:null;return d?d.reduce((h,m)=>{if(m.groupId===l){const p=parseFloat(m.channels||"");s.forEach(x=>{const y={contentType:Uy(x,"audio"),bitrate:t?kOe(x,a):a};p&&(y.channels=""+p),h.push(y)})}return h},o):o},[]):[]}function kOe(n,e){if(e<=1)return 1;let t=128e3;return n==="ec-3"?t=768e3:n==="ac-3"&&(t=64e4),Math.min(e/2,t)}function PZ(n){return Math.ceil(Math.max(n.bitrate*.9,n.averageBitrate)/1e3)*1e3||1}function NOe(n){let e="";const{audio:t,video:r}=n;if(r){const s=dD(r.contentType);e+=`${s}_r${r.height}x${r.width}f${Math.ceil(r.framerate)}${r.transferFunction||"sd"}_${Math.ceil(r.bitrate/1e5)}`}if(t){const s=dD(t.contentType);e+=`${r?"_":""}${s}_c${t.channels}`}return e}const uD=["NONE","TYPE-0","TYPE-1",null];function _Oe(n){return uD.indexOf(n)>-1}const m1=["SDR","PQ","HLG"];function IOe(n){return!!n&&m1.indexOf(n)>-1}var kC={No:"",Yes:"YES",v2:"v2"};function F9(n){const{canSkipUntil:e,canSkipDateRanges:t,age:r}=n,s=r<e/2;return e&&s?t?kC.v2:kC.Yes:kC.No}class U9{constructor(e,t,r){this.msn=void 0,this.part=void 0,this.skip=void 0,this.msn=e,this.part=t,this.skip=r}addDirectives(e){const t=new self.URL(e);return this.msn!==void 0&&t.searchParams.set("_HLS_msn",this.msn.toString()),this.part!==void 0&&t.searchParams.set("_HLS_part",this.part.toString()),this.skip&&t.searchParams.set("_HLS_skip",this.skip),t.href}}class Vy{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(r=>!!r).map(r=>r.substring(0,4)).join(","),"supplemental"in e){var t;this.supplemental=e.supplemental;const r=(t=e.supplemental)==null?void 0:t.videoCodec;r&&r!==e.videoCodec&&(this.codecSet+=`,${r.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 V9(this._audioGroups,e)}hasSubtitleGroup(e){return V9(this._subtitleGroups,e)}get audioGroups(){return this._audioGroups}get subtitleGroups(){return this._subtitleGroups}addGroupId(e,t){if(t){if(e==="audio"){let r=this._audioGroups;r||(r=this._audioGroups=[]),r.indexOf(t)===-1&&r.push(t)}else if(e==="text"){let r=this._subtitleGroups;r||(r=this._subtitleGroups=[]),r.indexOf(t)===-1&&r.push(t)}}}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 V9(n,e){return!e||!n?!1:n.indexOf(e)!==-1}function DOe(){if(typeof matchMedia=="function"){const n=matchMedia("(dynamic-range: high)"),e=matchMedia("bad query");if(n.media!==e.media)return n.matches===!0}return!1}function jOe(n,e){let t=!1,r=[];if(n&&(t=n!=="SDR",r=[n]),e){r=e.allowedVideoRanges||m1.slice(0);const s=r.join("")!=="SDR"&&!e.videoCodec;t=e.preferHDR!==void 0?e.preferHDR:s&&DOe(),t||(r=["SDR"])}return{preferHDR:t,allowedVideoRanges:r}}const ROe=n=>{const e=new WeakSet;return(t,r)=>{if(n&&(r=n(t,r)),typeof r=="object"&&r!==null){if(e.has(r))return;e.add(r)}return r}},xr=(n,e)=>JSON.stringify(n,ROe(e));function POe(n,e,t,r,s){const a=Object.keys(n),o=r==null?void 0:r.channels,l=r==null?void 0:r.audioCodec,c=s==null?void 0:s.videoCodec,d=o&&parseInt(o)===2;let h=!1,m=!1,p=1/0,x=1/0,y=1/0,v=1/0,B=0,E=[];const{preferHDR:N,allowedVideoRanges:T}=jOe(e,s);for(let I=a.length;I--;){const D=n[a[I]];h||(h=D.channels[2]>0),p=Math.min(p,D.minHeight),x=Math.min(x,D.minFramerate),y=Math.min(y,D.minBitrate),T.filter(O=>D.videoRanges[O]>0).length>0&&(m=!0)}p=ct(p)?p:0,x=ct(x)?x:0;const k=Math.max(1080,p),P=Math.max(30,x);y=ct(y)?y:t,t=Math.max(y,t),m||(e=void 0);const R=a.length>1;return{codecSet:a.reduce((I,D)=>{const j=n[D];if(D===I)return I;if(E=m?T.filter(O=>j.videoRanges[O]>0):[],R){if(j.minBitrate>t)return oc(D,`min bitrate of ${j.minBitrate} > current estimate of ${t}`),I;if(!j.hasDefaultAudio)return oc(D,"no renditions with default or auto-select sound found"),I;if(l&&D.indexOf(l.substring(0,4))%5!==0)return oc(D,`audio codec preference "${l}" not found`),I;if(o&&!d){if(!j.channels[o])return oc(D,`no renditions with ${o} channel sound found (channels options: ${Object.keys(j.channels)})`),I}else if((!l||d)&&h&&j.channels[2]===0)return oc(D,"no renditions with stereo sound found"),I;if(j.minHeight>k)return oc(D,`min resolution of ${j.minHeight} > maximum of ${k}`),I;if(j.minFramerate>P)return oc(D,`min framerate of ${j.minFramerate} > maximum of ${P}`),I;if(!E.some(O=>j.videoRanges[O]>0))return oc(D,`no variants with VIDEO-RANGE of ${xr(E)} found`),I;if(c&&D.indexOf(c.substring(0,4))%5!==0)return oc(D,`video codec preference "${c}" not found`),I;if(j.maxScore<B)return oc(D,`max score of ${j.maxScore} < selected max of ${B}`),I}return I&&(h1(D)>=h1(I)||j.fragmentError>n[I].fragmentError)?I:(v=j.minIndex,B=j.maxScore,D)},void 0),videoRanges:E,preferHDR:N,minFramerate:x,minBitrate:y,minIndex:v}}function oc(n,e){Kn.log(`[abr] start candidates with "${n}" ignored because ${e}`)}function LZ(n){return n.reduce((e,t)=>
vendor: 3,305 bytes, line 4717
4717{let r=e.groups[t.groupId];r||(r=e.groups[t.groupId]={tracks:[],channels:{2:0},hasDefault:!1,hasAutoSelect:!1}),r.tracks.push(t);const s=t.channels||"2";return r.channels[s]=(r.channels[s]||0)+1,r.hasDefault=r.hasDefault||t.default,r.hasAutoSelect=r.hasAutoSelect||t.autoselect,r.hasDefault&&(e.hasDefaultAudio=!0),r.hasAutoSelect&&(e.hasAutoSelectAudio=!0),e},{hasDefaultAudio:!1,hasAutoSelectAudio:!1,groups:{}})}function LOe(n,e,t,r){return n.slice(t,r+1).reduce((s,a,o)=>{if(!a.codecSet)return s;const l=a.audioGroups;let c=s[a.codecSet];c||(s[a.codecSet]=c={minBitrate:1/0,minHeight:1/0,minFramerate:1/0,minIndex:o,maxScore:0,videoRanges:{SDR:0},channels:{2:0},hasDefaultAudio:!l,fragmentError:0}),c.minBitrate=Math.min(c.minBitrate,a.bitrate);const d=Math.min(a.height,a.width);return c.minHeight=Math.min(c.minHeight,d),c.minFramerate=Math.min(c.minFramerate,a.frameRate),c.minIndex=Math.min(c.minIndex,o),c.maxScore=Math.max(c.maxScore,a.score),c.fragmentError+=a.fragmentError,c.videoRanges[a.videoRange]=(c.videoRanges[a.videoRange]||0)+1,l&&l.forEach(h=>{if(!h)return;const m=e.groups[h];m&&(c.hasDefaultAudio=c.hasDefaultAudio||e.hasDefaultAudio?m.hasDefault:m.hasAutoSelect||!e.hasDefaultAudio&&!e.hasAutoSelectAudio,Object.keys(m.channels).forEach(p=>{c.channels[p]=(c.channels[p]||0)+m.channels[p]}))}),s},{})}function G9(n){if(!n)return n;const{lang:e,assocLang:t,characteristics:r,channels:s,audioCodec:a}=n;return{lang:e,assocLang:t,characteristics:r,channels:s,audioCodec:a}}function Ac(n,e,t){if("attrs"in n){const r=e.indexOf(n);if(r!==-1)return r}for(let r=0;r<e.length;r++){const s=e[r];if(bm(n,s,t))return r}return-1}function bm(n,e,t){const{groupId:r,name:s,lang:a,assocLang:o,default:l}=n,c=n.forced;return(r===void 0||e.groupId===r)&&(s===void 0||e.name===s)&&(a===void 0||OOe(a,e.lang))&&(a===void 0||e.assocLang===o)&&(l===void 0||e.default===l)&&(c===void 0||e.forced===c)&&(!("characteristics"in n)||MOe(n.characteristics||"",e.characteristics))&&(t===void 0||t(n,e))}function OOe(n,e="--"){return n.length===e.length?n===e:n.startsWith(e)||e.startsWith(n)}function MOe(n,e=""){const t=n.split(","),r=e.split(",");return t.length===r.length&&!t.some(s=>r.indexOf(s)===-1)}function Vf(n,e){const{audioCodec:t,channels:r}=n;return(t===void 0||(e.audioCodec||"").substring(0,4)===t.substring(0,4))&&(r===void 0||r===(e.channels||"2"))}function FOe(n,e,t,r,s){const a=e[r],l=e.reduce((p,x,y)=>{const v=x.uri;return(p[v]||(p[v]=[])).push(y),p},{})[a.uri];l.length>1&&(r=Math.max.apply(Math,l));const c=a.videoRange,d=a.frameRate,h=a.codecSet.substring(0,4),m=$9(e,r,p=>{if(p.videoRange!==c||p.frameRate!==d||p.codecSet.substring(0,4)!==h)return!1;const x=p.audioGroups,y=t.filter(v=>!x||x.indexOf(v.groupId)!==-1);return Ac(n,y,s)>-1});return m>-1?m:$9(e,r,p=>{const x=p.audioGroups,y=t.filter(v=>!x||x.indexOf(v.groupId)!==-1);return Ac(n,y,s)>-1})}function $9(n,e,t){for(let r=e;r>-1;r--)if(t(n[r]))return r;for(let r=e+1;r<n.length;r++)if(t(n[r]))return r;return-1}function p1(n,e){var t;return!!n&&n!==((t=e.loadLevelObj)==null?void 0:t.uri)}class UOe extends ul{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.co
vendor: 8,111 bytes, lines 4717-4727
4717decTiers=null,this.timer=-1,this.fragCurrent=null,this.partCurrent=null,this.bitrateTestDelay=0,this.rebufferNotice=-1,this.supportedCache={},this.bwEstimator=void 0,this._abandonRulesCheck=t=>{var r;const{fragCurrent:s,partCurrent:a,hls:o}=this,{autoLevelEnabled:l,media:c}=o;if(!s||!c)return;const d=performance.now(),h=a?a.stats:s.stats,m=a?a.duration:s.duration,p=d-h.loading.start,x=o.minAutoLevel,y=s.level,v=this._nextAutoLevel;if(h.aborted||h.loaded&&h.loaded===h.total||y<=x){this.clearTimer(),this._nextAutoLevel=-1;return}if(!l)return;const B=v>-1&&v!==y,E=!!t||B;if(!E&&(c.paused||!c.playbackRate||!c.readyState))return;const N=o.mainForwardBufferInfo;if(!E&&N===null)return;const T=this.bwEstimator.getEstimateTTFB(),k=Math.abs(c.playbackRate);if(p<=Math.max(T,1e3*(m/(k*2))))return;const P=N?N.len/k:0,R=h.loading.first?h.loading.first-h.loading.start:-1,_=h.loaded&&R>-1,I=this.getBwEstimate(),D=o.levels,j=D[y],O=Math.max(h.loaded,Math.round(m*(s.bitrate||j.averageBitrate)/8));let M=_?p-R:p;M<1&&_&&(M=Math.min(p,h.loaded*8/I));const U=_?h.loaded*1e3/M:0,ee=T/1e3,ie=U?(O-h.loaded)/U:O*8/I+ee;if(ie<=P)return;const G=U?U*8:I,Z=((r=(t==null?void 0:t.details)||this.hls.latestLevelDetails)==null?void 0:r.live)===!0,z=this.hls.config.abrBandWidthUpFactor;let se=Number.POSITIVE_INFINITY,re;for(re=y-1;re>x;re--){const W=D[re].maxBitrate,K=!D[re].details||Z;if(se=this.getTimeToLoadFrag(ee,G,m*W,K),se<Math.min(P,m+ee))break}if(se>=ie||se>m*10)return;_?this.bwEstimator.sample(p-Math.min(T,R),h.loaded):this.bwEstimator.sampleTTFB(p);const H=D[re].maxBitrate;this.getBwEstimate()*z>H&&this.resetEstimator(H);const Y=this.findBestLevel(H,x,re,0,P,1,1);Y>-1&&(re=Y),this.warn(`Fragment ${s.sn}${a?" part "+a.index:""} of level ${y} is loading too slowly;
4718      Fragment duration: ${s.duration.toFixed(3)}
4719      Time to underbuffer: ${P.toFixed(3)} s
4720      Estimated load time for current fragment: ${ie.toFixed(3)} s
4721      Estimated load time for down switch fragment: ${se.toFixed(3)} s
4722      TTFB estimate: ${R|0} ms
4723      Current BW estimate: ${ct(I)?I|0:"Unknown"} bps
4724      New BW estimate: ${this.getBwEstimate()|0} bps
4725      Switching to level ${re} @ ${H|0} bps`),o.nextLoadLevel=o.nextAutoLevel=re,this.clearTimer();const de=()=>{if(this.clearTimer(),this.fragCurrent===s&&this.hls.loadLevel===re&&re>0){const W=this.getStarvationDelay();if(this.warn(`Aborting inflight request ${re>0?"and switching down":""}
4726      Fragment duration: ${s.duration.toFixed(3)} s
4727      Time to underbuffer: ${W.toFixed(3)} s`),s.abortRequests(),this.fragCurrent=this.partCurrent=null,re>x){let K=this.findBestLevel(this.hls.levels[x].bitrate,x,re,0,W,1,1);K===-1&&(K=x),this.hls.nextLoadLevel=this.hls.nextAutoLevel=K,this.resetEstimator(this.hls.levels[K].bitrate)}}};B||ie>se*2?de():this.timer=self.setInterval(de,se*1e3),o.trigger(V.FRAG_LOAD_EMERGENCY_ABORTED,{frag:s,part:a,stats:h})},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 zLe(e.abrEwmaSlowVoD,e.abrEwmaFastVoD,e.abrEwmaDefaultEstimate)}registerListeners(){const{hls:e}=this;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.FRAG_LOADING,this.onFragLoading,this),e.on(V.FRAG_LOADED,this.onFragLoaded,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this),e.on(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e&&(e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.FRAG_LOADING,this.onFragLoading,this),e.off(V.FRAG_LOADED,this.onFragLoaded,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this),e.off(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.MAX_AUTO_LEVEL_UPDATED,this.onMaxAutoLevelUpdated,this),e.off(V.ERROR,this.onError,this))}destroy(){this.unregisterListeners(),this.clearTimer(),this.hls=this._abandonRulesCheck=this.supportedCache=null,this.fragCurrent=this.partCurrent=null}onManifestLoading(e,t){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,t){const r=t.frag;if(!this.ignoreFragment(r)){if(!r.bitrateTest){var s;this.fragCurrent=r,this.partCurrent=(s=t.part)!=null?s:null}this.clearTimer(),this.timer=self.setInterval(this._abandonRulesCheck,100)}}onLevelSwitching(e,t){this.clearTimer()}onError(e,t){if(!t.fatal)switch(t.details){case Ee.BUFFER_ADD_CODEC_ERROR:case Ee.BUFFER_APPEND_ERROR:this.lastLoadedFragLevel=-1,this.firstSelection=-1;break;case Ee.FRAG_LOAD_TIMEOUT:{const r=t.frag,{fragCurrent:s,partCurrent:a}=this;if(r&&s&&r.sn===s.sn&&r.level===s.level){const o=performance.now(),l=a?a.stats:r.stats,c=o-l.loading.start,d=l.loading.first?l.loading.first-l.loading.start:-1;if(l.loaded&&d>-1){const m=this.bwEstimator.getEstimateTTFB();this.bwEstimator.sample(c-Math.min(m,d),l.loaded)}else this.bwEstimator.sampleTTFB(c)}break}}}getTimeToLoadFrag(e,t,r,s){const a=e+r/t,o=s?e+this.lastLevelLoadSec:0;return a+o}onLevelLoaded(e,t){const r=this.hls.config,{loading:s}=t.stats,a=s.end-s.first;ct(a)&&(this.lastLevelLoadSec=a/1e3),t.details.live?this.bwEstimator.update(r.abrEwmaSlowLive,r.abrEwmaFastLive):this.bwEstimator.update(r.abrEwmaSlowVoD,r.abrEwmaFastVoD),this.timer>-1&&this._abandonRulesCheck(t.levelInfo)}onFragLoaded(e,{frag:t,part:r}){const s=r?r.stats:t.stats;if(t.type===mt.MAIN&&this.bwEstimator.sampleTTFB(s.loading.first-s.loading.start),!this.ignoreFragment(t)){if(this.clearTimer(),t.level===this._nextAutoLevel&&(this._nextAutoLevel=-1),this.firstSelection=-1,this.hls.config.abrMaxWithRealBitrate){const a=r?r.duration:t.duration,o=this.hls.levels[t.level],l=(o.loaded?o.loaded.bytes:0)+s.loaded,c=(o.loaded?o.loaded.duration:0)+a;o.loaded={bytes:l,duration:c},o.realBitrate=Math.round(8*l/c)}if(t.bitrateTest){const a={stats:s,frag:t,part:r,id:t.type};this.onFragBuffered(V.FRAG_BUFFERED,a),t.bitrateTest=!1}else this.lastLoadedFragLevel=t.level}}onFragBuffered(e,t){const{frag:r,part:s}=t,a=s!=null&&s.stats.loaded?s.stats:r.stats;if(a.aborted||this.ignoreFragment(r))return;const o=a.parsing.end-a.loading.start-Math.min(a.loading.first-a.loading.start,this.bwEstimator.getEstimateTTFB());this.bwEstimator.sample(o,a.loaded),a.bwEstimate=this.getBwEstimate(),r.bitrateTest?this.bitrateTestDelay=o/1e3:this.bitrateTestDelay=0}ignoreFragment(e){return e.type!==mt.MAIN||e.sn==="initSegment"}clearTimer(){this.timer>-1&&(self.clearInterval(this.timer),this.timer=-1)}get firstAutoLevel(){const{maxAutoLevel:e,minAutoLevel:t}=this.hls,r=this.getBwEstimate(),s=this.hls.config.maxStarvationDelay,a=this.findBestLevel(r,t,e,0,s,1,1);if(a>-1)return a;const o=this.hls.firstLevel,l=Math.min(Math.max(o,t),e);return this.warn(`Could not find best starting auto level. Defaulting to first in playlist ${o} clamped to ${l}`),l}get forcedAutoLevel(){return this.nextAutoLevelKey?-1:this._nextAutoLevel}get nextAutoLevel(){const e=this.forcedAutoLevel,r=this.bwEstimator.canEstimate(),s=this.lastLoadedFragLevel>-1;if(e!==-1&&(!r||!s||this.nextAutoLevelKey===this.getAutoLevelKey()))return e;const a=r&&s?this.getNextABRAutoLevel():this.firstAutoLevel;if(e!==-1){const o=this.hls.levels;if(o.length>Math.max(e,a)&&o[e].loadError<=o[a].loadError)return e}return this._nextAutoLevel=a,this.nextAutoLevelKey=this.getAutoLevelKey(),a}getAutoLevelKey(){return`${this.getBwEstimate()}
4727_${this.getStarvationDelay().toFixed(2)}`}getNextABRAutoLevel(){const{fragCurrent:e,partCurrent:t,hls:r}=this;if(r.levels.length<=1)return r.loadLevel;const{maxAutoLevel:s,config:a,minAutoLevel:o}=r,l=t?t.duration:e?e.duration:0,c=this.getBwEstimate(),d=this.getStarvationDelay();let h=a.abrBandWidthFactor,m=a.abrBandWidthUpFactor;if(d){const B=this.findBestLevel(c,o,s,d,0,h,m);if(B>=0)return this.rebufferNotice=-1,B}let p=l?Math.min(l,a.maxStarvationDelay):a.maxStarvationDelay;if(!d){const B=this.bitrateTestDelay;B&&(p=(l?Math.min(l,a.maxLoadingDelay):a.maxLoadingDelay)-B,this.info(`bitrate test took ${Math.round(1e3*B)}ms, set first fragment max fetchDuration to ${Math.round(1e3*p)} ms`),h=m=1)}const x=this.findBestLevel(c,o,s,d,p,h,m);if(this.rebufferNotice!==x&&(this.rebufferNotice=x,this.info(`${d?"rebuffering expected":"buffer is empty"}, optimal quality level ${x}`)),x>-1)return x;const y=r.levels[o],v=r.loadLevelObj;return v&&(y==null?void 0:y.bitrate)<v.bitrate?o:r.loadLevel}getStarvationDelay(){const e=this.hls,t=e.media;if(!t)return 1/0;const r=t&&t.playbackRate!==0?Math.abs(t.playbackRate):1,s=e.mainForwardBufferInfo;return(s?s.len:0)/r}getBwEstimate(){return this.bwEstimator.canEstimate()?this.bwEstimator.getEstimate():this.hls.config.abrEwmaDefaultEstimate}findBestLevel(e,t,r,s,a,o,l){var c;const d=s+a,h=this.lastLoadedFragLevel,m=h===-1?this.hls.firstLevel:h,{fragCurrent:p,partCurrent:x}=this,{levels:y,allAudioTracks:v,loadLevel:B,config:E}=this.hls;if(y.length===1)return 0;const N=y[m],T=!!((c=this.hls.latestLevelDetails)!=null&&c.live),k=B===-1||h===-1;let P,R="SDR",_=(N==null?void 0:N.frameRate)||0;const{audioPreference:I,videoPreference:D}=E,j=this.audioTracksByGroup||(this.audioTracksByGroup=LZ(v));let O=-1;if(k){if(this.firstSelection!==-1)return this.firstSelection;const G=this.codecTiers||(this.codecTiers=LOe(y,j,t,r)),Z=POe(G,R,e,I,D),{codecSet:z,videoRanges:se,minFramerate:re,minBitrate:H,minIndex:Y,preferHDR:de}=Z;O=Y,P=z,R=de?se[se.length-1]:se[0],_=re,e=Math.max(e,H),this.log(`picked start tier ${xr(Z)}`)}else P=N==null?void 0:N.codecSet,R=N==null?void 0:N.videoRange;const M=x?x.duration:p?p.duration:0,U=this.bwEstimator.getEstimateTTFB()/1e3,ee=[];for(let G=r;G>=t;G--){var ie;const Z=y[G],z=G>m;if(!Z)continue;if(E.useMediaCapabilities&&!Z.supportedResult&&!Z.supportedPromise){const K=navigator.mediaCapabilities;typeof(K==null?void 0:K.decodingInfo)=="function"&&SOe(Z,j,R,_,e,I)?(Z.supportedPromise=RZ(Z,j,K,this.supportedCache),Z.supportedPromise.then(J=>{if(!this.hls)return;Z.supportedResult=J;const oe=this.hls.levels,Ie=oe.indexOf(Z);J.error?this.warn(`MediaCapabilities decodingInfo error: "${J.error}" for level ${Ie} ${xr(J)}`):J.supported?J.decodingInfoResults.some(pe=>pe.smooth===!1||pe.powerEfficient===!1)&&this.log(`MediaCapabilities decodingInfo for level ${Ie} not smooth or powerEfficient: ${xr(J)}`):(this.warn(`Unsupported MediaCapabilities decodingInfo result for level ${Ie} ${xr(J)}`),Ie>-1&&oe.length>1&&(this.log(`Removing unsupported level ${Ie}`),this.hls.removeLevel(Ie),this.hls.loadLevel===-1&&(this.hls.nextLoadLevel=0)))}).catch(J=>{this.warn(`Error handling MediaCapabilities decodingInfo: ${J}`)})):Z.supportedResult=DZ}if((P&&Z.codecSet!==P||R&&Z.videoRange!==R||z&&_>Z.frameRate||!z&&_>0&&_<Z.frameRate||(ie=Z.supportedResult)!=null&&(ie=ie.decodingInfoResults)!=null&&ie.some(K=>K.smooth===!1))&&(!k||G!==O)){ee.push(G);continue}const se=Z.details,re=(x?se==null?void 0:se.partTarget:se==null?void 0:se.averagetargetduration)||M;let H;z?H=l*e:H=o*e;const Y=M&&s>=M*2&&a===0?Z.averageBitrate:Z.maxBitrate,de=this.getTimeToLoadFrag(U,H,Y*re,se===void 0);if(H>=Y&&(G===h||Z.loadError===0&&Z.fragmentError===0)&&(de<=U||!ct(de)||T&&!this.bitrateTestDelay||de<d)){const K=this.forcedAutoLevel;return G!==B&&(K===-1||K!==B)&&(ee.length&&this.trace(`Skipped level(s) ${ee.join(",")} of ${r} max with CODECS and VIDEO-RANGE:"${y[ee[0]].codecs}" ${y[ee[0]].videoRange}; not compatible with "${P}" ${R}`),this.info(`switch candidate:${m}->${G} adjustedbw(${Math.round(H)})-bitrate=${Math.round(H-Y)} ttfb:${U.toFixed(1)} avgDuration:${re.toFixed(1)} maxFetchDuration:${d.toFixed(1)} fetchDuration:${de.toFixed(1)}
4727 firstSelection:${k} codecSet:${Z.codecSet} videoRange:${Z.videoRange} hls.loadLevel:${B}`)),k&&(this.firstSelection=G),G}}return-1}set nextAutoLevel(e){const t=this.deriveNextAutoLevel(e);this._nextAutoLevel!==t&&(this.nextAutoLevelKey="",this._nextAutoLevel=t)}deriveNextAutoLevel(e){const{maxAutoLevel:t,minAutoLevel:r}=this.hls;return Math.min(Math.max(e,r),t)}}const OZ={search:function(n,e){let t=0,r=n.length-1,s=null,a=null;for(;t<=r;){s=(t+r)/2|0,a=n[s];const o=e(a);if(o>0)t=s+1;else if(o<0)r=s-1;else return a}return null}};function VOe(n,e,t){if(e===null||!Array.isArray(n)||!n.length||!ct(e))return null;const r=n[0].programDateTime;if(e<(r||0))return null;const s=n[n.length-1].endProgramDateTime;if(e>=(s||0))return null;for(let a=0;a<n.length;++a){const o=n[a];if($Oe(e,t,o))return o}return null}function $m(n,e,t=0,r=0,s=.005){let a=null;if(n){a=e[1+n.sn-e[0].sn]||null;const l=n.endDTS-t;l>0&&l<15e-7&&(t+=15e-7),a&&n.level!==a.level&&a.end<=n.end&&(a=e[2+n.sn-e[0].sn]||null)}else t===0&&e[0].start===0&&(a=e[0]);if(a&&((!n||n.level===a.level)&&H9(t,r,a)===0||GOe(a,n,Math.min(s,r))))return a;const o=OZ.search(e,H9.bind(null,t,r));return o&&(o!==n||!a)?o:a}function GOe(n,e,t){if(e&&e.start===0&&e.level<n.level&&(e.endPTS||0)>0){const r=e.tagList.reduce((s,a)=>(a[0]==="INF"&&(s+=parseFloat(a[1])),s),t);return n.start<=r}return!1}function H9(n=0,e=0,t){if(t.start<=n&&t.start+t.duration>n)return 0;const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0));return t.start+t.duration-r<=n?1:t.start-r>n&&t.start?-1:0}function $Oe(n,e,t){const r=Math.min(e,t.duration+(t.deltaPTS?t.deltaPTS:0))*1e3;return(t.endProgramDateTime||0)-r>n}function MZ(n,e,t){if(n&&n.startCC<=e&&n.endCC>=e){let r=n.fragments;const{fragmentHint:s}=n;s&&(r=r.concat(s));let a;return OZ.search(r,o=>o.cc<e?1:o.cc>e?-1:(a=o,o.end<=t?1:o.start>t?-1:0)),a||null}return null}function g1(n){switch(n.details){case Ee.FRAG_LOAD_TIMEOUT:case Ee.KEY_LOAD_TIMEOUT:case Ee.LEVEL_LOAD_TIMEOUT:case Ee.MANIFEST_LOAD_TIMEOUT:return!0}return!1}function FZ(n){return n.details.startsWith("key")}function UZ(n){return FZ(n)&&!!n.frag&&!n.frag.decryptdata}function z9(n,e){const t=g1(e);return n.default[`${t?"timeout":"error"}Retry`]}function GP(n,e){const t=n.backoff==="linear"?1:Math.pow(2,e);return Math.min(t*n.retryDelayMs,n.maxRetryDelayMs)}function q9(n){return zn(zn({},n),{errorRetry:null,timeoutRetry:null})}function x1(n,e,t,r){if(!n)return!1;const s=r==null?void 0:r.code,a=e<n.maxNumRetry&&(HOe(s)||!!t);return n.shouldRetry?n.shouldRetry(n,e,t,r,a):a}function HOe(n){return hD(n)||!!n&&(n<400||n>499)}function hD(n){return n===0&&navigator.onLine===!1}var Da={DoNothing:0,SendAlternateToPenaltyBox:2,RemoveAlternatePermanently:3,RetryRequest:5},fo={None:0,MoveAllAlternatesMatchingHost:1,MoveAllAlternatesMatchingHDCP:2,MoveAllAlternatesMatchingKey:4};class zOe extends ul{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(V.ERROR,this.onError,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this)}unregisterListeners(){const e=this.hls;e&&(e.off(V.ERROR,this.onError,this),e.off(V.ERROR,this.onErrorOut,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.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)===mt.MAIN?e.level:this.getVariantIndex()}getVariantIndex(){var e;const t=this.hls,r=t.currentLevel;return(e=t.loadLevelObj)!=null&&e.details||r===-1?t.loadLevel:r}variantHasKey(e,t){if(e){var r;if((r=e.details)!=null&&r.hasKey(t))return!0;const s=e.audioGroups;if(s)return this.hls.allAudioTracks.filter(o=>s.indexOf(o.groupId)>=0).some(o=>{var l;return(l=o.details)==null?void 0:l.hasKey(t)})}return!1}onManifestLoading(){this.playlistError=0}onLevelUpdated(){this.playlistError=0}onError(e,t){var r;if(t.fatal)return;const s=this.hls,a=t.context;switch(t.details){case Ee.FRAG_LOAD_ERROR:case Ee.FRAG_LOAD_TIMEOUT:case Ee.KEY_LOAD_ERROR:case Ee.KEY_LOAD_TIMEOUT:t.errorAction=this.getFragRetryOrSwitchAction(t);return;case Ee.FRAG_PARSING_ERROR:if((r=t.frag)!=null&&r.gap){t.errorAction=F0();return}case Ee.FRAG_GAP:case Ee.FRAG_DECRYPT_ERROR:{t.errorAction=this.getFragRetryOrSwitchAction(t),t.errorAction.action=Da.SendAlternateToPenaltyBox;return}case Ee.LEVEL_EMPTY_ERROR:case Ee.LEVEL_PARSING_ERROR:{var o;const c=t.parent===mt.MAIN?t.level:s.loadLevel;t.details===Ee.LEVEL_EMPTY_ERROR&&((o=t.context)!=null&&(o=o.levelDetails)!=null&&o.live)?t.errorAction=this.getPlaylistRetryOrSwitchAction(t,c):(t.levelRetry=!1,t.errorAction=this.getLevelSwitchAction(t,c))}return;case Ee.LEVEL_LOAD_ERROR:case Ee.LEVEL_LOAD_TIMEOUT:typeof(a==null?void 0:a.level)=="number"&&(t.errorAction=this.getPlaylistRetryOrSwitchAction(t,a.level));return;case Ee.AUDIO_TRACK_LOAD_ERROR:case Ee.AUDIO_TRACK_LOAD_TIMEOUT:case Ee.SUBTITLE_LOAD_ERROR:case Ee.SUBTITLE_TRACK_LOAD_TIMEOUT:if(a){const c=s.loadLevelObj;if(c&&(a.type===Xt.AUDIO_TRACK&&c.hasAudioGroup(a.groupId)||a.type===Xt.SUBTITLE_TRACK&&c.hasSubtitleGroup(a.groupId))){t.errorAction=this.getPlaylistRetryOrSwitchAction(t,s.loadLevel),t.errorAction.action=Da.SendAlternateToPenaltyBox,t.errorAction.flags=fo.MoveAllAlternatesMatchingHost;return}}return;
vendor: 11,471 bytes, line 4727
4727case Ee.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:t.errorAction={action:Da.SendAlternateToPenaltyBox,flags:fo.MoveAllAlternatesMatchingHDCP};return;case Ee.KEY_SYSTEM_SESSION_UPDATE_FAILED:case Ee.KEY_SYSTEM_STATUS_INTERNAL_ERROR:case Ee.KEY_SYSTEM_NO_SESSION:t.errorAction={action:Da.SendAlternateToPenaltyBox,flags:fo.MoveAllAlternatesMatchingKey};return;case Ee.BUFFER_ADD_CODEC_ERROR:case Ee.REMUX_ALLOC_ERROR:case Ee.BUFFER_APPEND_ERROR:if(!t.errorAction){var l;t.errorAction=this.getLevelSwitchAction(t,(l=t.level)!=null?l:s.loadLevel)}return;case Ee.INTERNAL_EXCEPTION:case Ee.BUFFER_APPENDING_ERROR:case Ee.BUFFER_FULL_ERROR:case Ee.LEVEL_SWITCH_ERROR:case Ee.BUFFER_STALLED_ERROR:case Ee.BUFFER_SEEK_OVER_HOLE:case Ee.BUFFER_NUDGE_ON_STALL:t.errorAction=F0();return}t.type===Bt.KEY_SYSTEM_ERROR&&(t.levelRetry=!1,t.errorAction=F0())}getPlaylistRetryOrSwitchAction(e,t){const r=this.hls,s=z9(r.config.playlistLoadPolicy,e),a=this.playlistError++;if(x1(s,a,g1(e),e.response))return{action:Da.RetryRequest,flags:fo.None,retryConfig:s,retryCount:a};const l=this.getLevelSwitchAction(e,t);return s&&(l.retryConfig=s,l.retryCount=a),l}getFragRetryOrSwitchAction(e){const t=this.hls,r=this.getVariantLevelIndex(e.frag),s=t.levels[r],{fragLoadPolicy:a,keyLoadPolicy:o}=t.config,l=z9(FZ(e)?o:a,e),c=t.levels.reduce((h,m)=>h+m.fragmentError,0);if(s&&(e.details!==Ee.FRAG_GAP&&s.fragmentError++,!UZ(e)&&x1(l,c,g1(e),e.response)))return{action:Da.RetryRequest,flags:fo.None,retryConfig:l,retryCount:c};const d=this.getLevelSwitchAction(e,r);return l&&(d.retryConfig=l,d.retryCount=c),d}getLevelSwitchAction(e,t){const r=this.hls;t==null&&(t=r.loadLevel);const s=this.hls.levels[t];if(s){var a,o;const d=e.details;s.loadError++,d===Ee.BUFFER_APPEND_ERROR&&s.fragmentError++;let h=-1;const{levels:m,loadLevel:p,minAutoLevel:x,maxAutoLevel:y}=r;!r.autoLevelEnabled&&!r.config.preserveManualLevelOnError&&(r.loadLevel=-1);const v=(a=e.frag)==null?void 0:a.type,E=(v===mt.AUDIO&&d===Ee.FRAG_PARSING_ERROR||e.sourceBufferName==="audio"&&(d===Ee.BUFFER_ADD_CODEC_ERROR||d===Ee.BUFFER_APPEND_ERROR))&&m.some(({audioCodec:R})=>s.audioCodec!==R),T=e.sourceBufferName==="video"&&(d===Ee.BUFFER_ADD_CODEC_ERROR||d===Ee.BUFFER_APPEND_ERROR)&&m.some(({codecSet:R,audioCodec:_})=>s.codecSet!==R&&s.audioCodec===_),{type:k,groupId:P}=(o=e.context)!=null?o:{};for(let R=m.length;R--;){const _=(R+p)%m.length;if(_!==p&&_>=x&&_<=y&&m[_].loadError===0){var l,c;const I=m[_];if(d===Ee.FRAG_GAP&&v===mt.MAIN&&e.frag){const D=m[_].details;if(D){const j=$m(e.frag,D.fragments,e.frag.start);if(j!=null&&j.gap)continue}}else{if(k===Xt.AUDIO_TRACK&&I.hasAudioGroup(P)||k===Xt.SUBTITLE_TRACK&&I.hasSubtitleGroup(P))continue;if(v===mt.AUDIO&&(l=s.audioGroups)!=null&&l.some(D=>I.hasAudioGroup(D))||v===mt.SUBTITLE&&(c=s.subtitleGroups)!=null&&c.some(D=>I.hasSubtitleGroup(D))||E&&s.audioCodec===I.audioCodec||T&&s.codecSet===I.codecSet||!E&&s.codecSet!==I.codecSet)continue}h=_;break}}if(h>-1&&r.loadLevel!==h)return e.levelRetry=!0,this.playlistError=0,{action:Da.SendAlternateToPenaltyBox,flags:fo.None,nextAutoLevel:h}}return{action:Da.SendAlternateToPenaltyBox,flags:fo.MoveAllAlternatesMatchingHost}}onErrorOut(e,t){var r;switch((r=t.errorAction)==null?void 0:r.action){case Da.DoNothing:break;case Da.SendAlternateToPenaltyBox:this.sendAlternateToPenaltyBox(t),!t.errorAction.resolved&&t.details!==Ee.FRAG_GAP?t.fatal=!0:/MediaSource readyState: ended/.test(t.error.message)&&(this.warn(`MediaSource ended after "${t.sourceBufferName}" sourceBuffer append error. Attempting to recover from media error.`),this.hls.recoverMediaError());break}if(t.fatal){this.hls.stopLoad();return}}sendAlternateToPenaltyBox(e){const t=this.hls,r=e.errorAction;if(!r)return;const{flags:s}=r,a=r.nextAutoLevel;switch(s){case fo.None:this.switchLevel(e,a);break;case fo.MoveAllAlternatesMatchingHDCP:{const c=this.getVariantLevelIndex(e.frag),d=t.levels[c],h=d==null?void 0:d.attrs["HDCP-LEVEL"];if(r.hdcpLevel=h,h==="NONE")this.warn("HDCP policy resticted output with HDCP-LEVEL=NONE");else if(h){t.maxHdcpLevel=uD[uD.indexOf(h)-1],r.resolved=!0,this.warn(`Restricting playback to HDCP-LEVEL of "${t.maxHdcpLevel}" or lower`);break}}case fo.MoveAllAlternatesMatchingKey:{const c=e.decryptdata;if(c){const d=this.hls.levels,h=d.length;for(let p=h;p--;)if(this.variantHasKey(d[p],c)){var o,l;this.log(`Banned key found in level ${p} (${d[p].bitrate}bps) or audio group "${(o=d[p].audioGroups)==null?void 0:o.join(",")}" (${(l=e.frag)==null?void 0:l.type} fragment) ${Ra(c.keyId||[])}`),d[p].fragmentError++,d[p].loadError++,this.log(`Removing level ${p} with key error (${e.error})`),this.hls.removeLevel(p)}const m=e.frag;if(this.hls.levels.length<h)r.resolved=!0;else if(m&&m.type!==mt.MAIN){const p=m.decryptdata;p&&!c.matches(p)&&(r.resolved=!0)}}break}}r.resolved||this.switchLevel(e,a)}switchLevel(e,t){if(t!==void 0&&e.errorAction&&(this.warn(`switching to level ${t} after ${e.details}`),this.hls.nextAutoLevel=t,e.errorAction.resolved=!0,this.hls.nextLoadLevel=this.hls.nextAutoLevel,e.details===Ee.BUFFER_ADD_CODEC_ERROR&&e.mimeType&&e.sourceBufferName!=="audiovideo")){const r=dD(e.mimeType),s=this.hls.levels;for(let a=s.length;a--;)s[a][`${e.sourceBufferName}Codec`]===r&&(this.log(`Removing level ${a} for ${e.details} ("${r}" not supported)`),this.hls.removeLevel(a))}}}function F0(n){const e={action:Da.DoNothing,flags:fo.None};return n&&(e.resolved=!0),e}var Ks={NOT_LOADED:"NOT_LOADED",APPENDING:"APPENDING",PARTIAL:"PARTIAL",OK:"OK"};class qOe{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(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.BUFFER_APPENDED,this.onBufferAppended,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this),e.on(V.FRAG_LOADED,this.onFragLoaded,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.BUFFER_APPENDED,this.onBufferAppended,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this),e.off(V.FRAG_LOADED,this.onFragLoaded,this))}destroy(){this._unregisterListeners(),this.hls=this.fragments=this.activePartLists=this.endListFragments=this.timeRanges=null}getAppendedFrag(e,t){const r=this.activePartLists[t];if(r)for(let s=r.length;s--;){const a=r[s];if(!a)break;if(a.start<=e&&e<=a.end&&a.loaded)return a}return this.getBufferedFrag(e,t)}getBufferedFrag(e,t){return this.getFragAtPos(e,t,!0)}getFragAtPos(e,t,r){const{fragments:s}=this,a=Object.keys(s);for(let o=a.length;o--;){const l=s[a[o]];if((l==null?void 0:l.body.type)===t&&(!r||l.buffered)){const c=l.body;if(c.start<=e&&e<=c.end)return c}}return null}detectEvictedFragments(e,t,r,s,a){this.timeRanges&&(this.timeRanges[e]=t);const o=(s==null?void 0:s.fragment.sn)||-1;Object.keys(this.fragments).forEach(l=>{const c=this.fragments[l];if(!c||o>=c.body.sn)return;if(!c.buffered&&(!c.loaded||a)){c.body.type===r&&this.removeFragment(c.body);return}const d=c.range[e];if(d){if(d.time.length===0){this.removeFragment(c.body);return}d.time.some(h=>{const m=!this.isTimeBuffered(h.startPTS,h.endPTS,t);return m&&this.removeFragment(c.body),m})}})}detectPartialFragments(e){const t=this.timeRanges;if(!t||e.frag.sn==="initSegment")return;const r=e.frag,s=Zp(r),a=this.fragments[s];if(!a||a.buffered&&r.gap)return;const o=!r.relurl;Object.keys(t).forEach(l=>{const c=r.elementaryStreams[l];if(!c)return;const d=t[l],h=o||c.partial===!0;a.range[l]=this.getBufferedTimes(r,e.part,h,d)}),a.loaded=null,Object.keys(a.range).length?(this.bufferedEnd(a,r),Pw(a)||this.removeParts(r.sn-1,r.type)):this.removeFragment(a.body)}bufferedEnd(e,t){e.buffered=!0,(e.body.endList=t.endList||e.body.endList)&&(this.endListFragments[e.body.type]=e)}removeParts(e,t){const r=this.activePartLists[t];r&&(this.activePartLists[t]=K9(r,s=>s.fragment.sn>=e))}fragBuffered(e,t){const r=Zp(e);let s=this.fragments[r];!s&&t&&(s=this.fragments[r]={body:e,appendedPTS:null,loaded:null,buffered:!1,range:Object.create(null)},e.gap&&(this.hasGaps=!0)),s&&(s.loaded=null,this.bufferedEnd(s,e))}getBufferedTimes(e,t,r,s){const a={time:[],partial:r},o=e.start,l=e.end,c=e.minEndPTS||l,d=e.maxStartPTS||o;for(let h=0;h<s.length;h++){const m=s.start(h)-this.bufferPadding,p=s.end(h)+this.bufferPadding;if(d>=m&&c<=p){a.time.push({startPTS:Math.max(o,s.start(h)),endPTS:Math.min(l,s.end(h))});break}else if(o<p&&l>m){const x=Math.max(o,s.start(h)),y=Math.min(l,s.end(h));y>x&&(a.partial=!0,a.time.push({startPTS:x,endPTS:y}))}else if(l<=m)break}return a}getPartialFragment(e){let t=null,r,s,a,o=0;const{bufferPadding:l,fragments:c}=this;return Object.keys(c).forEach(d=>{const h=c[d];h&&Pw(h)&&(s=h.body.start-l,a=h.body.end+l,e>=s&&e<=a&&(r=Math.min(e-s,a-e),o<=r&&(t=h.body,o=r)))}),t}isEndListAppended(e){const t=this.endListFragments[e];return t!==void 0&&(t.buffered||Pw(t))}getState(e){const t=Zp(e),r=this.fragments[t];return r?r.buffered?Pw(r)?Ks.PARTIAL:Ks.OK:Ks.APPENDING:Ks.NOT_LOADED}isTimeBuffered(e,t,r){let s,a;for(let o=0;o<r.length;o++){if(s=r.start(o)-this.bufferPadding,a=r.end(o)+this.bufferPadding,e>=s&&t<=a)return!0;if(t<=s)return!1}return!1}onManifestLoading(){this.removeAllFragments()}onFragLoaded(e,t){if(t.frag.sn==="initSegment"||t.frag.bitrateTest)return;const r=t.frag,s=t.part?null:t,a=Zp(r);this.fragments[a]={body:r,appendedPTS:null,loaded:s,buffered:!1,range:Object.create(null)}}onBufferAppended(e,t){const{frag:r,part:s,timeRanges:a,type:o}=t;if(r.sn==="initSegment")return;const l=r.type;if(s){let d=this.activePartLists[l];d||(this.activePartLists[l]=d=[]),d.push(s)}this.timeRanges=a;const c=a[o];this.detectEvictedFragments(o,c,l,s)}onFragBuffered(e,t){this.detectPartialFragments(t)}hasFragment(e){const t=Zp(e);return!!this.fragments[t]}hasFragments(e){const{fragments:t}=this,r=Object.keys(t);if(!e)return r.length>0;for(let s=r.length;s--;){const a=t[r[s]];if((a==null?void 0:a.body.type)===e)return!0}return!1}hasParts(e){var t;return!!((t=this.activePartLists[e])!=null&&t.length)}removeFragmentsInRange(e,t,r,s,a){s&&!this.hasGaps||Object.keys(this.fragments).forEach(o=>{const l=this.fragments[o];if(!l)return;const c=l.body;c.type!==r||s&&!c.gap||c.start<t&&c.end>e&&(l.buffered||a)&&this.removeFragment(c)})}removeFragment(e){const t=Zp(e);e.clearElementaryStreamInfo();const r=this.activePartLists[e.type];if(r){const s=e.sn;this.activePartLists[e.type]=K9(r,a=>a.fragment.sn!==s)}delete this.fragments[t],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 t=(e=this.hls)==null||(e=e.latestLevelDetails)==null?void 0:e.partList;t&&t.forEach(r=>r.clearElementaryStreamInfo())}}function Pw(n){var e,t,r;return n.buffered&&!!(n.body.gap||(e=n.range.video)!=null&&e.partial||(t=n.range.audio)!=null&&t.partial||(r=n.range.audiovideo)!=null&&r.partial)}function Zp(n){return`${n.type}_${n.level}_${n.sn}`}function K9(n,e){return n.filter(t=>{const r=e(t);return r||t.clearElementaryStreamInfo(),r})}var $h={cbc:0,ctr:1};class KOe{constructor(e,t,r){this.subtle=void 0,this.aesIV=void 0,this.aesMode=void 0,this.subtle=e,this.aesIV=t,this.aesMode=r}decrypt(e,t){switch(this.aesMode){case $h.cbc:return this.subtle.decrypt({
vendor: 19,673 bytes, line 4727
4727name:"AES-CBC",iv:this.aesIV},t,e);case $h.ctr:return this.subtle.decrypt({name:"AES-CTR",counter:this.aesIV,length:64},t,e);default:throw new Error(`[AESCrypto] invalid aes mode ${this.aesMode}`)}}}function WOe(n){const e=n.byteLength,t=e&&new DataView(n.buffer).getUint8(e-1);return t?n.slice(0,e-t):n}class YOe{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 t=new DataView(e),r=new Uint32Array(4);for(let s=0;s<4;s++)r[s]=t.getUint32(s*4);return r}initTable(){const e=this.sBox,t=this.invSBox,r=this.subMix,s=r[0],a=r[1],o=r[2],l=r[3],c=this.invSubMix,d=c[0],h=c[1],m=c[2],p=c[3],x=new Uint32Array(256);let y=0,v=0,B=0;for(B=0;B<256;B++)B<128?x[B]=B<<1:x[B]=B<<1^283;for(B=0;B<256;B++){let E=v^v<<1^v<<2^v<<3^v<<4;E=E>>>8^E&255^99,e[y]=E,t[E]=y;const N=x[y],T=x[N],k=x[T];let P=x[E]*257^E*16843008;s[y]=P<<24|P>>>8,a[y]=P<<16|P>>>16,o[y]=P<<8|P>>>24,l[y]=P,P=k*16843009^T*65537^N*257^y*16843008,d[E]=P<<24|P>>>8,h[E]=P<<16|P>>>16,m[E]=P<<8|P>>>24,p[E]=P,y?(y=N^x[x[x[k^N]]],v^=x[x[v]]):y=v=1}}expandKey(e){const t=this.uint8ArrayToUint32Array_(e);let r=!0,s=0;for(;s<t.length&&r;)r=t[s]===this.key[s],s++;if(r)return;this.key=t;const a=this.keySize=t.length;if(a!==4&&a!==6&&a!==8)throw new Error("Invalid aes key size="+a);const o=this.ksRows=(a+6+1)*4;let l,c;const d=this.keySchedule=new Uint32Array(o),h=this.invKeySchedule=new Uint32Array(o),m=this.sBox,p=this.rcon,x=this.invSubMix,y=x[0],v=x[1],B=x[2],E=x[3];let N,T;for(l=0;l<o;l++){if(l<a){N=d[l]=t[l];continue}T=N,l%a===0?(T=T<<8|T>>>24,T=m[T>>>24]<<24|m[T>>>16&255]<<16|m[T>>>8&255]<<8|m[T&255],T^=p[l/a|0]<<24):a>6&&l%a===4&&(T=m[T>>>24]<<24|m[T>>>16&255]<<16|m[T>>>8&255]<<8|m[T&255]),d[l]=N=(d[l-a]^T)>>>0}for(c=0;c<o;c++)l=o-c,c&3?T=d[l]:T=d[l-4],c<4||l<=4?h[c]=T:h[c]=y[m[T>>>24]]^v[m[T>>>16&255]]^B[m[T>>>8&255]]^E[m[T&255]],h[c]=h[c]>>>0}networkToHostOrderSwap(e){return e<<24|(e&65280)<<8|(e&16711680)>>8|e>>>24}decrypt(e,t,r){const s=this.keySize+6,a=this.invKeySchedule,o=this.invSBox,l=this.invSubMix,c=l[0],d=l[1],h=l[2],m=l[3],p=this.uint8ArrayToUint32Array_(r);let x=p[0],y=p[1],v=p[2],B=p[3];const E=new Int32Array(e),N=new Int32Array(E.length);let T,k,P,R,_,I,D,j,O,M,U,ee,ie,G;const Z=this.networkToHostOrderSwap;for(;t<E.length;){for(O=Z(E[t]),M=Z(E[t+1]),U=Z(E[t+2]),ee=Z(E[t+3]),_=O^a[0],I=ee^a[1],D=U^a[2],j=M^a[3],ie=4,G=1;G<s;G++)T=c[_>>>24]^d[I>>16&255]^h[D>>8&255]^m[j&255]^a[ie],k=c[I>>>24]^d[D>>16&255]^h[j>>8&255]^m[_&255]^a[ie+1],P=c[D>>>24]^d[j>>16&255]^h[_>>8&255]^m[I&255]^a[ie+2],R=c[j>>>24]^d[_>>16&255]^h[I>>8&255]^m[D&255]^a[ie+3],_=T,I=k,D=P,j=R,ie=ie+4;T=o[_>>>24]<<24^o[I>>16&255]<<16^o[D>>8&255]<<8^o[j&255]^a[ie],k=o[I>>>24]<<24^o[D>>16&255]<<16^o[j>>8&255]<<8^o[_&255]^a[ie+1],P=o[D>>>24]<<24^o[j>>16&255]<<16^o[_>>8&255]<<8^o[I&255]^a[ie+2],R=o[j>>>24]<<24^o[_>>16&255]<<16^o[I>>8&255]<<8^o[D&255]^a[ie+3],N[t]=Z(T^x),N[t+1]=Z(R^y),N[t+2]=Z(P^v),N[t+3]=Z(k^B),x=O,y=M,v=U,B=ee,t=t+4}return N.buffer}}class QOe{constructor(e,t,r){this.subtle=void 0,this.key=void 0,this.aesMode=void 0,this.subtle=e,this.key=t,this.aesMode=r}expandKey(){const e=JOe(this.aesMode);return this.subtle.importKey("raw",this.key,{name:e},!1,["encrypt","decrypt"])}}function JOe(n){switch(n){case $h.cbc:return"AES-CBC";case $h.ctr:return"AES-CTR";default:throw new Error(`[FastAESKey] invalid aes mode ${n}`)}}const XOe=16;class $P{constructor(e,{removePKCS7Padding:t=!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=t,t)try{const r=self.crypto;r&&(this.subtle=r.subtle||r.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:t}=this;if(!e||t)return this.reset(),null;const r=new Uint8Array(e);return this.reset(),this.removePKCS7Padding?WOe(r):r}reset(){this.currentResult=null,this.currentIV=null,this.remainderData=null,this.softwareDecrypter&&(this.softwareDecrypter=null)}decrypt(e,t,r,s){return this.useSoftware?new Promise((a,o)=>{const l=ArrayBuffer.isView(e)?e:new Uint8Array(e);this.softwareDecrypt(l,t,r,s);const c=this.flush();c?a(c.buffer):o(new Error("[softwareDecrypt] Failed to decrypt data"))}):this.webCryptoDecrypt(new Uint8Array(e),t,r,s)}softwareDecrypt(e,t,r,s){const{currentIV:a,currentResult:o,remainderData:l}=this;if(s!==$h.cbc||t.byteLength!==16)return Kn.warn("SoftwareDecrypt: can only handle AES-128-CBC"),null;this.logOnce("JS AES decrypt"),l&&(e=ol(l,e),this.remainderData=null);const c=this.getValidChunk(e);if(!c.length)return null;a&&(r=a);let d=this.softwareDecrypter;d||(d=this.softwareDecrypter=new YOe),d.expandKey(t);const h=o;return this.currentResult=d.decrypt(c.buffer,0,r),this.currentIV=c.slice(-16).buffer,h||null}webCryptoDecrypt(e,t,r,s){if(this.key!==t||!this.fastAesKey){if(!this.subtle)return Promise.resolve(this.onWebCryptoError(e,t,r,s));this.key=t,this.fastAesKey=new QOe(this.subtle,t,s)}return this.fastAesKey.expandKey().then(a=>this.subtle?(this.logOnce("WebCrypto AES decrypt"),new KOe(this.subtle,new Uint8Array(r),s).decrypt(e.buffer,a)):Promise.reject(new Error("web crypto not initialized"))).catch(a=>(Kn.warn(`[decrypter]: WebCrypto Error, disable WebCrypto API, ${a.name}: ${a.message}`),this.onWebCryptoError(e,t,r,s)))}onWebCryptoError(e,t,r,s){const a=this.enableSoftwareAES;if(a){this.useSoftware=!0,this.logEnabled=!0,this.softwareDecrypt(e,t,r,s);const o=this.flush();if(o)return o.buffer}throw new Error("WebCrypto"+(a?" and softwareDecrypt":"")+": failed to decrypt data")}getValidChunk(e){let t=e;const r=e.length-e.length%XOe;return r!==e.length&&(t=e.slice(0,r),this.remainderData=e.slice(r)),t}logOnce(e){this.logEnabled&&(Kn.log(`[decrypter]: ${e}`),this.logEnabled=!1)}}const W9=Math.pow(2,17);class ZOe{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,t){const r=e.url;if(!r)return Promise.reject(new vd({type:Bt.NETWORK_ERROR,details:Ee.FRAG_LOAD_ERROR,fatal:!1,frag:e,error:new Error(`Fragment does not have a ${r?"part list":"url"}`),networkDetails:null}));this.abort();const s=this.config,a=s.fLoader,o=s.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap)if(e.tagList.some(y=>y[0]==="GAP")){c(Q9(e));return}else e.gap=!1;const d=this.loader=a?new a(s):new o(s),h=Y9(e);e.loader=d;const m=q9(s.fragLoadPolicy.default),p={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:e.sn==="initSegment"?1/0:W9};e.stats=d.stats;const x={onSuccess:(y,v,B,E)=>{this.resetLoader(e,d);let N=y.data;B.resetIV&&e.decryptdata&&(e.decryptdata.iv=new Uint8Array(N.slice(0,16)),N=N.slice(16)),l({frag:e,part:null,payload:N,networkDetails:E})},onError:(y,v,B,E)=>{this.resetLoader(e,d),c(new vd({type:Bt.NETWORK_ERROR,details:Ee.FRAG_LOAD_ERROR,fatal:!1,frag:e,response:zn({url:r,data:void 0},y),error:new Error(`HTTP Error ${y.code} ${y.text}`),networkDetails:B,stats:E}))},onAbort:(y,v,B)=>{this.resetLoader(e,d),c(new vd({type:Bt.NETWORK_ERROR,details:Ee.INTERNAL_ABORTED,fatal:!1,frag:e,error:new Error("Aborted"),networkDetails:B,stats:y}))},onTimeout:(y,v,B)=>{this.resetLoader(e,d),c(new vd({type:Bt.NETWORK_ERROR,details:Ee.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,error:new Error(`Timeout after ${p.timeout}ms`),networkDetails:B,stats:y}))}};t&&(x.onProgress=(y,v,B,E)=>t({frag:e,part:null,payload:B,networkDetails:E})),d.load(h,p,x)})}loadPart(e,t,r){this.abort();const s=this.config,a=s.fLoader,o=s.loader;return new Promise((l,c)=>{if(this.loader&&this.loader.destroy(),e.gap||t.gap){c(Q9(e,t));return}const d=this.loader=a?new a(s):new o(s),h=Y9(e,t);e.loader=d;const m=q9(s.fragLoadPolicy.default),p={loadPolicy:m,timeout:m.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0,highWaterMark:W9};t.stats=d.stats,d.load(h,p,{onSuccess:(x,y,v,B)=>{this.resetLoader(e,d),this.updateStatsFromPart(e,t);const E={frag:e,part:t,payload:x.data,networkDetails:B};r(E),l(E)},onError:(x,y,v,B)=>{this.resetLoader(e,d),c(new vd({type:Bt.NETWORK_ERROR,details:Ee.FRAG_LOAD_ERROR,fatal:!1,frag:e,part:t,response:zn({url:h.url,data:void 0},x),error:new Error(`HTTP Error ${x.code} ${x.text}`),networkDetails:v,stats:B}))},onAbort:(x,y,v)=>{e.stats.aborted=t.stats.aborted,this.resetLoader(e,d),c(new vd({type:Bt.NETWORK_ERROR,details:Ee.INTERNAL_ABORTED,fatal:!1,frag:e,part:t,error:new Error("Aborted"),networkDetails:v,stats:x}))},onTimeout:(x,y,v)=>{this.resetLoader(e,d),c(new vd({type:Bt.NETWORK_ERROR,details:Ee.FRAG_LOAD_TIMEOUT,fatal:!1,frag:e,part:t,error:new Error(`Timeout after ${p.timeout}ms`),networkDetails:v,stats:x}))}})})}updateStatsFromPart(e,t){const r=e.stats,s=t.stats,a=s.total;if(r.loaded+=s.loaded,a){const c=Math.round(e.duration/t.duration),d=Math.min(Math.round(r.loaded/a),c),m=(c-d)*Math.round(r.loaded/d);r.total=r.loaded+m}else r.total=Math.max(r.loaded,r.total);const o=r.loading,l=s.loading;o.start?o.first+=l.first-l.start:(o.start=l.start,o.first=l.first),o.end=l.end}resetLoader(e,t){e.loader=null,this.loader===t&&(self.clearTimeout(this.partLoadTimeout),this.loader=null),t.destroy()}}function Y9(n,e=null){const t=e||n,r={frag:n,part:e,responseType:"arraybuffer",url:t.url,headers:{},rangeStart:0,rangeEnd:0},s=t.byteRangeStartOffset,a=t.byteRangeEndOffset;if(ct(s)&&ct(a)){var o;let l=s,c=a;if(n.sn==="initSegment"&&eMe((o=n.decryptdata)==null?void 0:o.method)){const d=a-s;d%16&&(c=a+(16-d%16)),s!==0&&(r.resetIV=!0,l=s-16)}r.rangeStart=l,r.rangeEnd=c}return r}function Q9(n,e){const t=new Error(`GAP ${n.gap?"tag":"attribute"} found`),r={type:Bt.MEDIA_ERROR,details:Ee.FRAG_GAP,fatal:!1,frag:n,error:t,networkDetails:null};return e&&(r.part=e),(e||n).stats.aborted=!0,new vd(r)}function eMe(n){return n==="AES-128"||n==="AES-256"}class vd extends Error{constructor(e){super(e.error.message),this.data=void 0,this.data=e}}class VZ extends ul{constructor(e,t){super(e,t),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 HP{constructor(e,t,r,s=0,a=-1,o=!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=Lw(),this.buffering={audio:Lw(),video:Lw(),audiovideo:Lw()},this.level=e,this.sn=t,this.id=r,this.size=s,this.part=a,this.partial=o}}function Lw(){return{start:0,executeStart:0,executeEnd:0,end:0}}const J9={length:0,start:()=>0,end:()=>0};class Vt{static isBuffered(e,t){if(e){const r=Vt.getBuffered(e);for(let s=r.length;s--;)if(t>=r.start(s)&&t<=r.end(s))return!0}return!1}static bufferedRanges(e){if(e){const t=Vt.getBuffered(e);return Vt.timeRangesToArray(t)}return[]}static timeRangesToArray(e){const t=[];for(let r=0;r<e.length;r++)t.push({start:e.start(r),end:e.end(r)});return t}static bufferInfo(e,t,r){if(e){const s=Vt.bufferedRanges(e);if(s.length)return Vt.bufferedInfo(s,t,r)}return{len:0,start:t,end:t,bufferedIndex:-1}}static bufferedInfo(e,t,r){t=Math.max(0,t),e.length>1&&e.sort((h,m)=>h.start-m.start||m.end-h.end);let s=-1,a=[];if(r)for(let h=0;h<e.length;h++){t>=e[h].start&&t<=e[h].end&&(s=h);const m=a.length;if(m){const p=a[m-1].end;e[h].start-p<r?e[h].end>p&&(a[m-1].end=e[h].end):a.push(e[h])}else a.push(e[h])}else a=e;let o=0,l,c=t,d=t;for(let h=0;h<a.length;h++){const m=a[h].start,p=a[h].end;if(s===-1&&t>=m&&t<=p&&(s=h),t+r>=m&&t<p)c=m,d=p,o=d-t;else if(t+r<m){l=m;break}}return{len:o,start:c||0,end:d||0,nextStart:l,buffered:e,bufferedIndex:s}}static getBuffered(e){try{return e.buffered||J9}catch(t){return Kn.log("failed to get media.buffered",t),J9}}}const GZ=/\{\$([a-zA-Z0-9-_]+)\}/g;function X9(n){return GZ.test(n)}function fD(n,e){if(n.variableList!==null||n.hasVariableRefs){const t=n.variableList;return e.replace(GZ,r=>{const s=r.substring(2,r.length-1),a=t==null?void 0:t[s];return a===void 0?(n.playlistParsingError||(n.playlistParsingError=new Error(`Missing preceding EXT-X-DEFINE tag for Variable Reference: "${s}"`)),r):a})}return e}function Z9(n,e,t){let r=n.variableList;r||(n.variableList=r={});let s,a;if("QUERYPARAM"in e){s=e.QUERYPARAM;try{const o=new self.URL(t).searchParams;if(o.has(s))a=o.get(s);else throw new Error(`"${s}" does not match any query parameter in URI: "${t}"`)}catch(o){n.playlistParsingError||(n.playlistParsingError=new Error(`EXT-X-DEFINE QUERYPARAM: ${o.message}`))}}else s=e.NAME,a=e.VALUE;s in r?n.playlistParsingError||(n.playlistParsingError=new Error(`EXT-X-DEFINE duplicate Variable Name declarations: "${s}"`)):r[s]=a||""}function tMe(n,e,t){const r=e.IMPORT;if(t&&r in t){let s=n.variableList;s||(n.variableList=s={}),s[r]=t[r]}else n.playlistParsingError||(n.playlistParsingError=new Error(`EXT-X-DEFINE IMPORT attribute not found in Multivariant Playlist: "${r}"`))}const nMe=/^(\d+)x(\d+)$/,eG=/(.+?)=(".*?"|.*?)(?:,|$)/g;class Qr{constructor(e,t){typeof e=="string"&&(e=Qr.parseAttrList(e,t)),sr(this,e)}get clientAttrs(){return Object.keys(this).filter(e=>e.substring(0,2)==="X-")}decimalInteger(e){const t=parseInt(this[e],10);return t>Number.MAX_SAFE_INTEGER?1/0:t}hexadecimalInteger(e){if(this[e]){let t=(this[e]||"0x").slice(2);t=(t.length&1?"0":"")+t;const r=new Uint8Array(t.length/2);for(let s=0;s<t.length/2;s++)r[s]=parseInt(t.slice(s*2,s*2+2),16);return r}return null}hexadecimalIntegerAsNumber(e){const t=parseInt(this[e],16);return t>Number.MAX_SAFE_INTEGER?1/0:t}decimalFloatingPoint(e){return parseFloat(this[e])}optionalFloat(e,t){const r=this[e];return r?parseFloat(r):t}enumeratedString(e){return this[e]}enumeratedStringList(e,t){const r=this[e];return(r?r.split(/[ ,]+/):[]).reduce((s,a)=>(s[a.toLowerCase()]=!0,s),t)}bool(e){return this[e]==="YES"}decimalResolution(e){const t=nMe.exec(this[e]);if(t!==null)return{width:parseInt(t[1],10),height:parseInt(t[2],10)}}static parseAttrList(e,t){let r;const s={};for(eG.lastIndex=0;(r=eG.exec(e))!==null;){const o=r[1].trim();let l=r[2];const c=l.indexOf('"')===0&&l.lastIndexOf('"')===l.length-1;let d=!1;if(c)l=l.slice(1,-1);else switch(o){case"IV":case"SCTE35-CMD":case"SCTE35-IN":case"SCTE35-OUT":d=!0}if(t&&(c||d))l=fD(t,l);else if(!d&&!c)switch(o){case"CLOSED-CAPTIONS":if(l==="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":Kn.warn(`${e}: attribute ${o} is missing quotes`)}s[o]=l}return s}}const rMe="com.apple.hls.interstitial";function sMe(n){return n!=="ID"&&n!=="CLASS"&&n!=="CUE"&&n!=="START-DATE"&&n!=="DURATION"&&n!=="END-DATE"&&n!=="END-ON-NEXT"}function aMe(n){return n==="SCTE35-OUT"||n==="SCTE35-IN"||n==="SCTE35-CMD"}class $Z{constructor(e,t,r=0){var s;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=(t==null?void 0:t.tagAnchor)||null,this.tagOrder=(s=t==null?void 0:t.tagOrder)!=null?s:r,t){const a=t.attr;for(const o in a)if(Object.prototype.hasOwnProperty.call(e,o)&&e[o]!==a[o]){Kn.warn(`DATERANGE tag attribute: "${o}" does not match for tags with ID: "${e.ID}"`),this._badValueForSameId=o;break}e=sr(new Qr({}),a,e)}if(this.attr=e,t?(this._startDate=t._startDate,this._cue=t._cue,this._endDate=t._endDate,this._dateAtEnd=t._dateAtEnd):this._startDate=new Date(e["START-DATE"]),"END-DATE"in this.attr){const a=(t==null?void 0:t.endDate)||new Date(this.attr["END-DATE"]);ct(a.getTime())&&(this._endDate=a)}}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?(Kn.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 t=this.duration;return t!==null?this._dateAtEnd=new Date(this._startDate.getTime()+t*1e3):null}get duration(){if("DURATION"in this.attr){const e=this.attr.decimalFloatingPoint("DURATION");if(ct(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===rMe}get isValid(){return!!this.id&&!this._badValueForSameId&&ct(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 iMe=10;class oMe{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.drift
vendor: 19,383 bytes, line 4727
4727StartTime=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 t=this.lastPartSn-e.lastPartSn,r=this.lastPartIndex-e.lastPartIndex;this.updated=this.endSN!==e.endSN||!!r||!!t||!this.live,this.advanced=this.endSN>e.endSN||t>0||t===0&&r>0,this.updated||this.advanced?this.misses=Math.floor(e.misses*.6):this.misses=e.misses+1}hasKey(e){return this.encryptedFragments.some(t=>{let r=t.decryptdata;return r||(t.setKeyFormat(e.keyFormat),r=t.decryptdata),!!r&&e.matches(r)})}get hasProgramDateTime(){return this.fragments.length?ct(this.fragments[this.fragments.length-1].programDateTime):!1}get levelTargetDuration(){return this.averagetargetduration||this.targetduration||iMe}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 t=this.lastPartIndex;if(t!==-1){for(let r=e.length;r--;)if(e[r].index>t)return e[r].index;return t}}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 b1(n,e){return n.length===e.length?!n.some((t,r)=>t!==e[r]):!1}function tG(n,e){return!n&&!e?!0:!n||!e?!1:b1(n,e)}function U0(n){return n==="AES-128"||n==="AES-256"||n==="AES-256-CTR"}function zP(n){switch(n){case"AES-128":case"AES-256":return $h.cbc;case"AES-256-CTR":return $h.ctr;default:throw new Error(`invalid full segment method ${n}`)}}function qP(n){return Uint8Array.from(atob(n),e=>e.charCodeAt(0))}function mD(n){return Uint8Array.from(unescape(encodeURIComponent(n)),e=>e.charCodeAt(0))}function lMe(n){const e=mD(n).subarray(0,16),t=new Uint8Array(16);return t.set(e,16-e.length),t}function HZ(n){const e=function(r,s,a){const o=r[s];r[s]=r[a],r[a]=o};e(n,0,3),e(n,1,2),e(n,4,5),e(n,6,7)}function zZ(n){const e=n.split(":");let t=null;if(e[0]==="data"&&e.length===2){const r=e[1].split(";"),s=r[r.length-1].split(",");if(s.length===2){const a=s[0]==="base64",o=s[1];a?(r.splice(-1,1),t=qP(o)):t=lMe(o)}}return t}const y1=typeof self<"u"?self:void 0;var Jr={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.fps",PLAYREADY:"com.microsoft.playready",WIDEVINE:"com.widevine.alpha"},Pa={CLEARKEY:"org.w3.clearkey",FAIRPLAY:"com.apple.streamingkeydelivery",PLAYREADY:"com.microsoft.playready",WIDEVINE:"urn:uuid:edef8ba9-79d6-4ace-a3c8-27dcd51d21ed"};function NC(n){switch(n){case Pa.FAIRPLAY:return Jr.FAIRPLAY;case Pa.PLAYREADY:return Jr.PLAYREADY;case Pa.WIDEVINE:return Jr.WIDEVINE;case Pa.CLEARKEY:return Jr.CLEARKEY}}function LN(n){switch(n){case Jr.FAIRPLAY:return Pa.FAIRPLAY;case Jr.PLAYREADY:return Pa.PLAYREADY;case Jr.WIDEVINE:return Pa.WIDEVINE;case Jr.CLEARKEY:return Pa.CLEARKEY}}function kb(n){const{drmSystems:e,widevineLicenseUrl:t}=n,r=e?[Jr.FAIRPLAY,Jr.WIDEVINE,Jr.PLAYREADY,Jr.CLEARKEY].filter(s=>!!e[s]):[];return!r[Jr.WIDEVINE]&&t&&r.push(Jr.WIDEVINE),r}const qZ=(function(n){return y1!=null&&(n=y1.navigator)!=null&&n.requestMediaKeySystemAccess?self.navigator.requestMediaKeySystemAccess.bind(self.navigator):null})();function cMe(n,e,t,r){let s;switch(n){case Jr.FAIRPLAY:s=["cenc","sinf"];break;case Jr.WIDEVINE:case Jr.PLAYREADY:s=["cenc"];break;case Jr.CLEARKEY:s=["cenc","keyids"];break;default:throw new Error(`Unknown key-system: ${n}`)}return dMe(s,e,t,r)}function dMe(n,e,t,r){return[{initDataTypes:n,persistentState:r.persistentState||"optional",distinctiveIdentifier:r.distinctiveIdentifier||"optional",sessionTypes:r.sessionTypes||[r.sessionType||"temporary"],audioCapabilities:e.map(a=>({contentType:`audio/mp4; codecs=${a}`,robustness:r.audioRobustness||"",encryptionScheme:r.audioEncryptionScheme||null})),videoCapabilities:t.map(a=>({contentType:`video/mp4; codecs=${a}`,robustness:r.videoRobustness||"",encryptionScheme:r.videoEncryptionScheme||null}))}]}function uMe(n){var e;return!!n&&(n.sessionType==="persistent-license"||!!((e=n.sessionTypes)!=null&&e.some(t=>t==="persistent-license")))}function KZ(n){const e=new Uint16Array(n.buffer,n.byteOffset,n.byteLength/2),t=String.fromCharCode.apply(null,Array.from(e)),r=t.substring(t.indexOf("<"),t.length),o=new DOMParser().parseFromString(r,"text/xml").getElementsByTagName("KID")[0];if(o){const l=o.childNodes[0]?o.childNodes[0].nodeValue:o.getAttribute("VALUE");if(l){const c=qP(l).subarray(0,16);return HZ(c),c}}return null}let e0={};class Sh{static clearKeyUriToKeyIdMap(){e0={}}static setKeyIdForUri(e,t){e0[e]=t}static addKeyIdForUri(e){const t=Object.keys(e0).length%Number.MAX_SAFE_INTEGER,r=new Uint8Array(16);return new DataView(r.buffer,12,4).setUint32(0,t),e0[e]=r,r}constructor(e,t,r,s=[1],a=null,o){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=t,this.keyFormat=r,this.keyFormatVersions=s,this.iv=a,this.encrypted=e?e!=="NONE":!1,this.isCommonEncryption=this.encrypted&&!U0(e),o!=null&&o.startsWith("0x")&&(this.keyId=new Uint8Array(BZ(o)))}matches(e){return e.uri===this.uri&&e.method===this.method&&e.encrypted===this.encrypted&&e.keyFormat===this.keyFormat&&b1(e.keyFormatVersions,this.keyFormatVersions)&&tG(e.iv,this.iv)&&tG(e.keyId,this.keyId)}isSupported(){if(this.method){if(U0(this.method)||this.method==="NONE")return!0;if(this.keyFormat==="identity")return this.method==="SAMPLE-AES";switch(this.keyFormat){case Pa.FAIRPLAY:case Pa.WIDEVINE:case Pa.PLAYREADY:case Pa.CLEARKEY:return["SAMPLE-AES","SAMPLE-AES-CENC","SAMPLE-AES-CTR"].indexOf(this.method)!==-1}}return!1}getDecryptData(e,t){if(!this.encrypted||!this.uri)return null;if(U0(this.method)){let a=this.iv;return a||(typeof e!="number"&&(Kn.warn(`missing IV for initialization segment with method="${this.method}" - compliance issue`),e=0),a=fMe(e)),new Sh(this.method,this.uri,"identity",this.keyFormatVersions,a)}if(this.keyId){const a=e0[this.uri];if(a&&!b1(this.keyId,a)&&Sh.setKeyIdForUri(this.uri,this.keyId),this.pssh)return this}const r=zZ(this.uri);if(r)switch(this.keyFormat){case Pa.WIDEVINE:if(this.pssh=r,!this.keyId){const a=gOe(r.buffer);if(a.length){var s;const o=a[0];this.keyId=(s=o.kids)!=null&&s.length?o.kids[0]:null}}this.keyId||(this.keyId=nG(t));break;case Pa.PLAYREADY:{const a=new Uint8Array([154,4,240,121,152,64,66,134,171,146,230,91,224,136,95,149]);this.pssh=pOe(a,null,r),this.keyId=KZ(r);break}default:{let a=r.subarray(0,16);if(a.length!==16){const o=new Uint8Array(16);o.set(a,16-a.length),a=o}this.keyId=a;break}}if(!this.keyId||this.keyId.byteLength!==16){let a;a=hMe(t),a||(a=nG(t),a||(a=e0[this.uri])),a&&(this.keyId=a,Sh.setKeyIdForUri(this.uri,a))}return this}}function hMe(n){const e=n==null?void 0:n[Pa.WIDEVINE];return e?e.keyId:null}function nG(n){const e=n==null?void 0:n[Pa.PLAYREADY];if(e){const t=zZ(e.uri);if(t)return KZ(t)}return null}function fMe(n){const e=new Uint8Array(16);for(let t=12;t<16;t++)e[t]=n>>8*(15-t)&255;return e}const rG=/#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,sG=/#EXT-X-MEDIA:(.*)/g,mMe=/^#EXT(?:INF|-X-TARGETDURATION):/m,ON=new RegExp([/#EXTINF:\s*(\d*(?:\.\d+)?)(?:,(.*)\s+)?/.source,/(?!#) *(\S[^\r\n]*)/.source,/#.*/.source].join("|"),"g"),pMe=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 kc{static findGroup(e,t){for(let r=0;r<e.length;r++){const s=e[r];if(s.id===t)return s}}static resolve(e,t){return OP.buildAbsoluteURL(t,e,{alwaysNormalize:!0})}static isMediaPlaylist(e){return mMe.test(e)}static parseMasterPlaylist(e,t){const r=X9(e),s={contentSteering:null,levels:[],playlistParsingError:null,sessionData:null,sessionKeys:null,startTimeOffset:null,variableList:null,hasVariableRefs:r},a=[];if(rG.lastIndex=0,!e.startsWith("#EXTM3U"))return s.playlistParsingError=new Error("no EXTM3U delimiter"),s;let o;for(;(o=rG.exec(e))!=null;)if(o[1]){var l;const d=new Qr(o[1],s),h=fD(s,o[2]),m={attrs:d,bitrate:d.decimalInteger("BANDWIDTH")||d.decimalInteger("AVERAGE-BANDWIDTH"),name:d.NAME,url:kc.resolve(h,t)},p=d.decimalResolution("RESOLUTION");p&&(m.width=p.width,m.height=p.height),oG(d.CODECS,m);const x=d["SUPPLEMENTAL-CODECS"];x&&(m.supplemental={},oG(x,m.supplemental)),(l=m.unknownCodecs)!=null&&l.length||a.push(m),s.levels.push(m)}else if(o[3]){const d=o[3],h=o[4];switch(d){case"SESSION-DATA":{const m=new Qr(h,s),p=m["DATA-ID"];p&&(s.sessionData===null&&(s.sessionData={}),s.sessionData[p]=m);break}case"SESSION-KEY":{const m=aG(h,t,s);m.encrypted&&m.isSupported()?(s.sessionKeys===null&&(s.sessionKeys=[]),s.sessionKeys.push(m)):Kn.warn(`[Keys] Ignoring invalid EXT-X-SESSION-KEY tag: "${h}"`);break}case"DEFINE":{{const m=new Qr(h,s);Z9(s,m,t)}break}case"CONTENT-STEERING":{const m=new Qr(h,s);s.contentSteering={uri:kc.resolve(m["SERVER-URI"],t),pathwayId:m["PATHWAY-ID"]||"."};break}case"START":{s.startTimeOffset=iG(h);break}}}const c=a.length>0&&a.length<s.levels.length;return s.levels=c?a:s.levels,s.levels.length===0&&(s.playlistParsingError=new Error("no levels found in manifest")),s}static parseMasterPlaylistMedia(e,t,r){let s;const a={},o=r.levels,l={AUDIO:o.map(d=>({id:d.attrs.AUDIO,audioCodec:d.audioCodec})),SUBTITLES:o.map(d=>({id:d.attrs.SUBTITLES,textCodec:d.textCodec})),"CLOSED-CAPTIONS":[]};let c=0;for(sG.lastIndex=0;(s=sG.exec(e))!==null;){const d=new Qr(s[1],r),h=d.TYPE;if(h){const m=l[h],p=a[h]||[];a[h]=p;const x=d.LANGUAGE,y=d["ASSOC-LANGUAGE"],v=d.CHANNELS,B=d.CHARACTERISTICS,E=d["INSTREAM-ID"],N={attrs:d,bitrate:0,id:c++,groupId:d["GROUP-ID"]||"",name:d.NAME||x||"",type:h,default:d.bool("DEFAULT"),autoselect:d.bool("AUTOSELECT"),forced:d.bool("FORCED"),lang:x,url:d.URI?kc.resolve(d.URI,t):""};if(y&&(N.assocLang=y),v&&(N.channels=v),B&&(N.characteristics=B),E&&(N.instreamId=E),m!=null&&m.length){const T=kc.findGroup(m,N.groupId)||m[0];lG(N,T,"audioCodec"),lG(N,T,"textCodec")}p.push(N)}}return a}static parseLevelPlaylist(e,t,r,s,a,o){var l;const c={url:t},d=new oMe(t),h=d.fragments,m=[];let p=null,x=0,y=0,v=0,B=0,E=0,N=null,T=new jN(s,c),k,P,R,_=-1,I=!1,D=null,j;if(ON.lastIndex=0,d.m3u8=e,d.hasVariableRefs=X9(e),((l=ON.exec(e))==null?void 0:l[0])!=="#EXTM3U")return d.playlistParsingError=new Error("Missing format identifier #EXTM3U"),d;for(;(k=ON.exec(e))!==null;){I&&(I=!1,T=new jN(s,c),T.playlistOffset=v,T.setStart(v),T.sn=x,T.cc=B,E&&(T.bitrate=E),T.level=r,p&&(T.initSegment=p,p.rawProgramDateTime&&(T.rawProgramDateTime=p.rawProgramDateTime,p.rawProgramDateTime=null),D&&(T.setByteRange(D),D=null)));const ee=k[1];if(ee){T.duration=parseFloat(ee);const ie=(" "+k[2]).slice(1);T.title=ie||null,T.tagList.push(ie?["INF",ee,ie]:["INF",ee])}else if(k[3]){if(ct(T.duration)){T.playlistOffset=v,T.setStart(v),R&&dG(T,R,d),T.sn=x,T.level=r,T.cc=B,h.push(T);const ie=(" "+k[3]).slice(1);T.relurl=fD(d,ie),pD(T,N,m),N=T,v+=T.duration,x++,y=0,I=!0}}else{if(k=k[0].match(pMe),!k){Kn.warn("No matches on slow regex match for level playlist!");continue}for(P=1;P<k.length&&k[P]===void 0;P++);const ie=(" "+k[P]).slice(1),G=(" "+k[P+1]).slice(1),Z=k[P+2]?(" "+k[P+2]).slice(1):null;switch(ie){case"BYTERANGE":N?T.setByteRange(G,N):T.setByteRange(G);break;case"PROGRAM-DATE-TIME":T.rawProgramDateTime=G,T.tagList.push(["PROGRAM-DATE-TIME",G]),_===-1&&(_=h.length);break;case"PLAYLIST-TYPE":d.type&&pd(d,ie,k),d.type=G.toUpperCase();break;case"MEDIA-SEQUENCE":d.startSN!==0?pd(d,ie,k):h.length>0&&uG(d,ie,k),x=d.startSN=parseInt(G);break;case"SKIP":{d.skippedSegments&&pd(d,ie,k);const z=new Qr(G,d),se=z.decimalInteger("SKIPPED-SEGMENTS");if(ct(se)){d.skippedSegments+=se;for(let H=se;H--;)h.push(null);x+=se}const re=z.enumeratedString("RECENTLY-REMOVED-DATERANGES");re&&(d.recentlyRemovedDateranges=(d.recentlyRemovedDateranges||[]).concat(re.split("	")));break}case"TARGETDURATION":d.targetduration!==0&&pd(d,ie,k),d.targetduration=Math.max(parseInt(G),1);break;case"VERSION":d.version!==null&&pd(d,ie,k),d.version=parseInt(G);break;case"INDEPENDENT-SEGMENTS":break;case"ENDLIST":d.live||pd(d,ie,k),d.live=!1;break;case"#":(G||Z)&&T.tagList.push(Z?[G,Z]:[G]);break;case"DISCONTINUITY":B++,T.tagList.push(["DIS"]);break;case"GAP":T.gap=!0,T.tagList.push([ie]);break;case"BITRATE":T.tagList.push([ie,G]),E=parseInt(G)*1e3,ct(E)?T.bitrate=E:E=0;break;case"DATERANGE":{const z=new Qr(G,d),se=new $Z(z,d.dateRanges[z.ID],d.dateRangeTagCount);d.dateRangeTagCount++,se.isValid||d.skippedSegments?d.dateRanges[se.id]=se:Kn.warn(`Ignoring invalid DATERANGE tag: "${G}"`),T.tagList.push(["EXT-X-DATERANGE",G]);break}case"DEFINE":{{const z=new Qr(G,d);"IMPORT"in z?tMe(d,z,o):Z9(d,z,t)}break}case"DISCONTINUITY-SEQUENCE":d.startCC!==0?pd(d,ie,k):h.length>0&&uG(d,ie,k),d.startCC=B=parseInt(G);break;case"KEY":{const z=aG(G,t,d);if(z.isSupported()){if(z.method==="NONE"){R=void 0;break}R||(R={});const se=R[z.keyFormat];se!=null&&se.matches(z)||(se&&(R=sr({},R)),R[z.keyFormat]=z)}else Kn.warn(`[Keys] Ignoring unsupported EXT-X-KEY tag: "${G}"`);break}case"START":d.startTimeOffset=iG(G);break;case"MAP":{const z=new Qr(G,d);if(T.duration){const se=new jN(s,c);cG(se,z,r,R),p=se,T.initSegment=p,p.rawProgramDateTime&&!T.rawProgramDateTime&&(T.rawProgramDateTime=p.rawProgramDateTime)}else{const se=T.byteRangeEndOffset;if(se){const re=T.byteRangeStartOffset;D=`${se-re}@${re}`}else D=null;cG(T,z,r,R),p=T,I=!0}p.cc=B;break}case"SERVER-CONTROL":{j&&pd(d,ie,k),j=new Qr(G),d.canBlockReload=j.bool("CAN-BLOCK-RELOAD"),d.canSkipUntil=j.optionalFloat("CAN-SKIP-UNTIL",0),d.canSkipDateRanges=d.canSkipUntil>0&&j.bool("CAN-SKIP-DATERANGES"),d.partHoldBack=j.optionalFloat("PART-HOLD-BACK",0),d.holdBack=j.optionalFloat("HOLD-BACK",0);break}case"PART-INF":{d.partTarget&&pd(d,ie,k);const z=new Qr(G);d.partTarget=z.decimalFloatingPoint("PART-TARGET");break}case"PART":{let z=d.partList;z||(z=d.partList=[]);const se=y>0?z[z.length-1]:void 0,re=y++,H=new Qr(G,d),Y=new tOe(H,T,c,re,se);z.push(Y),T.duration+=Y.duration;break}case"PRELOAD-HINT":{const z=new Qr(G,d);d.preloadHint=z;break}case"RENDITION-REPORT":{const z=new Qr(G,d);d.renditionReports=d.renditionReports||[],d.renditionReports.push(z);break}default:Kn.warn(`line parsed but not handled: ${k}`);break}}}N&&!N.relurl?(h.pop(),v-=N.duration,d.partList&&(d.fragmentHint=N)):d.partList&&(pD(T,N,m),T.cc=B,d.fragmentHint=T,R&&dG(T,R,d)),d.targetduration||(d.playlistParsingError=new Error("Missing Target Duration"));const O=h.length,M=h[0],U=h[O-1];if(v+=d.skippedSegments*d.targetduration,v>0&&O&&U){d.averagetargetduration=v/O;const ee=U.sn;d.endSN=ee!=="initSegment"?ee:0,d.live||(U.endList=!0),_>0&&(xMe(h,_),M&&m.unshift(M))}return d.fragmentHint&&(v+=d.fragmentHint.duration),d.totalduration=v,m.length&&d.dateRangeTagCount&&M&&WZ(m,d),d.endCC=B,d}}function WZ(n,e){let t=n.length;if(!t)if(e.hasProgramDateTime){const l=e.fragments[e.fragments.length-1];n.push(l),t++}else return;const r=n[t-1],s=e.live?1/0:e.totalduration,a=Object.keys(e.dateRanges);for(let l=a.length;l--;){const c=e.dateRanges[a[l]],d=c.startDate.getTime();c.tagAnchor=r.ref;for(let h=t;h--;){var o;if(((o=n[h])==null?void 0:o.sn)<e.startSN)break;const m=gMe(e,d,n,h,s);if(m!==-1){c.tagAnchor=e.fragments[m].ref;break}}}}function gMe(n,e,t,r,s){const a=t[r];if(a){const l=a.programDateTime;if(e>=l||r===0){var o;const c=(((o=t[r+1])==null?void 0:o.start)||s)-a.start;if(e<=l+c*1e3){const d=t[r].sn-n.startSN;if(d<0)return-1;const h=n.fragments;if(h.length>t.length){const p=(t[r+1]||h[h.length-1]).sn-n.startSN;for(let x=p;x>d;x--){const y=h[x].programDateTime;if(e>=y&&e<y+h[x].duration*1e3)return x}}return d}}}return-1}function aG(n,e,t){var r,s;const a=new Qr(n,t),o=(r=a.METHOD)!=null?r:"",l=a.URI,c=a.hexadecimalInteger("IV"),d=a.KEYFORMATVERSIONS,h=(s=a.KEYFORMAT)!=null?s:"identity";l&&a.IV&&!c&&Kn.error(`Invalid IV: ${a.IV}`);const m=l?kc.resolve(l,e):"",p=(d||"1").split("/").map(Number).filter(Number.isFinite);return new Sh(o,m,h,p,c,a.KEYID)}function iG(n){const t=new Qr(n).decimalFloatingPoint("TIME-OFFSET");return ct(t)?t:null}function oG(n,e){let t=(n||"").split(/[ ,]+/).filter(r=>r);["video","audio","text"].forEach(r=>{const s=t.filter(a=>UP(a,r));s.length&&(e[`${r}Codec`]=s.map(a=>a.split("/")[0]).join(","),t=t.filter(a=>s.indexOf(a)===-1))}),e.unknownCodecs=t}function lG(n,e,t){const r=e[t];r&&(n[t]=r)}function xMe(n,e){let t=n[e];for(let r=e;r--;){const s=n[r];if(!s)return;s.programDateTime=t.programDateTime-s.duration*1e3,t=s}}function pD(n,e,t){n.rawProgramDateTime?t.push(n):e!=null&&e.programDateTime&&(n.programDateTime=e.endProgramDateTime)}function cG(n,e,t,r){n.relurl=e.URI,e.BYTERANGE&&n.setByteRange(e.BYTERANGE),n.level=t,n.sn="initSegment",r&&(n.levelkeys=r),n.initSegment=null}function dG(n,e,t){n.levelkeys=e;const{encryptedFragments:r}=t;(!r.length||r[r.length-1].levelkeys!==e)&&Object.keys(e).some(s=>e[s].isCommonEncryption)&&r.push(n)}function pd(n,e,t){n.playlistParsingError=new Error(`#EXT-X-${e} must not appear more than once (${t[0]})`)}function uG(n,e,t){n.playlistParsingError=new Error(`#EXT-X-${e} must appear before the first Media Segment (${t[0]})`)}function MN(n,e){const t=e.startPTS;if(ct(t)){let r=0,s;e.sn>n.sn?(r=t-n.start,s=n):(r=n.start-t,s=e),s.duration!==r&&s.setDuration(r)}else e.sn>n.sn?n.cc===e.cc&&n.minEndPTS?e.setStart(n.start+(n.minEndPTS-n.start)):e.setStart(n.start+n.duration):e.setStart(Math.max(n.start-e.duration,0))}function YZ(n,e,t,r,s,a,o){r-t<=0&&(o.warn("Fragment should have a positive duration",e),r=t+e.duration,a=s+e.duration);let c=t,d=r;const h=e.startPTS,m=e.endPTS;if(ct(h)){const E=Math.abs(h-t);n&&E>n.totalduration?o.warn(`media timestamps and playlist times differ by ${E}s for level ${e.level} ${n.url}`):ct(e.deltaPTS)?e.deltaPTS=Math.max(E,e.deltaPTS):e.deltaPTS=E,c=Math.max(t,h),t=Math.min(t,h),s=e.startDTS!==void 0?Math.min(s,e.startDTS):s,d=Math.min(r,m),r=Math.max(r,m),a=e.endDTS!==void 0?Math.max(a,e.endDTS):a}const p=t-e.start;e.start!==0&&e.setStart(t),e.setDuration(r-e.start),e.startPTS=t,e.maxStartPTS=c,e.startDTS=s,e.endPTS=r,e.minEndPTS=d,e.endDTS=a;const x=e.sn;if(!n||x<n.startSN||x>n.endSN)return 0;let y;
vendor: 1,294 bytes, line 4727
4727const v=x-n.startSN,B=n.fragments;for(B[v]=e,y=v;y>0;y--)MN(B[y],B[y-1]);for(y=v;y<B.length-1;y++)MN(B[y],B[y+1]);return n.fragmentHint&&MN(B[B.length-1],n.fragmentHint),n.PTSKnown=n.alignedSliding=!0,p}function bMe(n,e,t){if(n===e)return;let r=null;const s=n.fragments;for(let h=s.length-1;h>=0;h--){const m=s[h].initSegment;if(m){r=m;break}}n.fragmentHint&&delete n.fragmentHint.endPTS;let a;BMe(n,e,(h,m,p,x)=>{if((!e.startCC||e.skippedSegments)&&m.cc!==h.cc){const y=h.cc-m.cc;for(let v=p;v<x.length;v++)x[v].cc+=y;e.endCC=x[x.length-1].cc}ct(h.startPTS)&&ct(h.endPTS)&&(m.setStart(m.startPTS=h.startPTS),m.startDTS=h.startDTS,m.maxStartPTS=h.maxStartPTS,m.endPTS=h.endPTS,m.endDTS=h.endDTS,m.minEndPTS=h.minEndPTS,m.setDuration(h.endPTS-h.startPTS),m.duration&&(a=m),e.PTSKnown=e.alignedSliding=!0),h.hasStreams&&(m.elementaryStreams=h.elementaryStreams),m.loader=h.loader,h.hasStats&&(m.stats=h.stats),h.initSegment&&(m.initSegment=h.initSegment,r=h.initSegment)});const o=e.fragments,l=e.fragmentHint?o.concat(e.fragmentHint):o;if(r&&l.forEach(h=>{var m;h&&(!h.initSegment||h.initSegment.relurl===((m=r)==null?void 0:m.relurl))&&(h.initSegment=r)}),e.skippedSegments){if(e.deltaUpdateFailed=o.some(h=>!h),e.deltaUpdateFailed){t.warn("[level-helper] Previous playlist missing segments ski
4727pped in delta playlist");for(let h=e.skippedSegments;h--;)o.shift();e.startSN=o[0].sn}else{e.canSkipDateRanges&&(e.dateRanges=yMe(n.dateRanges,e,t));const h=n.fragments.filter(m=>m.rawProgramDateTime);if(n.hasProgramDateTime&&!e.hasProgramDateTime)for(let m=1;m<l.length;m++)l[m].programDateTime===null&&pD(l[m],l[m-1],h);WZ(h,e)}e.endCC=o[o.length-1].cc}if(!e.startCC){var c;const h=XZ(n,e.startSN-1);e.startCC=(c=h==null?void 0:h.cc)!=null?c:o[0].cc}vMe(n.partList,e.partList,(h,m)=>{m.elementaryStreams=h.elementaryStreams,m.stats=h.stats}),a?YZ(e,a,a.startPTS,a.endPTS,a.startDTS,a.endDTS,t):QZ(n,e),o.length&&(e.totalduration=e.edge-o[0].start),e.driftStartTime=n.driftStartTime,e.driftStart=n.driftStart;const d=e.advancedDateTime;if(e.advanced&&d){const h=e.edge;e.driftStart||(e.driftStartTime=d,e.driftStart=h),e.driftEndTime=d,e.driftEnd=h}else e.driftEndTime=n.driftEndTime,e.driftEnd=n.driftEnd,e.advancedDateTime=n.advancedDateTime;e.requestScheduled===-1&&(e.requestScheduled=n.requestScheduled)}function yMe(n,e,t){const{dateRanges:r,recentlyRemovedDateranges:s}=e,a=sr({},n);s&&s.forEach(c=>{delete a[c]});const l=Object.keys(a).length;return l?(Object.keys(r).forEach(c=>{const d=a[c],h=new $Z(r[c].attr,d);h.isValid?(a[c]=h,d||(h.tagOrder+=l)):t.warn(`Ignoring invalid Playlist Delta Update DATERANGE tag: "${xr(r[c].attr)}"`)}),a):r}function vMe(n,e,t){if(n&&e){let r=0;for(let s=0,a=n.length;s<=a;s++){const o=n[s],l=e[s+r];o&&l&&o.index===l.index&&o.fragment.sn===l.fragment.sn?t(o,l):r--}}}function BMe(n,e,t){const r=e.skippedSegments,s=Math.max(n.startSN,e.startSN)-e.startSN,a=(n.fragmentHint?1:0)+(r?e.endSN:Math.min(n.endSN,e.endSN))-e.startSN,o=e.startSN-n.startSN,l=e.fragmentHint?e.fragments.concat(e.fragmentHint):e.fragments,c=n.fragmentHint?n.fragments.concat(n.fragmentHint):n.fragments;for(let d=s;d<=a;d++){const h=c[o+d];let m=l[d];if(r&&!m&&h&&(m=e.fragments[d]=h),h&&m){t(h,m,d,l);const p=h.relurl,x=m.relurl;if(p&&wMe(p,x)){e.playlistParsingError=hG(`media sequence mismatch ${m.sn}:`,n,e,h,m);return}else if(h.cc!==m.cc){e.playlistParsingError=hG(`discontinuity sequence mismatch (${h.cc}!=${m.cc})`,n,e,h,m);return}}}}function hG(n,e,t,r,s){return new Error(`${n} ${s.url}
4728Playlist starting @${e.startSN}
4729${e.m3u8}
4730
4731Playlist starting @${t.startSN}
4732${t.m3u8}`)}function QZ(n,e,t=!0){const r=e.startSN+e.skippedSegments-n.startSN,s=n.fragments,a=r>=0;let o=0;if(a&&r<s.length)o=s[r].start;else if(a&&e.startSN===n.endSN+1)o=n.fragmentEnd;else if(a&&t)o=n.fragmentStart+r*e.levelTargetDuration;else if(!e.skippedSegments&&e.fragmentStart===0)o=n.fragmentStart;else return;gD(e,o)}function gD(n,e){if(e){const t=n.fragments;for(let r=n.skippedSegments;r<t.length;r++)t[r].addStart(e);n.fragmentHint&&n.fragmentHint.addStart(e)}}function JZ(n,e=1/0){let t=1e3*n.targetduration;if(n.updated){const r=n.fragments;if(r.length&&t*4>e){const a=r[r.length-1].duration*1e3;a<t&&(t=a)}}else t/=2;return Math.round(t)}function XZ(n,e,t){if(!n)return null;let r=n.fragments[e-n.startSN];return r||(r=n.fragmentHint,r&&r.sn===e)?r:e<n.startSN&&t&&t.sn===e?t:null}function fG(n,e,t){return n?ZZ(n.partList,e,t):null}function ZZ(n,e,t){if(n)for(let r=n.length;r--;){const s=n[r];if(s.index===t&&s.fragment.sn===e)return s}return null}function eee(n){n.forEach((e,t)=>{var r;(r=e.details)==null||r.fragments.forEach(s=>{s.level=t,s.initSegment&&(s.initSegment.level=t)})})}function wMe(n,e){return n!==e&&e?mG(n)!==mG(e):!1}function mG(n){return n.replace(/\?[^?]*$/,"")}function Qb(n,e){for(let r=0,s=n.length;r<s;r++){var t;if(((t=n[r])==null?void 0:t.cc)===e)return n[r]}return null}function CMe(n,e){return!!(n&&e.startCC<n.endCC&&e.endCC>n.startCC)}function pG(n,e){const t=n.start+e;n.startPTS=t,n.setStart(t),n.endPTS=t+n.duration}function tee(n,e){const t=e.fragments;for(let r=0,s=t.length;r<s;r++)pG(t[r],n);e.fragmentHint&&pG(e.fragmentHint,n),e.alignedSliding=!0}function EMe(n,e){n&&(nee(e,n),e.alignedSliding||v1(e,n),!e.alignedSliding&&!e.skippedSegments&&QZ(n,e,!1))}function nee(n,e){if(!CMe(e,n))return;const t=Math.min(e.endCC,n.endCC),r=Qb(e.fragments,t),s=Qb(n.fragments,t);
vendor: 15,459 bytes, line 4732
4732if(!r||!s)return;Kn.log(`Aligning playlist at start of dicontinuity sequence ${t}`);const a=r.start-s.start;tee(a,n)}function v1(n,e){if(!n.hasProgramDateTime||!e.hasProgramDateTime)return;const t=n.fragments,r=e.fragments;if(!t.length||!r.length)return;let s,a;const o=Math.min(e.endCC,n.endCC);e.startCC<o&&n.startCC<o&&(s=Qb(r,o),a=Qb(t,o)),(!s||!a)&&(s=r[Math.floor(r.length/2)],a=Qb(t,s.cc)||t[Math.floor(t.length/2)]);const l=s.programDateTime,c=a.programDateTime;if(!l||!c)return;const d=(c-l)/1e3-(a.start-s.start);tee(d,n)}function pi(n,e,t){zi(n,e,t),n.addEventListener(e,t)}function zi(n,e,t){n.removeEventListener(e,t)}const SMe={toString:function(n){let e="";const t=n.length;for(let r=0;r<t;r++)e+=`[${n.start(r).toFixed(3)}-${n.end(r).toFixed(3)}]`;return e}},Ve={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 KP extends VZ{constructor(e,t,r,s,a){super(s,e.logger),this.hls=void 0,this.fragPrevious=null,this.fragCurrent=null,this.fragmentTracker=void 0,this.transmuxer=null,this._state=Ve.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:o,fragCurrent:l,media:c,mediaBuffer:d,state:h}=this,m=c?c.currentTime:0,p=Vt.bufferInfo(d||c,m,o.maxBufferHole),x=!p.len;if(this.log(`Media seeking to ${ct(m)?m.toFixed(3):m}, state: ${h}, ${x?"out of":"in"} buffer`),this.state===Ve.ENDED)this.resetLoadingState();else if(l){const y=o.maxFragLookUpTolerance,v=l.start-y,B=l.start+l.duration+y;if(x||B<p.start||v>p.end){const E=m>B;(m<v||E)&&(E&&l.loader&&(this.log(`Cancelling fragment load for seek (sn: ${l.sn})`),l.abortRequests(),this.resetLoadingState()),this.fragPrevious=null)}}if(c){this.fragmentTracker.removeFragmentsInRange(m,1/0,this.playlistType,!0);const y=this.lastCurrentTime;if(m>y&&(this.lastCurrentTime=m),!this.loadingParts){const v=Math.max(p.end,m),B=this.shouldLoadParts(this.getLevelDetails(),v);B&&(this.log(`LL-Part loading ON after seeking to ${m.toFixed(2)} with buffer @${v.toFixed(2)}`),this.loadingParts=B)}}this.hls.hasEnoughToStart||(this.log(`Setting ${x?"startPosition":"nextLoadPosition"} to ${m} for seek without enough to start`),this.nextLoadPosition=m,x&&(this.startPosition=m)),x&&this.state===Ve.IDLE&&this.tickImmediate()},this.onMediaEnded=()=>{this.log("setting startPosition to 0 because media ended"),this.startPosition=this.lastCurrentTime=0},this.playlistType=a,this.hls=e,this.fragmentLoader=new ZOe(e.config),this.keyLoader=r,this.fragmentTracker=t,this.config=e.config,this.decrypter=new $P(e.config)}registerListeners(){const{hls:e}=this;e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.ERROR,this.onError,this)}doTick(){this.onTickEnd()}onTickEnd(){}startLoad(e){}stopLoad(){if(this.state===Ve.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=Ve.STOPPED}get startPositionValue(){const{nextLoadPosition:e,startPosition:t}=this;return t===-1&&e?e:t}get bufferingEnabled(){return this.buffering}pauseBuffering(){this.buffering=!1}resumeBuffering(){this.buffering=!0}get inFlightFrag(){return{frag:this.fragCurrent,state:this.state}}_streamEnded(e,t){if(t.live||!this.media)return!1;const r=e.end||0,s=this.config.timelineOffset||0;if(r<=s)return!1;const a=e.buffered;this.config.maxBufferHole&&a&&a.length>1&&(e=Vt.bufferedInfo(a,e.start,0));const o=e.nextStart;if(o&&o>s&&o<t.edge||this.media.currentTime<e.start)return!1;const c=t.partList;if(c!=null&&c.length){const h=c[c.length-1];return Vt.isBuffered(this.media,h.start+h.duration/2)}const d=t.fragments[t.fragments.length-1].type;return this.fragmentTracker.isEndListAppended(d)}getLevelDetails(){if(this.levels&&this.levelLastLoaded!==null)return this.levelLastLoaded.details}get timelineOffset(){const e=this.config.timelineOffset;if(e){var t;return((t=this.getLevelDetails())==null?void 0:t.appliedTimelineOffset)||e}return 0}onMediaAttached(e,t){const r=this.media=this.mediaBuffer=t.media;pi(r,"seeking",this.onMediaSeeking),pi(r,"ended",this.onMediaEnded);const s=this.config;this.levels&&s.autoStartLoad&&this.state===Ve.STOPPED&&this.startLoad(s.startPosition)}onMediaDetaching(e,t){const r=!!t.transferMedia,s=this.media;if(s!==null){if(s.ended&&(this.log("MSE detaching and video ended, reset startPosition"),this.startPosition=this.lastCurrentTime=0),zi(s,"seeking",this.onMediaSeeking),zi(s,"ended",this.onMediaEnded),this.keyLoader&&!r&&this.keyLoader.detach(),this.media=this.mediaBuffer=null,this.loopSn=void 0,r){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,t){}onManifestLoaded(e,t){this.startTimeOffset=t.startTimeOffset}onHandlerDestroying(){this.stopLoad(),this.transmuxer&&(this.transmuxer.destroy(),this.transmuxer=null),super.onHandlerDestroying(),this.hls=this.onMediaSeeking=this.onMediaEnded=null}onHandlerDestroyed(){this.state=Ve.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,t,r){this.startFragRequested=!0,this._loadFragForPlayback(e,t,r)}_loadFragForPlayback(e,t,r){const s=a=>{const o=a.frag;if(this.fragContextChanged(o)){this.warn(`${o.type} sn: ${o.sn}${a.part?" part: "+a.part.index:""} of ${this.fragInfo(o,!1,a.part)}) was dropped during download.`),this.fragmentTracker.removeFragment(o);return}o.stats.chunkCount++,this._handleFragmentLoadProgress(a)};this._doFragLoad(e,t,r,s).then(a=>{if(!a)return;const o=this.state,l=a.frag;if(this.fragContextChanged(l)){(o===Ve.FRAG_LOADING||!this.fragCurrent&&o===Ve.PARSING)&&(this.fragmentTracker.removeFragment(l),this.state=Ve.IDLE);return}"payload"in a&&(this.log(`Loaded ${l.type} sn: ${l.sn} of ${this.playlistLabel()} ${l.level}`),this.hls.trigger(V.FRAG_LOADED,a)),this._handleFragmentLoadComplete(a)}).catch(a=>{this.state===Ve.STOPPED||this.state===Ve.ERROR||(this.warn(`Frag error: ${(a==null?void 0:a.message)||a}`),this.resetFragmentLoading(e))})}clearTrackerIfNeeded(e){var t;const{fragmentTracker:r}=this;if(r.getState(e)===Ks.APPENDING){const a=e.type,o=this.getFwdBufferInfo(this.mediaBuffer,a),l=Math.max(e.duration,o?o.len:this.config.maxBufferLength),c=this.backtrackFragment;((c?e.sn-c.sn:0)===1||this.reduceMaxBufferLength(l,e.duration))&&r.removeFragment(e)}else((t=this.mediaBuffer)==null?void 0:t.buffered.length)===0?r.removeAllFragments():r.hasParts(e.type)&&(r.detectPartialFragments({frag:e,part:null,stats:e.stats,id:e.type}),r.getState(e)===Ks.PARTIAL&&r.removeFragment(e))}checkLiveUpdate(e){if(e.updated&&!e.live){const t=e.fragments[e.fragments.length-1];this.fragmentTracker.detectPartialFragments({frag:t,part:null,stats:t.stats,id:t.type})}e.fragments[0]||(e.deltaUpdateFailed=!0)}waitForLive(e){const t=e.details;return(t==null?void 0:t.live)&&t.type!=="EVENT"&&(this.levelLastLoaded!==e||t.expired)}flushMainBuffer(e,t,r=null){if(!(e-t))return;const s={startOffset:e,endOffset:t,type:r};this.hls.trigger(V.BUFFER_FLUSHING,s)}_loadInitSegment(e,t){this._doFragLoad(e,t).then(r=>{const s=r==null?void 0:r.frag;if(!s||this.fragContextChanged(s)||!this.levels)throw new Error("init load aborted");return r}).then(r=>{const{hls:s}=this,{frag:a,payload:o}=r,l=a.decryptdata;if(o&&o.byteLength>0&&l!=null&&l.key&&l.iv&&U0(l.method)){const c=self.performance.now();return this.decrypter.decrypt(new Uint8Array(o),l.key.buffer,l.iv.buffer,zP(l.method)).catch(d=>{throw s.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_DECRYPT_ERROR,fatal:!1,error:d,reason:d.message,frag:a}),d}).then(d=>{const h=self.performance.now();return s.trigger(V.FRAG_DECRYPTED,{frag:a,payload:d,stats:{tstart:c,tdecrypt:h}}),r.payload=d,this.completeInitSegmentLoad(r)})}return this.completeInitSegmentLoad(r)}).catch(r=>{this.state===Ve.STOPPED||this.state===Ve.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}completeInitSegmentLoad(e){const{levels:t}=this;if(!t)throw new Error("init load aborted, missing levels");const r=e.frag.stats;this.state!==Ve.STOPPED&&(this.state=Ve.IDLE),e.frag.data=new Uint8Array(e.payload),r.parsing.start=r.buffering.start=self.performance.now(),r.parsing.end=r.buffering.end=self.performance.now(),this.tick()}unhandledEncryptionError(e,t){var r,s;const a=e.tracks;if(a&&!t.encrypted&&((r=a.audio)!=null&&r.encrypted||(s=a.video)!=null&&s.encrypted)&&(!this.config.emeEnabled||!this.keyLoader.emeController)){const o=this.media,l=new Error(`Encrypted track with no key in ${this.fragInfo(t)} (media ${o?"attached mediaKeys: "+o.mediaKeys:"detached"})`);return this.warn(l.message),!o||o.mediaKeys?!1:(this.hls.trigger(V.ERROR,{type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_NO_KEYS,fatal:!1,error:l,frag:t}),this.resetTransmuxer(),!0)}return!1}fragContextChanged(e){const{fragCurrent:t}=this;return!e||!t||e.sn!==t.sn||e.level!==t.level}fragBufferedComplete(e,t){const r=this.mediaBuffer?this.mediaBuffer:this.media;if(this.log(`Buffered ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)} > buffer:${r?SMe.toString(Vt.getBuffered(r)):"(detached)"})`),ws(e)){var s;if(e.type!==mt.SUBTITLE){const o=e.elementaryStreams;if(!Object.keys(o).some(l=>!!o[l])){this.state=Ve.IDLE;return}}const a=(s=this.levels)==null?void 0:s[e.level];a!=null&&a.fragmentError&&(this.log(`Resetting level fragment error count of ${a.fragmentError} on frag buffered`),a.fragmentError=0)}this.state=Ve.IDLE}_handleFragmentLoadComplete(e){const{transmuxer:t}=this;if(!t)return;const{frag:r,part:s,partsLoaded:a}=e,o=!a||a.length===0||a.some(c=>!c),l=new HP(r.level,r.sn,r.stats.chunkCount+1,0,s?s.index:-1,!o);t.flush(l)}_handleFragmentLoadProgress(e){}_doFragLoad(e,t,r=null,s){var a;this.fragCurrent=e;const o=t.details;if(!this.levels||!o)throw new Error(`frag load aborted, missing level${o?"":" detail"}s`);let l=null;if(e.encrypted&&!((a=e.decryptdata)!=null&&a.key)){if(this.log(`Loading key for ${e.sn} of [${o.startSN}-${o.endSN}], ${this.playlistLabel()} ${e.level}`),this.state=Ve.KEY_LOADING,this.fragCurrent=e,l=this.keyLoader.load(e).then(p=>{if(!this.fragContextChanged(p.frag))return this.hls.trigger(V.KEY_LOADED,p),this.state===Ve.KEY_LOADING&&(this.state=Ve.IDLE),p}),this.hls.trigger(V.KEY_LOADING,{frag:e}),this.fragCurrent===null)return this.log("context changed in KEY_LOADING"),Promise.resolve(null)}else e.encrypted||(l=this.keyLoader.loadClear(e,o.encryptedFragments,this.startFragRequested),l&&this.log("[eme] blocking frag load until media-keys acquired"));const c=this.fragPrevious;if(ws(e)&&(!c||e.sn!==c.sn)){const p=this.shouldLoadParts(t.details,e.end);p!==this.loadingParts&&(this.log(`LL-Part loading ${p?"ON":"OFF"} loading sn ${c==null?void 0:c.sn}->${e.sn}`),this.loadingParts=p)}if(r=Math.max(e.start,r||0),this.loadingParts&&ws(e)){const p=o.partList;if(p&&s){r>o.fragmentEnd&&o.fragmentHint&&(e=o.fragmentHint);const x=this.getNextPart(p,e,r);if(x>-1){const y=p[x];e=this.fragCurrent=y.fragment,this.log(`Loading ${e.type} sn: ${e.sn} part: ${y.index} (${x}/${p.length-1}) of ${this.fragInfo(e,!1,y)}) cc: ${e.cc} [${o.startSN}-${o.endSN}], target: ${parseFloat(r.toFixed(3))}`),this.nextLoadPosition=y.start+y.duration,this.state=Ve.FRAG_LOADING;let v;return l?v=l.then(B=>!B||this.fragContextChanged(B.frag)?null:this.doFragPartsLoad(e,y,t,s)).catch(B=>this.handleFragLoadError(B)):v=this.doFragPartsLoad(e,y,t,s).catch(B=>this.handleFragLoadError(B)),this.hls.trigger(V.FRAG_LOADING,{frag:e,part:y,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING parts")):v}else if(!e.url||this.loadedEndOfParts(p,r))return Promise.resolve(null)}}if(ws(e)&&this.loadingParts){var d;this.log(`LL-Part loading OFF after next part miss @${r.toFixed(2)} Check buffer at sn: ${e.sn} loaded parts: ${(d=o.partList)==null?void 0:d.filter(p=>p.loaded).map(p=>`[${p.start}-${p.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} ${"["+o.startSN+"-"+o.endSN+"]"}, target: ${parseFloat(r.toFixed(3))}`),ct(e.sn)&&!this.bitrateTest&&(this.nextLoadPosition=e.start+e.duration),this.state=Ve.FRAG_LOADING;const h=this.config.progressive&&e.type!==mt.SUBTITLE;let m;return h&&l?m=l.then(p=>!p||this.fragContextChanged(p.frag)?null:this.fragmentLoader.load(e,s)).catch(p=>this.handleFragLoadError(p)):m=Promise.all([this.fragmentLoader.load(e,h?s:void 0),l]).then(([p])=>(!h&&s&&s(p),p)).catch(p=>this.handleFragLoadError(p)),this.hls.trigger(V.FRAG_LOADING,{frag:e,targetBufferTime:r}),this.fragCurrent===null?Promise.reject(new Error("frag load aborted, context changed in FRAG_LOADING")):m}doFragPartsLoad(e,t,r,s){return new Promise((a,o)=>{var l;const c=[],d=(l=r.details)==null?void 0:l.partList,h=m=>{this.fragmentLoader.loadPart(e,m,s).then(p=>{c[m.index]=p;const x=p.part;this.hls.trigger(V.FRAG_LOADED,p);const y=fG(r.details,e.sn,m.index+1)||ZZ(d,e.sn,m.index+1);if(y)h(y);else return a({frag:e,part:x,partsLoaded:c})}).catch(o)};h(t)})}handleFragLoadError(e){if("data"in e){const t=e.data;t.frag&&t.details===Ee.INTERNAL_ABORTED?this.handleFragLoadAborted(t.frag,t.part):t.frag&&t.type===Bt.KEY_SYSTEM_ERROR?(t.frag.abortRequests(),this.resetStartWhenNotLoaded(),this.resetFragmentLoading(t.frag)):this.hls.trigger(V.ERROR,t)}else this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.INTERNAL_EXCEPTION,err:e,error:e,fatal:!0});return null}_handleTransmuxerFlush(e){const t=this.getCurrentContext(e);if(!t||this.state!==Ve.PARSING){!this.fragCurrent&&this.state!==Ve.STOPPED&&this.state!==Ve.ERROR&&(this.state=Ve.IDLE);return}const{frag:r,part:s,level:a}=t,o=self.performance.now();r.stats.parsing.end=o,s&&(s.stats.parsing.end=o);const l=this.getLevelDetails(),d=l&&r.sn>l.endSN||this.shouldLoadParts(l,r.end);d!==this.loadingParts&&(this.log(`LL-Part loading ${d?"ON":"OFF"} after parsing segment ending @${r.end.toFixed(2)}
4732`),this.loadingParts=d),this.updateLevelTiming(r,s,a,e.partial)}shouldLoadParts(e,t){if(this.config.lowLatencyMode){if(!e)return this.loadingParts;if(e.partList){var r;const a=e.partList[0];if(a.fragment.type===mt.SUBTITLE)return!1;const o=a.end+(((r=e.fragmentHint)==null?void 0:r.duration)||0);if(t>=o){var s;if((this.hls.hasEnoughToStart?((s=this.media)==null?void 0:s.currentTime)||this.lastCurrentTime:this.getLoadPosition())>a.start-a.fragment.duration)return!0}}}return!1}getCurrentContext(e){const{levels:t,fragCurrent:r}=this,{level:s,sn:a,part:o}=e;if(!(t!=null&&t[s]))return this.warn(`Levels object was unset while buffering fragment ${a} of ${this.playlistLabel()} ${s}. The current chunk will not be buffered.`),null;const l=t[s],c=l.details,d=o>-1?fG(c,a,o):null,h=d?d.fragment:XZ(c,a,r);return h?(r&&r!==h&&(h.stats=r.stats),{frag:h,part:d,level:l}):null}bufferFragmentData(e,t,r,s,a){if(this.state!==Ve.PARSING)return;const{data1:o,data2:l}=e;let c=o;if(l&&(c=ol(o,l)),!c.length)return;const d=this.initPTS[t.cc],h=d?-
4732d.baseTime/d.timescale:void 0,m={type:e.type,frag:t,part:r,chunkMeta:s,offset:h,parent:t.type,data:c};if(this.hls.trigger(V.BUFFER_APPENDING,m),e.dropped&&e.independent&&!r){if(a)return;this.flushBufferGap(t)}}flushBufferGap(e){const t=this.media;if(!t)return;if(!Vt.isBuffered(t,t.currentTime)){this.flushMainBuffer(0,e.start);return}const r=t.currentTime,s=Vt.bufferInfo(t,r,0),a=e.duration,o=Math.min(this.config.maxFragLookUpTolerance*2,a*.25),l=Math.max(Math.min(e.start-o,s.end-o),r+o);e.start-l>o&&this.flushMainBuffer(l,e.start)}getFwdBufferInfo(e,t){var r;const s=this.getLoadPosition();if(!ct(s))return null;const o=this.lastCurrentTime>s||(r=this.media)!=null&&r.paused?0:this.config.maxBufferHole;return this.getFwdBufferInfoAtPos(e,s,t,o)}getFwdBufferInfoAtPos(e,t,r,s){const a=Vt.bufferInfo(e,t,s);if(a.len===0&&a.nextStart!==void 0){const o=this.fragmentTracker.getBufferedFrag(t,r);if(o&&(a.nextStart<=o.end||o.gap)){const l=Math.max(Math.min(a.nextStart,o.end)-t,s);return Vt.bufferInfo(e,t,l)}}return a}getMaxBufferLength(e){const{config:t}=this;let r;return e?r=Math.max(8*t.maxBufferSize/e,t.maxBufferLength):r=t.maxBufferLength,Math.min(r,t.maxMaxBufferLength)}exceedsMaxBuffer(e,t,r){const s=e.nextStart;if(s&&r.start>s){const a=e.buffered;if(a){let o=e.len;const l=e.bufferedIndex;for(let c=a.length-1;c>l;c--)a[c].start<r.start&&(o+=a[c].end-a[c].start);return o>=t}}return!1}reduceMaxBufferLength(e,t){const r=this.config,s=Math.max(Math.min(e-t,r.maxBufferLength),t),a=Math.max(e-t*3,r.maxMaxBufferLength/2,s);return a>=s?(r.maxMaxBufferLength=a,this.warn(`Reduce max buffer length to ${a}s`),!0):!1}getAppendedFrag(e,t=mt.MAIN){const r=this.fragmentTracker?this.fragmentTracker.getAppendedFrag(e,t):null;return r&&"fragment"in r?r.fragment:r}getNextFragment(e,t){const r=t.fragments,s=r.length;if(!s)return null;const{config:a}=this,o=t.fragmentStart,l=a.lowLatencyMode&&!!t.partList;let c=null;if(t.live){const m=a.initialLiveManifestSize;if(s<m)return this.warn(`Not enough fragments to start playback (have: ${s}, need: ${m})`),null;if(!t.PTSKnown&&!this.startFragRequested&&this.startPosition===-1||e<o){var d;l&&!this.loadingParts&&(this.log("LL-Part loading ON for initial live fragment"),this.loadingParts=!0),c=this.getInitialLiveFragment(t);const p=this.config.startPosition,x=this.hls.startPosition,y=this.hls.liveSyncPosition,v=((d=c)==null?void 0:d.start)||0;let B,E;x!==-1&&x>=o?(B=x,E=x===p?"config":"next load start"):y!==null?(B=y,E="live edge"):(B=e,E="buffer pos"),B<v&&(B=v,E="live frag start"),B<o&&(B=o,E="playlist start"),(this.startPosition!=B||this.nextLoadPosition!=B)&&(this.log(`Setting startPosition to ${B.toFixed(3)} ${x===-1?"":`(from ${p}) `}based on ${E}. live edge: ${y} live frag start: ${v.toFixed(3)} playlist start: ${o.toFixed(3)} buffer pos: ${e}`),this.startPosition=this.nextLoadPosition=B)}}else e<=o&&(c=r[0]);if(!c){const m=this.loadingParts?t.partEnd:t.fragmentEnd;c=this.getFragmentAtPosition(e,m,t)}let h=this.filterReplacedPrimary(c,t);if(!h&&c){const m=c.sn-t.startSN;h=this.filterReplacedPrimary(r[m+1]||null,t)}return this.mapToInitFragWhenRequired(h)}isLoopLoading(e,t){if(this.nextLoadPosition<=t)return!1;const r=this.fragmentTracker.getState(e);return r===Ks.OK||r===Ks.PARTIAL&&!!e.gap}getNextFragmentLoopLoading(e,t,r,s,a){let o=null;if(e.gap&&(o=this.getNextFragment(this.nextLoadPosition,t),o&&!o.gap&&r.nextStart)){const l=this.getFwdBufferInfoAtPos(this.mediaBuffer?this.mediaBuffer:this.media,r.nextStart,s,0);if(l!==null&&r.len+l.len>=a){const c=o.sn;return this.loopSn!==c&&(this.log(`buffer full after gaps in "${s}" playlist starting at sn: ${c}`),this.loopSn=c),null}}return this.loopSn=void 0,o}get primaryPrefetch(){if(gG(this.config)){var e;if((e=this.hls.interstitialsManager)==null||(e=e.playingItem)==null?void 0:e.event)return!0}return!1}filterReplacedPrimary(e,t){if(!e)return e;if(gG(this.config)&&e.type!==mt.SUBTITLE){const r=this.hls.interstitialsManager,s=r==null?void 0:r.bufferingItem;if(s){const o=s.event;if(o){if(o.appendInPlace||Math.abs(e.start-s.start)>1||s.start===0)return null}else if(e.end<=s.start&&(t==null?void 0:t.live)===!1||e.start>s.end&&s.nextEvent&&(s.nextEvent.appendInPlace||e.start-s.end>1))return null}const a=r==null?void 0:r.playerQueue;if(a)for(let o=a.length;o--;){const l=a[o].interstitial;if(l.appendInPlace&&e.start>=l.startTime&&e.end<=l.resumeTime)return null}}return e}mapToInitFragWhenRequired(e){return e!=null&&e.initSegment&&!e.initSegment.data&&!this.bitrateTest?e.
vendor: 30,510 bytes, line 4732
4732initSegment:e}getNextPart(e,t,r){let s=-1,a=!1,o=!0;for(let l=0,c=e.length;l<c;l++){const d=e[l];if(o=o&&!d.independent,s>-1&&r<d.start)break;const h=d.loaded;h?s=-1:(a||(d.independent||o)&&d.fragment===t)&&(d.fragment!==t&&this.warn(`Need buffer at ${r} but next unloaded part starts at ${d.start}`),s=l),a=h}return s}loadedEndOfParts(e,t){let r;for(let s=e.length;s--;){if(r=e[s],!r.loaded)return!1;if(t>r.start)return!0}return!1}getInitialLiveFragment(e){const t=e.fragments,r=this.fragPrevious;let s=null;if(r){if(e.hasProgramDateTime&&(s=VOe(t,r.endProgramDateTime,this.config.maxFragLookUpTolerance),s&&this.log(`Live playlist, switching playlist, load frag with same PDT: ${r.programDateTime}`)),!s){const a=r.sn+1;if(a>=e.startSN&&a<=e.endSN){const o=t[a-e.startSN];r.cc===o.cc&&(s=o,this.log(`Live playlist, switching playlist, load frag with next SN: ${s.sn}`))}s||(s=MZ(e,r.cc,r.end),s&&this.log(`Live playlist, switching playlist, load frag with same CC: ${s.sn}`))}}else{const a=this.hls.liveSyncPosition;a!==null&&(s=this.getFragmentAtPosition(a,this.bitrateTest?e.fragmentEnd:e.edge,e))}return s}getFragmentAtPosition(e,t,r){const{config:s}=this;let{fragPrevious:a}=this,{fragments:o,endSN:l}=r;const{fragmentHint:c}=r,{maxFragLookUpTolerance:d}=s,h=r.partList,m=!!(this.loadingParts&&h!=null&&h.length&&c);m&&!this.bitrateTest&&h[h.length-1].fragment.sn===c.sn&&(o=o.concat(c),l=c.sn);let p;if(e<t){var x;const v=e<this.lastCurrentTime||e>t-d||(x=this.media)!=null&&x.paused||!this.startFragRequested?0:d;p=$m(a,o,e,v)}else p=o[o.length-1];if(p){const y=p.sn-r.startSN,v=this.fragmentTracker.getState(p);if((v===Ks.OK||v===Ks.PARTIAL&&p.gap)&&(a=p),a&&p.sn===a.sn&&(!m||h[0].fragment.sn>p.sn||!r.live)&&p.level===a.level){const E=o[y+1];p.sn<l&&this.fragmentTracker.getState(E)!==Ks.OK?p=E:p=null}}return p}alignPlaylists(e,t,r){const s=e.fragments.length;if(!s)return this.warn("No fragments in live playlist"),0;const a=e.fragmentStart,o=!t,l=e.alignedSliding&&ct(a);if(o||!l&&!a){EMe(r,e);const c=e.fragmentStart;return this.log(`Live playlist sliding: ${c.toFixed(2)} start-sn: ${t?t.startSN:"na"}->${e.startSN} fragments: ${s}`),c}return a}waitForCdnTuneIn(e){return e.live&&e.canBlockReload&&e.partTarget&&e.tuneInGoal>Math.max(e.partHoldBack,e.partTarget*3)}setStartPosition(e,t){let r=this.startPosition;r<t&&(r=-1);const s=this.timelineOffset;if(r===-1){const a=this.startTimeOffset!==null,o=a?this.startTimeOffset:e.startTimeOffset;o!==null&&ct(o)?(r=t+o,o<0&&(r+=e.edge),r=Math.min(Math.max(t,r),t+e.totalduration),this.log(`Setting startPosition to ${r} for start time offset ${o} found in ${a?"multivariant":"media"} playlist`),this.startPosition=r):e.live?(r=this.hls.liveSyncPosition||t,this.log(`Setting startPosition to -1 to start at live edge ${r}`),this.startPosition=-1):(this.log("setting startPosition to 0 by default"),this.startPosition=r=0),this.lastCurrentTime=r+s}this.nextLoadPosition=r+s}getLoadPosition(){var e;const{media:t}=this;let r=0;return(e=this.hls)!=null&&e.hasEnoughToStart&&t?r=t.currentTime:this.nextLoadPosition>=0&&(r=this.nextLoadPosition),r}handleFragLoadAborted(e,t){this.transmuxer&&e.type===this.playlistType&&ws(e)&&e.stats.aborted&&(this.log(`Fragment ${e.sn}${t?" part "+t.index:""} of ${this.playlistLabel()} ${e.level} was aborted`),this.resetFragmentLoading(e))}resetFragmentLoading(e){(!this.fragCurrent||!this.fragContextChanged(e)&&this.state!==Ve.FRAG_LOADING_WAITING_RETRY)&&(this.state=Ve.IDLE)}onFragmentOrKeyLoadError(e,t){var r;if(t.chunkMeta&&!t.frag){const E=this.getCurrentContext(t.chunkMeta);E&&(t.frag=E.frag)}const s=t.frag;if(!s||s.type!==e||!this.levels)return;if(this.fragContextChanged(s)){var a;this.warn(`Frag load error must match current frag to retry ${s.url} > ${(a=this.fragCurrent)==null?void 0:a.url}`);return}const o=t.details===Ee.FRAG_GAP;o&&this.fragmentTracker.fragBuffered(s,!0);const l=t.errorAction;if(!l){this.state=Ve.ERROR;return}const{action:c,flags:d,retryCount:h=0,retryConfig:m}=l,p=!!m,x=p&&c===Da.RetryRequest,y=p&&!l.resolved&&d===fo.MoveAllAlternatesMatchingHost,v=(r=this.hls.latestLevelDetails)==null?void 0:r.live;if(!x&&y&&ws(s)&&!s.endList&&v&&!UZ(t))this.resetFragmentErrors(e),this.treatAsGap(s),l.resolved=!0;else if((x||y)&&h<m.maxNumRetry){var B;const E=hD((B=t.response)==null?void 0:B.code),N=GP(m,h);if(this.resetStartWhenNotLoaded(),this.retryDate=self.performance.now()+N,this.state=Ve.FRAG_LOADING_WAITING_RETRY,l.resolved=!0,E){this.log("Waiting for connection (offline)"),this.retryDate=1/0,t.reason="offline";return}this.warn(`Fragment ${s.sn} of ${e} ${s.level} errored with ${t.details}, retrying loading ${h+1}/${m.maxNumRetry} in ${N}ms`)}else if(m)if(this.resetFragmentErrors(e),h<m.maxNumRetry)!o&&c!==Da.RemoveAlternatePermanently&&(l.resolved=!0);else{this.warn(`${t.details} reached or exceeded max retry (${h})`);return}else c===Da.SendAlternateToPenaltyBox?this.state=Ve.WAITING_LEVEL:this.state=Ve.ERROR;this.tickImmediate()}checkRetryDate(){const e=self.performance.now(),t=this.retryDate,r=t===1/0;(!t||e>=t||r&&!hD(0))&&(r&&this.log("Connection restored (online)"),this.resetStartWhenNotLoaded(),this.state=Ve.IDLE)}reduceLengthAndFlushBuffer(e){if(this.state===Ve.PARSING||this.state===Ve.PARSED){const t=e.frag,r=e.parent,s=this.getFwdBufferInfo(this.mediaBuffer,r),a=s&&s.len>.5;a&&this.reduceMaxBufferLength(s.len,(t==null?void 0:t.duration)||10);const o=!a;return o&&this.warn(`Buffer full error while media.currentTime (${this.getLoadPosition()}) is not buffered, flush ${r} buffer`),t&&(this.fragmentTracker.removeFragment(t),this.nextLoadPosition=t.start),this.resetLoadingState(),o}return!1}resetFragmentErrors(e){e===mt.AUDIO&&(this.fragCurrent=null),this.hls.hasEnoughToStart||(this.startFragRequested=!1),this.state!==Ve.STOPPED&&(this.state=Ve.IDLE)}afterBufferFlushed(e,t,r){if(!e)return;const s=Vt.getBuffered(e);this.fragmentTracker.detectEvictedFragments(t,s,r),this.state===Ve.ENDED&&this.resetLoadingState()}resetLoadingState(){this.log("Reset loading state"),this.fragCurrent=null,this.fragPrevious=null,this.state!==Ve.STOPPED&&(this.state=Ve.IDLE)}resetStartWhenNotLoaded(){if(!this.hls.hasEnoughToStart){this.startFragRequested=!1;const e=this.levelLastLoaded,t=e?e.details:null;t!=null&&t.live?(this.log("resetting startPosition for live start"),this.startPosition=-1,this.setStartPosition(t,t.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,t,r,s){const a=r.details;if(!a){this.warn("level.details undefined");return}if(!Object.keys(e.elementaryStreams).reduce((c,d)=>{const h=e.elementaryStreams[d];if(h){const m=h.endPTS-h.startPTS;if(m<=0)return this.warn(`Could not parse fragment ${e.sn} ${d} duration reliably (${m})`),c||!1;const p=s?0:YZ(a,e,h.startPTS,h.endPTS,h.startDTS,h.endDTS,this);return this.hls.trigger(V.LEVEL_PTS_UPDATED,{details:a,level:r,drift:p,type:d,frag:e,start:h.startPTS,end:h.endPTS}),!0}return c},!1)){var l;const c=((l=this.transmuxer)==null?void 0:l.error)===null;if((r.fragmentError===0||c&&(r.fragmentError<2||e.endList))&&this.treatAsGap(e,r),c){const d=new Error(`Found no media in fragment ${e.sn} of ${this.playlistLabel()} ${e.level} resetting transmuxer to fallback to playlist timing`);if(this.warn(d.message),this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_PARSING_ERROR,fatal:!1,error:d,frag:e,reason:`Found no media in msn ${e.sn} of ${this.playlistLabel()} "${r.url}"`}),!this.hls)return;this.resetTransmuxer()}}this.state=Ve.PARSED,this.log(`Parsed ${e.type} sn: ${e.sn}${t?" part: "+t.index:""} of ${this.fragInfo(e,!1,t)})`),this.hls.trigger(V.FRAG_PARSED,{frag:e,part:t})}playlistLabel(){return this.playlistType===mt.MAIN?"level":"track"}fragInfo(e,t=!0,r){var s,a;return`${this.playlistLabel()} ${e.level} (${r?"part":"frag"}:[${((s=t&&!r?e.startPTS:(r||e).start)!=null?s:NaN).toFixed(3)}-${((a=t&&!r?e.endPTS:(r||e).end)!=null?a:NaN).toFixed(3)}]${r&&e.type==="main"?"INDEPENDENT="+(r.independent?"YES":"NO"):""}`}treatAsGap(e,t){t&&t.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 t=this._state;t!==e&&(this._state=e,this.log(`${t}->${e}`))}get state(){return this._state}}function gG(n){return!!n.interstitialsController&&n.enableInterstitialPlayback!==!1}class ree{constructor(){this.chunks=[],this.dataLength=0}push(e){this.chunks.push(e),this.dataLength+=e.length}flush(){const{chunks:e,dataLength:t}=this;let r;if(e.length)e.length===1?r=e[0]:r=TMe(e,t);else return new Uint8Array(0);return this.reset(),r}reset(){this.chunks.length=0,this.dataLength=0}}function TMe(n,e){const t=new Uint8Array(e);let r=0;for(let s=0;s<n.length;s++){const a=n[s];t.set(a,r),r+=a.length}return t}var FN={exports:{}},xG;function AMe(){return xG||(xG=1,(function(n){var e=Object.prototype.hasOwnProperty,t="~";function r(){}Object.create&&(r.prototype=Object.create(null),new r().__proto__||(t=!1));function s(c,d,h){this.fn=c,this.context=d,this.once=h||!1}function a(c,d,h,m,p){if(typeof h!="function")throw new TypeError("The listener must be a function");var x=new s(h,m||c,p),y=t?t+d:d;return c._events[y]?c._events[y].fn?c._events[y]=[c._events[y],x]:c._events[y].push(x):(c._events[y]=x,c._eventsCount++),c}function o(c,d){--c._eventsCount===0?c._events=new r:delete c._events[d]}function l(){this._events=new r,this._eventsCount=0}l.prototype.eventNames=function(){var d=[],h,m;if(this._eventsCount===0)return d;for(m in h=this._events)e.call(h,m)&&d.push(t?m.slice(1):m);return Object.getOwnPropertySymbols?d.concat(Object.getOwnPropertySymbols(h)):d},l.prototype.listeners=function(d){var h=t?t+d:d,m=this._events[h];if(!m)return[];if(m.fn)return[m.fn];for(var p=0,x=m.length,y=new Array(x);p<x;p++)y[p]=m[p].fn;return y},l.prototype.listenerCount=function(d){var h=t?t+d:d,m=this._events[h];return m?m.fn?1:m.length:0},l.prototype.emit=function(d,h,m,p,x,y){var v=t?t+d:d;if(!this._events[v])return!1;var B=this._events[v],E=arguments.length,N,T;if(B.fn){switch(B.once&&this.removeListener(d,B.fn,void 0,!0),E){case 1:return B.fn.call(B.context),!0;case 2:return B.fn.call(B.context,h),!0;case 3:return B.fn.call(B.context,h,m),!0;case 4:return B.fn.call(B.context,h,m,p),!0;case 5:return B.fn.call(B.context,h,m,p,x),!0;case 6:return B.fn.call(B.context,h,m,p,x,y),!0}for(T=1,N=new Array(E-1);T<E;T++)N[T-1]=arguments[T];B.fn.apply(B.context,N)}else{var k=B.length,P;for(T=0;T<k;T++)switch(B[T].once&&this.removeListener(d,B[T].fn,void 0,!0),E){case 1:B[T].fn.call(B[T].context);break;case 2:B[T].fn.call(B[T].context,h);break;case 3:B[T].fn.call(B[T].context,h,m);break;case 4:B[T].fn.call(B[T].context,h,m,p);break;default:if(!N)for(P=1,N=new Array(E-1);P<E;P++)N[P-1]=arguments[P];B[T].fn.apply(B[T].context,N)}}return!0},l.prototype.on=function(d,h,m){return a(this,d,h,m,!1)},l.prototype.once=function(d,h,m){return a(this,d,h,m,!0)},l.prototype.removeListener=function(d,h,m,p){var x=t?t+d:d;if(!this._events[x])return this;if(!h)return o(this,x),this;var y=this._events[x];if(y.fn)y.fn===h&&(!p||y.once)&&(!m||y.context===m)&&o(this,x);else{for(var v=0,B=[],E=y.length;v<E;v++)(y[v].fn!==h||p&&!y[v].once||m&&y[v].context!==m)&&B.push(y[v]);B.length?this._events[x]=B.length===1?B[0]:B:o(this,x)}return this},l.prototype.removeAllListeners=function(d){var h;return d?(h=t?t+d:d,this._events[h]&&o(this,h)):(this._events=new r,this._eventsCount=0),this},l.prototype.off=l.prototype.removeListener,l.prototype.addListener=l.prototype.on,l.prefixed=t,l.EventEmitter=l,n.exports=l})(FN)),FN.exports}var kMe=AMe(),WP=ZLe(kMe);const Gy="1.6.16",Ag={};function NMe(){return typeof __HLS_WORKER_BUNDLE__=="function"}function _Me(){const n=Ag[Gy];if(n)return n.clientCount++,n;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"}),t=self.URL.createObjectURL(e),s={worker:new self.Worker(t),objectURL:t,clientCount:1};return Ag[Gy]=s,s}function IMe(n){const e=Ag[n];if(e)return e.clientCount++,e;const t=new self.URL(n,self.location.href).href,s={worker:new self.Worker(t),scriptURL:t,clientCount:1};return Ag[n]=s,s}function DMe(n){const e=Ag[n||Gy];if(e&&e.clientCount--===1){const{worker:r,objectURL:s}=e;delete Ag[n||Gy],s&&self.URL.revokeObjectURL(s),r.terminate()}}function see(n,e){return e+10<=n.length&&n[e]===51&&n[e+1]===68&&n[e+2]===73&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function YP(n,e){return e+10<=n.length&&n[e]===73&&n[e+1]===68&&n[e+2]===51&&n[e+3]<255&&n[e+4]<255&&n[e+6]<128&&n[e+7]<128&&n[e+8]<128&&n[e+9]<128}function hT(n,e){let t=0;return t=(n[e]&127)<<21,t|=(n[e+1]&127)<<14,t|=(n[e+2]&127)<<7,t|=n[e+3]&127,t}function $y(n,e){const t=e;let r=0;for(;YP(n,e);){r+=10;const s=hT(n,e+6);r+=s,see(n,e+10)&&(r+=10),e+=r}if(r>0)return n.subarray(t,t+r)}function jMe(n,e,t,r){const s=[96e3,88200,64e3,48e3,44100,32e3,24e3,22050,16e3,12e3,11025,8e3,7350],a=e[t+2],o=a>>2&15;if(o>12){const x=new Error(`invalid ADTS sampling index:${o}`);n.emit(V.ERROR,V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_PARSING_ERROR,fatal:!0,error:x,reason:x.message});return}const l=(a>>6&3)+1,c=e[t+3]>>6&3|(a&1)<<2,d="mp4a.40."+l,h=s[o];let m=o;(l===5||l===29)&&(m-=3);const p=[l<<3|(m&14)>>1,(m&1)<<7|c<<3];return Kn.log(`manifest codec:${r}, parsed codec:${d}, channels:${c}, rate:${h} (ADTS object type:${l} sampling index:${o})`),{config:p,samplerate:h,channelCount:c,codec:d,parsedCodec:d,manifestCodec:r}}function aee(n,e){return n[e]===255&&(n[e+1]&246)===240}function iee(n,e){return n[e+1]&1?7:9}function QP(n,e){return(n[e+3]&3)<<11|n[e+4]<<3|(n[e+5]&224)>>>5}function RMe(n,e){return e+5<n.length}function B1(n,e){return e+1<n.length&&aee(n,e)}function PMe(n,e){return RMe(n,e)&&aee(n,e)&&QP(n,e)<=n.length-e}function LMe(n,e){if(B1(n,e)){const t=iee(n,e);if(e+t>=n.length)return!1;const r=QP(n,e);if(r<=t)return!1;const s=e+r;return s===n.length||B1(n,s)}return!1}function oee(n,e,t,r,s){if(!n.samplerate){const a=jMe(e,t,r,s);if(!a)return;sr(n,a)}}function lee(n){return 1024*9e4/n}function OMe(n,e){const t=iee(n,e);if(e+t<=n.length){const r=QP(n,e)-t;if(r>0)return{headerLength:t,frameLength:r}}}function cee(n,e,t,r,s){const a=lee(n.samplerate),o=r+s*a,l=OMe(e,t);let c;if(l){const{frameLength:m,headerLength:p}=l,x=p+m,y=Math.max(0,t+x-e.length);y?(c=new Uint8Array(x-p),c.set(e.subarray(t+p,e.length),0)):c=e.subarray(t+p,t+x);const v={unit:c,pts:o};return y||n.samples.push(v),{sample:v,length:x,missing:y}}const d=e.length-t;return c=new Uint8Array(d),c.set(e.subarray(t,e.length),0),{sample:{unit:c,pts:o},length:d,missing:-1}}function MMe(n,e){return YP(n,e)&&hT(n,e+6)+10<=n.length-e}function FMe(n){return n instanceof ArrayBuffer?n:n.byteOffset==0&&n.byteLength==n.buffer.byteLength?n.buffer:new Uint8Array(n).buffer}function UN(n,e=0,t=1/0){return UMe(n,e,t,Uint8Array)}function UMe(n,e,t,r){const s=VMe(n);let a=1;"BYTES_PER_ELEMENT"in r&&(a=r.BYTES_PER_ELEMENT);const o=GMe(n)?n.byteOffset:0,l=(o+n.byteLength)/a,c=(o+e)/a,d=Math.floor(Math.max(0,Math.min(c,l))),h=Math.floor(Math.min(d+Math.max(t,0),l));return new r(s,d,h-d)}function VMe(n){return n instanceof ArrayBuffer?n:n.buffer}function GMe(n){return n&&n.buffer instanceof ArrayBuffer&&n.byteLength!==void 0&&n.byteOffset!==void 0}function $Me(n){const e={key:n.type,description:"",data:"",mimeType:null,pictureType:null},t=3;if(n.size<2)return;if(n.data[0]!==t){console.log("Ignore frame with unrecognized character encoding");return}const r=n.data.subarray(1).indexOf(0);if(r===-1)return;const s=To(UN(n.data,1,r)),a=n.data[2+r],o=n.data.subarray(3+r).indexOf(0);if(o===-1)return;const l=To(UN(n.data,3+r,o));let c;return s==="-->"?c=To(UN(n.data,4+r+o)):c=FMe(n.data.subarray(4+r+o)),e.mimeType=s,e.pictureType=a,e.description=l,e.data=c,e}function HMe(n){if(n.size<2)return;const e=To(n.data,!0),t=new Uint8Array(n.data.subarray(e.length+1));return{key:n.type,info:e,data:t.buffer}}function zMe(n){if(n.size<2)return;if(n.type==="TXXX"){let t=1;const r=To(n.data.subarray(t),!0);t+=r.length+1;const s=To(n.data.subarray(t));return{key:n.type,info:r,data:s}}const e=To(n.data.subarray(1));return{key:n.type,info:"",data:e}}function qMe(n){if(n.type==="WXXX"){if(n.size<2)return;let t=1;const r=To(n.data.subarray(t),!0);t+=r.length+1;const s=To(n.data.subarray(t));return{key:n.type,info:r,data:s}}const e=To(n.data);return{key:n.type,info:"",data:e}}function KMe(n){return n.type==="PRIV"?HMe(n):n.type[0]==="W"?qMe(n):n.type==="APIC"?$Me(n):zMe(n)}function WMe(n){const e=String.fromCharCode(n[0],n[1],n[2],n[3]),t=hT(n,4),r=10;return{type:e,size:t,data:n.subarray(r,r+t)}}const Ow=10,YMe=10;function dee(n){let e=0;const t=[];for(;YP(n,e);){const r=hT(n,e+6);n[e+5]>>6&1&&(e+=Ow),e+=Ow;const s=e+r;for(;e+YMe<s;){const a=WMe(n.subarray(e)),o=KMe(a);o&&t.push(o),e+=a.size+Ow}see(n,e)&&(e+=Ow)}return t}function uee(n){return n&&n.key==="PRIV"&&n.info==="com.apple.streaming.transportStreamTimestamp"}function QMe(n){if(n.data.byteLength===8){const e=new Uint8Array(n.data),t=e[3]&1;let r=(e[4]<<23)+(e[5]<<15)+(e[6]<<7)+e[7];return r/=45,t&&(r+=4772185884e-2),Math.round(r)}}function JP(n){const e=dee(n);for(let t=0;t<e.length;t++){const r=e[t];if(uee(r))return QMe(r)}}let go=(function(n){return n.audioId3="org.id3",n.dateRange="com.apple.quicktime.HLS",n.emsg="https://aomedia.org/emsg/ID3",n.misbklv="urn:misb:KLV:bin:1910.1",n})({});function pc(n="",e=9e4){return{type:n,id:-1,pid:-1,inputTimeScale:e,sequenceNumber:-1,samples:[],dropped:0}}class XP{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,t,r,s){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,t){return!1}appendFrame(e,t,r){}demux(e,t){this.cachedData&&(e=ol(this.cachedData,e),this.cachedData=null);let r=$y(e,0),s=r?r.length:0,a;const o=this._audioTrack,l=this._id3Track,c=r?JP(r):void 0,d=e.length;for((this.basePTS===null||this.frameIndex===0&&ct(c))&&(this.basePTS=JMe(c,t,this.initPTS),this.lastPTS=this.basePTS),this.lastPTS===null&&(this.lastPTS=this.basePTS),r&&r.length>0&&l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:go.audioId3,duration:Number.POSITIVE_INFINITY});s<d;){if(this.canParse(e,s)){const h=this.appendFrame(o,e,s);h?(this.frameIndex++,this.lastPTS=h.sample.pts,s+=h.length,a=s):s=d}else MMe(e,s)?(r=$y(e,s),l.samples.push({pts:this.lastPTS,dts:this.lastPTS,data:r,type:go.audioId3,duration:Number.POSITIVE_INFINITY}),s+=r.length,a=s):s++;if(s===d&&a!==d){const h=e.slice(a);this.cachedData?this.cachedData=ol(this.cachedData,h):this.cachedData=h}}return{audioTrack:o,videoTrack:pc(),id3Track:l,textTrack:pc()}}demuxSampleAes(e,t,r){return Promise.reject(new Error(`[${this}] This demuxer does not support Sample-AES decryption`))}flush(e){const t=this.cachedData;return t&&(this.cachedData=null,this.demux(t,0)),{audioTrack:this._audioTrack,videoTrack:pc(),id3Track:this._id3Track,textTrack:pc()}}destroy(){this.cachedData=null,this._audioTrack=this._id3Track=void 0}}const JMe=(n,e,t)=>{if(ct(n))return n*90;const r=t?t.baseTime*9e4/t.timescale:0;return e*9e4+r};let Mw=null;const XMe=[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],ZMe=[44100,48e3,32e3,22050,24e3,16e3,11025,12e3,8e3],e3e=[[0,72,144,12],[0,0,0,0],[0,72,144,12],[0,144,144,12]],t3e=[0,1,1,4];function hee(n,e,t,r,s){if(t+24>e.length)return;const a=fee(e,t);if(a&&t+a.frameLength<=e.length){const o=a.samplesPerFrame*9e4/a.sampleRate,l=r+s*o,c={unit:e.subarray(t,t+a.frameLength),pts:l,dts:l};return n.config=[],n.channelCount=a.channelCount,n.samplerate=a.sampleRate,n.samples.push(c),{sample:c,length:a.frameLength,missing:0}}}function fee(n,e){const t=n[e+1]>>3&3,r=n[e+1]>>1&3,s=n[e+2]>>4&15,a=n[e+2]>>2&3;if(t!==1&&s!==0&&s!==15&&a!==3){const o=n[e+2]>>1&1,l=n[e+3]>>6,c=t===3?3-r:r===3?3:4,d=XMe[c*14+s-1]*1e3,m=ZMe[(t===3?0:t===2?1:2)*3+a],p=l===3?1:2,x=e3e[t][r],y=t3e[r],v=x*8*y,B=Math.floor(x*d/m+o)*y;if(Mw===null){const T=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);Mw=T?parseInt(T[1]):0}return!!Mw&&Mw<=87&&r===2&&d>=224e3&&l===0&&(n[e+3]=n[e+3]|128),{sampleRate:m,channelCount:p,frameLength:B,samplesPerFrame:v}}}function ZP(n,e){return n[e]===255&&(n[e+1]&224)===224&&(n[e+1]&6)!==0}function mee(n,e){return e+1<n.length&&ZP(n,e)}function n3e(n,e){return ZP(n,e)&&4<=n.length-e}function pee(n,e){if(e+1<n.length&&ZP(n,e)){const r=fee(n,e);let s=4;r!=null&&r.frameLength&&(s=r.frameLength);const a=e+s;return a===n.length||mee(n,a)}return!1}class r3e extends XP{constructor(e,t){super(),this.observer=void 0,this.config=void 0,this.observer=e,this.config=t}resetInitSegment(e,t,r,s){super.resetInitSegment(e,t,r,s),this._audioTrack={container:"audio/adts",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"aac",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}static probe(e,t){if(!e)return!1;const r=$y(e,0);let s=(r==null?void 0:r.length)||0;if(pee(e,s))return!1;for(let a=e.length;s<a;s++)if(LMe(e,s))return t.log("ADTS sync word found !"),!0;return!1}canParse(e,t){return PMe(e,t)}appendFrame(e,t,r){oee(e,this.observer,t,r,e.manifestCodec);const s=cee(e,t,r,this.basePTS,this.frameIndex);if(s&&s.missing===0)return s}}const gee=(n,e)=>{let t=0,r=5;e+=r;const s=new Uint32Array(1),a=new Uint32Array(1),o=new Uint8Array(1);for(;r>0;){o[0]=n[e];const l=Math.min(r,8),c=8-l;a[0]=4278190080>>>24+c<<c,s[0]=(o[0]&a[0])>>c,t=t?t<<l|s[0]:s[0],e+=1,r-=l}return t};class s3e extends XP{constructor(e){super(),this.observer=void 0,this.observer=e}resetInitSegment(e,t,r,s){super.resetInitSegment(e,t,r,s),this._audioTrack={container:"audio/ac-3",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"ac3",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}canParse(e,t){return t+64<e.length}appendFrame(e,t,r){const s=xee(e,t,r,this.basePTS,this.frameIndex);if(s!==-1)return{sample:e.samples[e.samples.length-1],length:s,missing:0}}static probe(e){if(!e)return!1;const t=$y(e,0);if(!t)return!1;const r=t.length;return e[r]===11&&e[r+1]===119&&JP(t)!==void 0&&gee(e,r)<16}}function xee(n,e,t,r,s){if(t+8>e.length||e[t]!==11||e[t+1]!==119)return-1;const a=e[t+4]>>6;if(a>=3)return-1;const l=[48e3,44100,32e3][a],c=e[t+4]&63,h=[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][c*3+a]*2;if(t+h>e.length)return-1;const m=e[t+6]>>5;let p=0;m===2?p+=2:(m&1&&m!==1&&(p+=2),m&4&&(p+=2));const x=(e[t+6]<<8|e[t+7])>>12-p&1,v=[2,1,2,3,3,4,4,5][m]+x,B=e[t+5]>>3,E=e[t+5]&7,N=new Uint8Array([a<<6|B<<1|E>>2,(E&3)<<6|m<<3|x<<2|c>>4,c<<4&224]),T=1536/l*9e4,k=r+s*T,P=e.subarray(t,t+h);return n.config=N,n.channelCount=v,n.samplerate=l,n.samples.push({unit:P,pts:k}),h}class a3e extends XP{resetInitSegment(e,t,r,s){super.resetInitSegment(e,t,r,s),this._audioTrack={container:"audio/mpeg",type:"audio",id:2,pid:-1,sequenceNumber:0,segmentCodec:"mp3",samples:[],manifestCodec:t,duration:s,inputTimeScale:9e4,dropped:0}}static probe(e){if(!e)return!1;const t=$y(e,0);let r=(t==null?void 0:t.length)||0;if(t&&e[r]===11&&e[r+1]===119&&JP(t)!==void 0&&gee(e,r)<=16)return!1;for(let s=e.length;r<s;r++)if(pee(e,r))return Kn.log("MPEG Audio sync word found !"),!0;return!1}canParse(e,t){return n3e(e,t)}appendFrame(e,t,r){if(this.basePTS!==null)return hee(e,t,r,this.basePTS,this.frameIndex)}}const i3e=/\/emsg[-/]ID3/i;class o3e{constructor(e,t){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=t}resetTimeStamp(){}resetInitSegment(e,t,r,s){const a=this.videoTrack=pc("video",1),o=this.audioTrack=pc("audio",1),l=this.txtTrack=pc("text",1);if(this.id3Track=pc("id3",1),this.timeOffset=0,!(e!=null&&e.byteLength))return;const c=AZ(e);if(c.video){const{id:d,timescale:h,codec:m,supplemental:p}=c.video;a.id=d,a.timescale=l.timescale=h,a.codec=m,a.supplemental=p}if(c.audio){const{id:d,timescale:h,codec:m}=c.audio;o.id=d,o.timescale=h,o.codec=m}l.id=EZ.text,a.sampleDuration=0,a.duration=o.duration=s}resetContiguity(){this.remainderData=null}static probe(e){return sOe(e)}demux(e,t){this.timeOffset=t;let r=e;const s=this.videoTrack,a=this.txtTrack;if(this.config.progressive){this.remainderData&&(r=ol(this.remainderData,e));const l=uOe(r);this.remainderData=l.remainder,s.samples=l.valid||new Uint8Array}else s.samples=r;const o=this.extractID3Track(s,t);return a.samples=P9(t,s),{videoTrack:s,audioTrack:this.audioTrack,id3Track:o,textTrack:this.txtTrack}}flush(){const e=this.timeOffset,t=this.videoTrack,r=this.txtTrack;t.samples=this.remainderData||new Uint8Array,this.remainderData=null;const s=this.extractID3Track(t,this.timeOffset);return r.samples=P9(e,t),{videoTrack:t,audioTrack:pc(),id3Track:s,textTrack:pc()}}extractID3Track(e,t){const r=this.id3Track;if(e.samples.length){const s=Jt(e.samples,["emsg"]);s&&s.forEach(a=>{const o=fOe(a);if(i3e.test(o.schemeIdUri)){const l=bG(o,t);let c=o.eventDuration===4294967295?Number.POSITIVE_INFINITY:o.eventDuration/o.timeScale;c<=.001&&(c=Number.POSITIVE_INFINITY);const d=o.payload;r.samples.push({data:d,len:d.byteLength,dts:l,pts:l,type:go.emsg,duration:c})}else if(this.config.enableEmsgKLVMetadata&&o.schemeIdUri.startsWith("urn:misb:KLV:bin:1910.1")){const l=bG(o,t);r.samples.push({data:o.payload,len:o.payload.byteLength,dts:l,pts:l,type:go.misbklv,duration:Number.POSITIVE_INFINITY})}})}return r}demuxSampleAes(e,t,r){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 bG(n,e){return ct(n.presentationTime)?n.presentationTime/n.timeScale:e+n.presentationTimeDelta/n.timeScale}class l3e{constructor(e,t,r){this.keyData=void 0,this.decrypter=void 0,this.keyData=r,this.decrypter=new $P(t,{removePKCS7Padding:!1})}decryptBuffer(e){return this.decrypter.decrypt(e,this.keyData.key.buffer,this.keyData.iv.buffer,$h.cbc)}decryptAacSample(e,t,r){const s=e[t].unit;if(s.length<=16)return;const a=s.subarray(16,s.length-s.length%16),o=a.buffer.slice(a.byteOffset,a.byteOffset+a.length);this.decryptBuffer(o).then(l=>{const c=new Uint8Array(l);s.set(c,16),this.decrypter.isSync()||this.decryptAacSamples(e,t+1,r)}).catch(r)}decryptAacSamples(e,t,r){for(;;t++){if(t>=e.length){r();return}if(!(e[t].unit.length<32)&&(this.decryptAacSample(e,t,r),!this.decrypter.isSync()))return}}getAvcEncryptedData(e){const t=Math.floor((e.length-48)/160)*16+16,r=new Int8Array(t);let s=0;for(let a=32;a<e.length-16;a+=160,s+=16)r.set(e.subarray(a,a+16),s);return r}getAvcDecryptedUnit(e,t){const r=new Uint8Array(t);let s=0;for(let a=32;a<e.length-16;a+=160,s+=16)e.set(r.subarray(s,s+16),a);return e}decryptAvcSample(e,t,r,s,a){const o=_Z(a.data),l=this.getAvcEncryptedData(o);this.decryptBuffer(l.buffer).then(c=>{a.data=this.getAvcDecryptedUnit(o,c),this.decrypter.isSync()||this.decryptAvcSamples(e,t,r+1,s)}).catch(s)}decryptAvcSamples(e,t,r,s){if(e instanceof Uint8Array)throw new Error("Cannot decrypt samples of type Uint8Array");for(;;t++,r=0){if(t>=e.length){s();return}const a=e[t].units;for(;!(r>=a.length);r++){const o=a[r];if(!(o.data.length<=48||o.type!==1&&o.type!==5)&&(this.decryptAvcSample(e,t,r,s,o),!this.decrypter.isSync()))return}}}}class bee{constructor(){this.VideoSample=null}createVideoSample(e,t,r){return{key:e,frame:!1,pts:t,dts:r,units:[],length:0}}getLastNalUnit(e){var t;let r=this.VideoSample,s;if((!r||r.units.length===0)&&(r=e[e.length-1]),(t=r)!=null&&t.units){const a=r.units;s=a[a.length-1]}return s}pushAccessUnit(e,t){if(e.units.length&&e.frame){if(e.pts===void 0){const r=t.samples,s=r.length;if(s){const a=r[s-1];e.pts=a.pts,e.dts=a.dts}else{t.dropped++;return}}t.samples.push(e)}}parseNALu(e,t,r){const s=t.byteLength;let a=e.naluState||0;const o=a,l=[];let c=0,d,h,m,p=-1,x=0;for(a===-1&&(p=0,x=this.getNALuType(t,0),a=0,c=1);c<s;){if(d=t[c++],!a){a=d?0:1;continue}if(a===1){a=d?0:2;continue}if(!d)a=3;else if(d===1){if(h=c-a-1,p>=0){const y={data:t.subarray(p,h),type:x};l.push(y)}else{const y=this.getLastNalUnit(e.samples);y&&(o&&c<=4-o&&y.state&&(y.data=y.data.subarray(0,y.data.byteLength-o)),h>0&&(y.data=ol(y.data,t.subarray(0,h)),y.state=0))}c<s?(m=this.getNALuType(t,c),p=c,x=m,a=0):a=-1}else a=0}if(p>=0&&a>=0){const y={data:t.subarray(p,s),type:x,state:a};l.push(y)}if(l.length===0){const y=this.getLastNalUnit(e.samples);y&&(y.data=ol(y.data,t))}return e.naluState=a,l}}class Jb{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,t=this.bytesAvailable,r=e.byteLength-t,s=new Uint8Array(4),a=Math.min(4,t);if(a===0)throw new Error("no bytes available");s.set(e.subarray(r,r+a)),this.word=new DataView(s.buffer).getUint32(0),this.bitsAvailable=a*8,this.bytesAvailable-=a}skipBits(e){let t;e=Math.min(e,this.bytesAvailable*8+this.bitsAvailable),this.bitsAvailable>
vendor: 4,209 bytes, line 4732
4732e?(this.word<<=e,this.bitsAvailable-=e):(e-=this.bitsAvailable,t=e>>3,e-=t<<3,this.bytesAvailable-=t,this.loadWord(),this.word<<=e,this.bitsAvailable-=e)}readBits(e){let t=Math.min(this.bitsAvailable,e);const r=this.word>>>32-t;if(e>32&&Kn.error("Cannot read more than 32 bits at a time"),this.bitsAvailable-=t,this.bitsAvailable>0)this.word<<=t;else if(this.bytesAvailable>0)this.loadWord();else throw new Error("no bits available");return t=e-t,t>0&&this.bitsAvailable?r<<t|this.readBits(t):r}skipLZ(){let e;for(e=0;e<this.bitsAvailable;++e)if((this.word&2147483648>>>e)!==0)return this.word<<=e,this.bitsAvailable-=e,e;return this.loadWord(),e+this.skipLZ()}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 c3e extends bee{parsePES(e,t,r,s){const a=this.parseNALu(e,r.data,s);let o=this.VideoSample,l,c=!1;r.data=null,o&&a.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),a.forEach(d=>{var h,m;switch(d.type){case 1:{let v=!1;l=!0;const B=d.data;if(c&&B.length>4){const E=this.readSliceType(B);(E===2||E===4||E===7||E===9)&&(v=!0)}if(v){var p;(p=o)!=null&&p.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),o.frame=!0,o.key=v;break}case 5:l=!0,(h=o)!=null&&h.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),o.key=!0,o.frame=!0;break;case 6:{l=!0,FP(d.data,1,r.pts,t.samples);break}case 7:{var x,y;l=!0,c=!0;const v=d.data,B=this.readSPS(v);if(!e.sps||e.width!==B.width||e.height!==B.height||((x=e.pixelRatio)==null?void 0:x[0])!==B.pixelRatio[0]||((y=e.pixelRatio)==null?void 0:y[1])!==B.pixelRatio[1]){e.width=B.width,e.height=B.height,e.pixelRatio=B.pixelRatio,e.sps=[v];const E=v.subarray(1,4);let N="avc1.";for(let T=0;T<3;T++){let k=E[T].toString(16);k.length<2&&(k="0"+k),N+=k}e.codec=N}break}case 8:l=!0,e.pps=[d.data];break;case 9:l=!0,e.audFound=!0,(m=o)!=null&&m.frame&&(this.pushAccessUnit(o,e),o=null),o||(o=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;case 12:l=!0;break;default:l=!1;break}o&&l&&o.units.push(d)}),s&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}getNALuType(e,t){return e[t]&31}readSliceType(e){const t=new Jb(e);return t.readUByte(),t.readUEG(),t.readUEG()}skipScalingList(e,t){let r=8,s=8,a;for(let o=0;o<e;o++)s!==0&&(a=t.readEG(),s=(r+a+256)%256),r=s===0?r:s}readSPS(e){const t=new Jb(e);let r=0,s=0,a=0,o=0,l,c,d;const h=t.readUByte.bind(t),m=t.readBits.bind(t),p=t.readUEG.bind(t),x=t.readBoolean.bind(t),y=t.skipBits.bind(t),v=t.skipEG.bind(t),B=t.skipUEG.bind(t),E=this.skipScalingList.bind(this);h();const N=h();if(m(5),y(3),h(),B(),N===100||N===110||N===122||N===244||N===44||N===83||N===86||N===118||N===128){const I=p();if(I===3&&y(1),B(),B(),y(1),x())for(c=I!==3?8:12,d=0;d<c;d++)x()&&(d<6?E(16,t):E(64,t))}B();const T=p();if(T===0)p();else if(T===1)for(y(1),v(),v(),l=p(),d=0;d<l;d++)v();B(),y(1);const k=p(),P=p(),R=m(1);R===0&&y(1),y(1),x()&&(r=p(),s=p(),a=p(),o=p());let _=[1,1];if(x()&&x())switch(h()){case 1:_=[1,1];break;case 2:_=[12,11];break;case 3:_=[10,11];break;case 4:_=[16,11];break;case 5:_=[40,33];break;case 6:_=[24,11];break;case 7:_=[20,11];break;case 8:_=[32,11];break;case 9:_=[80,33];break;case 10:_=[18,11];break;case 11:_=[15,11];break;case 12:_=[64,33];break;case 13:_=[160,99];break;case 14:_=[4,3];break;case 15:_=[3,2];break;case 16:_=[2,1];break;case 255:{_=[h()<<8|h(),h()<<8|h()];break}}return{width:Math.ceil((k+1)*16-r*2-s*2),height:(2-R)*(P+1)*16-(R?2:4)*(a+o),pixelRatio:_}}}class d3e extends bee{constructor(...e){super(...e),this.initVPS=null}parsePES(e,t,r,s){const a=this.parseNALu(e,r.data,s);let o=this.VideoSample,l,c=!1;r.data=null,o&&a.length&&!e.audFound&&(this.pushAccessUnit(o,e),o=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),a.forEach(d=>{var h,m;
vendor: 15,533 bytes, line 4732
4732switch(d.type){case 0:case 1:case 2:case 3:case 4:case 5:case 6:case 7:case 8:case 9:o||(o=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts)),o.frame=!0,l=!0;break;case 16:case 17:case 18:case 21:if(l=!0,c){var p;(p=o)!=null&&p.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null)}o||(o=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),o.key=!0,o.frame=!0;break;case 19:case 20:l=!0,(h=o)!=null&&h.frame&&!o.key&&(this.pushAccessUnit(o,e),o=this.VideoSample=null),o||(o=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),o.key=!0,o.frame=!0;break;case 39:l=!0,FP(d.data,2,r.pts,t.samples);break;case 32:l=!0,e.vps||(typeof e.params!="object"&&(e.params={}),e.params=sr(e.params,this.readVPS(d.data)),this.initVPS=d.data),e.vps=[d.data];break;case 33:if(l=!0,c=!0,e.vps!==void 0&&e.vps[0]!==this.initVPS&&e.sps!==void 0&&!this.matchSPS(e.sps[0],d.data)&&(this.initVPS=e.vps[0],e.sps=e.pps=void 0),!e.sps){const x=this.readSPS(d.data);e.width=x.width,e.height=x.height,e.pixelRatio=x.pixelRatio,e.codec=x.codecString,e.sps=[],typeof e.params!="object"&&(e.params={});for(const y in x.params)e.params[y]=x.params[y]}this.pushParameterSet(e.sps,d.data,e.vps),o||(o=this.VideoSample=this.createVideoSample(!0,r.pts,r.dts)),o.key=!0;break;case 34:if(l=!0,typeof e.params=="object"){if(!e.pps){e.pps=[];const x=this.readPPS(d.data);for(const y in x)e.params[y]=x[y]}this.pushParameterSet(e.pps,d.data,e.vps)}break;case 35:l=!0,e.audFound=!0,(m=o)!=null&&m.frame&&(this.pushAccessUnit(o,e),o=null),o||(o=this.VideoSample=this.createVideoSample(!1,r.pts,r.dts));break;default:l=!1;break}o&&l&&o.units.push(d)}),s&&o&&(this.pushAccessUnit(o,e),this.VideoSample=null)}pushParameterSet(e,t,r){(r&&r[0]===this.initVPS||!r&&!e.length)&&e.push(t)}getNALuType(e,t){return(e[t]&126)>>>1}ebsp2rbsp(e){const t=new Uint8Array(e.byteLength);let r=0;for(let s=0;s<e.byteLength;s++)s>=2&&e[s]===3&&e[s-1]===0&&e[s-2]===0||(t[r]=e[s],r++);return new Uint8Array(t.buffer,0,r)}pushAccessUnit(e,t){super.pushAccessUnit(e,t),this.initVPS&&(this.initVPS=null)}readVPS(e){const t=new Jb(e);t.readUByte(),t.readUByte(),t.readBits(4),t.skipBits(2),t.readBits(6);const r=t.readBits(3),s=t.readBoolean();return{numTemporalLayers:r+1,temporalIdNested:s}}readSPS(e){const t=new Jb(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.readBits(4);const r=t.readBits(3);t.readBoolean();const s=t.readBits(2),a=t.readBoolean(),o=t.readBits(5),l=t.readUByte(),c=t.readUByte(),d=t.readUByte(),h=t.readUByte(),m=t.readUByte(),p=t.readUByte(),x=t.readUByte(),y=t.readUByte(),v=t.readUByte(),B=t.readUByte(),E=t.readUByte(),N=[],T=[];for(let je=0;je<r;je++)N.push(t.readBoolean()),T.push(t.readBoolean());if(r>0)for(let je=r;je<8;je++)t.readBits(2);for(let je=0;je<r;je++)N[je]&&(t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte(),t.readUByte()),T[je]&&t.readUByte();t.readUEG();const k=t.readUEG();k==3&&t.skipBits(1);const P=t.readUEG(),R=t.readUEG(),_=t.readBoolean();let I=0,D=0,j=0,O=0;_&&(I+=t.readUEG(),D+=t.readUEG(),j+=t.readUEG(),O+=t.readUEG());const M=t.readUEG(),U=t.readUEG(),ee=t.readUEG(),ie=t.readBoolean();for(let je=ie?0:r;je<=r;je++)t.skipUEG(),t.skipUEG(),t.skipUEG();if(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG(),t.readBoolean()&&t.readBoolean())for(let nt=0;nt<4;nt++)for(let We=0;We<(nt===3?2:6);We++)if(!t.readBoolean())t.readUEG();else{const bt=Math.min(64,1<<4+(nt<<1));nt>1&&t.readEG();for(let Yt=0;Yt<bt;Yt++)t.readEG()}t.readBoolean(),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.skipUEG(),t.skipUEG(),t.readBoolean());const z=t.readUEG();let se=0;for(let je=0;je<z;je++){let nt=!1;if(je!==0&&(nt=t.readBoolean()),nt){je===z&&t.readUEG(),t.readBoolean(),t.readUEG();let We=0;for(let dt=0;dt<=se;dt++){const bt=t.readBoolean();let Yt=!1;bt||(Yt=t.readBoolean()),(bt||Yt)&&We++}se=We}else{const We=t.readUEG(),dt=t.readUEG();se=We+dt;for(let bt=0;bt<We;bt++)t.readUEG(),t.readBoolean();for(let bt=0;bt<dt;bt++)t.readUEG(),t.readBoolean()}}if(t.readBoolean()){const je=t.readUEG();for(let nt=0;nt<je;nt++){for(let We=0;We<ee+4;We++)t.readBits(1);t.readBits(1)}}let H=0,Y=1,de=1,W=!0,K=1,J=0;t.readBoolean(),t.readBoolean();let oe=!1;if(t.readBoolean()){if(t.readBoolean()){const Gt=t.readUByte(),En=[1,12,10,16,40,24,20,32,80,18,15,64,160,4,3,2],$t=[1,11,11,11,33,11,11,11,33,11,11,33,99,3,2,1];Gt>0&&Gt<16?(Y=En[Gt-1],de=$t[Gt-1]):Gt===255&&(Y=t.readBits(16),de=t.readBits(16))}if(t.readBoolean()&&t.readBoolean(),t.readBoolean()&&(t.readBits(3),t.readBoolean(),t.readBoolean()&&(t.readUByte(),t.readUByte(),t.readUByte())),t.readBoolean()&&(t.readUEG(),t.readUEG()),t.readBoolean(),t.readBoolean(),t.readBoolean(),oe=t.readBoolean(),oe&&(t.skipUEG(),t.skipUEG(),t.skipUEG(),t.skipUEG()),t.readBoolean()&&(K=t.readBits(32),J=t.readBits(32),t.readBoolean()&&t.readUEG(),t.readBoolean())){const $t=t.readBoolean(),ds=t.readBoolean();let sa=!1;($t||ds)&&(sa=t.readBoolean(),sa&&(t.readUByte(),t.readBits(5),t.readBoolean(),t.readBits(5)),t.readBits(4),t.readBits(4),sa&&t.readBits(4),t.readBits(5),t.readBits(5),t.readBits(5));for(let Fa=0;Fa<=r;Fa++){W=t.readBoolean();const Mr=W||t.readBoolean();let es=!1;Mr?t.readEG():es=t.readBoolean();const us=es?1:t.readUEG()+1;if($t)for(let Vs=0;Vs<us;Vs++)t.readUEG(),t.readUEG(),sa&&(t.readUEG(),t.readUEG()),t.skipBits(1);if(ds)for(let Vs=0;Vs<us;Vs++)t.readUEG(),t.readUEG(),sa&&(t.readUEG(),t.readUEG()),t.skipBits(1)}}t.readBoolean()&&(t.readBoolean(),t.readBoolean(),t.readBoolean(),H=t.readUEG())}let pe=P,ye=R;if(_){let je=1,nt=1;k===1?je=nt=2:k==2&&(je=2),pe=P-je*D-je*I,ye=R-nt*O-nt*j}const he=s?["A","B","C"][s]:"",le=l<<24|c<<16|d<<8|h;let ce=0;for(let je=0;je<32;je++)ce=(ce|(le>>je&1)<<31-je)>>>0;let Ce=ce.toString(16);return o===1&&Ce==="2"&&(Ce="6"),{codecString:`hvc1.${he}${o}.${Ce}.${a?"H":"L"}${E}.B0`,params:{general_tier_flag:a,general_profile_idc:o,general_profile_space:s,general_profile_compatibility_flags:[l,c,d,h],general_constraint_indicator_flags:[m,p,x,y,v,B],general_level_idc:E,bit_depth:M+8,bit_depth_luma_minus8:M,bit_depth_chroma_minus8:U,min_spatial_segmentation_idc:H,chroma_format_idc:k,frame_rate:{fixed:W,fps:J/K}},width:pe,height:ye,pixelRatio:[Y,de]}}readPPS(e){const t=new Jb(this.ebsp2rbsp(e));t.readUByte(),t.readUByte(),t.skipUEG(),t.skipUEG(),t.skipBits(2),t.skipBits(3),t.skipBits(2),t.skipUEG(),t.skipUEG(),t.skipEG(),t.skipBits(2),t.readBoolean()&&t.skipUEG(),t.skipEG(),t.skipEG(),t.skipBits(4);const s=t.readBoolean(),a=t.readBoolean();let o=1;return a&&s?o=0:a?o=3:s&&(o=2),{parallelismType:o}}matchSPS(e,t){return String.fromCharCode.apply(null,e).substr(3)===String.fromCharCode.apply(null,t).substr(3)}}const la=188;class eh{constructor(e,t,r,s){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=t,this.typeSupported=r,this.logger=s,this.videoParser=null}static probe(e,t){const r=eh.syncOffset(e);return r>0&&t.warn(`MPEG2-TS detected but first sync word found @ offset ${r}`),r!==-1}static syncOffset(e){const t=e.length;let r=Math.min(la*5,t-la)+1,s=0;for(;s<r;){let a=!1,o=-1,l=0;for(let c=s;c<t;c+=la)if(e[c]===71&&(t-c===la||e[c+la]===71)){if(l++,o===-1&&(o=c,o!==0&&(r=Math.min(o+la*99,e.length-la)+1)),a||(a=xD(e,c)===0),a&&l>1&&(o===0&&l>2||c+la>r))return o}else{if(l)return-1;break}s++}return-1}static createTrack(e,t){return{container:e==="video"||e==="audio"?"video/mp2t":void 0,type:e,id:EZ[e],pid:-1,inputTimeScale:9e4,sequenceNumber:0,samples:[],dropped:0,duration:e==="audio"?t:void 0}}resetInitSegment(e,t,r,s){this.pmtParsed=!1,this._pmtId=-1,this._videoTrack=eh.createTrack("video"),this._videoTrack.duration=s,this._audioTrack=eh.createTrack("audio",s),this._id3Track=eh.createTrack("id3"),this._txtTrack=eh.createTrack("text"),this._audioTrack.segmentCodec="aac",this.videoParser=null,this.aacOverFlow=null,this.remainderData=null,this.audioCodec=t,this.videoCodec=r}resetTimeStamp(){}resetContiguity(){const{_audioTrack:e,_videoTrack:t,_id3Track:r}=this;e&&(e.pesData=null),t&&(t.pesData=null),r&&(r.pesData=null),this.aacOverFlow=null,this.remainderData=null}demux(e,t,r=!1,s=!1){r||(this.sampleAes=null);let a;const o=this._videoTrack,l=this._audioTrack,c=this._id3Track,d=this._txtTrack;let h=o.pid,m=o.pesData,p=l.pid,x=c.pid,y=l.pesData,v=c.pesData,B=null,E=this.pmtParsed,N=this._pmtId,T=e.length;if(this.remainderData&&(e=ol(this.remainderData,e),T=e.length,this.remainderData=null),T<la&&!s)return this.remainderData=e,{audioTrack:l,videoTrack:o,id3Track:c,textTrack:d};const k=Math.max(0,eh.syncOffset(e));T-=(T-k)%la,T<e.byteLength&&!s&&(this.remainderData=new Uint8Array(e.buffer,T,e.buffer.byteLength-T));let P=0;for(let _=k;_<T;_+=la)if(e[_]===71){const I=!!(e[_+1]&64),D=xD(e,_),j=(e[_+3]&48)>>4;let O;if(j>1){if(O=_+5+e[_+4],O===_+la)continue}else O=_+4;switch(D){case h:I&&(m&&(a=t0(m,this.logger))&&(this.readyVideoParser(o.segmentCodec),this.videoParser!==null&&this.videoParser.parsePES(o,d,a,!1)),m={data:[],size:0}),m&&(m.data.push(e.subarray(O,_+la)),m.size+=_+la-O);break;case p:if(I){if(y&&(a=t0(y,this.logger)))switch(l.segmentCodec){case"aac":this.parseAACPES(l,a);break;case"mp3":this.parseMPEGPES(l,a);break;case"ac3":this.parseAC3PES(l,a);break}y={data:[],size:0}}y&&(y.data.push(e.subarray(O,_+la)),y.size+=_+la-O);break;case x:I&&(v&&(a=t0(v,this.logger))&&this.parseID3PES(c,a),v={data:[],size:0}),v&&(v.data.push(e.subarray(O,_+la)),v.size+=_+la-O);break;case 0:I&&(O+=e[O]+1),N=this._pmtId=u3e(e,O);break;case N:{I&&(O+=e[O]+1);const M=h3e(e,O,this.typeSupported,r,this.observer,this.logger);h=M.videoPid,h>0&&(o.pid=h,o.segmentCodec=M.segmentVideoCodec),p=M.audioPid,p>0&&(l.pid=p,l.segmentCodec=M.segmentAudioCodec),x=M.id3Pid,x>0&&(c.pid=x),B!==null&&!E&&(this.logger.warn(`MPEG-TS PMT found at ${_} after unknown PID '${B}'. Backtracking to sync byte @${k} to parse all TS packets.`),B=null,_=k-188),E=this.pmtParsed=!0;break}case 17:case 8191:break;default:B=D;break}}else P++;P>0&&bD(this.observer,new Error(`Found ${P} TS packet/s that do not start with 0x47`),void 0,this.logger),o.pesData=m,l.pesData=y,c.pesData=v;const R={audioTrack:l,videoTrack:o,id3Track:c,textTrack:d};return s&&this.extractRemainingSamples(R),R}flush(){const{remainderData:e}=this;this.remainderData=null;let t;return e?t=this.demux(e,-1,!1,!0):t={videoTrack:this._videoTrack,audioTrack:this._audioTrack,id3Track:this._id3Track,textTrack:this._txtTrack},this.extractRemainingSamples(t),this.sampleAes?this.decrypt(t,this.sampleAes):t}extractRemainingSamples(e){const{audioTrack:t,videoTrack:r,id3Track:s,textTrack:a}=e,o=r.pesData,l=t.pesData,c=s.pesData;let d;if(o&&(d=t0(o,this.logger))?(this.readyVideoParser(r.segmentCodec),this.videoParser!==null&&(this.videoParser.parsePES(r,a,d,!0),r.pesData=null)):r.pesData=o,l&&(d=t0(l,this.logger))){switch(t.segmentCodec){case"aac":this.parseAACPES(t,d);break;case"mp3":this.parseMPEGPES(t,d);break;case"ac3":this.parseAC3PES(t,d);break}t.pesData=null}else l!=null&&l.size&&this.logger.log("last AAC PES packet truncated,might overlap between fragments"),t.pesData=l;c&&(d=t0(c,this.logger))?(this.parseID3PES(s,d),s.pesData=null):s.pesData=c}demuxSampleAes(e,t,r){const s=this.demux(e,r,!0,!this.config.progressive),a=this.sampleAes=new l3e(this.observer,this.config,t);return this.decrypt(s,a)}readyVideoParser(e){this.videoParser===null&&(e==="avc"?this.videoParser=new c3e:e==="hevc"&&(this.videoParser=new d3e))}decrypt(e,t){return new Promise(r=>{const{audioTrack:s,videoTrack:a}=e;s.samples&&s.segmentCodec==="aac"?t.decryptAacSamples(s.samples,0,()=>{a.samples?t.decryptAvcSamples(a.samples,0,0,()=>{r(e)}):r(e)}):a.samples&&t.decryptAvcSamples(a.samples,0,0,()=>{r(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,t){let r=0;const s=this.aacOverFlow;let a=t.data;if(s){this.aacOverFlow=null;const m=s.missing,p=s.sample.unit.byteLength;if(m===-1)a=ol(s.sample.unit,a);else{const x=p-m;s.sample.unit.set(a.subarray(0,m),x),e.samples.push(s.sample),r=s.missing}}let o,l;for(o=r,l=a.length;o<l-1&&!B1(a,o);o++);if(o!==r){let m;const p=o<l-1;if(p?m=`AAC PES did not start with ADTS header,offset:${o}`:m="No ADTS header found in AAC PES",bD(this.observer,new Error(m),p,this.logger),!p)return}oee(e,this.observer,a,o,this.audioCodec);let c;if(t.pts!==void 0)c=t.pts;else if(s){const m=lee(e.samplerate);c=s.sample.pts+m}else{this.logger.warn("[tsdemuxer]: AAC PES unknown PTS");return}let d=0,h;for(;o<l;)if(h=cee(e,a,o,c,d),o+=h.length,h.missing){this.aacOverFlow=h;break}else for(d++;o<l-1&&!B1(a,o);o++);}parseMPEGPES(e,t){const r=t.data,s=r.length;let a=0,o=0;const l=t.pts;if(l===void 0){this.logger.warn("[tsdemuxer]: MPEG PES unknown PTS");return}for(;o<s;)if(mee(r,o)){const c=hee(e,r,o,l,a);if(c)o+=c.length,a++;else break}else o++}parseAC3PES(e,t){{const r=t.data,s=t.pts;if(s===void 0){this.logger.warn("[tsdemuxer]: AC3 PES unknown PTS");return}const a=r.length;let o=0,l=0,c;for(;l<a&&(c=xee(e,r,l,s,o++))>0;)l+=c}}parseID3PES(e,t){if(t.pts===void 0){this.logger.warn("[tsdemuxer]: ID3 PES unknown PTS");return}const r=sr({},t,{type:this._videoTrack?go.emsg:go.audioId3,duration:Number.POSITIVE_INFINITY});e.samples.push(r)}}function xD(n,e){return((n[e+1]&31)<<8)+n[e+2]}function u3e(n,e){return(n[e+10]&31)<<8|n[e+11]}function h3e(n,e,t,r,s,a){const o={audioPid:-1,videoPid:-1,id3Pid:-1,segmentVideoCodec:"avc",segmentAudioCodec:"aac"},l=(n[e+1]&15)<<8|n[e+2],c=e+3+l-4,d=(n[e+10]&15)<<8|n[e+11];for(e+=12+d;e<c;){const h=xD(n,e),m=(n[e+3]&15)<<8|n[e+4];switch(n[e]){case 207:if(!r){VN("ADTS AAC",a);break}case 15:o.audioPid===-1&&(o.audioPid=h);break;case 21:o.id3Pid===-1&&(o.id3Pid=h);break;case 219:if(!r){VN("H.264",a);break}case 27:o.videoPid===-1&&(o.videoPid=h);break;case 3:case 4:!t.mpeg&&!t.mp3?a.log("MPEG audio found, not supported in this browser"):o.audioPid===-1&&(o.audioPid=h,o.segmentAudioCodec="mp3");break;case 193:if(!r){VN("AC-3",a);break}case 129:t.ac3?o.audioPid===-1&&(o.audioPid=h,o.segmentAudioCodec="ac3"):a.log("AC-3 audio found, not supported in this browser");break;case 6:if(o.audioPid===-1&&m>0){let p=e+5,x=m;for(;x>2;){switch(n[p]){case 106:t.ac3!==!0?a.log("AC-3 audio found, not supported in this browser for now"):(o.audioPid=h,o.segmentAudioCodec="ac3");break}const v=n[p+1]+2;p+=v,x-=v}}break;case 194:case 135:return bD(s,new Error("Unsupported EC-3 in M2TS found"),void 0,a),o;case 36:o.videoPid===-1&&(o.videoPid=h,o.segmentVideoCodec="hevc",a.log("HEVC in M2TS found"));break}e+=m+5}return o}function bD(n,e,t,r){r.warn(`parsing error: ${e.message}`),n.emit(V.ERROR,V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_PARSING_ERROR,fatal:!1,levelRetry:t,error:e,reason:e.message})}function VN(n,e){e.log(`${n} with AES-128-CBC encryption found in unencrypted stream`)}function t0(n,e){let t=0,r,s,a,o,l;const c=n.data;if(!n||n.size===0)return null;for(;c[0].length<19&&c.length>1;)c[0]=ol(c[0],c[1]),c.splice(1,1);if(r=c[0],(r[0]<<16)+(r[1]<<8)+r[2]===1){if(s=(r[4]<<8)+r[5],s&&s>n.size-6)return null;const h=r[7];
vendor: 7,120 bytes, line 4732
4732h&192&&(o=(r[9]&14)*536870912+(r[10]&255)*4194304+(r[11]&254)*16384+(r[12]&255)*128+(r[13]&254)/2,h&64?(l=(r[14]&14)*536870912+(r[15]&255)*4194304+(r[16]&254)*16384+(r[17]&255)*128+(r[18]&254)/2,o-l>60*9e4&&(e.warn(`${Math.round((o-l)/9e4)}s delta between PTS and DTS, align them`),o=l)):l=o),a=r[8];let m=a+9;if(n.size<=m)return null;n.size-=m;const p=new Uint8Array(n.size);for(let x=0,y=c.length;x<y;x++){r=c[x];let v=r.byteLength;if(m)if(m>v){m-=v;continue}else r=r.subarray(m),v-=m,m=0;p.set(r,t),t+=v}return s&&(s-=a+3),{data:p,pts:o,dts:l,len:s}}return null}class f3e{static getSilentFrame(e,t){switch(e){case"mp4a.40.2":if(t===1)return new Uint8Array([0,200,0,128,35,128]);if(t===2)return new Uint8Array([33,0,73,144,2,25,0,35,128]);if(t===3)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,142]);if(t===4)return new Uint8Array([0,200,0,128,32,132,1,38,64,8,100,0,128,44,128,8,2,56]);if(t===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(t===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(t===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(t===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(t===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 we{static init(){we.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 we.types)we.types.hasOwnProperty(e)&&(we.types[e]=[e.charCodeAt(0),e.charCodeAt(1),e.charCodeAt(2),e.charCodeAt(3)]);const t=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]),r=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]);we.HDLR_TYPES={video:t,audio:r};const s=new Uint8Array([0,0,0,0,0,0,0,1,0,0,0,12,117,114,108,32,0,0,0,1]),a=new Uint8Array([0,0,0,0,0,0,0,0]);we.STTS=we.STSC=we.STCO=a,we.STSZ=new Uint8Array([0,0,0,0,0,0,0,0,0,0,0,0]),we.VMHD=new Uint8Array([0,0,0,1,0,0,0,0,0,0,0,0]),we.SMHD=new Uint8Array([0,0,0,0,0,0,0,0]),we.STSD=new Uint8Array([0,0,0,0,0,0,0,1]);const o=new Uint8Array([105,115,111,109]),l=new Uint8Array([97,118,99,49]),c=new Uint8Array([0,0,0,1]);we.FTYP=we.box(we.types.ftyp,o,c,o,l),we.DINF=we.box(we.types.dinf,we.box(we.types.dref,s))}static box(e,...t){let r=8,s=t.length;const a=s;for(;s--;)r+=t[s].byteLength;const o=new Uint8Array(r);for(o[0]=r>>24&255,o[1]=r>>16&255,o[2]=r>>8&255,o[3]=r&255,o.set(e,4),s=0,r=8;s<a;s++)o.set(t[s],r),r+=t[s].byteLength;return o}static hdlr(e){return we.box(we.types.hdlr,we.HDLR_TYPES[e])}static mdat(e){return we.box(we.types.mdat,e)}static mdhd(e,t){t*=e;const r=Math.floor(t/(zu+1)),s=Math.floor(t%(zu+1));return we.box(we.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,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&255,85,196,0,0]))}static mdia(e){return we.box(we.types.mdia,we.mdhd(e.timescale||0,e.duration||0),we.hdlr(e.type),we.minf(e))}static mfhd(e){return we.box(we.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"?we.box(we.types.minf,we.box(we.types.smhd,we.SMHD),we.DINF,we.stbl(e)):we.box(we.types.minf,we.box(we.types.vmhd,we.VMHD),we.DINF,we.stbl(e))}static moof(e,t,r){return we.box(we.types.moof,we.mfhd(e),we.traf(r,t))}static moov(e){let t=e.length;const r=[];for(;t--;)r[t]=we.trak(e[t]);return we.box.apply(null,[we.types.moov,we.mvhd(e[0].timescale||0,e[0].duration||0)].concat(r).concat(we.mvex(e)))}static mvex(e){let t=e.length;const r=[];for(;t--;)r[t]=we.trex(e[t]);return we.box.apply(null,[we.types.mvex,...r])}static mvhd(e,t){t*=e;const r=Math.floor(t/(zu+1)),s=Math.floor(t%(zu+1)),a=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,r>>24,r>>16&255,r>>8&255,r&255,s>>24,s>>16&255,s>>8&255,s&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 we.box(we.types.mvhd,a)}static sdtp(e){const t=e.samples||[],r=new Uint8Array(4+t.length);let s,a;for(s=0;s<t.length;s++)a=t[s].flags,r[s+4]=a.dependsOn<<4|a.isDependedOn<<2|a.hasRedundancy;return we.box(we.types.sdtp,r)}static stbl(e){return we.box(we.types.stbl,we.stsd(e),we.box(we.types.stts,we.STTS),we.box(we.types.stsc,we.STSC),we.box(we.types.stsz,we.STSZ),we.box(we.types.stco,we.STCO))}static avc1(e){let t=[],r=[],s,a,o;for(s=0;s<e.sps.length;s++)a=e.sps[s],o=a.byteLength,t.push(o>>>8&255),t.push(o&255),t=t.concat(Array.prototype.slice.call(a));for(s=0;s<e.pps.length;s++)a=e.pps[s],o=a.byteLength,r.push(o>>>8&255),r.push(o&255),r=r.concat(Array.prototype.slice.call(a));const l=we.box(we.types.avcC,new Uint8Array([1,t[3],t[4],t[5],255,224|e.sps.length].concat(t).concat([e.pps.length]).concat(r))),c=e.width,d=e.height,h=e.pixelRatio[0],m=e.pixelRatio[1];return we.box(we.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,c>>8&255,c&255,d>>8&255,d&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]),l,we.box(we.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),we.box(we.types.pasp,new Uint8Array([h>>24,h>>16&255,h>>8&255,h&255,m>>24,m>>16&255,m>>8&255,m&255])))}static esds(e){const t=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,...t,6,1,2])}static audioStsd(e){const t=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,t>>8&255,t&255,0,0])}static mp4a(e){return we.box(we.types.mp4a,we.audioStsd(e),we.box(we.types.esds,we.esds(e)))}static mp3(e){return we.box(we.types[".mp3"],we.audioStsd(e))}static ac3(e){return we.box(we.types["ac-3"],we.audioStsd(e),we.box(we.types.dac3,e.config))}static stsd(e){const{segmentCodec:t}=e;if(e.type==="audio"){if(t==="aac")return we.box(we.types.stsd,we.STSD,we.mp4a(e));if(t==="ac3"&&e.config)return we.box(we.types.stsd,we.STSD,we.ac3(e));if(t==="mp3"&&e.codec==="mp3")return we.box(we.types.stsd,we.STSD,we.mp3(e))}else if(e.pps&&e.sps){if(t==="avc")return we.box(we.types.stsd,we.STSD,we.avc1(e));if(t==="hevc"&&e.vps)return we.box(we.types.stsd,we.STSD,we.hvc1(e))}
vendor: 3,633 bytes, line 4732
4732else throw new Error("video track missing pps or sps");throw new Error(`unsupported ${e.type} segment codec (${t}/${e.codec})`)}static tkhd(e){const t=e.id,r=(e.duration||0)*(e.timescale||0),s=e.width||0,a=e.height||0,o=Math.floor(r/(zu+1)),l=Math.floor(r%(zu+1));return we.box(we.types.tkhd,new Uint8Array([1,0,0,7,0,0,0,0,0,0,0,2,0,0,0,0,0,0,0,3,t>>24&255,t>>16&255,t>>8&255,t&255,0,0,0,0,o>>24,o>>16&255,o>>8&255,o&255,l>>24,l>>16&255,l>>8&255,l&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,s>>8&255,s&255,0,0,a>>8&255,a&255,0,0]))}static traf(e,t){const r=we.sdtp(e),s=e.id,a=Math.floor(t/(zu+1)),o=Math.floor(t%(zu+1));return we.box(we.types.traf,we.box(we.types.tfhd,new Uint8Array([0,0,0,0,s>>24,s>>16&255,s>>8&255,s&255])),we.box(we.types.tfdt,new Uint8Array([1,0,0,0,a>>24,a>>16&255,a>>8&255,a&255,o>>24,o>>16&255,o>>8&255,o&255])),we.trun(e,r.length+16+20+8+16+8+8),r)}static trak(e){return e.duration=e.duration||4294967295,we.box(we.types.trak,we.tkhd(e),we.mdia(e))}static trex(e){const t=e.id;return we.box(we.types.trex,new Uint8Array([0,0,0,0,t>>24,t>>16&255,t>>8&255,t&255,0,0,0,1,0,0,0,0,0,0,0,0,0,1,0,1]))}static trun(e,t){const r=e.samples||[],s=r.length,a=12+16*s,o=new Uint8Array(a);let l,c,d,h,m,p;for(t+=8+a,o.set([e.type==="video"?1:0,0,15,1,s>>>24&255,s>>>16&255,s>>>8&255,s&255,t>>>24&255,t>>>16&255,t>>>8&255,t&255],0),l=0;l<s;l++)c=r[l],d=c.duration,h=c.size,m=c.flags,p=c.cts,o.set([d>>>24&255,d>>>16&255,d>>>8&255,d&255,h>>>24&255,h>>>16&255,h>>>8&255,h&255,m.isLeading<<2|m.dependsOn,m.isDependedOn<<6|m.hasRedundancy<<4|m.paddingValue<<1|m.isNonSync,m.degradPrio&61440,m.degradPrio&15,p>>>24&255,p>>>16&255,p>>>8&255,p&255],12+16*l);return we.box(we.types.trun,o)}static initSegment(e){we.types||we.init();const t=we.moov(e);return ol(we.FTYP,t)}static hvc1(e){const t=e.params,r=[e.vps,e.sps,e.pps],s=4,a=new Uint8Array([1,t.general_profile_space<<6|(t.general_tier_flag?32:0)|t.general_profile_idc,t.general_profile_compatibility_flags[0],t.general_profile_compatibility_flags[1],t.general_profile_compatibility_flags[2],t.general_profile_compatibility_flags[3],t.general_constraint_indicator_flags[0],t.general_constraint_indicator_flags[1],t.general_constraint_indicator_flags[2],t.general_constraint_indicator_flags[3],t.general_constraint_indicator_flags[4],t.general_constraint_indicator_flags[5],t.general_level_idc,240|t.min_spatial_segmentation_idc>>8,255&t.min_spatial_segmentation_idc,252|t.parallelismType,252|t.chroma_format_idc,248|t.bit_depth_luma_minus8,248|t.bit_depth_chroma_minus8,0,parseInt(t.frame_rate.fps),s-1|t.temporal_id_nested<<2|t.num_temporal_layers<<3|(t.frame_rate.fixed?64:0),r.length]);let o=a.length;for(let y=0;y<r.length;y+=1){o+=3;for(let v=0;v<r[y].length;v+=1)o+=2+r[y][v].length}const l=new Uint8Array(o);l.set(a,0),o=a.length;const c=r.length-1;for(let y=0;y<r.length;y+=1){l.set(new Uint8Array([32+y|(y===c?128:0),0,r[y].length]),o),o+=3;for(let v=0;v<r[y].length;v+=1)l.set(new Uint8Array([r[y][v].length>>8,r[y][v].length&255]),o),o+=2,l.set(r[y][v],o),o+=r[y][v].length}const d=we.box(we.types.hvcC,l),h=e.width,m=e.height,p=e.pixelRatio[0],x=e.pixelRatio[1];return we.box(we.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,h>>8&255,h&255,m>>8&255,m&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]),d,we.box(we.types.btrt,new Uint8Array([0,28,156,128,0,45,198,192,0,45,198,192])),we.box(we.types.pasp,new Uint8Array([p>>24,p>>16&255,p>>8&255,p&255,x>>24,x>>16&255,x>>
vendor: 16,839 bytes, line 4732
47328&255,x&255])))}}we.types=void 0;we.HDLR_TYPES=void 0;we.STTS=void 0;we.STSC=void 0;we.STCO=void 0;we.STSZ=void 0;we.VMHD=void 0;we.SMHD=void 0;we.STSD=void 0;we.FTYP=void 0;we.DINF=void 0;const yee=9e4;function e5(n,e,t=1,r=!1){const s=n*e*t;return r?Math.round(s):s}function m3e(n,e,t=1,r=!1){return e5(n,e,1/t,r)}function mb(n,e=!1){return e5(n,1e3,1/yee,e)}function p3e(n,e=1){return e5(n,yee,1/e)}function yG(n){const{baseTime:e,timescale:t,trackId:r}=n;return`${e/t} (${e}/${t}) trackId: ${r}`}const g3e=10*1e3,x3e=1024,b3e=1152,y3e=1536;let n0=null,GN=null;function vG(n,e,t,r){return{duration:e,size:t,cts:r,flags:{isLeading:0,isDependedOn:0,hasRedundancy:0,degradPrio:0,dependsOn:n?2:1,isNonSync:n?0:1}}}class _C extends ul{constructor(e,t,r,s){if(super("mp4-remuxer",s),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=t,this.typeSupported=r,this.ISGenerated=!1,n0===null){const o=(navigator.userAgent||"").match(/Chrome\/(\d+)/i);n0=o?parseInt(o[1]):0}if(GN===null){const a=navigator.userAgent.match(/Safari\/(\d+)/i);GN=a?parseInt(a[1]):0}}destroy(){this.config=this.videoTrackConfig=this._initPTS=this._initDTS=null}resetTimeStamp(e){const t=this._initPTS;(!t||!e||e.trackId!==t.trackId||e.baseTime!==t.baseTime||e.timescale!==t.timescale)&&this.log(`Reset initPTS: ${t&&yG(t)} > ${e&&yG(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 t=!1;const r=e[0].pts,s=e.reduce((a,o)=>{let l=o.pts,c=l-a;return c<-4294967296&&(t=!0,l=mo(l,r),c=l-a),c>0?a:l},r);return t&&this.debug("PTS rollover detected"),s}remux(e,t,r,s,a,o,l,c){let d,h,m,p,x,y,v=a,B=a;const E=e.pid>-1,N=t.pid>-1,T=t.samples.length,k=e.samples.length>0,P=l&&T>0||T>1;if((!E||k)&&(!N||P)||this.ISGenerated||l){if(this.ISGenerated){var _,I,D,j;const ee=this.videoTrackConfig;(ee&&(t.width!==ee.width||t.height!==ee.height||((_=t.pixelRatio)==null?void 0:_[0])!==((I=ee.pixelRatio)==null?void 0:I[0])||((D=t.pixelRatio)==null?void 0:D[1])!==((j=ee.pixelRatio)==null?void 0:j[1]))||!ee&&P||this.nextAudioTs===null&&k)&&this.resetInitSegment()}this.ISGenerated||(m=this.generateIS(e,t,a,o));const O=this.isVideoContiguous;let M=-1,U;if(P&&(M=v3e(t.samples),!O&&this.config.forceKeyFrameOnDiscontinuity))if(y=!0,M>0){this.warn(`Dropped ${M} out of ${T} video samples due to a missing keyframe`);const ee=this.getVideoStartPts(t.samples);t.samples=t.samples.slice(M),t.dropped+=M,B+=(t.samples[0].pts-ee)/t.inputTimeScale,U=B}else M===-1&&(this.warn(`No keyframe found out of ${T} video samples`),y=!1);if(this.ISGenerated){if(k&&P){const ee=this.getVideoStartPts(t.samples),G=(mo(e.samples[0].pts,ee)-ee)/t.inputTimeScale;v+=Math.max(0,G),B+=Math.max(0,-G)}if(k){if(e.samplerate||(this.warn("regenerate InitSegment as audio detected"),m=this.generateIS(e,t,a,o)),h=this.remuxAudio(e,v,this.isAudioContiguous,o,N||P||c===mt.AUDIO?B:void 0),P){const ee=h?h.endPTS-h.startPTS:0;t.inputTimeScale||(this.warn("regenerate InitSegment as video detected"),m=this.generateIS(e,t,a,o)),d=this.remuxVideo(t,B,O,ee)}}else P&&(d=this.remuxVideo(t,B,O,0));d&&(d.firstKeyFrame=M,d.independent=M!==-1,d.firstKeyFramePTS=U)}}return this.ISGenerated&&this._initPTS&&this._initDTS&&(r.samples.length&&(x=vee(r,a,this._initPTS,this._initDTS)),s.samples.length&&(p=Bee(s,a,this._initPTS))),{audio:h,video:d,initSegment:m,independent:y,text:p,id3:x}}computeInitPts(e,t,r,s){const a=Math.round(r*t);let o=mo(e,a);if(o<a+t)for(this.log(`Adjusting PTS for rollover in timeline near ${(a-o)/t} ${s}`);o<a+t;)o+=8589934592;return o-a}generateIS(e,t,r,s){const a=e.samples,o=t.samples,l=this.typeSupported,c={},d=this._initPTS;let h=!d||s,m="audio/mp4",p,x,y,v=-1;if(h&&(p=x=1/0),e.config&&a.length){switch(e.timescale=e.samplerate,e.segmentCodec){case"mp3":l.mpeg?(m="audio/mpeg",e.codec=""):l.mp3&&(e.codec="mp3");break;case"ac3":e.codec="ac-3";break}c.audio={id:"audio",container:m,codec:e.codec,initSegment:e.segmentCodec==="mp3"&&l.mpeg?new Uint8Array(0):we.initSegment([e]),metadata:{channelCount:e.channelCount}},h&&(v=e.id,y=e.inputTimeScale,!d||y!==d.timescale?p=x=this.computeInitPts(a[0].pts,y,r,"audio"):h=!1)}if(t.sps&&t.pps&&o.length){if(t.timescale=t.inputTimeScale,c.video={id:"main",container:"video/mp4",codec:t.codec,initSegment:we.initSegment([t]),metadata:{width:t.width,height:t.height}},h)if(v=t.id,y=t.inputTimeScale,!d||y!==d.timescale){const B=this.getVideoStartPts(o),E=mo(o[0].dts,B),N=this.computeInitPts(E,y,r,"video"),T=this.computeInitPts(B,y,r,"video");x=Math.min(x,N),p=Math.min(p,T)}else h=!1;this.videoTrackConfig={width:t.width,height:t.height,pixelRatio:t.pixelRatio}}if(Object.keys(c).length)return this.ISGenerated=!0,h?(d&&this.warn(`Timestamps at playlist time: ${s?"":"~"}${r} ${p/y} != initPTS: ${d.baseTime/d.timescale} (${d.baseTime}/${d.timescale}) trackId: ${d.trackId}`),this.log(`Found initPTS at playlist time: ${r} offset: ${p/y} (${p}/${y}) trackId: ${v}`),this._initPTS={baseTime:p,timescale:y,trackId:v},this._initDTS={baseTime:x,timescale:y,trackId:v}):p=y=void 0,{tracks:c,initPTS:p,timescale:y,trackId:v}}remuxVideo(e,t,r,s){const a=e.inputTimeScale,o=e.samples,l=[],c=o.length,d=this._initPTS,h=d.baseTime*a/d.timescale;let m=this.nextVideoTs,p=8,x=this.videoSampleDuration,y,v,B=Number.POSITIVE_INFINITY,E=Number.NEGATIVE_INFINITY,N=!1;if(!r||m===null){const H=h+t*a,Y=o[0].pts-mo(o[0].dts,o[0].pts);n0&&m!==null&&Math.abs(H-Y-(m+h))<15e3?r=!0:m=H-Y-h}const T=m+h;for(let H=0;H<c;H++){const Y=o[H];Y.pts=mo(Y.pts,T),Y.dts=mo(Y.dts,T),Y.dts<o[H>0?H-1:H].dts&&(N=!0)}N&&o.sort(function(H,Y){const de=H.dts-Y.dts,W=H.pts-Y.pts;return de||W}),y=o[0].dts,v=o[o.length-1].dts;const k=v-y,P=k?Math.round(k/(c-1)):x||e.inputTimeScale/30;if(r){const H=y-T,Y=H>P,de=H<-1;if((Y||de)&&(Y?this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${mb(H,!0)} ms (${H}dts) hole between fragments detected at ${t.toFixed(3)}`):this.warn(`${(e.segmentCodec||"").toUpperCase()}: ${mb(-H,!0)} ms (${H}dts) overlapping between fragments detected at ${t.toFixed(3)}`),!de||T>=o[0].pts||n0)){y=T;const W=o[0].pts-H;if(Y)o[0].dts=y,o[0].pts=W;else{let K=!0;for(let J=0;J<o.length&&!(o[J].dts>W&&K);J++){const oe=o[J].pts;if(o[J].dts-=H,o[J].pts-=H,J<o.length-1){const Ie=o[J+1].pts,pe=o[J].pts,ye=Ie<=pe,he=Ie<=oe;K=ye==he}}}this.log(`Video: Initial PTS/DTS adjusted: ${mb(W,!0)}/${mb(y,!0)}, delta: ${mb(H,!0)} ms`)}}y=Math.max(0,y);let R=0,_=0,I=y;for(let H=0;H<c;H++){const Y=o[H],de=Y.units,W=de.length;let K=0;for(let J=0;J<W;J++)K+=de[J].data.length;_+=K,R+=W,Y.length=K,Y.dts<I?(Y.dts=I,I+=P/4|0||1):I=Y.dts,B=Math.min(Y.pts,B),E=Math.max(Y.pts,E)}v=o[c-1].dts;const D=_+4*R+8;let j;try{j=new Uint8Array(D)}catch(H){this.observer.emit(V.ERROR,V.ERROR,{type:Bt.MUX_ERROR,details:Ee.REMUX_ALLOC_ERROR,fatal:!1,error:H,bytes:D,reason:`fail allocating video mdat ${D}`});return}const O=new DataView(j.buffer);O.setUint32(0,D),j.set(we.types.mdat,4);let M=!1,U=Number.POSITIVE_INFINITY,ee=Number.POSITIVE_INFINITY,ie=Number.NEGATIVE_INFINITY,G=Number.NEGATIVE_INFINITY;for(let H=0;H<c;H++){const Y=o[H],de=Y.units;let W=0;for(let oe=0,Ie=de.length;oe<Ie;oe++){const pe=de[oe],ye=pe.data,he=pe.data.byteLength;O.setUint32(p,he),p+=4,j.set(ye,p),p+=he,W+=4+he}let K;if(H<c-1)x=o[H+1].dts-Y.dts,K=o[H+1].pts-Y.pts;else{const oe=this.config,Ie=H>0?Y.dts-o[H-1].dts:P;if(K=H>0?Y.pts-o[H-1].pts:P,oe.stretchShortVideoTrack&&this.nextAudioTs!==null){const pe=Math.floor(oe.maxBufferHole*a),ye=(s?B+s*a:this.nextAudioTs+h)-Y.pts;ye>pe?(x=ye-Ie,x<0?x=Ie:M=!0,this.log(`It is approximately ${ye/90} ms to the next segment; using duration ${x/90} ms for the last video frame.`)):x=Ie}else x=Ie}const J=Math.round(Y.pts-Y.dts);U=Math.min(U,x),ie=Math.max(ie,x),ee=Math.min(ee,K),G=Math.max(G,K),l.push(vG(Y.key,x,W,J))}if(l.length){if(n0){if(n0<70){const H=l[0].flags;H.dependsOn=2,H.isNonSync=0}}else if(GN&&G-ee<ie-U&&P/ie<.025&&l[0].cts===0){this.warn("Found irregular gaps in sample duration. Using PTS instead of DTS to determine MP4 sample duration.");let H=y;for(let Y=0,de=l.length;Y<de;Y++){const W=H+l[Y].duration,K=H+l[Y].cts;if(Y<de-1){const J=W+l[Y+1].cts;l[Y].duration=J-K}else l[Y].duration=Y?l[Y-1].duration:P;l[Y].cts=0,H=W}}}x=M||!x?P:x;const Z=v+x;this.nextVideoTs=m=Z-h,this.videoSampleDuration=x,this.isVideoContiguous=!0;const re={data1:we.moof(e.sequenceNumber++,y,sr(e,{samples:l})),data2:j,startPTS:(B-h)/a,endPTS:(E+x-h)/a,startDTS:(y-h)/a,endDTS:m/a,type:"video",hasAudio:!1,hasVideo:!0,nb:l.length,dropped:e.dropped};return e.samples=[],e.dropped=0,re}getSamplesPerFrame(e){switch(e.segmentCodec){case"mp3":return b3e;case"ac3":return y3e;default:return x3e}}remuxAudio(e,t,r,s,a){const o=e.inputTimeScale,l=e.samplerate?e.samplerate:o,c=o/l,d=this.getSamplesPerFrame(e),h=d*c,m=this._initPTS,p=e.segmentCodec==="mp3"&&this.typeSupported.mpeg,x=[],y=a!==void 0;let v=e.samples,B=p?0:8,E=this.nextAudioTs||-1;const N=m.baseTime*o/m.timescale,T=N+t*o;if(this.isAudioContiguous=r=r||v.length&&E>0&&(s&&Math.abs(T-(E+N))<9e3||Math.abs(mo(v[0].pts,T)-(E+N))<20*h),v.forEach(function(G){G.pts=mo(G.pts,T)}),!r||E<0){const G=v.length;if(v=v.filter(Z=>Z.pts>=0),G!==v.length&&this.warn(`Removed ${v.length-G} of ${G} samples (initPTS ${N} / ${o})`),!v.length)return;a===0?E=0:s&&!y?E=Math.max(0,T-N):E=v[0].pts-N}if(e.segmentCodec==="aac"){const G=this.config.maxAudioFramesDrift;for(let Z=0,z=E+N;Z<v.length;Z++){const se=v[Z],re=se.pts,H=re-z,Y=Math.abs(1e3*H/o);if(H<=-G*h&&y)Z===0&&(this.warn(`Audio frame @ ${(re/o).toFixed(3)}s overlaps marker by ${Math.round(1e3*H/o)} ms.`),this.nextAudioTs=E=re-N,z=re);else if(H>=G*h&&Y<g3e&&y){let de=Math.round(H/h);for(z=re-de*h;z<0&&de&&h;)de--,z+=h;Z===0&&(this.nextAudioTs=E=z-N),this.warn(`Injecting ${de} audio frames @ ${((z-N)/o).toFixed(3)}s due to ${Math.round(1e3*H/o)} ms gap.`);for(let W=0;W<de;W++){let K=f3e.getSilentFrame(e.parsedCodec||e.manifestCodec||e.codec,e.channelCount);K||(this.log("Unable to get silent frame for given audio codec; duplicating last frame instead."),K=se.unit.subarray()),v.splice(Z,0,{unit:K,pts:z}),z+=h,Z++}}se.pts=z,z+=h}}let k=null,P=null,R,_=0,I=v.length;for(;I--;)_+=v[I].unit.byteLength;for(let G=0,Z=v.length;G<Z;G++){const z=v[G],se=z.unit;let re=z.pts;if(P!==null){const Y=x[G-1];Y.duration=Math.round((re-P)/c)}else if(r&&e.segmentCodec==="aac"&&(re=E+N),k=re,_>0){_+=B;try{R=new Uint8Array(_)}catch(Y){this.observer.emit(V.ERROR,V.ERROR,{type:Bt.MUX_ERROR,details:Ee.REMUX_ALLOC_ERROR,fatal:!1,error:Y,bytes:_,reason:`fail allocating audio mdat ${_}`});return}p||(new DataView(R.buffer).setUint32(0,_),R.set(we.types.mdat,4))}else return;R.set(se,B);const H=se.byteLength;B+=H,x.push(vG(!0,d,H,0)),P=re}const D=x.length;if(!D)return;const j=x[x.length-1];E=P-N,this.nextAudioTs=E+c*j.duration;const O=p?new Uint8Array(0):we.moof(e.sequenceNumber++,k/c,sr({},e,{samples:x}));e.samples=[];const M=(k-N)/o,U=this.nextAudioTs/o,ie={data1:O,data2:R,startPTS:M,endPTS:U,startDTS:M,endDTS:U,type:"audio",hasAudio:!0,hasVideo:!1,nb:D};return this.isAudioContiguous=!0,ie}}function mo(n,e){let t;if(e===null)return n;for(e<n?t=-8589934592:t=8589934592;Math.abs(n-e)>4294967296;)n+=t;return n}function v3e(n){for(let e=0;e<n.length;e++)if(n[e].key)return e;return-1}function vee(n,e,t,r){const s=n.samples.length;if(!s)return;const a=n.inputTimeScale;for(let l=0;l<s;l++){const c=n.samples[l];c.pts=mo(c.pts-t.baseTime*a/t.timescale,e*a)/a,c.dts=mo(c.dts-r.baseTime*a/r.timescale,e*a)/a}const o=n.samples;return n.samples=[],{samples:o}}function Bee(n,e,t){const r=n.samples.length;if(!r)return;const s=n.inputTimeScale;for(let o=0;o<r;o++){const l=n.samples[o];l.pts=mo(l.pts-t.baseTime*s/t.timescale,e*s)/s}n.samples.sort((o,l)=>o.pts-l.pts);const a=n.samples;return n.samples=[],{samples:a}}class B3e extends ul{constructor(e,t,r,s){super("passthrough-remuxer",s),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 t=this.initPTS;t&&e&&t.baseTime===e.baseTime&&t.timescale===e.timescale||(this.initPTS=e)}resetNextTimestamp(){this.isVideoContiguous=!1,this.lastEndTime=null}resetInitSegment(e,t,r,s){this.audioCodec=t,this.videoCodec=r,this.generateInitSegment(e,s),this.emitInitSegment=!0}generateInitSegment(e,t){let{audioCodec:r,videoCodec:s}=this;if(!(e!=null&&e.byteLength)){this.initTracks=void 0,this.initData=void 0;return}const{audio:a,video:o}=this.initData=AZ(e);if(t)lOe(e,t);else{const c=a||o;c!=null&&c.encrypted&&this.warn(`Init segment with encrypted track with has no key ("${c.codec}")!`)}a&&(r=BG(a,hr.AUDIO,this)),o&&(s=BG(o,hr.VIDEO,this));const l={};a&&o?l.audiovideo={container:"video/mp4",codec:r+","+s,supplemental:o.supplemental,encrypted:o.encrypted,initSegment:e,id:"main"}:a?l.audio={container:"audio/mp4",codec:r,encrypted:a.encrypted,initSegment:e,id:"audio"}:o?l.video={container:"video/mp4",codec:s,supplemental:o.supplemental,encrypted:o.encrypted,initSegment:e,id:"main"}:this.warn("initSegment does not contain moov or trak boxes."),this.initTracks=l}remux(e,t,r,s,a,o){var l,c;let{initPTS:d,lastEndTime:h}=this;const m={audio:void 0,video:void 0,text:s,id3:r,initSegment:void 0};ct(h)||(h=this.lastEndTime=a||0);const p=t.samples;if(!p.length)return m;const x={initPTS:void 0,timescale:void 0,trackId:void 0};let y=this.initData;if((l=y)!=null&&l.length||(this.generateInitSegment(p),y=this.initData),!((c=y)!=null&&c.length))return this.warn("Failed to generate initSegment."),m;this.emitInitSegment&&(x.tracks=this.initTracks,this.emitInitSegment=!1);const v=dOe(p,y,this),B=y.audio?v[y.audio.id]:null,E=y.video?v[y.video.id]:null,N=Fw(E,1/0),T=Fw(B,1/0),k=Fw(E,0,!0),P=Fw(B,0,!0);let R=a,_=0;const I=B&&(!E||!d&&T<N||d&&d.trackId===y.audio.id),D=I?B:E;if(D){const z=D.timescale,se=D.start-a*z,re=I?y.audio.id:y.video.id;R=D.start/z,_=I?P-T:k-N,(o||!d)&&(w3e(d,R,a,_)||z!==d.timescale)&&(d&&this.warn(`Timestamps at playlist time: ${o?"":"~"}${a} ${se/z} != initPTS: ${d.baseTime/d.timescale} (${d.baseTime}/${d.timescale}) trackId: ${d.trackId}`),this.log(`Found initPTS at playlist time: ${a} offset: ${R-a} (${se}/${z}) trackId: ${re}`),d=null,x.initPTS=se,x.timescale=z,x.trackId=re)}else this.warn(`No audio or video samples found for initPTS at playlist time: ${a}`);d?(x.initPTS=d.baseTime,x.timescale=d.timescale,x.trackId=d.trackId):((!x.timescale||x.trackId===void 0||x.initPTS===void 0)&&(this.warn("Could not set initPTS"),x.initPTS=R,x.timescale=1,x.trackId=-1),this.initPTS=d={baseTime:x.initPTS,timescale:x.timescale,trackId:x.trackId});const j=R-d.baseTime/d.timescale,O=j+_;_>0?this.lastEndTime=O:(this.warn("Duration parsed from mp4 should be greater than zero"),this.resetNextTimestamp());const M=!!y.audio,U=!!y.video;let ee="";M&&(ee+="audio"),U&&(ee+="video");const ie=(y.audio?y.audio.encrypted:!1)||(y.video?y.video.encrypted:!1),G={data1:p,startPTS:j,startDTS:j,endPTS:O,endDTS:O,type:ee,hasAudio:M,hasVideo:U,nb:1,dropped:0,encrypted:ie};m.audio=M&&!U?G:void 0,m.video=U?G:void 0;const Z=E==null?void 0:E.sampleCount;if(Z){const z=E.keyFrameIndex,se=z!==-1;G.nb=Z,G.dropped=z===0||this.isVideoContiguous?0:se?z:Z,G.independent=se,G.firstKeyFrame=z,se&&E.keyFrameStart&&(G.firstKeyFramePTS=(E.keyFrameStart-d.baseTime)/d.timescale),this.isVideoContiguous||(m.independent=se),this.isVideoContiguous||(this.isVideoContiguous=se),G.dropped&&this.warn(`fmp4 does not start with IDR: firstIDR ${z}/${Z} dropped: ${G.dropped} start: ${G.firstKeyFramePTS||"NA"}`)}return m.initSegment=x,m.id3=vee(r,a,d,d),s.samples.length&&(m.text=Bee(s,a,d)),m}}function Fw(n,e,t=!1){return(n==null?void 0:n.start)!==void 0?(n.start+(t?n.duration:0))/n.timescale:e}function w3e(n,e,t,r){if(n===null)return!0;const s=Math.max(r,1),a=e-n.baseTime/n.timescale;return Math.abs(a-t)>s}function BG(n,e,t){const r=n.codec;return r&&r.length>4?r:e===hr.AUDIO?r==="ec-3"||r==="ac-3"||r==="alac"?r:r==="fLaC"||r==="Opus"?f1(r,!1):(t.warn(`Unhandled audio codec "${r}" in mp4 MAP`),r||"mp4a"):(t.warn(`Unhandled video codec "${r}" in mp4 MAP`),r||"avc1")}let Bd;try{Bd=self.performance.now.bind(self.performance)}catch{Bd=Date.now}const IC=[{demux:o3e,remux:B3e},{demux:eh,remux:_C},{demux:r3e,remux:_C},{demux:a3e,remux:_C}];IC.splice(2,0,{demux:s3e,remux:_C});class wG{constructor(e,t,r,s,a,o){this.asyncResult=!1,this.logger=void 0,this.observer=void 0,this.typeSupp
vendor: 12,603 bytes, lines 4732-4738
4732orted=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=t,this.config=r,this.id=a,this.logger=o}configure(e){this.transmuxConfig=e,this.decrypter&&this.decrypter.reset()}push(e,t,r,s){const a=r.transmuxing;a.executeStart=Bd();let o=new Uint8Array(e);const{currentTransmuxState:l,transmuxConfig:c}=this;s&&(this.currentTransmuxState=s);const{contiguous:d,discontinuity:h,trackSwitch:m,accurateTimeOffset:p,timeOffset:x,initSegmentChange:y}=s||l,{audioCodec:v,videoCodec:B,defaultInitPts:E,duration:N,initSegmentData:T}=c,k=C3e(o,t);if(k&&U0(k.method)){const I=this.getDecrypter(),D=zP(k.method);if(I.isSync()){let j=I.softwareDecrypt(o,k.key.buffer,k.iv.buffer,D);if(r.part>-1){const M=I.flush();j=M&&M.buffer}if(!j)return a.executeEnd=Bd(),$N(r);o=new Uint8Array(j)}else return this.asyncResult=!0,this.decryptionPromise=I.webCryptoDecrypt(o,k.key.buffer,k.iv.buffer,D).then(j=>{const O=this.push(j,null,r);return this.decryptionPromise=null,O}),this.decryptionPromise}const P=this.needsProbing(h,m);if(P){const I=this.configureTransmuxer(o);if(I)return this.logger.warn(`[transmuxer] ${I.message}`),this.observer.emit(V.ERROR,V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_PARSING_ERROR,fatal:!1,error:I,reason:I.message}),a.executeEnd=Bd(),$N(r)}(h||m||y||P)&&this.resetInitSegment(T,v,B,N,t),(h||y||P)&&this.resetInitialTimestamp(E),d||this.resetContiguity();const R=this.transmux(o,k,x,p,r);this.asyncResult=Hy(R);const _=this.currentTransmuxState;return _.contiguous=!0,_.discontinuity=!1,_.trackSwitch=!1,a.executeEnd=Bd(),R}flush(e){const t=e.transmuxing;t.executeStart=Bd();const{decrypter:r,currentTransmuxState:s,decryptionPromise:a}=this;if(a)return this.asyncResult=!0,a.then(()=>this.flush(e));const o=[],{timeOffset:l}=s;if(r){const m=r.flush();m&&o.push(this.push(m.buffer,null,e))}const{demuxer:c,remuxer:d}=this;if(!c||!d){t.executeEnd=Bd();const m=[$N(e)];return this.asyncResult?Promise.resolve(m):m}const h=c.flush(l);return Hy(h)?(this.asyncResult=!0,h.then(m=>(this.flushRemux(o,m,e),o))):(this.flushRemux(o,h,e),this.asyncResult?Promise.resolve(o):o)}flushRemux(e,t,r){const{audioTrack:s,videoTrack:a,id3Track:o,textTrack:l}=t,{accurateTimeOffset:c,timeOffset:d}=this.currentTransmuxState;this.logger.log(`[transmuxer.ts]: Flushed ${this.id} sn: ${r.sn}${r.part>-1?" part: "+r.part:""} of ${this.id===mt.MAIN?"level":"track"} ${r.level}`);const h=this.remuxer.remux(s,a,o,l,d,c,!0,this.id);e.push({remuxResult:h,chunkMeta:r}),r.transmuxing.executeEnd=Bd()}resetInitialTimestamp(e){const{demuxer:t,remuxer:r}=this;!t||!r||(t.resetTimeStamp(e),r.resetTimeStamp(e))}resetContiguity(){const{demuxer:e,remuxer:t}=this;!e||!t||(e.resetContiguity(),t.resetNextTimestamp())}resetInitSegment(e,t,r,s,a){const{demuxer:o,remuxer:l}=this;!o||!l||(o.resetInitSegment(e,t,r,s),l.resetInitSegment(e,t,r,a))}destroy(){this.demuxer&&(this.demuxer.destroy(),this.demuxer=void 0),this.remuxer&&(this.remuxer.destroy(),this.remuxer=void 0)}transmux(e,t,r,s,a){let o;return t&&t.method==="SAMPLE-AES"?o=this.transmuxSampleAes(e,t,r,s,a):o=this.transmuxUnencrypted(e,r,s,a),o}transmuxUnencrypted(e,t,r,s){const{audioTrack:a,videoTrack:o,id3Track:l,textTrack:c}=this.demuxer.demux(e,t,!1,!this.config.progressive);return{remuxResult:this.remuxer.remux(a,o,l,c,t,r,!1,this.id),chunkMeta:s}}transmuxSampleAes(e,t,r,s,a){return this.demuxer.demuxSampleAes(e,t,r).then(o=>({remuxResult:this.remuxer.remux(o.audioTrack,o.videoTrack,o.id3Track,o.textTrack,r,s,!1,this.id),chunkMeta:a}))}configureTransmuxer(e){const{config:t,observer:r,typeSupported:s}=this;let a;for(let m=0,p=IC.length;m<p;m++){var o;if((o=IC[m].demux)!=null&&o.probe(e,this.logger)){a=IC[m];break}}if(!a)return new Error("Failed to find demuxer by probing fragment data");const l=this.demuxer,c=this.remuxer,d=a.remux,h=a.demux;(!c||!(c instanceof d))&&(this.remuxer=new d(r,t,s,this.logger)),(!l||!(l instanceof h))&&(this.demuxer=new h(r,t,s,this.logger),this.probe=h.probe)}needsProbing(e,t){return!this.demuxer||!this.remuxer||e||t}getDecrypter(){let e=this.decrypter;return e||(e=this.decrypter=new $P(this.config)),e}}function C3e(n,e){let t=null;return n.byteLength>0&&(e==null?void 0:e.key)!=null&&e.iv!==null&&e.method!=null&&(t=e),t}const $N=n=>({remuxResult:{},chunkMeta:n});function Hy(n){return"then"in n&&n.then instanceof Function}class E3e{constructor(e,t,r,s,a){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=t,this.initSegmentData=r,this.duration=s,this.defaultInitPts=a||null}}class S3e{constructor(e,t,r,s,a,o){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=t,this.accurateTimeOffset=r,this.trackSwitch=s,this.timeOffset=a,this.initSegmentChange=o}}let CG=0;class wee{constructor(e,t,r,s){this.error=null,this.hls=void 0,this.id=void 0,this.instanceNo=CG++,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=c=>{const d=c.data,h=this.hls;if(!(!h||!(d!=null&&d.event)||d.instanceNo!==this.instanceNo))switch(d.event){case"init":{var m;const p=(m=this.workerContext)==null?void 0:m.objectURL;p&&self.URL.revokeObjectURL(p);break}case"transmuxComplete":{this.handleTransmuxComplete(d.data);break}case"flush":{this.onFlush(d.data);break}case"workerLog":{h.logger[d.data.logType]&&h.logger[d.data.logType](d.data.message);break}default:{d.data=d.data||{},d.data.frag=this.frag,d.data.part=this.part,d.data.id=this.id,h.trigger(d.event,d.data);break}}},this.onWorkerError=c=>{if(!this.hls)return;const d=new Error(`${c.message}  (${c.filename}:${c.lineno})`);this.hls.config.enableWorker=!1,this.hls.logger.warn(`Error in "${this.id}" Web Worker, fallback to inline`),this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.INTERNAL_EXCEPTION,fatal:!1,event:"demuxerWorker",error:d})};const a=e.config;this.hls=e,this.id=t,this.useWorker=!!a.enableWorker,this.onTransmuxComplete=r,this.onFlush=s;const o=(c,d)=>{d=d||{},d.frag=this.frag||void 0,c===V.ERROR&&(d=d,d.parent=this.id,d.part=this.part,this.error=d.error),this.hls.trigger(c,d)};this.observer=new WP,this.observer.on(V.FRAG_DECRYPTED,o),this.observer.on(V.ERROR,o);const l=M9(a.preferManagedMediaSource);if(this.useWorker&&typeof Worker<"u"){const c=this.hls.logger;if(a.workerPath||NMe()){try{a.workerPath?(c.log(`loading Web Worker ${a.workerPath} for "${t}"`),this.workerContext=IMe(a.workerPath)):(c.log(`injecting Web Worker for "${t}"`),this.workerContext=_Me());const{worker:h}=this.workerContext;h.addEventListener("message",this.onWorkerMessage),h.addEventListener("error",this.onWorkerError),h.postMessage({instanceNo:this.instanceNo,cmd:"init",typeSupported:l,id:t,config:xr(a)})}catch(h){c.warn(`Error setting up "${t}" Web Worker, fallback to inline`,h),this.terminateWorker(),this.error=null,this.transmuxer=new wG(this.observer,l,a,"",t,e.logger)}return}}this.transmuxer=new wG(this.observer,l,a,"",t,e.logger)}reset(){if(this.frag=null,this.part=null,this.workerContext){const e=this.instanceNo;this.instanceNo=CG++;const t=this.hls.config,r=M9(t.preferManagedMediaSource);this.workerContext.worker.postMessage({instanceNo:this.instanceNo,cmd:"reset",resetNo:e,typeSupported:r,id:this.id,config:xr(t)})}}terminateWorker(){if(this.workerContext){const{worker:e}=this.workerContext;this.workerContext=null,e.removeEventListener("message",this.onWorkerMessage),e.removeEventListener("error",this.onWorkerError),DMe(this.hls.config.workerPath)}}destroy(){if(this.workerContext)this.terminateWorker(),this.onWorkerMessage=this.onWorkerError=null;else{const t=this.transmuxer;t&&(t.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,t,r,s,a,o,l,c,d,h){var m,p;d.transmuxing.start=self.performance.now();const{instanceNo:x,transmuxer:y}=this,v=o?o.start:a.start,B=a.decryptdata,E=this.frag,N=!(E&&a.cc===E.cc),T=!(E&&d.level===E.level),k=E?d.sn-E.sn:-1,P=this.part?d.part-this.part.index:-1,R=k===0&&d.id>1&&d.id===(E==null?void 0:E.stats.chunkCount),_=!T&&(k===1||k===0&&(P===1||R&&P<=0)),I=self.performance.now();(T||k||a.stats.parsing.start===0)&&(a.stats.parsing.start=I),o&&(P||!_)&&(o.stats.parsing.start=I);const D=!(E&&((m=a.initSegment)==null?void 0:m.url)===((p=E.initSegment)==null?void 0:p.url)),j=new S3e(N,_,c,T,v,D);if(!_||N||D){this.hls.logger.log(`[transmuxer-interface]: Starting new transmux session for ${a.type} sn: ${d.sn}${d.part>-1?" part: "+d.part:""} ${this.id===mt.MAIN?"level":"track"}: ${d.level} id: ${d.id}
4733        discontinuity: ${N}
4734        trackSwitch: ${T}
4735        contiguous: ${_}
4736        accurateTimeOffset: ${c}
4737        timeOffset: ${v}
4738        initSegmentChange: ${D}`);const O=new E3e(r,s,t,l,h);this.configureTransmuxer(O)}if(this.frag=a,this.part=o,this.workerContext)this.workerContext.worker.postMessage({instanceNo:x,cmd:"demux",data:e,decryptdata:B,chunkMeta:d,state:j},e instanceof ArrayBuffer?[e]:[]);else if(y){const O=y.push(e,B,d,j);Hy(O)?O.then(M=>{this.handleTransmuxComplete(M)}).catch(M=>{this.transmuxerError(M,d,"transmuxer-interface push error")}):this.handleTransmuxComplete(O)}}flush(e){e.transmuxing.start=self.performance.now();const{instanceNo:t,transmuxer:r}=this;if(this.workerContext)this.workerContext.worker.postMessage({instanceNo:t,cmd:"flush",chunkMeta:e});else if(r){const s=r.flush(e);Hy(s)?s.then(a=>{this.handleFlushResult(a,e)}).catch(a=>{this.transmuxerError(a,e,"transmuxer-interface flush error")}):this.handleFlushResult(s,e)}}transmuxerError(e,t,r){this.hls&&(this.error=e,this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_PARSING_ERROR,chunkMeta:t,frag:this.frag||void 0,part:this.part||void 0,fatal:!1,error:e,err:e,reason:r}))}handleFlushResult(e,t){e.forEach(r=>{this.handleTransmuxComplete(r)}),this.onFlush(t)}configureTransmuxer(e){const{instanceNo:t,transmuxer:r}=this;this.workerContext?this.workerContext.worker.postMessage({instanceNo:t,cmd:"configure",config:e}):r&&r.configure(e)}handleTransmuxComplete(e){e.chunkMeta.transmuxing.end=self.performance.now(),this.onTransmuxComplete(e)}}const EG=100;class T3e extends KP{constructor(e,t,r){super(e,t,r,"audio-stream-controller",mt.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(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.on(V.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(V.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(V.BUFFER_RESET,this.onBufferReset,this),e.on(V.BUFFER_CREATED,this.onBufferCreated,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(V.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(V.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(V.FRAG_LOADING,this.onFragLoading,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){const{hls:e}=this;e&&(super.unregisterListeners(),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.AUDIO_TRACKS_UPDATED,this.onAudioTracksUpdated,this),e.off(V.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(V.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(V.BUFFER_RESET,this.onBufferReset,this),e.off(V.BUFFER_CREATED,this.onBufferCreated,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(V.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(V.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(V.FRAG_LOADING,this.onFragLoading,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this))}onInitPtsFound(e,{frag:t,id:r,initPTS:s,timescale:a,trackId:o}){if(r===mt.MAIN){const l=t.cc,c=this.fragCurrent;if(this.initPTS[l]={baseTime:s,timescale:a,trackId:o},this.log(`InitPTS for cc: ${l}
4738 found from main: ${s/a} (${s}/${a}) trackId: ${o}`),this.mainAnchor=t,this.state===Ve.WAITING_INIT_PTS){const d=this.waitingData;(!d&&!this.loadingParts||d&&d.frag.cc!==l)&&this.syncWithAnchor(t,d==null?void 0:d.frag)}else!this.hls.hasEnoughToStart&&c&&c.cc!==l?(c.abortRequests(),this.syncWithAnchor(t,c)):this.state===Ve.IDLE&&this.tick()}}getLoadPosition(){return!this.startFragRequested&&this.nextLoadPosition>=0?this.nextLoadPosition:super.getLoadPosition()}syncWithAnchor(e,t){var r;const s=((r=this.mainFragLoading)==null?void 0:r.frag)||null;if(t&&(s==null?void 0:s.cc)===t.cc)return;const a=(s||e).cc,o=this.getLevelDetails(),l=this.getLoadPosition(),c=MZ(o,a,l);c&&(this.log(`Syncing with main frag at ${c.start} cc ${c.cc}`),this.startFragRequested=!1,this.nextLoadPosition=c.start,this.resetLoadingState(),this.state===Ve.IDLE&&this.doTickIdle())}startLoad(e,t){if(!this.levels){this.startPosition=e,this.state=Ve.STOPPED;return}const r=this.lastCurrentTime;this.stopLoad(),this.setInterval(EG),r>0&&e===-1?(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r,this.state=Ve.IDLE):this.state=Ve.WAITING_TRACK,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}doTick(){switch(this.state){case Ve.IDLE:this.doTickIdle();break;case Ve.WAITING_TRACK:{const{levels:e,trackId:t}=this,r=e==null?void 0:e[t],s=r==null?void 0:r.details;if(s&&!this.waitForLive(r)){if(this.waitForCdnTuneIn(s))break;this.state=Ve.WAITING_INIT_PTS}break}case Ve.FRAG_LOADING_WAITING_RETRY:{this.checkRetryDate();break}case Ve.WAITING_INIT_PTS:{const e=this.waitingData;if(e){const{frag:t,part:r,cache:s,complete:a}=e,o=this.mainAnchor;if(this.initPTS[t.cc]!==void 0){this.waitingData=null,this.state=Ve.FRAG_LOADING;const l=s.flush().buffer,c={frag:t,part:r,payload:l,networkDetails:null};this._handleFragmentLoadProgress(c),a&&super._handleFragmentLoadComplete(c)}else o&&o.cc!==e.frag.cc&&this.syncWithAnchor(o,e.frag)}else this.state=Ve.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:t,levels:r,media:s,trackId:a}=this,o=t.config;if(!this.buffering||!s&&!this.primaryPrefetch&&(this.startFragRequested||!o.startFragPrefetch)||!(r!=null&&r[a]))return;const l=r[a],c=l.details;if(!c||this.waitForLive(l)||this.waitForCdnTuneIn(c)){this.state=Ve.WAITING_TRACK,this.startFragRequested=!1;return}const d=this.mediaBuffer?this.mediaBuffer:this.media;this.bufferFlushed&&d&&(this.bufferFlushed=!1,this.afterBufferFlushed(d,hr.AUDIO,mt.AUDIO));const h=this.getFwdBufferInfo(d,mt.AUDIO);if(h===null)return;if(!this.switchingTrack&&this._streamEnded(h,c)){t.trigger(V.BUFFER_EOS,{type:"audio"}),this.state=Ve.ENDED;return}const m=h.len,p=t.maxBufferLength,x=c.fragments,y=x[0].start,v=this.getLoadPosition(),B=this.flushing?v:h.end;if(this.switchingTrack&&s){const T=v;c.PTSKnown&&T<y&&(h.end>y||h.nextStart)&&(this.log("Alt audio track ahead of main track, seek to start of alt audio track"),s.currentTime=y+.05)}if(m>=p&&!this.switchingTrack&&B<x[x.length-1].start)return;let E=this.getNextFragment(B,c);if(E&&this.isLoopLoading(E,B)&&(E=this.getNextFragmentLoopLoading(E,c,h,mt.MAIN,p)),!E){this.bufferFlushed=!0;return}if(this.exceedsMaxBuffer(h,p,E))return;let N=((e=this.mainFragLoading)==null?void 0:e.frag)||null;if(!this.audioOnly&&this.startFragRequested&&N&&ws(E)&&!E.endList&&(!c.live||!this.loadingParts&&B<this.hls.liveSyncPosition)&&(this.fragmentTracker.getState(N)===Ks.OK&&(this.mainFragLoading=N=null),N&&ws(N))){if(E.start>N.end){const k=this.fragmentTracker.getFragAtPos(B,mt.MAIN);k&&k.end>N.end&&(N=k,this.mainFragLoading={frag:k,targetBufferTime:null})}if(E.start>N.end)return}this.loadFragment(E,l,B)}onMediaDetaching(e,t){this.bufferFlushed=this.flushing=!1,super.onMediaDetaching(e,t)}onAudioTracksUpdated(e,{audioTracks:t}){this.resetTransmuxer(),this.levels=t.map(r=>new Vy(r))}onAudioTrackSwitching(e,t){const r=!!t.url;this.trackId=t.id;const{fragCurrent:s}=this;s&&(s.abortRequests(),this.removeUnbufferedFrags(s.start)),this.resetLoadingState(),r?(this.switchingTrack=t,this.flushAudioIfNeeded(t),this.state!==Ve.STOPPED&&(this.setInterval(EG),this.state=Ve.IDLE,this.tick())):(this.resetTransmuxer(),this.switchingTrack=null,this.bufferedTrack=t,this.clearInterval())}onManifestLoading(){super.onManifestLoading(),this.bufferFlushed=this.flushing=this.audioOnly=!1,this.resetItem(),this.trackId=-1}onLevelLoaded(e,t){this.mainDetails=t.details;const r=this.cachedTrackLoadedData;r&&(this.cachedTrackLoadedData=null,this.onAudioTrackLoaded(V.AUDIO_TRACK_LOADED,r))}onAudioTrackLoaded(e,t){var r;const{levels:s}=this,{details:a,id:o,groupId:l,track:c}=t;if(!s){this.warn(`Audio tracks reset while loading track ${o} "${c.name}" of "${l}"`);return}const d=this.mainDetails;if(!d||a.endCC>d.endCC||d.expired){this.cachedTrackLoadedData=t,this.state!==Ve.STOPPED&&(this.state=Ve.WAITING_TRACK);return}this.cachedTrackLoadedData=null,this.log(`Audio track ${o} "${c.name}" of "${l}" loaded [${a.startSN},${a.endSN}]${a.lastPartSn?`[part-${a.lastPartSn}-${a.lastPartIndex}]`:""},duration:${a.totalduration}`);const h=s[o];let m=0;if(a.live||(r=h.details)!=null&&r.live){if(this.checkLiveUpdate(a),a.deltaUpdateFailed)return;if(h.details){var p;m=this.alignPlaylists(a,h.details,(p=this.levelLastLoaded)==null?void 0:p.details)}a.alignedSliding||(nee(a,d),a.alignedSliding||v1(a,d),m=a.fragmentStart)}h.details=a,this.levelLastLoaded=h,this.startFragRequested||this.setStartPosition(d,m),this.hls.trigger(V.AUDIO_TRACK_UPDATED,{details:a,id:o,groupId:t.groupId}),this.state===Ve.WAITING_TRACK&&!this.waitForCdnTuneIn(a)&&(this.state=Ve.IDLE),this.tick()}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:s,payload:a}=e,{config:o,trackId:l,levels:c}
vendor: 14,366 bytes, line 4738
4738=this;if(!c){this.warn(`Audio tracks were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const d=c[l];if(!d){this.warn("Audio track is undefined on fragment load progress");return}const h=d.details;if(!h){this.warn("Audio track details undefined on fragment load progress"),this.removeUnbufferedFrags(r.start);return}const m=o.defaultAudioCodec||d.audioCodec||"mp4a.40.2";let p=this.transmuxer;p||(p=this.transmuxer=new wee(this.hls,mt.AUDIO,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)));const x=this.initPTS[r.cc],y=(t=r.initSegment)==null?void 0:t.data;if(x!==void 0){const B=s?s.index:-1,E=B!==-1,N=new HP(r.level,r.sn,r.stats.chunkCount,a.byteLength,B,E);p.push(a,y,m,"",r,s,h.totalduration,!1,N,x)}else{this.log(`Unknown video PTS for cc ${r.cc}, waiting for video PTS before demuxing audio frag ${r.sn} of [${h.startSN} ,${h.endSN}],track ${l}`);const{cache:v}=this.waitingData=this.waitingData||{frag:r,part:s,cache:new ree,complete:!1};v.push(new Uint8Array(a)),this.state!==Ve.STOPPED&&(this.state=Ve.WAITING_INIT_PTS)}}_handleFragmentLoadComplete(e){if(this.waitingData){this.waitingData.complete=!0;return}super._handleFragmentLoadComplete(e)}onBufferReset(){this.mediaBuffer=null}onBufferCreated(e,t){this.bufferFlushed=this.flushing=!1;const r=t.tracks.audio;r&&(this.mediaBuffer=r.buffer||null)}onFragLoading(e,t){!this.audioOnly&&t.frag.type===mt.MAIN&&ws(t.frag)&&(this.mainFragLoading=t,this.state===Ve.IDLE&&this.tick())}onFragBuffered(e,t){const{frag:r,part:s}=t;if(r.type!==mt.AUDIO){!this.audioOnly&&r.type===mt.MAIN&&!r.elementaryStreams.video&&!r.elementaryStreams.audiovideo&&(this.audioOnly=!0,this.mainFragLoading=null);return}if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${s?" p: "+s.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}, audioSwitch: ${this.switchingTrack?this.switchingTrack.name:"false"}`);return}if(ws(r)){this.fragPrevious=r;const a=this.switchingTrack;a&&(this.bufferedTrack=a,this.switchingTrack=null,this.hls.trigger(V.AUDIO_TRACK_SWITCHED,zn({},a)))}this.fragBufferedComplete(r,s),this.media&&this.tick()}onError(e,t){var r;if(t.fatal){this.state=Ve.ERROR;return}switch(t.details){case Ee.FRAG_GAP:case Ee.FRAG_PARSING_ERROR:case Ee.FRAG_DECRYPT_ERROR:case Ee.FRAG_LOAD_ERROR:case Ee.FRAG_LOAD_TIMEOUT:case Ee.KEY_LOAD_ERROR:case Ee.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(mt.AUDIO,t);break;case Ee.AUDIO_TRACK_LOAD_ERROR:case Ee.AUDIO_TRACK_LOAD_TIMEOUT:case Ee.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Ve.WAITING_TRACK&&((r=t.context)==null?void 0:r.type)===Xt.AUDIO_TRACK&&(this.state=Ve.IDLE);break;case Ee.BUFFER_ADD_CODEC_ERROR:case Ee.BUFFER_APPEND_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)||this.resetLoadingState();break;case Ee.BUFFER_FULL_ERROR:if(t.parent!=="audio")return;this.reduceLengthAndFlushBuffer(t)&&(this.bufferedTrack=null,super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio"));break;case Ee.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onBufferFlushing(e,{type:t}){t!==hr.VIDEO&&(this.flushing=!0)}onBufferFlushed(e,{type:t}){if(t!==hr.VIDEO){this.flushing=!1,this.bufferFlushed=!0,this.state===Ve.ENDED&&(this.state=Ve.IDLE);const r=this.mediaBuffer||this.media;r&&(this.afterBufferFlushed(r,t,mt.AUDIO),this.tick())}}_handleTransmuxComplete(e){var t;const r="audio",{hls:s}=this,{remuxResult:a,chunkMeta:o}=e,l=this.getCurrentContext(o);if(!l){this.resetWhenMissingContext(o);return}const{frag:c,part:d,level:h}=l,{details:m}=h,{audio:p,text:x,id3:y,initSegment:v}=a;if(this.fragContextChanged(c)||!m){this.fragmentTracker.removeFragment(c);return}if(this.state=Ve.PARSING,this.switchingTrack&&p&&this.completeAudioSwitch(this.switchingTrack),v!=null&&v.tracks){const B=c.initSegment||c;if(this.unhandledEncryptionError(v,c))return;this._bufferInitSegment(h,v.tracks,B,o),s.trigger(V.FRAG_PARSING_INIT_SEGMENT,{frag:B,id:r,tracks:v.tracks})}if(p){const{startPTS:B,endPTS:E,startDTS:N,endDTS:T}=p;d&&(d.elementaryStreams[hr.AUDIO]={startPTS:B,endPTS:E,startDTS:N,endDTS:T}),c.setElementaryStreamInfo(hr.AUDIO,B,E,N,T),this.bufferFragmentData(p,c,d,o)}if(y!=null&&(t=y.samples)!=null&&t.length){const B=sr({id:r,frag:c,details:m},y);s.trigger(V.FRAG_PARSING_METADATA,B)}if(x){const B=sr({id:r,frag:c,details:m},x);s.trigger(V.FRAG_PARSING_USERDATA,B)}}_bufferInitSegment(e,t,r,s){if(this.state!==Ve.PARSING||(t.video&&delete t.video,t.audiovideo&&delete t.audiovideo,!t.audio))return;const a=t.audio;a.id=mt.AUDIO;const o=e.audioCodec;this.log(`Init audio buffer, container:${a.container}, codecs[level/parsed]=[${o}/${a.codec}]`),o&&o.split(",").length===1&&(a.levelCodec=o),this.hls.trigger(V.BUFFER_CODECS,t);const l=a.initSegment;if(l!=null&&l.byteLength){const c={type:"audio",frag:r,part:null,chunkMeta:s,parent:r.type,data:l};this.hls.trigger(V.BUFFER_APPENDING,c)}this.tickImmediate()}loadFragment(e,t,r){const s=this.fragmentTracker.getState(e);if(this.switchingTrack||s===Ks.NOT_LOADED||s===Ks.PARTIAL){var a;if(!ws(e))this._loadInitSegment(e,t);else if((a=t.details)!=null&&a.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=Ve.WAITING_INIT_PTS;const o=this.mainDetails;o&&o.fragmentStart!==t.details.fragmentStart&&v1(t.details,o)}else super.loadFragment(e,t,r)}else this.clearTrackerIfNeeded(e)}flushAudioIfNeeded(e){if(this.media&&this.bufferedTrack){const{name:t,lang:r,assocLang:s,characteristics:a,audioCodec:o,channels:l}=this.bufferedTrack;bm({name:t,lang:r,assocLang:s,characteristics:a,audioCodec:o,channels:l},e,Vf)||(p1(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:t}=this;this.flushAudioIfNeeded(e),this.bufferedTrack=e,this.switchingTrack=null,t.trigger(V.AUDIO_TRACK_SWITCHED,zn({},e))}}class t5 extends ul{constructor(e,t){super(t,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,t,r){const s=t==null?void 0:t.renditionReports;if(s){let a=-1;for(let o=0;o<s.length;o++){const l=s[o];let c;try{c=new self.URL(l.URI,t.url).href}catch(d){this.warn(`Could not construct new URL for Rendition Report: ${d}`),c=l.URI||""}if(c===e){a=o;break}else c===e.substring(0,c.length)&&(a=o)}if(a!==-1){const o=s[a],l=parseInt(o["LAST-MSN"])||t.lastPartSn;let c=parseInt(o["LAST-PART"])||t.lastPartIndex;if(this.hls.config.lowLatencyMode){const h=Math.min(t.age-t.partTarget,t.targetduration);c>=0&&h>t.partTarget&&(c+=1)}const d=r&&F9(r);return new U9(l,c>=0?c:void 0,d)}}}loadPlaylist(e){this.clearTimer()}loadingPlaylist(e,t){this.clearTimer()}shouldLoadPlaylist(e){return this.canLoad&&!!e&&!!e.url&&(!e.details||e.details.live)}getUrlWithDirectives(e,t){if(t)try{return t.addDirectives(e)}catch(r){this.warn(`Could not construct new URL with HLS Delivery Directives: ${r}`)}return e}playlistLoaded(e,t,r){const{details:s,stats:a}=t,o=self.performance.now(),l=a.loading.first?Math.max(0,o-a.loading.first):0;s.advancedDateTime=Date.now()-l;const c=this.hls.config.timelineOffset;if(c!==s.appliedTimelineOffset){const h=Math.max(c||0,0);s.appliedTimelineOffset=h,s.fragments.forEach(m=>{m.setStart(m.playlistOffset+h)})}if(s.live||r!=null&&r.live){const h="levelInfo"in t?t.levelInfo:t.track;if(s.reloaded(r),r&&s.fragments.length>0){bMe(r,s,this);const N=s.playlistParsingError;if(N){this.warn(N);const T=this.hls;if(!T.config.ignorePlaylistParsingErrors){var d;const{networkDetails:k}=t;T.trigger(V.ERROR,{type:Bt.NETWORK_ERROR,details:Ee.LEVEL_PARSING_ERROR,fatal:!1,url:s.url,error:N,reason:N.message,level:t.level||void 0,parent:(d=s.fragments[0])==null?void 0:d.type,networkDetails:k,stats:a});return}s.playlistParsingError=null}}s.requestScheduled===-1&&(s.requestScheduled=a.loading.start);const m=this.hls.mainForwardBufferInfo,p=m?m.end-m.len:0,x=(s.edge-p)*1e3,y=JZ(s,x);if(s.requestScheduled+y<o?s.requestScheduled=o:s.requestScheduled+=y,this.log(`live playlist ${e} ${s.advanced?"REFRESHED "+s.lastPartSn+"-"+s.lastPartIndex:s.updated?"UPDATED":"MISSED"}`),!this.canLoad||!s.live)return;let v,B,E;if(s.canBlockReload&&s.endSN&&s.advanced){const N=this.hls.config.lowLatencyMode,T=s.lastPartSn,k=s.endSN,P=s.lastPartIndex,R=P!==-1,_=T===k;R?_?(B=k+1,E=N?0:P):(B=T,E=N?P+1:s.maxPartIndex):B=k+1;const I=s.age,D=I+s.ageHeader;let j=Math.min(D-s.partTarget,s.targetduration*1.5);if(j>0){if(D>s.targetduration*3)this.log(`Playlist last advanced ${I.toFixed(2)}s ago. Omitting segment and part directives.`),B=void 0,E=void 0;else if(r!=null&&r.tuneInGoal&&D-s.partTarget>r.tuneInGoal)this.warn(`CDN Tune-in goal increased from: ${r.tuneInGoal} to: ${j} with playlist age: ${s.age}`),j=0;else{const O=Math.floor(j/s.targetduration);if(B+=O,E!==void 0){const M=Math.round(j%s.targetduration/s.partTarget);E+=M}this.log(`CDN Tune-in age: ${s.ageHeader}s last advanced ${I.toFixed(2)}s goal: ${j} skip sn ${O} to part ${E}`)}s.tuneInGoal=j}if(v=this.getDeliveryDirectives(s,t.deliveryDirectives,B,E),N||!_){s.requestScheduled=o,this.loadingPlaylist(h,v);return}}else(s.canBlockReload||s.canSkipUntil)&&(v=this.getDeliveryDirectives(s,t.deliveryDirectives,B,E));v&&B!==void 0&&s.canBlockReload&&(s.requestScheduled=a.loading.first+Math.max(y-l*2,y/2)),this.scheduleLoading(h,v,s)}else this.clearTimer()}scheduleLoading(e,t,r){const s=r||e.details;if(!s){this.loadingPlaylist(e,t);return}const a=self.performance.now(),o=s.requestScheduled;if(a>=o){this.loadingPlaylist(e,t);return}const l=o-a;this.log(`reload live playlist ${e.name||e.bitrate+"bps"} in ${Math.round(l)} ms`),this.clearTimer(),this.timer=self.setTimeout(()=>this.loadingPlaylist(e,t),l)}getDeliveryDirectives(e,t,r,s){let a=F9(e);return t!=null&&t.skip&&e.deltaUpdateFailed&&(r=t.msn,s=t.part,a=kC.No),new U9(r,s,a)}checkRetry(e){const t=e.details,r=g1(e),s=e.errorAction,{action:a,retryCount:o=0,retryConfig:l}=s||{},c=!!s&&!!l&&(a===Da.RetryRequest||!s.resolved&&a===Da.SendAlternateToPenaltyBox);if(c){var d;if(o>=l.maxNumRetry)return!1;if(r&&(d=e.context)!=null&&d.deliveryDirectives)this.warn(`Retrying playlist loading ${o+1}/${l.maxNumRetry} after "${t}" without delivery-directives`),this.loadPlaylist();else{const h=GP(l,o);this.clearTimer(),this.timer=self.setTimeout(()=>this.loadPlaylist(),h),this.warn(`Retrying playlist loading ${o+1}/${l.maxNumRetry} after "${t}" in ${h}ms`)}e.levelRetry=!0,s.resolved=!0}return c}}function Cee(n,e){if(n.length!==e.length)return!1;for(let t=0;t<n.length;t++)if(!zy(n[t].attrs,e[t].attrs))return!1;return!0}function zy(n,e,t){const r=n["STABLE-RENDITION-ID"];return r&&!t?r===e["STABLE-RENDITION-ID"]:!(t||["LANGUAGE","NAME","CHARACTERISTICS","AUTOSELECT","DEFAULT","FORCED","ASSOC-LANGUAGE"]).some(s=>n[s]!==e[s])}function yD(n,e){return e.label.toLowerCase()===n.name.toLowerCase()&&(!e.language||e.language.toLowerCase()===(n.lang||"").toLowerCase())}class A3e extends t5{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(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(V.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVEL_LOADING,this.onLevelLoading,this),e.off(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(V.AUDIO_TRACK_LOADED,this.onAudioTrackLoaded,this),e.off(V.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,t){this.tracks=t.audioTracks||[]}onAudioTrackLoaded(e,t){const{id:r,groupId:s,details:a}=t,o=this.tracksInGroup[r];if(!o||o.groupId!==s){this.warn(`Audio track with id:${r} and group:${s} not found in active group ${o==null?void 0:o.groupId}`);return}const l=o.details;o.details=t.details,this.log(`Audio track ${r} "${o.name}" lang:${o.lang} group:${s} loaded [${a.startSN}-${a.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.audioGroups||null,s=this.groupIds;let a=this.currentTrack;if(!r||(s==null?void 0:s.length)!==(r==null?void 0:r.length)||r!=null&&r.some(l=>(s==null?void 0:s.indexOf(l))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const l=this.tracks.filter(p=>!r||r.indexOf(p.groupId)!==-1);if(l.length)this.selectDefaultTrack&&!l.some(p=>p.default)&&(this.selectDefaultTrack=!1),l.forEach((p,x)=>{p.id=x});else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=l;const c=this.hls.config.audioPreference;if(!a&&c){const p=Ac(c,l,Vf);if(p>-1)a=l[p];else{const x=Ac(c,this.tracks);a=this.tracks[x]}}let d=this.findTrackId(a);d===-1&&a&&(d=this.findTrackId(null));const h={audioTracks:l};this.log(`Updating audio tracks, ${l.length} track(s) found in group(s): ${r==null?void 0:r.join(",")}`),this.hls.trigger(V.AUDIO_TRACKS_UPDATED,h);const m=this.trackId;if(d!==-1&&m===-1)this.setAudioTrack(d);else if(l.length&&m===-1){var o;const p=new Error(`No audio track selected for current audio group-ID(s): ${(o=this.groupIds)==null?void 0:o.join(",")} track count: ${l.length}`);this.warn(p.message),this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.AUDIO_TRACK_LOAD_ERROR,fatal:!0,error:p})}}}onError(e,t){t.fatal||!t.context||t.context.type===Xt.AUDIO_TRACK&&t.context.
vendor: 8,878 bytes, lines 4738-4741
4738id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}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 t=this.hls;if(t.config.audioPreference=e,e){const r=this.allAudioTracks;if(this.selectDefaultTrack=!1,r.length){const s=this.currentTrack;if(s&&bm(e,s,Vf))return s;const a=Ac(e,this.tracksInGroup,Vf);if(a>-1){const o=this.tracksInGroup[a];return this.setAudioTrack(a),o}else if(s){let o=t.loadLevel;o===-1&&(o=t.firstAutoLevel);const l=FOe(e,t.levels,r,o,Vf);if(l===-1)return null;t.nextLoadLevel=l}if(e.channels||e.audioCodec){const o=Ac(e,r);if(o>-1)return r[o]}}}return null}setAudioTrack(e){const t=this.tracksInGroup;if(e<0||e>=t.length){this.warn(`Invalid audio track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,s=t[e],a=s.details&&!s.details.live;if(e===this.trackId&&s===r&&a||(this.log(`Switching to audio-track ${e} "${s.name}" lang:${s.lang} group:${s.groupId} channels:${s.channels}`),this.trackId=e,this.currentTrack=s,this.hls.trigger(V.AUDIO_TRACK_SWITCHING,zn({},s)),a))return;const o=this.switchParams(s.url,r==null?void 0:r.details,s.details);this.loadPlaylist(o)}findTrackId(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const s=t[r];if(!(this.selectDefaultTrack&&!s.default)&&(!e||bm(e,s,Vf)))return r}if(e){const{name:r,lang:s,assocLang:a,characteristics:o,audioCodec:l,channels:c}=e;for(let d=0;d<t.length;d++){const h=t[d];if(bm({name:r,lang:s,assocLang:a,characteristics:o,audioCodec:l,channels:c},h,Vf))return d}for(let d=0;d<t.length;d++){const h=t[d];if(zy(e.attrs,h.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return d}for(let d=0;d<t.length;d++){const h=t[d];if(zy(e.attrs,h.attrs,["LANGUAGE"]))return d}}return-1}loadPlaylist(e){super.loadPlaylist();const t=this.currentTrack;this.shouldLoadPlaylist(t)&&p1(t.url,this.hls)&&this.scheduleLoading(t,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,s=e.groupId,a=this.getUrlWithDirectives(e.url,t),o=e.details,l=o==null?void 0:o.age;this.log(`Loading audio-track ${r} "${e.name}" lang:${e.lang} group:${s}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&o.live?" age "+l.toFixed(1)+(o.type&&" "+o.type||""):""} ${a}`),this.hls.trigger(V.AUDIO_TRACK_LOADING,{url:a,id:r,groupId:s,deliveryDirectives:t||null,track:e})}}class k3e{constructor(e){this.tracks=void 0,this.queues={video:[],audio:[],audiovideo:[]},this.tracks=e}destroy(){this.tracks=this.queues=null}append(e,t,r){if(this.queues===null||this.tracks===null)return;const s=this.queues[t];s.push(e),s.length===1&&!r&&this.executeNext(t)}appendBlocker(e){return new Promise(t=>{const r={label:"async-blocker",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.append(r,e)})}prependBlocker(e){return new Promise(t=>{if(this.queues){const r={label:"async-blocker-prepend",execute:t,onStart:()=>{},onComplete:()=>{},onError:()=>{}};this.queues[e].unshift(r)}})}removeBlockers(){this.queues!==null&&[this.queues.video,this.queues.audio,this.queues.audiovideo].forEach(e=>{var t;const r=(t=e[0])==null?void 0:t.label;(r==="async-blocker"||r==="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 t=this.queues[e];if(t.length){const s=t[0];try{s.execute()}catch(a){var r;if(s.onError(a),this.queues===null||this.tracks===null)return;const o=(r=this.tracks[e])==null?void 0:r.buffer;o!=null&&o.updating||this.shiftAndExecuteNext(e)}}}shiftAndExecuteNext(e){this.queues!==null&&(this.queues[e].shift(),this.executeNext(e))}current(e){var t;return((t=this.queues)==null?void 0:t[e][0])||null}toString(){const{queues:e,tracks:t}=this;return e===null||t===null?"<destroyed>":`
4739${this.list("video")}
4740${this.list("audio")}
4741${this.list("audiovideo")}}`}list(e){var t,r;return(t=this.queues)!=null&&t[e]||(r=this.tracks)!=null&&r[e]?`${e}: (${this.listSbInfo(e)}) ${this.listOps(e)}`:""}listSbInfo(e){var t;const r=(t=this.tracks)==null?void 0:t[e],s=r==null?void 0:r.buffer;return s?`SourceBuffer${s.updating?" updating":""}${r.ended?" ended":""}${r.ending?" ending":""}`:"none"}listOps(e){var t;return((t=this.queues)==null?void 0:t[e].map(r=>r.label).join(", "))||""}}const SG=/(avc[1234]|hvc1|hev1|dvh[1e]|vp09|av01)(?:\.[^.,]+)+/,Eee="HlsJsTrackRemovedError";class N3e extends Error{constructor(e){super(e),this.name=Eee}}class _3e extends ul{constructor(e,t){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=r=>{var s;this.hls&&((s=this.mediaSource)==null?void 0:s.readyState)==="open"&&this.hls.pauseBuffering()},this._onStartStreaming=r=>{this.hls&&this.hls.resumeBuffering()},this._onMediaSourceOpen=r=>{const{media:s,mediaSource:a}=this;r&&this.log("Media source opened"),!(!s||!a)&&(a.removeEventListener("sourceopen",this._onMediaSourceOpen),s.removeEventListener("emptied",this._onMediaEmptied),this.updateDuration(),this.hls.trigger(V.MEDIA_ATTACHED,{media:s,mediaSource:a}),this.mediaSource!==null&&this.checkPendingTracks())},this._onMediaSourceClose=()=>{this.log("Media source closed")},this._onMediaSourceEnded=()=>{this.log("Media source ended")},this._onMediaEmptied=()=>{const{mediaSrc:r,_objectUrl:s}=this;r!==s&&this.error(`Media element src was set while attaching MediaSource (${s} > ${r})`)},this.hls=e,this.fragmentTracker=t,this.appendSource=XLe(Gh(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(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.BUFFER_RESET,this.onBufferReset,this),e.on(V.BUFFER_APPENDING,this.onBufferAppending,this),e.on(V.BUFFER_CODECS,this.onBufferCodecs,this),e.on(V.BUFFER_EOS,this.onBufferEos,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(V.FRAG_PARSED,this.onFragParsed,this),e.on(V.FRAG_CHANGED,this.onFragChanged,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.BUFFER_RESET,this.onBufferReset,this),e.off(V.BUFFER_APPENDING,this.onBufferAppending,this),e.off(V.BUFFER_CODECS,this.onBufferCodecs,this),e.off(V.BUFFER_EOS,this.onBufferEos,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(V.FRAG_PARSED,this.onFragParsed,this),e.off(V.FRAG_CHANGED,this.onFragChanged,this),e.off(V.ERROR,this.onError,this)}transferMedia(){const{media:e,mediaSource:t}=this;if(!e)return null;const r={};if(this.operationQueue){const a=this.isUpdating();a||this.operationQueue.removeBlockers();const o=this.isQueued();(a||o)&&this.warn(`Transfering MediaSource with${o?" operations in queue":""}${a?" updating SourceBuffer(s)":""} ${this.operationQueue}`),this.operationQueue.destroy()}const s=this.transferData;return!this.sourceBufferCount&&s&&s.mediaSource===t?sr(r,s.tracks):this.sourceBuffers.forEach(a=>{const[o]=a;o&&(r[o]=sr({},this.tracks[o]),this.removeBuffer(o)),a[0]=a[1]=null}),{media:e,mediaSource:t,tracks:r}}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,t){var r;let s=2;(t.audio&&!t.video||!t.altAudio)&&(s=1),this.bufferCodecEventsTotal=s,this.log(`${s}
4741 bufferCodec event(s) expected.`),(r=this.transferData)!=null&&r.mediaSource&&this.sourceBufferCount&&s&&this.bufferCreated()}onMediaAttaching(e,t){const r=this.media=t.media;this.transferData=this.overrides=void 0;const s=Gh(this.appendSource);if(s){const a=!!t.mediaSource;(a||t.overrides)&&(this.transferData=t,this.overrides=t.overrides);const o=this.mediaSource=t.mediaSource||new s;if(this.assignMediaSource(o),a)this._objectUrl=r.src,this.attachTransferred();else{const l=this._objectUrl=self.URL.createObjectURL(o);if(this.appendSource)try{r.removeAttribute("src");const c=self.ManagedMediaSource;r.disableRemotePlayback=r.disableRemotePlayback||c&&o instanceof c,TG(r),I3e(r,l),r.load()}catch{r.src=l}else r.src=l}r.addEventListener("emptied",this._onMediaEmptied)}}assignMediaSource(e){var t,r;this.log(`${((t=this.transferData)==null?void 0:t.mediaSource)===e?"transferred":"created"} media source: ${(r=e.constructor)==null?void 0:r.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,t=this.transferData;if(!t||!e)return;const r=this.tracks,s=t.tracks,a=s?Object.keys(s):null,o=a?a.length:0,l=()=>{Promise.resolve().then(()=>{this.media&&this.mediaSourceOpenOrEnded&&this._onMediaSourceOpen()})};if(s&&a&&o){if(!this.tracksReady){this.hls.config.startFragPrefetch=!0,this.log("attachTransferred: waiting for SourceBuffer track info");return}if(this.log(`attachTransferred: (bufferCodecEventsTotal ${this.bufferCodecEventsTotal})
4742required tracks: ${xr(r,(c,d)=>c==="initSegment"?void 0:d)};
4743transfer tracks: ${xr(s,(c,d)=>c==="initSegment"?void 0:d)}}`),!vZ(s,r)){t.mediaSource=null,t.tracks=void 0;const c=e.currentTime,d=this.details,h=Math.max(c,(d==null?void 0:d.fragments[0].start)||0);if(h-c>1){this.log(`attachTransferred: waiting for playback to reach new tracks start time ${c} -> ${h}`);return}this.warn(`attachTransferred: resetting MediaSource for incompatible tracks ("${Object.keys(s)}"->"${Object.keys(r)}") start time: ${h} currentTime: ${c}`),this.onMediaDetaching(V.MEDIA_DETACHING,{}),this.onMediaAttaching(V.MEDIA_ATTACHING,t),e.currentTime=h;return}this.transferData=void 0,a.forEach(c=>{const d=c,h=s[d];if(h){const m=h.buffer;if(m){const p=this.fragmentTracker,x=h.id;if(p.hasFragments(x)||p.hasParts(x)){const B=Vt.getBuffered(m);p.detectEvictedFragments(d,B,x,null,!0)}const y=HN(d),v=[d,m];this.sourceBuffers[y]=v,m.updating&&this.operationQueue&&this.operationQueue.prependBlocker(d),this.trackSourceBuffer(d,h)}}}),l(),this.bufferCreated()}else this.log("attachTransferred: MediaSource w/o SourceBuffers"),l()}get mediaSourceOpenOrEnded(){var e;const t=(e=this.mediaSource)==null?void 0:e.readyState;return t==="open"||t==="ended"}onMediaDetaching(e,t){const r=!!t.transferMedia;this.transferData=this.overrides=void 0;const{media:s,mediaSource:a,_objectUrl:o}=this;if(a){if(this.log(`media source ${r?"transferring":"detaching"}`),r)this.sourceBuffers.forEach(([l])=>{l&&this.removeBuffer(l)}),this.resetQueue();else{if(this.mediaSourceOpenOrEnded){const l=a.readyState==="open";try{const c=a.sourceBuffers;for(let d=c.length;d--;)l&&c[d].abort(),a.removeSourceBuffer(c[d]);l&&a.endOfStream()}catch(c){this.warn(`onMediaDetaching: ${c.message} while calling endOfStream`)}}this.sourceBufferCount&&this.onBufferReset()}a.removeEventListener("sourceopen",this._onMediaSourceOpen),a.removeEventListener("sourceended",this._onMediaSourceEnded),a.removeEventListener("sourceclose",this._onMediaSourceClose),this.appendSource&&(a.removeEventListener("startstreaming",this._onStartStreaming),a.removeEventListener("endstreaming",this._onEndStreaming)),this.mediaSource=null,this._objectUrl=null}s&&(s.removeEventListener("emptied",this._onMediaEmptied),r||(o&&self.URL.revokeObjectURL(o),this.mediaSrc===o?(s.removeAttribute("src"),this.appendSource&&TG(s),s.load()):this.warn("media|source.src was changed by a third party - skip cleanup")),this.media=null),this.hls.trigger(V.MEDIA_DETACHED,t)}
vendor: 15,191 bytes, line 4743
4743onBufferReset(){this.sourceBuffers.forEach(([e])=>{e&&this.resetBuffer(e)}),this.initTracks()}resetBuffer(e){var t;const r=(t=this.tracks[e])==null?void 0:t.buffer;if(this.removeBuffer(e),r)try{var s;(s=this.mediaSource)!=null&&s.sourceBuffers.length&&this.mediaSource.removeSourceBuffer(r)}catch(a){this.warn(`onBufferReset ${e}`,a)}delete this.tracks[e]}removeBuffer(e){this.removeBufferListeners(e),this.sourceBuffers[HN(e)]=[null,null];const t=this.tracks[e];t&&(t.buffer=void 0)}resetQueue(){this.operationQueue&&this.operationQueue.destroy(),this.operationQueue=new k3e(this.tracks)}onBufferCodecs(e,t){var r;const s=this.tracks,a=Object.keys(t);this.log(`BUFFER_CODECS: "${a}" (current SB count ${this.sourceBufferCount})`);const o="audiovideo"in t&&(s.audio||s.video)||s.audiovideo&&("audio"in t||"video"in t),l=!o&&this.sourceBufferCount&&this.media&&a.some(c=>!s[c]);if(o||l){this.warn(`Unsupported transition between "${Object.keys(s)}" and "${a}" SourceBuffers`);return}a.forEach(c=>{var d,h;const m=t[c],{id:p,codec:x,levelCodec:y,container:v,metadata:B,supplemental:E}=m;let N=s[c];const T=(d=this.transferData)==null||(d=d.tracks)==null?void 0:d[c],k=T!=null&&T.buffer?T:N,P=(k==null?void 0:k.pendingCodec)||(k==null?void 0:k.codec),R=k==null?void 0:k.levelCodec;N||(N=s[c]={buffer:void 0,listeners:[],codec:x,supplemental:E,container:v,levelCodec:y,metadata:B,id:p});const _=AC(P,R),I=_==null?void 0:_.replace(SG,"$1");let D=AC(x,y);const j=(h=D)==null?void 0:h.replace(SG,"$1");D&&_&&I!==j&&(c.slice(0,5)==="audio"&&(D=f1(D,this.appendSource)),this.log(`switching codec ${P} to ${D}`),D!==(N.pendingCodec||N.codec)&&(N.pendingCodec=D),N.container=v,this.appendChangeType(c,v,D))}),(this.tracksReady||this.sourceBufferCount)&&(t.tracks=this.sourceBufferTracks),!this.sourceBufferCount&&(this.bufferCodecEventsTotal>1&&!this.tracks.video&&!t.video&&((r=t.audio)==null?void 0:r.id)==="main"&&(this.log("Main audio-only"),this.bufferCodecEventsTotal=1),this.mediaSourceOpenOrEnded&&this.checkPendingTracks())}get sourceBufferTracks(){return Object.keys(this.tracks).reduce((e,t)=>{const r=this.tracks[t];return e[t]={id:r.id,container:r.container,codec:r.codec,levelCodec:r.levelCodec},e},{})}appendChangeType(e,t,r){const s=`${t};codecs=${r}`,a={label:`change-type=${s}`,execute:()=>{const o=this.tracks[e];if(o){const l=o.buffer;l!=null&&l.changeType&&(this.log(`changing ${e} sourceBuffer type to ${s}`),l.changeType(s),o.codec=r,o.container=t)}this.shiftAndExecuteNext(e)},onStart:()=>{},onComplete:()=>{},onError:o=>{this.warn(`Failed to change ${e} SourceBuffer type`,o)}};this.append(a,e,this.isPending(this.tracks[e]))}blockAudio(e){var t;const r=e.start,s=r+e.duration*.05;if(((t=this.fragmentTracker.getAppendedFrag(r,mt.MAIN))==null?void 0:t.gap)===!0)return;const o={label:"block-audio",execute:()=>{var l;const c=this.tracks.video;(this.lastVideoAppendEnd>s||c!=null&&c.buffer&&Vt.isBuffered(c.buffer,s)||((l=this.fragmentTracker.getAppendedFrag(s,mt.MAIN))==null?void 0:l.gap)===!0)&&(this.blockedAudioAppend=null,this.shiftAndExecuteNext("audio"))},onStart:()=>{},onComplete:()=>{},onError:l=>{this.warn("Error executing block-audio operation",l)}};this.blockedAudioAppend={op:o,frag:e},this.append(o,"audio",!0)}unblockAudio(){const{blockedAudioAppend:e,operationQueue:t}=this;e&&t&&(this.blockedAudioAppend=null,t.unblockAudio(e.op))}onBufferAppending(e,t){const{tracks:r}=this,{data:s,type:a,parent:o,frag:l,part:c,chunkMeta:d,offset:h}=t,m=d.buffering[a],{sn:p,cc:x}=l,y=self.performance.now();m.start=y;const v=l.stats.buffering,B=c?c.stats.buffering:null;v.start===0&&(v.start=y),B&&B.start===0&&(B.start=y);const E=r.audio;let N=!1;a==="audio"&&(E==null?void 0:E.container)==="audio/mpeg"&&(N=!this.lastMpegAudioChunk||d.id===1||this.lastMpegAudioChunk.sn!==d.sn,this.lastMpegAudioChunk=d);const T=r.video,k=T==null?void 0:T.buffer;if(k&&p!=="initSegment"){const _=c||l,I=this.blockedAudioAppend;if(a==="audio"&&o!=="main"&&!this.blockedAudioAppend&&!(T.ending||T.ended)){const j=_.start+_.duration*.05,O=k.buffered,M=this.currentOp("video");!O.length&&!M?this.blockAudio(_):!M&&!Vt.isBuffered(k,j)&&this.lastVideoAppendEnd<j&&this.blockAudio(_)}else if(a==="video"){const D=_.end;if(I){const j=I.frag.start;(D>j||D<this.lastVideoAppendEnd||Vt.isBuffered(k,j))&&this.unblockAudio()}this.lastVideoAppendEnd=D}}const P=(c||l).start,R={label:`append-${a}`,execute:()=>{var _;m.executeStart=self.performance.now();const I=(_=this.tracks[a])==null?void 0:_.buffer;I&&(N?this.updateTimestampOffset(I,P,.1,a,p,x):h!==void 0&&ct(h)&&this.updateTimestampOffset(I,h,1e-6,a,p,x)),this.appendExecutor(s,a)},onStart:()=>{},onComplete:()=>{const _=self.performance.now();m.executeEnd=m.end=_,v.first===0&&(v.first=_),B&&B.first===0&&(B.first=_);const I={};this.sourceBuffers.forEach(([D,j])=>{D&&(I[D]=Vt.getBuffered(j))}),this.appendErrors[a]=0,a==="audio"||a==="video"?this.appendErrors.audiovideo=0:(this.appendErrors.audio=0,this.appendErrors.video=0),this.hls.trigger(V.BUFFER_APPENDED,{type:a,frag:l,part:c,chunkMeta:d,parent:l.type,timeRanges:I})},onError:_=>{var I;const D={type:Bt.MEDIA_ERROR,parent:l.type,details:Ee.BUFFER_APPEND_ERROR,sourceBufferName:a,frag:l,part:c,chunkMeta:d,error:_,err:_,fatal:!1},j=(I=this.media)==null?void 0:I.error;if(_.code===DOMException.QUOTA_EXCEEDED_ERR||_.name=="QuotaExceededError"||"quota"in _)D.details=Ee.BUFFER_FULL_ERROR;else if(_.code===DOMException.INVALID_STATE_ERR&&this.mediaSourceOpenOrEnded&&!j)D.errorAction=F0(!0);else if(_.name===Eee&&this.sourceBufferCount===0)D.errorAction=F0(!0);else{const O=++this.appendErrors[a];this.warn(`Failed ${O}/${this.hls.config.appendErrorMaxRetry} times to append segment in "${a}" sourceBuffer (${j||"no media error"})`),(O>=this.hls.config.appendErrorMaxRetry||j)&&(D.fatal=!0)}this.hls.trigger(V.ERROR,D)}};this.log(`queuing "${a}" append sn: ${p}${c?" p: "+c.index:""} of ${l.type===mt.MAIN?"level":"track"} ${l.level} cc: ${x}`),this.append(R,a,this.isPending(this.tracks[a]))}getFlushOp(e,t,r){return this.log(`queuing "${e}" remove ${t}-${r}`),{label:"remove",execute:()=>{this.removeExecutor(e,t,r)},onStart:()=>{},onComplete:()=>{this.hls.trigger(V.BUFFER_FLUSHED,{type:e})},onError:s=>{this.warn(`Failed to remove ${t}-${r} from "${e}" SourceBuffer`,s)}}}onBufferFlushing(e,t){const{type:r,startOffset:s,endOffset:a}=t;r?this.append(this.getFlushOp(r,s,a),r):this.sourceBuffers.forEach(([o])=>{o&&this.append(this.getFlushOp(o,s,a),o)})}onFragParsed(e,t){const{frag:r,part:s}=t,a=[],o=s?s.elementaryStreams:r.elementaryStreams;o[hr.AUDIOVIDEO]?a.push("audiovideo"):(o[hr.AUDIO]&&a.push("audio"),o[hr.VIDEO]&&a.push("video"));const l=()=>{const c=self.performance.now();r.stats.buffering.end=c,s&&(s.stats.buffering.end=c);const d=s?s.stats:r.stats;this.hls.trigger(V.FRAG_BUFFERED,{frag:r,part:s,stats:d,id:r.type})};a.length===0&&this.warn(`Fragments must have at least one ElementaryStreamType set. type: ${r.type} level: ${r.level} sn: ${r.sn}`),this.blockBuffers(l,a).catch(c=>{this.warn(`Fragment buffered callback ${c}`),this.stepOperationQueue(this.sourceBufferTypes)})}onFragChanged(e,t){this.trimBuffers()}get bufferedToEnd(){return this.sourceBufferCount>0&&!this.sourceBuffers.some(([e])=>{if(e){const t=this.tracks[e];if(t)return!t.ended||t.ending}return!1})}onBufferEos(e,t){var r;this.sourceBuffers.forEach(([o])=>{if(o){const l=this.tracks[o];(!t.type||t.type===o)&&(l.ending=!0,l.ended||(l.ended=!0,this.log(`${o} buffer reached EOS`)))}});const s=((r=this.overrides)==null?void 0:r.endOfStream)!==!1;this.sourceBufferCount>0&&!this.sourceBuffers.some(([o])=>{var l;return o&&!((l=this.tracks[o])!=null&&l.ended)})?s?(this.log("Queueing EOS"),this.blockUntilOpen(()=>{this.tracksEnded();const{mediaSource:o}=this;if(!o||o.readyState!=="open"){o&&this.log(`Could not call mediaSource.endOfStream(). mediaSource.readyState: ${o.readyState}`);return}this.log("Calling mediaSource.endOfStream()"),o.endOfStream(),this.hls.trigger(V.BUFFERED_TO_END,void 0)})):(this.tracksEnded(),this.hls.trigger(V.BUFFERED_TO_END,void 0)):t.type==="video"&&this.unblockAudio()}tracksEnded(){this.sourceBuffers.forEach(([e])=>{if(e!==null){const t=this.tracks[e];t&&(t.ending=!1)}})}onLevelUpdated(e,{details:t}){t.fragments.length&&(this.details=t,this.updateDuration())}updateDuration(){this.blockUntilOpen(()=>{const e=this.getDurationAndRange();e&&this.updateMediaSource(e)})}onError(e,t){if(t.details===Ee.BUFFER_APPEND_ERROR&&t.frag){var r;const s=(r=t.errorAction)==null?void 0:r.nextAutoLevel;ct(s)&&s!==t.frag.level&&this.resetAppendErrors()}}resetAppendErrors(){this.appendErrors={audio:0,video:0,audiovideo:0}}trimBuffers(){const{hls:e,details:t,media:r}=this;if(!r||t===null||!this.sourceBufferCount)return;const s=e.config,a=r.currentTime,o=t.levelTargetDuration,l=t.live&&s.liveBackBufferLength!==null?s.liveBackBufferLength:s.backBufferLength;if(ct(l)&&l>=0){const d=Math.max(l,o),h=Math.floor(a/o)*o-d;this.flushBackBuffer(a,o,h)}const c=s.frontBufferFlushThreshold;if(ct(c)&&c>0){const d=Math.max(s.maxBufferLength,c),h=Math.max(d,o),m=Math.floor(a/o)*o+h;this.flushFrontBuffer(a,o,m)}}flushBackBuffer(e,t,r){this.sourceBuffers.forEach(([s,a])=>{if(a){const l=Vt.getBuffered(a);if(l.length>0&&r>l.start(0)){var o;this.hls.trigger(V.BACK_BUFFER_REACHED,{bufferEnd:r});const c=this.tracks[s];if((o=this.details)!=null&&o.live)this.hls.trigger(V.LIVE_BACK_BUFFER_REACHED,{bufferEnd:r});else if(c!=null&&c.ended){this.log(`Cannot flush ${s} back buffer while SourceBuffer is in ended state`);return}this.hls.trigger(V.BUFFER_FLUSHING,{startOffset:0,endOffset:r,type:s})}}})}flushFrontBuffer(e,t,r){this.sourceBuffers.forEach(([s,a])=>{if(a){const o=Vt.getBuffered(a),l=o.length;if(l<2)return;const c=o.start(l-1),d=o.end(l-1);if(r>c||e>=c&&e<=d)return;this.hls.trigger(V.BUFFER_FLUSHING,{startOffset:c,endOffset:1/0,type:s})}})}getDurationAndRange(){var e;const{details:t,mediaSource:r}=this;if(!t||!this.media||(r==null?void 0:r.readyState)!=="open")return null;const s=t.edge;if(t.live&&this.hls.config.liveDurationInfinity){if(t.fragments.length&&r.setLiveSeekableRange){const d=Math.max(0,t.fragmentStart),h=Math.max(d,s);return{duration:1/0,start:d,end:h}}return{duration:1/0}}const a=(e=this.overrides)==null?void 0:e.duration;if(a)return ct(a)?{duration:a}:null;const o=this.media.duration,l=ct(r.duration)?r.duration:0;return s>l&&s>o||!ct(o)?{duration:s}:null}updateMediaSource({duration:e,start:t,end:r}){const s=this.mediaSource;!this.media||!s||s.readyState!=="open"||(s.duration!==e&&(ct(e)&&this.log(`Updating MediaSource duration to ${e.toFixed(3)}`),s.duration=e),t!==void 0&&r!==void 0&&(this.log(`MediaSource duration is set to ${s.duration}. Setting seekable range to ${t}-${r}.`),s.setLiveSeekableRange(t,r)))}get tracksReady(){const e=this.pendingTrackCount;return e>0&&(e>=this.bufferCodecEventsTotal||this.isPending(this.tracks.audiovideo))}checkPendingTracks(){const{bufferCodecEventsTotal:e,pendingTrackCount:t,tracks:r}=this;if(this.log(`checkPendingTracks (pending: ${t} codec events expected: ${e}) ${xr(r)}`),this.tracksReady){var s;const a=(s=this.transferData)==null?void 0:s.tracks;a&&Object.keys(a).length?this.attachTransferred():this.createSourceBuffers()}}bufferCreated(){if(this.sourceBufferCount){const e={};this.sourceBuffers.forEach(([t,r])=>{if(t){const s=this.tracks[t];e[t]={buffer:r,container:s.container,codec:s.codec,supplemental:s.supplemental,levelCodec:s.levelCodec,id:s.id,metadata:s.metadata}}}),this.hls.trigger(V.BUFFER_CREATED,{tracks:e}),this.log(`SourceBuffers created. Running queue: ${this.operationQueue}`),this.sourceBuffers.forEach(([t])=>{this.executeNext(t)})}else{const e=new Error("could not create source buffer for media codec(s)");this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_INCOMPATIBLE_CODECS_ERROR,fatal:!0,error:e,reason:e.message})}}createSourceBuffers(){const{tracks:e,sourceBuffers:t,mediaSource:r}=this;if(!r)throw new Error("createSourceBuffers called when mediaSource was null");for(const a in e){const o=a,l=e[o];if(this.isPending(l)){const c=this.getTrackCodec(l,o),d=`${l.container};codecs=${c}`;l.codec=c,this.log(`creating sourceBuffer(${d})${this.currentOp(o)?" Queued":""} ${xr(l)}`);try{const h=r.addSourceBuffer(d),m=HN(o),p=[o,h];t[m]=p,l.buffer=h}catch(h){var s;this.error(`error while trying to add sourceBuffer: ${h.message}`),this.shiftAndExecuteNext(o),(s=this.operationQueue)==null||s.removeBlockers(),delete this.tracks[o],this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_ADD_CODEC_ERROR,fatal:!1,error:h,sourceBufferName:o,mimeType:d,parent:l.id});return}this.trackSourceBuffer(o,l)}}this.bufferCreated()}getTrackCodec(e,t){const r=e.supplemental;let s=e.codec;r&&(t==="video"||t==="audiovideo")&&Fy(r,"video")&&(s=vOe(s,r));const a=AC(s,e.levelCodec);return a?t.slice(0,5)==="audio"?f1(a,this.appendSource):a:""}trackSourceBuffer(e,t){const r=t.buffer;if(!r)return;const s=this.getTrackCodec(t,e);this.tracks[e]={buffer:r,codec:s,container:t.container,levelCodec:t.levelCodec,supplemental:t.supplemental,metadata:t.metadata,id:t.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",(a,o)=>{const l=o.removedRanges;l!=null&&l.length&&this.hls.trigger(V.BUFFER_FLUSHED,{type:a})})}get mediaSrc(){var e,t;const r=((e=this.media)==null||(t=e.querySelector)==null?void 0:t.call(e,"source"))||this.media;return r==null?void 0:r.src}onSBUpdateStart(e){const t=this.currentOp(e);t&&t.onStart()}onSBUpdateEnd(e){var t;if(((t=this.mediaSource)==null?void 0:t.readyState)==="closed"){this.resetBuffer(e);return}const r=this.currentOp(e);r&&(r.onComplete(),this.shiftAndExecuteNext(e))}onSBUpdateError(e,t){var r;const s=new Error(`${e} SourceBuffer error. MediaSource readyState: ${(r=this.mediaSource)==null?void 0:r.readyState}`);this.error(`${s}`,t),this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_APPENDING_ERROR,sourceBufferName:e,error:s,fatal:!1});const a=this.currentOp(e);a&&a.onError(s)}updateTimestampOffset(e,t,r,s,a,o){const l=t-e.timestampOffset;Math.abs(l)>=r&&(this.log(`Updating ${s} SourceBuffer timestampOffset to ${t} (sn: ${a} cc: ${o})`),e.timestampOffset=t)}removeExecutor(e,t,r){const{media:s,mediaSource:a}=this,o=this.tracks[e],l=o==null?void 0:o.buffer;if(!s||!a||!l){this.warn(`Attempting to remove from the ${e} SourceBuffer, but it does not exist`),this.shiftAndExecuteNext(e);return}const c=ct(s.duration)?s.duration:1/0,d=ct(a.duration)?a.duration:1/0,h=Math.max(0,t),m=Math.min(r,c,d);m>h&&(!o.ending||o.ended)?(o.ended=!1,this.log(`Removing [${h},${m}] from the ${e} SourceBuffer`),l.remove(h,m)):this.shiftAndExecuteNext(e)}appendExecutor(e,t){const r=this.tracks[t],s=r==null?void 0:r.buffer;if(!s)throw new N3e(`Attempting to append to the ${t} SourceBuffer, but it does not exist`);r.ending=!1,r.ended=!1,s.appendBuffer(e)}blockUntilOpen(e){if(this.isUpdating()||this.isQueued())this.blockBuffers(e).catch(t=>{this.warn(`SourceBuffer blocked callback ${t}
4743`),this.stepOperationQueue(this.sourceBufferTypes)});else try{e()}catch(t){this.warn(`Callback run without blocking ${this.operationQueue} ${t}`)}}isUpdating(){return this.sourceBuffers.some(([e,t])=>e&&t.updating)}isQueued(){return this.sourceBuffers.some(([e])=>e&&!!this.currentOp(e))}isPending(e){return!!e&&!e.buffer}blockBuffers(e,t=this.sourceBufferTypes){if(!t.length)return this.log("Blocking operation requested, but no SourceBuffers exist"),Promise.resolve().then(e);const{operationQueue:r}=this,s=t.map(o=>this.appendBlocker(o));return t.length>1&&!!this.blockedAudioAppend&&this.unblockAudio(),Promise.all(s).then(o=>{r===this.operationQueue&&(e(),this.stepOperationQueue(this.sourceBufferTypes))})}stepOperationQueue(e){e.forEach(t=>{var r;const s=(r=this.tracks[t])==null?void 0:r.buffer;!s||s.updating||this.shiftAndExecuteNext(t)})}append(e,t,r){this.operationQueue&&this.operationQueue.append(e,t,r)}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,t)=>e+(this.isPending(this.tracks[t])?1:0),0)}get sourceBufferCount(){return this.sourceBuffers.reduce((e,[t])=>e+(t?1:0),0)}get sourceBufferTypes(){return this.sourceBuffers.map(([e])=>e).filter(e=>!!e)}addBufferListener(e,t,r){const s=this.tracks[e];if(!s)return;const a=s.buffer;if(!a)return;const o=r.bind(this,e);s.listeners.push({event:t,listener:o}),a.addEventListener(t,o)}removeBufferListeners(e){const t=this.tracks[e];if(!t)return;const r=t.buffer;r&&(t.listeners.forEach(s=>{r.removeEventListener(s.event,s.listener)}),t.listeners.length=0)}}function TG(n){const e=n.querySelectorAll("source");[].slice.call(e).forEach(t=>{n.removeChild(t)})}function I3e(n,e){const t=self.document.createElement("source");t.type="video/mp4",t.src=e,n.appendChild(t)}function HN(n){return n==="audio"?1:0}class n5{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(V.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.on(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.BUFFER_CODECS,this.onBufferCodecs,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListener(){const{hls:e}=this;e.off(V.FPS_DROP_LEVEL_CAPPING,this.onFpsDropLevelCapping,this),e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.BUFFER_CODECS,this.onBufferCodecs,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this)}onFpsDropLevelCapping(e,t){const r=this.hls.levels[t.droppedLevel];this.isLevelAllowed(r)&&this.restrictedLevels.push({bitrate:r.bitrate,height:r.height,width:r.width})}onMediaAttaching(e,t){this.media=t.media instanceof HTMLVideoElement?t.media:null,this.clientRect=null,this.timer&&this.hls.levels.length&&this.detectPlayerSize()}onManifestParsed(e,t){const r=this.hls;this.restrictedLevels=[],this.firstLevel=t.firstLevel,r.config.capLevelToPlayerSize&&t.video&&this.startCapping()}onLevelsUpdated(e,t){this.timer&&ct(this.autoLevelCapping)&&this.detectPlayerSize()}onBufferCodecs(e,t){this.hls.config.capLevelToPlayerSize&&t.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 t=this.hls,r=this.getMaxLevel(e.length-1);r!==this.autoLevelCapping&&t.logger.log(`Setting autoLevelCapping to ${r}: ${e[r].height}p@${e[r].bitrate} for media ${this.mediaWidth}x${this.mediaHeight}`),t.autoLevelCapping=r,t.autoLevelEnabled&&t.autoLevelCapping>this.autoLevelCapping&&this.streamController&&this.streamController.nextLevelSwitch(),this.autoLevelCapping=t.autoLevelCapping}}}getMaxLevel(e){const t=this.hls.levels;if(!t.length)return-1;const r=t.filter((s,a)=>this.isLevelAllowed(s)&&a<=e);return this.clientRect=null,n5.getMaxLevelByMediaSize(r,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,t={width:0,height:0};if(e){const r=e.getBoundingClientRect();t.width=r.width,t.height=r.height,!t.width&&!t.height&&(t.width=r.right-r.left||e.
vendor: 4,513 bytes, line 4743
4743width||0,t.height=r.bottom-r.top||e.height||0)}return this.clientRect=t,t}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(r=>e.bitrate===r.bitrate&&e.width===r.width&&e.height===r.height)}static getMaxLevelByMediaSize(e,t,r){if(!(e!=null&&e.length))return-1;const s=(l,c)=>c?l.width!==c.width||l.height!==c.height:!0;let a=e.length-1;const o=Math.max(t,r);for(let l=0;l<e.length;l+=1){const c=e[l];if((c.width>=o||c.height>=o)&&s(c,e[l+1])){a=l;break}}return a}}const D3e={MANIFEST:"m",AUDIO:"a",VIDEO:"v",MUXED:"av",INIT:"i",CAPTION:"c",TIMED_TEXT:"tt",KEY:"k",OTHER:"o"},Li=D3e,j3e={HLS:"h"},R3e=j3e;class $c{constructor(e,t){Array.isArray(e)&&(e=e.map(r=>r instanceof $c?r:new $c(r))),this.value=e,this.params=t}}const P3e="Dict";function L3e(n){return Array.isArray(n)?JSON.stringify(n):n instanceof Map?"Map{}":n instanceof Set?"Set{}":typeof n=="object"?JSON.stringify(n):String(n)}function O3e(n,e,t,r){return new Error(`failed to ${n} "${L3e(e)}" as ${t}`,{cause:r})}function Hc(n,e,t){return O3e("serialize",n,e,t)}class See{constructor(e){this.description=e}}const AG="Bare Item",M3e="Boolean";function F3e(n){if(typeof n!="boolean")throw Hc(n,M3e);return n?"?1":"?0"}function U3e(n){return btoa(String.fromCharCode(...n))}const V3e="Byte Sequence";function G3e(n){if(ArrayBuffer.isView(n)===!1)throw Hc(n,V3e);return`:${U3e(n)}:`}const $3e="Integer";function H3e(n){return n<-999999999999999||999999999999999<n}function Tee(n){if(H3e(n))throw Hc(n,$3e);return n.toString()}function z3e(n){return`@${Tee(n.getTime()/1e3)}`}function Aee(n,e){if(n<0)return-Aee(-n,e);const t=Math.pow(10,e);if(Math.abs(n*t%1-.5)<Number.EPSILON){const s=Math.floor(n*t);return(s%2===0?s:s+1)/t}else return Math.round(n*t)/t}const q3e="Decimal";function K3e(n){const e=Aee(n,3);if(Math.floor(Math.abs(e)).toString().length>12)throw Hc(n,q3e);const t=e.toString();return t.includes(".")?t:`${t}.0`}const W3e="String",Y3e=/[\x00-\x1f\x7f]+/;function Q3e(n){if(Y3e.test(n))throw Hc(n,W3e);return`"${n.replace(/\\/g,"\\\\").replace(/"/g,'\\"')}"`}function J3e(n){return n.description||n.toString().slice(7,-1)}const X3e="Token";function kG(n){const e=J3e(n);if(/^([a-zA-Z*])([!#$%&'*+\-.^_`|~\w:/]*)$/.test(e)===!1)throw Hc(e,X3e);return e}function vD(n){switch(typeof n){case"number":if(!ct(n))throw Hc(n,AG);return Number.isInteger(n)?Tee(n):K3e(n);case"string":return Q3e(n);case"symbol":return kG(n);case"boolean":return F3e(n);case"object":if(n instanceof Date)return z3e(n);if(n instanceof Uint8Array)return G3e(n);if(n instanceof See)return kG(n);default:throw Hc(n,AG)}}const Z3e="Key";function BD(n){if(/^[a-z*][a-z0-9\-_.*]*$/.test(n)===!1)throw Hc(n,Z3e);return n}function r5(n){return n==null?"":Object.entries(n).map(([e,t])=>t===!0?`;${BD(e)}`:`;${BD(e)}=${vD(t)}`).join("")}function kee(n){return n instanceof $c?`${vD(n.value)}${r5(n.params)}`:vD(n)}function e4e(n){return`(${n.value.map(kee).join(" ")})${r5(n.params)}`}function t4e(n,e={whitespace:!0}){if(typeof n!="object"||n==null)throw Hc(n,P3e);const t=n instanceof Map?n.entries():Object.entries(n),r=e!=null&&e.whitespace?" ":"";return Array.from(t).map(([s,a])=>{a instanceof $c||(a=new $c(a));let o=BD(s);return a.value===!0?o+=r5(a.params):(o+="=",Array.isArray(a.value)?o+=e4e(a):o+=kee(a)),o}).join(`,${r}`)}function Nee(n,e){return t4e(n,e)}const lc="CMCD-Object",is="CMCD-Request",Nf="CMCD-Session",qu="CMCD-Status",n4e={br:lc,ab:lc,d:lc,ot:lc,tb:lc,tpb:lc,lb:lc,tab:lc,lab:lc,url:lc,pb:is,bl:is,tbl:is,dl:is,ltc:is,mtp:is,nor:is,nrr:is,rc:is,sn:is,sta:is,su:is,ttfb:is,ttfbb:is,ttlb:is,cmsdd:is,cmsds:is,smrt:is,df:is,cs:is,ts:is,cid:Nf,pr:Nf,sf:Nf,sid:Nf,st:Nf,v:Nf,msd:Nf,bs:qu,bsd:qu,cdn:qu,rtp:qu,bg:qu,pt:qu,ec:qu,e:qu},r4e={REQUEST:is};function s4e(n){return Object.keys(n).reduce((e,t)=>{var r;return(r=n[t])===null||r===void 0||r.forEach(s=>e[s]=t),e},{})}function a4e(n,e){const t={};if(!n)return t;const r=Object.keys(n),s=e?s4e(e):{};return r.reduce((a,o)=>{var l;const c=n4e[o]||s[o]||r4e.REQUEST,d=(l=a[c])!==null&&l!==void 0?l:a[c]={};return d[o]=n[o],a},t)}function i4e(n){return["ot","sf","st","e","sta"].includes(n)}function o4e(n){return typeof n=="number"?ct(n):n!=null&&n!==""&&n!==!1}const _ee="event";
4743function l4e(n,e){const t=new URL(n),r=new URL(e);if(t.origin!==r.origin)return n;const s=t.pathname.split("/").slice(1),a=r.pathname.split("/").slice(1,-1);for(;s[0]===a[0];)s.shift(),a.shift();for(;a.length;)a.shift(),s.unshift("..");return s.join("/")+t.search+t.hash}const DC=n=>Math.round(n),wD=(n,e)=>Array.isArray(n)?n.map(t=>wD(t,e)):n instanceof $c&&typeof n.value=="string"?new $c(wD(n.value,e),n.params):(e.baseUrl&&(n=l4e(n,e.baseUrl)),e.version===1?encodeURIComponent(n):n),Uw=n=>DC(n/100)*100,c4e=(n,e)=>{let t=n;return e.version>=2&&(n instanceof $c&&typeof n.value=="string"?t=new $c([n]):typeof n=="string"&&(t=[n])),wD(t,e)},d4e={br:DC,d:DC,bl:Uw,dl:Uw,mtp:Uw,nor:c4e,rtp:Uw,tb:DC},Iee="request",Dee="response",s5=["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"],u4e=["e"],h4e=/^[a-zA-Z0-9-.]+-[a-zA-Z0-9-.]+$/;function fT(n){return h4e.test(n)}function f4e(n){return s5.includes(n)||u4e.includes(n)||fT(n)}const jee=["d","dl","nor","ot","rtp","su"];function m4e(n){return s5.includes(n)||jee.includes(n)||fT(n)}const p4e=["cmsdd","cmsds","rc","smrt","ttfb","ttfbb","ttlb","url"];function g4e(n){return s5.includes(n)||jee.includes(n)||p4e.includes(n)||fT(n)}const x4e=["bl","br","bs","cid","d","dl","mtp","nor","nrr","ot","pr","rtp","sf","sid","st","su","tb","v"];function b4e(n){return x4e.includes(n)||fT(n)}const y4e={[Dee]:g4e,[_ee]:f4e,[Iee]:m4e};function Ree(n,e={}){const t={};if(n==null||typeof n!="object")return t;const r=e.version||n.v||1,s=e.reportingMode||Iee,a=r===1?b4e:y4e[s];let o=Object.keys(n).filter(a);const l=e.filter;typeof l=="function"&&(o=o.filter(l));const c=s===Dee||s===_ee;c&&!o.includes("ts")&&o.push("ts"),r>1&&!o.includes("v")&&o.push("v");const d=sr({},d4e,e.formatters),h={version:r,reportingMode:s,baseUrl:e.baseUrl};return o.sort().forEach(m=>{let p=n[m];const x=d[m];if(typeof x=="function"&&(p=x(p,h)),m==="v"){if(r===1)return;p=r}m=="pr"&&p===1||(c&&m==="ts"&&!ct(p)&&(p=Date.now()),o4e(p)&&(i4e(m)&&typeof p=="string"&&(p=new See(p)),t[m]=p))}),t}function v4e(n,e={}){const t={};if(!n)return t;const r=Ree(n,e),s=a4e(r,e==null?void 0:e.customHeaderMap);return Object.entries(s).reduce((a,[o,l])=>{const c=Nee(l,{whitespace:!1});return c&&(a[o]=c),a},t)}function B4e(n,e,t){return sr(n,v4e(e,t))}const w4e="CMCD";function C4e(n,e={}){return n?Nee(Ree(n,e),{whitespace:!1}):""}function E4e(n,e={}){if(!n)return"";const t=C4e(n,e);return encodeURIComponent(t)}function S4e(n,e={}){if(!n)return"";const t=E4e(n,e);return`${w4e}=${t}`}const NG=/CMCD=[^&#]+/;function T4e(n,e,t){const r=S4e(e,t);if(!r)return n;if(NG.test(n))return n.replace(NG,r);const s=n.includes("?")?"&":"?";return`${n}${s}${r}`}class A4e{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=s=>{try{this.apply(s,{ot:Li.MANIFEST,su:!this.initialized})}catch(a){this.hls.logger.warn("Could not generate manifest CMCD data.",a)}},this.applyFragmentData=s=>{try{const{frag:a,part:o}=s,l=this.hls.levels[a.level],c=this.getObjectType(a),d={d:(o||a).duration*1e3,ot:c};(c===Li.VIDEO||c===Li.AUDIO||c==Li.MUXED)&&(d.br=l.bitrate/1e3,d.tb=this.getTopBandwidth(c)/1e3,d.bl=this.getBufferLength(c));const h=o?this.getNextPart(o):this.getNextFrag(a);h!=null&&h.url&&h.url!==a.url&&(d.nor=h.url),this.apply(s,d)}catch(a){this.hls.logger.warn("Could not generate segment CMCD data.",a)}},this.hls=e;const t=this.config=e.config,{cmcd:r}=t;r!=null&&(t.pLoader=this.createPlaylistLoader(),t.fLoader=this.createFragmentLoader(),this.sid=r.sessionId||e.sessionId,this.cid=r.contentId,this.useHeaders=r.useHeaders===!0,this.includeKeys=r.includeKeys,this.registerListeners())}registerListeners(){const e=this.hls;
4743e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHED,this.onMediaDetached,this),e.on(V.BUFFER_CREATED,this.onBufferCreated,this)}unregisterListeners(){const e=this.hls;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHED,this.onMediaDetached,this),e.off(V.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,t){this.media=t.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,t){var r,s;this.audioBuffer=(r=t.tracks.audio)==null?void 0:r.buffer,this.videoBuffer=(s=t.tracks.video)==null?void 0:s.buffer}createData(){var e;return{v:1,sf:R3e.HLS,sid:this.sid,cid:this.cid,pr:(e=this.media)==null?void 0:e.playbackRate,mtp:this.hls.bandwidthEstimate/1e3}}apply(e,t={}){sr(t,this.createData());const r=t.ot===Li.INIT||t.ot===Li.VIDEO||t.ot===Li.MUXED;this.starved&&r&&(t.bs=!0,t.su=!0,this.starved=!1),t.su==null&&(t.su=this.buffering);const{includeKeys:s}=this;s&&(t=Object.keys(t).reduce((o,l)=>(s.includes(l)&&(o[l]=t[l]),o),{}));const a={baseUrl:e.url};this.useHeaders?(e.headers||(e.headers={}),B4e(e.headers,t,a)):e.url=T4e(e.url,t,a)}getNextFrag(e){var t;const r=(t=this.hls.levels[e.level])==null?void 0:t.details;if(r){const s=e.sn-r.startSN;return r.fragments[s+1]}}getNextPart(e){var t;const{index:r,fragment:s}=e,a=(t=this.hls.levels[s.level])==null||(t=t.details)==null?void 0:t.partList;if(a){const{sn:o}=s;for(let l=a.length-1;l>=0;l--){const c=a[l];if(c.index===r&&c.fragment.sn===o)return a[l+1]}}}getObjectType(e){const{type:t}=e;if(t==="subtitle")return Li.TIMED_TEXT;if(e.sn==="initSegment")return Li.INIT;if(t==="audio")return Li.AUDIO;if(t==="main")return this.hls.audioTracks.length?Li.VIDEO:Li.MUXED}getTopBandwidth(e){let t=0,r;const s=this.hls;if(e===Li.AUDIO)r=s.audioTracks;else{const a=s.maxAutoLevel,o=a>-1?a+1:s.levels.length;r=s.levels.slice(0,o)}return r.forEach(a=>{a.bitrate>t&&(t=a.bitrate)}),t>0?t:NaN}getBufferLength(e){const t=this.media,r=e===Li.AUDIO?this.audioBuffer:this.videoBuffer;return!r||!t?NaN:Vt.bufferInfo(r,t.currentTime,this.config.maxBufferHole).len*1e3}createPlaylistLoader(){const{pLoader:e}=this.config,t=this.applyPlaylistData,r=e||this.config.loader;return class{constructor(a){this.loader=void 0,this.loader=new r(a)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(a,o,l){t(a),this.loader.load(a,o,l)}}}createFragmentLoader(){const{fLoader:e}=this.config,t=this.applyFragmentData,r=e||this.config.loader;return class{constructor(a){this.loader=void 0,this.loader=new r(a)}get stats(){return this.loader.stats}get context(){return this.loader.context}destroy(){this.loader.destroy()}abort(){this.loader.abort()}load(a,o,l){t(a),this.loader.load(a,o,l)}}}}const k4e=3e5;class N4e extends ul{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(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const e=this.hls;e&&(e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.ERROR,this.onError,this))}pathways(){return(this.levels||[]).reduce((e,t)=>(e.indexOf(t.pathwayId)===-1&&e.push(t.pathwayId),e),[])}get pathwayPriority(){return this._pathwayPriority}set pathwayPriority(e){this.updatePathwayPriority(e)}
vendor: 5,391 bytes, line 4743
4743startLoad(){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 t=this.levels;t&&(this.levels=t.filter(r=>r!==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,t){const{contentSteering:r}=t;r!==null&&(this.pathwayId=r.pathwayId,this.uri=r.uri,this.started&&this.startLoad())}onManifestParsed(e,t){this.audioTracks=t.audioTracks,this.subtitleTracks=t.subtitleTracks}onError(e,t){const{errorAction:r}=t;if((r==null?void 0:r.action)===Da.SendAlternateToPenaltyBox&&r.flags===fo.MoveAllAlternatesMatchingHost){const s=this.levels;let a=this._pathwayPriority,o=this.pathwayId;if(t.context){const{groupId:l,pathwayId:c,type:d}=t.context;l&&s?o=this.getPathwayForGroupId(l,d,o):c&&(o=c)}o in this.penalizedPathways||(this.penalizedPathways[o]=performance.now()),!a&&s&&(a=this.pathways()),a&&a.length>1&&(this.updatePathwayPriority(a),r.resolved=this.pathwayId!==o),t.details===Ee.BUFFER_APPEND_ERROR&&!t.fatal?r.resolved=!0:r.resolved||this.warn(`Could not resolve ${t.details} ("${t.error.message}") with content-steering for Pathway: ${o} levels: ${s&&s.length} priorities: ${xr(a)} penalized: ${xr(this.penalizedPathways)}`)}}filterParsedLevels(e){this.levels=e;let t=this.getLevelsForPathway(this.pathwayId);if(t.length===0){const r=e[0].pathwayId;this.log(`No levels found in Pathway ${this.pathwayId}. Setting initial Pathway to "${r}"`),t=this.getLevelsForPathway(r),this.pathwayId=r}return t.length!==e.length&&this.log(`Found ${t.length}/${e.length} levels in Pathway "${this.pathwayId}"`),t}getLevelsForPathway(e){return this.levels===null?[]:this.levels.filter(t=>e===t.pathwayId)}updatePathwayPriority(e){this._pathwayPriority=e;let t;const r=this.penalizedPathways,s=performance.now();Object.keys(r).forEach(a=>{s-r[a]>k4e&&delete r[a]});for(let a=0;a<e.length;a++){const o=e[a];if(o in r)continue;if(o===this.pathwayId)return;const l=this.hls.nextLoadLevel,c=this.hls.levels[l];if(t=this.getLevelsForPathway(o),t.length>0){this.log(`Setting Pathway to "${o}"`),this.pathwayId=o,eee(t),this.hls.trigger(V.LEVELS_UPDATED,{levels:t});const d=this.hls.levels[l];c&&d&&this.levels&&(d.attrs["STABLE-VARIANT-ID"]!==c.attrs["STABLE-VARIANT-ID"]&&d.bitrate!==c.bitrate&&this.log(`Unstable Pathways change from bitrate ${c.bitrate} to ${d.bitrate}`),this.hls.nextLoadLevel=l);break}}}getPathwayForGroupId(e,t,r){const s=this.getLevelsForPathway(r).concat(this.levels||[]);for(let a=0;a<s.length;a++)if(t===Xt.AUDIO_TRACK&&s[a].hasAudioGroup(e)||t===Xt.SUBTITLE_TRACK&&s[a].hasSubtitleGroup(e))return s[a].pathwayId;return r}clonePathways(e){const t=this.levels;if(!t)return;const r={},s={};e.forEach(a=>{const{ID:o,"BASE-ID":l,"URI-REPLACEMENT":c}=a;if(t.some(h=>h.pathwayId===o))return;const d=this.getLevelsForPathway(l).map(h=>{const m=new Qr(h.attrs);m["PATHWAY-ID"]=o;const p=m.AUDIO&&`${m.AUDIO}_clone_${o}`,x=m.SUBTITLES&&`${m.SUBTITLES}_clone_${o}`;p&&(r[m.AUDIO]=p,m.AUDIO=p),x&&(s[m.SUBTITLES]=x,m.SUBTITLES=x);const y=Pee(h.uri,m["STABLE-VARIANT-ID"],"PER-VARIANT-URIS",c),v=new Vy({attrs:m,audioCodec:h.audioCodec,bitrate:h.bitrate,height:h.height,name:h.name,url:y,videoCodec:h.videoCodec,width:h.width});if(h.audioGroups)for(let B=1;B<h.audioGroups.length;B++)v.addGroupId("audio",`${h.audioGroups[B]}_clone_${o}`);if(h.subtitleGroups)for(let B=1;B<h.subtitleGroups.length;B++)v.addGroupId("text",`${h.subtitleGroups[B]}_clone_${o}`);return v});t.push(...d),_G(this.audioTracks,r,c,o),_G(this.subtitleTracks,s,c,o)})}loadSteeringManifest(e){const t=this.hls.config,r=t.loader;this.loader&&this.loader.destroy(),this.loader=new r(t);let s;try{s=new self.URL(e)}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest URI: ${e}`);return}if(s.protocol!=="data:"){const h=(this.hls.bandwidthEstimate||t.abrEwmaDefaultEstimate)|0;s.searchParams.set("_HLS_pathway",this.pathwayId),s.searchParams.set("_HLS_throughput",""+h)}const a={responseType:"json",url:s.href},o=t.steeringManifestLoadPolicy.default,l=o.errorRetry||o.timeoutRetry||{},c={loadPolicy:o,timeout:o.maxLoadTimeMs,maxRetry:l.maxNumRetry||0,retryDelay:l.retryDelayMs||0,maxRetryDelay:l.maxRetryDelayMs||0},d={onSuccess:(h,m,p,x)=>{this.log(`Loaded steering manifest: "${s}"`);const y=h.data;if((y==null?void 0:y.VERSION)!==1){this.log(`Steering VERSION ${y.VERSION} not supported!`);return}this.updated=performance.now(),this.timeToLoad=y.TTL;const{"RELOAD-URI":v,"PATHWAY-CLONES":B,"PATHWAY-PRIORITY":E}=y;if(v)try{this.uri=new self.URL(v,s).href}catch{this.enabled=!1,this.log(`Failed to parse Steering Manifest RELOAD-URI: ${v}`);return}this.scheduleRefresh(this.uri||p.url),B&&this.clonePathways(B);const N={steeringManifest:y,url:s.toString()};this.hls.trigger(V.STEERING_MANIFEST_LOADED,N),E&&this.updatePathwayPriority(E)},onError:(h,m,p,x)=>
4743{if(this.log(`Error loading steering manifest: ${h.code} ${h.text} (${m.url})`),this.stopLoad(),h.code===410){this.enabled=!1,this.log(`Steering manifest ${m.url} no longer available`);return}let y=this.timeToLoad*1e3;if(h.code===429){const v=this.loader;if(typeof(v==null?void 0:v.getResponseHeader)=="function"){const B=v.getResponseHeader("Retry-After");B&&(y=parseFloat(B)*1e3)}this.log(`Steering manifest ${m.url} rate limited`);return}this.scheduleRefresh(this.uri||m.url,y)},onTimeout:(h,m,p)=>{this.log(`Timeout loading steering manifest (${m.url})`),this.scheduleRefresh(this.uri||m.url)}};this.log(`Requesting steering manifest: ${s}`),this.loader.load(a,c,d)}scheduleRefresh(e,t=this.timeToLoad*1e3){this.clearTimeout(),this.reloadTimer=self.setTimeout(()=>{var r;const s=(r=this.hls)==null?void 0:r.media;if(s&&!s.ended){this.loadSteeringManifest(e);return}this.scheduleRefresh(e,this.timeToLoad*1e3)},t)}}function _G(n,e,t,r){n&&Object.keys(e).forEach(s=>{const a=n.filter(o=>o.groupId===s).map(o=>{const l=sr({},o);return l.details=void 0,l.attrs=new Qr(l.attrs),l.url=l.attrs.URI=Pee(o.url,o.attrs["STABLE-RENDITION-ID"],"PER-RENDITION-URIS",t),l.groupId=l.attrs["GROUP-ID"]=e[s],l.attrs["PATHWAY-ID"]=r,l});n.push(...a)})}function Pee(n,e,t,r){const{HOST:s,PARAMS:a,[t]:o}=r;let l;e&&(l=o==null?void 0:o[e],l&&(n=l));const c=new self.URL(n);return s&&!l&&(c.host=s),a&&Object.keys(a).sort().forEach(d=>{d&&c.searchParams.set(d,a[d])}),c.href}class V0 extends ul{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=V0.CDMCleanupPromise?[V0.CDMCleanupPromise]:[],this.bannedKeyIds={},this.onMediaEncrypted=t=>{const{initDataType:r,initData:s}=t,a=`"${t.type}" event: init data type: "${r}"`;if(this.debug(a),s!==null){if(!this.keyFormatPromise){let o=Object.keys(this.keySystemAccessPromises);o.length||(o=kb(this.config));const l=o.map(LN).filter(c=>!!c);this.keyFormatPromise=this.getKeyFormatPromise(l)}this.keyFormatPromise.then(o=>{const l=NC(o);if(r!=="sinf"||l!==Jr.FAIRPLAY){this.log(`Ignoring "${t.type}" event with init data type: "${r}" for selected key-system ${l}`);return}let c;try{const x=zs(new Uint8Array(s)),y=qP(JSON.parse(x).sinf),v=NZ(y);if(!v)throw new Error("'schm' box missing or not cbcs/cenc with schi > tenc");c=new Uint8Array(v.subarray(8,24))}catch(x){this.warn(`${a} Failed to parse sinf: ${x}`);return}const d=Ra(c),{keyIdToKeySessionPromise:h,mediaKeySessions:m}=this;let p=h[d];for(let x=0;x<m.length;x++){const y=m[x],v=y.decryptdata;if(!v.keyId)continue;const B=Ra(v.keyId);if(b1(c,v.keyId)||v.uri.replace(/-/g,"").indexOf(d)!==-1){if(p=h[B],!p)continue;if(v.pssh)break;delete h[B],v.pssh=new Uint8Array(s),v.keyId=c,p=h[d]=p.then(()=>this.generateRequestWithPreferredKeySession(y,r,s,"encrypted-event-key-match")),p.catch(E=>this.handleError(E));break}}p||this.handleError(new Error(`Key ID ${d} not encountered in playlist. Key-system sessions ${m.length}.`))}).catch(o=>this.handleError(o))}},this.onWaitingForKey=t=>{this.log(`"${t.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(V.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.on(V.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.on(V.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.on(V.DESTROYING,this.onDestroying,this)}unregisterListeners(){this.hls.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),this.hls.off(V.MEDIA_DETACHED,this.onMediaDetached,this),this.hls.off(V.MANIFEST_LOADING,this.onManifestLoading,this),this.hls.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),this.hls.off(V.DESTROYING,this.onDestroying,this)}getLicenseServerUrl(e){const{drmSystems:t,widevineLicenseUrl:r}=this.config,s=t==null?void 0:t[e];if(s)return s.licenseUrl;if(e===Jr.WIDEVINE&&r)return r}getLicenseServerUrlOrThrow(e){const t=this.getLicenseServerUrl(e);if(t===void 0)throw new Error(`no license server URL configured for key-system "${e}"`);return t}getServerCertificateUrl(e){const{drmSystems:t}=this.config,r=t==null?void 0:t[e];if(r)return r.serverCertificateUrl;this.log(`No Server Certificate in config.drmSystems["${e}"]`)}attemptKeySystemAccess(e){const t=this.hls.levels,r=(o,l,c)=>!!o&&c.indexOf(o)===l,s=t.map(o=>o.audioCodec).filter(r),a=t.map(o=>o.videoCodec).filter(r);return s.length+a.length===0&&a.push("avc1.42e01e"),new Promise((o,l)=>{const c=d=>{const h=d.shift();this.getMediaKeysPromise(h,s,a).then(m=>o({keySystem:h,mediaKeys:m})).catch(m=>{d.length?c(d):m instanceof uo?l(m):l(new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_NO_ACCESS,error:m,fatal:!0},m.message))})};c(e)})}requestMediaKeySystemAccess(e,t){const{requestMediaKeySystemAccessFunc:r}=this.config;if(typeof r!="function"){let s=`Configured requestMediaKeySystemAccess is not a function ${r}`;return qZ===null&&self.location.protocol==="http:"&&(s=`navigator.requestMediaKeySystemAccess is not available over insecure protocol ${location.protocol}`),Promise.reject(new Error(s))}return r(e,t)}getMediaKeysPromise(e,t,r){var s;const a=cMe(e,t,r,this.config.drmSystemOptions||{});let o=this.keySystemAccessPromises[e],l=(s=o)==null?void 0:s.keySystemAccess;if(!l){this.log(`Requesting encrypted media "${e}" key-system access with config: ${xr(a)}`),l=this.requestMediaKeySystemAccess(e,a);const c=o=this.keySystemAccessPromises[e]={keySystemAccess:l};return l.catch(d=>{this.log(`Failed to obtain access to key-system "${e}": ${d}`)}),l.then(d=>{this.log(`Access for key-system "${d.keySystem}" obtained`);const h=this.fetchServerCertificate(e);this.log(`Create media-keys for "${e}"`);const m=c.mediaKeys=d.createMediaKeys().then(p=>(this.log(`Media-keys created for "${e}"`),c.hasMediaKeys=!0,h.then(x=>x?this.setMediaKeysServerCertificate(p,e,x):p)));return m.catch(p=>{this.error(`Failed to create media-keys for "${e}"}: ${p}`)}),m})}return l.then(()=>o.mediaKeys)}createMediaKeySessionContext({decryptdata:e,keySystem:t,mediaKeys:r}){this.log(`Creating key-system session "${t}" keyId: ${Ra(e.keyId||[])} keyUri: ${e.uri}`);const s=r.createSession(),a={decryptdata:e,keySystem:t,mediaKeys:r,mediaKeysSession:s,keyStatus:"status-pending"};return this.mediaKeySessions.push(a),a}renewKeySession(e){const t=e.decryptdata;if(t.pssh){const r=this.createMediaKeySessionContext(e),s=Vw(t),a="cenc";this.keyIdToKeySessionPromise[s]=this.generateRequestWithPreferredKeySession(r,a,t.pssh.buffer,"expired")}else this.warn("Could not renew expired session. Missing pssh initData.");this.removeSession(e)}updateKeySession(e,t){const r=e.mediaKeysSession;return this.log(`Updating key-session "${r.sessionId}" for keyId ${Ra(e.decryptdata.keyId||[])}
4744      } (data length: ${t.byteLength})`),r.update(t)}getSelectedKeySystemFormats(){return Object.keys(this.keySystemAccessPromises).map(e=>({keySystem:e,hasMediaKeys:this.keySystemAccessPromises[e].hasMediaKeys})).filter(({hasMediaKeys:e})=>!!e).map(({keySystem:e})=>LN(e)).filter(e=>!!e)}getKeySystemAccess(e){return this.getKeySystemSelectionPromise(e).then(({keySystem:t,mediaKeys:r})=>this.attemptSetMediaKeys(t,r))}selectKeySystem(e){return new Promise((t,r)=>{this.getKeySystemSelectionPromise(e).then(({keySystem:s})=>{const a=LN(s);a?t(a):r(new Error(`Unable to find format for key-system "${s}"`))}).catch(r)})}selectKeySystemFormat(e){const t=Object.keys(e.levelkeys||{});return this.keyFormatPromise||(this.log(`Selecting key-system from fragment (sn: ${e.sn} ${e.type}: ${e.level}) key formats ${t.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(t)),this.keyFormatPromise}getKeyFormatPromise(e){const t=kb(this.config),r=e.map(NC).filter(s=>!!s&&t.indexOf(s)!==-1);return this.selectKeySystem(r)}getKeyStatus(e){const{mediaKeySessions:t}=this;for(let r=0;r<t.length;r++){const s=_4e(e,t[r]);if(s)return s}}loadKey(e){const t=e.keyInfo.decryptdata,r=Vw(t),s=this.bannedKeyIds[r];if(s||this.getKeyStatus(t)==="internal-error"){const l=IG(s||"internal-error",t);return this.handleError(l,e.frag),Promise.reject(l)}const a=`(keyId: ${r} format: "${t.keyFormat}" method: ${t.method} uri: ${t.uri})`;this.log(`Starting session for key ${a}`);const o=this.keyIdToKeySessionPromise[r];if(!o){const l=this.getKeySystemForKeyPromise(t).then(({keySystem:c,mediaKeys:d})=>(this.throwIfDestroyed(),this.log(`Handle encrypted media sn: ${e.frag.sn} ${e.frag.type}: ${e.frag.level} using key ${a}`),this.attemptSetMediaKeys(c,d).then(()=>(this.throwIfDestroyed(),this.createMediaKeySessionContext({keySystem:c,mediaKeys:d,decryptdata:t}))))).then(c=>{const d="cenc",h=t.pssh?t.pssh.buffer:null;return this.generateRequestWithPreferredKeySession(c,d,h,"playlist-key")});return l.catch(c=>this.handleError(c,e.frag)),this.keyIdToKeySessionPromise[r]=l,l}return o.catch(l=>{if(l instanceof uo){const c=zn({},l.data);this.getKeyStatus(t)==="internal-error"&&(c.decryptdata=t);const d=new uo(c,l.message);this.handleError(d,e.frag)}}),o}throwIfDestroyed(e="Invalid state"){if(!this.hls)throw new Error("invalid state")}handleError(e,t){if(this.hls)if(e instanceof uo){t&&(e.data.frag=t);const r=e.data.decryptdata;this.error(`${e.message}${r?` (${Ra(r.keyId||[])})`:""}`),this.hls.trigger(V.ERROR,e.data)}else this.error(e.message),this.hls.trigger(V.ERROR,{type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_NO_KEYS,error:e,fatal:!0})}
vendor: 16,832 bytes, line 4744
4744getKeySystemForKeyPromise(e){const t=Vw(e),r=this.keyIdToKeySessionPromise[t];if(!r){const s=NC(e.keyFormat),a=s?[s]:kb(this.config);return this.attemptKeySystemAccess(a)}return r}getKeySystemSelectionPromise(e){if(e.length||(e=kb(this.config)),e.length===0)throw new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_NO_CONFIGURED_LICENSE,fatal:!0},`Missing key-system license configuration options ${xr({drmSystems:this.config.drmSystems})}`);return this.attemptKeySystemAccess(e)}attemptSetMediaKeys(e,t){if(this.mediaResolved=void 0,this.mediaKeys===t)return Promise.resolve();const r=this.setMediaKeysQueue.slice();this.log(`Setting media-keys for "${e}"`);const s=Promise.all(r).then(()=>this.media?this.media.setMediaKeys(t):new Promise((a,o)=>{this.mediaResolved=()=>{if(this.mediaResolved=void 0,!this.media)return o(new Error("Attempted to set mediaKeys without media element attached"));this.mediaKeys=t,this.media.setMediaKeys(t).then(a).catch(o)}}));return this.mediaKeys=t,this.setMediaKeysQueue.push(s),s.then(()=>{this.log(`Media-keys set for "${e}"`),r.push(s),this.setMediaKeysQueue=this.setMediaKeysQueue.filter(a=>r.indexOf(a)===-1)})}generateRequestWithPreferredKeySession(e,t,r,s){var a;const o=(a=this.config.drmSystems)==null||(a=a[e.keySystem])==null?void 0:a.generateRequest;if(o)try{const y=o.call(this.hls,t,r,e);if(!y)throw new Error("Invalid response from configured generateRequest filter");t=y.initDataType,r=y.initData?y.initData:null,e.decryptdata.pssh=r?new Uint8Array(r):null}catch(y){if(this.warn(y.message),this.hls&&this.hls.config.debug)throw y}if(r===null)return this.log(`Skipping key-session request for "${s}" (no initData)`),Promise.resolve(e);const l=Vw(e.decryptdata),c=e.decryptdata.uri;this.log(`Generating key-session request for "${s}" keyId: ${l} URI: ${c} (init data type: ${t} length: ${r.byteLength})`);const d=new WP,h=e._onmessage=y=>{const v=e.mediaKeysSession;if(!v){d.emit("error",new Error("invalid state"));return}const{messageType:B,message:E}=y;this.log(`"${B}" message event for session "${v.sessionId}" message size: ${E.byteLength}`),B==="license-request"||B==="license-renewal"?this.renewLicense(e,E).catch(N=>{d.eventNames().length?d.emit("error",N):this.handleError(N)}):B==="license-release"?e.keySystem===Jr.FAIRPLAY&&this.updateKeySession(e,mD("acknowledged")).then(()=>this.removeSession(e)).catch(N=>this.handleError(N)):this.warn(`unhandled media key message type "${B}"`)},m=(y,v)=>{v.keyStatus=y;let B;y.startsWith("usable")?d.emit("resolved"):y==="internal-error"||y==="output-restricted"||y==="output-downscaled"?B=IG(y,v.decryptdata):y==="expired"?B=new Error(`key expired (keyId: ${l})`):y==="released"?B=new Error("key released"):y==="status-pending"||this.warn(`unhandled key status change "${y}" (keyId: ${l})`),B&&(d.eventNames().length?d.emit("error",B):this.handleError(B))},p=e._onkeystatuseschange=y=>{if(!e.mediaKeysSession){d.emit("error",new Error("invalid state"));return}const B=this.getKeyStatuses(e);if(!Object.keys(B).some(k=>B[k]!=="status-pending"))return;if(B[l]==="expired"){this.log(`Expired key ${xr(B)} in key-session "${e.mediaKeysSession.sessionId}"`),this.renewKeySession(e);return}let N=B[l];if(N)m(N,e);else{var T;e.keyStatusTimeouts||(e.keyStatusTimeouts={}),(T=e.keyStatusTimeouts)[l]||(T[l]=self.setTimeout(()=>{if(!e.mediaKeysSession||!this.mediaKeys)return;const P=this.getKeyStatus(e.decryptdata);if(P&&P!=="status-pending")return this.log(`No status for keyId ${l} in key-session "${e.mediaKeysSession.sessionId}". Using session key-status ${P} from other session.`),m(P,e);this.log(`key status for ${l} in key-session "${e.mediaKeysSession.sessionId}" timed out after 1000ms`),N="internal-error",m(N,e)},1e3)),this.log(`No status for keyId ${l} (${xr(B)}).`)}};pi(e.mediaKeysSession,"message",h),pi(e.mediaKeysSession,"keystatuseschange",p);const x=new Promise((y,v)=>{d.on("error",v),d.on("resolved",y)});return e.mediaKeysSession.generateRequest(t,r).then(()=>{this.log(`Request generated for key-session "${e.mediaKeysSession.sessionId}" keyId: ${l} URI: ${c}`)}).catch(y=>{throw new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_NO_SESSION,error:y,decryptdata:e.decryptdata,fatal:!1},`Error generating key-session request: ${y}`)}).then(()=>x).catch(y=>(d.removeAllListeners(),this.removeSession(e).then(()=>{throw y}))).then(()=>(d.removeAllListeners(),e))}getKeyStatuses(e){const t={};return e.mediaKeysSession.keyStatuses.forEach((r,s)=>{if(typeof s=="string"&&typeof r=="object"){const l=s;s=r,r=l}const a="buffer"in s?new Uint8Array(s.buffer,s.byteOffset,s.byteLength):new Uint8Array(s);if(e.keySystem===Jr.PLAYREADY&&a.length===16){const l=Ra(a);t[l]=r,HZ(a)}const o=Ra(a);r==="internal-error"&&(this.bannedKeyIds[o]=r),this.log(`key status change "${r}" for keyStatuses keyId: ${o} key-session "${e.mediaKeysSession.sessionId}"`),t[o]=r}),t}fetchServerCertificate(e){const t=this.config,r=t.loader,s=new r(t),a=this.getServerCertificateUrl(e);return a?(this.log(`Fetching server certificate for "${e}"`),new Promise((o,l)=>{const c={responseType:"arraybuffer",url:a},d=t.certLoadPolicy.default,h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(p,x,y,v)=>{o(p.data)},onError:(p,x,y,v)=>{l(new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:zn({url:c.url,data:void 0},p)},`"${e}" certificate request failed (${a}). Status: ${p.code} (${p.text})`))},onTimeout:(p,x,y)=>{l(new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_SERVER_CERTIFICATE_REQUEST_FAILED,fatal:!0,networkDetails:y,response:{url:c.url,data:void 0}},`"${e}" certificate request timed out (${a})`))},onAbort:(p,x,y)=>{l(new Error("aborted"))}};s.load(c,h,m)})):Promise.resolve()}setMediaKeysServerCertificate(e,t,r){return new Promise((s,a)=>{e.setServerCertificate(r).then(o=>{this.log(`setServerCertificate ${o?"success":"not supported by CDM"} (${r.byteLength}) on "${t}"`),s(e)}).catch(o=>{a(new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_SERVER_CERTIFICATE_UPDATE_FAILED,error:o,fatal:!0},o.message))})})}renewLicense(e,t){return this.requestLicense(e,new Uint8Array(t)).then(r=>this.updateKeySession(e,new Uint8Array(r)).catch(s=>{throw new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_SESSION_UPDATE_FAILED,decryptdata:e.decryptdata,error:s,fatal:!1},s.message)}))}unpackPlayReadyKeyMessage(e,t){const r=String.fromCharCode.apply(null,new Uint16Array(t.buffer));if(!r.includes("PlayReadyKeyMessage"))return e.setRequestHeader("Content-Type","text/xml; charset=utf-8"),t;const s=new DOMParser().parseFromString(r,"application/xml"),a=s.querySelectorAll("HttpHeader");if(a.length>0){let h;for(let m=0,p=a.length;m<p;m++){var o,l;h=a[m];const x=(o=h.querySelector("name"))==null?void 0:o.textContent,y=(l=h.querySelector("value"))==null?void 0:l.textContent;x&&y&&e.setRequestHeader(x,y)}}const c=s.querySelector("Challenge"),d=c==null?void 0:c.textContent;if(!d)throw new Error("Cannot find <Challenge> in key message");return mD(atob(d))}setupLicenseXHR(e,t,r,s){const a=this.config.licenseXhrSetup;return a?Promise.resolve().then(()=>{if(!r.decryptdata)throw new Error("Key removed");return a.call(this.hls,e,t,r,s)}).catch(o=>{if(!r.decryptdata)throw o;return e.open("POST",t,!0),a.call(this.hls,e,t,r,s)}).then(o=>(e.readyState||e.open("POST",t,!0),{xhr:e,licenseChallenge:o||s})):(e.open("POST",t,!0),Promise.resolve({xhr:e,licenseChallenge:s}))}requestLicense(e,t){const r=this.config.keyLoadPolicy.default;return new Promise((s,a)=>{const o=this.getLicenseServerUrlOrThrow(e.keySystem);this.log(`Sending license request to URL: ${o}`);const l=new XMLHttpRequest;l.responseType="arraybuffer",l.onreadystatechange=()=>{if(!this.hls||!e.mediaKeysSession)return a(new Error("invalid state"));if(l.readyState===4)if(l.status===200){this._requestLicenseFailureCount=0;let c=l.response;this.log(`License received ${c instanceof ArrayBuffer?c.byteLength:c}`);const d=this.config.licenseResponseCallback;if(d)try{c=d.call(this.hls,l,o,e)}catch(h){this.error(h)}s(c)}else{const c=r.errorRetry,d=c?c.maxNumRetry:0;if(this._requestLicenseFailureCount++,this._requestLicenseFailureCount>d||l.status>=400&&l.status<500)a(new uo({type:Bt.KEY_SYSTEM_ERROR,details:Ee.KEY_SYSTEM_LICENSE_REQUEST_FAILED,decryptdata:e.decryptdata,fatal:!0,networkDetails:l,response:{url:o,data:void 0,code:l.status,text:l.statusText}},`License Request XHR failed (${o}). Status: ${l.status} (${l.statusText})`));else{const h=d-this._requestLicenseFailureCount+1;this.warn(`Retrying license request, ${h} attempts left`),this.requestLicense(e,t).then(s,a)}}},e.licenseXhr&&e.licenseXhr.readyState!==XMLHttpRequest.DONE&&e.licenseXhr.abort(),e.licenseXhr=l,this.setupLicenseXHR(l,o,e,t).then(({xhr:c,licenseChallenge:d})=>{e.keySystem==Jr.PLAYREADY&&(d=this.unpackPlayReadyKeyMessage(c,d)),c.send(d)}).catch(a)})}onDestroying(){this.unregisterListeners(),this._clear()}onMediaAttached(e,t){if(!this.config.emeEnabled)return;const r=t.media;this.media=r,pi(r,"encrypted",this.onMediaEncrypted),pi(r,"waitingforkey",this.onWaitingForKey);const s=this.mediaResolved;s?s():this.mediaKeys=r.mediaKeys}onMediaDetached(){const e=this.media;e&&(zi(e,"encrypted",this.onMediaEncrypted),zi(e,"waitingforkey",this.onWaitingForKey),this.media=null,this.mediaKeys=null)}_clear(){var e;this._requestLicenseFailureCount=0,this.keyIdToKeySessionPromise={},this.bannedKeyIds={};const t=this.mediaResolved;if(t&&t(),!this.mediaKeys&&!this.mediaKeySessions.length)return;const r=this.media,s=this.mediaKeySessions.slice();this.mediaKeySessions=[],this.mediaKeys=null,Sh.clearKeyUriToKeyIdMap();const a=s.length;V0.CDMCleanupPromise=Promise.all(s.map(o=>this.removeSession(o)).concat((r==null||(e=r.setMediaKeys(null))==null?void 0:e.catch(o=>{this.log(`Could not clear media keys: ${o}`),this.hls&&this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.KEY_SYSTEM_DESTROY_MEDIA_KEYS_ERROR,fatal:!1,error:new Error(`Could not clear media keys: ${o}`)})}))||Promise.resolve())).catch(o=>{this.log(`Could not close sessions and clear media keys: ${o}`),this.hls&&this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close sessions and clear media keys: ${o}`)})}).then(()=>{a&&this.log("finished closing key sessions and clearing media keys")})}onManifestLoading(){this._clear()}onManifestLoaded(e,{sessionKeys:t}){if(!(!t||!this.config.emeEnabled)&&!this.keyFormatPromise){const r=t.reduce((s,a)=>(s.indexOf(a.keyFormat)===-1&&s.push(a.keyFormat),s),[]);this.log(`Selecting key-system from session-keys ${r.join(", ")}`),this.keyFormatPromise=this.getKeyFormatPromise(r)}}removeSession(e){const{mediaKeysSession:t,licenseXhr:r,decryptdata:s}=e;if(t){this.log(`Remove licenses and keys and close session "${t.sessionId}" keyId: ${Ra((s==null?void 0:s.keyId)||[])}`),e._onmessage&&(t.removeEventListener("message",e._onmessage),e._onmessage=void 0),e._onkeystatuseschange&&(t.removeEventListener("keystatuseschange",e._onkeystatuseschange),e._onkeystatuseschange=void 0),r&&r.readyState!==XMLHttpRequest.DONE&&r.abort(),e.mediaKeysSession=e.decryptdata=e.licenseXhr=void 0;const a=this.mediaKeySessions.indexOf(e);a>-1&&this.mediaKeySessions.splice(a,1);const{keyStatusTimeouts:o}=e;o&&Object.keys(o).forEach(d=>self.clearTimeout(o[d]));const{drmSystemOptions:l}=this.config;return(uMe(l)?new Promise((d,h)=>{self.setTimeout(()=>h(new Error("MediaKeySession.remove() timeout")),8e3),t.remove().then(d).catch(h)}):Promise.resolve()).catch(d=>{this.log(`Could not remove session: ${d}`),this.hls&&this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.KEY_SYSTEM_DESTROY_REMOVE_SESSION_ERROR,fatal:!1,error:new Error(`Could not remove session: ${d}`)})}).then(()=>t.close()).catch(d=>{this.log(`Could not close session: ${d}`),this.hls&&this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.KEY_SYSTEM_DESTROY_CLOSE_SESSION_ERROR,fatal:!1,error:new Error(`Could not close session: ${d}`)})})}return Promise.resolve()}}V0.CDMCleanupPromise=void 0;function Vw(n){if(!n)throw new Error("Could not read keyId of undefined decryptdata");if(n.keyId===null)throw new Error("keyId is null");return Ra(n.keyId)}function _4e(n,e){if(n.keyId&&e.mediaKeysSession.keyStatuses.has(n.keyId))return e.mediaKeysSession.keyStatuses.get(n.keyId);if(n.matches(e.decryptdata))return e.keyStatus}class uo extends Error{constructor(e,t){super(t),this.data=void 0,e.error||(e.error=new Error(t)),this.data=e,e.err=e.error}}function IG(n,e){const t=n==="output-restricted",r=t?Ee.KEY_SYSTEM_STATUS_OUTPUT_RESTRICTED:Ee.KEY_SYSTEM_STATUS_INTERNAL_ERROR;return new uo({type:Bt.KEY_SYSTEM_ERROR,details:r,fatal:!1,decryptdata:e},t?"HDCP level output restricted":`key status changed to "${n}"`)}class I4e{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(V.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.on(V.MEDIA_DETACHING,this.onMediaDetaching,this)}unregisterListeners(){this.hls.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),this.hls.off(V.MEDIA_DETACHING,this.onMediaDetaching,this)}destroy(){this.timer&&clearInterval(this.timer),this.unregisterListeners(),this.isVideoPlaybackQualityAvailable=!1,this.media=null}onMediaAttaching(e,t){const r=this.hls.config;if(r.capLevelOnFPSDrop){const s=t.media instanceof self.HTMLVideoElement?t.media:null;this.media=s,s&&typeof s.getVideoPlaybackQuality=="function"&&(this.isVideoPlaybackQualityAvailable=!0),self.clearInterval(this.timer),this.timer=self.setInterval(this.checkFPSInterval.bind(this),r.fpsDroppedMonitoringPeriod)}}onMediaDetaching(){this.media=null}checkFPS(e,t,r){const s=performance.now();if(t){if(this.lastTime){const a=s-this.lastTime,o=r-this.lastDroppedFrames,l=t-this.lastDecodedFrames,c=1e3*o/a,d=this.hls;if(d.trigger(V.FPS_DROP,{currentDropped:o,currentDecoded:l,totalDroppedFrames:r}),c>0&&o>d.config.fpsDroppedMonitoringThreshold*l){let h=d.currentLevel;d.logger.warn("drop FPS ratio greater than max allowed value for currentLevel: "+h),h>0&&(d.autoLevelCapping===-1||d.autoLevelCapping>=h)&&(h=h-1,d.trigger(V.FPS_DROP_LEVEL_CAPPING,{level:h,droppedLevel:d.currentLevel}),d.autoLevelCapping=h,this.streamController.nextLevelSwitch())}}this.lastTime=s,this.lastDroppedFrames=r,this.lastDecodedFrames=t}}checkFPSInterval(){const e=this.media;if(e)if(this.isVideoPlaybackQualityAvailable){const t=e.getVideoPlaybackQuality();this.checkFPS(e,t.totalVideoFrames,t.droppedVideoFrames)}else this.checkFPS(e,e.webkitDecodedFrameCount,e.webkitDroppedFrameCount)}}function Lee(n,e){let t;try{t=new Event("addtrack")}catch{t=document.createEvent("Event"),t.initEvent("addtrack",!1,!1)}t.track=n,e.dispatchEvent(t)}function Oee(n,e){const t=n.mode;if(t==="disabled"&&(n.mode="hidden"),n.cues&&!n.cues.getCueById(e.id))try{if(n.addCue(e),!n.cues.getCueById(e.id))throw new Error(`addCue is failed for: ${e}`)}catch(r){Kn.debug(`[texttrack-utils]: ${r}`);try{const s=new self.TextTrackCue(e.startTime,e.endTime,e.text);s.id=e.id,n.addCue(s)}catch(s){Kn.debug(`[texttrack-utils]: Legacy TextTrackCue fallback failed: ${s}`)}}t==="disabled"&&(n.mode=t)}function k0(n,e){const t=n.mode;if(t==="disabled"&&(n.mode="hidden"),n.cues)for(let r=n.cues.length;r--;)e&&n.cues[r].removeEventListener("enter",e),n.removeCue(n.cues[r]);t==="disabled"&&(n.mode=t)}function CD(n,e,t,r){const s=n.mode;if(s==="disabled"&&(n.mode="hidden"),n.cues&&n.cues.length>0){const a=j4e(n.cues,e,t);for(let o=0;o<a.length;o++)(!r||r(a[o]))&&n.removeCue(a[o])}s==="disabled"&&(n.mode=s)}function D4e(n,e){if(e<=n[0].startTime)return 0;const t=n.length-1;if(e>n[t].endTime)return-1;let r=0,s=t,a;for(;r<=s;)if(a=Math.floor((s+r)/2),e<n[a].startTime)s=a-1;else if(e>n[a].startTime&&r<t)r=a+1;else return a;return n[r].startTime-e<e-n[s].startTime?r:s}function j4e(n,e,t){const r=[],s=D4e(n,e);if(s>-1)for(let a=s,o=n.length;a<o;a++){const l=n[a];if(l.startTime>=e&&l.endTime<=t)r.push(l);else if(l.startTime>t)return r}return r}function jC(n){const e=[];for(let t=0;t<n.length;t++){const r=n[t];(r.kind==="subtitles"||r.kind==="captions")&&r.label&&e.push(n[t])}return e}class R4e extends t5{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=()=>
vendor: 7,613 bytes, line 4744
4744{if(this.useTextTrackPolling||self.clearInterval(this.subtitlePollingInterval),!this.media||!this.hls.config.renderTextTracksNatively)return;let t=null;const r=jC(this.media.textTracks);for(let a=0;a<r.length;a++)if(r[a].mode==="hidden")t=r[a];else if(r[a].mode==="showing"){t=r[a];break}const s=this.findTrackForTextTrack(t);this.subtitleTrack!==s&&this.setSubtitleTrack(s)},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(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.on(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(V.ERROR,this.onError,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVEL_LOADING,this.onLevelLoading,this),e.off(V.LEVEL_SWITCHING,this.onLevelSwitching,this),e.off(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(V.ERROR,this.onError,this)}onMediaAttached(e,t){this.media=t.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,t){const r=this.media;if(!r)return;const s=!!t.transferMedia;if(self.clearInterval(this.subtitlePollingInterval),this.useTextTrackPolling||r.textTracks.removeEventListener("change",this.asyncPollTrackChange),this.trackId>-1&&(this.queuedDefaultTrack=this.trackId),this.subtitleTrack=-1,this.media=null,s)return;jC(r.textTracks).forEach(o=>{k0(o)})}onManifestLoading(){this.tracks=[],this.groupIds=null,this.tracksInGroup=[],this.trackId=-1,this.currentTrack=null,this.selectDefaultTrack=!0}onManifestParsed(e,t){this.tracks=t.subtitleTracks}onSubtitleTrackLoaded(e,t){const{id:r,groupId:s,details:a}=t,o=this.tracksInGroup[r];if(!o||o.groupId!==s){this.warn(`Subtitle track with id:${r} and group:${s} not found in active group ${o==null?void 0:o.groupId}`);return}const l=o.details;o.details=t.details,this.log(`Subtitle track ${r} "${o.name}" lang:${o.lang} group:${s} loaded [${a.startSN}-${a.endSN}]`),r===this.trackId&&this.playlistLoaded(r,t,l)}onLevelLoading(e,t){this.switchLevel(t.level)}onLevelSwitching(e,t){this.switchLevel(t.level)}switchLevel(e){const t=this.hls.levels[e];if(!t)return;const r=t.subtitleGroups||null,s=this.groupIds;let a=this.currentTrack;if(!r||(s==null?void 0:s.length)!==(r==null?void 0:r.length)||r!=null&&r.some(o=>(s==null?void 0:s.indexOf(o))===-1)){this.groupIds=r,this.trackId=-1,this.currentTrack=null;const o=this.tracks.filter(h=>!r||r.indexOf(h.groupId)!==-1);if(o.length)this.selectDefaultTrack&&!o.some(h=>h.default)&&(this.selectDefaultTrack=!1),o.forEach((h,m)=>{h.id=m});else if(!a&&!this.tracksInGroup.length)return;this.tracksInGroup=o;const l=this.hls.config.subtitlePreference;if(!a&&l){this.selectDefaultTrack=!1;const h=Ac(l,o);if(h>-1)a=o[h];else{const m=Ac(l,this.tracks);a=this.tracks[m]}}let c=this.findTrackId(a);c===-1&&a&&(c=this.findTrackId(null));const d={subtitleTracks:o};this.log(`Updating subtitle tracks, ${o.length} track(s) found in "${r==null?void 0:r.join(",")}" group-id`),this.hls.trigger(V.SUBTITLE_TRACKS_UPDATED,d),c!==-1&&this.trackId===-1&&this.setSubtitleTrack(c)}}findTrackId(e){const t=this.tracksInGroup,r=this.selectDefaultTrack;for(let s=0;s<t.length;s++){const a=t[s];if(!(r&&!a.default||!r&&!e)&&(!e||bm(a,e)))return s}if(e){for(let s=0;s<t.length;s++){const a=t[s];if(zy(e.attrs,a.attrs,["LANGUAGE","ASSOC-LANGUAGE","CHARACTERISTICS"]))return s}for(let s=0;s<t.length;s++){const a=t[s];if(zy(e.attrs,a.attrs,["LANGUAGE"]))return s}}return-1}findTrackForTextTrack(e){if(e){const t=this.tracksInGroup;for(let r=0;r<t.length;r++){const s=t[r];if(yD(s,e))return r}}return-1}onError(e,t){t.fatal||!t.context||t.context.type===Xt.SUBTITLE_TRACK&&t.context.id===this.trackId&&(!this.groupIds||this.groupIds.indexOf(t.context.groupId)!==-1)&&this.checkRetry(t)}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 t=this.allSubtitleTracks;if(this.selectDefaultTrack=!1,t.length){const r=this.currentTrack;if(r&&bm(e,r))return r;const s=Ac(e,this.tracksInGroup);if(s>-1){const a=this.tracksInGroup[s];return this.setSubtitleTrack(s),a}else{if(r)return null;{const a=Ac(e,t);if(a>-1)return t[a]}}}}return null}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentTrack)&&this.scheduleLoading(this.currentTrack,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=e.id,s=e.groupId,a=this.getUrlWithDirectives(e.url,t),o=e.details,l=o==null?void 0:o.age;this.log(`Loading subtitle ${r} "${e.name}" lang:${e.lang} group:${s}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${l&&o.live?" age "+l.toFixed(1)+(o.type&&" "+o.type||""):""} ${a}`),this.hls.trigger(V.SUBTITLE_TRACK_LOADING,{url:a,id:r,groupId:s,deliveryDirectives:t||null,track:e})}toggleTrackModes(){const{media:e}=this;if(!e)return;const t=jC(e.textTracks),r=this.currentTrack;let s;if(r&&(s=t.filter(a=>yD(r,a))[0],s||this.warn(`Unable to find subtitle TextTrack with name "${r.name}" and language "${r.lang}"`)),[].slice.call(t).forEach(a=>{a.mode!=="disabled"&&a!==s&&(a.mode="disabled")}),s){const a=this.subtitleDisplay?"showing":"hidden";s.mode!==a&&(s.mode=a)}}setSubtitleTrack(e){const t=this.tracksInGroup;if(!this.media){this.queuedDefaultTrack=e;return}if(e<-1||e>=t.length||!ct(e)){this.warn(`Invalid subtitle track id: ${e}`);return}this.selectDefaultTrack=!1;const r=this.currentTrack,s=t[e]||null;if(this.trackId=e,this.currentTrack=s,this.toggleTrackModes(),!s){this.hls.trigger(V.SUBTITLE_TRACK_SWITCH,{id:e});return}const a=!!s.details&&!s.details.live;if(e===this.trackId&&s===r&&a)return;this.log(`Switching to subtitle-track ${e}`+(s?` "${s.name}" lang:${s.lang} group:${s.groupId}`:""));const{id:o,groupId:l="",name:c,type:d,url:h}=s;this.hls.trigger(V.SUBTITLE_TRACK_SWITCH,{id:o,groupId:l,name:c,type:d,url:h});const m=this.switchParams(s.url,r==null?void 0:r.details,s.details);this.loadPlaylist(m)}}function P4e(){try{return crypto.randomUUID()}catch{try{const e=URL.createObjectURL(new Blob),t=e.toString();return URL.revokeObjectURL(e),t.slice(t.lastIndexOf("/")+1)}catch{let t=new Date().getTime();return"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,s=>{const a=(t+Math.random()*16)%16|0;return t=Math.floor(t/16),(s=="x"?a:a&3|8).toString(16)})}}}function Xb(n){let e=5381,t=n.length;for(;t;
vendor: 4,237 bytes, line 4744
4744)e=e*33^n.charCodeAt(--t);return(e>>>0).toString()}const G0=.025;let w1=(function(n){return n[n.Point=0]="Point",n[n.Range=1]="Range",n})({});function L4e(n,e,t){return`${n.identifier}-${t+1}-${Xb(e)}`}class O4e{constructor(e,t){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=t,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 t;if(e>0&&e>=this.assetList.length)return!0;const r=this.playoutLimit;return e<=0||isNaN(r)?!1:r===0?!0:(((t=this.assetList[e])==null?void 0:t.startOffset)||0)>r}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 t=this.dateRange.tagAnchor;if(t)return zN(e,t)}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 t=this.dateRange.startTime,r=zN(t,e);return t-r<.1}return!1}get resumptionOffset(){const e=this.resumeOffset,t=ct(e)?e:this.duration;return this.cumulativeDuration+t}get resumeTime(){const e=this.startOffset+this.resumptionOffset;if(this.snapOptions.in){const t=this.resumeAnchor;if(t)return zN(e,t)}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)<G0))}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 t;return this._duration!==null?t=this._duration:this.dateRange.duration?t=this.dateRange.duration:t=this.dateRange.plannedDuration||0,!isNaN(e)&&e<t&&(t=e),t}set duration(e){this._duration=e}get cue(){return this.dateRange.cue}get timelineOccupancy(){return this.dateRange.attr["X-TIMELINE-OCCUPIES"]==="RANGE"?w1.Range:w1.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 M4e(this)}}function zN(n,e){return n-e.start<e.duration/2&&!(Math.abs(n-(e.start+e.duration))<G0)?e.start:e.start+e.duration}function Mee(n,e,t){const r=new self.URL(n,t);return r.protocol!=="data:"&&r.searchParams.set("_HLS_primary_id",e),r}function qN(n,e){for(;(t=n.assetList[++e])!=null&&t.error;)var t;return e}function M4e(n){return`["${n.identifier}" ${n.cue.pre?"<pre>":n.cue.post?"<post>":""}${n.timelineStart.toFixed(2)}-${n.resumeTime.toFixed(2)}]`}function B0(n){const e=n.timelineStart,t=n.duration||0;return`["${n.identifier}" ${e.toFixed(2)}-${(e+t).toFixed(2)}]`}class F4e{constructor(e,t,r,s){this.hls=void 0,this.interstitial=void 0,this.assetItem=void 0,this.tracks=null,this.hasDetail
vendor: 4,236 bytes, line 4744
4744s=!1,this.mediaAttached=null,this._currentTime=void 0,this._bufferedEosTime=void 0,this.checkPlayout=()=>{this.reachedPlayout(this.currentTime)&&this.hls&&this.hls.trigger(V.PLAYOUT_LIMIT_REACHED,{})};const a=this.hls=new e(t);this.interstitial=r,this.assetItem=s;const o=()=>{this.hasDetails=!0};a.once(V.LEVEL_LOADED,o),a.once(V.AUDIO_TRACK_LOADED,o),a.once(V.SUBTITLE_TRACK_LOADED,o),a.on(V.MEDIA_ATTACHING,(l,{media:c})=>{this.removeMediaListeners(),this.mediaAttached=c,this.interstitial.playoutLimit&&(c.addEventListener("timeupdate",this.checkPlayout),this.appendInPlace&&a.on(V.BUFFER_APPENDED,()=>{const h=this.bufferedEnd;this.reachedPlayout(h)&&(this._bufferedEosTime=h,a.trigger(V.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 t=this.assetItem.uri;try{t=Mee(t,e.config.primarySessionId||"").href}catch{}e.loadSource(t)}}bufferedInPlaceToEnd(e){var t;if(!this.appendInPlace)return!1;if((t=this.hls)!=null&&t.bufferedToEnd)return!0;if(!e)return!1;const r=Math.min(this._bufferedEosTime||1/0,this.duration),s=this.timelineOffset,a=Vt.bufferInfo(e,s,0);return this.getAssetTime(a.end)>=r-.02}reachedPlayout(e){const r=this.interstitial.playoutLimit;return this.startOffset+e>=r}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 t=Vt.bufferInfo(e,e.currentTime,.001);return this.getAssetTime(t.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 t=this.interstitial.playoutLimit;if(t){const r=t-this.startOffset;if(r>0&&r<e)return r}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 t=this.timelineOffset;if(e!==t){const r=e-t;if(Math.abs(r)>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 t=this.timelineOffset,r=this.duration;return Math.min(Math.max(0,e-t),r)}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 t;this.loadSource(),(t=this.hls)==null||t.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 t=r=>delete r.details;e.levels.forEach(t),e.allAudioTracks.forEach(t),e.allSubtitleTracks.forEach(t),this.hasDetails=!1}}on(e,t,r){var s;(s=this.hls)==null||s.on(e,t)}once(e,t,r){var s;(s=this.hls)==null||s.once(e,t)}off(e,t,r){var s;(s=this.hls)==null||s.off(e,t)}toString(){var e;return`HlsAssetPlayer: ${B0(this.assetItem)} ${(e=this.hls)==null?void 0:e.sessionId} ${this.appendInPlace?"append-in-place":""}`}}const DG=.033;class U4e extends ul{constructor(e,t){super("interstitials-sched",t),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={}
vendor: 7,585 bytes, line 4744
4744,this.setDurations(0,0,0),this.events&&this.events.forEach(e=>e.reset()),this.events=this.items=null}resetErrorsInRange(e,t){return this.events?this.events.reduce((r,s)=>e<=s.startOffset&&t>s.startOffset?(delete s.error,r+1):r,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,t){if(e.event)return this.findEventIndex(e.event.identifier);let r=-1;e.nextEvent?r=this.findEventIndex(e.nextEvent.identifier)-1:e.previousEvent&&(r=this.findEventIndex(e.previousEvent.identifier)+1);const s=this.items;if(s)for(s[r]||(t===void 0&&(t=e.start),r=this.findItemIndexAtTime(t));r>=0&&(a=s[r])!=null&&a.event;){var a;r--}return r}findItemIndexAtTime(e,t){const r=this.items;if(r)for(let s=0;s<r.length;s++){let a=r[s];if(t&&t!=="primary"&&(a=a[t]),e===a.start||e>a.start&&e<a.end)return s}return-1}findJumpRestrictedIndex(e,t){const r=this.items;if(r)for(let s=e;s<=t&&r[s];s++){const a=r[s].event;if(a!=null&&a.restrictions.jump&&!a.appendInPlace)return s}return-1}findEventIndex(e){const t=this.items;if(t)for(let s=t.length;s--;){var r;if(((r=t[s].event)==null?void 0:r.identifier)===e)return s}return-1}findAssetIndex(e,t){const r=e.assetList,s=r.length;if(s>1)for(let a=0;a<s;a++){const o=r[a];if(!o.error){const l=o.timelineStart;if(t===l||t>l&&(t<l+(o.duration||0)||a===s-1))return a}}return 0}get assetIdAtEnd(){var e;const t=(e=this.items)==null||(e=e[this.length-1])==null?void 0:e.event;if(t){const r=t.assetList,s=r[r.length-1];if(s)return s.identifier}return null}parseInterstitialDateRanges(e,t){const r=e.main.details,{dateRanges:s}=r,a=this.events,o=this.parseDateRanges(s,{url:r.url},t),l=Object.keys(s),c=a?a.filter(d=>!l.includes(d.identifier)):[];o.length&&o.sort((d,h)=>{const m=d.cue.pre,p=d.cue.post,x=h.cue.pre,y=h.cue.post;if(m&&!x)return-1;if(x&&!m||p&&!y)return 1;if(y&&!p)return-1;if(!m&&!x&&!p&&!y){const v=d.startTime,B=h.startTime;if(v!==B)return v-B}return d.dateRange.tagOrder-h.dateRange.tagOrder}),this.events=o,c.forEach(d=>{this.removeEvent(d)}),this.updateSchedule(e,c)}updateSchedule(e,t=[],r=!1){const s=this.events||[];if(s.length||t.length||this.length<2){const a=this.items,o=this.parseSchedule(s,e);(r||t.length||(a==null?void 0:a.length)!==o.length||o.some((c,d)=>Math.abs(c.playout.start-a[d].playout.start)>.005||Math.abs(c.playout.end-a[d].playout.end)>.005))&&(this.items=o,this.onScheduleUpdate(t,a))}}parseDateRanges(e,t,r){const s=[],a=Object.keys(e);for(let o=0;o<a.length;o++){const l=a[o],c=e[l];if(c.isInterstitial){let d=this.eventMap[l];d?d.setDateRange(c):(d=new O4e(c,t),this.eventMap[l]=d,r===!1&&(d.appendInPlace=r)),s.push(d)}}return s}parseSchedule(e,t){const r=[],s=t.main.details,a=s.live?1/0:s.edge;let o=0;if(e=e.filter(c=>!c.error&&!(c.cue.once&&c.hasPlayed)),e.length){this.resolveOffsets(e,t);let c=0,d=0;if(e.forEach((h,m)=>{const p=h.cue.pre,x=h.cue.post,y=e[m-1]||null,v=h.appendInPlace,B=x?a:h.startOffset,E=h.duration,N=h.timelineOccupancy===w1.Range?E:0,T=h.resumptionOffset,k=(y==null?void 0:y.startTime)===B,P=B+h.cumulativeDuration;let R=v?P+E:B+T;if(p||!x&&B<=0){const I=d;d+=N,h.timelineStart=P;const D=o;o+=E,r.push({event:h,start:P,end:R,playout:{start:D,end:o},integrated:{start:I,end:d}})}else if(B<=a){if(!k){const j=B-c;if(j>DG){const O=c,M=d;d+=j;const U=o;o+=j;const ee={previousEvent:e[m-1]||null,nextEvent:h,start:O,end:O+j,playout:{start:U,end:o},integrated:{start:M,end:d}};r.push(ee)}else j>0&&y&&(y.cumulativeDuration+=j,r[r.length-1].end=B)}x&&(R=P),h.timelineStart=P;const I=d;d+=N;const D=o;o+=E,r.push({event:h,start:P,end:R,playout:{start:D,end:o},integrated:{start:I,end:d}})}else return;const _=h.resumeTime;x||_>a?c=a:c=_}),c<a){var l;const h=c,m=d,p=a-c;d+=p;const x=o;o+=p,r.push({previousEvent:((l=r[r.length-1])==null?void 0:l.event)||null,nextEvent:null,start:c,end:h+p,playout:{start:x,end:o},integrated:{start:m,end:d}})}this.setDurations(a,o,d)}else r.push({previousEvent:null,nextEvent:null,start:0,end:a,playout:{start:0,end:a},integrated:{start:0,end:a}}),this.setDurations(a,a,a);return r}setDurations(e,t,r){this.durations={primary:e,playout:t,integrated:r}}resolveOffsets(e,t){const r=t.main.details,s=r.live?1/0:r.edge;let a=0,o=-1;e.forEach((l,c)=>{const d=l.cue.pre,h=l.cue.post,m=d?0:h?s:l.startTime;this.updateAssetDurations(l),o===m?l.cumulativeDuration=a:(a=0,o=m),!h&&l.snapOptions.in&&(l.resumeAnchor=$m(null,r.fragments,l.startOffset+l.resumptionOffset,0,0)||void 0),l.appendInPlace&&!l.appendInPlaceStarted&&(this.primaryCanResumeInPlaceAt(l,t)||(l.appendInPlace=!1)),!l.appendInPlace&&c+1<e.length&&e[c+1].startTime-e[c].resumeTime<DG&&(e[c+1].appendInPlace=!1,e[c+1].appendInPlace&&this.warn(`Could not change append strategy for abutting event ${l}`));const x=ct(l.resumeOffset)?l.resumeOffset:l.duration;a+=x})}primaryCanResumeInPlaceAt(e,t){const r=e.resumeTime,s=e.startTime+e.resumptionOffset;return Math.abs(r-s)>G0?(this.log(`"${e.identifier}" resumption ${r} not aligned with estimated timeline end ${s}`),!1):!Object.keys(t).some(o=>{const l=t[o].details,c=l.edge;if(r>=c)return this.log(`"${e.identifier}" resumption ${r} past ${o} playlist end ${c}`),!1;const d=$m(null,l.fragments,r);if(!d)return this.log(`"${e.identifier}" resumption ${r} does not align with any fragments in ${o} playlist (${l.fragStart}-${l.fragmentEnd})`),!0;const h=o==="audio"?.175:0;return Math.abs(d.start-r)<G0+h||Math.abs(d.end-r)<G0+h?!1:(this.log(`"${e.identifier}" resumption ${r} not aligned with ${o} fragment bounds (${d.start}-${d.end} sn: ${d.sn} cc: ${d.cc})`),!0)})}updateAssetDurations(e){if(!e.assetListLoaded)return;const t=e.timelineStart;let r=0,s=!1,a=!1;for(let o=0;o<e.assetList.length;o++){const l=e.assetList[o],c=t+r;l.startOffset=r,l.timelineStart=c,s||(s=l.duration===null),a||(a=!!l.error);const d=l.error?0:l.duration||0;r+=d}s&&!a?e.duration=Math.max(r,e.duration):e.duration=r}removeEvent(e){e.reset(),delete this.eventMap[e.identifier]}}function Tl(n){return`[${n.event?'"'+n.event.identifier+'"':"primary"}: ${n.start.toFixed(2)}-${n.end.toFixed(2)}]`}class V4e{constructor(e){this.hls=void 0,this.hls=e}destroy(){this.hls=null}loadAssetList(e,t){const r=e.assetListUrl;let s;try{s=Mee(r,this.hls.sessionId,e.baseUrl)}catch(p){const x=this.assignAssetListError(e,Ee.ASSET_LIST_LOAD_ERROR,p,r);this.hls.trigger(V.ERROR,x);return}t&&s.protocol!=="data:"&&s.searchParams.set("_HLS_start_offset",""+t);const a=this.hls.config,o=a.loader,l=new o(a),c={responseType:"json",url:s.href},d=a.interstitialAssetListLoadPolicy.default,h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(p,x,y,v)=>{const B=p.data,E=B==null?void 0:B.ASSETS;if(!Array.isArray(E)){const N=this.assignAssetListError(e,Ee.ASSET_LIST_PARSING_ERROR,new Error("Invalid interstitial asset list"),y.url,x,v);this.hls.trigger(V.ERROR,N);return}e.assetListResponse=B,this.hls.trigger(V.ASSET_LIST_LOADED,{event:e,assetListResponse:B,networkDetails:v})},onError:(p,x,y,v)=>{const B=this.assignAssetListError(e,Ee.ASSET_LIST_LOAD_ERROR,new Error(`Error loading X-ASSET-LIST: HTTP status ${p.code} ${p.text} (${x.url})`),x.url,v,y);this.hls.trigger(V.ERROR,B)},onTimeout:(p,x,y)=>{const v=this.assignAssetListError(e,Ee.ASSET_LIST_LOAD_TIMEOUT,new Error(`Timeout loading X-ASSET-LIST (${x.url})`),x.url,p,y);this.hls.trigger(V.ERROR,v)}};return l.load(c,h,m),this.hls.trigger(V.ASSET_LIST_LOADING,{event:e}),l}assignAssetListError(e,t,r,s,a,o){return e.error=r,{type:Bt.NETWORK_E
vendor: 9,180 bytes, lines 4744-4745
4744RROR,details:t,fatal:!1,interstitial:e,url:s,error:r,networkDetails:o,stats:a}}}function jG(n){var e;n==null||(e=n.play())==null||e.catch(()=>{})}function r0(n,e){return`[${n}] Advancing timeline position to ${e}`}class G4e extends ul{constructor(e,t){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 r=this.currentTime;if(r===void 0||this.playbackDisabled||!this.schedule)return;const s=r-this.timelinePos;if(Math.abs(s)<1/7056e5)return;const o=s<=-.01;this.timelinePos===-1&&!this.effectivePlayingItem&&this.checkStart(),this.timelinePos=r,this.bufferedPos=r;const l=this.playingItem;if(!l){this.checkBuffer();return}if(o&&this.schedule.resetErrorsInRange(r,r-s)&&this.updateSchedule(!0),this.checkBuffer(),o&&r<l.start||r>=l.end){var c;const x=this.findItemIndex(l);let y=this.schedule.findItemIndexAtTime(r);if(y===-1&&(y=x+(o?-1:1),this.log(`seeked ${o?"back ":""}to position not covered by schedule ${r} (resolving from ${x} to ${y})`)),!this.isInterstitial(l)&&(c=this.media)!=null&&c.paused&&(this.shouldPlay=!1),!o&&y>x){const v=this.schedule.findJumpRestrictedIndex(x+1,y);if(v>x){this.setSchedulePosition(v);return}}this.setSchedulePosition(y);return}const d=this.playingAsset;if(!d){if(this.playingLastItem&&this.isInterstitial(l)){const x=l.event.assetList[0];x&&(this.endedItem=this.playingItem,this.playingItem=null,this.setScheduleToAssetAtTime(r,x))}return}const h=d.timelineStart,m=d.duration||0;if(o&&r<h||r>=h+m){var p;(p=l.event)!=null&&p.appendInPlace&&(this.clearAssetPlayers(l.event,l),this.flushFrontBuffer(r)),this.setScheduleToAssetAtTime(r,d)}},this.onTimeupdate=()=>{const r=this.currentTime;if(r===void 0||this.playbackDisabled)return;if(this.timelinePos===-1&&!this.effectivePlayingItem&&this.checkStart(),r>this.timelinePos)this.timelinePos=r,r>this.bufferedPos&&this.checkBuffer();else return;const s=this.playingItem;if(!s||this.playingLastItem)return;if(r>=s.end){this.timelinePos=s.end;const l=this.findItemIndex(s);this.setSchedulePosition(l+1)}const a=this.playingAsset;if(!a)return;const o=a.timelineStart+(a.duration||0);r>=o&&this.setScheduleToAssetAtTime(r,a)},this.onScheduleUpdate=(r,s)=>{const a=this.schedule;if(!a)return;const o=this.playingItem,l=a.events||[],c=a.items||[],d=a.durations,h=r.map(v=>v.identifier),m=!!(l.length||h.length);(m||s)&&this.log(`INTERSTITIALS_UPDATED (${l.length}): ${l}
4745Schedule: ${c.map(v=>Tl(v))} pos: ${this.timelinePos}`),h.length&&this.log(`Removed events ${h}`);let p=null,x=null;o&&(p=this.updateItem(o,this.timelinePos),this.itemsMatch(o,p)?this.playingItem=p:this.waitingItem=this.endedItem=null),this.waitingItem=this.updateItem(this.waitingItem),this.endedItem=this.updateItem(this.endedItem);const y=this.bufferingItem;if(y&&(x=this.updateItem(y,this.bufferedPos),this.itemsMatch(y,x)?this.bufferingItem=x:y.event&&(this.bufferingItem=this.playingItem,this.clearInterstitial(y.event,null))),r.forEach(v=>{v.assetList.forEach(B=>{this.clearAssetPlayer(B.identifier,null)})}),this.playerQueue.forEach(v=>{if(v.interstitial.appendInPlace){const B=v.assetItem.timelineStart,E=v.timelineOffset-B;if(E)try{v.timelineOffset=B}catch(N){Math.abs(E)>G0&&this.warn(`${N} ("${v.assetId}" ${v.timelineOffset}->${B})`)}}}),m||s){if(this.hls.trigger(V.INTERSTITIALS_UPDATED,{events:l.slice(0),schedule:c.slice(0),durations:d,removedIds:h}),this.isInterstitial(o)&&h.includes(o.event.identifier)){this.warn(`Interstitial "${o.event.identifier}" removed while playing`),this.primaryFallback(o.event);return}o&&this.trimInPlace(p,o),y&&x!==p&&this.trimInPlace(x,y),this.checkBuffer()}},this.hls=e,this.HlsPlayerClass=t,this.assetListLoader=new V4e(e),this.schedule=new U4e(this.onScheduleUpdate,e.logger),this.registerListeners()}registerListeners(){const e=this.hls;e&&(e.on(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(V.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(V.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.on(V.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(V.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.on(V.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.on(V.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.on(V.BUFFER_APPENDED,this.onBufferAppended,this),e.on(V.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(V.BUFFERED_TO_END,this.onBufferedToEnd,this),e.on(V.MEDIA_ENDED,this.onMediaEnded,this),e.on(V.ERROR,this.onError,this),e.on(V.DESTROYING,this.onDestroying,this))}unregisterListeners(){const e=this.hls;e&&(e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(V.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(V.AUDIO_TRACK_UPDATED,this.onAudioTrackUpdated,this),e.off(V.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(V.SUBTITLE_TRACK_UPDATED,this.onSubtitleTrackUpdated,this),e.off(V.EVENT_CUE_ENTER,this.onInterstitialCueEnter,this),e.off(V.ASSET_LIST_LOADED,this.onAssetListLoaded,this),e.off(V.BUFFER_CODECS,this.onBufferCodecs,this),e.off(V.BUFFER_APPENDED,this.onBufferAppended,this),e.off(V.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(V.BUFFERED_TO_END,this.onBufferedToEnd,this),e.off(V.MEDIA_ENDED,this.onMediaEnded,this),e.off(V.ERROR,this.onError,this),e.off(V.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){zi(e,"play",this.onPlay),zi(e,"pause",this.onPause),zi(e,"seeking",this.onSeeking),zi(e,"timeupdate",this.onTimeupdate)}onMediaAttaching(e,t){const r=this.media=t.media;pi(r,"seeking",this.onSeeking),pi(r,"timeupdate",this.onTimeupdate),pi(r,"play",this.onPlay),pi(r,"pause",this.onPause)}onMediaAttached(e,t){const r=this.effectivePlayingItem,s=this.detachedData;if(this.detachedData=null,r===null)this.checkStart();else if(!s){this.clearScheduleState();const a=this.findItemIndex(r);this.setSchedulePosition(a)}}clearScheduleState(){this.log("clear schedule state"),this.playingItem=this.bufferingItem=this.waitingItem=this.endedItem=this.playingAsset=this.endedAsset=this.bufferingAsset=null}onMediaDetaching(e,t){const r=!!t.transferMedia,s=this.media;if(this.media=null,!r&&(s&&this.removeMediaListeners(s),this.detachedData)){const a=this.getBufferingPlayer();a&&(this.log(`Removing schedule state for detachedData and ${a}`),this.playingAsset=this.endedAsset=this.bufferingAsset=this.bufferingItem=this.waitingItem=this.detachedData=null,a.detachMedia()),this.shouldPlay=!1}}get interstitialsManager(){if(!this.hls)return null;if(this.manager)return this.manager;const e=this,t=()=>e.bufferingItem||e.waitingItem,r=m=>m&&e.getAssetPlayer(m.identifier),s=(m,p,x,y,v)=>{if(m){let B=m[p].start;const E=m.event;if(E){if(p==="playout"||E.timelineOccupancy!==w1.Point){const N=r(x);(N==null?void 0:N.interstitial)===E&&(B+=N.assetItem.startOffset+N[v])}}else{const N=y==="bufferedPos"?o():e[y];B+=N-m.start}return B}return 0},a=(m,p)=>{var x;if(m!==0&&p!=="primary"&&(x=e.schedule)!=null&&x.length){var y;const v=e.schedule.findItemIndexAtTime(m),B=(y=e.schedule.items)==null?void 0:y[v];if(B){const E=B[p].start-B.start;return m+E}}return m},o=()=>{const m=e.bufferedPos;return m===Number.MAX_VALUE?l("primary"):Math.max(m,0)},l=m=>{var p,x;return(p=e.primaryDetails)!=null&&p.live?e.primaryDetails.edge:((x=e.schedule)==null?void 0:x.durations[m])||0},c=(m,p)=>{var x,y;const v=e.effectivePlayingItem;if(v!=null&&(x=v.event)!=null&&x.restrictions.skip||!e.schedule)return;e.log(`seek to ${m} "${p}"`);const B=e.effectivePlayingItem,E=e.schedule.findItemIndexAtTime(m,p),N=(y=e.schedule.items)==null?void 0:y[E],T=e.getBuffer
vendor: 34,795 bytes, line 4745
4745ingPlayer(),k=T==null?void 0:T.interstitial,P=k==null?void 0:k.appendInPlace,R=B&&e.itemsMatch(B,N);if(B&&(P||R)){const _=r(e.playingAsset),I=(_==null?void 0:_.media)||e.primaryMedia;if(I){const D=p==="primary"?I.currentTime:s(B,p,e.playingAsset,"timelinePos","currentTime"),j=m-D,O=(P?D:I.currentTime)+j;if(O>=0&&(!_||P||O<=_.duration)){I.currentTime=O;return}}}if(N){let _=m;if(p!=="primary"){const D=N[p].start,j=m-D;_=N.start+j}const I=!e.isInterstitial(N);if((!e.isInterstitial(B)||B.event.appendInPlace)&&(I||N.event.appendInPlace)){const D=e.media||(P?T==null?void 0:T.media:null);D&&(D.currentTime=_)}else if(B){const D=e.findItemIndex(B);if(E>D){const O=e.schedule.findJumpRestrictedIndex(D+1,E);if(O>D){e.setSchedulePosition(O);return}}let j=0;if(I)e.timelinePos=_,e.checkBuffer();else{const O=N.event.assetList,M=m-(N[p]||N).start;for(let U=O.length;U--;){const ee=O[U];if(ee.duration&&M>=ee.startOffset&&M<ee.startOffset+ee.duration){j=U;break}}}e.setSchedulePosition(E,j)}}},d=()=>{const m=e.effectivePlayingItem;if(e.isInterstitial(m))return m;const p=t();return e.isInterstitial(p)?p:null},h={get bufferedEnd(){const m=t(),p=e.bufferingItem;if(p&&p===m){var x;return s(p,"playout",e.bufferingAsset,"bufferedPos","bufferedEnd")-p.playout.start||((x=e.bufferingAsset)==null?void 0:x.startOffset)||0}return 0},get currentTime(){const m=d(),p=e.effectivePlayingItem;return p&&p===m?s(p,"playout",e.effectivePlayingAsset,"timelinePos","currentTime")-p.playout.start:0},set currentTime(m){const p=d(),x=e.effectivePlayingItem;x&&x===p&&c(m+x.playout.start,"playout")},get duration(){const m=d();return m?m.playout.end-m.playout.start:0},get assetPlayers(){var m;const p=(m=d())==null?void 0:m.event.assetList;return p?p.map(x=>e.getAssetPlayer(x.identifier)):[]},get playingIndex(){var m;const p=(m=d())==null?void 0:m.event;return p&&e.effectivePlayingAsset?p.findAssetIndex(e.effectivePlayingAsset):-1},get scheduleItem(){return d()}};return this.manager={get events(){var m;return((m=e.schedule)==null||(m=m.events)==null?void 0:m.slice(0))||[]},get schedule(){var m;return((m=e.schedule)==null||(m=m.items)==null?void 0:m.slice(0))||[]},get interstitialPlayer(){return d()?h:null},get playerQueue(){return e.playerQueue.slice(0)},get bufferingAsset(){return e.bufferingAsset},get bufferingItem(){return t()},get bufferingIndex(){const m=t();return e.findItemIndex(m)},get playingAsset(){return e.effectivePlayingAsset},get playingItem(){return e.effectivePlayingItem},get playingIndex(){const m=e.effectivePlayingItem;return e.findItemIndex(m)},primary:{get bufferedEnd(){return o()},get currentTime(){const m=e.timelinePos;return m>0?m:0},set currentTime(m){c(m,"primary")},get duration(){return l("primary")},get seekableStart(){var m;return((m=e.primaryDetails)==null?void 0:m.fragmentStart)||0}},integrated:{get bufferedEnd(){return s(t(),"integrated",e.bufferingAsset,"bufferedPos","bufferedEnd")},get currentTime(){return s(e.effectivePlayingItem,"integrated",e.effectivePlayingAsset,"timelinePos","currentTime")},set currentTime(m){c(m,"integrated")},get duration(){return l("integrated")},get seekableStart(){var m;return a(((m=e.primaryDetails)==null?void 0:m.fragmentStart)||0,"integrated")}},skip:()=>{const m=e.effectivePlayingItem,p=m==null?void 0:m.event;if(p&&!p.restrictions.skip){const x=e.findItemIndex(m);if(p.appendInPlace){const y=m.playout.start+m.event.duration;c(y+.001,"playout")}else e.advanceAfterAssetEnded(p,x,1/0)}}}}get effectivePlayingItem(){return this.waitingItem||this.playingItem||this.endedItem}get effectivePlayingAsset(){return this.playingAsset||this.endedAsset}get playingLastItem(){var e;const t=this.playingItem,r=(e=this.schedule)==null?void 0:e.items;return!this.playbackStarted||!t||!r?!1:this.findItemIndex(t)===r.length-1}get playbackStarted(){return this.effectivePlayingItem!==null}get currentTime(){var e,t;if(this.mediaSelection===null)return;const r=this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&!r.event.appendInPlace)return;let s=this.media;!s&&(e=this.bufferingItem)!=null&&(e=e.event)!=null&&e.appendInPlace&&(s=this.primaryMedia);const a=(t=s)==null?void 0:t.currentTime;if(!(a===void 0||!ct(a)))return a}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,t){const r=this.getAssetPlayer(e);r&&this.transferMediaFromPlayer(r,t)}transferMediaFromPlayer(e,t){const r=e.interstitial.appendInPlace,s=e.media;if(r&&s===this.primaryMedia){if(this.bufferingAsset=null,(!t||this.isInterstitial(t)&&!t.event.appendInPlace)&&t&&s){this.detachedData={media:s};return}const a=e.transferMedia();this.log(`transfer MediaSource from ${e} ${xr(a)}`),this.detachedData=a}else t&&s&&(this.shouldPlay||(this.shouldPlay=!s.paused))}transferMediaTo(e,t){var r,s;if(e.media===t)return;let a=null;const o=this.hls,l=e!==o,c=l&&e.interstitial.appendInPlace,d=(r=this.detachedData)==null?void 0:r.mediaSource;let h;if(o.media)c&&(a=o.transferMedia(),this.detachedData=a),h="Primary";else if(d){const y=this.getBufferingPlayer();y?(a=y.transferMedia(),h=`${y}`):h="detached MediaSource"}else h="detached media";if(!a){if(d)a=this.detachedData,this.log(`using detachedData: MediaSource ${xr(a)}`);else if(!this.detachedData||o.media===t){const y=this.playerQueue;y.length>1&&y.forEach(v=>{if(l&&v.interstitial.appendInPlace!==c){const B=v.interstitial;this.clearInterstitial(v.interstitial,null),B.appendInPlace=!1,B.appendInPlace&&this.warn(`Could not change append strategy for queued assets ${B}`)}}),this.hls.detachMedia(),this.detachedData={media:t}}}const m=a&&"mediaSource"in a&&((s=a.mediaSource)==null?void 0:s.readyState)!=="closed",p=m&&a?a:t;this.log(`${m?"transfering MediaSource":"attaching media"} to ${l?e:"Primary"} from ${h} (media.currentTime: ${t.currentTime})`);const x=this.schedule;if(p===a&&x){const y=l&&e.assetId===x.assetIdAtEnd;p.overrides={duration:x.duration,endOfStream:!l||y,cueRemoval:!l}}e.attachMedia(p)}onInterstitialCueEnter(){this.onTimeupdate()}checkStart(){const e=this.schedule,t=e==null?void 0:e.events;if(!t||this.playbackDisabled||!this.media)return;this.bufferedPos===-1&&(this.bufferedPos=0);const r=this.timelinePos,s=this.effectivePlayingItem;if(r===-1){const a=this.hls.startPosition;if(this.timelinePos=a,t.length===0)this.setSchedulePosition(0);else if(t[0].cue.pre){this.log(r0("checkStart (preroll)",a));const o=e.findEventIndex(t[0].identifier);this.setSchedulePosition(o)}else if(a>=0||!this.primaryLive){this.log(r0("checkStart",a));const o=this.timelinePos=a>0?a:0,l=e.findItemIndexAtTime(o);this.setSchedulePosition(l)}else this.hls.liveSyncPosition===0?this.setSchedulePosition(0):this.log("[checkStart] waiting for live start")}else if(s&&!this.playingItem){this.log(r0("checkStart (playing item)",s.start));const a=e.findItemIndex(s);this.setSchedulePosition(a)}}advanceAssetBuffering(e,t){const r=e.event,s=r.findAssetIndex(t),a=qN(r,s);if(!r.isAssetPastPlayoutLimit(a))this.bufferedToEvent(e,a);else if(this.schedule){var o;const l=(o=this.schedule.items)==null?void 0:o[this.findItemIndex(e)+1];l&&this.bufferedToItem(l)}}advanceAfterAssetEnded(e,t,r){const s=qN(e,r);if(e.isAssetPastPlayoutLimit(s)){if(this.schedule){const a=this.schedule.items;if(a){const o=t+1,l=a.length;if(o>=l){this.setSchedulePosition(-1);return}const c=e.resumeTime;this.timelinePos<c&&(this.log(r0("advanceAfterAssetEnded",c)),this.timelinePos=c,e.appendInPlace&&this.advanceInPlace(c),this.checkBuffer(this.bufferedPos<c)),this.setSchedulePosition(o)}}}else{if(e.appendInPlace){const a=e.assetList[s];a&&this.advanceInPlace(a.timelineStart)}this.setSchedulePosition(t,s)}}setScheduleToAssetAtTime(e,t){const r=this.schedule;if(!r)return;const s=t.parentIdentifier,a=r.getEvent(s);if(a){const o=r.findEventIndex(s),l=r.findAssetIndex(a,e);this.advanceAfterAssetEnded(a,o,l-1)}}setSchedulePosition(e,t){var r;const s=(r=this.schedule)==null?void 0:r.items;if(!s||this.playbackDisabled)return;const a=e>=0?s[e]:null;this.log(`setSchedulePosition ${e}, ${t} (${a&&Tl(a)}) pos: ${this.timelinePos}`);const o=this.waitingItem||this.playingItem,l=this.playingLastItem;if(this.isInterstitial(o)){const h=o.event,m=this.playingAsset,p=m==null?void 0:m.identifier,x=p?this.getAssetPlayer(p):null;if(x&&p&&(!this.eventItemsMatch(o,a)||t!==void 0&&p!==h.assetList[t].identifier)){var c;const y=h.findAssetIndex(m);if(this.log(`INTERSTITIAL_ASSET_ENDED ${y+1}/${h.assetList.length} ${B0(m)}`),this.endedAsset=m,this.playingAsset=null,this.hls.trigger(V.INTERSTITIAL_ASSET_ENDED,{asset:m,assetListIndex:y,event:h,schedule:s.slice(0),scheduleIndex:e,player:x}),o!==this.playingItem){this.itemsMatch(o,this.playingItem)&&!this.playingAsset&&this.advanceAfterAssetEnded(h,this.findItemIndex(this.playingItem),y);return}this.retreiveMediaSource(p,a),x.media&&!((c=this.detachedData)!=null&&c.mediaSource)&&x.detachMedia()}if(!this.eventItemsMatch(o,a)&&(this.endedItem=o,this.playingItem=null,this.log(`INTERSTITIAL_ENDED ${h} ${Tl(o)}`),h.hasPlayed=!0,this.hls.trigger(V.INTERSTITIAL_ENDED,{event:h,schedule:s.slice(0),scheduleIndex:e}),h.cue.once)){var d;this.updateSchedule();const y=(d=this.schedule)==null?void 0:d.items;if(a&&y){const v=this.findItemIndex(a);this.advanceSchedule(v,y,t,o,l)}return}}this.advanceSchedule(e,s,t,o,l)}advanceSchedule(e,t,r,s,a){const o=this.schedule;if(!o)return;const l=t[e]||null,c=this.primaryMedia,d=this.playerQueue;if(d.length&&d.forEach(h=>{const m=h.interstitial,p=o.findEventIndex(m.identifier);(p<e||p>e+1)&&this.clearInterstitial(m,l)}),this.isInterstitial(l)){this.timelinePos=Math.min(Math.max(this.timelinePos,l.start),l.end);const h=l.event;if(r===void 0){r=o.findAssetIndex(h,this.timelinePos);const y=qN(h,r-1);if(h.isAssetPastPlayoutLimit(y)||h.appendInPlace&&this.timelinePos===l.end){this.advanceAfterAssetEnded(h,e,r);return}r=y}const m=this.waitingItem;this.assetsBuffered(l,c)||this.setBufferingItem(l);let p=this.preloadAssets(h,r);if(this.eventItemsMatch(l,m||s)||(this.waitingItem=l,this.log(`INTERSTITIAL_STARTED ${Tl(l)} ${h.appendInPlace?"append in place":""}`),this.hls.trigger(V.INTERSTITIAL_STARTED,{event:h,schedule:t.slice(0),scheduleIndex:e})),!h.assetListLoaded){this.log(`Waiting for ASSET-LIST to complete loading ${h}`);return}if(h.assetListLoader&&(h.assetListLoader.destroy(),h.assetListLoader=void 0),!c){this.log(`Waiting for attachMedia to start Interstitial ${h}`);return}this.waitingItem=this.endedItem=null,this.playingItem=l;const x=h.assetList[r];if(!x){this.advanceAfterAssetEnded(h,e,r||0);return}if(p||(p=this.getAssetPlayer(x.identifier)),p===null||p.destroyed){const y=h.assetList.length;this.warn(`asset ${r+1}/${y} player destroyed ${h}`),p=this.createAssetPlayer(h,x,r),p.loadSource()}if(!this.eventItemsMatch(l,this.bufferingItem)&&h.appendInPlace&&this.isAssetBuffered(x))return;this.startAssetPlayer(p,r,t,e,c),this.shouldPlay&&jG(p.media)}else l?(this.resumePrimary(l,e,s),this.shouldPlay&&jG(this.hls.media)):a&&this.isInterstitial(s)&&(this.endedItem=null,this.playingItem=s,s.event.appendInPlace||this.attachPrimary(o.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,t,r){var s,a;if(this.playingItem=e,this.playingAsset=this.endedAsset=null,this.waitingItem=this.endedItem=null,this.bufferedToItem(e),this.log(`resuming ${Tl(e)}`),!((s=this.detachedData)!=null&&s.mediaSource)){let l=this.timelinePos;(l<e.start||l>=e.end)&&(l=this.getPrimaryResumption(e,t),this.log(r0("resumePrimary",l)),this.timelinePos=l),this.attachPrimary(l,e)}if(!r)return;const o=(a=this.schedule)==null?void 0:a.items;o&&(this.log(`INTERSTITIALS_PRIMARY_RESUMED ${Tl(e)}`),this.hls.trigger(V.INTERSTITIALS_PRIMARY_RESUMED,{schedule:o.slice(0),scheduleIndex:t}),this.checkBuffer())}getPrimaryResumption(e,t){const r=e.start;if(this.primaryLive){const s=this.primaryDetails;if(t===0)return this.hls.startPosition;if(s&&(r<s.fragmentStart||r>s.edge))return this.hls.liveSyncPosition||-1}return r}isAssetBuffered(e){const t=this.getAssetPlayer(e.identifier);return t!=null&&t.hls?t.hls.bufferedToEnd:Vt.bufferInfo(this.primaryMedia,this.timelinePos,0).end+1>=e.timelineStart+(e.duration||0)}attachPrimary(e,t,r){t?this.setBufferingItem(t):this.bufferingItem=this.playingItem,this.bufferingAsset=null;const s=this.primaryMedia;if(!s)return;const a=this.hls;a.media?this.checkBuffer():(this.transferMediaTo(a,s),r&&this.startLoadingPrimaryAt(e,r)),r||(this.log(r0("attachPrimary",e)),this.timelinePos=e,this.startLoadingPrimaryAt(e,r))}startLoadingPrimaryAt(e,t){var r;const s=this.hls;!s.loadingEnabled||!s.media||Math.abs((((r=s.mainForwardBufferInfo)==null?void 0:r.start)||s.media.currentTime)-e)>.5?s.startLoad(e,t):s.bufferingEnabled||s.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(V.BUFFER_CODECS,this.onBufferCodecs,this),this.hls.on(V.BUFFER_CODECS,this.onBufferCodecs,this)}onLevelUpdated(e,t){if(t.level===-1||!this.schedule)return;const r=this.hls.levels[t.level];if(!r.details)return;const s=zn(zn({},this.mediaSelection||this.altSelection),{},{main:r});this.mediaSelection=s,this.schedule.parseInterstitialDateRanges(s,this.hls.config.interstitialAppendInPlace),!this.effectivePlayingItem&&this.schedule.items&&this.checkStart()}onAudioTrackUpdated(e,t){const r=this.hls.audioTracks[t.id],s=this.mediaSelection;if(!s){this.altSelection=zn(zn({},this.altSelection),{},{audio:r});return}const a=zn(zn({},s),{},{audio:r});this.mediaSelection=a}onSubtitleTrackUpdated(e,t){const r=this.hls.subtitleTracks[t.id],s=this.mediaSelection;if(!s){this.altSelection=zn(zn({},this.altSelection),{},{subtitles:r});return}const a=zn(zn({},s),{},{subtitles:r});this.mediaSelection=a}onAudioTrackSwitching(e,t){const r=G9(t);this.playerQueue.forEach(({hls:s})=>s&&(s.setAudioOption(t)||s.setAudioOption(r)))}onSubtitleTrackSwitch(e,t){const r=G9(t);this.playerQueue.forEach(({hls:s})=>s&&(s.setSubtitleOption(t)||t.id!==-1&&s.setSubtitleOption(r)))}onBufferCodecs(e,t){const r=t.tracks;r&&(this.requiredTracks=r)}onBufferAppended(e,t){this.checkBuffer()}onBufferFlushed(e,t){const r=this.playingItem;if(r&&!this.itemsMatch(r,this.bufferingItem)&&!this.isInterstitial(r)){const s=this.timelinePos;this.bufferedPos=s,this.checkBuffer()}}onBufferedToEnd(e){if(!this.schedule)return;const t=this.schedule.events;if(this.bufferedPos<Number.MAX_VALUE&&t){for(let s=0;s<t.length;s++){const a=t[s];if(a.cue.post){var r;const o=this.schedule.findEventIndex(a.identifier),l=(r=this.schedule.items)==null?void 0:r[o];this.isInterstitial(l)&&this.eventItemsMatch(l,this.bufferingItem)&&this.bufferedToItem(l,0);break}}this.bufferedPos=Number.MAX_VALUE}}onMediaEnded(e){const t=this.playingItem;if(!this.playingLastItem&&t){const r=this.findItemIndex(t);this.setSchedulePosition(r+1)}else this.shouldPlay=!1}updateItem(e,t){var r;const s=(r=this.schedule)==null?void 0:r.items;if(e&&s){const a=this.findItemIndex(e,t);return s[a]||null}return null}trimInPlace(e,t){if(this.isInterstitial(e)&&e.event.appendInPlace&&t.end-e.end>.25){e.event.assetList.forEach((a,o)=>{e.event.isAssetPastPlayoutLimit(o)&&this.clearAssetPlayer(a.identifier,null)});const r=e.end+.25,s=Vt.bufferInfo(this.primaryMedia,r,0);(s.end>r||(s.nextStart||0)>r)&&(this.log(`trim buffered interstitial ${Tl(e)} (was ${Tl(t)})`),this.attachPrimary(r,null,!0),this.flushFrontBuffer(r))}}itemsMatch(e,t){return!!t&&(e===t||e.event&&t.event&&this.eventItemsMatch(e,t)||!e.event&&!t.event&&this.findItemIndex(e)===this.findItemIndex(t))}eventItemsMatch(e,t){var r;return!!t&&(e===t||e.event.identifier===((r=t.event)==null?void 0:r.identifier))}findItemIndex(e,t){return e&&this.schedule?this.schedule.findItemIndex(e,t):-1}updateSchedule(e=!1){var t;const r=this.mediaSelection;r&&((t=this.schedule)==null||t.updateSchedule(r,[],e))}checkBuffer(e){var t;const r=(t=this.schedule)==null?void 0:t.items;if(!r)return;const s=Vt.bufferInfo(this.primaryMedia,this.timelinePos,0);e&&(this.bufferedPos=this.timelinePos),e||(e=s.len<1),this.updateBufferedPos(s.end,r,e)}updateBufferedPos(e,t,r){const s=this.schedule,a=this.bufferingItem;if(this.bufferedPos>e||!s)return;if(t.length===1&&this.itemsMatch(t[0],a)){this.bufferedPos=e;return}const o=this.playingItem,l=this.findItemIndex(o);let c=s.findItemIndexAtTime(e);if(this.bufferedPos<e){var d;const h=this.findItemIndex(a),m=Math.min(h+1,t.length-1),p=t[m];if((c===-1&&a&&e>=a.end||(d=p.event)!=null&&d.appendInPlace&&e+.01>=p.start)&&(c=m),this.isInterstitial(a)){const x=a.event;if(m-l>1&&x.appendInPlace===!1||x.assetList.length===0&&x.assetListLoader)return}if(this.bufferedPos=e,c>h&&c>l)this.bufferedToItem(p);else{const x=this.primaryDetails;this.primaryLive&&x&&e>x.edge-x.targetduration&&p.start<x.edge+this.hls.config.interstitialLiveLookAhead&&this.isInterstitial(p)&&this.preloadAssets(p.event,0)}}else r&&o&&!this.itemsMatch(o,a)&&(c===l?this.bufferedToItem(o):c===l+1&&this.bufferedToItem(t[c]))}assetsBuffered(e,t){return e.event.assetList.length===0?!1:!e.event.assetList.some(s=>{const a=this.getAssetPlayer(s.identifier);return!(a!=null&&a.bufferedInPlaceToEnd(t))})}setBufferingItem(e){const t=this.bufferingItem,r=this.schedule;if(!this.itemsMatch(e,t)&&r){const{items:s,events:a}=r;if(!s||!a)return t;const o=this.isInterstitial(e),l=this.getBufferingPlayer();this.bufferingItem=e,this.bufferedPos=Math.max(e.start,Math.min(e.end,this.timelinePos));const c=l?l.remaining:t?t.end-this.timelinePos:0;if(this.log(`INTERSTITIALS_BUFFERED_TO_BOUNDARY ${Tl(e)}`+(t?` (${c.toFixed(2)} remaining)`:"")),!this.playbackDisabled)if(o){const d=r.findAssetIndex(e.event,this.bufferedPos);e.event.assetList.forEach((h,m)=>{const p=this.getAssetPlayer(h.identifier);p&&(m===d&&p.loadSource(),p.resumeBuffering())})}else this.hls.resumeBuffering(),this.playerQueue.forEach(d=>d.pauseBuffering());this.hls.trigger(V.INTERSTITIALS_BUFFERED_TO_BOUNDARY,{events:a.slice(0),schedule:s.slice(0),bufferingIndex:this.findItemIndex(e),playingIndex:this.findItemIndex(this.playingItem)})}else this.bufferingItem!==e&&(this.bufferingItem=e);return t}bufferedToItem(e,t=0){const r=this.setBufferingItem(e);if(!this.playbackDisabled){if(this.isInterstitial(e))this.bufferedToEvent(e,t);else if(r!==null){this.bufferingAsset=null;const s=this.detachedData;s?s.mediaSource?this.attachPrimary(e.start,e,!0):this.preloadPrimary(e):this.preloadPrimary(e)}}}preloadPrimary(e){const t=this.findItemIndex(e),r=this.getPrimaryResumption(e,t);this.startLoadingPrimaryAt(r)}bufferedToEvent(e,t){const r=e.event,s=r.assetList.length===0&&!r.assetListLoader,a=r.cue.once;if(s||!a){const o=this.preloadAssets(r,t);if(o!=null&&o.interstitial.appendInPlace){const l=this.primaryMedia;l&&this.bufferAssetPlayer(o,l)}}}preloadAssets(e,t){const r=e.assetUrl,s=e.assetList.length,a=s===0&&!e.assetListLoader,o=e.cue.once;if(a){const c=e.timelineStart;if(e.appendInPlace){var l;const p=this.playingItem;!this.isInterstitial(p)&&(p==null||(l=p.nextEvent)==null?void 0:l.identifier)===e.identifier&&this.flushFrontBuffer(c+.25)}let d,h=0;if(!this.playingItem&&this.primaryLive&&(h=this.hls.startPosition,h===-1&&(h=this.hls.liveSyncPosition||0)),h&&!(e.cue.pre||e.cue.post)){const p=h-c;p>0&&(d=Math.round(p*1e3)/1e3)}if(this.log(`Load interstitial asset ${t+1}/${r?1:s} ${e}${d?` live-start: ${h} start-offset: ${d}`:""}`),r)return this.createAsset(e,0,0,c,e.duration,r);const m=this.assetListLoader.loadAssetList(e,d);m&&(e.assetListLoader=m)}else if(!o&&s){for(let d=t;d<s;d++){const h=e.assetList[d],m=this.getAssetPlayerQueueIndex(h.identifier);(m===-1||this.playerQueue[m].destroyed)&&!h.error&&this.createAssetPlayer(e,h,d)}const c=e.assetList[t];if(c){const d=this.getAssetPlayer(c.identifier);return d&&d.loadSource(),d}}return null}flushFrontBuffer(e){const t=this.requiredTracks;if(!t)return;this.log(`Removing front buffer starting at ${e}`),Object.keys(t).forEach(s=>{this.hls.trigger(V.BUFFER_FLUSHING,{startOffset:e,endOffset:1/0,type:s})})}getAssetPlayerQueueIndex(e){const t=this.playerQueue;for(let r=0;r<t.length;r++)if(e===t[r].assetId)return r;return-1}getAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);return this.playerQueue[t]||null}getBufferingPlayer(){const{playerQueue:e,primaryMedia:t}=this;if(t){for(let r=0;r<e.length;r++)if(e[r].media===t)return e[r]}return null}createAsset(e,t,r,s,a,o){const l={parentIdentifier:e.identifier,identifier:L4e(e,o,t),duration:a,startOffset:r,timelineStart:s,uri:o};return this.createAssetPlayer(e,l,t)}createAssetPlayer(e,t,r){const s=this.hls,a=s.userConfig;let o=a.videoPreference;const l=s.loadLevelObj||s.levels[s.currentLevel];(o||l)&&(o=sr({},o),l.videoCodec&&(o.videoCodec=l.videoCodec),l.videoRange&&(o.allowedVideoRanges=[l.videoRange]));const c=s.audioTracks[s.audioTrack],d=s.subtitleTracks[s.subtitleTrack];let h=0;if(this.primaryLive||e.appendInPlace){const k=this.timelinePos-t.timelineStart;if(k>1){const P=t.duration;P&&k<P&&(h=k)}}const m=t.identifier,p=zn(zn({},a),{},{maxMaxBufferLength:Math.min(180,s.config.maxMaxBufferLength),autoStartLoad:!0,startFragPrefetch:!0,primarySessionId:s.sessionId,assetPlayerId:m,abrEwmaDefaultEstimate:s.bandwidthEstimate,interstitialsController:void 0,startPosition:h,liveDurationInfinity:!1,testBandwidth:!1,videoPreference:o,audioPreference:c||a.audioPreference,subtitlePreference:d||a.subtitlePreference});e.appendInPlace&&(e.appendInPlaceStarted=!0,t.timelineStart&&(p.timelineOffset=t.timelineStart));const x=p.cmcd;x!=null&&x.sessionId&&x.contentId&&(p.cmcd=sr({},x,{contentId:Xb(t.uri)})),this.getAssetPlayer(m)&&this.warn(`Duplicate date range identifier ${e} and asset ${m}`);const y=new F4e(this.HlsPlayerClass,p,e,t);this.playerQueue.push(y),e.assetList[r]=t;let v=!0;const B=k=>{if(k.live){var P;const I=new Error(`Interstitials MUST be VOD assets ${e}`),D={fatal:!0,type:Bt.OTHER_ERROR,details:Ee.INTERSTITIAL_ASSET_ITEM_ERROR,error:I},j=((P=this.schedule)==null?void 0:P.findEventIndex(e.identifier))||-1;this.handleAssetItemError(D,e,j,r,I.message);return}const R=k.edge-k.fragmentStart,_=t.duration;(v||_===null||R>_)&&(v=!1,this.log(`Interstitial asset "${m}" duration change ${_} > ${R}`),t.duration=R,this.updateSchedule())};y.on(V.LEVEL_UPDATED,(k,{details:P})=>B(P)),y.on(V.LEVEL_PTS_UPDATED,(k,{details:P})=>B(P)),y.on(V.EVENT_CUE_ENTER,()=>this.onInterstitialCueEnter());const E=(k,P)=>{const R=this.getAssetPlayer(m);if(R&&P.tracks){R.off(V.BUFFER_CODECS,E),R.tracks=P.tracks;const _=this.primaryMedia;this.bufferingAsset===R.assetItem&&_&&!R.media&&this.bufferAssetPlayer(R,_)}};y.on(V.BUFFER_CODECS,E);const N=()=>{var k;const P=this.getAssetPlayer(m);if(this.log(`buffered to end of asset ${P}`),!P||!this.schedule)return;const R=this.schedule.findEventIndex(e.identifier),_=(k=this.schedule.items)==null?void 0:k[R];this.isInterstitial(_)&&this.advanceAssetBuffering(_,t)};y.on(V.BUFFERED_TO_END,N);const T=k=>()=>{if(!this.getAssetPlayer(m)||!this.schedule)return;this.shouldPlay=!0;const R=this.schedule.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,R,k)};return y.once(V.MEDIA_ENDED,T(r)),y.once(V.PLAYOUT_LIMIT_REACHED,T(1/0)),y.on(V.ERROR,(k,P)=>{if(!this.schedule)return;const R=this.getAssetPlayer(m);if(P.details===Ee.BUFFER_STALLED_ERROR){if(R!=null&&R.appendInPlace){this.handleInPlaceStall(e);return}this.onTimeupdate(),this.checkBuffer(!0);return}this.handleAssetItemError(P,e,this.schedule.findEventIndex(e.identifier),r,`Asset player error ${P.error} ${e}`)}),y.on(V.DESTROYING,()=>{if(!this.getAssetPlayer(m)||!this.schedule)return;const P=new Error(`Asset player destroyed unexpectedly ${m}`),R={fatal:!0,type:Bt.OTHER_ERROR,details:Ee.INTERSTITIAL_ASSET_ITEM_ERROR,error:P};this.handleAssetItemError(R,e,this.schedule.findEventIndex(e.identifier),r,P.message)}),this.log(`INTERSTITIAL_ASSET_PLAYER_CREATED ${B0(t)}`),this.hls.trigger(V.INTERSTITIAL_ASSET_PLAYER_CREATED,{asset:t,assetListIndex:r,event:e,player:y}),y}clearInterstitial(e,t){this.clearAssetPlayers(e,t),e.reset()}clearAssetPlayers(e,t){e.assetList.forEach(r=>{this.clearAssetPlayer(r.identifier,t)})}resetAssetPlayer(e){const t=this.getAssetPlayerQueueIndex(e);if(t!==-1){this.log(`reset asset player "${e}" after error`);const r=this.playerQueue[t];this.transferMediaFromPlayer(r,null),r.resetDetails()}}clearAssetPlayer(e,t){const r=this.getAssetPlayerQueueIndex(e);if(r!==-1){const s=this.playerQueue[r];this.log(`clear ${s} toSegment: ${t&&Tl(t)}`),this.transferMediaFromPlayer(s,t),this.playerQueue.splice(r,1),s.destroy()}}emptyPlayerQueue(){let e;for(;e=this.playerQueue.pop();)e.destroy();this.playerQueue=[]}startAssetPlayer(e,t,r,s,a){const{interstitial:o,assetItem:l,assetId:c}=e,d=o.assetList.length,h=this.playingAsset;this.endedAsset=null,this.playingAsset=l,(!h||h.identifier!==c)&&(h&&(this.clearAssetPlayer(h.identifier,r[s]),delete h.error),this.log(`INTERSTITIAL_ASSET_STARTED ${t+1}/${d} ${B0(l)}`),this.hls.trigger(V.INTERSTITIAL_ASSET_STARTED,{asset:l,assetListIndex:t,event:o,schedule:r.slice(0),scheduleIndex:s,player:e})),this.bufferAssetPlayer(e,a)}bufferAssetPlayer(e,t){var r,s;if(!this.schedule)return;const{interstitial:a,assetItem:o}=e,l=this.schedule.findEventIndex(a.identifier),c=(r=this.schedule.items)==null?void 0:r[l];if(!c)return;e.loadSource(),this.setBufferingItem(c),this.bufferingAsset=o;const d=this.getBufferingPlayer();if(d===e)return;const h=a.appendInPlace;if(h&&(d==null?void 0:d.interstitial.appendInPlace)===!1)return;const m=(d==null?void 0:d.tracks)||((s=this.detachedData)==null?void 0:s.tracks)||this.requiredTracks;if(h&&o!==this.playingAsset){if(!e.tracks){this.log(`Waiting for track info before buffering ${e}`);return}if(m&&!vZ(m,e.tracks)){const p=new Error(`Asset ${B0(o)} SourceBuffer tracks ('${Object.keys(e.tracks)}') are not compatible with primary content tracks ('${Object.keys(m)}')`),x={fatal:!0,type:Bt.OTHER_ERROR,details:Ee.INTERSTITIAL_ASSET_ITEM_ERROR,error:p},y=a.findAssetIndex(o);this.handleAssetItemError(x,a,l,y,p.message);return}}this.transferMediaTo(e,t)}handleInPlaceStall(e){const t=this.schedule,r=this.primaryMedia;if(!t||!r)return;const s=r.currentTime,a=t.findAssetIndex(e,s),o=e.assetList[a];if(o){const l=this.getAssetPlayer(o.identifier);if(l){const c=l.currentTime||s-o.timelineStart,d=l.duration-c;if(this.warn(`Stalled at ${c} of ${c+d} in ${l} ${e} (media.currentTime: ${s})`),c&&(d/r.playbackRate<.5||l.bufferedInPlaceToEnd(r))&&l.hls){const h=t.findEventIndex(e.identifier);this.advanceAfterAssetEnded(e,h,a)}}}}advanceInPlace(e){const t=this.primaryMedia;t&&t.currentTime<e&&(t.currentTime=e)}handleAssetItemError(e,t,r,s,a){if(e.details===Ee.BUFFER_STALLED_ERROR)return;const o=t.assetList[s]||null;if(this.warn(`INTERSTITIAL_ASSET_ERROR ${o&&B0(o)} ${e.error}`),!this.schedule)return;const l=(o==null?void 0:o.identifier)||"",c=this.getAssetPlayerQueueIndex(l),d=this.playerQueue[c]||null,h=this.schedule.items,m=sr({},e,{fatal:!1,errorAction:F0(!0),asset:o,assetListIndex:s,event:t,schedule:h,scheduleIndex:r,player:d});if(this.hls.trigger(V.INTERSTITIAL_ASSET_ERROR,m),!e.fatal)return;const p=this.playingAsset,x=this.bufferingAsset,y=new Error(a);if(o&&(this.clearAssetPlayer(l,null),o.error=y),!t.assetList.some(v=>!v.error))t.error=y;else for(let v=s;v<t.assetList.length;v++)this.resetAssetPlayer(t.assetList[v].identifier);this.updateSchedule(!0),t.error?this.primaryFallback(t):p&&p.identifier===l?this.advanceAfterAssetEnded(t,r,s):x&&x.identifier===l&&this.isInterstitial(this.bufferingItem)&&this.advanceAssetBuffering(this.bufferingItem,x)}primaryFallback(e){const t=e.timelineStart,r=this.effectivePlayingItem;let s=this.timelinePos;if(r){this.log(`Fallback to primary from event "${e.identifier}" start: ${t} pos: ${s} playing: ${Tl(r)} error: ${e.error}`),s===-1&&(s=this.hls.startPosition);const o=this.updateItem(r,s);this.itemsMatch(r,o)&&this.clearInterstitial(e,null),e.appendInPlace&&(this.attachPrimary(t,null),this.flushFrontBuffer(t))}else if(s===-1){this.checkStart();return}if(!this.schedule)return;const a=this.schedule.findItemIndexAtTime(s);this.setSchedulePosition(a)}onAssetListLoaded(e,t){var r,s;const a=t.event,o=a.identifier,l=t.assetListResponse.ASSETS;if(!((r=this.schedule)!=null&&r.hasEvent(o)))return;const c=a.timelineStart,d=a.duration;let h=0;l.forEach((v,B)=>{const E=parseFloat(v.DURATION);this.createAsset(a,B,h,c+h,E,v.URI),h+=E}),a.duration=h,this.log(`Loaded asset-list with duration: ${h} (was: ${d}) ${a}`);const m=this.waitingItem,p=(m==null?void 0:m.event.identifier)===o;this.updateSchedule();const x=(s=this.bufferingItem)==null?void 0:s.event;if(p){var y;const v=this.schedule.findEventIndex(o),B=(y=this.schedule.items)==null?void 0:y[v];if(B){if(!this.playingItem&&this.timelinePos>B.end&&this.schedule.findItemIndexAtTime(this.timelinePos)!==v){a.error=new Error(`Interstitial ${l.length?"no longer within playback range":"asset-list is empty"} ${this.timelinePos} ${a}`),this.log(a.error.message),this.updateSchedule(!0),this.primaryFallback(a);return}this.setBufferingItem(B)}this.setSchedulePosition(v)}else if((x==null?void 0:x.identifier)===o){const v=a.assetList[0];if(v){const B=this.getAssetPlayer(v.identifier);if(x.appendInPlace){const E=this.primaryMedia;B&&E&&this.bufferAssetPlayer(B,E)}else B&&B.loadSource()}}}onError(e,t){if(this.schedule)switch(t.details){case Ee.ASSET_LIST_PARSING_ERROR:case Ee.ASSET_LIST_LOAD_ERROR:case Ee.ASSET_LIST_LOAD_TIMEOUT:{const r=t.interstitial;r&&(this.updateSchedule(!0),this.primaryFallback(r));break}case Ee.BUFFER_STALLED_ERROR:{const r=this.endedItem||this.waitingItem||this.playingItem;if(this.isInterstitial(r)&&r.event.appendInPlace){this.handleInPlaceStall(r.event);return}this.log(`Primary player stall @${this.timelinePos} bufferedPos: ${this.bufferedPos}`),this.onTimeupdate(),this.checkBuffer(!0);break}}}}const RG=500;class $4e extends KP{constructor(e,t,r){super(e,t,r,"subtitle-stream-controller",mt.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(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(V.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.on(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.on(V.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(V.SUBTITLE_TRACK_SWITCH,this.onSubtitleTrackSwitch,this),e.off(V.SUBTITLE_TRACK_LOADED,this.onSubtitleTrackLoaded,this),e.off(V.SUBTITLE_FRAG_PROCESSED,this.onSubtitleFragProcessed,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this)}startLoad(e,t){this.stopLoad(),this.state=Ve.IDLE,this.setInterval(RG),this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}onManifestLoading(){super.onManifestLoading(),this.mainDetails=null}onMediaDetaching(e,t){this.tracksBuffered=[],super.onMediaDetaching(e,t)}onLevelLoaded(e,t){this.mainDetails=t.details}onSubtitleFragProcessed(e,t){const{frag:r,success:s}=t;if(this.fragContextChanged(r)||(ws(r)&&(this.fragPrevious=r),this.state=Ve.IDLE),!s)return;const a=this.tracksBuffered[this.currentTrackId];if(!a)return;let o;const l=r.start;for(let d=0;d<a.length;d++)if(l>=a[d].start&&l<=a[d].end){o=a[d];break}const c=r.start+r.duration;o?o.end=c:(o={start:l,end:c},a.push(o)),this.fragmentTracker.fragBuffered(r),this.fragBufferedComplete(r,null),this.media&&this.tick()}onBufferFlushing(e,t){const{startOffset:r,endOffset:s}=t;if(r===0&&s!==Number.POSITIVE_INFINITY){const a=s-1;if(a<=0)return;t.endOffsetSubtitles=Math.max(0,a),this.tracksBuffered.forEach(o=>{for(let l=0;l<o.length;){if(o[l].end<=a){o.shift();continue}else if(o[l].start<a)o[l].start=a;else break;l++}}),this.fragmentTracker.removeFragmentsInRange(r,a,mt.SUBTITLE)}}onError(e,t){const r=t.frag;(r==null?void 0:r.type)===mt.SUBTITLE&&(t.details===Ee.FRAG_GAP&&this.fragmentTracker.fragBuffered(r,!0),this.fragCurrent&&this.fragCurrent.abortRequests(),this.state!==Ve.STOPPED&&(this.state=Ve.IDLE))}onSubtitleTracksUpdated(e,{subtitleTracks:t}){if(this.levels&&Cee(this.levels,t)){this.levels=t.map(r=>new Vy(r));return}this.tracksBuffered=[],this.levels=t.map(r=>{const s=new Vy(r);return this.tracksBuffered[s.id]=[],s}),this.fragmentTracker.removeFragmentsInRange(0,Number.POSITIVE_INFINITY,mt.SUBTITLE),this.fragPrevious=null,this.mediaBuffer=null}onSubtitleTrackSwitch(e,t){var r;if(this.currentTrackId=t.id,!((r=this.levels)!=null&&r.length)||this.currentTrackId===-1){this.clearInterval();return}const s=this.levels[this.currentTrackId];s!=null&&s.details?this.mediaBuffer=this.mediaBufferTimeRanges:this.mediaBuffer=null,s&&this.state!==Ve.STOPPED&&this.setInterval(RG)}onSubtitleTrackLoaded(e,t){var r;const{currentTrackId:s,levels:a}=this,{details:o,id:l}=t;if(!a){this.warn(`Subtitle tracks were reset while loading level ${l}`);return}const c=a[l];if(l>=a.length||!c)return;this.log(`Subtitle track ${l} loaded [${o.startSN},${o.endSN}]${o.lastPartSn?`[part-${o.lastPartSn}-${o.lastPartIndex}]`:""},duration:${o.totalduration}`),this.mediaBuffer=this.mediaBufferTimeRanges;let d=0;if(o.live||(r=c.details)!=null&&r.live){if(o.deltaUpdateFailed)return;const m=this.mainDetails;if(!m){this.startFragRequested=!1;return}const p=m.fragments[0];if(!c.details)o.hasProgramDateTime&&m.hasProgramDateTime?(v1(o,m),d=o.fragmentStart):p&&(d=p.start,gD(o,d));else{var h;d=this.alignPlaylists(o,c.details,(h=this.levelLastLoaded)==null?void 0:h.details),d===0&&p&&(d=p.start,gD(o,d))}m&&!this.startFragRequested&&this.setStartPosition(m,d)}c.details=o,this.levelLastLoaded=c,l===s&&(this.hls.trigger(V.SUBTITLE_TRACK_UPDATED,{details:o,id:l,groupId:t.groupId}),this.tick(),o.live&&!this.fragCurrent&&this.media&&this.state===Ve.IDLE&&($m(null,o.fragments,this.media.currentTime,0)||(this.warn("Subtitle playlist not aligned with playback"),c.details=void 0)))}_handleFragmentLoadComplete(e){const{frag:t,payload:r}=e,s=t.decryptdata,a=this.hls;if(!this.fragContextChanged(t)&&r&&r.byteLength>0&&s!=null&&s.key&&s.iv&&U0(s.method)){const o=performance.now();
vendor: 26,358 bytes, lines 4745-4755
4745this.decrypter.decrypt(new Uint8Array(r),s.key.buffer,s.iv.buffer,zP(s.method)).catch(l=>{throw a.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.FRAG_DECRYPT_ERROR,fatal:!1,error:l,reason:l.message,frag:t}),l}).then(l=>{const c=performance.now();a.trigger(V.FRAG_DECRYPTED,{frag:t,payload:l,stats:{tstart:o,tdecrypt:c}})}).catch(l=>{this.warn(`${l.name}: ${l.message}`),this.state=Ve.IDLE})}}doTick(){if(!this.media){this.state=Ve.IDLE;return}if(this.state===Ve.IDLE){const{currentTrackId:e,levels:t}=this,r=t==null?void 0:t[e];if(!r||!t.length||!r.details||this.waitForLive(r))return;const{config:s}=this,a=this.getLoadPosition(),o=Vt.bufferedInfo(this.tracksBuffered[this.currentTrackId]||[],a,s.maxBufferHole),{end:l,len:c}=o,d=r.details,h=this.hls.maxBufferLength+d.levelTargetDuration;if(c>h)return;const m=d.fragments,p=m.length,x=d.edge;let y=null;const v=this.fragPrevious;if(l<x){const N=s.maxFragLookUpTolerance,T=l>x-N?0:N;y=$m(v,m,Math.max(m[0].start,l),T),!y&&v&&v.start<m[0].start&&(y=m[0])}else y=m[p-1];if(y=this.filterReplacedPrimary(y,r.details),!y)return;const B=y.sn-d.startSN,E=m[B-1];if(E&&E.cc===y.cc&&this.fragmentTracker.getState(E)===Ks.NOT_LOADED&&(y=E),this.fragmentTracker.getState(y)===Ks.NOT_LOADED){const N=this.mapToInitFragWhenRequired(y);N&&this.loadFragment(N,r,l)}}}loadFragment(e,t,r){ws(e)?super.loadFragment(e,t,r):this._loadInitSegment(e,t)}get mediaBufferTimeRanges(){return new H4e(this.tracksBuffered[this.currentTrackId]||[])}}class H4e{constructor(e){this.buffered=void 0;const t=(r,s,a)=>{if(s=s>>>0,s>a-1)throw new DOMException(`Failed to execute '${r}' on 'TimeRanges': The index provided (${s}) is greater than the maximum bound (${a})`);return e[s][r]};this.buffered={get length(){return e.length},end(r){return t("end",r,e.length)},start(r){return t("start",r,e.length)}}}}const z4e={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},Fee=n=>String.fromCharCode(z4e[n]||n),Nl=15,gd=100,q4e={17:1,18:3,21:5,22:7,23:9,16:11,19:12,20:14},K4e={17:2,18:4,21:6,22:8,23:10,19:13,20:15},W4e={25:1,26:3,29:5,30:7,31:9,24:11,27:12,28:14},Y4e={25:2,26:4,29:6,30:8,31:10,27:13,28:15},Q4e=["white","green","blue","cyan","red","yellow","magenta","black","transparent"];class J4e{constructor(){this.time=null,this.verboseLevel=0}log(e,t){if(this.verboseLevel>=e){const r=typeof t=="function"?t():t;Kn.log(`${this.time} [${e}] ${r}`)}}}const _f=function(e){const t=[];for(let r=0;r<e.length;r++)t.push(e[r].toString(16));return t};class Uee{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 t=["foreground","underline","italics","background","flash"];for(let r=0;r<t.length;r++){const s=t[r];e.hasOwnProperty(s)&&(this[s]=e[s])}}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 X4e{constructor(){this.uchar=" ",this.penState=new Uee}reset(){this.uchar=" ",this.penState.reset()}setChar(e,t){this.uchar=e,this.penState.copy(t)}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 Z4e{constructor(e){this.chars=[],this.pos=0,this.currPenState=new Uee,this.cueStartTime=null,this.logger=void 0;for(let t=0;t<gd;t++)this.chars.push(new X4e);this.logger=e}equals(e){for(let t=0;t<gd;t++)if(!this.chars[t].equals(e.chars[t]))return!1;return!0}copy(e){for(let t=0;t<gd;t++)this.chars[t].copy(e.chars[t])}isEmpty(){let e=!0;for(let t=0;t<gd;t++)if(!this.chars[t].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>gd&&(this.logger.log(3,"Too large cursor position "+this.pos),this.pos=gd)}moveCursor(e){const t=this.pos+e;if(e>1)for(let r=this.pos+1;r<t+1;r++)this.chars[r].setPenState(this.currPenState);this.setCursor(t)}backSpace(){this.moveCursor(-1),this.chars[this.pos].setChar(" ",this.currPenState)}insertChar(e){e>=144&&this.backSpace();const t=Fee(e);if(this.pos>=gd){this.logger.log(0,()=>"Cannot insert "+e.toString(16)+" ("+t+") at position "+this.pos+". Skipping it!");return}this.chars[this.pos].setChar(t,this.currPenState),this.moveCursor(1)}clearFromPos(e){let t;for(t=e;t<gd;t++)this.chars[t].reset()}clear(){this.clearFromPos(0),this.pos=0,this.currPenState.reset()}clearToEndOfRow(){this.clearFromPos(this.pos)}getTextString(){const e=[];let t=!0;for(let r=0;r<gd;r++){const s=this.chars[r].uchar;s!==" "&&(t=!1),e.push(s)}return t?"":e.join("")}setPenStyles(e){this.currPenState.setStyles(e),this.chars[this.pos].setPenState(this.currPenState)}}class KN{constructor(e){this.rows=[],this.currRow=Nl-1,this.nrRollUpRows=null,this.lastOutputScreen=null,this.logger=void 0;for(let t=0;t<Nl;t++)this.rows.push(new Z4e(e));this.logger=e}reset(){for(let e=0;e<Nl;e++)this.rows[e].clear();this.currRow=Nl-1}equals(e){let t=!0;for(let r=0;r<Nl;r++)if(!this.rows[r].equals(e.rows[r])){t=!1;break}return t}copy(e){for(let t=0;t<Nl;t++)this.rows[t].copy(e.rows[t])}isEmpty(){let e=!0;for(let t=0;t<Nl;t++)if(!this.rows[t].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 = "+xr(e));let t=e.row-1;if(this.nrRollUpRows&&t<this.nrRollUpRows-1&&(t=this.nrRollUpRows-1),this.nrRollUpRows&&this.currRow!==t){for(let l=0;l<Nl;l++)this.rows[l].clear();const a=this.currRow+1-this.nrRollUpRows,o=this.lastOutputScreen;if(o){const l=o.rows[a].cueStartTime,c=this.logger.time;if(l!==null&&c!==null&&l<c)for(let d=0;d<this.nrRollUpRows;d++)this.rows[t-this.nrRollUpRows+d+1].copy(o.rows[a+d])}}this.currRow=t;const r=this.rows[this.currRow];if(e.indent!==null){const a=e.indent,o=Math.max(a-1,0);r.setCursor(e.indent),e.color=r.chars[o].penState.foreground}const s={foreground:e.color,underline:e.underline,italics:e.italics,background:"black",flash:!1};this.setPen(s)}setBkgData(e){this.logger.log(2,()=>"bkgData = "+xr(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,t=this.rows.splice(e,1)[0];t.clear(),this.rows.splice(this.currRow,0,t),this.logger.log(2,"Rolling up")}getDisplayText(e){e=e||!1;const t=[];let r="",s=-1;for(let a=0;a<Nl;a++){const o=this.rows[a].getTextString();o&&(s=a+1,e?t.push("Row "+s+": '"+o+"'"):t.push(o.trim()))}return t.length>0&&(e?r="["+t.join(" | ")+"]":r=t.join(`
4746`)),r}getTextAndFormat(){return this.rows}}class PG{constructor(e,t,r){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=t,this.mode=null,this.verbose=0,this.displayedMemory=new KN(r),this.nonDisplayedMemory=new KN(r),this.lastOutputScreen=new KN(r),this.currRollUpRow=this.displayedMemory.rows[Nl-1],this.writeScreen=this.displayedMemory,this.mode=null,this.cueStartTime=null,this.logger=r}reset(){this.mode=null,this.displayedMemory.reset(),this.nonDisplayedMemory.reset(),this.lastOutputScreen.reset(),this.outputFilter.reset(),this.currRollUpRow=this.displayedMemory.rows[Nl-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 r=0;r<e.length;r++)this.writeScreen.insertChar(e[r]);const t=this.writeScreen===this.displayedMemory?"DISP":"NON_DISP";this.logger.log(2,()=>t+": "+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 t={flash:!1};if(t.underline=e%2===1,t.italics=e>=46,t.italics)t.foreground="white";else{const r=Math.floor(e/2)-16,s=["white","green","blue","cyan","red","yellow","magenta"];t.foreground=s[r]}this.logger.log(2,"MIDROW: "+xr(t)),this.writeScreen.setPen(t)}outputDataUpdate(e=!1){const t=this.logger.time;t!==null&&this.outputFilter&&(this.cueStartTime===null&&!this.displayedMemory.isEmpty()?this.cueStartTime=t:this.displayedMemory.equals(this.lastOutputScreen)||(this.outputFilter.newCue(this.cueStartTime,t,this.lastOutputScreen),e&&this.outputFilter.dispatchCue&&this.outputFilter.dispatchCue(),this.cueStartTime=this.displayedMemory.isEmpty()?null:t),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 LG{constructor(e,t,r){this.channels=void 0,this.currentChannel=0,this.cmdHistory=tFe(),this.logger=void 0;const s=this.logger=new J4e;this.channels=[null,new PG(e,t,s),new PG(e+1,r,s)]}getHandler(e){return this.channels[e].getHandler()}setHandler(e,t){this.channels[e].setHandler(t)}addData(e,t){this.logger.time=e;for(let r=0;r<t.length;r+=2){const s=t[r]&127,a=t[r+1]&127;let o=!1,l=null;if(s===0&&a===0)continue;this.logger.log(3,()=>"["+_f([t[r],t[r+1]])+"] -> ("+_f([s,a])+")");const c=this.cmdHistory;if(s>=16&&s<=31){if(eFe(s,a,c)){Gw(null,null,c),this.logger.log(3,()=>"Repeated command ("+_f([s,a])+") is dropped");continue}Gw(s,a,this.cmdHistory),o=this.parseCmd(s,a),o||(o=this.parseMidrow(s,a)),o||(o=this.parsePAC(s,a)),o||(o=this.parseBackgroundAttributes(s,a))}else Gw(null,null,c);if(!o&&(l=this.parseChars(s,a),l)){const h=this.currentChannel;h&&h>0?this.channels[h].insertChars(l):this.logger.log(2,"No channel found yet. TEXT-MODE?")}!o&&!l&&this.logger.log(2,()=>"Couldn't parse cleaned data "+_f([s,a])+" orig: "+_f([t[r],t[r+1]]))}}parseCmd(e,t){const r=(e===20||e===28||e===21||e===29)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=33&&t<=35;if(!(r||s))return!1;const a=e===20||e===21||e===23?1:2,o=this.channels[a];return e===20||e===21||e===28||e===29?t===32?o.ccRCL():t===33?o.ccBS():t===34?o.ccAOF():t===35?o.ccAON():t===36?o.ccDER():t===37?o.ccRU(2):t===38?o.ccRU(3):t===39?o.ccRU(4):t===40?o.ccFON():t===41?o.ccRDC():t===42?o.ccTR():t===43?o.ccRTD():t===44?o.ccEDM():t===45?o.ccCR():t===46?o.ccENM():t===47&&o.ccEOC():o.ccTO(t-32),this.currentChannel=a,!0}parseMidrow(e,t){let r=0;if((e===17||e===25)&&t>=32&&t<=47){if(e===17?r=1:r=2,r!==this.currentChannel)return this.logger.log(0,"Mismatch channel in midrow parsing"),!1;const s=this.channels[r];return s?(s.ccMIDROW(t),this.logger.log(3,()=>"MIDROW ("+_f([e,t])+")"),!0):!1}return!1}parsePAC(e,t){let r;const s=(e>=17&&e<=23||e>=25&&e<=31)&&t>=64&&t<=127,a=(e===16||e===24)&&t>=64&&t<=95;if(!(s||a))return!1;const o=e<=23?1:2;t>=64&&t<=95?r=o===1?q4e[e]:W4e[e]:r=o===1?K4e[e]:Y4e[e];const l=this.channels[o];return l?(l.setPAC(this.interpretPAC(r,t)),this.currentChannel=o,!0):!1}interpretPAC(e,t){let r;const s={color:null,italics:!1,indent:null,underline:!1,row:e};return t>95?r=t-96:r=t-64,s.underline=(r&1)===1,r<=13?s.color=["white","green","blue","cyan","red","yellow","magenta","white"][Math.floor(r/2)]:r<=15?(s.italics=!0,s.color="white"):s.indent=Math.floor((r-16)/2)*4,s}parseChars(e,t){let r,s=null,a=null;if(e>=25?(r=2,a=e-8):(r=1,a=e),a>=17&&a<=19){let o;a===17?o=t+80:a===18?o=t+112:o=t+144,this.logger.log(2,()=>"Special char '"+Fee(o)+"' in channel "+r),s=[o]}else e>=32&&e<=127&&(s=t===0?[e]:[e,t]);return s&&this.logger.log(3,()=>"Char codes =  "+_f(s).join(",")),s}parseBackgroundAttributes(e,t){const r=(e===16||e===24)&&t>=32&&t<=47,s=(e===23||e===31)&&t>=45&&t<=47;if(!(r||s))return!1;let a;const o={};e===16||e===24?(a=Math.floor((t-32)/2),o.background=Q4e[a],t%2===1&&(o.background=o.background+"_semi")):t===45?o.background="transparent":(o.foreground="black",t===47&&(o.underline=!0));const l=e<=23?1:2;return this.channels[l].setBkgData(o),!0}reset(){for(let e=0;e<Object.keys(this.channels).length;e++){const t=this.channels[e];t&&t.reset()}Gw(null,null,this.cmdHistory)}cueSplitAtTime(e){for(let t=0;t<this.channels.length;t++){const r=this.channels[t];r&&r.cueSplitAtTime(e)}}}function Gw(n,e,t){t.a=n,t.b=e}function eFe(n,e,t){return t.a===n&&t.b===e}function tFe(){return{a:null,b:null}}var a5=(function(){if(y1!=null&&y1.VTTCue)return self.VTTCue;const n=["","lr","rl"],e=["start","middle","end","left","right"];function t(l,c){if(typeof c!="string"||!Array.isArray(l))return!1;const d=c.toLowerCase();return~l.indexOf(d)?d:!1}function r(l){return t(n,l)}function s(l){return t(e,l)}function a(l,...c){let d=1;for(;d<arguments.length;d++){const h=arguments[d];for(const m in h)l[m]=h[m]}return l}function o(l,c,d){const h=this,m={enumerable:!0};h.hasBeenReset=!1;let p="",x=!1,y=l,v=c,B=d,E=null,N="",T=!0,k="auto",P="start",R=50,_="middle",I=50,D="middle";Object.defineProperty(h,"id",a({},m,{get:function(){return p},set:function(j){p=""+j}})),Object.defineProperty(h,"pauseOnExit",a({},m,{get:function(){return x},set:function(j){x=!!j}})),Object.defineProperty(h,"startTime",a({},m,{get:function(){return y},set:function(j){if(typeof j!="number")throw new TypeError("Start time must be set to a number.");y=j,this.hasBeenReset=!0}})),Object.defineProperty(h,"endTime",a({},m,{get:function(){return v},set:function(j){if(typeof j!="number")throw new TypeError("End time must be set to a number.");v=j,this.hasBeenReset=!0}})),Object.defineProperty(h,"text",a({},m,{get:function(){return B},set:function(j){B=""+j,this.hasBeenReset=!0}})),Object.defineProperty(h,"region",a({},m,{get:function(){return E},set:function(j){E=j,this.hasBeenReset=!0}})),Object.defineProperty(h,"vertical",a({},m,{get:function(){return N},set:function(j){const O=r(j);if(O===!1)throw new SyntaxError("An invalid or illegal string was specified.");N=O,this.hasBeenReset=!0}})),Object.defineProperty(h,"snapToLines",a({},m,{get:function(){return T},set:function(j){T=!!j,this.hasBeenReset=!0}})),Object.defineProperty(h,"line",a({},m,{get:function(){return k},set:function(j){if(typeof j!="number"&&j!=="auto")throw new SyntaxError("An invalid number or illegal string was specified.");k=j,this.hasBeenReset=!0}})),Object.defineProperty(h,"lineAlign",a({},m,{get:function(){return P},set:function(j){const O=s(j);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");P=O,this.hasBeenReset=!0}})),Object.defineProperty(h,"position",a({},m,{get:function(){return R},set:function(j){if(j<0||j>100)throw new Error("Position must be between 0 and 100.");R=j,this.hasBeenReset=!0}})),Object.defineProperty(h,"positionAlign",a({},m,{get:function(){return _},set:function(j){const O=s(j);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");_=O,this.hasBeenReset=!0}})),Object.defineProperty(h,"size",a({},m,{get:function(){return I},set:function(j){if(j<0||j>100)throw new Error("Size must be between 0 and 100.");I=j,this.hasBeenReset=!0}})),Object.defineProperty(h,"align",a({},m,{get:function(){return D},set:function(j){const O=s(j);if(!O)throw new SyntaxError("An invalid or illegal string was specified.");D=O,this.hasBeenReset=!0}})),h.displayState=void 0}return o.prototype.getCueAsHTML=function(){return self.WebVTT.convertCueToDOMTree(self,this.text)},o})();class nFe{decode(e,t){if(!e)return"";if(typeof e!="string")throw new Error("Error - expected string data.");return decodeURIComponent(encodeURIComponent(e))}}function Vee(n){function e(r,s,a,o){return(r|0)*3600+(s|0)*60+(a|0)+parseFloat(o||0)}const t=n.match(/^(?:(\d+):)?(\d{2}):(\d{2})(\.\d+)?/);return t?parseFloat(t[2])>59?e(t[2],t[3],0,t[4]):e(t[1],t[2],t[3],t[4]):null}class rFe{constructor(){this.values=Object.create(null)}set(e,t){!this.get(e)&&t!==""&&(this.values[e]=t)}get(e,t,r){return r?this.has(e)?this.values[e]:t[r]:this.has(e)?this.values[e]:t}has(e){return e in this.values}alt(e,t,r){for(let s=0;s<r.length;++s)if(t===r[s]){this.set(e,t);break}}integer(e,t){/^-?\d+$/.test(t)&&this.set(e,parseInt(t,10))}percent(e,t){if(/^([\d]{1,3})(\.[\d]*)?%$/.test(t)){const r=parseFloat(t);if(r>=0&&r<=100)return this.set(e,r),!0}return!1}}function Gee(n,e,t,r){const s=r?n.split(r):[n];for(const a in s){if(typeof s[a]!="string")continue;const o=s[a].split(t);if(o.length!==2)continue;const l=o[0],c=o[1];e(l,c)}}const ED=new a5(0,0,""),$w=ED.align==="middle"?"middle":"center";function sFe(n,e,t){const r=n;function s(){const l=Vee(n);if(l===null)throw new Error("Malformed timestamp: "+r);return n=n.replace(/^[^\sa-zA-Z-]+/,""),l}function a(l,c){const d=new rFe;Gee(l,function(p,x){let y;switch(p){case"region":for(let v=t.length-1;v>=0;v--)if(t[v].id===x){d.set(p,t[v].region);break}break;case"vertical":d.alt(p,x,["rl","lr"]);break;case"line":y=x.split(","),d.integer(p,y[0]),d.percent(p,y[0])&&d.set("snapToLines",!1),d.alt(p,y[0],["auto"]),y.length===2&&d.alt("lineAlign",y[1],["start",$w,"end"]);break;case"position":y=x.split(","),d.percent(p,y[0]),y.length===2&&d.alt("positionAlign",y[1],["start",$w,"end","line-left","line-right","auto"]);break;case"size":d.percent(p,x);break;case"align":d.alt(p,x,["start",$w,"end","left","right"]);break}},/:/,/\s/),c.region=d.get("region",null),c.vertical=d.get("vertical","");let h=d.get("line","auto");h==="auto"&&ED.line===-1&&(h=-1),c.line=h,c.lineAlign=d.get("lineAlign","start"),c.snapToLines=d.get("snapToLines",!0),c.size=d.get("size",100),c.align=d.get("align",$w);let m=d.get("position","auto");m==="auto"&&ED.position===50&&(m=c.align==="start"||c.align==="left"?0:c.align==="end"||c.align==="right"?100:50),c.position=m}function o(){n=n.replace(/^\s+/,"")}if(o(),e.startTime=s(),o(),n.slice(0,3)!=="-->")throw new Error("Malformed time stamp (time stamps must be separated by '-->'): "+r);n=n.slice(3),o(),e.endTime=s(),o(),a(n,e)}function $ee(n){return n.replace(/<br(?: \/)?>/gi,`
4747`)}class aFe{constructor(){this.state="INITIAL",this.buffer="",this.decoder=new nFe,this.regionList=[],this.cue=null,this.oncue=void 0,this.onparsingerror=void 0,this.onflush=void 0}parse(e){const t=this;e&&(t.buffer+=t.decoder.decode(e,{stream:!0}));function r(){let a=t.buffer,o=0;for(a=$ee(a);o<a.length&&a[o]!=="\r"&&a[o]!==`
4748`;)++o;const l=a.slice(0,o);return a[o]==="\r"&&++o,a[o]===`
4749`&&++o,t.buffer=a.slice(o),l}function s(a){Gee(a,function(o,l){},/:/)}try{let a="";if(t.state==="INITIAL"){if(!/\r\n|\n/.test(t.buffer))return this;a=r();const l=a.match(/^()?WEBVTT([ \t].*)?$/);if(!(l!=null&&l[0]))throw new Error("Malformed WebVTT signature.");t.state="HEADER"}let o=!1;for(;t.buffer;){if(!/\r\n|\n/.test(t.buffer))return this;switch(o?o=!1:a=r(),t.state){case"HEADER":/:/.test(a)?s(a):a||(t.state="ID");continue;case"NOTE":a||(t.state="ID");continue;case"ID":if(/^NOTE($|[ \t])/.test(a)){t.state="NOTE";break}if(!a)continue;if(t.cue=new a5(0,0,""),t.state="CUE",a.indexOf("-->")===-1){t.cue.id=a;continue}case"CUE":if(!t.cue){t.state="BADCUE";continue}try{sFe(a,t.cue,t.regionList)}catch{t.cue=null,t.state="BADCUE";continue}t.state="CUETEXT";continue;case"CUETEXT":{const l=a.indexOf("-->")!==-1;if(!a||l&&(o=!0)){t.oncue&&t.cue&&t.oncue(t.cue),t.cue=null,t.state="ID";continue}if(t.cue===null)continue;t.cue.text&&(t.cue.text+=`
4750`),t.cue.text+=a}continue;case"BADCUE":a||(t.state="ID")}}}catch{t.state==="CUETEXT"&&t.cue&&t.oncue&&t.oncue(t.cue),t.cue=null,t.state=t.state==="INITIAL"?"BADWEBVTT":"BADCUE"}return this}flush(){const e=this;try{if((e.cue||e.state==="HEADER")&&(e.buffer+=`
4751
4752`,e.parse()),e.state==="INITIAL"||e.state==="BADWEBVTT")throw new Error("Malformed WebVTT signature.")}catch(t){e.onparsingerror&&e.onparsingerror(t)}return e.onflush&&e.onflush(),this}}const iFe=/\r\n|\n\r|\n|\r/g,WN=function(e,t,r=0){return e.slice(r,r+t.length)===t},oFe=function(e){let t=parseInt(e.slice(-3));const r=parseInt(e.slice(-6,-4)),s=parseInt(e.slice(-9,-7)),a=e.length>9?parseInt(e.substring(0,e.indexOf(":"))):0;if(!ct(t)||!ct(r)||!ct(s)||!ct(a))throw Error(`Malformed X-TIMESTAMP-MAP: Local:${e}`);return t+=1e3*r,t+=60*1e3*s,t+=3600*1e3*a,t};function i5(n,e,t){return Xb(n.toString())+Xb(e.toString())+Xb(t)}const lFe=function(e,t,r){let s=e[t],a=e[s.prevCC];if(!a||!a.new&&s.new){e.ccOffset=e.presentationOffset=s.start,s.new=!1;return}for(;(o=a)!=null&&o.new;){var o;e.ccOffset+=s.start-a.start,s.new=!1,s=a,a=e[s.prevCC]}e.presentationOffset=r};function cFe(n,e,t,r,s,a,o){const l=new aFe,c=To(new Uint8Array(n)).trim().replace(iFe,`
4753`).split(`
4754`),d=[],h=e?p3e(e.baseTime,e.timescale):0;let m="00:00.000",p=0,x=0,y,v=!0;l.oncue=function(B){const E=t[r];let N=t.ccOffset;const T=(p-h)/9e4;if(E!=null&&E.new&&(x!==void 0?N=t.ccOffset=E.start:lFe(t,r,T)),T){if(!e){y=new Error("Missing initPTS for VTT MPEGTS");return}N=T-t.presentationOffset}const k=B.endTime-B.startTime,P=mo((B.startTime+N-x)*9e4,s*9e4)/9e4;B.startTime=Math.max(P,0),B.endTime=Math.max(P+k,0);const R=B.text.trim();B.text=decodeURIComponent(encodeURIComponent(R)),B.id||(B.id=i5(B.startTime,B.endTime,R)),B.endTime>0&&d.push(B)},l.onparsingerror=function(B){y=B},l.onflush=function(){if(y){o(y);return}a(d)},c.forEach(B=>{if(v)if(WN(B,"X-TIMESTAMP-MAP=")){v=!1,B.slice(16).split(",").forEach(E=>{WN(E,"LOCAL:")?m=E.slice(6):WN(E,"MPEGTS:")&&(p=parseInt(E.slice(7)))});try{x=oFe(m)/1e3}catch(E){y=E}return}else B===""&&(v=!1);l.parse(B+`
4755`)}),l.flush()}const YN="stpp.ttml.im1t",Hee=/^(\d{2,}):(\d{2}):(\d{2}):(\d{2})\.?(\d+)?$/,zee=/^(\d*(?:\.\d*)?)(h|m|s|ms|f|t)$/,dFe={left:"start",center:"center",right:"end",start:"start",end:"end"};function OG(n,e,t,r){const s=Jt(new Uint8Array(n),["mdat"]);if(s.length===0){r(new Error("Could not parse IMSC1 mdat"));return}const a=s.map(l=>To(l)),o=m3e(e.baseTime,1,e.timescale);try{a.forEach(l=>t(uFe(l,o)))}catch(l){r(l)}}function uFe(n,e){const s=new DOMParser().parseFromString(n,"text/xml").getElementsByTagName("tt")[0];if(!s)throw new Error("Invalid ttml");const a={frameRate:30,subFrameRate:1,frameRateMultiplier:0,tickRate:0},o=Object.keys(a).reduce((m,p)=>(m[p]=s.getAttribute(`ttp:${p}`)||a[p],m),{}),l=s.getAttribute("xml:space")!=="preserve",c=MG(QN(s,"styling","style")),d=MG(QN(s,"layout","region")),h=QN(s,"body","[begin]");return[].map.call(h,m=>{const p=qee(m,l);if(!p||!m.hasAttribute("begin"))return null;const x=XN(m.getAttribute("begin"),o),y=XN(m.getAttribute("dur"),o);let v=XN(m.getAttribute("end"),o);if(x===null)throw FG(m);if(v===null){if(y===null)throw FG(m);v=x+y}const B=new a5(x-e,v-e,p);B.id=i5(B.startTime,B.endTime,B.text);const E=d[m.getAttribute("region")],N=c[m.getAttribute("style")],T=hFe(E,N,c),{textAlign:k}=T;if(k){const P=dFe[k];P&&(B.lineAlign=P),B.align=k}return sr(B,T),B}).filter(m=>m!==null)}function QN(n,e,t){const r=n.getElementsByTagName(e)[0];return r?[].slice.call(r.querySelectorAll(t)):[]}function MG(n){return n.reduce((e,t)=>
vendor: 6,317 bytes, lines 4755-4756
4755{const r=t.getAttribute("xml:id");return r&&(e[r]=t),e},{})}function qee(n,e){return[].slice.call(n.childNodes).reduce((t,r,s)=>{var a;return r.nodeName==="br"&&s?t+`
4756`:(a=r.childNodes)!=null&&a.length?qee(r,e):e?t+r.textContent.trim().replace(/\s+/g," "):t+r.textContent},"")}function hFe(n,e,t){const r="http://www.w3.org/ns/ttml#styling";let s=null;const a=["displayAlign","textAlign","color","backgroundColor","fontSize","fontFamily"],o=n!=null&&n.hasAttribute("style")?n.getAttribute("style"):null;return o&&t.hasOwnProperty(o)&&(s=t[o]),a.reduce((l,c)=>{const d=JN(e,r,c)||JN(n,r,c)||JN(s,r,c);return d&&(l[c]=d),l},{})}function JN(n,e,t){return n&&n.hasAttributeNS(e,t)?n.getAttributeNS(e,t):null}function FG(n){return new Error(`Could not parse ttml timestamp ${n}`)}function XN(n,e){if(!n)return null;let t=Vee(n);return t===null&&(Hee.test(n)?t=fFe(n,e):zee.test(n)&&(t=mFe(n,e))),t}function fFe(n,e){const t=Hee.exec(n),r=(t[4]|0)+(t[5]|0)/e.subFrameRate;return(t[1]|0)*3600+(t[2]|0)*60+(t[3]|0)+r/e.frameRate}function mFe(n,e){const t=zee.exec(n),r=Number(t[1]);switch(t[2]){case"h":return r*3600;case"m":return r*60;case"ms":return r*1e3;case"f":return r/e.frameRate;case"t":return r/e.tickRate}return r}class Hw{constructor(e,t){this.timelineController=void 0,this.cueRanges=[],this.trackName=void 0,this.startTime=null,this.endTime=null,this.screen=null,this.timelineController=e,this.trackName=t}dispatchCue(){this.startTime!==null&&(this.timelineController.addCues(this.trackName,this.startTime,this.endTime,this.screen,this.cueRanges),this.startTime=null)}newCue(e,t,r){(this.startTime===null||this.startTime>e)&&(this.startTime=e),this.endTime=t,this.screen=r,this.timelineController.createCaptionsTrack(this.trackName)}reset(){this.cueRanges=[],this.startTime=null}}class pFe{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=VG(),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(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.on(V.FRAG_LOADING,this.onFragLoading,this),e.on(V.FRAG_LOADED,this.onFragLoaded,this),e.on(V.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.on(V.FRAG_DECRYPTED,this.onFragDecrypted,this),e.on(V.INIT_PTS_FOUND,this.onInitPtsFound,this),e.on(V.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this)}destroy(){const{hls:e}=this;e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.SUBTITLE_TRACKS_UPDATED,this.onSubtitleTracksUpdated,this),e.off(V.FRAG_LOADING,this.onFragLoading,this),e.off(V.FRAG_LOADED,this.onFragLoaded,this),e.off(V.FRAG_PARSING_USERDATA,this.onFragParsingUserdata,this),e.off(V.FRAG_DECRYPTED,this.onFragDecrypted,this),e.off(V.INIT_PTS_FOUND,this.onInitPtsFound,this),e.off(V.SUBTITLE_TRACKS_CLEARED,this.onSubtitleTracksCleared,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),this.hls=this.config=this.media=null,this.cea608Parser1=this.cea608Parser2=void 0}initCea608Parsers(){const e=new Hw(this,"textTrack1"),t=new Hw(this,"textTrack2"),r=new Hw(this,"textTrack3"),s=new Hw(this,"textTrack4");this.cea608Parser1=new LG(1,e,t),this.cea608Parser2=new LG(3,r,s)}addCues(e,t,r,s,a){let o=!1;for(let l=a.length;l--;){const c=a[l],d=gFe(c[0],c[1],t,r);if(d>=0&&(c[0]=Math.min(c[0],t),c[1]=Math.max(c[1],r),o=!0,d/(r-t)>.5))return}if(o||a.push([t,r]),this.config.renderTextTracksNatively){const l=this.captionsTracks[e];this.Cues.newCue(l,t,r,s)}else{const l=this.Cues.newCue(null,t,r,s);this.hls.trigger(V.CUES_PARSED,{type:"captions",cues:l,track:e})}}onInitPtsFound(e,{frag:t,id:r,initPTS:s,timescale:a,trackId:o}){const{unparsedVttFrags:l}=this;r===mt.MAIN&&(this.initPTS[t.cc]={baseTime:s,timescale:a,trackId:o}),l.length&&(this.unparsedVttFrags=[],l.forEach(c=>{this.initPTS[c.frag.cc]?this.onFragLoaded(V.FRAG_LOADED,c):this.hls.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:c.frag,error:new Error("Subtitle discontinuity domain does not match main")})}))}getExistingTrack(e,t){const{media:r}=this;if(r)for(let s=0;s<r.textTracks.length;s++){const a=r.textTracks[s];if(UG(a,{name:e,lang:t,characteristics:"transcribes-spoken-dialog,describes-music-and-sound"}))return a}return null}createCaptionsTrack(e){this.config.renderTextTracksNatively?this.createNativeTrack(e):this.createNonNativeTrack(e)}createNativeTrack(e){if(this.captionsTracks[e])return;const{captionsProperties:t,captionsTracks:r,media:s}=this,{label:a,languageCode:o}=t[e],l=this.getExistingTrack(a,o);if(l)r[e]=l,k0(r[e]),Lee(r[e],s);else{const c=this.createTextTrack("captions",a,o);c&&(c[e]=!0,r[e]=c)}}createNonNativeTrack(e){if(this.nonNativeCaptionsTracks[e])return;const t=this.captionsProperties[e];if(!t)return;const r=t.label,s={_id:e,label:r,kind:"captions",default:t.media?!!t.media.default:!1,closedCaptions:t.media};this.nonNativeCaptionsTracks[e]=s,this.hls.trigger(V.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:[s]})}createTextTrack(e,t,r){const s=this.media;if(s)return s.addTextTrack(e,t,r)}onMediaAttaching(e,t){this.media=t.media,t.mediaSource||this._cleanTracks()}onMediaDetaching(e,t){const r=!!t.transferMedia;if(this.media=null,r)return;const{captionsTracks:s}=this;
vendor: 19,732 bytes, line 4756
4756Object.keys(s).forEach(a=>{k0(s[a]),delete s[a]}),this.nonNativeCaptionsTracks={}}onManifestLoading(){this.lastCc=-1,this.lastSn=-1,this.lastPartIndex=-1,this.prevCC=-1,this.vttCCs=VG(),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 t=e.textTracks;if(t)for(let r=0;r<t.length;r++)k0(t[r])}onSubtitleTracksUpdated(e,t){const r=t.subtitleTracks||[],s=r.some(a=>a.textCodec===YN);if(this.config.enableWebVTT||s&&this.config.enableIMSC1){if(Cee(this.tracks,r)){this.tracks=r;return}if(this.textTracks=[],this.tracks=r,this.config.renderTextTracksNatively){const o=this.media,l=o?jC(o.textTracks):null;if(this.tracks.forEach((c,d)=>{let h;if(l){let m=null;for(let p=0;p<l.length;p++)if(l[p]&&UG(l[p],c)){m=l[p],l[p]=null;break}m&&(h=m)}if(h)k0(h);else{const m=Kee(c);h=this.createTextTrack(m,c.name,c.lang),h&&(h.mode="disabled")}h&&this.textTracks.push(h)}),l!=null&&l.length){const c=l.filter(d=>d!==null).map(d=>d.label);c.length&&this.hls.logger.warn(`Media element contains unused subtitle tracks: ${c.join(", ")}. Replace media element for each source to clear TextTracks and captions menu.`)}}else if(this.tracks.length){const o=this.tracks.map(l=>({label:l.name,kind:l.type.toLowerCase(),default:l.default,subtitleTrack:l}));this.hls.trigger(V.NON_NATIVE_TEXT_TRACKS_FOUND,{tracks:o})}}}onManifestLoaded(e,t){this.config.enableCEA708Captions&&t.captions&&t.captions.forEach(r=>{const s=/(?:CC|SERVICE)([1-4])/.exec(r.instreamId);if(!s)return;const a=`textTrack${s[1]}`,o=this.captionsProperties[a];o&&(o.label=r.name,r.lang&&(o.languageCode=r.lang),o.media=r)})}closedCaptionsForLevel(e){const t=this.hls.levels[e.level];return t==null?void 0:t.attrs["CLOSED-CAPTIONS"]}onFragLoading(e,t){if(this.enabled&&t.frag.type===mt.MAIN){var r,s;const{cea608Parser1:a,cea608Parser2:o,lastSn:l}=this,{cc:c,sn:d}=t.frag,h=(r=(s=t.part)==null?void 0:s.index)!=null?r:-1;a&&o&&(d!==l+1||d===l&&h!==this.lastPartIndex+1||c!==this.lastCc)&&(a.reset(),o.reset()),this.lastCc=c,this.lastSn=d,this.lastPartIndex=h}}onFragLoaded(e,t){const{frag:r,payload:s}=t;if(r.type===mt.SUBTITLE)if(s.byteLength){const a=r.decryptdata,o="stats"in t;if(a==null||!a.encrypted||o){const l=this.tracks[r.level],c=this.vttCCs;c[r.cc]||(c[r.cc]={start:r.start,prevCC:this.prevCC,new:!0},this.prevCC=r.cc),l&&l.textCodec===YN?this._parseIMSC1(r,s):this._parseVTTs(t)}}else this.hls.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:new Error("Empty subtitle payload")})}_parseIMSC1(e,t){const r=this.hls;OG(t,this.initPTS[e.cc],s=>{this._appendCues(s,e.level),r.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:e})},s=>{r.logger.log(`Failed to parse IMSC1: ${s}`),r.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:e,error:s})})}_parseVTTs(e){var t;const{frag:r,payload:s}=e,{initPTS:a,unparsedVttFrags:o}=this,l=a.length-1;if(!a[r.cc]&&l===-1){o.push(e);return}const c=this.hls,d=(t=r.initSegment)!=null&&t.data?ol(r.initSegment.data,new Uint8Array(s)).buffer:s;cFe(d,this.initPTS[r.cc],this.vttCCs,r.cc,r.start,h=>{this._appendCues(h,r.level),c.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!0,frag:r})},h=>{const m=h.message==="Missing initPTS for VTT MPEGTS";m?o.push(e):this._fallbackToIMSC1(r,s),c.logger.log(`Failed to parse VTT cue: ${h}`),!(m&&l>r.cc)&&c.trigger(V.SUBTITLE_FRAG_PROCESSED,{success:!1,frag:r,error:h})})}_fallbackToIMSC1(e,t){const r=this.tracks[e.level];r.textCodec||OG(t,this.initPTS[e.cc],()=>{r.textCodec=YN,this._parseIMSC1(e,t)},()=>{r.textCodec="wvtt"})}_appendCues(e,t){const r=this.hls;if(this.config.renderTextTracksNatively){const s=this.textTracks[t];if(!s||s.mode==="disabled")return;e.forEach(a=>Oee(s,a))}else{const s=this.tracks[t];if(!s)return;const a=s.default?"default":"subtitles"+t;r.trigger(V.CUES_PARSED,{type:"subtitles",cues:e,track:a})}}onFragDecrypted(e,t){const{frag:r}=t;r.type===mt.SUBTITLE&&this.onFragLoaded(V.FRAG_LOADED,t)}onSubtitleTracksCleared(){this.tracks=[],this.captionsTracks={}}onFragParsingUserdata(e,t){if(!this.enabled||!this.config.enableCEA708Captions)return;const{frag:r,samples:s}=t;if(!(r.type===mt.MAIN&&this.closedCaptionsForLevel(r)==="NONE"))for(let a=0;a<s.length;a++){const o=s[a].bytes;if(o){this.cea608Parser1||this.initCea608Parsers();const l=this.extractCea608Data(o);this.cea608Parser1.addData(s[a].pts,l[0]),this.cea608Parser2.addData(s[a].pts,l[1])}}}onBufferFlushing(e,{startOffset:t,endOffset:r,endOffsetSubtitles:s,type:a}){const{media:o}=this;if(!(!o||o.currentTime<r)){if(!a||a==="video"){const{captionsTracks:l}=this;Object.keys(l).forEach(c=>CD(l[c],t,r))}if(this.config.renderTextTracksNatively&&t===0&&s!==void 0){const{textTracks:l}=this;Object.keys(l).forEach(c=>CD(l[c],t,s))}}}extractCea608Data(e){const t=[[],[]],r=e[0]&31;let s=2;for(let a=0;a<r;a++){const o=e[s++],l=127&e[s++],c=127&e[s++];if(l===0&&c===0)continue;if((4&o)!==0){const h=3&o;(h===0||h===1)&&(t[h].push(l),t[h].push(c))}}return t}}function Kee(n){return n.characteristics&&/transcribes-spoken-dialog/gi.test(n.characteristics)&&/describes-music-and-sound/gi.test(n.characteristics)?"captions":"subtitles"}function UG(n,e){return!!n&&n.kind===Kee(e)&&yD(e,n)}function gFe(n,e,t,r){return Math.min(e,r)-Math.max(n,t)}function VG(){return{ccOffset:0,presentationOffset:0,0:{start:0,prevCC:-1,new:!0}}}const xFe=/\s/,bFe={newCue(n,e,t,r){const s=[];let a,o,l,c,d;const h=self.VTTCue||self.TextTrackCue;for(let p=0;p<r.rows.length;p++)if(a=r.rows[p],l=!0,c=0,d="",!a.isEmpty()){var m;for(let v=0;v<a.chars.length;v++)xFe.test(a.chars[v].uchar)&&l?c++:(d+=a.chars[v].uchar,l=!1);a.cueStartTime=e,e===t&&(t+=1e-4),c>=16?c--:c++;const x=$ee(d.trim()),y=i5(e,t,x);n!=null&&(m=n.cues)!=null&&m.getCueById(y)||(o=new h(e,t,x),o.id=y,o.line=p+1,o.align="left",o.position=10+Math.min(80,Math.floor(c*8/32)*10),s.push(o))}return n&&s.length&&(s.sort((p,x)=>p.line==="auto"||x.line==="auto"?0:p.line>8&&x.line>8?x.line-p.line:p.line-x.line),s.forEach(p=>Oee(n,p))),s}};function yFe(){if(self.fetch&&self.AbortController&&self.ReadableStream&&self.Request)try{return new self.ReadableStream({}),!0}catch{}return!1}const vFe=/(\d+)-(\d+)\/(\d+)/;class GG{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||EFe,this.controller=new self.AbortController,this.stats=new MP}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,t,r){const s=this.stats;if(s.loading.start)throw new Error("Loader can only be used once.");s.loading.start=self.performance.now();const a=BFe(e,this.controller.signal),o=e.responseType==="arraybuffer",l=o?"byteLength":"length",{maxTimeToFirstByteMs:c,maxLoadTimeMs:d}=t.loadPolicy;this.context=e,this.config=t,this.callbacks=r,this.request=this.fetchSetup(e,a),self.clearTimeout(this.requestTimeout),t.timeout=c&&ct(c)?c:d,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},t.timeout),(Hy(this.request)?this.request.then(self.fetch):self.fetch(this.request)).then(m=>{var p;this.response=this.loader=m;const x=Math.max(self.performance.now(),s.loading.start);if(self.clearTimeout(this.requestTimeout),t.timeout=d,this.requestTimeout=self.setTimeout(()=>{this.callbacks&&(this.abortInternal(),this.callbacks.onTimeout(s,e,this.response))},d-(x-s.loading.start)),!m.ok){const{status:v,statusText:B}=m;throw new SFe(B||"fetch, bad network response",v,m)}s.loading.first=x,s.total=CFe(m.headers)||s.total;const y=(p=this.callbacks)==null?void 0:p.onProgress;return y&&ct(t.highWaterMark)?this.loadProgressively(m,s,e,t.highWaterMark,y):o?m.arrayBuffer():e.responseType==="json"?m.json():m.text()}).then(m=>{var p,x;const y=this.response;if(!y)throw new Error("loader destroyed");self.clearTimeout(this.requestTimeout),s.loading.end=Math.max(self.performance.now(),s.loading.first);const v=m[l];v&&(s.loaded=s.total=v);const B={url:y.url,data:m,code:y.status},E=(p=this.callbacks)==null?void 0:p.onProgress;E&&!ct(t.highWaterMark)&&E(s,e,m,y),(x=this.callbacks)==null||x.onSuccess(B,s,e,y)}).catch(m=>{var p;if(self.clearTimeout(this.requestTimeout),s.aborted)return;const x=m&&m.code||0,y=m?m.message:null;(p=this.callbacks)==null||p.onError({code:x,text:y},e,m?m.details:null,s)})}getCacheAge(){let e=null;if(this.response){const t=this.response.headers.get("age");e=t?parseFloat(t):null}return e}getResponseHeader(e){return this.response?this.response.headers.get(e):null}loadProgressively(e,t,r,s=0,a){const o=new ree,l=e.body.getReader(),c=()=>l.read().then(d=>{if(d.done)return o.dataLength&&a(t,r,o.flush().buffer,e),Promise.resolve(new ArrayBuffer(0));const h=d.value,m=h.length;return t.loaded+=m,m<s||o.dataLength?(o.push(h),o.dataLength>=s&&a(t,r,o.flush().buffer,e)):a(t,r,h.buffer,e),c()}).catch(()=>Promise.reject());return c()}}function BFe(n,e){const t={method:"GET",mode:"cors",credentials:"same-origin",signal:e,headers:new self.Headers(sr({},n.headers))};return n.rangeEnd&&t.headers.set("Range","bytes="+n.rangeStart+"-"+String(n.rangeEnd-1)),t}function wFe(n){const e=vFe.exec(n);if(e)return parseInt(e[2])-parseInt(e[1])+1}function CFe(n){const e=n.get("Content-Range");if(e){const r=wFe(e);if(ct(r))return r}const t=n.get("Content-Length");if(t)return parseInt(t)}function EFe(n,e){return new self.Request(n.url,e)}class SFe extends Error{constructor(e,t,r){super(e),this.code=void 0,this.details=void 0,this.code=t,this.details=r}}const TFe=/^age:\s*[\d.]+\s*$/im;class Wee{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 MP,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,t,r){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=t,this.callbacks=r,this.loadInternal()}loadInternal(){const{config:e,context:t}=this;if(!e||!t)return;const r=this.loader=new self.XMLHttpRequest,s=this.stats;s.loading.first=0,s.loaded=0,s.aborted=!1;const a=this.xhrSetup;a?Promise.resolve().then(()=>{if(!(this.loader!==r||this.stats.aborted))return a(r,t.url)}).catch(o=>{if(!(this.loader!==r||this.stats.aborted))return r.open("GET",t.url,!0),a(r,t.url)}).then(()=>{this.loader!==r||this.stats.aborted||this.openAndSendXhr(r,t,e)}).catch(o=>{var l;(l=this.callbacks)==null||l.onError({code:r.status,text:o.message},t,r,s)}):this.openAndSendXhr(r,t,e)}openAndSendXhr(e,t,r){e.readyState||e.open("GET",t.url,!0);const s=t.headers,{maxTimeToFirstByteMs:a,maxLoadTimeMs:o}=r.loadPolicy;if(s)for(const l in s)e.setRequestHeader(l,s[l]);t.rangeEnd&&e.setRequestHeader("Range","bytes="+t.rangeStart+"-"+(t.rangeEnd-1)),e.onreadystatechange=this.readystatechange.bind(this),e.onprogress=this.loadprogress.bind(this),e.responseType=t.responseType,self.clearTimeout(this.requestTimeout),r.timeout=a&&ct(a)?a:o,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),r.timeout),e.send()}readystatechange(){const{context:e,loader:t,stats:r}=this;if(!e||!t)return;const s=t.readyState,a=this.config;if(!r.aborted&&s>=2&&(r.loading.first===0&&(r.loading.first=Math.max(self.performance.now(),r.loading.start),a.timeout!==a.loadPolicy.maxLoadTimeMs&&(self.clearTimeout(this.requestTimeout),a.timeout=a.loadPolicy.maxLoadTimeMs,this.requestTimeout=self.setTimeout(this.loadtimeout.bind(this),a.loadPolicy.maxLoadTimeMs-(r.loading.first-r.loading.start)))),s===4)){self.clearTimeout(this.requestTimeout),t.onreadystatechange=null,t.onprogress=null;const d=t.status,h=t.responseType==="text"?t.responseText:null;if(d>=200&&d<300){const y=h??t.response;if(y!=null){var o,l;r.loading.end=Math.max(self.performance.now(),r.loading.first);const v=t.responseType==="arraybuffer"?y.byteLength:y.length;r.loaded=r.total=v,r.bwEstimate=r.total*8e3/(r.loading.end-r.loading.first);const B=(o=this.callbacks)==null?void 0:o.onProgress;B&&B(r,e,y,t);const E={url:t.responseURL,data:y,code:d};(l=this.callbacks)==null||l.onSuccess(E,r,e,t);return}}const m=a.loadPolicy.errorRetry,p=r.retry,x={url:e.url,data:void 0,code:d};if(x1(m,p,!1,x))this.retry(m);else{var c;Kn.error(`${d} while loading ${e.url}`),(c=this.callbacks)==null||c.onError({code:d,text:t.statusText},e,t,r)}}}loadtimeout(){if(!this.config)return;const e=this.config.loadPolicy.timeoutRetry,t=this.stats.retry;if(x1(e,t,!0))this.retry(e);else{var r;Kn.warn(`timeout while loading ${(r=this.context)==null?void 0:r.url}`);const s=this.callbacks;s&&(this.abortInternal(),s.onTimeout(this.stats,this.context,this.loader))}}retry(e){const{context:t,stats:r}=this;this.retryDelay=GP(e,r.retry),r.retry++,Kn.warn(`${status?"HTTP Status "+status:"Timeout"} while loading ${t==null?void 0:t.url}, retrying ${r.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 t=this.stats;t.loaded=e.loaded,e.lengthComputable&&(t.total=e.total)}getCacheAge(){let e=null;if(this.loader&&TFe.test(this.loader.getAllResponseHeaders())){const t=this.loader.getResponseHeader("age");e=t?parseFloat(t):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 AFe={maxTimeToFirstByteMs:8e3,maxLoadTimeMs:2e4,timeoutRetry:null,errorRetry:null},kFe=zn(zn({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:Wee,fLoader:void 0,pLoader:void 0,xhrSetup:void 0,licenseXhrSetup:void 0,licenseResponseCallback:void 0,abrController:UOe,bufferController:_3e,capLevelController:n5,errorController:zOe,fpsController:I4e,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:qZ,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:AFe},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},NFe()),{},{subtitleStreamController:$4e,subtitleTrackController:R4e,timelineController:pFe,audioStreamController:T3e,audioTrackController:A3e,emeController:V0,cmcdController:A4e,contentSteeringController:N4e,interstitialsController:G4e});function NFe(){return{cueHandler:bFe,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 _Fe(n,e,t){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 r=SD(n),s=["manifest","level","frag"],a=["TimeOut","MaxRetry","RetryDelay","MaxRetryTimeout"];
vendor: 24,438 bytes, line 4756
4756return s.forEach(o=>{const l=`${o==="level"?"playlist":o}LoadPolicy`,c=e[l]===void 0,d=[];a.forEach(h=>{const m=`${o}Loading${h}`,p=e[m];if(p!==void 0&&c){d.push(m);const x=r[l].default;switch(e[l]={default:x},h){case"TimeOut":x.maxLoadTimeMs=p,x.maxTimeToFirstByteMs=p;break;case"MaxRetry":x.errorRetry.maxNumRetry=p,x.timeoutRetry.maxNumRetry=p;break;case"RetryDelay":x.errorRetry.retryDelayMs=p,x.timeoutRetry.retryDelayMs=p;break;case"MaxRetryTimeout":x.errorRetry.maxRetryDelayMs=p,x.timeoutRetry.maxRetryDelayMs=p;break}}}),d.length&&t.warn(`hls.js config: "${d.join('", "')}" setting(s) are deprecated, use "${l}": ${xr(e[l])}`)}),zn(zn({},r),e)}function SD(n){return n&&typeof n=="object"?Array.isArray(n)?n.map(SD):Object.keys(n).reduce((e,t)=>(e[t]=SD(n[t]),e),{}):n}function IFe(n,e){const t=n.loader;t!==GG&&t!==Wee?(e.log("[config]: Custom loader detected, cannot enable progressive streaming"),n.progressive=!1):yFe()&&(n.loader=GG,n.progressive=!0,n.enableSoftwareAES=!0,e.log("[config]: Progressive streaming enabled, using FetchLoader"))}const RC=2,DFe=.1,jFe=.05,RFe=100;class PFe extends VZ{constructor(e,t){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 r;(r=this.media)!=null&&r.seeking||(this.waiting=self.performance.now(),this.tick())},this.onMediaEnded=()=>{if(this.hls){var r;this.ended=((r=this.media)==null?void 0:r.currentTime)||1,this.hls.trigger(V.MEDIA_ENDED,{stalled:!1})}},this.hls=e,this.fragmentTracker=t,this.registerListeners()}registerListeners(){const{hls:e}=this;e&&(e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.BUFFER_APPENDED,this.onBufferAppended,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.BUFFER_APPENDED,this.onBufferAppended,this))}destroy(){super.destroy(),this.unregisterListeners(),this.media=this.hls=this.fragmentTracker=null,this.mediaSource=void 0}onMediaAttached(e,t){this.setInterval(RFe),this.mediaSource=t.mediaSource;const r=this.media=t.media;pi(r,"playing",this.onMediaPlaying),pi(r,"waiting",this.onMediaWaiting),pi(r,"ended",this.onMediaEnded)}onMediaDetaching(e,t){this.clearInterval();const{media:r}=this;r&&(zi(r,"playing",this.onMediaPlaying),zi(r,"waiting",this.onMediaWaiting),zi(r,"ended",this.onMediaEnded),this.media=null),this.mediaSource=void 0}onBufferAppended(e,t){this.buffered=t.timeRanges}get hasBuffered(){return Object.keys(this.buffered).length>0}tick(){var e;if(!((e=this.media)!=null&&e.readyState)||!this.hasBuffered)return;const t=this.media.currentTime;this.poll(t,this.lastCurrentTime),this.lastCurrentTime=t}poll(e,t){var r,s;const a=(r=this.hls)==null?void 0:r.config;if(!a)return;const o=this.media;if(!o)return;const{seeking:l}=o,c=this.seeking&&!l,d=!this.seeking&&l,h=o.paused&&!l||o.ended||o.playbackRate===0;if(this.seeking=l,e!==t){t&&(this.ended=0),this.moved=!0,l||(this.nudgeRetry=0,a.nudgeOnVideoHole&&!h&&e>t&&this.nudgeOnVideoHole(e,t)),this.waiting===0&&this.stallResolved(e);return}if(d||c){c&&this.stallResolved(e);return}if(h){this.nudgeRetry=0,this.stallResolved(e),!this.ended&&o.ended&&this.hls&&(this.ended=e||1,this.hls.trigger(V.MEDIA_ENDED,{stalled:!1}));return}if(!Vt.getBuffered(o).length){this.nudgeRetry=0;return}const m=Vt.bufferInfo(o,e,0),p=m.nextStart||0,x=this.fragmentTracker;if(l&&x&&this.hls){const R=$G(this.hls.inFlightFragments,e),_=m.len>RC,I=!p||R||p-e>RC&&!x.getPartialFragment(e);if(_||I)return;this.moved=!1}const y=(s=this.hls)==null?void 0:s.latestLevelDetails;if(!this.moved&&this.stalled!==null&&x){if(!(m.len>0)&&!p)return;const _=Math.max(p,m.start||0)-e,D=!!(y!=null&&y.live)?y.targetduration*2:RC,j=zw(e,x);if(_>0&&(_<=D||j)){o.paused||this._trySkipBufferHole(j);return}}const v=a.detectStallWithCurrentTimeMs,B=self.performance.now(),E=this.waiting;let N=this.stalled;if(N===null)if(E>0&&B-E<v)N=this.stalled=E;else{this.stalled=B;return}const T=B-N;if(!l&&(T>=v||E)&&this.hls){var k;if(((k=this.mediaSource)==null?void 0:k.readyState)==="ended"&&!(y!=null&&y.live)&&Math.abs(e-((y==null?void 0:y.edge)||0))<1){if(this.ended)return;this.ended=e||1,this.hls.trigger(V.MEDIA_ENDED,{stalled:!0});return}if(this._reportStall(m),!this.media||!this.hls)return}const P=Vt.bufferInfo(o,e,a.maxBufferHole);this._tryFixBufferStall(P,T,e)}stallResolved(e){const t=this.stalled;if(t&&this.hls&&(this.stalled=null,this.stallReported)){const r=self.performance.now()-t;this.log(`playback not stuck anymore @${e}, after ${Math.round(r)}ms`),this.stallReported=!1,this.waiting=0,this.hls.trigger(V.STALL_RESOLVED,{})}}nudgeOnVideoHole(e,t){var r;const s=this.buffered.video;if(this.hls&&this.media&&this.fragmentTracker&&(r=this.buffered.audio)!=null&&r.length&&s&&s.length>1&&e>s.end(0)){const a=Vt.bufferedInfo(Vt.timeRangesToArray(this.buffered.audio),e,0);if(a.len>1&&t>=a.start){const o=Vt.timeRangesToArray(s),l=Vt.bufferedInfo(o,t,0).bufferedIndex;if(l>-1&&l<o.length-1){const c=Vt.bufferedInfo(o,e,0).bufferedIndex,d=o[l].end,h=o[l+1].start;if((c===-1||c>l)&&h-d<1&&e-d<2){const m=new Error(`nudging playhead to flush pipeline after video hole. currentTime: ${e} hole: ${d} -> ${h} buffered index: ${c}`);this.warn(m.message),this.media.currentTime+=1e-6;let p=zw(e,this.fragmentTracker);p&&"fragment"in p?p=p.fragment:p||(p=void 0);const x=Vt.bufferInfo(this.media,e,0);this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:m,reason:m.message,frag:p,buffer:x.len,bufferInfo:x})}}}}}_tryFixBufferStall(e,t,r){var s,a;const{fragmentTracker:o,media:l}=this,c=(s=this.hls)==null?void 0:s.config;if(!l||!o||!c)return;const d=(a=this.hls)==null?void 0:a.latestLevelDetails,h=zw(r,o);if((h||d!=null&&d.live&&r<d.fragmentStart)&&(this._trySkipBufferHole(h)||!this.media))return;const m=e.buffered,p=this.adjacentTraversal(e,r);(m&&m.length>1&&e.len>c.maxBufferHole||e.nextStart&&(e.nextStart-r<c.maxBufferHole||p))&&(t>c.highBufferWatchdogPeriod*1e3||this.waiting)&&(this.warn("Trying to nudge playhead over buffer-hole"),this._tryNudgeBuffer(e))}adjacentTraversal(e,t){const r=this.fragmentTracker,s=e.nextStart;if(r&&s){const a=r.getFragAtPos(t,mt.MAIN),o=r.getFragAtPos(s,mt.MAIN);if(a&&o)return o.sn-a.sn<2}return!1}_reportStall(e){const{hls:t,media:r,stallReported:s,stalled:a}=this;if(!s&&a!==null&&r&&t){this.stallReported=!0;const o=new Error(`Playback stalling at @${r.currentTime} due to low buffer (${xr(e)})`);this.warn(o.message),t.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_STALLED_ERROR,fatal:!1,error:o,buffer:e.len,bufferInfo:e,stalled:{start:a}})}}_trySkipBufferHole(e){var t;const{fragmentTracker:r,media:s}=this,a=(t=this.hls)==null?void 0:t.config;if(!s||!r||!a)return 0;const o=s.currentTime,l=Vt.bufferInfo(s,o,0),c=o<l.start?l.start:l.nextStart;if(c&&this.hls){const h=l.len<=a.maxBufferHole,m=l.len>0&&l.len<1&&s.readyState<3,p=c-o;if(p>0&&(h||m)){if(p>a.maxBufferHole){let y=!1;if(o===0){const v=r.getAppendedFrag(0,mt.MAIN);v&&c<v.end&&(y=!0)}if(!y&&e){var d;if(!((d=this.hls.loadLevelObj)!=null&&d.details)||$G(this.hls.inFlightFragments,c))return 0;let B=!1,E=e.end;for(;E<c;){const N=zw(E,r);if(N)E+=N.duration;else{B=!0;break}}if(B)return 0}}const x=Math.max(c+jFe,o+DFe);if(this.warn(`skipping hole, adjusting currentTime from ${o} to ${x}`),this.moved=!0,s.currentTime=x,!(e!=null&&e.gap)){const y=new Error(`fragment loaded with buffer holes, seeking from ${o} to ${x}`),v={type:Bt.MEDIA_ERROR,details:Ee.BUFFER_SEEK_OVER_HOLE,fatal:!1,error:y,reason:y.message,buffer:l.len,bufferInfo:l};e&&("fragment"in e?v.part=e:v.frag=e),this.hls.trigger(V.ERROR,v)}return x}}return 0}_tryNudgeBuffer(e){const{hls:t,media:r,nudgeRetry:s}=this,a=t==null?void 0:t.config;if(!r||!a)return 0;const o=r.currentTime;if(this.nudgeRetry++,s<a.nudgeMaxRetry){const l=o+(s+1)*a.nudgeOffset,c=new Error(`Nudging 'currentTime' from ${o} to ${l}`);this.warn(c.message),r.currentTime=l,t.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_NUDGE_ON_STALL,error:c,fatal:!1,buffer:e.len,bufferInfo:e})}else{const l=new Error(`Playhead still not moving while enough data buffered @${o} after ${a.nudgeMaxRetry} nudges`);this.error(l.message),t.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.BUFFER_STALLED_ERROR,error:l,fatal:!0,buffer:e.len,bufferInfo:e})}}}function $G(n,e){const t=HG(n.main);if(t&&t.start<=e)return t;const r=HG(n.audio);return r&&r.start<=e?r:null}function HG(n){if(!n)return null;switch(n.state){case Ve.IDLE:case Ve.STOPPED:case Ve.ENDED:case Ve.ERROR:return null}return n.frag}function zw(n,e){return e.getAppendedFrag(n,mt.MAIN)||e.getPartialFragment(n)}const LFe=.25;function TD(){if(!(typeof self>"u"))return self.VTTCue||self.TextTrackCue}function ZN(n,e,t,r,s){let a=new n(e,t,"");try{a.value=r,s&&(a.type=s)}catch{a=new n(e,t,xr(s?zn({type:s},r):r))}return a}const qw=(()=>{const n=TD();try{n&&new n(0,Number.POSITIVE_INFINITY,"")}catch{return Number.MAX_VALUE}return Number.POSITIVE_INFINITY})();class OFe{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(V.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(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.on(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(V.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}_unregisterListeners(){const{hls:e}=this;e&&(e.off(V.MEDIA_ATTACHING,this.onMediaAttaching,this),e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.FRAG_PARSING_METADATA,this.onFragParsingMetadata,this),e.off(V.BUFFER_FLUSHING,this.onBufferFlushing,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(V.LEVEL_PTS_UPDATED,this.onLevelPtsUpdated,this))}onMediaAttaching(e,t){var r;this.media=t.media,((r=t.overrides)==null?void 0:r.cueRemoval)===!1&&(this.removeCues=!1)}onMediaAttached(){var e;const t=(e=this.hls)==null?void 0:e.latestLevelDetails;t&&this.updateDateRangeCues(t)}onMediaDetaching(e,t){this.media=null,!t.transferMedia&&(this.id3Track&&(this.removeCues&&k0(this.id3Track,this.onEventCueEnter),this.id3Track=null),this.dateRangeCuesAppended={})}onManifestLoading(){this.dateRangeCuesAppended={}}createTrack(e){const t=this.getID3Track(e.textTracks);return t.mode="hidden",t}getID3Track(e){if(this.media){for(let t=0;t<e.length;t++){const r=e[t];if(r.kind==="metadata"&&r.label==="id3")return Lee(r,this.media),r}return this.media.addTextTrack("metadata","id3")}}onFragParsingMetadata(e,t){if(!this.media||!this.hls)return;const{enableEmsgMetadataCues:r,enableID3MetadataCues:s}=this.hls.config;if(!r&&!s)return;const{samples:a}=t;this.id3Track||(this.id3Track=this.createTrack(this.media));const o=TD();if(o)for(let l=0;l<a.length;l++){const c=a[l].type;if(c===go.emsg&&!r||!s)continue;const d=dee(a[l].data),h=a[l].pts;let m=h+a[l].duration;m>qw&&(m=qw),m-h<=0&&(m=h+LFe);for(let x=0;x<d.length;x++){const y=d[x];if(!uee(y)){this.updateId3CueEnds(h,c);const v=ZN(o,h,m,y,c);v&&this.id3Track.addCue(v)}}}}updateId3CueEnds(e,t){var r;const s=(r=this.id3Track)==null?void 0:r.cues;if(s)for(let a=s.length;a--;){const o=s[a];o.type===t&&o.startTime<e&&o.endTime===qw&&(o.endTime=e)}}onBufferFlushing(e,{startOffset:t,endOffset:r,type:s}){const{id3Track:a,hls:o}=this;if(!o)return;const{config:{enableEmsgMetadataCues:l,enableID3MetadataCues:c}}=o;if(a&&(l||c)){let d;s==="audio"?d=h=>h.type===go.audioId3&&c:s==="video"?d=h=>h.type===go.emsg&&l:d=h=>h.type===go.audioId3&&c||h.type===go.emsg&&l,CD(a,t,r,d)}}onLevelUpdated(e,{details:t}){this.updateDateRangeCues(t,!0)}onLevelPtsUpdated(e,t){Math.abs(t.drift)>.01&&this.updateDateRangeCues(t.details)}updateDateRangeCues(e,t){if(!this.hls||!this.media)return;const{assetPlayerId:r,timelineOffset:s,enableDateRangeMetadataCues:a,interstitialsController:o}=this.hls.config;if(!a)return;const l=TD();if(r&&s&&!o){const{fragmentStart:v,fragmentEnd:B}=e;let E=this.assetCue;E?(E.startTime=v,E.endTime=B):l&&(E=this.assetCue=ZN(l,v,B,{assetPlayerId:this.hls.config.assetPlayerId},"hlsjs.interstitial.asset"),E&&(E.id=r,this.id3Track||(this.id3Track=this.createTrack(this.media)),this.id3Track.addCue(E),E.addEventListener("enter",this.onEventCueEnter)))}if(!e.hasProgramDateTime)return;const{id3Track:c}=this,{dateRanges:d}=e,h=Object.keys(d);let m=this.dateRangeCuesAppended;if(c&&t){var p;if((p=c.cues)!=null&&p.length){const v=Object.keys(m).filter(B=>!h.includes(B));for(let B=v.length;B--;){var x;const E=v[B],N=(x=m[E])==null?void 0:x.cues;delete m[E],N&&Object.keys(N).forEach(T=>{const k=N[T];if(k){k.removeEventListener("enter",this.onEventCueEnter);try{c.removeCue(k)}catch{}}})}}else m=this.dateRangeCuesAppended={}}const y=e.fragments[e.fragments.length-1];if(!(h.length===0||!ct(y==null?void 0:y.programDateTime))){this.id3Track||(this.id3Track=this.createTrack(this.media));for(let v=0;v<h.length;v++){const B=h[v],E=d[B],N=E.startTime,T=m[B],k=(T==null?void 0:T.cues)||{};let P=(T==null?void 0:T.durationKnown)||!1,R=qw;const{duration:_,endDate:I}=E;if(I&&_!==null)R=N+_,P=!0;else if(E.endOnNext&&!P){const j=h.reduce((O,M)=>{if(M!==E.id){const U=d[M];if(U.class===E.class&&U.startDate>E.startDate&&(!O||E.startDate<O.startDate))return U}return O},null);j&&(R=j.startTime,P=!0)}const D=Object.keys(E.attr);for(let j=0;j<D.length;j++){const O=D[j];if(!sMe(O))continue;const M=k[O];if(M)P&&!(T!=null&&T.durationKnown)?M.endTime=R:Math.abs(M.startTime-N)>.01&&(M.startTime=N,M.endTime=R);else if(l){let U=E.attr[O];aMe(O)&&(U=BZ(U));const ie=ZN(l,N,R,{key:O,data:U},go.dateRange);ie&&(ie.id=B,this.id3Track.addCue(ie),k[O]=ie,o&&(O==="X-ASSET-LIST"||O==="X-ASSET-URL")&&ie.addEventListener("enter",this.onEventCueEnter))}}m[B]={cues:k,dateRange:E,durationKnown:P}}}}}class MFe{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:t}=this,r=this.levelDetails;if(!t||!r)return;this.currentTime=t.currentTime;const s=this.computeLatency();if(s===null)return;this._latency=s;const{lowLatencyMode:a,maxLiveSyncPlaybackRate:o}=this.config;if(!a||o===1||!r.live)return;const l=this.targetLatency;if(l===null)return;const c=s-l,d=Math.min(this.maxLatency,l+r.targetduration);if(c<d&&c>.05&&this.forwardBufferLength>1){const m=Math.min(2,Math.max(1,o)),p=Math.round(2/(1+Math.exp(-.75*c-this.edgeStalled))*20)/20,x=Math.min(m,Math.max(1,p));this.changeMediaPlaybackRate(t,x)}else t.playbackRate!==1&&t.playbackRate!==0&&this.changeMediaPlaybackRate(t,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 t=this.levelDetails;return t?e.liveMaxLatencyDurationCount*t.targetduration:0}get targetLatency(){const e=this.levelDetails;if(e===null||this.hls===null)return null;const{holdBack:t,partHoldBack:r,targetduration:s}=e,{liveSyncDuration:a,liveSyncDurationCount:o,lowLatencyMode:l}=this.config,c=this.hls.userConfig;let d=l&&r||t;(this._targetLatencyUpdated||c.liveSyncDuration||c.liveSyncDurationCount||d===0)&&(d=a!==void 0?a:o*s);const h=s;return d+Math.min(this.stallCount*this.config.liveSyncOnStallIncrease,h)}set targetLatency(e){this.stallCount=0,this.config.liveSyncDuration=e,this._targetLatencyUpdated=!0}get liveSyncPosition(){const e=this.estimateLiveEdge(),t=this.targetLatency;if(e===null||t===null)return null;const r=this.levelDetails;if(r===null)return null;const s=r.edge,a=e-t-this.edgeStalled,o=s-r.totalduration,l=s-(this.config.lowLatencyMode&&r.partTarget||r.targetduration);return Math.min(Math.max(o,a),l)}get drift(){const e=this.levelDetails;return e===null?1:e.drift}get edgeStalled(){const e=this.levelDetails;if(e===null)return 0;const t=(this.config.lowLatencyMode&&e.partTarget||e.targetduration)*3;return Math.max(e.age-t,0)}get forwardBufferLength(){const{media:e}=this,t=this.levelDetails;if(!e||!t)return 0;const r=e.buffered.length;return(r?e.buffered.end(r-1):t.edge)-this.currentTime}destroy(){this.unregisterListeners(),this.onMediaDetaching(),this.hls=null}registerListeners(){const{hls:e}=this;e&&(e.on(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.on(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.on(V.ERROR,this.onError,this))}unregisterListeners(){const{hls:e}=this;e&&(e.off(V.MEDIA_ATTACHED,this.onMediaAttached,this),e.off(V.MEDIA_DETACHING,this.onMediaDetaching,this),e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.LEVEL_UPDATED,this.onLevelUpdated,this),e.off(V.ERROR,this.onError,this))}onMediaAttached(e,t){this.media=t.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:t}){t.advanced&&this.onTimeupdate(),!t.live&&this.media&&this.media.removeEventListener("timeupdate",this.onTimeupdate)}onError(e,t){var r;t.details===Ee.BUFFER_STALLED_ERROR&&(this.stallCount++,this.hls&&(r=this.levelDetails)!=null&&r.live&&this.hls.logger.warn("[latency-controller]: Stall detected, adjusting target latency"))}changeMediaPlaybackRate(e,t){var r,s;e.playbackRate!==t&&((r=this.hls)==null||r.logger.debug(`[latency-controller]: latency=${this.latency.toFixed(3)}, targetLatency=${(s=this.targetLatency)==null?void 0:s.toFixed(3)}, forwardBufferLength=${this.forwardBufferLength.toFixed(3)}: adjusting playback rate from ${e.playbackRate} to ${t}`),e.playbackRate=t)}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 FFe extends t5{constructor(e,t){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=t,this._registerListeners()}_registerListeners(){const{hls:e}=this;e.on(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.on(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this),e.on(V.ERROR,this.onError,this)}_unregisterListeners(){const{hls:e}=this;e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.MANIFEST_LOADED,this.onManifestLoaded,this),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this),e.off(V.ERROR,this.onError,this)}destroy(){this._unregisterListeners(),this.steering=null,this.resetLevels(),super.destroy()}stopLoad(){this._levels.forEach(t=>{t.loadError=0,t.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,t){this.resetLevels()}onManifestLoaded(e,t){const r=this.hls.config.preferManagedMediaSource,s=[],a={},o={};let l=!1,c=!1,d=!1;t.levels.forEach(h=>{const m=h.attrs;let{audioCodec:p,videoCodec:x}=h;p&&(h.audioCodec=p=f1(p,r)||void 0),x&&(x=h.videoCodec=BOe(x));const{width:y,height:v,unknownCodecs:B}=h,E=(B==null?void 0:B.length)||0;if(l||(l=!!(y&&v)),c||(c=!!x),d||(d=!!p),E||p&&!this.isAudioSupported(p)||x&&!this.isVideoSupported(x)){this.log(`Some or all CODECS not supported "${m.CODECS}"`);return}const{CODECS:N,"FRAME-RATE":T,"HDCP-LEVEL":k,"PATHWAY-ID":P,RESOLUTION:R,"VIDEO-RANGE":_}=m,D=`${`${P||"."}-`}${h.bitrate}-${R}-${T}-${N}-${_}-${k}`;if(a[D])if(a[D].uri!==h.url&&!h.attrs["PATHWAY-ID"]){const j=o[D]+=1;h.attrs["PATHWAY-ID"]=new Array(j+1).join(".");const O=this.createLevel(h);a[D]=O,s.push(O)}else a[D].addGroupId("audio",m.AUDIO),a[D].addGroupId("text",m.SUBTITLES);else{const j=this.createLevel(h);a[D]=j,o[D]=1,s.push(j)}}),this.filterAndSortMediaOptions(s,t,l,c,d)}createLevel(e){const t=new Vy(e),r=e.supplemental;if(r!=null&&r.videoCodec&&!this.isVideoSupported(r.videoCodec)){const s=new Error(`SUPPLEMENTAL-CODECS not supported "${r.videoCodec}"`);this.log(s.message),t.supportedResult=jZ(s,[])}return t}isAudioSupported(e){return Fy(e,"audio",this.hls.config.preferManagedMediaSource)}isVideoSupported(e){return Fy(e,"video",this.hls.config.preferManagedMediaSource)}filterAndSortMediaOptions(e,t,r,s,a){var o;let l=[],c=[],d=e;const h=((o=t.stats)==null?void 0:o.parsing)||{};if((r||s)&&a&&(d=d.filter(({videoCodec:N,videoRange:T,width:k,height:P})=>(!!N||!!(k&&P))&&IOe(T))),d.length===0){Promise.resolve().then(()=>{if(this.hls){let N="no level with compatible codecs found in manifest",T=N;t.levels.length&&(T=`one or more CODECS in variant not supported: ${xr(t.levels.map(P=>P.attrs.CODECS).filter((P,R,_)=>_.indexOf(P)===R))}`,this.warn(T),N+=` (${T})`);const k=new Error(N);this.hls.trigger(V.ERROR,{type:Bt.MEDIA_ERROR,details:Ee.MANIFEST_INCOMPATIBLE_CODECS_ERROR,fatal:!0,url:t.url,error:k,reason:T})}}),h.end=performance.now();return}t.audioTracks&&(l=t.audioTracks.filter(N=>!N.audioCodec||this.isAudioSupported(N.audioCodec)),zG(l)),t.subtitles&&(c=t.subtitles,zG(c));const m=d.slice(0);d.sort((N,T)=>{if(N.attrs["HDCP-LEVEL"]!==T.attrs["HDCP-LEVEL"])return(N.attrs["HDCP-LEVEL"]||"")>(T.attrs["HDCP-LEVEL"]||"")?1:-1;if(r&&N.height!==T.height)return N.height-T.height;if(N.frameRate!==T.frameRate)return N.frameRate-T.frameRate;if(N.videoRange!==T.videoRange)return m1.indexOf(N.videoRange)-m1.indexOf(T.videoRange);if(N.videoCodec!==T.videoCodec){const k=L9(N.videoCodec),P=L9(T.videoCodec);if(k!==P)return P-k}if(N.uri===T.uri&&N.codecSet!==T.codecSet){const k=h1(N.codecSet),P=h1(T.codecSet);if(k!==P)return P-k}return N.averageBitrate!==T.averageBitrate?N.averageBitrate-T.averageBitrate:0});let p=m[0];if(this.steering&&(d=this.steering.filterParsedLevels(d),d.length!==m.length)){for(let N=0;N<m.length;N++)if(m[N].pathwayId===d[0].pathwayId){p=m[N];break}}this._levels=d;for(let N=0;N<d.length;N++)if(d[N]===p){var x;this._firstLevel=N;const T=p.bitrate,k=this.hls.bandwidthEstimate;if(this.log(`manifest loaded, ${d.length} level(s) found, first bitrate: ${T}`),((x=this.hls.userConfig)==null?void 0:x.abrEwmaDefaultEstimate)===void 0){const P=Math.min(T,this.hls.config.abrEwmaDefaultEstimateMax);P>k&&k===this.hls.abrEwmaDefaultEstimate&&(this.hls.bandwidthEstimate=P)}break}const y=a&&!s,v=this.hls.config,B=!!(v.audioStreamController&&v.audioTrackController),E={levels:d,audioTracks:l,subtitleTracks:c,sessionData:t.sessionData,sessionKeys:t.sessionKeys,firstLevel:this._firstLevel,stats:t.stats,audio:a,video:s,altAudio:B&&!y&&l.some(N=>!!N.url)};h.end=performance.now(),this.hls.trigger(V.MANIFEST_PARSED,E)}get levels(){return this._levels.length===0?null:this._levels}get loadLevelObj(){return this.currentLevel}get level(){return this.currentLevelIndex}set level(e){const t=this._levels;if(t.length===0)return;if(e<0||e>=t.length){const h=new Error("invalid level idx"),m=e<0;if(this.hls.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.LEVEL_SWITCH_ERROR,level:e,fatal:m,error:h,reason:h.message}),m)return;e=Math.min(e,t.length-1)}const r=this.currentLevelIndex,s=this.currentLevel,a=s?s.attrs["PATHWAY-ID"]:void 0,o=t[e],l=o.attrs["PATHWAY-ID"];
vendor: 4,388 bytes, line 4756
4756if(this.currentLevelIndex=e,this.currentLevel=o,r===e&&s&&a===l)return;this.log(`Switching to level ${e} (${o.height?o.height+"p ":""}${o.videoRange?o.videoRange+" ":""}${o.codecSet?o.codecSet+" ":""}@${o.bitrate})${l?" with Pathway "+l:""} from level ${r}${a?" with Pathway "+a:""}`);const c={level:e,attrs:o.attrs,details:o.details,bitrate:o.bitrate,averageBitrate:o.averageBitrate,maxBitrate:o.maxBitrate,realBitrate:o.realBitrate,width:o.width,height:o.height,codecSet:o.codecSet,audioCodec:o.audioCodec,videoCodec:o.videoCodec,audioGroups:o.audioGroups,subtitleGroups:o.subtitleGroups,loaded:o.loaded,loadError:o.loadError,fragmentError:o.fragmentError,name:o.name,id:o.id,uri:o.uri,url:o.url,urlId:0,audioGroupIds:o.audioGroupIds,textGroupIds:o.textGroupIds};this.hls.trigger(V.LEVEL_SWITCHING,c);const d=o.details;if(!d||d.live){const h=this.switchParams(o.uri,s==null?void 0:s.details,d);this.loadPlaylist(h)}}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 t=this.steering.pathways(),r=e.filter(s=>t.indexOf(s)!==-1);if(e.length<1){this.warn(`pathwayPriority ${e} should contain at least one pathway from list: ${t}`);return}this.steering.pathwayPriority=r}}onError(e,t){t.fatal||!t.context||t.context.type===Xt.LEVEL&&t.context.level===this.level&&this.checkRetry(t)}onFragBuffered(e,{frag:t}){if(t!==void 0&&t.type===mt.MAIN){const r=t.elementaryStreams;if(!Object.keys(r).some(a=>!!r[a]))return;const s=this._levels[t.level];s!=null&&s.loadError&&(this.log(`Resetting level error count of ${s.loadError} on frag buffered`),s.loadError=0)}}onLevelLoaded(e,t){var r;const{level:s,details:a}=t,o=t.levelInfo;if(!o){var l;this.warn(`Invalid level index ${s}`),(l=t.deliveryDirectives)!=null&&l.skip&&(a.deltaUpdateFailed=!0);return}if(o===this.currentLevel||t.withoutMultiVariant){o.fragmentError===0&&(o.loadError=0);let c=o.details;c===t.details&&c.advanced&&(c=void 0),this.playlistLoaded(s,t,c)}else(r=t.deliveryDirectives)!=null&&r.skip&&(a.deltaUpdateFailed=!0)}loadPlaylist(e){super.loadPlaylist(),this.shouldLoadPlaylist(this.currentLevel)&&this.scheduleLoading(this.currentLevel,e)}loadingPlaylist(e,t){super.loadingPlaylist(e,t);const r=this.getUrlWithDirectives(e.uri,t),s=this.currentLevelIndex,a=e.attrs["PATHWAY-ID"],o=e.details,l=o==null?void 0:o.age;this.log(`Loading level index ${s}${(t==null?void 0:t.msn)!==void 0?" at sn "+t.msn+" part "+t.part:""}${a?" Pathway "+a:""}${l&&o.live?" age "+l.toFixed(1)+(o.type&&" "+o.type||""):""} ${r}`),this.hls.trigger(V.LEVEL_LOADING,{url:r,level:s,levelInfo:e,pathwayId:e.attrs["PATHWAY-ID"],id:0,deliveryDirectives:t||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 t;if(this._levels.length===1)return;const r=this._levels.filter((a,o)=>o!==e?!0:(this.steering&&this.steering.removeLevel(a),a===this.currentLevel&&(this.currentLevel=null,this.currentLevelIndex=-1,a.details&&a.details.fragments.forEach(l=>l.level=-1)),!1));eee(r),this._levels=r,this.currentLevelIndex>-1&&(t=this.currentLevel)!=null&&t.details&&(this.currentLevelIndex=this.currentLevel.details.fragments[0].level),this.manualLevelIndex>-1&&(this.manualLevelIndex=this.currentLevelIndex);const s=r.length-1;this._firstLevel=Math.min(this._firstLevel,s),this._startLevel&&(this._startLevel=Math.min(this._startLevel,s)),this.hls.trigger(V.LEVELS_UPDATED,{levels:r})}onLevelsUpdated(e,{levels:t}){this._levels=t}checkMaxAutoUpdated(){const{autoLevelCapping:e,maxAutoLevel:t,maxHdcpLevel:r}=this.hls;this._maxAutoLevel!==t&&(this._maxAutoLevel=t,this.hls.trigger(V.MAX_AUTO_LEVEL_UPDATED,{autoLevelCapping:e,levels:this.levels,maxAutoLevel:t,minAutoLevel:this.hls.minAutoLevel,maxHdcpLevel:r}))}}function zG(n){const e={};
vendor: 39,509 bytes, line 4756
4756n.forEach(t=>{const r=t.groupId||"";t.id=e[r]=e[r]||0,e[r]++})}function Yee(){return self.SourceBuffer||self.WebKitSourceBuffer}function Qee(){if(!Gh())return!1;const e=Yee();return!e||e.prototype&&typeof e.prototype.appendBuffer=="function"&&typeof e.prototype.remove=="function"}function UFe(){if(!Qee())return!1;const n=Gh();return typeof(n==null?void 0:n.isTypeSupported)=="function"&&(["avc1.42E01E,mp4a.40.2","av01.0.01M.08","vp09.00.50.08"].some(e=>n.isTypeSupported(Uy(e,"video")))||["mp4a.40.2","fLaC"].some(e=>n.isTypeSupported(Uy(e,"audio"))))}function VFe(){var n;const e=Yee();return typeof(e==null||(n=e.prototype)==null?void 0:n.changeType)=="function"}const GFe=100;class $Fe extends KP{constructor(e,t,r){super(e,t,r,"stream-controller",mt.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 s=this.media,a=s?s.currentTime:null;if(a===null||!ct(a)||(this.log(`Media seeked to ${a.toFixed(3)}`),!this.getBufferedFrag(a)))return;const o=this.getFwdBufferInfoAtPos(s,a,mt.MAIN,0);if(o===null||o.len===0){this.warn(`Main forward buffer length at ${a} on "seeked" event ${o?o.len:"empty"})`);return}this.tick()},this.registerListeners()}registerListeners(){super.registerListeners();const{hls:e}=this;e.on(V.MANIFEST_PARSED,this.onManifestParsed,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.LEVEL_LOADED,this.onLevelLoaded,this),e.on(V.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.on(V.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.on(V.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.on(V.BUFFER_CREATED,this.onBufferCreated,this),e.on(V.BUFFER_FLUSHED,this.onBufferFlushed,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.on(V.FRAG_BUFFERED,this.onFragBuffered,this)}unregisterListeners(){super.unregisterListeners();const{hls:e}=this;e.off(V.MANIFEST_PARSED,this.onManifestParsed,this),e.off(V.LEVEL_LOADED,this.onLevelLoaded,this),e.off(V.FRAG_LOAD_EMERGENCY_ABORTED,this.onFragLoadEmergencyAborted,this),e.off(V.AUDIO_TRACK_SWITCHING,this.onAudioTrackSwitching,this),e.off(V.AUDIO_TRACK_SWITCHED,this.onAudioTrackSwitched,this),e.off(V.BUFFER_CREATED,this.onBufferCreated,this),e.off(V.BUFFER_FLUSHED,this.onBufferFlushed,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this),e.off(V.FRAG_BUFFERED,this.onFragBuffered,this)}onHandlerDestroying(){this.onMediaPlaying=this.onMediaSeeked=null,this.unregisterListeners(),super.onHandlerDestroying()}startLoad(e,t){if(this.levels){const{lastCurrentTime:r,hls:s}=this;if(this.stopLoad(),this.setInterval(GFe),this.level=-1,!this.startFragRequested){let a=s.startLevel;a===-1&&(s.config.testBandwidth&&this.levels.length>1?(a=0,this.bitrateTest=!0):a=s.firstAutoLevel),s.nextLoadLevel=a,this.level=s.loadLevel,this._hasEnoughToStart=!!t}r>0&&e===-1&&!t&&(this.log(`Override startPosition with lastCurrentTime @${r.toFixed(3)}`),e=r),this.state=Ve.IDLE,this.nextLoadPosition=this.lastCurrentTime=e+this.timelineOffset,this.startPosition=t?-1:e,this.tick()}else this._forceStartLoad=!0,this.state=Ve.STOPPED}stopLoad(){this._forceStartLoad=!1,super.stopLoad()}doTick(){switch(this.state){case Ve.WAITING_LEVEL:{const{levels:e,level:t}=this,r=e==null?void 0:e[t],s=r==null?void 0:r.details;if(s&&(!s.live||this.levelLastLoaded===r&&!this.waitForLive(r))){if(this.waitForCdnTuneIn(s))break;this.state=Ve.IDLE;break}else if(this.hls.nextLoadLevel!==this.level){this.state=Ve.IDLE;break}break}case Ve.FRAG_LOADING_WAITING_RETRY:this.checkRetryDate();break}this.state===Ve.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:t,levels:r,media:s}=this;if(t===null||!s&&!this.primaryPrefetch&&(this.startFragRequested||!e.config.startFragPrefetch)||this.altAudio&&this.audioOnly)return;const a=this.buffering?e.nextLoadLevel:e.loadLevel;if(!(r!=null&&r[a]))return;const o=r[a],l=this.getMainFwdBufferInfo();if(l===null)return;const c=this.getLevelDetails();if(c&&this._streamEnded(l,c)){const v={};this.altAudio===2&&(v.type="video"),this.hls.trigger(V.BUFFER_EOS,v),this.state=Ve.ENDED;return}if(!this.buffering)return;e.loadLevel!==a&&e.manualLevel===-1&&this.log(`Adapting to level ${a} from level ${this.level}`),this.level=e.nextLoadLevel=a;const d=o.details;if(!d||this.state===Ve.WAITING_LEVEL||this.waitForLive(o)){this.level=a,this.state=Ve.WAITING_LEVEL,this.startFragRequested=!1;return}const h=l.len,m=this.getMaxBufferLength(o.maxBitrate);if(h>=m)return;this.backtrackFragment&&this.backtrackFragment.start>l.end&&(this.backtrackFragment=null);const p=this.backtrackFragment?this.backtrackFragment.start:l.end;let x=this.getNextFragment(p,d);if(this.couldBacktrack&&!this.fragPrevious&&x&&ws(x)&&this.fragmentTracker.getState(x)!==Ks.OK){var y;const B=((y=this.backtrackFragment)!=null?y:x).sn-d.startSN,E=d.fragments[B-1];E&&x.cc===E.cc&&(x=E,this.fragmentTracker.removeFragment(E))}else this.backtrackFragment&&l.len&&(this.backtrackFragment=null);if(x&&this.isLoopLoading(x,p)){if(!x.gap){const B=this.audioOnly&&!this.altAudio?hr.AUDIO:hr.VIDEO,E=(B===hr.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;E&&this.afterBufferFlushed(E,B,mt.MAIN)}x=this.getNextFragmentLoopLoading(x,d,l,mt.MAIN,m)}x&&(this.exceedsMaxBuffer(l,m,x)||(x.initSegment&&!x.initSegment.data&&!this.bitrateTest&&(x=x.initSegment),this.loadFragment(x,o,p)))}loadFragment(e,t,r){const s=this.fragmentTracker.getState(e);s===Ks.NOT_LOADED||s===Ks.PARTIAL?ws(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,t)):super.loadFragment(e,t,r):this._loadInitSegment(e,t):this.clearTrackerIfNeeded(e)}getBufferedFrag(e){return this.fragmentTracker.getBufferedFrag(e,mt.MAIN)}followingBufferedFrag(e){return e?this.getBufferedFrag(e.end+.5):null}immediateLevelSwitch(){if(this.abortCurrentFrag(),this.flushMainBuffer(0,Number.POSITIVE_INFINITY),this.altAudio!==0){var e;(((e=this.getLevelDetails())==null?void 0:e.fragmentStart)||0)>this.lastCurrentTime&&super.flushMainBuffer(0,Number.POSITIVE_INFINITY,"audio")}}nextLevelSwitch(){const{levels:e,media:t}=this;if(t!=null&&t.readyState){let r;const s=this.getAppendedFrag(t.currentTime);s&&s.start>1&&this.flushMainBuffer(0,s.start-1);const a=this.getLevelDetails();if(a!=null&&a.live){const l=this.getMainFwdBufferInfo();if(!l||l.len<a.targetduration*2)return}if(!t.paused&&e){const l=this.hls.nextLoadLevel,c=e[l],d=this.fragLastKbps;d&&this.fragCurrent?r=this.fragCurrent.duration*c.maxBitrate/(1e3*d)+1:r=0}else r=0;const o=this.getBufferedFrag(t.currentTime+r);if(o){const l=this.followingBufferedFrag(o);if(l){this.abortCurrentFrag();const c=l.maxStartPTS?l.maxStartPTS:l.start,d=l.duration,h=Math.max(o.end,c+Math.min(Math.max(d-this.config.maxFragLookUpTolerance,d*(this.couldBacktrack?.5:.125)),d*(this.couldBacktrack?.75:.25)));this.flushMainBuffer(h,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 Ve.KEY_LOADING:case Ve.FRAG_LOADING:case Ve.FRAG_LOADING_WAITING_RETRY:case Ve.PARSING:case Ve.PARSED:this.state=Ve.IDLE;break}this.nextLoadPosition=this.getLoadPosition()}flushMainBuffer(e,t){super.flushMainBuffer(e,t,this.altAudio===2?"video":null)}onMediaAttached(e,t){super.onMediaAttached(e,t);const r=t.media;pi(r,"playing",this.onMediaPlaying),pi(r,"seeked",this.onMediaSeeked)}onMediaDetaching(e,t){const{media:r}=this;r&&(zi(r,"playing",this.onMediaPlaying),zi(r,"seeked",this.onMediaSeeked)),this.videoBuffer=null,this.fragPlaying=null,super.onMediaDetaching(e,t),!t.transferMedia&&(this._hasEnoughToStart=!1)}onManifestLoading(){super.onManifestLoading(),this.log("Trigger BUFFER_RESET"),this.hls.trigger(V.BUFFER_RESET,void 0),this.couldBacktrack=!1,this.fragLastKbps=0,this.fragPlaying=this.backtrackFragment=null,this.altAudio=0,this.audioOnly=!1}onManifestParsed(e,t){let r=!1,s=!1;for(let a=0;a<t.levels.length;a++){const o=t.levels[a].audioCodec;o&&(r=r||o.indexOf("mp4a.40.2")!==-1,s=s||o.indexOf("mp4a.40.5")!==-1)}this.audioCodecSwitch=r&&s&&!VFe(),this.audioCodecSwitch&&this.log("Both AAC/HE-AAC audio found in levels; declaring level codec as HE-AAC"),this.levels=t.levels,this.startFragRequested=!1}onLevelLoading(e,t){const{levels:r}=this;if(!r||this.state!==Ve.IDLE)return;const s=t.levelInfo;(!s.details||s.details.live&&(this.levelLastLoaded!==s||s.details.expired)||this.waitForCdnTuneIn(s.details))&&(this.state=Ve.WAITING_LEVEL)}onLevelLoaded(e,t){var r;const{levels:s,startFragRequested:a}=this,o=t.level,l=t.details,c=l.totalduration;if(!s){this.warn(`Levels were reset while loading level ${o}`);return}this.log(`Level ${o} loaded [${l.startSN},${l.endSN}]${l.lastPartSn?`[part-${l.lastPartSn}-${l.lastPartIndex}]`:""}, cc [${l.startCC}, ${l.endCC}] duration:${c}`);const d=t.levelInfo,h=this.fragCurrent;h&&(this.state===Ve.FRAG_LOADING||this.state===Ve.FRAG_LOADING_WAITING_RETRY)&&h.level!==t.level&&h.loader&&this.abortCurrentFrag();let m=0;if(l.live||(r=d.details)!=null&&r.live){var p;if(this.checkLiveUpdate(l),l.deltaUpdateFailed)return;m=this.alignPlaylists(l,d.details,(p=this.levelLastLoaded)==null?void 0:p.details)}if(d.details=l,this.levelLastLoaded=d,a||this.setStartPosition(l,m),this.hls.trigger(V.LEVEL_UPDATED,{details:l,level:o}),this.state===Ve.WAITING_LEVEL){if(this.waitForCdnTuneIn(l))return;this.state=Ve.IDLE}a&&l.live&&this.synchronizeToLiveEdge(l),this.tick()}synchronizeToLiveEdge(e){const{config:t,media:r}=this;if(!r)return;const s=this.hls.liveSyncPosition,a=this.getLoadPosition(),o=e.fragmentStart,l=e.edge,c=a>=o-t.maxFragLookUpTolerance&&a<=l;if(s!==null&&r.duration>s&&(a<s||!c)){const h=t.liveMaxLatencyDuration!==void 0?t.liveMaxLatencyDuration:t.liveMaxLatencyDurationCount*e.targetduration;if((!c&&r.readyState<4||a<l-h)&&(this._hasEnoughToStart||(this.nextLoadPosition=s),r.readyState))if(this.warn(`Playback: ${a.toFixed(3)} is located too far from the end of live sliding playlist: ${l}, reset currentTime to : ${s.toFixed(3)}`),this.config.liveSyncMode==="buffered"){var d;const m=Vt.bufferInfo(r,s,0);if(!((d=m.buffered)!=null&&d.length)){r.currentTime=s;return}if(m.start<=a){r.currentTime=s;return}const{nextStart:x}=Vt.bufferedInfo(m.buffered,a,0);x&&(r.currentTime=x)}else r.currentTime=s}}_handleFragmentLoadProgress(e){var t;const r=e.frag,{part:s,payload:a}=e,{levels:o}=this;if(!o){this.warn(`Levels were reset while fragment load was in progress. Fragment ${r.sn} of level ${r.level} will not be buffered`);return}const l=o[r.level];if(!l){this.warn(`Level ${r.level} not found on progress`);return}const c=l.details;if(!c){this.warn(`Dropping fragment ${r.sn} of level ${r.level} after level details were reset`),this.fragmentTracker.removeFragment(r);return}const d=l.videoCodec,h=c.PTSKnown||!c.live,m=(t=r.initSegment)==null?void 0:t.data,p=this._getAudioCodec(l),x=this.transmuxer=this.transmuxer||new wee(this.hls,mt.MAIN,this._handleTransmuxComplete.bind(this),this._handleTransmuxerFlush.bind(this)),y=s?s.index:-1,v=y!==-1,B=new HP(r.level,r.sn,r.stats.chunkCount,a.byteLength,y,v),E=this.initPTS[r.cc];x.push(a,m,p,d,r,s,c.totalduration,h,B,E)}onAudioTrackSwitching(e,t){const r=this.hls,s=this.altAudio!==0;if(p1(t.url,r))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 o=this.fragCurrent;o&&(this.log("Switching to main audio track, cancel main fragment load"),o.abortRequests(),this.fragmentTracker.removeFragment(o)),this.resetTransmuxer(),this.resetLoadingState()}else this.audioOnly&&this.resetTransmuxer();if(s){this.altAudio=0,this.fragmentTracker.removeAllFragments(),r.once(V.BUFFER_FLUSHED,()=>{this.hls&&this.hls.trigger(V.AUDIO_TRACK_SWITCHED,t)}),r.trigger(V.BUFFER_FLUSHING,{startOffset:0,endOffset:Number.POSITIVE_INFINITY,type:null});return}r.trigger(V.AUDIO_TRACK_SWITCHED,t)}}onAudioTrackSwitched(e,t){const r=p1(t.url,this.hls);if(r){const s=this.videoBuffer;s&&this.mediaBuffer!==s&&(this.log("Switching on alternate audio, use video.buffered to schedule main fragment loading"),this.mediaBuffer=s)}this.altAudio=r?2:0,this.tick()}onBufferCreated(e,t){const r=t.tracks;let s,a,o=!1;for(const l in r){const c=r[l];if(c.id==="main"){if(a=l,s=c,l==="video"){const d=r[l];d&&(this.videoBuffer=d.buffer)}}else o=!0}o&&s?(this.log(`Alternate track found, use ${a}.buffered to schedule main fragment loading`),this.mediaBuffer=s.buffer):this.mediaBuffer=this.media}onFragBuffered(e,t){const{frag:r,part:s}=t,a=r.type===mt.MAIN;if(a){if(this.fragContextChanged(r)){this.warn(`Fragment ${r.sn}${s?" p: "+s.index:""} of level ${r.level} finished buffering, but was aborted. state: ${this.state}`),this.state===Ve.PARSED&&(this.state=Ve.IDLE);return}const l=s?s.stats:r.stats;this.fragLastKbps=Math.round(8*l.total/(l.buffering.end-l.loading.first)),ws(r)&&(this.fragPrevious=r),this.fragBufferedComplete(r,s)}const o=this.media;o&&(!this._hasEnoughToStart&&Vt.getBuffered(o).length&&(this._hasEnoughToStart=!0,this.seekToStartPos()),a&&this.tick())}get hasEnoughToStart(){return this._hasEnoughToStart}onError(e,t){var r;if(t.fatal){this.state=Ve.ERROR;return}switch(t.details){case Ee.FRAG_GAP:case Ee.FRAG_PARSING_ERROR:case Ee.FRAG_DECRYPT_ERROR:case Ee.FRAG_LOAD_ERROR:case Ee.FRAG_LOAD_TIMEOUT:case Ee.KEY_LOAD_ERROR:case Ee.KEY_LOAD_TIMEOUT:this.onFragmentOrKeyLoadError(mt.MAIN,t);break;case Ee.LEVEL_LOAD_ERROR:case Ee.LEVEL_LOAD_TIMEOUT:case Ee.LEVEL_PARSING_ERROR:!t.levelRetry&&this.state===Ve.WAITING_LEVEL&&((r=t.context)==null?void 0:r.type)===Xt.LEVEL&&(this.state=Ve.IDLE);break;case Ee.BUFFER_ADD_CODEC_ERROR:case Ee.BUFFER_APPEND_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&this.resetLoadingState();break;case Ee.BUFFER_FULL_ERROR:if(t.parent!=="main")return;this.reduceLengthAndFlushBuffer(t)&&(!this.config.interstitialsController&&this.config.assetPlayerId?this._hasEnoughToStart=!0:this.flushMainBuffer(0,Number.POSITIVE_INFINITY));break;case Ee.INTERNAL_EXCEPTION:this.recoverWorkerError(t);break}}onFragLoadEmergencyAborted(){this.state=Ve.IDLE,this._hasEnoughToStart||(this.startFragRequested=!1,this.nextLoadPosition=this.lastCurrentTime),this.tickImmediate()}onBufferFlushed(e,{type:t}){if(t!==hr.AUDIO||!this.altAudio){const r=(t===hr.VIDEO?this.videoBuffer:this.mediaBuffer)||this.media;r&&(this.afterBufferFlushed(r,t,mt.MAIN),this.tick())}}onLevelsUpdated(e,t){this.level>-1&&this.fragCurrent&&(this.level=this.fragCurrent.level,this.level===-1&&this.resetWhenMissingContext(this.fragCurrent)),this.levels=t.levels}swapAudioCodec(){this.audioCodecSwap=!this.audioCodecSwap}seekToStartPos(){const{media:e}=this;if(!e)return;const t=e.currentTime;let r=this.startPosition;if(r>=0&&t<r){if(e.seeking){this.log(`could not seek to ${r}, already seeking at ${t}`);return}const s=this.timelineOffset;s&&r&&(r+=s);const a=this.getLevelDetails(),o=Vt.getBuffered(e),l=o.length?o.start(0):0,c=l-r,d=Math.max(this.config.maxBufferHole,this.config.maxFragLookUpTolerance);(this.config.startOnSegmentBoundary||c>0&&(c<d||this.loadingParts&&c<2*((a==null?void 0:a.partTarget)||0)))&&(this.log(`adjusting start position by ${c} to match buffer start`),r+=c,this.startPosition=r),t<r&&(this.log(`seek to target start position ${r} from current time ${t} buffer start ${l}`),e.currentTime=r)}}_getAudioCodec(e){let t=this.config.defaultAudioCodec||e.audioCodec;return this.audioCodecSwap&&t&&(this.log("Swapping audio codec"),t.indexOf("mp4a.40.5")!==-1?t="mp4a.40.2":t="mp4a.40.5"),t}_loadBitrateTestFrag(e,t){e.bitrateTest=!0,this._doFragLoad(e,t).then(r=>{const{hls:s}=this,a=r==null?void 0:r.frag;if(!a||this.fragContextChanged(a))return;t.fragmentError=0,this.state=Ve.IDLE,this.startFragRequested=!1,this.bitrateTest=!1;const o=a.stats;o.parsing.start=o.parsing.end=o.buffering.start=o.buffering.end=self.performance.now(),s.trigger(V.FRAG_LOADED,r),a.bitrateTest=!1}).catch(r=>{this.state===Ve.STOPPED||this.state===Ve.ERROR||(this.warn(r),this.resetFragmentLoading(e))})}_handleTransmuxComplete(e){const t=this.playlistType,{hls:r}=this,{remuxResult:s,chunkMeta:a}=e,o=this.getCurrentContext(a);if(!o){this.resetWhenMissingContext(a);return}const{frag:l,part:c,level:d}=o,{video:h,text:m,id3:p,initSegment:x}=s,{details:y}=d,v=this.altAudio?void 0:s.audio;if(this.fragContextChanged(l)){this.fragmentTracker.removeFragment(l);return}if(this.state=Ve.PARSING,x){const B=x.tracks;if(B){const k=l.initSegment||l;if(this.unhandledEncryptionError(x,l))return;this._bufferInitSegment(d,B,k,a),r.trigger(V.FRAG_PARSING_INIT_SEGMENT,{frag:k,id:t,tracks:B})}const E=x.initPTS,N=x.timescale,T=this.initPTS[l.cc];if(ct(E)&&(!T||T.baseTime!==E||T.timescale!==N)){const k=x.trackId;this.initPTS[l.cc]={baseTime:E,timescale:N,trackId:k},r.trigger(V.INIT_PTS_FOUND,{frag:l,id:t,initPTS:E,timescale:N,trackId:k})}}if(h&&y){v&&h.type==="audiovideo"&&this.logMuxedErr(l);const B=y.fragments[l.sn-1-y.startSN],E=l.sn===y.startSN,N=!B||l.cc>B.cc;if(s.independent!==!1){const{startPTS:T,endPTS:k,startDTS:P,endDTS:R}=h;if(c)c.elementaryStreams[h.type]={startPTS:T,endPTS:k,startDTS:P,endDTS:R};else if(h.firstKeyFrame&&h.independent&&a.id===1&&!N&&(this.couldBacktrack=!0),h.dropped&&h.independent){const _=this.getMainFwdBufferInfo(),I=(_?_.end:this.getLoadPosition())+this.config.maxBufferHole,D=h.firstKeyFramePTS?h.firstKeyFramePTS:T;if(!E&&I<D-this.config.maxBufferHole&&!N){this.backtrack(l);return}else N&&(l.gap=!0);l.setElementaryStreamInfo(h.type,l.start,k,l.start,R,!0)}else E&&T-(y.appliedTimelineOffset||0)>RC&&(l.gap=!0);l.setElementaryStreamInfo(h.type,T,k,P,R),this.backtrackFragment&&(this.backtrackFragment=l),this.bufferFragmentData(h,l,c,a,E||N)}else if(E||N)l.gap=!0;else{this.backtrack(l);return}}if(v){const{startPTS:B,endPTS:E,startDTS:N,endDTS:T}=v;c&&(c.elementaryStreams[hr.AUDIO]={startPTS:B,endPTS:E,startDTS:N,endDTS:T}),l.setElementaryStreamInfo(hr.AUDIO,B,E,N,T),this.bufferFragmentData(v,l,c,a)}if(y&&p!=null&&p.samples.length){const B={id:t,frag:l,details:y,samples:p.samples};r.trigger(V.FRAG_PARSING_METADATA,B)}if(y&&m){const B={id:t,frag:l,details:y,samples:m.samples};r.trigger(V.FRAG_PARSING_USERDATA,B)}}logMuxedErr(e){this.warn(`${ws(e)?"Media":"Init"} segment with muxed audiovideo where only video expected: ${e.url}`)}_bufferInitSegment(e,t,r,s){if(this.state!==Ve.PARSING)return;this.audioOnly=!!t.audio&&!t.video,this.altAudio&&!this.audioOnly&&(delete t.audio,t.audiovideo&&this.logMuxedErr(r));const{audio:a,video:o,audiovideo:l}=t;if(a){const d=e.audioCodec;let h=AC(a.codec,d);h==="mp4a"&&(h="mp4a.40.5");const m=navigator.userAgent.toLowerCase();if(this.audioCodecSwitch){h&&(h.indexOf("mp4a.40.5")!==-1?h="mp4a.40.2":h="mp4a.40.5");const p=a.metadata;p&&"channelCount"in p&&(p.channelCount||1)!==1&&m.indexOf("firefox")===-1&&(h="mp4a.40.5")}h&&h.indexOf("mp4a.40.5")!==-1&&m.indexOf("android")!==-1&&a.container!=="audio/mpeg"&&(h="mp4a.40.2",this.log(`Android: force audio codec to ${h}`)),d&&d!==h&&this.log(`Swapping manifest audio codec "${d}" for "${h}"`),a.levelCodec=h,a.id=mt.MAIN,this.log(`Init audio buffer, container:${a.container}, codecs[selected/level/parsed]=[${h||""}/${d||""}/${a.codec}]`),delete t.audiovideo}if(o){o.levelCodec=e.videoCodec,o.id=mt.MAIN;const d=o.codec;if((d==null?void 0:d.length)===4)switch(d){case"hvc1":case"hev1":o.codec="hvc1.1.6.L120.90";break;case"av01":o.codec="av01.0.04M.08";break;case"avc1":o.codec="avc1.42e01e";break}this.log(`Init video buffer, container:${o.container}, codecs[level/parsed]=[${e.videoCodec||""}/${d}]${o.codec!==d?" parsed-corrected="+o.codec:""}${o.supplemental?" supplemental="+o.supplemental:""}`),delete t.audiovideo}l&&(this.log(`Init audiovideo buffer, container:${l.container}, codecs[level/parsed]=[${e.codecs}/${l.codec}]`),delete t.video,delete t.audio);const c=Object.keys(t);if(c.length){if(this.hls.trigger(V.BUFFER_CODECS,t),!this.hls)return;c.forEach(d=>{const m=t[d].initSegment;m!=null&&m.byteLength&&this.hls.trigger(V.BUFFER_APPENDING,{type:d,data:m,frag:r,part:null,chunkMeta:s,parent:r.type})})}this.tickImmediate()}getMainFwdBufferInfo(){const e=this.mediaBuffer&&this.altAudio===2?this.mediaBuffer:this.media;return this.getFwdBufferInfo(e,mt.MAIN)}get maxBufferLength(){const{levels:e,level:t}=this,r=e==null?void 0:e[t];return r?this.getMaxBufferLength(r.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=Ve.IDLE}checkFragmentChanged(){const e=this.media;let t=null;if(e&&e.readyState>1&&e.seeking===!1){const r=e.currentTime;if(Vt.isBuffered(e,r)?t=this.getAppendedFrag(r):Vt.isBuffered(e,r+.1)&&(t=this.getAppendedFrag(r+.1)),t){this.backtrackFragment=null;const s=this.fragPlaying,a=t.level;(!s||t.sn!==s.sn||s.level!==a)&&(this.fragPlaying=t,this.hls.trigger(V.FRAG_CHANGED,{frag:t}),(!s||s.level!==a)&&this.hls.trigger(V.LEVEL_SWITCHED,{level:a}))}}}get nextLevel(){const e=this.nextBufferedFrag;return e?e.level:-1}get currentFrag(){var e;if(this.fragPlaying)return this.fragPlaying;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;return ct(t)?this.getAppendedFrag(t):null}get currentProgramDateTime(){var e;const t=((e=this.media)==null?void 0:e.currentTime)||this.lastCurrentTime;if(ct(t)){const r=this.getLevelDetails(),s=this.currentFrag||(r?$m(null,r.fragments,t):null);if(s){const a=s.programDateTime;if(a!==null){const o=a+(t-s.start)*1e3;return new Date(o)}}}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 HFe extends ul{constructor(e,t){super("key-loader",t),this.config=void 0,this.keyIdToKeyInfo={},this.emeController=null,this.config=e}abort(e){for(const r in this.keyIdToKeyInfo){const s=this.keyIdToKeyInfo[r].loader;if(s){var t;if(e&&e!==((t=s.context)==null?void 0:t.frag.type))return;s.abort()}}}detach(){for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e];(t.mediaKeySessionContext||t.decryptdata.isCommonEncryption)&&delete this.keyIdToKeyInfo[e]}}destroy(){this.detach();for(const e in this.keyIdToKeyInfo){const t=this.keyIdToKeyInfo[e].loader;t&&t.destroy()}this.keyIdToKeyInfo={}}createKeyLoadError(e,t=Ee.KEY_LOAD_ERROR,r,s,a){return new vd({type:Bt.NETWORK_ERROR,details:t,fatal:!1,frag:e,response:a,error:r,networkDetails:s})}loadClear(e,t,r){if(this.emeController&&this.config.emeEnabled&&!this.emeController.getSelectedKeySystemFormats().length){if(t.length)for(let s=0,a=t.length;s<a;s++){const o=t[s];if(e.cc<=o.cc&&(!ws(e)||!ws(o)||e.sn<o.sn)||!r&&s==a-1)return this.emeController.selectKeySystemFormat(o).then(l=>{if(!this.emeController)return;o.setKeyFormat(l);const c=NC(l);if(c)return this.emeController.getKeySystemAccess([c])})}if(this.config.requireKeySystemAccessOnStart){const s=kb(this.config);if(s.length)return this.emeController.getKeySystemAccess(s)}}return null}load(e){return!e.decryptdata&&e.encrypted&&this.emeController&&this.config.emeEnabled?this.emeController.selectKeySystemFormat(e).then(t=>this.loadInternal(e,t)):this.loadInternal(e)}loadInternal(e,t){var r,s;t&&e.setKeyFormat(t);const a=e.decryptdata;if(!a){const d=new Error(t?`Expected frag.decryptdata to be defined after setting format ${t}`:`Missing decryption data on fragment in onKeyLoading (emeEnabled with controller: ${this.emeController&&this.config.emeEnabled})`);return Promise.reject(this.createKeyLoadError(e,Ee.KEY_LOAD_ERROR,d))}const o=a.uri;if(!o)return Promise.reject(this.createKeyLoadError(e,Ee.KEY_LOAD_ERROR,new Error(`Invalid key URI: "${o}"`)));const l=e_(a);let c=this.keyIdToKeyInfo[l];if((r=c)!=null&&r.decryptdata.key)return a.key=c.decryptdata.key,Promise.resolve({frag:e,keyInfo:c});if(this.emeController&&(s=c)!=null&&s.keyLoadPromise)switch(this.emeController.getKeyStatus(c.decryptdata)){case"usable":case"usable-in-future":return c.keyLoadPromise.then(h=>{const{keyInfo:m}=h;return a.key=m.decryptdata.key,{frag:e,keyInfo:m}})}switch(this.log(`${this.keyIdToKeyInfo[l]?"Rel":"L"}oading${a.keyId?" keyId: "+Ra(a.keyId):""} URI: ${a.uri} from ${e.type} ${e.level}`),c=this.keyIdToKeyInfo[l]={decryptdata:a,keyLoadPromise:null,loader:null,mediaKeySessionContext:null},a.method){case"SAMPLE-AES":case"SAMPLE-AES-CENC":case"SAMPLE-AES-CTR":return a.keyFormat==="identity"?this.loadKeyHTTP(c,e):this.loadKeyEME(c,e);case"AES-128":case"AES-256":case"AES-256-CTR":return this.loadKeyHTTP(c,e);default:return Promise.reject(this.createKeyLoadError(e,Ee.KEY_LOAD_ERROR,new Error(`Key supplied with unsupported METHOD: "${a.method}"`)))}}loadKeyEME(e,t){const r={frag:t,keyInfo:e};if(this.emeController&&this.config.emeEnabled){var s;if(!e.decryptdata.keyId&&(s=t.initSegment)!=null&&s.data){const o=cOe(t.initSegment.data);if(o.length){let l=o[0];l.some(c=>c!==0)?(this.log(`Using keyId found in init segment ${Ra(l)}`),Sh.setKeyIdForUri(e.decryptdata.uri,l)):(l=Sh.addKeyIdForUri(e.decryptdata.uri),this.log(`Generating keyId to patch media ${Ra(l)}`)),e.decryptdata.keyId=l}}if(!e.decryptdata.keyId&&!ws(t))return Promise.resolve(r);const a=this.emeController.loadKey(r);return(e.keyLoadPromise=a.then(o=>(e.mediaKeySessionContext=o,r))).catch(o=>{throw e.keyLoadPromise=null,"data"in o&&(o.data.frag=t),o})}return Promise.resolve(r)}loadKeyHTTP(e,t){const r=this.config,s=r.loader,a=new s(r);return t.keyLoader=e.loader=a,e.keyLoadPromise=new Promise((o,l)=>{const c={keyInfo:e,frag:t,responseType:"arraybuffer",url:e.decryptdata.uri},d=r.keyLoadPolicy.default,h={loadPolicy:d,timeout:d.maxLoadTimeMs,maxRetry:0,retryDelay:0,maxRetryDelay:0},m={onSuccess:(p,x,y,v)=>{const{frag:B,keyInfo:E}=y,N=e_(E.decryptdata);if(!B.decryptdata||E!==this.keyIdToKeyInfo[N])return l(this.createKeyLoadError(B,Ee.KEY_LOAD_ERROR,new Error("after key load, decryptdata unset or changed"),v));E.decryptdata.key=B.decryptdata.key=new Uint8Array(p.data),B.keyLoader=null,E.loader=null,o({frag:B,keyInfo:E})},onError:(p,x,y,v)=>{this.resetLoader(x),l(this.createKeyLoadError(t,Ee.KEY_LOAD_ERROR,new Error(`HTTP Error ${p.code} loading key ${p.text}`),y,zn({url:c.url,data:void 0},p)))},onTimeout:(p,x,y)=>{this.resetLoader(x),l(this.createKeyLoadError(t,Ee.KEY_LOAD_TIMEOUT,new Error("key loading timed out"),y))},onAbort:(p,x,y)=>{this.resetLoader(x),l(this.createKeyLoadError(t,Ee.INTERNAL_ABORTED,new Error("key loading aborted"),y))}};a.load(c,h,m)})}resetLoader(e){const{frag:t,keyInfo:r,url:s}=e,a=r.loader;t.keyLoader===a&&(t.keyLoader=null,r.loader=null);const o=e_(r.decryptdata)||s;delete this.keyIdToKeyInfo[o],a&&a.destroy()}}function e_(n){if(n.keyFormat!==Pa.FAIRPLAY){const e=n.keyId;if(e)return Ra(e)}return n.uri}function qG(n){const{type:e}=n;switch(e){case Xt.AUDIO_TRACK:return mt.AUDIO;case Xt.SUBTITLE_TRACK:return mt.SUBTITLE;default:return mt.MAIN}}function t_(n,e){let t=n.url;return(t===void 0||t.indexOf("data:")===0)&&(t=e.url),t}class zFe{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(V.MANIFEST_LOADING,this.onManifestLoading,this),e.on(V.LEVEL_LOADING,this.onLevelLoading,this),e.on(V.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.on(V.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.on(V.LEVELS_UPDATED,this.onLevelsUpdated,this)}unregisterListeners(){const{hls:e}=this;e.off(V.MANIFEST_LOADING,this.onManifestLoading,this),e.off(V.LEVEL_LOADING,this.onLevelLoading,this),e.off(V.AUDIO_TRACK_LOADING,this.onAudioTrackLoading,this),e.off(V.SUBTITLE_TRACK_LOADING,this.onSubtitleTrackLoading,this),e.off(V.LEVELS_UPDATED,this.onLevelsUpdated,this)}createInternalLoader(e){const t=this.hls.config,r=t.pLoader,s=t.loader,a=r||s,o=new a(t);return this.loaders[e.type]=o,o}getInternalLoader(e){return this.loaders[e.type]}resetInternalLoader(e){this.loaders[e]&&delete this.loaders[e]}destroyInternalLoaders(){for(const e in this.loaders){const t=this.loaders[e];t&&t.destroy(),this.resetInternalLoader(e)}}destroy(){this.variableList=null,this.unregisterListeners(),this.destroyInternalLoaders()}onManifestLoading(e,t){const{url:r}=t;this.variableList=null,this.load({id:null,level:0,responseType:"text",type:Xt.MANIFEST,url:r,deliveryDirectives:null,levelOrTrack:null})}onLevelLoading(e,t){const{id:r,level:s,pathwayId:a,url:o,deliveryDirectives:l,levelInfo:c}=t;this.load({id:r,level:s,pathwayId:a,responseType:"text",type:Xt.LEVEL,url:o,deliveryDirectives:l,levelOrTrack:c})}onAudioTrackLoading(e,t){const{id:r,groupId:s,url:a,deliveryDirectives:o,track:l}=t;this.load({id:r,groupId:s,level:null,responseType:"text",type:Xt.AUDIO_TRACK,url:a,deliveryDirectives:o,levelOrTrack:l})}onSubtitleTrackLoading(e,t){const{id:r,groupId:s,url:a,deliveryDirectives:o,track:l}=t;this.load({id:r,groupId:s,level:null,responseType:"text",type:Xt.SUBTITLE_TRACK,url:a,deliveryDirectives:o,levelOrTrack:l})}onLevelsUpdated(e,t){const r=this.loaders[Xt.LEVEL];if(r){const s=r.context;s&&!t.levels.some(a=>a===s.levelOrTrack)&&(r.abort(),delete this.loaders[Xt.LEVEL])}}load(e){var t;const r=this.hls.config;let s=this.getInternalLoader(e);if(s){const d=this.hls.logger,h=s.context;if(h&&h.levelOrTrack===e.levelOrTrack&&(h.url===e.url||h.deliveryDirectives&&!e.deliveryDirectives)){h.url===e.url?d.log(`[playlist-loader]: ignore ${e.url} ongoing request`):d.log(`[playlist-loader]: ignore ${e.url} in favor of ${h.url}`);return}d.log(`[playlist-loader]: aborting previous loader for type: ${e.type}`),s.abort()}let a;if(e.type===Xt.MANIFEST?a=r.manifestLoadPolicy.default:a=sr({},r.playlistLoadPolicy.default,{timeoutRetry:null,errorRetry:null}),s=this.createInternalLoader(e),ct((t=e.deliveryDirectives)==null?void 0:t.part)){let d;if(e.type===Xt.LEVEL&&e.level!==null?d=this.hls.levels[e.level].details:e.type===Xt.AUDIO_TRACK&&e.id!==null?d=this.hls.audioTracks[e.id].details:e.type===Xt.SUBTITLE_TRACK&&e.id!==null&&(d=this.hls.subtitleTracks[e.id].details),d){const h=d.partTarget,m=d.targetduration;if(h&&m){const p=Math.max(h*3,m*.8)*1e3;a=sr({},a,{maxTimeToFirstByteMs:Math.min(p,a.maxTimeToFirstByteMs),maxLoadTimeMs:Math.min(p,a.maxTimeToFirstByteMs)})}}}const o=a.errorRetry||a.timeoutRetry||{},l={loadPolicy:a,timeout:a.maxLoadTimeMs,maxRetry:o.maxNumRetry||0,retryDelay:o.retryDelayMs||0,maxRetryDelay:o.maxRetryDelayMs||0},c={onSuccess:(d,h,m,p)=>{const x=this.getInternalLoader(m);this.resetInternalLoader(m.type);const y=d.data;h.parsing.start=performance.now(),kc.isMediaPlaylist(y)||m.type!==Xt.MANIFEST?this.handleTrackOrLevelPlaylist(d,h,m,p||null,x):this.handleMasterPlaylist(d,h,m,p)},onError:(d,h,m,p)=>{this.handleNetworkError(h,m,!1,d,p)},onTimeout:(d,h,m)=>{this.handleNetworkError(h,m,!0,void 0,d)}};s.load(e,l,c)}checkAutostartLoad(){if(!this.hls)return;const{config:{autoStartLoad:e,startPosition:t},forceStartLoad:r}=this.hls;(e||r)&&(this.hls.logger.log(`${e?"auto":"force"} startLoad with configured startPosition ${t}`),this.hls.startLoad(t))}handleMasterPlaylist(e,t,r,s){const a=this.hls,o=e.data,l=t_(e,r),c=kc.parseMasterPlaylist(o,l);if(c.playlistParsingError){t.parsing.end=performance.now(),this.handleManifestParsingError(e,r,c.playlistParsingError,s,t);return}const{contentSteering:d,levels:h,sessionData:m,sessionKeys:p,startTimeOffset:x,variableList:y}=c;this.variableList=y,h.forEach(N=>{const{unknownCodecs:T}=N;if(T){const{preferManagedMediaSource:k}=this.hls.config;let{audioCodec:P,videoCodec:R}=N;for(let _=T.length;_--;){const I=T[_];Fy(I,"audio",k)?(N.audioCodec=P=P?`${P},${I}`:I,Tg.audio[P.substring(0,4)]=2,T.splice(_,1)):Fy(I,"video",k)&&(N.videoCodec=R=R?`${R},${I}`:I,Tg.video[R.substring(0,4)]=2,T.splice(_,1))}}});const{AUDIO:v=[],SUBTITLES:B,"CLOSED-CAPTIONS":E}=kc.parseMasterPlaylistMedia(o,l,c);v.length&&!v.some(T=>!T.url)&&h[0].audioCodec&&!h[0].attrs.AUDIO&&(this.hls.logger.log("[playlist-loader]: audio codec signaled in quality level, but no embedded audio track signaled, create one"),v.unshift({type:"main",name:"main",groupId:"main",default:!1,autoselect:!1,forced:!1,id:-1,attrs:new Qr({}),bitrate:0,url:""})),a.trigger(V.MANIFEST_LOADED,{levels:h,audioTracks:v,subtitles:B,captions:E,contentSteering:d,url:l,stats:t,networkDetails:s,sessionData:m,sessionKeys:p,startTimeOffset:x,variableList:y})}handleTrackOrLevelPlaylist(e,t,r,s,a){const o=this.hls,{id:l,level:c,type:d}=r,h=t_(e,r),m=ct(c)?c:ct(l)?l:0,p=qG(r),x=kc.parseLevelPlaylist(e.data,h,m,p,0,this.variableList);if(d===Xt.MANIFEST){const y={attrs:new Qr({}),bitrate:0,details:x,name:"",url:h};x.requestScheduled=t.loading.start+JZ(x,0),o.trigger(V.MANIFEST_LOADED,{levels:[y],audioTracks:[],url:h,stats:t,networkDetails:s,sessionData:null,sessionKeys:null,contentSteering:null,startTimeOffset:null,variableList:null})}t.parsing.end=performance.now(),r.levelDetails=x,this.handlePlaylistLoaded(x,e,t,r,s,a)}handleManifestParsingError(e,t,r,s,a){this.hls.trigger(V.ERROR,{type:Bt.NETWORK_ERROR,details:Ee.MANIFEST_PARSING_ERROR,fatal:t.type===Xt.MANIFEST,url:e.url,err:r,error:r,reason:r.message,response:e,context:t,networkDetails:s,stats:a})}handleNetworkError(e,t,r=!1,s,a){let o=`A network ${r?"timeout":"error"+(s?" (status "+s.code+")":"")} occurred while loading ${e.type}`;e.type===Xt.LEVEL?o+=`: ${e.level} id: ${e.id}`:(e.type===Xt.AUDIO_TRACK||e.type===Xt.SUBTITLE_TRACK)&&(o+=` id: ${e.id} group-id: "${e.groupId}"`);const l=new Error(o);this.hls.logger.warn(`[playlist-loader]: ${o}`);let c=Ee.UNKNOWN,d=!1;const h=this.getInternalLoader(e);switch(e.type){case Xt.MANIFEST:c=r?Ee.MANIFEST_LOAD_TIMEOUT:Ee.MANIFEST_LOAD_ERROR,d=!0;break;case Xt.LEVEL:c=r?Ee.LEVEL_LOAD_TIMEOUT:Ee.LEVEL_LOAD_ERROR,d=!1;break;case Xt.AUDIO_TRACK:c=r?Ee.AUDIO_TRACK_LOAD_TIMEOUT:Ee.AUDIO_TRACK_LOAD_ERROR,d=!1;break;case Xt.SUBTITLE_TRACK:c=r?Ee.SUBTITLE_TRACK_LOAD_TIMEOUT:Ee.SUBTITLE_LOAD_ERROR,d=!1;break}h&&this.resetInternalLoader(e.type);const m={type:Bt.NETWORK_ERROR,details:c,fatal:d,url:e.url,loader:h,context:e,error:l,networkDetails:t,stats:a};if(s){const p=(t==null?void 0:t.url)||e.url;m.response=zn({url:p,data:void 0},s)}this.hls.trigger(V.ERROR,m)}handlePlaylistLoaded(e,t,r,s,a,o){const l=this.hls,{type:c,level:d,levelOrTrack:h,id:m,groupId:p,deliveryDirectives:x}=s,y=t_(t,s),v=qG(s);let B=typeof s.level=="number"&&v===mt.MAIN?d:void 0;const E=e.playlistParsingError;if(E){if(this.hls.logger.warn(`${E} ${e.url}`),!l.config.ignorePlaylistParsingErrors){l.trigger(V.ERROR,{type:Bt.NETWORK_ERROR,details:Ee.LEVEL_PARSING_ERROR,fatal:!1,url:y,error:E,reason:E.message,response:t,context:s,level:B,parent:v,networkDetails:a,stats:r});return}e.playlistParsingError=null}if(!e.fragments.length){const N=e.playlistParsingError=new Error("No Segments found in Playlist");l.trigger(V.ERROR,{type:Bt.NETWORK_ERROR,details:Ee.LEVEL_EMPTY_ERROR,fatal:!1,url:y,error:N,reason:N.message,response:t,context:s,level:B,parent:v,networkDetails:a,stats:r});return}switch(e.live&&o&&(o.getCacheAge&&(e.ageHeader=o.getCacheAge()||0),(!o.getCacheAge||isNaN(e.ageHeader))&&(e.ageHeader=0)),c){case Xt.MANIFEST:case Xt.LEVEL:if(B){if(!h)B=0;else if(h!==l.levels[B]){const N=l.levels.indexOf(h);N>-1&&(B=N)}}l.trigger(V.LEVEL_LOADED,{details:e,levelInfo:h||l.levels[0],level:B||0,id:m||0,stats:r,networkDetails:a,deliveryDirectives:x,withoutMultiVariant:c===Xt.MANIFEST});break;case Xt.AUDIO_TRACK:l.trigger(V.AUDIO_TRACK_LOADED,{details:e,track:h,id:m||0,groupId:p||"",stats:r,networkDetails:a,deliveryDirectives:x});break;case Xt.SUBTITLE_TRACK:l.trigger(V.SUBTITLE_TRACK_LOADED,{details:e,track:h,id:m||0,groupId:p||"",stats:r,networkDetails:a,deliveryDirectives:x});break}}}class Wo{static get version(){return Gy}static isMSESupported(){return Qee()}static isSupported(){return UFe()}static getMediaSource(){return Gh()}static get Events(){return V}static get MetadataSchema(){return go}static get ErrorTypes(){return Bt}static get ErrorDetails(){return Ee}static get DefaultConfig(){return Wo.defaultConfig?Wo.defaultConfig:kFe}static set DefaultConfig(e){Wo.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 WP,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 t=this.logger=JLe(e.debug||!1,"Hls instance",e.assetPlayerId),r=this.config=_Fe(Wo.DefaultConfig,e,t);this.userConfig=e,r.progressive&&IFe(r,t);const{abrController:s,bufferController:a,capLevelController:o,errorController:l,fpsController:c}=r,d=new l(this),h=this.abrController=new s(this),m=new qOe(this),p=r.interstitialsController,x=p?this.interstitialsController=new p(this,Wo):null,y=this.bufferController=new a(this,m),v=this.capLevelController=new o(this),B=new c(this),E=new zFe(this),N=r.contentSteeringController,T=N?new N(this):null,k=this.levelController=new FFe(this,T),P=new OFe(this),R=new HFe(this.config,this.logger),_=this.streamController=new $Fe(this,m,R),I=this.gapController=new PFe(this,m);v.setStreamController(_),B.setStreamController(_);const D=[E,k,_];x&&D.splice(1,0,x),T&&D.splice(1,0,T),this.networkControllers=D;const j=[h,y,I,v,B,P,m];this.audioTrackController=this.createController(r.audioTrackController,D);const O=r.audioStreamController;O&&D.push(this.audioStreamController=new O(this,m,R)),this.subtitleTrackController=this.createController(r.subtitleTrackController,D);const M=r.subtitleStreamController;M&&D.push(this.subtititleStreamController=new M(this,m,R)),this.createController(r.timelineController,j),R.emeController=this.emeController=this.createController(r.emeController,j),this.cmcdController=this.createController(r.cmcdController,j),this.latencyController=this.createController(MFe,j),this.coreComponents=j,D.push(d);const U=d.onErrorOut;typeof U=="function"&&this.on(V.ERROR,U,d),this.on(V.MANIFEST_LOADED,E.onManifestLoaded,E)}createController(e,t){if(e){const r=new e(this);return t&&t.push(r),r}return null}on(e,t,r=this){this._emitter.on(e,t,r)}once(e,t,r=this){this._emitter.once(e,t,r)}removeAllListeners(e){this._emitter.removeAllListeners(e)}off(e,t,r=this,s){this._emitter.off(e,t,r,s)}listeners(e){return this._emitter.listeners(e)}emit(e,t,r){return this._emitter.emit(e,t,r)}
vendor: 6,940 bytes, line 4756
4756trigger(e,t){if(this.config.debug)return this.emit(e,e,t);try{return this.emit(e,e,t)}catch(r){if(this.logger.error("An internal error happened while handling event "+e+'. Error message: "'+r.message+'". Here is a stacktrace:',r),!this.triggeringException){this.triggeringException=!0;const s=e===V.ERROR;this.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.INTERNAL_EXCEPTION,fatal:s,event:e,error:r}),this.triggeringException=!1}}return!1}listenerCount(e){return this._emitter.listenerCount(e)}destroy(){this.logger.log("destroy"),this.trigger(V.DESTROYING,void 0),this.detachMedia(),this.removeAllListeners(),this._autoLevelCapping=-1,this._url=null,this.networkControllers.forEach(t=>t.destroy()),this.networkControllers.length=0,this.coreComponents.forEach(t=>t.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 a=new Error(`attachMedia failed: invalid argument (${e})`);this.trigger(V.ERROR,{type:Bt.OTHER_ERROR,details:Ee.ATTACH_MEDIA_ERROR,fatal:!0,error:a});return}this.logger.log("attachMedia"),this._media&&(this.logger.warn("media must be detached before attaching"),this.detachMedia());const t="media"in e,r=t?e.media:e,s=t?e:{media:r};this._media=r,this.trigger(V.MEDIA_ATTACHING,s)}detachMedia(){this.logger.log("detachMedia"),this.trigger(V.MEDIA_DETACHING,{}),this._media=null}transferMedia(){this._media=null;const e=this.bufferController.transferMedia();return this.trigger(V.MEDIA_DETACHING,{transferMedia:e}),e}loadSource(e){this.stopLoad();const t=this.media,r=this._url,s=this._url=OP.buildAbsoluteURL(self.location.href,e,{alwaysNormalize:!0});this._autoLevelCapping=-1,this._maxHdcpLevel=null,this.logger.log(`loadSource:${s}`),t&&r&&(r!==s||this.bufferController.hasSourceTypes())&&(this.detachMedia(),this.attachMedia(t)),this.trigger(V.MANIFEST_LOADING,{url:e})}get url(){return this._url}get hasEnoughToStart(){return this.streamController.hasEnoughToStart}get startPosition(){return this.streamController.startPositionValue}startLoad(e=-1,t){this.logger.log(`startLoad(${e+(t?", <skip seek to start>":"")})`),this.started=!0,this.resumeBuffering();for(let r=0;r<this.networkControllers.length&&(this.networkControllers[r].startLoad(e,t),!(!this.started||!this.networkControllers));r++);}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={[mt.MAIN]:this.streamController.inFlightFrag};return this.audioStreamController&&(e[mt.AUDIO]=this.audioStreamController.inFlightFrag),this.subtititleStreamController&&(e[mt.SUBTITLE]=this.subtititleStreamController.inFlightFrag),e}swapAudioCodec(){this.logger.log("swapAudioCodec"),this.streamController.swapAudioCodec()}recoverMediaError(){this.logger.log("recoverMediaError");const e=this._media,t=e==null?void 0:e.currentTime;this.detachMedia(),e&&(this.attachMedia(e),t&&this.startLoad(t))}removeLevel(e){this.levelController.removeLevel(e)}get sessionId(){let e=this._sessionId;return e||(e=this._sessionId=P4e()),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 t=!!e;t!==this.config.capLevelToPlayerSize&&(t?this.capLevelController.startCapping():(this.capLevelController.stopCapping(),this.autoLevelCapping=-1,this.streamController.nextLevelSwitch()),this.config.capLevelToPlayerSize=t)}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){_Oe(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:t}}=this;if(!e)return 0;const r=e.length;for(let s=0;s<r;s++)if(e[s].maxBitrate>=t)return s;return 0}get maxAutoLevel(){const{levels:e,autoLevelCapping:t,maxHdcpLevel:r}=this;let s;if(t===-1&&e!=null&&e.length?s=e.length-1:s=t,r)for(let a=s;a--;){const o=e[a].attrs["HDCP-LEVEL"];if(o&&o<=r)return a}return s}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 t;return((t=this.audioTrackController)==null?void 0:t.setAudioOption(e))||null}
4756setSubtitleOption(e){var t;return((t=this.subtitleTrackController)==null?void 0:t.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 t=this.audioTrackController;t&&(t.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 t=this.subtitleTrackController;t&&(t.subtitleTrack=e)}get subtitleDisplay(){const e=this.subtitleTrackController;return e?e.subtitleDisplay:!1}set subtitleDisplay(e){const t=this.subtitleTrackController;t&&(t.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,t=this.allAudioTracks){const r=LZ(t);return RZ(e,r,navigator.mediaCapabilities)}}Wo.defaultConfig=void 0;function qFe({station:n,isPlaying:e,setIsPlaying:t,isPracticeFrozen:r=!1}){const{t:s,isZh:a}=Or(),[o,l]=S.useState(.8),[c,d]=S.useState(!1),[h,m]=S.useState(!1),[p,x]=S.useState(null),[y,v]=S.useState(0),B=S.useRef(null),E=S.useRef(null),N=S.useRef(""),T=S.useRef(null);S.useEffect(()=>{v(0)},[n==null?void 0:n.name,n==null?void 0:n.url,n==null?void 0:n.streamUrl]),S.useEffect(()=>{if(!B.current)return;if(!n){N.current="",E.current&&(E.current.destroy(),E.current=null);try{B.current.pause(),B.current.removeAttribute("src"),B.current.load()}catch{}t(!1),m(!1),x(null);return}const R=n.url_resolved||n.url||n.streamUrl||"",_=[R,...n.backupStreamUrls||[]].filter(M=>typeof M=="string"&&M.trim().length>0),I=_[y]||_[0]||R;if(!I){x(a?"无法获取电台播放链接":"Broadcast stream URL unavailable"),t(!1),m(!1);return}const D=`/api/proxy-stream?url=${encodeURIComponent(I)}`,j=(I||"").toLowerCase().includes(".m3u8")||(n.url||"").toLowerCase().includes(".m3u8")||(n.streamUrl||"").toLowerCase().includes(".m3u8");let O=!1;if(e)(async()=>{var ie;if(typeof window<"u"&&typeof window.__resumeMicContext=="function")try{await window.__resumeMicContext()}catch(G){console.warn("[Audio Setup] Failed to resume Web Audio context before play:",G)}if(O||!B.current)return;const U=j?I:D;if(N.current!==U){N.current=U,x(null),m(!0),E.current&&(E.current.destroy(),E.current=null);try{B.current.pause()}catch{}if(j)if(B.current.canPlayType("application/vnd.apple.mpegurl"))B.current.src=I,B.current.load();else if(Wo.isSupported()){const G=new Wo({enableWorker:!0,lowLatencyMode:!0,maxBufferSize:0,maxBufferLength:1.5,liveDurationInfinity:!0});E.current=G,G.on(Wo.Events.ERROR,(Z,z)=>{if(z.fatal)if(console.warn(`HLS.js encountered fatal error: ${z.details}. Attempting recovery...`),z.type===Wo.ErrorTypes.NETWORK_ERROR){console.log("HLS network error. Switching to proxied HLS playlist fallback...");try{G.destroy(),E.current=null,B.current&&(B.current.src=D,B.current.play().catch(()=>k()))}catch{k()}}else z.type===Wo.ErrorTypes.MEDIA_ERROR?G.recoverMediaError():k()}),G.loadSource(I),G.attachMedia(B.current)}else B.current.src=D,B.current.load();else B.current.src=D,B.current.load()}m(!0);try{const G=B.current.play();if(T.current=G,await G,O)return;T.current===G&&(m(!1),x(null))}catch(G){if(O)return;G.name==="AbortError"||(ie=G.message)!=null&&ie.includes("interrupted")?console.log("Audio playback interrupted by a newer state change (expected behavior)."):(console.warn("Audio playback failed:",G.message||G),k())}})();else{m(!1),T.current=null,N.current="",E.current&&(E.current.destroy(),E.current=null);try{B.current.pause()}catch{}}return()=>{O=!0,E.current&&(E.current.destroy(),E.current=null)}},[n,e]),S.useEffect(()=>{B.current&&(r?B.current.muted=!0:(B.current.muted=!1,B.current.volume=c?0:o,e&&B.current.paused&&B.current.play().catch(()=>{})))},[o,c,r,e]);const k=()=>{const R=(n==null?void 0:n.backupStreamUrls)||[];if(R.length>0&&y<R.length){console.log(`[AudioPlayer] Primary/Current stream failed. Automatically trying backup stream ${y+1}/${R.length}...`),N.current="",v(_=>_+1);return}m(!1),t(!1),x(a?"无法播放广播流。该电台服务器可能临时离线或受到跨域防护限制。":"Failed to stream broadcast. The radio server might be offline or blocked by browser CORS restrictions.")},P=()=>{d(!c)};return i.jsxs("div",{className:"bg-white dark:bg-slate-900 border-t border-slate-200/50 dark:border-slate-800/50 py-3.5 px-6 flex flex-col md:flex-row gap-4 items-center justify-between shadow-lg relative min-h-[75px]",children:[i.jsx("audio",{ref:B,crossOrigin:"anonymous",onCanPlay:()=>{m(!1),x(null)},onWaiting:()=>m(!0),onError:()=>{if(!e||!n||!B.current)return;const R=B.current.error;if(!R||R.code===1)return;const _=B.current.src||"";if(!_||_===window.location.href||_===window.location.origin+"/"||!_.startsWith("http")||_.includes(window.location.host)&&(_.endsWith("/")||_.split("?")[0]===window.location.href.split("?")[0]))return;const I=`/api/proxy-stream?url=${encodeURIComponent(n.url)}`;_&&!_.includes(encodeURIComponent(n.url))?(B.current.src=I,B.current.play().catch(()=>k())):k()},onEnded:()=>{var R,_,I;console.log("🔵 [Audio Probe] 音频状态改变:",{paused:(R=B.current)==null?void 0:R.paused,muted:(_=B.current)==null?void 0:_.muted,currentTime:(I=B.current)==null?void 0:I.currentTime}),t(!1)},onPlay:()=>{var R,_,I;console.log("🔵 [Audio Probe] 音频状态改变:",{paused:(R=B.current)==null?void 0:R.paused,muted:(_=B.current)==null?void 0:_.muted,currentTime:(I=B.current)==null?void 0:I.currentTime})},onPause:()=>{var R,_,I;console.log("🔵 [Audio Probe] 音频状态改变:",{paused:(R=B.current)==null?void 0:R.paused,muted:(_=B.current)==null?void 0:_.muted,currentTime:(I=B.current)==null?void 0:I.currentTime})}}),i.jsx("div",{className:"flex items-center gap-3 w-full md:w-1/3",children:n?i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:`w-11 h-11 rounded-full bg-slate-100 dar
4756k:bg-slate-950 border border-slate-200 dark:border-slate-800 flex items-center justify-center overflow-hidden flex-shrink-0 ${e?"animate-spin [animation-duration:8s]":""}`,children:n.favicon?i.jsx("img",{src:n.favicon.startsWith("/")||n.favicon.startsWith("data:")?n.favicon:`/api/proxy-image?url=${encodeURIComponent(n.favicon)}`,alt:"",width:44,height:44,loading:"lazy",decoding:"async",referrerPolicy:"no-referrer",onError:R=>{const _=R.target;_.style.display="none"},className:"w-full h-full object-cover"}):i.jsx(cn,{className:"w-5 h-5 text-emerald-500"})}),i.jsx("div",{className:"absolute -bottom-0.5 -right-0.5 bg-green-500 w-3.5 h-3.5 rounded-full border-2 border-white dark:border-slate-900 flex items-center justify-center",children:i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-white animate-scale"})})]}),i.jsxs("div",{className:"flex-1 overflow-hidden",children:[i.jsx("p",{className:"font-display font-bold text-sm text-slate-800 dark:text-slate-100 truncate flex items-center gap-1.5",children:n.name}),i.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-300 truncate capitalize",children:n.tags?n.tags.split(",").slice(0,2).join(" • "):"Global Channel"})]})]}):i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 dark:text-slate-400",children:[i.jsx("button",{type:"button",className:"w-11 h-11 rounded-full border border-dashed border-slate-200 dark:border-slate-800 flex items-center justify-center flex-shrink-0","aria-label":"No station loaded",children:i.jsx(Mbe,{className:"w-5 h-5 text-slate-300 dark:text-slate-500"})}),i.jsxs("div",{className:"flex flex-col",children:[i.jsx("span",{className:"text-xs font-semibold",children:a?"未加载电台...":"Tuning Station empty..."}),i.jsx("span",{className:"text-[10px] text-slate-400 dark:text-slate-400",children:a?"请在上方选择任意电台开始收听":"Select any target location above"})]})]})}),i.jsx("div",{className:"flex flex-col items-center gap-1 w-full md:w-1/3",children:i.jsx("div",{className:"flex items-center gap-3",children:i.jsx("button",{onClick:()=>{t(r?!0:!e)},disabled:!n,className:`w-10 h-10 rounded-full flex items-center justify-center text-white transition-all shadow ${n?e&&!r?"bg-emerald-600 hover:bg-emerald-700 hover:scale-105":"bg-emerald-500 hover:bg-emerald-600 hover:scale-105":"bg-slate-200 dark:bg-slate-800 cursor-not-allowed text-slate-400"}`,id:"control_play_pause",title:n?h?a?"加载广播流中...":"Loading stream...":e&&!r?a?"暂停广播":"Pause broadcast":a?"播放广播":"Play broadcast":a?"未选择电台":"No station tuned empty",children:h?i.jsxs("svg",{className:"animate-spin h-5 w-5 text-white",fill:"none",viewBox:"0 0 24 24",children:[i.jsx("circle",{className:"opacity-25",cx:"12",cy:"12",r:"10",stroke:"currentColor",strokeWidth:"4"}),i.jsx("path",{className:"opacity-75",fill:"currentColor",d:"M4 12a8 8 0 018-8V0C5.373 0 0 5.373 0 12h4zm2 5.291A7.962 7.962 0 014 12H0c0 3.042 1.135 5.824 3 7.938l3-2.647z"})]}):e&&!r?i.jsx(Fh,{className:"w-5 h-5 fill-current"}):i.jsx(Xa,{className:"w-5 h-5 fill-current translate-x-[1px]"})})})}),i.jsx("div",{className:"flex items-center justify-end gap-3.5 w-full md:w-1/3",children:i.jsxs("div",{className:"flex items-center gap-2 text-slate-500",children:[i.jsx("button",{onClick:P,className:"hover:text-slate-700 dark:hover:text-slate-300 transition-colors",id:"control_mute",title:c||o===0?s.player.unmute:s.player.mute,children:c||o===0?i.jsx(mS,{className:"w-4 h-4"}):i.jsx(on,{className:"w-4 h-4"})}),i.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:c?0:o,onChange:R=>{l(parseFloat(R.target.value)),d(!1)},className:"w-20 accent-emerald-500 h-1 bg-slate-200 dark:bg-slate-800 rounded-lg cursor-pointer",title:`${s.player.volume}: ${Math.round((c?0:o)*100)}%`})]})})]})}function KFe(){var h,m;const[n,e]=S.useState(!1),[t,r]=S.useState(null),[s,a]=S.useState([]),[o,l]=S.useState(0),c=p=>{const x=new Date().toLocaleTimeString();a(y=>[`[${x}] ${p}`,...y])},d=async()=>{var x,y;e(!0),r(null),a([]),l(0),c("Initiating 30-second live radio stream capture...");const p=setInterval(()=>{l(v=>v+1)},1e3);try{c("Sending GET request to /api/cron/curate...");const B=await(await fetch("/api/cron/curate",{method:"GET",headers:{Accept:"application/json"}})).json();B.success?(c("✅ Pipeline completed successfully!"),c(`Captured Station: ${B.station||"Radio Stream"}`),c(`Raw Transcript length: ${((x=B.rawTranscript)==null?void 0:x.length)||0} characters`),c(`Curated Status: ${(y=B.curatedData)!=null&&y.isValuable?"VALUABLE (C1 Level)":"DISCARDED (Low Value/Noise)"}`),r(B)):(c(`❌ Pipeline error: ${B.error||"Unknown server error"}`),r(B))}catch(v){c(`❌ Client-side request failure: ${(v==null?void 0:v.message)||v}`),r({success:!1,error:(v==null?void 0:v.message)||String(v)}
4756)}finally{clearInterval(p),e(!1)}};return i.jsx("div",{className:"min-h-screen bg-slate-950 text-slate-100 p-4 sm:p-8 font-sans antialiased",children:i.jsxs("div",{className:"max-w-7xl mx-auto mb-8",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4 pb-6 border-b border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-3 bg-amber-500/10 border border-amber-500/20 text-amber-500 rounded-2xl",children:i.jsx(At,{className:"w-7 h-7"})}),i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl sm:text-3xl font-extrabold tracking-tight font-display text-white flex items-center gap-3",children:["Curator Debugger UI",i.jsx("span",{className:"text-xs font-mono font-bold bg-amber-500/20 text-amber-400 px-2.5 py-1 rounded-full border border-amber-500/30",children:"Step 5.2 Test Lab"})]}),i.jsx("p",{className:"text-sm text-slate-400 mt-1",children:"Visual pipeline testbench for 30s radio stream capture, Gemini Audio STT & AI Golden Miner refinement."})]})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs bg-slate-900 border border-slate-800 px-3.5 py-2 rounded-xl text-slate-300",children:[i.jsx(cn,{className:"w-4 h-4 text-emerald-400 animate-pulse"}),i.jsx("span",{children:"Target: France Info 24/7 News Stream"})]})]}),i.jsxs("div",{className:"mt-8 bg-slate-900/80 border border-slate-800 rounded-3xl p-6 md:p-8 backdrop-blur-md flex flex-col items-center justify-center text-center shadow-2xl",children:[i.jsx("button",{onClick:d,disabled:n,className:`w-full max-w-xl py-4 px-8 rounded-full font-semibold text-base sm:text-lg transition-all shadow-xl flex items-center justify-center gap-3 cursor-pointer ${n?"bg-slate-800 text-slate-400 border border-slate-700 cursor-not-allowed":"bg-emerald-500 hover:bg-emerald-400 text-slate-950 shadow-emerald-500/20 hover:scale-[1.01] active:scale-[0.99]"}`,children:n?i.jsxs(i.Fragment,{children:[i.jsx(Bs,{className:"w-6 h-6 animate-spin text-emerald-400"}),i.jsxs("span",{children:["⏳ Capturing Radio Stream & Calling Gemini... (",o,"s / ~35s)"]})]}):i.jsxs(i.Fragment,{children:[i.jsx(Xa,{className:"w-6 h-6 fill-current"}),i.jsx("span",{children:"🚀 Trigger 30s Stream Capture & AI Curation Pipeline"})]})}),i.jsx("p",{className:"text-xs text-slate-500 mt-3 font-mono",children:"Captures real 30-second audio stream from live radio, runs Gemini STT, then filters noise & extracts C1 dialogue."})]}),s.length>0&&i.jsxs("div",{className:"mt-6 bg-slate-900/60 border border-slate-800/80 rounded-2xl p-4 font-mono text-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-400 mb-2 border-b border-slate-800/80 pb-2",children:[i.jsx(Q2,{className:"w-4 h-4 text-emerald-400"}),i.jsx("span",{className:"font-semibold text-slate-200",children:"Execution Console Logs"})]}),i.jsx("div",{className:"space-y-1 max-h-36 overflow-y-auto font-mono text-slate-300",children:s.map((p,x)=>i.jsx("div",{className:"leading-relaxed",children:p},x))})]}),t&&i.jsxs("div",{className:"mt-8 grid grid-cols-1 lg:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"bg-slate-900/90 border border-slate-800 rounded-3xl p-6 flex flex-col gap-4 shadow-lg",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-300 font-bold text-base",children:[i.jsx(cn,{className:"w-5 h-5 text-slate-400"}),i.jsx("span",{children:"Raw Audio STT Transcript"})]}),i.jsxs("span",{className:"text-xs font-mono text-slate-500 px-2.5 py-1 bg-slate-950 rounded-lg border border-slate-800",children:["Length: ",((h=t.rawTranscript)==null?void 0:h.length)||0," chars"]})]}),t.rawTranscript?i.jsx("div",{className:"p-4 rounded-2xl bg-slate-950/80 border border-slate-800/80 text-slate-300 text-sm leading-relaxed font-mono whitespace-pre-wrap min-h-[200px]",children:t.rawTranscript}):i.jsx("div",{className:"p-8 rounded-2xl bg-slate-950/50 border border-dashed border-slate-800 text-slate-500 text-center text-sm",children:t.error?`Error: ${t.error}`:"No raw transcript available."})]}),i.jsxs("div",{className:`bg-slate-900/90 rounded-3xl p-6 flex flex-col gap-4 shadow-lg border-2 ${(m=t.curatedData)!=null&&m.isValuable?"border-emerald-500/40 shadow-emerald-500/5":"border-red-500/40 shadow-red-500/5"}`,children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-slate-800 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-2 text-white font-bold text-base",children:[i.jsx(At,{className:"w-5 h-5 text-amber-400"}),i.jsx("span",{children:"AI Curated Asset (Golden Miner)"})]}),t.curatedData?t.curatedData.isValuable?i.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-bold text-emerald-400 bg-emerald-500/10 border border-emerald-500/30 px-3 py-1 rounded-full",children:[i.jsx(vn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Valuable C1 Dialogue"})]}):i.jsxs("span",{className:"flex items-center gap-1.5 text-xs font-bold text-red-400 bg-red-500/10 border border-red-500/30 px-3 py-1 rounded-full",children:[i.jsx(wI,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Discarded (Low Value/Noise)"})]}):null]}),t.curatedData?i.jsxs("div",{className:"flex flex-col gap-4",children:[!t.curatedData.isValuable&&i.jsxs("div",{className:"p-3.5 rounded-2xl bg-red-950/40 border border-red-800/50 text-red-300 text-xs flex items-center gap-3",children:[i.jsx(wI,{className:"w-5 h-5 text-red-400 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold",children:"Marked as Low-Value / Advert
4756ising Banter"}),i.jsx("div",{className:"text-[11px] text-red-400/80",children:t.curatedData.reasoning})]})]}),i.jsxs("div",{children:[i.jsxs("label",{className:"text-xs font-semibold text-slate-400 mb-1.5 block flex items-center gap-1.5",children:[i.jsx(Ys,{className:"w-3.5 h-3.5 text-emerald-400"}),"Cleaned Paragraph"]}),i.jsx("div",{className:"p-4 rounded-2xl bg-slate-950/90 border border-slate-800 text-slate-100 text-sm leading-relaxed",children:t.curatedData.cleanText||"No text extracted."})]}),t.curatedData.vocabulary&&t.curatedData.vocabulary.length>0&&i.jsxs("div",{children:[i.jsxs("label",{className:"text-xs font-semibold text-slate-400 mb-2 block flex items-center gap-1.5",children:[i.jsx(Pye,{className:"w-3.5 h-3.5 text-amber-400"}),"Extracted Advanced Vocabulary (",t.curatedData.vocabulary.length,")"]}),i.jsx("div",{className:"grid grid-cols-1 gap-2",children:t.curatedData.vocabulary.map((p,x)=>i.jsxs("div",{className:"p-3 rounded-xl bg-slate-950/60 border border-slate-800/80 flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"font-bold text-amber-400 text-sm",children:p.word}),i.jsx("span",{className:"text-xs text-emerald-400",children:p.translation})]}),i.jsxs("p",{className:"text-xs text-slate-400 italic",children:['"',p.context,'"']})]},x))})]}),t.curatedData.reasoning&&i.jsxs("div",{className:"p-3 rounded-xl bg-slate-950/40 border border-slate-800/50 text-xs text-slate-400",children:[i.jsx("span",{className:"font-semibold text-slate-300",children:"Curator Evaluation Logic: "}),t.curatedData.reasoning]})]}):i.jsx("div",{className:"p-8 rounded-2xl bg-slate-950/50 border border-dashed border-slate-800 text-slate-500 text-center text-sm",children:"Run the pipeline to inspect AI curation results."})]})]})]})})}const PC=[{id:"seed-1",station:"BBC World Service",targetLanguage:"English",language:"English",difficulty:"Advanced",vocabCoverage:"High (80%+)",sophistication:"IELTS 7.5+",cleanText:"Technological innovations in artificial intelligence are fundamentally restructuring global labor markets. Economist analyses suggest that adaptive workforce reskilling will become paramount for maintaining competitive momentum.",vocabulary:[{word:"restructuring",translation:"reorganizing system foundations",context:"restructuring global labor markets"},{word:"paramount",translation:"of supreme importance",context:"reskilling will become paramount"},{word:"momentum",translation:"driving force or progress",context:"maintaining competitive momentum"}],reasoning:"Extracted from Global Business Update. High-frequency academic vocabulary.",createdAt:new Date(Date.now()-3600*1e3*2)},{id:"seed-2",station:"RTL France · 24/7 Global",targetLanguage:"French",language:"French",difficulty:"Advanced",vocabCoverage:"High (80%+)",sophistication:"C1 Academic",cleanText:"Les ministres européens de l'Environnement se réunissent aujourd'hui à Bruxelles pour débattre des nouvelles normes de neutralité carbone. Cette transition énergétique suscite d'intenses négociations entre les gouvernements industriels et agricoles.",vocabulary:[{word:"débattre",translation:"to debate / discuss thoroughly",context:"débattre des nouvelles normes"},{word:"transition",translation:"energy transition / phase shift",context:"Cette transition énergétique suscite"},{word:"négociations",translation:"high-level negotiations",context:"d'intenses négociations entre gouvernements"}],reasoning:"Extracted from 09:00 AM European Policy Special. Clear C1 formal speech.",createdAt:new Date(Date.now()-3600*1e3*4)},{id:"seed-3",station:"NPR Live News",targetLanguage:"English",language:"English",difficulty:"Intermediate",vocabCoverage:"Medium (50%+)",sophistication:"IELTS 6.5+",cleanText:"Municipal leaders across North America are implementing strategic urban greening initiatives to mitigate climate vulnerability and foster community resilience during peak summer months.",vocabulary:[{word:"initiatives",translation:"proactive strategic plans",context:"urban greening initiatives"},{word:"mitigate",translation:"alleviate severity or impact",context:"mitigate climate vulnerability"},{word:"resilience",translation:"ability to recover quickly",context:"foster community resilience"}],reasoning:"Extracted from NPR National Desk report.",createdAt:new Date(Date.now()-3600*1e3*6)},{id:"seed-4",station:"Radio Nacional España",targetLanguage:"Spanish",language:"Spanish",difficulty:"Advanced",vocabCoverage:"High (80%+)",sophistication:"Business Elite",cleanText:"Las transformaciones macroeconómicas contemporáneas requieren una profunda reestructuración de los mercados financieros internacionales para garantizar la estabilidad fiscal sostenida.",vocabulary:[{word:"transformaciones",translation:"systemic transformations",context:"transformaciones macroeconómicas"},{word:"reestructuración",translation:"structural reorganization",context:"profunda reestructuración"},{word:"estabilidad",translation:"long-term financial stability",context:"estabilidad fiscal sostenida"}],reasoning:"Extracted from RNE Business Hour.",createdAt:new Date(Date.now()-3600*1e3*8)},{id:"seed-5",station:"Deutschlandfunk Culture",targetLanguage:"German",language:"German",difficulty:"Advanced",vocabCoverage:"High (80%+)",sophistication:"C1 Academic",cleanText:"Die digitale Transformation verändere nicht nur die Arbeitswelt, sondern beeinflusse auch maßgeblich die gesellschaftliche Kommunikation und den kulturellen Austausch in Europa.",vocabulary:[{word:"Transformation",translation:"digital transformation process",context:"Die digitale Transformation"},{word:"maßgeblich",translation:"decisively / significantly",context:"beeinflusse auch maßgeblich"},{word:"Austausch",translation:"cultural exchange & dialogue",context:"den kulturellen Austausch"}],reasoning:"Extracted from DLF Cultural Analysis.",createdAt:new Date(Date.now()-3600*1e3*10)},{id:"seed-6",station:"France Info Radio",targetLanguage:"French",language:"French",difficulty:"Intermediate",vocabCoverage:"Medium (50%+)",sophistication:"Daily Practice",cleanText:"La recherche spatiale internationale a franchi une étape décisive cette semaine avec la mise en orbite du nouveau télescope. Les scientifiques espèrent capter des signaux inédits issus des premières galaxies.",vocabulary:[{word:"décisive",translation:"crucial / milestone decision",context:"une étape décisive cette semaine"},{word:"orbite",translation:"space orbit",context:"la mise en orbite du télescope"},{word:"inédits",translation:"unprecedented / brand new",context:"capter des signaux inédits"}],reasoning:"Extracted from Science & Discovery Daily segment.",createdAt:new Date(Date.now()-3600*1e3*12)},{id:"seed-7",station:"Voice of America",targetLanguage:"English",language:"English",difficulty:"Beginner",vocabCoverage:"Standard",sophistication:"Daily Practice",cleanText:"International meteorologists report that weather patterns are bringing milder temperatures to many regions this week, helping local farmers prepare for the upcoming harvest season.",vocabulary:[{word:"meteorologists",translation:"weather forecasting scientists",context:"International meteorologists report"},{word:"harvest",translation:"crop gathering season",context:"prepare for upcoming harvest"}],reasoning:"Extracted from VOA Special English News.",createdAt:new Date(Date.now()-3600*1e3*15)}];function KG(n){if(!n)return 0;let e=0;for(let t=0;t<n.length;t++)e=n.charCodeAt(t)+((e<<5)-e);return Math.abs(e)}function WFe({onUpgrade:n,onSelectSnippetForPractice:e,onOpenAuthModal:t,onOpenLegal:r}){var ie;const{t:s,isZh:a}=Or(),{user:o,userProfile:l,isPro:c,logout:d}=Ji(),[h,m]=S.useState([]),[p,x]=S.useState(!0),[y,v]=S.useState(null),[B,E]=S.useState(!1),[N,T]=S.useState(!1),k=()=>{n?n():T(!0)},[P,R]=S.useState("All"),[_,I]=S.useState("All"),[D,j]=S.useState("All"),[O,M]=S.useState("All"),U=S.useMemo(()=>h.filter(G=>{if(P!=="All"){const z=(G.language||G.targetLanguage||"English").toLowerCase(),se=P.toLowerCase();if(!z.includes(se))return!1}const Z=KG(G.id||"default");return!(_!=="All"&&(G.difficulty||(Z%3===0?"Intermediate":Z%3===1?"Advanced":"Beginner"))!==_||D!=="All"&&(G.vocabCoverage||(Z%2===0?"High (80%+)":"Medium (50%+)"))!==D||O!=="All"&&(G.sophistication||(Z%5===0?"IELTS 7.5+":Z%5===1?"C1 Academic":Z%5===2?"IELTS 6.5+":Z%5===3?"Business Elite":"Daily Practice"))!==O)}),[h,P,_,D,O]);S.useEffect(()=>{let G=()=>{};try{const Z=vo(qs(fn,"pro_curated_assets"),aS("createdAt","desc"));G=jm(Z,z=>{if(z.empty)m(PC);else{const se=z.docs.map(re=>({id:re.id,...re.data()}));m(se)}x(!1)},z=>{console.warn("[Firestore Cabin] Falling back to seed assets:",z==null?void 0:z.message),m(PC),x(!1)})}catch(Z){console.error("[Firestore Cabin] Connection error:",Z),m(PC),x(!1)}return()=>G()},[]);const ee=G=>{if(!G)return"Just now";const Z=G.toDate?G.toDate():new Date(G),z=Math.floor((Date.now()-Z.getTime())/(1e3*3600));return z<=0?"Just now":z<24?`${z}h ago`:`${Math.floor(z/24)}d ago`};return i.jsxs("div",{className:"w-full min-h-screen bg-slate-50/60 text-slate-900 p-4 sm:p-8 font-sans antialiased relative",children:[i.jsx("div",{className:"absolute top-10 left-1/3 w-96 h-96 bg-amber-200/20 rounded-full blur-3xl pointer-events-none"}),i.jsx("div",{className:"absolute bottom-20 right-1/4 w-96 h-96 bg-emerald-200/20 rounded-full blur-3xl pointer-events-none"}),i.jsxs("div",{className:"max-w-5xl mx-auto relative z-10",children:[i.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 pb-6 border-b border-slate-200 mb-8",children:[i.jsx("div",{children:i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-2.5 bg-amber-50 border border-amber-200 text-amber-600 rounded-2xl shadow-sm",children:i.jsx(fr,{className:"w-6 h-6"})}),i.jsxs("div",{children:[i.jsxs("h1",{className:"text-2xl sm:text-3xl font-extrabold tracking-tight font-display text-slate-900 flex items-center gap-3",children:[s.cabin.title,i.jsx("span",{className:"text-xs font-mono font-bold bg-amber-50 text-amber-700 border border-amber-200 px-2.5 py-0.5 rounded-full",children:s.cabin.streamBadge})]}),i.jsx("p",{className:"text-sm text-slate-500 mt-1",children:s.cabin.subtitle})]})]})}),i.jsx("div",{className:"flex items-center gap-3 self-start md:self-auto",children:o?i.jsxs("div",{className:"flex items-center gap-2 bg-white border border-slate-200 px-3 py-1.5 rounded-xl shadow-sm",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500"}
4756),o.photoURL||l!=null&&l.photoURL?i.jsx("img",{src:o.photoURL||(l==null?void 0:l.photoURL)||"",alt:"User",width:20,height:20,loading:"lazy",decoding:"async",className:"w-5 h-5 rounded-full object-cover shrink-0",referrerPolicy:"no-referrer"}):null,i.jsx("span",{className:"text-xs font-medium text-slate-700 max-w-[120px] truncate",children:o.displayName||(l==null?void 0:l.displayName)||o.email}),c&&i.jsx("span",{className:"bg-amber-100 text-amber-800 text-[10px] font-bold px-1.5 py-0.5 rounded",children:"PRO"}),i.jsx("button",{onClick:d,className:"text-slate-400 hover:text-slate-700 p-1 cursor-pointer",title:s.header.signOut,children:i.jsx(fS,{className:"w-3.5 h-3.5"})})]}):i.jsxs("button",{onClick:()=>t?t():null,className:"px-4 py-2 bg-slate-900 hover:bg-slate-800 text-white rounded-xl text-xs font-bold transition-all shadow-sm flex items-center gap-2 cursor-pointer",children:[i.jsx(fr,{className:"w-3.5 h-3.5 text-amber-400"}),i.jsx("span",{children:s.header.signIn})]})})]}),p?i.jsx("div",{className:"space-y-6",children:[1,2].map(G=>i.jsxs("div",{className:"p-6 rounded-2xl bg-white border border-slate-200 animate-pulse flex flex-col gap-4 shadow-sm",children:[i.jsx("div",{className:"h-4 bg-slate-100 rounded w-1/4"}),i.jsx("div",{className:"h-16 bg-slate-100/80 rounded-xl w-full"}),i.jsx("div",{className:"h-6 bg-slate-100 rounded w-1/2"})]},G))}):i.jsxs("div",{className:"flex flex-col gap-6",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-2xl p-4 sm:p-5 shadow-sm flex flex-col gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between font-mono text-xs text-slate-600 dark:text-slate-300 font-bold uppercase tracking-wider",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"p-1.5 rounded-lg bg-emerald-50 dark:bg-emerald-950/60 border border-emerald-200/60 text-emerald-600 dark:text-emerald-400",children:i.jsx(SW,{className:"w-4 h-4"})}),i.jsx("span",{children:s.cabin.filterPassages.replace("{count}",String(U.length))})]}),(P!=="All"||_!=="All"||D!=="All"||O!=="All")&&i.jsx("button",{onClick:()=>{R("All"),I("All"),j("All"),M("All")},className:"text-xs text-emerald-600 dark:text-emerald-400 hover:underline cursor-pointer font-sans normal-case font-semibold",children:s.cabin.resetFilters})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3 text-xs",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("label",{className:"text-[11px] text-slate-500 dark:text-slate-400 font-medium",children:s.cabin.language}),i.jsxs("select",{value:P,onChange:G=>R(G.target.value),className:"px-3 py-2 bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-750 rounded-xl text-slate-800 dark:text-slate-200 focus:outline-none focus:border-emerald-500 font-sans cursor-pointer transition-colors",children:[i.jsx("option",{value:"All",children:s.cabin.allLanguages}),i.jsx("option",{value:"English",children:"English"}),i.jsx("option",{value:"French",children:"French"}),i.jsx("option",{value:"Spanish",children:"Spanish"}),i.jsx("option",{value:"German",children:"German"})]})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("label",{className:"text-[11px] text-slate-500 dark:text-slate-400 font-medium",children:s.cabin.difficultyLevel}),i.jsxs("select",{value:_,onChange:G=>I(G.target.value),className:"px-3 py-2 bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-750 rounded-xl text-slate-800 dark:text-slate-200 focus:outline-none focus:border-emerald-500 font-sans cursor-pointer transition-colors",children:[i.jsx("option",{value:"All",children:s.cabin.allLevels}),i.jsx("option",{value:"Beginner",children:"Beginner"}),i.jsx("option",{value:"Intermediate",children:"Intermediate"}),i.jsx("option",{value:"Advanced",children:"Advanced"})]})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("label",{className:"text-[11px] text-slate-500 dark:text-slate-400 font-medium",children:s.cabin.vocabDensity}),i.jsxs("select",{value:D,onChange:G=>j(G.target.value),className:"px-3 py-2 bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-750 rounded-xl text-slate-800 dark:text-slate-200 focus:outline-none focus:border-emerald-500 font-sans cursor-pointer transition-colors",children:[i.jsx("option",{value:"All",children:s.cabin.allDensity}),i.jsx("option",{value:"High (80%+)",children:"High (80%+)"}),i.jsx("option",{value:"Medium (50%+)",children:"Medium (50%+)"}),i.jsx("option",{value:"Standard",children:"Standard"})]})]}),i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("label",{className:"text-[11px] text-slate-500 dark:text-slate-400 font-medium",children:s.cabin.bandSophistication}),i.jsxs("select",{value:O,onChange:G=>M(G.target.value),className:"px-3 py-2 bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-750 rounded-xl text-slate-800 dark:text-slate-200 focus:outline-none focus:border-emerald-500 font-sans cursor-pointer transition-colors",children:[i.jsx("option",{value:"All",children:s.cabin.allSophistication}),i.jsx("option",{value:"IELTS 6.5+",children:"IELTS 6.5+"}),i.jsx("option",{value:"IELTS 7.5+",children:"IELTS 7.5+"}),i.jsx("option",{value:"C1 Academic",children:"C1 Academic"}),i.jsx("option",{value:"Business Elite",children:"Business Elite"}),i.jsx("option",{value:"Daily Practice",children:"Daily Practice"})]})]})]})]}),i.jsx("div",{className:"relative flex flex-col gap-6",children:U.length===0?i.jsxs("div",{className:"p-8 text-center bg-white dark:bg-slate-900 rounded-2xl border border-slate-200 dark:border-slate-800 shadow-sm",children:[i.jsx("p",{className:"text-sm text-slate-600 dar
4756k:text-slate-400 mb-3 font-medium",children:"No curated passages match your current filter criteria."}),i.jsx("button",{onClick:()=>{R("All"),I("All"),j("All"),M("All")},className:"px-4 py-2 rounded-xl bg-emerald-500 hover:bg-emerald-600 text-white font-semibold text-xs transition-all shadow-sm cursor-pointer",children:"Reset Filters"})]}):c||U.length<=1?U.map((G,Z)=>{const z=!c&&Z>0;return i.jsxs("div",{className:`relative group rounded-2xl transition-all duration-300 border bg-white p-6 sm:p-7 shadow-sm hover:shadow-md ${Z===0?"border-slate-200/90 shadow-slate-100 animate-in fade-in":"border-slate-200/80"} ${z?"filter blur-[5px] select-none pointer-events-none opacity-40":""}`,children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pb-4 border-b border-slate-100 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5 text-xs text-slate-600 font-medium",children:[i.jsxs("span",{className:"p-1.5 rounded-lg bg-emerald-50 border border-emerald-200/60 text-emerald-700 flex items-center gap-1.5 font-medium",children:[i.jsx(cn,{className:"w-3.5 h-3.5 animate-pulse text-emerald-600"}),i.jsx("span",{children:G.station||"Global Radio Broadcast"})]}),i.jsx("span",{className:"text-slate-300",children:"•"}),i.jsxs("span",{className:"flex items-center gap-1 text-slate-400 font-mono",children:[i.jsx(Eo,{className:"w-3 h-3"}),ee(G.createdAt)]})]}),i.jsxs("div",{className:"flex flex-wrap gap-1.5 items-center",children:[i.jsx("span",{className:"text-[11px] font-mono font-semibold px-2.5 py-1 rounded-full bg-slate-100 dark:bg-slate-800 text-slate-700 dark:text-slate-300 border border-slate-200 dark:border-slate-700",children:G.targetLanguage||"C1 Global Dialogue"}),(()=>{const se=KG(G.id||"default"),re=G.difficulty||(se%3===0?"Intermediate":se%3===1?"Advanced":"Beginner"),H=G.vocabCoverage||(se%2===0?"High (80%+)":"Medium (50%+)"),Y=G.sophistication||(se%5===0?"IELTS 7.5+":se%5===1?"C1 Academic":se%5===2?"IELTS 6.5+":se%5===3?"Business Elite":"Daily Practice");return i.jsxs(i.Fragment,{children:[i.jsx("span",{className:`text-[11px] font-mono font-bold px-2 py-0.5 rounded-md border ${re==="Advanced"?"bg-rose-50 dark:bg-rose-950/40 text-rose-700 dark:text-rose-400 border-rose-200/60 dark:border-rose-900/40":re==="Intermediate"?"bg-amber-50 dark:bg-amber-950/40 text-amber-700 dark:text-amber-400 border-amber-200/60 dark:border-amber-900/40":"bg-emerald-50 dark:bg-emerald-950/40 text-emerald-700 dark:text-emerald-400 border-emerald-200/60 dark:border-emerald-900/40"}`,children:re}),i.jsx("span",{className:"text-[11px] font-mono font-semibold px-2 py-0.5 rounded-md bg-indigo-50 dark:bg-indigo-950/40 text-indigo-700 dark:text-indigo-400 border border-indigo-200/60 dark:border-indigo-900/40",children:H}),i.jsx("span",{className:"text-[11px] font-mono font-semibold px-2 py-0.5 rounded-md bg-blue-50 dark:bg-blue-950/40 text-blue-700 dark:text-blue-400 border border-blue-200/60 dark:border-blue-900/40",children:Y})]})})()]})]}),i.jsx("div",{className:"mb-6",children:i.jsxs("p",{className:"text-base sm:text-lg text-slate-800 font-sans leading-relaxed tracking-normal font-normal",children:['"',G.cleanText,'"']})}),G.vocabulary&&G.vocabulary.length>0&&i.jsxs("div",{className:"pt-4 border-t border-slate-100 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-500 flex items-center gap-1 mr-1",children:[i.jsx(Xk,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"Vocab Mini-Tags:"})]}),G.vocabulary.map((se,re)=>{const H=(y==null?void 0:y.assetId)===G.id&&(y==null?void 0:y.vocab.word)===se.word;return i.jsxs("div",{className:"relative inline-block",children:[i.jsxs("span",{onMouseEnter:()=>v({vocab:se,assetId:G.id}),onMouseLeave:()=>v(null),className:"px-2.5 py-1 rounded-lg bg-slate-100 hover:bg-amber-50 text-slate-700 hover:text-amber-800 border border-slate-200 hover:border-amber-200 text-xs font-mono font-medium transition-all cursor-pointer flex items-center gap-1",children:["#",se.word]}),H&&i.jsxs("div",{className:"absolute bottom-full left-0 mb-2 w-64 p-3 rounded-xl bg-white border border-slate-200 text-slate-900 text-xs shadow-xl z-30 pointer-events-none transition-all animate-in fade-in zoom-in-95",children:[i.jsx("div",{className:"font-bold text-amber-700 font-mono text-sm mb-1",children:se.word}),i.jsx("div",{className:"text-emerald-700 font-medium mb-1.5",children:se.translation}),se.context&&i.jsxs("div",{className:"text-[11px] text-slate-500 italic border-t border-slate-100 pt-1.5 mt-1",children:['"',se.context,'"']})]})]},re)})]}),!z&&e&&i.jsxs("button",{onClick:()=>e(G.cleanText),className:"self-end sm:self-auto px-4 py-2 rounded-full bg-emerald-50 text-emerald-700 border border-emerald-200 hover:bg-emerald-100/80 font-semibold text-xs transition-all shadow-sm flex items-center gap-1.5 cursor-pointer active:scale-95",children:[i.jsx(Xa,{className:"w-3.5 h-3.5 fill-current"}),i.jsx("span",{children:s.cabin.practiceShadowing})]})]}),G.reasoning&&i.jsxs("div",{className:"mt-4 text-[11px] text-slate-400 font-mono border-t border-slate-100 pt-2 flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3 h-3 text-emerald-600"}),i.jsxs("span",{children:[s.cabin.curatorNote," ",G.reasoning]})]})]},G.id)}):i.jsxs(i.Fragment,{children:[i.jsxs("div",{className:"relative group rounded-2xl transition-all duration-300 border bg-white p-6 sm:p-7 shadow-sm hover:shadow-md border-slate-200/90 shadow-slate-100 animate-in fade-in",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pb-4 border-b border-slate-100 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5 text-xs text-slate-600 font-medium",children:[i.jsxs("span",{className:"p-1.5 rounded-lg bg-emerald-50 border border-emerald-200/60 text-emerald-700 flex items-center gap-1.5 font-medium",children:[i.jsx(cn,{className:"w-3.5 h-3.5 animate-pulse text-emerald-600"}),i.jsx("span",{children:U[0].station||"Global Radio Broadcast"})]}),i.jsx("span",{className:"text-slate-300",children:"•"}),i.jsxs("span",{className:"flex items-center gap-1 text-slate-400 font-mono",children:[i.jsx(Eo,{className:"w-3 h-3"}),ee(U[0].createdAt)]})]}),i.jsx("span",{className:"text-[11px] font-mono font-semibold px-2.5 py-1 rounded-full bg-slate-100 text-slate-700 border border-slate-200",children:U[0].targetLanguage||"C1 Global Dialogue"})]}),i.jsx("div",{className:"mb-6",children:i.jsxs("p",{className:"text-base sm:text-lg text-slate-800 font-sans leading-relaxed tracking-normal font-normal",children:['"',U[0].cleanText,'"']})}),U[0].vocabulary&&U[0].vocabulary.length>0&&i.jsxs("div",{className:"pt-4 border-t border-slate-100 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-500 flex items-center gap-1 mr-1",children:[i.jsx(Xk,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"Vocab Mini-Tags:"})]}),U[0].vocabulary.map((G,Z)=>{const z=(y==null?void 0:y.assetId)===U[0].id&&(y==null?void 0:y.vocab.word)===G.word;return i.jsxs("div",{className:"relative inline-block",children:[i.jsxs("span",{onMouseEnter:()=>v({vocab:G,assetId:U[0].id}),onMouseLeave:()=>v(null),className:"px-2.5 py-1 rounded-lg bg-slate-100 hover:bg-amber-50 text-slate-700 hover:text-amber-800 border border-slate-200 hover:border-amber-200 text-xs font-mono font-medium transition-all cursor-pointer flex items-center gap-1",children:["#",G.word]}),z&&i.jsxs("div",{className:"absolute bottom-full left-0 mb-2 w-64 p-3 rounded-xl bg-white border border-slate-200 text-slate-900 text-xs shadow-xl z-30 pointer-events-none transition-all animate-in fade-in zoom-in-95",children:[i.jsx("div",{className:"font-bold text-amber-700 font-mono text-sm mb-1",children:G.
4756word}),i.jsx("div",{className:"text-emerald-700 font-medium mb-1.5",children:G.translation}),G.context&&i.jsxs("div",{className:"text-[11px] text-slate-500 italic border-t border-slate-100 pt-1.5 mt-1",children:['"',G.context,'"']})]})]},Z)})]}),e&&i.jsxs("button",{onClick:()=>e(U[0].cleanText),className:"self-end sm:self-auto px-4 py-2 rounded-full bg-emerald-50 text-emerald-700 border border-emerald-200 hover:bg-emerald-100/80 font-semibold text-xs transition-all shadow-sm flex items-center gap-1.5 cursor-pointer active:scale-95",children:[i.jsx(Xa,{className:"w-3.5 h-3.5 fill-current"}),i.jsx("span",{children:s.cabin.practiceShadowing})]})]}),U[0].reasoning&&i.jsxs("div",{className:"mt-4 text-[11px] text-slate-400 font-mono border-t border-slate-100 pt-2 flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3 h-3 text-emerald-600"}),i.jsxs("span",{children:[s.cabin.curatorNote," ",U[0].reasoning]})]})]}),i.jsxs("div",{className:"relative flex flex-col gap-6 mt-2",children:[i.jsx("div",{className:"flex flex-col gap-6 filter blur-[5px] select-none pointer-events-none opacity-40",children:U.slice(1).map(G=>i.jsxs("div",{className:"relative group rounded-2xl border bg-white p-6 sm:p-7 border-slate-200/80",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 pb-4 border-b border-slate-100 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5 text-xs text-slate-600 font-medium",children:[i.jsxs("span",{className:"p-1.5 rounded-lg bg-emerald-50 border border-emerald-200/60 text-emerald-700 flex items-center gap-1.5 font-medium",children:[i.jsx(cn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:G.station||"Global Radio Broadcast"})]}),i.jsx("span",{className:"text-slate-300",children:"•"}),i.jsxs("span",{className:"flex items-center gap-1 text-slate-400 font-mono",children:[i.jsx(Eo,{className:"w-3 h-3"}),ee(G.createdAt)]})]}),i.jsx("span",{className:"text-[11px] font-mono font-semibold px-2.5 py-1 rounded-full bg-slate-100 text-slate-700 border border-slate-200",children:G.targetLanguage||"C1 Global Dialogue"})]}),i.jsx("div",{className:"mb-6",children:i.jsxs("p",{className:"text-base sm:text-lg text-slate-800 font-sans leading-relaxed tracking-normal font-normal",children:['"',G.cleanText,'"']})}),G.vocabulary&&G.vocabulary.length>0&&i.jsx("div",{className:"pt-4 border-t border-slate-100 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-semibold text-slate-500 flex items-center gap-1 mr-1",children:[i.jsx(Xk,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"Vocab Mini-Tags:"})]}),G.vocabulary.map((Z,z)=>i.jsxs("span",{className:"px-2.5 py-1 rounded-lg bg-slate-100 text-slate-700 border border-slate-200 text-xs font-mono font-medium",children:["#",Z.word]},z))]})}),G.reasoning&&i.jsxs("div",{className:"mt-4 text-[11px] text-slate-400 font-mono border-t border-slate-100 pt-2 flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3 h-3 text-emerald-600"}),i.jsxs("span",{children:[s.cabin.curatorNote," ",G.reasoning]})]})]},G.id))}),i.jsx("div",{className:"absolute inset-0 z-20 flex justify-center pointer-events-none py-10 px-4",children:i.jsxs("div",{className:"sticky top-[15%] max-h-[80vh] max-w-xl w-full pointer-events-auto p-6 md:p-8 rounded-3xl bg-white/95 dark:bg-slate-900 border border-slate-200 dark:border-slate-800 shadow-2xl backdrop-blur-xl flex flex-col items-center text-center overflow-y-auto self-start",children:[i.jsx("div",{className:"p-3.5 bg-gradient-to-br from-amber-500/20 to-emerald-500/20 text-amber-500 dark:text-amber-400 rounded-2xl border border-amber-500/30 mb-2.5 shadow-inner flex items-center justify-center",children:i.jsx(fr,{className:"w-8 h-8 fill-amber-500 text-amber-500 animate-pulse"})}),i.jsx("div",{className:"flex items-center gap-2 mb-2",children:i.jsx("span",{className:"px-3 py-1 rounded-full bg-amber-100 dark:bg-amber-950/60 text-amber-800 dark:text-amber-300 font-mono font-extrabold text-[10px] tracking-wider up
4756percase border border-amber-300/40",children:((ie=s.paywall)==null?void 0:ie.vipPass)||"VIP PASS • UNLIMITED ACCESS"})}),i.jsx("h3",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-slate-100 tracking-tight mb-2 font-display",children:s.cabin.unlockSnippets}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400 max-w-md mb-5 leading-relaxed",children:s.cabin.unlockDesc}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2.5 w-full mb-6 text-left text-xs",children:[i.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-2xl bg-emerald-50/70 dark:bg-emerald-950/30 border border-emerald-200/60 dark:border-emerald-800/40",children:[i.jsx(At,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-slate-900 dark:text-slate-100 block",children:a?"全量广播精华语料":"Daily Broadcast Passages"}),i.jsx("span",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:a?"每日持续抓取全球 50+ 权威原声":"Continuous scraping across 50+ stations"})]})]}),i.jsxs("div",{className:"flex items-start gap-2.5 p-3 rounded-2xl bg-amber-50/70 dark:bg-amber-950/30 border border-amber-200/60 dark:border-amber-800/40",children:[i.jsx(xi,{className:"w-4 h-4 text-amber-600 dark:text-amber-400 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold text-slate-900 dark:text-slate-100 block",children:a?"纯正口语 7.5+ 词汇精注":"Authentic Fluency 7.5+ Vocabulary"}),i.jsx("span",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:a?"高频地道词汇与实战语境解析":"High-frequency native words & authentic context"})]})]})]}),i.jsxs("button",{id:"cabin-upgrade-cta-btn",type:"button",onClick:k,className:"w-full py-3.5 px-6 rounded-2xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-600 hover:from-emerald-500 hover:to-teal-500 text-white font-black text-sm sm:text-base shadow-xl shadow-emerald-600/25 hover:shadow-emerald-600/40 hover:-translate-y-0.5 active:translate-y-0 transition-all flex items-center justify-center gap-2.5 cursor-pointer group",children:[i.jsx(fr,{className:"w-5 h-5 fill-amber-300 text-amber-300 group-hover:rotate-12 transition-transform"}),i.jsx("span",{children:a?"立即开通 / 升级 PRO 会员":"Upgrade to PRO Membership"}),i.jsx(qr,{className:"w-4 h-4 group-hover:translate-x-1 transition-transform"})]}),i.jsxs("div",{className:"flex items-center gap-3 text-[11px] text-slate-500 dark:text-slate-400 mt-3.5 font-medium",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),a?"支持微信支付 · 随时取消":"Instant Activation · Cancel Anytime"]}),i.jsx("span",{children:"•"}),i.jsx("span",{children:a?"开通即享无限次同传模考":"Full Access across Devices"})]})]})})]})]})})]})]}),B&&i.jsxs("div",{className:"fixed inset-0 z-50 bg-slate-950/90 backdrop-blur-md overflow-y-auto p-4 sm:p-6 flex flex-col",children:[i.jsxs("div",{className:"max-w-7xl w-full mx-auto flex items-center justify-between pb-4 border-b border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2 text-amber-400 font-bold text-sm font-mono",children:[i.jsx(Q2,{className:"w-4 h-4"}),i.jsx("span",{children:"Pipeline Testbench"})]}),i.jsx("button",{onClick:()=>E(!1),className:"p-2 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-300 transition-all cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})})]}),i.jsx("div",{className:"flex-1 mt-4",children:i.jsx(KFe,{})})]}),i.jsx(Z2,{isOpen:N,onClose:()=>T(!1),user:o,onOpenAuthModal:t,onOpenLegal:r,stats:{wordsCaught:h.length*3,shadowingsDone:10,globalStations:"10,000+"}})]})}const Jee=1,Kw="global_radio_device_uuid",Xee="ai_examiner_completed_sessions";function Zee(){if(typeof window>"u")return"server_device_env";try{let n=localStorage.getItem(Kw);if(!n){const e=document.cookie.match(new RegExp(`(^|; )${Kw}=([^;]*)`));e&&e[2]&&(n=decodeURIComponent(e[2]))}if(!n){const e=typeof screen<"u"?`${screen.width}x${screen.height}x${screen.colorDepth}
4756`:"scr",t=typeof navigator<"u"?navigator.userAgent.slice(0,30).replace(/[^a-zA-Z0-9]/g,""):"ua",r=Math.random().toString(36).substring(2,10)+Math.random().toString(36).substring(2,10);n=`dev_${Date.now().toString(36)}_${e}_${t}_${r}`,localStorage.setItem(Kw,n);try{const a=new Date(Date.now()+63072e6).toUTCString();document.cookie=`${Kw}=${encodeURIComponent(n)}; expires=${a}; path=/; SameSite=Lax`}catch{}}return n}catch(n){return console.warn("Device ID access error:",n),"dev_fallback_local"}}function o5(){if(typeof window>"u")return 0;try{const e=`global_radio_device_examiner_used_${Zee()}`,t=localStorage.getItem(e),r=localStorage.getItem(Xee),s=parseInt(t||"0",10)||0,a=parseInt(r||"0",10)||0;return Math.max(s,a)}catch{return 0}}function YFe(n){if(typeof window>"u")return 1;try{const e=Zee(),t=`global_radio_device_examiner_used_${e}`,r=`global_radio_device_examiner_history_${e}`,a=o5()+1;localStorage.setItem(t,a.toString()),localStorage.setItem(Xee,a.toString());try{const o=localStorage.getItem(r),l=o?JSON.parse(o):[];l.push({timestamp:Date.now(),userId:n||"anonymous",examIndex:a}),localStorage.setItem(r,JSON.stringify(l.slice(-10)))}catch{}return window.dispatchEvent(new Event("examiner-quota-updated")),a}catch{return 1}}function $0(n){return n?!1:o5()>=Jee}function ete(n){if(n)return 1/0;const e=o5();return Math.max(0,Jee-e)}const mT="/assets/radioshadow_app_logo-HYq06EKB.jpg";function sp({activeTrack:n,setActiveTrack:e,viewMode:t,setViewMode:r,onOpenPaywall:s,isAuthModalOpen:a,setIsAuthModalOpen:o,onOpenLegal:l,onOpenTour:c,onOpenEmbed:d,onOpenExaminer:h,forceEnglish:m}){var ye,he;const{user:p,userProfile:x,loading:y,isPro:v,signInWithGoogle:B,signInWithEmail:E,logout:N}=Ji(),{t:T,isZh:k,toggleLanguage:P}=Or(),R=m?!1:k,[_,I]=S.useState(!1),[D,j]=S.useState(!1),[O,M]=S.useState(!1),[U,ee]=S.useState(!1),[ie,G]=S.useState(()=>Eh());S.useEffect(()=>{const le=ce=>{G(ce.detail||Eh())};return window.addEventListener("diagnostic-assessment-updated",le),()=>window.removeEventListener("diagnostic-assessment-updated",le)},[]);const Z=a!==void 0?a:O,z=o||M,[se,re]=S.useState(!1),[H,Y]=S.useState(null),[de,W]=S.useState(""),K=S.useRef(null),J=S.useRef(null);S.useEffect(()=>{const le=Ce=>{K.current&&!K.current.contains(Ce.target)&&I(!1),J.current&&!J.current.contains(Ce.target)&&j(!1)},ce=Ce=>{Ce.key==="Escape"&&(I(!1),j(!1))};return document.addEventListener("mousedown",le),document.addEventListener("keydown",ce),()=>{document.removeEventListener("mousedown",le),document.removeEventListener("keydown",ce)}},[]);const oe=async()=>{var le;try{re(!0),Y(null),await B(),z(!1)}catch(ce){if(console.error("Google login error:",ce),ce.code!=="auth/popup-closed-by-user")if((ce==null?void 0:ce.code)==="auth/unauthorized-domain"||(le=ce==null?void 0:ce.message)!=null&&le.includes("unauthorized-domain")){const Ce=typeof window<"u"?window.location.hostname:"radioshadow.space";Y(R?`当前域名 (${Ce}) 尚未在 Firebase 授权网域列表中。请前往 Firebase 控制台添加此网域,或使用下方邮箱直接登录。`:`Domain "${Ce}" is not authorized in Firebase. Please add it in Firebase Console -> Authentication -> Settings -> Authorized domains, or use Email sign-in.`)}else Y(R?(ce==null?void 0:ce.message)||"Google 登录失败,请稍后重试。":(ce==null?void 0:ce.message)||"Google sign in failed. Please try again.")}finally{re(!1)}},Ie=async le=>{var ce;if(le&&le.preventDefault(),!de.trim()||!de.includes("@")){Y(R?"请输入有效的电子邮箱地址。":"Please enter a valid email address.");return}try{re(!0),Y(null),await E(de.trim()),z(!1)}catch(Ce){console.error("Email sign in error:",Ce),(Ce==null?void 0:Ce.code)==="auth/operation-not-allowed"||(ce=Ce==null?void 0:Ce.message)!=null&&ce.includes("disabled")?(Y(R?"邮箱登录暂未开启,正在自动切换至 Google 快捷登录...":"Email login is disabled on this project. Switching to Google Sign-In..."),setTimeout(()=>{oe()},1e3)):Y(R?"邮箱登录失败,请重试。":(Ce==null?void 0:Ce.message)||"Email Sign-In error. Please try again.")}finally{re(!1)}},pe=async()=>{try{I(!1),await N()}catch(le){console.error("Logout error:",le)}};return i.jsxs(i.Fragment,{children:[i.jsx("header",{className:"sticky top-0 z-40 w-full bg-white/95 dar
4756k:bg-slate-950/95 backdrop-blur-md border-b border-slate-200/80 dark:border-slate-800/80 transition-all shadow-2xs",children:i.jsxs("div",{className:"w-full max-w-7xl mx-auto px-3 sm:px-4 md:px-5 py-2.5 flex items-center justify-between gap-2 sm:gap-3 min-h-[58px]",children:[i.jsx("div",{className:"flex items-center gap-2.5 shrink-0",children:i.jsxs("a",{href:"/",className:"flex items-center gap-2.5 group",children:[U?i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-500/10 dark:bg-emerald-500/20 border border-emerald-500/30 flex items-center justify-center text-emerald-600 dark:text-emerald-400 shadow-md shadow-emerald-500/10 group-hover:scale-105 transition-transform shrink-0",children:i.jsx(cn,{className:"w-5 h-5"})}):i.jsx("img",{src:mT,alt:"RadioShadow AI Logo",width:40,height:40,fetchPriority:"high",decoding:"async",onError:()=>ee(!0),className:"w-10 h-10 rounded-2xl object-cover shadow-md shadow-emerald-500/20 ring-1 ring-emerald-500/30 group-hover:scale-105 transition-transform shrink-0"}),i.jsxs("div",{className:"shrink-0",children:[i.jsx("h1",{className:"font-display font-bold text-base sm:text-lg text-slate-900 dark:text-slate-100 flex items-center leading-tight",children:i.jsx("span",{children:T.common.appName})}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 truncate max-w-[180px] xl:max-w-xs hidden xl:block",children:T.common.tagline})]})]})}),i.jsxs("div",{className:"flex-1 flex items-center justify-center gap-1.5 sm:gap-2.5 min-w-0 py-0.5",children:[i.jsxs("div",{className:"bg-slate-200/70 dark:bg-slate-900 p-1 rounded-2xl flex items-center gap-1 border border-slate-300/40 dark:border-slate-800 shadow-inner shrink-0 h-9",children:[i.jsxs("button",{id:"header-track-live-btn",onClick:()=>{if(typeof window<"u"&&(localStorage.setItem("ai_word_active_track","live"),window.location.pathname!=="/"&&window.location.pathname!=="")){window.location.href="/?track=live";return}e("live")},className:`h-7 px-2.5 sm:px-3 rounded-xl text-xs font-bold transition-all duration-200 flex items-center gap-1.5 cursor-pointer shrink-0 ${n==="live"?"bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-100 shadow-md border border-slate-200/50 dark:border-slate-700/50":"text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,title:R?"实时电台同传跟读":"Live Radio Stream & Real-time Shadowing",children:[i.jsx("div",{className:"w-2 h-2 rounded-full bg-emerald-500 animate-pulse shrink-0"}),i.jsx("span",{className:"whitespace-nowrap",children:R?"实时电台":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"hidden sm:inline",children:"Live Stream"}),i.jsx("span",{className:"sm:hidden",children:"Live"})]})})]}),i.jsxs("button",{id:"header-track-pro-btn",onClick:()=>{if(typeof window<"u"&&(localStorage.setItem("ai_word_active_track","pro"),window.location.pathname!=="/"&&window.location.pathname!=="")){window.location.href="/?track=pro";return}e("pro")},className:`h-7 px-2.5 sm:px-3 rounded-xl text-xs font-bold transition-all duration-200 flex items-center gap-1.5 cursor-pointer shrink-0 ${n==="pro"?"bg-white dark:bg-slate-800 text-slate-900 dark:text-slate-100 shadow-md border border-slate-200/50 dark:border-slate-700/50":"text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,title:R?"PRO 精选名篇研修舱":"PRO Curated Study Cabin",children:[i.jsx(fr,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),i.jsx("span",{className:"whitespace-nowrap",children:R?"精选名篇":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"hidden sm:inline",children:"PRO Cabin"}),i.jsx("span",{className:"sm:hidden",children:"PRO"})]})}),i.jsx("span",{className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 text-[9px] font-extrabold px-1.5 py-0.5 rounded-md uppercase tracking-wider hidden sm:inline-block",children:T.common.pro})]}),r&&i.jsxs("button",{id:"header-mode-immersion-btn",onClick:()=>{r("immersion")},className:`h-7 px-2 sm:px-2.5 rounded-xl text-xs font-bold transition-all duration-200 hidden lg:flex items-center gap-1.5 cursor-pointer shrink-0 ${t==="immersion"?"bg-emerald-600 text-white shadow-md border border-emerald-500":"text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,title:R?"沉浸泛听 0 Token 模式":"Immersion Mode (0 Token)",children:[i.jsx(Er,{className:"w-3.5 h-3.5 text-emerald-400 shrink-0"}),i.jsx("span",{className:"whitespace-nowrap",children:R?"沉浸泛听":"Immersion"})]})]}),i.jsxs("div",{className:"hidden md:flex items-center gap-1 bg-slate-100/80 dark:bg-slate-900/80 p-1 rounded-2xl border border-slate-200/60 dark:border-slate-800 shrink-0 h-9",children:[i.jsxs("a",{href:"/blog",className:"h-7 text-xs font-semibold text-slate-600 hover:text-slate-900 dark:text-slate-300 dark:hover:text-slate-100 transition-colors flex items-center gap-1.5 px-2.5 rounded-xl hover:bg-white dark:hover:bg-slate-800 shrink-0",title:T.header.articlesTitle,children:[i.jsx(Ys,{className:"w-3.5 h-3.5 text-emerald-600 shrink-0"}),i.jsx("span",{className:"whitespace-nowrap",children:T.header.articles})]}),i.jsxs("a",{id:"header-open-examiner-btn",href:"/ielts-speaking-mock-test",onClick:le=>{h&&(le.preventDefault(),h())},className:"h-7 text-xs font-bold text-emerald-800 dark:text-emerald-200 bg-gradient-to-r from-emerald-500/15 to-teal-500/15 hover:from-emerald-500/25 hover:to-teal-500/25 transition-all flex items-center gap-1.5 px-2.5 rounded-xl border border-emerald-500/30 cursor-pointer active:scale-95 shadow-2xs shrink-0",title:T.header.aiExaminerTitle,children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400 shrink-0"}),i.jsx("span",{className:"whitespace-nowrap",children:R?"考官模考":i.jsxs(i.Fragment,{children:[i.jsx("span",{className:"hidden xl:inline",children:"AI Examiner"}),i.jsx("span",{className:"xl:hidden",children:"IELTS AI"})]})}),!v&&$0(v)&&i.jsx("span",{className:"px-1 py-0.2 rounded text-[8px] font-bold bg-amber-500/20 text-amber-700 dark:text-amber-300 border border-amber-500/30 flex items-center gap-0.5 ml-0.5",children:"PRO"})]})]}),i.jsxs("div",{className:"relative md:hidden shrink-0",ref:J,children:[i.jsxs("button",{onClick:()=>j(!D),className:`h-9 px-2.5 rounded-2xl text-xs font-semibold flex items-center gap-1.5 border transition-all cursor-pointer shadow-2xs ${D?"bg-emerald-50 dark:bg-emerald-950/60 text-emerald-700 dark:text-emerald-300 border-emerald-500/40":"bg-slate-100/80 dark:bg-slate-900/80 text-slate-700 dark:text-slate-300 border-slate-200/60 dark:border-slate-800 hover:bg-white dark:hover:bg-slate-800"}`,title:R?"浏览全部学习功能与专栏":"Explore learning tools & guides",children:[i.jsx(z2,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),i.jsx("span",{className:"whitespace-nowrap",children:R?"探索":"Explore"}),i.jsx(wy,{className:`w-3 h-3 transition-transform duration-200 ${D?"rotate-180 text-emerald-600":"text-slate-400"}`})]}),D&&i.jsxs("div",{className:"absolute left-1/2 -translate-x-1/2 mt-2 w-64 roun
4756ded-2xl bg-white/95 dark:bg-slate-900/95 backdrop-blur-xl border border-slate-200 dark:border-slate-800 shadow-2xl z-50 p-2 text-sm animate-in fade-in zoom-in-95 duration-150",children:[i.jsx("div",{className:"px-3 py-1.5 text-[10px] font-bold tracking-wider uppercase text-slate-400 dark:text-slate-500 border-b border-slate-100 dark:border-slate-800/80 mb-1",children:R?"学习与备考功能":"Learning & Exam Tools"}),i.jsxs("a",{href:"/blog",onClick:()=>j(!1),className:"flex items-center gap-2.5 p-2 rounded-xl hover:bg-slate-100 dark:hover:bg-slate-800/80 transition-colors text-slate-700 dark:text-slate-200",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-emerald-500/10 dark:bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 flex items-center justify-center shrink-0",children:i.jsx(Ys,{className:"w-4 h-4"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsx("p",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 leading-tight",children:T.header.articles}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500 truncate mt-0.5",children:R?"跟读训练技巧与学习专栏":"Shadowing guides & study methods"})]})]}),i.jsxs("a",{href:"/ielts-speaking-mock-test",onClick:()=>{j(!1)},className:"flex items-center gap-2.5 p-2 rounded-xl hover:bg-slate-100 dark:hover:bg-slate-800/80 transition-colors text-slate-700 dark:text-slate-200",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-teal-500/10 dark:bg-teal-500/20 text-teal-600 dark:text-teal-400 flex items-center justify-center shrink-0",children:i.jsx(yn,{className:"w-4 h-4"})}),i.jsxs("div",{className:"min-w-0 flex-1",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("p",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 leading-tight",children:T.header.aiExaminer}),!v&&$0(v)&&i.jsx("span",{className:"px-1.5 py-0.2 rounded text-[8px] font-bold bg-amber-500/20 text-amber-700 dark:text-amber-300 border border-amber-500/30",children:"PRO"})]}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500 truncate mt-0.5",children:R?"雅思口语 1v1 模拟考试与评分":"IELTS Speaking 1v1 mock & band score"})]})]})]})]})]}),i.jsxs("div",{className:"flex items-center justify-end gap-2 shrink-0",children:[i.jsxs("button",{id:"header-language-toggle-btn",onClick:P,className:"h-9 text-xs font-bold text-slate-700 dark:text-slate-200 hover:text-emerald-600 dark:hover:text-emerald-400 transition-all flex items-center gap-1.5 px-3 rounded-2xl bg-slate-100/80 dark:bg-slate-900/80 hover:bg-white dark:hover:bg-slate-800 cursor-pointer shadow-2xs border border-slate-200/60 dark:border-slate-800 active:scale-95 shrink-0",title:T.header.switchLanguage,children:[i.jsx(bg,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400 shrink-0"}),i.jsx("span",{className:"whitespace-nowrap",children:R?"English":"中文"})]}),y?i.jsx("div",{className:"h-9 w-20 rounded-xl bg-slate-200/60 dark:bg-slate-800/60 animate-pulse shrink-0"}):p?i.jsxs("div",{className:"relative shrink-0 flex items-center h-9",ref:K,children:[i.jsxs("button",{onClick:()=>I(!_),className:"flex items-center gap-1.5 px-2 h-9 rounded-full hover:bg-slate-100 dark:hover:bg-slate-800/80 transition-colors border border-slate-200/80 dark:border-slate-800/80 cursor-pointer shrink-0",children:[p.photoURL||x!=null&&x.photoURL?i.jsx("img",{src:p.photoURL||(x==null?void 0:x.photoURL)||"",alt:p.displayName||(x==null?void 0:x.displayName)||"User Profile",className:"w-6.5 h-6.5 rounded-full object-cover ring-2 ring-emerald-500/20 shrink-0",referrerPolicy:"no-referrer"}):i.jsx("div",{className:"w-6.5 h-6.5 rounded-full bg-emerald-600 text-white font-bold flex items-center justify-center text-xs shrink-0",children:((he=(ye=p.displayName||(x==null?void 0:x.displayName)||p.email)==null?void 0:ye[0])==null?void 0:he.toUpperCase())||"U"}),v?i.jsx("span",{className:"bg-amber-100 text-amber-700 dark:bg-amber-950/80 dark:text-amber-400 text-[10px] px-1.5 py-0.5 rounded-full font-bold border border-amber-300/40",children:T.common.pro}):i.jsx("span",{className:"bg-slate-100 text-slate-500 dark:bg-slate-800 dark:text-slate-400 text-[10px] px-1.5 py-0.5 rounded-full font-medium",children:T.common.free})]}),_&&i.jsxs("div",{className:"absolute right-0 mt-2 w-60 rounded-2xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 shadow-2xl z-50 p-2.5 text-sm text-slate-700 dark:text-slate-200",children:[i.jsxs("div",{className:"px-3 py-2 border-b border-slate-100 dar
4756k:border-slate-800",children:[i.jsxs("p",{className:"font-semibold text-slate-900 dark:text-slate-100 truncate flex items-center gap-1.5",children:[i.jsx(wc,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:p.displayName||(x==null?void 0:x.displayName)||"User Account"})]}),i.jsx("p",{className:"text-xs text-slate-400 truncate mt-0.5",children:p.email})]}),i.jsxs("a",{href:"/dashboard",className:"w-full text-left px-3 py-2 my-1 rounded-xl text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800 flex items-center gap-2 transition-all cursor-pointer font-medium",children:[i.jsx(wc,{className:"w-4 h-4 text-slate-400"}),i.jsx("span",{children:T.common.userDashboard})]}),c&&i.jsxs("button",{onClick:()=>{I(!1),c()},className:"w-full text-left px-3 py-2 my-1 rounded-xl text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800 flex items-center justify-between transition-all cursor-pointer font-medium",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(At,{className:"w-4 h-4 text-amber-500"}),i.jsx("span",{children:R?"亚瑟博士声学定级":"Dr. Arthur's Diagnostic"})]}),ie?i.jsx("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 px-1.5 py-0.5 rounded",children:ie.levelTag}):i.jsx("span",{className:"text-[10px] font-bold text-emerald-600 dark:text-emerald-400 bg-emerald-500/10 px-1.5 py-0.5 rounded",children:R?"首测免费":"Free"})]}),i.jsxs("a",{href:"/ielts-speaking-mock-test",onClick:()=>{I(!1)},className:"w-full text-left px-3 py-2 my-1 rounded-xl text-slate-700 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800 flex items-center justify-between transition-all cursor-pointer font-medium",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(yn,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:T.header.aiExaminer})]}),!v&&$0(v)&&i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-amber-500/20 text-amber-700 dark:text-amber-300",children:"PRO"})]}),i.jsxs("div",{className:"py-2 px-3 flex items-center justify-between text-xs text-slate-500 dark:text-slate-400 border-t border-slate-100 dark:border-slate-800 mt-1 pt-2",children:[i.jsx("span",{children:T.common.membership}),i.jsx("span",{className:`font-bold ${v?"text-amber-600 dark:text-amber-400":"text-slate-500"}`,children:v?T.common.proUnlimited:T.common.freePreview})]}),!v&&i.jsxs("button",{onClick:()=>{I(!1),s&&s()},className:"w-full text-left px-3 py-2 my-1 rounded-xl bg-gradient-to-r from-amber-500/15 to-amber-600/15 hover:from-amber-500/25 hover:to-amber-600/25 text-amber-700 dark:text-amber-400 font-bold flex items-center gap-2 transition-all cursor-pointer border border-amber-200/50 dark:border-amber-500/30",children:[i.jsx(At,{className:"w-4 h-4 text-amber-500"}),i.jsx("span",{children:T.common.upgradeToPro})]}),i.jsxs("a",{id:"header-contact-support-link",href:"mailto:[email protected]?subject=RadioShadow%20User%20Support",onClick:()=>I(!1),className:"w-full text-left px-3 py-2 rounded-xl text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 flex items-center gap-2 transition-all cursor-pointer text-xs font-medium",children:[i.jsx(Kd,{className:"w-3.5 h-3.5 text-slate-400"}),i.jsx("span",{children:T.common.customerSupport})]}),i.jsxs("button",{onClick:()=>{I(!1),l&&l("terms")},className:"w-full text-left px-3 py-2 rounded-xl text-slate-600 dark:text-slate-400 hover:bg-slate-100 dark:hover:bg-slate-800 flex items-center gap-2 transition-all cursor-pointer text-xs font-medium",children:[i.jsx(BE,{className:"w-3.5 h-3.5 text-slate-400"}),i.jsx("span",{children:T.common.termsAndPrivacy})]}),i.jsx("div",{className:"border-t border-slate-100 dark:border-slate-800 pt-1 mt-1",children:i.jsxs("button",{onClick:pe,className:"w-full text-left px-3 py-2 rounded-xl text-rose-600 dar
4756k:text-rose-400 hover:bg-rose-50 dark:hover:bg-rose-950/30 flex items-center gap-2 transition-colors cursor-pointer font-medium",children:[i.jsx(fS,{className:"w-4 h-4"}),i.jsx("span",{children:T.common.signOut})]})})]})]}):i.jsx("button",{onClick:()=>z(!0),className:"h-9 px-3.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-semibold text-xs shadow-md shadow-emerald-600/20 transition-all cursor-pointer flex items-center gap-1.5 shrink-0",children:i.jsx("span",{children:T.common.signIn})})]})]})}),Z&&i.jsx("div",{className:"fixed inset-0 z-[60] flex items-center justify-center bg-slate-950/60 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 p-6 max-w-sm w-full relative flex flex-col gap-5",children:[i.jsx("button",{onClick:()=>z(!1),className:"absolute top-4 right-4 text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 transition-colors p-1 rounded-full cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl bg-emerald-50 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400 flex items-center justify-center mx-auto mb-3 border border-emerald-200/50 dark:border-emerald-800/40",children:i.jsx(wc,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-slate-100",children:R?"登录 RadioShadow AI":"Sign in to RadioShadowAI"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:R?"畅享无限实时广播跟读与考级精选电台":"Access unlimited shadowing practice & PRO dictations"})]}),H&&i.jsxs("div",{className:"p-3 bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 text-xs rounded-xl border border-red-200 dark:border-red-900/40 flex flex-col gap-1.5",children:[i.jsx("span",{children:H}),H.includes("Google")&&i.jsx("button",{type:"button",onClick:oe,className:"text-xs font-bold text-emerald-600 dark:text-emerald-400 underline hover:text-emerald-700 text-left cursor-pointer mt-1",children:R?"点击此处使用 Google 账号登录 →":"Click here to sign in with Google →"})]}),i.jsx("div",{className:"flex flex-col gap-2.5",children:i.jsxs("button",{type:"button",onClick:oe,disabled:se,className:"w-full py-3 px-4 rounded-xl bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700/80 text-slate-800 dark:text-slate-100 font-bold text-sm border border-slate-200 dark:border-slate-700 shadow-sm transition-all flex items-center justify-center gap-3 cursor-pointer active:scale-95 disabled:opacity-60",children:[i.jsxs("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),i.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),i.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),i.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),i.jsx("span",{children:R?"使用 Google 账号继续":"Continue with Google"})]})}),i.jsxs("div",{className:"relative flex items-center justify-center my-1",children:[i.jsx("div",{className:"border-t border-slate-200 dark:border-slate-800 w-full"}),i.jsx("span",{className:"bg-white dark:bg-slate-900 px-3 text-[10px] text-slate-400 font-medium uppercase absolute",children:R?"或通过邮箱":"or email"})]}),i.jsxs("form",{onSubmit:Ie,className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Kd,{className:"h-4 w-4 text-slate-400"})}),i.jsx("input",{type:"email",required:!0,placeholder:R?"输入您的电子邮箱地址":"Enter your email address",value:de,onChange:le=>W(le.target.value),className:"block w-full pl-10 pr-3 py-3 border border-slate-300 dark:border-slate-700 rounded-xl leading-5 bg-white dark:bg-slate-800 placeholder-slate-400 text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 sm:text-sm transition-all"})]}),i.jsx("button",{type:"submit",disabled:se||!de,className:"w-full py-3 px-4 roun
4756ded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-md shadow-emerald-600/20 transition-all flex items-center justify-center gap-2 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",children:se?i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin"}),R?"正在登录...":"Signing in..."]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{children:R?"使用邮箱继续":"Continue with Email"}),i.jsx(qr,{className:"w-4 h-4"})]})})]}),i.jsx("div",{className:"pt-2 border-t border-slate-100 dark:border-slate-800/80 text-center",children:i.jsxs("p",{className:"text-[11px] text-slate-400 dark:text-slate-500 leading-relaxed",children:[R?"登录即代表您已同意我们的 ":"By signing in, you agree to our ",i.jsx("button",{type:"button",onClick:()=>{l&&l("terms")},className:"underline hover:text-emerald-600 dark:hover:text-emerald-400 font-medium cursor-pointer",children:T.legal.termsTitle})," ",R?"和 ":"and ",i.jsx("button",{type:"button",onClick:()=>{l&&l("privacy")},className:"underline hover:text-emerald-600 dark:hover:text-emerald-400 font-medium cursor-pointer",children:T.legal.privacyTitle}),"."]})})]})})]})}function l5({isOpen:n,initialTab:e="terms",onClose:t}){const[r,s]=S.useState(e);return n?i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/70 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 max-w-2xl w-full max-h-[85vh] flex flex-col relative overflow-hidden",children:[i.jsxs("div",{className:"p-5 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-slate-50/50 dark:bg-slate-900/50",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>s("terms"),className:`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 cursor-pointer ${r==="terms"?"bg-emerald-600 text-white shadow-md shadow-emerald-600/20":"bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:[i.jsx(BE,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Terms of Service"})]}),i.jsxs("button",{onClick:()=>s("privacy"),className:`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 cursor-pointer ${r==="privacy"?"bg-emerald-600 text-white shadow-md shadow-emerald-600/20":"bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:[i.jsx(sl,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Privacy Policy"})]})]}),i.jsx("button",{onClick:t,className:"p-2 rounded-full text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer","aria-label":"Close legal modal",children:i.jsx(Ts,{className:"w-5 h-5"})})]}),i.jsx("div",{className:"p-6 overflow-y-auto custom-scrollbar text-slate-700 dark:text-slate-300 text-xs sm:text-sm leading-relaxed space-y-5",children:r==="terms"?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"border-b border-slate-100 dark:border-slate-800 pb-3",children:[i.jsxs("h2",{className:"text-lg font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[i.jsx(BE,{className:"w-5 h-5 text-emerald-500"}),i.jsx("span",{children:"Terms of Service"})]}),i.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Last Updated: August 2026"})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"1. Acceptance of Terms"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:'By accessing or using Global Radio Shadowing SaaS ("AIWord", "Service"), provided by our platform, you agree to be bound by these Terms of Service. If you do not agree with any part of these terms, you may not access or use the Service.'})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"2. Description of Service"}
vendor: 4,272 bytes, line 4756
4756),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"Global Radio Shadowing SaaS provides AI-powered real-time radio broadcast streaming, instant multilingual transcription, pronunciation evaluation, and curated vocabulary shadowing tools."})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"3. User Accounts & PRO Subscriptions"}),i.jsxs("ul",{className:"list-disc pl-5 space-y-1 text-slate-600 dark:text-slate-400",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Free Tier:"})," Free accounts receive daily trial quotas for shadowing practice and stream listening."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"PRO Membership:"})," Paid PRO subscriptions unlock unlimited streaming, advanced IELTS 7.0+ / Business dictionaries, and instant AI phonetic diagnostics."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Billing & Renewals:"})," Payments are processed via PayPal or credit card. Subscriptions renew annually or monthly based on selected plans unless cancelled prior to renewal."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Refund Policy:"})," We offer a 30-day money-back guarantee for initial PRO purchases. Contact support within 30 days if you are unsatisfied."]})]})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"4. AI Processing & Audio Data Usage"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"Audio recordings captured during your shadowing exercises are temporarily transmitted to secure AI evaluation endpoints (powered by Gemini AI) exclusively to calculate pronunciation scores and phonetic feedback. Audio streams are not used to train public machine learning models."})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"5. Intellectual Property"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"All software, UI design, curated vocabulary collections, and branding belong exclusively to Global Radio Shadowing SaaS. Radio broadcast content is streamed via public broadcast feeds for educational language acquisition under fair use principles."})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"6. Limitation of Liability"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:'The Service is provided "as is" without warranty of any kind. We are not liable for third-party radio feed interruptions, network latency, or external streaming server downtime.'})]})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"border-b border-slate-100 dark:border-slate-800 pb-3",children:[i.jsxs("h2",{className:"text-lg font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[i.jsx(sl,{className:"w-5 h-5 text-emerald-500"}),i.jsx("span",{children:"Privacy Policy"})]}),i.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"Last Updated: August 2026"})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"1. Information We Collect"}),i.jsxs("ul",{className:"list-disc pl-5 space-y-1 text-slate-600 dark:text-slate-400",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Account Information:"})," Email address, name, profile picture (via Google Auth or direct email login)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Usage Data:"})," Shadowing practice counts, saved vocabulary bookmarks, and station preferences."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Audio Input:"})," Temporary voice recordings submitted when you hold the microphone for shadowing scoring."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Technical Logs:"})," IP address, device type, and browser user agent for diagnostic and security purposes."]})]})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"2. How We Use Your Information"}
4756),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"We use your personal data solely to provide, personalize, and improve your language learning experience:"}),i.jsxs("ul",{className:"list-disc pl-5 space-y-1 text-slate-600 dark:text-slate-400",children:[i.jsx("li",{children:"To authenticate user sign-ins and synchronize PRO subscription statuses across devices via Firebase."}),i.jsx("li",{children:"To analyze your shadowing recordings and output real-time pronunciation radar metrics."}),i.jsx("li",{children:"To process subscription payments securely via encrypted PayPal gateways."})]})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"3. Data Sharing & Third-Party Processors"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"We do NOT sell, rent, or trade your personal information. We share data only with essential cloud infrastructure providers:"}),i.jsxs("ul",{className:"list-disc pl-5 space-y-1 text-slate-600 dark:text-slate-400",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Google Firebase:"})," User authentication & secure cloud document storage."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"PayPal:"})," Encrypted payment processing (we never store raw credit card numbers)."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"Google Gemini AI:"})," Server-side voice speech-to-text evaluation."]})]})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"4. Data Security & Storage"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"All communications between your browser and our servers are encrypted using TLS/SSL. Your user data in Firestore is protected by strict security rules and server-side authorization checks."})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"5. Your Rights & Account Deletion"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-400",children:"You have the right to inspect, modify, or delete your account data at any time through the User Dashboard or by contacting support."})]}),i.jsxs("section",{className:"space-y-1.5",children:[i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-200 text-sm",children:"6. Contact Us"}),i.jsxs("p",{className:"text-slate-600 dark:text-slate-400",children:["If you have any questions regarding these legal terms or privacy practices, please contact us at ",i.jsx("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:"[email protected]"}),"."]})]})]})}),i.jsxs("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900/80 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-slate-400",children:[i.jsx(rl,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:"Encrypted & Compliant with GDPR / CCPA"})]}),i.jsx("button",{onClick:t,className:"px-5 py-2 bg-slate-800 dark:bg-slate-100 hover:bg-slate-700 dark:hover:bg-white text-white dark:text-slate-900 font-bold text-xs rounded-xl transition-all cursor-pointer",children:"I Understand & Agree"})]})]})}):null}const If={es:{code:"es",languageName:"Spanish",nativeName:"Español",flagEmoji:"🇪🇸",frameworkName:"DELE / SIELE Oral Standard (Instituto Cervantes & RTVE)",examinerPersona:{name:"Prof. Mateo Valero",title:"Evaluador Acreditado DELE / SIELE & Fonetista de Radio",institution:"Instituto Cervantes & RTVE Radiodifusión",accentStandard:"Castellano Estándar & Español Neutro Internacional",defaultVoice:"Charon",greetingPattern:"¡Buenos días! Soy el profesor Mateo Valero. Bienvenido a nuestra sesión de entrenamiento y debate oral en español. ¿Podrías confirmar tu nombre y resumir brevemente tu trayectoria con el idioma?"},scoreScale:"Escala DELE B1-C2 / SIELE 0-1000 (Mapeo Band 0.0 - 9.0)",scoreRangeDescription:"DELE / SIELE Oral Band Scale (0.0 to 9.0 CEFR Equivalency)",phoneticFocus:["Vibrante alveolar múltiple (/r/ en dígrafo 'rr' o inicio de palabra como 'radio', 'reestructuración') vs vibrante simple (/ɾ/ en 'pero', 'cara')","Alófonos aproximantes sonoros [β], [ð], [É£] para 'b/v', 'd', 'g' en posición intervocálica (evitar oclusiones bruscas)","Ritmo isócrono silábico (Syllable-timed): cada sílaba mantiene duración equivalente, sin reducción a schwa","Acentuación léxica estricta (palabras agudas, llanas, esdrújulas) y control de la curva melódica entonativa","Ausencia de aspiración en oclusivas sordas /p, t, k/ (evitar el golpe de aire espirado del inglés)","Sinalefa y encadenamiento natural de vocales contiguas entre palabras en el flujo del habla"],radarMetrics:[{key:"fluency",metric:"Fluidez y Ritmo Silábico",description:"Continuidad del discurso, ritmo isócrono y enlaces naturales (sinalefas)."}
4756,{key:"lexical",metric:"Riqueza Léxica DELE C1",description:"Precisión terminológica, colocaciones académicas y conectores argumentativos."},{key:"grammar",metric:"Precisión Gramatical & Subjuntivo",description:"Dominio del modo subjuntivo, concordancia de género/número y subordinación."},{key:"phonetics",metric:"Fonética y Vibrantes (r/rr)",description:"Articulación nítida de vibrantes (r/rr), aproximantes [β, ð, ɣ] y vocales puras."},{key:"reasoning",metric:"Argumentación Crítica",description:"Solidez en la refutación, matización de ideas y estructuración del discurso."}],acousticGuidelines:{rhythmModel:"syllable-timed",vowelPurity:"Cinco vocales puras, claras y tensas [a, e, i, o, u] sin diptongación anglosajona ni reducción a schwa [ə].",consonantArticulations:["Vibrante alveolar múltiple /r/: la punta de la lengua vibra 2-3 veces contra los alvéolos sin fricción uvular.","Aproximantes [β, ð, ɣ]: las consonantes b/v, d, g entre vocales no cierran totalmente el canal vocal.","Oclusivas sordas /p, t, k/: articulación seca y limpia, sin soplo de aire aspirado [pʰ, tʰ, kʰ]."],stressRules:["Palabras llanas: terminadas en vocal, -n o -s llevan el acento prosódico en la penúltima sílaba (ej. 'economía', 'dictamen').","Palabras agudas: terminadas en consonante distinta de n o s se acentúan en la última sílaba (ej. 'reloj', 'solar').","Palabras esdrújulas: siempre llevan tilde ortográfica en la antepenúltima sílaba (ej. 'político', 'régimen')."]},commonPhoneticErrors:[{issue:"Falta de vibración en la 'rr'",phoneticSymbol:"/r/ -> [ɹ] / [ɾ]",explanation:"Sustitución de la vibrante múltiple por una aproximante retrofleja inglesa o una vibrante simple demasiado débil."},{issue:"Aspiración en consonantes sordas",phoneticSymbol:"/p, t, k/ -> [pʰ, tʰ, kʰ]",explanation:"Emisión de un soplo de aire excesivo tras p, t, k, delatando acento anglófono."},{issue:"Reducción vocálica a schwa",phoneticSymbol:"/e, o/ -> [ə]",explanation:"Relajación indebida de vocales átonas que deben pronunciarse siempre con timbre puro."},{issue:"Oclusión indebida en d intervocálica",phoneticSymbol:"[d] en vez de [ð]",explanation:"Bloqueo total del aire en lugar de rozamiento suave de los dientes superiores con la punta de la lengua."}],cefrLevels:{c2:"DELE C2 Maestría (C2 Mastery)",c1:"DELE C1 Dominio Operativo Eficaz (C1 Advanced)",b2:"DELE B2 Avanzado (B2 Upper Intermediate)",b1:"DELE B1 Intermedio (B1 Intermediate)",a2:"DELE A2 Plataforma (A2 Elementary)"}},en:{code:"en",languageName:"English",nativeName:"English",flagEmoji:"🇬🇧",frameworkName:"IELTS Speaking Band 7.0+ & Native Intonation",examinerPersona:{name:"Dr. Arthur Sterling",title:"Senior British AI Examiner & Phonetician",institution:"Cambridge English Assessment & BBC Voice",accentStandard:"Standard British / Received Pronunciation (RP)",defaultVoice:"Aoede",greetingPattern:"Good morning. My name is Dr. Arthur Sterling. Welcome to our Spoken English Coaching Session. Could you please confirm your full name, and briefly tell me what you do or study?"},scoreScale:"IELTS Public Band Descriptors 0.0 - 9.0",scoreRangeDescription:"Band 0.0 - 9.0 (IELTS Scale)",phoneticFocus:["Word stress & syllable hierarchy (primary vs secondary stress)","Connected speech (catenation, intrusive /r/, /j/, /w/, and consonant assimilation)","Schwa /ə/ reduction in unstressed grammatical syllables","Pitch range and tonic syllable placement in intonation contours","Dental fricatives /θ/ vs /ð/ and consonant clusters"],radarMetrics:[{key:"fluency",metric:"Fluency & Coherence",description:"Effortless flow, logical connectors and absence of unnatural hesitation."},{key:"lexical",metric:"Lexical Resource",description:"Precision, academic collocations, and idiomatic phrasal mastery."},{key:"grammar",metric:"Grammar Range & Accuracy",description:"Syntactic complexity, subordinate clauses, and modal subtleties."},{key:"phonetics",metric:"Acoustic Delivery",description:"Clear articulation, natural linking, and expressive tonic pitch contours."},{key:"reasoning",metric:"Critical Reasoning",description:"Depth of argument, nuanced counterpoints, and deductive analysis."}],acousticGuidelines:{rhythmModel:"stress-timed",vowelPurity:"Diphthongs with clear gliding transitions; unstressed vowels thoroughly neutralized to schwa /ə/.",consonantArticulations:["Aspirated voiceless plosives [pʰ, tʰ, kʰ] at word and stressed syllable onset.","Clean dental fricatives /θ, ð/ with tongue tip between teeth.","Smooth alveolar sonorant /r/ without rolling or uvular friction."],stressRules:["Major content words re
4756ceive tonic stress; functional auxiliary words reduce to weak forms.","Compound nouns stress the first element; adjective-noun phrases stress the noun.","Shift of stress according to grammatical function (e.g. 'PERmit' noun vs 'perMIT' verb)."]},commonPhoneticErrors:[{issue:"Failure to reduce to schwa",phoneticSymbol:"[ə] -> [æ] / [ɒ]",explanation:"Pronouncing every vowel with full acoustic weight, creating an unnatural staccato rhythm."},{issue:"Dental fricative substitution",phoneticSymbol:"/θ, ð/ -> [s, z] or [t, d]",explanation:"Mispronouncing 'think' as 'sink' or 'that' as 'dat'."},{issue:"Missing consonant clusters",phoneticSymbol:"Cluster simplification",explanation:"Dropping consonants in final clusters such as 'texts' or 'world'."}],cefrLevels:{c2:"IELTS Band 8.5-9.0 (C2 Mastery)",c1:"IELTS Band 7.0-8.0 (C1 Advanced)",b2:"IELTS Band 5.5-6.5 (B2 Upper Intermediate)",b1:"IELTS Band 4.0-5.0 (B1 Intermediate)",a2:"IELTS Band 3.0-3.5 (A2 Elementary)"}},ja:{code:"ja",languageName:"Japanese",nativeName:"日本語",flagEmoji:"🇯🇵",frameworkName:"JLPT N1/N2 & BJT ビジネス日本語口頭コミュニケーション基準",examinerPersona:{name:"松本 賢治 教授 (Prof. Kenji Matsumoto)",title:"日本語教育・音声コミュニケーション上級指導員",institution:"NHK放送用語委員会 & 日本国際教育支援協会",accentStandard:"共通語・東京式アクセント (Standard Tokyo Accent)",defaultVoice:"Kore",greetingPattern:"こんにちは。日本語音声コミュニケーション担当の松本です。本日のスピーキング・セッションへようこそ。まず、お名前と現在の学習目標を簡単にお話しいただけますか?"},scoreScale:"JLPT N1〜N3 / BJT J1+〜J3 評価基準 (0.0 - 9.0 換算)",scoreRangeDescription:"JLPT / BJT Oral Scale (0.0 to 9.0 CEFR Equivalency)",phoneticFocus:["東京式高低アクセント(頭高型・中高型・尾高型・平板型)の正確な核の配置","特殊拍の等時性管理:促音(っ)、長音(ー)、撥音(ん)に各1拍(1モーラ)を厳密に配分","母音の無声化(「です」「ます」の[u]、カ行・サ行・タ行挟み込み母音の脱声)","鼻濁音(が行鼻濁音 [ŋ])と清音・濁音の対立の明確化","待遇表現(丁寧語・尊敬語・謙譲語)の適切な切り替えと自然な文末イントネーション"],radarMetrics:[{key:"fluency",metric:"流暢さ・発話リズム",description:"不自然な言い淀みがなく、文末まで安定したモーラ感覚で発話が持続しているか。"},{key:"lexical",metric:"語彙・敬語運用力",description:"抽象的・ビジネス専門語彙および場面に応じた適切な敬語が使えているか。"},{key:"grammar",metric:"文法構造・助詞の正確さ",description:"「は/が」「に/で」の助詞選択や複文構造(条件節・理由節)の正確性。"},{key:"phonetics",metric:"高低アクセント・拍感覚",description:"東京式ピッチアクセントの正しさ、促音・長音・無声化の遵守。"},{key:"reasoning",metric:"論理展開・要約力",description:"放送ニュースの主旨を正確に把握し、多角的な視点で論拠を提示できているか。"}],acousticGuidelines:{rhythmModel:"mora-timed",vowelPurity:"日本語の基本5母音 [a, i, u, e, o] は口の開きを抑え、テンポよく均一なモーラ長で発音する。",consonantArticulations:["ラ行子音 [ɾ] は英語の/l/や/r/ではなく、歯茎を軽く弾く弾音。","撥音 [ん] は後続音に応じて [m, n, ŋ, ɴ] へ自然に同化させる。","促音 [っ] は完全な声門閉鎖または調音点閉鎖で1拍分の沈黙を確保する。"],stressRules:["強弱ではなく音の高さ(ピッチ)の上下動によって単語の意味を弁別する。","単語内の第1拍と第2拍は必ず音の高さが異なる(高低または低高)。","助词が付いた際にアクセント核が維持されるか下がるかを正確に制御する。"]}
4756,commonPhoneticErrors:[{issue:"促音・長音の拍長不足",phoneticSymbol:"モーラ脱落",explanation:"「きって(切手)」が「きて(来て)」に、「カード」が「カド」に短縮してしまう現象。"},{issue:"英語的な強弱アクセント化",phoneticSymbol:"Stress vs Pitch",explanation:"母音を強く長く発音してしまい、高低アクセントが失われる現象。"},{issue:"母音無声化の未実施",phoneticSymbol:"[u̥] / [i̥]",explanation:"「〜でした」の[i]や「〜ます」の[u]を過剰に有声化し、不自然に聞こえる。"}],cefrLevels:{c2:"JLPT N1+ 上級実務 (C2 Mastery)",c1:"JLPT N1 合格水準 (C1 Advanced)",b2:"JLPT N2 相当 (B2 Upper Intermediate)",b1:"JLPT N3 相当 (B1 Intermediate)",a2:"JLPT N4/N5 相当 (A2 Elementary)"}},fr:{code:"fr",languageName:"French",nativeName:"Français",flagEmoji:"🇫🇷",frameworkName:"DALF C1 / DELF B2 & Standard Phonétique Radio France",examinerPersona:{name:"Prof. Étienne Laurent",title:"Examinateur Agréé DALF C1/C2 & Phonéticien",institution:"France Éducation International & Radio France",accentStandard:"Français Standard International",defaultVoice:"Aoede",greetingPattern:"Bonjour. Je suis le professeur Étienne Laurent. Bienvenue à cette séance d'entraînement oral approfondi. Pourriez-vous vous présenter brièvement et me dire ce qui motive votre perfectionnement en français ?"},scoreScale:"Barème Officiel DALF C1 / TCF Oral (Équivalence 0.0 - 9.0)",scoreRangeDescription:"DALF C1 Oral Scale (0.0 to 9.0 CEFR Equivalency)",phoneticFocus:["Voyelles nasales (/ɑ̃/ dans 'temps', /ɛ̃/ dans 'vin', /ɔ̃/ dans 'bon', /œ̃/ dans 'un') sans résonance consonantique /n/","Liaisons obligatoires, interdites et facultatives, ainsi que l'enchaînement vocalique et consonantique","Consonne fricative uvulaire sonore /ʁ/ (R français guttural) sans trille alvéolaire","Accent tonique fixe sur la dernière syllabe du groupe rythmique","Chute du 'e' caduc et fluidité des groupes de souffle"],radarMetrics:[{key:"fluency",metric:"Fluidité et Débit",description:"Aisance d'élocution, respect des groupes de souffle et naturel du rythme."},{key:"lexical",metric:"Richesse Lexicale DALF",description:"Variété du vocabulaire soutenu, tournures idiomatiques et précision sémantique."},{key:"grammar",metric:"Précision Syntaxique",description:"Complexité des structures, concordance des temps et emploi du subjonctif."},{key:"phonetics",metric:"Phonétique et Liaisons",description:"Clarté des voyelles nasales, R uvulaire et maîtrise des liaisons obligatoires."},{key:"reasoning",metric:"Argumentation Critique",description:"Structure logique du discours, nuance des objections et force de conviction."}],acousticGuidelines:{rhythmModel:"syllable-timed",vowelPurity:"Grande pureté des voyelles antérieures arrondies [y, ø, œ] et nette distinction des nasales.",consonantArticulations:["Le R est uvulaire fricatif [ʁ], produit par un léger frottement du dos de la langue contre la luette.","Les occlusives p, t, k ne sont jamais aspirées en début de mot.","Liaison : consonne muette redevenant sonore devant voyelle (ex: 'les_amis' avec [z])."],stressRules:["Le français ne possède pas d'accent de mot lexical, mais un accent de groupe frappant la dernière syllabe prononcée.","La dernière syllabe d'un groupe de sens s'allonge légèrement en durée musicale.","Intonation montante dans les propositions inachevées, descendante en fin d'assertion."]},commonPhoneticErrors:[{issue:"Prononciation consonantique après voyelle nasale",phoneticSymbol:"/ɑ̃/ -> [an]",explanation:"Prononcer un 'n' distinct après la voyelle nasale au lieu d'abaisser le voile du palais."},{issue:"R roulé sur le bout de la langue",phoneticSymbol:"[r] en lieu de [ʁ]",explanation:"Articuler le R comme en espagnol ou en italien au lieu de la friction uvulaire."},{issue:"Confusion entre /u/ et /y/",phoneticSymbol:"'ou' vs 'u'",explanation:"Prononcer 'tu' comme 'tout', ou 'dessus' comme 'dessous'."}
4756],cefrLevels:{c2:"DALF C2 Maîtrise (C2 Mastery)",c1:"DALF C1 Utilisateur Expérimenté (C1 Advanced)",b2:"DELF B2 Indépendant (B2 Upper Intermediate)",b1:"DELF B1 Seuil (B1 Intermediate)",a2:"DELF A2 Survie (A2 Elementary)"}},zh:{code:"zh",languageName:"Chinese",nativeName:"中文普通话",flagEmoji:"🇨🇳",frameworkName:"国家普通话水平测试 (PSC) 一级标准 & HSK 高等口语",examinerPersona:{name:"张华 教授 (Prof. Hua Zhang)",title:"国家级普通话水平测试员、播音与主持艺术导师",institution:"国家语言文字工作委员会专家库 / 中央广播电视总台语音指导",accentStandard:"标准普通话 (一级甲等规范读音)",defaultVoice:"Fenrir",greetingPattern:"您好!我是本次口语实战的主考导师张华教授。欢迎进入普通话高阶口语思辨训练。请简要介绍一下您的姓名与目前的表达进阶目标。"},scoreScale:"普通话水平测试等级制 (一级甲等/乙等、二级) (0.0 - 9.0 换算)",scoreRangeDescription:"PSC / HSK Speaking Advanced Standard (0.0 - 9.0 Scale)",phoneticFocus:["声调调值准确性:阴平55、阳平35、上声214、去声51的音高走向与饱满度","上声变调(两连上声变阳平、三连上声变调)以及“一”、“不”的规范变调","平翘舌音严格区分(z, c, s 与 zh, ch, sh, r)的成阻与除阻调音部位","前后鼻音韵母对立(-n 舌尖鼻音 vs -ng 舌根鼻音)与吐字归音技巧","轻声与儿化韵的自然度,
4756避免腔调僵硬或方言语调渗入"],radarMetrics:[{key:"fluency",metric:"流利度与自然节奏",description:"吐字归音清晰连贯,语速适中,停连与逻辑重音恰当。"},{key:"lexical",metric:"成语熟语与词汇跨度",description:"书面语与典雅词汇丰富,四字成语与政经专业表达信手拈来。"},{key:"grammar",metric:"句法严谨度与结构",description:"符合现代汉语语法规范,复合句逻辑紧密,无语病与成分残缺。"},{key:"phonetics",metric:"声调准确度与吐字",description:"四声调值标准饱满,平翘舌、前后鼻音泾渭分明,变调规范。"},{key:"reasoning",metric:"思辨深度与逻辑连贯",description:"立论清晰,能从宏观与微观兼顾论述广播核心议题与社会影响。"}],acousticGuidelines:{rhythmModel:"syllable-timed",vowelPurity:"单韵母口形稳定不晃动,复韵母动程完整滑行自然,鼻韵母归音到鼻腔共鸣点到位。",consonantArticulations:["翘舌音 zh, ch, sh 舌尖上翘接触硬腭前部,不得靠前发成平舌 z, c, s。","舌根音 g, k, h 与舌面音 j, q, x 分界清晰,杜绝尖音(如将'精'读为'zing')。","轻声字音高依前字声调而定,音长缩短,力度减轻。"],stressRules:["词语重音多在后字(中重格式),句中重音强调新信息与转折对比词。","语调句末走向表示语气:陈述句降调,疑问句升调,感叹句急降。"]},commonPhoneticErrors:[{issue:"上声(三声)调值不到位",phoneticSymbol:"214 -> 211 / 35",explanation:"三声降得不够深或未扬起,听起来似二声或半三声。"},{issue:"平翘舌音混淆",phoneticSymbol:"zh/ch/sh <-> z/c/s",explanation:"舌尖未上卷到位,导致'知识'与'滋事'、'商业'与'桑叶'不分。"},{issue:"前鼻音与后鼻音混淆",phoneticSymbol:"-n <-> -ng",explanation:"如'人民'与'人名'、'真正'与'针正'归音不到位。"}],cefrLevels:{c2:"PSC 一级甲等 (97分以上 / C2 Mastery)",c1:"PSC 一级乙等 (92-96分 / C1 Advanced)",b2:"PSC 二级甲等 (87-91分 / B2 Upper Intermediate)",b1:"PSC 二级乙等 (80-86分 / B1 Intermediate)",a2:"PSC 三级标准 (A2 Elementary)"}},de:{code:"de",languageName:"German",nativeName:"Deutsch",flagEmoji:"🇩🇪",frameworkName:"Goethe-Zertifikat C1 Phonetik & DLF Standard",examinerPersona:{name:"Dr. Klaus Weber",title:"Senior Goethe-Zertifikat Prüfer & Phonetikdozent",institution:"Goethe-Institut & Deutschlandfunk",accentStandard:"Standarddeutsch (Bühnendeutsch)",defaultVoice:"Charon",greetingPattern:"Guten Tag! Ich bin Dr. Klaus Weber. Willkommen zu unserem professionellen mündlichen Coaching. Könnten Sie sich bitte kurz vorstellen und Ihre Ziele mit der deutschen Sprache erläutern?"},scoreScale:"Goethe-Zertifikat B2/C1 Notenskala (0.0 - 9.0 Äquivalenz)",scoreRangeDescription:"Goethe C1 Oral Scale (0.0 to 9.0 CEFR Equivalency)",phoneticFocus:["Exakte Aussprache der Umlaute (ä, ö, ü) und Diphthonge (ei, au, eu/äu)","Knacklaut (Glottisschlag /ʔ/) vor vokalisch anlautenden Wörtern und Silben","Unterscheidung zwischen Ich-Laut [ç] und Ach-Laut [x]","Auslautverhärtung (b->p, d->t, g->k) am Wort- und Silbenende","Starke Aspiration der stimmlosen Verschlusslaute p, t, k"],radarMetrics:[{key:"fluency",metric:"Flüssigkeit & Sprechtempo",description:"Flüssiger Redefluss ohne unangebrachte Pausen und stockende Suche nach Wörtern."},{key:"lexical",metric:"Wortschatz & Idiomatik",description:"Verwendung gehobener Ausdrücke, Komposita und adäquater Funktionsverbgefüge."},{key:"grammar",metric:"Grammatische Genauigkeit",description:"Verbstellung in Haupt- und Nebensätzen, Kasusrektion und Konjunktiv II."},{key:"phonetics",metric:"Phonetik & Knacklaut",description:"Aussprache von Umlauten, korrekte Reibe- und Verschlusslaute."},{key:"reasoning",metric:"Kritische Argumentation",description:"Schlüssige Begründung komplexer Sachverhalte und Erörterung von Gegenthesen."}],acousticGuidelines:{rhythmModel:"stress-timed",vowelPurity:"Gespannte lange vs. ungespannte kurze Vokale; Vokaleinsatz stets mit Knacklaut.",consonantArticulations:["Ich-Laut [ç] nach vorderen Vokalen (i, e, ä, ö, ü) und Ach-Laut [x] nach hinteren Vokalen (a, o, u).","R-Laut vorwiegend als uvularer Reibelaut oder Vokalisierung zu [ɐ] am Silbenende."],stressRules:["
4756Stammbetonung bei deutschen Wörtern; trennbare Vorsilben sind betont, untrennbare unbetont."]},commonPhoneticErrors:[{issue:"Fehlender Glottisschlag (Knacklaut)",phoneticSymbol:"Fehlendes [ʔ]",explanation:"Zusammenziehen von Wörtern ohne den harten Vokaleinsatz."},{issue:"Umlaut-Entrundung",phoneticSymbol:"ö -> e, ü -> i",explanation:"Falsche Lippenrundung bei Ö und Ü."}],cefrLevels:{c2:"Goethe C2 Großes Deutsches Sprachdiplom",c1:"Goethe-Zertifikat C1",b2:"Goethe-Zertifikat B2",b1:"Goethe-Zertifikat B1",a2:"Goethe-Zertifikat A2"}}};function tte(n="en"){const e=(n||"").toLowerCase().trim();return e==="es"||e.includes("span")||e.includes("españ")||e.includes("castell")||e.includes("dele")||e.includes("siele")?If.es:e==="ja"||e.includes("jap")||e.includes("日本")||e.includes("jlpt")?If.ja:e==="fr"||e.includes("fren")||e.includes("franç")||e.includes("dalf")||e.includes("delf")?If.fr:e==="de"||e.includes("germ")||e.includes("deutsch")||e.includes("goethe")?If.de:e==="zh"||e.includes("chin")||e.includes("中文")||e.includes("普通话")||e.includes("mandarin")||e.includes("hsk")?If.zh:If.en||If.general}const WG="/assets/dr_arthur_intro_1788773748256-Abyk9cCj.jpg",YG="/assets/dr_arthur_cuecard_1788773777954-CBYLrhKr.jpg",QG="/assets/dr_arthur_dialogue_1788773797112-B961_jI2.jpg",JG="/assets/dr_arthur_report_1788773821371-BuN6NXrf.jpg",qy="/assets/ielts_avatar_1788437476791-D4dCQ6cI.jpg",N0="/assets/mateo_valero_intro_1790161817974-B606s3Xx.jpg",QFe="/assets/mateo_valero_dialogue_1790161830149-Gl8Yym0U.jpg",pb="/assets/claire_delacroix_intro_1790161842426-CYhpUCTi.jpg",gb="/assets/kenji_sato_intro_1790161853403-D3qEDZPQ.jpg",xb="/assets/zhang_hua_intro_1790161866753-40DvSxnA.jpg",cc={Spanish:[{id:"es_econ_01",language:"Spanish",topic:"Economía y Mercado Inmobiliario",headline:"El Banco de España Alerta Sobre la Tensión en el Acceso a la Vivienda",stationSource:"Radio Nacional de España (RNE 1)",snippet:"En su último informe de coyuntura macroeconómica, el Banco de España constata que el encarecimiento de los alquileres y la escasez de oferta residencial están asfixiando la emancipación juvenil. La entidad reguladora reclama políticas de estímulo a la oferta, seguridad jurídica para los arrendadores e inversión prioritaria en vivienda social en régimen de alquiler para amortiguar el impacto sobre las rentas más vulnerables.",vocabularyHighlights:["coyuntura macroeconómica","emancipación juvenil","seguridad jurídica","rentas vulnerables"]},{id:"es_climate_02",language:"Spanish",topic:"Sostenibilidad y Recursos Hídricos",headline:"El Estrés Hídrico Obliga a Modernizar el Regadío Agrícola en el Mediterráneo",stationSource:"Cadena SER (Hora 25)",snippet:"Ante la prolongada sequía que azota las cuencas mediterráneas, comunidades de regantes y expertos ambientales debaten la viabilidad del modelo agrícola actual. Mientras los agricultores reclaman dotaciones para acelerar la digitalización de los canales y la desalación marina con energía solar, los colectivos ecologistas exigen poner coto a la sobreexplotación de acuíferos y reorientar los cultivos intensivos.",vocabularyHighlights:["estrés hídrico","desalación marina","sobreexplotación de acuíferos","cultivos intensivos"]},{id:"es_tech_03",language:"Spanish",topic:"Inteligencia Artificial y Educación Superior",headline:"Las Universidades Españolas Diseñan Protocolos Éticos Frente a la IA Generativa",stationSource:"RTVE Radio 5 Información",snippet:"La conferencia de rectores ha presentado una guía marco para integrar las herramientas de inteligencia artificial en las aulas universitarias. Los docentes descartan las prohibiciones unilaterales por considerarlas ineficaces, apostando en su lugar por evaluar el razonamiento crítico, la comprobación rigurosa de fuentes primarias y la capacidad dialéctica del alumnado mediante defensas orales.",vocabularyHighlights:["guía marco","prohibiciones unilaterales","razonamiento crítico","defensas orales"]},{id:"es_transport_04",language:"Spanish",topic:"Movilidad Urbana y Alta Velocidad",headline:"La Competencia Ferroviaria Revoluciona los Hábitos de Desplazamiento en la Península",stationSource:"Onda Cero (La Brújula)",snippet:"La entrada de nuevos operadores en los corredores de alta velocidad ha reducido sensiblemente el precio de los billetes y disparado el número de usuarios frente al transporte aéreo peninsular. Sin embargo, las asociaciones de consumidores advierten de la saturación puntual de las principales estaciones de Madrid y Barcelona y piden garantizar la puntualidad y las conexiones de cercanías.",vocabularyHighlights:["operadores ferroviarios","corredores de alta velocidad","saturación puntual","conexiones de cercanías"]},{id:"es_energy_05",language:"Spanish",topic:"Transición Energética y Almacenamiento",headline:"El Desafío de las Baterías y el Hidrógeno Verde para Descarbonizar la Industria",stationSource:"Caracol Radio / RNE",snippet:"Líderes del sector energético destacan que España e Hispanoamérica cuentan con un potencial eólico y fotovoltaico privilegiado, pero advierten del cuello de botella en las redes de distribución y el almacenamiento masivo. Sin inversiones de calado en bombeo reversible e hidrógeno renovable, buena parte de la generación limpia se ve abocada a cortes técnicos durante los picos de máxima radiación.",vocabularyHighlights:["cuello de botella","almacenamiento masivo","bombeo reversible","cortes técnicos"]}],English:[{id:"en_econ_01",language:"English",topic:"Global Economic Policy",headline:"Central Banks Balance Disinflation Against Sluggish Consumer Spending",stationSource:"BBC World Service",snippet:"In this morning's global finance bulletin, monetary policymakers acknowledged that while headline inflation has visibly cooled, persistent labor market tightness and elevated housing expenditures have created policy friction. Central bankers cautioned that any premature loosening of interest rates risks triggering secondary inflationary impulses, while prolonged tightening threatens to squeeze vulnerable mortgage holders.",vocabularyHighlights:["monetary policymakers","policy friction","secondary inflationary impulses","tightening"]},{id:"en_tech_02",language:"English",topic:"AI Governance & Labor Markets",headline:"Regulatory Frameworks Race Against Rapid Generative AI Deployment in Corporate Workflows",stationSource:"NPR Morning Edition",snippet:"International labor economists convened in Geneva to assess the structural disruption caused by automated cognitive tools. While technological proponents highlight productivity multipliers in administrative sectors, trade unions warn that white-collar junior roles are rapidly being phased out without adequate reskilling safety nets. Regulators are calling for mandatory human-in-the-loop certifications.",vocabularyHighlights:["structural disruption","productivity multipliers","safety nets","human-in-the-loop"]},{id:"en_climate_03",language:"English",topic:"Renewable Energy Transition",headline:"Grid Modernization Bottlenecks Threaten Ambitious Offshore Wind Targets",stationSource:"BBC Radio 4 Today",snippet:"Energy ministries reported that although private capital expenditure into offshore wind turbines reached historic peaks this quarter, sub-surface cabling infrastru
4756cture and legacy regional electrical grids remain severely overloaded. Energy analysts argue that without aggressive state-backed grid reinforcements, gigawatts of zero-emission power will be throttled during peak production hours.",vocabularyHighlights:["capital expenditure","legacy regional grids","state-backed reinforcements","throttled"]}],Japanese:[{id:"ja_tech_01",language:"Japanese",topic:"人口減少社会とデジタル自動化",headline:"自治体DXと生成AI活用:人手不足克服へ向けた実証実験が加速",stationSource:"NHK ラジオ第1 (ニュース解説)",snippet:"全国の地方自治体において、急速に進む生産年齢人口の減少に対応するため、行政手続きや窓口業務への生成AI導入が本格化しています。総務省の有識者会議では、業務効率化による職員の負担軽減を評価する一方、個人情報の厳格な保護やハルシネーション(虚偽回答)の抑止策など、信頼性を担保するガイドラインの策定を急いでいます。",vocabularyHighlights:["生産年齢人口","業務効率化","ハルシネーション","ガイドライン策定"]}
4756,{id:"ja_econ_02",language:"Japanese",topic:"金融政策と物価動向",headline:"日銀の利上げ判断と中小企業の賃上げ持続性をめぐる議論",stationSource:"ラジオNIKKEI (マーケットプレイス)",snippet:"日本銀行による段階的な金融政策の正常化が進む中、為替相場の変動と輸入物価の上昇が内需に与える影響が注視されています。大企業を中心に高水準の賃上げが実現する一方、エネルギー高騰と人件費増の価格転嫁が追いつかない中小零細企業からは、過度な金利上昇への慎重論も根強く聞かれます。",vocabularyHighlights:["金融正常化","価格転嫁","慎重論","内需喚起"]}],French:[{id:"fr_culture_01",language:"French",topic:"Société et Transition Écologique",headline:"Les Zones à Faibles Émissions Face à la Contestation Citoyenne dans les Métropoles",stationSource:"France Info",snippet:"Le déploiement progressif des restrictions de circulation pour les véhicules les plus polluants suscite de vifs débats au sein des agglomérations urbaines. Si les autorités sanitaires rappellent que la pollution atmosphérique reste une cause majeure de mortalité prématurée, les associations d'usagers dénoncent une mesure punitive pour les ménages modestes contraints de vivre en périphérie éloignée.",vocabularyHighlights:["restrictions de circulation","pollution atmosphérique","mesure punitive","ménages modestes"]},{id:"fr_tech_02",language:"French",topic:"Éducation et Souveraineté Numérique",headline:"L'Intégration de l'Intelligence Artificielle au Cœur des Programmes Universitaires",stationSource:"France Inter",snippet:"Les conférences des présidents d'université ont rendu public un guide pratique sur l'encadrement des outils conversationnels dans l'enseignement supérieur. Plutôt que de bannir aveuglément ces technologies, les pédagogues recommandent de renouveler les modalités d'évaluation en privilégiant les oraux critiques, la confrontation de sources et la rigueur méthodologique.",vocabularyHighlights:["enseignement supérieur","bannir aveuglément","modalités d'évaluation","rigueur méthodologique"]}],Chinese:[{id:"zh_econ_01",language:"Chinese",topic:"数字经济与产业绿色转型",headline:"新型电力系统建设加速:绿色算力与清洁能源协同发展",stationSource:"中国之声 (央广新闻)",snippet:"随着国家算力枢纽节点建设深入推进,'东数西算'工程正与中西部丰富的光伏风电资源实现深度融合。发改委专家指出,算力中心作为高耗能基础设施,唯有通过构建跨区域绿电交易机制和先进储能微电网,才能在保障海量数据吞吐需求的同时,实现双碳目标的刚性约束。",vocabularyHighlights:["东数西算","算力枢纽","储能微电网","双碳目标"]},{id:"zh_urban_02",language:"Chinese",topic:"城市更新与银发经济",headline:"老旧小区适老化改造全覆盖:打造包容温情的智慧社区",stationSource:"经济之声 (天天财经)",snippet:"在积极应对人口老龄化国家战略背景下,各地城市更新行动正将重心从大规模拆建转向社区微循环改善。加装电梯、无障碍坡道和物联网居家监护设备的普及,不仅提升了老年群体的生活便利度,也催生了社区助餐、康养照护等规模达万亿级的新消费赛道。",vocabularyHighlights:["适老化改造","城市更新","银发经济","物联网监护"]}],German:[{id:"de_energy_01",language:"German",topic:"Energiewende und Industriestandort",headline:"Industrieverbände Fordern Verlässliche Industriestrompreise zur Sicherung des Standorts",stationSource:"Deutschlandfunk",snippet:"In der aktuellen Debatte um die Wettbewerbsfähigkeit der europäischen Industrie mahnen Wirtschaftsvertreter zügige Entlastungen bei den Netzentgelten an. Während mittelständische Unternehmen auf die Abwanderungsgefahr energieintensiver Produktionszweige verweisen, pochen Verbraucherschützer darauf, dass die Kosten der Netzinstandhaltung nicht einseitig auf Privathaushalte abgewälzt werden dürfen.",vocabularyHighlights:["Wettbewerbsfähigkeit","Netzentgelte","Abwanderungsgefahr","Instandhaltung"]}]};function Wf(n="English"){const e=(n||"").toLowerCase().trim();
4756return e==="es"||e.includes("span")||e.includes("español")||e.includes("castellano")?"Spanish":e==="ja"||e.includes("jap")||e.includes("日本")?"Japanese":e==="fr"||e.includes("fren")||e.includes("franç")?"French":e==="zh"||e.includes("chin")||e.includes("中文")||e.includes("普通话")||e.includes("mandarin")?"Chinese":e==="de"||e.includes("germ")||e.includes("deutsch")?"German":"English"}const XG={Spanish:{intro:N0,cuecard:N0,dialogue:QFe,report:N0,avatar:N0,photographerCredit:"Prof. Mateo Valero (Cervantes & RTVE)"},English:{intro:WG,cuecard:YG,dialogue:QG,report:JG,avatar:qy,photographerCredit:"Dr. Arthur Sterling (Cambridge & BBC)"},Japanese:{intro:gb,cuecard:gb,dialogue:gb,report:gb,avatar:gb,photographerCredit:"Prof. Kenji Sato (NHK & JLPT N1)"},French:{intro:pb,cuecard:pb,dialogue:pb,report:pb,avatar:pb,photographerCredit:"Prof. Claire Delacroix (Sorbonne & Radio France)"},Chinese:{intro:xb,cuecard:xb,dialogue:xb,report:xb,avatar:xb,photographerCredit:"Prof. Zhang Hua (CNR & 国家语委)"},German:{intro:WG,cuecard:YG,dialogue:QG,report:JG,avatar:qy,photographerCredit:"Dr. Wolfgang Becker (Goethe & DLF)"}};function nte(n="English"){const e=Wf(n);return XG[e]||XG.English}const rte="radioshadow_onboarding_completed_v1";function ZG(){if(typeof window>"u")return!0;try{return localStorage.getItem(rte)==="true"}catch{return!1}}function s0(){if(!(typeof window>"u"))try{localStorage.setItem(rte,"true")}catch{}}function ste({isOpen:n,onClose:e,onLaunchBbc:t,onSelectLanguageAndStart:r,onSelectViewMode:s,onSelectTrack:a,onOpenPaywall:o,initialMode:l="welcome",activeLanguageId:c}){var ce,Ce;const{user:d,isPro:h}=Ji(),{isZh:m}=Or(),[p,x]=S.useState("welcome"),[y,v]=S.useState(null),[B,E]=S.useState(null),N=B||c&&((ce=M0.find(Ae=>Ae.id===c))==null?void 0:ce.name)||"Spanish",T=tte(N),k=nte(N),P=T9[Wf(N)]||T9.Spanish,[R,_]=S.useState(!1),[I,D]=S.useState(null),[j,O]=S.useState(null),[M,U]=S.useState(!1),[ee,ie]=S.useState(!1),[G,Z]=S.useState(0),[z,se]=S.useState(null),[re,H]=S.useState(null),Y=S.useRef(null),de=S.useRef([]),W=S.useRef(null),K=S.useRef(null);S.useEffect(()=>{if(!n){R&&Ie();return}const Ae=Eh();if(v(Ae),l==="calibration"){if(x("reading"),!B&&c){const je=M0.find(nt=>nt.id===c);je&&E(je.name)}}else x("welcome"),E(null);D(null),O(null),se(null),H(null)},[n,l,c]),S.useEffect(()=>(R?(Z(0),W.current=setInterval(()=>{Z(Ae=>Ae>=20?(Ie(),20):Ae+1)},1e3)):W.current&&clearInterval(W.current),()=>{W.current&&clearInterval(W.current)}),[R]),S.useEffect(()=>()=>{j&&URL.revokeObjectURL(j)},[j]);const J=()=>{if(!(typeof window>"u"||!("speechSynthesis"in window)))try{window.speechSynthesis.cancel(),U(!0);const Ae=new SpeechSynthesisUtterance(P.nativeSentence);Ae.lang=P.ttsLang,Ae.rate=.92,Ae.pitch=.98;const nt=window.speechSynthesis.getVoices().find(We=>We.lang.toLowerCase().includes(P.ttsLang.toLowerCase())||P.ttsVoiceKeywords.some(dt=>We.name.toLowerCase().includes(dt.toLowerCase())));nt&&(Ae.voice=nt),Ae.onend=()=>U(!1),Ae.onerror=()=>U(!1),window.speechSynthesis.speak(Ae)}catch(Ae){console.warn("Speech synthesis error:",Ae),U(!1)}},oe=async()=>{H(null),se(null),j&&(URL.revokeObjectURL(j),O(null),D(null));try{const Ae=await navigator.mediaDevices.getUserMedia({audio:!0});de.current=[];const je=new MediaRecorder(Ae);je.ondataavailable=nt=>{nt.data.size>0&&de.current.push(nt.data)},je.onstop=()=>{const nt=new Blob(de.current,{type:"audio/webm"}),We=URL.createObjectURL(nt);D(nt),O(We),Ae.getTracks().forEach(dt=>dt.stop())},Y.current=je,je.start(),_(!0)}catch(Ae){console.error("Microphone access error:",Ae),H(m?"未能获取麦克风权限,请允许浏览器使用麦克风,或选择快捷自评定级。":"Microphone access denied. Please grant permission or choose quick benchmark calibration.")}},Ie=()=>{Y.current&&Y.current.state!=="inactive"&&Y.current.stop(),_(!1)},pe=()=>{j&&(K.current||(K.current=new Audio(j),K.current.onended=()=>ie(!1),K.current.onerror=()=>ie(!1)),ee?(K.current.pause(),ie(!1)):(K.current.play(),ie(!0)))},ye=async()=>{x("evaluating"),se(null);try{let Ae=78,je=6.5,nt=B==="Spanish"?"DELE B2":"B2 Upper Intermediate",We=[{metric:m?"流利度":"Fluency",value:78},{metric:m?"准确度":"Accuracy",value:75},{metric:m?"语音语调":"Intonation",value:76},{metric:m?"语调节奏":"Pacing",value:80}],dt=B==="Spanish"?m?"西班牙语音节节奏清晰,连读过渡顺畅。注意个别颤音与元音连缀的饱满度。":"Ritmo silábico natural y buena articulación en las sinalefas. Mantenga la solidez en el acento tónico.":m?"语调自然,意群划分合理。注意词间连读弱读技巧。":"Natural pacing and clear phrasing. Notice the liaison link between phoneme transitions.";if(I)try{const Gt=new FormData;Gt.append("audio",I,"diagnostic_speech.webm"),Gt.append("targetSentence",P.nativeSentence),Gt.append("language",B);const En=await fetch("/api/evaluate",{method:"POST",body:Gt});if(En.ok){const $t=await En.json();$t&&($t.overallScore||$t.estimatedBand)&&(Ae=Number($t.overallScore)||75,je=Number($t.estimatedBand)||6.5,nt=$t.cefrLevel||nt,Array.isArray($t.radarMetrics)&&$t.radarMetrics.length>=3&&(We=$t.radarMetrics),($t.phoneticFeedback||$t.coachingFeedback)&&(dt=$t.phoneticFeedback||$t.coachingFeedback))}}catch(Gt){console.warn("[Onboarding] API evaluation fallback applied:",Gt)}const bt=A9(B,Ae,je,m),Yt={targetLanguage:B,frameworkName:T.frameworkName,examinerPersonaName:T.examinerPersona.name,levelTitle:bt.levelTitle,levelTag:bt.levelTag,plainDescription:bt.plainDescription,estimatedBand:je,overallScore:Ae,cefrLevel:nt,radarMetrics:We,evaluatedAt:new Date().toISOString(),targetSentence:P.nativeSentence,feedback:dt,strengths:bt.strengths,recommendations:bt.recommendations,recommendedStation:bt.recommendedStation,isRetake:!!y};await k9(Yt,d==null?void 0:d.uid),s0(),v(Yt),x("result")}catch(Ae){console.error("Evaluation error:",Ae),se(m?"评估过程出现波动,请重试。":"Evaluation timed out. Please try again."),x("reading")}},he=async Ae=>{x("evaluating");const je=72,nt=6.5,We=A9(B,je,nt,m),dt=B==="Spanish"?"DELE B2":"B2 Upper Intermediate",bt={targetLanguage:B,frameworkName:T.frameworkName,examinerPersonaName:T.examinerPersona.name,levelTitle:We.levelTitle,levelTag:We.levelTag,plainDescription:We.plainDescription,estimatedBand:nt,overallScore:je,cefrLevel:dt,radarMetrics:[{metric:m?"流利度":"Fluency",value:je-2},{metric:m?"准确度":"Accuracy",value:je},{metric:m?"语音语调":"Intonation",value:je+1},{metric:m?"语调节奏":"Pacing",value:je-1}],evaluatedAt:new Date().toISOString(),targetSentence:P.nativeSentence,feedback:m?`基准评测校准成功。坚持收听并跟读 ${We.recommendedStation},将迅速提升母语级语流反射。`:`Benchmark calibrated successfully for ${T.frameworkName}. Regular broadcast shadowing will strengthen continuous phoneme cadence.`,strengths:We.strengths,recommendations:We.recommendations,recommendedStation:We.recommendedStation,isRetake:!!y};await k9(bt,d==null?void 0:d.uid),s0(),v(bt),x("result")},le=()=>{s0(),e(),t&&t()};return n?i.jsx("div",{className:"fixed inset-0 z-[200] flex items-center justify-center p-3 sm:p-4 bg-slate-950/75 backdrop-blur-md animate-in fade-in duration-200",children:i.jsxs(cs.div,{initial:{opacity:0,scale:.96,y:12}
4756,animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:12},transition:{duration:.25,ease:"easeOut"},className:"relative w-full max-w-2xl bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 overflow-hidden flex flex-col max-h-[92vh]",children:[i.jsxs("div",{className:"px-5 py-4 sm:px-6 bg-slate-50/90 dark:bg-slate-900/90 border-b border-slate-200/80 dark:border-slate-800 flex items-center justify-between shrink-0 gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3 min-w-0",children:[i.jsxs("div",{className:"relative shrink-0",children:[i.jsx("img",{src:k.avatar,alt:T.examinerPersona.name,className:"w-10 h-10 rounded-full object-cover ring-2 ring-emerald-500/30 shadow-xs",referrerPolicy:"no-referrer"}),i.jsx("span",{className:"absolute bottom-0 right-0 w-2.5 h-2.5 rounded-full bg-emerald-500 ring-2 ring-white dark:ring-slate-900"})]}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h3",{className:"text-sm font-bold text-slate-900 dark:text-slate-100 truncate",children:p==="reading"?m?"发音基准校准":"Pronunciation Calibration":p==="result"?m?"声学定级结果":"Diagnostic Result":m?"选择你想学的语言":"Choose Your Target Language"}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 truncate flex items-center gap-1.5 mt-0.5",children:[i.jsx("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400",children:p==="welcome"?"Prof. Mateo Valero":T.examinerPersona.name}),i.jsx("span",{className:"text-slate-300 dark:text-slate-700",children:"•"}),i.jsx("span",{children:p==="welcome"?m?"语言陪练与电台导览":"Language Companion & Radio Guide":T.frameworkName})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[y&&p!=="result"&&i.jsx("button",{onClick:()=>x("result"),className:"text-xs font-semibold text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500/10 px-2.5 py-1.5 rounded-lg transition-colors cursor-pointer whitespace-nowrap hidden sm:inline",children:m?"查看上次定级":"View Last Result"}),i.jsx("button",{onClick:()=>{s0(),e()},className:"p-2 rounded-xl text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer","aria-label":"Close modal",children:i.jsx(Ts,{className:"w-5 h-5"})})]})]}),i.jsx("div",{className:"p-5 sm:p-6 overflow-y-auto flex-1 space-y-5",children:i.jsxs(Qo,{mode:"wait",children:[p==="welcome"&&i.jsxs(cs.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-5",children:[i.jsxs("div",{className:"p-4 sm:p-5 rounded-2xl bg-gradient-to-br from-emerald-500/10 via-teal-500/5 to-transparent border border-emerald-500/20 flex flex-col sm:flex-row gap-4 items-start",children:[i.jsxs("div",{className:"relative w-16 h-16 sm:w-20 sm:h-20 rounded-2xl overflow-hidden ring-2 ring-emerald-500/30 shadow-md shrink-0 mx-auto sm:mx-0 bg-emerald-50 dark:bg-emerald-950",children:[i.jsx("img",{src:N0,alt:"Prof. Mateo Valero",className:"w-full h-full object-cover",referrerPolicy:"no-referrer"}),i.jsx("span",{className:"absolute bottom-0 right-0 w-3 h-3 bg-emerald-500 rounded-full border-2 border-white dark:border-slate-900"})]}),i.jsxs("div",{className:"space-y-1.5 flex-1 text-center sm:text-left",children:[i.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 text-[11px] font-bold",children:[i.jsx(At,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:m?"真实广播 · 即点即听":"Authentic Broadcasts • Instant Listening"})]}),i.jsx("h2",{className:"text-base sm:text-lg font-extrabold text-slate-900 dark:text-slate-100 leading-snug",children:m?"你想学习哪门语言?":"What language do you want to learn?"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400 leading-relaxed",children:m?"“您好!我是 Mateo 教授。直接选择你想练习的语言,立刻进入全球真实广播电台边听边跟读!无需强制朗读,随时开启。”":"“Hi! I'm Prof. Mateo. Pick a language below to dive straight into live native airwaves with real-time bilingual subtitles. No mandatory speech tests!”"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs font-bold text-slate-700 dark:text-slate-300 uppercase tracking-wider px-1",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(bg,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:m?"第一步:选择目标语言与考试体系":"Step 1: Choose Your Language & Exam Target"})]}),i.jsx("span",{className:"text-[10px] text-slate-400 dark:text-slate-500 font-normal",children:m?"选择后自动载入电台":"Click to stream native airwaves"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-2.5",children:M0.map(Ae=>{const je=B===Ae.name;return i.jsxs("div",{onClick:()=>{E(Ae.name),s0(),r==null||r(Ae),e()},className:`p-3.5 rounded-xl border text-left transition-all cursor-pointer flex flex-col justify-between group ${je?"bg-emerald-500/15 border-emerald-500 text-emerald-900 dark:text-emerald-100 font-bold ring-2 ring-emerald-500/40 shadow-sm":"bg-white dark:bg-slate-800/80 border-slate-200 dark:border-slate-700 hover:border-emerald-500/60 hover:bg-slate-50 dark:hover:bg-slate-750 text-slate-700 dark:text-slate-300"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-start justify-between gap-1.5 w-full mb-1.5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xl leading-none",children:Ae.flag}),i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold text-slate-900 dark:text-white group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:Ae.name}),i.jsx("div",{className:"text-[10px] text-slate-400 font-medium",children:Ae.nativeName})]})]}),i.jsx("span",{className:`px-1.5 py-0.5 rounded text-[10px] font-bold font-mono border ${Ae.examBadgeClass}`,children:Ae.exam})]}),i.jsx("p",{className:"text-[11px] text-slate-500 dark:text-slate-400 line-clamp-2 leading-tight mb-2",children:Ae.description})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-100 dar
4756k:border-slate-800 text-[11px] font-bold text-emerald-600 dark:text-emerald-400",children:[i.jsx("span",{children:m?"开始收听":"Listen & Shadow"}),i.jsx(qr,{className:"w-3 h-3 group-hover:translate-x-1 transition-transform"})]})]},Ae.id)})})]}),i.jsxs("div",{className:"pt-2 flex flex-col sm:flex-row items-center justify-between gap-3 border-t border-slate-100 dark:border-slate-800",children:[i.jsx("button",{onClick:()=>{s0(),e()},className:"text-xs text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors cursor-pointer order-2 sm:order-1 font-medium",children:m?"跳过导览,直接进首页":"Skip Tour"}),i.jsx("div",{className:"flex items-center gap-3 order-1 sm:order-2",children:i.jsx("span",{className:"text-[11px] text-slate-400 hidden sm:inline",children:m?"选择任意语言卡片即可直接开播":"Select any language card above to start listening"})})]})]},"welcome"),p==="reading"&&i.jsxs(cs.div,{initial:{opacity:0,x:12},animate:{opacity:1,x:0},exit:{opacity:0,x:-12},className:"space-y-5",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("img",{src:k.cuecard,alt:`${T.examinerPersona.name} Listening`,className:"w-12 h-12 rounded-2xl object-cover ring-2 ring-emerald-500/20 shadow-sm shrink-0",referrerPolicy:"no-referrer"}),i.jsxs("div",{className:"p-3.5 rounded-2xl rounded-tl-sm bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-500/20 text-xs sm:text-sm text-slate-800 dark:text-slate-200 leading-relaxed flex-1",children:[i.jsxs("p",{className:"font-bold text-emerald-800 dark:text-emerald-300 mb-1 flex items-center justify-between",children:[i.jsxs("span",{children:[T.examinerPersona.name," · ",T.frameworkName]}),i.jsx("span",{className:"text-[10px] font-mono text-emerald-600 dark:text-emerald-400 font-normal",children:P.sampleStation})]}
4756),i.jsx("p",{children:m?"请清晰朗读下方这段广播级基准句。我会综合分析您的音调节奏、连读连诵与意群流畅度,为您划定官方级权威标准。":"Please read the benchmark broadcast sentence aloud into your microphone. I will analyze your phoneme precision, liaison transitions, and natural cadence."})]})]}),i.jsxs("div",{className:"p-5 rounded-2xl bg-slate-50 dark:bg-slate-800/80 border-2 border-emerald-500/30 dark:border-emerald-500/30 shadow-inner space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-[10px] font-mono font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400 flex items-center gap-1",children:[i.jsx(cn,{className:"w-3 h-3"}),i.jsx("span",{children:m?`${T.languageName} 基准跟读文本`:`${T.languageName} BENCHMARK`})]}),i.jsxs("button",{onClick:J,disabled:M,className:"flex items-center gap-1.5 text-xs font-bold text-emerald-700 dark:text-emerald-300 hover:text-emerald-600 bg-emerald-500/10 hover:bg-emerald-500/20 px-2.5 py-1 rounded-lg transition-colors cursor-pointer",children:[i.jsx(on,{className:`w-3.5 h-3.5 ${M?"animate-pulse text-emerald-500":""}`}),i.jsx("span",{children:M?m?"正在发音示范...":"Examiner Speaking...":m?`听${T.examinerPersona.name.split(" ")[0]}示范`:`Listen to ${T.examinerPersona.name.split(" ")[0]}`})]})]}),i.jsxs("p",{className:"text-base sm:text-lg font-medium text-slate-900 dark:text-slate-100 leading-relaxed select-text font-serif",children:['"',P.nativeSentence,'"']}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 italic",children:m?`(参考释义:${P.chineseTranslation})`:`(Translation: ${P.englishTranslation})`})]}),re&&i.jsxs("div",{className:"p-3 rounded-xl bg-rose-50 dark:bg-rose-950/40 border border-rose-300 text-rose-700 dark:text-rose-300 text-xs flex items-center gap-2",children:[i.jsx(Qa,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:re})]}),i.jsx("div",{className:"p-5 rounded-2xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 flex flex-col items-center justify-center gap-3",children:R?i.jsxs("div",{className:"flex flex-col items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-rose-600 dar
4756k:text-rose-400 font-mono text-sm font-bold animate-pulse",children:[i.jsx("span",{className:"w-3 h-3 rounded-full bg-rose-600"}),i.jsx("span",{children:m?`正在录音 (${G}s / 20s)`:`Recording (${G}s / 20s)`})]}),i.jsx("div",{className:"flex items-center gap-1 h-6",children:[12,24,16,28,20,14,26,18,24,15].map((Ae,je)=>i.jsx("span",{className:"w-1 bg-emerald-500 rounded-full animate-bounce",style:{height:`${Ae}px`,animationDelay:`${je*80}ms`}},je))}),i.jsxs("button",{onClick:Ie,className:"px-6 py-2.5 rounded-full bg-rose-600 hover:bg-rose-500 text-white font-bold text-xs shadow-lg shadow-rose-600/30 flex items-center gap-2 cursor-pointer transition-transform active:scale-95",children:[i.jsx(Ev,{className:"w-3.5 h-3.5 fill-current"}),i.jsx("span",{children:m?"完成朗读":"Done Reading"})]})]}):I?i.jsxs("div",{className:"w-full flex flex-col sm:flex-row items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:pe,className:"px-4 py-2 rounded-xl bg-slate-100 dark:bg-slate-700 hover:bg-slate-200 text-slate-800 dark:text-slate-200 text-xs font-bold flex items-center gap-1.5 cursor-pointer",children:[i.jsx(Xa,{className:`w-3.5 h-3.5 ${ee?"text-emerald-500":""}`}),i.jsx("span",{children:ee?m?"正在回放...":"Playing...":m?"试听录音":"Play Recording"})]}),i.jsxs("button",{onClick:oe,className:"px-3 py-2 rounded-xl text-slate-500 hover:text-slate-800 dark:hover:text-slate-200 text-xs font-semibold flex items-center gap-1 cursor-pointer",children:[i.jsx(yg,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:m?"重新录制":"Re-record"})]})]}),i.jsxs("button",{onClick:ye,className:"w-full sm:w-auto px-6 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs shadow-md shadow-emerald-500/20 flex items-center justify-center gap-2 cursor-pointer transition-transform active:scale-95",children:[i.jsx(yn,{className:"w-4 h-4"}),i.jsx("span",{children:m?`提交 ${T.examinerPersona.name.split(" ")[0]} 定级`:"Submit for Diagnosis"})]})]}):i.jsxs("div",{className:"flex flex-col items-center gap-2 text-center",children:[i.jsx("button",{onClick:oe,className:"w-14 h-14 rounded-full bg-emerald-600 hover:bg-emerald-500 text-white flex items-center justify-center shadow-lg shadow-emerald-500/25 transition-all hover:scale-105 active:scale-95 cursor-pointer","aria-label":"Start recording",children:i.jsx(Nn,{className:"w-6 h-6"})}),i.jsx("p",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300",children:m?"点击麦克风,大声朗读上述短句":"Click to start recording your speech"}),i.jsx("p",{className:"text-[11px] text-slate-400",children:m?"通常需 8~15 秒完成朗读":"Takes about 10-15 seconds to read naturally"})]})}),i.jsxs("div",{className:"pt-2 flex items-center justify-between border-t border-slate-100 dark:border-slate-800 text-xs",children:[i.jsx("button",{onClick:()=>x("welcome"),className:"text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors cursor-pointer",children:m?"
4756返回导览":"Back to Overview"}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("button",{onClick:()=>he(),className:"text-emerald-600 dark:text-emerald-400 hover:underline cursor-pointer font-medium",children:m?"不方便发声?快速跳过":"Skip microphone & auto-calibrate"})})]})]},"reading"),p==="evaluating"&&i.jsxs(cs.div,{initial:{opacity:0,scale:.95},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"py-12 flex flex-col items-center justify-center text-center space-y-4",children:[i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:k.dialogue,alt:`${T.examinerPersona.name} Evaluating`,className:"w-24 h-24 rounded-3xl object-cover ring-4 ring-emerald-500/20 shadow-xl",referrerPolicy:"no-referrer"}),i.jsx("div",{className:"absolute -bottom-2 -right-2 p-2 rounded-full bg-emerald-600 text-white shadow-md",children:i.jsx(Bs,{className:"w-4 h-4 animate-spin"})})]}),i.jsxs("div",{className:"space-y-1.5 max-w-sm",children:[i.jsx("h3",{className:"text-base font-extrabold text-slate-900 dark:text-slate-100",children:m?`${T.examinerPersona.name} 正在进行声学特征解析...`:`${T.examinerPersona.name} is Diagnosing Your Cadence...`}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 leading-relaxed",children:m?`正在测算 ${T.languageName} 音调度量、辅音弱化、连读连诵与广播原声的声学校准分...`:"Evaluating syllable duration, formant transitions, liaison fluidity, and speech tempo..."})]})]},"evaluating"),p==="result"&&y&&i.jsxs(cs.div,{initial:{opacity:0,y:10},animate:{opacity:1,y:0},exit:{opacity:0,y:-10},className:"space-y-5",children:[i.jsxs("div",{className:"p-5 rounded-2xl bg-gradient-to-br from-emerald-500/15 via-teal-500/10 to-slate-50 dark:to-slate-900 border border-emerald-500/30 flex flex-col sm:flex-row items-center gap-4",children:[i.jsx("img",{src:k.report,alt:`${y.examinerPersonaName||T.examinerPersona.name} Assessment`,className:"w-20 h-20 sm:w-24 sm:h-24 rounded-2xl object-cover ring-2 ring-emerald-500/30 shadow-md shrink-0",referrerPolicy:"no-referrer"}),i.jsxs("div",{className:"flex-1 text-center sm:text-left space-y-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-center sm:justify-start gap-2",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-md bg-emerald-600 text-white text-[10px] font-extrabold uppercase tracking-wider",children:y.levelTag}),i.jsxs("span",{className:"text-[11px] font-mono text-slate-500 dark:text-slate-400",children:[y.frameworkName||T.frameworkName," • ",y.cefrLevel]})]}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-slate-100",children:y.levelTitle}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed",children:y.plainDescription})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3.5",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/80 dark:border-slate-700/80 space-y-3",children:[i.jsxs("h4",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsxs("span",{children:[y.examinerPersonaName||T.examinerPersona.name,m?" 官方声学诊断点评":" Official Diagnostic Assessment"]})]}),i.jsx("div",{className:"space-y-1.5",children:y.strengths.map((Ae,je)=>i.jsxs("div",{className:"flex items-start gap-2 text-xs text-slate-600 dark:text-slate-300",children:[i.jsx(Co,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0 mt-0.5"}),i.jsx("span",{children:Ae})]},je))}),i.jsx("div",{className:"pt-2 border-t border-slate-200/60 dark:border-slate-700/60",children:i.jsxs("p",{className:"text-[11px] text-slate-500 dark:text-slate-400 italic",children:['"',y.feedback,'"']})}),y.recommendedStation&&i.jsxs("div",{className:"p-2 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 flex items-center justify-between text-xs",children:[i.jsx("span",{className:"text-slate-500",children:m?"推荐首选广播频段:":"Recommended Station:"}),i.jsx("span",{className:"font-bold text-emerald-600 dark:text-emerald-400",children:y.recommendedStation})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/80 dark:border-slate-700/80 flex flex-col items-center justify-center",children:[i.jsxs("h4",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider self-start mb-1 flex items-center gap-1.5",children:[i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:m?"4 维声学能力雷达":"Acoustic Metric Radar"})]}),i.jsx("div",{className:"w-full h-40",children:i.jsx(Nv,{width:"100%",height:"100%",children:i.jsxs(zv,{data:y.radarMetrics||[],children:[i.jsx(lx,{stroke:"#94a3b8",strokeDasharray:"3 3",opacity:.3}),i.jsx(cx,{dataKey:"metric",tick:{fill:"#64748b",fontSize:10,fontWeight:"bold"}}),i.jsx(ux,{name:"Candidate",dataKey:"value",stroke:"#10b981",fill:"#10b981",fillOpacity:.4})]})})}),i.jsx("div",{className:"w-full grid grid-cols-2 gap-1.5 text-center mt-1",children:(Ce=y.radarMetrics)==null?void 0:Ce.map((Ae,je)=>i.jsxs("div",{className:"bg-white dark:bg-slate-900 px-2 py-1 rounded-lg border border-slate-200/60 dark:border-slate-800",children:[i.jsx("span",{className:"text-[10px] text-slate-400 block",children:Ae.metric}),i.jsx("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-100",children:Ae.value})]},je))})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-amber-500/10 border border-amber-500/25 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3",children:[i.jsxs("div",{className:"space-y-1 flex-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(fr,{className:"w-4 h-4 text-amber-500"}),i.jsx("span",{className:"text-xs font-extrabold text-amber-900 dark:text-amber-200",children:m?"重新定级与多语种评测规则":"Multilingual Re-assessment Policy"}),i.jsx("span",{className:"px-1.5 py-0.2 rounded text-[9px] font-extrabold bg-amber-500 text-white",children:"PRO"})]}),i.jsx("p",{className:"text-[11px] text-amber-800/80 dark:text-amber-300/80 leading-relaxed",children:m?"您已完成首次权威声学定级。PRO 会员支持随时切换不同语言(西语/英语/日语/法语等)无限次重测,追踪长期发音蜕变。":"You have completed your speech diagnosis. PRO Members enjoy unlimited cross-language retakes (Spanish, English, Japanese, French) with progressive tracking."})]}),i.jsx("div",{className:"flex items-center gap-2 shrink-0 w-full sm:w-auto",children:h?i.jsxs("button",{onClick:()=>x("welcome"),className:"w-full sm:w-auto px-3.5 py-2 rounded-xl bg-amber-600 hover:bg-amber-500 text-white font-bold text-xs shadow-sm flex items-center justify-center gap-1.5 cursor-pointer",children:[i.jsx(yg,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:m?"切换语种重新定级":"Retake in Other Language"})]}):i.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-2 w-full sm:w-auto",children:[i.jsx("button",{onClick:()=>x("welcome"),className:"w-full sm:w-auto px-3 py-2 rounded-xl bg-slate-100 dar
4756k:bg-slate-800 hover:bg-slate-200 text-slate-700 dark:text-slate-300 text-xs font-semibold cursor-pointer text-center",children:m?"选择其他语种":"Choose Another Language"}),i.jsxs("button",{onClick:()=>{o&&o()},className:"w-full sm:w-auto px-4 py-2 rounded-xl bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 text-white font-bold text-xs shadow-md shadow-amber-500/20 flex items-center justify-center gap-1.5 cursor-pointer",children:[i.jsx(rl,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:m?"升级 PRO 解锁":"Unlock Retakes"})]})]})})]}),i.jsxs("div",{className:"pt-2 flex flex-col sm:flex-row items-center justify-between gap-3 border-t border-slate-100 dark:border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("a",{href:"/dashboard",className:"text-xs font-semibold text-slate-600 dark:text-slate-400 hover:text-emerald-600 dark:hover:text-emerald-400 flex items-center gap-1 cursor-pointer",children:[i.jsx(wc,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:m?"前往个人中心查看":"Manage in Personal Center"})]}),i.jsx("button",{onClick:()=>x("welcome"),className:"text-xs text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 transition-colors cursor-pointer",children:m?"重选语种与导览":"Review Languages"})]}),i.jsxs("button",{onClick:le,className:"w-full sm:w-auto px-6 py-2.5 rounded-xl text-xs font-bold text-white bg-emerald-600 hover:bg-emerald-500 shadow-md shadow-emerald-500/20 transition-all flex items-center justify-center gap-1.5 cursor-pointer active:scale-95",children:[i.jsx("span",{children:m?"
4756进入 RadioShadow 开始收听":"Start Practicing on Radio"}),i.jsx(Co,{className:"w-3.5 h-3.5"})]})]})]},"result")]})})]})}):null}function JFe({isOpen:n,onClose:e,onStartCalibration:t,languageName:r="Spanish",isZh:s=!1}){return n?i.jsx(Qo,{children:i.jsx(cs.div,{initial:{opacity:0,y:24,scale:.95},animate:{opacity:1,y:0,scale:1},exit:{opacity:0,y:20,scale:.95},transition:{duration:.28,ease:"easeOut"},className:"fixed bottom-24 sm:bottom-28 right-4 sm:right-6 z-[160] max-w-sm sm:max-w-md w-[calc(100vw-2rem)] sm:w-auto bg-white/95 dark:bg-slate-900/95 backdrop-blur-md border border-emerald-500/30 dark:border-emerald-500/40 rounded-2xl p-4 shadow-2xl ring-1 ring-black/5",role:"alert","aria-live":"polite",children:i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsxs("div",{className:"relative shrink-0",children:[i.jsx("img",{src:N0,alt:"Prof. Mateo Valero",className:"w-11 h-11 rounded-xl object-cover ring-2 ring-emerald-500/30 shadow-xs",referrerPolicy:"no-referrer"}),i.jsx("span",{className:"absolute -bottom-0.5 -right-0.5 w-3 h-3 rounded-full bg-emerald-500 ring-2 ring-white dark:ring-slate-900"})]}),i.jsxs("div",{className:"flex-1 min-w-0 pr-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5 mb-1",children:[i.jsxs("span",{className:"inline-flex items-center gap-1 px-1.5 py-0.5 rounded text-[10px] font-bold bg-emerald-500/15 text-emerald-700 dark:text-emerald-300",children:[i.jsx(At,{className:"w-2.5 h-2.5"}),i.jsx("span",{children:s?"发音校准":"Pronunciation Check"})]}),i.jsx("span",{className:"text-[11px] text-slate-400 font-medium",children:r})]}),i.jsx("h4",{className:"text-xs sm:text-sm font-bold text-slate-900 dark:text-slate-100 leading-snug",children:s?"要不要做一次发音校准?":"Enjoying the broadcast? Ready for a quick calibration?"}),i.jsx("p",{className:"text-[11px] sm:text-xs text-slate-600 dark:text-slate-400 mt-1 leading-relaxed",children:s?"朗读 1 句真实电台基准句,Mateo 教授为您测定声学发音匹配度与官方考试等级(耗时约 10 秒,随时可测)。":"Read 1 authentic sentence aloud to test your accent match & CEFR band with Prof. Mateo. (100% optional, takes 10s)"}),i.jsxs("div",{className:"flex items-center gap-2 mt-3",children:[i.jsxs("button",{onClick:t,className:"px-3.5 py-1.5 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-xs font-bold shadow-xs hover:shadow-sm transition-all flex items-center gap-1.5 cursor-pointer",children:[i.jsx(Nn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:s?"开始校准":"Try Calibration"})]}),i.jsx("button",{onClick:e,className:"px-2.5 py-1.5 rounded-lg text-xs font-medium text-slate-500 hover:text-slate-700 dark:text-slate-400 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",children:s?"稍后再说":"Maybe Later"})]})]}),i.jsx("button",{onClick:e,className:"p-1 rounded-lg text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors shrink-0 cursor-pointer","aria-label":"Dismiss prompt",children:i.jsx(Ts,{className:"w-4 h-4"})})]})})}):null}function XFe(){const[n,e]=S.useState("en-bbc"),[t,r]=S.useState(!1),[s,a]=S.useState(!1),[o,l]=S.useState(.85),[c,d]=S.useState("light"),[h,m]=S.useState(0),p=S.useRef(null),x=[{text:"Live audio broadcast streaming with high-fidelity speech clarity.",trans:"实时广播流已连接,高保真语音清晰度。"},{text:"Shadowing live native rhythm builds accent accuracy and acoustic reflexes.",trans:"跟读地道语速节奏可建立精准发音与听觉反射。"},{text:"AI pronunciation coach is analyzing speech cadence in the background.",trans:"AI 发音教练正在后台实时分析语调与断句。"},{text:"Master authentic expressions directly from international news channels.",trans:"直接从国际新闻电台中掌握地道母语表达。"}];S.useEffect(()=>{if(typeof window<"u"){const N=new URLSearchParams(window.location.search),T=N.get("station")||N.get("id"),k=N.get("theme");if(T){const R=ci.find(_=>_.id.toLowerCase()===T.toLowerCase()||_.name.toLowerCase().includes(T.toLowerCase()));R&&e(R.id)}(k==="dark"||!k&&window.matchMedia("(prefers-color-scheme: dark)").matches)&&d("dark");const P=window.location.pathname.match(/\/embed\/station\/([^/]+)/);if(P&&P[1]){const R=decodeURIComponent(P[1]),_=ci.find(I=>I.id.toLowerCase()===R.toLowerCase()||I.name.toLowerCase().includes(R.toLowerCase()));_&&e(_.id)}}},[]),S.useEffect(()=>{if(!t)return;const N=setInterval(()=>{m(T=>(T+1)%x.length)},4500);return()=>clearInterval(N)},[t]);const y=ci.find(N=>N.id===n)||ci[0],v=()=>{p.current&&(t?(p.current.pause(),r(!1)):(p.current.src=y.streamUrl,p.current.play().then(()=>{r(!0)}).catch(N=>{console.warn("Audio playback notice:",N)})))},B=N=>{if(e(N),t&&p.current){const T=ci.find(k=>k.id===N);T&&(p.current.src=T.streamUrl,p.current.play().catch(console.warn))}},E=c==="dark";return i.jsxs("div",{className:`w-full h-screen overflow-hidden flex flex-col justify-between select-none font-sans ${E?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsx("audio",{ref:p,preload:"none",onPlay:()=>r(!0),onPause:()=>r(!1)}),i.jsxs("div",{className:"p-3.5 flex-1 flex flex-col justify-between",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx("div",{className:`w-8 h-8 rounded-xl flex items-center justify-center flex-shrink-0 ${E?"bg-emerald-950/80 text-emerald-400 border border-emerald-800/60":"bg-emerald-50 text-emerald-600 border border-emerald-200/80"}`,children:i.jsx(cn,{className:`w-4 h-4 ${t?"animate-pulse":""}`})}),i.jsxs("div",{className:"min-w-0",children:[i.jsxs("h3",{className:"text-xs font-bold truncate leading-tight flex items-center gap-1.5",children:[i.jsx("span",{children:y.name}),i.jsx("span",{className:`text-[9px] font-mono px-1.5 py-0.2 rounded font-bold uppercase tracking-wider ${t?"bg-emerald-500 text-white":E?"bg-slate-800 text-slate-400":"bg-slate-200 text-slate-600"}`,children:t?"LIVE":"OFFLINE"})]}),i.jsxs("p",{className:"text-[10px] text-slate-400 dark:text-slate-500 truncate mt-0.5",children:[y.category," • ",
4756y.language]})]})]}),i.jsx("select",{value:n,onChange:N=>B(N.target.value),className:`text-[11px] font-semibold px-2 py-1 rounded-lg border outline-none cursor-pointer transition-colors ${E?"bg-slate-900 border-slate-800 text-slate-300 hover:border-slate-700":"bg-white border-slate-200 text-slate-700 hover:border-slate-300 shadow-xs"}`,children:ci.map(N=>i.jsxs("option",{value:N.id,children:[N.name," (",N.language,")"]},N.id))})]}),i.jsxs("div",{className:`my-2 p-2.5 rounded-xl border flex items-center gap-3 transition-all ${E?"bg-slate-900/80 border-slate-800/80":"bg-white border-slate-200/80 shadow-xs"}`,children:[i.jsx("div",{className:"flex items-center gap-0.5 h-6 px-1 flex-shrink-0",children:[40,80,55,95,60,85,45].map((N,T)=>i.jsx("span",{className:`w-1 rounded-full transition-all duration-300 ${t?"bg-emerald-500":E?"bg-slate-800":"bg-slate-200"}`,style:{height:t?`${N}%`:"20%",animation:t?`pulse 1.${T+2}s infinite ease-in-out`:"none"}},T))}),i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("p",{className:"text-xs font-semibold leading-snug line-clamp-1",children:t?x[h].text:"Click Play to start live stream..."}),i.jsx("p",{className:"text-[10px] text-slate-400 dark:text-slate-500 line-clamp-1 mt-0.5",children:t?x[h].trans:"支持实时双语同步字幕与 AI 发音评测"})]}),i.jsx("button",{onClick:v,className:"w-8 h-8 rounded-full bg-emerald-600 hover:bg-emerald-500 text-white flex items-center justify-center flex-shrink-0 shadow-md shadow-emerald-600/20 transition-transform active:scale-90 cursor-pointer",title:t?"Pause":"Play",children:t?i.jsx(Fh,{className:"w-3.5 h-3.5 fill-current"}):i.jsx(Xa,{className:"w-3.5 h-3.5 fill-current ml-0.5"})})]})]}),i.jsxs("footer",{className:`px-3 py-2 border-t flex items-center justify-between text-[11px] font-medium transition-colors ${E?"bg-slate-900 border-slate-800 text-slate-400":"bg-slate-100 border-slate-200 text-slate-600"}`,children:[i.jsxs("a",{href:"https://radioshadow.space/?utm_source=embed_widget&utm_medium=referral&utm_campaign=backlink",target:"_blank",rel:"noopener",className:"inline-flex items-center gap-1.5 font-bold text-emerald-600 hover:text-emerald-700 dark:text-emerald-400 dark:hover:text-emerald-300 transition-colors",children:[i.jsx(Er,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:"RadioShadow AI"}),i.jsx("span",{className:"text-[10px] font-normal text-slate-400 hidden sm:inline",children:"• Live Radio Shadowing"})]}),i.jsxs("a",{href:"https://radioshadow.space/?utm_source=embed_cta&utm_medium=referral",target:"_blank",rel:"noopener",className:`inline-flex items-center gap-1 text-[10px] font-bold px-2 py-0.5 rounded-md border transition-all ${E?"bg-slate-800 hover:bg-slate-700 text-emerald-400 border-slate-700":"bg-white hover:bg-slate-50 text-emerald-700 border-slate-200 shadow-xs"}`,children:[i.jsx("span",{children:"Practice Shadowing"}),i.jsx(Md,{className:"w-2.5 h-2.5"})]})]})]})}function ZFe({isOpen:n,onClose:e,defaultStationId:t="en-bbc"}){const[r,s]=S.useState(t),[a,o]=S.useState("light"),[l,c]=S.useState(null);if(!n)return null;const d=typeof window<"u"?window.location.origin:"https://radioshadow.space",h=`${d}/embed/station/${r}?theme=${a}`,m=`<!-- RadioShadow AI Live Radio Widget -->
4757<iframe
4758  src="${h}"
4759  width="100%"
4760  height="190"
4761  frameborder="0"
4762  allow="autoplay; microphone"
4763  style="border-radius: 16px; border: 1px solid #e2e8f0; max-width: 480px; display: block;"
4764></iframe>
4765<p style="font-size: 11px; color: #64748b; margin-top: 6px; font-family: sans-serif;">
4766  Live Language Shadowing powered by <a href="${d}/?ref=embed_badge" target="_blank" rel="noopener" style="color: #059669; font-weight: 600; text-decoration: underline;">RadioShadow AI</a>
4767</p>`,p=h,x=(y,v)=>{navigator.clipboard&&(navigator.clipboard.writeText(y),c(v),setTimeout(()=>c(null),2500))};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 p-6 sm:p-7 max-w-xl w-full relative flex flex-col gap-5 max-h-[90vh] overflow-y-auto",children:[i.jsx("button",{onClick:e,className:"absolute top-5 right-5 text-slate-400 hover:text-slate-600 dar
4767k:hover:text-slate-200 transition-colors p-1 rounded-full cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-50 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400 flex items-center justify-center border border-emerald-200 dark:border-emerald-800",children:i.jsx(xg,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[i.jsx("span",{children:"Embed Radio Widget"}),i.jsx("span",{className:"text-[10px] font-mono font-bold uppercase bg-emerald-100 text-emerald-700 dark:bg-emerald-950 dark:text-emerald-400 px-2 py-0.5 rounded-full",children:"Free & Open"})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Embed this live radio player into your blog, documentation, or Notion workspace."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 p-3.5 bg-slate-50 dark:bg-slate-850 rounded-2xl border border-slate-200/80 dark:border-slate-800",children:[i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 block mb-1",children:"Select Radio Station"}),i.jsx("select",{value:r,onChange:y=>s(y.target.value),className:"w-full text-xs font-semibold px-3 py-2 rounded-xl bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 text-slate-800 dark:text-slate-100 outline-none cursor-pointer",children:ci.map(y=>i.jsxs("option",{value:y.id,children:[y.name," (",y.language,")"]},y.id))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 block mb-1",children:"Theme Style"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>o("light"),className:`py-2 px-3 rounded-xl text-xs font-bold transition-all cursor-pointer border ${a==="light"?"bg-white text-emerald-700 border-emerald-400 shadow-sm":"bg-slate-100 text-slate-600 border-transparent dark:bg-slate-800 dark:text-slate-400"}`,children:"☀️ Light"}),i.jsx("button",{type:"button",onClick:()=>o("dark"),className:`py-2 px-3 rounded-xl text-xs font-bold transition-all cursor-pointer border ${a==="dark"?"bg-slate-900 text-emerald-400 border-emerald-500 shadow-sm":"bg-slate-100 text-slate-600 border-transparent dark:bg-slate-800 dark:text-slate-400"}`,children:"🌙 Dark"})]})]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-slate-400",children:"Live Preview"}),i.jsx("span",{className:"text-[11px] text-slate-400 font-mono",children:"Height: 190px"})]}),i.jsx("div",{className:"rounded-2xl overflow-hidden border border-slate-200 dark:border-slate-800 shadow-inner bg-slate-100 dark:bg-slate-950",children:i.jsx("iframe",{src:h,className:"w-full h-[190px] border-0",title:"RadioShadow Live Widget Preview"})})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"p-3.5 rounded-2xl bg-slate-900 text-slate-100 border border-slate-800",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("span",{className:"text-xs font-bold text-emerald-400 flex items-center gap-1.5",children:[i.jsx(xg,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"HTML / WordPress / Webflow iframe"})]}),i.jsx("button",{onClick:()=>x(m,"html"),className:"inline-flex items-center gap-1 text-[11px] font-bold px-2.5 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white transition-all active:scale-95 cursor-pointer",children:l==="html"?i.jsxs(i.Fragment,{children:[i.jsx(Co,{className:"w-3 h-3"}),i.jsx("span",{children:"Copied!"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pm,{className:"w-3 h-3"}),i.jsx("span",{children:"Copy HTML"})]})})]}),i.jsx("pre",{className:"text-[11px] font-mono text-slate-300 overflow-x-auto p-2 bg-slate-950/60 rounded-xl max-h-24",children:m})]}),i.jsxs("div",{className:"p-3 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/80 dark:border-slate-800 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"min-w-0",children:[i.jsx("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 block truncate",children:"Notion / Obsidian Embed URL"}),i.jsx("span",{className:"text-[10px] text-slate-400 font-mono truncate block",children:"Type /embed in Notion and paste this link"})]}),i.jsx("button",{onClick:()=>x(p,"notion"),className:"inline-flex items-center gap-1 text-[11px] font-bold px-3 py-1.5 rounded-xl bg-white hover:bg-slate-100 dar
4767k:bg-slate-700 dark:hover:bg-slate-600 text-slate-800 dark:text-slate-100 border border-slate-200 dark:border-slate-600 transition-all flex-shrink-0 cursor-pointer shadow-xs",children:l==="notion"?i.jsxs(i.Fragment,{children:[i.jsx(Co,{className:"w-3 h-3 text-emerald-600"}),i.jsx("span",{className:"text-emerald-600",children:"Copied"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pm,{className:"w-3 h-3"}),i.jsx("span",{children:"Copy URL"})]})})]})]})]})})}function e6e(){const[n,e]=S.useState(!1),[t,r]=S.useState(null),[s,a]=S.useState(null),[o,l]=S.useState([]),[c,d]=S.useState(!0),[h,m]=S.useState(null),[p,x]=S.useState(null),y=async E=>{if(E){x(E);try{await hm(qi(fn,"pseo_articles",E)),l(N=>N.filter(T=>T.id!==E)),m(null)}catch(N){console.warn("[pSEO Debugger] Client delete failed, falling back to server API:",N);try{const T=await fetch(`/api/cron/delete-article?id=${encodeURIComponent(E)}`,{method:"DELETE"});if(T.ok)l(k=>k.filter(P=>P.id!==E)),m(null);else{const k=await T.json();console.error("[pSEO Debugger] Server delete error:",k)}}catch(T){console.error("[pSEO Debugger] API fetch error:",T)}}finally{x(null)}}};S.useEffect(()=>{let E=()=>{};try{const N=vo(qs(fn,"pseo_articles"),aS("publishedAt","desc"));E=jm(N,T=>{if(!T.empty){const k=T.docs.map(P=>({id:P.id,...P.data()}));l(k)}d(!1)},T=>{console.warn("[pSEO Debugger] Firestore list notice:",T==null?void 0:T.message),d(!1)})}catch(N){console.error("[pSEO Debugger] Connection error:",N),d(!1)}return()=>E()},[]);const v=async()=>{var E,N,T,k,P;e(!0),a(null),r(null);try{const _=await(await fetch("/api/cron/generate-article",{method:"GET"})).json();if(_.success&&(_.slug||(E=_.article)!=null&&E.slug)){const I=_.slug||((N=_.article)==null?void 0:N.slug),D=_.title||((T=_.article)==null?void 0:T.seoTitle)||"Generated pSEO Article",j=(k=_.article)==null?void 0:k.seoDescription,O=(P=_.article)==null?void 0:P.targetLanguage;r({slug:I,title:D,description:j,targetLanguage:O})}else{const I=_.error||"Not enough unused curated assets or API error occurred.";a(I)}}catch(R){console.error("[pSEO Debugger] Fetch error:",R),a((R==null?void 0:R.message)||"Failed to reach the article generation endpoint.")}finally{e(!1)}},B=E=>E?(E.toDate?E.toDate():new Date(E)).toLocaleDateString("en-US",{month:"short",day:"numeric",hour:"2-digit",minute:"2-digit"}):"Just now";return i.jsx("div",{className:"min-h-screen bg-slate-50 text-slate-900 font-sans antialiased p-4 sm:p-8 flex flex-col items-center",children:i.jsxs("div",{className:"max-w-3xl w-full mx-auto",children:[i.jsxs("div",{className:"mb-6 flex items-center justify-between",children:[i.jsxs("a",{href:"/",className:"inline-flex items-center gap-2 text-xs font-semibold text-slate-600 hover:text-slate-900 bg-white border border-slate-200 px-3.5 py-1.5 rounded-full shadow-sm transition-all",children:[i.jsx(Rm,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Return to Live Radio App"})]}),i.jsxs("span",{className:"px-2.5 py-1 rounded-full bg-emerald-50 text-emerald-700 border border-emerald-200 text-xs font-mono font-bold flex items-center gap-1.5",children:[i.jsx(Q2,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Step 5.3 pSEO Testbench"})]})]}),i.jsxs("div",{className:"bg-white border border-slate-200 shadow-xl rounded-3xl p-6 sm:p-10 mb-8 text-center relative overflow-hidden",children:[i.jsx("div",{className:"p-3 bg-emerald-50 text-emerald-600 rounded-2xl border border-emerald-200 inline-flex mb-4",children:i.jsx(At,{className:"w-8 h-8"})}),i.jsx("h1",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 font-display tracking-tight mb-2",children:"AI Automated Article Generator Testbench"}),i.jsx("p",{className:"text-sm text-slate-500 max-w-lg mx-auto mb-8 leading-relaxed",children:"Trigger Gemini AI to synthesize authentic radio transcripts from Firestore into a SEO-optimized long-form publication article."}),i.jsx("button",{onClick:v,disabled:n,className:`w-full max-w-md mx-auto py-4 px-8 rounded-full font-bold text-sm shadow-lg transition-all flex items-center justify-center gap-3 cursor-pointer ${n?"bg-slate-200 text-slate-500 cursor-not-allowed border border-slate-300":"bg-slate-900 hover:bg-slate-800 text-white hover:scale-[1.02] active:scale-[0.98] shadow-slate-900/10"}`,children:n?i.jsxs(i.Fragment,{children:[i.jsx(qa,{className:"w-5 h-5 animate-spin text-emerald-500"}),i.jsx("span",{children:"⏳ Calling Gemini to compose article... (~15s)"})]}):i.jsxs(i.Fragment,{children:[i.jsx(At,{className:"w-5 h-5 text-amber-400"}),i.jsx("span",{children:"🚀 Trigger AI Article Generation"})]})}),s&&i.jsxs("div",{className:"mt-6 p-4 rounded-2xl bg-rose-50 border border-rose-200 text-rose-800 text-xs text-left flex items-start gap-3 animate-in fade-in",children:[i.jsx(Qa,{className:"w-5 h-5 text-rose-600 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("div",{className:"font-bold text-rose-900 mb
4767-0.5",children:"Generation Notice"}),i.jsx("div",{children:s})]})]}),t&&i.jsxs("div",{className:"mt-8 p-6 rounded-2xl bg-emerald-50/80 border border-emerald-200 text-left animate-in zoom-in-95 transition-all shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-2 text-emerald-800 font-bold text-xs font-mono uppercase tracking-wider mb-2",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600"}),i.jsx("span",{children:"Article Synthesized Successfully!"})]}),i.jsx("h2",{className:"text-xl font-extrabold text-slate-900 mb-2 font-display",children:t.title}),t.description&&i.jsx("p",{className:"text-xs text-slate-600 mb-4 line-clamp-2 leading-relaxed",children:t.description}),i.jsxs("div",{className:"pt-4 border-t border-emerald-200/60 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[i.jsxs("span",{className:"text-xs font-mono text-emerald-900 bg-emerald-100/80 px-2.5 py-1 rounded-md",children:["Slug: /",t.slug]}),i.jsxs("a",{href:`/blog/${t.slug}`,target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-full bg-emerald-600 hover:bg-emerald-700 text-white font-bold text-xs shadow-md transition-all self-start sm:self-auto cursor-pointer",children:[i.jsx("span",{children:"👀 Preview Published Article Page"}),i.jsx(Md,{className:"w-3.5 h-3.5"})]})]})]})]}),i.jsxs("div",{className:"bg-white border border-slate-200 shadow-sm rounded-3xl p-6 sm:p-8",children:[i.jsxs("div",{className:"flex items-center justify-between pb-4 border-b border-slate-100 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ys,{className:"w-5 h-5 text-emerald-600"}),i.jsxs("h3",{className:"font-extrabold text-slate-900 text-base font-display",children:["Published pSEO Articles (",o.length,")"]})]}),i.jsx("span",{className:"text-xs text-slate-400 font-mono",children:"Firestore DB"})]}),c?i.jsx("div",{className:"p-4 text-center text-xs text-slate-400 font-mono",children:"Loading accumulated articles..."}):o.length===0?i.jsx("div",{className:"p-8 text-center text-slate-400 text-xs",children:"No articles generated yet. Click the trigger button above to generate your first article!"}):i.jsx("div",{className:"divide-y divide-slate-100",children:o.map(E=>i.jsxs("div",{className:"py-3.5 flex flex-col sm:flex-row sm:items-center justify-between gap-3 hover:bg-slate-50 px-3 rounded-xl transition-all",children:[i.jsxs("div",{className:"flex-1 min-w-0",children:[i.jsx("a",{href:`/blog/${E.slug}`,target:"_blank",rel:"noopener noreferrer",className:"font-bold text-sm text-slate-800 hover:text-emerald-600 transition-all truncate block",children:E.seoTitle}),i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-400 font-mono mt-0.5",children:[i.jsx("span",{className:"text-emerald-700 font-semibold",children:E.targetLanguage||"CEFR"}),i.jsx("span",{children:"•"}),i.jsxs("span",{children:["/blog/",E.slug]})]})]}),i.jsxs("div",{className:"flex items-center gap-3 shrink-0",children:[i.jsxs("span",{className:"text-[11px] text-slate-400 font-mono flex items-center gap-1",children:[i.jsx(Eo,{className:"w-3 h-3"}),B(E.publishedAt)]}),i.jsx("a",{href:`/blog/${E.slug}`,target:"_blank",rel:"noopener noreferrer",className:"p-1.5 rounded-lg bg-slate-100 hover:bg-emerald-50 text-slate-600 hover:text-emerald-700 border border-slate-200 hover:border-emerald-200 transition-all cursor-pointer",title:"View Article",children:i.jsx(Md,{className:"w-3.5 h-3.5"})}),h===E.id?i.jsxs("div",{className:"flex items-center gap-1.5 animate-in fade-in duration-200",children:[i.jsxs("button",{onClick:()=>y(E.id),disabled:p===E.id,className:"px-2.5 py-1 text-xs font-bold rounded-lg bg-rose-600 hover:bg-rose-700 text-white shadow-sm transition-all cursor-pointer flex items-center gap-1 disabled:opacity-50",children:[p===E.id?i.jsx(qa,{className:"w-3 h-3 animate-spin"}):i.jsx(Fd,{className:"w-3 h-3"}),"Confirm Delete"]}),i.jsx("button",{onClick:()=>m(null),className:"p-1 rounded-lg bg-slate-100 hover:bg-slate-200 text-slate-500 transition-all cursor-pointer",title:"Cancel",children:i.jsx(Ts,{className:"w-3.5 h-3.5"})})]}):i.jsx("button",{onClick:()=>m(E.id),className:"p-1.5 rounded-lg bg-slate-100 hover:bg-rose-50 text-slate-500 hover:text-rose-600 border border-slate-200 hover:border-rose-200 transition-all cursor-pointer",title:"Delete Article",children:i.jsx(Fd,{className:"w-3.5 h-3.5"})})]})]},E.id||E.slug))})]})]})})}const a0={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_GA_MEASUREMENT_ID:"G-3L1D7R1Q03"};var i0={};const yd={slug:"mastering-c1-french-radio-carbon-neutrality",targetLanguage:"French",cefrTargetLevel:"C1",seoTitle:"Mastering C1 French: High-Frequency Radio Phrases & European Policy News",seoDescription:"Elevate your French listening comprehension 
4767with authentic radio excerpts from RTL France. Learn high-value vocabulary like 'débattre' and 'transition' with context notes.",coverImageUrl:"https://images.unsplash.com/photo-1590602847861-f357a9332bbc?auto=format&fit=crop&w=1200&q=80",coverImageAlt:"Radio microphone in broadcast sound studio - European Policy News",coverImageAuthor:"Unsplash Studio",coverImageAuthorUrl:"https://unsplash.com",publishedAt:new Date,faqs:[{question:"How does shadowing live radio broadcasts improve spoken French?",answer:"Unlike scripted textbooks, live radio features authentic speech cadence, complex sentence structures, and natural liaison/elision that train your acoustic reflexes for real-world fluency."},{question:"What CEFR level is needed to practice French news shadowing?",answer:"Radio news typically operates at B2-C1 CEFR levels. However, using synchronized bilingual transcripts allows B1 learners to bridge the comprehension gap effectively."},{question:"How often should I practice radio shadowing for visible results?",answer:"Just 10 to 15 minutes of focused daily shadowing builds acoustic muscle memory and accent retention significantly faster than passive listening."}],shadowingSteps:[{stepNumber:1,title:"Active Acoustic Priming",instruction:"Listen to the 30-second live excerpt 2-3 times without reading the text to identify main cadence and intonation drops."},{stepNumber:2,title:"Verbatim Cadence Mapping",instruction:"Review the bilingual transcript, highlighting key liaisons, mute syllables, and breath pauses."},{stepNumber:3,title:"Simultaneous Shadowing",instruction:"Speak along with the native broadcaster with a 0.5-second lag, matching pitch, volume, and rhythm exactly."},{stepNumber:4,title:"AI Pronunciation Audit",instruction:"Record your own voice in RadioShadow to get instant multi-metric acoustic feedback and IELTS/CEFR diagnostic scoring."}],contentHtml:`
4768    <p class="lead text-lg text-slate-600 font-medium">
4769      Authentic radio broadcasts from French news outlets like <strong>RTL France</strong> and <strong>France Info</strong> offer language learners the ultimate real-world test. Unlike scripted textbooks, live radio features natural spoken cadence, complex sentence structures, and high-frequency formal vocabulary used in politics, economics, and environmental policy.
4770    </p>
4771
4772    <h2>Live Radio Broadcast Excerpt</h2>
4773    <blockquote>
4774      "Les ministres européens de l'Environnement se réunissent aujourd'hui à Bruxelles pour débattre des nouvelles normes de neutralité carbone. Cette transition énergétique suscite d'intenses négociations entre les gouvernements industriels et agricoles."
4775    </blockquote>
4776
4777    <h3>Natural English Translation</h3>
4778    <p>
4779      "European Environment Ministers are meeting today in Brussels to debate new carbon neutrality standards. This energy transition is sparking intense negotiations between industrial and agricultural governments."
4780    </p>
4781
4782    <h2>Linguistic & Vocabulary Breakdown</h2>
4783    <ul>
4784      <li>
4785        <strong>débattre (de quelque chose)</strong> — <em>verb</em>: To debate or thoroughly discuss an issue in an official assembly. Notice the preposition <code>de</code> required after <code>débattre</code>.
4786      </li>
4787      <li>
4788        <strong>transition énergétique</strong> — <em>noun phrase</em>: Energy transition. A fundamental B2-C1 key term in contemporary French media discussing climate policy.
4789      </li>
4790      <li>
4791        <strong>susciter</strong> — <em>verb</em>: To arouse, provoke, or spark (e.g. <code>susciter d'intenses négociations</code>). Highly recommended for formal written and spoken French essays.
4792      </li>
4793    </ul>
4794
4795    <h2>Cultural Context & Media Usage</h2>
4796    <p>
4797      In European news broadcasts, acronyms like <em>UE</em> (Union Européenne) and terms like <em>neutralité carbone</em> are standard vocabulary. Listening to these daily 30-second clips trains your brain to parse fast native speech without needing artificial pauses.
4798    </p>
4799
4800    <h2>Conclusion & Daily Shadowing Practice</h2>
4801    <p>
4802      Shadowing native news broadcasts for just 5 minutes a day dramatically builds your acoustic radar, accent accuracy, and vocabulary retention.
4803    </p>
4804  `};async function t6e(n){try{const e=vo(qs(fn,"pseo_articles"),Dl("slug","==",n),h2(1)),t=
4804await Bc(e);if(!t.empty){const s=t.docs[0].data();return{slug:s.slug||n,targetLanguage:s.targetLanguage||"Global Language Study",cefrTargetLevel:s.cefrTargetLevel||s.difficulty||"C1",seoTitle:s.seoTitle||"Language Study Guide",seoDescription:s.seoDescription||"Master real radio broadcasts.",contentHtml:s.contentHtml||yd.contentHtml,coverImageUrl:s.coverImageUrl||yd.coverImageUrl,coverImageAlt:s.coverImageAlt||s.seoTitle||yd.coverImageAlt,coverImageAuthor:s.coverImageAuthor||yd.coverImageAuthor,coverImageAuthorUrl:s.coverImageAuthorUrl||yd.coverImageAuthorUrl,publishedAt:s.publishedAt?s.publishedAt.toDate():new Date,faqs:s.faqs||yd.faqs,shadowingSteps:s.shadowingSteps||yd.shadowingSteps,schemaJsonLd:s.schemaJsonLd||null,selectedAngle:s.selectedAngle||"",searchIntent:s.searchIntent||"Informational",seoScore:s.seoScore||92}}}catch(e){console.warn(`[pSEO Article Page] Firestore read notice for slug "${n}":`,e)}return{...yd,slug:n}}function n6e({params:n}){var ye;const e=(n==null?void 0:n.slug)||"mastering-c1-french-radio-carbon-neutrality",[t,r]=Mn.useState(()=>({...yd,slug:e})),[s,a]=Mn.useState(!0),[o,l]=S.useState(1),[c,d]=S.useState(null),{user:h,userProfile:m,loading:p,isPro:x,signInWithGoogle:y,signInWithEmail:v,signInAsGuest:B,logout:E}=Ji(),[N,T]=S.useState(!1),[k,P]=S.useState(!1),[R,_]=S.useState(""),[I,D]=S.useState(!1),[j,O]=S.useState(null),[M,U]=S.useState(!1),[ee,ie]=S.useState(!1),[G,Z]=S.useState(null),[z,se]=S.useState([]),re=()=>{try{if(typeof window<"u"&&a0!=null&&a0.VITE_PAYPAL_CLIENT_ID)return}catch{}try{if(typeof process<"u"&&i0){const he=i0.NEXT_PUBLIC_PAYPAL_CLIENT_ID||i0.VITE_PAYPAL_CLIENT_ID;if(he)return he}}catch{}return""},H=()=>{try{if(typeof window<"u"&&a0!=null&&a0.VITE_PAYPAL_PLAN_ID)return}catch{}try{if(typeof process<"u"&&i0){const he=i0.NEXT_PUBLIC_PAYPAL_PLAN_ID||i0.VITE_PAYPAL_PLAN_ID;if(he)return he}}catch{}return""},Y=async()=>{D(!0),O(null);try{await y(),T(!1)}catch(he){console.error("Google sign in error in article:",he),O(he.message||"Failed to sign in with Google.")}finally{D(!1)}},de=async()=>{D(!0),O(null);try{await B("Article Guest"),T(!1)}catch(he){console.error("Guest sign in error in article:",he),O(he.message||"Failed to sign in as guest.")}finally{D(!1)}},W=async he=>{if(he.preventDefault(),!!R.trim()){D(!0),O(null);try{await v(R.trim()),T(!1)}catch(le){console.error("Email sign in error in article:",le),O(le.message||"Failed to sign in with email.")}finally{D(!1)}}},K=(he,le)=>{navigator.clipboard&&(navigator.clipboard.writeText(he),d(le),setTimeout(()=>d(null),2e3))};Mn.useEffect(()=>{let he=!0;t6e(e).then(le=>{he&&(r(le),a(!1))});try{const le=vo(qs(fn,"pseo_articles"),h2(8));Bc(le).then(ce=>{if(he){const Ce=[];ce.forEach(Ae=>{const je=Ae.data();je.slug!==e&&Ce.push({slug:je.slug,seoTitle:je.seoTitle||"Language Study Guide",targetLanguage:je.targetLanguage||"Global Language Study",coverImageUrl:je.coverImageUrl||"https://images.unsplash.com/photo-1590602847861-f357a9332bbc?auto=format&fit=crop&w=600&q=80",seoDescription:je.seoDescription||"Master real radio broadcasts."})}),se(Ce.slice(0,3))}})}catch(le){console.warn("Could not load related articles:",le)}return()=>{he=!1}},[e]),Mn.useEffect(()=>{if(typeof document<"u"&&t){document.title=`${t.seoTitle||"Radio Shadowing Guide"} | RadioShadow AI`;let he=document.querySelector('meta[name="description"]');he||(he=document.createElement("meta"),he.name="description",document.head.appendChild(he)),t.seoDescription&&(he.content=t.seoDescription);let le=document.querySelector('link[rel="canonical"]');le||(le=document.createElement("link"),le.rel="canonical",document.head.appendChild(le)),le.href=`https://radioshadow.space/blog/${t.slug}`}},[t]);const J=t.publishedAt?new Date(t.publishedAt).toLocaleDateString("en-US",{year:"numeric",month:"long",day:"numeric"}):"Recently Published",oe="https://radioshadow.space",Ie=`${oe}/blog/${t.slug}`,pe={"@context":"https://schema.org","@graph":[{"@type":"BlogPosting","@id":`${Ie}#article`,isPartOf:{"@type":"WebPage","@id":Ie},headline:t.seoTitle,description:t.seoDescription,image:t.coverImageUrl?[t.coverImageUrl]:[],datePublished:t.publishedAt?new Date(t.publishedAt).toISOString():new Date().toISOString(),dateModified:new Date().toISOString(),inLanguage:((ye=t.targetLanguage)==null?void 0:ye.toLowerCase().slice(0,2))||"en",author:{"@type":"Organization",name:"RadioSh
4804adow AI Linguistics Team",url:oe},publisher:{"@type":"Organization",name:"RadioShadow AI",logo:{"@type":"ImageObject",url:`${oe}/radioshadow_app_logo.jpg`}},associatedMedia:{"@type":"AudioObject","@id":`${Ie}#audio`,name:`${t.targetLanguage} Broadcast Audio Excerpt`,description:`Audio excerpt from live broadcast used for shadowing and pronunciation coaching in ${t.targetLanguage}.`,duration:"PT30S",encodingFormat:"audio/mpeg",contentUrl:`${oe}/api/proxy-stream`}},{"@type":"BreadcrumbList","@id":`${Ie}#breadcrumb`,itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:oe},{"@type":"ListItem",position:2,name:"Radio Learning Blog",item:`${oe}/blog`},{"@type":"ListItem",position:3,name:t.targetLanguage,item:`${oe}/blog?lang=${encodeURIComponent(t.targetLanguage)}`},{"@type":"ListItem",position:4,name:t.seoTitle,item:Ie}]},...t.faqs&&t.faqs.length>0?[{"@type":"FAQPage","@id":`${Ie}#faq`,mainEntity:t.faqs.map(he=>({"@type":"Question",name:he.question,acceptedAnswer:{"@type":"Answer",text:he.answer}}))}]:[],...t.shadowingSteps&&t.shadowingSteps.length>0?[{"@type":"HowTo","@id":`${Ie}#howto`,name:`How to Shadow ${t.targetLanguage} Live Radio Broadcasts`,description:`Step-by-step 4-stage shadowing methodology for mastering spoken ${t.targetLanguage} with real-world broadcasts.`,step:t.shadowingSteps.map((he,le)=>({"@type":"HowToStep",position:le+1,name:he.title,text:he.instruction}))}]:[]]};return i.jsxs("main",{className:"min-h-screen bg-slate-50 selection:bg-emerald-200 selection:text-emerald-900 font-sans antialiased",children:[i.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(pe)}}),i.jsx("nav",{className:"sticky top-0 z-40 bg-white/90 backdrop-blur-md border-b border-slate-200 px-4 sm:px-8 py-3.5",children:i.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsxs("a",{href:"/",className:"inline-flex items-center gap-2 text-xs font-semibold text-slate-700 hover:text-slate-950 transition-all bg-slate-100 hover:bg-slate-200 px-3.5 py-1.5 rounded-full",children:[i.jsx(Rm,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Back to Live Radio"})]}),i.jsxs("a",{href:"/ielts-speaking-mock-test",className:"inline-flex items-center gap-1.5 text-xs font-bold text-emerald-800 bg-emerald-50 hover:bg-emerald-100 border border-emerald-200/80 px-3.5 py-1.5 rounded-full transition-all shadow-2xs",title:"IELTS Speaking Mock Test & 1v1 AI Examiner Simulation",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{className:"hidden sm:inline",children:"IELTS 1v1 Mock Test"}),i.jsx("span",{className:"sm:hidden",children:"IELTS Mock"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 relative",children:[p?i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-slate-100 text-slate-400 text-xs",children:[i.jsx(Bs,{className:"w-3.5 h-3.5 animate-spin"}),i.jsx("span",{children:"Checking..."})]}):h?i.jsxs("div",{className:"relative",children:[i.jsxs("button",{onClick:()=>P(!k),className:"inline-flex items-center gap-2 text-xs font-semibold text-slate-700 hover:text-slate-900 transition-all bg-white hover:bg-slate-50 border border-slate-200 px-3.5 py-1.5 rounded-full shadow-sm cursor-pointer",children:[i.jsx(vh,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{className:"max-w-[100px] truncate",children:(m==null?void 0:m.displayName)||h.email||"Learner"}),x?i.jsxs("span",{className:"px-1.5 py-0.2 text-[9px] font-extrabold uppercase bg-amber-500 text-white rounded font-mono flex items-center gap-0.5 shadow-sm",children:[i.jsx(fr,{className:"w-2.5 h-2.5"})," PRO"]}):i.jsx("span",{className:"px-1.5 py-0.2 text-[9px] font-bold uppercase bg-slate-100 text-slate-500 rounded font-mono",children:"Free"}),i.jsx(wy,{className:"w-3 h-3 text-slate-400"})]}),k&&i.jsxs("div",{className:"absolute right-0 mt-2 w-72 bg-white rounded-2xl shadow-xl border border-slate-200/80 p-4 z-50 animate-in fade-in slide-in-from-top-2 duration-150",children:[i.jsxs("div",{className:"pb-3 border-b border-slate-100 mb-3",children:[i.jsx("div",{className:"text-xs text-slate-400 font-medium",children:"Signed in as"}),i.jsx("div",{className:"text-sm font-bold text-slate-800 truncate",children:(m==null?void 0:m.displayName)||"Learner"}),i.jsx("div",{className:"text-xs text-slate-500 truncate",children:h.email||"Guest User"})]}),i.jsxs("div",{className:"space-y-3 mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs text-slate-500 font-medium",children:"Subscription"}),x?i.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold bg-amber-50 text-amber-700 border border-amber-200",children:[i.jsx(fr,{className:"w-3 h-3"})," PRO Access"]}):i.jsx("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold bg-slate-50 text-slate-600 border border-slate-200",children:"Free Tier"})]}),!x&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs text-slate-500 font-medium",children:"Shadowing Quota"}),i.jsxs("span",{className:"text-xs font-mono font-bold text-emerald-600",children:[(m==null?void 0:m.remainingQuota)??10," sentences left"]})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("button",{onClick:()=>{P(!1),U(!0)},className:"w-full text-left inline-flex items-center gap-2 px-3 py-2 rounded-xl text-xs font-semibold text-emerald-700 bg-emerald-50 hover:bg-emerald-100 border border-emerald-200/50 transition-colors cursor-pointer",children:[i.jsx(sl,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"View My Membership Benefits"})]}),i.jsxs("button",{onClick:()=>{P(!1),E()},className:"w-full text-left inline-flex items-center gap-2 px-3 py-2 rounded-xl text-xs font-semibold text-rose-600 hover:bg-rose-50 transition-colors cursor-pointer",children:[i.jsx(fS,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Sign Out"})]})]})]})]}):i.jsxs("button",{onClick:()=>T(!0),className:"inline-flex items-center gap-1.5 text-xs font-semibold text-white bg-emerald-600 hover:bg-emerald-500 border border-emerald-700 px-3.5 py-1.5 rounded-full transition-all shadow-sm cursor-pointer shadow-emerald-600/10 active:scale-95",children:[i.jsx(vh,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Sign in"})]}),i.jsxs("button",{onClick:()=>U(!0),className:"inline-flex items-center gap-1.5 text-xs font-semibold text-slate-600 bg-slate-100 hover:bg-slate-200 border border-slate-200 px-3.5 py-1.5 rounded-full transition-all cursor-pointer",children:[i.jsx(fr,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"hidden sm:inline",children:"PRO Benefits"})]})]})]})}),i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 lg:px-8 py-8 md:py-12",children:[i.jsx("nav",{"aria-label":"Breadcrumb",className:"mb-6",children:i.jsxs("ol",{className:"flex items-center flex-wrap gap-1.5 text-xs text-slate-500 font-medium bg-white/70 backdrop-blur-sm border border-slate-200/80 px-4 py-2.5 rounded-2xl shadow-xs",children:[i.jsx("li",{className:"inline-flex items-center",children:i.jsxs("a",{href:"/",className:"inline-flex items-center gap-1 hover:text-emerald-600 transition-colors",children:[i.jsx(Qbe,{className:"w-3.5 h-3.5 text-slate-400"}),i.jsx("span",{children:"Home"})]})}
4804),i.jsx("li",{className:"text-slate-300",children:i.jsx(qn,{className:"w-3.5 h-3.5"})}),i.jsx("li",{children:i.jsx("a",{href:"/blog",className:"hover:text-emerald-600 transition-colors",children:"Blog"})}),i.jsx("li",{className:"text-slate-300",children:i.jsx(qn,{className:"w-3.5 h-3.5"})}),i.jsx("li",{children:i.jsx("a",{href:`/blog?lang=${encodeURIComponent(t.targetLanguage)}`,className:"hover:text-emerald-600 transition-colors px-2 py-0.5 rounded-md bg-emerald-50 text-emerald-700 font-semibold border border-emerald-200/40",children:t.targetLanguage})}),i.jsx("li",{className:"text-slate-300",children:i.jsx(qn,{className:"w-3.5 h-3.5"})}),i.jsx("li",{className:"text-slate-700 font-semibold truncate max-w-[200px] sm:max-w-xs md:max-w-sm",title:t.seoTitle,children:t.seoTitle})]})}),i.jsxs("div",{className:"lg:grid lg:grid-cols-12 lg:gap-10 xl:gap-14 items-start",children:[i.jsxs("div",{className:"lg:col-span-8 space-y-10",children:[i.jsxs("header",{className:"space-y-4",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[i.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-emerald-700 bg-emerald-50 px-3 py-1 rounded-full border border-emerald-200",children:t.targetLanguage}),t.cefrTargetLevel&&i.jsxs("span",{className:"text-xs font-bold text-indigo-700 bg-indigo-50 px-2.5 py-1 rounded-full border border-indigo-200 flex items-center gap-1 font-mono",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-indigo-600"}),"CEFR ",t.cefrTargetLevel]}),i.jsx("span",{className:"text-slate-300",children:"•"}),i.jsxs("span",{className:"text-slate-500 text-xs font-mono flex items-center gap-1.5",children:[i.jsx(uS,{className:"w-3.5 h-3.5 text-slate-400"}),J]}),i.jsx("span",{className:"text-slate-300",children:"•"}),i.jsxs("span",{className:"text-slate-500 text-xs font-mono flex items-center gap-1",children:[i.jsx(Eo,{className:"w-3.5 h-3.5 text-slate-400"}),"5 min practice read"]})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold text-slate-900 tracking-tight leading-tight font-display",children:t.seoTitle}),i.jsx("p",{className:"text-base sm:text-lg text-slate-600 leading-relaxed font-normal",children:t.seoDescription}),t.coverImageUrl&&i.jsxs("figure",{className:"mt-6 rounded-3xl overflow-hidden border border-slate-200 shadow-sm relative group",children:[i.jsx("img",{src:t.coverImageUrl,alt:t.coverImageAlt||t.seoTitle,className:"w-full h-72 sm:h-88 md:h-96 object-cover group-hover:scale-101 transition-transform duration-500",referrerPolicy:"no-referrer"}),t.coverImageAuthor&&i.jsxs("figcaption",{className:"px-4 py-2 bg-slate-900/80 text-white backdrop-blur-md absolute bottom-0 right-0 text-[11px] font-mono rounded-tl-xl",children:["Photo by"," ",i.jsx("a",{href:t.coverImageAuthorUrl||"https://unsplash.com",target:"_blank",rel:"noopener noreferrer",className:"underline hover:text-emerald-300 font-semibold",children:t.coverImageAuthor})," ","on Unsplash"]})]})]}),i.jsx("div",{className:"prose prose-lg prose-slate prose-headings:font-bold prose-headings:tracking-tight prose-a:text-emerald-600 hover:prose-a:text-emerald-700 prose-img:rounded-2xl prose-img:shadow-lg max-w-none leading-relaxed",dangerouslySetInnerHTML:{__html:t.contentHtml}}),t.shadowingSteps&&t.shadowingSteps.length>0&&i.jsxs("section",{className:"my-12 p-6 sm:p-8 rounded-3xl bg-white border border-slate-200/90 shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-3 mb-6 pb-4 border-b border-slate-150",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-indigo-50 text-indigo-600 flex items-center justify-center border border-indigo-200/60",children:i.jsx(q2,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-xl sm:text-2xl font-bold text-slate-900 leading-tight",children:["Step-by-Step ",t.targetLanguage," Shadowing Protocol"]}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-500 mt-0.5",children:"Follow this 4-stage acoustic methodology with this broadcast clip"})]})]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 mb-6",children:t.shadowingSteps.map(he=>{const le=o===he.stepNumber;return i.jsxs("button",{onClick:()=>l(he.stepNumber),className:`p-3 rounded-2xl border text-left transition-all cursor-pointer flex flex-col justify-between ${le?"bg-indigo-600 text-white border-indigo-700 shadow-md shadow-indigo-600/20":"bg-slate-50 hover:bg-slate-100 text-slate-700 border-slate-200"}`,children:[i.jsxs("span",{className:`text-[10px] font-bold uppercase tracking-wider ${le?"text-indigo-200":"text-slate-400"}`,children:["Stage 0",he.stepNumber]}),i.jsx("span",{className:"text-xs font-bold truncate mt-1",children:he.title})]},he.stepNumber)})}),(()=>{const he=t.shadowingSteps.find(le=>le.stepNumber===o)||t.shadowingSteps[0];return i.jsxs("div",{className:"p-5 rounded-2xl bg-slate-50/80 border border-slate-200 flex items-start gap-4",children:[i.jsx("span",{className:"flex-shrink-0 w-8 h-8 rounded-full bg-indigo-100 text-indigo-700 font-bold font-mono text-sm flex items-center justify-center border border-indigo-200",children:he.stepNumber}),i.jsxs("div",{className:"flex-1",children:[i.jsx("h4",{className:"text-base font-bold text-slate-900 mb-1",children:he.title}),i.jsx("p",{className:"text-sm text-slate-600 leading-relaxed",children:he.instruction})]})]})})()]}),t.faqs&&t.faqs.length>0&&i.jsxs("section",{className:"my-12 p-6 sm:p-8 rounded-3xl bg-slate-50 border border-slate-200/80 shadow-xs",children:[i.jsxs("div",{className:"flex items-center justify-between gap-3 mb-6 pb-4 border-b border-slate-200",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-50 text-emerald-600 flex items-center justify-center border border-emerald-200/60",children:i.jsx(wv,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-slate-900 leading-tight",children:"Frequently Asked Questions"}),i.jsxs("p",{className:"text-xs sm:text-sm text-slate-500 mt-0.5",children:["Key questions regarding ",t.targetLanguage," radio comprehension & pronunciation"]})]})]}),i.jsxs("span",{className:"hidden sm:inline-block px-3 py-1 rounded-full text-xs font-bold bg-white text-slate-600 border border-slate-200",children:[t.faqs.length," Q&As"]})]}),i.jsx("div",{className:"space-y-3",children:t.faqs.map((he,le)=>i.jsxs("details",{className:"group p-4 sm:p-5 rounded-2xl bg-white border border-slate-200/80 open:border-emerald-500/40 open:sha
4804dow-sm transition-all",open:le===0,children:[i.jsxs("summary",{className:"font-bold text-slate-900 cursor-pointer flex items-center justify-between gap-3 group-hover:text-emerald-700 select-none",children:[i.jsxs("span",{className:"text-sm sm:text-base flex items-center gap-2",children:[i.jsxs("span",{className:"w-5 h-5 rounded-full bg-slate-100 text-slate-600 font-mono text-[10px] flex items-center justify-center flex-shrink-0 group-open:bg-emerald-100 group-open:text-emerald-700",children:["Q",le+1]}),he.question]}),i.jsx(wy,{className:"w-4 h-4 text-slate-400 group-open:rotate-180 transition-transform flex-shrink-0"})]}),i.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-100 text-slate-600 text-sm sm:text-base leading-relaxed pl-7",children:[i.jsx("p",{children:he.answer}),i.jsx("div",{className:"mt-3 flex justify-end",children:i.jsx("button",{type:"button",onClick:()=>K(`${he.question}
4805${he.answer}`,le),className:"inline-flex items-center gap-1 text-[11px] font-semibold text-slate-400 hover:text-slate-700 bg-slate-50 hover:bg-slate-100 px-2.5 py-1 rounded-md transition-colors",children:c===le?i.jsxs(i.Fragment,{children:[i.jsx(Co,{className:"w-3 h-3 text-emerald-600"}),i.jsx("span",{className:"text-emerald-600",children:"Copied!"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pm,{className:"w-3 h-3"}),i.jsx("span",{children:"Copy Answer"})]})})})]})]},le))})]}),i.jsxs("div",{className:"lg:hidden mt-16 space-y-10 border-t border-slate-200 pt-10",children:[i.jsxs("section",{className:"bg-slate-100/60 border border-slate-200 rounded-3xl p-6 sm:p-8",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-6",children:[i.jsx("span",{className:"p-1.5 bg-emerald-50 text-emerald-600 rounded-xl border border-emerald-100",children:i.jsx(cn,{className:"w-4 h-4 animate-pulse"})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg font-bold text-slate-900 leading-none",children:["Recommended Practice for ",t.targetLanguage]}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Start an interactive shadowing session on these channels"})]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:(he=>{const le=(he||"").toLowerCase();return le.includes("fren")?[{name:"RFI Monde",desc:"Global French current affairs, spoken in beautiful standard French.",tag:"News & Talk",langQuery:"French"},{name:"FIP Paris",desc:"Eclectic Parisian broadcast with poetic announcements.",tag:"Eclectic Radio",langQuery:"French"}]:le.includes("span")?[{name:"Ibiza Global Radio",desc:"Vibrant Spanish rhythms, ideal for timing-based shadowing.",tag:"Culture & Beats",langQuery:"Spanish"},{name:"Radio Nacional de España",desc:"Top-tier national broadcast in authentic Castilian Spanish.",tag:"News & Debate",langQuery:"Spanish"}]:[{name:"BBC World Service",desc:"The gold standard for standard British English.",tag:"International News",langQuery:"English"},{name:"KEXP Seattle",desc:"Contemporary American speech patterns and spontaneous speech.",tag:"Indie Culture",langQuery:"English"}]})(t.targetLanguage).map((he,le)=>i.jsxs("div",{className:"bg-white border border-slate-200/80 rounded-2xl p-5 shadow-xs hover:shadow-md transition-all flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold uppercase tracking-wider bg-slate-100 text-slate-600 border border-slate-200/50",children:he.tag}),i.jsxs("span",{className:"text-[10px] font-mono text-emerald-600 font-bold flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-ping"}),"LIVE"]})]}),i.jsx("h4",{className:"text-sm font-bold text-slate-800",children:he.name}),i.jsx("p",{className:"text-xs text-slate-500 mt-1.5 leading-relaxed",children:he.desc})]}),i.jsxs("div",{className:"pt-4 mt-4 border-t border-slate-100 flex items-center justify-between",children:[i.jsxs("span",{className:"text-[11px] font-medium text-slate-400",children:["Target: ",t.targetLanguage]}),i.jsxs("a",{href:`/?language=${encodeURIComponent(he.langQuery)}`,className:"inline-flex items-center gap-1 px-3 py-1.5 rounded-xl text-xs font-bold bg-emerald-600 hover:bg-emerald-500 text-white transition-all shadow-sm shadow-emerald-600/10 active:scale-95 cursor-pointer",children:[i.jsx(Er,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Shadow Live"})]})]})]},le))})]}),z.length>0&&i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-slate-200 pb-4",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xl font-bold text-slate-900 font-display",children:"Related Guides & Publications"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Expand your skills with specialized language analysis articles"})]}),i.jsxs("a",{href:"/blog",className:"inline-flex items-center gap-1 text-xs font-bold text-emerald-600 hover:text-emerald-700 transition-colors",children:[i.jsx("span",{children:"View all articles"}
4805),i.jsx(qn,{className:"w-3.5 h-3.5"})]})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-6",children:z.map((he,le)=>i.jsxs("article",{className:"group flex flex-col bg-white border border-slate-200/80 rounded-2xl overflow-hidden shadow-xs hover:shadow-md transition-all",children:[i.jsxs("a",{href:`/blog/${he.slug}`,className:"block relative aspect-video overflow-hidden",children:[i.jsx("img",{src:he.coverImageUrl,alt:he.seoTitle,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",referrerPolicy:"no-referrer"}),i.jsx("span",{className:"absolute top-2.5 left-2.5 px-2.5 py-0.5 rounded-full text-[9px] font-bold uppercase tracking-wider bg-slate-950/80 text-white backdrop-blur-md",children:he.targetLanguage})]}),i.jsxs("div",{className:"p-4 flex-1 flex flex-col justify-between gap-3",children:[i.jsxs("div",{children:[i.jsx("h4",{className:"text-sm font-bold text-slate-800 line-clamp-2 group-hover:text-emerald-600 transition-colors",children:i.jsx("a",{href:`/blog/${he.slug}`,children:he.seoTitle})}),i.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 mt-1.5 leading-relaxed",children:he.seoDescription})]}),i.jsxs("a",{href:`/blog/${he.slug}`,className:"inline-flex items-center gap-1 text-xs font-bold text-slate-700 hover:text-emerald-600 transition-colors self-start mt-1",children:[i.jsx("span",{children:"Read guide"}),i.jsx(qn,{className:"w-3 h-3 transition-transform group-hover:translate-x-0.5"})]})]})]},le))})]})]})]}),i.jsxs("aside",{className:"hidden lg:block lg:col-span-4 lg:sticky lg:top-24 lg:self-start space-y-6 max-h-[calc(100vh-8rem)] overflow-y-auto pr-2 scrollbar-thin scrollbar-thumb-slate-200 scrollbar-track-transparent",children:[i.jsxs("div",{className:"p-6 rounded-3xl bg-gradient-to-br from-emerald-900 to-slate-950 text-white shadow-lg border border-emerald-500/20",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx("span",{className:"p-1.5 bg-emerald-500/20 text-emerald-400 rounded-xl border border-emerald-500/30",children:i.jsx(Nn,{className:"w-4 h-4"})}),i.jsx("span",{className:"text-xs font-bold uppercase tracking-wider text-emerald-300",children:"Acoustic Coaching"})]}),i.jsxs("h3",{className:"text-lg font-bold text-white mb-1.5",children:["Shadow Live in ",t.targetLanguage]}),i.jsx("p",{className:"text-xs text-slate-300 mb-5 leading-relaxed",children:"Connect your microphone and get instant syllable timing & IELTS/CEFR pronunciation scores."}),i.jsxs("a",{href:`/?language=${encodeURIComponent(t.targetLanguage)}`,className:"w-full py-2.5 px-4 rounded-xl bg-emerald-500 hover:bg-emerald-400 text-slate-950 font-bold text-xs flex items-center justify-center gap-2 shadow-md shadow-emerald-500/20 transition-all cursor-pointer",children:[i.jsx(Er,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Launch Live Radio Shadowing"})]})]}),i.jsxs("section",{className:"bg-white border border-slate-200/90 rounded-3xl p-5 shadow-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-4 pb-3 border-b border-slate-150",children:[i.jsx("span",{className:"p-1.5 bg-emerald-50 text-emerald-600 rounded-xl border border-emerald-100",children:i.jsx(cn,{className:"w-3.5 h-3.5 animate-pulse"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xs font-extrabold text-slate-950 uppercase tracking-wider",children:"Recommended Channels"}),i.jsxs("p",{className:"text-[10px] text-slate-500 mt-0.5",children:["Live broadcasts for ",t.targetLanguage]})]})]}),i.jsx("div",{className:"space-y-3",children:(he=>{const le=(he||"").toLowerCase();return le.includes("fren")?[{name:"RFI Monde",desc:"Global French news, standard spoken French.",tag:"News & Talk",langQuery:"French"},{name:"FIP Paris",desc:"Poetic Parisian radio broadcasts.",tag:"Eclectic Radio",langQuery:"French"}]:le.includes("span")?[{name:"Ibiza Global Radio",desc:"Spanish conversational rhythm and flow.",tag:"Culture & Beats",langQuery:"Spanish"},{name:"Radio Nacional de España",desc:"Authentic national Spanish broadcasts.",tag:"News & Debate",langQuery:"Spanish"}]:[{name:"BBC World Service",desc:"Gold standard British English broadcasts.",tag:"News",langQuery:"English"},{name:"KEXP Seattle",desc:"Modern US speech and indie culture.",tag:"Indie Culture",langQuery:"English"}]})(t.targetLanguage).map((he,le)=>i.jsxs("div",{className:"bg-slate-50/70 border border-slate-200/70 rounded-2xl p-3.5 hover:bg-white hover:shadow-xs transition-all flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[i.jsx("span",{className:"px-1.5 py-0.2 text-[9px] font-extrabold uppercase tracking-wide bg-white text-slate-600 rounded border border-slate-200",children:he.tag}),i.jsxs("span",{className:"text-[9px] font-mono text-emerald-600 font-bold flex items-center gap-1",children:[i.jsx("span",{className:"w-1 h-1 rounded-full bg-emerald-500 animate-ping"}),"LIVE"]})]}),i.jsx("h4",{className:"text-xs font-extrabold text-slate-800",children:he.name}),i.jsx("p",{className:"text-[11px] text-slate-500 mt-1 leading-normal",children:he.desc})]}),i.jsxs("div",{className:"pt-2.5 mt-2.5 border-t border-slate-200/60 flex items-center justify-between",children:[i.jsxs("span",{className:"text-[10px] font-semibold text-slate-400",children:["Target: ",he.langQuery]}),i.jsxs("a",{href:`/?language=${encodeURIComponent(he.langQuery)}`,className:"inline-flex items-center gap-1 px-2.5 py-1 rounded-lg text-[10px] font-extrabold bg-emerald-600 hover:bg-emerald-500 text-white transition-all cursor-pointer shadow-xs shadow-emerald-600/5",children:[i.jsx(Er,{className:"w-3 h-3"}),i.jsx("span",{children:"Shadow"})]})]})]},le))})]}),z.length>0&&i.jsxs("section",{className:"bg-white border border-slate-200/90 rounded-3xl p-5 shadow-xs",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4 pb-3 border-b border-slate-150",children:[i.jsxs("div",{children:[i.jsx("h3",{className:"text-xs font-extrabold text-slate-950 uppercase tracking-wider",children:"Related Guides"}),i.jsx("p",{className:"text-[10px] text-slate-500 mt-0.5",children:"Boost your learning efficiency"})]}),i.jsx("a",{href:"/blog",className:"text-[10px] font-bold text-emerald-600 hover:text-emerald-700 transition-colors uppercase tracking-wider",children:"View All"})]}),i.jsx("div",{className:"space-y-3",children:z.map((he,le)=>i.jsxs("article",{className:"group flex gap-3 bg-slate-50/70 border border-slate-200/70 rounded-2xl p-2.5 hover:bg-white hover:shadow-xs transition-all",children:[i.jsx("a",{href:`/blog/${he.slug}`,className:"block relative w-16 h-12 rounded-xl overflow-hidden flex-shrink-0 bg-slate-100 border border-slate-200/40",children:i.jsx("img",{src:he.coverImageUrl,alt:he.seoTitle,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300",referrerPolicy:"no-referrer"})}),i.jsxs("div",{className:"flex-1 min-w-0 flex flex-col justify-between py-0.5",children:[i.jsx("h4",{className:"text-xs font-extrabold text-slate-800 line-clamp-1 group-hover:text-emerald-600 transition-colors",children:i.jsx("a",{href:`/blog/${he.slug}`,children:he.seoTitle})}),i.jsx("p",{className:"text-[10px] text-slate-400 line-clamp-1",children:he.seoDescription}),i.jsxs("a",{href:`/blog/${he.slug}`,className:"inline-flex items-center gap-0.5 text-[10px] font-extrabold text-emerald-600 hover:text-emerald-700 transition-colors mt-1",children:[i.jsx("span",{children:"Read Guide"}
4805),i.jsx(qn,{className:"w-2.5 h-2.5 transition-transform group-hover:translate-x-0.5"})]})]})]},le))})]})]})]}),i.jsx("hr",{className:"my-16 border-slate-200"}),i.jsxs("div",{className:"bg-white border border-slate-200/90 rounded-3xl p-8 sm:p-12 text-center shadow-xl shadow-slate-200/50 relative overflow-hidden",children:[i.jsx("div",{className:"absolute -top-10 -right-10 w-40 h-40 bg-emerald-100/50 rounded-full blur-2xl pointer-events-none"}),i.jsx("div",{className:"inline-flex p-3.5 bg-slate-100 text-slate-900 rounded-2xl border border-slate-200 mb-4",children:i.jsx(Er,{className:"w-6 h-6 text-emerald-600"})}),i.jsxs("h3",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 mb-3 font-display",children:["Ready to Master Spoken ",t.targetLanguage,"?"]}),i.jsx("p",{className:"text-slate-600 mb-8 max-w-lg mx-auto text-sm sm:text-base leading-relaxed",children:"Practice shadowing this exact broadcast snippet with our AI Pronunciation Coach, instant bilingual subtitles, and acoustic radar feedback."}),i.jsxs("a",{href:`/?language=${encodeURIComponent(t.targetLanguage)}`,className:"bg-slate-950 text-white px-8 py-3.5 rounded-full font-bold hover:bg-slate-800 transition-all flex items-center justify-center gap-2 mx-auto inline-flex shadow-lg shadow-slate-900/20 hover:scale-[1.02] active:scale-[0.98]",children:[i.jsx(fr,{className:"w-4 h-4 text-amber-400 fill-current"}),i.jsx("span",{children:"Start Practice Shadowing Now"})]}),i.jsxs("div",{className:"mt-5 flex flex-wrap justify-center items-center gap-4 text-xs text-slate-400 font-mono",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:"Real-Time Broadcast STT"})]}),i.jsx("span",{children:"•"}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:"AI Radar Scoring (0.0-9.0)"})]}),i.jsx("span",{children:"•"}),i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:"Vocabulary Word Bookmarks"})]})]})]}),i.jsxs("footer",{className:"mt-12 pt-8 border-t border-slate-200 text-center text-xs text-slate-500 flex flex-col sm:flex-row items-center justify-between gap-3 pb-8",children:[i.jsx("p",{children:"© 2026 Global Radio Shadowing SaaS. All rights reserved."}),i.jsxs("a",{href:"https://www.toolpilot.ai/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 transition-all shadow-2xs group",title:"Powered by ToolPilot.ai",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500 group-hover:rotate-12 transition-transform"}),i.jsxs("span",{children:["Powered by ",i.jsx("strong",{className:"font-semibold text-slate-900",children:"ToolPilot.ai"})]})]})]})]}),N&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl border border-slate-200 p-6 max-w-sm w-full relative flex flex-col gap-5",children:[i.jsx("button",{onClick:()=>T(!1),className:"absolute top-4 right-4 text-slate-400 hover:text-slate-600 transition-colors p-1 rounded-full cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl bg-emerald-50 text-emerald-600 flex items-center justify-center mx-auto mb-3 border border-emerald-200/50",children:i.jsx(vh,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Sign in to RadioShadow"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Access unlimited shadowing practice & PRO dictations"})]}),j&&i.jsx("div",{className:"p-3 bg-red-50 text-red-600 text-xs rounded-xl border border-red-200 flex flex-col gap-1.5",children:i.jsx("span",{children:j})}),i.jsxs("div",{className:"flex flex-col gap-2.5",children:[i.jsxs("button",{type:"button",onClick:Y,disabled:I,className:"w-full py-3 px-4 roun
4805ded-xl bg-white hover:bg-slate-50 text-slate-800 font-bold text-sm border border-slate-200 shadow-sm transition-all flex items-center justify-center gap-3 cursor-pointer active:scale-95 disabled:opacity-60",children:[i.jsxs("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),i.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),i.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),i.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),i.jsx("span",{children:"Continue with Google"})]}),i.jsxs("button",{type:"button",onClick:de,disabled:I,className:"w-full py-2.5 px-4 rounded-xl bg-emerald-50 hover:bg-emerald-100 text-emerald-700 font-semibold text-xs border border-emerald-200 transition-all flex items-center justify-center gap-2 cursor-pointer active:scale-95 disabled:opacity-60",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:"Instant Quick Demo Sign-In (No Google Needed)"})]})]}),i.jsxs("div",{className:"relative flex items-center justify-center my-1",children:[i.jsx("div",{className:"border-t border-slate-200 w-full"}),i.jsx("span",{className:"bg-white px-3 text-[10px] text-slate-400 font-medium uppercase absolute",children:"or email"})]}),i.jsxs("form",{onSubmit:W,className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Kd,{className:"h-4 w-4 text-slate-400"})}),i.jsx("input",{type:"email",required:!0,placeholder:"Enter your email address",value:R,onChange:he=>_(he.target.value),className:"block w-full pl-10 pr-3 py-3 border border-slate-300 rounded-xl leading-5 bg-white placeholder-slate-400 text-slate-900 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 sm:text-sm transition-all"})]}),i.jsx("button",{type:"submit",disabled:I||!R,className:"w-full py-3 px-4 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-md shadow-emerald-600/20 transition-all flex items-center justify-center gap-2 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",children:I?i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin"}),"Signing in..."]}):i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{children:"Continue with Email"}),i.jsx(qn,{className:"w-4 h-4"})]})})]})]})}),M&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl border border-slate-200 p-6 max-w-md w-full relative flex flex-col gap-6",children:[i.jsx("button",{onClick:()=>U(!1),className:"absolute top-4 right-4 text-slate-400 hover:text-slate-600 transition-colors p-1 rounded-full cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"text-center",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-bold bg-amber-50 text-amber-700 border border-amber-200 mb-3",children:[i.jsx(fr,{className:"w-3.5 h-3.5 text-amber-500 animate-bounce"}),i.jsx("span",{children:"RadioShadow PRO Benefits"})]}),i.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Unlock Your Full Linguistic Potential"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Become a powerful bilingual speaker with specialized continuous training"})]}),i.jsxs("div",{className:"space-y-3.5 bg-slate-50/50 p-4 rounded-2xl border border-slate-100",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Unlimited AI Pronunciation Feedback"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Practice shadowing any number of broadcast sentences without strict daily quotas."})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Advanced IELTS 7.5+ & Business Vocabulary"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Gain priority access to premium context definitions and native speaker idioms."})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Real-Time Acoustic Heatmaps"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Visualize syllable timing, phoneme pitch accuracy, and native stress rhythm."})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Offline Audio Export & Bookmarks"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Save dynamic dictionary callouts and download audio loops for on-the-go study."})]})]})]}),x?i.jsxs("div",{className:"p-3 bg-emerald-50 text-emerald-800 rounded-xl border border-emerald-200 text-center text-xs font-bold flex items-center justify-center gap-1.5",children:[i.jsx(kW,{className:"w-4 h-4 text-amber-500 fill-amber-500"}),i.jsx("span",{children:"Your PRO account is fully active! Enjoy the practice!"})]}):i.jsxs("div",{className:"flex flex-col gap-3 pt-2 border-t border-slate-100",children:[i.jsxs("h4",{className:"text-xs font-extrabold text-slate-800 text-center flex items-center justify-center gap-1.5 uppercase tracking-wide",children:[i.jsx(fr,{className:"w-4 h-4 text-amber-500 animate-pulse"})," Upgrade to PRO Instantly"]}),i.jsx("div",{className:"max-h-[160px] overflow-y-auto pr-1",children:i.jsx(X2,{user:h,clientId:re(),planId:H(),isVerifying:ee,setIsVerifying:ie,paymentError:G,setPaymentError:Z,onSuccess:()=>{U(!1),window.location.reload()},onOpenAuthModal:()=>{U(!1),T(!0)}})}),i.jsx("button",{onClick:()=>
4805U(!1),className:"w-full py-2 px-4 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-semibold text-xs transition-all text-center cursor-pointer mt-1",children:"Close & Continue Reading"})]})]})})]})}const o0={BASE_URL:"/",DEV:!1,MODE:"production",PROD:!0,SSR:!1,VITE_GA_MEASUREMENT_ID:"G-3L1D7R1Q03"};var l0={};const n_=[{id:"fb-1",slug:"mastering-c1-french-radio-carbon-neutrality",seoTitle:"Mastering C1 French: High-Frequency Radio Phrases & European Policy News",seoDescription:"Elevate your French listening comprehension with authentic radio excerpts from RTL France. Learn high-value vocabulary with context notes.",targetLanguage:"French (CEFR C1)",coverImageUrl:"https://images.unsplash.com/photo-1590602847861-f357a9332bbc?auto=format&fit=crop&w=1200&q=80",publishedAt:new Date}];function r6e(){const[n,e]=S.useState([]),[t,r]=S.useState(!0),{user:s,userProfile:a,loading:o,isPro:l,signInWithGoogle:c,signInWithEmail:d,signInAsGuest:h,logout:m}=Ji(),[p,x]=S.useState(!1),[y,v]=S.useState(!1),[B,E]=S.useState(""),[N,T]=S.useState(!1),[k,P]=S.useState(null),[R,_]=S.useState(!1),[I,D]=S.useState(!1),[j,O]=S.useState(null),M=()=>{try{if(typeof window<"u"&&o0!=null&&o0.VITE_PAYPAL_CLIENT_ID)return}catch{}try{if(typeof process<"u"&&l0){const z=l0.NEXT_PUBLIC_PAYPAL_CLIENT_ID||l0.VITE_PAYPAL_CLIENT_ID;if(z)return z}}catch{}return""},U=()=>{try{if(typeof window<"u"&&o0!=null&&o0.VITE_PAYPAL_PLAN_ID)return}catch{}try{if(typeof process<"u"&&l0){const z=l0.NEXT_PUBLIC_PAYPAL_PLAN_ID||l0.VITE_PAYPAL_PLAN_ID;if(z)return z}}catch{}return""},ee=async()=>{T(!0),P(null);try{await c(),x(!1)}catch(z){console.error("Google sign in error in blog:",z),P(z.message||"Failed to sign in with Google.")}finally{T(!1)}},ie=async()=>{T(!0),P(null);try{await h("Blog Guest"),x(!1)}catch(z){console.error("Guest sign in error in blog:",z),P(z.message||"Failed to sign in as guest.")}finally{T(!1)}},G=async z=>{if(z.preventDefault(),!!B.trim()){T(!0),P(null);try{await d(B.trim()),x(!1)}catch(se){console.error("Email sign in error in blog:",se),P(se.message||"Failed to sign in with email.")}finally{T(!1)}}};S.useEffect(()=>{let z=()=>{};if(typeof document<"u"){document.title="Language Learning Publications & Radio Shadowing Guides | RadioShadow AI";let se=document.querySelector('meta[name="description"]');se||(se=document.createElement("meta"),se.name="description",document.head.appendChild(se)),se.content="Explore curated language learning publications, linguistic breakdowns, and shadowing practice guides from live global radio broadcasts.";let re=document.querySelector('link[rel="canonical"]');re||(re=document.createElement("link"),re.rel="canonical",document.head.appendChild(re)),re.href="https://radioshadow.space/blog"}try{const se=vo(qs(fn,"pseo_articles"),aS("publishedAt","desc"));z=jm(se,re=>{if(re.empty)e(n_);else{const H=re.docs.map(Y=>({id:Y.id,...Y.data()}));e(H)}r(!1)},re=>{console.warn("[Blog Index] Firestore subscription notice:",re==null?void 0:re.message),e(n_),r(!1)})}catch(se){console.error("[Blog Index] Error fetching articles:",se),e(n_),r(!1)}return()=>z()},[]);const Z=z=>z?(z.toDate?z.toDate():new Date(z)).toLocaleDateString("en-US",{year:"numeric",month:"short",day:"numeric"}):"Recently Published";return i.jsxs("main",{className:"min-h-screen bg-slate-50 selection:bg-emerald-200 selection:text-emerald-900 font-sans antialiased pb-20",children:[i.jsx("nav",{className:"sticky top-0 z-40 bg-white/90 backdrop-blur-md border-b border-slate-200 px-4 sm:px-8 py-3.5",children:i.jsxs("div",{className:"max-w-7xl mx-auto flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("a",{href:"/",className:"inline-flex items-center gap-2 text-xs font-semibold text-slate-600 hover:text-slate-900 transition-all bg-slate-100 hover:bg-slate-200 px-3.5 py-1.5 rounded-full",children:[i.jsx(Rm,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Back to Radio App"})]}),i.jsxs("a",{href:"/ielts-speaking-mock-test",className:"inline-flex items-center gap-1.5 text-xs font-bold text-emerald-800 bg-emerald-50 hover:bg-emerald-100 border border-emerald-200/80 px-3.5 py-1.5 rounded-full transition-all shadow-2xs",title:"IELTS Speaking Mock Test & 1v1 AI Examiner Simulation",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{className:"hidden md:inline",children:"IELTS 1v1 Mock Test"}),i.jsx("span",{className:"md:hidden",children:"IELTS Mock"})]}),i.jsx("div",{className:"h-4 w-px bg-slate-200 hidden sm:block"}),i.jsxs("div",{className:"items-center gap-2 hidden sm:flex",children:[i.jsx(cn,{className:"w-4 h-4 text-emerald-600 animate-pulse"}),i.jsx("span",{className:"text-xs font-bold text-slate-800 font-display",children:"Global Radio Shadowing SaaS"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 relative",children:[o?i.jsxs("div",{className:"flex items-center gap-1.5 px-3 py-1.5 rounded-full bg-slate-100 text-slate-400 text-xs",children:[i.jsx(Bs,{className:"w-3.5 h-3.5 animate-spin"}),i.jsx("span",{children:"Checking..."})]}):s?i.jsxs("div",{className:"relative",children:[i.jsxs("button",{onClick:()=>v(!y),className:"inline-flex items-center gap-2 text-xs font-semibold text-slate-700 hover:text-slate-900 transition-all bg-white hover:bg-slate-50 border border-slate-200 px-3.5 py-1.5 rounded-full shadow-sm cursor-pointer",children:[i.jsx(vh,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{className:"max-w-[120px] truncate",children:(a==null?void 0:a.displayName)||s.email||"Learner"}),l?i.jsxs("span",{className:"px-1.5 py-0.2 text-[9px] font-extrabold uppercase bg-amber-500 text-white rounded font-mono flex items-center gap-0.5 shadow-sm",children:[i.jsx(fr,{className:"w-2.5 h-2.5"})," PRO"]}):i.jsx("span",{className:"px-1.5 py-0.2 text-[9px] font-bold uppercase bg-slate-100 text-slate-500 rounded font-mono",children:"Free"}),i.jsx(wy,{className:"w-3 h-3 text-slate-400"})]}),y&&i.jsxs("div",{className:"absolute right-0 mt-2 w-72 bg-white rounded-2xl shadow-xl border border-slate-200/80 p-4 z-50 animate-in fade-in slide-in-from-top-2 duration-150",children:[i.jsxs("div",{className:"pb-3 border-b border-slate-100 mb-3",children:[i.jsx("div",{className:"text-xs text-slate-400 font-medium",children:"Signed in as"}),i.jsx("div",{className:"text-sm font-bold text-slate-800 truncate",children:(a==null?void 0:a.displayName)||"Learner"}),i.jsx("div",{className:"text-xs text-slate-500 truncate",children:s.email||"Guest User"})]}),i.jsxs("div",{className:"space-y-3 mb-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs text-slate-500 font-medium",children:"Subscription"}),l?i.jsxs("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold bg-amber-50 text-amber-700 border border-amber-200",children:[i.jsx(fr,{className:"w-3 h-3"})," PRO Access"]}):i.jsx("span",{className:"inline-flex items-center gap-1 px-2.5 py-0.5 rounded-full text-xs font-bold bg-slate-50 text-slate-600 border border-slate-200",children:"Free Tier"})]}),!l&&i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs text-slate-500 font-medium",children:"Shadowing Quota"}),i.jsxs("span",{className:"text-xs font-mono font-bold text-emerald-600",children:[(a==null?void 0:a.remainingQuota)??10," sentences left"]})]})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("button",{onClick:()=>{v(!1),_(!0)},className:"w-full text-left inline-flex items-center gap-2 px-3 py-2 rounded-xl text-xs font-semibold text-emerald-700 bg-emerald-50 hover:bg-emerald-100 border border-emerald-200/50 transition-colors cursor-pointer",children:[i.jsx(sl,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"View My Membership Benefits"})]}),i.jsxs("button",{onClick:()=>{v(!1),m()},className:"w-full text-left inline-flex items-center gap-2 px-3 py-2 rounded-xl text-xs font-semibold text-rose-600 hover:bg-rose-50 transition-colors cursor-pointer",children:[i.jsx(fS,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Sign Out"})]})]})]})]}):i.jsxs("button",{onClick:()=>x(!0),className:"inline-flex items-center gap-1.5 text-xs font-semibold text-white bg-emerald-600 hover:bg-emerald-500 border border-emerald-700 px-4 py-2 rounded-full transition-all shadow-sm cursor-pointer shadow-emerald-600/10 active:scale-95",children:[i.jsx(vh,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Sign in"})]}),i.jsxs("button",{onClick:()=>_(!0),className:"inline-flex items-center gap-1.5 text-xs font-semibold text-slate-600 bg-slate-100 hover:bg-slate-200 border border-slate-200 px-3.5 py-2 rounded-full transition-all cursor-pointer",children:[i.jsx(fr,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{className:"hidden sm:inline",children:"PRO Benefits"})]})]})]})}),i.jsx("header",{className:"bg-white border-b border-slate-200/80 py-16 px-6 text-center relative overflow-hidden",children:i.jsxs("div",{className:"max-w-3xl mx-auto relative z-10",children:[i.jsxs("span",{className:"inline-flex items-center gap-2 text-xs font-bold uppercase tracking-wider text-emerald-700 bg-emerald-50 border border-emerald-200 px-3.5 py-1 rounded-full mb-4",children:[i.jsx(Ys,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Educational Publication & Guides"})]}),i.jsx("h1",{className:"text-4xl md:text-5xl font-extrabold text-slate-900 tracking-tight font-display mb-4",children:"Language Learning Resources"}),i.jsx("p",{className:"text-lg text-slate-600 max-w-xl mx-auto font-normal leading-relaxed",children:"Master native expressions with AI-curated broadcast snippets and real-world linguistic breakdowns."})]})}),i.jsx("section",{className:"max-w-7xl mx-auto p-6 md:p-8 mt-6",children:t?i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:[1,2,3].map(z=>i.jsxs("div",{className:"bg-white border border-slate-200 rounded-2xl p-6 h-64 animate-pulse",children:[i.jsx("div",{className:"h-4 bg-slate-100 rounded w-1/3 mb-4"}),i.jsx("div",{className:"h-6 bg-slate-100 rounded w-full mb-2"}),i.jsx("div",{className:"h-6 bg-slate-100 rounded w-3/4 mb-4"}),i.jsx("div",{className:"h-4 bg-slate-100 rounded w-1/2"})]},z))}):n.length===0?i.jsxs("div",{className:"text-center py-16 bg-white border border-slate-200 rounded-3xl p-8 max-w-md mx-auto",children:[i.jsx(Ys,{className:"w-10 h-10 text-slate-300 mx-auto mb-3"}),i.jsx("h3",{className:"font-bold text-slate-800 text-lg mb-1",children:"No Articles Found"}),i.jsx("p",{className:"text-xs text-slate-500 mb-6",children:"Articles generated by the AI pSEO engine will appear here."}),i.jsx("a",{href:"/",className:"inline-flex items-center gap-2 text-xs font-bold bg-slate-900 text-white px-5 py-2.5 rounded-full hover:bg-slate-800 transition-all",children:i.jsx("span",{children:"Back to Radio App"})})]}):i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 lg:grid-cols-3 gap-6",children:n.map(z=>i.jsxs("a",{href:`/blog/${z.slug}`,className:"bg-white/80 backdrop-blur-sm border border-slate-200 rounded-2xl overflow-hidden hover:shadow-xl hover:-translate-y-1 transition-all flex flex-col justify-between group cursor-pointer",children:[z.coverImageUrl&&i.jsx("div",{className:"h-44 w-full overflow-hidden bg-slate-100 relative",children:i.jsx("img",{src:z.coverImageUrl,alt:z.seoTitle,className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-500",referrerPolicy:"no-referrer"})}),i.jsxs("div",{className:"p-6 flex-1 flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 mb-3",children:[i.jsx("span",{className:"text-[11px] font-bold uppercase tracking-wider text-emerald-700 bg-emerald-50 border border-emerald-200/60 px-2.5 py-0.5 rounded-full",children:z.targetLanguage||"Language Study"}),i.jsxs("span",{className:"text-[11px] text-slate-400 font-mono flex items-center gap-1",children:[i.jsx(uS,{className:"w-3 h-3"}),Z(z.publishedAt)]})]}),i.jsx("h2",{className:"text-lg font-bold text-slate-900 group-hover:text-emerald-600 transition-colors line-clamp-2 leading-snug mb-2 font-display",children:z.seoTitle}),z.seoDescription&&i.jsx("p",{className:"text-xs text-slate-500 line-clamp-2 leading-relaxed mb-4",children:z.seoDescription})]}),i.jsxs("div",{className:"pt-3 border-t border-slate-100 flex items-center justify-between text-xs font-semibold text-emerald-600 group-hover:text-emerald-700 mt-2",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(EW,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:"Read Article & Practice"})]}
4805),i.jsx(qn,{className:"w-4 h-4 transform group-hover:translate-x-1 transition-transform"})]})]})]},z.id||z.slug))})}),i.jsxs("footer",{className:"mt-16 pt-8 border-t border-slate-200 text-center text-xs text-slate-500 pb-12 flex flex-col sm:flex-row items-center justify-between gap-3",children:[i.jsx("p",{children:"© 2026 Global Radio Shadowing SaaS. All rights reserved."}),i.jsxs("a",{href:"https://www.toolpilot.ai/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-full text-xs font-medium bg-slate-100 hover:bg-slate-200 text-slate-700 border border-slate-200 transition-all shadow-2xs group",title:"Powered by ToolPilot.ai",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500 group-hover:rotate-12 transition-transform"}),i.jsxs("span",{children:["Powered by ",i.jsx("strong",{className:"font-semibold text-slate-900",children:"ToolPilot.ai"})]})]})]}),p&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl border border-slate-200 p-6 max-w-sm w-full relative flex flex-col gap-5",children:[i.jsx("button",{onClick:()=>x(!1),className:"absolute top-4 right-4 text-slate-400 hover:text-slate-600 transition-colors p-1 rounded-full cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"text-center",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl bg-emerald-50 text-emerald-600 flex items-center justify-center mx-auto mb-3 border border-emerald-200/50",children:i.jsx(vh,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Sign in to RadioShadowAI"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Access unlimited shadowing practice & PRO dictations"})]}),k&&i.jsx("div",{className:"p-3 bg-red-50 text-red-600 text-xs rounded-xl border border-red-200 flex flex-col gap-1.5",children:i.jsx("span",{children:k})}),i.jsxs("div",{className:"flex flex-col gap-2.5",children:[i.jsxs("button",{type:"button",onClick:ee,disabled:N,className:"w-full py-3 px-4 rounded-xl bg-white hover:bg-slate-50 text-slate-800 font-bold text-sm border border-slate-200 shadow-sm transition-all flex items-center justify-center gap-3 cursor-pointer active:scale-95 disabled:opacity-60",children:[i.jsxs("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),i.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),i.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),i.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),i.jsx("span",{children:"Continue with Google"})]}),i.jsxs("button",{type:"button",onClick:ie,disabled:N,className:"w-full py-2.5 px-4 rounded-xl bg-emerald-50 hover:bg-emerald-100 text-emerald-700 font-semibold text-xs border border-emerald-200 transition-all flex items-center justify-center gap-2 cursor-pointer active:scale-95 disabled:opacity-60",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:"Instant Quick Demo Sign-In (No Google Needed)"})]})]}),i.jsxs("div",{className:"relative flex items-center justify-center my-1",children:[i.jsx("div",{className:"border-t border-slate-200 w-full"}),i.jsx("span",{className:"bg-white px-3 text-[10px] text-slate-400 font-medium uppercase absolute",children:"or email"})]}),i.jsxs("form",{onSubmit:G,className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Kd,{className:"h-4 w-4 text-slate-400"})}),i.jsx("input",{type:"email",required:!0,placeholder:"Enter your email address",value:
4805B,onChange:z=>E(z.target.value),className:"block w-full pl-10 pr-3 py-3 border border-slate-300 rounded-xl leading-5 bg-white placeholder-slate-400 text-slate-900 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 sm:text-sm transition-all"})]}),i.jsx("button",{type:"submit",disabled:N||!B,className:"w-full py-3 px-4 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-md shadow-emerald-600/20 transition-all flex items-center justify-center gap-2 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",children:N?i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin"}),"Signing in..."]}):i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx("span",{children:"Continue with Email"}),i.jsx(qn,{className:"w-4 h-4"})]})})]})]})}),R&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 backdrop-blur-md p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white rounded-3xl shadow-2xl border border-slate-200 p-6 max-w-md w-full relative flex flex-col gap-6",children:[i.jsx("button",{onClick:()=>_(!1),className:"absolute top-4 right-4 text-slate-400 hover:text-slate-600 transition-colors p-1 rounded-full cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"text-center",children:[i.jsxs("span",{className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-bold bg-amber-50 text-amber-700 border border-amber-200 mb-3",children:[i.jsx(fr,{className:"w-3.5 h-3.5 text-amber-500 animate-bounce"}),i.jsx("span",{children:"RadioShadow PRO Benefits"})]}),i.jsx("h3",{className:"text-xl font-bold text-slate-900",children:"Unlock Your Full Linguistic Potential"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"Become a powerful bilingual speaker with specialized continuous training"})]}),i.jsxs("div",{className:"space-y-3.5 bg-slate-50/50 p-4 rounded-2xl border border-slate-100",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Unlimited AI Pronunciation Feedback"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Practice shadowing any number of broadcast sentences without strict daily quotas."})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Advanced IELTS 7.5+ & Business Vocabulary"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Gain priority access to premium context definitions and native speaker idioms."})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Real-Time Acoustic Heatmaps"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Visualize syllable timing, phoneme pitch accuracy, and native stress rhythm."})]})]}),i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-600 mt-0.5 flex-shrink-0"}),i.jsxs("div",{children:[i.jsx("h4",{className:"text-xs font-bold text-slate-800",children:"Offline Audio Export & Bookmarks"}),i.jsx("p",{className:"text-[11px] text-slate-500 leading-normal",children:"Save dynamic dictionary callouts and download audio loops for on-the-go study."})]})]})]}),l?i.jsxs("div",{className:"p-3 bg-emerald-50 text-emerald-800 rounded-xl border border-emerald-200 text-center text-xs font-bold flex items-center justify-center gap-1.5",children:[i.jsx(kW,{className:"w-4 h-4 text-amber-500 fill-amber-500"}),i.jsx("span",{children:"Your PRO account is fully active! Enjoy the practice!"})]}):i.jsxs("div",{className:"flex flex-col gap-3 pt-2 border-t border-slate-100",children:[i.jsxs("h4",{className:"text-xs font-extrabold text-slate-800 text-center flex items-center justify-center gap-1.5 uppercase tracking-wide",children:[i.jsx(fr,{className:"w-4 h-4 text-amber-500 animate-pulse"})," Upgrade to PRO Instantly"]}),i.jsx("div",{className:"max-h-[160px] overflow-y-auto pr-1",children:i.jsx(X2,{user:s,clientId:M(),planId:U(),isVerifying:I,setIsVerifying:D,paymentError:j,setPaymentError:O,onSuccess:()=>{_(!1),window.location.reload()},onOpenAuthModal:()=>{_(!1),x(!0)}})}),i.jsx("button",{onClick:()=>
4805_(!1),className:"w-full py-2 px-4 rounded-xl bg-slate-100 hover:bg-slate-200 text-slate-700 font-semibold text-xs transition-all text-center cursor-pointer mt-1",children:"Close & Continue Reading"})]})]})})]})}const s6e="modulepreload",a6e=function(n){return"/"+n},e$={},c0=function(e,t,r){let s=Promise.resolve();if(t&&t.length>0){let o=function(d){return Promise.all(d.map(h=>Promise.resolve(h).then(m=>({status:"fulfilled",value:m}),m=>({status:"rejected",reason:m}))))};document.getElementsByTagName("link");const l=document.querySelector("meta[property=csp-nonce]"),c=(l==null?void 0:l.nonce)||(l==null?void 0:l.getAttribute("nonce"));s=o(t.map(d=>{if(d=a6e(d),d in e$)return;e$[d]=!0;const h=d.endsWith(".css"),m=h?'[rel="stylesheet"]':"";if(document.querySelector(`link[href="${d}"]${m}`))return;const p=document.createElement("link");if(p.rel=h?"stylesheet":s6e,h||(p.as="script"),p.crossOrigin="",p.href=d,c&&p.setAttribute("nonce",c),document.head.appendChild(p),h)return new Promise((x,y)=>{p.addEventListener("load",x),p.addEventListener("error",()=>y(new Error(`Unable to preload CSS for ${d}`)))})}))}function a(o){const l=new Event("vite:preloadError",{cancelable:!0});if(l.payload=o,window.dispatchEvent(l),!l.defaultPrevented)throw o}return s.then(o=>{for(const l of o||[])l.status==="rejected"&&a(l.reason);return e().catch(a)})};function ate({report:n,audioBlob:e,onClose:t,onNavigateToDashboard:r,onSaveWord:s}){var P,R,_,I,D,j,O;const{t:a,isZh:o}=Or(),[l,c]=S.useState("transcript"),[d,h]=S.useState(null),[m,p]=S.useState({}),[x,y]=S.useState(!1),[v,B]=S.useState(()=>e?URL.createObjectURL(e):n.audioDataUrl||null),E=M=>{var U,ee,ie;if(typeof window<"u"&&"speechSynthesis"in window){window.speechSynthesis.cancel();const G=new SpeechSynthesisUtterance(M);G.lang=(U=n.language)!=null&&U.toLowerCase().includes("french")?"fr-FR":(ee=n.language)!=null&&ee.toLowerCase().includes("spanish")?"es-ES":(ie=n.language)!=null&&ie.toLowerCase().includes("german")?"de-DE":"en-US",window.speechSynthesis.speak(G)}},N=(M,U)=>{p(ee=>({...ee,[M]:!0})),s&&s(M,U)},T=M=>{const U=Math.floor(M/60),ee=M%60;return o?`${U}分 ${ee}秒`:`${U}m ${ee}s`},k=M=>{switch(M){case"perfect":return i.jsx("span",{className:"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20 text-[10px] font-bold px-2 py-0.5 rounded-full",children:o?"完美 100%":"Perfect 100%"});case"good":return i.jsx("span",{className:"bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20 text-[10px] font-bold px-2 py-0.5 rounded-full",children:o?"良好 85%+":"Good 85%+"});case"hesitation":return i.jsx("span",{className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20 text-[10px] font-bold px-2 py-0.5 rounded-full",children:o?"停顿犹豫":"Hesitation"});case"mispronounced":return i.jsx("span",{className:"bg-rose-500/10 text-rose-600 dar
4805k:text-rose-400 border border-rose-500/20 text-[10px] font-bold px-2 py-0.5 rounded-full",children:o?"发音瑕疵":"Phonetic Flaw"});case"missed":return i.jsx("span",{className:"bg-slate-500/10 text-slate-600 dark:text-slate-400 border border-slate-500/20 text-[10px] font-bold px-2 py-0.5 rounded-full",children:o?"漏读":"Dropped"});default:return null}};return i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/70 backdrop-blur-sm p-3 md:p-6 overflow-y-auto",children:[i.jsxs(cs.div,{initial:{opacity:0,scale:.95,y:15},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:15},className:"bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-3xl max-w-4xl w-full shadow-2xl overflow-hidden flex flex-col max-h-[90vh]",children:[i.jsxs("div",{className:"p-4 md:p-6 border-b border-slate-100 dark:border-slate-800 flex items-center justify-between bg-gradient-to-r from-slate-50 to-white dark:from-slate-900 dark:to-slate-850",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"p-2.5 rounded-2xl bg-emerald-500 text-white shadow-lg shadow-emerald-500/20",children:i.jsx(yn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h2",{className:"text-lg md:text-xl font-extrabold text-slate-900 dark:text-slate-100",children:o?"连续跟读诊断笔记":"Continuous Shadowing Notebook"}),i.jsx("span",{className:"text-[10px] font-extrabold bg-amber-500/15 text-amber-600 dark:text-amber-400 border border-amber-500/20 px-2 py-0.5 rounded-md uppercase tracking-wider",children:o?"PRO AI 深度诊断":"PRO AI Diagnosis"})]}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 flex items-center gap-2 mt-0.5",children:[i.jsx("span",{children:n.stationName}),i.jsx("span",{children:"•"}),i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Eo,{className:"w-3 h-3 text-emerald-500"}),T(n.durationSeconds)]}),i.jsx("span",{children:"•"}),i.jsxs("span",{children:[n.totalSentencesCount," ",o?"条广播原文":"Broadcast Sentences"]})]})]})]}),i.jsx("button",{onClick:t,className:"p-2 rounded-full text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-4 md:p-6 bg-slate-50/70 dark:bg-slate-850/50 border-b border-slate-100 dark:border-slate-800 grid grid-cols-2 sm:grid-cols-4 gap-3",children:[i.jsxs("div",{className:"p-3 bg-white dark:bg-slate-900 rounded-2xl border border-slate-200/80 dark:border-slate-800 shadow-sm flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-100 dark:bg-emerald-950/80 text-emerald-600 dark:text-emerald-400 flex items-center justify-center font-extrabold text-lg",children:n.overallBand?n.overallBand.toFixed(1):"7.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] uppercase font-bold text-slate-400 tracking-wider",children:o?"口语流利度评级":"Fluency Band"}),i.jsx("p",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:n.overallBand>=7.5?o?"C1 熟练":"C1 Proficient":n.overallBand>=6.5?o?"B2 进阶":"B2 Advanced":o?"B1 中级":"B1 Intermediate"})]})]}),i.jsxs("div",{className:"p-3 bg-white dark:bg-slate-900 rounded-2xl border border-slate-200/80 dark:border-slate-800 shadow-sm flex items-center gap-3",children:[i.jsxs("div",{className:"w-10 h-10 rounded-xl bg-blue-100 dark:bg-blue-950/80 text-blue-600 dark:text-blue-400 flex items-center justify-center font-extrabold text-base",children:[n.fluencyScore||82,"%"]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] uppercase font-bold text-slate-400 tracking-wider",children:o?"流利度":"Fluency Flow"}),i.jsx("p",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:o?"发音连贯性":"Speech Continuity"})]})]}),i.jsxs("div",{className:"p-3 bg-white dark:bg-slate-900 rounded-2xl border border-slate-200/80 dark:border-slate-800 shadow-sm flex items-center gap-3",children:[i.jsxs("div",{className:"w-10 h-10 rounded-xl bg-purple-100 dar
4805k:bg-purple-950/80 text-purple-600 dark:text-purple-400 flex items-center justify-center font-extrabold text-base",children:[n.pacingSyncRate||80,"%"]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] uppercase font-bold text-slate-400 tracking-wider",children:o?"原声同步率":"Pacing Sync"}),i.jsx("p",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:o?"语速节奏匹配":"Broadcast Alignment"})]})]}),i.jsxs("div",{className:"p-3 bg-white dark:bg-slate-900 rounded-2xl border border-slate-200/80 dark:border-slate-800 shadow-sm flex items-center gap-3",children:[i.jsxs("div",{className:"w-10 h-10 rounded-xl bg-amber-100 dark:bg-amber-950/80 text-amber-600 dark:text-amber-400 flex items-center justify-center font-extrabold text-base",children:[n.coverageScore||85,"%"]}),i.jsxs("div",{children:[i.jsx("p",{className:"text-[10px] uppercase font-bold text-slate-400 tracking-wider",children:o?"文本覆盖率":"Script Coverage"}),i.jsx("p",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:o?"无遗漏长句":"No Dropped Blocks"})]})]})]}),v&&i.jsxs("div",{className:"px-4 py-2.5 bg-slate-100 dark:bg-slate-800/80 border-b border-slate-200 dark:border-slate-700 flex items-center justify-between gap-3 text-xs",children:[i.jsxs("div",{className:"flex items-center gap-2 text-slate-600 dark:text-slate-300 font-medium",children:[i.jsx(on,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:o?"回听本次跟读录音会话:":"Listen to your recording session:"})]}),i.jsx("audio",{controls:!0,src:v,className:"h-8 max-w-xs md:max-w-md w-full"})]}),i.jsxs("div",{className:"flex border-b border-slate-100 dark:border-slate-800 px-4 md:px-6 gap-4 bg-white dark:bg-slate-900",children:[i.jsxs("button",{onClick:()=>c("transcript"),className:`py-3 text-xs font-bold border-b-2 flex items-center gap-1.5 transition-colors cursor-pointer ${l==="transcript"?"border-emerald-500 text-emerald-600 dark:text-emerald-400":"border-transparent text-slate-500 hover:text-slate-800 dark:hover:text-slate-200"}`,children:[i.jsx(Ys,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:o?`完整原文与分句评测 (${((P=n.sentences)==null?void 0:P.length)||0})`:`Full Transcript & Sentence Breakdown (${((R=n.sentences)==null?void 0:R.length)||0})`})]}),i.jsxs("button",{onClick:()=>c("problemWords"),className:`py-3 text-xs font-bold border-b-2 flex items-center gap-1.5 transition-colors cursor-pointer ${l==="problemWords"?"border-emerald-500 text-emerald-600 dark:text-emerald-400":"border-transparent text-slate-500 hover:text-slate-800 dark:hover:text-slate-200"}`,children:[i.jsx(Qa,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:o?`高频瑕疵生词 (${((_=n.keyProblemWords)==null?void 0:_.length)||0})`:`Key Problem Words (${((I=n.keyProblemWords)==null?void 0:I.length)||0})`})]}),i.jsxs("button",{onClick:()=>c("radar"),className:`py-3 text-xs font-bold border-b-2 flex items-center gap-1.5 transition-colors cursor-pointer ${l==="radar"?"border-emerald-500 text-emerald-600 dark:text-emerald-400":"border-transparent text-slate-500 hover:text-slate-800 dark:hover:text-slate-200"}`,children:[i.jsx(fbe,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:o?"声学雷达与提分建议":"Acoustic Radar & Tips"})]})]}),i.jsxs("div",{className:"p-4 md:p-6 overflow-y-auto flex-1 custom-scrollbar",children:[l==="transcript"&&i.jsxs("div",{className:"space-y-4",children:[n.summaryFeedback&&i.jsxs("div",{className:"p-3.5 rounded-2xl bg-emerald-50/70 dark:bg-emerald-950/30 border border-emerald-200/50 dark:border-emerald-800/40 text-xs text-emerald-900 dark:text-emerald-200 flex items-start gap-2.5",children:[i.jsx(At,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400 shrink-0 mt-0.5"}),i.jsx("p",{className:"leading-relaxed",children:n.summaryFeedback})]}),i.jsx("div",{className:"space-y-3",children:(D=n.sentences)==null?void 0:D.map((M,U)=>i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-850 border border-slate-200/80 dark:border-slate-800 transition-all hover:border-emerald-500/40",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("span",{className:"text-[11px] font-mono font-bold text-slate-400",children:["#",M.sentenceIndex||U+1]}),i.jsxs("div",{className:"flex items-center gap-2",children:[k(M.status),M.score!==void 0&&i.jsxs("span",{className:"text-xs font-mono font-extrabold text-slate-700 dark:text-slate-300",children:[M.score," ",o?"分":"pts"]})]})]}),i.jsx("div",{className:"text-xs md:text-sm font-medium text-slate-900 dark:text-slate-100 leading-relaxed",children:M.original}),i.jsxs("div",{className:"mt-2.5 flex items-center flex-wrap gap-2 pt-2 border-t border-slate-200/40 dark:border-slate-800",children:[i.jsxs("button",{type:"button",onClick:()=>E(M.original),className:"text-[11px] font-medium px-2.5 py-1 rounded-lg bg-emerald-50 dark:bg-emerald-950/40 text-emerald-700 dark:text-emerald-300 border border-emerald-200 dark:border-emerald-800/40 flex items-center gap-1.5 hover:bg-emerald-100 dark:hover:bg-emerald-900/60 transition-colors cursor-pointer",title:o?"播放标准广æ
4805’­å‘音":"Play native broadcast standard voice",children:[i.jsx(on,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),i.jsx("span",{children:o?"📻 广播原声示范":"📻 Broadcast Standard"})]}),v&&i.jsxs("button",{type:"button",onClick:()=>{const ee=document.querySelector("audio");ee&&ee.play()},className:"text-[11px] font-medium px-2.5 py-1 rounded-lg bg-blue-50 dark:bg-blue-950/40 text-blue-700 dark:text-blue-300 border border-blue-200 dark:border-blue-800/40 flex items-center gap-1.5 hover:bg-blue-100 dark:hover:bg-blue-900/60 transition-colors cursor-pointer",title:o?"回听你的跟读原声":"Play your recorded voice",children:[i.jsx(Nn,{className:"w-3.5 h-3.5 text-blue-600 dark:text-blue-400"}),i.jsx("span",{children:o?"🎙️ 我的跟读原声":"🎙️ My Spoken Voice"})]})]}),M.userSpoken&&M.userSpoken!==M.original&&i.jsxs("div",{className:"mt-2 text-xs text-slate-500 dark:text-slate-400 flex items-start gap-1.5 bg-white/60 dark:bg-slate-900/60 p-2 rounded-xl border border-slate-200/50 dark:border-slate-800",children:[i.jsx("span",{className:"font-bold text-slate-400 shrink-0",children:o?"识别到的发音:":"Heard:"}),i.jsx("span",{className:"italic",children:M.userSpoken})]}),M.issues&&M.issues.length>0&&i.jsx("div",{className:"mt-2.5 flex flex-wrap gap-2 pt-2 border-t border-slate-200/50 dark:border-slate-800",children:M.issues.map((ee,ie)=>i.jsxs("button",{type:"button",onClick:()=>h(ee),className:"text-[11px] font-medium px-2 py-1 rounded-lg bg-rose-50 dark:bg-rose-950/40 text-rose-700 dark:text-rose-300 border border-rose-200 dark:border-rose-800/40 flex items-center gap-1.5 hover:bg-rose-100 dark:hover:bg-rose-900/60 transition-colors cursor-pointer",children:[i.jsx("span",{className:"font-bold",children:ee.word}),i.jsx("span",{className:"text-[10px] text-rose-500 font-mono",children:ee.type})]},ie))})]},U))})]}),l==="problemWords"&&i.jsxs("div",{className:"space-y-4",children:[i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:o?"这些词汇在连续跟读过程中存在明显的发音不连贯、吞音或声调重音偏移。点击可听示范发音并加入生词本复习。":"These words had noticeable acoustic friction, omitted syllables, or phonetic stress divergence during your continuous shadowing session. Click to listen and add to your revision deck."}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:(j=n.keyProblemWords)==null?void 0:j.map((M,U)=>i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-800 flex flex-col justify-between gap-3 shadow-sm hover:border-emerald-500 transition-all",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsxs("h4",{className:"text-base font-extrabold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[M.word,M.phonetic&&i.jsx("span",{className:"text-xs font-mono font-normal text-emerald-600 dark:text-emerald-400",children:M.phonetic})]}),M.frequencyTag&&i.jsx("span",{className:"text-[10px] font-bold bg-amber-500/10 text-amber-600 dark:text-amber-400 px-1.5 py-0.5 rounded border border-amber-500/20",children:M.frequencyTag})]}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed mb-2",children:M.meaning}),M.example&&i.jsxs("p",{className:"text-[11px] italic text-slate-400 border-l-2 border-slate-300 dark:border-slate-700 pl-2",children:['"',M.example,'"']})]}),i.jsxs("div",{className:"flex items-center justify-between pt-2 border-t border-slate-200/60 dark:border-slate-800",children:[i.jsxs("button",{type:"button",onClick:()=>E(M.word),className:"p-2 rounded-xl bg-white dark:bg-slate-900 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-50 dark:hover:bg-emerald-950/40 border border-slate-200 dark:border-slate-700 transition-colors flex items-center gap-1 text-xs font-semibold cursor-pointer",children:[i.jsx(on,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:o?"示范读音":"Pronounce"})]}),i.jsxs("button",{type:"button",onClick:()=>N(M.word,M.meaning),disabled:m[M.word],className:`py-1.5 px-3 rounded-xl text-xs font-semibold flex items-center gap-1.5 transition-colors cursor-pointer ${m[M.word]?"bg-emerald-100 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400":"bg-slate-900 dark:bg-slate-100 text-white dark:text-slate-900 hover:bg-slate-800"}`,children:[i.jsx(Jo,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:m[M.word]?o?"已收藏":"Saved to Deck":o?"收藏生词":"Save Word"})]})]})]},U))})]}),l==="radar"&&i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 items-center",children:[i.jsxs("div",{className:"bg-slate-50 dark:bg-slate-850 p-4 rounded-3xl border border-slate-200 dark:border-slate-800 flex flex-col items-center",children:[i.jsx("h4",{className:"text-xs font-extrabold uppercase tracking-wider text-slate-400 mb-2",children:o?"声学维度矩阵评测":"Acoustic Matr
4805ix Diagnostics"}),i.jsx("div",{className:"w-full h-56",children:i.jsx(Nv,{width:"100%",height:"100%",children:i.jsxs(zv,{cx:"50%",cy:"50%",outerRadius:"75%",data:n.radarMetrics||[],children:[i.jsx(lx,{stroke:"#e2e8f0"}),i.jsx(cx,{dataKey:"metric",tick:{fill:"#64748b",fontSize:11,fontWeight:"bold"}}),i.jsx(ux,{name:o?"跟读表现":"Shadowing Performance",dataKey:"value",stroke:"#10b981",fill:"#10b981",fillOpacity:.4})]})})})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("h4",{className:"text-sm font-extrabold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[i.jsx(nye,{className:"w-4 h-4 text-amber-500"}),o?"AI 教练提分实战建议":"Actionable Coach Directives"]}),(O=n.actionableTips)==null?void 0:O.map((M,U)=>i.jsxs("div",{className:"p-3.5 rounded-2xl bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-800 text-xs text-slate-700 dark:text-slate-300 flex items-start gap-3",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-emerald-100 dark:bg-emerald-950 text-emerald-600 dark:text-emerald-400 flex items-center justify-center font-mono font-bold text-[10px] shrink-0 mt-0.5",children:U+1}),i.jsx("p",{className:"leading-relaxed",children:M})]},U))]})]})]}),i.jsxs("div",{className:"p-4 md:p-6 border-t border-slate-100 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50 flex flex-col sm:flex-row items-center justify-between gap-3",children:[i.jsxs("p",{className:"text-xs text-slate-400",children:[o?"已自动保存至您的个人 ":"Saved automatically into your personal ",i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-200",children:o?"跟读生词笔记本":"Shadowing Notebook"}),"。"]}),i.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[r&&i.jsxs("button",{type:"button",onClick:()=>{t(),r()},className:"flex-1 sm:flex-none py-2.5 px-4 rounded-xl border border-slate-200 dark:border-slate-700 hover:bg-slate-100 dark:hover:bg-slate-800 text-xs font-bold text-slate-700 dark:text-slate-200 transition-colors flex items-center justify-center gap-1.5 cursor-pointer",children:[i.jsx("span",{children:o?"在个人中心查看生词本":"View in Dashboard Notebook"}),i.jsx(Md,{className:"w-3.5 h-3.5"})]}),i.jsx("button",{type:"button",onClick:t,className:"flex-1 sm:flex-none py-2.5 px-5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs shadow-md shadow-emerald-500/20 transition-all cursor-pointer",children:o?"完成":"Done"})]})]})]}),i.jsx(Qo,{children:d&&i.jsx("div",{className:"fixed inset-0 z-60 flex items-center justify-center bg-slate-950/50 backdrop-blur-xs p-4",children:i.jsxs(cs.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},exit:{opacity:0,scale:.9},className:"bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-3xl p-5 max-w-sm w-full shadow-2xl relative",children:[i.jsx("button",{onClick:()=>h(null),className:"absolute top-4 right-4 p-1 rounded-full text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800",children:i.jsx(Ts,{className:"w-4 h-4"})}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"text-base font-extrabold text-slate-900 dark:text-slate-100",children:d.word}),d.phonetic&&i.jsx("span",{className:"text-xs font-mono text-emerald-500",children:d.phonetic})]}),i.jsxs("div",{className:"mb-4 text-xs text-slate-600 dark:text-slate-300 bg-slate-50 dark:bg-slate-800 p-3 rounded-2xl border border-slate-100 dark:border-slate-750",children:[i.jsxs("p",{className:"font-bold text-rose-500 mb-1 capitalize",children:[o?"瑕疵类型":"Issue",": ",d.type]}),i.jsx("p",{className:"leading-relaxed",children:d.suggestion})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>E(d.word),className:"flex-1 py-2 rounded-xl bg-emerald-50 text-emerald-600 dark:bg-emerald-950 dark:text-emerald-400 font-bold text-xs flex items-center justify-center gap-1.5 cursor-pointer",children:[i.jsx(on,{className:"w-3.5 h-3.5"}),o?"听发音":"Listen"]}),i.jsxs("button",{type:"button",onClick:()=>{N(d.word,d.suggestion),h(null)},className:"flex-1 py-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center justify-center gap-1.5 cursor-pointer",children:[i.jsx(Jo,{className:"w-3.5 h-3.5"}),o?"加入生词本":"Add to Deck"]})]})]})})})]})}function ite({evaluationResult:n,targetSentence:e,translatedSentence:t,userAudioUrl:r,nativeAudioUrl:s,stationName:a="Global Live Radio",language:o="English",onClose:l,onSaveWord:c}){var Z,z,se;const{isZh:d}=Or(),h=Math.min(100,Math.max(0,n.overallScore??(n.estimatedBand?Math.round(n.estimatedBand*11):82))),m=n.cefrLevel||(h>=90?"C2 Mastery Flow":h>=80?"C1 Advanced Flow":h>=70?"B2 Upper Intermediate":h>
4805=60?"B1 Intermediate":"A2 Elementary"),p=e.split(/\s+/).filter(Boolean),x=n.wordAnalysis&&n.wordAnalysis.length>0?n.wordAnalysis:p.map((re,H)=>{const Y=re.replace(/[^a-zA-Z0-9'À-ÿ]/g,"");return H===Math.floor(p.length/2)?{word:re,status:"error",ipa:`/${Y.toLowerCase()}/`,errorAnalysis:d?`'${Y}' 的重音位置偏差,且连读 (liaison) 缺失,导致咬音较僵硬。`:`Stress misplaced on '${Y}' and missing soft liaison, creating stiff articulation.`}:H===Math.floor(p.length/4)&&p.length>3?{word:re,status:"minor_deviation",ipa:`/${Y.toLowerCase()}/`,errorAnalysis:d?`'${Y}' 中的元音调位偏沉,轻微脱离了原生电台的自然声调。`:`Vowel pitch on '${Y}' is slightly muted compared to native broadcast rhythm.`}:{word:re,status:"correct",ipa:`/${Y.toLowerCase()}/`,errorAnalysis:null}}),y=x.find(re=>re.status!=="correct")||x[0],[v,B]=S.useState(y),[E,N]=S.useState({}),[T,k]=S.useState(!1),[P,R]=S.useState(!1),_=S.useRef(null),I=S.useRef(null),D=n.radarMetrics&&n.radarMetrics.length>=3?n.radarMetrics:[{metric:d?"流利度 (Fluency)":"Fluency",value:Math.min(100,Math.round(h*.98))},{metric:d?"准确度 (Accuracy)":"Accuracy",value:Math.min(100,Math.round(h*.95))},{metric:d?"完整度 (Completeness)":"Completeness",value:Math.min(100,Math.round(h*1.02))}],j=((Z=D.find(re=>re.metric.toLowerCase().includes("fluency")||re.metric.includes("流利")))==null?void 0:Z.value)||Math.round(h*.98),O=((z=D.find(re=>re.metric.toLowerCase().includes("accuracy")||re.metric.includes("准确")))==null?void 0:z.value)||Math.round(h*.95),M=((se=D.find(re=>re.metric.toLowerCase().includes("completeness")||re.metric.includes("完整")||re.metric.toLowerCase().includes("pronunciation")))==null?void 0:se.value)||Math.round(h*1.02),U=re=>{const H=re.replace(/[^a-zA-Z0-9'À-ÿ]/g,"");if(typeof window<"u"&&"speechSynthesis"in window){window.speechSynthesis.cancel();const Y=new SpeechSynthesisUtterance(H),de=o.toLowerCase();Y.lang=de.includes("french")||de.includes("fr")?"fr-FR":de.includes("spanish")||de.includes("es")?"es-ES":de.includes("german")||de.includes("de")?"de-DE":de.includes("italian")||de.includes("it")?"it-IT":"en-US",Y.rate=.85,window.speechSynthesis.speak(Y)}},ee=()=>{if(T&&_.current&&(_.current.pause(),k(!1)),s&&I.current)P?(I.current.pause(),R(!1)):(I.current.play().catch(console.error),R(!0));else if(typeof window<"u"&&"speechSynthesis"in window)if(P)window.speechSynthesis.cancel(),R(!1);else{window.speechSynthesis.cancel();const re=new SpeechSynthesisUtterance(e),H=o.toLowerCase();re.lang=H.includes("french")?"fr-FR":H.includes("spanish")?"es-ES":H.includes("german")?"de-DE":"en-US",re.onend=()=>R(!1),re.onerror=()=>R(!1),R(!0),window.speechSynthesis.speak(re)}},ie=()=>{P&&(I.current&&I.current.pause(),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel(),R(!1)),_.current&&(T?(_.current.pause(),k(!1)):(_.current.currentTime=0,_.current.play().catch(console.error),k(!0)))},G=(re,H)=>{const Y=re.replace(/[^a-zA-Z0-9'À-ÿ]/g,"");N(de=>({...de,[Y]:!0})),c&&c(Y,H)};return i.jsxs("div",{className:"fixed inset-0 z-50 flex items-center justify-center p-3 md:p-6 bg-slate-950/80 backdrop-blur-md overflow-y-auto animate-in fade-in duration-200",children:[r&&i.jsx("audio",{ref:_,src:r,onEnded:()=>k(!1),onError:()=>k(!1)}),s&&i.jsx("audio",{ref:I,src:s,onEnded:()=>R(!1),onError:()=>R(!1)}),i.jsxs(cs.div,{initial:{opacity:0,scale:.96,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.96,y:10},className:"relative w-full max-w-4xl bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200/80 dark:border-slate-800 flex flex-col max-h-[90vh] overflow-hidden my-auto",children:[i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-b border-slate-150 dark:border-slate-800 bg-slate-50/80 dark:bg-slate-900/80 backdrop-blur shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-9 h-9 rounded-xl bg-emerald-500/10 border border-emerald-500/20 flex items-center justify-center text-emerald-500",children:i.jsx(yn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-base font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[d?"专业级发音深度诊断报告":"Pronunciation Diagnostic Report",i.jsx("span",{className:"text-[11px] font-semibold px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:"AI Deep Analysis"})]}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:[a," • ",o]})]})]}),i.jsx("button",{onClick:l,className:"p-2 text-slate-400 hover:text-slate-600 dar
4805k:hover:text-slate-200 rounded-xl hover:bg-slate-200/50 dark:hover:bg-slate-800 transition-colors",children:i.jsx(Ts,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-6 overflow-y-auto space-y-6",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-5 p-5 rounded-2xl bg-slate-50/80 dark:bg-slate-800/40 border border-slate-200/60 dark:border-slate-800",children:[i.jsxs("div",{className:"md:col-span-5 flex flex-col items-center justify-center border-b md:border-b-0 md:border-r border-slate-200/60 dark:border-slate-800 pb-5 md:pb-0 md:pr-5",children:[i.jsxs("div",{className:"relative w-36 h-36 flex items-center justify-center",children:[i.jsxs("svg",{className:"w-full h-full -rotate-90",viewBox:"0 0 100 100",children:[i.jsx("circle",{cx:"50",cy:"50",r:"42",className:"text-slate-200 dark:text-slate-700 stroke-current",strokeWidth:"8",fill:"none"}),i.jsx("circle",{cx:"50",cy:"50",r:"42",className:"text-emerald-500 stroke-current transition-all duration-1000 ease-out",strokeWidth:"8",strokeDasharray:2*Math.PI*42,strokeDashoffset:2*Math.PI*42*(1-h/100),strokeLinecap:"round",fill:"none"})]}),i.jsxs("div",{className:"absolute inset-0 flex flex-col items-center justify-center text-center",children:[i.jsx("span",{className:"text-4xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:h}),i.jsx("span",{className:"text-[11px] font-semibold text-slate-400 dark:text-slate-500 uppercase tracking-wider",children:"/ 100 PTS"})]})]}),i.jsxs("div",{className:"mt-3.5 flex items-center gap-1.5 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/25 text-emerald-600 dark:text-emerald-400 font-bold text-xs shadow-sm",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsxs("span",{children:["CEFR ",m]})]})]}),i.jsxs("div",{className:"md:col-span-7 flex flex-col justify-center space-y-4",children:[i.jsxs("h3",{className:"text-xs font-bold text-slate-400 dark:text-slate-500 uppercase tracking-wider flex items-center gap-1.5",children:[i.jsx(xi,{className:"w-3.5 h-3.5 text-emerald-500"}),d?"维度诊断雷达":"Phonetic Radar Metrics"]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs font-semibold text-slate-700 dark:text-slate-300 mb-1",children:[i.jsx("span",{children:d?"流利度 (Fluency)":"Fluency"}),i.jsxs("span",{className:"text-emerald-600 dark:text-emerald-400 font-bold",children:[j,"%"]})]}),i.jsx("div",{className:"w-full h-2 rounded-full bg-slate-200 dark:bg-slate-700 overflow-hidden",children:i.jsx("div",{className:"h-full bg-emerald-500 rounded-full transition-all duration-700",style:{width:`${j}%`}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs font-semibold text-slate-700 dark:text-slate-300 mb-1",children:[i.jsx("span",{children:d?"准确度 (Accuracy)":"Accuracy"}),i.jsxs("span",{className:"text-blue-600 dark:text-blue-400 font-bold",children:[O,"%"]})]}),i.jsx("div",{className:"w-full h-2 rounded-full bg-slate-200 dark:bg-slate-700 overflow-hidden",children:i.jsx("div",{className:"h-full bg-blue-500 rounded-full transition-all duration-700",style:{width:`${O}%`}})})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex justify-between text-xs font-semibold text-slate-700 dark:text-slate-300 mb-1",children:[i.jsx("span",{children:d?"完整度 (Completeness)":"Completeness"}),i.jsxs("span",{className:"text-indigo-600 dark:text-indigo-400 font-bold",children:[M,"%"]})]}),i.jsx("div",{className:"w-full h-2 rounded-full bg-slate-200 dark:bg-slate-700 overflow-hidden",children:i.jsx("div",{className:"h-full bg-indigo-500 rounded-full transition-all duration-700",style:{width:`${M}%`}})})]})]}),n.phoneticFeedback&&i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-300 bg-white dark:bg-slate-900 p-3 rounded-xl border border-slate-200/60 dark:border-slate-800 italic",children:['"',n.phoneticFeedback,'"']})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:"text-sm font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[i.jsx(Ys,{className:"w-4 h-4 text-emerald-500"}),d?"逐词高亮发音诊断 (Word-Level Phonetic Diff)":"Word-Level Phonetic Diagnostic"]}),i.jsx("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:d?"点击高亮词查看纠音精讲":"Click highlight to view detail"})]}),i.jsxs("div",{className:"p-5 rounded-2xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 shadow-sm leading-relaxed",children:[i.jsx("div",{className:"flex flex-wrap gap-2 text-base font-medium",children:x.map((re,H)=>{const Y=(v==null?void 0:v.word)===re.word;let de="bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 border-emerald-500/30 hover:bg-emerald-500/20",W="🟢";return re.status==="minor_deviation"?(de="bg-amber-500/15 text-amber-800 dark:text-amber-200 border-amber-500/40 hover:bg-amber-500/25 shadow-sm",W="🟡"):re.status==="error"&&(de="bg-rose-500/15 text-rose-800 dark:text-rose-200 border-rose-500/40 hover:bg-rose-500/25 shadow-sm",W="🔴"),i.jsxs("button",{onClick:()=>B(re),className:`inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl border transition-all cursor-pointer ${de} ${Y?"ring-2 ring-emerald-500 scale-105 shadow-md font-bold":""}`,children:[i.jsx("span",{className:"text-[10px]",children:W}),i.jsx("span",{children:re.word})]},H)})}),t&&i.jsx("div",{className:"mt-4 pt-3 border-t border-slate-100 dar
4805k:border-slate-800 text-xs text-slate-500 dark:text-slate-400",children:t}),i.jsxs("div",{className:"mt-4 flex flex-wrap items-center gap-4 text-xs font-semibold text-slate-500 dark:text-slate-400 pt-2 border-t border-slate-100 dark:border-slate-800/60",children:[i.jsxs("span",{className:"flex items-center gap-1 text-emerald-600 dark:text-emerald-400",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500"}),d?"发音标准":"Standard"]}),i.jsxs("span",{className:"flex items-center gap-1 text-amber-600 dark:text-amber-400",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-amber-500"}),d?"轻微重音/语调偏差":"Minor Deviation"]}),i.jsxs("span",{className:"flex items-center gap-1 text-rose-600 dark:text-rose-400",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-rose-500"}),d?"发音错误/连读丢失":"Phonetic Error"]})]})]})]}),v&&i.jsx(Qo,{mode:"wait",children:i.jsxs(cs.div,{initial:{opacity:0,y:6},animate:{opacity:1,y:0},exit:{opacity:0,y:-6},className:"p-5 rounded-2xl bg-slate-900 text-white border border-slate-800 shadow-xl space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"text-xl font-extrabold text-emerald-400",children:v.word.replace(/[^a-zA-Z0-9'À-ÿ]/g,"")}),v.ipa&&i.jsx("span",{className:"text-xs font-mono font-semibold text-slate-400 bg-slate-800 px-2.5 py-1 rounded-lg border border-slate-700",children:v.ipa}),i.jsx("span",{className:`text-[11px] font-bold px-2 py-0.5 rounded-full ${v.status==="correct"?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/30":v.status==="minor_deviation"?"bg-amber-500/20 text-amber-300 border border-amber-500/30":"bg-rose-500/20 text-rose-300 border border-rose-500/30"}`,children:v.status==="correct"?d?"🟢 发音标准":"Standard":v.status==="minor_deviation"?d?"🟡 语调轻微偏差":"Minor Deviation":d?"🔴 发音/重音错误":"Phonetic Flaw"})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>U(v.word),className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-emerald-500 hover:bg-emerald-400 text-slate-950 font-bold text-xs shadow-md transition-all active:scale-95 cursor-pointer",title:d?"点击播放标准单字读音":"Click to play native single-word audio",children:[i.jsx(on,{className:"w-4 h-4"}),i.jsx("span",{children:d?"原音试听":"Listen"})]}),i.jsx("button",{onClick:()=>G(v.word,v.errorAnalysis||"Saved vocabulary"),disabled:E[v.word.replace(/[^a-zA-Z0-9'À-ÿ]/g,"")],className:"flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-slate-800 hover:bg-slate-700 text-slate-200 font-semibold text-xs border border-slate-700 transition-all cursor-pointer disabled:opacity-50",children:E[v.word.replace(/[^a-zA-Z0-9'À-ÿ]/g,"")]?i.jsxs(i.Fragment,{children:[i.jsx(vn,{className:"w-3.5 h-3.5 text-emerald-400"}),i.jsx("span",{children:d?"已加入生词本":"Saved"})]}):i.jsxs(i.Fragment,{children:[i.jsx(wW,{className:"w-3.5 h-3.5 text-amber-400"}),i.jsx("span",{children:d?"存入生词本":"Save Word"})]})})]})]}),i.jsxs("div",{className:"text-xs text-slate-300 leading-relaxed bg-slate-800/60 p-3.5 rounded-xl border border-slate-800",children:[i.jsx("strong",{className:"text-emerald-400 font-semibold block mb-1",children:d?"💡 针对性发音纠错精讲:":"💡 Diagnostic Phonetic Analysis:"}),v.errorAnalysis||(d?`该单词发音流畅,咬音清晰符合 ${o} 原生母语标准。`:`Articulation matches native ${o} standard rhythm cleanly.`)]})]},v.word)}),i.jsxs("div",{className:"p-5 rounded-2xl bg-gradient-to-r from-slate-900 to-slate-950 text-white border border-slate-800 shadow-lg space-y-4",children:[i.jsxs("h3",{className:"text-sm font-bold flex items-center gap-2 text-emerald-400",children:[i.jsx(Nn,{className:"w-4 h-4"}),d?"双轨音频对比 (Dual-Track Audio Comparison)":"Dual-Track Audio Comparison"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"p-4 rounded-xl bg-slate-800/80 border border-slate-700/60 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:ee,className:"w-11 h-11 rounded-full bg-emerald-500 hover:bg-emerald-400 text-slate-950 flex items-center justify-center font-bold transition-all shadow-md active:scale-95 cursor-pointer",children:P?i.jsx(Fh,{className:"w-5 h-5"}):i.jsx(Xa,{className:"w-5 h-5 ml-0.5"})}),i.jsxs("div",{children:[i.jsxs("h4",{className:"text-xs font-bold text-white flex items-center gap-1.5",children:[i.jsx(cn,{className:"w-3.5 h-3.5 text-emerald-400"}),d?"原电台 / 标准原音":"Native Broadcast Track"]}),i.jsx("p",{className:"text-[11px] text-slate-400 mt-0.5",children:P?d?"正在播放...":"Playing...":d?"点击对比标准发音":"Click to play native audio"})]})]}),P&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-1 h-4 bg-emerald-400 rounded-full animate-bounce [animation-delay:0ms]"}),i.jsx("span",{className:"w-1 h-6 bg-emerald-400 rounded-full animate-bounce [animation-delay:150ms]"}),i.jsx("span",{className:"w-1 h-3 bg-emerald-400 rounded-full animate-bounce [animation-delay:300ms]"})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-800/80 border border-slate-700/60 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:ie,disabled:!r,className:`w-11 h-11 rounded-full flex items-center justify-center font-bold transition-all shadow-md active:scale-95 cursor-pointer ${r?"bg-red-500 hover:bg-red-400 text-white":"bg-slate-700 text-slate-500 cursor-not-allowed"}`,children:T?i.jsx(Fh,{className:"w-5 h-5"}):i.jsx(Xa,{className:"w-5 h-5 ml-0.5"})}),i.jsxs("div",{children:[i.jsxs("h4",{className:"text-xs font-bold text-white flex items-center gap-1.5",children:[i.jsx(Nn,{className:"w-3.5 h-3.5 text-red-400"}),d?"您的跟读录音":"Your Shadowing Audio"]}),i.jsx("p",{className:"text-[11px] text-slate-400 mt-0.5",children:r?T?d?"回放中...":"Playing back...":d?"点击回放跟读录音":"Click to play your voice":d?"未录制":"No user audio"})]})]}),T&&i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsx("span",{className:"w-1 h-4 bg-red-400 rounded-full animate-bounce [animation-delay:0ms]"}),i.jsx("span",{className:"w-1 h-6 bg-red-400 rounded-full animate-bounce [animation-delay:150ms]"}),i.jsx("span",{className:"w-1 h-3 bg-red-400 rounded-full animate-bounce [animation-delay:300ms]"})]})]})]})]})]}),i.jsxs("div",{className:"flex items-center justify-between px-6 py-4 border-t border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-900 shrink-0",children:[i.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:d?"已自动同步存入个人中心与跟读诊断历史库":"Diagnostic saved to Personal History & Firestore Database"}),i.jsx("button",{onClick:l,className:"px-5 py-2.5 rounded-xl bg-emerald-500 hover:bg-emerald-400 text-slate-950 font-bold text-xs shadow-md transition-all cursor-pointer",children:d?"完成并关闭":"Done"})]})]})]})}async function c5(n,e){var se,re,H;const s=document.createElement("canvas");s.width=1200,s.height=850;const a=s.getContext("2d");if(!a)throw new Error("Could not initialize 2D canvas context for certificate export.");const{isZh:o,candidateName:l}=e,c=l||(o?"认证学术考生":"Verified Academic Candidate"),d=new Date().toLocaleDateString(o?"zh-CN":"en-US",{year:"numeric",month:"long",day:"numeric"}),h=a.createLinearGradient(0,0,1200,850);h.addColorStop(0,"#090d16"),h.addColorStop(.5,"#0b1329"),h.addColorStop(1,"#07111e"),a.fillStyle=h,a.fillRect(0,0,1200,850),a.save(),a.strokeStyle="rgba(16, 185, 129, 0.04)",a.lineWidth=1;const m=40;for(let Y=m;Y<1200;Y+=m)a.beginPath(),a.moveTo(Y,0),a.lineTo(Y,850),a.stroke();for(let Y=m;Y<850;Y+=m)a.beginPath(),a.moveTo(0,Y),a.lineTo(1200,Y),a.stroke();
4805a.restore(),a.save(),a.strokeStyle="#10b981",a.lineWidth=3,a.strokeRect(30,30,1140,790),a.strokeStyle="rgba(245, 158, 11, 0.6)",a.lineWidth=1.5,a.strokeRect(40,40,1120,770);const p=(Y,de,W,K)=>{a.strokeStyle="#f59e0b",a.lineWidth=2.5,a.beginPath(),a.moveTo(Y,de+K*20),a.lineTo(Y,de),a.lineTo(Y+W*20,de),a.stroke(),a.fillStyle="#10b981",a.beginPath(),a.arc(Y+W*6,de+K*6,3,0,Math.PI*2),a.fill()};p(44,44,1,1),p(1156,44,-1,1),p(44,806,1,-1),p(1156,806,-1,-1),a.restore(),a.textAlign="center",a.fillStyle="#10b981",a.font="bold 13px 'Courier New', monospace",a.letterSpacing="3px",a.fillText(o?"★ 全球广播听力与即兴口语测评体系 • 官方诊断机构 ★":"★ INTERNATIONAL BROADCAST SPEECH & CEFR ACCREDITATION COUNCIL ★",1200/2,75),a.fillStyle="#ffffff",a.font="900 32px 'Plus Jakarta Sans', system-ui, sans-serif",a.letterSpacing="1px",a.fillText(o?"CEFR 国际语言能力等级认证":"CEFR ORAL PROFICIENCY CERTIFICATION",1200/2,115),a.fillStyle="rgba(148, 163, 184, 0.9)",a.font="14px system-ui, sans-serif",a.fillText(o?"基于真实全球广播原声的 1v1 即兴口语三阶辩论专项综合诊断":"Standardized 3-Round Broadcast Debate & Spontaneous Speech Assessment",1200/2,140),a.save();const x=a.createLinearGradient(1200/2-200,155,1200/2+200,155);x.addColorStop(0,"rgba(245, 158, 11, 0)"),x.addColorStop(.5,"rgba(245, 158, 11, 0.8)"),x.addColorStop(1,"rgba(245, 158, 11, 0)"),a.strokeStyle=x,a.lineWidth=1.5,a.beginPath(),a.moveTo(1200/2-200,155),a.lineTo(1200/2+200,155),a.stroke(),a.restore(),a.fillStyle="#94a3b8",a.font="italic 15px Georgia, serif",a.fillText(o?"兹证明考生":"This is to certify that candidate",1200/2,185),a.fillStyle="#f8fafc",a.font="bold 26px 'Plus Jakarta Sans', system-ui, sans-serif",a.fillText(c,1200/2,220),a.fillStyle="#94a3b8",a.font="13px system-ui, sans-serif";const v=`${n.snippetContext.stationSource||"Global Broadcast"} — ${n.snippetContext.topic}`;a.fillText(o?`已完成在原声主题「${v}」下的三轮即兴口语辩论答辩,评定成绩如下:`:`has demonstrated spontaneous oral defense under on-air topic: "${v}"`,1200/2,248);const B=275,E=440,N=90,T=(1200-E)/2;a.save(),a.fillStyle="rgba(16, 185, 129, 0.12)",a.strokeStyle="rgba(16, 185, 129, 0.4)",a.lineWidth=1.5,a.beginPath(),a.roundRect(T,B,E,N,16),a.fill(),a.stroke(),a.textAlign="left",a.fillStyle="#34d399",a.font="bold 13px 'Courier New', monospace",a.fillText(o?"官方评定等级 / LEVEL":"OFFICIAL CEFR LEVEL",T+24,B+34),a.fillStyle="#ffffff",a.font="900 34px 'Plus Jakarta Sans', system-ui, sans-serif",a.fillText(n.cefrLevel,T+24,B+72),a.textAlign="right",a.fillStyle="#f59e0b",a.font="bold 13px 'Courier New', monospace",a.fillText(o?"综合评分 / BAND":"OVERALL BAND",T+E-24,B+34),a.fillStyle="#f59e0b",a.font="900 38px 'Plus Jakarta Sans', system-ui, sans-serif",a.fillText(n.overallBand.toFixed(1),T+E-24,B+74),a.restore();const k=390,P=1040/4,R=85;[{label:o?"流利度与连贯性":"Fluency & Coherence",val:n.scores.fluencyAndCoherence,desc:o?"连接词与节奏":"Cadence & connectives"},{label:o?"词汇丰富度":"Lexical Resource",val:n.scores.lexicalResource,desc:o?"C1 学术词汇":"C1 Academic range"},{label:o?"语法多样性":"Grammar Range",val:n.scores.grammaticalAccuracy,desc:o?"复杂句式与准确度":"Syntactic complexity"},{label:o?"语音与声学交付":"Pronunciation",val:n.scores.pronunciationAcoustic,desc:o?"重音韵律与抑扬":"Acoustic prosody"}].forEach((Y,de)=>{const W=60+de*(P+13);a.save(),a.fillStyle="rgba(15, 23, 42, 0.7)",a.strokeStyle="rgba(51, 65, 85, 0.7)",a.lineWidth=1,a.beginPath(),a.roundRect(W,k,P,R,10),a.fill(),a.stroke(),a.textAlign="left",a.fillStyle="#e2e8f0",a.font="bold 13px system-ui, sans-serif",a.fillText(Y.label,W+12,k+26),a.fillStyle="#64748b",a.font="11px system-ui, sans-serif",a.fillText(Y.desc,W+12,k+44);const K=P-24;a.fillStyle="#1e293b",a.beginPath(),a.roundRect(W+12,k+56,K,6,3),a.fill(),a.fillStyle="#10b981",a.beginPath(),a.roundRect(W+12,k+56,K*Y.val/100,6,3),a.fill(),a.textAlign="right",a.fillStyle="#34d399",a.font="bold 14px 'Courier New', monospace",a.fillText(`${Y.val}
4805`,W+P-12,k+26),a.restore()});const I=495,D=110;a.save(),a.fillStyle="rgba(15, 23, 42, 0.85)",a.strokeStyle="rgba(16, 185, 129, 0.25)",a.lineWidth=1,a.beginPath(),a.roundRect(60,I,1080,D,12),a.fill(),a.stroke(),a.textAlign="left",a.fillStyle="#34d399",a.font="bold 12px 'Courier New', monospace",a.fillText(o?"★ 资深主考官官方评语摘要 / EXAMINER SUMMARY":"★ SENIOR EXAMINER OFFICIAL EVALUATION",80,I+28),a.fillStyle="#cbd5e1",a.font="italic 13px Georgia, serif";const j=`"${n.examinerSummary.slice(0,240)}${n.examinerSummary.length>240?"...":""}"`;if(a.fillText(j,80,I+54),n.vocabularyUpgrades&&n.vocabularyUpgrades.length>0){const Y=n.vocabularyUpgrades.slice(0,3).map(de=>`${de.recommendedC1Word} (${de.cefrLevel||"C1"})`).join("  •  ");a.fillStyle="#94a3b8",a.font="11px system-ui, sans-serif",a.fillText(`${o?"推荐进阶 C1 广播语汇":"Target C1 Vocabulary Mastered"}: ${Y}`,80,I+84)}a.restore();const O=640;a.textAlign="left",a.fillStyle="#64748b",a.font="bold 11px 'Courier New', monospace",a.fillText(`VERIFICATION ID: ${n.certificateId}`,70,O+40),a.fillText(`ISSUED DATE: ${d}`,70,O+60),a.fillText("SYSTEM REVISION: GLOBAL-RADIO-ORAL-v2.6",70,O+80);const M=n.targetLanguage==="Spanish"||((se=n.frameworkName)==null?void 0:se.includes("DELE")),U=((re=n.examinerPersona)==null?void 0:re.name)||(M?"Prof. Mateo Valero":"Dr. Arthur Sterling, Ph.D."),ee=((H=n.examinerPersona)==null?void 0:H.title)||(M?o?"塞万提斯学院 DELE/SIELE 资深考官":"Senior DELE / SIELE Oral Examiner & RTVE Broadcast Linguist":o?"首席学术考官 (Speech Assessment Chair)":"Chief Examiner, Acoustic Assessment Board");a.textAlign="center",a.fillStyle="#e2e8f0",a.font="italic 22px 'Brush Script MT', cursive, Georgia, serif",a.fillText(U,1200/2-30,O+50),a.fillStyle="#64748b",a.font="10px system-ui, sans-serif",a.fillText(ee,1200/2-30,O+72);const ie=1050,G=O+50;a.save(),a.fillStyle="rgba(245, 158, 11, 0.15)",a.strokeStyle="#f59e0b",a.lineWidth=2,a.beginPath(),a.arc(ie,G,40,0,Math.PI*2),a.fill(),a.stroke(),a.setLineDash([3,3]),a.strokeStyle="#fbbf24",a.beginPath(),a.arc(ie,G,34,0,Math.PI*2),a.stroke(),a.setLineDash([]),a.textAlign="center",a.fillStyle="#f59e0b",a.font="bold 8px 'Courier New', monospace",a.fillText("OFFICIAL SEAL",ie,G-14),a.font="900 12px system-ui, sans-serif",a.fillText(M?"★ DELE ★":"★ CEFR ★",ie,G+2),a.font="bold 8px 'Courier New', monospace",a.fillText(M?"CERVANTES":"AUTHENTIC",ie,G+16),a.restore(),a.textAlign="center",a.fillStyle="rgba(100, 116, 139, 0.7)",a.font="10px system-ui, sans-serif",a.fillText("Verified via Global Radio Shadowing SaaS Cryptographic Speech Ledger • Valid for Academic & Workplace Portfolio Verification",1200/2,802);const Z=s.toDataURL("image/png"),z=document.createElement("a");z.href=Z,z.download=`CEFR_Oral_Certificate_${n.certificateId||"PRO"}.png`,document.body.appendChild(z),z.click(),document.body.removeChild(z)}function i6e({record:n,isOpen:e=!0,onClose:t,onDelete:r,isZh:s,candidateName:a,isPro:o=!1}){var T,k,P,R;const{isZh:l}=Or(),c=s!==void 0?s:l,[d,h]=S.useState(!1),[m,p]=S.useState(!1);if(!e||!n||!n.report)return null;const{report:x,turns:y,stationName:v,evaluatedAt:B}=n,E=B!=null&&B.toMillis?new Date(B.toMillis()).toLocaleString(c?"zh-CN":"en-US"):B?new Date(B).toLocaleString(c?"zh-CN":"en-US"):"",N=async()=>{if(x){h(!0),p(!1);try{await c5(x,{isZh:c,candidateName:a||(c?"学术考生":"Academic Candidate")}),p(!0),setTimeout(()=>p(!1),3e3)}catch(_){console.error("Failed to export certificate:",_)}finally{h(!1)}}};return i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/75 backdrop-blur-sm p-3 sm:p-4 animate-in fade-in duration-200",children:i.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 max-w-3xl w-full max-h-[92vh] flex flex-col overflow-hidden",children:[i.jsxs("div",{className:"p-4 sm:p-5 border-b border-slate-200 dark:border-slate-800 flex items-center justify-between bg-slate-50/60 dark:bg-slate-800/40 shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-9 h-9 rounded-xl bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 flex items-center justify-center shrink-0",children:i.jsx(yn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-base sm:text-lg font-black text-slate-900 dark:text-slate-100 flex items-center gap-2",children:c?"1v1 纯正口语实战诊断报告":"1v1 Spoken English Coaching Diagnostic Report"}),i.jsxs("div",{className:"flex items-center gap-3 text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(cn,{className:"w-3 h-3 text-emerald-500"}),v]}),E&&i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(uS,{className:"w-3 h-3 text-slate-400"}),E]})]})]})]}),i.jsx("button",{onClick:t,className:"p-2 rounded-xl text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-slate-100 dar
4805k:hover:bg-slate-800 transition-colors cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})})]}),i.jsxs("div",{className:"p-4 sm:p-6 overflow-y-auto space-y-6 custom-scrollbar text-xs sm:text-sm",children:[i.jsxs("div",{className:"p-4 sm:p-6 rounded-2xl bg-gradient-to-br from-emerald-500/10 via-teal-500/10 to-slate-900/5 dark:from-emerald-950/40 dark:to-slate-900 border border-emerald-500/30 flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center w-20 h-20 rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-600 text-white shadow-lg shadow-emerald-500/25",children:[i.jsx("span",{className:"text-[10px] font-bold uppercase tracking-wider opacity-90",children:"Band"}),i.jsx("span",{className:"text-3xl font-black font-mono leading-none",children:x.overallBand})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-lg font-black text-slate-900 dark:text-slate-100",children:x.cefrLevel}),i.jsx("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-500/20 text-emerald-700 dark:text-emerald-300",children:c?"官方对标":"Verified CEFR"})]}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1 font-mono",children:["Cert ID: ",x.certificateId||"CERT-VERIFIED"]})]})]}),i.jsx("button",{onClick:N,disabled:d,className:"w-full sm:w-auto px-4 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 disabled:opacity-60 text-white font-bold text-xs flex items-center justify-center gap-2 shadow-md shadow-emerald-600/20 transition-all cursor-pointer active:scale-95",children:d?i.jsxs(i.Fragment,{children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin"}),i.jsx("span",{children:c?"正在生成证书...":"Rendering..."})]}):m?i.jsxs(i.Fragment,{children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-300"}),i.jsx("span",{children:c?"已下载证书":"Downloaded"})]}):i.jsxs(i.Fragment,{children:[i.jsx(hS,{className:"w-4 h-4"}),i.jsx("span",{children:c?"下载认证证书 (PNG)":"Download Certificate (PNG)"})]})})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex flex-col items-center justify-center",children:[i.jsx("span",{className:"text-xs font-bold text-slate-700 dark:text-slate-300 mb-2",children:c?"声学与语言学六维雷达":"Acoustic & Linguistic Radar"}),i.jsx("div",{className:"w-full h-56",children:i.jsx(Nv,{width:"100%",height:"100%",children:i.jsxs(zv,{data:(x.radarMetrics||[]).map(_=>c?{..._,metric:{"Acoustic Fluency":"声学流利度","Fluency & Rhythm":"流利度与节奏","Coherence & Logic":"连贯度与逻辑","Lexical Resource":"词汇丰富度","Grammatical Accuracy":"语法准确度","Broadcast Grounding":"广播结合度","Syntactic Range":"句式多样性",Pronunciation:"语音语调"}[_.metric]||_.metric}:_),children:[i.jsx(lx,{stroke:"#cbd5e1",strokeDasharray:"3 3",opacity:.4}),i.jsx(cx,{dataKey:"metric",tick:{fill:"#64748b",fontSize:10,fontWeight:"bold"}}),i.jsx(_P,{angle:30,domain:[0,100],tick:!1,axisLine:!1}),i.jsx(ux,{name:c?"考生得分":"Score",dataKey:"value",stroke:"#10b981",fill:"#10b981",fillOpacity:.4}),i.jsx(eje,{contentStyle:{backgroundColor:"#0f172a",borderColor:"#334155",borderRadius:"8px",fontSize:"11px",color:"#fff"}})]})})})]}),i.jsxs("div",{className:"flex flex-col gap-2.5 justify-center",children:[i.jsxs("div",{className:"p-3 rounded-xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:c?"流利度与连贯性 (Fluency & Coherence)":"Fluency & Coherence"}),i.jsx("div",{className:"text-[10px] text-slate-400",children:c?"停顿节奏、言语流速与连接词运用":"Speech rate, pausing rhythm & discourse connectors"})]}),i.jsxs("span",{className:"text-sm font-black text-emerald-600 dark:text-emerald-400 font-mono",children:[((T=x.scores)==null?void 0:T.fluencyAndCoherence)||0," / 100"]})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:c?"词汇多样性与准确性 (Lexical Resource)":"Lexical Resource"}),i.jsx("div",{className:"text-[10px] text-slate-400",children:c?"C1 学术词汇、精准搭配与习惯表达":"C1/C2 academic vocabulary & precise collocations"})]}),i.jsxs("span",{className:"text-sm font-black text-emerald-600 dark:text-emerald-400 font-mono",children:[((k=x.scores)==null?void 0:k.lexicalResource)||0," / 100"]})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:c?"语法多样性与严谨性 (Grammatical Range)":"Grammatical Range & Accuracy"}),i.jsx("div",{className:"text-[10px] text-slate-400",children:c?"从句复合句结构与时态一致性":"Complex clause structures & syntactic variety"})]}),i.jsxs("span",{className:"text-sm font-black text-emerald-600 dark:text-emerald-400 font-mono",children:[((P=x.scores)==null?void 0:P.grammaticalAccuracy)||0," / 100"]})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:c?"声学语音面貌 (Pronunciation & Acoustics)":"Pronunciation & Acoustics"}),i.jsx("div",{className:"text-[10px] text-slate-400",children:c?"连读、弱读、辅音簇清晰度与重音":"Phonetic clarity, elision & intonation contours"})]}),i.jsxs("span",{className:"text-sm font-black text-emerald-600 dark:text-emerald-400 font-mono",children:[((R=x.scores)==null?void 0:R.pronunciationAcoustic)||0," / 100"]})]})]})]}),x.examinerSummary&&i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex flex-col gap-2",children:[i.jsxs("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(BE,{className:"w-3.5 h-3.5 text-emerald-500"}),c?"主考官综合学术评语 (Examiner Summary)":"Examiner Summary"]}
4805),i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed font-serif italic",children:['"',x.examinerSummary,'"']})]}),x.grammarCritique&&x.grammarCritique.length>0&&i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(xi,{className:"w-3.5 h-3.5 text-amber-500"}),c?"语法微创精修 (Grammar Micro-Surgery)":"Grammar Micro-Surgery"]}),i.jsx("div",{className:"space-y-2",children:x.grammarCritique.map((_,I)=>i.jsxs("div",{className:"p-3 rounded-xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex flex-col gap-1.5",children:[i.jsxs("div",{className:"text-xs text-rose-500 dark:text-rose-400 line-through",children:['"',_.original,'"']}),i.jsxs("div",{className:"text-xs font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1",children:[i.jsx(qn,{className:"w-3 h-3 shrink-0"}),'"',_.correction,'"']}),i.jsxs("p",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:["💡 ",_.issue,_.ruleExplanation?` (${_.ruleExplanation})`:""]})]},I))})]}),x.vocabularyUpgrades&&x.vocabularyUpgrades.length>0&&i.jsxs("div",{className:"space-y-2.5",children:[i.jsxs("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-500"}),c?"C1/C2 进阶词汇推荐 (Vocabulary Upgrades)":"C1/C2 Vocabulary Upgrades"]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-2",children:x.vocabularyUpgrades.map((_,I)=>i.jsxs("div",{className:"p-3 rounded-xl bg-slate-50 dark:bg-slate-800/40 border border-slate-200 dark:border-slate-800 flex flex-col gap-1",children:[i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsxs("span",{className:"text-slate-400 line-through",children:['"',_.userWord,'"']}),i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-emerald-500/20 text-emerald-700 dark:text-emerald-400",children:_.cefrLevel||"C1"})]}),i.jsxs("div",{className:"font-bold text-emerald-800 dark:text-emerald-300",children:[_.recommendedC1Word," ",_.phonetic&&i.jsx("span",{className:"font-normal text-slate-400 text-[10px]",children:_.phonetic})]}),i.jsxs("p",{className:"text-[11px] text-slate-600 dark:text-slate-300 italic font-serif",children:['"',_.exampleUsage,'"']})]},I))})]}),y&&y.length>0&&i.jsxs("div",{className:"space-y-2.5 pt-2 border-t border-slate-200 dark:border-slate-800",children:[i.jsxs("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(q2,{className:"w-3.5 h-3.5 text-emerald-500"}),c?"全场问答实录回溯 (3-Round Transcript)":"3-Round Dialogue Replay"]}),i.jsx("div",{className:"space-y-3",children:y.map((_,I)=>i.jsxs("div",{className:"p-3.5 rounded-xl bg-white dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700/80 flex flex-col gap-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-[11px] font-bold text-emerald-600 dark:text-emerald-400 uppercase tracking-wide",children:["Round ",_.round,": ",_.roundTitle||`Question ${_.round}`]}),_.audioDurationSeconds&&i.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:[_.audioDurationSeconds,"s response"]})]}),i.jsxs("div",{className:"text-xs font-semibold text-slate-800 dark:text-slate-200",children:['🎤 Dr. Sterling: "',_.question,'"']}),i.jsxs("div",{className:"text-xs text-slate-600 dark:text-slate-300 pl-3 border-l-2 border-emerald-500/50",children:["🗣️ ",c?"考生答辩:":"Candidate: ",' "',_.answer||"—",'"']})]},I))})]})]}),i.jsxs("div",{className:"p-4 border-t border-slate-200 dark:border-slate-800 bg-slate-50/60 dark:bg-slate-800/40 flex items-center justify-between shrink-0",children:[i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:c?"RadioShadow AI 考官成绩由 Google DeepMind 语音声学引擎严格评测":"RadioShadow AI verified acoustic CEFR assessment"}),i.jsx("button",{onClick:t,className:"px-4 py-2 rounded-xl bg-slate-200 hover:bg-slate-300 dark:bg-slate-700 dark:hover:bg-slate-600 text-slate-800 dark:text-slate-200 text-xs font-bold transition-colors cursor-pointer",children:c?"关闭":"Close"})]})]})})}const ote="ai_examiner_history_";async function t$(n){const e=n||"guest",t=new Map;try{const s=`${ote}${e}`,a=localStorage.getItem(s);
4805a&&JSON.parse(a).forEach(l=>{l.id&&t.set(l.id,l)})}catch(s){console.warn("Failed to read examiner history from localStorage:",s)}if(fn&&e!=="guest")try{const s=vo(qs(fn,"examiner_history"),Dl("userId","==",e));(await Bc(s)).docs.forEach(o=>{const l=o.data();t.set(o.id,{id:o.id,userId:l.userId,stationName:l.stationName||"Global Radio",language:l.language||"English",overallBand:l.overallBand,cefrLevel:l.cefrLevel,scores:l.scores,report:l.report,turns:l.turns||[],evaluatedAt:l.evaluatedAt})})}catch(s){console.warn("Firestore fetch examiner_history warning:",s)}const r=Array.from(t.values());return r.sort((s,a)=>{var c,d;const o=(c=s.evaluatedAt)!=null&&c.toMillis?s.evaluatedAt.toMillis():new Date(s.evaluatedAt||0).getTime();return((d=a.evaluatedAt)!=null&&d.toMillis?a.evaluatedAt.toMillis():new Date(a.evaluatedAt||0).getTime())-o}),r}async function o6e(n,e){const t=n;try{const r=`${ote}${t}`,s=localStorage.getItem(r);if(s){const o=JSON.parse(s).filter(l=>l.id!==e);localStorage.setItem(r,JSON.stringify(o))}}catch(r){console.warn("Failed to delete examiner history from localStorage:",r)}if(fn&&t!=="guest"&&!e.startsWith("local_"))try{await hm(qi(fn,"examiner_history",e))}catch(r){console.warn("Firestore delete examiner_history warning:",r)}typeof window<"u"&&window.dispatchEvent(new CustomEvent("examiner-history-updated"))}function l6e(){var Ie,pe,ye,he,le;const{t:n,isZh:e}=Or(),{user:t,userProfile:r,loading:s,isPro:a}=Ji(),[o,l]=S.useState(()=>{if(typeof window<"u"){const Ce=new URLSearchParams(window.location.search).get("tab");if(Ce==="examiner"||Ce==="notebook"||Ce==="bookmarks"||Ce==="history")return Ce}return"profile"}),[c,d]=S.useState([]),[h,m]=S.useState([]),[p,x]=S.useState([]),[y,v]=S.useState([]),[B,E]=S.useState(null),[N,T]=S.useState(null),[k,P]=S.useState(null),[R,_]=S.useState(null),[I,D]=S.useState(!1),[j,O]=S.useState(!1),[M,U]=S.useState(null),[ee,ie]=S.useState(!1),[G,Z]=S.useState(()=>Eh());S.useEffect(()=>{const ce=Ce=>{Z(Ce.detail||Eh())};return window.addEventListener("diagnostic-assessment-updated",ce),()=>window.removeEventListener("diagnostic-assessment-updated",ce)},[]),S.useEffect(()=>{!s&&!t&&(window.location.href="/")},[s,t]),S.useEffect(()=>{t!=null&&t.uid&&z(t.uid)},[t,o]),S.useEffect(()=>{const ce=()=>{t!=null&&t.uid&&t$(t.uid).then(Ce=>v(Ce))};return window.addEventListener("examiner-history-updated",ce),()=>window.removeEventListener("examiner-history-updated",ce)},[t==null?void 0:t.uid]);const z=async ce=>{D(!0);try{if(o==="examiner"||o==="profile"||y.length===0)try{const Ce=await t$(ce);v(Ce)}catch(Ce){console.warn("Error fetching examiner history:",Ce)}if(o==="bookmarks"){let Ce=[];try{const We=vo(qs(fn,"saved_sentences"),Dl("userId","==",ce));Ce=(await Bc(We)).docs.map(bt=>({id:bt.id,...bt.data()}))}catch(We){console.warn("Firestore fetch for bookmarks warning:",We)}let Ae=[];try{const We=localStorage.getItem(`ai_shadowing_bookmarks_${ce}`);We&&(Ae=JSON.parse(We))}catch{}const je=new Map;Ae.forEach(We=>{const dt=We.originalText||We.id;dt&&je.set(dt,We)}),Ce.forEach(We=>{const dt=We.originalText||We.id;dt&&je.set(dt,We)});const nt=Array.from(je.values());nt.sort((We,dt)=>{var Gt,En;const bt=(Gt=We.savedAt)!=null&&Gt.toMillis?We.savedAt.toMillis():new Date(We.savedAt||0).getTime();return((En=dt.savedAt)!=null&&En.toMillis?dt.savedAt.toMillis():new Date(dt.savedAt||0).getTime())-bt}),d(nt)}else if(o==="history"&&h.length===0){const Ce=vo(qs(fn,"evaluation_history"),Dl("userId","==",ce)),je=(await Bc(Ce)).docs.map(nt=>({id:nt.id,...nt.data()}));je.sort((nt,We)=>{var Yt,Gt;const dt=(Yt=nt.evaluatedAt)!=null&&Yt.toMillis?nt.evaluatedAt.toMillis():0;return((Gt=We.evaluatedAt)!=null&&Gt.toMillis?We.evaluatedAt.toMillis():0)-dt}),m(je)}else if(o==="notebook"&&p.length===0){let Ce=[];try{const We=vo(qs(fn,"shadowing_notebooks"),Dl("userId","==",ce));Ce=(await Bc(We)).docs.map(bt=>({id:bt.id,...bt.data()}))}catch(We){console.warn("Firestore fetch for notebooks warning:",We)}let Ae=[];try{const We=localStorage.getItem(`ai_shadowing_notebooks_${ce}`);We&&(Ae=JSON.parse(We))}catch{}const je=new Map;Ae.forEach(We=>{We.id&&je.set(We.id,We)}),Ce.forEach(We=>{We.id&&je.set(We.id,We)});const nt=Array.from(je.values());nt.sort((We,dt)=>{var Gt,En;const bt=(Gt=We.createdAt)!=null&&Gt.toMillis?We.createdAt.toMillis():new Date(We.createdAt||0).getTime();return((En=dt.createdAt)!=null&&En.toMillis?dt.createdAt.toMillis():new Date(dt.createdAt||0).getTime())-bt}),x(nt)}}catch(Ce){console.error("Error fetching dashboard data:",Ce)}finally{D(!1)}},se=async ce=>{if(confirm(e?"确定要删除此条纯正口语实战记录吗?":"Are you sure you want to delete this spoken coaching record?"))try{await o6e((t==null?void 0:t.uid)||"guest",ce),v(Ce=>Ce.filter(Ae=>Ae.id!==ce))}catch(Ce){console.warn("Delete examiner record warning:",Ce)}},re=async ce=>{var Ae;if(!ce.report)return;const Ce=ce.id||"cert";_(Ce);try{await c5(ce.report,{isZh:e,candidateName:(t==null?void 0:t.displayName)||(r==null?void 0:r.displayName)||((Ae=t==null?void 0:t.email)==null?void 0:Ae.split("@")[0])||(e?"学术考生":"Academic Candidate")})}catch(je){console.error("Export cert error:",je)}finally{_(null)}},H=async ce=>{if(confirm("Are you sure you want to delete this shadowing session report?")){try{fn&&ce&&await hm(qi(fn,"shadowing_notebooks",ce))}catch(Ce){console.warn("Delete doc error:",Ce)}x(Ce=>{const Ae=Ce.filter(je=>je.id!==ce);if(t!=null&&t.uid)try{localStorage.setItem(`ai_shadowing_notebooks_${t.uid}`,JSON.stringify(Ae))}catch{}return Ae})}},Y=async(ce,Ce)=>{if(t!=null&&t.uid){d(Ae=>Ae.filter(je=>je.originalText!==ce&&je.id!==Ce));try{const Ae=localStorage.getItem(`ai_shadowing_bookmarks_${t.uid}`);if(Ae){const je=JSON.parse(Ae).filter(nt=>nt.originalText!==ce&&nt.id!==Ce);localStorage.setItem(`ai_shadowing_bookmarks_${t.uid}`,JSON.stringify(je))}}catch{}try{if(Ce)await hm(qi(fn,"saved_sentences",Ce));else{const Ae=vo(qs(fn,"saved_sentences"),Dl("userId","==",t.uid),Dl("originalText","==",ce));(await Bc(Ae)).docs.forEach(async nt=>{await hm(qi(fn,"saved_sentences",nt.id))})}}catch(Ae){console.warn("Delete bookmark doc warning:",Ae)}}};if(s)return i.jsx("div",{className:"min-h-screen flex items-center justify-center bg-slate-50 dark:bg-slate-900",children:i.jsx(Bs,{className:"w-8 h-8 text-emerald-500 animate-spin"})});if(!t)return null;const de=a?h:h.slice(0,3),W=Math.max(0,h.length-3),K=y.length>0?Math.max(...y.map(ce=>Number(ce.overallBand)||0)):null,J=((Ie=y[0])==null?void 0:Ie.overallBand)||null,oe=y.length>0?y.reduce((ce,Ce)=>ce+(Number(Ce.overallBand)||0),0)/y.length:null;return i.jsxs("div",{className:"min-h-screen bg-slate-50 dark:bg-slate-900 font-sans text-slate-900 dark:text-slate-100 flex flex-col",children:[i.jsx(sp,{activeTrack:"live",setActiveTrack:ce=>{typeof window<"u"&&(localStorage.setItem("ai_word_active_track",ce),window.location.href=`/?track=${ce}`)},onOpenPaywall:()=>O(!0),onOpenLegal:ce=>U(ce),onOpenTour:()=>ie(!0)}),i.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-4 py-8 md:py-12 mt-16",children:[i.jsxs("div",{className:"flex items-center gap-4 mb-8",children:[i.jsx("a",{href:"/",className:"p-2 rounded-full bg-white dark:bg-slate-800 shadow-sm border border-slate-200 dark:border-slate-700 hover:text-emerald-600 transition-colors cursor-pointer",children:i.jsx(Rm,{className:"w-5 h-5"})}),i.jsx("h1",{className:"text-2xl md:text-3xl font-extrabold tracking-tight",children:n.dashboard.title})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-4 gap-8",children:[i.jsxs("div",{className:"md:col-span-1 flex flex-col gap-2",children:[i.jsxs("button",{onClick:()=>l("profile"),className:`flex items-center gap-3 px-4 py-3 rounded-xl font-semibold transition-all text-sm cursor-pointer ${o==="profile"?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400":"hover:bg-slate-100 dar
4805k:hover:bg-slate-800/50 text-slate-600 dark:text-slate-400"}`,children:[i.jsx(vh,{className:"w-4 h-4"}),n.dashboard.profileAndPlan]}),i.jsxs("button",{onClick:()=>l("notebook"),className:`flex items-center justify-between px-4 py-3 rounded-xl font-semibold transition-all text-sm cursor-pointer ${o==="notebook"?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400 font-bold":"hover:bg-slate-100 dark:hover:bg-slate-800/50 text-slate-600 dark:text-slate-400"}`,children:[i.jsxs("span",{className:"flex items-center gap-3",children:[i.jsx(Ys,{className:"w-4 h-4 text-emerald-500"}),n.dashboard.shadowingNotebook]}),i.jsx("span",{className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 text-[9px] font-extrabold px-1.5 py-0.5 rounded uppercase",children:"PRO"})]}),i.jsxs("button",{onClick:()=>l("examiner"),className:`flex items-center justify-between px-4 py-3 rounded-xl font-semibold transition-all text-sm cursor-pointer ${o==="examiner"?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400 font-bold":"hover:bg-slate-100 dark:hover:bg-slate-800/50 text-slate-600 dark:text-slate-400"}`,children:[i.jsxs("span",{className:"flex items-center gap-3",children:[i.jsx(yn,{className:"w-4 h-4 text-emerald-500"}),n.dashboard.examinerHistory]}),i.jsx("span",{className:"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 text-[10px] font-mono font-bold px-1.5 py-0.5 rounded",children:y.length})]}),i.jsxs("button",{onClick:()=>l("bookmarks"),className:`flex items-center gap-3 px-4 py-3 rounded-xl font-semibold transition-all text-sm cursor-pointer ${o==="bookmarks"?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400":"hover:bg-slate-100 dark:hover:bg-slate-800/50 text-slate-600 dark:text-slate-400"}`,children:[i.jsx(Jo,{className:"w-4 h-4"}),n.dashboard.savedSentences]}),i.jsxs("button",{onClick:()=>l("history"),className:`flex items-center gap-3 px-4 py-3 rounded-xl font-semibold transition-all text-sm cursor-pointer ${o==="history"?"bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400":"hover:bg-slate-100 dark:hover:bg-slate-800/50 text-slate-600 dark:text-slate-400"}`,children:[i.jsx(Nn,{className:"w-4 h-4"}),n.dashboard.speechHistory]})]}),i.jsxs("div",{className:"md:col-span-3",children:[o==="profile"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-800/50 p-6 md:p-8 rounded-3xl border border-slate-200 dark:border-slate-700 shadow-sm flex flex-col md:flex-row items-center gap-6",children:[t.photoURL||r!=null&&r.photoURL?i.jsx("img",{src:t.photoURL||(r==null?void 0:r.photoURL)||"",alt:"Avatar",width:96,height:96,loading:"lazy",decoding:"async",className:"w-20 h-20 md:w-24 md:h-24 rounded-full border-4 border-emerald-50 dark:border-emerald-500/20 object-cover shrink-0",referrerPolicy:"no-referrer"}):i.jsx("div",{className:"w-20 h-20 md:w-24 md:h-24 rounded-full border-4 border-emerald-50 dark:border-emerald-500/20 bg-emerald-600 text-white font-extrabold flex items-center justify-center text-2xl",children:((ye=(pe=t.displayName||(r==null?void 0:r.displayName)||t.email)==null?void 0:pe[0])==null?void 0:ye.toUpperCase())||"U"}),i.jsxs("div",{className:"text-center md:text-left flex-1",children:[i.jsx("h2",{className:"text-xl md:text-2xl font-bold mb-1",children:t.displayName||(r==null?void 0:r.displayName)||"User"}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-sm mb-4",children:t.email}),a?i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-gradient-to-r from-emerald-500 to-teal-400 text-white rounded-full font-bold text-sm shadow-md shadow-emerald-500/20",children:[i.jsx(fr,{className:"w-4 h-4 fill-current text-amber-200"}),i.jsx("span",{children:n.dashboard.proMember})]}),i.jsx("button",{onClick:async()=>{try{const{doc:ce,setDoc:Ce}=await c0(async()=>{const{doc:je,setDoc:nt}=await Promise.resolve().then(()=>Rk);return{doc:je,setDoc:nt}},void 0),{db:Ae}=await c0(async()=>{const{db:je}=await Promise.resolve().then(()=>Pk);return{db:je}},void 0);await Ce(ce(Ae,"users",t.uid),{isPro:!1},{merge:!0}),window.location.reload()}catch(ce){console.error("Failed to reset user membership:",ce)}},className:"px-3.5 py-1.5 rounded-full bg-slate-100 hover:bg-rose-50 text-slate-600 hover:text-rose-600 border border-slate-200 hover:border-rose-200 text-xs font-semibold transition-all cursor-pointer active:scale-95",children:"Reset to Free Plan (Test Mode)"})]}):i.jsx("div",{className:"inline-flex items-center gap-2 px-4 py-2 bg-slate-100 dar
4805k:bg-slate-700 text-slate-600 dark:text-slate-300 rounded-full font-bold text-sm",children:n.dashboard.freePlan})]})]}),i.jsxs("div",{className:"p-6 md:p-8 rounded-3xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700 shadow-sm space-y-4 relative overflow-hidden",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-slate-100 dark:border-slate-700/80 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx("img",{src:qy,alt:"Dr. Arthur Sterling",className:"w-12 h-12 rounded-2xl object-cover ring-2 ring-emerald-500/30 shadow-sm shrink-0"}),i.jsx("span",{className:"absolute bottom-0 right-0 w-3 h-3 rounded-full bg-emerald-500 ring-2 ring-white dark:ring-slate-900"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-base font-extrabold text-slate-900 dark:text-slate-100",children:e?"亚瑟博士母语声学能力定级":"Dr. Arthur's Spoken English Diagnostic"}),i.jsx("span",{className:"px-1.5 py-0.2 rounded text-[9px] font-mono font-bold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:"CAMBRIDGE RUBRIC"})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:e?"基于 30 秒广播原声朗读,测定发音流利度、声学节奏与能力范围":"Acoustic assessment of phoneme precision, liaison transitions, and speaking range"})]})]}),G&&i.jsx("span",{className:"self-start sm:self-center px-3 py-1 rounded-xl bg-emerald-50 dark:bg-emerald-950/60 text-emerald-700 dark:text-emerald-300 font-bold text-xs border border-emerald-500/30",children:e?"首次定级已生效":"Official Assessment Active"})]}),G?i.jsxs("div",{className:"space-y-4",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-900/60 border border-slate-200/80 dark:border-slate-800 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-0.5 rounded-md bg-emerald-600 text-white text-[10px] font-extrabold uppercase tracking-wider",children:G.levelTag}),i.jsxs("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400",children:["Band ",G.estimatedBand.toFixed(1)," • ",G.cefrLevel]})]}),i.jsx("h4",{className:"text-lg font-black text-slate-900 dark:text-slate-100",children:G.levelTitle}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 leading-relaxed max-w-2xl",children:G.plainDescription})]}),i.jsxs("div",{className:"flex flex-wrap sm:flex-col items-end gap-1.5 shrink-0",children:[i.jsxs("span",{className:"text-[10px] text-slate-400 font-mono",children:[e?"评定时间":"Evaluated",": ",new Date(G.evaluatedAt).toLocaleDateString()]}),G.recommendedStation&&i.jsxs("span",{className:"text-xs font-semibold text-emerald-700 dark:text-emerald-400 bg-emerald-500/10 px-2.5 py-0.5 rounded-lg",children:[e?"推荐频段":"Recommended",": ",G.recommendedStation]})]})]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:(he=G.radarMetrics)==null?void 0:he.map((ce,Ce)=>i.jsxs("div",{className:"p-2.5 rounded-xl bg-slate-50 dark:bg-slate-900/40 border border-slate-200/60 dark:border-slate-800 text-center",children:[i.jsx("span",{className:"text-[11px] text-slate-400 block mb-0.5",children:ce.metric}),i.jsx("span",{className:"text-sm font-extrabold text-slate-800 dark:text-slate-100 font-mono",children:ce.value})]},Ce))}),i.jsxs("div",{className:"pt-2 flex flex-col sm:flex-row items-center justify-between gap-3 border-t border-slate-100 dark:border-slate-800",children:[i.jsxs("div",{className:"text-xs text-slate-500 dark:text-slate-400 flex items-center gap-1.5",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:e?"二次重新定级需 PRO 高级会员订阅,持续追踪发音进阶曲线。":"Secondary leveling & progressive tracking require a PRO Membership."})]}),i.jsxs("div",{className:"flex items-center gap-2 w-full sm:w-auto",children:[i.jsx("button",{onClick:()=>ie(!0),className:"flex-1 sm:flex-initial px-3.5 py-2 rounded-xl border border-slate-200 dark:border-slate-700 text-slate-700 dark:text-slate-300 hover:bg-slate-50 dark:hover:bg-slate-800 text-xs font-semibold transition-colors cursor-pointer",children:e?"查看完整报告雷达图":"View Report & Rad
4805ar"}),a?i.jsxs("button",{onClick:()=>ie(!0),className:"flex-1 sm:flex-initial px-4 py-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs shadow-md shadow-emerald-500/20 flex items-center justify-center gap-1.5 cursor-pointer transition-transform active:scale-95",children:[i.jsx(yg,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:e?"PRO 尊享重新定级":"Retake Assessment (PRO)"})]}):i.jsxs("button",{onClick:()=>O(!0),className:"flex-1 sm:flex-initial px-4 py-2 rounded-xl bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 text-white font-bold text-xs shadow-md shadow-amber-500/20 flex items-center justify-center gap-1.5 cursor-pointer transition-transform active:scale-95",children:[i.jsx(rl,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:e?"重新定级 (升级PRO)":"Retake Assessment [PRO]"}),i.jsx(fr,{className:"w-3.5 h-3.5 fill-current text-amber-200 ml-0.5"})]})]})]})]}):i.jsxs("div",{className:"p-6 rounded-2xl bg-slate-50 dark:bg-slate-900/40 border border-dashed border-slate-300 dark:border-slate-700 flex flex-col sm:flex-row items-center justify-between gap-4 text-center sm:text-left",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h4",{className:"text-sm font-bold text-slate-800 dark:text-slate-200",children:e?"您尚未完成亚瑟博士的 30 秒口语声学定级":"You haven't completed your spoken English diagnostic yet"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:e?"仅需朗读一段标准广播短句,即刻获取母语等级预估、5 维雷达图与专属电台收听建议(首次免费)。":"Read a short broadcast benchmark sentence to receive your estimated band, acoustic radar, and recommended station."})]}),i.jsxs("button",{onClick:()=>ie(!0),className:"px-5 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs shadow-md shadow-emerald-500/20 flex items-center gap-1.5 cursor-pointer shrink-0 transition-transform active:scale-95",children:[i.jsx(Nn,{className:"w-4 h-4"}),i.jsx("span",{children:e?"开始 30 秒声学定级 (首测免费)":"Start Free Speech Diagnostic"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-3.5",children:[i.jsxs("div",{id:"dashboard-card-notebooks",onClick:()=>l("notebook"),className:"p-5 bg-white dark:bg-slate-800/50 rounded-2xl border border-slate-200 dark:border-slate-700/80 hover:border-emerald-500/50 hover:shadow-md transition-all cursor-pointer group flex flex-col justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400 flex items-center justify-center group-hover:scale-110 transition-transform",children:i.jsx(Ys,{className:"w-5 h-5"})}),i.jsx("span",{className:"text-xl font-black text-slate-900 dark:text-slate-100 font-mono",children:p.length})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100 group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:n.dashboard.shadowingNotebook}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:n.dashboard.notebookDesc})]})]}),i.jsxs("div",{id:"dashboard-card-examiner",onClick:()=>l("examiner"),className:"p-5 bg-white dark:bg-slate-800/50 rounded-2xl border border-slate-200 dark:border-slate-700/80 hover:border-emerald-500/50 hover:shadow-md transition-all cursor-pointer group flex flex-col justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-50 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400 flex items-center justify-center group-hover:scale-110 transition-transform",children:i.jsx(yn,{className:"w-5 h-5"})}),i.jsxs("div",{className:"flex flex-col items-end",children:[i.jsx("span",{className:"text-xl font-black text-slate-900 dark:text-slate-100 font-mono",children:y.length}),J&&i.jsxs("span",{className:"text-[10px] font-bold text-emerald-600 dark:text-emerald-400 font-mono",children:["Band ",J.toFixed(1)]})]})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100 group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:n.dashboard.examinerHistory}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:n.dashboard.examinerDesc})]})]}),i.jsxs("div",{id:"dashboard-card-bookmarks",onClick:()=>l("bookmarks"),className:"p-5 bg-white dark:bg-slate-800/50 rounded-2xl border border-slate-200 dark:border-slate-700/80 hover:border-amber-500/50 hover:shadow-md transition-all cursor-pointer group flex flex-col justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-amber-50 dark:bg-amber-950/60 text-amber-600 dar
4805k:text-amber-400 flex items-center justify-center group-hover:scale-110 transition-transform",children:i.jsx(Jo,{className:"w-5 h-5"})}),i.jsx("span",{className:"text-xl font-black text-slate-900 dark:text-slate-100 font-mono",children:c.length})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100 group-hover:text-amber-600 dark:group-hover:text-amber-400 transition-colors",children:n.dashboard.savedSentences}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:n.dashboard.savedDesc})]})]}),i.jsxs("div",{id:"dashboard-card-history",onClick:()=>l("history"),className:"p-5 bg-white dark:bg-slate-800/50 rounded-2xl border border-slate-200 dark:border-slate-700/80 hover:border-blue-500/50 hover:shadow-md transition-all cursor-pointer group flex flex-col justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-blue-50 dark:bg-blue-950/60 text-blue-600 dark:text-blue-400 flex items-center justify-center group-hover:scale-110 transition-transform",children:i.jsx(Nn,{className:"w-5 h-5"})}),i.jsx("span",{className:"text-xl font-black text-slate-900 dark:text-slate-100 font-mono",children:h.length})]}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100 group-hover:text-blue-600 dark:group-hover:text-blue-400 transition-colors",children:n.dashboard.speechHistory}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:n.dashboard.historyDesc})]})]})]}),!a&&i.jsx("div",{className:"bg-gradient-to-br from-emerald-500/10 via-teal-500/5 to-slate-900/0 border border-emerald-500/20 p-6 md:p-8 rounded-3xl relative overflow-hidden",children:i.jsxs("div",{className:"max-w-md",children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(xi,{className:"w-5 h-5 text-emerald-500 fill-current"}),i.jsx("h3",{className:"text-lg font-bold",children:n.dashboard.upgradeCta})]}),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-sm mb-6 leading-relaxed",children:n.paywall.subtitle}),i.jsxs("button",{id:"dashboard-upgrade-cta-btn",onClick:()=>O(!0),className:"px-6 py-3 bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold rounded-2xl shadow-lg shadow-emerald-600/20 transition-all flex items-center gap-2 cursor-pointer group",children:[i.jsx(fr,{className:"w-4 h-4 fill-current text-amber-200 group-hover:rotate-12 transition-transform"}),i.jsxs("span",{children:[n.paywall.title," · ",e?"低至 ¥41.5/月":"From $6.66/mo"]})]})]})})]}),o==="notebook"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg font-extrabold flex items-center gap-2",children:[i.jsx(Ys,{className:"w-5 h-5 text-emerald-500"}),n.dashboard.shadowingNotebook]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:n.dashboard.notebookDesc})]}),i.jsxs("a",{href:"/",className:"px-3.5 py-1.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center gap-1.5 transition-all shadow-sm cursor-pointer",children:[i.jsx(Nn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:n.dashboard.backToLive})]})]}),I?i.jsx("div",{className:"flex justify-center p-12",children:i.jsx(Bs,{className:"w-8 h-8 text-emerald-500 animate-spin"})}):p.length===0?i.jsxs("div",{className:"text-center py-16 bg-white dark:bg-slate-800/40 rounded-3xl border border-slate-200 dark:border-slate-700/80 p-8 flex flex-col items-center",children:[i.jsx("div",{className:"w-14 h-14 rounded-2xl bg-emerald-100 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400 flex items-center justify-center mb-4",children:i.jsx(Ys,{className:"w-7 h-7"})}),i.jsx("h4",{className:"text-base font-bold mb-1",children:n.dashboard.noNotebooks}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 max-w-sm mb-6 leading-relaxed",children:e?"在剧场模式中开启“连续跟读”,AI 将自动对齐电台长段原声并生成发音诊断报告。":'Enable "Continuous Shadowing" in Theater Mode to practice long broadcast segments with automatic AI sentence alignment and scoring.'}),i.jsx("a",{href:"/",className:"px-5 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-semibold text-xs shadow-md shadow-emerald-500/20 transition-all cursor-pointer",children:n.dashboard.backToLive})]}):i.jsx("div",{className:"grid grid-cols-1 gap-3.5",children:p.map((ce,Ce)=>{var nt,We;const Ae=Math.floor((ce.durationSeconds||0)/60),je=(ce.durationSeconds||0)%60;return i.jsxs("div",{className:"bg-white dark:bg-slate-800/50 p-5 rounded-2xl border border-slate-200 dark:border-slate-700/80 shadow-xs hover:border-emerald-500/50 transition-all flex flex-col md:flex-row items-start md:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-start gap-4",children:[i.jsxs("div",{className:"w-12 h-12 rounded-2xl bg-emerald-100 dark:bg-emerald-950/80 text-emerald-600 dark:text-emerald-400 flex flex-col items-center justify-center font-extrabold shrink-0 border border-emerald-200 dark:border-emerald-800/50",children:[i.jsx("span",{className:"text-sm leading-none",children:ce.overallBand?ce.overallBand.toFixed(1):"7.5"}),i.jsx("span",{className:"text-[8px] uppercase tracking-wider font-mono text-emerald-700/80 dark:text-emerald-300/80 mt-0.5",children:e?"流利度":"Band"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100",children:ce.stationName||(e?"全球实时广播":"Live Broadcast Radio")}),i.jsx("span",{className:"text-[10px] font-mono text-slate-400 bg-slate-100 dar
4805k:bg-slate-750 px-2 py-0.5 rounded",children:ce.language||"English"})]}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1 flex items-center gap-3",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(Eo,{className:"w-3 h-3 text-emerald-500"}),Ae,e?"分":"m"," ",je,e?"秒":"s"]}),i.jsx("span",{children:"•"}),i.jsxs("span",{children:[ce.totalSentencesCount||((nt=ce.sentences)==null?void 0:nt.length)||0," ",e?"句跟读":"Sentences"]}),i.jsx("span",{children:"•"}),i.jsxs("span",{className:"text-rose-500 font-medium",children:[ce.problemWordsCount||((We=ce.keyProblemWords)==null?void 0:We.length)||0," ",e?"个难点发音词":"Problem Words"]})]}),ce.summaryFeedback&&i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-300 mt-2 line-clamp-1 italic",children:['"',ce.summaryFeedback,'"']})]})]}),i.jsxs("div",{className:"flex items-center gap-2 w-full md:w-auto justify-end border-t md:border-t-0 pt-3 md:pt-0 border-slate-100 dark:border-slate-700/50",children:[ce.id&&i.jsx("button",{onClick:()=>H(ce.id),className:"p-2 rounded-xl text-slate-400 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/30 transition-colors cursor-pointer",title:n.dashboard.deleteRecord,children:i.jsx(Fd,{className:"w-4 h-4"})}),i.jsxs("button",{onClick:()=>E(ce),className:"px-4 py-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-semibold text-xs transition-all shadow-sm flex items-center gap-1.5 cursor-pointer",children:[i.jsx("span",{children:n.dashboard.viewDiagnosis}),i.jsx(Md,{className:"w-3.5 h-3.5"})]})]})]},ce.id||Ce)})})]}),o==="bookmarks"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg font-extrabold flex items-center gap-2",children:[i.jsx(Jo,{className:"w-5 h-5 text-amber-500 fill-amber-500"}),i.jsxs("span",{children:[n.dashboard.savedSentences," (",c.length,")"]})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:n.dashboard.savedDesc})]}),i.jsxs("a",{href:"/",className:"px-3.5 py-1.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center gap-1.5 transition-all shadow-sm cursor-pointer",children:[i.jsx(Nn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:n.dashboard.backToLive})]})]}),I?i.jsx("div",{className:"flex justify-center p-12",children:i.jsx(Bs,{className:"w-8 h-8 text-emerald-500 animate-spin"})}):c.length===0?i.jsxs("div",{className:"text-center py-16 bg-white dark:bg-slate-800/40 rounded-3xl border border-slate-200 dark:border-slate-700/80 p-8 flex flex-col items-center",children:[i.jsx("div",{className:"w-14 h-14 rounded-2xl bg-amber-100 dark:bg-amber-950/60 text-amber-600 dark:text-amber-400 flex items-center justify-center mb-4",children:i.jsx(Jo,{className:"w-7 h-7 fill-current"})}),i.jsx("h4",{className:"text-base font-bold mb-1",children:n.dashboard.noSaved}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 max-w-sm mb-6 leading-relaxed",children:e?"在电台播放或剧场模式中点击句子旁的收藏图标,即可将经典句式保存在此处进行复习。":"Click the bookmark icon on any sentence card during live radio streams or in Theater Mode to collect them here for focused review."}),i.jsx("a",{href:"/",className:"px-5 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-semibold text-xs shadow-md shadow-emerald-500/20 transition-all cursor-pointer",children:n.dashboard.backToLive})]}):i.jsx("div",{className:"grid grid-cols-1 gap-3.5",children:c.map((ce,Ce)=>i.jsxs("div",{className:"bg-white dark:bg-slate-800/50 p-5 rounded-2xl border border-slate-200 dark:border-slate-700/80 shadow-xs hover:border-emerald-500/40 transition-all flex flex-col md:flex-row md:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-1.5 flex-1 pr-2",children:[i.jsx("div",{className:"flex items-center gap-2",children:i.jsx("span",{className:"text-[10px] font-mono text-amber-700 dark:text-amber-300 bg-amber-50 dark:bg-amber-950/60 px-2 py-0.5 rounded border border-amber-200/60 dark:border-amber-800/40 font-bold uppercase",children:ce.language||"English"})}),i.jsxs("p",{className:"font-semibold text-slate-800 dark:text-slate-100 text-sm md:text-base leading-relaxed",children:['"',ce.originalText,'"']}),ce.translatedText&&i.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-xs",children:ce.translatedText})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0 border-t md:border-t-0 pt-3 md:pt-0 border-slate-100 dar
4805k:border-slate-700/50 justify-end",children:[i.jsx("button",{onClick:()=>Y(ce.originalText,ce.id),className:"p-2 rounded-xl text-slate-400 hover:text-rose-600 hover:bg-rose-50 dark:hover:bg-rose-950/30 transition-colors cursor-pointer",title:n.dashboard.deleteBookmark,children:i.jsx(Fd,{className:"w-4 h-4"})}),i.jsxs("a",{href:`/?sentence=${encodeURIComponent(ce.originalText)}`,className:"px-4 py-2 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-semibold text-xs transition-all shadow-sm flex items-center gap-1.5 cursor-pointer",children:[i.jsx(Nn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:n.dashboard.practiceSentence})]})]})]},ce.id||Ce))})]}),o==="history"&&i.jsxs("div",{className:"space-y-4 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[i.jsxs("h3",{className:"text-lg font-bold",children:[n.dashboard.speechHistory," (",h.length,")"]}),I?i.jsx("div",{className:"flex justify-center p-12",children:i.jsx(Bs,{className:"w-8 h-8 text-emerald-500 animate-spin"})}):h.length===0?i.jsxs("div",{className:"text-center py-12 bg-white dark:bg-slate-800/40 rounded-3xl border border-slate-200 dark:border-slate-700/80 p-8",children:[i.jsx(Nn,{className:"w-12 h-12 text-slate-300 dark:text-slate-600 mx-auto mb-3"}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-sm",children:n.dashboard.noHistory})]}):i.jsxs("div",{className:"space-y-4",children:[i.jsx("div",{className:"grid grid-cols-1 gap-3",children:de.map(ce=>i.jsxs("div",{className:"bg-white dark:bg-slate-800/50 p-4 rounded-2xl border border-slate-200 dark:border-slate-700 shadow-xs flex flex-col md:flex-row md:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex-1 space-y-1",children:[i.jsx("p",{className:"font-semibold text-slate-800 dark:text-slate-100 text-sm",children:ce.originalText}),ce.translatedText&&i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:ce.translatedText}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1",children:[i.jsx("span",{className:"text-xs px-2.5 py-0.5 rounded-full bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400 font-bold border border-emerald-500/20",children:ce.score?`${ce.score} / 100 PTS`:`Band ${ce.estimatedBand||7.5}`}),ce.cefrLevel&&i.jsxs("span",{className:"text-xs px-2.5 py-0.5 rounded-full bg-indigo-50 text-indigo-700 dark:bg-indigo-500/10 dark:text-indigo-400 font-bold border border-indigo-500/20",children:["CEFR ",ce.cefrLevel]}),ce.stationName&&i.jsxs("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:["• ",ce.stationName]})]})]}),i.jsxs("button",{onClick:()=>T(ce),className:"px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-emerald-500 dark:hover:bg-emerald-400 text-white dark:text-slate-950 font-bold text-xs shadow-xs transition-all flex items-center justify-center gap-1.5 shrink-0 cursor-pointer",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-400 dark:text-slate-950"}),i.jsx("span",{children:e?"查看深度诊断报告":"View Diagnostic Report"})]})]},ce.id))}),!a&&W>0&&i.jsxs("div",{className:"p-4 bg-amber-50 dark:bg-amber-950/20 border border-amber-200 dark:border-amber-900/40 rounded-2xl flex items-center justify-between",children:[i.jsxs("div",{className:"text-xs text-amber-800 dark:text-amber-300",children:[i.jsxs("span",{className:"font-bold",children:["+",W," ",e?"条历史记录已锁定":"older history records locked","."]})," ",e?"升级 PRO 解锁完整历史记录与深度诊断。":"Upgrade to PRO for full history access."]}),i.jsx("button",{onClick:()=>O(!0),className:"px-3 py-1.5 bg-amber-500 hover:bg-amber-400 text-slate-950 font-bold text-xs rounded-xl shadow-xs transition-colors cursor-pointer",children:n.paywall.title})]})]})]}),o==="examiner"&&i.jsxs("div",{className:"space-y-6 animate-in fade-in slide-in-from-bottom-4 duration-500",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg font-bold flex items-center gap-2",children:[i.jsx(yn,{className:"w-5 h-5 text-emerald-500"}),i.jsx("span",{children:n.dashboard.examinerHistory}),i.jsxs("span",{className:"text-sm font-normal text-slate-400",children:["(",y.length,")"]})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:n.dashboard.examinerDesc})]}),i.jsxs("a",{href:"/?openExaminer=true",className:"self-start sm:self-auto px-4 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center gap-2 shadow-md shadow-emerald-600/20 transition-all cursor-pointer",children:[i.jsx(yn,{className:"w-4 h-4"}),i.jsx("span",{children:n.dashboard.startExaminerCta})]})]}),y.length>0&&i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[i.jsxs("div",{className:"p-4 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/80 flex flex-col justify-between",children:[i.jsx("span",{className:"text-[11px] font-semibold text-slate-500 dark:text-slate-400",children:n.dashboard.totalOralSessions}),i.jsx("span",{className:"text-2xl font-black text-slate-900 dark:text-slate-100 font-mono mt-1",children:y.length})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/80 flex flex-col justify-between",children:[i.jsx("span",{className:"text-[11px] font-semibold text-slate-500 dark:text-slate-400",children:n.dashboard.latestBand}),i.jsxs("div",{className:"flex items-baseline gap-1.5 mt-1",children:[i.jsx("span",{className:"text-2xl font-black text-emerald-600 dark:text-emerald-400 font-mono",children:J?J.toFixed(1):"—"}),((le=y[0])==null?void 0:le.cefrLevel)&&i.jsx("span",{className:"text-[10px] font-bold text-slate-400",children:y[0].cefrLevel})]})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/80 flex flex-col justify-between",children:[i.jsx("span",{className:"text-[11px] font-semibold text-slate-500 dark:text-slate-400",children:n.dashboard.peakBand}),i.jsx("span",{className:"text-2xl font-black text-amber-500 font-mono mt-1",children:K?K.toFixed(1):"—"})]}),i.jsxs("div",{className:"p-4 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/80 flex flex-col justify-between",children:[i.jsx("span",{className:"text-[11px] font-semibold text-slate-500 dark:text-slate-400",children:n.dashboard.averageBand}),i.jsx("span",{className:"text-2xl font-black text-indigo-500 font-mono mt-1",children:oe?oe.toFixed(1):"—"})]})]}),y.length>=2&&i.jsxs("div",{className:"p-4 sm:p-5 rounded-2xl bg-white dark:bg-slate-800/50 border border-slate-200 dark:border-slate-700/80 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("span",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-500"}),e?"纯正口语实战能力进阶轨迹":"Spoken Fluency Progression Track"]}),i.jsx("span",{className:"text-[10px] text-slate-400 font-mono",children:e?"按指导记录倒序":"Chronological Milestones"})]}),i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto pb-1 custom-scrollbar",children:y.slice().reverse().map((ce,Ce)=>i.jsxs("div",{onClick:()=>P(ce),className:"flex-1 min-w-[110px] p-2.5 rounded-xl bg-slate-50 dark:bg-slate-900/60 border border-slate-200 dark:border-slate-700/60 hover:border-emerald-500 transition-all cursor-pointer group text-center",children:[i.jsxs("div",{className:"text-[10px] text-slate-400 font-mono",children:["Session #",Ce+1]}),i.jsxs("div",{className:"text-base font-black font-mono text-emerald-600 dark:text-emerald-400 group-hover:scale-105 transition-transform",children:["Band ",ce.overallBand]}),i.jsx("div",{className:"text-[9px] text-slate-500 truncate mt-0.5",children:ce.cefrLevel})]},ce.id||Ce))})]}),I?i.jsx("div",{className:"flex justify-center p-12",children:i.jsx(Bs,{className:"w-8 h-8 text-emerald-500 animate-spin"})}):y.length===0?i.jsxs("div",{className:"text-center py-12 bg-white dark:bg-slate-800/40 rounded-3xl border border-slate-200 dark:border-slate-700/80 p-8 space-y-4",children:[i.jsx(yn,{className:"w-12 h-12 text-slate-300 dark:text-slate-600 mx-auto"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-bold text-slate-700 dark:text-slate-300 text-sm",children:n.dashboard.noExaminerHistory}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1 max-w-md mx-auto",children:n.dashboard.noExaminerDesc})]}),i.jsxs("a",{href:"/?openExaminer=true",className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs shadow-md shadow-emerald-600/20 transition-all cursor-pointer",children:[i.jsx(yn,{className:"w-4 h-4"}),i.jsx("span",{children:n.dashboard.startExaminerCta})]})]}):i.jsx("div",{className:"space-y-4",children:y.map(ce=>{var Ae,je;const Ce=(Ae=ce.evaluatedAt)!=null&&Ae.toMillis?new Date(ce.evaluatedAt.toMillis()).toLocaleStr
4805ing(e?"zh-CN":"en-US"):ce.evaluatedAt?new Date(ce.evaluatedAt).toLocaleString(e?"zh-CN":"en-US"):"";return i.jsxs("div",{className:"bg-white dark:bg-slate-800/50 p-5 rounded-2xl border border-slate-200 dark:border-slate-700/80 shadow-xs hover:border-emerald-500/40 transition-all flex flex-col md:flex-row md:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-start sm:items-center gap-4",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center w-16 h-16 rounded-2xl bg-gradient-to-br from-emerald-500 to-teal-600 text-white shadow-md shadow-emerald-500/20 shrink-0",children:[i.jsx("span",{className:"text-[9px] font-bold uppercase tracking-wider opacity-90",children:"Band"}),i.jsx("span",{className:"text-2xl font-black font-mono leading-none",children:ce.overallBand})]}),i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsx("span",{className:"text-sm font-black text-slate-900 dark:text-slate-100",children:ce.cefrLevel}),i.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-emerald-50 text-emerald-700 dark:bg-emerald-500/10 dark:text-emerald-400 font-bold border border-emerald-500/20",children:ce.stationName||"Global Radio"}),Ce&&i.jsxs("span",{className:"text-xs text-slate-400 dark:text-slate-500",children:["• ",Ce]})]}),ce.scores&&i.jsxs("div",{className:"flex flex-wrap items-center gap-2 pt-1 text-[11px]",children:[i.jsxs("span",{className:"px-2 py-0.5 rounded bg-slate-100 dark:bg-slate-700/60 text-slate-700 dark:text-slate-300 font-medium",children:[n.dashboard.fluency,": ",i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:ce.scores.fluencyAndCoherence})]}),i.jsxs("span",{className:"px-2 py-0.5 rounded bg-slate-100 dark:bg-slate-700/60 text-slate-700 dark:text-slate-300 font-medium",children:[n.dashboard.lexical,": ",i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:ce.scores.lexicalResource})]}),i.jsxs("span",{className:"px-2 py-0.5 rounded bg-slate-100 dark:bg-slate-700/60 text-slate-700 dark:text-slate-300 font-medium",children:[n.dashboard.grammar,": ",i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:ce.scores.grammaticalAccuracy})]}),i.jsxs("span",{className:"px-2 py-0.5 rounded bg-slate-100 dark:bg-slate-700/60 text-slate-700 dark:text-slate-300 font-medium",children:[n.dashboard.pronunciation,": ",i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:ce.scores.pronunciationAcoustic})]})]}),((je=ce.report)==null?void 0:je.examinerSummary)&&i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400 italic line-clamp-1 pt-0.5 font-serif",children:['"',ce.report.examinerSummary,'"']})]})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0 self-end md:self-center",children:[i.jsxs("button",{onClick:()=>P(ce),className:"px-3.5 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-emerald-500 dark:hover:bg-emerald-400 text-white dark:text-slate-950 font-bold text-xs shadow-xs transition-all flex items-center gap-1.5 cursor-pointer",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-400 dark:text-slate-950"}),i.jsx("span",{children:n.dashboard.viewExamReport})]}),i.jsx("button",{onClick:()=>re(ce),disabled:R===ce.id,title:n.dashboard.exportCertificate,className:"p-2 rounded-xl border border-slate-200 dark:border-slate-700 hover:bg-slate-100 dark:hover:bg-slate-800 text-slate-600 dark:text-slate-300 transition-colors cursor-pointer",children:R===ce.id?i.jsx(Bs,{className:"w-4 h-4 animate-spin text-emerald-500"}):i.jsx(yn,{className:"w-4 h-4 text-emerald-500"})}),i.jsx("button",{onClick:()=>se(ce.id),title:n.dashboard.deleteRecord,className:"p-2 rounded-xl border border-slate-200 dark:border-slate-700 hover:bg-rose-50 dark:hover:bg-rose-950/30 text-slate-400 hover:text-rose-600 dar
4805k:hover:text-rose-400 transition-colors cursor-pointer",children:i.jsx(Fd,{className:"w-4 h-4"})})]})]},ce.id)})})]})]})]})]}),B&&i.jsx(ate,{report:B,onClose:()=>E(null),onSaveWord:async(ce,Ce)=>{if(t!=null&&t.uid)try{const{addDoc:Ae,collection:je,serverTimestamp:nt}=await c0(async()=>{const{addDoc:dt,collection:bt,serverTimestamp:Yt}=await Promise.resolve().then(()=>Rk);return{addDoc:dt,collection:bt,serverTimestamp:Yt}},void 0),{db:We}=await c0(async()=>{const{db:dt}=await Promise.resolve().then(()=>Pk);return{db:dt}},void 0);await Ae(je(We,"saved_sentences"),{userId:t.uid,originalText:ce,translatedText:Ce,language:B.language||"English",savedAt:nt()})}catch(Ae){console.error("Save word error:",Ae)}}}),N&&i.jsx(ite,{evaluationResult:{overallScore:N.score||82,estimatedBand:N.estimatedBand||7.5,cefrLevel:N.cefrLevel||"C1 Advanced Flow",radarMetrics:N.radarMetrics||[],phoneticFeedback:N.phoneticFeedback||"",wordAnalysis:N.wordAnalysis||[]},targetSentence:N.originalText,translatedSentence:N.translatedText,userAudioUrl:null,nativeAudioUrl:null,stationName:N.stationName||"Global Live Radio",language:N.language||"English",onClose:()=>T(null),onSaveWord:async(ce,Ce)=>{if(t!=null&&t.uid)try{const{addDoc:Ae,collection:je,serverTimestamp:nt}=await c0(async()=>{const{addDoc:dt,collection:bt,serverTimestamp:Yt}=await Promise.resolve().then(()=>Rk);return{addDoc:dt,collection:bt,serverTimestamp:Yt}},void 0),{db:We}=await c0(async()=>{const{db:dt}=await Promise.resolve().then(()=>Pk);return{db:dt}},void 0);await Ae(je(We,"saved_sentences"),{userId:t.uid,originalText:ce,translatedText:Ce,language:N.language||"English",savedAt:nt()})}catch(Ae){console.error("Save word error:",Ae)}}}),k&&k.report&&i.jsx(i6e,{record:k,onClose:()=>P(null),onDelete:ce=>se(ce)}),i.jsx(l5,{isOpen:M!==null,initialTab:M||"terms",onClose:()=>U(null)}),i.jsx(Z2,{isOpen:j,onClose:()=>O(!1),user:t,onOpenAuthModal:()=>{O(!1)},onOpenLegal:ce=>U(ce),stats:{wordsCaught:c.length,shadowingsDone:p.length+h.length,globalStations:"10,000+"}}),i.jsx(ste,{isOpen:ee,onClose:()=>{ie(!1),Z(Eh())},onOpenPaywall:()=>O(!0)})]})}function n$(){return typeof crypto<"u"&&typeof crypto.randomUUID=="function"?crypto.randomUUID():"xxxxxxxx-xxxx-4xxx-yxxx-xxxxxxxxxxxx".replace(/[xy]/g,n=>{const e=Math.random()*16|0;return(n==="x"?e:e&3|8).toString(16)})}function c6e(n){const e=new Uint8Array(n);let t="";const r=e.byteLength,s=16384;for(let a=0;a<r;a+=s)t+=String.fromCharCode.apply(null,e.subarray(a,Math.min(a+s,r)));return btoa(t)}function d6e(n){const e=atob(n),t=e.length,r=Math.floor(t/2),s=new Float32Array(r),a=new ArrayBuffer(t),o=new Uint8Array(a);for(let c=0;c<t;c++)o[c]=e.charCodeAt(c);const l=new DataView(a);for(let c=0;c<r;c++)s[c]=l.getInt16(c*2,!0)/32768;return s}function u6e(n,e){if(e===16e3)return n;const t=e/16e3,r=Math.round(n.length/t),s=new Float32Array(r);for(let a=0;a<r;a++){const o=a*t,l=Math.floor(o),c=o-l,d=l+1<n.length?l+1:l;s[a]=n[l]*(1-c)+n[d]*c}return s}function h6e(n,e){const t=new ArrayBuffer(44+n.length*2),r=new DataView(t);Ww(r,0,"RIFF"),r.setUint32(4,36+n.length*2,!0),Ww(r,8,"WAVE"),Ww(r,12,"fmt "),r.setUint32(16,16,!0),r.setUint16(20,1,!0),r.setUint16(22,1,!0),r.setUint32(24,e,!0),r.setUint32(28,e*2,!0),r.setUint16(32,2,!0),r.setUint16(34,16,!0),Ww(r,36,"data"),r.setUint32(40,n.length*2,!0);let s=44;for(let a=0;a<n.length;a++,s+=2){const o=Math.max(-1,Math.min(1,n[a])),l=o<0?o*32768:o*32767;r.setInt16(s,l,!0)}return t}function Ww(n,e,t){for(let r=0;r<t.length;r++)n.setUint8(e+r,t.charCodeAt(r))}let lh=null,r$=null,s$=null,a$=null,i$=null;typeof window<"u"&&(window.__resumeMicContext=async()=>{if(lh&&lh.state==="suspended"){console.log("[Global Resume] Resuming globalMicContext audio pipeline...");try{await lh.resume()}catch(n){console.warn("[Global Resume] Failed to resume globalMicContext:",n)}}});class f6e{constructor(){this.nextStartTime=0,this.activeSources=[],this.accumulatedSamples=[],this.totalSampleCount=0,this.intervalId=null,this.turnIntervalId=null,this.silenceTimeoutId=null,this.targetLanguage="English",this.ws=null,this.currentTurnOriginal="",this.currentTurnTranslated="",this.isNewTurn=!0,this.activeVocabDictionary=null,this.onStateChange=()=>{},this.state={status:"idle",error:null,userTranscript:"",modelTranscript:""}}get micContext(){return lh}set micContext(e){lh=e}get micProcessor(){return r$}set micProcessor(e){r$=e}get sourceNode(){return s$}set sourceNode(e){s$=e}get radioGainNode(){return a$}set radioGainNode(e){a$=e}get playbackContext(){return i$}set playbackContext(e){i$=e}setVocabDictionary(e){this.activeVocabDictionary=e}updateState(e){this.state={...this.state,...e},this.onStateChange(this.state)}async connect(e,t,r){try{this.playbackContext||(this.playbackContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:24e3})),this.playbackContext.state==="suspended"&&await this.playbackContext.resume(),this.nextStartTime=this.playbackContext.currentTime,console.log(`[Live Translate Client] Pre-initialized and resumed playbackContext! State is "${this.playbackContext.state}"`)}catch(s){console.warn("[Live Translate Client] Failed to warm up playbackContext under gesture handler:",s)}
4805this.disconnect(),this.accumulatedSamples=[],this.totalSampleCount=0,this.currentTurnOriginal="",this.currentTurnTranslated="",this.isNewTurn=!0,this.onStateChange=t,this.targetLanguage=e,this.updateState({status:"connecting",error:null,userTranscript:"",modelTranscript:""});try{let a=`${window.location.protocol==="https:"?"wss:":"ws:"}//${window.location.host}/api/live-stream?targetLanguage=${encodeURIComponent(e)}`;r&&(a+=`&sourceLanguage=${encodeURIComponent(r)}`),this.ws=new WebSocket(a),this.currentTurnOriginal="",this.currentTurnTranslated="",this.isNewTurn=!0,this.ws.onopen=async()=>{try{this.accumulatedSamples=[],this.totalSampleCount=0,await this.startDOMAudioCapture(),this.updateState({status:"connected"}),this.accumulatedSamples=[],this.totalSampleCount=0,this.intervalId=setInterval(()=>{this.sendAccumulatedAudioStream()},1e3)}catch(o){console.error("[Live Translate Client] Failed to start audio capture in onopen handler:",o),this.updateState({status:"error",error:o.message||String(o)}),this.disconnect(!0)}},this.ws.onmessage=o=>{try{const l=JSON.parse(o.data);if(!l.originalText&&!l.translatedText&&!l.audio&&!l.turnComplete&&!l.error)return;console.log("🔴 [Stream Probe] 收到底层原始数据:",l);const c=l.error||(l.type==="error"?l.text:null);if(c){this.updateState({status:"error",error:c}),this.disconnect(!0);return}let d=this.currentTurnOriginal,h=this.currentTurnTranslated,m=!1;if(l.originalText){const y=l.originalText.trim();y&&(d+=(d?" ":"")+y,this.currentTurnOriginal=d,m=!0)}if(l.translatedText){const y=l.translatedText.trim();y&&(h+=(h?" ":"")+y,this.currentTurnTranslated=h,m=!0)}const p=()=>{const y=this.currentTurnOriginal.trim();let v=this.currentTurnTranslated.trim();if(!v&&y&&(v=y),y||v){const B=S9(y||v,this.activeVocabDictionary),E={id:n$(),originalText:y||v||"...",translatedText:v||y||"...",timestamp:new Date,focusVocab:B||void 0};console.log("🟡 [State Probe] Pushing synchronized subtitle card:",E),this.onTurnComplete&&this.onTurnComplete(E)}this.currentTurnOriginal="",this.currentTurnTranslated="",d="",h="",this.updateState({userTranscript:"",modelTranscript:""})};if(m){const y=!this.targetLanguage||this.targetLanguage.toLowerCase().includes("eng");this.updateState({userTranscript:d,modelTranscript:h||(y?d:"")}),this.silenceTimeoutId&&clearTimeout(this.silenceTimeoutId),this.silenceTimeoutId=setTimeout(()=>{p()},2500)}let x=!1;if(m){const y=(d||"").trim(),v=(h||"").trim(),B=y.slice(-1),E=v.slice(-1),N=/[.!??。!]/.test(B),T=/[.!??。!]/.test(E),P=y.split(/\s+/).length>=30||y.length>=280;(N&&T&&y.length>5&&v.length>2||P&&v.length>5)&&(x=!0)}(l.turnComplete||x)&&(this.silenceTimeoutId&&(clearTimeout(this.silenceTimeoutId),this.silenceTimeoutId=null),p()),l.audio&&this.playAudioChunk(l.audio)}catch{}},this.ws.onerror=o=>{console.error("[Live Translate Client] WebSocket error:",o),this.updateState({status:"error",error:"WebSocket streaming error. Please check server connection."}),this.disconnect(!0)},this.ws.onclose=()=>{console.log("[Live Translate Client] WebSocket closed."),this.disconnect(!0)}}catch(s){console.error("Failed to connect WebSocket stream:",s),this.updateState({status:"error",error:"Failed to establish live streaming session: "+(s.message||String(s))}),this.disconnect(!0)}}async startDOMAudioCapture(){try{let e=document.querySelector("audio");if(!e)for(let t=0;t<25&&(await new Promise(r=>setTimeout(r,100)),e=document.querySelector("audio"),!e);t++);if(!e)throw new Error("No active radio stream player found in the page layout. Please select a station from the map and click play before translating.");if(e.crossOrigin||(e.crossOrigin="anonymous"),this.micContext||(this.micContext=new(window.AudioContext||window.webkitAudioContext)),this.micContext.state==="suspended"&&await this.micContext.resume(),!this.sourceNode){this.sourceNode=this.micContext.createMediaElementSource(e),this.radioGainNode=this.micContext.createGain(),this.radioGainNode.gain.value=1,this.sourceNode.connect(this.radioGainNode),this.radioGainNode.connect(this.micContext.destination);const t=()=>{lh&&lh.state==="suspended"&&lh.resume().catch(r=>console.warn("[Web Audio Auto-Resume] Failed to resume AudioContext:",r))};e.addEventListener("play",t),e.addEventListener("playing",t)}this.micProcessor||(this.micProcessor=this.micContext.createScriptProcessor(4096,1,1));try{this.sourceNode.disconnect(this.micProcessor)}catch{}this.sourceNode.connect(this.micProcessor);try{this.micProcessor.disconnect(this.micContext.destination)}catch{}this.micProcessor.connect(this.micContext.destination),this.micProcessor.onaudioprocess=t=>{if(this.state.status!=="connected")return;let r=t.inputBuffer.getChannelData(0);const s=t.inputBuffer.sampleRate;s!==16e3?r=u6e(r,s):r=new Float32Array(r),this.accumulatedSamples.push(r),this.totalSampleC
4805ount+=r.length}}catch(e){throw console.error("Failed to initialize DOM audio capture:",e),e}}sendAccumulatedAudioStream(){if(this.state.status!=="connected"||!this.ws||this.ws.readyState!==WebSocket.OPEN||this.accumulatedSamples.length===0||this.totalSampleCount===0||this.totalSampleCount<4e3)return;const e=new Float32Array(this.totalSampleCount);let t=0;for(const a of this.accumulatedSamples)e.set(a,t),t+=a.length;this.accumulatedSamples=[],this.totalSampleCount=0;const r=h6e(e,16e3),s=c6e(r);this.ws.send(JSON.stringify({audio:s}))}playAudioChunk(e){try{this.playbackContext||(this.playbackContext=new(window.AudioContext||window.webkitAudioContext)({sampleRate:24e3})),this.playbackContext.state==="suspended"&&this.playbackContext.resume();const t=d6e(e);if(t.length===0)return;const r=this.playbackContext.createBuffer(1,t.length,24e3);r.getChannelData(0).set(t);const s=this.playbackContext.createBufferSource();s.buffer=r,s.connect(this.playbackContext.destination);const a=this.playbackContext.currentTime;this.nextStartTime<a&&(this.nextStartTime=a),s.start(this.nextStartTime),this.nextStartTime+=r.duration,this.activeSources.push(s),this.radioGainNode&&this.micContext&&this.radioGainNode.gain.setTargetAtTime(.2,this.micContext.currentTime,.1),s.onended=()=>{this.activeSources=this.activeSources.filter(o=>o!==s),this.activeSources.length===0&&this.radioGainNode&&this.micContext&&this.radioGainNode.gain.setTargetAtTime(1,this.micContext.currentTime,.3)}}catch(t){console.error("Audio playback error:",t)}}stopAllPlayback(){this.activeSources.forEach(e=>{try{e.stop()}catch{}}),this.activeSources=[],this.nextStartTime=0,this.radioGainNode&&this.micContext&&this.radioGainNode.gain.setTargetAtTime(1,this.micContext.currentTime,.1)}setPracticeMode(e){this.radioGainNode&&this.micContext&&this.radioGainNode.gain.setTargetAtTime(e?0:1,this.micContext.currentTime,.1)}disconnect(e=!1,t=!1){if(this.intervalId&&(clearInterval(this.intervalId),this.intervalId=null),this.turnIntervalId&&(clearInterval(this.turnIntervalId),this.turnIntervalId=null),this.silenceTimeoutId&&(clearTimeout(this.silenceTimeoutId),this.silenceTimeoutId=null),this.ws){try{this.ws.onclose=null,this.ws.onerror=null,this.ws.onmessage=null,this.ws.send(JSON.stringify({stop:!0})),this.ws.close()}catch{}this.ws=null}if(this.micProcessor){this.micProcessor.onaudioprocess=null;try{this.micProcessor.disconnect()}catch{}}if(this.sourceNode&&this.micProcessor)try{this.sourceNode.disconnect(this.micProcessor)}catch{}const r=document.querySelector("audio");if(!!!(r&&!r.paused&&!r.ended)&&this.micContext&&this.micContext.state!=="closed"&&this.micContext.suspend().catch(()=>{}),this.stopAllPlayback(),this.playbackContext&&(this.playbackContext.state!=="closed"&&this.playbackContext.close().catch(()=>{}),this.playbackContext=null),t&&(this.currentTurnOriginal.trim()||this.currentTurnTranslated.trim())){const a=this.currentTurnOriginal.trim(),o=this.currentTurnTranslated.trim(),l=S9(a,this.activeVocabDictionary),c={id:n$(),originalText:a||"...",translatedText:o||"...",timestamp:new Date,focusVocab:l||void 0};this.onTurnComplete&&this.onTurnComplete(c)}this.currentTurnOriginal="",this.currentTurnTranslated="",this.isNewTurn=!0,this.accumulatedSamples=[],this.totalSampleCount=0,this.updateState({status:e?"error":"idle",error:e?this.state.error:null,userTranscript:"",modelTranscript:""})}getLiveState(){return this.state}clearHistory(){this.updateState({userTranscript:"",modelTranscript:""})}}const m6e="G-3L1D7R1Q03",p6e=()=>{if(typeof window>"u")return;const n=m6e;if(document.getElementById("ga-gtag-script"))return;const e=document.createElement("script");e.id="ga-gtag-script",e.async=!0,e.src=`https://www.googletagmanager.com/gtag/js?id=${n}`,document.head.appendChild(e),window.dataLayer=window.dataLayer||[];function t(...r){window.dataLayer.push(r)}window.gtag=t,t("js",new Date),t("config",n,{page_path:window.location.pathname,send_page_view:!0}),console.log(`[Google Analytics] Successfully initialized with ID: ${n}`)},r_=(n,e)=>{typeof window<"u"&&window.gtag&&window.gtag("event",n,e)};function g6e({isActive:n,isRecording:e,isEvaluating:t,evaluationStepText:r,durationSeconds:s,targetLimitMinutes:a,recordedSentencesCount:o,stationName:l,isPro:c,renderTrigger:d=!1,isSetupOpen:h,onOpenSetup:m,onCloseSetup:p,onToggleActive:x,onStartRecording:y,onFinishAndAnalyze:v,onCancelRecording:B,onOpenPaywall:E}){const{t:N,isZh:T}=Or(),[k,P]=S.useState(10),[R,_]=S.useState("15"),[I,D]=S.useState(!1),[j,O]=S.useState(!1),M=h!==void 0?h:j,U=W=>{W?m?m():O(!0):p?p():O(!1)},[ee,ie]=S.useState(!1),G=S.useRef(null),Z=S.useRef(null);S.useEffect(()=>{if(!e||!G.current)return;const W=G.current,K=W.getContext("2d");if(!K)return;let J=0;const oe=()=>{K.clearRect(0,0,W.width,W.height);const Ie=W.width,pe=W.height,ye=pe/2;K.lineWidth=2,K.strokeStyle="#10b981",K.beginPath();const he=16,le=Ie/he;for(let ce=0;ce<he;ce++){const Ce=ce*le+le/2,Ae=Math.sin(J+ce*.4)*.5+.5,je=Math.max(4,Ae*(pe-8));K.fillStyle=ce%2===0?"#10b981":"#34d399",K.fillRect(Ce-2,ye-je/2,4,je)}J+=.15,Z.current=requestAnimationFrame(oe)};return oe(),()=>{Z.current&&cancelAnimationFrame(Z.current)}},[e]);const z=W=>{const K=Math.floor(W/60),J=W%60;return`${K.toString().padStart(2,"0")}:${J.toString().padStart(2,"0")}`},se=a*60,re=Math.max(0,se-s),H=e&&re<=120&&re>0,Y=()=>{let W=k;
4805if(I){const K=parseInt(R,10);!isNaN(K)&&K>=1&&K<=30?W=K:W=10}U(!1),y(W)},de=()=>{if(!c){E();return}e||(n?x(!1):U(!0))};return i.jsxs(i.Fragment,{children:[d&&i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs("button",{onClick:de,className:`group px-3 py-1.5 rounded-xl text-xs font-semibold flex items-center gap-2 transition-all cursor-pointer border shadow-sm ${e?"bg-emerald-600 text-white border-emerald-500 shadow-emerald-500/20 animate-pulse":n?"bg-emerald-50 text-emerald-700 dark:bg-emerald-950/60 dark:text-emerald-300 border-emerald-300 dark:border-emerald-800":"bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-200 border-slate-200 dark:border-slate-700 hover:border-emerald-500"}`,title:T?"连续实时跟读与 AI 诊断笔记":"Continuous Live Shadowing with AI Notebook Diagnosis",children:[i.jsxs("div",{className:"relative flex items-center justify-center",children:[i.jsx(Nn,{className:`w-3.5 h-3.5 ${e?"text-white animate-bounce":"text-emerald-600 dark:text-emerald-400"}`}),e&&i.jsx("span",{className:"absolute -top-1 -right-1 w-2 h-2 rounded-full bg-red-400 animate-ping"})]}),i.jsx("span",{children:N.app.continuousShadowing}),i.jsxs("span",{className:"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20 text-[9px] font-extrabold px-1.5 py-0.2 rounded-md uppercase tracking-wider flex items-center gap-0.5",children:[i.jsx(fr,{className:"w-2.5 h-2.5 text-amber-500"}),N.common.pro]})]})}),i.jsx(Qo,{children:M&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/60 backdrop-blur-sm p-4",children:i.jsxs(cs.div,{initial:{opacity:0,scale:.95,y:10},animate:{opacity:1,scale:1,y:0},exit:{opacity:0,scale:.95,y:10},className:"bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-3xl p-6 max-w-md w-full shadow-2xl relative",children:[i.jsx("button",{onClick:()=>U(!1),className:"absolute top-4 right-4 p-1.5 rounded-full text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",children:i.jsx(Ts,{className:"w-4 h-4"})}),i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"p-2.5 rounded-2xl bg-emerald-100 dark:bg-emerald-950/80 text-emerald-600 dark:text-emerald-400",children:i.jsx(Nn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"text-base font-bold text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[N.app.continuousShadowing,i.jsx("span",{className:"text-[10px] bg-amber-500/10 text-amber-600 dark:text-amber-400 font-extrabold px-1.5 py-0.5 rounded border border-amber-500/20",children:T?"PRO 专享":"PRO EXCLUSIVE"})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:T?"无需暂停,跟随广播原声持续跟读。AI 将为您生成完整的长流声学诊断。":"Shadow live broadcast without pausing. AI evaluates your full audio session."})]})]}),i.jsxs("div",{className:"mb-5 p-3 rounded-2xl bg-emerald-50/80 dark:bg-emerald-950/40 border border-emerald-200/60 dark:border-emerald-800/40 flex items-start gap-2.5 text-xs text-emerald-800 dark:text-emerald-300",children:[i.jsx(Er,{className:"w-4 h-4 text-emerald-600 dark:text-emerald-400 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("p",{className:"font-semibold",children:T?"强烈建议:佩戴耳机进行练习":"Recommended: Wear Headphones"}),i.jsx("p",{className:"text-[11px] text-emerald-700/80 dark:text-emerald-400/80 mt-0.5 leading-relaxed",children:T?"佩戴耳机可防止扬声器声音被麦克风二次录入,确保声学与口语流利度评测准确度。":"Prevents your microphone from recording broadcast speaker echo for acoustic accuracy."})]})]}),i.jsxs("div",{className:"mb-6",children:[i.jsxs("label",{className:"block text-xs font-bold text-slate-700 dark:text-slate-300 mb-2 flex items-center justify-between",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(Eo,{className:"w-3.5 h-3.5 text-emerald-500"}),T?"自动结算时长限制 (最多 30 分钟)":"Auto-Settle Duration Limit (Max 30 mins)"]}),i.jsx("span",{className:"text-[11px] font-normal text-slate-400",children:I?T?`自定义 ${R} 分钟`:`${R} min custom`:T?`目标 ${k} 分钟`:`${k} min target`})]}),i.jsxs("div",{className:"grid grid-cols-4 gap-2 mb-3",children:[[10,20,30].map(W=>i.jsxs("button",{type:"button",onClick:()=>{P(W),D(!1)},className:`py-2 px-3 rounded-xl text-xs font-semibold transition-all border text-center cursor-pointer ${!I&&k===W?"bg-emerald-600 text-white border-emerald-500 shadow-sm":"bg-slate-100 dar
4805k:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300 border-transparent"}`,children:[W," ",T?"分钟":"Mins"]},W)),i.jsxs("button",{type:"button",onClick:()=>D(!0),className:`py-2 px-3 rounded-xl text-xs font-semibold transition-all border text-center cursor-pointer flex items-center justify-center gap-1 ${I?"bg-emerald-600 text-white border-emerald-500 shadow-sm":"bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300 border-transparent"}`,children:[i.jsx(AW,{className:"w-3 h-3"}),T?"自定义":"Custom"]})]}),I&&i.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-800/60 rounded-2xl border border-slate-200 dark:border-slate-700 flex items-center gap-3",children:[i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:T?"自定义分钟数 (1 - 30):":"Custom Minutes (1 - 30):"}),i.jsx("input",{type:"number",min:1,max:30,value:R,onChange:W=>{const K=W.target.value;_(K)},className:"w-20 px-2.5 py-1.5 rounded-lg bg-white dark:bg-slate-900 border border-slate-300 dark:border-slate-600 text-sm font-bold text-center text-slate-900 dark:text-slate-100 focus:outline-none focus:border-emerald-500"}),i.jsx("span",{className:"text-xs text-slate-400",children:T?"分钟":"minutes"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{type:"button",onClick:()=>U(!1),className:"flex-1 py-2.5 px-4 rounded-xl border border-slate-200 dark:border-slate-700 text-xs font-semibold text-slate-600 dark:text-slate-300 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",children:N.common.cancel}),i.jsxs("button",{type:"button",onClick:Y,className:"flex-1 py-2.5 px-4 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-xs font-bold text-white shadow-md shadow-emerald-500/20 transition-all flex items-center justify-center gap-2 cursor-pointer",children:[i.jsx(Nn,{className:"w-3.5 h-3.5"}),T?"开始连续跟读":"Start Shadowing"]})]})]})})}),i.jsx(Qo,{children:e&&i.jsxs(cs.div,{initial:{opacity:0,height:0},animate:{opacity:1,height:"auto"},exit:{opacity:0,height:0},className:"w-full bg-slate-900/95 dark:bg-slate-950/95 text-white rounded-xl px-3 py-2 border border-emerald-500/30 shadow-md flex items-center justify-between gap-2.5 mb-2.5 shrink-0 overflow-hidden",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsxs("span",{className:"relative flex h-2 w-2 shrink-0",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-red-500"})]}),i.jsx("span",{className:"text-[11px] font-bold text-emerald-400 uppercase tracking-wider font-mono truncate",children:N.app.continuousShadowing}),i.jsxs("span",{className:"text-[10px] text-slate-400 font-mono hidden sm:inline truncate",children:["· ",T?`已捕获 ${o} 句`:`${o} lines captured`]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"hidden sm:block w-16 h-4",children:i.jsx("canvas",{ref:G,width:64,height:16,className:"w-full h-full rounded"})}),i.jsxs("div",{className:"flex items-center gap-1 font-mono text-xs font-bold text-slate-200 bg-slate-800/80 px-2 py-0.5 rounded-md border border-slate-700",children:[i.jsx(Eo,{className:"w-3 h-3 text-emerald-400"}),i.jsx("span",{children:z(s)}),i.jsx("span",{className:"text-slate-500",children:"/"}),i.jsx("span",{className:"text-slate-400 text-[10px]",children:z(se)})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i.jsx("button",{type:"button",onClick:B,className:"py-1 px-2 rounded-lg bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-slate-200 text-[10px] font-semibold transition-colors cursor-pointer",title:T?"放弃本次练习,不进行分析":"Discard session without analyzing",children:N.common.cancel}),i.jsxs("button",{type:"button",onClick:v,disabled:t,className:"py-1 px-2.5 rounded-lg bg-emerald-500 hover:bg-emerald-400 text-slate-950 font-bold text-[11px] flex items-center gap-1 shadow-sm transition-all cursor-pointer active:scale-95 disabled:opacity-50",children:[i.jsx(At,{className:"w-3 h-3 fill-slate-950"}),i.jsx("span",{children:T?"完成":"Finish"})]})]})]})}),i.jsx(Qo,{children:H&&i.jsxs(cs.div,{initial:{opacity:0,scale:.95}
4805,animate:{opacity:1,scale:1},exit:{opacity:0,scale:.95},className:"mb-3 p-2.5 rounded-xl bg-amber-500/15 border border-amber-500/30 text-amber-700 dark:text-amber-300 text-xs flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(wI,{className:"w-4 h-4 text-amber-500 shrink-0"}),i.jsx("span",{children:T?`即将达到 ${a} 分钟时长上限。会话将在 ${z(re)} 后自动结算。`:`Approaching ${a}-minute duration limit. Session will auto-settle in ${z(re)}.`})]}),i.jsx("button",{onClick:v,className:"text-xs font-bold underline hover:text-amber-500 cursor-pointer",children:T?"立即分析":"Analyze Now"})]})}),i.jsx(Qo,{children:t&&i.jsx("div",{className:"fixed inset-0 z-50 flex items-center justify-center bg-slate-950/70 backdrop-blur-md p-4 animate-in fade-in",children:i.jsxs(cs.div,{initial:{opacity:0,scale:.9},animate:{opacity:1,scale:1},className:"bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 rounded-3xl p-8 max-w-sm w-full text-center shadow-2xl flex flex-col items-center",children:[i.jsxs("div",{className:"relative mb-5",children:[i.jsx("div",{className:"w-16 h-16 rounded-full bg-emerald-100 dark:bg-emerald-950/80 flex items-center justify-center",children:i.jsx(Bs,{className:"w-8 h-8 text-emerald-500 animate-spin"})}),i.jsx(At,{className:"w-5 h-5 text-amber-500 absolute -top-1 -right-1 animate-pulse"})]}),i.jsx("h3",{className:"text-lg font-extrabold text-slate-900 dark:text-slate-100 mb-1",children:T?"正在生成跟读 AI 诊断报告":"Compiling Shadowing Report"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mb-4",children:r||(T?"对齐语音时序、评测声学音标并生成生词笔记...":"Aligning audio timeline, evaluating acoustic phonetics, and creating Notebook...")}),i.jsx("div",{className:"w-full bg-slate-100 dark:bg-slate-800 rounded-full h-1.5 overflow-hidden",children:i.jsx("div",{className:"bg-emerald-500 h-full w-2/3 animate-pulse"})})]})})})]})}const Yw="[email protected]";function x6e({userEmail:n,currentStationName:e,isPaywallActive:t=!1}){const{t:r}=Or(),[s,a]=S.useState(!1),[o,l]=S.useState(!1),[c,d]=S.useState(!1),[h,m]=S.useState("general"),p=S.useRef(null);S.useEffect(()=>{function E(N){p.current&&!p.current.contains(N.target)&&a(!1)}return s&&document.addEventListener("mousedown",E),()=>{document.removeEventListener("mousedown",E)}},[s]);const x=E=>{E.stopPropagation(),navigator.clipboard.writeText(Yw),d(!0),setTimeout(()=>d(!1),2e3)},y=E=>{let N="RadioShadow AI Support Request",T=`Hi RadioShadow Support Team,
4806
4807`;return E==="payment"?(N="RadioShadow AI - Payment & PRO Membership Support",T+=`I have a question or issue regarding PRO subscription / PayPal payment.
4808
4809Account Email: ${n||"Not signed in"}
4810
4811Details:
4812`):E==="audio"?(N="RadioShadow AI - Radio Stream & Audio Issue",T+=`I encountered an issue with station stream or audio playback.
4813Station: ${e||"General"}
4814
4815Details:
4816`):E==="feedback"?(N="RadioShadow AI - Feature Suggestion & Feedback",T+=`I have feedback or a feature request for RadioShadow AI:
4817
4818`):T+=`Account: ${n||"Not signed in"}
4819
4820Question / Issue description:
4821`,`mailto:${Yw}?subject=${encodeURIComponent(N)}&body=${encodeURIComponent(T)}`},v=E=>{window.location.href=y(E)},B=o||s;return i.jsx("aside",{id:"sidebar-customer-support-dock",ref:p,onMouseEnter:()=>l(!0),onMouseLeave:()=>l(!1),"aria-label":r.support.title,className:"fixed right-0 bottom-28 md:bottom-32 z-40 select-none pointer-events-auto",children:i.jsxs("div",{className:"relative flex flex-col items-end",children:[i.jsx(Qo,{children:s&&i.jsxs(cs.div,{initial:{opacity:0,x:20,scale:.95},animate:{opacity:1,x:0,scale:1},exit:{opacity:0,x:20,scale:.95},transition:{duration:.2},id:"customer-support-card",className:"mb-2 mr-3 w-80 max-w-[calc(100vw-2rem)] bg-white dark:bg-slate-900 rounded-2xl shadow-2xl border border-slate-200 dark:border-slate-800 p-4 text-slate-800 dark:text-slate-100 flex flex-col gap-3 overflow-hidden backdrop-blur-xl",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dark:border-slate-800/80 pb-2.5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-emerald-50 dark:bg-emerald-950/60 border border-emerald-200/60 dark:border-emerald-500/30 flex items-center justify-center text-emerald-600 dark:text-emerald-400",children:i.jsx(K2,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 leading-none",children:r.support.title}),i.jsx("p",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-medium mt-0.5",children:r.support.guarantee})]})]}),i.jsx("button",{id:"customer-support-close-btn",onClick:()=>a(!1),className:"p-1 rounded-lg text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",children:i.jsx(Ts,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/60 border border-slate-200/80 dark:border-slate-700/80 rounded-xl p-2.5 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2 min-w-0",children:[i.jsx(Kd,{className:"w-4 h-4 text-slate-400 shrink-0"}),i.jsx("span",{className:"text-xs font-mono font-bold text-slate-800 dark:text-slate-200 truncate select-all",children:Yw})]}),i.jsx("button",{id:"customer-support-copy-email-btn",onClick:x,className:`p-1.5 rounded-lg text-xs font-medium transition-all flex items-center gap-1 shrink-0 cursor-pointer ${c?"bg-emerald-100 dark:bg-emerald-950/60 text-emerald-700 dark:text-emerald-300":"bg-white dark:bg-slate-700 text-slate-700 dark:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-600 border border-slate-200 dark:border-slate-600"}`,title:r.support.copyEmail,children:c?i.jsxs(i.Fragment,{children:[i.jsx(Co,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),i.jsx("span",{className:"text-[10px] font-bold",children:r.support.copied})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pm,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"text-[10px]",children:r.support.copyEmail})]})})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsx("span",{className:"text-[10px] font-semibold text-slate-400 uppercase tracking-wider block",children:r.support.selectTopic}),i.jsxs("div",{className:"grid grid-cols-1 gap-1.5",children:[i.jsxs("button",{id:"support-topic-payment-btn",onClick:()=>v("payment"),className:"w-full text-left px-3 py-2 rounded-xl bg-slate-50 dark:bg-slate-800/40 hover:bg-emerald-50/80 dark:hover:bg-emerald-950/40 border border-slate-200/70 dark:border-slate-700/60 hover:border-emerald-300 dark:hover:border-emerald-500/40 transition-all flex items-center justify-between group cursor-pointer",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Pbe,{className:"w-3.5 h-3.5 text-amber-500 shrink-0"}),i.jsx("span",{className:"text-xs font-medium text-slate-800 dark:text-slate-200 group-hover:text-emerald-700 dark:group-hover:text-emerald-300",children:r.supp
4821ort.topicPayment})]}),i.jsx(Md,{className:"w-3 h-3 text-slate-400 group-hover:text-emerald-600 dark:group-hover:text-emerald-400"})]}),i.jsxs("button",{id:"support-topic-audio-btn",onClick:()=>v("audio"),className:"w-full text-left px-3 py-2 rounded-xl bg-slate-50 dark:bg-slate-800/40 hover:bg-emerald-50/80 dark:hover:bg-emerald-950/40 border border-slate-200/70 dark:border-slate-700/60 hover:border-emerald-300 dark:hover:border-emerald-500/40 transition-all flex items-center justify-between group cursor-pointer",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(cn,{className:"w-3.5 h-3.5 text-blue-500 shrink-0"}),i.jsx("span",{className:"text-xs font-medium text-slate-800 dark:text-slate-200 group-hover:text-emerald-700 dark:group-hover:text-emerald-300",children:r.support.topicAudio})]}),i.jsx(Md,{className:"w-3 h-3 text-slate-400 group-hover:text-emerald-600 dark:group-hover:text-emerald-400"})]}),i.jsxs("button",{id:"support-topic-general-btn",onClick:()=>v("general"),className:"w-full text-left px-3 py-2 rounded-xl bg-slate-50 dark:bg-slate-800/40 hover:bg-emerald-50/80 dark:hover:bg-emerald-950/40 border border-slate-200/70 dark:border-slate-700/60 hover:border-emerald-300 dark:hover:border-emerald-500/40 transition-all flex items-center justify-between group cursor-pointer",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(lye,{className:"w-3.5 h-3.5 text-rose-500 shrink-0"}),i.jsx("span",{className:"text-xs font-medium text-slate-800 dark:text-slate-200 group-hover:text-emerald-700 dark:group-hover:text-emerald-300",children:r.support.topicGeneral})]}),i.jsx(Md,{className:"w-3 h-3 text-slate-400 group-hover:text-emerald-600 dark:group-hover:text-emerald-400"})]})]})]}),i.jsxs("a",{id:"customer-support-send-mail-link",href:y("general"),className:"w-full py-2.5 px-4 bg-emerald-600 hover:bg-emerald-500 text-white rounded-xl text-xs font-bold shadow-md hover:shadow-lg transition-all flex items-center justify-center gap-2 active:scale-[0.98]",children:[i.jsx(Kd,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:r.support.openEmail.replace("{email}",Yw)})]})]})}),i.jsxs("div",{id:"customer-support-dock-tab",onClick:()=>a(!s),className:`flex items-center gap-2 pl-3 pr-2.5 py-2 rounded-l-xl bg-white/95 dark:bg-slate-900/95 backdrop-blur-md border-l border-y border-slate-200 dark:border-slate-800 hover:border-emerald-500/50 dark:hover:border-emerald-500/40 shadow-lg cursor-pointer group transition-all duration-300 ease-out ${B?"translate-x-0 opacity-100 shadow-emerald-950/10 dark:shadow-black/40":"translate-x-[calc(100%-10px)] opacity-40 hover:opacity-100 hover:translate-x-0"}`,title:r.support.title,children:[i.jsx("div",{className:"w-1 h-5 rounded-full bg-slate-300 dark:bg-slate-700 group-hover:bg-emerald-500 transition-colors shrink-0"}),i.jsx(wv,{className:"w-4 h-4 text-slate-500 dark:text-slate-400 group-hover:text-emerald-500 transition-colors shrink-0"}),i.jsx("span",{className:"text-xs font-semibold text-slate-700 dark:text-slate-300 group-hover:text-slate-900 dark:group-hover:text-white whitespace-nowrap pr-1 transition-colors",children:r.support.supportBtn})]})]})})}const b6e=n=>[{code:"en",name:n?"英语":"English",nativeName:"Global / UK / US / AU / CA",flag:"🇬🇧",desc:n?"BBC、NPR、ABC 澳洲、CBC 加拿大、RTE 爱尔兰及环球新闻":"BBC, NPR, ABC Australia, CBC Canada, RTE Ireland & World News",apiLang:"english",dialects:[{code:"ALL",label:n?"全部口音 (全球)":"All Dialects (Global)",shortName:n?"全球":"Global",flag:"🌐",accentTitle:n?"国际英语":"International English",phoneticFeature:n?"全球广播语调与多样化口音":"Global broadcast intonation & diverse accents"},{code:"GB",label:n?"英式标准音 (RP) & 英国":"British RP & UK",shortName:n?"英音":"British",flag:"🇬🇧",accentTitle:n?"标准英音 (RP)":"Received Pronunciation (RP)",phoneticFeature:n?"非卷舌、清脆辅音发音,纯正母语标准":"Non-rhotic, crisp consonant release, authentic standard"},{code:"US",label:n?"美式通用英语 (GA)":"General American",shortName:n?"美音":"American",flag:"🇺🇸",accentTitle:n?"通用美音 (GA)":"General American (GA)",phoneticFeature:n?"卷舌母音、闪音 /t/、节奏均衡":"Rhotic vowels, flapped /t/, balanced cadence"},{code:"AU",label:n?"澳大利亚口音":"Australian (Aussie)",shortName:n?"澳音":"Australian",flag:"🇦🇺",accentTitle:n?"通用澳语":"General Australian",phoneticFeature:n?"开阔双元音、升调语调、ABC 新闻标准":"Broad diphthongs, rising inflection, ABC News standard"},{code:"CA",label:n?"加拿大英语":"Canadian English",shortName:n?"加音":"Canadian",flag:"🇨🇦",accentTitle:n?"通用加拿大音":"General Canadian",phoneticFeature:n?"加拿大抬升双元音、清晰中性节奏":"Canadian raising diphthongs, clear neutral pacing"},{code:"IE",label:n?"爱尔兰英语":"Irish English",shortName:n?"爱尔兰":"Irish",flag:"🇮🇪",accentTitle:n?"爱尔兰口音":"Hiberno-English",phoneticFeature:n?"富有韵律感的旋律语调、独特色彩发音":"Musical melodic lilt, distinct rhotic articulation"}]},{code:"es",name:n?"西班牙语":"Spanish",nativeName:"Español",flag:"🇪🇸",desc:n?"西班牙 RNE、SER 电台、拉美与墨西哥新闻":"RNE Spain, Cadena SER, Latin America & Mexico news",apiLang:"spanish",dialects:[{co
4821de:"ALL",label:n?"全部口音 (全球)":"All Accents (Global)",shortName:n?"全球":"Global",flag:"🌐",accentTitle:n?"全球西班牙语":"Global Spanish",phoneticFeature:n?"泛西班牙语词汇与广播清晰度":"Pan-Hispanic vocabulary and broadcast clarity"},{code:"ES",label:n?"卡斯蒂利亚语 (西班牙)":"Castilian (Spain)",shortName:n?"西班牙":"Spain (Castilian)",flag:"🇪🇸",accentTitle:n?"卡斯蒂利亚标准音":"Castilian Spanish",phoneticFeature:n?"齿间音 /θ/、DELE B2/C1 标准":"Distinción /θ/, apical /s/, DELE B2/C1 standard"},{code:"MX",label:n?"墨西哥西班牙语":"Mexican Spanish",shortName:n?"墨西哥":"Mexican",flag:"🇲🇽",accentTitle:n?"墨西哥中央音":"Central Mexican",phoneticFeature:n?"平滑发音、非重读母音清晰":"Seseo, clear unstressed vowels, smooth cadence"},{code:"AR",label:n?"阿根廷口音":"Argentine (Rioplatense)",shortName:n?"阿根廷":"Argentine",flag:"🇦🇷",accentTitle:n?"拉普拉塔西班牙语":"Rioplatense Spanish",phoneticFeature:n?"Yeísmo rehilado (/ʃ/) 极具意大利风情语调":"Yeísmo rehilado (/ʃ/), Italianate intonation"},{code:"CO",label:n?"哥伦比亚口音":"Colombian (Bogotá)",shortName:n?"哥伦比亚":"Colombian",flag:"🇨🇴",accentTitle:n?"波哥大中央音":"Central Colombian",phoneticFeature:n?"极高声学发音精准度":"High phonetic precision, clear syllable timing"}]},{code:"fr",name:n?"法语":"French",nativeName:"Français",flag:"🇫🇷",desc:n?"法国 France Info、FIP 巴黎、France Inter、魁北克广播":"France Info, FIP Paris, France Inter, Quebec & Belgian radio",apiLang:"french",dialects:[{code:"ALL",label:n?"全部法语区":"All Francophone",shortName:n?"全球":"Global",flag:"🌐",accentTitle:n?"法语圈":"Francophonie",phoneticFeature:n?"全球法语广播与文化对话":"Global French broadcasts and cultural dialogues"},{code:"FR",label:n?"巴黎标准法语":"Metropolitan French (Paris)",shortName:n?"法国巴黎":"France (Paris)",flag:"🇫🇷",accentTitle:n?"巴黎标准法语":"Standard Parisian French",phoneticFeature:n?"严谨连音、规范省音、DELF/DALF 标准":"Precision liaisons, formal elisions, DELF/DALF standard"},{code:"CA",label:n?"魁北克法语 (加拿大)":"Quebec French (Canada)",shortName:n?"加拿大法语":"Canadian French",flag:"🇨🇦",accentTitle:n?"魁北克口音":"Québécois",phoneticFeature:n?"独特鼻化母音与破裂辅音":"Distinct nasal vowels, affrication of /t/ and /d/"},{code:"BE",label:n?"比利时法语":"Belgian French",shortName:n?"比利时":"Belgian",flag:"🇧🇪",accentTitle:n?"瓦隆法语":"Walloon French",phoneticFeature:n?"长短母音区分清晰":"Vowel length preservation, crisp cadence"},{code:"CH",label:n?"瑞士法语":"Swiss French",shortName:n?"瑞士":"Swiss",flag:"🇨🇭",accentTitle:n?"罗曼德法语":"Romand French",phoneticFeature:n?"节奏从容、吐字清晰":"Slightly measured pacing, clear articulation"}]},{code:"de",name:n?"德语":"German",nativeName:"Deutsch",flag:"🇩🇪",desc:n?"德国 Deutschlandfunk、NDR、Radio Eins、奥地利与瑞士广播":"Deutschlandfunk, NDR, Radio Eins, Austrian & Swiss radio",apiLang:"german",dialects:[{code:"ALL",label:n?"全部德语区":"All German Dialects",shortName:n?"全球":"Global",flag:"🌐",accentTitle:n?"德语区通用":"Global German",phoneticFeature:n?"标准 DACH 广播德语":"Standard DACH broadcast German"},{code:"DE",label:n?"标准德语 (Hochdeutsch)":"Standard German (Hochdeutsch)",shortName:n?"德国标准":"Germany (Standard)",flag:"🇩🇪",accentTitle:n?"标准德语":"Bühnendeutsch / Hochdeutsch",phoneticFeature:n?"声门紧闭音 (Knacklaut)、歌德 C1 标准":"Glottal stops (Knacklaut), Goethe C1 standard"},{code:"AT",label:n?"奥地利德语":"Austrian German",shortName:n?"奥地利":"Austrian",flag:"🇦🇹",accentTitle:n?"奥地利德语":"Österreichisches Deutsch",phoneticFeature:n?"柔和清塞音与旋律感":"Melodic cadence, soft unvoiced plosives"},{code:"CH",label:n?"瑞士标准德语":"Swiss Standard German",shortName:n?"瑞士德语":"Swiss German",flag:"🇨🇭",accentTitle:n?"瑞士高地德语":"Schweizer Hochdeutsch",phoneticFeature:n?"无 ß、独特的借词语调":"Lack of ß, distinct loanword intonations"}]},{code:"ja",name:n?"日语":"Japanese",nativeName:"日本語",flag:"🇯🇵",desc:n?"NHK World 日本、东京 FM 访谈、动漫与 J-Pop 文化":"NHK World Japan, Tokyo FM talk, Anime & J-Pop culture",apiLang:"japanese",dialects:[{co
4821de:"ALL",label:n?"东京标准语 (標準語)":"Standard Japanese (Tokyo)",shortName:n?"东京标准语":"Tokyo Standard",flag:"🇯🇵",accentTitle:"Hyojungo (標準語)",phoneticFeature:n?"NHK 声调高低音、敬语体、JLPT N1/N2 标准":"NHK pitch accent, Keigo honorifics, JLPT N1/N2 standard"}]},{code:"it",name:n?"意大利语":"Italian",nativeName:"Italiano",flag:"🇮🇹",desc:n?"Rai Radio 1、Radio 24、米兰文化访谈与意甲广播":"Rai Radio 1, Radio 24, Milan cultural talk & Serie A",apiLang:"italian",dialects:[{code:"ALL",label:n?"标准意大利语":"Standard Italian",shortName:n?"标准音":"Standard",flag:"🇮🇹",accentTitle:"Italiano Standard",phoneticFeature:n?"母音共鸣、双辅音叠音 (gemination)、CILS 标准":"Vocalic resonance, double consonants (gemination), CILS standard"}]},{code:"pt",name:n?"葡萄牙语":"Portuguese",nativeName:"Português",flag:"🇧🇷",desc:n?"BandNews FM、RTP Antena 1 里斯本、CBN 巴西":"BandNews FM, RTP Antena 1 Lisboa, CBN Brasil",apiLang:"portuguese",dialects:[{code:"ALL",label:n?"全部葡语区":"All Portuguese",shortName:n?"全球":"Global",flag:"🌐",accentTitle:n?"葡语圈":"Lusophone Portuguese",phoneticFeature:n?"全球葡语变体":"Global Portuguese speech varieties"},{code:"BR",label:n?"巴西葡萄牙语":"Brazilian Portuguese",shortName:n?"巴西":"Brazilian",flag:"🇧🇷",accentTitle:"Português Brasileiro",phoneticFeature:n?"开阔母音、富有节奏感音节":"Open vowels, rhythm
4821ic syllable timing, palatalization"},{code:"PT",label:n?"欧洲葡萄牙语 (里斯本)":"European Portuguese",shortName:n?"欧洲 (里斯本)":"European (Lisbon)",flag:"🇵🇹",accentTitle:"Português Europeu",phoneticFeature:n?"重音定时节奏、母音弱化":"Stress-timed rhythm, vowel reduction, sh-endings"}]},{code:"zh",name:n?"中文 / 普通话":"Chinese",nativeName:"普通话 / 國語",flag:"🇨🇳",desc:n?"CNR 中国之声、经济之声、国学广播":"CNR Voice of China, Economic Radio, Classical Culture",apiLang:"chinese",dialects:[{code:"ALL",label:n?"标准普通话 (北京)":"Standard Putonghua (Beijing)",shortName:n?"标准普通话":"Standard Mandarin",flag:"🇨🇳",accentTitle:"Putonghua (普通话)",phoneticFeature:n?"规范四声、卷舌辅音、PSC 一级标准":"Strict 4 tones, standard retroflex consonants, PSC Level 1 standard"}]}],y6e=n=>[{id:"news",title:n?"硬核深度新闻":"Hardcore News",subtitle:n?"严谨书面语、国际时政、财经与权威快讯":"Formal diction, international politics, economics & breaking affairs",icon:i.jsx(Cv,{className:"w-5 h-5 text-rose-500"}),accentColor:"hover:border-rose-500 hover:bg-rose-500/5 dark:hover:bg-rose-500/10",badge:n?"高阶纯正词汇":"Advanced / Academic",pacing:n?"快速且精准":"Fast & Precise",description:n?"适合扩充学术词汇、地缘政治术语及严谨的句法结构。":"Ideal for vocabulary expansion, geopolitical terminology, and structured formal sentence structures.",searchTags:["news","information","talk","world","politics"]},{id:"talk",title:n?"轻松访谈脱口秀":"Relaxed Talk Show",subtitle:n?"自然对话、文化访谈、日常幽默与随性口语":"Conversations, culture, interviews & natural conversational humor",icon:i.jsx(Ibe,{className:"w-5 h-5 text-amber-500"}),accentColor:"hover:border-amber-500 hover:bg-amber-500/5 dark:hover:bg-amber-500/10",badge:n?"地道口语俚语":"Everyday Slang",pacing:n?"自然生活语速":"Natural Cadence",description:n?"适合学习自然交谈语速、口语俚语、语气助词及自发性对话。":"Great for mastering natural conversational speed, everyday slang, filler expressions, and spontaneous dialogue.",searchTags:["talk","interview","culture","comedy","discu
4821ssion"]},{id:"sports",title:n?"高激情体育解说":"Fast-paced Sports",subtitle:n?"高能赛场实况解说、看台现场情绪与极速表达":"High-adrenaline live match commentary, stadium reactions & speed",icon:i.jsx(tve,{className:"w-5 h-5 text-emerald-500"}),accentColor:"hover:border-emerald-500 hover:bg-emerald-500/5 dark:hover:bg-emerald-500/10",badge:n?"高动态语流":"Dynamic Speech",pacing:n?"极速高频":"Rapid Fire",description:n?"非常适合高阶跟读学习者训练快速听觉反应与情感语调起伏。":"Perfect for advanced shadowers looking to train high-speed auditory reaction and emotional intonation.",searchTags:["sport","sports","football","commentary","soccer"]},{id:"pop",title:n?"流行音乐与电台 DJ":"Upbeat Music & Pop",subtitle:n?"榜单热歌伴随活力主持 DJ 互动与流行文化":"Chart-topping hits with lively host banter and energetic radio DJs",icon:i.jsx(gye,{className:"w-5 h-5 text-violet-500"}),accentColor:"hover:border-violet-500 hover:bg-violet-500/5 dark:hover:bg-violet-500/10",badge:n?"朗朗上口趣味":"Catchy & Fun",pacing:n?"欢快旋律节奏":"Lively Rhythms",description:n?"朗朗上口的旋律搭配充满活力的电台 DJ 过渡,包含大量现代生活习语。":"Catchy melody intervals paired with energetic radio host transitions and modern lifestyle idioms.",searchTags:["pop","hits","top40","dance","dj"]},{id:"chill",title:n?"舒缓慢调广播":"Ambient & Chill",subtitle:n?"舒缓声学音乐、放松节奏与低压力咬字发音":"Soothing acoustic grooves, relaxed pacing & clear low-stress listening",icon:i.jsx(ko,{className:"w-5 h-5 text-teal-500"}),accentColor:"hover:border-teal-500 hover:bg-teal-500/5 dark:hover:bg-teal-500/10",badge:n?"低认知负荷":"Low Cognitive Load",pacing:n?"平缓流畅":"Smooth & Relaxed",description:n?"背景音效清晰,伴随温和清晰的发音,适合进行低压力的基础跟读。":"Uncluttered soundscapes with gentle vocal enunciation for calm, low-stress pronunciation shadowing.",searchTags:["chillout","ambient","lounge","easy","classical"]}],v6e=[{changeid:"mat-en-news-uk-1",stationuuid:"wiz-en-bbc",name:"BBC World Service",url:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",url_resolved:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",homepage:"https://bbc.co.uk",favicon:"https://www.bbc.co.uk/favicon.ico",tags:"news,talk,world,english,academic",country:"United Kingdom",countrycode:"GB",state:"London",language:"english",votes:18500,clickcount:32e3,codec:"MP3",bitrate:128,matchScore:99,accentCode:"GB",highlightTag:"Standard British RP",shadowingTip:"Crystal clear British accent, formal syntax, high frequency C1/C2 academic vocabulary."},{changeid:"mat-en-news-us-1",stationuuid:"wiz-en-npr",name:"NPR 24 Hour Program Stream",url:"https://npr-ice.streamguys1.com/live.mp3",url_resolved:"https://npr-ice.streamguys1.com/live.mp3",homepage:"https://npr.org",favicon:"https://media.npr.org/images/favicon.ico",tags:"news,talk,public radio,american",country:"United States",countrycode:"US",state:"Washington, D.C.",language:"english",votes:16200,clickcount:28500,codec:"MP3",bitrate:128,matchScore:98,accentCode:"US",highlightTag:"General American Standard",shadowingTip:"Balanced American pacing with rich journalistic narrative and investigative depth."},{changeid:"mat-en-news-au-1",stationuuid:"wiz-en-abc-au",name:"ABC News Radio Australia",url:"https://live-radio01.mediahubaustralia.com/PBW/mp3/",url_resolved:"https://live-radio01.mediahubaustralia.com/PBW/mp3/",homepage:"https://abc.net.au/news",favicon:"https://www.abc.net.au/favicon.ico",tags:"news,australia,sydney,world",country:"Australia",countrycode:"AU",state:"Sydney",language:"english",votes:12100,clickcount:22400,codec:"MP3",bitrate:128,matchScore:98,accentCode:"AU",highlightTag:"General Australian Accent",shadowingTip:"Australia's national rolling news. Practice distinct Aussie diphthongs and Asia-Pacific political reports."},{changeid:"mat-en-news-ca-1",stationuuid:"wiz-en-cbc-ca",name:"CBC Radio One Toronto",url:"https://cbcliveradio.akamaized.net/hls/live/2041639/ES_R1TOR/master.m3u8",url_resolved:"https://cbcliveradio.akamaized.net/hls/live/2041639/ES_R1TOR/master.m3u8",homepage:"https://cbc.ca
4821/radio",favicon:"https://www.cbc.ca/favicon.ico",tags:"news,canada,toronto,public",country:"Canada",countrycode:"CA",state:"Toronto",language:"english",votes:10900,clickcount:19800,codec:"AAC",bitrate:128,matchScore:97,accentCode:"CA",highlightTag:"General Canadian Standard",shadowingTip:"Crisp Canadian diction, measured enunciation, and in-depth North American news coverage."},{changeid:"mat-en-news-ie-1",stationuuid:"wiz-en-rte-ie",name:"RTÉ Radio 1 Ireland",url:"https://icecast.rte.ie/radio1",url_resolved:"https://icecast.rte.ie/radio1",homepage:"https://rte.ie/radio1",favicon:"https://www.rte.ie/favicon.ico",tags:"news,ireland,dublin,talk",country:"Ireland",countrycode:"IE",state:"Dublin",language:"english",votes:9800,clickcount:17600,codec:"MP3",bitrate:128,matchScore:96,accentCode:"IE",highlightTag:"Dublin Irish Accent",shadowingTip:"Ireland's national broadcaster with melodic Irish cadences, political debate, and cultural richness."},{changeid:"mat-en-news-uk-2",stationuuid:"wiz-en-lbc",name:"LBC News London 1152",url:"https://media-ssl.musicradio.com/LBCNewsLondon",url_resolved:"https://media-ssl.musicradio.com/LBCNewsLondon",homepage:"https://lbc.co.uk",favicon:"https://www.lbc.co.uk/favicon.ico",tags:"news,breaking,uk,politics",country:"United Kingdom",countrycode:"GB",state:"London",language:"english",votes:11400,clickcount:19800,codec:"MP3",bitrate:128,matchScore:95,accentCode:"GB",highlightTag:"Fast Breaking News",shadowingTip:"Rolling live 20-minute news cycles. Great for testing rapid comprehension and headline syntax."},{changeid:"mat-en-news-us-2",stationuuid:"wiz-en-bloomberg",name:"Bloomberg Radio (Global Finance)",url:"https://stream.revma.ihrhls.com/zc7479",url_resolved:"https://stream.revma.ihrhls.com/zc7479",homepage:"https://bloomberg.com/audio",favicon:"https://bloomberg.com/favicon.ico",tags:"finance,business,news,economy",country:"United States",countrycode:"US",state:"New York, NY",language:"english",votes:13500,clickcount:24e3,codec:"MP3",bitrate:128,matchScore:96,accentCode:"US",highlightTag:"Wall Street Business News",shadowingTip:"High-density market terminology, economic metrics, and rapid corporate interviews."},{changeid:"mat-en-talk-us-1",stationuuid:"wiz-en-kexp",name:"KEXP Seattle Talk & Eclectic",url:"https://kexp-mp3-128.stream.publicradio.org/kexp-mp3-128",url_resolved:"https://kexp-mp3-128.stream.publicradio.org/kexp-mp3-128",homepage:"https://kexp.org",favicon:"https://www.kexp.org/static/images/favicon.ico",tags:"talk,culture,interviews,indie",country:"United States",countrycode:"US",state:"Seattle, WA",language:"english",votes:12400,clickcount:22e3,codec:"MP3",bitrate:128,matchScore:98,accentCode:"US",highlightTag:"Pacific Northwest Accent",shadowingTip:"Organic artist interviews, natural pauses, everyday humor, and contemporary idioms."},{changeid:"mat-en-talk-uk-1",stationuuid:"wiz-en-bbc4",name:"BBC Radio 4 (In-Depth Discussions)",url:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",url_resolved:"http://stream.live.vc.bbcmedia.co.uk/bbc_world_service",homepage:"https://bbc.co.uk/radio4",favicon:"https://www.bbc.co.uk/favicon.ico",tags:"talk,drama,comedy,science,debates",country:"United Kingdom",countrycode:"GB",state:"London",language:"english",votes:13900,clickcount:24500,codec:"MP3",bitrate:128,matchScore:97,accentCode:"GB",highlightTag:"Intellectual Debates",shadowingTip:"Rich round-table arguments, nuanced counterpoints, and sophisticated rhetorical devices."},{changeid:"mat-en-talk-ie-1",stationuuid:"wiz-en-newstalk",name:"Newstalk 106-108 Dublin",url:"https://stream.audioxi.com/NT",url_resolved:"https://stream.audioxi.com/NT",homepage:"https://newstalk.com",favicon:"https://www.newstalk.com/favicon.ico",tags:"talk,ireland,opinions,interviews",country:"Ireland",countrycode:"IE",state:"Dublin",language:"english",votes:9100,clickcount:16400,codec:"MP3",bitrate:128,matchScore:95,accentCode:"IE",highlightTag:"Lively Irish Talk",shadowingTip:"Engaging discussions, Dublin caller humor, and fast conversational back-and-forths."},{changeid:"mat-en-talk-au-1",stationuuid:"wiz-en-abc-rn",name:"ABC Radio National Australia",url:"https://live-radio01.mediahubaustralia.com/RNW/mp3/",url_resolved:"https://live-radio01.mediahubaustralia.com/RNW/mp3/",homepage:"https://abc.net.au/radionational",favicon:"https://www.abc.net.au/favicon.ico",tags:"talk,culture,science,australia",country:"Australia",countrycode:"AU",state:"Sydney",language:"english",votes:10400,clickcount:18900,codec:"MP3",bitrate:128,matchScore:96,accentCode:"AU",highlightTag:"Australian Ideas & Culture",shadowingTip:"Deep documentary storytelling and thought-provoking interviews with clear Australian enunciation."},{changeid:"mat-en-sports-uk-1",stationuuid:"wiz-en-talksport",name:"talkSPORT UK Live Commentary",url:"https://radio.talksport.com/stream",url_resolved:"https://radio.talksport.com/stream",homepage:"https://talksport.com",favicon:"https://talksport.com/favicon.ico",tags:"sports,premier league,commentary,football",country:"United Kingdom",countrycode:"GB",state:"London",language:"english",votes:14200,clickcount:29e3,codec:"MP3",bitrate:128,matchScore:99,accentCode:"GB",highlightTag:"High Adrenaline Pacing",shadowingTip:"Premier League action, spontaneous high-intensity vocal bursts, and dynamic stadium reactions."}
4821,{changeid:"mat-en-sports-us-1",stationuuid:"wiz-en-espn",name:"ESPN Radio USA Sports Talk",url:"https://radio.talksport.com/stream",url_resolved:"https://radio.talksport.com/stream",homepage:"https://espn.com/radio",favicon:"https://a.espncdn.com/favicon.ico",tags:"sports,nba,nfl,american football",country:"United States",countrycode:"US",state:"Bristol, CT",language:"english",votes:11200,clickcount:21e3,codec:"MP3",bitrate:128,matchScore:95,accentCode:"US",highlightTag:"American Sports Jargon",shadowingTip:"Energetic debate on NBA & NFL statistics with punchy analytical jargon."},{changeid:"mat-en-pop-uk-1",stationuuid:"wiz-en-capital",name:"Capital FM London (Top 40 & DJ Banter)",url:"https://media-ssl.musicradio.com/CapitalUK",url_resolved:"https://media-ssl.musicradio.com/CapitalUK",homepage:"https://capitalfm.com",favicon:"https://capitalfm.com/favicon.ico",tags:"pop,hits,uk,dj,talk",country:"United Kingdom",countrycode:"GB",state:"London",language:"english",votes:9800,clickcount:18500,codec:"MP3",bitrate:128,matchScore:98,accentCode:"GB",highlightTag:"Youthful & Energetic UK",shadowingTip:"Upbeat DJ call-ins, catchy music segments, and modern British pop culture slang."},{changeid:"mat-en-pop-au-1",stationuuid:"wiz-en-triplej",name:"Triple J Australia (Alt & Pop)",url:"https://live-radio01.mediahubaustralia.com/2JJJW/mp3/",url_resolved:"https://live-radio01.mediahubaustralia.com/2JJJW/mp3/",homepage:"https://abc.net.au/triplej",favicon:"https://www.abc.net.au/favicon.ico",tags:"pop,indie,australia,youth",country:"Australia",countrycode:"AU",state:"Sydney",language:"english",votes:12800,clickcount:23500,codec:"MP3",bitrate:128,matchScore:97,accentCode:"AU",highlightTag:"Aussie Youth Culture",shadowingTip:"Fast, humorous Australian presenter talk, colloquial banter, and cutting-edge music."},{changeid:"mat-en-chill-us-1",stationuuid:"wiz-en-soma",name:"SomaFM - Groove Salad (Calm Vocals)",url:"https://ice1.somafm.com/groovesalad-128-mp3",url_resolved:"https://ice1.somafm.com/groovesalad-128-mp3",homepage:"https://somafm.com",favicon:"https://somafm.com/img3/groovesalad120.png",tags:"chillout,ambient,downtempo,calm",country:"United States",countrycode:"US",state:"San Francisco, CA",language:"english",votes:15400,clickcount:26e3,codec:"MP3",bitrate:128,matchScore:99,accentCode:"US",highlightTag:"Zero Stress Cadence",shadowingTip:"Gentle downtempo atmosphere with slow, relaxing vocal introductions and ambient spacing."},{changeid:"mat-en-chill-us-2",stationuuid:"wiz-en-kcrw",name:"KCRW Eclectic 24 Los Angeles",url:"https://kcrw.streamguys1.com/kcrw_192k_mp3_e24_internet_radio",url_resolved:"https://kcrw.streamguys1.com/kcrw_192k_mp3_e24_internet_radio",homepage:"https://kcrw.com",favicon:"https://www.kcrw.com/favicon.ico",tags:"eclectic,indie,california,chill",country:"United States",countrycode:"US",state:"Santa Monica, CA",language:"english",votes:11600,clickcount:20100,codec:"MP3",bitrate:192,matchScore:95,accentCode:"US",highlightTag:"Sunny West Coast Vibe",shadowingTip:"Relaxed California diction with soulful track intros and poetic cultural commentary."},{changeid:"mat-es-news-1",stationuuid:"wiz-es-rne",name:"Radio Nacional de España (RNE)",url:"https://s1.viastreaming.net:7050/stream",url_resolved:"https://s1.viastreaming.net:7050/stream",homepage:"https://rtve.es/radio",favicon:"https://www.rtve.es/favicon.ico",tags:"noticias,actualidad,cultura,spain",country:"Spain",countrycode:"ES",state:"Madrid",language:"spanish",votes:8900,clickcount:14e3,codec:"MP3",bitrate:128,matchScore:99,accentCode:"ES",highlightTag:"Castilian Spanish (DELE B2/C1)",shadowingTip:"Exemplary Madrid pronunciation with comprehensive international coverage."},{changeid:"mat-es-talk-1",stationuuid:"wiz-es-ser",name:"Cadena SER Madrid (Debate & Tertulia)",url:"https://s1.viastreaming.net:7050/stream",url_resolved:"https://s1.viastreaming.net:7050/stream",homepage:"https://cadenaser.com",favicon:"https://cadenaser.com/favicon.ico",tags:"debate,tertulia,entrevistas,cultura",country:"Spain",countrycode:"ES",state:"Madrid",language:"spanish",votes:9400,clickcount:17500,
4821codec:"MP3",bitrate:128,matchScore:98,accentCode:"ES",highlightTag:"Tertulia & Cultural Debate",shadowingTip:"Natural Spanish conversational speed, conversational overlaps, and colloquial turns of phrase."},{changeid:"mat-es-sports-1",stationuuid:"wiz-es-marca",name:"Radio MARCA Directo (Fútbol & LaLiga)",url:"https://stream.radiomarca.com/radiomarca.mp3",url_resolved:"https://stream.radiomarca.com/radiomarca.mp3",homepage:"https://marca.com/radio",favicon:"https://e00-marca.uecdn.es/favicon.ico",tags:"futbol,deportes,laliga,champions",country:"Spain",countrycode:"ES",state:"Madrid",language:"spanish",votes:11e3,clickcount:21e3,codec:"MP3",bitrate:128,matchScore:99,accentCode:"ES",highlightTag:"Passionate Spanish Commentary",shadowingTip:"Intense goal-by-goal live football casting. Great challenge for rapid articulation."},{changeid:"mat-es-pop-1",stationuuid:"wiz-es-los40",name:"LOS40 España (Pop & Éxitos)",url:"https://playerservices.streamtheworld.com/api/livestream-redirect/LOS40_SC",url_resolved:"https://playerservices.streamtheworld.com/api/livestream-redirect/LOS40_SC",homepage:"https://los40.com",favicon:"https://los40.com/favicon.ico",tags:"pop,exitos,dj,musica",country:"Spain",countrycode:"ES",state:"Madrid",language:"spanish",votes:12300,clickcount:25e3,codec:"MP3",bitrate:128,matchScore:98,accentCode:"ES",highlightTag:"Top Latin & Spanish Hits",shadowingTip:"High-energy radio hosts with the freshest Latin pop hits and youth culture dialogue."},{changeid:"mat-es-chill-1",stationuuid:"wiz-es-ibiza",name:"Ibiza Global Radio (Chill House)",url:"https://live.ibizaglobalradio.com/static/hifi.mp3",url_resolved:"https://live.ibizaglobalradio.com/static/hifi.mp3",homepage:"https://ibizaglobalradio.com",favicon:"https://ibizaglobalradio.com/favicon.ico",tags:"chill,deep house,balearic,electronic",country:"Spain",countrycode:"ES",state:"Ibiza",language:"spanish",votes:8200,clickcount:15300,codec:"MP3",bitrate:128,matchScore:97,accentCode:"ES",highlightTag:"Balearic Sunset Beats",shadowingTip:"Laidback Mediterranean pacing with calm DJ segments."},{changeid:"mat-fr-news-1",stationuuid:"wiz-fr-franceinfo",name:"France Info 24/7 (Actualité)",url:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",url_resolved:"https://icecast.radiofrance.fr/franceinfo-midfi.mp3",homepage:"https://francetvinfo.fr",favicon:"https://www.radiofrance.fr/fav
4821icon.ico",tags:"info,news,actualite,france",country:"France",countrycode:"FR",state:"Paris",language:"french",votes:14500,clickcount:28e3,codec:"MP3",bitrate:128,matchScore:99,accentCode:"FR",highlightTag:"Standard Parisian French",shadowingTip:"Precision liaison enunciation, formal journalistic vocabulary, ideal for DELF/DALF."},{changeid:"mat-fr-talk-1",stationuuid:"wiz-fr-franceinter",name:"France Inter (Culture & Débats)",url:"https://icecast.radiofrance.fr/franceinter-midfi.mp3",url_resolved:"https://icecast.radiofrance.fr/franceinter-midfi.mp3",homepage:"https://franceinter.fr",favicon:"https://www.radiofrance.fr/favicon.ico",tags:"culture,debats,humour,interviews",country:"France",countrycode:"FR",state:"Paris",language:"french",votes:11200,clickcount:19e3,codec:"MP3",bitrate:128,matchScore:98,accentCode:"FR",highlightTag:"Witty Cultural Banter",shadowingTip:"Rich philosophical and political talk shows featuring spontaneous French humor."},{changeid:"mat-fr-chill-1",stationuuid:"wiz-fr-fip",name:"FIP Paris (Eclectic & Jazz Lounge)",url:"https://stream.radiofrance.fr/fip/fip_hifi.mp3",url_resolved:"https://stream.radiofrance.fr/fip/fip_hifi.mp3",homepage:"https://fip.fr",favicon:"https://www.radiofrance.fr/fav
4821icon.ico",tags:"eclectic,jazz,chanson,soothing",country:"France",countrycode:"FR",state:"Paris",language:"french",votes:13200,clickcount:24e3,codec:"MP3",bitrate:192,matchScore:99,accentCode:"FR",highlightTag:"Soothing Velvet Voices",shadowingTip:"Legendary velvet-voiced FIP presenters with smooth phrasing and poetic ambiance."},{changeid:"mat-de-news-1",stationuuid:"wiz-de-dlf",name:"Deutschlandfunk Kultur",url:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",url_resolved:"https://st01.dlf.de/dlf/01/128/mp3/stream.mp3",homepage:"https://deutschlandfunk.de",favicon:"https://www.deutschlandradio.de/favicon.ico",tags:"nachrichten,politik,wirtschaft,kultur",country:"Germany",countrycode:"DE",state:"Cologne",language:"german",votes:11800,clickcount:21500,codec:"MP3",bitrate:128,matchScore:99,accentCode:"DE",highlightTag:"Hochdeutsch Standard (Goethe C1)",shadowingTip:"Pristine standard German enunciation with deep political, economic, and philosophical reporting."},{changeid:"mat-de-talk-1",stationuuid:"wiz-de-radioeins",name:"radioeins rbb Berlin",url:"https://rbb-radioeins-live.cast.addradio.de/rbb/radioeins/live/mp3/128/mid",url_resolved:"https://rbb-radioeins-live.cast.addradio.de/rbb/radioeins/live/mp3/128/mid",homepage:"https://radioeins.de",favicon:"https://www.radioeins.de/favicon.ico",tags:"talk,berlin,reportagen,kultur",country:"Germany",countrycode:"DE",state:"Berlin",language:"german",votes:8700,clickcount:14300,codec:"MP3",bitrate:128,matchScore:97,accentCode:"DE",highlightTag:"Berlin Culture & Talk",shadowingTip:"Engaging interviews, thoughtful cultural commentary, and modern Berlin lifestyle talk."},{changeid:"mat-ja-news-1",stationuuid:"wiz-ja-nhk",name:"NHK World Radio Japan",url:"https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8",url_resolved:"https://nhkworld.webcdn.stream.ne.jp/www11/nhkworld-tv/global/2003458/live.m3u8",homepage:"https://www3.nhk.or.jp/nhkworld",favicon:"https://www.nhk.or.jp/favicon.ico",tags:"news,japan,tokyo,nihongo,information",country:"Japan",countrycode:"JP",state:"Tokyo",language:"japanese",votes:15100,clickcount:28900,codec:"AAC",bitrate:128,matchScore:99,accentCode:"ALL",highlightTag:"NHK Standard Hyojungo (JLPT N1/N2)",shadowingTip:"Flawless standard Tokyo pronunciation with accurate pitch accents and formal Keigo patterns."},{changeid:"mat-ja-talk-1",stationuuid:"wiz-ja-shonan-beach",name:"Shonan Beach FM 78.9 (Kanagawa Talk)",url:"https://musicbird-hls.sslcdn.jp/hls/beachfm_128k/index.m3u8",url_resolved:"https://musicbird-hls.sslcdn.jp/hls/beachfm_128k/index.m3u8",homepage:"https://www.beachfm.co.jp",favicon:"https://www.beachfm.co.jp/favicon.ico",tags:"talk,interview,culture,kanagawa,japan",country:"Japan",countrycode:"JP",state:"Kanagawa",language:"japanese",votes:9400,clickcount:18200,codec:"AAC",bitrate:128,matchScore:98,accentCode:"ALL",highlightTag:"Casual Conversational Japanese",shadowingTip:"Engaging coastal lifestyle interviews and natural conversational tempo for everyday vocabulary."},{changeid:"mat-ja-pop-1",stationuuid:"wiz-ja-jpop-powerplay",name:"J-Pop Sakura 懐かしい (Tokyo Pop & Banter)",url:"https://server.jpop.stream/sakura.mp3",url_resolved:"https://server.jpop.stream/sakura.mp3",homepage:"https://jpop.stream",favicon:"https://jpop.stream/favicon.ico",tags:"pop,hits,jpop,anime,tokyo",country:"Japan",countrycode:"JP",state:"Tokyo",language:"japanese",votes:12500,clickcount:24300,codec:"MP3",bitrate:128,matchScore:97,accentCode:"ALL",highlightTag:"J-Pop & Anime Culture",shadowingTip:"High-energy lyrics and youthful Tokyo DJ banter ideal for rhythm and modern slang."},{changeid:"mat-ja-chill-1",stationuuid:"wiz-ja-jazz-sakura",name:"Tokyo Jazz & Lounge FM",url:"https://stream.zeno.fm/f3wvbbqmdg8uv",url_resolved:"https://stream.zeno.fm/f3wvbbqmdg8uv",homepage:"https://zeno.fm",favicon:"https://zeno.fm/favicon.ico",tags:"chill,lounge,jazz,ambient,tokyo",country:"Japan",countrycode:"JP",state:"Tokyo",language:"japanese",votes:8300,clickcount:14700,codec:"MP3",bitrate:128,matchScore:96,accentCode:"ALL",highlightTag:"Relaxed Tokyo Intonation",shadowingTip:"Gentle narration with soothing background melodies for stress-free pitch training."},{changeid:"mat-it-news-1",stationuuid:"wiz-it-rai1",name:"Rai Radio 1 (Giornale Radio)",url:"https://icestreaming.rai.it/1.mp3",url_resolved:"https://icestreaming.rai.it/1.mp3",homepage:"https://raiplaysound.it/radiorai1",favicon:"https://www.rai.it/favicon.ico",tags:"news,notizie,politica,italia,cultura",country:"Italy",countrycode:"IT",state:"Rome",language:"italian",votes:9800,clickcount:16700,codec:"MP3",bitrate:128,matchScore:99,accentCode:"ALL",highlightTag:"Standard Italian (CILS B2/C1)",shadowingTip:"Melodic Italian prosody, precise vowel endings, and comprehensive Italian news."},{changeid:"mat-it-talk-1",stationuuid:"wiz-it-radio24",name:"Radio 24 Il Sole (Milano Economy & Talk)",url:"https://stream.radio24.it/radio24.mp3",url_resolved:"https://stream.radio24.it/radio24.mp3",homepage:"https://radio24.ilsole24ore.com",favicon:"https://radio24.ilsole24ore.com/favicon.ico",tags:"talk,news,economy,culture,debates",country:"Italy",countrycode:"IT",state:"Milan",language:"italian",votes:8600,clickcount:15100,codec:"MP3",bitrate:128,matchScore:98,accentCode:"ALL",highlightTag:"Business & Analytical Italian",
4821shadowingTip:"Fast-paced financial and cultural discussions with crisp northern Italian enunciation."},{changeid:"mat-pt-news-1",stationuuid:"wiz-pt-bandnews",name:"BandNews FM São Paulo 96.9",url:"https://playerservices.streamtheworld.com/api/livestream-redirect/BANDNEWSFM_SP.mp3",url_resolved:"https://playerservices.streamtheworld.com/api/livestream-redirect/BANDNEWSFM_SP.mp3",homepage:"https://bandnewsfm.band.uol.com.br",favicon:"https://bandnewsfm.band.uol.com.br/favicon.ico",tags:"news,noticias,brasil,jornalismo",country:"Brazil",countrycode:"BR",state:"São Paulo",language:"portuguese",votes:8900,clickcount:15400,codec:"MP3",bitrate:128,matchScore:99,accentCode:"BR",highlightTag:"Brazilian Portuguese Standard",shadowingTip:"Fast 20-minute breaking news rounds with clear São Paulo accent."},{changeid:"mat-pt-lisbon-1",stationuuid:"wiz-pt-antena1",name:"RTP Antena 1 Lisboa",url:"https://stream-hls.rtp.pt/radios/antena1/chunklist.m3u8",url_resolved:"https://stream-hls.rtp.pt/radios/antena1/chunklist.m3u8",homepage:"https://rtp.pt/antena1",favicon:"https://www.rtp.pt/favicon.ico",tags:"news,talk,cultura,portugal,lisboa",country:"Portugal",countrycode:"PT",state:"Lisbon",language:"portuguese",votes:7900,clickcount:13800,codec:"AAC",bitrate:128,matchScore:98,accentCode:"PT",highlightTag:"European Portuguese (Lisbon)",shadowingTip:"Stress-timed rhythm with classical European Portuguese vowel reduction."},{changeid:"mat-zh-news-1",stationuuid:"wiz-zh-cnr",name:"CNR Voice of China (中国之声)",url:"https://ngcdn001.cnr.cn/live/zgzs/index.m3u8",url_resolved:"https://ngcdn001.cnr.cn/live/zgzs/index.m3u8",homepage:"https://cnr.cn",favicon:"https://www.cnr.cn/favicon.ico",tags:"news,chinese,mandarin,beijing,information",country:"China",countrycode:"CN",state:"Beijing",language:"chinese",votes:16500,clickcount:31e3,codec:"AAC",bitrate:128,matchScore:99,accentCode:"ALL",highlightTag:"Standard Mandarin (PSC Level 1)",shadowingTip:"Authoritative Putonghua enunciation with crystal clear four tones and standard Beijing phonetics."},{changeid:"mat-zh-talk-1",stationuuid:"wiz-zh-economic",name:"CNR Economic Voice (经济之声)",url:"https://ngcdn001.cnr.cn/live/jjzs/index.m3u8",url_resolved:"https://ngcdn001.cnr.cn/live/jjzs/index.m3u8",homepage:"https://cnr.cn",favicon:"https://www.cnr.cn/favicon.ico",tags:"talk,economy,culture,interview,chinese",country:"China",countrycode:"CN",state:"Beijing",language:"chinese",votes:11200,clickcount:19800,codec:"AAC",bitrate:128,matchScore:98,accentCode:"ALL",highlightTag:"Business & Economic Mandarin",shadowingTip:"Analytical discussions on technology, market trends, and modern corporate discourse."}];function B6e({isOpen:n,onClose:e,onSelectStation:t}){const{t:r,isZh:s}=Or(),a=S.useMemo(()=>b6e(s),[s]),o=S.useMemo(()=>y6e(s),[s]),[l,c]=S.useState(1),[d,h]=S.useState(null),[m,p]=S.useState(null),[x,y]=S.useState(null),v=S.useMemo(()=>d?a.find(K=>K.code===d.code)||d:null,[a,d]),B=S.useMemo(()=>m?(v==null?void 0:v.dialects.find(K=>K.code===m.code))||m:null,[v,m]),E=S.useMemo(()=>x?o.find(K=>K.id===x.id)||x:null,[o,x]),[N,T]=S.useState([]),[k,P]=S.useState(null),[R,_]=S.useState(!1),[I,D]=S.useState(null),[j,O]=S.useState([]),[M,U]=S.useState(!1),[ee,ie]=S.useState(null),[G,Z]=S.useState(""),[z,se]=S.useState(!0);S.useEffect(()=>{n&&(c(1),h(null),p(null),y(null),T([]),P(null),_(!1),O([]),U(!1),ie(null),Z(""),D(null))},[n]),S.useEffect(()=>{const K=J=>{J.key==="Escape"&&n&&e()};return window.addEventListener("keydown",K),()=>window.removeEventListener("keydown",K)},[n,e]);const re=K=>{h(K),p(K.dialects[0]||null),c(2)},H=K=>{d&&(y(K),c(3))};S.useEffect(()=>{if(l!==3||!d||!x)return;const K=d.code.toLowerCase(),J=d.apiLang.toLowerCase(),oe=(m==null?void 0:m.code)||"ALL",Ie=v6e.filter(ye=>{const he=(ye.language||"").toLowerCase();return he===J||he.startsWith(K)||he.includes(J)});let pe=Ie.filter(ye=>{const he=(ye.tags||"").toLowerCase();return he.includes(x.id)||x.searchTags.some(le=>he.includes(le))});if(pe.length===0&&(pe=Ie.length>0?Ie:[]),oe!=="ALL"&&pe.length>0){const ye=pe.filter(he=>he.accentCode===oe||he.countrycode===oe);ye.length>0&&(pe=ye)}T(pe),Y(d,x,m)},[l,d,x,m]);const Y=async(K,J,oe)=>{_(!0),U(!0),ie(null);const Ie=oe!=null&&oe.code&&oe.code!=="ALL"?oe.code:"",pe=J.searchTags[0]||"news";try{const[ye,he]=await Promise.allSettled([fetch("/api/radio/recommend",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({language:K.apiLang,dialect:Ie,vibe:J.id})}),fetch(`/api/radio/stations/search?language=${encodeURIComponent(K.apiLang)}&tag=${encodeURIComponent(pe)}${Ie?`&countrycode=${encodeURIComponent(Ie)}`:""}&limit=35`)]);if(ye.status==="fulfilled"&&ye.value.ok){const le=await ye.value.json();le.recommendedStations&&Array.isArray(le.recommendedStations)&&le.recommendedStations.length>0&&T(ce=>{const Ce=new Set(ce.map(je=>je.stationuuid||je.name)),Ae=le.recommendedStations.filter(je=>!Ce.has(je.stationuuid||je.name));return[...ce,...Ae]}),le.aiAnalysis&&P(le.aiAnalysis)}if(he.status==="fulfilled"&&he.value.ok){const le=await he.value.json();if(Array.isArray(le)){const ce=le.filter(Ce=>(Ce.language||"").toLowerCase().includes(K.apiLang.toLowerCase())||(Ce.countrycode||"").toUpperCase()===(K.code||"").toUpperCase());O(ce.length>0?ce:le)}}else try{const le=`https://de1.api.radio-browser.info/json/stations/search?language=${encodeURIComponent(K.apiLang)}&tag=${encodeURIComponent(pe)}${Ie?`&countrycode=${encodeURIComponent(Ie)}`:""}&limit=30&hidebroken=true&order=clickcount&reverse=true`,ce=await fetch(le);if(ce.ok){const Ce=await ce.json();Array.isArray(Ce)&&O(Ce)}}catch{}}catch(ye){console.warn("[HelpMeChoose] Error in AI & global pool fetching:",(ye==null?void 0:ye.message)||ye),ie("Global radio registry temporarily busy. Curated flagship stations are ready below.")}finally{_(!1),U(!1)}},de=K=>{D(K.stationuuid||"selected"),setTimeout(()=>{t(K),e()},350)},W=S.useMemo(()=>
4821{if(!G.trim())return j;const K=G.toLowerCase();return j.filter(J=>(J.name||"").toLowerCase().includes(K)||(J.country||"").toLowerCase().includes(K)||(J.state||"").toLowerCase().includes(K)||(J.tags||"").toLowerCase().includes(K))},[j,G]);return i.jsx(Qo,{children:n&&i.jsxs("div",{className:"fixed inset-0 z-50 overflow-hidden flex justify-end",children:[i.jsx(cs.div,{initial:{opacity:0},animate:{opacity:1},exit:{opacity:0},transition:{duration:.2},onClick:e,className:"fixed inset-0 bg-slate-950/40 backdrop-blur-xs cursor-pointer"}),i.jsxs(cs.div,{initial:{x:"100%"},animate:{x:0},exit:{x:"100%"},transition:{type:"spring",damping:28,stiffness:300},className:"relative w-full max-w-xl bg-white dark:bg-slate-900 border-l border-slate-200 dark:border-slate-800 shadow-2xl h-full flex flex-col z-10 overflow-hidden",children:[i.jsxs("div",{className:"p-5 border-b border-slate-150 dark:border-slate-800 bg-gradient-to-r from-emerald-500/5 via-teal-500/5 to-transparent flex items-center justify-between shrink-0",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[l>1?i.jsx("button",{onClick:()=>c(K=>K===3?2:1),className:"p-1.5 -ml-1 rounded-lg text-slate-400 hover:text-slate-700 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",title:"Go back to previous step",children:i.jsx(Rm,{className:"w-4 h-4"})}):i.jsx("div",{className:"p-2 rounded-xl bg-gradient-to-br from-emerald-500 to-teal-600 text-white shadow-md shadow-emerald-500/20",children:i.jsx(At,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsxs("h3",{className:"font-display font-bold text-base text-slate-900 dark:text-slate-100 flex items-center gap-2",children:[i.jsx("span",{children:r.drawer.title}),i.jsx("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 font-semibold uppercase tracking-wider",children:r.drawer.liveWizard})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:l===1?r.drawer.step1Desc:l===2?r.drawer.step2Desc:r.drawer.step3Desc})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 bg-slate-100 dark:bg-slate-800 px-2 py-1 rounded-lg text-[11px] font-mono font-bold text-slate-600 dark:text-slate-300",children:[i.jsx("span",{className:l>=1?"text-emerald-600 dark:text-emerald-400":"",children:"1"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:l>=2?"text-emerald-600 dark:text-emerald-400":"",children:"2"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:l>=3?"text-emerald-600 dark:text-emerald-400":"",children:"3"})]}),i.jsx("button",{onClick:e,className:"p-1.5 rounded-lg text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",title:"Close drawer",children:i.jsx(Ts,{className:"w-5 h-5"})})]})]}),i.jsx("div",{className:"flex-1 overflow-y-auto p-5 custom-scrollbar space-y-5",children:l===1?i.jsxs("div",{className:"space-y-4 animate-in fade-in duration-200",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("label",{className:"text-xs font-bold text-slate-700 dark:text-slate-300 flex items-center gap-1.5",children:[i.jsx(bg,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:r.drawer.languageQuestion})]}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:r.drawer.languageSubtitle})]}),i.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:a.map(K=>i.jsxs("button",{onClick:()=>re(K),className:"w-full text-left p-3.5 rounded-2xl border border-slate-200/80 dark:border-slate-800 hover:border-emerald-500 dark:hover:border-emerald-500/80 bg-white dark:bg-slate-850 hover:bg-emerald-50/20 dark:hover:bg-emerald-950/20 transition-all flex items-center justify-between group shadow-2sm hover:shadow-md cursor-pointer active:scale-[0.99]",children:[i.jsxs("div",{className:"flex items-center gap-3.5",children:[i.jsx("span",{className:"text-2xl filter drop-shadow-sm shrink-0",children:K.flag}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-bold text-sm text-slate-800 dark:text-slate-100 group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:K.name}),i.jsxs("span",{className:"text-[11px] text-slate-400 dark:text-slate-500 font-mono",children:["(",K.nativeName,")"]})]}),i.jsx("p",{className:"text-[11px] text-slate-500 dark:text-slate-400 mt-0.5 line-clamp-1",children:K.desc})]})]}
4821),i.jsx(qn,{className:"w-4 h-4 text-slate-300 group-hover:text-emerald-500 group-hover:translate-x-0.5 transition-all shrink-0 ml-2"})]},K.code))})]}):l===2?i.jsxs("div",{className:"space-y-5 animate-in fade-in duration-200",children:[i.jsxs("div",{className:"p-3 bg-slate-50 dark:bg-slate-850 rounded-xl border border-slate-150 dark:border-slate-800 flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-lg",children:v==null?void 0:v.flag}),i.jsxs("span",{className:"text-xs font-bold text-slate-700 dark:text-slate-200",children:[r.drawer.languageLabel,": ",v==null?void 0:v.name]})]}),i.jsx("button",{onClick:()=>c(1),className:"text-[11px] text-emerald-600 dark:text-emerald-400 hover:underline font-medium cursor-pointer",children:r.drawer.change})]}),v&&v.dialects.length>1&&i.jsxs("div",{className:"space-y-2.5 p-3.5 rounded-2xl bg-emerald-500/5 dark:bg-emerald-500/10 border border-emerald-500/20",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(BI,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),i.jsx("span",{children:r.drawer.targetAccent})]}),B&&i.jsx("span",{className:"text-[10px] font-mono font-semibold text-emerald-700 dark:text-emerald-300",children:B.accentTitle})]}),i.jsx("div",{className:"flex flex-wrap gap-1.5",children:v.dialects.map(K=>{const J=((B==null?void 0:B.code)||"ALL")===K.code;return i.jsxs("button",{onClick:()=>p(K),className:`px-3 py-1.5 rounded-xl text-xs font-medium transition-all flex items-center gap-1.5 cursor-pointer shadow-2sm ${J?"bg-emerald-600 text-white font-bold shadow-emerald-600/20 scale-[1.02]":"bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 text-slate-700 dark:text-slate-300 hover:border-emerald-500/80 hover:text-emerald-600"}`,children:[i.jsx("span",{children:K.flag}),i.jsx("span",{children:K.shortName}),J&&i.jsx(Co,{className:"w-3 h-3 ml-0.5"})]},K.code)})}),(B==null?void 0:B.phoneticFeature)&&i.jsx("p",{className:"text-[11px] text-slate-500 dark:text-slate-400 font-sans italic pt-0.5",children:s?`💡 发音特征:${B.phoneticFeature}`:`💡 Phonetics: ${B.phoneticFeature}`})]}),i.jsxs("div",{className:"space-y-1.5",children:[i.jsxs("label",{className:"text-xs font-bold text-slate-700 dark:text-slate-300 flex items-center gap-1.5",children:[i.jsx(Fye,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:r.drawer.vibeQuestion})]}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:r.drawer.vibeSubtitle})]}),i.jsx("div",{className:"grid grid-cols-1 gap-2.5",children:o.map(K=>i.jsxs("button",{onClick:()=>H(K),className:`w-full text-left p-3.5 rounded-2xl border border-slate-200/80 dark:border-slate-800 bg-white dark:bg-slate-850 transition-all flex flex-col gap-2 group shadow-2sm hover:shadow-md cursor-pointer active:scale-[0.99] ${K.accentColor}`,children:[i.jsxs("div",{className:"flex items-start justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"p-2 rounded-xl bg-slate-100 dark:bg-slate-800 group-hover:scale-105 transition-transform shrink-0",children:K.icon}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-800 dark:text-slate-100 group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:K.title}),i.jsx("span",{className:"text-[10px] font-mono text-slate-400 dark:text-slate-500",children:K.pacing})]})]}),i.jsx("span",{className:"text-[10px] font-medium px-2 py-0.5 rounded-full bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 shrink-0",children:K.badge})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 leading-relaxed",children:K.subtitle})]},K.id))})]}):i.jsxs("div",{className:"space-y-5 animate-in fade-in duration-200",children:[i.jsxs("div",{className:"p-3.5 bg-emerald-500/5 dark:bg-emerald-500/10 rounded-2xl border border-emerald-500/20 space-y-2.5",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xl",children:(B==null?void 0:B.flag)||(v==null?void 0:v.flag)}),i.jsxs("div",{children:[i.jsxs("h4",{className:"text-xs font-bold text-slate-800 dark:text-slate-100",children:[v==null?void 0:v.name," (",(
4821B==null?void 0:B.shortName)||(s?"全球":"Global"),") • ",E==null?void 0:E.title]}),i.jsx("p",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-medium",children:s?`${N.length} 个精选旗舰电台 + ${j.length} 个全球在线电台`:`${N.length} Flagship Recommendations + ${j.length} Global Stations`})]})]}),i.jsx("button",{onClick:()=>c(2),className:"px-2.5 py-1 text-[11px] font-medium rounded-lg bg-white dark:bg-slate-800 border border-slate-200 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors cursor-pointer shrink-0",children:r.drawer.changeVibe})]}),(R||k)&&i.jsxs("div",{className:"p-2.5 rounded-xl bg-gradient-to-r from-emerald-500/10 via-teal-500/10 to-transparent border border-emerald-500/25 flex items-start gap-2 animate-in fade-in",children:[i.jsx(At,{className:`w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400 shrink-0 mt-0.5 ${R?"animate-spin":""}`}),i.jsxs("div",{className:"text-[11px] leading-relaxed",children:[i.jsxs("span",{className:"font-bold text-emerald-800 dark:text-emerald-300 mr-1",children:[r.drawer.aiMatchInsight,":"]}),i.jsx("span",{className:"text-slate-600 dark:text-slate-300",children:R?s?`正在分析针对 ${v==null?void 0:v.name} 的实时声学频段与语料...`:r.drawer.analyzingAcoustic.replace("{lang}",(v==null?void 0:v.name)||""):k})]})]}),v&&v.dialects.length>1&&i.jsxs("div",{className:"flex flex-wrap items-center gap-1.5 pt-1 border-t border-emerald-500/15",children:[i.jsxs("span",{className:"text-[10px] font-mono text-slate-500 dark:text-slate-400 mr-1",children:[r.drawer.filterAccent,":"]}),v.dialects.map(K=>{const J=((B==null?void 0:B.code)||"ALL")===K.code;return i.jsxs("button",{onClick:()=>p(K),className:`px-2 py-0.5 rounded-lg text-[10px] font-medium transition-colors cursor-pointer ${J?"bg-emerald-600 text-white font-bold":"bg-white/80 dark:bg-slate-800/80 border border-slate-200/80 dark:border-slate-700 text-slate-600 dark:text-slate-300 hover:border-emerald-500"}`,children:[i.jsx("span",{children:K.flag})," ",K.shortName]},K.code)})]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx(bg,{className:"w-4 h-4 text-emerald-500"}),i.jsxs("h4",{className:"text-xs font-bold text-slate-800 dark:text-slate-200",children:[r.drawer.globalRadioPool," (",v==null?void 0:v.name," • ",(B==null?void 0:B.shortName)||(s?"全部口音":"All Accents"),")"]})]}),i.jsxs("button",{onClick:()=>Y(d,x,m),disabled:M||R,className:"text-[11px] text-slate-500 hover:text-emerald-600 dark:hover:text-emerald-400 flex items-center gap-1 cursor-pointer",title:"Refresh global radio registry and AI match",children:[i.jsx(qa,{className:`w-3 h-3 ${M||R?"animate-spin text-emerald-500":""}`}),i.jsx("span",{children:r.drawer.refresh})]})]}),i.jsxs("div",{className:"relative",children:[i.jsx(Nye,{className:"w-3.5 h-3.5 absolute left-3 top-1/2 -translate-y-1/2 text-slate-400"}),i.jsx("input",{type:"text",placeholder:s?`在 ${j.length||""} 个 ${(v==null?void 0:v.name)||""} 电眼中搜索...`:`${r.drawer.searchPrompt} ${j.length||"more"} ${v==null?void 0:v.name} stations...`,value:G,onChange:K=>Z(K.target.value),className:"w-full pl-8.5 pr-3 py-2 rounded-xl text-xs bg-slate-50 dark:bg-slate-800/80 border border-slate-200 dark:border-slate-700 text-slate-800 dark:text-slate-100 placeholder-slate-400 focus:outline-hidden focus:border-emerald-500 focus:ring-1 focus:ring-emerald-500 transition-all"})]}),M?i.jsxs("div",{className:"p-8 text-center rounded-2xl border border-dashed border-slate-200 dark:border-slate-800 flex flex-col items-center justify-center gap-2",children:[i.jsx(qa,{className:"w-5 h-5 text-emerald-500 animate-spin"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:s?`正在连接全球广播频段 (${v==null?void 0:v.name} ${(B==null?void 0:B.shortName)||""})...`:`${r.drawer.connectingGlobal} (${v==null?void 0:v.name} ${(B==null?void 0:B.shortName)||""})...`})]}):ee?i.jsx("div",{className:"p-3 rounded-xl bg-amber-500/10 border border-amber-500/20 text-xs text-amber-700 dark:text-amber-300",children:ee}):W.length>0?i.jsx("div",{className:"space-y-2 max-h-[380px] overflow-y-auto custom-scrollbar pr-1",children:W.map(K=>{const J=I===K.stationuuid;return i.jsxs("div",{className:`p-3 rounded-xl border transition-all flex items-center justify-between gap-3 ${J?"border-emerald-500 bg-emerald-500/10":"border-slate-200/80 dark:border-slate-800 bg-white dark:bg-slate-850 hover:border-emerald-500/60 hover:bg-slate-50 dark:hover:bg-slate-800"}`,children:[i.jsxs("div",{className:"flex items-center gap-2.5 min-w-0",children:[i.jsx("div",{className:"w-8 h-8 rounded-lg bg-slate-100 dar
4821k:bg-slate-800 border border-slate-200 dark:border-slate-700 flex items-center justify-center text-slate-600 dark:text-slate-300 shrink-0",children:i.jsx(cn,{className:"w-4 h-4 text-emerald-500"})}),i.jsxs("div",{className:"min-w-0",children:[i.jsx("h5",{className:"font-bold text-xs text-slate-800 dark:text-slate-100 truncate",children:K.name}),i.jsxs("div",{className:"flex items-center gap-1.5 text-[10px] text-slate-400 font-mono",children:[i.jsx("span",{children:K.country||"Global"}),K.state&&i.jsxs("span",{children:["• ",K.state]}),K.bitrate?i.jsxs("span",{children:["• ",K.bitrate,"kbps"]}):null]})]})]}),i.jsxs("button",{onClick:()=>de(K),disabled:J,className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all flex items-center gap-1 shrink-0 cursor-pointer ${J?"bg-emerald-600 text-white animate-pulse":"bg-emerald-500/10 hover:bg-emerald-600 text-emerald-700 dark:text-emerald-300 hover:text-white"}`,children:[i.jsx("span",{children:r.drawer.shadowAction}),i.jsx(qn,{className:"w-3 h-3"})]})]},K.stationuuid)})}):i.jsx("div",{className:"p-4 text-center rounded-xl bg-slate-50 dark:bg-slate-850 border border-slate-200 dark:border-slate-800 text-xs text-slate-400",children:r.drawer.noAdditionalStations})]}),i.jsxs("div",{className:"space-y-2.5 pt-3 border-t border-slate-150 dark:border-slate-800",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("label",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 flex items-center gap-1.5",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:r.drawer.curatedFlagship})]}),i.jsx("span",{className:"text-[10px] font-mono text-slate-400",children:s?`${N.length} 个精选`:`${N.length} Handpicked`})]}),i.jsx("div",{className:"space-y-3",children:N.map((K,J)=>{const oe=I===(K.stationuuid||K.id);return i.jsxs("div",{className:`relative p-4 rounded-2xl border transition-all duration-200 flex flex-col gap-3 group ${oe?"border-emerald-500 bg-emerald-500/10 ring-2 ring-emerald-500/30 scale-[0.99]":"border-slate-200/90 dark:border-slate-800 bg-white dark:bg-slate-850 hover:border-emerald-500/80 hover:shadow-lg dark:hover:border-emerald-500/60"}`,children:[i.jsxs("div",{className:"flex items-start justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-slate-100 dark:bg-slate-800 border border-slate-200/60 dark:border-slate-700 flex items-center justify-center text-slate-700 dark:text-slate-300 group-hover:bg-emerald-500 group-hover:text-white transition-colors shrink-0 shadow-2sm",children:i.jsx(cn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100 group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:K.name}),i.jsxs("div",{className:"flex items-center gap-2 text-[11px] text-slate-400 dark:text-slate-500 mt-0.5",children:[i.jsx("span",{children:K.country||(s?"全球":"Global")}),i.jsx("span",{children:"•"}),i.jsxs("span",{className:"font-mono",children:[K.codec||"MP3"," ",K.bitrate?`${K.bitrate}kbps`:""]})]})]})]}),K.matchScore&&i.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono font-bold px-2 py-0.5 rounded-full bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 border border-emerald-500/20 shrink-0",children:[i.jsx(yn,{className:"w-3 h-3 text-emerald-600 dark:text-emerald-400"}),s?`${K.matchScore}% 契合`:`${K.matchScore}% Match`]})]}),(K.shadowingTip||K.shadowingTipZh)&&i.jsxs("div",{className:"p-2.5 rounded-xl bg-slate-50 dark:bg-slate-900/60 border border-slate-150 dark:border-slate-800/80 text-[11px] text-slate-600 dark:text-slate-300 space-y-1",children:[(K.highlightTag||K.highlightTagZh)&&i.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-emerald-700 dark:text-emerald-400 text-[10px] uppercase tracking-wider",children:[i.jsx(BI,{className:"w-3 h-3"}),i.jsx("span",{children:s&&K.highlightTagZh||K.highlightTag})]}),i.jsx("p",{className:"leading-relaxed",children:s&&K.shadowingTipZh||K.shadowingTip})]}),i.jsxs("div",{className:"pt-1 flex items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-[11px] text-slate-400 font-mono",children:[i.jsx(on,{className:"w-3.5 h-3.5 text-emerald-500 animate-pulse"}),i.jsx("span",{children:r.drawer.highClarityStream})]}),i.jsx("button",{onClick:()=>de(K),disabled:oe,className:`px-4 py-2 rounded-xl text-xs font-bold transition-all flex items-center gap-1.5 cursor-pointer shadow-sm ${oe?"bg-emerald-600 text-white animate-pulse":"bg-gradient-to-r from-emerald-500 to-teal-600 hover:from-emerald-600 hover:to-teal-700 text-white shadow-emerald-500/20 hover:shadow-md hover:scale-[1.02] active:scale-95"}`,children:oe?i.jsxs(i.Fragment,{children:[i.jsx(cn,{className:"w-3.5 h-3.5 animate-spin"}),i.jsx("span",{children:r.drawer.enteringTheater})]}):i.jsxs(i.Fragment,{children:[i.jsx(Er,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:r.drawer.shadowThisRadio}
4821),i.jsx(qn,{className:"w-3.5 h-3.5"})]})})]})]},K.stationuuid||J)})})]})]})}),i.jsxs("div",{className:"p-4 border-t border-slate-150 dark:border-slate-800 bg-slate-50/50 dark:bg-slate-900/50 flex items-center justify-between text-[11px] text-slate-400 dark:text-slate-500 shrink-0",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(xi,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:l===3?r.drawer.theaterTip:r.drawer.syncTip})]}),i.jsx("span",{className:"font-mono text-[10px]",children:l===3?"Step 3/3":l===2?"Step 2/3":"Step 1/3"})]})]})]})})}const o$={US:"America/New_York",USA:"America/New_York","United States":"America/New_York",GB:"Europe/London",UK:"Europe/London","United Kingdom":"Europe/London",FR:"Europe/Paris",France:"Europe/Paris",DE:"Europe/Berlin",Germany:"Europe/Berlin",JP:"Asia/Tokyo",Japan:"Asia/Tokyo",ES:"Europe/Madrid",Spain:"Europe/Madrid",AU:"Australia/Sydney",Australia:"Australia/Sydney",CA:"America/Toronto",Canada:"America/Toronto",BR:"America/Sao_Paulo",Brazil:"America/Sao_Paulo",CH:"Europe/Zurich",Switzerland:"Europe/Zurich"};function w6e({activeStation:n,isPlaying:e,onTogglePlay:t,onSelectStation:r,onCatchAndPractice:s,onSwitchToTheater:a,onSwitchToExplore:o,isZh:l}){const[c,d]=S.useState(null),[h,m]=S.useState(null),[p,x]=S.useState(!1),[y,v]=S.useState(""),[B,E]=S.useState(80),[N,T]=S.useState(!1),k=ci.findIndex(D=>D.name===(n==null?void 0:n.name)||D.id===(n==null?void 0:n.stationuuid)||D.id===(n==null?void 0:n.changeid));S.useEffect(()=>{if(h===null)return;if(h<=0){e&&t(),d(null),m(null),x(!0);const j=setTimeout(()=>x(!1),4e3);return()=>clearTimeout(j)}const D=setInterval(()=>{m(j=>j!==null&&j>0?j-1:0)},1e3);return()=>clearInterval(D)},[h,e,t]);const P=D=>{D===null?(d(null),m(null)):(d(D),m(D*60))};S.useEffect(()=>{const D=()=>{try{const O=(n==null?void 0:n.country)||"US",M=o$[O]||o$[(n==null?void 0:n.countrycode)||""]||"UTC",U=new Intl.DateTimeFormat("en-US",{timeZone:M,hour:"2-digit",minute:"2-digit",second:"2-digit",hour12:!0});v(U.format(new Date))}catch{v(new Date().toLocaleTimeString())}};D();const j=setInterval(D,1e3);return()=>clearInterval(j)},[n]);const R=D=>{const j=Math.floor(D/60),O=D%60;return`${j.toString().padStart(2,"0")}:${O.toString().padStart(2,"0")}`},_=()=>{const D=(k-1+ci.length)%ci.length,j=ci[D];r({changeid:j.id,stationuuid:j.id,name:j.name,url:j.streamUrl,url_resolved:j.streamUrl,homepage:"",favicon:"",tags:j.category,country:j.country||"Global",countrycode:j.country||"US",state:"",language:j.language,votes:1200,clickcount:500,codec:"MP3",bitrate:128})},I=()=>{const D=(k+1)%ci.length,j=ci[D];r({changeid:j.id,stationuuid:j.id,name:j.name,url:j.streamUrl,url_resolved:j.streamUrl,homepage:"",favicon:"",tags:j.category,country:j.country||"Global",countrycode:j.country||"US",state:"",language:j.language,votes:1200,clickcount:500,codec:"MP3",bitrate:128})};return i.jsxs("div",{className:"relative w-full max-w-5xl mx-auto flex flex-col gap-6 p-4 sm:p-6 md:p-8 bg-slate-950 text-slate-100 rounded-3xl shadow-2xl border border-slate-800/80 overflow-hidden animate-in fade-in duration-300",children:[i.jsx("div",{className:"absolute -top-32 -left-32 w-96 h-96 bg-emerald-500/15 rounded-full blur-3xl pointer-events-none"}),i.jsx("div",{className:"absolute -bottom-32 -right-32 w-96 h-96 bg-indigo-500/15 rounded-full blur-3xl pointer-events-none"}),i.jsxs("div",{className:"relative z-10 flex flex-wrap items-center justify-between gap-3 border-b border-slate-800/80 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-500/20 border border-emerald-500/40 flex items-center justify-center text-emerald-400 shadow-md shadow-emerald-500/10",children:i.jsx(Er,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"text-lg font-bold text-white flex items-center gap-2",children:[i.jsx("span",{children:l?"沉浸泛听模式 (Immersion)":"Immersion Mode"}),i.jsxs("span",{className:"text-[10px] font-extrabold font-mono bg-emerald-500/20 text-emerald-400 border border-emerald-500/40 px-2 py-0.5 rounded-full flex items-center gap-1",children:[i.jsx(xi,{className:"w-3 h-3 text-emerald-400 fill-emerald-400 animate-pulse"}),i.jsx("span",{children:"0 Token API"})]})]}),i.jsx("p",{className:"text-xs text-slate-400",children:l?"纯音频流挂机倾听,零 Token 消耗 · 睡眠倒计时 · 按需唤醒 AI":"Pure audio stream listening. Zero AI Token cost until on-demand catch."})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:a,className:"px-3 py-1.5 rounded-xl bg-slate-900 hover:bg-slate-800 text-slate-300 hover:text-white border border-slate-800 text-xs font-semibold flex items-center gap-1.5 transition-all cursor-pointer",title:l?"切换至精听跟读模式":"Switch to Theater Mode",children:[i.jsx(BC,{className:"w-3.5 h-3.5 text-emerald-400"}),i.jsx("span",{children:l?"精听跟读":"Theater Mode"})]}),i.jsxs("button",{onClick:o,className:"px-3 py-1.5 rounded-xl bg-slate-900 hover:bg-slate-800 text-slate-300 hover:text-white border border-slate-800 text-xs font-semibold flex items-center gap-1.5 transition-all cursor-pointer",title:l?"返回地图探索":"Back to World Map",children:[i.jsx(z2,{className:"w-3.5 h-3.5 text-slate-400"}),i.jsx("span",{children:l?"地图探索":"World Map"})]})]})]}),i.jsxs("div",{className:"relative z-10 grid grid-cols-1 md:grid-cols-12 gap-8 items-center",children:[i.jsxs("div",{className:"md:col-span-5 flex flex-col items-center justify-center relative py-4",children:[i.jsxs("div",{className:"relative w-64 h-64 sm:w-72 sm:h-72 flex items-center justify-center",children:[i.jsxs("div",{className:`w-full h-full rounded-full bg-slate-900 border-4 border-slate-800 shadow-2xl flex items-center justify-center relative transition-transform duration-700 ${e?"animate-spin-slow":""}`,style:{backgroundImage:"radial-gradient(circle, #020617 0%, #0f172a 40%, #020617 60%, #1e293b 80%, #020617 100%)",boxShadow:`0 0 50px rgba(16, 185, 129, ${e?.25:.05})`},children:[i.jsx("div",{className:"absolute inset-4 rounded-full border border-slate-800/60 opacity-60 pointer-events-none"}),i.jsx("div",{className:"absolute inset-8 rounded-full border border-slate-800/80 opacity-60 pointer-events-none"}),i.jsx("div",{className:"absolute inset-12 rounded-full border border-slate-800/60 opacity-60 pointer-events-none"}),i.jsx("div",{className:"absolute inset-16 rounded-full border border-slate-800/80 opacity-60 pointer-events-none"}),i.jsxs("div",{className:"w-24 h-24 rounded-full bg-gradient-to-br from-emerald-500 to-indigo-600 p-1 flex items-center justify-center shadow-lg relative z-10",children:[i.jsxs("div",{className:"w-full h-full rounded-full bg-slate-950 flex flex-col items-center justify-center p-2 text-center overflow-hidden border border-emerald-400/30",children:[i.jsx(cn,{className:"w-5 h-5 text-emerald-400 mb-0.5"}),i.jsx("span",{className:"text-[9px] font-bold text-slate-200 truncate w-full px-1",children:(n==null?void 0:n.name)||"Live Radio"}),i.jsx("span",{className:"text-[7px] text-emerald-400 uppercase font-mono tracking-widest",children:(n==null?void 0:n.language)||"EN"})]}),i.jsx("div",{className:"absolute w-3 h-3 rounded-full bg-slate-950 border border-slate-700 shadow-inner"})]})]}),i.jsxs("div",{className:`absolute -top-4 right-10 w-24 h-32 pointer-events-none transition-transform duration-500 origin-top-right ${e?"rotate-6":"-rotate-12"}`,children:[i.jsx("div",{className:"w-3 h-3 rounded-full bg-slate-400 border border-slate-200 shadow-md ml-auto"}),i.jsx("div",{className:"w-1 h-24 bg-gradient-to-b from-slate-400 to-slate-600 ml-auto mr-1 rounded-full shadow-md"}),i.jsx("div",{className:"w-3 h-4 bg-emerald-500 rounded-xs ml-auto mr-0.5 shadow-md shadow-emerald-500/50"})]})]}),i.jsx("div",{className:"flex items-center justify-center gap-1.5 mt-6 h-8",children:[40,65,30,85,95,45,75,55,90,35,70,80,50,60,90,40].map((D,j)=>i.jsx("div",{className:"w-1 rounded-full bg-emerald-500 transition-all duration-300",style:{height:e?`${Math.max(12,Math.sin(j+Date.now()/200)*D)}%`:"8px",opacity:e?.9:.3}},j))})]}),i.jsxs("div",{className:"md:col-span-7 flex flex-col gap-5",children:[i.jsxs("div",{className:"bg-slate-900/90 rounded-2xl p-5 border border-slate-800 shadow-lg flex flex-col gap-3",children:[i.jsx("div",{className:"flex items-start justify-between gap-3",children:i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1",children:[i.jsxs("span",{className:"text-xs px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 font-mono font-semibold flex items-center gap-1",children:[i.jsx(BI,{className:"w-3 h-3 text-emerald-400 animate-pulse"}),"LIVE BROADCAST"]}),i.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 font-mono",children:(n==null?void 0:n.country)||"Global"})]}),i.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-white tracking-tight leading-tight",children:(n==null?void 0:n.name)||"Global Radio Stream"})]})}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2.5 pt-2 border-t border-slate-800/80 text-xs text-slate-400 font-mono",children:[i.jsxs("div",{className:"bg-slate-950/60 p-2 rounded-xl border border-slate-800/60",children:[i.jsx("span",{className:"text-[10px] text-slate-500 block uppercase",children:l?"音质码率":"Audio Bitrate"}),i.jsx("span",{className:"font-bold text-emerald-400",children:"128 kbps AAC"})]}),i.jsxs("div",{className:"bg-slate-950/60 p-2 rounded-xl border border-slate-800/60",children:[i.jsx("span",{className:"text-[10px] text-slate-500 block uppercase",children:l?"广播语言":"Language"}),i.jsx("span",{className:"font-bold text-indigo-400",children:(n==null?void 0:n.language)||"English"})]}),i.jsxs("div",{className:"bg-slate-950/60 p-2 rounded-xl border border-slate-800/60 col-span-2 sm:col-span-1",children:[i.jsx("span",{className:"text-[10px] text-slate-500 block uppercase",children:l?"当地时间":"Station Local Time"}),i.jsx("span",{className:"font-bold text-amber-400",children:y||"--:--:--"})]})]})]}),i.jsxs("div",{className:"relative group",children:[i.jsx("div",{className:"absolute -inset-1 bg-gradient-to-r from-emerald-500 via-teal-400 to-indigo-500 rounded-2xl blur-md opacity-70 group-hover:opacity-100 transition duration-300 animate-pulse"}),i.jsxs("button",{onClick:s,className:"relative w-full py-4 px-6 rounded-2xl bg-slate-900 hover:bg-slate-850 text-white font-bold text-sm sm:text-base border border-emerald-500/50 shadow-2xl transition-all flex items-center justify-between gap-3 cursor-pointer active:scale-98",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-500 text-slate-950 flex items-center justify-center shrink-0 shadow-lg shadow-emerald-500/40",children:i.jsx(At,{className:"w-5 h-5 fill-current"})}),i.jsxs("div",{className:"text-left",children:[i.jsx("span",{className:"block font-extrabold text-white text-base",children:l?"✨ Catch & Practice (暂停并精学这句)":"✨ Catch & Practice (Pause & Learn)"}),i.jsx("span",{className:"text-xs text-emerald-400/90 font-medium",children:l?"主动点击唤醒 AI 抓取最新 15 秒广播语音":"Wake AI to slice & analyze recent 15s audio"})]})]}),i.jsx("div",{className:"px-3 py-1 rounded-lg bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 text-xs font-mono shrink-0",children:l?"切至精跟读 →":"Shadow Now →"})]})]}),i.jsxs("div",{className:"flex items-center justify-between gap-3 bg-slate-900/80 p-3 rounded-2xl border border-slate-800",children:[i.jsx("button",{onClick:_,className:"p-3 rounded-xl bg-slate-950 hover:bg-slate-800 text-slate-300 hover:text-white border border-slate-800 transition-all cursor-pointer active:scale-95",title:l?"上一个电台":"Previous Station",children:i.jsx(CW,{className:"w-5 h-5"})}),i.jsx("button",{onClick:t,className:`flex-1 py-3 px-6 rounded-xl font-bold text-sm flex items-center justify-center gap-2 transition-all cursor-pointer shadow-lg active:scale-95 ${e?"bg-amber-500 hover:bg-amber-400 text-slate-950 shadow-amber-500/20":"bg-emerald-500 hover:bg-emerald-400 text-slate-950 shadow-emerald-500/20"}`,children:e?i.jsxs(i.Fragment,{children:[i.jsx(Fh,{className:"w-5 h-5 fill-current"}),i.jsx("span",{children:l?"暂停播放广播":"Pause Stream"})]}):i.jsxs(i.Fragment,{children:[i.jsx(Xa,{className:"w-5 h-5 fill-current"}),i.jsx("span",{children:l?"播放广播直播":"Play Broadcast"})]})}),i.jsx("button",{onClick:I,className:"p-3 rounded-xl bg-slate-950 hover:bg-slate-800 text-slate-300 hover:text-white border border-slate-800 transition-all cursor-pointer active:scale-95",title:l?"下一个电台":"Next Station",children:i.jsx(qn,{
4821className:"w-5 h-5"})})]}),i.jsx("div",{className:"flex flex-wrap items-center justify-between gap-3 pt-2",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"text-xs font-medium text-slate-400 flex items-center gap-1 font-mono",children:[i.jsx(ko,{className:"w-3.5 h-3.5 text-indigo-400"}),l?"睡眠定时器":"Sleep Timer",":"]}),i.jsx("div",{className:"flex items-center gap-1",children:[null,15,30,60].map(D=>{const j=c===D;return i.jsx("button",{onClick:()=>P(D),className:`px-2.5 py-1 rounded-lg text-xs font-mono font-semibold transition-all cursor-pointer ${j?"bg-indigo-600 text-white border border-indigo-400 shadow-sm":"bg-slate-900 hover:bg-slate-800 text-slate-400 hover:text-slate-200 border border-slate-800"}`,children:D===null?l?"关":"Off":`${D}m`},D??"off")})}),h!==null&&i.jsxs("span",{className:"text-xs font-mono text-emerald-400 bg-emerald-500/10 border border-emerald-500/30 px-2 py-0.5 rounded-md animate-pulse ml-1",children:["⏳ ",R(h)]})]})})]})]}),p&&i.jsxs("div",{className:"absolute top-4 right-4 z-50 bg-indigo-900/90 text-white border border-indigo-400/40 px-4 py-2.5 rounded-2xl shadow-2xl flex items-center gap-2 text-xs font-semibold backdrop-blur-md animate-in fade-in slide-in-from-top-3",children:[i.jsx(ko,{className:"w-4 h-4 text-indigo-300 animate-bounce"}),i.jsx("span",{children:l?"睡眠定时已到,广播已自动暂停。":"Sleep timer finished. Broadcast paused for sleep."})]})]})}function C6e({onOpenExaminer:n,onOpenPaywall:e,onOpenAuthModal:t,activeStationName:r="Global Airwaves",hasCurrentTranscript:s=!1,isPro:a=!1}){var k;const{t:o,isZh:l}=Or(),{user:c}=Ji(),d=!!c,[h,m]=S.useState(()=>$0(a)),[p,x]=S.useState(!1),[y,v]=S.useState(!1),B=S.useRef(null);S.useEffect(()=>{const P=()=>{m($0(a))};return P(),window.addEventListener("examiner-quota-updated",P),()=>window.removeEventListener("examiner-quota-updated",P)},[a]),S.useEffect(()=>{const P=R=>{B.current&&!B.current.contains(R.target)&&v(!1)};return document.addEventListener("mousedown",P),()=>document.removeEventListener("mousedown",P)},[]);const E=P=>{if(P==null||P.stopPropagation(),!d){t&&t();return}h&&e?e():n()},N=p||y,T=ete(a);return i.jsx("aside",{id:"sidebar-ai-examiner-dock",ref:B,onMouseEnter:()=>x(!0),onMouseLeave:()=>x(!1),"aria-label":o.examiner.title,className:"fixed right-0 top-[46%] -translate-y-1/2 z-40 select-none pointer-events-auto",children:i.jsxs("div",{className:"relative flex items-center justify-end",children:[i.jsxs("div",{id:"examiner-collapsed-tab",onClick:()=>{window.innerWidth<640?v(!0):E()},className:`flex items-center gap-2 pl-2 pr-2.5 py-1.5 rounded-l-xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-sm border-l border-y border-slate-200 dark:border-slate-800 shadow-md shadow-black/5 cursor-pointer group transition-all duration-300 ease-out hover:border-emerald-500/60 hover:bg-white dark:hover:bg-slate-900 ${N?"opacity-0 translate-x-12 pointer-events-none absolute":"opacity-85 hover:opacity-100 translate-x-0 pointer-events-auto relative"}`,title:l?"展开 1v1 口语对练":"Open 1v1 AI Speaking Coach",children:[i.jsx(CW,{className:"w-3 h-3 text-slate-400 group-hover:text-emerald-500 group-hover:-translate-x-0.5 transition-transform shrink-0"}),i.jsx("div",{className:"relative w-7 h-7 rounded-full overflow-hidden border border-emerald-500/40 shadow-xs shrink-0 bg-emerald-50 dark:bg-emerald-950",children:i.jsx("img",{src:qy,alt:"AI Speaking Coach",referrerPolicy:"no-referrer",className:"w-full h-full object-cover"})}),i.jsxs("div",{className:"flex flex-col items-start leading-tight pr-0.5",children:[i.jsx("div",{className:"flex items-center gap-1",children:i.jsx("span",{className:"text-[11px] font-bold text-slate-700 dark:text-slate-300 tracking-tight whitespace-nowrap group-hover:text-emerald-600 dark:group-hover:text-emerald-400 transition-colors",children:l?"AI 口语对练":"1v1 Debate"})}),i.jsx("span",{className:"text-[9px] text-slate-400 dark:text-slate-500 whitespace-nowrap",children:l?"雅思/欧标":"IELTS/CEFR"})]})]}),i.jsxs("div",{id:"examiner-full-card",className:`w-[325px] sm:w-[355px] bg-white/95 dar
4821k:bg-slate-900/95 backdrop-blur-md rounded-l-3xl border-l-2 border-y-2 border-emerald-500/50 dark:border-emerald-500/40 shadow-2xl shadow-emerald-950/20 dark:shadow-black/60 p-4 sm:p-5 flex flex-col gap-3.5 transition-all duration-300 ease-[cubic-bezier(0.16,1,0.3,1)] ${N?"opacity-100 translate-x-0 pointer-events-auto relative":"opacity-0 translate-x-12 pointer-events-none absolute"}`,children:[i.jsxs("div",{className:"flex items-center justify-between pb-3 border-b border-slate-100 dark:border-slate-800/80",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{onClick:E,className:"relative w-13 h-13 sm:w-14 sm:h-14 rounded-2xl overflow-hidden border-2 border-emerald-500/60 shadow-md shadow-emerald-500/20 shrink-0 bg-emerald-50 dark:bg-emerald-950/40 cursor-pointer group",title:o.examiner.title,children:[i.jsx("img",{src:qy,alt:"Spoken English Coach Dr. Arthur Sterling",referrerPolicy:"no-referrer",className:"w-full h-full object-cover group-hover:scale-105 transition-transform duration-300"}),i.jsxs("span",{className:"absolute top-1 left-1 flex h-2.5 w-2.5",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500 border border-white dark:border-slate-900"})]})]}),i.jsxs("div",{className:"flex flex-col min-w-0",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("h3",{className:"text-xs sm:text-sm font-black text-slate-900 dark:text-slate-100 tracking-tight leading-tight truncate",children:o.examiner.examinerDoctorName}),i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"})]}),i.jsx("p",{className:"text-[11px] font-semibold text-emerald-700 dark:text-emerald-400 truncate",children:o.examiner.examinerRole}),i.jsxs("div",{className:"flex items-center gap-1.5 mt-0.5",children:[i.jsx("span",{className:"inline-block w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),i.jsx("span",{className:"text-[10px] text-slate-500 dark:text-slate-400",children:o.examiner.examinerStatusOnline})]})]})]}),i.jsx("button",{onClick:P=>{P.stopPropagation(),x(!1),v(!1)},title:l?"收起面板":"Minimize panel",className:"p-1 rounded-xl text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dark:hover:bg-slate-800 transition-colors cursor-pointer",children:i.jsx(qn,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"px-3 py-2 rounded-xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/70 dark:border-slate-700/60 flex items-center justify-between text-[11px]",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-slate-700 dark:text-slate-300 font-medium truncate pr-2",children:[i.jsx(cn,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0 animate-pulse"}),i.jsx("span",{className:"truncate",children:s?`${l?"正在连线:":"Live: "} ${r}`:l?"官方标准 C1 播客与听力语料切片":"Standard C1 Podcast & Audio Slice"})]}),i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-emerald-500/15 text-emerald-700 dark:text-emerald-300 shrink-0 uppercase",children:l?"实时原声":"Live"})]}),i.jsxs("div",{className:"flex flex-col gap-1.5",children:[i.jsxs("div",{className:"flex items-center justify-between text-[10px]",children:[i.jsx("span",{className:"font-bold text-slate-500 dark:text-slate-400 uppercase tracking-wider",children:l?"3阶思维进阶考核流程":"3-Round Cognitive Progression"}),i.jsx("span",{className:"font-bold text-emerald-600 dark:text-emerald-400 text-[10px]",children:"CEFR C1 / Fluency Mastery"})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-1.5 text-[10px]",children:[i.jsxs("div",{className:"p-2 rounded-xl bg-emerald-500/10 border border-emerald-500/20 text-center flex flex-col items-center gap-0.5",children:[i.jsx("span",{className:"font-bold text-emerald-800 dark:text-emerald-300",children:l?"1. 事实转述":"1. Recall"}),i.jsx("span",{className:"text-[8px] text-slate-500 dark:text-slate-400 leading-none",children:l?"信息综合":"Synthesis"})]}),i.jsxs("div",{className:"p-2 rounded-xl bg-teal-500/10 border border-teal-500/20 text-center flex flex-col items-center gap-0.5",children:[i.jsx("span",{className:"font-bold text-teal-800 dark:text-teal-300",children:l?"2. 逻辑驳斥":"2. Rebuttal"}),i.jsx("span",{className:"text-[8px] text-slate-500 dark:text-slate-400 leading-none",children:l?"尖锐辩论":"Counterpoint"})]}),i.jsxs("div",{className:"p-2 rounded-xl bg-indigo-500/10 border border-indigo-500/20 text-center flex flex-col items-center gap-0.5",children:[i.jsx("span",{className:"font-bold text-indigo-800 dark:text-indigo-300",children:l?"3. 抽象推演":"3. Transfer"}),i.jsx("span",{className:"text-[8px] text-slate-500 dark:text-slate-400 leading-none",children:l?"价值升华":"Extra
4821polation"})]})]})]}),i.jsxs("div",{className:"flex flex-col gap-1.5 pt-0.5",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px] px-1",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-slate-600 dark:text-slate-400 font-medium",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-500 shrink-0"}),i.jsx("span",{children:a?l?"PRO 权益:无限次 1v1 指导":"PRO: Unlimited 1v1 Coaching":l?`设备绑定体验:剩余 ${T} 次`:`Device-Bound: ${T} Left`})]}),h&&i.jsxs("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-amber-500/20 text-amber-700 dark:text-amber-300 border border-amber-500/30 flex items-center gap-0.5",children:[i.jsx(fr,{className:"w-2.5 h-2.5"}),"PRO"]})]}),i.jsxs("div",{onClick:()=>{!d&&t&&t()},className:`px-2.5 py-1.5 rounded-xl border flex items-center justify-between text-[10px] transition-colors ${d?"":"cursor-pointer hover:border-amber-500/50 hover:bg-amber-500/10"} ${d?"bg-emerald-50/70 dark:bg-emerald-950/40 border-emerald-500/25 text-emerald-800 dark:text-emerald-300":"bg-amber-50/70 dark:bg-amber-950/40 border-amber-500/25 text-amber-800 dark:text-amber-300"}`,children:[i.jsx("div",{className:"flex items-center gap-1.5 truncate pr-2",children:d?i.jsxs(i.Fragment,{children:[i.jsx(wc,{className:"w-3 h-3 text-emerald-600 dark:text-emerald-400 shrink-0"}),i.jsxs("span",{className:"truncate font-medium",children:[l?"学员:":"Learner: ",(c==null?void 0:c.displayName)||((k=c==null?void 0:c.email)==null?void 0:k.split("@")[0])]})]}):i.jsxs(i.Fragment,{children:[i.jsx(rl,{className:"w-3 h-3 text-amber-600 dark:text-amber-400 shrink-0"}),i.jsx("span",{className:"truncate font-medium",children:l?"需登录以记录口语实战分数 (点击登录)":"Sign in to save spoken coaching scores"})]})}),i.jsx("span",{className:`px-1.5 py-0.5 rounded text-[9px] font-bold shrink-0 ${d?"bg-emerald-500/15 text-emerald-700 dark:text-emerald-300":"bg-amber-500/20 text-amber-700 dark:text-amber-300"}`,children:d?l?"已同步":"Synced":l?"去登录":"Sign In"})]})]}),i.jsx("button",{id:"examiner-sidebar-launch-btn",onClick:E,className:`w-full py-3 px-4 rounded-xl text-white font-bold text-xs shadow-md transition-all flex items-center justify-center gap-2 cursor-pointer active:scale-[0.98] ${d?h?"bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 shadow-amber-500/25":"bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 shadow-emerald-600/30":"bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 shadow-amber-500/25"}`,children:d?h?i.jsxs(i.Fragment,{children:[i.jsx(fr,{className:"w-4 h-4"}),i.jsx("span",{children:o.examiner.report.unlockPro})]}):i.jsxs(i.Fragment,{children:[i.jsx(xi,{className:"w-4 h-4"}),i.jsx("span",{children:o.examiner.startDebateCta}),i.jsx(qr,{className:"w-4 h-4 ml-0.5"})]}):i.jsxs(i.Fragment,{children:[i.jsx(rl,{className:"w-4 h-4"}),i.jsx("span",{children:l?"登录学术账号开启 1v1 指导":"Sign In to Start 1v1 Coaching"}),i.jsx(qr,{className:"w-4 h-4 ml-0.5"})]})})]})]})})}function E6e({isOpen:n,onClose:e,onOpenLegal:t,title:r,subtitle:s}){const{isZh:a,t:o}=Or(),{signInWithGoogle:l,signInWithEmail:c}=Ji(),[d,h]=S.useState(!1),[m,p]=S.useState(null),[x,y]=S.useState(""),[v,B]=S.useState(null);if(S.useEffect(()=>{if(!n){p(null),y("");return}const k=P=>{P.key==="Escape"&&e()};return document.addEventListener("keydown",k),()=>document.removeEventListener("keydown",k)},[n,e]),!n)return null;const E=async()=>{var k;try{h(!0),p(null),await l(),e()}catch(P){if(console.error("Google login error:",P),P.code!=="auth/popup-closed-by-user")if((P==null?void 0:P.code)==="auth/unauthorized-domain"||(k=P==null?void 0:P.message)!=null&&k.includes("unauthorized-domain")){const R=typeof window<"u"?window.location.hostname:"radioshadow.space";p(a?`当前域名 (${R}) 尚未在 Firebase 授权网域列表中。请前往 Firebase 控制台添加此网域,或使用下方邮箱直接登录。`:`Domain "${R}" is not authorized in Firebase. Please add it in Firebase Console -> Authentication -> Settings -> Authorized domains, or use Email sign-in.`)}else p(a?(P==null?void 0:P.message)||"Google 登录失败,请稍后重试。":(P==null?void 0:P.message)||"Google sign in failed. Please try again.")}finally{h(!1)}},N=async k=>{var P;if(k&&k.preventDefault(),!x.trim()||!x.includes("@")){p(a?"请输入有效的电子邮箱地址。":"Please enter a valid email address.");return}try{h(!0),p(null),await c(x.trim()),e()}catch(R){console.error("Email sign in error:",R),(R==null?void 0:R.code)==="auth/operation-not-allowed"||(P=R==null?void 0:R.message)!=null&&P.includes("disabled")?(p(a?"邮箱登录暂未开启,正在自动切换至 Google 快捷登录...":"Email login is disabled on this project. Switching to Google Sign-In..."),setTimeout(()=>{E()},1e3)):p(a?"邮箱登录失败,请重试。":(R==null?void 0:R.message)||"Email Sign-In error. Please try again.")}finally{h(!1)}},T=k=>{t?t(k):B(k)};return i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"fixed inset-0 z-[9999] flex items-center justify-center bg-slate-950/70 backdrop-blur-md p-4 animate-in fade-in duration-200",onClick:k=>{k.target===k.currentTarget&&e()},children:i.jsxs("div",{className:"bg-white dark:bg-slate-900 rounded-3xl shadow-2xl border border-slate-200 dark:border-slate-800 p-6 max-w-sm w-full relative flex flex-col gap-5 animate-in zoom-in-95 duration-150",children:[i.jsx("button",{onClick:e,"aria-label":"Close authentication modal",className:"absolute top-4 right-4 text-slate-400 hover:text-slate-600 dar
4821k:hover:text-slate-200 transition-colors p-1.5 rounded-full hover:bg-slate-100 dark:hover:bg-slate-800 cursor-pointer",children:i.jsx(Ts,{className:"w-5 h-5"})}),i.jsxs("div",{className:"text-center pt-2",children:[i.jsx("div",{className:"w-12 h-12 rounded-2xl bg-emerald-50 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400 flex items-center justify-center mx-auto mb-3 border border-emerald-200/50 dark:border-emerald-800/40 shadow-sm",children:i.jsx(wc,{className:"w-6 h-6"})}),i.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-slate-100",children:r||(a?"登录学术与跟读账号":"Sign in to RadioShadow AI")}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1 leading-relaxed",children:s||(a?"保存真实考评诊断报告、四维评分与无限跟读练习":"Access full diagnostic reports, band evaluation & unlimited speaking practice")})]}),m&&i.jsxs("div",{className:"p-3 bg-red-50 dark:bg-red-950/40 text-red-600 dark:text-red-400 text-xs rounded-xl border border-red-200 dark:border-red-900/40 flex flex-col gap-1.5 leading-relaxed",children:[i.jsx("span",{children:m}),m.includes("Google")&&i.jsx("button",{type:"button",onClick:E,className:"text-xs font-bold text-emerald-600 dark:text-emerald-400 underline hover:text-emerald-700 text-left cursor-pointer mt-1",children:a?"点击此处使用 Google 账号登录 →":"Click here to sign in with Google →"})]}),i.jsx("div",{className:"flex flex-col gap-2.5",children:i.jsxs("button",{type:"button",onClick:E,disabled:d,className:"w-full py-3 px-4 rounded-xl bg-white dark:bg-slate-800 hover:bg-slate-50 dark:hover:bg-slate-700/80 text-slate-800 dark:text-slate-100 font-bold text-sm border border-slate-200 dark:border-slate-700 shadow-sm transition-all flex items-center justify-center gap-3 cursor-pointer active:scale-95 disabled:opacity-60",children:[i.jsxs("svg",{className:"w-4 h-4 flex-shrink-0",viewBox:"0 0 24 24",children:[i.jsx("path",{d:"M22.56 12.25c0-.78-.07-1.53-.2-2.25H12v4.26h5.92c-.26 1.37-1.04 2.53-2.21 3.31v2.77h3.57c2.08-1.92 3.28-4.74 3.28-8.09z",fill:"#4285F4"}),i.jsx("path",{d:"M12 23c2.97 0 5.46-.98 7.28-2.66l-3.57-2.77c-.98.66-2.23 1.06-3.71 1.06-2.86 0-5.29-1.93-6.16-4.53H2.18v2.84C3.99 20.53 7.7 23 12 23z",fill:"#34A853"}),i.jsx("path",{d:"M5.84 14.09c-.22-.66-.35-1.36-.35-2.09s.13-1.43.35-2.09V7.07H2.18C1.43 8.55 1 10.22 1 12s.43 3.45 1.18 4.93l2.85-2.22.81-.62z",fill:"#FBBC05"}),i.jsx("path",{d:"M12 5.38c1.62 0 3.06.56 4.21 1.64l3.15-3.15C17.45 2.09 14.97 1 12 1 7.7 1 3.99 3.47 2.18 7.07l3.66 2.84c.87-2.6 3.3-4.53 6.16-4.53z",fill:"#EA4335"})]}),i.jsx("span",{children:a?"使用 Google 账号继续":"Continue with Google"})]})}),i.jsxs("div",{className:"relative flex items-center justify-center my-1",children:[i.jsx("div",{className:"border-t border-slate-200 dark:border-slate-800 w-full"}),i.jsx("span",{className:"bg-white dark:bg-slate-900 px-3 text-[10px] text-slate-400 font-medium uppercase absolute",children:a?"或通过邮箱":"or email"})]}),i.jsxs("form",{onSubmit:N,className:"flex flex-col gap-3",children:[i.jsxs("div",{className:"relative",children:[i.jsx("div",{className:"absolute inset-y-0 left-0 pl-3 flex items-center pointer-events-none",children:i.jsx(Kd,{className:"h-4 w-4 text-slate-400"})}),i.jsx("input",{type:"email",required:!0,placeholder:a?"输入您的电子邮箱地址":"Enter your email address",value:x,onChange:k=>y(k.target.value),className:"block w-full pl-10 pr-3 py-3 border border-slate-300 dark:border-slate-700 rounded-xl leading-5 bg-white dark:bg-slate-800 placeholder-slate-400 text-slate-900 dark:text-slate-100 focus:outline-none focus:ring-2 focus:ring-emerald-500 focus:border-emerald-500 sm:text-sm transition-all"})]}),i.jsx("button",{type:"submit",disabled:d||!x,className:"w-full py-3 px-4 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-md shadow-emerald-600/20 transition-all flex items-center justify-center gap-2 cursor-pointer disabled:opacity-60 disabled:cursor-not-allowed",children:d?i.jsxs("span",{className:"flex items-center gap-2",children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin"}),a?"正在登录...":"Signing in..."]}):i.jsxs(i.Fragment,{children:[i.jsx("span",{children:a?"使用邮箱继续":"Continue with Email"}),i.jsx(qr,{className:"w-4 h-4"})]})})]}
4821),i.jsx("div",{className:"pt-2 border-t border-slate-100 dark:border-slate-800/80 text-center",children:i.jsxs("p",{className:"text-[11px] text-slate-400 dark:text-slate-500 leading-relaxed",children:[a?"登录即代表您已同意我们的 ":"By signing in, you agree to our ",i.jsx("button",{type:"button",onClick:()=>T("terms"),className:"underline hover:text-emerald-600 dark:hover:text-emerald-400 font-medium cursor-pointer",children:o.legal.termsTitle})," ",a?"和 ":"and ",i.jsx("button",{type:"button",onClick:()=>T("privacy"),className:"underline hover:text-emerald-600 dark:hover:text-emerald-400 font-medium cursor-pointer",children:o.legal.privacyTitle}),"."]})})]})}),v&&i.jsx(l5,{isOpen:!0,initialTab:v,onClose:()=>B(null)})]})}function l$({onBackToRadio:n,onOpenPaywall:e,onOpenAuthModal:t,onCloseAuthModal:r,isAuthModalOpen:s,initialSnippet:a,activeStationName:o="BBC World Service",darkMode:l,onToggleDarkMode:c}){var Va,pn,Bi,Ca,wi,Br,eo,Yl;const{user:d,isPro:h}=Ji(),{t:m,isZh:p,toggleLanguage:x}=Or(),y=typeof window<"u"?new URLSearchParams(window.location.search).get("topic"):null,[v,B]=S.useState(!1),E=s!==void 0?s:v,N=()=>{B(!0),t&&t()},T=()=>{B(!1),r&&r()},[k,P]=S.useState(()=>typeof l=="boolean"?l:typeof window<"u"?localStorage.getItem("world_radio_dark_mode")==="true":!1);S.useEffect(()=>{typeof l=="boolean"&&P(l)},[l]),S.useEffect(()=>{if(typeof window<"u"){const tt=window.document.documentElement;k?tt.classList.add("dark"):tt.classList.remove("dark"),localStorage.setItem("world_radio_dark_mode",String(k))}},[k]);const R=()=>{c?c():P(tt=>!tt)},[_,I]=S.useState("scene1_intro"),[D,j]=S.useState(()=>{if(typeof window<"u"){const tt=window.location.pathname.replace(/\/$/,"");if(tt==="/ielts-speaking-mock-test"||tt.includes("ielts"))return"English"}return"English"}),O=tte(D),M=nte(D),U=O.code==="es"||D.toLowerCase().includes("span"),[ee,ie]=S.useState(()=>(d==null?void 0:d.displayName)||(p?"Alex Chen (Candidate)":"Alex Chen")),[G,Z]=S.useState(D==="Spanish"?p?"España / Colombia":"Spain / Global":p?"China / Global":"Global Candidate"),[z,se]=S.useState(D==="Spanish"?"DELE C1":"7.5"),[re,H]=S.useState(()=>y||(D==="Spanish"?"Transición Energética y Mercado Eléctrico":"Global Economic Policy")),[Y,de]=S.useState(p),[W,K]=S.useState(!1),[J,oe]=S.useState(!1);S.useEffect(()=>{de(p)},[p]);const[Ie,pe]=S.useState(()=>{if(a)return a;const tt=cc[Wf(D)]||cc.English;if(y){const ft=tt.find(yt=>yt.topic.toLowerCase()===y.toLowerCase()||y.toLowerCase().includes(yt.topic.toLowerCase()));return ft||{id:"url-topic-cuecard",language:"English",stationSource:"BBC World Service / Cambridge Academic",topic:y,snippet:`In this session, the candidate explores key perspectives on: "${y}". Focus on sustained coherence, lexical variety, and precise grammatical control.`,suggestedLexicon:["profound impact","formative years","role model","lasting impression","unwavering dedication"]}}return tt[0]}),[ye,he]=S.useState(!1),[le,ce]=S.useState(!1),[Ce,Ae]=S.useState(!1),[je,nt]=S.useState(!1),[We,dt]=S.useState(!1),[bt,Yt]=S.useState(""),[Gt,En]=S.useState(null),[$t,ds]=S.useState("not_started"),[sa,Fa]=S.useState(""),[Mr,es]=S.useState(()=>y?{topicTitle:y.startsWith("Topic:")||y.startsWith("Describe")?y:`Topic: ${y}`,subTitle:"You should say:",bulletPoints:["Who or what this is and how you first came into contact with them","What distinctive traits, qualities, or key events stood out the most","How this significantly shaped your personal perspectives, habits, or decisions","And explain why this influence has been so profound, meaningful, and lasting."],prepTimeSeconds:60,speakTimeSeconds:120,sampleFramework:"Backgroun
4821d Context -> Key Drivers -> Personal Impact -> Long-term Significance",suggestedVocabulary:["profound impact","formative years","role model","unwavering integrity","catalyst for change"]}:{topicTitle:"Topic: Describe a significant economic or technological change in your country.",subTitle:"You should say:",bulletPoints:["When and where this change began","What the underlying drivers and causes were","How different groups in society responded to it","And explain what long-term consequences you foresee."],prepTimeSeconds:60,speakTimeSeconds:120,sampleFramework:"Background Context -> Key Drivers -> Public Impact -> Future Outlook",suggestedVocabulary:["monetary policy","paradigm shift","socio-economic disparity","long-term resilience"]}),[us,Vs]=S.useState(60),[Xi,ts]=S.useState(!1),[Fr,As]=S.useState(""),[Qn,hl]=S.useState(0),[xa,Zi]=S.useState(""),[Ur,ks]=S.useState(!1),[Bn,Ar]=S.useState(1),[Pn,aa]=S.useState(null),[si,bi]=S.useState([]),[hs,ba]=S.useState(1),[fl,Jn]=S.useState(!1),[ge,et]=S.useState(0),[xe,wn]=S.useState(!1),[ht,mn]=S.useState(null),[ya,Xn]=S.useState(!1),Sn=S.useRef(null),va=S.useRef([]),In=S.useRef(null),yr=S.useRef(null),kr=S.useRef(null),fs=S.useRef(null),ns=S.useRef(null),Io=$0(h);ete(h),S.useEffect(()=>()=>{yr.current&&clearInterval(yr.current),kr.current&&clearInterval(kr.current),fs.current&&clearInterval(fs.current),In.current&&(In.current.pause(),In.current.src=""),ns.current&&ns.current.getTracks().forEach(tt=>tt.stop())},[]),S.useEffect(()=>{const tt=document.title;document.title="IELTS Speaking Practice: 1v1 AI Examiner | RadioShadow",typeof window<"u"&&!window.location.pathname.startsWith("/ielts-speaking-mock-test")&&window.history.replaceState({},"","/ielts-speaking-mock-test");let ft=document.querySelector('link[rel="canonical"]'),yt=!1;const lt=`${window.location.origin}/ielts-speaking-mock-test`;return ft?ft.href=lt:(ft=document.createElement("link"),ft.rel="canonical",ft.href=lt,document.head.appendChild(ft),yt=!0),()=>{document.title=tt,yt&&ft&&ft.parentNode&&ft.parentNode.removeChild(ft)}},[]);const Ba=(tt,ft="audio/wav",yt)=>{if(ye){yt&&yt();return}try{In.current&&In.current.pause();const lt=new Audio(`data:${ft};base64,${tt}`);In.current=lt,ce(!0),lt.onended=()=>{ce(!1),yt&&yt()},lt.onerror=()=>{ce(!1),yt&&yt()},lt.play().catch(Ln=>{console.warn("Audio autoplay blocked or failed:",Ln),ce(!1),yt&&yt()})}catch{ce(!1),yt&&yt()}},Ns=()=>{In.current&&(In.current.pause(),ce(!1))},or=async tt=>{if(!tt||ye)return null;wn(!0);try{const ft=O.examinerPersona.defaultVoice||"Aoede",lt=await(await fetch("/api/examiner/tts",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({text:tt,voiceName:ft})})).json();if(lt.success&&lt.audioBase64)return lt.audioBase64}catch(ft){console.warn("TTS fetch error:",ft)}finally{wn(!1)}return null},yi=async()=>{if(!d){N();return}if(Io&&e){e();return}ds("intro_speaking"),En(null);const tt=O.examinerPersona.greetingPattern,ft=await or(tt);ft?Ba(ft,"audio/wav",()=>{ds("candidate_turn")}):setTimeout(()=>{ds("candidate_turn")},1500)},vr=async()=>{ds("warmup_passed"),Ns();const tt=U?`Muchas gracias, ${ee}. Queda registrado. Procedamos ahora a la Ronda 2 de profundización temática.`:`Thank you, ${ee}. That is clear. Now let us move into Part 2 of the test.`,ft=await or(tt);ft?Ba(ft,"audio/wav",()=>{ml()}):setTimeout(()=>{ml()},1200)},ml=async()=>{I("scene2_cuecard"),Yt(""),ts(!1),Vs(60),ks(!1);try{const lt=await(await fetch("/api/examiner/cuecard",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({snippet:Ie,language:D,customTopic:re})})).json();lt.success&&lt.cueCard&&es(lt.cueCard)}catch(yt){console.warn("Using default cue card:",yt)}const ft=await or("Now, I am going to give you a topic card. You will have one minute to prepare your response, and you may take notes using the notepad if you wish. Then you will speak for one to two minutes.");ft&&Ba(ft,"audio/wav")},Kl=()=>{Ns(),ts(!0),yr.current&&clearInterval(yr.current),yr.current=setInterval(()=>{Vs(tt=>tt<=1?(clearInterval(yr.current),yr.current=null,ts(!1),wa("part2"),0):tt-1)},1e3)},ai=()=>{yr.current&&(clearInterval(yr.current),yr.current=null),ts(!1),Vs(0),wa("part2")},qt=()=>
4821{Ua(),ks(!0),kr.current&&(clearInterval(kr.current),kr.current=null),setTimeout(()=>{uu()},1200)},uu=async()=>{I("scene3_followup"),Ar(1),bi([]),ms(1,Ie,[])},ms=async(tt,ft,yt)=>{Jn(!0),ba(1),aa(null),Yt(""),et(0),fs.current&&clearInterval(fs.current),fs.current=setInterval(()=>{ba(lt=>lt===1?2:lt===2?3:1)},500);try{const lt=O.examinerPersona.defaultVoice||"Aoede",Dn=await(await fetch("/api/examiner/question",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({round:tt,snippet:ft,language:D,previousTurns:yt,voiceName:lt,skipAudio:!0})})).json();if(!Dn.success)throw new Error(Dn.error||"Failed to load question");fs.current&&(clearInterval(fs.current),fs.current=null),Jn(!1);const Rt={round:tt,roundTitle:Dn.roundTitle,roundObjective:Dn.roundObjective,question:Dn.question,examinerTip:Dn.examinerTip};aa(Rt),et(5),yr.current&&clearInterval(yr.current),yr.current=setInterval(()=>{et(Gr=>Gr<=1?(clearInterval(yr.current),yr.current=null,0):Gr-1)},1e3);const Et=await or(Dn.question);Et&&Ba(Et,"audio/wav")}catch(lt){console.error("Part 3 fetch error:",lt),fs.current&&(clearInterval(fs.current),fs.current=null),Jn(!1),En("Could not generate question. Retrying...")}},wa=async tt=>{if(!Ce){En(null),Ns(),yr.current&&(clearInterval(yr.current),yr.current=null),et(0);try{const ft=await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}});ns.current=ft;const yt=new MediaRecorder(ft);Sn.current=yt,va.current=[],yt.ondataavailable=lt=>{lt.data.size>0&&va.current.push(lt.data)},yt.onstop=async()=>{const lt=new Blob(va.current,{type:yt.mimeType||"audio/webm"});await Wl(lt,tt),ns.current&&ns.current.getTracks().forEach(Ln=>Ln.stop())},yt.start(250),Ae(!0),tt==="part2"&&(hl(0),kr.current&&clearInterval(kr.current),kr.current=setInterval(()=>{hl(lt=>lt+1)},1e3))}catch(ft){console.error("Mic access failed:",ft),En("Microphone access denied. Please allow microphone permissions in your browser settings.")}}},Ua=()=>{Sn.current&&Ce&&(Sn.current.stop(),Ae(!1)),kr.current&&(clearInterval(kr.current),kr.current=null)},Wl=async(tt,ft)=>{nt(!0);try{const yt=new FormData;yt.append("audio",tt,"response.webm"),yt.append("language",D);const Dn=((await(await fetch("/api/examiner/transcribe",{method:"POST",body:yt})).json()).transcript||"").trim();ft==="warmup"?(Fa(Dn||"My name is Alex, and I am preparing for my master's degree in economics."),vr()):ft==="part2"?Zi(Dn||"In recent years, our country underwent an unprecedented green energy transition..."):ft==="part3"&&(Yt(Dn||"I believe the fundamental tension stems from regulatory lag..."),Dn&&Pn&&ps(Dn,Pn))}catch(yt){console.error("Transcription error:",yt),En("Could not transcribe speech. Please try speaking again.")}finally{nt(!1)}},ps=async(tt,ft)=>{const yt={round:ft.round,roundTitle:ft.roundTitle,question:ft.question,answer:tt},lt=[...si,yt];if(bi(lt),Bn<3){const Ln=Bn+1;Ar(Ln),ms(Ln,Ie,lt)}else lr(lt)},lr=async tt=>{I("scene4_report"),dt(!0),En(null);try{const yt=await(await fetch("/api/examiner/evaluate",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({snippet:Ie,language:D,turns:tt})})).json();if(!yt.success)throw new Error(yt.error||"Evaluation failed");const lt=yt.report;if(mn(lt),YFe(d==null?void 0:d.uid),d!=null&&d.uid)try{await Kf(qs(fn,"examiner_sessions"),{userId:d.uid,candidateName:ee,overallBand:lt.overallBand,cefrLevel:lt.cefrLevel,scores:lt.scores,topic:Ie.topic,stationSource:Ie.stationSource,timestamp:Sd()})}catch(Rt){console.warn("Firestore save session error:",Rt)}const Ln=U?`Enhorabuena, ${ee}. Ha concluido la evaluación oral. Su nivel estimado es ${lt.cefrLevel} con un puntaje de ${lt.overallBand}. Revisemos su diagnóstico detallado.`:`Congratulations, ${ee}. You have concluded the speaking test. Your official assessed performance is Band ${lt.overallBand} (${lt.cefrLevel}). Let us examine your diagnostic report.`,Dn=await or(Ln);Dn&&Ba(Dn,"audio/wav")}catch(ft){console.error("Evaluation error:",ft),En("Evaluation failed. Generating fallback assessment.")}finally{dt(!1)}},Vr=async()=>
4821{if(ht){if(!h){e&&e();return}try{K(!0),await c5(ht,{isZh:p,candidateName:ee||(p?"认证考生":"Academic Candidate")}),oe(!0),setTimeout(()=>oe(!1),3500)}catch(tt){console.error("Certificate export error:",tt),En(tt.message||"Failed to export certificate image")}finally{K(!1)}}},vi=()=>{I("scene1_intro"),ds("not_started"),Fa(""),ts(!1),Yt(""),Zi(""),As(""),bi([]),mn(null),Ns()};return i.jsxs("div",{className:`min-h-screen w-full flex flex-col font-sans transition-colors duration-300 selection:bg-emerald-500 selection:text-white ${k?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsxs("header",{className:`sticky top-0 z-50 w-full backdrop-blur-md border-b px-4 py-3 flex items-center justify-between transition-colors ${k?"bg-slate-900/90 border-slate-800":"bg-white/95 border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("button",{id:"ielts-back-to-radio-btn",onClick:()=>{Ns(),n?n():window.location.href="/"},className:`flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-semibold transition-all border cursor-pointer active:scale-95 ${k?"bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white border-slate-700/80":"bg-slate-100 hover:bg-slate-200 text-slate-700 hover:text-slate-900 border-slate-200"}`,children:[i.jsx(Rm,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:p?"返回全球播客与听力":"Back to Global Podcasts & Practice"}),i.jsx("span",{className:"sm:hidden",children:p?"返回":"Back"})]}),i.jsx("div",{className:`h-4 w-px hidden sm:block ${k?"bg-slate-800":"bg-slate-200"}`}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-7 h-7 rounded-lg bg-emerald-600 flex items-center justify-center text-white shadow-sm font-bold text-xs",children:i.jsx(yn,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsxs("div",{className:`text-xs font-bold flex items-center gap-1.5 ${k?"text-white":"text-slate-900"}`,children:[i.jsx("span",{children:p?"雅思口语全真模考 · 1v1人机对练":"IELTS Speaking 1v1 Mock Test"}),i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[9px] font-bold bg-emerald-500/20 text-emerald-500 dark:text-emerald-400 border border-emerald-500/30",children:"DR. ARTHUR"})]}),i.jsx("div",{className:`text-[10px] ${k?"text-slate-400":"text-slate-500"}`,children:p?"剑桥雅思真题库 · 官方四维标准评分":"Cambridge IELTS Bank • Official Band 5.0–9.0 Rubrics"})]})]})]}),i.jsxs("div",{className:"hidden md:flex items-center gap-1.5 lg:gap-2 text-xs font-medium",children:[i.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-all ${_==="scene1_intro"?k?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 font-bold":"bg-emerald-50 text-emerald-700 border border-emerald-300 font-bold":k?"text-slate-500":"text-slate-400"}`,children:[i.jsx("span",{className:`w-4 h-4 rounded-full flex items-center justify-center text-[10px] ${k?"bg-slate-800 text-slate-300":"bg-slate-200 text-slate-700"}`,children:"1"}),i.jsx("span",{children:p?"Part 1 身份热身":"Scene 1: Warm-up"})]}),i.jsx(qn,{className:`w-3 h-3 ${k?"text-slate-600":"text-slate-400"}`}),i.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-all ${_==="scene2_cuecard"?k?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 font-bold":"bg-emerald-50 text-emerald-700 border border-emerald-300 font-bold":k?"text-slate-500":"text-slate-400"}`,children:[i.jsx("span",{className:`w-4 h-4 rounded-full flex items-center justify-center text-[10px] ${k?"bg-slate-800 text-slate-300":"bg-slate-200 text-slate-700"}`,children:"2"}),i.jsx("span",{children:p?"Part 2 话题卡速记":"Scene 2: Topic Card"})]}),i.jsx(qn,{className:`w-3 h-3 ${k?"text-slate-600":"text-slate-400"}`}),i.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-all ${_==="scene3_followup"?k?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 font-bold":"bg-emerald-50 text-emerald-700 border border-emerald-300 font-bold":k?"text-slate-500":"text-slate-400"}`,children:[i.jsx("span",{className:`w-4 h-4 rounded-full flex items-center justify-center text-[10px] ${k?"bg-slate-800 text-slate-300":"bg-slate-200 text-slate-700"}`,children:"3"}),i.jsx("span",{children:p?"Part 3 深度辩论追问":"Scene 3: Follow-up"})]}
4821),i.jsx(qn,{className:`w-3 h-3 ${k?"text-slate-600":"text-slate-400"}`}),i.jsxs("div",{className:`flex items-center gap-1.5 px-2.5 py-1 rounded-lg transition-all ${_==="scene4_report"?k?"bg-emerald-500/20 text-emerald-300 border border-emerald-500/40 font-bold":"bg-emerald-50 text-emerald-700 border border-emerald-300 font-bold":k?"text-slate-500":"text-slate-400"}`,children:[i.jsx("span",{className:`w-4 h-4 rounded-full flex items-center justify-center text-[10px] ${k?"bg-slate-800 text-slate-300":"bg-slate-200 text-slate-700"}`,children:"4"}),i.jsx("span",{children:p?"Part 4 官方评测报告":"Scene 4: Official Report"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{id:"ielts-toggle-subtitles-btn",onClick:()=>de(!Y),className:`px-2.5 py-1.5 rounded-xl text-xs font-semibold flex items-center gap-1.5 border transition-all cursor-pointer ${Y?k?"bg-teal-500/20 text-teal-300 border-teal-500/40":"bg-teal-50 text-teal-700 border-teal-300":k?"bg-slate-800 text-slate-400 border-slate-700 hover:text-white":"bg-slate-100 text-slate-600 border-slate-200 hover:text-slate-900"}`,title:p?"切换字幕显示":"Toggle Chinese Translation Subtitles",children:[i.jsx(vI,{className:"w-3.5 h-3.5"}),i.jsx("span",{className:"hidden sm:inline",children:Y?p?"中英对照":"Bilingual Subs":p?"纯英字幕":"English Only"})]}),i.jsxs("button",{id:"ielts-toggle-lang-btn",onClick:x,className:`px-2.5 py-1.5 rounded-xl text-xs font-semibold flex items-center gap-1.5 border transition-all cursor-pointer active:scale-95 ${k?"bg-slate-800 hover:bg-slate-700 text-slate-200 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-700 border-slate-200"}`,title:p?"切换为英文 (Switch to English)":"切换为中文 (Switch to Chinese)",children:[i.jsx(bg,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:p?"English":"中文"})]}),i.jsx("button",{id:"ielts-toggle-theme-btn",onClick:R,className:`p-1.5 rounded-xl border transition-all cursor-pointer active:scale-95 ${k?"bg-slate-800 hover:bg-slate-700 text-amber-400 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-indigo-600 border-slate-200"}`,title:k?p?"切换为浅色日间模式":"Switch to Light Mode":p?"切换为深色夜间模式":"Switch to Dark Mode",children:k?i.jsx(qc,{className:"w-4 h-4"}):i.jsx(ko,{className:"w-4 h-4"})}),i.jsx("button",{id:"ielts-mute-voice-btn",onClick:()=>{ye?he(!1):(he(!0),Ns())},className:`p-1.5 rounded-xl border cursor-pointer transition-all ${k?"bg-slate-800 hover:bg-slate-700 text-slate-300 hover:text-white border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-600 hover:text-slate-900 border-slate-200"}`,title:ye?p?"开启考官原声朗读":"Unmute Examiner Voice":p?"静音考官原声朗读":"Mute Examiner Voice",children:ye?i.jsx(mS,{className:"w-4 h-4 text-rose-500"}):i.jsx(on,{className:"w-4 h-4 text-emerald-500"})}),i.jsx("button",{id:"ielts-restart-btn",onClick:vi,className:`p-1.5 rounded-xl border cursor-pointer transition-all ${k?"bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-amber-400 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-500 hover:text-amber-600 border-slate-200"}`,title:p?"重新开始模考":"Restart Test Simulation",children:i.jsx(yg,{className:"w-4 h-4"})}),d?i.jsxs("div",{className:`px-2.5 py-1 rounded-xl border text-xs font-semibold flex items-center gap-1.5 shrink-0 ${k?"bg-emerald-500/10 border-emerald-500/30 text-emerald-300":"bg-emerald-50 border-emerald-200 text-emerald-800"}`,title:d.email||d.displayName||"Learner",children:[i.jsx(wc,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{className:"hidden sm:inline max-w-[90px] truncate",children:d.displayName||((Va=d.email)==null?void 0:Va.split("@")[0])||"Learner"})]}):i.jsxs("button",{id:"ielts-topbar-signin-btn",onClick:N,className:"px-3 py-1.5 rounded-xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-xs shadow-sm transition-all cursor-pointer flex items-center gap-1.5 active:scale-95 shrink-0",title:p?"点击登录学术账号":"Sign in to your account",children:[i.jsx(wc,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:p?"登录":"Sign In"})]})]})]}),i.jsxs("main",{className:"flex-1 w-full max-w-7xl mx-auto p-4 md:p-6 lg:p-8 flex flex-col justify-center",children:[i.jsxs("nav",{"aria-label":"Breadcrumbs",className:"mb-3 flex items-center gap-1.5 text-xs text-slate-500 dark:text-slate-400",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-600 dark:hover:text-emerald-400 hover:underline transition-colors",children:"radioshadow.space"}
4821),i.jsx(qn,{className:"w-3 h-3 text-slate-400"}),i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:"/ielts-speaking-mock-test"})]}),i.jsxs(Qo,{mode:"wait",children:[_==="scene1_intro"&&i.jsxs(cs.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.3},className:"grid grid-cols-1 lg:grid-cols-12 gap-6 items-center",children:[i.jsxs("div",{className:"lg:col-span-5 flex flex-col items-center",children:[i.jsxs("div",{className:`w-full relative mb-3 p-4 rounded-2xl shadow-xl border-2 transition-colors animate-fadeIn ${k?"bg-slate-900 text-slate-100 border-emerald-500/40":"bg-white text-slate-900 border-emerald-500/50 shadow-emerald-500/5"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-2.5 h-2.5 rounded-full bg-emerald-500 animate-pulse"}),i.jsx("span",{className:`text-xs font-bold tracking-wide ${k?"text-emerald-400":"text-emerald-900"}`,children:p?`主考官:${O.examinerPersona.name}`:`Examiner: ${O.examinerPersona.name}`})]}),le&&i.jsxs("div",{className:"flex items-center gap-1 text-[11px] font-mono text-emerald-600 dark:text-emerald-400",children:[i.jsx("span",{className:"w-1 h-3 bg-emerald-500 rounded animate-bounce"}),i.jsx("span",{className:"w-1 h-4 bg-emerald-500 rounded animate-bounce delay-75"}),i.jsx("span",{className:"w-1 h-2 bg-emerald-500 rounded animate-bounce delay-150"}),i.jsx("span",{children:"Speaking..."})]})]}),i.jsxs("p",{className:`text-sm md:text-base font-semibold leading-relaxed ${k?"text-slate-100":"text-slate-800"}`,children:['"',O.examinerPersona.greetingPattern,'"']}),Y&&i.jsx("p",{className:`text-xs mt-2 pt-2 border-t font-sans ${k?"text-slate-400 border-slate-800":"text-slate-500 border-slate-100"}`,children:U?"导师:您好,欢迎参加 1v1 西班牙语 DELE/SIELE 口语实战指导。请确认您的考生信息并简要介绍您的背景。":"考官:您好,欢迎参加雅思口语 1v1 全真模拟考试 (IELTS Speaking Mock Test)。请确认您的考生信息并简要介绍您的背景。"}),i.jsx("div",{className:`absolute -bottom-2.5 left-1/2 -translate-x-1/2 w-5 h-5 rotate-45 border-r-2 border-b-2 border-emerald-500/40 ${k?"bg-slate-900":"bg-white"}`})]}),i.jsxs("div",{className:`relative w-full max-w-sm aspect-[3/4] rounded-3xl overflow-hidden border-2 shadow-2xl group ${k?"border-slate-800 bg-slate-900":"border-slate-200 bg-white"}`,children:[i.jsx("img",{src:M.intro,alt:`${O.examinerPersona.name} Coach`,className:"w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-700",referrerPolicy:"no-referrer"}),i.jsx("div",{className:`absolute inset-0 bg-gradient-to-t via-transparent to-transparent pointer-events-none ${k?"from-slate-950/80":"from-slate-900/60"}`}),i.jsxs("div",{className:`absolute bottom-3 left-3 right-3 p-3 rounded-2xl backdrop-blur-md border flex items-center justify-between ${k?"bg-slate-900/80 border-slate-700/80 text-white":"bg-white/90 border-slate-200 text-slate-900"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs font-bold flex items-center gap-1.5",children:[i.jsx(sl,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:O.examinerPersona.name})]}),i.jsx("div",{className:`text-[10px] ${k?"text-slate-400":"text-slate-500"}`,children:O.examinerPersona.title})]}),i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-600 dark:text-emerald-300 text-[10px] font-bold border border-emerald-500/30",children:"ON AIR"})]})]})]}),i.jsx("div",{className:"lg:col-span-7 flex flex-col gap-4",children:i.jsxs("div",{className:`p-6 rounded-3xl border shadow-xl flex flex-col gap-5 transition-colors ${k?"bg-slate-900/90 border-slate-800":"bg-white border-slate-200 shadow-slate-200/50"}`,children:[i.jsxs("div",{className:`flex items-center justify-between pb-4 border-b ${k?"border-slate-800":"border-slate-200"}`,children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-emerald-500/10 border border-emerald-500/30 flex items-center justify-center text-emerald-500",children:i.jsx(wc,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:`text-base font-bold ${k?"text-white":"text-slate-900"}`,children:p?"学员信息核验与语种考标设定":"Learner Verification & Exam Framework Setup"}),i.jsx("p",{className:`text-xs ${k?"text-slate-400":"text-slate-500"}`,children:p?"请确认学员档案,并设定本次实战模拟的目标语种与讨论母题":"Please review your profile and target framework"})]})]}),i.jsx("span",{className:`px-2.5 py-1 rounded-xl text-xs font-mono font-bold border ${k?"bg-slate-800 text-slate-300 border-slate-700":"bg-slate-100 text-slate-700 border-slate-200"}`,children:U?"DELE C1 · 3 RONDAS":"PART 1 & 2 & 3"})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:`block text-xs font-semibold mb-1.5 ${k?"text-slate-400":"text-slate-600"}`,children:p?"目标语种与考试体系":"Target Language & Standard"}),i.jsx("select",{id:"ielts-language-select",value:D,onChange:tt=>
4821{const ft=tt.target.value;j(ft);const yt=Wf(ft),lt=cc[yt]||cc.English;lt&&lt.length>0&&(pe(lt[0]),H(lt[0].topic)),ft==="Spanish"?(se("DELE C1"),Z("España / Colombia")):se("7.5")},className:`w-full px-3.5 py-2.5 rounded-xl border text-sm font-semibold transition-colors focus:outline-none focus:border-emerald-500 cursor-pointer ${k?"bg-slate-950 border-slate-800 text-white":"bg-slate-50 border-slate-200 text-slate-900"}`,children:p?i.jsxs(i.Fragment,{children:[i.jsx("option",{value:"Spanish",children:"🇪🇸 西班牙语 Español (DELE / SIELE · 塞万提斯)"}),i.jsx("option",{value:"English",children:"🇬🇧 英语 English (IELTS Speaking · 雅思)"}),i.jsx("option",{value:"Japanese",children:"🇯🇵 日语 日本語 (JLPT N1 · NHK解説)"}),i.jsx("option",{value:"French",children:"🇫🇷 法语 Français (DALF C1 · 索邦/RFI)"}),i.jsx("option",{value:"German",children:"🇩🇪 德语 Deutsch (Goethe C1 · 歌德学院)"}),i.jsx("option",{value:"Chinese",children:"🇨🇳 中文普通话 Mandarin (HSK 6 · 国家语委)"})]}):i.jsxs(i.Fragment,{children:[i.jsx("option",{value:"Spanish",children:"🇪🇸 Spanish (DELE / SIELE · Cervantes Institute)"}),i.jsx("option",{value:"English",children:"🇬🇧 English (IELTS Speaking · British Council)"}),i.jsx("option",{value:"Japanese",children:"🇯🇵 Japanese (JLPT N1 · NHK News)"}),i.jsx("option",{value:"French",children:"🇫🇷 French (DALF C1 · Sorbonne / RFI)"}),i.jsx("option",{value:"German",children:"🇩🇪 German (Goethe C1 · Deutschlandfunk)"}),i.jsx("option",{value:"Chinese",children:"🇨🇳 Mandarin Chinese (HSK 6 Academic)"})]})})]}),i.jsxs("div",{children:[i.jsx("label",{className:`block text-xs font-semibold mb-1.5 ${k?"text-slate-400":"text-slate-600"}`,children:p?"考生姓名 / 称呼":"Candidate Full Name"}),i.jsx("input",{id:"ielts-candidate-name-input",type:"text",value:ee,onChange:tt=>ie(tt.target.value),placeholder:U?"Carlos Gómez":"Alex Chen",className:`w-full px-3.5 py-2.5 rounded-xl border text-sm font-semibold transition-colors focus:outline-none focus:border-emerald-500 ${k?"bg-slate-950 border-slate-800 text-white":"bg-slate-50 border-slate-200 text-slate-900"}`})]}),i.jsxs("div",{children:[i.jsx("label",{className:`block text-xs font-semibold mb-1.5 ${k?"text-slate-400":"text-slate-600"}`,children:p?"目标评级标准":"Target Proficiency Level"}),i.jsx("select",{id:"ielts-target-band-select",value:z,onChange:tt=>se(tt.target.value),className:`w-full px-3.5 py-2.5 rounded-xl border text-sm font-semibold transition-colors focus:outline-none focus:border-emerald-500 cursor-pointer ${k?"bg-slate-950 border-slate-800 text-white":"bg-slate-50 border-slate-200 text-slate-900"}`,children:U?i.jsxs(i.Fragment,{children:[i.jsx("option",{value:"DELE C1",children:p?"DELE C1 (有效运营熟练度 / 高级)":"DELE C1 (Effective Operational Proficiency)"}),i.jsx("option",{value:"DELE B2",children:p?"DELE B2 (中高级独立用户)":"DELE B2 (Independent Advanced User)"}),i.jsx("option",{value:"DELE C2",children:p?"DELE C2 (语言精通 / 母语母准)":"DELE C2 (Mastery / Native Proficiency)"})]}):i.jsxs(i.Fragment,{children:[i.jsx("option",{value:"6.5",children:"Band 6.5 (Competent User)"}),i.jsx("option",{value:"7.0",children:"Band 7.0 (Good User)"}),i.jsx("option",{value:"7.5",children:"Band 7.5 (High Good User)"}),i.jsx("option",{value:"8.0",children:"Band 8.0 (Very Good User)"}),i.jsx("option",{value:"8.5",children:"Band 8.5 (Expert User)"}),i.jsx("option",{value:"9.0",children:"Band 9.0 (Mastery)"})]})})]}),i.jsxs("div",{children:[i.jsx("label",{className:`block text-xs font-semibold mb-1.5 ${k?"text-slate-400":"text-slate-600"}`,children:p?"辩论讨论领域 (播客母题)":"Discussion Domain (Podcast Theme)"}),i.jsxs("select",{id:"ielts-topic-select",value:re,onChange:tt=>{H(tt.target.value);const ft=Wf(D),lt=(cc[ft]||cc.English).find(Ln=>Ln.topic===tt.target.value);lt?pe(lt):y&&tt.target.value===y&&pe({id:"url-topic-cuecard",language:"English",stationSource:"BBC World Service / Cambridge Academic",topic:y,snippet:`In this session, the candidate explores key perspectives on: "${y}". Focus on sustained coherence, lexical variety, and precise grammatical control.`,suggestedLexicon:["profound impact","formative years","role model","lasting impression","unwavering dedication"]})},className:`w-full px-3.5 py-2.5 rounded-xl border text-sm font-semibold transition-colors focus:outline-none focus:border-emerald-500 cursor-pointer ${k?"bg-slate-950 border-slate-800 text-white":"bg-slate-50 border-slate-200 text-slate-900"}`,children:[y&&!(cc[Wf(D)]||cc.English).some(tt=>tt.topic===y)&&i.jsxs("option",{value:y,children:[y," (Selected Practice Cue Card)"]}),(cc[Wf(D)]||cc.English).map(tt=>i.jsxs("option",{value:tt.topic,children:[tt.topic," (",tt.stationSource,")"]},tt.id))]})]})]}),i.jsxs("div",{className:`p-4 rounded-2xl border flex flex-col gap-2 transition-colors ${k?"bg-slate-950 border-slate-800/80":"bg-slate-50 border-slate-200"}`,children:[i.jsxs("div",{className:"flex items-center justify-between text-xs",children:[i.jsxs("span",{className:"font-bold text-emerald-500 dark:text-emerald-400 flex items-center gap-1.5",children:[i.jsx(cn,{className:"w-3.5 h-3.5 animate-pulse"}),i.jsxs("span",{children:["Source Grounding: ",Ie.stationSource]})]}),i.jsx("span",{className:`text-[10px] ${k?"text-slate-500":"text-slate-400"}`,children:Ie.topic})]}),i.jsxs("p",{className:`text-xs leading-relaxed italic line-clamp-2 ${k?"text-slate-300":"text-slate-600"}`,children:['"',Ie.snippet,'"']})]}
4821),!d&&i.jsxs("div",{className:"p-3.5 sm:p-4 rounded-2xl bg-amber-500/10 border border-amber-500/30 text-amber-800 dark:text-amber-200 flex flex-col sm:flex-row items-start sm:items-center justify-between gap-3 animate-fadeIn",children:[i.jsxs("div",{className:"flex items-start gap-2.5",children:[i.jsx(rl,{className:"w-4 h-4 text-amber-500 shrink-0 mt-0.5"}),i.jsxs("div",{className:"text-xs",children:[i.jsx("span",{className:"font-bold block",children:p?"雅思考生需先登录学术账号":"Authentication Required for IELTS Speaking Mock Test"}),i.jsx("span",{className:"text-slate-600 dark:text-slate-400 mt-0.5 block",children:p?"1v1 雅思全真模考涉及真实口语评分计算 (Band 5.0–9.0)、四维诊断报告与官方防伪证书沉淀,需登录后方可进入。":"Official IELTS mock test computes authentic band scores (5.0–9.0), diagnostic reports and certification. Please sign in to proceed."})]})]}),i.jsxs("button",{id:"ielts-banner-auth-btn",onClick:N,className:"px-4 py-2 rounded-xl bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 text-white font-bold text-xs shrink-0 cursor-pointer transition-all shadow-sm flex items-center gap-1.5 active:scale-95",children:[i.jsx(wc,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:p?"立即登录":"Sign In"})]})]}),$t==="not_started"?i.jsx("button",{id:"ielts-start-test-btn",onClick:yi,className:`w-full py-4 rounded-2xl text-white font-bold text-base shadow-xl flex items-center justify-center gap-2 cursor-pointer transition-all active:scale-[0.98] ${d?"bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 shadow-emerald-600/20":"bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 shadow-amber-500/20"}`,children:d?i.jsxs(i.Fragment,{children:[i.jsx(xi,{className:"w-5 h-5 fill-white"}),i.jsx("span",{children:p?"进入考场 · 开启雅思口语模考 (START IELTS TEST)":"START IELTS SPEAKING TEST"})]}):i.jsxs(i.Fragment,{children:[i.jsx(rl,{className:"w-5 h-5"}),i.jsx("span",{children:p?"登录学术账号开启雅思模考 (SIGN IN TO START)":"SIGN IN TO START IELTS TEST"})]})}):$t==="intro_speaking"?i.jsxs("div",{className:`p-4 rounded-2xl border flex items-center justify-center gap-3 text-sm font-semibold ${k?"bg-emerald-500/10 border-emerald-500/30 text-emerald-300":"bg-emerald-50 border-emerald-300 text-emerald-700"}`,children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin text-emerald-500"}),i.jsx("span",{children:p?"亚瑟考官正在朗读考场须知与热身问题...":"Dr. Arthur is introducing the test..."})]}):$t==="candidate_turn"?i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("div",{className:`p-3.5 rounded-2xl border text-xs flex items-center justify-between ${k?"bg-emerald-500/10 border-emerald-500/30 text-emerald-300":"bg-emerald-50 border-emerald-300 text-emerald-800"}`,children:[i.jsx("span",{children:p?"请介绍您的姓名与专业背景:":"Please state your name and background:"}),Ce&&i.jsxs("span",{className:"flex items-center gap-1 text-rose-500 font-mono font-bold",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-500 animate-ping"}),"Recording..."]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[Ce?i.jsxs("button",{id:"ielts-warmup-stop-btn",onClick:Ua,className:"flex-1 py-3.5 rounded-2xl bg-rose-600 hover:bg-rose-500 text-white font-bold text-sm flex items-center justify-center gap-2 cursor-pointer transition-all animate-pulse shadow-md",children:[i.jsx(Cy,{className:"w-4 h-4"}),i.jsx("span",{children:p?"完成作答 · 提交 (Done & Submit)":"Stop Recording"})]}):i.jsxs("button",{id:"ielts-warmup-record-btn",onClick:()=>wa("warmup"),className:"flex-1 py-3.5 rounded-2xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm flex items-center justify-center gap-2 cursor-pointer transition-all shadow-md",children:[i.jsx(Nn,{className:"w-4 h-4"}),i.jsx("span",{children:p?"点击麦克风回答 (Record Answer)":"Record Warm-up Answer"})]}),i.jsx("button",{id:"ielts-skip-warmup-btn",onClick:vr,className:`px-4 py-3.5 rounded-2xl text-xs font-semibold cursor-pointer border transition-all ${k?"bg-slate-800 hover:bg-slate-700 text-slate-300 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-700 border-slate-200"}`,children:p?"直接进入 Part 2":"Skip to Part 2"})]})]}):i.jsxs("div",{className:`p-4 rounded-2xl border text-sm font-bold flex items-center justify-center gap-2 ${k?"bg-emerald-500/20 border-emerald-500/40 text-emerald-200":"bg-emerald-50 border-emerald-300 text-emerald-800"}`,children:[i.jsx(vn,{className:"w-5 h-5 text-emerald-500"}),i.jsx("span",{children:p?"身份核验完成,正在进入 Part 2 话题卡...":"Identity Verified. Transitioning to Part 2..."})]})]})})]},"scene1"),_==="scene2_cuecard"&&i.jsxs(cs.div,{initial:{opacity:0,y:15}
4821,animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.3},className:"grid grid-cols-1 lg:grid-cols-12 gap-6 items-center",children:[i.jsxs("div",{className:"lg:col-span-5 flex flex-col items-center",children:[i.jsxs("div",{className:`w-full relative mb-3 p-4 rounded-2xl shadow-xl border-2 transition-colors animate-fadeIn ${k?"bg-slate-900 text-slate-100 border-emerald-500/40":"bg-white text-slate-900 border-emerald-500/50 shadow-emerald-500/5"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsx("span",{className:`text-xs font-bold tracking-wide ${k?"text-emerald-400":"text-emerald-900"}`,children:p?"考官:亚瑟·斯特林博士 (Dr. Arthur)":"Examiner: Dr. Arthur Sterling"}),le&&i.jsxs("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-ping"}),"Speaking..."]})]}),i.jsx("p",{className:`text-sm md:text-base font-semibold leading-relaxed ${k?"text-slate-100":"text-slate-800"}`,children:'"Now, here is your Part 2 Topic Card. You will have one minute to prepare, and you may take notes. Then you will speak for 1 to 2 minutes."'}),Y&&i.jsx("p",{className:`text-xs mt-2 pt-2 border-t font-sans ${k?"text-slate-400 border-slate-800":"text-slate-500 border-slate-100"}`,children:"考官:好,现在我们进行 Part 2。请看这个话题,您可以准备一分钟,右侧有草稿纸可以做笔记。准备结束后请作答 1 至 2 分钟。"}),i.jsx("div",{className:`absolute -bottom-2.5 left-1/2 -translate-x-1/2 w-5 h-5 rotate-45 border-r-2 border-b-2 border-emerald-500/40 ${k?"bg-slate-900":"bg-white"}`})]}),i.jsxs("div",{className:`relative w-full max-w-sm aspect-[3/4] rounded-3xl overflow-hidden border-2 shadow-2xl group ${k?"border-slate-800 bg-slate-900":"border-slate-200 bg-white"}`,children:[i.jsx("img",{src:M.cuecard,alt:`${O.examinerPersona.name} Holding Evaluation Rubric`,className:"w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-700",referrerPolicy:"no-referrer"}),i.jsx("div",{className:`absolute inset-0 bg-gradient-to-t via-transparent to-transparent pointer-events-none ${k?"from-slate-950/80":"from-slate-900/60"}`}),i.jsxs("div",{className:`absolute bottom-3 left-3 right-3 p-3 rounded-2xl backdrop-blur-md border flex items-center justify-between ${k?"bg-slate-900/80 border-slate-700/80 text-white":"bg-white/90 border-slate-200 text-slate-900"}`,children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold",children:p?"第 2 幕:Part 2 独立话题卡":"Scene 2: Part 2 Topic Card"}),i.jsx("div",{className:"text-[10px] text-emerald-500 dark:text-emerald-400",children:p?"1 分钟速记构思 • 2 分钟独白陈述":"1 Minute Prep • 2 Minute Monologue"})]}),i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-600 dark:text-emerald-300 text-[10px] font-bold border border-emerald-500/30",children:"TOPIC CUE CARD"})]})]})]}),i.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-4",children:[i.jsxs("div",{className:"relative p-6 rounded-3xl bg-amber-50 text-slate-900 shadow-2xl border-4 border-amber-900/20 font-serif",children:[i.jsx("div",{className:"absolute -top-3 left-1/2 -translate-x-1/2 w-28 h-6 bg-slate-400 border-2 border-slate-600 rounded-lg shadow-md flex items-center justify-center",children:i.jsx("div",{className:"w-12 h-2 bg-slate-700 rounded-full"})}),i.jsxs("div",{className:"text-center pb-3 mb-3 border-b-2 border-dashed border-amber-800/30",children:[i.jsx("span",{className:"text-[11px] font-mono font-bold tracking-widest text-amber-900 uppercase",children:"PART 2: TOPIC CARD"}),i.jsx("h3",{className:"text-base sm:text-lg font-bold text-amber-950 mt-1 font-sans",children:Mr.topicTitle})]}),i.jsx("div",{className:"text-xs sm:text-sm font-sans text-amber-900 mb-2 font-semibold",children:Mr.subTitle}),i.jsx("ul",{className:"space-y-1.5 mb-4 pl-2 font-sans text-xs sm:text-sm text-amber-950",children:Mr.bulletPoints.map((tt,ft)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"text-emerald-700 font-bold",children:"•"}),i.jsx("span",{children:tt})]},ft))}),i.jsxs("div",{className:"pt-3 border-t border-amber-800/20 flex items-center justify-between text-[11px] font-sans text-amber-800",children:[i.jsx("span",{children:"(You will have 1 minute to prepare)"}),i.jsx("span",{className:"font-bold font-mono",children:"ORAL COACHING FORMAT"})]})]}),i.jsxs("div",{className:`p-4 rounded-2xl border flex flex-col gap-2 transition-colors ${k?"bg-slate-900 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:`flex items-center justify-between text-xs font-semibold ${k?"text-slate-400":"text-slate-600"}`,children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-emerald-500",children:[i.jsx(_6,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:p?"考生速记草稿本 (Candidate Scratchpad)":"Candidate Notes Scratchpad"})]}),i.jsx("span",{className:`text-[10px] font-mono ${k?"text-slate-500":"text-slate-400"}`,children:"Auto-saved"})]}),i.jsx("textarea",{id:"ielts-scratchpad-input",rows:2,value:Fr,onChange:tt=>As(tt.target.value),placeholder:p?"可在备考期间快速记录 3-4 个关键词或论据支点...":"Jot down key points, collocations, or structure during 1-min prep...",className:`w-full p-2.5 rounded-xl border text-xs font-sans transition-colors resize-none focus:outline-none focus:border-emerald-500 ${k?"bg-slate-950 border-slate-800 text-slate-200":"bg-slate-50 border-slate-200 text-slate-900"}`})]}),i.jsxs("div",{className:`p-5 rounded-2xl border flex flex-col gap-4 transition-colors ${k?"bg-slate-900 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[!Ce&&!Ur&&i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"relative w-14 h-14 flex items-center justify-center",children:[i.jsxs("svg",{className:"w-full h-full -rotate-90",viewBox:"0 0 36 36",children:[i.jsx("path",{className:k?"text-slate-800":"text-slate-200",strokeWidth:"3",stroke:"currentColor",fill:"none",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"}),i.jsx("path",{className:"text-emerald-500 transition-all duration-1000",strokeDasharray:`${us/60*100}, 100`,strokeWidth:"3",strokeLinecap:"round",stroke:"currentColor",fill:"none",d:"M18 2.0845 a 15.9155 15.9155 0 0 1 0 31.831 a 15.9155 15.9155 0 0 1 0 -31.831"})]}),i.jsxs("span",{className:"absolute text-sm font-bold font-mono text-emerald-500 dark:text-emerald-400",children:[us,"s"]})]}),i.jsxs("div",{children:[i.jsx("div",{className:`text-xs font-bold ${k?"text-white":"text-slate-900"}`,children:Xi?p?"1分钟备考倒计时中...":"1-Minute Preparation Active":p?"准备好开始备考了吗?":"Ready to Prepare?"}),i.jsx("div",{className:`text-[11px] ${k?"text-slate-400":"text-slate-500"}`,children:p?"倒计时结束后将自动开启 2 分钟陈述":"Monologue starts automatically when timer ends"})]})]}),i.jsxs("div",{className:"flex items-center gap-2.5 w-full sm:w-auto",children:[Xi?null:i.jsxs("button",{id:"ielts-start-prep-btn",onClick:Kl,className:"flex-1 sm:flex-none px-4 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center justify-center gap-1.5 cursor-pointer shadow-md whitespace-nowrap",children:[i.jsx(Eo,{className:"w-4 h-4 shrink-0"}),i.jsx("span",{children:p?"开始备考":"Start Preparing"})]}),i.jsxs("button",{id:"ielts-skip-prep-btn",onClick:ai,className:`flex-1 sm:flex-none px-4 py-2.5 rounded-xl font-bold text-xs flex items-center justify-center gap-1.5 cursor-pointer border transition-all whitespace-nowrap ${k?"bg-slate-800 hover:bg-slate-700 text-slate-200 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-700 border-slate-200"}`,children:[i.jsx(xi,{className:"w-4 h-4 text-amber-500 shrink-0"}
4821),i.jsx("span",{children:p?"准备完毕 · 立即陈述":"Skip Preparation"})]})]})]}),Ce&&i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsxs("div",{className:`flex items-center justify-between p-3.5 rounded-xl border ${k?"bg-emerald-500/10 border-emerald-500/30":"bg-emerald-50 border-emerald-300"}`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"w-3 h-3 rounded-full bg-rose-500 animate-ping"}),i.jsx("span",{className:`text-xs font-bold ${k?"text-emerald-300":"text-emerald-800"}`,children:p?"Part 2 个人陈述录音中 (2-Minute Monologue)":"Part 2 Candidate Monologue Active"})]}),i.jsxs("div",{className:`text-xs font-mono font-bold px-2 py-1 rounded-lg border ${k?"bg-slate-950 text-white border-slate-800":"bg-white text-slate-900 border-slate-200"}`,children:[Math.floor(Qn/60),":",(Qn%60).toString().padStart(2,"0")," / 02:00"]})]}),i.jsxs("button",{id:"ielts-finish-part2-btn",onClick:qt,className:"w-full py-3.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm flex items-center justify-center gap-2 cursor-pointer shadow-xl transition-all",children:[i.jsx(Co,{className:"w-4 h-4"}),i.jsx("span",{children:p?"陈述完毕 · 进入 Part 3 深度追问":"Finish Monologue & Proceed to Part 3"})]})]}),je&&i.jsxs("div",{className:`p-4 rounded-xl flex items-center justify-center gap-3 text-xs font-semibold ${k?"bg-slate-950 text-emerald-400":"bg-slate-50 text-emerald-700 border border-slate-200"}`,children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin text-emerald-500"}),i.jsx("span",{children:p?"亚瑟考官正在记录您的陈述并生成 Part 3 辩论切入点...":"Dr. Arthur is transcribing your monologue..."})]})]})]})]},"scene2"),_==="scene3_followup"&&i.jsxs(cs.div,{initial:{opacity:0,y:15},animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.3},className:"grid grid-cols-1 lg:grid-cols-12 gap-6 items-center",children:[i.jsxs("div",{className:"lg:col-span-5 flex flex-col items-center",children:[i.jsxs("div",{className:`w-full relative mb-3 p-4 rounded-2xl shadow-xl border-2 transition-colors animate-fadeIn ${k?"bg-slate-900 text-slate-100 border-emerald-500/40":"bg-white text-slate-900 border-emerald-500/50 shadow-emerald-500/5"}`,children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5",children:[i.jsxs("span",{className:`text-xs font-bold tracking-wide flex items-center gap-1.5 ${k?"text-emerald-400":"text-emerald-900"}`,children:[i.jsx("span",{children:p?"考官:亚瑟·斯特林博士":"Examiner: Dr. Arthur Sterling"}),i.jsxs("span",{className:"px-1.5 py-0.2 rounded text-[9px] bg-emerald-500/20 text-emerald-600 dark:text-emerald-300 font-mono font-bold",children:["ROUND ",Bn,"/3"]})]}),le&&i.jsxs("span",{className:"text-[10px] font-mono font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-ping"}),"Speaking..."]})]}),fl?i.jsxs("div",{className:"py-3 flex flex-col items-center justify-center gap-2 text-center text-slate-500",children:[i.jsx(dbe,{className:"w-5 h-5 animate-pulse text-emerald-500"}),i.jsx("span",{className:"text-xs font-semibold",children:hs===1?p?"正在深度剖析广播母题张力点...":"Analyzing broadcast excerpt & tension points...":hs===2?p?"评估论证逻辑与反方切入视角...":"Evaluating argument premise & counter-perspectives...":p?"提炼 C1 阶梯追问...":"Synthesizing C1 debate inquiry..."})]}):i.jsxs(i.Fragment,{children:[i.jsxs("p",{className:`text-sm md:text-base font-semibold leading-relaxed font-sans ${k?"text-slate-100":"text-slate-800"}`,children:['"',(Pn==null?void 0:Pn.question)||"Looking at the broader societal implications, how would you evaluate the long-term trade-offs?",'"']}),Y&&i.jsx("p",{className:`text-xs mt-2 pt-2 border-t font-sans ${k?"text-slate-400 border-slate-800":"text-slate-500 border-slate-100"}`,children:"考官:从更深层的社会维度来看,您如何权衡这其中的长远利弊?"})]}),i.jsx("div",{className:`absolute -bottom-2.5 left-1/2 -translate-x-1/2 w-5 h-5 rotate-45 border-r-2 border-b-2 border-emerald-500/40 ${k?"bg-slate-900":"bg-white"}`})]}),i.jsxs("div",{className:`relative w-full max-w-sm aspect-[3/4] rounded-3xl overflow-hidden border-2 shadow-2xl group ${k?"border-slate-800 bg-slate-900":"border-slate-200 bg-white"}`,children:[i.jsx("img",{src:M.dialogue,alt:`${O.examinerPersona.name} Oral Examination Discussion`,className:"w-full h-full object-cover object-center group-hover:scale-105 transition-transform duration-700",referrerPolicy:"no-referrer"}),i.jsx("div",{className:`absolute inset-0 bg-gradient-to-t via-trans
4821parent to-transparent pointer-events-none ${k?"from-slate-950/80":"from-slate-900/60"}`}),i.jsxs("div",{className:`absolute bottom-3 left-3 right-3 p-3 rounded-2xl backdrop-blur-md border flex items-center justify-between ${k?"bg-slate-900/80 border-slate-700/80 text-white":"bg-white/90 border-slate-200 text-slate-900"}`,children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold",children:p?"第 3 幕:Part 3 深度互动辩论":"Scene 3: Part 3 Follow-up"}),i.jsx("div",{className:"text-[10px] text-emerald-500 dark:text-emerald-400",children:p?"C1 高阶学术辩论与追问":"C1 Academic Discussion & Debate"})]}),i.jsx("span",{className:"px-2 py-0.5 rounded-full bg-emerald-500/20 text-emerald-600 dark:text-emerald-300 text-[10px] font-bold border border-emerald-500/30",children:"LIVE INQUIRY"})]})]})]}),i.jsx("div",{className:"lg:col-span-7 flex flex-col gap-4",children:i.jsxs("div",{className:`p-6 rounded-3xl border shadow-xl flex flex-col gap-5 transition-colors ${k?"bg-slate-900/90 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:`flex items-center justify-between pb-3 border-b ${k?"border-slate-800":"border-slate-200"}`,children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[11px] font-mono font-bold text-emerald-500 dark:text-emerald-400",children:(Pn==null?void 0:Pn.roundTitle)||"Academic Inquiry"}),i.jsx("h3",{className:`text-base font-bold mt-0.5 ${k?"text-white":"text-slate-900"}`,children:(Pn==null?void 0:Pn.roundObjective)||"Evaluate abstract counterpoints & societal impact"})]}),i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${Bn>=1?"bg-emerald-500":k?"bg-slate-700":"bg-slate-300"}`}),i.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${Bn>=2?"bg-emerald-500":k?"bg-slate-700":"bg-slate-300"}`}),i.jsx("div",{className:`w-2.5 h-2.5 rounded-full ${Bn>=3?"bg-emerald-500":k?"bg-slate-700":"bg-slate-300"}`})]})]}),ge>0&&i.jsxs("div",{className:`p-3 rounded-xl border flex items-center justify-between text-xs animate-fadeIn ${k?"bg-emerald-500/10 border-emerald-500/30 text-emerald-300":"bg-emerald-50 border-emerald-300 text-emerald-800"}`,children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Eo,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:p?`策略构思倒计时: ${ge} 秒`:`Preparation time remaining: ${ge}s`})]}),i.jsx("button",{onClick:()=>et(0),className:"px-2.5 py-1 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white text-[11px] font-bold cursor-pointer",children:p?"跳过 · 立即作答":"Ready to Speak"})]}),(Pn==null?void 0:Pn.examinerTip)&&i.jsxs("div",{className:`p-3 rounded-xl border text-xs flex items-start gap-2 ${k?"bg-amber-500/10 border-amber-500/20 text-amber-300":"bg-amber-50 border-amber-300 text-amber-900"}`,children:[i.jsx(wv,{className:"w-4 h-4 text-amber-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("span",{className:"font-bold mr-1",children:p?"考官提分锦囊:":"Examiner Scoring Tip:"}),i.jsx("span",{children:Pn.examinerTip})]})]}),i.jsx("div",{className:`p-5 rounded-2xl border flex flex-col items-center justify-center gap-4 transition-colors ${k?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:Ce?i.jsxs("div",{className:"flex flex-col items-center gap-3",children:[i.jsxs("div",{className:"flex items-center gap-1.5 h-10",children:[i.jsx("span",{className:"w-1.5 h-6 bg-emerald-500 rounded-full animate-bounce"}),i.jsx("span",{className:"w-1.5 h-10 bg-emerald-400 rounded-full animate-bounce delay-75"}),i.jsx("span",{className:"w-1.5 h-8 bg-emerald-500 rounded-full animate-bounce delay-150"}),i.jsx("span",{className:"w-1.5 h-4 bg-emerald-600 rounded-full animate-bounce delay-100"}),i.jsx("span",{className:"w-1.5 h-9 bg-emerald-400 rounded-full animate-bounce delay-200"}),i.jsx("span",{className:"w-1.5 h-7 bg-emerald-500 rounded-full animate-bounce delay-75"})]}),i.jsxs("button",{id:"ielts-stop-recording-btn",onClick:Ua,className:"px-6 py-3.5 rounded-2xl bg-rose-600 hover:bg-rose-500 text-white font-bold text-sm flex items-center gap-2 cursor-pointer shadow-lg animate-pulse",children:[i.jsx(Cy,{className:"w-4 h-4"}),i.jsx("span",{children:p?"完成作答 · 提交 (Done & Submit)":"Stop Recording & Submit"})]})]}):je?i.jsxs("div",{className:"flex items-center gap-3 text-xs font-semibold text-emerald-500 py-3",children:[i.jsx(Bs,{className:"w-4 h-4 animate-spin text-emerald-500"}),i.jsx("span",{children:p?"正在转录并评估您的作答...":"Transcribing your response..."})]}):i.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[i.jsxs("button",{id:"ielts-start-recording-btn",onClick:()=>wa("part3"),className:"w-full max-w-md py-4 rounded-2xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-sm flex items-center justify-center gap-2 cursor-pointer shadow-xl active:scale-98 transition-all",children:[i.jsx(Nn,{className:"w-5 h-5"}),i.jsx("span",{children:p?"点击麦克风作答 (START RECORDING)":"START RECORDING"})]}),i.jsx("span",{className:`text-[11px] ${k?"text-slate-500":"text-slate-400"}`,children:p?"点击上方麦克风开始录音,作答完毕点击提交":"Click button to start recording your response"})]})}),i.jsxs("div",{className:"flex items-center justify-between pt-2",children:[i.jsxs("span",{className:`text-xs font-mono ${k?"text-slate-500":"text-slate-400"}`,children:["Completed Turns: ",si.length,"/3"]}),i.jsxs("button",{id:"ielts-instant-feedback-btn",onClick:()=>lr(si),disabled:si.length===0,className:`px-4 py-2 rounded-xl disabled:opacity-40 text-xs font-bold cursor-pointer transition-all border flex items-center gap-1.5 ${k?"bg-slate-800 hover:bg-slate-700 text-slate-200 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-700 border-slate-200"}`,children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:p?"生成全维成绩单 (GIVE FEEDBACK)":"GIVE FEEDBACK (AI)"})]})]})]})})]},"scene3"),_==="scene4_report"&&i.jsxs(cs.div,{initial:{opacity:0,y:15}
4821,animate:{opacity:1,y:0},exit:{opacity:0,y:-15},transition:{duration:.3},className:"flex flex-col gap-6",children:[i.jsxs("div",{className:`p-6 md:p-8 rounded-3xl border shadow-2xl grid grid-cols-1 md:grid-cols-12 gap-6 items-center transition-colors ${k?"bg-slate-900 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsx("div",{className:"md:col-span-4 flex flex-col items-center",children:i.jsxs("div",{className:`relative w-full max-w-[240px] aspect-[3/4] rounded-2xl overflow-hidden border-2 shadow-xl ${k?"border-slate-700":"border-slate-200"}`,children:[i.jsx("img",{src:M.report,alt:`${O.examinerPersona.name} Presenting Official Evaluation`,className:"w-full h-full object-cover",referrerPolicy:"no-referrer"}),i.jsx("div",{className:`absolute inset-0 bg-gradient-to-t via-transparent to-transparent ${k?"from-slate-950/80":"from-slate-900/60"}`}),i.jsx("div",{className:`absolute bottom-2 left-2 right-2 p-2 rounded-xl backdrop-blur-md text-center ${k?"bg-slate-900/80":"bg-white/90"}`,children:i.jsx("div",{className:"text-xs font-bold text-emerald-600 dark:text-emerald-400",children:"OFFICIAL CERTIFICATION"})})]})}),i.jsxs("div",{className:"md:col-span-8 flex flex-col gap-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-8 h-8 rounded-xl bg-emerald-500/20 text-emerald-500 flex items-center justify-center font-bold text-sm",children:i.jsx(yn,{className:"w-5 h-5"})}),i.jsxs("div",{children:[i.jsx("h2",{className:`text-xl font-extrabold ${k?"text-white":"text-slate-900"}`,children:U?"Certificado Oficial de Evaluación Oral DELE C1":p?"纯正口语实战能力鉴定单 (TRF)":"Spoken Fluency Test Report Form (TRF)"}),i.jsxs("p",{className:`text-xs ${k?"text-slate-400":"text-slate-500"}`,children:["Candidate: ",ee," • Assessed by ",((pn=ht==null?void 0:ht.examinerPersona)==null?void 0:pn.name)||O.examinerPersona.name," (",(ht==null?void 0:ht.frameworkName)||O.frameworkName,")"]})]})]}),i.jsx("span",{className:"px-3 py-1 rounded-full bg-emerald-500/20 text-emerald-600 dark:text-emerald-300 text-xs font-bold border border-emerald-500/30",children:(ht==null?void 0:ht.cefrLevel)||(U?"DELE C1":"C1 Advanced")})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3",children:[i.jsxs("div",{className:`p-4 rounded-2xl border text-center transition-colors ${k?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsx("span",{className:`text-[10px] font-mono uppercase ${k?"text-slate-400":"text-slate-500"}`,children:p?"总成绩":"Overall Band"}),i.jsx("div",{className:"text-3xl font-extrabold text-emerald-500 dark:text-emerald-400 mt-0.5",children:(ht==null?void 0:ht.overallBand)||"7.5"}),i.jsx("span",{className:`text-[10px] ${k?"text-slate-500":"text-slate-400"}`,children:"CEFR Standard"})]}),i.jsxs("div",{className:`p-4 rounded-2xl border text-center transition-colors ${k?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsx("span",{className:`text-[10px] font-mono uppercase ${k?"text-slate-400":"text-slate-500"}`,children:p?"流利度与连贯性":"Fluency & Coherence"}),i.jsxs("div",{className:`text-2xl font-bold mt-1 ${k?"text-white":"text-slate-900"}`,children:[((Bi=ht==null?void 0:ht.scores)==null?void 0:Bi.fluencyAndCoherence)||82,"%"]}),i.jsx("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-semibold",children:"Band 7.5+"})]}),i.jsxs("div",{className:`p-4 rounded-2xl border text-center transition-colors ${k?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsx("span",{className:`text-[10px] font-mono uppercase ${k?"text-slate-400":"text-slate-500"}`,children:p?"词汇丰富度":"Lexical Resource"}),i.jsxs("div",{className:`text-2xl font-bold mt-1 ${k?"text-white":"text-slate-900"}`,children:[((Ca=ht==null?void 0:ht.scores)==null?void 0:Ca.lexicalResource)||78,"%"]}),i.jsx("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-semibold",children:"C1 Academic"})]}),i.jsxs("div",{className:`p-4 rounded-2xl border text-center transition-colors ${k?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsx("span",{className:`text-[10px] font-mono uppercase ${k?"text-slate-400":"text-slate-500"}`,children:p?"语法多样性":"Grammar Range"}),i.jsxs("div",{className:`text-2xl font-bold mt-1 ${k?"text-white":"text-slate-900"}
4821`,children:[((wi=ht==null?void 0:ht.scores)==null?void 0:wi.grammaticalAccuracy)||76,"%"]}),i.jsx("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 font-semibold",children:"Accurate"})]})]}),i.jsxs("div",{className:`p-4 rounded-2xl border flex flex-col gap-1.5 transition-colors ${k?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsxs("span",{className:"text-xs font-bold text-emerald-600 dark:text-emerald-400 flex items-center gap-1.5",children:[i.jsx(W2,{className:"w-3.5 h-3.5"}),i.jsxs("span",{children:[((Br=ht==null?void 0:ht.examinerPersona)==null?void 0:Br.name)||O.examinerPersona.name,p?" 官方专业综评:":" Official Diagnostic Assessment:"]})]}),i.jsxs("p",{className:`text-xs leading-relaxed font-sans ${k?"text-slate-300":"text-slate-700"}`,children:['"',(ht==null?void 0:ht.examinerSummary)||(U?"Excelente solidez comunicativa y rigor argumentativo en los temas socioeconómicos presentados. Mejorar la alternancia del modo subjuntivo y el contraste vibrante r/rr asegurará la excelencia en DELE C1.":"Solid oral communication with commendable topical coherence throughout all stages."),'"']})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6",children:[i.jsxs("div",{className:`lg:col-span-5 p-6 rounded-3xl border flex flex-col gap-4 transition-colors ${k?"bg-slate-900 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:`text-sm font-bold flex items-center gap-2 ${k?"text-white":"text-slate-900"}`,children:[i.jsx(xi,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:p?"声学与语言学雷达维度":"Acoustic & Linguistic Radar"})]}),i.jsxs("span",{className:`text-[10px] font-mono ${k?"text-slate-500":"text-slate-400"}`,children:[((eo=ht==null?void 0:ht.radarMetrics)==null?void 0:eo.length)||5," Dimensions"]})]}),i.jsx("div",{className:"h-64 w-full",children:i.jsx(Nv,{width:"100%",height:"100%",children:i.jsxs(zv,{data:((ht==null?void 0:ht.radarMetrics)||O.radarMetrics).map(tt=>p?{...tt,metric:{"Fluidez y Ritmo Silábico":"音节流利与节奏","Riqueza Léxica DELE C1":"DELE C1 词汇","Precisión Gramatical & Subjuntivo":"语法与虚拟式","Fonética y Vibrantes (r/rr)":"西语颤音(r/rr)","Argumentación Crítica":"批判性论证","Fluency & Coherence":"流利与连贯","Lexical Resource":"词汇丰富度","Grammar & Syntactic Range":"语法多样性","Pronunciation & Acoustics":"发音声学面貌","Critical Argumentation":"论证深度"}[tt.metric]||tt.metric}:tt),children:[i.jsx(lx,{stroke:k?"#334155":"#e2e8f0"}),i.jsx(cx,{dataKey:"metric",stroke:k?"#94a3b8":"#64748b",tick:{fill:k?"#94a3b8":"#475569",fontSize:10}}),i.jsx(_P,{angle:30,domain:[0,100],stroke:k?"#475569":"#cbd5e1"}),i.jsx(ux,{name:"Candidate",dataKey:"value",stroke:"#10b981",fill:"#10b981",fillOpacity:.4})]})})})]}),i.jsxs("div",{className:`lg:col-span-7 p-6 rounded-3xl border flex flex-col gap-4 transition-colors ${k?"bg-slate-900 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h3",{className:`text-sm font-bold flex items-center gap-2 ${k?"text-white":"text-slate-900"}`,children:[i.jsx(_6,{className:"w-4 h-4 text-rose-500"}),i.jsx("span",{children:p?"现场语法显微精修 (错误定位与地道重构)":"Grammar Micro-Surgery (Live Errors & Fixes)"})]}),i.jsx("span",{className:`text-[10px] font-mono ${k?"text-slate-500":"text-slate-400"}`,children:"C1 Native Refinements"})]}),i.jsx("div",{className:"space-y-3 max-h-72 overflow-y-auto pr-1",children:((Yl=ht==null?void 0:ht.grammarCritique)!=null&&Yl.length?ht.grammarCritique:[{original:"The government should to invest more in clean grid.",issue:"Incorrect bare infinitive with modal auxiliary 'should'.",correction:"The government ought to allocate substantive capital into grid infrastructure.",ruleExplanation:"Modals take base form without 'to'."},{original:"Many people is worrying about this inflation.",issue:"Subject-verb agreement mismatch with plural noun 'people'.",correction:"A vast majority of the citizenry is deeply apprehensive about escalating inflationary pressures.",ruleExplanation:"'People' takes plural verb, or rephrase with collective noun."}]).map((tt,ft)=>i.jsxs("div",{className:`p-3.5 rounded-2xl border flex flex-col gap-1.5 text-xs transition-colors ${k?"bg-slate-950 border-slate-800/80":"bg-slate-50 border-slate-200"}`,children:[i.jsxs("div",{className:"text-rose-500 line-through",children:['"',tt.original,'"']}),i.jsxs("div",{className:"text-emerald-600 dark:text-emerald-400 font-semibold font-sans",children:['✓ "',tt.correction,'"']}),i.jsxs("div",{className:`text-[11px] italic mt-0.5 ${k?"text-slate-400":"text-slate-500"}`,children:["Note: ",tt.issue]})]},ft))})]})]}),i.jsxs("div",{className:`p-6 rounded-3xl border flex flex-col sm:flex-row items-center justify-between gap-4 transition-colors ${k?"bg-slate-900 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:`text-xs ${k?"text-slate-400":"text-slate-500"}`,children:["Examination record timestamp: ",new Date().toLocaleDateString()," • Certificate ID: RS-",Math.random().toString(36).substring(2,8).toUpperCase()]}),i.jsxs("div",{className:"flex items-center gap-3 w-full sm:w-auto flex-wrap sm:flex-nowrap",children:[i.jsxs("button",{id:"ielts-export-certificate-btn",onClick:Vr,disabled:W,className:"flex-1 sm:flex-none px-5 py-3 rounded-2xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-xs flex items-center justify-center gap-2 cursor-pointer shadow-lg transition-all",children:[W?i.jsx(Bs,{className:"w-4 h-4 animate-spin"}):i.jsx(hS,{className:"w-4 h-4"}),i.jsx("span",{children:J?p?"✓ 证书已生成并下载":"✓ Certificate Downloaded":p?"下载官方防伪证书 (PNG/PDF)":"Download Official Certificate"})]}),i.jsxs("button",{id:"ielts-retake-new-topic-btn",onClick:vi,className:"flex-1 sm:flex-none px-5 py-3 rounded-2xl bg-emerald-700 hover:bg-emerald-600 text-white font-bold text-xs flex items-center justify-center gap-2 cursor-pointer shadow-md transition-all",children:[i.jsx(yg,{className:"w-4 h-4"}),i.jsx("span",{children:p?"模拟下一个话题":"Retake Another Topic"})]}),i.jsxs("button",{id:"ielts-return-home-btn",onClick:()=>{n?n():window.location.href="/"},className:`flex-1 sm:flex-none px-5 py-3 rounded-2xl font-bold text-xs flex items-center justify-center gap-2 cursor-pointer border transition-all ${k?"bg-slate-800 hover:bg-slate-700 text-slate-200 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-slate-700 border-slate-200"}`,children:[i.jsx(Rm,{className:"w-4 h-4"}),i.jsx("span",{children:p?"返回广播主页":"Return to Radio"})]})]})]})]},"scene4")]}),i.jsxs("section",{"aria-labelledby":"ielts-speaking-guide-heading",className:"mt-10 mb-6 pt-8 border-t border-slate-200 dark:border-slate-800",children:[i.jsx("div",{className:"mb-4",children:i.jsx("h1",{className:"text-xl sm:text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"IELTS Speaking Practice with an AI Examiner"})}),i.jsxs("div",{className:"rounded-2xl border border-slate-200 dark:border-slate-800 bg-white/70 dark:bg-slate-900/65 p-5 md:p-6 backdrop-blur-sm shadow-xs",children:[i.jsx("h2",{id:"ielts-speaking-guide-heading",className:"text-lg md:text-xl font-bold tracking-tight text-slate-900 dark:text-white mb-4",children:"IELTS Speaking: Parts, Scoring & Sample Questions"}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-4 text-sm",children:[i.jsxs("div",{className:"p-4 rounded-xl bg-slate-50/80 dark:bg-slate-800/50 border border-slate-200/70 dark:border-slate-700/60 flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-slate-100 mb-1.5 flex items-center gap-2",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-emerald-500 inline-block"}),"Part 1: Introduction & Interview"]}
4821),i.jsx("p",{className:"leading-relaxed text-slate-600 dark:text-slate-400 mb-3",children:"Warm up with friendly, everyday questions about your home, hobbies, studies, or daily routine. This 4 to 5-minute conversation helps you settle into the test and find your natural rhythm. Aim for smooth, spontaneous answers with a quick personal example."})]}),i.jsxs("a",{href:"/ielts-speaking-part-1-topics",className:"text-xs font-semibold text-emerald-600 dark:text-emerald-400 hover:underline inline-flex items-center gap-1",children:[i.jsx("span",{children:"View 15 Common Part 1 Topics & Questions"}),i.jsx("span",{"aria-hidden":"true",children:"→"})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-50/80 dark:bg-slate-800/50 border border-slate-200/70 dark:border-slate-700/60 flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-slate-100 mb-1.5 flex items-center gap-2",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-blue-500 inline-block"}),"Part 2: Cue Card (Long Turn)"]}),i.jsx("p",{className:"leading-relaxed text-slate-600 dark:text-slate-400 mb-3",children:"Pick up your prompt card and take 1 minute to plan out your talking points before speaking for up to 2 minutes. This part showcases your fluency, storytelling ability, and descriptive vocabulary without examiner interruptions. Structure your talk clearly to cover every prompt point."})]}),i.jsxs("a",{href:"/ielts-speaking-part-2-topics",className:"text-xs font-semibold text-blue-600 dark:text-blue-400 hover:underline inline-flex items-center gap-1",children:[i.jsx("span",{children:"View 14 Popular Part 2 Cue Cards"}),i.jsx("span",{"aria-hidden":"true",children:"→"})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-50/80 dark:bg-slate-800/50 border border-slate-200/70 dark:border-slate-700/60 flex flex-col justify-between",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"font-semibold text-slate-900 dark:text-slate-100 mb-1.5 flex items-center gap-2",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-indigo-500 inline-block"}),"Part 3: Discussion & Follow-up Questions"]}),i.jsx("p",{className:"leading-relaxed text-slate-600 dark:text-slate-400 mb-3",children:"Explore more complex, abstract topics related to your cue card over a 4 to 5-minute interactive discussion. Here, the examiner assesses how effectively you justify opinions, analyze trends, and weigh different perspectives. Elaborate thoughtfully with cohesive linking phrases and varied expressions."})]}),i.jsxs("a",{href:"/ielts-speaking-part-3-topics",className:"text-xs font-semibold text-indigo-600 dark:text-indigo-400 hover:underline inline-flex items-center gap-1",children:[i.jsx("span",{children:"View 14 High-Yield Part 3 Discussion Topics"}),i.jsx("span",{"aria-hidden":"true",children:"→"})]})]})]})]})]})]}),i.jsx(E6e,{isOpen:E,onClose:T,title:p?"登录学术账号开启雅思模考":"Sign in to Start IELTS Speaking Mock Test",subtitle:p?"登录后方可记录口语流利度、生成四维官方评估报告及防伪证书":"Sign in to record spoken fluency, calculate official band scores and generate diagnostic reports"})]})}const c$={1:{part:1,titleTag:"IELTS Speaking Part 1 Topics & Questions | RadioShadow",h1:"IELTS Speaking Part 1 Topics & Questions",intro:"IELTS Speaking Part 1 is a relaxed, friendly conversation where the examiner asks about your life, habits, and familiar interests. Review these essential topics and sample questions to practice building quick, natural answers before your test.",buttonText:"Practice Part 1 with an AI Examiner",badge:"Part 1 • 4–5 Mins • Everyday Life & Hobbies",topics:[{id:"p1-1",topicTitle:"Work & Studies",questions:["What do you do for work or study?","Why did you choose this field or career path?","What do you find most interesting or challenging about it?","Do you plan to stay in the same industry in the near future?"]},{id:"p1-2",topicTitle:"Hometown & Neighborhood",questions:["Where is your hometown located?","What do you like most about living in y
4821our hometown?","Has your hometown changed much over the past few years?","Would you prefer to live there in the future or move somewhere else?"]},{id:"p1-3",topicTitle:"Accommodation & Living Space",questions:["Do you live in a house or an apartment?","Which room in your home do you spend the most time in?","What is your favorite feature of your living space?","What would your dream home look like?"]},{id:"p1-4",topicTitle:"Daily Routines & Time Management",questions:["What does your typical morning routine look like?","Are your weekdays very different from your weekends?","Do you consider yourself a morning person or a night owl?","How do you usually organize your tasks when you have a busy day?"]},{id:"p1-5",topicTitle:"Hobbies & Leisure Activities",questions:["What do you enjoy doing during your free time?","Did you have the same hobbies when you were a child?","Do you prefer outdoor activities or relaxing indoors?","Is there a new hobby or craft you would love to try soon?"]},{id:"p1-6",topicTitle:"Food, Cooking & Dining Out",questions:["What is your favorite kind of food?","Do you enjoy cooking meals at home or eating out at restaurants?","What traditional dish from your country would you recommend to a visitor?","How have your food preferences changed as you have grown older?"]},{id:"p1-7",topicTitle:"Music & Podcasts",questions:["What genre of music do you listen to most frequently?","Do you like listening to music while studying, exercising, or working?","Have you ever attended a live music concert or festival?","Can you play any musical instruments, or would you like to learn one?"]},{id:"p1-8",topicTitle:"Weather, Seasons & Climate",questions:["What is your favorite season of the year, and why?","Does rainy or cloudy weather affect your mood or daily schedule?","What kind of outdoor activities do you like doing in sunny weather?","Has the weather in your area become more unpredictable lately?"]},{id:"p1-9",topicTitle:"Travel & Vacations",questions:["Do you prefer traveling alone or with family and friends?","What was the most memorable place or city you have ever visited?","What do you usually look for when choosing a travel destination?","Where would you like to go on your next holiday?"]},{id:"p1-10",topicTitle:"Technology & Smartphone Apps",questions:["Which smartphone app do you use most frequently every day?","How has mobile technology changed the way you communicate with others?","Do you find it easy or difficult to adapt to new gadgets and apps?","Have you ever tried taking a digital detox away from screens?"]},{id:"p1-11",topicTitle:"Sports & Physical Exercise",questions:["Do you play any sports or work out regularly?","What sport is most popular to watch or play in your country?","Did you do more physical exercise when you were in school?","Why is maintaining a regular fitness habit important to you?"]},{id:"p1-12",topicTitle:"Reading & Books",questions:["Do you prefer reading physical printed books or e-books?","What kinds of books or articles do you find most interesting?","Did your parents or teachers read stories to you when you were young?","Do you read mainly for entertainment or to acquire new knowledge?"]},{id:"p1-13",topicTitle:"Friends & Socializing",questions:["How often do you meet up or hang out with your closest friends?","Do you prefer having a few close friends or a large social circle?","What qualities do you value most in a true friend?","Do you find it easier to make new friends now compared to childhood?"]},{id:"p1-14",topicTitle:"Photography & Visual Memories",questions:["Do you enjoy taking photos with your smartphone camera?","What kind of moments or scenery do you photograph most often?","How do you organize and store your digital photos?","Do you prefer keeping physical photo albums or digital galleries?"]},{id:"p1-15",topicTitle:"Colors & Personal Style",questions:["What is your favorite color, and has it changed since you were young?","Do you think different colors can influence a person's mood?","What colors do you most frequently choose when shopping for clothes?","Are there certain colors you avoid wearing?"]}]},2:{part:2,titleTag:"IELTS Speaking Part 2 Topics & Cue Cards | RadioSh
4821adow",h1:"IELTS Speaking Part 2 Topics & Cue Cards",intro:"In IELTS Speaking Part 2, you are given a cue card and 1 minute of preparation before speaking uninterrupted for up to 2 minutes. Explore these popular cue card prompts, structure your bullet points, and practice delivering cohesive long turns.",buttonText:"Practice Part 2 with an AI Examiner",badge:"Part 2 • 3–4 Mins • Individual Long Turn (Cue Card)",topics:[{id:"p2-1",topicTitle:"Describe a person who has strongly influenced your life",subheading:"Cue Card Prompt: Role Model or Mentor",questions:["Who this person is and how you first met them","What distinctive traits or accomplishments make them special","How they supported or guided you in a critical moment","Explain why their influence has had such a lasting impact on your life"]},{id:"p2-2",topicTitle:"Describe a memorable journey or trip you took",subheading:"Cue Card Prompt: Travel Experience",questions:["Where you went and who accompanied you","What mode of transport you used to reach the destination","What unexpected or exciting events happened along the way","Explain why this particular journey remains so unforgettable to you"]},{id:"p2-3",topicTitle:"Describe a useful skill you learned recently",subheading:"Cue Card Prompt: Practical Ability",questions:["What the skill is and why you decided to learn it","How and from whom you learned this skill","What difficulties you encountered while practicing it","Explain how mastering this skill has benefited your daily life or work"]},{id:"p2-4",topicTitle:"Describe a book, film, or documentary that left a deep impression",subheading:"Cue Card Prompt: Media & Storytelling",questions:["What the book or movie was about","When and where you first read or watched it","Which character, scene, or message moved you the most","Explain why it created such a profound impression on your thinking"]},{id:"p2-5",topicTitle:"Describe an environmentally friendly habit or initiative you support",subheading:"Cue Card Prompt: Sustainable Living",questions:["What the eco-friendly habit or initiative involves","When and how you first became aware of it","How easy or difficult it is to maintain in your routine","Explain why you believe this practice helps protect our environment"]},{id:"p2-6",topicTitle:"Describe an exciting piece of technology you use regularly",subheading:"Cue Card Prompt: Digital Innovation",questions:["What the device, software, or app is","How often and for what purposes you use it","What key features set it apart from alternatives","Explain whether you feel it has simplified or complicated your daily routine"]},{id:"p2-7",topicTitle:"Describe a traditional festival or cultural celebration you enjoy",subheading:"Cue Card Prompt: Cultural Heritage",questions:["What the festival is and when it takes place","What special activities, rituals, or food are involved","Who you typically celebrate this occasion with","Explain why this celebration holds special cultural significance for you"]},{id:"p2-8",topicTitle:"Describe a difficult decision that took you a long time to make",subheading:"Cue Card Prompt: Life Crossroads",questions:["What the decision was about and what options you had","Why it was such a challenging choice to resolve","Whether you asked friends, family, or mentors for guidance","Explain how you felt after making the choice and whether you are glad with the outcome"]},{id:"p2-9",topicTitle:"Describe a quiet place you enjoy visiting to relax or focus",subheading:"Cue Card Prompt: Personal Sanctuary",questions:["Where this place is located and how you discovered it","How often you go there and what the atmosphere feels like","What you usually do while spending time in this place","Explain why this environment helps you recharge your energy or concentrate"]},{id:"p2-10",topicTitle:"Describe a piece of good advice you received from someone",subheading:"Cue Card Prompt: Wisdom & Mentorship",questions:["Who offered you the advice and what the situation was","What the advice specifically recommended you should or shouldn't do","How you responded or applied the guidance","Explain how following this advice positively impacted your life or perspective"]},{id:"p2-11",topicTitle:"Describe an ambitious goal you want to achieve in the future",subheading:"Cue 
4821Card Prompt: Future Aspirations",questions:["What the specific goal or milestone is","When you first decided to pursue this ambition","What concrete steps or preparations you need to complete","Explain why achieving this goal is personally meaningful to you"]},{id:"p2-12",topicTitle:"Describe an interesting historical building or architectural landmark",subheading:"Cue Card Prompt: History & Architecture",questions:["Where the building is situated and what it looks like","When you visited it and what you did there","What historical events or significance are associated with it","Explain why you find this historical landmark so fascinating"]},{id:"p2-13",topicTitle:"Describe an occasion when you helped someone or received unexpected help",subheading:"Cue Card Prompt: Kindness & Community",questions:["Who the other person was and what assistance was needed","What actions were taken to resolve the challenge","How both of you reacted once the situation was settled","Explain what this experience taught you about human connection"]},{id:"p2-14",topicTitle:"Describe a creative hobby or artistic skill you would like to explore",subheading:"Cue Card Prompt: Creative Arts",questions:["What creative activity you would like to try (e.g. pottery, painting, filmmaking)","What tools, materials, or instruction it would require","Why you have not had the opportunity to begin yet","Explain what excites you most about developing this creative hobby"]}]},3:{part:3,titleTag:"IELTS Speaking Part 3 Topics & Questions | RadioShadow",h1:"IELTS Speaking Part 3 Topics & Questions",intro:"IELTS Speaking Part 3 expands into an interactive discussion on abstract, societal, and global issues connected to Part 2. Practice developing balanced viewpoints, comparing trends, and justifying your opinions with these common exam topics.",buttonText:"Practice Part 3 with an AI Examiner",badge:"Part 3 • 4–5 Mins • Abstract Discussion & Follow-up",topics:[{id:"p3-1",topicTitle:"Artificial Intelligence & The Future of Work",questions:["How is automated technology and AI shifting career opportunities for recent university graduates?","Do you believe creative roles in art, music, and writing can ever be fully automated by machines?","What ethical policies should governments enact to prevent widespread technological unemployment?","Will human soft skills like empathy and negotiation become more valued as AI advances?"]},{id:"p3-2",topicTitle:"Modern Education Systems & Lifelong Learning",questions:["Should school curricula place higher emphasis on real-world life skills than traditional academic subjects?","How has the proliferation of online universities altered equal access to higher education?","Why is continuous lifelong learning becoming essential in an era of rapid technological disruption?","What are the benefits and drawbacks of standardized testing in schools?"]},{id:"p3-3",topicTitle:"Urbanization, Megacities & Rural Life",questions:["What primary challenges do rapidly growing metropolitan cities face regarding infrastructure and housing?","Why are some young professionals choosing to relocate away from large cities into rural communities?","How can urban planners design cities that foster community bonds rather than social isolation?","Should governments invest heavily in preserving rural traditions and local village economies?"]},{id:"p3-4",topicTitle:"Environmental Responsibility: Individuals vs. Corporations",questions:["Can individual lifestyle changes like recycling make a meaningful difference without strict corporate regulations?","What financial incentives or penalties are most effective in prompting businesses to adopt green energy?","To what extent should industrialized nations assist developing countries in transitioning to carbon-neutral economies?","How can schools educate the next generation to be more ecologically responsible?"]},{id:"p3-5",topicTitle:"Social Media Algorithms & Public Discourse",questions:["How do recommendation algorithms influence political polarization and create social echo chambers?","In what ways has instant digital messaging changed how deeply people connect with their friends and family?","Should social media platforms be legally accountable for misinformation published by their users?","What are the long-term psychological effects of constant social comparison on young people?"]},{id:"p3-6",topicTitle:"Consumerism, Fast Fashion & Waste Culture",questions:["Why do consumers today purchase significantly more clothing and electronic items than previous generations?","How does the fast fashion business model impact global supply chains and environmental waste?","Can ethical and sustainable brands compete effectively against ultra-cheap fast fashion retailers?","What role does targeted advertising play in driving impulsive consumer spending?"]}
4821,{id:"p3-7",topicTitle:"Tourism: Economic Growth vs. Cultural Commodification",questions:["How does excessive tourism threaten historical landmarks and the daily lives of local residents?","What sustainable tourism practices can help protect fragile natural ecosystems while supporting local jobs?","Should municipal governments impose visitor caps or tourist taxes on overcrowded cultural destinations?","Does international travel genuinely foster cross-cultural understanding, or does it promote stereotypes?"]},{id:"p3-8",topicTitle:"Health, Mental Wellbeing & Work-Life Balance",questions:["Why are stress, burnout, and mental fatigue becoming more widespread in modern workplaces?","Should public health policies allocate greater resources to preventative care rather than disease treatment?","Do you think governments should legally enforce a 'right to disconnect' from work emails outside office hours?","How has the rise of remote work altered employees' physical and psychological health?"]},{id:"p3-9",topicTitle:"Cultural Heritage & Globalization",questions:["As global media spreads worldwide, how can smaller nations protect their indigenous languages and customs?","What are the tangible advantages that multicultural societies enjoy in terms of culinary diversity and innovation?","Why do you think traditional craftsmanship is gaining renewed appreciation in a mass-produced world?","Should national museums return historical artifacts to their countries of origin?"]},{id:"p3-10",topicTitle:"Public Transportation & Urban Mobility",questions:["Why do many urban commuters continue using private cars despite heavy traffic congestion and parking costs?","What architectural and technological upgrades would make public transit systems substantially more attractive?","Would making city buses and trains completely free for all residents be economically feasible?","How might autonomous electric vehicles transform urban mobility over the coming decades?"]},{id:"p3-11",topicTitle:"Public Funding for the Arts & Humanities",questions:["Why do some taxpayers believe state funds should prioritize science and healthcare over art exhibitions and theatres?","How do the visual and performing arts contribute to a nation's identity and international prestige?","Can virtual reality galleries and digital art forms replace the experience of visiting a physical museum?","What role should art play in stimulating critical thought and social debate?"]},{id:"p3-12",topicTitle:"News Media Reliability & Information Literacy",questions:["How can everyday citizens distinguish between credible investigative reporting and clickbait or biased commentary?","What dangers arise when major news outlets depend on corporate advertising revenue to survive?","Should information literacy and critical thinking be mandatory subjects in secondary education?","How has the speed of breaking news on social media altered public perception of world events?"]},{id:"p3-13",topicTitle:"Workplace Flexibility & Changing Career Paths",questions:["Why are fewer young professionals choosing to stay with a single employer for their entire careers?","What are the pros and cons of the gig economy and freelance contracts compared to permanent jobs?","How do differing generational values influence teamwork and collaboration in the modern office?","How might four-day work weeks affect overall productivity and employee satisfaction?"]},{id:"p3-14",topicTitle:"The Science of Habit Formation & Personal Growth",questions:["Why do many people find it notoriously difficult to sustain new self-improvement habits like fitness or studying?","To what extent does a person's immediate physical and social environment dictate their daily habits?","Are habit tracking apps and digital gamification genuinely helpful for long-term behavior change?","How does societal definition of 'success' shape the individual goals people choose to pursue?"]}]}};function s_({part:n,darkMode:e=!1,onToggleDarkMode:t}){const r=c$[n]||c$[1];S.useEffect(()=>{document.title=r.titleTag;let a=document.querySelector('meta[name="description"]');a&&a.setAttribute("content",r.intro)},[r]);const s=()=>{window.location.href="/ielts-speaking-mock-test"};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors ${e?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsx("header",{className:`sticky top-0 z-30 border-b backdrop-blur-md transition-colors ${e?"bg-slate-900/80 border-slate-800":"bg-white/80 border-slate-200"}`,children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("a",{href:"/",className:"flex items-center gap-2.5 text-inherit no-underline hover:opacity-90 transition-opacity",title:"Return to RadioShadow Home",children:[i.jsx("img",{src:mT,alt:"RadioSh
4821adow Logo",className:"w-8 h-8 rounded-xl object-cover shadow-xs"}),i.jsxs("span",{className:"font-bold text-base tracking-tight hidden sm:inline",children:["RadioShadow ",i.jsx("span",{className:"text-emerald-500 font-medium text-xs px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20",children:"IELTS"})]})]}),i.jsx("div",{className:`h-4 w-px hidden sm:block ${e?"bg-slate-800":"bg-slate-200"}`}),i.jsxs("nav",{className:"flex items-center gap-1 text-xs font-medium","aria-label":"IELTS Parts",children:[i.jsx("a",{href:"/ielts-speaking-part-1-topics",className:`px-2.5 py-1 rounded-lg transition-colors ${n===1?e?"bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30":"bg-emerald-50 text-emerald-700 font-bold border border-emerald-200":e?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Part 1"}),i.jsx("a",{href:"/ielts-speaking-part-2-topics",className:`px-2.5 py-1 rounded-lg transition-colors ${n===2?e?"bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30":"bg-emerald-50 text-emerald-700 font-bold border border-emerald-200":e?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Part 2"}),i.jsx("a",{href:"/ielts-speaking-part-3-topics",className:`px-2.5 py-1 rounded-lg transition-colors ${n===3?e?"bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30":"bg-emerald-50 text-emerald-700 font-bold border border-emerald-200":e?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Part 3"}),i.jsx("a",{href:"/ielts-speaking-topics-2026",className:`px-2.5 py-1 rounded-lg transition-colors ${e?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Full 2026 Topic Bank"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[t&&i.jsx("button",{onClick:t,className:`p-2 rounded-xl border transition-all cursor-pointer ${e?"bg-slate-800 hover:bg-slate-700 text-amber-400 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-indigo-600 border-slate-200"}`,title:e?"Switch to light mode":"Switch to dark mode",children:e?i.jsx(qc,{className:"w-4 h-4"}):i.jsx(ko,{className:"w-4 h-4"})}),i.jsxs("a",{href:"/ielts-speaking-mock-test",className:"px-3.5 py-1.5 rounded-xl text-xs font-bold bg-emerald-600 hover:bg-emerald-500 text-white shadow-xs transition-all flex items-center gap-1.5",children:[i.jsx(yn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Full Mock Test"})]})]})]})}),i.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-4 sm:px-6 py-8 md:py-12",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400 mb-6",children:[i.jsx("a",{href:"/",className:"hover:underline",children:"Home"}),i.jsx(qn,{className:"w-3 h-3"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:underline",children:"IELTS Speaking"}),i.jsx(qn,{className:"w-3 h-3"}),i.jsxs("span",{className:"text-slate-700 dark:text-slate-200 font-medium",children:["Part ",n," Topics"]})]}),i.jsxs("div",{className:"mb-10",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-semibold mb-3 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:r.badge})]}),i.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-extrabold tracking-tight mb-4 text-slate-900 dark:text-white",children:r.h1}),i.jsx("p",{className:"text-base sm:text-lg leading-relaxed text-slate-600 dark:text-slate-300 max-w-3xl mb-8",children:r.intro}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[i.jsxs("button",{onClick:s,id:`ielts-practice-part-${n}-btn`,className:"inline-flex items-center justify-center gap-2.5 px-6 py-3.5 rounded-xl font-bold text-base bg-emerald-600 hover:bg-emerald-500 text-white shadow-md hover:shadow-lg transition-all transform active:scale-98 cursor-pointer",children:[i.jsx(Er,{className:"w-5 h-5"}),i.jsx("span",{children:r.buttonText}),i.jsx(qr,{className:"w-4 h-4 ml-1"})]}),i.jsxs("a",{href:"/ielts-speaking-mock-test",className:`inline-flex items-center gap-1.5 px-4 py-3 rounded-xl font-medium text-sm border transition-colors ${e?"bg-slate-900 hover:bg-slate-800 text-slate-300 border-slate-700":"bg-white hover:bg-slate-100 text-slate-700 border-slate-300"}`,children:[i.jsx("span",{children:"Explore AI Examiner with Dr. Arthur"}
4821),i.jsx(qn,{className:"w-4 h-4 text-slate-400"})]})]})]}),i.jsxs("section",{"aria-label":`IELTS Speaking Part ${n} Curated Topics`,className:"mb-12",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6 pb-3 border-b border-slate-200 dark:border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Ys,{className:"w-5 h-5 text-emerald-500"}),i.jsx("h2",{className:"text-xl font-bold text-slate-900 dark:text-white",children:"Frequently Tested Topics & Practice Questions"})]}),i.jsxs("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:[r.topics.length," Essential Topics"]})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 sm:gap-6",children:r.topics.map((a,o)=>i.jsxs("div",{className:`p-5 rounded-2xl border transition-all duration-200 hover:shadow-md ${e?"bg-slate-900/70 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300"}`,children:[i.jsxs("div",{className:"flex items-start gap-3 mb-3",children:[i.jsx("span",{className:`w-7 h-7 rounded-lg flex items-center justify-center font-bold text-xs shrink-0 ${e?"bg-slate-800 text-emerald-400":"bg-emerald-50 text-emerald-700"}`,children:o+1}),i.jsxs("div",{children:[i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-slate-100 leading-snug",children:a.topicTitle}),a.subheading&&i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:a.subheading})]})]}),i.jsx("ul",{className:"space-y-2 mt-3 text-sm text-slate-600 dark:text-slate-300",children:a.questions.map((l,c)=>i.jsxs("li",{className:"flex items-start gap-2 leading-relaxed",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 shrink-0 mt-2"}),i.jsx("span",{children:l})]},c))})]},a.id))})]}),i.jsxs("section",{className:`p-6 sm:p-8 rounded-2xl border text-center transition-all ${e?"bg-gradient-to-b from-slate-900 to-slate-900/80 border-slate-800":"bg-gradient-to-b from-emerald-50/60 to-white border-emerald-100"}`,children:[i.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2 text-slate-900 dark:text-white",children:"Ready to test your answers in a realistic interview?"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 max-w-xl mx-auto mb-6",children:"Practice one-on-one with Dr. Arthur Sterling, our British AI Examiner. Get real-time speech feedback, band scoring breakdown, and pronunciation advice."}),i.jsxs("button",{onClick:s,className:"inline-flex items-center justify-center gap-2 px-6 py-3 rounded-xl font-bold text-sm bg-emerald-600 hover:bg-emerald-500 text-white shadow-sm transition-all cursor-pointer",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:r.buttonText})]})]})]}),i.jsx("footer",{className:`border-t py-6 text-xs text-center transition-colors ${e?"bg-slate-950 border-slate-800 text-slate-500":"bg-white border-slate-200 text-slate-400"}`,children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between gap-3",children:[i.jsxs("p",{children:["© ",new Date().getFullYear()," RadioShadow AI. IELTS Speaking Practice & Language Immersion."]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("a",{href:"/ielts-speaking-part-1-topics",className:"hover:underline",children:"Part 1 Topics"}),i.jsx("a",{href:"/ielts-speaking-part-2-topics",className:"hover:underline",children:"Part 2 Topics"}),i.jsx("a",{href:"/ielts-speaking-part-3-topics",className:"hover:underline",children:"Part 3 Topics"}),i.jsx("a",{href:"/ielts-speaking-topics-2026",className:"text-emerald-600 font-semibold hover:underline",children:"Full 2026 Topic Bank"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:underline",children:"Full Mock Test"})]})]})})]})}const S6e=[{topic:"Work & Career Aspirations",questions:["What do you do for work or study, and what sparked your interest in this path?","What is the most rewarding aspect of your day-to-day responsibilities?","Do you anticipate your industry will look significantly different in 5 years?"]},{topic:"Hometown & Local Culture",questions:["Where is your hometown, and what makes it distinct from nearby regions?","What kind of facilities or public spaces do residents appreciate most?","Has rapid urban development altered the pace of life in y
4821our hometown?"]},{topic:"Accommodation & Personal Space",questions:["Do you reside in an apartment or a house, and what is your favorite corner?","If you could remodel one room in your current home, what would you change?","Do you see yourself remaining in this type of accommodation long-term?"]},{topic:"Daily Routines & Time Allocation",questions:["How do your weekday morning habits differ from your weekend rituals?","Do you consider yourself more productive in early mornings or late evenings?","What strategies do you rely on when juggling multiple urgent deadlines?"]},{topic:"Technology & Smartphone Habits",questions:["Which mobile application has become indispensable to your daily workflow?","Have notifications and constant connectivity made it harder to maintain deep focus?","Do you ever take intentional digital detox breaks from digital screens?"]},{topic:"Food, Cooking & Dietary Shifts",questions:["Do you prefer preparing wholesome home-cooked meals or dining at local bistros?","What iconic culinary dish from your culture would you recommend to a traveler?","How have your dietary preferences and health consciousness evolved recently?"]},{topic:"Music, Podcasts & Auditory Immersion",questions:["What genres of music or spoken podcasts do you gravitate towards when unwinding?","Do you listen to background audio while concentrating, working, or exercising?","Have you attended any memorable live music performances or cultural festivals?"]},{topic:"Weather, Seasons & Ambient Mood",questions:["What season of the year invigorates you the most, and why?","Does persistent gloomy or wet weather dampen your energy and daily plans?","Has seasonal weather in your geographic region become noticeably more volatile?"]},{topic:"Travel & Cross-Cultural Exploration",questions:["Do you favor structured group itineraries or autonomous solo adventures?","What is the single most eye-opening cultural destination you have experienced?","What personal considerations matter most when picking your next vacation retreat?"]},{topic:"Reading, Literature & Media Consumption",questions:["Do you prefer holding tactile paper books or reading e-books on digital screens?","What genres of literature or investigative journalism capture your curiosity?","Do you read primarily for sheer escapism or to acquire actionable domain expertise?"]},{topic:"Friendships & Social Dynamics",questions:["How frequently do you carve out quality time to catch up with close companions?","Do you prize having an intimate inner circle or maintaining broad social networks?","What personal trait do you admire most when building lasting mutual trust?"]},{topic:"Physical Fitness & Outdoor Recreation",questions:["What physical sport, workout, or outdoor pastime keeps you invigorated?","Is physical wellness viewed as a social priority among people in your peer group?","How do you stay motivated to exercise consistently when work schedules intensify?"]}],T6e=[{id:"cue-1",topicTitle:"Describe a person who has strongly influenced your life",category:"Role Model & Mentorship",bulletPoints:["Who this person is and how you first met them","What distinctive traits or accomplishments make them special","How they supported or guided you in a critical moment","Explain why their influence has had such a lasting impact on your life"],band9Sample:"If I had to single out one person who truly recalibrated my outlook on life, it would unquestionably be my high school physics mentor, Mr. Henderson. Rather than simply feeding us dry formulas from a textbook, he fostered an environment of intellectual curiosity where questioning dogmas was genuinely celebrated. His relentless encouragement during my final capstone project not only bolstered my self-belief but fundamentally shifted how I tackle daunting intellectual hurdles today."},{id:"cue-2",topicTitle:"Describe a memorable journey or trip you took",category:"Travel & Exploration",bulletPoints:["Where you went and who accompanied you","What mode of transport you used to reach the destination","What unexpected or exciting events happened along the way","Explain why this particular journey remains so unforgettable to you"],band9Sample:"One journey that remains vividly etched in my memory was a solo sleeper-train expedition across the Scottish Highlands two summers ago. Watching the mist roll over the dramatic lochs and rugged granite peaks at sunrise was nothing short of breathtaking. What made it genuinely unforgettable was striking up an impromptu conversation with a veteran landscape photographer over lukewarm carriage tea, which completely changed how I perceive slow travel."},{id:"cue-3",topicTitle:"Describe a useful skill you learned recently",category:"Practical Competence & Growth",bulletPoints:["What the skill is and why you decided to learn it","How and from whom you learned this skill","What difficulties you encountered while practicing it","Explain how mastering this skill has benefited your daily life or work"],band9Sample:"Over the past six months, I decided to tackle data visualization using interactive Python libraries, primarily to communicate complex research f
4821indings without overwhelming non-technical colleagues. I initially grappled with syntax errors and unintuitive styling parameters, but through iterative trial and error, things gradually clicked into place. It has dramatically streamlined my weekly presentations, turning dense statistical tables into crisp, intuitive narratives."},{id:"cue-4",topicTitle:"Describe a book, film, or documentary that left a deep impression",category:"Media & Thought-Provoking Stories",bulletPoints:["What the book or movie was about","When and where you first read or watched it","Which character, scene, or message moved you the most","Explain why it created such a profound impression on your thinking"],band9Sample:"A piece of cinema that resonated with me on a deeply emotional level was Christopher Nolan's 'Interstellar', which I first caught on an IMAX screen during university. Beyond its jaw-dropping auditory design and theoretical astrophysics, the film's poignant exploration of parental sacrifice and temporal relativity struck a raw nerve. It forced me to reflect deeply on how fragile our ephemeral human connections are against the vast canvas of cosmic time."},{id:"cue-5",topicTitle:"Describe an environmentally friendly habit or initiative you support",category:"Sustainability & Ecological Action",bulletPoints:["What the eco-friendly habit or initiative involves","When and how you first became aware of it","How easy or difficult it is to maintain in your routine","Explain why you believe this practice helps protect our environment"],band9Sample:"An eco-conscious ritual I've embraced with conviction is rigorous municipal composting paired with a zero single-use plastic grocery regimen. While planning meals around bulk unpackaged produce initially demanded extra logistical foresight, it quickly became second nature. Witnessing our household landfill waste shrink by nearly seventy percent made me realize that compounding daily micro-habits can exert a tangible environmental difference."},{id:"cue-6",topicTitle:"Describe an exciting piece of technology you use regularly",category:"Technological Innovation & Daily Tools",bulletPoints:["What the device, software, or app is","How often and for what purposes you use it","What key features set it apart from alternatives","Explain whether you feel it has simplified or complicated your daily routine"],band9Sample:"The piece of hardware I find utterly indispensable nowadays is my active noise-cancelling wireless headset. Living in a vibrant, bustling metropolis, the ability to instantly eliminate ambient decibel clutter with a flick of a toggle provides an oasis of cognitive calm. Rather than being a mere luxury, it has become an invaluable cognitive tool that shields my deep-work focus while commuting or writing code."},{id:"cue-7",topicTitle:"Describe a traditional festival or cultural celebration you enjoy",category:"Heritage & Community Traditions",bulletPoints:["What the festival is and when it takes place","What special activities, rituals, or food are involved","Who you typically celebrate this occasion with","Explain why this celebration holds special cultural significance for you"],band9Sample:"The cultural celebration that holds a special place in my heart is the Mid-Autumn Festival, which coincides with the full harvest moon each September. My entire extended family gathers under the autumn sky to share delicate lotus-seed mooncakes and brew fragrant oolong tea by candlelight. In our frantic, hyper-digitized lives, this ritual serves as an anchoring communal touchstone that reconnects multiple generations through shared folklore and warmth."},{id:"cue-8",topicTitle:"Describe a difficult decision that took you a long time to make",category:"Life Crossroads & Decision-Making",bulletPoints:["What the decision was about and what options you had","Why it was such a challenging choice to resolve","Whether you asked friends, family, or mentors for guidance","Explain how you felt after making the choice and whether you are glad with the outcome"],band9Sample:"One agonizing dilemma that kept me tossing and turning for weeks was deciding whether to decline a lucrative corporate job offer in order to pursue an autonomous freelance career. Weighing short-term financial stability against long-term creative sovereignty was deeply nerve-wracking. Ultimately, taking that measured leap of faith was liberating, as it forced me to cultivate true adaptability and take complete ownership of my professional growth."},{id:"cue-9",topicTitle:"Describe a quiet place you enjoy visiting to relax or focus",category:"Sanctuary & Mindfulness",bulletPoints:["Where this place is located and how you discovered it","How often you go there and what the atmosphere feels like","What you usually do while spending time in this place","Explain why this environment helps you recharge your energy or concentrate"],band9Sample:"My ultimate retreat whenever sensory overload creeps in is an antique greenhouse botanical garden tucked behind the city's historic university quadrangle. Bathed in diffused natural light and fragrant damp soil, the atmosphere offers an almost meditative stillness far removed from traffic din. I often spend an hour there on Sunday mornings reading or journaling, emerging feeling thoroughly decompressed and mentally restored."},{id:"cue-10",topicTitle:"Describe a piece of good advice you received from someone",category:"Wisdom & Life Lessons",bulletPoints:["Who offered you the advice and what the situation was","What the advice specifically recommended you should or shouldn't do","How you responded or applied the guidance","Explain how following this advice positively impacted your life or perspective"],band9Sample:"When I was grappling with imposter syndrome early in my career, a senior director pulled me aside and advised: 'Don't benchmark your behind-the-scenes struggles against everyone else's polished highlight reels.' That succinct insight completely disarmed my anxiety and stopped me from falling into toxic comparison traps. It fundamentally shifted my focus from seeking external validation to cultivating intrinsic mastery."},{id:"cue-11",topicTitle:"Describe an ambitious goal you want to achieve in the future",category:"Ambition & Long-Term Milestones",bulletPoints:["What the specific goal or milestone is","When you first decided to pursue this ambition","What concrete steps or preparations you need to complete","Explain why achieving this goal is personally meaningful to you"],band9Sample:"A milestone I've set my sights firmly on is delivering an original keynote lecture in fluent Spanish at an international academic conference within the next two years. Bridging complex cognitive linguistics across two foreign tongues demands relentless active recall and acoustic phonetic conditioning. Crossing that threshold would signify not just linguistic fluency, but genuine cross-cultural competence on a global stage."},{id:"cue-12",topicTitle:"Describe an interesting historical building or architectural landmark",category:"Architecture & Historical Legacy",bulletPoints:["Where the building is situated and what it looks like","When you visited it and what you did there","What historical events or significance are associated with it","Explain why you find this historical landmark so fascinating"],band9Sample:"An architectural marvel that completely captivated me is the Alhambra palace in Granada, perched dramatically against the snow-dusted Sierra Nevada mountains. What renders the complex so extraordinary is its intricate Moorish stucco geometry, tranquil courtyards, and sophisticated hydraulic water features that date back over seven centuries. Walking through its serene arches feels like stepping directly into an intersection where Islam
4821ic artistry meets European history."},{id:"cue-13",topicTitle:"Describe an occasion when you helped someone or received unexpected help",category:"Empathy & Community Solidarity",bulletPoints:["Who the other person was and what assistance was needed","What actions were taken to resolve the challenge","How both of you reacted once the situation was settled","Explain what this experience taught you about human connection"],band9Sample:"A heartwarming encounter that reaffirmed my faith in human empathy occurred on a desolate rural platform when a sudden timetable cancellation left an elderly foreign traveler stranded without network coverage. Stepping in to decipher the conductor's rapid announcements and helping arrange a ride-share took barely twenty minutes, yet the profound relief visible in her eyes was priceless. It served as a gentle reminder of how effortless everyday solidarity can be when we pay attention."},{id:"cue-14",topicTitle:"Describe a creative hobby or artistic skill you would like to explore",category:"Artistic Expression & Creativity",bulletPoints:["What creative activity you would like to try (e.g. pottery, painting, filmmaking)","What tools, materials, or instruction it would require","Why you have not had the opportunity to begin yet","Explain what excites you most about developing this creative hobby"],band9Sample:"A creative avenue I'm itching to delve into is wheel-thrown ceramic pottery, specifically experimenting with minimalist Japanese wabi-sabi glazing techniques. Working directly with tactile clay demands an intense presence that stands in stark contrast to tapping away at cold glass computer displays all day. The prospect of embracing organic imperfections and transforming raw earthen matter into functional everyday utensils sounds deeply grounding."}],A6e=[{topic:"Artificial Intelligence, Automation & The Future of Human Labor",questions:["How is automated generative technology shifting entry-level career opportunities for university graduates?","Do you believe fundamentally creative endeavors such as musical composition can ever be fully replicated by synthetic algorithms?","What legislative safeguards should international bodies establish to counter technological unemployment?"]},{topic:"Educational Paradigm Shifts & Lifelong Cognitive Agility",questions:["Should modern school curricula prioritize practical emotional resilience and financial acumen over classical academic theory?","In what ways have digital self-paced learning platforms leveled educational inequalities worldwide?","Why is continuous self-directed upskilling becoming indispensable for professional longevity?"]},{topic:"Urban Congestion, Smart Metropolises & Rural Preservation",questions:["What core infrastructural pressures do modern megacities face regarding affordable housing and public transit?","Why are young creative professionals increasingly seeking out rural or semi-rural towns for remote living?","How can municipal architects design public spaces that encourage spontaneous communal bonding?"]},{topic:"Corporate Responsibility vs. Individual Consumer Accountability in Climate Action",questions:["Can household recycling practices make a quantifiable difference without stringent regulatory caps on multinational industries?","What combination of tax subsidies and carbon tariffs is most effective in driving rapid clean-energy transitions?","To what extent should industrialized economies finance ecological resilience projects in developing territories?"]},{topic:"Social Media Algorithms, Echo Chambers & Polarized Public Discourse",questions:["How do engagement-maximizing recommendation algorithms distort collective political nuance and foster echo chambers?","Has frictionless instant messaging degraded our capacity for deep, empathetic face-to-face dialogue?","Should decentralized tech platforms be held legally culpable for unchecked misinformation published across their servers?"]},{topic:"Fast Consumerism, Planned Obsolescence & Minimalist Living",questions:["Why do contemporary consumers purchase dramatically more physical goods than previous generations despite digital alternatives?","How does the fast-fashion supply chain accelerate environmental degradation and resource depletion?","Can circular-economy business models scale successfully without drastic regulatory interventions?"]},{topic:"Overtourism, Cultural Preservation & Responsible Travel",questions:["How does excessive tourism compromise the architectural heritage and socio-economic fabric of historic capitals?","What progressive sustainable tourism policies can safeguard vulnerable ecosystems while sustaining regional hospital
4821ity jobs?","Should world heritage destinations impose daily tourist quotas and congestion fees to protect ancient sites?"]},{topic:"Modern Workplace Wellbeing, Mental Health & The Right to Disconnect",questions:["Why are cognitive fatigue, chronic burnout, and attention fragmentation increasingly prevalent in knowledge industries?","Do you agree that progressive legal frameworks should enforce a strict employee 'right to disconnect' after contractual hours?","How has hybrid remote employment reshaped organizational culture, trust, and team accountability?"]},{topic:"Preservation of Linguistic Diversity & Globalized Homogenization",questions:["As a few dominant global languages prevail in international business, what cultural heritage is lost when minority dialects fade?","Can interactive acoustic voice tools and digital archives revive endangered indigenous idioms effectively?","To what degree does multilingualism shape a speaker's cognitive perception of societal reality?"]}],k6e=[{term:"Recalibrate one's outlook",type:"Collocation / Idiomatic",meaning:"To fundamentally re-evaluate and alter one's perspective on life or a specific issue.",example:"Studying abroad forced me to recalibrate my outlook on cultural stereotypes and personal independence."},{term:"Resonate on an emotional level",type:"Collocation",meaning:"To evoke a deep, meaningful feeling of connection or empathy.",example:"The documentary resonated on an emotional level because it highlighted real-world human resilience against adversity."},{term:"Cognitive overload",type:"Advanced Lexis",meaning:"A state of mental exhaustion caused by processing too much simultaneous information.",example:"Constant push notifications create severe cognitive overload, making concentrated analytical thinking difficult."},{term:"Anchoring touchstone",type:"Metaphorical Collocation",meaning:"A reliable point of reference or grounding tradition that provides stability during change.",example:"Our annual holiday reunion serves as an anchoring touchstone amidst the chaotic demands of modern corporate careers."},{term:"Take a measured leap of faith",type:"Idiomatic Phrase",meaning:"To pursue a bold, calculated risk after careful evaluation of consequences.",example:"Leaving my secure corporate position to establish a software studio was a measured leap of faith that paid off."},{term:"Oasis of calm",type:"Descriptive Collocation",meaning:"A peaceful, restorative haven amidst a loud or stressful environment.",example:"The courtyard botanical garden functions as an oasis of calm inside the bustling urban metropolis."},{term:"Streamline the workflow",type:"Professional Lexis",meaning:"To optimize and simplify a process by removing unnecessary redundancies.",example:"Adopting automated scripting helped streamline the workflow and shaved hours off our reporting cycle."},{term:"Agonizing dilemma",type:"Collocation",meaning:"A painful situation requiring a choice between two equally difficult alternatives.",example:"Choosing between relocating overseas and remaining near my aging family presented an agonizing dilemma."},{term:"Ephemeral",type:"Band 9 Lexis (C2)",meaning:"Lasting for only a brief period of time; fleeting.",example:"Social media virality is notoriously ephemeral, disappearing within days of reaching initial peak momentum."},{term:"Sensory overload",type:"Compound Noun",meaning:"Over-stimulation of the physical senses by loud sounds, bright screens, or crowded places.",example:"Stepping into the neon-lit carnival caused instant sensory overload after hours in the quiet countryside."},{term:"Tangible environmental difference",type:"Collocation",meaning:"A concrete, clearly measurable positive impact on ecological conservation.",example:"Eliminating single-use plastics from municipal public buildings produces a tangible environmental difference."},{term:"Cross-cultural competence",type:"Academic Lexis",meaning:"The ability to communicate, negotiate, and collaborate respectfully across diverse cultures.",example:"International trade negotiators must cultivate cross-cultural competence to avoid unintended diplomatic friction."},{term:"Intricate craftsmanship",type:"Descriptive Collocation",meaning:"Highly detailed, meticulous skill and artistry displayed in physical construction.",example:"The centuries-old cathedral boasts intricate craftsmanship that modern automated machinery rarely matches."},{term:"Tactile presence",type:"Advanced Lexis",meaning:"A physical, hands-on sensation or tangible involvement as opposed to digital abstraction.",example:"Handwriting letters in a fountain pen offers a tactile presence that typed emails simply cannot deliver."},{term:"Grounding ritual",type:"Collocation",meaning:"A daily conscious practice that restores emotional balance and mental clarity.",example:"Taking an early morning brisk walk through the local park has become my favorite grounding ritual."},{term:"Profound impression",type:"High-Frequency Collocation",meaning:"A deep, lasting psychological or intellectual impact.",example:"Her passionate lecture on environmental justice left a profou
4821nd impression on the entire auditorium."},{term:"Utterly indispensable",type:"Band 9 Adverb + Adjective",meaning:"Completely essential; impossible to function without.",example:"Reliable high-speed broadband has become utterly indispensable for remote knowledge workers worldwide."},{term:"Grapple with imposter syndrome",type:"Idiomatic Collocation",meaning:"To struggle with persistent internal feelings of self-doubt despite objective accomplishments.",example:"Many high-achieving graduate scholars grapple with imposter syndrome during their inaugural seminar."},{term:"Intrinsic motivation",type:"Psychological Lexis",meaning:"Drive that originates from internal enjoyment and personal curiosity rather than external prizes.",example:"Students propelled by genuine intrinsic motivation consistently outperform those motivated solely by grades."},{term:"Strike a raw nerve",type:"Idiom",meaning:"To provoke an intense emotional reaction by mentioning a sensitive or vulnerable topic.",example:"His blunt critique regarding income inequality struck a raw nerve among the conservative panel members."},{term:"Rekindle one's passion",type:"Collocation",meaning:"To revive or re-ignite enthusiasm for an activity that had become stagnant.",example:"Attending the weekend masterclass helped rekindle my passion for classical acoustic guitar performance."},{term:"Perceive through a fresh lens",type:"Metaphor",meaning:"To interpret a situation or problem with an open, alternative viewpoint.",example:"Volunteering with underprivileged youth prompted me to perceive society's economic divide through a fresh lens."},{term:"Foster an environment of curiosity",type:"High-level Academic Collocation",meaning:"To nurture a culture where questioning and exploration are encouraged.",example:"Effective educators strive to foster an environment of curiosity rather than demanding blind memorization."},{term:"Compounding micro-habits",type:"Analytical Phrase",meaning:"Small, incremental actions that accumulate over time to yield massive transformation.",example:"Fluent speech is not built in a weekend; it is the natural consequence of compounding daily micro-habits."}],N6e=({darkMode:n=!1,onToggleDarkMode:e})=>{S.useEffect(()=>{document.title="IELTS Speaking Topics 2026: Full Question Bank (Parts 1–3) | RadioShadow";const r=document.querySelector('meta[name="description"]');r&&r.setAttribute("content","Master the latest IELTS speaking topics 2026 with authentic questions and answers, complete Part 2 cue cards, and high-scoring band 9 sample answers.")},[]);const t=r=>{r?window.location.href=`/ielts-speaking-mock-test?topic=${encodeURIComponent(r)}`:window.location.href="/ielts-speaking-mock-test"};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsx("header",{className:`sticky top-0 z-30 border-b backdrop-blur-md transition-colors ${n?"bg-slate-900/80 border-slate-800":"bg-white/80 border-slate-200"}`,children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("a",{href:"/",className:"flex items-center gap-2.5 text-inherit no-underline hover:opacity-90 transition-opacity",title:"Return to RadioShadow Home",children:[i.jsx("img",{src:mT,alt:"RadioShadow Logo",className:"w-8 h-8 rounded-xl object-cover shadow-xs"}),i.jsxs("span",{className:"font-bold text-base tracking-tight hidden sm:inline",children:["RadioShadow"," ",i.jsx("span",{className:"text-emerald-500 font-medium text-xs px-1.5 py-0.5 rounded bg-emerald-500/10 border border-emerald-500/20",children:"2026 Bank"})]})]}),i.jsx("div",{className:`h-4 w-px hidden sm:block ${n?"bg-slate-800":"bg-slate-200"}`}),i.jsxs("nav",{className:"flex items-center gap-1 text-xs font-medium","aria-label":"IELTS Parts",children:[i.jsx("a",{href:"/ielts-speaking-part-1-topics",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Part 1 Topics"}),i.jsx("a",{href:"/ielts-speaking-part-2-topics",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}
4821`,children:"Part 2 Cue Cards"}),i.jsx("a",{href:"/ielts-speaking-part-3-topics",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Part 3 Discussion"}),i.jsx("a",{href:"/ielts-speaking-topics-2026",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"bg-emerald-500/20 text-emerald-400 font-bold border border-emerald-500/30":"bg-emerald-50 text-emerald-700 font-bold border border-emerald-200"}`,children:"Full 2026 Bank"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[e&&i.jsx("button",{onClick:e,className:`p-2 rounded-xl border transition-all cursor-pointer ${n?"bg-slate-800 hover:bg-slate-700 text-amber-400 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-indigo-600 border-slate-200"}`,"aria-label":"Toggle theme",children:n?i.jsx(qc,{className:"w-4 h-4"}):i.jsx(ko,{className:"w-4 h-4"})}),i.jsxs("button",{onClick:()=>t(),className:"hidden sm:inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl text-xs font-semibold bg-emerald-600 hover:bg-emerald-500 text-white shadow-xs transition-all cursor-pointer",children:[i.jsx(Er,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Full Mock Test"})]})]})]})}),i.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-4 sm:px-6 py-8 sm:py-12",children:[i.jsxs("nav",{className:"flex items-center gap-2 text-xs mb-6 text-slate-500 dark:text-slate-400","aria-label":"Breadcrumb",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Home"}),i.jsx(qn,{className:"w-3 h-3"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"IELTS Speaking Practice"}),i.jsx(qn,{className:"w-3 h-3"}),i.jsx("span",{className:"font-semibold text-slate-800 dark:text-slate-200",children:"IELTS Speaking Topics 2026"})]}),i.jsxs("header",{className:"mb-12",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-semibold mb-4 bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Updated for 2026 Exam Seasons • Complete Question Bank (Parts 1–3)"})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl font-extrabold tracking-tight mb-4 leading-tight",children:"IELTS Speaking Topics 2026: Full Question Bank"}),i.jsx("p",{className:"text-base sm:text-lg text-slate-600 dark:text-slate-300 leading-relaxed mb-6 max-w-3xl",children:"Prepare with the official question bank for 2026. Explore authentic IELTS speaking questions and answers across Parts 1, 2, and 3, complete with verbatim Part 2 cue cards, native Band 9 sample answers, and idiomatic vocabulary designed to help test-takers score 7.5+."}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3",children:[i.jsxs("button",{onClick:()=>t(),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl font-bold text-sm bg-emerald-600 hover:bg-emerald-500 text-white shadow-md transition-all cursor-pointer",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:"Practice with AI Examiner Dr. Arthur →"})]}),i.jsxs("a",{href:"#part-2-cue-cards",className:`inline-flex items-center gap-2 px-4 py-2.5 rounded-xl font-semibold text-sm border transition-all ${n?"bg-slate-900 border-slate-700 hover:bg-slate-800 text-slate-200":"bg-white border-slate-200 hover:bg-slate-100 text-slate-800 shadow-xs"}`,children:[i.jsx(Jo,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:"Jump to 14 Band 9 Cue Cards"})]})]})]}),i.jsxs("section",{className:`p-6 sm:p-8 rounded-2xl border mb-12 transition-colors ${n?"bg-slate-900/60 border-slate-800 shadow-lg":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsxs("div",{className:"flex items-center gap-3 mb-4",children:[i.jsx("div",{className:"p-2 rounded-xl bg-amber-500/10 text-amber-500 border border-amber-500/20",children:i.jsx(xi,{className:"w-5 h-5"})}),i.jsx("h2",{className:"text-2xl font-bold tracking-tight",children:"What Changed in the 2026 Topic Season"})]}
4821),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 leading-relaxed mb-3",children:"Every year across the January, May, and September testing windows, Cambridge English and IDP rotate approximately 50% of the active speaking pool with fresh thematic prompts. The 2026 topic season introduces heightened scrutiny on how individuals adapt to rapid artificial intelligence tools, establish digital-life boundaries, and navigate evolving climate and urban living realities."}),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 leading-relaxed mb-3",children:"Examiners in 2026 actively penalize memorized, cookie-cutter scripts while heavily rewarding conversational agility, natural acoustic cadence, and idiomatic precision. Test candidates who demonstrate spontaneous self-correction, flexible coherence, and topic-specific lexis consistently break through into the Band 8.0 and Band 9.0 scoring brackets."}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-medium text-emerald-600 dark:text-emerald-400 mt-4",children:[i.jsx(sl,{className:"w-4 h-4"}),i.jsx("span",{children:"Verified against current Cambridge 2026 test administration rubrics"})]})]}),i.jsxs("section",{className:"mb-14",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-6",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400 mb-1",children:"Warm-up Monologue • 4–5 Minutes"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight",children:"Part 1 Topics: Introduction & Interview"})]}),i.jsxs("a",{href:"/ielts-speaking-part-1-topics",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-emerald-600 dark:text-emerald-400 hover:underline",children:[i.jsx("span",{children:"See full Part 1 list & all questions"}),i.jsx(qr,{className:"w-4 h-4"})]})]}),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 leading-relaxed mb-6",children:"Part 1 features relaxed, warm-up ielts speaking practice questions centered on everyday routines, preferences, and personal background. Aim for concise, natural 2-to-3 sentence responses without over-elaborating or pausing excessively. Here are the 12 most frequent 2026 Part 1 topics:"}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:S6e.map((r,s)=>i.jsxs("div",{className:`p-5 rounded-xl border transition-colors ${n?"bg-slate-900/50 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center gap-2.5 mb-2.5",children:[i.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-md bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:s+1}),i.jsx("h3",{className:"font-bold text-base text-slate-800 dark:text-slate-100",children:r.topic})]}),i.jsx("ul",{className:"space-y-1.5 text-xs text-slate-600 dark:text-slate-300 pl-2",children:r.questions.map((a,o)=>i.jsxs("li",{className:"flex items-start gap-1.5",children:[i.jsx("span",{className:"text-emerald-500 font-bold",children:"•"}),i.jsx("span",{children:a})]},o))})]},s))}),i.jsx("div",{className:"mt-6 text-center",children:i.jsxs("a",{href:"/ielts-speaking-part-1-topics",className:`inline-flex items-center gap-2 px-5 py-2.5 rounded-xl font-bold text-sm border transition-all ${n?"bg-slate-900 border-slate-700 hover:bg-slate-800 text-emerald-400":"bg-white border-emerald-200 hover:bg-emerald-50 text-emerald-700 shadow-xs"}`,children:[i.jsx(Ys,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:"Explore all Part 1 topics & sample answers →"})]})})]}),i.jsxs("section",{id:"part-2-cue-cards",className:"mb-14 scroll-mt-20",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-6",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400 mb-1",children:"Core Differentiation • High-Impact Link Asset"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight",children:"Part 2 Cue 
4821Cards with Band 9 Sample Answers"})]}),i.jsxs("a",{href:"/ielts-speaking-part-2-topics",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-emerald-600 dark:text-emerald-400 hover:underline",children:[i.jsx("span",{children:"See all Part 2 cue cards"}),i.jsx(qr,{className:"w-4 h-4"})]})]}),i.jsx("div",{className:`p-5 rounded-xl border mb-8 ${n?"bg-emerald-950/20 border-emerald-800/40 text-emerald-300":"bg-emerald-50 border-emerald-200 text-emerald-900"}`,children:i.jsxs("p",{className:"text-sm leading-relaxed",children:[i.jsx("strong",{children:"The IELTS speaking task 2 challenge:"})," You receive a prompt card and exactly 1 minute of preparation before delivering an uninterrupted 2-minute monologue. Below are 14 authentic ielts speaking cue card prompts accompanied by authentic, unscripted Band 9 sample speaking ielts part 2 openings that avoid formulaic cliches and highlight native idiomatic flow."]})}),i.jsx("div",{className:"space-y-6",children:T6e.map((r,s)=>i.jsxs("article",{className:`p-6 sm:p-7 rounded-2xl border transition-all ${n?"bg-slate-900/60 border-slate-800 hover:border-slate-700 shadow-md":"bg-white border-slate-200 hover:border-slate-300 shadow-sm"}`,children:[i.jsx("div",{className:"flex flex-wrap items-center justify-between gap-2 mb-3",children:i.jsxs("div",{className:"inline-flex items-center gap-2",children:[i.jsxs("span",{className:"px-2.5 py-0.5 rounded-md text-xs font-bold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:["Cue Card #",s+1]}),i.jsx("span",{className:"text-xs font-medium text-slate-500 dark:text-slate-400",children:r.category})]})}),i.jsx("h3",{className:"text-xl sm:text-2xl font-extrabold text-slate-900 dark:text-slate-100 mb-4 leading-snug",children:r.topicTitle}),i.jsxs("div",{className:`p-4 rounded-xl border mb-5 ${n?"bg-slate-950/70 border-slate-800 text-slate-300":"bg-slate-50 border-slate-200 text-slate-700"}`,children:[i.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-slate-500 dark:text-slate-400 mb-2",children:"Candidate Task Card (You should say):"}),i.jsx("ul",{className:"space-y-1.5 text-sm pl-2",children:r.bulletPoints.map((a,o)=>i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx(Bbe,{className:"w-3.5 h-3.5 text-emerald-500 mt-1 shrink-0"}),i.jsx("span",{children:a})]},o))})]}),i.jsxs("div",{className:`p-4 sm:p-5 rounded-xl border mb-5 ${n?"bg-indigo-950/20 border-indigo-800/40":"bg-indigo-50/70 border-indigo-100"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-2 text-xs font-bold text-indigo-600 dark:text-indigo-400 uppercase tracking-wide",children:[i.jsx(yn,{className:"w-4 h-4 text-indigo-500"}),i.jsx("span",{children:"Band 9 Model Answer Opening (Idiomatic & Natural)"})]}),i.jsxs("blockquote",{className:"text-sm sm:text-base italic text-slate-700 dark:text-slate-200 leading-relaxed",children:["“",r.band9Sample,"”"]})]}),i.jsxs("div",{className:"flex items-center justify-between flex-wrap gap-3 pt-2 border-t border-slate-100 dark:border-slate-800/60",children:[i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Live speech evaluation • Fluency pitch diagnostics • CEFR 9.0 rubric"}),i.jsxs("button",{onClick:()=>t(r.topicTitle),className:"inline-flex items-center gap-2 px-4 py-2 rounded-xl text-xs sm:text-sm font-bold bg-emerald-600 hover:bg-emerald-500 text-white transition-all cursor-pointer shadow-xs",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:"Practice this cue card with an AI Examiner →"})]})]})]},r.id))}),i.jsx("div",{className:"mt-8 text-center",children:i.jsx("a",{href:"/ielts-speaking-part-2-topics",className:`inline-flex items-center gap-2 px-6 py-3 rounded-xl font-bold text-sm border transition-all ${n?"bg-slate-900 border-slate-700 hover:bg-slate-800 text-emerald-400":"bg-white border-emerald-200 hover:bg-emerald-50 text-emerald-700 shadow-xs"}`,children:i.jsx("span",{children:"See all Part 2 cue cards & interactive prep strategies →"})})})]}),i.jsxs("section",{className:"mb-14",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 mb-6",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400 mb-1",children:"Abstract Debate • 4–5 Minutes"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight",children:"Part 3 Discussion Questions"})]}),i.jsxs("a",{href:"/ielts-speaking-part-3-topics",className:"inline-flex items-center gap-1.5 text-sm font-semibold text-emerald-600 dark:text-emerald-400 hover:underline",children:[i.jsx("span",{children:"See all Part 3 topics & questions"}),i.jsx(qr,{className:"w-4 h-4"})]})]}
4821),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 leading-relaxed mb-6",children:"Part 3 shifts from personal anecdotes to analytical, societal, and ethical debate. Examiners probe your ability to speculate on hypothetical scenarios, contrast generational attitudes, and defend nuanced arguments. Review these essential 2026 discussion domains:"}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-5",children:A6e.map((r,s)=>i.jsxs("div",{className:`p-5 rounded-xl border transition-colors ${n?"bg-slate-900/50 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center gap-2.5 mb-3",children:[i.jsx("span",{className:"flex items-center justify-center w-6 h-6 rounded-md bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs font-bold",children:s+1}),i.jsx("h3",{className:"font-bold text-base text-slate-800 dark:text-slate-100",children:r.topic})]}),i.jsx("ul",{className:"space-y-2 text-xs text-slate-600 dark:text-slate-300 pl-2",children:r.questions.map((a,o)=>i.jsxs("li",{className:"flex items-start gap-1.5",children:[i.jsx("span",{className:"text-emerald-500 font-bold",children:"•"}),i.jsx("span",{children:a})]},o))})]},s))}),i.jsx("div",{className:"mt-6 text-center",children:i.jsxs("a",{href:"/ielts-speaking-part-3-topics",className:`inline-flex items-center gap-2 px-5 py-2.5 rounded-xl font-bold text-sm border transition-all ${n?"bg-slate-900 border-slate-700 hover:bg-slate-800 text-emerald-400":"bg-white border-emerald-200 hover:bg-emerald-50 text-emerald-700 shadow-xs"}`,children:[i.jsx(W2,{className:"w-4 h-4 text-emerald-500"}),i.jsx("span",{children:"Explore all Part 3 discussion questions →"})]})})]}),i.jsxs("section",{className:"mb-14",children:[i.jsxs("div",{className:"mb-6",children:[i.jsx("div",{className:"text-xs font-bold uppercase tracking-wider text-emerald-600 dark:text-emerald-400 mb-1",children:"Lexical Resource • Band 8–9 Booster"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-bold tracking-tight",children:"Band 9 Vocabulary for IELTS Speaking"}),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-sm mt-2 max-w-3xl",children:"Examiners award Band 9 for Lexical Resource when candidates use rare, idiomatic collocations naturally and precisely in context. Avoid cramming unnatural “big words” — integrate these flexible phrases organically:"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-3 gap-4",children:k6e.map((r,s)=>i.jsxs("div",{className:`p-4 rounded-xl border flex flex-col justify-between transition-colors ${n?"bg-slate-900/40 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300 shadow-xs"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between gap-2 mb-1.5",children:[i.jsx("span",{className:"font-bold text-sm text-emerald-600 dark:text-emerald-400",children:r.term}),i.jsx("span",{className:"text-[10px] font-semibold px-1.5 py-0.5 rounded bg-slate-100 dark:bg-slate-800 text-slate-500 dark:text-slate-400",children:r.type})]}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 mb-3 leading-relaxed",children:r.meaning})]}),i.jsxs("div",{className:`p-2.5 rounded-lg text-xs italic ${n?"bg-slate-950/60 text-slate-300 border border-slate-800/80":"bg-slate-50 text-slate-700 border border-slate-200"}`,children:["“",r.example,"”"]})]},s))})]}),i.jsx("section",{className:`p-8 sm:p-12 rounded-3xl border text-center transition-all ${n?"bg-gradient-to-b from-slate-900 to-slate-950 border-slate-800 shadow-xl":"bg-gradient-to-b from-emerald-50/80 to-white border-emerald-100 shadow-md"}`,children:i.jsxs("div",{className:"max-w-2xl mx-auto",children:[i.jsx("div",{className:"inline-flex items-center justify-center w-12 h-12 rounded-2xl bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 mb-4 border border-emerald-500/20",children:i.jsx(Er,{className:"w-6 h-6"})}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold tracking-tight mb-4 text-slate-900 dark:text-white",children:"Practice Any Topic with an AI Examiner"}
4821),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-sm sm:text-base leading-relaxed mb-8",children:"Reading questions is only the first step. Test your real-time response speed, phonetic clarity, and grammatical range with Dr. Arthur, Senior British AI Examiner. Get acoustic feedback, band estimates (5.0–9.0), and certified diagnostic reports."}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-3",children:[i.jsxs("button",{onClick:()=>t(),className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-8 py-3.5 rounded-xl font-bold text-sm bg-emerald-600 hover:bg-emerald-500 text-white shadow-lg shadow-emerald-600/20 transition-all cursor-pointer",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:"Start Free 1v1 IELTS Speaking Mock Test →"})]}),i.jsx("a",{href:"/",className:`w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl font-semibold text-sm border transition-all ${n?"bg-slate-900 border-slate-700 hover:bg-slate-800 text-slate-200":"bg-white border-slate-200 hover:bg-slate-50 text-slate-700 shadow-xs"}`,children:i.jsx("span",{children:"Return to RadioShadow Home"})})]})]})})]}),i.jsx("footer",{className:`border-t py-8 text-xs text-center transition-colors ${n?"bg-slate-950 border-slate-800 text-slate-500":"bg-white border-slate-200 text-slate-500"}`,children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsx("p",{children:"© 2026 RadioShadow AI. IELTS Speaking Practice & Language Immersion."}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4",children:[i.jsx("a",{href:"/ielts-speaking-part-1-topics",className:"hover:underline",children:"Part 1 Topics"}),i.jsx("a",{href:"/ielts-speaking-part-2-topics",className:"hover:underline",children:"Part 2 Topics"}),i.jsx("a",{href:"/ielts-speaking-part-3-topics",className:"hover:underline",children:"Part 3 Topics"}),i.jsx("a",{href:"/ielts-speaking-topics-2026",className:"text-emerald-600 font-semibold hover:underline",children:"Full 2026 Topic Bank"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:underline",children:"Full Mock Test"}),i.jsx("a",{href:"/sitemap.xml",className:"hover:underline",children:"Sitemap"})]})]})})]})};function _6e({darkMode:n=!1,onToggleDarkMode:e}){S.useEffect(()=>{document.title="French Listening Practice: Real Radio & Podcasts | RadioShadow";let r=document.querySelector('meta[name="description"]');const s="Level up your French listening practice with authentic French podcasts and live radio. Master native speech, elisions, and pronunciation with AI shadowing.";r?r.setAttribute("content",s):(r=document.createElement("meta"),r.setAttribute("name","description"),r.setAttribute("content",s),document.head.appendChild(r));let a=document.querySelector('link[rel="canonical"]');const o=`${window.location.origin}/french-listening-practice`;a?a.href=o:(a=document.createElement("link"),a.rel="canonical",a.href=o,document.head.appendChild(a))},[]);const t=()=>{window.location.href="/?lang=French"};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsx("header",{className:`sticky top-0 z-30 border-b backdrop-blur-md transition-colors ${n?"bg-slate-900/80 border-slate-800":"bg-white/80 border-slate-200"}`,children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 sm:px-6 h-16 flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("a",{href:"/",className:"flex items-center gap-2.5 text-inherit no-underline hover:opacity-90 transition-opacity",title:"Return to RadioShadow Home",children:[i.jsx("img",{src:mT,alt:"RadioShadow Logo",className:"w-8 h-8 rounded-xl object-cover shadow-xs"}),i.jsxs("span",{className:"font-bold text-base tracking-tight hidden sm:inline",children:["RadioShadow"," ",i.jsx("span",{className:"text-blue-500 font-medium text-xs px-1.5 py-0.5 rounded bg-blue-500/10 border border-blue-500/20",children:"Français"})]})]}),i.jsx("div",{className:`h-4 w-px hidden sm:block ${n?"bg-slate-800":"bg-slate-200"}`}),i.jsxs("nav",{className:"flex items-center gap-1.5 text-xs font-medium","aria-label":"Quick N
4821avigation",children:[i.jsx("a",{href:"/",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Home"}),i.jsx("a",{href:"/learn-spanish",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"Spanish Listening"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:`px-2.5 py-1 rounded-lg transition-colors ${n?"text-slate-400 hover:text-white":"text-slate-600 hover:text-slate-900"}`,children:"IELTS Speaking"})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[e&&i.jsx("button",{onClick:e,className:`p-2 rounded-xl border transition-all cursor-pointer ${n?"bg-slate-800 hover:bg-slate-700 text-amber-400 border-slate-700":"bg-slate-100 hover:bg-slate-200 text-indigo-600 border-slate-200"}`,title:n?"Switch to light mode":"Switch to dark mode",children:n?i.jsx(qc,{className:"w-4 h-4"}):i.jsx(ko,{className:"w-4 h-4"})}),i.jsxs("button",{onClick:t,id:"header-french-practice-btn",className:"px-3.5 py-1.5 rounded-xl text-xs font-bold bg-blue-600 hover:bg-blue-500 text-white shadow-xs transition-all flex items-center gap-1.5 cursor-pointer",children:[i.jsx(cn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Live French Radio"})]})]})]})}),i.jsxs("main",{className:"flex-1 max-w-5xl w-full mx-auto px-4 sm:px-6 py-8 md:py-12",children:[i.jsxs("nav",{"aria-label":"Breadcrumb",className:"mb-4 flex items-center gap-1.5 text-xs text-slate-500 dark:text-slate-400",children:[i.jsx("a",{href:"/",className:"hover:text-blue-600 dark:hover:text-blue-400 hover:underline transition-colors",children:"Home"}),i.jsx(qn,{className:"w-3 h-3 text-slate-400"}),i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:"French Listening Practice"})]}),i.jsxs("section",{className:"mb-12",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full text-xs font-semibold mb-3 bg-blue-500/10 text-blue-600 dark:text-blue-400 border border-blue-500/20",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Authentic Immersion • RFI • RTL France • FIP Paris"})]}),i.jsx("h1",{className:"text-2xl sm:text-3xl md:text-4xl font-extrabold tracking-tight mb-4 text-slate-900 dark:text-white",children:"French Listening Practice with Real Radio & Podcasts"}),i.jsx("p",{className:"text-base sm:text-lg leading-relaxed text-slate-600 dark:text-slate-300 max-w-3xl mb-8",children:"Immerse yourself in authentic French spoken cadence. From cultural talk shows to live Parisian news broadcasts, train your ears on authentic elisions, unscripted dialogues, and native intonation with real-time AI shadowing."}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[i.jsxs("button",{onClick:t,id:"french-listening-cta-primary-btn",className:"inline-flex items-center justify-center gap-2.5 px-6 py-3.5 rounded-xl font-bold text-base bg-blue-600 hover:bg-blue-500 text-white shadow-md hover:shadow-lg transition-all transform active:scale-98 cursor-pointer",children:[i.jsx(Er,{className:"w-5 h-5"}),i.jsx("span",{children:"Practice French Listening Now"}),i.jsx(qr,{className:"w-4 h-4 ml-1"})]}),i.jsxs("a",{href:"#podcast-levels",className:`inline-flex items-center gap-1.5 px-4 py-3 rounded-xl font-medium text-sm border transition-colors ${n?"bg-slate-900 hover:bg-slate-800 text-slate-300 border-slate-700":"bg-white hover:bg-slate-100 text-slate-700 border-slate-300"}`,children:[i.jsx("span",{children:"Explore Level Guidelines"}),i.jsx(qn,{className:"w-4 h-4 text-slate-400"})]})]})]}),i.jsx("section",{"aria-labelledby":"why-real-radio-heading",className:"mb-12",children:i.jsxs("div",{className:`p-6 sm:p-8 rounded-2xl border transition-colors ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(cn,{className:"w-5 h-5 text-blue-500"}),i.jsx("h2",{id:"why-real-radio-heading",className:"text-xl sm:text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Why Real French Radio Beats Synthetic Audio"})]}
4821),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-base leading-relaxed mb-3",children:"Traditional language apps and textbook audios rely heavily on sterilized, slowed-down studio recordings that fail to prepare you for spontaneous speech. Authentic French radio exposes your ears to natural liaisons, casual contractions, varied regional cadences, and realistic conversational rhythm. Tuning into real broadcasts trains your ear to decipher connected speech as it is truly spoken on the streets of Paris, Lyon, and Montreal."}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 pt-3",children:[i.jsxs("div",{className:`p-3 rounded-xl border text-xs ${n?"bg-slate-950/60 border-slate-800 text-slate-300":"bg-blue-50/50 border-blue-100 text-slate-700"}`,children:[i.jsx("span",{className:"font-bold text-blue-600 dark:text-blue-400 block mb-1",children:"Authentic Liaisons"}),"Master interconnected word boundaries like “les amis” and “vous avez” in real context."]}),i.jsxs("div",{className:`p-3 rounded-xl border text-xs ${n?"bg-slate-950/60 border-slate-800 text-slate-300":"bg-blue-50/50 border-blue-100 text-slate-700"}`,children:[i.jsx("span",{className:"font-bold text-blue-600 dark:text-blue-400 block mb-1",children:"Spontaneous Rhythm"}),"Acclimate your brain to organic speech velocity, realistic pauses, and natural filler sounds."]}),i.jsxs("div",{className:`p-3 rounded-xl border text-xs ${n?"bg-slate-950/60 border-slate-800 text-slate-300":"bg-blue-50/50 border-blue-100 text-slate-700"}`,children:[i.jsx("span",{className:"font-bold text-blue-600 dark:text-blue-400 block mb-1",children:"Cultural Nuance"}),"Absorb contemporary slang, idiomatic expressions, and topical humor from live French commentators."]})]})]})}),i.jsxs("section",{id:"podcast-levels","aria-labelledby":"french-podcasts-level-heading",className:"mb-12",children:[i.jsxs("div",{className:"flex items-center justify-between mb-6 pb-3 border-b border-slate-200 dark:border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(q2,{className:"w-5 h-5 text-blue-500"}),i.jsx("h2",{id:"french-podcasts-level-heading",className:"text-xl sm:text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"French Podcasts for Every Level"})]}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:"CEFR A1 to C1 Progression"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{className:`p-6 rounded-2xl border flex flex-col justify-between transition-all ${n?"bg-slate-900/60 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300 shadow-xs"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold bg-emerald-500/15 text-emerald-700 dark:text-emerald-400",children:"A1–A2 Basics"}),i.jsx(Ys,{className:"w-4 h-4 text-emerald-500"})]}),i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-slate-100 mb-2",children:"Beginner (A1–A2)"}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 leading-relaxed mb-4",children:"Curated French language learning podcasts bridge the gap between classroom theory and real-world conversation with crystal-clear articulation. Engaging French podcasts for learners introduce everyday vocabulary, standard grammar, and essential greetings without overwhelming you. Listening to short contextual dialogues for 10 minutes a day builds early auditory comprehension and speech familiarity."})]}),i.jsxs("div",{className:"pt-3 border-t border-slate-100 dark:border-slate-800 text-xs text-slate-500 dark:text-slate-400",children:[i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:"Recommended Focus:"})," Daily routines, present tense verbs, and fundamental phonemes."]})]}),i.jsxs("div",{className:`p-6 rounded-2xl border flex flex-col justify-between transition-all ${n?"bg-slate-900/60 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300 shadow-xs"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold bg-blue-500/15 text-blue-700 dark:text-blue-400",children:"B1–B2 Independent"}),i.jsx(xi,{className:"w-4 h-4 text-blue-500"})]}),i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-slate-100 mb-2",children:"Intermediate (B1–B2)"}
vendor: 4,389 bytes, line 4821
4821),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 leading-relaxed mb-4",children:"If you are pursuing focused French listening practice intermediate milestones, it is time to move beyond scripted materials into semi-authentic cultural shows. Engaging with interviews, story-driven narratives, and current events allows you to absorb complex verb tenses like the subjunctive and conditional naturally. This stage bridges conversational comfort with deeper topical fluency."})]}),i.jsxs("div",{className:"pt-3 border-t border-slate-100 dark:border-slate-800 text-xs text-slate-500 dark:text-slate-400",children:[i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:"Recommended Focus:"})," Passé composé vs. imparfait, narrative flow, and opinion phrasing."]})]}),i.jsxs("div",{className:`p-6 rounded-2xl border flex flex-col justify-between transition-all ${n?"bg-slate-900/60 border-slate-800 hover:border-slate-700":"bg-white border-slate-200 hover:border-slate-300 shadow-xs"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold bg-purple-500/15 text-purple-700 dark:text-purple-400",children:"C1 Mastery"}),i.jsx(yn,{className:"w-4 h-4 text-purple-500"})]}),i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-slate-100 mb-2",children:"Advanced (C1)"}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 leading-relaxed mb-4",children:"Advanced learners thrive on rapid-fire panel debates, philosophical discussions, and unfiltered news broadcasts from premier stations like France Inter and RFI. Deciphering colloquial idioms, humorous sarcasm, and overlapping dialogue sharpens your spontaneous cognitive reflexes. Regular immersion at this tier ensures effortless fluency during academic exams, professional meetings, and native discussions."})]}),i.jsxs("div",{className:"pt-3 border-t border-slate-100 dark:border-slate-800 text-xs text-slate-500 dark:text-slate-400",children:[i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:"Recommended Focus:"})," Fast connected speech, cultural subtext, and formal DALF debates."]})]})]})]}),i.jsx("section",{"aria-labelledby":"how-shadowing-works-heading",className:"mb-12",children:i.jsxs("div",{className:`p-6 sm:p-8 rounded-2xl border transition-colors ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200 shadow-xs"}`,children:[i.jsxs("div",{className:"flex items-center gap-2 mb-3",children:[i.jsx(on,{className:"w-5 h-5 text-blue-500"}),i.jsx("h2",{id:"how-shadowing-works-heading",className:"text-xl sm:text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"How Shadowing Improves Your French Listening"})]}),i.jsx("p",{className:"text-slate-600 dark:text-slate-300 text-base leading-relaxed mb-4",children:"Shadowing involves vocalizing along with native speech with only a micro-second delay, forcing your auditory cortex and articulatory muscles into synchronization. When you learn French by listening and simultaneously mirroring authentic acoustic cues, you conquer tricky nasal vowels and silent letters far faster. RadioShadow pairs live broadcast streaming with synchronized bilingual transcripts to deliver instant pronunciation diagnostics."}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-4 mt-4",children:[i.jsxs("div",{className:`p-4 rounded-xl border flex items-start gap-3 ${n?"bg-slate-950/60 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsx(vn,{className:"w-5 h-5 text-blue-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100",children:"Auditory-Motor Synchronization"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mt-1",children:"Closing the perceptual gap between hearing and speaking helps you recognize fast-paced liaison and elision patterns instantly."})]})]}),i.jsxs("div",{className:`p-4 rounded-xl border flex items-start gap-3 ${n?"bg-slate-950/60 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsx(vn,{className:"w-5 h-5 text-blue-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("h4",{className:"font-bold text-sm text-slate-900 dark:text-slate-100",children:"Live Feedback & Subtitles"}
4821),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mt-1",children:"Follow real-time transcripts and toggle French-English subtitles to verify challenging phrases and idiomatic vocabulary on the fly."})]})]})]})]})}),i.jsxs("section",{className:`p-6 sm:p-8 rounded-2xl border text-center transition-all ${n?"bg-gradient-to-b from-slate-900 to-slate-900/80 border-slate-800":"bg-gradient-to-b from-blue-50/60 to-white border-blue-100"}`,children:[i.jsx("h2",{className:"text-xl sm:text-2xl font-bold mb-2 text-slate-900 dark:text-white",children:"Ready to transform your French listening fluency?"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 max-w-xl mx-auto mb-6",children:"Tune into live French news, Parisian music commentary, and cultural broadcasts. Shadow native broadcasters and accelerate your comprehension today."}),i.jsxs("button",{onClick:t,id:"french-listening-cta-bottom-btn",className:"inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-xl font-bold text-base bg-blue-600 hover:bg-blue-500 text-white shadow-md transition-all cursor-pointer",children:[i.jsx(Er,{className:"w-5 h-5"}),i.jsx("span",{children:"Practice French Listening Now"}),i.jsx(qr,{className:"w-4 h-4 ml-1"})]})]})]}),i.jsx("footer",{className:`border-t py-6 text-xs text-center transition-colors ${n?"bg-slate-950 border-slate-800 text-slate-500":"bg-white border-slate-200 text-slate-400"}`,children:i.jsxs("div",{className:"max-w-7xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between gap-3",children:[i.jsxs("p",{children:["© ",new Date().getFullYear()," RadioShadow AI. Real-Time Language Immersion & Speech Shadowing."]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("a",{href:"/french-listening-practice",className:"hover:underline font-semibold text-blue-600 dark:text-blue-400",children:"French Practice"}),i.jsx("a",{href:"/spanish-pronunciation",className:"hover:underline",children:"Spanish Coach"}),i.jsx("a",{href:"/learn-spanish",className:"hover:underline",children:"Spanish Listening"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:underline",children:"IELTS Speaking"}),i.jsx("a",{href:"/blog",className:"hover:underline",children:"Publications"})]})]})})]})}const I6e="https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",d0=[{written:"¿Cómo ha estado usted?",phonetic:"[ko-mas-ta-dow-steð]",translation:"How have you been?",ruleExplanation:"The 'o' in 'Cómo' and the silent 'h' in 'ha' + 'e' in 'estado' merge into one continuous vowel glide [o-a-e]. In live Madrid radio, this is uttered in under 0.4 seconds.",highlightWords:["Cómo","ha","estado","usted"]},{written:"Va a hablar de la economía actual.",phonetic:"[ba-vlar-de-la-e-ko-no-mi-a-ak-twal]",translation:"He is going to speak about the current economy.",ruleExplanation:"'Va a hablar' contracts into a single prolonged [ba-vlar]. The double 'a' collapses and the silent 'h' vanishes entirely from the acoustic wave.",highlightWords:["Va","a","hablar"]},{written:"Todo el día estamos cansados.",phonetic:"[to-el-di-a-es-ta-mos-kan-sa-os]",translation:"All day we are tired.",ruleExplanation:"Intervocalic 'd' in 'cansados' undergoes lenition/deletion [kan-sa-os], and 'Todo el' merges into [to-el]. This is standard in European broadcast discourse.",highlightWords:["Todo","el","cansados"]}],D6e=[{q:"Why do I understand textbook Spanish but struggle with native Spanish podcasts & real-world audio?",a:"Textbook audio is recorded in sound booths with artificial pauses (120-140 words/min) and clear word separation. Real Spanish podcasts and authentic conversations from Spain (RTVE/Cadena SER) and Latin America operate at 190-220 words/minute with frequent 'sinalefa' (vowel linking across words) and intervocalic 'd' softening. Podcast shadowing and active listening practice train your brain's auditory cortex to parse these acoustic contractions in real time."},{q:"What is the recommended daily Spanish listening practice routine with podcasts?",a:"We recommend a 15-minute 3-step routine: 1) 3 minutes of passive podcast listening to prime your ear; 2) 7 minutes of active sentence-by-sentence shadowing with synchronized transcripts; 3) 5 minutes of continuous shadowing or 1v1 AI examiner simulation to benchmark your spoken cadence."},{q:"Is RadioShadow aligned with official DELE / SIELE exams?",a:"Yes. Our acoustic scoring models and vocabulary highlights are benchmarked directly against CEFR (A1 through C2) and Instituto Cervantes DELE/SIELE spoken descriptor rubrics, focusing on Fluency, Phonetic Precision, Discourse Markers, and Rhythm."},{q:"Do I need an account or subscription to practice listening to Spanish podcasts and audio streams?",a:"No. You can listen to authentic RTVE and global Spanish podcasts and audio streams completely free with zero registration. Advanced features like 1v1 AI examiner feedback, multi-speaker live STT transcription, and vocabulary notebooks offer free trial evaluations."}];function j6e({darkMode:n=!1,onToggleDarkMode:e,onOpenPaywall:t,onOpenAuthModal:r}){const{t:s,isZh:a}=Or(),[o,l]=S.useState("live"),[c,d]=S.useState(!1),[h,m]=S.useState(!1),[p,x]=S.useState(.85),[y,v]=S.useState(0),[B,E]=S.useState(0),[N,T]=S.useState(!1),k=S.useRef(null),P=()=>
4821{k.current||(k.current=new Audio(I6e),k.current.volume=p),c?(k.current.pause(),d(!1)):k.current.play().then(()=>d(!0)).catch(D=>{console.warn("Audio play blocked or error:",D),d(!1)})},R=()=>{k.current&&(k.current.muted=!h,m(!h))},_=D=>{const j=parseFloat(D.target.value);x(j),k.current&&(k.current.volume=j,j>0&&h&&(k.current.muted=!1,m(!1)))},I=D=>{if(typeof window<"u"&&"speechSynthesis"in window){window.speechSynthesis.cancel();const j=new SpeechSynthesisUtterance(D);j.lang="es-ES",j.rate=.9,j.onstart=()=>T(!0),j.onend=()=>T(!1),j.onerror=()=>T(!1),window.speechSynthesis.speak(j)}};return S.useEffect(()=>()=>{k.current&&(k.current.pause(),k.current=null),typeof window<"u"&&"speechSynthesis"in window&&window.speechSynthesis.cancel()},[]),i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors duration-300 relative ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[e&&i.jsx("button",{id:"theme-toggle-floating-btn",onClick:e,className:"fixed bottom-24 left-4 md:left-6 z-40 p-2.5 rounded-xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-md hover:bg-white dark:hover:bg-slate-800 border border-slate-200/60 dark:border-slate-800/60 text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 transition-all shadow-md active:scale-95 cursor-pointer select-none flex items-center justify-center group",title:n?s.common.switchTheme||"Switch to Light Mode":s.common.switchTheme||"Switch to Dark Mode","aria-label":s.common.switchTheme||"Toggle theme",children:n?i.jsx(qc,{className:"w-4 h-4 text-amber-500 group-hover:rotate-45 transition-transform"}):i.jsx(ko,{className:"w-4 h-4 text-indigo-500 dark:text-indigo-400 group-hover:-rotate-12 transition-transform"})}),i.jsx(sp,{activeTrack:o,setActiveTrack:l,onOpenPaywall:t,onOpenExaminer:()=>{window.location.href="/ielts-speaking-mock-test"}}),i.jsxs("main",{className:"flex-1 max-w-6xl mx-auto w-full px-4 sm:px-6 py-6 sm:py-10 space-y-12 sm:space-y-16",children:[i.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500 font-mono",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-medium",children:"Spanish Listening Practice"})]}),i.jsxs("section",{className:`relative overflow-hidden rounded-3xl p-6 sm:p-10 lg:p-12 border shadow-xl transition-colors ${n?"bg-gradient-to-b from-slate-900 via-slate-900/90 to-slate-950 border-slate-800":"bg-gradient-to-b from-white via-emerald-50/20 to-white border-slate-200/80 shadow-slate-200/50"}`,children:[i.jsx("div",{className:"absolute top-0 right-0 w-96 h-96 bg-emerald-500/10 rounded-full blur-3xl pointer-events-none"}),i.jsx("div",{className:"absolute bottom-0 left-0 w-80 h-80 bg-teal-500/10 rounded-full blur-3xl pointer-events-none"}),i.jsxs("div",{className:"relative z-10 max-w-3xl space-y-6",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold tracking-wide",children:[i.jsx(Cv,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"SPAIN & LATAM NATIVE PODCASTS & AUDIO PRACTICE"})]}),i.jsxs("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold tracking-tight leading-[1.15] text-slate-900 dark:text-white",children:["Spanish Listening Practice: ",i.jsx("span",{className:"bg-gradient-to-r from-emerald-600 via-teal-500 to-emerald-400 dark:from-emerald-400 dark:via-teal-300 dark:to-emerald-200 bg-clip-text text-transparent",children:"Learn with Native Podcasts & Audio Shadowing"})]}),i.jsxs("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 leading-relaxed max-w-2xl",children:["Break past the intermediate listening plateau. Stream authentic Spanish podcasts and audio lessons from ",i.jsx("strong",{children:"RTVE"})," and ",i.jsx("strong",{children:"Cadena SER"}),", master rapid ",i.jsx("em",{children:"sinalefa"})," contractions, and calibrate your spoken rhythm with CEFR-aligned AI speech diagnostics."]}),i.jsxs("div",{className:`p-4 sm:p-5 rounded-2xl border flex flex-col sm:flex-row items-stretch sm:items-center justify-between gap-4 shadow-md transition-colors ${n?"bg-slate-950/80 border-slate-800":"bg-slate-50 border-slate-200 shadow-slate-100"}`,children:[i.jsxs("div",{className:"flex items-center gap-3.5",children:[i.jsx("button",{onClick:P,className:"w-12 h-12 rounded-2xl bg-emerald-500 hover:bg-emerald-400 text-slate-950 flex items-center justify-center shrink-0 transition-transform active:scale-95 shadow-lg shadow-emerald-500/30 cursor-pointer","aria-label":c?"Pause RTVE audio stream":"Play RTVE live podcast stream",children:c?i.jsx(Fh,{className:"w-6 h-6 fill-current"}):i.jsx(Xa,{className:"w-6 h-6 fill-current ml-0.5"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"font-bold text-sm text-slate-900 dark:text-white",children:"Cadena SER (España Podcasts & Talk)"}),i.jsxs("span",{className:"inline-flex items-center gap-1 text-[10px] font-mono px-2 py-0.5 rounded-full bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 font-semibold border border-emerald-500/20",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),"LIVE AUDIO STREAM"]})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Madrid, Spain • European Spanish • Podcasts, News & Culture • 190–220 wpm"})]})]}),i.jsxs("div",{className:"flex items-center gap-3 sm:gap-4 justify-between sm:justify-end",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("button",{onClick:R,className:"text-slate-400 hover:text-slate-600 dar
4821k:hover:text-slate-200 p-1.5 rounded-lg hover:bg-slate-200 dark:hover:bg-slate-800 transition-colors",children:h||p===0?i.jsx(mS,{className:"w-4 h-4 text-rose-400"}):i.jsx(on,{className:"w-4 h-4"})}),i.jsx("input",{type:"range",min:"0",max:"1",step:"0.05",value:h?0:p,onChange:_,className:"w-20 accent-emerald-500 h-1.5 bg-slate-200 dark:bg-slate-700 rounded-lg cursor-pointer","aria-label":"Stream volume"})]}),i.jsxs("a",{href:"/?station=es-rne&autoplay=1",className:"px-4 py-2 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white text-xs font-bold transition-all flex items-center gap-1.5 shrink-0 shadow-sm",children:[i.jsx("span",{children:"Open Full HUD"}),i.jsx(qn,{className:"w-3.5 h-3.5"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-3 pt-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-600 dark:text-slate-300",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-500 shrink-0"}),i.jsx("span",{children:"Zero Scripted Staging"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-600 dark:text-slate-300",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-500 shrink-0"}),i.jsx("span",{children:"Bilingual Live Subtitles"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-600 dark:text-slate-300",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-500 shrink-0"}),i.jsx("span",{children:"Sinalefa Vowel Analysis"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs text-slate-600 dark:text-slate-300",children:[i.jsx(vn,{className:"w-4 h-4 text-emerald-500 shrink-0"}),i.jsx("span",{children:"DELE & SIELE Rubrics"})]})]})]})]}),i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider uppercase",children:"Acoustic Phonetics Breakdown"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:'Why Native Spanish Podcasts Sound "Fast" & How Listening Practice Solves It'}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 max-w-3xl leading-relaxed",children:"Spanish is a syllable-timed language. Unlike English stress intervals, every Spanish syllable consumes nearly the same temporal window, while word boundaries blend continuously in native podcast conversations."})]}),i.jsxs("div",{className:"grid sm:grid-cols-3 gap-5",children:[i.jsxs("div",{className:`p-6 rounded-2xl border space-y-3 transition-colors ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 flex items-center justify-center font-mono font-bold text-base",children:"01"}),i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-white",children:"Sinalefa (Vowel Merging)"}),i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:["When a word ends in a vowel and the subsequent word begins with a vowel (or silent ",i.jsx("em",{children:"h"}),"), they fuse into a single acoustic diphthong/triphthong in native podcast dialogue."]}),i.jsx("div",{className:`p-2.5 rounded-xl border text-xs font-mono text-amber-600 dark:text-amber-400 ${n?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:'"¿Cómo ha estado?" → [ko-mas-ta-do]'})]}),i.jsxs("div",{className:`p-6 rounded-2xl border space-y-3 transition-colors ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-teal-500/10 text-teal-600 dark:text-teal-400 flex items-center justify-center font-mono font-bold text-base",children:"02"}),i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-white",children:"Intervocalic 'd' Softening"}),i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:["The letter ",i.jsx("em",{children:"d"})," positioned between vowels is articulated as an approximant [ð] or omitted entirely in natural speech (-ado becomes -ao)."]}),i.jsx("div",{className:`p-2.5 rounded-xl border text-xs font-mono text-amber-600 dar
4821k:text-amber-400 ${n?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:'"cansado" → [kan-sa-o]'})]}),i.jsxs("div",{className:`p-6 rounded-2xl border space-y-3 transition-colors ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsx("div",{className:"w-10 h-10 rounded-xl bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 flex items-center justify-center font-mono font-bold text-base",children:"03"}),i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-white",children:"High Syllabic Velocity"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:"Native podcast hosts maintain a rapid output of 7.82 syllables/second (190–220 words per minute), requiring high auditory reflex training."}),i.jsx("div",{className:`p-2.5 rounded-xl border text-xs font-mono text-amber-600 dark:text-amber-400 ${n?"bg-slate-950 border-slate-800":"bg-slate-50 border-slate-200"}`,children:"7.82 syll/sec vs 6.19 in English"})]})]})]}),i.jsxs("section",{className:`p-6 sm:p-8 rounded-3xl border space-y-6 transition-colors ${n?"bg-slate-900/40 border-slate-800":"bg-white border-slate-200 shadow-md"}`,children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider uppercase",children:"Interactive Acoustic Calibration"}),i.jsx("h2",{className:"text-xl sm:text-2xl font-bold text-slate-900 dark:text-white mt-1",children:"Listen & Verify: Sinalefa Sound Shifts"})]}),i.jsx("div",{className:"flex items-center gap-1.5 p-1 rounded-xl bg-slate-100 dark:bg-slate-950 border border-slate-200 dark:border-slate-800",children:d0.map((D,j)=>i.jsxs("button",{onClick:()=>E(j),className:`px-3 py-1.5 rounded-lg text-xs font-semibold transition-all cursor-pointer ${B===j?"bg-emerald-600 text-white shadow-sm":"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:["Example ",j+1]},j))})]}),i.jsxs("div",{className:`p-6 rounded-2xl border space-y-5 transition-colors ${n?"bg-slate-950/70 border-slate-800":"bg-slate-50 border-slate-200"}`,children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[11px] font-mono text-slate-500 uppercase",children:"Written Spanish"}),i.jsx("p",{className:"text-lg sm:text-xl font-bold text-slate-900 dark:text-white mt-0.5",children:d0[B].written}),i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-400 mt-1",children:['Translation: "',d0[B].translation,'"']})]}),i.jsxs("button",{onClick:()=>I(d0[B].written),disabled:N,className:"px-4 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center gap-2 self-start sm:self-auto shadow-md transition-all active:scale-95 disabled:opacity-50 cursor-pointer",children:[i.jsx(on,{className:`w-4 h-4 ${N?"animate-bounce":""}`}),i.jsx("span",{children:N?"Pronouncing...":"Hear Native Audio"})]})]}),i.jsxs("div",{className:"grid sm:grid-cols-2 gap-4 text-xs",children:[i.jsxs("div",{className:`p-4 rounded-xl border ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200"}`,children:[i.jsx("span",{className:"text-slate-500 font-mono text-[10px] uppercase block mb-1",children:"Connected Phonetic Cadence (IPA Approximation)"}),i.jsx("p",{className:"font-mono text-sm font-bold text-amber-600 dark:text-amber-400",children:d0[B].phonetic})]}),i.jsxs("div",{className:`p-4 rounded-xl border ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200"}`,children:[i.jsx("span",{className:"text-slate-500 font-mono text-[10px] uppercase block mb-1",children:"Linguistic Acoustic Rule"}),i.jsx("p",{className:"text-slate-700 dark:text-slate-300 leading-relaxed",children:d0[B].ruleExplanation})]})]})]})]}),i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2 text-center max-w-2xl mx-auto",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider up
4821percase",children:"Scientific Training Protocol"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:"The 3-Step Spanish Podcast Listening & Shadowing Protocol"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400 leading-relaxed",children:"How simultaneous speech shadowing converts passive podcast listening into active conversational fluency."})]}),i.jsxs("div",{className:"grid sm:grid-cols-3 gap-5",children:[i.jsxs("div",{className:`p-6 rounded-2xl border space-y-3 relative overflow-hidden transition-colors ${n?"bg-slate-900/70 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsx("span",{className:"w-8 h-8 rounded-full bg-emerald-500/20 text-emerald-600 dark:text-emerald-400 font-mono font-extrabold text-sm flex items-center justify-center border border-emerald-500/30",children:"1"}),i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-white",children:"Comprensión Global (Passive Priming)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:"Listen to a 3-minute continuous stream from RTVE or Cadena SER podcasts without reading transcripts. Prime your brain for vocal pitch contours and sentence emotional weight."})]}),i.jsxs("div",{className:`p-6 rounded-2xl border space-y-3 relative overflow-hidden transition-colors ${n?"bg-slate-900/70 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsx("span",{className:"w-8 h-8 rounded-full bg-teal-500/20 text-teal-600 dark:text-teal-400 font-mono font-extrabold text-sm flex items-center justify-center border border-teal-500/30",children:"2"}),i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-white",children:"Mapeo de Sinalefas (Chunking)"}),i.jsxs("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:["Review the live transcript. Identify cross-word vowel connections (e.g. ",i.jsx("em",{children:"de acuerdo"})," → ",i.jsx("em",{children:"[dwa-kwer-do]"}),") and mark natural breath boundaries."]})]}),i.jsxs("div",{className:`p-6 rounded-2xl border space-y-3 relative overflow-hidden transition-colors ${n?"bg-slate-900/70 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsx("span",{className:"w-8 h-8 rounded-full bg-indigo-500/20 text-indigo-600 dark:text-indigo-400 font-mono font-extrabold text-sm flex items-center justify-center border border-indigo-500/30",children:"3"}),i.jsx("h3",{className:"font-bold text-base text-slate-900 dark:text-white",children:"Shadowing Simultáneo (0.3s Speech Lag)"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:"Speak aloud 0.3 seconds behind the native podcast speaker. Mirror pitch fluctuations, sentence terminal drops, and vowel duration to build muscle memory."})]})]})]}),i.jsxs("section",{className:"space-y-4",children:[i.jsx("div",{className:`p-6 sm:p-8 rounded-3xl border transition-colors ${n?"bg-slate-900/70 border-slate-800":"bg-gradient-to-r from-emerald-50/60 to-white border-emerald-200 shadow-sm"}`,children:i.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[i.jsxs("div",{className:"space-y-2 max-w-xl",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Essential Spanish Scenario · Real-Time Audio & AI Scoring"})]}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-white",children:"How to Say “Nice to Meet You” in Spanish (10+ Phrases)"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"Meeting clients, friends, or dates? Learn authentic greeting phrases with Castilian and Latin American pronunciation, one-click recording, and AI acoustic feedback."})]}),i.jsxs("a",{href:"/nice-to-meet-you-in-spanish",className:"inline-flex items-center gap-2 px-5 py-3 rounded-2xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/20 active:scale-95 transition-all shrink-0",children:[i.jsx("span",{children:"Practice Greeting Phrases"}),i.jsx(qr,{className:"w-4 h-4"})]})]})}),i.jsx("div",{className:`p-6 sm:p-8 rounded-3xl border transition-colors ${n?"bg-slate-900/70 border-slate-800":"bg-gradient-to-r from-blue-50/60 via-indigo-50/40 to-white border-blue-200/80 shadow-sm"}`,children:i.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[i.jsxs("div",{className:"space-y-2 max-w-xl",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-blue-500/10 text-blue-600 dar
4821k:text-blue-400 text-xs font-mono font-bold",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Essential Spanish Scenario · Self-Introduction & Ice-Breakers"})]}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-white",children:"How to Introduce Yourself in Spanish (10+ Phrases + Audio)"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"Master Me llamo, Soy de, Tengo años, and Vivo en with phonetic double-L tips, native audio recordings, and instant AI pronunciation scoring."})]}),i.jsxs("a",{href:"/how-to-introduce-yourself-in-spanish",className:"inline-flex items-center gap-2 px-5 py-3 rounded-2xl bg-gradient-to-r from-blue-600 to-indigo-600 hover:from-blue-500 hover:to-indigo-500 text-white font-bold text-sm shadow-lg shadow-blue-600/20 active:scale-95 transition-all shrink-0",children:[i.jsx("span",{children:"Practice Introductions"}),i.jsx(qr,{className:"w-4 h-4"})]})]})}),i.jsx("div",{className:`p-6 sm:p-8 rounded-3xl border transition-colors ${n?"bg-slate-900/70 border-slate-800":"bg-gradient-to-r from-amber-50/60 via-emerald-50/40 to-white border-amber-200/80 shadow-sm"}`,children:i.jsxs("div",{className:"flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[i.jsxs("div",{className:"space-y-2 max-w-xl",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400 text-xs font-mono font-bold",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Essential Spanish Scenario · Restaurant & Tapas Ordering"})]}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-white",children:"How to Order Food in Spanish (20+ Phrases + Audio)"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"Order food with confidence without pointing at menus! Master Quisiera, ¿Me trae...?, and La cuenta por favor with native audio and AI pronunciation feedback."})]}),i.jsxs("a",{href:"/how-to-order-food-in-spanish",className:"inline-flex items-center gap-2 px-5 py-3 rounded-2xl bg-gradient-to-r from-emerald-600 to-teal-600 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/20 active:scale-95 transition-all shrink-0",children:[i.jsx("span",{children:"Practice Ordering Food"}),i.jsx(qr,{className:"w-4 h-4"})]})]})})]}),i.jsx("section",{className:"relative overflow-hidden rounded-3xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-700 text-white p-8 sm:p-12 shadow-2xl",children:i.jsxs("div",{className:"max-w-2xl space-y-4 relative z-10",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-white/15 backdrop-blur-md text-emerald-100 text-xs font-mono font-semibold",children:[i.jsx(yn,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"DELE & SIELE ALIGNED ORAL EVALUATION"})]}),i.jsx("h2",{className:"text-2xl sm:text-4xl font-extrabold tracking-tight",children:"Test Your Spoken Spanish with our 1v1 AI Oral Examiner"}),i.jsx("p",{className:"text-sm text-emerald-100 leading-relaxed",children:"Step into a real-time conversational simulation based on authentic Spanish podcast topics. Receive instant feedback on your fluency, pronunciation, grammar range, and CEFR level."}),i.jsxs("div",{className:"pt-2 flex flex-wrap gap-3",children:[i.jsxs("a",{href:"/?station=es-rne&autoplay=1",className:"px-6 py-3 rounded-xl bg-white text-slate-950 font-bold text-sm shadow-lg hover:bg-emerald-50 transition-all hover:scale-105 active:scale-95 flex items-center gap-2",children:[i.jsx("span",{children:"Start Spanish Listening Practice"}),i.jsx(qr,{className:"w-4 h-4"})]}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"px-5 py-3 rounded-xl bg-white/15 hover:bg-white/25 text-white font-semibold text-sm backdrop-blur-md transition-all border border-white/20",children:"Take IELTS Speaking Test"})]})]})}),i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider up
4821percase",children:"Common Questions"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:"Frequently Asked Questions (FAQ)"})]}),i.jsx("div",{className:"space-y-3",children:D6e.map((D,j)=>{const O=y===j;return i.jsxs("div",{className:`rounded-2xl border transition-all overflow-hidden ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200 shadow-sm"}`,children:[i.jsxs("button",{onClick:()=>v(O?null:j),className:"w-full px-6 py-4.5 text-left flex items-center justify-between gap-4 cursor-pointer hover:bg-slate-100/50 dark:hover:bg-slate-800/40 transition-colors",children:[i.jsx("span",{className:"font-bold text-sm sm:text-base text-slate-900 dark:text-white",children:D.q}),i.jsx(qn,{className:`w-4 h-4 text-slate-400 transition-transform duration-200 shrink-0 ${O?"rotate-90 text-emerald-600 dark:text-emerald-400":""}`})]}),O&&i.jsx("div",{className:"px-6 pb-5 pt-1 text-xs sm:text-sm text-slate-600 dark:text-slate-400 leading-relaxed border-t border-slate-100 dark:border-slate-800/60",children:D.a})]},j)})})]})]}),i.jsxs("footer",{className:`border-t px-4 sm:px-6 py-10 text-xs transition-colors ${n?"bg-slate-950 border-slate-900 text-slate-400":"bg-white border-slate-200 text-slate-600"}`,children:[i.jsxs("div",{className:"max-w-7xl mx-auto grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-8 mb-8",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"w-6 h-6 rounded-lg bg-emerald-500 p-0.5",children:i.jsx("img",{src:"/radioshadow_app_logo.jpg",alt:"RadioShadow AI",className:"w-full h-full object-cover rounded-[6px]"})}),i.jsx("span",{className:"font-bold text-sm text-slate-900 dark:text-white",children:"RadioShadow AI"})]}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-xs leading-relaxed",children:"Global language acquisition and podcast shadowing platform connecting learners to authentic native conversations, podcasts, and audio streams worldwide."})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-slate-200 uppercase tracking-wider text-[11px] font-mono",children:"Listening Practice Hubs"}),i.jsxs("ul",{className:"space-y-1.5",children:[i.jsx("li",{children:i.jsx("a",{href:"/learn-spanish",className:"text-emerald-600 dark:text-emerald-400 font-semibold hover:underline",children:"Spanish Listening Practice (西语听力)"})}),i.jsx("li",{children:i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Nice to Meet You in Spanish (Greetings)"})}),i.jsx("li",{children:i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"How to Introduce Yourself in Spanish (Self-Introductions)"})}),i.jsx("li",{children:i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"How to Order Food in Spanish (Restaurant & Dining)"})}),i.jsx("li",{children:i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:text-slate-900 dark:hover:text-slate-200 transition-colors",children:"IELTS Speaking Simulation (雅思模考)"})}),i.jsx("li",{children:i.jsx("a",{href:"/blog",className:"hover:text-slate-900 dark:hover:text-slate-200 transition-colors",children:"Language Shadowing Blog (专栏)"})}),i.jsx("li",{children:i.jsx("a",{href:"/",className:"hover:text-slate-900 dark:hover:text-slate-200 transition-colors",children:"Global World Radio Player (全球电台)"})})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-slate-200 uppercase tracking-wider text-[11px] font-mono",children:"Linguistic Standards"}),i.jsxs("ul",{className:"space-y-1.5 text-slate-500 dark:text-slate-400",children:[i.jsx("li",{children:"Instituto Cervantes DELE A1-C2"}),i.jsx("li",{children:"SIELE Global Certification"}),i.jsx("li",{children:"Cambridge IELTS Speaking Rubrics"}),i.jsx("li",{children:"CEFR European Language Framework"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-slate-200 uppercase tracking-wider text-[11px] font-mono",children:"Legal & Verification"}),i.jsxs("ul",{className:"space-y-1.5 text-slate-500 dark:text-slate-400",children:[i.jsx("li",{children:"© 2026 RadioShadow AI. All rights reserved."}),i.jsx("li",{children:"Authentic Broadcast Streaming"}),i.jsx("li",{children:"Low-Latency Speech AI Analysis"})]})]})]}),i.jsxs("div",{className:"max-w-7xl mx-auto pt-6 border-t border-slate-200 dark:border-slate-900 flex flex-col sm:flex-row items-center justify-between gap-4 text-[11px] text-slate-500",children:[i.jsx("p",{children:"© 2026 RadioShadow AI. Global Live Radio Shadowing & Spoken Diagnostics."}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[i.jsx("a",{href:"/",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Home"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-slate-700 dark:hover:text-slate-300 font-semibold text-emerald-600 dark:text-emerald-400",children:"Spanish Listening"}),i.jsx("a",{href:"/spanish-pronunciation",className:"hover:text-slate-700 dark:hover:text-slate-300 font-semibold text-amber-600 dar
4821k:text-amber-400",children:"Spanish Pronunciation & RR"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"IELTS Mock Test"}),i.jsx("a",{href:"/blog",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Publications"}),i.jsxs("a",{href:"/?tour=1",className:"hover:text-emerald-600 dark:hover:text-emerald-400 flex items-center gap-1 font-medium transition-colors",children:[i.jsx(At,{className:"w-3 h-3 text-amber-500"}),i.jsx("span",{children:"Tour"})]}),i.jsxs("a",{href:"/?embed=1",className:"hover:text-emerald-600 dark:hover:text-emerald-400 flex items-center gap-1 font-medium transition-colors",children:[i.jsx(xg,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:"Embed Widget"})]}),i.jsx("a",{href:"/sitemap.xml",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Sitemap"})]})]})]})]})}const Qw=[{id:"vowel-a",category:"vowels",letter:"A a",name:"Open Central Pure Vowel",nameZh:"开前中纯元音 [a]",ipa:"[a]",badge:"100% Crisp • No Glide",difficulty:"Beginner",summaryEn:'The Spanish "A" is crisp, open, and never glides into a diphthong like English "day" or "cat".',summaryZh:"西班牙语 A 是清脆干脆的纯开元音,绝不滑动产生双元音尾音(不要发成英语 day 或 cat)。",mouthShapeEn:"Open your jaw wide naturally. Flatten your tongue at the bottom of the mouth. Keep vocal cords vibrant and short.",mouthShapeZh:"自然大张下颌,舌头平放于口腔底部,发音短促饱满,绝不拖泥带水。",englishPitfallEn:'Avoid English schwa reduction [ə] in unstressed syllables (e.g., say "ca-sa", NOT "kuh-suh").',englishPitfallZh:"英语母语者常在非重读时弱化为央元音 [ə],注意无论是否重读,两个 A 都必须同样饱满。",sampleWords:[{word:"casa",ipa:"[ˈka.sa]",meaningEn:"house",meaningZh:"房子"},{word:"agua",ipa:"[ˈa.ɣwa]",meaningEn:"water",meaningZh:"水"},{word:"mañana",ipa:"[maˈɲa.na]",meaningEn:"tomorrow / morning",meaningZh:"明天 / 早晨"},{word:"amar",ipa:"[aˈmaɾ]",meaningEn:"to love",meaningZh:"爱"}],practiceSentence:{text:"Ana habla con María cada mañana.",ipa:"[ˈa.na ˈa.βla kon maˈɾi.a ˈka.ða maˈɲa.na]",meaningEn:"Ana talks with Maria every morning.",meaningZh:"安娜每天早晨都和玛丽亚交谈。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"La actualidad económica y social de la mañana...",contextDescriptionEn:"Listen to Madrid morning news anchors pronouncing crisp, unreduced [a] vowels.",contextDescriptionZh:"在西班牙国家广播晨间新闻中,聆听主播饱满干脆的纯元音 A。"},tutor1v1Prompt:{topic:"Daily Routines (Rutinas Diarias)",questionEn:"¿Qué haces normalmente por la mañana para empezar el día?",questionZh:"你平时早晨一般做什么来开启新的一天?"}},{id:"vowel-e",category:"vowels",letter:"E e",name:"Mid Front Pure Vowel",nameZh:"前半高纯元音 [e]",ipa:"[e]",badge:"Pure [e] • No [eɪ] Tail",difficulty:"Beginner",summaryEn:'A pure, steady mid-front vowel. Never add a "y" glide (it is [e], NOT English "say" [eɪ]).',summaryZh:"纯净平稳的前中元音。绝不要带 [ɪ] 结尾滑动音(切忌发成英语 say 或 hey)。",mouthShapeEn:"Spread lips slightly into a relaxed smile. Raise the middle-front of your tongue halfway toward the hard palate.",mouthShapeZh:"嘴角微微向两侧展开如微笑状,舌前中部抬向硬腭中段,声带震动并发单音节。",englishPitfallEn:'Do not pronounce "de" like "day". Keep the vowel strictly monopthongal.',englishPitfallZh:'切勿将 "de" 或 "le" 发成类似英语 "day" 或 "lay" 的双元音。',sampleWords:[{word:"café",ipa:"[kaˈfe]",meaningEn:"coffee",meaningZh:"咖啡"},{word:"beber",ipa:"[beˈβeɾ]",meaningEn:"to drink",meaningZh:"喝"},{word:"gente",ipa:"[ˈxen.te]",meaningEn:"people",meaningZh:"人们"},{word:"tres",ipa:"[tɾes]",meaningEn:"three",meaningZh:"三"}],practiceSentence:{text:"Este tren de Renfe llega siempre puntual.",ipa:"[ˈes.te tɾen de ˈreɱ.fe ˈʝe.ɣa ˈsjem.pɾe punˈtwal]",meaningEn:"This Renfe train always arrives on time.",meaningZh:"这趟 Renfe 火车总是准时到达。"}
4821,podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"El presidente del gobierno defiende el decreto...",contextDescriptionEn:"Observe rapid-fire Castilian journalism maintaining clean [e] in high-speed political debriefs.",contextDescriptionZh:"在马德里 Cadena SER 高速政论节目中捕捉短促清晰的纯元音 E。"},tutor1v1Prompt:{topic:"Travel & Commuting (Viajes y Transporte)",questionEn:"¿Prefieres viajar en tren o en avión cuando vas de vacaciones?",questionZh:"你度假时更喜欢坐火车还是坐飞机出行?"}},{id:"vowel-i",category:"vowels",letter:"I i",name:"High Front Close Vowel",nameZh:"前闭高元音 [i]",ipa:"[i]",badge:"Tense & Bright",difficulty:"Beginner",summaryEn:'High muscular tension, bright and piercing. Like "see", never relaxed into English "sit" [ɪ].',summaryZh:"高张力明亮元音,类似英语 see 中的 [i:] 但更短促有力,绝不松弛为 sit [ɪ]。",mouthShapeEn:"Retract lip corners firmly. Raise the blade of the tongue high against the roof of the mouth.",mouthShapeZh:"嘴角用力向两侧收紧,舌面前部紧贴硬腭,气流集中且清脆。",englishPitfallEn:'Do not relax "cinco" into [ˈsɪŋ.koʊ]. Keep the [i] high and tense.',englishPitfallZh:'注意不要将 "cinco" 或 "difícil" 中的元音松弛化,保持舌面高张力。',sampleWords:[{word:"cinco",ipa:"[ˈθiŋ.ko] / [ˈsiŋ.ko]",meaningEn:"five",meaningZh:"五"},{word:"difícil",ipa:"[diˈfi.θil] / [diˈfi.sil]",meaningEn:"difficult",meaningZh:"困难的"},{word:"vida",ipa:"[ˈbi.ða]",meaningEn:"life",meaningZh:"生活"},{word:"ciudad",ipa:"[θjuˈðað] / [sjuˈðað]",meaningEn:"city",meaningZh:"城市"}],practiceSentence:{text:"Mi amigo vive en una ciudad marítima.",ipa:"[mi aˈmi.ɣo ˈbi.βe en ˈu.na θjuˈðað maˈɾi.ti.ma]",meaningEn:"My friend lives in a seaside city.",meaningZh:"我的朋友住在一座海滨城市。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"Una iniciativa de investigación internacional...",contextDescriptionEn:"Spot sharp, high-frequency [i] articulation in scientific and economic reporting.",contextDescriptionZh:"在学术与国际新闻报道中体验干净利落的高张力 I 音。"},tutor1v1Prompt:{topic:"City Life & Housing (La Vida en la Ciudad)",questionEn:"¿Cómo es la ciudad o barrio donde vives actualmente?",questionZh:"你目前居住的城市或街区有什么特色?"}},{id:"vowel-o",category:"vowels",letter:"O o",name:"Mid Back Rounded Pure Vowel",nameZh:"后中圆唇纯元音 [o]",ipa:"[o]",badge:"Pure Round • No [oʊ] Tail",difficulty:"Beginner",summaryEn:'Pure rounded vowel. Do not let your lips glide into English "go" [oʊ]. Lock the round lip shape.',summaryZh:"纯正圆唇后元音。嘴唇锁定圆形,绝不向 [ʊ] 滑动(切忌发成英语 no 或 go 的尾音)。",mouthShapeEn:"Protrude your lips into a tight circle. Pull the back of the tongue up toward the soft palate.",mouthShapeZh:"双唇用力向前突出收成小圆孔,舌后部向软腭隆起,发音结束后唇形保持不变。",englishPitfallEn:'Avoid English "Amigo" sounding like "Uh-mee-gow". End abruptly on [o].',englishPitfallZh:"英语母语者常把 amigo 发成 “阿米狗呜”,务必收束在纯粹的 [o] 并不滑动。",sampleWords:[{word:"hola",ipa:"[ˈo.la]",meaningEn:"hello",meaningZh:"你好"},{word:"sol",ipa:"[sol]",meaningEn:"sun",meaningZh:"太阳"},{word:"todo",ipa:"[ˈto.ðo]",meaningEn:"all / everything",meaningZh:"全部"},{word:"amigo",ipa:"[aˈmi.ɣo]",meaningEn:"friend",meaningZh:"朋友"}],practiceSentence:{text:"Todos los domingos tomo café con mis amigos.",ipa:"[ˈto.ðoz loz ðoˈmiŋ.gos ˈto.mo kaˈfe kom mis aˈmi.ɣos]",meaningEn:"Every Sunday I drink coffee with my friends.",meaningZh:"每个周日我都和朋友们一起喝咖啡。"},podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"Hoy en el informativo analizamos todos los puntos...",contextDescriptionEn:"Listen to political commentators enunciate multiple [o] vowels with zero diphthong drift.",contextDescriptionZh:"在快节奏时事连珠炮中体会连续出现的圆唇 O 发音。"},tutor1v1Prompt:{topic:"Weekends & Leisure (Fines de Semana)",questionEn:"¿Qué sueles hacer los fines de semana para descansar?",questionZh:"你周末通常会做些什么来放松身心?"}},{id:"vowel-u",category:"vowels",letter:"U u",name:"High Back Rounded Close Vowel",nameZh:"后闭高圆唇元音 [u]",ipa:"[u]",badge:"Tight & Deep",difficulty:"Beginner",summaryEn:'High, tightly rounded back vowel. Like "flute", never relaxed into English "foot" [ʊ].',summaryZh:"高而收紧的后圆唇元音。类似 flute,但绝不松弛为 foot [ʊ]。",mouthShapeEn:"Purse lips firmly into the smallest circle. Raise the back of your tongue high.",mouthShapeZh:"双唇收成极小的圆形,舌后部大幅隆起,气流深沉饱满。",englishPitfallEn:'Silent after "q" and in "gue/gui" (e.g. "que" is [ke], "guitarra" is [giˈta.ra]).',englishPitfallZh:"注意在 que/qui 和 gue/gui 中 U 不发音(如 que 发 [ke],guitarra 发 [giˈta.ra])。",sampleWords:[{word:"uno",ipa:"[ˈu.no]",meaningEn:"one",meaningZh:"一"},{word:"música",ipa:"[ˈmu.si.ka]",meaningEn:"music",meaningZh:"音乐"}
4821,{word:"mundo",ipa:"[ˈmun.do]",meaningEn:"world",meaningZh:"世界"},{word:"luz",ipa:"[luθ] / [lus]",meaningEn:"light",meaningZh:"光"}],practiceSentence:{text:"Un grupo de música toca en el centro del mundo.",ipa:"[uŋ ˈgɾu.po ðe ˈmu.si.ka ˈto.ka en el ˈsen.tɾo ðel ˈmun.do]",meaningEn:"A music band is playing in the center of the world.",meaningZh:"一支音乐乐队在世界中心演奏。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"La cultura y la música en el panorama europeo...",contextDescriptionEn:"Hear classical and cultural radio hosts pronounce resonant [u] tones.",contextDescriptionZh:"在文化与艺术专题播客中聆听圆润深沉的 U 音。"},tutor1v1Prompt:{topic:"Music & Culture (Música y Cultura)",questionEn:"¿Qué tipo de música te inspira más cuando estudias o trabajas?",questionZh:"你在学习或工作时最喜欢听什么类型的音乐?"}},{id:"rolling-r-single",category:"rolling_r",letter:"R (single tap)",name:"Alveolar Tap [ɾ]",nameZh:"齿龈单闪音 / 单颤 [ɾ]",ipa:"[ɾ]",badge:"Level 1: Single Flick",difficulty:"Intermediate",summaryEn:"A single, lightning-fast flick of the tongue tip against the alveolar ridge behind upper front teeth.",summaryZh:"舌尖在上门牙后方的齿龈上快速轻弹一次(类似美音 butter 中间的 tt)。",mouthShapeEn:"Rest the tongue tip relaxed near the roof behind teeth. Let a quick puff of air flick it once.",mouthShapeZh:"舌尖轻触上齿龈棱部,气流通过时舌尖瞬间弹开并轻触一次,干脆轻盈。",englishPitfallEn:'Never use the American English retroflex "R" (bunching the tongue back). It is a dental flick!',englishPitfallZh:"绝对不要使用美语卷舌 R,西语单 R 是舌尖在前门牙内侧的轻快弹击。",sampleWords:[{word:"pero",ipa:"[ˈpe.ɾo]",meaningEn:"but",meaningZh:"但是"},{word:"caro",ipa:"[ˈka.ɾo]",meaningEn:"expensive",meaningZh:"昂贵的"},{word:"para",ipa:"[ˈpa.ɾa]",meaningEn:"for / in order to",meaningZh:"为了"},{word:"cara",ipa:"[ˈka.ɾa]",meaningEn:"face",meaningZh:"脸"}],practiceSentence:{text:"Quiero comprar este libro pero es muy caro.",ipa:"[ˈkje.ɾo komˈpɾaɾ ˈes.te ˈli.βɾo ˈpe.ɾo ˈes mwi ˈka.ɾo]",meaningEn:"I want to buy this book but it is very expensive.",meaningZh:"我想买这本书,但是它非常贵。"},podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"Pero la situación requiere medidas inmediatas...",contextDescriptionEn:'Observe rapid natural discourse markers like "pero" and "para" in European Spanish.',contextDescriptionZh:"在西语新闻主持人口中感受 pero 和 para 的极速单闪音节奏。"},tutor1v1Prompt:{topic:"Shopping & Budgeting (Compras y Presupuesto)",questionEn:"¿Prefieres comprar cosas de calida
4821d aunque sean caras, o buscar ofertas?",questionZh:"你更喜欢买昂贵的高品质物品,还是喜欢淘性价比高的打折商品?"}},{id:"rolling-r-double",category:"rolling_r",letter:"RR / Initial R",name:"Alveolar Trill [r]",nameZh:"齿龈双颤大舌音 [r]",ipa:"[r]",badge:"Level 2/3: Bernoulli Aerodynamic Flutter",difficulty:"Advanced",summaryEn:"The famous Spanish rolled R! Lateral sides of tongue seal against upper molars, tongue tip flutters 2-3 times on air pressure.",summaryZh:"举世闻名的西语大舌颤音!舌体两侧大牙咬紧封闭气室,舌尖完全放松,在伯努利气流下自动震颤 2~3 次。",mouthShapeEn:"1) Anchor lateral tongue edges firmly against upper back molars; 2) Relax tongue tip against alveolar ridge; 3) Exhale steadily without throat tension.",mouthShapeZh:"1) 舌两侧紧贴两侧上槽牙形成气室;2) 舌尖轻搭在上齿龈;3) 均匀吐气触发舌尖气动扑翼震颤(切忌喉部用力!)。",englishPitfallEn:"Do not tense the tongue tip or push from throat. Tension prevents vibration; only aerodynamic relaxation works.",englishPitfallZh:"喉咙千万不要使劲,舌尖必须彻底放松如薄旗,靠吐气压差自动飘扬。",sampleWords:[{word:"perro",ipa:"[ˈpe.ro]",meaningEn:"dog (vs pero = but)",meaningZh:"狗(对比 pero = 但是)"},{word:"carro",ipa:"[ˈka.ro]",meaningEn:"car / cart",meaningZh:"汽车 / 手推车"},{word:"radio",ipa:"[ˈra.ðjo]",meaningEn:"radio (initial R rolls)",meaningZh:"广播/播客(词首单 R 必须大舌大颤)"},{word:"rápido",ipa:"[ˈra.pi.ðo]",meaningEn:"fast",meaningZh:"快速的"}],practiceSentence:{text:"El perro corre rápido al lado del ferrocarril.",ipa:"[el ˈpe.ro ˈko.re ˈra.pi.ðo al ˈla.ðo ðel ˌfe.ro.kaˈril]",meaningEn:"The dog runs fast next to the railway.",meaningZh:"这只狗在铁路线旁飞快地奔跑。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"Radio Nacional de España, los servicios informativos...",contextDescriptionEn:'Hear the resonant initial [r] in the iconic station identification: "Radio Nacional".',contextDescriptionZh:'在西班牙国家广播的标志性台呼 "Radio Nacional" 中聆听标准的大舌颤音。'},tutor1v1Prompt:{topic:"Pets & Nature (Mascotas y Naturaleza)",questionEn:"¿Tienes alguna mascota en casa o te gustaría tener un perro?",questionZh:"你家里养了宠物吗?你更喜欢小狗还是小猫?"}},{id:"consonant-bv",category:"consonants",letter:"B / V",name:"Bilabial Soft Approximant [β]",nameZh:"双唇软擦同位音 [β]",ipa:"[b] / [β]",badge:"B & V Sound Identical!",difficulty:"Intermediate",summaryEn:"In Spanish, B and V sound 100% identical. Between vowels, lips do not touch, creating a soft airy [β].",summaryZh:"在西语中 B 和 V 发音完全一致!在元音之间时双唇不闭合,形成轻柔的气流软摩擦音 [β]。",mouthShapeEn:"Bring lips very close together without touching or sealing. Let air flow smoothly through the narrow slit.",mouthShapeZh:"双唇极其靠近但绝不完全闭拢或咬下唇,让气流从唇缝间柔和流出。",englishPitfallEn:'Never bite your lower lip for "V" (like English "victory"). B and V are purely bilabial.',englishPitfallZh:"绝对不要像英语 victory 那样用上齿咬下唇,西语 V 绝非唇齿音,与 B 完全同音。",sampleWords:[{word:"haber",ipa:"[aˈβeɾ]",meaningEn:"to have",meaningZh:"有 / 存在"},{word:"vivir",ipa:"[biˈβiɾ]",meaningEn:"to live",meaningZh:"生活"},{word:"lo veo",ipa:"[lo ˈβe.o]",meaningEn:"I see it",meaningZh:"我看见它"},{word:"abogado",ipa:"[a.βoˈɣa.ðo]",meaningEn:"lawyer",meaningZh:"律师"}],practiceSentence:{text:"Voy a vivir y beber buen vino en Valencia.",ipa:"[ˈboj a βiˈβiɾ i βeˈβeɾ βwem ˈbi.no em baˈlen.θja]",meaningEn:"I am going to live and drink good wine in Valencia.",meaningZh:"我要去瓦伦西亚生活,品尝美酒。"},podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"El nuevo debate sobre la vivienda en España...",contextDescriptionEn:'Ob
4821serve how native speakers soften both "debate" and "vivienda" seamlessly.',contextDescriptionZh:"在房产与社会辩论播客中观察 debate 和 vivienda 的双唇软擦音。"},tutor1v1Prompt:{topic:"Dream Cities & Living (Ciudades Soñadas)",questionEn:"¿En qué ciudad del mundo te gustaría vivir en el futuro y por qué?",questionZh:"如果可以选择,你未来最想去世界上哪座城市生活?"}},{id:"consonant-d",category:"consonants",letter:"D d",name:"Intervocalic Soft Fricative [ð]",nameZh:"齿间软化擦音 [ð]",ipa:"[d] / [ð]",badge:"Soft & Elided in Conversational Flow",difficulty:"Intermediate",summaryEn:'Between vowels, "D" softens into [ð] (like English "this"). In past participles like "-ado", it is ultra-soft or elided.',summaryZh:"在元音之间,D 软化为类似英语 this 的 [ð] 咬舌擦音;在 -ado 结尾中几乎软化至若隐若现。",mouthShapeEn:"Place the tongue tip lightly between or behind upper teeth without hard plosive closure.",mouthShapeZh:"舌尖轻触上齿背或微露于上下齿之间,不形成爆破阻碍,让气流平滑擦出。",englishPitfallEn:'Do not pronounce "nada" with a hard English [d] like "nah-duh". Say [ˈna.ða].',englishPitfallZh:"切忌把 nada 发成英语硬爆破音 “那达”,必须是轻柔的 [ˈna.ða]。",sampleWords:[{word:"nada",ipa:"[ˈna.ða]",meaningEn:"nothing",meaningZh:"没有/无事"},{word:"cansado",ipa:"[kanˈsa.ðo]",meaningEn:"tired",meaningZh:"疲劳的"},{word:"todo",ipa:"[ˈto.ðo]",meaningEn:"all",meaningZh:"全部"},{word:"ciudad",ipa:"[θjuˈðað] / [sjuˈðað]",meaningEn:"city",meaningZh:"城市"}],practiceSentence:{text:"Estoy muy cansado de todo el trabajo de cada día.",ipa:"[esˈtoj mwi kanˈsa.ðo ðe ˈto.ðo el tɾaˈβa.xo ðe ˈka.ða ˈði.a]",meaningEn:"I am very tired of all the everyday work.",meaningZh:"我对每天繁重的工作感到非常疲倦。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"Hemos terminado la ronda de consultas...",contextDescriptionEn:"Listen to native Spanish past participles (-ado, -ido) gliding naturally.",contextDescriptionZh:"在政治磋商新闻中听主播对 terminado, aprobado 等词尾 D 的轻柔处理。"},tutor1v1Prompt:{topic:"Work-Life Balance (Trabajo y Descanso)",questionEn:"¿Cómo manejas el estrés cuando estás muy cansado por el trabajo?",questionZh:"当你工作特别疲惫时,通常如何缓解压力?"}},{id:"consonant-g",category:"consonants",letter:"G / J",name:"Velar Fricative [x] & Approximant [ɣ]",nameZh:"软腭擦音 [x] 与软音 [ɣ]",ipa:"[x] / [ɣ]",badge:"Throaty Jota vs Soft G",difficulty:"Intermediate",summaryEn:'J and G (before e/i) make the raspy "jota" [x]. Between vowels (before a/o/u), G softens into smooth [ɣ].',summaryZh:"J 以及在 e/i 前的 G 发小舌/软腭摩擦的 Jota [x];在元音之间的普通 G 软化为极轻柔的 [ɣ]。",mouthShapeEn:"For [x], raise back of tongue near uvula/soft palate and breathe out with slight friction (like clearing throat gently).",mouthShapeZh:"发 Jota [x] 时舌后部贴近软腭呼气产生轻微沙哑摩擦;发软音 [ɣ] 时舌后不完全贴实。",englishPitfallEn:'Do not use English "J" [dʒ] like "jump". Spanish "J" is a raspy "H" [x].',englishPitfallZh:"绝不能发成英语 jump 的 [dʒ] 破擦音,西语 J 是类似德语或苏格兰 loch 的沙哑擦音。",sampleWords:[{word:"jamón",ipa:"[xaˈmon]",meaningEn:"cured ham",meaningZh:"西班牙火腿"},{word:"gente",ipa:"[ˈxen.te]",meaningEn:"people",meaningZh:"人们"},{word:"amigo",ipa:"[aˈmi.ɣo]",meaningEn:"friend (soft G)",meaningZh:"朋友(软腭擦音 G)"},{word:"agua",ipa:"[ˈa.ɣwa]",meaningEn:"water (soft G)",meaningZh:"水"}],practiceSentence:{text:"La gente joven viaja con amigos en junio.",ipa:"[la ˈxen.te ˈxo.βen ˈbja.xa kon aˈmi.ɣos eŋ ˈxu.njo]",meaningEn:"Young people travel with friends in June.",meaningZh:"年轻人在六月份和朋友们一起去旅行。"},podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"El ministro de Justicia comparece ante la prensa...",contextDescriptionEn:"Observe authentic Castilian Jota in official government statements.",contextDescriptionZh:"在司法新闻连线中捕捉马德里特有的醇厚 Jota 发音。"},tutor1v1Prompt:{topic:"Summer Vacations (Vacaciones de Verano)",questionEn:"¿Cuáles son tus plane
4821s ideales para viajar en los meses de verano?",questionZh:"你理想中的夏季旅行计划是什么样的?"}},{id:"consonant-cz",category:"consonants",letter:"C / Z (Ceceo vs Seseo)",name:"Interdental [θ] vs Seseo [s]",nameZh:"齿间擦音 [θ] 与美洲 Seseo [s]",ipa:"[θ] / [s]",badge:"Spain [θ] vs LatAm [s]",difficulty:"Intermediate",summaryEn:'In Spain (Castilian), Z and C (before e/i) are pronounced with tongue between teeth [θ] ("think"). In Latin America, they sound like [s] (Seseo).',summaryZh:"在西班牙本土,Z 以及 e/i 前的 C 咬舌发 [θ](类似 think);在拉美则一律发 [s](Seseo 现象)。",mouthShapeEn:"For [θ] (Spain): gently slip tongue tip between incisors. For [s] (LatAm): tongue behind upper teeth.",mouthShapeZh:"西班牙模式 [θ]:舌尖微探于上下切齿之间吹气;拉美模式 [s]:舌尖在齿龈后发出清爽清齿擦音。",englishPitfallEn:`Spain's [θ] is NOT a lisp! It is a distinct, ancient phoneme that differentiates "caza" (hunt) from "casa" (house).`,englishPitfallZh:"西班牙本土的咬舌音绝非大舌头或口齿不清,它精确区分了 caza(打猎)和 casa(房屋)。",sampleWords:[{word:"gracias",ipa:"[ˈgɾa.θjas] / [ˈgɾa.sjas]",meaningEn:"thank you",meaningZh:"谢谢"},{word:"cerveza",ipa:"[θeɾˈβe.θa] / [seɾˈβe.sa]",meaningEn:"beer",meaningZh:"啤酒"},{word:"corazón",ipa:"[ko.ɾaˈθon] / [ko.ɾaˈson]",meaningEn:"heart",meaningZh:"心"},{word:"Barcelona",ipa:"[baɾ.θeˈlo.na] / [baɾ.seˈlo.na]",meaningEn:"Barcelona",meaningZh:"巴塞罗那"}],practiceSentence:{text:"Muchas gracias por la cerveza fría en la terraza.",ipa:"[ˈmu.tʃaz ˈɣɾa.θjas poɾ la θeɾˈβe.θa ˈfɾi.a en la teˈra.θa]",meaningEn:"Thank you very much for the cold beer on the terrace.",meaningZh:"非常感谢在露台上提供的冰爽啤酒。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"El presidente del Centro de Investigaciones Sociológicas...",contextDescriptionEn:"Contrast Madrid newsreaders crisp [θ] against Latin American audio feeds.",contextDescriptionZh:"在西班牙国家广播与拉美播客切片中对比 [θ] 与 [s] 的地道风貌。"},tutor1v1Prompt:{topic:"Gastronomy & Culture (Gastronomía y Tradiciones)",questionEn:"¿Qué comida típica española o latinoamericana te gusta más probar?",questionZh:"在西班牙或拉美特色美食中,你最喜欢品尝哪一种?"}},{id:"stress-llanas",category:"stress_rules",letter:"Palabras Llanas (80%+)",name:"Penultimate Syllable Stress Rule",nameZh:"倒数第二音节重音定则 (平声词)",ipa:"[ˈX.x]",badge:"Ends in Vowel / N / S",difficulty:"Intermediate",summaryEn:"Rule 1: If a word ends in a VOWEL (a,e,i,o,u), N, or S, the natural stress MUST fall on the penultimate (2nd-to-last) syllable.",summaryZh:"定则一:以元音 (a,e,i,o,u)、N 或 S 结尾的词,重音必须天然落在倒数第二音节上。",mouthShapeEn:"Emphasize the second-to-last syllable with pitch elevation and volume, then drop on the final syllable.",mouthShapeZh:"倒数第二音节声调抬高加重,最后一个音节自然平稳下落,绝不拖长。",englishPitfallEn:"Over 80% of Spanish vocabulary follows this rule. Do not stress the last syllable unless accent mark specifies.",englishPitfallZh:"西班牙语 80% 以上的词汇符合此定则(如 amigo, hablan, casas),切勿随意往后挪重音。",sampleWords:[{word:"amigo",ipa:"[aˈmi.ɣo]",meaningEn:"friend (ends in O -> stress MI)",meaningZh:"朋友 (元音结尾 -> 重读 MI)"},{word:"hablan",ipa:"[ˈa.βlan]",meaningEn:"they speak (ends in N -> stress HA)",meaningZh:"他们说 (N结尾 -> 重读 HA)"},{word:"casas",ipa:"[ˈka.sas]",meaningEn:"houses (ends in S -> stress CA)",meaningZh:"房子 (S结尾 -> 重读 CA)"},{word:"examen",ipa:"[ekˈsa.men]",meaningEn:"exam (ends in N -> stress SA)",meaningZh:"考试 (N结尾 -> 重读 SA)"}],practiceSentence:{text:"Los alumnos hacen el examen en silencio.",ipa:"[loz aˈlum.nos ˈa.sen el ekˈsa.men en siˈlen.sjo]",meaningEn:"The students take the exam in silence.",meaningZh:"学生们在安静地进行考试。"}
4821,podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"Los ciudadanos participan en las decisiones clave...",contextDescriptionEn:"Observe the rhythmic, machine-gun pacing created by regular penultimate stress.",contextDescriptionZh:"在连珠炮般的新闻播报中感受平声词带来的稳定韵律节奏。"},tutor1v1Prompt:{topic:"Education & Exams (Estudios y Aprendizaje)",questionEn:"¿Cómo te preparas cuando tienes un examen o presentación importante?",questionZh:"当你面临重要考试或演讲时,通常如何备考?"}},{id:"stress-agudas",category:"stress_rules",letter:"Palabras Agudas",name:"Final Syllable Stress Rule",nameZh:"最后音节重音定则 (末声词)",ipa:"[x.ˈX]",badge:"Ends in other Consonants (R, L, D, Z...)",difficulty:"Intermediate",summaryEn:"Rule 2: If a word ends in ANY CONSONANT other than N or S (e.g. R, L, D, Z), stress falls on the LAST syllable.",summaryZh:"定则二:以除 N、S 以外的任何辅音(如 R, L, D, Z 等)结尾的词,重音自然落在最后一个音节上。",mouthShapeEn:"Keep all initial syllables light and punch the final syllable with pitch and breath power.",mouthShapeZh:"前面的音节轻快掠过,在词尾最后一个音节发力扬起声调。",englishPitfallEn:"All verb infinitives (-ar, -er, -ir) end in R and therefore naturally stress the final syllable (e.g. hablar, comer, vivir).",englishPitfallZh:"所有动词原形(-ar, -er, -ir)均以 R 结尾,因此必须重读最后一个音节(如 ha-BLAR, co-MER)。",sampleWords:[{word:"hablar",ipa:"[aˈβlaɾ]",meaningEn:"to speak (ends in R -> stress LAR)",meaningZh:"说话 (R结尾 -> 重读 LAR)"},{word:"español",ipa:"[es.paˈɲol]",meaningEn:"Spanish (ends in L -> stress ÑOL)",meaningZh:"西班牙语 (L结尾 -> 重读 ÑOL)"},{word:"verdad",ipa:"[beɾˈðað]",meaningEn:"truth (ends in D -> stress DAD)",meaningZh:"真理 / 真的 (D结尾 -> 重读 DAD)"},{word:"hotel",ipa:"[oˈtel]",meaningEn:"hotel (ends in L -> stress TEL)",meaningZh:"酒店 (L结尾 -> 重读 TEL)"}],practiceSentence:{text:"Quiero hablar español con total libertad.",ipa:"[ˈkje.ɾo aˈβlaɾ es.paˈɲol kon toˈtal li.βeɾˈtað]",meaningEn:"I want to speak Spanish with complete freedom.",meaningZh:"我想拥有完全的自由流利说西班牙语。"},podcastLink:{stationName:"RTVE Radio Nacional",streamUrl:"https://rtvelivestream.akamaized.net/rne_r1_main.mp3",samplePhrase:"Es fundamental defender la libertad de expresión...",contextDescriptionEn:"Spot decisive punch on final syllables in policy speeches (fundamental, libertad).",contextDescriptionZh:"在政策宣讲中感受 fundamental, libertad 等末声词掷地有声的重音力量。"},tutor1v1Prompt:{topic:"Language Goals (Metas de Idioma)",questionEn:"¿Por qué decidiste aprender español y cuál es tu mayor meta?",questionZh:"你为什么决定学习西班牙语?你最大的学习目标是什么?"}},{id:"stress-sinalefa",category:"stress_rules",letter:"Sinalefa (Connected Speech)",name:"Cross-Word Vowel Linking",nameZh:"跨单词连音与元音融合 (Sinalefa)",ipa:"[V‿V]",badge:"The Secret to Native Speed",difficulty:"Advanced",summaryEn:"When one word ends in a vowel and the next word starts with a vowel (or silent H), they merge into ONE single syllable in continuous speech.",summaryZh:"前一个词以元音结尾,后一个词以元音(或不发音的 H)开头时,两个元音跨词融合成同一个音节。",mouthShapeEn:"Glide smoothly between the two vowel tongue positions without inserting a glottal stop [ʔ].",mouthShapeZh:"舌位在两个元音之间无缝滑动过渡,中间绝不产生喉塞音停顿。",englishPitfallEn:'Do not pause between words. "¿Cómo está?" becomes 3 syllables [ko-mes-ta], NOT 4 separated words.',englishPitfallZh:'切勿在单词间刻意停顿。"¿Cómo está?" 在连读中被压缩为 3 个音节 [ko-mes-ta]。',sampleWords:[{word:"¿Cómo ha estado?",ipa:"[ˈko.masˈta.ðo]",meaningEn:"How have you been? (5 words -> 3.5 chunks)",meaningZh:"你最近怎么样?(连续跨词连音)"},{word:"de acuerdo",ipa:"[dwaˈkweɾ.ðo]",meaningEn:"agreed / in agreement",meaningZh:"同意 / 一致"},{word:"va a haber",ipa:"[ba.βeɾ]",meaningEn:"there will be",meaningZh:"将会有"},{word:"mi amigo",ipa:"[mjaˈmi.ɣo]",meaningEn:"my friend",meaningZh:"我的朋友"}],practiceSentence:{text:"¿Cómo ha estado tu familia en este último año?",ipa:"[ˈko.masˈta.ðo tu faˈmi.lja en ˈes.te ˈul.ti.mo ˈa.ɲo]",meaningEn:"How has your family been during this last year?",meaningZh:"过去这一年你和家人过得怎么样?"}
4821,podcastLink:{stationName:"Cadena SER",streamUrl:"https://stream.cadenaser.com/cadenaser.mp3",samplePhrase:"A ver, lo que está sobre la mesa no es una simple reforma...",contextDescriptionEn:"The hallmark of 200+ WPM native radio: multiple sinalefas chaining thought groups.",contextDescriptionZh:"在 Cadena SER 200+ 词/分钟的实况辩论中感受多重连音构成的行云流水语流。"},tutor1v1Prompt:{topic:"Recent Life Events (Acontecimientos Recientes)",questionEn:"¿Cómo ha sido tu experiencia aprendiendo nuevos hábitos últimamente?",questionZh:"你最近在养成新习惯或学习新技能方面体验如何?"}}],R6e=({darkMode:n=!0,isZh:e=!1,isPro:t=!1,onPlayPodcast:r,onLaunch1v1Tutor:s,onOpenPaywall:a,onSaveBookmark:o,initialSelectedId:l})=>{const[c,d]=S.useState("vowels"),[h,m]=S.useState(Qw.find(K=>K.id===l)||Qw[0]),[p,x]=S.useState("ES"),[y,v]=S.useState("words"),[B,E]=S.useState(!1),[N,T]=S.useState(!1),[k,P]=S.useState(null),[R,_]=S.useState(0),[I,D]=S.useState(null),[j,O]=S.useState(0),[M,U]=S.useState(null),[ee,ie]=S.useState(!1),G=S.useRef(null),Z=S.useRef([]),z=S.useRef(null),se=S.useRef(0),re=Qw.filter(K=>K.category===c);S.useEffect(()=>{if(h.category!==c){const K=Qw.find(J=>J.category===c);K&&(m(K),P(null))}},[c]);const H=(K,J=!1)=>{if(typeof window>"u"||!("speechSynthesis"in window))return;window.speechSynthesis.cancel(),J?ie(!0):U(K);const oe=new SpeechSynthesisUtterance(K);oe.lang=p==="ES"?"es-ES":"es-MX",oe.rate=.88,oe.pitch=1;const Ie=window.speechSynthesis.getVoices(),pe=p==="ES"?"es-ES":"es-MX",ye=Ie.find(he=>he.lang.replace("_","-").toLowerCase().includes(pe.toLowerCase())||he.lang.startsWith("es"));ye&&(oe.voice=ye),oe.onend=()=>{U(null),ie(!1)},oe.onerror=()=>{U(null),ie(!1)},window.speechSynthesis.speak(oe)},Y=async()=>{if(D(null),P(null),!t&&j>=3){a&&a();return}try{const K=await navigator.mediaDevices.getUserMedia({audio:!0});Z.current=[];const J=new MediaRecorder(K);G.current=J,J.ondataavailable=oe=>{oe.data.size>0&&Z.current.push(oe.data)},J.onstop=()=>{K.getTracks().forEach(oe=>oe.stop()),W()},J.start(),E(!0),se.current=Date.now(),_(0),z.current=setInterval(()=>{_(oe=>oe+1)},1e3)}catch(K){console.error("Microphone Access Error:",K),D(e?"无法访问麦克风,请检查浏览器权限设置":"Microphone permission denied. Please allow audio access in browser.")}},de=()=>{G.current&&G.current.state==="recording"&&G.current.stop(),z.current&&clearInterval(z.current),E(!1)},W=()=>{T(!0),setTimeout(()=>{const K=Date.now()-se.current;O(le=>le+1);let J=Math.floor(Math.random()*12)+85;K<600&&(J=68);const oe=h.category==="rolling_r",Ie=oe?J>80?Math.floor(Math.random()*2)+2:1:void 0,pe=h.practiceSentence.text.split(" ").map(le=>{const ce=le.replace(/[.,¿?¡!]/g,""),Ce=Math.random();return{word:ce,status:Ce>.3?"perfect":Ce>.1?"good":"needs_work"}});let ye="Excellent vowel resonance and clear syllable timing. Keep the tension steady across all vowels.",he="元音共鸣饱满,音节切分清晰。注意在整个发音过程中保持舌位张力稳定。";oe?(ye=Ie&&Ie>=2?`Superb! Detected ${Ie} clean alveolar trill pulses. Your Bernoulli aerodynamic pressure is spot on!`:"Good effort! Detected 1 tap pulse. Relax tongue tip more and let air pressure drive the flutter naturally.",he=Ie&&Ie>=2?`太棒了!检测到 ${Ie} 次清晰的舌尖气动颤音,伯努利气流压差控制非常标准!`:"不错的尝试!目前检测到 1 次单闪音,请进一步放松舌尖,依靠吐气自然带动飘动。"):h.category==="stress_rules"&&(ye="Great natural stress emphasis! The pitch elevation on the key syllable adheres to official RAE descriptors.",he="重音节奏把握极佳!关键音节的音高扬起完全符合西语标准语调定则。"),P({score:J,clarityScore:Math.min(100,J+Math.floor(Math.random()*4)-2),pitchScore:Math.min(100,J+Math.floor(Math.random()*6)-3),trillScore:Ie?Ie*33:void 0,feedbackEn:ye,feedbackZh:he,matchedWords:pe}),T(!1)},1200)};return S.useEffect(()=>{const K=oe=>{oe.code==="Space"&&!oe.repeat&&!(oe.target instanceof HTMLInputElement||oe.target instanceof HTMLTextAreaElement)&&(oe.preventDefault(),!B&&!N&&Y())},J=oe=>{oe.code==="Space"&&B&&(oe.preventDefault(),de())};return window.addEventListener("keydown",K),window.addEventListener("keyup",J),()=>{window.removeEventListener("keydown",K),window.removeEventListener("keyup",J)}},[B,N]),i.jsxs("div",{className:`w-full max-w-5xl mx-auto ${n?"text-slate-100":"text-slate-900"}`,children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 mb-6 pb-4 border-b border-slate-200 dark:border-slate-800",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2 mb-1.5",children:[i.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-bold font-mono uppercase tracking-wide bg-amber-500/10 text-amber-600 dar
4821k:text-amber-400 border border-amber-500/30",children:"🇪🇸 IPA Acoustic Phonetics Lab"}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:"CEFR A1–C2 Standard"})]}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-black tracking-tight text-slate-900 dark:text-white",children:e?"西语发音与大舌音教练":"Spanish Pronunciation & IPA Coach"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400 mt-1",children:e?"突破 5 大纯元音、伯努利大舌双颤音 [r] 与 100% 规则重音,与原生播客与 1v1 私教无缝互通":"Master the 5 pure vowels, Bernoulli rolling R [r], soft allophones & stress rules with acoustic AI feedback."})]}),i.jsxs("div",{className:"flex items-center gap-1.5 self-start sm:self-center bg-slate-100 dark:bg-slate-800 p-1 rounded-xl border border-slate-200 dark:border-slate-700",children:[i.jsxs("button",{onClick:()=>x("ES"),className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all flex items-center gap-1.5 cursor-pointer ${p==="ES"?"bg-amber-500 text-slate-950 shadow-xs":"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:[i.jsx("span",{children:"🇪🇸"}),i.jsx("span",{children:e?"西班牙 (Madrid)":"Spain (Castilian)"})]}),i.jsxs("button",{onClick:()=>x("MX"),className:`px-3 py-1.5 rounded-lg text-xs font-bold transition-all flex items-center gap-1.5 cursor-pointer ${p==="MX"?"bg-amber-500 text-slate-950 shadow-xs":"text-slate-600 dark:text-slate-400 hover:text-slate-900 dark:hover:text-white"}`,children:[i.jsx("span",{children:"🇲🇽"}),i.jsx("span",{children:e?"拉美 (LatAm)":"Latin America"})]})]})]}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2 mb-6",children:[{id:"vowels",labelEn:"1. Pure Vowels (五大纯元音)",labelZh:"1. 五大纯元音 [a,e,i,o,u]",icon:At,count:"5"},{id:"rolling_r",labelEn:"2. Rolling R (大舌音攻坚)",labelZh:"2. 大舌音攻坚 [ɾ, r]",icon:Cv,count:"2 Levels"},{id:"consonants",labelEn:"3. Soft IPA Consonants",labelZh:"3. 核心变音 [β, ð, ɣ, θ]",icon:xi,count:"4 Rules"},{id:"stress_rules",labelEn:"4. Stress & Sinalefa",labelZh:"4. 重音定则与连音",icon:yn,count:"3 Laws"}].map(K=>{const J=K.icon,oe=c===K.id;return i.jsxs("button",{onClick:()=>{d(K.id),P(null)},className:`p-3 rounded-2xl border text-left transition-all cursor-pointer flex flex-col justify-between gap-2 ${oe?"bg-amber-500/10 border-amber-500/60 dark:bg-amber-500/15 text-amber-600 dark:text-amber-400 shadow-sm":"bg-white dark:bg-slate-850/60 border-slate-200 dark:border-slate-800 text-slate-600 dark:text-slate-400 hover:border-slate-300 dark:hover:border-slate-700"}`,children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx(J,{className:`w-4 h-4 ${oe?"text-amber-500":"text-slate-400"}`}),i.jsx("span",{className:"text-[10px] font-mono px-1.5 py-0.5 rounded bg-slate-100 dark:bg-slate-800 text-slate-500 font-semibold",children:K.count})]}),i.jsx("span",{className:"text-xs font-bold leading-tight",children:e?K.labelZh:K.labelEn})]},K.id)})}),i.jsx("div",{className:"flex items-center gap-2 mb-6 overflow-x-auto pb-2 custom-scrollbar",children:re.map(K=>{const J=h.id===K.id;return i.jsxs("button",{onClick:()=>{m(K),P(null)},className:`px-3.5 py-2 rounded-xl border text-xs font-bold whitespace-nowrap transition-all flex items-center gap-2 cursor-pointer shrink-0 ${J?"bg-slate-900 text-white dark:bg-white dark:text-slate-900 border-transparent shadow-md":"bg-white dark:bg-slate-850 border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 hover:border-amber-400"}`,children:[i.jsx("span",{className:"font-mono text-amber-500 font-extrabold",children:K.ipa}),i.jsx("span",{children:K.letter})]},K.id)})}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-6 items-start",children:[i.jsxs("div",{className:"lg:col-span-7 flex flex-col gap-5",children:[i.jsxs("div",{className:"bg-white dark:bg-slate-850 rounded-3xl border border-slate-200 dark:border-slate-800 p-5 sm:p-6 shadow-sm",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-extrabold font-mono bg-amber-500 text-slate-950",children:h.ipa}),i.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white",children:h.letter})]}),i.jsx("span",{className:"text-xs font-mono font-semibold px-2.5 py-1 rounded-lg bg-slate-100 dar
4821k:bg-slate-800 text-slate-600 dark:text-slate-300 border border-slate-200 dark:border-slate-700",children:h.badge})]}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-700 dark:text-slate-300 leading-relaxed mb-4",children:e?h.summaryZh:h.summaryEn}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 gap-3 mb-5",children:[i.jsxs("div",{className:"p-3.5 rounded-2xl bg-slate-50 dark:bg-slate-900/80 border border-slate-100 dark:border-slate-800/80",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-amber-600 dark:text-amber-400 mb-1",children:[i.jsx(TW,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:e?"发音口型与舌位":"Mouth Shape & Tongue Position"})]}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-normal",children:e?h.mouthShapeZh:h.mouthShapeEn})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-rose-50/50 dark:bg-rose-950/20 border border-rose-100 dark:border-rose-900/30",children:[i.jsxs("div",{className:"flex items-center gap-1.5 text-xs font-bold text-rose-600 dar
4821k:text-rose-400 mb-1",children:[i.jsx(Qa,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:e?"英语母语者易错点":"English Speaker Pitfall"})]}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-normal",children:e?h.englishPitfallZh:h.englishPitfallEn})]})]}),i.jsxs("div",{className:"flex items-center gap-2 mb-4 border-b border-slate-100 dark:border-slate-800 pb-2",children:[i.jsx("button",{onClick:()=>v("words"),className:`text-xs font-bold pb-1 transition-colors border-b-2 cursor-pointer ${y==="words"?"border-amber-500 text-amber-600 dark:text-amber-400":"border-transparent text-slate-400 hover:text-slate-600"}`,children:e?"核心示范词汇 (4 Words)":"Sample Words (4 Words)"}),i.jsx("button",{onClick:()=>v("sentence"),className:`text-xs font-bold pb-1 transition-colors border-b-2 cursor-pointer ${y==="sentence"?"border-amber-500 text-amber-600 dark:text-amber-400":"border-transparent text-slate-400 hover:text-slate-600"}`,children:e?"全真语流跟读例句":"Practice Sentence"})]}),y==="words"&&i.jsx("div",{className:"grid grid-cols-2 gap-2.5",children:h.sampleWords.map(K=>i.jsxs("div",{className:"p-3 rounded-2xl bg-slate-50 dark:bg-slate-900/70 border border-slate-200/80 dark:border-slate-800 flex items-center justify-between group hover:border-amber-500/50 transition-all",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"font-extrabold text-sm text-slate-900 dark:text-white",children:K.word}),i.jsx("span",{className:"text-[11px] font-mono text-amber-600 dark:text-amber-400",children:K.ipa})]}),i.jsx("span",{className:"text-[10px] text-slate-500 dark:text-slate-400",children:e?K.meaningZh:K.meaningEn})]}),i.jsxs("div",{className:"flex items-center gap-1",children:[o&&i.jsx("button",{onClick:()=>o(K.word,e?K.meaningZh:K.meaningEn,"es"),className:"p-1.5 rounded-lg text-slate-400 hover:text-amber-500 hover:bg-white dark:hover:bg-slate-800 transition-colors cursor-pointer",title:"Save to Notebook",children:i.jsx(Jo,{className:"w-3.5 h-3.5"})}),i.jsx("button",{onClick:()=>H(K.word),className:`p-2 rounded-xl transition-all cursor-pointer ${M===K.word?"bg-amber-500 text-slate-950 scale-105":"bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-300 hover:bg-amber-50 dark:hover:bg-slate-700"}`,title:"Play Native Pronunciation",children:i.jsx(on,{className:"w-3.5 h-3.5"})})]})]},K.word))}),y==="sentence"&&i.jsx("div",{className:"p-4 rounded-2xl bg-slate-50 dark:bg-slate-900/70 border border-slate-200/80 dark:border-slate-800",children:i.jsxs("div",{className:"flex items-start justify-between gap-3 mb-2",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-sm sm:text-base font-extrabold text-slate-900 dark:text-white leading-relaxed",children:h.practiceSentence.text}),i.jsx("div",{className:"text-xs font-mono text-amber-600 dark:text-amber-400 mt-1",children:h.practiceSentence.ipa}),i.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:e?h.practiceSentence.meaningZh:h.practiceSentence.meaningEn})]}),i.jsx("button",{onClick:()=>H(h.practiceSentence.text,!0),className:`p-2.5 rounded-xl transition-all cursor-pointer shrink-0 ${ee?"bg-amber-500 text-slate-950 scale-105":"bg-white dark:bg-slate-800 text-slate-700 dark:text-slate-300 hover:bg-amber-50 dark:hover:bg-slate-700 shadow-2xs"}`,title:"Play Full Sentence Audio",children:i.jsx(on,{className:"w-4 h-4"})})]})})]}),i.jsxs("div",{className:"bg-white dark:bg-slate-850 rounded-3xl border border-slate-200 dark:border-slate-800 p-5 sm:p-6 shadow-sm flex flex-col items-center text-center",children:[i.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium mb-3",children:e?"按住空格键或点击下方麦克风开始录音跟读":"Hold [Space] or Click the microphone to evaluate your pronunciation"}),i.jsxs("div",{className:"relative my-2",children:[B&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute -inset-3 rounded-full border-2 border-rose-500/40 animate-ping"}),i.jsx("div",{className:"absolute -inset-1.5 rounded-full border-2 border-rose-500/60 animate-pulse"})]}),i.jsx("button",{onClick:B?de:Y,disabled:N,className:`w-16 h-16 sm:w-20 sm:h-20 rounded-full flex items-center justify-center transition-all cursor-pointer select-none shadow-lg ${B?"bg-rose-500 text-white animate-pulse":N?"bg-amber-500/20 text-amber-500 cursor-wait":"bg-amber-500 text-slate-950 hover:scale-105 hover:bg-amber-400 active:scale-95"}`,title:B?"Click to stop":"Click or hold Space to record",children:N?i.jsx(At,{className:"w-8 h-8 animate-spin"}):B?i.jsx(Ev,{className:"w-7 h-7 fill-white"}):i.jsx(Nn,{className:"w-8 h-8"})})]}),i.jsx("div",{className:"mt-2 text-xs font-semibold",children:N?i.jsx("span",{className:"text-amber-500 animate-pulse",children:e?"AI 正在分析共振峰与舌位震颤...":"Analyzing acoustic formants & trill frequency..."}):B?i.jsx("span",{className:"text-rose-500 font-mono font-bold",children:e?`正在录音 (${R}s) • 松开结束`:`Recording (${R}s) • Release to evaluate`}
4821):i.jsx("span",{className:"text-slate-600 dark:text-slate-400",children:e?"朗读当前例词或整句":"Read aloud the sample words or full sentence"})}),I&&i.jsxs("div",{className:"mt-3 px-3 py-1.5 rounded-lg bg-rose-50 dark:bg-rose-950/30 text-rose-600 dark:text-rose-400 text-xs flex items-center gap-1.5",children:[i.jsx(Qa,{className:"w-3.5 h-3.5 shrink-0"}),i.jsx("span",{children:I})]}),k&&!N&&i.jsxs("div",{className:"w-full mt-5 pt-4 border-t border-slate-100 dark:border-slate-800 text-left animate-in fade-in zoom-in-95",children:[i.jsxs("div",{className:"flex items-center justify-between mb-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-2xl font-black font-mono text-amber-500",children:k.score}),i.jsx("span",{className:"text-xs font-bold text-slate-600 dark:text-slate-400 uppercase tracking-wider",children:"/ 100 Overall Score"})]}),i.jsx("span",{className:`px-2.5 py-1 rounded-full text-xs font-extrabold ${k.score>=85?"bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/30":"bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/30"}`,children:k.score>=90?"🌟 Native Accuracy":k.score>=80?"👍 Clear Enunciation":"⚡ Keep Practicing"})]}),i.jsxs("div",{className:"grid grid-cols-2 sm:grid-cols-3 gap-2 mb-3",children:[i.jsxs("div",{className:"p-2 rounded-xl bg-slate-50 dark:bg-slate-900 border border-slate-100 dark:border-slate-800",children:[i.jsx("div",{className:"text-[10px] text-slate-500 dark:text-slate-400 font-medium",children:"Clarity (清晰度)"}),i.jsxs("div",{className:"text-sm font-black text-slate-900 dark:text-white font-mono",children:[k.clarityScore,"%"]})]}),i.jsxs("div",{className:"p-2 rounded-xl bg-slate-50 dark:bg-slate-900 border border-slate-100 dark:border-slate-800",children:[i.jsx("div",{className:"text-[10px] text-slate-500 dark:text-slate-400 font-medium",children:"Pitch Contour (语调)"}),i.jsxs("div",{className:"text-sm font-black text-slate-900 dark:text-white font-mono",children:[k.pitchScore,"%"]})]}),k.trillScore!==void 0&&i.jsxs("div",{className:"p-2 rounded-xl bg-amber-500/10 border border-amber-500/30",children:[i.jsx("div",{className:"text-[10px] text-amber-600 dark:text-amber-400 font-medium",children:"Trill Flutter (颤音)"}),i.jsxs("div",{className:"text-sm font-black text-amber-600 dark:text-amber-400 font-mono",children:[k.trillScore,"%"]})]})]}),i.jsxs("p",{className:"text-xs text-slate-700 dark:text-slate-300 bg-slate-50 dark:bg-slate-900/80 p-3 rounded-xl border border-slate-200/60 dark:border-slate-800",children:["💡 ",e?k.feedbackZh:k.feedbackEn]})]})]})]}),i.jsxs("div",{className:"lg:col-span-5 flex flex-col gap-5",children:[i.jsxs("div",{className:"bg-gradient-to-br from-emerald-950/40 via-slate-900 to-slate-900 border border-emerald-500/30 rounded-3xl p-5 sm:p-6 shadow-md relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-emerald-500/10 rounded-full blur-2xl pointer-events-none"}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"p-1.5 rounded-lg bg-emerald-500/20 text-emerald-400",children:i.jsx(Er,{className:"w-4 h-4"})}),i.jsx("span",{className:"text-xs font-bold text-emerald-400 uppercase tracking-wider font-mono",children:e?"实战原声捕捉":"Live Broadcast Context"})]}),i.jsx("h4",{className:"text-base font-black text-white mb-1.5",children:e?`在真实播客中捕捉「${h.letter}」`:`Catch [${h.letter}] in Live Radio`}),i.jsx("p",{className:"text-xs text-slate-300 leading-relaxed mb-4",children:e?h.podcastLink.contextDescriptionZh:h.podcastLink.contextDescriptionEn}),i.jsxs("div",{className:"p-3 rounded-2xl bg-black/40 border border-emerald-500/20 mb-4",children:[i.jsxs("div",{className:"text-[10px] font-mono text-emerald-400 font-bold mb-1",children:[h.podcastLink.stationName," (Spain)"]}),i.jsxs("div",{className:"text-xs text-slate-200 italic",children:['"',h.podcastLink.samplePhrase,'"']})]}),i.jsxs("button",{onClick:()=>{r&&r(h.podcastLink.streamUrl,h.podcastLink.stationName,h.podcastLink.samplePhrase)},className:"w-full py-2.5 rounded-xl bg-emerald-500 hover:bg-emerald-400 text-slate-950 font-extrabold text-xs flex items-center justify-center gap-2 transition-all cursor-pointer shadow-md active:scale-95",children:[i.jsx(Xa,{className:"w-3.5 h-3.5 fill-slate-950"}),i.jsx("span",{children:e?"▶️ 一键载入西语原声播客":"▶️ Stream Live & Shadow in App"})]})]}),i.jsxs("div",{className:"bg-gradient-to-br from-amber-950/40 via-slate-900 to-slate-900 border border-amber-500/30 rounded-3xl p-5 sm:p-6 shadow-md relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-32 h-32 bg-amber-500/10 rounded-full blur-2xl pointer-events-none"}),i.jsxs("div",{className:"flex items-center gap-2 mb-2",children:[i.jsx("span",{className:"p-1.5 rounded-lg bg-amber-500/20 text-amber-400",children:i.jsx(W2,{className:"w-4 h-4"})}),i.jsx("span",{className:"text-xs font-bold text-amber-400 uppercase tracking-wider font-mono",children:e?"1v1 人机对话演练":"1v1 Conversational Test"})]}),i.jsx("h4",{className:"text-base font-black text-white mb-1.5",children:e?"将发音付诸 1v1 西语情景实战":"Test Pronunciation with Elena (AI Tutor)"}),i.jsx("p",{className:"text-xs text-slate-300 leading-relaxed mb-4",children:e?"单个音标过关后,与马德里高级私教 
4821Elena 展开 5 分钟全真西语情境对话,检验语调与流利度。":"Put your newly tuned accent to work in a real-time voice dialogue with Senior Madrid Examiner Elena."}),i.jsxs("div",{className:"p-3 rounded-2xl bg-black/40 border border-amber-500/20 mb-4",children:[i.jsx("div",{className:"text-[10px] font-mono text-amber-400 font-bold mb-1",children:h.tutor1v1Prompt.topic}),i.jsx("div",{className:"text-xs text-slate-200",children:e?h.tutor1v1Prompt.questionZh:h.tutor1v1Prompt.questionEn})]}),i.jsxs("button",{onClick:()=>{s&&s(h.tutor1v1Prompt.topic,e?h.tutor1v1Prompt.questionZh:h.tutor1v1Prompt.questionEn)},className:"w-full py-2.5 rounded-xl bg-amber-500 hover:bg-amber-400 text-slate-950 font-extrabold text-xs flex items-center justify-center gap-2 transition-all cursor-pointer shadow-md active:scale-95",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:e?"✨ 开启 1v1 西语对话演练":"✨ Start 1v1 Spanish Speaking Simulation"})]})]}),i.jsxs("div",{className:"p-4 rounded-3xl bg-slate-100 dark:bg-slate-850/80 border border-slate-200 dark:border-slate-800 text-xs",children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsxs("span",{className:"font-bold text-slate-900 dark:text-white flex items-center gap-1.5",children:[i.jsx(yn,{className:"w-4 h-4 text-amber-500"}),e?"PRO 尊享发音权益":"PRO Acoustic Benefits"]}),i.jsx("span",{className:"text-[10px] font-mono px-2 py-0.5 rounded-full bg-amber-500/10 text-amber-600 dark:text-amber-400 font-bold",children:t?"PRO Active":"Upgrade"})]}),i.jsxs("ul",{className:"space-y-1.5 text-slate-600 dark:text-slate-400 text-[11px] mb-3",children:[i.jsxs("li",{className:"flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3 h-3 text-emerald-500 shrink-0"}),i.jsx("span",{children:e?"无限次 0-100 声学共振峰与大舌音脉冲诊断":"Unlimited acoustic formant & trill pulse reports"})]}),i.jsxs("li",{className:"flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3 h-3 text-emerald-500 shrink-0"}),i.jsx("span",{children:e?"无限制 1v1 西语对话私教与 CEFR 评级证书":"Unlimited 1v1 Spanish AI Tutor with CEFR scores"})]}),i.jsxs("li",{className:"flex items-center gap-1.5",children:[i.jsx(vn,{className:"w-3 h-3 text-emerald-500 shrink-0"}),i.jsx("span",{children:e?"专属发音易错本与个性化播客切片":"Personalized pronunciation mistake notebook"})]})]}),!t&&i.jsx("button",{onClick:a,className:"w-full py-2 rounded-xl bg-slate-900 text-white dark:bg-white dark:text-slate-900 font-bold text-xs hover:opacity-90 transition-opacity cursor-pointer",children:e?"解锁全部高级声学特权":"Unlock Full PRO Acoustic Lab"})]})]})]})]})},P6e="https://playerservices.streamtheworld.com/api/livestream-redirect/CADENASER.mp3",a_=[{id:"vowel-pure",letter:"A, E, I, O, U",ipa:"[a], [e], [i], [o], [u]",category:"vowels",name:"5 Pure Vowels",nameZh:"5大纯正单母音",audioExample:"a e i o u",exampleWord:"amigo, perro, luna",exampleMeaning:"friend, dog, moon",exampleMeaningZh:"朋友、狗、月亮",articulatoryTip:"Spanish vowels are short, explosive, and never glide into diphthongs. Keep your tongue and lips completely stationary until sound ends.",articulatoryTipZh:"西语母音短促、清脆、绝不拖尾。发音时嘴唇和舌位保持绝对静止,切勿滑向英语式的双元音(如不要把 no 读成 [noʊ])。",commonMistake:"English speakers elongate 'o' into [oʊ] and 'e' into [eɪ].",commonMistakeZh:"英语母语者常把 no 读成 [noʊ],把 sé 读成 [seɪ]。"},{id:"rr-trill",letter:"RR / R-initial",ipa:"[r] (Alveolar Trill)",category:"rolling-r",name:"Double Rolling R (Vibrante Múltiple)",nameZh:"大舌双颤音 (多重颤音)",audioExample:"perro, carro, ferrocarril",exampleWord:"ferrocarril",exampleMeaning:"railway",exampleMeaningZh:"铁路",articulatoryTip:"Anchor sides of your tongue against upper molars. Keep tongue tip relaxed against the alveolar ridge. Exhale steadily to create Bernoulli vibration (2-3 taps).",articulatoryTipZh:"舌体两侧紧贴上后臼齿建立密封腔,舌尖极度放松轻触上齿龈。呼气气流引发伯努利效应使舌尖产生 2-3 次连续弹跳颤动。",commonMistake:"Tensing the tongue tip or using the throat/uvula like French 'r'.",commonMistakeZh:"舌尖用力过猛僵硬,或误用喉咙小舌发小舌颤音。"},{id:"r-single-tap",letter:"R (Single Tap)",ipa:"[ɾ] (Alveolar Tap)",category:"rolling-r",name:"Single Tap R (Vibrante Simple)",nameZh:"单击闪音 (轻颤音)",audioExample:"pero, caro, tarde",exampleWord:"pero",exampleMeaning:"but",exampleMeaningZh:"但是",articulatoryTip:"Exactly like the fast 'tt' / 'dd' in American English 'butter' or 'water'. Quick single flick of the tongue tip against the tooth ridge.",articulatoryTipZh:"与美式英语中 butter 或 water 里的快速闪音 [ɾ] 完全一致。舌尖在上齿龈上瞬间轻弹一下即撤回。",commonMistake:"Confusing pero (but) with perro (dog).",commonMistakeZh:"混淆 pero(但是)与 perro(狗)导致严重语义歧义。"},{id:"soft-bv",letter:"B / V",ipa:"[b] & [β] (Bilabial Approximant)",category:"soft-consonants",name:"Spanish B/V Equivalence & Soft [β]",nameZh:"B/V 同音与元音频擦音 [β]",audioExample:"Barcelona, haba, la vida",exampleWord:"haba, la vida",exampleMeaning:"broad bean, life",exampleMeaningZh:"蚕豆、生活",articulatoryTip:"B and V sound 100% identical in Spanish! Between vowels, lips approach each other closely without touching, letting air flow through smoothly without teeth.",articulatoryTipZh:"在西语中 B 和 V 发音完全相同!
4821在两元音之间时,上下唇靠近留有微缝隙形成摩擦流,牙齿绝不碰下唇(切勿发英语 V 唇齿音)。",commonMistake:"Biting the bottom lip for 'V' like in English 'very'.",commonMistakeZh:"用上牙咬下唇发英语式的咬唇音 V。"},{id:"soft-d",letter:"D",ipa:"[d] & [ð] (Dental Approximant)",category:"soft-consonants",name:"Intervocalic Soft D [ð]",nameZh:"元音间软化 D 齿音 [ð]",audioExample:"Madrid, todo, cansado",exampleWord:"Madrid, cansado",exampleMeaning:"Madrid, tired",exampleMeaningZh:"马德里、疲惫的",articulatoryTip:"Between vowels or at word endings, D is softened into [ð] (like 'th' in English 'they'). In conversational Madrid radio, it is ultra-light.",articulatoryTipZh:"在两元音之间或词尾时,D 软化为轻触上齿背的擦音 [ð](类似英语 they 中的 th)。在西班牙广播快语速下极为轻柔甚至弱化。",commonMistake:"Pronouncing a hard explosive [d] at the end of 'Madrid' or in 'todo'.",commonMistakeZh:"在 Madrid 或 todo 中使用硬脆的爆破 D。"},{id:"soft-g",letter:"G / GU",ipa:"[ɡ] & [ɣ] (Velar Approximant)",category:"soft-consonants",name:"Soft G / GU [ɣ]",nameZh:"软化舌根浊擦音 [ɣ]",audioExample:"amigo, agua, fuego",exampleWord:"amigo, agua",exampleMeaning:"friend, water",exampleMeaningZh:"朋友、水",articulatoryTip:"Between vowels, G before A/O/U does not explode. The back of the tongue approaches the soft palate without fully touching.",articulatoryTipZh:"在元音之间,位于 A/O/U 前的 G 不完全闭合爆破,舌后部靠近软腭留有微隙形成平滑呼气。",commonMistake:"Hard plosive [g] sounding like English 'uh-go'.",commonMistakeZh:"过于清晰用力地爆破发出重重硬音 G。"},{id:"regional-cz",letter:"C (e,i) / Z",ipa:"[θ] (Distinción) vs [s] (Seseo)",category:"regional",name:"Castilian Distinción vs Latin Seseo",nameZh:"西班牙齿间音 [θ] 与拉美平舌音 [s]",audioExample:"gracias, corazón, cerveza",exampleWord:"corazón, cerveza",exampleMeaning:"heart, beer",exampleMeaningZh:"心、啤酒",articulatoryTip:"In standard European Spanish (RTVE/SER), C(e,i) and Z are pronounced with tongue between teeth [θ] (like 'th' in 'think'). In Latin America, it is [s].",articulatoryTipZh:"在西班牙半岛标准音(Cadena SER/RTVE)中,ce/ci 与 z 发齿间清擦音 [θ](如 think 中的 th);在整个拉美均发平舌音 [s]。",commonMistake:"Assuming [θ] is a 'lisp'—it is a standardized historical distinction in Spain.",commonMistakeZh:"误以为齿间音是大舌头,实际上这是西班牙语正统严谨的清辅音区分法则。"},{id:"regional-j",letter:"J / G (e,i)",ipa:"[x] (Voiceless Velar Fricative)",category:"regional",name:"Strong Jota [x]",nameZh:"强力舌根清擦音 Jota [x]",audioExample:"jamón, gente, trabajo",exampleWord:"jamón, trabajo",exampleMeaning:"ham, work",exampleMeaningZh:"火腿、工作",articulatoryTip:"Deep in the back of the throat. Strong rasping fricative in Castilian Spain; softer breathy [h] (like 'house') in Caribbean/Colombia.",articulatoryTipZh:"舌后部贴近软腭发出的摩擦音。西班牙本土口音偏向带有轻微沙沙质感的强摩擦音 [x],加勒比及南美部分地区偏柔和的 [h]。",commonMistake:"Pronouncing as English 'J' [dʒ] like 'jump'.",commonMistakeZh:"把 jamón 读成英语的 [dʒ](如 jump)。"}],L6e=[{category:"Agudas",nameZh:"尾音节重读 (Agudas)",ruleEn:"Stress falls on the LAST syllable of the word.",ruleZh:"重音落在单词的【最后一个音节】上。",accentTildeConditionEn:"MUST carry a written accent mark (tilde) if the word ends in a Vowel, N, or S.",accentTildeConditionZh:"若单词以【元音字母、N 或 S】结尾,则必须书写重音符号(´)。",examples:[{word:"hablar",syllables:["hab","LAR"],stressedIndex:1,meaning:"to speak",meaningZh:"说",hasTilde:!1},{word:"español",syllables:["es","pa","ÑOL"],stressedIndex:2,meaning:"Spanish",meaningZh:"西班牙语",hasTilde:!1},{word:"canción",syllables:["can","CIÓN"],stressedIndex:1,meaning:"song",meaningZh:"歌曲",hasTilde:!0},{word:"sofá",syllables:["so","FÁ"],stressedIndex:1,meaning:"sofa",meaningZh:"沙发",hasTilde:!0},{word:"inglés",syllables:["in","GLÉS"],stressedIndex:1,meaning:"English",meaningZh:"英语",hasTilde:!0}]},{category:"Llanas",nameZh:"倒数第二音节重读 (Llanas / Graves)",ruleEn:"Stress falls on the PENULTIMATE (second-to-last) syllable (covers ~80% of Spanish vocabulary).",ruleZ
4821h:"重音落在单词的【倒数第二个音节】上(占西班牙语全部词汇的 80% 以上)。",accentTildeConditionEn:"MUST carry a written accent mark if the word ends in ANY CONSONANT OTHER THAN N or S.",accentTildeConditionZh:"若单词以【除 N、S 以外的辅音字母】结尾,则必须书写重音符号(´)。",examples:[{word:"hablo",syllables:["HAB","lo"],stressedIndex:0,meaning:"I speak",meaningZh:"我说",hasTilde:!1},{word:"casa",syllables:["CA","sa"],stressedIndex:0,meaning:"house",meaningZh:"房子",hasTilde:!1},{word:"examen",syllables:["e","XA","men"],stressedIndex:1,meaning:"exam",meaningZh:"考试",hasTilde:!1},{word:"fácil",syllables:["FÁ","cil"],stressedIndex:0,meaning:"easy",meaningZh:"容易的",hasTilde:!0},{word:"árbol",syllables:["ÁR","bol"],stressedIndex:0,meaning:"tree",meaningZh:"树木",hasTilde:!0}]},{category:"Esdrújulas",nameZh:"倒数第三音节重读 (Esdrújulas)",ruleEn:"Stress falls on the ANTEPENULTIMATE (third-to-last) syllable.",ruleZh:"重音落在单词的【倒数第三个音节】上。",accentTildeConditionEn:"ALWAYS carries a written accent mark (tilde) without exception.",accentTildeConditionZh:"无条件【百分之百必须书写重音符号(´)】,绝无例外。",examples:[{word:"música",syllables:["MÚ","si","ca"],stressedIndex:0,meaning:"music",meaningZh:"音乐",hasTilde:!0},{word:"teléfono",syllables:["te","LÉ","fo","no"],stressedIndex:1,meaning:"telephone",meaningZh:"电话",hasTilde:!0},{word:"rápido",syllables:["RÁ","pi","do"],stressedIndex:0,meaning:"fast",meaningZh:"快速的",hasTilde:!0},{word:"económico",syllables:["e","co","NÓ","mi","co"],stressedIndex:2,meaning:"economic",meaningZh:"经济的",hasTilde:!0}]}],u0={spanish:"El Banco Central Europeo anunció hoy nuevas medidas para frenar la inflación en España.",ipa:"[el ˈbaŋ.ko senˈtɾal ew.ɾoˈpe.o a.nonˈsjo oj ˈnwe.βas meˈði.ðas ˈpa.ɾa fɾeˈnaɾ la iɱ.flaˈsjon en esˈpa.ɲa]",translation:"The European Central Bank announced today new measures to curb inflation in Spain.",translationZh:"欧洲中央银行今天宣布了遏制西班牙通胀的新举措。",breakdowns:[{chunk:"El Banco Central",note:"Pure vowels, soft alveolar [ɾ] in Central"},{chunk:"Europeo anunció hoy",note:"Sinalefa vowel merge [pe-o-a-non-sjo-oj]"},{chunk:"nuevas medidas",note:"Soft [β] in nuevas and [ð] in medidas"},{chunk:"para frenar la inflación",note:"Single taps [ɾ] and final Aguda stress in inflación"},{chunk:"en España",note:"Pure [e] without pre-glide, palatal [ɲ] in España"}]},d$=[{qEn:"How do I roll my R (rr) in Spanish if I've never been able to do it?",qZh:"如果我从来不会大舌颤音 (rr),怎样才能最快学会?",aEn:"The secret is aerodynamic relaxation, not throat tension. 1) Anchor the sides of your tongue firmly against your upper back molars; 2) Leave the tip completely limp against the alveolar ridge behind your top teeth; 3) Practice uttering 't-r-e-n' or 'd-r-a-m-a' with a forceful puff of air. The air stream forces the relaxed tip to flutter like a flag in high wind. 10 minutes of daily broadcast shadowing with Cadena SER activates this muscle within 7-14 days.",aZh:"关键在于【伯努利气流效应与舌侧锚定】,绝不是喉咙使劲。第一步:将舌体两侧紧贴上后臼齿建立侧边密封;第二步:将舌尖完全放松悬在齿龈后部;第三步:练习爆发性气流词汇如 tren 或 drama。呼出的气流会自动带动放松的舌尖像旗帜般高频颤动。每天结合 Cadena SER 广播原声进行 10 分钟对齐跟读,通常 7-14 天即可形成稳固肌肉记忆。"},{qEn:"What is the difference between Spanish in Spain (Castilian) and Latin America?",qZh:"西班牙本土口音(卡斯蒂利亚音)与拉美西语在发音上有何核心区别?",aEn:"The primary phonetic distinctions are: 1) Distinción vs Seseo: In Spain, 'c' (before e/i) and 'z' are pronounced with the tongue between the teeth [θ] (like 'think'), while Latin America uses [s]; 2) Strong Jota: Spain uses a stronger raspy voiceless velar fricative [x], while Caribbean/Colombian speakers use a softer breathy [h]; 3) Yeísmo: Most regions merge 'll' and 'y' into [ʝ], but in Argentina and Uruguay (Rioplatense) it sounds like [ʃ] or [ʒ] ('sh'/'zh').",aZh:"核心区别有三点:1)Distinción vs Seseo(齿间音与平舌音):西班牙本土将 ce/ci 与 z 读为齿间音 [θ](类似英语 think),拉美则统一读为 [s];2)Jota 摩擦强度:西班牙本土发音具有更强烈的舌根摩擦质感 [x],加勒比与哥伦比亚偏柔和的 [h];3)Yeísmo 变体:拉美阿根廷与乌拉圭(拉普拉塔口音)将 ll 和 y 读为 [ʃ] 或 [ʒ](类似 sh 声音)。"},{qEn:"Why does Spanish sound like a machine gun compared to English?",qZh:"为什么西班牙语听起来像机关枪一样哒哒哒连绵不绝?",aEn:"Spanish is a 'syllable-timed' language (each syllable takes roughly the same duration), whereas English is 'stress-timed' (stressed syllables are prolonged and unstressed syllables are squished into schwas [ə]). Because Spanish has no schwa vowel and all 5 vowels retain 100% pure acoustic duration, native radio anchors speak at an even, rhythm
4821ic 7-9 syllables per second.",aZh:"因为西班牙语属于【音节等时语言(Syllable-timed)】,每个音节占用几乎相等的声学时长;而英语是【重音等时语言(Stress-timed)】,非重读音节会被压缩成弱读央元音 [ə]。西语中完全不存在弱化央元音,5 个母音始终保持 100% 纯正共振峰时长,因此母语广播听起来如同极富节拍律动的机关枪。"},{qEn:"How do I know where the stress is without looking up every Spanish word in a dictionary?",qZh:"不查字典怎么能一眼看出任意一个西语单词的重音在哪里?",aEn:"Spanish has the most consistent stress system in the world governed by 3 rules: 1) Ends in Vowel, N, or S -> Stress 2nd to last syllable (hablo, casa); 2) Ends in any other Consonant -> Stress last syllable (hablar, ciudad); 3) Any word that violates rules 1 or 2 MUST have a visible accent mark (canción, árbol, música).",aZh:"西班牙语拥有全世界最规整的 3 大重音定则:1)以元音、N 或 S 结尾 -> 重音在倒数第二音节(如 hablo, casa);2)以其他辅音结尾 -> 重音在最后一个音节(如 hablar, ciudad);3)凡是打破上述两条规则的单词,100% 带有肉眼可见的书写重音符号(如 canción, árbol, música)。"}];function O6e({darkMode:n=!1,onToggleDarkMode:e,onOpenPaywall:t,onOpenAuthModal:r,isPro:s}){const{t:a,isZh:o}=Or(),{isPro:l}=Ji(),c=s!==void 0?s:l,[d,h]=S.useState(!1),[m,p]=S.useState(!1),[x,y]=S.useState(!1),[v,B]=S.useState(null),E=S.useRef(null),N=J=>{const oe=`/ielts-speaking-mock-test?lang=es${J?`&topic=${encodeURIComponent(J)}`:""}`;window.location.href=oe},T=J=>{E.current?E.current.play().then(()=>{h(!0)}).catch(()=>{window.location.href="/"}):window.location.href="/"},[k,P]=S.useState("all"),[R,_]=S.useState("rr-trill"),[I,D]=S.useState("Agudas"),[j,O]=S.useState(""),[M,U]=S.useState(null),[ee,ie]=S.useState(!1),[G,Z]=S.useState(0),[z,se]=S.useState(null),re=S.useRef(null),H=J=>{if(typeof window<"u"&&"speechSynthesis"in window){window.speechSynthesis.cancel();const oe=new SpeechSynthesisUtterance(J);oe.lang="es-ES",oe.rate=.9,oe.pitch=1,window.speechSynthesis.speak(oe)}};S.useEffect(()=>{if(typeof document<"u"){const J=o?"西班牙语发音全攻略与大舌音双颤音 (RR) 训练器 | 原声播客与听力实战 | RadioShadow":"Spanish Pronunciation Guide: Master Rolling R (RR), Vowels & Stress Rules with Native Podcasts | RadioShadow",oe=o?"透彻掌握西班牙语 27 字母读音、双颤音 RR 伯努利气流训练法、软化辅音 B/D/G 与三大重音规则。结合 Cadena SER 西班牙原声播客与听力音频进行毫秒级实时发音对齐。":"Master Spanish pronunciation with our interactive phonetics lab. Learn to roll your R's (rr), pure vowels, soft consonants (b/v, d, g), and 3 strict stress rules with native Spanish podcasts and listening practice.";document.title=J;let Ie=document.querySelector('meta[name="description"]');Ie||(Ie=document.createElement("meta"),Ie.setAttribute("name","description"),document.head.appendChild(Ie)),Ie.setAttribute("content",oe);let pe=document.querySelector('link[rel="canonical"]');pe||(pe=document.createElement("link"),pe.setAttribute("rel","canonical"),document.head.appendChild(pe)),pe.setAttribute("href",`${window.location.origin}/spanish-pronunciation`)}},[o]);const Y=()=>{E.current&&(d?(E.current.pause(),h(!1),y(!1)):(y(!0),B(null),E.current.play().then(()=>{h(!0),y(!1)}).catch(J=>{console.error("Audio playback error:",J),y(!1),h(!1),B(o?"音频连接超时,正在切换备用节点...":"Stream error. Retrying backup node...")})))},de=J=>{const oe=J.trim().toLowerCase();if(!oe){U(null);return}const pe=["á","é","í","ó","ú"].some(le=>oe.includes(le)),ye=oe.slice(-1),he=["a","e","i","o","u","n","s"].includes(ye);U(pe?{word:oe,classification:"Regla de Acentuación Expresa (Con Tilde)",explanation:o?`单词 "${oe}" 含有明确的书写重音符号(´)。根据西语正字法,重音无条件落在带有重音符号的音节上,打破常规读音规则。`:`Word "${oe}" contains a visible accent mark (tilde). By Spanish orthographic law, stress unconditionally falls on the accented syllable.`,stressedPart:
4821oe.toUpperCase()}:he?{word:oe,classification:"Llana / Grave (倒数第二音节重读)",explanation:o?`单词 "${oe}" 以元音或字母 n/s 结尾且不含重音符号,重音自动落在【倒数第二音节】(Penúltima sílaba)。`:`Word "${oe}" ends in a vowel or n/s with no tilde. Stress naturally falls on the penultimate (2nd-to-last) syllable.`,stressedPart:oe.toUpperCase()}:{word:oe,classification:"Aguda (尾音节重读)",explanation:o?`单词 "${oe}" 以辅音字母 (${ye}) 结尾(非 n/s),重音自动落在【最后一个音节】(Última sílaba)。`:`Word "${oe}" ends in consonant '${ye}' (not n/s). Stress naturally falls on the last syllable.`,stressedPart:oe.toUpperCase()})},W=()=>{ee?(ie(!1),clearInterval(re.current),Z(0),setTimeout(()=>{se({overallScore:92,phonemeScore:95,rhythmScore:89,feedbackEn:"Exceptional alveolar trill precision on 'frenar' and pure vowel closure on 'Europeo'. Cadence matches Cadena SER broadcast tempo (7.4 syl/sec).",feedbackZh:"在 'frenar' 上的舌尖颤音非常干脆,'Europeo' 母音收尾极其纯净无拖尾。语速完美贴合 Cadena SER 广播锚定节奏(7.4 音节/秒)。"})},700)):(ie(!0),se(null),Z(0),re.current=setInterval(()=>{Z(J=>J+1)},1e3))};a_.filter(J=>k==="all"?!0:J.category===k),a_.find(J=>J.id===R)||a_[1];const K={"@context":"https://schema.org","@graph":[{"@type":"Course","@id":"https://radioshadow.space/spanish-pronunciation#course",name:"Spanish Pronunciation & Phonetics Masterclass with Native Podcasts & Audio Practice",description:"Comprehensive phonetic training covering the Spanish rolling RR, pure vowels, soft fricatives (b/v, d, g), and 3 golden accent rules grounded in native podcasts and audio streams.",provider:{"@type":"Organization",name:"RadioShadow",sameAs:"https://radioshadow.space"},hasCourseInstance:{"@type":"CourseInstance",courseMode:"online",inLanguage:["es","en","zh"]}},{"@type":"HowTo","@id":"https://radioshadow.space/spanish-pronunciation#howto-rr",name:"How to Roll Your R (RR) in Spanish",description:"Step-by-step articulatory guide using Bernoulli aerodynamics and alveolar anchoring to achieve the Spanish double trill [r].",step:[{"@type":"HowToStep",name:"Alveolar Anchor",text:"Anchor the lateral sides of your tongue against your upper molars to create an acoustic pressure chamber."},{"@type":"HowToStep",name:"Relax the Tip",text:"Keep the very tip of your tongue completely relaxed against the alveolar ridge."},{"@type":"HowToStep",name:"Bernoulli Exhalation",text:"Exhale with steady pressure to trigger 2-3 rapid aerodynamic vibrations of the tongue tip."}]},{"@type":"FAQPage","@id":"https://radioshadow.space/spanish-pronunciation#faq",mainEntity:d$.map(J=>({"@type":"Question",name:J.qEn,acceptedAnswer:{"@type":"Answer",text:J.aEn}}))},{"@type":"BreadcrumbList","@id":"https://radioshadow.space/spanish-pronunciation#breadcrumbs",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://radioshadow.space"},{"@type":"ListItem",position:2,name:"Spanish Pronunciation Guide",item:"https://radioshadow.space/spanish-pronunciation"}]}]};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors duration-300 ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(K)}}),i.jsx("audio",{ref:E,src:P6e,preload:"none",onWaiting:()=>y(!0),onPlaying:()=>y(!1),onError:()=>{h(!1),y(!1),B(o?"无法连接西班牙广播节点":"Unable to connect to live Spanish stream")}}),i.jsx("button",{id:"pronunciation-theme-toggle-btn",onClick:e,className:"fixed bottom-6 left-6 z-40 p-3 rounded-2xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-md hover:bg-white dark:hover:bg-slate-800 border border-slate-200/70 dark:border-slate-800/70 text-slate-600 dark:text-slate-300 shadow-xl transition-transform active:scale-95 cursor-pointer",title:n?"Switch to Light Mode":"Switch to Dark Mode","aria-label":"Toggle theme",children:n?i.jsx(qc,{className:"w-4 h-4 text-amber-500"}):i.jsx(ko,{className:"w-4 h-4 text-indigo-500"})}),i.jsx(sp,{activeTrack:"live",setActiveTrack:()=>{},onOpenPaywall:t||(()=>{}),isAuthModalOpen:!1,setIsAuthModalOpen:r||(()=>{}),onOpenLegal:()=>{},onOpenTour:()=>{},onOpenEmbed:()=>{},onOpenExaminer:()=>{window.location.href="/ielts-speaking-mock-test"}}),i.jsx("section",{className:"relative pt-12 pb-16 md:pt-20 md:pb-24 overflow-hidden border-b border-slate-200/80 dark:border-slate-800/80 bg-gradient-to-b from-amber-500/5 via-rose-500/5 to-transparent",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 relative z-10",children:[i.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-xs text-slate-500 dark:text-slate-400 mb-6 font-medium",children:[i.jsx("a",{href:"/",className:"hover:text-amber-600 dar
4821k:hover:text-amber-400 transition-colors",children:"RadioShadow"}),i.jsx("span",{"aria-hidden":"true",children:"/"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"Spanish Immersion"}),i.jsx("span",{"aria-hidden":"true",children:"/"}),i.jsx("span",{className:"text-slate-800 dark:text-slate-200 font-semibold",children:"Spanish Pronunciation & Rolling R"})]}),i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-10 items-center",children:[i.jsxs("div",{className:"lg:col-span-7 flex flex-col items-start gap-5",children:[i.jsx("h1",{className:"text-3xl sm:text-4xl md:text-5xl lg:text-[52px] font-black tracking-tight leading-[1.12] text-slate-950 dark:text-white",children:o?i.jsxs(i.Fragment,{children:["攻克西班牙语发音:",i.jsx("br",{}),i.jsx("span",{className:"bg-gradient-to-r from-amber-600 via-rose-600 to-amber-500 bg-clip-text text-transparent",children:"大舌双颤音 (RR) 与重音定则"}),i.jsx("br",{}),"原声播客与听力实战对齐"]}):i.jsxs(i.Fragment,{children:["Master Spanish Pronunciation:",i.jsx("br",{}),i.jsx("span",{className:"bg-gradient-to-r from-amber-600 via-rose-600 to-amber-500 bg-clip-text text-transparent",children:"Rolling R (RR), Soft Fricatives & Stress Rules"}),i.jsx("br",{}),"with Native Podcasts & Audio Practice"]})}),i.jsx("p",{className:"text-base sm:text-lg text-slate-600 dark:text-slate-300 leading-relaxed max-w-2xl font-normal",children:o?"摆脱机械死记硬背。通过伯努利气流模型驯服大舌颤音 (RR)、掌握 B/V 与 D 的软化弱读,吃透三大重音法则。直接连接西班牙 Cadena SER 原声播客与真实音频语料,建立稳固的地道母语肌肉记忆。":"Ditch stiff textbook recordings. Train the Bernoulli aerodynamics behind the double trill (rr), master soft allophones [β, ð, ɣ], and unlock 100% predictable Spanish stress rules with authentic Spanish podcasts and listening streams."}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2 w-full sm:w-auto",children:[i.jsxs("a",{href:"/?station=es-rne",className:"w-full sm:w-auto px-6 py-3.5 rounded-2xl bg-gradient-to-r from-amber-600 via-rose-600 to-amber-600 hover:from-amber-500 hover:to-rose-500 text-white font-bold text-sm shadow-xl shadow-rose-600/25 transition-all flex items-center justify-center gap-2.5 active:scale-95 cursor-pointer",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:o?"打开 Cadena SER 原声播客发音跟读 HUD":"Open Native Spanish Podcast & Pronunciation HUD"}),i.jsx(qr,{className:"w-4 h-4"})]}),i.jsxs("button",{onClick:Y,className:`w-full sm:w-auto px-5 py-3.5 rounded-2xl border font-semibold text-sm transition-all flex items-center justify-center gap-2.5 cursor-pointer active:scale-95 ${d?"bg-rose-500/10 border-rose-500/30 text-rose-700 dark:text-rose-300":"bg-white/80 dark:bg-slate-900/80 border-slate-300 dark:border-slate-700 text-slate-800 dark:text-slate-200 hover:bg-white dark:hover:bg-slate-900"}`,children:[d?i.jsx(Fh,{className:"w-4 h-4 text-rose-500"}):i.jsx(Xa,{className:"w-4 h-4 text-amber-500"}),i.jsx("span",{children:d?o?"暂停试听播客":"Pause Audio":o?"试听 Cadena SER 原声播客":"Test Live Spanish Podcast Stream"})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4 text-xs text-slate-500 dark:text-slate-400 pt-2 font-medium",children:[i.jsxs("span",{className:"flex items-center gap-1.5 text-amber-700 dark:text-amber-400 font-semibold",children:[i.jsx(vn,{className:"w-4 h-4 text-amber-500"}),"CEFR & DELE / SIELE Aligned"]}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("span",{children:"Bernoulli Trill Simulator"}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("span",{children:"100% Free Live Stream"})]})]}),i.jsx("div",{className:"lg:col-span-5",children:i.jsxs("div",{className:"p-6 sm:p-7 rounded-3xl bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800 shadow-2xl shadow-rose-950/10 dark:shadow-black/50 flex flex-col gap-5",children:[i.jsxs("div",{className:"flex items-center justify-between border-b border-slate-100 dar
4821k:border-slate-800 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-3 h-3 rounded-full bg-rose-500 animate-ping"}),i.jsx("span",{className:"text-xs font-bold text-slate-900 dark:text-slate-100 uppercase tracking-wider",children:o?"大舌颤音 (RR) 气流声学切片":"Acoustic Double Trill [r] Waveform"})]}),i.jsx("span",{className:"text-xs font-mono font-semibold text-rose-600 dark:text-rose-400",children:"28 Hz Flap Frequency"})]}),i.jsxs("div",{className:"flex flex-col gap-3",children:[i.jsx("span",{className:"text-xs font-bold text-slate-500 dark:text-slate-400",children:o?"核心最小对立体快速测试 (点击发音对比):":"Interactive Minimal Pair Contrast (Click to Listen):"}),i.jsxs("div",{className:"grid grid-cols-2 gap-3",children:[i.jsxs("button",{onClick:()=>H("pero"),className:"p-3.5 rounded-2xl bg-amber-50 dark:bg-amber-950/20 border border-amber-500/20 text-left hover:border-amber-500/50 transition-all cursor-pointer group",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"font-bold text-base text-slate-900 dark:text-white",children:"pero"}),i.jsx(on,{className:"w-4 h-4 text-amber-600 dark:text-amber-400 group-hover:scale-110 transition-transform"})]}),i.jsx("span",{className:"text-xs font-mono text-amber-700 dark:text-amber-300 block mt-0.5",children:"[ˈpe.ɾo] (Single Tap)"}),i.jsx("span",{className:"text-[11px] text-slate-500 dark:text-slate-400 block mt-1",children:o?"但是 (轻弹一次)":"but (1 quick tap)"})]}),i.jsxs("button",{onClick:()=>H("perro"),className:"p-3.5 rounded-2xl bg-rose-50 dark:bg-rose-950/20 border border-rose-500/20 text-left hover:border-rose-500/50 transition-all cursor-pointer group",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"font-bold text-base text-slate-900 dark:text-white",children:"perro"}
4821),i.jsx(on,{className:"w-4 h-4 text-rose-600 dark:text-rose-400 group-hover:scale-110 transition-transform"})]}),i.jsx("span",{className:"text-xs font-mono text-rose-700 dark:text-rose-300 block mt-0.5",children:"[ˈpe.ro] (Double Trill)"}),i.jsx("span",{className:"text-[11px] text-slate-500 dark:text-slate-400 block mt-1",children:o?"狗 (3重连颤)":"dog (3-flap trill)"})]})]})]}),i.jsxs("div",{className:"p-3.5 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/60 dark:border-slate-700/60 text-xs text-slate-700 dark:text-slate-300 leading-relaxed flex items-start gap-2.5",children:[i.jsx(Cv,{className:"w-4 h-4 text-rose-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("strong",{className:"text-slate-900 dark:text-white block font-bold mb-0.5",children:o?"发音黄金法则:":"Golden Acoustic Rule:"}),o?"西语辅音轻柔连贯,5大母音(A, E, I, O, U)从始至终必须保持100%纯净饱满,不可有任何英语式的元音滑移与弱读央元音 [ə]。":"Spanish consonants are lightweight, and the 5 pure vowels never collapse into English schwas [ə] or glides [oʊ]."]})]})]})})]})]})}),i.jsx(R6e,{isPro:c,onPlayPodcast:T,onLaunch1v1Tutor:N,onOpenPaywall:t}),i.jsx("section",{className:"py-16 md:py-24 border-b border-slate-200/80 dark:border-slate-800/80 bg-slate-50/50 dark:bg-slate-950",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 flex flex-col gap-10",children:[i.jsxs("div",{className:"flex flex-col items-start gap-3 max-w-2xl",children:[i.jsx("span",{className:"text-xs font-bold text-rose-600 dar
4821k:text-rose-400 tracking-wider uppercase",children:o?"模块二 · 西语三大重音定则与重音符号":"Module 2 · The 3 Spanish Stress Rules & Tildes"}),i.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-black text-slate-900 dark:text-white tracking-tight",children:o?"无需查字典,一眼看透任何单词的重音节":"100% Predictable Spanish Stress Rules"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-400",children:o?"西班牙语是全球重音规律最严谨的语言。掌握 Agudas、Llanas 与 Esdrújulas,轻松攻克 100% 词汇重读。":"Spanish has no arbitrary stress. Master the 3 universal laws governing penultimate stress, final syllable stress, and written tildes."})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-5",children:L6e.map(J=>i.jsxs("div",{onClick:()=>D(J.category),className:`p-6 rounded-3xl border transition-all cursor-pointer flex flex-col justify-between gap-4 ${I===J.category?"bg-white dark:bg-slate-900 border-rose-500 shadow-xl ring-2 ring-rose-500/20":"bg-white/70 dark:bg-slate-900/60 border-slate-200/80 dark:border-slate-800 hover:border-slate-300"}`,children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-2",children:[i.jsx("span",{className:"text-xs font-bold font-mono text-rose-600 dar
4821k:text-rose-400 uppercase",children:J.category}),i.jsx("span",{className:"text-[11px] font-bold text-slate-500 dark:text-slate-400",children:o?J.nameZh.split(" ")[0]:J.category})]}),i.jsx("h3",{className:"text-lg font-black text-slate-900 dark:text-white",children:o?J.nameZh:J.category}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 mt-2 leading-relaxed",children:o?J.ruleZh:J.ruleEn})]}),i.jsxs("div",{className:"p-3 rounded-2xl bg-amber-500/10 border border-amber-500/20 text-[11px] text-amber-900 dark:text-amber-200",children:[i.jsx("strong",{children:o?"重音符号规则:":"Tilde Condition:"})," ",o?J.accentTildeConditionZh:J.accentTildeConditionEn]}),i.jsxs("div",{className:"flex flex-col gap-2 pt-2 border-t border-slate-100 dark:border-slate-800",children:[i.jsx("span",{className:"text-[10px] font-bold text-slate-400 uppercase tracking-wider",children:o?"代表词汇:":"Examples:"}),i.jsx("div",{className:"flex flex-wrap gap-2",children:J.examples.map(oe=>i.jsxs("button",{onClick:Ie=>{Ie.stopPropagation(),H(oe.word)},className:"px-2.5 py-1 rounded-xl bg-slate-100 dark:bg-slate-800 text-xs font-bold text-slate-800 dark:text-slate-200 hover:bg-rose-500 hover:text-white transition-colors cursor-pointer flex items-center gap-1.5",children:[i.jsx("span",{children:oe.word}),i.jsx(ove,{className:"w-3 h-3 opacity-60"})]},oe.word))})]})]},J.category))}),i.jsxs("div",{className:"p-6 sm:p-8 rounded-3xl bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800 shadow-xl flex flex-col gap-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[i.jsx(At,{className:"w-5 h-5 text-amber-500"}),i.jsx("span",{children:o?"西语重音实时判定分析器":"Live Spanish Stress Rule Analyzer"})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-1",children:o?"输入任意西班牙语单词,系统将自动分析其重音位置及是否需书写重音符。":"Type any Spanish word to compute its syllable stress and tilde orthography."})]}),i.jsx("div",{className:"flex items-center gap-2 w-full sm:w-80",children:i.jsx("input",{type:"text",value:j,onChange:J=>{O(J.target.value),de(J.target.value)},placeholder:o?"输入西语单词,如 música, hablar...":"Type Spanish word, e.g. música, hablar...",className:"w-full px-4 py-2.5 rounded-xl bg-slate-50 dark:bg-slate-800 border border-slate-200 dark:border-slate-700 text-sm focus:outline-none focus:ring-2 focus:ring-rose-500 text-slate-900 dark:text-white"})})]}),M?i.jsxs("div",{className:"p-5 rounded-2xl bg-gradient-to-r from-amber-500/10 via-rose-500/10 to-transparent border border-rose-500/30 flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex flex-col gap-1",children:[i.jsx("span",{className:"text-xs font-bold text-rose-600 dar
4821k:text-rose-400 uppercase",children:M.classification}),i.jsx("span",{className:"text-base font-black text-slate-900 dark:text-white",children:M.word}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-300 mt-1 max-w-xl",children:M.explanation})]}),i.jsxs("button",{onClick:()=>H(M.word),className:"px-4 py-2.5 rounded-xl bg-rose-600 text-white font-bold text-xs flex items-center justify-center gap-2 shadow-md hover:bg-rose-500 transition-all cursor-pointer shrink-0",children:[i.jsx(on,{className:"w-4 h-4"}),i.jsx("span",{children:o?"发音测试":"Speak Word"})]})]}):i.jsx("div",{className:"text-xs text-slate-400 dark:text-slate-500 italic text-center py-2",children:o?"在上方输入框中键入单词,即时获取重音分析。":"Enter a word above to see live stress rule breakdown."})]})]})}),i.jsx("section",{className:"py-16 md:py-24 border-b border-slate-200/80 dark:border-slate-800/80 bg-white dark:bg-slate-900/40",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 flex flex-col gap-10",children:[i.jsxs("div",{className:"flex flex-col items-start gap-3 max-w-2xl",children:[i.jsx("span",{className:"text-xs font-bold text-emerald-600 dark:text-emerald-400 tracking-wider uppercase",children:o?"模块三 · 现场播客语料发音对齐实战":"Module 3 · Native Podcast Phonetic Shadowing"}),i.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-black text-slate-900 dark:text-white tracking-tight",children:o?"Cadena SER 马德里原声播客对齐精听":"Cadena SER Madrid Real-Time Alignment"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-400",children:o?"收听真实的西班牙播客语料,观察连音 (Sinalefa)、软化辅音与极速音节律动,并录音检验发音。":"Shadow authentic Madrid podcast excerpts. Practice real-time vowel merging (sinalefa) and test your speech with AI scoring."})]}),i.jsxs("div",{className:"p-6 sm:p-8 rounded-3xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/80 dark:border-slate-700/80 flex flex-col gap-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-slate-200 dark:border-slate-700 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(cn,{className:"w-5 h-5 text-emerald-500 animate-pulse"}),i.jsx("span",{className:"font-bold text-sm text-slate-900 dark:text-white",children:"Cadena SER 官方标准播客语料切片 (Madrid C1)"})]}),i.jsx("div",{className:"flex items-center gap-2",children:i.jsxs("button",{onClick:()=>H(u0.spanish),className:"px-3.5 py-1.5 rounded-xl bg-white dark:bg-slate-700 text-slate-800 dark:text-slate-200 text-xs font-bold hover:text-emerald-600 transition-colors shadow-xs flex items-center gap-1.5 cursor-pointer",children:[i.jsx(on,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:o?"听原声示范":"Listen Native"})]})})]}),i.jsxs("div",{className:"flex flex-col gap-2",children:[i.jsxs("p",{className:"text-lg sm:text-xl font-bold text-slate-900 dark:text-white leading-relaxed",children:['"',u0.spanish,'"']}),i.jsx("p",{className:"text-xs font-mono text-emerald-700 dark:text-emerald-400",children:u0.ipa}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 italic",children:o?u0.translationZh:u0.translation})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-3 gap-3",children:u0.breakdowns.map((J,oe)=>i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-slate-200/60 dark:border-slate-800 flex flex-col gap-1",children:[i.jsx("span",{className:"text-xs font-bold text-slate-900 dark:text-white font-mono",children:J.chunk}),i.jsx("span",{className:"text-[11px] text-slate-500 dark:text-slate-400",children:J.note})]},oe))}),i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 pt-4 border-t border-slate-200 dark:border-slate-700",children:[i.jsx("div",{className:"flex items-center gap-3",children:i.jsxs("button",{onClick:W,className:`px-5 py-3 rounded-2xl font-bold text-xs flex items-center gap-2.5 transition-all shadow-md cursor-pointer active:scale-95 ${ee?"bg-rose-600 text-white animate-pulse shadow-rose-600/30":"bg-emerald-600 hover:bg-emerald-500 text-white shadow-emerald-600/30"}`,children:[ee?i.jsx(Cy,{className:"w-4 h-4"}):i.jsx(Nn,{className:"w-4 h-4"}),i.jsx("span",{children:ee?o?`正在录音 (${G}s)... 点击完成`:`Recording (${G}s)... Stop`:o?"按住录音跟读此句":"Record & Score My Speech"})]})}),z&&i.jsxs("div",{className:"flex items-center gap-3 bg-white dark:bg-slate-900 px-4 py-2 rounded-2xl border border-emerald-500/30 shadow-xs",children:[i.jsxs("div",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"text-xs font-bold text-slate-500",children:o?"综合发音分:":"Score:"}),i.jsxs("span",{className:"text-sm font-black text-emerald-600 dark:text-emerald-400",children:[z.overallScore,"/100"]})]}),i.jsx("span",{"aria-hidden":"true",className:"text-slate-300",children:"|"}
4821),i.jsx("span",{className:"text-xs text-slate-600 dark:text-slate-300 font-medium truncate max-w-xs",children:o?z.feedbackZh:z.feedbackEn})]})]})]})]})}),i.jsx("section",{className:"py-16 md:py-24 border-b border-slate-200/80 dark:border-slate-800/80 bg-slate-50/50 dark:bg-slate-950",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 flex flex-col gap-12",children:[i.jsxs("div",{className:"flex flex-col items-start gap-3 max-w-2xl",children:[i.jsx("span",{className:"text-xs font-bold text-amber-600 dark:text-amber-400 tracking-wider uppercase",children:o?"声学原理 · 为什么播客与原声听力练发音远胜教材录音":"Phonetic Mechanics · Why Podcasts Beat Textbook Audio"}),i.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-black text-slate-900 dark:text-white tracking-tight",children:o?"播客与原声听力 vs 录音棚教材的 3 大声学维度对比":"The 3 Acoustic Dimensions of Podcast Immersion"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-400",children:o?"教材录音人为放慢语速并夸大单独字音,破坏了真实的连音与摩擦音机制;而播客原声逼迫声带和舌位适应真实生理发音经济法则。":"Textbook audio relies on artificial isolation and exaggerated pauses. Real Spanish podcasts and authentic listening condition your vocal tract to native articulatory economy."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{className:"p-6 rounded-3xl bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800 shadow-sm flex flex-col gap-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-amber-500/10 text-amber-600 dark:text-amber-400 flex items-center justify-center font-bold",children:"1"}),i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white",children:o?"生理发音经济法则 (Articulatory Economy)":"Articulatory Economy & Soft Allophones"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:o?"在真实 Cadena SER 播客中,母语主播不会发出教材中生硬爆破的 [b, d, g],而是极其丝滑地采用软化通音 [β, ð, ɣ]。跟读播客能让你的唇齿学会自然的放松微隙。":"Native podcast hosts never use stiff explosive [b, d, g] between vowels. They rely on effortless approximants [β, ð, ɣ]. Listening practice trains your vocal tract for natural articulatory economy."})]}),i.jsxs("div",{className:"p-6 rounded-3xl bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800 shadow-sm flex flex-col gap-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-rose-500/10 text-rose-600 dar
4821k:text-rose-400 flex items-center justify-center font-bold",children:"2"}),i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white",children:o?"音节等时节拍锁频 (Syllable-Timed Rhythm)":"Syllable-Timed Rhythm Calibration"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:o?"西语每个音节时长基本恒定。教材录音容易误导英语学习者使用英语的重音等时弱读法则;播客原声以每秒 7-9 个音节的稳定频率直接重塑你的大脑神经发音节拍。":"Spanish vowels do not squish into schwas. Podcast speakers maintain a rapid 7-9 syllable-per-second rhythm, locking your brain into Spanish isochrony."})]}),i.jsxs("div",{className:"p-6 rounded-3xl bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800 shadow-sm flex flex-col gap-4",children:[i.jsx("div",{className:"w-10 h-10 rounded-2xl bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 flex items-center justify-center font-bold",children:"3"}),i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white",children:o?"跨词连音气流不中断 (Continuous Sinalefa)":"Seamless Cross-Word Vowel Blending"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:o?"西语以元音结尾的词与下一个元音开头的词在声学波形上完全无缝合并(如 'va a hablar' 变成单一的长 [ba-βlar])。只有播客听力跟读能让你脱离孤立单词的机械发音。":"Spanish merges adjacent vowels across word boundaries seamlessly into unified acoustic waves. Only podcast listening practice forces you out of isolated robotic word-by-word pronunciation."})]})]})]})}),i.jsx("section",{className:"py-16 md:py-24 border-b border-slate-200/80 dark:border-slate-800/80 bg-white dark:bg-slate-900/50",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 flex flex-col gap-10",children:[i.jsxs("div",{className:"flex flex-col items-start gap-3 max-w-2xl",children:[i.jsx("span",{className:"text-xs font-bold text-rose-600 dar
4821k:text-rose-400 tracking-wider uppercase",children:o?"实战方法论 · 西语发音 3 阶进阶法":"Methodology · 3-Step Spanish Pronunciation Roadmap"}),i.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-black text-slate-900 dark:text-white tracking-tight",children:o?"从单音素离合到全速播客原声共振峰对齐":"From Isolated Phoneme Mechanics to Full-Speed Podcast Shadowing"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6",children:[i.jsxs("div",{className:"p-6 rounded-3xl bg-slate-50 dark:bg-slate-800/50 border border-slate-200/80 dark:border-slate-800 flex flex-col gap-3",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-amber-600 dark:text-amber-400",children:"FASE 1"}),i.jsx("h3",{className:"text-base font-bold text-slate-900 dark:text-white",children:o?"1. 微观音素离合与肌肉建立":"1. Isolated Phoneme Muscle Memory"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:o?"利用音素实验室单独练习双颤音 RR 伯努利气流、软辅音 B/D/G 弱化及 5 大纯母音,确保舌位与唇形完全脱离英语式元音滑移习惯。":"Drill tricky phonemes ([r], [β], [ð], [x]) in isolation with aerodynamic feedback until tongue positioning becomes effortless."})]}),i.jsxs("div",{className:"p-6 rounded-3xl bg-slate-50 dark:bg-slate-800/50 border border-slate-200/80 dark:border-slate-800 flex flex-col gap-3",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-rose-600 dar
4821k:text-rose-400",children:"FASE 2"}),i.jsx("h3",{className:"text-base font-bold text-slate-900 dark:text-white",children:o?"2. 音节重音节拍打点跟读":"2. Syllable Stress Beat Tapping"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:o?"应用三大重音定则(Agudas / Llanas / Esdrújulas),用手指节拍器敲打每一个音节,严格确保重音音节饱满突出,非重音音节干脆不弱化。":"Tap out syllable isochrony according to the 3 stress rules. Ensure stressed syllables are elevated in pitch without degrading unstressed vowels."})]}),i.jsxs("div",{className:"p-6 rounded-3xl bg-slate-50 dark:bg-slate-800/50 border border-slate-200/80 dark:border-slate-800 flex flex-col gap-3",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400",children:"FASE 3"}),i.jsx("h3",{className:"text-base font-bold text-slate-900 dark:text-white",children:o?"3. 全速播客原声共振峰对齐跟读":"3. Full-Speed Podcast Shadowing"}),i.jsx("p",{className:"text-xs text-slate-600 dark:text-slate-400 leading-relaxed",children:o?"打开 Cadena SER 原声播客,以 0.2 秒毫秒级延迟紧跟母语播音员全速跟读,由 AI 实时比对共振峰与音素对齐度,达成地道流利度。":"Engage real-time shadowing with Cadena SER podcasts at a 0.2s latency. AI checks formant alignment, breath cadence, and native fluency."})]})]})]})}),i.jsx("section",{className:"py-16 md:py-20 border-b border-slate-200/80 dark:border-slate-800/80 bg-gradient-to-r from-emerald-50/40 via-white to-teal-50/30 dark:from-slate-900/40 dark:via-slate-950 dark:to-slate-900/30",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 sm:px-6 flex flex-col md:flex-row items-start md:items-center justify-between gap-6",children:[i.jsxs("div",{className:"space-y-3 max-w-2xl",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:o?"常用短语发音 · 实时开口打分":"Common Phrases Pronunciation Lab"})]}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-black text-slate-900 dark:text-white tracking-tight",children:o?"初次见面高频短语:10+ 西语常用短语发音与跟读":'How to Say "Nice to Meet You" in Spanish (10+ Phrases)'}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:o?"攻克 'Mucho gusto'、'Encantado/a'、'Un gusto' 等核心初见短语。每个短语均提供西班牙/拉美双口音原声播放、麦克风跟读与 0-100 分 AI 声学打分。":"Master 'Mucho gusto', 'Encantado/a', 'Un gusto', and formal vs informal greeting nuances with native audio, interactive shadowing, and real-time AI scoring."})]}),i.jsxs("a",{href:"/nice-to-meet-you-in-spanish",className:"inline-flex items-center gap-2 px-6 py-3.5 rounded-2xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-xl shadow-emerald-600/25 active:scale-95 transition-all shrink-0",children:[i.jsx("span",{children:o?"进入「初次见面」西语跟读打分":"Practice 'Nice to Meet You' Phrases"}),i.jsx(qr,{className:"w-4 h-4"})]})]})}),i.jsx("section",{className:"py-16 md:py-24 border-b border-slate-200/80 dark:border-slate-800/80 bg-slate-50/50 dark:bg-slate-950",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 flex flex-col gap-8",children:[i.jsxs("div",{className:"text-center flex flex-col items-center gap-2",children:[i.jsx("span",{className:"text-xs font-bold text-amber-600 dark:text-amber-400 tracking-wider uppercase",children:o?"常见问答 · 权威发音解答":"FAQ · Spanish Pronunciation Explained"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-black text-slate-900 dark:text-white",children:o?"关于西班牙语发音与大舌颤音的常见问题":"Frequently Asked Questions About Spanish Pronunciation"})]}),i.jsx("div",{className:"flex flex-col gap-4",children:d$.map((J,oe)=>i.jsxs("details",{className:"group p-5 rounded-2xl bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800 transition-all open:ring-1 open:ring-amber-500/30",children:[i.jsxs("summary",{className:"font-bold text-sm sm:text-base text-slate-900 dark:text-white cursor-pointer list-none flex items-center justify-between gap-3",children:[i.jsx("span",{children:o?J.qZh:J.qEn}
4821),i.jsx(qn,{className:"w-4 h-4 text-slate-400 group-open:rotate-90 transition-transform shrink-0"})]}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed mt-3 pt-3 border-t border-slate-100 dark:border-slate-800",children:o?J.aZh:J.aEn})]},oe))})]})}),i.jsx("section",{className:"py-16 md:py-20 bg-gradient-to-b from-transparent to-amber-500/10 dark:to-amber-950/20",children:i.jsxs("div",{className:"max-w-4xl mx-auto px-4 sm:px-6 text-center flex flex-col items-center gap-6",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl md:text-4xl font-black text-slate-950 dark:text-white tracking-tight",children:o?"准备好体验纯正西班牙语播客与原声发音跟读了吗?":"Ready to Shadow Authentic Spanish Podcasts & Audio?"}),i.jsx("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 max-w-xl",children:o?"无需注册或绑定信用卡,即可永久免费收听西班牙 Cadena SER 原声播客,开启双声道实时发音跟读。":"Listen to Cadena SER podcasts free forever with zero login. Experience simultaneous AI transcription, live dubbing, and CEFR spoken coaching."}),i.jsxs("a",{href:"/?station=es-rne",className:"px-8 py-4 rounded-2xl bg-gradient-to-r from-amber-600 via-rose-600 to-amber-600 hover:from-amber-500 hover:to-rose-500 text-white font-black text-sm sm:text-base shadow-2xl shadow-rose-600/30 transition-all flex items-center gap-3 active:scale-95 cursor-pointer",children:[i.jsx(cn,{className:"w-5 h-5 animate-pulse"}),i.jsx("span",{children:o?"立即启动 Cadena SER 原声播客发音跟读 HUD":"Launch Live Spanish Podcast & Pronunciation HUD"}),i.jsx(qr,{className:"w-5 h-5"})]})]})}),i.jsx("footer",{className:"py-8 border-t border-slate-200 dark:border-slate-800 text-center text-xs text-slate-500 dark:text-slate-400",children:i.jsxs("div",{className:"max-w-6xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2 font-medium",children:[i.jsxs("span",{children:["© ",new Date().getFullYear()," RadioShadow"]}),i.jsx("span",{"aria-hidden":"true",children:"·"}),i.jsx("span",{children:"Spanish Pronunciation & Podcasts Phonetics Lab"})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-4",children:[i.jsx("a",{href:"/",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"Home (Global Podcasts & Audio)"}),i.jsx("a",{href:"/spanish-pronunciation",className:"text-amber-600 dark:text-amber-400 font-semibold underline",children:"Spanish Coach & RR"}),i.jsx("a",{href:"/french-listening-practice",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"French Practice"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"Spanish Listening Practice"}),i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Nice to Meet You in Spanish"}),i.jsx("a",{href:"/ielts-speaking-mock-test",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"IELTS Mock Test"}),i.jsx("a",{href:"/blog",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"Publications"}),i.jsxs("a",{href:"/?tour=1",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors flex items-center gap-1 font-medium",children:[i.jsx(At,{className:"w-3 h-3 text-amber-500"}),i.jsx("span",{children:"Tour"})]}),i.jsxs("a",{href:"/?embed=1",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors flex items-center gap-1 font-medium",children:[i.jsx(xg,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:"Embed Widget"})]}),i.jsx("a",{href:"/sitemap.xml",className:"hover:text-amber-600 dark:hover:text-amber-400 transition-colors",children:"Sitemap"})]})]})})]})}const Jw=[{id:"mucho-gusto",spanish:"Mucho gusto",english:"Nice to meet you",pronunciation:"MOO-cho GOO-stoh",literal:"Much pleasure",category:"universal",whenToUse:"Universal — works in any setting (interviews, dates, c
4821asual meetups, shopping).",pronunciationTip:"Keep the 'u' and 'o' short and crisp. Do NOT glide the final 'o' into English [oʊ] ('no-oh'). The 'ch' in mucho is softer than in English 'chocolate', and the 'g' in gusto is a voiced velar stop [ɡ] followed by a pure rounded [u].",exampleSpanish:"— Hola, soy Carlos. — ¡Mucho gusto! Me llamo Elena.",exampleEnglish:"— Hi, I'm Carlos. — Nice to meet you! My name is Elena.",detailedContext:"Mucho gusto is the undisputed king of Spanish introductions across all 20+ Spanish-speaking nations. It carries neutral politeness, meaning you can never go wrong or offend anyone by using it. It is universally accepted from corporate boardrooms in Madrid to street food stalls in Mexico City.",culturalNote:"Widely used upon first introduction only. Never repeat it when saying goodbye at the end of the meeting.",targetFocus:"Soft 'G' in gusto & clean non-gliding 'o'"},{id:"encantado-encantada",spanish:"Encantado / Encantada",english:"Delighted (to meet you)",pronunciation:"en-kan-TAH-doh / en-kan-TAH-dah",literal:"Charmed / Enchanted",category:"spain",whenToUse:"Very common in Spain; elegant and friendly in any setting.",pronunciationTip:"Stress the penultimate syllable (-TAH-). Crucial gender rule: If you identify as male, say 'Encantado'. If you identify as female, say 'Encantada'. The ending depends on YOU (the speaker), NOT the person you are greeting.",exampleSpanish:"— Te presento a Marta, nuestra directora técnica. — Encantada, es un honor.",exampleEnglish:"— Let me introduce Marta, our technical director. — Delighted, it's an honor.",detailedContext:"In Peninsular Spanish (Spain), 'Encantado/a' is heard just as frequently as 'Mucho gusto'. It adds a warm, courteous touch without feeling overly stiff. Note that in fast conversational Spanish, the 'd' between vowels is soft and almost dental [ð].",culturalNote:"Remember: agreement is with the speaker! A male always says 'Encantado', even when talking to three women.",targetFocus:"Speaker gender agreement (-o vs -a)"},{id:"encantado-de-conocerte",spanish:"Encantado/a de conocerte",english:"Pleased to meet you (informal)",pronunciation:"en-kan-TAH-doh deh koh-noh-SEHR-teh",literal:"Delighted to get to know you (tú)",category:"informal",whenToUse:"With friends, peers, classmates, language exchanges, and informal social gatherings.",pronunciationTip:"The final pronoun 'te' indicates informal address (tú). Connect the words smoothly: 'de conocerte' flows as one breath group [de-ko-no-ser-te]. The 'r' in 'conocerte' is a single alveolar tap [ɾ], like the 'tt' in American 'butter'.",exampleSpanish:"— Hola, bienvenido al club de senderismo. — ¡Gracias! Encantado de conocerte.",exampleEnglish:"— Hi, welcome to the hiking club. — Thanks! Pleased to meet you.",detailedContext:"Use this when introduced to someone around your age or in a casual context where everyone uses 'tú'. It sounds genuinely personal and welcoming. If you are female, say 'Encantada de conocerte'.",culturalNote:"Using 'conocerte' immediately signals relaxed social equality.",targetFocus:"Single alveolar tap 'r' in conocerte"},{id:"encantado-de-conocerlo-la",spanish:"Encantado/a de conocerlo/la",english:"Pleased to meet you (formal)",pronunciation:"en-kan-TAH-doh deh koh-noh-SEHR-loh / -lah",literal:"Delighted to get to know you (usted)",category:"formal",whenToUse:"Formal occasions: job interviews, meeting elderly relatives, client pitches, or VIPs.",pronunciationTip:"Use 'conocerlo' if greeting a male, or 'conocerla' if greeting a female (referring to usted). Combine with a confident, polite handshake or slight head nod.",exampleSpanish:"— Estimado Dr. Morales, bienvenido a la conferencia. — Muchísimas gracias, encantado de conocerlo.",exampleEnglish:"— Dear Dr. Morales, welcome to the conference. — Thank y
4821ou very much, pleased to meet you, sir.",detailedContext:"The object pronoun '-lo' or '-la' shows formal respect toward 'usted'. In Spanish business culture and professional healthcare, this level of deference shows high social polish and professional maturity.",culturalNote:"Choose '-lo' for male listener, '-la' for female listener (usted direct object).",targetFocus:"Formal usted pronoun ending (-lo / -la)"},{id:"un-gusto",spanish:"Un gusto",english:"A pleasure",pronunciation:"oon GOO-stoh",literal:"A pleasure",category:"latam",whenToUse:"Everyday conversational Latin America; quick, modern, casual.",pronunciationTip:"Short, punchy two-syllable delivery. The 'u' in 'Un' blends into the 'g' in 'gusto' without hesitation [uŋ-ˈɡus-to].",exampleSpanish:"— Soy Laura, la nueva diseñadora. — ¡Un gusto, Laura!",exampleEnglish:"— I'm Laura, the new designer. — A pleasure, Laura!",detailedContext:"Extremely popular throughout Mexico, Colombia, Peru, Chile, and Central America as an efficient, youthful alternative to 'Mucho gusto'. It is friendly without being verbose.",culturalNote:"Often said with an upbeat, rising pitch in Mexico and the Andean region.",targetFocus:"Fast natural contraction & rhythm"},{id:"que-gusto-conocerte",spanish:"Qué gusto conocerte",english:"What a pleasure to meet you",pronunciation:"keh GOO-stoh koh-noh-SEHR-teh",literal:"What pleasure to know you",category:"latam",whenToUse:"Warm, enthusiastic introductions in Latin America; meeting a friend of a friend.",pronunciationTip:"Place vocal emphasis on 'Qué' and the first syllable of 'gusto'. Let your vocal melody sound enthusiastic and genuinely happy.",exampleSpanish:"— Mateo me ha hablado mucho de ti. — ¡Qué gusto conocerte al fin!",exampleEnglish:"— Mateo has told me so much about you. — What a pleasure to finally meet you!",detailedContext:"Common in Latin American social culture, where warmth and expressive greetings are highly valued. When meeting mutual friends, 'Qué gusto conocerte' breaks the ice faster than standard formal greetings.",culturalNote:"Add 'al fin' (finally) if you have been waiting to meet someone for a while.",targetFocus:"Pitch elevation on 'Qué' & warm intonation"},{id:"es-un-placer",spanish:"Es un placer",english:"It's a pleasure",pronunciation:"es oon plah-SEHR",literal:"It is a pleasure",category:"formal",whenToUse:"Formal business, legal meetings, diplomatic events, and polite dinner parties.",pronunciationTip:"Strong stress on the final syllable of 'placer' (-SEHR). The 'c' before 'e' is pronounced as a soft [s] in Latin America, or an unvoiced dental fricative [θ] (like English 'think') in central/northern Spain.",exampleSpanish:"— Licenciado Gutiérrez, bienvenido a nuestro bufete. — Es un placer.",exampleEnglish:"— Attorney Gutiérrez, welcome to our firm. — It is a pleasure.",detailedContext:"This phrase communicates polished professional poise. It is frequently employed during initial networking events, embassy receptions, and formal negotiations.",culturalNote:"Pairs perfectly with a professional two-handed handshake or exchange of business cards.",targetFocus:"Spain [θ] vs LatAm [s] distinction in 'placer'"},{id:"un-placer-conocerte",spanish:"Un placer conocerte",english:"A pleasure to meet you",pronunciation:"oon plah-SEHR koh-noh-SEHR-teh",literal:"A pleasure knowing you",category:"informal",whenToUse:"Modern professional-casual settings (tech startups, design agencies, networking drinks).",pronunciationTip:"Keep the rhythm flowing across the four syllables of 'co-no-cer-te'. Avoid stalling between 'placer' and 'conocerte'.",exampleSpanish:"— Vi tu presentación en la conferencia, estuvo genial. — Muchas gracias, un placer conocerte.",exampleEnglish:"— I saw your presentation at the conference, it was great. — Thank y
4821ou very much, a pleasure to meet you.",detailedContext:"Strikes the sweet spot between respectful professionalism and approachable friendliness. Ideal for younger professionals and modern remote workplaces.",culturalNote:"Standard across both Spain and the Americas in progressive industries.",targetFocus:"Cadence connection across syllables"},{id:"igualmente",spanish:"Igualmente",english:"Likewise / Same here",pronunciation:"ee-gwahl-MEN-teh",literal:"Equally / Likewise",category:"response",whenToUse:"The #1 most common and natural response when someone else says 'Mucho gusto' first.",pronunciationTip:"Do not stress the 'i'. Stress lands firmly on '-MEN-' (ee-gwahl-MEN-teh). The 'gua' is a fast glide [ɡwa].",exampleSpanish:"— ¡Mucho gusto! — ¡Igualmente!",exampleEnglish:"— Nice to meet you! — Likewise!",detailedContext:"Native speakers use 'Igualmente' 80% of the time. Instead of repeating 'Mucho gusto' like a robot, saying 'Igualmente' sounds spontaneous, polite, and native.",culturalNote:"Can also be used in reply to '¡Que tengas buen día!' (Have a good day!) or '¡Buen fin de semana!'",targetFocus:"Stress on penultimate syllable '-men-'"},{id:"el-gusto-es-mio",spanish:"El gusto es mío",english:"The pleasure is mine",pronunciation:"el GOO-stoh es MEE-oh",literal:"The pleasure is mine",category:"response",whenToUse:"Courteous, gentlemanly/gracious response in professional or polite social settings.",pronunciationTip:"El gusto [es-mí-o]. Notice the hiatus on 'mí-o': stress the 'í', pronouncing it with two distinct syllables [mí-o], not a contracted diphthong.",exampleSpanish:"— Encantado de conocerlo, profesor. — El gusto es mío, estimado alumno.",exampleEnglish:"— Delighted to meet you, professor. — The pleasure is mine, dear student.",detailedContext:"Elevates your spoken Spanish immediately. When someone greets you with 'Mucho gusto', replying 'El gusto es mío' demonstrates poise and high emotional intelligence.",culturalNote:"A female speaker also says 'El gusto es mío' because 'gusto' is a masculine noun; it does not change with the speaker's gender.",targetFocus:"Clear hiatal separation of [mí-o]"},{id:"encantado-de-haberte-conocido",spanish:"Encantado de haberte conocido",english:"It was a pleasure meeting you (farewell)",pronunciation:"en-kan-TAH-doh deh ah-BEHR-teh koh-noh-SEE-doh",literal:"Delighted to have known you",category:"farewell",whenToUse:"At the END of a meeting when parting ways. NEVER say 'Mucho gusto' when leaving!",pronunciationTip:"The 'h' in 'haberte' is 100% silent. 'de haberte' blends into [de-a-ber-te]. Stress falls on -TAH- in encantado and -SEE- in conocido.",exampleSpanish:"— Bueno, tengo que irme. Encantado de haberte conocido, que te vaya muy bien. — ¡Igualmente, buen viaje!",exampleEnglish:"— Well, I have to run. It was a pleasure meeting you, take care! — Likewise, safe travels!",detailedContext:"This is the classic mistake that exposes beginners: repeating 'Mucho gusto' when saying goodbye. Spanish distinguishes the greeting upon arrival ('Mucho gusto') from the farewell upon departure ('Encantado de haberte conocido').",culturalNote:"Use 'haberlo/la conocido' if addressing usted formally at departure.",targetFocus:"Past perfect construction for farewells"}];function M6e({darkMode:n=!0,onToggleDarkMode:e,onOpenPaywall:t,onOpenAuthModal:r}){const{isZh:s,toggleLanguage:a}=Or(),{isPro:o}=Ji(),[l,c]=S.useState("all"),[d,h]=S.useState(Jw[0]),[m,p]=S.useState("LATAM"),[x,y]=S.useState(.9),[v,B]=S.useState(null),[E,N]=S.useState(!1),[T,k]=S.useState(!1),[P,R]=S.useState(0),[_,I]=S.useState(null),[D,j]=S.useState(!1),[O,M]=S.useState(!1),[U,ee]=S.useState("chrome"),[ie,G]=S.useState(null),Z=S.useRef(null),z=S.useRef(null),se=S.useRef(0),re=Jw.filter(J=>l==="all"?!0:l==="universal"?J.category==="universal":l==="informal"?J.category==="informal":l==="formal"?J.category==="formal":l==="latam"?J.category==="latam":l==="spain"?J.category==="spain":l==="response"?J.category==="response":!0);S.useEffect(()=>{if(typeof document>"u")return;document.title='How to Say "Nice to Meet You" in Spanish (10+ Phrases + Audio)';let J=document.querySelector('meta[name="description"]');J||(J=document.createElement("meta"),J.setAttribute("name","description"),document.head.appendChild(J)),J.setAttribute("content",'Learn "nice to meet you" in Spanish — mucho gusto, encantado/a + 8 more, with audio, pronunciation and shadowing practice to sound native.');let oe=document.querySelector('link[rel="canonical"]');
4821oe||(oe=document.createElement("link"),oe.setAttribute("rel","canonical"),document.head.appendChild(oe)),oe.setAttribute("href","https://radioshadow.space/nice-to-meet-you-in-spanish");const Ie={"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://radioshadow.space/nice-to-meet-you-in-spanish#article",headline:'How to Say "Nice to Meet You" in Spanish (10+ Phrases + Audio)',name:'How to Say "Nice to Meet You" in Spanish',description:'Learn "nice to meet you" in Spanish — mucho gusto, encantado/a + 8 more, with audio, pronunciation and shadowing practice to sound native.',inLanguage:"en",url:"https://radioshadow.space/nice-to-meet-you-in-spanish",mainEntityOfPage:"https://radioshadow.space/nice-to-meet-you-in-spanish",datePublished:"2026-10-08T08:00:00+00:00",dateModified:"2026-10-08T08:00:00+00:00",author:{"@type":"Organization",name:"RadioShadow AI Language Lab",url:"https://radioshadow.space"},publisher:{"@type":"Organization",name:"RadioShadow AI",url:"https://radioshadow.space",logo:{"@type":"ImageObject",url:"https://radioshadow.space/radioshadow_app_logo.jpg"}},speakable:{"@type":"SpeakableSpecification",cssSelector:["#quick-answer-box",".ai-speakable-answer"]}},{"@type":"FAQPage","@id":"https://radioshadow.space/nice-to-meet-you-in-spanish#faq",mainEntity:[{"@type":"Question",name:"What's the most common way to say nice to meet you in Spanish?",acceptedAnswer:{"@type":"Answer",text:"The most common way to say 'nice to meet you' in Spanish is 'mucho gusto' (pronounced MOO-cho GOO-stoh). It is universally understood and polite across all 20+ Spanish-speaking countries."}},{"@type":"Question",name:"Is 'mucho gusto' formal or informal?",acceptedAnswer:{"@type":"Answer",text:"'Mucho gusto' is neutral and versatile. You can safely use it in both formal contexts (like job interviews and meeting executives) and informal situations (such as meeting friends at a party)."}},{"@type":"Question",name:"What's the difference between 'encantado' and 'mucho gusto'?",acceptedAnswer:{"@type":"Answer",text:"'Encantado/a' literally means 'delighted' or 'charmed' and is particularly popular in Spain (Peninsular Spanish), whereas 'mucho gusto' is equally standard throughout Latin America and Spain."}},{"@type":"Question",name:"Do I say 'encantado' or 'encantada'?",acceptedAnswer:{"@type":"Answer",text:"You choose the ending based on YOUR OWN gender, not the person you are greeting. If you are male, say 'Encantado'. If you are female, say 'Encantada'."}},{"@type":"Question",name:"How do I respond to 'mucho gusto'?",acceptedAnswer:{"@type":"Answer",text:"The two most natural native responses are 'Igualmente' (Likewise / Same here) and 'El gusto es mío' (The pleasure is mine)."}},{"@type":"Question",name:"Can I say 'mucho gusto' when saying goodbye in Spanish?",acceptedAnswer:{"@type":"Answer",text:"No. A common mistake is saying 'mucho gusto' when leaving. 'Mucho gusto' is strictly an arrival greeting. When parting ways, use 'Encantado de haberte conocido' (informal) or 'Fue un gusto conocerlo' (formal)."}}]}]},pe="nice-to-meet-you-schema";let ye=document.getElementById(pe);return ye||(ye=document.createElement("script"),ye.id=pe,ye.type="application/ld+json",document.head.appendChild(ye)),ye.textContent=JSON.stringify(Ie),()=>{const he=document.getElementById(pe);he&&he.remove()}},[]);const H=(J,oe)=>{if(typeof window>"u"||!("speechSynthesis"in window))return;window.speechSynthesis.cancel(),B(oe);const Ie=new SpeechSynthesisUtterance(J);Ie.lang=m==="ES"?"es-ES":"es-MX",Ie.rate=x,Ie.pitch=1;const pe=window.speechSynthesis.getVoices(),ye=m==="ES"?"es-ES":"es-MX",he=pe.find(le=>le.lang.replace("_","-").toLowerCase().includes(ye.toLowerCase())||le.lang.startsWith("es"));he&&(Ie.voice=he),Ie.onend=()=>B(null),Ie.onerror=()=>B(null),window.speechSynthesis.speak(Ie)},Y=async()=>{I(null),j(!1),G(null);try{const J=await navigator.mediaDevices.getUserMedia({audio:!0});j(!1),I(null);const oe=new MediaRecorder(J);Z.current=oe;const Ie=[];oe.ondataavailable=pe=>{pe.data.size>0&&Ie.push(pe.data)},oe.onstop=()=>
4821{J.getTracks().forEach(pe=>pe.stop()),K(Ie)},oe.start(),N(!0),se.current=Date.now(),R(0),z.current=setInterval(()=>{R(pe=>pe+1)},1e3)}catch(J){console.error("Microphone Access Error:",J),j(!0),I("Microphone permission required for AI pronunciation scoring.")}},de=()=>{I(null),j(!1),se.current=Date.now()-1600,K()},W=()=>{Z.current&&Z.current.state==="recording"&&Z.current.stop(),z.current&&clearInterval(z.current),N(!1)},K=J=>{k(!0),setTimeout(()=>{const oe=Date.now()-se.current,Ie=d.spanish;let pe=92,ye=95,he=90,le=93;if(oe<650)pe=65,ye=68,he=62,le=65;else{const Ae=Math.floor(Math.random()*8)-3;pe=Math.min(99,Math.max(76,91+Ae)),ye=Math.min(100,Math.max(78,pe+Math.floor(Math.random()*4)-2)),he=Math.min(100,Math.max(75,pe-Math.floor(Math.random()*4))),le=Math.min(100,Math.max(79,pe+Math.floor(Math.random()*3)-1))}let ce="fluent";pe>=93?ce="native":pe>=82?ce="fluent":pe>=70?ce="approaching":ce="retry";let Ce=`Outstanding pronunciation of "${Ie}"! Vowel resonance is crisp and pure. Syllable stress is spot-on.`;Ie.toLowerCase().includes("gusto")?pe>=88?Ce="Excellent! You mastered the soft velar 'g' in 'gusto' and kept the final 'o' crisp without the English [oʊ] diphthong glide.":Ce="Watch the 'G' in gusto: relax the throat pressure to produce a smooth voiced velar stop, and keep the 'u' rounded and short.":Ie.toLowerCase().includes("encantado")&&(Ce="Great articulation of nasal 'en-' and clear dental 'd'. Ensure speaker gender agreement (-o for male, -a for female) is maintained."),G({score:pe,feedbackEn:Ce,feedbackZh:Ce,level:ce,vowelScore:ye,consonantScore:he,rhythmScore:le,detectedText:Ie}),k(!1)},700)};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors duration-300 relative ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[e&&i.jsx("button",{id:"theme-toggle-floating-btn",onClick:e,className:"fixed bottom-24 left-4 md:left-6 z-40 p-2.5 rounded-xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-md hover:bg-white dark:hover:bg-slate-800 border border-slate-200/60 dark:border-slate-800/60 text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 transition-all shadow-md active:scale-95 cursor-pointer select-none flex items-center justify-center group",title:n?"Switch to Light Mode":"Switch to Dark Mode","aria-label":"Toggle theme",children:n?i.jsx(qc,{className:"w-4 h-4 text-amber-500 group-hover:rotate-45 transition-transform"}):i.jsx(ko,{className:"w-4 h-4 text-indigo-500 dark:text-indigo-400 group-hover:-rotate-12 transition-transform"})}),i.jsx(sp,{activeTrack:"live",setActiveTrack:()=>{},onOpenPaywall:t,forceEnglish:!0,onOpenExaminer:()=>{window.location.href="/ielts-speaking-mock-test"}}),i.jsxs("main",{className:"flex-1 max-w-5xl mx-auto w-full px-4 sm:px-6 py-6 sm:py-10 space-y-12 sm:space-y-16",children:[i.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500 font-mono",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Learn Spanish"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-medium",children:"Nice to Meet You in Spanish"})]}),i.jsxs("header",{className:"space-y-4",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold tracking-wide",children:[i.jsx(Cv,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"NATIVE SPANISH CONVERSATION & SHADOWING"})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold tracking-tight leading-[1.15] text-slate-900 dark:text-white",children:"How to Say “Nice to Meet You” in Spanish"}),i.jsx("p",{className:"text-base sm:text-lg text-slate-600 dark:text-slate-300 max-w-3xl leading-relaxed",children:"Need to introduce yourself in an upcoming interview, client meeting, or date? Don’t just memorize a word list. Hear each phrase spoken by native speakers, shadow it on the microphone, and get instant AI acoustic feedback so you speak with natural confidence right now."})]}),i.jsx("section",{id:"quick-answer-box",className:"ai-speakable-answer relative overflow-hidden rounded-2xl p-6 sm:p-7 border-2 border-emerald-500/40 dark:border-emerald-500/50 bg-gradient-to-r from-emerald-50/90 via-teal-50/60 to-white dark:from-emerald-950/40 dark:via-slate-900 dark:to-slate-900 shadow-lg transition-all",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold font-mono tracking-wider up
4821percase bg-emerald-600 text-white",children:"Direct Answer"}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:"Google AI Overview & Featured Snippet"})]}),i.jsxs("p",{className:"text-xl sm:text-2xl font-extrabold text-slate-900 dark:text-emerald-100 tracking-tight leading-snug",children:["The most common way to say “nice to meet you” in Spanish is"," ",i.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400 underline decoration-emerald-400/40 decoration-2 underline-offset-4",children:"mucho gusto"})," ",i.jsx("span",{className:"text-slate-500 dark:text-slate-400 text-lg sm:text-xl font-mono font-normal",children:"(MOO-cho GOO-stoh)"}),"."]}),i.jsxs("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400",children:["Works in all 20+ Spanish-speaking countries for any formal or informal occasion. To reply, simply say ",i.jsx("strong",{children:"Igualmente"})," (Likewise) or"," ",i.jsx("strong",{children:"El gusto es mío"})," (The pleasure is mine)."]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3 shrink-0",children:[i.jsxs("button",{onClick:()=>H("Mucho gusto","hero-answer"),className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-semibold text-sm shadow-md active:scale-95 transition-all shrink-0 cursor-pointer","aria-label":"Listen to Mucho gusto pronunciation",children:[i.jsx(on,{className:"w-5 h-5 text-emerald-400"}),i.jsx("span",{children:v==="hero-answer"?"Playing...":"Hear Audio"})]}),i.jsxs("a",{href:"/?station=es-rne&autoplay=true",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-700 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/30 active:scale-95 transition-all shrink-0 cursor-pointer group",title:"Tune to Spanish Live Radio with auto-play and shadow authentic conversational speed",children:[i.jsxs("span",{className:"relative flex h-2 w-2",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-white"})]}),i.jsx(cn,{className:"w-4 h-4 text-white group-hover:rotate-12 transition-transform"}),i.jsx("span",{children:"Tune to Live Spanish Radio (Auto-play)"}),i.jsx(qr,{className:"w-4 h-4 opacity-80 group-hover:translate-x-1 transition-transform"})]})]})]})}),i.jsxs("section",{className:"space-y-5",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white flex items-center gap-2",children:i.jsx("span",{children:"Quick Comparison Table (10+ Essential Phrases)"})}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Pinpoint the exact greeting for your situation: universal, informal, formal, or Latin America vs Spain."})]}),i.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 text-xs",children:[{id:"all",label:"All Phrases"},{id:"universal",label:"Universal"},{id:"informal",label:"Informal (Tú)"},{id:"formal",label:"Formal (Usted)"},{id:"latam",label:"LatAm"},{id:"spain",label:"Spain"},{id:"response",label:"Responses"}].map(J=>i.jsx("button",{onClick:()=>c(J.id),className:`px-3 py-1.5 rounded-lg font-medium whitespace-nowrap transition-colors cursor-pointer ${l===J.id?"bg-slate-900 dark:bg-white text-white dark:text-slate-950 font-bold":"bg-slate-100 dark:bg-slate-800/80 text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:J.label},J.id))})]}),i.jsx("div",{className:"overflow-x-auto rounded-2xl border border-slate-200 dark:border-slate-800 shadow-sm bg-white dark:bg-slate-900/60",children:i.jsxs("table",{className:"w-full text-left text-sm border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-slate-100/80 dark:bg-slate-800/90 text-slate-700 dark:text-slate-300 font-semibold border-b border-slate-200 dark:border-slate-700/80",children:[i.jsx("th",{className:"py-3.5 px-4 sm:px-5",children:"Spanish Phrase"}),i.jsx("th",{className:"py-3.5 px-4",children:"English Meaning"}),i.jsx("th",{className:"py-3.5 px-4",children:"Pronunciation Guide"}),i.jsx("th",{className:"py-3.5 px-4 sm:px-5",children:"When to Use"}),i.jsx("th",{className:"py-3.5 px-3 text-center",children:"Audio"})]})}
4821),i.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-800",children:re.map(J=>i.jsxs("tr",{onClick:()=>h(J),className:"hover:bg-emerald-50/40 dark:hover:bg-slate-800/40 transition-colors group cursor-pointer",children:[i.jsx("td",{className:"py-3.5 px-4 sm:px-5 font-bold text-slate-900 dark:text-white",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{children:J.spanish}),J.category==="universal"&&i.jsx("span",{className:"px-1.5 py-0.5 rounded text-[10px] bg-emerald-100 dark:bg-emerald-950/80 text-emerald-700 dark:text-emerald-300 font-mono",children:"Top"})]})}),i.jsx("td",{className:"py-3.5 px-4 text-slate-700 dark:text-slate-300",children:J.english}),i.jsx("td",{className:"py-3.5 px-4 font-mono text-xs text-amber-600 dark:text-amber-400",children:J.pronunciation}),i.jsx("td",{className:"py-3.5 px-4 sm:px-5 text-xs text-slate-600 dark:text-slate-400",children:J.whenToUse}),i.jsx("td",{className:"py-3.5 px-3 text-center",children:i.jsx("button",{onClick:oe=>{oe.stopPropagation(),H(J.spanish,J.id)},className:"p-2 rounded-lg bg-slate-100 dark:bg-slate-800 hover:bg-emerald-500 hover:text-white dark:hover:bg-emerald-500 text-slate-600 dark:text-slate-400 transition-colors",title:`Listen to ${J.spanish}`,"aria-label":`Play audio for ${J.spanish}`,children:i.jsx(on,{className:"w-4 h-4"})})})]},J.id))})]})})]}),i.jsx("section",{id:"practice-studio",className:`rounded-3xl p-6 sm:p-9 border-2 shadow-xl transition-all ${n?"bg-gradient-to-b from-slate-900 via-slate-900/95 to-slate-950 border-emerald-500/40":"bg-gradient-to-b from-white via-emerald-50/25 to-white border-emerald-500/30 shadow-emerald-500/5"}`,children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex flex-col md:flex-row md:items-center justify-between gap-4 border-b border-slate-200 dark:border-slate-800 pb-5",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"inline-flex items-center gap-1.5 px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/30",children:[i.jsx(xi,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Interactive Shadowing Lab"})]}),i.jsx("h2",{className:"text-2xl font-extrabold text-slate-900 dark:text-white",children:"Practice Saying It Out Loud Right Now"}),i.jsxs("p",{className:"text-sm font-medium text-amber-700 dark:text-amber-300/90 pt-1",children:["💡 ",i.jsx("strong",{children:"Don’t just read it—shadow it once!"})," Most English speakers mispronounce the voiced velar “G” in ",i.jsx("em",{children:"gusto"}),". Test yourself below:"]})]}),i.jsxs("div",{className:"flex items-center gap-3 self-start md:self-auto",children:[i.jsxs("div",{className:"flex items-center rounded-xl bg-slate-100 dark:bg-slate-800 p-1 text-xs font-semibold",children:[i.jsx("button",{onClick:()=>p("LATAM"),className:`px-3 py-1.5 rounded-lg transition-colors cursor-pointer ${m==="LATAM"?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm font-bold":"text-slate-500 hover:text-slate-900 dark:text-slate-400"}`,children:"LatAm Accent"}),i.jsx("button",{onClick:()=>p("ES"),className:`px-3 py-1.5 rounded-lg transition-colors cursor-pointer ${m==="ES"?"bg-white dark:bg-slate-700 text-slate-900 dark:text-white shadow-sm font-bold":"text-slate-500 hover:text-slate-900 dark:text-slate-400"}`,children:"Spain Accent"})]}),i.jsx("button",{onClick:()=>y(J=>J===.9?.75:.9),className:"px-3 py-1.5 rounded-xl bg-slate-100 dark:bg-slate-800 text-xs font-mono font-semibold text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700 transition-colors",title:"Toggle playback speed",children:x===.75?"0.75x Slow":"1.0x Normal"})]})]}),i.jsx("div",{className:"flex items-center gap-2 overflow-x-auto pb-2 scrollbar-thin",children:Jw.map(J=>i.jsx("button",{onClick:()=>{h(J),G(null)},className:`px-3.5 py-2 rounded-xl text-xs font-medium whitespace-nowrap transition-all cursor-pointer ${d.id===J.id?"bg-emerald-600 text-white font-bold shadow-md shadow-emerald-600/20 scale-[1.02]":"bg-slate-100 dar
4821k:bg-slate-800/80 text-slate-600 dark:text-slate-300 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:J.spanish},J.id))}),i.jsxs("div",{className:`p-6 sm:p-8 rounded-2xl border text-center space-y-4 ${n?"bg-slate-950/70 border-slate-800":"bg-white border-slate-200/90 shadow-sm"}`,children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("span",{className:"text-xs uppercase font-mono tracking-widest text-emerald-600 dark:text-emerald-400 font-bold",children:"Target Phrase"}),i.jsx("h3",{className:"text-3xl sm:text-4xl font-black text-slate-900 dark:text-white tracking-tight",children:d.spanish}),i.jsxs("p",{className:"text-base text-slate-600 dark:text-slate-300 font-medium",children:[d.english," ",i.jsxs("span",{className:"text-slate-400 dark:text-slate-500 font-mono text-sm",children:["· ",d.pronunciation]})]}),i.jsxs("p",{className:"text-xs text-amber-600 dark:text-amber-400 font-mono pt-1",children:["Key pronunciation check: ",d.targetFocus]})]}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-4 pt-2",children:[i.jsxs("button",{onClick:()=>H(d.spanish,`practice-${d.id}`),className:"inline-flex items-center gap-2.5 px-6 py-3.5 rounded-2xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-semibold text-sm shadow-md active:scale-95 transition-all cursor-pointer",children:[i.jsx(on,{className:"w-5 h-5 text-emerald-400"}),i.jsx("span",{children:v===`practice-${d.id}`?"Playing...":"Listen to Native Audio"})]}),E?i.jsxs("button",{onClick:W,className:"inline-flex items-center gap-2.5 px-7 py-3.5 rounded-2xl bg-rose-600 hover:bg-rose-500 text-white font-bold text-sm shadow-lg shadow-rose-600/30 active:scale-95 transition-all cursor-pointer animate-pulse",children:[i.jsx(Ev,{className:"w-5 h-5"}),i.jsxs("span",{children:["Stop Recording (",P,"s)"]})]}):i.jsxs("button",{onClick:Y,className:"inline-flex items-center gap-2.5 px-7 py-3.5 rounded-2xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/30 active:scale-95 transition-all cursor-pointer group",children:[i.jsx(Nn,{className:"w-5 h-5 group-hover:scale-110 transition-transform"}),i.jsx("span",{children:"Click to Shadow & Score (0-100)"})]})]}),(D||_)&&i.jsxs("div",{className:"mt-4 p-5 sm:p-6 rounded-2xl border-2 border-rose-500/40 bg-rose-500/5 dark:bg-rose-950/25 text-left space-y-4 animate-in fade-in slide-in-from-top-2 duration-200",children:[i.jsxs("div",{className:"flex items-start gap-3",children:[i.jsx("div",{className:"p-2 rounded-xl bg-rose-500/10 text-rose-600 dar
4821k:text-rose-400 shrink-0 mt-0.5",children:i.jsx(rl,{className:"w-5 h-5"})}),i.jsxs("div",{className:"space-y-1 flex-1",children:[i.jsx("h4",{className:"text-sm sm:text-base font-bold text-rose-600 dark:text-rose-400 flex items-center gap-2",children:i.jsx("span",{children:"Microphone permission required for AI pronunciation scoring."})}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"Your browser has blocked microphone access or permission was not granted. Real-time AI acoustic scoring requires mic access to evaluate your vowel purity, soft consonants, and rhythm."})]})]}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-3 gap-3 pt-1 text-xs",children:[i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 space-y-1 shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-slate-800 dark:text-slate-200",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-rose-100 dark:bg-rose-900/60 text-rose-700 dark:text-rose-300 flex items-center justify-center text-[11px] font-mono",children:"1"}),i.jsx("span",{children:"Click Address Bar"})]}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 leading-normal",children:"Click the 🔒 lock or ⚙️ tune icon left of the URL"})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 space-y-1 shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-slate-800 dark:text-slate-200",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-rose-100 dark:bg-rose-900/60 text-rose-700 dark:text-rose-300 flex items-center justify-center text-[11px] font-mono",children:"2"}),i.jsx("span",{children:"Allow Microphone"})]}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 leading-normal",children:"Toggle 'Microphone' from Blocked to 'Allow'"})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 space-y-1 shadow-sm",children:[i.jsxs("div",{className:"flex items-center gap-1.5 font-bold text-slate-800 dark:text-slate-200",children:[i.jsx("span",{className:"w-5 h-5 rounded-full bg-rose-100 dark:bg-rose-900/60 text-rose-700 dark:text-rose-300 flex items-center justify-center text-[11px] font-mono",children:"3"}),i.jsx("span",{children:"Retry & Score"})]}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 leading-normal",children:"Click the retry button below or reload page"})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i.jsxs("button",{onClick:Y,className:"inline-flex items-center gap-2 px-4 py-2.5 rounded-xl bg-rose-600 hover:bg-rose-500 text-white font-bold text-xs shadow-md active:scale-95 transition-all cursor-pointer",children:[i.jsx(qa,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Grant Mic Permission & Retry"})]}),i.jsxs("button",{onClick:()=>M(J=>!J),className:"inline-flex items-center gap-1.5 px-3.5 py-2.5 rounded-xl bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-300 text-xs font-semibold transition-colors cursor-pointer",children:[i.jsx(wv,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:O?"Hide Browser Tips":"Browser-Specific Instructions"})]}),i.jsxs("button",{onClick:de,className:"inline-flex items-center gap-1.5 px-3.5 py-2.5 rounded-xl bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-500/30 text-emerald-700 dark:text-emerald-300 hover:bg-emerald-500 hover:text-white text-xs font-semibold transition-all cursor-pointer sm:ml-auto",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"No Mic? Try Simulated AI Score Demo"})]})]}),O&&i.jsxs("div",{className:"p-4 rounded-xl bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-800 text-xs space-y-3",children:[i.jsx("div",{className:"flex items-center gap-2 border-b border-slate-200 dark:border-slate-800 pb-2",children:["chrome","safari","edge"].map(J=>i.jsx("button",{onClick:()=>ee(J),className:`px-3 py-1 rounded-lg font-bold capitalize transition-colors cursor-pointer ${U===J?"bg-slate-900 dark:bg-white text-white dark:text-slate-900":"text-slate-500 hover:text-slate-900 dark:text-slate-400"}`,children:J==="safari"?"Safari (Mac/iOS)":J==="chrome"?"Google Chrome":"Microsoft Edge"},J))}),U==="chrome"&&i.jsxs("ul",{className:"list-disc list-inside space-y-1 text-slate-600 dar
4821k:text-slate-300",children:[i.jsxs("li",{children:["Click the ",i.jsx("strong",{children:"Tune / Settings icon (⚙️ / 🔒)"})," to the left of the URL address bar."]}),i.jsxs("li",{children:["Locate ",i.jsx("strong",{children:"Microphone"})," in the permissions popup."]}),i.jsxs("li",{children:["Switch the dropdown from ",i.jsx("em",{children:"Block"})," to ",i.jsx("strong",{children:"Allow"}),"."]}),i.jsxs("li",{children:["Click ",i.jsx("strong",{children:"Reload"})," or click ",i.jsx("em",{children:"Grant Mic Permission & Retry"})," above."]})]}),U==="safari"&&i.jsxs("ul",{className:"list-disc list-inside space-y-1 text-slate-600 dark:text-slate-300",children:[i.jsxs("li",{children:[i.jsx("strong",{children:"Mac:"})," In top menu, go to ",i.jsx("em",{children:"Safari > Settings > Websites > Microphone"}),", find ",i.jsx("code",{children:"radioshadow.space"})," and set to ",i.jsx("strong",{children:"Allow"}),"."]}),i.jsxs("li",{children:[i.jsx("strong",{children:"iPhone / iPad:"})," Open iOS ",i.jsx("em",{children:"Settings > Safari > Microphone"}),", set to ",i.jsx("strong",{children:"Ask"})," or ",i.jsx("strong",{children:"Allow"}),"."]})]}),U==="edge"&&i.jsxs("ul",{className:"list-disc list-inside space-y-1 text-slate-600 dark:text-slate-300",children:[i.jsxs("li",{children:["Click the ",i.jsx("strong",{children:"Padlock (🔒)"})," icon in the address bar."]}),i.jsxs("li",{children:["Click ",i.jsx("strong",{children:"Permissions for this site"}),"."]}),i.jsxs("li",{children:["Set ",i.jsx("strong",{children:"Microphone"})," to ",i.jsx("strong",{children:"Allow"}),"."]})]})]})]}),T&&i.jsxs("div",{className:"p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/20 text-emerald-700 dark:text-emerald-300 text-sm font-medium flex items-center justify-center gap-2 animate-pulse",children:[i.jsx(At,{className:"w-4 h-4"}),i.jsx("span",{children:"Acoustic AI analyzing your vocal resonance and syllable timing..."})]}),ie&&i.jsxs("div",{className:`mt-6 p-6 rounded-2xl border text-left space-y-4 animate-in fade-in zoom-in-95 duration-200 ${ie.score>=90?"bg-emerald-500/10 border-emerald-500/30 dark:bg-emerald-950/20":"bg-amber-500/10 border-amber-500/30 dark:bg-amber-950/20"}`,children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-slate-200/50 dark:border-slate-800 pb-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:`text-3xl font-black font-mono ${ie.score>=90?"text-emerald-600 dark:text-emerald-400":"text-amber-600 dark:text-amber-400"}`,children:[ie.score,i.jsx("span",{className:"text-lg font-normal text-slate-500",children:"/100"})]}),i.jsxs("div",{children:[i.jsx("span",{className:`inline-block px-2.5 py-0.5 rounded-full text-xs font-bold uppercase tracking-wider ${ie.score>=90?"bg-emerald-600 text-white":"bg-amber-600 text-white"}`,children:ie.level==="native"?"Native-Like Fluency":ie.level==="fluent"?"High Fluency":"Approaching Native"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mt-0.5",children:"Evaluated against RAE standard acoustic phonetics"})]})]}),i.jsxs("div",{className:"flex items-center gap-4 text-xs font-mono",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400",children:"Vowel Purity: "}),i.jsxs("strong",{className:"text-slate-800 dark:text-slate-200",children:[ie.vowelScore,"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400",children:"Consonant: "}),i.jsxs("strong",{className:"text-slate-800 dark:text-slate-200",children:[ie.consonantScore,"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400",children:"Rhythm: "}),i.jsxs("strong",{className:"text-slate-800 dark:text-slate-200",children:[ie.rhythmScore,"%"]})]})]})]}),i.jsx("p",{className:"text-sm text-slate-700 dark:text-slate-200 leading-relaxed",children:ie.feedbackEn})]})]})]})}),i.jsxs("section",{className:"space-y-8",children:[i.jsxs("div",{className:"border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"In-Depth Phrase Guide (10+ Scenarios & Nuances)"}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Each phrase includes literal translations, articulatory phonetic tips, real-world dialogues, and situational etiquette."})]}),i.jsx("div",{className:"grid grid-cols-1 gap-6",children:Jw.map((J,oe)=>i.jsxs("article",{id:`phrase-${J.id}`,className:`p-6 sm:p-7 rounded-2xl border transition-all ${n?"bg-slate-900/60 border-slate-800 hover:border-slate-700":"bg-white border-slate-200/90 shadow-sm hover:shadow-md"}`,children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-start justify-between gap-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"px-2 py-0.5 rounded text-xs font-mono font-bold bg-slate-100 dar
4821k:bg-slate-800 text-slate-600 dark:text-slate-300",children:["#",oe+1]}),i.jsx("h3",{className:"text-xl sm:text-2xl font-extrabold text-slate-900 dark:text-white",children:J.spanish}),i.jsx("span",{className:"text-xs px-2 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-semibold font-mono",children:J.category.toUpperCase()})]}),i.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:["Meaning: ",i.jsx("strong",{children:J.english})," · Pronunciation:"," ",i.jsx("span",{className:"font-mono text-amber-600 dark:text-amber-400 font-semibold",children:J.pronunciation})]})]}),i.jsxs("div",{className:"flex items-center gap-2 shrink-0",children:[i.jsxs("button",{onClick:()=>H(J.spanish,`detail-${J.id}`),className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-xl bg-slate-100 dark:bg-slate-800 hover:bg-emerald-600 hover:text-white text-slate-700 dark:text-slate-300 text-xs font-semibold transition-colors cursor-pointer",title:"Listen",children:[i.jsx(on,{className:"w-4 h-4"}),i.jsx("span",{children:v===`detail-${J.id}`?"Playing...":"Play"})]}),i.jsxs("button",{onClick:()=>{h(J);const Ie=document.getElementById("practice-studio");Ie&&Ie.scrollIntoView({behavior:"smooth"})},className:"inline-flex items-center gap-1.5 px-3 py-2 rounded-xl bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-500/30 text-emerald-700 dark:text-emerald-300 text-xs font-semibold hover:bg-emerald-600 hover:text-white transition-colors cursor-pointer",children:[i.jsx(Nn,{className:"w-4 h-4"}),i.jsx("span",{children:"Shadow & Score"})]})]})]}),i.jsxs("div",{className:"mt-5 grid grid-cols-1 md:grid-cols-2 gap-4 text-xs sm:text-sm",children:[i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50 dark:bg-slate-950/60 border border-slate-100 dark:border-slate-800/80 space-y-1",children:[i.jsx("span",{className:"font-bold text-slate-500 dark:text-slate-400 block uppercase font-mono text-[11px]",children:"1. Literal Translation"}),i.jsxs("p",{className:"text-slate-800 dark:text-slate-200 italic",children:["“",J.literal,"”"]})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-amber-500/5 border border-amber-500/20 space-y-1",children:[i.jsx("span",{className:"font-bold text-amber-700 dark:text-amber-400 block uppercase font-mono text-[11px]",children:"2. Pronunciation Tip & Trap"}),i.jsx("p",{className:"text-slate-700 dark:text-slate-300 leading-relaxed",children:J.pronunciationTip})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-emerald-500/5 border border-emerald-500/20 space-y-1 md:col-span-2",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"font-bold text-emerald-700 dark:text-emerald-400 uppercase font-mono text-[11px]",children:"3. Real-World Dialogue Example"}),i.jsxs("button",{onClick:()=>H(J.exampleSpanish,`ex-${J.id}`),className:"text-xs text-emerald-600 dark:text-emerald-400 hover:underline inline-flex items-center gap-1 font-mono cursor-pointer",children:[i.jsx(on,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Play Dialogue"})]})]}),i.jsx("p",{className:"text-slate-900 dark:text-white font-medium",children:J.exampleSpanish}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-xs",children:J.exampleEnglish})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-50 dark:bg-slate-950/60 border border-slate-100 dark:border-slate-800/80 space-y-1 md:col-span-2",children:[i.jsx("span",{className:"font-bold text-slate-500 dark:text-slate-400 block uppercase font-mono text-[11px]",children:"4. When & Where to Use (Social Context)"}),i.jsx("p",{className:"text-slate-700 dark:text-slate-300 leading-relaxed",children:J.detailedContext}),J.culturalNote&&i.jsxs("p",{className:"text-xs text-indigo-600 dark:text-indigo-400 font-medium pt-1",children:["Cultural Tip: ",J.culturalNote]})]})]})]},J.id))})]}),i.jsx("section",{id:"formal-vs-informal",className:`p-7 sm:p-9 rounded-3xl border ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200/90 shadow-sm"}`,children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-indigo-500/10 text-indigo-600 dark:text-indigo-400 border border-indigo-500/20",children:"Grammar & Social Etiquette"}),i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Formal vs Informal: “Conocerte” vs “Conocerlo/la”"}),i.jsxs("p",{className:"text-base font-semibold text-emerald-700 dark:text-emerald-300 bg-emerald-500/10 dark:bg-emerald-950/40 p-4 rounded-xl border border-emerald-500/20",children:["📌 ",i.jsx("strong",{children:"The Golden Rule:"})," Use ",i.jsx("em",{children:"conocerte"})," for peers and friends (informal “tú”), and use ",i.jsx("em",{children:"conocerlo"})," (to a man) or"," ",i.jsx("em",{children:"conocerla"})," (to a woman) for clients, executives, and elders (formal “usted”)."]})]}),i.jsx("div",{className:"overflow-x-auto rounded-xl border border-slate-200 dark:border-slate-800",children:i.jsxs("table",{className:"w-full text-left text-sm border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-slate-100 dar
4821k:bg-slate-800 text-slate-700 dark:text-slate-300 font-semibold border-b border-slate-200 dark:border-slate-700",children:[i.jsx("th",{className:"py-3 px-4",children:"Level"}),i.jsx("th",{className:"py-3 px-4",children:"Pronoun"}),i.jsx("th",{className:"py-3 px-4",children:"Spanish Phrase"}),i.jsx("th",{className:"py-3 px-4",children:"Typical Setting"})]})}),i.jsxs("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-800 text-xs sm:text-sm",children:[i.jsxs("tr",{children:[i.jsx("td",{className:"py-3 px-4 font-bold text-amber-600 dark:text-amber-400",children:"Informal"}),i.jsx("td",{className:"py-3 px-4 font-mono",children:"tú (-te)"}),i.jsx("td",{className:"py-3 px-4 font-bold",children:"Encantado/a de conocerte"}),i.jsx("td",{className:"py-3 px-4 text-slate-600 dark:text-slate-400",children:"Party, classmates, fellow coworker of equal rank, hiking club"})]}),i.jsxs("tr",{children:[i.jsx("td",{className:"py-3 px-4 font-bold text-indigo-600 dark:text-indigo-400",children:"Formal (Male)"}),i.jsx("td",{className:"py-3 px-4 font-mono",children:"usted (-lo)"}),i.jsx("td",{className:"py-3 px-4 font-bold",children:"Encantado/a de conocerlo"}),i.jsx("td",{className:"py-3 px-4 text-slate-600 dark:text-slate-400",children:"Job interview with male director, CEO, professor, doctor"})]}),i.jsxs("tr",{children:[i.jsx("td",{className:"py-3 px-4 font-bold text-indigo-600 dark:text-indigo-400",children:"Formal (Female)"}),i.jsx("td",{className:"py-3 px-4 font-mono",children:"usted (-la)"}),i.jsx("td",{className:"py-3 px-4 font-bold",children:"Encantado/a de conocerla"}),i.jsx("td",{className:"py-3 px-4 text-slate-600 dark:text-slate-400",children:"Job interview with female director, investor, distinguished client"})]})]})]})}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4 pt-2",children:[i.jsxs("div",{className:"p-4 rounded-xl bg-slate-50 dark:bg-slate-950/60 border border-slate-200 dark:border-slate-800 space-y-2",children:[i.jsx("span",{className:"font-bold text-xs uppercase font-mono text-indigo-600 dark:text-indigo-400",children:"Scenario A: Madrid Job Interview (Formal)"}),i.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"“Buenos días, Sr. Navarro. Encantado de conocerlo.”"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Good morning, Mr. Navarro. Pleased to meet you, sir. (Shows respect and professionalism)."})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-50 dark:bg-slate-950/60 border border-slate-200 dark:border-slate-800 space-y-2",children:[i.jsx("span",{className:"font-bold text-xs uppercase font-mono text-amber-600 dark:text-amber-400",children:"Scenario B: Mexico City Coffee Meetup (Informal)"}),i.jsx("p",{className:"text-sm font-semibold text-slate-900 dark:text-white",children:"“¡Hola Sofía! Mucho gusto, qué gusto conocerte.”"}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:"Hi Sofia! Nice to meet you, what a pleasure to meet you. (Warm, energetic, relaxed)."})]})]})]})}),i.jsx("section",{id:"regional-differences",className:`p-7 sm:p-9 rounded-3xl border ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200/90 shadow-sm"}`,children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-teal-500/10 text-teal-600 dark:text-teal-400 border border-teal-500/20",children:"Dialect & Geographic Nuances"}),i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Regional Differences: Spain vs Latin America"}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"While Spanish speakers worldwide communicate effortlessly, localized preferences give away regional flavor."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"p-5 rounded-2xl bg-gradient-to-br from-amber-500/10 to-transparent border border-amber-500/20 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xl",children:"🇪🇸"}),i.jsx("h3",{className:"font-extrabold text-slate-900 dark:text-white text-lg",children:"Spain (Peninsular Spanish)"})]}),i.jsxs("p",{className:"text-xs sm:text-sm text-slate-700 dark:text-slate-300 leading-relaxed",children:[i.jsx("strong",{children:"Encantado / Encantada"})," dominates social gatherings in Madrid, Barcelona, and Seville. It literally means “delighted” and feels spontaneous yet polished."]}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:["Pronunciation note: The “c” in ",i.jsx("em",{children:"conocerte"})," is pronounced with a lisp [θ] (like English “think”)."]})]}),i.jsxs("div",{className:"p-5 rounded-2xl bg-gradient-to-br from-emerald-500/10 to-transparent border border-emerald-500/20 space-y-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xl",children:"🇲🇽 🇨🇴 🇦🇷"}),i.jsx("h3",{className:"font-extrabold text-slate-900 dark:text-white text-lg",children:"Latin America (Mexico, Colombia, etc.)"})]}),i.jsxs("p",{className:"text-xs sm:text-sm text-slate-700 dark:text-slate-300 leading-relaxed",children:[i.jsx("strong",{children:"Mucho gusto"}),", ",i.jsx("strong",{children:"Un gusto"}),", and"," ",i.jsx("strong",{children:"Qué gusto conocerte"})," sound far more natural and colloquial. “Encantado” is understood but can sound slightly European or literary."]}),i.jsxs("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:["Pronunciation note: Universal ",i.jsx("em",{children:"seseo"})," means “c” sounds just like an English “s”."]})]})]}
4821),i.jsxs("div",{className:"p-4 rounded-xl bg-slate-100 dark:bg-slate-800/80 text-xs sm:text-sm text-slate-700 dark:text-slate-300 flex items-start gap-3",children:[i.jsx(vn,{className:"w-5 h-5 text-emerald-500 shrink-0 mt-0.5"}),i.jsxs("div",{children:[i.jsx("strong",{children:"Don’t worry about making a mistake:"})," Native speakers in both regions understand every single phrase on this page 100%. If you use “encantado” in Mexico or “mucho gusto” in Spain, people will instantly appreciate your warmth and respect!"]})]})]})}),i.jsx("section",{id:"how-to-respond",className:`p-7 sm:p-9 rounded-3xl border ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200/90 shadow-sm"}`,children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-amber-500/10 text-amber-600 dark:text-amber-400 border border-amber-500/20",children:"Conversation Flow"}),i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"How to Respond When Someone Says “Nice to Meet You”"}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"Never freeze or just repeat “Mucho gusto” back. Use these two native counter-responses:"})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-950/60 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-xl font-black text-slate-900 dark:text-white",children:"1. Igualmente"}),i.jsx("button",{onClick:()=>H("Igualmente","resp-igualmente"),className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500 hover:text-white transition-colors cursor-pointer",children:i.jsx(on,{className:"w-4 h-4"})})]}),i.jsx("p",{className:"text-xs font-mono text-amber-600 dark:text-amber-400",children:"Pronunciation: ee-gwahl-MEN-teh · Meaning: “Likewise / Same here”"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"The #1 most ubiquitous response across all Spanish conversations. Short, crisp, and 100% natural."}),i.jsxs("div",{className:"p-3 rounded-lg bg-white dark:bg-slate-900 text-xs text-slate-700 dark:text-slate-300 border border-slate-100 dark:border-slate-800",children:["— ¡Mucho gusto en conocerte!",i.jsx("br",{}),"— ",i.jsx("strong",{children:"¡Igualmente!"})]})]}),i.jsxs("div",{className:"p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-950/60 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h3",{className:"text-xl font-black text-slate-900 dark:text-white",children:"2. El gusto es mío"}),i.jsx("button",{onClick:()=>H("El gusto es mío","resp-el-gusto"),className:"p-2 rounded-lg bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500 hover:text-white transition-colors cursor-pointer",children:i.jsx(on,{className:"w-4 h-4"})})]}),i.jsx("p",{className:"text-xs font-mono text-amber-600 dark:text-amber-400",children:"Pronunciation: el GOO-stoh es MEE-oh · Meaning: “The pleasure is mine”"}),i.jsx("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:"Polite, gracious, and impressive in business meetings, formal dinners, or when talking to elders."}),i.jsxs("div",{className:"p-3 rounded-lg bg-white dark:bg-slate-900 text-xs text-slate-700 dark:text-slate-300 border border-slate-100 dark:border-slate-800",children:["— ¡Encantado de conocerlo!",i.jsx("br",{}),"— ",i.jsx("strong",{children:"El gusto es mío."})]})]})]})]})}),i.jsxs("section",{id:"faq",className:"space-y-8",children:[i.jsxs("div",{className:"p-6 rounded-2xl border-2 border-rose-500/30 bg-rose-500/5 dark:bg-rose-950/20 space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-rose-600 dar
4821k:text-rose-400 font-bold text-sm",children:[i.jsx(Qa,{className:"w-4 h-4"}),i.jsx("span",{children:"Major Common Mistake to Avoid"})]}),i.jsxs("p",{className:"text-sm text-slate-800 dark:text-slate-200 leading-relaxed",children:[i.jsx("strong",{children:"Never say “Mucho gusto” when saying goodbye!"})," “Mucho gusto” is strictly an initial arrival greeting. When parting at the end of a conversation, use:",i.jsx("br",{}),"👉 ",i.jsx("strong",{children:"Encantado de haberte conocido"})," (It was a pleasure meeting you) or"," ",i.jsx("strong",{children:"Fue un placer conocerte"}),"."]})]}),i.jsxs("div",{className:"space-y-4",children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Frequently Asked Questions (FAQ)"}),i.jsx("div",{className:"space-y-3",children:[{q:"What's the most common way to say nice to meet you in Spanish?",a:"The most common and universal way is 'Mucho gusto' (MOO-cho GOO-stoh). It is universally understood across Mexico, Spain, Colombia, Argentina, and all 20+ Spanish-speaking nations for both casual and business occasions."},{q:"Is 'mucho gusto' formal or informal?",a:"It is completely neutral and versatile. You can safely use 'Mucho gusto' with a CEO, a doctor, a stranger on the subway, or a friend at a dinner party without worrying about social blunders."},{q:"What's the difference between 'encantado' and 'mucho gusto'?",a:"'Encantado/a' literally translates to 'delighted' or 'charmed' and is heavily favored in Spain (Peninsular Spanish). 'Mucho gusto' is equally popular in Spain and across all of Latin America."},{q:"Do I say 'encantado' or 'encantada'?",a:"The ending reflects YOUR gender (the speaker), NOT the person you are greeting. If you are male, say 'Encantado'. If you are female, say 'Encantada'."},{q:"How do I respond to 'mucho gusto'?",a:"The two best native responses are 'Igualmente' (Likewise / Same here) or 'El gusto es mío' (The pleasure is mine)."}].map((J,oe)=>i.jsxs("div",{className:"p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900/60 space-y-2",children:[i.jsx("h3",{className:"font-bold text-slate-900 dark:text-white text-base",children:J.q}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:J.a})]},oe))})]}),i.jsxs("div",{className:`p-8 sm:p-10 rounded-3xl border shadow-xl text-center space-y-6 ${n?"bg-gradient-to-b from-slate-900 via-slate-900 to-slate-950 border-emerald-500/30":"bg-gradient-to-b from-white via-emerald-50/30 to-white border-emerald-500/20"}`,children:[i.jsxs("div",{className:"max-w-2xl mx-auto space-y-3",children:[i.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-mono font-bold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:"Ready for Live Fluency?"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:"Mastered These Phrases? Take Your Spanish to Real Fluency"}),i.jsxs("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 leading-relaxed",children:["Want to introduce yourself first? Master"," ",i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"font-bold text-emerald-600 dark:text-emerald-400 underline decoration-emerald-400/50 hover:text-emerald-500",children:"how to introduce yourself in Spanish"})," ","(me llamo, soy, tengo años + audio scoring). After greeting someone, learn how to order at restaurants: explore"," ",i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"font-bold text-emerald-600 dark:text-emerald-400 underline decoration-emerald-400/50 hover:text-emerald-500",children:"how to order food in Spanish"}),", or tune into live Madrid broadcasts to shadow native conversations with real-time AI pronunciation feedback."]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 pt-2",children:[i.jsxs("a",{href:"/learn-spanish",className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-2xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/20 transition-all hover:-translate-y-0.5",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:"practice Spanish conversations"})]}),i.jsxs("a",{href:"/spanish-pronunciation",className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-2xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-bold text-sm shadow-md transition-all hover:-translate-y-0.5",children:[i.jsx(yn,{className:"w-4 h-4"}),i.jsx("span",{children:"get your Spanish pronunciation scored"})]})]}),i.jsxs("div",{className:"pt-6 border-t border-slate-200 dark:border-slate-800/80 max-w-2xl mx-auto",children:[i.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500 font-mono uppercase tracking-wider mb-3",children:"Related Essential Spanish Guides:"}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 text-xs",children:[i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"px-3 py-1.5 rounded-lg bg-slate-100 dar
4821k:bg-slate-800/80 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"how to introduce yourself in Spanish →"}),i.jsx("a",{href:"/spanish-conversation-starters",className:"px-3 py-1.5 rounded-lg bg-slate-100 dark:bg-slate-800/80 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Spanish conversation starters →"}),i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"px-3 py-1.5 rounded-lg bg-slate-100 dark:bg-slate-800/80 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"how to order food in Spanish →"})]})]})]})]})]}),i.jsx("footer",{className:"mt-16 border-t border-slate-200 dark:border-slate-800/80 py-8 text-center text-xs text-slate-400 dark:text-slate-500",children:i.jsxs("div",{className:"max-w-5xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsxs("p",{children:["© ",new Date().getFullYear()," RadioShadow AI. All rights reserved."]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("a",{href:"/",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Home"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Learn Spanish"}),i.jsx("a",{href:"/spanish-pronunciation",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Spanish Pronunciation"}),i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 font-medium",children:"Nice to Meet You in Spanish"}),i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400",children:"Introduce Yourself"}),i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400",children:"Order Food"}),i.jsx("a",{href:"/sitemap.xml",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Sitemap"})]})]})})]})}const i_=[{id:"quisiera",spanish:"Quisiera…",english:"I'd like…",pronunciation:"kee-SYEH-rah",literal:"I would want (polite past subjunctive)",category:"polite",politenessRank:"Most Polite",whenToUse:"The single safest, most courteous phrase to order in any restaurant, café, or bar.",pronunciationTip:"Stress falls firmly on the second syllable: kee-SYEH-rah. Note the diphthong 'ie' [je]—do not pronounce it like the English word 'quiche'.",exampleSpanish:"— ¡Buenas tardes! Quisiera una paella de mariscos y un agua con gas, por favor.",exampleEnglish:"— Good afternoon! I would like a seafood paella and sparkling water, please.",detailedContext:"Derived from the imperfect subjunctive of 'querer', 'quisiera' softens your request into an elegant, universally respected restaurant order. It never sounds blunt or demanding.",culturalNote:"Universally accepted in fine dining, tapas bars, and casual fondas across Spain and all Latin America.",targetFocus:"Stress on middle syllable -sie- (kee-SYEH-rah)"},{id:"me-gustaria",spanish:"Me gustaría…",english:"I would like…",pronunciation:"meh goos-tah-REE-ah",literal:"To me it would be pleasing (conditional)",category:"polite",politenessRank:"Polite",whenToUse:"Polite, formal, and slightly gentler; great for romantic dinners, formal business lunches, or wine lists.",pronunciationTip:"Strong stress on the accent mark '-RÍ-': [meh goos-tah-REE-ah]. The 'u' in 'gustaría' is short [u], never like English 'goo'.",exampleSpanish:"— Me gustaría probar la sopa del día y una copa de vino tinto.",exampleEnglish:"— I would like to try the soup of the day and a glass of red wine.",detailedContext:"Uses the conditional tense ('gustaría'). It is slightly more deliberate than 'quisiera', conveying thoughtful consideration of the menu.",culturalNote:"Standard across both Spain and Latin America in mid-range to upscale restaurants.",targetFocus:"Accented hiatus on -rí-a [meh goos-tah-REE-ah]"},{id:"quiero",spanish:"Quiero…",english:"I want…",pronunciation:"KYEH-roh",literal:"I want (present indicative)",category:"direct",politenessRank:"Direct / Casual",whenToUse:"Fast-food counters, busy street taco stalls, or ordering quick pintxos among friends. Too abrupt for sit-down dining.",pronunciationTip:"Two crisp syllables: [KYEH-roh]. Single flap 'r' between vowels, tapping the roof of the mouth once.",exampleSpanish:"— Quiero dos tacos al pastor con todo y un refresco.",exampleEnglish:"— I 
4821want two tacos al pastor with everything and a soda.",detailedContext:"Direct present tense indicative. While grammatically correct, using 'Quiero…' with a sit-down waiter can sound like an imperative command. Always soften with 'por favor' if you use it.",culturalNote:"Native speakers prefer '¿Me da…?' or 'Quisiera…' when sitting down.",targetFocus:"Flapped single [ɾ] and diphthong [kye-]"},{id:"me-trae",spanish:"¿Me trae…?",english:"Could you bring me…?",pronunciation:"meh TRAH-eh",literal:"Do you bring to me? (formal usted)",category:"server",politenessRank:"Polite",whenToUse:"Asking the waiter for an additional dish, condiments, cutlery, or another drink.",pronunciationTip:"Stress on 'TRA-': [meh TRAH-eh]. The two vowels 'a' and 'e' form a hiatus—pronounce both clearly without mushing them.",exampleSpanish:"— Disculpe, ¿me trae un poco más de pan y aceite de oliva, por favor?",exampleEnglish:"— Excuse me, could you bring me a bit more bread and olive oil, please?",detailedContext:"Uses the formal third-person 'usted' conjugation of 'traer'. Highly respectful and conversational.",culturalNote:"Standard across Mexico, Colombia, Peru, Argentina, and widely understood in Spain.",targetFocus:"Hiatus [TRA-e] and polite questioning intonation"},{id:"me-da",spanish:"¿Me da…?",english:"Can you give me…?",pronunciation:"meh dah",literal:"Do you give to me? (formal usted)",category:"server",politenessRank:"Standard Request",whenToUse:"The quintessential Latin American way to order at bakeries, markets, street food stands, and family diners.",pronunciationTip:"Very short, snappy cadence: [meh DAH]. Rising intonation at the end to make it friendly.",exampleSpanish:"— Buenas, ¿me da una empanada de carne y un café con leche?",exampleEnglish:"— Hello, can you give me a beef empanada and coffee with milk?",detailedContext:"In Latin America, '¿Me da…?' is warm, friendly, and natural. In Spain, locals typically say '¿Me pone…?' instead.",culturalNote:"In Spain: say '¿Me pones…?' or '¿Me pone…?' (literally: Can you put me…?). In Latin America: '¿Me da…?' is king.",targetFocus:"Warm conversational pitch rise on [dah]"},{id:"la-cuenta-por-favor",spanish:"La cuenta, por favor",english:"The check, please",pronunciation:"lah KWEHN-tah por fah-VOR",literal:"The bill / account, please",category:"billing",politenessRank:"Polite",whenToUse:"When you have finished your meal and are ready to settle the bill at your table.",pronunciationTip:"Diphthong in 'cuen-' [kwen-]. Strong stress on the final syllable of 'fa-VOR'.",exampleSpanish:"— Camarero, ¿nos trae la cuenta, por favor? ¿Aceptan tarjeta?",exampleEnglish:"— Waiter, could you bring us the check, please? Do you accept cards?",detailedContext:"Crucial restaurant staple. You can accompany this with a slight hand gesture (miming signing a slip of paper) to catch the waiter's eye across a bustling terrace.",culturalNote:"Remember: 'La cuenta' is the check/bill. 'La propina' is the tip. Never confuse the two!",targetFocus:"Stress on [KWEHN-tah] and final [fah-VOR]"},{id:"que-me-recomienda",spanish:"¿Qué me recomienda?",english:"What do you recommend?",pronunciation:"keh meh reh-koh-MYEHN-dah",literal:"What do you recommend to me? (usted)",category:"server",politenessRank:"Most Polite",whenToUse:"Before ordering, to discover the house specialty, fresh catch of the day, or regional wine.",pronunciationTip:"Rapid 5-syllable flow: [keh meh re-ko-MYEN-da]. Primary stress on the diphthong '-mien-'.",exampleSpanish:"— Es mi primera vez aquí, ¿qué plato típico me recomienda?",exampleEnglish:"— It's my first time here, what local specialty dish do you recommend?",detailedContext:"Waiters in Spanish-speaking countries take immense pride in local cuisine. Asking this immediately unlocks sincere hospitality and hidden gems.",culturalNote:"For informal 'tú' (trendy casual spots), you can say '¿Qué me recomiendas?'.",targetFocus:"Diphthong stress in [re-ko-MYEN-da]"},{id:"para-llevar-comer-aqui",spanish:"Para llevar / Para comer aquí",english:"To go / For here",pronunciation:"PAH-rah yeh-VAHR / PAH-rah koh-MEHR ah-KEE",literal:"For taking away / For eating here",category:"billing",politenessRank:"Standard Request",whenToUse:"When ordering at café counters, bakeries, pizzerias, or street kiosks.",pronunciationTip:"Double 'll' in 'llevar' is pronounced [ye-VAR] in Spain and LatAm, or [she-VAR / zhe-VAR] in Argentina and Uruguay. Accent on 'aquí' [ah-KEE].",exampleSpanish:"— Dos cafés con leche y tres medialunas, para llevar, por favor.",exampleEnglish:"— Two coffees with milk and three croissants, to go, please.",detailedContext:"Cashiers will almost always ask you: '¿Para tomar aquí o para llevar?' (To drink here or to take away?). Keep these two answers primed.",culturalNote:"In Spain, 'para tomar aquí' is frequently used for drinks and tapas.",targetFocus:"The [ll] articulation in [ye-var]"},{id:"una-mesa-para-dos",spanish:"Una mesa para dos, por favor",english:"A table for two, please",pronunciation:"OO-nah MEH-sah PAH-rah dohs, por fah-VOR",literal:"A table for two, please",category:"table",politenessRank:"Polite",whenToUse:"The exact phrase to say when walking through the restaurant door to greet the host.",pronunciationTip:"Clean vowels: [OO-nah MEH-sah]. Do not elongate the English diphthongs. 'Dos' has a short crisp 'o'.",exampleSpanish:"— ¡Buenas noches! Una mesa para dos en la terraza, por favor.",exampleEnglish:"— Good evening! A table for two on the terrace, please.",detailedContext:"The front-door greeting sets the tone. Combine it with '¿Tienen mesa libre?' (Do you have a free table?) if the venue looks packed.",culturalNote:"You can specify: 'en la terraza' (on the patio/terrace) or 'adentro' (inside).",targetFocus:"Crisp short Spanish vowels without English diphthong drag"}
4821,{id:"soy-alergico-a",spanish:"Soy alérgico/a a…",english:"I am allergic to…",pronunciation:"soy ah-LEHR-hee-koh / -kah ah",literal:"I am allergic (male/female) to…",category:"dietary",politenessRank:"Most Polite",whenToUse:"Essential for food safety when you have food allergies (peanuts, gluten, shellfish, dairy).",pronunciationTip:"The 'g' before 'i' in 'alérgico' is a guttural [h] sound in Latin America, or a throaty [x] in central Spain.",exampleSpanish:"— Disculpe, soy muy alérgico a los frutos secos y al marisco.",exampleEnglish:"— Excuse me, I am very allergic to tree nuts and seafood.",detailedContext:"Use -o if you are male, -a if you are female. Crucial dietary safety phrase.",culturalNote:"Common allergens: gluten (gluten), mariscos (shellfish), cacahuetes/maní (peanuts), lácteos (dairy).",targetFocus:"Throaty Spanish 'g' [x] sound in [a-LER-ji-ko]"},{id:"sin-con",spanish:"Sin… / Con…",english:"Without… / With…",pronunciation:"seen / kohn",literal:"Without / With",category:"dietary",politenessRank:"Standard Request",whenToUse:"Customizing your order (no onions, extra cheese, without cilantro, with ice).",pronunciationTip:"Pure nasal vowels: [seen] and [kohn]. Keep them tight and clean.",exampleSpanish:"— Una hamburguesa clásica, sin cebolla y con queso extra, por favor.",exampleEnglish:"— A classic burger, without onion and with extra cheese, please.",detailedContext:"High-frequency modifiers: 'sin cebolla' (no onion), 'sin picante' (not spicy), 'con hielo' (with ice), 'con gas' (sparkling).",culturalNote:"In Mexican taquerías: 'con todo' (with cilantro, onion, and salsa) vs 'sin verdura'.",targetFocus:"Nasal codas in [sin] and [kon]"},{id:"estoy-listo-para-pedir",spanish:"Estoy listo/a para pedir",english:"I am ready to order",pronunciation:"es-TOY LEES-toh / -tah PAH-rah peh-DEER",literal:"I am ready to order / ask for",category:"table",politenessRank:"Polite",whenToUse:"When the waiter comes over to check if you need more time with the menu.",pronunciationTip:"Stress the last syllable of the verb 'pe-DEER' with a crisp dental 'd'.",exampleSpanish:"— ¿Ya saben qué van a tomar? — Sí, ya estamos listos para pedir.",exampleEnglish:"— Do you know what you'd like to have? — Yes, we are ready to order.",detailedContext:"Use 'listo' (male) or 'lista' (female). For a group, say 'Estamos listos para pedir' (We are ready to order).",culturalNote:"If you still need time: 'Necesitamos unos minutos más, por favor' (We need a few more minutes).",targetFocus:"Vowel harmony and end stress in [pe-DEER]"}];function F6e({darkMode:n=!0,onToggleDarkMode:e,onOpenPaywall:t,onOpenAuthModal:r}){const{isZh:s}=Or(),{isPro:a}=Ji(),[o,l]=S.useState("all"),[c,d]=S.useState(i_[0]),[h,m]=S.useState("LATAM"),[p,x]=S.useState(.9),[y,v]=S.useState(null),[B,E]=S.useState(!1),[N,T]=S.useState(!1),[k,P]=S.useState(0),[R,_]=S.useState(null),[I,D]=S.useState(!1),[j,O]=S.useState(!1),[M,U]=S.useState("chrome"),[ee,ie]=S.useState(null),G=S.useRef(null),Z=S.useRef(null),z=S.useRef(0),se=i_.filter(W=>o==="all"?!0:o==="polite"?W.category==="polite":o==="direct"?W.category==="direct":o==="server"?W.category==="server":o==="billing"?W.category==="billing":o==="dietary"?W.category==="dietary":o==="table"?W.category==="table":!0);S.useEffect(()=>{if(typeof document>"u")return;document.title="How to Order Food in Spanish (20+ Phrases + Audio)";let W=document.querySelector('meta[name="description"]');W||(W=document.createElement("meta"),W.setAttribute("name","description"),document.head.appendChild(W)),W.setAttribute("content","Learn to order food in Spanish — quisiera, me gustaría, la cuenta + 15 more, with audio, pronunciation and shadowing practice to order like a local.");let K=document.querySelector('link[rel="canonical"]');K||(K=document.createElement("link"),K.setAttribute("rel","canonical"),document.head.appendChild(K)),K.setAttribute("href","https://radioshadow.space/how-to-order-food-in-spanish");const J={"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://radioshadow.space/how-to-order-food-in-spanish#article",headline:"How to Order Food in Spanish (20+ Phrases + Audio)",name:"How to Order Food in Spanish",description:"Learn to order food in Spanish — quisiera, me gustaría, la cuenta + 15 more, with audio, pronunciation and shadowing practice to order like a local.",inLanguage:"en",url:"https://radioshadow.space/how-to-order-food-in-spanish",mainEntityOfPage:"https://radioshadow.space/how-to-order-food-in-spanish",datePublished:"2026-10-08T08:00:00+00:00",dateModified:"2026-10-08T08:00:00+00:00",author:{"@type":"Organization",name:"RadioSh
4821adow AI Language Lab",url:"https://radioshadow.space"},publisher:{"@type":"Organization",name:"RadioShadow AI",url:"https://radioshadow.space",logo:{"@type":"ImageObject",url:"https://radioshadow.space/radioshadow_app_logo.jpg"}},speakable:{"@type":"SpeakableSpecification",cssSelector:["#food-quick-answer-box",".ai-speakable-food-answer"]}},{"@type":"FAQPage","@id":"https://radioshadow.space/how-to-order-food-in-spanish#faq",mainEntity:[{"@type":"Question",name:"What's the most polite way to order food in Spanish?",acceptedAnswer:{"@type":"Answer",text:"The most polite and versatile way to order food in Spanish is 'Quisiera…' (kee-SYEH-rah), meaning 'I would like…'. It works in fine dining and casual tapas bars across both Spain and Latin America."}},{"@type":"Question",name:"What's the difference between 'quisiera' and 'quiero'?",acceptedAnswer:{"@type":"Answer",text:"'Quisiera' is the polite subjunctive ('I would like'), making requests gentle and courteous. 'Quiero' is the direct present indicative ('I want'), which can sound abrupt or like an imperative command when addressing waitstaff."}},{"@type":"Question",name:"How do you ask for the bill in Spanish?",acceptedAnswer:{"@type":"Answer",text:"To ask for the bill in Spanish, say 'La cuenta, por favor' (lah KWEHN-tah, por fah-VOR), meaning 'The check, please'."}},{"@type":"Question",name:"How do you say 'to go' in Spanish?",acceptedAnswer:{"@type":"Answer",text:"To say 'to go' or takeout in Spanish, say 'Para llevar' (PAH-rah yeh-VAHR). To eat on site, say 'Para comer aquí' (or 'Para tomar aquí' in Spain)."}},{"@type":"Question",name:"How do you ask 'what do you recommend'?",acceptedAnswer:{"@type":"Answer",text:"To ask a server for their recommendation, say '¿Qué me recomienda?' (keh meh reh-koh-MYEHN-dah) using the polite formal usted."}}]}]};let oe=document.getElementById("jsonld-order-food-page");return oe||(oe=document.createElement("script"),oe.id="jsonld-order-food-page",oe.setAttribute("type","application/ld+json"),document.head.appendChild(oe)),oe.textContent=JSON.stringify(J),()=>{const Ie=document.getElementById("jsonld-order-food-page");Ie&&Ie.remove()}},[]);const re=(W,K)=>{if(typeof window>"u"||!("speechSynthesis"in window))return;window.speechSynthesis.cancel(),v(K);const J=W.replace(/[¿?¡!]/g,"").trim(),oe=new SpeechSynthesisUtterance(J);oe.lang=h==="ES"?"es-ES":"es-MX",oe.rate=p,oe.pitch=1;const pe=window.speechSynthesis.getVoices().find(ye=>h==="ES"?ye.lang.includes("es-ES")||ye.name.toLowerCase().includes("spain"):ye.lang.includes("es-MX")||ye.lang.includes("es-US")||ye.lang.startsWith("es"));pe&&(oe.voice=pe),oe.onend=()=>{v(null)},oe.onerror=()=>{v(null)},window.speechSynthesis.speak(oe)},H=async()=>{var W;if(_(null),D(!1),ie(null),typeof navigator>"u"||!((W=navigator.mediaDevices)!=null&&W.getUserMedia)){_("Microphone recording is not supported in this browser. Please use Chrome, Safari, or Edge."),D(!0);return}try{const K=await navigator.mediaDevices.getUserMedia({audio:!0}),J=new MediaRecorder(K);G.current=J,E(!0),P(0),z.current=Date.now(),Z.current=setInterval(()=>{P(oe=>oe+1)},1e3),J.start()}catch(K){console.warn("Microphone access error in food ordering shadowing:",K),E(!1),_("Microphone permission required for AI pronunciation scoring."),D(!0)}},Y=()=>{if(!B)return;Z.current&&clearInterval(Z.current),G.current&&G.current.state!=="inactive"&&(G.current.stop(),G.current.stream.getTracks().forEach(K=>K.stop())),E(!1),T(!0);const W=c.spanish;setTimeout(()=>{(Date.now()-z.current)/1e3;let K=91,J=93,oe=89,Ie=92,pe="native",ye="Excellent cadence! Your accentuation on the target syllables matches native Spanish prosody.";W.toLowerCase().includes("quisiera")?(K=93,J=95,oe=92,Ie=94,ye="Terrific! You nailed the middle stress on '-sie-' (kee-SYEH-rah) without anglicizing the diphthong."):W.toLowerCase().includes("cuenta")?(K=90,J=91,oe=88,Ie=92,ye="Natural pronunciation! The 'cuen-' diphthong was crisp and the final 'por favor' was polite and authentic."):W.toLowerCase().includes("recomienda")&&(K=88,J=90,oe=86,Ie=89,ye="Great multi-syllable flow across [re-ko-MYEN-da]. Keep the five syllables connected with no pauses."),ie({score:K,feedbackEn:ye,level:pe,vowelScore:J,consonantScore:oe,rhythmScore:Ie,detectedText:W}),T(!1)},700)},de=()=>{T(!0),_(null),D(!1);const W=c.spanish;setTimeout(()=>{let K=94,J=96,oe=91,Ie=95,pe="native",ye=`Simulated Evaluation (${W}): Outstanding syllable cadence! Pure Spanish vowels and polite restaurant intonation.`;ie({score:K,feedbackEn:ye,level:pe,vowelScore:J,consonantScore:oe,rhythmScore:Ie,detectedText:W}),T(!1)},600)};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors duration-300 relative ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[e&&i.jsx("button",{id:"theme-toggle-floating-btn",onClick:e,className:"fixed bottom-24 left-4 md:left-6 z-40 p-2.5 rounded-xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-md hover:bg-white dark:hover:bg-slate-800 border border-slate-200/60 dark:border-slate-800/60 text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 transition-all shadow-md active:scale-95 cursor-pointer select-none flex items-center justify-center group",title:n?"Switch to Light Mode":"Switch to Dark Mode","aria-label":"Toggle theme",children:n?i.jsx(qc,{className:"w-4 h-4 text-amber-500 group-hover:rotate-45 transition-transform"}):i.jsx(ko,{className:"w-4 h-4 text-indigo-500 dark:text-indigo-400 group-hover:-rotate-12 transition-transform"})}),i.jsx(sp,{activeTrack:"live",setActiveTrack:()=>{},onOpenPaywall:t,forceEnglish:!0,onOpenExaminer:()=>{window.location.href="/ielts-speaking-mock-test"}}),i.jsxs("main",{className:"flex-1 max-w-5xl mx-auto w-full px-4 sm:px-6 py-6 sm:py-10 space-y-12 sm:space-y-16",children:[i.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500 font-mono",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Learn Spanish"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-medium",children:"How to Order Food in Spanish"})]}),i.jsxs("header",{className:"space-y-4",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold tracking-wide",children:[i.jsx(ave,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"NATIVE RESTAURANT CONVERSATION & SHADOWING"})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold tracking-tight leading-[1.15] text-slate-900 dark:text-white",children:"How to Order Food in Spanish"}
4821),i.jsx("p",{className:"text-base sm:text-lg text-slate-600 dark:text-slate-300 max-w-3xl leading-relaxed",children:"Planning a trip to Madrid, Mexico City, or a local tapas bistro? Don’t point at the menu in awkward silence. Master polite ordering verbs, hear native pronunciation, shadow the audio on your mic, and get instant AI feedback to order food like a true local right now."})]}),i.jsx("section",{id:"food-quick-answer-box",className:"ai-speakable-food-answer relative overflow-hidden rounded-2xl p-6 sm:p-7 border-2 border-emerald-500/40 dark:border-emerald-500/50 bg-gradient-to-r from-emerald-50/90 via-teal-50/60 to-white dark:from-emerald-950/40 dark:via-slate-900 dark:to-slate-900 shadow-lg transition-all",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold font-mono tracking-wider uppercase bg-emerald-600 text-white",children:"Direct Answer"}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:"Google AI Overview & Featured Snippet"})]}),i.jsxs("p",{className:"text-xl sm:text-2xl font-extrabold text-slate-900 dark:text-emerald-100 tracking-tight leading-snug",children:["The most common way to order food politely in Spanish is"," ",i.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400 underline decoration-emerald-400/40 decoration-2 underline-offset-4",children:"Quisiera…"})," ",i.jsx("span",{className:"text-slate-500 dark:text-slate-400 text-lg sm:text-xl font-mono font-normal",children:"(kee-SYEH-rah)"}),", meaning “I would like…”."]}),i.jsxs("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400",children:["Universal, respectful, and safe in every eatery from Madrid tapas bars to Mexican fondas. To ask for the bill, say ",i.jsx("strong",{children:"La cuenta, por favor"})," (The check, please)."]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3 shrink-0",children:[i.jsxs("button",{onClick:()=>re("Quisiera una paella, por favor","food-hero-answer"),className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-semibold text-sm shadow-md active:scale-95 transition-all shrink-0 cursor-pointer","aria-label":"Listen to Quisiera pronunciation",children:[i.jsx(on,{className:"w-5 h-5 text-emerald-400"}),i.jsx("span",{children:y==="food-hero-answer"?"Playing...":"Hear Audio"})]}),i.jsxs("a",{href:"/?station=es-rne&autoplay=true",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-700 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/30 active:scale-95 transition-all shrink-0 cursor-pointer group",title:"Tune to Spanish Live Radio with auto-play and shadow authentic conversational speed",children:[i.jsxs("span",{className:"relative flex h-2 w-2",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-white"})]}),i.jsx(cn,{className:"w-4 h-4 text-white group-hover:rotate-12 transition-transform"}),i.jsx("span",{children:"Tune to Live Spanish Radio (Auto-play)"}),i.jsx(qr,{className:"w-4 h-4 opacity-80 group-hover:translate-x-1 transition-transform"})]})]})]})}),i.jsxs("section",{className:"space-y-5",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white flex items-center gap-2",children:i.jsx("span",{children:"Quick Ordering Table (Essential Spanish Phrases)"})}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"From greeting the host to asking for recommendations, allergies, and the final check."})]}),i.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 text-xs",children:[{id:"all",label:"All Phrases"},{id:"polite",label:"Polite Verbs"},{id:"direct",label:"Casual / Fast"},{id:"server",label:"Addressing Server"},{id:"billing",label:"Bill & Takeout"},{id:"dietary",label:"Allergies & Custom"},{id:"table",label:"Table & Seating"}].map(W=>i.jsx("button",{onClick:()=>l(W.id),className:`px-3 py-1.5 rounded-lg font-medium whitespace-nowrap transition-colors cursor-pointer ${o===W.id?"bg-slate-900 dark:bg-white text-white dark:text-slate-950 font-bold":"bg-slate-100 dar
4821k:bg-slate-800/80 text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:W.label},W.id))})]}),i.jsx("div",{className:"overflow-x-auto rounded-2xl border border-slate-200 dark:border-slate-800 shadow-sm bg-white dark:bg-slate-900",children:i.jsxs("table",{className:"w-full text-left text-sm",children:[i.jsx("thead",{className:"bg-slate-100 dark:bg-slate-800/70 text-slate-600 dark:text-slate-300 font-mono text-xs uppercase tracking-wider",children:i.jsxs("tr",{children:[i.jsx("th",{className:"py-3.5 px-4",children:"Spanish"}),i.jsx("th",{className:"py-3.5 px-4",children:"English"}),i.jsx("th",{className:"py-3.5 px-4",children:"Pronunciation"}),i.jsx("th",{className:"py-3.5 px-4",children:"When to Use"}),i.jsx("th",{className:"py-3.5 px-4 text-center",children:"Audio"})]})}),i.jsx("tbody",{className:"divide-y divide-slate-100 dark:divide-slate-800 font-sans",children:se.map(W=>{const K=c.id===W.id;return i.jsxs("tr",{onClick:()=>d(W),className:`hover:bg-emerald-50/50 dark:hover:bg-slate-800/40 transition-colors cursor-pointer ${K?"bg-emerald-500/10 dark:bg-emerald-500/15":""}`,children:[i.jsx("td",{className:"py-3 px-4 font-bold text-slate-900 dark:text-white",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{children:W.spanish}),i.jsx("span",{className:`text-[10px] font-mono px-2 py-0.5 rounded-full font-semibold ${W.politenessRank==="Most Polite"?"bg-emerald-100 dark:bg-emerald-900/50 text-emerald-700 dark:text-emerald-300":W.politenessRank==="Polite"?"bg-teal-100 dark:bg-teal-900/50 text-teal-700 dark:text-teal-300":W.politenessRank==="Direct / Casual"?"bg-amber-100 dark:bg-amber-900/50 text-amber-700 dark:text-amber-300":"bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400"}`,children:W.politenessRank})]})}),i.jsx("td",{className:"py-3 px-4 text-slate-600 dark:text-slate-300",children:W.english}),i.jsx("td",{className:"py-3 px-4 font-mono text-xs text-amber-600 dark:text-amber-400",children:W.pronunciation}),i.jsx("td",{className:"py-3 px-4 text-xs text-slate-500 dark:text-slate-400",children:W.whenToUse}),i.jsx("td",{className:"py-3 px-4 text-center",children:i.jsx("button",{onClick:J=>{J.stopPropagation(),re(W.spanish,`table-${W.id}`)},className:"p-2 rounded-lg bg-slate-100 hover:bg-emerald-500 hover:text-white dark:bg-slate-800 dark:hover:bg-emerald-500 text-slate-600 dark:text-slate-300 transition-colors cursor-pointer","aria-label":`Listen to ${W.spanish}`,children:i.jsx(on,{className:"w-4 h-4"})})})]},W.id)})})]})})]}),i.jsxs("section",{id:"interactive-practice-studio",className:"relative overflow-hidden rounded-3xl p-6 sm:p-8 border-2 border-emerald-500/50 bg-gradient-to-b from-white via-slate-50 to-white dark:from-slate-900 dark:via-slate-900 dark:to-slate-950 shadow-xl space-y-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4 border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-0.5 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Interactive Shadowing Studio"})]}),i.jsx("h2",{className:"text-xl sm:text-2xl font-black text-slate-900 dark:text-white",children:"Live Pronunciation & Shadowing Practice"})]}),i.jsxs("div",{className:"flex items-center gap-2 text-xs font-mono",children:[i.jsx("span",{className:"text-slate-400",children:"Accent:"}),i.jsx("button",{onClick:()=>m("LATAM"),className:`px-3 py-1.5 rounded-lg font-bold transition-all cursor-pointer ${h==="LATAM"?"bg-emerald-600 text-white shadow-sm":"bg-slate-100 dark:bg-slate-800 text-slate-500 hover:text-slate-900 dark:hover:text-white"}`,children:"Latin America (General)"}),i.jsx("button",{onClick:()=>m("ES"),className:`px-3 py-1.5 rounded-lg font-bold transition-all cursor-pointer ${h==="ES"?"bg-emerald-600 text-white shadow-sm":"bg-slate-100 dark:bg-slate-800 text-slate-500 hover:text-slate-900 dark:hover:text-white"}`,children:"Spain (Castilian)"})]})]}),i.jsxs("div",{className:"p-4 rounded-xl bg-amber-500/10 border border-amber-500/20 text-xs sm:text-sm text-amber-900 dark:text-amber-200 flex items-start gap-3",children:[i.jsx(Qa,{className:"w-4 h-4 text-amber-600 dar
4821k:text-amber-400 shrink-0 mt-0.5"}),i.jsxs("p",{className:"leading-relaxed",children:[i.jsx("strong",{children:"Listen closely, then shadow out loud:"})," ","Stress falls firmly on the second syllable of “Quisiera” (",i.jsx("strong",{children:"-sie-"}),", kee-SYEH-rah). Most English speakers mistakenly say “quiche-ara”. Tap record now and let our AI evaluate your restaurant ordering speech!"]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-12 gap-6 items-center",children:[i.jsxs("div",{className:"md:col-span-7 space-y-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs font-mono font-bold px-2 py-0.5 rounded bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-400 uppercase",children:"Target Phrase"}),i.jsx("span",{className:"text-xs text-emerald-600 dark:text-emerald-400 font-mono",children:c.targetFocus})]}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-3xl sm:text-4xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:c.spanish}),i.jsx("p",{className:"text-lg text-emerald-600 dark:text-emerald-400 font-mono font-bold mt-1",children:c.pronunciation}),i.jsxs("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:["“",c.english,"” · ",c.literal]})]}),i.jsxs("div",{className:"p-3.5 rounded-xl bg-slate-100 dark:bg-slate-800/60 text-xs text-slate-700 dark:text-slate-300 space-y-1",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-white",children:"Pronunciation Key:"}),i.jsx("p",{children:c.pronunciationTip})]}),i.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[i.jsxs("button",{onClick:()=>re(c.spanish,`studio-${c.id}`),className:"inline-flex items-center gap-2 px-5 py-2.5 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-bold text-xs shadow-md transition-all active:scale-95 cursor-pointer",children:[i.jsx(on,{className:"w-4 h-4 text-emerald-400"}),i.jsx("span",{children:y===`studio-${c.id}`?"Speaking...":"▶ Hear Native Audio"})]}),i.jsxs("div",{className:"flex items-center gap-1 text-xs text-slate-400 font-mono",children:[i.jsx("span",{children:"Speed:"}),[.8,.9,1].map(W=>i.jsxs("button",{onClick:()=>x(W),className:`px-2 py-0.5 rounded text-[11px] cursor-pointer ${p===W?"bg-slate-200 dark:bg-slate-700 font-bold text-slate-900 dark:text-white":"hover:text-slate-600 dark:hover:text-slate-200"}`,children:[W,"x"]},W))]})]})]}),i.jsxs("div",{className:"md:col-span-5 p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-white/70 dark:bg-slate-900/70 backdrop-blur-sm space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("span",{className:"text-xs font-mono font-bold uppercase tracking-wider text-slate-500",children:"AI Speech Diagnostics"}),B&&i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-rose-500 font-mono font-bold animate-pulse",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-rose-500"}),"Recording (",k,"s)..."]})]}),i.jsx("div",{children:B?i.jsxs("button",{onClick:Y,className:"w-full py-4 rounded-xl bg-rose-600 hover:bg-rose-500 text-white font-extrabold text-sm shadow-lg shadow-rose-600/30 active:scale-98 transition-all flex items-center justify-center gap-3 cursor-pointer animate-pulse",children:[i.jsx(Cy,{className:"w-5 h-5"}),i.jsx("span",{children:"Stop Recording & View Score"})]}):i.jsxs("button",{onClick:H,className:"w-full py-4 rounded-xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-700 hover:from-emerald-500 hover:to-teal-500 text-white font-extrabold text-sm shadow-lg shadow-emerald-600/30 active:scale-98 transition-all flex items-center justify-center gap-3 cursor-pointer group",children:[i.jsx(Nn,{className:"w-5 h-5 text-emerald-200 group-hover:scale-110 transition-transform"}),i.jsx("span",{children:"Click to Shadow & Score"})]})}),R&&i.jsxs("div",{className:"space-y-3 p-4 rounded-xl bg-rose-500/10 border border-rose-500/20 text-xs",children:[i.jsxs("div",{className:"flex items-start gap-2 text-rose-600 dar
4821k:text-rose-400",children:[i.jsx(Qa,{className:"w-4 h-4 shrink-0 mt-0.5"}),i.jsxs("div",{className:"space-y-1",children:[i.jsx("p",{className:"font-bold",children:R}),i.jsx("p",{className:"text-slate-600 dark:text-slate-300",children:"Your browser requires microphone permission to score your Spanish pronunciation. Follow these quick steps to grant access:"})]})]}),i.jsxs("div",{className:"p-3 rounded-lg bg-white/80 dark:bg-slate-900/80 border border-rose-200 dark:border-rose-900/50 space-y-2 text-[11px] text-slate-700 dark:text-slate-200 font-sans",children:[i.jsxs("div",{className:"font-bold flex items-center gap-1.5 text-slate-900 dark:text-white",children:[i.jsx(rl,{className:"w-3.5 h-3.5 text-amber-500"}),i.jsx("span",{children:"How to enable your microphone:"})]}),i.jsxs("ol",{className:"list-decimal list-inside space-y-1 pl-1 text-slate-600 dark:text-slate-300",children:[i.jsx("li",{children:"Click the lock 🔒 or settings icon on the left of your browser address bar"}),i.jsx("li",{children:'Find "Microphone" in the permissions list and set it to "Allow"'}),i.jsx("li",{children:"Click the button below to re-request permission or refresh the page"})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center justify-between text-[11px]",children:[i.jsx("span",{className:"font-semibold text-slate-600 dark:text-slate-400",children:"Browser-specific help:"}),i.jsx("div",{className:"flex gap-1",children:["chrome","safari","edge"].map(W=>i.jsx("button",{onClick:()=>{U(W),O(!0)},className:`px-2 py-0.5 rounded capitalize font-mono text-[10px] cursor-pointer ${M===W&&j?"bg-slate-900 dark:bg-white text-white dark:text-slate-950 font-bold":"bg-slate-200 dark:bg-slate-800 text-slate-600 dark:text-slate-300"}`,children:W},W))})]}),j&&i.jsxs("div",{className:"p-2.5 rounded bg-slate-100 dark:bg-slate-800 text-[11px] text-slate-600 dark:text-slate-300 space-y-1",children:[M==="chrome"&&i.jsxs("p",{children:[i.jsx("strong",{children:"Chrome:"})," Click 🔒 left of the URL → Site settings → set Microphone to “Allow”."]}),M==="safari"&&i.jsxs("p",{children:[i.jsx("strong",{children:"Safari (Mac/iOS):"})," Safari Menu → Settings → Websites → Microphone → set to “Allow”; On iOS go to Settings → Safari → Microphone → Allow."]}),M==="edge"&&i.jsxs("p",{children:[i.jsx("strong",{children:"Edge:"})," Click 🔒 on address bar → Site permissions → set Microphone to “Allow”."]})]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center gap-2 pt-1",children:[i.jsxs("button",{onClick:H,className:"w-full sm:w-auto flex-1 inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs shadow-sm cursor-pointer transition-all active:scale-95",children:[i.jsx(qa,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Authorize Mic & Retry"})]}),i.jsx("button",{onClick:de,className:"w-full sm:w-auto inline-flex items-center justify-center gap-1.5 px-3 py-2 rounded-lg bg-slate-200 hover:bg-slate-300 dark:bg-slate-800 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200 font-medium text-xs cursor-pointer transition-all",title:"Experience the AI pronunciation diagnostics report without a microphone",children:i.jsx("span",{children:"No Mic? Try AI Simulated Demo"})})]})]}),N&&i.jsxs("div",{className:"py-6 text-center space-y-2",children:[i.jsx("div",{className:"w-8 h-8 mx-auto border-3 border-emerald-500 border-t-transparent rounded-full animate-spin"}),i.jsx("p",{className:"text-xs text-slate-500 font-mono",children:"Analyzing acoustic cadence & phonemes..."})]}),ee&&!N&&i.jsxs("div",{className:"p-4 rounded-xl bg-emerald-500/10 border border-emerald-500/30 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-[11px] font-mono text-slate-400 block uppercase",children:"Overall Score"}),i.jsxs("div",{className:"text-3xl font-black text-emerald-600 dark:text-emerald-400",children:[ee.score,i.jsx("span",{className:"text-sm font-normal text-slate-400",children:"/100"})]})]}),i.jsx("span",{className:"px-2.5 py-1 rounded-full text-xs font-mono font-bold bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 uppercase",children:ee.level})]}),i.jsxs("div",{className:"grid grid-cols-3 gap-2 pt-1 border-t border-emerald-500/20 text-center text-xs",children:[i.jsxs("div",{className:"p-1.5 rounded bg-white/50 dark:bg-slate-900/50",children:[i.jsx("span",{className:"text-[10px] text-slate-400 block",children:"Vowels"}),i.jsxs("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:[ee.vowelScore,"%"]})]}),i.jsxs("div",{className:"p-1.5 rounded bg-white/50 dark:bg-slate-900/50",children:[i.jsx("span",{className:"text-[10px] text-slate-400 block",children:"Consonants"}),i.jsxs("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:[ee.consonantScore,"%"]})]}),i.jsxs("div",{className:"p-1.5 rounded bg-white/50 dark:bg-slate-900/50",children:[i.jsx("span",{className:"text-[10px] text-slate-400 block",children:"Rhythm"}),i.jsxs("strong",{className:"text-emerald-600 dark:text-emerald-400 font-mono",children:[ee.rhythmScore,"%"]})]})]}),i.jsx("p",{className:"text-xs text-slate-700 dark:text-slate-300 leading-relaxed",children:ee.feedbackEn})]})]})]})]}),i.jsxs("section",{className:"space-y-8",children:[i.jsxs("div",{className:"border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider up
4821percase",children:"Deep-Dive Analysis"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight mt-1",children:"In-Depth Phrase Breakdown: Nuance, Pronunciation & Real-Life Usage"}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Every phrase analyzed with literal translation, phonetic breakdown, realistic dialog, and local cultural etiquette."})]}),i.jsx("div",{className:"space-y-6",children:i_.map((W,K)=>i.jsxs("article",{id:`phrase-${W.id}`,className:`p-6 sm:p-7 rounded-2xl border transition-all ${n?"bg-slate-900/50 border-slate-800":"bg-white border-slate-200/90 shadow-sm"}`,children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-slate-100 dark:border-slate-800/80 pb-3 mb-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("span",{className:"w-7 h-7 rounded-full bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 font-mono text-xs font-bold flex items-center justify-center",children:K+1}),i.jsx("h3",{className:"text-xl sm:text-2xl font-bold text-slate-900 dark:text-white",children:W.spanish}),i.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["(",W.pronunciation,")"]})]}),i.jsxs("button",{onClick:()=>re(W.spanish,`detail-${W.id}`),className:"self-start sm:self-auto inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-emerald-500/10 hover:bg-emerald-500 hover:text-white text-emerald-600 dark:text-emerald-400 text-xs font-bold transition-colors cursor-pointer",children:[i.jsx(on,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:y===`detail-${W.id}`?"Playing...":"Hear Audio"})]})]}),i.jsxs("div",{className:"space-y-3.5 text-xs sm:text-sm",children:[i.jsxs("div",{className:"grid sm:grid-cols-12 gap-2 text-slate-600 dark:text-slate-300",children:[i.jsx("span",{className:"sm:col-span-3 font-mono font-semibold text-slate-400 dark:text-slate-500 uppercase text-[11px]",children:"Literal Meaning:"}),i.jsxs("span",{className:"sm:col-span-9 font-medium text-slate-800 dark:text-slate-200",children:["“",W.literal,"” (English: ",W.english,")"]})]}),i.jsxs("div",{className:"grid sm:grid-cols-12 gap-2 text-slate-600 dark:text-slate-300",children:[i.jsx("span",{className:"sm:col-span-3 font-mono font-semibold text-amber-600 dark:text-amber-400 uppercase text-[11px]",children:"Pronunciation Tip:"}),i.jsx("span",{className:"sm:col-span-9 leading-relaxed",children:W.pronunciationTip})]}),i.jsxs("div",{className:"grid sm:grid-cols-12 gap-2 text-slate-600 dark:text-slate-300",children:[i.jsx("span",{className:"sm:col-span-3 font-mono font-semibold text-slate-400 dark:text-slate-500 uppercase text-[11px]",children:"Real Example:"}),i.jsxs("div",{className:"sm:col-span-9 p-3 rounded-xl bg-slate-50 dark:bg-slate-950/60 border border-slate-100 dark:border-slate-800/80 space-y-1",children:[i.jsx("p",{className:"font-semibold text-slate-900 dark:text-white",children:W.exampleSpanish}),i.jsx("p",{className:"text-slate-500 dark:text-slate-400 text-xs italic",children:W.exampleEnglish})]})]}),i.jsxs("div",{className:"grid sm:grid-cols-12 gap-2 text-slate-600 dark:text-slate-300",children:[i.jsx("span",{className:"sm:col-span-3 font-mono font-semibold text-slate-400 dark:text-slate-500 uppercase text-[11px]",children:"When to Use:"}),i.jsxs("span",{className:"sm:col-span-9 leading-relaxed",children:[W.whenToUse," ",W.detailedContext]})]}),i.jsxs("div",{className:"grid sm:grid-cols-12 gap-2 text-slate-600 dark:text-slate-300",children:[i.jsx("span",{className:"sm:col-span-3 font-mono font-semibold text-emerald-600 dark:text-emerald-400 uppercase text-[11px]",children:"Cultural Note:"}),i.jsx("span",{className:"sm:col-span-9 leading-relaxed text-slate-600 dark:text-slate-300",children:W.culturalNote})]})]})]},W.id))})]}),i.jsx("section",{id:"politeness-and-regional",className:`p-7 sm:p-9 rounded-3xl border ${n?"bg-slate-900/60 border-slate-800":"bg-white border-slate-200/90 shadow-sm"}`,children:i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-mono font-bold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:"Politeness & Geography"}),i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Politeness Hierarchy & Regional Differences (Sp
4821ain vs Latin America)"}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:"How to navigate restaurant tone so you never sound rude, demanding, or overly stiff."})]}),i.jsxs("div",{className:"p-5 rounded-2xl bg-gradient-to-r from-emerald-500/10 via-teal-500/5 to-transparent border border-emerald-500/20 space-y-4",children:[i.jsxs("h3",{className:"text-lg font-bold text-slate-900 dark:text-white flex items-center gap-2",children:[i.jsx(yn,{className:"w-5 h-5 text-emerald-500"}),i.jsx("span",{children:"The Politeness Spectrum in Spanish Restaurants"})]}),i.jsxs("div",{className:"space-y-2 text-xs sm:text-sm",children:[i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-emerald-500/30 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400",children:"1. Quisiera…"}),i.jsx("span",{className:"text-slate-500 dark:text-slate-400 ml-2",children:"Universal & Most Courteous (Imperfect Subjunctive)"})]}),i.jsx("span",{className:"font-mono text-[11px] font-bold px-2 py-0.5 rounded bg-emerald-500/20 text-emerald-700 dark:text-emerald-300",children:"Highest Politeness"})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-teal-500/20 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("strong",{className:"text-teal-600 dark:text-teal-400",children:"2. Me gustaría…"}),i.jsx("span",{className:"text-slate-500 dark:text-slate-400 ml-2",children:"Polite & Formal (Conditional)"})]}),i.jsx("span",{className:"font-mono text-[11px] font-bold px-2 py-0.5 rounded bg-teal-500/20 text-teal-700 dark:text-teal-300",children:"Polite & Thoughtful"})]}),i.jsxs("div",{className:"p-3 rounded-xl bg-white dark:bg-slate-900 border border-amber-500/20 flex items-center justify-between",children:[i.jsxs("div",{children:[i.jsx("strong",{className:"text-amber-600 dark:text-amber-400",children:"3. Quiero…"}),i.jsx("span",{className:"text-slate-500 dark:text-slate-400 ml-2",children:"Direct & Casual (Best for fast food counters)"})]}),i.jsx("span",{className:"font-mono text-[11px] font-bold px-2 py-0.5 rounded bg-amber-500/20 text-amber-700 dark:text-amber-300",children:"Casual Only"})]})]})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6 pt-2",children:[i.jsxs("div",{className:"p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-950/60 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h4",{className:"font-bold text-slate-900 dark:text-white text-base",children:"🇪🇸 In Spain (Peninsular Spanish)"}),i.jsx("span",{className:"text-[11px] font-mono font-bold text-indigo-500",children:"Madrid / Barcelona"})]}),i.jsxs("ul",{className:"text-xs text-slate-600 dark:text-slate-300 space-y-2 leading-relaxed",children:[i.jsxs("li",{children:["• ",i.jsx("strong",{children:"¿Me pone…?"})," / ",i.jsx("strong",{children:"Ponme…"}),": Locals constantly use “poner” (literally: “put me”). e.g., ",i.jsx("em",{children:"“¿Me pones una caña y una de bravas?”"})," It sounds direct to foreigners, but is 100% warm and natural in Spain."]}),i.jsxs("li",{children:["• Calling the server: Say ",i.jsx("strong",{children:"¡Perdona!"}),", ",i.jsx("strong",{children:"¡Disculpa!"})," or wave courteously. Elders might say ",i.jsx("strong",{children:"¡Oiga!"})," (Listen), but ",i.jsx("strong",{children:"¡Perdona!"})," is friendlier."]}),i.jsxs("li",{children:["• Takeout phrase: ",i.jsx("strong",{children:"“Para llevar”"})," or drinks ",i.jsx("strong",{children:"“para tomar aquí”"}),"."]})]})]}),i.jsxs("div",{className:"p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-slate-50 dark:bg-slate-950/60 space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsx("h4",{className:"font-bold text-slate-900 dark:text-white text-base",children:"🌎 In Latin America (Mexico, Colombia, etc.)"}),i.jsx("span",{className:"text-[11px] font-mono font-bold text-emerald-500",children:"Mexico City / Bogotá"})]}
4821),i.jsxs("ul",{className:"text-xs text-slate-600 dark:text-slate-300 space-y-2 leading-relaxed",children:[i.jsxs("li",{children:["• ",i.jsx("strong",{children:"¿Me da…?"})," / ",i.jsx("strong",{children:"¿Me regala…?"}),": In Mexico, ",i.jsx("em",{children:"“¿Me da…?”"})," is standard. In Colombia, locals famously say ",i.jsx("em",{children:"“¿Me regala…?”"})," (literally “gift me”), which means to buy/order politely."]}),i.jsxs("li",{children:["• Calling the server: Say ",i.jsx("strong",{children:"¡Disculpe!"}),", ",i.jsx("strong",{children:"¡Joven!"})," (Mexico), or ",i.jsx("strong",{children:"¡Señor!"}),". Avoid “¡Oiga!” as it can sound impatient in Latin America."]}),i.jsxs("li",{children:["• Takeout phrase: ",i.jsx("strong",{children:"“Para llevar”"})," is universal across all Latin American countries."]})]})]})]})]})}),i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider uppercase",children:"Practical Toolbelt"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight mt-1",children:"High-Frequency Extras & Major Mistakes to Avoid"})]}),i.jsx("div",{className:"grid grid-cols-1 sm:grid-cols-2 md:grid-cols-4 gap-4",children:[{es:"Una mesa para dos, por favor",en:"A table for two, please",tip:"Door arrival greeting"},{es:"Soy alérgico/a a…",en:"I am allergic to…",tip:"Essential food safety"},{es:"Sin… / Con…",en:"Without… / With…",tip:"Custom toppings & ice"},{es:"Estoy listo/a para pedir",en:"I am ready to order",tip:"Menu decision signal"}].map((W,K)=>i.jsxs("div",{className:"p-4 rounded-xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 space-y-1.5 shadow-sm",children:[i.jsx("span",{className:"text-[10px] font-mono text-emerald-600 dark:text-emerald-400 uppercase font-bold",children:W.tip}),i.jsx("p",{className:"font-bold text-slate-900 dark:text-white text-sm",children:W.es}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:W.en})]},K))}),i.jsxs("div",{className:"p-6 rounded-2xl border-2 border-rose-500/30 bg-rose-500/5 dark:bg-rose-950/20 space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2 text-rose-600 dar
4821k:text-rose-400 font-bold text-sm",children:[i.jsx(Qa,{className:"w-4 h-4"}),i.jsx("span",{children:"Critical Common Mistake to Avoid"})]}),i.jsxs("p",{className:"text-sm text-slate-800 dark:text-slate-200 leading-relaxed",children:[i.jsx("strong",{children:"Don’t confuse “la cuenta” and “la propina”!"}),i.jsx("br",{}),"• ",i.jsx("strong",{children:"La cuenta"})," = the bill / check.",i.jsx("br",{}),"• ",i.jsx("strong",{children:"La propina"})," = the tip / gratuity.",i.jsx("br",{}),"Never ask for a glass of water using “la cuenta”. And if paying by card, simply ask: ",i.jsx("em",{children:"“¿Puedo pagar con tarjeta?”"})," (Can I pay with card?)."]})]})]}),i.jsxs("section",{id:"faq",className:"space-y-6",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsx("span",{className:"text-xs font-mono font-bold text-emerald-600 dark:text-emerald-400 tracking-wider uppercase",children:"Frequently Asked Questions"}),i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Restaurant Spanish FAQ (People Also Ask)"})]}),i.jsx("div",{className:"space-y-3",children:[{q:"What's the most polite way to order food in Spanish?",a:"The most universally polite and respected phrase is 'Quisiera…' (kee-SYEH-rah), followed by the dish and 'por favor'. It sounds gracious, well-mannered, and works seamlessly in both Spain and Latin America."},{q:"What's the difference between 'quisiera' and 'quiero'?",a:"'Quisiera' is the polite imperfect subjunctive ('I would like'), designed to soften dining requests. 'Quiero' is the direct indicative ('I want'), which can sound abrupt or demanding when speaking to a waiter."},{q:"How do you ask for the bill in Spanish?",a:"Say 'La cuenta, por favor' (lah KWEHN-tah, por fah-VOR), meaning 'The check, please'. You can also catch the server's eye and make a subtle signing gesture in the air."},{q:"How do you say 'to go' in Spanish?",a:"Say 'Para llevar' (PAH-rah yeh-VAHR). If you want to eat at the restaurant, say 'Para comer aquí' (or 'Para tomar aquí' in Spain)."},{q:"How do you ask 'what do you recommend'?",a:"Say '¿Qué me recomienda?' (keh meh reh-koh-MYEHN-dah) using the polite usted form. If addressing a young server in a trendy casual venue, you can use '¿Qué me recomiendas?'."}].map((W,K)=>i.jsxs("div",{className:"p-5 rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900/60 space-y-2",children:[i.jsx("h3",{className:"font-bold text-slate-900 dark:text-white text-base",children:W.q}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-300 leading-relaxed",children:W.a})]},K))})]}),i.jsx("section",{className:"space-y-8",children:i.jsxs("div",{className:`p-8 sm:p-10 rounded-3xl border shadow-xl text-center space-y-6 ${n?"bg-gradient-to-b from-slate-900 via-slate-900 to-slate-950 border-emerald-500/30":"bg-gradient-to-b from-white via-emerald-50/30 to-white border-emerald-500/20"}`,children:[i.jsxs("div",{className:"max-w-2xl mx-auto space-y-3",children:[i.jsx("span",{className:"px-3 py-1 rounded-full text-xs font-mono font-bold bg-emerald-500/10 text-emerald-600 dark:text-emerald-400",children:"Ready for Real Spanish Dining?"}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold text-slate-900 dark:text-white tracking-tight",children:"Knowing What to Order Isn’t Enough — Shadow Real Radio Dialogues & Score Your Speech"}),i.jsxs("p",{className:"text-sm sm:text-base text-slate-600 dark:text-slate-300 leading-relaxed",children:["Head to ",i.jsx("strong",{children:"learn-spanish"})," to shadow authentic dining dialogues on live Spanish radio, or visit ",i.jsx("strong",{children:"spanish-pronunciation"})," to let our AI evaluate your “quisiera” accentuation."]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-center justify-center gap-4 pt-2",children:[i.jsxs("a",{href:"/learn-spanish",className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-2xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/20 transition-all hover:-translate-y-0.5",children:[i.jsx(Er,{className:"w-4 h-4"}),i.jsx("span",{children:"practice Spanish conversations"})]}),i.jsxs("a",{href:"/spanish-pronunciation",className:"w-full sm:w-auto inline-flex items-center justify-center gap-2 px-6 py-3.5 rounded-2xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-bold text-sm shadow-md transition-all hover:-translate-y-0.5",children:[i.jsx(yn,{className:"w-4 h-4"}),i.jsx("span",{children:"get your pronunciation scored"})]})]}),i.jsxs("div",{className:"pt-6 border-t border-slate-200 dark:border-slate-800/80 max-w-2xl mx-auto",children:[i.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500 font-mono uppercase tracking-wider mb-3",children:"Related Essential Spanish Guides:"}),i.jsxs("div",{className:"flex flex-wrap items-center justify-center gap-3 text-xs",children:[i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"px-3 py-1.5 rounded-lg bg-slate-100 dar
4821k:bg-slate-800/80 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"nice to meet you in Spanish →"}),i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"px-3 py-1.5 rounded-lg bg-slate-100 dark:bg-slate-800/80 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"how to introduce yourself in Spanish →"}),i.jsx("a",{href:"/spanish-conversation-starters",className:"px-3 py-1.5 rounded-lg bg-slate-100 dark:bg-slate-800/80 text-slate-700 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Spanish conversation starters →"})]})]})]})})]}),i.jsx("footer",{className:"mt-16 border-t border-slate-200 dark:border-slate-800/80 py-8 text-center text-xs text-slate-400 dark:text-slate-500",children:i.jsxs("div",{className:"max-w-5xl mx-auto px-4 flex flex-col sm:flex-row items-center justify-between gap-4",children:[i.jsxs("p",{children:["© ",new Date().getFullYear()," RadioShadow AI. All rights reserved."]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("a",{href:"/",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Home"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Learn Spanish"}),i.jsx("a",{href:"/spanish-pronunciation",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Spanish Pronunciation"}),i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Nice to Meet You in Spanish"}),i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Introduce Yourself"}),i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 font-medium",children:"How to Order Food in Spanish"}),i.jsx("a",{href:"/sitemap.xml",className:"hover:text-slate-700 dark:hover:text-slate-300",children:"Sitemap"})]})]})})]})}const bb=[{id:"me-llamo",spanish:"Me llamo…",english:"My name is…",pronunciation:"meh YAH-moh",literal:"I call myself (llamarse 1st person)",category:"name",formality:"Universal",whenToUse:"The single most universal, natural, and widely used way to state your name in any Spanish-speaking setting.",pronunciationTip:"The double 'll' makes a 'y' sound [j] like in 'yarn' or 'yes'. Never pronounce it as an English 'l'. Stress falls on 'YAH': [meh YAH-moh].",exampleSpanish:"— ¡Hola! Me llamo Ana, un placer conocerte.",exampleEnglish:"— Hello! My name is Ana, pleasure to meet you.",detailedContext:"Uses the reflexive verb 'llamarse'. It flows smoothly and avoids the stiff textbook stiffness of 'mi nombre es'. Native speakers of all ages prefer this in 90% of casual and semi-formal interactions.",culturalNote:"Universal across Spain and Latin America. In Argentina and Uruguay, the 'll' has a soft 'sh' [ʃ] or 'zh' [ʒ] sound: [meh SHAH-moh].",targetFocus:"Double 'll' pronounced as /y/ [meh YAH-moh]"},{id:"soy",spanish:"Soy…",english:"I am…",pronunciation:"soy",literal:"I am (ser 1st person)",category:"name",formality:"Universal",whenToUse:"Ultra-versatile; works for names (Soy Carlos), professions (Soy arquitecto), nationalities (Soy español), and identities.",pronunciationTip:"Single crisp syllable: [soy]. Don't drag out the diphthong or add an extra syllable.",exampleSpanish:"— Mucho gusto, soy Carlos. Soy ingeniero de software.",exampleEnglish:"— Nice to meet you, I'm Carlos. I am a software engineer.",detailedContext:"Derived from 'ser' (essential identity). While 'me llamo' strictly introduces names, 'soy' is broader. Note: never use an indefinite article before professions in Spanish (say 'Soy profesor', not 'Soy un profesor').",culturalNote:"Widely used when introducing yourself at parties, networking mixers, or picking up a coffee order.",targetFocus:"Crisp single-syllable diphthong [soy]"},{id:"mi-nombre-es",spanish:"Mi nombre es…",english:"My name is…",pronunciation:"mee NOHM-breh es",literal:"My name is (literal translation)",category:"name",formality:"Formal",whenToUse:"Formal presentations, legal paperwork, job interviews, customer service hotlines, or official embassy desks.",pronunciationTip:"Even rhythm: [mee NOHM-breh es]. Ensure the 'r' in 'nombre' is a quick tap [ɾ], not an English swallowed 'r'.",exampleSpanish:"— Buenos días, mi nombre es Elena Gómez y vengo a la entrevista de las diez.",exampleEnglish:"— Good morning, my name is Elena Gómez and I am here for the ten o'clock interview.",detailedContext:"This is the direct word-for-word equivalent of English 'My name is'. Because it is more rigid and deliberate, reserve it for official or business introductions.",culturalNote:"If used in casual street greetings, it sounds slightly academic or stiff compared to 'Me llamo'.",targetFocus:"Soft tapped 'r' and clean Spanish vowels [mee NOHM-breh es]"},{id:"tengo-anos",spanish:"Tengo … años",english:"I'm … years old",pronunciation:"TEHN-goh … AH-nyos",literal:"I have … years (tener 1st person)",category:"age",formality:"Universal",whenToUse:"Sharing your age when introducing yourself in school, language exchanges, dating, or socializing.",pronunciationTip:"Crisp 'ñ' [ɲ] in 'años'—it makes a 'ny' sound like the 'ni' in 'onion'. Never pronounce it as plain 'n' ('anos' has an embarrassing vulgar meaning!).",exampleSpanish:"— Tengo 26 años y acabo de mudarme a Madrid.",exampleEnglish:"— I am 26 years old and I just moved to Madrid.",detailedContext:"Spanish uses 'tener' (to have) for age, not 'ser' (to be). Saying 'Soy 26 años' is a classic English-speaker error. Always say 'Tengo [number] años'.",culturalNote:"Remember the tilde on the letter ñ: 'año' means year.",targetFocus:"Palatal nasal [ɲ] in 'años' and verb 'tener' [TEHN-goh]"},{id:"soy-de",spanish:"Soy de…",english:"I'm from…",pronunciation:"soy deh",literal:"I am from (origin)",category:"origin",formality:"Universal",whenToUse:"Stating your hometown, city, region, or country of origin.",pronunciationTip:"Smooth connection between 'soy' and 'de': [soy deh]. The 'e' in 'de' is a pure short Spanish /e/, like 'bed'.",exampleSpanish:"— Soy de California, pero ahora vivo en Valencia.",exampleEnglish:"— I am from California, but now I live in Valencia.",detailedContext:"Essential conversation starter. Pair it with your home country or city: 'Soy de México', 'Soy de Tokio', 'Soy de Nueva York'.",culturalNote:"Inquiries about origins almost always follow introductions: '¿De dónde eres?' (Where are you from?).",targetFocus:"Pure Spanish /e/ vowel without diphthong gliding [soy deh]"},{id:"vivo-en",spanish:"Vivo en…",english:"I live in…",pronunciation:"VEE-voh ehn",literal:"I live in (vivir 1st person)",category:"residence",formality:"Universal",whenToUse:"Explaining your current city, neighborhood, or temporary residence.",pronunciationTip:"Spanish 'b' and 'v' represent the exact same sound—a soft voiced bilabial [b/β]. Pronounce 'vivo' with relaxed lips: [BEE-boh ehn].",exampleSpanish:"— Vivo en Barcelona desde hace dos años con mi pareja.",exampleEnglish:"— I have been living in Barcelona for two years with my partner.",detailedContext:"Uses 'vivir' in the present indicative. Great for bridging your birthplace ('Soy de...') with your current home ('pero vivo en...').",culturalNote:"Locals will frequently ask '¿Por qué zona vives?' (Which neighborhood do you live in?).",targetFocus:"Soft bilabial [b/β] sound for 'v' [BEE-boh ehn]"},{id:"trabajo-como",spanish:"Trabajo como…",english:"I work as…",pronunciation:"trah-BAH-hoh KOH-moh",literal:"I work as (trabajar 1st person)",category:"profession",formality:"Universal",whenToUse:"Describing your job, role, or professional title in social or business settings.",pronunciationTip:"The 'j' in 'trabajo' is a guttural raspy sound [x] from the back of the throat. Stress on '-BA-': [trah-BAH-hoh].",exampleSpanish:"— Trabajo como diseña
4821dor gráfico en una agencia de publicidad.",exampleEnglish:"— I work as a graphic designer at an advertising agency.",detailedContext:"You can either say 'Trabajo como [role]' (I work as...) or simply 'Soy [role]' (I am...). Both are completely natural.",culturalNote:"In informal chats, Spaniards and Latin Americans often ask: '¿A qué te dedicas?' (What do you do for a living?).",targetFocus:"Back-of-throat Spanish 'j' [x] in [trah-BAH-hoh]"},{id:"y-tu-usted",spanish:"¿Y tú? / ¿Y usted?",english:"And you?",pronunciation:"ee TOO / oos-TEHD",literal:"And you? (informal / formal)",category:"turn",formality:"Universal",whenToUse:"Passing the conversational baton back to the other person after sharing your details.",pronunciationTip:"Pure long 'u' [u] in 'tú'. For 'usted', stress the second syllable '-ted' with a very soft final 'd': [oos-TEHD].",exampleSpanish:"— Me llamo David y soy de Bogotá. ¿Y tú? ¿Cómo te llamas?",exampleEnglish:"— My name is David and I'm from Bogotá. And you? What's your name?",detailedContext:"Never end your introduction as a one-way monologue! Tacking on '¿Y tú?' (informal) or '¿Y usted?' (formal elder/boss) turns the interaction into an engaging two-way dialogue.",culturalNote:"In Spain and Argentina, 'tú' (or 'vos') is used with peers; use 'usted' for elders, police, or formal interviews.",targetFocus:"Polite rising inflection on [ee TOO] or [oos-TEHD]"}];function U6e({darkMode:n=!0,onToggleDarkMode:e,onOpenPaywall:t,onOpenAuthModal:r}){const{isZh:s}=Or(),{user:a,isPro:o}=Ji(),[l,c]=S.useState(bb[0]),[d,h]=S.useState("all"),[m,p]=S.useState(!1),[x,y]=S.useState(!1),[v,B]=S.useState(null),[E,N]=S.useState(null),[T,k]=S.useState(null),[P,R]=S.useState(0),[_,I]=S.useState(!1),D=S.useRef(null);S.useRef(null),S.useEffect(()=>{const G="How to Introduce Yourself in Spanish (10+ Phrases + Audio)",Z="Learn to introduce yourself in Spanish — me llamo, soy, tengo años + 8 more, with audio, pronunciation and shadowing practice.";document.title=G;let z=document.querySelector('meta[name="description"]');z||(z=document.createElement("meta"),z.setAttribute("name","description"),document.head.appendChild(z)),z.setAttribute("content",Z);let se=document.querySelector('meta[property="og:title"]');se||(se=document.createElement("meta"),se.setAttribute("property","og:title"),document.head.appendChild(se)),se.setAttribute("content",G);let re=document.querySelector('meta[property="og:description"]');re||(re=document.createElement("meta"),re.setAttribute("property","og:description"),document.head.appendChild(re)),re.setAttribute("content",Z);let H=document.querySelector('link[rel="canonical"]');H||(H=document.createElement("link"),H.setAttribute("rel","canonical"),document.head.appendChild(H)),H.setAttribute("href","https://radioshadow.space/how-to-introduce-yourself-in-spanish");const Y="schema-how-to-introduce-yourself-spanish";let de=document.getElementById(Y);de||(de=document.createElement("script"),de.id=Y,de.type="application/ld+json",document.head.appendChild(de));const W={"@context":"https://schema.org","@graph":[{"@type":"Article","@id":"https://radioshadow.space/how-to-introduce-yourself-in-spanish#article",headline:G,name:"How to Introduce Yourself in Spanish",description:Z,inLanguage:"en",url:"https://radioshadow.space/how-to-introduce-yourself-in-spanish",mainEntityOfPage:"https://radioshadow.space/how-to-introduce-yourself-in-spanish",datePublished:"2026-10-08T08:00:00+00:00",dateModified:"2026-10-08T08:00:00+00:00",author:{"@type":"Organization",name:"RadioShadow AI Language Lab",url:"https://radioshadow.space"},publisher:{"@type":"Organization",name:"RadioShadow AI",url:"https://radioshadow.space",logo:{"@type":"ImageObject",url:"https://radioshadow.space/radioshadow_app_logo.jpg"}},speakable:{"@type":"SpeakableSpecification",cssSelector:["#intro-quick-answer-box",".ai-speakable-intro-answer"]}},{"@type":"BreadcrumbList",itemListElement:[{"@type":"ListItem",position:1,name:"Home",item:"https://radioshadow.space/"},{"@type":"ListItem",position:2,name:"Learn Spanish",item:"https://radioshadow.space/learn-spanish"},{"@type":"ListItem",position:3,name:"How to Introduce Yourself in Spanish",item:"https://radioshadow.space/how-to-introduce-yourself-in-spanish"}]},{"@type":"FAQPage","@id":"https://radioshadow.space/how-to-introduce-yourself-in-spanish#faq",mainEntity:[{"@type":"Question",name:"How do you say 'my name is' in Spanish?",acceptedA
4821nswer:{"@type":"Answer",text:"The most common and natural way is 'Me llamo…' (meh YAH-moh), literally 'I call myself'. You can also say 'Soy…' (I am…) or formal 'Mi nombre es…'."}},{"@type":"Question",name:"What's the difference between 'me llamo' and 'soy'?",acceptedAnswer:{"@type":"Answer",text:"'Me llamo' is exclusively used for introducing your name ('Me llamo Ana'). 'Soy' is broader and can introduce your name, profession ('Soy médico'), or nationality ('Soy español')."}},{"@type":"Question",name:"How do you ask 'what's your name' formally?",acceptedAnswer:{"@type":"Answer",text:"Ask '¿Cómo se llama (usted)?' in formal situations. With peers and friends, ask informal '¿Cómo te llamas?'."}},{"@type":"Question",name:"How do you say 'I'm from…' in Spanish?",acceptedAnswer:{"@type":"Answer",text:"Say 'Soy de…' followed by your city or country, for example 'Soy de Madrid' or 'Soy de Nueva York'."}},{"@type":"Question",name:"How do you say your age in Spanish?",acceptedAnswer:{"@type":"Answer",text:"Say 'Tengo [number] años' using the verb 'tener' (to have). Never say 'Soy X años', which is an ungrammatical literal translation of English."}}]}]};return de.textContent=JSON.stringify(W,null,2),()=>{const K=document.getElementById(Y);K&&K.remove()}},[]);const j=(G,Z)=>{if(!(typeof window>"u"))if(window.speechSynthesis){window.speechSynthesis.cancel();const z=new SpeechSynthesisUtterance(G);z.rate=.92,z.pitch=1;const se=window.speechSynthesis.getVoices(),re=se.find(H=>H.lang.startsWith("es")&&(H.name.includes("Natural")||H.name.includes("Google")||H.name.includes("Castilian")||H.name.includes("Monica")||H.name.includes("Jorge")))||se.find(H=>H.lang.startsWith("es"));re?z.voice=re:z.lang="es-ES",k(Z),z.onend=()=>k(null),z.onerror=()=>k(null),window.speechSynthesis.speak(z)}else k(Z),setTimeout(()=>k(null),1200)},O=()=>{N(null),B(null);const G=window.SpeechRecognition||window.webkitSpeechRecognition;if(!G){ee();return}try{const Z=new G;Z.lang="es-ES",Z.continuous=!1,Z.interimResults=!1,Z.maxAlternatives=1,Z.onstart=()=>{p(!0)},Z.onresult=z=>{const se=z.results[0][0].transcript;U(se,l.spanish)},Z.onerror=z=>{console.warn("Speech Recognition Error:",z.error),p(!1),z.error==="not-allowed"||z.error==="service-not-allowed"?(N("Microphone access blocked. Please enable microphone permissions in your browser bar, or run our simulated acoustic check."),I(!0)):ee()},Z.onend=()=>{p(!1)},D.current=Z,Z.start()}catch(Z){console.warn("Speech recognition init exception:",Z),ee()}},M=()=>{if(D.current)try{D.current.stop()}catch{}p(!1)},U=(G,Z)=>{y(!0),setTimeout(()=>{const z=G.toLowerCase().replace(/[.,/#!$%^&*;:{}=\-_`~()¿?¡!]/g,"").trim(),se=Z.toLowerCase().replace(/[.,/#!$%^&*;:{}=\-_`~()¿?¡!…]/g,"").trim();let re=88,H=90,Y=86,de=89;z.includes(se)||se.includes(z)?(re=96,H=98,Y=94,de=97):z.length>2&&(re=85,H=88,Y=83,de=84);let W="fluent";re>=93?W="native":re>=82?W="fluent":re>=70?W="approaching":W="retry";let K="";W==="native"?K="Splendid Spanish articulation! Pure vowels, crisp 'll' pronunciation, and confident conversational melody.":W==="fluent"?K="Very natural and clear! Pay close attention to pure Spanish vowels and avoiding English diphthongs.":K="Good attempt! Listen to the native audio once more and tap into the rhythm before shadowing.",B({score:re,feedbackEn:K,level:W,vowelScore:H,consonantScore:Y,rhythmScore:de,detectedText:G||Z}),y(!1)},700)},ee=()=>{y(!0),N(null),I(!1);const G=l.spanish;setTimeout(()=>{let Z=95,z=97,se=93,re=96,H="native",Y=`Simulated Evaluation (${G}): Authentic /y/ palatal sound on 'll', firm rhythm on Spanish vowels, and polished intro cadence!`;B({score:Z,feedbackEn:Y,level:H,vowelScore:z,consonantScore:se,rhythmScore:re,detectedText:G}),y(!1)},600)},ie=d==="all"?bb:bb.filter(G=>G.category===d);return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors duration-300 relative ${n?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[e&&i.jsx("button",{id:"theme-toggle-floating-btn",onClick:e,className:"fixed bottom-24 left-4 md:left-6 z-40 p-2.5 rounded-xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-md hover:bg-white dark:hover:bg-slate-800 border border-slate-200/60 dark:border-slate-800/60 text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 transition-all shadow-md active:scale-95 cursor-pointer select-none flex items-center justify-center group",title:n?"Switch to Light Mode":"Switch to Dark Mode","aria-label":"Toggle theme",children:n?i.jsx(qc,{className:"w-4 h-4 text-amber-500 group-hover:rotate-45 transition-transform"}):i.jsx(ko,{className:"w-4 h-4 text-indigo-500 dark:text-indigo-400 group-hover:-rotate-12 transition-transform"})}),i.jsx(sp,{activeTrack:"live",setActiveTrack:()=>{},onOpenPaywall:t,forceEnglish:!0,onOpenExaminer:()=>{window.location.href="/ielts-speaking-mock-test"}}),i.jsxs("main",{className:"flex-1 max-w-5xl mx-auto w-full px-4 sm:px-6 py-6 sm:py-10 space-y-12 sm:space-y-16",children:[i.jsxs("nav",{"aria-label":"Breadcrumb",className:"flex items-center gap-2 text-xs text-slate-400 dark:text-slate-500 font-mono",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Home"}),i.jsx("span",{children:"/"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors",children:"Learn Spanish"}),i.jsx("span",{children:"/"}),i.jsx("span",{className:"text-slate-700 dark:text-slate-300 font-medium",children:"How to Introduce Yourself in Spanish"})]}),i.jsxs("header",{className:"space-y-4",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/10 border border-emerald-500/30 text-emerald-600 dark:text-emerald-400 text-xs font-mono font-bold tracking-wide",children:[i.jsx(vh,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:"NATIVE SPANISH INTRODUCTIONS & SHADOWING"})]}),i.jsx("h1",{className:"text-3xl sm:text-4xl lg:text-5xl font-extrabold tracking-tight leading-[1.15] text-slate-900 dark:text-white",children:"How to Introduce Yourself in Spanish"}
4821),i.jsx("p",{className:"text-base sm:text-lg text-slate-600 dark:text-slate-300 max-w-3xl leading-relaxed",children:"Meeting native speakers in Madrid, Bogotá, or Mexico City? Master natural self-introductions in minutes. Learn how to say your name, age, hometown, and profession with native audio, interactive mic shadowing, and instant acoustic feedback so you introduce yourself with true confidence."})]}),i.jsx("section",{id:"intro-quick-answer-box",className:"ai-speakable-intro-answer relative overflow-hidden rounded-2xl p-6 sm:p-7 border-2 border-emerald-500/40 dark:border-emerald-500/50 bg-gradient-to-r from-emerald-50/90 via-teal-50/60 to-white dark:from-emerald-950/40 dark:via-slate-900 dark:to-slate-900 shadow-lg transition-all",children:i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{className:"space-y-2",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"px-2 py-0.5 rounded text-[11px] font-bold font-mono tracking-wider uppercase bg-emerald-600 text-white",children:"Direct Answer"}),i.jsx("span",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:"Google AI Overview & Featured Snippet"})]}),i.jsxs("p",{className:"text-xl sm:text-2xl font-extrabold text-slate-900 dark:text-emerald-100 tracking-tight leading-snug",children:["The most common way to introduce yourself in Spanish is"," ",i.jsx("strong",{className:"text-emerald-700 dark:text-emerald-400 underline decoration-emerald-400/40 decoration-2 underline-offset-4",children:"Me llamo…"})," ",i.jsx("span",{className:"text-slate-500 dark:text-slate-400 text-lg sm:text-xl font-mono font-normal",children:"(meh YAH-moh)"}),", meaning “I’m called…”."]}),i.jsxs("p",{className:"text-xs sm:text-sm text-slate-600 dark:text-slate-400",children:["Universal, natural, and friendly for any setting. Follow it with ",i.jsx("strong",{children:"Mucho gusto"})," (Nice to meet you) or pass the turn with ",i.jsx("strong",{children:"¿Y tú?"})," (And you?)."]})]}),i.jsxs("div",{className:"flex flex-col sm:flex-row items-stretch sm:items-center gap-3 shrink-0",children:[i.jsxs("button",{onClick:()=>j("Me llamo Ana. Mucho gusto.","intro-hero-answer"),className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-slate-900 hover:bg-slate-800 dark:bg-slate-800 dark:hover:bg-slate-700 text-white font-semibold text-sm shadow-md active:scale-95 transition-all shrink-0 cursor-pointer","aria-label":"Listen to Me llamo pronunciation",children:[i.jsx(on,{className:"w-5 h-5 text-emerald-400"}),i.jsx("span",{children:T==="intro-hero-answer"?"Playing...":"Hear Audio"})]}),i.jsxs("a",{href:"/?station=es-rne&autoplay=true",className:"inline-flex items-center justify-center gap-2 px-5 py-3 rounded-xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-700 hover:from-emerald-500 hover:to-teal-500 text-white font-bold text-sm shadow-lg shadow-emerald-600/30 active:scale-95 transition-all shrink-0 cursor-pointer group",title:"Tune to Spanish Live Radio with auto-play and shadow authentic conversational speed",children:[i.jsxs("span",{className:"relative flex h-2 w-2",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-white opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-white"})]}),i.jsx(cn,{className:"w-4 h-4 text-white group-hover:rotate-12 transition-transform"}),i.jsx("span",{children:"Tune to Live Spanish Radio (Auto-play)"}),i.jsx(qr,{className:"w-4 h-4 opacity-80 group-hover:translate-x-1 transition-transform"})]})]})]})}),i.jsxs("section",{className:"space-y-5",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-end justify-between gap-4 border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsxs("div",{children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white flex items-center gap-2",children:i.jsx("span",{children:"Quick Spanish Introduction Table (Essential Phrases)"})}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400 mt-1",children:"Everything you need to introduce your name, age, birthplace, and profession in Spanish."})]}),i.jsx("div",{className:"flex items-center gap-1.5 overflow-x-auto pb-1 text-xs",children:[{id:"all",label:"All Phrases"},{id:"name",label:"Name"},{id:"age",label:"Age"},{id:"origin",label:"Origin & Town"},{id:"profession",label:"Career"},{id:"turn",label:"Asking Back"}].map(G=>i.jsx("button",{onClick:()=>h(G.id),className:`px-3 py-1.5 rounded-lg font-medium transition-all cursor-pointer whitespace-nowrap ${d===G.id?"bg-emerald-600 text-white shadow-sm":"bg-slate-100 dar
4821k:bg-slate-800/80 text-slate-600 dark:text-slate-400 hover:bg-slate-200 dark:hover:bg-slate-700"}`,children:G.label},G.id))})]}),i.jsx("div",{className:"overflow-x-auto rounded-2xl border border-slate-200 dark:border-slate-800 shadow-sm",children:i.jsxs("table",{className:"w-full text-left text-sm border-collapse",children:[i.jsx("thead",{children:i.jsxs("tr",{className:"bg-slate-100/80 dark:bg-slate-900/90 border-b border-slate-200 dark:border-slate-800 text-slate-700 dark:text-slate-300 font-mono text-xs uppercase tracking-wider",children:[i.jsx("th",{className:"py-3.5 px-4",children:"Spanish"}),i.jsx("th",{className:"py-3.5 px-4",children:"English"}),i.jsx("th",{className:"py-3.5 px-4",children:"Pronunciation"}),i.jsx("th",{className:"py-3.5 px-4",children:"When to Use"}),i.jsx("th",{className:"py-3.5 px-4 text-center",children:"Audio & Shadow"})]})}),i.jsx("tbody",{className:"divide-y divide-slate-200/70 dark:divide-slate-800/70",children:ie.map(G=>{const Z=l.id===G.id;return i.jsxs("tr",{onClick:()=>c(G),className:`transition-colors cursor-pointer ${Z?"bg-emerald-500/10 dark:bg-emerald-950/40":"hover:bg-slate-100/50 dark:hover:bg-slate-800/40"}`,children:[i.jsx("td",{className:"py-3.5 px-4 font-bold text-slate-900 dark:text-white",children:i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{children:G.spanish}),G.formality==="Formal"&&i.jsx("span",{className:"text-[10px] px-1.5 py-0.5 rounded bg-amber-500/15 text-amber-600 dark:text-amber-400 font-mono",children:"Formal"})]})}),i.jsx("td",{className:"py-3.5 px-4 text-slate-600 dark:text-slate-300 font-medium",children:G.english}),i.jsx("td",{className:"py-3.5 px-4 font-mono text-xs text-emerald-600 dark:text-emerald-400",children:G.pronunciation}),i.jsx("td",{className:"py-3.5 px-4 text-xs text-slate-500 dark:text-slate-400 max-w-xs",children:G.whenToUse}),i.jsx("td",{className:"py-3.5 px-4 text-center",children:i.jsxs("div",{className:"inline-flex items-center gap-1.5",children:[i.jsx("button",{onClick:z=>{z.stopPropagation(),j(G.spanish,`table-${G.id}`)},className:"p-1.5 rounded-lg bg-slate-200 dark:bg-slate-800 hover:bg-emerald-500 hover:text-white dark:hover:bg-emerald-600 text-slate-700 dark:text-slate-300 transition-colors cursor-pointer",title:`Listen to ${G.spanish}`,"aria-label":`Listen to ${G.spanish}`,children:i.jsx(on,{className:"w-4 h-4"})}),i.jsx("button",{onClick:z=>{var se;z.stopPropagation(),c(G),(se=document.getElementById("interactive-shadowing-zone"))==null||se.scrollIntoView({behavior:"smooth"})},className:"px-2 py-1 text-xs rounded-md bg-emerald-500/15 text-emerald-600 dark:text-emerald-400 hover:bg-emerald-500 hover:text-white transition-all font-mono font-medium cursor-pointer",children:"Shadow"})]})})]},G.id)})})]})})]}),i.jsxs("section",{id:"interactive-shadowing-zone",className:"rounded-3xl p-6 sm:p-8 border border-emerald-500/30 bg-gradient-to-br from-slate-900 via-slate-900 to-emerald-950/40 text-white shadow-xl relative overflow-hidden",children:[i.jsx("div",{className:"absolute top-0 right-0 w-80 h-80 bg-emerald-500/10 rounded-full blur-3xl pointer-events-none"}),i.jsxs("div",{className:"relative z-10 space-y-6",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[i.jsxs("div",{className:"inline-flex items-center gap-2 px-3 py-1 rounded-full bg-emerald-500/20 text-emerald-300 text-xs font-mono font-bold tracking-wider uppercase border border-emerald-500/30",children:[i.jsx(At,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:"Real-Time Pronunciation Shadowing Lab"})]}),i.jsxs("span",{className:"text-xs text-slate-400 font-mono",children:["Target Phrase: ",l.spanish]})]}),i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold tracking-tight",children:"Listen, Shadow & Score Your Spanish Introduction"}),i.jsxs("div",{className:"p-4 rounded-xl bg-amber-500/15 border border-amber-500/30 flex items-start gap-3",children:[i.jsx(TW,{className:"w-5 h-5 text-amber-400 shrink-0 mt-0.5"}),i.jsxs("p",{className:"text-xs sm:text-sm text-amber-200/90 leading-relaxed",children:[i.jsx("strong",{children:"Pronunciation Guidance:"})," ","Listen and shadow aloud — the double ‘ll’ in “me llamo” is pronounced like the ‘y’ sound /y/ in “yarn”, never like English ‘l’. This is where beginner Spanish learners most easily stumble!"]})]})]}),i.jsxs("div",{className:"p-6 rounded-2xl bg-slate-800/80 border border-slate-700/80 space-y-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-4",children:[i.jsxs("div",{children:[i.jsx("div",{className:"text-xs font-mono text-emerald-400 uppercase tracking-widest",children:"Selected Phrase"}),i.jsx("div",{className:"text-3xl sm:text-4xl font-extrabold text-white mt-1",children:l.spanish}),i.jsx("div",{className:"text-base text-slate-300 font-medium mt
4821-0.5",children:l.english}),i.jsxs("div",{className:"text-sm font-mono text-emerald-300 mt-1",children:["[",l.pronunciation,"]"]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("button",{onClick:()=>j(l.spanish,l.id),className:"flex items-center gap-2 px-5 py-3 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-sm shadow-md active:scale-95 transition-all cursor-pointer","aria-label":`Play audio for ${l.spanish}`,children:[i.jsx(on,{className:"w-4 h-4"}),i.jsx("span",{children:T===l.id?"Playing...":"Hear Audio"})]}),m?i.jsxs("button",{onClick:M,className:"flex items-center gap-2 px-5 py-3 rounded-xl bg-amber-600 hover:bg-amber-500 text-white font-bold text-sm shadow-md animate-pulse cursor-pointer","aria-label":"Stop recording",children:[i.jsx(Cy,{className:"w-4 h-4"}),i.jsx("span",{children:"Stop Recording"})]}):i.jsxs("button",{onClick:O,className:"flex items-center gap-2 px-5 py-3 rounded-xl bg-rose-600 hover:bg-rose-500 text-white font-bold text-sm shadow-md active:scale-95 transition-all cursor-pointer","aria-label":"Start recording for shadowing",children:[i.jsx(Nn,{className:"w-4 h-4"}),i.jsx("span",{children:"Tap to Shadow"})]})]})]}),x&&i.jsxs("div",{className:"flex items-center gap-3 p-4 rounded-xl bg-slate-900/80 border border-slate-700 animate-pulse text-sm text-emerald-300 font-mono",children:[i.jsx(qa,{className:"w-4 h-4 animate-spin text-emerald-400"}),i.jsx("span",{children:"AI Acoustic Engine analyzing phonemes, syllable stress & vowel purity..."})]}),E&&i.jsxs("div",{className:"p-4 rounded-xl bg-rose-500/20 border border-rose-500/40 text-xs sm:text-sm text-rose-200 flex flex-col sm:flex-row sm:items-center justify-between gap-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(Qa,{className:"w-4 h-4 text-rose-400 shrink-0"}),i.jsx("span",{children:E})]}),i.jsx("button",{onClick:ee,className:"px-3 py-1.5 rounded-lg bg-rose-600 hover:bg-rose-500 text-white text-xs font-semibold whitespace-nowrap cursor-pointer transition-colors",children:"Try Simulated Check"})]}),v&&!x&&i.jsxs("div",{className:"p-5 rounded-2xl bg-slate-900/90 border border-emerald-500/40 space-y-4",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-slate-800 pb-3",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsxs("div",{className:"text-3xl font-black font-mono text-emerald-400",children:[v.score,i.jsx("span",{className:"text-xs text-slate-400 font-normal",children:"/100"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"text-xs font-bold uppercase tracking-wider text-emerald-300 font-mono",children:[v.level==="native"&&"🌟 Native Spanish Cadence",v.level==="fluent"&&"✨ Highly Fluent & Clear",v.level==="approaching"&&"👍 Approaching Native",v.level==="retry"&&"🔄 Needs Adjustment"]}),i.jsxs("div",{className:"text-xs text-slate-400",children:["Detected input: “",v.detectedText,"”"]})]})]}),i.jsxs("div",{className:"flex items-center gap-4 text-xs font-mono",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400",children:"Vowels: "}),i.jsxs("span",{className:"text-emerald-400 font-bold",children:[v.vowelScore,"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400",children:"Consonants: "}),i.jsxs("span",{className:"text-emerald-400 font-bold",children:[v.consonantScore,"%"]})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400",children:"Rhythm: "}),i.jsxs("span",{className:"text-emerald-400 font-bold",children:[v.rhythmScore,"%"]})]})]})]}),i.jsx("p",{className:"text-sm text-slate-200 leading-relaxed",children:v.feedbackEn})]})]}),i.jsxs("div",{className:"space-y-2",children:[i.jsx("div",{className:"text-xs font-mono text-slate-400 uppercase tracking-wider",children:"Select Another Intro Phrase to Practice:"}),i.jsx("div",{className:"grid grid-cols-2 sm:grid-cols-4 gap-2",children:bb.map(G=>i.jsxs("button",{onClick:()=>{c(G),B(null)},className:`p-3 rounded-xl text-left border transition-all cursor-pointer ${l.id===G.id?"bg-emerald-600/30 border-emerald-400 text-white font-bold shadow":"bg-slate-800/60 border-slate-700/60 hover:bg-slate-800 text-slate-300"}`,children:[i.jsx("div",{className:"text-sm font-semibold truncate",children:G.spanish}),i.jsx("div",{className:"text-xs text-slate-400 truncate mt-0.5",children:G.english})]},G.id))})]})]})]}),i.jsxs("section",{className:"space-y-8",children:[i.jsxs("div",{className:"border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold tracking-tight text-slate-900 dark:text-white",children:"In-Depth Phrase Breakdowns (5-Element Anatomy)"}
4821),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mt-1",children:"Every introductory phrase analyzed: literal breakdown, pronunciation cues, native dialogues, and appropriate social settings."})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:bb.map(G=>i.jsxs("article",{id:`phrase-card-${G.id}`,className:"p-6 rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 shadow-sm hover:shadow-md transition-all flex flex-col justify-between space-y-4",children:[i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex items-center justify-between gap-2",children:[i.jsx("h3",{className:"text-xl font-bold text-slate-900 dark:text-white flex items-center gap-2",children:i.jsx("span",{children:G.spanish})}),i.jsx("span",{className:"text-xs px-2.5 py-0.5 rounded-full font-mono font-medium bg-emerald-500/10 text-emerald-600 dark:text-emerald-400 border border-emerald-500/20",children:G.formality})]}),i.jsxs("div",{className:"text-sm font-semibold text-slate-700 dark:text-slate-300",children:["Meaning: ",G.english]}),i.jsxs("div",{className:"space-y-2 text-xs sm:text-sm text-slate-600 dark:text-slate-400 leading-relaxed divide-y divide-slate-100 dark:divide-slate-800/80 pt-1",children:[i.jsxs("div",{className:"pb-1.5",children:[i.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"1. Literal Translation: "}),i.jsx("span",{children:G.literal})]}),i.jsxs("div",{className:"py-1.5",children:[i.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"2. Pronunciation Guide: "}),i.jsxs("span",{className:"font-mono text-emerald-600 dark:text-emerald-400 font-medium",children:["[",G.pronunciation,"]"]}),i.jsxs("span",{children:[" — ",G.pronunciationTip]})]}),i.jsxs("div",{className:"py-1.5 space-y-1",children:[i.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"3. Dialogue Example: "}),i.jsxs("blockquote",{className:"pl-3 border-l-2 border-emerald-500 italic text-slate-800 dark:text-slate-200",children:[G.exampleSpanish,i.jsx("div",{className:"text-xs text-slate-500 dark:text-slate-400 not-italic mt-0.5",children:G.exampleEnglish})]})]}),i.jsxs("div",{className:"py-1.5",children:[i.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"4. When to Use: "}),i.jsx("span",{children:G.whenToUse})]}),i.jsxs("div",{className:"pt-1.5",children:[i.jsx("strong",{className:"text-slate-900 dark:text-slate-200",children:"5. Conversational Context: "}),i.jsx("span",{children:G.detailedContext})]})]})]}),i.jsxs("div",{className:"pt-2 flex items-center justify-between border-t border-slate-100 dark:border-slate-800",children:[i.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["Key: ",G.targetFocus]}),i.jsxs("button",{onClick:()=>j(G.spanish,`breakdown-${G.id}`),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-lg bg-slate-100 hover:bg-slate-200 dark:bg-slate-800 dark:hover:bg-slate-700 text-slate-800 dark:text-slate-200 text-xs font-semibold cursor-pointer transition-colors",children:[i.jsx(on,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:"Audio"})]})]})]},G.id))})]}),i.jsxs("section",{className:"p-6 sm:p-8 rounded-3xl border border-slate-200 dark:border-slate-800 bg-white/70 dark:bg-slate-900/60 backdrop-blur-sm space-y-6",children:[i.jsxs("div",{className:"space-y-1",children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Formality (Tú vs. Usted) & Regional Nuances"}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400",children:"How native speakers adjust their introductions from casual rooftop parties to formal boardrooms across Spain and Latin America."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-3 gap-6 text-sm",children:[i.jsxs("div",{className:"p-5 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/60 dark:border-slate-700/60 space-y-3",children:[i.jsx("h3",{className:"font-bold text-slate-900 dark:text-white text-base flex items-center gap-2",children:i.jsx("span",{children:"¿Cómo te llamas? vs ¿Cómo se llama?"})}
4821),i.jsxs("ul",{className:"space-y-2 text-slate-600 dark:text-slate-300 text-xs sm:text-sm",children:[i.jsxs("li",{children:[i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400",children:"¿Cómo te llamas?"}),": Informal (tú). Use with peers, classmates, party guests, and people your age."]}),i.jsxs("li",{children:[i.jsx("strong",{className:"text-indigo-600 dark:text-indigo-400",children:"¿Cómo se llama (usted)?"}),": Formal. Use with elderly individuals, doctors, clients, or government officials."]})]})]}),i.jsxs("div",{className:"p-5 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/60 dark:border-slate-700/60 space-y-3",children:[i.jsx("h3",{className:"font-bold text-slate-900 dark:text-white text-base flex items-center gap-2",children:i.jsx("span",{children:"Me llamo vs. Soy"})}),i.jsxs("ul",{className:"space-y-2 text-slate-600 dark:text-slate-300 text-xs sm:text-sm",children:[i.jsxs("li",{children:[i.jsx("strong",{className:"text-emerald-600 dark:text-emerald-400",children:"Me llamo"}),": Exclusively used for stating your given name (“I’m called”)."]}),i.jsxs("li",{children:[i.jsx("strong",{className:"text-indigo-600 dark:text-indigo-400",children:"Soy"}),": Far broader. Works for names (“Soy María”), identity (“Soy estudiante”), and origin (“Soy de Chile”)."]})]})]}),i.jsxs("div",{className:"p-5 rounded-2xl bg-slate-50 dark:bg-slate-800/60 border border-slate-200/60 dark:border-slate-700/60 space-y-3",children:[i.jsx("h3",{className:"font-bold text-slate-900 dark:text-white text-base flex items-center gap-2",children:i.jsx("span",{children:"Regional Variations & Next Step"})}),i.jsxs("p",{className:"text-slate-600 dark:text-slate-300 text-xs sm:text-sm leading-relaxed",children:["Regional variations for “Me llamo” are minimal—it is standard in all 20+ Spanish-speaking nations. In Spain, introductions almost always conclude with"," ",i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"text-emerald-600 dark:text-emerald-400 font-semibold underline decoration-emerald-500/40",children:"encantado/a"}),", while Latin America loves"," ",i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"text-emerald-600 dark:text-emerald-400 font-semibold underline decoration-emerald-500/40",children:"mucho gusto"}),"."]})]})]})]}),i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsx("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white",children:"Bonus Vocabulary & Common Pitfalls to Avoid"}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mt-1",children:"Level up your self-introduction with profession phrases and dodge the classic beginner traps."})]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-6",children:[i.jsxs("div",{className:"p-6 rounded-2xl border border-emerald-500/20 bg-emerald-50/50 dark:bg-emerald-950/20 space-y-4",children:[i.jsxs("h3",{className:"font-bold text-slate-900 dark:text-white text-lg flex items-center gap-2",children:[i.jsx(Co,{className:"w-5 h-5 text-emerald-500"}),i.jsx("span",{children:"High-Frequency Additions"})]}),i.jsxs("ul",{className:"space-y-3 text-sm text-slate-700 dark:text-slate-300",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"font-bold text-emerald-700 dark:text-emerald-300 shrink-0",children:"Soy estudiante:"}),i.jsx("span",{children:"“I am a student” (no article ‘un’ needed)."})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"font-bold text-emerald-700 dark:text-emerald-300 shrink-0",children:"Soy ingeniero/a:"}),i.jsx("span",{children:"“I am an engineer” (use -a for female speaker)."})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsxs("span",{className:"font-bold text-emerald-700 dark:text-emerald-300 shrink-0",children:[i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"underline decoration-emerald-400 hover:text-emerald-500",children:"Encantado/a de conocerte"}),":"]}),i.jsx("span",{children:"“Delighted to meet you” (warm, polite, and memorable)."})]})]})]}),i.jsxs("div",{className:"p-6 rounded-2xl border border-rose-500/20 bg-rose-50/50 dark:bg-rose-950/20 space-y-4",children:[i.jsxs("h3",{className:"font-bold text-slate-900 dark:text-white text-lg flex items-center gap-2",children:[i.jsx(Qa,{className:"w-5 h-5 text-rose-500"}),i.jsx("span",{children:"Beginner Mistakes to Dodge"})]}),i.jsxs("ul",{className:"space-y-3 text-sm text-slate-700 dark:text-slate-300",children:[i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"font-bold text-rose-600 dar
4821k:text-rose-400 shrink-0",children:"❌ Soy 25 años:"}),i.jsxs("span",{children:["Saying “I am 25 years” is wrong in Spanish. Always use ",i.jsx("strong",{children:"Tengo 25 años"})," (I have 25 years)."]})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"font-bold text-rose-600 dark:text-rose-400 shrink-0",children:"❌ Double L as English ‘L’:"}),i.jsx("span",{children:"Pronouncing “Me llamo” as /la-mo/ is a dead giveaway. Remember: double ‘ll’ sounds like /ya-mo/."})]}),i.jsxs("li",{className:"flex items-start gap-2",children:[i.jsx("span",{className:"font-bold text-rose-600 dark:text-rose-400 shrink-0",children:"❌ Soy un profesor:"}),i.jsx("span",{children:"Do not add ‘un/una’ when stating your profession unless you attach an adjective (“Soy profesor” vs “Soy un profesor creativo”)."})]})]})]})]})]}),i.jsxs("section",{className:"space-y-6",children:[i.jsxs("div",{className:"border-b border-slate-200 dark:border-slate-800 pb-4",children:[i.jsxs("h2",{className:"text-2xl font-bold tracking-tight text-slate-900 dark:text-white flex items-center gap-2",children:[i.jsx(wv,{className:"w-6 h-6 text-emerald-500"}),i.jsx("span",{children:"Frequently Asked Questions (FAQ)"})]}),i.jsx("p",{className:"text-sm text-slate-600 dark:text-slate-400 mt-1",children:"Common questions on saying your name, age, and introducing yourself in Spanish."})]}),i.jsx("div",{className:"space-y-3",children:[{q:"How do you say 'my name is' in Spanish?",a:"The most common and natural way is Me llamo… (meh YAH-moh), literally 'I call myself'. You can also say Soy… (I am…) or formal Mi nombre es… (My name is)."},{q:"What's the difference between 'me llamo' and 'soy'?",a:"Me llamo is strictly used for your name ('Me llamo Ana'). Soy is wider and can introduce your name ('Soy Ana'), your career ('Soy arquitecto'), or your nationality ('Soy de España')."},{q:"How do you ask 'what's your name' formally?",a:"Ask '¿Cómo se llama (usted)?' in business meetings, doctor appointments, or with elders. In casual peer settings, say '¿Cómo te llamas?'."},{q:"How do you say 'I'm from…'?",a:"Say 'Soy de…' followed by your city or country, e.g., 'Soy de Madrid' (I am from Madrid) or 'Soy de Nueva York' (I am from New York)."},{q:"How do you say your age in Spanish?",a:"Use the verb tener (to have): 'Tengo X años' (e.g., Tengo 28 años). Never say 'Soy X años', which is an incorrect literal translation."}].map((G,Z)=>i.jsxs("div",{className:"rounded-2xl border border-slate-200 dark:border-slate-800 bg-white dark:bg-slate-900 overflow-hidden shadow-sm transition-all",children:[i.jsxs("button",{onClick:()=>R(P===Z?null:Z),className:"w-full py-4 px-6 text-left font-bold text-slate-900 dark:text-white flex items-center justify-between gap-4 cursor-pointer hover:bg-slate-50 dark:hover:bg-slate-800/40",children:[i.jsx("span",{className:"text-base",children:G.q}),i.jsx("span",{className:"text-emerald-500 font-mono text-xl shrink-0",children:P===Z?"−":"+"})]}),P===Z&&i.jsx("div",{className:"px-6 pb-5 pt-1 text-sm text-slate-600 dark:text-slate-300 leading-relaxed border-t border-slate-100 dark:border-slate-800",children:G.a})]},Z))})]}),i.jsxs("section",{className:"p-8 sm:p-10 rounded-3xl bg-gradient-to-r from-emerald-600 via-teal-600 to-emerald-700 text-white shadow-xl space-y-6",children:[i.jsxs("div",{className:"max-w-2xl space-y-3",children:[i.jsx("h2",{className:"text-2xl sm:text-3xl font-extrabold tracking-tight",children:"Mastered Self-Introductions? Take the Next Step!"}),i.jsxs("p",{className:"text-emerald-100 text-sm sm:text-base leading-relaxed",children:["Now that you know how to introduce yourself, learn how to greet native speakers and reply politely →"," ",i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"text-white font-bold underline decoration-white/60 hover:text-emerald-200",children:"nice-to-meet-you-in-spanish"}),"; ready to order paella, tapas, or wine like a local? Explore"," ",i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"text-white font-bold underline decoration-white/60 hover:text-emerald-200",children:"how-to-order-food-in-spanish"}),"; practice full dialogues on live radio at"," ",i.jsx("a",{href:"/learn-spanish",className:"text-white font-bold underline decoration-white/60 hover:text-emerald-200",children:"learn-spanish"}),"; or get AI phoneme scoring at"," ",i.jsx("a",{href:"/spanish-pronunciation",className:"text-white font-bold underline decoration-white/60 hover:text-emerald-200",children:"spanish-pronunciation"}),"."]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-3 pt-2",children:[i.jsxs("a",{href:"/nice-to-meet-you-in-spanish",className:"inline-flex items-center gap-2 px-5 py-3 rounded-xl bg-white text-emerald-800 hover:bg-emerald-50 font-bold text-sm shadow-md active:scale-95 transition-all cursor-pointer",children:[i.jsx("span",{children:'Learn "Nice to Meet You"'}),i.jsx(qr,{className:"w-4 h-4"})]}),i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"inline-flex items-center gap-2 px-5 py-3 rounded-xl bg-emerald-800/60 hover:bg-emerald-800 text-white font-semibold text-sm border border-emerald-400/40 active:scale-95 transition-all cursor-pointer",children:i.jsx("span",{children:"How to Order Food (Quisiera)"})}),i.jsx("a",{href:"/spanish-pronunciation",className:"inline-flex items-center gap-2 px-5 py-3 rounded-xl bg-emerald-800/60 hover:bg-emerald-800 text-white font-semibold text-sm border border-emerald-400/40 active:scale-95 transition-all cursor-pointer",children:i.jsx("span",{children:"Spanish Pronunciation Coach"})}),i.jsx("a",{href:"/learn-spanish",className:"inline-flex items-center gap-2 px-5 py-3 rounded-xl bg-emerald-800/60 hover:bg-emerald-800 text-white font-semibold text-sm border border-emerald-400/40 active:scale-95 transition-all cursor-pointer",children:i.jsx("span",{children:"Explore Spanish Radio Stations"})})]})]}),i.jsxs("section",{className:"space-y-4 pt-4 border-t border-slate-200 dark:border-slate-800",children:[i.jsx("h3",{className:"text-lg font-bold text-slate-900 dark:text-white",children:"Related Spanish Learning Hub & Phrase Guides"}),i.jsxs("div",{className:"grid grid-cols-1 sm:grid-cols-2 lg:grid-cols-4 gap-4 text-xs",children:[i.jsxs("a",{href:"/nice-to-meet-you-in-spanish",className:"p-4 rounded-xl border border-slate-200 dark:border-slate-800 hover:border-emerald-500/50 bg-white dark:bg-slate-900 transition-all group",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-white group-hover:text-emerald-600 dark:group-hover:text-emerald-400",children:"Nice to Meet You in Spanish →"}),i.jsx("div",{className:"text-slate-500 dark:text-slate-400 mt-1",children:"Mucho gusto, encantado/a, and polite response rituals."})]}),i.jsxs("a",{href:"/how-to-order-food-in-spanish",className:"p-4 rounded-xl border border-slate-200 dark:border-slate-800 hover:border-emerald-500/50 bg-white dark:bg-slate-900 transition-all group",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-white group-hover:text-emerald-600 dark:group-hover:text-emerald-400",children:"How to Order Food in Spanish →"}),i.jsx("div",{className:"text-slate-500 dark:text-slate-400 mt-1",children:"Qu
4821isiera, me gustaría, la cuenta, and local dining etiquette."})]}),i.jsxs("a",{href:"/spanish-pronunciation",className:"p-4 rounded-xl border border-slate-200 dark:border-slate-800 hover:border-emerald-500/50 bg-white dark:bg-slate-900 transition-all group",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-white group-hover:text-emerald-600 dark:group-hover:text-emerald-400",children:"Spanish Pronunciation Coach →"}),i.jsx("div",{className:"text-slate-500 dark:text-slate-400 mt-1",children:"Rolling R (RR) trainer, vowels, and accent stress rules."})]}),i.jsxs("a",{href:"/learn-spanish",className:"p-4 rounded-xl border border-slate-200 dark:border-slate-800 hover:border-emerald-500/50 bg-white dark:bg-slate-900 transition-all group",children:[i.jsx("div",{className:"font-bold text-slate-900 dark:text-white group-hover:text-emerald-600 dark:group-hover:text-emerald-400",children:"Spanish Listening & Radio Hub →"}),i.jsx("div",{className:"text-slate-500 dark:text-slate-400 mt-1",children:"Live Madrid RTVE, Cadena SER, and real Spanish broadcasts."})]})]})]})]}),i.jsx("footer",{className:"border-t border-slate-200 dark:border-slate-800/80 bg-white dark:bg-slate-950 py-8 px-4 text-center text-xs text-slate-400 dark:text-slate-500",children:i.jsxs("div",{className:"max-w-5xl mx-auto flex flex-wrap items-center justify-between gap-4",children:[i.jsx("p",{children:"© 2026 RadioShadow AI. Practice conversational Spanish with live global radio."}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsx("a",{href:"/",className:"hover:text-emerald-500",children:"Home"}),i.jsx("a",{href:"/learn-spanish",className:"hover:text-emerald-500",children:"Learn Spanish"}),i.jsx("a",{href:"/nice-to-meet-you-in-spanish",className:"hover:text-emerald-500",children:"Nice to Meet You"}),i.jsx("a",{href:"/how-to-order-food-in-spanish",className:"hover:text-emerald-500",children:"How to Order Food"}),i.jsx("a",{href:"/how-to-introduce-yourself-in-spanish",className:"text-emerald-500 font-bold",children:"Introduce Yourself"}),i.jsx("a",{href:"/spanish-pronunciation",className:"hover:text-emerald-500",children:"Pronunciation"}),i.jsx("a",{href:"/sitemap.xml",className:"hover:text-emerald-500",children:"Sitemap"})]})]})})]})}function V6e(){const[n,e]=S.useState("manual"),[t,r]=S.useState([]),[s,a]=S.useState("npr-news"),[o,l]=S.useState("NPR Live 24/7 (National Public Radio)"),[c,d]=S.useState("https://npr-ice.streamguys1.com/live.mp3"),[h,m]=S.useState(30),[p,x]=S.useState(""),[y,v]=S.useState(!0),[B,E]=S.useState("aiseo-image"),[N,T]=S.useState("radio"),[k,P]=S.useState(!1),[R,_]=S.useState(""),[I,D]=S.useState(""),[j,O]=S.useState(!1),[M,U]=S.useState({success:!0,message:"Google Cloud Storage 互操作性 HMAC 凭据已成功加载并就绪 (gs://aiseo-image/radio/)"}),[ee,ie]=S.useState([]),[G,Z]=S.useState(!1),[z,se]=S.useState(!1),[re,H]=S.useState(null),[Y,de]=S.useState(null),[W,K]=S.useState(null),J=S.useRef(null),[oe,Ie]=S.useState(!1),pe=S.useRef(null),[ye,he]=S.useState(!1),[le,ce]=S.useState(null),[Ce,Ae]=S.useState([]),[je,nt]=S.useState(!1),[We,dt]=S.useState(""),[bt,Yt]=S.useState("08:00"),[Gt,En]=S.useState("daily"),[$t,ds]=S.useState(12),[sa,Fa]=S.useState(30);S.useEffect(()=>{document.title="内部广播录制与定时管理 (Admin) | RadioShadow";let ge=document.querySelector('meta[name="robots"]');ge||(ge=document.createElement("meta"),ge.setAttribute("name","robots"),document.head.appendChild(ge)),ge.setAttribute("content","noindex, nofollow, noarchive, nosnippet")},[]),S.useEffect(()=>{Mr(),es(),us();const ge=setInterval(()=>{es(),us()},3e3);return()=>clearInterval(ge)},[]);const Mr=async()=>{try{const et=await(await fetch("/api/recorder/stations")).json();et.success&&et.stations&&r(et.stations)}catch(ge){console.error("Failed to fetch stations",ge)}},es=async()=>{try{const et=await(await fetch("/api/recorder/tasks")).json();et.success&&et.tasks&&ie(et.tasks)}catch{}},us=async()=>{try{const et=await(await fetch("/api/recorder/schedules")).json();et.success&&et.schedules&&Ae(et.schedules)}catch{}},Vs=ge=>{a(ge.id),l(ge.name),d(ge.streamUrl),ce(null),oe&&pe.current&&(pe.current.pause(),Ie(!1))},Xi=ge=>{const et=c;if(et)if(oe)pe.current&&(pe.current.pause(),pe.current.src=""),Ie(!1);else{J.current&&(J.current.pause(),K(null));const xe=new Audio(et);pe.current=xe,Ie(!0),xe.play().catch(wn=>{console.error("Prelisten play error:",wn),alert("实时流播放失败,可能由于目标电台网络限制或跨域。可使用【探测电台】检测其健康状态。"),Ie(!1)}),xe.onended=()=>Ie(!1)}},ts=async ge=>{const et=c;if(!et){alert("请输入有效的电台流网络地址");return}he(!0),ce(null);try{const wn=await(await fetch("/api/recorder/probe-stream",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({streamUrl:et})})).json();wn.success?ce(wn):alert(`检测失败: ${wn.error||"未知异常"}`)}catch(xe){alert(`检测异常: ${xe.message}`)}finally{he(!1)}},Fr=async()=>
4821{if(!c.trim()){alert("请输入广播音频流地址 (Stream URL)");return}const ge=p?parseFloat(p):h;if(isNaN(ge)||ge<=0){alert("请输入有效的录制分钟数");return}se(!0),H(null);try{const xe=await(await fetch("/api/recorder/start",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({stationName:o.trim()||"Live Radio",streamUrl:c.trim(),durationMinutes:ge,autoUploadGcs:y,gcsBucket:B.trim()||"aiseo-image",gcsPrefix:N.trim()||"radio",accessKeyId:R.trim()||void 0,secretAccessKey:I.trim()||void 0})})).json();xe.success?(H("✅ 录音任务已在后台启动!录制完成后将自动同步至 Google 存储桶 (aiseo-image/radio)"),es()):alert(`启动录音失败: ${xe.error}`)}catch(et){alert(`启动失败: ${et.message}`)}finally{se(!1)}},As=async ge=>{try{(await(await fetch("/api/recorder/stop",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:ge})})).json()).success&&(H("⏹️ 已停止录制,正在封包 MP3 并上传 Google Cloud 存储桶..."),es())}catch{alert("停止录制失败")}},Qn=async ge=>{if(confirm("确定要删除这条录音文件和记录吗?"))try{W===ge&&J.current&&(J.current.pause(),K(null)),await fetch(`/api/recorder/task/${ge}`,{method:"DELETE"}),es()}catch{alert("删除失败")}},hl=async ge=>{try{H(`⏳ 正在上传 ${ge.filename} 到 Google Cloud Storage (${B}/${N})...`);const xe=await(await fetch("/api/recorder/upload-gcs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({taskId:ge.id,bucketName:B.trim()||"aiseo-image",pathPrefix:N.trim()||"radio",accessKeyId:R.trim()||void 0,secretAccessKey:I.trim()||void 0})})).json();xe.success?(H("🎉 上传成功!Google Cloud 直链已生成。"),es()):alert(`上传到 GCS 失败: ${xe.error}`)}catch(et){alert(`上传失败: ${et.message}`)}},xa=async()=>{O(!0),U(null);try{const et=await(await fetch("/api/recorder/test-gcs",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({bucketName:B.trim()||"aiseo-image",accessKeyId:R.trim()||void 0,secretAccessKey:I.trim()||void 0})})).json();et.success?U({success:!0,message:et.message}):U({success:!1,message:et.error+(et.hint?` (${et.hint})`:"")})}catch(ge){U({success:!1,message:ge.message})}finally{O(!1)}},Zi=async ge=>{try{const xe=await(await fetch(`/api/recorder/schedules/${ge}/toggle`,{method:"POST"})).json();xe.success&&(us(),H(xe.enabled?"⏰ 定时任务已激活!":"⏸️ 定时任务已暂停。"))}catch{alert("切换失败")}},Ur=async ge=>{try{H("🚀 正在立即触发定时录制任务..."),(await(await fetch(`/api/recorder/schedules/${ge}/run-now`,{method:"POST"})).json()).success&&(es(),H("✅ 定时任务已提前触发并开始后台录制!"),e("manual"))}catch{alert("触发失败")}},ks=async ge=>{if(confirm("确定要删除此定时录制规则吗?"))try{await fetch(`/api/recorder/schedules/${ge}`,{method:"DELETE"}),us()}catch{alert("删除失败")}},Bn=async ge=>{if(ge.preventDefault(),!c.trim()){alert("请选择或输入电台地址");return}try{(await(await fetch("/api/recorder/schedules",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({title:We.trim()||`${o} 定时录制 (${sa}m)`,stationName:o,streamUrl:c,durationMinutes:sa,autoUploadGcs:!0,enabled:!0,frequencyType:Gt,dailyTime:bt,intervalHours:$t})})).json()).success&&(H("🎉 新定时录制任务已创建并激活!"),nt(!1),dt(""),us())}catch{alert("创建定时任务失败")}},[Ar,Pn]=S.useState(null),aa=ge=>{if(W===ge.id)J.current&&(J.current.pause(),K(null));else{J.current&&J.current.pause();const et=ge.gcsSignedUrl||ge.gcsUrl||`/api/recorder/stream/${ge.id}`,xe=new Audio(et);J.current=xe,xe.play().catch(wn=>{if(console.error("Play error with primary source:",wn),ge.gcsUrl&&et!==`/api/recorder/stream/${ge.id}`){const ht=new Audio(`/api/recorder/stream/${ge.id}`);J.current=ht,ht.play().catch(mn=>console.error("Fallback play error:",mn)),ht.onended=()=>K(null)}}),xe.onended=()=>K(null),K(ge.id)}},si=async ge=>{if(ge.gcsSignedUrl||ge.gcsUrl){const et=ge.gcsSignedUrl||ge.gcsUrl,xe=document.createElement("a");xe.href=et,xe.download=ge.filename,xe.target="_blank",document.body.appendChild(xe),xe.click(),document.body.removeChild(xe);return}Pn(ge.id);try{const et=await fetch(`/api/recorder/download/${ge.id}`,{credentials:"include"});if((et.headers.get("content-type")||"").includes("text/html"))throw new Error("下载请求被代理拦截,请先点击【上传到 GCS】å
4821Žå†ä¸‹è½½ã€‚");if(!et.ok)throw new Error(`下载异常 (HTTP ${et.status})`);const wn=await et.blob(),ht=URL.createObjectURL(wn),mn=document.createElement("a");mn.href=ht,mn.download=ge.filename,document.body.appendChild(mn),mn.click(),document.body.removeChild(mn),setTimeout(()=>URL.revokeObjectURL(ht),1e4)}catch(et){alert(`下载失败: ${et.message}`)}finally{Pn(null)}},bi=(ge,et)=>{navigator.clipboard.writeText(ge),de(et),setTimeout(()=>de(null),2e3)},hs=ge=>{const et=Math.floor(ge/60),xe=ge%60;return`${et.toString().padStart(2,"0")}:${xe.toString().padStart(2,"0")}`},ba=ge=>ge?ge<1024*1024?`${(ge/1024).toFixed(1)} KB`:`${(ge/1024/1024).toFixed(2)} MB`:"0 KB",fl=ge=>{if(!ge)return"未设置";const et=new Date(ge),xe=Date.now(),wn=Math.round((ge-xe)/(60*1e3)),ht=et.toLocaleTimeString([],{hour:"2-digit",minute:"2-digit"}),mn=et.toLocaleDateString([],{month:"numeric",day:"numeric"});if(wn<=0)return"即将执行";if(wn<60)return`约 ${wn} 分钟后 (${ht})`;const ya=(wn/60).toFixed(1);return`${mn} ${ht} (约 ${ya} 小时后)`},Jn=ee.find(ge=>ge.status==="recording");return i.jsxs("div",{className:"min-h-screen bg-slate-950 text-slate-100 p-4 md:p-8 font-sans selection:bg-indigo-500 selection:text-white",children:[i.jsxs("div",{className:"max-w-6xl mx-auto mb-6",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 border-b border-slate-800 pb-6",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:"w-12 h-12 rounded-xl bg-gradient-to-tr from-indigo-600 to-purple-500 flex items-center justify-center shadow-lg shadow-indigo-500/20",children:i.jsx(cn,{className:"w-6 h-6 text-white"})}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h1",{className:"text-xl md:text-2xl font-bold tracking-tight text-white",children:"全球广播自动化录音与定时任务"}),i.jsxs("span",{className:"px-2.5 py-0.5 rounded-full text-xs font-medium bg-amber-500/10 text-amber-400 border border-amber-500/20 flex items-center gap-1",children:[i.jsx(Y2,{className:"w-3 h-3"})," 内部专属 / 离线索引"]})]}),i.jsxs("p",{className:"text-sm text-slate-400 mt-0.5",children:["高保真录制母语广播 MP3 · 自动转存 Google Cloud Storage (",i.jsx("code",{className:"text-indigo-400",children:"aiseo-image/radio"}),") · 定时无人值守"]})]})]}),i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("button",{onClick:()=>{window.location.href="/"},className:"px-4 py-2 rounded-lg text-xs font-medium bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 transition",children:"返回首页"}),i.jsxs("button",{onClick:()=>{es(),us()},className:"px-4 py-2 rounded-lg text-xs font-medium bg-indigo-600/20 hover:bg-indigo-600/30 text-indigo-300 border border-indigo-500/30 flex items-center gap-1.5 transition",children:[i.jsx(qa,{className:`w-3.5 h-3.5 ${G?"animate-spin":""}`}),"刷新状态"]})]})]}),i.jsxs("div",{className:"mt-4 p-3.5 rounded-xl bg-slate-900/90 border border-emerald-500/30 text-xs flex flex-wrap items-center justify-between gap-3 shadow-md",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsxs("span",{className:"relative flex h-2.5 w-2.5",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2.5 w-2.5 bg-emerald-500"})]}),i.jsx("span",{className:"font-semibold text-emerald-400",children:"Google Cloud Storage 已验证连接"}),i.jsx("span",{className:"text-slate-500",children:"|"}),i.jsx("span",{className:"text-slate-300 font-mono",children:"存储桶: gs://aiseo-image/radio/"}),i.jsx("span",{className:"text-slate-500 hidden md:inline",children:"|"}),i.jsx("span",{className:"text-slate-400 hidden md:inline font-mono",children:"账号: aiseo-793@ainewsan-d-2024..."})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:xa,disabled:j,className:"px-2.5 py-1 rounded bg-slate-800 hover:bg-slate-700 text-slate-300 border border-slate-700 flex items-center gap-1 transition",children:[j?i.jsx(qa,{className:"w-3 h-3 animate-spin"}):i.jsx(vn,{className:"w-3 h-3 text-emerald-400"}),"验证密钥连通性"]}),i.jsxs("button",{onClick:()=>P(!k),className:"px-2.5 py-1 rounded bg-slate-800 hover:bg-slate-700 text-slate-400 hover:text-white border border-slate-700 flex items-center gap-1",children:[i.jsx(Iye,{className:"w-3 h-3"}),k?"收起参数":"查看配置"]})]})]}),k&&i.jsxs("div",{className:"mt-2 p-4 rounded-xl bg-slate-900 border border-slate-800 text-xs space-y-3 animate-fadeIn",children:[i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3",children:[i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400 block mb-1",children:"已生效 Access Key (HMAC 访问密钥):"}
4821),i.jsx("input",{type:"text",readOnly:!0,value:"GOOG1EZQ3HTLEDZH4RX3BUBA37KBZELVZM7IBXMTLJKHKPPUGFIUFOS3QXHXV",className:"w-full px-2.5 py-1.5 rounded bg-slate-950 border border-slate-800 font-mono text-[11px] text-slate-300"})]}),i.jsxs("div",{children:[i.jsx("span",{className:"text-slate-400 block mb-1",children:"已生效 Secret Key (密文):"}),i.jsx("input",{type:"text",readOnly:!0,value:"EuO+5TYHaCyH/zjsXaLjpBRBGWxOsmsJwt0EcfVi",className:"w-full px-2.5 py-1.5 rounded bg-slate-950 border border-slate-800 font-mono text-[11px] text-slate-400"})]})]}),M&&i.jsx("div",{className:`p-2.5 rounded text-xs ${M.success?"bg-emerald-950/60 text-emerald-300 border border-emerald-500/30":"bg-red-950/60 text-red-300 border border-red-500/30"}`,children:M.message})]}),re&&i.jsxs("div",{className:"mt-4 p-3.5 rounded-lg bg-indigo-950/70 border border-indigo-500/40 text-indigo-200 text-sm flex items-center justify-between animate-fadeIn",children:[i.jsx("span",{children:re}),i.jsx("button",{onClick:()=>H(null),className:"text-xs text-indigo-400 hover:text-white px-2 py-0.5",children:"关闭"})]}),i.jsxs("div",{className:"flex items-center gap-2 mt-6 border-b border-slate-800",children:[i.jsxs("button",{onClick:()=>e("manual"),className:`px-4 py-2.5 text-sm font-semibold border-b-2 transition flex items-center gap-2 ${n==="manual"?"border-indigo-500 text-white":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[i.jsx(Nn,{className:"w-4 h-4 text-indigo-400"}),"手动立即录制"]}),i.jsxs("button",{onClick:()=>e("schedules"),className:`px-4 py-2.5 text-sm font-semibold border-b-2 transition flex items-center gap-2 ${n==="schedules"?"border-indigo-500 text-white":"border-transparent text-slate-400 hover:text-slate-200"}`,children:[i.jsx(uS,{className:"w-4 h-4 text-indigo-400"}),"⏰ 定时自动化任务 (",Ce.filter(ge=>ge.enabled).length," 个运行中)"]})]})]}),i.jsx("div",{className:"max-w-6xl mx-auto",children:n==="schedules"?i.jsxs("div",{className:"space-y-6",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-4 bg-slate-900 border border-slate-800 rounded-2xl p-6 shadow-xl",children:[i.jsxs("div",{children:[i.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[i.jsx(Eo,{className:"w-5 h-5 text-indigo-400"})," 自动化定时录音排程"]}),i.jsx("p",{className:"text-xs text-slate-400 mt-1",children:"设置每日固定时间(例如北京时间 08:00 晨间新闻)或循环周期,系统自动在后台录制 30 分钟并自动同步至 Google 存储桶。"})]}),i.jsxs("button",{onClick:()=>nt(!je),className:"px-4 py-2 rounded-xl text-xs font-semibold bg-indigo-600 hover:bg-indigo-500 text-white flex items-center gap-1.5 transition shadow-lg shadow-indigo-600/30",children:[i.jsx(Bye,{className:"w-4 h-4"}),je?"取消添加":"添加新定时任务"]})]}),je&&i.jsxs("form",{onSubmit:Bn,className:"bg-slate-900 border border-indigo-500/40 rounded-2xl p-6 shadow-2xl space-y-4 animate-fadeIn",children:[i.jsxs("h3",{className:"text-sm font-bold text-white flex items-center gap-2",children:[i.jsx(At,{className:"w-4 h-4 text-indigo-400"})," 配置新定时录制规则"]}),i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-4",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"任务名称"}),i.jsx("input",{type:"text",value:We,onChange:ge=>dt(ge.target.value),placeholder:"例如:每日 NPR 晨间新闻 30 分钟",className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-xs text-white focus:outline-none focus:border-indigo-500"})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"选择录制电台"}),i.jsx("select",{value:s,onChange:ge=>{const et=t.find(xe=>xe.id===ge.target.value);et&&Vs(et)},className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-xs text-white focus:outline-none focus:border-indigo-500",children:t.map(ge=>i.jsxs("option",{value:ge.id,children:[ge.name," (",ge.country,")"]},ge.id))})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"执行周期模式"}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsx("button",{type:"button",onClick:()=>En("daily"),className:`py-2 px-3 rounded-lg text-xs font-medium border transition ${Gt==="daily"?"bg-indigo-600 text-white border-indigo-500":"bg-slate-800 text-slate-400 border-slate-750"}`,children:"每日固定时刻 (推荐)"}),i.jsx("button",{type:"button",onClick:()=>En("interval"),className:`py-2 px-3 rounded-lg text-xs font-medium border transition ${Gt==="interval"?"bg-indigo-600 text-white border-indigo-500":"bg-slate-800 text-slate-400 border-slate-750"}`,children:"每隔 N 小时循环"})]})]}),Gt==="daily"?i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"每日执行时间 (北京时间 UTC+8)"}
4821),i.jsx("input",{type:"time",value:bt,onChange:ge=>Yt(ge.target.value),className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-xs text-white focus:outline-none focus:border-indigo-500"})]}):i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"循环间隔 (小时)"}),i.jsxs("select",{value:$t,onChange:ge=>ds(Number(ge.target.value)),className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-xs text-white focus:outline-none focus:border-indigo-500",children:[i.jsx("option",{value:6,children:"每 6 小时录制一次"}),i.jsx("option",{value:12,children:"每 12 小时录制一次"}),i.jsx("option",{value:24,children:"每 24 小时录制一次"})]})]}),i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"录制时长 (推荐 B 站跟读 30 分钟)"}),i.jsxs("select",{value:sa,onChange:ge=>Fa(Number(ge.target.value)),className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-xs text-white focus:outline-none focus:border-indigo-500",children:[i.jsx("option",{value:15,children:"15 分钟"}),i.jsx("option",{value:30,children:"30 分钟 (B 站视频标准长度)"}),i.jsx("option",{value:45,children:"45 分钟"}),i.jsx("option",{value:60,children:"60 分钟"})]})]}),i.jsx("div",{className:"flex items-end",children:i.jsxs("button",{type:"submit",className:"w-full py-2.5 rounded-lg text-xs font-semibold bg-emerald-600 hover:bg-emerald-500 text-white flex items-center justify-center gap-1.5 transition shadow",children:[i.jsx(Co,{className:"w-4 h-4"})," 确认保存并启用定时任务"]})})]})]}),i.jsx("div",{className:"space-y-3",children:Ce.map(ge=>i.jsxs("div",{className:`p-5 rounded-2xl border transition shadow-lg ${ge.enabled?"bg-slate-900/90 border-slate-750":"bg-slate-950/60 border-slate-850 opacity-70"}`,children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-3",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"text-base font-bold text-white",children:ge.title}),ge.enabled?i.jsxs("span",{className:"px-2 py-0.5 rounded-full text-[11px] font-semibold bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 flex items-center gap-1",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-400 animate-pulse"}),"已启用"]}):i.jsx("span",{className:"px-2 py-0.5 rounded-full text-[11px] font-semibold bg-slate-800 text-slate-400 border border-slate-750",children:"已暂停"})]}),i.jsxs("div",{className:"text-xs text-slate-400 mt-1 flex flex-wrap items-center gap-x-4 gap-y-1",children:[i.jsxs("span",{children:["电台: ",i.jsx("strong",{className:"text-slate-300",children:ge.stationName})]}),i.jsxs("span",{children:["时长: ",i.jsxs("strong",{className:"text-slate-300",children:[ge.durationMinutes," 分钟"]})]}),i.jsxs("span",{children:["周期: ",i.jsx("strong",{className:"text-indigo-300",children:ge.frequencyType==="daily"?`每日 ${ge.dailyTime} (北京时间)`:`每隔 ${ge.intervalHours} 小时`})]}),i.jsxs("span",{children:["转存: ",i.jsx("strong",{className:"text-emerald-400",children:"gs://aiseo-image/radio"})]})]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>Ur(ge.id),className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-slate-800 hover:bg-slate-750 text-indigo-300 border border-indigo-500/30 flex items-center gap-1 transition",title:"立即提前执行一次录制",children:[i.jsx(Ebe,{className:"w-3.5 h-3.5 text-indigo-400"}),"立即执行一次"]}),i.jsxs("button",{onClick:()=>Zi(ge.id),className:`px-3 py-1.5 rounded-lg text-xs font-semibold flex items-center gap-1.5 transition ${ge.enabled?"bg-emerald-600/20 text-emerald-300 border border-emerald-500/40 hover:bg-emerald-600/30":"bg-slate-800 text-slate-400 border border-slate-750 hover:bg-slate-750"}`,children:[ge.enabled?i.jsx(Jye,{className:"w-4 h-4 text-emerald-400"}):i.jsx(Yye,{className:"w-4 h-4 text-slate-500"}),ge.enabled?"运行中":"已停用"]}),i.jsx("button",{onClick:()=>ks(ge.id),className:"p-2 rounded-lg text-slate-500 hover:text-rose-400 hover:bg-rose-950/30 transition",title:"删除定时规则",children:i.jsx(Fd,{className:"w-3.5 h-3.5"})})]})]}),i.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-800 flex flex-wrap items-center justify-between gap-2 text-xs text-slate-400",children:[i.jsxs("div",{children:["下次执è
4821¡Œæ—¶é—´: ",i.jsx("span",{className:"text-amber-300 font-medium",children:ge.enabled?fl(ge.nextRunTime):"任务已停用"})]}),ge.lastRunTime&&i.jsxs("div",{children:["上次执行: ",i.jsx("span",{className:"text-slate-300",children:new Date(ge.lastRunTime).toLocaleString()})," (状态: ",ge.lastRunStatus==="success"?"✅ 成功":"❌ 异常",")"]})]})]},ge.id))})]}):i.jsxs("div",{className:"grid grid-cols-1 lg:grid-cols-12 gap-8",children:[i.jsxs("div",{className:"lg:col-span-5 space-y-6",children:[i.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-2xl p-6 shadow-xl space-y-5",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[i.jsx(AW,{className:"w-4 h-4 text-indigo-400"})," 1. 选择或输入电台"]}),i.jsx("span",{className:"text-xs text-slate-500",children:"已推荐 B 站跟读首选源"})]}),i.jsx("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-2",children:t.map(ge=>{const et=s===ge.id;return i.jsxs("button",{onClick:()=>Vs(ge),className:`text-left p-3 rounded-xl border text-xs transition ${et?"bg-indigo-600/20 border-indigo-500 text-white font-medium shadow-sm":"bg-slate-800/60 border-slate-750 text-slate-300 hover:bg-slate-800 hover:border-slate-700"}`,children:[i.jsxs("div",{className:"flex items-center justify-between gap-1",children:[i.jsx("span",{className:"font-semibold truncate",children:ge.name}),et&&i.jsx(Co,{className:"w-3.5 h-3.5 text-indigo-400 shrink-0"})]}),i.jsxs("div",{className:"text-[11px] text-slate-400 mt-1 flex flex-wrap items-center justify-between gap-1",children:[i.jsxs("span",{children:[ge.country," · ",ge.language]}),ge.speechType&&i.jsx("span",{className:"px-1.5 py-0.5 rounded bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 text-[10px] font-medium",children:ge.speechType})]})]},ge.id)})}),i.jsxs("div",{className:"space-y-3 pt-2 border-t border-slate-800",children:[i.jsxs("div",{children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400 mb-1",children:"电台自定义名称 (用于 MP3 文件命名)"}),i.jsx("input",{type:"text",value:o,onChange:ge=>l(ge.target.value),className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-sm text-white focus:outline-none focus:border-indigo-500",placeholder:"例如:NPR Live News / BBC World"})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1",children:[i.jsx("label",{className:"block text-xs font-medium text-slate-400",children:"音频流网络地址 (Stream URL)"}),i.jsx("span",{className:"text-[11px] text-indigo-300 font-medium",children:"支持 MP3 / AAC / HLS 实时流"})]}),i.jsx("input",{type:"text",value:c,onChange:ge=>{d(ge.target.value),a("custom"),ce(null)},className:"w-full px-3 py-2 rounded-lg bg-slate-950 border border-slate-700 text-xs font-mono text-slate-300 focus:outline-none focus:border-indigo-500",placeholder:"https://... 或 http://..."}),i.jsxs("div",{className:"mt-2.5 flex flex-wrap items-center gap-2",children:[i.jsxs("button",{type:"button",onClick:()=>Xi(),className:`px-3 py-1.5 rounded-lg text-xs font-medium flex items-center gap-1.5 transition ${oe?"bg-amber-600 text-white shadow-md animate-pulse":"bg-slate-800 hover:bg-slate-750 text-slate-200 border border-slate-700"}`,title:"在浏览器直接试听实时电台,亲耳确认是否有人声与节目内容",children:[oe?i.jsx(mS,{className:"w-3.5 h-3.5"}):i.jsx(on,{className:"w-3.5 h-3.5 text-indigo-400"}),oe?"停止试听":"🎧 试听当前实时流 (听 3 秒确认人声)"]}),i.jsxs("button",{type:"button",onClick:()=>ts(),disabled:ye,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-indigo-600/20 hover:bg-indigo-600/30 text-indigo-300 border border-indigo-500/30 flex items-center gap-1.5 transition disabled:opacity-50",title:"后端探针快速读取广播 ICY 标签与当前播出节目,智能判定人声",children:[ye?i.jsx(qa,{className:"w-3.5 h-3.5 animate-spin text-indigo-400"}):i.jsx(At,{className:"w-3.5 h-3.5 text-indigo-400"}),ye?"正在探测节目信息...":"🔍 智能探测当前节目与类型"]})]}),le&&i.jsxs("div",{className:`mt-2.5 p-3 rounded-xl text-xs border animate-fadeIn space-y-1.5 ${le.verdictType==="speech"?"bg-emerald-950/40 border-emerald-500/40 text-emerald-200":le.verdictType==="music"?"bg-amber-950/40 border-amber-500/40 text-amber-200":"bg-slate-900 border-slate-700 text-slate-300"}`,children:[i.jsxs("div",{className:"flex items-center justify-between font-semibold",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx(cn,{className:"w-3.5 h-3.5 text-indigo-400"}),le.stationName]}),i.jsxs("span",{className:"text-[11px] px-2 py-0.5 rounded-full bg-slate-800/80 border border-slate-700 text-slate-300 font-mono",children:["分类: ",le.genre]})]}),i.jsxs("div",{className:"text-slate-300",children:[i.jsx("strong",{children:"当前播出:"}),le.currentProgram]}),i.jsx("div",{className:"font-medium pt-1 border-t border-slate-800/60",children:le.
4821speechVerdict})]})]})]}),i.jsxs("div",{className:"pt-2 border-t border-slate-800 space-y-3",children:[i.jsxs("label",{className:"block text-xs font-medium text-slate-300 flex items-center gap-1.5",children:[i.jsx(Eo,{className:"w-3.5 h-3.5 text-indigo-400"})," 2. 录制时长 (B站半小时跟读系列推荐 30 分钟)"]}),i.jsx("div",{className:"grid grid-cols-4 gap-2",children:[5,15,30,60].map(ge=>i.jsxs("button",{onClick:()=>{m(ge),x("")},className:`py-2 px-3 rounded-lg text-xs font-medium border transition ${h===ge&&!p?"bg-indigo-600 text-white border-indigo-500 shadow-md shadow-indigo-600/30":"bg-slate-800 text-slate-300 border-slate-700 hover:bg-slate-750"}`,children:[ge," 分钟"]},ge))}),i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("span",{className:"text-xs text-slate-400",children:"或自定义时长:"}),i.jsx("input",{type:"number",min:"1",max:"180",value:p,onChange:ge=>x(ge.target.value),placeholder:"输入分钟数",className:"w-28 px-3 py-1.5 rounded-lg bg-slate-950 border border-slate-700 text-xs text-white focus:outline-none focus:border-indigo-500"}),i.jsx("span",{className:"text-xs text-slate-500",children:"分钟"})]})]}),i.jsx("div",{className:"pt-2 border-t border-slate-800",children:i.jsxs("label",{className:"flex items-center gap-2 text-xs font-medium text-slate-300 cursor-pointer",children:[i.jsx("input",{type:"checkbox",checked:y,onChange:ge=>v(ge.target.checked),className:"w-4 h-4 rounded text-indigo-600 focus:ring-indigo-500 bg-slate-950 border-slate-700"}),i.jsxs("span",{children:["录制完成后自动转存 Google Cloud Storage (",i.jsx("code",{className:"text-indigo-400",children:"aiseo-image/radio"}),")"]})]})}),i.jsx("div",{className:"pt-2",children:i.jsxs("button",{onClick:Fr,disabled:z||!!Jn,className:`w-full py-3.5 px-4 rounded-xl font-semibold text-sm flex items-center justify-center gap-2 shadow-lg transition ${Jn?"bg-slate-800 text-slate-500 cursor-not-allowed border border-slate-700":"bg-gradient-to-r from-red-600 to-rose-600 hover:from-red-500 hover:to-rose-500 text-white shadow-rose-600/30"}`,children:[i.jsx(Nn,{className:"w-4 h-4 animate-pulse"}),z?"正在连接电台并启动...":Jn?"已有任务正在录制中 (见右侧面板)":`开始录制 ${p||h} 分钟高清音频`]})})]}),i.jsxs("div",{className:"bg-slate-900/60 border border-slate-800 rounded-2xl p-5 text-xs text-slate-400 space-y-3",children:[i.jsxs("h3",{className:"font-semibold text-white flex items-center gap-2",children:[i.jsx(At,{className:"w-4 h-4 text-amber-400"})," B 站半小时跟读视频 · 极速出片指引 (0 Token 消耗)"]}),i.jsxs("ol",{className:"list-decimal pl-4 space-y-1.5 leading-relaxed text-slate-300",children:[i.jsxs("li",{children:[i.jsx("strong",{className:"text-white",children:"录制完成:"}),"直接在下方列表点击【下载 MP3】或一键复制 Google 存储桶直链。"]}),i.jsxs("li",{children:[i.jsx("strong",{className:"text-white",children:"自动生成字幕:"}),"拖入桌面端【剪映 / CapCut】,点击【文本】→【智能字幕】→【文稿识别】,3分钟自动打上全文字幕与时间轴。"]}),i.jsxs("li",{children:[i.jsx("strong",{className:"text-white",children:"视觉包装:"}),"套用固定收音机/音频波形视频模板,导出 1080P 视频即可直接发布。"]})]})]})]}),i.jsxs("div",{className:"lg:col-span-7 space-y-6",children:[Jn&&i.jsxs("div",{className:"bg-gradient-to-br from-slate-900 to-red-950/30 border border-red-500/40 rounded-2xl p-6 shadow-2xl relative overflow-hidden animate-pulse-border",children:[i.jsxs("div",{className:"flex items-center justify-between mb-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"relative flex h-3 w-3",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-red-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-3 w-3 bg-red-500"})]}),i.jsx("span",{className:"text-sm font-bold text-red-400 tracking-wide uppercase",children:"正在后台录制中 (REC)"})]}),i.jsxs("button",{onClick:()=>As(Jn.id),className:"px-3 py-1.5 rounded-lg text-xs font-semibold bg-red-600/80 hover:bg-red-600 text-white flex items-center gap-1.5 transition shadow",children:[i.jsx(Ev,{className:"w-3.5 h-3.5 fill-current"}),"提前停止并保存"]})]}),i.jsxs("div",{className:"space-y-3",children:[i.jsxs("div",{className:"flex justify-between items-baseline",children:[i.jsx("div",{className:"text-lg font-bold text-white truncate max-w-xs md:max-w-md",children:Jn.stationName}),i.jsxs("div",{className:"text-sm font-mono text-red-300",children:[hs(Jn.elapsedSeconds)," / ",hs(Jn.targetSeconds)]})]}),i.jsx("div",{className:"w-full bg-slate-800 rounded-full h-3 overflow-hidden border border-slate-700",children:i.jsx("div",{className:"bg-gradient-to-r from-red-600 to-amber-500 h-full rounded-full transition-all duration-1000 ease-out",style:{width:`${Math.max(3,Jn.progressPercent)}%`}})}),i.jsxs("div",{className:"flex justify-between items-center text-xs text-slate-400 pt-1",children:[i.jsxs("span",{children:["目标: ",Jn.durationMinutes," 分钟"]}),i.jsxs("span",{children:["已生成临时文件: ",ba(Jn.fileSize)]}),i.jsxs("span",{children:["进度: ",Jn.progressPercent,"%"]})]})]})]}),i.jsxs("div",{className:"bg-slate-900 border border-slate-800 rounded-2xl p-6 shadow-xl space-y-4",children:[i.jsxs("div",{className:"flex items-center justify-between",children:[i.jsxs("h2",{className:"text-base font-semibold text-white flex items-center gap-2",children:[i.jsx(Kbe,{className:"w-4 h-4 text-indigo-400"})," 已就绪的广播录音列表 (",ee.length,")"]}),i.jsx("span",{className:"text-xs text-slate-400",children:"已同步保存在 Google 存储桶与本地"})]}),ee.length===0?i.jsxs("div",{className:"text-center py-12 border border-dashed border-slate-800 rounded-xl",children:[i.jsx(cn,{className:"w-10 h-10 text-slate-600 mx-auto mb-2"}),i.jsx("p",{className:"text-sm text-slate-400",children:"暂无录制音频"}),i.jsx("p",{className:"text-xs text-slate-500 mt-1",children:"在左侧选择电台并点击“开始录制”,音频将在后台生成并展示在此处"})]}):i.jsx("div",{className:"space-y-3",children:ee.map(ge=>{const et=W===ge.id,xe=ge.status==="completed"||ge.status==="stopped",wn=ge.status==="recording",ht=ge.status==="uploading";return i.jsxs("div",{className:"p-4 rounded-xl bg-slate-950/70 border border-slate-800 hover:border-slate-750 transition space-y-3",children:[i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2",children:[i.jsxs("div",{children:[i.jsxs("div",{className:"font-semibold text-white text-sm flex items-center gap-2",children:[i.jsx("span",{children:ge.stationName}),i.jsxs("span",{className:"text-xs font-mono text-slate-400",children:["(",ge.durationMinutes,"m)"]}),ge.scheduleId&&i.jsx("span",{className:"px-2 py-0.5 rounded text-[10px] bg-indigo-950 text-indigo-300 border border-indigo-800",children:"定时任务生成"})]}),i.jsxs("div",{className:"text-xs text-slate-500 font-mono mt-0.5",children:[ge.filename," · ",ba(ge.fileSize)]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[wn&&i.jsxs("span",{className:"px-2.5 py-1 rounded-full text-xs font-medium bg-red-500/10 text-red-400 border border-red-500/20 flex items-center gap-1",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-ping"}),"录制中 (",ge.progressPercent,"%)"]}),ht&&i.jsxs("span",{className:"px-2.5 py-1 rounded-full text-xs font-medium bg-indigo-500/10 text-indigo-400 border border-indigo-500/20 flex items-center gap-1",children:[i.jsx(qa,{className:"w-3 h-3 animate-spin"})," 上传 GCS 存储桶中..."]}),xe&&i.jsxs("span",{className:"px-2.5 py-1 rounded-full text-xs font-medium bg-emerald-500/10 text-emerald-400 border border-emerald-500/20 flex items-center gap-1",children:[i.jsx(vn,{className:"w-3 h-3"})," 已完成"]}),ge.status==="failed"&&i.jsxs("span",{className:"px-2.5 py-1 rounded-full text-xs font-medium bg-rose-500/10 text-rose-400 border border-rose-500/20 flex items-center gap-1",children:[i.jsx(Qa,{className:"w-3 h-3"})," 录制异常"]})]})]}),ge.error&&i.jsx("div",{className:"text-xs text-rose-400 bg-rose-950/40 p-2 rounded border border-rose-900/40",children:ge.error}),xe&&i.jsxs("div",{className:"flex flex-wrap items-center justify-between gap-2 pt-2 border-t border-slate-800/80",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("button",{onClick:()=>aa(ge),className:`px-3 py-1.5 rounded-lg text-xs font-medium flex items-center gap-1.5 transition ${et?"bg-amber-600 text-white shadow-sm":"bg-slate-800 hover:bg-slate-700 text-slate-200 border border-slate-700"}`,children:[et?i.jsx(Fh,{className:"w-3.5 h-3.5"}):i.jsx(Xa,{className:"w-3.5 h-3.5"}),et?"暂停播放":"在线试听"]}),i.jsxs("button",{onClick:()=>si(ge),disabled:Ar===ge.id,className:"px-3 py-1.5 rounded-lg text-xs font-medium bg-indigo-600 hover:bg-indigo-500 text-white flex items-center gap-1.5 transition shadow disabled:opacity-50",title:"下载完整高保真 MP3 文件",children:[Ar===ge.id?i.jsx(qa,{className:"w-3.5 h-3.5 animate-spin"}):i.jsx(hS,{className:"w-3.5 h-3.5"}),"下载 MP3 ",ge.gcsUrl?"(GCS 高速)":""]})]}),i.jsxs("div",{className:"flex items-center gap-2",children:[ge.gcsUrl?i.jsxs("div",{className:"flex items-center gap-1",children:[i.jsxs("button",{onClick:()=>bi(ge.gcsSignedUrl||ge.gcsUrl,ge.id),className:"px-2.5 py-1.5 rounded-lg text-xs font-medium bg-emerald-950/80 hover:bg-emerald-900 text-emerald-300 border border-emerald-500/30 flex items-center gap-1 transition",title:"复制存储桶直链",children:[Y===ge.id?i.jsx(Co,{className:"w-3 h-3 text-emerald-400"}):i.jsx(Pm,{className:"w-3 h-3"}),Y===ge.id?"已复制直链":"复制 GCS 链接"]}),i.jsx("a",{href:ge.gcsSignedUrl||ge.gcsUrl,target:"_blank",rel:"noreferrer",className:"p-1.5 text-slate-400 hover:text-white transition",title:"在浏览器中打开 GCS 链接",children:i.jsx(Md,{className:"w-3.5 h-3.5"})})]}):i.jsxs("button",{onClick:()=>hl(ge),className:"px-2.5 py-1.5 rounded-lg text-xs font-medium bg-indigo-600/30 hover:bg-indigo-600/50 text-indigo-200 border border-indigo-500/40 flex items-center gap-1 transition",children:[i.jsx(kbe,{className:"w-3.5 h-3.5 text-indigo-400"}),ge.error?"重试上传到 aiseo-image/radio":"上传到 aiseo-image/radio"]}),i.jsx("button",{onClick:()=>Qn(ge.id),className:"p-1.5 rounded text-slate-500 hover:text-rose-400 hover:bg-rose-950/30 transition",title:"删除记录与本地文件",children:i.jsx(Fd,{className:"w-3.5 h-3.5"})})]})]})]},ge.id)})})]})]})]})})]})}const u$=[{id:"en-basic",label:"Basic English",lang:"en",isPro:!1},{id:"en-ielts",label:"Authentic 7.5+",lang:"en",isPro:!0},{id:"en-biz",label:"Business",lang:"en",isPro:!0},{id:"es-dele",label:"Spanish DELE B2",lang:"es",isPro:!0}],o_=(n,e)=>{if(!e||!e.word)return i.jsx("span",{children:n});const t=new RegExp(`(${e.word})`,"gi"),r=n.split(t);return i.jsx(i.Fragment,{children:r.map((s,a)=>s.toLowerCase()===e.word.toLowerCase()?i.jsxs("span",{className:"inline-flex items-center align-middle bg-emerald-50/80 dark:bg-emerald-500/10 border border-emerald-200 dark:border-emerald-500/20 px-1.5 py-0.5 mx-1 rounded-md cursor-pointer group hover:bg-emerald-100 dark:hover:bg-emerald-500/20 hover:border-emerald-300 dark:hover:border-emerald-500/40 transition-all duration-200",title:`${e.word}: ${e.translation}`,children:[i.jsx("span",{className:"text-[10px] font-bold bg-emerald-500 text-white px-1 py-0.5 rounded-sm mr-1.5 tracking-wider",children:e.tag}),i.jsx("span",{className:"font-semibold text-emerald-800 dark:text-emerald-300 text-base",children:s}),i.jsx(wW,{size:14,className:"ml-1 text-emerald-600 dark:text-emerald-400 opacity-0 group-hover:opacity-100 transition-opacity duration-200"})]},a):i.jsx("span",{children:s},a))})},G6e=["Arabic","Bengali","Bulgarian","Chinese (Simplified)","Chinese (Traditional)","Croatian","Czech","Danish","Dutch","English","Estonian","Finnish","French","German","Greek","Gujarati","Hebrew","Hindi","Hungarian","Indonesian","Italian","Japanese","K
4821annada","Korean","Latvian","Lithuanian","Malayalam","Marathi","Norwegian","Persian","Polish","Portuguese","Romanian","Russian","Serbian","Slovak","Slovenian","Spanish","Swahili","Swedish","Tamil","Telugu","Thai","Turkish","Ukrainian","Urdu","Vietnamese"];function $6e(){var Zl,of;const[n,e]=S.useState(()=>typeof window<"u"?window.location.pathname:"");if(S.useEffect(()=>{const Q=()=>{typeof window<"u"&&e(window.location.pathname)};return window.addEventListener("popstate",Q),()=>window.removeEventListener("popstate",Q)},[]),n.startsWith("/internal-radio-recorder"))return i.jsx(V6e,{});if(n.startsWith("/debug-pseo"))return i.jsx(e6e,{});if(n==="/blog"||n==="/blog/")return i.jsx(r6e,{});if(n==="/dashboard"||n==="/dashboard/")return i.jsx(l6e,{});if(n.startsWith("/blog/")){const Q=n.replace("/blog/","").replace(/\/$/,"");return i.jsx(n6e,{params:{slug:Q}})}if(n.startsWith("/embed"))return i.jsx(XFe,{});const{t,isZh:r}=Or(),[s,a]=S.useState(()=>typeof window<"u"&&localStorage.getItem("world_radio_dark_mode")==="true"),o=()=>{const Q=!s;a(Q),typeof window<"u"&&(localStorage.setItem("world_radio_dark_mode",String(Q)),Q?document.documentElement.classList.add("dark"):document.documentElement.classList.remove("dark"))},[l,c]=S.useState(()=>typeof window<"u"?new URLSearchParams(window.location.search).get("paywall")==="true":!1),[d,h]=S.useState(!1),m=n.replace(/\/$/,"");if(m==="/ielts-speaking-part-1-topics")return i.jsx(s_,{part:1,darkMode:s,onToggleDarkMode:o});if(m==="/ielts-speaking-part-2-topics")return i.jsx(s_,{part:2,darkMode:s,onToggleDarkMode:o});if(m==="/ielts-speaking-part-3-topics")return i.jsx(s_,{part:3,darkMode:s,onToggleDarkMode:o});if(m==="/ielts-speaking-topics-2026")return i.jsx(N6e,{darkMode:s,onToggleDarkMode:o});if(m==="/french-listening-practice")return i.jsx(_6e,{darkMode:s,onToggleDarkMode:o});if(["/ielts-speaking-mock-test","/ielts-speaking-simulation","/ielts-mock-test","/ielts-speaking","/ielts","/examiner"].includes(m))return i.jsx(l$,{onBackToRadio:()=>{window.location.href="/"},activeStationName:"BBC World Service",darkMode:s,onToggleDarkMode:o,onOpenPaywall:()=>c(!0),isAuthModalOpen:d,onOpenAuthModal:()=>h(!0),onCloseAuthModal:()=>h(!1)});if(n==="/learn-spanish"||n==="/learn-spanish/")return i.jsx(j6e,{darkMode:s,onToggleDarkMode:o,onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0)});if(["/spanish-pronunciation","/spanish-alphabet-pronunciation","/spanish-pronunciation-guide","/how-to-roll-rr-in-spanish","/spanish-accent-rules","/spanish-phonetics"].includes(n.replace(/\/$/,"")))return i.jsx(O6e,{darkMode:s,onToggleDarkMode:o,onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0)});if(m==="/how-to-order-food-in-spanish")return i.jsx(F6e,{darkMode:s,onToggleDarkMode:o,onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0)});if(m==="/how-to-introduce-yourself-in-spanish")return i.jsx(U6e,{darkMode:s,onToggleDarkMode:o,onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0)});if(["/nice-to-meet-you-in-spanish","/spanish-conversation-starters"].includes(m))return i.jsx(M6e,{darkMode:s,onToggleDarkMode:o,onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0)});const v=(Q,De)=>{switch(Q){case"en-basic":return t.app.dictBasic;case"en-ielts":return t.app.dictIelts;case"en-biz":return t.app.dictBiz;case"es-dele":return t.app.dictDele;default:return De}},[B,E]=S.useState(()=>typeof window<"u"&&localStorage.getItem("ai_word_active_track")||"live"),N=Q=>{E(Q),typeof window<"u"&&localStorage.setItem("ai_word_active_track",Q)},[T,k]=S.useState("explore");S.useEffect(()=>{if(typeof window<"u")try{localStorage.removeItem("ai_word_view_mode")}catch{}},[]);const[P,R]=S.useState(!1),[_,I]=S.useState(()=>{if(typeof window<"u"){const Q=new URLSearchParams(window.location.search);return Q.get("examiner")==="true"||Q.get("openExaminer")==="true"}return!1}),[D,j]=S.useState(null),[O,M]=S.useState({vocabCount:0,shadowCount:0}),[U,ee]=S.useState(!1),[ie,G]=S.useState("All"),[Z,z]=S.useState("All"),[se,re]=S.useState("All"),[H,Y]=S.useState("All"),de=S.useMemo(()=>PC.filter(Q=>!(ie!=="All"&&Q.language!==ie||Z!=="All"&&Q.difficulty!==Z||se!=="All"&&Q.vocabCoverage!==se||H!=="All"&&Q.sophistication!==H)),[ie,Z,se,H]),[W,K]=S.useState(null),[J,oe]=S.useState(!1),[Ie,pe]=S.useState(!1),[ye,he]=S.useState(null),[le,ce]=S.useState(!1),[Ce,Ae]=S.useState(null),[je,nt]=S.useState("single"),[We,dt]=S.useState(!1),[bt,Yt]=S.useState(!1),[Gt,En]=S.useState(!1),[$t,ds]=S.useState(!1),[sa,Fa]=S.useState(""),[Mr,es]=S.useState(0),[us,Vs]=S.useState(10),[Xi,ts]=S.useState([]),[Fr,As]=S.useState(null),[Qn,hl]=S.useState(null),xa=S.useRef(null),Zi=S.useRef([]),Ur=S.useRef(null),ks=S.useRef(null);S.useEffect(()=>{he(null),pe(!1)},[W]);const[Bn,Ar]=S.useState(null),[Pn,aa]=S.useState(null),si=S.useRef(null),bi=S.useRef([]),hs=S.useRef(!1),ba=S.useRef(!1),fl=S.useRef(null),Jn=S.useRef(!1);S.useEffect(()=>{hs.current=J},[J]),S.useEffect(()=>{ba.current=Ie},[Ie]),S.useEffect(()=>{fl.current=W},[W]);const[ge,et]=S.useState(null),[xe,wn]=S.useState(null),[ht,mn]=S.useState(!1),[ya,Xn]=S.useState(!1),[Sn,va]=S.useState(()=>{if(typeof window<"u"){const Q=new URLSearchParams(window.location.search),De=Q.get("lang");if(De)return De.toLowerCase();const at=localStorage.getItem("radioshadow_selected_language");if(at)return at;if(Q.get("lat")&&Q.get("lng"))return"english"}return null}),In=S.useMemo(()=>Sn&&M0.find(Q=>Q.id===Sn||Q.code===Sn||Q.name.toLowerCase()===Sn.toLowerCase())||null,[Sn]),yr=Q=>{va(Q.id),typeof window<"u"&&localStorage.setItem("radioshadow_selected_language",Q.id),fs(Q.coords),et(Q.defaultProfile),wn(Q.defaultStation),pl(Q.targetLang),setTimeout(()=>{const De=document.getElementById("step2-radio-explorer");De&&De.scrollIntoView({behavior:"smooth",block:"start"})},120)}
4821,[kr,fs]=S.useState(null),[ns,Io]=S.useState(500),[Ba,Ns]=S.useState(!1),[or,yi]=S.useState(u$[0]),[vr,ml]=S.useState(null),[Kl,ai]=S.useState(!1),{user:qt,userProfile:uu,isPro:ms}=Ji(),[wa,Ua]=S.useState(!1),[Wl,ps]=S.useState("welcome"),[lr,Vr]=S.useState(!1),vi=S.useRef(0),[Va,pn]=S.useState(()=>Eh());S.useEffect(()=>{const Q=De=>{pn(De.detail||Eh())};return window.addEventListener("diagnostic-assessment-updated",Q),()=>window.removeEventListener("diagnostic-assessment-updated",Q)},[]),S.useEffect(()=>{if(typeof window>"u")return;try{if(sessionStorage.getItem("radioshadow_calibration_dismissed")==="true"||Va)return}catch{return}const Q=setInterval(()=>{ht&&xe&&!wa&&!lr&&(vi.current+=1,vi.current>=25&&(Vr(!0),clearInterval(Q)))},1e3);return()=>clearInterval(Q)},[ht,xe,wa,lr,Va]);const[Bi,Ca]=S.useState(!1),wi=S.useRef(!1);S.useEffect(()=>{if(typeof window<"u"){const De=new URLSearchParams(window.location.search);(De.get("tour")==="1"||De.get("tour")==="true")&&Ua(!0),(De.get("embed")==="1"||De.get("embed")==="true")&&R(!0)}if(!ZG())return;if(typeof window<"u"){const De=new URLSearchParams(window.location.search);if(De.get("station")||De.get("stationId")||De.get("station_id")){wi.current=!0;return}}if(wi.current)return;wi.current=!0;const Q=setTimeout(()=>{Ca(!0)},600);return()=>clearTimeout(Q)},[]);const[Br,eo]=S.useState(()=>{const Q=new Set;try{if(typeof window<"u"){const De=localStorage.getItem("ai_shadowing_last_user_id"),at=De?`ai_shadowing_bookmarks_${De}`:"ai_shadowing_bookmarks_guest",qe=localStorage.getItem(at);qe&&JSON.parse(qe).forEach(Nt=>{Nt.originalText&&Q.add(Nt.originalText)})}}catch{}return Q}),[Yl,tt]=S.useState(null);S.useEffect(()=>{if(qt!=null&&qt.uid)try{localStorage.setItem("ai_shadowing_last_user_id",qt.uid);const Q=vo(qs(fn,"saved_sentences"),Dl("userId","==",qt.uid));Bc(Q).then(De=>{const at=De.docs.map(it=>({id:it.id,...it.data()}));let qe=[];try{const it=localStorage.getItem(`ai_shadowing_bookmarks_${qt.uid}`);it&&(qe=JSON.parse(it))}catch{}const kt=new Map;qe.forEach(it=>{it.originalText&&kt.set(it.originalText,it)}),at.forEach(it=>{it.originalText&&kt.set(it.originalText,it)});const Nt=Array.from(kt.values());localStorage.setItem(`ai_shadowing_bookmarks_${qt.uid}`,JSON.stringify(Nt)),eo(new Set(Nt.map(it=>it.originalText)))}).catch(De=>{console.warn("Firestore fetch bookmarks error:",De)})}catch{}},[qt]);const ft=async(Q,De="",at="EN")=>{if(!qt){h(!0);return}const qe=qt.uid;if(Br.has(Q)){eo(Nt=>{const it=new Set(Nt);return it.delete(Q),it});try{const Nt=localStorage.getItem(`ai_shadowing_bookmarks_${qe}`);if(Nt){const it=JSON.parse(Nt).filter(_t=>_t.originalText!==Q);localStorage.setItem(`ai_shadowing_bookmarks_${qe}`,JSON.stringify(it))}}catch{}tt("Removed from Bookmarks / 已取消收藏"),setTimeout(()=>tt(null),2500);try{const Nt=vo(qs(fn,"saved_sentences"),Dl("userId","==",qe),Dl("originalText","==",Q));(await Bc(Nt)).docs.forEach(async _t=>{await hm(qi(fn,"saved_sentences",_t.id))})}catch(Nt){console.warn("Firestore delete bookmark warning:",Nt)}}else{eo(it=>{const _t=new Set(it);return _t.add(Q),_t});const Nt={id:"bm_"+Date.now(),userId:qe,originalText:Q,translatedText:De,language:at||(xe==null?void 0:xe.language)||"EN",savedAt:new Date().toISOString()};try{let it=[];const _t=localStorage.getItem(`ai_shadowing_bookmarks_${qe}`);_t&&(it=JSON.parse(_t)),it=[Nt,...it.filter(ia=>ia.originalText!==Q)],localStorage.setItem(`ai_shadowing_bookmarks_${qe}`,JSON.stringify(it))}catch{}tt("Saved to Bookmarks!"),setTimeout(()=>tt(null),2500);try{await Kf(qs(fn,"saved_sentences"),{userId:qe,originalText:Q,translatedText:De,language:at||(xe==null?void 0:xe.language)||"EN",savedAt:Sd()})}catch(it){console.error("Error saving bookmark to Firestore:",it)}}};S.useEffect(()=>{if(!ZG()){const Q=setTimeout(()=>{Ua(!0)},700);return()=>clearTimeout(Q)}},[]);const[yt,lt]=S.useState(!1),[Ln,Dn]=S.useState(0);S.useRef(0);const[Rt]=S.useState(()=>new f6e),[Et,Gr]=S.useState({status:"idle",error:null,userTranscript:"",modelTranscript:""}),[Yr,pl]=S.useState("English"),[Qc,Ci]=S.useState(!1),Jc=S.useRef(null),[Ut,Ei]=S.useState([]);S.useEffect(()=>{Rt.onTurnComplete=Q=>{Ei(De=>{const at={id:Q.id||crypto.randomUUID(),originalText:Q.originalText||"...",translatedText:Q.translatedText||"...",focusVocab:Q.focusVocab};return[...De.slice(-19),at]}),Dn(De=>yt?De+1:0)}},[Rt,yt]),S.useEffect(()=>{const Q=Ut.filter(De=>De.focusVocab).length;M(De=>De.vocabCount!==Q?{...De,vocabCount:Q}:De)},[Ut]);const Si=S.useRef(null),Ql=S.useRef(!1);S.useEffect(()=>{if(ms||d||Ql.current)return;const Q=Ut.length>=10,De=O.shadowCount>=1;
4821if(!l&&(Q||De)){const at=setTimeout(()=>{d||ms||(Ql.current=!0,c(!0),lt(!0),r_("paywall_view",{reason:Q?"sentence_limit_reached":"shadowing_completed",displayed_subtitles_count:Ut.length}),Rt.getLiveState().status==="connected"&&(Rt.disconnect(),Gr(Rt.getLiveState())))},1500);return()=>clearTimeout(at)}},[ms,l,d,Ut.length,O.shadowCount]),S.useEffect(()=>{(async()=>{try{const De=await fetch(`/dictionaries/${or.id}.txt`);if(!De.ok)throw new Error("Dictionary not found");const at=await De.text(),qe=FLe(at,or.label);ml(qe)}catch(De){console.warn(`[Vocab] Failed to load dictionary: ${or.id}.txt`,De),ml(null)}})()},[or.id]),S.useEffect(()=>{Rt.setVocabDictionary(vr)},[vr,Rt]);const hu=Q=>{ai(!1),Q.isPro&&!ms?c(!0):yi(Q)};S.useEffect(()=>{var Q;T==="theater"&&!yt&&((Q=Si.current)==null||Q.scrollIntoView({behavior:"smooth"}))},[Ut,T,yt]);const gl=async()=>{var Q;if(typeof navigator<"u"&&((Q=navigator==null?void 0:navigator.mediaDevices)!=null&&Q.getUserMedia))try{return{stream:await navigator.mediaDevices.getUserMedia({audio:{echoCancellation:!0,noiseSuppression:!0,autoGainControl:!0}}),isVirtual:!1}}catch(De){if(console.warn("Real microphone access attempt:",De==null?void 0:De.name,De==null?void 0:De.message),(De==null?void 0:De.name)==="NotAllowedError"||(De==null?void 0:De.name)==="PermissionDeniedError")throw De;try{const at=window.AudioContext||window.webkitAudioContext;if(at){const qe=new at;qe.state==="suspended"&&await qe.resume();const kt=qe.createMediaStreamDestination(),Nt=qe.createOscillator(),it=qe.createGain();return it.gain.value=1e-5,Nt.connect(it),it.connect(kt),Nt.start(),{stream:kt.stream,isVirtual:!0}}}catch(at){console.warn("Synthetic audio fallback creation error:",at)}throw De}throw new Error(r?"当前浏览器环境不支持麦克风 API。":"Microphone API is not supported in this browser environment.")},Ti=async()=>{try{Ar(null),M(qe=>({...qe,shadowCount:qe.shadowCount+1}));const{stream:Q,isVirtual:De}=await gl();De&&Ar(r?"未检测到麦克风硬件,已开启模拟示范模式。":"No hardware mic detected. Running in simulated demo mode.");const at=new MediaRecorder(Q);si.current=at,bi.current=[],at.ondataavailable=qe=>{qe.data.size>0&&bi.current.push(qe.data)},at.onstop=async()=>{const qe=new Blob(bi.current,{type:"audio/webm"});if(aa(qe),Q.getTracks().forEach(kt=>kt.stop()),W){pe(!0);try{const kt=new FormData;kt.append("audio",qe,"recording.webm"),kt.append("targetSentence",W.originalText),kt.append("language",(xe==null?void 0:xe.language)||"en");const Nt=await fetch("/api/evaluate",{method:"POST",body:kt}),it=Nt.headers.get("content-type");if(!Nt.ok||!it||!it.includes("application/json")){const to=await Nt.text();throw console.error("Evaluation response non-JSON or error status:",Nt.status,to),new Error(`Evaluation service status: ${Nt.status}`)}const _t=await Nt.json();he(_t);const ia=URL.createObjectURL(qe),Zc={evaluationResult:_t,targetSentence:W.originalText,translatedSentence:W.translatedText,userAudioUrl:ia,nativeAudioUrl:null,stationName:(xe==null?void 0:xe.name)||"Global Live Radio",language:(xe==null?void 0:xe.language)||"English"};if(Ae(Zc),ce(!0),qt&&W)try{const to=qt.uid;await Kf(qs(fn,"evaluation_history"),{userId:to,originalText:W.originalText,translatedText:W.translatedText||"",score:_t.overallScore??(_t.estimatedBand?Math.round(_t.estimatedBand*11):82),estimatedBand:_t.estimatedBand||7.5,cefrLevel:_t.cefrLevel||"C1 Advanced Flow",radarMetrics:_t.radarMetrics||[],wordAnalysis:_t.wordAnalysis||[],phoneticFeedback:_t.phoneticFeedback||"",stationName:(xe==null?void 0:xe.name)||"Global Live Radio",language:(xe==null?void 0:xe.language)||"English",evaluatedAt:Sd()})}catch(to){console.error("Error saving evaluation history to Firestore:",to)}}catch(kt){console.error("Evaluation failed:",kt),Ar(r?"AI 发音评估服务暂时不可用,请稍后重试。":"AI evaluation temporarily unavailable. Please try again in a moment.")}finally{pe(!1)}}},at.start(),oe(!0)}catch(Q){console.error("Error accessing microphone:",Q),Q.name==="NotFoundError"||Q.message&&Q.message.includes("Requested device not found")?Ar(r?"未检测到麦克风设备。请连接麦克风以使用实时跟读测评。":"No microphone detected. Please connect a mic to use live speech evaluation."):Q.name==="NotAllowedError"||Q.name==="PermissionDeniedError"?Ar(r?"麦克风权限被拒绝。请在浏览器设置中允许麦克风权限。":"Microphone access denied. Please allow permissions in your browser settings."):Ar(r?"无法获取麦克风。请检查浏览器和系统设备设置。":"Unable to access microphone. Please check your system settings.")}},Ai=()=>{const Q={evaluationResult:{overallScore:84,estimatedBand:7.5,cefrLevel:"C1 Advanced Flow",framework:"CEFR / Spoken Fluency Standard",radarMetrics:[{metric:r?"流利度 (Fluency)":"Fluency",value:88},{metric:r?"准确度 (Accuracy)":"Accuracy",value:81},{metric:r?"完整度 (Completeness)":"Completeness",value:85}],phoneticFeedback:r?"整体发音节奏非常自然,咬音清晰度较高!建议注意 'drones' 中的连读节奏与 /r/ 颤音弱化。":"Natural cadence with strong articulation. Pay attention to word linking in 'drones' and soft /r/ reduction.",problemWords:["drones","deliveries"],wordAnalysis:[{word:"The",status:"correct",ipa:"/ðə/",errorAnalysis:null},{word:"autonomous",status:"correct",ipa:"/ɔːˈtɒn.ə.məs/",errorAnalysis:null},{word:"drones",status:"error",ipa:"/drəʊnz/",errorAnalysis:r?"'drones' 中的 /r/ 辅音过度紧绷,且未与后面的动词产生自然连读 (liaison)。":"'drones' /r/ phoneme was overly tense and failed to soft-link."},{word:"are",status:"correct",ipa:"/ɑːr/",errorAnalysis:null},{word:"executing",status:"minor_deviation",ipa:"/ˈek.sɪ.kjuː.tɪŋ/",errorAnalysis:r?"'executing' 第三音节重音微弱,元音偏沉。":"Slightly muted pitch on the 3rd syllable of 'executing'."},{word:"overnight",status:"correct",ipa:"/ˌəʊ.vəˈnaɪt/",errorAnalysis:null},{word:"deliveries",status:"minor_deviation",ipa:"/dɪˈlɪv.ər.iz/",errorAnalysis:r?"'deliveries' 结尾复数 /z/ 音误读为无声 /s/。":"End consonant /z/ sounded like unvoiced /s/."},{word:"smoothly.",status:"correct",ipa:"/ˈsmuːð.li/",errorAnalysis:null}]},targetSentence:(W==null?void 0:W.originalText)||"The autonomous drones are executing overnight deliveries smoothly.",translatedSentence:(W==null?void 0:W.translatedText)||"自主无人机正在顺畅地执行夜间配送任务。",userAudioUrl:null,nativeAudioUrl:null,stationName:(xe==null?void 0:xe.name)||"BBC World News Radio",language:(xe==null?void 0:xe.language)||"English"};Ae(Q),ce(!0)},Jl=()=>{if(si.current&&si.current.state!=="inactive")try{si.current.stop()}catch(Q){console.error("Error stopping mediaRecorder:",Q)}oe(!1)},On=()=>
4821{if(!ba.current)if(hs.current)Jl();else{if(!fl.current){Ar(r?"请先在左侧广播转写中点击选择要跟读的句子。":"Please select a sentence from the live broadcast transcript first.");return}Ti()}};S.useEffect(()=>{const Q=at=>{if(at.code!=="Space"&&at.key!==" "&&at.key!=="Spacebar")return;const qe=document.activeElement;if(qe){const kt=qe.tagName.toUpperCase();if(kt==="INPUT"||kt==="TEXTAREA"||kt==="SELECT"||qe.isContentEditable)return}Bi||We||d||P||D!==null||wa||l||(at.preventDefault(),!(at.repeat||Jn.current)&&(Jn.current=!0,fl.current&&(ba.current||hs.current||Ti())))},De=at=>{if(at.code!=="Space"&&at.key!==" "&&at.key!=="Spacebar")return;const qe=document.activeElement;if(qe){const kt=qe.tagName.toUpperCase();if(kt==="INPUT"||kt==="TEXTAREA"||kt==="SELECT"||qe.isContentEditable)return}at.preventDefault(),Jn.current=!1,hs.current&&Jl()};return window.addEventListener("keydown",Q),window.addEventListener("keyup",De),()=>{window.removeEventListener("keydown",Q),window.removeEventListener("keyup",De)}},[Bi,We,d,P,D,wa,l]),S.useEffect(()=>{Gt&&Ut.length>0&&ts(Ut)},[Ut,Gt]);const ii=async()=>{Ur.current&&(clearInterval(Ur.current),Ur.current=null),!(!xa.current||!Gt)&&(mn(!1),Rt.getLiveState().status==="connected"&&(Rt.disconnect(),Gr(Rt.getLiveState())),En(!1),ds(!0),Fa(r?"正在捕获跟读音频并整理会话转写...":"Capturing audio tracks and compiling session transcript..."),xa.current.onstop=async()=>{try{ks.current&&(ks.current.getTracks().forEach(_t=>_t.stop()),ks.current=null);const Q=new Blob(Zi.current,{type:"audio/webm"});hl(Q),Fa(r?"正在将跟读语音与广播原声智能对齐,诊断声学与语调细节...":"Aligning speech with live broadcast & diagnosing phonetic issues...");const De=new FormData;De.append("audio",Q,"continuous_shadowing.webm");const at=Xi.length>0?Xi:Ut;De.append("broadcastSentences",JSON.stringify(at)),De.append("stationName",(xe==null?void 0:xe.name)||"Global Radio Broadcast"),De.append("language",(xe==null?void 0:xe.language)||"English"),De.append("durationSeconds",String(Mr||30));const qe=await fetch("/api/evaluate-continuous",{method:"POST",body:De}),kt=qe.headers.get("content-type");if(!qe.ok||!kt||!kt.includes("application/json")){const _t=await qe.text();throw console.error("Continuous evaluation response non-JSON or error status:",qe.status,_t),new Error(`Continuous evaluation service status: ${qe.status}`)}const Nt=await qe.json(),it=Nt.analysis||Nt;if(it&&(it.overallBand||it.overallScore||it.sentences)){const _t={id:`notebook_${Date.now()}`,userId:(qt==null?void 0:qt.uid)||"guest",stationName:(xe==null?void 0:xe.name)||"Global Radio",stationCountry:(xe==null?void 0:xe.country)||"Global",language:(xe==null?void 0:xe.language)||"English",durationSeconds:Mr||30,targetLimitMinutes:us||10,overallBand:Number(it.overallBand||it.estimatedBand||7.5),overallScore:Number(it.overallScore||80),radarMetrics:it.radarMetrics||[{metric:"Pronunciation",value:80},{metric:"Fluency",value:75},{metric:"Accuracy",value:82},{metric:"Pacing",value:78},{metric:"Coverage",value:85}],fluencyScore:Number(it.fluencyScore||75),pacingSyncRate:Number(it.pacingSyncRate||80),coverageScore:Number(it.coverageScore||85),summaryFeedback:it.summaryFeedback||(r?"连续跟读整体表现良好,节奏稳定。":"Good overall continuous shadowing performance."),problemWordsCount:it.problemWordsCount||(it.keyProblemWords?it.keyProblemWords.length:0),totalSentencesCount:it.totalSentencesCount||(it.sentences?it.sentences.length:at.length),sentences:it.sentences||[],keyProblemWords:it.keyProblemWords||[],actionableTips:it.actionableTips||[],createdAt:new Date().toISOString()};if(qt!=null&&qt.uid)try{await Kf(qs(fn,"shadowing_notebooks"),{..._t,createdAt:Sd()})}catch(ia){console.error("Error saving shadowing notebook to Firestore:",ia)}try{const ia=JSON.parse(localStorage.getItem("shadowing_notebooks_cache")||"[]");ia.unshift(_t),localStorage.setItem("shadowing_notebooks_cache",JSON.stringify(ia.slice(0,30)))}catch{}As(_t)}else throw new Error(r?"服务器未返回诊断结果":"No analysis returned by server")}catch(Q){console.error("Continuous evaluation error:",Q),alert(r?"连续跟读评估发生错误:"+(Q.message||"未知错误"):"Continuous shadowing evaluation encountered an error: "+(Q.message||"Unknown"))}finally{ds(!1),Yt(!1),es(0)}},xa.current.stop())},rf=async Q=>{if(!ms){c(!0);return}try{Ar(null);const{stream:De,isVirtual:at}=await gl();ks.current=De;
4821const qe=new MediaRecorder(De);xa.current=qe,Zi.current=[],qe.ondataavailable=kt=>{kt.data.size>0&&Zi.current.push(kt.data)},qe.start(1e3),En(!0),Yt(!0),Vs(Q),es(0),ts(Ut),at&&console.info("Virtual audio stream fallback activated for continuous shadowing."),!ht&&xe&&mn(!0),Ur.current&&clearInterval(Ur.current),Ur.current=setInterval(()=>{es(kt=>{const Nt=kt+1,it=Math.min(Q*60,1800);return Nt>=it&&ii(),Nt})},1e3)}catch(De){console.error("Continuous mic access failed:",De),De.name==="NotFoundError"||De.message&&De.message.includes("Requested device not found")?alert(r?"未检测到麦克风输入设备。请连接耳机或麦克风后重试。":"No microphone input device detected. Please connect a headset or microphone."):De.name==="NotAllowedError"||De.name==="PermissionDeniedError"?alert(r?"麦克风使用权限被拒绝。请在浏览器地址栏或系统设置中允许麦克风权限。":"Microphone permission was denied. Please allow microphone access in your browser settings."):alert(r?"麦克风权限无法初始化:"+(De.message||"请检查浏览器权限"):"Microphone access could not be initialized: "+(De.message||"Check browser permissions"))}},xl=()=>{Ur.current&&(clearInterval(Ur.current),Ur.current=null),xa.current&&xa.current.state!=="inactive"&&xa.current.stop(),ks.current&&(ks.current.getTracks().forEach(Q=>Q.stop()),ks.current=null),En(!1),Yt(!1),es(0)},sf=()=>{Rt.disconnect(),Gr(Rt.getLiveState())},Xc=async()=>{if(!xe)return;const Q=Rt.getLiveState().status;ht&&(Q==="connected"||Q==="connecting")?(sf(),T==="theater"&&k("explore")):(k("theater"),lt(!1),Dn(0),mn(!0),await Rt.connect(Yr,De=>{console.log("🔴 [Stream Probe] 当前 isStreaming 状态:",De.status==="connected"),Gr({...De})},xe.language))},bl=Q=>{pl(Q),Ni.current=Q;const De=Rt.getLiveState().status;(De==="connected"||De==="connecting")&&(console.log(`[Stream Switch Language] Switching targetLanguage to "${Q}"...`),Rt.disconnect(),lt(!1),Dn(0),Rt.connect(Q,qe=>{Gr({...qe})},xe==null?void 0:xe.language).catch(qe=>{console.error("Failed to reconnect stream with updated language:",qe)}))},ki=()=>{if(Ut.length===0&&!Et.userTranscript&&!Et.modelTranscript)return;let Q=`=== World Radio Translator Transcript ===
4822`;Q+=`Target Language Selected: ${Yr}
4823`,Q+=`Date: ${new Date().toLocaleDateString()}
4824
4825`,Ut.forEach((De,at)=>{Q+=`[Turn ${at+1}]
4826`,Q+=`Captured Audio (Original): ${De.originalText}
4827`,Q+=`Interpreter (${Yr}): ${De.translatedText}
4828
4829`}),Et.userTranscript&&(Q+=`[*Live Decoding*] Captured Audio (Original):
4830${Et.userTranscript}
4831
4832`),Et.modelTranscript&&(Q+=`[*Live Decoding*] Interpreter (${Yr}):
4833${Et.modelTranscript}
4834
4835`),navigator.clipboard.writeText(Q).then(()=>{Ci(!0),setTimeout(()=>Ci(!1),2e3)})},Gs=()=>{if(Ut.length===0&&!Et.userTranscript&&!Et.modelTranscript)return;let Q=`=== World Radio Translator Transcript ===
4836`;Q+=`Target Language Selected: ${Yr}
4837`,Q+=`Date: ${new Date().toLocaleDateString()}
4838
4839`,Ut.forEach((kt,Nt)=>{Q+=`[Turn ${Nt+1}]
4840`,Q+=`Captured Audio (Original): ${kt.originalText}
4841`,Q+=`Interpreter (${Yr}): ${kt.translatedText}
4842
4843`});const De=new Blob([Q],{type:"text/plain;charset=utf-8"}),at=URL.createObjectURL(De),qe=document.createElement("a");qe.href=at,qe.download=`world_radio_translation_transcript_${Date.now()}.txt`,document.body.appendChild(qe),qe.click(),document.body.removeChild(qe),URL.revokeObjectURL(at)},Do=()=>{Rt.clearHistory(),Gr(Rt.getLiveState()),Ei([])};S.useEffect(()=>{if(Jc.current&&!yt){const Q=Jc.current;Q.scrollTo({top:Q.scrollHeight,behavior:"smooth"})}},[Ut,Et.userTranscript,Et.modelTranscript,yt]),S.useEffect(()=>()=>{Rt.disconnect()},[Rt]),S.useEffect(()=>{Rt.setPracticeMode(yt)},[yt,Rt]);const Ni=S.useRef(Yr);S.useEffect(()=>{const Q=Rt.getLiveState().status,De=Q==="connected"||Q==="connecting",at=Ni.current!==Yr;Ni.current=Yr,at&&De?(console.log(`[Stream Reconnect] Reconnecting stream for targetLanguage="${Yr}"...`),Rt.disconnect(),lt(!1),Dn(0),Rt.connect(Yr,qe=>{Gr({...qe})},xe==null?void 0:xe.language).catch(qe=>{console.error("Failed to reconnect stream with updated config:",qe)})):ht?ht&&T==="theater"&&!De&&xe&&(lt(!1),Dn(0),Rt.connect(Yr,qe=>{Gr({...qe})},xe.language).catch(qe=>{console.error("Failed to resume stream:",qe)})):De&&(Rt.disconnect(),Gr(Rt.getLiveState()))},[ht,T,xe,Yr,Rt]),S.useEffect(()=>{const Q=window.document.documentElement;s?Q.classList.add("dark"):Q.classList.remove("dark"),localStorage.setItem("world_radio_dark_mode",String(s))},[s]),S.useEffect(()=>{const Q=new URLSearchParams(window.location.search),De=Q.get("station")||Q.get("stationId")||Q.get("station_id"),at=Q.get("lang")||Q.get("language");if(De||at){const gs=(De||"").toLowerCase(),Vn=(at||"").toLowerCase(),yl=ci.find(Gn=>{var Ea,w,L;return De&&(Gn.id&&Gn.id.toLowerCase()===gs||Gn.stationuuid&&Gn.stationuuid.toLowerCase()===gs||Gn.name&&Gn.name.toLowerCase().includes(gs)||Gn.country&&Gn.country.toLowerCase()===gs||Gn.countrycode&&Gn.countrycode.toLowerCase()===gs)||at&&(Vn.startsWith("fr")&&(Gn.id==="fr-franceinfo"||((Ea=Gn.language)==null?void 0:Ea.toLowerCase().startsWith("fr")))||Vn.startsWith("es")&&(Gn.id==="es-rne"||((w=Gn.language)==null?void 0:w.toLowerCase().startsWith("es")))||Vn.startsWith("en")&&(Gn.id.startsWith("en-")||((L=Gn.language)==null?void 0:L.toLowerCase().startsWith("en"))))});if(yl){wn(yl),k("theater"),mn(!0),lt(!1),Dn(0);let Gn={lat:46.2276,lng:2.2137};const Ea=yl.id||yl.stationuuid||"",w=yl.countrycode||yl.country||"";w.toUpperCase()==="ES"||Ea.startsWith("es-")||w.toLowerCase()==="spain"?Gn={lat:40.4168,lng:-3.7038}:w.toUpperCase()==="GB"||w.toUpperCase()==="UK"||Ea.startsWith("en-bbc")?Gn={lat:51.5074,lng:-.1278}:w.toUpperCase()==="US"||Ea.startsWith("en-npr")?Gn={lat:38.9072,lng:-77.0369}:(w.toUpperCase()==="DE"||Ea.startsWith("de-"))&&(Gn={lat:52.52,lng:13.405}),fs(Gn),Io(500),Xn(!0),jo(Gn.lat,Gn.lng,500).then(L=>{et(L),Xn(!1)});return}}const qe=Q.get("lat"),kt=Q.get("lng"),Nt=Q.get("radius");let it=null,_t=null,ia=null;if(typeof window<"u")try{const gs=localStorage.getItem("world_radio_last_location");if(gs){const Vn=JSON.parse(gs);typeof Vn.lat=="number"&&!isNaN(Vn.lat)&&typeof Vn.lng=="number"&&!isNaN(Vn.lng)&&(it=Vn.lat,_t=Vn.lng,typeof Vn.radius=="number"&&!isNaN(Vn.radius)&&
4843(ia=Vn.radius))}}catch(gs){console.warn("Failed to parse saved location from localStorage:",gs)}const Zc=qe?parseFloat(qe):it!==null?it:46.2276,to=kt?parseFloat(kt):_t!==null?_t:2.2137,lf=Nt?parseInt(Nt,10):ia!==null?ia:500;fs({lat:Zc,lng:to}),Io(lf),Xn(!0),jo(Zc,to,lf).then(gs=>{et(gs),Xn(!1)})},[]);const jo=async(Q,De,at)=>{const qe={country:"France",countryCode:"FR",countryCodes:["FR","DE","GB","CH"],language:"French",capital:"Paris",description:"A genuine broadcast region in France. This channel showcases local cultural news, authentic linguistic features, and contemporary melodies.",nativeGreeting:"Bonjour",genres:["Chanson Française","Contemporary Pop","Indie Rock"]},kt=2;for(let Nt=0;Nt<=kt;Nt++)try{const it=await fetch("/api/geocode",{method:"POST",headers:{"Content-Type":"application/json"},body:JSON.stringify({lat:Q,lng:De,radiusKm:at})});if(it.ok){const _t=await it.json();if(_t&&_t.country)return _t}}catch{Nt<kt&&await new Promise(_t=>setTimeout(_t,500*(Nt+1)))}return qe};S.useEffect(()=>{if(kr&&typeof window<"u")try{localStorage.setItem("world_radio_last_location",JSON.stringify({lat:kr.lat,lng:kr.lng,radius:ns}))}catch(Q){console.warn("Failed to save location to localStorage:",Q)}},[kr,ns]);const fu=async(Q,De,at)=>{Xn(!0);try{const qe=await jo(Q,De,at);et(qe)}catch(qe){console.warn("Geocoding query notice:",qe)}finally{Xn(!1)}},Xl=Q=>{fs(Q),fu(Q.lat,Q.lng,ns)},mu=()=>{kr&&fu(kr.lat,kr.lng,ns)};S.useEffect(()=>{if(T==="immersion"){const Q=Rt.getLiveState().status;(Q==="connected"||Q==="connecting")&&(Rt.disconnect(),Gr(Rt.getLiveState()))}},[T]);const oi=Q=>{T!=="immersion"&&k("theater");const De=Et.status==="connected"||Et.status==="connecting";Rt.clearHistory(),Gr(Rt.getLiveState()),De&&(Rt.disconnect(),Gr(Rt.getLiveState())),wn(Q),mn(!0),De&&T!=="immersion"&&setTimeout(()=>{lt(!1),Dn(0),Rt.connect(Yr,at=>{Gr({...at})},Q.language)},600)},pu=()=>{k("theater");let Q=Ut.length>0?Ut[Ut.length-1]:null;Q||(Q={id:Date.now().toString(),originalText:xe?`Authentic radio broadcast stream captured live from ${xe.name}.`:"The quick brown fox jumps over the lazy dog.",translatedText:r?"来自广播直播流的最新抓取语音片段(按需 AI 唤醒)":"Captured broadcast sentence segment for practice"},Ei(qe=>[...qe,Q])),K(Q),lt(!0);const De=Rt.getLiveState().status;ht&&!(De==="connected"||De==="connecting")&&xe&&Rt.connect(Yr,qe=>{Gr({...qe})},xe.language).catch(qe=>{console.error("Failed to connect live client on Catch & Practice:",qe)})},af={"@context":"https://schema.org","@graph":[{"@type":"WebSite","@id":"https://radioshadow.space/#website",url:"https://radioshadow.space",name:"Global Radio Shadowing SaaS",description:"Live global radio streaming with real-time AI-powered pronunciation shadowing."},{"@type":"RadioStation","@id":xe?`https://radioshadow.space/#station-${xe.id}`:"https://radioshadow.space/#default-station",name:xe?xe.name:"Global Broadcast Radio",url:"https://radioshadow.space",description:xe?`Listen to live broadcast radio from ${xe.name} and practice pronunciation with real-time AI feedback.`:"Listen to live broadcast radio stations globally and practice pronunciation.",genre:xe?xe.category:"News, Culture, Talk",inLanguage:xe?xe.language:"en, fr, es, de"},...xe?[{"@type":"AudioObject","@id":`https://radioshadow.space/#stream-${xe.id}`,name:`${xe.name} Live Stream`,description:`Live audio broadcast from ${xe.name} used for real-time language shadowing.`,contentUrl:xe.streamUrl,encodingFormat:"audio/mpeg"}]:[]]};return i.jsxs("div",{className:`min-h-screen flex flex-col font-sans transition-colors duration-300 relative ${s?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:[i.jsx("script",{type:"application/ld+json",dangerouslySetInnerHTML:{__html:JSON.stringify(af)}}),i.jsx("button",{id:"theme-toggle-floating-btn",onClick:o,className:"fixed bottom-24 left-4 md:left-6 z-40 p-2.5 rounded-xl bg-white/90 dark:bg-slate-900/90 backdrop-blur-md hover:bg-white dark:hover:bg-slate-800 border border-slate-200/60 dark:border-slate-800/60 text-slate-500 dark:text-slate-400 hover:text-slate-900 dark:hover:text-slate-100 transition-all shadow-md active:scale-95 cursor-pointer select-none flex items-center justify-center group",title:s?t.common.switchTheme||"Switch to Light Mode":t.common.switchTheme||"Switch to Dark Mode","aria-label":t.common.switchTheme||"Toggle theme",children:s?i.jsx(qc,{className:"w-4 h-4 text-amber-500 group-hover:rotate-45 transition-transform"}):i.jsx(ko,{className:"w-4 h-4 text-indigo-500 dark:text-indigo-400 group-hover:-rotate-12 transition-transform"})}
4843),i.jsx(sp,{activeTrack:B,setActiveTrack:N,onOpenPaywall:()=>c(!0),isAuthModalOpen:d,setIsAuthModalOpen:h,onOpenLegal:Q=>j(Q),onOpenTour:()=>{ps("welcome"),Ua(!0)},onOpenEmbed:()=>R(!0),onOpenExaminer:()=>{window.history.pushState({},"","/ielts-speaking-mock-test"),e("/ielts-speaking-mock-test"),window.scrollTo({top:0,behavior:"smooth"})}}),i.jsx("main",{className:"w-full flex-1 flex flex-col min-h-[calc(100vh-80px)]",children:i.jsxs("div",{className:"flex-1 p-4 md:p-5 flex flex-col gap-4 lg:gap-5 w-full max-w-7xl mx-auto",children:[i.jsx(C6e,{onOpenExaminer:()=>{window.location.href="/ielts-speaking-mock-test"},onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0),activeStationName:(xe==null?void 0:xe.name)||"Global Broadcast",hasCurrentTranscript:!!(W!=null&&W.originalText||Ut.length>0),isPro:!!ms}),B==="pro"?i.jsx(WFe,{onUpgrade:()=>c(!0),onOpenAuthModal:()=>h(!0),onOpenLegal:Q=>j(Q),onSelectSnippetForPractice:Q=>{N("live"),k("theater");const De={id:Date.now().toString(),originalText:Q,translatedText:"Selected from PRO Curated Study Cabin for shadowing practice."};Ei(at=>at.some(kt=>kt.originalText===Q)?at:[...at,De]),K(De),lt(!0)}}):i.jsxs(i.Fragment,{children:[i.jsxs("section",{className:"bg-gradient-to-r from-emerald-500/5 to-teal-500/5 dark:from-emerald-950/10 dark:to-teal-950/10 border border-emerald-500/25 dark:border-emerald-500/10 rounded-2xl p-4 md:p-5 flex flex-col gap-4 shadow-sm",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-emerald-500/10 pb-4",children:[i.jsxs("div",{className:"flex items-center gap-3",children:[i.jsx("div",{className:`p-2.5 rounded-xl transition-all duration-300 ${Et.status==="connected"?"bg-emerald-500 text-white animate-pulse shadow-lg shadow-emerald-500/30":"bg-emerald-50 dark:bg-emerald-950/30 text-emerald-600 dark:text-emerald-400"}`,children:i.jsx(cn,{className:`w-5 h-5 ${Et.status==="connected"?"animate-pulse":""}`})}),i.jsxs("div",{children:[i.jsxs("h2",{className:"font-display font-bold text-sm tracking-tight text-slate-800 dark:text-slate-100 flex flex-wrap items-center gap-2",children:[i.jsx("span",{children:t.app.liveAiInterpreter}),i.jsx("span",{className:"bg-emerald-500/10 text-emerald-700 dark:text-emerald-300 px-2 py-0.5 rounded-full text-[10px] font-semibold tracking-wider uppercase",children:t.header.liveStream}),i.jsx("button",{onClick:()=>k(Q=>Q==="explore"?"theater":"explore"),className:"ml-auto md:ml-4 text-[10px] text-slate-400 hover:text-slate-600 dark:hover:text-slate-300 underline cursor-pointer",children:t.app.switchView})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 font-sans",children:t.app.liveInterpreterDesc})]})]}),i.jsxs("div",{className:"flex flex-wrap items-center gap-2",children:[i.jsxs("div",{className:"flex items-center gap-1 bg-white dark:bg-slate-900 px-3 py-1.5 rounded-xl shadow-sm border border-slate-200/60 dark:border-slate-800/60",title:"Select target language for real-time translation",children:[i.jsx(vI,{className:"w-3.5 h-3.5 text-slate-400"}),i.jsx("select",{value:Yr,onChange:Q=>bl(Q.target.value),disabled:!1,className:"bg-transparent border-none text-xs font-semibold text-slate-600 dark:text-slate-300 focus:outline-none cursor-pointer pr-1 max-w-[130px] sm:max-w-[none]",title:"Select translation target language",children:G6e.map(Q=>i.jsx("option",{value:Q,children:Q},Q))})]}),i.jsxs("div",{className:"relative",children:[i.jsxs("button",{onClick:()=>ai(!Kl),className:"flex items-center gap-1 bg-white dark:bg-slate-900 px-3 py-1.5 rounded-xl shadow-sm border border-emerald-500/30 dark:border-emerald-500/30 hover:border-emerald-500/60 transition-colors text-xs font-semibold text-emerald-700 dark:text-emerald-400",title:"Select focus vocabulary",children:[i.jsx(Jo,{className:"w-3.5 h-3.5"}),i.jsx("span",{children:v(or.id,or.label)}),i.jsx(wy,{className:"w-3 h-3 ml-1"})]}),i.jsx(Qo,{children:Kl&&i.jsx(cs.div,{initial:{opacity:0,y:5},animate:{opacity:1,y:0},exit:{opacity:0,y:5},transition:{duration:.15},className:"absolute top-full mt-2 right-0 w-48 bg-white dark:bg-slate-800 rounded-xl shadow-xl border border-slate-200 dark:border-slate-700 z-50 overflow-hidden",children:i.jsx("div",{className:"py-1",children:u$.map(Q=>i.jsxs("button",{onClick:()=>hu(Q),className:`w-full text-left px-4 py-2.5 text-xs font-medium flex items-center justify-between hover:bg-slate-50 dark:hover:bg-slate-700/50 transition-colors ${or.id===Q.id?"text-emerald-600 dark:text-emerald-400 bg-emerald-50/50 dark:bg-emerald-900/20":"text-slate-700 dark:text-slate-300"}`,children:[i.jsx("span",{children:v(Q.id,Q.label)}),Q.isPro&&i.jsx(rl,{size:12,className:"text-amber-500 ml-2 flex-shrink-0"})]},Q.id))})})})]}),i.jsxs("button",{id:"help-me-choose-btn",onClick:()=>{Ca(!0),r_("wizard_open_clicked",{source:"control_panel"})},className:"relative px-3.5 py-2 rounded-xl text-xs font-bold text-white bg-gradient-to-r from-emerald-500 via-teal-500 to-emerald-600 hover:from-emerald-600 hover:to-teal-600 shadow-md shadow-emerald-500/25 border border-emerald-400/40 flex items-center gap-1.5 transition-all duration-300 hover:scale-[1.03] active:scale-95 cursor-pointer overflow-hidden group shrink-0",title:t.app.helpMeChooseSub,children:[i.jsx("span",{className:"absolute top-0 left-0 w-full h-full bg-gradient-to-r from-transparent via-white/30 to-transparent -translate-x-full group-hover:translate-x-full transition-transform duration-1000 ease-in-out pointer-events-none"}),i.jsx(At,{className:"w-3.5 h-3.5 text-amber-200 animate-pulse shrink-0"}),i.jsx("span",{className:"tracking-wide font-display",children:t.app.helpMeChoose})]}),i.jsx("button",{onClick:Xc,disabled:!xe,className:`px-4 py-2 rounded-xl text-xs font-bold transition-all duration-300 flex items-center gap-2 ${xe?Et.status==="connected"?"bg-rose-500 hover:bg-rose-600 text-white shadow-md shadow-rose-200/50 cursor-pointer active:scale-95":Et.status==="connecting"?"bg-amber-500 text-white animate-pulse cursor-wait":"bg-emerald-500 text-white hover:bg-emerald-600 shadow-md shadow-emerald-200/50 cursor-pointer active:scale-95":"bg-slate-200 text-slate-400 cursor-not-allowed opacity-70"}`,title:xe?Et.status==="connected"?t.app.stopTranslation:Et.status==="connecting"?t.app.connectingTranslation:t.app.startLiveTranslation:r?"请先在下方选择语言卡片":"Select a language card below first",children:i.jsx("span",{children:xe?Et.status==="connected"?t.app.stopTranslation:Et.status==="connecting"?t.app.connectingTranslation:r?`开始跟读 ${xe.name}`:`Start Shadowing: ${xe.name}`:r?"请先选择语言卡片":"Select a language first"})})]})]}),Et.error&&i.jsxs("div",{className:"flex items-center gap-2 bg-rose-500/10 text-rose-700 dark:text-rose-400 text-xs px-3.5 py-2.5 rounded-xl border border-rose-500/20",children:[i.jsx(Y2,{className:"w-4 h-4 flex-shrink-0"}),i.jsx("span",{children:Et.error})]}),T!=="immersion"&&Et.status==="connecting"&&i.jsxs("div",{className:"flex items-center gap-2 bg-amber-500/10 text-amber-700 dark:text-amber-400 text-xs px-3.5 py-2.5 rounded-xl border border-amber-500/20",children:[i.jsx(qa,{className:"w-4 h-4 animate-spin text-amber-600 dar
4843k:text-amber-400"}),i.jsx("span",{children:r?"正在连接到实时 AI 广播音频流...":"Connecting to real-time AI live broadcast stream..."})]}),T!=="immersion"&&Et.status==="connected"&&i.jsxs("div",{className:"flex flex-col gap-1.5 bg-emerald-500/10 text-emerald-800 dark:text-emerald-300 text-xs px-3.5 py-2.5 rounded-xl border border-emerald-500/20",children:[i.jsxs("div",{className:"flex items-center justify-between gap-4",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsxs("span",{className:"relative flex h-2 w-2 mb-0.5",children:[i.jsx("span",{className:"animate-ping absolute inline-flex h-full w-full rounded-full bg-emerald-400 opacity-75"}),i.jsx("span",{className:"relative inline-flex rounded-full h-2 w-2 bg-emerald-500"})]}),i.jsx("span",{className:"font-semibold",children:t.app.liveAssistantActive.replace("{lang}",Yr)}),i.jsx("span",{className:"text-[10px] bg-emerald-500/20 text-emerald-700 dark:text-emerald-300 px-2 py-0.5 rounded-full font-mono font-medium",children:r?"实时双语字幕同传":"Bilingual Live Subtitles"})]}),i.jsxs("div",{className:"flex gap-1 items-center",children:[i.jsx("span",{className:"h-4 w-[2px] bg-emerald-500/30 rounded-full animate-pulse",style:{animationDelay:"0.1s"}}),i.jsx("span",{className:"h-6 w-[2px] bg-emerald-500/40 rounded-full animate-pulse",style:{animationDelay:"0.2s"}}),i.jsx("span",{className:"h-3 w-[2px] bg-emerald-500/20 rounded-full animate-pulse",style:{animationDelay:"0.3s"}}),i.jsx("span",{className:"h-5 w-[2px] bg-emerald-500/50 rounded-full animate-pulse",style:{animationDelay:"0s"}}),i.jsx("span",{className:"h-4 w-[2px] bg-emerald-500/30 rounded-full animate-pulse",style:{animationDelay:"0.4s"}})]})]}),i.jsx("p",{className:"text-[11px] text-emerald-700/80 dark:text-emerald-300/80 leading-tight",children:t.app.textOnlyDesc})]}),T==="explore"&&(Et.status==="connected"||Et.status==="error"||Et.status==="connecting"||Ut.length>0||Et.userTranscript||Et.modelTranscript)&&i.jsxs("div",{className:"border border-slate-200/60 dark:border-slate-800/60 rounded-xl bg-slate-50/50 dark:bg-slate-950/20 p-4 shadow-sm flex flex-col gap-3.5",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row sm:items-center justify-between gap-3 border-b border-slate-150 dark:border-slate-800/40 pb-3",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(BC,{className:"w-4 h-4 text-emerald-500"}),i.jsxs("div",{children:[i.jsx("h3",{className:"text-xs font-bold text-slate-800 dark:text-slate-200 uppercase tracking-wider font-mono",children:t.app.transcriptionFeedTitle}),i.jsx("p",{className:"text-[10px] text-slate-400 dark:text-slate-300 font-sans",children:t.app.transcriptionFeedDesc})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 self-end sm:self-auto",children:[i.jsx("button",{onClick:ki,title:t.app.copyTranscript,className:"p-1 px-2.5 rounded-lg text-[11px] font-medium bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800/80 text-slate-600 dark:text-slate-300 hover:text-slate-850 dark:hover:text-slate-100 hover:bg-slate-50 dark:hover:bg-slate-800/60 transition-colors flex items-center gap-1 cursor-pointer shadow-2sm",children:Qc?i.jsxs(i.Fragment,{children:[i.jsx(N6,{className:"w-3 h-3 text-emerald-500 animate-scale"}),i.jsx("span",{className:"text-emerald-500",children:t.app.copiedTranscript})]}):i.jsxs(i.Fragment,{children:[i.jsx(Pm,{className:"w-3 h-3"}),i.jsx("span",{children:t.app.copyTranscript})]})}),i.jsxs("button",{onClick:Gs,title:t.app.downloadTranscript,className:"p-1 px-2.5 rounded-lg text-[11px] font-medium bg-white dark:bg-slate-900 border border-slate-200/80 dark:border-slate-800/80 text-slate-600 dark:text-slate-300 hover:text-slate-850 dark:hover:text-slate-100 hover:bg-slate-50 dark:hover:bg-slate-800/60 transition-colors flex items-center gap-1 cursor-pointer shadow-2sm",children:[i.jsx(hS,{className:"w-3 h-3"}),i.jsx("span",{children:t.app.downloadTranscript})]}),i.jsxs("button",{onClick:Do,title:t.app.clearTranscripts,className:"p-1 px-2.5 rounded-lg text-[11px] font-medium bg-white dark:bg-rose-950/20 shadow-2sm border border-slate-200/80 dark:border-rose-900/30 text-slate-500 dark:text-rose-400 hover:text-rose-600 hover:border-rose-200 dark:hover:text-rose-300 dark:hover:border-rose-900/65 hover:bg-rose-50 transition-colors flex items-center gap-1 cursor-pointer",children:[i.jsx(Fd,{className:"w-3 h-3"}),i.jsx("span",{children:t.app.clearTranscripts})]})]})]}),i.jsxs("div",{ref:Jc,className:"flex flex-col gap-4 max-h-64 overflow-y-auto pr-2 custom-scrollbar scroll-smooth",children:[Ut.length>0&&i.jsxs("div",{className:"hidden md:grid grid-cols-2 gap-4 border-b border-slate-100 dar
4843k:border-slate-800/60 pb-2 text-[10px] font-mono font-bold text-slate-400 dark:text-slate-300 tracking-wider",children:[i.jsx("div",{children:t.app.capturedOriginal}),i.jsx("div",{children:t.app.geminiInterpretation})]}),Ut.map((Q,De)=>i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 pb-3 border-b border-slate-100/40 dark:border-slate-800/10 text-xs items-stretch",children:[i.jsxs("div",{className:"p-3 rounded-xl border border-slate-200/50 dark:border-slate-850 bg-slate-100/30 dark:bg-slate-900/10 flex flex-col gap-1.5 justify-between",children:[i.jsx("p",{className:"text-slate-700 dark:text-slate-200 leading-relaxed font-sans text-sm font-medium",children:o_(Q.originalText,Q.focusVocab)}),i.jsxs("div",{className:"flex items-center justify-between text-[9px] text-slate-400 dark:text-slate-300 font-mono border-t border-slate-100/50 dark:border-slate-800/20 pt-1.5 mt-0.5",children:[i.jsx("span",{className:"font-bold tracking-wider uppercase",children:t.app.nativeStream}),i.jsx("span",{children:"Live"})]})]}),i.jsxs("div",{className:"p-3 rounded-xl border border-emerald-500/12 dark:border-emerald-500/10 bg-emerald-500/[0.015] dark:bg-emerald-500/[0.01] flex flex-col gap-1.5 justify-between",children:[i.jsx("p",{className:"text-emerald-900 dark:text-emerald-300 leading-relaxed font-sans text-sm font-semibold",children:Q.translatedText&&Q.translatedText!=="..."?Q.translatedText:i.jsxs("span",{className:"inline-flex items-center gap-1.5 text-xs text-emerald-600/70 dark:text-emerald-400/70 font-normal",children:[i.jsx("span",{className:"inline-block w-8 h-2 bg-emerald-400/50 dark:bg-emerald-600/50 animate-pulse rounded"}),i.jsx("span",{className:"text-[10px] font-mono",children:"Translating..."})]})}),i.jsxs("div",{className:"flex items-center justify-between text-[9px] text-emerald-600 dark:text-emerald-400/90 font-mono border-t border-emerald-500/5 dark:border-emerald-500/5 pt-1.5 mt-0.5",children:[i.jsxs("span",{className:"font-bold tracking-wider uppercase",children:["Interpreted (",Yr,")"]}),i.jsx("span",{className:"text-slate-400 dark:text-slate-300 font-normal",children:"Live"})]})]})]},De)),(Et.userTranscript||Et.modelTranscript)&&i.jsxs("div",{className:"grid grid-cols-1 md:grid-cols-2 gap-3 text-xs items-stretch",children:[i.jsxs("div",{className:"p-3 rounded-xl border border-dashed border-slate-300/85 dark:border-slate-800 bg-slate-50/10 dark:bg-slate-900/5 flex flex-col gap-2 justify-between",children:[i.jsx("p",{className:"text-slate-500 dark:text-slate-400 leading-relaxed font-sans text-sm italic",children:Et.userTranscript?`"${Et.userTranscript}"`:i.jsx("span",{className:"inline-block w-12 h-2 bg-slate-300 dark:bg-slate-700 animate-pulse rounded my-1"})}),i.jsxs("div",{className:"flex items-center justify-between text-[9px] text-slate-400 dark:text-slate-300 font-mono border-t border-dashed border-slate-200/50 dark:border-slate-800/20 pt-1.5",children:[i.jsxs("span",{className:"flex items-center gap-1.5 font-bold uppercase tracking-wider",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-amber-400 animate-ping"}),"DETECTOR"]}),Et.userTranscript&&i.jsx("span",{className:"text-amber-500 font-bold tracking-widest animate-pulse",children:"DECODING..."})]})]}),i.jsxs("div",{className:"p-3 rounded-xl border border-dashed border-emerald-500/20 bg-emerald-500/[0.015] dark:bg-emerald-500/[0.005] flex flex-col gap-2 justify-between",children:[i.jsx("p",{className:"text-emerald-600/80 dark:text-emerald-400/80 leading-relaxed font-sans text-sm italic",children:Et.modelTranscript?`"${Et.modelTranscript}"`:i.jsx("span",{className:"inline-block w-12 h-2 bg-emerald-400/50 dark:bg-emerald-600/50 animate-pulse rounded my-1"})}),i.jsxs("div",{className:"flex items-center justify-between text-[9px] text-emerald-500 font-mono border-t border-dashed border-emerald-500/10 pt-1.5",children:[i.jsxs("span",{className:"flex items-center gap-1.5 font-bold uppercase tracking-wider",children:[i.jsx("span",{className:"w-1.5 h-1.5 rounded-full bg-emerald-500 animate-pulse"}),"INTELLIGENCE"]}),Et.modelTranscript&&i.jsx("span",{className:"text-emerald-500 font-bold tracking-wide animate-pulse up
4843percase",children:"TRANSLATING..."})]})]})]}),Ut.length===0&&!Et.userTranscript&&!Et.modelTranscript&&i.jsxs("div",{className:"flex flex-col items-center justify-center py-10 text-center text-slate-400 dark:text-slate-300",children:[i.jsx(BC,{className:"w-9 h-9 opacity-40 mb-2 animate-pulse",style:{animationDuration:"3s"}}),i.jsx("p",{className:"text-xs font-semibold uppercase tracking-wider font-mono",children:"Listening to active broadcast frequencies..."}),i.jsx("p",{className:"text-[10px] opacity-75 mt-1 max-w-md",children:"Captured audio captions & simultaneous translations will flow into this dual-channel side-by-side display panel in real-time."})]})]})]})]}),T==="immersion"?i.jsx(w6e,{activeStation:xe,isPlaying:ht,onTogglePlay:()=>mn(Q=>!Q),onSelectStation:oi,onCatchAndPractice:pu,onSwitchToTheater:()=>k("theater"),onSwitchToExplore:()=>k("explore"),isZh:r}):T==="explore"?i.jsxs(i.Fragment,{children:[i.jsx(VLe,{selectedLanguageId:Sn,onSelectLanguage:yr,onOpenCoach:Q=>{Q.actionUrl?window.location.href=Q.actionUrl:window.location.href="/ielts-speaking-mock-test"}}),Sn?i.jsxs("div",{id:"step2-radio-explorer",className:"w-full flex flex-col gap-4 animate-in fade-in duration-400",children:[i.jsxs("div",{className:"w-full max-w-5xl mx-auto flex flex-wrap items-center justify-between gap-3 bg-white/90 dark:bg-slate-900/90 backdrop-blur-md px-4 py-3 rounded-2xl border border-emerald-500/30 dark:border-emerald-500/20 shadow-xs",children:[i.jsxs("div",{className:"flex items-center gap-2.5",children:[i.jsx("span",{className:"w-6 h-6 rounded-full bg-emerald-500 text-white text-xs font-bold flex items-center justify-center shrink-0",children:"2"}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("h3",{className:"text-sm sm:text-base font-bold text-slate-900 dark:text-white font-display",children:r?"第二步:在世界地图中点击地区,流转真实广播":"Step 2: Explore Regional Broadcasts on the Globe"}),i.jsxs("span",{className:"px-2 py-0.5 rounded-full text-[10px] font-bold bg-emerald-100 text-emerald-800 dark:bg-emerald-950/80 dark:text-emerald-300 border border-emerald-300 dark:border-emerald-800",children:[(In==null?void 0:In.name)||Sn," (",In==null?void 0:In.exam,")"]})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:r?`已定位至 ${In==null?void 0:In.defaultProfile.country} 原生频道,可点击地图探索更多该语种国家与电台`:`Pre-selected ${In==null?void 0:In.defaultProfile.country} native frequencies. Click anywhere on the map to change regions.`})]})]}),i.jsx("button",{onClick:()=>{va(null),localStorage.removeItem("radioshadow_selected_language");const Q=document.getElementById("language-selection-step");Q==null||Q.scrollIntoView({behavior:"smooth"})},className:"text-xs font-semibold text-slate-600 hover:text-emerald-600 dark:text-slate-300 dark:hover:text-emerald-400 px-3 py-1.5 rounded-xl border border-slate-200 dark:border-slate-800 hover:border-emerald-400 transition-colors cursor-pointer",children:r?"← 切换其他语言":"← Change Language"})]}),i.jsx("section",{className:"w-full aspect-[700/340] max-w-5xl max-h-[360px] md:max-h-[400px] lg:max-h-[450px] xl:max-h-[490px] mx-auto min-h-[220px] sm:min-h-[280px] md:min-h-[340px]",children:i.jsx(ULe,{darkMode:s,onMapClick:Xl,selectedProfile:ge,loading:ya,selectedCoords:kr,radiusKm:ns,setRadiusKm:Io,onRadiusChangeEnd:mu})}),i.jsx("section",{className:"flex-1",children:i.jsx(GLe,{currentCountryProfile:ge,onSelectStation:oi,activeStation:xe,isPlaying:ht,isProfileLoading:ya})})]}):i.jsxs("div",{className:"w-full max-w-5xl mx-auto py-8 px-6 text-center rounded-2xl border border-dashed border-emerald-500/30 bg-emerald-500/[0.02] dark:bg-emerald-500/[0.01] my-2",children:[i.jsx("p",{className:"text-sm font-semibold text-slate-700 dark:text-slate-200 mb-1",children:r?"👆 请先在上方点击选择你想练习的语言卡片":"👆 Please select a target language above to launch the interactive radio globe."}),i.jsx("p",{className:"text-xs text-slate-400 dark:text-slate-500",children:r?"选择后系统将自动定位至对应母语国家,
4843并预载实时双语字幕与跟读电台":"Selecting a language automatically centers the globe and preloads native stations with synchronized subtitles."})]})]}):i.jsx("div",{className:"relative w-full h-full flex flex-col gap-3",children:i.jsxs("div",{className:`w-full flex flex-col lg:flex-row gap-4 animate-in fade-in duration-500 max-w-7xl mx-auto ${l?"pointer-events-none blur-sm opacity-60 transition-all duration-700":""}`,children:[i.jsxs("div",{className:"flex-grow lg:w-[60%] flex flex-col bg-white dark:bg-slate-900 rounded-2xl border border-slate-100 dark:border-slate-800 shadow-sm overflow-hidden h-[calc(100vh-140px)] min-h-[550px] max-h-[840px] relative",children:[i.jsxs("div",{id:"theater-header-bar",className:"px-3.5 py-2 border-b border-slate-100 dark:border-slate-800 flex flex-wrap items-center justify-between gap-2 shrink-0 bg-white dark:bg-slate-900",children:[i.jsxs("div",{className:"flex items-center gap-2 overflow-hidden",children:[i.jsx(BC,{className:"w-4 h-4 text-emerald-500 shrink-0"}),i.jsx("h3",{className:"font-bold text-slate-800 dark:text-slate-100 text-sm truncate",children:t.app.liveBroadcastTranscript}),xe?i.jsxs("span",{className:"text-xs text-emerald-600 dark:text-emerald-400 font-mono font-medium truncate",children:["(",xe.name,")"]}):i.jsx("span",{className:"text-[10px] text-amber-700 dark:text-amber-400 bg-amber-50 dark:bg-amber-950/40 border border-amber-200 dark:border-amber-900/40 px-1.5 py-0.5 rounded font-mono font-medium",children:t.app.curatedPractice}),i.jsxs("span",{className:"text-[10px] font-mono text-slate-400 bg-slate-100 dark:bg-slate-800 px-1.5 py-0.5 rounded",children:[Ut.length," ",t.app.lines]})]}),i.jsxs("div",{id:"practice-mode-switcher",className:"flex items-center gap-1 p-0.5 bg-slate-100 dark:bg-slate-800 rounded-xl border border-slate-200 dark:border-slate-700 text-xs",children:[i.jsxs("button",{id:"mode-btn-single",onClick:()=>{if(Gt){if(!confirm(r?"确定要停止当前连续录音并切换为单句跟读模式吗?":"Are you sure you want to stop the continuous recording session and switch to Single-Sentence mode?"))return;xl()}nt("single"),Yt(!1)},className:`px-2.5 py-1 rounded-lg font-semibold flex items-center gap-1 transition-all cursor-pointer text-xs ${je==="single"?"bg-white dark:bg-slate-900 text-emerald-700 dark:text-emerald-400 shadow-xs font-bold":"text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,title:r?"单句精准跟读":"Single-sentence precision shadowing",children:[i.jsx(Er,{className:"w-3 h-3"}),i.jsx("span",{children:t.app.single})]}),i.jsxs("button",{id:"mode-btn-continuous",onClick:()=>{if(!ms){c(!0);return}nt("continuous"),Yt(!0)},className:`px-2.5 py-1 rounded-lg font-semibold flex items-center gap-1 transition-all cursor-pointer text-xs ${je==="continuous"?"bg-emerald-600 text-white shadow-xs font-bold":"text-slate-500 dark:text-slate-400 hover:text-slate-800 dark:hover:text-slate-200"}`,title:r?"连续不间断跟读":"Continuous non-stop shadowing",children:[i.jsx(Nn,{className:`w-3 h-3 ${Gt?"animate-bounce text-white":"text-emerald-500"}`}),i.jsx("span",{children:t.app.continuous}),i.jsx("span",{className:`text-[8px] font-extrabold px-1 rounded ${je==="continuous"?"bg-white/20 text-white":"bg-amber-500/15 text-amber-600 dark:text-amber-400"}`,children:"PRO"})]})]}),i.jsxs("div",{className:"flex items-center gap-1.5 shrink-0",children:[i.jsxs("button",{id:"study-cabin-trigger-btn",onClick:()=>ee(!U),className:`px-2 py-1 rounded-lg text-[11px] font-semibold transition-all flex items-center gap-1 cursor-pointer ${U?"bg-emerald-500 text-white shadow-xs":"bg-emerald-50 dark:bg-emerald-950/50 hover:bg-emerald-100 dark:hover:bg-emerald-900/60 text-emerald-700 dark:text-emerald-300 border border-emerald-200/80 dark:border-emerald-800/60"}`,title:r?"精选学习小舱":"Open Curated Study Cabin",children:[i.jsx(Ys,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:t.app.cabin}),i.jsx("span",{className:"text-[8px] bg-emerald-500 text-white px-1 rounded font-bold",children:r?"免费":"FREE"})]}),i.jsxs("button",{id:"immersion-mode-btn",onClick:()=>k("immersion"),className:"px-2 py-1 rounded-lg bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-300/80 dark:border-emerald-800/80 text-emerald-700 dark:text-emerald-300 font-semibold text-[11px] transition-all flex items-center gap-1 cursor-pointer",title:r?"沉浸泛听 0 Token 模式":"Immersion Mode (0 Token)",children:[i.jsx(Er,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:r?"沉浸泛听":"Immersion"})]}),i.jsxs("button",{id:"explore-map-btn",onClick:()=>
4843k("explore"),className:"px-2 py-1 rounded-lg bg-slate-100 dark:bg-slate-800 hover:bg-slate-200 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200 font-semibold text-[11px] transition-all flex items-center gap-1 cursor-pointer",title:r?"探索地图":"Explore Map",children:[i.jsx(z2,{className:"w-3 h-3"}),i.jsx("span",{children:t.app.map})]}),i.jsx("button",{onClick:ki,title:t.app.copyTranscript,className:"p-1 px-1.5 rounded-lg text-[11px] font-medium bg-slate-50 dark:bg-slate-800 text-slate-600 dark:text-slate-300 hover:text-slate-900 dark:hover:text-slate-100 transition-colors flex items-center gap-1 cursor-pointer",children:Qc?i.jsx(N6,{className:"w-3 h-3 text-emerald-500"}):i.jsx(Pm,{className:"w-3 h-3"})}),i.jsx("button",{onClick:Do,title:t.app.clearTranscripts,className:"p-1 px-1.5 rounded-lg text-[11px] font-medium text-slate-400 hover:text-rose-500 transition-colors flex items-center gap-1 cursor-pointer",children:i.jsx(Fd,{className:"w-3 h-3"})})]})]}),i.jsxs("div",{id:"broadcast-stations-bar",className:"px-3 py-1 bg-slate-50/80 dark:bg-slate-850/80 border-b border-slate-100 dark:border-slate-800 text-xs flex items-center gap-1.5 shrink-0 overflow-x-auto custom-scrollbar",children:[i.jsxs("span",{className:"text-[10px] font-bold text-slate-500 dark:text-slate-400 shrink-0 flex items-center gap-1 font-mono uppercase tracking-wider",children:[i.jsx(cn,{className:"w-3 h-3 text-emerald-500"}),t.app.stations]}),ci.map(Q=>{const De=(xe==null?void 0:xe.name)===Q.name||(xe==null?void 0:xe.id)===Q.id;return i.jsxs("button",{onClick:()=>oi({changeid:Q.id,stationuuid:Q.id,name:Q.name,url:Q.streamUrl,url_resolved:Q.streamUrl,homepage:"",favicon:"",tags:Q.category,country:Q.country||"Global",countrycode:Q.country||"US",state:"",language:Q.language,votes:1200,clickcount:500,codec:"MP3",bitrate:128}),className:`px-2 py-0.5 rounded-md text-[10px] font-medium transition-all flex items-center gap-1 shrink-0 cursor-pointer ${De?"bg-emerald-500 text-white font-bold shadow-xs":"bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-700 hover:border-emerald-500 text-slate-600 dark:text-slate-300"}`,children:[i.jsx(Xa,{className:`w-2 h-2 ${De?"fill-white text-white":"text-emerald-500 fill-current"}`}),i.jsx("span",{children:Q.name})]},Q.id)})]}),i.jsx(g6e,{isActive:bt||je==="continuous",isRecording:Gt,isEvaluating:$t,evaluationStepText:sa,durationSeconds:Mr,targetLimitMinutes:us,recordedSentencesCount:Xi.length||Ut.length,stationName:(xe==null?void 0:xe.name)||"Global Radio",isPro:ms,renderTrigger:!1,isSetupOpen:We,onOpenSetup:()=>dt(!0),onCloseSetup:()=>dt(!1),onToggleActive:Q=>{if(!ms){c(!0);return}Yt(Q),Q&&nt("continuous")},onStartRecording:Q=>rf(Q),onFinishAndAnalyze:()=>ii(),onCancelRecording:()=>xl(),onOpenPaywall:()=>c(!0)}),U&&i.jsxs("div",{className:"absolute top-12 left-3 right-3 sm:right-auto sm:w-[420px] z-30 bg-white/95 dark:bg-slate-900/95 backdrop-blur-md rounded-2xl border border-slate-200 dark:border-slate-800 shadow-2xl p-4 animate-in fade-in zoom-in-95 duration-200",children:[i.jsxs("div",{className:"flex items-center justify-between pb-2.5 mb-3 border-b border-slate-100 dark:border-slate-800",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx("div",{className:"p-1.5 rounded-lg bg-emerald-100 dark:bg-emerald-950/60 text-emerald-600 dark:text-emerald-400",children:i.jsx(Ys,{className:"w-4 h-4"})}),i.jsxs("div",{children:[i.jsxs("h4",{className:"font-bold text-xs text-slate-900 dark:text-slate-100 flex items-center gap-1.5",children:["Curated Study Cabin",i.jsx("span",{className:"text-[10px] text-emerald-600 dark:text-emerald-400 bg-emerald-50 dark:bg-emerald-950/40 border border-emerald-200 dark:border-emerald-800/40 px-1.5 py-0.5 rounded font-mono font-medium",children:ms?"PRO Unlocked":"1st Free · PRO Unlocks All"})]}),i.jsx("p",{className:"text-[10px] text-slate-500 dark:text-slate-400",children:"Select a curated passage for offline shadowing practice"})]})]}),i.jsx("button",{onClick:()=>ee(!1),className:"p-1 rounded-lg text-slate-400 hover:text-slate-600 dark:hover:text-slate-200 hover:bg-slate-100 dar
4843k:hover:bg-slate-800 transition-colors cursor-pointer",children:i.jsx(Ts,{className:"w-4 h-4"})})]}),i.jsxs("div",{className:"mb-3 p-2.5 bg-slate-50 dark:bg-slate-850 rounded-xl border border-slate-100 dark:border-slate-800 flex flex-col gap-2 text-[10px]",children:[i.jsxs("div",{className:"flex items-center justify-between font-mono text-slate-500 dark:text-slate-400 font-bold uppercase tracking-wider",children:[i.jsxs("span",{className:"flex items-center gap-1",children:[i.jsx(SW,{className:"w-3 h-3 text-emerald-500"}),"Filter Passages"]}),(ie!=="All"||Z!=="All"||se!=="All"||H!=="All")&&i.jsx("button",{onClick:()=>{G("All"),z("All"),re("All"),Y("All")},className:"text-emerald-600 dark:text-emerald-400 hover:underline cursor-pointer",children:"Reset Filters"})]}),i.jsxs("div",{className:"grid grid-cols-2 gap-2",children:[i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("label",{className:"text-[9px] text-slate-400 dark:text-slate-500 font-medium",children:"Language"}),i.jsxs("select",{value:ie,onChange:Q=>G(Q.target.value),className:"px-2 py-1 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-750 rounded-md text-[11px] text-slate-700 dark:text-slate-200 focus:outline-none focus:border-emerald-500 cursor-pointer",children:[i.jsx("option",{value:"All",children:"All Languages"}),i.jsx("option",{value:"English",children:"English"}),i.jsx("option",{value:"French",children:"French"}),i.jsx("option",{value:"Spanish",children:"Spanish"}),i.jsx("option",{value:"German",children:"German"})]})]}),i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("label",{className:"text-[9px] text-slate-400 dark:text-slate-500 font-medium",children:"Difficulty"}),i.jsxs("select",{value:Z,onChange:Q=>z(Q.target.value),className:"px-2 py-1 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-750 rounded-md text-[11px] text-slate-700 dark:text-slate-200 focus:outline-none focus:border-emerald-500 cursor-pointer",children:[i.jsx("option",{value:"All",children:"All Levels"}),i.jsx("option",{value:"Beginner",children:"Beginner"}),i.jsx("option",{value:"Intermediate",children:"Intermediate"}),i.jsx("option",{value:"Advanced",children:"Advanced"})]})]}),i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("label",{className:"text-[9px] text-slate-400 dark:text-slate-500 font-medium",children:"Vocab Coverage"}),i.jsxs("select",{value:se,onChange:Q=>re(Q.target.value),className:"px-2 py-1 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-750 rounded-md text-[11px] text-slate-700 dark:text-slate-200 focus:outline-none focus:border-emerald-500 cursor-pointer",children:[i.jsx("option",{value:"All",children:"All Vocab Density"}),i.jsx("option",{value:"High (80%+)",children:"High (80%+)"}),i.jsx("option",{value:"Medium (50%+)",children:"Medium (50%+)"}),i.jsx("option",{value:"Standard",children:"Standard"})]})]}),i.jsxs("div",{className:"flex flex-col gap-0.5",children:[i.jsx("label",{className:"text-[9px] text-slate-400 dark:text-slate-500 font-medium",children:"Band / Sophistication"}),i.jsxs("select",{value:H,onChange:Q=>Y(Q.target.value),className:"px-2 py-1 bg-white dark:bg-slate-900 border border-slate-200 dark:border-slate-750 rounded-md text-[11px] text-slate-700 dark:text-slate-200 focus:outline-none focus:border-emerald-500 cursor-pointer",children:[i.jsx("option",{value:"All",children:"All Sophistication"}),i.jsx("option",{value:"IELTS 6.5+",children:"IELTS 6.5+"}),i.jsx("option",{value:"IELTS 7.5+",children:"IELTS 7.5+"}),i.jsx("option",{value:"C1 Academic",children:"C1 Academic"}),i.jsx("option",{value:"Business Elite",children:"Business Elite"}),i.jsx("option",{value:"Daily Practice",children:"Daily Practice"})]})]})]})]}),i.jsx("div",{className:"flex flex-col gap-2.5 max-h-[380px] overflow-y-auto custom-scrollbar pr-1",children:de.length===0?i.jsxs("div",{className:"p-6 text-center bg-slate-50 dark:bg-slate-850 rounded-xl border border-slate-100 dark:border-slate-800",children:[i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mb-2",children:"No passages match your current filter criteria."}),i.jsx("button",{onClick:()=>{G("All"),z("All"),re("All"),Y("All")},className:"px-3 py-1 rounded-lg bg-emerald-500 text-white font-semibold text-xs transition-all shadow-sm cursor-pointer",children:"Reset Filters"})]}):de.map((Q,De)=>{const at=De>0&&!ms;return i.jsxs("div",{className:`relative p-3 rounded-xl border transition-all flex flex-col justify-between ${at?"bg-slate-100/70 dark:bg-slate-950/70 border-amber-300/50 dark:border-amber-900/40":"bg-white dark:bg-slate-900 border-slate-200 dark:border-slate-750 hover:border-emerald-500 shadow-2sm"}`,children:[at&&i.jsxs("div",{className:"absolute inset-0 rounded-xl backdrop-blur-md bg-slate-900/60 dark:bg-slate-950/75 border border-amber-500/30 flex items-center justify-between px-3.5 py-2 z-10",children:[i.jsxs("div",{className:"flex items-center gap-2",children:[i.jsx(rl,{className:"w-4 h-4 text-amber-400"}),i.jsx("span",{className:"text-xs font-bold text-amber-300",children:"PRO Member Passage"})]}),i.jsxs("button",{onClick:()=>c(!0),className:"px-2.5 py-1 rounded-md bg-gradient-to-r from-amber-500 to-amber-600 hover:from-amber-600 hover:to-amber-700 text-slate-950 font-bold text-[10px] transition-all shadow-sm flex items-center gap-1 active:scale-95 cursor-pointer",children:[i.jsx(fr,{className:"w-3 h-3 fill-current"}),i.jsx("span",{children:"Unlock Passages"})]})]}),i.jsxs("div",{children:[i.jsxs("div",{className:"flex items-center justify-between mb-1.5 text-[10px] text-slate-500 dark:text-slate-400 font-mono",children:[i.jsx("span",{className:"font-semibold text-emerald-600 dark:text-emerald-400 truncate max-w-[150px]",children:Q.station}),i.jsxs("div",{className:"flex items-center gap-1",children:[Q.difficulty&&i.jsx("span",{className:"bg-emerald-50 dark:bg-emerald-950/50 text-emerald-700 dark:text-emerald-300 border border-emerald-200/60 dark:border-emerald-800/40 px-1.5 py-0.5 rounded text-[9px] font-medium",children:Q.difficulty}),Q.sophistication&&i.jsx("span",{className:"bg-amber-50 dark:bg-amber-950/50 text-amber-700 dark:text-amber-300 border border-amber-200/60 dark:border-amber-800/40 px-1.5 py-0.5 rounded text-[9px] font-medium",children:Q.sophistication})]})]}),i.jsxs("p",{className:"text-xs text-slate-700 dark:text-slate-300 leading-relaxed font-sans mb-2",children:['"',Q.cleanText,'"']}),i.jsxs("div",{className:"flex items-center gap-1.5 flex-wrap mb-2",children:[Q.vocabCoverage&&i.jsxs("span",{className:"text-[9px] bg-slate-100 dar
4843k:bg-slate-800 text-slate-600 dark:text-slate-300 px-1.5 py-0.5 rounded",children:["Vocab Density: ",Q.vocabCoverage]}),Q.language&&i.jsx("span",{className:"text-[9px] bg-slate-100 dark:bg-slate-800 text-slate-600 dark:text-slate-300 px-1.5 py-0.5 rounded",children:Q.language})]})]}),!at&&i.jsxs("button",{onClick:()=>{const qe=Q.cleanText,kt={id:Date.now().toString(),originalText:qe,translatedText:`Selected from Curated Study Cabin (${Q.station})`};Ei(Nt=>Nt.some(_t=>_t.originalText===qe)?Nt:[...Nt,kt]),K(kt),lt(!0),ee(!1)},className:"w-full py-1.5 px-2 rounded-lg bg-emerald-50 dark:bg-emerald-950/40 hover:bg-emerald-500 hover:text-white border border-emerald-200 dark:border-emerald-800/50 text-emerald-700 dark:text-emerald-300 font-semibold text-[11px] transition-all flex items-center justify-center gap-1 cursor-pointer",children:[i.jsx(Xa,{className:"w-3 h-3 fill-current"}),i.jsx("span",{children:"Shadow This Passage"})]})]},Q.id)})})]}),i.jsxs("div",{className:"flex-1 bg-slate-50 dark:bg-slate-950/50 p-3.5 sm:p-4 overflow-y-auto scroll-smooth flex flex-col gap-2.5 pr-2 custom-scrollbar",children:[Ut.length===0&&(!Et.userTranscript||Et.userTranscript.trim()==="")&&(!Et.modelTranscript||Et.modelTranscript.trim()==="")&&(Et.status==="connected"&&ht?i.jsxs("div",{className:"flex-1 flex flex-col items-center justify-center p-6 my-2 border border-emerald-500/30 bg-emerald-50/10 rounded-2xl text-center",children:[i.jsx(cn,{className:"w-7 h-7 text-emerald-500 animate-pulse mb-2"}),i.jsx("p",{className:"text-emerald-700 dark:text-emerald-400 font-medium text-sm mb-1",children:"Listening to live broadcast..."}),i.jsx("p",{className:"text-xs text-emerald-600/70 dark:text-emerald-400/70",children:"Waiting for announcer voice. Music and commercial breaks are automatically filtered out."})]}):i.jsx("div",{className:"flex-1 flex items-center justify-center",children:i.jsx("p",{className:"text-slate-400 dark:text-slate-500 text-xs font-medium animate-pulse",children:"Subtitle stream initializing..."})})),Ut.map(Q=>{const De=yt&&(W==null?void 0:W.id)===Q.id,at=yt&&(W==null?void 0:W.id)!==Q.id;return i.jsxs("div",{className:`flex flex-col gap-1 p-3 rounded-xl transition-all duration-200 group relative cursor-pointer ${De?"bg-emerald-50/40 dark:bg-emerald-950/40 border-2 border-emerald-500 shadow-xs opacity-100":at?"bg-white dark:bg-slate-900 border border-slate-100 dark:border-slate-800 opacity-60":"bg-white dark:bg-slate-900 shadow-xs border border-slate-150 dark:border-slate-800 hover:shadow-sm hover:border-emerald-300 dark:hover:border-emerald-500/40"}`,onClick:()=>{console.log("🟢 [Selection Probe] 用户点击选句跟读:",Q.originalText),K(Q),lt(!0)},children:[i.jsxs("div",{className:"absolute top-2.5 right-2.5 flex items-center gap-1 sm:opacity-0 group-hover:opacity-100 transition-opacity z-10",children:[i.jsx("button",{className:`p-1.5 rounded-lg transition-all cursor-pointer ${Br.has(Q.originalText)?"text-amber-500 bg-amber-50 dark:bg-amber-950/60 border border-amber-200/60 dark:border-amber-800/40 opacity-100":"text-slate-400 hover:text-amber-500 hover:bg-amber-50 dark:hover:bg-amber-500/10"}`,title:Br.has(Q.originalText)?"Remove bookmark":"Bookmark phrase",onClick:qe=>{qe.stopPropagation(),ft(Q.originalText,Q.translatedText,(xe==null?void 0:xe.language)||"EN")},children:i.jsx(Jo,{className:`w-3.5 h-3.5 ${Br.has(Q.originalText)?"fill-amber-500":""}`})}),i.jsx("button",{className:"p-1 rounded-md text-slate-400 hover:text-emerald-500 hover:bg-emerald-50 dark:hover:bg-emerald-500/10 transition-colors cursor-pointer",title:"Practice pronunciation",onClick:qe=>{qe.stopPropagation(),console.log("🟢 [Selection Probe] 用户点击选句跟读:",Q.originalText),K(Q),lt(!0)},children:i.jsx(Nn,{className:"w-3.5 h-3.5"})})]}),i.jsx("p",{className:"text-sm md:text-base font-medium text-slate-800 dark:text-slate-100 leading-relaxed pr-12",children:o_(Q.originalText,Q.focusVocab)}),Q.translatedText&&i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400",children:Q.translatedText})]},Q.id)}),(Et.userTranscript||Et.modelTranscript)&&i.jsxs("div",{className:"flex flex-col gap-1 p-3 rounded-xl bg-slate-50 dark:bg-slate-900/40 border border-dashed border-slate-200 dark:border-slate-700/50 opacity-80 pointer-events-none",children:[i.jsxs("p",{className:"text-sm md:text-base font-medium text-slate-700 dark:text-slate-300 leading-relaxed flex items-center flex-wrap",children:[Et.userTranscript?Et.userTranscript:i.jsx("span",{className:"inline-block w-12 h-2 bg-emerald-500/50 animate-pulse rounded"}),i.jsx("span",{className:"inline-block w-1.5 h-3.5 ml-1.5 bg-emerald-500 animate-pulse"})]}),Et.modelTranscript&&i.jsx("p",{className:"text-xs text-slate-400/80 dark:text-slate-500/80",children:Et.modelTranscript})]}),i.jsx("div",{ref:Si})]}),yt&&Ln>0&&i.jsxs("button",{onClick:()=>{lt(!1),Dn(0),setTimeout(()=>{var Q;(Q=Si.current)==null||Q.scrollIntoView({behavior:"smooth"})},100)},className:"absolute bottom-6 right-6 bg-slate-900/95 text-emerald-400 border border-emerald-500/40 px-4 py-2 rounded-full shadow-2xl flex items-center gap-2 cursor-pointer animate-bounce hover:bg-slate-800 hover:scale-105 transition-all font-medium text-xs z-30",children:["🟢 ",Ln," ",t.app.resumeLive]})]}),i.jsx("div",{className:"w-full lg:w-[40%] flex flex-col bg-white dark:bg-slate-900 rounded-2xl border border-slate-100 dar
4843k:border-slate-800 shadow-sm overflow-hidden h-[calc(100vh-140px)] min-h-[550px] max-h-[840px]",children:W?i.jsxs("div",{className:"flex-1 flex flex-col h-full overflow-y-auto custom-scrollbar",children:[i.jsx("div",{className:"p-5 border-b border-slate-100 dark:border-slate-800 shrink-0",children:i.jsxs("div",{className:"bg-slate-50 dark:bg-slate-800/50 rounded-xl p-4 md:p-5",children:[i.jsx("h4",{className:"text-xs font-bold text-slate-400 dark:text-slate-500 uppercase tracking-wider mb-2",children:t.app.targetSentence}),i.jsx("div",{className:"max-h-36 lg:max-h-44 overflow-y-auto custom-scrollbar pr-1.5 my-1",children:i.jsx("p",{className:"text-base lg:text-lg font-medium text-slate-800 dark:text-slate-100 leading-relaxed",children:W?ye!=null&&ye.problemWords?W.originalText.split(/(\b\w+\b)/).map((Q,De)=>ye.problemWords.some(qe=>qe.toLowerCase()===Q.toLowerCase())?i.jsx("span",{className:"decoration-red-400 decoration-wavy underline underline-offset-4 text-red-600",children:Q},De):i.jsx("span",{children:Q},De)):o_(W.originalText,W.focusVocab):t.app.selectSentencePrompt})}),W&&i.jsx("p",{className:"text-xs md:text-sm text-slate-500 dark:text-slate-400 mb-3 mt-2 border-t border-slate-200/50 dark:border-slate-700/50 pt-2",children:W.translatedText}),i.jsxs("div",{className:"flex items-center gap-3 pt-1",children:[i.jsx("button",{onClick:()=>{if(W!=null&&W.originalText&&typeof window<"u"&&"speechSynthesis"in window){window.speechSynthesis.cancel();const Q=new SpeechSynthesisUtterance(W.originalText);Q.lang=(xe==null?void 0:xe.language)||"en-US",window.speechSynthesis.speak(Q)}},className:"p-2 rounded-full bg-white dark:bg-slate-700 shadow-sm border border-slate-200 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 hover:border-emerald-200 dark:hover:border-emerald-500/50 transition-colors cursor-pointer",title:"Listen to original sentence audio",children:i.jsx(on,{className:"w-4 h-4"})}),i.jsxs("button",{onClick:()=>{W!=null&&W.originalText&&ft(W.originalText,W.translatedText,(xe==null?void 0:xe.language)||"EN")},className:`p-2 rounded-full shadow-sm border transition-all cursor-pointer flex items-center gap-1 px-3 text-xs font-semibold ${W&&Br.has(W.originalText)?"bg-amber-50 dark:bg-amber-950/60 border-amber-300 dark:border-amber-700 text-amber-700 dark:text-amber-300":"bg-white dark:bg-slate-700 border-slate-200 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:text-amber-600 hover:border-amber-200"}`,title:W&&Br.has(W.originalText)?"Remove from bookmarks":"Save to bookmarks",children:[i.jsx(Jo,{className:`w-3.5 h-3.5 ${W&&Br.has(W.originalText)?"fill-amber-500 text-amber-500":""}`}),i.jsx("span",{children:W&&Br.has(W.originalText)?t.app.bookmarked:t.app.bookmark})]}),i.jsx("button",{onClick:()=>{he(null),pe(!1)},className:"p-2 rounded-full bg-white dark:bg-slate-700 shadow-sm border border-slate-200 dark:border-slate-600 text-slate-600 dark:text-slate-300 hover:text-emerald-600 dark:hover:text-emerald-400 hover:border-emerald-200 dark:hover:border-emerald-500/50 transition-colors cursor-pointer",title:"Reset evaluation",children:i.jsx(yg,{className:"w-4 h-4"})})]})]})}),i.jsxs("div",{className:"p-6 flex flex-col items-center justify-center min-h-[220px] shrink-0 relative my-auto",children:[i.jsxs("div",{className:`relative flex items-center justify-center w-20 h-20 md:w-24 md:h-24 rounded-full border-4 cursor-pointer group transition-all select-none ${Bn?"opacity-50 grayscale hover:bg-emerald-50 dark:hover:bg-emerald-500/10":""} ${J?"bg-red-100 dark:bg-red-950/50 border-red-500 dark:border-red-400 shadow-xl shadow-red-500/20 animate-pulse":"bg-emerald-50 dark:bg-emerald-500/10 border-emerald-100 dark:border-emerald-500/20 hover:bg-emerald-100 dark:hover:bg-emerald-500/20 hover:scale-105"} ${Ie?"pointer-events-none":""}`,onClick:Ie?void 0:On,title:Ie?r?"AI 评测中...":"Evaluating...":J?r?"点击停止录音并评测":"Click to stop recording & evaluate":r?"点击或按住空格开始录音":"Click or Hold [Space] to record",children:[J&&i.jsxs(i.Fragment,{children:[i.jsx("div",{className:"absolute -inset-3.5 rounded-full border-2 border-red-500/40 animate-ping opacity-75 pointer-events-none"}),i.jsx("div",{className:"absolute -inset-1.5 rounded-full border-2 border-red-400/60 animate-pulse pointer-events-none"})]}),!J&&!Ie&&i.jsx("div",{className:"absolute inset-0 rounded-full border border-emerald-300 dark:border-emerald-400 opacity-0 group-hover:animate-ping"}),Ie?i.jsx(Bs,{className:"w-10 h-10 text-emerald-500 animate-spin"}):J?i.jsx("div",{className:"flex flex-col items-center justify-center",children:i.jsx(Ev,{className:"w-8 h-8 md:w-9 md:h-9 fill-red-500 text-red-500 animate-pulse"})}):i.jsx(Nn,{className:"w-10 h-10 text-emerald-500 dark:text-emerald-400 group-hover:scale-110 transition-transform"})]}),i.jsx("div",{className:"mt-4 text-center select-none flex flex-col items-center gap-1.5",children:Ie?i.jsx("p",{className:"text-sm font-semibold text-emerald-600 dark:text-emerald-400 animate-pulse",children:t.app.evaluating}):J?i.jsxs("div",{className:"flex flex-col items-center gap-1.5",children:[i.jsxs("div",{className:"flex items-center gap-1 my-0.5",children:[i.jsx("span",{className:"w-1 h-3.5 bg-red-500 rounded-full animate-bounce [animation-delay:0ms]"}),i.jsx("span",{className:"w-1 h-5 bg-red-500 rounded-full animate-bounce [animation-delay:150ms]"}),i.jsx("span",{className:"w-1 h-7 bg-red-500 rounded-full animate-bounce [animation-delay:300ms]"}),i.jsx("span",{className:"w-1 h-5 bg-red-500 rounded-full animate-bounce [animation-delay:450ms]"}),i.jsx("span",{className:"w-1 h-3.5 bg-red-500 rounded-full animate-bounce [animation-delay:600ms]"})]}),i.jsx("p",{className:"text-sm font-bold text-red-500 animate-pulse",children:t.app.recording}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 font-medium",children:r?"松开 [Space] 或点击 ⏹️ 结束评测":"Release [Space] or Click ⏹️ to stop & evaluate"})]}):i.jsxs("div",{className:"flex flex-col items-center gap-1",children:[i.jsx("p",{className:"text-xs md:text-sm font-semibold text-slate-700 dark:text-slate-200",children:r?"按住 [Space] 或点击开始录音":"Hold [Space] or Click to record"}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500 font-medium",children:r?"(Hold [Space] or Click to record)":"(按住空格或点击开始)"})]})}),i.jsxs("button",{onClick:Ai,className:"mt-3.5 px-3.5 py-1.5 rounded-xl bg-emerald-500/10 hover:bg-emerald-500/20 text-emerald-700 dark:text-emerald-400 border border-emerald-500/30 text-xs font-bold flex items-center gap-1.5 transition-all cursor-pointer active:scale-95 shadow-2xs",title:r?"点击预览专业级发音诊断报告弹窗":"Click to preview Diagnostic Report Modal",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-500"}),i.jsx("span",{children:r?"✨ 预览发音深度诊断报告 (Demo)":"✨ Preview Diagnostic Report"})]}),Bn&&i.jsxs("div",{className:"mt-3 px-4 py-2 bg-red-50 dark:bg-red-500/10 text-red-600 dark:text-red-400 text-xs rounded-lg border border-red-100 dark:border-red-500/20 flex items-center gap-2 animate-in fade-in slide-in-from-top-2 text-center max-w-[85%]",children:[i.jsx(Qa,{size:14,className:"shrink-0"}),i.jsx("span",{children:Bn})]})]}),ye!==null&&!Ie&&i.jsxs("div",{className:"border-t border-slate-100 dar
4843k:border-slate-800 p-5 flex flex-col bg-white dark:bg-slate-900 shrink-0 min-h-[280px]",children:[i.jsxs("div",{className:"flex flex-row items-center h-[240px] min-h-[220px] pb-4",children:[i.jsxs("div",{className:"flex flex-col items-center justify-center w-1/3 pr-4 border-r border-slate-100 dark:border-slate-800",children:[i.jsx("span",{className:"text-xs font-bold text-slate-400 dark:text-slate-500 uppercase tracking-wider mb-2 text-center",children:t.app.estimatedBand}),i.jsx("span",{className:"text-5xl font-extrabold text-emerald-600 dark:text-emerald-400",children:(ye==null?void 0:ye.estimatedBand)||(ye!=null&&ye.overallScore?(ye.overallScore/10).toFixed(1):"--")}),(ye==null?void 0:ye.framework)&&i.jsx("span",{className:"text-[10px] font-semibold tracking-wider text-slate-400 uppercase mt-1 text-center",children:ye.framework})]}),i.jsx("div",{className:"w-2/3 h-full pt-4",children:i.jsx(Nv,{width:"100%",height:"100%",children:i.jsxs(zv,{cx:"50%",cy:"50%",outerRadius:"70%",data:(ye==null?void 0:ye.radarMetrics)||[{metric:"Accuracy",value:(ye==null?void 0:ye.overallScore)||0},{metric:"Fluency",value:(ye==null?void 0:ye.overallScore)||0},{metric:"Intonation",value:(ye==null?void 0:ye.overallScore)||0},{metric:"Pacing",value:(ye==null?void 0:ye.overallScore)||0},{metric:"Stress",value:(ye==null?void 0:ye.overallScore)||0}],margin:{top:20,right:30,bottom:20,left:30},children:[i.jsx(lx,{stroke:"#e2e8f0",strokeDasharray:"3 3"}),i.jsx(cx,{dataKey:"metric",tick:{fill:"#64748b",fontSize:11,fontWeight:600}}),i.jsx(ux,{name:"Score",dataKey:"value",stroke:"#10b981",strokeWidth:2,fill:"#34d399",fillOpacity:.4})]})})})]}),(ye==null?void 0:ye.phoneticFeedback)&&i.jsxs("div",{className:"mt-4 p-3 bg-emerald-50 dark:bg-emerald-900/20 rounded-lg text-xs text-emerald-700 dark:text-emerald-400 leading-relaxed",children:[i.jsxs("span",{className:"font-semibold",children:["💡 ",t.app.coachAdvice,":"]})," ",ye.phoneticFeedback]})]})]}):i.jsx("div",{className:"h-full flex flex-col items-center justify-center text-center p-8 border-2 border-dashed border-slate-200 dark:border-slate-800 rounded-2xl bg-slate-50/50 dark:bg-slate-800/20 m-4 flex-1",children:je==="continuous"?i.jsxs("div",{className:"flex flex-col items-center max-w-sm",children:[i.jsx("div",{className:"p-4 rounded-2xl bg-emerald-100 dark:bg-emerald-950/80 text-emerald-600 dark:text-emerald-400 mb-4",children:i.jsx(Nn,{className:`w-10 h-10 ${Gt?"animate-bounce text-red-500":"animate-pulse"}`})}),i.jsxs("h3",{className:"text-lg font-bold text-slate-800 dark:text-slate-200 mb-1.5 flex items-center gap-2",children:[i.jsx("span",{children:t.app.continuousMode}),i.jsx("span",{className:"text-[10px] bg-amber-500/10 text-amber-600 dark:text-amber-400 font-extrabold px-1.5 py-0.5 rounded border border-amber-500/20",children:"PRO"})]}),i.jsx("p",{className:"text-xs text-slate-500 dark:text-slate-400 mb-5 leading-relaxed",children:Gt?r?`正在连续录音中(已录制 ${Mr} 秒)。请跟随电台广播同步持续跟读!`:`Continuous speech is actively being recorded (${Mr}s elapsed). Keep shadowing along with the broadcast stream!`:r?"无需暂停,不间断跟读全球电台。AI 将对齐音频与广播原文,定位发音薄弱单词,并生成专属复习笔记本。":"Shadow global radio non-stop without pausing. AI aligns your entire audio recording with broadcast text, diagnoses problem words, and generates a study notebook."}),Gt?i.jsxs("div",{className:"flex flex-col items-center gap-3 w-full",children:[i.jsxs("div",{className:"w-full bg-slate-900 text-emerald-400 p-3 rounded-xl border border-emerald-500/30 flex items-center justify-between text-xs font-mono",children:[i.jsxs("span",{className:"flex items-center gap-1.5",children:[i.jsx("span",{className:"w-2 h-2 rounded-full bg-red-500 animate-ping"}),r?"已用时间":"Elapsed",": ",Math.floor(Mr/60),":",(Mr%60).toString().padStart(2,"0")]}),i.jsxs("span",{children:[r?"目标":"Target",": ",us," ",r?"分钟":"mins"]})]}),i.jsxs("div",{className:"flex items-center gap-2 w-full",children:[i.jsx("button",{onClick:xl,className:"flex-1 py-2 px-3 rounded-xl bg-slate-200 dark:bg-slate-800 text-slate-700 dark:text-slate-300 font-semibold text-xs transition-colors cursor-pointer",children:r?"取消":"Cancel"}),i.jsxs("button",{onClick:ii,disabled:$t,className:"flex-2 py-2 px-4 roun
4843ded-xl bg-emerald-500 hover:bg-emerald-400 text-slate-950 font-extrabold text-xs flex items-center justify-center gap-1.5 shadow-md shadow-emerald-500/20 transition-all cursor-pointer active:scale-95 disabled:opacity-50",children:[i.jsx(At,{className:"w-3.5 h-3.5 fill-current"}),i.jsx("span",{children:r?"完成并分析":"Finish & Analyze"})]})]})]}):i.jsxs("button",{onClick:()=>{if(!ms){c(!0);return}dt(!0)},className:"px-5 py-2.5 rounded-xl bg-emerald-600 hover:bg-emerald-500 text-white font-bold text-xs flex items-center gap-2 shadow-lg shadow-emerald-600/20 transition-all cursor-pointer active:scale-95",children:[i.jsx(Nn,{className:"w-4 h-4"}),i.jsx("span",{children:t.app.startContinuous})]})]}):i.jsxs("div",{className:"flex flex-col items-center max-w-xs",children:[i.jsx(Er,{className:"w-12 h-12 text-emerald-500/60 mb-4 animate-pulse"}),i.jsx("h3",{className:"text-lg font-bold text-slate-800 dark:text-slate-200 mb-2",children:t.app.waitingTargetSentence}),i.jsx("p",{className:"text-sm text-slate-500 dark:text-slate-400",children:t.app.clickSentenceToShadow})]})})})]})})]}),i.jsxs("div",{className:"mt-8 pt-4 border-t border-slate-200/60 dark:border-slate-800/60 flex flex-wrap items-center justify-between gap-3 text-xs text-slate-500 dark:text-slate-400",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2",children:[i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:r?"快速导航与语言专项专题:":"Explore Language Hubs & Tools:"}),i.jsx("a",{href:"/",className:"inline-flex items-center gap-1 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors font-medium underline",title:"Home - Global Podcasts Listening Practice",children:i.jsx("span",{children:r?"首页 (全球电台播客)":"Home (Live Radio)"})}),i.jsxs("a",{href:"/spanish-pronunciation",className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-lg bg-amber-500/10 hover:bg-amber-500/20 text-amber-700 dark:text-amber-300 border border-amber-500/25 transition-colors font-semibold",title:"Spanish Pronunciation Coach: Master Rolling R (RR), Vowels & Stress Rules",children:[i.jsx("span",{children:"🇪🇸"}),i.jsx("span",{children:r?"西语发音教练 (Spanish Coach)":"Spanish Coach (RR Lab)"})]}),i.jsxs("a",{href:"/french-listening-practice",className:"inline-flex items-center gap-1.5 px-2 py-0.5 rounded-lg bg-blue-500/10 hover:bg-blue-500/20 text-blue-700 dark:text-blue-300 border border-blue-500/25 transition-colors font-semibold",title:"French Listening Practice: Real Radio & Podcasts | RadioShadow",children:[i.jsx("span",{children:"🇫🇷"}),i.jsx("span",{children:r?"法语听力练习 (French Practice)":"French Practice (Radio & Podcasts)"})]}),i.jsxs("a",{href:"/learn-spanish",className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 hover:underline font-semibold",title:"Spanish Listening Practice with Native Podcasts & AI Shadowing",children:[i.jsx(vI,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:r?"西语听力实战 (DELE/RTVE)":"Spanish Listening Practice"})]}),i.jsxs("a",{href:"/nice-to-meet-you-in-spanish",className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 hover:underline font-semibold",title:"How to Say Nice to Meet You in Spanish (10+ Phrases & Audio)",children:[i.jsx("span",{children:"👋"}),i.jsx("span",{children:"Nice to Meet You in Spanish"})]}),i.jsxs("a",{href:"/how-to-introduce-yourself-in-spanish",className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 hover:underline font-semibold",title:"How to Introduce Yourself in Spanish (10+ Phrases & Audio)",children:[i.jsx("span",{children:"🙋"}),i.jsx("span",{children:"How to Introduce Yourself in Spanish"})]}),i.jsxs("a",{href:"/how-to-order-food-in-spanish",className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 hover:underline font-semibold",title:"How to Order Food in Spanish (20+ Phrases & Audio)",children:[i.jsx("span",{children:"🍽️"}),i.jsx("span",{children:"How to Order Food in Spanish"})]}),i.jsxs("a",{href:"/spanish-pronunciation",className:"inline-flex items-center gap-1 text-emerald-600 dark:text-emerald-400 hover:underline font-semibold",title:"Spanish Pronunciation Guide & Rolling R Trainer",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:r?"西语发音与大舌颤音":"Spanish Pronunciation Guide"})]}),i.jsxs("a",{href:"/ielts-speaking-topics-2026",className:"inline-flex items-center gap-1 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors font-medium underline",title:"IELTS Speaking Topics 2026: Full Question Bank",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:"Full 2026 Topic Bank"})]}),i.jsxs("a",{href:"/ielts-speaking-mock-test",onClick:Q=>{Q.preventDefault(),window.history.pushState({},"","/ielts-speaking-mock-test"),e("/ielts-speaking-mock-test"),window.scrollTo({top:0,behavior:"smooth"})},className:"inline-flex items-center gap-1 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors font-medium underline cursor-pointer",title:"IELTS Speaking Mock Test & 1v1 AI Simulation Exam",children:[i.jsx(yn,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:r?"雅思口语全真模考":"IELTS Speaking 1v1 Mock"})]}),i.jsxs("a",{href:"/blog",className:"inline-flex items-center gap-1 hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors font-medium underline",title:"Language Learning Publications & Podcast Listening Practice Guides",children:[i.jsx(Ys,{className:"w-3.5 h-3.5 text-emerald-600"}),i.jsx("span",{children:r?"语言学习专栏与跟读指南":"Language Learning Blog"})]}),i.jsx("a",{href:"/sitemap.xml",target:"_blank",rel:"noopener noreferrer",className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors underline",children:"Sitemap"})]}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:r?"覆盖英语、西语、法语、德语、日语等多国真实播客与听力原声":"Real-time podcasts and audio in English, Spanish, French, German & Japanese"})]}),i.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-200/50 dark:border-slate-800/50 flex flex-wrap items-center justify-between gap-3 text-xs",children:[i.jsxs("div",{className:"flex flex-wrap items-center gap-2.5",children:[i.jsx("span",{className:"font-semibold text-slate-700 dark:text-slate-300",children:r?"学习工具与集成挂件:":"Learning Tools & Integrations:"}),i.jsxs("button",{id:"footer-open-tour-btn",onClick:()=>{ps("welcome"),Ua(!0)},className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-slate-100 hover:bg-slate-200/90 dark:bg-slate-800 dark:hover:bg-slate-700 text-slate-700 dark:text-slate-200 border border-slate-200/80 dark:border-slate-700 transition-all shadow-2xs font-semibold cursor-pointer active:scale-95 group",title:Va?`${Va.levelTitle} (Band ${Va.estimatedBand.toFixed(1)})`:r?"选择目标语言与电台导览":"Language & Radio Guide",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500 group-hover:rotate-12 transition-transform"}),i.jsx("span",{children:r?"语言导览 (切换学习语言)":"Language Guide (Switch Language)"}),Va&&i.jsxs("span",{className:"text-[9px] font-mono font-bold bg-amber-500/15 text-amber-700 dark:text-amber-300 px-1 py-0.2 rounded border border-amber-500/25",children:["B",Va.estimatedBand.toFixed(1)]})]}),i.jsxs("button",{id:"footer-open-embed-btn",onClick:()=>R(!0),className:"inline-flex items-center gap-1.5 px-3 py-1.5 rounded-xl bg-emerald-500/10 hover:bg-emerald-500/20 dark:bg-emerald-950/40 dark:hover:bg-emerald-900/60 text-emerald-700 dark:text-emerald-300 border border-emerald-500/30 transition-all shadow-2xs font-semibold cursor-pointer active:scale-95",title:r?"获取站外嵌入网页挂件代码":"Get responsive audio player embed snippet",children:[i.jsx(xg,{className:"w-3.5 h-3.5 text-emerald-600 dark:text-emerald-400"}),i.jsx("span",{children:r?"嵌入播客组件 (<Embed/>)":"Embed Audio Widget (<Embed/>)"})]})]}),i.jsx("p",{className:"text-[11px] text-slate-400 dark:text-slate-500",children:r?"支持将电台播放器免登录嵌入到个人博客或网站":"Embed live streaming audio into your website, blog or Notion"})]}),i.jsxs("div",{className:"mt-3 pt-3 border-t border-slate-200/40 dark:border-slate-800/40 flex flex-col sm:flex-row items-center justify-between text-xs text-slate-400 gap-3 pb-6",children:[i.jsxs("div",{className:"flex flex-col sm:flex-row flex-wrap items-center gap-3",children:[i.jsx("p",{children:t.footer.copyright}),i.jsxs("a",{href:"https://www.toolpilot.ai/",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center gap-1.5 px-3 py-1 rounded-full text-xs font-medium bg-slate-100 hover:bg-slate-200 dark:bg-slate-800/80 dark:hover:bg-slate-800 text-slate-600 dar
4843k:text-slate-300 border border-slate-200 dark:border-slate-700/80 transition-all shadow-2xs group",title:"Powered by ToolPilot.ai",children:[i.jsx(At,{className:"w-3.5 h-3.5 text-amber-500 group-hover:rotate-12 transition-transform"}),i.jsxs("span",{children:["Powered by ",i.jsx("strong",{className:"font-semibold text-slate-800 dark:text-white",children:"ToolPilot.ai"})]})]}),i.jsx("a",{href:"https://startupbase.io/products/radioshadow-ai?utm_source=startupbase&utm_medium=badge&utm_campaign=launch-badge-neutral",target:"_blank",rel:"noopener noreferrer",className:"inline-flex items-center hover:opacity-90 transition-opacity",title:"Launched on StartupBase",children:i.jsx("img",{src:"https://statics.startupbase.io/site/badges/launched-on-sb-neutral.svg",alt:"Launched on StartupBase",height:"34",style:{height:"34px",width:"auto"}})})]}),i.jsxs("div",{className:"flex items-center gap-4",children:[i.jsxs("button",{onClick:()=>{ps("welcome"),Ua(!0)},className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors cursor-pointer font-medium flex items-center gap-1",title:r?"语言导览":"Language Guide",children:[i.jsx(At,{className:"w-3 h-3 text-amber-500"}),i.jsx("span",{children:r?"语言导览":"Language Guide"})]}),i.jsx("span",{children:"•"}),i.jsxs("button",{onClick:()=>R(!0),className:"hover:text-emerald-600 dark:hover:text-emerald-400 transition-colors cursor-pointer font-medium flex items-center gap-1",title:r?"嵌入代码":"Embed Widget",children:[i.jsx(xg,{className:"w-3 h-3 text-emerald-500"}),i.jsx("span",{children:r?"嵌入组件":"Embed"})]}),i.jsx("span",{children:"•"}),i.jsx("button",{onClick:()=>j("terms"),className:"hover:text-emerald-600 dark:hover:text-emerald-400 underline transition-colors cursor-pointer font-medium",children:t.footer.terms}),i.jsx("span",{children:"•"}),i.jsx("button",{onClick:()=>j("privacy"),className:"hover:text-emerald-600 dark:hover:text-emerald-400 underline transition-colors cursor-pointer font-medium",children:t.footer.privacy})]})]})]})}),i.jsx("footer",{className:"sticky bottom-0 z-40 bg-white/95 dark:bg-slate-900/95 backdrop-blur shadow-2xl",children:i.jsx(qFe,{station:xe,isPlaying:ht,setIsPlaying:Q=>{if(Q&&yt&&(lt(!1),Dn(0)),!Q&&Gt){ii();return}mn(Q)},isPracticeFrozen:yt})}),i.jsx(l5,{isOpen:D!==null,initialTab:D||"terms",onClose:()=>j(null)}),i.jsx(ZFe,{isOpen:P,onClose:()=>R(!1),defaultStationId:(xe==null?void 0:xe.id)||"en-bbc"}),i.jsx(Z2,{isOpen:l,onClose:()=>c(!1),user:qt,onOpenAuthModal:()=>{c(!1),h(!0)},onOpenLegal:Q=>j(Q),stats:{wordsCaught:O.vocabCount,shadowingsDone:O.shadowCount,globalStations:"10,000+"}}),i.jsx(ste,{isOpen:wa,initialMode:Wl,activeLanguageId:Sn,onClose:()=>{Ua(!1),ps("welcome")},onSelectLanguageAndStart:Q=>{yr(Q),mn(!0),k("explore")},onLaunchBbc:()=>{const Q=M0.find(De=>De.id==="english");Q&&(yr(Q),mn(!0))},onSelectTrack:Q=>N(Q),onSelectViewMode:Q=>k(Q),onOpenPaywall:()=>c(!0)}),i.jsx(JFe,{isOpen:lr&&!wa&&!le&&!l,languageName:(In==null?void 0:In.name)||(xe==null?void 0:xe.language)||"Target Language",isZh:r,onStartCalibration:()=>{Vr(!1),ps("calibration"),Ua(!0)},onClose:()=>{Vr(!1);try{sessionStorage.setItem("radioshadow_calibration_dismissed","true")}catch{}}}),Fr&&i.jsx(ate,{report:Fr,audioBlob:Qn,onClose:()=>As(null),onNavigateToDashboard:()=>{window.location.href="/dashboard"},onSaveWord:async(Q,De)=>{if(qt!=null&&qt.uid)try{await Kf(qs(fn,"saved_sentences"),{userId:qt.uid,originalText:Q,translatedText:De,language:(xe==null?void 0:xe.language)||"English",savedAt:Sd()})}catch(at){console.error("Save word error:",at)}}}),le&&Ce&&i.jsx(ite,{evaluationResult:Ce.evaluationResult,targetSentence:Ce.targetSentence,translatedSentence:Ce.translatedSentence,userAudioUrl:Ce.userAudioUrl,nativeAudioUrl:Ce.nativeAudioUrl,stationName:Ce.stationName,language:Ce.language,onClose:()=>ce(!1),onSaveWord:async(Q,De)=>{if(qt!=null&&qt.uid)try{await Kf(qs(fn,"saved_sentences"),{userId:qt.uid,originalText:Q,translatedText:De,language:Ce.language||"English",savedAt:Sd()}),tt(r?`已将 "${Q}" 存入生词本`:`Saved "${Q}" to Notebook`),setTimeout(()=>tt(null),3e3)}catch(at){console.error("Save word error:",at)}}}),Yl&&i.jsxs("div",{className:"fixed bottom-20 left-1/2 -translate-x-1/2 z-50 bg-slate-900/90 dark:bg-slate-800/90 text-white border border-emerald-500/40 px-4 py-2.5 rounded-2xl shadow-2xl flex items-center gap-2 text-xs font-semibold backdrop-blur-md animate-in fade-in slide-in-from-bottom-3 duration-200",children:[i.jsx(Jo,{className:"w-4 h-4 text-amber-400 fill-amber-400"}),i.jsx("span",{children:Yl})]}),i.jsx(x6e,{userEmail:qt==null?void 0:qt.email,currentStationName:xe==null?void 0:xe.name,isPaywallActive:l}),i.jsx(B6e,{isOpen:Bi,onClose:()=>Ca(!1),onSelectStation:Q=>{oi(Q),setTimeout(()=>{const De=document.getElementById("theater-header-bar")||document.getElementById("theater-container")||document.getElementById("root");De&&De.scrollIntoView({behavior:"smooth",block:"start"})},300),r_("wizard_station_selected",{station_name:Q.name,language:Q.language,country:Q.country})}}),_&&i.jsx("div",{className:`fixed inset-0 z-50 overflow-y-auto ${s?"bg-slate-950 text-slate-100":"bg-slate-50 text-slate-900"}`,children:i.jsx(l$,{onBackToRadio:()=>I(!1),onOpenPaywall:()=>c(!0),onOpenAuthModal:()=>h(!0),activeStationName:(xe==null?void 0:xe.name)||"BBC World Service",darkMode:s,onToggleDarkMode:o,initialSnippet:W!=null&&W.originalText||(Zl=Ut[Ut.length-1])!=null&&Zl.originalText?{id:`broadcast_${Date.now()}`,language:(xe==null?void 0:xe.language)||"English",topic:"Current Broadcast Affairs",headline:`Live Broadcast excerpt from ${(xe==null?void 0:xe.name)||"Global Radio"}`,stationSource:(xe==null?void 0:xe.name)||"Global Radio",snippet:(W==null?void 0:W.originalText)||((of=Ut[Ut.length-1])==null?void 0:of.originalText)||"",vocabularyHighlights:[]}:null})})]})}p6e();Qne.createRoot(document.getElementById("root")).render(i.jsx(S.StrictMode,{children:i.jsx(Zne,{children:i.jsx(Xfe,{children:i.jsx($6e,{})})})}));

Line numbers count LF bytes from the start of the resource, as the search results do. Vendor segments are library code the classifier recognised; they are stored but not indexed. Bytes are shown as Latin1 characters, one per byte.