tokmon 0.28.8 → 0.29.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +9 -5
- package/dist/{bootstrap-ink-PYYVQAYP.js → bootstrap-ink-MPWICEIJ.js} +136 -58
- package/dist/{chunk-BZFDTIFV.js → chunk-3D6TO5TS.js} +2 -2
- package/dist/{chunk-6E2OJCIQ.js → chunk-5Q5HUOP4.js} +11 -4
- package/dist/{chunk-RY24UHMK.js → chunk-AUUBRLBG.js} +2 -2
- package/dist/{chunk-MIXBF6QU.js → chunk-BLUQGJKM.js} +2 -2
- package/dist/{chunk-UON47FYF.js → chunk-BYLWQ46U.js} +19 -2
- package/dist/{chunk-O7ORALKA.js → chunk-G2A3DVPU.js} +80 -1
- package/dist/{chunk-DESEB73E.js → chunk-WPZTPMBX.js} +1 -1
- package/dist/{chunk-WHOIUSJM.js → chunk-YWDMEU3L.js} +1 -1
- package/dist/{cli-command-XPFM6LUP.js → cli-command-WL2K5WWR.js} +145 -13
- package/dist/cli.js +6 -6
- package/dist/{config-JEDXAKPZ.js → config-B7QJQTU2.js} +7 -1
- package/dist/{daemon-KFMXYG7V.js → daemon-A3WGDRFT.js} +6 -6
- package/dist/daemon-handle-4E7RSSDB.js +11 -0
- package/dist/server-P6BRXBZ5.js +12 -0
- package/dist/web/assets/{Area-BqyvRn2x.js → Area-CEpf7_6d.js} +1 -1
- package/dist/web/assets/{analytics-B6QwqU9g.js → analytics-CdjcYtmK.js} +2 -2
- package/dist/web/assets/{breakdown-DYnVKScr.js → breakdown-DM6g0evr.js} +1 -1
- package/dist/web/assets/{button-CnT5g-Jl.js → button-Cu4co7ZR.js} +1 -1
- package/dist/web/assets/{chart-Duz9D-nH.js → chart-YlnVH1If.js} +1 -1
- package/dist/web/assets/{explore-P2EolJrt.js → explore-kLpZWR-_.js} +1 -1
- package/dist/web/assets/index-Dd37pBKy.js +83 -0
- package/dist/web/assets/index-PpTp4nyP.css +1 -0
- package/dist/web/assets/{models-8B4FBxr7.js → models-XKfoWTDv.js} +2 -2
- package/dist/web/assets/{overview-DXA_HAsw.js → overview-DC-WVKZ6.js} +2 -2
- package/dist/web/assets/{panel-gxLFBb8y.js → panel-B_U9oe1x.js} +1 -1
- package/dist/web/assets/settings-sheet-B7BuJ3j8.js +1 -0
- package/dist/web/assets/{share-sheet-CXdyA1ga.js → share-sheet-BaEXe1m9.js} +1 -1
- package/dist/web/assets/{timeline-CzC85trW.js → timeline-ar9mdhcb.js} +1 -1
- package/dist/web/index.html +2 -2
- package/package.json +1 -1
- package/dist/daemon-handle-6RYUJPC2.js +0 -11
- package/dist/server-LNFK5MRX.js +0 -12
- package/dist/web/assets/index-9hkGpa7j.js +0 -83
- package/dist/web/assets/index-ZmOS8p9O.css +0 -1
- package/dist/web/assets/settings-sheet-CJJl-3Gw.js +0 -1
|
@@ -0,0 +1,83 @@
|
|
|
1
|
+
const __vite__mapDeps=(i,m=__vite__mapDeps,d=(m.f||(m.f=["./share-sheet-BaEXe1m9.js","./button-Cu4co7ZR.js","./chart-YlnVH1If.js","./Area-CEpf7_6d.js","./overview-DC-WVKZ6.js","./panel-B_U9oe1x.js","./timeline-ar9mdhcb.js","./analytics-CdjcYtmK.js","./breakdown-DM6g0evr.js","./models-XKfoWTDv.js","./explore-kLpZWR-_.js","./settings-sheet-B7BuJ3j8.js"])))=>i.map(i=>d[i]);
|
|
2
|
+
var Jb=Object.defineProperty;var Gb=(e,t,n)=>t in e?Jb(e,t,{enumerable:!0,configurable:!0,writable:!0,value:n}):e[t]=n;var A=(e,t,n)=>Gb(e,typeof t!="symbol"?t+"":t,n);(function(){const t=document.createElement("link").relList;if(t&&t.supports&&t.supports("modulepreload"))return;for(const i of document.querySelectorAll('link[rel="modulepreload"]'))o(i);new MutationObserver(i=>{for(const c of i)if(c.type==="childList")for(const l of c.addedNodes)l.tagName==="LINK"&&l.rel==="modulepreload"&&o(l)}).observe(document,{childList:!0,subtree:!0});function n(i){const c={};return i.integrity&&(c.integrity=i.integrity),i.referrerPolicy&&(c.referrerPolicy=i.referrerPolicy),i.crossOrigin==="use-credentials"?c.credentials="include":i.crossOrigin==="anonymous"?c.credentials="omit":c.credentials="same-origin",c}function o(i){if(i.ep)return;i.ep=!0;const c=n(i);fetch(i.href,c)}})();var R$=typeof globalThis<"u"?globalThis:typeof window<"u"?window:typeof global<"u"?global:typeof self<"u"?self:{};function Yb(e){return e&&e.__esModule&&Object.prototype.hasOwnProperty.call(e,"default")?e.default:e}var fh={exports:{}},fa={},dh={exports:{}},Te={};/**
|
|
3
|
+
* @license React
|
|
4
|
+
* react.production.min.js
|
|
5
|
+
*
|
|
6
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
7
|
+
*
|
|
8
|
+
* This source code is licensed under the MIT license found in the
|
|
9
|
+
* LICENSE file in the root directory of this source tree.
|
|
10
|
+
*/var Tv;function Xb(){if(Tv)return Te;Tv=1;var e=Symbol.for("react.element"),t=Symbol.for("react.portal"),n=Symbol.for("react.fragment"),o=Symbol.for("react.strict_mode"),i=Symbol.for("react.profiler"),c=Symbol.for("react.provider"),l=Symbol.for("react.context"),d=Symbol.for("react.forward_ref"),h=Symbol.for("react.suspense"),p=Symbol.for("react.memo"),y=Symbol.for("react.lazy"),g=Symbol.iterator;function v(I){return I===null||typeof I!="object"?null:(I=g&&I[g]||I["@@iterator"],typeof I=="function"?I:null)}var w={isMounted:function(){return!1},enqueueForceUpdate:function(){},enqueueReplaceState:function(){},enqueueSetState:function(){}},S=Object.assign,E={};function F(I,Z,pe){this.props=I,this.context=Z,this.refs=E,this.updater=pe||w}F.prototype.isReactComponent={},F.prototype.setState=function(I,Z){if(typeof I!="object"&&typeof I!="function"&&I!=null)throw Error("setState(...): takes an object of state variables to update or a function which returns an object of state variables.");this.updater.enqueueSetState(this,I,Z,"setState")},F.prototype.forceUpdate=function(I){this.updater.enqueueForceUpdate(this,I,"forceUpdate")};function K(){}K.prototype=F.prototype;function _(I,Z,pe){this.props=I,this.context=Z,this.refs=E,this.updater=pe||w}var L=_.prototype=new K;L.constructor=_,S(L,F.prototype),L.isPureReactComponent=!0;var C=Array.isArray,D=Object.prototype.hasOwnProperty,$={current:null},N={key:!0,ref:!0,__self:!0,__source:!0};function T(I,Z,pe){var me,le={},Fe=null,fe=null;if(Z!=null)for(me in Z.ref!==void 0&&(fe=Z.ref),Z.key!==void 0&&(Fe=""+Z.key),Z)D.call(Z,me)&&!N.hasOwnProperty(me)&&(le[me]=Z[me]);var ke=arguments.length-2;if(ke===1)le.children=pe;else if(1<ke){for(var Pe=Array(ke),Ve=0;Ve<ke;Ve++)Pe[Ve]=arguments[Ve+2];le.children=Pe}if(I&&I.defaultProps)for(me in ke=I.defaultProps,ke)le[me]===void 0&&(le[me]=ke[me]);return{$$typeof:e,type:I,key:Fe,ref:fe,props:le,_owner:$.current}}function q(I,Z){return{$$typeof:e,type:I.type,key:Z,ref:I.ref,props:I.props,_owner:I._owner}}function ee(I){return typeof I=="object"&&I!==null&&I.$$typeof===e}function ne(I){var Z={"=":"=0",":":"=2"};return"$"+I.replace(/[=:]/g,function(pe){return Z[pe]})}var H=/\/+/g;function k(I,Z){return typeof I=="object"&&I!==null&&I.key!=null?ne(""+I.key):Z.toString(36)}function U(I,Z,pe,me,le){var Fe=typeof I;(Fe==="undefined"||Fe==="boolean")&&(I=null);var fe=!1;if(I===null)fe=!0;else switch(Fe){case"string":case"number":fe=!0;break;case"object":switch(I.$$typeof){case e:case t:fe=!0}}if(fe)return fe=I,le=le(fe),I=me===""?"."+k(fe,0):me,C(le)?(pe="",I!=null&&(pe=I.replace(H,"$&/")+"/"),U(le,Z,pe,"",function(Ve){return Ve})):le!=null&&(ee(le)&&(le=q(le,pe+(!le.key||fe&&fe.key===le.key?"":(""+le.key).replace(H,"$&/")+"/")+I)),Z.push(le)),1;if(fe=0,me=me===""?".":me+":",C(I))for(var ke=0;ke<I.length;ke++){Fe=I[ke];var Pe=me+k(Fe,ke);fe+=U(Fe,Z,pe,Pe,le)}else if(Pe=v(I),typeof Pe=="function")for(I=Pe.call(I),ke=0;!(Fe=I.next()).done;)Fe=Fe.value,Pe=me+k(Fe,ke++),fe+=U(Fe,Z,pe,Pe,le);else if(Fe==="object")throw Z=String(I),Error("Objects are not valid as a React child (found: "+(Z==="[object Object]"?"object with keys {"+Object.keys(I).join(", ")+"}":Z)+"). If you meant to render a collection of children, use an array instead.");return fe}function V(I,Z,pe){if(I==null)return I;var me=[],le=0;return U(I,me,"","",function(Fe){return Z.call(pe,Fe,le++)}),me}function J(I){if(I._status===-1){var Z=I._result;Z=Z(),Z.then(function(pe){(I._status===0||I._status===-1)&&(I._status=1,I._result=pe)},function(pe){(I._status===0||I._status===-1)&&(I._status=2,I._result=pe)}),I._status===-1&&(I._status=0,I._result=Z)}if(I._status===1)return I._result.default;throw I._result}var B={current:null},X={transition:null},re={ReactCurrentDispatcher:B,ReactCurrentBatchConfig:X,ReactCurrentOwner:$};function te(){throw Error("act(...) is not supported in production builds of React.")}return Te.Children={map:V,forEach:function(I,Z,pe){V(I,function(){Z.apply(this,arguments)},pe)},count:function(I){var Z=0;return V(I,function(){Z++}),Z},toArray:function(I){return V(I,function(Z){return Z})||[]},only:function(I){if(!ee(I))throw Error("React.Children.only expected to receive a single React element child.");return I}},Te.Component=F,Te.Fragment=n,Te.Profiler=i,Te.PureComponent=_,Te.StrictMode=o,Te.Suspense=h,Te.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=re,Te.act=te,Te.cloneElement=function(I,Z,pe){if(I==null)throw Error("React.cloneElement(...): The argument must be a React element, but you passed "+I+".");var me=S({},I.props),le=I.key,Fe=I.ref,fe=I._owner;if(Z!=null){if(Z.ref!==void 0&&(Fe=Z.ref,fe=$.current),Z.key!==void 0&&(le=""+Z.key),I.type&&I.type.defaultProps)var ke=I.type.defaultProps;for(Pe in Z)D.call(Z,Pe)&&!N.hasOwnProperty(Pe)&&(me[Pe]=Z[Pe]===void 0&&ke!==void 0?ke[Pe]:Z[Pe])}var Pe=arguments.length-2;if(Pe===1)me.children=pe;else if(1<Pe){ke=Array(Pe);for(var Ve=0;Ve<Pe;Ve++)ke[Ve]=arguments[Ve+2];me.children=ke}return{$$typeof:e,type:I.type,key:le,ref:Fe,props:me,_owner:fe}},Te.createContext=function(I){return I={$$typeof:l,_currentValue:I,_currentValue2:I,_threadCount:0,Provider:null,Consumer:null,_defaultValue:null,_globalName:null},I.Provider={$$typeof:c,_context:I},I.Consumer=I},Te.createElement=T,Te.createFactory=function(I){var Z=T.bind(null,I);return Z.type=I,Z},Te.createRef=function(){return{current:null}},Te.forwardRef=function(I){return{$$typeof:d,render:I}},Te.isValidElement=ee,Te.lazy=function(I){return{$$typeof:y,_payload:{_status:-1,_result:I},_init:J}},Te.memo=function(I,Z){return{$$typeof:p,type:I,compare:Z===void 0?null:Z}},Te.startTransition=function(I){var Z=X.transition;X.transition={};try{I()}finally{X.transition=Z}},Te.unstable_act=te,Te.useCallback=function(I,Z){return B.current.useCallback(I,Z)},Te.useContext=function(I){return B.current.useContext(I)},Te.useDebugValue=function(){},Te.useDeferredValue=function(I){return B.current.useDeferredValue(I)},Te.useEffect=function(I,Z){return B.current.useEffect(I,Z)},Te.useId=function(){return B.current.useId()},Te.useImperativeHandle=function(I,Z,pe){return B.current.useImperativeHandle(I,Z,pe)},Te.useInsertionEffect=function(I,Z){return B.current.useInsertionEffect(I,Z)},Te.useLayoutEffect=function(I,Z){return B.current.useLayoutEffect(I,Z)},Te.useMemo=function(I,Z){return B.current.useMemo(I,Z)},Te.useReducer=function(I,Z,pe){return B.current.useReducer(I,Z,pe)},Te.useRef=function(I){return B.current.useRef(I)},Te.useState=function(I){return B.current.useState(I)},Te.useSyncExternalStore=function(I,Z,pe){return B.current.useSyncExternalStore(I,Z,pe)},Te.useTransition=function(){return B.current.useTransition()},Te.version="18.3.1",Te}var Mv;function Ja(){return Mv||(Mv=1,dh.exports=Xb()),dh.exports}/**
|
|
11
|
+
* @license React
|
|
12
|
+
* react-jsx-runtime.production.min.js
|
|
13
|
+
*
|
|
14
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
15
|
+
*
|
|
16
|
+
* This source code is licensed under the MIT license found in the
|
|
17
|
+
* LICENSE file in the root directory of this source tree.
|
|
18
|
+
*/var Av;function Zb(){if(Av)return fa;Av=1;var e=Ja(),t=Symbol.for("react.element"),n=Symbol.for("react.fragment"),o=Object.prototype.hasOwnProperty,i=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED.ReactCurrentOwner,c={key:!0,ref:!0,__self:!0,__source:!0};function l(d,h,p){var y,g={},v=null,w=null;p!==void 0&&(v=""+p),h.key!==void 0&&(v=""+h.key),h.ref!==void 0&&(w=h.ref);for(y in h)o.call(h,y)&&!c.hasOwnProperty(y)&&(g[y]=h[y]);if(d&&d.defaultProps)for(y in h=d.defaultProps,h)g[y]===void 0&&(g[y]=h[y]);return{$$typeof:t,type:d,key:v,ref:w,props:g,_owner:i.current}}return fa.Fragment=n,fa.jsx=l,fa.jsxs=l,fa}var Lv;function e2(){return Lv||(Lv=1,fh.exports=Zb()),fh.exports}var P=e2(),Y=Ja();const Ra=Yb(Y);var Cu={},hh={exports:{}},dn={},mh={exports:{}},ph={};/**
|
|
19
|
+
* @license React
|
|
20
|
+
* scheduler.production.min.js
|
|
21
|
+
*
|
|
22
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
23
|
+
*
|
|
24
|
+
* This source code is licensed under the MIT license found in the
|
|
25
|
+
* LICENSE file in the root directory of this source tree.
|
|
26
|
+
*/var Ov;function t2(){return Ov||(Ov=1,(function(e){function t(X,re){var te=X.length;X.push(re);e:for(;0<te;){var I=te-1>>>1,Z=X[I];if(0<i(Z,re))X[I]=re,X[te]=Z,te=I;else break e}}function n(X){return X.length===0?null:X[0]}function o(X){if(X.length===0)return null;var re=X[0],te=X.pop();if(te!==re){X[0]=te;e:for(var I=0,Z=X.length,pe=Z>>>1;I<pe;){var me=2*(I+1)-1,le=X[me],Fe=me+1,fe=X[Fe];if(0>i(le,te))Fe<Z&&0>i(fe,le)?(X[I]=fe,X[Fe]=te,I=Fe):(X[I]=le,X[me]=te,I=me);else if(Fe<Z&&0>i(fe,te))X[I]=fe,X[Fe]=te,I=Fe;else break e}}return re}function i(X,re){var te=X.sortIndex-re.sortIndex;return te!==0?te:X.id-re.id}if(typeof performance=="object"&&typeof performance.now=="function"){var c=performance;e.unstable_now=function(){return c.now()}}else{var l=Date,d=l.now();e.unstable_now=function(){return l.now()-d}}var h=[],p=[],y=1,g=null,v=3,w=!1,S=!1,E=!1,F=typeof setTimeout=="function"?setTimeout:null,K=typeof clearTimeout=="function"?clearTimeout:null,_=typeof setImmediate<"u"?setImmediate:null;typeof navigator<"u"&&navigator.scheduling!==void 0&&navigator.scheduling.isInputPending!==void 0&&navigator.scheduling.isInputPending.bind(navigator.scheduling);function L(X){for(var re=n(p);re!==null;){if(re.callback===null)o(p);else if(re.startTime<=X)o(p),re.sortIndex=re.expirationTime,t(h,re);else break;re=n(p)}}function C(X){if(E=!1,L(X),!S)if(n(h)!==null)S=!0,J(D);else{var re=n(p);re!==null&&B(C,re.startTime-X)}}function D(X,re){S=!1,E&&(E=!1,K(T),T=-1),w=!0;var te=v;try{for(L(re),g=n(h);g!==null&&(!(g.expirationTime>re)||X&&!ne());){var I=g.callback;if(typeof I=="function"){g.callback=null,v=g.priorityLevel;var Z=I(g.expirationTime<=re);re=e.unstable_now(),typeof Z=="function"?g.callback=Z:g===n(h)&&o(h),L(re)}else o(h);g=n(h)}if(g!==null)var pe=!0;else{var me=n(p);me!==null&&B(C,me.startTime-re),pe=!1}return pe}finally{g=null,v=te,w=!1}}var $=!1,N=null,T=-1,q=5,ee=-1;function ne(){return!(e.unstable_now()-ee<q)}function H(){if(N!==null){var X=e.unstable_now();ee=X;var re=!0;try{re=N(!0,X)}finally{re?k():($=!1,N=null)}}else $=!1}var k;if(typeof _=="function")k=function(){_(H)};else if(typeof MessageChannel<"u"){var U=new MessageChannel,V=U.port2;U.port1.onmessage=H,k=function(){V.postMessage(null)}}else k=function(){F(H,0)};function J(X){N=X,$||($=!0,k())}function B(X,re){T=F(function(){X(e.unstable_now())},re)}e.unstable_IdlePriority=5,e.unstable_ImmediatePriority=1,e.unstable_LowPriority=4,e.unstable_NormalPriority=3,e.unstable_Profiling=null,e.unstable_UserBlockingPriority=2,e.unstable_cancelCallback=function(X){X.callback=null},e.unstable_continueExecution=function(){S||w||(S=!0,J(D))},e.unstable_forceFrameRate=function(X){0>X||125<X?console.error("forceFrameRate takes a positive int between 0 and 125, forcing frame rates higher than 125 fps is not supported"):q=0<X?Math.floor(1e3/X):5},e.unstable_getCurrentPriorityLevel=function(){return v},e.unstable_getFirstCallbackNode=function(){return n(h)},e.unstable_next=function(X){switch(v){case 1:case 2:case 3:var re=3;break;default:re=v}var te=v;v=re;try{return X()}finally{v=te}},e.unstable_pauseExecution=function(){},e.unstable_requestPaint=function(){},e.unstable_runWithPriority=function(X,re){switch(X){case 1:case 2:case 3:case 4:case 5:break;default:X=3}var te=v;v=X;try{return re()}finally{v=te}},e.unstable_scheduleCallback=function(X,re,te){var I=e.unstable_now();switch(typeof te=="object"&&te!==null?(te=te.delay,te=typeof te=="number"&&0<te?I+te:I):te=I,X){case 1:var Z=-1;break;case 2:Z=250;break;case 5:Z=1073741823;break;case 4:Z=1e4;break;default:Z=5e3}return Z=te+Z,X={id:y++,callback:re,priorityLevel:X,startTime:te,expirationTime:Z,sortIndex:-1},te>I?(X.sortIndex=te,t(p,X),n(h)===null&&X===n(p)&&(E?(K(T),T=-1):E=!0,B(C,te-I))):(X.sortIndex=Z,t(h,X),S||w||(S=!0,J(D))),X},e.unstable_shouldYield=ne,e.unstable_wrapCallback=function(X){var re=v;return function(){var te=v;v=re;try{return X.apply(this,arguments)}finally{v=te}}}})(ph)),ph}var Nv;function n2(){return Nv||(Nv=1,mh.exports=t2()),mh.exports}/**
|
|
27
|
+
* @license React
|
|
28
|
+
* react-dom.production.min.js
|
|
29
|
+
*
|
|
30
|
+
* Copyright (c) Facebook, Inc. and its affiliates.
|
|
31
|
+
*
|
|
32
|
+
* This source code is licensed under the MIT license found in the
|
|
33
|
+
* LICENSE file in the root directory of this source tree.
|
|
34
|
+
*/var Dv;function r2(){if(Dv)return dn;Dv=1;var e=Ja(),t=n2();function n(r){for(var s="https://reactjs.org/docs/error-decoder.html?invariant="+r,a=1;a<arguments.length;a++)s+="&args[]="+encodeURIComponent(arguments[a]);return"Minified React error #"+r+"; visit "+s+" for the full message or use the non-minified dev environment for full errors and additional helpful warnings."}var o=new Set,i={};function c(r,s){l(r,s),l(r+"Capture",s)}function l(r,s){for(i[r]=s,r=0;r<s.length;r++)o.add(s[r])}var d=!(typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"),h=Object.prototype.hasOwnProperty,p=/^[: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]*$/,y={},g={};function v(r){return h.call(g,r)?!0:h.call(y,r)?!1:p.test(r)?g[r]=!0:(y[r]=!0,!1)}function w(r,s,a,u){if(a!==null&&a.type===0)return!1;switch(typeof s){case"function":case"symbol":return!0;case"boolean":return u?!1:a!==null?!a.acceptsBooleans:(r=r.toLowerCase().slice(0,5),r!=="data-"&&r!=="aria-");default:return!1}}function S(r,s,a,u){if(s===null||typeof s>"u"||w(r,s,a,u))return!0;if(u)return!1;if(a!==null)switch(a.type){case 3:return!s;case 4:return s===!1;case 5:return isNaN(s);case 6:return isNaN(s)||1>s}return!1}function E(r,s,a,u,f,m,x){this.acceptsBooleans=s===2||s===3||s===4,this.attributeName=u,this.attributeNamespace=f,this.mustUseProperty=a,this.propertyName=r,this.type=s,this.sanitizeURL=m,this.removeEmptyString=x}var F={};"children dangerouslySetInnerHTML defaultValue defaultChecked innerHTML suppressContentEditableWarning suppressHydrationWarning style".split(" ").forEach(function(r){F[r]=new E(r,0,!1,r,null,!1,!1)}),[["acceptCharset","accept-charset"],["className","class"],["htmlFor","for"],["httpEquiv","http-equiv"]].forEach(function(r){var s=r[0];F[s]=new E(s,1,!1,r[1],null,!1,!1)}),["contentEditable","draggable","spellCheck","value"].forEach(function(r){F[r]=new E(r,2,!1,r.toLowerCase(),null,!1,!1)}),["autoReverse","externalResourcesRequired","focusable","preserveAlpha"].forEach(function(r){F[r]=new E(r,2,!1,r,null,!1,!1)}),"allowFullScreen async autoFocus autoPlay controls default defer disabled disablePictureInPicture disableRemotePlayback formNoValidate hidden loop noModule noValidate open playsInline readOnly required reversed scoped seamless itemScope".split(" ").forEach(function(r){F[r]=new E(r,3,!1,r.toLowerCase(),null,!1,!1)}),["checked","multiple","muted","selected"].forEach(function(r){F[r]=new E(r,3,!0,r,null,!1,!1)}),["capture","download"].forEach(function(r){F[r]=new E(r,4,!1,r,null,!1,!1)}),["cols","rows","size","span"].forEach(function(r){F[r]=new E(r,6,!1,r,null,!1,!1)}),["rowSpan","start"].forEach(function(r){F[r]=new E(r,5,!1,r.toLowerCase(),null,!1,!1)});var K=/[\-:]([a-z])/g;function _(r){return r[1].toUpperCase()}"accent-height alignment-baseline arabic-form baseline-shift cap-height clip-path clip-rule color-interpolation color-interpolation-filters color-profile color-rendering dominant-baseline enable-background fill-opacity fill-rule flood-color flood-opacity font-family font-size font-size-adjust font-stretch font-style font-variant font-weight glyph-name glyph-orientation-horizontal glyph-orientation-vertical horiz-adv-x horiz-origin-x image-rendering letter-spacing lighting-color marker-end marker-mid marker-start overline-position overline-thickness paint-order panose-1 pointer-events rendering-intent shape-rendering stop-color stop-opacity strikethrough-position strikethrough-thickness stroke-dasharray stroke-dashoffset stroke-linecap stroke-linejoin stroke-miterlimit stroke-opacity stroke-width text-anchor text-decoration text-rendering underline-position underline-thickness unicode-bidi unicode-range units-per-em v-alphabetic v-hanging v-ideographic v-mathematical vector-effect vert-adv-y vert-origin-x vert-origin-y word-spacing writing-mode xmlns:xlink x-height".split(" ").forEach(function(r){var s=r.replace(K,_);F[s]=new E(s,1,!1,r,null,!1,!1)}),"xlink:actuate xlink:arcrole xlink:role xlink:show xlink:title xlink:type".split(" ").forEach(function(r){var s=r.replace(K,_);F[s]=new E(s,1,!1,r,"http://www.w3.org/1999/xlink",!1,!1)}),["xml:base","xml:lang","xml:space"].forEach(function(r){var s=r.replace(K,_);F[s]=new E(s,1,!1,r,"http://www.w3.org/XML/1998/namespace",!1,!1)}),["tabIndex","crossOrigin"].forEach(function(r){F[r]=new E(r,1,!1,r.toLowerCase(),null,!1,!1)}),F.xlinkHref=new E("xlinkHref",1,!1,"xlink:href","http://www.w3.org/1999/xlink",!0,!1),["src","href","action","formAction"].forEach(function(r){F[r]=new E(r,1,!1,r.toLowerCase(),null,!0,!0)});function L(r,s,a,u){var f=F.hasOwnProperty(s)?F[s]:null;(f!==null?f.type!==0:u||!(2<s.length)||s[0]!=="o"&&s[0]!=="O"||s[1]!=="n"&&s[1]!=="N")&&(S(s,a,f,u)&&(a=null),u||f===null?v(s)&&(a===null?r.removeAttribute(s):r.setAttribute(s,""+a)):f.mustUseProperty?r[f.propertyName]=a===null?f.type===3?!1:"":a:(s=f.attributeName,u=f.attributeNamespace,a===null?r.removeAttribute(s):(f=f.type,a=f===3||f===4&&a===!0?"":""+a,u?r.setAttributeNS(u,s,a):r.setAttribute(s,a))))}var C=e.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED,D=Symbol.for("react.element"),$=Symbol.for("react.portal"),N=Symbol.for("react.fragment"),T=Symbol.for("react.strict_mode"),q=Symbol.for("react.profiler"),ee=Symbol.for("react.provider"),ne=Symbol.for("react.context"),H=Symbol.for("react.forward_ref"),k=Symbol.for("react.suspense"),U=Symbol.for("react.suspense_list"),V=Symbol.for("react.memo"),J=Symbol.for("react.lazy"),B=Symbol.for("react.offscreen"),X=Symbol.iterator;function re(r){return r===null||typeof r!="object"?null:(r=X&&r[X]||r["@@iterator"],typeof r=="function"?r:null)}var te=Object.assign,I;function Z(r){if(I===void 0)try{throw Error()}catch(a){var s=a.stack.trim().match(/\n( *(at )?)/);I=s&&s[1]||""}return`
|
|
35
|
+
`+I+r}var pe=!1;function me(r,s){if(!r||pe)return"";pe=!0;var a=Error.prepareStackTrace;Error.prepareStackTrace=void 0;try{if(s)if(s=function(){throw Error()},Object.defineProperty(s.prototype,"props",{set:function(){throw Error()}}),typeof Reflect=="object"&&Reflect.construct){try{Reflect.construct(s,[])}catch(G){var u=G}Reflect.construct(r,[],s)}else{try{s.call()}catch(G){u=G}r.call(s.prototype)}else{try{throw Error()}catch(G){u=G}r()}}catch(G){if(G&&u&&typeof G.stack=="string"){for(var f=G.stack.split(`
|
|
36
|
+
`),m=u.stack.split(`
|
|
37
|
+
`),x=f.length-1,b=m.length-1;1<=x&&0<=b&&f[x]!==m[b];)b--;for(;1<=x&&0<=b;x--,b--)if(f[x]!==m[b]){if(x!==1||b!==1)do if(x--,b--,0>b||f[x]!==m[b]){var R=`
|
|
38
|
+
`+f[x].replace(" at new "," at ");return r.displayName&&R.includes("<anonymous>")&&(R=R.replace("<anonymous>",r.displayName)),R}while(1<=x&&0<=b);break}}}finally{pe=!1,Error.prepareStackTrace=a}return(r=r?r.displayName||r.name:"")?Z(r):""}function le(r){switch(r.tag){case 5:return Z(r.type);case 16:return Z("Lazy");case 13:return Z("Suspense");case 19:return Z("SuspenseList");case 0:case 2:case 15:return r=me(r.type,!1),r;case 11:return r=me(r.type.render,!1),r;case 1:return r=me(r.type,!0),r;default:return""}}function Fe(r){if(r==null)return null;if(typeof r=="function")return r.displayName||r.name||null;if(typeof r=="string")return r;switch(r){case N:return"Fragment";case $:return"Portal";case q:return"Profiler";case T:return"StrictMode";case k:return"Suspense";case U:return"SuspenseList"}if(typeof r=="object")switch(r.$$typeof){case ne:return(r.displayName||"Context")+".Consumer";case ee:return(r._context.displayName||"Context")+".Provider";case H:var s=r.render;return r=r.displayName,r||(r=s.displayName||s.name||"",r=r!==""?"ForwardRef("+r+")":"ForwardRef"),r;case V:return s=r.displayName||null,s!==null?s:Fe(r.type)||"Memo";case J:s=r._payload,r=r._init;try{return Fe(r(s))}catch{}}return null}function fe(r){var s=r.type;switch(r.tag){case 24:return"Cache";case 9:return(s.displayName||"Context")+".Consumer";case 10:return(s._context.displayName||"Context")+".Provider";case 18:return"DehydratedFragment";case 11:return r=s.render,r=r.displayName||r.name||"",s.displayName||(r!==""?"ForwardRef("+r+")":"ForwardRef");case 7:return"Fragment";case 5:return s;case 4:return"Portal";case 3:return"Root";case 6:return"Text";case 16:return Fe(s);case 8:return s===T?"StrictMode":"Mode";case 22:return"Offscreen";case 12:return"Profiler";case 21:return"Scope";case 13:return"Suspense";case 19:return"SuspenseList";case 25:return"TracingMarker";case 1:case 0:case 17:case 2:case 14:case 15:if(typeof s=="function")return s.displayName||s.name||null;if(typeof s=="string")return s}return null}function ke(r){switch(typeof r){case"boolean":case"number":case"string":case"undefined":return r;case"object":return r;default:return""}}function Pe(r){var s=r.type;return(r=r.nodeName)&&r.toLowerCase()==="input"&&(s==="checkbox"||s==="radio")}function Ve(r){var s=Pe(r)?"checked":"value",a=Object.getOwnPropertyDescriptor(r.constructor.prototype,s),u=""+r[s];if(!r.hasOwnProperty(s)&&typeof a<"u"&&typeof a.get=="function"&&typeof a.set=="function"){var f=a.get,m=a.set;return Object.defineProperty(r,s,{configurable:!0,get:function(){return f.call(this)},set:function(x){u=""+x,m.call(this,x)}}),Object.defineProperty(r,s,{enumerable:a.enumerable}),{getValue:function(){return u},setValue:function(x){u=""+x},stopTracking:function(){r._valueTracker=null,delete r[s]}}}}function on(r){r._valueTracker||(r._valueTracker=Ve(r))}function xn(r){if(!r)return!1;var s=r._valueTracker;if(!s)return!0;var a=s.getValue(),u="";return r&&(u=Pe(r)?r.checked?"true":"false":r.value),r=u,r!==a?(s.setValue(r),!0):!1}function Fr(r){if(r=r||(typeof document<"u"?document:void 0),typeof r>"u")return null;try{return r.activeElement||r.body}catch{return r.body}}function Kr(r,s){var a=s.checked;return te({},s,{defaultChecked:void 0,defaultValue:void 0,value:void 0,checked:a??r._wrapperState.initialChecked})}function gc(r,s){var a=s.defaultValue==null?"":s.defaultValue,u=s.checked!=null?s.checked:s.defaultChecked;a=ke(s.value!=null?s.value:a),r._wrapperState={initialChecked:u,initialValue:a,controlled:s.type==="checkbox"||s.type==="radio"?s.checked!=null:s.value!=null}}function Ci(r,s){s=s.checked,s!=null&&L(r,"checked",s,!1)}function Eo(r,s){Ci(r,s);var a=ke(s.value),u=s.type;if(a!=null)u==="number"?(a===0&&r.value===""||r.value!=a)&&(r.value=""+a):r.value!==""+a&&(r.value=""+a);else if(u==="submit"||u==="reset"){r.removeAttribute("value");return}s.hasOwnProperty("value")?Ls(r,s.type,a):s.hasOwnProperty("defaultValue")&&Ls(r,s.type,ke(s.defaultValue)),s.checked==null&&s.defaultChecked!=null&&(r.defaultChecked=!!s.defaultChecked)}function Ir(r,s,a){if(s.hasOwnProperty("value")||s.hasOwnProperty("defaultValue")){var u=s.type;if(!(u!=="submit"&&u!=="reset"||s.value!==void 0&&s.value!==null))return;s=""+r._wrapperState.initialValue,a||s===r.value||(r.value=s),r.defaultValue=s}a=r.name,a!==""&&(r.name=""),r.defaultChecked=!!r._wrapperState.initialChecked,a!==""&&(r.name=a)}function Ls(r,s,a){(s!=="number"||Fr(r.ownerDocument)!==r)&&(a==null?r.defaultValue=""+r._wrapperState.initialValue:r.defaultValue!==""+a&&(r.defaultValue=""+a))}var wn=Array.isArray;function Qr(r,s,a,u){if(r=r.options,s){s={};for(var f=0;f<a.length;f++)s["$"+a[f]]=!0;for(a=0;a<r.length;a++)f=s.hasOwnProperty("$"+r[a].value),r[a].selected!==f&&(r[a].selected=f),f&&u&&(r[a].defaultSelected=!0)}else{for(a=""+ke(a),s=null,f=0;f<r.length;f++){if(r[f].value===a){r[f].selected=!0,u&&(r[f].defaultSelected=!0);return}s!==null||r[f].disabled||(s=r[f])}s!==null&&(s.selected=!0)}}function _o(r,s){if(s.dangerouslySetInnerHTML!=null)throw Error(n(91));return te({},s,{value:void 0,defaultValue:void 0,children:""+r._wrapperState.initialValue})}function yc(r,s){var a=s.value;if(a==null){if(a=s.children,s=s.defaultValue,a!=null){if(s!=null)throw Error(n(92));if(wn(a)){if(1<a.length)throw Error(n(93));a=a[0]}s=a}s==null&&(s=""),a=s}r._wrapperState={initialValue:ke(a)}}function bi(r,s){var a=ke(s.value),u=ke(s.defaultValue);a!=null&&(a=""+a,a!==r.value&&(r.value=a),s.defaultValue==null&&r.defaultValue!==a&&(r.defaultValue=a)),u!=null&&(r.defaultValue=""+u)}function Be(r){var s=r.textContent;s===r._wrapperState.initialValue&&s!==""&&s!==null&&(r.value=s)}function Lt(r){switch(r){case"svg":return"http://www.w3.org/2000/svg";case"math":return"http://www.w3.org/1998/Math/MathML";default:return"http://www.w3.org/1999/xhtml"}}function Kn(r,s){return r==null||r==="http://www.w3.org/1999/xhtml"?Lt(s):r==="http://www.w3.org/2000/svg"&&s==="foreignObject"?"http://www.w3.org/1999/xhtml":r}var Co,Wg=(function(r){return typeof MSApp<"u"&&MSApp.execUnsafeLocalFunction?function(s,a,u,f){MSApp.execUnsafeLocalFunction(function(){return r(s,a,u,f)})}:r})(function(r,s){if(r.namespaceURI!=="http://www.w3.org/2000/svg"||"innerHTML"in r)r.innerHTML=s;else{for(Co=Co||document.createElement("div"),Co.innerHTML="<svg>"+s.valueOf().toString()+"</svg>",s=Co.firstChild;r.firstChild;)r.removeChild(r.firstChild);for(;s.firstChild;)r.appendChild(s.firstChild)}});function Pi(r,s){if(s){var a=r.firstChild;if(a&&a===r.lastChild&&a.nodeType===3){a.nodeValue=s;return}}r.textContent=s}var Fi={animationIterationCount:!0,aspectRatio:!0,borderImageOutset:!0,borderImageSlice:!0,borderImageWidth:!0,boxFlex:!0,boxFlexGroup:!0,boxOrdinalGroup:!0,columnCount:!0,columns:!0,flex:!0,flexGrow:!0,flexPositive:!0,flexShrink:!0,flexNegative:!0,flexOrder:!0,gridArea:!0,gridRow:!0,gridRowEnd:!0,gridRowSpan:!0,gridRowStart:!0,gridColumn:!0,gridColumnEnd:!0,gridColumnSpan:!0,gridColumnStart:!0,fontWeight:!0,lineClamp:!0,lineHeight:!0,opacity:!0,order:!0,orphans:!0,tabSize:!0,widows:!0,zIndex:!0,zoom:!0,fillOpacity:!0,floodOpacity:!0,stopOpacity:!0,strokeDasharray:!0,strokeDashoffset:!0,strokeMiterlimit:!0,strokeOpacity:!0,strokeWidth:!0},Z_=["Webkit","ms","Moz","O"];Object.keys(Fi).forEach(function(r){Z_.forEach(function(s){s=s+r.charAt(0).toUpperCase()+r.substring(1),Fi[s]=Fi[r]})});function Hg(r,s,a){return s==null||typeof s=="boolean"||s===""?"":a||typeof s!="number"||s===0||Fi.hasOwnProperty(r)&&Fi[r]?(""+s).trim():s+"px"}function Kg(r,s){r=r.style;for(var a in s)if(s.hasOwnProperty(a)){var u=a.indexOf("--")===0,f=Hg(a,s[a],u);a==="float"&&(a="cssFloat"),u?r.setProperty(a,f):r[a]=f}}var eC=te({menuitem:!0},{area:!0,base:!0,br:!0,col:!0,embed:!0,hr:!0,img:!0,input:!0,keygen:!0,link:!0,meta:!0,param:!0,source:!0,track:!0,wbr:!0});function Ef(r,s){if(s){if(eC[r]&&(s.children!=null||s.dangerouslySetInnerHTML!=null))throw Error(n(137,r));if(s.dangerouslySetInnerHTML!=null){if(s.children!=null)throw Error(n(60));if(typeof s.dangerouslySetInnerHTML!="object"||!("__html"in s.dangerouslySetInnerHTML))throw Error(n(61))}if(s.style!=null&&typeof s.style!="object")throw Error(n(62))}}function _f(r,s){if(r.indexOf("-")===-1)return typeof s.is=="string";switch(r){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 Cf=null;function bf(r){return r=r.target||r.srcElement||window,r.correspondingUseElement&&(r=r.correspondingUseElement),r.nodeType===3?r.parentNode:r}var Pf=null,bo=null,Po=null;function Qg(r){if(r=Gi(r)){if(typeof Pf!="function")throw Error(n(280));var s=r.stateNode;s&&(s=Uc(s),Pf(r.stateNode,r.type,s))}}function Jg(r){bo?Po?Po.push(r):Po=[r]:bo=r}function Gg(){if(bo){var r=bo,s=Po;if(Po=bo=null,Qg(r),s)for(r=0;r<s.length;r++)Qg(s[r])}}function Yg(r,s){return r(s)}function Xg(){}var Ff=!1;function Zg(r,s,a){if(Ff)return r(s,a);Ff=!0;try{return Yg(r,s,a)}finally{Ff=!1,(bo!==null||Po!==null)&&(Xg(),Gg())}}function Ii(r,s){var a=r.stateNode;if(a===null)return null;var u=Uc(a);if(u===null)return null;a=u[s];e:switch(s){case"onClick":case"onClickCapture":case"onDoubleClick":case"onDoubleClickCapture":case"onMouseDown":case"onMouseDownCapture":case"onMouseMove":case"onMouseMoveCapture":case"onMouseUp":case"onMouseUpCapture":case"onMouseEnter":(u=!u.disabled)||(r=r.type,u=!(r==="button"||r==="input"||r==="select"||r==="textarea")),r=!u;break e;default:r=!1}if(r)return null;if(a&&typeof a!="function")throw Error(n(231,s,typeof a));return a}var If=!1;if(d)try{var Ri={};Object.defineProperty(Ri,"passive",{get:function(){If=!0}}),window.addEventListener("test",Ri,Ri),window.removeEventListener("test",Ri,Ri)}catch{If=!1}function tC(r,s,a,u,f,m,x,b,R){var G=Array.prototype.slice.call(arguments,3);try{s.apply(a,G)}catch(ie){this.onError(ie)}}var Ti=!1,vc=null,Sc=!1,Rf=null,nC={onError:function(r){Ti=!0,vc=r}};function rC(r,s,a,u,f,m,x,b,R){Ti=!1,vc=null,tC.apply(nC,arguments)}function sC(r,s,a,u,f,m,x,b,R){if(rC.apply(this,arguments),Ti){if(Ti){var G=vc;Ti=!1,vc=null}else throw Error(n(198));Sc||(Sc=!0,Rf=G)}}function Os(r){var s=r,a=r;if(r.alternate)for(;s.return;)s=s.return;else{r=s;do s=r,(s.flags&4098)!==0&&(a=s.return),r=s.return;while(r)}return s.tag===3?a:null}function e0(r){if(r.tag===13){var s=r.memoizedState;if(s===null&&(r=r.alternate,r!==null&&(s=r.memoizedState)),s!==null)return s.dehydrated}return null}function t0(r){if(Os(r)!==r)throw Error(n(188))}function oC(r){var s=r.alternate;if(!s){if(s=Os(r),s===null)throw Error(n(188));return s!==r?null:r}for(var a=r,u=s;;){var f=a.return;if(f===null)break;var m=f.alternate;if(m===null){if(u=f.return,u!==null){a=u;continue}break}if(f.child===m.child){for(m=f.child;m;){if(m===a)return t0(f),r;if(m===u)return t0(f),s;m=m.sibling}throw Error(n(188))}if(a.return!==u.return)a=f,u=m;else{for(var x=!1,b=f.child;b;){if(b===a){x=!0,a=f,u=m;break}if(b===u){x=!0,u=f,a=m;break}b=b.sibling}if(!x){for(b=m.child;b;){if(b===a){x=!0,a=m,u=f;break}if(b===u){x=!0,u=m,a=f;break}b=b.sibling}if(!x)throw Error(n(189))}}if(a.alternate!==u)throw Error(n(190))}if(a.tag!==3)throw Error(n(188));return a.stateNode.current===a?r:s}function n0(r){return r=oC(r),r!==null?r0(r):null}function r0(r){if(r.tag===5||r.tag===6)return r;for(r=r.child;r!==null;){var s=r0(r);if(s!==null)return s;r=r.sibling}return null}var s0=t.unstable_scheduleCallback,o0=t.unstable_cancelCallback,iC=t.unstable_shouldYield,aC=t.unstable_requestPaint,mt=t.unstable_now,cC=t.unstable_getCurrentPriorityLevel,Tf=t.unstable_ImmediatePriority,i0=t.unstable_UserBlockingPriority,xc=t.unstable_NormalPriority,uC=t.unstable_LowPriority,a0=t.unstable_IdlePriority,wc=null,dr=null;function lC(r){if(dr&&typeof dr.onCommitFiberRoot=="function")try{dr.onCommitFiberRoot(wc,r,void 0,(r.current.flags&128)===128)}catch{}}var Qn=Math.clz32?Math.clz32:hC,fC=Math.log,dC=Math.LN2;function hC(r){return r>>>=0,r===0?32:31-(fC(r)/dC|0)|0}var kc=64,Ec=4194304;function Mi(r){switch(r&-r){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:case 128:case 256:case 512:case 1024:case 2048:case 4096:case 8192:case 16384:case 32768:case 65536:case 131072:case 262144:case 524288:case 1048576:case 2097152:return r&4194240;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return r&130023424;case 134217728:return 134217728;case 268435456:return 268435456;case 536870912:return 536870912;case 1073741824:return 1073741824;default:return r}}function _c(r,s){var a=r.pendingLanes;if(a===0)return 0;var u=0,f=r.suspendedLanes,m=r.pingedLanes,x=a&268435455;if(x!==0){var b=x&~f;b!==0?u=Mi(b):(m&=x,m!==0&&(u=Mi(m)))}else x=a&~f,x!==0?u=Mi(x):m!==0&&(u=Mi(m));if(u===0)return 0;if(s!==0&&s!==u&&(s&f)===0&&(f=u&-u,m=s&-s,f>=m||f===16&&(m&4194240)!==0))return s;if((u&4)!==0&&(u|=a&16),s=r.entangledLanes,s!==0)for(r=r.entanglements,s&=u;0<s;)a=31-Qn(s),f=1<<a,u|=r[a],s&=~f;return u}function mC(r,s){switch(r){case 1:case 2:case 4:return s+250;case 8:case 16:case 32:case 64: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 s+5e3;case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:return-1;case 134217728:case 268435456:case 536870912:case 1073741824:return-1;default:return-1}}function pC(r,s){for(var a=r.suspendedLanes,u=r.pingedLanes,f=r.expirationTimes,m=r.pendingLanes;0<m;){var x=31-Qn(m),b=1<<x,R=f[x];R===-1?((b&a)===0||(b&u)!==0)&&(f[x]=mC(b,s)):R<=s&&(r.expiredLanes|=b),m&=~b}}function Mf(r){return r=r.pendingLanes&-1073741825,r!==0?r:r&1073741824?1073741824:0}function c0(){var r=kc;return kc<<=1,(kc&4194240)===0&&(kc=64),r}function Af(r){for(var s=[],a=0;31>a;a++)s.push(r);return s}function Ai(r,s,a){r.pendingLanes|=s,s!==536870912&&(r.suspendedLanes=0,r.pingedLanes=0),r=r.eventTimes,s=31-Qn(s),r[s]=a}function gC(r,s){var a=r.pendingLanes&~s;r.pendingLanes=s,r.suspendedLanes=0,r.pingedLanes=0,r.expiredLanes&=s,r.mutableReadLanes&=s,r.entangledLanes&=s,s=r.entanglements;var u=r.eventTimes;for(r=r.expirationTimes;0<a;){var f=31-Qn(a),m=1<<f;s[f]=0,u[f]=-1,r[f]=-1,a&=~m}}function Lf(r,s){var a=r.entangledLanes|=s;for(r=r.entanglements;a;){var u=31-Qn(a),f=1<<u;f&s|r[u]&s&&(r[u]|=s),a&=~f}}var ze=0;function u0(r){return r&=-r,1<r?4<r?(r&268435455)!==0?16:536870912:4:1}var l0,Of,f0,d0,h0,Nf=!1,Cc=[],Jr=null,Gr=null,Yr=null,Li=new Map,Oi=new Map,Xr=[],yC="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 submit".split(" ");function m0(r,s){switch(r){case"focusin":case"focusout":Jr=null;break;case"dragenter":case"dragleave":Gr=null;break;case"mouseover":case"mouseout":Yr=null;break;case"pointerover":case"pointerout":Li.delete(s.pointerId);break;case"gotpointercapture":case"lostpointercapture":Oi.delete(s.pointerId)}}function Ni(r,s,a,u,f,m){return r===null||r.nativeEvent!==m?(r={blockedOn:s,domEventName:a,eventSystemFlags:u,nativeEvent:m,targetContainers:[f]},s!==null&&(s=Gi(s),s!==null&&Of(s)),r):(r.eventSystemFlags|=u,s=r.targetContainers,f!==null&&s.indexOf(f)===-1&&s.push(f),r)}function vC(r,s,a,u,f){switch(s){case"focusin":return Jr=Ni(Jr,r,s,a,u,f),!0;case"dragenter":return Gr=Ni(Gr,r,s,a,u,f),!0;case"mouseover":return Yr=Ni(Yr,r,s,a,u,f),!0;case"pointerover":var m=f.pointerId;return Li.set(m,Ni(Li.get(m)||null,r,s,a,u,f)),!0;case"gotpointercapture":return m=f.pointerId,Oi.set(m,Ni(Oi.get(m)||null,r,s,a,u,f)),!0}return!1}function p0(r){var s=Ns(r.target);if(s!==null){var a=Os(s);if(a!==null){if(s=a.tag,s===13){if(s=e0(a),s!==null){r.blockedOn=s,h0(r.priority,function(){f0(a)});return}}else if(s===3&&a.stateNode.current.memoizedState.isDehydrated){r.blockedOn=a.tag===3?a.stateNode.containerInfo:null;return}}}r.blockedOn=null}function bc(r){if(r.blockedOn!==null)return!1;for(var s=r.targetContainers;0<s.length;){var a=jf(r.domEventName,r.eventSystemFlags,s[0],r.nativeEvent);if(a===null){a=r.nativeEvent;var u=new a.constructor(a.type,a);Cf=u,a.target.dispatchEvent(u),Cf=null}else return s=Gi(a),s!==null&&Of(s),r.blockedOn=a,!1;s.shift()}return!0}function g0(r,s,a){bc(r)&&a.delete(s)}function SC(){Nf=!1,Jr!==null&&bc(Jr)&&(Jr=null),Gr!==null&&bc(Gr)&&(Gr=null),Yr!==null&&bc(Yr)&&(Yr=null),Li.forEach(g0),Oi.forEach(g0)}function Di(r,s){r.blockedOn===s&&(r.blockedOn=null,Nf||(Nf=!0,t.unstable_scheduleCallback(t.unstable_NormalPriority,SC)))}function ji(r){function s(f){return Di(f,r)}if(0<Cc.length){Di(Cc[0],r);for(var a=1;a<Cc.length;a++){var u=Cc[a];u.blockedOn===r&&(u.blockedOn=null)}}for(Jr!==null&&Di(Jr,r),Gr!==null&&Di(Gr,r),Yr!==null&&Di(Yr,r),Li.forEach(s),Oi.forEach(s),a=0;a<Xr.length;a++)u=Xr[a],u.blockedOn===r&&(u.blockedOn=null);for(;0<Xr.length&&(a=Xr[0],a.blockedOn===null);)p0(a),a.blockedOn===null&&Xr.shift()}var Fo=C.ReactCurrentBatchConfig,Pc=!0;function xC(r,s,a,u){var f=ze,m=Fo.transition;Fo.transition=null;try{ze=1,Df(r,s,a,u)}finally{ze=f,Fo.transition=m}}function wC(r,s,a,u){var f=ze,m=Fo.transition;Fo.transition=null;try{ze=4,Df(r,s,a,u)}finally{ze=f,Fo.transition=m}}function Df(r,s,a,u){if(Pc){var f=jf(r,s,a,u);if(f===null)td(r,s,u,Fc,a),m0(r,u);else if(vC(f,r,s,a,u))u.stopPropagation();else if(m0(r,u),s&4&&-1<yC.indexOf(r)){for(;f!==null;){var m=Gi(f);if(m!==null&&l0(m),m=jf(r,s,a,u),m===null&&td(r,s,u,Fc,a),m===f)break;f=m}f!==null&&u.stopPropagation()}else td(r,s,u,null,a)}}var Fc=null;function jf(r,s,a,u){if(Fc=null,r=bf(u),r=Ns(r),r!==null)if(s=Os(r),s===null)r=null;else if(a=s.tag,a===13){if(r=e0(s),r!==null)return r;r=null}else if(a===3){if(s.stateNode.current.memoizedState.isDehydrated)return s.tag===3?s.stateNode.containerInfo:null;r=null}else s!==r&&(r=null);return Fc=r,null}function y0(r){switch(r){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"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 1;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"toggle":case"touchmove":case"wheel":case"mouseenter":case"mouseleave":case"pointerenter":case"pointerleave":return 4;case"message":switch(cC()){case Tf:return 1;case i0:return 4;case xc:case uC:return 16;case a0:return 536870912;default:return 16}default:return 16}}var Zr=null,$f=null,Ic=null;function v0(){if(Ic)return Ic;var r,s=$f,a=s.length,u,f="value"in Zr?Zr.value:Zr.textContent,m=f.length;for(r=0;r<a&&s[r]===f[r];r++);var x=a-r;for(u=1;u<=x&&s[a-u]===f[m-u];u++);return Ic=f.slice(r,1<u?1-u:void 0)}function Rc(r){var s=r.keyCode;return"charCode"in r?(r=r.charCode,r===0&&s===13&&(r=13)):r=s,r===10&&(r=13),32<=r||r===13?r:0}function Tc(){return!0}function S0(){return!1}function kn(r){function s(a,u,f,m,x){this._reactName=a,this._targetInst=f,this.type=u,this.nativeEvent=m,this.target=x,this.currentTarget=null;for(var b in r)r.hasOwnProperty(b)&&(a=r[b],this[b]=a?a(m):m[b]);return this.isDefaultPrevented=(m.defaultPrevented!=null?m.defaultPrevented:m.returnValue===!1)?Tc:S0,this.isPropagationStopped=S0,this}return te(s.prototype,{preventDefault:function(){this.defaultPrevented=!0;var a=this.nativeEvent;a&&(a.preventDefault?a.preventDefault():typeof a.returnValue!="unknown"&&(a.returnValue=!1),this.isDefaultPrevented=Tc)},stopPropagation:function(){var a=this.nativeEvent;a&&(a.stopPropagation?a.stopPropagation():typeof a.cancelBubble!="unknown"&&(a.cancelBubble=!0),this.isPropagationStopped=Tc)},persist:function(){},isPersistent:Tc}),s}var Io={eventPhase:0,bubbles:0,cancelable:0,timeStamp:function(r){return r.timeStamp||Date.now()},defaultPrevented:0,isTrusted:0},Uf=kn(Io),$i=te({},Io,{view:0,detail:0}),kC=kn($i),Bf,zf,Ui,Mc=te({},$i,{screenX:0,screenY:0,clientX:0,clientY:0,pageX:0,pageY:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,getModifierState:qf,button:0,buttons:0,relatedTarget:function(r){return r.relatedTarget===void 0?r.fromElement===r.srcElement?r.toElement:r.fromElement:r.relatedTarget},movementX:function(r){return"movementX"in r?r.movementX:(r!==Ui&&(Ui&&r.type==="mousemove"?(Bf=r.screenX-Ui.screenX,zf=r.screenY-Ui.screenY):zf=Bf=0,Ui=r),Bf)},movementY:function(r){return"movementY"in r?r.movementY:zf}}),x0=kn(Mc),EC=te({},Mc,{dataTransfer:0}),_C=kn(EC),CC=te({},$i,{relatedTarget:0}),Vf=kn(CC),bC=te({},Io,{animationName:0,elapsedTime:0,pseudoElement:0}),PC=kn(bC),FC=te({},Io,{clipboardData:function(r){return"clipboardData"in r?r.clipboardData:window.clipboardData}}),IC=kn(FC),RC=te({},Io,{data:0}),w0=kn(RC),TC={Esc:"Escape",Spacebar:" ",Left:"ArrowLeft",Up:"ArrowUp",Right:"ArrowRight",Down:"ArrowDown",Del:"Delete",Win:"OS",Menu:"ContextMenu",Apps:"ContextMenu",Scroll:"ScrollLock",MozPrintableKey:"Unidentified"},MC={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"},AC={Alt:"altKey",Control:"ctrlKey",Meta:"metaKey",Shift:"shiftKey"};function LC(r){var s=this.nativeEvent;return s.getModifierState?s.getModifierState(r):(r=AC[r])?!!s[r]:!1}function qf(){return LC}var OC=te({},$i,{key:function(r){if(r.key){var s=TC[r.key]||r.key;if(s!=="Unidentified")return s}return r.type==="keypress"?(r=Rc(r),r===13?"Enter":String.fromCharCode(r)):r.type==="keydown"||r.type==="keyup"?MC[r.keyCode]||"Unidentified":""},code:0,location:0,ctrlKey:0,shiftKey:0,altKey:0,metaKey:0,repeat:0,locale:0,getModifierState:qf,charCode:function(r){return r.type==="keypress"?Rc(r):0},keyCode:function(r){return r.type==="keydown"||r.type==="keyup"?r.keyCode:0},which:function(r){return r.type==="keypress"?Rc(r):r.type==="keydown"||r.type==="keyup"?r.keyCode:0}}),NC=kn(OC),DC=te({},Mc,{pointerId:0,width:0,height:0,pressure:0,tangentialPressure:0,tiltX:0,tiltY:0,twist:0,pointerType:0,isPrimary:0}),k0=kn(DC),jC=te({},$i,{touches:0,targetTouches:0,changedTouches:0,altKey:0,metaKey:0,ctrlKey:0,shiftKey:0,getModifierState:qf}),$C=kn(jC),UC=te({},Io,{propertyName:0,elapsedTime:0,pseudoElement:0}),BC=kn(UC),zC=te({},Mc,{deltaX:function(r){return"deltaX"in r?r.deltaX:"wheelDeltaX"in r?-r.wheelDeltaX:0},deltaY:function(r){return"deltaY"in r?r.deltaY:"wheelDeltaY"in r?-r.wheelDeltaY:"wheelDelta"in r?-r.wheelDelta:0},deltaZ:0,deltaMode:0}),VC=kn(zC),qC=[9,13,27,32],Wf=d&&"CompositionEvent"in window,Bi=null;d&&"documentMode"in document&&(Bi=document.documentMode);var WC=d&&"TextEvent"in window&&!Bi,E0=d&&(!Wf||Bi&&8<Bi&&11>=Bi),_0=" ",C0=!1;function b0(r,s){switch(r){case"keyup":return qC.indexOf(s.keyCode)!==-1;case"keydown":return s.keyCode!==229;case"keypress":case"mousedown":case"focusout":return!0;default:return!1}}function P0(r){return r=r.detail,typeof r=="object"&&"data"in r?r.data:null}var Ro=!1;function HC(r,s){switch(r){case"compositionend":return P0(s);case"keypress":return s.which!==32?null:(C0=!0,_0);case"textInput":return r=s.data,r===_0&&C0?null:r;default:return null}}function KC(r,s){if(Ro)return r==="compositionend"||!Wf&&b0(r,s)?(r=v0(),Ic=$f=Zr=null,Ro=!1,r):null;switch(r){case"paste":return null;case"keypress":if(!(s.ctrlKey||s.altKey||s.metaKey)||s.ctrlKey&&s.altKey){if(s.char&&1<s.char.length)return s.char;if(s.which)return String.fromCharCode(s.which)}return null;case"compositionend":return E0&&s.locale!=="ko"?null:s.data;default:return null}}var QC={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 F0(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s==="input"?!!QC[r.type]:s==="textarea"}function I0(r,s,a,u){Jg(u),s=Dc(s,"onChange"),0<s.length&&(a=new Uf("onChange","change",null,a,u),r.push({event:a,listeners:s}))}var zi=null,Vi=null;function JC(r){K0(r,0)}function Ac(r){var s=Oo(r);if(xn(s))return r}function GC(r,s){if(r==="change")return s}var R0=!1;if(d){var Hf;if(d){var Kf="oninput"in document;if(!Kf){var T0=document.createElement("div");T0.setAttribute("oninput","return;"),Kf=typeof T0.oninput=="function"}Hf=Kf}else Hf=!1;R0=Hf&&(!document.documentMode||9<document.documentMode)}function M0(){zi&&(zi.detachEvent("onpropertychange",A0),Vi=zi=null)}function A0(r){if(r.propertyName==="value"&&Ac(Vi)){var s=[];I0(s,Vi,r,bf(r)),Zg(JC,s)}}function YC(r,s,a){r==="focusin"?(M0(),zi=s,Vi=a,zi.attachEvent("onpropertychange",A0)):r==="focusout"&&M0()}function XC(r){if(r==="selectionchange"||r==="keyup"||r==="keydown")return Ac(Vi)}function ZC(r,s){if(r==="click")return Ac(s)}function eb(r,s){if(r==="input"||r==="change")return Ac(s)}function tb(r,s){return r===s&&(r!==0||1/r===1/s)||r!==r&&s!==s}var Jn=typeof Object.is=="function"?Object.is:tb;function qi(r,s){if(Jn(r,s))return!0;if(typeof r!="object"||r===null||typeof s!="object"||s===null)return!1;var a=Object.keys(r),u=Object.keys(s);if(a.length!==u.length)return!1;for(u=0;u<a.length;u++){var f=a[u];if(!h.call(s,f)||!Jn(r[f],s[f]))return!1}return!0}function L0(r){for(;r&&r.firstChild;)r=r.firstChild;return r}function O0(r,s){var a=L0(r);r=0;for(var u;a;){if(a.nodeType===3){if(u=r+a.textContent.length,r<=s&&u>=s)return{node:a,offset:s-r};r=u}e:{for(;a;){if(a.nextSibling){a=a.nextSibling;break e}a=a.parentNode}a=void 0}a=L0(a)}}function N0(r,s){return r&&s?r===s?!0:r&&r.nodeType===3?!1:s&&s.nodeType===3?N0(r,s.parentNode):"contains"in r?r.contains(s):r.compareDocumentPosition?!!(r.compareDocumentPosition(s)&16):!1:!1}function D0(){for(var r=window,s=Fr();s instanceof r.HTMLIFrameElement;){try{var a=typeof s.contentWindow.location.href=="string"}catch{a=!1}if(a)r=s.contentWindow;else break;s=Fr(r.document)}return s}function Qf(r){var s=r&&r.nodeName&&r.nodeName.toLowerCase();return s&&(s==="input"&&(r.type==="text"||r.type==="search"||r.type==="tel"||r.type==="url"||r.type==="password")||s==="textarea"||r.contentEditable==="true")}function nb(r){var s=D0(),a=r.focusedElem,u=r.selectionRange;if(s!==a&&a&&a.ownerDocument&&N0(a.ownerDocument.documentElement,a)){if(u!==null&&Qf(a)){if(s=u.start,r=u.end,r===void 0&&(r=s),"selectionStart"in a)a.selectionStart=s,a.selectionEnd=Math.min(r,a.value.length);else if(r=(s=a.ownerDocument||document)&&s.defaultView||window,r.getSelection){r=r.getSelection();var f=a.textContent.length,m=Math.min(u.start,f);u=u.end===void 0?m:Math.min(u.end,f),!r.extend&&m>u&&(f=u,u=m,m=f),f=O0(a,m);var x=O0(a,u);f&&x&&(r.rangeCount!==1||r.anchorNode!==f.node||r.anchorOffset!==f.offset||r.focusNode!==x.node||r.focusOffset!==x.offset)&&(s=s.createRange(),s.setStart(f.node,f.offset),r.removeAllRanges(),m>u?(r.addRange(s),r.extend(x.node,x.offset)):(s.setEnd(x.node,x.offset),r.addRange(s)))}}for(s=[],r=a;r=r.parentNode;)r.nodeType===1&&s.push({element:r,left:r.scrollLeft,top:r.scrollTop});for(typeof a.focus=="function"&&a.focus(),a=0;a<s.length;a++)r=s[a],r.element.scrollLeft=r.left,r.element.scrollTop=r.top}}var rb=d&&"documentMode"in document&&11>=document.documentMode,To=null,Jf=null,Wi=null,Gf=!1;function j0(r,s,a){var u=a.window===a?a.document:a.nodeType===9?a:a.ownerDocument;Gf||To==null||To!==Fr(u)||(u=To,"selectionStart"in u&&Qf(u)?u={start:u.selectionStart,end:u.selectionEnd}:(u=(u.ownerDocument&&u.ownerDocument.defaultView||window).getSelection(),u={anchorNode:u.anchorNode,anchorOffset:u.anchorOffset,focusNode:u.focusNode,focusOffset:u.focusOffset}),Wi&&qi(Wi,u)||(Wi=u,u=Dc(Jf,"onSelect"),0<u.length&&(s=new Uf("onSelect","select",null,s,a),r.push({event:s,listeners:u}),s.target=To)))}function Lc(r,s){var a={};return a[r.toLowerCase()]=s.toLowerCase(),a["Webkit"+r]="webkit"+s,a["Moz"+r]="moz"+s,a}var Mo={animationend:Lc("Animation","AnimationEnd"),animationiteration:Lc("Animation","AnimationIteration"),animationstart:Lc("Animation","AnimationStart"),transitionend:Lc("Transition","TransitionEnd")},Yf={},$0={};d&&($0=document.createElement("div").style,"AnimationEvent"in window||(delete Mo.animationend.animation,delete Mo.animationiteration.animation,delete Mo.animationstart.animation),"TransitionEvent"in window||delete Mo.transitionend.transition);function Oc(r){if(Yf[r])return Yf[r];if(!Mo[r])return r;var s=Mo[r],a;for(a in s)if(s.hasOwnProperty(a)&&a in $0)return Yf[r]=s[a];return r}var U0=Oc("animationend"),B0=Oc("animationiteration"),z0=Oc("animationstart"),V0=Oc("transitionend"),q0=new Map,W0="abort auxClick 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(" ");function es(r,s){q0.set(r,s),c(s,[r])}for(var Xf=0;Xf<W0.length;Xf++){var Zf=W0[Xf],sb=Zf.toLowerCase(),ob=Zf[0].toUpperCase()+Zf.slice(1);es(sb,"on"+ob)}es(U0,"onAnimationEnd"),es(B0,"onAnimationIteration"),es(z0,"onAnimationStart"),es("dblclick","onDoubleClick"),es("focusin","onFocus"),es("focusout","onBlur"),es(V0,"onTransitionEnd"),l("onMouseEnter",["mouseout","mouseover"]),l("onMouseLeave",["mouseout","mouseover"]),l("onPointerEnter",["pointerout","pointerover"]),l("onPointerLeave",["pointerout","pointerover"]),c("onChange","change click focusin focusout input keydown keyup selectionchange".split(" ")),c("onSelect","focusout contextmenu dragend focusin keydown keyup mousedown mouseup selectionchange".split(" ")),c("onBeforeInput",["compositionend","keypress","textInput","paste"]),c("onCompositionEnd","compositionend focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionStart","compositionstart focusout keydown keypress keyup mousedown".split(" ")),c("onCompositionUpdate","compositionupdate focusout keydown keypress keyup mousedown".split(" "));var Hi="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(" "),ib=new Set("cancel close invalid load scroll toggle".split(" ").concat(Hi));function H0(r,s,a){var u=r.type||"unknown-event";r.currentTarget=a,sC(u,s,void 0,r),r.currentTarget=null}function K0(r,s){s=(s&4)!==0;for(var a=0;a<r.length;a++){var u=r[a],f=u.event;u=u.listeners;e:{var m=void 0;if(s)for(var x=u.length-1;0<=x;x--){var b=u[x],R=b.instance,G=b.currentTarget;if(b=b.listener,R!==m&&f.isPropagationStopped())break e;H0(f,b,G),m=R}else for(x=0;x<u.length;x++){if(b=u[x],R=b.instance,G=b.currentTarget,b=b.listener,R!==m&&f.isPropagationStopped())break e;H0(f,b,G),m=R}}}if(Sc)throw r=Rf,Sc=!1,Rf=null,r}function Xe(r,s){var a=s[ad];a===void 0&&(a=s[ad]=new Set);var u=r+"__bubble";a.has(u)||(Q0(s,r,2,!1),a.add(u))}function ed(r,s,a){var u=0;s&&(u|=4),Q0(a,r,u,s)}var Nc="_reactListening"+Math.random().toString(36).slice(2);function Ki(r){if(!r[Nc]){r[Nc]=!0,o.forEach(function(a){a!=="selectionchange"&&(ib.has(a)||ed(a,!1,r),ed(a,!0,r))});var s=r.nodeType===9?r:r.ownerDocument;s===null||s[Nc]||(s[Nc]=!0,ed("selectionchange",!1,s))}}function Q0(r,s,a,u){switch(y0(s)){case 1:var f=xC;break;case 4:f=wC;break;default:f=Df}a=f.bind(null,s,a,r),f=void 0,!If||s!=="touchstart"&&s!=="touchmove"&&s!=="wheel"||(f=!0),u?f!==void 0?r.addEventListener(s,a,{capture:!0,passive:f}):r.addEventListener(s,a,!0):f!==void 0?r.addEventListener(s,a,{passive:f}):r.addEventListener(s,a,!1)}function td(r,s,a,u,f){var m=u;if((s&1)===0&&(s&2)===0&&u!==null)e:for(;;){if(u===null)return;var x=u.tag;if(x===3||x===4){var b=u.stateNode.containerInfo;if(b===f||b.nodeType===8&&b.parentNode===f)break;if(x===4)for(x=u.return;x!==null;){var R=x.tag;if((R===3||R===4)&&(R=x.stateNode.containerInfo,R===f||R.nodeType===8&&R.parentNode===f))return;x=x.return}for(;b!==null;){if(x=Ns(b),x===null)return;if(R=x.tag,R===5||R===6){u=m=x;continue e}b=b.parentNode}}u=u.return}Zg(function(){var G=m,ie=bf(a),ae=[];e:{var oe=q0.get(r);if(oe!==void 0){var he=Uf,ye=r;switch(r){case"keypress":if(Rc(a)===0)break e;case"keydown":case"keyup":he=NC;break;case"focusin":ye="focus",he=Vf;break;case"focusout":ye="blur",he=Vf;break;case"beforeblur":case"afterblur":he=Vf;break;case"click":if(a.button===2)break e;case"auxclick":case"dblclick":case"mousedown":case"mousemove":case"mouseup":case"mouseout":case"mouseover":case"contextmenu":he=x0;break;case"drag":case"dragend":case"dragenter":case"dragexit":case"dragleave":case"dragover":case"dragstart":case"drop":he=_C;break;case"touchcancel":case"touchend":case"touchmove":case"touchstart":he=$C;break;case U0:case B0:case z0:he=PC;break;case V0:he=BC;break;case"scroll":he=kC;break;case"wheel":he=VC;break;case"copy":case"cut":case"paste":he=IC;break;case"gotpointercapture":case"lostpointercapture":case"pointercancel":case"pointerdown":case"pointermove":case"pointerout":case"pointerover":case"pointerup":he=k0}var ve=(s&4)!==0,pt=!ve&&r==="scroll",z=ve?oe!==null?oe+"Capture":null:oe;ve=[];for(var M=G,W;M!==null;){W=M;var ce=W.stateNode;if(W.tag===5&&ce!==null&&(W=ce,z!==null&&(ce=Ii(M,z),ce!=null&&ve.push(Qi(M,ce,W)))),pt)break;M=M.return}0<ve.length&&(oe=new he(oe,ye,null,a,ie),ae.push({event:oe,listeners:ve}))}}if((s&7)===0){e:{if(oe=r==="mouseover"||r==="pointerover",he=r==="mouseout"||r==="pointerout",oe&&a!==Cf&&(ye=a.relatedTarget||a.fromElement)&&(Ns(ye)||ye[Rr]))break e;if((he||oe)&&(oe=ie.window===ie?ie:(oe=ie.ownerDocument)?oe.defaultView||oe.parentWindow:window,he?(ye=a.relatedTarget||a.toElement,he=G,ye=ye?Ns(ye):null,ye!==null&&(pt=Os(ye),ye!==pt||ye.tag!==5&&ye.tag!==6)&&(ye=null)):(he=null,ye=G),he!==ye)){if(ve=x0,ce="onMouseLeave",z="onMouseEnter",M="mouse",(r==="pointerout"||r==="pointerover")&&(ve=k0,ce="onPointerLeave",z="onPointerEnter",M="pointer"),pt=he==null?oe:Oo(he),W=ye==null?oe:Oo(ye),oe=new ve(ce,M+"leave",he,a,ie),oe.target=pt,oe.relatedTarget=W,ce=null,Ns(ie)===G&&(ve=new ve(z,M+"enter",ye,a,ie),ve.target=W,ve.relatedTarget=pt,ce=ve),pt=ce,he&&ye)t:{for(ve=he,z=ye,M=0,W=ve;W;W=Ao(W))M++;for(W=0,ce=z;ce;ce=Ao(ce))W++;for(;0<M-W;)ve=Ao(ve),M--;for(;0<W-M;)z=Ao(z),W--;for(;M--;){if(ve===z||z!==null&&ve===z.alternate)break t;ve=Ao(ve),z=Ao(z)}ve=null}else ve=null;he!==null&&J0(ae,oe,he,ve,!1),ye!==null&&pt!==null&&J0(ae,pt,ye,ve,!0)}}e:{if(oe=G?Oo(G):window,he=oe.nodeName&&oe.nodeName.toLowerCase(),he==="select"||he==="input"&&oe.type==="file")var Se=GC;else if(F0(oe))if(R0)Se=eb;else{Se=XC;var Ee=YC}else(he=oe.nodeName)&&he.toLowerCase()==="input"&&(oe.type==="checkbox"||oe.type==="radio")&&(Se=ZC);if(Se&&(Se=Se(r,G))){I0(ae,Se,a,ie);break e}Ee&&Ee(r,oe,G),r==="focusout"&&(Ee=oe._wrapperState)&&Ee.controlled&&oe.type==="number"&&Ls(oe,"number",oe.value)}switch(Ee=G?Oo(G):window,r){case"focusin":(F0(Ee)||Ee.contentEditable==="true")&&(To=Ee,Jf=G,Wi=null);break;case"focusout":Wi=Jf=To=null;break;case"mousedown":Gf=!0;break;case"contextmenu":case"mouseup":case"dragend":Gf=!1,j0(ae,a,ie);break;case"selectionchange":if(rb)break;case"keydown":case"keyup":j0(ae,a,ie)}var _e;if(Wf)e:{switch(r){case"compositionstart":var Ce="onCompositionStart";break e;case"compositionend":Ce="onCompositionEnd";break e;case"compositionupdate":Ce="onCompositionUpdate";break e}Ce=void 0}else Ro?b0(r,a)&&(Ce="onCompositionEnd"):r==="keydown"&&a.keyCode===229&&(Ce="onCompositionStart");Ce&&(E0&&a.locale!=="ko"&&(Ro||Ce!=="onCompositionStart"?Ce==="onCompositionEnd"&&Ro&&(_e=v0()):(Zr=ie,$f="value"in Zr?Zr.value:Zr.textContent,Ro=!0)),Ee=Dc(G,Ce),0<Ee.length&&(Ce=new w0(Ce,r,null,a,ie),ae.push({event:Ce,listeners:Ee}),_e?Ce.data=_e:(_e=P0(a),_e!==null&&(Ce.data=_e)))),(_e=WC?HC(r,a):KC(r,a))&&(G=Dc(G,"onBeforeInput"),0<G.length&&(ie=new w0("onBeforeInput","beforeinput",null,a,ie),ae.push({event:ie,listeners:G}),ie.data=_e))}K0(ae,s)})}function Qi(r,s,a){return{instance:r,listener:s,currentTarget:a}}function Dc(r,s){for(var a=s+"Capture",u=[];r!==null;){var f=r,m=f.stateNode;f.tag===5&&m!==null&&(f=m,m=Ii(r,a),m!=null&&u.unshift(Qi(r,m,f)),m=Ii(r,s),m!=null&&u.push(Qi(r,m,f))),r=r.return}return u}function Ao(r){if(r===null)return null;do r=r.return;while(r&&r.tag!==5);return r||null}function J0(r,s,a,u,f){for(var m=s._reactName,x=[];a!==null&&a!==u;){var b=a,R=b.alternate,G=b.stateNode;if(R!==null&&R===u)break;b.tag===5&&G!==null&&(b=G,f?(R=Ii(a,m),R!=null&&x.unshift(Qi(a,R,b))):f||(R=Ii(a,m),R!=null&&x.push(Qi(a,R,b)))),a=a.return}x.length!==0&&r.push({event:s,listeners:x})}var ab=/\r\n?/g,cb=/\u0000|\uFFFD/g;function G0(r){return(typeof r=="string"?r:""+r).replace(ab,`
|
|
39
|
+
`).replace(cb,"")}function jc(r,s,a){if(s=G0(s),G0(r)!==s&&a)throw Error(n(425))}function $c(){}var nd=null,rd=null;function sd(r,s){return r==="textarea"||r==="noscript"||typeof s.children=="string"||typeof s.children=="number"||typeof s.dangerouslySetInnerHTML=="object"&&s.dangerouslySetInnerHTML!==null&&s.dangerouslySetInnerHTML.__html!=null}var od=typeof setTimeout=="function"?setTimeout:void 0,ub=typeof clearTimeout=="function"?clearTimeout:void 0,Y0=typeof Promise=="function"?Promise:void 0,lb=typeof queueMicrotask=="function"?queueMicrotask:typeof Y0<"u"?function(r){return Y0.resolve(null).then(r).catch(fb)}:od;function fb(r){setTimeout(function(){throw r})}function id(r,s){var a=s,u=0;do{var f=a.nextSibling;if(r.removeChild(a),f&&f.nodeType===8)if(a=f.data,a==="/$"){if(u===0){r.removeChild(f),ji(s);return}u--}else a!=="$"&&a!=="$?"&&a!=="$!"||u++;a=f}while(a);ji(s)}function ts(r){for(;r!=null;r=r.nextSibling){var s=r.nodeType;if(s===1||s===3)break;if(s===8){if(s=r.data,s==="$"||s==="$!"||s==="$?")break;if(s==="/$")return null}}return r}function X0(r){r=r.previousSibling;for(var s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="$"||a==="$!"||a==="$?"){if(s===0)return r;s--}else a==="/$"&&s++}r=r.previousSibling}return null}var Lo=Math.random().toString(36).slice(2),hr="__reactFiber$"+Lo,Ji="__reactProps$"+Lo,Rr="__reactContainer$"+Lo,ad="__reactEvents$"+Lo,db="__reactListeners$"+Lo,hb="__reactHandles$"+Lo;function Ns(r){var s=r[hr];if(s)return s;for(var a=r.parentNode;a;){if(s=a[Rr]||a[hr]){if(a=s.alternate,s.child!==null||a!==null&&a.child!==null)for(r=X0(r);r!==null;){if(a=r[hr])return a;r=X0(r)}return s}r=a,a=r.parentNode}return null}function Gi(r){return r=r[hr]||r[Rr],!r||r.tag!==5&&r.tag!==6&&r.tag!==13&&r.tag!==3?null:r}function Oo(r){if(r.tag===5||r.tag===6)return r.stateNode;throw Error(n(33))}function Uc(r){return r[Ji]||null}var cd=[],No=-1;function ns(r){return{current:r}}function Ze(r){0>No||(r.current=cd[No],cd[No]=null,No--)}function Qe(r,s){No++,cd[No]=r.current,r.current=s}var rs={},Bt=ns(rs),an=ns(!1),Ds=rs;function Do(r,s){var a=r.type.contextTypes;if(!a)return rs;var u=r.stateNode;if(u&&u.__reactInternalMemoizedUnmaskedChildContext===s)return u.__reactInternalMemoizedMaskedChildContext;var f={},m;for(m in a)f[m]=s[m];return u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=s,r.__reactInternalMemoizedMaskedChildContext=f),f}function cn(r){return r=r.childContextTypes,r!=null}function Bc(){Ze(an),Ze(Bt)}function Z0(r,s,a){if(Bt.current!==rs)throw Error(n(168));Qe(Bt,s),Qe(an,a)}function ey(r,s,a){var u=r.stateNode;if(s=s.childContextTypes,typeof u.getChildContext!="function")return a;u=u.getChildContext();for(var f in u)if(!(f in s))throw Error(n(108,fe(r)||"Unknown",f));return te({},a,u)}function zc(r){return r=(r=r.stateNode)&&r.__reactInternalMemoizedMergedChildContext||rs,Ds=Bt.current,Qe(Bt,r),Qe(an,an.current),!0}function ty(r,s,a){var u=r.stateNode;if(!u)throw Error(n(169));a?(r=ey(r,s,Ds),u.__reactInternalMemoizedMergedChildContext=r,Ze(an),Ze(Bt),Qe(Bt,r)):Ze(an),Qe(an,a)}var Tr=null,Vc=!1,ud=!1;function ny(r){Tr===null?Tr=[r]:Tr.push(r)}function mb(r){Vc=!0,ny(r)}function ss(){if(!ud&&Tr!==null){ud=!0;var r=0,s=ze;try{var a=Tr;for(ze=1;r<a.length;r++){var u=a[r];do u=u(!0);while(u!==null)}Tr=null,Vc=!1}catch(f){throw Tr!==null&&(Tr=Tr.slice(r+1)),s0(Tf,ss),f}finally{ze=s,ud=!1}}return null}var jo=[],$o=0,qc=null,Wc=0,An=[],Ln=0,js=null,Mr=1,Ar="";function $s(r,s){jo[$o++]=Wc,jo[$o++]=qc,qc=r,Wc=s}function ry(r,s,a){An[Ln++]=Mr,An[Ln++]=Ar,An[Ln++]=js,js=r;var u=Mr;r=Ar;var f=32-Qn(u)-1;u&=~(1<<f),a+=1;var m=32-Qn(s)+f;if(30<m){var x=f-f%5;m=(u&(1<<x)-1).toString(32),u>>=x,f-=x,Mr=1<<32-Qn(s)+f|a<<f|u,Ar=m+r}else Mr=1<<m|a<<f|u,Ar=r}function ld(r){r.return!==null&&($s(r,1),ry(r,1,0))}function fd(r){for(;r===qc;)qc=jo[--$o],jo[$o]=null,Wc=jo[--$o],jo[$o]=null;for(;r===js;)js=An[--Ln],An[Ln]=null,Ar=An[--Ln],An[Ln]=null,Mr=An[--Ln],An[Ln]=null}var En=null,_n=null,et=!1,Gn=null;function sy(r,s){var a=jn(5,null,null,0);a.elementType="DELETED",a.stateNode=s,a.return=r,s=r.deletions,s===null?(r.deletions=[a],r.flags|=16):s.push(a)}function oy(r,s){switch(r.tag){case 5:var a=r.type;return s=s.nodeType!==1||a.toLowerCase()!==s.nodeName.toLowerCase()?null:s,s!==null?(r.stateNode=s,En=r,_n=ts(s.firstChild),!0):!1;case 6:return s=r.pendingProps===""||s.nodeType!==3?null:s,s!==null?(r.stateNode=s,En=r,_n=null,!0):!1;case 13:return s=s.nodeType!==8?null:s,s!==null?(a=js!==null?{id:Mr,overflow:Ar}:null,r.memoizedState={dehydrated:s,treeContext:a,retryLane:1073741824},a=jn(18,null,null,0),a.stateNode=s,a.return=r,r.child=a,En=r,_n=null,!0):!1;default:return!1}}function dd(r){return(r.mode&1)!==0&&(r.flags&128)===0}function hd(r){if(et){var s=_n;if(s){var a=s;if(!oy(r,s)){if(dd(r))throw Error(n(418));s=ts(a.nextSibling);var u=En;s&&oy(r,s)?sy(u,a):(r.flags=r.flags&-4097|2,et=!1,En=r)}}else{if(dd(r))throw Error(n(418));r.flags=r.flags&-4097|2,et=!1,En=r}}}function iy(r){for(r=r.return;r!==null&&r.tag!==5&&r.tag!==3&&r.tag!==13;)r=r.return;En=r}function Hc(r){if(r!==En)return!1;if(!et)return iy(r),et=!0,!1;var s;if((s=r.tag!==3)&&!(s=r.tag!==5)&&(s=r.type,s=s!=="head"&&s!=="body"&&!sd(r.type,r.memoizedProps)),s&&(s=_n)){if(dd(r))throw ay(),Error(n(418));for(;s;)sy(r,s),s=ts(s.nextSibling)}if(iy(r),r.tag===13){if(r=r.memoizedState,r=r!==null?r.dehydrated:null,!r)throw Error(n(317));e:{for(r=r.nextSibling,s=0;r;){if(r.nodeType===8){var a=r.data;if(a==="/$"){if(s===0){_n=ts(r.nextSibling);break e}s--}else a!=="$"&&a!=="$!"&&a!=="$?"||s++}r=r.nextSibling}_n=null}}else _n=En?ts(r.stateNode.nextSibling):null;return!0}function ay(){for(var r=_n;r;)r=ts(r.nextSibling)}function Uo(){_n=En=null,et=!1}function md(r){Gn===null?Gn=[r]:Gn.push(r)}var pb=C.ReactCurrentBatchConfig;function Yi(r,s,a){if(r=a.ref,r!==null&&typeof r!="function"&&typeof r!="object"){if(a._owner){if(a=a._owner,a){if(a.tag!==1)throw Error(n(309));var u=a.stateNode}if(!u)throw Error(n(147,r));var f=u,m=""+r;return s!==null&&s.ref!==null&&typeof s.ref=="function"&&s.ref._stringRef===m?s.ref:(s=function(x){var b=f.refs;x===null?delete b[m]:b[m]=x},s._stringRef=m,s)}if(typeof r!="string")throw Error(n(284));if(!a._owner)throw Error(n(290,r))}return r}function Kc(r,s){throw r=Object.prototype.toString.call(s),Error(n(31,r==="[object Object]"?"object with keys {"+Object.keys(s).join(", ")+"}":r))}function cy(r){var s=r._init;return s(r._payload)}function uy(r){function s(z,M){if(r){var W=z.deletions;W===null?(z.deletions=[M],z.flags|=16):W.push(M)}}function a(z,M){if(!r)return null;for(;M!==null;)s(z,M),M=M.sibling;return null}function u(z,M){for(z=new Map;M!==null;)M.key!==null?z.set(M.key,M):z.set(M.index,M),M=M.sibling;return z}function f(z,M){return z=ds(z,M),z.index=0,z.sibling=null,z}function m(z,M,W){return z.index=W,r?(W=z.alternate,W!==null?(W=W.index,W<M?(z.flags|=2,M):W):(z.flags|=2,M)):(z.flags|=1048576,M)}function x(z){return r&&z.alternate===null&&(z.flags|=2),z}function b(z,M,W,ce){return M===null||M.tag!==6?(M=oh(W,z.mode,ce),M.return=z,M):(M=f(M,W),M.return=z,M)}function R(z,M,W,ce){var Se=W.type;return Se===N?ie(z,M,W.props.children,ce,W.key):M!==null&&(M.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&cy(Se)===M.type)?(ce=f(M,W.props),ce.ref=Yi(z,M,W),ce.return=z,ce):(ce=yu(W.type,W.key,W.props,null,z.mode,ce),ce.ref=Yi(z,M,W),ce.return=z,ce)}function G(z,M,W,ce){return M===null||M.tag!==4||M.stateNode.containerInfo!==W.containerInfo||M.stateNode.implementation!==W.implementation?(M=ih(W,z.mode,ce),M.return=z,M):(M=f(M,W.children||[]),M.return=z,M)}function ie(z,M,W,ce,Se){return M===null||M.tag!==7?(M=Ks(W,z.mode,ce,Se),M.return=z,M):(M=f(M,W),M.return=z,M)}function ae(z,M,W){if(typeof M=="string"&&M!==""||typeof M=="number")return M=oh(""+M,z.mode,W),M.return=z,M;if(typeof M=="object"&&M!==null){switch(M.$$typeof){case D:return W=yu(M.type,M.key,M.props,null,z.mode,W),W.ref=Yi(z,null,M),W.return=z,W;case $:return M=ih(M,z.mode,W),M.return=z,M;case J:var ce=M._init;return ae(z,ce(M._payload),W)}if(wn(M)||re(M))return M=Ks(M,z.mode,W,null),M.return=z,M;Kc(z,M)}return null}function oe(z,M,W,ce){var Se=M!==null?M.key:null;if(typeof W=="string"&&W!==""||typeof W=="number")return Se!==null?null:b(z,M,""+W,ce);if(typeof W=="object"&&W!==null){switch(W.$$typeof){case D:return W.key===Se?R(z,M,W,ce):null;case $:return W.key===Se?G(z,M,W,ce):null;case J:return Se=W._init,oe(z,M,Se(W._payload),ce)}if(wn(W)||re(W))return Se!==null?null:ie(z,M,W,ce,null);Kc(z,W)}return null}function he(z,M,W,ce,Se){if(typeof ce=="string"&&ce!==""||typeof ce=="number")return z=z.get(W)||null,b(M,z,""+ce,Se);if(typeof ce=="object"&&ce!==null){switch(ce.$$typeof){case D:return z=z.get(ce.key===null?W:ce.key)||null,R(M,z,ce,Se);case $:return z=z.get(ce.key===null?W:ce.key)||null,G(M,z,ce,Se);case J:var Ee=ce._init;return he(z,M,W,Ee(ce._payload),Se)}if(wn(ce)||re(ce))return z=z.get(W)||null,ie(M,z,ce,Se,null);Kc(M,ce)}return null}function ye(z,M,W,ce){for(var Se=null,Ee=null,_e=M,Ce=M=0,bt=null;_e!==null&&Ce<W.length;Ce++){_e.index>Ce?(bt=_e,_e=null):bt=_e.sibling;var je=oe(z,_e,W[Ce],ce);if(je===null){_e===null&&(_e=bt);break}r&&_e&&je.alternate===null&&s(z,_e),M=m(je,M,Ce),Ee===null?Se=je:Ee.sibling=je,Ee=je,_e=bt}if(Ce===W.length)return a(z,_e),et&&$s(z,Ce),Se;if(_e===null){for(;Ce<W.length;Ce++)_e=ae(z,W[Ce],ce),_e!==null&&(M=m(_e,M,Ce),Ee===null?Se=_e:Ee.sibling=_e,Ee=_e);return et&&$s(z,Ce),Se}for(_e=u(z,_e);Ce<W.length;Ce++)bt=he(_e,z,Ce,W[Ce],ce),bt!==null&&(r&&bt.alternate!==null&&_e.delete(bt.key===null?Ce:bt.key),M=m(bt,M,Ce),Ee===null?Se=bt:Ee.sibling=bt,Ee=bt);return r&&_e.forEach(function(hs){return s(z,hs)}),et&&$s(z,Ce),Se}function ve(z,M,W,ce){var Se=re(W);if(typeof Se!="function")throw Error(n(150));if(W=Se.call(W),W==null)throw Error(n(151));for(var Ee=Se=null,_e=M,Ce=M=0,bt=null,je=W.next();_e!==null&&!je.done;Ce++,je=W.next()){_e.index>Ce?(bt=_e,_e=null):bt=_e.sibling;var hs=oe(z,_e,je.value,ce);if(hs===null){_e===null&&(_e=bt);break}r&&_e&&hs.alternate===null&&s(z,_e),M=m(hs,M,Ce),Ee===null?Se=hs:Ee.sibling=hs,Ee=hs,_e=bt}if(je.done)return a(z,_e),et&&$s(z,Ce),Se;if(_e===null){for(;!je.done;Ce++,je=W.next())je=ae(z,je.value,ce),je!==null&&(M=m(je,M,Ce),Ee===null?Se=je:Ee.sibling=je,Ee=je);return et&&$s(z,Ce),Se}for(_e=u(z,_e);!je.done;Ce++,je=W.next())je=he(_e,z,Ce,je.value,ce),je!==null&&(r&&je.alternate!==null&&_e.delete(je.key===null?Ce:je.key),M=m(je,M,Ce),Ee===null?Se=je:Ee.sibling=je,Ee=je);return r&&_e.forEach(function(Qb){return s(z,Qb)}),et&&$s(z,Ce),Se}function pt(z,M,W,ce){if(typeof W=="object"&&W!==null&&W.type===N&&W.key===null&&(W=W.props.children),typeof W=="object"&&W!==null){switch(W.$$typeof){case D:e:{for(var Se=W.key,Ee=M;Ee!==null;){if(Ee.key===Se){if(Se=W.type,Se===N){if(Ee.tag===7){a(z,Ee.sibling),M=f(Ee,W.props.children),M.return=z,z=M;break e}}else if(Ee.elementType===Se||typeof Se=="object"&&Se!==null&&Se.$$typeof===J&&cy(Se)===Ee.type){a(z,Ee.sibling),M=f(Ee,W.props),M.ref=Yi(z,Ee,W),M.return=z,z=M;break e}a(z,Ee);break}else s(z,Ee);Ee=Ee.sibling}W.type===N?(M=Ks(W.props.children,z.mode,ce,W.key),M.return=z,z=M):(ce=yu(W.type,W.key,W.props,null,z.mode,ce),ce.ref=Yi(z,M,W),ce.return=z,z=ce)}return x(z);case $:e:{for(Ee=W.key;M!==null;){if(M.key===Ee)if(M.tag===4&&M.stateNode.containerInfo===W.containerInfo&&M.stateNode.implementation===W.implementation){a(z,M.sibling),M=f(M,W.children||[]),M.return=z,z=M;break e}else{a(z,M);break}else s(z,M);M=M.sibling}M=ih(W,z.mode,ce),M.return=z,z=M}return x(z);case J:return Ee=W._init,pt(z,M,Ee(W._payload),ce)}if(wn(W))return ye(z,M,W,ce);if(re(W))return ve(z,M,W,ce);Kc(z,W)}return typeof W=="string"&&W!==""||typeof W=="number"?(W=""+W,M!==null&&M.tag===6?(a(z,M.sibling),M=f(M,W),M.return=z,z=M):(a(z,M),M=oh(W,z.mode,ce),M.return=z,z=M),x(z)):a(z,M)}return pt}var Bo=uy(!0),ly=uy(!1),Qc=ns(null),Jc=null,zo=null,pd=null;function gd(){pd=zo=Jc=null}function yd(r){var s=Qc.current;Ze(Qc),r._currentValue=s}function vd(r,s,a){for(;r!==null;){var u=r.alternate;if((r.childLanes&s)!==s?(r.childLanes|=s,u!==null&&(u.childLanes|=s)):u!==null&&(u.childLanes&s)!==s&&(u.childLanes|=s),r===a)break;r=r.return}}function Vo(r,s){Jc=r,pd=zo=null,r=r.dependencies,r!==null&&r.firstContext!==null&&((r.lanes&s)!==0&&(un=!0),r.firstContext=null)}function On(r){var s=r._currentValue;if(pd!==r)if(r={context:r,memoizedValue:s,next:null},zo===null){if(Jc===null)throw Error(n(308));zo=r,Jc.dependencies={lanes:0,firstContext:r}}else zo=zo.next=r;return s}var Us=null;function Sd(r){Us===null?Us=[r]:Us.push(r)}function fy(r,s,a,u){var f=s.interleaved;return f===null?(a.next=a,Sd(s)):(a.next=f.next,f.next=a),s.interleaved=a,Lr(r,u)}function Lr(r,s){r.lanes|=s;var a=r.alternate;for(a!==null&&(a.lanes|=s),a=r,r=r.return;r!==null;)r.childLanes|=s,a=r.alternate,a!==null&&(a.childLanes|=s),a=r,r=r.return;return a.tag===3?a.stateNode:null}var os=!1;function xd(r){r.updateQueue={baseState:r.memoizedState,firstBaseUpdate:null,lastBaseUpdate:null,shared:{pending:null,interleaved:null,lanes:0},effects:null}}function dy(r,s){r=r.updateQueue,s.updateQueue===r&&(s.updateQueue={baseState:r.baseState,firstBaseUpdate:r.firstBaseUpdate,lastBaseUpdate:r.lastBaseUpdate,shared:r.shared,effects:r.effects})}function Or(r,s){return{eventTime:r,lane:s,tag:0,payload:null,callback:null,next:null}}function is(r,s,a){var u=r.updateQueue;if(u===null)return null;if(u=u.shared,(De&2)!==0){var f=u.pending;return f===null?s.next=s:(s.next=f.next,f.next=s),u.pending=s,Lr(r,a)}return f=u.interleaved,f===null?(s.next=s,Sd(u)):(s.next=f.next,f.next=s),u.interleaved=s,Lr(r,a)}function Gc(r,s,a){if(s=s.updateQueue,s!==null&&(s=s.shared,(a&4194240)!==0)){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Lf(r,a)}}function hy(r,s){var a=r.updateQueue,u=r.alternate;if(u!==null&&(u=u.updateQueue,a===u)){var f=null,m=null;if(a=a.firstBaseUpdate,a!==null){do{var x={eventTime:a.eventTime,lane:a.lane,tag:a.tag,payload:a.payload,callback:a.callback,next:null};m===null?f=m=x:m=m.next=x,a=a.next}while(a!==null);m===null?f=m=s:m=m.next=s}else f=m=s;a={baseState:u.baseState,firstBaseUpdate:f,lastBaseUpdate:m,shared:u.shared,effects:u.effects},r.updateQueue=a;return}r=a.lastBaseUpdate,r===null?a.firstBaseUpdate=s:r.next=s,a.lastBaseUpdate=s}function Yc(r,s,a,u){var f=r.updateQueue;os=!1;var m=f.firstBaseUpdate,x=f.lastBaseUpdate,b=f.shared.pending;if(b!==null){f.shared.pending=null;var R=b,G=R.next;R.next=null,x===null?m=G:x.next=G,x=R;var ie=r.alternate;ie!==null&&(ie=ie.updateQueue,b=ie.lastBaseUpdate,b!==x&&(b===null?ie.firstBaseUpdate=G:b.next=G,ie.lastBaseUpdate=R))}if(m!==null){var ae=f.baseState;x=0,ie=G=R=null,b=m;do{var oe=b.lane,he=b.eventTime;if((u&oe)===oe){ie!==null&&(ie=ie.next={eventTime:he,lane:0,tag:b.tag,payload:b.payload,callback:b.callback,next:null});e:{var ye=r,ve=b;switch(oe=s,he=a,ve.tag){case 1:if(ye=ve.payload,typeof ye=="function"){ae=ye.call(he,ae,oe);break e}ae=ye;break e;case 3:ye.flags=ye.flags&-65537|128;case 0:if(ye=ve.payload,oe=typeof ye=="function"?ye.call(he,ae,oe):ye,oe==null)break e;ae=te({},ae,oe);break e;case 2:os=!0}}b.callback!==null&&b.lane!==0&&(r.flags|=64,oe=f.effects,oe===null?f.effects=[b]:oe.push(b))}else he={eventTime:he,lane:oe,tag:b.tag,payload:b.payload,callback:b.callback,next:null},ie===null?(G=ie=he,R=ae):ie=ie.next=he,x|=oe;if(b=b.next,b===null){if(b=f.shared.pending,b===null)break;oe=b,b=oe.next,oe.next=null,f.lastBaseUpdate=oe,f.shared.pending=null}}while(!0);if(ie===null&&(R=ae),f.baseState=R,f.firstBaseUpdate=G,f.lastBaseUpdate=ie,s=f.shared.interleaved,s!==null){f=s;do x|=f.lane,f=f.next;while(f!==s)}else m===null&&(f.shared.lanes=0);Vs|=x,r.lanes=x,r.memoizedState=ae}}function my(r,s,a){if(r=s.effects,s.effects=null,r!==null)for(s=0;s<r.length;s++){var u=r[s],f=u.callback;if(f!==null){if(u.callback=null,u=a,typeof f!="function")throw Error(n(191,f));f.call(u)}}}var Xi={},mr=ns(Xi),Zi=ns(Xi),ea=ns(Xi);function Bs(r){if(r===Xi)throw Error(n(174));return r}function wd(r,s){switch(Qe(ea,s),Qe(Zi,r),Qe(mr,Xi),r=s.nodeType,r){case 9:case 11:s=(s=s.documentElement)?s.namespaceURI:Kn(null,"");break;default:r=r===8?s.parentNode:s,s=r.namespaceURI||null,r=r.tagName,s=Kn(s,r)}Ze(mr),Qe(mr,s)}function qo(){Ze(mr),Ze(Zi),Ze(ea)}function py(r){Bs(ea.current);var s=Bs(mr.current),a=Kn(s,r.type);s!==a&&(Qe(Zi,r),Qe(mr,a))}function kd(r){Zi.current===r&&(Ze(mr),Ze(Zi))}var st=ns(0);function Xc(r){for(var s=r;s!==null;){if(s.tag===13){var a=s.memoizedState;if(a!==null&&(a=a.dehydrated,a===null||a.data==="$?"||a.data==="$!"))return s}else if(s.tag===19&&s.memoizedProps.revealOrder!==void 0){if((s.flags&128)!==0)return s}else if(s.child!==null){s.child.return=s,s=s.child;continue}if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return null;s=s.return}s.sibling.return=s.return,s=s.sibling}return null}var Ed=[];function _d(){for(var r=0;r<Ed.length;r++)Ed[r]._workInProgressVersionPrimary=null;Ed.length=0}var Zc=C.ReactCurrentDispatcher,Cd=C.ReactCurrentBatchConfig,zs=0,ot=null,xt=null,_t=null,eu=!1,ta=!1,na=0,gb=0;function zt(){throw Error(n(321))}function bd(r,s){if(s===null)return!1;for(var a=0;a<s.length&&a<r.length;a++)if(!Jn(r[a],s[a]))return!1;return!0}function Pd(r,s,a,u,f,m){if(zs=m,ot=s,s.memoizedState=null,s.updateQueue=null,s.lanes=0,Zc.current=r===null||r.memoizedState===null?xb:wb,r=a(u,f),ta){m=0;do{if(ta=!1,na=0,25<=m)throw Error(n(301));m+=1,_t=xt=null,s.updateQueue=null,Zc.current=kb,r=a(u,f)}while(ta)}if(Zc.current=ru,s=xt!==null&&xt.next!==null,zs=0,_t=xt=ot=null,eu=!1,s)throw Error(n(300));return r}function Fd(){var r=na!==0;return na=0,r}function pr(){var r={memoizedState:null,baseState:null,baseQueue:null,queue:null,next:null};return _t===null?ot.memoizedState=_t=r:_t=_t.next=r,_t}function Nn(){if(xt===null){var r=ot.alternate;r=r!==null?r.memoizedState:null}else r=xt.next;var s=_t===null?ot.memoizedState:_t.next;if(s!==null)_t=s,xt=r;else{if(r===null)throw Error(n(310));xt=r,r={memoizedState:xt.memoizedState,baseState:xt.baseState,baseQueue:xt.baseQueue,queue:xt.queue,next:null},_t===null?ot.memoizedState=_t=r:_t=_t.next=r}return _t}function ra(r,s){return typeof s=="function"?s(r):s}function Id(r){var s=Nn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=xt,f=u.baseQueue,m=a.pending;if(m!==null){if(f!==null){var x=f.next;f.next=m.next,m.next=x}u.baseQueue=f=m,a.pending=null}if(f!==null){m=f.next,u=u.baseState;var b=x=null,R=null,G=m;do{var ie=G.lane;if((zs&ie)===ie)R!==null&&(R=R.next={lane:0,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null}),u=G.hasEagerState?G.eagerState:r(u,G.action);else{var ae={lane:ie,action:G.action,hasEagerState:G.hasEagerState,eagerState:G.eagerState,next:null};R===null?(b=R=ae,x=u):R=R.next=ae,ot.lanes|=ie,Vs|=ie}G=G.next}while(G!==null&&G!==m);R===null?x=u:R.next=b,Jn(u,s.memoizedState)||(un=!0),s.memoizedState=u,s.baseState=x,s.baseQueue=R,a.lastRenderedState=u}if(r=a.interleaved,r!==null){f=r;do m=f.lane,ot.lanes|=m,Vs|=m,f=f.next;while(f!==r)}else f===null&&(a.lanes=0);return[s.memoizedState,a.dispatch]}function Rd(r){var s=Nn(),a=s.queue;if(a===null)throw Error(n(311));a.lastRenderedReducer=r;var u=a.dispatch,f=a.pending,m=s.memoizedState;if(f!==null){a.pending=null;var x=f=f.next;do m=r(m,x.action),x=x.next;while(x!==f);Jn(m,s.memoizedState)||(un=!0),s.memoizedState=m,s.baseQueue===null&&(s.baseState=m),a.lastRenderedState=m}return[m,u]}function gy(){}function yy(r,s){var a=ot,u=Nn(),f=s(),m=!Jn(u.memoizedState,f);if(m&&(u.memoizedState=f,un=!0),u=u.queue,Td(xy.bind(null,a,u,r),[r]),u.getSnapshot!==s||m||_t!==null&&_t.memoizedState.tag&1){if(a.flags|=2048,sa(9,Sy.bind(null,a,u,f,s),void 0,null),Ct===null)throw Error(n(349));(zs&30)!==0||vy(a,s,f)}return f}function vy(r,s,a){r.flags|=16384,r={getSnapshot:s,value:a},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.stores=[r]):(a=s.stores,a===null?s.stores=[r]:a.push(r))}function Sy(r,s,a,u){s.value=a,s.getSnapshot=u,wy(s)&&ky(r)}function xy(r,s,a){return a(function(){wy(s)&&ky(r)})}function wy(r){var s=r.getSnapshot;r=r.value;try{var a=s();return!Jn(r,a)}catch{return!0}}function ky(r){var s=Lr(r,1);s!==null&&er(s,r,1,-1)}function Ey(r){var s=pr();return typeof r=="function"&&(r=r()),s.memoizedState=s.baseState=r,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:ra,lastRenderedState:r},s.queue=r,r=r.dispatch=Sb.bind(null,ot,r),[s.memoizedState,r]}function sa(r,s,a,u){return r={tag:r,create:s,destroy:a,deps:u,next:null},s=ot.updateQueue,s===null?(s={lastEffect:null,stores:null},ot.updateQueue=s,s.lastEffect=r.next=r):(a=s.lastEffect,a===null?s.lastEffect=r.next=r:(u=a.next,a.next=r,r.next=u,s.lastEffect=r)),r}function _y(){return Nn().memoizedState}function tu(r,s,a,u){var f=pr();ot.flags|=r,f.memoizedState=sa(1|s,a,void 0,u===void 0?null:u)}function nu(r,s,a,u){var f=Nn();u=u===void 0?null:u;var m=void 0;if(xt!==null){var x=xt.memoizedState;if(m=x.destroy,u!==null&&bd(u,x.deps)){f.memoizedState=sa(s,a,m,u);return}}ot.flags|=r,f.memoizedState=sa(1|s,a,m,u)}function Cy(r,s){return tu(8390656,8,r,s)}function Td(r,s){return nu(2048,8,r,s)}function by(r,s){return nu(4,2,r,s)}function Py(r,s){return nu(4,4,r,s)}function Fy(r,s){if(typeof s=="function")return r=r(),s(r),function(){s(null)};if(s!=null)return r=r(),s.current=r,function(){s.current=null}}function Iy(r,s,a){return a=a!=null?a.concat([r]):null,nu(4,4,Fy.bind(null,s,r),a)}function Md(){}function Ry(r,s){var a=Nn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&bd(s,u[1])?u[0]:(a.memoizedState=[r,s],r)}function Ty(r,s){var a=Nn();s=s===void 0?null:s;var u=a.memoizedState;return u!==null&&s!==null&&bd(s,u[1])?u[0]:(r=r(),a.memoizedState=[r,s],r)}function My(r,s,a){return(zs&21)===0?(r.baseState&&(r.baseState=!1,un=!0),r.memoizedState=a):(Jn(a,s)||(a=c0(),ot.lanes|=a,Vs|=a,r.baseState=!0),s)}function yb(r,s){var a=ze;ze=a!==0&&4>a?a:4,r(!0);var u=Cd.transition;Cd.transition={};try{r(!1),s()}finally{ze=a,Cd.transition=u}}function Ay(){return Nn().memoizedState}function vb(r,s,a){var u=ls(r);if(a={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null},Ly(r))Oy(s,a);else if(a=fy(r,s,a,u),a!==null){var f=Xt();er(a,r,u,f),Ny(a,s,u)}}function Sb(r,s,a){var u=ls(r),f={lane:u,action:a,hasEagerState:!1,eagerState:null,next:null};if(Ly(r))Oy(s,f);else{var m=r.alternate;if(r.lanes===0&&(m===null||m.lanes===0)&&(m=s.lastRenderedReducer,m!==null))try{var x=s.lastRenderedState,b=m(x,a);if(f.hasEagerState=!0,f.eagerState=b,Jn(b,x)){var R=s.interleaved;R===null?(f.next=f,Sd(s)):(f.next=R.next,R.next=f),s.interleaved=f;return}}catch{}finally{}a=fy(r,s,f,u),a!==null&&(f=Xt(),er(a,r,u,f),Ny(a,s,u))}}function Ly(r){var s=r.alternate;return r===ot||s!==null&&s===ot}function Oy(r,s){ta=eu=!0;var a=r.pending;a===null?s.next=s:(s.next=a.next,a.next=s),r.pending=s}function Ny(r,s,a){if((a&4194240)!==0){var u=s.lanes;u&=r.pendingLanes,a|=u,s.lanes=a,Lf(r,a)}}var ru={readContext:On,useCallback:zt,useContext:zt,useEffect:zt,useImperativeHandle:zt,useInsertionEffect:zt,useLayoutEffect:zt,useMemo:zt,useReducer:zt,useRef:zt,useState:zt,useDebugValue:zt,useDeferredValue:zt,useTransition:zt,useMutableSource:zt,useSyncExternalStore:zt,useId:zt,unstable_isNewReconciler:!1},xb={readContext:On,useCallback:function(r,s){return pr().memoizedState=[r,s===void 0?null:s],r},useContext:On,useEffect:Cy,useImperativeHandle:function(r,s,a){return a=a!=null?a.concat([r]):null,tu(4194308,4,Fy.bind(null,s,r),a)},useLayoutEffect:function(r,s){return tu(4194308,4,r,s)},useInsertionEffect:function(r,s){return tu(4,2,r,s)},useMemo:function(r,s){var a=pr();return s=s===void 0?null:s,r=r(),a.memoizedState=[r,s],r},useReducer:function(r,s,a){var u=pr();return s=a!==void 0?a(s):s,u.memoizedState=u.baseState=s,r={pending:null,interleaved:null,lanes:0,dispatch:null,lastRenderedReducer:r,lastRenderedState:s},u.queue=r,r=r.dispatch=vb.bind(null,ot,r),[u.memoizedState,r]},useRef:function(r){var s=pr();return r={current:r},s.memoizedState=r},useState:Ey,useDebugValue:Md,useDeferredValue:function(r){return pr().memoizedState=r},useTransition:function(){var r=Ey(!1),s=r[0];return r=yb.bind(null,r[1]),pr().memoizedState=r,[s,r]},useMutableSource:function(){},useSyncExternalStore:function(r,s,a){var u=ot,f=pr();if(et){if(a===void 0)throw Error(n(407));a=a()}else{if(a=s(),Ct===null)throw Error(n(349));(zs&30)!==0||vy(u,s,a)}f.memoizedState=a;var m={value:a,getSnapshot:s};return f.queue=m,Cy(xy.bind(null,u,m,r),[r]),u.flags|=2048,sa(9,Sy.bind(null,u,m,a,s),void 0,null),a},useId:function(){var r=pr(),s=Ct.identifierPrefix;if(et){var a=Ar,u=Mr;a=(u&~(1<<32-Qn(u)-1)).toString(32)+a,s=":"+s+"R"+a,a=na++,0<a&&(s+="H"+a.toString(32)),s+=":"}else a=gb++,s=":"+s+"r"+a.toString(32)+":";return r.memoizedState=s},unstable_isNewReconciler:!1},wb={readContext:On,useCallback:Ry,useContext:On,useEffect:Td,useImperativeHandle:Iy,useInsertionEffect:by,useLayoutEffect:Py,useMemo:Ty,useReducer:Id,useRef:_y,useState:function(){return Id(ra)},useDebugValue:Md,useDeferredValue:function(r){var s=Nn();return My(s,xt.memoizedState,r)},useTransition:function(){var r=Id(ra)[0],s=Nn().memoizedState;return[r,s]},useMutableSource:gy,useSyncExternalStore:yy,useId:Ay,unstable_isNewReconciler:!1},kb={readContext:On,useCallback:Ry,useContext:On,useEffect:Td,useImperativeHandle:Iy,useInsertionEffect:by,useLayoutEffect:Py,useMemo:Ty,useReducer:Rd,useRef:_y,useState:function(){return Rd(ra)},useDebugValue:Md,useDeferredValue:function(r){var s=Nn();return xt===null?s.memoizedState=r:My(s,xt.memoizedState,r)},useTransition:function(){var r=Rd(ra)[0],s=Nn().memoizedState;return[r,s]},useMutableSource:gy,useSyncExternalStore:yy,useId:Ay,unstable_isNewReconciler:!1};function Yn(r,s){if(r&&r.defaultProps){s=te({},s),r=r.defaultProps;for(var a in r)s[a]===void 0&&(s[a]=r[a]);return s}return s}function Ad(r,s,a,u){s=r.memoizedState,a=a(u,s),a=a==null?s:te({},s,a),r.memoizedState=a,r.lanes===0&&(r.updateQueue.baseState=a)}var su={isMounted:function(r){return(r=r._reactInternals)?Os(r)===r:!1},enqueueSetState:function(r,s,a){r=r._reactInternals;var u=Xt(),f=ls(r),m=Or(u,f);m.payload=s,a!=null&&(m.callback=a),s=is(r,m,f),s!==null&&(er(s,r,f,u),Gc(s,r,f))},enqueueReplaceState:function(r,s,a){r=r._reactInternals;var u=Xt(),f=ls(r),m=Or(u,f);m.tag=1,m.payload=s,a!=null&&(m.callback=a),s=is(r,m,f),s!==null&&(er(s,r,f,u),Gc(s,r,f))},enqueueForceUpdate:function(r,s){r=r._reactInternals;var a=Xt(),u=ls(r),f=Or(a,u);f.tag=2,s!=null&&(f.callback=s),s=is(r,f,u),s!==null&&(er(s,r,u,a),Gc(s,r,u))}};function Dy(r,s,a,u,f,m,x){return r=r.stateNode,typeof r.shouldComponentUpdate=="function"?r.shouldComponentUpdate(u,m,x):s.prototype&&s.prototype.isPureReactComponent?!qi(a,u)||!qi(f,m):!0}function jy(r,s,a){var u=!1,f=rs,m=s.contextType;return typeof m=="object"&&m!==null?m=On(m):(f=cn(s)?Ds:Bt.current,u=s.contextTypes,m=(u=u!=null)?Do(r,f):rs),s=new s(a,m),r.memoizedState=s.state!==null&&s.state!==void 0?s.state:null,s.updater=su,r.stateNode=s,s._reactInternals=r,u&&(r=r.stateNode,r.__reactInternalMemoizedUnmaskedChildContext=f,r.__reactInternalMemoizedMaskedChildContext=m),s}function $y(r,s,a,u){r=s.state,typeof s.componentWillReceiveProps=="function"&&s.componentWillReceiveProps(a,u),typeof s.UNSAFE_componentWillReceiveProps=="function"&&s.UNSAFE_componentWillReceiveProps(a,u),s.state!==r&&su.enqueueReplaceState(s,s.state,null)}function Ld(r,s,a,u){var f=r.stateNode;f.props=a,f.state=r.memoizedState,f.refs={},xd(r);var m=s.contextType;typeof m=="object"&&m!==null?f.context=On(m):(m=cn(s)?Ds:Bt.current,f.context=Do(r,m)),f.state=r.memoizedState,m=s.getDerivedStateFromProps,typeof m=="function"&&(Ad(r,s,m,a),f.state=r.memoizedState),typeof s.getDerivedStateFromProps=="function"||typeof f.getSnapshotBeforeUpdate=="function"||typeof f.UNSAFE_componentWillMount!="function"&&typeof f.componentWillMount!="function"||(s=f.state,typeof f.componentWillMount=="function"&&f.componentWillMount(),typeof f.UNSAFE_componentWillMount=="function"&&f.UNSAFE_componentWillMount(),s!==f.state&&su.enqueueReplaceState(f,f.state,null),Yc(r,a,f,u),f.state=r.memoizedState),typeof f.componentDidMount=="function"&&(r.flags|=4194308)}function Wo(r,s){try{var a="",u=s;do a+=le(u),u=u.return;while(u);var f=a}catch(m){f=`
|
|
40
|
+
Error generating stack: `+m.message+`
|
|
41
|
+
`+m.stack}return{value:r,source:s,stack:f,digest:null}}function Od(r,s,a){return{value:r,source:null,stack:a??null,digest:s??null}}function Nd(r,s){try{console.error(s.value)}catch(a){setTimeout(function(){throw a})}}var Eb=typeof WeakMap=="function"?WeakMap:Map;function Uy(r,s,a){a=Or(-1,a),a.tag=3,a.payload={element:null};var u=s.value;return a.callback=function(){fu||(fu=!0,Yd=u),Nd(r,s)},a}function By(r,s,a){a=Or(-1,a),a.tag=3;var u=r.type.getDerivedStateFromError;if(typeof u=="function"){var f=s.value;a.payload=function(){return u(f)},a.callback=function(){Nd(r,s)}}var m=r.stateNode;return m!==null&&typeof m.componentDidCatch=="function"&&(a.callback=function(){Nd(r,s),typeof u!="function"&&(cs===null?cs=new Set([this]):cs.add(this));var x=s.stack;this.componentDidCatch(s.value,{componentStack:x!==null?x:""})}),a}function zy(r,s,a){var u=r.pingCache;if(u===null){u=r.pingCache=new Eb;var f=new Set;u.set(s,f)}else f=u.get(s),f===void 0&&(f=new Set,u.set(s,f));f.has(a)||(f.add(a),r=Db.bind(null,r,s,a),s.then(r,r))}function Vy(r){do{var s;if((s=r.tag===13)&&(s=r.memoizedState,s=s!==null?s.dehydrated!==null:!0),s)return r;r=r.return}while(r!==null);return null}function qy(r,s,a,u,f){return(r.mode&1)===0?(r===s?r.flags|=65536:(r.flags|=128,a.flags|=131072,a.flags&=-52805,a.tag===1&&(a.alternate===null?a.tag=17:(s=Or(-1,1),s.tag=2,is(a,s,1))),a.lanes|=1),r):(r.flags|=65536,r.lanes=f,r)}var _b=C.ReactCurrentOwner,un=!1;function Yt(r,s,a,u){s.child=r===null?ly(s,null,a,u):Bo(s,r.child,a,u)}function Wy(r,s,a,u,f){a=a.render;var m=s.ref;return Vo(s,f),u=Pd(r,s,a,u,m,f),a=Fd(),r!==null&&!un?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Nr(r,s,f)):(et&&a&&ld(s),s.flags|=1,Yt(r,s,u,f),s.child)}function Hy(r,s,a,u,f){if(r===null){var m=a.type;return typeof m=="function"&&!sh(m)&&m.defaultProps===void 0&&a.compare===null&&a.defaultProps===void 0?(s.tag=15,s.type=m,Ky(r,s,m,u,f)):(r=yu(a.type,null,u,s,s.mode,f),r.ref=s.ref,r.return=s,s.child=r)}if(m=r.child,(r.lanes&f)===0){var x=m.memoizedProps;if(a=a.compare,a=a!==null?a:qi,a(x,u)&&r.ref===s.ref)return Nr(r,s,f)}return s.flags|=1,r=ds(m,u),r.ref=s.ref,r.return=s,s.child=r}function Ky(r,s,a,u,f){if(r!==null){var m=r.memoizedProps;if(qi(m,u)&&r.ref===s.ref)if(un=!1,s.pendingProps=u=m,(r.lanes&f)!==0)(r.flags&131072)!==0&&(un=!0);else return s.lanes=r.lanes,Nr(r,s,f)}return Dd(r,s,a,u,f)}function Qy(r,s,a){var u=s.pendingProps,f=u.children,m=r!==null?r.memoizedState:null;if(u.mode==="hidden")if((s.mode&1)===0)s.memoizedState={baseLanes:0,cachePool:null,transitions:null},Qe(Ko,Cn),Cn|=a;else{if((a&1073741824)===0)return r=m!==null?m.baseLanes|a:a,s.lanes=s.childLanes=1073741824,s.memoizedState={baseLanes:r,cachePool:null,transitions:null},s.updateQueue=null,Qe(Ko,Cn),Cn|=r,null;s.memoizedState={baseLanes:0,cachePool:null,transitions:null},u=m!==null?m.baseLanes:a,Qe(Ko,Cn),Cn|=u}else m!==null?(u=m.baseLanes|a,s.memoizedState=null):u=a,Qe(Ko,Cn),Cn|=u;return Yt(r,s,f,a),s.child}function Jy(r,s){var a=s.ref;(r===null&&a!==null||r!==null&&r.ref!==a)&&(s.flags|=512,s.flags|=2097152)}function Dd(r,s,a,u,f){var m=cn(a)?Ds:Bt.current;return m=Do(s,m),Vo(s,f),a=Pd(r,s,a,u,m,f),u=Fd(),r!==null&&!un?(s.updateQueue=r.updateQueue,s.flags&=-2053,r.lanes&=~f,Nr(r,s,f)):(et&&u&&ld(s),s.flags|=1,Yt(r,s,a,f),s.child)}function Gy(r,s,a,u,f){if(cn(a)){var m=!0;zc(s)}else m=!1;if(Vo(s,f),s.stateNode===null)iu(r,s),jy(s,a,u),Ld(s,a,u,f),u=!0;else if(r===null){var x=s.stateNode,b=s.memoizedProps;x.props=b;var R=x.context,G=a.contextType;typeof G=="object"&&G!==null?G=On(G):(G=cn(a)?Ds:Bt.current,G=Do(s,G));var ie=a.getDerivedStateFromProps,ae=typeof ie=="function"||typeof x.getSnapshotBeforeUpdate=="function";ae||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(b!==u||R!==G)&&$y(s,x,u,G),os=!1;var oe=s.memoizedState;x.state=oe,Yc(s,u,x,f),R=s.memoizedState,b!==u||oe!==R||an.current||os?(typeof ie=="function"&&(Ad(s,a,ie,u),R=s.memoizedState),(b=os||Dy(s,a,b,u,oe,R,G))?(ae||typeof x.UNSAFE_componentWillMount!="function"&&typeof x.componentWillMount!="function"||(typeof x.componentWillMount=="function"&&x.componentWillMount(),typeof x.UNSAFE_componentWillMount=="function"&&x.UNSAFE_componentWillMount()),typeof x.componentDidMount=="function"&&(s.flags|=4194308)):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),s.memoizedProps=u,s.memoizedState=R),x.props=u,x.state=R,x.context=G,u=b):(typeof x.componentDidMount=="function"&&(s.flags|=4194308),u=!1)}else{x=s.stateNode,dy(r,s),b=s.memoizedProps,G=s.type===s.elementType?b:Yn(s.type,b),x.props=G,ae=s.pendingProps,oe=x.context,R=a.contextType,typeof R=="object"&&R!==null?R=On(R):(R=cn(a)?Ds:Bt.current,R=Do(s,R));var he=a.getDerivedStateFromProps;(ie=typeof he=="function"||typeof x.getSnapshotBeforeUpdate=="function")||typeof x.UNSAFE_componentWillReceiveProps!="function"&&typeof x.componentWillReceiveProps!="function"||(b!==ae||oe!==R)&&$y(s,x,u,R),os=!1,oe=s.memoizedState,x.state=oe,Yc(s,u,x,f);var ye=s.memoizedState;b!==ae||oe!==ye||an.current||os?(typeof he=="function"&&(Ad(s,a,he,u),ye=s.memoizedState),(G=os||Dy(s,a,G,u,oe,ye,R)||!1)?(ie||typeof x.UNSAFE_componentWillUpdate!="function"&&typeof x.componentWillUpdate!="function"||(typeof x.componentWillUpdate=="function"&&x.componentWillUpdate(u,ye,R),typeof x.UNSAFE_componentWillUpdate=="function"&&x.UNSAFE_componentWillUpdate(u,ye,R)),typeof x.componentDidUpdate=="function"&&(s.flags|=4),typeof x.getSnapshotBeforeUpdate=="function"&&(s.flags|=1024)):(typeof x.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),s.memoizedProps=u,s.memoizedState=ye),x.props=u,x.state=ye,x.context=R,u=G):(typeof x.componentDidUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=4),typeof x.getSnapshotBeforeUpdate!="function"||b===r.memoizedProps&&oe===r.memoizedState||(s.flags|=1024),u=!1)}return jd(r,s,a,u,m,f)}function jd(r,s,a,u,f,m){Jy(r,s);var x=(s.flags&128)!==0;if(!u&&!x)return f&&ty(s,a,!1),Nr(r,s,m);u=s.stateNode,_b.current=s;var b=x&&typeof a.getDerivedStateFromError!="function"?null:u.render();return s.flags|=1,r!==null&&x?(s.child=Bo(s,r.child,null,m),s.child=Bo(s,null,b,m)):Yt(r,s,b,m),s.memoizedState=u.state,f&&ty(s,a,!0),s.child}function Yy(r){var s=r.stateNode;s.pendingContext?Z0(r,s.pendingContext,s.pendingContext!==s.context):s.context&&Z0(r,s.context,!1),wd(r,s.containerInfo)}function Xy(r,s,a,u,f){return Uo(),md(f),s.flags|=256,Yt(r,s,a,u),s.child}var $d={dehydrated:null,treeContext:null,retryLane:0};function Ud(r){return{baseLanes:r,cachePool:null,transitions:null}}function Zy(r,s,a){var u=s.pendingProps,f=st.current,m=!1,x=(s.flags&128)!==0,b;if((b=x)||(b=r!==null&&r.memoizedState===null?!1:(f&2)!==0),b?(m=!0,s.flags&=-129):(r===null||r.memoizedState!==null)&&(f|=1),Qe(st,f&1),r===null)return hd(s),r=s.memoizedState,r!==null&&(r=r.dehydrated,r!==null)?((s.mode&1)===0?s.lanes=1:r.data==="$!"?s.lanes=8:s.lanes=1073741824,null):(x=u.children,r=u.fallback,m?(u=s.mode,m=s.child,x={mode:"hidden",children:x},(u&1)===0&&m!==null?(m.childLanes=0,m.pendingProps=x):m=vu(x,u,0,null),r=Ks(r,u,a,null),m.return=s,r.return=s,m.sibling=r,s.child=m,s.child.memoizedState=Ud(a),s.memoizedState=$d,r):Bd(s,x));if(f=r.memoizedState,f!==null&&(b=f.dehydrated,b!==null))return Cb(r,s,x,u,b,f,a);if(m){m=u.fallback,x=s.mode,f=r.child,b=f.sibling;var R={mode:"hidden",children:u.children};return(x&1)===0&&s.child!==f?(u=s.child,u.childLanes=0,u.pendingProps=R,s.deletions=null):(u=ds(f,R),u.subtreeFlags=f.subtreeFlags&14680064),b!==null?m=ds(b,m):(m=Ks(m,x,a,null),m.flags|=2),m.return=s,u.return=s,u.sibling=m,s.child=u,u=m,m=s.child,x=r.child.memoizedState,x=x===null?Ud(a):{baseLanes:x.baseLanes|a,cachePool:null,transitions:x.transitions},m.memoizedState=x,m.childLanes=r.childLanes&~a,s.memoizedState=$d,u}return m=r.child,r=m.sibling,u=ds(m,{mode:"visible",children:u.children}),(s.mode&1)===0&&(u.lanes=a),u.return=s,u.sibling=null,r!==null&&(a=s.deletions,a===null?(s.deletions=[r],s.flags|=16):a.push(r)),s.child=u,s.memoizedState=null,u}function Bd(r,s){return s=vu({mode:"visible",children:s},r.mode,0,null),s.return=r,r.child=s}function ou(r,s,a,u){return u!==null&&md(u),Bo(s,r.child,null,a),r=Bd(s,s.pendingProps.children),r.flags|=2,s.memoizedState=null,r}function Cb(r,s,a,u,f,m,x){if(a)return s.flags&256?(s.flags&=-257,u=Od(Error(n(422))),ou(r,s,x,u)):s.memoizedState!==null?(s.child=r.child,s.flags|=128,null):(m=u.fallback,f=s.mode,u=vu({mode:"visible",children:u.children},f,0,null),m=Ks(m,f,x,null),m.flags|=2,u.return=s,m.return=s,u.sibling=m,s.child=u,(s.mode&1)!==0&&Bo(s,r.child,null,x),s.child.memoizedState=Ud(x),s.memoizedState=$d,m);if((s.mode&1)===0)return ou(r,s,x,null);if(f.data==="$!"){if(u=f.nextSibling&&f.nextSibling.dataset,u)var b=u.dgst;return u=b,m=Error(n(419)),u=Od(m,u,void 0),ou(r,s,x,u)}if(b=(x&r.childLanes)!==0,un||b){if(u=Ct,u!==null){switch(x&-x){case 4:f=2;break;case 16:f=8;break;case 64: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:case 4194304:case 8388608:case 16777216:case 33554432:case 67108864:f=32;break;case 536870912:f=268435456;break;default:f=0}f=(f&(u.suspendedLanes|x))!==0?0:f,f!==0&&f!==m.retryLane&&(m.retryLane=f,Lr(r,f),er(u,r,f,-1))}return rh(),u=Od(Error(n(421))),ou(r,s,x,u)}return f.data==="$?"?(s.flags|=128,s.child=r.child,s=jb.bind(null,r),f._reactRetry=s,null):(r=m.treeContext,_n=ts(f.nextSibling),En=s,et=!0,Gn=null,r!==null&&(An[Ln++]=Mr,An[Ln++]=Ar,An[Ln++]=js,Mr=r.id,Ar=r.overflow,js=s),s=Bd(s,u.children),s.flags|=4096,s)}function ev(r,s,a){r.lanes|=s;var u=r.alternate;u!==null&&(u.lanes|=s),vd(r.return,s,a)}function zd(r,s,a,u,f){var m=r.memoizedState;m===null?r.memoizedState={isBackwards:s,rendering:null,renderingStartTime:0,last:u,tail:a,tailMode:f}:(m.isBackwards=s,m.rendering=null,m.renderingStartTime=0,m.last=u,m.tail=a,m.tailMode=f)}function tv(r,s,a){var u=s.pendingProps,f=u.revealOrder,m=u.tail;if(Yt(r,s,u.children,a),u=st.current,(u&2)!==0)u=u&1|2,s.flags|=128;else{if(r!==null&&(r.flags&128)!==0)e:for(r=s.child;r!==null;){if(r.tag===13)r.memoizedState!==null&&ev(r,a,s);else if(r.tag===19)ev(r,a,s);else if(r.child!==null){r.child.return=r,r=r.child;continue}if(r===s)break e;for(;r.sibling===null;){if(r.return===null||r.return===s)break e;r=r.return}r.sibling.return=r.return,r=r.sibling}u&=1}if(Qe(st,u),(s.mode&1)===0)s.memoizedState=null;else switch(f){case"forwards":for(a=s.child,f=null;a!==null;)r=a.alternate,r!==null&&Xc(r)===null&&(f=a),a=a.sibling;a=f,a===null?(f=s.child,s.child=null):(f=a.sibling,a.sibling=null),zd(s,!1,f,a,m);break;case"backwards":for(a=null,f=s.child,s.child=null;f!==null;){if(r=f.alternate,r!==null&&Xc(r)===null){s.child=f;break}r=f.sibling,f.sibling=a,a=f,f=r}zd(s,!0,a,null,m);break;case"together":zd(s,!1,null,null,void 0);break;default:s.memoizedState=null}return s.child}function iu(r,s){(s.mode&1)===0&&r!==null&&(r.alternate=null,s.alternate=null,s.flags|=2)}function Nr(r,s,a){if(r!==null&&(s.dependencies=r.dependencies),Vs|=s.lanes,(a&s.childLanes)===0)return null;if(r!==null&&s.child!==r.child)throw Error(n(153));if(s.child!==null){for(r=s.child,a=ds(r,r.pendingProps),s.child=a,a.return=s;r.sibling!==null;)r=r.sibling,a=a.sibling=ds(r,r.pendingProps),a.return=s;a.sibling=null}return s.child}function bb(r,s,a){switch(s.tag){case 3:Yy(s),Uo();break;case 5:py(s);break;case 1:cn(s.type)&&zc(s);break;case 4:wd(s,s.stateNode.containerInfo);break;case 10:var u=s.type._context,f=s.memoizedProps.value;Qe(Qc,u._currentValue),u._currentValue=f;break;case 13:if(u=s.memoizedState,u!==null)return u.dehydrated!==null?(Qe(st,st.current&1),s.flags|=128,null):(a&s.child.childLanes)!==0?Zy(r,s,a):(Qe(st,st.current&1),r=Nr(r,s,a),r!==null?r.sibling:null);Qe(st,st.current&1);break;case 19:if(u=(a&s.childLanes)!==0,(r.flags&128)!==0){if(u)return tv(r,s,a);s.flags|=128}if(f=s.memoizedState,f!==null&&(f.rendering=null,f.tail=null,f.lastEffect=null),Qe(st,st.current),u)break;return null;case 22:case 23:return s.lanes=0,Qy(r,s,a)}return Nr(r,s,a)}var nv,Vd,rv,sv;nv=function(r,s){for(var a=s.child;a!==null;){if(a.tag===5||a.tag===6)r.appendChild(a.stateNode);else if(a.tag!==4&&a.child!==null){a.child.return=a,a=a.child;continue}if(a===s)break;for(;a.sibling===null;){if(a.return===null||a.return===s)return;a=a.return}a.sibling.return=a.return,a=a.sibling}},Vd=function(){},rv=function(r,s,a,u){var f=r.memoizedProps;if(f!==u){r=s.stateNode,Bs(mr.current);var m=null;switch(a){case"input":f=Kr(r,f),u=Kr(r,u),m=[];break;case"select":f=te({},f,{value:void 0}),u=te({},u,{value:void 0}),m=[];break;case"textarea":f=_o(r,f),u=_o(r,u),m=[];break;default:typeof f.onClick!="function"&&typeof u.onClick=="function"&&(r.onclick=$c)}Ef(a,u);var x;a=null;for(G in f)if(!u.hasOwnProperty(G)&&f.hasOwnProperty(G)&&f[G]!=null)if(G==="style"){var b=f[G];for(x in b)b.hasOwnProperty(x)&&(a||(a={}),a[x]="")}else G!=="dangerouslySetInnerHTML"&&G!=="children"&&G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&G!=="autoFocus"&&(i.hasOwnProperty(G)?m||(m=[]):(m=m||[]).push(G,null));for(G in u){var R=u[G];if(b=f!=null?f[G]:void 0,u.hasOwnProperty(G)&&R!==b&&(R!=null||b!=null))if(G==="style")if(b){for(x in b)!b.hasOwnProperty(x)||R&&R.hasOwnProperty(x)||(a||(a={}),a[x]="");for(x in R)R.hasOwnProperty(x)&&b[x]!==R[x]&&(a||(a={}),a[x]=R[x])}else a||(m||(m=[]),m.push(G,a)),a=R;else G==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,b=b?b.__html:void 0,R!=null&&b!==R&&(m=m||[]).push(G,R)):G==="children"?typeof R!="string"&&typeof R!="number"||(m=m||[]).push(G,""+R):G!=="suppressContentEditableWarning"&&G!=="suppressHydrationWarning"&&(i.hasOwnProperty(G)?(R!=null&&G==="onScroll"&&Xe("scroll",r),m||b===R||(m=[])):(m=m||[]).push(G,R))}a&&(m=m||[]).push("style",a);var G=m;(s.updateQueue=G)&&(s.flags|=4)}},sv=function(r,s,a,u){a!==u&&(s.flags|=4)};function oa(r,s){if(!et)switch(r.tailMode){case"hidden":s=r.tail;for(var a=null;s!==null;)s.alternate!==null&&(a=s),s=s.sibling;a===null?r.tail=null:a.sibling=null;break;case"collapsed":a=r.tail;for(var u=null;a!==null;)a.alternate!==null&&(u=a),a=a.sibling;u===null?s||r.tail===null?r.tail=null:r.tail.sibling=null:u.sibling=null}}function Vt(r){var s=r.alternate!==null&&r.alternate.child===r.child,a=0,u=0;if(s)for(var f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags&14680064,u|=f.flags&14680064,f.return=r,f=f.sibling;else for(f=r.child;f!==null;)a|=f.lanes|f.childLanes,u|=f.subtreeFlags,u|=f.flags,f.return=r,f=f.sibling;return r.subtreeFlags|=u,r.childLanes=a,s}function Pb(r,s,a){var u=s.pendingProps;switch(fd(s),s.tag){case 2:case 16:case 15:case 0:case 11:case 7:case 8:case 12:case 9:case 14:return Vt(s),null;case 1:return cn(s.type)&&Bc(),Vt(s),null;case 3:return u=s.stateNode,qo(),Ze(an),Ze(Bt),_d(),u.pendingContext&&(u.context=u.pendingContext,u.pendingContext=null),(r===null||r.child===null)&&(Hc(s)?s.flags|=4:r===null||r.memoizedState.isDehydrated&&(s.flags&256)===0||(s.flags|=1024,Gn!==null&&(eh(Gn),Gn=null))),Vd(r,s),Vt(s),null;case 5:kd(s);var f=Bs(ea.current);if(a=s.type,r!==null&&s.stateNode!=null)rv(r,s,a,u,f),r.ref!==s.ref&&(s.flags|=512,s.flags|=2097152);else{if(!u){if(s.stateNode===null)throw Error(n(166));return Vt(s),null}if(r=Bs(mr.current),Hc(s)){u=s.stateNode,a=s.type;var m=s.memoizedProps;switch(u[hr]=s,u[Ji]=m,r=(s.mode&1)!==0,a){case"dialog":Xe("cancel",u),Xe("close",u);break;case"iframe":case"object":case"embed":Xe("load",u);break;case"video":case"audio":for(f=0;f<Hi.length;f++)Xe(Hi[f],u);break;case"source":Xe("error",u);break;case"img":case"image":case"link":Xe("error",u),Xe("load",u);break;case"details":Xe("toggle",u);break;case"input":gc(u,m),Xe("invalid",u);break;case"select":u._wrapperState={wasMultiple:!!m.multiple},Xe("invalid",u);break;case"textarea":yc(u,m),Xe("invalid",u)}Ef(a,m),f=null;for(var x in m)if(m.hasOwnProperty(x)){var b=m[x];x==="children"?typeof b=="string"?u.textContent!==b&&(m.suppressHydrationWarning!==!0&&jc(u.textContent,b,r),f=["children",b]):typeof b=="number"&&u.textContent!==""+b&&(m.suppressHydrationWarning!==!0&&jc(u.textContent,b,r),f=["children",""+b]):i.hasOwnProperty(x)&&b!=null&&x==="onScroll"&&Xe("scroll",u)}switch(a){case"input":on(u),Ir(u,m,!0);break;case"textarea":on(u),Be(u);break;case"select":case"option":break;default:typeof m.onClick=="function"&&(u.onclick=$c)}u=f,s.updateQueue=u,u!==null&&(s.flags|=4)}else{x=f.nodeType===9?f:f.ownerDocument,r==="http://www.w3.org/1999/xhtml"&&(r=Lt(a)),r==="http://www.w3.org/1999/xhtml"?a==="script"?(r=x.createElement("div"),r.innerHTML="<script><\/script>",r=r.removeChild(r.firstChild)):typeof u.is=="string"?r=x.createElement(a,{is:u.is}):(r=x.createElement(a),a==="select"&&(x=r,u.multiple?x.multiple=!0:u.size&&(x.size=u.size))):r=x.createElementNS(r,a),r[hr]=s,r[Ji]=u,nv(r,s,!1,!1),s.stateNode=r;e:{switch(x=_f(a,u),a){case"dialog":Xe("cancel",r),Xe("close",r),f=u;break;case"iframe":case"object":case"embed":Xe("load",r),f=u;break;case"video":case"audio":for(f=0;f<Hi.length;f++)Xe(Hi[f],r);f=u;break;case"source":Xe("error",r),f=u;break;case"img":case"image":case"link":Xe("error",r),Xe("load",r),f=u;break;case"details":Xe("toggle",r),f=u;break;case"input":gc(r,u),f=Kr(r,u),Xe("invalid",r);break;case"option":f=u;break;case"select":r._wrapperState={wasMultiple:!!u.multiple},f=te({},u,{value:void 0}),Xe("invalid",r);break;case"textarea":yc(r,u),f=_o(r,u),Xe("invalid",r);break;default:f=u}Ef(a,f),b=f;for(m in b)if(b.hasOwnProperty(m)){var R=b[m];m==="style"?Kg(r,R):m==="dangerouslySetInnerHTML"?(R=R?R.__html:void 0,R!=null&&Wg(r,R)):m==="children"?typeof R=="string"?(a!=="textarea"||R!=="")&&Pi(r,R):typeof R=="number"&&Pi(r,""+R):m!=="suppressContentEditableWarning"&&m!=="suppressHydrationWarning"&&m!=="autoFocus"&&(i.hasOwnProperty(m)?R!=null&&m==="onScroll"&&Xe("scroll",r):R!=null&&L(r,m,R,x))}switch(a){case"input":on(r),Ir(r,u,!1);break;case"textarea":on(r),Be(r);break;case"option":u.value!=null&&r.setAttribute("value",""+ke(u.value));break;case"select":r.multiple=!!u.multiple,m=u.value,m!=null?Qr(r,!!u.multiple,m,!1):u.defaultValue!=null&&Qr(r,!!u.multiple,u.defaultValue,!0);break;default:typeof f.onClick=="function"&&(r.onclick=$c)}switch(a){case"button":case"input":case"select":case"textarea":u=!!u.autoFocus;break e;case"img":u=!0;break e;default:u=!1}}u&&(s.flags|=4)}s.ref!==null&&(s.flags|=512,s.flags|=2097152)}return Vt(s),null;case 6:if(r&&s.stateNode!=null)sv(r,s,r.memoizedProps,u);else{if(typeof u!="string"&&s.stateNode===null)throw Error(n(166));if(a=Bs(ea.current),Bs(mr.current),Hc(s)){if(u=s.stateNode,a=s.memoizedProps,u[hr]=s,(m=u.nodeValue!==a)&&(r=En,r!==null))switch(r.tag){case 3:jc(u.nodeValue,a,(r.mode&1)!==0);break;case 5:r.memoizedProps.suppressHydrationWarning!==!0&&jc(u.nodeValue,a,(r.mode&1)!==0)}m&&(s.flags|=4)}else u=(a.nodeType===9?a:a.ownerDocument).createTextNode(u),u[hr]=s,s.stateNode=u}return Vt(s),null;case 13:if(Ze(st),u=s.memoizedState,r===null||r.memoizedState!==null&&r.memoizedState.dehydrated!==null){if(et&&_n!==null&&(s.mode&1)!==0&&(s.flags&128)===0)ay(),Uo(),s.flags|=98560,m=!1;else if(m=Hc(s),u!==null&&u.dehydrated!==null){if(r===null){if(!m)throw Error(n(318));if(m=s.memoizedState,m=m!==null?m.dehydrated:null,!m)throw Error(n(317));m[hr]=s}else Uo(),(s.flags&128)===0&&(s.memoizedState=null),s.flags|=4;Vt(s),m=!1}else Gn!==null&&(eh(Gn),Gn=null),m=!0;if(!m)return s.flags&65536?s:null}return(s.flags&128)!==0?(s.lanes=a,s):(u=u!==null,u!==(r!==null&&r.memoizedState!==null)&&u&&(s.child.flags|=8192,(s.mode&1)!==0&&(r===null||(st.current&1)!==0?wt===0&&(wt=3):rh())),s.updateQueue!==null&&(s.flags|=4),Vt(s),null);case 4:return qo(),Vd(r,s),r===null&&Ki(s.stateNode.containerInfo),Vt(s),null;case 10:return yd(s.type._context),Vt(s),null;case 17:return cn(s.type)&&Bc(),Vt(s),null;case 19:if(Ze(st),m=s.memoizedState,m===null)return Vt(s),null;if(u=(s.flags&128)!==0,x=m.rendering,x===null)if(u)oa(m,!1);else{if(wt!==0||r!==null&&(r.flags&128)!==0)for(r=s.child;r!==null;){if(x=Xc(r),x!==null){for(s.flags|=128,oa(m,!1),u=x.updateQueue,u!==null&&(s.updateQueue=u,s.flags|=4),s.subtreeFlags=0,u=a,a=s.child;a!==null;)m=a,r=u,m.flags&=14680066,x=m.alternate,x===null?(m.childLanes=0,m.lanes=r,m.child=null,m.subtreeFlags=0,m.memoizedProps=null,m.memoizedState=null,m.updateQueue=null,m.dependencies=null,m.stateNode=null):(m.childLanes=x.childLanes,m.lanes=x.lanes,m.child=x.child,m.subtreeFlags=0,m.deletions=null,m.memoizedProps=x.memoizedProps,m.memoizedState=x.memoizedState,m.updateQueue=x.updateQueue,m.type=x.type,r=x.dependencies,m.dependencies=r===null?null:{lanes:r.lanes,firstContext:r.firstContext}),a=a.sibling;return Qe(st,st.current&1|2),s.child}r=r.sibling}m.tail!==null&&mt()>Qo&&(s.flags|=128,u=!0,oa(m,!1),s.lanes=4194304)}else{if(!u)if(r=Xc(x),r!==null){if(s.flags|=128,u=!0,a=r.updateQueue,a!==null&&(s.updateQueue=a,s.flags|=4),oa(m,!0),m.tail===null&&m.tailMode==="hidden"&&!x.alternate&&!et)return Vt(s),null}else 2*mt()-m.renderingStartTime>Qo&&a!==1073741824&&(s.flags|=128,u=!0,oa(m,!1),s.lanes=4194304);m.isBackwards?(x.sibling=s.child,s.child=x):(a=m.last,a!==null?a.sibling=x:s.child=x,m.last=x)}return m.tail!==null?(s=m.tail,m.rendering=s,m.tail=s.sibling,m.renderingStartTime=mt(),s.sibling=null,a=st.current,Qe(st,u?a&1|2:a&1),s):(Vt(s),null);case 22:case 23:return nh(),u=s.memoizedState!==null,r!==null&&r.memoizedState!==null!==u&&(s.flags|=8192),u&&(s.mode&1)!==0?(Cn&1073741824)!==0&&(Vt(s),s.subtreeFlags&6&&(s.flags|=8192)):Vt(s),null;case 24:return null;case 25:return null}throw Error(n(156,s.tag))}function Fb(r,s){switch(fd(s),s.tag){case 1:return cn(s.type)&&Bc(),r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 3:return qo(),Ze(an),Ze(Bt),_d(),r=s.flags,(r&65536)!==0&&(r&128)===0?(s.flags=r&-65537|128,s):null;case 5:return kd(s),null;case 13:if(Ze(st),r=s.memoizedState,r!==null&&r.dehydrated!==null){if(s.alternate===null)throw Error(n(340));Uo()}return r=s.flags,r&65536?(s.flags=r&-65537|128,s):null;case 19:return Ze(st),null;case 4:return qo(),null;case 10:return yd(s.type._context),null;case 22:case 23:return nh(),null;case 24:return null;default:return null}}var au=!1,qt=!1,Ib=typeof WeakSet=="function"?WeakSet:Set,ge=null;function Ho(r,s){var a=r.ref;if(a!==null)if(typeof a=="function")try{a(null)}catch(u){at(r,s,u)}else a.current=null}function qd(r,s,a){try{a()}catch(u){at(r,s,u)}}var ov=!1;function Rb(r,s){if(nd=Pc,r=D0(),Qf(r)){if("selectionStart"in r)var a={start:r.selectionStart,end:r.selectionEnd};else e:{a=(a=r.ownerDocument)&&a.defaultView||window;var u=a.getSelection&&a.getSelection();if(u&&u.rangeCount!==0){a=u.anchorNode;var f=u.anchorOffset,m=u.focusNode;u=u.focusOffset;try{a.nodeType,m.nodeType}catch{a=null;break e}var x=0,b=-1,R=-1,G=0,ie=0,ae=r,oe=null;t:for(;;){for(var he;ae!==a||f!==0&&ae.nodeType!==3||(b=x+f),ae!==m||u!==0&&ae.nodeType!==3||(R=x+u),ae.nodeType===3&&(x+=ae.nodeValue.length),(he=ae.firstChild)!==null;)oe=ae,ae=he;for(;;){if(ae===r)break t;if(oe===a&&++G===f&&(b=x),oe===m&&++ie===u&&(R=x),(he=ae.nextSibling)!==null)break;ae=oe,oe=ae.parentNode}ae=he}a=b===-1||R===-1?null:{start:b,end:R}}else a=null}a=a||{start:0,end:0}}else a=null;for(rd={focusedElem:r,selectionRange:a},Pc=!1,ge=s;ge!==null;)if(s=ge,r=s.child,(s.subtreeFlags&1028)!==0&&r!==null)r.return=s,ge=r;else for(;ge!==null;){s=ge;try{var ye=s.alternate;if((s.flags&1024)!==0)switch(s.tag){case 0:case 11:case 15:break;case 1:if(ye!==null){var ve=ye.memoizedProps,pt=ye.memoizedState,z=s.stateNode,M=z.getSnapshotBeforeUpdate(s.elementType===s.type?ve:Yn(s.type,ve),pt);z.__reactInternalSnapshotBeforeUpdate=M}break;case 3:var W=s.stateNode.containerInfo;W.nodeType===1?W.textContent="":W.nodeType===9&&W.documentElement&&W.removeChild(W.documentElement);break;case 5:case 6:case 4:case 17:break;default:throw Error(n(163))}}catch(ce){at(s,s.return,ce)}if(r=s.sibling,r!==null){r.return=s.return,ge=r;break}ge=s.return}return ye=ov,ov=!1,ye}function ia(r,s,a){var u=s.updateQueue;if(u=u!==null?u.lastEffect:null,u!==null){var f=u=u.next;do{if((f.tag&r)===r){var m=f.destroy;f.destroy=void 0,m!==void 0&&qd(s,a,m)}f=f.next}while(f!==u)}}function cu(r,s){if(s=s.updateQueue,s=s!==null?s.lastEffect:null,s!==null){var a=s=s.next;do{if((a.tag&r)===r){var u=a.create;a.destroy=u()}a=a.next}while(a!==s)}}function Wd(r){var s=r.ref;if(s!==null){var a=r.stateNode;switch(r.tag){case 5:r=a;break;default:r=a}typeof s=="function"?s(r):s.current=r}}function iv(r){var s=r.alternate;s!==null&&(r.alternate=null,iv(s)),r.child=null,r.deletions=null,r.sibling=null,r.tag===5&&(s=r.stateNode,s!==null&&(delete s[hr],delete s[Ji],delete s[ad],delete s[db],delete s[hb])),r.stateNode=null,r.return=null,r.dependencies=null,r.memoizedProps=null,r.memoizedState=null,r.pendingProps=null,r.stateNode=null,r.updateQueue=null}function av(r){return r.tag===5||r.tag===3||r.tag===4}function cv(r){e:for(;;){for(;r.sibling===null;){if(r.return===null||av(r.return))return null;r=r.return}for(r.sibling.return=r.return,r=r.sibling;r.tag!==5&&r.tag!==6&&r.tag!==18;){if(r.flags&2||r.child===null||r.tag===4)continue e;r.child.return=r,r=r.child}if(!(r.flags&2))return r.stateNode}}function Hd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.nodeType===8?a.parentNode.insertBefore(r,s):a.insertBefore(r,s):(a.nodeType===8?(s=a.parentNode,s.insertBefore(r,a)):(s=a,s.appendChild(r)),a=a._reactRootContainer,a!=null||s.onclick!==null||(s.onclick=$c));else if(u!==4&&(r=r.child,r!==null))for(Hd(r,s,a),r=r.sibling;r!==null;)Hd(r,s,a),r=r.sibling}function Kd(r,s,a){var u=r.tag;if(u===5||u===6)r=r.stateNode,s?a.insertBefore(r,s):a.appendChild(r);else if(u!==4&&(r=r.child,r!==null))for(Kd(r,s,a),r=r.sibling;r!==null;)Kd(r,s,a),r=r.sibling}var Ot=null,Xn=!1;function as(r,s,a){for(a=a.child;a!==null;)uv(r,s,a),a=a.sibling}function uv(r,s,a){if(dr&&typeof dr.onCommitFiberUnmount=="function")try{dr.onCommitFiberUnmount(wc,a)}catch{}switch(a.tag){case 5:qt||Ho(a,s);case 6:var u=Ot,f=Xn;Ot=null,as(r,s,a),Ot=u,Xn=f,Ot!==null&&(Xn?(r=Ot,a=a.stateNode,r.nodeType===8?r.parentNode.removeChild(a):r.removeChild(a)):Ot.removeChild(a.stateNode));break;case 18:Ot!==null&&(Xn?(r=Ot,a=a.stateNode,r.nodeType===8?id(r.parentNode,a):r.nodeType===1&&id(r,a),ji(r)):id(Ot,a.stateNode));break;case 4:u=Ot,f=Xn,Ot=a.stateNode.containerInfo,Xn=!0,as(r,s,a),Ot=u,Xn=f;break;case 0:case 11:case 14:case 15:if(!qt&&(u=a.updateQueue,u!==null&&(u=u.lastEffect,u!==null))){f=u=u.next;do{var m=f,x=m.destroy;m=m.tag,x!==void 0&&((m&2)!==0||(m&4)!==0)&&qd(a,s,x),f=f.next}while(f!==u)}as(r,s,a);break;case 1:if(!qt&&(Ho(a,s),u=a.stateNode,typeof u.componentWillUnmount=="function"))try{u.props=a.memoizedProps,u.state=a.memoizedState,u.componentWillUnmount()}catch(b){at(a,s,b)}as(r,s,a);break;case 21:as(r,s,a);break;case 22:a.mode&1?(qt=(u=qt)||a.memoizedState!==null,as(r,s,a),qt=u):as(r,s,a);break;default:as(r,s,a)}}function lv(r){var s=r.updateQueue;if(s!==null){r.updateQueue=null;var a=r.stateNode;a===null&&(a=r.stateNode=new Ib),s.forEach(function(u){var f=$b.bind(null,r,u);a.has(u)||(a.add(u),u.then(f,f))})}}function Zn(r,s){var a=s.deletions;if(a!==null)for(var u=0;u<a.length;u++){var f=a[u];try{var m=r,x=s,b=x;e:for(;b!==null;){switch(b.tag){case 5:Ot=b.stateNode,Xn=!1;break e;case 3:Ot=b.stateNode.containerInfo,Xn=!0;break e;case 4:Ot=b.stateNode.containerInfo,Xn=!0;break e}b=b.return}if(Ot===null)throw Error(n(160));uv(m,x,f),Ot=null,Xn=!1;var R=f.alternate;R!==null&&(R.return=null),f.return=null}catch(G){at(f,s,G)}}if(s.subtreeFlags&12854)for(s=s.child;s!==null;)fv(s,r),s=s.sibling}function fv(r,s){var a=r.alternate,u=r.flags;switch(r.tag){case 0:case 11:case 14:case 15:if(Zn(s,r),gr(r),u&4){try{ia(3,r,r.return),cu(3,r)}catch(ve){at(r,r.return,ve)}try{ia(5,r,r.return)}catch(ve){at(r,r.return,ve)}}break;case 1:Zn(s,r),gr(r),u&512&&a!==null&&Ho(a,a.return);break;case 5:if(Zn(s,r),gr(r),u&512&&a!==null&&Ho(a,a.return),r.flags&32){var f=r.stateNode;try{Pi(f,"")}catch(ve){at(r,r.return,ve)}}if(u&4&&(f=r.stateNode,f!=null)){var m=r.memoizedProps,x=a!==null?a.memoizedProps:m,b=r.type,R=r.updateQueue;if(r.updateQueue=null,R!==null)try{b==="input"&&m.type==="radio"&&m.name!=null&&Ci(f,m),_f(b,x);var G=_f(b,m);for(x=0;x<R.length;x+=2){var ie=R[x],ae=R[x+1];ie==="style"?Kg(f,ae):ie==="dangerouslySetInnerHTML"?Wg(f,ae):ie==="children"?Pi(f,ae):L(f,ie,ae,G)}switch(b){case"input":Eo(f,m);break;case"textarea":bi(f,m);break;case"select":var oe=f._wrapperState.wasMultiple;f._wrapperState.wasMultiple=!!m.multiple;var he=m.value;he!=null?Qr(f,!!m.multiple,he,!1):oe!==!!m.multiple&&(m.defaultValue!=null?Qr(f,!!m.multiple,m.defaultValue,!0):Qr(f,!!m.multiple,m.multiple?[]:"",!1))}f[Ji]=m}catch(ve){at(r,r.return,ve)}}break;case 6:if(Zn(s,r),gr(r),u&4){if(r.stateNode===null)throw Error(n(162));f=r.stateNode,m=r.memoizedProps;try{f.nodeValue=m}catch(ve){at(r,r.return,ve)}}break;case 3:if(Zn(s,r),gr(r),u&4&&a!==null&&a.memoizedState.isDehydrated)try{ji(s.containerInfo)}catch(ve){at(r,r.return,ve)}break;case 4:Zn(s,r),gr(r);break;case 13:Zn(s,r),gr(r),f=r.child,f.flags&8192&&(m=f.memoizedState!==null,f.stateNode.isHidden=m,!m||f.alternate!==null&&f.alternate.memoizedState!==null||(Gd=mt())),u&4&&lv(r);break;case 22:if(ie=a!==null&&a.memoizedState!==null,r.mode&1?(qt=(G=qt)||ie,Zn(s,r),qt=G):Zn(s,r),gr(r),u&8192){if(G=r.memoizedState!==null,(r.stateNode.isHidden=G)&&!ie&&(r.mode&1)!==0)for(ge=r,ie=r.child;ie!==null;){for(ae=ge=ie;ge!==null;){switch(oe=ge,he=oe.child,oe.tag){case 0:case 11:case 14:case 15:ia(4,oe,oe.return);break;case 1:Ho(oe,oe.return);var ye=oe.stateNode;if(typeof ye.componentWillUnmount=="function"){u=oe,a=oe.return;try{s=u,ye.props=s.memoizedProps,ye.state=s.memoizedState,ye.componentWillUnmount()}catch(ve){at(u,a,ve)}}break;case 5:Ho(oe,oe.return);break;case 22:if(oe.memoizedState!==null){mv(ae);continue}}he!==null?(he.return=oe,ge=he):mv(ae)}ie=ie.sibling}e:for(ie=null,ae=r;;){if(ae.tag===5){if(ie===null){ie=ae;try{f=ae.stateNode,G?(m=f.style,typeof m.setProperty=="function"?m.setProperty("display","none","important"):m.display="none"):(b=ae.stateNode,R=ae.memoizedProps.style,x=R!=null&&R.hasOwnProperty("display")?R.display:null,b.style.display=Hg("display",x))}catch(ve){at(r,r.return,ve)}}}else if(ae.tag===6){if(ie===null)try{ae.stateNode.nodeValue=G?"":ae.memoizedProps}catch(ve){at(r,r.return,ve)}}else if((ae.tag!==22&&ae.tag!==23||ae.memoizedState===null||ae===r)&&ae.child!==null){ae.child.return=ae,ae=ae.child;continue}if(ae===r)break e;for(;ae.sibling===null;){if(ae.return===null||ae.return===r)break e;ie===ae&&(ie=null),ae=ae.return}ie===ae&&(ie=null),ae.sibling.return=ae.return,ae=ae.sibling}}break;case 19:Zn(s,r),gr(r),u&4&&lv(r);break;case 21:break;default:Zn(s,r),gr(r)}}function gr(r){var s=r.flags;if(s&2){try{e:{for(var a=r.return;a!==null;){if(av(a)){var u=a;break e}a=a.return}throw Error(n(160))}switch(u.tag){case 5:var f=u.stateNode;u.flags&32&&(Pi(f,""),u.flags&=-33);var m=cv(r);Kd(r,m,f);break;case 3:case 4:var x=u.stateNode.containerInfo,b=cv(r);Hd(r,b,x);break;default:throw Error(n(161))}}catch(R){at(r,r.return,R)}r.flags&=-3}s&4096&&(r.flags&=-4097)}function Tb(r,s,a){ge=r,dv(r)}function dv(r,s,a){for(var u=(r.mode&1)!==0;ge!==null;){var f=ge,m=f.child;if(f.tag===22&&u){var x=f.memoizedState!==null||au;if(!x){var b=f.alternate,R=b!==null&&b.memoizedState!==null||qt;b=au;var G=qt;if(au=x,(qt=R)&&!G)for(ge=f;ge!==null;)x=ge,R=x.child,x.tag===22&&x.memoizedState!==null?pv(f):R!==null?(R.return=x,ge=R):pv(f);for(;m!==null;)ge=m,dv(m),m=m.sibling;ge=f,au=b,qt=G}hv(r)}else(f.subtreeFlags&8772)!==0&&m!==null?(m.return=f,ge=m):hv(r)}}function hv(r){for(;ge!==null;){var s=ge;if((s.flags&8772)!==0){var a=s.alternate;try{if((s.flags&8772)!==0)switch(s.tag){case 0:case 11:case 15:qt||cu(5,s);break;case 1:var u=s.stateNode;if(s.flags&4&&!qt)if(a===null)u.componentDidMount();else{var f=s.elementType===s.type?a.memoizedProps:Yn(s.type,a.memoizedProps);u.componentDidUpdate(f,a.memoizedState,u.__reactInternalSnapshotBeforeUpdate)}var m=s.updateQueue;m!==null&&my(s,m,u);break;case 3:var x=s.updateQueue;if(x!==null){if(a=null,s.child!==null)switch(s.child.tag){case 5:a=s.child.stateNode;break;case 1:a=s.child.stateNode}my(s,x,a)}break;case 5:var b=s.stateNode;if(a===null&&s.flags&4){a=b;var R=s.memoizedProps;switch(s.type){case"button":case"input":case"select":case"textarea":R.autoFocus&&a.focus();break;case"img":R.src&&(a.src=R.src)}}break;case 6:break;case 4:break;case 12:break;case 13:if(s.memoizedState===null){var G=s.alternate;if(G!==null){var ie=G.memoizedState;if(ie!==null){var ae=ie.dehydrated;ae!==null&&ji(ae)}}}break;case 19:case 17:case 21:case 22:case 23:case 25:break;default:throw Error(n(163))}qt||s.flags&512&&Wd(s)}catch(oe){at(s,s.return,oe)}}if(s===r){ge=null;break}if(a=s.sibling,a!==null){a.return=s.return,ge=a;break}ge=s.return}}function mv(r){for(;ge!==null;){var s=ge;if(s===r){ge=null;break}var a=s.sibling;if(a!==null){a.return=s.return,ge=a;break}ge=s.return}}function pv(r){for(;ge!==null;){var s=ge;try{switch(s.tag){case 0:case 11:case 15:var a=s.return;try{cu(4,s)}catch(R){at(s,a,R)}break;case 1:var u=s.stateNode;if(typeof u.componentDidMount=="function"){var f=s.return;try{u.componentDidMount()}catch(R){at(s,f,R)}}var m=s.return;try{Wd(s)}catch(R){at(s,m,R)}break;case 5:var x=s.return;try{Wd(s)}catch(R){at(s,x,R)}}}catch(R){at(s,s.return,R)}if(s===r){ge=null;break}var b=s.sibling;if(b!==null){b.return=s.return,ge=b;break}ge=s.return}}var Mb=Math.ceil,uu=C.ReactCurrentDispatcher,Qd=C.ReactCurrentOwner,Dn=C.ReactCurrentBatchConfig,De=0,Ct=null,St=null,Nt=0,Cn=0,Ko=ns(0),wt=0,aa=null,Vs=0,lu=0,Jd=0,ca=null,ln=null,Gd=0,Qo=1/0,Dr=null,fu=!1,Yd=null,cs=null,du=!1,us=null,hu=0,ua=0,Xd=null,mu=-1,pu=0;function Xt(){return(De&6)!==0?mt():mu!==-1?mu:mu=mt()}function ls(r){return(r.mode&1)===0?1:(De&2)!==0&&Nt!==0?Nt&-Nt:pb.transition!==null?(pu===0&&(pu=c0()),pu):(r=ze,r!==0||(r=window.event,r=r===void 0?16:y0(r.type)),r)}function er(r,s,a,u){if(50<ua)throw ua=0,Xd=null,Error(n(185));Ai(r,a,u),((De&2)===0||r!==Ct)&&(r===Ct&&((De&2)===0&&(lu|=a),wt===4&&fs(r,Nt)),fn(r,u),a===1&&De===0&&(s.mode&1)===0&&(Qo=mt()+500,Vc&&ss()))}function fn(r,s){var a=r.callbackNode;pC(r,s);var u=_c(r,r===Ct?Nt:0);if(u===0)a!==null&&o0(a),r.callbackNode=null,r.callbackPriority=0;else if(s=u&-u,r.callbackPriority!==s){if(a!=null&&o0(a),s===1)r.tag===0?mb(yv.bind(null,r)):ny(yv.bind(null,r)),lb(function(){(De&6)===0&&ss()}),a=null;else{switch(u0(u)){case 1:a=Tf;break;case 4:a=i0;break;case 16:a=xc;break;case 536870912:a=a0;break;default:a=xc}a=Cv(a,gv.bind(null,r))}r.callbackPriority=s,r.callbackNode=a}}function gv(r,s){if(mu=-1,pu=0,(De&6)!==0)throw Error(n(327));var a=r.callbackNode;if(Jo()&&r.callbackNode!==a)return null;var u=_c(r,r===Ct?Nt:0);if(u===0)return null;if((u&30)!==0||(u&r.expiredLanes)!==0||s)s=gu(r,u);else{s=u;var f=De;De|=2;var m=Sv();(Ct!==r||Nt!==s)&&(Dr=null,Qo=mt()+500,Ws(r,s));do try{Ob();break}catch(b){vv(r,b)}while(!0);gd(),uu.current=m,De=f,St!==null?s=0:(Ct=null,Nt=0,s=wt)}if(s!==0){if(s===2&&(f=Mf(r),f!==0&&(u=f,s=Zd(r,f))),s===1)throw a=aa,Ws(r,0),fs(r,u),fn(r,mt()),a;if(s===6)fs(r,u);else{if(f=r.current.alternate,(u&30)===0&&!Ab(f)&&(s=gu(r,u),s===2&&(m=Mf(r),m!==0&&(u=m,s=Zd(r,m))),s===1))throw a=aa,Ws(r,0),fs(r,u),fn(r,mt()),a;switch(r.finishedWork=f,r.finishedLanes=u,s){case 0:case 1:throw Error(n(345));case 2:Hs(r,ln,Dr);break;case 3:if(fs(r,u),(u&130023424)===u&&(s=Gd+500-mt(),10<s)){if(_c(r,0)!==0)break;if(f=r.suspendedLanes,(f&u)!==u){Xt(),r.pingedLanes|=r.suspendedLanes&f;break}r.timeoutHandle=od(Hs.bind(null,r,ln,Dr),s);break}Hs(r,ln,Dr);break;case 4:if(fs(r,u),(u&4194240)===u)break;for(s=r.eventTimes,f=-1;0<u;){var x=31-Qn(u);m=1<<x,x=s[x],x>f&&(f=x),u&=~m}if(u=f,u=mt()-u,u=(120>u?120:480>u?480:1080>u?1080:1920>u?1920:3e3>u?3e3:4320>u?4320:1960*Mb(u/1960))-u,10<u){r.timeoutHandle=od(Hs.bind(null,r,ln,Dr),u);break}Hs(r,ln,Dr);break;case 5:Hs(r,ln,Dr);break;default:throw Error(n(329))}}}return fn(r,mt()),r.callbackNode===a?gv.bind(null,r):null}function Zd(r,s){var a=ca;return r.current.memoizedState.isDehydrated&&(Ws(r,s).flags|=256),r=gu(r,s),r!==2&&(s=ln,ln=a,s!==null&&eh(s)),r}function eh(r){ln===null?ln=r:ln.push.apply(ln,r)}function Ab(r){for(var s=r;;){if(s.flags&16384){var a=s.updateQueue;if(a!==null&&(a=a.stores,a!==null))for(var u=0;u<a.length;u++){var f=a[u],m=f.getSnapshot;f=f.value;try{if(!Jn(m(),f))return!1}catch{return!1}}}if(a=s.child,s.subtreeFlags&16384&&a!==null)a.return=s,s=a;else{if(s===r)break;for(;s.sibling===null;){if(s.return===null||s.return===r)return!0;s=s.return}s.sibling.return=s.return,s=s.sibling}}return!0}function fs(r,s){for(s&=~Jd,s&=~lu,r.suspendedLanes|=s,r.pingedLanes&=~s,r=r.expirationTimes;0<s;){var a=31-Qn(s),u=1<<a;r[a]=-1,s&=~u}}function yv(r){if((De&6)!==0)throw Error(n(327));Jo();var s=_c(r,0);if((s&1)===0)return fn(r,mt()),null;var a=gu(r,s);if(r.tag!==0&&a===2){var u=Mf(r);u!==0&&(s=u,a=Zd(r,u))}if(a===1)throw a=aa,Ws(r,0),fs(r,s),fn(r,mt()),a;if(a===6)throw Error(n(345));return r.finishedWork=r.current.alternate,r.finishedLanes=s,Hs(r,ln,Dr),fn(r,mt()),null}function th(r,s){var a=De;De|=1;try{return r(s)}finally{De=a,De===0&&(Qo=mt()+500,Vc&&ss())}}function qs(r){us!==null&&us.tag===0&&(De&6)===0&&Jo();var s=De;De|=1;var a=Dn.transition,u=ze;try{if(Dn.transition=null,ze=1,r)return r()}finally{ze=u,Dn.transition=a,De=s,(De&6)===0&&ss()}}function nh(){Cn=Ko.current,Ze(Ko)}function Ws(r,s){r.finishedWork=null,r.finishedLanes=0;var a=r.timeoutHandle;if(a!==-1&&(r.timeoutHandle=-1,ub(a)),St!==null)for(a=St.return;a!==null;){var u=a;switch(fd(u),u.tag){case 1:u=u.type.childContextTypes,u!=null&&Bc();break;case 3:qo(),Ze(an),Ze(Bt),_d();break;case 5:kd(u);break;case 4:qo();break;case 13:Ze(st);break;case 19:Ze(st);break;case 10:yd(u.type._context);break;case 22:case 23:nh()}a=a.return}if(Ct=r,St=r=ds(r.current,null),Nt=Cn=s,wt=0,aa=null,Jd=lu=Vs=0,ln=ca=null,Us!==null){for(s=0;s<Us.length;s++)if(a=Us[s],u=a.interleaved,u!==null){a.interleaved=null;var f=u.next,m=a.pending;if(m!==null){var x=m.next;m.next=f,u.next=x}a.pending=u}Us=null}return r}function vv(r,s){do{var a=St;try{if(gd(),Zc.current=ru,eu){for(var u=ot.memoizedState;u!==null;){var f=u.queue;f!==null&&(f.pending=null),u=u.next}eu=!1}if(zs=0,_t=xt=ot=null,ta=!1,na=0,Qd.current=null,a===null||a.return===null){wt=1,aa=s,St=null;break}e:{var m=r,x=a.return,b=a,R=s;if(s=Nt,b.flags|=32768,R!==null&&typeof R=="object"&&typeof R.then=="function"){var G=R,ie=b,ae=ie.tag;if((ie.mode&1)===0&&(ae===0||ae===11||ae===15)){var oe=ie.alternate;oe?(ie.updateQueue=oe.updateQueue,ie.memoizedState=oe.memoizedState,ie.lanes=oe.lanes):(ie.updateQueue=null,ie.memoizedState=null)}var he=Vy(x);if(he!==null){he.flags&=-257,qy(he,x,b,m,s),he.mode&1&&zy(m,G,s),s=he,R=G;var ye=s.updateQueue;if(ye===null){var ve=new Set;ve.add(R),s.updateQueue=ve}else ye.add(R);break e}else{if((s&1)===0){zy(m,G,s),rh();break e}R=Error(n(426))}}else if(et&&b.mode&1){var pt=Vy(x);if(pt!==null){(pt.flags&65536)===0&&(pt.flags|=256),qy(pt,x,b,m,s),md(Wo(R,b));break e}}m=R=Wo(R,b),wt!==4&&(wt=2),ca===null?ca=[m]:ca.push(m),m=x;do{switch(m.tag){case 3:m.flags|=65536,s&=-s,m.lanes|=s;var z=Uy(m,R,s);hy(m,z);break e;case 1:b=R;var M=m.type,W=m.stateNode;if((m.flags&128)===0&&(typeof M.getDerivedStateFromError=="function"||W!==null&&typeof W.componentDidCatch=="function"&&(cs===null||!cs.has(W)))){m.flags|=65536,s&=-s,m.lanes|=s;var ce=By(m,b,s);hy(m,ce);break e}}m=m.return}while(m!==null)}wv(a)}catch(Se){s=Se,St===a&&a!==null&&(St=a=a.return);continue}break}while(!0)}function Sv(){var r=uu.current;return uu.current=ru,r===null?ru:r}function rh(){(wt===0||wt===3||wt===2)&&(wt=4),Ct===null||(Vs&268435455)===0&&(lu&268435455)===0||fs(Ct,Nt)}function gu(r,s){var a=De;De|=2;var u=Sv();(Ct!==r||Nt!==s)&&(Dr=null,Ws(r,s));do try{Lb();break}catch(f){vv(r,f)}while(!0);if(gd(),De=a,uu.current=u,St!==null)throw Error(n(261));return Ct=null,Nt=0,wt}function Lb(){for(;St!==null;)xv(St)}function Ob(){for(;St!==null&&!iC();)xv(St)}function xv(r){var s=_v(r.alternate,r,Cn);r.memoizedProps=r.pendingProps,s===null?wv(r):St=s,Qd.current=null}function wv(r){var s=r;do{var a=s.alternate;if(r=s.return,(s.flags&32768)===0){if(a=Pb(a,s,Cn),a!==null){St=a;return}}else{if(a=Fb(a,s),a!==null){a.flags&=32767,St=a;return}if(r!==null)r.flags|=32768,r.subtreeFlags=0,r.deletions=null;else{wt=6,St=null;return}}if(s=s.sibling,s!==null){St=s;return}St=s=r}while(s!==null);wt===0&&(wt=5)}function Hs(r,s,a){var u=ze,f=Dn.transition;try{Dn.transition=null,ze=1,Nb(r,s,a,u)}finally{Dn.transition=f,ze=u}return null}function Nb(r,s,a,u){do Jo();while(us!==null);if((De&6)!==0)throw Error(n(327));a=r.finishedWork;var f=r.finishedLanes;if(a===null)return null;if(r.finishedWork=null,r.finishedLanes=0,a===r.current)throw Error(n(177));r.callbackNode=null,r.callbackPriority=0;var m=a.lanes|a.childLanes;if(gC(r,m),r===Ct&&(St=Ct=null,Nt=0),(a.subtreeFlags&2064)===0&&(a.flags&2064)===0||du||(du=!0,Cv(xc,function(){return Jo(),null})),m=(a.flags&15990)!==0,(a.subtreeFlags&15990)!==0||m){m=Dn.transition,Dn.transition=null;var x=ze;ze=1;var b=De;De|=4,Qd.current=null,Rb(r,a),fv(a,r),nb(rd),Pc=!!nd,rd=nd=null,r.current=a,Tb(a),aC(),De=b,ze=x,Dn.transition=m}else r.current=a;if(du&&(du=!1,us=r,hu=f),m=r.pendingLanes,m===0&&(cs=null),lC(a.stateNode),fn(r,mt()),s!==null)for(u=r.onRecoverableError,a=0;a<s.length;a++)f=s[a],u(f.value,{componentStack:f.stack,digest:f.digest});if(fu)throw fu=!1,r=Yd,Yd=null,r;return(hu&1)!==0&&r.tag!==0&&Jo(),m=r.pendingLanes,(m&1)!==0?r===Xd?ua++:(ua=0,Xd=r):ua=0,ss(),null}function Jo(){if(us!==null){var r=u0(hu),s=Dn.transition,a=ze;try{if(Dn.transition=null,ze=16>r?16:r,us===null)var u=!1;else{if(r=us,us=null,hu=0,(De&6)!==0)throw Error(n(331));var f=De;for(De|=4,ge=r.current;ge!==null;){var m=ge,x=m.child;if((ge.flags&16)!==0){var b=m.deletions;if(b!==null){for(var R=0;R<b.length;R++){var G=b[R];for(ge=G;ge!==null;){var ie=ge;switch(ie.tag){case 0:case 11:case 15:ia(8,ie,m)}var ae=ie.child;if(ae!==null)ae.return=ie,ge=ae;else for(;ge!==null;){ie=ge;var oe=ie.sibling,he=ie.return;if(iv(ie),ie===G){ge=null;break}if(oe!==null){oe.return=he,ge=oe;break}ge=he}}}var ye=m.alternate;if(ye!==null){var ve=ye.child;if(ve!==null){ye.child=null;do{var pt=ve.sibling;ve.sibling=null,ve=pt}while(ve!==null)}}ge=m}}if((m.subtreeFlags&2064)!==0&&x!==null)x.return=m,ge=x;else e:for(;ge!==null;){if(m=ge,(m.flags&2048)!==0)switch(m.tag){case 0:case 11:case 15:ia(9,m,m.return)}var z=m.sibling;if(z!==null){z.return=m.return,ge=z;break e}ge=m.return}}var M=r.current;for(ge=M;ge!==null;){x=ge;var W=x.child;if((x.subtreeFlags&2064)!==0&&W!==null)W.return=x,ge=W;else e:for(x=M;ge!==null;){if(b=ge,(b.flags&2048)!==0)try{switch(b.tag){case 0:case 11:case 15:cu(9,b)}}catch(Se){at(b,b.return,Se)}if(b===x){ge=null;break e}var ce=b.sibling;if(ce!==null){ce.return=b.return,ge=ce;break e}ge=b.return}}if(De=f,ss(),dr&&typeof dr.onPostCommitFiberRoot=="function")try{dr.onPostCommitFiberRoot(wc,r)}catch{}u=!0}return u}finally{ze=a,Dn.transition=s}}return!1}function kv(r,s,a){s=Wo(a,s),s=Uy(r,s,1),r=is(r,s,1),s=Xt(),r!==null&&(Ai(r,1,s),fn(r,s))}function at(r,s,a){if(r.tag===3)kv(r,r,a);else for(;s!==null;){if(s.tag===3){kv(s,r,a);break}else if(s.tag===1){var u=s.stateNode;if(typeof s.type.getDerivedStateFromError=="function"||typeof u.componentDidCatch=="function"&&(cs===null||!cs.has(u))){r=Wo(a,r),r=By(s,r,1),s=is(s,r,1),r=Xt(),s!==null&&(Ai(s,1,r),fn(s,r));break}}s=s.return}}function Db(r,s,a){var u=r.pingCache;u!==null&&u.delete(s),s=Xt(),r.pingedLanes|=r.suspendedLanes&a,Ct===r&&(Nt&a)===a&&(wt===4||wt===3&&(Nt&130023424)===Nt&&500>mt()-Gd?Ws(r,0):Jd|=a),fn(r,s)}function Ev(r,s){s===0&&((r.mode&1)===0?s=1:(s=Ec,Ec<<=1,(Ec&130023424)===0&&(Ec=4194304)));var a=Xt();r=Lr(r,s),r!==null&&(Ai(r,s,a),fn(r,a))}function jb(r){var s=r.memoizedState,a=0;s!==null&&(a=s.retryLane),Ev(r,a)}function $b(r,s){var a=0;switch(r.tag){case 13:var u=r.stateNode,f=r.memoizedState;f!==null&&(a=f.retryLane);break;case 19:u=r.stateNode;break;default:throw Error(n(314))}u!==null&&u.delete(s),Ev(r,a)}var _v;_v=function(r,s,a){if(r!==null)if(r.memoizedProps!==s.pendingProps||an.current)un=!0;else{if((r.lanes&a)===0&&(s.flags&128)===0)return un=!1,bb(r,s,a);un=(r.flags&131072)!==0}else un=!1,et&&(s.flags&1048576)!==0&&ry(s,Wc,s.index);switch(s.lanes=0,s.tag){case 2:var u=s.type;iu(r,s),r=s.pendingProps;var f=Do(s,Bt.current);Vo(s,a),f=Pd(null,s,u,r,f,a);var m=Fd();return s.flags|=1,typeof f=="object"&&f!==null&&typeof f.render=="function"&&f.$$typeof===void 0?(s.tag=1,s.memoizedState=null,s.updateQueue=null,cn(u)?(m=!0,zc(s)):m=!1,s.memoizedState=f.state!==null&&f.state!==void 0?f.state:null,xd(s),f.updater=su,s.stateNode=f,f._reactInternals=s,Ld(s,u,r,a),s=jd(null,s,u,!0,m,a)):(s.tag=0,et&&m&&ld(s),Yt(null,s,f,a),s=s.child),s;case 16:u=s.elementType;e:{switch(iu(r,s),r=s.pendingProps,f=u._init,u=f(u._payload),s.type=u,f=s.tag=Bb(u),r=Yn(u,r),f){case 0:s=Dd(null,s,u,r,a);break e;case 1:s=Gy(null,s,u,r,a);break e;case 11:s=Wy(null,s,u,r,a);break e;case 14:s=Hy(null,s,u,Yn(u.type,r),a);break e}throw Error(n(306,u,""))}return s;case 0:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Yn(u,f),Dd(r,s,u,f,a);case 1:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Yn(u,f),Gy(r,s,u,f,a);case 3:e:{if(Yy(s),r===null)throw Error(n(387));u=s.pendingProps,m=s.memoizedState,f=m.element,dy(r,s),Yc(s,u,null,a);var x=s.memoizedState;if(u=x.element,m.isDehydrated)if(m={element:u,isDehydrated:!1,cache:x.cache,pendingSuspenseBoundaries:x.pendingSuspenseBoundaries,transitions:x.transitions},s.updateQueue.baseState=m,s.memoizedState=m,s.flags&256){f=Wo(Error(n(423)),s),s=Xy(r,s,u,a,f);break e}else if(u!==f){f=Wo(Error(n(424)),s),s=Xy(r,s,u,a,f);break e}else for(_n=ts(s.stateNode.containerInfo.firstChild),En=s,et=!0,Gn=null,a=ly(s,null,u,a),s.child=a;a;)a.flags=a.flags&-3|4096,a=a.sibling;else{if(Uo(),u===f){s=Nr(r,s,a);break e}Yt(r,s,u,a)}s=s.child}return s;case 5:return py(s),r===null&&hd(s),u=s.type,f=s.pendingProps,m=r!==null?r.memoizedProps:null,x=f.children,sd(u,f)?x=null:m!==null&&sd(u,m)&&(s.flags|=32),Jy(r,s),Yt(r,s,x,a),s.child;case 6:return r===null&&hd(s),null;case 13:return Zy(r,s,a);case 4:return wd(s,s.stateNode.containerInfo),u=s.pendingProps,r===null?s.child=Bo(s,null,u,a):Yt(r,s,u,a),s.child;case 11:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Yn(u,f),Wy(r,s,u,f,a);case 7:return Yt(r,s,s.pendingProps,a),s.child;case 8:return Yt(r,s,s.pendingProps.children,a),s.child;case 12:return Yt(r,s,s.pendingProps.children,a),s.child;case 10:e:{if(u=s.type._context,f=s.pendingProps,m=s.memoizedProps,x=f.value,Qe(Qc,u._currentValue),u._currentValue=x,m!==null)if(Jn(m.value,x)){if(m.children===f.children&&!an.current){s=Nr(r,s,a);break e}}else for(m=s.child,m!==null&&(m.return=s);m!==null;){var b=m.dependencies;if(b!==null){x=m.child;for(var R=b.firstContext;R!==null;){if(R.context===u){if(m.tag===1){R=Or(-1,a&-a),R.tag=2;var G=m.updateQueue;if(G!==null){G=G.shared;var ie=G.pending;ie===null?R.next=R:(R.next=ie.next,ie.next=R),G.pending=R}}m.lanes|=a,R=m.alternate,R!==null&&(R.lanes|=a),vd(m.return,a,s),b.lanes|=a;break}R=R.next}}else if(m.tag===10)x=m.type===s.type?null:m.child;else if(m.tag===18){if(x=m.return,x===null)throw Error(n(341));x.lanes|=a,b=x.alternate,b!==null&&(b.lanes|=a),vd(x,a,s),x=m.sibling}else x=m.child;if(x!==null)x.return=m;else for(x=m;x!==null;){if(x===s){x=null;break}if(m=x.sibling,m!==null){m.return=x.return,x=m;break}x=x.return}m=x}Yt(r,s,f.children,a),s=s.child}return s;case 9:return f=s.type,u=s.pendingProps.children,Vo(s,a),f=On(f),u=u(f),s.flags|=1,Yt(r,s,u,a),s.child;case 14:return u=s.type,f=Yn(u,s.pendingProps),f=Yn(u.type,f),Hy(r,s,u,f,a);case 15:return Ky(r,s,s.type,s.pendingProps,a);case 17:return u=s.type,f=s.pendingProps,f=s.elementType===u?f:Yn(u,f),iu(r,s),s.tag=1,cn(u)?(r=!0,zc(s)):r=!1,Vo(s,a),jy(s,u,f),Ld(s,u,f,a),jd(null,s,u,!0,r,a);case 19:return tv(r,s,a);case 22:return Qy(r,s,a)}throw Error(n(156,s.tag))};function Cv(r,s){return s0(r,s)}function Ub(r,s,a,u){this.tag=r,this.key=a,this.sibling=this.child=this.return=this.stateNode=this.type=this.elementType=null,this.index=0,this.ref=null,this.pendingProps=s,this.dependencies=this.memoizedState=this.updateQueue=this.memoizedProps=null,this.mode=u,this.subtreeFlags=this.flags=0,this.deletions=null,this.childLanes=this.lanes=0,this.alternate=null}function jn(r,s,a,u){return new Ub(r,s,a,u)}function sh(r){return r=r.prototype,!(!r||!r.isReactComponent)}function Bb(r){if(typeof r=="function")return sh(r)?1:0;if(r!=null){if(r=r.$$typeof,r===H)return 11;if(r===V)return 14}return 2}function ds(r,s){var a=r.alternate;return a===null?(a=jn(r.tag,s,r.key,r.mode),a.elementType=r.elementType,a.type=r.type,a.stateNode=r.stateNode,a.alternate=r,r.alternate=a):(a.pendingProps=s,a.type=r.type,a.flags=0,a.subtreeFlags=0,a.deletions=null),a.flags=r.flags&14680064,a.childLanes=r.childLanes,a.lanes=r.lanes,a.child=r.child,a.memoizedProps=r.memoizedProps,a.memoizedState=r.memoizedState,a.updateQueue=r.updateQueue,s=r.dependencies,a.dependencies=s===null?null:{lanes:s.lanes,firstContext:s.firstContext},a.sibling=r.sibling,a.index=r.index,a.ref=r.ref,a}function yu(r,s,a,u,f,m){var x=2;if(u=r,typeof r=="function")sh(r)&&(x=1);else if(typeof r=="string")x=5;else e:switch(r){case N:return Ks(a.children,f,m,s);case T:x=8,f|=8;break;case q:return r=jn(12,a,s,f|2),r.elementType=q,r.lanes=m,r;case k:return r=jn(13,a,s,f),r.elementType=k,r.lanes=m,r;case U:return r=jn(19,a,s,f),r.elementType=U,r.lanes=m,r;case B:return vu(a,f,m,s);default:if(typeof r=="object"&&r!==null)switch(r.$$typeof){case ee:x=10;break e;case ne:x=9;break e;case H:x=11;break e;case V:x=14;break e;case J:x=16,u=null;break e}throw Error(n(130,r==null?r:typeof r,""))}return s=jn(x,a,s,f),s.elementType=r,s.type=u,s.lanes=m,s}function Ks(r,s,a,u){return r=jn(7,r,u,s),r.lanes=a,r}function vu(r,s,a,u){return r=jn(22,r,u,s),r.elementType=B,r.lanes=a,r.stateNode={isHidden:!1},r}function oh(r,s,a){return r=jn(6,r,null,s),r.lanes=a,r}function ih(r,s,a){return s=jn(4,r.children!==null?r.children:[],r.key,s),s.lanes=a,s.stateNode={containerInfo:r.containerInfo,pendingChildren:null,implementation:r.implementation},s}function zb(r,s,a,u,f){this.tag=s,this.containerInfo=r,this.finishedWork=this.pingCache=this.current=this.pendingChildren=null,this.timeoutHandle=-1,this.callbackNode=this.pendingContext=this.context=null,this.callbackPriority=0,this.eventTimes=Af(0),this.expirationTimes=Af(-1),this.entangledLanes=this.finishedLanes=this.mutableReadLanes=this.expiredLanes=this.pingedLanes=this.suspendedLanes=this.pendingLanes=0,this.entanglements=Af(0),this.identifierPrefix=u,this.onRecoverableError=f,this.mutableSourceEagerHydrationData=null}function ah(r,s,a,u,f,m,x,b,R){return r=new zb(r,s,a,b,R),s===1?(s=1,m===!0&&(s|=8)):s=0,m=jn(3,null,null,s),r.current=m,m.stateNode=r,m.memoizedState={element:u,isDehydrated:a,cache:null,transitions:null,pendingSuspenseBoundaries:null},xd(m),r}function Vb(r,s,a){var u=3<arguments.length&&arguments[3]!==void 0?arguments[3]:null;return{$$typeof:$,key:u==null?null:""+u,children:r,containerInfo:s,implementation:a}}function bv(r){if(!r)return rs;r=r._reactInternals;e:{if(Os(r)!==r||r.tag!==1)throw Error(n(170));var s=r;do{switch(s.tag){case 3:s=s.stateNode.context;break e;case 1:if(cn(s.type)){s=s.stateNode.__reactInternalMemoizedMergedChildContext;break e}}s=s.return}while(s!==null);throw Error(n(171))}if(r.tag===1){var a=r.type;if(cn(a))return ey(r,a,s)}return s}function Pv(r,s,a,u,f,m,x,b,R){return r=ah(a,u,!0,r,f,m,x,b,R),r.context=bv(null),a=r.current,u=Xt(),f=ls(a),m=Or(u,f),m.callback=s??null,is(a,m,f),r.current.lanes=f,Ai(r,f,u),fn(r,u),r}function Su(r,s,a,u){var f=s.current,m=Xt(),x=ls(f);return a=bv(a),s.context===null?s.context=a:s.pendingContext=a,s=Or(m,x),s.payload={element:r},u=u===void 0?null:u,u!==null&&(s.callback=u),r=is(f,s,x),r!==null&&(er(r,f,x,m),Gc(r,f,x)),x}function xu(r){if(r=r.current,!r.child)return null;switch(r.child.tag){case 5:return r.child.stateNode;default:return r.child.stateNode}}function Fv(r,s){if(r=r.memoizedState,r!==null&&r.dehydrated!==null){var a=r.retryLane;r.retryLane=a!==0&&a<s?a:s}}function ch(r,s){Fv(r,s),(r=r.alternate)&&Fv(r,s)}function qb(){return null}var Iv=typeof reportError=="function"?reportError:function(r){console.error(r)};function uh(r){this._internalRoot=r}wu.prototype.render=uh.prototype.render=function(r){var s=this._internalRoot;if(s===null)throw Error(n(409));Su(r,s,null,null)},wu.prototype.unmount=uh.prototype.unmount=function(){var r=this._internalRoot;if(r!==null){this._internalRoot=null;var s=r.containerInfo;qs(function(){Su(null,r,null,null)}),s[Rr]=null}};function wu(r){this._internalRoot=r}wu.prototype.unstable_scheduleHydration=function(r){if(r){var s=d0();r={blockedOn:null,target:r,priority:s};for(var a=0;a<Xr.length&&s!==0&&s<Xr[a].priority;a++);Xr.splice(a,0,r),a===0&&p0(r)}};function lh(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11)}function ku(r){return!(!r||r.nodeType!==1&&r.nodeType!==9&&r.nodeType!==11&&(r.nodeType!==8||r.nodeValue!==" react-mount-point-unstable "))}function Rv(){}function Wb(r,s,a,u,f){if(f){if(typeof u=="function"){var m=u;u=function(){var G=xu(x);m.call(G)}}var x=Pv(s,u,r,0,null,!1,!1,"",Rv);return r._reactRootContainer=x,r[Rr]=x.current,Ki(r.nodeType===8?r.parentNode:r),qs(),x}for(;f=r.lastChild;)r.removeChild(f);if(typeof u=="function"){var b=u;u=function(){var G=xu(R);b.call(G)}}var R=ah(r,0,!1,null,null,!1,!1,"",Rv);return r._reactRootContainer=R,r[Rr]=R.current,Ki(r.nodeType===8?r.parentNode:r),qs(function(){Su(s,R,a,u)}),R}function Eu(r,s,a,u,f){var m=a._reactRootContainer;if(m){var x=m;if(typeof f=="function"){var b=f;f=function(){var R=xu(x);b.call(R)}}Su(s,x,r,f)}else x=Wb(a,s,r,f,u);return xu(x)}l0=function(r){switch(r.tag){case 3:var s=r.stateNode;if(s.current.memoizedState.isDehydrated){var a=Mi(s.pendingLanes);a!==0&&(Lf(s,a|1),fn(s,mt()),(De&6)===0&&(Qo=mt()+500,ss()))}break;case 13:qs(function(){var u=Lr(r,1);if(u!==null){var f=Xt();er(u,r,1,f)}}),ch(r,1)}},Of=function(r){if(r.tag===13){var s=Lr(r,134217728);if(s!==null){var a=Xt();er(s,r,134217728,a)}ch(r,134217728)}},f0=function(r){if(r.tag===13){var s=ls(r),a=Lr(r,s);if(a!==null){var u=Xt();er(a,r,s,u)}ch(r,s)}},d0=function(){return ze},h0=function(r,s){var a=ze;try{return ze=r,s()}finally{ze=a}},Pf=function(r,s,a){switch(s){case"input":if(Eo(r,a),s=a.name,a.type==="radio"&&s!=null){for(a=r;a.parentNode;)a=a.parentNode;for(a=a.querySelectorAll("input[name="+JSON.stringify(""+s)+'][type="radio"]'),s=0;s<a.length;s++){var u=a[s];if(u!==r&&u.form===r.form){var f=Uc(u);if(!f)throw Error(n(90));xn(u),Eo(u,f)}}}break;case"textarea":bi(r,a);break;case"select":s=a.value,s!=null&&Qr(r,!!a.multiple,s,!1)}},Yg=th,Xg=qs;var Hb={usingClientEntryPoint:!1,Events:[Gi,Oo,Uc,Jg,Gg,th]},la={findFiberByHostInstance:Ns,bundleType:0,version:"18.3.1",rendererPackageName:"react-dom"},Kb={bundleType:la.bundleType,version:la.version,rendererPackageName:la.rendererPackageName,rendererConfig:la.rendererConfig,overrideHookState:null,overrideHookStateDeletePath:null,overrideHookStateRenamePath:null,overrideProps:null,overridePropsDeletePath:null,overridePropsRenamePath:null,setErrorHandler:null,setSuspenseHandler:null,scheduleUpdate:null,currentDispatcherRef:C.ReactCurrentDispatcher,findHostInstanceByFiber:function(r){return r=n0(r),r===null?null:r.stateNode},findFiberByHostInstance:la.findFiberByHostInstance||qb,findHostInstancesForRefresh:null,scheduleRefresh:null,scheduleRoot:null,setRefreshHandler:null,getCurrentFiber:null,reconcilerVersion:"18.3.1-next-f1338f8080-20240426"};if(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__<"u"){var _u=__REACT_DEVTOOLS_GLOBAL_HOOK__;if(!_u.isDisabled&&_u.supportsFiber)try{wc=_u.inject(Kb),dr=_u}catch{}}return dn.__SECRET_INTERNALS_DO_NOT_USE_OR_YOU_WILL_BE_FIRED=Hb,dn.createPortal=function(r,s){var a=2<arguments.length&&arguments[2]!==void 0?arguments[2]:null;if(!lh(s))throw Error(n(200));return Vb(r,s,null,a)},dn.createRoot=function(r,s){if(!lh(r))throw Error(n(299));var a=!1,u="",f=Iv;return s!=null&&(s.unstable_strictMode===!0&&(a=!0),s.identifierPrefix!==void 0&&(u=s.identifierPrefix),s.onRecoverableError!==void 0&&(f=s.onRecoverableError)),s=ah(r,1,!1,null,null,a,!1,u,f),r[Rr]=s.current,Ki(r.nodeType===8?r.parentNode:r),new uh(s)},dn.findDOMNode=function(r){if(r==null)return null;if(r.nodeType===1)return r;var s=r._reactInternals;if(s===void 0)throw typeof r.render=="function"?Error(n(188)):(r=Object.keys(r).join(","),Error(n(268,r)));return r=n0(s),r=r===null?null:r.stateNode,r},dn.flushSync=function(r){return qs(r)},dn.hydrate=function(r,s,a){if(!ku(s))throw Error(n(200));return Eu(null,r,s,!0,a)},dn.hydrateRoot=function(r,s,a){if(!lh(r))throw Error(n(405));var u=a!=null&&a.hydratedSources||null,f=!1,m="",x=Iv;if(a!=null&&(a.unstable_strictMode===!0&&(f=!0),a.identifierPrefix!==void 0&&(m=a.identifierPrefix),a.onRecoverableError!==void 0&&(x=a.onRecoverableError)),s=Pv(s,null,r,1,a??null,f,!1,m,x),r[Rr]=s.current,Ki(r),u)for(r=0;r<u.length;r++)a=u[r],f=a._getVersion,f=f(a._source),s.mutableSourceEagerHydrationData==null?s.mutableSourceEagerHydrationData=[a,f]:s.mutableSourceEagerHydrationData.push(a,f);return new wu(s)},dn.render=function(r,s,a){if(!ku(s))throw Error(n(200));return Eu(null,r,s,!1,a)},dn.unmountComponentAtNode=function(r){if(!ku(r))throw Error(n(40));return r._reactRootContainer?(qs(function(){Eu(null,null,r,!1,function(){r._reactRootContainer=null,r[Rr]=null})}),!0):!1},dn.unstable_batchedUpdates=th,dn.unstable_renderSubtreeIntoContainer=function(r,s,a,u){if(!ku(a))throw Error(n(200));if(r==null||r._reactInternals===void 0)throw Error(n(38));return Eu(r,s,a,!1,u)},dn.version="18.3.1-next-f1338f8080-20240426",dn}var jv;function kw(){if(jv)return hh.exports;jv=1;function e(){if(!(typeof __REACT_DEVTOOLS_GLOBAL_HOOK__>"u"||typeof __REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE!="function"))try{__REACT_DEVTOOLS_GLOBAL_HOOK__.checkDCE(e)}catch(t){console.error(t)}}return e(),hh.exports=r2(),hh.exports}var $v;function s2(){if($v)return Cu;$v=1;var e=kw();return Cu.createRoot=e.createRoot,Cu.hydrateRoot=e.hydrateRoot,Cu}var o2=s2(),i2={};const dp=u2();function nt(e,...t){if(!dp)return;const n=c2(e,...t);performance.mark(n);try{console.log(e,...t)}catch{console.log(n)}}function a2(e,...t){dp&&console.warn(e,...t)}function c2(e,...t){return e.replace(/%[sfdO]/g,n=>{const o=t.shift();return n==="%O"&&o?JSON.stringify(o).replace(/"([^"]+)":/g,"$1:"):String(o)})}function u2(){if(typeof window>"u")return(i2.DEBUG||"").includes("nuqs");try{const e="nuqs-localStorage-test";if(typeof localStorage>"u")return!1;localStorage.setItem(e,e);const t=localStorage.getItem(e)===e;return localStorage.removeItem(e),t&&(localStorage.getItem("debug")||"").includes("nuqs")}catch{return!1}}const l2={303:"Multiple adapter contexts detected. This might happen in monorepos.",404:"nuqs requires an adapter to work with your framework.",409:"Multiple versions of the library are loaded. This may lead to unexpected behavior. Currently using `%s`, but `%s` (via the %s adapter) was about to load on top.",414:"Max safe URL length exceeded. Some browsers may not be able to accept this URL. Consider limiting the amount of state stored in the URL.",422:"Invalid options combination: `limitUrlUpdates: debounce` should be used in SSR scenarios, with `shallow: false`",429:"URL update rate-limited by the browser. Consider increasing `throttleMs` for key(s) `%s`. %O",500:"Empty search params cache. Search params can't be accessed in Layouts.",501:"Search params cache already populated. Have you called `parse` twice?"};function Ga(e){return`[nuqs] ${l2[e]}
|
|
42
|
+
See https://nuqs.dev/NUQS-${e}`}function f2(e){if(e.size===0)return"";const t=[];for(const[o,i]of e.entries()){const c=o.replace(/#/g,"%23").replace(/&/g,"%26").replace(/\+/g,"%2B").replace(/=/g,"%3D").replace(/\?/g,"%3F");t.push(`${c}=${d2(i)}`)}return"?"+t.join("&")}function d2(e){return e.replace(/%/g,"%25").replace(/\+/g,"%2B").replace(/ /g,"+").replace(/#/g,"%23").replace(/&/g,"%26").replace(/"/g,"%22").replace(/'/g,"%27").replace(/`/g,"%60").replace(/</g,"%3C").replace(/>/g,"%3E").replace(/[\x00-\x1F]/g,t=>encodeURIComponent(t))}const uo=Y.createContext({useAdapter(){throw new Error(Ga(404))}});uo.displayName="NuqsAdapterContext";dp&&typeof window<"u"&&(window.__NuqsAdapterContext&&window.__NuqsAdapterContext!==uo&&console.error(Ga(303)),window.__NuqsAdapterContext=uo);function h2(e){return({children:t,defaultOptions:n,processUrlSearchParams:o,...i})=>Y.createElement(uo.Provider,{...i,value:{useAdapter:e,defaultOptions:n,processUrlSearchParams:o}},t)}function m2(e){const t=Y.useContext(uo);if(!("useAdapter"in t))throw new Error(Ga(404));return t.useAdapter(e)}const p2=()=>Y.useContext(uo).defaultOptions,g2=()=>Y.useContext(uo).processUrlSearchParams;function y2(){var e;if(typeof window>"u"||!window.GestureEvent)return 50;try{const t=(e=navigator.userAgent)==null?void 0:e.match(/version\/([\d\.]+) safari/i);return parseFloat(t[1])>=17?120:320}catch{return 320}}function v2(e){return{method:"throttle",timeMs:e}}const _a=v2(y2());function S2(e){return e===null||Array.isArray(e)&&e.length===0}function x2(e,t,n){if(typeof e=="string")n.set(t,e);else{n.delete(t);for(const o of e)n.append(t,o);n.has(t)||n.set(t,"")}return n}function hp(){const e=new Map;return{on(t,n){const o=e.get(t)||[];return o.push(n),e.set(t,o),()=>this.off(t,n)},off(t,n){const o=e.get(t);o&&e.set(t,o.filter(i=>i!==n))},emit(t,n){var o;(o=e.get(t))==null||o.forEach(i=>i(n))}}}function im(e,t,n){function o(){e(),n.removeEventListener("abort",c)}const i=setTimeout(o,t);function c(){clearTimeout(i),n.removeEventListener("abort",c)}n.addEventListener("abort",c)}function am(){const e=Promise;if(Promise.hasOwnProperty("withResolvers"))return Promise.withResolvers();let t=()=>{},n=()=>{};return{promise:new e((o,i)=>{t=o,n=i}),resolve:t,reject:n}}function w2(e,t){let n=t;for(let o=e.length-1;o>=0;o--){const i=e[o];if(!i)continue;const c=n;n=()=>i(c)}n()}function cm(){return new URLSearchParams(location.search)}var Ew=class{constructor(){A(this,"updateMap",new Map);A(this,"options",{history:"replace",scroll:!1,shallow:!0});A(this,"timeMs",_a.timeMs);A(this,"transitions",new Set);A(this,"resolvers",null);A(this,"controller",null);A(this,"lastFlushedAt",0);A(this,"resetQueueOnNextPush",!1)}push({key:e,query:t,options:n},o=_a.timeMs){this.resetQueueOnNextPush&&(this.reset(),this.resetQueueOnNextPush=!1),nt("[nuqs gtq] Enqueueing %s=%s %O",e,t,n),this.updateMap.set(e,t),n.history==="push"&&(this.options.history="push"),n.scroll&&(this.options.scroll=!0),n.shallow===!1&&(this.options.shallow=!1),n.startTransition&&this.transitions.add(n.startTransition),(!Number.isFinite(this.timeMs)||o>this.timeMs)&&(this.timeMs=o)}getQueuedQuery(e){return this.updateMap.get(e)}getPendingPromise({getSearchParamsSnapshot:e=cm}){var t;return((t=this.resolvers)==null?void 0:t.promise)??Promise.resolve(e())}flush({getSearchParamsSnapshot:e=cm,rateLimitFactor:t=1,...n},o){if(this.controller??(this.controller=new AbortController),!Number.isFinite(this.timeMs))return nt("[nuqs gtq] Skipping flush due to throttleMs=Infinity"),Promise.resolve(e());if(this.resolvers)return this.resolvers.promise;this.resolvers=am();const i=()=>{this.lastFlushedAt=performance.now();const[l,d]=this.applyPendingUpdates({...n,autoResetQueueOnUpdate:n.autoResetQueueOnUpdate??!0,getSearchParamsSnapshot:e},o);d===null?(this.resolvers.resolve(l),this.resetQueueOnNextPush=!0):this.resolvers.reject(l),this.resolvers=null};return im(()=>{const l=performance.now()-this.lastFlushedAt,d=this.timeMs,h=t*Math.max(0,d-l);nt("[nuqs gtq] Scheduling flush in %f ms. Throttled at %f ms (x%f)",h,d,t),h===0?i():im(i,h,this.controller.signal)},0,this.controller.signal),this.resolvers.promise}abort(){var e,t;return(e=this.controller)==null||e.abort(),this.controller=new AbortController,(t=this.resolvers)==null||t.resolve(new URLSearchParams),this.resolvers=null,this.reset()}reset(){const e=Array.from(this.updateMap.keys());return nt("[nuqs gtq] Resetting queue %s",JSON.stringify(Object.fromEntries(this.updateMap))),this.updateMap.clear(),this.transitions.clear(),this.options={history:"replace",scroll:!1,shallow:!0},this.timeMs=_a.timeMs,e}applyPendingUpdates(e,t){const{updateUrl:n,getSearchParamsSnapshot:o}=e;let i=o();if(nt("[nuqs gtq] Applying %d pending update(s) on top of %s",this.updateMap.size,i.toString()),this.updateMap.size===0)return[i,null];const c=Array.from(this.updateMap.entries()),l={...this.options},d=Array.from(this.transitions);e.autoResetQueueOnUpdate&&this.reset(),nt("[nuqs gtq] Flushing queue %O with options %O",c,l);for(const[h,p]of c)p===null?i.delete(h):i=x2(p,h,i);t&&(i=t(i));try{return w2(d,()=>{n(i,l)}),[i,null]}catch(h){return console.error(Ga(429),c.map(([p])=>p).join(),h),[i,h]}}};const ju=new Ew;function k2(e,t,n){const o=Y.useCallback(()=>{const c=Object.fromEntries(e.map(l=>[l,n(l)]));return[JSON.stringify(c),c]},[e.join(","),n]),i=Y.useRef(null);return i.current===null&&(i.current=o()),Y.useSyncExternalStore(Y.useCallback(c=>{const l=e.map(d=>t(d,c));return()=>l.forEach(d=>d())},[e.join(","),t]),()=>{const[c,l]=o();return i.current[0]===c?i.current[1]:(i.current=[c,l],l)},()=>i.current[1])}var E2=class{constructor(e){A(this,"callback");A(this,"resolvers",am());A(this,"controller",new AbortController);A(this,"queuedValue");this.callback=e}abort(){this.controller.abort(),this.queuedValue=void 0}push(e,t){return this.queuedValue=e,this.controller.abort(),this.controller=new AbortController,im(()=>{const n=this.resolvers;try{nt("[nuqs dq] Flushing debounce queue",e);const o=this.callback(e);nt("[nuqs dq] Reset debounce queue %O",this.queuedValue),this.queuedValue=void 0,this.resolvers=am(),o.then(i=>n.resolve(i)).catch(i=>n.reject(i))}catch(o){this.queuedValue=void 0,n.reject(o)}},t,this.controller.signal),this.resolvers.promise}},_2=class{constructor(e=new Ew){A(this,"throttleQueue");A(this,"queues",new Map);A(this,"queuedQuerySync",hp());this.throttleQueue=e}useQueuedQueries(e){return k2(e,(t,n)=>this.queuedQuerySync.on(t,n),t=>this.getQueuedQuery(t))}push(e,t,n,o){if(!Number.isFinite(t)){const l=n.getSearchParamsSnapshot??cm;return Promise.resolve(l())}const i=e.key;if(!this.queues.has(i)){nt("[nuqs dqc] Creating debounce queue for `%s`",i);const l=new E2(d=>(this.throttleQueue.push(d),this.throttleQueue.flush(n,o).finally(()=>{var h;((h=this.queues.get(d.key))==null?void 0:h.queuedValue)===void 0&&(nt("[nuqs dqc] Cleaning up empty queue for `%s`",d.key),this.queues.delete(d.key)),this.queuedQuerySync.emit(d.key)})));this.queues.set(i,l)}nt("[nuqs dqc] Enqueueing debounce update %O",e);const c=this.queues.get(i).push(e,t);return this.queuedQuerySync.emit(i),c}abort(e){var n;const t=this.queues.get(e);return t?(nt("[nuqs dqc] Aborting debounce queue %s=%s",e,(n=t.queuedValue)==null?void 0:n.query),this.queues.delete(e),t.abort(),this.queuedQuerySync.emit(e),o=>(o.then(t.resolvers.resolve,t.resolvers.reject),o)):o=>o}abortAll(){var e;for(const[t,n]of this.queues.entries())nt("[nuqs dqc] Aborting debounce queue %s=%s",t,(e=n.queuedValue)==null?void 0:e.query),n.abort(),n.resolvers.resolve(new URLSearchParams),this.queuedQuerySync.emit(t);this.queues.clear()}getQueuedQuery(e){var n,o;const t=(o=(n=this.queues.get(e))==null?void 0:n.queuedValue)==null?void 0:o.query;return t!==void 0?t:this.throttleQueue.getQueuedQuery(e)}};const gh=new _2(ju);function _w(e,t){return e===t?!0:e===null||t===null||typeof e=="string"||typeof t=="string"||e.length!==t.length?!1:e.every((n,o)=>n===t[o])}function Uv(e,t,n){return o=>{if(!(t.length===0||t.some(c=>!_w(o.getAll(c),e.getAll(c)))))return nt("[nuqs `%s`] no change, returning previous",t.join(","),o),o;const i=Cw(e,t,n);return nt("[nuqs `%s`] subbed search params change\n from %O\n to %O",t.join(","),o,i),i}}function Cw(e,t,n){if(t.length===0)return e;const o=n?new URLSearchParams(e):e;for(const i of e.keys())t.includes(i)||o.delete(i);return o}const C2="__nuqs__",um=hp();function b2(e){return function(n,o){const i=new URL(location.href);i.search=f2(n),nt("[nuqs react] Updating url: %s",i),e&&o.shallow===!1?(o.history==="push"?location.assign:location.replace).call(location,i):(o.history==="push"?history.pushState:history.replaceState).call(history,history.state,C2,i),um.emit("update",n),o.scroll===!0&&window.scrollTo({top:0})}}const bw=Y.createContext({fullPageNavigationOnShallowFalseUpdates:!1});function P2(e){const{fullPageNavigationOnShallowFalseUpdates:t}=Y.useContext(bw),[n,o]=Y.useState(()=>typeof location>"u"?new URLSearchParams:Cw(new URLSearchParams(location.search),e,!1));return Y.useEffect(()=>{const i=()=>{o(Uv(new URLSearchParams(location.search),e,!1))},c=l=>{o(Uv(l,e,!0))};return um.on("update",c),window.addEventListener("popstate",i),()=>{um.off("update",c),window.removeEventListener("popstate",i)}},[e.join("&")]),{searchParams:n,updateUrl:Y.useMemo(()=>b2(t),[t])}}const F2=h2(P2);function I2({children:e,fullPageNavigationOnShallowFalseUpdates:t=!1,...n}){return Y.createElement(bw.Provider,{value:{fullPageNavigationOnShallowFalseUpdates:t}},Y.createElement(F2,{...n,children:e}))}const R2="modulepreload",T2=function(e,t){return new URL(e,t).href},Bv={},Sr=function(t,n,o){let i=Promise.resolve();if(n&&n.length>0){let l=function(y){return Promise.all(y.map(g=>Promise.resolve(g).then(v=>({status:"fulfilled",value:v}),v=>({status:"rejected",reason:v}))))};const d=document.getElementsByTagName("link"),h=document.querySelector("meta[property=csp-nonce]"),p=(h==null?void 0:h.nonce)||(h==null?void 0:h.getAttribute("nonce"));i=l(n.map(y=>{if(y=T2(y,o),y in Bv)return;Bv[y]=!0;const g=y.endsWith(".css"),v=g?'[rel="stylesheet"]':"";if(!!o)for(let E=d.length-1;E>=0;E--){const F=d[E];if(F.href===y&&(!g||F.rel==="stylesheet"))return}else if(document.querySelector(`link[href="${y}"]${v}`))return;const S=document.createElement("link");if(S.rel=g?"stylesheet":R2,g||(S.as="script"),S.crossOrigin="",S.href=y,p&&S.setAttribute("nonce",p),document.head.appendChild(S),g)return new Promise((E,F)=>{S.addEventListener("load",E),S.addEventListener("error",()=>F(new Error(`Unable to preload CSS for ${y}`)))})}))}function c(l){const d=new Event("vite:preloadError",{cancelable:!0});if(d.payload=l,window.dispatchEvent(d),!d.defaultPrevented)throw l}return i.then(l=>{for(const d of l||[])d.status==="rejected"&&c(d.reason);return t().catch(c)})};var Sa=typeof window<"u"?Y.useLayoutEffect:Y.useEffect;function yh(e){const t=Y.useRef({value:e,prev:null}),n=t.current.value;return e!==n&&(t.current={value:e,prev:n}),t.current.prev}function M2(e,t,n={},o={}){Y.useEffect(()=>{if(!e.current||o.disabled||typeof IntersectionObserver!="function")return;const i=new IntersectionObserver(([c])=>{t(c)},n);return i.observe(e.current),()=>{i.disconnect()}},[t,n,o.disabled,e])}function A2(e){const t=Y.useRef(null);return Y.useImperativeHandle(e,()=>t.current,[]),t}const Pw=!1;function Ta(e){return e[e.length-1]}function L2(e){return typeof e=="function"}function Xs(e,t){return L2(e)?e(t):e}const Fw=Object.prototype.hasOwnProperty,zv=Object.prototype.propertyIsEnumerable;function Iw(e){for(const t in e)if(Fw.call(e,t))return!0;return!1}const O2=()=>Object.create(null),Qs=(e,t)=>Zs(e,t,O2);function Zs(e,t,n=()=>({}),o=0){if(e===t)return e;if(o>500)return t;const i=t,c=Wv(e)&&Wv(i);if(!c&&!(el(e)&&el(i)))return i;const l=c?e:Vv(e);if(!l)return i;const d=c?i:Vv(i);if(!d)return i;const h=l.length,p=d.length,y=c?new Array(p):n();let g=0;for(let v=0;v<p;v++){const w=c?v:d[v],S=e[w],E=i[w];if(S===E){y[w]=S,(c?v<h:Fw.call(e,w))&&g++;continue}if(S===null||E===null||typeof S!="object"||typeof E!="object"){y[w]=E;continue}const F=Zs(S,E,n,o+1);y[w]=F,F===S&&g++}return h===p&&g===h?e:y}function Vv(e){const t=Object.getOwnPropertyNames(e);for(const i of t)if(!zv.call(e,i))return!1;const n=Object.getOwnPropertySymbols(e);if(n.length===0)return t;const o=t;for(const i of n){if(!zv.call(e,i))return!1;o.push(i)}return o}function el(e){if(!qv(e))return!1;const t=e.constructor;if(typeof t>"u")return!0;const n=t.prototype;return!(!qv(n)||!n.hasOwnProperty("isPrototypeOf"))}function qv(e){return Object.prototype.toString.call(e)==="[object Object]"}function Wv(e){return Array.isArray(e)&&e.length===Object.keys(e).length}function no(e,t,n){if(e===t)return!0;if(typeof e!=typeof t)return!1;if(Array.isArray(e)&&Array.isArray(t)){if(e.length!==t.length)return!1;for(let o=0,i=e.length;o<i;o++)if(!no(e[o],t[o],n))return!1;return!0}if(el(e)&&el(t)){const o=(n==null?void 0:n.ignoreUndefined)??!0;if(n!=null&&n.partial){for(const l in t)if((!o||t[l]!==void 0)&&!no(e[l],t[l],n))return!1;return!0}let i=0;if(!o)i=Object.keys(e).length;else for(const l in e)e[l]!==void 0&&i++;let c=0;for(const l in t)if((!o||t[l]!==void 0)&&(c++,c>i||!no(e[l],t[l],n)))return!1;return i===c}return!1}function ui(e){let t,n;const o=new Promise((i,c)=>{t=i,n=c});return o.status="pending",o.resolve=i=>{o.status="resolved",o.value=i,t(i),e==null||e(i)},o.reject=i=>{o.status="rejected",n(i)},o}function Ma(e){return!!(e&&typeof e=="object"&&typeof e.then=="function")}function N2(e){return e.replace(/[\x00-\x1f\x7f]/g,"")}function Hv(e){let t;try{t=decodeURI(e)}catch{t=e.replaceAll(/%[0-9A-F]{2}/gi,n=>{try{return decodeURI(n)}catch{return n}})}return N2(t)}const D2=["http:","https:","mailto:","tel:"];function tl(e,t){if(!e)return!1;try{const n=new URL(e);return!t.has(n.protocol)}catch{return!1}}function da(e){if(!e)return{path:e,handledProtocolRelativeURL:!1};if(!/[%\\\x00-\x1f\x7f]/.test(e)&&!e.startsWith("//"))return{path:e,handledProtocolRelativeURL:!1};const t=/%25|%5C/gi;let n=0,o="",i;for(;(i=t.exec(e))!==null;)o+=Hv(e.slice(n,i.index))+i[0],n=t.lastIndex;o=o+Hv(n?e.slice(n):e);let c=!1;return o.startsWith("//")&&(c=!0,o="/"+o.replace(/^\/+/,"")),{path:o,handledProtocolRelativeURL:c}}function j2(e){return/\s|[^\u0000-\u007F]/.test(e)?e.replace(/\s|[^\u0000-\u007F]/gu,encodeURIComponent):e}function $2(e,t){if(e===t)return!0;if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function Vr(){throw new Error("Invariant failed")}function Aa(e){const t=new Map;let n,o;const i=c=>{c.next&&(c.prev?(c.prev.next=c.next,c.next.prev=c.prev,c.next=void 0,o&&(o.next=c,c.prev=o)):(c.next.prev=void 0,n=c.next,c.next=void 0,o&&(c.prev=o,o.next=c)),o=c)};return{get(c){const l=t.get(c);if(l)return i(l),l.value},set(c,l){if(t.size>=e&&n){const h=n;t.delete(h.key),h.next&&(n=h.next,h.next.prev=void 0),h===o&&(o=void 0)}const d=t.get(c);if(d)d.value=l,i(d);else{const h={key:c,value:l,prev:o};o&&(o.next=h),o=h,n||(n=h),t.set(c,h)}},clear(){t.clear(),n=void 0,o=void 0}}}const ys=4,Rw=5;function U2(e){const t=e.indexOf("{");if(t===-1)return null;const n=e.indexOf("}",t);return n===-1||t+1>=e.length?null:[t,n]}function Tw(e,t,n=new Uint16Array(6)){const o=e.indexOf("/",t),i=o===-1?e.length:o,c=e.substring(t,i);if(!c||!c.includes("$"))return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n;if(c==="$"){const d=e.length;return n[0]=2,n[1]=t,n[2]=t,n[3]=d,n[4]=d,n[5]=d,n}if(c.charCodeAt(0)===36)return n[0]=1,n[1]=t,n[2]=t+1,n[3]=i,n[4]=i,n[5]=i,n;const l=U2(c);if(l){const[d,h]=l,p=c.charCodeAt(d+1);if(p===45){if(d+2<c.length&&c.charCodeAt(d+2)===36){const y=d+3,g=h;if(y<g)return n[0]=3,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=i,n}}else if(p===36){const y=d+1,g=d+2;return g===h?(n[0]=2,n[1]=t+d,n[2]=t+y,n[3]=t+g,n[4]=t+h+1,n[5]=e.length,n):(n[0]=1,n[1]=t+d,n[2]=t+g,n[3]=t+h,n[4]=t+h+1,n[5]=i,n)}}return n[0]=0,n[1]=t,n[2]=t,n[3]=i,n[4]=i,n[5]=i,n}function Al(e,t,n,o,i,c,l){var h,p,y,g,v,w,S,E,F,K;l==null||l(n);let d=o;{const _=n.fullPath??n.from,L=_.length,C=((h=n.options)==null?void 0:h.caseSensitive)??e,D=((y=(p=n.options)==null?void 0:p.params)==null?void 0:y.parse)??((g=n.options)==null?void 0:g.parseParams);for(;d<L;){const N=Tw(_,d,t);let T;const q=d,ee=N[5];switch(d=ee+1,c++,N[0]){case 0:{const ne=_.substring(N[2],N[3]);if(C){const H=(v=i.static)==null?void 0:v.get(ne);if(H)T=H;else{i.static??(i.static=new Map);const k=eo(n.fullPath??n.from);k.parent=i,k.depth=c,T=k,i.static.set(ne,k)}}else{const H=ne.toLowerCase(),k=(w=i.staticInsensitive)==null?void 0:w.get(H);if(k)T=k;else{i.staticInsensitive??(i.staticInsensitive=new Map);const U=eo(n.fullPath??n.from);U.parent=i,U.depth=c,T=U,i.staticInsensitive.set(H,U)}}break}case 1:{const ne=_.substring(q,N[1]),H=_.substring(N[4],ee),k=C&&!!(ne||H),U=ne?k?ne:ne.toLowerCase():void 0,V=H?k?H:H.toLowerCase():void 0,J=!D&&((S=i.dynamic)==null?void 0:S.find(B=>!B.parse&&B.caseSensitive===k&&B.prefix===U&&B.suffix===V));if(J)T=J;else{const B=Sh(1,n.fullPath??n.from,k,U,V);T=B,B.depth=c,B.parent=i,i.dynamic??(i.dynamic=[]),i.dynamic.push(B)}break}case 3:{const ne=_.substring(q,N[1]),H=_.substring(N[4],ee),k=C&&!!(ne||H),U=ne?k?ne:ne.toLowerCase():void 0,V=H?k?H:H.toLowerCase():void 0,J=!D&&((E=i.optional)==null?void 0:E.find(B=>!B.parse&&B.caseSensitive===k&&B.prefix===U&&B.suffix===V));if(J)T=J;else{const B=Sh(3,n.fullPath??n.from,k,U,V);T=B,B.parent=i,B.depth=c,i.optional??(i.optional=[]),i.optional.push(B)}break}case 2:{const ne=_.substring(q,N[1]),H=_.substring(N[4],ee),k=C&&!!(ne||H),U=ne?k?ne:ne.toLowerCase():void 0,V=H?k?H:H.toLowerCase():void 0,J=Sh(2,n.fullPath??n.from,k,U,V);T=J,J.parent=i,J.depth=c,i.wildcard??(i.wildcard=[]),i.wildcard.push(J)}}i=T}if(D&&n.children&&!n.isRoot&&n.id&&n.id.charCodeAt(n.id.lastIndexOf("/")+1)===95){const N=eo(n.fullPath??n.from);N.kind=Rw,N.parent=i,c++,N.depth=c,i.pathless??(i.pathless=[]),i.pathless.push(N),i=N}const $=(n.path||!n.children)&&!n.isRoot;if($&&_.endsWith("/")){const N=eo(n.fullPath??n.from);N.kind=ys,N.parent=i,c++,N.depth=c,i.index=N,i=N}i.parse=D??null,i.priority=((K=(F=n.options)==null?void 0:F.params)==null?void 0:K.priority)??0,$&&!i.route&&(i.route=n,i.fullPath=n.fullPath??n.from)}if(n.children)for(const _ of n.children)Al(e,t,_,d,i,c,l)}function vh(e,t){if(e.parse&&!t.parse)return-1;if(!e.parse&&t.parse)return 1;if(e.parse&&t.parse&&(e.priority||t.priority))return t.priority-e.priority;if(e.prefix&&t.prefix&&e.prefix!==t.prefix){if(e.prefix.startsWith(t.prefix))return-1;if(t.prefix.startsWith(e.prefix))return 1}if(e.suffix&&t.suffix&&e.suffix!==t.suffix){if(e.suffix.endsWith(t.suffix))return-1;if(t.suffix.endsWith(e.suffix))return 1}return e.prefix&&!t.prefix?-1:!e.prefix&&t.prefix?1:e.suffix&&!t.suffix?-1:!e.suffix&&t.suffix?1:e.caseSensitive&&!t.caseSensitive?-1:!e.caseSensitive&&t.caseSensitive?1:0}function gs(e){var t,n,o;if(e.pathless)for(const i of e.pathless)gs(i);if(e.static)for(const i of e.static.values())gs(i);if(e.staticInsensitive)for(const i of e.staticInsensitive.values())gs(i);if((t=e.dynamic)!=null&&t.length){e.dynamic.sort(vh);for(const i of e.dynamic)gs(i)}if((n=e.optional)!=null&&n.length){e.optional.sort(vh);for(const i of e.optional)gs(i)}if((o=e.wildcard)!=null&&o.length){e.wildcard.sort(vh);for(const i of e.wildcard)gs(i)}}function eo(e){return{kind:0,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:e,parent:null,parse:null,priority:0}}function Sh(e,t,n,o,i){return{kind:e,depth:0,pathless:null,index:null,static:null,staticInsensitive:null,dynamic:null,optional:null,wildcard:null,route:null,fullPath:t,parent:null,parse:null,priority:0,caseSensitive:n,prefix:o,suffix:i}}function B2(e,t){const n=eo("/"),o=new Uint16Array(6);for(const i of e)Al(!1,o,i,1,n,0);gs(n),t.masksTree=n,t.flatCache=Aa(1e3)}function z2(e,t){e||(e="/");const n=t.flatCache.get(e);if(n)return n;const o=mp(e,t.masksTree);return t.flatCache.set(e,o),o}function V2(e,t,n,o,i){e||(e="/"),o||(o="/");const c=t?`case\0${e}`:e;let l=i.singleCache.get(c);return l||(l=eo("/"),Al(t,new Uint16Array(6),{from:e},1,l,0),i.singleCache.set(c,l)),mp(o,l,n)}function q2(e,t,n=!1){const o=n?e:`nofuzz\0${e}`,i=t.matchCache.get(o);if(i!==void 0)return i;e||(e="/");let c;try{c=mp(e,t.segmentTree,n)}catch(l){if(l instanceof URIError)c=null;else throw l}return c&&(c.branch=Aw(c.route)),t.matchCache.set(o,c),c}function W2(e){return e==="/"?e:e.replace(/\/{1,}$/,"")}function H2(e,t=!1,n){const o=eo(e.fullPath),i=new Uint16Array(6),c={},l={};let d=0;return Al(t,i,e,1,o,0,h=>{if(n==null||n(h,d),h.id in c&&Vr(),c[h.id]=h,d!==0&&h.path){const p=W2(h.fullPath);(!l[p]||h.fullPath.endsWith("/"))&&(l[p]=h)}d++}),gs(o),{processedTree:{segmentTree:o,singleCache:Aa(1e3),matchCache:Aa(1e3),flatCache:null,masksTree:null},routesById:c,routesByPath:l}}function mp(e,t,n=!1){const o=e.split("/"),i=Q2(e,o,t,n);if(!i)return null;const[c]=Mw(e,o,i);return{route:i.node.route,rawParams:c}}function Mw(e,t,n){var y,g,v,w,S,E,F,K,_,L;const o=K2(n.node);let i=null;const c=Object.create(null);let l=((y=n.extract)==null?void 0:y.part)??0,d=((g=n.extract)==null?void 0:g.node)??0,h=((v=n.extract)==null?void 0:v.path)??0,p=((w=n.extract)==null?void 0:w.segment)??0;for(;d<o.length;l++,d++,h++,p++){const C=o[d];if(C.kind===ys)break;if(C.kind===Rw){p--,l--,h--;continue}const D=t[l],$=h;if(D&&(h+=D.length),C.kind===1){i??(i=n.node.fullPath.split("/"));const N=i[p],T=((S=C.prefix)==null?void 0:S.length)??0;if(N.charCodeAt(T)===123){const q=((E=C.suffix)==null?void 0:E.length)??0,ee=N.substring(T+2,N.length-q-1),ne=D.substring(T,D.length-q);c[ee]=decodeURIComponent(ne)}else{const q=N.substring(1);c[q]=decodeURIComponent(D)}}else if(C.kind===3){if(n.skipped&1<<d){l--,h=$-1;continue}i??(i=n.node.fullPath.split("/"));const N=i[p],T=((F=C.prefix)==null?void 0:F.length)??0,q=((K=C.suffix)==null?void 0:K.length)??0,ee=N.substring(T+3,N.length-q-1),ne=C.suffix||C.prefix?D.substring(T,D.length-q):D;ne&&(c[ee]=decodeURIComponent(ne))}else if(C.kind===2){const N=C,T=e.substring($+(((_=N.prefix)==null?void 0:_.length)??0),e.length-(((L=N.suffix)==null?void 0:L.length)??0)),q=decodeURIComponent(T);c["*"]=q,c._splat=q;break}}return n.rawParams&&Object.assign(c,n.rawParams),[c,{part:l,node:d,path:h,segment:p}]}function Aw(e){const t=[e];for(;e.parentRoute;)e=e.parentRoute,t.push(e);return t.reverse(),t}function K2(e){const t=Array(e.depth+1);do t[e.depth]=e,e=e.parent;while(e);return t}function Q2(e,t,n,o){if(e==="/"&&n.index)return{node:n.index,skipped:0};const i=!Ta(t),c=i&&e!=="/",l=t.length-(i?1:0),d=[{node:n,index:1,skipped:0,depth:1,statics:0,dynamics:0,optionals:0}];let h=null,p=null;for(;d.length;){const y=d.pop(),{node:g,index:v,skipped:w,depth:S,statics:E,dynamics:F,optionals:K}=y;let{extract:_,rawParams:L}=y;if(g.kind===2&&g.route&&!Pu(p,y))continue;if(g.parse){if(!Kv(e,t,y))continue;L=y.rawParams,_=y.extract}o&&g.route&&g.kind!==ys&&Pu(h,y)&&(h=y);const C=v===l;if(C&&(g.route&&(!c||g.kind===ys||g.kind===2)&&Pu(p,y)&&(p=y),!g.optional&&!g.wildcard&&!g.index&&!g.pathless))continue;const D=C?void 0:t[v];let $;if(C&&g.index){const N={node:g.index,index:v,skipped:w,depth:S+1,statics:E,dynamics:F,optionals:K,extract:_,rawParams:L};let T=!0;if(g.index.parse&&(Kv(e,t,N)||(T=!1)),T){if(!F&&!K&&!w&&J2(E,l))return N;Pu(p,N)&&(p=N)}}if(g.wildcard)for(let N=g.wildcard.length-1;N>=0;N--){const T=g.wildcard[N],{prefix:q,suffix:ee}=T;if(!(q&&(C||!(T.caseSensitive?D:$??($=D.toLowerCase())).startsWith(q)))){if(ee){if(C)continue;const ne=t.slice(v).join("/").slice(-ee.length);if((T.caseSensitive?ne:ne.toLowerCase())!==ee)continue}d.push({node:T,index:l,skipped:w,depth:S+1,statics:E,dynamics:F,optionals:K,extract:_,rawParams:L})}}if(g.optional){const N=w|1<<S,T=S+1;for(let q=g.optional.length-1;q>=0;q--){const ee=g.optional[q];d.push({node:ee,index:v,skipped:N,depth:T,statics:E,dynamics:F,optionals:K,extract:_,rawParams:L})}if(!C)for(let q=g.optional.length-1;q>=0;q--){const ee=g.optional[q],{prefix:ne,suffix:H}=ee;if(ne||H){const k=ee.caseSensitive?D:$??($=D.toLowerCase());if(ne&&!k.startsWith(ne)||H&&!k.endsWith(H))continue}d.push({node:ee,index:v+1,skipped:w,depth:T,statics:E,dynamics:F,optionals:K+bu(l,v),extract:_,rawParams:L})}}if(!C&&g.dynamic&&D)for(let N=g.dynamic.length-1;N>=0;N--){const T=g.dynamic[N],{prefix:q,suffix:ee}=T;if(q||ee){const ne=T.caseSensitive?D:$??($=D.toLowerCase());if(q&&!ne.startsWith(q)||ee&&!ne.endsWith(ee))continue}d.push({node:T,index:v+1,skipped:w,depth:S+1,statics:E,dynamics:F+bu(l,v),optionals:K,extract:_,rawParams:L})}if(!C&&g.staticInsensitive){const N=g.staticInsensitive.get($??($=D.toLowerCase()));N&&d.push({node:N,index:v+1,skipped:w,depth:S+1,statics:E+bu(l,v),dynamics:F,optionals:K,extract:_,rawParams:L})}if(!C&&g.static){const N=g.static.get(D);N&&d.push({node:N,index:v+1,skipped:w,depth:S+1,statics:E+bu(l,v),dynamics:F,optionals:K,extract:_,rawParams:L})}if(g.pathless){const N=S+1;for(let T=g.pathless.length-1;T>=0;T--){const q=g.pathless[T];d.push({node:q,index:v,skipped:w,depth:N,statics:E,dynamics:F,optionals:K,extract:_,rawParams:L})}}}if(p)return p;if(o&&h){let y=h.index;for(let v=0;v<h.index;v++)y+=t[v].length;const g=y===e.length?"/":e.slice(y);return h.rawParams??(h.rawParams=Object.create(null)),h.rawParams["**"]=decodeURIComponent(g),h}return null}function bu(e,t){return 2**(e-t-1)}function J2(e,t){return e===2**(t-1)-1}function Kv(e,t,n){let o,i;try{[o,i]=Mw(e,t,n)}catch{return null}if(n.rawParams=o,n.extract=i,!n.node.parse)return!0;try{if(n.node.parse(o)===!1)return null}catch{}return!0}function Pu(e,t){return e?t.statics>e.statics||t.statics===e.statics&&(t.dynamics>e.dynamics||t.dynamics===e.dynamics&&(t.optionals>e.optionals||t.optionals===e.optionals&&((t.node.kind===ys)>(e.node.kind===ys)||t.node.kind===ys==(e.node.kind===ys)&&t.depth>e.depth))):!0}function $u(e){return pp(e.filter(t=>t!==void 0).join("/"))}function pp(e){return e.replace(/\/{2,}/g,"/")}function Lw(e){return e==="/"?e:e.replace(/^\/{1,}/,"")}function Br(e){const t=e.length;return t>1&&e[t-1]==="/"?e.replace(/\/{1,}$/,""):e}function Ow(e){return Br(Lw(e))}function nl(e,t){return e!=null&&e.endsWith("/")&&e!=="/"&&e!==`${t}/`?e.slice(0,-1):e}function G2(e,t,n){return nl(e,n)===nl(t,n)}function Y2({base:e,to:t,trailingSlash:n="never",cache:o}){const i=t.startsWith("/"),c=!i&&t===".";let l;if(o){l=i?t:c?e:e+"\0"+t;const p=o.get(l);if(p)return p}let d;if(c)d=e.split("/");else if(i)d=t.split("/");else{for(d=e.split("/");d.length>1&&Ta(d)==="";)d.pop();const p=t.split("/");for(let y=0,g=p.length;y<g;y++){const v=p[y];v===""?y?y===g-1&&d.push(v):d=[v]:v===".."?d.pop():v==="."||d.push(v)}}d.length>1&&(Ta(d)===""?n==="never"&&d.pop():n==="always"&&d.push(""));const h=pp(d.join("/"))||"/";return l&&o&&o.set(l,h),h}function X2(e){const t=new Map(e.map(i=>[encodeURIComponent(i),i])),n=Array.from(t.keys()).map(i=>i.replace(/[.*+?^${}()|[\]\\]/g,"\\$&")).join("|"),o=new RegExp(n,"g");return i=>i.replace(o,c=>t.get(c)??c)}function xh(e,t,n){const o=t[e];return typeof o!="string"?o:e==="_splat"?/^[a-zA-Z0-9\-._~!/]*$/.test(o)?o:o.split("/").map(i=>Jv(i,n)).join("/"):Jv(o,n)}function Qv({path:e,params:t,decoder:n,...o}){let i=!1;const c=Object.create(null);if(!e||e==="/")return{interpolatedPath:"/",usedParams:c,isMissingParams:i};if(!e.includes("$"))return{interpolatedPath:e,usedParams:c,isMissingParams:i};const l=e.length;let d=0,h,p="";for(;d<l;){const y=d;h=Tw(e,y,h);const g=h[5];if(d=g+1,y===g)continue;const v=h[0];if(v===0){p+="/"+e.substring(y,g);continue}if(v===2){const w=t._splat;c._splat=w,c["*"]=w;const S=e.substring(y,h[1]),E=e.substring(h[4],g);if(!w){i=!0,(S||E)&&(p+="/"+S+E);continue}const F=xh("_splat",t,n);p+="/"+S+F+E;continue}if(v===1){const w=e.substring(h[2],h[3]);!i&&!(w in t)&&(i=!0),c[w]=t[w];const S=e.substring(y,h[1]),E=e.substring(h[4],g),F=xh(w,t,n)??"undefined";p+="/"+S+F+E;continue}if(v===3){const w=e.substring(h[2],h[3]),S=t[w];if(S==null)continue;c[w]=S;const E=e.substring(y,h[1]),F=e.substring(h[4],g),K=xh(w,t,n)??"";p+="/"+E+K+F;continue}}return e.endsWith("/")&&(p+="/"),{usedParams:c,interpolatedPath:p||"/",isMissingParams:i}}function Jv(e,t){const n=encodeURIComponent(e);return(t==null?void 0:t(n))??n}function Kt(e){return(e==null?void 0:e.isNotFound)===!0}function Z2(e,t=String){const n=new URLSearchParams;for(const o in e){const i=e[o];i!==void 0&&n.set(o,t(i))}return n.toString()}function wh(e){return e?e==="false"?!1:e==="true"?!0:+e*0===0&&+e+""===e?+e:e:""}function eP(e){const t=new URLSearchParams(e),n=Object.create(null);for(const[o,i]of t.entries()){const c=n[o];c==null?n[o]=wh(i):Array.isArray(c)?c.push(wh(i)):n[o]=[c,wh(i)]}return n}const tP=rP(JSON.parse),nP=sP(JSON.stringify,JSON.parse);function rP(e){return t=>{t[0]==="?"&&(t=t.substring(1));const n=eP(t);for(const o in n){const i=n[o];if(typeof i=="string")try{n[o]=e(i)}catch{}}return n}}function sP(e,t){const n=typeof t=="function";function o(i){if(typeof i=="object"&&i!==null)try{return e(i)}catch{}else if(n&&typeof i=="string")try{return t(i),e(i)}catch{}return i}return i=>{const c=Z2(i,o);return c?`?${c}`:""}}const ro="__root__";function oP(e){if(e.statusCode=e.statusCode||e.code||307,!e._builtLocation&&!e.reloadDocument&&typeof e.href=="string")try{new URL(e.href),e.reloadDocument=!0}catch{}const t=new Headers(e.headers);e.href&&t.get("Location")===null&&t.set("Location",e.href);const n=new Response(null,{status:e.statusCode,headers:t});if(n.options=e,e.throw)throw n;return n}function mn(e){return e instanceof Response&&!!e.options}const lm=e=>{var t;if(!e.rendered)return e.rendered=!0,(t=e.onReady)==null?void 0:t.call(e)},iP=e=>e.stores.matchesId.get().some(t=>{var n;return(n=e.stores.matchStores.get(t))==null?void 0:n.get()._forcePending}),Ll=(e,t)=>!!(e.preload&&!e.router.stores.matchStores.has(t)),so=(e,t,n=!0)=>{const o={...e.router.options.context??{}},i=n?t:t-1;for(let c=0;c<=i;c++){const l=e.matches[c];if(!l)continue;const d=e.router.getMatch(l.id);d&&Object.assign(o,d.__routeContext,d.__beforeLoadContext)}return o},Gv=(e,t)=>{if(!e.matches.length)return;const n=t.routeId,o=e.matches.findIndex(l=>l.routeId===e.router.routeTree.id),i=o>=0?o:0;let c=n?e.matches.findIndex(l=>l.routeId===n):e.firstBadMatchIndex??e.matches.length-1;c<0&&(c=i);for(let l=c;l>=0;l--){const d=e.matches[l];if(e.router.looseRoutesById[d.routeId].options.notFoundComponent)return l}return n?c:i},vs=(e,t,n)=>{var o,i,c;if(!(!mn(n)&&!Kt(n)))throw mn(n)&&n.redirectHandled&&!n.options.reloadDocument||(t&&((o=t._nonReactive.beforeLoadPromise)==null||o.resolve(),(i=t._nonReactive.loaderPromise)==null||i.resolve(),t._nonReactive.beforeLoadPromise=void 0,t._nonReactive.loaderPromise=void 0,t._nonReactive.error=n,e.updateMatch(t.id,l=>({...l,status:mn(n)?"redirected":Kt(n)?"notFound":l.status==="pending"?"success":l.status,context:so(e,t.index),isFetching:!1,error:n})),Kt(n)&&!n.routeId&&(n.routeId=t.routeId),(c=t._nonReactive.loadPromise)==null||c.resolve()),mn(n)&&(e.rendered=!0,n.options._fromLocation=e.location,n.redirectHandled=!0,n=e.router.resolveRedirect(n))),n},Nw=(e,t)=>{const n=e.router.getMatch(t);return!!(!n||n._nonReactive.dehydrated)},Yv=(e,t,n)=>{const o=so(e,n);e.updateMatch(t,i=>({...i,context:o}))},ha=(e,t,n)=>{var l,d;const{id:o,routeId:i}=e.matches[t],c=e.router.looseRoutesById[i];if(n instanceof Promise)throw n;e.firstBadMatchIndex??(e.firstBadMatchIndex=t),vs(e,e.router.getMatch(o),n);try{(d=(l=c.options).onError)==null||d.call(l,n)}catch(h){n=h,vs(e,e.router.getMatch(o),n)}e.updateMatch(o,h=>{var p,y;return(p=h._nonReactive.beforeLoadPromise)==null||p.resolve(),h._nonReactive.beforeLoadPromise=void 0,(y=h._nonReactive.loadPromise)==null||y.resolve(),{...h,error:n,status:"error",isFetching:!1,updatedAt:Date.now(),abortController:new AbortController}}),!e.preload&&!mn(n)&&!Kt(n)&&(e.serialError??(e.serialError=n))},Dw=(e,t,n,o)=>{var c;if(o._nonReactive.pendingTimeout!==void 0)return;const i=n.options.pendingMs??e.router.options.defaultPendingMs;if(e.onReady&&!Ll(e,t)&&(n.options.loader||n.options.beforeLoad||$w(n))&&typeof i=="number"&&i!==1/0&&(n.options.pendingComponent??((c=e.router.options)==null?void 0:c.defaultPendingComponent))){const l=setTimeout(()=>{lm(e)},i);o._nonReactive.pendingTimeout=l}},aP=(e,t,n)=>{const o=e.router.getMatch(t);if(!o._nonReactive.beforeLoadPromise&&!o._nonReactive.loaderPromise)return;Dw(e,t,n,o);const i=()=>{const c=e.router.getMatch(t);c.preload&&(c.status==="redirected"||c.status==="notFound")&&vs(e,c,c.error)};return o._nonReactive.beforeLoadPromise?o._nonReactive.beforeLoadPromise.then(i):i()},cP=(e,t,n,o)=>{const i=e.router.getMatch(t);let c=i._nonReactive.loadPromise;i._nonReactive.loadPromise=ui(()=>{c==null||c.resolve(),c=void 0});const{paramsError:l,searchError:d}=i;l&&ha(e,n,l),d&&ha(e,n,d),Dw(e,t,o,i);const h=new AbortController;let p=!1;const y=()=>{p||(p=!0,e.updateMatch(t,C=>({...C,isFetching:"beforeLoad",fetchCount:C.fetchCount+1,abortController:h})))},g=()=>{var C;(C=i._nonReactive.beforeLoadPromise)==null||C.resolve(),i._nonReactive.beforeLoadPromise=void 0,e.updateMatch(t,D=>({...D,isFetching:!1}))};if(!o.options.beforeLoad){e.router.batch(()=>{y(),g()});return}i._nonReactive.beforeLoadPromise=ui();const v={...so(e,n,!1),...i.__routeContext},{search:w,params:S,cause:E}=i,F=Ll(e,t),K={search:w,abortController:h,params:S,preload:F,context:v,location:e.location,navigate:C=>e.router.navigate({...C,_fromLocation:e.location}),buildLocation:e.router.buildLocation,cause:F?"preload":E,matches:e.matches,routeId:o.id,...e.router.options.additionalContext},_=C=>{if(C===void 0){e.router.batch(()=>{y(),g()});return}(mn(C)||Kt(C))&&(y(),ha(e,n,C)),e.router.batch(()=>{y(),e.updateMatch(t,D=>({...D,__beforeLoadContext:C})),g()})};let L;try{if(L=o.options.beforeLoad(K),Ma(L))return y(),L.catch(C=>{ha(e,n,C)}).then(_)}catch(C){y(),ha(e,n,C)}_(L)},uP=(e,t)=>{const{id:n,routeId:o}=e.matches[t],i=e.router.looseRoutesById[o],c=()=>d(),l=()=>cP(e,n,t,i),d=()=>{if(Nw(e,n))return;const h=aP(e,n,i);return Ma(h)?h.then(l):l()};return c()},lP=(e,t,n)=>{var c,l,d,h,p,y;const o=e.router.getMatch(t);if(!o||!n.options.head&&!n.options.scripts&&!n.options.headers)return;const i={ssr:e.router.options.ssr,matches:e.matches,match:o,params:o.params,loaderData:o.loaderData};return Promise.all([(l=(c=n.options).head)==null?void 0:l.call(c,i),(h=(d=n.options).scripts)==null?void 0:h.call(d,i),(y=(p=n.options).headers)==null?void 0:y.call(p,i)]).then(([g,v,w])=>({meta:g==null?void 0:g.meta,links:g==null?void 0:g.links,headScripts:g==null?void 0:g.scripts,headers:w,scripts:v,styles:g==null?void 0:g.styles}))},jw=(e,t,n,o,i)=>{const c=t[o-1],{params:l,loaderDeps:d,abortController:h,cause:p}=e.router.getMatch(n),y=so(e,o),g=Ll(e,n);return{params:l,deps:d,preload:!!g,parentMatchPromise:c,abortController:h,context:y,location:e.location,navigate:v=>e.router.navigate({...v,_fromLocation:e.location}),cause:g?"preload":p,route:i,...e.router.options.additionalContext}},Xv=async(e,t,n,o,i)=>{var c,l,d,h,p;try{const y=e.router.getMatch(n);try{(!(Pw??e.router.isServer)||y.ssr===!0)&&La(i);const g=i.options.loader,v=typeof g=="function"?g:g==null?void 0:g.handler,w=v==null?void 0:v(jw(e,t,n,o,i)),S=!!v&&Ma(w);if((S||i._lazyPromise||i._componentsPromise||i.options.head||i.options.scripts||i.options.headers||y._nonReactive.minPendingPromise)&&e.updateMatch(n,F=>({...F,isFetching:"loader"})),v){const F=S?await w:w;vs(e,e.router.getMatch(n),F),F!==void 0&&e.updateMatch(n,K=>({...K,loaderData:F}))}i._lazyPromise&&await i._lazyPromise;const E=y._nonReactive.minPendingPromise;E&&await E,i._componentsPromise&&await i._componentsPromise,e.updateMatch(n,F=>({...F,error:void 0,context:so(e,o),status:"success",isFetching:!1,updatedAt:Date.now()}))}catch(g){let v=g;if((v==null?void 0:v.name)==="AbortError"){if(y.abortController.signal.aborted){(c=y._nonReactive.loaderPromise)==null||c.resolve(),y._nonReactive.loaderPromise=void 0;return}e.updateMatch(n,S=>({...S,status:S.status==="pending"?"success":S.status,isFetching:!1,context:so(e,o)}));return}const w=y._nonReactive.minPendingPromise;w&&await w,Kt(g)&&await((d=(l=i.options.notFoundComponent)==null?void 0:l.preload)==null?void 0:d.call(l)),vs(e,e.router.getMatch(n),g);try{(p=(h=i.options).onError)==null||p.call(h,g)}catch(S){v=S,vs(e,e.router.getMatch(n),S)}!mn(v)&&!Kt(v)&&await La(i,["errorComponent"]),e.updateMatch(n,S=>({...S,error:v,context:so(e,o),status:"error",isFetching:!1}))}}catch(y){const g=e.router.getMatch(n);g&&(g._nonReactive.loaderPromise=void 0),vs(e,g,y)}},fP=async(e,t,n)=>{var w,S,E,F;async function o(K,_,L,C,D){const $=Date.now()-_.updatedAt,N=K?D.options.preloadStaleTime??e.router.options.defaultPreloadStaleTime??3e4:D.options.staleTime??e.router.options.defaultStaleTime??0,T=D.options.shouldReload,q=typeof T=="function"?T(jw(e,t,i,n,D)):T,{status:ee,invalid:ne}=C,H=$>=N&&(!!e.forceStaleReload||C.cause==="enter"||L!==void 0&&L!==C.id);l=ee==="success"&&(ne||(q??H)),K&&D.options.preload===!1||(l&&!e.sync&&y?(d=!0,(async()=>{var k,U;try{await Xv(e,t,i,n,D);const V=e.router.getMatch(i);(k=V._nonReactive.loaderPromise)==null||k.resolve(),(U=V._nonReactive.loadPromise)==null||U.resolve(),V._nonReactive.loaderPromise=void 0,V._nonReactive.loadPromise=void 0}catch(V){mn(V)&&await e.router.navigate(V.options)}})()):ee!=="success"||l?await Xv(e,t,i,n,D):Yv(e,i,n))}const{id:i,routeId:c}=e.matches[n];let l=!1,d=!1;const h=e.router.looseRoutesById[c],p=h.options.loader,y=((typeof p=="function"||p==null?void 0:p.staleReloadMode)??e.router.options.defaultStaleReloadMode)!=="blocking";if(Nw(e,i)){if(!e.router.getMatch(i))return e.matches[n];Yv(e,i,n)}else{const K=e.router.getMatch(i),_=e.router.stores.matchesId.get()[n],L=((w=_&&e.router.stores.matchStores.get(_)||null)==null?void 0:w.routeId)===c?_:(S=e.router.stores.matches.get().find(D=>D.routeId===c))==null?void 0:S.id,C=Ll(e,i);if(K._nonReactive.loaderPromise){if(K.status==="success"&&!e.sync&&!K.preload&&y)return K;await K._nonReactive.loaderPromise;const D=e.router.getMatch(i),$=D._nonReactive.error||D.error;$&&vs(e,D,$),D.status==="pending"&&await o(C,K,L,D,h)}else{const D=C&&!e.router.stores.matchStores.has(i),$=e.router.getMatch(i);$._nonReactive.loaderPromise=ui(),D!==$.preload&&e.updateMatch(i,N=>({...N,preload:D})),await o(C,K,L,$,h)}}const g=e.router.getMatch(i);d||((E=g._nonReactive.loaderPromise)==null||E.resolve(),(F=g._nonReactive.loadPromise)==null||F.resolve(),g._nonReactive.loadPromise=void 0),clearTimeout(g._nonReactive.pendingTimeout),g._nonReactive.pendingTimeout=void 0,d||(g._nonReactive.loaderPromise=void 0),g._nonReactive.dehydrated=void 0;const v=d?g.isFetching:!1;return v!==g.isFetching||g.invalid!==!1?(e.updateMatch(i,K=>({...K,isFetching:v,invalid:!1})),e.router.getMatch(i)):g};async function Zv(e){var v,w;const t=e,n=[];iP(t.router)&&lm(t);let o;for(let S=0;S<t.matches.length;S++){try{const E=uP(t,S);Ma(E)&&await E}catch(E){if(mn(E))throw E;if(Kt(E))o=E;else if(!t.preload)throw E;break}if(t.serialError||t.firstBadMatchIndex!=null)break}const i=t.firstBadMatchIndex??t.matches.length,c=o&&!t.preload?Gv(t,o):void 0,l=o&&t.preload?0:c!==void 0?Math.min(c+1,i):i;let d,h;for(let S=0;S<l;S++)n.push(fP(t,n,S));try{await Promise.all(n)}catch{const S=await Promise.allSettled(n);for(const E of S){if(E.status!=="rejected")continue;const F=E.reason;if(mn(F))throw F;Kt(F)?d??(d=F):h??(h=F)}if(h!==void 0)throw h}const p=d??(o&&!t.preload?o:void 0);let y=t.firstBadMatchIndex!==void 0?t.firstBadMatchIndex:t.matches.length-1;if(!p&&o&&t.preload)return t.matches;if(p){const S=Gv(t,p);S===void 0&&Vr();const E=t.matches[S],F=t.router.looseRoutesById[E.routeId],K=(v=t.router.options)==null?void 0:v.defaultNotFoundComponent;!F.options.notFoundComponent&&K&&(F.options.notFoundComponent=K),p.routeId=E.routeId;const _=E.routeId===t.router.routeTree.id;t.updateMatch(E.id,L=>({...L,..._?{status:"success",globalNotFound:!0,error:void 0}:{status:"notFound",error:p},isFetching:!1})),y=S,await La(F,["notFoundComponent"])}else if(!t.preload){const S=t.matches[0];S.globalNotFound||(w=t.router.getMatch(S.id))!=null&&w.globalNotFound&&t.updateMatch(S.id,E=>({...E,globalNotFound:!1,error:void 0}))}if(t.serialError&&t.firstBadMatchIndex!==void 0){const S=t.router.looseRoutesById[t.matches[t.firstBadMatchIndex].routeId];await La(S,["errorComponent"])}for(let S=0;S<=y;S++){const{id:E,routeId:F}=t.matches[S],K=t.router.looseRoutesById[F];try{const _=lP(t,E,K);if(_){const L=await _;t.updateMatch(E,C=>({...C,...L}))}}catch(_){console.error(`Error executing head for route ${F}:`,_)}}const g=lm(t);if(Ma(g)&&await g,p)throw p;if(t.serialError&&!t.preload&&!t.onReady)throw t.serialError;return t.matches}function eS(e,t){const n=t.map(o=>{var i,c;return(c=(i=e.options[o])==null?void 0:i.preload)==null?void 0:c.call(i)}).filter(Boolean);if(n.length!==0)return Promise.all(n)}function La(e,t=Uu){!e._lazyLoaded&&e._lazyPromise===void 0&&(e.lazyFn?e._lazyPromise=e.lazyFn().then(o=>{const{id:i,...c}=o.options;Object.assign(e.options,c),e._lazyLoaded=!0,e._lazyPromise=void 0}):e._lazyLoaded=!0);const n=()=>e._componentsLoaded?void 0:t===Uu?(()=>{if(e._componentsPromise===void 0){const o=eS(e,Uu);o?e._componentsPromise=o.then(()=>{e._componentsLoaded=!0,e._componentsPromise=void 0}):e._componentsLoaded=!0}return e._componentsPromise})():eS(e,t);return e._lazyPromise?e._lazyPromise.then(n):n()}function $w(e){var t;for(const n of Uu)if((t=e.options[n])!=null&&t.preload)return!0;return!1}const Uu=["component","errorComponent","pendingComponent","notFoundComponent"];function dP(e){return{input:({url:t})=>{for(const n of e)t=fm(n,t);return t},output:({url:t})=>{for(let n=e.length-1;n>=0;n--)t=Uw(e[n],t);return t}}}function hP(e){const t=Ow(e.basepath),n=`/${t}`,o=e.caseSensitive?n:n.toLowerCase(),i=`${o}/`;return{input:({url:c})=>{const l=e.caseSensitive?c.pathname:c.pathname.toLowerCase();return l===o?c.pathname="/":l.startsWith(i)&&(c.pathname=c.pathname.slice(n.length)),c},output:({url:c})=>(c.pathname=$u(["/",t,c.pathname]),c)}}function fm(e,t){var o;const n=(o=e==null?void 0:e.input)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function Uw(e,t){var o;const n=(o=e==null?void 0:e.output)==null?void 0:o.call(e,{url:t});if(n){if(typeof n=="string")return new URL(n);if(n instanceof URL)return n}return t}function mP(e,t){const{createMutableStore:n,createReadonlyStore:o,batch:i,init:c}=t,l=new Map,d=new Map,h=new Map,p=n(e.status),y=n(e.loadedAt),g=n(e.isLoading),v=n(e.isTransitioning),w=n(e.location),S=n(e.resolvedLocation),E=n(e.statusCode),F=n(e.redirect),K=n([]),_=n([]),L=n([]),C=o(()=>kh(l,K.get())),D=o(()=>kh(d,_.get())),$=o(()=>kh(h,L.get())),N=o(()=>K.get()[0]),T=o(()=>K.get().some(B=>{var X;return((X=l.get(B))==null?void 0:X.get().status)==="pending"})),q=o(()=>{var B;return{locationHref:w.get().href,resolvedLocationHref:(B=S.get())==null?void 0:B.href,status:p.get()}}),ee=o(()=>({status:p.get(),loadedAt:y.get(),isLoading:g.get(),isTransitioning:v.get(),matches:C.get(),location:w.get(),resolvedLocation:S.get(),statusCode:E.get(),redirect:F.get()})),ne=Aa(64);function H(B){let X=ne.get(B);return X||(X=o(()=>{const re=K.get();for(const te of re){const I=l.get(te);if(I&&I.routeId===B)return I.get()}}),ne.set(B,X)),X}const k={status:p,loadedAt:y,isLoading:g,isTransitioning:v,location:w,resolvedLocation:S,statusCode:E,redirect:F,matchesId:K,pendingIds:_,cachedIds:L,matches:C,pendingMatches:D,cachedMatches:$,firstId:N,hasPending:T,matchRouteDeps:q,matchStores:l,pendingMatchStores:d,cachedMatchStores:h,__store:ee,getRouteMatchStore:H,setMatches:U,setPending:V,setCached:J};U(e.matches),c==null||c(k);function U(B){Eh(B,l,K,n,i)}function V(B){Eh(B,d,_,n,i)}function J(B){Eh(B,h,L,n,i)}return k}function kh(e,t){const n=[];for(const o of t){const i=e.get(o);i&&n.push(i.get())}return n}function Eh(e,t,n,o,i){const c=e.map(d=>d.id),l=new Set(c);i(()=>{for(const d of t.keys())l.has(d)||t.delete(d);for(const d of e){const h=t.get(d.id);if(!h){const p=o(d);p.routeId=d.routeId,t.set(d.id,p);continue}h.routeId=d.routeId,h.get()!==d&&h.set(d)}$2(n.get(),c)||n.set(c)})}var xs="__TSR_index",tS="popstate",nS="beforeunload";function pP(e){let t=e.getLocation();const n=new Set,o=l=>{t=e.getLocation(),n.forEach(d=>d({location:t,action:l}))},i=l=>{e.notifyOnIndexChange??!0?o(l):t=e.getLocation()},c=async({task:l,navigateOpts:d,...h})=>{var g,v;if((d==null?void 0:d.ignoreBlocker)??!1){l();return}const p=((g=e.getBlockers)==null?void 0:g.call(e))??[],y=h.type==="PUSH"||h.type==="REPLACE";if(typeof document<"u"&&p.length&&y)for(const w of p){const S=Oa(h.path,h.state);if(await w.blockerFn({currentLocation:t,nextLocation:S,action:h.type})){(v=e.onBlocked)==null||v.call(e);return}}l()};return{get location(){return t},get length(){return e.getLength()},subscribers:n,subscribe:l=>(n.add(l),()=>{n.delete(l)}),push:(l,d,h)=>{const p=t.state[xs];d=rS(p+1,d),c({task:()=>{e.pushState(l,d),o({type:"PUSH"})},navigateOpts:h,type:"PUSH",path:l,state:d})},replace:(l,d,h)=>{const p=t.state[xs];d=rS(p,d),c({task:()=>{e.replaceState(l,d),o({type:"REPLACE"})},navigateOpts:h,type:"REPLACE",path:l,state:d})},go:(l,d)=>{c({task:()=>{e.go(l),i({type:"GO",index:l})},navigateOpts:d,type:"GO"})},back:l=>{c({task:()=>{e.back((l==null?void 0:l.ignoreBlocker)??!1),i({type:"BACK"})},navigateOpts:l,type:"BACK"})},forward:l=>{c({task:()=>{e.forward((l==null?void 0:l.ignoreBlocker)??!1),i({type:"FORWARD"})},navigateOpts:l,type:"FORWARD"})},canGoBack:()=>t.state[xs]!==0,createHref:l=>e.createHref(l),block:l=>{var h;if(!e.setBlockers)return()=>{};const d=((h=e.getBlockers)==null?void 0:h.call(e))??[];return e.setBlockers([...d,l]),()=>{var y,g;const p=((y=e.getBlockers)==null?void 0:y.call(e))??[];(g=e.setBlockers)==null||g.call(e,p.filter(v=>v!==l))}},flush:()=>{var l;return(l=e.flush)==null?void 0:l.call(e)},destroy:()=>{var l;return(l=e.destroy)==null?void 0:l.call(e)},notify:o}}function rS(e,t){t||(t={});const n=gp();return{...t,key:n,__TSR_key:n,[xs]:e}}function Bw(e){var T,q;const t=(e==null?void 0:e.window)??(typeof document<"u"?window:void 0),n=t.history.pushState,o=t.history.replaceState;let i=[];const c=()=>i,l=ee=>i=ee,d=(e==null?void 0:e.createHref)??(ee=>ee),h=(e==null?void 0:e.parseLocation)??(()=>Oa(`${t.location.pathname}${t.location.search}${t.location.hash}`,t.history.state));if(!((T=t.history.state)!=null&&T.__TSR_key)&&!((q=t.history.state)!=null&&q.key)){const ee=gp();t.history.replaceState({[xs]:0,key:ee,__TSR_key:ee},"")}let p=h(),y,g=!1,v=!1,w=!1,S=!1;const E=()=>p;let F,K;const _=()=>{F&&(N._ignoreSubscribers=!0,(F.isPush?t.history.pushState:t.history.replaceState)(F.state,"",F.href),N._ignoreSubscribers=!1,F=void 0,K=void 0,y=void 0)},L=(ee,ne,H)=>{const k=d(ne);K||(y=p),p=Oa(ne,H),F={href:k,state:H,isPush:(F==null?void 0:F.isPush)||ee==="push"},K||(K=Promise.resolve().then(()=>_()))},C=ee=>{p=h(),N.notify({type:ee})},D=async()=>{if(v){v=!1;return}const ee=h(),ne=ee.state[xs]-p.state[xs],H=ne===1,k=ne===-1,U=!H&&!k||g;g=!1;const V=U?"GO":k?"BACK":"FORWARD",J=U?{type:"GO",index:ne}:{type:k?"BACK":"FORWARD"};if(w)w=!1;else{const B=c();if(typeof document<"u"&&B.length){for(const X of B)if(await X.blockerFn({currentLocation:p,nextLocation:ee,action:V})){v=!0,t.history.go(1),N.notify(J);return}}}p=h(),N.notify(J)},$=ee=>{if(S){S=!1;return}let ne=!1;const H=c();if(typeof document<"u"&&H.length)for(const k of H){const U=k.enableBeforeUnload??!0;if(U===!0){ne=!0;break}if(typeof U=="function"&&U()===!0){ne=!0;break}}if(ne)return ee.preventDefault(),ee.returnValue=""},N=pP({getLocation:E,getLength:()=>t.history.length,pushState:(ee,ne)=>L("push",ee,ne),replaceState:(ee,ne)=>L("replace",ee,ne),back:ee=>(ee&&(w=!0),S=!0,t.history.back()),forward:ee=>{ee&&(w=!0),S=!0,t.history.forward()},go:ee=>{g=!0,t.history.go(ee)},createHref:ee=>d(ee),flush:_,destroy:()=>{t.history.pushState=n,t.history.replaceState=o,t.removeEventListener(nS,$,{capture:!0}),t.removeEventListener(tS,D)},onBlocked:()=>{y&&p!==y&&(p=y)},getBlockers:c,setBlockers:l,notifyOnIndexChange:!1});return t.addEventListener(nS,$,{capture:!0}),t.addEventListener(tS,D),t.history.pushState=function(...ee){const ne=n.apply(t.history,ee);return N._ignoreSubscribers||C("PUSH"),ne},t.history.replaceState=function(...ee){const ne=o.apply(t.history,ee);return N._ignoreSubscribers||C("REPLACE"),ne},N}function gP(e){const t=typeof document<"u"?window:void 0;return Bw({window:t,parseLocation:()=>{const n=t.location.hash.split("#").slice(1),o=n[0]??"/",i=t.location.search,c=n.slice(1);return Oa(`${o}${i}${c.length===0?"":`#${c.join("#")}`}`,t.history.state)},createHref:n=>`${t.location.pathname}${t.location.search}#${n}`})}function yP(e){let t=e.replace(/[\x00-\x1f\x7f]/g,"");return t.startsWith("//")&&(t="/"+t.replace(/^\/+/,"")),t}function Oa(e,t){const n=yP(e),o=n.indexOf("#"),i=n.indexOf("?"),c=gp();return{href:n,pathname:n.substring(0,o>0?i>0?Math.min(o,i):o:i>0?i:n.length),hash:o>-1?n.substring(o):"",search:i>-1?n.slice(i,o===-1?void 0:o):"",state:t||{[xs]:0,key:c,__TSR_key:c}}}function gp(){return(Math.random()+1).toString(36).substring(7)}function si(e,t){const n=t,o=e;return{fromLocation:n,toLocation:o,pathChanged:(n==null?void 0:n.pathname)!==o.pathname,hrefChanged:(n==null?void 0:n.href)!==o.href,hashChanged:(n==null?void 0:n.hash)!==o.hash}}const dm=new WeakMap;var vP=class{constructor(e,t){this.tempLocationKey=`${Math.round(Math.random()*1e7)}`,this._scroll={next:!0},this.shouldViewTransition=void 0,this.isViewTransitionTypesSupported=void 0,this.subscribers=new Set,this.routeBranchCache=new WeakMap,this.startTransition=n=>n(),this.update=n=>{var y;const o=this.options,i=this.basepath??(o==null?void 0:o.basepath)??"/",c=this.basepath===void 0,l=o==null?void 0:o.rewrite;if(this.options={...o,...n},this.isServer=this.options.isServer??typeof document>"u",this.protocolAllowlist=new Set(this.options.protocolAllowlist),this.options.pathParamsAllowedCharacters&&(this.pathParamsDecoder=X2(this.options.pathParamsAllowedCharacters)),(!this.history||this.options.history&&this.options.history!==this.history)&&(this.options.history?this.history=this.options.history:this.history=Bw()),this.origin=this.options.origin,this.origin||(window!=null&&window.origin&&window.origin!=="null"?this.origin=window.origin:this.origin="http://localhost"),this.history&&this.updateLatestLocation(),this.options.routeTree!==this.routeTree){this.routeTree=this.options.routeTree;let g;this.resolvePathCache=Aa(1e3),g=this.buildRouteTree(),this.setRoutes(g)}if(!this.stores&&this.latestLocation){const g=this.getStoreConfig(this);this.batch=g.batch,this.stores=mP(xP(this.latestLocation),g),TP(this)}let d=!1;const h=this.options.basepath??"/",p=this.options.rewrite;if(c||i!==h||l!==p){this.basepath=h;const g=[],v=Ow(h);v&&v!=="/"&&g.push(hP({basepath:h})),p&&g.push(p),this.rewrite=g.length===0?void 0:g.length===1?g[0]:dP(g),this.history&&this.updateLatestLocation(),d=!0}d&&this.stores&&this.stores.location.set(this.latestLocation),typeof window<"u"&&"CSS"in window&&typeof((y=window.CSS)==null?void 0:y.supports)=="function"&&(this.isViewTransitionTypesSupported=window.CSS.supports("selector(:active-view-transition-type(a))"))},this.updateLatestLocation=()=>{this.latestLocation=this.parseLocation(this.history.location,this.latestLocation)},this.buildRouteTree=()=>{const n=H2(this.routeTree,this.options.caseSensitive,(o,i)=>{o.init({originalIndex:i})});return this.options.routeMasks&&B2(this.options.routeMasks,n.processedTree),n},this.subscribe=(n,o)=>{const i={eventType:n,fn:o};return this.subscribers.add(i),()=>{this.subscribers.delete(i)}},this.emit=n=>{this.subscribers.forEach(o=>{o.eventType===n.type&&o.fn(n)})},this.parseLocation=(n,o)=>{const i=({pathname:h,search:p,hash:y,href:g,state:v})=>{if(!this.rewrite&&!/[ \x00-\x1f\x7f\u0080-\uffff]/.test(h)){const K=this.options.parseSearch(p),_=this.options.stringifySearch(K);return{href:h+_+y,publicHref:h+_+y,pathname:da(h).path,external:!1,searchStr:_,search:Qs(o==null?void 0:o.search,K),hash:da(y.slice(1)).path,state:Zs(o==null?void 0:o.state,v)}}const w=new URL(g,this.origin),S=fm(this.rewrite,w),E=this.options.parseSearch(S.search),F=this.options.stringifySearch(E);return S.search=F,{href:S.href.replace(S.origin,""),publicHref:g,pathname:da(S.pathname).path,external:!!this.rewrite&&S.origin!==this.origin,searchStr:F,search:Qs(o==null?void 0:o.search,E),hash:da(S.hash.slice(1)).path,state:Zs(o==null?void 0:o.state,v)}},c=i(n),{__tempLocation:l,__tempKey:d}=c.state;if(l&&(!d||d===this.tempLocationKey)){const h=i(l);return h.state.key=c.state.key,h.state.__TSR_key=c.state.__TSR_key,delete h.state.__tempLocation,{...h,maskedLocation:c}}return c},this.resolvePathWithBase=(n,o)=>Y2({base:n,to:o.includes("//")?pp(o):o,trailingSlash:this.options.trailingSlash,cache:this.resolvePathCache}),this.matchRoutes=(n,o,i)=>typeof n=="string"?this.matchRoutesInternal({pathname:n,search:o},i):this.matchRoutesInternal(n,o),this.getMatchedRoutes=n=>wP({pathname:n,routesById:this.routesById,processedTree:this.processedTree}),this.cancelMatch=n=>{const o=this.getMatch(n);o&&(o.abortController.abort(),clearTimeout(o._nonReactive.pendingTimeout),o._nonReactive.pendingTimeout=void 0)},this.cancelMatches=()=>{this.stores.pendingIds.get().forEach(n=>{this.cancelMatch(n)}),this.stores.matchesId.get().forEach(n=>{var i;if(this.stores.pendingMatchStores.has(n))return;const o=(i=this.stores.matchStores.get(n))==null?void 0:i.get();o&&(o.status==="pending"||o.isFetching==="loader")&&this.cancelMatch(n)})},this.buildLocation=n=>{const o=(c={})=>{var ne,H;const l=c._fromLocation||this.pendingBuiltLocation||this.latestLocation,d=this.matchRoutesLightweight(l);c.from;const h=c.unsafeRelative==="path"?l.pathname:c.from??d.fullPath,p=c.to?`${c.to}`:void 0,y=d.search,g=Object.assign(Object.create(null),d.params),v=(p==null?void 0:p.charCodeAt(0))===47?"/":this.resolvePathWithBase(h,"."),w=p?this.resolvePathWithBase(v,p):v,S=c.params===!1||c.params===null?Object.create(null):(c.params??!0)===!0?g:Object.assign(g,Xs(c.params,g)),E=this.routesByPath[Br(w)];let F;if(E)F=this.getRouteBranch(E);else if(w.includes("$"))F=[];else{const k=this.getMatchedRoutes(w);F=k.matchedRoutes,this.options.notFoundRoute&&(!k.foundRoute||k.foundRoute.path!=="/"&&k.routeParams["**"])&&(F=[...F,this.options.notFoundRoute])}if(F.length&&Iw(S))for(const k of F){const U=((ne=k.options.params)==null?void 0:ne.stringify)??k.options.stringifyParams;if(U)try{Object.assign(S,U(S))}catch{}}const K=n.leaveParams?w:da(Qv({path:w,params:S,decoder:this.pathParamsDecoder,server:this.isServer}).interpolatedPath).path;let _=y;if(n._includeValidateSearch&&((H=this.options.search)!=null&&H.strict)){const k={};F.forEach(U=>{if(U.options.validateSearch)try{Object.assign(k,Bu(U.options.validateSearch,{...k,..._}))}catch{}}),_=k}_=kP({search:_,dest:c,destRoutes:F,_includeValidateSearch:n._includeValidateSearch}),_=Qs(y,_);const L=this.options.stringifySearch(_),C=c.hash===!0?l.hash:c.hash?Xs(c.hash,l.hash):void 0,D=C?`#${C}`:"";let $=c.state===!0?l.state:c.state?Xs(c.state,l.state):{};$=Zs(l.state,$);const N=`${K}${L}${D}`;let T,q,ee=!1;if(this.rewrite){const k=new URL(N,this.origin),U=Uw(this.rewrite,k);T=k.href.replace(k.origin,""),U.origin!==this.origin?(q=U.href,ee=!0):q=U.pathname+U.search+U.hash}else T=j2(N),q=T;return{publicHref:q,href:T,pathname:K,search:_,searchStr:L,state:$,hash:C??"",external:ee,unmaskOnReload:c.unmaskOnReload}},i=(c={},l)=>{const d=o(c);let h=l?o(l):void 0;if(!h){const p=Object.create(null);if(this.options.routeMasks){const y=z2(d.pathname,this.processedTree);if(y){Object.assign(p,y.rawParams);const{from:g,params:v,...w}=y.route,S=v===!1||v===null?Object.create(null):(v??!0)===!0?p:Object.assign(p,Xs(v,p));l={from:n.from,...w,params:S},h=o(l)}}}return h&&(d.maskedLocation=h),d};return n.mask?i(n,{from:n.from,...n.mask}):i(n)},this.commitLocation=async({viewTransition:n,ignoreBlocker:o,...i})=>{let c;const l=()=>{const p=["key","__TSR_key","__TSR_index","__hashScrollIntoViewOptions"];p.forEach(g=>{i.state[g]=this.latestLocation.state[g]});const y=no(i.state,this.latestLocation.state);return p.forEach(g=>{delete i.state[g]}),y},d=Br(this.latestLocation.href)===Br(i.href);let h=this.commitLocationPromise;if(this.commitLocationPromise=ui(()=>{h==null||h.resolve(),h=void 0}),d&&l())this.load();else{let{maskedLocation:p,hashScrollIntoView:y,...g}=i;p&&(g={...p,state:{...p.state,__tempKey:void 0,__tempLocation:{...g,search:g.searchStr,state:{...g.state,__tempKey:void 0,__tempLocation:void 0,__TSR_key:void 0,key:void 0}}}},(g.unmaskOnReload??this.options.unmaskOnReload??!1)&&(g.state.__tempKey=this.tempLocationKey)),g.state.__hashScrollIntoViewOptions=y??this.options.defaultHashScrollIntoView??!0,this.shouldViewTransition=n,c=i.replace?"REPLACE":"PUSH",this.history[c==="REPLACE"?"replace":"push"](g.publicHref,g.state,{ignoreBlocker:o})}return this._scroll.next=i.resetScroll??!0,this.history.subscribers.size||this.load(c?{action:{type:c}}:void 0),this.commitLocationPromise},this.buildAndCommitLocation=({replace:n,resetScroll:o,hashScrollIntoView:i,viewTransition:c,ignoreBlocker:l,href:d,...h}={})=>{if(d){const g=this.history.location.state.__TSR_index,v=Oa(d,{__TSR_index:n?g:g+1}),w=new URL(v.pathname,this.origin);h.to=fm(this.rewrite,w).pathname,h.search=this.options.parseSearch(v.search),h.hash=v.hash.slice(1)}const p=this.buildLocation({...h,_includeValidateSearch:!0});this.pendingBuiltLocation=p;const y=this.commitLocation({...p,viewTransition:c,replace:n,resetScroll:o,hashScrollIntoView:i,ignoreBlocker:l});return Promise.resolve().then(()=>{this.pendingBuiltLocation===p&&(this.pendingBuiltLocation=void 0)}),y},this.navigate=async({to:n,reloadDocument:o,href:i,publicHref:c,...l})=>{var h,p;let d=!1;if(i)try{new URL(`${i}`),d=!0}catch{}if(d&&!o&&(o=!0),o){if(n!==void 0||!i){const g=this.buildLocation({to:n,...l});i=i??g.publicHref,c=c??g.publicHref}const y=!d&&c?c:i;if(tl(y,this.protocolAllowlist))return Promise.resolve();if(!l.ignoreBlocker){const g=((p=(h=this.history).getBlockers)==null?void 0:p.call(h))??[];for(const v of g)if(v!=null&&v.blockerFn&&await v.blockerFn({currentLocation:this.latestLocation,nextLocation:this.latestLocation,action:"PUSH"}))return Promise.resolve()}return l.replace?window.location.replace(y):window.location.href=y,Promise.resolve()}return this.buildAndCommitLocation({...l,href:i,to:n,_isNavigate:!0})},this.beforeLoad=()=>{this.cancelMatches(),this.updateLatestLocation();const n=this.matchRoutes(this.latestLocation),o=this.stores.cachedMatches.get().filter(i=>!n.some(c=>c.id===i.id));this.batch(()=>{this.stores.status.set("pending"),this.stores.statusCode.set(200),this.stores.isLoading.set(!0),this.stores.location.set(this.latestLocation),this.stores.setPending(n),this.stores.setCached(o)})},this.load=async n=>{var p;const o=(p=n==null?void 0:n.action)==null?void 0:p.type;let i,c,l;const d=this.stores.resolvedLocation.get()??this.stores.location.get();for(l=new Promise(y=>{this.startTransition(async()=>{var g;try{this.beforeLoad(),o?dm.set(this.latestLocation,o):dm.delete(this.latestLocation);const v=this.latestLocation,w=si(v,this.stores.resolvedLocation.get());this.stores.redirect.get()||this.emit({type:"onBeforeNavigate",...w}),this.emit({type:"onBeforeLoad",...w}),await Zv({router:this,sync:n==null?void 0:n.sync,forceStaleReload:d.href===v.href,matches:this.stores.pendingMatches.get(),location:v,updateMatch:this.updateMatch,onReady:async()=>{this.startTransition(()=>{this.startViewTransition(async()=>{var _,L;let S=null,E=null,F=null,K=null;this.batch(()=>{const C=this.stores.pendingMatches.get(),D=C.length,$=this.stores.matches.get();S=D?$.filter(q=>!this.stores.pendingMatchStores.has(q.id)):null;const N=new Set;for(const q of this.stores.pendingMatchStores.values())q.routeId&&N.add(q.routeId);const T=new Set;for(const q of this.stores.matchStores.values())q.routeId&&T.add(q.routeId);E=D?$.filter(q=>!N.has(q.routeId)):null,F=D?C.filter(q=>!T.has(q.routeId)):null,K=D?C.filter(q=>T.has(q.routeId)):$,this.stores.isLoading.set(!1),this.stores.loadedAt.set(Date.now()),D&&(this.stores.setMatches(C),this.stores.setPending([]),this.stores.setCached([...this.stores.cachedMatches.get(),...S.filter(q=>q.status!=="error"&&q.status!=="notFound"&&q.status!=="redirected")]),this.clearExpiredCache())});for(const[C,D]of[[E,"onLeave"],[F,"onEnter"],[K,"onStay"]])if(C)for(const $ of C)(L=(_=this.looseRoutesById[$.routeId].options)[D])==null||L.call(_,$)})})}})}catch(v){mn(v)?(i=v,this.navigate({...i.options,replace:!0,ignoreBlocker:!0})):Kt(v)&&(c=v);const w=i?i.status:c?404:this.stores.matches.get().some(S=>S.status==="error")?500:200;this.batch(()=>{this.stores.statusCode.set(w),this.stores.redirect.set(i)})}this.latestLoadPromise===l&&((g=this.commitLocationPromise)==null||g.resolve(),this.latestLoadPromise=void 0,this.commitLocationPromise=void 0),y()})}),this.latestLoadPromise=l,await l;this.latestLoadPromise&&l!==this.latestLoadPromise;)await this.latestLoadPromise;let h;this.hasNotFoundMatch()?h=404:this.stores.matches.get().some(y=>y.status==="error")&&(h=500),h!==void 0&&this.stores.statusCode.set(h)},this.startViewTransition=n=>{const o=this.shouldViewTransition??this.options.defaultViewTransition;if(this.shouldViewTransition=void 0,o&&typeof document<"u"&&"startViewTransition"in document&&typeof document.startViewTransition=="function"){let i;if(typeof o=="object"&&this.isViewTransitionTypesSupported){const c=this.latestLocation,l=this.stores.resolvedLocation.get(),d=typeof o.types=="function"?o.types(si(c,l)):o.types;if(d===!1){n();return}i={update:n,types:d}}else i=n;document.startViewTransition(i)}else n()},this.updateMatch=(n,o)=>{this.startTransition(()=>{const i=this.stores.pendingMatchStores.get(n);if(i){i.set(o);return}const c=this.stores.matchStores.get(n);if(c){c.set(o);return}const l=this.stores.cachedMatchStores.get(n);if(l){const d=o(l.get());d.status==="redirected"?this.stores.cachedMatchStores.delete(n)&&this.stores.cachedIds.set(h=>h.filter(p=>p!==n)):l.set(d)}})},this.getMatch=n=>{var o,i,c;return((o=this.stores.cachedMatchStores.get(n))==null?void 0:o.get())??((i=this.stores.pendingMatchStores.get(n))==null?void 0:i.get())??((c=this.stores.matchStores.get(n))==null?void 0:c.get())},this.invalidate=n=>{const o=i=>{var c;return((c=n==null?void 0:n.filter)==null?void 0:c.call(n,i))??!0?{...i,invalid:!0,...n!=null&&n.forcePending||i.status==="error"||i.status==="notFound"?{status:"pending",error:void 0}:void 0}:i};return this.batch(()=>{this.stores.setMatches(this.stores.matches.get().map(o)),this.stores.setCached(this.stores.cachedMatches.get().map(o)),this.stores.setPending(this.stores.pendingMatches.get().map(o))}),this.shouldViewTransition=!1,this.load({sync:n==null?void 0:n.sync})},this.getParsedLocationHref=n=>n.publicHref||"/",this.resolveRedirect=n=>{const o=n.headers.get("Location");if(!n.options.href||n.options._builtLocation){const i=n.options._builtLocation??this.buildLocation(n.options),c=this.getParsedLocationHref(i);n.options.href=c,n.headers.set("Location",c)}else if(o)try{const i=new URL(o);if(this.origin&&i.origin===this.origin){const c=i.pathname+i.search+i.hash;n.options.href=c,n.headers.set("Location",c)}}catch{}if(n.options.href&&!n.options._builtLocation&&tl(n.options.href,this.protocolAllowlist))throw new Error("Redirect blocked: unsafe protocol");return n.headers.get("Location")||n.headers.set("Location",n.options.href),n},this.clearCache=n=>{const o=n==null?void 0:n.filter;o!==void 0?this.stores.setCached(this.stores.cachedMatches.get().filter(i=>!o(i))):this.stores.setCached([])},this.clearExpiredCache=()=>{const n=Date.now(),o=i=>{const c=this.looseRoutesById[i.routeId];if(!c.options.loader)return!0;const l=(i.preload?c.options.preloadGcTime??this.options.defaultPreloadGcTime:c.options.gcTime??this.options.defaultGcTime)??300*1e3;return i.status==="error"?!0:n-i.updatedAt>=l};this.clearCache({filter:o})},this.loadRouteChunk=La,this.preloadRoute=async n=>{const o=n._builtLocation??this.buildLocation(n);let i=this.matchRoutes(o,{throwOnError:!0,preload:!0,dest:n});const c=new Set([...this.stores.matchesId.get(),...this.stores.pendingIds.get()]),l=new Set([...c,...this.stores.cachedIds.get()]),d=i.filter(h=>!l.has(h.id));if(d.length){const h=this.stores.cachedMatches.get();this.stores.setCached([...h,...d])}try{return i=await Zv({router:this,matches:i,location:o,preload:!0,updateMatch:(h,p)=>{c.has(h)?i=i.map(y=>y.id===h?p(y):y):this.updateMatch(h,p)}}),i}catch(h){if(mn(h))return h.options.reloadDocument?void 0:await this.preloadRoute({...h.options,_fromLocation:o});Kt(h)||console.error(h);return}},this.matchRoute=(n,o)=>{const i={...n,to:n.to?this.resolvePathWithBase(n.from||"",n.to):void 0,params:n.params||{},leaveParams:!0},c=this.buildLocation(i);if(o!=null&&o.pending&&this.stores.status.get()!=="pending")return!1;const l=((o==null?void 0:o.pending)===void 0?!this.stores.isLoading.get():o.pending)?this.latestLocation:this.stores.resolvedLocation.get()||this.stores.location.get(),d=V2(c.pathname,(o==null?void 0:o.caseSensitive)??!1,(o==null?void 0:o.fuzzy)??!1,l.pathname,this.processedTree);return!d||n.params&&!no(d.rawParams,n.params,{partial:!0})?!1:(o==null?void 0:o.includeSearch)??!0?no(l.search,c.search,{partial:!0})?d.rawParams:!1:d.rawParams},this.hasNotFoundMatch=()=>this.stores.matches.get().some(n=>n.status==="notFound"||n.globalNotFound),this.getStoreConfig=t,this.update({defaultPreloadDelay:50,defaultPendingMs:1e3,defaultPendingMinMs:500,context:void 0,...e,caseSensitive:e.caseSensitive??!1,notFoundMode:e.notFoundMode??"fuzzy",stringifySearch:e.stringifySearch??nP,parseSearch:e.parseSearch??tP,protocolAllowlist:e.protocolAllowlist??D2}),typeof document<"u"&&(self.__TSR_ROUTER__=this)}isShell(){return!!this.options.isShell}isPrerendering(){return!!this.options.isPrerendering}get state(){return this.stores.__store.get()}setRoutes({routesById:e,routesByPath:t,processedTree:n}){this.routesById=e,this.routesByPath=t,this.processedTree=n;const o=this.options.notFoundRoute;o&&(o.init({originalIndex:99999999999}),this.routesById[o.id]=o)}getRouteBranch(e){let t=this.routeBranchCache.get(e);return t||(t=Aw(e),this.routeBranchCache.set(e,t)),t}get looseRoutesById(){return this.routesById}getParentContext(e){return e!=null&&e.id?e.context??this.options.context??void 0:this.options.context??void 0}matchRoutesInternal(e,t){var y,g;const n=this.getMatchedRoutes(e.pathname),{foundRoute:o,routeParams:i}=n;let{matchedRoutes:c}=n,l=!1;(o?o.path!=="/"&&i["**"]:Br(e.pathname))&&(this.options.notFoundRoute?c=[...c,this.options.notFoundRoute]:l=!0);const d=l?_P(this.options.notFoundMode,c):void 0,h=new Array(c.length),p=new Map;for(const v of this.stores.matchStores.values())v.routeId&&p.set(v.routeId,v.get());for(let v=0;v<c.length;v++){const w=c[v],S=h[v-1];let E,F,K;{const U=(S==null?void 0:S.search)??e.search,V=(S==null?void 0:S._strictSearch)??void 0;try{const J=Bu(w.options.validateSearch,{...U})??void 0;E={...U,...J},F={...V,...J},K=void 0}catch(J){let B=J;if(J instanceof rl||(B=new rl(J.message,{cause:J})),t!=null&&t.throwOnError)throw B;E=U,F={},K=B}}const _=((g=(y=w.options).loaderDeps)==null?void 0:g.call(y,{search:E}))??"",L=_?JSON.stringify(_):"",{interpolatedPath:C,usedParams:D}=Qv({path:w.fullPath,params:i,decoder:this.pathParamsDecoder,server:this.isServer}),$=w.id+C+L,N=this.getMatch($),T=p.get(w.id),q=(N==null?void 0:N._strictParams)??D;let ee;if(!N)try{sS(w,q)}catch(U){if(Kt(U)||mn(U)?ee=U:ee=new SP(U.message,{cause:U}),t!=null&&t.throwOnError)throw ee}Object.assign(i,q);const ne=T?"stay":"enter";let H;if(N)H={...N,cause:ne,params:(T==null?void 0:T.params)??i,_strictParams:q,search:Qs(T?T.search:N.search,E),_strictSearch:F};else{const U=w.options.loader||w.options.beforeLoad||w.lazyFn||$w(w)?"pending":"success";H={id:$,ssr:w.options.ssr,index:v,routeId:w.id,params:(T==null?void 0:T.params)??i,_strictParams:q,pathname:C,updatedAt:Date.now(),search:T?Qs(T.search,E):E,_strictSearch:F,searchError:void 0,status:U,isFetching:!1,error:void 0,paramsError:ee,__routeContext:void 0,_nonReactive:{loadPromise:ui()},__beforeLoadContext:void 0,context:{},abortController:new AbortController,fetchCount:0,cause:ne,loaderDeps:T?Zs(T.loaderDeps,_):_,invalid:!1,preload:!1,links:void 0,scripts:void 0,headScripts:void 0,meta:void 0,staticData:w.options.staticData||{},fullPath:w.fullPath}}t!=null&&t.preload||(H.globalNotFound=d===w.id),H.searchError=K;const k=this.getParentContext(S);H.context={...k,...H.__routeContext,...H.__beforeLoadContext},h[v]=H}for(let v=0;v<h.length;v++){const w=h[v],S=this.looseRoutesById[w.routeId],E=this.getMatch(w.id),F=p.get(w.routeId);if(w.params=F?Qs(F.params,i):i,!E){const K=h[v-1],_=this.getParentContext(K);if(S.options.context){const L={deps:w.loaderDeps,params:w.params,context:_??{},location:e,navigate:C=>this.navigate({...C,_fromLocation:e}),buildLocation:this.buildLocation,cause:w.cause,abortController:w.abortController,preload:!!w.preload,matches:h,routeId:S.id};w.__routeContext=S.options.context(L)??void 0}w.context={..._,...w.__routeContext,...w.__beforeLoadContext}}}return h}matchRoutesLightweight(e){var p;const{matchedRoutes:t,routeParams:n}=this.getMatchedRoutes(e.pathname),o=Ta(t),i={...e.search};for(const y of t)try{Object.assign(i,Bu(y.options.validateSearch,i))}catch{}const c=Ta(this.stores.matchesId.get()),l=c&&((p=this.stores.matchStores.get(c))==null?void 0:p.get()),d=l&&l.routeId===o.id&&l.pathname===e.pathname;let h;if(d)h=l.params;else{const y=Object.assign(Object.create(null),n);for(const g of t)try{sS(g,y)}catch{}h=y}return{matchedRoutes:t,fullPath:o.fullPath,search:i,params:h}}},rl=class extends Error{},SP=class extends Error{};function xP(e){return{loadedAt:0,isLoading:!1,isTransitioning:!1,status:"idle",resolvedLocation:void 0,location:e,matches:[],statusCode:200}}function Bu(e,t){if(e==null)return{};if("~standard"in e){const n=e["~standard"].validate(t);if(n instanceof Promise)throw new rl("Async validation not supported");if(n.issues)throw new rl(JSON.stringify(n.issues,void 0,2),{cause:n});return n.value}return"parse"in e?e.parse(t):typeof e=="function"?e(t):{}}function wP({pathname:e,routesById:t,processedTree:n}){const o=Object.create(null),i=Br(e);let c;const l=q2(i,n,!0);return l&&(c=l.route,Object.assign(o,l.rawParams)),{matchedRoutes:(l==null?void 0:l.branch)||[t.__root__],routeParams:o,foundRoute:c}}function kP({search:e,dest:t,destRoutes:n,_includeValidateSearch:o}){return EP(n)(e,t,o??!1)}function EP(e){var c;let t,n;const o=[];for(const l of e){const d=l.options;if("search"in d)(c=d.search)!=null&&c.middlewares&&o.push(...d.search.middlewares);else if(d.preSearchFilters||d.postSearchFilters){const p=({search:y,next:g})=>{const v=g(d.preSearchFilters?d.preSearchFilters.reduce((w,S)=>S(w),y):y);return d.postSearchFilters?d.postSearchFilters.reduce((w,S)=>S(w),v):v};o.push(p)}const h=d.validateSearch;if(h){const p=({search:y,next:g,meta:v})=>{const w=g(y);if(n)try{const S=Bu(h,w);if(v&&S)for(const E in S)E in w||(v.defaulted||(v.defaulted=new Map)).set(E,S[E]);return{...w,...S}}catch{}return w};o.push(p)}}const i=(l,d,h)=>{if(l>=o.length){if(!t.search)return{};if(t.search===!0)return d;const y=Xs(t.search,d);return h&&(h.explicit=y),y}const p=(y,g)=>{if(g){const v=h||{};return{search:i(l+1,y,v),meta:v}}return i(l+1,y,h)};return o[l]({search:d,next:p,meta:h})};return function(d,h,p){return t=h,n=p,i(0,d)}}function _P(e,t){if(e!=="root")for(let n=t.length-1;n>=0;n--){const o=t[n];if(o.children)return o.id}return ro}function sS(e,t){var o;const n=((o=e.options.params)==null?void 0:o.parse)??e.options.parseParams;if(n){const i=n(t);if(i===!1)throw new Error("Route params.parse returned false for a matched route");Object.assign(t,i)}}function CP(){try{return sessionStorage}catch{return}}const bP="tsr-scroll-restoration-v1_3",oi=CP();function PP(){try{return JSON.parse((oi==null?void 0:oi.getItem("tsr-scroll-restoration-v1_3"))||"{}")}catch{return{}}}function FP(){try{oi==null||oi.setItem(bP,JSON.stringify(ms))}catch{}}const ms=PP(),oS="data-scroll-restoration-id",IP=e=>e.state.__TSR_key||e.href;function RP(e){const t=e.getAttribute(oS);if(t)return`[${oS}="${t}"]`;let n="",o=e,i;for(;i=o.parentNode;){let c=1,l=o;for(;l=l.previousElementSibling;)c++;const d=`${o.localName}:nth-child(${c})`;n=n?`${d} > ${n}`:d,o=i}return n}let Fu=!1;const ei="window";function hm(e){try{return typeof e=="function"?e():document.querySelector(e)}catch{}}function iS(e){const t=[];for(const n of e){if(n===ei)continue;const o=hm(n);o&&t.push(o)}return t}function TP(e,t){const n=e.options.scrollRestoration,o=e._scroll;n&&(o.restoring=!0);const i=e.options.getScrollRestorationKey||IP,c=new Map,l=(p,y,g)=>{const v=c.get(p)||{};v.scrollX=y,v.scrollY=g,c.set(p,v)},d=p=>{if(!(Fu||!o.restoring))if(p.target===document)l(ei,scrollX,scrollY);else{const y=p.target;l(y,y.scrollLeft,y.scrollTop)}},h=p=>{if(!o.restoring)return;const y=ms[p]||(ms[p]={});for(const[g,v]of c)g===ei?y[ei]=v:g.isConnected&&(y[RP(g)]=v)};n&&!o.restoration&&(o.restoration=!0,Fu=!1,history.scrollRestoration="manual",document.addEventListener("scroll",d,!0),e.subscribe("onBeforeLoad",p=>{p.fromLocation&&h(i(p.fromLocation)),c.clear()}),addEventListener("pagehide",()=>{h(i(e.stores.resolvedLocation.get()??e.stores.location.get())),FP()})),!o.reset&&(o.reset=!0,e.subscribe("onRendered",p=>{var F;const y=e.options.scrollRestorationBehavior,g=e.options.scrollToTopSelectors,v=o.next;let w;if(c.clear(),v||(o.next=!0),typeof e.options.scrollRestoration=="function"&&!e.options.scrollRestoration({location:e.latestLocation}))return;const S=i(p.toLocation),E=p.fromLocation&&i(p.fromLocation);if(o.restoring&&E&&E!==S){const K=ms[E];if(K){let _=ms[S];for(const L in K){if(L===ei){if(v)continue}else{const C=hm(L);if(!C||v&&g&&(w??(w=iS(g)),w.includes(C)))continue}_||(_=ms[S]={}),_[L]??(_[L]=K[L])}}}Fu=!0;try{const K=p.toLocation.hash,_=p.toLocation.state.__hashScrollIntoViewOptions??!0;let L=!1;if(v){const C=dm.get(p.toLocation),D=K&&_&&(C==="PUSH"||C==="REPLACE"),$=o.restoring?ms[S]:void 0;if($)for(const N in $){const{scrollX:T,scrollY:q}=$[N];if(N===ei){if(D)continue;scrollTo({top:q,left:T,behavior:y}),L=!0}else{const ee=hm(N);ee&&(ee.scrollLeft=T,ee.scrollTop=q)}}if(!L&&!K){const N={top:0,left:0,behavior:y};if(scrollTo(N),g){w??(w=iS(g));for(const T of w)T.scrollTo(N)}}}!L&&K&&_&&((F=document.getElementById(K))==null||F.scrollIntoView(_))}finally{Fu=!1}}))}const MP="Error preloading route! ☝️";var zw=class{get to(){return this._to}get id(){return this._id}get path(){return this._path}get fullPath(){return this._fullPath}constructor(e){if(this.init=t=>{var h,p;this.originalIndex=t.originalIndex;const n=this.options,o=!(n!=null&&n.path)&&!(n!=null&&n.id);this.parentRoute=(p=(h=this.options).getParentRoute)==null?void 0:p.call(h),o?this._path=ro:this.parentRoute||Vr();let i=o?ro:n==null?void 0:n.path;i&&i!=="/"&&(i=Lw(i));const c=(n==null?void 0:n.id)||i;let l=o?ro:$u([this.parentRoute.id==="__root__"?"":this.parentRoute.id,c]);i==="__root__"&&(i="/"),l!=="__root__"&&(l=$u(["/",l]));const d=l==="__root__"?"/":$u([this.parentRoute.fullPath,i]);this._path=i,this._id=l,this._fullPath=d,this._to=Br(d)},this.addChildren=t=>this._addFileChildren(t),this._addFileChildren=t=>(Array.isArray(t)&&(this.children=t),typeof t=="object"&&t!==null&&(this.children=Object.values(t)),this),this._addFileTypes=()=>this,this.updateLoader=t=>(Object.assign(this.options,t),this),this.update=t=>(Object.assign(this.options,t),this),this.lazy=t=>(this.lazyFn=t,this),this.redirect=t=>oP({from:this.fullPath,...t}),this.options=e||{},this.isRoot=!(e!=null&&e.getParentRoute),e!=null&&e.id&&(e!=null&&e.path))throw new Error("Route cannot have both an 'id' and a 'path' option.")}},AP=class extends zw{constructor(e){super(e)}};function yp(e){const t=e.errorComponent??vp;return P.jsx(LP,{getResetKey:e.getResetKey,onCatch:e.onCatch,children:({error:n,reset:o})=>n?Y.createElement(t,{error:n,reset:o}):e.children})}var LP=class extends Y.Component{constructor(...e){super(...e),this.state={error:null}}static getDerivedStateFromProps(e,t){const n=e.getResetKey();return t.error&&t.resetKey!==n?{resetKey:n,error:null}:{resetKey:n}}static getDerivedStateFromError(e){return{error:e}}reset(){this.setState({error:null})}componentDidCatch(e,t){this.props.onCatch&&this.props.onCatch(e,t)}render(){return this.props.children({error:this.state.error,reset:()=>{this.reset()}})}};function vp({error:e}){const[t,n]=Y.useState(!1);return P.jsxs("div",{style:{padding:".5rem",maxWidth:"100%"},children:[P.jsxs("div",{style:{display:"flex",alignItems:"center",gap:".5rem"},children:[P.jsx("strong",{style:{fontSize:"1rem"},children:"Something went wrong!"}),P.jsx("button",{style:{appearance:"none",fontSize:".6em",border:"1px solid currentColor",padding:".1rem .2rem",fontWeight:"bold",borderRadius:".25rem"},onClick:()=>n(o=>!o),children:t?"Hide Error":"Show Error"})]}),P.jsx("div",{style:{height:".25rem"}}),t?P.jsx("div",{children:P.jsx("pre",{style:{fontSize:".7em",border:"1px solid red",borderRadius:".25rem",padding:".3rem",color:"red",overflow:"auto"},children:e.message?P.jsx("code",{children:e.message}):null})}):null]})}function OP({children:e,fallback:t=null}){return Vw()?P.jsx(Ra.Fragment,{children:e}):P.jsx(Ra.Fragment,{children:t})}function Vw(){return Ra.useSyncExternalStore(NP,()=>!0,()=>!1)}function NP(){return()=>{}}var qw=Y.createContext(null);function Mn(e){return Y.useContext(qw)}var Ol=Y.createContext(void 0),DP=Y.createContext(void 0),tt=(e=>(e[e.None=0]="None",e[e.Mutable=1]="Mutable",e[e.Watching=2]="Watching",e[e.RecursedCheck=4]="RecursedCheck",e[e.Recursed=8]="Recursed",e[e.Dirty=16]="Dirty",e[e.Pending=32]="Pending",e))(tt||{});function jP({update:e,notify:t,unwatched:n}){return{link:o,unlink:i,propagate:c,checkDirty:l,shallowPropagate:d};function o(p,y,g){const v=y.depsTail;if(v!==void 0&&v.dep===p)return;const w=v!==void 0?v.nextDep:y.deps;if(w!==void 0&&w.dep===p){w.version=g,y.depsTail=w;return}const S=p.subsTail;if(S!==void 0&&S.version===g&&S.sub===y)return;const E=y.depsTail=p.subsTail={version:g,dep:p,sub:y,prevDep:v,nextDep:w,prevSub:S,nextSub:void 0};w!==void 0&&(w.prevDep=E),v!==void 0?v.nextDep=E:y.deps=E,S!==void 0?S.nextSub=E:p.subs=E}function i(p,y=p.sub){const g=p.dep,v=p.prevDep,w=p.nextDep,S=p.nextSub,E=p.prevSub;return w!==void 0?w.prevDep=v:y.depsTail=v,v!==void 0?v.nextDep=w:y.deps=w,S!==void 0?S.prevSub=E:g.subsTail=E,E!==void 0?E.nextSub=S:(g.subs=S)===void 0&&n(g),w}function c(p){let y=p.nextSub,g;e:do{const v=p.sub;let w=v.flags;if(w&60?w&12?w&4?!(w&48)&&h(p,v)?(v.flags=w|40,w&=1):w=0:v.flags=w&-9|32:w=0:v.flags=w|32,w&2&&t(v),w&1){const S=v.subs;if(S!==void 0){const E=(p=S).nextSub;E!==void 0&&(g={value:y,prev:g},y=E);continue}}if((p=y)!==void 0){y=p.nextSub;continue}for(;g!==void 0;)if(p=g.value,g=g.prev,p!==void 0){y=p.nextSub;continue e}break}while(!0)}function l(p,y){let g,v=0,w=!1;e:do{const S=p.dep,E=S.flags;if(y.flags&16)w=!0;else if((E&17)===17){if(e(S)){const F=S.subs;F.nextSub!==void 0&&d(F),w=!0}}else if((E&33)===33){(p.nextSub!==void 0||p.prevSub!==void 0)&&(g={value:p,prev:g}),p=S.deps,y=S,++v;continue}if(!w){const F=p.nextDep;if(F!==void 0){p=F;continue}}for(;v--;){const F=y.subs,K=F.nextSub!==void 0;if(K?(p=g.value,g=g.prev):p=F,w){if(e(y)){K&&d(F),y=p.sub;continue}w=!1}else y.flags&=-33;y=p.sub;const _=p.nextDep;if(_!==void 0){p=_;continue e}}return w}while(!0)}function d(p){do{const y=p.sub,g=y.flags;(g&48)===32&&(y.flags=g|16,(g&6)===2&&t(y))}while((p=p.nextSub)!==void 0)}function h(p,y){let g=y.depsTail;for(;g!==void 0;){if(g===p)return!0;g=g.prevDep}return!1}}function $P(e,t,n){var c,l,d;const o=typeof e=="object",i=o?e:void 0;return{next:(c=o?e.next:e)==null?void 0:c.bind(i),error:(l=o?e.error:t)==null?void 0:l.bind(i),complete:(d=o?e.complete:n)==null?void 0:d.bind(i)}}const mm=[];let zu=0;const{link:aS,unlink:UP,propagate:BP,checkDirty:Ww,shallowPropagate:cS}=jP({update(e){return e._update()},notify(e){mm[pm++]=e,e.flags&=~tt.Watching},unwatched(e){e.depsTail!==void 0&&(e.depsTail=void 0,e.flags=tt.Mutable|tt.Dirty,sl(e))}});let Iu=0,pm=0,yr,gm=0;function Hw(e){try{++gm,e()}finally{--gm||Kw()}}function sl(e){const t=e.depsTail;let n=t!==void 0?t.nextDep:e.deps;for(;n!==void 0;)n=UP(n,e)}function Kw(){if(!(gm>0)){for(;Iu<pm;){const e=mm[Iu];mm[Iu++]=void 0,e.notify()}Iu=0,pm=0}}function uS(e,t){const n=typeof e=="function",o=e,i={_snapshot:n?void 0:e,subs:void 0,subsTail:void 0,deps:void 0,depsTail:void 0,flags:n?tt.None:tt.Mutable,get(){return yr!==void 0&&aS(i,yr,zu),i._snapshot},subscribe(c){const l=$P(c),d={current:!1},h=zP(()=>{var p;i.get(),d.current?(p=l.next)==null||p.call(l,i._snapshot):d.current=!0});return{unsubscribe:()=>{h.stop()}}},_update(c){const l=yr,d=(t==null?void 0:t.compare)??Object.is;if(n)yr=i,++zu,i.depsTail=void 0;else if(c===void 0)return!1;n&&(i.flags=tt.Mutable|tt.RecursedCheck);try{const h=i._snapshot,p=typeof c=="function"?c(h):c===void 0&&n?o(h):c;return h===void 0||!d(h,p)?(i._snapshot=p,!0):!1}finally{yr=l,n&&(i.flags&=~tt.RecursedCheck),sl(i)}}};return n?(i.flags=tt.Mutable|tt.Dirty,i.get=function(){const c=i.flags;if(c&tt.Dirty||c&tt.Pending&&Ww(i.deps,i)){if(i._update()){const l=i.subs;l!==void 0&&cS(l)}}else c&tt.Pending&&(i.flags=c&~tt.Pending);return yr!==void 0&&aS(i,yr,zu),i._snapshot}):i.set=function(c){if(i._update(c)){const l=i.subs;l!==void 0&&(BP(l),cS(l),Kw())}},i}function zP(e){const t=()=>{const o=yr;yr=n,++zu,n.depsTail=void 0,n.flags=tt.Watching|tt.RecursedCheck;try{return e()}finally{yr=o,n.flags&=~tt.RecursedCheck,sl(n)}},n={deps:void 0,depsTail:void 0,subs:void 0,subsTail:void 0,flags:tt.Watching|tt.RecursedCheck,notify(){const o=this.flags;o&tt.Dirty||o&tt.Pending&&Ww(this.deps,this)?t():this.flags=tt.Watching},stop(){this.flags=tt.None,this.depsTail=void 0,sl(this)}};return t(),n}var _h={exports:{}},Ch={},bh={exports:{}},Ph={};/**
|
|
43
|
+
* @license React
|
|
44
|
+
* use-sync-external-store-shim.production.js
|
|
45
|
+
*
|
|
46
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
47
|
+
*
|
|
48
|
+
* This source code is licensed under the MIT license found in the
|
|
49
|
+
* LICENSE file in the root directory of this source tree.
|
|
50
|
+
*/var lS;function VP(){if(lS)return Ph;lS=1;var e=Ja();function t(g,v){return g===v&&(g!==0||1/g===1/v)||g!==g&&v!==v}var n=typeof Object.is=="function"?Object.is:t,o=e.useState,i=e.useEffect,c=e.useLayoutEffect,l=e.useDebugValue;function d(g,v){var w=v(),S=o({inst:{value:w,getSnapshot:v}}),E=S[0].inst,F=S[1];return c(function(){E.value=w,E.getSnapshot=v,h(E)&&F({inst:E})},[g,w,v]),i(function(){return h(E)&&F({inst:E}),g(function(){h(E)&&F({inst:E})})},[g]),l(w),w}function h(g){var v=g.getSnapshot;g=g.value;try{var w=v();return!n(g,w)}catch{return!0}}function p(g,v){return v()}var y=typeof window>"u"||typeof window.document>"u"||typeof window.document.createElement>"u"?p:d;return Ph.useSyncExternalStore=e.useSyncExternalStore!==void 0?e.useSyncExternalStore:y,Ph}var fS;function qP(){return fS||(fS=1,bh.exports=VP()),bh.exports}/**
|
|
51
|
+
* @license React
|
|
52
|
+
* use-sync-external-store-shim/with-selector.production.js
|
|
53
|
+
*
|
|
54
|
+
* Copyright (c) Meta Platforms, Inc. and affiliates.
|
|
55
|
+
*
|
|
56
|
+
* This source code is licensed under the MIT license found in the
|
|
57
|
+
* LICENSE file in the root directory of this source tree.
|
|
58
|
+
*/var dS;function WP(){if(dS)return Ch;dS=1;var e=Ja(),t=qP();function n(p,y){return p===y&&(p!==0||1/p===1/y)||p!==p&&y!==y}var o=typeof Object.is=="function"?Object.is:n,i=t.useSyncExternalStore,c=e.useRef,l=e.useEffect,d=e.useMemo,h=e.useDebugValue;return Ch.useSyncExternalStoreWithSelector=function(p,y,g,v,w){var S=c(null);if(S.current===null){var E={hasValue:!1,value:null};S.current=E}else E=S.current;S=d(function(){function K($){if(!_){if(_=!0,L=$,$=v($),w!==void 0&&E.hasValue){var N=E.value;if(w(N,$))return C=N}return C=$}if(N=C,o(L,$))return N;var T=v($);return w!==void 0&&w(N,T)?(L=$,N):(L=$,C=T)}var _=!1,L,C,D=g===void 0?null:g;return[function(){return K(y())},D===null?void 0:function(){return K(D())}]},[y,g,v,w]);var F=i(p,S[0],S[1]);return l(function(){E.hasValue=!0,E.value=F},[F]),h(F),F},Ch}var hS;function HP(){return hS||(hS=1,_h.exports=WP()),_h.exports}var KP=HP();function QP(e,t){return e===t}function en(e,t,n=QP){const o=Y.useCallback(l=>{if(!e)return()=>{};const{unsubscribe:d}=e.subscribe(l);return d},[e]),i=Y.useCallback(()=>e==null?void 0:e.get(),[e]);return KP.useSyncExternalStoreWithSelector(o,i,i,t,n)}var Fh={get(){},subscribe(){return{unsubscribe(){}}}};function Qw(e,t){const n=Y.useRef();return o=>{const i=e!=null&&e.select?e.select(o):o;return(e==null?void 0:e.structuralSharing)??t.options.defaultStructuralSharing?n.current=Zs(n.current,i):i}}function go(e){const t=Mn(),n=Y.useContext(e.from?DP:Ol),o=e.from?t.stores.getRouteMatchStore(e.from):t.stores.matchStores.get(n),i=Qw(e,t),c=en(o??Fh,l=>l?i(l):Fh);if(c!==Fh)return c;(e.shouldThrow??!0)&&Vr()}function Jw(e){return go({from:e.from,strict:e.strict,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.loaderData):t.loaderData})}function Gw(e){const{select:t,...n}=e;return go({...n,select:o=>t?t(o.loaderDeps):o.loaderDeps})}function Yw(e){return go({from:e.from,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,strict:e.strict,select:t=>{const n=e.strict===!1?t.params:t._strictParams;return e.select?e.select(n):n}})}function Xw(e){return go({from:e.from,strict:e.strict,shouldThrow:e.shouldThrow,structuralSharing:e.structuralSharing,select:t=>e.select?e.select(t.search):t.search})}function Zw(e){const t=Mn();return Y.useCallback(n=>t.navigate({...n,from:n.from??(e==null?void 0:e.from)}),[e==null?void 0:e.from,t])}function e1(e){return go({...e,select:t=>e.select?e.select(t.context):t.context})}var JP=kw();function GP(e,t){const n=Mn(),o=A2(t),{activeProps:i,inactiveProps:c,activeOptions:l,to:d,preload:h,preloadDelay:p,preloadIntentProximity:y,hashScrollIntoView:g,replace:v,startTransition:w,resetScroll:S,viewTransition:E,children:F,target:K,disabled:_,style:L,className:C,onClick:D,onBlur:$,onFocus:N,onMouseEnter:T,onMouseLeave:q,onTouchStart:ee,ignoreBlocker:ne,params:H,search:k,hash:U,state:V,mask:J,reloadDocument:B,unsafeRelative:X,from:re,_fromLocation:te,...I}=e,Z=Vw(),pe=Y.useMemo(()=>e,[n,e.from,e._fromLocation,e.hash,e.to,e.search,e.params,e.state,e.mask,e.unsafeRelative]),me=en(n.stores.location,Be=>Be,(Be,Lt)=>Be.href===Lt.href),le=Y.useMemo(()=>{const Be={_fromLocation:me,...pe};return n.buildLocation(Be)},[n,me,pe]),Fe=le.maskedLocation?le.maskedLocation.publicHref:le.publicHref,fe=le.maskedLocation?le.maskedLocation.external:le.external,ke=Y.useMemo(()=>nF(Fe,fe,n.history,_),[_,fe,Fe,n.history]),Pe=Y.useMemo(()=>{if(ke!=null&&ke.external)return tl(ke.href,n.protocolAllowlist)?void 0:ke.href;if(!rF(d)&&!(typeof d!="string"||d.indexOf(":")===-1))try{return new URL(d),tl(d,n.protocolAllowlist)?void 0:d}catch{}},[d,ke,n.protocolAllowlist]),Ve=Y.useMemo(()=>{if(Pe)return!1;if(l!=null&&l.exact){if(!G2(me.pathname,le.pathname,n.basepath))return!1}else{const Be=nl(me.pathname,n.basepath),Lt=nl(le.pathname,n.basepath);if(!(Be.startsWith(Lt)&&(Be.length===Lt.length||Be[Lt.length]==="/")))return!1}return((l==null?void 0:l.includeSearch)??!0)&&!no(me.search,le.search,{partial:!(l!=null&&l.exact),ignoreUndefined:!(l!=null&&l.explicitUndefined)})?!1:l!=null&&l.includeHash?Z&&me.hash===le.hash:!0},[l==null?void 0:l.exact,l==null?void 0:l.explicitUndefined,l==null?void 0:l.includeHash,l==null?void 0:l.includeSearch,me,Pe,Z,le.hash,le.pathname,le.search,n.basepath]),on=Ve?Xs(i,{})??YP:Ih,xn=Ve?Ih:Xs(c,{})??Ih,Fr=[C,on.className,xn.className].filter(Boolean).join(" "),Kr=(L||on.style||xn.style)&&{...L,...on.style,...xn.style},[gc,Ci]=Y.useState(!1),Eo=Y.useRef(!1),Ir=e.reloadDocument||Pe?!1:h??n.options.defaultPreload,Ls=p??n.options.defaultPreloadDelay??0,wn=Y.useCallback(()=>{n.preloadRoute({...pe,_builtLocation:le}).catch(Be=>{console.warn(Be),console.warn(MP)})},[n,pe,le]);M2(o,Y.useCallback(Be=>{Be!=null&&Be.isIntersecting&&wn()},[wn]),tF,{disabled:!!_||Ir!=="viewport"}),Y.useEffect(()=>{Eo.current||!_&&Ir==="render"&&(wn(),Eo.current=!0)},[_,wn,Ir]);const Qr=Be=>{const Lt=Be.currentTarget.getAttribute("target"),Kn=K!==void 0?K:Lt;if(!_&&!sF(Be)&&!Be.defaultPrevented&&(!Kn||Kn==="_self")&&Be.button===0){Be.preventDefault(),JP.flushSync(()=>{Ci(!0)});const Co=n.subscribe("onResolved",()=>{Co(),Ci(!1)});n.navigate({...pe,replace:v,resetScroll:S,hashScrollIntoView:g,startTransition:w,viewTransition:E,ignoreBlocker:ne})}};if(Pe)return{...I,ref:o,href:Pe,...F&&{children:F},...K&&{target:K},..._&&{disabled:_},...L&&{style:L},...C&&{className:C},...D&&{onClick:D},...$&&{onBlur:$},...N&&{onFocus:N},...T&&{onMouseEnter:T},...q&&{onMouseLeave:q},...ee&&{onTouchStart:ee}};const _o=Be=>{if(_||Ir!=="intent")return;if(!Ls){wn();return}const Lt=Be.currentTarget;if(ma.has(Lt))return;const Kn=setTimeout(()=>{ma.delete(Lt),wn()},Ls);ma.set(Lt,Kn)},yc=Be=>{_||Ir!=="intent"||wn()},bi=Be=>{if(_||!Ir||!Ls)return;const Lt=Be.currentTarget,Kn=ma.get(Lt);Kn&&(clearTimeout(Kn),ma.delete(Lt))};return{...I,...on,...xn,href:ke==null?void 0:ke.href,ref:o,onClick:Go([D,Qr]),onBlur:Go([$,bi]),onFocus:Go([N,_o]),onMouseEnter:Go([T,_o]),onMouseLeave:Go([q,bi]),onTouchStart:Go([ee,yc]),disabled:!!_,target:K,...Kr&&{style:Kr},...Fr&&{className:Fr},..._&&XP,...Ve&&ZP,...Z&&gc&&eF}}var Ih={},YP={className:"active"},XP={role:"link","aria-disabled":!0},ZP={"data-status":"active","aria-current":"page"},eF={"data-transitioning":"transitioning"},ma=new WeakMap,tF={rootMargin:"100px"},Go=e=>t=>{for(const n of e)if(n){if(t.defaultPrevented)return;n(t)}};function nF(e,t,n,o){if(!o)return t?{href:e,external:!0}:{href:n.createHref(e)||"/",external:!1}}function rF(e){if(typeof e!="string")return!1;const t=e.charCodeAt(0);return t===47?e.charCodeAt(1)!==47:t===46}var Sp=Y.forwardRef((e,t)=>{const{_asChild:n,...o}=e,{type:i,...c}=GP(o,t),l=typeof o.children=="function"?o.children({isActive:c["data-status"]==="active"}):o.children;if(!n){const{disabled:d,...h}=c;return Y.createElement("a",h,l)}return Y.createElement(n,c,l)});function sF(e){return!!(e.metaKey||e.altKey||e.ctrlKey||e.shiftKey)}var oF=class extends zw{constructor(e){super(e),this.useMatch=t=>go({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>e1({...t,from:this.id}),this.useSearch=t=>Xw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Yw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Gw({...t,from:this.id}),this.useLoaderData=t=>Jw({...t,from:this.id}),this.useNavigate=()=>Zw({from:this.fullPath}),this.Link=Ra.forwardRef((t,n)=>P.jsx(Sp,{ref:n,from:this.fullPath,...t}))}};function t1(e){return new oF(e)}var iF=class extends AP{constructor(e){super(e),this.useMatch=t=>go({select:t==null?void 0:t.select,from:this.id,structuralSharing:t==null?void 0:t.structuralSharing}),this.useRouteContext=t=>e1({...t,from:this.id}),this.useSearch=t=>Xw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useParams=t=>Yw({select:t==null?void 0:t.select,structuralSharing:t==null?void 0:t.structuralSharing,from:this.id}),this.useLoaderDeps=t=>Gw({...t,from:this.id}),this.useLoaderData=t=>Jw({...t,from:this.id}),this.useNavigate=()=>Zw({from:this.fullPath}),this.Link=Ra.forwardRef((t,n)=>P.jsx(Sp,{ref:n,from:this.fullPath,...t}))}};function aF(e){return new iF(e)}function cF(e){const t=Mn(),n=`not-found-${en(t.stores.location,o=>o.pathname)}-${en(t.stores.status,o=>o)}`;return P.jsx(yp,{getResetKey:()=>n,onCatch:(o,i)=>{var c;if(Kt(o))(c=e.onCatch)==null||c.call(e,o,i);else throw o},errorComponent:({error:o})=>{var i;if(Kt(o))return(i=e.fallback)==null?void 0:i.call(e,o);throw o},children:e.children})}function uF(){return P.jsx("p",{children:"Not Found"})}function ti(e){return P.jsx(P.Fragment,{children:e.children})}function n1(e,t,n){return t.options.notFoundComponent?P.jsx(t.options.notFoundComponent,{...n}):e.options.defaultNotFoundComponent?P.jsx(e.options.defaultNotFoundComponent,{...n}):P.jsx(uF,{})}function lF(e){return null}function fF(){return lF(Mn()),null}var dF=(e,t)=>e.routeId===t.routeId&&e._displayPending===t._displayPending,hF=(e,t)=>e[0]===t[0]&&e[1]===t[1],r1=Y.memo(function({matchId:t}){const n=Mn(),o=n.stores.matchStores.get(t);o||Vr();const i=en(n.stores.loadedAt,l=>l),c=en(o,l=>l,dF);return P.jsx(mF,{router:n,matchId:t,resetKey:i,matchState:Y.useMemo(()=>{var h;const l=c.routeId,d=(h=n.routesById[l].parentRoute)==null?void 0:h.id;return{routeId:l,ssr:c.ssr,_displayPending:c._displayPending,parentRouteId:d}},[c._displayPending,c.routeId,c.ssr,n.routesById])})});function mF({router:e,matchId:t,resetKey:n,matchState:o}){var S,E;const i=e.routesById[o.routeId],c=i.options.pendingComponent??e.options.defaultPendingComponent,l=c?P.jsx(c,{}):null,d=i.options.errorComponent??e.options.defaultErrorComponent,h=i.options.onCatch??e.options.defaultOnCatch,p=i.isRoot?i.options.notFoundComponent??((S=e.options.notFoundRoute)==null?void 0:S.options.component):i.options.notFoundComponent,y=o.ssr===!1||o.ssr==="data-only",g=(!i.isRoot||i.options.wrapInSuspense||y)&&(i.options.wrapInSuspense??c??(((E=i.options.errorComponent)==null?void 0:E.preload)||y))?Y.Suspense:ti,v=d?yp:ti,w=p?cF:ti;return P.jsxs(i.isRoot?i.options.shellComponent??ti:ti,{children:[P.jsx(Ol.Provider,{value:t,children:P.jsx(g,{fallback:l,children:P.jsx(v,{getResetKey:()=>n,errorComponent:d||vp,onCatch:(F,K)=>{if(Kt(F))throw F.routeId??(F.routeId=o.routeId),F;h==null||h(F,K)},children:P.jsx(w,{fallback:F=>{if(F.routeId??(F.routeId=o.routeId),!p||F.routeId&&F.routeId!==o.routeId||!F.routeId&&!i.isRoot)throw F;return Y.createElement(p,F)},children:y||o._displayPending?P.jsx(OP,{fallback:l,children:P.jsx(mS,{matchId:t})}):P.jsx(mS,{matchId:t})})})})}),o.parentRouteId===ro?P.jsxs(P.Fragment,{children:[P.jsx(pF,{}),e.options.scrollRestoration&&Pw?P.jsx(fF,{}):null]}):null]})}function pF(){const e=Mn(),t=Y.useRef();return Sa(()=>{const n=e.stores.resolvedLocation.get(),o=t.current;n&&(!o||o.href!==n.href)&&e.emit({type:"onRendered",...si(e.stores.location.get(),o??n)}),t.current=n},[en(e.stores.resolvedLocation,n=>n==null?void 0:n.state.__TSR_key),e]),null}var mS=Y.memo(function({matchId:t}){const n=Mn(),o=(y,g)=>{var v;return((v=n.getMatch(y.id))==null?void 0:v._nonReactive[g])??y._nonReactive[g]},i=n.stores.matchStores.get(t);i||Vr();const c=en(i,y=>y),l=c.routeId,d=n.routesById[l],h=Y.useMemo(()=>{var g;const y=(g=n.routesById[l].options.remountDeps??n.options.defaultRemountDeps)==null?void 0:g({routeId:l,loaderDeps:c.loaderDeps,params:c._strictParams,search:c._strictSearch});return y?JSON.stringify(y):void 0},[l,c.loaderDeps,c._strictParams,c._strictSearch,n.options.defaultRemountDeps,n.routesById]),p=Y.useMemo(()=>{const y=d.options.component??n.options.defaultComponent;return y?P.jsx(y,{},h):P.jsx(s1,{})},[h,d.options.component,n.options.defaultComponent]);if(c._displayPending)throw o(c,"displayPendingPromise");if(c._forcePending)throw o(c,"minPendingPromise");if(c.status==="pending"){const y=d.options.pendingMinMs??n.options.defaultPendingMinMs;if(y){const g=n.getMatch(c.id);if(g&&!g._nonReactive.minPendingPromise){const v=ui();g._nonReactive.minPendingPromise=v,setTimeout(()=>{v.resolve(),g._nonReactive.minPendingPromise=void 0},y)}}throw o(c,"loadPromise")}if(c.status==="notFound")return Kt(c.error)||Vr(),n1(n,d,c.error);if(c.status==="redirected")throw mn(c.error)||Vr(),o(c,"loadPromise");if(c.status==="error")throw c.error;return p}),s1=Y.memo(function(){const t=Mn(),n=Y.useContext(Ol);let o,i=!1,c;{const p=n?t.stores.matchStores.get(n):void 0;[o,i]=en(p,y=>[y==null?void 0:y.routeId,(y==null?void 0:y.globalNotFound)??!1],hF),c=en(t.stores.matchesId,y=>y[y.findIndex(g=>g===n)+1])}const l=o?t.routesById[o]:void 0,d=t.options.defaultPendingComponent?P.jsx(t.options.defaultPendingComponent,{}):null;if(i)return l||Vr(),n1(t,l,void 0);if(!c)return null;const h=P.jsx(r1,{matchId:c});return o===ro?P.jsx(Y.Suspense,{fallback:d,children:h}):h});function gF(){const e=Mn(),t=Y.useRef({router:e,mounted:!1}),[n,o]=Y.useState(!1),i=en(e.stores.isLoading,g=>g),c=en(e.stores.hasPending,g=>g),l=yh(i),d=i||n||c,h=yh(d),p=i||c,y=yh(p);return e.startTransition=g=>{o(!0),Y.startTransition(()=>{g(),o(!1)})},Y.useEffect(()=>{const g=e.history.subscribe(e.load),v=e.buildLocation({to:e.latestLocation.pathname,search:!0,params:!0,hash:!0,state:!0,_includeValidateSearch:!0});return Br(e.latestLocation.publicHref)!==Br(v.publicHref)&&e.commitLocation({...v,replace:!0}),()=>{g()}},[e,e.history]),Sa(()=>{if(typeof window<"u"&&e.ssr||t.current.router===e&&t.current.mounted)return;t.current={router:e,mounted:!0},(async()=>{try{await e.load()}catch(v){console.error(v)}})()},[e]),Sa(()=>{l&&!i&&e.emit({type:"onLoad",...si(e.stores.location.get(),e.stores.resolvedLocation.get())})},[l,e,i]),Sa(()=>{y&&!p&&e.emit({type:"onBeforeRouteMount",...si(e.stores.location.get(),e.stores.resolvedLocation.get())})},[p,y,e]),Sa(()=>{if(h&&!d){const g=si(e.stores.location.get(),e.stores.resolvedLocation.get());e.emit({type:"onResolved",...g}),Hw(()=>{e.stores.status.set("idle"),e.stores.resolvedLocation.set(e.stores.location.get())})}},[d,h,e]),null}function yF(){const e=Mn(),t=e.routesById[ro].options.pendingComponent??e.options.defaultPendingComponent,n=t?P.jsx(t,{}):null,o=P.jsxs(typeof document<"u"&&e.ssr?ti:Y.Suspense,{fallback:n,children:[P.jsx(gF,{}),P.jsx(vF,{})]});return e.options.InnerWrap?P.jsx(e.options.InnerWrap,{children:o}):o}function vF(){const e=Mn(),t=en(e.stores.firstId,i=>i),n=en(e.stores.loadedAt,i=>i),o=t?P.jsx(r1,{matchId:t}):null;return P.jsx(Ol.Provider,{value:t,children:e.options.disableGlobalCatchBoundary?o:P.jsx(yp,{getResetKey:()=>n,errorComponent:vp,onCatch:void 0,children:o})})}var SF=e=>({createMutableStore:uS,createReadonlyStore:uS,batch:Hw}),xF=e=>new wF(e),wF=class extends vP{constructor(e){super(e,SF)}};function kF({router:e,children:t,...n}){Iw(n)&&e.update({...e.options,...n,context:{...e.options.context,...n.context}});const o=P.jsx(qw.Provider,{value:e,children:t});return e.options.Wrap?P.jsx(e.options.Wrap,{children:o}):o}function EF({router:e,...t}){return P.jsx(kF,{router:e,...t,children:P.jsx(yF,{})})}function _F(e){const t=Mn({warn:(e==null?void 0:e.router)===void 0}),n=(e==null?void 0:e.router)||t;return en(n.stores.__store,Qw(e,n))}const Nl=["claude","codex","cursor","copilot","pi","opencode","antigravity","gemini","grok"],xp=["vscode","monokai","dracula","github","nord","one-dark-pro","solarized","tokyo-night","catppuccin","midnight","forest","sunset","cyberpunk","synthwave","luxury","minimal"],ym={vscode:{name:"VS Code",light:{name:"Light+",primary:"#007ACC",background:"#FFFFFF",foreground:"#333333",card:"#F3F3F3",cardForeground:"#1E1E1E",border:"#E5E5E5",accent:"#0066BF",accentForeground:"#FFFFFF",muted:"#F6F6F6",mutedForeground:"#6E6E6E"},dark:{name:"Dark+",primary:"#007ACC",background:"#1E1E1E",foreground:"#CCCCCC",card:"#252526",cardForeground:"#CCCCCC",border:"#3E3E42",accent:"#0E639C",accentForeground:"#FFFFFF",muted:"#2D2D30",mutedForeground:"#858585"}},monokai:{name:"Monokai",light:{name:"Monokai Light",primary:"#A6E22E",background:"#F8F8F2",foreground:"#272822",card:"#E6E6E0",cardForeground:"#272822",border:"#C4C4B8",accent:"#66D9EF",accentForeground:"#272822",muted:"#E6E6E0",mutedForeground:"#75715E"},dark:{name:"Monokai",primary:"#A6E22E",background:"#272822",foreground:"#F8F8F2",card:"#3E3D32",cardForeground:"#F8F8F2",border:"#75715E",accent:"#66D9EF",accentForeground:"#272822",muted:"#49483E",mutedForeground:"#75715E"}},dracula:{name:"Dracula",light:{name:"Dracula Light",primary:"#BD93F9",background:"#F8F8F2",foreground:"#282A36",card:"#E6E6E0",cardForeground:"#282A36",border:"#C4C4B8",accent:"#FF79C6",accentForeground:"#282A36",muted:"#E6E6E0",mutedForeground:"#6272A4"},dark:{name:"Dracula",primary:"#BD93F9",background:"#282A36",foreground:"#F8F8F2",card:"#343746",cardForeground:"#F8F8F2",border:"#44475A",accent:"#FF79C6",accentForeground:"#282A36",muted:"#44475A",mutedForeground:"#6272A4"}},github:{name:"GitHub",light:{name:"GitHub Light",primary:"#0969DA",background:"#FFFFFF",foreground:"#24292F",card:"#F6F8FA",cardForeground:"#24292F",border:"#D0D7DE",accent:"#0969DA",accentForeground:"#FFFFFF",muted:"#F6F8FA",mutedForeground:"#57606A"},dark:{name:"GitHub Dark",primary:"#58A6FF",background:"#0D1117",foreground:"#C9D1D9",card:"#161B22",cardForeground:"#C9D1D9",border:"#30363D",accent:"#1F6FEB",accentForeground:"#FFFFFF",muted:"#161B22",mutedForeground:"#8B949E"}},nord:{name:"Nord",light:{name:"Nord Light",primary:"#5E81AC",background:"#ECEFF4",foreground:"#2E3440",card:"#E5E9F0",cardForeground:"#2E3440",border:"#D8DEE9",accent:"#88C0D0",accentForeground:"#2E3440",muted:"#E5E9F0",mutedForeground:"#4C566A"},dark:{name:"Nord",primary:"#88C0D0",background:"#2E3440",foreground:"#D8DEE9",card:"#3B4252",cardForeground:"#E5E9F0",border:"#434C5E",accent:"#5E81AC",accentForeground:"#ECEFF4",muted:"#434C5E",mutedForeground:"#88C0D0"}},"one-dark-pro":{name:"One Dark Pro",light:{name:"One Light Pro",primary:"#528BFF",background:"#FAFAFA",foreground:"#383A42",card:"#F0F0F0",cardForeground:"#383A42",border:"#E0E0E0",accent:"#61AFEF",accentForeground:"#FAFAFA",muted:"#F0F0F0",mutedForeground:"#5C6370"},dark:{name:"One Dark Pro",primary:"#61AFEF",background:"#282C34",foreground:"#ABB2BF",card:"#2C313C",cardForeground:"#ABB2BF",border:"#3E4451",accent:"#528BFF",accentForeground:"#FFFFFF",muted:"#3E4451",mutedForeground:"#5C6370"}},solarized:{name:"Solarized",light:{name:"Solarized Light",primary:"#268BD2",background:"#FDF6E3",foreground:"#657B83",card:"#EEE8D5",cardForeground:"#586E75",border:"#93A1A1",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#FDF6E3",mutedForeground:"#839496"},dark:{name:"Solarized Dark",primary:"#268BD2",background:"#002B36",foreground:"#839496",card:"#073642",cardForeground:"#93A1A1",border:"#586E75",accent:"#2AA198",accentForeground:"#FDF6E3",muted:"#073642",mutedForeground:"#657B83"}},"tokyo-night":{name:"Tokyo Night",light:{name:"Tokyo Night Day",primary:"#2E7DE9",background:"#E1E2E7",foreground:"#343B58",card:"#D5D6DB",cardForeground:"#343B58",border:"#9699A3",accent:"#7AA2F7",accentForeground:"#343B58",muted:"#D5D6DB",mutedForeground:"#565F89"},dark:{name:"Tokyo Night",primary:"#7AA2F7",background:"#1A1B26",foreground:"#C0CAF5",card:"#24283B",cardForeground:"#C0CAF5",border:"#414868",accent:"#BB9AF7",accentForeground:"#1A1B26",muted:"#2F3549",mutedForeground:"#565F89"}},catppuccin:{name:"Catppuccin",light:{name:"Catppuccin Latte",primary:"#1E66F5",background:"#EFF1F5",foreground:"#4C4F69",card:"#E6E9EF",cardForeground:"#4C4F69",border:"#BCC0CC",accent:"#EA76CB",accentForeground:"#EFF1F5",muted:"#E6E9EF",mutedForeground:"#6C6F85"},dark:{name:"Catppuccin Mocha",primary:"#89B4FA",background:"#1E1E2E",foreground:"#CDD6F4",card:"#313244",cardForeground:"#CDD6F4",border:"#45475A",accent:"#F38BA8",accentForeground:"#1E1E2E",muted:"#313244",mutedForeground:"#6C7086"}},midnight:{name:"Midnight",light:{name:"Midnight Light",primary:"#3B82F6",background:"#F8FAFC",foreground:"#0F172A",card:"#E2E8F0",cardForeground:"#0F172A",border:"#CBD5E1",accent:"#1D4ED8",accentForeground:"#F8FAFC",muted:"#E2E8F0",mutedForeground:"#64748B"},dark:{name:"Midnight",primary:"#3B82F6",background:"#0F172A",foreground:"#F8FAFC",card:"#1E293B",cardForeground:"#F8FAFC",border:"#334155",accent:"#1D4ED8",accentForeground:"#FFFFFF",muted:"#1E293B",mutedForeground:"#94A3B8"}},forest:{name:"Forest",light:{name:"Forest Light",primary:"#22C55E",background:"#F0FDF4",foreground:"#052E16",card:"#DCFCE7",cardForeground:"#052E16",border:"#BBF7D0",accent:"#15803D",accentForeground:"#F0FDF4",muted:"#DCFCE7",mutedForeground:"#166534"},dark:{name:"Forest",primary:"#22C55E",background:"#052E16",foreground:"#DCFCE7",card:"#14532D",cardForeground:"#DCFCE7",border:"#166534",accent:"#15803D",accentForeground:"#FFFFFF",muted:"#14532D",mutedForeground:"#86EFAC"}},sunset:{name:"Sunset",light:{name:"Sunset Light",primary:"#F97316",background:"#FFF7ED",foreground:"#431407",card:"#FFEDD5",cardForeground:"#431407",border:"#FED7AA",accent:"#EA580C",accentForeground:"#FFF7ED",muted:"#FFEDD5",mutedForeground:"#9A3412"},dark:{name:"Sunset",primary:"#F97316",background:"#431407",foreground:"#FFEDD5",card:"#7C2D12",cardForeground:"#FFEDD5",border:"#9A3412",accent:"#EA580C",accentForeground:"#FFFFFF",muted:"#7C2D12",mutedForeground:"#FDBA74"}},cyberpunk:{name:"Cyberpunk",light:{name:"Cyberpunk Light",primary:"#F472B6",background:"#FFFFFF",foreground:"#000000",card:"#F3F4F6",cardForeground:"#000000",border:"#E5E7EB",accent:"#E879F9",accentForeground:"#000000",muted:"#F3F4F6",mutedForeground:"#22D3EE"},dark:{name:"Cyberpunk",primary:"#F472B6",background:"#000000",foreground:"#22D3EE",card:"#111111",cardForeground:"#E879F9",border:"#F472B6",accent:"#FFFF00",accentForeground:"#000000",muted:"#111111",mutedForeground:"#22D3EE"}},synthwave:{name:"Synthwave",light:{name:"Synthwave Light",primary:"#D946EF",background:"#FAF5FF",foreground:"#2A0A3B",card:"#F3E8FF",cardForeground:"#2A0A3B",border:"#E9D5FF",accent:"#06B6D4",accentForeground:"#FAF5FF",muted:"#F3E8FF",mutedForeground:"#C026D3"},dark:{name:"Synthwave",primary:"#D946EF",background:"#2A0A3B",foreground:"#F5D0FE",card:"#4A1D66",cardForeground:"#F5D0FE",border:"#C026D3",accent:"#06B6D4",accentForeground:"#FFFFFF",muted:"#4A1D66",mutedForeground:"#E879F9"}},luxury:{name:"Luxury",light:{name:"Luxury Light",primary:"#D4AF37",background:"#FAFAF9",foreground:"#1C1917",card:"#F5F5F4",cardForeground:"#1C1917",border:"#E7E5E4",accent:"#B45309",accentForeground:"#FAFAF9",muted:"#F5F5F4",mutedForeground:"#78716C"},dark:{name:"Luxury",primary:"#D4AF37",background:"#1C1917",foreground:"#E7E5E4",card:"#292524",cardForeground:"#D4AF37",border:"#78716C",accent:"#B45309",accentForeground:"#FFFFFF",muted:"#292524",mutedForeground:"#A8A29E"}},minimal:{name:"Minimal",light:{name:"Minimal",primary:"#18181B",background:"#FFFFFF",foreground:"#18181B",card:"#FFFFFF",cardForeground:"#18181B",border:"#E4E4E7",accent:"#F4F4F5",accentForeground:"#18181B",muted:"#FAFAFA",mutedForeground:"#71717A"},dark:{name:"Minimal Dark",primary:"#FAFAFA",background:"#18181B",foreground:"#FAFAFA",card:"#27272A",cardForeground:"#FAFAFA",border:"#3F3F46",accent:"#27272A",accentForeground:"#FAFAFA",muted:"#27272A",mutedForeground:"#A1A1AA"}}},wp=["tokmon","phosphor",...xp],o1=[...wp,"custom"],CF={vscode:"VS Code Light+ and Dark+",monokai:"Classic editor green and cyan",dracula:"Purple and pink on deep slate",github:"GitHub light and dark",nord:"Arctic blue-gray palette","one-dark-pro":"Atom-inspired editor palette",solarized:"Precision blue and teal","tokyo-night":"Cool blue and violet",catppuccin:"Latte and Mocha palettes",midnight:"Deep navy and bright blue",forest:"Natural green surfaces",sunset:"Warm orange and earth tones",cyberpunk:"Neon cyan, pink, and yellow",synthwave:"Purple and electric cyan",luxury:"Gold on warm neutrals",minimal:"High-contrast monochrome"},pS=[{id:"tokmon",name:"Tokmon",hint:"Calm system utility",darkOnly:!1,custom:!1},{id:"phosphor",name:"Phosphor",hint:"Black terminal green",darkOnly:!0,custom:!1},...xp.map(e=>({id:e,name:ym[e].name,hint:CF[e],darkOnly:!1,custom:!1})),{id:"custom",name:"Custom",hint:"Your shared palette",darkOnly:!1,custom:!0}];function bF(e){return typeof e=="string"&&o1.includes(e)}function PF(e){return typeof e=="string"&&wp.includes(e)}function FF(e){return pS.find(t=>t.id===e)??pS[0]}function i1(e){return FF(e).darkOnly}const IF=["canvas","panel","inset","insetStrong","chrome","line","lineStrong","lineFaint","text","textDim","textFaint","textStrong","accent","cost","positive"],ii=Object.freeze({version:1,mode:"auto",preset:"tokmon",terminal:"ansi"}),a1={canvas:"#0a0a0a",panel:"#101011",inset:"#161617",insetStrong:"#1d1d1e",chrome:"#1e1f22",line:"#262627",lineStrong:"#343435",lineFaint:"#1a1a1b",text:"#d4d6d6",textDim:"#8d9090",textFaint:"#585b5b",textStrong:"#f3f5f5",accent:"#79be7e",cost:"#d9c074",positive:"#6caa71",ok:"#79be7e",warn:"#e0b84c",crit:"#e5584b",unknown:"#8d9090"},c1={canvas:"#f4f5f5",panel:"#ffffff",inset:"#eceeee",insetStrong:"#e1e4e4",chrome:"#f4f5f5",line:"#d4d9d9",lineStrong:"#bcc2c2",lineFaint:"#e7eaea",text:"#2b2e2e",textDim:"#5a6060",textFaint:"#979d9d",textStrong:"#0d1010",accent:"#2f8f57",cost:"#9a7b1c",positive:"#2f8f57",ok:"#2f8f57",warn:"#9a7b1c",crit:"#b0403a",unknown:"#5a6060"},RF={canvas:"#000000",panel:"#050705",inset:"#0a0f0b",insetStrong:"#101710",chrome:"#070b08",line:"#1a2a1e",lineStrong:"#2c4634",lineFaint:"#101812",text:"#c6f7d3",textDim:"#7fc98d",textFaint:"#4c7d57",textStrong:"#eafff0",accent:"#35f38a",cost:"#ffd24a",positive:"#35f38a",ok:"#35f38a",warn:"#ffc44d",crit:"#ff6b5b",unknown:"#7fc98d"},TF={canvas:"#f3f5f0",panel:"#ffffff",inset:"#e8ede7",insetStrong:"#dce5dc",chrome:"#f3f5f0",line:"#cad7ca",lineStrong:"#a9bca9",lineFaint:"#e4ebe4",text:"#0b2610",textDim:"#426b49",textFaint:"#748c78",textStrong:"#031507",accent:"#128a2e",cost:"#826500",positive:"#128a2e",ok:"#128a2e",warn:"#826500",crit:"#b23a32",unknown:"#5c705f"},MF=/^#[0-9a-f]{6}$/i;function nr(e){return typeof e=="string"&&MF.test(e)?e.toLowerCase():null}function vm(e){return[Number.parseInt(e.slice(1,3),16),Number.parseInt(e.slice(3,5),16),Number.parseInt(e.slice(5,7),16)]}function Rh(e){return Math.round(Math.max(0,Math.min(255,e))).toString(16).padStart(2,"0")}function zr(e,t,n){const[o,i,c]=vm(e),[l,d,h]=vm(t),p=Math.max(0,Math.min(1,n));return`#${Rh(o+(l-o)*p)}${Rh(i+(d-i)*p)}${Rh(c+(h-c)*p)}`}function gS(e){const t=nr(e);if(!t)throw new TypeError("expected a #RRGGBB color");const n=vm(t).map(o=>{const i=o/255;return i<=.04045?i/12.92:((i+.055)/1.055)**2.4});return .2126*n[0]+.7152*n[1]+.0722*n[2]}function to(e,t){const n=gS(e),o=gS(t);return(Math.max(n,o)+.05)/(Math.min(n,o)+.05)}function jr(e,t,n,o){const i=nr(e);if(t.every(h=>to(i,h)>=n))return i;const c=[o,"#000000","#ffffff"].reduce((h,p)=>Math.min(...t.map(y=>to(p,y)))>Math.min(...t.map(y=>to(h,y)))?p:h);let l=0,d=1;for(let h=0;h<16;h++){const p=(l+d)/2,y=zr(i,c,p);t.every(g=>to(y,g)>=n)?d=p:l=p}return zr(i,c,d)}function yS(e,t){const n=nr(e.background),o=nr(e.card),i=nr(e.foreground),c=t==="dark"?"#ffffff":"#000000",l=jr(i,[n,o],4.5,c),d=jr(e.cardForeground,[n,o],4.5,c),h=jr(e.mutedForeground,[n],3,l),p=jr(e.primary,[n,o],3,l),y=jr(e.accent,[o],3,l),g=jr(e.primary,[o],3,l),v=t==="dark"?a1:c1;return{canvas:n,panel:o,inset:nr(e.muted),insetStrong:zr(e.muted,e.foreground,.08),chrome:n,line:nr(e.border),lineStrong:zr(e.border,e.foreground,.18),lineFaint:zr(e.background,e.border,.5),text:l,textDim:h,textFaint:nr(e.mutedForeground),textStrong:d,accent:p,cost:y,positive:g,ok:jr(v.ok,[o],3,l),warn:jr(v.warn,[o],3,l),crit:jr(v.crit,[o],3,l),unknown:h}}const AF=Object.fromEntries(xp.map(e=>[e,{light:yS(ym[e].light,"light"),dark:yS(ym[e].dark,"dark")}])),Sm={tokmon:{light:c1,dark:a1},phosphor:{light:TF,dark:RF},...AF},LF=[["text","canvas",4.5],["text","panel",4.5],["textStrong","canvas",4.5],["textStrong","panel",4.5],["textDim","canvas",3],["accent","canvas",3],["accent","panel",3],["cost","panel",3],["positive","panel",3],["ok","panel",3],["warn","panel",3],["crit","panel",3]];function u1(e){return LF.flatMap(([t,n,o])=>{const i=to(e[t],e[n]);return i+Number.EPSILON<o?[{foreground:t,background:n,minimum:o,actual:i}]:[]})}function xm(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function vS(e,t,n,o){if(!xm(e))return e!==void 0&&o.push(`custom.${t} was not an object`),{};const i={};for(const c of IF){if(!(c in e))continue;const l=nr(e[c]);l?i[c]=l:o.push(`custom.${t}.${c} was not a #RRGGBB color`)}for(;;){const c={...n,...i},l=u1(c)[0];if(!l)break;const d=l.foreground,h=l.background;if(d in i)delete i[d],o.push(`custom.${t}.${d} did not meet WCAG contrast`);else if(h in i)delete i[h],o.push(`custom.${t}.${h} did not meet WCAG contrast`);else break}return i}function l1(e){const t=[],n=xm(e)?e:{};n!==e&&e!==void 0&&t.push("appearance was not an object");const o=n.mode==="light"||n.mode==="dark"||n.mode==="auto"?n.mode:ii.mode;n.mode!==void 0&&n.mode!==o&&t.push("appearance.mode was invalid");const i=bF(n.preset)?n.preset:ii.preset;n.preset!==void 0&&n.preset!==i&&t.push("appearance.preset was invalid");const c=n.terminal==="dark"||n.terminal==="light"||n.terminal==="off"||n.terminal==="ansi"?n.terminal:ii.terminal;n.terminal!==void 0&&n.terminal!==c&&t.push("appearance.terminal was invalid"),n.version!==void 0&&n.version!==1&&t.push("appearance.version was invalid");let l;if(i==="custom"||n.custom!==void 0){const h=xm(n.custom)?n.custom:{};n.custom!==void 0&&h!==n.custom&&t.push("appearance.custom was not an object");const p=PF(h.base)?h.base:"tokmon";h.base!==void 0&&h.base!==p&&t.push("custom.base was invalid"),l={base:p,light:vS(h.light,"light",Sm[p].light,t),dark:vS(h.dark,"dark",Sm[p].dark,t)}}const d={version:1,mode:o,preset:i,terminal:c,...l?{custom:l}:{}};return{appearance:d,repaired:t.length>0||JSON.stringify(n)!==JSON.stringify(d),reasons:t}}function OF(e){return l1(e).appearance}function NF(e){return{...e,card:zr(e.panel,e.text,.06),cardHover:zr(e.panel,e.text,.1),divider:e.line,track:zr(e.panel,e.text,.1),accentTint:zr(e.panel,e.accent,.14),accentOn:to(e.accent,"#000000")>=to(e.accent,"#ffffff")?"#000000":"#ffffff",focusRing:e.accent}}function f1(e,t="dark"){var h,p;const n=OF(e),o=n.mode==="auto"?t:n.mode,i=i1(n.preset)?"dark":o,c=n.preset==="custom"?((h=n.custom)==null?void 0:h.base)??"tokmon":n.preset,l=Sm[c][i],d=n.preset==="custom"?((p=n.custom)==null?void 0:p[i])??{}:{};return{mode:i,tokens:NF({...l,...d})}}const d1=[7,14,30];function DF(e,t){const n=Array.isArray(e)?e:t&&typeof t=="string"&&t.trim()?[t]:[];return ol(n,2)}function ol(e,t){if(!Array.isArray(e))return[];const n=new Set,o=[];for(const i of e){if(typeof i!="string")continue;const c=i.trim();if(!(!c||n.has(c))&&(n.add(c),o.push(c),o.length>=t))break}return o}const jF=2;function $F(e,t,n=Number.POSITIVE_INFINITY){return ol(e.filter(o=>t.has(o)),n)}function T$(e,t,n,o=Number.POSITIVE_INFINITY){const i=$F(e,n,o);return i.includes(t)?i.filter(c=>c!==t):!n.has(t)||i.length>=o?i:[...i,t]}const tr={version:1,mode:"auto",elements:{providerMark:!0,value:!0,progress:!1},density:"comfortable",customSpacing:{edgePaddingPt:1,markValueGapPt:3,providerGapPt:8}},Dt={enabled:!0,menuBar:tr,showMenuBarText:!0,menuBarValue:"usage",displayMetric:"smartHeadroom",pollIntervalSec:30,activeTimeoutMin:10,graceMin:30,promotionHoldMin:5,lowWatermarkPct:20,criticalWatermarkPct:5,pinnedAccount:null,pins:[],pinnedProviders:[],launchAtLogin:!1,theme:"dark"},UF=32,kp={expandedProviders:[],graphRangeDays:14},Ep={enabled:!0,disabledProviders:[],excludedAccounts:[]},bn={revision:0,interval:2,billingInterval:5,clearScreen:!0,privacyMode:!0,privacyToggleKey:"p",timezone:null,accounts:[],activeAccountId:null,disabledProviders:[],onboarded:!1,dashboardLayout:"grid",defaultFocus:"all",ascii:"auto",allowNetworkAccess:!1,allowedHosts:[],resetDisplay:"relative",knownProviders:[],appearance:{...ii},accountDetection:{...Ep},tray:{...Dt},desktop:{...kp}},BF=["claude","codex","cursor"],Th=["cyan","magenta","green","yellow","blue","red"],SS=[...Nl],M$=["cyan","magenta","green","yellow","blue","red","cyanBright","magentaBright","greenBright"],Ru={claude:{name:"Claude",color:"green"},codex:{name:"Codex",color:"cyan"},cursor:{name:"Cursor",color:"magenta"},copilot:{name:"Copilot",color:"white"},pi:{name:"Pi",color:"blue"},opencode:{name:"opencode",color:"yellow"},antigravity:{name:"Antigravity",color:"red"},gemini:{name:"Gemini",color:"greenBright"},grok:{name:"Grok",color:"yellowBright"}},zF=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/i,VF=/[A-Z0-9._%+-]+@[A-Z0-9.-]+\.[A-Z]{2,}/gi;function qF(e){return typeof e=="string"&&zF.test(e)}function h1(e){return e.replace(VF,"[redacted]")}function A$(e,t=SS.filter(o=>!e.disabledProviders.includes(o)),n){const o=new Set(t),i=new Set,c=new Set,l=new Set,d=new Set,h=[],p=e.accountDetection.enabled,y=new Set(e.accountDetection.disabledProviders),g=(S,E)=>`${S}:${E&&E!=="~"?E:"~"}`,v=new Set(e.accountDetection.excludedAccounts.map(S=>g(S.providerId,S.homeDir))),w=S=>{l.add(S.id),d.add(g(S.providerId,S.homeDir)),h.push(S)};if(e.accounts.forEach((S,E)=>{const F=Ru[S.providerId];i.add(S.id),c.add(g(S.providerId,S.homeDir)),w({id:S.id,providerId:S.providerId,name:S.name,homeDir:S.homeDir||"~",color:S.color||F.color,source:"configured",explicitId:S.id,explicitIndex:E})}),n)for(const S of n){if(!p||y.has(S.providerId)||e.disabledProviders.includes(S.providerId))continue;const E=g(S.providerId,S.homeDir);if(v.has(E)||i.has(S.id)||c.has(E)||l.has(S.id)||d.has(E))continue;const F=Ru[S.providerId];w({id:S.id,providerId:S.providerId,name:S.name,homeDir:S.homeDir||"~",color:S.color||F.color,source:"auto"})}for(const S of SS){if(!p||y.has(S)||e.disabledProviders.includes(S)||!o.has(S))continue;const E=g(S,"~");if(v.has(E)||i.has(S)||c.has(E)||l.has(S)||d.has(E))continue;const F=Ru[S];w({id:S,providerId:S,name:F.name,homeDir:"~",color:F.color,source:"auto"})}for(const S of e.accountDetection.excludedAccounts){if(c.has(g(S.providerId,S.homeDir)))continue;const E=Ru[S.providerId];w({id:`ignored:${S.providerId}:${S.homeDir}`,providerId:S.providerId,name:`${E.name} account`,homeDir:S.homeDir,color:E.color,source:"ignored",excludedRef:S})}return h}function L$(e,t){return e.enabled&&!e.disabledProviders.includes(t)}function O$(e,t,n){const o=e.disabledProviders.filter(i=>i!==t);return{...e,knownProviders:e.knownProviders.includes(t)?e.knownProviders:[...e.knownProviders,t],disabledProviders:n?o:[...o,t]}}function N$(e,t,n){const o=e.disabledProviders.filter(i=>i!==t);return{...e,disabledProviders:n?o:[...o,t]}}function D$(e,t,n){const o=t.homeDir.trim()||"~",i=l=>l.providerId===t.providerId&&l.homeDir===o,c=e.excludedAccounts.filter(l=>!i(l));return{...e,excludedAccounts:n?[...c,{providerId:t.providerId,homeDir:o}]:c}}function xS(e,t,n){return typeof e=="number"&&Number.isFinite(e)&&e>=n?e:t}function Yo(e,t,n,o){return typeof e=="number"&&Number.isFinite(e)&&e>=n&&e<=o?e:t}function Mh(e,t,n,o){return typeof e!="number"||!Number.isFinite(e)?t:Math.min(o,Math.max(n,Math.round(e*2)/2))}function WF(e){try{return new Intl.DateTimeFormat("en-CA",{timeZone:e}),!0}catch{return!1}}function $n(e){return!!e&&typeof e=="object"&&!Array.isArray(e)}function pa(e){return Nl.includes(e)}function ga(e,t){try{return JSON.stringify(e)===JSON.stringify(t)}catch{return!1}}function HF(e,t=Dt.showMenuBarText){if(!$n(e))return{...tr,elements:{...tr.elements,value:t},customSpacing:{...tr.customSpacing}};const n=$n(e.elements)?e.elements:{},o=$n(e.customSpacing)?e.customSpacing:{};return{version:1,mode:e.mode==="custom"?"custom":"auto",elements:{providerMark:typeof n.providerMark=="boolean"?n.providerMark:tr.elements.providerMark,value:typeof n.value=="boolean"?n.value:tr.elements.value,progress:typeof n.progress=="boolean"?n.progress:tr.elements.progress},density:e.density==="compact"||e.density==="tight"?e.density:tr.density,customSpacing:{edgePaddingPt:Mh(o.edgePaddingPt,tr.customSpacing.edgePaddingPt,0,6),markValueGapPt:Mh(o.markValueGapPt,tr.customSpacing.markValueGapPt,0,8),providerGapPt:Mh(o.providerGapPt,tr.customSpacing.providerGapPt,0,16)}}}function KF(e){if(typeof e!="string")return null;const t=e.trim();if(!t)return null;try{const n=new URL(`http://${t}`);if(n.username||n.password||n.port||n.pathname!=="/"||n.search||n.hash)return null;const o=n.hostname.toLowerCase().replace(/\.$/,"");return!o||o.length>253||o.includes("*")||o.split(".").some(c=>!c||c.length>63||!/^[a-z0-9](?:[a-z0-9-]*[a-z0-9])?$/.test(c))?null:o}catch{return null}}function QF(e){if(!Array.isArray(e))return[];const t=e.map(KF).filter(n=>n!==null);return[...new Set(t)]}function m1(e){const t=[],n=$n(e)?e:{};n!==e&&t.push("config root was not an object");const o=Array.isArray(n.accounts)?n.accounts:[];!Array.isArray(n.accounts)&&n.accounts!==void 0&&t.push("accounts was not an array");const i=[],c=new Set;o.forEach((T,q)=>{if(!$n(T)){t.push(`accounts[${q}] was not an object`);return}const ee=T.providerId??"claude";if(!pa(ee)){t.push(`accounts[${q}].providerId was invalid`);return}const ne=typeof T.id=="string"&&T.id.trim()?T.id.trim():"",H=typeof T.name=="string"&&T.name.trim()?T.name.trim():"";if(!ne||!H){t.push(`accounts[${q}] was missing id or name`);return}if(c.has(ne)){t.push(`accounts[${q}].id was duplicated`);return}c.add(ne),i.push({id:ne,providerId:ee,name:H,homeDir:typeof T.homeDir=="string"&&T.homeDir.trim()?T.homeDir:"~",...typeof T.color=="string"&&T.color.trim()?{color:T.color}:{}})});const l=(Array.isArray(n.disabledProviders)?n.disabledProviders:[]).filter(pa);n.disabledProviders!==void 0&&!Array.isArray(n.disabledProviders)&&t.push("disabledProviders was not an array");const d=Array.isArray(n.knownProviders)?n.knownProviders.filter(pa):n.onboarded===!0?[...BF]:[];n.knownProviders!==void 0&&!Array.isArray(n.knownProviders)&&t.push("knownProviders was not an array");const h=QF(n.allowedHosts);n.allowedHosts!==void 0&&!ga(n.allowedHosts,h)&&t.push("allowedHosts contained invalid or duplicate hostnames");const p=l1(n.appearance);n.appearance!==void 0&&p.repaired&&t.push(...p.reasons);const y=$n(n.accountDetection)?n.accountDetection:{};n.accountDetection!==void 0&&!$n(n.accountDetection)&&t.push("accountDetection was not an object");const g=Array.isArray(y.disabledProviders)?[...new Set(y.disabledProviders.filter(pa))]:[],v=[],w=new Set;Array.isArray(y.excludedAccounts)?y.excludedAccounts.forEach((T,q)=>{if(!$n(T)||!pa(T.providerId)||typeof T.homeDir!="string"||!T.homeDir.trim()){t.push(`accountDetection.excludedAccounts[${q}] was invalid`);return}const ee=T.homeDir.trim(),ne=`${T.providerId}:${ee}`;w.has(ne)||(w.add(ne),v.push({providerId:T.providerId,homeDir:ee}))}):y.excludedAccounts!==void 0&&t.push("accountDetection.excludedAccounts was not an array");const S={enabled:typeof y.enabled=="boolean"?y.enabled:Ep.enabled,disabledProviders:g,excludedAccounts:v};n.accountDetection!==void 0&&!ga(n.accountDetection,S)&&t.push("accountDetection contained invalid settings");const E=$n(n.tray)?n.tray:{};n.tray!==void 0&&!$n(n.tray)&&t.push("tray was not an object");const F=typeof E.showMenuBarText=="boolean"?E.showMenuBarText:Dt.showMenuBarText,K=HF(E.menuBar,F),_={enabled:typeof E.enabled=="boolean"?E.enabled:Dt.enabled,menuBar:K,showMenuBarText:K.elements.value,menuBarValue:E.menuBarValue==="todayTokens"||E.menuBarValue==="usage"?E.menuBarValue:Dt.menuBarValue,displayMetric:E.displayMetric==="tightestRemaining"||E.displayMetric==="smartHeadroom"?E.displayMetric:Dt.displayMetric,pollIntervalSec:Yo(E.pollIntervalSec,Dt.pollIntervalSec,1,86400),activeTimeoutMin:Yo(E.activeTimeoutMin,Dt.activeTimeoutMin,1,1440),graceMin:Yo(E.graceMin,Dt.graceMin,1,10080),promotionHoldMin:Yo(E.promotionHoldMin,Dt.promotionHoldMin,0,1440),lowWatermarkPct:Yo(E.lowWatermarkPct,Dt.lowWatermarkPct,0,100),criticalWatermarkPct:Yo(E.criticalWatermarkPct,Dt.criticalWatermarkPct,0,100),pinnedAccount:typeof E.pinnedAccount=="string"&&E.pinnedAccount.trim()?E.pinnedAccount.trim():null,pins:DF(E.pins,typeof E.pinnedAccount=="string"?E.pinnedAccount:null),pinnedProviders:ol(E.pinnedProviders,jF),launchAtLogin:typeof E.launchAtLogin=="boolean"?E.launchAtLogin:Dt.launchAtLogin,theme:E.theme==="dark"?E.theme:Dt.theme};_.graceMin<_.activeTimeoutMin&&(_.graceMin=Math.max(Dt.graceMin,_.activeTimeoutMin)),_.criticalWatermarkPct>_.lowWatermarkPct&&(_.criticalWatermarkPct=Math.min(Dt.criticalWatermarkPct,_.lowWatermarkPct)),n.tray!==void 0&&!ga(n.tray,_)&&t.push("tray contained invalid settings");const L=$n(n.desktop)?n.desktop:{};n.desktop!==void 0&&!$n(n.desktop)&&t.push("desktop was not an object");const C={expandedProviders:ol(L.expandedProviders,UF),graphRangeDays:d1.includes(L.graphRangeDays)?L.graphRangeDays:kp.graphRangeDays};n.desktop!==void 0&&!ga(n.desktop,C)&&t.push("desktop contained invalid settings");const D=typeof n.activeAccountId=="string"&&(c.has(n.activeAccountId)||Nl.includes(n.activeAccountId))?n.activeAccountId:null;n.activeAccountId!==void 0&&n.activeAccountId!==null&&D===null&&t.push("activeAccountId did not match a known account/provider");const $=typeof n.timezone=="string"&&n.timezone.trim()&&WF(n.timezone.trim())?n.timezone.trim():null;n.timezone!==void 0&&n.timezone!==null&&$===null&&t.push("timezone was invalid");const N={...bn,revision:typeof n.revision=="number"&&Number.isSafeInteger(n.revision)&&n.revision>=0?n.revision:bn.revision,interval:xS(n.interval,bn.interval,1),billingInterval:xS(n.billingInterval,bn.billingInterval,1),clearScreen:typeof n.clearScreen=="boolean"?n.clearScreen:bn.clearScreen,privacyMode:typeof n.privacyMode=="boolean"?n.privacyMode:bn.privacyMode,privacyToggleKey:typeof n.privacyToggleKey=="string"&&n.privacyToggleKey.length===1?n.privacyToggleKey:bn.privacyToggleKey,timezone:$,accounts:i,activeAccountId:D,disabledProviders:l,onboarded:n.onboarded===!0,dashboardLayout:n.dashboardLayout==="single"?"single":"grid",defaultFocus:n.defaultFocus==="last"?"last":"all",ascii:n.ascii==="on"?"on":n.ascii==="off"?"off":"auto",allowNetworkAccess:n.allowNetworkAccess===!0,allowedHosts:h,resetDisplay:n.resetDisplay==="absolute"?"absolute":"relative",knownProviders:d,appearance:p.appearance,accountDetection:S,tray:_,desktop:C};for(const T of Object.keys(bn))T in n||t.push(`missing ${T}`);return{config:N,repaired:t.length>0||!ga(n,N),reasons:t}}function JF(e){try{return m1(e).config}catch{return{...bn,appearance:{...ii},accountDetection:{...Ep},tray:{...Dt},desktop:{...kp}}}}function GF(e){return e.trim().toLowerCase().replace(/[^a-z0-9]+/g,"_").replace(/^_+|_+$/g,"").slice(0,48)}function j$(e,t){const n=GF(e)||"account",o=new Set(t.map(i=>i.id));if(!o.has(n))return n;for(let i=2;i<1e3;i++){const c=`${n}_${i}`;if(!o.has(c))return c}return`${n}_${Date.now()}`}function $$(e){const t=new Set(e.map(n=>n.color).filter(Boolean));for(const n of Th)if(!t.has(n))return n;return Th[e.length%Th.length]}function U$(e){return e?e.replace(/\x1b\][\s\S]*?(?:\x07|\x1b\\)/g,"").replace(/\x1b\[[0-?]*[ -/]*[@-~]/g,"").replace(/\x1bO./g,"").replace(/\x1b/g,"").replace(/[\x00-\x1f\x7f-\x9f]/g,"").replace(/\[20[01]~/g,""):""}const YF=e=>Math.max(0,Math.min(100,e));function B$(e){return e===null||!Number.isFinite(e)?null:YF(100-e)}function z$(e){return e===null||!Number.isFinite(e)?"unknown":e<=10?"crit":e<=25?"warn":"ok"}function XF(e,t){const n=e.identity;return n?[n.title,n.subtitle].filter(i=>!!(i!=null&&i.trim())).filter((i,c,l)=>l.indexOf(i)===c).filter(i=>i.toLocaleLowerCase()!==t.toLocaleLowerCase()).join(" · ")||n.title||t:e.name||t}function V$(e,t,n,o){return n?{draft:e,revision:t,conflict:t!==null&&o.config.revision>t}:t!==null&&o.config.revision<t?{draft:e,revision:t,conflict:!1}:{draft:o.config,revision:o.config.revision,conflict:!1}}function _p(e){var t;if(e&&typeof e=="object"){const n=e;if(n.kind==="conflict"){const o=n.state,i=(t=o==null?void 0:o.config)==null?void 0:t.revision;return{message:typeof i=="number"?`configuration changed elsewhere (daemon revision ${i})`:"settings changed elsewhere; reload before saving",conflictState:o!=null&&o.config&&typeof i=="number"?o:null}}if(n.kind==="persistence"&&typeof n.message=="string")return{message:n.message,conflictState:null}}return{message:e instanceof Error?e.message:"config update failed",conflictState:null}}const $t=(e,t)=>{switch(t.length){case 0:return e;case 1:return t[0](e);case 2:return t[1](t[0](e));case 3:return t[2](t[1](t[0](e)));case 4:return t[3](t[2](t[1](t[0](e))));case 5:return t[4](t[3](t[2](t[1](t[0](e)))));case 6:return t[5](t[4](t[3](t[2](t[1](t[0](e))))));case 7:return t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))));case 8:return t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e))))))));case 9:return t[8](t[7](t[6](t[5](t[4](t[3](t[2](t[1](t[0](e)))))))));default:{let n=e;for(let o=0,i=t.length;o<i;o++)n=t[o](n);return n}}},ZF={pipe(){return $t(this,arguments)}},Dl=(function(){function e(){}return e.prototype=ZF,e})(),se=function(e,t){if(typeof e=="function")return function(){return e(arguments)?t.apply(this,arguments):n=>t(n,...arguments)};switch(e){case 0:case 1:throw new RangeError(`Invalid arity ${e}`);case 2:return function(n,o){return arguments.length>=2?t(n,o):function(i){return t(i,n)}};case 3:return function(n,o,i){return arguments.length>=3?t(n,o,i):function(c){return t(c,n,o)}};default:return function(){if(arguments.length>=e)return t.apply(this,arguments);const n=arguments;return function(o){return t(o,...n)}}}},Ie=e=>e,bs=e=>()=>e,Cp=bs(!0),p1=bs(!1),jl=bs(void 0),Ya=jl;function g1(e,t,n,o,i,c,l,d,h){switch(arguments.length){case 1:return e;case 2:return function(){return t(e.apply(this,arguments))};case 3:return function(){return n(t(e.apply(this,arguments)))};case 4:return function(){return o(n(t(e.apply(this,arguments))))};case 5:return function(){return i(o(n(t(e.apply(this,arguments)))))};case 6:return function(){return c(i(o(n(t(e.apply(this,arguments))))))};case 7:return function(){return l(c(i(o(n(t(e.apply(this,arguments)))))))};case 8:return function(){return d(l(c(i(o(n(t(e.apply(this,arguments))))))))};case 9:return function(){return h(d(l(c(i(o(n(t(e.apply(this,arguments)))))))))}}}function Ps(e){const t=new WeakMap;return n=>{if(t.has(n))return t.get(n);const o=e(n);return t.set(n,o),o}}const wm=e=>{const t=new Set(Reflect.ownKeys(e));if(e.constructor===Object)return t;e instanceof Error&&t.delete("stack");const n=Object.getPrototypeOf(e);let o=n;for(;o!==null&&o!==Object.prototype;){const i=Reflect.ownKeys(o);for(let c=0;c<i.length;c++)t.add(i[c]);o=Object.getPrototypeOf(o)}return t.has("constructor")&&typeof e.constructor=="function"&&n===e.constructor.prototype&&t.delete("constructor"),t},km=new WeakSet;function bp(e){return typeof e=="string"}function y1(e){return typeof e=="number"}function eI(e){return typeof e=="boolean"}function $l(e){return typeof e=="function"}function tI(e){return e!==void 0}function nI(e){return e!=null}function rI(e){return!1}function v1(e){return!0}function sI(e){return typeof e=="object"&&e!==null||$l(e)}const Ue=se(2,(e,t)=>sI(e)&&t in e);function oI(e){return Ue(e,Symbol.iterator)||bp(e)}const rn="~effect/interfaces/Hash",vt=e=>{switch(typeof e){case"number":return Pp(e);case"bigint":return Ft(e.toString(10));case"boolean":return Ft(String(e));case"symbol":return Ft(String(e));case"string":return Ft(e);case"undefined":return Ft("undefined");case"function":case"object":{if(e===null)return Ft("null");if(e instanceof Date)return Ft(e.toISOString());if(e instanceof RegExp)return Ft(e.toString());{if(km.has(e))return Em(e);if(Lh.has(e))return Lh.get(e);const t=lI(e,()=>iI(e)?e[rn]():typeof e=="function"?Em(e):Array.isArray(e)||ArrayBuffer.isView(e)?S1(e):e instanceof Map?cI(e):e instanceof Set?uI(e):Fp(e));return Lh.set(e,t),t}}default:throw new Error(`BUG: unhandled typeof ${typeof e} - please report an issue at https://github.com/Effect-TS/effect/issues`)}},Em=e=>(Ah.has(e)||Ah.set(e,Pp(Math.floor(Math.random()*Number.MAX_SAFE_INTEGER))),Ah.get(e)),sr=se(2,(e,t)=>e*53^t),Ul=e=>e&3221225471|e>>>1&1073741824,iI=e=>Ue(e,rn),Pp=e=>{if(e!==e)return Ft("NaN");if(e===1/0)return Ft("Infinity");if(e===-1/0)return Ft("-Infinity");let t=e|0;for(t!==e&&(t^=e*4294967295);e>4294967295;)t^=e/=4294967295;return Ul(t)},Ft=e=>{let t=5381,n=e.length;for(;n;)t=t*33^e.charCodeAt(--n);return Ul(t)},aI=(e,t)=>{let n=12289;for(const o of t)n^=sr(vt(o),vt(e[o]));return Ul(n)},Fp=e=>aI(e,wm(e)),Ip=(e,t)=>n=>{let o=e;for(const i of n)o^=t(i);return Ul(o)},S1=Ip(6151,vt),cI=Ip(Ft("Map"),([e,t])=>sr(vt(e),vt(t))),uI=Ip(Ft("Set"),vt),Ah=new WeakMap,Lh=new WeakMap,Oh=new WeakSet;function lI(e,t){if(Oh.has(e))return Ft("[Circular]");Oh.add(e);const n=t();return Oh.delete(e),n}const sn="~effect/interfaces/Equal";function Pn(){return arguments.length===1?e=>lo(e,arguments[0]):lo(arguments[0],arguments[1])}function lo(e,t){if(e===t)return!0;if(e==null||t==null)return!1;const n=typeof e;return n!==typeof t?!1:n==="number"&&e!==e&&t!==t?!0:n!=="object"&&n!=="function"||km.has(e)||km.has(t)?!1:hI(e,t,dI)}function fI(e,t,n){const o=Nh.has(e),i=Dh.has(t);if(o&&i)return!0;if(o||i)return!1;Nh.add(e),Dh.add(t);const c=n();return Nh.delete(e),Dh.delete(t),c}const Nh=new WeakSet,Dh=new WeakSet;function dI(e,t){if(vt(e)!==vt(t))return!1;if(e instanceof Date)return t instanceof Date?e.toISOString()===t.toISOString():!1;if(e instanceof RegExp)return t instanceof RegExp?e.toString()===t.toString():!1;const n=wS(e),o=wS(t);if(n!==o)return!1;const i=n&&o;return typeof e=="function"&&!i?!1:fI(e,t,()=>i?e[sn](t):Array.isArray(e)?!Array.isArray(t)||e.length!==t.length?!1:mI(e,t):ArrayBuffer.isView(e)?!ArrayBuffer.isView(t)||e.byteLength!==t.byteLength?!1:pI(e,t):e instanceof Map?!(t instanceof Map)||e.size!==t.size?!1:vI(e,t):e instanceof Set?!(t instanceof Set)||e.size!==t.size?!1:xI(e,t):gI(e,t))}function hI(e,t,n){let o=Tu.get(e);if(!o)o=new WeakMap,Tu.set(e,o);else if(o.has(t))return o.get(t);const i=n(e,t);o.set(t,i);let c=Tu.get(t);return c||(c=new WeakMap,Tu.set(t,c)),c.set(e,i),i}const Tu=new WeakMap;function mI(e,t){for(let n=0;n<e.length;n++)if(!lo(e[n],t[n]))return!1;return!0}function pI(e,t){if(e.length!==t.length)return!1;for(let n=0;n<e.length;n++)if(e[n]!==t[n])return!1;return!0}function gI(e,t){const n=wm(e),o=wm(t);if(n.size!==o.size)return!1;for(const i of n)if(!o.has(i)||!lo(e[i],t[i]))return!1;return!0}function yI(e,t){return function(o,i){for(const[c,l]of o){let d=!1;for(const[h,p]of i)if(e(c,h)&&t(l,p)){d=!0;break}if(!d)return!1}return!0}}const vI=yI(lo,lo);function SI(e){return function(n,o){for(const i of n){let c=!1;for(const l of o)if(e(i,l)){c=!0;break}if(!c)return!1}return!0}}const xI=SI(lo),wS=e=>Ue(e,sn),wI=()=>Pn,kI=e=>(t,n)=>t===n||e(t,n),EI=(e,t)=>e===t,_I=()=>EI;function CI(e){return kI((t,n)=>{if(t.length!==n.length)return!1;for(let o=0;o<t.length;o++)if(!e(t[o],n[o]))return!1;return!0})}const x1=e=>e.length>0,Bl=Symbol.for("~effect/Redactable"),bI=e=>Ue(e,Bl);function zl(e){return bI(e)?w1(e):e}function w1(e){var t;return e[Bl](((t=globalThis[Ca])==null?void 0:t.context)??PI)}const Ca="~effect/Fiber/currentFiber",PI={"~effect/Context":{},mapUnsafe:new Map,pipe(){return $t(this,arguments)}};function ht(e,t){const n=(t==null?void 0:t.space)??0,o=new WeakSet,i=n?typeof n=="number"?" ".repeat(n):n:"",c=p=>i.repeat(p),l=(p,y)=>{const g=p==null?void 0:p.constructor;return g&&g!==Object.prototype.constructor&&g.name?`${g.name}(${y})`:y},d=p=>{try{return Reflect.ownKeys(p)}catch{return["[ownKeys threw]"]}};function h(p,y=0){if(Array.isArray(p)){if(o.has(p))return kS;if(o.add(p),!i||p.length<=1)return`[${p.map(v=>h(v,y)).join(",")}]`;const g=p.map(v=>h(v,y+1)).join(`,
|
|
59
|
+
`+c(y+1));return`[
|
|
60
|
+
${c(y+1)}${g}
|
|
61
|
+
${c(y)}]`}if(p instanceof Date)return II(p);if(!(t!=null&&t.ignoreToString)&&Ue(p,"toString")&&typeof p.toString=="function"&&p.toString!==Object.prototype.toString&&p.toString!==Array.prototype.toString){const g=RI(p);return p instanceof Error&&p.cause?`${g} (cause: ${h(p.cause,y)})`:g}if(typeof p=="string")return JSON.stringify(p);if(typeof p=="number"||p==null||typeof p=="boolean"||typeof p=="symbol")return String(p);if(typeof p=="bigint")return String(p)+"n";if(typeof p=="object"||typeof p=="function"){if(o.has(p))return kS;if(o.add(p),Bl in p)return ht(w1(p));if(Symbol.iterator in p)return`${p.constructor.name}(${h(Array.from(p),y)})`;const g=d(p);if(!i||g.length<=1){const w=`{${g.map(S=>`${il(S)}:${h(p[S],y)}`).join(",")}}`;return l(p,w)}const v=`{
|
|
62
|
+
${g.map(w=>`${c(y+1)}${il(w)}: ${h(p[w],y+1)}`).join(`,
|
|
63
|
+
`)}
|
|
64
|
+
${c(y)}}`;return l(p,v)}return String(p)}return h(e,0)}const kS="[Circular]";function il(e){return typeof e=="string"?JSON.stringify(e):String(e)}function FI(e){return e.map(t=>`[${il(t)}]`).join("")}function II(e){try{return e.toISOString()}catch{return"Invalid Date"}}function RI(e){try{const t=e.toString();return typeof t=="string"?t:String(t)}catch{return"[toString threw]"}}function k1(e,t){let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&zl(c):c,t==null?void 0:t.space);return n=void 0,o}const fo=Symbol.for("nodejs.util.inspect.custom"),Xa=e=>{try{if(Ue(e,"toJSON")&&$l(e.toJSON)&&e.toJSON.length===0)return e.toJSON();if(Array.isArray(e))return e.map(Xa)}catch{return"[toJSON threw]"}return zl(e)},TI=(e,t=2)=>{if(typeof e=="string")return e;try{return typeof e=="object"?MI(e,t):String(e)}catch{return String(e)}},MI=(e,t)=>{let n=[];const o=JSON.stringify(e,(i,c)=>typeof c=="object"&&c!==null?n.includes(c)?void 0:n.push(c)&&zl(c):c,t);return n=void 0,o},ES={toJSON(){return Xa(this)},[fo](){return this.toJSON()},toString(){return ht(this.toJSON())}};class Vl{constructor(t){A(this,"called",!1);A(this,"self");this.self=t}next(t){return this.called?{value:t,done:!0}:(this.called=!0,{value:this.self,done:!1})}[Symbol.iterator](){return new Vl(this.self)}}const li="~effect/Utils/internal",E1={[li]:e=>e()},AI={[li]:e=>{try{return e()}finally{}}};var sw;const LI=((sw=E1[li](()=>new Error().stack))==null?void 0:sw.includes(li))===!0,tn=LI?E1[li]:AI[li],Fs="~effect/Effect",Na="~effect/Exit",OI={_A:Ie,_E:Ie,_R:Ie},_1=`${Fs}/identifier`,Me=`${Fs}/args`,Tt=`${Fs}/evaluate`,Fn=`${Fs}/successCont`,xr=`${Fs}/failureCont`,ho=`${Fs}/ensureCont`,Gs=Symbol.for("effect/Effect/Yield"),Is={pipe(){return $t(this,arguments)},toJSON(){return{...this}},toString(){return ht(this.toJSON(),{ignoreToString:!0,space:2})},[fo](){return this.toJSON()}},ql={[Symbol.iterator](){return new Vl(this)}},NI={...ql,pipe(){return $t(this,arguments)}},DI={[Fs]:OI,...Is,[Symbol.iterator](){return new Vl(this)},asEffect(){return this},toJSON(){return{_id:"Effect",op:this[_1],...Me in this?{args:this[Me]}:void 0}}},Jt=e=>Ue(e,Fs),C1=e=>Ue(e,Na),Vu="~effect/Cause",qu="~effect/Cause/Reason",Wl=e=>Ue(e,Vu),jI=e=>Ue(e,qu);var ow;class yo{constructor(t){A(this,ow);A(this,"reasons");this[Vu]=Vu,this.reasons=t}pipe(){return $t(this,arguments)}toJSON(){return{_id:"Cause",failures:this.reasons.map(t=>t.toJSON())}}toString(){return`Cause(${ht(this.reasons)})`}[(ow=Vu,fo)](){return this.toJSON()}[sn](t){return Wl(t)&&this.reasons.length===t.reasons.length&&this.reasons.every((n,o)=>Pn(n,t.reasons[o]))}[rn](){return S1(this.reasons)}}const _S=new WeakMap;var iw;class Rp{constructor(t,n,o){A(this,iw);A(this,"annotations");A(this,"_tag");if(this[qu]=qu,this._tag=t,n!==Hl&&typeof o=="object"&&o!==null&&n.size>0){const i=_S.get(o);i&&(n=new Map([...i,...n])),_S.set(o,n)}this.annotations=n}annotate(t,n){if(t.mapUnsafe.size===0)return this;const o=new Map(this.annotations);t.mapUnsafe.forEach((c,l)=>{(n==null?void 0:n.overwrite)!==!0&&o.has(l)||o.set(l,c)});const i=Object.assign(Object.create(Object.getPrototypeOf(this)),this);return i.annotations=o,i}pipe(){return $t(this,arguments)}toString(){return ht(this)}[(iw=qu,fo)](){return this.toString()}}const Hl=new Map;class b1 extends Rp{constructor(n,o=Hl){super("Fail",o,n);A(this,"error");this.error=n}toString(){return`Fail(${ht(this.error)})`}toJSON(){return{_tag:"Fail",error:this.error}}[sn](n){return Tp(n)&&Pn(this.error,n.error)&&Pn(this.annotations,n.annotations)}[rn](){return sr(Ft(this._tag))(sr(vt(this.error))(vt(this.annotations)))}}const Da=e=>new yo(e),$I=new yo([]),P1=e=>new yo([new b1(e)]);class F1 extends Rp{constructor(n,o=Hl){super("Die",o,n);A(this,"defect");this.defect=n}toString(){return`Die(${ht(this.defect)})`}toJSON(){return{_tag:"Die",defect:this.defect}}[sn](n){return BI(n)&&Pn(this.defect,n.defect)&&Pn(this.annotations,n.annotations)}[rn](){return sr(Ft(this._tag))(sr(vt(this.defect))(vt(this.annotations)))}}const UI=e=>new yo([new F1(e)]),_m=se(e=>Wl(e[0]),(e,t,n)=>t.mapUnsafe.size===0?e:new yo(e.reasons.map(o=>o.annotate(t,n)))),Tp=e=>e._tag==="Fail",BI=e=>e._tag==="Die",Mp=e=>e._tag==="Interrupt";function zI(e){return fi("Effect.evaluate: Not implemented")}const Za=e=>({...DI,[_1]:e.op,[Tt]:e[Tt]??zI,[Fn]:e[Fn],[xr]:e[xr],[ho]:e[ho]}),cr=e=>{const t=Za(e);return function(){const n=Object.create(t);return n[Me]=e.single===!1?arguments:arguments[0],n}},I1=e=>{const t={...Za(e),[Na]:Na,_tag:e.op,get[e.prop](){return this[Me]},toString(){return`${e.op}(${ht(this[Me])})`},toJSON(){return{_id:"Exit",_tag:e.op,[e.prop]:this[Me]}},[sn](n){return C1(n)&&n._tag===this._tag&&Pn(this[Me],n[Me])},[rn](){return sr(Ft(e.op),vt(this[Me]))}};return function(n){const o=Object.create(t);return o[Me]=n,o}},lt=I1({op:"Success",prop:"value",[Tt](e){const t=e.getCont(Fn);return t?t[Fn](this[Me],e,this):e.yieldWith(this)}}),Kl={key:"effect/Cause/StackTrace"},VI={key:"effect/Cause/InterruptorStackTrace"},zn=I1({op:"Failure",prop:"cause",[Tt](e){let t=this[Me],n=!1;e.currentStackFrame&&(t=_m(t,{mapUnsafe:new Map([[Kl.key,e.currentStackFrame]])}),n=!0);let o=e.getCont(xr);for(;e.interruptible&&e._interruptedCause&&o;)o=e.getCont(xr);return o?o[xr](t,e,n?void 0:this):e.yieldWith(n?this:zn(t))}}),Cr=e=>zn(P1(e)),fi=e=>zn(UI(e)),Ke=cr({op:"WithFiber",[Tt](e){return this[Me](e)}}),qI=(function(){class e extends globalThis.Error{asEffect(){return Cr(this)}}return Object.assign(e.prototype,NI),e})(),R1=(function(){const e=Symbol.for("effect/Data/Error/plainArgs");return class extends qI{constructor(n){super(n==null?void 0:n.message,n!=null&&n.cause?{cause:n.cause}:void 0),n&&(Object.assign(this,n),Object.defineProperty(this,e,{value:n,enumerable:!1}))}toJSON(){return{...this[e],...this}}}})(),Ap=e=>{class t extends R1{constructor(){super(...arguments);A(this,"_tag",e)}}return t.prototype.name=e,t},CS="~effect/Cause/NoSuchElementError";var aw,cw;class WI extends(cw=Ap("NoSuchElementError"),aw=CS,cw){constructor(n){super({message:n});A(this,aw,CS)}}const ja="~effect/Cause/Done",HI=e=>Ue(e,ja),T1={[ja]:ja,_tag:"Done",value:void 0},Lp=e=>e===void 0?T1:{[ja]:ja,_tag:"Done",value:e},KI=Cr(T1),QI=e=>e===void 0?KI:Cr(Lp(e)),M1="~effect/data/Option",A1={[M1]:{_A:e=>e},...Is,...ql},L1=Object.assign(Object.create(A1),{_tag:"Some",_op:"Some",[sn](e){return O1(e)&&D1(e)&&Pn(this.value,e.value)},[rn](){return sr(vt(this._tag))(vt(this.value))},toString(){return`some(${ht(this.value)})`},toJSON(){return{_id:"Option",_tag:this._tag,value:Xa(this.value)}},asEffect(){return lt(this.value)}});Object.defineProperty(L1,"valueOrUndefined",{get(){return this.value}});const JI=vt("None"),GI=Object.assign(Object.create(A1),{_tag:"None",_op:"None",valueOrUndefined:void 0,[sn](e){return O1(e)&&N1(e)},[rn](){return JI},toString(){return"none()"},toJSON(){return{_id:"Option",_tag:this._tag}},asEffect(){return Cr(new WI)}}),O1=e=>Ue(e,M1),N1=e=>e._tag==="None",D1=e=>e._tag==="Some",YI=Object.create(GI),XI=e=>{const t=Object.create(L1);return t.value=e,t},j1="~effect/data/Result",$1={[j1]:{_A:e=>e,_E:e=>e},...Is,...ql},ZI=Object.assign(Object.create($1),{_tag:"Success",_op:"Success",[sn](e){return U1(e)&&z1(e)&&Pn(this.success,e.success)},[rn](){return sr(vt(this._tag))(vt(this.success))},toString(){return`success(${ht(this.success)})`},toJSON(){return{_id:"Result",_tag:this._tag,value:Xa(this.success)}},asEffect(){return lt(this.success)}}),eR=Object.assign(Object.create($1),{_tag:"Failure",_op:"Failure",[sn](e){return U1(e)&&B1(e)&&Pn(this.failure,e.failure)},[rn](){return sr(vt(this._tag))(vt(this.failure))},toString(){return`failure(${ht(this.failure)})`},toJSON(){return{_id:"Result",_tag:this._tag,failure:Xa(this.failure)}},asEffect(){return Cr(this.failure)}}),U1=e=>Ue(e,j1),B1=e=>e._tag==="Failure",z1=e=>e._tag==="Success",tR=e=>{const t=Object.create(eR);return t.failure=e,t},nR=e=>{const t=Object.create(ZI);return t.success=e,t};function Op(e){return(t,n)=>t===n?0:e(t,n)}const Np=Op((e,t)=>globalThis.Number.isNaN(e)&&globalThis.Number.isNaN(t)?0:globalThis.Number.isNaN(e)?-1:globalThis.Number.isNaN(t)?1:e<t?-1:1),rR=se(2,(e,t)=>Op((n,o)=>e(t(n),t(o)))),sR=e=>se(2,(t,n)=>e(t,n)===-1),V1=e=>se(2,(t,n)=>e(t,n)===1),oR=e=>se(2,(t,n)=>e(t,n)!==1),q1=e=>se(2,(t,n)=>e(t,n)!==-1),iR=e=>se(2,(t,n)=>t===n||e(t,n)<1?t:n),Vn=()=>YI,Ne=XI,vo=N1,_s=D1,aR=se(2,(e,t)=>vo(e)?t():e.value),W1=aR(jl),Dp=se(2,(e,t)=>vo(e)?Vn():Ne(t(e.value))),cR=se(2,(e,t)=>vo(e)?Vn():t(e.value)?Ne(e.value):Vn()),Hr=nR,or=tR,Mt=B1,uR=z1,lR={[Symbol.iterator](){return fR}},fR={next(){return{done:!0,value:void 0}}},dR=()=>lR,hR=se(2,(e,t)=>Object.hasOwn(e,t)),mR=e=>Object.keys(e),pR=e=>se(2,(t,n)=>{for(const o of mR(t))if(!hR(n,o)||!e(t[o],n[o]))return!1;return!0}),gR=e=>{const t=pR(e);return(n,o)=>t(n,o)&&t(o,n)},bS=globalThis.Array,kr=e=>bS.isArray(e)?e:bS.from(e),H1=se(2,(e,t)=>[...e,t]),yR=se(2,(e,t)=>kr(e).concat(kr(t))),PS=x1,al=x1;function vR(e,t){return e<0||e>=t.length}const SR=se(2,(e,t)=>{const n=Math.floor(t);if(vR(n,e))throw new Error(`Index out of bounds: ${n}`);return e[n]}),xR=SR(0),wR=e=>e.slice(1),kR=se(3,(e,t,n)=>{const o=kr(e),i=kr(t);return al(o)?al(i)?CR(n)(yR(o,i)):o:i}),ER=se(2,(e,t)=>kR(e,t,wI())),_R=()=>[],K1=se(2,(e,t)=>e.map(t)),CR=se(2,(e,t)=>{const n=kr(e);if(al(n)){const o=[xR(n)],i=wR(n);for(const c of i)o.every(l=>!t(c,l))&&o.push(c);return o}return[]}),FS="~effect/Context/Service",Wn=function(){var i;const e=Error.stackTraceLimit;Error.stackTraceLimit=2;const t=new Error;Error.stackTraceLimit=e;function n(){}const o=n;return Object.setPrototypeOf(o,bR),Object.defineProperty(o,"stack",{get(){return t.stack}}),arguments.length>0?(o.key=arguments[0],(i=arguments[1])!=null&&i.defaultValue&&(o[cl]=cl,o.defaultValue=arguments[1].defaultValue),o):function(c,l){return o.key=c,l!=null&&l.make&&(o.make=l.make),o}},bR={[FS]:FS,...Is,...ql,toJSON(){return{_id:"Service",key:this.key,stack:this.stack}},asEffect(){return(this.asEffect=bs(Ke(t=>lt(oo(t.context,this)))))()},of(e){return e},context(e){return di(this,e)},use(e){return Ke(t=>e(oo(t.context,this)))},useSync(e){return Ke(t=>lt(e(oo(t.context,this))))}},cl="~effect/Context/Reference",Q1="~effect/Context",ws=e=>{const t=Object.create(PR);return t.mapUnsafe=e,t.mutable=!1,t},PR={...Is,[Q1]:{_Services:e=>e},toJSON(){return{_id:"Context",services:Array.from(this.mapUnsafe).map(([e,t])=>({key:e,value:t}))}},[sn](e){if(!J1(e)||this.mapUnsafe.size!==e.mapUnsafe.size)return!1;for(const t of this.mapUnsafe.keys())if(!e.mapUnsafe.has(t)||!Pn(this.mapUnsafe.get(t),e.mapUnsafe.get(t)))return!1;return!0},[rn](){return Pp(this.mapUnsafe.size)}},J1=e=>Ue(e,Q1),G1=e=>Ue(e,cl),ir=()=>FR,FR=ws(new Map),di=(e,t)=>ws(new Map([[e.key,t]])),Rs=se(3,(e,t,n)=>Y1(e,o=>{o.set(t.key,n)})),IR=se(3,(e,t,n)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):G1(t)?Jl(t):n()),Ql=se(2,(e,t)=>{if(!e.mapUnsafe.has(t.key)){if(cl in t)return Jl(t);throw TR(t)}return e.mapUnsafe.get(t.key)}),oo=Ql,RR=(e,t)=>e.mapUnsafe.has(t.key)?e.mapUnsafe.get(t.key):Jl(t),jh="~effect/Context/defaultValue",Jl=e=>jh in e?e[jh]:e[jh]=e.defaultValue(),TR=e=>{const t=new Error(`Service not found${e.key?`: ${String(e.key)}`:""}`);if(e.stack){const n=e.stack.split(`
|
|
65
|
+
`);if(n.length>2){const o=n[2].match(/at (.*)/);o&&(t.message=t.message+` (defined at ${o[1]})`)}}if(t.stack){const n=t.stack.split(`
|
|
66
|
+
`);n.splice(1,3),t.stack=n.join(`
|
|
67
|
+
`)}return t},MR=se(2,(e,t)=>e.mapUnsafe.has(t.key)?Ne(e.mapUnsafe.get(t.key)):G1(t)?Ne(Jl(t)):Vn()),hi=se(2,(e,t)=>e.mapUnsafe.size===0?t:t.mapUnsafe.size===0?e:Y1(e,n=>{t.mapUnsafe.forEach((o,i)=>n.set(i,o))})),AR=(...e)=>{const t=new Map;for(let n=0;n<e.length;n++)e[n].mapUnsafe.forEach((o,i)=>{t.set(i,o)});return ws(t)},Y1=(e,t)=>{if(e.mutable)return t(e.mapUnsafe),e;const n=new Map(e.mapUnsafe);return t(n),ws(n)},rt=Wn,ul="~effect/time/Duration",LR=BigInt(0),X1=BigInt(1e3),OR=BigInt(1e6),NR=/^(-?\d+(?:\.\d+)?)\s+(nanos?|micros?|millis?|seconds?|minutes?|hours?|days?|weeks?)$/,jp=e=>{switch(typeof e){case"number":return $a(e);case"bigint":return TS(e);case"string":{const t=NR.exec(e);if(!t)break;const[n,o,i]=t,c=Number(o);switch(i){case"nano":case"nanos":return TS(BigInt(o));case"micro":case"micros":return VR(BigInt(o));case"milli":case"millis":return $a(c);case"second":case"seconds":return qR(c);case"minute":case"minutes":return WR(c);case"hour":case"hours":return HR(c);case"day":case"days":return KR(c);case"week":case"weeks":return QR(c)}break}case"object":{if(e===null)break;if(ul in e)return e;if(Array.isArray(e))return e.length!==2||!e.every(y1)?IS(e):Number.isNaN(e[0])||Number.isNaN(e[1])?$p:e[0]===-1/0||e[1]===-1/0?zR:e[0]===1/0||e[1]===1/0?BR:pn(BigInt(Math.round(e[0]*1e9))+BigInt(Math.round(e[1])));const t=e;let n=0;if(t.weeks&&(n+=t.weeks*6048e5),t.days&&(n+=t.days*864e5),t.hours&&(n+=t.hours*36e5),t.minutes&&(n+=t.minutes*6e4),t.seconds&&(n+=t.seconds*1e3),t.milliseconds&&(n+=t.milliseconds),!t.microseconds&&!t.nanoseconds)return pn(n);let o=BigInt(n)*OR;return t.microseconds&&(o+=BigInt(t.microseconds)*X1),t.nanoseconds&&(o+=BigInt(t.nanoseconds)),pn(o)}}return IS(e)},IS=e=>{throw new Error(`Invalid Input: ${e}`)},RS={_tag:"Millis",millis:0},DR={_tag:"Infinity"},jR={_tag:"NegativeInfinity"},$R={[ul]:ul,[rn](){return Fp(this.value)},[sn](e){return UR(e)&&ZR(this,e)},toString(){switch(this.value._tag){case"Infinity":return"Infinity";case"NegativeInfinity":return"-Infinity";case"Nanos":return`${this.value.nanos} nanos`;case"Millis":return`${this.value.millis} millis`}},toJSON(){switch(this.value._tag){case"Millis":return{_id:"Duration",_tag:"Millis",millis:this.value.millis};case"Nanos":return{_id:"Duration",_tag:"Nanos",nanos:String(this.value.nanos)};case"Infinity":return{_id:"Duration",_tag:"Infinity"};case"NegativeInfinity":return{_id:"Duration",_tag:"NegativeInfinity"}}},[fo](){return this.toJSON()},pipe(){return $t(this,arguments)}},pn=e=>{const t=Object.create($R);return typeof e=="number"?isNaN(e)||e===0||Object.is(e,-0)?t.value=RS:Number.isFinite(e)?Number.isInteger(e)?t.value={_tag:"Millis",millis:e}:t.value={_tag:"Nanos",nanos:BigInt(Math.round(e*1e6))}:t.value=e>0?DR:jR:e===LR?t.value=RS:t.value={_tag:"Nanos",nanos:e},t},UR=e=>Ue(e,ul),$p=pn(0),BR=pn(1/0),zR=pn(-1/0),TS=e=>pn(e),VR=e=>pn(e*X1),$a=e=>pn(e),qR=e=>pn(e*1e3),WR=e=>pn(e*6e4),HR=e=>pn(e*36e5),KR=e=>pn(e*864e5),QR=e=>pn(e*6048e5),Z1=e=>JR(e,{onMillis:Ie,onNanos:t=>Number(t)/1e6,onInfinity:()=>1/0,onNegativeInfinity:()=>-1/0}),MS=e=>{switch(e.value._tag){case"Infinity":case"NegativeInfinity":throw new Error("Cannot convert infinite duration to nanos");case"Nanos":return e.value.nanos;case"Millis":return BigInt(Math.round(e.value.millis*1e6))}},JR=se(2,(e,t)=>{switch(e.value._tag){case"Millis":return t.onMillis(e.value.millis);case"Nanos":return t.onNanos(e.value.nanos);case"Infinity":return t.onInfinity();case"NegativeInfinity":return(t.onNegativeInfinity??t.onInfinity)()}}),ek=se(3,(e,t,n)=>e.value._tag==="Infinity"||e.value._tag==="NegativeInfinity"||t.value._tag==="Infinity"||t.value._tag==="NegativeInfinity"?n.onInfinity(e,t):e.value._tag==="Millis"?t.value._tag==="Millis"?n.onMillis(e.value.millis,t.value.millis):n.onNanos(MS(e),t.value.nanos):n.onNanos(e.value.nanos,MS(t))),GR=Op((e,t)=>ek(e,t,{onMillis:(n,o)=>n<o?-1:n>o?1:0,onNanos:(n,o)=>n<o?-1:n>o?1:0,onInfinity:(n,o)=>n.value._tag===o.value._tag?0:n.value._tag==="Infinity"?1:n.value._tag==="NegativeInfinity"||o.value._tag==="Infinity"?-1:1})),YR=(e,t)=>ek(e,t,{onMillis:(n,o)=>n===o,onNanos:(n,o)=>n===o,onInfinity:(n,o)=>n.value._tag===o.value._tag}),XR=iR(GR),ZR=se(2,(e,t)=>YR(e,t)),eT=e=>t=>!Mt(e(t)),tT=e=>t=>t.has(e)?Hr(t):or(t),nT=se(2,(e,t)=>n=>{const o=e(n);return Mt(o)?o:t(o.success)}),tk=se(2,(e,t)=>n=>{const o=e(n);if(Mt(o))return or(n);const i=t(o.success);return Mt(i)?or(n):i}),nk=rt("effect/Scheduler",{defaultValue:()=>new sk}),rk="setImmediate"in globalThis?e=>{const t=globalThis.setImmediate(e);return()=>globalThis.clearImmediate(t)}:e=>{const t=setTimeout(e,0);return()=>clearTimeout(t)};class rT{constructor(){A(this,"buckets",[])}scheduleTask(t,n){const o=this.buckets,i=o.length;let c,l=0;for(;l<i&&!(o[l][0]>n);l++)c=o[l];c&&c[0]===n?c[1].push(t):l===i?o.push([n,[t]]):o.splice(l,0,[n,[t]])}drain(){const t=this.buckets;return this.buckets=[],t}}class sk{constructor(t="async",n=rk){A(this,"executionMode");A(this,"setImmediate");this.executionMode=t,this.setImmediate=n}shouldYield(t){return t.currentOpCount>=t.maxOpsBeforeYield}makeDispatcher(){return new sT(this.setImmediate)}}class sT{constructor(t=rk){A(this,"tasks",new rT);A(this,"running");A(this,"setImmediate");A(this,"afterScheduled",()=>{this.running=void 0,this.runTasks()});this.setImmediate=t}scheduleTask(t,n){this.tasks.scheduleTask(t,n),this.running===void 0&&(this.running=this.setImmediate(this.afterScheduled))}runTasks(){const t=this.tasks.drain();for(let n=0;n<t.length;n++){const o=t[n][1];for(let i=0;i<o.length;i++)o[i]()}}flush(){for(;this.tasks.buckets.length>0;)this.running!==void 0&&(this.running(),this.running=void 0),this.runTasks()}}const oT=rt("effect/Scheduler/MaxOpsBeforeYield",{defaultValue:()=>2048}),iT=rt("effect/Scheduler/PreventSchedulerYield",{defaultValue:()=>!1}),ok="effect/Tracer/ParentSpan";class aT extends Wn()(ok){}const cT=e=>e,Cm=rt("effect/Tracer/DisablePropagation",{defaultValue:p1}),uT=rt("effect/Tracer/CurrentTraceLevel",{defaultValue:()=>"Info"}),lT=rt("effect/Tracer/MinimumTraceLevel",{defaultValue:()=>"All"}),ik="effect/Tracer",fT=rt(ik,{defaultValue:()=>cT({span:e=>new dT(e)})});class dT{constructor(t){A(this,"_tag","Span");A(this,"spanId");A(this,"traceId","native");A(this,"sampled");A(this,"name");A(this,"parent");A(this,"annotations");A(this,"links");A(this,"startTime");A(this,"kind");A(this,"status");A(this,"attributes");A(this,"events",[]);var n;this.name=t.name,this.parent=t.parent,this.annotations=t.annotations,this.links=t.links,this.startTime=t.startTime,this.kind=t.kind,this.sampled=t.sampled,this.status={_tag:"Started",startTime:t.startTime},this.attributes=new Map,this.traceId=((n=W1(t.parent))==null?void 0:n.traceId)??AS(32),this.spanId=AS(16)}end(t,n){this.status={_tag:"Ended",endTime:t,exit:n,startTime:this.status.startTime}}attribute(t,n){this.attributes.set(t,n)}event(t,n,o){this.events.push([t,n,o??{}])}addLinks(t){this.links.push(...t)}}const AS=(function(){const e="abcdef0123456789",t=e.length;return function(n){let o="";for(let i=0;i<n;i++)o+=e.charAt(Math.floor(Math.random()*t));return o}})(),hT="effect/observability/Metric/FiberRuntimeMetricsKey",mT=rt("effect/References/CurrentConcurrency",{defaultValue:()=>"unbounded"}),ak=rt("effect/References/CurrentStackFrame",{defaultValue:jl}),pT=rt("effect/References/TracerEnabled",{defaultValue:Cp}),ck=rt("effect/References/TracerTimingEnabled",{defaultValue:Cp}),gT=rt("effect/References/TracerSpanAnnotations",{defaultValue:()=>({})}),yT=rt("effect/References/TracerSpanLinks",{defaultValue:()=>[]}),Up=rt("effect/References/CurrentLogAnnotations",{defaultValue:()=>({})}),vT=rt("effect/References/CurrentLogLevel",{defaultValue:()=>"Info"}),ST=rt("effect/References/MinimumLogLevel",{defaultValue:()=>"Info"}),xT=rt("effect/References/CurrentLogSpans",{defaultValue:()=>[]}),wT=e=>{if((e==null?void 0:e.captureStackTrace)===!1)return e;if((e==null?void 0:e.captureStackTrace)!==void 0&&typeof e.captureStackTrace!="boolean")return e;const t=Error.stackTraceLimit;Error.stackTraceLimit=3;const n=new Error;return Error.stackTraceLimit=t,{...e,captureStackTrace:ET(()=>n.stack)}},kT=e=>t=>{let n;return()=>{if(n!==void 0)return n;const o=t();if(!o)return;const i=o.split(`
|
|
68
|
+
`);if(i[e]!==void 0)return n=i[e].trim(),n}},ET=kT(3),_T="dev";class uk extends Rp{constructor(n,o=Hl){super("Interrupt",o,"Interrupted");A(this,"fiberId");this.fiberId=n}toString(){return`Interrupt(${this.fiberId})`}toJSON(){return{_tag:"Interrupt",fiberId:this.fiberId}}[sn](n){return Mp(n)&&this.fiberId===n.fiberId&&this.annotations===n.annotations}[rn](){return sr(Ft(`${this._tag}:${this.fiberId}`))(Em(this.annotations))}}const CT=e=>new uk(e),Bp=e=>new yo([new uk(e)]),bT=e=>{const t=e.reasons.find(Tp);return t?Hr(t):or(e)},So=e=>{for(let t=0;t<e.reasons.length;t++){const n=e.reasons[t];if(n._tag==="Fail")return Hr(n.error)}return or(e)},PT=e=>e.reasons.some(Mp),zp=e=>{let t;for(let n=0;n<e.reasons.length;n++){const o=e.reasons[n];o._tag==="Interrupt"&&(t??(t=new Set),o.fiberId!==void 0&&t.add(o.fiberId))}return t?Hr(t):or(e)},FT=e=>{const t=zp(e);return Mt(t)?IT:t.success},IT=new Set,RT=e=>e.reasons.length>0&&e.reasons.every(Mp),TT=se(2,(e,t)=>{if(e.reasons.length===0)return t;if(t.reasons.length===0)return e;const n=new yo(ER(e.reasons,t.reasons));return Pn(e,n)?e:n}),MT=e=>{const t={Fail:[],Die:[],Interrupt:[]};for(let n=0;n<e.reasons.length;n++)t[e.reasons[n]._tag].push(e.reasons[n]);return t},Vp=e=>{const t=MT(e);return t.Fail.length>0?t.Fail[0].error:t.Die.length>0?t.Die[0].defect:t.Interrupt.length>0?new globalThis.Error("All fibers interrupted without error"):new globalThis.Error("Empty cause")},AT=e=>{const t=[],n=[];if(e.reasons.length===0)return t;const o=Error.stackTraceLimit;Error.stackTraceLimit=1;for(const i of e.reasons){if(i._tag==="Interrupt"){n.push(i);continue}t.push(bm(i._tag==="Die"?i.defect:i.error,i.annotations))}if(t.length===0){const i=new Error("The fiber was interrupted by:");i.name="InterruptCause",i.stack=DT(i,n);const c=new globalThis.Error("All fibers interrupted without error",{cause:i});c.name="InterruptError",c.stack=`${c.name}: ${c.message}`,t.push(bm(c,n[0].annotations))}return Error.stackTraceLimit=o,t},bm=(e,t)=>{const n=typeof e;let o;if(e&&n==="object"){if(o=new globalThis.Error(LT(e),{cause:e.cause?bm(e.cause):void 0}),typeof e.name=="string"&&(o.name=e.name),typeof e.stack=="string")o.stack=NT(e.stack,o,t);else{const i=`${o.name}: ${o.message}`;o.stack=t?lk(i,t):i}for(const i of Object.keys(e))i in o||(o[i]=e[i])}else o=new globalThis.Error(e?n==="string"?e:k1(e):`Unknown error: ${e}`);return o},LT=e=>{if(typeof e.message=="string")return e.message;if(typeof e.toString=="function"&&e.toString!==Object.prototype.toString&&e.toString!==Array.prototype.toString)try{return e.toString()}catch{}return k1(e)},OT=/\((.*)\)/g,NT=(e,t,n)=>{const o=`${t.name}: ${t.message}`,i=(e.startsWith(o)?e.slice(o.length):e).split(`
|
|
69
|
+
`),c=[o];for(let l=1;l<i.length&&!/(?:Generator\.next|~effect\/Effect)/.test(i[l]);l++)c.push(i[l]);return n?lk(c.join(`
|
|
70
|
+
`),n):c.join(`
|
|
71
|
+
`)},lk=(e,t)=>{const n=t==null?void 0:t.get(Kl.key);return n&&(e=`${e}
|
|
72
|
+
${fk(n)}`),e},DT=(e,t)=>{const n=[`${e.name}: ${e.message}`];for(const o of t){const i=o.fiberId!==void 0?`#${o.fiberId}`:"unknown",c=o.annotations.get(VI.key);n.push(` at fiber (${i})`),c&&n.push(fk(c))}return n.join(`
|
|
73
|
+
`)},fk=e=>{const t=[];let n=e,o=0;for(;n&&o<10;){const i=n.stack();if(i){const c=i.matchAll(OT);let l=!1;for(const[,d]of c)l=!0,t.push(` at ${n.name} (${d})`);l||t.push(` at ${n.name} (${i.replace(/^at /,"")})`)}else t.push(` at ${n.name}`);n=n.parent,o++}return t.join(`
|
|
74
|
+
`)},dk=e=>AT(e).map(t=>t.cause?`${t.stack} {
|
|
75
|
+
${hk(t.cause," ")}
|
|
76
|
+
}`:t.stack).join(`
|
|
77
|
+
`),hk=(e,t)=>{const n=e.stack.split(`
|
|
78
|
+
`);let o=`${t}[cause]: ${n[0]}`;for(let i=1,c=n.length;i<c;i++)o+=`
|
|
79
|
+
${t}${n[i]}`;return e.cause&&(o+=` {
|
|
80
|
+
${hk(e.cause,`${t} `)}
|
|
81
|
+
${t}}`),o},Pm=`~effect/Fiber/${_T}`,jT={_A:Ie,_E:Ie},$T={id:0},qp=()=>globalThis[Ca];var uw;uw=Pm;class mk{constructor(t,n=!0){A(this,uw);A(this,"id");A(this,"interruptible");A(this,"currentOpCount");A(this,"currentLoopCount");A(this,"_stack");A(this,"_observers");A(this,"_exit");A(this,"_currentExit");A(this,"_children");A(this,"_interruptedCause");A(this,"_yielded");A(this,"context");A(this,"currentScheduler");A(this,"currentTracerContext");A(this,"currentSpan");A(this,"currentLogLevel");A(this,"minimumLogLevel");A(this,"currentStackFrame");A(this,"runtimeMetrics");A(this,"maxOpsBeforeYield");A(this,"currentPreventYield");A(this,"_dispatcher");this[Pm]=jT,this.setContext(t),this.id=++$T.id,this.currentOpCount=0,this.currentLoopCount=0,this.interruptible=n,this._stack=[],this._observers=[],this._exit=void 0,this._children=void 0,this._interruptedCause=void 0,this._yielded=void 0}get currentDispatcher(){return this._dispatcher??(this._dispatcher=this.currentScheduler.makeDispatcher())}getRef(t){return RR(this.context,t)}addObserver(t){return this._exit?(t(this._exit),Ya):(this._observers.push(t),()=>{const n=this._observers.indexOf(t);n>=0&&this._observers.splice(n,1)})}interruptUnsafe(t,n){if(this._exit)return;let o=Bp(t);this.currentStackFrame&&(o=_m(o,di(Kl,this.currentStackFrame))),n&&(o=_m(o,n)),this._interruptedCause=this._interruptedCause?TT(this._interruptedCause,o):o,this.interruptible&&this.evaluate(Gt(this._interruptedCause))}pollUnsafe(){return this._exit}evaluate(t){var o,i;if((o=this.runtimeMetrics)==null||o.recordFiberStart(this.context),this._exit)return;if(this._yielded!==void 0){const c=this._yielded;this._yielded=void 0,c()}const n=this.runLoop(t);if(n!==Gs){this._exit=n,(i=this.runtimeMetrics)==null||i.recordFiberEnd(this.context,this._exit);for(let c=0;c<this._observers.length;c++)this._observers[c](n);this._observers.length=0}}runLoop(t){const n=globalThis[Ca];globalThis[Ca]=this;let o=!1,i=t;this.currentOpCount=0;const c=++this.currentLoopCount;try{for(;;){if(this.currentOpCount++,!o&&!this.currentPreventYield&&this.currentScheduler.shouldYield(this)){o=!0;const l=i;i=$e(Hp,()=>l)}if(i=this.currentTracerContext?this.currentTracerContext(i,this):i[Tt](this),c!==this.currentLoopCount)return Gs;if(i===Gs){const l=this._yielded;return Na in l?(this._yielded=void 0,l):Gs}}}catch(l){return Ue(i,Tt)?this.runLoop(fi(l)):fi(`Fiber.runLoop: Not a valid effect: ${String(i)}`)}finally{globalThis[Ca]=n}}getCont(t){for(;;){const n=this._stack.pop();if(!n)return;const o=n[ho]&&n[ho](this);if(o)return o[t]=o,o;if(n[t])return n}}yieldWith(t){return this._yielded=t,Gs}children(){return this._children??(this._children=new Set)}pipe(){return $t(this,arguments)}setContext(t){this.context=t;const n=this.getRef(nk);n!==this.currentScheduler&&(this.currentScheduler=n,this._dispatcher=void 0),this.currentSpan=t.mapUnsafe.get(ok),this.currentLogLevel=this.getRef(vT),this.minimumLogLevel=this.getRef(ST),this.currentStackFrame=t.mapUnsafe.get(ak.key),this.maxOpsBeforeYield=this.getRef(oT),this.currentPreventYield=this.getRef(iT),this.runtimeMetrics=t.mapUnsafe.get(hT);const o=t.mapUnsafe.get(ik);this.currentTracerContext=o?o.context:void 0}get currentSpanLocal(){var t;return((t=this.currentSpan)==null?void 0:t._tag)==="Span"?this.currentSpan:void 0}}const Gl=e=>{if(!e.currentStackFrame)return;const t=new Map;return t.set(Kl.key,e.currentStackFrame),ws(t)},pk=e=>{const t=e;return t._exit?Re(t._exit):ur(n=>t._exit?n(Re(t._exit)):kt(e.addObserver(o=>n(Re(o)))))},gk=e=>ur(t=>{const n=e[Symbol.iterator](),o=[];let i;function c(){let l=n.next();for(;!l.done;){if(l.value._exit){o.push(l.value._exit),l=n.next();continue}i=l.value.addObserver(d=>{o.push(d),c()});return}t(Re(o))}return c(),kt(()=>i==null?void 0:i())}),Wp=e=>Ke(t=>UT(e,t.id)),UT=se(e=>Ue(e[0],Pm),(e,t,n)=>Ke(o=>{let i=Gl(o);return i=i&&n?hi(i,n):i??n,e.interruptUnsafe(t,i),kk(pk(e))})),ll=e=>Ke(t=>{const n=Gl(t);for(const o of e)o.interruptUnsafe(t.id,n);return kk(gk(e))}),Re=lt,Gt=zn,Yl=Cr,kt=cr({op:"Sync",[Tt](e){const t=this[Me](),n=e.getCont(Fn);return n?n[Fn](t,e):e.yieldWith(lt(t))}}),Et=cr({op:"Suspend",[Tt](e){return this[Me]()}}),BT=cr({op:"Yield",[Tt](e){let t=!1;return e.currentDispatcher.scheduleTask(()=>{t||e.evaluate(qn)},this[Me]??0),e.yieldWith(()=>{t=!0})}}),Hp=BT(0),zT=e=>Re(Ne(e)),VT=Re(Vn()),Xl=e=>fi(e),yk=e=>Et(()=>Yl(tn(e))),ut=Re(void 0),qT=e=>vk(function(t,n){tn(()=>e(n)).then(o=>t(Re(o)),o=>t(Xl(o)))},e.length!==0),WT=e=>Ke(t=>e(t.id)),vk=cr({op:"Async",single:!1,[Tt](e){const t=tn(()=>this[Me][0].bind(e.currentScheduler));let n=!1,o=!1;const i=this[Me][1]?new AbortController:void 0,c=t(l=>{n||(n=!0,o?e.evaluate(l):o=l)},i==null?void 0:i.signal);return o!==!1?o:(o=!0,e._yielded=()=>{n=!0},i===void 0&&c===void 0||e._stack.push(HT(()=>(n=!0,i==null||i.abort(),c??qn))),Gs)}}),HT=cr({op:"AsyncFinalizer",[ho](e){e.interruptible&&(e.interruptible=!1,e._stack.push(sf))},[xr](e,t){return PT(e)?$e(this[Me](),()=>Gt(e)):Gt(e)}}),ur=e=>vk(e,e.length>=2),KT=ur(Ya),QT=(...e)=>Et(()=>Ua(e.length===1?e[0]():e[1].call(e[0].self))),Sk=(e,...t)=>{const n=t.length===0?function(){return Et(()=>Ua(e.apply(this,arguments)))}:function(){let o=Et(()=>Ua(e.apply(this,arguments)));for(let i=0;i<t.length;i++)o=t[i](o,...arguments);return o};return xk(e.length,n)},xk=(e,t)=>Object.defineProperty(t,"length",{value:e,configurable:!0}),JT=(e,...t)=>xk(e.length,t.length===0?function(){return LS(()=>e.apply(this,arguments))}:function(){let n=LS(()=>e.apply(this,arguments));for(const o of t)n=o(n);return n}),LS=e=>{try{const t=e();let n;for(;;){const o=t.next(n);if(o.done)return Re(o.value);const c=o.value.asEffect(),l=c;if(l&&l._tag==="Success"){n=l.value;continue}else{if(l&&l._tag==="Failure")return c;{let d=!0;return Et(()=>d?(d=!1,$e(c,h=>Ua(t,h))):Et(()=>Ua(e())))}}}}catch(t){return Xl(t)}},Ua=cr({op:"Iterator",single:!1,[Fn](e,t){const n=this[Me][0];for(;;){const o=n.next(e);if(o.done)return Re(o.value);const i=o.value.asEffect();if(In(i)){if(i._tag==="Failure")return i}else return t._stack.push(this),i;e=i.value}},[Tt](e){return this[Fn](this[Me][1],e)}}),xi=se(2,(e,t)=>{const n=Re(t);return $e(e,o=>n)}),ec=se(2,(e,t)=>$e(e,n=>Jt(t)?t:tn(()=>t(n)))),wk=se(2,(e,t)=>$e(e,n=>xi(Jt(t)?t:tn(()=>t(n)),n))),kk=e=>$e(e,t=>qn),GT=(e,t)=>Ke(n=>ur(o=>{let i=!1;const c=new Set,l=h=>{i=!0,o(c.size===0?h:$e(Ak(ll(c)),()=>h))};let d=0;for(const h of e){if(i)break;const p=d++,y=af(n,h,!0,!0,!1);c.add(y),y.addObserver(g=>{c.delete(y);const v=!i;l(g),v&&(t!=null&&t.onWinner)&&t.onWinner({fiber:y,index:p,parentFiber:n})})}return ll(c)})),Ek=se(e=>Jt(e[1]),(e,t,n)=>GT([e,t],n)),$e=se(2,(e,t)=>{const n=Object.create(YT);return n[Me]=e,n[Fn]=t.length!==1?o=>t(o):t,n}),YT=Za({op:"OnSuccess",[Tt](e){return e._stack.push(this),this[Me]}}),In=e=>Na in e,XT=se(2,(e,t)=>In(e)?e._tag==="Success"?t(e.value):e:$e(e,t)),ZT=e=>$e(e,Ie),jt=se(2,(e,t)=>$e(e,n=>Re(tn(()=>t(n))))),eM=se(2,(e,t)=>In(e)?aM(e,t):jt(e,t)),tM=se(2,(e,t)=>In(e)?cM(e,t):kM(e,t)),nM=se(2,(e,t)=>In(e)?uM(e,t):EM(e,t)),rM=se(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return e;const n=So(e.cause);return Mt(n)?e:t(n.success)}return ef(e,t)}),sM=e=>zn(Bp(e)),Kp=e=>e._tag==="Success",oM=e=>e._tag==="Failure",iM=e=>e._tag==="Failure"?Hr(e.cause):or(e),qn=lt(void 0),aM=se(2,(e,t)=>e._tag==="Success"?lt(t(e.value)):e),cM=se(2,(e,t)=>{if(e._tag==="Success")return e;const n=So(e.cause);return Mt(n)?e:Cr(t(n.success))}),uM=se(2,(e,t)=>{if(e._tag==="Success")return lt(t.onSuccess(e.value));const n=So(e.cause);return Mt(n)?e:Cr(t.onFailure(n.success))}),lM=se(2,(e,t)=>Kp(e)?t:e),fM=e=>{const t=[];for(const n of e)n._tag==="Failure"&&t.push(...n.cause.reasons);return t.length===0?qn:zn(Da(t))},dM=e=>Kp(e)?Ne(e.value):Vn(),hM=e=>Ke(t=>Re(MR(t.context,e))),Zl=se(2,(e,t)=>Ke(n=>{const o=n.context,i=t(o);return o===i?e:(n.setContext(i),Mk(e,()=>{n.setContext(o)}))})),_k=se(3,(e,t,n)=>Zl(e,o=>{const i=Ql(o,t),c=n(i);return i===c?o:Rs(o,t,c)})),mM=()=>pM,pM=Ke(e=>Re(e.context)),Ck=e=>Ke(t=>e(t.context)),tc=se(2,(e,t)=>In(e)?e:Zl(e,hi(t))),nc=function(){return arguments.length===1?se(2,(e,t)=>OS(e,arguments[0],t)):se(3,(e,t,n)=>OS(e,t,n)).apply(this,arguments)},OS=(e,t,n)=>Zl(e,o=>o.mapUnsafe.get(t.key)===n?o:Rs(o,t,n)),gM=se(e=>Jt(e[1]),(e,t,n)=>yM(e,t,(o,i)=>[o,i],n)),yM=se(e=>Jt(e[1]),(e,t,n,o)=>o!=null&&o.concurrent?jt(WM([e,t],{concurrency:2}),([i,c])=>tn(()=>n(i,c))):$e(e,i=>jt(t,c=>tn(()=>n(i,c))))),vM=se(e=>Jt(e[0]),(e,t)=>Yp({while:Cp,body:bs(t!=null&&t.disableYield?e:$e(e,n=>Hp)),step:Ya})),rc=se(2,(e,t)=>{const n=Object.create(SM);return n[Me]=e,n[xr]=t.length!==1?o=>t(o):t,n}),SM=Za({op:"OnFailure",[Tt](e){return e._stack.push(this),this[Me]}}),bk=se(3,(e,t,n)=>rc(e,o=>{const i=t(o);return Mt(i)?Gt(i.failure):tn(()=>n(i.success,o))})),ef=se(2,(e,t)=>bk(e,So,n=>t(n))),xM=se(2,(e,t)=>rc(e,n=>ec(tn(()=>t(n)),Gt(n)))),wM=se(e=>Jt(e[0]),(e,t,n,o)=>rc(e,i=>{const c=So(i);if(Mt(c))return Gt(c.failure);const l=t(c.success);return Mt(l)?o?tn(()=>o(l.failure)):Gt(i):tn(()=>n(l.success))})),kM=se(2,(e,t)=>ef(e,n=>yk(()=>t(n)))),EM=se(2,(e,t)=>Qp(e,{onFailure:n=>yk(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),_M=e=>ef(e,Xl),CM=se(e=>Jt(e[0]),(e,t)=>{if(!(t!=null&&t.log))return Qp(e,{onFailure:o=>ut,onSuccess:o=>ut});const n=Kk(t.log===!0?void 0:t.log);return tf(e,{onFailure(o){const i=bT(o);return Mt(i)?Gt(i.failure):t.message===void 0?n(o):n(t.message,o)},onSuccess:o=>ut})}),$h=e=>FM(e,{onFailure:or,onSuccess:Hr}),tf=se(2,(e,t)=>{const n=Object.create(bM);return n[Me]=e,n[Fn]=t.onSuccess.length!==1?o=>t.onSuccess(o):t.onSuccess,n[xr]=t.onFailure.length!==1?o=>t.onFailure(o):t.onFailure,n}),bM=Za({op:"OnSuccessAndFailure",[Tt](e){return e._stack.push(this),this[Me]}}),Qp=se(2,(e,t)=>tf(e,{onFailure:n=>{const o=n.reasons.find(Tp);return o?tn(()=>t.onFailure(o.error)):Gt(n)},onSuccess:t.onSuccess})),PM=se(2,(e,t)=>Qp(e,{onFailure:n=>kt(()=>t.onFailure(n)),onSuccess:n=>kt(()=>t.onSuccess(n))})),FM=se(2,(e,t)=>{if(In(e)){if(e._tag==="Success")return lt(t.onSuccess(e.value));const n=So(e.cause);return Mt(n)?e:lt(t.onFailure(n.success))}return PM(e,t)}),nf=e=>In(e)?lt(e):IM(e),IM=cr({op:"Exit",[Tt](e){return e._stack.push(this),this[Me]},[Fn](e,t,n){return Re(n??lt(e))},[xr](e,t,n){return Re(n??zn(e))}}),RM=se(2,(e,t)=>ec(eg(t),e)),Pk=se(2,(e,t)=>Ek(e,$e(eg(t.duration),t.orElse))),TM=se(2,(e,t)=>Pk(e,{duration:t,orElse:()=>Yl(new mA)})),NS="~effect/Scope",DS="~effect/Scope/Closeable",rf=Wn("effect/Scope"),Fk=(e,t)=>Et(()=>Ik(e,t)??ut),Ik=(e,t)=>{if(e.state._tag==="Closed")return;const n={_tag:"Closed",exit:t};if(e.state._tag==="Empty"){e.state=n;return}const{finalizers:o}=e.state;if(e.state=n,o.size!==0)return o.size===1?o.values().next().value(t):MM(e,o,t)},MM=Sk(function*(e,t,n){let o=[];const i=[],c=Array.from(t.values()),l=qp();for(let d=c.length-1;d>=0;d--){const h=c[d];e.strategy==="sequential"?o.push(yield*nf(h(n))):i.push(af(l,h(n),!0,!0,"inherit"))}return i.length>0&&(o=yield*gk(i)),yield*fM(o)}),AM=(e,t)=>{const n=Gp(t);if(e.state._tag==="Closed")return n.state=e.state,n;const o={};return Ba(e,o,i=>Fk(n,i)),Ba(n,o,i=>kt(()=>Jp(e,o))),n},mi=(e,t)=>Et(()=>e.state._tag==="Closed"?t(e.state.exit):(Ba(e,{},t),ut)),LM=(e,t)=>mi(e,bs(t)),Ba=(e,t,n)=>{e.state._tag==="Empty"?e.state={_tag:"Open",finalizers:new Map([[t,n]])}:e.state._tag==="Open"&&e.state.finalizers.set(t,n)},Jp=(e,t)=>{e.state._tag==="Open"&&e.state.finalizers.delete(t)},Gp=(e="sequential")=>({[DS]:DS,[NS]:NS,strategy:e,state:OM}),OM={_tag:"Empty"},Rk=rf.asEffect(),NM=nc(rf),Tk=e=>Et(()=>{const t=Gp();return Ts(e(t),n=>Et(()=>Ik(t,n)??ut))}),DM=(e,t,n)=>Ck(o=>Nk(i=>$e(Rk,c=>wk(n!=null&&n.interruptible?i(e):e,l=>mi(c,d=>tc(t(l,d),o)))))),Mk=cr({op:"OnExit",single:!1,[Tt](e){return e._stack.push(this),this[Me][0]},[ho](e){e.interruptible&&this[Me][2]!==!0&&(e._stack.push(sf),e.interruptible=!1)},[Fn](e,t,n){n??(n=lt(e));const o=this[Me][1](n);return o?$e(o,i=>n):n},[xr](e,t,n){n??(n=zn(e));const o=this[Me][1](n);return o?$e(o,i=>n):n}}),Ts=se(2,Mk),jM=se(2,(e,t)=>Ts(e,n=>t)),$M=se(3,(e,t,n)=>Ts(e,o=>{const i=t(o);return Mt(i)?ut:n(i.success,o)})),UM=se(2,(e,t)=>$M(e,iM,t)),BM=se(3,(e,t,n)=>Ts(e,o=>{if(o._tag!=="Failure")return ut;const i=t(o.cause);return Mt(i)?ut:n(i.success,o.cause)})),zM=se(2,(e,t)=>BM(zp,t)(e)),VM=Ke(e=>Gt(Bp(e.id))),Ak=e=>Ke(t=>(t.interruptible&&(t.interruptible=!1,t._stack.push(sf)),e)),Lk=cr({op:"SetInterruptible",[ho](e){if(e.interruptible=this[Me],e._interruptedCause&&e.interruptible)return()=>Gt(e._interruptedCause)}}),sf=Lk(!0),qM=Lk(!1),Ok=e=>Ke(t=>t.interruptible?e:(t.interruptible=!0,t._stack.push(qM),t._interruptedCause?Gt(t._interruptedCause):e)),Nk=e=>Ke(t=>t.interruptible?(t.interruptible=!1,t._stack.push(sf),e(Ok)):e(Ie)),WM=(e,t)=>oI(e)?(t==null?void 0:t.mode)==="result"?Ys(e,$h,t):Ys(e,Ie,t):t!=null&&t.discard?t.mode==="result"?Ys(Object.values(e),$h,t):Ys(Object.values(e),Ie,t):Et(()=>{const n={};return xi(Ys(Object.entries(e),([o,i])=>jt((t==null?void 0:t.mode)==="result"?$h(i):i,c=>{n[o]=c}),{discard:!0,concurrency:t==null?void 0:t.concurrency}),n)}),Yp=cr({op:"While",[Fn](e,t){return this[Me].step(e),this[Me].while()?(t._stack.push(this),this[Me].body()):qn},[Tt](e){return this[Me].while()?(e._stack.push(this),this[Me].body()):qn}}),Ys=se(e=>typeof e[1]=="function",(e,t,n)=>Ke(o=>{const i=(n==null?void 0:n.concurrency)==="inherit"?o.getRef(mT):(n==null?void 0:n.concurrency)??1,c=i==="unbounded"?Number.POSITIVE_INFINITY:Math.max(1,i);if(c===1)return HM(e,t,n);const l=kr(e);let d=l.length;if(d===0)return n!=null&&n.discard?ut:Re([]);const h=n!=null&&n.discard?void 0:new Array(d),p=KM({f:t,out:h},l,{concurrency:c});return p?xi(p,h):Re(h)})),HM=(e,t,n)=>Et(()=>{const o=n!=null&&n.discard?void 0:[],i=e[Symbol.iterator]();let c=i.next(),l=0;return xi(Yp({while:()=>!c.done,body:()=>t(c.value,l++),step:d=>{o&&o.push(d),c=i.next()}}),o)}),Dk=e=>{const t=e.onItem,n=e.step;return(o,i,c)=>{let l=(c==null?void 0:c.start)??0;const d=(c==null?void 0:c.end)??i.length,h=(c==null?void 0:c.concurrency)??1;let p=!1,y,g,v,w=!1,S,E;const F=()=>{let K=!1;for(;!S&&l<d;l++){const _=i[l],L=E??t(o,_,l);if(In(L)){if(S=n(o,_,L,l),S)break}else{if(h===1)return $e(nf(L),C=>(S=n(o,_,C,l),l++,S??F()??ut));if(y){E=void 0;const C=af(y,L,!0,!0,"inherit");if(C._exit){if(S=n(o,_,C._exit,l),S)break;continue}g?g.add(C):g=new Set([C]);const D=l;if(C.addObserver($=>{if(g.delete(C),S){if(!w&&$._tag==="Failure")for(const N of $.cause.reasons)N._tag!=="Interrupt"&&(S._tag==="Failure"?S.cause.reasons.push(N):S=zn(Da([N])))}else{const N=n(o,_,$,D);N&&(S=N._tag==="Failure"?zn(Da(N.cause.reasons.slice())):N,F())}if(K){const N=F();N&&v(N)}else p&&g.size===0&&v(S??ut)}),g.size<h)continue;K=!0,l++;return}else return ur(C=>{y=qp(),E=L,v=C;const D=F();return D?C(D):Et(()=>(S=qn,w=!0,g?ll(g):ut))})}}if(p=!0,S){if(g&&g.size>0){const _=Gl(y);g.forEach(L=>L.interruptUnsafe(y.id,_));return}if(v||S._tag==="Failure")return S}else if(v)if(g)g.size===0&&v(ut);else return qn};return F()}},of=()=>Dk,KM=Dk({onItem(e,t,n){return e.f(t,n)},step(e,t,n,o){if(n._tag==="Failure")return n;e.out&&(e.out[o]=n.value)}}),af=(e,t,n=!1,o=!1,i=!1)=>{const c=i==="inherit"?e.interruptible:!i,l=new mk(e.context,c);return n?l.evaluate(t):e.currentDispatcher.scheduleTask(()=>l.evaluate(t),0),!o&&!l._exit&&(e.children().add(l),l.addObserver(()=>e._children.delete(l))),l},jk=se(e=>Jt(e[0]),(e,t,n)=>Ke(o=>{const i=af(o,e,n==null?void 0:n.startImmediately,!0,n==null?void 0:n.uninterruptible);if(!i._exit)if(t.state._tag!=="Closed"){const c={};Ba(t,c,()=>WT(d=>d===i.id?ut:Wp(i))),i.addObserver(()=>Jp(t,c))}else i.interruptUnsafe(o.id,Gl(o));return Re(i)})),QM=se(e=>Jt(e[0]),(e,t)=>$e(Rk,n=>jk(e,n,t))),sc=e=>(t,n)=>{const o=new mk(n!=null&&n.scheduler?Rs(e,nk,n.scheduler):e,(n==null?void 0:n.uninterruptible)!==!0);if(o.evaluate(t),o._exit)return o;if(n!=null&&n.signal)if(n.signal.aborted)o.interruptUnsafe();else{const i=()=>o.interruptUnsafe();n.signal.addEventListener("abort",i,{once:!0}),o.addObserver(()=>n.signal.removeEventListener("abort",i))}return n!=null&&n.onFiberStart&&n.onFiberStart(o),o},JM=se(2,(e,t)=>{if(e._exit)return e;if(t.state._tag==="Closed")return e.interruptUnsafe(e.id),e;const n={};return Ba(t,n,()=>Wp(e)),e.addObserver(()=>Jp(t,n)),e}),GM=sc(ir()),$k=e=>{const t=sc(e);return(n,o)=>{const i=t(n,o);return o!=null&&o.onExit&&i.addObserver(o.onExit),c=>i.interruptUnsafe(c)}},YM=$k(ir()),Xp=e=>{const t=sc(e);return(n,o)=>{const i=t(n,o);return new Promise(c=>{i.addObserver(l=>c(l))})}},XM=Xp(ir()),Uk=e=>{const t=Xp(e);return(n,o)=>t(n,o).then(i=>{if(i._tag==="Failure")throw Vp(i.cause);return i.value})},ZM=Uk(ir()),Zp=e=>{const t=sc(e);return n=>{var c;if(In(n))return n;const o=new sk("sync"),i=t(n,{scheduler:o});return(c=i.currentDispatcher)==null||c.flush(),i._exit??fi(new pA(i))}},eA=Zp(ir()),Bk=e=>{const t=Zp(e);return n=>{const o=t(n);if(o._tag==="Failure")throw Vp(o.cause);return o.value}},tA=Bk(ir()),jS=Re(!0),$S=Re(!1);class nA{constructor(t){A(this,"waiters",[]);A(this,"scheduled",!1);A(this,"isOpen");A(this,"flushWaiters",()=>{this.scheduled=!1;const t=this.waiters;this.waiters=[];for(let n=0;n<t.length;n++)t[n](qn)});A(this,"open",Ke(t=>this.isOpen?$S:(this.isOpen=!0,this.scheduleUnsafe(t))));A(this,"release",Ke(t=>this.isOpen?$S:this.scheduleUnsafe(t)));A(this,"await",ur(t=>this.isOpen?t(ut):(this.waiters.push(t),kt(()=>{const n=this.waiters.indexOf(t);n!==-1&&this.waiters.splice(n,1)}))));A(this,"close",kt(()=>this.closeUnsafe()));A(this,"whenOpen",t=>$e(this.await,()=>t));this.isOpen=t}scheduleUnsafe(t){return this.scheduled||this.waiters.length===0||(this.scheduled=!0,t.currentDispatcher.scheduleTask(this.flushWaiters,0)),jS}openUnsafe(){return this.isOpen?!1:(this.isOpen=!0,this.flushWaiters(),!0)}closeUnsafe(){return this.isOpen?(this.isOpen=!1,!0):!1}}const rA=e=>new nA(e??!1),Fm=BigInt(0),sA={_tag:"Span",spanId:"noop",traceId:"noop",sampled:!1,status:{_tag:"Ended",startTime:Fm,endTime:Fm,exit:qn},attributes:new Map,links:[],kind:"internal",attribute(){},event(){},end(){},addLinks(){}},oA=e=>Object.assign(Object.create(sA),e),zk=e=>e?oo(e.annotations,Cm)?e._tag==="Span"?zk(W1(e.parent)):Vn():Ne(e):Vn(),Vk=(e,t,n)=>{const o=!e.getRef(pT)||(n==null?void 0:n.annotations)&&oo(n.annotations,Cm),i=(n==null?void 0:n.parent)!==void 0?Ne(n.parent):n!=null&&n.root?Vn():zk(e.currentSpan);let c;if(o)c=oA({name:t,parent:i,annotations:Rs((n==null?void 0:n.annotations)??ir(),Cm,!0)});else{const l=e.getRef(fT),d=e.getRef(wi),h=e.getRef(ck),p=e.getRef(gT),y=e.getRef(yT),g=(n==null?void 0:n.level)??e.getRef(uT),v=(n==null?void 0:n.links)!==void 0?[...y,...n.links]:y.slice();c=l.span({name:t,parent:i,annotations:(n==null?void 0:n.annotations)??ir(),links:v,startTime:h?d.currentTimeNanosUnsafe():BigInt(0),kind:(n==null?void 0:n.kind)??"internal",root:(n==null?void 0:n.root)??vo(i),sampled:(n==null?void 0:n.sampled)??(_s(i)&&i.value.sampled===!1?!1:!Wk(e.getRef(lT),g))});for(const[w,S]of Object.entries(p))c.attribute(w,S);if((n==null?void 0:n.attributes)!==void 0)for(const[w,S]of Object.entries(n.attributes))c.attribute(w,S)}return c},iA=(e,t)=>Ak(Ke(n=>{const o=Ql(n.context,rf),i=Vk(n,e,t??{}),c=n.getRef(wi),l=n.getRef(ck);return xi(mi(o,d=>cA(i,d,c,l)),i)})),aA=(e,t)=>(t=typeof t=="function"?t:jl,_k(ak,n=>({name:e,stack:t,parent:n}))),cA=(e,t,n,o)=>kt(()=>{e.status._tag!=="Ended"&&e.end(o?n.currentTimeNanosUnsafe():Fm,t)}),uA=(e,...t)=>{const n=t.length===1?void 0:t[0],o=t[t.length-1];return Ke(i=>{const c=Vk(i,e,n),l=i.getRef(wi);return Ts(tn(()=>o(c)),d=>kt(()=>{c.status._tag!=="Ended"&&c.end(l.currentTimeNanosUnsafe(),d)}))})},US=nc(aT),lA=function(){const e=Jt(arguments[0]),t=e?arguments[1]:arguments[0];let n=e?arguments[2]:arguments[1],o=Ie;return t._tag==="Span"&&(n=wT(n),o=aA(t.name,n==null?void 0:n.captureStackTrace)),e?US(o(arguments[0]),t):i=>US(o(i),t)},wi=rt("effect/Clock",{defaultValue:()=>new dA}),fA=2**31-1;class dA{constructor(){A(this,"currentTimeMillis",kt(()=>this.currentTimeMillisUnsafe()));A(this,"currentTimeNanos",kt(()=>this.currentTimeNanosUnsafe()))}currentTimeMillisUnsafe(){return Date.now()}currentTimeNanosUnsafe(){return hA()}sleep(t){const n=Z1(t);return n<=0?Hp:ur(o=>{if(n>fA)return;const i=setTimeout(()=>o(ut),n);return kt(()=>clearTimeout(i))})}}const BS=(function(){const e=BigInt(1e6);if(typeof performance>"u"||typeof performance.now>"u")return()=>BigInt(Date.now())*e;if(typeof performance.timeOrigin=="number"&&performance.timeOrigin===0)return()=>BigInt(Math.round(performance.now()*1e6));const t=BigInt(Date.now())*e-BigInt(Math.round(performance.now()*1e6));return()=>t+BigInt(Math.round(performance.now()*1e6))})(),hA=(function(){const e=typeof process=="object"&&"hrtime"in process&&typeof process.hrtime.bigint=="function"?process.hrtime:void 0;if(!e)return BS;const t=BS()-e.bigint();return()=>t+e.bigint()})(),qk=e=>Ke(t=>e(t.getRef(wi))),eg=e=>qk(t=>t.sleep(jp(e))),zS="~effect/Cause/TimeoutError";var lw,fw;class mA extends(fw=Ap("TimeoutError"),lw=zS,fw){constructor(n){super({message:n});A(this,lw,zS)}}const VS="~effect/Cause/AsyncFiberError";var dw,hw;class pA extends(hw=Ap("AsyncFiberError"),dw=VS,hw){constructor(n){super({message:"An asynchronous Effect was executed with Effect.runSync",fiber:n});A(this,dw,VS)}}const gA=rt("effect/Console/CurrentConsole",{defaultValue:()=>globalThis.console}),yA=e=>{switch(e){case"All":return Number.MIN_SAFE_INTEGER;case"Fatal":return 5e4;case"Error":return 4e4;case"Warn":return 3e4;case"Info":return 2e4;case"Debug":return 1e4;case"Trace":return 0;case"None":return Number.MAX_SAFE_INTEGER}},vA=rR(Np,yA),Wk=V1(vA),SA=rt("effect/Loggers/CurrentLoggers",{defaultValue:()=>new Set([PA,FA])}),xA=rt("effect/Logger/LogToStderr",{defaultValue:p1}),wA="~effect/Logger",kA={[wA]:{_Message:Ie,_Output:Ie},pipe(){return $t(this,arguments)}},Hk=e=>{const t=Object.create(kA);return t.log=e,t},EA=e=>e.replace(/[\s="]/g,"_"),_A=(e,t)=>`${EA(e[0])}=${t-e[1]}ms`,Kk=e=>(...t)=>{let n;for(let o=0,i=t.length;o<i;o++){const c=t[o];Wl(c)&&(n?t.splice(o,1):t=t.slice(0,o).concat(t.slice(o+1)),n=n?Da(n.reasons.concat(c.reasons)):c,o--)}return n===void 0&&(n=$I),Ke(o=>{const i=e??o.currentLogLevel;if(Wk(o.minimumLogLevel,i))return ut;const c=o.getRef(wi),l=o.getRef(SA);if(l.size>0){const d=new Date(c.currentTimeMillisUnsafe());for(const h of l)h.log({cause:n,fiber:o,date:d,logLevel:i,message:t})}return ut})},CA=e=>`${e.getHours().toString().padStart(2,"0")}:${e.getMinutes().toString().padStart(2,"0")}:${e.getSeconds().toString().padStart(2,"0")}.${e.getMilliseconds().toString().padStart(3,"0")}`,bA=typeof process=="object"&&process!==null&&typeof process.stdout=="object"&&process.stdout!==null;bA&&process.stdout.isTTY;const PA=Hk(({cause:e,date:t,fiber:n,logLevel:o,message:i})=>{const c=Array.isArray(i)?i.slice():[i];e.reasons.length>0&&c.push(dk(e));const l=t.getTime(),d=n.getRef(xT);let h="";for(const v of d)h+=` ${_A(v,l)}`;const p=n.getRef(Up);Object.keys(p).length>0&&c.push(p);const y=n.getRef(gA);(n.getRef(xA)?y.error:y.log)(`[${CA(t)}] ${o.toUpperCase()} (#${n.id})${h}:`,...c)}),FA=Hk(({cause:e,fiber:t,logLevel:n,message:o})=>{const i=t.getRef(wi),c=t.getRef(Up),l=t.currentSpan;if(l===void 0||l._tag==="ExternalSpan")return;const d={};for(const[h,p]of Object.entries(c))d[h]=p;d["effect.fiberId"]=t.id,d["effect.logLevel"]=n.toUpperCase(),e.reasons.length>0&&(d["effect.cause"]=dk(e)),l.event(TI(Array.isArray(o)&&o.length===1?o[0]:o),i.currentTimeNanosUnsafe(),d)}),IA=Wl,RA=jI,Im=Da,Rm=e=>new b1(e),Tm=e=>new F1(e),Mm=CT,TA=RT,Qk=Vp,oc=So,MA=FT,AA=zp,tg=HI,cf=QI,LA=C1,Uh=lt,ba=zn,ic=Cr,OA=fi,NA=sM,Jk=qn,Gk=Kp,Yk=oM,DA=dM,jA="~effect/Deferred",$A={[jA]:{_A:Ie,_E:Ie},pipe(){return $t(this,arguments)}},ng=()=>{const e=Object.create($A);return e.resumes=void 0,e.effect=void 0,e},rg=e=>ur(t=>e.effect?t(e.effect):(e.resumes??(e.resumes=[]),e.resumes.push(t),kt(()=>{const n=e.resumes.indexOf(t);e.resumes.splice(n,1)}))),UA=se(2,(e,t)=>kt(()=>Pa(e,t))),Xk=UA,Pa=(e,t)=>{if(e.effect)return!1;if(e.effect=t,e.resumes){for(let n=0;n<e.resumes.length;n++)e.resumes[n](t);e.resumes=void 0}return!0},BA=se(2,(e,t)=>Nk(n=>$e(nf(n(e)),o=>Xk(t,o)))),zA=Up,qS=rf,sg=Gp,fl=NM,VA=mi,qA=LM,dl=AM,uf=Fk,WA="~effect/Layer",WS="~effect/Layer/MemoMap",HA={[WA]:{_ROut:Ie,_E:Ie,_RIn:Ie},pipe(){return $t(this,arguments)}},Zk=e=>{const t=Object.create(HA);return t.build=e,t},og=e=>Zk((t,n)=>{const o=dl(n);return Ts(e(t,o),i=>i._tag==="Failure"?uf(o,i):ut)}),KA=e=>{const t=og((n,o)=>n.getOrElseMemoize(t,o,e));return t};class QA{constructor(){A(this,"map",new Map)}get[WS](){return WS}getOrElseMemoize(t,n,o){if(this.map.has(t)){const d=this.map.get(t);return d.observers++,ec(mi(n,h=>d.finalizer(h)),d.effect)}const i=sg(),c=ng(),l={observers:1,effect:rg(c),finalizer:d=>Et(()=>(l.observers--,l.observers===0?(this.map.delete(t),uf(i,d)):ut))};return this.map.set(t,l),mi(n,l.finalizer).pipe($e(()=>o(this,i)),Ts(d=>(l.effect=d,Xk(c,d))))}}const ig=()=>new QA,Tl=class Tl extends Wn()("effect/Layer/CurrentMemoMap"){};A(Tl,"getOrCreate",IR(Tl,ig));let za=Tl;const ag=se(3,(e,t,n)=>nc(jt(e.build(t,n),Rs(za,t)),za,t)),JA=se(2,(e,t)=>Ke(n=>ag(e,za.getOrCreate(n.context),t))),cg=function(){return arguments.length===1?e=>HS(di(arguments[0],e)):HS(di(arguments[0],arguments[1]))},HS=e=>Zk(bs(Re(e))),Am=function(){return arguments.length===1?e=>KS(arguments[0],e):KS(arguments[0],arguments[1])},KS=(e,t)=>Lm(jt(t,n=>di(e,n))),Lm=e=>KA((t,n)=>fl(e,n)),eE=(e,t,n)=>{const o=dl(n,"parallel");return Ys(e,i=>i.build(t,dl(o,"sequential")),{concurrency:e.length}).pipe(jt(i=>AR(...i)))},tE=(...e)=>og((t,n)=>eE(e,t,n)),GA=(e,t,n)=>og((o,i)=>$e(Array.isArray(t)?eE(t,o,i):t.build(o,i),c=>e.build(o,i).pipe(tc(c),jt(l=>n(l,c))))),Om=se(2,(e,t)=>GA(e,t,Ie)),YA=class extends Dl{constructor(t){super(),t&&Object.assign(this,t)}},XA=se(2,(e,t)=>{const n=QS(e),o=QS(t),i=n>o?n:o,c=parseInt(e.toFixed(i).replace(".","")),l=parseInt(t.toFixed(i).replace(".",""));return c%l/Math.pow(10,i)});function QS(e){const t=e.toString(),n=t.indexOf("e-");if(n!==-1){const o=parseInt(t.slice(n+2));return(t.slice(0,n).split(".")[1]||"").length+o}return(t.split(".")[1]||"").length}const hl=se(2,(e,t)=>bk(e,tL,n=>t(n))),JS=e=>e.reasons.some(ZA),ZA=e=>e._tag==="Fail"&&tg(e.error),eL=tk(oc,e=>tg(e)?Hr(e):or(e)),tL=tk(oc,e=>tg(e)?Hr(e.value):or(e)),nE=se(2,(e,t)=>tf(e,{onSuccess:t.onSuccess,onFailure:n=>{const o=eL(n);return Mt(o)?t.onFailure(o.failure):t.onDone(o.success.value)}})),rE="~effect/Schedule",GS=rt("effect/Schedule/CurrentMetadata",{defaultValue:bs({input:void 0,output:void 0,duration:$p,attempt:0,start:0,now:0,elapsed:0,elapsedSincePrevious:0})}),nL={[rE]:{_Out:Ie,_In:Ie,_Env:Ie},pipe(){return $t(this,arguments)}},rL=e=>Ue(e,rE),lf=e=>{const t=Object.create(nL);return t.step=e,t},ug=()=>{let e=0,t,n;return(o,i)=>{n===void 0&&(n=o);const c=o-n,l=t===void 0?0:o-t;return t=o,{input:i,attempt:++e,start:n,now:o,elapsed:c,elapsedSincePrevious:l}}},sE=e=>lf(jt(e,t=>{const n=ug();return(o,i)=>t(n(o,i))})),Va=e=>rc(e.step,t=>Re(()=>Gt(t))),sL=e=>qk(t=>jt(Va(e),n=>{const o=ug();return i=>Et(()=>{const c=t.currentTimeMillisUnsafe();return $e(n(c,i),([l,d])=>{const h=o(c,i);return h.output=l,h.duration=d,xi(eg(d),h)})})})),oL=se(2,(e,t)=>iL(e,t,(n,o)=>[n,o])),iL=se(3,(e,t,n)=>lf(jt(gM(Va(e),Va(t)),([o,i])=>(c,l)=>nE(o(c,l),{onSuccess:d=>i(c,l).pipe(jt(h=>[n(d[0],h[0]),XR(d[1],h[1])]),hl(h=>Re([n(d[0],h),d[1]]))),onFailure:Gt,onDone:d=>i(c,l).pipe(jt(h=>[n(d,h[0]),h[1]]),hl(h=>cf(n(d,h))))})))),aL=(e,t=2)=>{const n=Z1(jp(e));return sE(Re(o=>{const i=$a(n*Math.pow(t,o.attempt-1));return Re([i,i])}))},oE=e=>lf(jt(Va(e),t=>(n,o)=>nE(t(n,o),{onSuccess:i=>Re([o,i[1]]),onFailure:Gt,onDone:()=>cf(o)}))),cL=e=>Wu(aE,({attempt:t})=>Re(t<=e)),iE=e=>{const t=jp(e);return sE(Re(n=>Re([n.attempt-1,t])))},Wu=se(2,(e,t)=>lf(jt(Va(e),n=>{const o=ug();return(i,c)=>$e(n(i,c),l=>{const[d,h]=l,p=t({...o(i,c),output:d,duration:h});return $e(Jt(p)?p:Re(p),y=>y?Re(l):cf(d))})}))),aE=iE($p),uL=(e,t,n)=>Tk(o=>$e(n!=null&&n.local?ag(t,ig(),o):JA(t,o),i=>tc(e,i))),lL=se(e=>Jt(e[0]),(e,t,n)=>J1(t)?tc(e,t):uL(e,Array.isArray(t)?tE(...t):t,n)),fL=se(3,(e,t,n)=>$e(sL(t),o=>{let i=GS.defaultValue(),c;const l=ef(Et(()=>nc(e,GS,i)),d=>(c=d,$e(o(d),h=>(i=h,l))));return hl(l,d=>tn(()=>n(c,d)))})),dL=se(2,(e,t)=>{const n=typeof t=="function"?t(Ie):rL(t)?t:mL(t);return fL(e,n,Yl)}),hL=oE(aE),mL=e=>{let t=e.schedule?oE(e.schedule):hL;return e.while&&(t=Wu(t,({input:n})=>{const o=e.while(n);return Jt(o)?o:Re(o)})),e.until&&(t=Wu(t,({input:n})=>{const o=e.until(n);return Jt(o)?jt(o,i=>!i):Re(!o)})),e.times!==void 0&&(t=Wu(t,({attempt:n})=>Re(n<=e.times))),t},ai=Jt,cE=Ys,uE=Yp,pL=qT,ft=Re,lg=VT,gL=zT,Er=Et,Bn=kt,gt=ut,YS=ur,yL=KT,Nm=QT,Ge=Yl,vL=Gt,SL=Xl,ml=Ke,Rn=$e,xL=ZT,wL=ec,kL=wk,XS=nf,Ms=jt,pl=rc,EL=wM,Hu=_M,_L=xM,CL=dL,bL=CM,PL=TM,lE=Pk,FL=RM,fE=Ek,IL=tf,gl=mM,dE=Ck,RL=lL,io=tc,TL=hM,ML=Zl,AL=nc,LL=Tk,hE=DM,mE=jM,OL=UM,pE=Ts,Dm=VM,fg=Ok,NL=zM,gE=vM,DL=iA,jL=uA,ZS=lA,$L=jk,dg=QM,jm=GM,yl=sc,UL=$k,BL=YM,Ku=ZM,zL=Uk,VL=XM,qL=Xp,hg=tA,WL=Bk,yE=eA,HL=Zp,ao=Sk,KL=Kk("Error"),QL=se(e=>ai(e[0]),(e,...t)=>_k(e,zA,n=>{const o={...n};return t.length===1?Object.assign(o,t[0]):o[t[0]]=t[1],o})),vE=eM,xo=tM,qa=nM,ri=XT,JL=rM,$m=JT;function xa(e,t,n){return t==="__proto__"?Object.defineProperty(e,t,{value:n,writable:!0,enumerable:!0,configurable:!0}):e[t]=n,e}function SE(e){return e.checks?e.checks[e.checks.length-1].annotations:e.annotations}function GL(e){return t=>{var n;return(n=SE(t))==null?void 0:n[e]}}const YL=GL("identifier"),mg=Ps(e=>{const t=YL(e);return typeof t=="string"?t:e.getExpected(mg)}),XL=e=>e.replace(/[/\\^$*+?.()|[\]{}]/g,"\\$&"),Qu=new WeakMap,xE="~effect/data/Redacted",ZL=e=>Ue(e,xE),ex=(e,t)=>{const n=Object.create(eO);return Qu.set(n,e),n},eO={[xE]:{_A:e=>e},label:void 0,...Is,toJSON(){return this.toString()},toString(){return`<redacted${bp(this.label)?":"+this.label:""}>`},[rn](){return vt(Qu.get(this))},[sn](e){return ZL(e)&&Pn(Qu.get(this),Qu.get(e))}},Um="~effect/SchemaIssue/Issue";function tO(e){return Ue(e,Um)}var mw;let br=(mw=Um,class{constructor(){A(this,mw,Um)}toString(){return lO(this)}}),nO=class extends br{constructor(n,o,i){super();A(this,"_tag","Filter");A(this,"actual");A(this,"filter");A(this,"issue");this.actual=n,this.filter=o,this.issue=i}};class rO extends br{constructor(n,o,i){super();A(this,"_tag","Encoding");A(this,"ast");A(this,"actual");A(this,"issue");this.ast=n,this.actual=o,this.issue=i}}class ar extends br{constructor(n,o){super();A(this,"_tag","Pointer");A(this,"path");A(this,"issue");this.path=n,this.issue=o}}class wE extends br{constructor(n){super();A(this,"_tag","MissingKey");A(this,"annotations");this.annotations=n}}class kE extends br{constructor(n,o){super();A(this,"_tag","UnexpectedKey");A(this,"ast");A(this,"actual");this.ast=n,this.actual=o}}class Qt extends br{constructor(n,o,i){super();A(this,"_tag","Composite");A(this,"ast");A(this,"actual");A(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class Pr extends br{constructor(n,o){super();A(this,"_tag","InvalidType");A(this,"ast");A(this,"actual");this.ast=n,this.actual=o}}class vl extends br{constructor(n,o){super();A(this,"_tag","InvalidValue");A(this,"actual");A(this,"annotations");this.actual=n,this.annotations=o}}class tx extends br{constructor(n,o,i){super();A(this,"_tag","AnyOf");A(this,"ast");A(this,"actual");A(this,"issues");this.ast=n,this.actual=o,this.issues=i}}class sO extends br{constructor(n,o,i){super();A(this,"_tag","OneOf");A(this,"ast");A(this,"actual");A(this,"successes");this.ast=n,this.actual=o,this.successes=i}}function Bm(e,t){if(tO(t))return t;if(typeof t=="string")return new vl(Ne(e),{message:t});const n=typeof t.issue=="string"?new vl(Ne(e),{message:t.issue}):t.issue;return new ar(t.path,n)}function oO(e,t){if(t!==void 0)return typeof t=="boolean"?t?void 0:new vl(Ne(e)):Bm(e,t)}function iO(e,t,n){return Array.isArray(n)?al(n)?n.length===1?Bm(e,n[0]):new Qt(t,Ne(e),K1(n,o=>Bm(e,o))):void 0:oO(e,n)}const aO=e=>{const t=Wa(e);if(t!==void 0)return t;switch(e._tag){case"InvalidType":return zm(mg(e.ast),nx(e.actual));case"InvalidValue":return`Invalid data ${nx(e.actual)}`;case"MissingKey":return"Missing key";case"UnexpectedKey":return`Unexpected key with value ${ht(e.actual)}`;case"Forbidden":return"Forbidden operation";case"OneOf":return`Expected exactly one member to match the input ${ht(e.actual)}`}},cO=e=>Wa(e.issue)??Wa(e);function zm(e,t){return`Expected ${e}, got ${t}`}function ni(e,t,n,o){switch(e._tag){case"Filter":{const i=o(e);if(i!==void 0)return[{path:t,message:i}];switch(e.issue._tag){case"InvalidValue":return[{path:t,message:zm(EE(e.filter),ht(e.actual))}];default:return ni(e.issue,t,n,o)}}case"Encoding":return ni(e.issue,t,n,o);case"Pointer":return ni(e.issue,[...t,...e.path],n,o);case"Composite":return e.issues.flatMap(i=>ni(i,t,n,o));case"AnyOf":{const i=Wa(e);if(e.issues.length===0){if(i!==void 0)return[{path:t,message:i}];const c=zm(mg(e.ast),ht(e.actual));return[{path:t,message:c}]}return e.issues.flatMap(c=>ni(c,t,n,o))}default:return[{path:t,message:n(e)}]}}function EE(e){var n;const t=(n=e.annotations)==null?void 0:n.expected;if(typeof t=="string")return t;switch(e._tag){case"Filter":return"<filter>";case"FilterGroup":return e.checks.map(o=>EE(o)).join(" & ")}}function uO(){return e=>ni(e,[],aO,cO).map(fO).join(`
|
|
82
|
+
`)}const lO=uO();function fO(e){let t=e.message;if(e.path&&e.path.length>0){const n=FI(e.path);t+=`
|
|
83
|
+
at ${n}`}return t}function Wa(e){switch(e._tag){case"InvalidType":case"OneOf":case"Composite":case"AnyOf":return ya(e.ast.annotations);case"InvalidValue":case"Forbidden":return ya(e.annotations);case"MissingKey":return ya(e.annotations,"messageMissingKey");case"UnexpectedKey":return ya(e.ast.annotations,"messageUnexpectedKey");case"Filter":return ya(e.filter.annotations);case"Encoding":return Wa(e.issue)}}function ya(e,t="message"){const n=e==null?void 0:e[t];if(typeof n=="string")return n}function nx(e){return vo(e)?"no value provided":ht(e.value)}class pi extends Dl{constructor(n){super();A(this,"run");this.run=n}map(n){return new pi((o,i)=>this.run(o,i).pipe(vE(Dp(n))))}compose(n){return rx(this)?n:rx(n)?this:new pi((o,i)=>this.run(o,i).pipe(ri(c=>n.run(c,i))))}}const _E=new pi(ft);function rx(e){return e.run===_E.run}function gi(){return _E}function gn(e){return dO(Dp(e))}function dO(e){return new pi(t=>ft(e(t)))}function hO(e){return new pi(t=>{const n=cR(t,tI);return _s(n)?ft(n):Ms(e,Ne)})}function mO(){return gn(globalThis.String)}function CE(){return gn(globalThis.Number)}const Vm="~effect/SchemaTransformation/Transformation";var pw;pw=Vm;const Ml=class Ml{constructor(t,n){A(this,pw,Vm);A(this,"_tag","Transformation");A(this,"decode");A(this,"encode");this.decode=t,this.encode=n}flip(){return new Ml(this.encode,this.decode)}compose(t){return new Ml(this.decode.compose(t.decode),t.encode.compose(this.encode))}};let Tn=Ml;function pO(e){return Ue(e,Vm)}const bE=e=>pO(e)?e:new Tn(e.decode,e.encode);function ff(e){return new Tn(gn(e.decode),gn(e.encode))}const gO=new Tn(gi(),gi());function pg(){return gO}const PE=new Tn(CE(),mO()),FE=e=>ff({decode:t=>{const n=new Error(t.message);return typeof t.name=="string"&&t.name!=="Error"&&(n.name=t.name),typeof t.stack=="string"&&(n.stack=t.stack),n},encode:t=>{const n={name:t.name,message:t.message};return e!=null&&e.includeStack&&typeof t.stack=="string"&&(n.stack=t.stack),n}});function wo(e){return t=>t._tag===e}const IE=wo("Declaration"),yO=wo("Never"),Sl=wo("Literal"),vO=wo("UniqueSymbol"),SO=wo("Arrays"),xO=wo("Objects"),wO=wo("Union");class At{constructor(t,n){A(this,"to");A(this,"transformation");this.to=t,this.transformation=n}}const kO={};class yi{constructor(t,n,o=void 0,i=void 0){A(this,"isOptional");A(this,"isMutable");A(this,"defaultValue");A(this,"annotations");this.isOptional=t,this.isMutable=n,this.defaultValue=o,this.annotations=i}}const sx="~effect/Schema";var gw;gw=sx;class vn{constructor(t=void 0,n=void 0,o=void 0,i=void 0){A(this,gw,sx);A(this,"annotations");A(this,"checks");A(this,"encoding");A(this,"context");this.annotations=t,this.checks=n,this.encoding=o,this.context=i}toString(){return`<${this._tag}>`}}class ac extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);A(this,"_tag","Declaration");A(this,"typeParameters");A(this,"run");this.typeParameters=n,this.run=o}getParser(){const n=this.run(this.typeParameters);return(o,i)=>vo(o)?lg:vE(n(o.value,this,i),Ne)}recur(n){const o=vi(this.typeParameters,n);return o===this.typeParameters?this:new ac(o,this.run,this.annotations,this.checks,void 0,this.context)}getExpected(){var o;const n=(o=this.annotations)==null?void 0:o.expected;return typeof n=="string"?n:"<Declaration>"}}let EO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Null")}getParser(){return mf(this,null)}getExpected(){return"null"}};const gg=new EO;let _O=class extends vn{constructor(){super(...arguments);A(this,"_tag","Undefined")}getParser(){return mf(this,void 0)}toCodecJson(){return Rt(this,[RE])}getExpected(){return"undefined"}};const RE=new At(gg,new Tn(gn(()=>{}),gn(()=>null))),CO=new _O;let bO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Void")}getParser(){return mf(this,void 0)}toCodecJson(){return Rt(this,[RE])}getExpected(){return"void"}};const PO=new bO;let FO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Never")}getParser(){return ko(this,rI)}getExpected(){return"never"}};const IO=new FO;let RO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Any")}getParser(){return ko(this,v1)}getExpected(){return"any"}};const TO=new RO;let MO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Unknown")}getParser(){return ko(this,v1)}getExpected(){return"unknown"}};const yg=new MO;let Fa=class extends vn{constructor(n,o,i,c,l){super(o,i,c,l);A(this,"_tag","Literal");A(this,"literal");if(typeof n=="number"&&!globalThis.Number.isFinite(n))throw new Error(`A numeric literal must be finite, got ${ht(n)}`);this.literal=n}getParser(){return mf(this,this.literal)}toCodecJson(){return typeof this.literal=="bigint"?ox(this):this}toCodecStringTree(){return typeof this.literal=="string"?this:ox(this)}getExpected(){return typeof this.literal=="string"?JSON.stringify(this.literal):globalThis.String(this.literal)}};function ox(e){const t=globalThis.String(e.literal);return Rt(e,[new At(new Fa(t),new Tn(gn(()=>e.literal),gn(()=>t)))])}let AO=class extends vn{constructor(){super(...arguments);A(this,"_tag","String")}getParser(){return ko(this,bp)}getExpected(){return"string"}};const TE=new AO;let LO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Number")}getParser(){return ko(this,y1)}toCodecJson(){return this.checks&&(wa(this.checks,"isFinite")||wa(this.checks,"isInt"))?this:Rt(this,[WO])}toCodecStringTree(){return this.checks&&(wa(this.checks,"isFinite")||wa(this.checks,"isInt"))?Rt(this,[t3]):Rt(this,[n3])}getExpected(){return"number"}};function wa(e,t){return e.some(n=>{var o,i;switch(n._tag){case"Filter":return((i=(o=n.annotations)==null?void 0:o.meta)==null?void 0:i._tag)===t;case"FilterGroup":return wa(n.checks,t)}})}const ME=new LO;let OO=class extends vn{constructor(){super(...arguments);A(this,"_tag","Boolean")}getParser(){return ko(this,eI)}getExpected(){return"boolean"}};const NO=new OO;class df extends vn{constructor(n,o,i,c,l,d,h){super(c,l,d,h);A(this,"_tag","Arrays");A(this,"isMutable");A(this,"elements");A(this,"rest");this.isMutable=n,this.elements=o,this.rest=i;const p=o.findIndex(qr);if(p!==-1&&(o.slice(p+1).some(y=>!qr(y))||i.length>1))throw new Error("A required element cannot follow an optional element. ts(1257)");if(i.length>1&&i.slice(1).some(qr))throw new Error("An optional element cannot follow a rest element. ts(1266)")}getParser(n){const o=this,i=o.elements.map(g=>({ast:g,parser:n(g)})),c=o.rest.map(g=>({ast:g,parser:n(g)})),l=i.length,[d,...h]=c,p=h.length;function y(g,v){return v<l?i[v]:v>=g?h[v-g]:d}return $m(function*(g,v){if(g._tag==="None")return g;const w=g.value;if(!Array.isArray(w))return yield*Ge(new Pr(o,g));const S=w.length,E={ast:o,getParser:y,oinput:g,len:S,tailThreshold:jO(S,l,p),output:new globalThis.Array(S),issues:void 0,options:v},F=vg(v==null?void 0:v.concurrency),K=DO(E,w,{concurrency:F==null?void 0:F.concurrency,end:o.rest.length===0?l:Math.max(S,l+p)});if(K&&(yield*K),o.rest.length===0&&S>l)for(let _=l;_<=S-1;_++){const L=new ar([_],new kE(o,w[_]));if(v.errors==="all")E.issues?E.issues.push(L):E.issues=[L];else return yield*Ge(new Qt(o,g,[L]))}return E.issues?yield*Ge(new Qt(o,g,E.issues)):Ne(E.output)})}recur(n){const o=vi(this.elements,n),i=vi(this.rest,n);return o===this.elements&&i===this.rest?this:new df(this.isMutable,o,i,this.annotations,this.checks,void 0,this.context)}getExpected(){return"array"}}const DO=of()({onItem(e,t,n){const o=n<e.len?Ne(t):Vn();return e.getParser(e.tailThreshold,n).parser(o,e.options)},step(e,t,n,o){var i;if(n._tag==="Failure")return xl(e,e.ast,o,n);if(n.value._tag==="Some")e.output[o]=n.value.value;else{const c=e.getParser(e.tailThreshold,o);if(qr(c.ast))return;const l=new ar([o],new wE((i=c.ast.context)==null?void 0:i.annotations));if(e.options.errors==="all")e.issues?e.issues.push(l):e.issues=[l];else return ic(new Qt(e.ast,e.oinput,[l]))}}});function jO(e,t,n){return Math.max(t,e-n)}const vg=e=>(e=e==="unbounded"?1/0:e??1,e>1?{concurrency:e}:void 0),xl=(e,t,n,o)=>{const i=oc(o.cause);if(Mt(i))return o;const c=new ar([n],i.success);if(e.options.errors==="all")e.issues?e.issues.push(c):e.issues=[c];else return ic(new Qt(t,e.oinput,[c]))},Sg="[+-]?\\d*\\.?\\d+(?:[Ee][+-]?\\d+)?",$O=new globalThis.RegExp(`(?:${Sg}|Infinity|-Infinity|NaN)`);function AE(e,t){const n=ks(t);switch(n._tag){case"String":return Object.keys(e);case"TemplateLiteral":{const o=YO(n);return Object.keys(e).filter(i=>o.test(i))}case"Symbol":return Object.getOwnPropertySymbols(e);case"Number":return Object.keys(e).filter(o=>$O.test(o));case"Union":return[...new Set(n.types.flatMap(o=>AE(e,o)))];default:return[]}}class LE{constructor(t,n){A(this,"name");A(this,"type");this.name=t,this.type=n}}class UO{constructor(t,n,o){A(this,"parameter");A(this,"type");A(this,"merge");if(this.parameter=t,this.type=n,this.merge=o,qr(n)&&!KE(n))throw new Error("Cannot use `Schema.optionalKey` with index signatures, use `Schema.optional` instead.")}}class xg extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);A(this,"_tag","Objects");A(this,"propertySignatures");A(this,"indexSignatures");this.propertySignatures=n,this.indexSignatures=o;const h=n.map(p=>p.name).filter((p,y,g)=>g.indexOf(p)!==y);if(h.length>0)throw new Error(`Duplicate identifiers: ${JSON.stringify(h)}. ts(2300)`)}getParser(n){const o=this,i=[],c=new Set,l=[];for(const p of o.propertySignatures)i.push(p.name),c.add(p.name),l.push({ps:p,parser:n(p.type),name:p.name,type:p.type});const d=o.indexSignatures.length;if(o.propertySignatures.length===0&&o.indexSignatures.length===0)return ko(o,nI);const h=d>0?of()({onItem:$m(function*(p,[y,g]){const w=n(YE(g.parameter))(Ne(y),p.options),S=In(w)?w:yield*XS(w);if(S._tag==="Failure"){const L=xl(p,o,y,S);L&&(yield*L);return}const E=Ne(p.input[y]),K=n(g.type)(E,p.options),_=In(K)?K:yield*XS(K);if(_._tag==="Failure"){const L=xl(p,o,y,_);L&&(yield*L);return}else if(S.value._tag==="Some"&&_.value._tag==="Some"){const L=S.value.value,C=_.value.value;if(g.merge&&g.merge.decode&&Object.hasOwn(p.out,L)){const[D,$]=g.merge.decode.combine([L,p.out[L]],[L,C]);xa(p.out,D,$)}else xa(p.out,L,C)}}),step:(p,y,g)=>g._tag==="Failure"?g:void 0}):void 0;return $m(function*(p,y){if(p._tag==="None")return p;const g=p.value;if(!(typeof g=="object"&&g!==null&&!Array.isArray(g)))return yield*Ge(new Pr(o,p));const v={},w={ast:o,oinput:p,input:g,out:v,issues:void 0,options:y},S=y.errors==="all",E=y.onExcessProperty==="error",F=y.onExcessProperty==="preserve";let K;if(o.indexSignatures.length===0&&(E||F)){K=Reflect.ownKeys(g);for(let C=0;C<K.length;C++){const D=K[C];if(!c.has(D))if(E){const $=new ar([D],new kE(o,g[D]));if(S){w.issues?w.issues.push($):w.issues=[$];continue}else return yield*Ge(new Qt(o,p,[$]))}else xa(v,D,g[D])}}const _=vg(y==null?void 0:y.concurrency),L=BO(w,l,_);if(L&&(yield*L),h){const C=_R();for(let $=0;$<d;$++){const N=o.indexSignatures[$],T=AE(g,N.parameter);for(let q=0;q<T.length;q++){const ee=T[q];C.push([ee,N])}}const D=h(w,C,_);D&&(yield*D)}if(w.issues)return yield*Ge(new Qt(o,p,w.issues));if(y.propertyOrder==="original"){const C=(K??Reflect.ownKeys(g)).concat(i),D={};for(const $ of C)Object.hasOwn(v,$)&&xa(D,$,v[$]);return Ne(D)}return Ne(v)})}rebuild(n,o){const i=vi(this.propertySignatures,l=>{const d=n(l.type);return d===l.type?l:new LE(l.name,d)}),c=vi(this.indexSignatures,l=>{var y;const d=n(l.parameter),h=n(l.type),p=o?(y=l.merge)==null?void 0:y.flip():l.merge;return d===l.parameter&&h===l.type&&p===l.merge?l:new UO(d,h,p)});return i===this.propertySignatures&&c===this.indexSignatures?this:new xg(i,c,this.annotations,this.checks,void 0,this.context)}flip(n){return this.rebuild(n,!0)}recur(n){return this.rebuild(n,!1)}getExpected(){return this.propertySignatures.length===0&&this.indexSignatures.length===0?"object | array":"object"}}const BO=of()({onItem(e,t){const n=Object.hasOwn(e.input,t.name)?Ne(e.input[t.name]):Vn();return t.parser(n,e.options)},step(e,t,n){var o;if(n._tag==="Failure")return xl(e,e.ast,t.name,n);if(n.value._tag==="Some")xa(e.out,t.name,n.value.value);else if(!qr(t.type)){const i=new ar([t.name],new wE((o=t.type.context)==null?void 0:o.annotations));if(e.options.errors==="all"){e.issues?e.issues.push(i):e.issues=[i];return}else return ic(new Qt(e.ast,e.oinput,[i]))}}});function wg(e,t,n){return new xg(Reflect.ownKeys(e).map(o=>new LE(o,e[o].ast)),[],n,t)}function OE(e){return e.ast}function kg(e,t,n){return new cc(e.map(OE),t,void 0,n)}function NE(e){switch(e._tag){case"Null":return["null"];case"Undefined":case"Void":return["undefined"];case"String":case"TemplateLiteral":return["string"];case"Number":return["number"];case"Boolean":return["boolean"];case"Symbol":case"UniqueSymbol":return["symbol"];case"BigInt":return["bigint"];case"Arrays":return["array"];case"ObjectKeyword":return["object","array","function"];case"Objects":return e.propertySignatures.length||e.indexSignatures.length?["object"]:["object","array"];case"Enum":return Array.from(new Set(e.enums.map(([,t])=>typeof t)));case"Literal":return[typeof e.literal];case"Union":return Array.from(new Set(e.types.flatMap(NE)));default:return["null","undefined","string","number","boolean","symbol","bigint","object","array","function"]}}function Eg(e){var t;switch(e._tag){default:return[];case"Declaration":{const n=(t=e.annotations)==null?void 0:t["~sentinels"];return Array.isArray(n)?n:[]}case"Objects":return e.propertySignatures.flatMap(n=>{const o=n.type;if(!qr(o)){if(Sl(o))return[{key:n.name,literal:o.literal}];if(vO(o))return[{key:n.name,literal:o.symbol}]}return[]});case"Arrays":return e.elements.flatMap((n,o)=>Sl(n)&&!qr(n)?[{key:o,literal:n.literal}]:[]);case"Suspend":return Eg(e.thunk())}}const ix=new WeakMap;function zO(e){var n,o;let t=ix.get(e);if(t)return t;t={};for(const i of e){const c=ks(i);if(yO(c))continue;const l=NE(c),d=Eg(c);t.byType??(t.byType={});for(const h of l)((n=t.byType)[h]??(n[h]=[])).push(i);if(d.length>0){t.bySentinel??(t.bySentinel=new Map);for(const{key:h,literal:p}of d){let y=t.bySentinel.get(h);y||t.bySentinel.set(h,y=new Map);let g=y.get(p);g||y.set(p,g=[]),g.push(i)}}else{t.otherwise??(t.otherwise={});for(const h of l)((o=t.otherwise)[h]??(o[h]=[])).push(i)}}return ix.set(e,t),t}function ax(e){return t=>{const n=ks(t);return n._tag==="Literal"?n.literal===e:n._tag==="UniqueSymbol"?n.symbol===e:!0}}function VO(e,t){var i,c;const n=zO(t),o=e===null?"null":Array.isArray(e)?"array":typeof e;if(n.bySentinel){const l=((i=n.otherwise)==null?void 0:i[o])??[];if(o==="object"||o==="array"){for(const[d,h]of n.bySentinel)if(Object.hasOwn(e,d)){const p=h.get(e[d]);if(p)return[...p,...l].filter(ax(e))}}return l}return(((c=n.byType)==null?void 0:c[o])??[]).filter(ax(e))}let cc=class DE extends vn{constructor(n,o,i,c,l,d){super(i,c,l,d);A(this,"_tag","Union");A(this,"types");A(this,"mode");this.types=n,this.mode=o}getParser(n){const o=this;return(i,c)=>{if(i._tag==="None")return ft(i);const l=i.value,d=VO(l,o.types),h={ast:o,recur:n,oinput:i,input:l,out:void 0,successes:[],issues:void 0,options:c},p=vg(c==null?void 0:c.concurrency),y=qO(h,d,p);return y?Rn(y,g=>h.out?ft(h.out):Ge(new tx(o,l,h.issues??[]))):h.out?ft(h.out):Ge(new tx(o,l,h.issues??[]))}}recur(n){const o=vi(this.types,n);return o===this.types?this:new DE(o,this.mode,this.annotations,this.checks,void 0,this.context)}getExpected(n){var c;const o=(c=this.annotations)==null?void 0:c.expected;if(typeof o=="string")return o;if(this.types.length===0)return"never";const i=this.types.map(l=>{const d=ks(l);switch(d._tag){case"Arrays":{const h=d.elements.filter(Sl);if(h.length>0)return`${cx(d.isMutable)}[ ${h.map(p=>{var y;return n(p)+ux((y=p.context)==null?void 0:y.isOptional)}).join(", ")}, ... ]`;break}case"Objects":{const h=d.propertySignatures.filter(p=>Sl(p.type));if(h.length>0)return`{ ${h.map(p=>{var y,g;return`${cx((y=p.type.context)==null?void 0:y.isMutable)}${il(p.name)}${ux((g=p.type.context)==null?void 0:g.isOptional)}: ${n(p.type)}`}).join(", ")}, ... }`;break}}return n(d)});return Array.from(new Set(i)).join(" | ")}};const qO=of()({onItem(e,t){return e.recur(t)(e.oinput,e.options)},step(e,t,n){if(n._tag==="Failure"){const o=oc(n.cause);if(Mt(o))return n;e.issues?e.issues.push(o.success):e.issues=[o.success]}else{if(e.out&&e.ast.mode==="oneOf")return e.successes.push(t),ic(new sO(e.ast,e.input,e.successes));if(e.out=n.value,e.successes.push(t),e.ast.mode==="anyOf")return Jk}}}),jE=new cc([new Fa("Infinity"),new Fa("-Infinity"),new Fa("NaN")],"anyOf"),WO=new At(new cc([ME,jE],"anyOf"),new Tn(CE(),gn(e=>globalThis.Number.isFinite(e)?e:globalThis.String(e))));function cx(e){return e?"":"readonly "}function ux(e){return e?"?":""}class wl extends Dl{constructor(n,o=void 0,i=!1){super();A(this,"_tag","Filter");A(this,"run");A(this,"annotations");A(this,"aborted");this.run=n,this.annotations=o,this.aborted=i}annotate(n){return new wl(this.run,{...this.annotations,...n},this.aborted)}abort(){return new wl(this.run,this.annotations,!0)}and(n,o){return new kl([this,n],o)}}class kl extends Dl{constructor(n,o=void 0){super();A(this,"_tag","FilterGroup");A(this,"checks");A(this,"annotations");this.checks=n,this.annotations=o}annotate(n){return new kl(this.checks,{...this.annotations,...n})}and(n,o){return new kl([this,n],o)}}function $E(e,t,n=!1){return new wl((o,i,c)=>iO(o,i,e(o,i,c)),t,n)}function UE(e,t){const n=e.source;return $E(o=>e.test(o),{expected:`a string matching the RegExp ${n}`,meta:{_tag:"isPattern",regExp:e},toArbitraryConstraint:{string:{patterns:[e.source]}},...t})}function hf(e,t){const n=Object.getOwnPropertyDescriptors(e);return t(n),Object.create(Object.getPrototypeOf(e),n)}function Rt(e,t){return e.encoding===t?e:hf(e,n=>{n.encoding.value=t})}function _g(e,t){return e.context===t?e:hf(e,n=>{n.context.value=t})}function BE(e,t){if(e.checks){const n=e.checks[e.checks.length-1];return zE(e,H1(e.checks.slice(0,-1),n.annotate(t)))}return hf(e,n=>{n.annotations.value={...n.annotations.value,...t}})}function zE(e,t){return e.checks===t?e:hf(e,n=>{n.checks.value=t})}function Cg(e,t){return zE(e,e.checks?[...e.checks,...t]:t)}function VE(e,t){const n=e,o=n[n.length-1],i=t(o.to);return i!==o.to?H1(e.slice(0,e.length-1),new At(i,o.transformation)):e}function HO(e){return t=>t.encoding?Rt(t,VE(t.encoding,e)):t}function KO(e,t,n){const o=new At(e,t);return Rt(n,n.encoding?[...n.encoding,o]:[o])}function vi(e,t){let n=!1;const o=new Array(e.length);for(let i=0;i<e.length;i++){const c=e[i],l=t(c);l!==c&&(n=!0),o[i]=l}return n?o:e}function qE(e,t){const n=e.context?new yi(e.context.isOptional,e.context.isMutable,e.context.defaultValue,{...e.context.annotations,...t}):new yi(!1,!1,void 0,t);return _g(e,n)}const WE=HO(HE);function HE(e){const t=e.context?e.context.isOptional===!1?new yi(!0,e.context.isMutable,e.context.defaultValue,e.context.annotations):e.context:new yi(!0,!1);return WE(_g(e,t))}function QO(e,t){const n=new Tn(hO(t),gi()),o=[new At(yg,n)],i=e.context?new yi(e.context.isOptional,e.context.isMutable,o,e.context.annotations):new yi(!1,!1,o);return _g(e,i)}function JO(e,t,n){return KO(e,n,t)}function qr(e){var t;return((t=e.context)==null?void 0:t.isOptional)??!1}const El=Ps(e=>{var n;if(e.encoding)return El(Rt(e,void 0));const t=e;return((n=t.recur)==null?void 0:n.call(t,El))??t}),ks=Ps(e=>El(co(e)));function GO(e,t){const n=t,o=n.length,i=n[o-1],c=[new At(co(Rt(e,void 0)),n[0].transformation.flip())];for(let d=1;d<o;d++)c.unshift(new At(co(n[d-1].to),n[d].transformation.flip()));const l=co(i.to);return l.encoding?Rt(l,[...l.encoding,...c]):Rt(l,c)}const co=Ps(e=>{var n,o;if(e.encoding)return GO(e,e.encoding);const t=e;return((n=t.flip)==null?void 0:n.call(t,co))??((o=t.recur)==null?void 0:o.call(t,co))??t});function KE(e){switch(e._tag){case"Undefined":return!0;case"Union":return e.types.some(KE);default:return!1}}function QE(e,t){return e.encodedParts.map(n=>XO(n,JE(n),t)).join("")}const YO=Ps(e=>new globalThis.RegExp(`^${QE(e,!0)}$`));function JE(e){switch(e._tag){case"Literal":return XL(globalThis.String(e.literal));case"String":return ZO;case"Number":return Sg;case"BigInt":return r3;case"TemplateLiteral":return QE(e,!1);case"Union":return e.types.map(JE).join("|")}}function XO(e,t,n){if(wO(e)){if(!n)return`(?:${t})`}else if(!n)return t;return`(${t})`}function mf(e,t){const n=gL(t);return o=>o._tag==="None"?lg:o.value===t?n:Ge(new Pr(e,o))}function ko(e,t){return n=>n._tag==="None"?lg:t(n.value)?ft(n):Ge(new Pr(e,n))}function GE(e){function t(n){return n.encoding?Rt(n,VE(n.encoding,t)):e(n)}return Ps(t)}const YE=GE(e=>{switch(e._tag){default:return e;case"Number":return e.toCodecStringTree();case"Union":return e.recur(YE)}}),ZO="[\\s\\S]*?",lx=new globalThis.RegExp(`^${Sg}$`);function e3(e){return UE(lx,{expected:"a string representing a finite number",meta:{_tag:"isStringFinite",regExp:lx},...e})}const XE=Cg(TE,[e3()]),t3=new At(XE,PE),n3=new At(new cc([XE,jE],"anyOf"),PE),r3="-?\\d+";function qm(e,t,n,o,i){for(let c=0;c<e.length;c++){const l=e[c];if(l._tag==="FilterGroup")qm(l.checks,t,n,o,i);else{const d=l.run(t,o,i);if(d&&(n.push(new nO(t,l,d)),l.aborted||(i==null?void 0:i.errors)!=="all"))return}}}const ZE="~effect/Schema/Class",s3="~structural";function o3(e){const t=new Set,n=new Set;return o(e);function o(i){if(i===null||typeof i=="string"||typeof i=="boolean")return!0;if(typeof i=="number")return globalThis.Number.isFinite(i);if(typeof i!="object"||i===void 0||t.has(i))return!1;if(n.has(i))return!0;t.add(i);const c=Array.isArray(i)?i.every(o):Object.keys(i).every(l=>o(i[l]));return t.delete(i),c&&n.add(i),c}}const i3=new ac([],()=>(e,t)=>o3(e)?ft(e):Ge(new Pr(t,Ne(e))),{typeConstructor:{_tag:"effect/Json"},generation:{runtime:"Schema.Json",Type:"Schema.Json"},expected:"JSON value",toCodecJson:()=>new At(yg,pg())}),a3=new At(gg,new Tn(gi(),gn(()=>null))),c3=new At(i3,pg()),u3=pk,e_=Wp,l3=ll,Wm=qp,f3=JM,t_=rA,d3=Symbol.for("effect/MutableList/Empty"),h3=()=>({head:void 0,tail:void 0,length:0}),fx=()=>({array:[],mutable:!0,offset:0,next:void 0}),Hm=(e,t)=>{e.tail?e.tail.mutable||(e.tail.next=fx(),e.tail=e.tail.next):e.head=e.tail=fx(),e.tail.array.push(t),e.length++},m3=(e,t)=>p3(e,kr(t),!Array.isArray(t)),p3=(e,t,n=!1)=>{if(t.length===0)return 0;const o={array:t,mutable:n,offset:0,next:void 0};return e.head?e.tail=e.tail.next=o:e.head=e.tail=o,e.length+=t.length,t.length},Ju=e=>{e.head=e.tail=void 0,e.length=0},n_=(e,t)=>{var c;if(t<=0||!e.head)return[];if(t=Math.min(t,e.length),t===e.length&&((c=e.head)==null?void 0:c.offset)===0&&!e.head.next){const l=e.head.array;return Ju(e),l}const n=new Array(t);let o=0,i=e.head;for(;i;){for(;i.offset<i.array.length;)if(n[o++]=i.array[i.offset],i.mutable&&(i.array[i.offset]=void 0),i.offset++,o===t)return e.head=i,e.length-=t,e.length===0&&Ju(e),n;i=i.next}return Ju(e),n},g3=e=>{if(!e.head)return d3;const t=e.head.array[e.head.offset];return e.head.mutable&&(e.head.array[e.head.offset]=void 0),e.head.offset++,e.length--,e.head.offset===e.head.array.length&&(e.head.next?e.head=e.head.next:Ju(e)),t},y3="~effect/Queue",v3="~effect/Queue/Enqueue",S3="~effect/Queue/Dequeue",Bh={_A:Ie,_E:Ie},x3={[y3]:Bh,[v3]:Bh,[S3]:Bh,...Is,toJSON(){return{_id:"effect/Queue",state:this.state._tag,size:P3(this)}}},w3=e=>Ke(t=>{const n=Object.create(x3);return n.dispatcher=t.currentDispatcher,n.capacity=(e==null?void 0:e.capacity)??Number.POSITIVE_INFINITY,n.strategy=(e==null?void 0:e.strategy)??"suspend",n.messages=h3(),n.scheduleRunning=!1,n.state={_tag:"Open",takers:new Set,offers:new Set,awaiters:new Set},Re(n)}),k3=e=>w3({capacity:e}),E3=(e,t)=>Et(()=>{if(e.state._tag!=="Open")return Re(kr(t));const n=_3(e,t);return n.length===0?lt([]):e.strategy==="dropping"?Re(n):M3(e,n)}),_3=(e,t)=>{if(e.state._tag!=="Open")return kr(t);if(e.capacity===Number.POSITIVE_INFINITY||e.strategy==="sliding")return m3(e.messages,t),e.strategy==="sliding"&&n_(e.messages,e.messages.length-e.capacity),hx(e),[];const n=e.capacity<=0?e.state.takers.size:e.capacity-e.messages.length;if(n===0)return kr(t);const o=[];let i=0;for(const c of t)i<n?Hm(e.messages,c):o.push(c),i++;return hx(e),o},ka=se(2,(e,t)=>kt(()=>C3(e,t))),C3=(e,t)=>{if(e.state._tag!=="Open")return!1;const n=zn(t),o=lM(n,I3);return e.state.offers.size===0&&e.messages.length===0?(s_(e,o),!0):(e.state={...e.state,_tag:"Closing",exit:o},!0)},dx=e=>ka(e,P1(Lp())),b3=e=>r_(e,1,Number.POSITIVE_INFINITY),r_=(e,t,n)=>Et(()=>T3(e,t,n)??ec(A3(e),r_(e,1,n))),P3=e=>e.state._tag==="Done"?0:e.messages.length,F3=lt(!0),I3=Cr(Lp()),R3=e=>{if(e.scheduleRunning=!1,!(e.state._tag==="Done"||e.state.takers.size===0)){for(const t of e.state.takers)if(e.state.takers.delete(t),t(qn),e.messages.length===0)break}},hx=e=>{e.scheduleRunning||e.state._tag==="Done"||e.state.takers.size===0||(e.scheduleRunning=!0,e.dispatcher.scheduleTask(()=>R3(e),0))},T3=(e,t,n)=>{if(e.state._tag==="Done")return e.state.exit;if(n<=0||t<=0)return lt([]);if(e.capacity<=0&&e.state.offers.size>0){e.capacity=1,zh(e),e.capacity=0;const o=[g3(e.messages)];return zh(e),lt(o)}if(t=Math.min(t,e.capacity||1),t<=e.messages.length){const o=n_(e.messages,n);return zh(e),lt(o)}},M3=(e,t)=>ur(n=>{if(e.state._tag!=="Open")return n(lt(t));const o={_tag:"Array",remaining:t,offset:0,resume:n};return e.state.offers.add(o),kt(()=>{e.state._tag==="Open"&&e.state.offers.delete(o)})}),zh=e=>{if(e.state._tag==="Done")return JS(e.state.exit.cause);if(e.state.offers.size===0)return e.state._tag==="Closing"&&e.messages.length===0?(s_(e,e.state.exit),JS(e.state.exit.cause)):!1;let t=e.capacity-e.messages.length;for(const n of e.state.offers){if(t===0)break;if(n._tag==="Single")Hm(e.messages,n.message),t--,n.resume(F3),e.state.offers.delete(n);else{for(;n.offset<n.remaining.length;n.offset++){if(t===0)return!1;Hm(e.messages,n.remaining[n.offset]),t--}n.resume(lt([])),e.state.offers.delete(n)}}return!1},A3=e=>ur(t=>e.state._tag==="Done"?t(e.state.exit):(e.state.takers.add(t),kt(()=>{e.state._tag!=="Done"&&e.state.takers.delete(t)}))),s_=(e,t)=>{if(e.state._tag==="Done")return;const n=e.state;e.state={_tag:"Done",exit:t};for(const o of n.takers)o(t);n.takers.clear();for(const o of n.awaiters)o(t);n.awaiters.clear()},L3="~effect/Channel",O3={[L3]:{_Env:Ie,_InErr:Ie,_InElem:Ie,_OutErr:Ie,_OutElem:Ie},pipe(){return $t(this,arguments)}},uc=e=>{const t=Object.create(O3);return t.transform=(n,o)=>pl(e(n,o),i=>ft(vL(i))),t},N3=(e,t)=>uc((n,o)=>Rn(lc(e)(n,o),i=>t(i,o))),D3=e=>uc((t,n)=>e),lc=e=>e.transform,j3=e=>uc((t,n)=>Er(()=>lc(e())(t,n))),$3=e=>D3(ft(b3(e))),U3=se(2,(e,t)=>N3(e,n=>Bn(()=>{let o=0;return Ms(n,i=>t(i,o++))}))),B3=e=>uc((t,n)=>{let o;return ft(Er(()=>o||e.pipe(fl(n),Rn(i=>lc(i)(t,n)),Rn(i=>o=i))))}),z3=(e,t,n)=>Er(()=>{const o=sg(),i=lc(e)(cf(),o);return hl(Rn(i,t),ft).pipe(pE(c=>uf(o,c)))}),V3=se(2,(e,t)=>uc((n,o)=>Ms(io(lc(e)(n,o),t),io(t)))),q3=se(2,(e,t)=>z3(e,n=>gE(Rn(n,t),{disableYield:!0}))),ki=e=>e,Ea=Ps(e=>{var t;switch(e._tag){case"Declaration":{const n=(t=e.annotations)==null?void 0:t[ZE];if($l(n)){const o=n(e.typeParameters),i=Ea(o.to);return Rt(e,i===o.to?[o]:[new At(i,o.transformation)])}return e}case"Objects":case"Arrays":return e.recur(n=>{var i;const o=(i=n.context)==null?void 0:i.defaultValue;return o?Rt(Ea(n),o):Ea(n)});case"Suspend":return e.recur(Ea);default:return e}});function pf(e){const t=Ea(El(e.ast)),n=bg(t);return(o,i)=>n(o,i!=null&&i.disableChecks?i!=null&&i.parseOptions?{...i.parseOptions,disableChecks:!0}:{disableChecks:!0}:i==null?void 0:i.parseOptions)}function o_(e){const t=pf(e);return(n,o)=>DA(yE(t(n,o)))}function W3(e){const t=pf(e);return(n,o)=>hg(xo(t(n,o),i=>new Error(i.toString(),{cause:i})))}function mo(e){return bg(e.ast)}function H3(e){return J3(mo(e))}const K3=H3;function Q3(e){return bg(co(e.ast))}function bg(e){const t=Gu(e);return(n,o)=>ri(t(Ne(n),o??kO),i=>i._tag==="None"?Ge(new vl(i)):ft(i.value))}function J3(e){return(t,n)=>hg(xo(e(t,n),o=>new Error(o.toString(),{cause:o})))}const Gu=Ps(e=>{var i;let t;const n=(i=SE(e))==null?void 0:i.parseOptions;if(!e.context&&!e.encoding&&!e.checks)return(c,l)=>(t??(t=e.getParser(Gu)),n&&(l={...l,...n}),t(c,l));const o=SO(e)||xO(e)||IE(e)&&e.typeParameters.length>0;return(c,l)=>{n&&(l={...l,...n});const d=e.encoding;let h;if(d){const y=d,g=y.length;for(let v=g-1;v>=0;v--){const w=y[v],S=w.to,E=Gu(S);if(h=h?ri(h,F=>E(F,l)):E(c,l),w.transformation._tag==="Transformation"){const F=w.transformation.decode;h=ri(h,K=>F.run(K,l))}else h=w.transformation.decode(h,l)}h=xo(h,v=>new rO(e,c,v))}t??(t=e.getParser(Gu));let p=h?ri(h,y=>t(y,l)):t(c,l);if(e.checks&&!(l!=null&&l.disableChecks)){const y=e.checks;(l==null?void 0:l.errors)==="all"&&o&&_s(c)&&(p=JL(p,g=>{const v=[];qm(y.filter(S=>{var E;return(E=S.annotations)==null?void 0:E[s3]}),c.value,v,e,l);const w=PS(v)?g._tag==="Composite"&&g.ast===e?new Qt(e,g.actual,[...g.issues,...v]):new Qt(e,c,[g,...v]):g;return Ge(w)})),p=ri(p,g=>{if(_s(g)){const v=g.value,w=[];if(qm(y,v,w,e,l),PS(w))return Ge(new Qt(e,g,w))}return ft(g)})}return p}}),Km="~effect/Schema/Schema",G3={[Km]:Km,pipe(){return $t(this,arguments)},annotate(e){return this.rebuild(BE(this.ast,e))},annotateKey(e){return this.rebuild(qE(this.ast,e))},check(...e){return this.rebuild(Cg(this.ast,e))}};function Pg(e,t){const n=Object.create(G3);return t&&Object.assign(n,t),n.ast=e,n.rebuild=o=>Pg(o,t),n.makeEffect=g1(pf(n),xo(o=>new gf(o))),n.make=W3(n),n.makeOption=o_(n),n}const Qm="~effect/Schema/SchemaError";var yw;yw=Qm;class gf{constructor(t){A(this,yw,Qm);A(this,"_tag","SchemaError");A(this,"name","SchemaError");A(this,"issue");this.issue=t}get message(){return this.issue.toString()}toString(){return`SchemaError(${this.message})`}}const Y3=Z3(X3);function X3(e){switch(e._tag){case"BigInt":case"Symbol":case"UniqueSymbol":return 0;default:return 1}}function Z3(e){return t=>{const n=new Map;for(let c=0;c<t.length;c++)n.set(ks(t[c]),c);const o=[...t].sort((c,l)=>{c=ks(c),l=ks(l);const d=e(c),h=e(l);return d!==h?d-h:n.get(c)-n.get(l)});return o.some((c,l)=>c!==t[l])?o:t}}const Ia=Km;function yf(){return(e,t,n)=>Ye(new ac(e.map(OE),o=>t(o.map(i=>Ye(i))),n))}function i_(e,t){return yf()([],()=>(n,o)=>e(n)?ft(n):Ge(new Pr(o,Ne(n))),t)}function eN(e){return Ue(e,Qm)}function mx(e){const t=mo(e);return(n,o)=>xo(t(n,o),i=>new gf(i))}const tN=K3;function nN(e){const t=Q3(e);return(n,o)=>xo(t(n,o),i=>new gf(i))}const rN=nN,Ye=Pg;function Fg(e){return Ue(e,Ia)&&e[Ia]===Ia}const xe=ki(e=>Ye(HE(e.ast),{schema:e})),Ei=ki(e=>xe(c_(e)));function dt(e){const t=Ye(new Fa(e),{literal:e,transform(n){return t.pipe(Cl(dt(n),{decode:gn(()=>n),encode:gn(()=>e)}))}});return t}const px=Ye(IO),gx=Ye(TO),sN=Ye(yg),oN=Ye(gg),iN=Ye(CO),de=Ye(TE),Ig=Ye(ME),ct=Ye(NO),_l=Ye(PO);function Rg(e,t){return Ye(e,{fields:t,mapFields(n,o){const i=n(this.fields);return Rg(wg(i,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function we(e){return Rg(wg(e,void 0),e)}const We=ki(e=>Ye(new df(!1,[],[e.ast]),{schema:e})),aN=ki(e=>Ye(new df(!1,[e.ast],[e.ast]),{schema:e}));function a_(e,t){return Ye(e,{members:t,mapMembers(n,o){const i=n(this.members);return a_(kg(i,this.ast.mode,o!=null&&o.unsafePreserveChecks?this.ast.checks:void 0),i)}})}function nn(e,t){return a_(kg(e,"anyOf",void 0),e)}function He(e){const t=e.map(dt);return Ye(kg(t,"anyOf",void 0),{literals:e,members:t,mapMembers(n){return nn(n(this.members))},pick(n){return He(n)},transform(n){return nn(t.map((o,i)=>o.transform(n[i])))}})}const Ae=ki(e=>nn([e,oN])),c_=ki(e=>nn([e,iN]));function Cl(e,t){return n=>Ye(JO(n.ast,e.ast,t?bE(t):pg()),{from:n,to:e})}function cN(e){return t=>Ye(QO(t.ast,e),{schema:t})}function Sn(e){return dt(e).pipe(cN(ft(e)))}function uN(e,t){return we({_tag:Sn(e),...t})}function lN(e,t){return i_(n=>n instanceof e,t)}function fc(){return(e,t)=>new At(e.ast,bE(t))}const dc=$E,fN=UE;function dN(e){return dc(t=>globalThis.Number.isFinite(t),{expected:"a finite number",meta:{_tag:"isFinite"},toArbitraryConstraint:{number:{noDefaultInfinity:!0,noNaN:!0}},...e})}function hN(e){const t=q1(e.order),n=e.formatter??ht;return(o,i)=>{var c;return dc(l=>t(l,o),{expected:`a value greater than or equal to ${n(o)}`,...(c=e.annotate)==null?void 0:c.call(e,o),...i})}}function mN(e){const t=q1(e.order),n=V1(e.order),o=oR(e.order),i=sR(e.order),c=e.formatter??ht;return(l,d)=>{var y;const h=l.exclusiveMinimum?n:t,p=l.exclusiveMaximum?i:o;return dc(g=>h(g,l.minimum)&&p(g,l.maximum),{expected:`a value between ${c(l.minimum)}${l.exclusiveMinimum?" (excluded)":""} and ${c(l.maximum)}${l.exclusiveMaximum?" (excluded)":""}`,...(y=e.annotate)==null?void 0:y.call(e,l),...d})}}function pN(e){return(t,n)=>{var i;const o=e.formatter??ht;return dc(c=>e.remainder(c,t)===e.zero,{expected:`a value that is a multiple of ${o(t)}`,...(i=e.annotate)==null?void 0:i.call(e,t),...n})}}const u_=hN({order:Np,annotate:e=>({meta:{_tag:"isGreaterThanOrEqualTo",minimum:e},toArbitraryConstraint:{number:{min:e}}})}),$r=mN({order:Np,annotate:e=>({meta:{_tag:"isBetween",...e},toArbitraryConstraint:{number:{min:e.minimum,max:e.maximum,...e.exclusiveMinimum&&{minExcluded:!0},...e.exclusiveMaximum&&{maxExcluded:!0}}}})}),Vh=pN({remainder:XA,zero:0,annotate:e=>({expected:`a value that is a multiple of ${e}`,meta:{_tag:"isMultipleOf",divisor:e}})});function gN(e){return dc(t=>globalThis.Number.isSafeInteger(t),{expected:"an integer",meta:{_tag:"isInt"},toArbitraryConstraint:{number:{isInteger:!0}},...e})}function yx(e,t){const n=yf()([e,t],([o,i])=>(c,l,d)=>{if(!RA(c))return Ge(new Pr(l,Ne(c)));switch(c._tag){case"Fail":return qa(mo(o)(c.error,d),{onSuccess:Rm,onFailure:h=>new Qt(l,Ne(c),[new ar(["error"],h)])});case"Die":return qa(mo(i)(c.defect,d),{onSuccess:Tm,onFailure:h=>new Qt(l,Ne(c),[new ar(["defect"],h)])});case"Interrupt":return ft(c)}},{typeConstructor:{_tag:"effect/Cause/Failure"},generation:{runtime:"Schema.CauseReason(?, ?)",Type:"Cause.Failure<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause.Failure",toCodec:([o,i])=>fc()(nn([we({_tag:dt("Fail"),error:o}),we({_tag:dt("Die"),defect:i}),we({_tag:dt("Interrupt"),fiberId:c_(be)})]),ff({decode:c=>{switch(c._tag){case"Fail":return Rm(c.error);case"Die":return Tm(c.defect);case"Interrupt":return Mm(c.fiberId)}},encode:Ie})),toArbitrary:([o,i])=>l_(o,i),toEquivalence:([o,i])=>f_(o,i),toFormatter:([o,i])=>d_(o,i)});return Ye(n.ast,{error:e,defect:t})}function l_(e,t){return(n,o)=>n.oneof(o!=null&&o.isSuspend?{maxDepth:2,depthIdentifier:"Cause.Failure"}:{},n.constant(Mm()),n.integer({min:1}).map(Mm),e.map(i=>Rm(i)),t.map(i=>Tm(i)))}function f_(e,t){return(n,o)=>{if(n._tag!==o._tag)return!1;switch(n._tag){case"Fail":return e(n.error,o.error);case"Die":return t(n.defect,o.defect);case"Interrupt":return n.fiberId===o.fiberId}}}function d_(e,t){return n=>{switch(n._tag){case"Fail":return`Fail(${e(n.error)})`;case"Die":return`Die(${t(n.defect)})`;case"Interrupt":return"Interrupt"}}}function vx(e,t){const n=yf()([e,t],([o,i])=>{const c=We(yx(o,i));return(l,d,h)=>IA(l)?qa(mo(c)(l.reasons,h),{onSuccess:Im,onFailure:p=>new Qt(d,Ne(l),[new ar(["failures"],p)])}):Ge(new Pr(d,Ne(l)))},{typeConstructor:{_tag:"effect/Cause"},generation:{runtime:"Schema.Cause(?, ?)",Type:"Cause.Cause<?, ?>",importDeclaration:'import * as Cause from "effect/Cause"'},expected:"Cause",toCodec:([o,i])=>fc()(We(yx(o,i)),ff({decode:Im,encode:({reasons:c})=>c})),toArbitrary:([o,i])=>h_(o,i),toEquivalence:([o,i])=>m_(o,i),toFormatter:([o,i])=>p_(o,i)});return Ye(n.ast,{error:e,defect:t})}function h_(e,t){return(n,o)=>n.array(l_(e,t)(n,o)).map(Im)}function m_(e,t){const n=CI(f_(e,t));return(o,i)=>n(o.reasons,i.reasons)}function p_(e,t){const n=d_(e,t);return o=>`Cause([${o.reasons.map(n).join(", ")}])`}const g_=we({message:de,name:xe(de),stack:xe(de)}),yN=lN(globalThis.Error,{typeConstructor:{_tag:"Error"},generation:{runtime:"Schema.Error",Type:"globalThis.Error"},expected:"Error",toCodecJson:()=>fc()(g_,FE()),toArbitrary:()=>e=>e.string().map(t=>new globalThis.Error(t))}),Sx=new Tn(gi(),gn(e=>{try{return JSON.parse(JSON.stringify(e))}catch{return ht(e)}})),lr=nn([g_.pipe(Cl(yN,FE())),gx.pipe(Cl(sN.annotate({toCodecJson:()=>fc()(gx,Sx),toArbitrary:()=>e=>e.json()}),Sx))]);function vN(e,t,n){const o=yf()([e,t,n],([i,c,l])=>{const d=vx(c,l);return(h,p,y)=>{if(!LA(h))return Ge(new Pr(p,Ne(h)));switch(h._tag){case"Success":return qa(mo(i)(h.value,y),{onSuccess:Uh,onFailure:g=>new Qt(p,Ne(h),[new ar(["value"],g)])});case"Failure":return qa(mo(d)(h.cause,y),{onSuccess:ba,onFailure:g=>new Qt(p,Ne(h),[new ar(["cause"],g)])})}}},{typeConstructor:{_tag:"effect/Exit"},generation:{runtime:"Schema.Exit(?, ?, ?)",Type:"Exit.Exit<?, ?, ?>",importDeclaration:'import * as Exit from "effect/Exit"'},expected:"Exit",toCodec:([i,c,l])=>fc()(nn([we({_tag:dt("Success"),value:i}),we({_tag:dt("Failure"),cause:vx(c,l)})]),ff({decode:d=>d._tag==="Success"?Uh(d.value):ba(d.cause),encode:d=>Gk(d)?{_tag:"Success",value:d.value}:{_tag:"Failure",cause:d.cause}})),toArbitrary:([i,c,l])=>(d,h)=>d.oneof(h!=null&&h.isSuspend?{maxDepth:2,depthIdentifier:"Exit"}:{},i.map(p=>Uh(p)),h_(c,l)(d,h).map(p=>ba(p))),toEquivalence:([i,c,l])=>{const d=m_(c,l);return(h,p)=>{if(h._tag!==p._tag)return!1;switch(h._tag){case"Success":return i(h.value,p.value);case"Failure":return d(h.cause,p.cause)}}},toFormatter:([i,c,l])=>{const d=p_(c,l);return h=>{switch(h._tag){case"Success":return`Exit.Success(${i(h.value)})`;case"Failure":return`Exit.Failure(${d(h.cause)})`}}}});return Ye(o.ast,{value:e,error:t,defect:n})}const be=Ig.check(dN()),SN=Ig.check(gN()),xN=globalThis.Symbol.for("immer-draftable");function Tg(e,t,n,o,i){var h,p,y,g;const c=kN(n,t,o),l=y_(t),d=(g=class extends e{constructor(...[v,w]){v=v??{};const S=n.make(v,w);super({...v,...S},{...w,disableChecks:!0})}get[(y=Ia,p=l,h=xN,p)](){return l}static get ast(){return c(this).ast}static pipe(){return $t(this,arguments)}static rebuild(v){return c(this).rebuild(v)}static make(v,w){return new this(v,w)}static makeOption(v,w){return o_(c(this))(v??{},w)}static makeEffect(v,w){return xo(pf(c(this))(v??{},w),S=>new gf(S))}static annotate(v){return this.rebuild(BE(this.ast,v))}static annotateKey(v){return this.rebuild(qE(this.ast,v))}static check(...v){return this.rebuild(Cg(this.ast,v))}static extend(v){return(w,S)=>{const E={...n.fields,...w};return Tg(this,v,Rg(wg(E,n.ast.checks,{identifier:v}),E),S,i)}}static mapFields(v,w){return n.mapFields(v,w)}},A(g,y,Ia),A(g,h,!0),A(g,"identifier",t),A(g,"fields",n.fields),g);return i!==void 0&&Object.assign(d.prototype,i(t)),d}function wN(e){return new Tn(gn(t=>new e(t)),gi())}function y_(e){return`~effect/Schema/Class/${e}`}function kN(e,t,n){let o;return i=>{if(o===void 0){const c=wN(i),l=Ye(new ac([e.ast],()=>(d,h)=>d instanceof i||Ue(d,y_(t))?ft(d):Ge(new Pr(h,Ne(d))),{identifier:t,[ZE]:([d])=>new At(d,c),toCodec:([d])=>new At(d.ast,c),toArbitrary:([d])=>()=>d.map(h=>new i(h)),toFormatter:([d])=>h=>`${i.identifier}(${d(h)})`,"~sentinels":Eg(e.ast),...n}));o=e.pipe(Cl(l,c))}return o}}function Mg(e){return Fg(e)}const EN=e=>(t,n)=>{const o=Mg(t)?t:we(t);return Tg(YA,e,o,n,i=>({toString(){return`${i}(${ht({...this})})`}}))},Hn=e=>(t,n)=>{const o=Mg(t)?t:we(t);return Tg(R1,e,o,n,c=>({name:c}))},vf=e=>(t,n,o)=>Hn(e??t)(Mg(n)?n.mapFields(i=>({_tag:Sn(t),...i}),{unsafePreserveChecks:!0}):uN(t,n),o);function qh(e){return Ye(v_(e.ast))}const v_=GE(e=>{const t=_N(e,v_);return t!==e&&qr(e)?WE(t):t});function _N(e,t){var n,o;switch(e._tag){case"Declaration":{const i=((n=e.annotations)==null?void 0:n.toCodecJson)??((o=e.annotations)==null?void 0:o.toCodec);if($l(i)){const c=IE(e)?e.typeParameters.map(h=>Pg(ks(h))):[],l=i(c),d=t(l.to);return Rt(e,d===l.to?[l]:[new At(d,l.transformation)])}return Rt(e,[a3])}case"Unknown":case"ObjectKeyword":return Rt(e,[c3]);case"Undefined":case"Void":case"Literal":case"Number":return e.toCodecJson();case"UniqueSymbol":case"Symbol":case"BigInt":return e.toCodecStringTree();case"Objects":{if(e.propertySignatures.some(i=>typeof i.name!="string"))throw new globalThis.Error("Objects property names must be strings",{cause:e});return e.recur(t)}case"Union":{const i=Y3(e.types);return i!==e.types?new cc(i,e.mode,e.annotations,e.checks,e.encoding,e.context).recur(t):e.recur(t)}case"Arrays":case"Suspend":return e.recur(t)}return e}const CN="~effect/Stream",bN={_R:Ie,_E:Ie,_A:Ie},PN={[CN]:bN,pipe(){return $t(this,arguments)}},FN=e=>{const t=Object.create(PN);return t.channel=e,t},IN="~effect/Stream",RN=e=>Ue(e,IN),hc=FN,TN=e=>e.channel,MN=e=>hc(j3(()=>e().channel)),AN=e=>hc($3(e)),LN=e=>hc(B3(Ms(e,TN))),xx=se(2,(e,t)=>MN(()=>{let n=0;return hc(U3(e.channel,K1(o=>t(o,n++))))})),ON=se(2,(e,t)=>hc(V3(e.channel,t))),NN=se(2,(e,t)=>q3(e.channel,n=>{let o=0;return uE({while:()=>o<n.length,body:()=>t(n[o++]),step:Ya})})),Jm="~effect/FiberSet",DN=e=>Ue(e,Jm),jN={[Jm]:Jm,[Symbol.iterator](){return this.state._tag==="Closed"?dR():this.state.backing[Symbol.iterator]()},...Is,toJSON(){return{_id:"FiberMap",state:this.state}}},$N=(e,t)=>{const n=Object.create(jN);return n.state={_tag:"Open",backing:e},n.deferred=t,n},UN=()=>hE(Bn(()=>$N(new Set,ng())),e=>Er(()=>{const t=e.state;if(t._tag==="Closed")return gt;e.state={_tag:"Closed"};const n=t.backing;return l3(n).pipe(BA(e.deferred))})),S_=-1,BN=eT(nT(AA,tT(S_))),zN=se(e=>DN(e[0]),(e,t,n)=>{if(e.state._tag==="Closed"){t.interruptUnsafe(S_);return}else if(e.state.backing.has(t))return;e.state.backing.add(t),t.addObserver(o=>{e.state._tag!=="Closed"&&(e.state.backing.delete(t),Yk(o)&&((n==null?void 0:n.propagateInterruption)===!0?!BN(o.cause):!TA(o.cause))&&Pa(e.deferred,o))})}),VN=(function(){let e;return()=>(e===void 0&&(e=jm(Dm)),e)})(),qN=e=>()=>Ms(gl(),t=>{const n=yl(t);return(o,i)=>{if(e.state._tag==="Closed")return VN();const c=n(o,i);return zN(e,c),c}}),wx=e=>rg(e.deferred),WN="~effect/interfaces/PrimaryKey",kx="~effect/ManagedRuntime",HN=(e,t)=>{const n=(t==null?void 0:t.memoMap)??ig(),o=sg("parallel"),i=dl(o,"sequential"),c={onFiberStart:f3(o)},l=y=>y?{...y,onFiberStart:y.onFiberStart?g=>{c.onFiberStart(g),y.onFiberStart(g)}:c.onFiberStart}:c;let d;const h=ml(y=>(d||(d=jm(kL(ag(e,n,i),g=>Bn(()=>{p.cachedContext=g})),{...c,scheduler:y.currentScheduler})),xL(u3(d)))),p={[kx]:kx,memoMap:n,scope:o,contextEffect:h,cachedContext:void 0,context(){return p.cachedContext===void 0?Ku(p.contextEffect):Promise.resolve(p.cachedContext)},dispose(){return Ku(p.disposeEffect)},disposeEffect:Er(()=>(p.contextEffect=SL("ManagedRuntime disposed"),p.cachedContext=void 0,uf(p.scope,Jk))),runFork(y,g){return p.cachedContext===void 0?jm(Xo(p,y),l(g)):yl(p.cachedContext)(y,l(g))},runCallback(y,g){return p.cachedContext===void 0?BL(Xo(p,y),l(g)):UL(p.cachedContext)(y,l(g))},runSyncExit(y){return p.cachedContext===void 0?yE(Xo(p,y)):HL(p.cachedContext)(y)},runSync(y){return p.cachedContext===void 0?hg(Xo(p,y)):WL(p.cachedContext)(y)},runPromiseExit(y,g){return p.cachedContext===void 0?VL(Xo(p,y),l(g)):qL(p.cachedContext)(y,l(g))},runPromise(y,g){return p.cachedContext===void 0?Ku(Xo(p,y),l(g)):zL(p.cachedContext)(y,l(g))}};return p};function Xo(e,t){return Rn(e.contextEffect,n=>io(t,n))}const Gm="~effect/rpc/RpcSchema/StreamSchema";function x_(e){return Ue(e,Gm)}function w_(e){return x_(e)?Ne({success:e.success,error:e.error}):Vn()}const KN=i_(RN);function QN(e,t){return Ye(KN.ast,{[Gm]:Gm,success:e,error:t})}const Ex="~effect/rpc/Rpc",JN={[Ex]:Ex,pipe(){return $t(this,arguments)},setSuccess(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:e,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setError(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:e,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},setPayload(e){return ps({_tag:this._tag,payloadSchema:Fg(e)?e:we(e),successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},middleware(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:new Set([...this.middlewares,e])})},prefix(e){return ps({_tag:`${e}${this._tag}`,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,annotations:this.annotations,middlewares:this.middlewares})},annotate(e,t){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:Rs(this.annotations,e,t)})},annotateMerge(e){return ps({_tag:this._tag,payloadSchema:this.payloadSchema,successSchema:this.successSchema,errorSchema:this.errorSchema,defectSchema:this.defectSchema,middlewares:this.middlewares,annotations:hi(this.annotations,e)})}},ps=e=>{function t(){}return Object.setPrototypeOf(t,JN),Object.assign(t,e),t.key=`effect/rpc/Rpc/${e._tag}`,t},_i=(e,t)=>{const n=(t==null?void 0:t.success)??_l,o=(t==null?void 0:t.error)??px,i=(t==null?void 0:t.defect)??lr;let c;return t!=null&&t.primaryKey?c=class extends EN(`effect/rpc/Rpc/${e}`)(t.payload){[WN](){return t.primaryKey(this)}}:c=Fg(t==null?void 0:t.payload)?t==null?void 0:t.payload:t!=null&&t.payload?we(t==null?void 0:t.payload):_l,ps({_tag:e,payloadSchema:c,successSchema:t!=null&&t.stream?QN(n,o):n,errorSchema:t!=null&&t.stream?px:o,defectSchema:i,annotations:ir(),middlewares:new Set})},Wh=new WeakMap,GN=e=>{if(Wh.has(e))return Wh.get(e);const t=e,n=new Set([t.errorSchema]),o=w_(t.successSchema);_s(o)&&n.add(o.value.error);for(const c of t.middlewares)n.add(c.error);const i=vN(_s(o)?_l:t.successSchema,nn([...n]),t.defectSchema);return Wh.set(e,i),i},YN="~effect/rpc/Rpc/Wrapper",XN=e=>YN in e,ZN={add(...e){const t=new Map(this.requests);for(const n of e)t.set(n._tag,n);return Ur({requests:t,annotations:this.annotations})},merge(...e){const t=new Map(this.requests),n=new Map(this.annotations.mapUnsafe);for(const o of e){for(const[i,c]of o.requests)t.set(i,c);for(const[i,c]of o.annotations.mapUnsafe)n.set(i,c)}return Ur({requests:t,annotations:ws(n)})},omit(...e){const t=new Map(this.requests);for(const n of e)t.delete(n);return Ur({requests:t,annotations:this.annotations})},middleware(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.middleware(e));return Ur({requests:t,annotations:this.annotations})},toHandlers(e){const t=this;return Nm(function*(){const n=yield*gl(),o=ai(e)?yield*e:e,i=new Map;for(const[c,l]of Object.entries(o)){const d=t.requests.get(c);i.set(d.key,{tag:d._tag,handler:l,context:n})}return ws(i)})},prefix(e){const t=new Map;for(const n of this.requests.values()){const o=n.prefix(e);t.set(o._tag,o)}return Ur({requests:t,annotations:this.annotations})},toLayer(e){return Lm(this.toHandlers(e))},of:Ie,toLayerHandler(e,t){const n=this;return Lm(Nm(function*(){const o=yield*gl(),i=ai(t)?yield*t:t,c=new Map,l=n.requests.get(e);return c.set(l.key,{handler:i,context:o}),ws(c)}))},accessHandler(e){return dE(t=>{const n=this.requests.get(e),{handler:o,context:i}=t.mapUnsafe.get(n.key);return ft((c,l)=>{l.rpc=n;const d=o(c,l),h=XN(d)?d.value:d;return ai(h)?RL(h,i):ON(h,i)})})},annotate(e,t){return Ur({requests:this.requests,annotations:Rs(this.annotations,e,t)})},annotateRpcs(e,t){return this.annotateRpcsMerge(di(e,t))},annotateMerge(e){return Ur({requests:this.requests,annotations:hi(this.annotations,e)})},annotateRpcsMerge(e){const t=new Map;for(const[n,o]of this.requests)t.set(n,o.annotateMerge(hi(e,o.annotations)));return Ur({requests:t,annotations:this.annotations})}},Ur=e=>Object.assign(function(){},ZN,{requests:e.requests,annotations:e.annotations}),eD=(...e)=>Ur({requests:new Map(e.map(t=>[t._tag,t])),annotations:ir()}),tD="/ws",nD=4,Ht={getConfig:"tokmon.getConfig",setConfig:"tokmon.setConfig",refresh:"tokmon.refresh",browseFs:"tokmon.browseFs",snapshot:"tokmon.snapshot",config:"tokmon.config"},rD=He(["all","summary","table","billing","peak"]),po=He(Nl),rr=SN.check(u_(0)),bl=be.check(u_(1)),sD=we({id:de,providerId:po,name:de,homeDir:de,color:xe(de)}),oD=we({enabled:ct,menuBar:xe(we({version:dt(1),mode:He(["auto","custom"]),elements:we({providerMark:ct,value:ct,progress:ct}),density:He(["comfortable","compact","tight"]),customSpacing:we({edgePaddingPt:be.check($r({minimum:0,maximum:6})).check(Vh(.5)),markValueGapPt:be.check($r({minimum:0,maximum:8})).check(Vh(.5)),providerGapPt:be.check($r({minimum:0,maximum:16})).check(Vh(.5))})})),showMenuBarText:ct,menuBarValue:xe(He(["usage","todayTokens"])),displayMetric:He(["smartHeadroom","tightestRemaining"]),pollIntervalSec:be.check($r({minimum:1,maximum:86400})),activeTimeoutMin:be.check($r({minimum:1,maximum:1440})),graceMin:be.check($r({minimum:1,maximum:10080})),promotionHoldMin:be.check($r({minimum:0,maximum:1440})),lowWatermarkPct:be.check($r({minimum:0,maximum:100})),criticalWatermarkPct:be.check($r({minimum:0,maximum:100})),pinnedAccount:Ae(de),pins:We(de),pinnedProviders:xe(We(de)),launchAtLogin:ct,theme:dt("dark")}),iD=we({expandedProviders:We(de),graphRangeDays:xe(He(d1))}),aD=we({enabled:ct,disabledProviders:We(po),excludedAccounts:We(we({providerId:po,homeDir:de}))}),Zt=de.check(fN(/^#[0-9a-f]{6}$/i)),_x=we({canvas:xe(Zt),panel:xe(Zt),inset:xe(Zt),insetStrong:xe(Zt),chrome:xe(Zt),line:xe(Zt),lineStrong:xe(Zt),lineFaint:xe(Zt),text:xe(Zt),textDim:xe(Zt),textFaint:xe(Zt),textStrong:xe(Zt),accent:xe(Zt),cost:xe(Zt),positive:xe(Zt)}),cD=we({version:dt(1),mode:He(["auto","light","dark"]),preset:He(o1),terminal:He(["ansi","dark","light","off"]),custom:xe(we({base:He(wp),light:_x,dark:_x}))}),k_=we({revision:rr,interval:bl,billingInterval:bl,clearScreen:ct,privacyMode:ct,privacyToggleKey:de,timezone:Ae(de),accounts:We(sD),activeAccountId:Ae(de),disabledProviders:We(po),onboarded:ct,dashboardLayout:He(["grid","single"]),defaultFocus:He(["all","last"]),ascii:He(["auto","on","off"]),allowNetworkAccess:ct,allowedHosts:We(de),resetDisplay:He(["relative","absolute"]),knownProviders:We(po),appearance:xe(cD),accountDetection:xe(aD),tray:xe(oD),desktop:xe(iD)}),uD=we({version:dt(nD),capabilities:We(de)}),mc=we({protocol:uD,config:k_}),lD=we({expectedRevision:rr,config:k_}),fD=we({kind:dt("conflict"),state:mc});class Ym extends vf()("ConfigUpdateConflictFailure",{kind:dt("conflict"),state:mc}){}const dD=we({kind:dt("persistence"),message:de});class hD extends vf()("ConfigPersistenceFailure",{kind:dt("persistence"),message:de}){}const mD=nn([Ym,fD]),pD=nn([hD,dD]);class gD extends vf()("RefreshFailure",{kind:dt("refresh"),message:de}){}const yD=we({name:de,path:de,dir:ct}),vD=we({path:de,parent:Ae(de),entries:We(yD)}),Hh=we({cost:be,tokens:be,input:be,cacheRead:be,cacheSavings:be}),SD=we({name:de,input:be,output:be,cacheCreate:be,cacheRead:be,cacheSavings:be,cost:be,count:be}),Kh=we({label:de,models:We(de),input:be,output:be,cacheCreate:be,cacheRead:be,cacheSavings:be,total:be,cost:be,count:be,breakdown:We(SD)}),xD=we({today:Hh,week:Hh,month:Hh,burnRate:be,series:We(be),lastActivityAt:Ae(rr)}),wD=we({daily:We(Kh),weekly:We(Kh),monthly:We(Kh)}),kD=nn([we({kind:dt("percent")}),we({kind:dt("dollars"),currency:xe(de)}),we({kind:dt("count"),suffix:xe(de)})]),ED=we({key:xe(de),role:xe(He(["session","weekly","model","other","unbounded"])),modelId:xe(Ae(de)),active:xe(ct),label:de,used:be,limit:Ae(be),format:kD,resetsAt:xe(Ae(de)),primary:xe(ct)}),E_=He(["session","weekly","model","other","unbounded"]),_D=we({title:de,subtitle:Ae(de),accessibleLabel:de,redacted:ct}),CD=we({key:de,label:de,role:E_,modelId:Ae(de),usedPct:Ae(be),remainingPct:Ae(be),resetsAt:Ae(rr),bounded:ct,primary:ct,active:ct,displayOrder:rr,valueText:de,value:xe(we({kind:dt("money"),used:be,limit:Ae(be),remaining:Ae(be),currency:de}))}),bD=we({key:de,label:de,role:E_,remainingPct:be,included:ct,reason:He(["session","active-model","weekly-cap","primary","fallback-floor"])}),__=we({value:Ae(be),unit:dt("index-100"),mode:He(["smart","single-window","fallback-floor","unavailable"]),basis:He(["active","idle-runway","unavailable"]),representativeAccountId:Ae(de),activeAccountIds:We(de),factors:We(bD),explanation:de}),PD=we({plan:Ae(de),metrics:We(ED),error:Ae(de),email:xe(Ae(de)),displayName:xe(Ae(de)),activity:xe(Ae(we({series:We(be),summary:de}))),modelSpend:xe(Ae(We(we({name:de,usd:be,requests:be})))),asOfMs:xe(rr)}),FD=we({id:de,providerId:po,name:de,color:de,homeDir:Ae(de),hasUsage:ct,hasBilling:ct,email:xe(Ae(de)),displayName:xe(Ae(de)),identity:xe(_D),quotas:xe(We(CD)),headroom:xe(__),plan:xe(Ae(de)),lastActivityAt:Ae(rr),dashboard:Ae(xD),table:Ae(wD),billing:Ae(PD),summaryState:He(["pending","ready","error"]),billingState:He(["pending","ready","error"]),tableState:He(["pending","ready","error"]),summaryUpdatedAt:xe(Ae(rr)),billingUpdatedAt:xe(Ae(rr)),tableUpdatedAt:xe(Ae(rr))}),ID=we({version:de,generatedAt:rr,tz:de,intervalMs:bl,billingIntervalMs:xe(bl),providers:We(we({id:po,name:de,color:de,headroom:xe(__)})),accounts:We(FD),seeded:ct,peak:Ae(we({state:He(["peak","off-peak","weekend"]),label:de,minutesUntilChange:Ae(be),changesAt:xe(Ae(de))}))}),Ag=we({}),RD=_i(Ht.getConfig,{payload:Ag,success:mc}),TD=_i(Ht.setConfig,{payload:lD,success:mc,error:nn([mD,pD])}),MD=_i(Ht.refresh,{payload:we({scope:rD}),success:_l,error:gD}),AD=_i(Ht.browseFs,{payload:we({path:de}),success:vD}),LD=_i(Ht.snapshot,{payload:Ag,success:ID,stream:!0}),OD=_i(Ht.config,{payload:Ag,success:mc,stream:!0}),ND=eD(RD,TD,MD,AD,LD,OD);function DD(e){if(!e||typeof e!="object")return!1;const t=e;return t.isContentEditable?!0:typeof t.tagName=="string"&&["INPUT","TEXTAREA","SELECT"].includes(t.tagName.toUpperCase())}function jD(e,t){return t.length===1&&!e.metaKey&&!e.ctrlKey&&!e.altKey&&!e.shiftKey&&!e.repeat&&!e.editable&&!DD(e.target)&&e.key.toLowerCase()===t.toLowerCase()}const Ha="#8d9090",hn={green:"#6caa71",greenBright:"#79be7e",cyan:"#7ccbcd",cyanBright:"#84dde0",blue:"#6d96b4",blueBright:"#67b5ed",magenta:"#bd7bcd",magentaBright:"#d389e5",yellow:"#c4ac62",yellowBright:"#d9c074",red:"#b45648",redBright:"#cf6a5a",white:"#dee5eb",whiteBright:"#f3f5f5",gray:Ha,grey:Ha},$D={claude:hn.green,codex:hn.cyan,cursor:hn.magenta,copilot:hn.white,pi:hn.blue,opencode:hn.yellow,antigravity:hn.red,gemini:hn.greenBright,grok:hn.yellowBright};function UD(e){return e?e.startsWith("#")?e:hn[e]??Ha:Ha}const o6=UD;function i6(e){return $D[e]??Ha}const Cx=["#00d7ff","#00d787","#e6b450","#d75f87","#5f87ff","#af87ff","#5fd7a7","#ff8787","#d7af5f","#87d7ff","#d787d7","#9ee493","#ffb454","#7aa2f7","#bb9af7"],bx=new Map;function BD(e){const t=bx.get(e);if(t)return t;let n=0;for(let i=0;i<e.length;i++)n=n*31+e.charCodeAt(i)>>>0;const o=Cx[n%Cx.length];return bx.set(e,o),o}const a6={input:hn.blue,output:hn.green,cacheCreate:hn.yellow,cacheRead:hn.cyan};function Px(e){return e.replace(/^claude-/,"").replace(/^gpt-/,"gpt-").replace(/-\d{8}$/,"").replace(/-latest$/,"")}const Fx=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"];function c6(e,t={}){if(!Number.isFinite(e))return"$0.00";const n=t.sign&&e>0?"+":"",o=Math.abs(e);if(o>=1e5)return`${n}$${(e/1e3).toFixed(0)}k`;if(o>=1e4)return`${n}$${(e/1e3).toFixed(1)}k`;if(o>=1){const i=e<0?"-":"";return`${n}${i}$${o.toLocaleString("en-US",{minimumFractionDigits:2,maximumFractionDigits:2})}`}return o>=.01?`${n}$${e.toFixed(3)}`:o===0?"$0.00":`${n}$${e.toFixed(4)}`}function u6(e){if(!Number.isFinite(e))return"$0";const t=Math.abs(e);return t>=1e6?`$${(e/1e6).toFixed(1).replace(/\.0$/,"")}M`:t>=1e3?`$${(e/1e3).toFixed(1).replace(/\.0$/,"")}k`:t>=1?`$${Math.round(e)}`:t===0?"$0":`$${e.toFixed(2)}`}function l6(e){if(!Number.isFinite(e)||e===0)return"0";const t=Math.abs(e);return t>=1e9?`${(e/1e9).toFixed(2)}B`:t>=1e6?`${(e/1e6).toFixed(2)}M`:t>=1e3?`${(e/1e3).toFixed(1)}k`:String(Math.round(e))}function f6(e){return Number.isFinite(e)?Math.round(e).toLocaleString("en-US"):"0"}function d6(e){if(!Number.isFinite(e))return"0";const t=Math.abs(e);return t>=1e6?`${(e/1e6).toFixed(1)}M`:t>=1e4?`${Math.round(e/1e3)}k`:Math.round(e).toLocaleString("en-US")}function h6(e,t=0){return Number.isFinite(e)?`${(e*100).toFixed(t)}%`:"0%"}function zD(e,t){const n=Math.max(0,Math.round((t-e)/1e3));if(n<2)return"just now";if(n<60)return`${n}s ago`;const o=Math.round(n/60);if(o<60)return`${o}m ago`;const i=Math.round(o/60);return i<24?`${i}h ago`:`${Math.round(i/24)}d ago`}function m6(e){const t=/^(\d{4})-(\d{2})-(\d{2})$/.exec(e);if(t)return`${Fx[Number(t[2])-1]} ${Number(t[3])}`;const n=/^(\d{4})-(\d{2})$/.exec(e);return n?`${Fx[Number(n[2])-1]} ${n[1]}`:e}function VD(e){if(!Number.isFinite(e)||e<=0)return null;const t=Math.max(1,Math.ceil(e/6e4));return{days:Math.floor(t/1440),hours:Math.floor(t%1440/60),minutes:t%60,totalMinutes:t}}function qD(e,t=Date.now()){const n=VD(new Date(e).getTime()-t);return n?n.days>0?`${n.days}d ${n.hours}h`:n.hours>0?`${n.hours}h ${n.minutes}m`:`${n.minutes}m`:"now"}function WD(e,t,n=Date.now(),o){const i=Date.parse(e);return Number.isFinite(i)?t==="relative"?qD(e,n):new Intl.DateTimeFormat(void 0,{month:"short",day:"numeric",hour:"numeric",minute:"2-digit",timeZone:o}).format(new Date(i)):e}function C_(e){return e.input+e.output+e.cacheCreate+e.cacheRead}const Lg=864e5,p6=["Jan","Feb","Mar","Apr","May","Jun","Jul","Aug","Sep","Oct","Nov","Dec"],Pl=e=>{const[t,n,o]=e.split("-").map(Number);return Date.UTC(t,(n||1)-1,o||1)},Fl=e=>new Date(e).toISOString().slice(0,10),HD=e=>{try{return new Intl.DateTimeFormat("en-CA",{timeZone:e||void 0,year:"numeric",month:"2-digit",day:"2-digit"}).format(new Date)}catch{return new Date().toISOString().slice(0,10)}},KD=e=>(new Date(e).getUTCDay()+6)%7,g6=e=>{const t=Pl(e);return Fl(t-KD(t)*Lg)},QD={period:"6m"},Og=[{key:"7d",label:"7 days",shortLabel:"7d"},{key:"30d",label:"30 days",shortLabel:"30d"},{key:"90d",label:"90 days",shortLabel:"90d"},{key:"mtd",label:"month to date",shortLabel:"MTD"},{key:"6m",label:"6 months",shortLabel:"6M"},{key:"all",label:"all time",shortLabel:"All"}];function b_(e){return e.providers.length?new Set(e.providers):null}function JD(e,t){const n=b_(t);return e.accounts.filter(o=>!(!o.hasUsage||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function Xm(e){var t,n,o,i,c,l,d,h,p;return!!(e.hasBilling&&((n=(t=e.billing)==null?void 0:t.metrics)!=null&&n.length||(o=e.billing)!=null&&o.plan||(i=e.billing)!=null&&i.error||(d=(l=(c=e.billing)==null?void 0:c.activity)==null?void 0:l.series)!=null&&d.length||(p=(h=e.billing)==null?void 0:h.modelSpend)!=null&&p.length))}function GD(e,t){const n=b_(t);return e.accounts.filter(o=>!(!o.hasUsage&&!Xm(o)||t.account!=="all"&&o.id!==t.account||n&&!n.has(o.providerId)))}function YD(e){var n;let t=null;for(const o of e)for(const i of((n=o.table)==null?void 0:n.daily)??[])(!t||i.label>t)&&(t=i.label);return t}function P_(e,t,n){if(!t||e==="all")return null;if(e==="mtd")return HD(n).slice(0,7)+"-01";if(e==="6m"){const i=new Date(Pl(t)),c=i.getUTCMonth()-6,l=i.getUTCFullYear()+Math.floor(c/12),d=(c%12+12)%12,h=new Date(Date.UTC(l,d+1,0)).getUTCDate();return Fl(Date.UTC(l,d,Math.min(i.getUTCDate(),h)))}const o=e==="7d"?7:e==="90d"?90:30;return Fl(Pl(t)-(o-1)*Lg)}function y6(e,t,n,o){if(!n||e==="all")return null;const i=P_(e,n,o);if(t==="daily")return i;const c=t==="monthly"?365:84,l=Fl(Pl(n)-(c-1)*Lg);return i&&i<l?i:l}function XD(e,t){const n=XF(e,t);return n.toLocaleLowerCase()===t.toLocaleLowerCase()?t:`${t} · ${n}`}const ZD=()=>({cost:0,tokens:0,cacheSavings:0,calls:0}),e4=(e,t,n,o,i)=>{e.cost+=t,e.tokens+=n,e.cacheSavings+=o,e.calls+=i};function t4(){return{totals:ZD(),burnRate:0,timelineMap:new Map,cacheByDay:new Map,provAgg:new Map,modelAgg:new Map,modelTrend:new Map,modelOptionSet:new Set,tokenComposition:{input:0,output:0,cacheCreate:0,cacheRead:0}}}function n4(e,t,n,o,i){let c=0,l=0,d=0,h=0;for(const g of t.breakdown){if(e.modelOptionSet.add(g.name),i&&!i.has(g.name))continue;const v=C_(g);c+=g.cost,l+=v,d+=g.cacheSavings,h+=g.count,e.tokenComposition.input+=g.input,e.tokenComposition.output+=g.output,e.tokenComposition.cacheCreate+=g.cacheCreate,e.tokenComposition.cacheRead+=g.cacheRead;const w=e.modelAgg.get(g.name)??{cost:0,tokens:0,cacheSavings:0,calls:0};w.cost+=g.cost,w.tokens+=v,w.cacheSavings+=g.cacheSavings,w.calls+=g.count,e.modelAgg.set(g.name,w);let S=e.modelTrend.get(g.name);S||(S=new Map,e.modelTrend.set(g.name,S)),S.set(t.label,(S.get(t.label)??0)+g.cost)}if(i&&h===0&&c===0)return;e4(e.totals,c,l,d,h);const p=e.timelineMap.get(t.label)??{date:t.label,total:0,tokens:0,byProvider:{}};p.total+=c,p.tokens+=l,p.byProvider[n]=(p.byProvider[n]??0)+c,e.timelineMap.set(t.label,p),e.cacheByDay.set(t.label,(e.cacheByDay.get(t.label)??0)+d);const y=e.provAgg.get(n)??{id:n,name:n,color:o,cost:0,tokens:0,calls:0};y.cost+=c,y.tokens+=l,y.calls+=h,e.provAgg.set(n,y)}function r4(e){return[...e.timelineMap.values()].sort((t,n)=>t.date.localeCompare(n.date))}function s4(e,t,n){const o=t.map(i=>i.date);return[...e.modelAgg.entries()].map(([i,c])=>{const l=e.modelTrend.get(i);return{model:i,color:BD(i),cost:c.cost,tokens:c.tokens,cacheSavings:c.cacheSavings,calls:c.calls,share:n>0?c.cost/n:0,tokenShare:e.totals.tokens>0?c.tokens/e.totals.tokens:0,callShare:e.totals.calls>0?c.calls/e.totals.calls:0,trend:o.map(d=>(l==null?void 0:l.get(d))??0)}}).sort((i,c)=>c.cost-i.cost)}function o4(e,t){var _,L,C;const n=e?JD(e,t):[],o=YD(n),i=P_(t.period,o,(e==null?void 0:e.tz)??""),c=t.models.length?new Set(t.models):null,l=new Map,d=new Map;for(const D of(e==null?void 0:e.providers)??[])l.set(D.id,D.color),d.set(D.id,D.name);const h=t4(),p=D=>!i||D>=i;for(const D of n){h.burnRate+=((_=D.dashboard)==null?void 0:_.burnRate)??0;const $=D.providerId,N=l.get($)??D.color;for(const T of((L=D.table)==null?void 0:L.daily)??[])p(T.label)&&n4(h,T,$,N,c)}for(const D of h.provAgg.values()){const $=d.get(D.id);$&&(D.name=$)}const y=r4(h);let g=0;const v=y.map(D=>(g+=D.total,{date:D.date,total:g})),w=y.map(D=>({date:D.date,value:h.cacheByDay.get(D.date)??0})),S=new Map;for(const D of n)for(const $ of((C=D.table)==null?void 0:C.daily)??[]){if(!p($.label))continue;const N=c?$.breakdown.filter(q=>c.has(q.name)):$.breakdown;if(c&&N.length===0)continue;let T=S.get($.label);T||(T={tokens:0,calls:0,cacheSavings:0,models:new Map},S.set($.label,T));for(const q of N)T.tokens+=C_(q),T.calls+=q.count,T.cacheSavings+=q.cacheSavings,T.models.set(q.name,(T.models.get(q.name)??0)+q.cost)}const E=y.map(D=>{const $=S.get(D.date);return{date:D.date,cost:D.total,tokens:($==null?void 0:$.tokens)??0,calls:($==null?void 0:$.calls)??0,cacheSavings:($==null?void 0:$.cacheSavings)??0,models:$?[...$.models.entries()].map(([N,T])=>({name:N,cost:T})).sort((N,T)=>T.cost-N.cost):[]}}),F=[...h.provAgg.values()].sort((D,$)=>$.cost-D.cost),K=s4(h,y,h.totals.cost);return{filteredAccounts:n,totals:h.totals,burnRate:h.burnRate,timeline:y,cumulative:v,cacheSavingsSeries:w,calendar:E,cardAccounts:e?GD(e,t):[],byProvider:F,byModel:K,tokenComposition:h.tokenComposition,modelOptions:[...h.modelOptionSet].sort(),latestDay:o,rangeStart:i}}function Ut({children:e,className:t="size-4",...n}){return P.jsx("svg",{viewBox:"0 0 24 24",fill:"none",stroke:"currentColor",strokeWidth:1.75,strokeLinecap:"round",strokeLinejoin:"round",className:t,"aria-hidden":!0,...n,children:e})}const v6=e=>P.jsxs(Ut,{...e,children:[P.jsx("path",{d:"M23 19a2 2 0 0 1-2 2H3a2 2 0 0 1-2-2V8a2 2 0 0 1 2-2h4l2-3h6l2 3h4a2 2 0 0 1 2 2z"}),P.jsx("circle",{cx:"12",cy:"13",r:"4"})]}),S6=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"M20 6 9 17l-5-5"})}),x6=e=>P.jsxs(Ut,{...e,children:[P.jsx("rect",{x:"9",y:"9",width:"13",height:"13",rx:"2"}),P.jsx("path",{d:"M5 15H4a2 2 0 0 1-2-2V4a2 2 0 0 1 2-2h9a2 2 0 0 1 2 2v1"})]}),w6=e=>P.jsxs(Ut,{...e,children:[P.jsx("path",{d:"M21 15v4a2 2 0 0 1-2 2H5a2 2 0 0 1-2-2v-4"}),P.jsx("path",{d:"m7 10 5 5 5-5"}),P.jsx("path",{d:"M12 15V3"})]}),k6=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"M3 6.5A2.5 2.5 0 0 1 5.5 4H9l2 2h7.5A2.5 2.5 0 0 1 21 8.5v8A2.5 2.5 0 0 1 18.5 19h-13A2.5 2.5 0 0 1 3 16.5z"})}),i4=e=>P.jsxs(Ut,{...e,children:[P.jsx("path",{d:"M4 12v8a2 2 0 0 0 2 2h12a2 2 0 0 0 2-2v-8"}),P.jsx("path",{d:"m16 6-4-4-4 4"}),P.jsx("path",{d:"M12 2v13"})]}),a4=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"m6 9 6 6 6-6"})}),E6=e=>P.jsxs(Ut,{...e,children:[P.jsx("circle",{cx:"11",cy:"11",r:"8"}),P.jsx("path",{d:"m21 21-4.3-4.3"})]}),c4=e=>P.jsxs(Ut,{...e,children:[P.jsx("path",{d:"M18 6 6 18"}),P.jsx("path",{d:"m6 6 12 12"})]}),u4=e=>P.jsxs(Ut,{...e,children:[P.jsx("circle",{cx:"12",cy:"12",r:"4"}),P.jsx("path",{d:"M12 2v2M12 20v2M4.9 4.9l1.4 1.4M17.7 17.7l1.4 1.4M2 12h2M20 12h2M4.9 19.1l1.4-1.4M17.7 6.3l1.4-1.4"})]}),l4=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"M21 12.8A9 9 0 1 1 11.2 3a7 7 0 0 0 9.8 9.8z"})}),f4=e=>P.jsxs(Ut,{...e,children:[P.jsx("circle",{cx:"12",cy:"12",r:"3"}),P.jsx("path",{d:"M19.4 15a1.65 1.65 0 0 0 .33 1.82l.06.06a2 2 0 1 1-2.83 2.83l-.06-.06a1.65 1.65 0 0 0-1.82-.33 1.65 1.65 0 0 0-1 1.51V21a2 2 0 0 1-4 0v-.09A1.65 1.65 0 0 0 9 19.4a1.65 1.65 0 0 0-1.82.33l-.06.06a2 2 0 1 1-2.83-2.83l.06-.06a1.65 1.65 0 0 0 .33-1.82 1.65 1.65 0 0 0-1.51-1H3a2 2 0 0 1 0-4h.09A1.65 1.65 0 0 0 4.6 9a1.65 1.65 0 0 0-.33-1.82l-.06-.06a2 2 0 1 1 2.83-2.83l.06.06a1.65 1.65 0 0 0 1.82.33H9a1.65 1.65 0 0 0 1-1.51V3a2 2 0 0 1 4 0v.09a1.65 1.65 0 0 0 1 1.51 1.65 1.65 0 0 0 1.82-.33l.06-.06a2 2 0 1 1 2.83 2.83l-.06.06a1.65 1.65 0 0 0-.33 1.82V9a1.65 1.65 0 0 0 1.51 1H21a2 2 0 0 1 0 4h-.09a1.65 1.65 0 0 0-1.51 1z"})]}),d4=e=>P.jsxs(Ut,{...e,children:[P.jsx("path",{d:"M20 6v5h-5"}),P.jsx("path",{d:"M4 18v-5h5"}),P.jsx("path",{d:"M18.7 9A7 7 0 0 0 6.3 6.3L4 8"}),P.jsx("path",{d:"M5.3 15A7 7 0 0 0 17.7 17.7L20 16"})]}),_6=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"M12 5v14M5 12h14"})}),C6=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"M3 6h18M8 6V4a2 2 0 0 1 2-2h4a2 2 0 0 1 2 2v2m3 0v14a2 2 0 0 1-2 2H7a2 2 0 0 1-2-2V6"})}),b6=e=>P.jsxs(Ut,{...e,children:[P.jsx("path",{d:"M12 20h9"}),P.jsx("path",{d:"M16.5 3.5a2.12 2.12 0 0 1 3 3L7 19l-4 1 1-4z"})]}),P6=e=>P.jsx(Ut,{...e,children:P.jsx("path",{d:"m18 15-6-6-6 6"})}),_r="focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-accent",Qh=["▁","▂","▃","▄","▅","▆","▇","█"];function F6({data:e,color:t="var(--color-accent)",className:n=""}){const o=Qh.length-1,i=Math.max(...e,0),c=Math.min(...e,0),l=i>0&&c===i;return P.jsx("span",{className:`font-mono leading-none ${n}`,style:{color:t},"aria-hidden":!0,children:e.length===0?"·":l?Qh[Math.floor(o/2)].repeat(e.length):e.map(d=>Qh[i<=0?0:Math.max(0,Math.min(o,Math.floor(d/i*(o+.999))))]).join("")})}function I6({label:e,value:t,sub:n,valueClass:o="text-fg-bright"}){return P.jsxs("div",{children:[P.jsx("div",{className:"font-display text-[10px] uppercase tracking-wide text-fg-faint",children:e}),P.jsx("div",{className:`tnum mt-1 text-xl ${o}`,children:t}),n!=null&&P.jsx("div",{className:"mt-0.5 text-xs text-fg-dim",children:n})]})}function R6({children:e}){return P.jsx("div",{className:"flex h-full min-h-24 items-center justify-center text-center text-xs text-fg-faint",children:e})}function h4(e,t){return t?h1(e):e}function Ix({value:e,privacyMode:t,className:n,title:o}){const[i,c]=Y.useState(!1);return!(t&&qF(e))||i?P.jsx("span",{className:n,title:o??e,children:e}):P.jsx("button",{type:"button",onClick:()=>c(!0),className:`min-w-0 cursor-pointer truncate rounded text-left ${_r} ${n??""}`,title:"Click to reveal email","aria-label":"Email hidden. Click to reveal.",children:P.jsx("span",{className:"inline-block max-w-full truncate blur-sm transition hover:blur-[2px]",children:h1(e)})})}function m4({options:e,value:t,onChange:n,size:o="sm",btnClassName:i,containerClassName:c,ariaLabel:l}){const d="flex items-center overflow-hidden rounded border border-line",h=o==="xs"?"px-1.5 py-0.5 text-[10px] transition max-sm:py-1.5":"px-2 py-1 text-xs transition max-sm:py-2",p=o==="xs"?"bg-bg-3 text-accent":"bg-bg-2 text-accent",y=o==="xs"?"text-fg-faint hover:text-fg":"text-fg-dim hover:text-fg";return P.jsx("div",{className:c??d,role:"radiogroup","aria-label":l,children:e.map(g=>P.jsx("button",{type:"button",role:"radio","aria-checked":t===g.value,onClick:()=>n(g.value),className:`${i??h} ${_r} ${t===g.value?p:y}`,children:g.label},String(g.value)))})}function Rx({label:e,value:t,children:n}){const[o,i]=Y.useState(!1),c=Y.useRef(null),l=Y.useRef(null),d=Y.useRef(null),h=Y.useId(),p=(g=!1)=>{i(!1),g&&requestAnimationFrame(()=>{var v;return(v=l.current)==null?void 0:v.focus()})};Y.useEffect(()=>{if(!o)return;const g=v=>{c.current&&!c.current.contains(v.target)&&p()};return document.addEventListener("mousedown",g),()=>document.removeEventListener("mousedown",g)},[o]);const y=g=>{var E;const v=Array.from(((E=d.current)==null?void 0:E.querySelectorAll('[role="menuitem"]:not([disabled])'))??[]),w=v.indexOf(document.activeElement);let S=null;if(g.key==="Escape"){g.preventDefault(),p(!0);return}g.key==="Home"&&(S=0),g.key==="End"&&(S=v.length-1),g.key==="ArrowDown"&&(S=w<0?0:(w+1)%v.length),g.key==="ArrowUp"&&(S=w<0?v.length-1:(w-1+v.length)%v.length),S!==null&&v[S]&&(g.preventDefault(),v[S].focus())};return P.jsxs("div",{ref:c,className:"relative",children:[P.jsxs("button",{ref:l,type:"button","aria-haspopup":"menu","aria-expanded":o,"aria-controls":o?h:void 0,onClick:()=>i(g=>!g),onKeyDown:g=>{g.key!=="ArrowDown"&&g.key!=="ArrowUp"||(g.preventDefault(),i(!0),requestAnimationFrame(()=>{var w,S;const v=(w=d.current)==null?void 0:w.querySelectorAll('[role="menuitem"]:not([disabled])');(S=v==null?void 0:v[g.key==="ArrowDown"?0:v.length-1])==null||S.focus()}))},className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:py-2 ${_r}`,children:[P.jsxs("span",{className:"text-fg-faint",children:[e,":"]}),P.jsx("span",{className:"text-fg",children:t}),P.jsx(a4,{className:`size-3 transition ${o?"rotate-180":""}`})]}),o&&P.jsx("div",{id:h,ref:d,role:"menu",onKeyDown:y,className:"absolute right-0 z-50 mt-1 min-w-44 max-w-[calc(100vw-2.5rem)] rounded-md border border-line-2 bg-bg-2 p-1 shadow-xl",children:n(()=>p(!0))})]})}function Tx({children:e}){return P.jsx("div",{className:"flex flex-col",children:e})}function Mu({active:e,onClick:t,children:n}){return P.jsx("button",{type:"button",role:"menuitem",onClick:t,className:`flex min-w-0 items-center gap-2 rounded px-2 py-1 text-left text-xs transition ${_r} ${e?"bg-bg-3 text-fg-bright":"text-fg-dim hover:bg-bg-3 hover:text-fg"}`,children:n})}function p4({snapshot:e,derived:t,filters:n,setFilters:o,privacyMode:i=!0}){const c=(e==null?void 0:e.providers)??[],d=((e==null?void 0:e.accounts)??[]).filter(_=>_.hasUsage),h=new Set(d.map(_=>_.providerId)),p=c.filter(_=>h.has(_.id)),y=new Set(t.cardAccounts.map(_=>_.providerId)),g=c.filter(_=>!h.has(_.id)&&y.has(_.id)),v=n.providers.length?d.filter(_=>n.providers.includes(_.providerId)):d,w=_=>{var L;return((L=c.find(C=>C.id===_))==null?void 0:L.name)??_},S=_=>XD(_,w(_.providerId)),E=d.find(_=>_.id===n.account),F=_=>o(L=>{const C=L.providers.includes(_);return{...L,providers:C?L.providers.filter(D=>D!==_):[...L.providers,_]}}),K=n.providers.length>0||n.models.length>0||n.account!=="all";return P.jsx("div",{className:"border-t border-line bg-bg-0/70",children:P.jsxs("div",{className:"mx-auto flex max-w-[1600px] flex-wrap items-center gap-x-4 gap-y-2 px-5 py-2.5 2xl:max-w-[1920px]",children:[P.jsx("span",{className:"hidden text-xs text-fg-faint sm:inline",children:"filter:"}),P.jsxs("div",{className:"flex flex-wrap items-center gap-1.5",children:[p.map(_=>{const L=n.providers.includes(_.id),C=n.providers.length>0&&!L;return P.jsxs("button",{type:"button","aria-pressed":L,onClick:()=>F(_.id),className:`flex items-center gap-1.5 rounded border px-2 py-0.5 text-xs transition max-sm:py-1.5 ${_r}`,style:{borderColor:L?_.color:"var(--color-line)",color:C?"var(--color-fg-faint)":L?_.color:"var(--color-fg-dim)",background:L?"var(--color-bg-2)":"transparent"},title:L?`hide ${_.name}`:n.providers.length?`add ${_.name}`:`show only ${_.name}`,children:[P.jsx("span",{style:{color:_.color,opacity:C?.4:1},"aria-hidden":!0,children:L?"●":"○"}),_.name]},_.id)}),g.length>0&&P.jsxs("span",{className:"flex items-center gap-1.5 text-xs text-fg-faint",title:"Billing-only providers — shown as cards with plan & quota; no usage timeline to filter",children:[p.length>0&&P.jsx("span",{className:"text-line-2",children:"|"}),P.jsx("span",{children:"billing-only:"}),g.map(_=>P.jsxs("span",{className:"flex items-center gap-1 text-fg-dim",children:[P.jsx("span",{style:{color:_.color,opacity:.55},"aria-hidden":!0,children:"·"}),_.name]},_.id))]})]}),P.jsxs("div",{className:"flex w-full flex-wrap items-center gap-2 md:ml-auto md:w-auto",children:[v.length>1?P.jsx(Rx,{label:"account",value:n.account==="all"?"all":E?h4(S(E),i):"all",children:_=>P.jsxs(Tx,{children:[P.jsx(Mu,{active:n.account==="all",onClick:()=>{o(L=>({...L,account:"all"})),_()},children:"All accounts"}),P.jsx("div",{className:"my-1 h-px bg-line"}),P.jsx("div",{className:"max-h-64 overflow-y-auto",children:v.map(L=>P.jsxs(Mu,{active:n.account===L.id,onClick:()=>{o(C=>({...C,account:L.id})),_()},children:[P.jsx("span",{style:{color:L.color},"aria-hidden":!0,children:"●"})," ",P.jsx(Ix,{value:S(L),privacyMode:i,className:"truncate"})]},L.id))})]})}):v.length===1?P.jsxs("span",{className:"rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-dim",children:["account: ",P.jsx(Ix,{value:S(v[0]),privacyMode:i,className:"text-fg"})]}):null,P.jsx(Rx,{label:"model",value:n.models.length===0?"all":n.models.length===1?Px(n.models[0]):`${n.models.length} models`,children:()=>P.jsxs(Tx,{children:[P.jsx(Mu,{active:n.models.length===0,onClick:()=>o(_=>({..._,models:[]})),children:"All models"}),P.jsx("div",{className:"my-1 h-px bg-line"}),P.jsxs("div",{className:"max-h-64 overflow-y-auto",children:[t.modelOptions.length===0&&P.jsx("div",{className:"px-2 py-1 text-xs text-fg-faint",children:"no models in range"}),t.modelOptions.map(_=>{const L=n.models.includes(_);return P.jsxs(Mu,{active:L,onClick:()=>o(C=>({...C,models:L?C.models.filter(D=>D!==_):[...C.models,_]})),children:[P.jsx("span",{className:L?"text-accent":"text-fg-faint","aria-hidden":!0,children:L?"◉":"○"})," ",Px(_)]},_)})]})]})}),P.jsxs("div",{className:"flex shrink-0 items-center gap-1.5",children:[P.jsx("span",{className:"text-xs text-fg-faint",children:"range:"}),P.jsx(m4,{options:Og.map(_=>({value:_.key,label:_.shortLabel})),value:n.period,onChange:_=>o(L=>({...L,period:_})),size:"sm",ariaLabel:"time range"})]}),K&&P.jsxs("button",{type:"button",onClick:()=>o(_=>({..._,providers:[],models:[],account:"all"})),className:`flex items-center gap-1 rounded border border-line bg-bg-1 px-2 py-1 text-xs text-fg-faint transition hover:border-line-2 hover:text-fg ${_r}`,title:"Clear provider, model & account filters","aria-label":"Clear provider, model and account filters",children:[P.jsx(c4,{className:"size-3","aria-hidden":!0})," clear"]})]})]})})}const g4=Y.lazy(()=>Sr(()=>import("./share-sheet-BaEXe1m9.js"),__vite__mapDeps([0,1,2,3]),import.meta.url).then(e=>({default:e.ShareSheet}))),F_=Y.createContext(null),y4=()=>{const e=Y.useContext(F_);if(!e)throw new Error("useShare must be used inside ShareProvider");return e};function v4({children:e}){const[t,n]=Y.useState(null);return P.jsxs(F_.Provider,{value:n,children:[e,t?P.jsx(Y.Suspense,{fallback:P.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Preparing share preview…"}),children:P.jsx(g4,{source:t,onClose:()=>n(null)})}):null]})}function S4({derived:e,periodLabel:t,tz:n,version:o}){const i=y4();return P.jsxs("button",{type:"button",onClick:()=>i({kind:"summary",derived:e,periodLabel:t,tz:n,version:o}),className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2.5 py-1 text-xs text-fg-dim transition hover:border-accent/60 hover:text-accent active:scale-[0.97] max-sm:py-2 ${_r}`,title:"Create a shareable image",children:[P.jsx(i4,{className:"size-3.5"}),P.jsx("span",{children:"share"})]})}const Mx=[{key:"overview",label:"overview"},{key:"analytics",label:"analytics"},{key:"models",label:"models"},{key:"explore",label:"explore"}];function x4(e=1e3){const[t,n]=Y.useState(()=>Date.now());return Y.useEffect(()=>{const o=setInterval(()=>n(Date.now()),e);return()=>clearInterval(o)},[e]),t}function w4({mode:e,resolvedMode:t,disabled:n,onToggle:o}){const i=e==="auto"?"light":e==="light"?"dark":"auto";return P.jsxs("button",{type:"button",onClick:o,disabled:n,title:`Theme: ${e}${e==="auto"?` (${t})`:""}. Switch to ${i}`,"aria-label":`Theme mode ${e}${e==="auto"?`, currently ${t}`:""}; switch to ${i}`,className:`relative rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg disabled:opacity-40 max-sm:p-2.5 ${_r}`,children:[t==="dark"?P.jsx(u4,{className:"size-3.5"}):P.jsx(l4,{className:"size-3.5"}),e==="auto"&&P.jsx("span",{className:"absolute -right-1 -top-1 text-[8px] font-bold text-accent","aria-hidden":!0,children:"A"})]})}function k4({conn:e,freshAt:t}){const n=x4(),o=e==="live"?"var(--color-ok)":e==="error"?"var(--color-critical)":"var(--color-warning)",i=t?zD(t,n):null,c=e==="live"?i??"live":e==="connecting"?"connecting…":e==="reconnecting"?i?`reconnecting · ${i}`:"reconnecting…":i?`offline · ${i}`:"offline";return P.jsxs("span",{className:"flex items-center gap-1.5 text-xs",role:"status","aria-live":"polite",children:[P.jsxs("span",{className:"relative flex size-2","aria-hidden":!0,children:[e==="live"&&P.jsx("span",{className:"absolute inline-flex size-full animate-ping rounded-full opacity-60",style:{background:o}}),P.jsx("span",{className:"relative inline-flex size-2 rounded-full",style:{background:o}})]}),P.jsx("span",{className:"inline-block truncate text-fg-dim max-sm:max-w-[7rem]",children:c})]})}function Jh({label:e}){return P.jsxs("div",{className:"flex min-h-[50vh] flex-col items-center justify-center gap-2 text-sm text-fg-dim",role:"status","aria-live":"polite",children:[P.jsxs("span",{className:"font-display text-lg text-fg-dim","aria-hidden":!0,children:["tokmon",P.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),P.jsx("span",{className:"text-fg-faint",children:e})]})}function Gh(e,t){return e==="error"||e==="reconnecting"?"Connection lost — waiting for the local tokmon daemon…":t}function E4(){const e=document.getElementById("dashboard-content");e&&(e.scrollIntoView({block:"start"}),requestAnimationFrame(()=>e.focus({preventScroll:!0})))}function _4({onOpen:e}){return P.jsx("button",{type:"button",onClick:e,title:"Settings","aria-label":"Open settings",className:`rounded border border-line bg-bg-1 p-1.5 text-fg-dim transition hover:border-line-2 hover:text-fg max-sm:p-2.5 ${_r}`,children:P.jsx(f4,{className:"size-3.5"})})}function C4({phase:e,onRefresh:t}){const n=e==="refreshing"?"refreshing…":e==="success"?"updated":e==="error"?"refresh failed":"refresh";return P.jsxs("button",{type:"button",onClick:t,disabled:e==="refreshing",title:"Refresh all data (R)","aria-label":"Refresh all data",className:`flex items-center gap-1.5 rounded border border-line bg-bg-1 px-2 py-1.5 text-xs text-fg-dim transition hover:border-line-2 hover:text-fg disabled:cursor-wait ${_r}`,children:[P.jsx(d4,{className:`size-3.5 ${e==="refreshing"?"animate-spin motion-reduce:animate-none":""}`}),P.jsx("span",{className:e==="error"?"text-critical":"",children:n})]})}function b4({peak:e,resetDisplay:t,tz:n}){const o=e.state==="peak"?"var(--color-warning)":"var(--color-positive)",i=e.changesAt??(e.minutesUntilChange!=null?new Date(Date.now()+e.minutesUntilChange*6e4).toISOString():null);return P.jsxs("span",{className:"hidden items-center gap-1 text-xs text-fg-dim lg:flex",children:[P.jsx("span",{"aria-hidden":!0,style:{color:o},children:"●"}),P.jsx("span",{style:{color:o},children:e.label}),i&&P.jsxs("span",{className:"tnum text-fg-faint",children:["(",WD(i,t,Date.now(),n),")"]})]})}function P4(e,t){const n=e.providers.filter(c=>t.providers.has(c)),o=e.account==="all"||t.accounts.has(e.account)?e.account:"all",i=t.modelsReady?e.models.filter(c=>t.models.has(c)):e.models;return n.length===e.providers.length&&i.length===e.models.length&&o===e.account?e:{...e,providers:n,account:o,models:i}}function Ng(e,t,n){try{return e(t)}catch(o){return a2("[nuqs] Error while parsing value `%s`: %O"+(n?" (for key `%s`)":""),t,o,n),null}}function fr(e){function t(n){if(typeof n>"u")return null;let o="";if(Array.isArray(n)){if(n[0]===void 0)return null;o=n[0]}return typeof n=="string"&&(o=n),Ng(e.parse,o)}return{type:"single",eq:(n,o)=>n===o,...e,parseServerSide:t,withDefault(n){return{...this,defaultValue:n,parseServerSide(o){return t(o)??n}}},withOptions(n){return{...this,...n}}}}const Yh=fr({parse:e=>e,serialize:String});fr({parse:e=>{const t=parseInt(e);return t==t?t:null},serialize:e=>""+Math.round(e)});fr({parse:e=>{const t=parseInt(e);return t==t?t-1:null},serialize:e=>""+Math.round(e+1)});fr({parse:e=>{const t=parseInt(e,16);return t==t?t:null},serialize:e=>{const t=Math.round(e).toString(16);return(t.length&1?"0":"")+t}});fr({parse:e=>{const t=parseFloat(e);return t==t?t:null},serialize:String});fr({parse:e=>e.toLowerCase()==="true",serialize:String});function Dg(e,t){return e.valueOf()===t.valueOf()}fr({parse:e=>{const t=parseInt(e);return t==t?new Date(t):null},serialize:e=>""+e.valueOf(),eq:Dg});fr({parse:e=>{const t=new Date(e);return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString(),eq:Dg});fr({parse:e=>{const t=new Date(e.slice(0,10));return t.valueOf()==t.valueOf()?t:null},serialize:e=>e.toISOString().slice(0,10),eq:Dg});function F4(e){return I4(e)}function I4(e){return fr({parse:t=>{const n=t;return e.includes(n)?n:null},serialize:String})}function Ax(e,t=","){const n=e.eq??((i,c)=>i===c),o=encodeURIComponent(t);return fr({parse:i=>i===""?[]:i.split(t).map((c,l)=>Ng(e.parse,c.replaceAll(o,t),`[${l}]`)).filter(c=>c!=null),serialize:i=>i.map(c=>(e.serialize?e.serialize(c):String(c)).replaceAll(t,o)).join(t),eq(i,c){return i===c?!0:i.length!==c.length?!1:i.every((l,d)=>n(l,c[d]))}})}const Xh=hp(),R4={};function T4(e,t={}){const n=Y.useId(),o=p2(),i=g2(),{history:c="replace",scroll:l=(o==null?void 0:o.scroll)??!1,shallow:d=(o==null?void 0:o.shallow)??!0,throttleMs:h=_a.timeMs,limitUrlUpdates:p=o==null?void 0:o.limitUrlUpdates,clearOnDefault:y=(o==null?void 0:o.clearOnDefault)??!0,startTransition:g,urlKeys:v=R4}=t,w=Object.keys(e).join(","),S=Y.useMemo(()=>Object.fromEntries(Object.keys(e).map(T=>[T,v[T]??T])),[w,JSON.stringify(v)]),E=m2(Object.values(S)),F=E.searchParams,K=Y.useRef({}),_=Y.useMemo(()=>Object.fromEntries(Object.keys(e).map(T=>[T,e[T].defaultValue??null])),[Object.values(e).map(({defaultValue:T})=>T).join(",")]),L=gh.useQueuedQueries(Object.values(S)),[C,D]=Y.useState(()=>Zh(e,v,F??new URLSearchParams,L).state),$=Y.useRef(C);if(nt("[nuq+ %s `%s`] render - state: %O, iSP: %s",n,w,C,F),Object.keys(K.current).join("&")!==Object.values(S).join("&")){const{state:T,hasChanged:q}=Zh(e,v,F,L,K.current,$.current);q&&(nt("[nuq+ %s `%s`] State changed: %O",n,w,{state:T,initialSearchParams:F,queuedQueries:L,queryRef:K.current,stateRef:$.current}),$.current=T,D(T)),K.current=Object.fromEntries(Object.entries(S).map(([ee,ne])=>{var H;return[ne,((H=e[ee])==null?void 0:H.type)==="multi"?F==null?void 0:F.getAll(ne):(F==null?void 0:F.get(ne))??null]}))}Y.useEffect(()=>{const{state:T,hasChanged:q}=Zh(e,v,F,L,K.current,$.current);q&&(nt("[nuq+ %s `%s`] State changed: %O",n,w,{state:T,initialSearchParams:F,queuedQueries:L,queryRef:K.current,stateRef:$.current}),$.current=T,D(T))},[Object.values(S).map(T=>`${T}=${F==null?void 0:F.getAll(T)}`).join("&"),JSON.stringify(L)]),Y.useEffect(()=>{const T=Object.keys(e).reduce((q,ee)=>(q[ee]=({state:ne,query:H})=>{D(k=>{const{defaultValue:U}=e[ee],V=S[ee],J=ne??U??null,B=k[ee]??U??null;return Object.is(B,J)?(nt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). no change, skipping, resolved: %O",n,w,V,ne,U,$.current),k):($.current={...$.current,[ee]:J},K.current[V]=H,nt("[nuq+ %s `%s`] Cross-hook key sync %s: %O (default: %O). updateInternalState, resolved: %O",n,w,V,ne,U,$.current),$.current)})},q),{});for(const q of Object.keys(e)){const ee=S[q];nt("[nuq+ %s `%s`] Subscribing to sync for `%s`",n,ee,w),Xh.on(ee,T[q])}return()=>{for(const q of Object.keys(e)){const ee=S[q];nt("[nuq+ %s `%s`] Unsubscribing to sync for `%s`",n,ee,w),Xh.off(ee,T[q])}}},[w,S]);const N=Y.useCallback((T,q={})=>{var B,X,re,te,I,Z;const ee=Object.fromEntries(Object.keys(e).map(pe=>[pe,null])),ne=typeof T=="function"?T(Lx($.current,_))??ee:T??ee;nt("[nuq+ %s `%s`] setState: %O",n,w,ne);let H,k=0,U=!1;const V=[];for(let[pe,me]of Object.entries(ne)){const le=e[pe],Fe=S[pe];if(!le||me===void 0)continue;(q.clearOnDefault??le.clearOnDefault??y)&&me!==null&&le.defaultValue!==void 0&&(le.eq??((Pe,Ve)=>Pe===Ve))(me,le.defaultValue)&&(me=null);const fe=me===null?null:(le.serialize??String)(me);Xh.emit(Fe,{state:me,query:fe});const ke={key:Fe,query:fe,options:{history:q.history??le.history??c,shallow:q.shallow??le.shallow??d,scroll:q.scroll??le.scroll??l,startTransition:q.startTransition??le.startTransition??g}};if(((B=q==null?void 0:q.limitUrlUpdates)==null?void 0:B.method)==="debounce"||(p==null?void 0:p.method)==="debounce"||((X=le.limitUrlUpdates)==null?void 0:X.method)==="debounce"){ke.options.shallow===!0&&console.warn(Ga(422));const Pe=((re=q==null?void 0:q.limitUrlUpdates)==null?void 0:re.timeMs)??(p==null?void 0:p.timeMs)??((te=le.limitUrlUpdates)==null?void 0:te.timeMs)??_a.timeMs,Ve=gh.push(ke,Pe,E,i);k<Pe&&(H=Ve,k=Pe)}else{const Pe=((I=q==null?void 0:q.limitUrlUpdates)==null?void 0:I.timeMs)??((Z=le==null?void 0:le.limitUrlUpdates)==null?void 0:Z.timeMs)??(p==null?void 0:p.timeMs)??q.throttleMs??le.throttleMs??h;V.push(gh.abort(Fe)),ju.push(ke,Pe),U=!0}}const J=V.reduce((pe,me)=>me(pe),U?ju.flush(E,i):ju.getPendingPromise(E));return H??J},[w,c,d,l,h,p==null?void 0:p.method,p==null?void 0:p.timeMs,g,S,E.updateUrl,E.getSearchParamsSnapshot,E.rateLimitFactor,i,_]);return[Y.useMemo(()=>Lx(C,_),[C,_]),N]}function Zh(e,t,n,o,i,c){let l=!1;const d=Object.entries(e).reduce((h,[p,y])=>{const g=(t==null?void 0:t[p])??p,v=o[g],w=y.type==="multi"?[]:null,S=v===void 0?(y.type==="multi"?n==null?void 0:n.getAll(g):n==null?void 0:n.get(g))??w:v;return i&&c&&_w(i[g]??w,S)?(h[p]=c[p]??null,h):(l=!0,h[p]=(S2(S)?null:Ng(y.parse,S,g))??null,i&&(i[g]=S),h)},{});if(!l){const h=Object.keys(e),p=Object.keys(c??{});l=h.length!==p.length||h.some(y=>!p.includes(y))}return{state:d,hasChanged:l}}function Lx(e,t){return Object.fromEntries(Object.keys(e).map(n=>[n,e[n]??t[n]??null]))}function M4(){const[e,t]=T4({p:Ax(Yh).withDefault([]),m:Ax(Yh).withDefault([]),a:Yh.withDefault("all"),period:F4(Og.map(i=>i.key)).withDefault(QD.period)},{history:"replace"}),n=Y.useMemo(()=>({providers:e.p,models:e.m,account:e.a,period:e.period}),[e.p,e.m,e.a,e.period]),o=Y.useCallback(i=>{t(c=>{const l={providers:c.p,models:c.m,account:c.a,period:c.period},d=typeof i=="function"?i(l):i;return{p:d.providers,m:d.models,a:d.account,period:d.period}})},[t]);return[n,o]}const Ox=Symbol.for("~effect/http/Headers"),Ka=Object.create(null);Object.defineProperties(Ka,{[Ox]:{value:Ox},[Bl]:{value(e){return N4(this,oo(e,D4))}},toJSON:{value(){return zl(this)}},[sn]:{value(e){return L4(this,e)}},[rn]:{value(){return Fp(this)}},toString:{value:ES.toString},[fo]:{value:ES[fo]}});const A4=e=>Object.assign(Object.create(Ka),e),L4=gR(_I()),jg=Object.create(Ka),O4=e=>{if(e===void 0)return jg;if(Symbol.iterator in e){const n=Object.create(Ka);for(const[o,i]of e)n[o.toLowerCase()]=i;return n}const t=Object.create(Ka);for(const[n,o]of Object.entries(e))Array.isArray(o)?t[n.toLowerCase()]=o.join(", "):o!==void 0&&(t[n.toLowerCase()]=o);return t},Nx=se(2,(e,t)=>{const n=A4(e);return Object.assign(n,t),n}),N4=se(2,(e,t)=>{const n={...e},o=i=>{if(typeof i=="string"){const c=i.toLowerCase();c in e&&(n[c]=ex(e[c]))}else for(const c in e)i.test(c)&&(n[c]=ex(e[c]))};if(Array.isArray(t))for(let i=0;i<t.length;i++)o(t[i]);else o(t);return n}),D4=rt("effect/Headers/CurrentRedactedNames",{defaultValue:()=>["authorization","cookie","set-cookie","x-api-key"]}),j4="~effect/http/HttpClientError";class $g extends Hn(j4)({_tag:Sn("HttpError"),kind:He(["EncodeError","DecodeError","TransportError","InvalidUrlError","StatusCodeError","EmptyBodyError"]),cause:Ei(lr)}){static fromHttpClientError(t){return new $g({_tag:"HttpError",kind:t.reason._tag,cause:t.reason})}}const Dx="~effect/socket/Socket",Ug=Wn("effect/socket/Socket"),$4=e=>Ug.of({[Dx]:Dx,runRaw:e.runRaw,run:e.run??((t,n)=>e.runRaw(o=>typeof o=="string"?t(U4.encode(o)):o instanceof Uint8Array?t(o):t(new Uint8Array(o)),n)),runString:e.runString??(e.run?(t,n)=>e.run(o=>t(em.decode(o)),n):(t,n)=>e.runRaw(o=>typeof o=="string"?t(o):o instanceof Uint8Array?t(em.decode(o)):t(em.decode(new Uint8Array(o))),n)),writer:e.writer}),U4=new TextEncoder,em=new TextDecoder,B4="~effect/socket/Socket/CloseEvent",z4=e=>Ue(e,B4),Yu="~effect/socket/Socket/SocketError",V4=e=>Ue(e,Yu);class I_ extends Hn("effect/socket/Socket/SocketReadError")({_tag:Sn("SocketReadError"),cause:lr}){constructor(){super(...arguments);A(this,"message","An error occurred during Read")}}class q4 extends Hn("effect/socket/Socket/SocketWriteError")({_tag:Sn("SocketWriteError"),cause:lr}){constructor(){super(...arguments);A(this,"message","An error occurred during Write")}}class Il extends Hn("effect/socket/Socket/SocketOpenError")({_tag:Sn("SocketOpenError"),kind:He(["Unknown","Timeout"]),cause:lr}){get message(){return this.kind==="Timeout"?'timeout waiting for "open"':"An error occurred during Open"}}class Rl extends Hn("effect/socket/Socket/SocketCloseError")({_tag:Sn("SocketCloseError"),code:Ig,closeReason:Ei(de)}){static filterClean(t){return function(n){return ci.is(n)&&n.reason._tag==="SocketCloseError"&&t(n.reason.code)?Hr(n.reason):or(n)}}get message(){return this.closeReason?`${this.code}: ${this.closeReason}`:`${this.code}`}}const R_=nn([I_,q4,Il,Rl]);var vw,Sw;class ci extends(Sw=vf(Yu)("SocketError",{_tag:Sn("SocketError"),reason:R_}),vw=Yu,Sw){constructor(n){var t=(...Q6)=>(super(...Q6),A(this,vw,Yu),A(this,"message",this.reason.message),this);"cause"in n.reason?t({...n,cause:n.reason.cause}):t(n)}static is(n){return V4(n)}}const W4=e=>!0;class H4 extends Wn()("~effect/socket/Socket/WebSocket"){}class T_ extends Wn()("@effect/platform/Socket/WebSocketConstructor"){}const K4=cg(T_)((e,t)=>new globalThis.WebSocket(e,t)),Q4=(e,t)=>T_.use(n=>J4(hE((typeof e=="string"?ft(e):e).pipe(Ms(o=>n(o,t==null?void 0:t.protocols))),o=>Bn(()=>o.close(1e3))),t)),J4=(e,t)=>ml(n=>{let o;const i=t_(!1),c=n.context,l=(t==null?void 0:t.closeCodeIsError)??W4,d=(y,g)=>LL(ao(function*(v){const w=yield*UN().pipe(fl(v)),S=yield*fl(e,v),E=yield*AL(qN(w)(),H4,S);let F=!1;function K(C){if(C.data instanceof Blob){const $=Rn(pL(()=>C.data.arrayBuffer()),N=>{const T=y(new Uint8Array(N));return ai(T)?T:gt});return E($)}const D=y(C.data);ai(D)&&E(D)}function _(C){S.removeEventListener("message",K),S.removeEventListener("close",L),Pa(w.deferred,Ge(new ci({reason:F?new I_({cause:C}):new Il({kind:"Unknown",cause:C})})))}function L(C){const D=typeof C.code=="number"?C.code:1001;S.removeEventListener("message",K),S.removeEventListener("error",_),Pa(w.deferred,Ge(new ci({reason:new Rl({code:D,closeReason:C.reason})})))}if(S.addEventListener("close",L,{once:!0}),S.addEventListener("error",_,{once:!0}),S.addEventListener("message",K),S.readyState!==1){const C=ng();S.addEventListener("open",()=>{F=!0,Pa(C,gt)},{once:!0}),yield*rg(C).pipe(lE({duration:(t==null?void 0:t.openTimeout)??1e4,orElse:()=>Ge(new ci({reason:new Il({kind:"Timeout",cause:new Error('timeout waiting for "open"')})}))}),fE(wx(w)))}return F=!0,o=S,i.openUnsafe(),g!=null&&g.onOpen&&(yield*g.onOpen),yield*EL(wx(w),Rl.filterClean(C=>!l(C)),()=>gt)})).pipe(ML(v=>hi(c,v)),mE(Bn(()=>{i.closeUnsafe(),o=void 0}))),p=ft(y=>i.whenOpen(Bn(()=>{const g=o;z4(y)?g.close(y.code,y.reason):g.send(y)})));return ft($4({runRaw:d,writer:p}))}),G4=g1(Q4,Am(Ug));class M_ extends Wn()("effect/workers/Transferable/Collector"){}const Y4=()=>{let e=[];const t=i=>{e.push(...i)},n=()=>e,o=()=>{const i=e;return e=[],i};return M_.of({addAllUnsafe:t,addAll:i=>Bn(()=>t(i)),readUnsafe:n,read:Bn(n),clearUnsafe:o,clear:Bn(o)})};class X4 extends Hn("effect/workers/WorkerError/WorkerSpawnError")({_tag:Sn("WorkerSpawnError"),message:de,cause:Ei(lr)}){}class Z4 extends Hn("effect/workers/WorkerError/WorkerSendError")({_tag:Sn("WorkerSendError"),message:de,cause:Ei(lr)}){}class ej extends Hn("effect/workers/WorkerError/WorkerReceiveError")({_tag:Sn("WorkerReceiveError"),message:de,cause:Ei(lr)}){}class tj extends Hn("effect/workers/WorkerError/WorkerUnknownError")({_tag:Sn("WorkerUnknownError"),message:de,cause:Ei(lr)}){}const nj=nn([X4,Z4,ej,tj]),tm="~effect/rpc/RpcClientError";class Zm extends Hn("effect/rpc/RpcClientError/RpcClientDefect")({_tag:Sn("RpcClientDefect"),message:de,cause:lr}){}var xw,ww;class ep extends(ww=Hn(tm)({_tag:Sn("RpcClientError"),reason:nn([nj,R_,$g,Zm])}),xw=tm,ww){constructor(){super(...arguments);A(this,xw,tm)}get message(){return`${this.reason._tag}: ${this.reason.message}`}}const Au=e=>typeof e=="bigint"?e:BigInt(e),rj={_tag:"Ping"};var tp;try{tp=new TextDecoder}catch{}var ue,wr,O=0,Je={},Oe,Ss,Un=0,vr=0,It,Wr,yn=[],Le,jx={useRecords:!1,mapsAsObjects:!0};class A_{}const L_=new A_;L_.name="MessagePack 0xC1";var Es=!1,$x=2,sj;class Qa{constructor(t){t&&(t.useRecords===!1&&t.mapsAsObjects===void 0&&(t.mapsAsObjects=!0),t.sequential&&t.trusted!==!1&&(t.trusted=!0,!t.structures&&t.useRecords!=!1&&(t.structures=[],t.maxSharedStructures||(t.maxSharedStructures=0))),t.structures?t.structures.sharedLength=t.structures.length:t.getStructures&&((t.structures=[]).uninitialized=!0,t.structures.sharedLength=0),t.int64AsNumber&&(t.int64AsType="number")),Object.assign(this,t)}unpack(t,n){if(ue)return U_(()=>(rp(),this?this.unpack(t,n):Qa.prototype.unpack.call(jx,t,n)));!t.buffer&&t.constructor===ArrayBuffer&&(t=typeof Buffer<"u"?Buffer.from(t):new Uint8Array(t)),typeof n=="object"?(wr=n.end||t.length,O=n.start||0):(O=0,wr=n>-1?n:t.length),vr=0,Ss=null,It=null,ue=t;try{Le=t.dataView||(t.dataView=new DataView(t.buffer,t.byteOffset,t.byteLength))}catch(o){throw ue=null,t instanceof Uint8Array?o:new Error("Source must be a Uint8Array or Buffer but was a "+(t&&typeof t=="object"?t.constructor.name:typeof t))}if(this instanceof Qa){if(Je=this,this.structures)return Oe=this.structures,Lu(n);(!Oe||Oe.length>0)&&(Oe=[])}else Je=jx,(!Oe||Oe.length>0)&&(Oe=[]);return Lu(n)}unpackMultiple(t,n){let o,i=0;try{Es=!0;let c=t.length,l=this?this.unpack(t,c):Sf.unpack(t,c);if(n){if(n(l,i,O)===!1)return;for(;O<c;)if(i=O,n(Lu(),i,O)===!1)return}else{for(o=[l];O<c;)i=O,o.push(Lu());return o}}catch(c){throw c.lastPosition=i,c.values=o,c}finally{Es=!1,rp()}}_mergeStructures(t,n){t=t||[],Object.isFrozen(t)&&(t=t.map(o=>o.slice(0)));for(let o=0,i=t.length;o<i;o++){let c=t[o];c&&(c.isShared=!0,o>=32&&(c.highByte=o-32>>5))}t.sharedLength=t.length;for(let o in n||[])if(o>=0){let i=t[o],c=n[o];c&&(i&&((t.restoreStructures||(t.restoreStructures=[]))[o]=i),t[o]=c)}return this.structures=t}decode(t,n){return this.unpack(t,n)}}function Lu(e){try{if(!Je.trusted&&!Es){let n=Oe.sharedLength||0;n<Oe.length&&(Oe.length=n)}let t;if(Je.randomAccessStructure&&ue[O]<64&&ue[O]>=32&&sj||(t=yt()),It&&(O=It.postBundlePosition,It=null),Es&&(Oe.restoreStructures=null),O==wr)Oe&&Oe.restoreStructures&&Ux(),Oe=null,ue=null,Wr&&(Wr=null);else{if(O>wr)throw new Error("Unexpected end of MessagePack data");if(!Es){let n;try{n=JSON.stringify(t,(o,i)=>typeof i=="bigint"?`${i}n`:i).slice(0,100)}catch(o){n="(JSON view not available "+o+")"}throw new Error("Data read, but end of buffer not reached "+n)}}return t}catch(t){throw Oe&&Oe.restoreStructures&&Ux(),rp(),(t instanceof RangeError||t.message.startsWith("Unexpected end of buffer")||O>wr)&&(t.incomplete=!0),t}}function Ux(){for(let e in Oe.restoreStructures)Oe[e]=Oe.restoreStructures[e];Oe.restoreStructures=null}function yt(){let e=ue[O++];if(e<160)if(e<128){if(e<64)return e;{let t=Oe[e&63]||Je.getStructures&&O_()[e&63];return t?(t.read||(t.read=Bg(t,e&63)),t.read()):e}}else if(e<144)if(e-=128,Je.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=D_();o==="__proto__"&&(o="__proto_"),t[o]=yt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(yt(),yt());return t}else{e-=144;let t=new Array(e);for(let n=0;n<e;n++)t[n]=yt();return Je.freezeData?Object.freeze(t):t}else if(e<192){let t=e-160;if(vr>=O)return Ss.slice(O-Un,(O+=t)-Un);if(vr==0&&wr<140){let n=t<16?zg(t):N_(t);if(n!=null)return n}return np(t)}else{let t;switch(e){case 192:return null;case 193:return It?(t=yt(),t>0?It[1].slice(It.position1,It.position1+=t):It[0].slice(It.position0,It.position0-=t)):L_;case 194:return!1;case 195:return!0;case 196:if(t=ue[O++],t===void 0)throw new Error("Unexpected end of buffer");return nm(t);case 197:return t=Le.getUint16(O),O+=2,nm(t);case 198:return t=Le.getUint32(O),O+=4,nm(t);case 199:return Js(ue[O++]);case 200:return t=Le.getUint16(O),O+=2,Js(t);case 201:return t=Le.getUint32(O),O+=4,Js(t);case 202:if(t=Le.getFloat32(O),Je.useFloat32>2){let n=Vg[(ue[O]&127)<<1|ue[O+1]>>7];return O+=4,(n*t+(t>0?.5:-.5)>>0)/n}return O+=4,t;case 203:return t=Le.getFloat64(O),O+=8,t;case 204:return ue[O++];case 205:return t=Le.getUint16(O),O+=2,t;case 206:return t=Le.getUint32(O),O+=4,t;case 207:return Je.int64AsType==="number"?(t=Le.getUint32(O)*4294967296,t+=Le.getUint32(O+4)):Je.int64AsType==="string"?t=Le.getBigUint64(O).toString():Je.int64AsType==="auto"?(t=Le.getBigUint64(O),t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Le.getBigUint64(O),O+=8,t;case 208:return Le.getInt8(O++);case 209:return t=Le.getInt16(O),O+=2,t;case 210:return t=Le.getInt32(O),O+=4,t;case 211:return Je.int64AsType==="number"?(t=Le.getInt32(O)*4294967296,t+=Le.getUint32(O+4)):Je.int64AsType==="string"?t=Le.getBigInt64(O).toString():Je.int64AsType==="auto"?(t=Le.getBigInt64(O),t>=BigInt(-2)<<BigInt(52)&&t<=BigInt(2)<<BigInt(52)&&(t=Number(t))):t=Le.getBigInt64(O),O+=8,t;case 212:if(t=ue[O++],t==114)return Hx(ue[O++]&63);{let n=yn[t];if(n)return n.read?(O++,n.read(yt())):n.noBuffer?(O++,n()):n(ue.subarray(O,++O));throw new Error("Unknown extension "+t)}case 213:return t=ue[O],t==114?(O++,Hx(ue[O++]&63,ue[O++])):Js(2);case 214:return Js(4);case 215:return Js(8);case 216:return Js(16);case 217:return t=ue[O++],vr>=O?Ss.slice(O-Un,(O+=t)-Un):ij(t);case 218:return t=Le.getUint16(O),O+=2,vr>=O?Ss.slice(O-Un,(O+=t)-Un):aj(t);case 219:return t=Le.getUint32(O),O+=4,vr>=O?Ss.slice(O-Un,(O+=t)-Un):cj(t);case 220:return t=Le.getUint16(O),O+=2,zx(t);case 221:return t=Le.getUint32(O),O+=4,zx(t);case 222:return t=Le.getUint16(O),O+=2,Vx(t);case 223:return t=Le.getUint32(O),O+=4,Vx(t);default:if(e>=224)return e-256;if(e===void 0){let n=new Error("Unexpected end of MessagePack data");throw n.incomplete=!0,n}throw new Error("Unknown MessagePack token "+e)}}}const oj=/^[a-zA-Z_$][a-zA-Z\d_$]*$/;function Bg(e,t){function n(){if(n.count++>$x){let i;try{i=e.read=new Function("r","return function(){return "+(Je.freezeData?"Object.freeze":"")+"({"+e.map(c=>c==="__proto__"?"__proto_:r()":oj.test(c)?c+":r()":"["+JSON.stringify(c)+"]:r()").join(",")+"})}")(yt)}catch{return $x=1/0,n()}return e.read0=i,e.highByte===0&&(e.read=Bx(t,e.read)),i()}let o={};for(let i=0,c=e.length;i<c;i++){let l=e[i];l==="__proto__"&&(l="__proto_"),o[l]=yt()}return Je.freezeData?Object.freeze(o):o}return n.count=0,e.read0=n,e.highByte===0?Bx(t,n):n}const Bx=(e,t)=>function(){let n=ue[O++];if(n===0)return t();let o=e<32?-(e+(n<<5)):e+(n<<5),i=Oe[o]||O_()[o];if(!i)throw new Error("Record id is not defined for "+o);return i.read||(i.read=Bg(i,e)),i.read()};function O_(){let e=U_(()=>(ue=null,Je.getStructures()));return Oe=Je._mergeStructures(e,Oe)}var np=pc,ij=pc,aj=pc,cj=pc;function pc(e){let t;if(e<16&&(t=zg(e)))return t;if(e>64&&tp)return tp.decode(ue.subarray(O,O+=e));const n=O+e,o=[];for(t="";O<n;){const i=ue[O++];if((i&128)===0)o.push(i);else if((i&224)===192){const c=ue[O++]&63,l=(i&31)<<6|c;l<128?o.push(65533):o.push(l)}else if((i&240)===224){const c=ue[O++]&63,l=ue[O++]&63,d=(i&31)<<12|c<<6|l;d<2048||d>=55296&&d<=57343?o.push(65533):o.push(d)}else if((i&248)===240){const c=ue[O++]&63,l=ue[O++]&63,d=ue[O++]&63;let h=(i&7)<<18|c<<12|l<<6|d;h<65536||h>1114111?o.push(65533):(h>65535&&(h-=65536,o.push(h>>>10&1023|55296),h=56320|h&1023),o.push(h))}else o.push(65533);o.length>=4096&&(t+=Pt.apply(String,o),o.length=0)}return o.length>0&&(t+=Pt.apply(String,o)),t}function zx(e){let t=new Array(e);for(let n=0;n<e;n++)t[n]=yt();return Je.freezeData?Object.freeze(t):t}function Vx(e){if(Je.mapsAsObjects){let t={};for(let n=0;n<e;n++){let o=D_();o==="__proto__"&&(o="__proto_"),t[o]=yt()}return t}else{let t=new Map;for(let n=0;n<e;n++)t.set(yt(),yt());return t}}var Pt=String.fromCharCode;function N_(e){let t=O,n=new Array(e);for(let o=0;o<e;o++){const i=ue[O++];if((i&128)>0){O=t;return}n[o]=i}return Pt.apply(String,n)}function zg(e){if(e<4)if(e<2){if(e===0)return"";{let t=ue[O++];if((t&128)>1){O-=1;return}return Pt(t)}}else{let t=ue[O++],n=ue[O++];if((t&128)>0||(n&128)>0){O-=2;return}if(e<3)return Pt(t,n);let o=ue[O++];if((o&128)>0){O-=3;return}return Pt(t,n,o)}else{let t=ue[O++],n=ue[O++],o=ue[O++],i=ue[O++];if((t&128)>0||(n&128)>0||(o&128)>0||(i&128)>0){O-=4;return}if(e<6){if(e===4)return Pt(t,n,o,i);{let c=ue[O++];if((c&128)>0){O-=5;return}return Pt(t,n,o,i,c)}}else if(e<8){let c=ue[O++],l=ue[O++];if((c&128)>0||(l&128)>0){O-=6;return}if(e<7)return Pt(t,n,o,i,c,l);let d=ue[O++];if((d&128)>0){O-=7;return}return Pt(t,n,o,i,c,l,d)}else{let c=ue[O++],l=ue[O++],d=ue[O++],h=ue[O++];if((c&128)>0||(l&128)>0||(d&128)>0||(h&128)>0){O-=8;return}if(e<10){if(e===8)return Pt(t,n,o,i,c,l,d,h);{let p=ue[O++];if((p&128)>0){O-=9;return}return Pt(t,n,o,i,c,l,d,h,p)}}else if(e<12){let p=ue[O++],y=ue[O++];if((p&128)>0||(y&128)>0){O-=10;return}if(e<11)return Pt(t,n,o,i,c,l,d,h,p,y);let g=ue[O++];if((g&128)>0){O-=11;return}return Pt(t,n,o,i,c,l,d,h,p,y,g)}else{let p=ue[O++],y=ue[O++],g=ue[O++],v=ue[O++];if((p&128)>0||(y&128)>0||(g&128)>0||(v&128)>0){O-=12;return}if(e<14){if(e===12)return Pt(t,n,o,i,c,l,d,h,p,y,g,v);{let w=ue[O++];if((w&128)>0){O-=13;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w)}}else{let w=ue[O++],S=ue[O++];if((w&128)>0||(S&128)>0){O-=14;return}if(e<15)return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w,S);let E=ue[O++];if((E&128)>0){O-=15;return}return Pt(t,n,o,i,c,l,d,h,p,y,g,v,w,S,E)}}}}}function qx(){let e=ue[O++],t;if(e<192)t=e-160;else switch(e){case 217:t=ue[O++];break;case 218:t=Le.getUint16(O),O+=2;break;case 219:t=Le.getUint32(O),O+=4;break;default:throw new Error("Expected string")}return pc(t)}function nm(e){return Je.copyBuffers?Uint8Array.prototype.slice.call(ue,O,O+=e):ue.subarray(O,O+=e)}function Js(e){let t=ue[O++];if(yn[t]){let n;return yn[t](ue.subarray(O,n=O+=e),o=>{O=o;try{return yt()}finally{O=n}})}else throw new Error("Unknown extension type "+t)}var Wx=new Array(4096);function D_(){let e=ue[O++];if(e>=160&&e<192){if(e=e-160,vr>=O)return Ss.slice(O-Un,(O+=e)-Un);if(!(vr==0&&wr<180))return np(e)}else return O--,j_(yt());let t=(e<<5^(e>1?Le.getUint16(O):e>0?ue[O]:0))&4095,n=Wx[t],o=O,i=O+e-3,c,l=0;if(n&&n.bytes==e){for(;o<i;){if(c=Le.getUint32(o),c!=n[l++]){o=1879048192;break}o+=4}for(i+=3;o<i;)if(c=ue[o++],c!=n[l++]){o=1879048192;break}if(o===i)return O=o,n.string;i-=3,o=O}for(n=[],Wx[t]=n,n.bytes=e;o<i;)c=Le.getUint32(o),n.push(c),o+=4;for(i+=3;o<i;)c=ue[o++],n.push(c);let d=e<16?zg(e):N_(e);return d!=null?n.string=d:n.string=np(e)}function j_(e){if(typeof e=="string")return e;if(typeof e=="number"||typeof e=="boolean"||typeof e=="bigint")return e.toString();if(e==null)return e+"";if(Je.allowArraysInMapKeys&&Array.isArray(e)&&e.flat().every(t=>["string","number","boolean","bigint"].includes(typeof t)))return e.flat().toString();throw new Error(`Invalid property type for record: ${typeof e}`)}const Hx=(e,t)=>{let n=yt().map(j_),o=e;t!==void 0&&(e=e<32?-((t<<5)+e):(t<<5)+e,n.highByte=t);let i=Oe[e];return i&&(i.isShared||Es)&&((Oe.restoreStructures||(Oe.restoreStructures=[]))[e]=i),Oe[e]=n,n.read=Bg(n,o),(n.read0||n.read)()};yn[0]=()=>{};yn[0].noBuffer=!0;yn[66]=e=>{let t=e.byteLength%8||8,n=BigInt(e[0]&128?e[0]-256:e[0]);for(let o=1;o<t;o++)n<<=BigInt(8),n+=BigInt(e[o]);if(e.byteLength!==t){let o=new DataView(e.buffer,e.byteOffset,e.byteLength),i=(c,l)=>{let d=l-c;if(d<=40){let g=o.getBigUint64(c);for(let v=c+8;v<l;v+=8)g<<=BigInt(64),g|=o.getBigUint64(v);return g}let h=c+(d>>4<<3),p=i(c,h),y=i(h,l);return p<<BigInt((l-h)*8)|y};n=n<<BigInt((o.byteLength-t)*8)|i(t,o.byteLength)}return n};let Kx={Error,EvalError,RangeError,ReferenceError,SyntaxError,TypeError,URIError,AggregateError:typeof AggregateError=="function"?AggregateError:null};yn[101]=()=>{let e=yt();if(!Kx[e[0]]){let t=Error(e[1],{cause:e[2]});return t.name=e[0],t}return Kx[e[0]](e[1],{cause:e[2]})};yn[105]=e=>{if(Je.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Le.getUint32(O-4);Wr||(Wr=new Map);let n=ue[O],o;n>=144&&n<160||n==220||n==221?o=[]:n>=128&&n<144||n==222||n==223?o=new Map:(n>=199&&n<=201||n>=212&&n<=216)&&ue[O+1]===115?o=new Set:o={};let i={target:o};Wr.set(t,i);let c=yt();if(i.used)Object.assign(o,c);else return i.target=c;if(o instanceof Map)for(let[l,d]of c.entries())o.set(l,d);if(o instanceof Set)for(let l of Array.from(c))o.add(l);return o};yn[112]=e=>{if(Je.structuredClone===!1)throw new Error("Structured clone extension is disabled");let t=Le.getUint32(O-4),n=Wr.get(t);return n.used=!0,n.target};yn[115]=()=>new Set(yt());const $_=["Int8","Uint8","Uint8Clamped","Int16","Uint16","Int32","Uint32","Float32","Float64","BigInt64","BigUint64"].map(e=>e+"Array");let uj=typeof globalThis=="object"?globalThis:window;yn[116]=e=>{let t=e[0],n=Uint8Array.prototype.slice.call(e,1).buffer,o=$_[t];if(!o){if(t===16)return n;if(t===17)return new DataView(n);throw new Error("Could not find typed array for code "+t)}return new uj[o](n)};yn[120]=()=>{let e=yt();return new RegExp(e[0],e[1])};const lj=[];yn[98]=e=>{let t=(e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3],n=O;return O+=t-e.length,It=lj,It=[qx(),qx()],It.position0=0,It.position1=0,It.postBundlePosition=O,O=n,yt()};yn[255]=e=>e.length==4?new Date((e[0]*16777216+(e[1]<<16)+(e[2]<<8)+e[3])*1e3):e.length==8?new Date(((e[0]<<22)+(e[1]<<14)+(e[2]<<6)+(e[3]>>2))/1e6+((e[3]&3)*4294967296+e[4]*16777216+(e[5]<<16)+(e[6]<<8)+e[7])*1e3):e.length==12?new Date(((e[0]<<24)+(e[1]<<16)+(e[2]<<8)+e[3])/1e6+((e[4]&128?-281474976710656:0)+e[6]*1099511627776+e[7]*4294967296+e[8]*16777216+(e[9]<<16)+(e[10]<<8)+e[11])*1e3):new Date("invalid");function U_(e){let t=wr,n=O,o=Un,i=vr,c=Ss,l=Wr,d=It,h=new Uint8Array(ue.slice(0,wr)),p=Oe,y=Oe.slice(0,Oe.length),g=Je,v=Es,w=e();return wr=t,O=n,Un=o,vr=i,Ss=c,Wr=l,It=d,ue=h,Es=v,Oe=p,Oe.splice(0,Oe.length,...y),Je=g,Le=new DataView(ue.buffer,ue.byteOffset,ue.byteLength),w}function rp(){ue=null,Wr=null,Oe=null}const Vg=new Array(147);for(let e=0;e<256;e++)Vg[e]=+("1e"+Math.floor(45.15-e*.30103));var Sf=new Qa({useRecords:!1});Sf.unpack;Sf.unpackMultiple;Sf.unpack;let fj=new Float32Array(1);new Uint8Array(fj.buffer,0,4);let Xu;try{Xu=new TextEncoder}catch{}let sp,op;const Si=typeof Buffer<"u",Ou=Si?function(e){return Buffer.allocUnsafeSlow(e)}:Uint8Array,B_=Si?Buffer:Uint8Array,Qx=Si?4294967296:2144337920;let Q,va,qe,j=0,Wt,it=null,dj;const hj=21760,mj=/[\u0080-\uFFFF]/,Zo=Symbol("record-id");class pj extends Qa{constructor(t){super(t),this.offset=0;let n,o,i,c,l=B_.prototype.utf8Write?function(k,U){return Q.utf8Write(k,U,Q.byteLength-U)}:Xu&&Xu.encodeInto?function(k,U){return Xu.encodeInto(k,Q.subarray(U)).written}:!1,d=this;t||(t={});let h=t&&t.sequential,p=t.structures||t.saveStructures,y=t.maxSharedStructures;if(y==null&&(y=p?32:0),y>8160)throw new Error("Maximum maxSharedStructure is 8160");t.structuredClone&&t.moreTypes==null&&(this.moreTypes=!0);let g=t.maxOwnStructures;g==null&&(g=p?32:64),!this.structures&&t.useRecords!=!1&&(this.structures=[]);let v=y>32||g+y>64,w=y+64,S=y+g+64;if(S>8256)throw new Error("Maximum maxSharedStructure + maxOwnStructure is 8192");let E=[],F=0,K=0;this.pack=this.encode=function(k,U){if(Q||(Q=new Ou(8192),qe=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,8192)),j=0),Wt=Q.length-10,Wt-j<2048?(Q=new Ou(Q.length),qe=Q.dataView||(Q.dataView=new DataView(Q.buffer,0,Q.length)),Wt=Q.length-10,j=0):j=j+7&2147483640,n=j,U&xj&&(j+=U&255),c=d.structuredClone?new Map:null,d.bundleStrings&&typeof k!="string"?(it=[],it.size=1/0):it=null,i=d.structures,i){i.uninitialized&&(i=d._mergeStructures(d.getStructures()));let J=i.sharedLength||0;if(J>y)throw new Error("Shared structures is larger than maximum shared structures, try increasing maxSharedStructures to "+i.sharedLength);if(!i.transitions){i.transitions=Object.create(null);for(let B=0;B<J;B++){let X=i[B];if(!X)continue;let re,te=i.transitions;for(let I=0,Z=X.length;I<Z;I++){let pe=X[I];re=te[pe],re||(re=te[pe]=Object.create(null)),te=re}te[Zo]=B+64}this.lastNamedStructuresLength=J}h||(i.nextId=J+64)}o&&(o=!1);let V;try{d.randomAccessStructure&&!d.readOnlyStructures&&k&&typeof k=="object"?k.constructor===Object?H(k):k.constructor!==Map&&!Array.isArray(k)&&!op.some(B=>k instanceof B)?H(k.toJSON?k.toJSON():k):C(k):C(k);let J=it;if(it&&Gx(n,C,0),c&&c.idsToInsert){let B=c.idsToInsert.sort((I,Z)=>I.offset>Z.offset?1:-1),X=B.length,re=-1;for(;J&&X>0;){let I=B[--X].offset+n;I<J.stringsPosition+n&&re===-1&&(re=0),I>J.position+n?re>=0&&(re+=6):(re>=0&&(qe.setUint32(J.position+n,qe.getUint32(J.position+n)+re),re=-1),J=J.previous,X++)}re>=0&&J&&qe.setUint32(J.position+n,qe.getUint32(J.position+n)+re),j+=B.length*6,j>Wt&&q(j),d.offset=j;let te=gj(Q.subarray(n,j),B);return c=null,te}return d.offset=j,U&vj?(Q.start=n,Q.end=j,Q):Q.subarray(n,j)}catch(J){throw V=J,J}finally{if(i&&(_(),o&&d.saveStructures)){let J=i.sharedLength||0,B=Q.subarray(n,j),X=yj(i,d);if(!V)return d.saveStructures(X,X.isCompatible)===!1?(i.uninitialized=!0,d.pack(k,U)):(d.lastNamedStructuresLength=J,Q.length>1073741824&&(Q=null),B)}Q.length>1073741824&&(Q=null),U&Sj&&(j=n)}};const _=()=>{K<10&&K++;let k=i.sharedLength||0;if(i.length>k&&!h&&(i.length=k),F>1e4)i.transitions=null,K=0,F=0,E.length>0&&(E=[]);else if(E.length>0&&!h){for(let U=0,V=E.length;U<V;U++)E[U][Zo]=0;E=[]}},L=k=>{var U=k.length;U<16?Q[j++]=144|U:U<65536?(Q[j++]=220,Q[j++]=U>>8,Q[j++]=U&255):(Q[j++]=221,qe.setUint32(j,U),j+=4);for(let V=0;V<U;V++)C(k[V])},C=k=>{j>Wt&&(Q=q(j));var U=typeof k,V;if(U==="string"){let J=k.length;if(it&&J>=4&&J<4096){if((it.size+=J)>hj){let te,I=(it[0]?it[0].length*3+it[1].length:0)+10;j+I>Wt&&(Q=q(j+I));let Z;it.position?(Z=it,Q[j]=200,j+=3,Q[j++]=98,te=j-n,j+=4,Gx(n,C,0),qe.setUint16(te+n-3,j-n-te)):(Q[j++]=214,Q[j++]=98,te=j-n,j+=4),it=["",""],it.previous=Z,it.size=0,it.position=te}let re=mj.test(k);it[re?0:1]+=k,Q[j++]=193,C(re?-J:J);return}let B;J<32?B=1:J<256?B=2:J<65536?B=3:B=5;let X=J*3;if(j+X>Wt&&(Q=q(j+X)),J<64||!l){let re,te,I,Z=j+B;for(re=0;re<J;re++)te=k.charCodeAt(re),te<128?Q[Z++]=te:te<2048?(Q[Z++]=te>>6|192,Q[Z++]=te&63|128):(te&64512)===55296&&((I=k.charCodeAt(re+1))&64512)===56320?(te=65536+((te&1023)<<10)+(I&1023),re++,Q[Z++]=te>>18|240,Q[Z++]=te>>12&63|128,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128):(Q[Z++]=te>>12|224,Q[Z++]=te>>6&63|128,Q[Z++]=te&63|128);V=Z-j-B}else V=l(k,j+B);V<32?Q[j++]=160|V:V<256?(B<2&&Q.copyWithin(j+2,j+1,j+1+V),Q[j++]=217,Q[j++]=V):V<65536?(B<3&&Q.copyWithin(j+3,j+2,j+2+V),Q[j++]=218,Q[j++]=V>>8,Q[j++]=V&255):(B<5&&Q.copyWithin(j+5,j+3,j+3+V),Q[j++]=219,qe.setUint32(j,V),j+=4),j+=V}else if(U==="number")if(k>>>0===k)k<32||k<128&&this.useRecords===!1||k<64&&!this.randomAccessStructure?Q[j++]=k:k<256?(Q[j++]=204,Q[j++]=k):k<65536?(Q[j++]=205,Q[j++]=k>>8,Q[j++]=k&255):(Q[j++]=206,qe.setUint32(j,k),j+=4);else if(k>>0===k)k>=-32?Q[j++]=256+k:k>=-128?(Q[j++]=208,Q[j++]=k+256):k>=-32768?(Q[j++]=209,qe.setInt16(j,k),j+=2):(Q[j++]=210,qe.setInt32(j,k),j+=4);else{let J;if((J=this.useFloat32)>0&&k<4294967296&&k>=-2147483648){Q[j++]=202,qe.setFloat32(j,k);let B;if(J<4||(B=k*Vg[(Q[j]&127)<<1|Q[j+1]>>7])>>0===B){j+=4;return}else j--}Q[j++]=203,qe.setFloat64(j,k),j+=8}else if(U==="object"||U==="function")if(!k)Q[j++]=192;else{if(c){let B=c.get(k);if(B){if(!B.id){let X=c.idsToInsert||(c.idsToInsert=[]);B.id=X.push(B)}Q[j++]=214,Q[j++]=112,qe.setUint32(j,B.id),j+=4;return}else c.set(k,{offset:j-n})}let J=k.constructor;if(J===Object)T(k);else if(J===Array)L(k);else if(J===Map)if(this.mapAsEmptyObject)Q[j++]=128;else{V=k.size,V<16?Q[j++]=128|V:V<65536?(Q[j++]=222,Q[j++]=V>>8,Q[j++]=V&255):(Q[j++]=223,qe.setUint32(j,V),j+=4);for(let[B,X]of k)C(B),C(X)}else{for(let B=0,X=sp.length;B<X;B++){let re=op[B];if(k instanceof re){let te=sp[B];if(te.write){te.type&&(Q[j++]=212,Q[j++]=te.type,Q[j++]=0);let le=te.write.call(this,k);le===k?Array.isArray(k)?L(k):T(k):C(le);return}let I=Q,Z=qe,pe=j;Q=null;let me;try{me=te.pack.call(this,k,le=>(Q=I,I=null,j+=le,j>Wt&&q(j),{target:Q,targetView:qe,position:j-le}),C)}finally{I&&(Q=I,qe=Z,j=pe,Wt=Q.length-10)}me&&(me.length+j>Wt&&q(me.length+j),j=Jx(me,Q,j,te.type));return}}if(Array.isArray(k))L(k);else{if(k.toJSON){const B=k.toJSON();if(B!==k)return C(B)}if(U==="function")return C(this.writeFunction&&this.writeFunction(k));T(k)}}}else if(U==="boolean")Q[j++]=k?195:194;else if(U==="bigint"){if(k<9223372036854776e3&&k>=-9223372036854776e3)Q[j++]=211,qe.setBigInt64(j,k);else if(k<18446744073709552e3&&k>0)Q[j++]=207,qe.setBigUint64(j,k);else if(this.largeBigIntToFloat)Q[j++]=203,qe.setFloat64(j,Number(k));else{if(this.largeBigIntToString)return C(k.toString());if(this.useBigIntExtension||this.moreTypes){let J=k<0?BigInt(-1):BigInt(0),B;if(k>>BigInt(65536)===J){let X=BigInt(18446744073709552e3)-BigInt(1),re=[];for(;re.push(k&X),k>>BigInt(63)!==J;)k>>=BigInt(64);B=new Uint8Array(new BigUint64Array(re).buffer),B.reverse()}else{let X=k<0,re=(X?~k:k).toString(16);if(re.length%2?re="0"+re:parseInt(re.charAt(0),16)>=8&&(re="00"+re),Si)B=Buffer.from(re,"hex");else{B=new Uint8Array(re.length/2);for(let te=0;te<B.length;te++)B[te]=parseInt(re.slice(te*2,te*2+2),16)}if(X)for(let te=0;te<B.length;te++)B[te]=~B[te]}B.length+j>Wt&&q(B.length+j),j=Jx(B,Q,j,66);return}else throw new RangeError(k+" was too large to fit in MessagePack 64-bit integer format, use useBigIntExtension, or set largeBigIntToFloat to convert to float-64, or set largeBigIntToString to convert to string")}j+=8}else if(U==="undefined")this.encodeUndefinedAsNil?Q[j++]=192:(Q[j++]=212,Q[j++]=0,Q[j++]=0);else throw new Error("Unknown type: "+U)},D=this.variableMapSize||this.coercibleKeyAsNumber||this.skipValues?k=>{let U;if(this.skipValues){U=[];for(let B in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(B))&&!this.skipValues.includes(k[B])&&U.push(B)}else U=Object.keys(k);let V=U.length;V<16?Q[j++]=128|V:V<65536?(Q[j++]=222,Q[j++]=V>>8,Q[j++]=V&255):(Q[j++]=223,qe.setUint32(j,V),j+=4);let J;if(this.coercibleKeyAsNumber)for(let B=0;B<V;B++){J=U[B];let X=Number(J);C(isNaN(X)?J:X),C(k[J])}else for(let B=0;B<V;B++)C(J=U[B]),C(k[J])}:k=>{Q[j++]=222;let U=j-n;j+=2;let V=0;for(let J in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(J))&&(C(J),C(k[J]),V++);if(V>65535)throw new Error('Object is too large to serialize with fast 16-bit map size, use the "variableMapSize" option to serialize this object');Q[U+++n]=V>>8,Q[U+n]=V&255},$=this.useRecords===!1?D:t.progressiveRecords&&!v?k=>{let U,V=i.transitions||(i.transitions=Object.create(null)),J=j++-n,B;for(let X in k)if(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X)){if(U=V[X],U)V=U;else{let re=Object.keys(k),te=V;V=i.transitions;let I=0;for(let Z=0,pe=re.length;Z<pe;Z++){let me=re[Z];U=V[me],U||(U=V[me]=Object.create(null),I++),V=U}J+n+1==j?(j--,ee(V,re,I)):ne(V,re,J,I),B=!0,V=te[X]}C(k[X])}if(!B){let X=V[Zo];X?Q[J+n]=X:ne(V,Object.keys(k),J,0)}}:k=>{let U,V=i.transitions||(i.transitions=Object.create(null)),J=0;for(let X in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X))&&(U=V[X],U||(U=V[X]=Object.create(null),J++),V=U);let B=V[Zo];B?B>=96&&v?(Q[j++]=((B-=96)&31)+96,Q[j++]=B>>5):Q[j++]=B:ee(V,V.__keys__||Object.keys(k),J);for(let X in k)(typeof k.hasOwnProperty!="function"||k.hasOwnProperty(X))&&C(k[X])},N=typeof this.useRecords=="function"&&this.useRecords,T=N?k=>{N(k)?$(k):D(k)}:$,q=k=>{let U;if(k>16777216){if(k-n>Qx)throw new Error("Packed buffer would be larger than maximum buffer size");U=Math.min(Qx,Math.round(Math.max((k-n)*(k>67108864?1.25:2),4194304)/4096)*4096)}else U=(Math.max(k-n<<2,Q.length-1)>>12)+1<<12;let V=new Ou(U);return qe=V.dataView||(V.dataView=new DataView(V.buffer,0,U)),k=Math.min(k,Q.length),Q.copy?Q.copy(V,0,n,k):V.set(Q.slice(n,k)),j-=n,n=0,Wt=V.length-10,Q=V},ee=(k,U,V)=>{let J=i.nextId;J||(J=64),J<w&&this.shouldShareStructure&&!this.shouldShareStructure(U)?(J=i.nextOwnId,J<S||(J=w),i.nextOwnId=J+1):(J>=S&&(J=w),i.nextId=J+1);let B=U.highByte=J>=96&&v?J-96>>5:-1;k[Zo]=J,k.__keys__=U,i[J-64]=U,J<w?(U.isShared=!0,i.sharedLength=J-63,o=!0,B>=0?(Q[j++]=(J&31)+96,Q[j++]=B):Q[j++]=J):(B>=0?(Q[j++]=213,Q[j++]=114,Q[j++]=(J&31)+96,Q[j++]=B):(Q[j++]=212,Q[j++]=114,Q[j++]=J),V&&(F+=K*V),E.length>=g&&(E.shift()[Zo]=0),E.push(k),C(U))},ne=(k,U,V,J)=>{let B=Q,X=j,re=Wt,te=n;Q=va,j=0,n=0,Q||(va=Q=new Ou(8192)),Wt=Q.length-10,ee(k,U,J),va=Q;let I=j;if(Q=B,j=X,Wt=re,n=te,I>1){let Z=j+I-1;Z>Wt&&q(Z);let pe=V+n;Q.copyWithin(pe+I,pe+1,j),Q.set(va.slice(0,I),pe),j=Z}else Q[V+n]=va[0]},H=k=>{let U=dj(k,Q,n,j,i,q,(V,J,B)=>{if(B)return o=!0;j=J;let X=Q;return C(V),_(),X!==Q?{position:j,targetView:qe,target:Q}:j},this);if(U===0)return T(k);j=U}}useBuffer(t){Q=t,Q.dataView||(Q.dataView=new DataView(Q.buffer,Q.byteOffset,Q.byteLength)),qe=Q.dataView,j=0}set position(t){j=t}get position(){return j}clearSharedData(){this.structures&&(this.structures=[]),this.typedStructs&&(this.typedStructs=[])}}op=[Date,Set,Error,RegExp,ArrayBuffer,Object.getPrototypeOf(Uint8Array.prototype).constructor,DataView,A_];sp=[{pack(e,t,n){let o=e.getTime()/1e3;if((this.useTimestamp32||e.getMilliseconds()===0)&&o>=0&&o<4294967296){let{target:i,targetView:c,position:l}=t(6);i[l++]=214,i[l++]=255,c.setUint32(l,o)}else if(o>0&&o<4294967296){let{target:i,targetView:c,position:l}=t(10);i[l++]=215,i[l++]=255,c.setUint32(l,e.getMilliseconds()*4e6+(o/1e3/4294967296>>0)),c.setUint32(l+4,o)}else if(isNaN(o)){if(this.onInvalidDate)return t(0),n(this.onInvalidDate());let{target:i,targetView:c,position:l}=t(3);i[l++]=212,i[l++]=255,i[l++]=255}else{let{target:i,targetView:c,position:l}=t(15);i[l++]=199,i[l++]=12,i[l++]=255,c.setUint32(l,e.getMilliseconds()*1e6),c.setBigInt64(l+4,BigInt(Math.floor(o)))}}},{pack(e,t,n){if(this.setAsEmptyObject)return t(0),n({});let o=Array.from(e),{target:i,position:c}=t(this.moreTypes?3:0);this.moreTypes&&(i[c++]=212,i[c++]=115,i[c++]=0),n(o)}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=101,o[i++]=0),n([e.name,e.message,e.cause])}},{pack(e,t,n){let{target:o,position:i}=t(this.moreTypes?3:0);this.moreTypes&&(o[i++]=212,o[i++]=120,o[i++]=0),n([e.source,e.flags])}},{pack(e,t){this.moreTypes?rm(e,16,t):sm(Si?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let n=e.constructor;n!==B_&&this.moreTypes?rm(e,$_.indexOf(n.name),t):sm(e,t)}},{pack(e,t){this.moreTypes?rm(e,17,t):sm(Si?Buffer.from(e):new Uint8Array(e),t)}},{pack(e,t){let{target:n,position:o}=t(1);n[o]=193}}];function rm(e,t,n,o){let i=e.byteLength;if(i+1<256){var{target:c,position:l}=n(4+i);c[l++]=199,c[l++]=i+1}else if(i+1<65536){var{target:c,position:l}=n(5+i);c[l++]=200,c[l++]=i+1>>8,c[l++]=i+1&255}else{var{target:c,position:l,targetView:d}=n(7+i);c[l++]=201,d.setUint32(l,i+1),l+=4}c[l++]=116,c[l++]=t,e.buffer||(e=new Uint8Array(e)),c.set(new Uint8Array(e.buffer,e.byteOffset,e.byteLength),l)}function sm(e,t){let n=e.byteLength;var o,i;if(n<256){var{target:o,position:i}=t(n+2);o[i++]=196,o[i++]=n}else if(n<65536){var{target:o,position:i}=t(n+3);o[i++]=197,o[i++]=n>>8,o[i++]=n&255}else{var{target:o,position:i,targetView:c}=t(n+5);o[i++]=198,c.setUint32(i,n),i+=4}o.set(e,i)}function Jx(e,t,n,o){let i=e.length;switch(i){case 1:t[n++]=212;break;case 2:t[n++]=213;break;case 4:t[n++]=214;break;case 8:t[n++]=215;break;case 16:t[n++]=216;break;default:i<256?(t[n++]=199,t[n++]=i):i<65536?(t[n++]=200,t[n++]=i>>8,t[n++]=i&255):(t[n++]=201,t[n++]=i>>24,t[n++]=i>>16&255,t[n++]=i>>8&255,t[n++]=i&255)}return t[n++]=o,t.set(e,n),n+=i,n}function gj(e,t){let n,o=t.length*6,i=e.length-o;for(;n=t.pop();){let c=n.offset,l=n.id;e.copyWithin(c+o,c,i),o-=6;let d=c+o;e[d++]=214,e[d++]=105,e[d++]=l>>24,e[d++]=l>>16&255,e[d++]=l>>8&255,e[d++]=l&255,i=c}return e}function Gx(e,t,n){if(it.length>0){qe.setUint32(it.position+e,j+n-it.position-e),it.stringsPosition=j-e;let o=it;it=null,t(o[0]),t(o[1])}}function yj(e,t){return e.isCompatible=n=>{let o=!n||(t.lastNamedStructuresLength||0)===n.length;return o||t._mergeStructures(n),o},e}let z_=new pj({useRecords:!1});z_.pack;z_.pack;const vj=512,Sj=1024,xj=2048;class qg extends Wn()("effect/rpc/RpcSerialization"){}const wj=qg.of({contentType:"application/json",includesFraming:!1,makeUnsafe:()=>{const e=new TextDecoder;return{decode:t=>{const n=JSON.parse(typeof t=="string"?t:e.decode(t));return Array.isArray(n)?n:[n]},encode:t=>JSON.stringify(t)}}}),kj=cg(qg)(wj),Ej=e=>Er(()=>{const t=new Set,n=new Map,o=new Map;let i=(c,l)=>dE(d=>{let h=n.get(c);return h||(h=[],n.set(c,h)),h.push([l,d]),gt});return Ms(e((c,l)=>{const d=o.get(c);return d?d(l):i(c,l)},t),c=>({...c,run(l,d){return Nm(function*(){t.add(l),o.set(l,d);const h=n.get(l);if(h){n.delete(l);for(const[p,y]of h)yield*io(Er(()=>d(p)),y)}return yield*pE(yL,()=>(t.delete(l),o.delete(l),gt))})}}))});let _j=BigInt(0);const Cj=ao(function*(e,t){const n=(t==null?void 0:t.spanPrefix)??"RpcClient",o=(t==null?void 0:t.supportsAck)??!0,i=(t==null?void 0:t.disableTracing)??!1,c=(t==null?void 0:t.generateRequestId)??(()=>_j++),l=yield*gl(),d=oo(l,qS),h=new Map;let p=!1;yield*qA(d,ml(_=>(p=!0,y(NA(_.id)))));const y=ao(function*(_){for(const[L,C]of h)h.delete(L),C._tag==="Queue"?yield*_._tag==="Success"?dx(C.queue):ka(C.queue,_.cause):C.resume(_)}),g=_=>{const L=x_(_.successSchema),C=S(_);return(D,$)=>{const N=$!=null&&$.headers?O4($.headers):jg,T=($==null?void 0:$.context)??ir();if(!L){const ee=ne=>v(_,C,ne,_.payloadSchema.make(D),N,T,($==null?void 0:$.discard)??!1);return i?ee(void 0):jL(`${n}.${_._tag}`,{attributes:t.spanAttributes},ee)}const q=w(_,C,_.payloadSchema.make(D),N,($==null?void 0:$.streamBufferSize)??16,T);return $!=null&&$.asQueue?q:LN(Ms(q,AN))}},v=(_,L,C,D,$,N,T)=>ml(q=>{if(p)return Dm;const ee=c(),ne=L(k=>t.onFromClient({message:k,context:N,discard:T}),{_tag:"Request",id:ee,tag:_._tag,payload:D,...C?{traceId:C.traceId,spanId:C.spanId,sampled:C.sampled}:{},headers:Nx(q.getRef(Xx),$)});if(T)return ne;let H;return NL(YS(k=>{const U={_tag:"Effect",rpc:_,context:N,resume(V){k(V),H&&!H.pollUnsafe()&&q.currentDispatcher.scheduleTask(()=>{H.interruptUnsafe(q.id)},0)}};h.set(ee,U),H=ne.pipe(C?ZS(C,{captureStackTrace:!1}):Ie,yl(q.context)),H.addObserver(V=>{if(V._tag==="Failure")return k(V)})}),k=>(h.delete(ee),wL(e_(H),E(ee,Array.from(k),N))))}),w=ao(function*(_,L,C,D,$,N){if(p)return yield*Dm;const T=i?void 0:yield*DL(`${n}.${_._tag}`,{attributes:t.spanAttributes}),q=Wm(),ee=c(),ne=Ql(q.context,qS);yield*VA(ne,k=>h.has(ee)?(h.delete(ee),E(ee,Yk(k)?Array.from(MA(k.cause)):[],N)):gt);const H=yield*k3($);return h.set(ee,{_tag:"Queue",rpc:_,queue:H,scope:ne,context:N}),yield*L(k=>t.onFromClient({message:k,context:N,discard:!1}),{_tag:"Request",id:ee,tag:_._tag,payload:C,...T?{traceId:T.traceId,spanId:T.spanId,sampled:T.sampled}:{},headers:Nx(q.getRef(Xx),D)}).pipe(T?ZS(T,{captureStackTrace:!1}):Ie,pl(k=>ka(H,k)),fg,$L(ne,{startImmediately:!0})),H}),S=_=>{const L=[];for(const C of _.middlewares.values()){const D=l.mapUnsafe.get(`${C.key}/Client`);D&&L.push(D)}return L.length===0?(C,D)=>C(D):function C(D,$,N=L.length-1){return N===-1?D($):L[N]({rpc:_,request:$,next(T){return C(D,T,N-1)}})}},E=(_,L,C)=>YS(D=>{const $=Wm();t.onFromClient({message:{_tag:"Interrupt",requestId:_,interruptors:L},context:C,discard:!1}).pipe(PL(1e3),yl($.context)).addObserver(()=>{D(gt)})}),F=_=>{switch(_._tag){case"Chunk":{const L=_.requestId,C=h.get(L);return!C||C._tag!=="Queue"?gt:E3(C.queue,_.values).pipe(o?Rn(()=>t.onFromClient({message:{_tag:"Ack",requestId:_.requestId},context:C.context,discard:!1})):Ie,pl(D=>ka(C.queue,D)))}case"Exit":{const L=_.requestId,C=h.get(L);return C?(h.delete(L),C._tag==="Effect"?(C.resume(_.exit),gt):_.exit._tag==="Success"?dx(C.queue):ka(C.queue,_.exit.cause)):gt}case"Defect":return y(OA(_.defect));case"ClientEnd":return gt}};let K;if(t.flatten){const _=new Map;K=function(C,D,$){let N=_.get(C);return N||(N=g(e.requests.get(C)),_.set(C,N)),N(D,$)}}else K={},e.requests.forEach(_=>{K[_._tag]=g(_)});return{client:K,write:F}});let bj=0;const Pj=ao(function*(e,t){const n=bj++,{run:o,send:i,supportsAck:c,supportsTransferables:l}=yield*xf,d=new Map,{client:h,write:p}=yield*Cj(e,{...t,supportsAck:c,onFromClient({message:y}){switch(y._tag){case"Request":{const g=e.requests.get(y.tag),v=l?Y4():void 0,w=Wm(),S={rpc:g,context:v?Rs(w.context,M_,v):w.context,schemas:Fj(g)};return d.set(y.id,S),S.schemas.encodePayload(y.payload).pipe(io(S.context),Hu,Rn(E=>i(n,{...y,id:String(y.id),payload:E,headers:Object.entries(y.headers)},v&&v.readUnsafe())))}case"Ack":return d.get(y.requestId)?i(n,{_tag:"Ack",requestId:String(y.requestId)}):gt;case"Interrupt":return d.get(y.requestId)?(d.delete(y.requestId),i(n,{_tag:"Interrupt",requestId:String(y.requestId)})):gt;case"Eof":return gt}}});return yield*o(n,y=>{switch(y._tag){case"Chunk":{const g=Au(y.requestId),v=d.get(g);return!v||vo(v.schemas.decodeChunk)?gt:v.schemas.decodeChunk.value(y.values).pipe(io(v.context),Hu,Rn(w=>p({_tag:"Chunk",clientId:0,requestId:Au(y.requestId),values:w})),OL(w=>p({_tag:"Exit",clientId:0,requestId:Au(y.requestId),exit:ba(w)})))}case"Exit":{const g=Au(y.requestId),v=d.get(g);return v?(d.delete(g),v.schemas.decodeExit(y.exit).pipe(io(v.context),Hu,IL({onSuccess:w=>p({_tag:"Exit",clientId:0,requestId:g,exit:w}),onFailure:w=>p({_tag:"Exit",clientId:0,requestId:g,exit:ba(w)})}))):gt}case"Defect":return p({_tag:"Defect",clientId:0,defect:Mj(y.defect)});case"ClientProtocolError":{const g=ic(y.error);return cE(d.keys(),v=>p({_tag:"Exit",clientId:0,requestId:v,exit:g}))}default:return gt}}).pipe(pl(KL),fg,dg),h}),Yx=new WeakMap,Fj=e=>{let t=Yx.get(e);if(t!==void 0)return t;const n=w_(e.successSchema);return t={decodeChunk:Dp(n,o=>mx(qh(aN(o.success)))),encodePayload:rN(qh(e.payloadSchema)),decodeExit:mx(qh(GN(e)))},Yx.set(e,t),t},Xx=rt("effect/rpc/RpcClient/CurrentHeaders",{defaultValue:()=>jg});class xf extends Wn()("effect/rpc/RpcClient/Protocol"){}A(xf,"make",Ej);const Ij=e=>xf.make(ao(function*(t,n){const o=yield*Ug,i=yield*qg,c=yield*TL(ip),l=new Map,d=yield*o.writer;let h=i.makeUnsafe();const p=yield*Tj(d(h.encode(rj)));let y;const g=Er(()=>(y=void 0,_s(c)?c.value.onConnect:gt)),v=w=>cE(n,S=>t(S,w));return yield*Er(()=>(h=i.makeUnsafe(),p.reset(),o.runRaw(w=>{try{const S=h.decode(w);if(S.length===0)return;let E=0;return uE({while:()=>E<S.length,body:()=>{const F=S[E++];if(F._tag==="Pong")return p.onPong(),gt;if("requestId"in F){const K=l.get(F.requestId);if(K!==void 0)return F._tag==="Exit"&&l.delete(F.requestId),t(K,F)}return v(F)},step:Ya})}catch(S){return v({_tag:"ClientProtocolError",error:new ep({reason:new Zm({message:"Error decoding message",cause:S})})})}},{onOpen:g}).pipe(fE(Rn(p.timeout,()=>Ge(new ci({reason:new Il({kind:"Timeout",cause:new Error("ping timeout")})}))))))).pipe(Rn(()=>Ge(new ci({reason:new Rl({code:1e3})}))),_s(c)?mE(c.value.onDisconnect):Ie,_L(w=>{const S=oc(w),E=uR(S);return y=new ep({reason:E?S.success.reason:new Zm({message:"Unknown socket error",cause:Qk(w)})}),v({_tag:"ClientProtocolError",error:y})}),CL((e==null?void 0:e.retryPolicy)??Rj),QL({module:"RpcClient",method:"makeProtocolSocket"}),dg),{send(w,S){if(y)return Ge(y);S._tag==="Request"&&l.set(S.id,w);const E=h.encode(S);return E===void 0?gt:Hu(d(E))},supportsAck:!0,supportsTransferables:!1}})),Rj=aL(500,1.5).pipe(oL(iE(5e3))),Tj=ao(function*(e){let t=!0;const n=t_(),o=()=>{t=!0,n.closeUnsafe()},i=()=>{t=!0};return yield*Er(()=>t?(t=!1,e):n.open).pipe(FL("5 seconds"),bL,gE,fg,dg),{timeout:n.await,reset:o,onPong:i}});class ip extends Wn()("effect/rpc/RpcClient/ConnectionHooks"){}const Mj=tN(lr);class V_ extends Error{constructor(t="daemon RPC connection closed"){super(t),this.name="DaemonRpcConnectionError"}}class Aj extends Error{constructor(t,n){super(`${t} timed out after ${n}ms`),this.method=t,this.timeoutMs=n,this.name="DaemonRpcRequestTimeoutError"}}class Nu extends Wn()("tokmon/client/DaemonRpcClient/TokmonRpcClient"){}const Lj=new Function("specifier","return import(specifier)");function Zx(){let e=!1,t;return{promise:new Promise(o=>{t=o}),resolve:o=>{e||(e=!0,t(o))}}}function Oj(e){const t=typeof window>"u"?void 0:window.location.origin,n=new URL(e,t);if(n.protocol==="http:"?n.protocol="ws:":n.protocol==="https:"&&(n.protocol="wss:"),n.protocol!=="ws:"&&n.protocol!=="wss:")throw new Error(`unsupported daemon RPC protocol: ${n.protocol}`);return n.hash="",n.searchParams.delete("tokmonToken"),n.searchParams.delete("wsToken"),n.pathname=tD,n.toString()}function Nj(e){return e==="node"?!0:e==="browser"?!1:typeof window>"u"}async function Dj(e,t,n){const o={openTimeout:$a(n)};return Nj(t)?(await Lj("@effect/platform-node/NodeSocket")).layerWebSocket(e,o):G4(e,o).pipe(Om(K4))}function Zu(e){return{protocol:{version:e.protocol.version,capabilities:[...e.protocol.capabilities]},config:JF(e.config)}}function jj(e){const t=o=>o?{...o,activeAccountIds:[...o.activeAccountIds],factors:o.factors.map(i=>({...i}))}:void 0,n=o=>o.map(i=>({...i,models:[...i.models],breakdown:i.breakdown.map(c=>({...c}))}));return{...e,providers:e.providers.map(o=>({...o,headroom:t(o.headroom)})),accounts:e.accounts.map(o=>{var i;return{...o,identity:o.identity?{...o.identity}:void 0,quotas:(i=o.quotas)==null?void 0:i.map(c=>({...c})),headroom:t(o.headroom),dashboard:o.dashboard?{...o.dashboard,today:{...o.dashboard.today},week:{...o.dashboard.week},month:{...o.dashboard.month},series:[...o.dashboard.series]}:null,table:o.table?{daily:n(o.table.daily),weekly:n(o.table.weekly),monthly:n(o.table.monthly)}:null,billing:o.billing?{...o.billing,metrics:o.billing.metrics.map(c=>({...c,format:{...c.format}})),activity:o.billing.activity?{...o.billing.activity,series:[...o.billing.activity.series]}:o.billing.activity,modelSpend:o.billing.modelSpend==null?o.billing.modelSpend:o.billing.modelSpend.map(c=>({...c}))}:null,summaryUpdatedAt:o.summaryUpdatedAt??null,billingUpdatedAt:o.billingUpdatedAt??null,tableUpdatedAt:o.tableUpdatedAt??null}}),peak:e.peak?{...e.peak}:null}}function $j(e){if(!e||typeof e!="object"||e.kind!=="conflict")return e;const t=e.state;if(!t)return e;const n=Zu(t);return e instanceof Ym?new Ym({kind:"conflict",state:n}):{...e,state:n}}function Uj(e){return e instanceof ep||eN(e)}async function Bj(e,t,n){let o=null;try{await Promise.race([e.promise,t.promise.then(i=>Promise.reject(i)),new Promise((i,c)=>{var l;o=setTimeout(()=>c(new V_(`daemon RPC connection timed out after ${n}ms`)),n),(l=o.unref)==null||l.call(o)})])}finally{o&&clearTimeout(o)}}function zj(e,t={}){const n=Oj(e),o=Math.max(1,t.requestTimeoutMs??3e4),i=Math.max(1,t.reconnectBaseDelayMs??250),c=new Set;let l=null,d=null,h=null,p=null,y=null,g=0,v=!1,w=!1;const S=H=>{if(t.onSubscriberError){try{t.onSubscriberError(H)}catch(k){console.error("[tokmon] daemon RPC subscriber error reporter failed",k)}return}console.error("[tokmon] daemon RPC subscriber failed",H)},E=(H,k)=>{var U;try{(U=t.onConn)==null||U.call(t,H,k)}catch(V){S(V)}},F=()=>{y&&(clearTimeout(y),y=null)},K=H=>{const k=H.fiber;return H.fiber=null,H.owner=null,k?Ku(e_(k)).catch(()=>{}):Promise.resolve()},_=H=>(H.active=!1,c.delete(H),H.watchdogTimer&&(clearInterval(H.watchdogTimer),H.watchdogTimer=null),K(H)),L=()=>{var k;if(w||c.size===0||y||l||d||typeof t.reconnectAttempts=="number"&&g>=t.reconnectAttempts)return;const H=Math.min(2500,i*1.5**g);y=setTimeout(()=>{y=null,g++,ee()},H),(k=y.unref)==null||k.call(y)},C=(H,k,U)=>{H.invalidated||(H.invalidated=!0,l===H&&(l=null),H.runtime.dispose().catch(()=>{}),w||E(k,U),L())},D=async(H,k)=>{const U=await Dj(n,t.transport,o),V=cg(ip,ip.of({onConnect:Bn(()=>{H.resolve()}),onDisconnect:Bn(()=>{k.resolve(new V_)})}));return Am(xf,Ij({retryPolicy:cL(0)})).pipe(Om(tE(U,kj,V)))},$=async()=>{if(w)throw new Error("daemon RPC client is closed");if(l)return l;if(d)return d;E(v?"reconnecting":"connecting");const H=(async()=>{let k=null;try{const U=Zx(),V=Zx(),J=await D(U,V),B=Am(Nu,Pj(ND)).pipe(Om(J));if(k=HN(B),h=k,await k.runPromise(Nu.asEffect()),await Bj(U,V,o),w)throw new Error("daemon RPC client is closed");const X={runtime:k,disconnected:V.promise,invalidated:!1};return l=X,h=null,v=!0,g=0,E("live"),X.disconnected.then(re=>{C(X,"reconnecting",re)}),q(X),X}catch(U){throw h===k&&(h=null),await(k==null?void 0:k.dispose().catch(()=>{})),w||E("error",U),U}})();d=H;try{return await H}finally{d===H&&(d=null)}},N=async(H,k)=>{const U=await $();try{return await U.runtime.runPromise(Nu.use(V=>k(V)).pipe(lE({duration:$a(o),orElse:()=>Ge(new Aj(H,o))})))}catch(V){const J=$j(V);throw!w&&Uj(J)&&C(U,"error",J),J}},T=(H,k)=>{if(w||!H.active||H.fiber||k.invalidated)return;H.lastValueAt=Date.now(),H.staleAfterMs=t.snapshotStaleFloorMs??9e4,H.owner=k;const U=k.runtime.runFork(Nu.use(V=>H.streamFor(V).pipe(NN(J=>Bn(()=>{H.lastValueAt=Date.now(),H.staleAfterFor&&(H.staleAfterMs=H.staleAfterFor(J));try{H.onValue(J)}catch(B){S(B)}})))));H.fiber=U,U.addObserver(V=>{H.fiber===U&&(H.fiber=null),H.owner===k&&(H.owner=null),!(w||!H.active||k.invalidated)&&(Gk(V)?C(k,"reconnecting"):C(k,"error",Qk(V.cause)))})},q=H=>{for(const k of c)T(k,H)};function ee(){w||c.size===0||p||(p=$().then(()=>{}).catch(()=>{L()}).finally(()=>{p=null}))}const ne=(H,k,U)=>{var J,B;if(w)return()=>{};const V={streamFor:H,onValue:k,staleAfterFor:U,active:!0,fiber:null,owner:null,watchdogTimer:null,lastValueAt:0,staleAfterMs:Number.POSITIVE_INFINITY};if(c.add(V),U){const X=Math.min(5e3,Math.max(10,(t.snapshotStaleFloorMs??9e4)/2));V.watchdogTimer=setInterval(()=>{!V.fiber||!V.owner||V.lastValueAt===0||Date.now()-V.lastValueAt<=V.staleAfterMs||(V.lastValueAt=Date.now(),C(V.owner,"reconnecting"))},X),(B=(J=V.watchdogTimer).unref)==null||B.call(J)}return l?T(V,l):ee(),()=>{_(V),c.size===0&&F()}};return{getConfig:()=>N(Ht.getConfig,H=>H[Ht.getConfig]({})).then(Zu),setConfig:H=>N(Ht.setConfig,k=>k[Ht.setConfig](H)).then(Zu),refresh:(H="all")=>N(Ht.refresh,k=>k[Ht.refresh]({scope:H})),browseFs:H=>N(Ht.browseFs,k=>k[Ht.browseFs]({path:H})),subscribeSnapshot:H=>ne(k=>k[Ht.snapshot]({}).pipe(xx(jj)),H,k=>Math.max(t.snapshotStaleFloorMs??9e4,k.intervalMs*3)),subscribeConfig:H=>ne(k=>k[Ht.config]({}).pipe(xx(Zu)),H),async close(){if(w)return;w=!0,E("closed"),F();const H=[...c].map(_);c.clear();const k=l;l=null,await(h==null?void 0:h.dispose().catch(()=>{})),await Promise.all(H),await(k==null?void 0:k.runtime.dispose().catch(()=>{})),await(d==null?void 0:d.catch(()=>{})),h=null,d=null,p=null}}}let om=null;const ap=new Set;function Vj(e,t,n){const o=new URLSearchParams(t);o.delete("tokmonToken");let i=n.replace(/^#/,"");if(!i.startsWith("/"))i=new URLSearchParams(i).has("tokmonToken")?"/":i;else{const d=i.indexOf("#");if(d!==-1){const p=new URLSearchParams(i.slice(d+1));p.has("tokmonToken")&&(p.delete("tokmonToken"),i=`${i.slice(0,d)}${p.size?`#${p.toString()}`:""}`)}const h=i.indexOf("?");if(h!==-1){const p=new URLSearchParams(i.slice(h+1));p.delete("tokmonToken"),i=`${i.slice(0,h)}${p.size?`?${p.toString()}`:""}`}}const c=o.size?`?${o.toString()}`:"",l=i?`#${i}`:"";return`${e}${c}${l}`}if(typeof window<"u"){const e=`${window.location.pathname}${window.location.search}${window.location.hash}`,t=Vj(window.location.pathname,window.location.search,window.location.hash);t!==e&&window.history.replaceState(window.history.state,"",t)}function qj(e){for(const t of ap)t(e)}function Wj(e){e!=="closed"&&qj(e)}function As(){return om||(om=zj(window.location.origin,{transport:"browser",onConn:Wj})),om}function Hj(e){return ap.add(e),()=>{ap.delete(e)}}function Kj(){const[e,t]=Y.useState(null),[n,o]=Y.useState("connecting"),i=Y.useRef(null);return Y.useEffect(()=>{let c=!1,l=null;const d=As();return l=Hj(h=>{c||o(h)}),i.current=d.subscribeSnapshot(h=>{c||(t(h),o("live"))}),()=>{var h;c=!0,l==null||l(),(h=i.current)==null||h.call(i),i.current=null}},[]),{snapshot:e,conn:n}}function Cs(e){return{...e,config:m1(e.config).config}}async function Qj(){return Cs(await As().getConfig())}async function cp(e,t,n=As()){return Cs(await n.setConfig({config:e,expectedRevision:t}))}async function Jj(e,t=As()){const n=Cs(e),o=!n.config.privacyMode;try{return await cp({...n.config,privacyMode:o},n.config.revision,t)}catch(i){const c=_p(i).conflictState;if(!c)throw i;const l=Cs(c);return l.config.privacyMode===o?l:cp({...l.config,privacyMode:o},l.config.revision,t)}}async function Gj(e,t,n=As()){const o=Cs(e),i=c=>cp({...c.config,appearance:{...c.config.appearance,mode:t}},c.config.revision,n);try{return await i(o)}catch(c){const l=_p(c).conflictState;if(!l)throw c;const d=Cs(l);return d.config.appearance.mode===t?d:i(d)}}function Yj(e){const t=_p(e).conflictState;return t?Cs(t):null}async function T6(e){return As().browseFs(e)}function q_(e){return As().subscribeConfig(t=>{e(Cs(t))})}async function Xj(){return As().refresh("all")}function Zj(e){if(e.key.toLowerCase()!=="r"||e.metaKey||e.ctrlKey||e.altKey)return!1;const t=e.target;return t?t.isContentEditable?!1:!t.tagName||!["INPUT","TEXTAREA","SELECT"].includes(t.tagName):!0}const e$="tokmon-theme-cache-v1",t$=1,n$={canvas:"--color-bg-0",panel:"--color-bg-1",inset:"--color-bg-2",insetStrong:"--color-bg-3",line:"--color-line",lineStrong:"--color-line-2",lineFaint:"--color-line-faint",text:"--color-fg",textDim:"--color-fg-dim",textFaint:"--color-fg-faint",textStrong:"--color-fg-bright",accent:"--color-accent",cost:"--color-cost",positive:"--color-positive",ok:"--color-ok",warn:"--color-warning",crit:"--color-critical",unknown:"--color-unknown",card:"--color-card",cardHover:"--color-card-hover",divider:"--color-divider",track:"--color-track",accentTint:"--color-accent-tint",accentOn:"--color-accent-on",focusRing:"--color-focus-ring"};function r$(e,t){const n=f1(e,t?"dark":"light");return{appearance:e,...n}}function W_(e){return Object.fromEntries(Object.entries(n$).map(([t,n])=>[n,e[t]]))}function s$(e,t){e.classList.toggle("light",t.mode==="light"),e.classList.toggle("dark",t.mode==="dark"),e.dataset.themeMode=t.mode,e.dataset.themePreset=t.appearance.preset;for(const[n,o]of Object.entries(W_(t.tokens)))e.style.setProperty(n,o)}function o$(e){return JSON.stringify({version:t$,mode:e.mode,preset:e.appearance.preset,vars:W_(e.tokens)})}function i$(e,t){var n,o;document.documentElement.style.colorScheme=e,(n=document.querySelector('meta[name="color-scheme"]'))==null||n.setAttribute("content",e),(o=document.querySelector('meta[name="theme-color"]'))==null||o.setAttribute("content",t)}function a$(e){try{localStorage.setItem(e$,o$(e))}catch{}}function c$(e){return e==="auto"?"light":e==="light"?"dark":"auto"}function M6(e){return e.preset!=="custom"||!e.custom?[]:["light","dark"].flatMap(t=>{var d;const n=((d=e.custom)==null?void 0:d[t])??{},i=Object.entries(n).filter(h=>nr(h[1])===null).map(([h])=>({mode:t,keys:[h],message:"Use #RRGGBB."})),c=Object.fromEntries(Object.entries(n).filter(([,h])=>nr(h)!==null)),l=f1({...e,preset:"custom",mode:t,custom:{base:e.custom.base,light:{},dark:{}}},t).tokens;for(const h of u1({...l,...c}))i.push({mode:t,keys:[h.foreground,h.background],message:`${h.foreground} needs ${h.minimum}:1 contrast on ${h.background}.`});return i})}const H_=Y.createContext(null);function u$(e){const t=window.matchMedia("(prefers-color-scheme: dark)"),n=o=>e(o.matches);return t.addEventListener("change",n),e(t.matches),()=>t.removeEventListener("change",n)}function l$({children:e}){const[t,n]=Y.useState(null),[o,i]=Y.useState(null),[c,l]=Y.useState(()=>window.matchMedia("(prefers-color-scheme: dark)").matches),d=Y.useRef(null),h=Y.useCallback(w=>{d.current=w,n(w)},[]);Y.useEffect(()=>u$(l),[]),Y.useEffect(()=>{let w=!0;Qj().then(E=>{w&&h(E)}).catch(()=>{});const S=q_(E=>{w&&h(E)});return()=>{w=!1,S()}},[h]);const p=o??(t==null?void 0:t.config.appearance)??ii,y=Y.useMemo(()=>r$(p,c),[p,c]);Y.useEffect(()=>{!t&&!o||(s$(document.documentElement,y),i$(y.mode,y.tokens.canvas),o||a$(y))},[o,y,t]);const g=Y.useCallback(async()=>{const w=d.current;if(!w)return;const S=c$(w.config.appearance.mode);try{h(await Gj(w,S))}catch{}},[h]),v=Y.useMemo(()=>({appearance:p,resolved:y,ready:t!==null,setPreview:i,commit:w=>{i(null),h(w)},toggleMode:g}),[h,p,y,t,g]);return P.jsx(H_.Provider,{value:v,children:e})}function f$(){const e=Y.useContext(H_);if(!e)throw new Error("useTheme must be used inside ThemeProvider");return e}const ew=[100,86,72,58,46,92,78,64,52,82,68,56];function up(e){return`color-mix(in oklab, var(--color-accent) ${ew[e%ew.length]}%, var(--color-fg-dim))`}function K_(e){return e==="phosphor"}function A6(e,t,n){return K_(e)?up(t):n}function d$(e,t){return K_(t.preset)?{...e,byProvider:e.byProvider.map((n,o)=>({...n,color:up(o)})),byModel:e.byModel.map((n,o)=>({...n,color:up(o)}))}:e}const Q_=()=>Promise.all([Sr(()=>import("./overview-DC-WVKZ6.js"),__vite__mapDeps([4,5]),import.meta.url),Sr(()=>import("./timeline-ar9mdhcb.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),J_=()=>Promise.all([Sr(()=>import("./analytics-CdjcYtmK.js"),__vite__mapDeps([7,5]),import.meta.url),Sr(()=>import("./breakdown-DM6g0evr.js"),__vite__mapDeps([8,2,5]),import.meta.url),Sr(()=>import("./timeline-ar9mdhcb.js"),__vite__mapDeps([6,2,5,3]),import.meta.url)]).then(([e])=>e),G_=()=>Promise.all([Sr(()=>import("./models-XKfoWTDv.js"),__vite__mapDeps([9,5]),import.meta.url),Sr(()=>import("./breakdown-DM6g0evr.js"),__vite__mapDeps([8,2,5]),import.meta.url)]).then(([e])=>e),Y_=()=>Sr(()=>import("./explore-kLpZWR-_.js"),__vite__mapDeps([10,5]),import.meta.url),h$={overview:Q_,analytics:J_,models:G_,explore:Y_},m$=Y.lazy(()=>Q_().then(e=>({default:e.OverviewTab}))),p$=Y.lazy(()=>J_().then(e=>({default:e.AnalyticsTab}))),g$=Y.lazy(()=>G_().then(e=>({default:e.ModelsTab}))),y$=Y.lazy(()=>Y_().then(e=>({default:e.ExploreTab}))),v$=Y.lazy(()=>Sr(()=>import("./settings-sheet-B7BuJ3j8.js"),__vite__mapDeps([11,1]),import.meta.url).then(e=>({default:e.SettingsSheet}))),tw=e=>{h$[e]()},lp=e=>`/${e}`,X_=Y.createContext(null),wf=()=>{const e=Y.useContext(X_);if(!e)throw new Error("useDashboard outside provider");return e};function S$(){var le,Fe;const{snapshot:e,conn:t}=Kj(),[n,o]=M4(),i=f$(),[c,l]=Y.useState(!1),[d,h]=Y.useState(bn.privacyMode),[p,y]=Y.useState(bn.privacyToggleKey),[g,v]=Y.useState(bn.allowNetworkAccess),[w,S]=Y.useState(bn.resetDisplay),[E,F]=Y.useState("idle"),K=Y.useRef(null),_=Y.useRef(null),L=Y.useRef(null),C=Y.useRef(null),D=Y.useRef(null),$=Y.useCallback(fe=>{L.current=fe,h(C.current??fe.config.privacyMode),y(fe.config.privacyToggleKey),v(fe.config.allowNetworkAccess),S(fe.config.resetDisplay)},[]);Y.useEffect(()=>{if(t==="live")return q_($)},[$,t]);const N=Y.useCallback(()=>{if(K.current)return;D.current&&clearTimeout(D.current),F("refreshing");const fe=Xj().then(()=>F("success")).catch(()=>F("error")).finally(()=>{K.current=null,D.current=setTimeout(()=>F("idle"),3e3)});K.current=fe},[]),T=Y.useCallback(()=>{if(_.current)return;const fe=L.current;if(!fe)return;const ke=!fe.config.privacyMode;C.current=ke,h(ke);const Pe=Jj(fe).then(Ve=>{C.current=null,$(Ve)}).catch(Ve=>{C.current=null;const on=Yj(Ve);$(on??L.current??fe)}).finally(()=>{_.current=null});_.current=Pe.then(()=>{})},[$]);Y.useEffect(()=>{if(t!=="live"||c)return;const fe=ke=>{if(jD(ke,p)){ke.preventDefault(),T();return}Zj(ke)&&(ke.preventDefault(),N())};return window.addEventListener("keydown",fe),()=>window.removeEventListener("keydown",fe)},[t,p,T,N,c]),Y.useEffect(()=>()=>{D.current&&clearTimeout(D.current)},[]);const q=Y.useMemo(()=>o4(e,n),[e,n]),ee=Y.useMemo(()=>d$(q,i.appearance),[q,i.appearance]),ne=((le=Og.find(fe=>fe.key===n.period))==null?void 0:le.label)??n.period,H=n.period==="all"?void 0:ne,k=_F({select:fe=>fe.location.pathname}),U=((Fe=Mx.find(fe=>lp(fe.key)===k))==null?void 0:Fe.key)??"overview";Y.useEffect(()=>{var on;if(!e)return;const fe=new Set(e.providers.map(xn=>xn.id)),ke=new Set(e.accounts.map(xn=>xn.id)),Pe=new Set;for(const xn of e.accounts)for(const Fr of((on=xn.table)==null?void 0:on.monthly)??[])for(const Kr of Fr.breakdown)Pe.add(Kr.name);const Ve=P4(n,{providers:fe,accounts:ke,models:Pe,modelsReady:Pe.size>0});Ve!==n&&o(Ve)},[e,n,o]);const V=(e==null?void 0:e.accounts.filter(fe=>fe.hasUsage))??[],J=V.length>0,B=((e==null?void 0:e.accounts)??[]).some(Xm),X=((e==null?void 0:e.accounts)??[]).some(fe=>fe.hasBilling&&!Xm(fe)),re=J&&V.every(fe=>fe.table!=null),te=Y.useRef(!1);Y.useEffect(()=>{re&&(te.current=!0)},[re]);const[I,Z]=Y.useState(!1);Y.useEffect(()=>{const fe=setTimeout(()=>Z(!0),12e3);return()=>clearTimeout(fe)},[]);const pe=!J||re||te.current||I,me=Y.useMemo(()=>e?{snapshot:e,filters:n,derived:ee,periodLabel:ne,scopeLabel:H,privacyMode:d,resetDisplay:w}:null,[e,n,ee,ne,H,d,w]);return P.jsxs("div",{className:"min-h-screen",children:[P.jsx("button",{type:"button",onClick:E4,className:"fixed left-3 top-3 z-[100] -translate-y-20 rounded bg-bg-2 px-3 py-2 text-sm text-fg-bright shadow-lg transition-transform focus-visible:translate-y-0 focus-visible:outline-none focus-visible:ring-2 focus-visible:ring-accent",children:"Skip to dashboard"}),P.jsxs("header",{className:"relative z-30 border-b border-line bg-bg-0/80 backdrop-blur",children:[P.jsxs("div",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px]",children:[P.jsxs("div",{className:"flex flex-wrap items-center gap-x-4 gap-y-2 py-3.5",children:[P.jsx("h1",{className:"font-display text-2xl text-fg-bright",children:"TOKMON"}),P.jsxs("span",{className:"hidden text-sm text-fg-faint sm:inline",children:["~/usage ",P.jsx("span",{className:"text-prompt",children:"$"})," ",P.jsx("span",{className:"text-fg-dim",children:U}),P.jsx("span",{className:"cursor-blink text-accent",children:"▋"})]}),P.jsxs("div",{className:"ml-auto flex min-w-0 items-center gap-3",children:[(e==null?void 0:e.peak)&&P.jsx(b4,{peak:e.peak,resetDisplay:w,tz:e.tz}),P.jsx(k4,{conn:t,freshAt:(e==null?void 0:e.generatedAt)??null}),t==="live"&&P.jsx(C4,{phase:E,onRefresh:N}),t==="live"&&P.jsx(_4,{onOpen:()=>l(!0)}),P.jsx(w4,{mode:i.appearance.mode,resolvedMode:i.resolved.mode,disabled:!i.ready||i1(i.appearance.preset),onToggle:()=>{i.toggleMode()}}),pe&&(J||B)&&P.jsx(S4,{derived:ee,periodLabel:ne,tz:(e==null?void 0:e.tz)??"",version:(e==null?void 0:e.version)??""})]})]}),P.jsx("nav",{className:"-mb-px flex items-center gap-1 overflow-x-auto","aria-label":"Dashboard sections",children:Mx.map(fe=>P.jsx(Sp,{to:lp(fe.key),"aria-current":U===fe.key?"page":void 0,onMouseEnter:()=>tw(fe.key),onFocus:()=>tw(fe.key),className:`relative shrink-0 border-b-2 px-3 py-2 font-display text-xs uppercase tracking-wider transition focus-visible:outline-none focus-visible:ring-1 focus-visible:ring-inset focus-visible:ring-accent ${U===fe.key?"border-accent text-fg-bright":"border-transparent text-fg-faint hover:text-fg-dim"}`,children:fe.label},fe.key))})]}),P.jsx(p4,{snapshot:e,derived:ee,filters:n,setFilters:o,privacyMode:d})]}),P.jsxs("main",{id:"dashboard-content",tabIndex:-1,className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-5 focus:outline-none",children:[g&&P.jsx("div",{className:"mb-4 rounded border border-critical/60 bg-critical/10 px-3 py-2 text-xs text-critical",role:"alert",children:"Unsafe network access is enabled. This dashboard may be reachable from your LAN after the daemon restarts."}),e&&t!=="live"&&P.jsx("div",{className:"mb-4 rounded border border-line bg-bg-1 px-3 py-2 text-xs text-fg-dim",role:"status","aria-live":"polite",children:Gh(t,"Reconnecting…")}),(e==null?void 0:e.seeded)&&P.jsxs("div",{className:"mb-4 flex items-center gap-2 rounded border border-line bg-bg-1 px-3 py-1.5 text-xs text-fg-dim",role:"status","aria-live":"polite",children:[P.jsx("span",{className:"inline-flex size-2 rounded-full",style:{background:"var(--color-cost)"},"aria-hidden":!0}),"showing cached data — refreshing…"]}),e?!J&&!B?X&&!I&&t!=="error"?P.jsx(Jh,{label:"reading billing…"}):P.jsx("div",{className:"rounded-md border border-line bg-bg-1 p-8 text-center text-sm text-fg-dim",children:"No providers detected. Open tokmon, enable a provider, then refresh."}):!pe||!me?P.jsx(Jh,{label:Gh(t,"reading usage history…")}):P.jsx(X_.Provider,{value:me,children:P.jsx(s1,{})}):P.jsx(Jh,{label:Gh(t,"reading usage…")})]}),P.jsxs("footer",{className:"mx-auto max-w-[1600px] px-5 2xl:max-w-[1920px] py-6 text-center text-[11px] text-fg-faint",children:["tokmon",e!=null&&e.version?` v${e.version}`:""," · by David Ilie · live LLM usage dashboard"]}),c?P.jsx(Y.Suspense,{fallback:P.jsx("div",{className:"fixed inset-0 z-[60] grid place-items-center bg-bg-0/70 text-sm text-fg-dim",role:"status","aria-live":"polite",children:"Opening settings…"}),children:P.jsx(v$,{snapshot:e,onClose:()=>l(!1)})}):null]})}function nw(){const{derived:e,periodLabel:t,scopeLabel:n,snapshot:o,privacyMode:i,resetDisplay:c}=wf();return P.jsx(Y.Suspense,{fallback:P.jsx(kf,{label:"overview"}),children:P.jsx(m$,{derived:e,periodLabel:t,scopeLabel:n,providers:o.providers,privacyMode:i,resetDisplay:c,tz:o.tz})})}function x$(){const{derived:e,scopeLabel:t}=wf();return P.jsx(Y.Suspense,{fallback:P.jsx(kf,{label:"analytics"}),children:P.jsx(p$,{derived:e,scopeLabel:t})})}function w$(){const{derived:e,scopeLabel:t}=wf();return P.jsx(Y.Suspense,{fallback:P.jsx(kf,{label:"models"}),children:P.jsx(g$,{derived:e,scopeLabel:t})})}function k$(){const{snapshot:e,filters:t,periodLabel:n,privacyMode:o}=wf();return P.jsx(Y.Suspense,{fallback:P.jsx(kf,{label:"explore"}),children:P.jsx(y$,{snapshot:e,filters:t,periodLabel:n,privacyMode:o})})}function kf({label:e}){return P.jsxs("div",{className:"min-h-[50vh] content-center text-center text-sm text-fg-faint",role:"status","aria-live":"polite",children:["Loading ",e,"…"]})}const fp=aF({component:S$}),Du=(e,t)=>t1({getParentRoute:()=>fp,path:lp(e),component:t}),E$=fp.addChildren([t1({getParentRoute:()=>fp,path:"/",component:nw}),Du("overview",nw),Du("analytics",x$),Du("models",w$),Du("explore",k$)]),_$=xF({routeTree:E$,history:gP(),defaultViewTransition:!0});function C$(){return P.jsx(EF,{router:_$})}const rw="tokmon.preloadReloadAt",b$=3e4;function P$(e,t){return!Number.isFinite(e)||t-e>=b$}function F$(){const e=t=>{t.preventDefault();let n=Number.NaN;try{n=Number(window.sessionStorage.getItem(rw))}catch{}const o=Date.now();if(P$(n,o)){try{window.sessionStorage.setItem(rw,String(o))}catch{}window.location.reload()}};return window.addEventListener("vite:preloadError",e),()=>window.removeEventListener("vite:preloadError",e)}F$();o2.createRoot(document.getElementById("root")).render(P.jsx(Y.StrictMode,{children:P.jsx(I2,{children:P.jsx(l$,{children:P.jsx(v4,{children:P.jsx(C$,{})})})})}));export{L$ as $,JD as A,YD as B,y6 as C,Lg as D,R6 as E,_r as F,g6 as G,P_ as H,d6 as I,y4 as J,i4 as K,E6 as L,p6 as M,v6 as N,SS as O,Ix as P,$$ as Q,Ra as R,F6 as S,a6 as T,Ru as U,j$ as V,U$ as W,c4 as X,WF as Y,KF as Z,Sr as _,K_ as a,o6 as a0,S6 as a1,N$ as a2,O$ as a3,A$ as a4,P6 as a5,a4 as a6,b6 as a7,C6 as a8,d4 as a9,R$ as aA,D$ as aa,_6 as ab,M$ as ac,T6 as ad,k6 as ae,tr as af,$F as ag,d1 as ah,T$ as ai,f1 as aj,M6 as ak,i1 as al,pS as am,FF as an,PF as ao,wp as ap,nr as aq,V$ as ar,Qj as as,q_ as at,cp as au,_p as av,r$ as aw,W_ as ax,x6 as ay,w6 as az,l6 as b,f6 as c,A6 as d,XF as e,c6 as f,B$ as g,Px as h,h4 as i,P as j,WD as k,m6 as l,u6 as m,m4 as n,KD as o,i6 as p,Pl as q,Y as r,z$ as s,Fl as t,f$ as u,I6 as v,BD as w,Yb as x,h6 as y,C_ as z};
|